mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 21:24:59 +00:00
Coded some Gen 9 ability/item/move effects
This commit is contained in:
@@ -239,7 +239,9 @@ module GameData
|
|||||||
:DRAGONMEMORY,
|
:DRAGONMEMORY,
|
||||||
:DARKMEMORY,
|
:DARKMEMORY,
|
||||||
:FAIRYMEMORY],
|
:FAIRYMEMORY],
|
||||||
:GIRATINA => [:GRISEOUSORB],
|
:DIALGA => [:ADAMANTCRYSTAL],
|
||||||
|
:PALKIA => [:LUSTROUSGLOBE],
|
||||||
|
:GIRATINA => [:GRISEOUSORB, :GRISEOUSCORE],
|
||||||
:GENESECT => [:BURNDRIVE, :CHILLDRIVE, :DOUSEDRIVE, :SHOCKDRIVE],
|
:GENESECT => [:BURNDRIVE, :CHILLDRIVE, :DOUSEDRIVE, :SHOCKDRIVE],
|
||||||
:KYOGRE => [:BLUEORB],
|
:KYOGRE => [:BLUEORB],
|
||||||
:GROUDON => [:REDORB],
|
:GROUDON => [:REDORB],
|
||||||
@@ -247,6 +249,7 @@ module GameData
|
|||||||
:ZAMAZENTA => [:RUSTEDSHIELD],
|
:ZAMAZENTA => [:RUSTEDSHIELD],
|
||||||
:OGERPON => [:WELLSPRINGMASK, :HEARTHFLAMEMASK, :CORNERSTONEMASK]
|
:OGERPON => [:WELLSPRINGMASK, :HEARTHFLAMEMASK, :CORNERSTONEMASK]
|
||||||
}
|
}
|
||||||
|
combos[:GIRATINA].delete(:GRISEOUSORB) if Settings::MECHANICS_GENERATION >= 9
|
||||||
return combos[species]&.include?(@id)
|
return combos[species]&.include?(@id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -484,8 +484,10 @@ class Battle
|
|||||||
return allSameSideBattlers.select { |b| b.pbOwnedByPlayer? }.length
|
return allSameSideBattlers.select { |b| b.pbOwnedByPlayer? }.length
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbCheckGlobalAbility(abil)
|
def pbCheckGlobalAbility(abil, check_mold_breaker = false)
|
||||||
allBattlers.each { |b| return b if b.hasActiveAbility?(abil) }
|
allBattlers.each do |b|
|
||||||
|
return b if b.hasActiveAbility?(abil) && (!check_mold_breaker || !b.beingMoldBroken?)
|
||||||
|
end
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -497,6 +499,13 @@ class Battle
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns an array containing the IDs of all active abilities.
|
||||||
|
def pbAllActiveAbilities
|
||||||
|
ret = []
|
||||||
|
allBattlers.each { |b| ret.push(b.ability_id) if b.abilityActive? }
|
||||||
|
return ret
|
||||||
|
end
|
||||||
|
|
||||||
# Given a battler index, and using battle side sizes, returns an array of
|
# Given a battler index, and using battle side sizes, returns an array of
|
||||||
# battler indices from the opposing side that are in order of most "opposite".
|
# battler indices from the opposing side that are in order of most "opposite".
|
||||||
# Used when choosing a target and pressing up/down to move the cursor to the
|
# Used when choosing a target and pressing up/down to move the cursor to the
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ class Battle::Battler
|
|||||||
ret = (@pokemon) ? @pokemon.weight : 500
|
ret = (@pokemon) ? @pokemon.weight : 500
|
||||||
ret += @effects[PBEffects::WeightChange]
|
ret += @effects[PBEffects::WeightChange]
|
||||||
ret = 1 if ret < 1
|
ret = 1 if ret < 1
|
||||||
if abilityActive? && !@battle.moldBreaker
|
if abilityActive? && !beingMoldBroken?
|
||||||
ret = Battle::AbilityEffects.triggerWeightCalc(self.ability, self, ret)
|
ret = Battle::AbilityEffects.triggerWeightCalc(self.ability, self, ret)
|
||||||
end
|
end
|
||||||
if itemActive?
|
if itemActive?
|
||||||
@@ -382,7 +382,9 @@ class Battle::Battler
|
|||||||
:COMATOSE,
|
:COMATOSE,
|
||||||
:RKSSYSTEM
|
:RKSSYSTEM
|
||||||
]
|
]
|
||||||
return ability_blacklist.include?(abil.id)
|
return true if ability_blacklist.include?(abil.id)
|
||||||
|
return true if hasActiveItem?(:ABILITYSHIELD)
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
# Applies to gaining the ability.
|
# Applies to gaining the ability.
|
||||||
@@ -492,6 +494,11 @@ class Battle::Battler
|
|||||||
return hasActiveAbility?([:MOLDBREAKER, :TERAVOLT, :TURBOBLAZE])
|
return hasActiveAbility?([:MOLDBREAKER, :TERAVOLT, :TURBOBLAZE])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def beingMoldBroken?
|
||||||
|
return false if hasActiveItem?(:ABILITYSHIELD)
|
||||||
|
return @battle.moldBreaker
|
||||||
|
end
|
||||||
|
|
||||||
def canChangeType?
|
def canChangeType?
|
||||||
return ![:MULTITYPE, :RKSSYSTEM].include?(@ability_id)
|
return ![:MULTITYPE, :RKSSYSTEM].include?(@ability_id)
|
||||||
end
|
end
|
||||||
@@ -502,7 +509,7 @@ class Battle::Battler
|
|||||||
return false if @effects[PBEffects::SmackDown]
|
return false if @effects[PBEffects::SmackDown]
|
||||||
return false if @battle.field.effects[PBEffects::Gravity] > 0
|
return false if @battle.field.effects[PBEffects::Gravity] > 0
|
||||||
return true if pbHasType?(:FLYING)
|
return true if pbHasType?(:FLYING)
|
||||||
return true if hasActiveAbility?(:LEVITATE) && !@battle.moldBreaker
|
return true if hasActiveAbility?(:LEVITATE) && !beingMoldBroken?
|
||||||
return true if hasActiveItem?(:AIRBALLOON)
|
return true if hasActiveItem?(:AIRBALLOON)
|
||||||
return true if @effects[PBEffects::MagnetRise] > 0
|
return true if @effects[PBEffects::MagnetRise] > 0
|
||||||
return true if @effects[PBEffects::Telekinesis] > 0
|
return true if @effects[PBEffects::Telekinesis] > 0
|
||||||
@@ -571,7 +578,7 @@ class Battle::Battler
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if Settings::MECHANICS_GENERATION >= 6
|
if Settings::MECHANICS_GENERATION >= 6
|
||||||
if hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker
|
if hasActiveAbility?(:OVERCOAT) && !beingMoldBroken?
|
||||||
if showMsg
|
if showMsg
|
||||||
@battle.pbShowAbilitySplash(self)
|
@battle.pbShowAbilitySplash(self)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class Battle::Battler
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
# Uproar immunity
|
# Uproar immunity
|
||||||
if newStatus == :SLEEP && !(hasActiveAbility?(:SOUNDPROOF) && !@battle.moldBreaker)
|
if newStatus == :SLEEP && !(hasActiveAbility?(:SOUNDPROOF) && !beingMoldBroken?)
|
||||||
@battle.allBattlers.each do |b|
|
@battle.allBattlers.each do |b|
|
||||||
next if b.effects[PBEffects::Uproar] == 0
|
next if b.effects[PBEffects::Uproar] == 0
|
||||||
@battle.pbDisplay(_INTL("But the uproar kept {1} awake!", pbThis(true))) if showMessages
|
@battle.pbDisplay(_INTL("But the uproar kept {1} awake!", pbThis(true))) if showMessages
|
||||||
@@ -105,19 +105,18 @@ class Battle::Battler
|
|||||||
immAlly = nil
|
immAlly = nil
|
||||||
if Battle::AbilityEffects.triggerStatusImmunityNonIgnorable(self.ability, self, newStatus)
|
if Battle::AbilityEffects.triggerStatusImmunityNonIgnorable(self.ability, self, newStatus)
|
||||||
immuneByAbility = true
|
immuneByAbility = true
|
||||||
elsif self_inflicted || !@battle.moldBreaker
|
elsif abilityActive? && (self_inflicted || !beingMoldBroken?) &&
|
||||||
if abilityActive? && Battle::AbilityEffects.triggerStatusImmunity(self.ability, self, newStatus)
|
Battle::AbilityEffects.triggerStatusImmunity(self.ability, self, newStatus)
|
||||||
immuneByAbility = true
|
immuneByAbility = true
|
||||||
else
|
else
|
||||||
allAllies.each do |b|
|
allAllies.each do |b|
|
||||||
next if !b.abilityActive?
|
next if !b.abilityActive? || (!self_inflicted && b.beingMoldBroken?)
|
||||||
next if !Battle::AbilityEffects.triggerStatusImmunityFromAlly(b.ability, self, newStatus)
|
next if !Battle::AbilityEffects.triggerStatusImmunityFromAlly(b.ability, self, newStatus)
|
||||||
immuneByAbility = true
|
immuneByAbility = true
|
||||||
immAlly = b
|
immAlly = b
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
if immuneByAbility
|
if immuneByAbility
|
||||||
if showMessages
|
if showMessages
|
||||||
@battle.pbShowAbilitySplash(immAlly || self)
|
@battle.pbShowAbilitySplash(immAlly || self)
|
||||||
@@ -456,7 +455,7 @@ class Battle::Battler
|
|||||||
@battle.pbDisplay(_INTL("{1} surrounds itself with misty terrain!", pbThis(true))) if showMessages
|
@battle.pbDisplay(_INTL("{1} surrounds itself with misty terrain!", pbThis(true))) if showMessages
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if (selfInflicted || !@battle.moldBreaker) && hasActiveAbility?(:OWNTEMPO)
|
if (selfInflicted || !beingMoldBroken?) && hasActiveAbility?(:OWNTEMPO)
|
||||||
if showMessages
|
if showMessages
|
||||||
@battle.pbShowAbilitySplash(self)
|
@battle.pbShowAbilitySplash(self)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
@@ -516,8 +515,7 @@ class Battle::Battler
|
|||||||
@battle.pbDisplay(_INTL("{1} is unaffected!", pbThis)) if showMessages
|
@battle.pbDisplay(_INTL("{1} is unaffected!", pbThis)) if showMessages
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if !@battle.moldBreaker
|
if hasActiveAbility?([:AROMAVEIL, :OBLIVIOUS]) && !beingMoldBroken?
|
||||||
if hasActiveAbility?([:AROMAVEIL, :OBLIVIOUS])
|
|
||||||
if showMessages
|
if showMessages
|
||||||
@battle.pbShowAbilitySplash(self)
|
@battle.pbShowAbilitySplash(self)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
@@ -530,7 +528,7 @@ class Battle::Battler
|
|||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
allAllies.each do |b|
|
allAllies.each do |b|
|
||||||
next if !b.hasActiveAbility?(:AROMAVEIL)
|
next if !b.hasActiveAbility?(:AROMAVEIL) || b.beingMoldBroken?
|
||||||
if showMessages
|
if showMessages
|
||||||
@battle.pbShowAbilitySplash(b)
|
@battle.pbShowAbilitySplash(b)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
@@ -543,7 +541,6 @@ class Battle::Battler
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -569,7 +566,7 @@ class Battle::Battler
|
|||||||
# Flinching
|
# Flinching
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
def pbFlinch(_user = nil)
|
def pbFlinch(_user = nil)
|
||||||
return if hasActiveAbility?(:INNERFOCUS) && !@battle.moldBreaker
|
return if hasActiveAbility?(:INNERFOCUS) && !beingMoldBroken?
|
||||||
@effects[PBEffects::Flinch] = true
|
@effects[PBEffects::Flinch] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Battle::Battler
|
|||||||
def pbCanRaiseStatStage?(stat, user = nil, move = nil, showFailMsg = false, ignoreContrary = false)
|
def pbCanRaiseStatStage?(stat, user = nil, move = nil, showFailMsg = false, ignoreContrary = false)
|
||||||
return false if fainted?
|
return false if fainted?
|
||||||
# Contrary
|
# Contrary
|
||||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
|
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !beingMoldBroken?
|
||||||
return pbCanLowerStatStage?(stat, user, move, showFailMsg, true)
|
return pbCanLowerStatStage?(stat, user, move, showFailMsg, true)
|
||||||
end
|
end
|
||||||
# Check the stat stage
|
# Check the stat stage
|
||||||
@@ -24,7 +24,7 @@ class Battle::Battler
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbRaiseStatStageBasic(stat, increment, ignoreContrary = false)
|
def pbRaiseStatStageBasic(stat, increment, ignoreContrary = false)
|
||||||
if !@battle.moldBreaker
|
if !beingMoldBroken?
|
||||||
# Contrary
|
# Contrary
|
||||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary
|
if hasActiveAbility?(:CONTRARY) && !ignoreContrary
|
||||||
return pbLowerStatStageBasic(stat, increment, true)
|
return pbLowerStatStageBasic(stat, increment, true)
|
||||||
@@ -46,7 +46,7 @@ class Battle::Battler
|
|||||||
|
|
||||||
def pbRaiseStatStage(stat, increment, user, showAnim = true, ignoreContrary = false)
|
def pbRaiseStatStage(stat, increment, user, showAnim = true, ignoreContrary = false)
|
||||||
# Contrary
|
# Contrary
|
||||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
|
if hasActiveAbility?(:CONTRARY) && !beingMoldBroken? && !ignoreContrary
|
||||||
return pbLowerStatStage(stat, increment, user, showAnim, true)
|
return pbLowerStatStage(stat, increment, user, showAnim, true)
|
||||||
end
|
end
|
||||||
# Perform the stat stage change
|
# Perform the stat stage change
|
||||||
@@ -69,7 +69,7 @@ class Battle::Battler
|
|||||||
|
|
||||||
def pbRaiseStatStageByCause(stat, increment, user, cause, showAnim = true, ignoreContrary = false)
|
def pbRaiseStatStageByCause(stat, increment, user, cause, showAnim = true, ignoreContrary = false)
|
||||||
# Contrary
|
# Contrary
|
||||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
|
if hasActiveAbility?(:CONTRARY) && !beingMoldBroken? && !ignoreContrary
|
||||||
return pbLowerStatStageByCause(stat, increment, user, cause, showAnim, true)
|
return pbLowerStatStageByCause(stat, increment, user, cause, showAnim, true)
|
||||||
end
|
end
|
||||||
# Perform the stat stage change
|
# Perform the stat stage change
|
||||||
@@ -123,7 +123,7 @@ class Battle::Battler
|
|||||||
def pbCanLowerStatStage?(stat, user = nil, move = nil, showFailMsg = false,
|
def pbCanLowerStatStage?(stat, user = nil, move = nil, showFailMsg = false,
|
||||||
ignoreContrary = false, ignoreMirrorArmor = false)
|
ignoreContrary = false, ignoreMirrorArmor = false)
|
||||||
return false if fainted?
|
return false if fainted?
|
||||||
if !@battle.moldBreaker
|
if !beingMoldBroken?
|
||||||
# Contrary
|
# Contrary
|
||||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary
|
if hasActiveAbility?(:CONTRARY) && !ignoreContrary
|
||||||
return pbCanRaiseStatStage?(stat, user, move, showFailMsg, true)
|
return pbCanRaiseStatStage?(stat, user, move, showFailMsg, true)
|
||||||
@@ -146,21 +146,24 @@ class Battle::Battler
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if abilityActive?
|
if abilityActive?
|
||||||
return false if !@battle.moldBreaker && Battle::AbilityEffects.triggerStatLossImmunity(
|
return false if !beingMoldBroken? && Battle::AbilityEffects.triggerStatLossImmunity(
|
||||||
self.ability, self, stat, @battle, showFailMsg
|
self.ability, self, stat, @battle, showFailMsg
|
||||||
)
|
)
|
||||||
return false if Battle::AbilityEffects.triggerStatLossImmunityNonIgnorable(
|
return false if Battle::AbilityEffects.triggerStatLossImmunityNonIgnorable(
|
||||||
self.ability, self, stat, @battle, showFailMsg
|
self.ability, self, stat, @battle, showFailMsg
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
if !@battle.moldBreaker
|
|
||||||
allAllies.each do |b|
|
allAllies.each do |b|
|
||||||
next if !b.abilityActive?
|
next if !b.abilityActive? || b.beingMoldBroken?
|
||||||
return false if Battle::AbilityEffects.triggerStatLossImmunityFromAlly(
|
return false if Battle::AbilityEffects.triggerStatLossImmunityFromAlly(
|
||||||
b.ability, b, self, stat, @battle, showFailMsg
|
b.ability, b, self, stat, @battle, showFailMsg
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if user && user.index != @index # Only protects against moves/abilities of non-self
|
||||||
|
return false if itemActive? && Battle::ItemEffects.triggerStatLossImmunity(
|
||||||
|
self.item, self, stat, @battle, showFailMsg
|
||||||
|
)
|
||||||
end
|
end
|
||||||
# Check the stat stage
|
# Check the stat stage
|
||||||
if statStageAtMin?(stat)
|
if statStageAtMin?(stat)
|
||||||
@@ -174,7 +177,7 @@ class Battle::Battler
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbLowerStatStageBasic(stat, increment, ignoreContrary = false)
|
def pbLowerStatStageBasic(stat, increment, ignoreContrary = false)
|
||||||
if !@battle.moldBreaker
|
if !beingMoldBroken?
|
||||||
# Contrary
|
# Contrary
|
||||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary
|
if hasActiveAbility?(:CONTRARY) && !ignoreContrary
|
||||||
return pbRaiseStatStageBasic(stat, increment, true)
|
return pbRaiseStatStageBasic(stat, increment, true)
|
||||||
@@ -197,7 +200,7 @@ class Battle::Battler
|
|||||||
|
|
||||||
def pbLowerStatStage(stat, increment, user, showAnim = true, ignoreContrary = false,
|
def pbLowerStatStage(stat, increment, user, showAnim = true, ignoreContrary = false,
|
||||||
mirrorArmorSplash = 0, ignoreMirrorArmor = false)
|
mirrorArmorSplash = 0, ignoreMirrorArmor = false)
|
||||||
if !@battle.moldBreaker
|
if !beingMoldBroken?
|
||||||
# Contrary
|
# Contrary
|
||||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary
|
if hasActiveAbility?(:CONTRARY) && !ignoreContrary
|
||||||
return pbRaiseStatStage(stat, increment, user, showAnim, true)
|
return pbRaiseStatStage(stat, increment, user, showAnim, true)
|
||||||
@@ -239,7 +242,7 @@ class Battle::Battler
|
|||||||
|
|
||||||
def pbLowerStatStageByCause(stat, increment, user, cause, showAnim = true,
|
def pbLowerStatStageByCause(stat, increment, user, cause, showAnim = true,
|
||||||
ignoreContrary = false, ignoreMirrorArmor = false)
|
ignoreContrary = false, ignoreMirrorArmor = false)
|
||||||
if !@battle.moldBreaker
|
if !beingMoldBroken?
|
||||||
# Contrary
|
# Contrary
|
||||||
if hasActiveAbility?(:CONTRARY) && !ignoreContrary
|
if hasActiveAbility?(:CONTRARY) && !ignoreContrary
|
||||||
return pbRaiseStatStageByCause(stat, increment, user, cause, showAnim, true)
|
return pbRaiseStatStageByCause(stat, increment, user, cause, showAnim, true)
|
||||||
@@ -350,6 +353,12 @@ class Battle::Battler
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if itemActive? &&
|
||||||
|
Battle::ItemEffects.triggerStatLossImmunity(self.item, self, :ATTACK, @battle, false)
|
||||||
|
@battle.pbDisplay(_INTL("{1}'s {2} prevented {3}'s {4} from working!",
|
||||||
|
pbThis, itemName, user.pbThis(true), user.abilityName))
|
||||||
|
return false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return false if !pbCanLowerStatStage?(:ATTACK, user)
|
return false if !pbCanLowerStatStage?(:ATTACK, user)
|
||||||
return pbLowerStatStageByCause(:ATTACK, 1, user, user.abilityName)
|
return pbLowerStatStageByCause(:ATTACK, 1, user, user.abilityName)
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ class Battle::Battler
|
|||||||
magicCoater = b.index
|
magicCoater = b.index
|
||||||
b.effects[PBEffects::MagicCoat] = false
|
b.effects[PBEffects::MagicCoat] = false
|
||||||
break
|
break
|
||||||
elsif b.hasActiveAbility?(:MAGICBOUNCE) && !@battle.moldBreaker &&
|
elsif b.hasActiveAbility?(:MAGICBOUNCE) && !b.beingMoldBroken? &&
|
||||||
!b.effects[PBEffects::MagicBounce]
|
!b.effects[PBEffects::MagicBounce]
|
||||||
magicBouncer = b.index
|
magicBouncer = b.index
|
||||||
b.effects[PBEffects::MagicBounce] = true
|
b.effects[PBEffects::MagicBounce] = true
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ class Battle::Battler
|
|||||||
@battle.successStates[user.index].protected = true
|
@battle.successStates[user.index].protected = true
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if !(user.hasActiveAbility?(:UNSEENFIST) && move.contactMove?)
|
if !(user.hasActiveAbility?(:UNSEENFIST) && move.pbContactMove?(user))
|
||||||
# Wide Guard
|
# Wide Guard
|
||||||
if target.pbOwnSide.effects[PBEffects::WideGuard] && user.index != target.index &&
|
if target.pbOwnSide.effects[PBEffects::WideGuard] && user.index != target.index &&
|
||||||
move.pbTarget(user).num_targets > 1 &&
|
move.pbTarget(user).num_targets > 1 &&
|
||||||
@@ -444,7 +444,7 @@ class Battle::Battler
|
|||||||
target.effects[PBEffects::MagicCoat] = false
|
target.effects[PBEffects::MagicCoat] = false
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if target.hasActiveAbility?(:MAGICBOUNCE) && !@battle.moldBreaker &&
|
if target.hasActiveAbility?(:MAGICBOUNCE) && !target.beingMoldBroken? &&
|
||||||
!target.effects[PBEffects::MagicBounce]
|
!target.effects[PBEffects::MagicBounce]
|
||||||
target.damageState.magicBounce = true
|
target.damageState.magicBounce = true
|
||||||
target.effects[PBEffects::MagicBounce] = true
|
target.effects[PBEffects::MagicBounce] = true
|
||||||
@@ -469,7 +469,7 @@ class Battle::Battler
|
|||||||
# Airborne-based immunity to Ground moves
|
# Airborne-based immunity to Ground moves
|
||||||
if move.damagingMove? && move.calcType == :GROUND &&
|
if move.damagingMove? && move.calcType == :GROUND &&
|
||||||
target.airborne? && !move.hitsFlyingTargets?
|
target.airborne? && !move.hitsFlyingTargets?
|
||||||
if target.hasActiveAbility?(:LEVITATE) && !@battle.moldBreaker
|
if target.hasActiveAbility?(:LEVITATE) && !target.beingMoldBroken?
|
||||||
if show_message
|
if show_message
|
||||||
@battle.pbShowAbilitySplash(target)
|
@battle.pbShowAbilitySplash(target)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
@@ -502,7 +502,7 @@ class Battle::Battler
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if Settings::MECHANICS_GENERATION >= 6
|
if Settings::MECHANICS_GENERATION >= 6
|
||||||
if target.hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker
|
if target.hasActiveAbility?(:OVERCOAT) && !target.beingMoldBroken?
|
||||||
if show_message
|
if show_message
|
||||||
@battle.pbShowAbilitySplash(target)
|
@battle.pbShowAbilitySplash(target)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
|
|||||||
@@ -139,6 +139,8 @@ class Battle::Move
|
|||||||
def pulseMove?; return @flags.any? { |f| f[/^Pulse$/i] }; end
|
def pulseMove?; return @flags.any? { |f| f[/^Pulse$/i] }; end
|
||||||
def bombMove?; return @flags.any? { |f| f[/^Bomb$/i] }; end
|
def bombMove?; return @flags.any? { |f| f[/^Bomb$/i] }; end
|
||||||
def danceMove?; return @flags.any? { |f| f[/^Dance$/i] }; end
|
def danceMove?; return @flags.any? { |f| f[/^Dance$/i] }; end
|
||||||
|
def slicingMove?; return @flags.any? { |f| f[/^Slicing$/i] }; end
|
||||||
|
def windMove?; return @flags.any? { |f| f[/^Wind$/i] }; end
|
||||||
# Causes perfect accuracy and double damage if target used Minimize. Perfect accuracy only with Gen 6+ mechanics.
|
# Causes perfect accuracy and double damage if target used Minimize. Perfect accuracy only with Gen 6+ mechanics.
|
||||||
def tramplesMinimize?; return @flags.any? { |f| f[/^TramplesMinimize$/i] }; end
|
def tramplesMinimize?; return @flags.any? { |f| f[/^TramplesMinimize$/i] }; end
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ class Battle::Move
|
|||||||
|
|
||||||
def pbContactMove?(user)
|
def pbContactMove?(user)
|
||||||
return false if user.hasActiveAbility?(:LONGREACH)
|
return false if user.hasActiveAbility?(:LONGREACH)
|
||||||
|
return false if punchingMove? && user.hasActiveItem?(:PUNCHINGGLOVE)
|
||||||
return contactMove?
|
return contactMove?
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -86,9 +87,8 @@ class Battle::Move
|
|||||||
# Check if target is immune to the move because of its ability
|
# Check if target is immune to the move because of its ability
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
def pbImmunityByAbility(user, target, show_message)
|
def pbImmunityByAbility(user, target, show_message)
|
||||||
return false if @battle.moldBreaker
|
|
||||||
ret = false
|
ret = false
|
||||||
if target.abilityActive?
|
if target.abilityActive? && !target.beingMoldBroken?
|
||||||
ret = Battle::AbilityEffects.triggerMoveImmunity(target.ability, user, target,
|
ret = Battle::AbilityEffects.triggerMoveImmunity(target.ability, user, target,
|
||||||
self, @calcType, @battle, show_message)
|
self, @calcType, @battle, show_message)
|
||||||
end
|
end
|
||||||
@@ -126,8 +126,7 @@ class Battle::Move
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbMoveFailedAromaVeil?(user, target, showMessage = true)
|
def pbMoveFailedAromaVeil?(user, target, showMessage = true)
|
||||||
return false if @battle.moldBreaker
|
if target.hasActiveAbility?(:AROMAVEIL) && !target.beingMoldBroken?
|
||||||
if target.hasActiveAbility?(:AROMAVEIL)
|
|
||||||
if showMessage
|
if showMessage
|
||||||
@battle.pbShowAbilitySplash(target)
|
@battle.pbShowAbilitySplash(target)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
@@ -141,7 +140,7 @@ class Battle::Move
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
target.allAllies.each do |b|
|
target.allAllies.each do |b|
|
||||||
next if !b.hasActiveAbility?(:AROMAVEIL)
|
next if !b.hasActiveAbility?(:AROMAVEIL) || b.beingMoldBroken?
|
||||||
if showMessage
|
if showMessage
|
||||||
@battle.pbShowAbilitySplash(b)
|
@battle.pbShowAbilitySplash(b)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
@@ -168,13 +167,13 @@ class Battle::Move
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
# Ice Face will take the damage
|
# Ice Face will take the damage
|
||||||
if !@battle.moldBreaker && target.isSpecies?(:EISCUE) &&
|
if !target.beingMoldBroken? && target.isSpecies?(:EISCUE) &&
|
||||||
target.form == 0 && target.ability == :ICEFACE && physicalMove?
|
target.form == 0 && target.ability == :ICEFACE && physicalMove?
|
||||||
target.damageState.iceFace = true
|
target.damageState.iceFace = true
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
# Disguise will take the damage
|
# Disguise will take the damage
|
||||||
if !@battle.moldBreaker && target.isSpecies?(:MIMIKYU) &&
|
if !target.beingMoldBroken? && target.isSpecies?(:MIMIKYU) &&
|
||||||
target.form == 0 && target.ability == :DISGUISE
|
target.form == 0 && target.ability == :DISGUISE
|
||||||
target.damageState.disguise = true
|
target.damageState.disguise = true
|
||||||
return
|
return
|
||||||
@@ -202,7 +201,7 @@ class Battle::Move
|
|||||||
target.damageState.endured = true
|
target.damageState.endured = true
|
||||||
damage -= 1
|
damage -= 1
|
||||||
elsif damage == target.totalhp
|
elsif damage == target.totalhp
|
||||||
if target.hasActiveAbility?(:STURDY) && !@battle.moldBreaker
|
if target.hasActiveAbility?(:STURDY) && !target.beingMoldBroken?
|
||||||
target.damageState.sturdy = true
|
target.damageState.sturdy = true
|
||||||
damage -= 1
|
damage -= 1
|
||||||
elsif target.hasActiveItem?(:FOCUSSASH) && target.hp == target.totalhp
|
elsif target.hasActiveItem?(:FOCUSSASH) && target.hp == target.totalhp
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ class Battle::Move
|
|||||||
ret = Effectiveness::NORMAL_EFFECTIVE_MULTIPLIER
|
ret = Effectiveness::NORMAL_EFFECTIVE_MULTIPLIER
|
||||||
end
|
end
|
||||||
# Foresight
|
# Foresight
|
||||||
if (user.hasActiveAbility?(:SCRAPPY) || target.effects[PBEffects::Foresight]) &&
|
if (user.hasActiveAbility?(:SCRAPPY) || user.hasActiveAbility?(:MINDSEYE) ||
|
||||||
defType == :GHOST
|
target.effects[PBEffects::Foresight]) && defType == :GHOST
|
||||||
ret = Effectiveness::NORMAL_EFFECTIVE_MULTIPLIER
|
ret = Effectiveness::NORMAL_EFFECTIVE_MULTIPLIER
|
||||||
end
|
end
|
||||||
# Miracle Eye
|
# Miracle Eye
|
||||||
@@ -136,7 +136,7 @@ class Battle::Move
|
|||||||
b.ability, modifiers, user, target, self, @calcType
|
b.ability, modifiers, user, target, self, @calcType
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
if target.abilityActive? && !@battle.moldBreaker
|
if target.abilityActive? && !target.beingMoldBroken?
|
||||||
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(
|
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(
|
||||||
target.ability, modifiers, user, target, self, @calcType
|
target.ability, modifiers, user, target, self, @calcType
|
||||||
)
|
)
|
||||||
@@ -163,6 +163,7 @@ class Battle::Move
|
|||||||
end
|
end
|
||||||
modifiers[:evasion_stage] = 0 if target.effects[PBEffects::Foresight] && modifiers[:evasion_stage] > 0
|
modifiers[:evasion_stage] = 0 if target.effects[PBEffects::Foresight] && modifiers[:evasion_stage] > 0
|
||||||
modifiers[:evasion_stage] = 0 if target.effects[PBEffects::MiracleEye] && modifiers[:evasion_stage] > 0
|
modifiers[:evasion_stage] = 0 if target.effects[PBEffects::MiracleEye] && modifiers[:evasion_stage] > 0
|
||||||
|
modifiers[:evasion_stage] = 0 if user.hasActiveAbility?(:MINDSEYE)
|
||||||
end
|
end
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
@@ -182,7 +183,7 @@ class Battle::Move
|
|||||||
if c >= 0 && user.abilityActive?
|
if c >= 0 && user.abilityActive?
|
||||||
c = Battle::AbilityEffects.triggerCriticalCalcFromUser(user.ability, user, target, c)
|
c = Battle::AbilityEffects.triggerCriticalCalcFromUser(user.ability, user, target, c)
|
||||||
end
|
end
|
||||||
if c >= 0 && target.abilityActive? && !@battle.moldBreaker
|
if c >= 0 && target.abilityActive? && !target.beingMoldBroken?
|
||||||
c = Battle::AbilityEffects.triggerCriticalCalcFromTarget(target.ability, user, target, c)
|
c = Battle::AbilityEffects.triggerCriticalCalcFromTarget(target.ability, user, target, c)
|
||||||
end
|
end
|
||||||
# Item effects that alter critical hit rate
|
# Item effects that alter critical hit rate
|
||||||
@@ -253,7 +254,7 @@ class Battle::Move
|
|||||||
baseDmg = pbBaseDamage(@power, user, target)
|
baseDmg = pbBaseDamage(@power, user, target)
|
||||||
# Calculate user's attack stat
|
# Calculate user's attack stat
|
||||||
atk, atkStage = pbGetAttackStats(user, target)
|
atk, atkStage = pbGetAttackStats(user, target)
|
||||||
if !target.hasActiveAbility?(:UNAWARE) || @battle.moldBreaker
|
if !target.hasActiveAbility?(:UNAWARE) || target.beingMoldBroken?
|
||||||
atkStage = max_stage if target.damageState.critical && atkStage < max_stage
|
atkStage = max_stage if target.damageState.critical && atkStage < max_stage
|
||||||
atk = (atk.to_f * stageMul[atkStage] / stageDiv[atkStage]).floor
|
atk = (atk.to_f * stageMul[atkStage] / stageDiv[atkStage]).floor
|
||||||
end
|
end
|
||||||
@@ -282,49 +283,66 @@ class Battle::Move
|
|||||||
|
|
||||||
def pbCalcDamageMultipliers(user, target, numTargets, type, baseDmg, multipliers)
|
def pbCalcDamageMultipliers(user, target, numTargets, type, baseDmg, multipliers)
|
||||||
# Global abilities
|
# Global abilities
|
||||||
if (@battle.pbCheckGlobalAbility(:DARKAURA) && type == :DARK) ||
|
all_abilities = @battle.pbAllActiveAbilities
|
||||||
(@battle.pbCheckGlobalAbility(:FAIRYAURA) && type == :FAIRY)
|
if (all_abilities.include?(:DARKAURA) && type == :DARK) ||
|
||||||
if @battle.pbCheckGlobalAbility(:AURABREAK)
|
(all_abilities.include?(:FAIRYAURA) && type == :FAIRY)
|
||||||
|
if all_abilities.include?(:AURABREAK)
|
||||||
multipliers[:power_multiplier] *= 3 / 4.0
|
multipliers[:power_multiplier] *= 3 / 4.0
|
||||||
else
|
else
|
||||||
multipliers[:power_multiplier] *= 4 / 3.0
|
multipliers[:power_multiplier] *= 4 / 3.0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if all_abilities.include?(:TABLETSOFRUIN) && user.ability_id != :TABLETSOFRUIN
|
||||||
|
multipliers[:power_multiplier] *= 3 / 4.0 if physicalMove?
|
||||||
|
end
|
||||||
|
if all_abilities.include?(:VESSELOFRUIN) && user.ability_id != :VESSELOFRUIN
|
||||||
|
multipliers[:power_multiplier] *= 3 / 4.0 if specialMove?
|
||||||
|
end
|
||||||
|
if all_abilities.include?(:SWORDOFRUIN) && user.ability_id != :SWORDOFRUIN
|
||||||
|
if @battle.field.effects[PBEffects::WonderRoom] > 0
|
||||||
|
multipliers[:defense_multiplier] *= 3 / 4.0 if specialMove?
|
||||||
|
else
|
||||||
|
multipliers[:defense_multiplier] *= 3 / 4.0 if physicalMove?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if all_abilities.include?(:BEADSOFRUIN) && user.ability_id != :BEADSOFRUIN
|
||||||
|
if @battle.field.effects[PBEffects::WonderRoom] > 0
|
||||||
|
multipliers[:defense_multiplier] *= 3 / 4.0 if physicalMove?
|
||||||
|
else
|
||||||
|
multipliers[:defense_multiplier] *= 3 / 4.0 if specialMove?
|
||||||
|
end
|
||||||
|
end
|
||||||
# Ability effects that alter damage
|
# Ability effects that alter damage
|
||||||
if user.abilityActive?
|
if user.abilityActive?
|
||||||
Battle::AbilityEffects.triggerDamageCalcFromUser(
|
Battle::AbilityEffects.triggerDamageCalcFromUser(
|
||||||
user.ability, user, target, self, multipliers, baseDmg, type
|
user.ability, user, target, self, multipliers, baseDmg, type
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
if !@battle.moldBreaker
|
|
||||||
# NOTE: It's odd that the user's Mold Breaker prevents its partner's
|
# NOTE: It's odd that the user's Mold Breaker prevents its partner's
|
||||||
# beneficial abilities (i.e. Flower Gift boosting Atk), but that's
|
# beneficial abilities (i.e. Flower Gift boosting Atk), but that's
|
||||||
# how it works.
|
# how it works.
|
||||||
user.allAllies.each do |b|
|
user.allAllies.each do |b|
|
||||||
next if !b.abilityActive?
|
next if !b.abilityActive? || b.beingMoldBroken?
|
||||||
Battle::AbilityEffects.triggerDamageCalcFromAlly(
|
Battle::AbilityEffects.triggerDamageCalcFromAlly(
|
||||||
b.ability, user, target, self, multipliers, baseDmg, type
|
b.ability, user, target, self, multipliers, baseDmg, type
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
if target.abilityActive?
|
if target.abilityActive?
|
||||||
|
if !target.beingMoldBroken?
|
||||||
Battle::AbilityEffects.triggerDamageCalcFromTarget(
|
Battle::AbilityEffects.triggerDamageCalcFromTarget(
|
||||||
target.ability, user, target, self, multipliers, baseDmg, type
|
target.ability, user, target, self, multipliers, baseDmg, type
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
if target.abilityActive?
|
|
||||||
Battle::AbilityEffects.triggerDamageCalcFromTargetNonIgnorable(
|
Battle::AbilityEffects.triggerDamageCalcFromTargetNonIgnorable(
|
||||||
target.ability, user, target, self, multipliers, baseDmg, type
|
target.ability, user, target, self, multipliers, baseDmg, type
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
if !@battle.moldBreaker
|
|
||||||
target.allAllies.each do |b|
|
target.allAllies.each do |b|
|
||||||
next if !b.abilityActive?
|
next if !b.abilityActive? || b.beingMoldBroken?
|
||||||
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(
|
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(
|
||||||
b.ability, user, target, self, multipliers, baseDmg, type
|
b.ability, user, target, self, multipliers, baseDmg, type
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
# Item effects that alter damage
|
# Item effects that alter damage
|
||||||
if user.itemActive?
|
if user.itemActive?
|
||||||
Battle::ItemEffects.triggerDamageCalcFromUser(
|
Battle::ItemEffects.triggerDamageCalcFromUser(
|
||||||
@@ -400,14 +418,18 @@ class Battle::Move
|
|||||||
# Multi-targeting attacks
|
# Multi-targeting attacks
|
||||||
multipliers[:final_damage_multiplier] *= 0.75 if numTargets > 1
|
multipliers[:final_damage_multiplier] *= 0.75 if numTargets > 1
|
||||||
# Weather
|
# Weather
|
||||||
case user.effectiveWeather
|
case target.effectiveWeather
|
||||||
when :Sun, :HarshSun
|
when :Sun, :HarshSun
|
||||||
case type
|
case type
|
||||||
when :FIRE
|
when :FIRE
|
||||||
multipliers[:final_damage_multiplier] *= 1.5
|
multipliers[:final_damage_multiplier] *= 1.5
|
||||||
when :WATER
|
when :WATER
|
||||||
|
if @function_code == "IncreasePowerInSun" && [:Sun, :HarshSun].include?(user.effectiveWeather)
|
||||||
|
multipliers[:final_damage_multiplier] *= 1.5
|
||||||
|
else
|
||||||
multipliers[:final_damage_multiplier] /= 2
|
multipliers[:final_damage_multiplier] /= 2
|
||||||
end
|
end
|
||||||
|
end
|
||||||
when :Rain, :HeavyRain
|
when :Rain, :HeavyRain
|
||||||
case type
|
case type
|
||||||
when :FIRE
|
when :FIRE
|
||||||
@@ -487,7 +509,7 @@ class Battle::Move
|
|||||||
# Additional effect chance
|
# Additional effect chance
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
def pbAdditionalEffectChance(user, target, effectChance = 0)
|
def pbAdditionalEffectChance(user, target, effectChance = 0)
|
||||||
return 0 if target.hasActiveAbility?(:SHIELDDUST) && !@battle.moldBreaker
|
return 0 if target.hasActiveAbility?(:SHIELDDUST) && !target.beingMoldBroken?
|
||||||
ret = (effectChance > 0) ? effectChance : @addlEffect
|
ret = (effectChance > 0) ? effectChance : @addlEffect
|
||||||
return ret if ret > 100
|
return ret if ret > 100
|
||||||
if (Settings::MECHANICS_GENERATION >= 6 || @function_code != "EffectDependsOnEnvironment") &&
|
if (Settings::MECHANICS_GENERATION >= 6 || @function_code != "EffectDependsOnEnvironment") &&
|
||||||
@@ -502,7 +524,7 @@ class Battle::Move
|
|||||||
# not here.
|
# not here.
|
||||||
def pbFlinchChance(user, target)
|
def pbFlinchChance(user, target)
|
||||||
return 0 if flinchingMove?
|
return 0 if flinchingMove?
|
||||||
return 0 if target.hasActiveAbility?(:SHIELDDUST) && !@battle.moldBreaker
|
return 0 if target.hasActiveAbility?(:SHIELDDUST) && !target.beingMoldBroken?
|
||||||
ret = 0
|
ret = 0
|
||||||
if user.hasActiveAbility?(:STENCH, true) ||
|
if user.hasActiveAbility?(:STENCH, true) ||
|
||||||
user.hasActiveItem?([:KINGSROCK, :RAZORFANG], true)
|
user.hasActiveItem?([:KINGSROCK, :RAZORFANG], true)
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ class Battle::Move::TargetMultiStatDownMove < Battle::Move
|
|||||||
# NOTE: It's a bit of a faff to make sure the appropriate failure message
|
# NOTE: It's a bit of a faff to make sure the appropriate failure message
|
||||||
# is shown here, I know.
|
# is shown here, I know.
|
||||||
canLower = false
|
canLower = false
|
||||||
if target.hasActiveAbility?(:CONTRARY) && !@battle.moldBreaker
|
if target.hasActiveAbility?(:CONTRARY) && !target.beingMoldBroken?
|
||||||
(@statDown.length / 2).times do |i|
|
(@statDown.length / 2).times do |i|
|
||||||
next if target.statStageAtMax?(@statDown[i * 2])
|
next if target.statStageAtMax?(@statDown[i * 2])
|
||||||
canLower = true
|
canLower = true
|
||||||
|
|||||||
@@ -342,19 +342,16 @@ class Battle::Move::StartPsychicTerrain < Battle::Move
|
|||||||
end
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Removes the current terrain. Fails if there is no terrain in effect.
|
# Removes the current terrain. (Ice Spinner)
|
||||||
# (Steel Roller)
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class Battle::Move::RemoveTerrain < Battle::Move
|
class Battle::Move::RemoveTerrain < Battle::Move
|
||||||
def pbMoveFailed?(user, targets)
|
# NOTE: Bulbapedia claims that Ice Spinner shouldn't remove terrain if the
|
||||||
if @battle.field.terrain == :None
|
# user faints because of its Life Orb or is switched out by Red Card.
|
||||||
@battle.pbDisplay(_INTL("But it failed!"))
|
# I can't find any evidence of this. Also, those items trigger at the
|
||||||
return true
|
# very end of a move's use, way after move effects usually happen. I'm
|
||||||
end
|
# treating Bulbapedia's claim as a mistake and ignoring it.
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
def pbEffectGeneral(user)
|
def pbEffectGeneral(user)
|
||||||
|
return if user.fainted?
|
||||||
case @battle.field.terrain
|
case @battle.field.terrain
|
||||||
when :Electric
|
when :Electric
|
||||||
@battle.pbDisplay(_INTL("The electricity disappeared from the battlefield."))
|
@battle.pbDisplay(_INTL("The electricity disappeared from the battlefield."))
|
||||||
@@ -369,6 +366,20 @@ class Battle::Move::RemoveTerrain < Battle::Move
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Removes the current terrain. Fails if there is no terrain in effect.
|
||||||
|
# (Steel Roller)
|
||||||
|
#===============================================================================
|
||||||
|
class Battle::Move::RemoveTerrainFailsIfNoTerrain < Battle::Move::RemoveTerrain
|
||||||
|
def pbMoveFailed?(user, targets)
|
||||||
|
if @battle.field.terrain == :None
|
||||||
|
@battle.pbDisplay(_INTL("But it failed!"))
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Entry hazard. Lays spikes on the opposing side (max. 3 layers). (Spikes)
|
# Entry hazard. Lays spikes on the opposing side (max. 3 layers). (Spikes)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|||||||
@@ -387,6 +387,16 @@ class Battle::Move::RaiseUserAtkDef1 < Battle::Move::MultiStatUpMove
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Increases the user's Attack, Defense and Speed by 1 stage each. (Victory Dance)
|
||||||
|
#===============================================================================
|
||||||
|
class Battle::Move::RaiseUserAtkDefSpd1 < Battle::Move::MultiStatUpMove
|
||||||
|
def initialize(battle, move)
|
||||||
|
super
|
||||||
|
@statUp = [:ATTACK, 1, :DEFENSE, 1, :SPEED, 1]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Increases the user's Attack, Defense and accuracy by 1 stage each. (Coil)
|
# Increases the user's Attack, Defense and accuracy by 1 stage each. (Coil)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
@@ -1037,7 +1047,7 @@ class Battle::Move::LowerTargetSpAtk2IfCanAttract < Battle::Move::TargetStatDown
|
|||||||
@battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis)) if show_message
|
@battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis)) if show_message
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
if target.hasActiveAbility?(:OBLIVIOUS) && !@battle.moldBreaker
|
if target.hasActiveAbility?(:OBLIVIOUS) && !target.beingMoldBroken?
|
||||||
if show_message
|
if show_message
|
||||||
@battle.pbShowAbilitySplash(target)
|
@battle.pbShowAbilitySplash(target)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
@@ -1054,7 +1064,7 @@ class Battle::Move::LowerTargetSpAtk2IfCanAttract < Battle::Move::TargetStatDown
|
|||||||
|
|
||||||
def pbAdditionalEffect(user, target)
|
def pbAdditionalEffect(user, target)
|
||||||
return if user.gender == 2 || target.gender == 2 || user.gender == target.gender
|
return if user.gender == 2 || target.gender == 2 || user.gender == target.gender
|
||||||
return if target.hasActiveAbility?(:OBLIVIOUS) && !@battle.moldBreaker
|
return if target.hasActiveAbility?(:OBLIVIOUS) && !target.beingMoldBroken?
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1109,6 +1119,17 @@ class Battle::Move::LowerTargetSpeed1 < Battle::Move::TargetStatDownMove
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Decreases the target's Speed by 1 stage. Accuracy perfect in rain.
|
||||||
|
# (Bleakwind Storm)
|
||||||
|
#===============================================================================
|
||||||
|
class Battle::Move::LowerTargetSpeed1AlwaysHitsInRain < Battle::Move::LowerTargetSpeed1
|
||||||
|
def pbBaseAccuracy(user, target)
|
||||||
|
return 0 if [:Rain, :HeavyRain].include?(target.effectiveWeather)
|
||||||
|
return super
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Decreases the target's Speed by 1 stage. Power is halved in Grassy Terrain.
|
# Decreases the target's Speed by 1 stage. Power is halved in Grassy Terrain.
|
||||||
# (Bulldoze)
|
# (Bulldoze)
|
||||||
@@ -1932,6 +1953,9 @@ class Battle::Move::StartUserSideDoubleSpeed < Battle::Move
|
|||||||
def pbEffectGeneral(user)
|
def pbEffectGeneral(user)
|
||||||
user.pbOwnSide.effects[PBEffects::Tailwind] = 4
|
user.pbOwnSide.effects[PBEffects::Tailwind] = 4
|
||||||
@battle.pbDisplay(_INTL("The Tailwind blew from behind {1}!", user.pbTeam(true)))
|
@battle.pbDisplay(_INTL("The Tailwind blew from behind {1}!", user.pbTeam(true)))
|
||||||
|
@battle.allSameSideBattlers(user).each do |b|
|
||||||
|
pbRaiseStatStageByAbility(:ATTACK, 1, b) if b.hasActiveAbility?(:WINDRIDER)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -176,6 +176,16 @@ class Battle::Move::ParalyzeTargetIfNotTypeImmune < Battle::Move::ParalyzeTarget
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Paralyzes the target. Accuracy perfect in rain. (Wildbolt Storm)
|
||||||
|
#===============================================================================
|
||||||
|
class Battle::Move::ParalyzeTargetAlwaysHitsInRain < Battle::Move::ParalyzeTarget
|
||||||
|
def pbBaseAccuracy(user, target)
|
||||||
|
return 0 if [:Rain, :HeavyRain].include?(target.effectiveWeather)
|
||||||
|
return super
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Paralyzes the target. Accuracy perfect in rain, 50% in sunshine. Hits some
|
# Paralyzes the target. Accuracy perfect in rain, 50% in sunshine. Hits some
|
||||||
# semi-invulnerable targets. (Thunder)
|
# semi-invulnerable targets. (Thunder)
|
||||||
@@ -233,6 +243,16 @@ class Battle::Move::BurnTarget < Battle::Move
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Burns the target. Accuracy perfect in rain. (Sandsear Storm)
|
||||||
|
#===============================================================================
|
||||||
|
class Battle::Move::BurnTargetAlwaysHitsInRain < Battle::Move::BurnTarget
|
||||||
|
def pbBaseAccuracy(user, target)
|
||||||
|
return 0 if [:Rain, :HeavyRain].include?(target.effectiveWeather)
|
||||||
|
return super
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Burns the target if any of its stats were increased this round.
|
# Burns the target if any of its stats were increased this round.
|
||||||
# (Burning Jealousy)
|
# (Burning Jealousy)
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class Battle::Move::OHKO < Battle::Move::FixedDamageMove
|
|||||||
@battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis)) if show_message
|
@battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis)) if show_message
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
if target.hasActiveAbility?(:STURDY) && !@battle.moldBreaker
|
if target.hasActiveAbility?(:STURDY) && !target.beingMoldBroken?
|
||||||
if show_message
|
if show_message
|
||||||
@battle.pbShowAbilitySplash(target)
|
@battle.pbShowAbilitySplash(target)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
@@ -190,10 +190,19 @@ class Battle::Move::PowerLowerWithUserHP < Battle::Move
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Power increases with the target's HP. (Hard Press)
|
||||||
|
#===============================================================================
|
||||||
|
class Battle::Move::PowerHigherWithTargetHP100 < Battle::Move
|
||||||
|
def pbBaseDamage(baseDmg, user, target)
|
||||||
|
return [100 * target.hp / target.totalhp, 1].max
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Power increases with the target's HP. (Crush Grip, Wring Out)
|
# Power increases with the target's HP. (Crush Grip, Wring Out)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
class Battle::Move::PowerHigherWithTargetHP < Battle::Move
|
class Battle::Move::PowerHigherWithTargetHP120 < Battle::Move
|
||||||
def pbBaseDamage(baseDmg, user, target)
|
def pbBaseDamage(baseDmg, user, target)
|
||||||
return [120 * target.hp / target.totalhp, 1].max
|
return [120 * target.hp / target.totalhp, 1].max
|
||||||
end
|
end
|
||||||
@@ -395,6 +404,23 @@ class Battle::Move::RandomPowerDoublePowerIfTargetUnderground < Battle::Move
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Power is increased by 50% in sunny weather. (Hydro Steam)
|
||||||
|
#===============================================================================
|
||||||
|
class Battle::Move::IncreasePowerInSun < Battle::Move
|
||||||
|
# NOTE: No code needed here. Effect is coded in def pbCalcDamageMultipliers.
|
||||||
|
end
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# Power is increased by 50% if Electric Terrain applies. (Psyblade)
|
||||||
|
#===============================================================================
|
||||||
|
class Battle::Move::IncreasePowerInElectricTerrain < Battle::Move
|
||||||
|
def pbBaseDamage(baseDmg, user, target)
|
||||||
|
baseDmg = (baseDmg * 1.5).floor if @battle.field.terrain == :Electric && target.affectedByTerrain?
|
||||||
|
return baseDmg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Power is doubled if the target's HP is down to 1/2 or less. (Brine)
|
# Power is doubled if the target's HP is down to 1/2 or less. (Brine)
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
@@ -1090,6 +1116,15 @@ class Battle::Move::RecoilHalfOfDamageDealt < Battle::Move::RecoilMove
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# User takes recoil damage equal to 1/2 of is maximum HP. (Chloroblast)
|
||||||
|
#===============================================================================
|
||||||
|
class Battle::Move::RecoilHalfOfTotalHP < Battle::Move::RecoilMove
|
||||||
|
def pbRecoilDamage(user, target)
|
||||||
|
return (user.totalhp / 2.0).round
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# Type effectiveness is multiplied by the Flying-type's effectiveness against
|
# Type effectiveness is multiplied by the Flying-type's effectiveness against
|
||||||
# the target. (Flying Press)
|
# the target. (Flying Press)
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class Battle::Move::HitThreeTimesPowersUpWithEachHit < Battle::Move
|
|||||||
|
|
||||||
def pbOnStartUse(user, targets)
|
def pbOnStartUse(user, targets)
|
||||||
@calcBaseDmg = 0
|
@calcBaseDmg = 0
|
||||||
@accCheckPerHit = !user.hasActiveAbility?(:SKILLLINK)
|
@accCheckPerHit = !user.hasActiveAbility?(:SKILLLINK) && !user.hasActiveItem?(:LOADEDDICE)
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbBaseDamage(baseDmg, user, target)
|
def pbBaseDamage(baseDmg, user, target)
|
||||||
@@ -110,6 +110,7 @@ class Battle::Move::HitTwoToFiveTimes < Battle::Move
|
|||||||
]
|
]
|
||||||
r = @battle.pbRandom(hitChances.length)
|
r = @battle.pbRandom(hitChances.length)
|
||||||
r = hitChances.length - 1 if user.hasActiveAbility?(:SKILLLINK)
|
r = hitChances.length - 1 if user.hasActiveAbility?(:SKILLLINK)
|
||||||
|
r = 4 if r < 4 && user.hasActiveItem?(:LOADEDDICE)
|
||||||
return hitChances[r]
|
return hitChances[r]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ class Battle::Move::HealUserByTargetAttackLowerTargetAttack1 < Battle::Move
|
|||||||
# has Contrary and is at +6" check too for symmetry. This move still
|
# has Contrary and is at +6" check too for symmetry. This move still
|
||||||
# works even if the stat stage cannot be changed due to an ability or
|
# works even if the stat stage cannot be changed due to an ability or
|
||||||
# other effect.
|
# other effect.
|
||||||
if !@battle.moldBreaker && target.hasActiveAbility?(:CONTRARY)
|
if target.hasActiveAbility?(:CONTRARY) && !target.beingMoldBroken?
|
||||||
if target.statStageAtMax?(@statDown[0])
|
if target.statStageAtMax?(@statDown[0])
|
||||||
@battle.pbDisplay(_INTL("But it failed!")) if show_message
|
@battle.pbDisplay(_INTL("But it failed!")) if show_message
|
||||||
return true
|
return true
|
||||||
@@ -469,8 +469,7 @@ class Battle::Move::UserLosesHalfOfTotalHPExplosive < Battle::Move
|
|||||||
def worksWithNoTargets?; return true; end
|
def worksWithNoTargets?; return true; end
|
||||||
|
|
||||||
def pbMoveFailed?(user, targets)
|
def pbMoveFailed?(user, targets)
|
||||||
if !@battle.moldBreaker
|
bearer = @battle.pbCheckGlobalAbility(:DAMP, true)
|
||||||
bearer = @battle.pbCheckGlobalAbility(:DAMP)
|
|
||||||
if bearer
|
if bearer
|
||||||
@battle.pbShowAbilitySplash(bearer)
|
@battle.pbShowAbilitySplash(bearer)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
@@ -482,7 +481,6 @@ class Battle::Move::UserLosesHalfOfTotalHPExplosive < Battle::Move
|
|||||||
@battle.pbHideAbilitySplash(bearer)
|
@battle.pbHideAbilitySplash(bearer)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -501,8 +499,7 @@ class Battle::Move::UserFaintsExplosive < Battle::Move
|
|||||||
def pbNumHits(user, targets); return 1; end
|
def pbNumHits(user, targets); return 1; end
|
||||||
|
|
||||||
def pbMoveFailed?(user, targets)
|
def pbMoveFailed?(user, targets)
|
||||||
if !@battle.moldBreaker
|
bearer = @battle.pbCheckGlobalAbility(:DAMP, true)
|
||||||
bearer = @battle.pbCheckGlobalAbility(:DAMP)
|
|
||||||
if bearer
|
if bearer
|
||||||
@battle.pbShowAbilitySplash(bearer)
|
@battle.pbShowAbilitySplash(bearer)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
@@ -514,7 +511,6 @@ class Battle::Move::UserFaintsExplosive < Battle::Move
|
|||||||
@battle.pbHideAbilitySplash(bearer)
|
@battle.pbHideAbilitySplash(bearer)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class Battle::Move::UserTakesTargetItem < Battle::Move
|
|||||||
return if !target.item || user.item
|
return if !target.item || user.item
|
||||||
return if target.unlosableItem?(target.item)
|
return if target.unlosableItem?(target.item)
|
||||||
return if user.unlosableItem?(target.item)
|
return if user.unlosableItem?(target.item)
|
||||||
return if target.hasActiveAbility?(:STICKYHOLD) && !@battle.moldBreaker
|
return if target.hasActiveAbility?(:STICKYHOLD) && !target.beingMoldBroken?
|
||||||
itemName = target.itemName
|
itemName = target.itemName
|
||||||
user.item = target.item
|
user.item = target.item
|
||||||
# Permanently steal the item from wild Pokémon
|
# Permanently steal the item from wild Pokémon
|
||||||
@@ -91,7 +91,7 @@ class Battle::Move::UserTargetSwapItems < Battle::Move
|
|||||||
@battle.pbDisplay(_INTL("But it failed!")) if show_message
|
@battle.pbDisplay(_INTL("But it failed!")) if show_message
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
if target.hasActiveAbility?(:STICKYHOLD) && !@battle.moldBreaker
|
if target.hasActiveAbility?(:STICKYHOLD) && !target.beingMoldBroken?
|
||||||
if show_message
|
if show_message
|
||||||
@battle.pbShowAbilitySplash(target)
|
@battle.pbShowAbilitySplash(target)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
@@ -181,7 +181,7 @@ class Battle::Move::RemoveTargetItem < Battle::Move
|
|||||||
return if user.fainted?
|
return if user.fainted?
|
||||||
return if target.damageState.unaffected || target.damageState.substitute
|
return if target.damageState.unaffected || target.damageState.substitute
|
||||||
return if !target.item || target.unlosableItem?(target.item)
|
return if !target.item || target.unlosableItem?(target.item)
|
||||||
return if target.hasActiveAbility?(:STICKYHOLD) && !@battle.moldBreaker
|
return if target.hasActiveAbility?(:STICKYHOLD) && !target.beingMoldBroken?
|
||||||
itemName = target.itemName
|
itemName = target.itemName
|
||||||
target.pbRemoveItem(false)
|
target.pbRemoveItem(false)
|
||||||
@battle.pbDisplay(_INTL("{1} dropped its {2}!", target.pbThis, itemName))
|
@battle.pbDisplay(_INTL("{1} dropped its {2}!", target.pbThis, itemName))
|
||||||
@@ -197,7 +197,7 @@ class Battle::Move::DestroyTargetBerryOrGem < Battle::Move
|
|||||||
return if !target.item || (!target.item.is_berry? &&
|
return if !target.item || (!target.item.is_berry? &&
|
||||||
!(Settings::MECHANICS_GENERATION >= 6 && target.item.is_gem?))
|
!(Settings::MECHANICS_GENERATION >= 6 && target.item.is_gem?))
|
||||||
return if target.unlosableItem?(target.item)
|
return if target.unlosableItem?(target.item)
|
||||||
return if target.hasActiveAbility?(:STICKYHOLD) && !@battle.moldBreaker
|
return if target.hasActiveAbility?(:STICKYHOLD) && !target.beingMoldBroken?
|
||||||
item_name = target.itemName
|
item_name = target.itemName
|
||||||
target.pbRemoveItem
|
target.pbRemoveItem
|
||||||
@battle.pbDisplay(_INTL("{1}'s {2} was incinerated!", target.pbThis, item_name))
|
@battle.pbDisplay(_INTL("{1}'s {2} was incinerated!", target.pbThis, item_name))
|
||||||
@@ -219,7 +219,7 @@ class Battle::Move::CorrodeTargetItem < Battle::Move
|
|||||||
@battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis)) if show_message
|
@battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis)) if show_message
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
if target.hasActiveAbility?(:STICKYHOLD) && !@battle.moldBreaker
|
if target.hasActiveAbility?(:STICKYHOLD) && !target.beingMoldBroken?
|
||||||
if show_message
|
if show_message
|
||||||
@battle.pbShowAbilitySplash(target)
|
@battle.pbShowAbilitySplash(target)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
@@ -386,7 +386,7 @@ class Battle::Move::UserConsumeTargetBerry < Battle::Move
|
|||||||
return if user.fainted? || target.fainted?
|
return if user.fainted? || target.fainted?
|
||||||
return if target.damageState.unaffected || target.damageState.substitute
|
return if target.damageState.unaffected || target.damageState.substitute
|
||||||
return if !target.item || !target.item.is_berry? || target.unlosableItem?(target.item)
|
return if !target.item || !target.item.is_berry? || target.unlosableItem?(target.item)
|
||||||
return if target.hasActiveAbility?(:STICKYHOLD) && !@battle.moldBreaker
|
return if target.hasActiveAbility?(:STICKYHOLD) && !target.beingMoldBroken?
|
||||||
item = target.item
|
item = target.item
|
||||||
itemName = target.itemName
|
itemName = target.itemName
|
||||||
user.setBelched
|
user.setBelched
|
||||||
@@ -438,7 +438,7 @@ class Battle::Move::ThrowUserItemAtTarget < Battle::Move
|
|||||||
|
|
||||||
def pbEffectAgainstTarget(user, target)
|
def pbEffectAgainstTarget(user, target)
|
||||||
return if target.damageState.substitute
|
return if target.damageState.substitute
|
||||||
return if target.hasActiveAbility?(:SHIELDDUST) && !@battle.moldBreaker
|
return if target.hasActiveAbility?(:SHIELDDUST) && !target.beingMoldBroken?
|
||||||
case user.item_id
|
case user.item_id
|
||||||
when :POISONBARB
|
when :POISONBARB
|
||||||
target.pbPoison(user) if target.pbCanPoison?(user, false, self)
|
target.pbPoison(user) if target.pbCanPoison?(user, false, self)
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ class Battle::Move::SwitchOutTargetStatusMove < Battle::Move
|
|||||||
def canMagicCoat?; return true; end
|
def canMagicCoat?; return true; end
|
||||||
|
|
||||||
def pbFailsAgainstTarget?(user, target, show_message)
|
def pbFailsAgainstTarget?(user, target, show_message)
|
||||||
if target.hasActiveAbility?(:SUCTIONCUPS) && !@battle.moldBreaker
|
if target.hasActiveAbility?(:SUCTIONCUPS) && !target.beingMoldBroken?
|
||||||
if show_message
|
if show_message
|
||||||
@battle.pbShowAbilitySplash(target)
|
@battle.pbShowAbilitySplash(target)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
@@ -206,7 +206,7 @@ class Battle::Move::SwitchOutTargetStatusMove < Battle::Move
|
|||||||
next if b.fainted? || b.damageState.unaffected
|
next if b.fainted? || b.damageState.unaffected
|
||||||
next if b.wild?
|
next if b.wild?
|
||||||
next if b.effects[PBEffects::Ingrain]
|
next if b.effects[PBEffects::Ingrain]
|
||||||
next if b.hasActiveAbility?(:SUCTIONCUPS) && !@battle.moldBreaker
|
next if b.hasActiveAbility?(:SUCTIONCUPS) && !b.beingMoldBroken?
|
||||||
newPkmn = @battle.pbGetReplacementPokemonIndex(b.index, true) # Random
|
newPkmn = @battle.pbGetReplacementPokemonIndex(b.index, true) # Random
|
||||||
next if newPkmn < 0
|
next if newPkmn < 0
|
||||||
@battle.pbRecallAndReplace(b.index, newPkmn, true)
|
@battle.pbRecallAndReplace(b.index, newPkmn, true)
|
||||||
@@ -241,7 +241,7 @@ class Battle::Move::SwitchOutTargetDamagingMove < Battle::Move
|
|||||||
next if b.fainted? || b.damageState.unaffected || b.damageState.substitute
|
next if b.fainted? || b.damageState.unaffected || b.damageState.substitute
|
||||||
next if b.wild?
|
next if b.wild?
|
||||||
next if b.effects[PBEffects::Ingrain]
|
next if b.effects[PBEffects::Ingrain]
|
||||||
next if b.hasActiveAbility?(:SUCTIONCUPS) && !@battle.moldBreaker
|
next if b.hasActiveAbility?(:SUCTIONCUPS) && !b.beingMoldBroken?
|
||||||
newPkmn = @battle.pbGetReplacementPokemonIndex(b.index, true) # Random
|
newPkmn = @battle.pbGetReplacementPokemonIndex(b.index, true) # Random
|
||||||
next if newPkmn < 0
|
next if newPkmn < 0
|
||||||
@battle.pbRecallAndReplace(b.index, newPkmn, true)
|
@battle.pbRecallAndReplace(b.index, newPkmn, true)
|
||||||
@@ -868,7 +868,7 @@ class Battle::Move::DisableTargetStatusMoves < Battle::Move
|
|||||||
end
|
end
|
||||||
return true if pbMoveFailedAromaVeil?(user, target, show_message)
|
return true if pbMoveFailedAromaVeil?(user, target, show_message)
|
||||||
if Settings::MECHANICS_GENERATION >= 6 && target.hasActiveAbility?(:OBLIVIOUS) &&
|
if Settings::MECHANICS_GENERATION >= 6 && target.hasActiveAbility?(:OBLIVIOUS) &&
|
||||||
!@battle.moldBreaker
|
!target.beingMoldBroken?
|
||||||
if show_message
|
if show_message
|
||||||
@battle.pbShowAbilitySplash(target)
|
@battle.pbShowAbilitySplash(target)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class Battle::AI
|
|||||||
desire_mult = -1
|
desire_mult = -1
|
||||||
end
|
end
|
||||||
# If target has Contrary, use different calculations to score the stat change
|
# If target has Contrary, use different calculations to score the stat change
|
||||||
if !ignore_contrary && !fixed_change && !@battle.moldBreaker && target.has_active_ability?(:CONTRARY)
|
if !ignore_contrary && !fixed_change && target.has_active_ability?(:CONTRARY) && !target.being_mold_broken?
|
||||||
if desire_mult > 0 && whole_effect
|
if desire_mult > 0 && whole_effect
|
||||||
PBDebug.log_score_change(MOVE_USELESS_SCORE - score, "don't prefer raising target's stats (it has Contrary)")
|
PBDebug.log_score_change(MOVE_USELESS_SCORE - score, "don't prefer raising target's stats (it has Contrary)")
|
||||||
return MOVE_USELESS_SCORE
|
return MOVE_USELESS_SCORE
|
||||||
@@ -62,7 +62,7 @@ class Battle::AI
|
|||||||
end
|
end
|
||||||
# Calculate amount that stat will be raised by
|
# Calculate amount that stat will be raised by
|
||||||
increment = stat_changes[idx + 1]
|
increment = stat_changes[idx + 1]
|
||||||
increment *= 2 if !fixed_change && !@battle.moldBreaker && target.has_active_ability?(:SIMPLE)
|
increment *= 2 if !fixed_change && target.has_active_ability?(:SIMPLE) && !target.being_mold_broken?
|
||||||
increment = [increment, Battle::Battler::STAT_STAGE_MAXIMUM - target.stages[stat]].min # The actual stages gained
|
increment = [increment, Battle::Battler::STAT_STAGE_MAXIMUM - target.stages[stat]].min # The actual stages gained
|
||||||
# Count this as a valid stat raise
|
# Count this as a valid stat raise
|
||||||
real_stat_changes.push([stat, increment]) if increment > 0
|
real_stat_changes.push([stat, increment]) if increment > 0
|
||||||
@@ -324,7 +324,7 @@ class Battle::AI
|
|||||||
desire_mult = 1
|
desire_mult = 1
|
||||||
end
|
end
|
||||||
# If target has Contrary, use different calculations to score the stat change
|
# If target has Contrary, use different calculations to score the stat change
|
||||||
if !ignore_contrary && !fixed_change && !@battle.moldBreaker && target.has_active_ability?(:CONTRARY)
|
if !ignore_contrary && !fixed_change && target.has_active_ability?(:CONTRARY) && !target.being_mold_broken?
|
||||||
if desire_mult > 0 && whole_effect
|
if desire_mult > 0 && whole_effect
|
||||||
PBDebug.log_score_change(MOVE_USELESS_SCORE - score, "don't prefer lowering target's stats (it has Contrary)")
|
PBDebug.log_score_change(MOVE_USELESS_SCORE - score, "don't prefer lowering target's stats (it has Contrary)")
|
||||||
return MOVE_USELESS_SCORE
|
return MOVE_USELESS_SCORE
|
||||||
@@ -366,7 +366,7 @@ class Battle::AI
|
|||||||
end
|
end
|
||||||
# Calculate amount that stat will be lowered by
|
# Calculate amount that stat will be lowered by
|
||||||
decrement = stat_changes[idx + 1]
|
decrement = stat_changes[idx + 1]
|
||||||
decrement *= 2 if !fixed_change && !@battle.moldBreaker && target.has_active_ability?(:SIMPLE)
|
decrement *= 2 if !fixed_change && target.has_active_ability?(:SIMPLE) && !target.being_mold_broken?
|
||||||
decrement = [decrement, Battle::Battler::STAT_STAGE_MAXIMUM + target.stages[stat]].min # The actual stages lost
|
decrement = [decrement, Battle::Battler::STAT_STAGE_MAXIMUM + target.stages[stat]].min # The actual stages lost
|
||||||
# Count this as a valid stat drop
|
# Count this as a valid stat drop
|
||||||
real_stat_changes.push([stat, decrement]) if decrement > 0
|
real_stat_changes.push([stat, decrement]) if decrement > 0
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ Battle::AI::Handlers::GeneralMoveAgainstTargetScore.add(:target_can_Magic_Coat_o
|
|||||||
if move.statusMove? && move.move.canMagicCoat? && target.opposes?(user) &&
|
if move.statusMove? && move.move.canMagicCoat? && target.opposes?(user) &&
|
||||||
(target.faster_than?(user) || !target.battler.semiInvulnerable?)
|
(target.faster_than?(user) || !target.battler.semiInvulnerable?)
|
||||||
old_score = score
|
old_score = score
|
||||||
if !battle.moldBreaker && target.has_active_ability?(:MAGICBOUNCE)
|
if target.has_active_ability?(:MAGICBOUNCE) && !target.being_mold_broken?
|
||||||
score = Battle::AI::MOVE_USELESS_SCORE
|
score = Battle::AI::MOVE_USELESS_SCORE
|
||||||
PBDebug.log_score_change(score - old_score, "useless because target will Magic Bounce it")
|
PBDebug.log_score_change(score - old_score, "useless because target will Magic Bounce it")
|
||||||
elsif target.has_move_with_function?("BounceBackProblemCausingStatusMoves") &&
|
elsif target.has_move_with_function?("BounceBackProblemCausingStatusMoves") &&
|
||||||
@@ -108,7 +108,7 @@ Battle::AI::Handlers::GeneralMoveScore.add(:any_foe_can_Magic_Coat_or_Bounce_mov
|
|||||||
old_score = score
|
old_score = score
|
||||||
ai.each_foe_battler(user.side) do |b, i|
|
ai.each_foe_battler(user.side) do |b, i|
|
||||||
next if user.faster_than?(b) && b.battler.semiInvulnerable?
|
next if user.faster_than?(b) && b.battler.semiInvulnerable?
|
||||||
if b.has_active_ability?(:MAGICBOUNCE) && !battle.moldBreaker
|
if b.has_active_ability?(:MAGICBOUNCE) && !b.being_mold_broken?
|
||||||
score = Battle::AI::MOVE_USELESS_SCORE
|
score = Battle::AI::MOVE_USELESS_SCORE
|
||||||
PBDebug.log_score_change(score - old_score, "useless because a foe will Magic Bounce it")
|
PBDebug.log_score_change(score - old_score, "useless because a foe will Magic Bounce it")
|
||||||
break
|
break
|
||||||
@@ -336,7 +336,7 @@ Battle::AI::Handlers::GeneralMoveAgainstTargetScore.add(:external_flinching_effe
|
|||||||
user.faster_than?(target) && target.effects[PBEffects::Substitute] == 0
|
user.faster_than?(target) && target.effects[PBEffects::Substitute] == 0
|
||||||
if user.has_active_item?([:KINGSROCK, :RAZORFANG]) ||
|
if user.has_active_item?([:KINGSROCK, :RAZORFANG]) ||
|
||||||
user.has_active_ability?(:STENCH)
|
user.has_active_ability?(:STENCH)
|
||||||
if battle.moldBreaker || !target.has_active_ability?([:INNERFOCUS, :SHIELDDUST])
|
if !target.has_active_ability?([:INNERFOCUS, :SHIELDDUST]) || target.being_mold_broken?
|
||||||
old_score = score
|
old_score = score
|
||||||
score += 8
|
score += 8
|
||||||
score += 5 if move.move.multiHitMove?
|
score += 5 if move.move.multiHitMove?
|
||||||
|
|||||||
@@ -274,6 +274,10 @@ class Battle::AI::AIBattler
|
|||||||
return battler.hasMoldBreaker?
|
return battler.hasMoldBreaker?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def being_mold_broken?
|
||||||
|
return battler.beingMoldBroken?
|
||||||
|
end
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
def item_id; return battler.item_id; end
|
def item_id; return battler.item_id; end
|
||||||
|
|||||||
@@ -110,13 +110,13 @@ class Battle::AI::AIMove
|
|||||||
@move.pbOnStartUse(user.battler, [target.battler]) # Calculate category
|
@move.pbOnStartUse(user.battler, [target.battler]) # Calculate category
|
||||||
end
|
end
|
||||||
atk, atk_stage = @move.pbGetAttackStats(user.battler, target.battler)
|
atk, atk_stage = @move.pbGetAttackStats(user.battler, target.battler)
|
||||||
if !target.has_active_ability?(:UNAWARE) || @ai.battle.moldBreaker
|
if !target.has_active_ability?(:UNAWARE) || target.being_mold_broken?
|
||||||
atk_stage = max_stage if is_critical && atk_stage < max_stage
|
atk_stage = max_stage if is_critical && atk_stage < max_stage
|
||||||
atk = (atk.to_f * stage_mul[atk_stage] / stage_div[atk_stage]).floor
|
atk = (atk.to_f * stage_mul[atk_stage] / stage_div[atk_stage]).floor
|
||||||
end
|
end
|
||||||
##### Calculate target's defense stat #####
|
##### Calculate target's defense stat #####
|
||||||
defense, def_stage = @move.pbGetDefenseStats(user.battler, target.battler)
|
defense, def_stage = @move.pbGetDefenseStats(user.battler, target.battler)
|
||||||
if !user.has_active_ability?(:UNAWARE) || @ai.battle.moldBreaker
|
if !user.has_active_ability?(:UNAWARE) || user.being_mold_broken?
|
||||||
def_stage = max_stage if is_critical && def_stage > max_stage
|
def_stage = max_stage if is_critical && def_stage > max_stage
|
||||||
defense = (defense.to_f * stage_mul[def_stage] / stage_div[def_stage]).floor
|
defense = (defense.to_f * stage_mul[def_stage] / stage_div[def_stage]).floor
|
||||||
end
|
end
|
||||||
@@ -171,14 +171,13 @@ class Battle::AI::AIMove
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if !@ai.battle.moldBreaker
|
|
||||||
user_battler.allAllies.each do |b|
|
user_battler.allAllies.each do |b|
|
||||||
next if !b.abilityActive?
|
next if !b.abilityActive? || b.beingMoldBroken?
|
||||||
Battle::AbilityEffects.triggerDamageCalcFromAlly(
|
Battle::AbilityEffects.triggerDamageCalcFromAlly(
|
||||||
b.ability, user_battler, target_battler, @move, multipliers, base_dmg, calc_type
|
b.ability, user_battler, target_battler, @move, multipliers, base_dmg, calc_type
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
if target.ability_active?
|
if target.ability_active? && !target.being_mold_broken?
|
||||||
case target.ability_id
|
case target.ability_id
|
||||||
when :FILTER, :SOLIDROCK
|
when :FILTER, :SOLIDROCK
|
||||||
if Effectiveness.super_effective_type?(calc_type, *target.pbTypes(true))
|
if Effectiveness.super_effective_type?(calc_type, *target.pbTypes(true))
|
||||||
@@ -190,20 +189,17 @@ class Battle::AI::AIMove
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
if target.ability_active?
|
if target.ability_active?
|
||||||
Battle::AbilityEffects.triggerDamageCalcFromTargetNonIgnorable(
|
Battle::AbilityEffects.triggerDamageCalcFromTargetNonIgnorable(
|
||||||
target.ability, user_battler, target_battler, @move, multipliers, base_dmg, calc_type
|
target.ability, user_battler, target_battler, @move, multipliers, base_dmg, calc_type
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
if !@ai.battle.moldBreaker
|
|
||||||
target_battler.allAllies.each do |b|
|
target_battler.allAllies.each do |b|
|
||||||
next if !b.abilityActive?
|
next if !b.abilityActive? || b.beingMoldBroken?
|
||||||
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(
|
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(
|
||||||
b.ability, user_battler, target_battler, @move, multipliers, base_dmg, calc_type
|
b.ability, user_battler, target_battler, @move, multipliers, base_dmg, calc_type
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
# Item effects that alter damage
|
# Item effects that alter damage
|
||||||
if user.item_active?
|
if user.item_active?
|
||||||
case user.item_id
|
case user.item_id
|
||||||
@@ -445,7 +441,7 @@ class Battle::AI::AIMove
|
|||||||
b.ability, modifiers, user_battler, target_battler, @move, calc_type
|
b.ability, modifiers, user_battler, target_battler, @move, calc_type
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
if !@ai.battle.moldBreaker && target.ability_active?
|
if target.ability_active? && !target.being_mold_broken?
|
||||||
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(
|
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(
|
||||||
target.ability, modifiers, user_battler, target_battler, @move, calc_type
|
target.ability, modifiers, user_battler, target_battler, @move, calc_type
|
||||||
)
|
)
|
||||||
@@ -510,7 +506,7 @@ class Battle::AI::AIMove
|
|||||||
user_battler, target_battler, crit_stage)
|
user_battler, target_battler, crit_stage)
|
||||||
return -1 if crit_stage < 0
|
return -1 if crit_stage < 0
|
||||||
end
|
end
|
||||||
if !@ai.battle.moldBreaker && target.ability_active?
|
if target.ability_active? && !target.being_mold_broken?
|
||||||
crit_stage = Battle::AbilityEffects.triggerCriticalCalcFromTarget(target_battler.ability,
|
crit_stage = Battle::AbilityEffects.triggerCriticalCalcFromTarget(target_battler.ability,
|
||||||
user_battler, target_battler, crit_stage)
|
user_battler, target_battler, crit_stage)
|
||||||
return -1 if crit_stage < 0
|
return -1 if crit_stage < 0
|
||||||
@@ -556,7 +552,7 @@ class Battle::AI::AIMove
|
|||||||
# Additional effect will be negated
|
# Additional effect will be negated
|
||||||
return -999 if user.has_active_ability?(:SHEERFORCE)
|
return -999 if user.has_active_ability?(:SHEERFORCE)
|
||||||
return -999 if target && user.index != target.index &&
|
return -999 if target && user.index != target.index &&
|
||||||
target.has_active_ability?(:SHIELDDUST) && !@ai.battle.moldBreaker
|
target.has_active_ability?(:SHIELDDUST) && !target.being_mold_broken?
|
||||||
# Additional effect will always trigger
|
# Additional effect will always trigger
|
||||||
return 0 if chance > 100
|
return 0 if chance > 100
|
||||||
# Calculate the chance
|
# Calculate the chance
|
||||||
|
|||||||
@@ -341,17 +341,23 @@ Battle::AI::Handlers::MoveEffectScore.add("StartPsychicTerrain",
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
#
|
#
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
Battle::AI::Handlers::MoveFailureCheck.add("RemoveTerrain",
|
|
||||||
proc { |move, user, ai, battle|
|
|
||||||
next battle.field.terrain == :None
|
|
||||||
}
|
|
||||||
)
|
|
||||||
Battle::AI::Handlers::MoveEffectScore.add("RemoveTerrain",
|
Battle::AI::Handlers::MoveEffectScore.add("RemoveTerrain",
|
||||||
proc { |score, move, user, ai, battle|
|
proc { |score, move, user, ai, battle|
|
||||||
next score - ai.get_score_for_terrain(battle.field.terrain, user)
|
next score - ai.get_score_for_terrain(battle.field.terrain, user)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
#
|
||||||
|
#===============================================================================
|
||||||
|
Battle::AI::Handlers::MoveFailureCheck.add("RemoveTerrainFailsIfNoTerrain",
|
||||||
|
proc { |move, user, ai, battle|
|
||||||
|
next battle.field.terrain == :None
|
||||||
|
}
|
||||||
|
)
|
||||||
|
Battle::AI::Handlers::MoveEffectScore.copy("RemoveTerrain",
|
||||||
|
"RemoveTerrainFailsIfNoTerrain")
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
#
|
#
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|||||||
@@ -628,7 +628,7 @@ Battle::AI::Handlers::MoveFailureAgainstTargetCheck.add("RaiseTargetAttack2Confu
|
|||||||
)
|
)
|
||||||
Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("RaiseTargetAttack2ConfuseTarget",
|
Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("RaiseTargetAttack2ConfuseTarget",
|
||||||
proc { |score, move, user, target, ai, battle|
|
proc { |score, move, user, target, ai, battle|
|
||||||
if !target.has_active_ability?(:CONTRARY) || battle.moldBreaker
|
if !target.has_active_ability?(:CONTRARY) || target.being_mold_broken?
|
||||||
next Battle::AI::MOVE_USELESS_SCORE if !target.battler.pbCanConfuse?(user.battler, false, move.move)
|
next Battle::AI::MOVE_USELESS_SCORE if !target.battler.pbCanConfuse?(user.battler, false, move.move)
|
||||||
end
|
end
|
||||||
# Score for stat raise
|
# Score for stat raise
|
||||||
@@ -650,7 +650,7 @@ Battle::AI::Handlers::MoveFailureAgainstTargetCheck.add("RaiseTargetSpAtk1Confus
|
|||||||
)
|
)
|
||||||
Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("RaiseTargetSpAtk1ConfuseTarget",
|
Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("RaiseTargetSpAtk1ConfuseTarget",
|
||||||
proc { |score, move, user, target, ai, battle|
|
proc { |score, move, user, target, ai, battle|
|
||||||
if !target.has_active_ability?(:CONTRARY) || battle.moldBreaker
|
if !target.has_active_ability?(:CONTRARY) || target.being_mold_broken?
|
||||||
next Battle::AI::MOVE_USELESS_SCORE if !target.battler.pbCanConfuse?(user.battler, false, move.move)
|
next Battle::AI::MOVE_USELESS_SCORE if !target.battler.pbCanConfuse?(user.battler, false, move.move)
|
||||||
end
|
end
|
||||||
# Score for stat raise
|
# Score for stat raise
|
||||||
@@ -690,7 +690,7 @@ Battle::AI::Handlers::MoveFailureAgainstTargetCheck.add("RaiseTargetRandomStat2"
|
|||||||
)
|
)
|
||||||
Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("RaiseTargetRandomStat2",
|
Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("RaiseTargetRandomStat2",
|
||||||
proc { |score, move, user, target, ai, battle|
|
proc { |score, move, user, target, ai, battle|
|
||||||
next Battle::AI::MOVE_USELESS_SCORE if !battle.moldBreaker && target.has_active_ability?(:CONTRARY)
|
next Battle::AI::MOVE_USELESS_SCORE if target.has_active_ability?(:CONTRARY) && !target.being_mold_broken?
|
||||||
next Battle::AI::MOVE_USELESS_SCORE if target.rough_end_of_round_damage >= target.hp
|
next Battle::AI::MOVE_USELESS_SCORE if target.rough_end_of_round_damage >= target.hp
|
||||||
score -= 7 if target.index != user.index # Less likely to use on ally
|
score -= 7 if target.index != user.index # Less likely to use on ally
|
||||||
score += 10 if target.has_active_ability?(:SIMPLE)
|
score += 10 if target.has_active_ability?(:SIMPLE)
|
||||||
@@ -831,7 +831,7 @@ Battle::AI::Handlers::MoveFailureAgainstTargetCheck.add("LowerTargetSpAtk2IfCanA
|
|||||||
next true if move.statusMove? &&
|
next true if move.statusMove? &&
|
||||||
!target.battler.pbCanLowerStatStage?(move.move.statDown[0], user.battler, move.move)
|
!target.battler.pbCanLowerStatStage?(move.move.statDown[0], user.battler, move.move)
|
||||||
next true if user.gender == 2 || target.gender == 2 || user.gender == target.gender
|
next true if user.gender == 2 || target.gender == 2 || user.gender == target.gender
|
||||||
next true if !battle.moldBreaker && target.has_active_ability?(:OBLIVIOUS)
|
next true if target.has_active_ability?(:OBLIVIOUS) && !target.being_mold_broken?
|
||||||
next false
|
next false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -576,7 +576,7 @@ Battle::AI::Handlers::MoveEffectScore.add("StartUserSideImmunityToInflictedStatu
|
|||||||
Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("FlinchTarget",
|
Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("FlinchTarget",
|
||||||
proc { |score, move, user, target, ai, battle|
|
proc { |score, move, user, target, ai, battle|
|
||||||
next score if target.faster_than?(user) || target.effects[PBEffects::Substitute] > 0
|
next score if target.faster_than?(user) || target.effects[PBEffects::Substitute] > 0
|
||||||
next score if target.has_active_ability?(:INNERFOCUS) && !battle.moldBreaker
|
next score if target.has_active_ability?(:INNERFOCUS) && !target.being_mold_broken?
|
||||||
add_effect = move.get_score_change_for_additional_effect(user, target)
|
add_effect = move.get_score_change_for_additional_effect(user, target)
|
||||||
next score if add_effect == -999 # Additional effect will be negated
|
next score if add_effect == -999 # Additional effect will be negated
|
||||||
score += add_effect
|
score += add_effect
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ Battle::AI::Handlers::MoveBasePower.add("LowerTargetHPToUserHP",
|
|||||||
Battle::AI::Handlers::MoveFailureAgainstTargetCheck.add("OHKO",
|
Battle::AI::Handlers::MoveFailureAgainstTargetCheck.add("OHKO",
|
||||||
proc { |move, user, target, ai, battle|
|
proc { |move, user, target, ai, battle|
|
||||||
next true if target.level > user.level
|
next true if target.level > user.level
|
||||||
next true if !battle.moldBreaker && target.has_active_ability?(:STURDY)
|
next true if target.has_active_ability?(:STURDY) && !target.being_mold_broken?
|
||||||
next false
|
next false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -144,7 +144,8 @@ Battle::AI::Handlers::MoveBasePower.copy("PowerHigherWithUserHP",
|
|||||||
#
|
#
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
Battle::AI::Handlers::MoveBasePower.copy("PowerHigherWithUserHP",
|
Battle::AI::Handlers::MoveBasePower.copy("PowerHigherWithUserHP",
|
||||||
"PowerHigherWithTargetHP")
|
"PowerHigherWithTargetHP100",
|
||||||
|
"PowerHigherWithTargetHP120")
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("CureTargetStatusHealUser
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
Battle::AI::Handlers::MoveFailureAgainstTargetCheck.add("HealUserByTargetAttackLowerTargetAttack1",
|
Battle::AI::Handlers::MoveFailureAgainstTargetCheck.add("HealUserByTargetAttackLowerTargetAttack1",
|
||||||
proc { |move, user, target, ai, battle|
|
proc { |move, user, target, ai, battle|
|
||||||
if !battle.moldBreaker && target.has_active_ability?(:CONTRARY)
|
if target.has_active_ability?(:CONTRARY) && !target.being_mold_broken?
|
||||||
next target.statStageAtMax?(:ATTACK)
|
next target.statStageAtMax?(:ATTACK)
|
||||||
end
|
end
|
||||||
next target.statStageAtMin?(:ATTACK)
|
next target.statStageAtMin?(:ATTACK)
|
||||||
@@ -456,7 +456,7 @@ Battle::AI::Handlers::MoveEffectScore.add("UserLosesHalfOfTotalHP",
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
Battle::AI::Handlers::MoveFailureCheck.add("UserLosesHalfOfTotalHPExplosive",
|
Battle::AI::Handlers::MoveFailureCheck.add("UserLosesHalfOfTotalHPExplosive",
|
||||||
proc { |move, user, ai, battle|
|
proc { |move, user, ai, battle|
|
||||||
next !battle.moldBreaker && battle.pbCheckGlobalAbility(:DAMP)
|
next !battle.pbCheckGlobalAbility(:DAMP, true).nil?
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
Battle::AI::Handlers::MoveEffectScore.copy("UserLosesHalfOfTotalHP",
|
Battle::AI::Handlers::MoveEffectScore.copy("UserLosesHalfOfTotalHP",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("UserTakesTargetItem",
|
|||||||
next score if !target.item || target.battler.unlosableItem?(target.item)
|
next score if !target.item || target.battler.unlosableItem?(target.item)
|
||||||
next score if user.battler.unlosableItem?(target.item)
|
next score if user.battler.unlosableItem?(target.item)
|
||||||
next score if target.effects[PBEffects::Substitute] > 0
|
next score if target.effects[PBEffects::Substitute] > 0
|
||||||
next score if target.has_active_ability?(:STICKYHOLD) && !battle.moldBreaker
|
next score if target.has_active_ability?(:STICKYHOLD) && !target.being_mold_broken?
|
||||||
# User can steal the target's item; score it
|
# User can steal the target's item; score it
|
||||||
user_item_preference = user.wants_item?(target.item_id)
|
user_item_preference = user.wants_item?(target.item_id)
|
||||||
user_no_item_preference = user.wants_item?(:NONE)
|
user_no_item_preference = user.wants_item?(:NONE)
|
||||||
@@ -58,7 +58,7 @@ Battle::AI::Handlers::MoveFailureAgainstTargetCheck.add("UserTargetSwapItems",
|
|||||||
next true if !user.item && !target.item
|
next true if !user.item && !target.item
|
||||||
next true if user.battler.unlosableItem?(user.item) || user.battler.unlosableItem?(target.item)
|
next true if user.battler.unlosableItem?(user.item) || user.battler.unlosableItem?(target.item)
|
||||||
next true if target.battler.unlosableItem?(target.item) || target.battler.unlosableItem?(user.item)
|
next true if target.battler.unlosableItem?(target.item) || target.battler.unlosableItem?(user.item)
|
||||||
next true if target.has_active_ability?(:STICKYHOLD) && !battle.moldBreaker
|
next true if target.has_active_ability?(:STICKYHOLD) && !target.being_mold_broken?
|
||||||
next false
|
next false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -113,7 +113,7 @@ Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("RemoveTargetItem",
|
|||||||
next score if user.wild?
|
next score if user.wild?
|
||||||
next score if !target.item || target.battler.unlosableItem?(target.item)
|
next score if !target.item || target.battler.unlosableItem?(target.item)
|
||||||
next score if target.effects[PBEffects::Substitute] > 0
|
next score if target.effects[PBEffects::Substitute] > 0
|
||||||
next score if target.has_active_ability?(:STICKYHOLD) && !battle.moldBreaker
|
next score if target.has_active_ability?(:STICKYHOLD) && !target.being_mold_broken?
|
||||||
next score if !target.item_active?
|
next score if !target.item_active?
|
||||||
# User can knock off the target's item; score it
|
# User can knock off the target's item; score it
|
||||||
item_preference = target.wants_item?(target.item_id)
|
item_preference = target.wants_item?(target.item_id)
|
||||||
@@ -132,7 +132,7 @@ Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("DestroyTargetBerryOrGem"
|
|||||||
!(Settings::MECHANICS_GENERATION >= 6 && target.item.is_gem?))
|
!(Settings::MECHANICS_GENERATION >= 6 && target.item.is_gem?))
|
||||||
next score if user.battler.unlosableItem?(target.item)
|
next score if user.battler.unlosableItem?(target.item)
|
||||||
next score if target.effects[PBEffects::Substitute] > 0
|
next score if target.effects[PBEffects::Substitute] > 0
|
||||||
next score if target.has_active_ability?(:STICKYHOLD) && !battle.moldBreaker
|
next score if target.has_active_ability?(:STICKYHOLD) && !target.being_mold_broken?
|
||||||
next score if !target.item_active?
|
next score if !target.item_active?
|
||||||
# User can incinerate the target's item; score it
|
# User can incinerate the target's item; score it
|
||||||
item_preference = target.wants_item?(target.item_id)
|
item_preference = target.wants_item?(target.item_id)
|
||||||
@@ -302,7 +302,7 @@ Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("UserConsumeTargetBerry",
|
|||||||
next score if !target.item || !target.item.is_berry?
|
next score if !target.item || !target.item.is_berry?
|
||||||
next score if user.battler.unlosableItem?(target.item)
|
next score if user.battler.unlosableItem?(target.item)
|
||||||
next score if target.effects[PBEffects::Substitute] > 0
|
next score if target.effects[PBEffects::Substitute] > 0
|
||||||
next score if target.has_active_ability?(:STICKYHOLD) && !battle.moldBreaker
|
next score if target.has_active_ability?(:STICKYHOLD) && !target.being_mold_broken?
|
||||||
# Score the user gaining the item's effect
|
# Score the user gaining the item's effect
|
||||||
score += user.get_score_change_for_consuming_item(target.item_id)
|
score += user.get_score_change_for_consuming_item(target.item_id)
|
||||||
# Score for other results of consuming the berry
|
# Score for other results of consuming the berry
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ Battle::AI::Handlers::MoveEffectAgainstTargetScore.add("SwitchOutTargetDamagingM
|
|||||||
proc { |score, move, user, target, ai, battle|
|
proc { |score, move, user, target, ai, battle|
|
||||||
next score if target.wild?
|
next score if target.wild?
|
||||||
# No score modification if the target can't be made to switch out
|
# No score modification if the target can't be made to switch out
|
||||||
next score if !battle.moldBreaker && target.has_active_ability?(:SUCTIONCUPS)
|
next score if target.has_active_ability?(:SUCTIONCUPS) && !target.being_mold_broken?
|
||||||
next score if target.effects[PBEffects::Ingrain]
|
next score if target.effects[PBEffects::Ingrain]
|
||||||
# No score modification if the target can't be replaced
|
# No score modification if the target can't be replaced
|
||||||
can_switch = false
|
can_switch = false
|
||||||
@@ -764,7 +764,7 @@ Battle::AI::Handlers::MoveFailureAgainstTargetCheck.add("DisableTargetStatusMove
|
|||||||
next true if target.effects[PBEffects::Taunt] > 0
|
next true if target.effects[PBEffects::Taunt] > 0
|
||||||
next true if move.move.pbMoveFailedAromaVeil?(user.battler, target.battler, false)
|
next true if move.move.pbMoveFailedAromaVeil?(user.battler, target.battler, false)
|
||||||
next true if Settings::MECHANICS_GENERATION >= 6 &&
|
next true if Settings::MECHANICS_GENERATION >= 6 &&
|
||||||
!battle.moldBreaker && target.has_active_ability?(:OBLIVIOUS)
|
target.has_active_ability?(:OBLIVIOUS) && !target.being_mold_broken?
|
||||||
next false
|
next false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -462,13 +462,19 @@ Battle::AbilityEffects::StatusImmunity.add(:MAGMAARMOR,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::AbilityEffects::StatusImmunity.add(:PURIFYINGSALT,
|
||||||
|
proc { |ability, battler, status|
|
||||||
|
next true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
Battle::AbilityEffects::StatusImmunity.add(:WATERVEIL,
|
Battle::AbilityEffects::StatusImmunity.add(:WATERVEIL,
|
||||||
proc { |ability, battler, status|
|
proc { |ability, battler, status|
|
||||||
next true if status == :BURN
|
next true if status == :BURN
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
Battle::AbilityEffects::StatusImmunity.copy(:WATERVEIL, :WATERBUBBLE)
|
Battle::AbilityEffects::StatusImmunity.copy(:WATERVEIL, :THERMALEXCHANGE, :WATERBUBBLE)
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# StatusImmunityNonIgnorable handlers
|
# StatusImmunityNonIgnorable handlers
|
||||||
@@ -661,7 +667,7 @@ Battle::AbilityEffects::StatusCure.add(:WATERVEIL,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
Battle::AbilityEffects::StatusCure.copy(:WATERVEIL, :WATERBUBBLE)
|
Battle::AbilityEffects::StatusCure.copy(:WATERVEIL, :THERMALEXCHANGE, :WATERBUBBLE)
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# StatLossImmunity handlers
|
# StatLossImmunity handlers
|
||||||
@@ -751,6 +757,8 @@ Battle::AbilityEffects::StatLossImmunity.add(:KEENEYE,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::AbilityEffects::StatLossImmunity.copy(:KEENEYE, :MINDSEYE)
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# StatLossImmunityNonIgnorable handlers
|
# StatLossImmunityNonIgnorable handlers
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
@@ -916,6 +924,12 @@ Battle::AbilityEffects::MoveImmunity.add(:BULLETPROOF,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::AbilityEffects::MoveImmunity.add(:EARTHEATER,
|
||||||
|
proc { |ability, user, target, move, type, battle, show_message|
|
||||||
|
next target.pbMoveImmunityHealingAbility(user, move, type, :GROUND, show_message)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
Battle::AbilityEffects::MoveImmunity.add(:FLASHFIRE,
|
Battle::AbilityEffects::MoveImmunity.add(:FLASHFIRE,
|
||||||
proc { |ability, user, target, move, type, battle, show_message|
|
proc { |ability, user, target, move, type, battle, show_message|
|
||||||
next false if user.index == target.index
|
next false if user.index == target.index
|
||||||
@@ -1019,6 +1033,36 @@ Battle::AbilityEffects::MoveImmunity.add(:WATERABSORB,
|
|||||||
|
|
||||||
Battle::AbilityEffects::MoveImmunity.copy(:WATERABSORB, :DRYSKIN)
|
Battle::AbilityEffects::MoveImmunity.copy(:WATERABSORB, :DRYSKIN)
|
||||||
|
|
||||||
|
Battle::AbilityEffects::MoveImmunity.add(:WELLBAKEDBODY,
|
||||||
|
proc { |ability, user, target, move, type, battle, show_message|
|
||||||
|
next target.pbMoveImmunityStatRaisingAbility(user, move, type,
|
||||||
|
:FIRE, :DEFENSE, 2, show_message)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
Battle::AbilityEffects::MoveImmunity.add(:WINDRIDER,
|
||||||
|
proc { |ability, user, target, move, type, battle, show_message|
|
||||||
|
next false if user.index == target.index
|
||||||
|
next false if !move.windMove?
|
||||||
|
if show_message
|
||||||
|
battle.pbShowAbilitySplash(target)
|
||||||
|
if target.pbCanRaiseStatStage?(:ATTACK, target)
|
||||||
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
|
target.pbRaiseStatStage(:ATTACK, 1, target)
|
||||||
|
else
|
||||||
|
target.pbRaiseStatStageByCause(:ATTACK, 1, target, target.abilityName)
|
||||||
|
end
|
||||||
|
elsif Battle::Scene::USE_ABILITY_SPLASH
|
||||||
|
battle.pbDisplay(_INTL("It doesn't affect {1}...", target.pbThis(true)))
|
||||||
|
else
|
||||||
|
battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!", target.pbThis, target.abilityName, move.name))
|
||||||
|
end
|
||||||
|
battle.pbHideAbilitySplash(target)
|
||||||
|
end
|
||||||
|
next true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
Battle::AbilityEffects::MoveImmunity.add(:WONDERGUARD,
|
Battle::AbilityEffects::MoveImmunity.add(:WONDERGUARD,
|
||||||
proc { |ability, user, target, move, type, battle, show_message|
|
proc { |ability, user, target, move, type, battle, show_message|
|
||||||
next false if move.statusMove?
|
next false if move.statusMove?
|
||||||
@@ -1351,6 +1395,12 @@ Battle::AbilityEffects::DamageCalcFromUser.add(:RIVALRY,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::AbilityEffects::DamageCalcFromUser.add(:ROCKYPAYLOAD,
|
||||||
|
proc { |ability, user, target, move, mults, power, type|
|
||||||
|
mults[:attack_multiplier] *= 1.5 if type == :ROCK
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
Battle::AbilityEffects::DamageCalcFromUser.add(:SANDFORCE,
|
Battle::AbilityEffects::DamageCalcFromUser.add(:SANDFORCE,
|
||||||
proc { |ability, user, target, move, mults, power, type|
|
proc { |ability, user, target, move, mults, power, type|
|
||||||
if user.effectiveWeather == :Sandstorm &&
|
if user.effectiveWeather == :Sandstorm &&
|
||||||
@@ -1360,6 +1410,12 @@ Battle::AbilityEffects::DamageCalcFromUser.add(:SANDFORCE,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::AbilityEffects::DamageCalcFromUser.add(:SHARPNESS,
|
||||||
|
proc { |ability, user, target, move, mults, power, type|
|
||||||
|
mults[:power_multiplier] *= 1.5 if move.slicingMove?
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
Battle::AbilityEffects::DamageCalcFromUser.add(:SHEERFORCE,
|
Battle::AbilityEffects::DamageCalcFromUser.add(:SHEERFORCE,
|
||||||
proc { |ability, user, target, move, mults, power, type|
|
proc { |ability, user, target, move, mults, power, type|
|
||||||
mults[:power_multiplier] *= 1.3 if move.addlEffect > 0
|
mults[:power_multiplier] *= 1.3 if move.addlEffect > 0
|
||||||
@@ -1443,7 +1499,7 @@ Battle::AbilityEffects::DamageCalcFromUser.add(:TORRENT,
|
|||||||
|
|
||||||
Battle::AbilityEffects::DamageCalcFromUser.add(:TOUGHCLAWS,
|
Battle::AbilityEffects::DamageCalcFromUser.add(:TOUGHCLAWS,
|
||||||
proc { |ability, user, target, move, mults, power, type|
|
proc { |ability, user, target, move, mults, power, type|
|
||||||
mults[:power_multiplier] *= 4 / 3.0 if move.contactMove?
|
mults[:power_multiplier] *= 4 / 3.0 if move.pbContactMove?(user)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1578,6 +1634,12 @@ Battle::AbilityEffects::DamageCalcFromTarget.add(:PUNKROCK,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::AbilityEffects::DamageCalcFromTarget.add(:PURIFYINGSALT,
|
||||||
|
proc { |ability, user, target, move, mults, power, type|
|
||||||
|
mults[:attack_multiplier] /= 2 if move.calcType == :GHOST
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
Battle::AbilityEffects::DamageCalcFromTarget.add(:THICKFAT,
|
Battle::AbilityEffects::DamageCalcFromTarget.add(:THICKFAT,
|
||||||
proc { |ability, user, target, move, mults, power, type|
|
proc { |ability, user, target, move, mults, power, type|
|
||||||
mults[:power_multiplier] /= 2 if [:FIRE, :ICE].include?(type)
|
mults[:power_multiplier] /= 2 if [:FIRE, :ICE].include?(type)
|
||||||
@@ -1663,8 +1725,7 @@ Battle::AbilityEffects::OnBeingHit.add(:AFTERMATH,
|
|||||||
next if !target.fainted?
|
next if !target.fainted?
|
||||||
next if !move.pbContactMove?(user)
|
next if !move.pbContactMove?(user)
|
||||||
battle.pbShowAbilitySplash(target)
|
battle.pbShowAbilitySplash(target)
|
||||||
if !battle.moldBreaker
|
dampBattler = battle.pbCheckGlobalAbility(:DAMP, true)
|
||||||
dampBattler = battle.pbCheckGlobalAbility(:DAMP)
|
|
||||||
if dampBattler
|
if dampBattler
|
||||||
battle.pbShowAbilitySplash(dampBattler)
|
battle.pbShowAbilitySplash(dampBattler)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
@@ -1677,7 +1738,6 @@ Battle::AbilityEffects::OnBeingHit.add(:AFTERMATH,
|
|||||||
battle.pbHideAbilitySplash(target)
|
battle.pbHideAbilitySplash(target)
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
end
|
|
||||||
if user.takesIndirectDamage?(Battle::Scene::USE_ABILITY_SPLASH) &&
|
if user.takesIndirectDamage?(Battle::Scene::USE_ABILITY_SPLASH) &&
|
||||||
user.affectedByContactEffect?(Battle::Scene::USE_ABILITY_SPLASH)
|
user.affectedByContactEffect?(Battle::Scene::USE_ABILITY_SPLASH)
|
||||||
battle.scene.pbDamageAnimation(user)
|
battle.scene.pbDamageAnimation(user)
|
||||||
@@ -1922,6 +1982,8 @@ Battle::AbilityEffects::OnBeingHit.add(:MUMMY,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::AbilityEffects::OnBeingHit.copy(:MUMMY, :LINGERINGAROMA)
|
||||||
|
|
||||||
Battle::AbilityEffects::OnBeingHit.add(:PERISHBODY,
|
Battle::AbilityEffects::OnBeingHit.add(:PERISHBODY,
|
||||||
proc { |ability, user, target, move, battle|
|
proc { |ability, user, target, move, battle|
|
||||||
next if !move.pbContactMove?(user)
|
next if !move.pbContactMove?(user)
|
||||||
@@ -1980,6 +2042,15 @@ Battle::AbilityEffects::OnBeingHit.add(:STAMINA,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::AbilityEffects::OnBeingHit.add(:SEEDSOWER,
|
||||||
|
proc { |ability, user, target, move, battle|
|
||||||
|
next if battle.field.terrain == :Grassy
|
||||||
|
battle.pbShowAbilitySplash(target)
|
||||||
|
battle.pbStartTerrain(target, :Grassy)
|
||||||
|
# NOTE: The ability splash is hidden again in def pbStartTerrain.
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
Battle::AbilityEffects::OnBeingHit.add(:STATIC,
|
Battle::AbilityEffects::OnBeingHit.add(:STATIC,
|
||||||
proc { |ability, user, target, move, battle|
|
proc { |ability, user, target, move, battle|
|
||||||
next if !move.pbContactMove?(user)
|
next if !move.pbContactMove?(user)
|
||||||
@@ -1998,6 +2069,30 @@ Battle::AbilityEffects::OnBeingHit.add(:STATIC,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::AbilityEffects::OnBeingHit.add(:THERMALEXCHANGE,
|
||||||
|
proc { |ability, user, target, move, battle|
|
||||||
|
next if move.calcType != :FIRE
|
||||||
|
target.pbRaiseStatStageByAbility(:ATTACK, 1, target)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
Battle::AbilityEffects::OnBeingHit.add(:TOXICDEBRIS,
|
||||||
|
proc { |ability, user, target, move, battle|
|
||||||
|
next if !move.physicalMove?
|
||||||
|
next if target.pbOpposingSide.effects[PBEffects::ToxicSpikes] >= 2
|
||||||
|
battle.pbShowAbilitySplash(target)
|
||||||
|
target.pbOpposingSide.effects[PBEffects::ToxicSpikes] += 1
|
||||||
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
|
battle.pbDisplay(_INTL("Poison spikes were scattered all around {1}'s feet!",
|
||||||
|
target.pbOpposingTeam(true)))
|
||||||
|
else
|
||||||
|
battle.pbDisplay(_INTL("{1}'s {2} scattered poison spikes all around {3}'s feet!",
|
||||||
|
target.pbThis, target.abilityName, target.pbOpposingTeam(true)))
|
||||||
|
end
|
||||||
|
battle.pbHideAbilitySplash(target)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
Battle::AbilityEffects::OnBeingHit.add(:WANDERINGSPIRIT,
|
Battle::AbilityEffects::OnBeingHit.add(:WANDERINGSPIRIT,
|
||||||
proc { |ability, user, target, move, battle|
|
proc { |ability, user, target, move, battle|
|
||||||
next if !move.pbContactMove?(user)
|
next if !move.pbContactMove?(user)
|
||||||
@@ -2060,10 +2155,10 @@ Battle::AbilityEffects::OnBeingHit.add(:WEAKARMOR,
|
|||||||
|
|
||||||
Battle::AbilityEffects::OnDealingHit.add(:POISONTOUCH,
|
Battle::AbilityEffects::OnDealingHit.add(:POISONTOUCH,
|
||||||
proc { |ability, user, target, move, battle|
|
proc { |ability, user, target, move, battle|
|
||||||
next if !move.contactMove?
|
next if !move.pbContactMove?(user)
|
||||||
next if battle.pbRandom(100) >= 30
|
next if battle.pbRandom(100) >= 30
|
||||||
battle.pbShowAbilitySplash(user)
|
battle.pbShowAbilitySplash(user)
|
||||||
if target.hasActiveAbility?(:SHIELDDUST) && !battle.moldBreaker
|
if target.hasActiveAbility?(:SHIELDDUST) && !target.being_mold_broken?
|
||||||
battle.pbShowAbilitySplash(target)
|
battle.pbShowAbilitySplash(target)
|
||||||
if !Battle::Scene::USE_ABILITY_SPLASH
|
if !Battle::Scene::USE_ABILITY_SPLASH
|
||||||
battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis))
|
battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis))
|
||||||
@@ -2080,6 +2175,27 @@ Battle::AbilityEffects::OnDealingHit.add(:POISONTOUCH,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::AbilityEffects::OnDealingHit.add(:TOXICCHAIN,
|
||||||
|
proc { |ability, user, target, move, battle|
|
||||||
|
next if battle.pbRandom(100) >= 30
|
||||||
|
battle.pbShowAbilitySplash(user)
|
||||||
|
if target.hasActiveAbility?(:SHIELDDUST) && !target.being_mold_broken?
|
||||||
|
battle.pbShowAbilitySplash(target)
|
||||||
|
if !Battle::Scene::USE_ABILITY_SPLASH
|
||||||
|
battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis))
|
||||||
|
end
|
||||||
|
battle.pbHideAbilitySplash(target)
|
||||||
|
elsif target.pbCanPoison?(user, Battle::Scene::USE_ABILITY_SPLASH)
|
||||||
|
msg = nil
|
||||||
|
if !Battle::Scene::USE_ABILITY_SPLASH
|
||||||
|
msg = _INTL("{1}'s {2} badly poisoned {3}!", user.pbThis, user.abilityName, target.pbThis(true))
|
||||||
|
end
|
||||||
|
target.pbPoison(user, msg, true)
|
||||||
|
end
|
||||||
|
battle.pbHideAbilitySplash(user)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# OnEndOfUsingMove handlers
|
# OnEndOfUsingMove handlers
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
@@ -2215,7 +2331,7 @@ Battle::AbilityEffects::AfterMoveUseFromTarget.add(:PICKPOCKET,
|
|||||||
# sense, so this code doesn't do it.
|
# sense, so this code doesn't do it.
|
||||||
next if target.wild?
|
next if target.wild?
|
||||||
next if switched_battlers.include?(user.index) # User was switched out
|
next if switched_battlers.include?(user.index) # User was switched out
|
||||||
next if !move.contactMove?
|
next if !move.pbContactMove?(user)
|
||||||
next if user.effects[PBEffects::Substitute] > 0 || target.damageState.substitute
|
next if user.effects[PBEffects::Substitute] > 0 || target.damageState.substitute
|
||||||
next if target.item || !user.item
|
next if target.item || !user.item
|
||||||
next if user.unlosableItem?(user.item) || target.unlosableItem?(user.item)
|
next if user.unlosableItem?(user.item) || target.unlosableItem?(user.item)
|
||||||
@@ -3057,6 +3173,13 @@ Battle::AbilityEffects::OnSwitchIn.add(:UNNERVE,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::AbilityEffects::OnSwitchIn.add(:WINDRIDER,
|
||||||
|
proc { |ability, battler, battle, switch_in|
|
||||||
|
next if battler.pbOwnSide.effects[PBEffects::Tailwind] == 0
|
||||||
|
battler.pbRaiseStatStageByAbility(:ATTACK, 1, battler)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# OnSwitchOut handlers
|
# OnSwitchOut handlers
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ module Battle::ItemEffects
|
|||||||
OnStatLoss = ItemHandlerHash.new
|
OnStatLoss = ItemHandlerHash.new
|
||||||
# Battler's status problem
|
# Battler's status problem
|
||||||
StatusCure = ItemHandlerHash.new
|
StatusCure = ItemHandlerHash.new
|
||||||
|
# Battler's stat stages
|
||||||
|
StatLossImmunity = ItemHandlerHash.new
|
||||||
# Priority and turn order
|
# Priority and turn order
|
||||||
PriorityBracketChange = ItemHandlerHash.new
|
PriorityBracketChange = ItemHandlerHash.new
|
||||||
PriorityBracketUse = ItemHandlerHash.new
|
PriorityBracketUse = ItemHandlerHash.new
|
||||||
@@ -83,6 +85,12 @@ module Battle::ItemEffects
|
|||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
|
def self.triggerStatLossImmunity(item, battler, stat, battle, show_messages)
|
||||||
|
return trigger(StatLossImmunity, item, battler, stat, battle, show_messages)
|
||||||
|
end
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
|
||||||
def self.triggerPriorityBracketChange(item, battler, battle)
|
def self.triggerPriorityBracketChange(item, battler, battle)
|
||||||
return trigger(PriorityBracketChange, item, battler, battle, ret: 0)
|
return trigger(PriorityBracketChange, item, battler, battle, ret: 0)
|
||||||
end
|
end
|
||||||
@@ -627,6 +635,18 @@ Battle::ItemEffects::StatusCure.add(:RAWSTBERRY,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#===============================================================================
|
||||||
|
# StatLossImmunity handlers
|
||||||
|
#===============================================================================
|
||||||
|
|
||||||
|
Battle::ItemEffects::StatLossImmunity.add(:CLEARAMULET,
|
||||||
|
proc { |item, battler, stat, battle, showMessages|
|
||||||
|
battle.pbDisplay(_INTL("The effects of {1}'s {2} prevent its stats from being lowered!",
|
||||||
|
battler.pbThis, GameData::Item.get(item).name)) if showMessages
|
||||||
|
next true
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# PriorityBracketChange handlers
|
# PriorityBracketChange handlers
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
@@ -730,6 +750,8 @@ Battle::ItemEffects::DamageCalcFromUser.add(:ADAMANTORB,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::ItemEffects::DamageCalcFromUser.copy(:ADAMANTORB, :ADAMANTCRYSTAL)
|
||||||
|
|
||||||
Battle::ItemEffects::DamageCalcFromUser.add(:BLACKBELT,
|
Battle::ItemEffects::DamageCalcFromUser.add(:BLACKBELT,
|
||||||
proc { |item, user, target, move, mults, power, type|
|
proc { |item, user, target, move, mults, power, type|
|
||||||
mults[:power_multiplier] *= 1.2 if type == :FIGHTING
|
mults[:power_multiplier] *= 1.2 if type == :FIGHTING
|
||||||
@@ -772,6 +794,14 @@ Battle::ItemEffects::DamageCalcFromUser.add(:CHOICESPECS,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::ItemEffects::DamageCalcFromUser.add(:CORNERSTONEMASK,
|
||||||
|
proc { |item, user, target, move, mults, power, type|
|
||||||
|
mults[:power_multiplier] *= 1.2 if user.isSpecies?(:OGERPON)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
Battle::ItemEffects::DamageCalcFromUser.copy(:CORNERSTONEMASK, :HEARTHFLAMEEMASK, :WELLSPRINGMASK)
|
||||||
|
|
||||||
Battle::ItemEffects::DamageCalcFromUser.add(:DARKGEM,
|
Battle::ItemEffects::DamageCalcFromUser.add(:DARKGEM,
|
||||||
proc { |item, user, target, move, mults, power, type|
|
proc { |item, user, target, move, mults, power, type|
|
||||||
user.pbMoveTypePoweringUpGem(:DARK, move, type, mults)
|
user.pbMoveTypePoweringUpGem(:DARK, move, type, mults)
|
||||||
@@ -858,6 +888,8 @@ Battle::ItemEffects::DamageCalcFromUser.add(:GRISEOUSORB,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::ItemEffects::DamageCalcFromUser.copy(:GRISEOUSORB, :GRISEOUSCORE)
|
||||||
|
|
||||||
Battle::ItemEffects::DamageCalcFromUser.add(:GROUNDGEM,
|
Battle::ItemEffects::DamageCalcFromUser.add(:GROUNDGEM,
|
||||||
proc { |item, user, target, move, mults, power, type|
|
proc { |item, user, target, move, mults, power, type|
|
||||||
user.pbMoveTypePoweringUpGem(:GROUND, move, type, mults)
|
user.pbMoveTypePoweringUpGem(:GROUND, move, type, mults)
|
||||||
@@ -900,6 +932,8 @@ Battle::ItemEffects::DamageCalcFromUser.add(:LUSTROUSORB,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::ItemEffects::DamageCalcFromUser.copy(:LUSTROUSORB, :LUSTROUSGLOBE)
|
||||||
|
|
||||||
Battle::ItemEffects::DamageCalcFromUser.add(:MAGNET,
|
Battle::ItemEffects::DamageCalcFromUser.add(:MAGNET,
|
||||||
proc { |item, user, target, move, mults, power, type|
|
proc { |item, user, target, move, mults, power, type|
|
||||||
mults[:power_multiplier] *= 1.2 if type == :ELECTRIC
|
mults[:power_multiplier] *= 1.2 if type == :ELECTRIC
|
||||||
@@ -987,6 +1021,12 @@ Battle::ItemEffects::DamageCalcFromUser.add(:PSYCHICGEM,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Battle::ItemEffects::DamageCalcFromUser.add(:PUNCHINGGLOVE,
|
||||||
|
proc { |item, user, target, move, mults, power, type|
|
||||||
|
mults[:power_multiplier] *= 1.1 if move.punchingMove?
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
Battle::ItemEffects::DamageCalcFromUser.add(:ROCKGEM,
|
Battle::ItemEffects::DamageCalcFromUser.add(:ROCKGEM,
|
||||||
proc { |item, user, target, move, mults, power, type|
|
proc { |item, user, target, move, mults, power, type|
|
||||||
user.pbMoveTypePoweringUpGem(:ROCK, move, type, mults)
|
user.pbMoveTypePoweringUpGem(:ROCK, move, type, mults)
|
||||||
@@ -1551,7 +1591,7 @@ Battle::ItemEffects::AfterMoveUseFromTarget.add(:REDCARD,
|
|||||||
battle.pbDisplay(_INTL("{1} held up its {2} against {3}!",
|
battle.pbDisplay(_INTL("{1} held up its {2} against {3}!",
|
||||||
battler.pbThis, battler.itemName, user.pbThis(true)))
|
battler.pbThis, battler.itemName, user.pbThis(true)))
|
||||||
battler.pbConsumeItem
|
battler.pbConsumeItem
|
||||||
if user.hasActiveAbility?(:SUCTIONCUPS) && !battle.moldBreaker
|
if user.hasActiveAbility?(:SUCTIONCUPS) && !user.being_mold_broken?
|
||||||
battle.pbShowAbilitySplash(user)
|
battle.pbShowAbilitySplash(user)
|
||||||
if Battle::Scene::USE_ABILITY_SPLASH
|
if Battle::Scene::USE_ABILITY_SPLASH
|
||||||
battle.pbDisplay(_INTL("{1} anchors itself!", user.pbThis))
|
battle.pbDisplay(_INTL("{1} anchors itself!", user.pbThis))
|
||||||
|
|||||||
@@ -409,6 +409,30 @@ ItemHandlers::UseOnPokemon.addIf(:evolution_stones,
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ItemHandlers::UseOnPokemon.add(:SCROLLOFWATERS, proc { |item, qty, pkmn, scene|
|
||||||
|
if pkmn.shadowPokemon?
|
||||||
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
|
next false
|
||||||
|
end
|
||||||
|
newspecies = pkmn.check_evolution_on_use_item(item)
|
||||||
|
if newspecies
|
||||||
|
pkmn.form = 1 # NOTE: This is the only difference to the generic evolution stone code.
|
||||||
|
pbFadeOutInWithMusic do
|
||||||
|
evo = PokemonEvolutionScene.new
|
||||||
|
evo.pbStartScreen(pkmn, newspecies)
|
||||||
|
evo.pbEvolution(false)
|
||||||
|
evo.pbEndScreen
|
||||||
|
if scene.is_a?(PokemonPartyScreen)
|
||||||
|
scene.pbRefreshAnnotations(proc { |p| !p.check_evolution_on_use_item(item).nil? })
|
||||||
|
scene.pbRefresh
|
||||||
|
end
|
||||||
|
end
|
||||||
|
next true
|
||||||
|
end
|
||||||
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
|
next false
|
||||||
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:POTION, proc { |item, qty, pkmn, scene|
|
ItemHandlers::UseOnPokemon.add(:POTION, proc { |item, qty, pkmn, scene|
|
||||||
next pbHPItem(pkmn, 20, scene)
|
next pbHPItem(pkmn, 20, scene)
|
||||||
})
|
})
|
||||||
@@ -1138,8 +1162,12 @@ ItemHandlers::UseOnPokemon.add(:ABILITYPATCH, proc { |item, qty, pkmn, scene|
|
|||||||
if scene.pbConfirm(_INTL("Do you want to change {1}'s Ability?", pkmn.name))
|
if scene.pbConfirm(_INTL("Do you want to change {1}'s Ability?", pkmn.name))
|
||||||
abils = pkmn.getAbilityList
|
abils = pkmn.getAbilityList
|
||||||
new_ability_id = nil
|
new_ability_id = nil
|
||||||
abils.each { |a| new_ability_id = a[0] if a[1] == 2 }
|
if pkmn.hasHiddenAbility?
|
||||||
if !new_ability_id || pkmn.hasHiddenAbility? || pkmn.isSpecies?(:ZYGARDE)
|
new_ability_id = 0 if Settings::MECHANICS_GENERATION >= 9 # First regular ability
|
||||||
|
else
|
||||||
|
abils.each { |a| new_ability_id = a[0] if a[1] == 2 } # Hidden ability
|
||||||
|
end
|
||||||
|
if !new_ability_id || pkmn.isSpecies?(:ZYGARDE)
|
||||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||||
next false
|
next false
|
||||||
end
|
end
|
||||||
@@ -1153,6 +1181,22 @@ ItemHandlers::UseOnPokemon.add(:ABILITYPATCH, proc { |item, qty, pkmn, scene|
|
|||||||
next false
|
next false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ItemHandlers::UseOnPokemon.add(:METEORITE, proc { |item, qty, pkmn, scene|
|
||||||
|
if !pkmn.isSpecies?(:DEOXYS)
|
||||||
|
scene.pbDisplay(_INTL("It had no effect."))
|
||||||
|
next false
|
||||||
|
elsif pkmn.fainted?
|
||||||
|
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
|
||||||
|
next false
|
||||||
|
end
|
||||||
|
new_form = (pkmn.form + 1) % 4 # Normal, Attack, Defense, Speed
|
||||||
|
pkmn.setForm(new_form) do
|
||||||
|
scene.pbRefresh
|
||||||
|
scene.pbDisplay(_INTL("{1} transformed!", pkmn.name))
|
||||||
|
end
|
||||||
|
next true
|
||||||
|
})
|
||||||
|
|
||||||
ItemHandlers::UseOnPokemon.add(:GRACIDEA, proc { |item, qty, pkmn, scene|
|
ItemHandlers::UseOnPokemon.add(:GRACIDEA, proc { |item, qty, pkmn, scene|
|
||||||
if !pkmn.isSpecies?(:SHAYMIN) || pkmn.form != 0 ||
|
if !pkmn.isSpecies?(:SHAYMIN) || pkmn.form != 0 ||
|
||||||
pkmn.status == :FROZEN || PBDayNight.isNight?
|
pkmn.status == :FROZEN || PBDayNight.isNight?
|
||||||
|
|||||||
@@ -270,8 +270,21 @@ MultipleForms.register(:ROTOM, {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
MultipleForms.register(:DIALGA, {
|
||||||
|
"getForm" => proc { |pkmn|
|
||||||
|
next pkmn.hasItem?(:ADAMANTCRYSTAL) ? 1 : 0
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
MultipleForms.register(:PALKIA, {
|
||||||
|
"getForm" => proc { |pkmn|
|
||||||
|
next pkmn.hasItem?(:LUSTROUSGLOBE) ? 1 : 0
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
MultipleForms.register(:GIRATINA, {
|
MultipleForms.register(:GIRATINA, {
|
||||||
"getForm" => proc { |pkmn|
|
"getForm" => proc { |pkmn|
|
||||||
|
next 1 if pkmn.hasItem?(:GRISEOUSCORE)
|
||||||
next 1 if pkmn.hasItem?(:GRISEOUSORB) && Settings::MECHANICS_GENERATION <= 8
|
next 1 if pkmn.hasItem?(:GRISEOUSORB) && Settings::MECHANICS_GENERATION <= 8
|
||||||
next 1 if $game_map&.metadata&.has_flag?("DistortionWorld")
|
next 1 if $game_map&.metadata&.has_flag?("DistortionWorld")
|
||||||
next 0
|
next 0
|
||||||
|
|||||||
@@ -6163,7 +6163,7 @@ Power = 1
|
|||||||
Accuracy = 100
|
Accuracy = 100
|
||||||
TotalPP = 5
|
TotalPP = 5
|
||||||
Target = NearOther
|
Target = NearOther
|
||||||
FunctionCode = PowerHigherWithTargetHP
|
FunctionCode = PowerHigherWithTargetHP120
|
||||||
Flags = Contact,CanProtect,CanMirrorMove
|
Flags = Contact,CanProtect,CanMirrorMove
|
||||||
Description = The target is crushed with great force. The attack is more powerful the more HP the target has left.
|
Description = The target is crushed with great force. The attack is more powerful the more HP the target has left.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
@@ -6319,7 +6319,7 @@ Power = 1
|
|||||||
Accuracy = 100
|
Accuracy = 100
|
||||||
TotalPP = 5
|
TotalPP = 5
|
||||||
Target = NearOther
|
Target = NearOther
|
||||||
FunctionCode = PowerHigherWithTargetHP
|
FunctionCode = PowerHigherWithTargetHP120
|
||||||
Flags = Contact,CanProtect,CanMirrorMove
|
Flags = Contact,CanProtect,CanMirrorMove
|
||||||
Description = The user powerfully wrings the foe. The more HP the foe has, the greater this attack's power.
|
Description = The user powerfully wrings the foe. The more HP the foe has, the greater this attack's power.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
@@ -8900,7 +8900,7 @@ Power = 130
|
|||||||
Accuracy = 100
|
Accuracy = 100
|
||||||
TotalPP = 5
|
TotalPP = 5
|
||||||
Target = NearOther
|
Target = NearOther
|
||||||
FunctionCode = RemoveTerrain
|
FunctionCode = RemoveTerrainFailsIfNoTerrain
|
||||||
Flags = Contact,CanProtect,CanMirrorMove
|
Flags = Contact,CanProtect,CanMirrorMove
|
||||||
Description = The user attacks while destroying the terrain. This move fails when the ground isn't a terrain.
|
Description = The user attacks while destroying the terrain. This move fails when the ground isn't a terrain.
|
||||||
#-------------------------------
|
#-------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user