From fede5c4bbfb692d101d604c793bb26d59e6cb2df Mon Sep 17 00:00:00 2001 From: xolatile Date: Tue, 10 Oct 2023 13:58:50 -0400 Subject: [PATCH] Core ammunition implementation... --- xabina.adb | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/xabina.adb b/xabina.adb index 5255bae..518d7e5 100644 --- a/xabina.adb +++ b/xabina.adb @@ -257,6 +257,40 @@ function xabina return integer is -- Ammunition ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + type ammunition_list is ( + ARROWS, BOLTS, SLINGSHOTS, JARIDS + ); + + type ammunition_mark is mod 72; + + type ammunition_constant_type is new entity_constant_type with + record + value : natural := 0; + weight : natural := 0; + dual_wield : boolean := false; + amount_limit : natural := 0; + attack_range : natural_subrange := (0, 0); + distance_range : natural_subrange := (0, 0); + end record; + + type ammunition_variable_type is new entity_variable_type with + record + amount : natural_subrange := (0, 0); + enchantment : natural := 0; + end record; + + type ammunition_constant_list is array (ammunition_list) of ammunition_constant_type; + type ammunition_variable_list is array (ammunition_mark) of ammunition_variable_type; + + ammunition_constant_data : constant ammunition_constant_list := ( + (ENTITY_AMMUNITION, to_unbounded_string ("Arrows"), '^', COLOUR_RED, EFFECT_NORMAL, 11, 13, false, 23, (0, 7), (17, 67)), + (ENTITY_AMMUNITION, to_unbounded_string ("Bolts"), '^', COLOUR_RED, EFFECT_NORMAL, 13, 23, false, 29, (0, 5), (17, 67)), + (ENTITY_AMMUNITION, to_unbounded_string ("Slingshots"), '^', COLOUR_RED, EFFECT_NORMAL, 5, 7, true, 43, (0, 7), (17, 67)), + (ENTITY_AMMUNITION, to_unbounded_string ("Jarids"), '^', COLOUR_RED, EFFECT_NORMAL, 29, 37, true, 7, (0, 7), (17, 67)) + ); + + ammunition_variable_data : ammunition_variable_list; + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -- Weapon ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -407,12 +441,24 @@ function xabina return integer is begin + for this in magic_list + loop + x := x + render_character (magic_constant_data (this).symbol, magic_constant_data (this).colour, magic_constant_data (this).effect); + put_line (" " & to_string (magic_constant_data (this).name)); + end loop; + for this in item_list loop x := x + render_character (item_constant_data (this).symbol, item_constant_data (this).colour, item_constant_data (this).effect); put_line (" " & to_string (item_constant_data (this).name)); end loop; + for this in ammunition_list + loop + x := x + render_character (ammunition_constant_data (this).symbol, ammunition_constant_data (this).colour, ammunition_constant_data (this).effect); + put_line (" " & to_string (ammunition_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);