From 25ab404c92fdf167217aa595ae5e9fd453a17078 Mon Sep 17 00:00:00 2001 From: xolatile Date: Fri, 26 Apr 2024 16:05:48 -0400 Subject: [PATCH] Autistic naming changes, version 666... --- source/attribute.adb | 12 ++++++------ source/attribute.ads | 8 ++++---- source/chad.adb | 8 ++++---- source/chad.ads | 18 +++++++++--------- source/construction.adb | 10 +++++----- source/construction.ads | 12 ++++++------ source/deity.adb | 4 ++-- source/deity.ads | 8 ++++---- source/effect.adb | 4 ++-- source/effect.ads | 8 ++++---- source/faction.adb | 4 ++-- source/faction.ads | 14 +++++++------- source/item.adb | 8 ++++---- source/item.ads | 36 +++++++++++++++++------------------- source/magic.adb | 14 +++++++------- source/magic.ads | 12 ++++++------ source/might.adb | 14 +++++++------- source/might.ads | 12 ++++++------ source/resource.adb | 12 ++++++------ source/resource.ads | 8 ++++---- source/skill.adb | 12 ++++++------ source/skill.ads | 8 ++++---- source/ui.adb | 16 ++++++++-------- source/ui.ads | 2 +- source/unit.adb | 32 ++++++++++++++++---------------- source/unit.ads | 18 +++++++++--------- source/world.adb | 26 +++++++++++++------------- source/world.ads | 6 +++--- 28 files changed, 172 insertions(+), 174 deletions(-) diff --git a/source/attribute.adb b/source/attribute.adb index 0cd6fbe..29f9fc0 100644 --- a/source/attribute.adb +++ b/source/attribute.adb @@ -8,7 +8,7 @@ package body attribute is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - sprite : array (codex) of core.sprite; + sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------ @@ -16,9 +16,9 @@ package body attribute is begin core.echo (core.comment, "Configuring attribute components..."); -- - for index in codex + for index in enumeration loop - sprite (index) := core.import_sprite ("./sprite/attribute/" & core.lowercase (codex'image (index)) & ".png", 1, 1); + sprite (index) := core.import_sprite ("./sprite/attribute/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1); end loop; end configure; @@ -34,10 +34,10 @@ package body attribute is ui.draw_tiny_menu (move_x, move_y, width, height, true); ui.draw_title_bar (move_x, move_y, width, "Attributes"); -- - for index in codex + for index in enumeration loop - ui.draw_icon (sprite (index), trait (index).text, move_x + offset, move_y + offset + codex'pos (index) * core.icon); - ui.write (trait (index).name, move_x + offset + core.icon, move_y + offset + codex'pos (index) * core.icon); + ui.draw_icon (sprite (index), trait (index).text, move_x + offset, move_y + offset + enumeration'pos (index) * core.icon); + ui.write (trait (index).name, move_x + offset + core.icon, move_y + offset + enumeration'pos (index) * core.icon); end loop; end menu; diff --git a/source/attribute.ads b/source/attribute.ads index 9065b51..38d4b53 100644 --- a/source/attribute.ads +++ b/source/attribute.ads @@ -8,7 +8,7 @@ package attribute is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - type codex is ( + type enumeration is ( offense, defense, wisdom, stamina, speed, reach ); @@ -23,13 +23,13 @@ package attribute is text : core.long_string; end record; - type points is array (codex) of base_limit; + type points is array (enumeration) of base_limit; ------------------------------------------------------------------------------------------ - count : constant natural := codex'pos (codex'last) + 1; + count : constant natural := enumeration'pos (enumeration'last) + 1; - trait : constant array (codex) of information := ( + trait : constant array (enumeration) of information := ( ("Offense ", 0, "- "), ("Defense ", 0, "- "), ("Wisdom ", 0, "- "), diff --git a/source/chad.adb b/source/chad.adb index 067b2b2..566c89d 100644 --- a/source/chad.adb +++ b/source/chad.adb @@ -8,7 +8,7 @@ package body chad is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - sprite : array (codex) of core.sprite; + sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------ @@ -16,16 +16,16 @@ package body chad is begin core.echo (core.comment, "Configuring chad components..."); -- - for index in codex + for index in enumeration loop - --~sprite (index) := core.import_sprite ("./sprite/chad/" & core.lowercase (codex'image (index)) & ".png", 1, 1); + --~sprite (index) := core.import_sprite ("./sprite/chad/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1); null; end loop; end configure; ------------------------------------------------------------------------------------------ - procedure draw (index : in codex; x, y : in integer) is + procedure draw (index : in enumeration; x, y : in integer) is begin core.draw (sprite (index), x, y); end draw; diff --git a/source/chad.ads b/source/chad.ads index 0fd5e0e..5cef101 100644 --- a/source/chad.ads +++ b/source/chad.ads @@ -8,7 +8,7 @@ package chad is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - type codex is ( + type enumeration is ( ada, richard, ognjen, wouter, john, marina ); @@ -17,15 +17,15 @@ package chad is type information is record name : core.short_string; - kind : faction.codex; - bonus_attribute : attribute.codex; - bonus_skill : skill.codex; - bonus_resource : resource.codex; + kind : faction.enumeration; + bonus_attribute : attribute.enumeration; + bonus_skill : skill.enumeration; + bonus_resource : resource.enumeration; end record; type data is record - index : codex; + index : enumeration; attributes : attribute.points; skills : skill.points; resources : resource.points; @@ -33,9 +33,9 @@ package chad is ------------------------------------------------------------------------------------------ - count : constant natural := codex'pos (codex'last) + 1; + count : constant natural := enumeration'pos (enumeration'last) + 1; - trait : constant array (codex) of information := ( + trait : constant array (enumeration) of information := ( ("Ada Augusta King ", faction.fairy, attribute.defense, skill.diplomacy, resource.steel), ("Richard Martin Stallman ", faction.dwarf, attribute.offense, skill.leadership, resource.wood), ("Ognjen Milan Robovic ", faction.gnoll, attribute.stamina, skill.archery, resource.leather), @@ -48,7 +48,7 @@ package chad is procedure configure; - procedure draw (index : in codex; x, y : in integer); + procedure draw (index : in enumeration; x, y : in integer); ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/construction.adb b/source/construction.adb index f08384a..d2f5850 100644 --- a/source/construction.adb +++ b/source/construction.adb @@ -8,7 +8,7 @@ package body construction is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - sprite : array (codex) of core.sprite; + sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------ @@ -16,11 +16,11 @@ package body construction is begin core.echo (core.comment, "Configuring construction components..."); -- - for index in codex + for index in enumeration loop declare - folder : constant string := core.lowercase (faction.codex'image (trait (index).kind)); - file : constant string := core.lowercase (codex'image (index)); + folder : constant string := core.lowercase (faction.enumeration'image (trait (index).kind)); + file : constant string := core.lowercase (enumeration'image (index)); begin sprite (index) := core.import_sprite ("./sprite/construction/" & folder & "/" & file & ".png", trait (index).frames, 1); end; @@ -29,7 +29,7 @@ package body construction is ------------------------------------------------------------------------------------------ - procedure draw (index : in codex; x, y : in integer) is + procedure draw (index : in enumeration; x, y : in integer) is begin core.move (sprite (index), x, y, trait (index).frames, 1); end draw; diff --git a/source/construction.ads b/source/construction.ads index 06378c4..5abaa2a 100644 --- a/source/construction.ads +++ b/source/construction.ads @@ -8,7 +8,7 @@ package construction is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - type codex is ( + type enumeration is ( a, b, c, d, e, f ); @@ -17,17 +17,17 @@ package construction is type information is record name : core.short_string; - kind : faction.codex; + kind : faction.enumeration; price : resource.points; frames : integer; - evoke : effect.codex; + evoke : effect.enumeration; end record; ------------------------------------------------------------------------------------------ - count : constant natural := codex'pos (codex'last) + 1; + count : constant natural := enumeration'pos (enumeration'last) + 1; - trait : constant array (codex) of information := ( + trait : constant array (enumeration) of information := ( ("A ", faction.dwarf, (others => 0), 1, effect.none), ("B ", faction.fairy, (others => 0), 1, effect.none), ("C ", faction.gnoll, (others => 0), 1, effect.none), @@ -40,7 +40,7 @@ package construction is procedure configure; - procedure draw (index : in codex; x, y : in integer); + procedure draw (index : in enumeration; x, y : in integer); ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/deity.adb b/source/deity.adb index 70d955f..ff4c0c2 100644 --- a/source/deity.adb +++ b/source/deity.adb @@ -8,11 +8,11 @@ package body deity is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - sprite : array (codex) of core.sprite; + sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------ - procedure draw (value : in codex; x, y : in integer) is + procedure draw (value : in enumeration; x, y : in integer) is begin null; end draw; diff --git a/source/deity.ads b/source/deity.ads index 691d4e1..f389738 100644 --- a/source/deity.ads +++ b/source/deity.ads @@ -8,7 +8,7 @@ package deity is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - type codex is ( + type enumeration is ( svarog, dabog, svetovid, gozag, ru, xom, sheigarath, ornhul, khuganagoth, vel_sheina, deigehen, geazhul ); @@ -25,9 +25,9 @@ package deity is ------------------------------------------------------------------------------------------ - count : constant natural := codex'pos (codex'last) + 1; + count : constant natural := enumeration'pos (enumeration'last) + 1; - trait : constant array (codex) of information := ( + trait : constant array (enumeration) of information := ( ("Svarog the Lawful ", 3), -- Serbia ("Dabog the Lonely ", -3), ("Svetovid the Awakened ", 0), @@ -44,7 +44,7 @@ package deity is ------------------------------------------------------------------------------------------ - procedure draw (value : in codex; x, y : in integer); + procedure draw (value : in enumeration; x, y : in integer); ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/effect.adb b/source/effect.adb index ab93b4e..272282b 100644 --- a/source/effect.adb +++ b/source/effect.adb @@ -8,11 +8,11 @@ package body effect is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - sprite : array (codex) of core.sprite; + sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------ - procedure draw (value : in codex; x, y : in integer) is + procedure draw (value : in enumeration; x, y : in integer) is begin null; end draw; diff --git a/source/effect.ads b/source/effect.ads index 87c1669..3f214a4 100644 --- a/source/effect.ads +++ b/source/effect.ads @@ -8,7 +8,7 @@ package effect is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - type codex is ( + type enumeration is ( none, one ); @@ -22,16 +22,16 @@ package effect is ------------------------------------------------------------------------------------------ - count : constant natural := codex'pos (codex'last) + 1; + count : constant natural := enumeration'pos (enumeration'last) + 1; - trait : constant array (codex) of information := ( + trait : constant array (enumeration) of information := ( ("- ", true), ("- ", true) ); ------------------------------------------------------------------------------------------ - procedure draw (value : in codex; x, y : in integer); + procedure draw (value : in enumeration; x, y : in integer); ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/faction.adb b/source/faction.adb index c8ba118..fa1faa3 100644 --- a/source/faction.adb +++ b/source/faction.adb @@ -8,11 +8,11 @@ package body faction is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - sprite : array (codex) of core.sprite; + sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------ - procedure draw (value : in codex; x, y : in integer) is + procedure draw (value : in enumeration; x, y : in integer) is begin null; end draw; diff --git a/source/faction.ads b/source/faction.ads index e5f121f..4c5613f 100644 --- a/source/faction.ads +++ b/source/faction.ads @@ -8,7 +8,7 @@ package faction is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - type codex is ( + type enumeration is ( fairy, dwarf, gnoll, kobold, goblin, imp, neutral ); @@ -18,16 +18,16 @@ package faction is type information is record name : core.short_string; - bonus_attribute : attribute.codex; - bonus_skill : skill.codex; - bonus_resource : resource.codex; + bonus_attribute : attribute.enumeration; + bonus_skill : skill.enumeration; + bonus_resource : resource.enumeration; end record; ------------------------------------------------------------------------------------------ - count : constant natural := codex'pos (codex'last) + 1; + count : constant natural := enumeration'pos (enumeration'last) + 1; - trait : constant array (codex) of information := ( + trait : constant array (enumeration) of information := ( ("Fairy Kingdom ", attribute.speed, skill.mysticism, resource.gold), ("Dwarf Kingdom ", attribute.defense, skill.estates, resource.stone), ("Gnoll Kingdom ", attribute.stamina, skill.logistics, resource.leather), @@ -39,7 +39,7 @@ package faction is ------------------------------------------------------------------------------------------ - procedure draw (value : in codex; x, y : in integer); + procedure draw (value : in enumeration; x, y : in integer); ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/item.adb b/source/item.adb index 63e6cf0..00d852a 100644 --- a/source/item.adb +++ b/source/item.adb @@ -8,7 +8,7 @@ package body item is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - sprite : array (codex) of core.sprite; + sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------ @@ -16,11 +16,11 @@ package body item is begin core.echo (core.comment, "Configuring item components..."); -- - for index in codex + for index in enumeration loop declare folder : constant string := core.lowercase (slot'image (trait (index).kind)); - file : constant string := core.lowercase (codex'image (index)); + file : constant string := core.lowercase (enumeration'image (index)); begin sprite (index) := core.import_sprite ("./sprite/item/" & folder & "/" & file & ".png", 1, 1); end; @@ -29,7 +29,7 @@ package body item is ------------------------------------------------------------------------------------------ - procedure draw (index : in codex; x, y : in integer) is + procedure draw (index : in enumeration; x, y : in integer) is begin core.draw (sprite (index), x, y); end draw; diff --git a/source/item.ads b/source/item.ads index 935eb9a..ea44ea0 100644 --- a/source/item.ads +++ b/source/item.ads @@ -2,7 +2,7 @@ -- -- GNU General Public Licence (version 3 or later) -with core, effect, attribute, skill; +with core, effect, attribute, skill, faction; package item is @@ -13,9 +13,9 @@ package item is neck, main_hand, off_hand, bag, cloak, additional ); - type codex is ( + type enumeration is ( iron_chestplate, iron_greaves, grey_tunic, iron_gauntlets, iron_helmet, iron_sword, - golden_necklace, iron_round_shield, ginger_long_beard, ginger_short_hair, head_runic_tattoo + golden_necklace, iron_round_shield ); ------------------------------------------------------------------------------------------ @@ -24,33 +24,31 @@ package item is name : core.short_string; kind : slot; attributes : attribute.points; - bonus_skill : skill.codex; - evoke : effect.codex; + bonus_skill : skill.enumeration; + favor : faction.enumeration; + evoke : effect.enumeration; end record; ------------------------------------------------------------------------------------------ - count : constant natural := codex'pos (codex'last) + 1; + count : constant natural := enumeration'pos (enumeration'last) + 1; - trait : constant array (codex) of information := ( - ("Iron Chestplate ", chest, (0, 3, 0, 0, 0, 0), skill.leadership, effect.none), - ("Iron Greaves ", feet, (0, 1, 0, 0, 0, 0), skill.logistics, effect.none), - ("Grey Tunic ", full_body, (0, 1, 0, 1, 0, 0), skill.exploration, effect.none), - ("Iron Gauntlets ", hands, (0, 1, 0, 0, 0, 0), skill.logistics, effect.none), - ("Iron Helmet ", head, (0, 1, 0, 0, 0, 0), skill.leadership, effect.none), - ("Iron Sword ", main_hand, (1, 0, 0, 0, 1, 2), skill.tactics, effect.none), - ("Golden Necklace ", neck, (0, 0, 0, 0, 0, 0), skill.estates, effect.none), - ("Iron Round Shield ", off_hand, (0, 2, 0, 0, 0, 1), skill.tactics, effect.none), - ("Ginger Long Beard ", with_body, (0, 0, 0, 0, 0, 0), skill.mercantile, effect.none), - ("Ginger Short Hair ", with_body, (0, 0, 0, 0, 0, 0), skill.mercantile, effect.none), - ("Head Runic Tattoo ", with_body, (0, 0, 1, 0, 0, 0), skill.mysticism, effect.none) + trait : constant array (enumeration) of information := ( + ("Iron Chestplate ", chest, (0, 3, 0, 0, 0, 0), skill.leadership, faction.gnoll, effect.none), + ("Iron Greaves ", feet, (0, 1, 0, 0, 0, 0), skill.logistics, faction.gnoll, effect.none), + ("Grey Tunic ", full_body, (0, 1, 0, 1, 0, 0), skill.exploration, faction.neutral, effect.none), + ("Iron Gauntlets ", hands, (0, 1, 0, 0, 0, 0), skill.logistics, faction.gnoll, effect.none), + ("Iron Helmet ", head, (0, 1, 0, 0, 0, 0), skill.leadership, faction.gnoll, effect.none), + ("Iron Sword ", main_hand, (1, 0, 0, 0, 1, 2), skill.tactics, faction.gnoll, effect.none), + ("Golden Necklace ", neck, (0, 0, 0, 0, 0, 0), skill.estates, faction.fairy, effect.none), + ("Iron Round Shield ", off_hand, (0, 2, 0, 0, 0, 1), skill.tactics, faction.gnoll, effect.none) ); ------------------------------------------------------------------------------------------ procedure configure; - procedure draw (index : in codex; x, y : in integer); + procedure draw (index : in enumeration; x, y : in integer); ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/magic.adb b/source/magic.adb index 9029016..0e5c2bf 100644 --- a/source/magic.adb +++ b/source/magic.adb @@ -11,8 +11,8 @@ package body magic is view_width : constant natural := 90; view_height : constant natural := 90; - view_sprite : array (codex) of core.sprite; - icon_sprite : array (codex) of core.sprite; + view_sprite : array (enumeration) of core.sprite; + icon_sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------ @@ -20,11 +20,11 @@ package body magic is begin core.echo (core.comment, "Configuring magic components..."); -- - for index in codex + for index in enumeration loop declare folder : constant string := core.lowercase (school'image (trait (index).kind)); - file : constant string := core.lowercase (codex'image (index)); + file : constant string := core.lowercase (enumeration'image (index)); begin view_sprite (index) := core.import_sprite ("./sprite/magic/" & folder & "/" & file & ".png", 1, 1); icon_sprite (index) := core.import_sprite ("./sprite/magic/icon/" & file & ".png", 1, 1); @@ -34,7 +34,7 @@ package body magic is ------------------------------------------------------------------------------------------ - procedure icon (index : in codex; x, y : in integer) is + procedure icon (index : in enumeration; x, y : in integer) is begin core.draw (icon_sprite (index), x + 2, y + 2); ui.draw_overicon (trait (index).text, x, y); @@ -42,7 +42,7 @@ package body magic is ------------------------------------------------------------------------------------------ - procedure view (index : in codex; x, y : in integer) is + procedure view (index : in enumeration; x, y : in integer) is offset : constant integer := 4; begin core.draw (view_sprite (index), x + offset, y + offset); @@ -63,7 +63,7 @@ package body magic is ui.draw_tiny_menu (move_x, move_y, width, height, true); ui.draw_title_bar (move_x, move_y, width, "Magic Abilities"); -- - for index in codex + for index in enumeration loop icon (index, move_x + offset + school'pos (trait (index).kind) * 168, move_y + offset + next (school'pos (trait (index).kind)) * core.icon); ui.write (trait (index).name, move_x + offset + school'pos (trait (index).kind) * 168 + core.icon, move_y + offset + next (school'pos (trait (index).kind)) * core.icon); diff --git a/source/magic.ads b/source/magic.ads index b6331fa..e2f1ab4 100644 --- a/source/magic.ads +++ b/source/magic.ads @@ -13,7 +13,7 @@ package magic is prime, water ); - type codex is ( + type enumeration is ( -- Neutral magic_arrow, chain_magic_arrow, -- Air @@ -48,15 +48,15 @@ package magic is name : core.short_string; kind : school; level : level_limit; - evoke : effect.codex; + evoke : effect.enumeration; text : core.long_string; end record; ------------------------------------------------------------------------------------------ - count : constant natural := codex'pos (codex'last) + 1; + count : constant natural := enumeration'pos (enumeration'last) + 1; - trait : constant array (codex) of information := ( + trait : constant array (enumeration) of information := ( ("Magic Arrow ", neutral, 0, effect.none, "Primary spell that channels mana through the air in order to do damage. "), ("Chain Magic Arrow ", neutral, 0, effect.none, "Advanced primary spell that chains mana to damage multiple foes. "), ("Blow Away ", air, 0, effect.none, "Weak spell that creates a strong gust of wind to knock back enemies. "), @@ -137,8 +137,8 @@ package magic is procedure configure; - procedure icon (index : in codex; x, y : in integer); - procedure view (index : in codex; x, y : in integer); + procedure icon (index : in enumeration; x, y : in integer); + procedure view (index : in enumeration; x, y : in integer); procedure menu (x, y : in integer; center : in boolean); diff --git a/source/might.adb b/source/might.adb index b403309..c5fc029 100644 --- a/source/might.adb +++ b/source/might.adb @@ -11,8 +11,8 @@ package body might is view_width : constant integer := 90; view_height : constant integer := 90; - view_sprite : array (codex) of core.sprite; - icon_sprite : array (codex) of core.sprite; + view_sprite : array (enumeration) of core.sprite; + icon_sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------ @@ -20,11 +20,11 @@ package body might is begin core.echo (core.comment, "Configuring might components..."); -- - for index in codex + for index in enumeration loop declare folder : constant string := core.lowercase (school'image (trait (index).kind)); - file : constant string := core.lowercase (codex'image (index)); + file : constant string := core.lowercase (enumeration'image (index)); begin view_sprite (index) := core.import_sprite ("./sprite/might/" & folder & "/" & file & ".png", 1, 1); icon_sprite (index) := core.import_sprite ("./sprite/might/icon/" & file & ".png", 1, 1); @@ -34,7 +34,7 @@ package body might is ------------------------------------------------------------------------------------------ - procedure icon (index : in codex; x, y : in integer) is + procedure icon (index : in enumeration; x, y : in integer) is begin core.draw (icon_sprite (index), x + 2, y + 2); ui.draw_overicon (trait (index).text, x, y); @@ -42,7 +42,7 @@ package body might is ------------------------------------------------------------------------------------------ - procedure view (index : in codex; x, y : in integer) is + procedure view (index : in enumeration; x, y : in integer) is offset : constant integer := 4; begin core.draw (view_sprite (index), x + offset, y + offset); @@ -63,7 +63,7 @@ package body might is ui.draw_tiny_menu (move_x, move_y, width, height, true); ui.draw_title_bar (move_x, move_y, width, "Might Abilities"); -- - for index in codex + for index in enumeration loop icon (index, move_x + offset + school'pos (trait (index).kind) * 168, move_y + offset + next (school'pos (trait (index).kind)) * core.icon); ui.write (trait (index).name, move_x + offset + school'pos (trait (index).kind) * 168 + core.icon, move_y + offset + next (school'pos (trait (index).kind)) * core.icon); diff --git a/source/might.ads b/source/might.ads index 1bee754..c540043 100644 --- a/source/might.ads +++ b/source/might.ads @@ -13,7 +13,7 @@ package might is offense, tactics ); - type codex is ( + type enumeration is ( -- Neutral -- Archery cover, evasive_maneuvers, focused_fire, magic_ammunition, piercing_bolt, precision, @@ -47,15 +47,15 @@ package might is name : core.short_string; kind : school; level : level_limit; - evoke : effect.codex; + evoke : effect.enumeration; text : core.long_string; end record; ------------------------------------------------------------------------------------------ - count : constant natural := codex'pos (codex'last) + 1; + count : constant natural := enumeration'pos (enumeration'last) + 1; - trait : constant array (codex) of information := ( + trait : constant array (enumeration) of information := ( ("Cover ", archery, 0, effect.none, "Provides temporary protection from enemy attacks. "), ("Evasive Maneuvers ", archery, 0, effect.none, "Allows the user to dodge and avoid incoming attacks more effectively. "), ("Focused Fire ", archery, 0, effect.none, "Increases accuracy and damage output towards a single target. "), @@ -122,8 +122,8 @@ package might is procedure configure; - procedure icon (index : in codex; x, y : in integer); - procedure view (index : in codex; x, y : in integer); + procedure icon (index : in enumeration; x, y : in integer); + procedure view (index : in enumeration; x, y : in integer); procedure menu (x, y : in integer; center : in boolean); diff --git a/source/resource.adb b/source/resource.adb index 05d327f..8facc0b 100644 --- a/source/resource.adb +++ b/source/resource.adb @@ -8,7 +8,7 @@ package body resource is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - sprite : array (codex) of core.sprite; + sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------ @@ -16,9 +16,9 @@ package body resource is begin core.echo (core.comment, "Configuring resource components..."); -- - for index in codex + for index in enumeration loop - sprite (index) := core.import_sprite ("./sprite/resource/" & core.lowercase (codex'image (index)) & ".png", 1, 1); + sprite (index) := core.import_sprite ("./sprite/resource/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1); end loop; end configure; @@ -34,10 +34,10 @@ package body resource is ui.draw_tiny_menu (move_x, move_y, width, height, true); ui.draw_title_bar (move_x, move_y, width, "Resources"); -- - for index in codex + for index in enumeration loop - ui.draw_icon (sprite (index), trait (index).text, move_x + offset, move_y + offset + codex'pos (index) * core.icon); - ui.write (trait (index).name, move_x + offset + core.icon, move_y + offset + codex'pos (index) * core.icon); + ui.draw_icon (sprite (index), trait (index).text, move_x + offset, move_y + offset + enumeration'pos (index) * core.icon); + ui.write (trait (index).name, move_x + offset + core.icon, move_y + offset + enumeration'pos (index) * core.icon); end loop; end menu; diff --git a/source/resource.ads b/source/resource.ads index 1035472..e14046a 100644 --- a/source/resource.ads +++ b/source/resource.ads @@ -8,7 +8,7 @@ package resource is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - type codex is ( + type enumeration is ( gold, wood, stone, steel, leather, crystal ); @@ -23,13 +23,13 @@ package resource is text : core.long_string; end record; - type points is array (codex) of base_limit; + type points is array (enumeration) of base_limit; ------------------------------------------------------------------------------------------ - count : constant natural := codex'pos (codex'last) + 1; + count : constant natural := enumeration'pos (enumeration'last) + 1; - trait : constant array (codex) of information := ( + trait : constant array (enumeration) of information := ( ("Gold ", 0, "- "), ("Wood ", 0, "- "), ("Stone ", 0, "- "), diff --git a/source/skill.adb b/source/skill.adb index dc3e283..af06213 100644 --- a/source/skill.adb +++ b/source/skill.adb @@ -8,7 +8,7 @@ package body skill is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - sprite : array (codex) of core.sprite; + sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------ @@ -16,9 +16,9 @@ package body skill is begin core.echo (core.comment, "Configuring skill components..."); -- - for index in codex + for index in enumeration loop - sprite (index) := core.import_sprite ("./sprite/skill/" & core.lowercase (codex'image (index)) & ".png", 1, 1); + sprite (index) := core.import_sprite ("./sprite/skill/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1); end loop; end configure; @@ -35,10 +35,10 @@ package body skill is ui.draw_tiny_menu (move_x, move_y, width, height, true); ui.draw_title_bar (move_x, move_y, width, "Skills"); -- - for index in codex + for index in enumeration loop - ui.draw_icon (sprite (index), trait (index).text, move_x + 216 * (codex'pos (index) mod column) + offset, move_y + core.icon * (codex'pos (index) / column) + offset); - ui.write (trait (index).name, move_x + 216 * (codex'pos (index) mod column) + offset + core.icon, move_y + core.icon * (codex'pos (index) / column) + offset); + ui.draw_icon (sprite (index), trait (index).text, move_x + 216 * (enumeration'pos (index) mod column) + offset, move_y + core.icon * (enumeration'pos (index) / column) + offset); + ui.write (trait (index).name, move_x + 216 * (enumeration'pos (index) mod column) + offset + core.icon, move_y + core.icon * (enumeration'pos (index) / column) + offset); end loop; end menu; diff --git a/source/skill.ads b/source/skill.ads index 9810bf5..c8be987 100644 --- a/source/skill.ads +++ b/source/skill.ads @@ -8,7 +8,7 @@ package skill is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - type codex is ( + type enumeration is ( archery, diplomacy, estates, exploration, leadership, logistics, medicine, mercantile, mysticism, necromancy, sorcery, tactics ); @@ -24,13 +24,13 @@ package skill is text : core.long_string; end record; - type points is array (codex) of base_limit; + type points is array (enumeration) of base_limit; ------------------------------------------------------------------------------------------ - count : constant natural := codex'pos (codex'last) + 1; + count : constant natural := enumeration'pos (enumeration'last) + 1; - trait : constant array (codex) of information := ( + trait : constant array (enumeration) of information := ( ("Archery ", 0, "- "), ("Diplomacy ", 0, "- "), ("Estates ", 0, "- "), diff --git a/source/ui.adb b/source/ui.adb index 6ea2f80..ef34705 100644 --- a/source/ui.adb +++ b/source/ui.adb @@ -8,7 +8,7 @@ package body ui is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - sprite : array (style, codex) of core.sprite; + sprite : array (style, enumeration) of core.sprite; glyphs : array (style) of core.glyphs; ------------------------------------------------------------------------------------------ @@ -23,7 +23,7 @@ package body ui is ------------------------------------------------------------------------------------------ - procedure draw (index : in codex; x, y : in integer) is + procedure draw (index : in enumeration; x, y : in integer) is begin core.zoom := 1.0; core.draw (sprite (active, index), x, y); @@ -32,7 +32,7 @@ package body ui is ------------------------------------------------------------------------------------------ - procedure crop (index : in codex; x, y, u, v, width, height : in integer) is + procedure crop (index : in enumeration; x, y, u, v, width, height : in integer) is begin core.zoom := 1.0; core.crop (sprite (active, index), x, y, u, v, width, height); @@ -41,7 +41,7 @@ package body ui is ------------------------------------------------------------------------------------------ - procedure draw_horizontally (index : in codex; x, y, width : in integer) is + procedure draw_horizontally (index : in enumeration; x, y, width : in integer) is base : constant integer := sprite (active, index).width; begin for move in 0 .. width / base - 1 @@ -54,7 +54,7 @@ package body ui is ------------------------------------------------------------------------------------------ - procedure draw_vertically (index : in codex; x, y, height : in integer) is + procedure draw_vertically (index : in enumeration; x, y, height : in integer) is base : constant integer := sprite (active, index).height; begin for move in 0 .. height / base - 1 @@ -67,7 +67,7 @@ package body ui is ------------------------------------------------------------------------------------------ - procedure draw_background (index : in codex; x, y, width, height : in integer) is + procedure draw_background (index : in enumeration; x, y, width, height : in integer) is base_width : integer := sprite (active, index).width; base_height : integer := sprite (active, index).height; crop_width : integer := width mod base_width; @@ -98,9 +98,9 @@ package body ui is begin glyphs (index) := core.import_glyphs ("./sprite/ui/" & folder_path & "/font.png", (if index = default then 16 else 24), 0); -- - for this in codex + for this in enumeration loop - sprite (index, this) := core.import_sprite ("./sprite/ui/" & folder_path & core.lowercase (codex'image (this)) & ".png", 1, 1); + sprite (index, this) := core.import_sprite ("./sprite/ui/" & folder_path & core.lowercase (enumeration'image (this)) & ".png", 1, 1); end loop; end load_ui; begin diff --git a/source/ui.ads b/source/ui.ads index c6c10b8..532b2ab 100644 --- a/source/ui.ads +++ b/source/ui.ads @@ -12,7 +12,7 @@ package ui is default, steam ); - type codex is ( + type enumeration is ( none, main_background, corner_upper_left, corner_upper_right, corner_lower_left, corner_lower_right, diff --git a/source/unit.adb b/source/unit.adb index b3a0f6b..bed421b 100644 --- a/source/unit.adb +++ b/source/unit.adb @@ -11,9 +11,9 @@ package body unit is view_width : constant integer := 48; view_height : constant integer := 64; - sprite : array (codex) of core.sprite; - icon_sprite : array (codex) of core.sprite; - view_sprite : array (codex) of core.sprite; + sprite : array (enumeration) of core.sprite; + icon_sprite : array (enumeration) of core.sprite; + view_sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------ @@ -21,11 +21,11 @@ package body unit is begin core.echo (core.comment, "Configuring unit components..."); -- - for index in codex + for index in enumeration loop declare - folder : constant string := core.lowercase (faction.codex'image (trait (index).kind)); - file : constant string := core.lowercase (codex'image (index)); + folder : constant string := core.lowercase (faction.enumeration'image (trait (index).kind)); + file : constant string := core.lowercase (enumeration'image (index)); begin sprite (index) := core.import_sprite ("./sprite/unit/" & folder & "/" & file & ".png", 4, 6); icon_sprite (index) := core.import_sprite ("./sprite/unit/icon/" & file & ".png", 1, 1); @@ -36,14 +36,14 @@ package body unit is ------------------------------------------------------------------------------------------ - procedure draw (index : in codex; state : in animation; x, y : in integer) is + procedure draw (index : in enumeration; state : in animation; x, y : in integer) is begin core.move (sprite (index), x, y, 6, animation'pos (state)); end draw; ------------------------------------------------------------------------------------------ - procedure icon (index : in codex; x, y : in integer) is + procedure icon (index : in enumeration; x, y : in integer) is begin core.draw (icon_sprite (index), x + 2, y + 2); ui.draw_overicon (trait (index).text, x, y); @@ -51,7 +51,7 @@ package body unit is ------------------------------------------------------------------------------------------ - procedure view (index : in codex; x, y : in integer) is + procedure view (index : in enumeration; x, y : in integer) is offset : constant integer := 4; begin core.draw (view_sprite (index), x + offset, y + offset); @@ -71,18 +71,18 @@ package body unit is ui.draw_tiny_menu (move_x, move_y, width, height, true); ui.draw_title_bar (move_x, move_y, width, "Units"); -- - for index in codex + for index in enumeration loop - move := faction.codex'pos (trait (index).kind) * 168; + move := faction.enumeration'pos (trait (index).kind) * 168; -- - icon (index, move_x + offset + move, move_y + offset + (codex'pos (index) mod 14) * core.icon); - ui.write (trait (index).name, move_x + offset + move + core.icon, move_y + offset + (codex'pos (index) mod 14) * core.icon); + icon (index, move_x + offset + move, move_y + offset + (enumeration'pos (index) mod 14) * core.icon); + ui.write (trait (index).name, move_x + offset + move + core.icon, move_y + offset + (enumeration'pos (index) mod 14) * core.icon); end loop; end menu; ------------------------------------------------------------------------------------------ - procedure stat (index : in codex; x, y : in integer; center : in boolean) is + procedure stat (index : in enumeration; x, y : in integer; center : in boolean) is offset : constant integer := 16; width : constant integer := 10 + offset + 6 * (sprite (index).width + 8); height : constant integer := attribute.count * core.icon + 2 * offset + 10 + sprite (index).height; @@ -95,9 +95,9 @@ package body unit is -- view (index, move_x + offset, move_y + offset); -- - --~for data in attribute.codex + --~for data in attribute.enumeration --~loop - --~move := attribute.codex'pos (data) * core.icon; + --~move := attribute.enumeration'pos (data) * core.icon; --~-- --~ui.draw_icon (attribute.sprite (data), attribute.trait (data).text, move_x + view_width + 12 + offset, move_y + offset + move); --~-- diff --git a/source/unit.ads b/source/unit.ads index ff7dd79..60f3e7d 100644 --- a/source/unit.ads +++ b/source/unit.ads @@ -12,7 +12,7 @@ package unit is idle, walk, melee, shoot, wounded, dead ); - type codex is ( + type enumeration is ( dwarf_male, fairy_male, gnoll_male, goblin_male, imp_male, kobold_male ); @@ -21,17 +21,17 @@ package unit is type information is record name : core.short_string; - kind : faction.codex; + kind : faction.enumeration; attributes : attribute.points; - evoke : effect.codex; + evoke : effect.enumeration; text : core.long_string; end record; ------------------------------------------------------------------------------------------ - count : constant natural := codex'pos (codex'last) + 1; + count : constant natural := enumeration'pos (enumeration'last) + 1; - trait : constant array (codex) of information := ( + trait : constant array (enumeration) of information := ( ("Dwarf ", faction.dwarf, (others => 1), effect.none, " "), ("Fairy ", faction.fairy, (others => 1), effect.none, " "), ("Gnoll ", faction.gnoll, (others => 1), effect.none, " "), @@ -44,13 +44,13 @@ package unit is procedure configure; - procedure draw (index : in codex; state : in animation; x, y : in integer); - procedure icon (index : in codex; x, y : in integer); - procedure view (index : in codex; x, y : in integer); + procedure draw (index : in enumeration; state : in animation; x, y : in integer); + procedure icon (index : in enumeration; x, y : in integer); + procedure view (index : in enumeration; x, y : in integer); procedure menu (x, y : in integer; center : in boolean); - procedure stat (index : in codex; x, y : in integer; center : in boolean); + procedure stat (index : in enumeration; x, y : in integer; center : in boolean); ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/world.adb b/source/world.adb index 17f179a..cd4dc93 100644 --- a/source/world.adb +++ b/source/world.adb @@ -12,9 +12,9 @@ package body world is type world_array is array (natural range <>) of access information; - type limit_array is array (codex) of integer; + type limit_array is array (enumeration) of integer; - type landmark_sprite_array is array (codex) of access sprite_array; + type landmark_sprite_array is array (enumeration) of access sprite_array; ------------------------------------------------------------------------------------------ @@ -35,14 +35,14 @@ package body world is -- blocks := core.import_sprite ("./sprite/world/terrain/terrain.png", 1, 1); -- - for index in codex + for index in enumeration loop landmarks (index) := new sprite_array (0 .. limit (index) - 1); -- for value in 0 .. limit (index) - 1 loop declare - folder : constant string := core.lowercase (codex'image (index)); + folder : constant string := core.lowercase (enumeration'image (index)); file : constant string := value'image; begin landmarks (index) (value) := core.import_sprite ("./sprite/world/landmark/" & folder & "/" & file & ".png", 1, 1); @@ -53,7 +53,7 @@ package body world is ------------------------------------------------------------------------------------------ - procedure make (index : in codex; width, height : in natural) is + procedure make (index : in enumeration; width, height : in natural) is begin core.echo (core.comment, "-- Procedurally generating new map..."); -- @@ -89,14 +89,14 @@ package body world is -- for object in 0 .. construction_limit loop - map.construction (object).index := core.random (0, construction.codex'pos (construction.codex'last)); + map.construction (object).index := core.random (0, construction.enumeration'pos (construction.enumeration'last)); map.construction (object).x := core.base * core.random (1, map.width - 1); map.construction (object).y := core.base * core.random (1, map.height - 1); end loop; -- for object in 0 .. item_limit loop - map.item (object).index := core.random (0, item.codex'pos (item.codex'last)); + map.item (object).index := core.random (0, item.enumeration'pos (item.enumeration'last)); map.item (object).x := core.base * core.random (1, map.width - 1); map.item (object).y := core.base * core.random (1, map.height - 1); end loop; @@ -115,13 +115,13 @@ package body world is loop for move_x in 0 .. + width / core.base - 1 loop - u := core.base * codex'pos (map.terrain) * 4; + u := core.base * enumeration'pos (map.terrain) * 4; v := core.base * map.block (core.camera.x + move_x, core.camera.y + move_y); -- core.crop (blocks, x + move_x * core.base, y + move_y * core.base, u, v, core.base, core.base); end loop; -- - u := core.base * codex'pos (map.terrain) * 4; + u := core.base * enumeration'pos (map.terrain) * 4; v := core.base * map.block (width / core.base, core.camera.y + move_y); -- core.crop (blocks, x + width - crop_width, y + move_y * core.base, u, v, crop_width, core.base); @@ -129,13 +129,13 @@ package body world is -- for move_x in 0 .. width / core.base - 1 loop - u := core.base * codex'pos (map.terrain) * 4; + u := core.base * enumeration'pos (map.terrain) * 4; v := core.base * map.block (core.camera.x + move_x, height / core.base); -- core.crop (blocks, x + move_x * core.base, y + height - crop_height, u, v, core.base, crop_height); end loop; -- - u := core.base * codex'pos (map.terrain) * 4; + u := core.base * enumeration'pos (map.terrain) * 4; v := core.base * map.block (width / core.base, height / core.base); -- core.crop (blocks, x + width - crop_width, y + height - crop_height, u, v, crop_width, crop_height); @@ -160,7 +160,7 @@ package body world is goto skip_drawing_out_of_view_construction; end if; -- - construction.draw (construction.codex'val (map.construction (object).index), + construction.draw (construction.enumeration'val (map.construction (object).index), map.construction (object).x - core.camera.x * core.base, map.construction (object).y - core.camera.y * core.base); -- @@ -174,7 +174,7 @@ package body world is goto skip_drawing_out_of_view_item; end if; -- - item.draw (item.codex'val (map.item (object).index), + item.draw (item.enumeration'val (map.item (object).index), map.item (object).x - core.camera.x * core.base, map.item (object).y - core.camera.y * core.base); -- diff --git a/source/world.ads b/source/world.ads index a68d04e..bd29266 100644 --- a/source/world.ads +++ b/source/world.ads @@ -8,7 +8,7 @@ package world is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - type codex is ( + type enumeration is ( ash, cave, grass, rough, snow, swamp ); @@ -24,7 +24,7 @@ package world is type information is record - terrain : codex; + terrain : enumeration; width : natural; height : natural; block : access block_array; @@ -41,7 +41,7 @@ package world is procedure configure; - procedure make (index : in codex; width, height : in natural); + procedure make (index : in enumeration; width, height : in natural); procedure draw (x, y, width, height : in integer; show_grid : in boolean);