mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-15 08:03:45 +01:00
Defiant and Competitive
This commit is contained in:
parent
c0f47d67aa
commit
c1f9032989
@ -5803,6 +5803,16 @@ BattleScript_DrizzleActivates::
|
|||||||
call BattleScript_WeatherFormChanges
|
call BattleScript_WeatherFormChanges
|
||||||
end3
|
end3
|
||||||
|
|
||||||
|
BattleScript_DefiantActivates::
|
||||||
|
pause 0x20
|
||||||
|
call BattleScript_AbilityPopUp
|
||||||
|
statbuffchange 0, NULL
|
||||||
|
setgraphicalstatchangevalues
|
||||||
|
playanimation BS_ABILITY_BATTLER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
|
||||||
|
printstring STRINGID_PKMNSSTATCHANGED2
|
||||||
|
waitmessage 0x40
|
||||||
|
return
|
||||||
|
|
||||||
BattleScript_AbilityPopUp:
|
BattleScript_AbilityPopUp:
|
||||||
showabilitypopup BS_ABILITY_BATTLER
|
showabilitypopup BS_ABILITY_BATTLER
|
||||||
recordability BS_ABILITY_BATTLER
|
recordability BS_ABILITY_BATTLER
|
||||||
|
@ -295,5 +295,6 @@ extern const u8 BattleScript_MistySurgeActivates[];
|
|||||||
extern const u8 BattleScript_ElectricSurgeActivates[];
|
extern const u8 BattleScript_ElectricSurgeActivates[];
|
||||||
extern const u8 BattleScript_SpectralThiefSteal[];
|
extern const u8 BattleScript_SpectralThiefSteal[];
|
||||||
extern const u8 BattleScript_StatUpMsg[];
|
extern const u8 BattleScript_StatUpMsg[];
|
||||||
|
extern const u8 BattleScript_DefiantActivates[];
|
||||||
|
|
||||||
#endif // GUARD_BATTLE_SCRIPTS_H
|
#endif // GUARD_BATTLE_SCRIPTS_H
|
||||||
|
@ -1893,8 +1893,9 @@ static void atk10_printstring(void)
|
|||||||
if (gBattleControllerExecFlags == 0)
|
if (gBattleControllerExecFlags == 0)
|
||||||
{
|
{
|
||||||
u16 var = T2_READ_16(gBattlescriptCurrInstr + 1);
|
u16 var = T2_READ_16(gBattlescriptCurrInstr + 1);
|
||||||
PrepareStringBattle(var, gBattlerAttacker);
|
|
||||||
gBattlescriptCurrInstr += 3;
|
gBattlescriptCurrInstr += 3;
|
||||||
|
PrepareStringBattle(var, gBattlerAttacker);
|
||||||
gBattleCommunication[MSG_DISPLAY] = 1;
|
gBattleCommunication[MSG_DISPLAY] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1938,9 +1939,8 @@ static void atk13_printfromtable(void)
|
|||||||
const u16 *ptr = (const u16*) T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
const u16 *ptr = (const u16*) T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
ptr += gBattleCommunication[MULTISTRING_CHOOSER];
|
ptr += gBattleCommunication[MULTISTRING_CHOOSER];
|
||||||
|
|
||||||
PrepareStringBattle(*ptr, gBattlerAttacker);
|
|
||||||
|
|
||||||
gBattlescriptCurrInstr += 5;
|
gBattlescriptCurrInstr += 5;
|
||||||
|
PrepareStringBattle(*ptr, gBattlerAttacker);
|
||||||
gBattleCommunication[MSG_DISPLAY] = 1;
|
gBattleCommunication[MSG_DISPLAY] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -483,11 +483,25 @@ void PrepareStringBattle(u16 stringId, u8 battler)
|
|||||||
else if (stringId == STRINGID_STATSWONTINCREASE && gBattleScripting.statChanger & STAT_BUFF_NEGATIVE)
|
else if (stringId == STRINGID_STATSWONTINCREASE && gBattleScripting.statChanger & STAT_BUFF_NEGATIVE)
|
||||||
stringId = STRINGID_STATSWONTDECREASE;
|
stringId = STRINGID_STATSWONTDECREASE;
|
||||||
|
|
||||||
if (stringId == STRINGID_STATSWONTDECREASE2 && GetBattlerAbility(battler) == ABILITY_CONTRARY)
|
else if (stringId == STRINGID_STATSWONTDECREASE2 && GetBattlerAbility(battler) == ABILITY_CONTRARY)
|
||||||
stringId = STRINGID_STATSWONTINCREASE2;
|
stringId = STRINGID_STATSWONTINCREASE2;
|
||||||
else if (stringId == STRINGID_STATSWONTINCREASE2 && GetBattlerAbility(battler) == ABILITY_CONTRARY)
|
else if (stringId == STRINGID_STATSWONTINCREASE2 && GetBattlerAbility(battler) == ABILITY_CONTRARY)
|
||||||
stringId = STRINGID_STATSWONTDECREASE2;
|
stringId = STRINGID_STATSWONTDECREASE2;
|
||||||
|
|
||||||
|
// Check Defiant and Competitive stat raise whenever a stat is lowered.
|
||||||
|
else if (((GetBattlerAbility(gBattlerTarget) == ABILITY_DEFIANT && gBattleMons[gBattlerTarget].statStages[STAT_ATK] != 12)
|
||||||
|
|| (GetBattlerAbility(gBattlerTarget) == ABILITY_COMPETITIVE && gBattleMons[gBattlerTarget].statStages[STAT_SPATK] != 12))
|
||||||
|
&& stringId == STRINGID_PKMNSSTATCHANGED4)
|
||||||
|
{
|
||||||
|
gBattlerAbility = gBattlerTarget;
|
||||||
|
BattleScriptPushCursor();
|
||||||
|
gBattlescriptCurrInstr = BattleScript_DefiantActivates;
|
||||||
|
if (GetBattlerAbility(gBattlerTarget) == ABILITY_DEFIANT)
|
||||||
|
SET_STATCHANGER(STAT_ATK, 2, FALSE);
|
||||||
|
else
|
||||||
|
SET_STATCHANGER(STAT_SPATK, 2, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
gActiveBattler = battler;
|
gActiveBattler = battler;
|
||||||
BtlController_EmitPrintString(0, stringId);
|
BtlController_EmitPrintString(0, stringId);
|
||||||
MarkBattlerForControllerExec(gActiveBattler);
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user