Skip to content

Commit

Permalink
Fix Scale Shot bug and use Canceller Multihit Moves (#3290)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexOn1ine authored Sep 10, 2023
1 parent 49e791f commit 18577ce
Show file tree
Hide file tree
Showing 6 changed files with 471 additions and 348 deletions.
58 changes: 1 addition & 57 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectPresent @ EFFECT_PRESENT
.4byte BattleScript_EffectHit @ EFFECT_FRUSTRATION
.4byte BattleScript_EffectSafeguard @ EFFECT_SAFEGUARD
.4byte BattleScript_EffectHit @ EFFECT_UNUSED_125
.4byte BattleScript_EffectMagnitude @ EFFECT_MAGNITUDE
.4byte BattleScript_EffectBatonPass @ EFFECT_BATON_PASS
.4byte BattleScript_EffectHit @ EFFECT_PURSUIT
Expand Down Expand Up @@ -406,7 +405,6 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectHit @ EFFECT_BOLT_BEAK
.4byte BattleScript_EffectSkyDrop @ EFFECT_SKY_DROP
.4byte BattleScript_EffectHit @ EFFECT_EXPANDING_FORCE
.4byte BattleScript_EffectScaleShot @ EFFECT_SCALE_SHOT
.4byte BattleScript_EffectMeteorBeam @ EFFECT_METEOR_BEAM
.4byte BattleScript_EffectHit @ EFFECT_RISING_VOLTAGE
.4byte BattleScript_EffectHit @ EFFECT_BEAK_BLAST
Expand Down Expand Up @@ -723,60 +721,6 @@ BattleScript_FirstChargingTurnMeteorBeam::
seteffectsecondary
return

BattleScript_EffectScaleShot::
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring
ppreduce
setmultihitcounter 0x0
initmultihitstring
sethword sMULTIHIT_EFFECT, 0x0
BattleScript_ScaleShotLoop::
jumpifhasnohp BS_ATTACKER, BattleScript_ScaleShotEnd
jumpifhasnohp BS_TARGET, BattleScript_ScaleShotPrintStrings
jumpifhalfword CMP_EQUAL, gChosenMove, MOVE_SLEEP_TALK, BattleScript_ScaleShotDoMultiHit
jumpifstatus BS_ATTACKER, STATUS1_SLEEP, BattleScript_ScaleShotPrintStrings
BattleScript_ScaleShotDoMultiHit::
movevaluescleanup
copyhword sMOVE_EFFECT, sMULTIHIT_EFFECT
critcalc
damagecalc
jumpifmovehadnoeffect BattleScript_ScaleShotMultiHitNoMoreHits
adjustdamage
attackanimation
waitanimation
effectivenesssound
hitanimation BS_TARGET
waitstate
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
critmessage
waitmessage B_WAIT_TIME_LONG
multihitresultmessage
printstring STRINGID_EMPTYSTRING3
waitmessage 1
addbyte sMULTIHIT_STRING + 4, 0x1
moveendto MOVEEND_NEXT_TARGET
jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_ScaleShotPrintStrings
decrementmultihit BattleScript_ScaleShotLoop
goto BattleScript_ScaleShotPrintStrings
BattleScript_ScaleShotMultiHitNoMoreHits::
pause B_WAIT_TIME_SHORT
BattleScript_ScaleShotPrintStrings::
resultmessage
waitmessage B_WAIT_TIME_LONG
jumpifmovehadnoeffect BattleScript_ScaleShotEnd
copyarray gBattleTextBuff1, sMULTIHIT_STRING, 0x6
printstring STRINGID_HITXTIMES
waitmessage B_WAIT_TIME_LONG
BattleScript_ScaleShotEnd::
setmoveeffect MOVE_EFFECT_SCALE_SHOT | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN
seteffectwithchance
tryfaintmon BS_TARGET
moveendcase MOVEEND_SYNCHRONIZE_TARGET
moveendfrom MOVEEND_STATUS_IMMUNITY_ABILITIES
end

BattleScript_EffectSkyDrop:
jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_SkyDropTurn2
attackcanceler
Expand Down Expand Up @@ -881,7 +825,7 @@ BattleScript_FlingEnd:
tryfaintmon BS_TARGET
trysymbiosis
goto BattleScript_MoveEnd

BattleScript_FlingFailConsumeItem::
removeitem BS_ATTACKER
goto BattleScript_FailedFromAtkString
Expand Down
Loading

0 comments on commit 18577ce

Please sign in to comment.