mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-14 15:43:43 +01:00
Add Protean
This commit is contained in:
parent
5aff99b015
commit
0329175f06
@ -5997,6 +5997,12 @@ BattleScript_ColorChangeActivates::
|
|||||||
waitmessage 0x40
|
waitmessage 0x40
|
||||||
return
|
return
|
||||||
|
|
||||||
|
BattleScript_ProteanActivates::
|
||||||
|
call BattleScript_AbilityPopUp
|
||||||
|
printstring STRINGID_PKMNCHANGEDTYPE
|
||||||
|
waitmessage 0x40
|
||||||
|
return
|
||||||
|
|
||||||
BattleScript_CursedBodyActivates::
|
BattleScript_CursedBodyActivates::
|
||||||
call BattleScript_AbilityPopUp
|
call BattleScript_AbilityPopUp
|
||||||
printstring STRINGID_CUSEDBODYDISABLED
|
printstring STRINGID_CUSEDBODYDISABLED
|
||||||
|
@ -283,5 +283,6 @@ extern const u8 BattleScript_MoveEffectFlameBurst[];
|
|||||||
extern const u8 BattleScript_TrainerSlideMsgRet[];
|
extern const u8 BattleScript_TrainerSlideMsgRet[];
|
||||||
extern const u8 BattleScript_TrainerSlideMsgEnd2[];
|
extern const u8 BattleScript_TrainerSlideMsgEnd2[];
|
||||||
extern const u8 BattleScript_MoveEffectFeint[];
|
extern const u8 BattleScript_MoveEffectFeint[];
|
||||||
|
extern const u8 BattleScript_ProteanActivates[];
|
||||||
|
|
||||||
#endif // GUARD_BATTLE_SCRIPTS_H
|
#endif // GUARD_BATTLE_SCRIPTS_H
|
||||||
|
@ -5467,8 +5467,7 @@ static void HandleAction_UseMove(void)
|
|||||||
{
|
{
|
||||||
u8 side;
|
u8 side;
|
||||||
u8 var = 4;
|
u8 var = 4;
|
||||||
u32 attackerAbility;
|
u32 moveType;
|
||||||
u32 ateType, moveType;
|
|
||||||
|
|
||||||
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
|
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
|
||||||
|
|
||||||
@ -5535,6 +5534,10 @@ static void HandleAction_UseMove(void)
|
|||||||
gBattleResults.lastUsedMoveOpponent = gCurrentMove;
|
gBattleResults.lastUsedMoveOpponent = gCurrentMove;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set dynamic move type.
|
||||||
|
SetTypeBeforeUsingMove(gChosenMove, gBattlerAttacker);
|
||||||
|
GET_MOVE_TYPE(gChosenMove, moveType);
|
||||||
|
|
||||||
// choose target
|
// choose target
|
||||||
side = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE;
|
side = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE;
|
||||||
if (gSideTimers[side].followmeTimer != 0
|
if (gSideTimers[side].followmeTimer != 0
|
||||||
@ -5547,8 +5550,8 @@ static void HandleAction_UseMove(void)
|
|||||||
else if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
else if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||||
&& gSideTimers[side].followmeTimer == 0
|
&& gSideTimers[side].followmeTimer == 0
|
||||||
&& (gBattleMoves[gCurrentMove].power != 0 || gBattleMoves[gCurrentMove].target != MOVE_TARGET_USER)
|
&& (gBattleMoves[gCurrentMove].power != 0 || gBattleMoves[gCurrentMove].target != MOVE_TARGET_USER)
|
||||||
&& ((gBattleMons[*(gBattleStruct->moveTarget + gBattlerAttacker)].ability != ABILITY_LIGHTNING_ROD && gBattleMoves[gCurrentMove].type == TYPE_ELECTRIC)
|
&& ((gBattleMons[*(gBattleStruct->moveTarget + gBattlerAttacker)].ability != ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC)
|
||||||
|| (gBattleMons[*(gBattleStruct->moveTarget + gBattlerAttacker)].ability != ABILITY_STORM_DRAIN && gBattleMoves[gCurrentMove].type == TYPE_WATER)
|
|| (gBattleMons[*(gBattleStruct->moveTarget + gBattlerAttacker)].ability != ABILITY_STORM_DRAIN && moveType == TYPE_WATER)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -5557,8 +5560,8 @@ static void HandleAction_UseMove(void)
|
|||||||
{
|
{
|
||||||
if (side != GetBattlerSide(gActiveBattler)
|
if (side != GetBattlerSide(gActiveBattler)
|
||||||
&& *(gBattleStruct->moveTarget + gBattlerAttacker) != gActiveBattler
|
&& *(gBattleStruct->moveTarget + gBattlerAttacker) != gActiveBattler
|
||||||
&& ((gBattleMons[gActiveBattler].ability == ABILITY_LIGHTNING_ROD && gBattleMoves[gCurrentMove].type == TYPE_ELECTRIC)
|
&& ((gBattleMons[gActiveBattler].ability == ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC)
|
||||||
|| (gBattleMons[gActiveBattler].ability == ABILITY_STORM_DRAIN && gBattleMoves[gCurrentMove].type == TYPE_WATER)
|
|| (gBattleMons[gActiveBattler].ability == ABILITY_STORM_DRAIN && moveType == TYPE_WATER)
|
||||||
)
|
)
|
||||||
&& GetBattlerTurnOrderNum(gActiveBattler) < var)
|
&& GetBattlerTurnOrderNum(gActiveBattler) < var)
|
||||||
{
|
{
|
||||||
@ -5692,9 +5695,6 @@ static void HandleAction_UseMove(void)
|
|||||||
if (gBattleTypeFlags & BATTLE_TYPE_ARENA)
|
if (gBattleTypeFlags & BATTLE_TYPE_ARENA)
|
||||||
BattleArena_AddMindPoints(gBattlerAttacker);
|
BattleArena_AddMindPoints(gBattlerAttacker);
|
||||||
|
|
||||||
// Set dynamic move type.
|
|
||||||
SetTypeBeforeUsingMove(gChosenMove, gBattlerAttacker);
|
|
||||||
|
|
||||||
gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT;
|
gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -949,6 +949,7 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move)
|
|||||||
static void atk00_attackcanceler(void)
|
static void atk00_attackcanceler(void)
|
||||||
{
|
{
|
||||||
s32 i;
|
s32 i;
|
||||||
|
u32 moveType;
|
||||||
|
|
||||||
if (gBattleOutcome != 0)
|
if (gBattleOutcome != 0)
|
||||||
{
|
{
|
||||||
@ -963,6 +964,21 @@ static void atk00_attackcanceler(void)
|
|||||||
}
|
}
|
||||||
if (AtkCanceller_UnableToUseMove())
|
if (AtkCanceller_UnableToUseMove())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Check Protean activation.
|
||||||
|
GET_MOVE_TYPE(gCurrentMove, moveType);
|
||||||
|
if (GetBattlerAbility(gBattlerAttacker) == ABILITY_PROTEAN
|
||||||
|
&& (gBattleMons[gBattlerAttacker].type1 != moveType || gBattleMons[gBattlerAttacker].type2 != moveType ||
|
||||||
|
(gBattleMons[gBattlerAttacker].type3 != moveType && gBattleMons[gBattlerAttacker].type3 != TYPE_MYSTERY))
|
||||||
|
&& gCurrentMove != MOVE_STRUGGLE)
|
||||||
|
{
|
||||||
|
PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType);
|
||||||
|
SET_BATTLER_TYPE(gBattlerAttacker, moveType);
|
||||||
|
BattleScriptPushCursor();
|
||||||
|
gBattlescriptCurrInstr = BattleScript_ProteanActivates;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (AbilityBattleEffects(ABILITYEFFECT_MOVES_BLOCK, gBattlerTarget, 0, 0, 0))
|
if (AbilityBattleEffects(ABILITYEFFECT_MOVES_BLOCK, gBattlerTarget, 0, 0, 0))
|
||||||
return;
|
return;
|
||||||
if (!gBattleMons[gBattlerAttacker].pp[gCurrMovePos] && gCurrentMove != MOVE_STRUGGLE && !(gHitMarker & 0x800200)
|
if (!gBattleMons[gBattlerAttacker].pp[gCurrMovePos] && gCurrentMove != MOVE_STRUGGLE && !(gHitMarker & 0x800200)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user