Merge branch 'battle_engine' of https://github.com/rh-hideout/pokeemerald-expansion into wandering_spirit
This commit is contained in:
commit
f4537b1213
9 changed files with 85 additions and 64 deletions
|
@ -5200,8 +5200,19 @@ BattleScript_EffectSkillSwap:
|
||||||
tryswapabilities BattleScript_ButItFailed
|
tryswapabilities BattleScript_ButItFailed
|
||||||
attackanimation
|
attackanimation
|
||||||
waitanimation
|
waitanimation
|
||||||
|
.if B_ABILITY_POP_UP == TRUE
|
||||||
|
copybyte gBattlerAbility, gBattlerTarget
|
||||||
|
call BattleScript_AbilityPopUp
|
||||||
|
pause 20
|
||||||
|
copybyte gBattlerAbility, gBattlerAttacker
|
||||||
|
call BattleScript_AbilityPopUp
|
||||||
|
.endif
|
||||||
printstring STRINGID_PKMNSWAPPEDABILITIES
|
printstring STRINGID_PKMNSWAPPEDABILITIES
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
|
.if B_SKILL_SWAP >= GEN_4
|
||||||
|
switchinabilities BS_ATTACKER
|
||||||
|
switchinabilities BS_TARGET
|
||||||
|
.endif
|
||||||
goto BattleScript_MoveEnd
|
goto BattleScript_MoveEnd
|
||||||
|
|
||||||
BattleScript_EffectImprison::
|
BattleScript_EffectImprison::
|
||||||
|
@ -5957,7 +5968,7 @@ BattleScript_DamagingWeatherHeal:
|
||||||
printstring STRINGID_ICEBODYHPGAIN
|
printstring STRINGID_ICEBODYHPGAIN
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
BattleScript_DamagingWeatherHpChange:
|
BattleScript_DamagingWeatherHpChange:
|
||||||
orword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_GRUDGE
|
orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
tryfaintmon BS_ATTACKER, FALSE, NULL
|
tryfaintmon BS_ATTACKER, FALSE, NULL
|
||||||
|
@ -5967,7 +5978,7 @@ BattleScript_DamagingWeatherLoopIncrement::
|
||||||
addbyte gBattleCommunication, 1
|
addbyte gBattleCommunication, 1
|
||||||
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamagingWeatherLoop
|
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_DamagingWeatherLoop
|
||||||
BattleScript_DamagingWeatherContinuesEnd::
|
BattleScript_DamagingWeatherContinuesEnd::
|
||||||
bicword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_GRUDGE
|
bicword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_GRUDGE
|
||||||
end2
|
end2
|
||||||
|
|
||||||
BattleScript_SandStormHailEnds::
|
BattleScript_SandStormHailEnds::
|
||||||
|
@ -6086,7 +6097,7 @@ BattleScript_SafeguardEnds::
|
||||||
|
|
||||||
BattleScript_LeechSeedTurnDrain::
|
BattleScript_LeechSeedTurnDrain::
|
||||||
playanimation BS_ATTACKER, B_ANIM_LEECH_SEED_DRAIN, sB_ANIM_ARG1
|
playanimation BS_ATTACKER, B_ANIM_LEECH_SEED_DRAIN, sB_ANIM_ARG1
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
copyword gBattleMoveDamage, gHpDealt
|
copyword gBattleMoveDamage, gHpDealt
|
||||||
|
@ -6100,7 +6111,7 @@ BattleScript_LeechSeedTurnPrintLiquidOoze::
|
||||||
call BattleScript_AbilityPopUp
|
call BattleScript_AbilityPopUp
|
||||||
setbyte cMULTISTRING_CHOOSER, B_MSG_LEECH_SEED_OOZE
|
setbyte cMULTISTRING_CHOOSER, B_MSG_LEECH_SEED_OOZE
|
||||||
BattleScript_LeechSeedTurnPrintAndUpdateHp::
|
BattleScript_LeechSeedTurnPrintAndUpdateHp::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_TARGET
|
healthbarupdate BS_TARGET
|
||||||
datahpupdate BS_TARGET
|
datahpupdate BS_TARGET
|
||||||
printfromtable gLeechSeedStringIds
|
printfromtable gLeechSeedStringIds
|
||||||
|
@ -6281,14 +6292,14 @@ BattleScript_EncoredNoMore::
|
||||||
BattleScript_DestinyBondTakesLife::
|
BattleScript_DestinyBondTakesLife::
|
||||||
printstring STRINGID_PKMNTOOKFOE
|
printstring STRINGID_PKMNTOOKFOE
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
tryfaintmon BS_ATTACKER, FALSE, NULL
|
tryfaintmon BS_ATTACKER, FALSE, NULL
|
||||||
return
|
return
|
||||||
|
|
||||||
BattleScript_DmgHazardsOnAttacker::
|
BattleScript_DmgHazardsOnAttacker::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
call BattleScript_PrintHurtByDmgHazards
|
call BattleScript_PrintHurtByDmgHazards
|
||||||
|
@ -6303,7 +6314,7 @@ BattleScript_DmgHazardsOnAttackerFainted::
|
||||||
goto BattleScript_HandleFaintedMon
|
goto BattleScript_HandleFaintedMon
|
||||||
|
|
||||||
BattleScript_DmgHazardsOnTarget::
|
BattleScript_DmgHazardsOnTarget::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_TARGET
|
healthbarupdate BS_TARGET
|
||||||
datahpupdate BS_TARGET
|
datahpupdate BS_TARGET
|
||||||
call BattleScript_PrintHurtByDmgHazards
|
call BattleScript_PrintHurtByDmgHazards
|
||||||
|
@ -6318,7 +6329,7 @@ BattleScript_DmgHazardsOnTargetFainted::
|
||||||
goto BattleScript_HandleFaintedMon
|
goto BattleScript_HandleFaintedMon
|
||||||
|
|
||||||
BattleScript_DmgHazardsOnFaintedBattler::
|
BattleScript_DmgHazardsOnFaintedBattler::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_FAINTED
|
healthbarupdate BS_FAINTED
|
||||||
datahpupdate BS_FAINTED
|
datahpupdate BS_FAINTED
|
||||||
call BattleScript_PrintHurtByDmgHazards
|
call BattleScript_PrintHurtByDmgHazards
|
||||||
|
@ -6373,7 +6384,7 @@ BattleScript_StickyWebOnSwitchInEnd:
|
||||||
BattleScript_PerishSongTakesLife::
|
BattleScript_PerishSongTakesLife::
|
||||||
printstring STRINGID_PKMNPERISHCOUNTFELL
|
printstring STRINGID_PKMNPERISHCOUNTFELL
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
tryfaintmon BS_ATTACKER, FALSE, NULL
|
tryfaintmon BS_ATTACKER, FALSE, NULL
|
||||||
|
@ -6383,14 +6394,14 @@ BattleScript_PerishBodyActivates::
|
||||||
call BattleScript_AbilityPopUp
|
call BattleScript_AbilityPopUp
|
||||||
printstring STRINGID_PKMNSWILLPERISHIN3TURNS
|
printstring STRINGID_PKMNSWILLPERISHIN3TURNS
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
return
|
return
|
||||||
|
|
||||||
BattleScript_GulpMissileGorging::
|
BattleScript_GulpMissileGorging::
|
||||||
call BattleScript_AbilityPopUp
|
call BattleScript_AbilityPopUp
|
||||||
playanimation BS_ATTACKER, B_ANIM_GULP_MISSILE, NULL
|
playanimation BS_ATTACKER, B_ANIM_GULP_MISSILE, NULL
|
||||||
waitanimation
|
waitanimation
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
effectivenesssound
|
effectivenesssound
|
||||||
hitanimation BS_ATTACKER
|
hitanimation BS_ATTACKER
|
||||||
waitstate
|
waitstate
|
||||||
|
@ -6419,7 +6430,7 @@ BattleScript_GulpMissileGulping::
|
||||||
call BattleScript_AbilityPopUp
|
call BattleScript_AbilityPopUp
|
||||||
playanimation BS_ATTACKER, B_ANIM_GULP_MISSILE, NULL
|
playanimation BS_ATTACKER, B_ANIM_GULP_MISSILE, NULL
|
||||||
waitanimation
|
waitanimation
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
effectivenesssound
|
effectivenesssound
|
||||||
hitanimation BS_ATTACKER
|
hitanimation BS_ATTACKER
|
||||||
waitstate
|
waitstate
|
||||||
|
@ -6998,7 +7009,7 @@ BattleScript_AnticipationActivates::
|
||||||
BattleScript_AftermathDmg::
|
BattleScript_AftermathDmg::
|
||||||
pause B_WAIT_TIME_SHORT
|
pause B_WAIT_TIME_SHORT
|
||||||
call BattleScript_AbilityPopUp
|
call BattleScript_AbilityPopUp
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
printstring STRINGID_AFTERMATHDMG
|
printstring STRINGID_AFTERMATHDMG
|
||||||
|
@ -7031,7 +7042,7 @@ BattleScript_PoisonTurnDmg::
|
||||||
BattleScript_DoStatusTurnDmg::
|
BattleScript_DoStatusTurnDmg::
|
||||||
statusanimation BS_ATTACKER
|
statusanimation BS_ATTACKER
|
||||||
BattleScript_DoTurnDmg:
|
BattleScript_DoTurnDmg:
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
tryfaintmon BS_ATTACKER, FALSE, NULL
|
tryfaintmon BS_ATTACKER, FALSE, NULL
|
||||||
|
@ -7044,7 +7055,7 @@ BattleScript_PoisonHealActivates::
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
recordability BS_ATTACKER
|
recordability BS_ATTACKER
|
||||||
statusanimation BS_ATTACKER
|
statusanimation BS_ATTACKER
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
end2
|
end2
|
||||||
|
@ -7141,7 +7152,7 @@ BattleScript_DoSelfConfusionDmg::
|
||||||
effectivenesssound
|
effectivenesssound
|
||||||
hitanimation BS_ATTACKER
|
hitanimation BS_ATTACKER
|
||||||
waitstate
|
waitstate
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
resultmessage
|
resultmessage
|
||||||
|
@ -7162,7 +7173,7 @@ BattleScript_MoveUsedPowder::
|
||||||
effectivenesssound
|
effectivenesssound
|
||||||
hitanimation BS_ATTACKER
|
hitanimation BS_ATTACKER
|
||||||
waitstate
|
waitstate
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
printstring STRINGID_POWDEREXPLODES
|
printstring STRINGID_POWDEREXPLODES
|
||||||
|
@ -7336,7 +7347,7 @@ BattleScript_MoveEffectRecoil::
|
||||||
jumpifmove MOVE_STRUGGLE, BattleScript_DoRecoil
|
jumpifmove MOVE_STRUGGLE, BattleScript_DoRecoil
|
||||||
jumpifability BS_ATTACKER, ABILITY_ROCK_HEAD, BattleScript_RecoilEnd
|
jumpifability BS_ATTACKER, ABILITY_ROCK_HEAD, BattleScript_RecoilEnd
|
||||||
BattleScript_DoRecoil::
|
BattleScript_DoRecoil::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_IGNORE_DISGUISE
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_IGNORE_DISGUISE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
printstring STRINGID_PKMNHITWITHRECOIL
|
printstring STRINGID_PKMNHITWITHRECOIL
|
||||||
|
@ -7490,13 +7501,15 @@ BattleScript_CheekPouchActivates::
|
||||||
|
|
||||||
BattleScript_HarvestActivates::
|
BattleScript_HarvestActivates::
|
||||||
pause 5
|
pause 5
|
||||||
|
tryrecycleitem BattleScript_HarvestActivatesEnd
|
||||||
call BattleScript_AbilityPopUp
|
call BattleScript_AbilityPopUp
|
||||||
printstring STRINGID_HARVESTBERRY
|
printstring STRINGID_HARVESTBERRY
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
|
BattleScript_HarvestActivatesEnd:
|
||||||
end3
|
end3
|
||||||
|
|
||||||
BattleScript_SolarPowerActivates::
|
BattleScript_SolarPowerActivates::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
call BattleScript_AbilityPopUp
|
call BattleScript_AbilityPopUp
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
|
@ -7742,7 +7755,7 @@ BattleScript_BadDreamsActivates::
|
||||||
BattleScript_BadDreamsLoop:
|
BattleScript_BadDreamsLoop:
|
||||||
trygetbaddreamstarget BattleScript_BadDreamsEnd
|
trygetbaddreamstarget BattleScript_BadDreamsEnd
|
||||||
dmg_1_8_targethp
|
dmg_1_8_targethp
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
printstring STRINGID_BADDREAMSDMG
|
printstring STRINGID_BADDREAMSDMG
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
jumpifability BS_TARGET, ABILITY_MAGIC_GUARD, BattleScript_BadDreamsIncrement
|
jumpifability BS_TARGET, ABILITY_MAGIC_GUARD, BattleScript_BadDreamsIncrement
|
||||||
|
@ -7911,14 +7924,14 @@ BattleScript_GrassyTerrainLoop:
|
||||||
printstring STRINGID_GRASSYTERRAINHEALS
|
printstring STRINGID_GRASSYTERRAINHEALS
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
BattleScript_GrassyTerrainHpChange:
|
BattleScript_GrassyTerrainHpChange:
|
||||||
orword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
BattleScript_GrassyTerrainLoopIncrement::
|
BattleScript_GrassyTerrainLoopIncrement::
|
||||||
addbyte gBattleCommunication, 1
|
addbyte gBattleCommunication, 1
|
||||||
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_GrassyTerrainLoop
|
jumpifbytenotequal gBattleCommunication, gBattlersCount, BattleScript_GrassyTerrainLoop
|
||||||
BattleScript_GrassyTerrainLoopEnd::
|
BattleScript_GrassyTerrainLoopEnd::
|
||||||
bicword gHitMarker, HITMARKER_x20 | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
bicword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
jumpifword CMP_COMMON_BITS, gFieldStatuses, STATUS_FIELD_TERRAIN_PERMANENT, BattleScript_GrassyTerrainHealEnd
|
jumpifword CMP_COMMON_BITS, gFieldStatuses, STATUS_FIELD_TERRAIN_PERMANENT, BattleScript_GrassyTerrainHealEnd
|
||||||
jumpifbyte CMP_EQUAL, gFieldTimers + 5, 0, BattleScript_GrassyTerrainEnds
|
jumpifbyte CMP_EQUAL, gFieldTimers + 5, 0, BattleScript_GrassyTerrainEnds
|
||||||
BattleScript_GrassyTerrainHealEnd:
|
BattleScript_GrassyTerrainHealEnd:
|
||||||
|
@ -8140,7 +8153,7 @@ BattleScript_ImposterActivates::
|
||||||
end3
|
end3
|
||||||
|
|
||||||
BattleScript_HurtAttacker:
|
BattleScript_HurtAttacker:
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
printstring STRINGID_PKMNHURTSWITH
|
printstring STRINGID_PKMNHURTSWITH
|
||||||
|
@ -8164,7 +8177,7 @@ BattleScript_RockyHelmetActivatesDmg:
|
||||||
|
|
||||||
BattleScript_SpikyShieldEffect::
|
BattleScript_SpikyShieldEffect::
|
||||||
jumpifabsent BS_ATTACKER, BattleScript_SpikyShieldRet
|
jumpifabsent BS_ATTACKER, BattleScript_SpikyShieldRet
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
|
@ -8175,7 +8188,7 @@ BattleScript_SpikyShieldRet::
|
||||||
return
|
return
|
||||||
|
|
||||||
BattleScript_KingsShieldEffect::
|
BattleScript_KingsShieldEffect::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
||||||
seteffectsecondary
|
seteffectsecondary
|
||||||
setmoveeffect 0
|
setmoveeffect 0
|
||||||
|
@ -8185,7 +8198,7 @@ BattleScript_KingsShieldEffect::
|
||||||
return
|
return
|
||||||
|
|
||||||
BattleScript_BanefulBunkerEffect::
|
BattleScript_BanefulBunkerEffect::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_x100000
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_PASSIVE_DAMAGE
|
||||||
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
|
||||||
seteffectsecondary
|
seteffectsecondary
|
||||||
setmoveeffect 0
|
setmoveeffect 0
|
||||||
|
@ -8439,7 +8452,7 @@ BattleScript_ItemHealHP_RemoveItemRet_Anim:
|
||||||
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
|
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
|
||||||
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
|
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
|
orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_SCRIPTING
|
healthbarupdate BS_SCRIPTING
|
||||||
datahpupdate BS_SCRIPTING
|
datahpupdate BS_SCRIPTING
|
||||||
removeitem BS_SCRIPTING
|
removeitem BS_SCRIPTING
|
||||||
|
@ -8454,7 +8467,7 @@ BattleScript_ItemHealHP_RemoveItemEnd2_Anim:
|
||||||
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
|
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
|
||||||
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
|
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
|
orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
removeitem BS_ATTACKER
|
removeitem BS_ATTACKER
|
||||||
|
@ -8488,7 +8501,7 @@ BattleScript_AirBaloonMsgPop::
|
||||||
return
|
return
|
||||||
|
|
||||||
BattleScript_ItemHurtRet::
|
BattleScript_ItemHurtRet::
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 | HITMARKER_IGNORE_DISGUISE
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE | HITMARKER_IGNORE_DISGUISE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
printstring STRINGID_HURTBYITEM
|
printstring STRINGID_HURTBYITEM
|
||||||
|
@ -8506,7 +8519,7 @@ BattleScript_ItemHealHP_Ret::
|
||||||
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
|
playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL
|
||||||
printstring STRINGID_PKMNSITEMRESTOREDHPALITTLE
|
printstring STRINGID_PKMNSITEMRESTOREDHPALITTLE
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE
|
orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_ATTACKER
|
healthbarupdate BS_ATTACKER
|
||||||
datahpupdate BS_ATTACKER
|
datahpupdate BS_ATTACKER
|
||||||
return
|
return
|
||||||
|
@ -8537,7 +8550,7 @@ BattleScript_BerryConfuseHealEnd2_Anim:
|
||||||
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
|
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
|
||||||
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
|
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
|
orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_SCRIPTING
|
healthbarupdate BS_SCRIPTING
|
||||||
datahpupdate BS_SCRIPTING
|
datahpupdate BS_SCRIPTING
|
||||||
printstring STRINGID_FORXCOMMAYZ
|
printstring STRINGID_FORXCOMMAYZ
|
||||||
|
@ -8556,7 +8569,7 @@ BattleScript_BerryConfuseHealRet_Anim:
|
||||||
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
|
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
|
||||||
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
|
printstring STRINGID_PKMNSITEMRESTOREDHEALTH
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
|
orword gHitMarker, HITMARKER_SKIP_DMG_TRACK | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||||
healthbarupdate BS_SCRIPTING
|
healthbarupdate BS_SCRIPTING
|
||||||
datahpupdate BS_SCRIPTING
|
datahpupdate BS_SCRIPTING
|
||||||
printstring STRINGID_FORXCOMMAYZ
|
printstring STRINGID_FORXCOMMAYZ
|
||||||
|
|
|
@ -547,7 +547,7 @@ struct BattleStruct
|
||||||
u16 synchronizeMoveEffect;
|
u16 synchronizeMoveEffect;
|
||||||
bool8 anyMonHasTransformed;
|
bool8 anyMonHasTransformed;
|
||||||
void (*savedCallback)(void);
|
void (*savedCallback)(void);
|
||||||
u16 usedHeldItems[MAX_BATTLERS_COUNT];
|
u16 usedHeldItems[PARTY_SIZE][2]; // For each party member and side. For harvest, recycle
|
||||||
u16 chosenItem[MAX_BATTLERS_COUNT];
|
u16 chosenItem[MAX_BATTLERS_COUNT];
|
||||||
u8 AI_itemType[2];
|
u8 AI_itemType[2];
|
||||||
u8 AI_itemFlags[2];
|
u8 AI_itemFlags[2];
|
||||||
|
|
|
@ -155,6 +155,7 @@ bool32 TryRoomService(u8 battlerId);
|
||||||
void BufferStatChange(u8 battlerId, u8 statId, u8 stringId);
|
void BufferStatChange(u8 battlerId, u8 statId, u8 stringId);
|
||||||
void DoBurmyFormChange(u32 monId);
|
void DoBurmyFormChange(u32 monId);
|
||||||
bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 checkTarget);
|
bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 checkTarget);
|
||||||
|
u16 GetUsedHeldItem(u8 battler);
|
||||||
|
|
||||||
// ability checks
|
// ability checks
|
||||||
bool32 IsRolePlayBannedAbilityAtk(u16 ability);
|
bool32 IsRolePlayBannedAbilityAtk(u16 ability);
|
||||||
|
|
|
@ -176,7 +176,7 @@
|
||||||
#define STATUS4_PLASMA_FISTS (1 << 1)
|
#define STATUS4_PLASMA_FISTS (1 << 1)
|
||||||
|
|
||||||
#define HITMARKER_x10 (1 << 4)
|
#define HITMARKER_x10 (1 << 4)
|
||||||
#define HITMARKER_x20 (1 << 5)
|
#define HITMARKER_SKIP_DMG_TRACK (1 << 5)
|
||||||
#define HITMARKER_DESTINYBOND (1 << 6)
|
#define HITMARKER_DESTINYBOND (1 << 6)
|
||||||
#define HITMARKER_NO_ANIMATIONS (1 << 7)
|
#define HITMARKER_NO_ANIMATIONS (1 << 7)
|
||||||
#define HITMARKER_IGNORE_SUBSTITUTE (1 << 8)
|
#define HITMARKER_IGNORE_SUBSTITUTE (1 << 8)
|
||||||
|
@ -190,7 +190,7 @@
|
||||||
#define HITMARKER_IGNORE_DISGUISE (1 << 16)
|
#define HITMARKER_IGNORE_DISGUISE (1 << 16)
|
||||||
// 3 free spots because of change in handling of UNDERGROUND/UNDERWATER/ON AIR
|
// 3 free spots because of change in handling of UNDERGROUND/UNDERWATER/ON AIR
|
||||||
#define HITMARKER_UNABLE_TO_USE_MOVE (1 << 19)
|
#define HITMARKER_UNABLE_TO_USE_MOVE (1 << 19)
|
||||||
#define HITMARKER_x100000 (1 << 20)
|
#define HITMARKER_PASSIVE_DAMAGE (1 << 20)
|
||||||
#define HITMARKER_x200000 (1 << 21)
|
#define HITMARKER_x200000 (1 << 21)
|
||||||
#define HITMARKER_x400000 (1 << 22)
|
#define HITMARKER_x400000 (1 << 22)
|
||||||
#define HITMARKER_x800000 (1 << 23)
|
#define HITMARKER_x800000 (1 << 23)
|
||||||
|
|
|
@ -148,6 +148,7 @@
|
||||||
#define B_CRASH_IF_TARGET_IMMUNE GEN_7 // In Gen4+, The user of Jump Kick or High Jump Kick will "keep going and crash" if it attacks a target that is immune to the move.
|
#define B_CRASH_IF_TARGET_IMMUNE GEN_7 // In Gen4+, The user of Jump Kick or High Jump Kick will "keep going and crash" if it attacks a target that is immune to the move.
|
||||||
#define B_MEMENTO_FAIL GEN_7 // In Gen4+, Memento fails if there is no target or if the target is protected or behind substitute. But not if Atk/Sp. Atk are at -6.
|
#define B_MEMENTO_FAIL GEN_7 // In Gen4+, Memento fails if there is no target or if the target is protected or behind substitute. But not if Atk/Sp. Atk are at -6.
|
||||||
#define B_GLARE_GHOST GEN_7 // In Gen4+, Glare can hit Ghost-type Pokémon normally.
|
#define B_GLARE_GHOST GEN_7 // In Gen4+, Glare can hit Ghost-type Pokémon normally.
|
||||||
|
#define B_SKILL_SWAP GEN_7 // In Gen4+, Skill Swap triggers switch-in abilities after use.
|
||||||
|
|
||||||
// Ability settings
|
// Ability settings
|
||||||
#define B_ABILITY_WEATHER GEN_7 // In Gen6+, ability-induced weather lasts 5 turns. Before, it lasted until the battle ended or until it was changed by a move or a different weather-affecting ability.
|
#define B_ABILITY_WEATHER GEN_7 // In Gen6+, ability-induced weather lasts 5 turns. Before, it lasted until the battle ended or until it was changed by a move or a different weather-affecting ability.
|
||||||
|
|
|
@ -1530,7 +1530,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||||
score -= 10;
|
score -= 10;
|
||||||
break;
|
break;
|
||||||
case EFFECT_RECYCLE:
|
case EFFECT_RECYCLE:
|
||||||
if (gBattleStruct->usedHeldItems[battlerAtk] == 0 || gBattleMons[battlerAtk].item != 0)
|
if (GetUsedHeldItem(battlerAtk) == 0 || gBattleMons[battlerAtk].item != 0)
|
||||||
score -= 10;
|
score -= 10;
|
||||||
break;
|
break;
|
||||||
case EFFECT_IMPRISON:
|
case EFFECT_IMPRISON:
|
||||||
|
@ -1951,7 +1951,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||||
score -= 10;
|
score -= 10;
|
||||||
break;
|
break;
|
||||||
case EFFECT_BELCH:
|
case EFFECT_BELCH:
|
||||||
if (ItemId_GetPocket(gBattleStruct->usedHeldItems[battlerAtk]) != POCKET_BERRIES)
|
if (ItemId_GetPocket(GetUsedHeldItem(battlerAtk)) != POCKET_BERRIES)
|
||||||
score -= 10; // attacker has not consumed a berry
|
score -= 10; // attacker has not consumed a berry
|
||||||
break;
|
break;
|
||||||
case EFFECT_YAWN:
|
case EFFECT_YAWN:
|
||||||
|
@ -4097,9 +4097,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||||
score += 3;
|
score += 3;
|
||||||
break;
|
break;
|
||||||
case EFFECT_RECYCLE:
|
case EFFECT_RECYCLE:
|
||||||
if (gBattleStruct->usedHeldItems[battlerAtk] != ITEM_NONE)
|
if (GetUsedHeldItem(battlerAtk) != ITEM_NONE)
|
||||||
score++;
|
score++;
|
||||||
if (IsRecycleEncouragedItem(gBattleStruct->usedHeldItems[battlerAtk]))
|
if (IsRecycleEncouragedItem(GetUsedHeldItem(battlerAtk)))
|
||||||
score++;
|
score++;
|
||||||
break;
|
break;
|
||||||
case EFFECT_BRICK_BREAK:
|
case EFFECT_BRICK_BREAK:
|
||||||
|
|
|
@ -2862,7 +2862,6 @@ static void BattleStartClearSetData(void)
|
||||||
gBattleResources->flags->flags[i] = 0;
|
gBattleResources->flags->flags[i] = 0;
|
||||||
gPalaceSelectionBattleScripts[i] = 0;
|
gPalaceSelectionBattleScripts[i] = 0;
|
||||||
gBattleStruct->lastTakenMove[i] = 0;
|
gBattleStruct->lastTakenMove[i] = 0;
|
||||||
gBattleStruct->usedHeldItems[i] = 0;
|
|
||||||
gBattleStruct->choicedMove[i] = 0;
|
gBattleStruct->choicedMove[i] = 0;
|
||||||
gBattleStruct->changedItems[i] = 0;
|
gBattleStruct->changedItems[i] = 0;
|
||||||
gBattleStruct->lastTakenMoveFrom[i][0] = 0;
|
gBattleStruct->lastTakenMoveFrom[i][0] = 0;
|
||||||
|
@ -2935,7 +2934,11 @@ static void BattleStartClearSetData(void)
|
||||||
gBattleStruct->mega.triggerSpriteId = 0xFF;
|
gBattleStruct->mega.triggerSpriteId = 0xFF;
|
||||||
|
|
||||||
for (i = 0; i < PARTY_SIZE; i++)
|
for (i = 0; i < PARTY_SIZE; i++)
|
||||||
|
{
|
||||||
|
gBattleStruct->usedHeldItems[i][0] = 0;
|
||||||
|
gBattleStruct->usedHeldItems[i][1] = 0;
|
||||||
gBattleStruct->itemStolen[i].originalItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
|
gBattleStruct->itemStolen[i].originalItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwitchInClearSetData(void)
|
void SwitchInClearSetData(void)
|
||||||
|
@ -3635,7 +3638,7 @@ void BattleTurnPassed(void)
|
||||||
gHitMarker &= ~(HITMARKER_NO_ATTACKSTRING);
|
gHitMarker &= ~(HITMARKER_NO_ATTACKSTRING);
|
||||||
gHitMarker &= ~(HITMARKER_UNABLE_TO_USE_MOVE);
|
gHitMarker &= ~(HITMARKER_UNABLE_TO_USE_MOVE);
|
||||||
gHitMarker &= ~(HITMARKER_x400000);
|
gHitMarker &= ~(HITMARKER_x400000);
|
||||||
gHitMarker &= ~(HITMARKER_x100000);
|
gHitMarker &= ~(HITMARKER_PASSIVE_DAMAGE);
|
||||||
gBattleScripting.animTurn = 0;
|
gBattleScripting.animTurn = 0;
|
||||||
gBattleScripting.animTargetsHit = 0;
|
gBattleScripting.animTargetsHit = 0;
|
||||||
gBattleScripting.moveendState = 0;
|
gBattleScripting.moveendState = 0;
|
||||||
|
@ -4772,7 +4775,7 @@ static void RunTurnActionsFunctions(void)
|
||||||
|
|
||||||
if (gCurrentTurnActionNumber >= gBattlersCount) // everyone did their actions, turn finished
|
if (gCurrentTurnActionNumber >= gBattlersCount) // everyone did their actions, turn finished
|
||||||
{
|
{
|
||||||
gHitMarker &= ~(HITMARKER_x100000);
|
gHitMarker &= ~(HITMARKER_PASSIVE_DAMAGE);
|
||||||
gBattleMainFunc = sEndTurnFuncsTable[gBattleOutcome & 0x7F];
|
gBattleMainFunc = sEndTurnFuncsTable[gBattleOutcome & 0x7F];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -2123,7 +2123,7 @@ static void Cmd_healthbarupdate(void)
|
||||||
if (gBattleControllerExecFlags)
|
if (gBattleControllerExecFlags)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
|
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) || (gHitMarker & HITMARKER_PASSIVE_DAMAGE))
|
||||||
{
|
{
|
||||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||||
|
|
||||||
|
@ -2160,7 +2160,7 @@ static void Cmd_datahpupdate(void)
|
||||||
else
|
else
|
||||||
moveType = gBattleMoves[gCurrentMove].type;
|
moveType = gBattleMoves[gCurrentMove].type;
|
||||||
|
|
||||||
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
|
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) || (gHitMarker & HITMARKER_PASSIVE_DAMAGE))
|
||||||
{
|
{
|
||||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||||
if (DoesSubstituteBlockMove(gBattlerAttacker, gActiveBattler, gCurrentMove) && gDisableStructs[gActiveBattler].substituteHP && !(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE))
|
if (DoesSubstituteBlockMove(gBattlerAttacker, gActiveBattler, gCurrentMove) && gDisableStructs[gActiveBattler].substituteHP && !(gHitMarker & HITMARKER_IGNORE_SUBSTITUTE))
|
||||||
|
@ -2206,9 +2206,9 @@ static void Cmd_datahpupdate(void)
|
||||||
}
|
}
|
||||||
else // hp goes down
|
else // hp goes down
|
||||||
{
|
{
|
||||||
if (gHitMarker & HITMARKER_x20)
|
if (gHitMarker & HITMARKER_SKIP_DMG_TRACK)
|
||||||
{
|
{
|
||||||
gHitMarker &= ~(HITMARKER_x20);
|
gHitMarker &= ~(HITMARKER_SKIP_DMG_TRACK);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2230,10 +2230,10 @@ static void Cmd_datahpupdate(void)
|
||||||
gBattleMons[gActiveBattler].hp = 0;
|
gBattleMons[gActiveBattler].hp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gSpecialStatuses[gActiveBattler].dmg && !(gHitMarker & HITMARKER_x100000))
|
if (!gSpecialStatuses[gActiveBattler].dmg && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE))
|
||||||
gSpecialStatuses[gActiveBattler].dmg = gHpDealt;
|
gSpecialStatuses[gActiveBattler].dmg = gHpDealt;
|
||||||
|
|
||||||
if (IS_MOVE_PHYSICAL(gCurrentMove) && !(gHitMarker & HITMARKER_x100000) && gCurrentMove != MOVE_PAIN_SPLIT)
|
if (IS_MOVE_PHYSICAL(gCurrentMove) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE) && gCurrentMove != MOVE_PAIN_SPLIT)
|
||||||
{
|
{
|
||||||
gProtectStructs[gActiveBattler].physicalDmg = gHpDealt;
|
gProtectStructs[gActiveBattler].physicalDmg = gHpDealt;
|
||||||
gSpecialStatuses[gActiveBattler].physicalDmg = gHpDealt;
|
gSpecialStatuses[gActiveBattler].physicalDmg = gHpDealt;
|
||||||
|
@ -2248,7 +2248,7 @@ static void Cmd_datahpupdate(void)
|
||||||
gSpecialStatuses[gActiveBattler].physicalBattlerId = gBattlerTarget;
|
gSpecialStatuses[gActiveBattler].physicalBattlerId = gBattlerTarget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!IS_MOVE_PHYSICAL(gCurrentMove) && !(gHitMarker & HITMARKER_x100000))
|
else if (!IS_MOVE_PHYSICAL(gCurrentMove) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE))
|
||||||
{
|
{
|
||||||
gProtectStructs[gActiveBattler].specialDmg = gHpDealt;
|
gProtectStructs[gActiveBattler].specialDmg = gHpDealt;
|
||||||
gSpecialStatuses[gActiveBattler].specialDmg = gHpDealt;
|
gSpecialStatuses[gActiveBattler].specialDmg = gHpDealt;
|
||||||
|
@ -2264,7 +2264,7 @@ static void Cmd_datahpupdate(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gHitMarker &= ~(HITMARKER_x100000);
|
gHitMarker &= ~(HITMARKER_PASSIVE_DAMAGE);
|
||||||
BtlController_EmitSetMonData(0, REQUEST_HP_BATTLE, 0, 2, &gBattleMons[gActiveBattler].hp);
|
BtlController_EmitSetMonData(0, REQUEST_HP_BATTLE, 0, 2, &gBattleMons[gActiveBattler].hp);
|
||||||
MarkBattlerForControllerExec(gActiveBattler);
|
MarkBattlerForControllerExec(gActiveBattler);
|
||||||
}
|
}
|
||||||
|
@ -6796,10 +6796,10 @@ static void Cmd_removeitem(void)
|
||||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||||
itemId = gBattleMons[gActiveBattler].item;
|
itemId = gBattleMons[gActiveBattler].item;
|
||||||
|
|
||||||
// Popped Air Balloon cannot be restored by no means.
|
// Popped Air Balloon cannot be restored by any means.
|
||||||
if (GetBattlerHoldEffect(gActiveBattler, TRUE) != HOLD_EFFECT_AIR_BALLOON)
|
if (GetBattlerHoldEffect(gActiveBattler, TRUE) != HOLD_EFFECT_AIR_BALLOON)
|
||||||
gBattleStruct->usedHeldItems[gActiveBattler] = itemId;
|
gBattleStruct->usedHeldItems[gBattlerPartyIndexes[gActiveBattler]][GetBattlerSide(gActiveBattler)] = itemId; // Remember if switched out
|
||||||
|
|
||||||
gBattleMons[gActiveBattler].item = 0;
|
gBattleMons[gActiveBattler].item = 0;
|
||||||
CheckSetUnburden(gActiveBattler);
|
CheckSetUnburden(gActiveBattler);
|
||||||
|
|
||||||
|
@ -12550,7 +12550,7 @@ static void Cmd_tryrecycleitem(void)
|
||||||
u16 *usedHeldItem;
|
u16 *usedHeldItem;
|
||||||
|
|
||||||
gActiveBattler = gBattlerAttacker;
|
gActiveBattler = gBattlerAttacker;
|
||||||
usedHeldItem = &gBattleStruct->usedHeldItems[gActiveBattler];
|
usedHeldItem = &gBattleStruct->usedHeldItems[gBattlerPartyIndexes[gActiveBattler]][GetBattlerSide(gActiveBattler)];
|
||||||
if (*usedHeldItem != 0 && gBattleMons[gActiveBattler].item == 0)
|
if (*usedHeldItem != 0 && gBattleMons[gActiveBattler].item == 0)
|
||||||
{
|
{
|
||||||
gLastUsedItem = *usedHeldItem;
|
gLastUsedItem = *usedHeldItem;
|
||||||
|
|
|
@ -864,7 +864,7 @@ void HandleAction_NothingIsFainted(void)
|
||||||
gCurrentTurnActionNumber++;
|
gCurrentTurnActionNumber++;
|
||||||
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
|
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
|
||||||
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
|
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
|
||||||
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_x100000
|
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_PASSIVE_DAMAGE
|
||||||
| HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT
|
| HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT
|
||||||
| HITMARKER_CHARGING | HITMARKER_x4000000);
|
| HITMARKER_CHARGING | HITMARKER_x4000000);
|
||||||
}
|
}
|
||||||
|
@ -876,7 +876,7 @@ void HandleAction_ActionFinished(void)
|
||||||
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
|
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
|
||||||
SpecialStatusesClear();
|
SpecialStatusesClear();
|
||||||
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
|
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
|
||||||
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_x100000
|
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_PASSIVE_DAMAGE
|
||||||
| HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT
|
| HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT
|
||||||
| HITMARKER_CHARGING | HITMARKER_x4000000 | HITMARKER_IGNORE_DISGUISE);
|
| HITMARKER_CHARGING | HITMARKER_x4000000 | HITMARKER_IGNORE_DISGUISE);
|
||||||
|
|
||||||
|
@ -2414,7 +2414,7 @@ u8 DoBattlerEndTurnEffects(void)
|
||||||
{
|
{
|
||||||
u32 ability, i, effect = 0;
|
u32 ability, i, effect = 0;
|
||||||
|
|
||||||
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_x20);
|
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||||
while (gBattleStruct->turnEffectsBattlerId < gBattlersCount && gBattleStruct->turnEffectsTracker <= ENDTURN_BATTLER_COUNT)
|
while (gBattleStruct->turnEffectsBattlerId < gBattlersCount && gBattleStruct->turnEffectsTracker <= ENDTURN_BATTLER_COUNT)
|
||||||
{
|
{
|
||||||
gActiveBattler = gBattlerAttacker = gBattlerByTurnOrder[gBattleStruct->turnEffectsBattlerId];
|
gActiveBattler = gBattlerAttacker = gBattlerByTurnOrder[gBattleStruct->turnEffectsBattlerId];
|
||||||
|
@ -2908,13 +2908,13 @@ u8 DoBattlerEndTurnEffects(void)
|
||||||
return effect;
|
return effect;
|
||||||
|
|
||||||
}
|
}
|
||||||
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_x20);
|
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8 HandleWishPerishSongOnTurnEnd(void)
|
bool8 HandleWishPerishSongOnTurnEnd(void)
|
||||||
{
|
{
|
||||||
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_x20);
|
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||||
|
|
||||||
switch (gBattleStruct->wishPerishSongState)
|
switch (gBattleStruct->wishPerishSongState)
|
||||||
{
|
{
|
||||||
|
@ -3011,7 +3011,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_x20);
|
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -4373,11 +4373,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
||||||
case ABILITY_HARVEST:
|
case ABILITY_HARVEST:
|
||||||
if (((WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) || Random() % 2 == 0)
|
if (((WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) || Random() % 2 == 0)
|
||||||
&& gBattleMons[battler].item == ITEM_NONE
|
&& gBattleMons[battler].item == ITEM_NONE
|
||||||
&& gBattleStruct->changedItems[battler] == ITEM_NONE
|
&& gBattleStruct->changedItems[battler] == ITEM_NONE // Will not inherit an item
|
||||||
&& ItemId_GetPocket(gBattleStruct->usedHeldItems[battler]) == POCKET_BERRIES)
|
&& ItemId_GetPocket(GetUsedHeldItem(battler)) == POCKET_BERRIES)
|
||||||
{
|
{
|
||||||
gLastUsedItem = gBattleStruct->changedItems[battler] = gBattleStruct->usedHeldItems[battler];
|
|
||||||
gBattleStruct->usedHeldItems[battler] = ITEM_NONE;
|
|
||||||
BattleScriptPushCursorAndCallback(BattleScript_HarvestActivates);
|
BattleScriptPushCursorAndCallback(BattleScript_HarvestActivates);
|
||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
|
@ -9553,3 +9551,8 @@ bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 chec
|
||||||
#endif
|
#endif
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u16 GetUsedHeldItem(u8 battler)
|
||||||
|
{
|
||||||
|
return gBattleStruct->usedHeldItems[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)];
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue