diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-06-08 17:51:57 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-06-08 17:51:57 +0200 |
commit | 6daf34377e6c0c1e1861d65c55d2df18e9e491d4 (patch) | |
tree | e633101960d6ef439f5f32b6731a5942b7a252c7 | |
parent | e0e4d2216c5763e318e4b321aef63cf67924f8d0 (diff) |
Lua: Move "pick up rod tip" help to C
-rw-r--r-- | lib/mods/theme/scpt/help.lua | 13 | ||||
-rw-r--r-- | lib/scpt/help.lua | 13 | ||||
-rw-r--r-- | src/help.c | 18 |
3 files changed, 17 insertions, 27 deletions
diff --git a/lib/mods/theme/scpt/help.lua b/lib/mods/theme/scpt/help.lua index 1273eab4..339a5d17 100644 --- a/lib/mods/theme/scpt/help.lua +++ b/lib/mods/theme/scpt/help.lua @@ -291,19 +291,6 @@ ingame_help ingame_help { ["hook"] = HOOK_GET, - ["event"] = function(obj, idx) if obj.tval == TV_ROD then return TRUE end end, - ["desc"] = - { - "You've found a rod-tip! You will need to attach it to a rod base", - "before you can use it. Once it has been attatched (use the 'z' key)", - "you cannot unattach it! The rod tip will determine the effect of", - "the rod. To use your rod, 'z'ap it once it has been assembled.", - } -} - -ingame_help -{ - ["hook"] = HOOK_GET, ["event"] = function(obj, idx) if obj.tval == TV_TRAPKIT then return TRUE end end, ["desc"] = { diff --git a/lib/scpt/help.lua b/lib/scpt/help.lua index 189805fb..e7b9a662 100644 --- a/lib/scpt/help.lua +++ b/lib/scpt/help.lua @@ -257,19 +257,6 @@ ingame_help ingame_help { ["hook"] = HOOK_GET, - ["event"] = function(obj, idx) if obj.tval == TV_ROD then return TRUE end end, - ["desc"] = - { - "You've found a rod-tip! You will need to attach it to a rod base", - "before you can use it. Once it has been attatched (use the 'z' key)", - "you cannot unattach it! The rod tip will determine the effect of", - "the rod. To use your rod, 'z'ap it once it has been assembled.", - } -} - -ingame_help -{ - ["hook"] = HOOK_GET, ["event"] = function(obj, idx) if obj.tval == TV_TRAPKIT then return TRUE end end, ["desc"] = { @@ -14,7 +14,7 @@ #include "angband.h" #define DESC_MAX 10 -#define TRIGGERED_HELP_MAX 8 +#define TRIGGERED_HELP_MAX 9 #define HELP_VOID_JUMPGATE 0 #define HELP_FOUNTAIN 1 @@ -24,6 +24,7 @@ #define HELP_GET_ESSENCE 5 #define HELP_GET_RUNE 6 #define HELP_GET_ROD 7 +#define HELP_GET_ROD_TIP 8 /** * Struct for help triggered by a boolean condition @@ -86,6 +87,11 @@ static bool_ trigger_get_rod(void *in, void *out) { return (g->o_ptr->tval == TV_ROD_MAIN); } +static bool_ trigger_get_rod_tip(void *in, void *out) { + hook_get_in *g = (hook_get_in *) in; + return (g->o_ptr->tval == TV_ROD); +} + /** * Trigger-based help items */ @@ -154,6 +160,16 @@ static triggered_help_type triggered_help[TRIGGERED_HELP_MAX] = "like quicker charging time, or a larger capacity for charges.", NULL } + }, + { HELP_GET_ROD_TIP, + HOOK_GET, + trigger_get_rod_tip, + { "You've found a rod-tip! You will need to attach it to a rod base", + "before you can use it. Once it has been attatched (use the 'z' key)", + "you cannot unattach it! The rod tip will determine the effect of", + "the rod. To use your rod, 'z'ap it once it has been assembled.", + NULL + } } }; |