From 8f7682e6fbd636e3172290f0adc9e8b45c5dd0a2 Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Sat, 9 Jun 2012 09:55:18 +0200 Subject: Lua: Move "gained two melee skills" help to C --- src/help.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'src/help.c') 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); } /* -- cgit v1.2.3