summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-06-09 09:29:06 +0200
committerBardur Arantsson <bardur@scientician.net>2012-06-09 09:29:06 +0200
commit6987232c337535eb3b7f7de14ae0637d6f4b3d1d (patch)
tree2aca2263098956a5828e53eb87460532147e362e /src
parent6763d205ca391d8a4c1544afbcfceddf5ec54c77 (diff)
Lua: Move "identify object with spell slot" help to C
Diffstat (limited to 'src')
-rw-r--r--src/help.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/help.c b/src/help.c
index 73892ff7..bee5c480 100644
--- a/src/help.c
+++ b/src/help.c
@@ -14,7 +14,7 @@
#include "angband.h"
#define DESC_MAX 14
-#define TRIGGERED_HELP_MAX 16
+#define TRIGGERED_HELP_MAX 17
#define HELP_VOID_JUMPGATE 0
#define HELP_FOUNTAIN 1
@@ -32,6 +32,7 @@
#define HELP_GAME_THEME 13
#define HELP_1ST_LEVEL 14
#define HELP_20TH_LEVEL 15
+#define HELP_ID_SPELL_ITM 16
/**
* Struct for help triggered by a boolean condition
@@ -132,6 +133,21 @@ static bool_ trigger_20th_level(void *in, void *out) {
return (p_ptr->lev >= 20);
}
+static bool_ trigger_identify_spell_item(void *in_, void *out) {
+ hook_identify_in *in = (hook_identify_in *) in_;
+
+ if (in->mode == IDENT_FULL)
+ {
+ u32b f1, f2, f3, f4, f5, esp;
+ object_flags(in->o_ptr, &f1, &f2, &f3, &f4, &f5, &esp);
+ if (f5 & TR5_SPELL_CONTAIN)
+ {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
/**
* Trigger-based help items
*/
@@ -296,6 +312,16 @@ static triggered_help_type triggered_help[TRIGGERED_HELP_MAX] =
"http://angband.oook.cz/ where it will end up in the ladder.",
NULL
}
+ },
+ { HELP_ID_SPELL_ITM,
+ HOOK_IDENTIFY,
+ trigger_identify_spell_item,
+ { "Ah, an item that can contain a spell. To use it you must have some levels of",
+ "Magic skill and then you get the option to copy a spell when pressing m.",
+ "Then just select which spell to copy and to which object. Note that doing so",
+ "is permanent; the spell cannot be removed or changed later.",
+ NULL
+ }
}
};