summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/mods/theme/scpt/help.lua58
-rw-r--r--lib/scpt/help.lua58
-rw-r--r--src/externs.h1
-rw-r--r--src/help.c68
-rw-r--r--src/skills.c6
5 files changed, 73 insertions, 118 deletions
diff --git a/lib/mods/theme/scpt/help.lua b/lib/mods/theme/scpt/help.lua
index 189cd687..421cdb11 100644
--- a/lib/mods/theme/scpt/help.lua
+++ b/lib/mods/theme/scpt/help.lua
@@ -24,64 +24,6 @@ ingame_help
-- list of files for classes, { filename, anchor }
local t =
{
- ["skill"] =
- {
- ["Air"] = { "skills.txt", 27 },
- ["Alchemy"] = { "skills.txt", 49 },
- ["Antimagic"] = { "skills.txt", 50 },
- ["Archery"] = { "skills.txt", 08 },
- ["Axe-mastery"] = { "skills.txt", 05 },
- ["Backstab"] = { "skills.txt", 18 },
- ["Barehand-combat"] = { "skills.txt", 13 },
- ["Boomerang-mastery"] = { "skills.txt", 12 },
- ["Boulder-throwing"] = { "skills.txt", 58 },
- ["Bow-mastery"] = { "skills.txt", 10 },
- ["Combat"] = { "skills.txt", 01 },
- ["Conveyance"] = { "skills.txt", 30 },
- ["Corpse-preservation"] = { "skills.txt", 44 },
- ["Critical-hits"] = { "skills.txt", 04 },
- ["Crossbow-mastery"] = { "skills.txt", 11 },
- ["Demonology"] = { "skills.txt", 52 },
- ["Disarming"] = { "skills.txt", 16 },
- ["Divination"] = { "skills.txt", 31 },
- ["Dodging"] = { "skills.txt", 20 },
- ["Druidistic"] = { "skills.txt", 40 },
- ["Earth"] = { "skills.txt", 28 },
- ["Fire"] = { "skills.txt", 25 },
- ["Geomancy"] = { "skills.txt", 60 },
- ["Hafted-mastery"] = { "skills.txt", 06 },
- ["Magic"] = { "skills.txt", 21 },
- ["Magic-Device"] = { "skills.txt", 54 },
- ["Mana"] = { "skills.txt", 24 },
- ["Meta"] = { "skills.txt", 29 },
- ["Mimicry"] = { "skills.txt", 47 },
- ["Mind"] = { "skills.txt", 33 },
- ["Mindcraft"] = { "skills.txt", 41 },
- ["Monster-lore"] = { "skills.txt", 42 },
- ["Music"] = { "skills.txt", 59 },
- ["Nature"] = { "skills.txt", 34 },
- ["Necromancy"] = { "skills.txt", 35 },
- ["Polearm-mastery"] = { "skills.txt", 07 },
- ["Possession"] = { "skills.txt", 45 },
- ["Prayer"] = { "skills.txt", 39 },
- ["Runecraft"] = { "skills.txt", 36 },
- ["Sling-mastery"] = { "skills.txt", 09 },
- ["Sneakiness"] = { "skills.txt", 14 },
- ["Spell-power"] = { "skills.txt", 22 },
- ["Spirituality"] = { "skills.txt", 38 },
- ["Sorcery"] = { "skills.txt", 23 },
- ["Stealing"] = { "skills.txt", 19 },
- ["Stealth"] = { "skills.txt", 15 },
- ["Stunning-blows"] = { "skills.txt", 53 },
- ["Summoning"] = { "skills.txt", 43 },
- ["Sword-mastery"] = { "skills.txt", 03 },
- ["Symbiosis"] = { "skills.txt", 46 },
- ["Temporal"] = { "skills.txt", 32 },
- ["Thaumaturgy"] = { "skills.txt", 37 },
- ["Udun"] = { "skills.txt", 48 },
- ["Weaponmastery"] = { "skills.txt", 02 },
- ["Water"] = { "skills.txt", 26 },
- },
["ability"] =
{
["Spread blows"] = { "ability.txt", 02 },
diff --git a/lib/scpt/help.lua b/lib/scpt/help.lua
index 189cd687..421cdb11 100644
--- a/lib/scpt/help.lua
+++ b/lib/scpt/help.lua
@@ -24,64 +24,6 @@ ingame_help
-- list of files for classes, { filename, anchor }
local t =
{
- ["skill"] =
- {
- ["Air"] = { "skills.txt", 27 },
- ["Alchemy"] = { "skills.txt", 49 },
- ["Antimagic"] = { "skills.txt", 50 },
- ["Archery"] = { "skills.txt", 08 },
- ["Axe-mastery"] = { "skills.txt", 05 },
- ["Backstab"] = { "skills.txt", 18 },
- ["Barehand-combat"] = { "skills.txt", 13 },
- ["Boomerang-mastery"] = { "skills.txt", 12 },
- ["Boulder-throwing"] = { "skills.txt", 58 },
- ["Bow-mastery"] = { "skills.txt", 10 },
- ["Combat"] = { "skills.txt", 01 },
- ["Conveyance"] = { "skills.txt", 30 },
- ["Corpse-preservation"] = { "skills.txt", 44 },
- ["Critical-hits"] = { "skills.txt", 04 },
- ["Crossbow-mastery"] = { "skills.txt", 11 },
- ["Demonology"] = { "skills.txt", 52 },
- ["Disarming"] = { "skills.txt", 16 },
- ["Divination"] = { "skills.txt", 31 },
- ["Dodging"] = { "skills.txt", 20 },
- ["Druidistic"] = { "skills.txt", 40 },
- ["Earth"] = { "skills.txt", 28 },
- ["Fire"] = { "skills.txt", 25 },
- ["Geomancy"] = { "skills.txt", 60 },
- ["Hafted-mastery"] = { "skills.txt", 06 },
- ["Magic"] = { "skills.txt", 21 },
- ["Magic-Device"] = { "skills.txt", 54 },
- ["Mana"] = { "skills.txt", 24 },
- ["Meta"] = { "skills.txt", 29 },
- ["Mimicry"] = { "skills.txt", 47 },
- ["Mind"] = { "skills.txt", 33 },
- ["Mindcraft"] = { "skills.txt", 41 },
- ["Monster-lore"] = { "skills.txt", 42 },
- ["Music"] = { "skills.txt", 59 },
- ["Nature"] = { "skills.txt", 34 },
- ["Necromancy"] = { "skills.txt", 35 },
- ["Polearm-mastery"] = { "skills.txt", 07 },
- ["Possession"] = { "skills.txt", 45 },
- ["Prayer"] = { "skills.txt", 39 },
- ["Runecraft"] = { "skills.txt", 36 },
- ["Sling-mastery"] = { "skills.txt", 09 },
- ["Sneakiness"] = { "skills.txt", 14 },
- ["Spell-power"] = { "skills.txt", 22 },
- ["Spirituality"] = { "skills.txt", 38 },
- ["Sorcery"] = { "skills.txt", 23 },
- ["Stealing"] = { "skills.txt", 19 },
- ["Stealth"] = { "skills.txt", 15 },
- ["Stunning-blows"] = { "skills.txt", 53 },
- ["Summoning"] = { "skills.txt", 43 },
- ["Sword-mastery"] = { "skills.txt", 03 },
- ["Symbiosis"] = { "skills.txt", 46 },
- ["Temporal"] = { "skills.txt", 32 },
- ["Thaumaturgy"] = { "skills.txt", 37 },
- ["Udun"] = { "skills.txt", 48 },
- ["Weaponmastery"] = { "skills.txt", 02 },
- ["Water"] = { "skills.txt", 26 },
- },
["ability"] =
{
["Spread blows"] = { "ability.txt", 02 },
diff --git a/src/externs.h b/src/externs.h
index d2ff11c2..6b416e7e 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -622,6 +622,7 @@ extern void help_race(cptr race);
extern void help_subrace(cptr subrace);
extern void help_class(cptr klass);
extern void help_god(cptr god);
+extern void help_skill(cptr skill);
/* birth.c */
extern void print_desc_aux(cptr txt, int y, int x);
diff --git a/src/help.c b/src/help.c
index 874f0f45..510fe2dd 100644
--- a/src/help.c
+++ b/src/help.c
@@ -219,6 +219,69 @@ context_help_type god_table[] =
};
/**
+ * Skill help files
+ */
+context_help_type skill_table[] =
+{
+ { "Air", "skills.txt", 27 },
+ { "Alchemy", "skills.txt", 49 },
+ { "Antimagic", "skills.txt", 50 },
+ { "Archery", "skills.txt", 8 },
+ { "Axe-mastery", "skills.txt", 5 },
+ { "Backstab", "skills.txt", 18 },
+ { "Barehand-combat", "skills.txt", 13 },
+ { "Boomerang-mastery", "skills.txt", 12 },
+ { "Boulder-throwing", "skills.txt", 58 },
+ { "Bow-mastery", "skills.txt", 10 },
+ { "Combat", "skills.txt", 1 },
+ { "Conveyance", "skills.txt", 30 },
+ { "Corpse-preservation", "skills.txt", 44 },
+ { "Critical-hits", "skills.txt", 4 },
+ { "Crossbow-mastery", "skills.txt", 11 },
+ { "Demonology", "skills.txt", 52 },
+ { "Disarming", "skills.txt", 16 },
+ { "Divination", "skills.txt", 31 },
+ { "Dodging", "skills.txt", 20 },
+ { "Druidistic", "skills.txt", 40 },
+ { "Earth", "skills.txt", 28 },
+ { "Fire", "skills.txt", 25 },
+ { "Geomancy", "skills.txt", 60 },
+ { "Hafted-mastery", "skills.txt", 6 },
+ { "Magic", "skills.txt", 21 },
+ { "Magic-Device", "skills.txt", 54 },
+ { "Mana", "skills.txt", 24 },
+ { "Meta", "skills.txt", 29 },
+ { "Mimicry", "skills.txt", 47 },
+ { "Mind", "skills.txt", 33 },
+ { "Mindcraft", "skills.txt", 41 },
+ { "Monster-lore", "skills.txt", 42 },
+ { "Music", "skills.txt", 59 },
+ { "Nature", "skills.txt", 34 },
+ { "Necromancy", "skills.txt", 35 },
+ { "Polearm-mastery", "skills.txt", 7 },
+ { "Possession", "skills.txt", 45 },
+ { "Prayer", "skills.txt", 39 },
+ { "Runecraft", "skills.txt", 36 },
+ { "Sling-mastery", "skills.txt", 9 },
+ { "Sneakiness", "skills.txt", 14 },
+ { "Spell-power", "skills.txt", 22 },
+ { "Spirituality", "skills.txt", 38 },
+ { "Sorcery", "skills.txt", 23 },
+ { "Stealing", "skills.txt", 19 },
+ { "Stealth", "skills.txt", 15 },
+ { "Stunning-blows", "skills.txt", 53 },
+ { "Summoning", "skills.txt", 43 },
+ { "Sword-mastery", "skills.txt", 3 },
+ { "Symbiosis", "skills.txt", 46 },
+ { "Temporal", "skills.txt", 32 },
+ { "Thaumaturgy", "skills.txt", 37 },
+ { "Udun", "skills.txt", 48 },
+ { "Weaponmastery", "skills.txt", 2 },
+ { "Water", "skills.txt", 26 },
+ { NULL, NULL, 0 },
+};
+
+/**
* Trigger functions
*/
static bool_ trigger_void_jumpgate(void *in, void *out) {
@@ -639,3 +702,8 @@ void help_god(cptr god)
show_context_help(context_help);
}
}
+
+void help_skill(cptr skill)
+{
+ show_context_help(find_context_help(skill_table, skill));
+}
diff --git a/src/skills.c b/src/skills.c
index acb63999..2a0a4f18 100644
--- a/src/skills.c
+++ b/src/skills.c
@@ -553,8 +553,10 @@ void do_cmd_skill()
if (wizard && (c == '-')) skill_bonus[table[sel][0]] -= SKILL_STEP;
/* Contextual help */
- if (c == '?') exec_lua(format("ingame_help('select_context', 'skill', '%s')", s_info[table[sel][0]].name + s_name));
- ;
+ if (c == '?')
+ {
+ help_skill(s_info[table[sel][0]].name + s_name);
+ }
/* Handle boundaries and scrolling */
if (sel < 0) sel = max - 1;