Added skill explanation implementation...

This commit is contained in:
Ognjen Milan Robovic 2024-06-15 08:36:42 -04:00
parent c7ae66839f
commit 91c0073ce2
5 changed files with 55 additions and 11 deletions

View File

@ -210,7 +210,7 @@ package body core is
end if;
end loop;
--
return height + 1;
return height + 2;
end string_height;
------------------------------------------------------------------------------------------

View File

@ -66,6 +66,39 @@ package skill is
eremnokinesis => (new string'("Eremnokinesis"), new string'("Eremnokinesis skill is for lonely, sad and depressed people only."))
);
explanation : constant array (enumeration) of access string := (
none => new string'("--"),
--
alchemy => new string'("--"),
archery => new string'("--"),
architecture => new string'("--"),
athletics => new string'("--"),
diplomacy => new string'("--"),
estates => new string'("--"),
exploration => new string'("--"),
leadership => new string'("--"),
logistics => new string'("--"),
medicine => new string'("--"),
mercantile => new string'("--"),
mysticism => new string'("--"),
necromancy => new string'("--"),
resistance => new string'("--"),
skirmish => new string'("--"),
sorcery => new string'("--"),
tactics => new string'("--"),
thaumaturgy => new string'("--"),
pyrokinesis => new string'("--"),
hydrokinesis => new string'("--"),
aerokinesis => new string'("--"),
khousokinesis => new string'("--"),
phosokinesis => new string'("--"),
eremnokinesis => new string'("Eremnokinesis skill, meaning the art of manipulating darkness, increases strength and " & core.line_feed &
"duration of magical abilities from Dark school of magic, influences your experience with " & core.line_feed &
"creatures that have high darkness aptitude, mainly Dark Elementals, and lets you see " & core.line_feed &
"further into the shroud, not increasing the visibility, but giving you information about " & core.line_feed &
"what monsters or items are beyond the shadows.")
);
icon : array (enumeration) of core.sprite;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -167,12 +167,11 @@ package body ui is
core.draw (data, x, y, factor => 1);
write (text, x + core.icon + 10, y + 10, code => true);
--
if core.cursor_inside (x, y, core.icon, core.icon) then
if core.cursor_inside (x, y, width, core.icon) then
prioritize := true;
--
if core.cursor_mode = core.cursor_left then
if core.cursor_mode = core.cursor_right then
action.all;
core.cursor_mode := core.cursor_none;
end if;
end if;
end draw_icon_and_text;

View File

@ -440,6 +440,13 @@ package body world is
------------------------------------------------------------------------------------------
procedure review_skill is
begin
ui.draw_text (skill.explanation (review_skill_data).all, core.center_x (90*9+20), core.center_y (5*15+20), offset => 10);
end review_skill;
------------------------------------------------------------------------------------------
procedure review_unit is
data : unit.definition := unit.description (review_unit_data);
from : faction.definition := faction.description (data.kind);
@ -1181,11 +1188,14 @@ package body world is
count : constant natural := skill.limit'last + 1;
begin
for index in skill.limit loop
ui.draw_icon_and_text (data => skill.icon (data.skills (index).index),
text => skill.description (data.skills (index).index).name.all & data.skills (index).value'image,
x => x + (index mod 2) * (width / 2),
y => y + (index / 2) * core.icon,
width => width / 2);
review_skill_data := data.skills (index).index;
--
ui.draw_icon_and_text (data => skill.icon (data.skills (index).index),
text => skill.description (data.skills (index).index).name.all & data.skills (index).value'image,
x => x + (index mod 2) * (width / 2),
y => y + (index / 2) * core.icon,
width => width / 2,
action => review_skill'access);
end loop;
--
return (width, (count / 2) * core.icon);

View File

@ -41,8 +41,9 @@ package world is
map : definition;
review_unit_data : unit.enumeration;
review_chad_data : chad.enumeration;
review_skill_data : skill.enumeration;
review_unit_data : unit.enumeration;
review_chad_data : chad.enumeration;
------------------------------------------------------------------------------------------
@ -70,6 +71,7 @@ package world is
procedure draw_unit (data : in unit.enumeration; state : in core.animation; x, y, factor : in integer);
procedure draw_chad (data : in chad.information; state : in core.animation; x, y, factor : in integer);
procedure review_skill;
procedure review_unit;
procedure review_chad;