Reworked the way that entities are loaded so they're more dynamic and can be configured without modifying C++code.

This commit is contained in:
Zed A. Shaw 2025-01-08 16:09:22 -05:00
parent 1f7214fcd4
commit 9ce4fbd552
6 changed files with 94 additions and 42 deletions

View file

@ -5,8 +5,12 @@
"foreground": [24, 205, 189],
"background": [230, 20, 120],
"description": "A torch that barely lights the way. You wonder if it'd be better to not see the person who murders you.",
"type": "LIGHT",
"display": "\u0f08"
"inventory_count": 1,
"components": [
{"type": "LightSource", "config": {"strength": 70, "radius": 2.0}},
{"type": "Tile", "config": {"chr": "\u0f08"}},
{"type": "Weapon", "config": {"damage": 35}}
]
},
"SWORD_RUSTY": {
"id": "SWORD_RUSTY",
@ -14,8 +18,24 @@
"foreground": [24, 205, 189],
"background": [24, 205, 189],
"description": "A sword left to rot in a deep hole where it acquired a patina of dirt and tetanus. You aren't sure if it's more deadly for you to hold it or for the people you stab with it.",
"type": "WEAPON",
"display":"\u1e37"
"inventory_count": 1,
"components": [
{"type": "Weapon", "config": {"damage": 15}},
{"type": "Tile", "config": {"chr": "\u1e37"}}
]
},
"SWORD_LIGHT_AND_FLAME": {
"id": "SWORD_LIGHT_AND_FLAME",
"name": "Sword of Light and Flame",
"foreground": [24, 205, 189],
"background": [24, 205, 189],
"description": "A sword so powerful, a great man from the Land of The Rising Sun thrust it into the ocean of Nerf to chill its effects.",
"inventory_count": 1,
"components": [
{"type": "LightSource", "config": {"strength": 70, "radius": 1.8}},
{"type": "Tile", "config": {"chr": "\u0236"}},
{"type": "Weapon", "config": {"damage": 30}}
]
},
"CHEST_SMALL": {
"id": "CHEST_SMALL",
@ -23,8 +43,11 @@
"foreground": [24, 205, 189],
"background": [24, 205, 189],
"description": "A small chest of gold. You wonder who would leave something like this around.",
"type": "LOOT",
"display":"\uaaea"
"components": [
{"type": "Tile", "config": {"chr": "\uaaea"}},
{"type": "Loot", "config": {"amount": 10}}
],
"inventory_count": 1
},
"WALL_TORCH": {
"id": "WALL_TORCH",
@ -32,7 +55,11 @@
"foreground": [24, 205, 189],
"background": [24, 205, 189],
"description": "A torch on a wall you can't pick up.",
"type": "FIXED_LIGHT",
"inventory_count": 0,
"components": [
{"type": "Tile", "config": {"chr": "\u06bf"}},
{"type": "LightSource", "config": {"strength": 60, "radius": 1.8}}
],
"display": "☀"
}
}