Fixed using Pursuit against a switcher preventing using the next move

This commit is contained in:
Maruno17
2022-06-18 21:13:30 +01:00
parent 79f5e5d4aa
commit 9a03b25755
5 changed files with 73 additions and 86 deletions

View File

@@ -39,9 +39,7 @@ class Battle
end
# Use Pursuit
@choices[b.index][3] = idxSwitcher # Change Pursuit's target
if b.pbProcessTurn(@choices[b.index], false)
b.effects[PBEffects::Pursuit] = true
end
b.pbProcessTurn(@choices[b.index], false)
break if @decision > 0 || @battlers[idxSwitcher].fainted?
end
@switching = false

View File

@@ -236,7 +236,6 @@ class Battle::Battler
@effects[PBEffects::PriorityItem] = false
@effects[PBEffects::Protect] = false
@effects[PBEffects::ProtectRate] = 1
@effects[PBEffects::Pursuit] = false
@effects[PBEffects::Quash] = 0
@effects[PBEffects::Rage] = false
@effects[PBEffects::RagePowder] = false

View File

@@ -46,14 +46,6 @@ class Battle::Battler
pbEndTurn(choice)
return false
end
# Turn is skipped if Pursuit was used during switch
if @effects[PBEffects::Pursuit]
@effects[PBEffects::Pursuit] = false
pbCancelMoves
pbEndTurn(choice)
@battle.pbJudge
return false
end
# Use the move
PBDebug.log("[Move usage] #{pbThis} started using #{choice[2].name}")
PBDebug.logonerr {

View File

@@ -47,79 +47,78 @@ module PBEffects
Ingrain = 42
Instruct = 43
Instructed = 44
JawLock = 994
KingsShield = 45
LaserFocus = 46
LeechSeed = 47
LockOn = 48
LockOnPos = 49
MagicBounce = 50
MagicCoat = 51
MagnetRise = 52
MeanLook = 53
MeFirst = 54
Metronome = 55
MicleBerry = 56
Minimize = 57
MiracleEye = 58
MirrorCoat = 59
MirrorCoatTarget = 60
MoveNext = 61
MudSport = 62
Nightmare = 63
NoRetreat = 990
Obstruct = 992
Octolock = 993
Outrage = 64
ParentalBond = 65
PerishSong = 66
PerishSongUser = 67
PickupItem = 68
PickupUse = 69
Pinch = 70 # Battle Palace only
Powder = 71
PowerTrick = 72
Prankster = 73
PriorityAbility = 74
PriorityItem = 75
Protect = 76
ProtectRate = 77
Pursuit = 78
Quash = 79
Rage = 80
RagePowder = 81 # Used along with FollowMe
Rollout = 82
Roost = 83
ShellTrap = 84
SkyDrop = 85
SlowStart = 86
SmackDown = 87
Snatch = 88
SpikyShield = 89
Spotlight = 90
Stockpile = 91
StockpileDef = 92
StockpileSpDef = 93
Substitute = 94
TarShot = 991
Taunt = 95
Telekinesis = 96
ThroatChop = 97
Torment = 98
Toxic = 99
Transform = 100
TransformSpecies = 101
Trapping = 102 # Trapping move
TrappingMove = 103
TrappingUser = 104
Truant = 105
TwoTurnAttack = 106
Type3 = 107
Unburden = 108
Uproar = 109
WaterSport = 110
WeightChange = 111
Yawn = 112
JawLock = 45
KingsShield = 46
LaserFocus = 47
LeechSeed = 48
LockOn = 49
LockOnPos = 50
MagicBounce = 51
MagicCoat = 52
MagnetRise = 53
MeanLook = 54
MeFirst = 55
Metronome = 56
MicleBerry = 57
Minimize = 58
MiracleEye = 59
MirrorCoat = 60
MirrorCoatTarget = 61
MoveNext = 62
MudSport = 63
Nightmare = 64
NoRetreat = 65
Obstruct = 66
Octolock = 67
Outrage = 68
ParentalBond = 69
PerishSong = 70
PerishSongUser = 71
PickupItem = 72
PickupUse = 73
Pinch = 74 # Battle Palace only
Powder = 75
PowerTrick = 76
Prankster = 77
PriorityAbility = 78
PriorityItem = 79
Protect = 80
ProtectRate = 81
Quash = 82
Rage = 83
RagePowder = 84 # Used along with FollowMe
Rollout = 85
Roost = 86
ShellTrap = 87
SkyDrop = 88
SlowStart = 89
SmackDown = 90
Snatch = 91
SpikyShield = 92
Spotlight = 93
Stockpile = 94
StockpileDef = 95
StockpileSpDef = 96
Substitute = 97
TarShot = 98
Taunt = 99
Telekinesis = 100
ThroatChop = 101
Torment = 102
Toxic = 103
Transform = 104
TransformSpecies = 105
Trapping = 106 # Trapping move
TrappingMove = 107
TrappingUser = 108
Truant = 109
TwoTurnAttack = 110
Type3 = 111
Unburden = 112
Uproar = 113
WaterSport = 114
WeightChange = 115
Yawn = 116
#=============================================================================
# These effects apply to a battler position

View File

@@ -86,7 +86,6 @@ module Battle::DebugVariables
# PBEffects::PriorityItem - not suitable for setting via debug
PBEffects::Protect => { name: "Protect applies this round", default: false },
PBEffects::ProtectRate => { name: "Protect success chance 1/x", default: 1, max: 999 },
# PBEffects::Pursuit - not suitable for setting via debug
# PBEffects::Quash - not suitable for setting via debug
# PBEffects::Rage - only applies to use of specific move, not suitable for setting via debug
PBEffects::Rollout => { name: "Rollout rounds remaining (lower=stronger)", default: 0 },