2023-10-15 09:08:31 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- 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 ada.text_io ;
package core is
2023-10-15 12:40:35 -04:00
------------------------------------------------------------------------------------------
type screen_width is mod 120 ;
type screen_height is mod 40 ;
type screen_matrix is array ( screen_height , screen_width ) of character ;
------------------------------------------------------------------------------------------
2023-10-15 10:01:21 -04:00
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 ;
2023-10-15 09:08:31 -04:00
2023-10-15 12:40:35 -04:00
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 ) ;
2023-10-15 09:08:31 -04:00
------------------------------------------------------------------------------------------
type description is new string ( 1 . . 144 ) ;
2023-10-15 13:35:03 -04:00
type list is (
none , menu , map , item , magic , ammunition , weapon , armour ,
scroll , potion , consumable , note , plant , animal , monster , player
2023-10-15 09:08:31 -04:00
) ;
------------------------------------------------------------------------------------------
2023-10-15 13:35:03 -04:00
type constant_type is tagged
2023-10-15 09:08:31 -04:00
record
2023-10-15 14:31:43 -04:00
entity : list := core . none ; -- Entity identifier.
2023-10-15 09:08:31 -04:00
name : string ( 1 . . 20 ) := "- " ; -- Entity general name.
symbol : character := ' ' ; -- Entity ASCII character representation.
2023-10-15 10:01:21 -04:00
colour : character := ' 7 ' ; -- Entity VT100 escape sequence colour.
effect : character := ' 0 ' ; -- Entity VT100 escape sequence effect.
2023-10-15 09:08:31 -04:00
end record ;
2023-10-15 13:35:03 -04:00
type variable_type is tagged
2023-10-15 09:08:31 -04:00
record
x : integer := 0 ; -- Global X coordinate.
y : integer := 0 ; -- Global Y coordinate.
end record ;
2023-10-15 12:40:35 -04:00
------------------------------------------------------------------------------------------
2023-10-15 09:08:31 -04:00
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 ;
2023-10-15 14:31:43 -04:00
type health_type is
2023-10-15 09:08:31 -04:00
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 ;
2023-10-15 14:31:43 -04:00
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 ;
2023-10-15 09:08:31 -04:00
------------------------------------------------------------------------------------------
2023-10-15 10:01:21 -04:00
colour : colour_type ;
effect : effect_type ;
2023-10-15 09:08:31 -04:00
2023-10-15 12:40:35 -04:00
screen_symbol : screen_matrix := ( others => ( others => cancel ) ) ;
screen_colour : screen_matrix := ( others => ( others => colour . white ) ) ;
screen_effect : screen_matrix := ( others => ( others => effect . normal ) ) ;
------------------------------------------------------------------------------------------
procedure screen_delete ;
procedure screen_offset ;
procedure screen_hide_cursor ;
procedure screen_show_cursor ;
procedure screen_new_line ;
2023-10-15 14:31:43 -04:00
procedure render_character ( symbol : character ;
colour : character ;
effect : character ;
y : screen_height ;
x : screen_width ) ;
2023-10-15 12:40:35 -04:00
procedure render_buffer ;
------------------------------------------------------------------------------------------
2023-10-15 09:08:31 -04:00
end core ;