mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
Fix Tar Shot
If Tar Shot can't do anything to the target it should fail. Checking this is clunky, but it works.
This commit is contained in:
parent
fb62479d85
commit
cecd341011
@ -1888,6 +1888,11 @@
|
||||
.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
|
||||
|
@ -461,6 +461,7 @@ BattleScript_EffectTarShot:
|
||||
attackcanceler
|
||||
jumpifsubstituteblocks BattleScript_ButItFailedAtkStringPpReduce
|
||||
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
|
||||
cantarshotwork BS_TARGET, BattleScript_ButItFailedAtkStringPpReduce
|
||||
attackstring
|
||||
ppreduce
|
||||
setstatchanger STAT_SPEED, 1, TRUE
|
||||
|
@ -200,9 +200,10 @@
|
||||
#define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 127
|
||||
#define VARIOUS_TRY_NO_RETREAT 128
|
||||
#define VARIOUS_TRY_TAR_SHOT 129
|
||||
#define VARIOUS_CHECK_POLTERGEIST 130
|
||||
#define VARIOUS_SET_OCTOLOCK 131
|
||||
#define VARIOUS_CUT_1_3_HP_RAISE_STATS 132
|
||||
#define VARIOUS_CAN_TAR_SHOT_WORK 130
|
||||
#define VARIOUS_CHECK_POLTERGEIST 131
|
||||
#define VARIOUS_SET_OCTOLOCK 132
|
||||
#define VARIOUS_CUT_1_3_HP_RAISE_STATS 133
|
||||
|
||||
// Cmd_manipulatedamage
|
||||
#define DMG_CHANGE_SIGN 0
|
||||
|
@ -9107,6 +9107,15 @@ static void Cmd_various(void)
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
return;
|
||||
case VARIOUS_CAN_TAR_SHOT_WORK:
|
||||
// Tar Shot will fail if it's already been used on the target and its speed can't be lowered further
|
||||
if (gDisableStructs[gActiveBattler].tarShot
|
||||
&& (gBattleMons[gActiveBattler].statStages[STAT_SPEED] == MIN_STAT_STAGE
|
||||
|| (gBattleMons[gActiveBattler].statStages[STAT_SPEED] == MAX_STAT_STAGE && GetBattlerAbility(gActiveBattler) == ABILITY_CONTRARY)))
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
else
|
||||
gBattlescriptCurrInstr += 7;
|
||||
return;
|
||||
}
|
||||
|
||||
gBattlescriptCurrInstr += 3;
|
||||
|
Loading…
Reference in New Issue
Block a user