2018-02-13 17:22:33 +01:00
|
|
|
#include "global.h"
|
2018-02-13 18:38:54 +01:00
|
|
|
#include "event_data.h"
|
|
|
|
#include "event_scripts.h"
|
2018-02-13 17:22:33 +01:00
|
|
|
#include "field_effect.h"
|
2018-12-24 21:59:05 +01:00
|
|
|
#include "fldeff.h"
|
2018-02-13 17:22:33 +01:00
|
|
|
#include "party_menu.h"
|
|
|
|
#include "script.h"
|
2018-11-19 18:14:28 +01:00
|
|
|
#include "string_util.h"
|
2018-02-13 18:38:54 +01:00
|
|
|
#include "task.h"
|
2018-06-30 14:26:33 +02:00
|
|
|
#include "constants/event_objects.h"
|
2018-11-13 15:19:04 +01:00
|
|
|
#include "constants/field_effects.h"
|
2018-02-13 17:22:33 +01:00
|
|
|
|
2018-02-27 06:03:23 +01:00
|
|
|
// static functions
|
2020-07-02 10:59:52 +02:00
|
|
|
static void FieldCallback_Strength(void);
|
|
|
|
static void StartStrengthFieldEffect(void);
|
2018-02-13 17:22:33 +01:00
|
|
|
|
2018-02-27 06:03:23 +01:00
|
|
|
// text
|
2018-02-15 05:17:42 +01:00
|
|
|
bool8 SetUpFieldMove_Strength(void)
|
2018-02-13 17:22:33 +01:00
|
|
|
{
|
2019-11-21 05:12:51 +01:00
|
|
|
if (CheckObjectGraphicsInFrontOfPlayer(OBJ_EVENT_GFX_PUSHABLE_BOULDER) == TRUE)
|
2018-02-13 17:22:33 +01:00
|
|
|
{
|
|
|
|
gSpecialVar_Result = GetCursorSelectionMonId();
|
2018-06-16 00:45:48 +02:00
|
|
|
gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu;
|
2020-07-02 10:59:52 +02:00
|
|
|
gPostMenuFieldCallback = FieldCallback_Strength;
|
2018-02-13 17:22:33 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2020-07-02 10:59:52 +02:00
|
|
|
static void FieldCallback_Strength(void)
|
2018-02-13 17:22:33 +01:00
|
|
|
{
|
|
|
|
gFieldEffectArguments[0] = GetCursorSelectionMonId();
|
2022-08-15 21:18:12 +02:00
|
|
|
ScriptContext_SetupScript(EventScript_UseStrength);
|
2018-02-13 17:22:33 +01:00
|
|
|
}
|
|
|
|
|
2020-07-02 10:59:52 +02:00
|
|
|
bool8 FldEff_UseStrength(void)
|
2018-02-13 17:22:33 +01:00
|
|
|
{
|
2020-06-20 01:58:56 +02:00
|
|
|
u8 taskId = CreateFieldMoveTask();
|
2020-07-02 10:59:52 +02:00
|
|
|
gTasks[taskId].data[8] = (u32)StartStrengthFieldEffect >> 16;
|
|
|
|
gTasks[taskId].data[9] = (u32)StartStrengthFieldEffect;
|
2018-02-13 17:22:33 +01:00
|
|
|
GetMonNickname(&gPlayerParty[gFieldEffectArguments[0]], gStringVar1);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2020-07-02 10:59:52 +02:00
|
|
|
// Just passes control back to EventScript_UseStrength
|
|
|
|
static void StartStrengthFieldEffect(void)
|
2018-02-13 17:22:33 +01:00
|
|
|
{
|
2018-02-15 05:17:42 +01:00
|
|
|
FieldEffectActiveListRemove(FLDEFF_USE_STRENGTH);
|
2022-08-15 21:18:12 +02:00
|
|
|
ScriptContext_Enable();
|
2018-02-13 17:22:33 +01:00
|
|
|
}
|