Skip to content

Commit

Permalink
Merge pull request #302 from BuffelSaft/bugs
Browse files Browse the repository at this point in the history
Fix Bugs
  • Loading branch information
BuffelSaft authored Nov 17, 2021
2 parents 200f042 + 7d37f1a commit c50dd60
Show file tree
Hide file tree
Showing 50 changed files with 1,060 additions and 480 deletions.
34 changes: 34 additions & 0 deletions asm/macros/battle_script.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1881,11 +1881,45 @@
.2byte \species
.4byte \ptr
.endm
.macro tryendneutralizinggas battler:req
various \battler, VARIOUS_TRY_END_NEUTRALIZING_GAS
.endm

.macro trytoapplymimicry battler:req, ptr:req
various \battler, VARIOUS_TRY_TO_APPLY_MIMICRY
.4byte \ptr
.endm
.macro trynoretreat battler:req, ptr:req
various \battler, VARIOUS_TRY_NO_RETREAT
.4byte \ptr
.endm

.macro trytarshot battler:req, ptr:req
various \battler, VARIOUS_TRY_TAR_SHOT
.4byte \ptr
.endm

.macro cantarshotwork battler:req, ptr:req
various \battler, VARIOUS_CAN_TAR_SHOT_WORK
.4byte \ptr
.endm

.macro checkpoltergeist battler:req, ptr:req
various \battler, VARIOUS_CHECK_POLTERGEIST
.4byte \ptr
.endm

.macro setoctolock battler:req, ptr:req
various \battler, VARIOUS_SET_OCTOLOCK
.4byte \ptr
.endm

.macro cutonethirdhpraisestats ptr:req
various BS_ATTACKER, VARIOUS_CUT_1_3_HP_RAISE_STATS
.4byte \ptr
.endm

.macro photongeysercheck
various BS_ATTACKER, VARIOUS_PHOTON_GEYSER_CHECK
Expand Down
23 changes: 17 additions & 6 deletions data/battle_anim_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -2510,20 +2510,30 @@ Move_GIGA_IMPACT:
loadspritegfx ANIM_TAG_IMPACT
monbg ANIM_DEF_PARTNER
setalpha 12, 8
createvisualtask AnimTask_IsContest, 2
jumprettrue SetGigaImpactContestsBG
createvisualtask AnimTask_IsTargetPlayerSide, 2
jumpretfalse SetGigaImpactOpponentBG
goto SetGigaImpactPlayerBG
SetGigaImpactOpponentBG:
fadetobg BG_GIGA_IMPACT_OPPONENT
goto GigaImpactContinuity
SetGigaImpactPlayerBG:
fadetobg BG_GIGA_IMPACT_PLAYER
goto GigaImpactContinuity
SetGigaImpactContestsBG:
fadetobg BG_GIGA_IMPACT_CONTEST
goto GigaImpactContinuity
GigaImpactContinuity:
playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER
createsprite gVerticalDipSpriteTemplate, ANIM_ATTACKER, 2, 6, 1, ANIM_ATTACKER
waitforvisualfinish
delay 11
createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0, 26, 0, 0, 5
delay 6
@monbg ANIM_DEF_PARTNER
@setalpha 12, 8
@createvisualtask AnimTask_WindUpLunge, 5, 7, 0, -18, 8, 23, 10, 40, 10
@delay 35
createsprite gComplexPaletteBlendSpriteTemplate, 2, 7, 31, 3, 1, 0, 10, 0, 0
waitbgfadeout
createsprite gBasicHitSplatSpriteTemplate, 4, 4, -10, 0, 1, 0
playsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET
call SetImpactBackground
delay 1
createsprite gSlideMonToOffsetSpriteTemplate 2, 5, 1, -16, 0, 0, 4
waitforvisualfinish
Expand All @@ -2538,6 +2548,7 @@ Move_GIGA_IMPACT:
blendoff
restorebg
waitbgfadein
waitforvisualfinish
end

Move_NASTY_PLOT:
Expand Down
150 changes: 144 additions & 6 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,13 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectPhotonGeyser @ EFFECT_PHOTON_GEYSER
.4byte BattleScript_EffectShellSideArm @ EFFECT_SHELL_SIDE_ARM
.4byte BattleScript_EffectHit @ EFFECT_TERRAIN_PULSE
.4byte BattleScript_EffectJawLock @ EFFECT_JAW_LOCK
.4byte BattleScript_EffectNoRetreat @ EFFECT_NO_RETREAT
.4byte BattleScript_EffectTarShot @ EFFECT_TAR_SHOT
.4byte BattleScript_EffectPoltergeist @ EFFECT_POLTERGEIST
.4byte BattleScript_EffectOctolock @ EFFECT_OCTOLOCK
.4byte BattleScript_EffectClangorousSoul @ EFFECT_CLANGOROUS_SOUL
.4byte BattleScript_EffectHit @ EFFECT_BOLT_BEAK

BattleScript_EffectShellSideArm:
shellsidearmcheck
Expand Down Expand Up @@ -433,6 +440,113 @@ BattleScript_EffectAuraWheel: @ Aura Wheel can only be used by Morpeko
waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd

BattleScript_EffectClangorousSoul:
attackcanceler
attackstring
ppreduce
cutonethirdhpraisestats BattleScript_ButItFailed
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_SKIP_DMG_TRACK | HITMARKER_PASSIVE_DAMAGE | HITMARKER_IGNORE_DISGUISE
attackanimation
waitanimation
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
call BattleScript_AllStatsUp
goto BattleScript_MoveEnd

BattleScript_EffectOctolock:
attackcanceler
jumpifsubstituteblocks BattleScript_ButItFailedAtkStringPpReduce
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
setoctolock BS_TARGET, BattleScript_ButItFailed
attackanimation
waitanimation
printstring STRINGID_CANTESCAPEBECAUSEOFCURRENTMOVE
waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd

BattleScript_OctolockEndTurn::
setbyte sSTAT_ANIM_PLAYED, FALSE
jumpifstat BS_TARGET, CMP_GREATER_THAN, STAT_DEF, MIN_STAT_STAGE, BattleScript_OctolockLowerDef
jumpifstat BS_TARGET, CMP_GREATER_THAN, STAT_SPDEF, MIN_STAT_STAGE, BattleScript_OctolockTryLowerSpDef
goto BattleScript_OctolockEnd2
BattleScript_OctolockLowerDef:
jumpifability BS_TARGET, ABILITY_BIG_PECKS, BattleScript_OctolockTryLowerSpDef
playstatchangeanimation BS_ATTACKER, BIT_DEF | BIT_SPDEF, STAT_CHANGE_NEGATIVE
setbyte sSTAT_ANIM_PLAYED, TRUE
setstatchanger STAT_DEF, 1, TRUE
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_OctolockTryLowerSpDef
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_OctolockTryLowerSpDef
printfromtable gStatUpStringIds
waitmessage B_WAIT_TIME_LONG
BattleScript_OctolockTryLowerSpDef:
jumpifbyte CMP_EQUAL, sSTAT_ANIM_PLAYED, TRUE, BattleScript_OctolockSkipSpDefAnim
playstatchangeanimation BS_ATTACKER, BIT_SPDEF, STAT_CHANGE_NEGATIVE
BattleScript_OctolockSkipSpDefAnim:
setstatchanger STAT_SPDEF, 1, TRUE
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_OctolockEnd2
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_OctolockEnd2
printfromtable gStatUpStringIds
waitmessage B_WAIT_TIME_LONG
BattleScript_OctolockEnd2::
end2

BattleScript_EffectPoltergeist:
attackcanceler
attackstring
ppreduce
checkpoltergeist BS_TARGET, BattleScript_ButItFailed
printstring STRINGID_ABOUTTOUSEPOLTERGEIST
waitmessage B_WAIT_TIME_LONG
goto BattleScript_HitFromCritCalc

BattleScript_EffectTarShot:
attackcanceler
jumpifsubstituteblocks BattleScript_ButItFailedAtkStringPpReduce
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
cantarshotwork BS_TARGET, BattleScript_ButItFailedAtkStringPpReduce
attackstring
ppreduce
setstatchanger STAT_SPEED, 1, TRUE
attackanimation
waitanimation
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_TryTarShot
setgraphicalstatchangevalues
playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
printfromtable gStatDownStringIds
waitmessage B_WAIT_TIME_LONG
BattleScript_TryTarShot:
trytarshot BS_TARGET, BattleScript_MoveEnd
printstring STRINGID_PKMNBECAMEWEAKERTOFIRE
waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd

BattleScript_EffectNoRetreat:
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
trynoretreat BS_TARGET, BattleScript_ButItFailed
attackanimation
waitanimation
call BattleScript_AllStatsUp
jumpifstatus2 BS_TARGET, STATUS2_ESCAPE_PREVENTION, BattleScript_MoveEnd
setmoveeffect MOVE_EFFECT_PREVENT_ESCAPE
seteffectprimary
printstring STRINGID_CANTESCAPEDUETOUSEDMOVE
waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd

BattleScript_EffectJawLock:
setmoveeffect MOVE_EFFECT_TRAP_BOTH | MOVE_EFFECT_CERTAIN
goto BattleScript_EffectHit

BattleScript_BothCanNoLongerEscape::
printstring STRINGID_BOTHCANNOLONGERESCAPE
waitmessage B_WAIT_TIME_LONG
return

BattleScript_EffectHyperspaceFury:
jumpifspecies BS_ATTACKER, SPECIES_HOOPA_UNBOUND, BattleScript_EffectHyperspaceFuryUnbound
jumpifspecies BS_ATTACKER, SPECIES_HOOPA, BattleScript_ButHoopaCantUseIt
Expand Down Expand Up @@ -1775,7 +1889,7 @@ BattleScript_EffectSoak:
attackanimation
waitanimation
trysoak BattleScript_ButItFailed
printstring STRINGID_TRANSFORMEDINTOWATERTYPE
printstring STRINGID_TARGETCHANGEDTYPE
waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd

Expand Down Expand Up @@ -2080,6 +2194,7 @@ BattleScript_EffectSimpleBeam:
trytoclearprimalweather
printstring STRINGID_EMPTYSTRING3
waitmessage 1
tryendneutralizinggas BS_TARGET
goto BattleScript_MoveEnd

BattleScript_EffectSuckerPunch:
Expand Down Expand Up @@ -2302,6 +2417,7 @@ BattleScript_EffectGastroAcid:
trytoclearprimalweather
printstring STRINGID_EMPTYSTRING3
waitmessage 1
tryendneutralizinggas BS_TARGET
goto BattleScript_MoveEnd

BattleScript_EffectToxicSpikes:
Expand Down Expand Up @@ -6331,7 +6447,7 @@ BattleScript_AttackerItemStatRaise::
playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
waitanimation
printstring STRINGID_USINGITEMSTATOFPKMNROSE
waitmessage 0x40
waitmessage B_WAIT_TIME_LONG
removeitem BS_ATTACKER
BattleScript_AttackerItemStatRaiseRet:
return
Expand Down Expand Up @@ -8227,6 +8343,12 @@ BattleScript_SwitchInAbilityMsg::
waitmessage B_WAIT_TIME_LONG
end3

BattleScript_SwitchInAbilityMsgRet::
call BattleScript_AbilityPopUp
printfromtable gSwitchInAbilityStringIds
waitmessage B_WAIT_TIME_LONG
return

BattleScript_ActivateAsOne::
call BattleScript_AbilityPopUp
printfromtable gSwitchInAbilityStringIds
Expand Down Expand Up @@ -8992,7 +9114,7 @@ BattleScript_StickyBarbTransfer::
BattleScript_RedCardActivates::
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_REDCARDACTIVATE
waitmessage 0x40
waitmessage B_WAIT_TIME_LONG
swapattackerwithtarget
jumpifstatus3 BS_EFFECT_BATTLER, STATUS3_ROOTED, BattleScript_RedCardIngrain
jumpifability BS_EFFECT_BATTLER, ABILITY_SUCTION_CUPS, BattleScript_RedCardSuctionCups
Expand All @@ -9003,13 +9125,13 @@ BattleScript_RedCardEnd:
return
BattleScript_RedCardIngrain:
printstring STRINGID_PKMNANCHOREDITSELF
waitmessage 0x40
waitmessage B_WAIT_TIME_LONG
removeitem BS_SCRIPTING
swapattackerwithtarget
return
BattleScript_RedCardSuctionCups:
printstring STRINGID_PKMNANCHORSITSELFWITH
waitmessage 0x40
waitmessage B_WAIT_TIME_LONG
removeitem BS_SCRIPTING
swapattackerwithtarget
return
Expand All @@ -9018,7 +9140,7 @@ BattleScript_EjectButtonActivates::
makevisible BS_ATTACKER
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, NULL
printstring STRINGID_EJECTBUTTONACTIVATE
waitmessage 0x40
waitmessage B_WAIT_TIME_LONG
removeitem BS_SCRIPTING
makeinvisible BS_SCRIPTING
openpartyscreen BS_SCRIPTING, BattleScript_EjectButtonEnd
Expand Down Expand Up @@ -9082,3 +9204,19 @@ BattleScript_PastelVeilLoopIncrement:
goto BattleScript_PastelVeilEnd
BattleScript_PastelVeilEnd:
end3

sByteFour:
.byte MAX_BATTLERS_COUNT

BattleScript_NeutralizingGasExits::
savetarget
pause B_WAIT_TIME_SHORT
printstring STRINGID_NEUTRALIZINGGASOVER
waitmessage B_WAIT_TIME_LONG
setbyte gBattlerTarget, 0
BattleScript_NeutralizingGasExitsLoop:
switchinabilities BS_TARGET
addbyte gBattlerTarget, 1
jumpifbytenotequal gBattlerTarget, sByteFour, BattleScript_NeutralizingGasExitsLoop @ SOMEHOW, comparing to gBattlersCount is problematic.

This comment has been minimized.

Copy link
@kleeenexfeu

kleeenexfeu Nov 19, 2021

This might present a problem, because gBattlersCount should be 2 in 1 V 1, and 4 in 2 V 2, here it'll always be 4. This might lead to read/write unwanted data in the RAM, because of the reason mentionned, but also because the whole battle structure might change depending on how many battlers can be on the field at the same time.
Unless you made 2 battlescripts for neutralizing gaz : one for double, one for simple, in which case you can ignore this comment :p

restoretarget
return
19 changes: 0 additions & 19 deletions graphics/battle_anims/backgrounds/giga_impact.pal

This file was deleted.

19 changes: 19 additions & 0 deletions graphics/battle_anims/backgrounds/new/giga_impact.pal
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
240 136 184
232 104 168
136 8 40
248 24 104
216 32 96
224 72 136
160 0 48
216 0 64
200 40 88
192 0 56
176 32 128
176 24 72
152 16 56
200 48 80
216 56 160
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions graphics/battle_anims/backgrounds/new/giga_impact_contest.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
�$�$�$�$�$�$�$�$�$� � � � � � � � � � � � � � � � D!E!F!G!H!I!@!�$�$�$�$�$�$�$�$�$� � � � � � � � � � � � � � � � � � � � � � � �$�$�$�$�$�$�$�$�$� � � � � � � � � � � � � � � �
! ! !!!!!�$�$�$�$�$�$�$�$�$� � � � � � � � � � � � � � � � !!!!!!!�$�$�$�$�$�$�$�$�$� � � � � � � � � � � � � � � � *!+!,!-!.!/!"!�$�$�$�$�$�$�$�$�$� � � � � � � � � � � � � � � � :!;!<!=!>!?!2!�$�$�$�$�$�$�$�$�$� � � � � � � � � � � � � � � � J!K!L!M!N!O!B!�,�,�,�,�,�,�,�,�,�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(J)K)L)M)N)O)B)�,�,�,�,�,�,�,�,�,�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(:);)<)=)>)?)2)�,�,�,�,�,�,�,�,�,�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(*)+),)-).)/)")�,�,�,�,�,�,�,�,�,�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�()))))))�,�,�,�,�,�,�,�,�,�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(
) ) )))))�,�,�,�,�,�,�,�,�,�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�,�,�,�,�,�,�,�,�,�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(D)E)F)G)H)I)@)
Expand Down
Binary file modified graphics/battle_anims/backgrounds/new/giga_impact_opponent.bin
Binary file not shown.
19 changes: 0 additions & 19 deletions graphics/battle_anims/backgrounds/new/giga_impact_opponent.pal

This file was deleted.

Binary file not shown.
Binary file modified graphics/battle_anims/backgrounds/new/giga_impact_player.bin
Binary file not shown.
Loading

0 comments on commit c50dd60

Please sign in to comment.