2023-10-09 14:49:12 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2023 - Ognjen 'xolatile' Milan Robovic
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-09 16:33:18 -04:00
-- 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
2023-10-09 14:49:12 -04:00
-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-08 15:11:04 -04:00
-- 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
2023-10-09 14:49:12 -04:00
-- 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...
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-08 15:11:04 -04:00
2023-10-12 10:26:53 -04:00
with ada.text_io ;
use ada.text_io ;
2023-10-08 15:11:04 -04:00
2023-10-09 16:33:18 -04:00
-- Do not use this command below, it's for real-time game...
2023-10-10 15:49:36 -04:00
-- $ gnatmake xabina.adb
-- $ stty raw -echo && ./xabina && stty sane
2023-10-08 15:11:04 -04:00
function xabina return integer is
2023-10-09 14:49:12 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- System
2023-10-09 14:56:48 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-08 15:11:04 -04:00
2023-10-11 10:48:41 -04:00
COLOUR_GREY : constant character := ' 0 ' ;
COLOUR_RED : constant character := ' 1 ' ;
COLOUR_GREEN : constant character := ' 2 ' ;
COLOUR_YELLOW : constant character := ' 3 ' ;
COLOUR_BLUE : constant character := ' 4 ' ;
COLOUR_PINK : constant character := ' 5 ' ;
COLOUR_CYAN : constant character := ' 6 ' ;
COLOUR_WHITE : constant character := ' 7 ' ;
EFFECT_NORMAL : constant character := ' 0 ' ;
EFFECT_BOLD : constant character := ' 1 ' ;
EFFECT_ITALIC : constant character := ' 3 ' ;
EFFECT_UNDERLINE : constant character := ' 4 ' ;
EFFECT_BLINK : constant character := ' 5 ' ;
EFFECT_REVERSE : constant character := ' 7 ' ;
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-10 23:46:07 -04:00
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
procedure action_idle ;
type procedure_pointer is access procedure ;
type ascii_range is mod 2 * * 8 ;
type action_data is array ( ascii_range ) of procedure _pointer ;
type screen_width is mod 120 ;
type screen_height is mod 40 ;
type screen_type is array ( screen_height , screen_width ) of character ;
------------------------------------------------------------------------------------------
active : boolean := true ;
signal : character := ' ' ;
action_list : action_data := ( others => action_idle ' access ) ;
screen_symbol : screen_type := ( others => ( others => CANCEL ) ) ;
screen_colour : screen_type := ( others => ( others => COLOUR_WHITE ) ) ;
screen_effect : screen_type := ( others => ( others => EFFECT_NORMAL ) ) ;
------------------------------------------------------------------------------------------
procedure bind ( symbol : character := CANCEL ;
action : procedure _pointer := action_idle ' access ) is
begin
action_list ( character ' pos ( symbol ) ) := action ;
end bind ;
procedure unbind ( symbol : character := CANCEL ) is
begin
action_list ( character ' pos ( symbol ) ) := action_idle ' access ;
end unbind ;
procedure action_idle is begin null ; end action_idle ;
procedure action_exit is begin active := false ; end action_exit ;
procedure render_screen_delete is begin put ( ESCAPE & "[2J" ) ; end render_screen_delete ;
procedure render_screen_offset is begin put ( ESCAPE & "[H" ) ; end render_screen_offset ;
procedure render_cursor_hide is begin put ( ESCAPE & "[?25l" ) ; end render_cursor_hide ;
procedure render_cursor_show is begin put ( ESCAPE & "[?25h" ) ; end render_cursor_show ;
procedure render_realignment is begin put ( CARRIAGE_RETURN & LINE_FEED ) ; end render_realignment ;
procedure render_character ( symbol : character := ' ' ;
colour : character := COLOUR_WHITE ;
effect : character := EFFECT_NORMAL ;
y : screen_height := 0 ;
x : screen_width := 0 ) is
begin
screen_symbol ( y , x ) := symbol ;
screen_colour ( y , x ) := colour ;
screen_effect ( y , x ) := effect ;
end render_character ;
procedure render_screen is
format : string ( 1 . . 12 ) := ESCAPE & "[E;3CmS" & ESCAPE & "[0m" ;
begin
render_screen_offset ;
for y in screen_height
loop
for x in screen_width
loop
format ( 8 ) := screen_symbol ( y , x ) ;
format ( 6 ) := screen_colour ( y , x ) ;
format ( 3 ) := screen_effect ( y , x ) ;
put ( format ) ;
end loop ;
render_realignment ;
end loop ;
end render_screen ;
2023-10-09 14:49:12 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Entity
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-11 10:48:41 -04:00
type entity_list is (
2023-10-10 13:36:30 -04:00
ENTITY_NULL , ENTITY_MENU , ENTITY_MAP , ENTITY_ITEM , ENTITY_MAGIC , ENTITY_AMMUNITION , ENTITY_WEAPON , ENTITY_ARMOUR ,
2023-10-09 16:49:02 -04:00
ENTITY_SCROLL , ENTITY_POTION , ENTITY_CONSUMABLE , ENTITY_NOTE , ENTITY_PLANT , ENTITY_ANIMAL , ENTITY_GOBLIN , ENTITY_PLAYER
2023-10-09 14:56:48 -04:00
) ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-09 14:49:12 -04:00
type entity_constant_type is tagged
record
2023-10-12 10:26:53 -04:00
entity : entity_list := ENTITY_NULL ; -- Entity identifier.
name : string ( 1 . . 20 ) := "- " ; -- Entity general name.
symbol : character := ' ' ; -- Entity ASCII character representation.
colour : character := COLOUR_WHITE ; -- Entity VT100 escape sequence colour.
effect : character := EFFECT_NORMAL ; -- Entity VT100 escape sequence effect.
2023-10-09 14:49:12 -04:00
end record ;
type entity_variable_type is tagged
record
x : integer := 0 ; -- Global X coordinate.
y : integer := 0 ; -- Global Y coordinate.
end record ;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-09 16:49:02 -04:00
-- Menu
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-11 16:25:59 -04:00
-- Map
2023-10-09 14:49:12 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-09 16:33:18 -04:00
type map_list is (
2023-10-11 16:25:59 -04:00
MAP_STONE_WALL , MAP_WOODEN_WALL , MAP_STONE_FLOOR , MAP_WOODEN_FLOOR , MAP_WATER_SHALLOW , MAP_WATER_DEEP , MAP_SWAMP_SHALLOW , MAP_SWAMP_DEEP
2023-10-09 14:49:12 -04:00
) ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
type map_width is mod 120 ;
type map_height is mod 40 ;
2023-10-09 14:49:12 -04:00
type map_constant_type is new entity_constant_type with
2023-10-08 15:11:04 -04:00
record
2023-10-09 16:33:18 -04:00
collide : boolean := false ;
2023-10-08 15:11:04 -04:00
end record ;
2023-10-11 16:00:21 -04:00
type map_constant_list is array ( map_list ) of map_constant_type ;
type map_variable_list is array ( map_height , map_width ) of map_list ;
2023-10-08 15:11:04 -04:00
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-09 16:33:18 -04:00
map_constant_data : constant map_constant_list := (
2023-10-12 10:26:53 -04:00
( ENTITY_MAP , "Stone Wall " , '#' , COLOUR_GREY , EFFECT_BOLD , true ) ,
( ENTITY_MAP , "Wooden Wall " , '#' , COLOUR_YELLOW , EFFECT_NORMAL , true ) ,
( ENTITY_MAP , "Stone Floor " , '.' , COLOUR_GREY , EFFECT_BOLD , false ) ,
( ENTITY_MAP , "Wooden Floor " , '.' , COLOUR_YELLOW , EFFECT_NORMAL , false ) ,
( ENTITY_MAP , "Water (shallow) " , '~' , COLOUR_BLUE , EFFECT_NORMAL , false ) ,
( ENTITY_MAP , "Water (deep) " , '~' , COLOUR_BLUE , EFFECT_BOLD , true ) ,
( ENTITY_MAP , "Swamp (shallow) " , '~' , COLOUR_GREEN , EFFECT_NORMAL , false ) ,
( ENTITY_MAP , "Swamp (deep) " , '~' , COLOUR_GREEN , EFFECT_BOLD , true )
2023-10-08 15:11:04 -04:00
) ;
2023-10-11 16:00:21 -04:00
map_variable_data : map_variable_list ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-11 16:00:21 -04:00
procedure generate_map is
begin
for y in map_height
loop
for x in map_width
loop
2023-10-11 16:25:59 -04:00
map_variable_data ( y , x ) := MAP_STONE_FLOOR ;
2023-10-11 16:00:21 -04:00
end loop ;
end loop ;
end generate_map ;
2023-10-11 16:25:59 -04:00
procedure render_map is
symbol : character := ' ' ;
colour : character := COLOUR_WHITE ;
effect : character := EFFECT_NORMAL ;
begin
for y in screen_height
loop
for x in screen_width
loop
symbol := map_constant_data ( map_variable_data ( map_height ( y ) , map_width ( x ) ) ) . symbol ;
colour := map_constant_data ( map_variable_data ( map_height ( y ) , map_width ( x ) ) ) . colour ;
effect := map_constant_data ( map_variable_data ( map_height ( y ) , map_width ( x ) ) ) . effect ;
render_character ( symbol , colour , effect , y , x ) ;
end loop ;
end loop ;
end render_map ;
2023-10-09 14:49:12 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-09 16:49:02 -04:00
-- Item
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-09 23:10:19 -04:00
type item_list is (
WOOD , BARK , FLAX , PLANK , STICK , BRACES , NAILS , LINEN ,
CHAMOMILE , MINT , WAX , SALT , SUGAR , PEPPER , CINNAMON , YEAST ,
SKULL , BONE , INTESTINES , FUR , LEATHER , FAT , HORN , TUSK ,
COPPER_ORE , IRON_ORE , SILVER_ORE , GOLD_ORE , COAL_ORE , TIN_ORE , ZINC_ORE , LEAD_ORE ,
COPPER , IRON , SILVER , GOLD , COAL , TIN , ZINC , LEAD ,
BRONZE , BRASS , STEEL , MERCURY , OIL , INK , VENOM , SILK ,
PAPERS , PAPERWEIGHT
) ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-09 23:10:19 -04:00
type item_mark is mod 72 ;
type item_constant_type is new entity_constant_type with
record
value : natural := 0 ;
weight : natural := 0 ;
end record ;
type item_variable_type is new entity_variable_type with
record
owner : natural := 0 ;
end record ;
type item_constant_list is array ( item_list ) of item_constant_type ;
type item_variable_list is array ( item_mark ) of item_variable_type ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-09 23:10:19 -04:00
item_constant_data : constant item_constant_list := (
2023-10-12 10:26:53 -04:00
( ENTITY_ITEM , "Wood " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 2 , 2 ) ,
( ENTITY_ITEM , "Bark " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 1 , 2 ) ,
( ENTITY_ITEM , "Flax " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 3 , 1 ) ,
( ENTITY_ITEM , "Plank " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 2 , 2 ) ,
( ENTITY_ITEM , "Stick " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 2 , 2 ) ,
( ENTITY_ITEM , "Braces " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 2 , 1 ) ,
( ENTITY_ITEM , "Nails " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 1 , 1 ) ,
( ENTITY_ITEM , "Linen " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 23 , 1 ) ,
( ENTITY_ITEM , "Chamomile " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 3 , 1 ) ,
( ENTITY_ITEM , "Mint " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 5 , 1 ) ,
( ENTITY_ITEM , "Wax " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 7 , 1 ) ,
( ENTITY_ITEM , "Salt " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 13 , 1 ) ,
( ENTITY_ITEM , "Sugar " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 17 , 1 ) ,
( ENTITY_ITEM , "Pepper " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 11 , 1 ) ,
( ENTITY_ITEM , "Cinnamon " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 23 , 1 ) ,
( ENTITY_ITEM , "Yeast " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 5 , 1 ) ,
( ENTITY_ITEM , "Skull " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 2 , 1 ) ,
( ENTITY_ITEM , "Bone " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 1 , 1 ) ,
( ENTITY_ITEM , "Intestines " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 1 , 1 ) ,
( ENTITY_ITEM , "Fur " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 7 , 2 ) ,
( ENTITY_ITEM , "Leather " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 3 , 1 ) ,
( ENTITY_ITEM , "Fat " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 1 , 1 ) ,
( ENTITY_ITEM , "Horn " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 2 , 1 ) ,
( ENTITY_ITEM , "Tusk " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 3 , 5 ) ,
( ENTITY_ITEM , "Copper Ore " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 5 , 7 ) ,
( ENTITY_ITEM , "Iron Ore " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 7 , 11 ) ,
( ENTITY_ITEM , "Silver Ore " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 17 , 7 ) ,
( ENTITY_ITEM , "Gold Ore " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 23 , 7 ) ,
( ENTITY_ITEM , "Coal Ore " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 2 , 7 ) ,
( ENTITY_ITEM , "Tin Ore " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 13 , 7 ) ,
( ENTITY_ITEM , "Zinc Ore " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 13 , 7 ) ,
( ENTITY_ITEM , "Lead Ore " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 11 , 13 ) ,
( ENTITY_ITEM , "Copper " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 17 , 5 ) ,
( ENTITY_ITEM , "Iron " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 19 , 7 ) ,
( ENTITY_ITEM , "Silver " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 23 , 5 ) ,
( ENTITY_ITEM , "Gold " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 29 , 5 ) ,
( ENTITY_ITEM , "Coal " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 19 , 5 ) ,
( ENTITY_ITEM , "Tin " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 11 , 5 ) ,
( ENTITY_ITEM , "Zinc " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 13 , 5 ) ,
( ENTITY_ITEM , "Lead " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 47 , 7 ) ,
( ENTITY_ITEM , "Bronze " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 61 , 5 ) ,
( ENTITY_ITEM , "Brass " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 67 , 5 ) ,
( ENTITY_ITEM , "Steel " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 71 , 7 ) ,
( ENTITY_ITEM , "Mercury " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 97 , 11 ) ,
( ENTITY_ITEM , "Oil " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 5 , 1 ) ,
( ENTITY_ITEM , "Ink " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 13 , 1 ) ,
( ENTITY_ITEM , "Venom " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 11 , 1 ) ,
( ENTITY_ITEM , "Silk " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 13 , 1 ) ,
( ENTITY_ITEM , "Papers " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 1 , 1 ) ,
( ENTITY_ITEM , "Paperweight " , '+' , COLOUR_YELLOW , EFFECT_NORMAL , 2 , 1 )
2023-10-09 23:10:19 -04:00
) ;
item_variable_data : item_variable_list ;
2023-10-09 16:49:02 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Spell
2023-10-10 13:36:30 -04:00
-- -- Place-holders mostly, implement self/target/target_range effect variations...
2023-10-09 16:49:02 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-10 13:36:30 -04:00
type magic_list is (
IGNITE , ILLUMINATE , BLADECHARM , BATTLECRY
) ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-10 13:36:30 -04:00
type magic_mark is mod 72 ;
type magic_constant_type is new entity_constant_type with
record
self : boolean := false ;
health : integer := 0 ;
armour : integer := 0 ;
mana : integer := 0 ;
stamina : integer := 0 ;
distance : integer := 0 ;
tribute : natural := 0 ;
end record ;
type magic_variable_type is new entity_variable_type with
record
enchantment : natural := 0 ;
end record ;
type magic_constant_list is array ( magic_list ) of magic_constant_type ;
type magic_variable_list is array ( magic_mark ) of magic_variable_type ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-10 13:36:30 -04:00
magic_constant_data : constant magic_constant_list := (
2023-10-12 10:26:53 -04:00
( ENTITY_MAGIC , "Ignite " , '*' , COLOUR_YELLOW , EFFECT_ITALIC , false , - 3 , 0 , 0 , - 1 , 7 , 1 ) ,
( ENTITY_MAGIC , "Illuminate " , '*' , COLOUR_YELLOW , EFFECT_ITALIC , false , 0 , 0 , 0 , - 1 , 13 , 1 ) ,
( ENTITY_MAGIC , "Bladecharm " , '*' , COLOUR_RED , EFFECT_ITALIC , true , 0 , - 3 , 0 , - 1 , 7 , 3 ) ,
( ENTITY_MAGIC , "Battlecry " , '*' , COLOUR_RED , EFFECT_ITALIC , true , - 1 , - 1 , 0 , - 1 , 7 , 2 )
2023-10-10 13:36:30 -04:00
) ;
magic_variable_data : magic_variable_list ;
2023-10-09 16:49:02 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Ammunition
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-10 13:58:50 -04:00
type ammunition_list is (
ARROWS , BOLTS , SLINGSHOTS , JARIDS
) ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-10 13:58:50 -04:00
type ammunition_mark is mod 72 ;
type ammunition_constant_type is new entity_constant_type with
record
2023-10-11 10:48:41 -04:00
value : natural := 0 ;
weight : natural := 0 ;
dual_wield : boolean := false ;
amount_limit : natural := 0 ;
attack_range : natural := 0 ;
distance_range : natural := 0 ;
2023-10-10 13:58:50 -04:00
end record ;
type ammunition_variable_type is new entity_variable_type with
record
2023-10-11 10:48:41 -04:00
amount : natural := 0 ;
enchantment : natural := 0 ;
2023-10-10 13:58:50 -04:00
end record ;
type ammunition_constant_list is array ( ammunition_list ) of ammunition_constant_type ;
type ammunition_variable_list is array ( ammunition_mark ) of ammunition_variable_type ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-10 13:58:50 -04:00
ammunition_constant_data : constant ammunition_constant_list := (
2023-10-12 10:26:53 -04:00
( ENTITY_AMMUNITION , "Arrows " , '^' , COLOUR_RED , EFFECT_NORMAL , 11 , 13 , false , 23 , 7 , 67 ) ,
( ENTITY_AMMUNITION , "Bolts " , '^' , COLOUR_RED , EFFECT_NORMAL , 13 , 23 , false , 29 , 5 , 67 ) ,
( ENTITY_AMMUNITION , "Slingshots " , '^' , COLOUR_RED , EFFECT_NORMAL , 5 , 7 , true , 43 , 7 , 67 ) ,
( ENTITY_AMMUNITION , "Jarids " , '^' , COLOUR_RED , EFFECT_NORMAL , 29 , 37 , true , 7 , 7 , 67 )
2023-10-10 13:58:50 -04:00
) ;
ammunition_variable_data : ammunition_variable_list ;
2023-10-09 16:49:02 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-09 16:33:18 -04:00
-- Weapon
2023-10-09 14:56:48 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-09 16:33:18 -04:00
type weapon_list is (
2023-10-10 15:49:36 -04:00
IRON_SWORD , IRON_GREATSWORD , IRON_AXE , IRON_BATTLEAXE , IRON_SPEAR , IRON_SHIELD , IRON_MACE , IRON_HAMMER ,
BRONZE_SWORD , BRONZE_GREATSWORD , BRONZE_AXE , BRONZE_BATTLEAXE , BRONZE_SPEAR , BRONZE_SHIELD , BRONZE_MACE , BRONZE_HAMMER ,
BRASS_SWORD , BRASS_GREATSWORD , BRASS_AXE , BRASS_BATTLEAXE , BRASS_SPEAR , BRASS_SHIELD , BRASS_MACE , BRASS_HAMMER
2023-10-09 15:26:24 -04:00
) ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-09 16:33:18 -04:00
type weapon_mark is mod 72 ;
type weapon_constant_type is new entity_constant_type with
2023-10-09 15:26:24 -04:00
record
2023-10-11 10:48:41 -04:00
dual_wield : boolean := false ;
value : natural := 0 ;
weight : natural := 0 ;
attack_range : natural := 0 ;
defense_range : natural := 0 ;
distance_range : natural := 0 ;
2023-10-09 15:26:24 -04:00
end record ;
2023-10-09 16:33:18 -04:00
type weapon_variable_type is new entity_variable_type with
2023-10-09 15:26:24 -04:00
record
2023-10-09 16:33:18 -04:00
enchantment : natural := 0 ;
condition : natural := 0 ;
2023-10-09 15:26:24 -04:00
end record ;
2023-10-09 16:33:18 -04:00
type weapon_constant_list is array ( weapon_list ) of weapon_constant_type ;
type weapon_variable_list is array ( weapon_mark ) of weapon_variable_type ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-09 16:33:18 -04:00
weapon_constant_data : constant weapon_constant_list := (
2023-10-12 10:26:53 -04:00
( ENTITY_WEAPON , "Iron Sword " , ' l ' , COLOUR_RED , EFFECT_NORMAL , true , 11 , 31 , 7 , 2 , 1 ) ,
( ENTITY_WEAPON , "Iron Greatsword " , ' L ' , COLOUR_RED , EFFECT_BOLD , false , 23 , 67 , 11 , 3 , 2 ) ,
( ENTITY_WEAPON , "Iron Axe " , ' r ' , COLOUR_RED , EFFECT_NORMAL , true , 13 , 43 , 7 , 2 , 1 ) ,
( ENTITY_WEAPON , "Iron Battleaxe " , ' T ' , COLOUR_RED , EFFECT_BOLD , false , 19 , 73 , 13 , 2 , 2 ) ,
( ENTITY_WEAPON , "Iron Spear " , ' I ' , COLOUR_RED , EFFECT_BOLD , false , 17 , 53 , 10 , 4 , 2 ) ,
( ENTITY_WEAPON , "Iron Shield " , ' o ' , COLOUR_RED , EFFECT_NORMAL , true , 13 , 37 , 3 , 9 , 1 ) ,
( ENTITY_WEAPON , "Iron Mace " , ' i ' , COLOUR_RED , EFFECT_NORMAL , true , 11 , 41 , 8 , 2 , 1 ) ,
( ENTITY_WEAPON , "Iron Hammer " , ' t ' , COLOUR_RED , EFFECT_NORMAL , true , 13 , 47 , 7 , 3 , 1 ) ,
( ENTITY_WEAPON , "Bronze Sword " , ' l ' , COLOUR_RED , EFFECT_NORMAL , true , 11 , 31 , 7 , 2 , 1 ) ,
( ENTITY_WEAPON , "Bronze Greatsword " , ' L ' , COLOUR_RED , EFFECT_BOLD , false , 23 , 67 , 11 , 3 , 2 ) ,
( ENTITY_WEAPON , "Bronze Axe " , ' r ' , COLOUR_RED , EFFECT_NORMAL , true , 13 , 43 , 7 , 2 , 1 ) ,
( ENTITY_WEAPON , "Bronze Battleaxe " , ' T ' , COLOUR_RED , EFFECT_BOLD , false , 19 , 73 , 13 , 2 , 2 ) ,
( ENTITY_WEAPON , "Bronze Spear " , ' I ' , COLOUR_RED , EFFECT_BOLD , false , 17 , 53 , 10 , 4 , 2 ) ,
( ENTITY_WEAPON , "Bronze Shield " , ' o ' , COLOUR_RED , EFFECT_NORMAL , true , 13 , 37 , 3 , 9 , 1 ) ,
( ENTITY_WEAPON , "Bronze Mace " , ' i ' , COLOUR_RED , EFFECT_NORMAL , true , 11 , 41 , 8 , 2 , 1 ) ,
( ENTITY_WEAPON , "Bronze Hammer " , ' t ' , COLOUR_RED , EFFECT_NORMAL , true , 13 , 47 , 7 , 3 , 1 ) ,
( ENTITY_WEAPON , "Brass Sword " , ' l ' , COLOUR_RED , EFFECT_NORMAL , true , 11 , 31 , 7 , 2 , 1 ) ,
( ENTITY_WEAPON , "Brass Greatsword " , ' L ' , COLOUR_RED , EFFECT_BOLD , false , 23 , 67 , 11 , 3 , 2 ) ,
( ENTITY_WEAPON , "Brass Axe " , ' r ' , COLOUR_RED , EFFECT_NORMAL , true , 13 , 43 , 7 , 2 , 1 ) ,
( ENTITY_WEAPON , "Brass Battleaxe " , ' T ' , COLOUR_RED , EFFECT_BOLD , false , 19 , 73 , 13 , 2 , 2 ) ,
( ENTITY_WEAPON , "Brass Spear " , ' I ' , COLOUR_RED , EFFECT_BOLD , false , 17 , 53 , 10 , 4 , 2 ) ,
( ENTITY_WEAPON , "Brass Shield " , ' o ' , COLOUR_RED , EFFECT_NORMAL , true , 13 , 37 , 3 , 9 , 1 ) ,
( ENTITY_WEAPON , "Brass Mace " , ' i ' , COLOUR_RED , EFFECT_NORMAL , true , 11 , 41 , 8 , 2 , 1 ) ,
( ENTITY_WEAPON , "Brass Hammer " , ' t ' , COLOUR_RED , EFFECT_NORMAL , true , 13 , 47 , 7 , 3 , 1 )
2023-10-09 15:26:24 -04:00
) ;
2023-10-09 16:33:18 -04:00
weapon_variable_data : weapon_variable_list ;
2023-10-09 14:56:48 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-09 16:49:02 -04:00
-- Armour
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-09 23:27:39 -04:00
type armour_list is (
IRON_HELMET , IRON_CHESTPLATE , IRON_GAUNTLETS , IRON_GREAVES , IRON_CUISSE , IRON_FAULD , IRON_GARDBRACE , IRON_REREBRACE
) ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-09 23:27:39 -04:00
type armour_mark is mod 72 ;
type armour_constant_type is new entity_constant_type with
record
2023-10-11 10:48:41 -04:00
value : natural := 0 ;
weight : natural := 0 ;
defense_range : natural := 0 ;
2023-10-09 23:27:39 -04:00
end record ;
type armour_variable_type is new entity_variable_type with
record
enchantment : natural := 0 ;
condition : natural := 0 ;
end record ;
type armour_constant_list is array ( armour_list ) of armour_constant_type ;
type armour_variable_list is array ( armour_mark ) of armour_variable_type ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-09 23:27:39 -04:00
armour_constant_data : constant armour_constant_list := (
2023-10-12 10:26:53 -04:00
( ENTITY_ARMOUR , "Iron Helmet " , ' m ' , COLOUR_YELLOW , EFFECT_NORMAL , 11 , 31 , 7 ) ,
( ENTITY_ARMOUR , "Iron Chestplate " , ' M ' , COLOUR_YELLOW , EFFECT_BOLD , 23 , 67 , 11 ) ,
( ENTITY_ARMOUR , "Iron Gauntlets " , ' i ' , COLOUR_YELLOW , EFFECT_NORMAL , 13 , 43 , 7 ) ,
( ENTITY_ARMOUR , "Iron Greaves " , ' I ' , COLOUR_YELLOW , EFFECT_NORMAL , 19 , 73 , 13 ) ,
( ENTITY_ARMOUR , "Iron Cuisse " , ' Y ' , COLOUR_YELLOW , EFFECT_BOLD , 17 , 53 , 10 ) ,
( ENTITY_ARMOUR , "Iron Fauld " , '-' , COLOUR_YELLOW , EFFECT_NORMAL , 13 , 37 , 3 ) ,
( ENTITY_ARMOUR , "Iron Gardbrace " , ' v ' , COLOUR_YELLOW , EFFECT_NORMAL , 11 , 41 , 8 ) ,
( ENTITY_ARMOUR , "Iron Rerebrace " , ' V ' , COLOUR_YELLOW , EFFECT_NORMAL , 13 , 47 , 7 )
2023-10-09 23:27:39 -04:00
) ;
armour_variable_data : armour_variable_list ;
2023-10-09 16:49:02 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Scroll
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Potion
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Consumable
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Note
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-09 14:56:48 -04:00
-- Plant
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-09 16:33:18 -04:00
type plant_list is (
2023-10-10 14:34:06 -04:00
OAK_TREE , PINE_TREE , BIRCH_TREE , ACACIA_TREE , APPLE_TREE , PEACH_TREE , ORANGE_TREE , PEAR_TREE ,
BUSH , THORNY_BUSH , TALL_GRASS , REED
2023-10-09 14:56:48 -04:00
) ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-10 14:34:06 -04:00
type plant_mark is mod 72 ;
type plant_constant_type is new entity_constant_type with
record
health_limit : natural := 0 ;
end record ;
type plant_variable_type is new entity_variable_type with
record
health : natural := 0 ;
end record ;
type plant_constant_list is array ( plant_list ) of plant_constant_type ;
type plant_variable_list is array ( plant_mark ) of plant_variable_type ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-10 14:34:06 -04:00
plant_constant_data : constant plant_constant_list := (
2023-10-12 10:26:53 -04:00
( ENTITY_PLANT , "Oak Tree " , ' T ' , COLOUR_GREEN , EFFECT_BOLD , 11 ) ,
( ENTITY_PLANT , "Pine Tree " , ' T ' , COLOUR_GREEN , EFFECT_BOLD , 23 ) ,
( ENTITY_PLANT , "Birch Tree " , ' T ' , COLOUR_GREEN , EFFECT_BOLD , 13 ) ,
( ENTITY_PLANT , "Acacia Tree " , ' T ' , COLOUR_GREEN , EFFECT_BOLD , 19 ) ,
( ENTITY_PLANT , "Apple Tree " , ' T ' , COLOUR_GREEN , EFFECT_BOLD , 17 ) ,
( ENTITY_PLANT , "Peach Tree " , ' T ' , COLOUR_GREEN , EFFECT_BOLD , 13 ) ,
( ENTITY_PLANT , "Orange Tree " , ' T ' , COLOUR_GREEN , EFFECT_BOLD , 11 ) ,
( ENTITY_PLANT , "Pear Tree " , ' T ' , COLOUR_GREEN , EFFECT_BOLD , 13 ) ,
( ENTITY_PLANT , "Bush " , '&' , COLOUR_GREEN , EFFECT_NORMAL , 5 ) ,
( ENTITY_PLANT , "Thorny Bush " , '&' , COLOUR_GREEN , EFFECT_NORMAL , 7 ) ,
( ENTITY_PLANT , "Tall Grass " , '%' , COLOUR_GREEN , EFFECT_NORMAL , 3 ) ,
( ENTITY_PLANT , "Reed " , '%' , COLOUR_GREEN , EFFECT_NORMAL , 3 )
2023-10-10 14:34:06 -04:00
) ;
plant_variable_data : plant_variable_list ;
2023-10-09 14:56:48 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Animal
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-09 16:33:18 -04:00
type animal_list is (
2023-10-11 16:51:24 -04:00
ANIMAL_PIG , ANIMAL_COW , ANIMAL_CHICKEN , ANIMAL_SHEEP , ANIMAL_BOAR , ANIMAL_GOAT , ANIMAL_AUROCH , ANIMAL_DUCK ,
ANIMAL_DOG , ANIMAL_CAT , ANIMAL_RABBIT , ANIMAL_HAMSTER , ANIMAL_HORSE , ANIMAL_DONKEY , ANIMAL_CAMEL , ANIMAL_ELEPHANT ,
ANIMAL_OWL , ANIMAL_HAWK , ANIMAL_PIGEON , ANIMAL_VULTURE , ANIMAL_CROW , ANIMAL_PHEASANT , ANIMAL_SPARROW , ANIMAL_ALBATROSS ,
ANIMAL_SARDINE , ANIMAL_HERRING , ANIMAL_CATFISH , ANIMAL_CARP , ANIMAL_WHALE , ANIMAL_SHARK , ANIMAL_SQUID , ANIMAL_SAWFISH ,
ANIMAL_WORM , ANIMAL_BEE , ANIMAL_CENTIPEDE , ANIMAL_SPIDER , ANIMAL_FROG , ANIMAL_RAT , ANIMAL_BAT , ANIMAL_MOLE ,
ANIMAL_WOLF , ANIMAL_FOX , ANIMAL_BEAR , ANIMAL_MAMMOTH , ANIMAL_ELK , ANIMAL_MOOSE , ANIMAL_DEER , ANIMAL_PEEBLES ,
ANIMAL_LION , ANIMAL_HYENA , ANIMAL_BISON , ANIMAL_ZEBRA , ANIMAL_GIRAFFE , ANIMAL_CROCODILE , ANIMAL_MONKEY , ANIMAL_GNU ,
ANIMAL_CARIBOU , ANIMAL_SEAL , ANIMAL_MORSE , ANIMAL_PENGUIN , ANIMAL_TURTLE , ANIMAL_CAYMAN , ANIMAL_OTTER , ANIMAL_SNAKE ,
ANIMAL_LIZARD , ANIMAL_DAEODON , ANIMAL_SLIME , ANIMAL_AXOLOTL , ANIMAL_HEDGEHOG , ANIMAL_CATERPILLAR , ANIMAL_CRAB , ANIMAL_SCORPION ,
ANIMAL_GIANT_LIZARD , ANIMAL_GIANT_CENTIPEDE , ANIMAL_GIANT_SPIDER , ANIMAL_GIANT_SLOTH ,
ANIMAL_GIANT_OWL , ANIMAL_GIANT_SCORPION , ANIMAL_GIANT_AXOLOTL , ANIMAL_GIANT_WORM
2023-10-09 14:56:48 -04:00
) ;
2023-10-11 16:51:24 -04:00
------------------------------------------------------------------------------------------
type animal_mark is mod 72 ;
type animal_constant_type is new entity_constant_type with
record
health_limit : natural := 0 ;
attack_range : natural := 0 ;
defense_range : natural := 0 ;
end record ;
type animal_variable_type is new entity_variable_type with
record
health : natural := 0 ;
end record ;
type animal_constant_list is array ( animal_list ) of animal_constant_type ;
type animal_variable_list is array ( animal_mark ) of animal_variable_type ;
------------------------------------------------------------------------------------------
animal_constant_data : constant animal_constant_list := (
2023-10-12 10:26:53 -04:00
( ENTITY_ANIMAL , "Pig " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Cow " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Chicken " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Sheep " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Boar " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Goat " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Auroch " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Duck " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Dog " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Cat " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Rabbit " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Hamster " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Horse " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Donkey " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Camel " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Elephant " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Owl " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Hawk " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Pigeon " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Vulture " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Crow " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Pheasant " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Sparrow " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Albatross " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Sardine " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Herring " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Catfish " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Carp " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Whale " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Shark " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Squid " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Sawfish " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Worm " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Bee " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Centipede " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Spider " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Frog " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Rat " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Bat " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Mole " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Wolf " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Fox " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Bear " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Mammoth " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Elk " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Moose " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Deer " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Peebles " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Lion " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Hyena " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Bison " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Zebra " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Giraffe " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Crocodile " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Monkey " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Gnu " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Caribou " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Seal " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Morse " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Penguin " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Turtle " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Cayman " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Otter " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Snake " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Lizard " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Daeodon " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Slime " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Axolotl " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Hedgehog " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Caterpillar " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Crab " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Scorpion " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Giant Lizard " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Giant Centipede " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Giant Spider " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Giant Sloth " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Giant Owl " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Giant Scorpion " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Giant Axolotl " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 ) ,
( ENTITY_ANIMAL , "Giant Worm " , ' a ' , COLOUR_GREEN , EFFECT_NORMAL , 11 , 11 , 11 )
2023-10-11 16:51:24 -04:00
) ;
animal_variable_data : animal_variable_list ;
2023-10-09 14:56:48 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-09 14:49:12 -04:00
-- Goblin
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-09 16:33:18 -04:00
type goblin_list is (
2023-10-10 14:34:06 -04:00
GOBLIN_SLAVE , GOBLIN_WORKER , GOBLIN_WARRIOR , GOBLIN_BOAR_RIDER , GOBLIN_SHAMAN , GOBLIN_CHIEF , GOBLIN_KING , GOBLIN_OGRE
2023-10-09 14:56:48 -04:00
) ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-09 14:49:12 -04:00
type goblin_constant_type is new entity_constant_type with
record
2023-10-11 10:48:41 -04:00
health_limit : natural := 0 ;
armour_limit : natural := 0 ;
mana_limit : natural := 0 ;
stamina_limit : natural := 0 ;
attack_range : natural := 0 ;
2023-10-09 14:49:12 -04:00
end record ;
type goblin_variable_type is new entity_variable_type with
record
2023-10-09 15:26:24 -04:00
health : natural := 0 ;
armour : natural := 0 ;
mana : natural := 0 ;
stamina : natural := 0 ;
2023-10-09 14:49:12 -04:00
end record ;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-09 16:49:02 -04:00
-- Player
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-11 12:39:17 -04:00
type player_data is
record
x : map_width := 0 ;
y : map_height := 0 ;
health : natural := 0 ;
armour : natural := 0 ;
mana : natural := 0 ;
stamina : natural := 0 ;
end record ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-09 14:49:12 -04:00
2023-10-11 16:25:59 -04:00
player : player_data ;
2023-10-11 10:48:41 -04:00
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-08 15:11:04 -04:00
2023-10-11 16:25:59 -04:00
procedure render_player is
2023-10-10 15:49:36 -04:00
begin
2023-10-11 16:25:59 -04:00
render_character ( '@' , COLOUR_CYAN , EFFECT_BOLD , screen_height ( player . y ) , screen_width ( player . x ) ) ;
end render_player ;
2023-10-10 13:58:50 -04:00
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Gameplay
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-10 23:46:07 -04:00
2023-10-11 12:39:17 -04:00
procedure action_move_up is begin player . y := player . y - 1 ; end action_move_up ;
procedure action_move_down is begin player . y := player . y + 1 ; end action_move_down ;
procedure action_move_left is begin player . x := player . x - 1 ; end action_move_left ;
procedure action_move_right is begin player . x := player . x + 1 ; end action_move_right ;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2023-10-10 15:49:36 -04:00
-- Main
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
begin
2023-10-09 23:27:39 -04:00
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-11 12:39:17 -04:00
bind ( ' q ' , action_exit ' access ) ;
2023-10-11 12:44:13 -04:00
bind ( ' w ' , action_move_up ' access ) ;
bind ( ' s ' , action_move_down ' access ) ;
bind ( ' a ' , action_move_left ' access ) ;
bind ( ' d ' , action_move_right ' access ) ;
2023-10-11 15:15:16 -04:00
render_screen_delete ;
render_screen_offset ;
render_cursor_hide ;
2023-10-10 23:46:07 -04:00
2023-10-11 16:00:21 -04:00
generate_map ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-10 14:34:06 -04:00
loop
2023-10-10 23:46:07 -04:00
exit when active = false ;
2023-10-11 10:48:41 -04:00
signal := CANCEL ;
2023-10-11 16:25:59 -04:00
render_map ;
render_player ;
2023-10-11 15:15:16 -04:00
render_screen ;
2023-10-11 10:48:41 -04:00
get_immediate ( signal ) ;
action_list ( character ' pos ( signal ) ) . all ;
2023-10-10 14:34:06 -04:00
end loop ;
2023-10-11 16:25:59 -04:00
------------------------------------------------------------------------------------------
2023-10-11 15:15:16 -04:00
render_cursor_show ;
2023-10-11 12:44:13 -04:00
2023-10-08 15:11:04 -04:00
return 0 ;
end xabina ;