mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 06:34:59 +00:00
AI and other Gen 8 Effects (#123)
* Added Rattled being triggered by Intimidate in Gen 8 * Added Rapid Spin speed boost effect * Added basic AI for Gen 8 * Tweaked Leppa berry's effect * Added Ability Patch's exemption for Zygarde * Added Curse's Gen 8 targeting change * Added Teleport's Gen 8 effect * Added check for Choice items in Instruct and Dancer * Added Quash's Gen 8 change to the order that multiple Quashed Pokémon move in Co-authored-by: Maruno17 <serialcolour@hotmail.com>
This commit is contained in:
@@ -91,6 +91,12 @@ class PokeBattle_Battler
|
||||
end
|
||||
end
|
||||
|
||||
# Used for Rattled's Gen 8 effect. Called when Intimidate is triggered.
|
||||
def pbAbilitiesOnIntimidated
|
||||
return if !abilityActive?
|
||||
BattleHandlers.triggerAbilityOnIntimidated(self.ability, self, @battle)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
# Ability curing
|
||||
#=============================================================================
|
||||
|
||||
@@ -522,14 +522,16 @@ class PokeBattle_Battler
|
||||
next if idxMove<0
|
||||
oldLastRoundMoved = b.lastRoundMoved
|
||||
@battle.pbDisplay(_INTL("{1} used the move instructed by {2}!",b.pbThis,user.pbThis(true)))
|
||||
PBDebug.logonerr{
|
||||
b.effects[PBEffects::Instructed] = true
|
||||
b.pbUseMoveSimple(b.lastMoveUsed,b.lastRegularMoveTarget,idxMove,false)
|
||||
b.effects[PBEffects::Instructed] = false
|
||||
}
|
||||
b.lastRoundMoved = oldLastRoundMoved
|
||||
@battle.pbJudge
|
||||
return if @battle.decision>0
|
||||
b.effects[PBEffects::Instructed] = true
|
||||
if b.pbCanChooseMove?(@moves[idxMove], false)
|
||||
PBDebug.logonerr{
|
||||
b.pbUseMoveSimple(b.lastMoveUsed,b.lastRegularMoveTarget,idxMove,false)
|
||||
}
|
||||
b.lastRoundMoved = oldLastRoundMoved
|
||||
@battle.pbJudge
|
||||
return if @battle.decision>0
|
||||
end
|
||||
b.effects[PBEffects::Instructed] = false
|
||||
end
|
||||
# Dancer
|
||||
if !@effects[PBEffects::Dancer] && !user.lastMoveFailed && realNumHits>0 &&
|
||||
@@ -556,16 +558,18 @@ class PokeBattle_Battler
|
||||
@battle.pbDisplay(_INTL("{1} kept the dance going with {2}!",
|
||||
nextUser.pbThis,nextUser.abilityName))
|
||||
end
|
||||
PBDebug.logonerr{
|
||||
nextUser.effects[PBEffects::Dancer] = true
|
||||
nextUser.pbUseMoveSimple(move.id,preTarget)
|
||||
nextUser.effects[PBEffects::Dancer] = false
|
||||
}
|
||||
nextUser.lastRoundMoved = oldLastRoundMoved
|
||||
nextUser.effects[PBEffects::Outrage] = oldOutrage
|
||||
nextUser.currentMove = oldCurrentMove
|
||||
@battle.pbJudge
|
||||
return if @battle.decision>0
|
||||
nextUser.effects[PBEffects::Dancer] = true
|
||||
if nextUser.pbCanChooseMove?(move, false)
|
||||
PBDebug.logonerr{
|
||||
nextUser.pbUseMoveSimple(move.id,preTarget)
|
||||
}
|
||||
nextUser.lastRoundMoved = oldLastRoundMoved
|
||||
nextUser.effects[PBEffects::Outrage] = oldOutrage
|
||||
nextUser.currentMove = oldCurrentMove
|
||||
@battle.pbJudge
|
||||
return if @battle.decision>0
|
||||
end
|
||||
nextUser.effects[PBEffects::Dancer] = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user