overhaul: data-driven architecture

This commit is contained in:
Llywelwyn 2023-07-25 03:50:50 +01:00
parent 062d36f640
commit f53b767376
19 changed files with 680 additions and 727 deletions

View file

126
raws/items.json Normal file
View file

@ -0,0 +1,126 @@
[
{
"id": "potion_health",
"name": { "name": "potion of health", "plural": "potions of health" },
"renderable": { "glyph": "!", "fg": "#FF00FF", "bg": "#000000", "order": 2 },
"flags": ["CONSUMABLE", "DESTRUCTIBLE"],
"effects": { "provides_healing": "12" }
},
{
"id": "potion_health_weak",
"name": { "name": "potion of lesser health", "plural": "potions of lesser health" },
"renderable": { "glyph": "!", "fg": "#FF00FF", "bg": "#000000", "order": 2 },
"flags": ["CONSUMABLE", "DESTRUCTIBLE"],
"effects": { "provides_healing": "6" }
},
{
"id": "scroll_magicmissile",
"name": { "name": "scroll of magic missile", "plural": "scrolls of magic missile" },
"renderable": { "glyph": "?", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
"flags": ["CONSUMABLE", "DESTRUCTIBLE"],
"effects": { "ranged": "12", "damage": "10" }
},
{
"id": "scroll_fireball",
"name": { "name": "scroll of fireball", "plural": "scrolls of fireball" },
"renderable": { "glyph": "?", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
"flags": ["CONSUMABLE", "DESTRUCTIBLE"],
"effects": { "ranged": "10", "damage": "15", "aoe": "3" }
},
{
"id": "scroll_fireball_cursed",
"name": { "name": "cursed scroll of fireball", "plural": "cursed scrolls of fireball" },
"renderable": { "glyph": "?", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
"flags": ["CONSUMABLE", "DESTRUCTIBLE", "CURSED"],
"effects": { "ranged": "10", "damage": "15", "aoe": "3" }
},
{
"id": "scroll_confusion",
"name": { "name": "scroll of confusion", "plural": "scrolls of confusion" },
"renderable": { "glyph": "?", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
"flags": ["CONSUMABLE", "DESTRUCTIBLE"],
"effects": { "ranged": "10", "confusion": "4" }
},
{
"id": "scroll_magicmap",
"name": { "name": "scroll of magic mapping", "plural": "scrolls of magic mapping" },
"renderable": { "glyph": "?", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
"flags": ["CONSUMABLE", "DESTRUCTIBLE"],
"effects": { "magicmapper": "" }
},
{
"id": "scroll_magicmap_cursed",
"name": { "name": "scroll of magic mapping", "plural": "scrolls of magic mapping" },
"renderable": { "glyph": "?", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
"flags": ["CONSUMABLE", "DESTRUCTIBLE", "CURSED"],
"effects": { "magicmapper": "" }
},
{
"id": "equip_dagger",
"name": { "name": "dagger", "plural": "daggers" },
"renderable": { "glyph": ")", "fg": "#808080", "bg": "#000000", "order": 2 },
"flags": ["EQUIP_MELEE"],
"effects": { "melee_power_bonus": "1" }
},
{
"id": "equip_shortsword",
"name": { "name": "shortsword", "plural": "shortswords" },
"renderable": { "glyph": ")", "fg": "#C0C0C0", "bg": "#000000", "order": 2 },
"flags": ["EQUIP_MELEE"],
"effects": { "melee_power_bonus": "2" }
},
{
"id": "equip_smallshield",
"name": { "name": "buckler", "plural": "bucklers" },
"renderable": { "glyph": "[", "fg": "#808080", "bg": "#000000", "order": 2 },
"flags": ["EQUIP_SHIELD"],
"effects": { "defence_bonus": "1" }
},
{
"id": "equip_mediumshield",
"name": { "name": "medium shield", "plural": "medium shield" },
"renderable": { "glyph": "[", "fg": "#C0C0C0", "bg": "#000000", "order": 2 },
"flags": ["EQUIP_SHIELD"],
"effects": { "defence_bonus": "2", "melee_power_bonus": "-1" }
},
{
"id": "wand_magicmissile",
"name": { "name": "wand of magic missile", "plural": "wands of magic missile" },
"renderable": { "glyph": "/", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
"flags": ["WAND"],
"effects": { "ranged": "12", "damage": "10" }
},
{
"id": "wand_fireball",
"name": { "name": "wand of fireball", "plural": "wands of fireball" },
"renderable": { "glyph": "/", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
"flags": ["WAND"],
"effects": { "ranged": "10", "damage": "15", "aoe": "3" }
},
{
"id": "wand_confusion",
"name": { "name": "wand of confusion", "plural": "wands of confusion" },
"renderable": { "glyph": "/", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
"flags": ["WAND"],
"effects": { "ranged": "10", "confusion": "4" }
},
{
"id": "wand_digging",
"name": { "name": "wand of digging", "plural": "wands of digging" },
"renderable": { "glyph": "/", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
"flags": ["WAND"],
"effects": { "ranged": "10", "digger": "" }
},
{
"id": "food_rations",
"name": { "name": "rations", "plural": "rations" },
"renderable": { "glyph": "%", "fg": "#FFA07A", "bg": "#000000", "order": 2 },
"flags": ["FOOD", "CONSUMABLE"]
},
{
"id": "food_apple",
"name": { "name": "apple", "plural": "apples" },
"renderable": { "glyph": "%", "fg": "#008000", "bg": "#000000", "order": 2 },
"flags": ["FOOD", "CONSUMABLE"]
}
]

26
raws/mobs.json Normal file
View file

@ -0,0 +1,26 @@
[
{
"id": "orc",
"name": "orc",
"renderable": { "glyph": "o", "fg": "#00FF00", "bg": "#000000", "order": 1 },
"flags": ["BLOCKS_TILE"],
"stats": { "max_hp": 8, "hp": 8, "defence": 0, "power": 3 },
"vision_range": 12
},
{
"id": "goblin",
"name": "goblin",
"renderable": { "glyph": "g", "fg": "#00FF00", "bg": "#000000", "order": 1 },
"flags": ["BLOCKS_TILE"],
"stats": { "max_hp": 6, "hp": 6, "defence": 0, "power": 2 },
"vision_range": 12
},
{
"id": "goblin_chieftain",
"name": "goblin chieftain",
"renderable": { "glyph": "G", "fg": "#00FF00", "bg": "#000000", "order": 1 },
"flags": ["BLOCKS_TILE"],
"stats": { "max_hp": 8, "hp": 8, "defence": 0, "power": 3 },
"vision_range": 12
}
]

22
raws/props.json Normal file
View file

@ -0,0 +1,22 @@
[
{
"id": "door",
"name": "door",
"renderable": { "glyph": "+", "fg": "#00FFFF", "bg": "#000000", "order": 2 },
"flags": ["BLOCKS_TILE", "BLOCKS_VISIBILITY", "DOOR"]
},
{
"id": "trap_bear",
"name": "bear trap",
"renderable": { "glyph": "^", "fg": "#C0C0C0", "bg": "#000000", "order": 2 },
"flags": ["HIDDEN", "ENTRY_TRIGGER", "SINGLE_ACTIVATION"],
"effects": { "damage": "6" }
},
{
"id": "trap_confusion",
"name": "magic trap",
"renderable": { "glyph": "^", "fg": "#800080", "bg": "#000000", "order": 2 },
"flags": ["HIDDEN", "ENTRY_TRIGGER", "SINGLE_ACTIVATION"],
"effects": { "confusion": "3" }
}
]

57
raws/spawn_tables.json Normal file
View file

@ -0,0 +1,57 @@
[
{
"id": "equipment",
"table": [
{ "id": "equip_dagger", "weight": 4, "min": 0, "max": 100 },
{ "id": "equip_shortsword", "weight": 2, "min": 0, "max": 100 },
{ "id": "equip_smallshield", "weight": 4, "min": 0, "max": 100 },
{ "id": "equip_mediumshield", "weight": 2, "min": 0, "max": 100 }
]
},
{
"id": "potions",
"table": [
{ "id": "potion_health_weak", "weight": 6, "min": 0, "max": 100 },
{ "id": "potion_health", "weight": 3, "min": 0, "max": 100 }
]
},
{
"id": "scrolls",
"table": [
{ "id": "scroll_fireball", "weight": 2, "min": 0, "max": 100 },
{ "id": "scroll_confusion", "weight": 2, "min": 0, "max": 100 },
{ "id": "scroll_magicmap", "weight": 2, "min": 0, "max": 100 }
]
},
{
"id": "wands",
"table": [
{ "id": "wand_magicmissile", "weight": 1, "min": 0, "max": 100 },
{ "id": "wand_fireball", "weight": 1, "min": 0, "max": 100 },
{ "id": "wand_confusion", "weight": 1, "min": 0, "max": 100 },
{ "id": "wand_digging", "weight": 1, "min": 0, "max": 100 }
]
},
{
"id": "food",
"table": [
{ "id": "food_rations", "weight": 1, "min": 0, "max": 100 },
{ "id": "food_apple", "weight": 1, "min": 0, "max": 100 }
]
},
{
"id": "mobs",
"table": [
{ "id": "goblin", "weight": 6, "min": 0, "max": 100 },
{ "id": "orc", "weight": 2, "min": 0, "max": 100 },
{ "id": "goblin_chieftain", "weight": 1, "min": 0, "max": 100 }
]
},
{
"id": "traps",
"table": [
{ "id": "trap_bear", "weight": 2, "min": 0, "max": 100 },
{ "id": "trap_confusion", "weight": 1, "min": 0, "max": 100 }
]
}
]

View file

@ -1,180 +0,0 @@
{
"items": [
{
"name": "potion of health",
"renderable": {
"glyph": "!",
"fg": "#FF00FF",
"bg": "#000000",
"order": 2
},
"consumable": {
"effects": { "provides_healing": "8" }
}
},
{
"name": "potion of greater health",
"renderable": {
"glyph": "!",
"fg": "#FF00FF",
"bg": "#000000",
"order": 2
},
"consumable": {
"effects": { "provides_healing": "16" }
}
},
{
"name": "potion of superior health",
"renderable": {
"glyph": "!",
"fg": "#FF00FF",
"bg": "#000000",
"order": 2
},
"consumable": {
"effects": { "provides_healing": "32" }
}
},
{
"name": "scroll of magic missile",
"renderable": {
"glyph": "?",
"fg": "#00FFFF",
"bg": "#000000",
"order": 2
},
"consumable": {
"effects": {
"ranged": "12",
"damage": "10"
}
}
},
{
"name": "scroll of fireball",
"renderable": {
"glyph": "?",
"fg": "#FFA500",
"bg": "#000000",
"order": 2
},
"consumable": {
"effects": {
"ranged": "10",
"damage": "20",
"aoe": "3"
}
}
},
{
"name": "scroll of confusion",
"renderable": {
"glyph": "?",
"fg": "#A020F0",
"bg": "#000000",
"order": 2
},
"consumable": {
"effects": {
"ranged": "10",
"confusion": "4"
}
}
},
{
"name": "scroll of magic mapping",
"renderable": {
"glyph": "?",
"fg": "#4169E1",
"bg": "#000000",
"order": 2
},
"consumable": {
"effects": {
"magic_mapping": ""
}
}
},
{
"name": "rations",
"renderable": {
"glyph": "%",
"fg": "#FFA07A",
"bg": "#000000",
"order": 2
},
"consumable": {
"effects": {
"food": ""
}
}
},
{
"name": "dagger",
"renderable": {
"glyph": ")",
"fg": "#BEBEBE",
"bg": "#000000",
"order": 2
},
"weapon": {
"range": "melee",
"power_bonus": 1
}
},
{
"name": "shortsword",
"renderable": {
"glyph": ")",
"fg": "#D3D3D3",
"bg": "#000000",
"order": 2
},
"weapon": {
"range": "melee",
"power_bonus": 2
}
},
{
"name": "buckler",
"renderable": {
"glyph": "[",
"fg": "#BEBEBE",
"bg": "#000000",
"order": 2
},
"shield": {
"defence_bonus": 1
}
},
{
"name": "medium shield",
"renderable": {
"glyph": "[",
"fg": "#BEBEBE",
"bg": "#000000",
"order": 2
},
"shield": {
"power_bonus": -1,
"defence_bonus": 1
}
},
{
"name": "large shield",
"renderable": {
"glyph": "[",
"fg": "#F5F5F5",
"bg": "#000000",
"order": 2
},
"shield": {
"power_bonus": -2,
"defence_bonus": 3
}
}
],
"mobs": [],
"props": []
}