xhads/source/world.ads
2024-06-01 20:42:12 -04:00

248 lines
12 KiB
Ada

-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, attribute, skill, resource, material, equipment, unit, construction, chad, effect;
package world is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
type biome is (
ash, sand, grass, rough, snow, swamp
);
type landmark_index is (
dead_tree, mossy_rock, palm_tree, pine_tree, pine_forest, reeds,
rock, snowed_pine_tree, snowed_rock, spiky_rock, wooden_sign, wooden_arrow_sign,
rune_stone, snowed_rune_stone, mossy_rune_stone, snowed_pine_forest, hyacinths, orchids,
asters, daffodils, royal_grave, grave, humble_grave, wooden_wide_sign,
birch_tree, fir_tree, oak_tree
);
type location_index is (
well_of_agility, well_of_knowledge, well_of_strength, old_dwarven_grave, huge_ancient_urn, banana_tree,
apple_tree, cherry_tree, lemon_tree, orange_tree, pear_tree, peach_tree,
plum_tree
);
------------------------------------------------------------------------------------------
type landmark_stats is record
name : core.short_string;
spawn : biome;
clip : boolean;
frames : integer;
end record;
type location_stats is record
name : core.short_string;
clip : boolean;
frames : integer;
states : integer;
evoke : effect.information;
end record;
type entity_description is record
index : natural;
state : natural;
x, y : integer;
end record;
type integer_matrix is array (natural range <>, natural range <>) of integer;
type boolean_matrix is array (natural range <>, natural range <>) of boolean;
type entity_array is array (natural range <>) of entity_description;
type definition is record
kind : biome;
width : natural;
height : natural;
chad_count : natural;
chad_limit : natural;
tiles : access integer_matrix;
clips : access boolean_matrix;
views : access boolean_matrix;
landmarks : access entity_array;
locations : access entity_array;
constructions : access entity_array;
equipments : access entity_array;
units : access entity_array;
chads : access chad.informations;
end record;
------------------------------------------------------------------------------------------
biome_count : constant natural := biome'pos (biome'last) + 1;
landmarks : array (landmark_index) of core.sprite;
locations : array (location_index) of core.sprite;
landmark_count : constant natural := landmark_index'pos (landmark_index'last) + 1;
location_count : constant natural := location_index'pos (location_index'last) + 1;
landmark_description : constant array (landmark_index) of landmark_stats := (
dead_tree => ("Dead Tree ", ash, true, 1),
mossy_rock => ("Mossy Rock ", swamp, true, 1),
palm_tree => ("Palm Tree ", sand, true, 4),
pine_tree => ("Pine Tree ", grass, true, 4),
pine_forest => ("Pine Forest ", grass, true, 4),
reeds => ("Reeds ", swamp, false, 4),
rock => ("Rock ", sand, true, 1),
snowed_pine_tree => ("Snowed Pine Tree ", snow, true, 4),
snowed_rock => ("Snowed Rock ", snow, true, 1),
spiky_rock => ("Spiky Rock ", ash, true, 1),
wooden_sign => ("Wooden Sign ", grass, false, 1),
wooden_arrow_sign => ("Wooden Arrow Sign ", grass, false, 1),
rune_stone => ("Rune Stone ", grass, true, 4),
snowed_rune_stone => ("Snowed Rune Stone ", snow, true, 1),
mossy_rune_stone => ("Mossy Rune Stone ", swamp, true, 4),
snowed_pine_forest => ("Snowed Pine Forest ", snow, true, 4),
hyacinths => ("Hyacinths ", grass, false, 1),
orchids => ("Orchids ", grass, false, 1),
asters => ("Asters ", grass, false, 1),
daffodils => ("Daffodils ", grass, false, 1),
royal_grave => ("Royal Grave ", ash, true, 1),
grave => ("Grave ", ash, true, 1),
humble_grave => ("Humble Grave ", ash, true, 1),
wooden_wide_sign => ("Wooden Wide Sign ", grass, false, 1),
birch_tree => ("Birch Tree ", grass, true, 4),
fir_tree => ("Fir Tree ", grass, true, 4),
oak_tree => ("Oak Tree ", grass, true, 4)
);
location_description : constant array (location_index) of location_stats := (
well_of_agility => ("Well of Agility ", true, 4, 3, (effect.modify_attribute, attribute.enumeration'pos (attribute.speed), 2, false, 0)),
well_of_knowledge => ("Well of Knowledge ", true, 4, 3, (effect.modify_attribute, attribute.enumeration'pos (attribute.wisdom), 2, false, 0)),
well_of_strength => ("Well of Strength ", true, 4, 3, (effect.modify_attribute, attribute.enumeration'pos (attribute.offense), 2, false, 0)),
old_dwarven_grave => ("Old Dwarven Grave ", true, 1, 3, (effect.modify_attribute, attribute.enumeration'pos (attribute.defense), 1, false, 0)),
huge_ancient_urn => ("Huge Ancient Urn ", true, 1, 3, (effect.modify_attribute, attribute.enumeration'pos (attribute.offense), 1, false, 0)),
--
banana_tree => ("Banana Tree ", true, 4, 3, (effect.modify_material, material.enumeration'pos (material.banana), 4, true, 600)),
apple_tree => ("Apple Tree ", true, 4, 3, (effect.modify_material, material.enumeration'pos (material.apple), 6, true, 600)),
cherry_tree => ("Cherry Tree ", true, 4, 3, (effect.modify_material, material.enumeration'pos (material.cherry), 6, true, 600)),
lemon_tree => ("Lemon Tree ", true, 4, 3, (effect.modify_material, material.enumeration'pos (material.lemon), 6, true, 600)),
orange_tree => ("Orange Tree ", true, 4, 3, (effect.modify_material, material.enumeration'pos (material.orange), 6, true, 600)),
pear_tree => ("Pear Tree ", true, 4, 3, (effect.modify_material, material.enumeration'pos (material.pear), 6, true, 600)),
peach_tree => ("Peach Tree ", true, 4, 3, (effect.modify_material, material.enumeration'pos (material.peach), 6, true, 600)),
plum_tree => ("Plum Tree ", true, 4, 3, (effect.modify_material, material.enumeration'pos (material.plum), 6, true, 600))
);
month_name : constant array (1 .. 12) of core.unstring := (
core.unbound ("I <> Month of Red-Haired Goddess"),
core.unbound ("II <> Month of Xorana"),
core.unbound ("III <> Month of Heneal"),
core.unbound ("IV <> Month of Evelor"),
core.unbound ("V <> Month of Orohan"),
core.unbound ("VI <> Month of Aezora"),
core.unbound ("VII <> Month of Mitena"),
core.unbound ("VIII <> Month of Guarea"),
core.unbound ("IX <> Month of Kerena"),
core.unbound ("X <> Month of Uldrae"),
core.unbound ("XI <> Month of Kanako"),
core.unbound ("XII <> Month of Time-Rebirth")
);
week_name : constant array (1 .. 52) of core.unstring := (
core.unbound ("I <> Week of Miners"),
core.unbound ("II <> Week of Flora"),
core.unbound ("III <> Week of Alchemists"),
core.unbound ("IV <> Week of Shape"),
core.unbound ("V <> Week of Sword"),
core.unbound ("VI <> Week of Necromancers"),
core.unbound ("VII <> Week of Fauna"),
core.unbound ("VIII <> Week of --"),
core.unbound ("IX <> Week of Guards"),
core.unbound ("X <> Week of Blacksmiths"),
core.unbound ("XI <> Week of Archers"),
core.unbound ("XII <> Week of --"),
core.unbound ("XIII <> Week of Sound"),
core.unbound ("XIV <> Week of Water"),
core.unbound ("XV <> Week of Bankers"),
core.unbound ("XVI <> Week of --"),
core.unbound ("XVII <> Week of --"),
core.unbound ("XVIII <> Week of Thaumaturgs"),
core.unbound ("XIX <> Week of Stonecutters"),
core.unbound ("XX <> Week of --"),
core.unbound ("XXI <> Week of --"),
core.unbound ("XXII <> Week of Logic"),
core.unbound ("XXIII <> Week of Mystics"),
core.unbound ("XXIV <> Week of Diplomats"),
core.unbound ("XXV <> Week of Boots"),
core.unbound ("XXVI <> Week of Shield"),
core.unbound ("XXVII <> Week of Advisors"),
core.unbound ("XXVIII <> Week of Architects"),
core.unbound ("XXIX <> Week of Flame"),
core.unbound ("XXX <> Week of Value"),
core.unbound ("XXXI <> Week of Healers"),
core.unbound ("XXXII <> Week of Spear"),
core.unbound ("XXXIII <> Week of --"),
core.unbound ("XXXIV <> Week of Leaders"),
core.unbound ("XXXV <> Week of Skirmishers"),
core.unbound ("XXXVI <> Week of Lubmerjacks"),
core.unbound ("XXXVII <> Week of Pathfinders"),
core.unbound ("XXXVIII <> Week of --"),
core.unbound ("XXXIX <> Week of --"),
core.unbound ("XL <> Week of Helmet"),
core.unbound ("XLI <> Week of Leatherers"),
core.unbound ("XLII <> Week of --"),
core.unbound ("XLIII <> Week of --"),
core.unbound ("XLIV <> Week of Sorcerers"),
core.unbound ("XLV <> Week of Gloves"),
core.unbound ("XLVI <> Week of Earth"),
core.unbound ("XLVII <> Week of Explorers"),
core.unbound ("XLVIII <> Week of --"),
core.unbound ("XLIX <> Week of Strategists"),
core.unbound ("L <> Week of Gemologists"),
core.unbound ("LI <> Week of Merchants"),
core.unbound ("LII <> Week of World")
);
day_name : constant array (1 .. 7) of core.unstring := (
core.unbound ("I <> Day of Sun"),
core.unbound ("II <> Day of Mother-Moon"),
core.unbound ("III <> Day of Daughter-Moon"),
core.unbound ("IV <> Day of All-Earth"),
core.unbound ("V <> Day of All-Water"),
core.unbound ("VI <> Day of All-Sky"),
core.unbound ("VII <> Day of Deities")
);
map : definition;
------------------------------------------------------------------------------------------
procedure configure;
procedure make (index : in biome; width, height, chad_limit : in natural);
procedure save (file_name : in string);
procedure load (file_name : in string);
procedure draw;
procedure draw_performance_box;
procedure mapshot (file_path : in string);
function map_is_revealed return boolean;
procedure add_chad (data : in chad.information);
procedure resource_cheat_1;
procedure resource_cheat_2;
procedure resource_cheat_3;
procedure resource_cheat_4;
procedure resource_cheat_5;
procedure resource_cheat_6;
procedure reveal_map;
procedure restore_points;
procedure player_up;
procedure player_down;
procedure player_left;
procedure player_right;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end world;