diff --git a/source/attribute.adb b/source/attribute.adb index 9345c76..4ed5e4f 100644 --- a/source/attribute.adb +++ b/source/attribute.adb @@ -39,7 +39,7 @@ package body attribute is ------------------------------------------------------------------------------------------ - procedure draw_points (data : in points := (others => 0); + procedure draw_points (data : in points := (others => (0, 0)); x : in integer := 0; y : in integer := 0) is move_x : integer := x; @@ -47,7 +47,7 @@ package body attribute is for index in enumeration loop ui.draw_icon (icon (index), trait (index).text, move_x, y); ui.draw_text_box (move_x, y + core.icon, core.icon, core.icon); - ui.write (data (index)'image, move_x + 4, y + core.icon + 8, (255, 255, 255, 255), 15, true); + ui.write (data (index).value'image, move_x + 4, y + core.icon + 8, (255, 255, 255, 255), 15, true); -- move_x := move_x + core.icon; end loop; diff --git a/source/attribute.ads b/source/attribute.ads index 307bf80..f6d01e1 100644 --- a/source/attribute.ads +++ b/source/attribute.ads @@ -16,30 +16,33 @@ package attribute is type information is record name : core.short_string; - base : natural; + base : core.point; text : core.long_string; end record; - type points is array (enumeration) of natural; + type points is array (enumeration) of core.point; + type bonus is array (enumeration) of natural; + + default : points := (others => (1, 12)); ------------------------------------------------------------------------------------------ count : constant natural := enumeration'pos (enumeration'last) + 1; trait : constant array (enumeration) of information := ( - ("Offense ", 0, "Offense attribute determines your damage modifier when attacking. "), - ("Defense ", 0, "D-FENS attribute determines how much damage your reflect and receive. "), - ("Wisdom ", 0, "Wisdom attribute determines how much mana your chad has. "), - ("Stamina ", 0, "Stamina attribute determines how fast you recover from being wounded. "), - ("Speed ", 0, "Speed attribute determines how far you can walk per turn. "), - ("Reach ", 0, "Reach attribute determines your range modifier when shooting or casting.") + offense => ("Offense ", (1, 12), "Offense attribute determines your damage modifier when attacking. "), + defense => ("Defense ", (1, 12), "D-FENS attribute determines how much damage your reflect and receive. "), + wisdom => ("Wisdom ", (1, 12), "Wisdom attribute determines how much mana your chad has. "), + stamina => ("Stamina ", (1, 12), "Stamina attribute determines how fast you recover from being wounded. "), + speed => ("Speed ", (1, 12), "Speed attribute determines how far you can walk per turn. "), + reach => ("Reach ", (1, 12), "Reach attribute determines your range modifier when shooting or casting.") ); ------------------------------------------------------------------------------------------ procedure configure; - procedure draw_points (data : in points := (others => 0); + procedure draw_points (data : in points := (others => (0, 0)); x : in integer := 0; y : in integer := 0); diff --git a/source/construction.ads b/source/construction.ads index 2972c12..1f3c025 100644 --- a/source/construction.ads +++ b/source/construction.ads @@ -17,7 +17,7 @@ package construction is type information is record name : core.short_string; kind : faction.enumeration; - price : resource.prices; + price : resource.price; frames : integer; evoke : effect.value; end record; diff --git a/source/effect.adb b/source/effect.adb index e629d23..89aa54c 100644 --- a/source/effect.adb +++ b/source/effect.adb @@ -4,6 +4,8 @@ with core, attribute, skill, resource, deity, material, magic, equipment, unit, construction, chad, world; +use type core.point; + package body effect is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -13,9 +15,9 @@ package body effect is case data.operation is when player_add => case data.operator is - when attribute_offense => core.increment (world.map.chads (1).attributes (attribute.offense)); - when attribute_wisdom => core.increment (world.map.chads (1).attributes (attribute.wisdom)); - when attribute_speed => core.increment (world.map.chads (1).attributes (attribute.speed)); + when attribute_offense => world.map.chads (1).attributes (attribute.offense) := world.map.chads (1).attributes (attribute.offense) + data.modifier; + when attribute_wisdom => world.map.chads (1).attributes (attribute.wisdom) := world.map.chads (1).attributes (attribute.wisdom) + data.modifier; + when attribute_speed => world.map.chads (1).attributes (attribute.speed) := world.map.chads (1).attributes (attribute.speed) + data.modifier; when others => null; end case; when others => null; diff --git a/source/equipment.ads b/source/equipment.ads index 0cacf7c..6de1407 100644 --- a/source/equipment.ads +++ b/source/equipment.ads @@ -45,7 +45,7 @@ package equipment is type information is record name : core.short_string; kind : slot; - attributes : attribute.points; + attributes : attribute.bonus; favor : faction.enumeration; evoke : effect.value; end record; diff --git a/source/main.adb b/source/main.adb index e8e6bce..199c3c1 100644 --- a/source/main.adb +++ b/source/main.adb @@ -29,7 +29,7 @@ procedure main is health => (30, 40), mana => (20, 30), stamina => (10, 20), - attributes => (1, 2, 3, 4, 5, 6), + attributes => attribute.default, skills => (1, 2, 3, 4, 5, 6, 7, 8, 9, others => 0), resources => ((101, 240), (103, 240), (107, 240), (109, 240), (113, 240), (127, 240)), equipments => (equipment.chest => equipment.elven_armour, @@ -327,7 +327,7 @@ begin view_show (index)); end loop; -- - resource.draw_points (world.map.chads (1).resources, (preview_width - 4 * icon * resource.count) / 2, (if view_list (map_preview_panel) then icon else 0)); + resource.draw_points (world.map.chads (1).resources, (preview_width - 5 * icon * resource.count) / 2, (if view_list (map_preview_panel) then icon else 0)); -- signal_list (signal_mode).all; -- @@ -347,7 +347,7 @@ begin ui.synchronize; end loop gameplay_loop; - world.mapshot (folder & "/test.png"); + --~world.mapshot (folder & "/mapshot.png"); ------------------------------------------------------------------------------------------ diff --git a/source/resource.adb b/source/resource.adb index 371165d..241abb6 100644 --- a/source/resource.adb +++ b/source/resource.adb @@ -38,11 +38,16 @@ package body resource is ------------------------------------------------------------------------------------------ procedure draw_points (data : in points; x, y : in integer) is + frame_width : constant integer := 4 * core.icon; begin for index in enumeration loop - ui.draw_icon (icon (index), trait (index).text, x + 4 * core.icon * enumeration'pos (index), y); - ui.draw_frame (trait (index).text, x + 4 * core.icon * enumeration'pos (index) + core.icon, y, 3 * core.icon, core.icon); - ui.write (data (index).value'image, x + 4 * core.icon * enumeration'pos (index) + core.icon - 1, y + 6, size => 18); + ui.draw_icon (icon (index), trait (index).text, x + (core.icon + frame_width) * enumeration'pos (index), y); + ui.draw_frame (trait (index).text, x + (core.icon + frame_width) * enumeration'pos (index) + core.icon, y, frame_width, core.icon); + -- + ui.write (text => data (index).value'image & " /" & data (index).limit'image, + x => x + (core.icon + frame_width) * enumeration'pos (index) + core.icon - 1, + y => y + 7, + size => 18); end loop; end draw_points; diff --git a/source/resource.ads b/source/resource.ads index 954b591..c4f5987 100644 --- a/source/resource.ads +++ b/source/resource.ads @@ -16,24 +16,24 @@ package resource is type information is record name : core.short_string; - base : natural; + base : core.point; text : core.long_string; end record; type points is array (enumeration) of core.point; - type prices is array (enumeration) of natural; + type price is array (enumeration) of natural; ------------------------------------------------------------------------------------------ count : constant natural := enumeration'pos (enumeration'last) + 1; trait : constant array (enumeration) of information := ( - ("Gold ", 0, "Gold is precious yellowish shiny metal, valued since ancient times. "), - ("Wood ", 0, "Wood is just bundle of lignin and cellulose, nothing more. "), - ("Stone ", 0, "Stone is essential building block for most constructions in this world. "), - ("Metal ", 0, "Metal as a resource is mixture of commonly found metalic elements. "), - ("Leather ", 0, "Leather is general purpose resource, used for armours and decorations. "), - ("Gem ", 0, "Gem as a resource is same as metal, just mixture of various gems. ") + gold => ("Gold ", (24, 480), "Gold is precious yellowish shiny metal, valued since ancient times. "), + wood => ("Wood ", (12, 240), "Wood is just bundle of lignin and cellulose, nothing more. "), + stone => ("Stone ", (12, 240), "Stone is essential building block for most constructions in this world. "), + metal => ("Metal ", (12, 240), "Metal as a resource is mixture of commonly found metalic elements. "), + leather => ("Leather ", (12, 240), "Leather is general purpose resource, used for armours and decorations. "), + gem => ("Gem ", (12, 240), "Gem as a resource is same as metal, just mixture of various gems. ") ); ------------------------------------------------------------------------------------------ diff --git a/source/unit.ads b/source/unit.ads index e4d2d09..91d8ffa 100644 --- a/source/unit.ads +++ b/source/unit.ads @@ -17,7 +17,7 @@ package unit is type information is record name : core.short_string := "-- "; kind : faction.enumeration := faction.neutral; - attributes : attribute.points := (others => 0); + attributes : attribute.bonus := (others => 0); daily_fee : natural := 0; equipments : equipment.equip_array := (others => equipment.none); end record;