Browse Source

Added skill explanation implementation...

master
parent
commit
91c0073ce2
5 changed files with 55 additions and 11 deletions
  1. +1
    -1
      source/core.adb
  2. +33
    -0
      source/skill.ads
  3. +2
    -3
      source/ui.adb
  4. +15
    -5
      source/world.adb
  5. +4
    -2
      source/world.ads

+ 1
- 1
source/core.adb View File

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

------------------------------------------------------------------------------------------


+ 33
- 0
source/skill.ads 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;

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


+ 2
- 3
source/ui.adb 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;


+ 15
- 5
source/world.adb 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);


+ 4
- 2
source/world.ads 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;



Loading…
Cancel
Save