summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-06-09 17:18:46 +0200
committerBardur Arantsson <bardur@scientician.net>2012-06-09 17:22:03 +0200
commitcbe5a2de1592e402808e962de8d346829aa5aba4 (patch)
treeafc80b9199dd18c9bc112617bdd856bf9291e506 /src
parent4da2e8d9545698b9fc7936e5f6d9a137d0b7c930 (diff)
Lua: Move "ability" help to C
Diffstat (limited to 'src')
-rw-r--r--src/externs.h1
-rw-r--r--src/help.c24
-rw-r--r--src/skills.c6
3 files changed, 29 insertions, 2 deletions
diff --git a/src/externs.h b/src/externs.h
index 6b416e7e..e1f77bc1 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -623,6 +623,7 @@ extern void help_subrace(cptr subrace);
extern void help_class(cptr klass);
extern void help_god(cptr god);
extern void help_skill(cptr skill);
+extern void help_ability(cptr ability);
/* birth.c */
extern void print_desc_aux(cptr txt, int y, int x);
diff --git a/src/help.c b/src/help.c
index 510fe2dd..a19b7b27 100644
--- a/src/help.c
+++ b/src/help.c
@@ -282,6 +282,25 @@ context_help_type skill_table[] =
};
/**
+ * Ability help files
+ */
+context_help_type ability_table[] =
+{
+ { "Spread blows", "ability.txt", 2 },
+ { "Tree walking", "ability.txt", 3 },
+ { "Perfect casting", "ability.txt", 4 },
+ { "Extra Max Blow(1)", "ability.txt", 5 },
+ { "Extra Max Blow(2)", "ability.txt", 6 },
+ { "Ammo creation", "ability.txt", 7 },
+ { "Touch of death", "ability.txt", 8 },
+ { "Artifact Creation", "ability.txt", 9 },
+ { "Far reaching attack", "ability.txt", 10 },
+ { "Trapping", "ability.txt", 11 },
+ { "Undead Form", "ability.txt", 12 },
+ { NULL, NULL, 0 },
+};
+
+/**
* Trigger functions
*/
static bool_ trigger_void_jumpgate(void *in, void *out) {
@@ -707,3 +726,8 @@ void help_skill(cptr skill)
{
show_context_help(find_context_help(skill_table, skill));
}
+
+void help_ability(cptr ability)
+{
+ show_context_help(find_context_help(ability_table, ability));
+}
diff --git a/src/skills.c b/src/skills.c
index 2a0a4f18..aba838be 100644
--- a/src/skills.c
+++ b/src/skills.c
@@ -1611,8 +1611,10 @@ if (ab_info[i].name)
if (wizard && (c == '-')) ab_info[table[sel]].acquired = FALSE;
/* Contextual help */
- if (c == '?') exec_lua(format("ingame_help('select_context', 'ability', '%s')", ab_info[table[sel]].name + ab_name));
- ;
+ if (c == '?')
+ {
+ help_ability(ab_info[table[sel]].name + ab_name);
+ }
/* Handle boundaries and scrolling */
if (sel < 0) sel = max - 1;