Added picking-up bananas...

This commit is contained in:
Ognjen Milan Robovic 2024-05-28 06:08:45 -04:00
parent f5fc9654b5
commit 34edd2ef72
9 changed files with 96 additions and 46 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 B

View File

@ -2,7 +2,7 @@
--
-- GNU General Public Licence (version 3 or later)
with core, ui, attribute, skill, resource, faction, equipment;
with core, ui, attribute, skill, resource, material, faction, equipment;
package body chad is
@ -143,6 +143,7 @@ package body chad is
attribute.save_points (here, data.attributes);
skill.save_points (here, data.skills);
resource.save_points (here, data.resources);
material.save_points (here, data.materials);
--~equipments : equipment.equip_array;
--~item_count : natural;
--~items : item_array;
@ -165,6 +166,7 @@ package body chad is
attribute.load_points (here, data.attributes);
skill.load_points (here, data.skills);
resource.load_points (here, data.resources);
material.load_points (here, data.materials);
--~equipments : equipment.equip_array;
--~item_count : natural;
--~items : item_array;

View File

@ -2,7 +2,7 @@
--
-- GNU General Public Licence (version 3 or later)
with core, attribute, skill, resource, faction, equipment;
with core, attribute, skill, resource, material, faction, equipment;
package chad is
@ -37,6 +37,7 @@ package chad is
attributes : attribute.points;
skills : skill.points;
resources : resource.points;
materials : material.points;
equipments : equipment.equip_array;
item_count : natural;
items : item_array;

View File

@ -13,37 +13,39 @@ package body effect is
procedure apply (data : in value) is
begin
case data.operation is
when offense => world.map.chads (1).attributes (attribute.offense) := world.map.chads (1).attributes (attribute.offense) + data.modifier;
when defense => world.map.chads (1).attributes (attribute.defense) := world.map.chads (1).attributes (attribute.defense) + data.modifier;
when wisdom => world.map.chads (1).attributes (attribute.wisdom) := world.map.chads (1).attributes (attribute.wisdom) + data.modifier;
when stamina => world.map.chads (1).attributes (attribute.stamina) := world.map.chads (1).attributes (attribute.stamina) + data.modifier;
when speed => world.map.chads (1).attributes (attribute.speed) := world.map.chads (1).attributes (attribute.speed) + data.modifier;
when reach => world.map.chads (1).attributes (attribute.reach) := world.map.chads (1).attributes (attribute.reach) + data.modifier;
when alchemy => world.map.chads (1).skills (skill.alchemy) := world.map.chads (1).skills (skill.alchemy) + data.modifier;
when archery => world.map.chads (1).skills (skill.archery) := world.map.chads (1).skills (skill.archery) + data.modifier;
when architecture => world.map.chads (1).skills (skill.architecture) := world.map.chads (1).skills (skill.architecture) + data.modifier;
when athletics => world.map.chads (1).skills (skill.athletics) := world.map.chads (1).skills (skill.athletics) + data.modifier;
when diplomacy => world.map.chads (1).skills (skill.diplomacy) := world.map.chads (1).skills (skill.diplomacy) + data.modifier;
when estates => world.map.chads (1).skills (skill.estates) := world.map.chads (1).skills (skill.estates) + data.modifier;
when exploration => world.map.chads (1).skills (skill.exploration) := world.map.chads (1).skills (skill.exploration) + data.modifier;
when leadership => world.map.chads (1).skills (skill.leadership) := world.map.chads (1).skills (skill.leadership) + data.modifier;
when logistics => world.map.chads (1).skills (skill.logistics) := world.map.chads (1).skills (skill.logistics) + data.modifier;
when medicine => world.map.chads (1).skills (skill.medicine) := world.map.chads (1).skills (skill.medicine) + data.modifier;
when mercantile => world.map.chads (1).skills (skill.mercantile) := world.map.chads (1).skills (skill.mercantile) + data.modifier;
when mysticism => world.map.chads (1).skills (skill.mysticism) := world.map.chads (1).skills (skill.mysticism) + data.modifier;
when necromancy => world.map.chads (1).skills (skill.necromancy) := world.map.chads (1).skills (skill.necromancy) + data.modifier;
when resistance => world.map.chads (1).skills (skill.resistance) := world.map.chads (1).skills (skill.resistance) + data.modifier;
when skirmish => world.map.chads (1).skills (skill.skirmish) := world.map.chads (1).skills (skill.skirmish) + data.modifier;
when sorcery => world.map.chads (1).skills (skill.sorcery) := world.map.chads (1).skills (skill.sorcery) + data.modifier;
when tactics => world.map.chads (1).skills (skill.tactics) := world.map.chads (1).skills (skill.tactics) + data.modifier;
when thaumaturgy => world.map.chads (1).skills (skill.thaumaturgy) := world.map.chads (1).skills (skill.thaumaturgy) + data.modifier;
when gold => world.map.chads (1).resources (resource.gold) := world.map.chads (1).resources (resource.gold) + data.modifier;
when wood => world.map.chads (1).resources (resource.wood) := world.map.chads (1).resources (resource.wood) + data.modifier;
when stone => world.map.chads (1).resources (resource.stone) := world.map.chads (1).resources (resource.stone) + data.modifier;
when metal => world.map.chads (1).resources (resource.metal) := world.map.chads (1).resources (resource.metal) + data.modifier;
when leather => world.map.chads (1).resources (resource.leather) := world.map.chads (1).resources (resource.leather) + data.modifier;
when gem => world.map.chads (1).resources (resource.gem) := world.map.chads (1).resources (resource.gem) + data.modifier;
when others => null;
when idle => null;
when offense => core.increment (world.map.chads (1).attributes (attribute.offense).value, data.modifier);
when defense => core.increment (world.map.chads (1).attributes (attribute.defense).value, data.modifier);
when wisdom => core.increment (world.map.chads (1).attributes (attribute.wisdom).value, data.modifier);
when stamina => core.increment (world.map.chads (1).attributes (attribute.stamina).value, data.modifier);
when speed => core.increment (world.map.chads (1).attributes (attribute.speed).value, data.modifier);
when reach => core.increment (world.map.chads (1).attributes (attribute.reach).value, data.modifier);
when alchemy => core.increment (world.map.chads (1).skills (skill.alchemy).value, data.modifier);
when archery => core.increment (world.map.chads (1).skills (skill.archery).value, data.modifier);
when architecture => core.increment (world.map.chads (1).skills (skill.architecture).value, data.modifier);
when athletics => core.increment (world.map.chads (1).skills (skill.athletics).value, data.modifier);
when diplomacy => core.increment (world.map.chads (1).skills (skill.diplomacy).value, data.modifier);
when estates => core.increment (world.map.chads (1).skills (skill.estates).value, data.modifier);
when exploration => core.increment (world.map.chads (1).skills (skill.exploration).value, data.modifier);
when leadership => core.increment (world.map.chads (1).skills (skill.leadership).value, data.modifier);
when logistics => core.increment (world.map.chads (1).skills (skill.logistics).value, data.modifier);
when medicine => core.increment (world.map.chads (1).skills (skill.medicine).value, data.modifier);
when mercantile => core.increment (world.map.chads (1).skills (skill.mercantile).value, data.modifier);
when mysticism => core.increment (world.map.chads (1).skills (skill.mysticism).value, data.modifier);
when necromancy => core.increment (world.map.chads (1).skills (skill.necromancy).value, data.modifier);
when resistance => core.increment (world.map.chads (1).skills (skill.resistance).value, data.modifier);
when skirmish => core.increment (world.map.chads (1).skills (skill.skirmish).value, data.modifier);
when sorcery => core.increment (world.map.chads (1).skills (skill.sorcery).value, data.modifier);
when tactics => core.increment (world.map.chads (1).skills (skill.tactics).value, data.modifier);
when thaumaturgy => core.increment (world.map.chads (1).skills (skill.thaumaturgy).value, data.modifier);
when gold => core.increment (world.map.chads (1).resources (resource.gold).value, data.modifier);
when wood => core.increment (world.map.chads (1).resources (resource.wood).value, data.modifier);
when stone => core.increment (world.map.chads (1).resources (resource.stone).value, data.modifier);
when metal => core.increment (world.map.chads (1).resources (resource.metal).value, data.modifier);
when leather => core.increment (world.map.chads (1).resources (resource.leather).value, data.modifier);
when gem => core.increment (world.map.chads (1).resources (resource.gem).value, data.modifier);
--
when take_material => core.increment (world.map.chads (1).materials (material.enumeration'val (data.modifier)).value, data.amount);
end case;
end apply;

View File

@ -7,11 +7,13 @@ package effect is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
type operation_index is (
idle,
offense, defense, wisdom, stamina, speed, reach,
alchemy, archery, architecture, athletics, diplomacy, estates,
exploration, leadership, logistics, medicine, mercantile, mysticism,
necromancy, resistance, skirmish, sorcery, tactics, thaumaturgy,
gold, wood, stone, metal, leather, gem
gold, wood, stone, metal, leather, gem,
take_material
);
------------------------------------------------------------------------------------------
@ -19,11 +21,12 @@ package effect is
type value is record
operation : operation_index;
modifier : integer;
amount : natural;
permanent : boolean;
duration : natural;
end record;
none : value;
none : constant value := (idle, 0, 0, false, 0);
------------------------------------------------------------------------------------------

View File

@ -129,6 +129,7 @@ procedure main is
attributes => attribute.default,
skills => skill.default,
resources => ((101, 240), (103, 240), (107, 240), (109, 240), (113, 240), (127, 240)),
materials => material.default,
equipments => (equipment.chest => equipment.elven_armour,
equipment.head => equipment.elven_helmet,
equipment.hands => equipment.leather_gauntlets,
@ -307,6 +308,7 @@ begin
end loop;
--
resource.draw_points (world.map.chads (1).resources, (preview_width - 5 * core.icon * resource.count) / 2, core.base);
material.draw_points (world.map.chads (1).materials, core.icon, 2 * core.base);
--
signal_list (core.signal_mode).all;
--

View File

@ -23,10 +23,39 @@ package body material is
------------------------------------------------------------------------------------------
procedure draw (index : in enumeration; x, y : in integer) is
procedure draw_points (data : in points := (others => (0, 0));
x : in integer := 0;
y : in integer := 0) is
move_x : integer := x;
begin
core.draw (sprite (index), x, y);
end draw;
for index in enumeration loop
if data (index).value > 0 then
ui.draw_icon (sprite (index), trait (index).name, move_x, y);
ui.draw_text_box (move_x, y + core.icon, core.icon, core.icon);
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 if;
end loop;
end draw_points;
------------------------------------------------------------------------------------------
procedure save_points (here : in core.io.file_type; data : in points) is
begin
for index in enumeration loop
core.save_point (here, data (index));
end loop;
end save_points;
------------------------------------------------------------------------------------------
procedure load_points (here : in core.io.file_type; data : out points) is
begin
for index in enumeration loop
core.load_point (here, data (index));
end loop;
end load_points;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -58,11 +58,20 @@ package material is
animal_fur => ("Animal Fur ", 7)
);
type points is array (enumeration) of core.point;
default : points := (others => (1, 12));
------------------------------------------------------------------------------------------
procedure configure;
procedure draw (index : in enumeration; x, y : in integer);
procedure draw_points (data : in points := (others => (0, 0));
x : in integer := 0;
y : in integer := 0);
procedure save_points (here : in core.io.file_type; data : in points);
procedure load_points (here : in core.io.file_type; data : out points);
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
--
-- GNU General Public Licence (version 3 or later)
with core, equipment, unit, construction, chad, effect;
with core, material, equipment, unit, construction, chad, effect;
package world is
@ -20,7 +20,7 @@ package world is
);
type location_index is (
well_of_agility, well_of_knowledge, well_of_strength, old_dwarven_grave, huge_ancient_urn
well_of_agility, well_of_knowledge, well_of_strength, old_dwarven_grave, huge_ancient_urn, banana_tree
);
------------------------------------------------------------------------------------------
@ -105,11 +105,13 @@ package world is
);
location_trait : constant array (location_index) of location_stats := (
well_of_agility => ("Well of Agility ", true, 4, 3, (effect.speed, 2, false, 0)),
well_of_knowledge => ("Well of Knowledge ", true, 4, 3, (effect.wisdom, 2, false, 0)),
well_of_strength => ("Well of Strength ", true, 4, 3, (effect.offense, 2, false, 0)),
old_dwarven_grave => ("Old Dwarven Grave ", true, 1, 3, (effect.defense, 1, false, 0)),
huge_ancient_urn => ("Huge Ancient Urn ", true, 1, 3, (effect.offense, 1, false, 0))
well_of_agility => ("Well of Agility ", true, 4, 3, (effect.speed, 2, 0, false, 0)),
well_of_knowledge => ("Well of Knowledge ", true, 4, 3, (effect.wisdom, 2, 0, false, 0)),
well_of_strength => ("Well of Strength ", true, 4, 3, (effect.offense, 2, 0, false, 0)),
old_dwarven_grave => ("Old Dwarven Grave ", true, 1, 3, (effect.defense, 1, 0, false, 0)),
huge_ancient_urn => ("Huge Ancient Urn ", true, 1, 3, (effect.offense, 1, 0, false, 0)),
--
banana_tree => ("Banana Tree ", true, 4, 3, (effect.take_material, material.enumeration'pos (material.banana), 4, true, 600))
);
map : information;