From 65576af120887470a6f063f67fa230ece9efdb05 Mon Sep 17 00:00:00 2001 From: xolatile Date: Mon, 9 Oct 2023 23:27:39 -0400 Subject: [PATCH] Core armour implementation... --- xabina.adb | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/xabina.adb b/xabina.adb index 3b874ea..bcfb89e 100644 --- a/xabina.adb +++ b/xabina.adb @@ -236,8 +236,8 @@ function xabina return integer is type weapon_constant_type is new entity_constant_type with record dual_wield : boolean := false; - weight : natural := 0; value : natural := 0; + weight : natural := 0; attack_range : integer_subrange := (0, 0); defense_range : integer_subrange := (0, 0); distance_range : integer_subrange := (0, 0); @@ -270,6 +270,42 @@ function xabina return integer is -- Armour ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + type armour_list is ( + IRON_HELMET, IRON_CHESTPLATE, IRON_GAUNTLETS, IRON_GREAVES, IRON_CUISSE, IRON_FAULD, IRON_GARDBRACE, IRON_REREBRACE + ); + + type armour_mark is mod 72; + + type armour_constant_type is new entity_constant_type with + record + value : natural := 0; + weight : natural := 0; + defense_range : integer_subrange := (0, 0); + -- description : unbounded_string := null_unbounded_string; + end record; + + type armour_variable_type is new entity_variable_type with + record + enchantment : natural := 0; + condition : natural := 0; + end record; + + type armour_constant_list is array (armour_list) of armour_constant_type; + type armour_variable_list is array (armour_mark) of armour_variable_type; + + armour_constant_data : constant armour_constant_list := ( + (ENTITY_ARMOUR, to_unbounded_string ("Iron Helmet"), 'm', COLOUR_YELLOW, EFFECT_NORMAL, 11, 31, (3, 7)), + (ENTITY_ARMOUR, to_unbounded_string ("Iron Chestplate"), 'M', COLOUR_YELLOW, EFFECT_BOLD, 23, 67, (5, 11)), + (ENTITY_ARMOUR, to_unbounded_string ("Iron Gauntlets"), 'i', COLOUR_YELLOW, EFFECT_NORMAL, 13, 43, (1, 7)), + (ENTITY_ARMOUR, to_unbounded_string ("Iron Greaves"), 'I', COLOUR_YELLOW, EFFECT_NORMAL, 19, 73, (6, 13)), + (ENTITY_ARMOUR, to_unbounded_string ("Iron Cuisse"), 'Y', COLOUR_YELLOW, EFFECT_BOLD, 17, 53, (4, 10)), + (ENTITY_ARMOUR, to_unbounded_string ("Iron Fauld"), '-', COLOUR_YELLOW, EFFECT_NORMAL, 13, 37, (0, 3)), + (ENTITY_ARMOUR, to_unbounded_string ("Iron Gardbrace"), 'v', COLOUR_YELLOW, EFFECT_NORMAL, 11, 41, (3, 8)), + (ENTITY_ARMOUR, to_unbounded_string ("Iron Rerebrace"), 'V', COLOUR_YELLOW, EFFECT_NORMAL, 13, 47, (4, 7)) + ); + + armour_variable_data : armour_variable_list; + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -- Scroll ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -345,6 +381,18 @@ begin put_line (" " & to_string (item_constant_data (this).name)); end loop; + for this in weapon_list + loop + x := x + render_character (weapon_constant_data (this).symbol, weapon_constant_data (this).colour, weapon_constant_data (this).effect); + put_line (" " & to_string (weapon_constant_data (this).name)); + end loop; + + for this in armour_list + loop + x := x + render_character (armour_constant_data (this).symbol, armour_constant_data (this).colour, armour_constant_data (this).effect); + put_line (" " & to_string (armour_constant_data (this).name)); + end loop; + return 0; end xabina;