diff --git a/assets/devices.json b/assets/devices.json index f4e86f2..5a464a4 100644 --- a/assets/devices.json +++ b/assets/devices.json @@ -3,39 +3,48 @@ "id": "STAIRS_DOWN", "name": "Stairs Down", "placement": "fixed", - "foreground": [24, 205, 189], - "background": [24, 205, 189], "description": "Stairs that go down further into the dungeon.", "inventory_count": 0, "randomized": false, "components": [ - {"_type": "Tile", "chr": "\u2ac5"}, - {"_type": "Device", "test": true, "events": ["Events::GUI::STAIRS_DOWN"]} + {"_type": "Tile", "chr": "\u2ac5", + "foreground": [24, 205, 189], + "background": [24, 205, 189] + }, + {"_type": "Device", + "config": {"test": true}, + "events": ["Events::GUI::STAIRS_DOWN"]} ] }, "STAIRS_UP": { "id": "STAIRS_UP", "name": "Stairs Up", - "foreground": [24, 205, 189], - "background": [24, 205, 189], "description": "Stairs that go up, for the weak.", "inventory_count": 0, "placement": "fixed", "components": [ - {"_type": "Tile", "chr": "\u2259"}, - {"_type": "Device", "test": true, "events": ["Events::GUI::STAIRS_UP"]} + {"_type": "Tile", "chr": "\u2259", + "foreground": [24, 205, 189], + "background": [24, 205, 189] + }, + {"_type": "Device", + "config": {"test": true}, + "events": ["Events::GUI::STAIRS_UP"]} ] }, "SPIKE_TRAP": { "id": "SPIKE_TRAP", "name": "Spike trap", - "foreground": [24, 205, 189], - "background": [24, 205, 189], "description": "Spikes stab you from the floor.", "inventory_count": 0, "components": [ - {"_type": "Tile", "chr": "\u1ac7"}, - {"_type": "Device", "test": true, "events": ["Events::GUI::TRAP"]} + {"_type": "Tile", "chr": "\u1ac7", + "foreground": [24, 205, 189], + "background": [24, 205, 189] + }, + {"_type": "Device", + "config": {"test": true}, + "events": ["Events::GUI::TRAP"]} ] } } diff --git a/assets/enemies.json b/assets/enemies.json index 60c0bcc..91b112f 100644 --- a/assets/enemies.json +++ b/assets/enemies.json @@ -1,21 +1,23 @@ { "PLAYER_TILE": { - "foreground": [255, 200, 125], - "background": [30, 20, 75], "components": [ - {"_type": "Tile", "chr": "\ua66b"}, - {"_type": "Combat", "hp": 200, "damage": 15}, + {"_type": "Tile", "chr": "\ua66b", + "foreground": [255, 200, 125], + "background": [30, 20, 75] + }, + {"_type": "Combat", "hp": 200, "damage": 15, "dead": false}, {"_type": "Motion", "dx": 0, "dy": 0, "random": false}, {"_type": "LightSource", "strength": 70, "radius": 2}, {"_type": "EnemyConfig", "hearing_distance": 5} ] }, "EVIL_EYE": { - "foreground": [75, 200, 125], - "background": [30, 20, 75], "components": [ - {"_type": "Tile", "chr": "\u08ac"}, - {"_type": "Combat", "hp": 100, "damage": 50}, + {"_type": "Tile", "chr": "\u08ac", + "foreground": [75, 200, 125], + "background": [30, 20, 75] + }, + {"_type": "Combat", "hp": 100, "damage": 50, "dead": false}, {"_type": "Motion", "dx": 0, "dy": 0, "random": false}, {"_type": "EnemyConfig", "hearing_distance": 10} ] diff --git a/assets/items.json b/assets/items.json index f91a367..a5c5284 100644 --- a/assets/items.json +++ b/assets/items.json @@ -2,48 +2,52 @@ "TORCH_BAD": { "id": "TORCH_BAD", "name": "Crappy Torch", - "foreground": [24, 120, 189], - "background": [230,120, 120], "description": "A torch that barely lights the way. You wonder if it'd be better to not see the person who murders you.", "inventory_count": 1, "components": [ {"_type": "LightSource", "strength": 70, "radius": 2.0}, - {"_type": "Tile", "chr": "\u0f08"} + {"_type": "Tile", "chr": "\u0f08", + "foreground": [24, 120, 189], + "background": [230,120, 120] + } ] }, "SWORD_RUSTY": { "id": "SWORD_RUSTY", "name": "Rusty Junk Sword", - "foreground": [24, 120, 189], - "background": [24, 120, 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.", "inventory_count": 1, "components": [ {"_type": "Weapon", "damage": 15}, - {"_type": "Tile", "chr": "\u1e37"} + {"_type": "Tile", "chr": "\u1e37", + "foreground": [24, 120, 189], + "background": [24, 120, 189] + } ] }, "SWORD_LIGHT_AND_FLAME": { "id": "SWORD_LIGHT_AND_FLAME", "name": "Sword of Light and Flame", - "foreground": [24, 205, 210], - "background": [24, 205, 210], "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", "strength": 70, "radius": 1.8}, - {"_type": "Tile", "chr": "\u0236"}, + {"_type": "Tile", "chr": "\u0236", + "foreground": [24, 205, 210], + "background": [24, 205, 210] + }, {"_type": "Weapon", "damage": 30} ] }, "CHEST_SMALL": { "id": "CHEST_SMALL", "name": "Small Chest", - "foreground": [150, 100, 189], - "background": [150, 100, 189], "description": "A small chest of gold. You wonder who would leave something like this around.", "components": [ - {"_type": "Tile", "chr": "\uaaea"}, + {"_type": "Tile", "chr": "\uaaea", + "foreground": [150, 100, 189], + "background": [150, 100, 189] + }, {"_type": "Loot", "amount": 10} ], "inventory_count": 1 @@ -51,24 +55,26 @@ "WALL_TORCH": { "id": "WALL_TORCH", "name": "Basic Wall Torch", - "foreground": [24, 205, 210], - "background": [24, 205, 210], "description": "A torch on a wall you can't pick up.", "inventory_count": 0, "components": [ - {"_type": "Tile", "chr": "\u077e"}, + {"_type": "Tile", "chr": "\u077e", + "foreground": [24, 205, 210], + "background": [24, 205, 210] + }, {"_type": "LightSource", "strength": 60, "radius": 1.8} ] }, "POTION_HEALING_SMALL": { "id": "POTION_HEALING_SMALL", "name": "Small Healing Potion", - "foreground": [255, 205, 189], - "background": [255, 205, 189], "description": "A small healing potion.", "inventory_count": 1, "components": [ - {"_type": "Tile", "chr": "\u03eb"}, + {"_type": "Tile", "chr": "\u03eb", + "foreground": [255, 205, 189], + "background": [255, 205, 189] + }, {"_type": "Curative", "hp": 20} ] } diff --git a/dinky_components.hpp b/dinky_components.hpp index 72cd807..73cf955 100644 --- a/dinky_components.hpp +++ b/dinky_components.hpp @@ -6,7 +6,7 @@ #define ENROLL_COMPONENT(COMPONENT, ...) \ - NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(COMPONENT, __VA_ARGS__); \ + NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(COMPONENT, __VA_ARGS__); \ template <> struct NameOf { \ static constexpr const char *name = #COMPONENT; \ };