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

View File

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

View File

@@ -46,14 +46,6 @@ class Battle::Battler
pbEndTurn(choice) pbEndTurn(choice)
return false return false
end 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 # Use the move
PBDebug.log("[Move usage] #{pbThis} started using #{choice[2].name}") PBDebug.log("[Move usage] #{pbThis} started using #{choice[2].name}")
PBDebug.logonerr { PBDebug.logonerr {

View File

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