diff --git a/compile.sh b/compile.sh index a9e51fb..9fe0fda 100644 --- a/compile.sh +++ b/compile.sh @@ -3,7 +3,7 @@ set -xe cd source -gnatmake -gnato -O3 -fstack-check -fno-exceptions -c main.adb +gnatmake -gnatp -O3 -f -fstack-check -fno-exceptions -c main.adb gnatbind main.ali gnatlink -o xhads main.ali -lraylib mv xhads ../xhads diff --git a/source/attribute.adb b/source/attribute.adb index d348602..7f3c980 100644 --- a/source/attribute.adb +++ b/source/attribute.adb @@ -9,13 +9,6 @@ package body attribute is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ procedure configure is - procedure define (index : in enumeration; minimum, maximum : in integer; name, text : in string) is - begin - description (index).base := (minimum, maximum); - description (index).name := core.unbound (name); - description (index).text := core.unbound (text); - end define; - -- structure : ui.structure; -- time : float := 0.0; @@ -24,16 +17,6 @@ package body attribute is -- core.echo (core.comment, "Configuring" & count'image & " attribute components..."); -- - description := new description_array (enumeration'range); - icon := new icon_array (enumeration'range); - -- - define (offense, 1, 12, "Offense", "Offense attribute determines your damage modifier when attacking."); - define (defense, 1, 12, "Defense", "D-FENS attribute determines how much damage your reflect and receive."); - define (wisdom, 1, 12, "Wisdom", "Wisdom attribute determines how much mana your chad has."); - define (stamina, 1, 12, "Stamina", "Stamina attribute determines how fast you recover from being wounded."); - define (speed, 1, 12, "Speed", "Speed attribute determines how far you can walk per turn."); - define (reach, 1, 12, "Reach", "Reach attribute determines your range modifier when shooting or casting."); - -- structure.title := "Attribute Menu "; structure.toggle := core.signal_a; structure.show := false; diff --git a/source/attribute.ads b/source/attribute.ads index 048c5b6..797a765 100644 --- a/source/attribute.ads +++ b/source/attribute.ads @@ -23,17 +23,22 @@ package attribute is type points is array (enumeration) of core.point; type bonus is array (enumeration) of natural; - type description_array is array (enumeration range <>) of definition; - type icon_array is array (enumeration range <>) of core.sprite; - ------------------------------------------------------------------------------------------ count : constant natural := enumeration'pos (enumeration'last) + 1; default : constant points := (others => (1, 12)); - description : access description_array; - icon : access icon_array; + description : constant array (enumeration) of definition := ( + offense => ((1, 12), core.unbound ("Offense"), core.unbound ("Offense attribute determines your damage modifier when attacking.")), + defense => ((1, 12), core.unbound ("Defense"), core.unbound ("D-FENS attribute determines how much damage your reflect and receive.")), + wisdom => ((1, 12), core.unbound ("Wisdom"), core.unbound ("Wisdom attribute determines how much mana your chad has.")), + stamina => ((1, 12), core.unbound ("Stamina"), core.unbound ("Stamina attribute determines how fast you recover from being wounded.")), + speed => ((1, 12), core.unbound ("Speed"), core.unbound ("Speed attribute determines how far you can walk per turn.")), + reach => ((1, 12), core.unbound ("Reach"), core.unbound ("Reach attribute determines your range modifier when shooting or casting.")) + ); + + icon : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------ diff --git a/source/resource.adb b/source/resource.adb index 15b8eb5..5e2691c 100644 --- a/source/resource.adb +++ b/source/resource.adb @@ -9,13 +9,6 @@ package body resource is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ procedure configure is - procedure define (index : in enumeration; minimum, maximum : in integer; name, text : in string) is - begin - description (index).base := (minimum, maximum); - description (index).name := core.unbound (name); - description (index).text := core.unbound (text); - end define; - -- structure : ui.structure; -- time : float := 0.0; @@ -24,16 +17,6 @@ package body resource is -- core.echo (core.comment, "Configuring" & count'image & " resource components..."); -- - description := new description_array (enumeration'range); - icon := new icon_array (enumeration'range); - -- - define (gold, 24, 480, "Gold", "Gold is precious yellowish shiny metal, valued since ancient times."); - define (wood, 12, 240, "Wood", "Wood is just bundle of lignin and cellulose, nothing more."); - define (stone, 12, 240, "Stone", "Stone is essential building block for most constructions in this world."); - define (metal, 12, 240, "Metal", "Metal as a resource is mixture of commonly found metalic elements."); - define (leather, 12, 240, "Leather", "Leather is general purpose resource, used for armours and decorations."); - define (gem, 12, 240, "Gem", "Gem as a resource is same as metal, just mixture of various gems."); - -- structure.title := "Resource Menu "; structure.toggle := core.signal_r; structure.show := false; diff --git a/source/resource.ads b/source/resource.ads index 4a87e0b..70af11d 100644 --- a/source/resource.ads +++ b/source/resource.ads @@ -23,15 +23,20 @@ package resource is type points is array (enumeration) of core.point; type price is array (enumeration) of natural; - type description_array is array (enumeration range <>) of definition; - type icon_array is array (enumeration range <>) of core.sprite; - ------------------------------------------------------------------------------------------ count : constant natural := enumeration'pos (enumeration'last) + 1; - description : access description_array; - icon : access icon_array; + description : constant array (enumeration) of definition := ( + gold => ((24, 480), core.unbound ("Gold"), core.unbound ("Gold is precious yellowish shiny metal, valued since ancient times.")), + wood => ((12, 240), core.unbound ("Wood"), core.unbound ("Wood is just bundle of lignin and cellulose, nothing more.")), + stone => ((12, 240), core.unbound ("Stone"), core.unbound ("Stone is essential building block for most constructions in this world.")), + metal => ((12, 240), core.unbound ("Metal"), core.unbound ("Metal as a resource is mixture of commonly found metalic elements.")), + leather => ((12, 240), core.unbound ("Leather"), core.unbound ("Leather is general purpose resource, used for armours and decorations.")), + gem => ((12, 240), core.unbound ("Gem"), core.unbound ("Gem as a resource is same as metal, just mixture of various gems.")) + ); + + icon : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------