mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 14:44:58 +00:00
Coded some Gen 9 ability/item/move effects
This commit is contained in:
@@ -139,6 +139,8 @@ class Battle::Move
|
||||
def pulseMove?; return @flags.any? { |f| f[/^Pulse$/i] }; end
|
||||
def bombMove?; return @flags.any? { |f| f[/^Bomb$/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.
|
||||
def tramplesMinimize?; return @flags.any? { |f| f[/^TramplesMinimize$/i] }; end
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ class Battle::Move
|
||||
|
||||
def pbContactMove?(user)
|
||||
return false if user.hasActiveAbility?(:LONGREACH)
|
||||
return false if punchingMove? && user.hasActiveItem?(:PUNCHINGGLOVE)
|
||||
return contactMove?
|
||||
end
|
||||
|
||||
@@ -86,9 +87,8 @@ class Battle::Move
|
||||
# Check if target is immune to the move because of its ability
|
||||
#=============================================================================
|
||||
def pbImmunityByAbility(user, target, show_message)
|
||||
return false if @battle.moldBreaker
|
||||
ret = false
|
||||
if target.abilityActive?
|
||||
if target.abilityActive? && !target.beingMoldBroken?
|
||||
ret = Battle::AbilityEffects.triggerMoveImmunity(target.ability, user, target,
|
||||
self, @calcType, @battle, show_message)
|
||||
end
|
||||
@@ -126,8 +126,7 @@ class Battle::Move
|
||||
end
|
||||
|
||||
def pbMoveFailedAromaVeil?(user, target, showMessage = true)
|
||||
return false if @battle.moldBreaker
|
||||
if target.hasActiveAbility?(:AROMAVEIL)
|
||||
if target.hasActiveAbility?(:AROMAVEIL) && !target.beingMoldBroken?
|
||||
if showMessage
|
||||
@battle.pbShowAbilitySplash(target)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@@ -141,7 +140,7 @@ class Battle::Move
|
||||
return true
|
||||
end
|
||||
target.allAllies.each do |b|
|
||||
next if !b.hasActiveAbility?(:AROMAVEIL)
|
||||
next if !b.hasActiveAbility?(:AROMAVEIL) || b.beingMoldBroken?
|
||||
if showMessage
|
||||
@battle.pbShowAbilitySplash(b)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@@ -168,13 +167,13 @@ class Battle::Move
|
||||
return
|
||||
end
|
||||
# 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.damageState.iceFace = true
|
||||
return
|
||||
end
|
||||
# Disguise will take the damage
|
||||
if !@battle.moldBreaker && target.isSpecies?(:MIMIKYU) &&
|
||||
if !target.beingMoldBroken? && target.isSpecies?(:MIMIKYU) &&
|
||||
target.form == 0 && target.ability == :DISGUISE
|
||||
target.damageState.disguise = true
|
||||
return
|
||||
@@ -202,7 +201,7 @@ class Battle::Move
|
||||
target.damageState.endured = true
|
||||
damage -= 1
|
||||
elsif damage == target.totalhp
|
||||
if target.hasActiveAbility?(:STURDY) && !@battle.moldBreaker
|
||||
if target.hasActiveAbility?(:STURDY) && !target.beingMoldBroken?
|
||||
target.damageState.sturdy = true
|
||||
damage -= 1
|
||||
elsif target.hasActiveItem?(:FOCUSSASH) && target.hp == target.totalhp
|
||||
|
||||
@@ -37,8 +37,8 @@ class Battle::Move
|
||||
ret = Effectiveness::NORMAL_EFFECTIVE_MULTIPLIER
|
||||
end
|
||||
# Foresight
|
||||
if (user.hasActiveAbility?(:SCRAPPY) || target.effects[PBEffects::Foresight]) &&
|
||||
defType == :GHOST
|
||||
if (user.hasActiveAbility?(:SCRAPPY) || user.hasActiveAbility?(:MINDSEYE) ||
|
||||
target.effects[PBEffects::Foresight]) && defType == :GHOST
|
||||
ret = Effectiveness::NORMAL_EFFECTIVE_MULTIPLIER
|
||||
end
|
||||
# Miracle Eye
|
||||
@@ -136,7 +136,7 @@ class Battle::Move
|
||||
b.ability, modifiers, user, target, self, @calcType
|
||||
)
|
||||
end
|
||||
if target.abilityActive? && !@battle.moldBreaker
|
||||
if target.abilityActive? && !target.beingMoldBroken?
|
||||
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(
|
||||
target.ability, modifiers, user, target, self, @calcType
|
||||
)
|
||||
@@ -163,6 +163,7 @@ class Battle::Move
|
||||
end
|
||||
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 user.hasActiveAbility?(:MINDSEYE)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -182,7 +183,7 @@ class Battle::Move
|
||||
if c >= 0 && user.abilityActive?
|
||||
c = Battle::AbilityEffects.triggerCriticalCalcFromUser(user.ability, user, target, c)
|
||||
end
|
||||
if c >= 0 && target.abilityActive? && !@battle.moldBreaker
|
||||
if c >= 0 && target.abilityActive? && !target.beingMoldBroken?
|
||||
c = Battle::AbilityEffects.triggerCriticalCalcFromTarget(target.ability, user, target, c)
|
||||
end
|
||||
# Item effects that alter critical hit rate
|
||||
@@ -253,7 +254,7 @@ class Battle::Move
|
||||
baseDmg = pbBaseDamage(@power, user, target)
|
||||
# Calculate user's attack stat
|
||||
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
|
||||
atk = (atk.to_f * stageMul[atkStage] / stageDiv[atkStage]).floor
|
||||
end
|
||||
@@ -282,48 +283,65 @@ class Battle::Move
|
||||
|
||||
def pbCalcDamageMultipliers(user, target, numTargets, type, baseDmg, multipliers)
|
||||
# Global abilities
|
||||
if (@battle.pbCheckGlobalAbility(:DARKAURA) && type == :DARK) ||
|
||||
(@battle.pbCheckGlobalAbility(:FAIRYAURA) && type == :FAIRY)
|
||||
if @battle.pbCheckGlobalAbility(:AURABREAK)
|
||||
all_abilities = @battle.pbAllActiveAbilities
|
||||
if (all_abilities.include?(:DARKAURA) && type == :DARK) ||
|
||||
(all_abilities.include?(:FAIRYAURA) && type == :FAIRY)
|
||||
if all_abilities.include?(:AURABREAK)
|
||||
multipliers[:power_multiplier] *= 3 / 4.0
|
||||
else
|
||||
multipliers[:power_multiplier] *= 4 / 3.0
|
||||
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
|
||||
if user.abilityActive?
|
||||
Battle::AbilityEffects.triggerDamageCalcFromUser(
|
||||
user.ability, user, target, self, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
if !@battle.moldBreaker
|
||||
# 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
|
||||
# how it works.
|
||||
user.allAllies.each do |b|
|
||||
next if !b.abilityActive?
|
||||
Battle::AbilityEffects.triggerDamageCalcFromAlly(
|
||||
b.ability, user, target, self, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
if target.abilityActive?
|
||||
# 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
|
||||
# how it works.
|
||||
user.allAllies.each do |b|
|
||||
next if !b.abilityActive? || b.beingMoldBroken?
|
||||
Battle::AbilityEffects.triggerDamageCalcFromAlly(
|
||||
b.ability, user, target, self, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
if target.abilityActive?
|
||||
if !target.beingMoldBroken?
|
||||
Battle::AbilityEffects.triggerDamageCalcFromTarget(
|
||||
target.ability, user, target, self, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
end
|
||||
if target.abilityActive?
|
||||
Battle::AbilityEffects.triggerDamageCalcFromTargetNonIgnorable(
|
||||
target.ability, user, target, self, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
if !@battle.moldBreaker
|
||||
target.allAllies.each do |b|
|
||||
next if !b.abilityActive?
|
||||
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(
|
||||
b.ability, user, target, self, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
target.allAllies.each do |b|
|
||||
next if !b.abilityActive? || b.beingMoldBroken?
|
||||
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(
|
||||
b.ability, user, target, self, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
# Item effects that alter damage
|
||||
if user.itemActive?
|
||||
@@ -400,13 +418,17 @@ class Battle::Move
|
||||
# Multi-targeting attacks
|
||||
multipliers[:final_damage_multiplier] *= 0.75 if numTargets > 1
|
||||
# Weather
|
||||
case user.effectiveWeather
|
||||
case target.effectiveWeather
|
||||
when :Sun, :HarshSun
|
||||
case type
|
||||
when :FIRE
|
||||
multipliers[:final_damage_multiplier] *= 1.5
|
||||
when :WATER
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
if @function_code == "IncreasePowerInSun" && [:Sun, :HarshSun].include?(user.effectiveWeather)
|
||||
multipliers[:final_damage_multiplier] *= 1.5
|
||||
else
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
end
|
||||
end
|
||||
when :Rain, :HeavyRain
|
||||
case type
|
||||
@@ -487,7 +509,7 @@ class Battle::Move
|
||||
# Additional effect chance
|
||||
#=============================================================================
|
||||
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
|
||||
return ret if ret > 100
|
||||
if (Settings::MECHANICS_GENERATION >= 6 || @function_code != "EffectDependsOnEnvironment") &&
|
||||
@@ -502,7 +524,7 @@ class Battle::Move
|
||||
# not here.
|
||||
def pbFlinchChance(user, target)
|
||||
return 0 if flinchingMove?
|
||||
return 0 if target.hasActiveAbility?(:SHIELDDUST) && !@battle.moldBreaker
|
||||
return 0 if target.hasActiveAbility?(:SHIELDDUST) && !target.beingMoldBroken?
|
||||
ret = 0
|
||||
if user.hasActiveAbility?(:STENCH, 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
|
||||
# is shown here, I know.
|
||||
canLower = false
|
||||
if target.hasActiveAbility?(:CONTRARY) && !@battle.moldBreaker
|
||||
if target.hasActiveAbility?(:CONTRARY) && !target.beingMoldBroken?
|
||||
(@statDown.length / 2).times do |i|
|
||||
next if target.statStageAtMax?(@statDown[i * 2])
|
||||
canLower = true
|
||||
|
||||
@@ -342,19 +342,16 @@ class Battle::Move::StartPsychicTerrain < Battle::Move
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Removes the current terrain. Fails if there is no terrain in effect.
|
||||
# (Steel Roller)
|
||||
# Removes the current terrain. (Ice Spinner)
|
||||
#===============================================================================
|
||||
class Battle::Move::RemoveTerrain < Battle::Move
|
||||
def pbMoveFailed?(user, targets)
|
||||
if @battle.field.terrain == :None
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
# NOTE: Bulbapedia claims that Ice Spinner shouldn't remove terrain if the
|
||||
# user faints because of its Life Orb or is switched out by Red Card.
|
||||
# I can't find any evidence of this. Also, those items trigger at the
|
||||
# very end of a move's use, way after move effects usually happen. I'm
|
||||
# treating Bulbapedia's claim as a mistake and ignoring it.
|
||||
def pbEffectGeneral(user)
|
||||
return if user.fainted?
|
||||
case @battle.field.terrain
|
||||
when :Electric
|
||||
@battle.pbDisplay(_INTL("The electricity disappeared from the battlefield."))
|
||||
@@ -369,6 +366,20 @@ class Battle::Move::RemoveTerrain < Battle::Move
|
||||
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)
|
||||
#===============================================================================
|
||||
|
||||
@@ -387,6 +387,16 @@ class Battle::Move::RaiseUserAtkDef1 < Battle::Move::MultiStatUpMove
|
||||
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)
|
||||
#===============================================================================
|
||||
@@ -1037,7 +1047,7 @@ class Battle::Move::LowerTargetSpAtk2IfCanAttract < Battle::Move::TargetStatDown
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis)) if show_message
|
||||
return true
|
||||
end
|
||||
if target.hasActiveAbility?(:OBLIVIOUS) && !@battle.moldBreaker
|
||||
if target.hasActiveAbility?(:OBLIVIOUS) && !target.beingMoldBroken?
|
||||
if show_message
|
||||
@battle.pbShowAbilitySplash(target)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@@ -1054,7 +1064,7 @@ class Battle::Move::LowerTargetSpAtk2IfCanAttract < Battle::Move::TargetStatDown
|
||||
|
||||
def pbAdditionalEffect(user, target)
|
||||
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
|
||||
end
|
||||
end
|
||||
@@ -1109,6 +1119,17 @@ class Battle::Move::LowerTargetSpeed1 < Battle::Move::TargetStatDownMove
|
||||
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.
|
||||
# (Bulldoze)
|
||||
@@ -1932,6 +1953,9 @@ class Battle::Move::StartUserSideDoubleSpeed < Battle::Move
|
||||
def pbEffectGeneral(user)
|
||||
user.pbOwnSide.effects[PBEffects::Tailwind] = 4
|
||||
@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
|
||||
|
||||
|
||||
@@ -176,6 +176,16 @@ class Battle::Move::ParalyzeTargetIfNotTypeImmune < Battle::Move::ParalyzeTarget
|
||||
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
|
||||
# semi-invulnerable targets. (Thunder)
|
||||
@@ -233,6 +243,16 @@ class Battle::Move::BurnTarget < Battle::Move
|
||||
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.
|
||||
# (Burning Jealousy)
|
||||
|
||||
@@ -73,7 +73,7 @@ class Battle::Move::OHKO < Battle::Move::FixedDamageMove
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis)) if show_message
|
||||
return true
|
||||
end
|
||||
if target.hasActiveAbility?(:STURDY) && !@battle.moldBreaker
|
||||
if target.hasActiveAbility?(:STURDY) && !target.beingMoldBroken?
|
||||
if show_message
|
||||
@battle.pbShowAbilitySplash(target)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@@ -190,10 +190,19 @@ class Battle::Move::PowerLowerWithUserHP < Battle::Move
|
||||
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)
|
||||
#===============================================================================
|
||||
class Battle::Move::PowerHigherWithTargetHP < Battle::Move
|
||||
class Battle::Move::PowerHigherWithTargetHP120 < Battle::Move
|
||||
def pbBaseDamage(baseDmg, user, target)
|
||||
return [120 * target.hp / target.totalhp, 1].max
|
||||
end
|
||||
@@ -395,6 +404,23 @@ class Battle::Move::RandomPowerDoublePowerIfTargetUnderground < Battle::Move
|
||||
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)
|
||||
#===============================================================================
|
||||
@@ -1090,6 +1116,15 @@ class Battle::Move::RecoilHalfOfDamageDealt < Battle::Move::RecoilMove
|
||||
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
|
||||
# the target. (Flying Press)
|
||||
|
||||
@@ -76,7 +76,7 @@ class Battle::Move::HitThreeTimesPowersUpWithEachHit < Battle::Move
|
||||
|
||||
def pbOnStartUse(user, targets)
|
||||
@calcBaseDmg = 0
|
||||
@accCheckPerHit = !user.hasActiveAbility?(:SKILLLINK)
|
||||
@accCheckPerHit = !user.hasActiveAbility?(:SKILLLINK) && !user.hasActiveItem?(:LOADEDDICE)
|
||||
end
|
||||
|
||||
def pbBaseDamage(baseDmg, user, target)
|
||||
@@ -110,6 +110,7 @@ class Battle::Move::HitTwoToFiveTimes < Battle::Move
|
||||
]
|
||||
r = @battle.pbRandom(hitChances.length)
|
||||
r = hitChances.length - 1 if user.hasActiveAbility?(:SKILLLINK)
|
||||
r = 4 if r < 4 && user.hasActiveItem?(:LOADEDDICE)
|
||||
return hitChances[r]
|
||||
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
|
||||
# works even if the stat stage cannot be changed due to an ability or
|
||||
# other effect.
|
||||
if !@battle.moldBreaker && target.hasActiveAbility?(:CONTRARY)
|
||||
if target.hasActiveAbility?(:CONTRARY) && !target.beingMoldBroken?
|
||||
if target.statStageAtMax?(@statDown[0])
|
||||
@battle.pbDisplay(_INTL("But it failed!")) if show_message
|
||||
return true
|
||||
@@ -469,19 +469,17 @@ class Battle::Move::UserLosesHalfOfTotalHPExplosive < Battle::Move
|
||||
def worksWithNoTargets?; return true; end
|
||||
|
||||
def pbMoveFailed?(user, targets)
|
||||
if !@battle.moldBreaker
|
||||
bearer = @battle.pbCheckGlobalAbility(:DAMP)
|
||||
if bearer
|
||||
@battle.pbShowAbilitySplash(bearer)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("{1} cannot use {2}!", user.pbThis, @name))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!",
|
||||
user.pbThis, @name, bearer.pbThis(true), bearer.abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(bearer)
|
||||
return true
|
||||
bearer = @battle.pbCheckGlobalAbility(:DAMP, true)
|
||||
if bearer
|
||||
@battle.pbShowAbilitySplash(bearer)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("{1} cannot use {2}!", user.pbThis, @name))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!",
|
||||
user.pbThis, @name, bearer.pbThis(true), bearer.abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(bearer)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
@@ -501,19 +499,17 @@ class Battle::Move::UserFaintsExplosive < Battle::Move
|
||||
def pbNumHits(user, targets); return 1; end
|
||||
|
||||
def pbMoveFailed?(user, targets)
|
||||
if !@battle.moldBreaker
|
||||
bearer = @battle.pbCheckGlobalAbility(:DAMP)
|
||||
if bearer
|
||||
@battle.pbShowAbilitySplash(bearer)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("{1} cannot use {2}!", user.pbThis, @name))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!",
|
||||
user.pbThis, @name, bearer.pbThis(true), bearer.abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(bearer)
|
||||
return true
|
||||
bearer = @battle.pbCheckGlobalAbility(:DAMP, true)
|
||||
if bearer
|
||||
@battle.pbShowAbilitySplash(bearer)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("{1} cannot use {2}!", user.pbThis, @name))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!",
|
||||
user.pbThis, @name, bearer.pbThis(true), bearer.abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(bearer)
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
@@ -10,7 +10,7 @@ class Battle::Move::UserTakesTargetItem < Battle::Move
|
||||
return if !target.item || user.item
|
||||
return if target.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
|
||||
user.item = target.item
|
||||
# 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
|
||||
return true
|
||||
end
|
||||
if target.hasActiveAbility?(:STICKYHOLD) && !@battle.moldBreaker
|
||||
if target.hasActiveAbility?(:STICKYHOLD) && !target.beingMoldBroken?
|
||||
if show_message
|
||||
@battle.pbShowAbilitySplash(target)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@@ -181,7 +181,7 @@ class Battle::Move::RemoveTargetItem < Battle::Move
|
||||
return if user.fainted?
|
||||
return if target.damageState.unaffected || target.damageState.substitute
|
||||
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
|
||||
target.pbRemoveItem(false)
|
||||
@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? &&
|
||||
!(Settings::MECHANICS_GENERATION >= 6 && target.item.is_gem?))
|
||||
return if target.unlosableItem?(target.item)
|
||||
return if target.hasActiveAbility?(:STICKYHOLD) && !@battle.moldBreaker
|
||||
return if target.hasActiveAbility?(:STICKYHOLD) && !target.beingMoldBroken?
|
||||
item_name = target.itemName
|
||||
target.pbRemoveItem
|
||||
@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
|
||||
return true
|
||||
end
|
||||
if target.hasActiveAbility?(:STICKYHOLD) && !@battle.moldBreaker
|
||||
if target.hasActiveAbility?(:STICKYHOLD) && !target.beingMoldBroken?
|
||||
if show_message
|
||||
@battle.pbShowAbilitySplash(target)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@@ -386,7 +386,7 @@ class Battle::Move::UserConsumeTargetBerry < Battle::Move
|
||||
return if user.fainted? || target.fainted?
|
||||
return if target.damageState.unaffected || target.damageState.substitute
|
||||
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
|
||||
itemName = target.itemName
|
||||
user.setBelched
|
||||
@@ -438,7 +438,7 @@ class Battle::Move::ThrowUserItemAtTarget < Battle::Move
|
||||
|
||||
def pbEffectAgainstTarget(user, target)
|
||||
return if target.damageState.substitute
|
||||
return if target.hasActiveAbility?(:SHIELDDUST) && !@battle.moldBreaker
|
||||
return if target.hasActiveAbility?(:SHIELDDUST) && !target.beingMoldBroken?
|
||||
case user.item_id
|
||||
when :POISONBARB
|
||||
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 pbFailsAgainstTarget?(user, target, show_message)
|
||||
if target.hasActiveAbility?(:SUCTIONCUPS) && !@battle.moldBreaker
|
||||
if target.hasActiveAbility?(:SUCTIONCUPS) && !target.beingMoldBroken?
|
||||
if show_message
|
||||
@battle.pbShowAbilitySplash(target)
|
||||
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.wild?
|
||||
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
|
||||
next if newPkmn < 0
|
||||
@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.wild?
|
||||
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
|
||||
next if newPkmn < 0
|
||||
@battle.pbRecallAndReplace(b.index, newPkmn, true)
|
||||
@@ -868,7 +868,7 @@ class Battle::Move::DisableTargetStatusMoves < Battle::Move
|
||||
end
|
||||
return true if pbMoveFailedAromaVeil?(user, target, show_message)
|
||||
if Settings::MECHANICS_GENERATION >= 6 && target.hasActiveAbility?(:OBLIVIOUS) &&
|
||||
!@battle.moldBreaker
|
||||
!target.beingMoldBroken?
|
||||
if show_message
|
||||
@battle.pbShowAbilitySplash(target)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
|
||||
Reference in New Issue
Block a user