Revised trait and sprite arrays...

This commit is contained in:
Ognjen Milan Robovic 2024-04-23 16:19:29 -04:00
parent d5e9a91c27
commit a2e5ce337e
29 changed files with 99 additions and 120 deletions

View File

@ -83,22 +83,22 @@ package body ai is
--
active := index;
--
core.write (male_name_array (actor (index).name), x + offset, y + offset, ui.glyphs (ui.active));
ui.write (male_name_array (actor (index).name), x + offset, y + offset);
--
core.write ("Envious = " & boolean'image (actor_is_envious), x + offset, y + offset + 32, ui.glyphs (ui.active));
core.write ("Glutton = " & boolean'image (actor_is_glutton), x + offset, y + offset + 64, ui.glyphs (ui.active));
core.write ("Greedy = " & boolean'image (actor_is_greedy), x + offset, y + offset + 96, ui.glyphs (ui.active));
core.write ("Slutty = " & boolean'image (actor_is_slutty), x + offset, y + offset + 128, ui.glyphs (ui.active));
core.write ("Proud = " & boolean'image (actor_is_proud), x + offset, y + offset + 160, ui.glyphs (ui.active));
core.write ("Lazy = " & boolean'image (actor_is_lazy), x + offset, y + offset + 192, ui.glyphs (ui.active));
core.write ("Angry = " & boolean'image (actor_is_angry), x + offset, y + offset + 224, ui.glyphs (ui.active));
core.write ("Thirsty = " & boolean'image (actor_is_thirsty), x + offset, y + offset + 256, ui.glyphs (ui.active));
core.write ("Hungry = " & boolean'image (actor_is_hungry), x + offset, y + offset + 288, ui.glyphs (ui.active));
core.write ("Tired = " & boolean'image (actor_is_tired), x + offset, y + offset + 320, ui.glyphs (ui.active));
core.write ("Lonely = " & boolean'image (actor_is_lonely), x + offset, y + offset + 352, ui.glyphs (ui.active));
core.write ("Healthy = " & boolean'image (actor_is_healthy), x + offset, y + offset + 384, ui.glyphs (ui.active));
core.write ("Happy = " & boolean'image (actor_is_happy), x + offset, y + offset + 416, ui.glyphs (ui.active));
core.write ("Bored = " & boolean'image (actor_is_bored), x + offset, y + offset + 448, ui.glyphs (ui.active));
ui.write ("Envious = " & boolean'image (actor_is_envious), x + offset, y + offset + 32);
ui.write ("Glutton = " & boolean'image (actor_is_glutton), x + offset, y + offset + 64);
ui.write ("Greedy = " & boolean'image (actor_is_greedy), x + offset, y + offset + 96);
ui.write ("Slutty = " & boolean'image (actor_is_slutty), x + offset, y + offset + 128);
ui.write ("Proud = " & boolean'image (actor_is_proud), x + offset, y + offset + 160);
ui.write ("Lazy = " & boolean'image (actor_is_lazy), x + offset, y + offset + 192);
ui.write ("Angry = " & boolean'image (actor_is_angry), x + offset, y + offset + 224);
ui.write ("Thirsty = " & boolean'image (actor_is_thirsty), x + offset, y + offset + 256);
ui.write ("Hungry = " & boolean'image (actor_is_hungry), x + offset, y + offset + 288);
ui.write ("Tired = " & boolean'image (actor_is_tired), x + offset, y + offset + 320);
ui.write ("Lonely = " & boolean'image (actor_is_lonely), x + offset, y + offset + 352);
ui.write ("Healthy = " & boolean'image (actor_is_healthy), x + offset, y + offset + 384);
ui.write ("Happy = " & boolean'image (actor_is_happy), x + offset, y + offset + 416);
ui.write ("Bored = " & boolean'image (actor_is_bored), x + offset, y + offset + 448);
end view_actor_state;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -6,6 +6,10 @@ package body attribute is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sprite : array (codex) of core.sprite;
------------------------------------------------------------------------------------------
procedure configure is
begin
core.echo (core.comment, "Configuring attribute components...");
@ -39,7 +43,7 @@ package body attribute is
loop
ui.draw_icon (trait (index).text, move_x + offset, move_y + offset + codex'pos (index) * core.icon);
draw (index, move_x + offset, move_y + offset + codex'pos (index) * core.icon);
core.write (trait (index).name, move_x + offset + core.icon, move_y + offset + codex'pos (index) * core.icon, ui.glyphs (ui.active));
ui.write (trait (index).name, move_x + offset + core.icon, move_y + offset + codex'pos (index) * core.icon);
end loop;
end menu;

View File

@ -19,14 +19,10 @@ package attribute is
text : core.long_string;
end record;
--~type trait_array is array (codex) of information;
--~type sprite_array is array (codex) of core.sprite;
type value_array is array (codex) of base_limit;
type points is array (codex) of base_limit;
------------------------------------------------------------------------------------------
sprite : array (codex) of core.sprite;
count : constant natural := codex'pos (codex'last) + 1;
trait : constant array (codex) of information := (

View File

@ -6,6 +6,10 @@ package body chad is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sprite : array (codex) of core.sprite;
------------------------------------------------------------------------------------------
procedure configure is
begin
core.echo (core.comment, "Configuring chad components...");

View File

@ -6,7 +6,7 @@ package chad is
type codex is (
ognjen, richard, eric, linus, ada, marina,
kethleen, wouter, john
kathleen, wouter, john
);
------------------------------------------------------------------------------------------
@ -23,19 +23,13 @@ package chad is
type data is
record
index : codex;
attributes : attribute.value_array;
--~attributes : array (attribute.codex) of attribute.base_limit;
skills : skill.value_array;
resources : resource.value_array;
attributes : attribute.points;
skills : skill.points;
resources : resource.points;
end record;
--~type trait_array is array (codex) of information;
--~type sprite_array is array (codex) of core.sprite;
------------------------------------------------------------------------------------------
sprite : array (codex) of core.sprite;
count : constant natural := codex'pos (codex'last) + 1;
trait : constant array (codex) of information := (

View File

@ -6,11 +6,7 @@ package body construction is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
type sprite_array is array (codex) of core.sprite;
------------------------------------------------------------------------------------------
sprite : sprite_array;
sprite : array (codex) of core.sprite;
------------------------------------------------------------------------------------------

View File

@ -48,18 +48,16 @@ package construction is
kind : faction.codex;
level : level_limit;
grade : grade_limit;
price : resource.value_array;
price : resource.points;
frames : integer;
evoke : effect.codex;
end record;
type trait_array is array (codex) of information;
------------------------------------------------------------------------------------------
count : constant natural := codex'pos (codex'last) + 1;
trait : constant trait_array := (
trait : constant array (codex) of information := (
("Boar Glen ", faction.neutral, 1, 1, ( 90, 0, 0, 0, 0, 0, 0), 1, effect.none),
("Enchanter's Hollow ", faction.neutral, 1, 1, (120, 0, 0, 0, 0, 0, 0), 1, effect.none),
("Hovel ", faction.neutral, 2, 1, (180, 0, 0, 0, 0, 0, 0), 1, effect.none),

View File

@ -6,7 +6,7 @@ package body deity is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sprite : core.sprite;
sprite : array (codex) of core.sprite;
------------------------------------------------------------------------------------------

View File

@ -19,13 +19,11 @@ package deity is
base : piety_limit;
end record;
type trait_array is array (codex) of information;
------------------------------------------------------------------------------------------
count : constant natural := codex'pos (codex'last) + 1;
trait : constant trait_array := (
trait : constant array (codex) of information := (
("Svarog the Lawful ", 3), -- Serbia
("Dabog the Lonely ", -3),
("Svetovid the Awakened ", 0),

View File

@ -6,6 +6,10 @@ package body effect is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sprite : array (codex) of core.sprite;
------------------------------------------------------------------------------------------
procedure draw (value : in codex; x, y : in integer) is
begin
null;

View File

@ -16,13 +16,11 @@ package effect is
make : boolean;
end record;
type trait_array is array (codex) of information;
------------------------------------------------------------------------------------------
count : constant natural := codex'pos (codex'last) + 1;
trait : constant trait_array := (
trait : constant array (codex) of information := (
("- ", true),
("- ", true)
);

View File

@ -6,6 +6,10 @@ package body faction is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sprite : array (codex) of core.sprite;
------------------------------------------------------------------------------------------
procedure draw (value : in codex; x, y : in integer) is
begin
null;

View File

@ -19,13 +19,11 @@ package faction is
resource_bonus : resource.codex;
end record;
type trait_array is array (codex) of information;
------------------------------------------------------------------------------------------
count : constant natural := codex'pos (codex'last) + 1;
trait : constant trait_array := (
trait : constant array (codex) of information := (
("Neutral ", attribute.attack, skill.tactics, resource.gold),
("Castle ", attribute.attack, skill.archery, resource.ore),
("Stronghold ", attribute.defense, skill.offense, resource.wood),

View File

@ -6,11 +6,7 @@ package body item is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
type sprite_array is array (codex) of core.sprite;
------------------------------------------------------------------------------------------
sprite : sprite_array;
sprite : array (codex) of core.sprite;
------------------------------------------------------------------------------------------

View File

@ -47,13 +47,11 @@ package item is
evoke : effect.codex;
end record;
type trait_array is array (codex) of information;
------------------------------------------------------------------------------------------
count : constant natural := codex'pos (codex'last) + 1;
trait : constant trait_array := (
trait : constant array (codex) of information := (
("Admiral's Hat ", head, 0, effect.none),
("Ambassador's Sash ", full_body, 0, effect.none),
("Undertaker's Amulet ", neck, 1, effect.none),

View File

@ -6,15 +6,11 @@ package body magic is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
type sprite_array is array (codex) of core.sprite;
view_width : constant natural := 90;
view_height : constant natural := 90;
------------------------------------------------------------------------------------------
view_width : constant integer := 90;
view_height : constant integer := 90;
view_sprite : sprite_array;
icon_sprite : sprite_array;
view_sprite : array (codex) of core.sprite;
icon_sprite : array (codex) of core.sprite;
------------------------------------------------------------------------------------------
@ -67,8 +63,8 @@ package body magic is
--
for index in codex
loop
icon (index, move_x + offset + school'pos (trait (index).kind) * 168, move_y + offset + next (school'pos (trait (index).kind)) * core.icon);
core.write (trait (index).name, move_x + offset + school'pos (trait (index).kind) * 168 + core.icon, move_y + offset + next (school'pos (trait (index).kind)) * core.icon, ui.glyphs (ui.active));
icon (index, move_x + offset + school'pos (trait (index).kind) * 168, move_y + offset + next (school'pos (trait (index).kind)) * core.icon);
ui.write (trait (index).name, move_x + offset + school'pos (trait (index).kind) * 168 + core.icon, move_y + offset + next (school'pos (trait (index).kind)) * core.icon);
--
next (school'pos (trait (index).kind)) := next (school'pos (trait (index).kind)) + 1;
end loop;

View File

@ -48,13 +48,11 @@ package magic is
text : core.long_string;
end record;
type trait_array is array (codex) of information;
------------------------------------------------------------------------------------------
count : constant natural := codex'pos (codex'last) + 1;
trait : constant trait_array := (
trait : constant array (codex) of information := (
("Magic Arrow ", neutral, 0, effect.none, "Primary spell that channels mana through the air in order to do damage. "),
("Chain Magic Arrow ", neutral, 0, effect.none, "Advanced primary spell that chains mana to damage multiple foes. "),
("Blow Away ", air, 0, effect.none, "Weak spell that creates a strong gust of wind to knock back enemies. "),

View File

@ -160,11 +160,11 @@ begin
signal_list (core.signal_code'val (core.signal_mode)).all;
--
--~ai.review;
--~ai.view_actor_state (1);
ai.view_actor_state (1);
--
menu_render;
--
core.write (integer'image (menu_count), 16, 16, ui.glyphs (ui.active), 16#FFFFFFFF#);
ui.write (integer'image (menu_count), 16, 16);
--
ui.draw_text_box (0, core.window_height - 32, core.window_width, 32);
end loop gameplay;

View File

@ -6,15 +6,11 @@ package body might is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
type sprite_array is array (codex) of core.sprite;
------------------------------------------------------------------------------------------
view_width : constant integer := 90;
view_height : constant integer := 90;
view_sprite : sprite_array;
icon_sprite : sprite_array;
view_sprite : array (codex) of core.sprite;
icon_sprite : array (codex) of core.sprite;
------------------------------------------------------------------------------------------
@ -67,8 +63,8 @@ package body might is
--
for index in codex
loop
icon (index, move_x + offset + school'pos (trait (index).kind) * 168, move_y + offset + next (school'pos (trait (index).kind)) * core.icon);
core.write (trait (index).name, move_x + offset + school'pos (trait (index).kind) * 168 + core.icon, move_y + offset + next (school'pos (trait (index).kind)) * core.icon, ui.glyphs (ui.active));
icon (index, move_x + offset + school'pos (trait (index).kind) * 168, move_y + offset + next (school'pos (trait (index).kind)) * core.icon);
ui.write (trait (index).name, move_x + offset + school'pos (trait (index).kind) * 168 + core.icon, move_y + offset + next (school'pos (trait (index).kind)) * core.icon);
--
next (school'pos (trait (index).kind)) := next (school'pos (trait (index).kind)) + 1;
end loop;

View File

@ -47,13 +47,11 @@ package might is
text : core.long_string;
end record;
type trait_array is array (codex) of information;
------------------------------------------------------------------------------------------
count : constant natural := codex'pos (codex'last) + 1;
trait : constant trait_array := (
trait : constant array (codex) of information := (
("Cover ", archery, 0, effect.none, "Provides temporary protection from enemy attacks. "),
("Evasive Maneuvers ", archery, 0, effect.none, "Allows the user to dodge and avoid incoming attacks more effectively. "),
("Focused Fire ", archery, 0, effect.none, "Increases accuracy and damage output towards a single target. "),

View File

@ -6,6 +6,10 @@ package body resource is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sprite : array (codex) of core.sprite;
------------------------------------------------------------------------------------------
procedure configure is
begin
core.echo (core.comment, "Configuring resource components...");
@ -39,7 +43,7 @@ package body resource is
loop
ui.draw_icon (trait (index).text, move_x + offset, move_y + offset + codex'pos (index) * core.icon);
draw (index, move_x + offset, move_y + offset + codex'pos (index) * core.icon);
core.write (trait (index).name, move_x + offset + core.icon, move_y + offset + codex'pos (index) * core.icon, ui.glyphs (ui.active));
ui.write (trait (index).name, move_x + offset + core.icon, move_y + offset + codex'pos (index) * core.icon);
end loop;
end menu;

View File

@ -20,17 +20,13 @@ package resource is
text : core.long_string;
end record;
type trait_array is array (codex) of information;
type sprite_array is array (codex) of core.sprite;
type value_array is array (codex) of base_limit;
type points is array (codex) of base_limit;
------------------------------------------------------------------------------------------
sprite : sprite_array;
count : constant natural := codex'pos (codex'last) + 1;
trait : constant trait_array := (
trait : constant array (codex) of information := (
("Gold ", 0, "Basic currency in the world, even tho silver is better. "),
("Wood ", 0, "Essential building material for most houses and stables. "),
("Mercury ", 0, "Usage is practiced by alchemists and necromancers mostly. "),

View File

@ -6,6 +6,10 @@ package body skill is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sprite : array (codex) of core.sprite;
------------------------------------------------------------------------------------------
procedure configure is
begin
core.echo (core.comment, "Configuring skill components...");
@ -40,7 +44,7 @@ package body skill is
loop
ui.draw_icon (trait (index).text, move_x + 216 * (codex'pos (index) / 6) + offset, move_y + core.icon * (codex'pos (index) mod 6) + offset);
draw (index, move_x + 216 * (codex'pos (index) / 6) + offset, move_y + core.icon * (codex'pos (index) mod 6) + offset);
core.write (trait (index).name, move_x + 216 * (codex'pos (index) / 6) + offset + core.icon, move_y + core.icon * (codex'pos (index) mod 6) + offset, ui.glyphs (ui.active));
ui.write (trait (index).name, move_x + 216 * (codex'pos (index) / 6) + offset + core.icon, move_y + core.icon * (codex'pos (index) mod 6) + offset);
end loop;
end menu;

View File

@ -22,17 +22,13 @@ package skill is
text : core.long_string;
end record;
type trait_array is array (codex) of information;
type sprite_array is array (codex) of core.sprite;
type value_array is array (codex) of base_limit;
type points is array (codex) of base_limit;
------------------------------------------------------------------------------------------
sprite : sprite_array;
count : constant natural := codex'pos (codex'last) + 1;
trait : constant trait_array := (
trait : constant array (codex) of information := (
("Archery ", 0, "Improves the effectiveness of ranged attacks. "),
("Offense ", 0, "Enhances the damage dealt in combat. "),
("Armourer ", 0, "Better at maintaining and repairing equipment. "),

View File

@ -6,6 +6,11 @@ package body ui is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
sprite : array (style, codex) of core.sprite;
glyphs : array (style) of core.glyphs;
------------------------------------------------------------------------------------------
procedure select_text_box (text : in string; x, y, width, height : in integer) is
begin
if core.cursor.x > x and core.cursor.x < x + width
@ -299,6 +304,13 @@ package body ui is
core.write ("Framerate :" & integer'image (core.framerate), x, y + 288, glyphs (active));
end draw_state_box;
------------------------------------------------------------------------------------------
procedure write (text : in string; x, y : in integer) is
begin
core.write (text, x, y, glyphs (active));
end write;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end ui;

View File

@ -32,13 +32,6 @@ package ui is
------------------------------------------------------------------------------------------
type sprite_array is array (style, codex) of core.sprite;
type glyphs_array is array (style) of core.glyphs;
------------------------------------------------------------------------------------------
sprite : sprite_array;
glyphs : glyphs_array;
active : style;
------------------------------------------------------------------------------------------
@ -62,6 +55,8 @@ package ui is
procedure draw_state_box (x, y : in integer);
procedure write (text : in string; x, y : in integer);
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
end ui;

View File

@ -6,14 +6,12 @@ package body unit is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
type sprite_array is array (codex) of core.sprite;
view_width : constant integer := 48;
view_height : constant integer := 64;
sprite : sprite_array;
icon_sprite : sprite_array;
view_sprite : sprite_array;
sprite : array (codex) of core.sprite;
icon_sprite : array (codex) of core.sprite;
view_sprite : array (codex) of core.sprite;
------------------------------------------------------------------------------------------
@ -75,8 +73,8 @@ package body unit is
loop
move := faction.codex'pos (trait (index).kind) * 168;
--
icon (index, move_x + offset + move, move_y + offset + (codex'pos (index) mod 14) * core.icon);
core.write (trait (index).name, move_x + offset + move + core.icon, move_y + offset + (codex'pos (index) mod 14) * core.icon, ui.glyphs (ui.active));
icon (index, move_x + offset + move, move_y + offset + (codex'pos (index) mod 14) * core.icon);
ui.write (trait (index).name, move_x + offset + move + core.icon, move_y + offset + (codex'pos (index) mod 14) * core.icon);
end loop;
end menu;
@ -102,7 +100,7 @@ package body unit is
ui.draw_icon (attribute.trait (data).text, move_x + view_width + 12 + offset, move_y + offset + move);
attribute.draw (data, move_x + view_width + 12 + offset, move_y + offset + move);
--
core.write (integer'image (trait (index).attributes (data)), move_x + view_width + 12 + offset + core.icon, move_y + offset + move, ui.glyphs (ui.active));
ui.write (integer'image (trait (index).attributes (data)), move_x + view_width + 12 + offset + core.icon, move_y + offset + move);
end loop;
--
for animate in animation

View File

@ -56,18 +56,16 @@ package unit is
record
name : core.short_string;
kind : faction.codex;
attributes : attribute.value_array;
attributes : attribute.points;
evoke : effect.codex;
text : core.long_string;
end record;
type trait_array is array (codex) of information;
------------------------------------------------------------------------------------------
count : constant natural := codex'pos (codex'last) + 1;
trait : constant trait_array := (
trait : constant array (codex) of information := (
("Azure Dragon ", faction.neutral, (1, 1, 1, 1), effect.none, "Powerful and majestic dragon known for its devastating attacks. "),
("Boar ", faction.neutral, (1, 1, 1, 1), effect.none, "Wild animal with tusks, often used as frontline warriors. "),
("Crystal Dragon ", faction.neutral, (1, 1, 1, 1), effect.none, "Crystal-encrusted dragon with powerful magical abilities. "),

View File

@ -20,9 +20,9 @@ package world is
type information is
record
terrain : codex;
width : natural;
height : natural;
terrain : codex;
width : natural;
height : natural;
block : access block_array;
landmark : access entity_array;
construction : access entity_array;