summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/mods/theme/scpt/help.lua11
-rw-r--r--lib/scpt/help.lua11
-rw-r--r--src/help.c15
3 files changed, 14 insertions, 23 deletions
diff --git a/lib/mods/theme/scpt/help.lua b/lib/mods/theme/scpt/help.lua
index ca6fa6c6..e1feea19 100644
--- a/lib/mods/theme/scpt/help.lua
+++ b/lib/mods/theme/scpt/help.lua
@@ -9,17 +9,6 @@
ingame_help
{
["hook"] = HOOK_MOVE,
- ["event"] = function(y, x) if cave(y, x).feat == FEAT_FOUNTAIN then return TRUE end end,
- ["desc"] =
- {
- "Fountains are always magical. You can quaff from them by pressing H.",
- "Beware that unlike potions they cannot be identified.",
- }
-}
-
-ingame_help
-{
- ["hook"] = HOOK_MOVE,
["event"] = function(y, x) if cave(y, x).o_idx ~= 0 then return TRUE end end,
["desc"] =
{
diff --git a/lib/scpt/help.lua b/lib/scpt/help.lua
index 293de713..42fb9eeb 100644
--- a/lib/scpt/help.lua
+++ b/lib/scpt/help.lua
@@ -9,17 +9,6 @@
ingame_help
{
["hook"] = HOOK_MOVE,
- ["event"] = function(y, x) if cave(y, x).feat == FEAT_FOUNTAIN then return TRUE end end,
- ["desc"] =
- {
- "Fountains are always magical. You can quaff from them by pressing H.",
- "Beware that unlike potions they cannot be identified.",
- }
-}
-
-ingame_help
-{
- ["hook"] = HOOK_MOVE,
["event"] = function(y, x) if cave(y, x).o_idx ~= 0 then return TRUE end end,
["desc"] =
{
diff --git a/src/help.c b/src/help.c
index a87a146a..edc61e53 100644
--- a/src/help.c
+++ b/src/help.c
@@ -14,9 +14,10 @@
#include "angband.h"
#define DESC_MAX 10
-#define TRIGGERED_HELP_MAX 1
+#define TRIGGERED_HELP_MAX 2
#define HELP_VOID_JUMPGATE 0
+#define HELP_FOUNTAIN 1
/**
* Struct for help triggered by a boolean condition
@@ -42,6 +43,11 @@ static bool_ trigger_void_jumpgate(void *in, void *out) {
return cave[p->y][p->x].feat == FEAT_BETWEEN;
}
+static bool_ trigger_fountain(void *in, void *out) {
+ hook_move_in *p = (hook_move_in *) in;
+ return cave[p->y][p->x].feat == FEAT_FOUNTAIN;
+}
+
/**
* Trigger-based help items
*/
@@ -53,6 +59,13 @@ static triggered_help_type triggered_help[TRIGGERED_HELP_MAX] =
{ "Void Jumpgates can be entered by pressing the > key. They will transport",
"you to another jumpgate, but beware of the cold damage that might kill you.",
NULL }
+ },
+ { HELP_FOUNTAIN,
+ HOOK_MOVE,
+ trigger_fountain,
+ { "Fountains are always magical. You can quaff from them by pressing H.",
+ "Beware that unlike potions they cannot be identified.",
+ NULL }
}
};