xabina/core.ads

113 lines
5.0 KiB
Ada

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- 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.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- 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;
package core is
type colour_type is
record
grey : character := '0';
red : character := '1';
green : character := '2';
yellow : character := '3';
blue : character := '4';
pink : character := '5';
cyan : character := '6';
white : character := '7';
end record;
type effect_type is
record
normal : character := '0';
bold : character := '1';
italic : character := '3';
underline : character := '4';
blink : character := '5';
contra : character := '7';
end record;
CANCEL : constant character := character'val (24);
CARRIAGE_RETURN : constant character := character'val (10);
LINE_FEED : constant character := character'val (13);
ESCAPE : constant character := character'val (27);
------------------------------------------------------------------------------------------
type description is new string (1 .. 144);
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Entity
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
type entity_list is (
ENTITY_NULL, ENTITY_MENU, ENTITY_MAP, ENTITY_ITEM, ENTITY_MAGIC, ENTITY_AMMUNITION, ENTITY_WEAPON, ENTITY_ARMOUR,
ENTITY_SCROLL, ENTITY_POTION, ENTITY_CONSUMABLE, ENTITY_NOTE, ENTITY_PLANT, ENTITY_ANIMAL, ENTITY_MONSTER, ENTITY_PLAYER
);
------------------------------------------------------------------------------------------
type entity_constant_type is tagged
record
entity : entity_list := ENTITY_NULL; -- Entity identifier.
name : string (1 .. 20) := "- "; -- Entity general name.
symbol : character := ' '; -- Entity ASCII character representation.
colour : character := '7'; -- Entity VT100 escape sequence colour.
effect : character := '0'; -- Entity VT100 escape sequence effect.
end record;
type entity_variable_type is tagged
record
x : integer := 0; -- Global X coordinate.
y : integer := 0; -- Global Y coordinate.
end record;
type soul_type is
record
envy : natural := 0;
gluttony : natural := 0;
greed : natural := 0;
lust : natural := 0;
pride : natural := 0;
sloth : natural := 0;
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
record
head : natural := 0;
chest : natural := 0;
stomach : natural := 0;
left_arm : natural := 0;
right_arm : natural := 0;
left_leg : natural := 0;
right_leg : natural := 0;
end record;
------------------------------------------------------------------------------------------
colour : colour_type;
effect : effect_type;
end core;