From a2e5ce337e28a3cfdc7533782b41992d2b5f6736 Mon Sep 17 00:00:00 2001 From: xolatile Date: Tue, 23 Apr 2024 16:19:29 -0400 Subject: [PATCH] Revised trait and sprite arrays... --- source/ai.adb | 30 +++++++++++++++--------------- source/attribute.adb | 6 +++++- source/attribute.ads | 6 +----- source/chad.adb | 4 ++++ source/chad.ads | 14 ++++---------- source/construction.adb | 6 +----- source/construction.ads | 6 ++---- source/deity.adb | 2 +- source/deity.ads | 4 +--- source/effect.adb | 4 ++++ source/effect.ads | 4 +--- source/faction.adb | 4 ++++ source/faction.ads | 4 +--- source/item.adb | 6 +----- source/item.ads | 4 +--- source/magic.adb | 16 ++++++---------- source/magic.ads | 4 +--- source/main.adb | 4 ++-- source/might.adb | 12 ++++-------- source/might.ads | 4 +--- source/resource.adb | 6 +++++- source/resource.ads | 8 ++------ source/skill.adb | 6 +++++- source/skill.ads | 8 ++------ source/ui.adb | 12 ++++++++++++ source/ui.ads | 9 ++------- source/unit.adb | 14 ++++++-------- source/unit.ads | 6 ++---- source/world.ads | 6 +++--- 29 files changed, 99 insertions(+), 120 deletions(-) diff --git a/source/ai.adb b/source/ai.adb index bb11135..9672af8 100644 --- a/source/ai.adb +++ b/source/ai.adb @@ -83,22 +83,22 @@ package body ai is -- active := index; -- - core.write (male_name_array (actor (index).name), x + offset, y + offset, ui.glyphs (ui.active)); + ui.write (male_name_array (actor (index).name), x + offset, y + offset); -- - core.write ("Envious = " & boolean'image (actor_is_envious), x + offset, y + offset + 32, ui.glyphs (ui.active)); - core.write ("Glutton = " & boolean'image (actor_is_glutton), x + offset, y + offset + 64, ui.glyphs (ui.active)); - core.write ("Greedy = " & boolean'image (actor_is_greedy), x + offset, y + offset + 96, ui.glyphs (ui.active)); - core.write ("Slutty = " & boolean'image (actor_is_slutty), x + offset, y + offset + 128, ui.glyphs (ui.active)); - core.write ("Proud = " & boolean'image (actor_is_proud), x + offset, y + offset + 160, ui.glyphs (ui.active)); - core.write ("Lazy = " & boolean'image (actor_is_lazy), x + offset, y + offset + 192, ui.glyphs (ui.active)); - core.write ("Angry = " & boolean'image (actor_is_angry), x + offset, y + offset + 224, ui.glyphs (ui.active)); - core.write ("Thirsty = " & boolean'image (actor_is_thirsty), x + offset, y + offset + 256, ui.glyphs (ui.active)); - core.write ("Hungry = " & boolean'image (actor_is_hungry), x + offset, y + offset + 288, ui.glyphs (ui.active)); - core.write ("Tired = " & boolean'image (actor_is_tired), x + offset, y + offset + 320, ui.glyphs (ui.active)); - core.write ("Lonely = " & boolean'image (actor_is_lonely), x + offset, y + offset + 352, ui.glyphs (ui.active)); - core.write ("Healthy = " & boolean'image (actor_is_healthy), x + offset, y + offset + 384, ui.glyphs (ui.active)); - core.write ("Happy = " & boolean'image (actor_is_happy), x + offset, y + offset + 416, ui.glyphs (ui.active)); - core.write ("Bored = " & boolean'image (actor_is_bored), x + offset, y + offset + 448, ui.glyphs (ui.active)); + ui.write ("Envious = " & boolean'image (actor_is_envious), x + offset, y + offset + 32); + ui.write ("Glutton = " & boolean'image (actor_is_glutton), x + offset, y + offset + 64); + ui.write ("Greedy = " & boolean'image (actor_is_greedy), x + offset, y + offset + 96); + ui.write ("Slutty = " & boolean'image (actor_is_slutty), x + offset, y + offset + 128); + ui.write ("Proud = " & boolean'image (actor_is_proud), x + offset, y + offset + 160); + ui.write ("Lazy = " & boolean'image (actor_is_lazy), x + offset, y + offset + 192); + ui.write ("Angry = " & boolean'image (actor_is_angry), x + offset, y + offset + 224); + ui.write ("Thirsty = " & boolean'image (actor_is_thirsty), x + offset, y + offset + 256); + ui.write ("Hungry = " & boolean'image (actor_is_hungry), x + offset, y + offset + 288); + ui.write ("Tired = " & boolean'image (actor_is_tired), x + offset, y + offset + 320); + ui.write ("Lonely = " & boolean'image (actor_is_lonely), x + offset, y + offset + 352); + ui.write ("Healthy = " & boolean'image (actor_is_healthy), x + offset, y + offset + 384); + ui.write ("Happy = " & boolean'image (actor_is_happy), x + offset, y + offset + 416); + ui.write ("Bored = " & boolean'image (actor_is_bored), x + offset, y + offset + 448); end view_actor_state; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/attribute.adb b/source/attribute.adb index 5577df0..b042158 100644 --- a/source/attribute.adb +++ b/source/attribute.adb @@ -6,6 +6,10 @@ package body attribute is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + sprite : array (codex) of core.sprite; + + ------------------------------------------------------------------------------------------ + procedure configure is begin core.echo (core.comment, "Configuring attribute components..."); @@ -39,7 +43,7 @@ package body attribute is loop ui.draw_icon (trait (index).text, move_x + offset, move_y + offset + codex'pos (index) * core.icon); draw (index, move_x + offset, move_y + offset + codex'pos (index) * core.icon); - core.write (trait (index).name, move_x + offset + core.icon, move_y + offset + codex'pos (index) * core.icon, ui.glyphs (ui.active)); + ui.write (trait (index).name, move_x + offset + core.icon, move_y + offset + codex'pos (index) * core.icon); end loop; end menu; diff --git a/source/attribute.ads b/source/attribute.ads index fcde13b..7a7fc65 100644 --- a/source/attribute.ads +++ b/source/attribute.ads @@ -19,14 +19,10 @@ package attribute is text : core.long_string; end record; - --~type trait_array is array (codex) of information; - --~type sprite_array is array (codex) of core.sprite; - type value_array is array (codex) of base_limit; + type points is array (codex) of base_limit; ------------------------------------------------------------------------------------------ - sprite : array (codex) of core.sprite; - count : constant natural := codex'pos (codex'last) + 1; trait : constant array (codex) of information := ( diff --git a/source/chad.adb b/source/chad.adb index acf966b..31f1d4e 100644 --- a/source/chad.adb +++ b/source/chad.adb @@ -6,6 +6,10 @@ package body chad is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + sprite : array (codex) of core.sprite; + + ------------------------------------------------------------------------------------------ + procedure configure is begin core.echo (core.comment, "Configuring chad components..."); diff --git a/source/chad.ads b/source/chad.ads index 5db4a05..a5a85a4 100644 --- a/source/chad.ads +++ b/source/chad.ads @@ -6,7 +6,7 @@ package chad is type codex is ( ognjen, richard, eric, linus, ada, marina, - kethleen, wouter, john + kathleen, wouter, john ); ------------------------------------------------------------------------------------------ @@ -23,19 +23,13 @@ package chad is type data is record index : codex; - attributes : attribute.value_array; - --~attributes : array (attribute.codex) of attribute.base_limit; - skills : skill.value_array; - resources : resource.value_array; + attributes : attribute.points; + skills : skill.points; + resources : resource.points; end record; - --~type trait_array is array (codex) of information; - --~type sprite_array is array (codex) of core.sprite; - ------------------------------------------------------------------------------------------ - sprite : array (codex) of core.sprite; - count : constant natural := codex'pos (codex'last) + 1; trait : constant array (codex) of information := ( diff --git a/source/construction.adb b/source/construction.adb index 81c9439..cb4cccc 100644 --- a/source/construction.adb +++ b/source/construction.adb @@ -6,11 +6,7 @@ package body construction is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - type sprite_array is array (codex) of core.sprite; - - ------------------------------------------------------------------------------------------ - - sprite : sprite_array; + sprite : array (codex) of core.sprite; ------------------------------------------------------------------------------------------ diff --git a/source/construction.ads b/source/construction.ads index 504732c..10d532b 100644 --- a/source/construction.ads +++ b/source/construction.ads @@ -48,18 +48,16 @@ package construction is kind : faction.codex; level : level_limit; grade : grade_limit; - price : resource.value_array; + price : resource.points; frames : integer; evoke : effect.codex; end record; - type trait_array is array (codex) of information; - ------------------------------------------------------------------------------------------ count : constant natural := codex'pos (codex'last) + 1; - trait : constant trait_array := ( + trait : constant array (codex) of information := ( ("Boar Glen ", faction.neutral, 1, 1, ( 90, 0, 0, 0, 0, 0, 0), 1, effect.none), ("Enchanter's Hollow ", faction.neutral, 1, 1, (120, 0, 0, 0, 0, 0, 0), 1, effect.none), ("Hovel ", faction.neutral, 2, 1, (180, 0, 0, 0, 0, 0, 0), 1, effect.none), diff --git a/source/deity.adb b/source/deity.adb index 6312293..9df0b25 100644 --- a/source/deity.adb +++ b/source/deity.adb @@ -6,7 +6,7 @@ package body deity is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - sprite : core.sprite; + sprite : array (codex) of core.sprite; ------------------------------------------------------------------------------------------ diff --git a/source/deity.ads b/source/deity.ads index f133cae..5458c51 100644 --- a/source/deity.ads +++ b/source/deity.ads @@ -19,13 +19,11 @@ package deity is base : piety_limit; end record; - type trait_array is array (codex) of information; - ------------------------------------------------------------------------------------------ count : constant natural := codex'pos (codex'last) + 1; - trait : constant trait_array := ( + trait : constant array (codex) of information := ( ("Svarog the Lawful ", 3), -- Serbia ("Dabog the Lonely ", -3), ("Svetovid the Awakened ", 0), diff --git a/source/effect.adb b/source/effect.adb index 2329111..bf45f66 100644 --- a/source/effect.adb +++ b/source/effect.adb @@ -6,6 +6,10 @@ package body effect is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + sprite : array (codex) of core.sprite; + + ------------------------------------------------------------------------------------------ + procedure draw (value : in codex; x, y : in integer) is begin null; diff --git a/source/effect.ads b/source/effect.ads index 54e8ad6..80994b0 100644 --- a/source/effect.ads +++ b/source/effect.ads @@ -16,13 +16,11 @@ package effect is make : boolean; end record; - type trait_array is array (codex) of information; - ------------------------------------------------------------------------------------------ count : constant natural := codex'pos (codex'last) + 1; - trait : constant trait_array := ( + trait : constant array (codex) of information := ( ("- ", true), ("- ", true) ); diff --git a/source/faction.adb b/source/faction.adb index 311caf1..b92a914 100644 --- a/source/faction.adb +++ b/source/faction.adb @@ -6,6 +6,10 @@ package body faction is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + sprite : array (codex) of core.sprite; + + ------------------------------------------------------------------------------------------ + procedure draw (value : in codex; x, y : in integer) is begin null; diff --git a/source/faction.ads b/source/faction.ads index c301f98..f4bffe4 100644 --- a/source/faction.ads +++ b/source/faction.ads @@ -19,13 +19,11 @@ package faction is resource_bonus : resource.codex; end record; - type trait_array is array (codex) of information; - ------------------------------------------------------------------------------------------ count : constant natural := codex'pos (codex'last) + 1; - trait : constant trait_array := ( + trait : constant array (codex) of information := ( ("Neutral ", attribute.attack, skill.tactics, resource.gold), ("Castle ", attribute.attack, skill.archery, resource.ore), ("Stronghold ", attribute.defense, skill.offense, resource.wood), diff --git a/source/item.adb b/source/item.adb index e4eb126..e3d36c3 100644 --- a/source/item.adb +++ b/source/item.adb @@ -6,11 +6,7 @@ package body item is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - type sprite_array is array (codex) of core.sprite; - - ------------------------------------------------------------------------------------------ - - sprite : sprite_array; + sprite : array (codex) of core.sprite; ------------------------------------------------------------------------------------------ diff --git a/source/item.ads b/source/item.ads index 3f13197..b7d375a 100644 --- a/source/item.ads +++ b/source/item.ads @@ -47,13 +47,11 @@ package item is evoke : effect.codex; end record; - type trait_array is array (codex) of information; - ------------------------------------------------------------------------------------------ count : constant natural := codex'pos (codex'last) + 1; - trait : constant trait_array := ( + trait : constant array (codex) of information := ( ("Admiral's Hat ", head, 0, effect.none), ("Ambassador's Sash ", full_body, 0, effect.none), ("Undertaker's Amulet ", neck, 1, effect.none), diff --git a/source/magic.adb b/source/magic.adb index 23e53e1..9c5f673 100644 --- a/source/magic.adb +++ b/source/magic.adb @@ -6,15 +6,11 @@ package body magic is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - type sprite_array is array (codex) of core.sprite; + view_width : constant natural := 90; + view_height : constant natural := 90; - ------------------------------------------------------------------------------------------ - - view_width : constant integer := 90; - view_height : constant integer := 90; - - view_sprite : sprite_array; - icon_sprite : sprite_array; + view_sprite : array (codex) of core.sprite; + icon_sprite : array (codex) of core.sprite; ------------------------------------------------------------------------------------------ @@ -67,8 +63,8 @@ package body magic is -- for index in codex loop - icon (index, move_x + offset + school'pos (trait (index).kind) * 168, move_y + offset + next (school'pos (trait (index).kind)) * core.icon); - core.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, ui.glyphs (ui.active)); + 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); -- next (school'pos (trait (index).kind)) := next (school'pos (trait (index).kind)) + 1; end loop; diff --git a/source/magic.ads b/source/magic.ads index c1ecae0..91d0bce 100644 --- a/source/magic.ads +++ b/source/magic.ads @@ -48,13 +48,11 @@ package magic is text : core.long_string; end record; - type trait_array is array (codex) of information; - ------------------------------------------------------------------------------------------ count : constant natural := codex'pos (codex'last) + 1; - trait : constant trait_array := ( + trait : constant array (codex) 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. "), diff --git a/source/main.adb b/source/main.adb index 5f156a0..1cee632 100644 --- a/source/main.adb +++ b/source/main.adb @@ -160,11 +160,11 @@ begin signal_list (core.signal_code'val (core.signal_mode)).all; -- --~ai.review; - --~ai.view_actor_state (1); + ai.view_actor_state (1); -- menu_render; -- - core.write (integer'image (menu_count), 16, 16, ui.glyphs (ui.active), 16#FFFFFFFF#); + ui.write (integer'image (menu_count), 16, 16); -- ui.draw_text_box (0, core.window_height - 32, core.window_width, 32); end loop gameplay; diff --git a/source/might.adb b/source/might.adb index 79ea66c..3417812 100644 --- a/source/might.adb +++ b/source/might.adb @@ -6,15 +6,11 @@ package body might is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - type sprite_array is array (codex) of core.sprite; - - ------------------------------------------------------------------------------------------ - view_width : constant integer := 90; view_height : constant integer := 90; - view_sprite : sprite_array; - icon_sprite : sprite_array; + view_sprite : array (codex) of core.sprite; + icon_sprite : array (codex) of core.sprite; ------------------------------------------------------------------------------------------ @@ -67,8 +63,8 @@ package body might is -- for index in codex loop - icon (index, move_x + offset + school'pos (trait (index).kind) * 168, move_y + offset + next (school'pos (trait (index).kind)) * core.icon); - core.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, ui.glyphs (ui.active)); + 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); -- next (school'pos (trait (index).kind)) := next (school'pos (trait (index).kind)) + 1; end loop; diff --git a/source/might.ads b/source/might.ads index 36bae82..bc6b57d 100644 --- a/source/might.ads +++ b/source/might.ads @@ -47,13 +47,11 @@ package might is text : core.long_string; end record; - type trait_array is array (codex) of information; - ------------------------------------------------------------------------------------------ count : constant natural := codex'pos (codex'last) + 1; - trait : constant trait_array := ( + trait : constant array (codex) 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. "), diff --git a/source/resource.adb b/source/resource.adb index 29fee05..7f6c0a2 100644 --- a/source/resource.adb +++ b/source/resource.adb @@ -6,6 +6,10 @@ package body resource is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + sprite : array (codex) of core.sprite; + + ------------------------------------------------------------------------------------------ + procedure configure is begin core.echo (core.comment, "Configuring resource components..."); @@ -39,7 +43,7 @@ package body resource is loop ui.draw_icon (trait (index).text, move_x + offset, move_y + offset + codex'pos (index) * core.icon); draw (index, move_x + offset, move_y + offset + codex'pos (index) * core.icon); - core.write (trait (index).name, move_x + offset + core.icon, move_y + offset + codex'pos (index) * core.icon, ui.glyphs (ui.active)); + ui.write (trait (index).name, move_x + offset + core.icon, move_y + offset + codex'pos (index) * core.icon); end loop; end menu; diff --git a/source/resource.ads b/source/resource.ads index 7d3c47c..0bef209 100644 --- a/source/resource.ads +++ b/source/resource.ads @@ -20,17 +20,13 @@ package resource is text : core.long_string; end record; - type trait_array is array (codex) of information; - type sprite_array is array (codex) of core.sprite; - type value_array is array (codex) of base_limit; + type points is array (codex) of base_limit; ------------------------------------------------------------------------------------------ - sprite : sprite_array; - count : constant natural := codex'pos (codex'last) + 1; - trait : constant trait_array := ( + trait : constant array (codex) of information := ( ("Gold ", 0, "Basic currency in the world, even tho silver is better. "), ("Wood ", 0, "Essential building material for most houses and stables. "), ("Mercury ", 0, "Usage is practiced by alchemists and necromancers mostly. "), diff --git a/source/skill.adb b/source/skill.adb index e6413f9..a441520 100644 --- a/source/skill.adb +++ b/source/skill.adb @@ -6,6 +6,10 @@ package body skill is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + sprite : array (codex) of core.sprite; + + ------------------------------------------------------------------------------------------ + procedure configure is begin core.echo (core.comment, "Configuring skill components..."); @@ -40,7 +44,7 @@ package body skill is loop ui.draw_icon (trait (index).text, move_x + 216 * (codex'pos (index) / 6) + offset, move_y + core.icon * (codex'pos (index) mod 6) + offset); draw (index, move_x + 216 * (codex'pos (index) / 6) + offset, move_y + core.icon * (codex'pos (index) mod 6) + offset); - core.write (trait (index).name, move_x + 216 * (codex'pos (index) / 6) + offset + core.icon, move_y + core.icon * (codex'pos (index) mod 6) + offset, ui.glyphs (ui.active)); + ui.write (trait (index).name, move_x + 216 * (codex'pos (index) / 6) + offset + core.icon, move_y + core.icon * (codex'pos (index) mod 6) + offset); end loop; end menu; diff --git a/source/skill.ads b/source/skill.ads index 5afa0ab..df9af40 100644 --- a/source/skill.ads +++ b/source/skill.ads @@ -22,17 +22,13 @@ package skill is text : core.long_string; end record; - type trait_array is array (codex) of information; - type sprite_array is array (codex) of core.sprite; - type value_array is array (codex) of base_limit; + type points is array (codex) of base_limit; ------------------------------------------------------------------------------------------ - sprite : sprite_array; - count : constant natural := codex'pos (codex'last) + 1; - trait : constant trait_array := ( + trait : constant array (codex) of information := ( ("Archery ", 0, "Improves the effectiveness of ranged attacks. "), ("Offense ", 0, "Enhances the damage dealt in combat. "), ("Armourer ", 0, "Better at maintaining and repairing equipment. "), diff --git a/source/ui.adb b/source/ui.adb index ad10f72..b67385f 100644 --- a/source/ui.adb +++ b/source/ui.adb @@ -6,6 +6,11 @@ package body ui is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + sprite : array (style, codex) of core.sprite; + glyphs : array (style) of core.glyphs; + + ------------------------------------------------------------------------------------------ + procedure select_text_box (text : in string; x, y, width, height : in integer) is begin if core.cursor.x > x and core.cursor.x < x + width @@ -299,6 +304,13 @@ package body ui is core.write ("Framerate :" & integer'image (core.framerate), x, y + 288, glyphs (active)); end draw_state_box; + ------------------------------------------------------------------------------------------ + + procedure write (text : in string; x, y : in integer) is + begin + core.write (text, x, y, glyphs (active)); + end write; + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end ui; diff --git a/source/ui.ads b/source/ui.ads index 40b8781..a938e40 100644 --- a/source/ui.ads +++ b/source/ui.ads @@ -32,13 +32,6 @@ package ui is ------------------------------------------------------------------------------------------ - type sprite_array is array (style, codex) of core.sprite; - type glyphs_array is array (style) of core.glyphs; - - ------------------------------------------------------------------------------------------ - - sprite : sprite_array; - glyphs : glyphs_array; active : style; ------------------------------------------------------------------------------------------ @@ -62,6 +55,8 @@ package ui is procedure draw_state_box (x, y : in integer); + procedure write (text : in string; x, y : in integer); + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end ui; diff --git a/source/unit.adb b/source/unit.adb index ded24db..85dac04 100644 --- a/source/unit.adb +++ b/source/unit.adb @@ -6,14 +6,12 @@ package body unit is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - type sprite_array is array (codex) of core.sprite; - view_width : constant integer := 48; view_height : constant integer := 64; - sprite : sprite_array; - icon_sprite : sprite_array; - view_sprite : sprite_array; + sprite : array (codex) of core.sprite; + icon_sprite : array (codex) of core.sprite; + view_sprite : array (codex) of core.sprite; ------------------------------------------------------------------------------------------ @@ -75,8 +73,8 @@ package body unit is loop move := faction.codex'pos (trait (index).kind) * 168; -- - icon (index, move_x + offset + move, move_y + offset + (codex'pos (index) mod 14) * core.icon); - core.write (trait (index).name, move_x + offset + move + core.icon, move_y + offset + (codex'pos (index) mod 14) * core.icon, ui.glyphs (ui.active)); + 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); end loop; end menu; @@ -102,7 +100,7 @@ package body unit is ui.draw_icon (attribute.trait (data).text, move_x + view_width + 12 + offset, move_y + offset + move); attribute.draw (data, move_x + view_width + 12 + offset, move_y + offset + move); -- - core.write (integer'image (trait (index).attributes (data)), move_x + view_width + 12 + offset + core.icon, move_y + offset + move, ui.glyphs (ui.active)); + ui.write (integer'image (trait (index).attributes (data)), move_x + view_width + 12 + offset + core.icon, move_y + offset + move); end loop; -- for animate in animation diff --git a/source/unit.ads b/source/unit.ads index 5b55a8a..8371dd1 100644 --- a/source/unit.ads +++ b/source/unit.ads @@ -56,18 +56,16 @@ package unit is record name : core.short_string; kind : faction.codex; - attributes : attribute.value_array; + attributes : attribute.points; evoke : effect.codex; text : core.long_string; end record; - type trait_array is array (codex) of information; - ------------------------------------------------------------------------------------------ count : constant natural := codex'pos (codex'last) + 1; - trait : constant trait_array := ( + trait : constant array (codex) of information := ( ("Azure Dragon ", faction.neutral, (1, 1, 1, 1), effect.none, "Powerful and majestic dragon known for its devastating attacks. "), ("Boar ", faction.neutral, (1, 1, 1, 1), effect.none, "Wild animal with tusks, often used as frontline warriors. "), ("Crystal Dragon ", faction.neutral, (1, 1, 1, 1), effect.none, "Crystal-encrusted dragon with powerful magical abilities. "), diff --git a/source/world.ads b/source/world.ads index d5e72c5..eca7684 100644 --- a/source/world.ads +++ b/source/world.ads @@ -20,9 +20,9 @@ package world is type information is record - terrain : codex; - width : natural; - height : natural; + terrain : codex; + width : natural; + height : natural; block : access block_array; landmark : access entity_array; construction : access entity_array;