diff options
author | Bardur Arantsson <bardur@scientician.net> | 2012-06-08 16:34:39 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2012-06-08 16:34:39 +0200 |
commit | ac8ef5f15e948e351ff4e92a4150ff6602dd680e (patch) | |
tree | cf21da10e677bebed4bb6abb49965f00b2f9a2e5 | |
parent | 4401b0bd2e85f491faf9971da4015a254b45366b (diff) |
Lua: Move "Found Altar" 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 ff901650..1f260a96 100644 --- a/lib/mods/theme/scpt/help.lua +++ b/lib/mods/theme/scpt/help.lua @@ -6,19 +6,6 @@ ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -ingame_help -{ - ["hook"] = HOOK_MOVE, - ["event"] = function(y, x) if (cave(y, x).feat >= FEAT_ALTAR_HEAD) and (cave(y, x).feat <= FEAT_ALTAR_TAIL) then return TRUE end end, - ["desc"] = - { - "Altars are the way to reach the Valar, powers of the world,", - "usualy called Gods. You can press O to become a follower.", - "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." - } -} - -- Beware this one, if Bree is moved from 21, 34 (y, x) on the wilderness map it will break ingame_help { diff --git a/lib/scpt/help.lua b/lib/scpt/help.lua index 8c8ffd8d..aa6d11f5 100644 --- a/lib/scpt/help.lua +++ b/lib/scpt/help.lua @@ -6,19 +6,6 @@ ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -ingame_help -{ - ["hook"] = HOOK_MOVE, - ["event"] = function(y, x) if (cave(y, x).feat >= FEAT_ALTAR_HEAD) and (cave(y, x).feat <= FEAT_ALTAR_TAIL) then return TRUE end end, - ["desc"] = - { - "Altars are the way to reach the Valar, powers of the world,", - "usualy called Gods. You can press O to become a follower.", - "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." - } -} - -- Beware this one, if Bree is moved from 21, 34 (y, x) on the wilderness map it will break ingame_help { @@ -14,11 +14,12 @@ #include "angband.h" #define DESC_MAX 10 -#define TRIGGERED_HELP_MAX 3 +#define TRIGGERED_HELP_MAX 4 #define HELP_VOID_JUMPGATE 0 #define HELP_FOUNTAIN 1 #define HELP_FOUND_OBJECT 2 +#define HELP_FOUND_ALTAR 3 /** * Struct for help triggered by a boolean condition @@ -54,6 +55,12 @@ static bool_ trigger_found_object(void *in, void *out) { return cave[p->y][p->x].o_idx != 0; } +static bool_ trigger_found_altar(void *in, void *out) { + hook_move_in *p = (hook_move_in *) in; + return ((cave[p->y][p->x].feat >= FEAT_ALTAR_HEAD) && + (cave[p->y][p->x].feat <= FEAT_ALTAR_TAIL)); +} + /** * Trigger-based help items */ @@ -82,6 +89,15 @@ static triggered_help_type triggered_help[TRIGGERED_HELP_MAX] = "some basic information. You may also want to identify them with scrolls,", "staves, rods or spells.", NULL } + }, + { HELP_FOUND_ALTAR, + HOOK_MOVE, + trigger_found_altar, + { "Altars are the way to reach the Valar, powers of the world,", + "usualy called Gods. You can press O to become a follower.", + "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 } } }; |