Implemented Cotton Down
This commit is contained in:
parent
3d8308844c
commit
0c4c6fc778
3 changed files with 35 additions and 0 deletions
|
@ -6189,6 +6189,25 @@ BattleScript_IllusionOff::
|
|||
waitmessage 0x40
|
||||
return
|
||||
|
||||
BattleScript_CottonDownActivates::
|
||||
setbyte gBattlerTarget, 0x1
|
||||
BattleScript_CottonDownLoop:
|
||||
setstatchanger STAT_SPEED, 1, TRUE
|
||||
statbuffchange STAT_BUFF_NOT_PROTECT_AFFECTED | STAT_BUFF_ALLOW_PTR, BattleScript_CottonDownActivatesLoopIncrement
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 0x2, BattleScript_CottonDownEnd
|
||||
call BattleScript_AbilityPopUp
|
||||
setgraphicalstatchangevalues
|
||||
playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
|
||||
setbyte gBattleCommunication STAT_SPEED
|
||||
stattextbuffer BS_TARGET
|
||||
printfromtable gStatDownStringIds
|
||||
waitmessage 0x40
|
||||
BattleScript_CottonDownActivatesLoopIncrement:
|
||||
addbyte gBattlerTarget, 0x1
|
||||
jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_CottonDownLoop
|
||||
BattleScript_CottonDownEnd:
|
||||
end3
|
||||
|
||||
BattleScript_AnticipationActivates::
|
||||
pause 0x5
|
||||
call BattleScript_AbilityPopUp
|
||||
|
|
|
@ -351,5 +351,6 @@ extern const u8 BattleScript_EmergencyExitWildNoPopUp[];
|
|||
extern const u8 BattleScript_CheekPouchActivates[];
|
||||
extern const u8 BattleScript_AnnounceAirLockCloudNine[];
|
||||
extern const u8 BattleScript_TargetAbilityStatRaiseOnSwitchin[];
|
||||
extern const u8 BattleScript_CottonDownActivates[];
|
||||
|
||||
#endif // GUARD_BATTLE_SCRIPTS_H
|
||||
|
|
|
@ -4608,6 +4608,21 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
|||
effect++;
|
||||
}
|
||||
break;
|
||||
case ABILITY_COTTON_DOWN:
|
||||
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
&& gBattleMons[gBattlerTarget].hp != 0
|
||||
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
|
||||
&& TARGET_TURN_DAMAGED)
|
||||
{
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
gBattlerAttacker = i;
|
||||
BattleScriptPushCursorAndCallback(BattleScript_CottonDownActivates);
|
||||
effect++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ABILITYEFFECT_MOVE_END_ATTACKER: // Same as above, but for attacker
|
||||
|
|
Loading…
Reference in a new issue