2024-04-25 00:27:13 -04:00
|
|
|
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
|
|
|
|
--
|
|
|
|
-- GNU General Public Licence (version 3 or later)
|
|
|
|
|
2024-05-17 18:35:31 -04:00
|
|
|
with core, equipment, unit, construction, chad;
|
2024-02-15 21:03:09 -05:00
|
|
|
|
|
|
|
package world is
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
2024-04-26 19:46:09 -04:00
|
|
|
type biome is (
|
2024-04-27 09:04:47 -04:00
|
|
|
ash, sand, grass, rough, snow, swamp
|
2024-02-15 21:03:09 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
2024-05-03 05:28:44 -04:00
|
|
|
type landmark_index is (
|
2024-05-06 14:35:19 -04:00
|
|
|
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-16 15:28:02 -04:00
|
|
|
asters, daffodils, royal_grave, grave, humble_grave, wooden_wide_sign
|
2024-05-03 05:28:44 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
type landmark_trait is record
|
2024-05-16 15:28:02 -04:00
|
|
|
name : core.short_string;
|
2024-05-03 05:28:44 -04:00
|
|
|
spawn : biome;
|
|
|
|
clip : boolean;
|
|
|
|
frames : integer;
|
|
|
|
end record;
|
|
|
|
|
2024-05-05 11:38:15 -04:00
|
|
|
type entity_trait is record
|
|
|
|
index : natural;
|
2024-05-03 05:28:44 -04:00
|
|
|
x, y : integer;
|
|
|
|
end record;
|
|
|
|
|
2024-05-05 11:38:15 -04:00
|
|
|
type tile_array is array (natural range <>, natural range <>) of integer;
|
2024-05-06 08:38:47 -04:00
|
|
|
type clip_array is array (natural range <>, natural range <>) of boolean;
|
2024-05-06 13:59:08 -04:00
|
|
|
type view_array is array (natural range <>, natural range <>) of boolean;
|
2024-05-05 11:38:15 -04:00
|
|
|
type entity_array is array (natural range <>) of entity_trait;
|
2024-05-03 05:28:44 -04:00
|
|
|
|
|
|
|
type information is record
|
2024-05-05 11:38:15 -04:00
|
|
|
kind : biome;
|
|
|
|
width : natural;
|
|
|
|
height : natural;
|
|
|
|
tiles : access tile_array;
|
2024-05-06 08:38:47 -04:00
|
|
|
clips : access clip_array;
|
2024-05-06 13:59:08 -04:00
|
|
|
views : access view_array;
|
2024-05-05 11:38:15 -04:00
|
|
|
landmarks : access entity_array;
|
|
|
|
constructions : access entity_array;
|
2024-05-13 09:20:16 -04:00
|
|
|
equipments : access entity_array;
|
2024-05-09 05:07:20 -04:00
|
|
|
units : access entity_array;
|
2024-05-17 18:35:31 -04:00
|
|
|
chads : access entity_array;
|
|
|
|
chad_data : access chad.data_list;
|
2024-05-03 05:28:44 -04:00
|
|
|
end record;
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
2024-05-10 23:44:09 -04:00
|
|
|
biome_count : constant natural := biome'pos (biome'last) + 1;
|
|
|
|
|
2024-05-03 05:28:44 -04:00
|
|
|
landmarks : array (landmark_index) of core.sprite;
|
|
|
|
|
2024-05-16 15:28:02 -04:00
|
|
|
landmark_limit : constant integer := 360;
|
2024-05-15 05:06:15 -04:00
|
|
|
landmark_count : constant natural := landmark_index'pos (landmark_index'last) + 1;
|
2024-05-03 05:28:44 -04:00
|
|
|
|
|
|
|
trait : constant array (landmark_index) of landmark_trait := (
|
2024-05-16 15:28:02 -04:00
|
|
|
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)
|
2024-05-03 05:28:44 -04:00
|
|
|
);
|
|
|
|
|
|
|
|
map : information;
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
2024-02-15 21:03:09 -05:00
|
|
|
procedure configure;
|
|
|
|
|
2024-04-26 19:46:09 -04:00
|
|
|
procedure make (index : in biome; width, height : in natural);
|
2024-02-15 21:03:09 -05:00
|
|
|
|
2024-04-27 03:49:02 -04:00
|
|
|
procedure draw;
|
2024-02-15 21:03:09 -05:00
|
|
|
|
2024-05-09 15:54:39 -04:00
|
|
|
procedure mapshot (file_path : in string);
|
|
|
|
|
2024-05-12 10:07:37 -04:00
|
|
|
procedure reveal_map;
|
|
|
|
|
2024-05-17 18:35:31 -04:00
|
|
|
procedure add_chad (data : in chad.data; entity : in entity_trait);
|
|
|
|
|
2024-02-15 21:03:09 -05:00
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
end world;
|