xhads/source/world.ads

251 lines
14 KiB
Ada
Raw Normal View History

-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
2024-05-31 07:14:00 -04:00
with core, attribute, skill, resource, material, equipment, unit, construction, chad, effect;
2024-02-15 21:03:09 -05:00
package world is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2024-04-26 19:46:09 -04:00
type biome is (
ash, sand, grass, rough, snow, swamp
2024-02-15 21:03:09 -05:00
);
type landmark_index is (
dead_tree, mossy_rock, palm_tree, pine_tree, pine_forest, reeds,
2024-05-15 05:06:15 -04:00
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,
2024-05-28 08:05:56 -04:00
asters, daffodils, royal_grave, grave, humble_grave, wooden_wide_sign,
birch_tree, fir_tree, oak_tree, old_willow_tree
);
type location_index is (
2024-05-28 08:05:56 -04:00
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 : access string;
spawn : biome;
clip : boolean;
frames : integer;
end record;
type location_stats is record
name : access string;
clip : boolean;
frames : integer;
states : integer;
evoke : effect.information;
end record;
type entity_description is record
index : natural;
2024-05-19 12:29:15 -04:00
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;
2024-05-15 05:06:15 -04:00
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 => (new string'("Dead Tree"), ash, true, 1),
mossy_rock => (new string'("Mossy Rock"), swamp, true, 1),
palm_tree => (new string'("Palm Tree"), sand, true, 4),
pine_tree => (new string'("Pine Tree"), grass, true, 4),
pine_forest => (new string'("Pine Forest"), grass, true, 4),
reeds => (new string'("Reeds"), swamp, false, 4),
rock => (new string'("Rock"), sand, true, 1),
snowed_pine_tree => (new string'("Snowed Pine Tree"), snow, true, 4),
snowed_rock => (new string'("Snowed Rock"), snow, true, 1),
spiky_rock => (new string'("Spiky Rock"), ash, true, 1),
wooden_sign => (new string'("Wooden Sign"), grass, false, 1),
wooden_arrow_sign => (new string'("Wooden Arrow Sign"), grass, false, 1),
rune_stone => (new string'("Rune Stone"), grass, true, 4),
snowed_rune_stone => (new string'("Snowed Rune Stone"), snow, true, 1),
mossy_rune_stone => (new string'("Mossy Rune Stone"), swamp, true, 4),
snowed_pine_forest => (new string'("Snowed Pine Forest"), snow, true, 4),
hyacinths => (new string'("Hyacinths"), grass, false, 1),
orchids => (new string'("Orchids"), grass, false, 1),
asters => (new string'("Asters"), grass, false, 1),
daffodils => (new string'("Daffodils"), grass, false, 1),
royal_grave => (new string'("Royal Grave"), ash, true, 1),
grave => (new string'("Grave"), ash, true, 1),
humble_grave => (new string'("Humble Grave"), ash, true, 1),
wooden_wide_sign => (new string'("Wooden Wide Sign"), grass, false, 1),
birch_tree => (new string'("Birch Tree"), grass, true, 4),
fir_tree => (new string'("Fir Tree"), grass, true, 4),
oak_tree => (new string'("Oak Tree"), grass, true, 4),
old_willow_tree => (new string'("Old Willow Tree"), swamp, true, 4)
);
location_description : constant array (location_index) of location_stats := (
well_of_agility => (new string'("Well of Agility"), true, 4, 3, (effect.modify_attribute, attribute.enumeration'pos (attribute.speed), 2, false, 0)),
well_of_knowledge => (new string'("Well of Knowledge"), true, 4, 3, (effect.modify_attribute, attribute.enumeration'pos (attribute.wisdom), 2, false, 0)),
well_of_strength => (new string'("Well of Strength"), true, 4, 3, (effect.modify_attribute, attribute.enumeration'pos (attribute.offense), 2, false, 0)),
old_dwarven_grave => (new string'("Old Dwarven Grave"), true, 1, 3, (effect.modify_attribute, attribute.enumeration'pos (attribute.defense), 1, false, 0)),
huge_ancient_urn => (new string'("Huge Ancient Urn"), true, 1, 3, (effect.modify_attribute, attribute.enumeration'pos (attribute.offense), 1, false, 0)),
2024-06-05 08:29:55 -04:00
banana_tree => (new string'("Banana Tree"), true, 4, 3, (effect.modify_material, material.enumeration'pos (material.banana), 4, true, 600)),
apple_tree => (new string'("Apple Tree"), true, 4, 3, (effect.modify_material, material.enumeration'pos (material.apple), 6, true, 600)),
cherry_tree => (new string'("Cherry Tree"), true, 4, 3, (effect.modify_material, material.enumeration'pos (material.cherry), 6, true, 600)),
lemon_tree => (new string'("Lemon Tree"), true, 4, 3, (effect.modify_material, material.enumeration'pos (material.lemon), 6, true, 600)),
orange_tree => (new string'("Orange Tree"), true, 4, 3, (effect.modify_material, material.enumeration'pos (material.orange), 6, true, 600)),
pear_tree => (new string'("Pear Tree"), true, 4, 3, (effect.modify_material, material.enumeration'pos (material.pear), 6, true, 600)),
peach_tree => (new string'("Peach Tree"), true, 4, 3, (effect.modify_material, material.enumeration'pos (material.peach), 6, true, 600)),
plum_tree => (new string'("Plum Tree"), true, 4, 3, (effect.modify_material, material.enumeration'pos (material.plum), 6, true, 600))
);
2024-06-05 08:29:55 -04:00
month_name : constant array (1 .. 13) of access string := (
new string'("I <> Month of Genesis"),
new string'("II <> Month of Life"),
2024-06-05 08:29:55 -04:00
new string'("III <> Month of Xorana"),
new string'("IV <> Month of Heneal"),
new string'("V <> Month of Evelor"),
new string'("VI <> Month of Orohan"),
new string'("VII <> Month of Aezora"),
new string'("VIII <> Month of Mitena"),
new string'("IX <> Month of Sheila"),
new string'("X <> Month of Iliona"),
new string'("XI <> Month of Uldrae"),
new string'("XII <> Month of Kanako"),
new string'("XIII <> Month of Death")
2024-06-01 15:10:31 -04:00
);
week_name : constant array (1 .. 52) of access string := (
2024-06-08 02:23:21 -04:00
new string'("I <> Week of Miners"), -- R 0 Gold
new string'("II <> Week of Flora"), -- D 0 Aezora
new string'("III <> Week of Alchemists"), -- S 0 Alchemy
new string'("IV <> Week of Shape"), -- D 7 Evelor
new string'("V <> Week of Sword"), -- A 0 Offense
new string'("VI <> Week of Necromancers"), -- S 12 Necromancy
new string'("VII <> Week of Fauna"), -- D 2 Sheila
new string'("VIII <> Week of Windmill"), -- S 20 Aerokinesis
new string'("IX <> Week of Guards"), -- S 13 Resistance
new string'("X <> Week of Blacksmiths"), -- R 3 Metal
new string'("XI <> Week of Archers"), -- S 1 Archery
new string'("XII <> Week of Bumblebee"), -- - --
new string'("XIII <> Week of Sound"), -- D 8 Orohan
new string'("XIV <> Week of Water"), -- D 3 Iliona
new string'("XV <> Week of Bankers"), -- S 5 Estates
new string'("XVI <> Week of Wall"), -- S 21 Khousokinesis
new string'("XVII <> Week of Axolotl"), -- - --
new string'("XVIII <> Week of Thaumaturgs"), -- S 17 Thaumaturgy
new string'("XIX <> Week of Stonecutters"), -- R 2 Stone
new string'("XX <> Week of Mole"), -- - --
new string'("XXI <> Week of Shrine"), -- S 22 Phosokinesis
new string'("XXII <> Week of Logic"), -- D 6 Heneal
new string'("XXIII <> Week of Mystics"), -- S 11 Mysticism
new string'("XXIV <> Week of Diplomats"), -- S 4 Diplomacy
new string'("XXV <> Week of Boots"), -- A 4 Speed
new string'("XXVI <> Week of Shield"), -- A 1 Defense
new string'("XXVII <> Week of Advisors"), -- S 8 Logistics
new string'("XXVIII <> Week of Architects"), -- S 2 Architecture
new string'("XXIX <> Week of Flame"), -- D 5 Kanako
new string'("XXX <> Week of Spider"), -- - --
new string'("XXXI <> Week of Value"), -- D 4 Uldrae
new string'("XXXII <> Week of Healers"), -- S 9 Medicine
new string'("XXXIII <> Week of Spear"), -- A 5 Reach
new string'("XXXIV <> Week of Gallows"), -- S 23 Eremnokinesis
new string'("XXXV <> Week of Leaders"), -- S 7 Leaderhsip
new string'("XXXVI <> Week of Skirmishers"), -- S 14 Skirmish
new string'("XXXVII <> Week of Lubmerjacks"), -- R 1 Wood
new string'("XXXVIII <> Week of Pathfinders"), -- S 3 Athletics
new string'("XXXIX <> Week of Frog"), -- - --
new string'("XL <> Week of Stakes"), -- S 18 Pyrokinesis
new string'("XLI <> Week of Helmet"), -- A 2 Wisdom
new string'("XLII <> Week of Leatherers"), -- R 4 Leather
new string'("XLIII <> Week of Rat"), -- - --
new string'("XLIV <> Week of Sorcerers"), -- S 15 Sorcery
new string'("XLV <> Week of Gloves"), -- A 3 Stamina
new string'("XLVI <> Week of Earth"), -- D 1 Mitena
new string'("XLVII <> Week of Explorers"), -- S 6 Exploration
new string'("XLVIII <> Week of Bridge"), -- S 19 Hydrokinesis
new string'("XLIX <> Week of Strategists"), -- S 16 Tactics
new string'("L <> Week of Gemologists"), -- R 5 Gem
new string'("LI <> Week of Merchants"), -- S 10 Mercantile
new string'("LII <> Week of Farce") -- D 9 Xorana (Osamu Dazai - The God of Farce)
2024-06-01 15:10:31 -04:00
);
day_name : constant array (1 .. 7) of access string := (
new string'("I <> Day of Sun"),
new string'("II <> Day of Mother-Moon"),
new string'("III <> Day of Daughter-Moon"),
new string'("IV <> Day of All-Earth"),
new string'("V <> Day of All-Water"),
new string'("VI <> Day of All-Sky"),
new string'("VII <> Day of Deities")
2024-06-01 15:10:31 -04:00
);
map : definition;
------------------------------------------------------------------------------------------
2024-02-15 21:03:09 -05:00
procedure configure;
procedure make (index : in biome; width, height, chad_limit : in natural);
2024-02-15 21:03:09 -05:00
procedure save (file_name : in string);
procedure load (file_name : in string);
procedure draw;
2024-02-15 21:03:09 -05:00
2024-06-01 20:42:12 -04:00
procedure draw_performance_box;
procedure mapshot (file_path : in string);
2024-05-22 21:22:34 -04:00
function map_is_revealed return boolean;
2024-05-12 10:07:37 -04:00
procedure add_chad (data : in chad.information);
2024-06-09 12:38:38 -04:00
procedure draw_unit (data : in unit.enumeration; state : in core.animation; x, y : in integer);
2024-05-22 21:22:34 -04:00
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;
2024-05-22 21:22:34 -04:00
procedure player_up;
procedure player_down;
procedure player_left;
procedure player_right;
2024-02-15 21:03:09 -05:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end world;