mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Refactored Secret Power move effect into a function
This commit is contained in:
parent
142a83ca96
commit
5019615be1
@ -36,6 +36,7 @@ u32 IsAbilityStatusProtected(u32 battler);
|
||||
bool32 TryResetBattlerStatChanges(u8 battler);
|
||||
bool32 CanCamouflage(u8 battlerId);
|
||||
u16 GetNaturePowerMove(void);
|
||||
u16 GetSecretPowerMoveEffect(void);
|
||||
void StealTargetItem(u8 battlerStealer, u8 battlerItem);
|
||||
|
||||
extern void (* const gBattleScriptingCommandsTable[])(void);
|
||||
|
@ -12068,37 +12068,44 @@ static void Cmd_jumpifhasnohp(void)
|
||||
|
||||
static void Cmd_getsecretpowereffect(void)
|
||||
{
|
||||
gBattleScripting.moveEffect = GetSecretPowerMoveEffect();
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
|
||||
u16 GetSecretPowerMoveEffect(void)
|
||||
{
|
||||
u16 moveEffect;
|
||||
switch (gBattleTerrain)
|
||||
{
|
||||
case BATTLE_TERRAIN_GRASS:
|
||||
gBattleScripting.moveEffect = MOVE_EFFECT_SLEEP;
|
||||
moveEffect = MOVE_EFFECT_SLEEP;
|
||||
break;
|
||||
case BATTLE_TERRAIN_LONG_GRASS:
|
||||
gBattleScripting.moveEffect = MOVE_EFFECT_SLEEP;
|
||||
moveEffect = MOVE_EFFECT_SLEEP;
|
||||
break;
|
||||
case BATTLE_TERRAIN_SAND:
|
||||
gBattleScripting.moveEffect = MOVE_EFFECT_ACC_MINUS_1;
|
||||
moveEffect = MOVE_EFFECT_ACC_MINUS_1;
|
||||
break;
|
||||
case BATTLE_TERRAIN_UNDERWATER:
|
||||
gBattleScripting.moveEffect = MOVE_EFFECT_ATK_MINUS_1;
|
||||
moveEffect = MOVE_EFFECT_ATK_MINUS_1;
|
||||
break;
|
||||
case BATTLE_TERRAIN_WATER:
|
||||
gBattleScripting.moveEffect = MOVE_EFFECT_ATK_MINUS_1;
|
||||
moveEffect = MOVE_EFFECT_ATK_MINUS_1;
|
||||
break;
|
||||
case BATTLE_TERRAIN_POND:
|
||||
gBattleScripting.moveEffect = MOVE_EFFECT_ATK_MINUS_1;
|
||||
moveEffect = MOVE_EFFECT_ATK_MINUS_1;
|
||||
break;
|
||||
case BATTLE_TERRAIN_MOUNTAIN:
|
||||
gBattleScripting.moveEffect = MOVE_EFFECT_ACC_MINUS_1;
|
||||
moveEffect = MOVE_EFFECT_ACC_MINUS_1;
|
||||
break;
|
||||
case BATTLE_TERRAIN_CAVE:
|
||||
gBattleScripting.moveEffect = MOVE_EFFECT_FLINCH;
|
||||
moveEffect = MOVE_EFFECT_FLINCH;
|
||||
break;
|
||||
default:
|
||||
gBattleScripting.moveEffect = MOVE_EFFECT_PARALYSIS;
|
||||
moveEffect = MOVE_EFFECT_PARALYSIS;
|
||||
break;
|
||||
}
|
||||
gBattlescriptCurrInstr++;
|
||||
return moveEffect;
|
||||
}
|
||||
|
||||
static void Cmd_pickup(void)
|
||||
|
Loading…
Reference in New Issue
Block a user