Fixed SetMoveEffect + Sheer Force

This commit is contained in:
Nephrite 2024-01-02 05:51:40 +09:00
parent 0980253cce
commit daeba066e0
4 changed files with 23 additions and 24 deletions

View file

@ -112,7 +112,10 @@
.byte 0x17
.endm
.macro clearstatusfromeffect battler:req
.macro clearstatusfromeffect battler:req, moveEffect=0
.if \moveEffect != 0
setmoveeffect \moveEffect
.endif
.byte 0x18
.byte \battler
.endm

View file

@ -938,7 +938,7 @@ BattleScript_FirstChargingTurnMeteorBeam::
copybyte cMULTISTRING_CHOOSER, sTWOTURN_STRINGID
printfromtable gFirstTurnOfTwoStringIds
waitmessage B_WAIT_TIME_LONG
seteffectsecondary MOVE_EFFECT_SP_ATK_PLUS_1 | MOVE_EFFECT_AFFECTS_USER
seteffectprimary MOVE_EFFECT_SP_ATK_PLUS_1 | MOVE_EFFECT_AFFECTS_USER
return
BattleScript_EffectSkyDrop:
@ -963,9 +963,8 @@ BattleScript_SkyDropWork:
goto BattleScript_MoveEnd
BattleScript_SkyDropTurn2:
attackcanceler
setmoveeffect MOVE_EFFECT_CHARGING
setbyte sB_ANIM_TURN, 0x1
clearstatusfromeffect BS_ATTACKER
clearstatusfromeffect BS_ATTACKER, MOVE_EFFECT_CHARGING
orword gHitMarker, HITMARKER_NO_PPDEDUCT
clearsemiinvulnerablebit
attackstring
@ -991,8 +990,7 @@ BattleScript_SkyDropChangedTarget:
BattleScript_SkyDropFlyingConfuseLock:
seteffectprimary MOVE_EFFECT_CONFUSION
BattleScript_SkyDropFlyingAlreadyConfused:
setmoveeffect MOVE_EFFECT_THRASH
clearstatusfromeffect BS_TARGET
clearstatusfromeffect BS_TARGET, MOVE_EFFECT_THRASH
jumpifstatus2 BS_TARGET, STATUS2_CONFUSION, BattleScript_MoveEnd
setbyte BS_ATTACKER, BS_TARGET
goto BattleScript_ThrashConfuses
@ -3797,9 +3795,8 @@ BattleScript_KOFail::
BattleScript_TwoTurnMovesSecondTurn::
attackcanceler
setmoveeffect MOVE_EFFECT_CHARGING
setbyte sB_ANIM_TURN, 1
clearstatusfromeffect BS_ATTACKER
clearstatusfromeffect BS_ATTACKER, MOVE_EFFECT_CHARGING
orword gHitMarker, HITMARKER_NO_PPDEDUCT
goto BattleScript_HitFromAccCheck
@ -4127,9 +4124,8 @@ BattleScript_EffectGeomancy:
call BattleScript_PowerHerbActivation
BattleScript_GeomancySecondTurn:
attackcanceler
setmoveeffect MOVE_EFFECT_CHARGING
setbyte sB_ANIM_TURN, 1
clearstatusfromeffect BS_ATTACKER
clearstatusfromeffect BS_ATTACKER, MOVE_EFFECT_CHARGING
orword gHitMarker, HITMARKER_NO_PPDEDUCT
attackstring
jumpifstat BS_ATTACKER, CMP_LESS_THAN, STAT_SPATK, MAX_STAT_STAGE, BattleScript_GeomancyDoMoveAnim
@ -4197,8 +4193,7 @@ BattleScript_EffectRage::
seteffectprimary MOVE_EFFECT_RAGE
goto BattleScript_HitFromAtkString
BattleScript_RageMiss::
setmoveeffect MOVE_EFFECT_RAGE
clearstatusfromeffect BS_ATTACKER
clearstatusfromeffect BS_ATTACKER, MOVE_EFFECT_RAGE
goto BattleScript_PrintMoveMissed
BattleScript_EffectMimic::
@ -5108,9 +5103,8 @@ BattleScript_FirstTurnSemiInvulnerable::
call BattleScript_PowerHerbActivation
BattleScript_SecondTurnSemiInvulnerable::
attackcanceler
setmoveeffect MOVE_EFFECT_CHARGING
setbyte sB_ANIM_TURN, 1
clearstatusfromeffect BS_ATTACKER
clearstatusfromeffect BS_ATTACKER, MOVE_EFFECT_CHARGING
orword gHitMarker, HITMARKER_NO_PPDEDUCT
BattleScript_SemiInvulnerableTryHit::
accuracycheck BattleScript_SemiInvulnerableMiss, ACC_CURR_MOVE
@ -5739,7 +5733,6 @@ BattleScript_EffectTeeterDance::
setbyte gBattlerTarget, 0
BattleScript_TeeterDanceLoop::
movevaluescleanup
setmoveeffect MOVE_EFFECT_CONFUSION
jumpifbyteequal gBattlerAttacker, gBattlerTarget, BattleScript_TeeterDanceLoopIncrement
jumpifability BS_TARGET, ABILITY_OWN_TEMPO, BattleScript_TeeterDanceOwnTempoPrevents
jumpifsubstituteblocks BattleScript_TeeterDanceSubstitutePrevents
@ -5749,7 +5742,7 @@ BattleScript_TeeterDanceLoop::
jumpifsafeguard BattleScript_TeeterDanceSafeguardProtected
attackanimation
waitanimation
seteffectprimary
seteffectprimary MOVE_EFFECT_CONFUSION
resultmessage
waitmessage B_WAIT_TIME_LONG
BattleScript_TeeterDanceDoMoveEndIncrement::
@ -6573,8 +6566,7 @@ BattleScript_BideStoringEnergy::
BattleScript_BideAttack::
attackcanceler
setmoveeffect MOVE_EFFECT_CHARGING
clearstatusfromeffect BS_ATTACKER
clearstatusfromeffect BS_ATTACKER, MOVE_EFFECT_CHARGING
printstring STRINGID_PKMNUNLEASHEDENERGY
waitmessage B_WAIT_TIME_LONG
accuracycheck BattleScript_MoveMissed, ACC_CURR_MOVE
@ -6597,8 +6589,7 @@ BattleScript_BideAttack::
BattleScript_BideNoEnergyToAttack::
attackcanceler
setmoveeffect MOVE_EFFECT_CHARGING
clearstatusfromeffect BS_ATTACKER
clearstatusfromeffect BS_ATTACKER, MOVE_EFFECT_CHARGING
printstring STRINGID_PKMNUNLEASHEDENERGY
waitmessage B_WAIT_TIME_LONG
goto BattleScript_ButItFailed

View file

@ -2820,7 +2820,7 @@ void SetMoveEffect(bool32 primary, bool32 certain)
&& !primary && gBattleScripting.moveEffect <= MOVE_EFFECT_CONFUSION)
INCREMENT_RESET_RETURN
if (TestSheerForceFlag(gBattlerAttacker, gCurrentMove) && gBattleScripting.moveEffect != MOVE_EFFECT_CHARGING)
if (TestSheerForceFlag(gBattlerAttacker, gCurrentMove) && !primary && gBattleScripting.moveEffect != MOVE_EFFECT_CHARGING)
INCREMENT_RESET_RETURN
if (gBattleMons[gEffectBattler].hp == 0 && !activateAfterFaint)

View file

@ -20,8 +20,12 @@ SINGLE_BATTLE_TEST("Sheer Force boosts power, but removes secondary effects of m
PLAYER(SPECIES_TAUROS) { Ability(ability); Status1(move == MOVE_SNORE ? STATUS1_SLEEP : STATUS1_NONE); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, move); }
if (gBattleMoves[move].effect == EFFECT_TWO_TURNS_ATTACK || gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE) {
if (move == MOVE_ALLURING_VOICE) // Alluring Voice requires the target to boost stats to have an effect
TURN { MOVE(opponent, MOVE_AGILITY); MOVE(player, move); }
else
TURN { MOVE(player, move); }
if (gBattleMoves[move].effect == EFFECT_TWO_TURNS_ATTACK || gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE
|| gBattleMoves[move].effect == EFFECT_METEOR_BEAM) {
TURN { SKIP_TURN(player); }
TURN { ; }
}
@ -31,7 +35,8 @@ SINGLE_BATTLE_TEST("Sheer Force boosts power, but removes secondary effects of m
if (ability == ABILITY_SHEER_FORCE) {
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
if (move != MOVE_ALLURING_VOICE)
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
STATUS_ICON(opponent, STATUS1_FREEZE);
STATUS_ICON(opponent, STATUS1_POISON);
STATUS_ICON(opponent, STATUS1_BURN);