From 6daf34377e6c0c1e1861d65c55d2df18e9e491d4 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Fri, 8 Jun 2012 17:51:57 +0200 Subject: Lua: Move "pick up rod tip" help to C --- lib/mods/theme/scpt/help.lua | 13 ------------- lib/scpt/help.lua | 13 ------------- 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 @@ -288,19 +288,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, 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 @@ -254,19 +254,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, diff --git a/src/help.c b/src/help.c index d08299a1..6e93db92 100644 --- a/src/help.c +++ b/src/help.c @@ -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 + } } }; -- cgit v1.2.3