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