mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Rearranged settings
This commit is contained in:
@@ -255,7 +255,7 @@ class PokeBattle_Battler
|
||||
speedMult /= 2 if pbOwnSide.effects[PBEffects::Swamp]>0
|
||||
# Paralysis
|
||||
if status==PBStatuses::PARALYSIS && !hasActiveAbility?(:QUICKFEET)
|
||||
speedMult /= (NEWEST_BATTLE_MECHANICS) ? 2 : 4
|
||||
speedMult /= (MECHANICS_GENERATION >= 7) ? 2 : 4
|
||||
end
|
||||
# Badge multiplier
|
||||
if @battle.internalBattle && pbOwnedByPlayer? &&
|
||||
@@ -524,28 +524,29 @@ class PokeBattle_Battler
|
||||
|
||||
def affectedByPowder?(showMsg=false)
|
||||
return false if fainted?
|
||||
return true if !NEWEST_BATTLE_MECHANICS
|
||||
if pbHasType?(:GRASS)
|
||||
if pbHasType?(:GRASS) && MORE_TYPE_EFFECTS
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected!",pbThis)) if showMsg
|
||||
return false
|
||||
end
|
||||
if hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker
|
||||
if showMsg
|
||||
@battle.pbShowAbilitySplash(self)
|
||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected!",pbThis))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!",pbThis,abilityName))
|
||||
if MECHANICS_GENERATION >= 6
|
||||
if hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker
|
||||
if showMsg
|
||||
@battle.pbShowAbilitySplash(self)
|
||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected!",pbThis))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!",pbThis,abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(self)
|
||||
end
|
||||
@battle.pbHideAbilitySplash(self)
|
||||
return false
|
||||
end
|
||||
return false
|
||||
end
|
||||
if hasActiveItem?(:SAFETYGOGGLES)
|
||||
if showMsg
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!",pbThis,itemName))
|
||||
if hasActiveItem?(:SAFETYGOGGLES)
|
||||
if showMsg
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!",pbThis,itemName))
|
||||
end
|
||||
return false
|
||||
end
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -137,7 +137,7 @@ class PokeBattle_Battler
|
||||
self.form = newForm
|
||||
pbUpdate(true)
|
||||
@hp = @totalhp-oldDmg
|
||||
@effects[PBEffects::WeightChange] = 0 if NEWEST_BATTLE_MECHANICS
|
||||
@effects[PBEffects::WeightChange] = 0 if MECHANICS_GENERATION >= 6
|
||||
@battle.scene.pbChangePokemon(self,@pokemon)
|
||||
@battle.scene.pbRefreshOne(@index)
|
||||
@battle.pbDisplay(msg) if msg && msg!=""
|
||||
@@ -275,7 +275,7 @@ class PokeBattle_Battler
|
||||
@spdef = target.spdef
|
||||
@speed = target.speed
|
||||
PBStats.eachBattleStat { |s| @stages[s] = target.stages[s] }
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if NEW_CRITICAL_HIT_RATE_MECHANICS
|
||||
@effects[PBEffects::FocusEnergy] = target.effects[PBEffects::FocusEnergy]
|
||||
@effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus]
|
||||
end
|
||||
|
||||
@@ -93,7 +93,7 @@ class PokeBattle_Battler
|
||||
when PBStatuses::BURN
|
||||
hasImmuneType |= pbHasType?(:FIRE)
|
||||
when PBStatuses::PARALYSIS
|
||||
hasImmuneType |= pbHasType?(:ELECTRIC) && NEWEST_BATTLE_MECHANICS
|
||||
hasImmuneType |= pbHasType?(:ELECTRIC) && MORE_TYPE_EFFECTS
|
||||
when PBStatuses::FROZEN
|
||||
hasImmuneType |= pbHasType?(:ICE)
|
||||
end
|
||||
@@ -189,7 +189,7 @@ class PokeBattle_Battler
|
||||
when PBStatuses::BURN
|
||||
hasImmuneType |= pbHasType?(:FIRE)
|
||||
when PBStatuses::PARALYSIS
|
||||
hasImmuneType |= pbHasType?(:ELECTRIC) && NEWEST_BATTLE_MECHANICS
|
||||
hasImmuneType |= pbHasType?(:ELECTRIC) && MORE_TYPE_EFFECTS
|
||||
end
|
||||
return false if hasImmuneType
|
||||
# Ability immunity
|
||||
|
||||
@@ -124,12 +124,10 @@ class PokeBattle_Battler
|
||||
#=============================================================================
|
||||
# Held item consuming/removing
|
||||
#=============================================================================
|
||||
def pbCanConsumeBerry?(_item,alwaysCheckGluttony=true)
|
||||
return false if @battle.pbCheckOpposingAbility(:UNNERVE,@index)
|
||||
return true if @hp<=@totalhp/4
|
||||
if alwaysCheckGluttony || NEWEST_BATTLE_MECHANICS
|
||||
return true if @hp<=@totalhp/2 && hasActiveAbility?(:GLUTTONY)
|
||||
end
|
||||
def pbCanConsumeBerry?(_item, check_gluttony = true)
|
||||
return false if @battle.pbCheckOpposingAbility(:UNNERVE, @index)
|
||||
return true if @hp <= @totalhp / 4
|
||||
return true if @hp <= @totalhp / 2 && (!check_gluttony || hasActiveAbility?(:GLUTTONY))
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ class PokeBattle_Battler
|
||||
}
|
||||
@battle.pbJudge
|
||||
# Update priority order
|
||||
# @battle.pbCalculatePriority if NEWEST_BATTLE_MECHANICS
|
||||
@battle.pbCalculatePriority if RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ class PokeBattle_Battler
|
||||
else
|
||||
@battle.pbCommonAnimation("Confusion",self)
|
||||
@battle.pbDisplay(_INTL("{1} is confused!",pbThis))
|
||||
threshold = (NEWEST_BATTLE_MECHANICS) ? 33 : 50 # % chance
|
||||
threshold = (MECHANICS_GENERATION >= 7) ? 33 : 50 # % chance
|
||||
if @battle.pbRandom(100)<threshold
|
||||
pbConfusionDamage(_INTL("It hurt itself in its confusion!"))
|
||||
@lastMoveFailed = true
|
||||
@@ -313,7 +313,7 @@ class PokeBattle_Battler
|
||||
# Wide Guard
|
||||
if target.pbOwnSide.effects[PBEffects::WideGuard] && user.index!=target.index &&
|
||||
PBTargets.multipleTargets?(move.pbTarget(user)) &&
|
||||
(NEWEST_BATTLE_MECHANICS || move.damagingMove?)
|
||||
(MECHANICS_GENERATION >= 7 || move.damagingMove?)
|
||||
@battle.pbCommonAnimation("WideGuard",target)
|
||||
@battle.pbDisplay(_INTL("Wide Guard protected {1}!",target.pbThis(true)))
|
||||
target.damageState.protected = true
|
||||
@@ -408,7 +408,7 @@ class PokeBattle_Battler
|
||||
return false
|
||||
end
|
||||
# Dark-type immunity to moves made faster by Prankster
|
||||
if NEWEST_BATTLE_MECHANICS && user.effects[PBEffects::Prankster] &&
|
||||
if MECHANICS_GENERATION >= 7 && user.effects[PBEffects::Prankster] &&
|
||||
target.pbHasType?(:DARK) && target.opposes?(user)
|
||||
PBDebug.log("[Target immune] #{target.pbThis} is Dark-type and immune to Prankster-boosted moves")
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
|
||||
@@ -441,26 +441,28 @@ class PokeBattle_Battler
|
||||
end
|
||||
end
|
||||
# Immunity to powder-based moves
|
||||
if NEWEST_BATTLE_MECHANICS && move.powderMove?
|
||||
if target.pbHasType?(:GRASS)
|
||||
if move.powderMove?
|
||||
if target.pbHasType?(:GRASS) && MORE_TYPE_EFFECTS
|
||||
PBDebug.log("[Target immune] #{target.pbThis} is Grass-type and immune to powder-based moves")
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
|
||||
return false
|
||||
end
|
||||
if target.hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker
|
||||
@battle.pbShowAbilitySplash(target)
|
||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1} because of its {2}.",target.pbThis(true),target.abilityName))
|
||||
if MECHANICS_GENERATION >= 6
|
||||
if target.hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker
|
||||
@battle.pbShowAbilitySplash(target)
|
||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1} because of its {2}.",target.pbThis(true),target.abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(target)
|
||||
return false
|
||||
end
|
||||
if target.hasActiveItem?(:SAFETYGOGGLES)
|
||||
PBDebug.log("[Item triggered] #{target.pbThis} has Safety Goggles and is immune to powder-based moves")
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
|
||||
return false
|
||||
end
|
||||
@battle.pbHideAbilitySplash(target)
|
||||
return false
|
||||
end
|
||||
if target.hasActiveItem?(:SAFETYGOGGLES)
|
||||
PBDebug.log("[Item triggered] #{target.pbThis} has Safety Goggles and is immune to powder-based moves")
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
|
||||
return false
|
||||
end
|
||||
end
|
||||
# Substitute
|
||||
|
||||
@@ -72,7 +72,7 @@ class PokeBattle_Battler
|
||||
next if b.status!=PBStatuses::FROZEN
|
||||
# NOTE: Non-Fire-type moves that thaw the user will also thaw the
|
||||
# target (in Gen 6+).
|
||||
if move.calcType == :FIRE || (NEWEST_BATTLE_MECHANICS && move.thawsUser?)
|
||||
if move.calcType == :FIRE || (MECHANICS_GENERATION >= 6 && move.thawsUser?)
|
||||
b.pbCureStatus
|
||||
end
|
||||
end
|
||||
|
||||
@@ -132,7 +132,7 @@ class PokeBattle_Move
|
||||
def nonLethal?(_user,_target); return false; end # For False Swipe
|
||||
|
||||
def ignoresSubstitute?(user) # user is the Pokémon using this move
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
return true if soundMove?
|
||||
return true if user && user.hasActiveAbility?(:INFILTRATOR)
|
||||
end
|
||||
|
||||
@@ -160,7 +160,7 @@ class PokeBattle_Move
|
||||
def pbIsCritical?(user,target)
|
||||
return false if target.pbOwnSide.effects[PBEffects::LuckyChant]>0
|
||||
# Set up the critical hit ratios
|
||||
ratios = (NEWEST_BATTLE_MECHANICS) ? [24,8,2,1] : [16,8,4,3,2]
|
||||
ratios = (NEW_CRITICAL_HIT_RATE_MECHANICS) ? [24,8,2,1] : [16,8,4,3,2]
|
||||
c = 0
|
||||
# Ability effects that alter critical hit rate
|
||||
if c>=0 && user.abilityActive?
|
||||
@@ -390,7 +390,7 @@ class PokeBattle_Move
|
||||
end
|
||||
# Critical hits
|
||||
if target.damageState.critical
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if NEW_CRITICAL_HIT_RATE_MECHANICS
|
||||
multipliers[FINAL_DMG_MULT] *= 1.5
|
||||
else
|
||||
multipliers[FINAL_DMG_MULT] *= 2
|
||||
@@ -455,7 +455,7 @@ class PokeBattle_Move
|
||||
def pbAdditionalEffectChance(user,target,effectChance=0)
|
||||
return 0 if target.hasActiveAbility?(:SHIELDDUST) && !@battle.moldBreaker
|
||||
ret = (effectChance>0) ? effectChance : @addlEffect
|
||||
if NEWEST_BATTLE_MECHANICS || @function!="0A4" # Secret Power
|
||||
if MECHANICS_GENERATION >= 6 || @function != "0A4" # Secret Power
|
||||
ret *= 2 if user.hasActiveAbility?(:SERENEGRACE) ||
|
||||
user.pbOwnSide.effects[PBEffects::Rainbow]>0
|
||||
end
|
||||
|
||||
@@ -555,7 +555,7 @@ class PokeBattle_ProtectMove < PokeBattle_Move
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
if !(@sidedEffect && NEWEST_BATTLE_MECHANICS) &&
|
||||
if (!@sidedEffect || MECHANICS_GENERATION <= 5) &&
|
||||
user.effects[PBEffects::ProtectRate]>1 &&
|
||||
@battle.pbRandom(user.effects[PBEffects::ProtectRate])!=0
|
||||
user.effects[PBEffects::ProtectRate] = 1
|
||||
@@ -575,7 +575,7 @@ class PokeBattle_ProtectMove < PokeBattle_Move
|
||||
else
|
||||
user.effects[@effect] = true
|
||||
end
|
||||
user.effects[PBEffects::ProtectRate] *= (NEWEST_BATTLE_MECHANICS) ? 3 : 2
|
||||
user.effects[PBEffects::ProtectRate] *= (MECHANICS_GENERATION >= 6) ? 3 : 2
|
||||
pbProtectMessage(user)
|
||||
end
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_003 < PokeBattle_SleepMove
|
||||
def pbMoveFailed?(user,targets)
|
||||
if NEWEST_BATTLE_MECHANICS && @id == :DARKVOID
|
||||
if MECHANICS_GENERATION >= 7 && @id == :DARKVOID
|
||||
if !user.isSpecies?(:DARKRAI) && user.effects[PBEffects::TransformSpecies] != :DARKRAI
|
||||
@battle.pbDisplay(_INTL("But {1} can't use the move!",user.pbThis))
|
||||
return true
|
||||
@@ -93,7 +93,7 @@ class PokeBattle_Move_006 < PokeBattle_PoisonMove
|
||||
end
|
||||
|
||||
def pbOverrideSuccessCheckPerHit(user,target)
|
||||
return (NEWEST_BATTLE_MECHANICS && statusMove? && user.pbHasType?(:POISON))
|
||||
return (MORE_TYPE_EFFECTS && statusMove? && user.pbHasType?(:POISON))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -107,7 +107,7 @@ end
|
||||
class PokeBattle_Move_007 < PokeBattle_ParalysisMove
|
||||
def tramplesMinimize?(param=1)
|
||||
# Perfect accuracy and double damage (for Body Slam only)
|
||||
return NEWEST_BATTLE_MECHANICS if @id == :BODYSLAM
|
||||
return MECHANICS_GENERATION >= 6 if @id == :BODYSLAM
|
||||
return super
|
||||
end
|
||||
|
||||
@@ -241,8 +241,8 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_010 < PokeBattle_FlinchMove
|
||||
def tramplesMinimize?(param=1)
|
||||
return super if @id == :DRAGONRUSH && !NEWEST_BATTLE_MECHANICS
|
||||
return true if param==1 && NEWEST_BATTLE_MECHANICS # Perfect accuracy
|
||||
return super if @id == :DRAGONRUSH && MECHANICS_GENERATION <= 5
|
||||
return true if param==1 && MECHANICS_GENERATION >= 6 # Perfect accuracy
|
||||
return true if param==2 # Double damage
|
||||
return super
|
||||
end
|
||||
@@ -305,7 +305,7 @@ class PokeBattle_Move_014 < PokeBattle_ConfuseMove
|
||||
end
|
||||
|
||||
def addlEffect
|
||||
return @chatterChance if !NEWEST_BATTLE_MECHANICS
|
||||
return @chatterChance if MECHANICS_GENERATION <= 5
|
||||
return super
|
||||
end
|
||||
end
|
||||
@@ -1267,7 +1267,7 @@ end
|
||||
class PokeBattle_Move_048 < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::EVASION,(NEWEST_BATTLE_MECHANICS) ? 2 : 1]
|
||||
@statDown = [PBStats::EVASION,(MECHANICS_GENERATION >= 6) ? 2 : 1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1297,11 +1297,13 @@ class PokeBattle_Move_049 < PokeBattle_TargetStatDownMove
|
||||
targetSide.effects[PBEffects::Spikes]>0 ||
|
||||
targetSide.effects[PBEffects::ToxicSpikes]>0 ||
|
||||
targetSide.effects[PBEffects::StickyWeb]
|
||||
return false if NEWEST_BATTLE_MECHANICS &&
|
||||
return false if MECHANICS_GENERATION >= 6 &&
|
||||
(targetOpposingSide.effects[PBEffects::StealthRock] ||
|
||||
targetOpposingSide.effects[PBEffects::Spikes]>0 ||
|
||||
targetOpposingSide.effects[PBEffects::ToxicSpikes]>0 ||
|
||||
targetOpposingSide.effects[PBEffects::StickyWeb])
|
||||
return false if MECHANICS_GENERATION >= 8 &&
|
||||
@battle.field.terrain != PBBattleTerrains::None
|
||||
return super
|
||||
end
|
||||
|
||||
@@ -1330,33 +1332,46 @@ class PokeBattle_Move_049 < PokeBattle_TargetStatDownMove
|
||||
@battle.pbDisplay(_INTL("{1} is no longer protected by Safeguard!!",target.pbTeam))
|
||||
end
|
||||
if target.pbOwnSide.effects[PBEffects::StealthRock] ||
|
||||
(NEWEST_BATTLE_MECHANICS &&
|
||||
(MECHANICS_GENERATION >= 6 &&
|
||||
target.pbOpposingSide.effects[PBEffects::StealthRock])
|
||||
target.pbOwnSide.effects[PBEffects::StealthRock] = false
|
||||
target.pbOpposingSide.effects[PBEffects::StealthRock] = false if NEWEST_BATTLE_MECHANICS
|
||||
target.pbOpposingSide.effects[PBEffects::StealthRock] = false if MECHANICS_GENERATION >= 6
|
||||
@battle.pbDisplay(_INTL("{1} blew away stealth rocks!",user.pbThis))
|
||||
end
|
||||
if target.pbOwnSide.effects[PBEffects::Spikes]>0 ||
|
||||
(NEWEST_BATTLE_MECHANICS &&
|
||||
(MECHANICS_GENERATION >= 6 &&
|
||||
target.pbOpposingSide.effects[PBEffects::Spikes]>0)
|
||||
target.pbOwnSide.effects[PBEffects::Spikes] = 0
|
||||
target.pbOpposingSide.effects[PBEffects::Spikes] = 0 if NEWEST_BATTLE_MECHANICS
|
||||
target.pbOpposingSide.effects[PBEffects::Spikes] = 0 if MECHANICS_GENERATION >= 6
|
||||
@battle.pbDisplay(_INTL("{1} blew away spikes!",user.pbThis))
|
||||
end
|
||||
if target.pbOwnSide.effects[PBEffects::ToxicSpikes]>0 ||
|
||||
(NEWEST_BATTLE_MECHANICS &&
|
||||
(MECHANICS_GENERATION >= 6 &&
|
||||
target.pbOpposingSide.effects[PBEffects::ToxicSpikes]>0)
|
||||
target.pbOwnSide.effects[PBEffects::ToxicSpikes] = 0
|
||||
target.pbOpposingSide.effects[PBEffects::ToxicSpikes] = 0 if NEWEST_BATTLE_MECHANICS
|
||||
target.pbOpposingSide.effects[PBEffects::ToxicSpikes] = 0 if MECHANICS_GENERATION >= 6
|
||||
@battle.pbDisplay(_INTL("{1} blew away poison spikes!",user.pbThis))
|
||||
end
|
||||
if target.pbOwnSide.effects[PBEffects::StickyWeb] ||
|
||||
(NEWEST_BATTLE_MECHANICS &&
|
||||
(MECHANICS_GENERATION >= 6 &&
|
||||
target.pbOpposingSide.effects[PBEffects::StickyWeb])
|
||||
target.pbOwnSide.effects[PBEffects::StickyWeb] = false
|
||||
target.pbOpposingSide.effects[PBEffects::StickyWeb] = false if NEWEST_BATTLE_MECHANICS
|
||||
target.pbOpposingSide.effects[PBEffects::StickyWeb] = false if MECHANICS_GENERATION >= 6
|
||||
@battle.pbDisplay(_INTL("{1} blew away sticky webs!",user.pbThis))
|
||||
end
|
||||
if MECHANICS_GENERATION >= 8 && @battle.field.terrain != PBBattleTerrains::None
|
||||
case @battle.field.terrain
|
||||
when PBBattleTerrains::Electric
|
||||
@battle.pbDisplay(_INTL("The electricity disappeared from the battlefield."))
|
||||
when PBBattleTerrains::Grassy
|
||||
@battle.pbDisplay(_INTL("The grass disappeared from the battlefield."))
|
||||
when PBBattleTerrains::Misty
|
||||
@battle.pbDisplay(_INTL("The mist disappeared from the battlefield."))
|
||||
when PBBattleTerrains::Psychic
|
||||
@battle.pbDisplay(_INTL("The weirdness disappeared from the battlefield."))
|
||||
end
|
||||
@battle.field.terrain = PBBattleTerrains::None
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1405,7 +1420,7 @@ class PokeBattle_Move_04D < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
inc = 2
|
||||
inc = 1 if @id == :STRINGSHOT && !NEWEST_BATTLE_MECHANICS
|
||||
inc = 1 if @id == :STRINGSHOT && MECHANICS_GENERATION <= 5
|
||||
@statDown = [PBStats::SPEED,inc]
|
||||
end
|
||||
end
|
||||
@@ -1559,7 +1574,7 @@ class PokeBattle_Move_055 < PokeBattle_Move
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
PBStats.eachBattleStat { |s| user.stages[s] = target.stages[s] }
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if NEW_CRITICAL_HIT_RATE_MECHANICS
|
||||
user.effects[PBEffects::FocusEnergy] = target.effects[PBEffects::FocusEnergy]
|
||||
user.effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus]
|
||||
end
|
||||
@@ -1794,7 +1809,7 @@ class PokeBattle_Move_05E < PokeBattle_Move
|
||||
userTypes = user.pbTypes(true)
|
||||
@newTypes = []
|
||||
user.eachMoveWithIndex do |m,i|
|
||||
break if NEWEST_BATTLE_MECHANICS && i>0
|
||||
break if MECHANICS_GENERATION >= 6 && i>0
|
||||
next if PBTypes.isPseudoType?(m.type)
|
||||
next if userTypes.include?(m.type)
|
||||
@newTypes.push(m.type) if !@newTypes.include?(m.type)
|
||||
@@ -2167,7 +2182,7 @@ class PokeBattle_Move_067 < PokeBattle_Move
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if !target.ability ||
|
||||
(user.ability==target.ability && !NEWEST_BATTLE_MECHANICS)
|
||||
(user.ability == target.ability && MECHANICS_GENERATION <= 5)
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -2369,7 +2384,7 @@ class PokeBattle_Move_070 < PokeBattle_FixedDamageMove
|
||||
@battle.pbHideAbilitySplash(target)
|
||||
return true
|
||||
end
|
||||
if NEWEST_BATTLE_MECHANICS && @id == :SHEERCOLD && target.pbHasType?(:ICE)
|
||||
if MECHANICS_GENERATION >= 7 && @id == :SHEERCOLD && target.pbHasType?(:ICE)
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -2378,7 +2393,7 @@ class PokeBattle_Move_070 < PokeBattle_FixedDamageMove
|
||||
|
||||
def pbAccuracyCheck(user,target)
|
||||
acc = @accuracy+user.level-target.level
|
||||
acc -= 10 if NEWEST_BATTLE_MECHANICS && @id == :SHEERCOLD && !user.pbHasType?(:ICE)
|
||||
acc -= 10 if MECHANICS_GENERATION >= 7 && @id == :SHEERCOLD && !user.pbHasType?(:ICE)
|
||||
return @battle.pbRandom(100)<acc
|
||||
end
|
||||
|
||||
@@ -2697,7 +2712,7 @@ end
|
||||
# Burn's halving of Attack is negated (new mechanics).
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_07E < PokeBattle_Move
|
||||
def damageReducedByBurn?; return !NEWEST_BATTLE_MECHANICS; end
|
||||
def damageReducedByBurn?; return MECHANICS_GENERATION <= 5; end
|
||||
|
||||
def pbBaseDamage(baseDmg,user,target)
|
||||
baseDmg *= 2 if user.poisoned? || user.burned? || user.paralyzed?
|
||||
|
||||
@@ -248,7 +248,7 @@ class PokeBattle_Move_090 < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbBaseDamage(baseDmg,user,target)
|
||||
return super if NEWEST_BATTLE_MECHANICS
|
||||
return super if MECHANICS_GENERATION >= 6
|
||||
hp = pbHiddenPower(user)
|
||||
return hp[1]
|
||||
end
|
||||
@@ -272,7 +272,7 @@ def pbHiddenPower(pkmn)
|
||||
idxType |= (iv[PBStats::SPDEF]&1)<<5
|
||||
idxType = (types.length-1)*idxType/63
|
||||
type = types[idxType]
|
||||
if !NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION <= 5
|
||||
powerMin = 30
|
||||
powerMax = 70
|
||||
power |= (iv[PBStats::HP]&2)>>1
|
||||
@@ -503,7 +503,7 @@ class PokeBattle_Move_096 < PokeBattle_Move
|
||||
@damageArray.each do |dmg, items|
|
||||
next if !items.include?(heldItem)
|
||||
ret = dmg
|
||||
ret += 20 if NEWEST_BATTLE_MECHANICS
|
||||
ret += 20 if MECHANICS_GENERATION >= 6
|
||||
break
|
||||
end
|
||||
return ret
|
||||
@@ -600,7 +600,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_09B < PokeBattle_Move
|
||||
def tramplesMinimize?(param=1)
|
||||
return true if NEWEST_BATTLE_MECHANICS # Perfect accuracy and double damage
|
||||
return true if MECHANICS_GENERATION >= 7 # Perfect accuracy and double damage
|
||||
return super
|
||||
end
|
||||
|
||||
@@ -646,7 +646,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_09D < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
if @battle.field.effects[PBEffects::MudSportField]>0
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
@@ -662,7 +662,7 @@ class PokeBattle_Move_09D < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@battle.field.effects[PBEffects::MudSportField] = 5
|
||||
else
|
||||
user.effects[PBEffects::MudSport] = true
|
||||
@@ -678,7 +678,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_09E < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
if @battle.field.effects[PBEffects::WaterSportField]>0
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
@@ -694,7 +694,7 @@ class PokeBattle_Move_09E < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@battle.field.effects[PBEffects::WaterSportField] = 5
|
||||
else
|
||||
user.effects[PBEffects::WaterSport] = true
|
||||
@@ -1193,7 +1193,7 @@ class PokeBattle_Move_0AF < PokeBattle_Move
|
||||
"133", # Hold Hands
|
||||
"134" # Celebrate
|
||||
]
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@moveBlacklist += [
|
||||
# Target-switching moves
|
||||
"0EB", # Roar, Whirlwind
|
||||
@@ -1320,7 +1320,7 @@ class PokeBattle_Move_0B3 < PokeBattle_Move
|
||||
case @battle.environment
|
||||
when PBEnvironment::Grass, PBEnvironment::TallGrass,
|
||||
PBEnvironment::Forest, PBEnvironment::ForestGrass
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@npMove = :ENERGYBALL if GameData::Move.exists?(:ENERGYBALL)
|
||||
else
|
||||
@npMove = :SEEDBOMB if GameData::Move.exists?(:SEEDBOMB)
|
||||
@@ -1330,30 +1330,31 @@ class PokeBattle_Move_0B3 < PokeBattle_Move
|
||||
when PBEnvironment::Puddle
|
||||
@npMove = :MUDBOMB if GameData::Move.exists?(:MUDBOMB)
|
||||
when PBEnvironment::Cave
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@npMove = :POWERGEM if GameData::Move.exists?(:POWERGEM)
|
||||
else
|
||||
@npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE)
|
||||
end
|
||||
when PBEnvironment::Rock
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER)
|
||||
else
|
||||
@npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE)
|
||||
end
|
||||
when PBEnvironment::Sand
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER)
|
||||
else
|
||||
@npMove = :EARTHQUAKE if GameData::Move.exists?(:EARTHQUAKE)
|
||||
end
|
||||
# Ice tiles in Gen 6 should be Ice Beam
|
||||
when PBEnvironment::Snow, PBEnvironment::Ice
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
when PBEnvironment::Snow
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@npMove = :FROSTBREATH if GameData::Move.exists?(:FROSTBREATH)
|
||||
else
|
||||
@npMove = :ICEBEAM if GameData::Move.exists?(:ICEBEAM)
|
||||
@npMove = :BLIZZARD if GameData::Move.exists?(:BLIZZARD)
|
||||
end
|
||||
when PBEnvironment::Ice
|
||||
@npMove = :ICEBEAM if GameData::Move.exists?(:ICEBEAM)
|
||||
when PBEnvironment::Volcano
|
||||
@npMove = :LAVAPLUME if GameData::Move.exists?(:LAVAPLUME)
|
||||
when PBEnvironment::Graveyard
|
||||
@@ -1513,7 +1514,7 @@ class PokeBattle_Move_0B5 < PokeBattle_Move
|
||||
"133", # Hold Hands
|
||||
"134" # Celebrate
|
||||
]
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@moveBlacklist += [
|
||||
# Moves that call other moves
|
||||
"0B3", # Nature Power
|
||||
@@ -1544,7 +1545,7 @@ class PokeBattle_Move_0B5 < PokeBattle_Move
|
||||
# NOTE: This includes the Pokémon of ally trainers in multi battles.
|
||||
@battle.pbParty(user.index).each_with_index do |pkmn,i|
|
||||
next if !pkmn || i==user.pokemonIndex
|
||||
next if NEWEST_BATTLE_MECHANICS && pkmn.egg?
|
||||
next if MECHANICS_GENERATION >= 6 && pkmn.egg?
|
||||
pkmn.moves.each do |move|
|
||||
next if @moveBlacklist.include?(move.function_code)
|
||||
next if move.type == :SHADOW
|
||||
@@ -1777,7 +1778,7 @@ class PokeBattle_Move_0BA < PokeBattle_Move
|
||||
return true
|
||||
end
|
||||
return true if pbMoveFailedAromaVeil?(user,target)
|
||||
if NEWEST_BATTLE_MECHANICS && target.hasActiveAbility?(:OBLIVIOUS) &&
|
||||
if MECHANICS_GENERATION >= 6 && target.hasActiveAbility?(:OBLIVIOUS) &&
|
||||
!@battle.moldBreaker
|
||||
@battle.pbShowAbilitySplash(target)
|
||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@@ -1842,7 +1843,7 @@ class PokeBattle_Move_0BC < PokeBattle_Move
|
||||
# Moves that call other moves (see also below)
|
||||
"0AE" # Mirror Move
|
||||
]
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 7
|
||||
@moveBlacklist += [
|
||||
# Moves that call other moves
|
||||
# "0AE", # Mirror Move # See above
|
||||
@@ -2235,7 +2236,7 @@ class PokeBattle_Move_0CE < PokeBattle_TwoTurnMove
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
if NEWEST_BATTLE_MECHANICS && target.pbWeight>=2000 # 200.0kg
|
||||
if MECHANICS_GENERATION >= 6 && target.pbWeight>=2000 # 200.0kg
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -2285,7 +2286,7 @@ class PokeBattle_Move_0CF < PokeBattle_Move
|
||||
return if target.effects[PBEffects::Trapping]>0
|
||||
# Set trapping effect duration and info
|
||||
if user.hasActiveItem?(:GRIPCLAW)
|
||||
target.effects[PBEffects::Trapping] = (NEWEST_BATTLE_MECHANICS) ? 8 : 6
|
||||
target.effects[PBEffects::Trapping] = (MECHANICS_GENERATION >= 5) ? 8 : 6
|
||||
else
|
||||
target.effects[PBEffects::Trapping] = 5+@battle.pbRandom(2)
|
||||
end
|
||||
@@ -2648,7 +2649,7 @@ end
|
||||
# User gains half the HP it inflicts as damage.
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0DD < PokeBattle_Move
|
||||
def healingMove?; return NEWEST_BATTLE_MECHANICS; end
|
||||
def healingMove?; return MECHANICS_GENERATION >= 6; end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
return if target.damageState.hpLost<=0
|
||||
@@ -2664,7 +2665,7 @@ end
|
||||
# (Dream Eater)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0DE < PokeBattle_Move
|
||||
def healingMove?; return NEWEST_BATTLE_MECHANICS; end
|
||||
def healingMove?; return MECHANICS_GENERATION >= 6; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if !target.asleep?
|
||||
@@ -2899,7 +2900,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0E7 < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
if NEWEST_BATTLE_MECHANICS && user.effects[PBEffects::DestinyBondPrevious]
|
||||
if MECHANICS_GENERATION >= 7 && user.effects[PBEffects::DestinyBondPrevious]
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -3144,7 +3145,7 @@ class PokeBattle_Move_0EF < PokeBattle_Move
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
if NEWEST_BATTLE_MECHANICS && target.pbHasType?(:GHOST)
|
||||
if MORE_TYPE_EFFECTS && target.pbHasType?(:GHOST)
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
|
||||
return true
|
||||
end
|
||||
@@ -3160,7 +3161,7 @@ class PokeBattle_Move_0EF < PokeBattle_Move
|
||||
def pbAdditionalEffect(user,target)
|
||||
return if target.fainted? || target.damageState.substitute
|
||||
return if target.effects[PBEffects::MeanLook]>=0
|
||||
return if NEWEST_BATTLE_MECHANICS && target.pbHasType?(:GHOST)
|
||||
return if MORE_TYPE_EFFECTS && target.pbHasType?(:GHOST)
|
||||
target.effects[PBEffects::MeanLook] = user.index
|
||||
@battle.pbDisplay(_INTL("{1} can no longer escape!",target.pbThis))
|
||||
end
|
||||
@@ -3174,7 +3175,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0F0 < PokeBattle_Move
|
||||
def pbBaseDamage(baseDmg,user,target)
|
||||
if NEWEST_BATTLE_MECHANICS &&
|
||||
if MECHANICS_GENERATION >= 6 &&
|
||||
target.item && !target.unlosableItem?(target.item)
|
||||
# NOTE: Damage is still boosted even if target has Sticky Hold or a
|
||||
# substitute.
|
||||
@@ -3300,7 +3301,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0F3 < PokeBattle_Move
|
||||
def ignoresSubstitute?(user)
|
||||
return true if NEWEST_BATTLE_MECHANICS
|
||||
return true if MECHANICS_GENERATION >= 6
|
||||
return super
|
||||
end
|
||||
|
||||
@@ -3364,7 +3365,7 @@ class PokeBattle_Move_0F5 < PokeBattle_Move
|
||||
def pbEffectWhenDealingDamage(user,target)
|
||||
return if target.damageState.substitute || target.damageState.berryWeakened
|
||||
return if !target.item || (!target.item.is_berry? &&
|
||||
!(NEWEST_BATTLE_MECHANICS && target.item.is_gem?))
|
||||
!(MECHANICS_GENERATION >= 6 && target.item.is_gem?))
|
||||
target.pbRemoveItem
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} was incinerated!",target.pbThis,target.itemName))
|
||||
end
|
||||
|
||||
@@ -1445,7 +1445,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_144 < PokeBattle_Move
|
||||
def tramplesMinimize?(param=1)
|
||||
return true if param==1 && NEWEST_BATTLE_MECHANICS # Perfect accuracy
|
||||
return true if param==1 && MECHANICS_GENERATION >= 6 # Perfect accuracy
|
||||
return true if param==2 # Double damage
|
||||
return super
|
||||
end
|
||||
@@ -1666,7 +1666,7 @@ end
|
||||
# User gains 3/4 the HP it inflicts as damage. (Draining Kiss, Oblivion Wing)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_14F < PokeBattle_Move
|
||||
def healingMove?; return NEWEST_BATTLE_MECHANICS; end
|
||||
def healingMove?; return MECHANICS_GENERATION >= 6; end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
return if target.damageState.hpLost<=0
|
||||
|
||||
@@ -231,9 +231,6 @@ class PokeBattle_Battle
|
||||
end
|
||||
end
|
||||
|
||||
# NOTE: In Gen 8, battler speeds stored in priority are recalculated far more
|
||||
# frequently than they used to be. There are several quoted-out calls to
|
||||
# pbCalculatePriority in these scripts which do this; just unquote them.
|
||||
def pbPriority(onlySpeedSort=false)
|
||||
ret = []
|
||||
if onlySpeedSort
|
||||
|
||||
@@ -64,7 +64,7 @@ class PokeBattle_Battle
|
||||
end
|
||||
end
|
||||
# Other certain switching effects
|
||||
return true if NEWEST_BATTLE_MECHANICS && battler.pbHasType?(:GHOST)
|
||||
return true if MORE_TYPE_EFFECTS && battler.pbHasType?(:GHOST)
|
||||
# Other certain trapping effects
|
||||
if battler.effects[PBEffects::Trapping]>0 ||
|
||||
battler.effects[PBEffects::MeanLook]>=0 ||
|
||||
@@ -286,7 +286,7 @@ class PokeBattle_Battle
|
||||
partyOrder[idxParty],partyOrder[idxPartyOld] = partyOrder[idxPartyOld],partyOrder[idxParty]
|
||||
# Send out the new Pokémon
|
||||
pbSendOut([[idxBattler,party[idxParty]]])
|
||||
# pbCalculatePriority(false,[idxBattler]) if NEWEST_BATTLE_MECHANICS
|
||||
pbCalculatePriority(false,[idxBattler]) if RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
|
||||
end
|
||||
|
||||
# Called from def pbReplace above and at the start of battle.
|
||||
|
||||
@@ -6,7 +6,7 @@ class PokeBattle_Battle
|
||||
return false if trainerBattle?
|
||||
battler = @battlers[idxBattler]
|
||||
return false if !@canRun && !battler.opposes?
|
||||
return true if battler.pbHasType?(:GHOST) && NEWEST_BATTLE_MECHANICS
|
||||
return true if battler.pbHasType?(:GHOST) && MORE_TYPE_EFFECTS
|
||||
return true if battler.abilityActive? &&
|
||||
BattleHandlers.triggerRunFromBattleAbility(battler.ability,battler)
|
||||
return true if battler.itemActive? &&
|
||||
@@ -71,7 +71,7 @@ class PokeBattle_Battle
|
||||
return 0
|
||||
end
|
||||
if !duringBattle
|
||||
if battler.pbHasType?(:GHOST) && NEWEST_BATTLE_MECHANICS
|
||||
if battler.pbHasType?(:GHOST) && MORE_TYPE_EFFECTS
|
||||
pbSEPlay("Battle flee")
|
||||
pbDisplayPaused(_INTL("You got away safely!"))
|
||||
@decision = 3
|
||||
|
||||
@@ -157,7 +157,7 @@ class PokeBattle_Battle
|
||||
if battler.isSpecies?(:GENGAR) && battler.mega?
|
||||
battler.effects[PBEffects::Telekinesis] = 0
|
||||
end
|
||||
pbCalculatePriority(false,[idxBattler]) if NEWEST_BATTLE_MECHANICS
|
||||
pbCalculatePriority(false,[idxBattler]) if RECALCULATE_TURN_ORDER_AFTER_MEGA_EVOLUTION
|
||||
# Trigger ability
|
||||
battler.pbEffectsOnSwitchIn
|
||||
end
|
||||
|
||||
@@ -84,7 +84,7 @@ class PokeBattle_Battle
|
||||
end
|
||||
return if @decision > 0
|
||||
end
|
||||
# pbCalculatePriority if NEWEST_BATTLE_MECHANICS
|
||||
pbCalculatePriority if RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
|
||||
end
|
||||
|
||||
def pbAttackPhaseMegaEvolution
|
||||
|
||||
@@ -331,7 +331,7 @@ class PokeBattle_Battle
|
||||
# Damage from Hyper Mode (Shadow Pokémon)
|
||||
priority.each do |b|
|
||||
next if !b.inHyperMode? || @choices[b.index][0]!=:UseMove
|
||||
hpLoss = (NEWEST_BATTLE_MECHANICS) ? b.totalhp/16 : b.totalhp/8
|
||||
hpLoss = b.totalhp/24
|
||||
@scene.pbDamageAnimation(b)
|
||||
b.pbReduceHP(hpLoss,false)
|
||||
pbDisplay(_INTL("The Hyper Mode attack hurts {1}!",b.pbThis(true)))
|
||||
@@ -370,7 +370,7 @@ class PokeBattle_Battle
|
||||
priority.each do |b|
|
||||
next if b.status!=PBStatuses::BURN || !b.takesIndirectDamage?
|
||||
oldHP = b.hp
|
||||
dmg = (NEWEST_BATTLE_MECHANICS) ? b.totalhp/16 : b.totalhp/8
|
||||
dmg = (MECHANICS_GENERATION >= 7) ? b.totalhp/16 : b.totalhp/8
|
||||
dmg = (dmg/2.0).round if b.hasActiveAbility?(:HEATPROOF)
|
||||
b.pbContinueStatus { b.pbReduceHP(dmg,false) }
|
||||
b.pbItemHPHealCheck
|
||||
@@ -417,9 +417,9 @@ class PokeBattle_Battle
|
||||
else pbCommonAnimation("Wrap", b)
|
||||
end
|
||||
if b.takesIndirectDamage?
|
||||
hpLoss = (NEWEST_BATTLE_MECHANICS) ? b.totalhp/8 : b.totalhp/16
|
||||
hpLoss = (MECHANICS_GENERATION >= 6) ? b.totalhp/8 : b.totalhp/16
|
||||
if @battlers[b.effects[PBEffects::TrappingUser]].hasActiveItem?(:BINDINGBAND)
|
||||
hpLoss = (NEWEST_BATTLE_MECHANICS) ? b.totalhp/6 : b.totalhp/8
|
||||
hpLoss = (MECHANICS_GENERATION >= 6) ? b.totalhp/6 : b.totalhp/8
|
||||
end
|
||||
@scene.pbDamageAnimation(b)
|
||||
b.pbReduceHP(hpLoss,false)
|
||||
|
||||
@@ -44,7 +44,7 @@ class PokeBattle_AI
|
||||
:ENERGYPOWDER => 50,
|
||||
:ENERGYROOT => 200
|
||||
}
|
||||
hpItems[:RAGECANDYBAR] = 20 if !NEWEST_BATTLE_MECHANICS
|
||||
hpItems[:RAGECANDYBAR] = 20 if !RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||
fullRestoreItems = [
|
||||
:FULLRESTORE
|
||||
]
|
||||
@@ -59,37 +59,37 @@ class PokeBattle_AI
|
||||
:FULLHEAL, :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE,
|
||||
:SHALOURSABLE, :BIGMALASADA, :LUMBERRY, :HEALPOWDER
|
||||
]
|
||||
allStatusItems.push(:RAGECANDYBAR) if NEWEST_BATTLE_MECHANICS
|
||||
allStatusItems.push(:RAGECANDYBAR) if RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||
xItems = {
|
||||
:XATTACK => [PBStats::ATTACK, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XATTACK => [PBStats::ATTACK, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XATTACK2 => [PBStats::ATTACK, 2],
|
||||
:XATTACK3 => [PBStats::ATTACK, 3],
|
||||
:XATTACK6 => [PBStats::ATTACK, 6],
|
||||
:XDEFENSE => [PBStats::DEFENSE, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XDEFENSE => [PBStats::DEFENSE, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XDEFENSE2 => [PBStats::DEFENSE, 2],
|
||||
:XDEFENSE3 => [PBStats::DEFENSE, 3],
|
||||
:XDEFENSE6 => [PBStats::DEFENSE, 6],
|
||||
:XDEFEND => [PBStats::DEFENSE, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XDEFEND => [PBStats::DEFENSE, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XDEFEND2 => [PBStats::DEFENSE, 2],
|
||||
:XDEFEND3 => [PBStats::DEFENSE, 3],
|
||||
:XDEFEND6 => [PBStats::DEFENSE, 6],
|
||||
:XSPATK => [PBStats::SPATK, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XSPATK => [PBStats::SPATK, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPATK2 => [PBStats::SPATK, 2],
|
||||
:XSPATK3 => [PBStats::SPATK, 3],
|
||||
:XSPATK6 => [PBStats::SPATK, 6],
|
||||
:XSPECIAL => [PBStats::SPATK, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XSPECIAL => [PBStats::SPATK, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPECIAL2 => [PBStats::SPATK, 2],
|
||||
:XSPECIAL3 => [PBStats::SPATK, 3],
|
||||
:XSPECIAL6 => [PBStats::SPATK, 6],
|
||||
:XSPDEF => [PBStats::SPDEF, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XSPDEF => [PBStats::SPDEF, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPDEF2 => [PBStats::SPDEF, 2],
|
||||
:XSPDEF3 => [PBStats::SPDEF, 3],
|
||||
:XSPDEF6 => [PBStats::SPDEF, 6],
|
||||
:XSPEED => [PBStats::SPEED, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XSPEED => [PBStats::SPEED, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPEED2 => [PBStats::SPEED, 2],
|
||||
:XSPEED3 => [PBStats::SPEED, 3],
|
||||
:XSPEED6 => [PBStats::SPEED, 6],
|
||||
:XACCURACY => [PBStats::ACCURACY, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XACCURACY => [PBStats::ACCURACY, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XACCURACY2 => [PBStats::ACCURACY, 2],
|
||||
:XACCURACY3 => [PBStats::ACCURACY, 3],
|
||||
:XACCURACY6 => [PBStats::ACCURACY, 6]
|
||||
|
||||
@@ -120,7 +120,7 @@ class PokeBattle_AI
|
||||
end
|
||||
return true if target.effects[PBEffects::Substitute]>0 && move.statusMove? &&
|
||||
!move.ignoresSubstitute?(user) && user.index!=target.index
|
||||
return true if NEWEST_BATTLE_MECHANICS && user.hasActiveAbility?(:PRANKSTER) &&
|
||||
return true if MECHANICS_GENERATION >= 7 && user.hasActiveAbility?(:PRANKSTER) &&
|
||||
target.pbHasType?(:DARK) && target.opposes?(user)
|
||||
return true if move.priority>0 && @battle.field.terrain==PBBattleTerrains::Psychic &&
|
||||
target.affectedByTerrain? && target.opposes?(user)
|
||||
@@ -200,7 +200,7 @@ class PokeBattle_AI
|
||||
baseDmg = move.pbNaturalGiftBaseDamage(user.item_id)
|
||||
when "09B" # Heavy Slam
|
||||
baseDmg = move.pbBaseDamage(baseDmg,user,target)
|
||||
baseDmg *= 2 if NEWEST_BATTLE_MECHANICS && skill>=PBTrainerAI.mediumSkill &&
|
||||
baseDmg *= 2 if MECHANICS_GENERATION >= 7 && skill>=PBTrainerAI.mediumSkill &&
|
||||
target.effects[PBEffects::Minimize]
|
||||
when "0A0", "0BD", "0BE" # Frost Breath, Double Kick, Twineedle
|
||||
baseDmg *= 2
|
||||
@@ -469,7 +469,7 @@ class PokeBattle_AI
|
||||
if skill>=PBTrainerAI.highSkill
|
||||
if user.status==PBStatuses::BURN && move.physicalMove?(type) &&
|
||||
!user.hasActiveAbility?(:GUTS) &&
|
||||
!(NEWEST_BATTLE_MECHANICS && move.function=="07E") # Facade
|
||||
!(MECHANICS_GENERATION >= 6 && move.function == "07E") # Facade
|
||||
multipliers[FINAL_DMG_MULT] /= 2
|
||||
end
|
||||
end
|
||||
@@ -646,7 +646,7 @@ class PokeBattle_AI
|
||||
end
|
||||
if skill>=PBTrainerAI.highSkill
|
||||
if move.function=="006" # Toxic
|
||||
modifiers[BASE_ACC] = 0 if NEWEST_BATTLE_MECHANICS && move.statusMove? &&
|
||||
modifiers[BASE_ACC] = 0 if MORE_TYPE_EFFECTS && move.statusMove? &&
|
||||
user.pbHasType?(:POISON)
|
||||
end
|
||||
if move.function=="070" # OHKO moves
|
||||
|
||||
@@ -491,10 +491,14 @@ FINAL_DMG_MULT = 3
|
||||
|
||||
def pbBattleConfusionBerry(battler,battle,item,forced,flavor,confuseMsg)
|
||||
return false if !forced && !battler.canHeal?
|
||||
return false if !forced && !battler.pbCanConsumeBerry?(item,false)
|
||||
return false if !forced && !battler.pbCanConsumeBerry?(item, (MECHANICS_GENERATION >= 7))
|
||||
itemName = GameData::Item.get(item).name
|
||||
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
||||
amt = (NEWEST_BATTLE_MECHANICS) ? battler.pbRecoverHP(battler.totalhp/2) : battler.pbRecoverHP(battler.totalhp/8)
|
||||
fraction_to_heal = 8 # Gens 6 and lower
|
||||
if MECHANICS_GENERATION == 7; fraction_to_heal = 2
|
||||
elsif MECHANICS_GENERATION >= 8; fraction_to_heal = 3
|
||||
end
|
||||
amt = battler.pbRecoverHP(battler.totalhp / fraction_to_heal)
|
||||
if amt>0
|
||||
if forced
|
||||
PBDebug.log("[Item triggered] Forced consuming of #{itemName}")
|
||||
@@ -577,7 +581,7 @@ def pbBattleGem(user,type,move,mults,moveType)
|
||||
return if move.is_a?(PokeBattle_PledgeMove)
|
||||
return if moveType != type
|
||||
user.effects[PBEffects::GemConsumed] = user.item_id
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
mults[BASE_DMG_MULT] *= 1.3
|
||||
else
|
||||
mults[BASE_DMG_MULT] *= 1.5
|
||||
@@ -603,10 +607,10 @@ def pbBattleWeatherAbility(weather,battler,battle,ignorePrimal=false)
|
||||
battle.pbDisplay(_INTL("{1}'s {2} activated!",battler.pbThis,battler.abilityName))
|
||||
end
|
||||
fixedDuration = false
|
||||
fixedDuration = true if NEWEST_BATTLE_MECHANICS &&
|
||||
weather!=PBWeather::HarshSun &&
|
||||
weather!=PBWeather::HeavyRain &&
|
||||
weather!=PBWeather::StrongWinds
|
||||
fixedDuration = true if FIXED_DURATION_WEATHER_FROM_ABILITY &&
|
||||
weather != PBWeather::HarshSun &&
|
||||
weather != PBWeather::HeavyRain &&
|
||||
weather != PBWeather::StrongWinds
|
||||
battle.pbStartWeather(battler,weather,fixedDuration)
|
||||
# NOTE: The ability splash is hidden again in def pbStartWeather.
|
||||
end
|
||||
|
||||
@@ -308,7 +308,7 @@ BattleHandlers::StatusCureAbility.add(:MAGMAARMOR,
|
||||
BattleHandlers::StatusCureAbility.add(:OBLIVIOUS,
|
||||
proc { |ability,battler|
|
||||
next if battler.effects[PBEffects::Attract]<0 &&
|
||||
(battler.effects[PBEffects::Taunt]==0 || !NEWEST_BATTLE_MECHANICS)
|
||||
(battler.effects[PBEffects::Taunt]==0 || MECHANICS_GENERATION <= 5)
|
||||
battler.battle.pbShowAbilitySplash(battler)
|
||||
if battler.effects[PBEffects::Attract]>=0
|
||||
battler.pbCureAttract
|
||||
@@ -319,7 +319,7 @@ BattleHandlers::StatusCureAbility.add(:OBLIVIOUS,
|
||||
battler.pbThis,battler.abilityName))
|
||||
end
|
||||
end
|
||||
if battler.effects[PBEffects::Taunt]>0 && NEWEST_BATTLE_MECHANICS
|
||||
if battler.effects[PBEffects::Taunt]>0 && MECHANICS_GENERATION >= 6
|
||||
battler.effects[PBEffects::Taunt] = 0
|
||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
battler.battle.pbDisplay(_INTL("{1}'s Taunt wore off!",battler.pbThis))
|
||||
@@ -741,7 +741,7 @@ BattleHandlers::MoveBaseTypeModifierAbility.add(:LIQUIDVOICE,
|
||||
BattleHandlers::MoveBaseTypeModifierAbility.add(:NORMALIZE,
|
||||
proc { |ability,user,move,type|
|
||||
next if !GameData::Type.exists?(:NORMAL)
|
||||
move.powerBoost = true if NEWEST_BATTLE_MECHANICS
|
||||
move.powerBoost = true if MECHANICS_GENERATION >= 7
|
||||
next :NORMAL
|
||||
}
|
||||
)
|
||||
@@ -780,7 +780,7 @@ BattleHandlers::AccuracyCalcUserAbility.add(:HUSTLE,
|
||||
|
||||
BattleHandlers::AccuracyCalcUserAbility.add(:KEENEYE,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
mods[EVA_STAGE] = 0 if mods[EVA_STAGE]>0 && NEWEST_BATTLE_MECHANICS
|
||||
mods[EVA_STAGE] = 0 if mods[EVA_STAGE]>0 && MECHANICS_GENERATION >= 6
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1601,12 +1601,12 @@ BattleHandlers::TargetAbilityOnHit.add(:WATERCOMPACTION,
|
||||
BattleHandlers::TargetAbilityOnHit.add(:WEAKARMOR,
|
||||
proc { |ability,user,target,move,battle|
|
||||
next if !move.physicalMove?
|
||||
next if !target.pbCanLowerStatStage?(PBStats::DEFENSE,target) &&
|
||||
!target.pbCanRaiseStatStage?(PBStats::SPEED,target)
|
||||
next if !target.pbCanLowerStatStage?(PBStats::DEFENSE, target) &&
|
||||
!target.pbCanRaiseStatStage?(PBStats::SPEED, target)
|
||||
battle.pbShowAbilitySplash(target)
|
||||
target.pbLowerStatStageByAbility(PBStats::DEFENSE,1,target,false)
|
||||
target.pbLowerStatStageByAbility(PBStats::DEFENSE, 1, target, false)
|
||||
target.pbRaiseStatStageByAbility(PBStats::SPEED,
|
||||
(NEWEST_BATTLE_MECHANICS) ? 2 : 1,target,false)
|
||||
(MECHANICS_GENERATION >= 7) ? 2 : 1, target, false)
|
||||
battle.pbHideAbilitySplash(target)
|
||||
}
|
||||
)
|
||||
@@ -2089,7 +2089,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:ANTICIPATION,
|
||||
next if m.statusMove?
|
||||
if type1
|
||||
moveType = m.type
|
||||
if NEWEST_BATTLE_MECHANICS && m.function == "090" # Hidden Power
|
||||
if MECHANICS_GENERATION >= 6 && m.function == "090" # Hidden Power
|
||||
moveType = pbHiddenPower(b.pokemon)[0]
|
||||
end
|
||||
eff = PBTypes.getCombinedEffectiveness(moveType,type1,type2,type3)
|
||||
@@ -2236,7 +2236,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:FRISK,
|
||||
end
|
||||
if foes.length>0
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
foes.each do |b|
|
||||
battle.pbDisplay(_INTL("{1} frisked {2} and found its {3}!",
|
||||
battler.pbThis,b.pbThis(true),b.itemName))
|
||||
|
||||
@@ -748,7 +748,7 @@ BattleHandlers::DamageCalcUserItem.copy(:SOFTSAND,:EARTHPLATE)
|
||||
BattleHandlers::DamageCalcUserItem.add(:SOULDEW,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
next if !user.isSpecies?(:LATIAS) && !user.isSpecies?(:LATIOS)
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if SOUL_DEW_POWERS_UP_TYPES
|
||||
mults[FINAL_DMG_MULT] *= 1.2 if type == :PSYCHIC || type == :DRAGON
|
||||
else
|
||||
if move.specialMove? && !user.battle.rules["souldewclause"]
|
||||
@@ -934,7 +934,7 @@ BattleHandlers::DamageCalcTargetItem.add(:SHUCABERRY,
|
||||
|
||||
BattleHandlers::DamageCalcTargetItem.add(:SOULDEW,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
next if NEWEST_BATTLE_MECHANICS
|
||||
next if SOUL_DEW_POWERS_UP_TYPES
|
||||
next if !target.isSpecies?(:LATIAS) && !target.isSpecies?(:LATIOS)
|
||||
if move.specialMove? && !user.battle.rules["souldewclause"]
|
||||
mults[DEF_MULT] *= 1.5
|
||||
|
||||
@@ -101,7 +101,7 @@ BallHandlers::ModifyCatchRate.add(:SAFARIBALL,proc { |ball,catchRate,battle,batt
|
||||
})
|
||||
|
||||
BallHandlers::ModifyCatchRate.add(:NETBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||
multiplier = (NEWEST_BATTLE_MECHANICS) ? 3.5 : 3
|
||||
multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 3.5 : 3
|
||||
catchRate *= multiplier if battler.pbHasType?(:BUG) || battler.pbHasType?(:WATER)
|
||||
next catchRate
|
||||
})
|
||||
@@ -112,14 +112,14 @@ BallHandlers::ModifyCatchRate.add(:DIVEBALL,proc { |ball,catchRate,battle,battle
|
||||
})
|
||||
|
||||
BallHandlers::ModifyCatchRate.add(:NESTBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||
if battler.level<=((NEWEST_BATTLE_MECHANICS) ? 29 : 30)
|
||||
catchRate *= [(41-battler.level)/10.0,1].max
|
||||
if battler.level <= 30
|
||||
catchRate *= [(41 - battler.level) / 10.0, 1].max
|
||||
end
|
||||
next catchRate
|
||||
})
|
||||
|
||||
BallHandlers::ModifyCatchRate.add(:REPEATBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||
multiplier = (NEWEST_BATTLE_MECHANICS) ? 3.5 : 3
|
||||
multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 3.5 : 3
|
||||
catchRate *= multiplier if battle.pbPlayer.owned[battler.species]
|
||||
next catchRate
|
||||
})
|
||||
@@ -131,14 +131,13 @@ BallHandlers::ModifyCatchRate.add(:TIMERBALL,proc { |ball,catchRate,battle,battl
|
||||
})
|
||||
|
||||
BallHandlers::ModifyCatchRate.add(:DUSKBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||
multiplier = (NEWEST_BATTLE_MECHANICS) ? 3 : 3.5
|
||||
multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 3 : 3.5
|
||||
catchRate *= multiplier if battle.time==2
|
||||
next catchRate
|
||||
})
|
||||
|
||||
BallHandlers::ModifyCatchRate.add(:QUICKBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||
multiplier = (NEWEST_BATTLE_MECHANICS) ? 4 : 5
|
||||
catchRate *= multiplier if battle.turnCount==0
|
||||
catchRate *= 5 if battle.turnCount==0
|
||||
next catchRate
|
||||
})
|
||||
|
||||
@@ -162,7 +161,7 @@ BallHandlers::ModifyCatchRate.add(:LEVELBALL,proc { |ball,catchRate,battle,battl
|
||||
})
|
||||
|
||||
BallHandlers::ModifyCatchRate.add(:LUREBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||
multiplier = (NEWEST_BATTLE_MECHANICS) ? 5 : 3
|
||||
multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 5 : 3
|
||||
catchRate *= multiplier if $PokemonTemp.encounterType==EncounterTypes::OldRod ||
|
||||
$PokemonTemp.encounterType==EncounterTypes::GoodRod ||
|
||||
$PokemonTemp.encounterType==EncounterTypes::SuperRod
|
||||
@@ -172,7 +171,7 @@ BallHandlers::ModifyCatchRate.add(:LUREBALL,proc { |ball,catchRate,battle,battle
|
||||
BallHandlers::ModifyCatchRate.add(:HEAVYBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||
next 0 if catchRate==0
|
||||
weight = battler.pbWeight
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if NEW_POKE_BALL_CATCH_RATES
|
||||
if weight>=3000; catchRate += 30
|
||||
elsif weight>=2000; catchRate += 20
|
||||
elsif weight<1000; catchRate -= 20
|
||||
|
||||
Reference in New Issue
Block a user