pokeemerald/src/fldeff_strength.c

51 lines
1.4 KiB
C
Raw Normal View History

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