Core armour implementation...

This commit is contained in:
Ognjen Milan Robovic 2023-10-09 23:27:39 -04:00
parent d4f4ac8530
commit 65576af120

View File

@ -236,8 +236,8 @@ function xabina return integer is
type weapon_constant_type is new entity_constant_type with type weapon_constant_type is new entity_constant_type with
record record
dual_wield : boolean := false; dual_wield : boolean := false;
weight : natural := 0;
value : natural := 0; value : natural := 0;
weight : natural := 0;
attack_range : integer_subrange := (0, 0); attack_range : integer_subrange := (0, 0);
defense_range : integer_subrange := (0, 0); defense_range : integer_subrange := (0, 0);
distance_range : integer_subrange := (0, 0); distance_range : integer_subrange := (0, 0);
@ -270,6 +270,42 @@ function xabina return integer is
-- Armour -- 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 -- Scroll
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@ -345,6 +381,18 @@ begin
put_line (" " & to_string (item_constant_data (this).name)); put_line (" " & to_string (item_constant_data (this).name));
end loop; 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; return 0;
end xabina; end xabina;