diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-06-08 16:45:21 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-06-08 16:45:21 +0200 |
commit | 41d157bccff5ae75117ea056915099981e338918 (patch) | |
tree | e1daeaab3fba6b5bb71cbd0ac8cd793c2ff55065 | |
parent | ac8ef5f15e948e351ff4e92a4150ff6602dd680e (diff) |
Lua: Move "Found Stairs" help to C
-rw-r--r-- | lib/mods/theme/scpt/help.lua | 11 | ||||
-rw-r--r-- | lib/scpt/help.lua | 11 | ||||
-rw-r--r-- | src/help.c | 15 |
3 files changed, 14 insertions, 23 deletions
diff --git a/lib/mods/theme/scpt/help.lua b/lib/mods/theme/scpt/help.lua index 1f260a96..decad717 100644 --- a/lib/mods/theme/scpt/help.lua +++ b/lib/mods/theme/scpt/help.lua @@ -36,17 +36,6 @@ ingame_help ingame_help { - ["hook"] = HOOK_MOVE, - ["event"] = function(y, x) if cave(y, x).feat == FEAT_MORE then return TRUE end end, - ["desc"] = - { - "Ah, this is a stair, or a way into something. Press > to enter it.", - "But be ready to fight what lies within, for it might not be too friendly.", - } -} - -ingame_help -{ ["callback"] = "monster_chat", ["desc"] = { diff --git a/lib/scpt/help.lua b/lib/scpt/help.lua index aa6d11f5..eb4bfa1a 100644 --- a/lib/scpt/help.lua +++ b/lib/scpt/help.lua @@ -36,17 +36,6 @@ ingame_help ingame_help { - ["hook"] = HOOK_MOVE, - ["event"] = function(y, x) if cave(y, x).feat == FEAT_MORE then return TRUE end end, - ["desc"] = - { - "Ah, this is a stair, or a way into something. Press > to enter it.", - "But be ready to fight what lies within, for it might not be too friendly.", - } -} - -ingame_help -{ ["callback"] = "monster_chat", ["desc"] = { @@ -14,12 +14,13 @@ #include "angband.h" #define DESC_MAX 10 -#define TRIGGERED_HELP_MAX 4 +#define TRIGGERED_HELP_MAX 5 #define HELP_VOID_JUMPGATE 0 #define HELP_FOUNTAIN 1 #define HELP_FOUND_OBJECT 2 #define HELP_FOUND_ALTAR 3 +#define HELP_FOUND_STAIR 4 /** * Struct for help triggered by a boolean condition @@ -61,6 +62,11 @@ static bool_ trigger_found_altar(void *in, void *out) { (cave[p->y][p->x].feat <= FEAT_ALTAR_TAIL)); } +static bool_ trigger_found_stairs(void *in, void *out) { + hook_move_in *p = (hook_move_in *) in; + return (cave[p->y][p->x].feat == FEAT_MORE); +} + /** * Trigger-based help items */ @@ -98,6 +104,13 @@ static triggered_help_type triggered_help[TRIGGERED_HELP_MAX] = "Beware that once you follow a god, you are not allowed to change.", "For an exact description of what gods do and want, read the documentation.", NULL } + }, + { HELP_FOUND_STAIR, + HOOK_MOVE, + trigger_found_stairs, + { "Ah, this is a stair, or a way into something. Press > to enter it.", + "But be ready to fight what lies within, for it might not be too friendly.", + NULL } } }; |