summaryrefslogtreecommitdiff
path: root/src/help.c
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-06-09 09:55:18 +0200
committerBardur Arantsson <bardur@scientician.net>2012-06-09 09:55:18 +0200
commit8f7682e6fbd636e3172290f0adc9e8b45c5dd0a2 (patch)
tree7851abbedb23530c125a76b73c73fb99cbe9c1b6 /src/help.c
parent625f73559675c8bc7e627cd6dc5ab924aa10a068 (diff)
Lua: Move "gained two melee skills" help to C
Diffstat (limited to 'src/help.c')
-rw-r--r--src/help.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/help.c b/src/help.c
index bee5c480..a80d1a33 100644
--- a/src/help.c
+++ b/src/help.c
@@ -14,7 +14,7 @@
#include "angband.h"
#define DESC_MAX 14
-#define TRIGGERED_HELP_MAX 17
+#define TRIGGERED_HELP_MAX 18
#define HELP_VOID_JUMPGATE 0
#define HELP_FOUNTAIN 1
@@ -33,6 +33,12 @@
#define HELP_1ST_LEVEL 14
#define HELP_20TH_LEVEL 15
#define HELP_ID_SPELL_ITM 16
+#define HELP_MELEE_SKILLS 17
+
+/**
+ * Game started?
+ */
+static bool_ game_started = FALSE;
/**
* Struct for help triggered by a boolean condition
@@ -148,6 +154,10 @@ static bool_ trigger_identify_spell_item(void *in_, void *out) {
return FALSE;
}
+static bool_ trigger_melee_skills(void *in, void *out) {
+ return (game_started && (get_melee_skills() > 1));
+}
+
/**
* Trigger-based help items
*/
@@ -322,6 +332,14 @@ static triggered_help_type triggered_help[TRIGGERED_HELP_MAX] =
"is permanent; the spell cannot be removed or changed later.",
NULL
}
+ },
+ { HELP_MELEE_SKILLS,
+ HOOK_RECALC_SKILLS,
+ trigger_melee_skills,
+ { "Ah, you now possess more than one melee type. To switch between them press m",
+ "and select the switch melee type option.",
+ NULL
+ }
}
};
@@ -348,6 +366,12 @@ static bool_ triggered_help_hook(void *data, void *in, void *out)
return FALSE;
}
+static bool_ hook_game_start(void *data, void *in, void *out)
+{
+ game_started = TRUE;
+ return FALSE;
+}
+
static void setup_triggered_help_hook(int i)
{
static int counter = 0;
@@ -373,6 +397,11 @@ static void setup_triggered_help_hooks()
{
setup_triggered_help_hook(i);
}
+
+ add_hook_new(HOOK_GAME_START,
+ hook_game_start,
+ "help_game_start",
+ NULL);
}
/*