From ab5dc8fcb03c8131b2852729c78e075bf9448d21 Mon Sep 17 00:00:00 2001 From: xolatile Date: Mon, 16 Oct 2023 14:28:07 -0400 Subject: [PATCH] Commiting... --- ammunition.adb | 47 +++++++++++++++++++++++++++++++++++++++++++++++ ammunition.ads | 5 +++++ animal.adb | 45 +++++++++++++++++++++++++++++++++++++++++++++ animal.ads | 5 +++++ armour.adb | 45 +++++++++++++++++++++++++++++++++++++++++++++ armour.ads | 5 +++++ compile.sh | 2 ++ magic.adb | 45 +++++++++++++++++++++++++++++++++++++++++++++ magic.ads | 5 +++++ monster.adb | 45 +++++++++++++++++++++++++++++++++++++++++++++ monster.ads | 5 +++++ plant.adb | 45 +++++++++++++++++++++++++++++++++++++++++++++ plant.ads | 5 +++++ 13 files changed, 304 insertions(+) create mode 100644 ammunition.adb create mode 100644 animal.adb create mode 100644 armour.adb create mode 100644 magic.adb create mode 100644 monster.adb create mode 100644 plant.adb diff --git a/ammunition.adb b/ammunition.adb new file mode 100644 index 0000000..3e8dd47 --- /dev/null +++ b/ammunition.adb @@ -0,0 +1,47 @@ +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- Copyright (c) 2023 - Ognjen 'xolatile' Milan Robovic +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- Xabina is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + +with core, map; + +package body ammunition is + + ------------------------------------------------------------------------------------------ + + procedure generate is + y : natural := 0; + x : natural := 0; + identifier : natural := 0; + begin + for this in map.mark + loop + y := core.randomize (0, natural (map.height'last)); + x := core.randomize (0, natural (map.width'last)); + identifier := core.randomize (0, natural (list'size)); + map.variable_data (this) := (integer (y), integer (x), core.ammunition, identifier); + end loop; + end generate; + + procedure render is + symbol : character := ' '; + colour : character := core.colour.white; + effect : character := core.effect.normal; + begin + for this in map.mark + loop + symbol := constant_data (list'val (map.variable_data (this).identifier)).symbol; + colour := constant_data (list'val (map.variable_data (this).identifier)).colour; + effect := constant_data (list'val (map.variable_data (this).identifier)).effect; + core.render_character (symbol, colour, effect, core.screen_height (map.variable_data (this).y), core.screen_width (map.variable_data (this).x)); + end loop; + end render; + + ------------------------------------------------------------------------------------------ + + ------------------------------------------------------------------------------------------ + +end ammunition; diff --git a/ammunition.ads b/ammunition.ads index 9e13a0b..5f9bd2c 100644 --- a/ammunition.ads +++ b/ammunition.ads @@ -52,4 +52,9 @@ package ammunition is ------------------------------------------------------------------------------------------ + procedure generate; + procedure render; + + ------------------------------------------------------------------------------------------ + end ammunition; diff --git a/animal.adb b/animal.adb new file mode 100644 index 0000000..9e648cc --- /dev/null +++ b/animal.adb @@ -0,0 +1,45 @@ +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- Copyright (c) 2023 - Ognjen 'xolatile' Milan Robovic +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- Xabina is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + +with core, map; + +package body animal is + + ------------------------------------------------------------------------------------------ + + procedure generate is + y : natural := 0; + x : natural := 0; + identifier : natural := 0; + begin + for this in map.mark + loop + y := core.randomize (0, natural (map.height'last)); + x := core.randomize (0, natural (map.width'last)); + identifier := core.randomize (0, natural (list'size)); + map.variable_data (this) := (integer (y), integer (x), core.animal, identifier); + end loop; + end generate; + + procedure render is + symbol : character := ' '; + colour : character := core.colour.white; + effect : character := core.effect.normal; + begin + for this in map.mark + loop + symbol := constant_data (list'val (map.variable_data (this).identifier)).symbol; + colour := constant_data (list'val (map.variable_data (this).identifier)).colour; + effect := constant_data (list'val (map.variable_data (this).identifier)).effect; + core.render_character (symbol, colour, effect, core.screen_height (map.variable_data (this).y), core.screen_width (map.variable_data (this).x)); + end loop; + end render; + + ------------------------------------------------------------------------------------------ + +end animal; diff --git a/animal.ads b/animal.ads index 1cb5f72..330cca0 100644 --- a/animal.ads +++ b/animal.ads @@ -134,4 +134,9 @@ package animal is ------------------------------------------------------------------------------------------ + procedure generate; + procedure render; + + ------------------------------------------------------------------------------------------ + end animal; diff --git a/armour.adb b/armour.adb new file mode 100644 index 0000000..14099be --- /dev/null +++ b/armour.adb @@ -0,0 +1,45 @@ +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- Copyright (c) 2023 - Ognjen 'xolatile' Milan Robovic +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- Xabina is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + +with core, map; + +package body armour is + + ------------------------------------------------------------------------------------------ + + procedure generate is + y : natural := 0; + x : natural := 0; + identifier : natural := 0; + begin + for this in map.mark + loop + y := core.randomize (0, natural (map.height'last)); + x := core.randomize (0, natural (map.width'last)); + identifier := core.randomize (0, natural (list'size)); + map.variable_data (this) := (integer (y), integer (x), core.armour, identifier); + end loop; + end generate; + + procedure render is + symbol : character := ' '; + colour : character := core.colour.white; + effect : character := core.effect.normal; + begin + for this in map.mark + loop + symbol := constant_data (list'val (map.variable_data (this).identifier)).symbol; + colour := constant_data (list'val (map.variable_data (this).identifier)).colour; + effect := constant_data (list'val (map.variable_data (this).identifier)).effect; + core.render_character (symbol, colour, effect, core.screen_height (map.variable_data (this).y), core.screen_width (map.variable_data (this).x)); + end loop; + end render; + + ------------------------------------------------------------------------------------------ + +end armour; diff --git a/armour.ads b/armour.ads index 412e843..8997593 100644 --- a/armour.ads +++ b/armour.ads @@ -53,4 +53,9 @@ package armour is ------------------------------------------------------------------------------------------ + procedure generate; + procedure render; + + ------------------------------------------------------------------------------------------ + end armour; diff --git a/compile.sh b/compile.sh index eec852c..2905161 100644 --- a/compile.sh +++ b/compile.sh @@ -2,6 +2,8 @@ set -xe +# WIP + rm -rf *.o *.ali gnatmake -o xabina main.adb diff --git a/magic.adb b/magic.adb new file mode 100644 index 0000000..3e6df28 --- /dev/null +++ b/magic.adb @@ -0,0 +1,45 @@ +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- Copyright (c) 2023 - Ognjen 'xolatile' Milan Robovic +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- Xabina is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + +with core, map; + +package body magic is + + ------------------------------------------------------------------------------------------ + + procedure generate is + y : natural := 0; + x : natural := 0; + identifier : natural := 0; + begin + for this in map.mark + loop + y := core.randomize (0, natural (map.height'last)); + x := core.randomize (0, natural (map.width'last)); + identifier := core.randomize (0, natural (list'size)); + map.variable_data (this) := (integer (y), integer (x), core.magic, identifier); + end loop; + end generate; + + procedure render is + symbol : character := ' '; + colour : character := core.colour.white; + effect : character := core.effect.normal; + begin + for this in map.mark + loop + symbol := constant_data (list'val (map.variable_data (this).identifier)).symbol; + colour := constant_data (list'val (map.variable_data (this).identifier)).colour; + effect := constant_data (list'val (map.variable_data (this).identifier)).effect; + core.render_character (symbol, colour, effect, core.screen_height (map.variable_data (this).y), core.screen_width (map.variable_data (this).x)); + end loop; + end render; + + ------------------------------------------------------------------------------------------ + +end magic; diff --git a/magic.ads b/magic.ads index 5bd9558..f09d46f 100644 --- a/magic.ads +++ b/magic.ads @@ -52,4 +52,9 @@ package magic is ------------------------------------------------------------------------------------------ + procedure generate; + procedure render; + + ------------------------------------------------------------------------------------------ + end magic; diff --git a/monster.adb b/monster.adb new file mode 100644 index 0000000..ad2e0f2 --- /dev/null +++ b/monster.adb @@ -0,0 +1,45 @@ +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- Copyright (c) 2023 - Ognjen 'xolatile' Milan Robovic +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- Xabina is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + +with core, map; + +package body monster is + + ------------------------------------------------------------------------------------------ + + procedure generate is + y : natural := 0; + x : natural := 0; + identifier : natural := 0; + begin + for this in map.mark + loop + y := core.randomize (0, natural (map.height'last)); + x := core.randomize (0, natural (map.width'last)); + identifier := core.randomize (0, natural (list'size)); + map.variable_data (this) := (integer (y), integer (x), core.monster, identifier); + end loop; + end generate; + + procedure render is + symbol : character := ' '; + colour : character := core.colour.white; + effect : character := core.effect.normal; + begin + for this in map.mark + loop + symbol := constant_data (list'val (map.variable_data (this).identifier)).symbol; + colour := constant_data (list'val (map.variable_data (this).identifier)).colour; + effect := constant_data (list'val (map.variable_data (this).identifier)).effect; + core.render_character (symbol, colour, effect, core.screen_height (map.variable_data (this).y), core.screen_width (map.variable_data (this).x)); + end loop; + end render; + + ------------------------------------------------------------------------------------------ + +end monster; diff --git a/monster.ads b/monster.ads index 59b6dc9..4c61a4d 100644 --- a/monster.ads +++ b/monster.ads @@ -52,4 +52,9 @@ package monster is ------------------------------------------------------------------------------------------ + procedure generate; + procedure render; + + ------------------------------------------------------------------------------------------ + end monster; diff --git a/plant.adb b/plant.adb new file mode 100644 index 0000000..656aa0a --- /dev/null +++ b/plant.adb @@ -0,0 +1,45 @@ +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- Copyright (c) 2023 - Ognjen 'xolatile' Milan Robovic +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +-- Xabina is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + +with core, map; + +package body plant is + + ------------------------------------------------------------------------------------------ + + procedure generate is + y : natural := 0; + x : natural := 0; + identifier : natural := 0; + begin + for this in map.mark + loop + y := core.randomize (0, natural (map.height'last)); + x := core.randomize (0, natural (map.width'last)); + identifier := core.randomize (0, natural (list'size)); + map.variable_data (this) := (integer (y), integer (x), core.plant, identifier); + end loop; + end generate; + + procedure render is + symbol : character := ' '; + colour : character := core.colour.white; + effect : character := core.effect.normal; + begin + for this in map.mark + loop + symbol := constant_data (list'val (map.variable_data (this).identifier)).symbol; + colour := constant_data (list'val (map.variable_data (this).identifier)).colour; + effect := constant_data (list'val (map.variable_data (this).identifier)).effect; + core.render_character (symbol, colour, effect, core.screen_height (map.variable_data (this).y), core.screen_width (map.variable_data (this).x)); + end loop; + end render; + + ------------------------------------------------------------------------------------------ + +end plant; diff --git a/plant.ads b/plant.ads index 496b8a4..440736d 100644 --- a/plant.ads +++ b/plant.ads @@ -55,4 +55,9 @@ package plant is ------------------------------------------------------------------------------------------ + procedure generate; + procedure render; + + ------------------------------------------------------------------------------------------ + end plant;