aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhongheng Liu <z.liu@outlook.com.gr>2024-10-23 23:26:20 +0300
committerZhongheng Liu <z.liu@outlook.com.gr>2024-10-23 23:26:20 +0300
commit4ee1a32e4e593f036f1fc051c0dfce40ac69dd66 (patch)
treeba710cbd6b24eb113e90f96b526e3a8d9bedad28
parentdc16793ad7548cb6e7cd43139566db8b6d138824 (diff)
downloadrulmarc-tui.tar.gz
rulmarc-tui.tar.bz2
rulmarc-tui.zip
feat: some typedefs for the RP in the RPGHEADtuimainllm_dev
-rw-r--r--data/objects.json3
-rw-r--r--utils/types/objects.go58
2 files changed, 61 insertions, 0 deletions
diff --git a/data/objects.json b/data/objects.json
new file mode 100644
index 0000000..0db3279
--- /dev/null
+++ b/data/objects.json
@@ -0,0 +1,3 @@
+{
+
+}
diff --git a/utils/types/objects.go b/utils/types/objects.go
new file mode 100644
index 0000000..a2fd941
--- /dev/null
+++ b/utils/types/objects.go
@@ -0,0 +1,58 @@
+package types
+
+func InitObjects() {
+ WEAPON_OLD_FAMILY_SWORD := Weapon{
+ name: "Mjorrsword",
+ atk: 10,
+ meta: WeaponMetadata{
+ info: "The Mjorrsword is an old sword, a legacy in your family. \nLast used in the Fjolrholmer Revolution, it is now yours to hold on to.",
+ }
+ }
+}
+
+type Inventory struct {
+ weapons []Weapon
+ foods []Food
+ potions []Potion
+}
+type Player struct {
+ name string
+ inventory Inventory
+ effects []Effect
+ wallet []Currency
+}
+
+type WeaponMetadata struct {
+ info string
+}
+
+type Weapon struct {
+ name string
+ atk int
+ meta WeaponMetadata
+}
+
+type Food struct {
+ name string
+ regen_health int
+}
+type Effect struct {
+ name string
+ effect func(p *Player)
+}
+
+type Potion struct {
+ name string
+ effect Effect
+}
+
+type Currency struct {
+ name string
+ prefix string
+ value int
+ amount int
+}
+
+type Consumable interface {
+ Food | Potion
+}