summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-06-08 17:36:02 +0200
committerBardur Arantsson <bardur@scientician.net>2012-06-08 17:39:52 +0200
commit0ade661fe361dae2f733587f1934e078fd4559fb (patch)
treecce41d4f4d3d0cd85ccad5b23248b73cf0abf506
parent0bad18e026e1fd9254191aa8d41f2d4c1b5ce19b (diff)
Lua: Move "pick up rune" help to C
-rw-r--r--lib/mods/theme/scpt/help.lua11
-rw-r--r--lib/scpt/help.lua11
-rw-r--r--src/help.c17
3 files changed, 16 insertions, 23 deletions
diff --git a/lib/mods/theme/scpt/help.lua b/lib/mods/theme/scpt/help.lua
index 98f3c9a9..7ab4871f 100644
--- a/lib/mods/theme/scpt/help.lua
+++ b/lib/mods/theme/scpt/help.lua
@@ -291,17 +291,6 @@ ingame_help
ingame_help
{
["hook"] = HOOK_GET,
- ["event"] = function(obj, idx) if obj.tval == TV_RUNE1 or obj.tval == TV_RUNE2 then return TRUE end end,
- ["desc"] =
- {
- "Ah, a rune! Runes are used with the Runecraft skill to allow you to",
- "create spells on your own.",
- }
-}
-
-ingame_help
-{
- ["hook"] = HOOK_GET,
["event"] = function(obj, idx) if obj.tval == TV_ROD_MAIN then return TRUE end end,
["desc"] =
{
diff --git a/lib/scpt/help.lua b/lib/scpt/help.lua
index c49eed97..c6597521 100644
--- a/lib/scpt/help.lua
+++ b/lib/scpt/help.lua
@@ -257,17 +257,6 @@ ingame_help
ingame_help
{
["hook"] = HOOK_GET,
- ["event"] = function(obj, idx) if obj.tval == TV_RUNE1 or obj.tval == TV_RUNE2 then return TRUE end end,
- ["desc"] =
- {
- "Ah, a rune! Runes are used with the Runecraft skill to allow you to",
- "create spells on your own.",
- }
-}
-
-ingame_help
-{
- ["hook"] = HOOK_GET,
["event"] = function(obj, idx) if obj.tval == TV_ROD_MAIN then return TRUE end end,
["desc"] =
{
diff --git a/src/help.c b/src/help.c
index cb73025b..a0ad3612 100644
--- a/src/help.c
+++ b/src/help.c
@@ -14,7 +14,7 @@
#include "angband.h"
#define DESC_MAX 10
-#define TRIGGERED_HELP_MAX 6
+#define TRIGGERED_HELP_MAX 7
#define HELP_VOID_JUMPGATE 0
#define HELP_FOUNTAIN 1
@@ -22,6 +22,7 @@
#define HELP_FOUND_ALTAR 3
#define HELP_FOUND_STAIR 4
#define HELP_GET_ESSENCE 5
+#define HELP_GET_RUNE 6
/**
* Struct for help triggered by a boolean condition
@@ -73,6 +74,12 @@ static bool_ trigger_get_essence(void *in, void *out) {
return (g->o_ptr->tval == TV_BATERIE);
}
+static bool_ trigger_get_rune(void *in, void *out) {
+ hook_get_in *g = (hook_get_in *) in;
+ return ((g->o_ptr->tval == TV_RUNE1) ||
+ (g->o_ptr->tval == TV_RUNE2));
+}
+
/**
* Trigger-based help items
*/
@@ -124,6 +131,14 @@ static triggered_help_type triggered_help[TRIGGERED_HELP_MAX] =
{ "Ah, an essence! Those magical containers stores energies. They are used",
"with the Alchemy skill to create or modify the powers of items.",
NULL }
+ },
+ { HELP_GET_RUNE,
+ HOOK_GET,
+ trigger_get_rune,
+ { "Ah, a rune! Runes are used with the Runecraft skill to allow you to",
+ "create spells on your own.",
+ NULL
+ }
}
};