diff --git a/icon/skill/aerokinesis.png b/icon/skill/aerokinesis.png new file mode 100644 index 0000000..58589e0 Binary files /dev/null and b/icon/skill/aerokinesis.png differ diff --git a/icon/skill/eremnokinesis.png b/icon/skill/eremnokinesis.png new file mode 100644 index 0000000..1227a6f Binary files /dev/null and b/icon/skill/eremnokinesis.png differ diff --git a/icon/skill/hydrokinesis.png b/icon/skill/hydrokinesis.png new file mode 100644 index 0000000..eb32d4e Binary files /dev/null and b/icon/skill/hydrokinesis.png differ diff --git a/icon/skill/khousokinesis.png b/icon/skill/khousokinesis.png new file mode 100644 index 0000000..345d1b5 Binary files /dev/null and b/icon/skill/khousokinesis.png differ diff --git a/icon/skill/none.png b/icon/skill/none.png new file mode 100644 index 0000000..01ea0e2 Binary files /dev/null and b/icon/skill/none.png differ diff --git a/icon/skill/phosokinesis.png b/icon/skill/phosokinesis.png new file mode 100644 index 0000000..796c7a3 Binary files /dev/null and b/icon/skill/phosokinesis.png differ diff --git a/icon/skill/pyrokinesis.png b/icon/skill/pyrokinesis.png new file mode 100644 index 0000000..b3035a8 Binary files /dev/null and b/icon/skill/pyrokinesis.png differ diff --git a/source/chad.ads b/source/chad.ads index c9fffeb..4f3f39a 100644 --- a/source/chad.ads +++ b/source/chad.ads @@ -23,9 +23,12 @@ package chad is bonus_resource : resource.enumeration; end record; - item_limit : constant natural := 24; + item_limit : constant natural := 24; + skill_limit : constant natural := 8; - type item_array is array (0 .. item_limit - 1) of equipment.enumeration; + type item_array is array (0 .. item_limit - 1) of equipment.enumeration; + type skill_array is array (0 .. skill_limit - 1) of skill.enumeration; + type skill_point is array (0 .. skill_limit - 1) of core.point; type information is record index : enumeration := ada; @@ -37,7 +40,8 @@ package chad is mana : core.point := (12, 12); movement : core.point := (12, 12); attributes : attribute.points := attribute.default; - skills : skill.points := skill.default; + skills : skill_array := (others => skill.none); + points : skill_point := (others => (0, 3)); resources : resource.points := resource.default; materials : material.points := material.default; equipments : equipment.equip_array := equipment.default; diff --git a/source/main.adb b/source/main.adb index cba2945..3fcaa0c 100644 --- a/source/main.adb +++ b/source/main.adb @@ -109,6 +109,9 @@ procedure main is text_box_height : integer := 0; player : chad.information := ( + skills => (skill.archery, skill.athletics, skill.tactics, skill.aerokinesis, skill.logistics, skill.leadership, skill.estates, skill.mysticism), + points => (others => (1, 3)), + -- equipments => (equipment.chest => equipment.iron_chestplate, equipment.head => equipment.iron_helmet, equipment.hands => equipment.iron_gauntlets, @@ -249,23 +252,15 @@ procedure main is end loop; end loop; -- - --~declare move_x : integer := x; - --~move_y : integer := y + 96 + 5 * 8 + 6 * core.icon; - --~begin - --~for index in skill.enumeration loop - --~if (skill.enumeration'pos (index) + 1) mod (skill.count / 2 + 1) = 0 then - --~move_x := x + 2 * core.icon + 120; - --~move_y := y + 96 + 5 * 8 + 6 * core.icon; - --~end if; - --~-- - --~ui.draw_icon (skill.icon (index), skill.description (index).text.all, move_x, move_y); - --~ui.draw_text_box (move_x + core.icon, move_y, core.icon, core.icon); - --~ui.write (player_1.skills (index).value'image, move_x + core.icon, move_y + 8, (others => 255), 15, true); - --~ui.write (skill.description (index).name.all, move_x + 2 * core.icon + 4, move_y + 8, (others => 255), 15, true); - --~-- - --~move_y := move_y + core.icon; - --~end loop; - --~end; + at_x := x + offset; + at_y := at_y + 3 * core.icon; + -- + for index in 0 .. chad.skill_limit - 1 loop + ui.draw_icon (skill.icon (player_1.skills (index)), skill.description (player_1.skills (index)).text.all, at_x, at_y + index * core.icon); + --~ui.draw_text_box (move_x + core.icon, move_y, core.icon, core.icon); + --~ui.write (player_1.skills (index).value'image, move_x + core.icon, move_y + 8, (others => 255), 15, true); + --~ui.write (skill.description (index).name.all, move_x + 2 * core.icon + 4, move_y + 8, (others => 255), 15, true); + end loop; end player_information; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/skill.ads b/source/skill.ads index db855ab..73f6509 100644 --- a/source/skill.ads +++ b/source/skill.ads @@ -9,17 +9,19 @@ package skill is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ type enumeration is ( + none, alchemy, archery, architecture, athletics, diplomacy, estates, exploration, leadership, logistics, medicine, mercantile, mysticism, - necromancy, resistance, skirmish, sorcery, tactics, thaumaturgy + necromancy, resistance, skirmish, sorcery, tactics, thaumaturgy, + pyrokinesis, hydrokinesis, aerokinesis, khousokinesis, phosokinesis, eremnokinesis ); ------------------------------------------------------------------------------------------ type definition is record - base : core.point; - name : access string; - text : access string; + base : core.point := (0, 3); + name : access string := new string'("--"); + text : access string := new string'("--"); end record; type points is array (enumeration) of core.point; @@ -29,27 +31,35 @@ package skill is count : constant natural := enumeration'pos (enumeration'last) + 1; - default : constant points := (others => (0, 24)); + default : constant points := (others => (0, 3)); description : constant array (enumeration) of definition := ( - alchemy => ((0, 24), new string'("Alchemy"), new string'("Alchemy skill determines effectiveness of your vials and potions.")), - archery => ((0, 24), new string'("Archery"), new string'("Archery skill determines effectiveness and range or your archers.")), - architecture => ((0, 24), new string'("Architecture"), new string'("Architecture decreases time spent on building constructions.")), - athletics => ((0, 24), new string'("Athletics"), new string'("Athletics increases movement speed of all your units, since they train.")), - diplomacy => ((0, 24), new string'("Diplomacy"), new string'("Diplomacy helps you to avoid starting a battle you can't win.")), - estates => ((0, 24), new string'("Estates"), new string'("Estates makes you the ultimate crypto-bro, establishing a blockchain.")), - exploration => ((0, 24), new string'("Exploration"), new string'("Exploration is quite self-explanatory by its' name, seriously.")), - leadership => ((0, 24), new string'("Leadership"), new string'("Leadership is the default skill for any true chad, like God intended.")), - logistics => ((0, 24), new string'("Logistics"), new string'("Logistics is a nightmare in real life, but this is only a game.")), - medicine => ((0, 24), new string'("Medicine"), new string'("Medicine skill makes you swallow pills like a kid in a drugstore.")), - mercantile => ((0, 24), new string'("Mercantile"), new string'("Mercantile is the skill of any true-born nosy person, otherwise useless.")), - mysticism => ((0, 24), new string'("Mysticism"), new string'("Mysticism allows you to have 60 cats, drink wine and talk weird.")), - necromancy => ((0, 24), new string'("Necromancy"), new string'("Necromancy lets you not to waste the bones after every battle.")), - resistance => ((0, 24), new string'("Resistence"), new string'("Resistence skill increases defense points of all your units slightly.")), - skirmish => ((0, 24), new string'("Skirmish"), new string'("Skirmish makes your units go berserk when they have little health left.")), - sorcery => ((0, 24), new string'("Sorcery"), new string'("Sorcery skill is appropriately named useless skill to have in real life.")), - tactics => ((0, 24), new string'("Tactics"), new string'("Tactics is the opposite of skirmish, master it and lose in every battle.")), - thaumaturgy => ((0, 24), new string'("Thaumaturgy"), new string'("Thaumaturgy lets you do nothing, and hope that the best will happen.")) + none => (others => <>), + -- + alchemy => ((0, 3), new string'("Alchemy"), new string'("Alchemy skill determines effectiveness of your vials and potions.")), + archery => ((0, 3), new string'("Archery"), new string'("Archery skill determines effectiveness and range or your archers.")), + architecture => ((0, 3), new string'("Architecture"), new string'("Architecture decreases time spent on building constructions.")), + athletics => ((0, 3), new string'("Athletics"), new string'("Athletics increases movement speed of all your units, since they train.")), + diplomacy => ((0, 3), new string'("Diplomacy"), new string'("Diplomacy helps you to avoid starting a battle you can't win.")), + estates => ((0, 3), new string'("Estates"), new string'("Estates makes you the ultimate crypto-bro, establishing a blockchain.")), + exploration => ((0, 3), new string'("Exploration"), new string'("Exploration is quite self-explanatory by its' name, seriously.")), + leadership => ((0, 3), new string'("Leadership"), new string'("Leadership is the default skill for any true chad, like God intended.")), + logistics => ((0, 3), new string'("Logistics"), new string'("Logistics is a nightmare in real life, but this is only a game.")), + medicine => ((0, 3), new string'("Medicine"), new string'("Medicine skill makes you swallow pills like a kid in a drugstore.")), + mercantile => ((0, 3), new string'("Mercantile"), new string'("Mercantile is the skill of any true-born nosy person, otherwise useless.")), + mysticism => ((0, 3), new string'("Mysticism"), new string'("Mysticism allows you to have 60 cats, drink wine and talk weird.")), + necromancy => ((0, 3), new string'("Necromancy"), new string'("Necromancy lets you not to waste the bones after every battle.")), + resistance => ((0, 3), new string'("Resistence"), new string'("Resistence skill increases defense points of all your units slightly.")), + skirmish => ((0, 3), new string'("Skirmish"), new string'("Skirmish makes your units go berserk when they have little health left.")), + sorcery => ((0, 3), new string'("Sorcery"), new string'("Sorcery skill is appropriately named useless skill to have in real life.")), + tactics => ((0, 3), new string'("Tactics"), new string'("Tactics is the opposite of skirmish, master it and lose in every battle.")), + thaumaturgy => ((0, 3), new string'("Thaumaturgy"), new string'("Thaumaturgy lets you do nothing, and hope that the best will happen.")), + pyrokinesis => ((0, 3), new string'("Pyrokinesis"), new string'("Pyrokinesis helps you to start fire quicker while cooking pork in camp.")), + hydrokinesis => ((0, 3), new string'("Hydrokinesis"), new string'("Hydrokinesis skill is for people who really like to drink water.")), + aerokinesis => ((0, 3), new string'("Aerokinesis"), new string'("Aerokinesis lets you fly, summon winds and then fall down.")), + khousokinesis => ((0, 3), new string'("Khousokinesis"), new string'("Khousokinesis is an essential skill for any proper farmer here.")), + phosokinesis => ((0, 3), new string'("Phosokinesis"), new string'("Phosokinesis allows you to bend the light and summon flying lamps.")), + eremnokinesis => ((0, 3), new string'("Eremnokinesis"), new string'("Eremnokinesis skill is for lonely, sad and depressed people only.")) ); icon : array (enumeration) of core.sprite; diff --git a/source/world.adb b/source/world.adb index 73c7285..5e567b6 100644 --- a/source/world.adb +++ b/source/world.adb @@ -316,10 +316,12 @@ package body world is core.save_point (file, map.chads (1).movement); -- for index in attribute.enumeration loop core.save_point (file, map.chads (1).attributes (index)); end loop; - for index in skill.enumeration loop core.save_point (file, map.chads (1).skills (index)); end loop; for index in resource.enumeration loop core.save_point (file, map.chads (1).resources (index)); end loop; for index in material.enumeration loop core.save_point (file, map.chads (1).materials (index)); end loop; -- + for index in 0 .. chad.skill_limit - 1 loop core.io.write (file, skill.enumeration'pos (map.chads (1).skills (index))); end loop; + for index in 0 .. chad.skill_limit - 1 loop core.save_point (file, map.chads (1).points (index)); end loop; + -- for kind in equipment.kind loop core.io.write (file, equipment.enumeration'pos (map.chads (1).equipments (kind))); end loop; @@ -385,10 +387,12 @@ package body world is core.load_point (file, map.chads (1).movement); -- for index in attribute.enumeration loop core.load_point (file, map.chads (1).attributes (index)); end loop; - for index in skill.enumeration loop core.load_point (file, map.chads (1).skills (index)); end loop; for index in resource.enumeration loop core.load_point (file, map.chads (1).resources (index)); end loop; for index in material.enumeration loop core.load_point (file, map.chads (1).materials (index)); end loop; -- + for index in 0 .. chad.skill_limit - 1 loop core.io.read (file, this); map.chads (1).skills (index) := skill.enumeration'val (this); end loop; + for index in 0 .. chad.skill_limit - 1 loop core.load_point (file, map.chads (1).points (index)); end loop; + -- for kind in equipment.kind loop core.io.read (file, this); map.chads (1).equipments (kind) := equipment.enumeration'val (this); end loop; @@ -910,10 +914,11 @@ package body world is ui.echo ("Player " & (if data.amount < 0 then "lost" else "gained") & integer'image (abs data.amount) & " " & attribute.description (attribute_index).name.all & " attribute points."); -- - when effect.modify_skill => skill_index := skill.enumeration'val (data.modifier); - player.skills (skill_index) := player.skills (skill_index) + data.amount; - ui.echo ("Player " & (if data.amount < 0 then "lost" else "gained") & integer'image (abs data.amount) & " " - & skill.description (skill_index).name.all & " skill points."); + when effect.modify_skill => null; + --~when effect.modify_skill => skill_index := skill.enumeration'val (data.modifier); + --~player.skills (skill_index) := player.skills (skill_index) + data.amount; + --~ui.echo ("Player " & (if data.amount < 0 then "lost" else "gained") & integer'image (abs data.amount) & " " + --~& skill.description (skill_index).name.all & " skill points."); -- when effect.modify_resource => resource_index := resource.enumeration'val (data.modifier); player.resources (resource_index) := player.resources (resource_index) + data.amount;