diff --git a/action.adb b/action.adb index 1f8798b..0fbdc90 100644 --- a/action.adb +++ b/action.adb @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with ada.text_io; diff --git a/action.ads b/action.ads index e7c4d9f..5e1977e 100644 --- a/action.ads +++ b/action.ads @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with ada.text_io; diff --git a/ammunition.ads b/ammunition.ads index 21faabf..9e13a0b 100644 --- a/ammunition.ads +++ b/ammunition.ads @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with core; diff --git a/animal.ads b/animal.ads index 5a9eddf..1cb5f72 100644 --- a/animal.ads +++ b/animal.ads @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with core; diff --git a/armour.ads b/armour.ads index 0cbfc1e..412e843 100644 --- a/armour.ads +++ b/armour.ads @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with core; diff --git a/core.adb b/core.adb index 21f4830..f7bf0a5 100644 --- a/core.adb +++ b/core.adb @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with ada.text_io; @@ -41,11 +37,11 @@ package body core is ada.text_io.put (carriage_return & line_feed); end screen_new_line; - procedure render_character (symbol : character := ' '; - colour : character := '7'; - effect : character := '0'; - y : screen_height := 0; - x : screen_width := 0) is + procedure render_character (symbol : character; + colour : character; + effect : character; + y : screen_height; + x : screen_width) is begin screen_symbol (y, x) := symbol; screen_colour (y, x) := colour; diff --git a/core.ads b/core.ads index b5c5af8..7f37a4d 100644 --- a/core.ads +++ b/core.ads @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with ada.text_io; @@ -63,7 +59,7 @@ package core is type constant_type is tagged record - entity : list := core.none; -- Entity identifier. + entity : list := core.none; -- Entity identifier. name : string (1 .. 20) := "- "; -- Entity general name. symbol : character := ' '; -- Entity ASCII character representation. colour : character := '7'; -- Entity VT100 escape sequence colour. @@ -89,18 +85,7 @@ package core is wrath : natural := 0; end record; - type mind_type is - record - fear : natural := 0; - pain : natural := 0; - thirst : natural := 0; - hunger : natural := 0; - exhaustion : natural := 0; - solitude : natural := 0; - faith : natural := 0; - end record; - - type body_type is + type health_type is record head : natural := 0; chest : natural := 0; @@ -111,6 +96,17 @@ package core is right_leg : natural := 0; end record; + type mana_type is + record + stamina : natural := 0; + fear : natural := 0; + pain : natural := 0; + thirst : natural := 0; + hunger : natural := 0; + exhaustion : natural := 0; + solitude : natural := 0; + end record; + ------------------------------------------------------------------------------------------ colour : colour_type; @@ -128,11 +124,11 @@ package core is procedure screen_show_cursor; procedure screen_new_line; - procedure render_character (symbol : character := ' '; - colour : character := '7'; - effect : character := '0'; - y : screen_height := 0; - x : screen_width := 0); + procedure render_character (symbol : character; + colour : character; + effect : character; + y : screen_height; + x : screen_width); procedure render_buffer; diff --git a/game.ads b/game.ads index 5cccbb8..3a17936 100644 --- a/game.ads +++ b/game.ads @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with core; diff --git a/item.ads b/item.ads index 472581b..a437cac 100644 --- a/item.ads +++ b/item.ads @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with core; diff --git a/magic.ads b/magic.ads index da70495..5bd9558 100644 --- a/magic.ads +++ b/magic.ads @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with core; diff --git a/main.adb b/main.adb index a375803..cf3a16f 100644 --- a/main.adb +++ b/main.adb @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with core, game, action, map, item, magic, ammunition, weapon, armour, plant, animal, monster, player; @@ -18,7 +14,7 @@ begin ------------------------------------------------------------------------------------------ - action.bind ('q', action.game_exit'access); + action.bind ('Q', action.game_exit'access); action.bind ('w', player.move_up'access); action.bind ('s', player.move_down'access); action.bind ('a', player.move_left'access); diff --git a/map.adb b/map.adb index f479828..2afe420 100644 --- a/map.adb +++ b/map.adb @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with core; diff --git a/map.ads b/map.ads index 1c09192..4f5e092 100644 --- a/map.ads +++ b/map.ads @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with core; diff --git a/monster.ads b/monster.ads index 02414e8..59b6dc9 100644 --- a/monster.ads +++ b/monster.ads @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with core; @@ -26,23 +22,34 @@ package monster is type constant_type is new core.constant_type with record - health_limit : natural := 0; - armour_limit : natural := 0; - mana_limit : natural := 0; - stamina_limit : natural := 0; - attack_range : natural := 0; + attack_range : natural := 0; end record; type variable_type is new core.variable_type with record - health : natural := 0; - armour : natural := 0; - mana : natural := 0; - stamina : natural := 0; + soul : core.soul_type; + health : core.health_type; + mana : core.mana_type; end record; + type constant_list is array (list) of constant_type; + type variable_list is array (mark) of variable_type; + ------------------------------------------------------------------------------------------ + constant_data : constant constant_list := ( + (core.monster, "Goblin Slave ", 'S', core.colour.green, core.effect.bold, 2), + (core.monster, "Goblin Worker ", 'R', core.colour.green, core.effect.bold, 3), + (core.monster, "Goblin Warrior ", 'W', core.colour.green, core.effect.bold, 5), + (core.monster, "Goblin Boar Rider ", 'B', core.colour.green, core.effect.bold, 11), + (core.monster, "Goblin Shaman ", 'H', core.colour.green, core.effect.bold, 3), + (core.monster, "Goblin Chief ", 'C', core.colour.green, core.effect.bold, 7), + (core.monster, "Goblin King ", 'K', core.colour.green, core.effect.bold, 13), + (core.monster, "Goblin Ogre ", 'O', core.colour.green, core.effect.bold, 23) + ); + + variable_data : variable_list; + ------------------------------------------------------------------------------------------ end monster; diff --git a/plant.ads b/plant.ads index 52dd23e..496b8a4 100644 --- a/plant.ads +++ b/plant.ads @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with core; diff --git a/player.adb b/player.adb index 3361deb..019ea8d 100644 --- a/player.adb +++ b/player.adb @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with core; diff --git a/player.ads b/player.ads index 5165b32..328579c 100644 --- a/player.ads +++ b/player.ads @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with core; diff --git a/weapon.ads b/weapon.ads index 70a83ef..c16b1bc 100644 --- a/weapon.ads +++ b/weapon.ads @@ -5,10 +5,6 @@ -- 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. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came --- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to --- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- with core;