mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-01-23 06:46:00 +00:00
More Gen 9 move effects
This commit is contained in:
@@ -155,8 +155,14 @@ end
|
||||
class Battle::Move::StatDownMove < Battle::Move
|
||||
attr_reader :statDown
|
||||
|
||||
def pbOnStartUse(user, targets)
|
||||
@stats_lowered = false
|
||||
end
|
||||
|
||||
def pbEffectWhenDealingDamage(user, target)
|
||||
return if @stats_lowered
|
||||
return if @battle.pbAllFainted?(target.idxOwnSide)
|
||||
@stats_lowered = true
|
||||
showAnim = true
|
||||
(@statDown.length / 2).times do |i|
|
||||
next if !user.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
|
||||
@@ -208,12 +208,10 @@ class Battle::Move::FailsIfTargetActed < Battle::Move
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# If attack misses, user takes crash damage of 1/2 of max HP.
|
||||
# (High Jump Kick, Jump Kick)
|
||||
# If attack misses, user takes crash damage of 1/2 of max HP. (Supercell Slam)
|
||||
#===============================================================================
|
||||
class Battle::Move::CrashDamageIfFailsUnusableInGravity < Battle::Move
|
||||
def recoilMove?; return true; end
|
||||
def unusableInGravity?; return true; end
|
||||
class Battle::Move::CrashDamageIfFails < Battle::Move
|
||||
def recoilMove?; return true; end
|
||||
|
||||
def pbCrashDamage(user)
|
||||
return if !user.takesIndirectDamage?
|
||||
@@ -225,6 +223,14 @@ class Battle::Move::CrashDamageIfFailsUnusableInGravity < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# If attack misses, user takes crash damage of 1/2 of max HP. Can't be used in
|
||||
# gravity. (High Jump Kick, Jump Kick)
|
||||
#===============================================================================
|
||||
class Battle::Move::CrashDamageIfFailsUnusableInGravity < Battle::Move::CrashDamageIfFails
|
||||
def unusableInGravity?; return true; end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Starts sunny weather. (Sunny Day)
|
||||
#===============================================================================
|
||||
@@ -387,6 +393,7 @@ class Battle::Move::AddSpikesToFoeSide < Battle::Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbMoveFailed?(user, targets)
|
||||
return false if damagingMove?
|
||||
if user.pbOpposingSide.effects[PBEffects::Spikes] >= 3
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
@@ -395,6 +402,15 @@ class Battle::Move::AddSpikesToFoeSide < Battle::Move
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
return if damagingMove?
|
||||
user.pbOpposingSide.effects[PBEffects::Spikes] += 1
|
||||
@battle.pbDisplay(_INTL("Spikes were scattered all around {1}'s feet!",
|
||||
user.pbOpposingTeam(true)))
|
||||
end
|
||||
|
||||
def pbAdditionalEffect(user, target)
|
||||
return if user.fainted?
|
||||
return if user.pbOpposingSide.effects[PBEffects::Spikes] >= 3
|
||||
user.pbOpposingSide.effects[PBEffects::Spikes] += 1
|
||||
@battle.pbDisplay(_INTL("Spikes were scattered all around {1}'s feet!",
|
||||
user.pbOpposingTeam(true)))
|
||||
@@ -409,6 +425,7 @@ class Battle::Move::AddToxicSpikesToFoeSide < Battle::Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbMoveFailed?(user, targets)
|
||||
return false if damagingMove?
|
||||
if user.pbOpposingSide.effects[PBEffects::ToxicSpikes] >= 2
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
@@ -417,6 +434,15 @@ class Battle::Move::AddToxicSpikesToFoeSide < Battle::Move
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
return if damagingMove?
|
||||
user.pbOpposingSide.effects[PBEffects::ToxicSpikes] += 1
|
||||
@battle.pbDisplay(_INTL("Poison spikes were scattered all around {1}'s feet!",
|
||||
user.pbOpposingTeam(true)))
|
||||
end
|
||||
|
||||
def pbAdditionalEffect(user, target)
|
||||
return if user.fainted?
|
||||
return if user.pbOpposingSide.effects[PBEffects::ToxicSpikes] >= 2
|
||||
user.pbOpposingSide.effects[PBEffects::ToxicSpikes] += 1
|
||||
@battle.pbDisplay(_INTL("Poison spikes were scattered all around {1}'s feet!",
|
||||
user.pbOpposingTeam(true)))
|
||||
@@ -430,6 +456,7 @@ class Battle::Move::AddStealthRocksToFoeSide < Battle::Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbMoveFailed?(user, targets)
|
||||
return false if damagingMove?
|
||||
if user.pbOpposingSide.effects[PBEffects::StealthRock]
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
@@ -438,6 +465,15 @@ class Battle::Move::AddStealthRocksToFoeSide < Battle::Move
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
return if damagingMove?
|
||||
user.pbOpposingSide.effects[PBEffects::StealthRock] = true
|
||||
@battle.pbDisplay(_INTL("Pointed stones float in the air around {1}!",
|
||||
user.pbOpposingTeam(true)))
|
||||
end
|
||||
|
||||
def pbAdditionalEffect(user, target)
|
||||
return if user.fainted?
|
||||
return if user.pbOpposingSide.effects[PBEffects::StealthRock]
|
||||
user.pbOpposingSide.effects[PBEffects::StealthRock] = true
|
||||
@battle.pbDisplay(_INTL("Pointed stones float in the air around {1}!",
|
||||
user.pbOpposingTeam(true)))
|
||||
@@ -451,6 +487,7 @@ class Battle::Move::AddStickyWebToFoeSide < Battle::Move
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def pbMoveFailed?(user, targets)
|
||||
return false if damagingMove?
|
||||
if user.pbOpposingSide.effects[PBEffects::StickyWeb]
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
@@ -459,6 +496,15 @@ class Battle::Move::AddStickyWebToFoeSide < Battle::Move
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
return false if damagingMove?
|
||||
user.pbOpposingSide.effects[PBEffects::StickyWeb] = true
|
||||
@battle.pbDisplay(_INTL("A sticky web has been laid out beneath {1}'s feet!",
|
||||
user.pbOpposingTeam(true)))
|
||||
end
|
||||
|
||||
def pbAdditionalEffect(user, target)
|
||||
return if user.fainted?
|
||||
return if user.pbOpposingSide.effects[PBEffects::StickyWeb]
|
||||
user.pbOpposingSide.effects[PBEffects::StickyWeb] = true
|
||||
@battle.pbDisplay(_INTL("A sticky web has been laid out beneath {1}'s feet!",
|
||||
user.pbOpposingTeam(true)))
|
||||
|
||||
@@ -111,6 +111,33 @@ class Battle::Move::MaxUserAttackLoseHalfOfTotalHP < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Reduces the user's HP by half of max, and raises its Attack, Special Attack
|
||||
# and Speed by 2 stages each. (Fillet Away)
|
||||
#===============================================================================
|
||||
class Battle::Move::RaiseUserAtkSpAtkSpeed2LoseHalfOfTotalHP < Battle::Move::MultiStatUpMove
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@statUp = [:ATTACK, 2, :SPECIAL_ATTACK, 2, :SPEED, 2]
|
||||
end
|
||||
|
||||
def pbMoveFailed?(user, targets)
|
||||
hpLoss = [user.totalhp / 2, 1].max
|
||||
if user.hp <= hpLoss
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
return super
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
super
|
||||
hpLoss = [user.totalhp / 2, 1].max
|
||||
user.pbReduceHP(hpLoss, false, false)
|
||||
user.pbItemHPHealCheck
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Increases the user's Defense by 1 stage. (Harden, Steel Wing, Withdraw)
|
||||
#===============================================================================
|
||||
@@ -453,16 +480,14 @@ class Battle::Move::LowerUserDefSpDef1RaiseUserAtkSpAtkSpd2 < Battle::Move
|
||||
def pbMoveFailed?(user, targets)
|
||||
failed = true
|
||||
(@statUp.length / 2).times do |i|
|
||||
if user.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
failed = false
|
||||
break
|
||||
end
|
||||
next if !user.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
failed = false
|
||||
break
|
||||
end
|
||||
(@statDown.length / 2).times do |i|
|
||||
if user.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
failed = false
|
||||
break
|
||||
end
|
||||
next if !user.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
failed = false
|
||||
break
|
||||
end
|
||||
if failed
|
||||
@battle.pbDisplay(_INTL("{1}'s stats can't be changed further!", user.pbThis))
|
||||
@@ -499,6 +524,86 @@ class Battle::Move::RaiseUserAtkSpd1 < Battle::Move::MultiStatUpMove
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Removes trapping moves, entry hazards and Leech Seed on user/user's side.
|
||||
# Poisons the target. (Mortal Spin)
|
||||
#===============================================================================
|
||||
class Battle::Move::RaiseUserAtkSpd1RemoveEntryHazardsAndSubstitutes < Battle::Move::RaiseUserAtkSpd1
|
||||
def pbMoveFailed?(user, targets)
|
||||
return false if damagingMove?
|
||||
failed = true
|
||||
(@statUp.length / 2).times do |i|
|
||||
next if !user.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
failed = false
|
||||
break
|
||||
end
|
||||
@battle.allBattlers.each do |b|
|
||||
failed = false if b.effects[PBEffects::Substitute] > 0
|
||||
end
|
||||
failed = false if user.pbOwnSide.effects[PBEffects::StealthRock] ||
|
||||
user.pbOwnSide.effects[PBEffects::Spikes] > 0 ||
|
||||
user.pbOwnSide.effects[PBEffects::ToxicSpikes] > 0 ||
|
||||
user.pbOwnSide.effects[PBEffects::StickyWeb]
|
||||
if failed
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
something_tidied = false
|
||||
@battle.allBattlers.each do |b|
|
||||
next if b.effects[PBEffects::Substitute] == 0
|
||||
b.effects[PBEffects::Substitute] = 0
|
||||
something_tidied = true
|
||||
@battle.pbDisplay(_INTL("{1}'s substitute faded!", b.pbThis))
|
||||
end
|
||||
if user.pbOwnSide.effects[PBEffects::StealthRock]
|
||||
user.pbOwnSide.effects[PBEffects::StealthRock] = false
|
||||
something_tidied = true
|
||||
@battle.pbDisplay(_INTL("The pointed stones disappeared from around {1}!", user.pbTeam(true)))
|
||||
end
|
||||
if user.pbOpposingSide.effects[PBEffects::StealthRock]
|
||||
user.pbOpposingSide.effects[PBEffects::StealthRock] = false
|
||||
something_tidied = true
|
||||
@battle.pbDisplay(_INTL("The pointed stones disappeared from around {1}!", user.pbOpposingTeam(true)))
|
||||
end
|
||||
if user.pbOwnSide.effects[PBEffects::Spikes] > 0
|
||||
user.pbOwnSide.effects[PBEffects::Spikes] = 0
|
||||
something_tidied = true
|
||||
@battle.pbDisplay(_INTL("The spikes disappeared from the ground around {1}!", user.pbTeam(true)))
|
||||
end
|
||||
if user.pbOpposingSide.effects[PBEffects::Spikes] > 0
|
||||
user.pbOpposingSide.effects[PBEffects::Spikes] = 0
|
||||
something_tidied = true
|
||||
@battle.pbDisplay(_INTL("The spikes disappeared from the ground around {1}!", user.pbpbOpposingSideTeam(true)))
|
||||
end
|
||||
if user.pbOwnSide.effects[PBEffects::ToxicSpikes] > 0
|
||||
user.pbOwnSide.effects[PBEffects::ToxicSpikes] = 0
|
||||
something_tidied = true
|
||||
@battle.pbDisplay(_INTL("The poison spikes disappeared from the ground around {1}!", user.pbTeam(true)))
|
||||
end
|
||||
if user.pbOpposingSide.effects[PBEffects::ToxicSpikes] > 0
|
||||
user.pbOpposingSide.effects[PBEffects::ToxicSpikes] = 0
|
||||
something_tidied = true
|
||||
@battle.pbDisplay(_INTL("The poison spikes disappeared from the ground around {1}!", user.pbpbOpposingSideTeam(true)))
|
||||
end
|
||||
if user.pbOwnSide.effects[PBEffects::StickyWeb]
|
||||
user.pbOwnSide.effects[PBEffects::StickyWeb] = false
|
||||
something_tidied = true
|
||||
@battle.pbDisplay(_INTL("The sticky webs disappeared from the ground around {1}!", user.pbTeam(true)))
|
||||
end
|
||||
if user.pbOpposingSide.effects[PBEffects::StickyWeb]
|
||||
user.pbOpposingSide.effects[PBEffects::StickyWeb] = false
|
||||
something_tidied = true
|
||||
@battle.pbDisplay(_INTL("The sticky webs disappeared from the ground around {1}!", user.pbpbOpposingSideTeam(true)))
|
||||
end
|
||||
@battle.pbDisplay(_INTL("Tidying up complete!")) if something_tidied
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Increases the user's Speed by 2 stages, and its Attack by 1 stage. (Shift Gear)
|
||||
#===============================================================================
|
||||
@@ -540,6 +645,37 @@ class Battle::Move::RaiseUserSpAtkSpDef1 < Battle::Move::MultiStatUpMove
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Increases the user's Sp. Attack and Sp. Defense by 1 stage each. Cures the
|
||||
# user's status condition. (Take Heart)
|
||||
#===============================================================================
|
||||
class Battle::Move::RaiseUserSpAtkSpDef1CureStatus < Battle::Move::MultiStatUpMove
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@statUp = [:SPECIAL_ATTACK, 1, :SPECIAL_DEFENSE, 1]
|
||||
end
|
||||
|
||||
def pbMoveFailed?(user, targets)
|
||||
failed = true
|
||||
(@statUp.length / 2).times do |i|
|
||||
next if !user.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
failed = false
|
||||
break
|
||||
end
|
||||
failed = false if user.pbHasAnyStatus?
|
||||
if failed
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
super
|
||||
user.pbCureStatus
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Increases the user's Sp. Attack, Sp. Defense and Speed by 1 stage each.
|
||||
# (Quiver Dance)
|
||||
@@ -682,6 +818,21 @@ class Battle::Move::LowerUserSpAtk1 < Battle::Move::StatDownMove
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Decreases the user's Special Attack by 1 stage. Scatters coins that the player
|
||||
# picks up after winning the battle. (Make It Rain)
|
||||
#===============================================================================
|
||||
class Battle::Move::LowerUserSpAtk1 < Battle::Move::LowerUserSpAtk1
|
||||
def pbEffectWhenDealingDamage(user, target)
|
||||
return if @stats_lowered
|
||||
if user.pbOwnedByPlayer?
|
||||
@battle.field.effects[PBEffects::PayDay] += 5 * user.level
|
||||
end
|
||||
@battle.pbDisplay(_INTL("Coins were scattered everywhere!"))
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Decreases the user's Special Attack by 2 stages.
|
||||
#===============================================================================
|
||||
@@ -744,7 +895,7 @@ end
|
||||
|
||||
#===============================================================================
|
||||
# Decreases the user's Defense and Special Defense by 1 stage each.
|
||||
# (Close Combat, Dragon Ascent)
|
||||
# (Armor Cannon, Close Combat, Dragon Ascent, Headlong Rush)
|
||||
#===============================================================================
|
||||
class Battle::Move::LowerUserDefSpDef1 < Battle::Move::StatDownMove
|
||||
def initialize(battle, move)
|
||||
@@ -801,6 +952,62 @@ class Battle::Move::RaiseTargetAttack1 < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Increases the target's Attack by 2 stages. Decreases the target's Defense by 2
|
||||
# stages. (Spicy Extract)
|
||||
#===============================================================================
|
||||
class Battle::Move::RaiseTargetAtk2LowerTargetDef2 < Battle::Move
|
||||
attr_reader :statUp, :statDown
|
||||
|
||||
def canMagicCoat?; return true; end
|
||||
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@statUp = [:ATTACK, 2]
|
||||
@statDown = [:DEFENSE, 2]
|
||||
end
|
||||
|
||||
def pbMoveFailed?(user, targets)
|
||||
failed = true
|
||||
targets.each do |b|
|
||||
(@statUp.length / 2).times do |i|
|
||||
next if !target.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
failed = false
|
||||
break
|
||||
end
|
||||
break if !failed
|
||||
(@statDown.length / 2).times do |i|
|
||||
next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
failed = false
|
||||
break
|
||||
end
|
||||
break if !failed
|
||||
end
|
||||
if failed
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
def pbEffectAgainstTarget(user, target)
|
||||
showAnim = true
|
||||
(@statDown.length / 2).times do |i|
|
||||
next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
if target.pbLowerStatStage(@statDown[i * 2], @statDown[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
showAnim = true
|
||||
(@statUp.length / 2).times do |i|
|
||||
next if !target.pbCanRaiseStatStage?(@statUp[i * 2], user, self)
|
||||
if target.pbRaiseStatStage(@statUp[i * 2], @statUp[(i * 2) + 1], user, showAnim)
|
||||
showAnim = false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Increases the target's Attack by 2 stages. Confuses the target. (Swagger)
|
||||
#===============================================================================
|
||||
@@ -990,6 +1197,27 @@ class Battle::Move::LowerTargetDefense1PowersUpInGravity < Battle::Move::LowerTa
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# 50% chance to decreases the target's Defense by 1 stage. 30% chance to make
|
||||
# the target flinch. (Triple Arrows)
|
||||
#===============================================================================
|
||||
class Battle::Move::LowerTargetDefense1FlinchTarget < Battle::Move::TargetStatDownMove
|
||||
def flinchingMove?; return true; end
|
||||
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@statDown = [:DEFENSE, 1]
|
||||
end
|
||||
|
||||
def pbAdditionalEffect(user, target)
|
||||
return if target.damageState.substitute
|
||||
stat_chance = pbAdditionalEffectChance(user, target, 50)
|
||||
super if stat_chance > 0 && @battle.pbRandom(100) < stat_chance
|
||||
flinch_chance = pbAdditionalEffectChance(user, target, 30)
|
||||
target.pbFlinch(user) if flinch_chance > 0 && @battle.pbRandom(100) < flinch_chance
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Decreases the target's Defense by 2 stages. (Screech)
|
||||
#===============================================================================
|
||||
|
||||
@@ -126,6 +126,44 @@ class Battle::Move::PoisonTargetLowerTargetSpeed1 < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Removes trapping moves, entry hazards and Leech Seed on user/user's side.
|
||||
# Poisons the target. (Mortal Spin)
|
||||
#===============================================================================
|
||||
class Battle::Move::PoisonTargetRemoveUserBindingAndEntryHazards < Battle::Move::PoisonTarget
|
||||
def pbEffectAfterAllHits(user, target)
|
||||
return if user.fainted? || target.damageState.unaffected
|
||||
if user.effects[PBEffects::Trapping] > 0
|
||||
trapMove = GameData::Move.get(user.effects[PBEffects::TrappingMove]).name
|
||||
trapUser = @battle.battlers[user.effects[PBEffects::TrappingUser]]
|
||||
@battle.pbDisplay(_INTL("{1} got free of {2}'s {3}!", user.pbThis, trapUser.pbThis(true), trapMove))
|
||||
user.effects[PBEffects::Trapping] = 0
|
||||
user.effects[PBEffects::TrappingMove] = nil
|
||||
user.effects[PBEffects::TrappingUser] = -1
|
||||
end
|
||||
if user.effects[PBEffects::LeechSeed] >= 0
|
||||
user.effects[PBEffects::LeechSeed] = -1
|
||||
@battle.pbDisplay(_INTL("{1} shed Leech Seed!", user.pbThis))
|
||||
end
|
||||
if user.pbOwnSide.effects[PBEffects::StealthRock]
|
||||
user.pbOwnSide.effects[PBEffects::StealthRock] = false
|
||||
@battle.pbDisplay(_INTL("{1} blew away stealth rocks!", user.pbThis))
|
||||
end
|
||||
if user.pbOwnSide.effects[PBEffects::Spikes] > 0
|
||||
user.pbOwnSide.effects[PBEffects::Spikes] = 0
|
||||
@battle.pbDisplay(_INTL("{1} blew away spikes!", user.pbThis))
|
||||
end
|
||||
if user.pbOwnSide.effects[PBEffects::ToxicSpikes] > 0
|
||||
user.pbOwnSide.effects[PBEffects::ToxicSpikes] = 0
|
||||
@battle.pbDisplay(_INTL("{1} blew away poison spikes!", user.pbThis))
|
||||
end
|
||||
if user.pbOwnSide.effects[PBEffects::StickyWeb]
|
||||
user.pbOwnSide.effects[PBEffects::StickyWeb] = false
|
||||
@battle.pbDisplay(_INTL("{1} blew away sticky webs!", user.pbThis))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Badly poisons the target. (Poison Fang, Toxic)
|
||||
#===============================================================================
|
||||
@@ -353,6 +391,20 @@ class Battle::Move::ParalyzeBurnOrFreezeTarget < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Poisons, paralyzes or puts to sleep the target. (Dire Claw)
|
||||
#===============================================================================
|
||||
class Battle::Move::PoisonParalyzeOrSleepTarget < Battle::Move
|
||||
def pbAdditionalEffect(user, target)
|
||||
return if target.damageState.substitute
|
||||
case @battle.pbRandom(3)
|
||||
when 0 then target.pbPoison(user) if target.pbCanPoison?(user, false, self)
|
||||
when 1 then target.pbParalyze(user) if target.pbCanParalyze?(user, false, self)
|
||||
when 2 then target.pbSleep if target.pbCanSleep?(user, false, self)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# User passes its status problem to the target. (Psycho Shift)
|
||||
#===============================================================================
|
||||
@@ -649,6 +701,23 @@ class Battle::Move::ConfuseTargetAlwaysHitsInRainHitsTargetInSky < Battle::Move:
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Confuses the target. If attack misses, user takes crash damage of 1/2 of max
|
||||
# HP. (Axe Kick)
|
||||
#===============================================================================
|
||||
class Battle::Move::ConfuseTargetCrashDamageIfFails < Battle::Move::ConfuseTarget
|
||||
def recoilMove?; return true; end
|
||||
|
||||
def pbCrashDamage(user)
|
||||
return if !user.takesIndirectDamage?
|
||||
@battle.pbDisplay(_INTL("{1} kept going and crashed!", user.pbThis))
|
||||
@battle.scene.pbDamageAnimation(user)
|
||||
user.pbReduceHP(user.totalhp / 2, false)
|
||||
user.pbItemHPHealCheck
|
||||
user.pbFaint if user.fainted?
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Attracts the target. (Attract)
|
||||
#===============================================================================
|
||||
@@ -953,6 +1022,27 @@ class Battle::Move::UserLosesFireType < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# User loses their Electric type. Fails if user is not Electric-type.
|
||||
# (Double Shock)
|
||||
#===============================================================================
|
||||
class Battle::Move::UserLosesElectricType < Battle::Move
|
||||
def pbMoveFailed?(user, targets)
|
||||
if !user.pbHasType?(:ELECTRIC)
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
def pbEffectAfterAllHits(user, target)
|
||||
if !user.effects[PBEffects::DoubleShock]
|
||||
user.effects[PBEffects::DoubleShock] = true
|
||||
@battle.pbDisplay(_INTL("{1} used up all its electricity!", user.pbThis))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Target's ability becomes Simple. (Simple Beam)
|
||||
#===============================================================================
|
||||
|
||||
@@ -421,6 +421,38 @@ class Battle::Move::IncreasePowerInElectricTerrain < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Damage is increased by 33% if the move is super-effective. (Electro Drift)
|
||||
#===============================================================================
|
||||
class Battle::Move::IncreasePowerIfSuperEffective < Battle::Move
|
||||
def pbModifyDamage(damageMult, user, target)
|
||||
damageMult = damageMult * 4 / 3 if Effectiveness.super_effective?(target.damageState.typeMod)
|
||||
return damageMult
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Power is doubled 30% of the time. (Fickle Beam)
|
||||
#===============================================================================
|
||||
class Battle::Move::DoublePower30PercentChance < Battle::Move
|
||||
def pbOnStartUse(user, targets)
|
||||
@double_power = @battle.pbRandom(100) < 30
|
||||
if @double_power
|
||||
@battle.pbDisplayBrief(_INTL("{1} is going all out for this attack!", user.pbThis))
|
||||
end
|
||||
end
|
||||
|
||||
def pbBaseDamage(baseDmg, user, target)
|
||||
baseDmg *= 2 if @double_power
|
||||
return baseDmg
|
||||
end
|
||||
|
||||
def pbShowAnimation(id, user, targets, hitNum = 0, showAnimation = true)
|
||||
hitNum = 1 if @double_power
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Power is doubled if the target's HP is down to 1/2 or less. (Brine)
|
||||
#===============================================================================
|
||||
@@ -477,6 +509,20 @@ class Battle::Move::DoublePowerIfTargetPoisoned < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Power is doubled if the target is poisoned, and then poisons the target.
|
||||
# (Barb Barrage)
|
||||
#===============================================================================
|
||||
class Battle::Move::DoublePowerIfTargetPoisonedPoisonTarget < Battle::Move::PoisonTarget
|
||||
def pbBaseDamage(baseDmg, user, target)
|
||||
if target.poisoned? &&
|
||||
(target.effects[PBEffects::Substitute] == 0 || ignoresSubstitute?(user))
|
||||
baseDmg *= 2
|
||||
end
|
||||
return baseDmg
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Power is doubled if the target is paralyzed. Cures the target of paralysis.
|
||||
# (Smelling Salts)
|
||||
@@ -511,6 +557,20 @@ class Battle::Move::DoublePowerIfTargetStatusProblem < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Power is doubled if the target has a status problem, and then burns the
|
||||
# target. (Infernal Parade)
|
||||
#===============================================================================
|
||||
class Battle::Move::DoublePowerIfTargetStatusProblemBurnTarget < Battle::Move::BurnTarget
|
||||
def pbBaseDamage(baseDmg, user, target)
|
||||
if target.pbHasAnyStatus? &&
|
||||
(target.effects[PBEffects::Substitute] == 0 || ignoresSubstitute?(user))
|
||||
baseDmg *= 2
|
||||
end
|
||||
return baseDmg
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Power is doubled if the user has no held item. (Acrobatics)
|
||||
#===============================================================================
|
||||
@@ -895,6 +955,18 @@ class Battle::Move::ProtectUserBanefulBunker < Battle::Move::ProtectMove
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# User is protected against damaging moves this round. If a Pokémon makes
|
||||
# contact with the user while this effect applies, that Pokémon is burned.
|
||||
# (Burning Bulwark)
|
||||
#===============================================================================
|
||||
class Battle::Move::ProtectUserFromDamagingMovesBurningBulwark < Battle::Move::ProtectMove
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@effect = PBEffects::BurningBulwark
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# User is protected against damaging moves this round. Decreases the Attack of
|
||||
# the user of a stopped contact move by 2 stages. (King's Shield)
|
||||
@@ -919,6 +991,19 @@ class Battle::Move::ProtectUserFromDamagingMovesObstruct < Battle::Move::Protect
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# For the rest of this round, the user avoids all damaging moves that would hit
|
||||
# it. If a move that makes contact is stopped by this effect, decreases the
|
||||
# Speed of the Pokémon using that move by 1 stage. Contributes to Protect's
|
||||
# counter. (Silk Trap)
|
||||
#===============================================================================
|
||||
class Battle::Move::ProtectUserFromDamagingMovesSilkTrap < Battle::Move::ProtectMove
|
||||
def initialize(battle, move)
|
||||
super
|
||||
@effect = PBEffects::SilkTrap
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# User is protected against moves that target it this round. Damages the user of
|
||||
# a stopped contact move by 1/8 of its max HP. (Spiky Shield)
|
||||
@@ -1004,9 +1089,11 @@ end
|
||||
class Battle::Move::RemoveProtections < Battle::Move
|
||||
def pbEffectAgainstTarget(user, target)
|
||||
target.effects[PBEffects::BanefulBunker] = false
|
||||
target.effects[PBEffects::BurningBulwark] = false
|
||||
target.effects[PBEffects::KingsShield] = false
|
||||
target.effects[PBEffects::Obstruct] = false
|
||||
target.effects[PBEffects::Protect] = false
|
||||
target.effects[PBEffects::SilkTrap] = false
|
||||
target.effects[PBEffects::SpikyShield] = false
|
||||
target.pbOwnSide.effects[PBEffects::CraftyShield] = false
|
||||
target.pbOwnSide.effects[PBEffects::MatBlock] = false
|
||||
@@ -1047,9 +1134,11 @@ class Battle::Move::HoopaRemoveProtectionsBypassSubstituteLowerUserDef1 < Battle
|
||||
|
||||
def pbEffectAgainstTarget(user, target)
|
||||
target.effects[PBEffects::BanefulBunker] = false
|
||||
target.effects[PBEffects::BurningBulwark] = false
|
||||
target.effects[PBEffects::KingsShield] = false
|
||||
target.effects[PBEffects::Obstruct] = false
|
||||
target.effects[PBEffects::Protect] = false
|
||||
target.effects[PBEffects::SilkTrap] = false
|
||||
target.effects[PBEffects::SpikyShield] = false
|
||||
target.pbOwnSide.effects[PBEffects::CraftyShield] = false
|
||||
target.pbOwnSide.effects[PBEffects::MatBlock] = false
|
||||
@@ -1317,6 +1406,46 @@ class Battle::Move::TypeIsUserFirstType < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# This move's type is the same as the user's second type, only if the user is
|
||||
# Ogerpon. (Ivy Cudgel)
|
||||
#===============================================================================
|
||||
class Battle::Move::TypeDependsOnUserOgerponForm < Battle::Move
|
||||
def pbBaseType(user)
|
||||
if user.isSpecies?(:OGERPON)
|
||||
case user.form
|
||||
when 1
|
||||
return :WATER if GameData::Type.exists?(:WATER)
|
||||
when 2
|
||||
return :FIRE if GameData::Type.exists?(:FIRE)
|
||||
when 3
|
||||
return :ROCK if GameData::Type.exists?(:ROCK)
|
||||
end
|
||||
end
|
||||
return @type
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# This move's type is the same as the user's second type, only if the user is
|
||||
# Ogerpon. (Ivy Cudgel)
|
||||
#===============================================================================
|
||||
class Battle::Move::TypeDependsOnUserTaurosFormRemoveScreens < Battle::Move::RemoveScreens
|
||||
def pbBaseType(user)
|
||||
if user.isSpecies?(:TAUROS)
|
||||
case user.form
|
||||
when 1
|
||||
return :FIGHTING if GameData::Type.exists?(:WATER)
|
||||
when 2
|
||||
return :FIRE if GameData::Type.exists?(:FIRE)
|
||||
when 3
|
||||
return :WATER if GameData::Type.exists?(:ROCK)
|
||||
end
|
||||
end
|
||||
return @type
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Power and type depends on the user's IVs. (Hidden Power)
|
||||
#===============================================================================
|
||||
|
||||
@@ -63,8 +63,8 @@ class Battle::Move::HitTwoTimesTargetThenTargetAlly < Battle::Move
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Hits 3 times. Power is multiplied by the hit number. (Triple Kick)
|
||||
# An accuracy check is performed for each hit.
|
||||
# Hits 3 times. Power is multiplied by the hit number. An accuracy check is
|
||||
# performed for each hit. (Triple Kick)
|
||||
#===============================================================================
|
||||
class Battle::Move::HitThreeTimesPowersUpWithEachHit < Battle::Move
|
||||
def multiHitMove?; return true; end
|
||||
@@ -95,6 +95,27 @@ class Battle::Move::HitThreeTimesAlwaysCriticalHit < Battle::Move
|
||||
def pbCritialOverride(user, target); return 1; end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Hits 10 times in a row. An accuracy check is performed for each hit.
|
||||
# (Population Bomb)
|
||||
#===============================================================================
|
||||
class Battle::Move::HitThreeTimesAlwaysCriticalHit < Battle::Move
|
||||
def multiHitMove?; return true; end
|
||||
|
||||
def pbNumHits(user, targets)
|
||||
return 4 + @battle.pbRandom(7) if user.hasActiveItem?(:LOADEDDICE)
|
||||
return 10
|
||||
end
|
||||
|
||||
def successCheckPerHit?
|
||||
return @accCheckPerHit
|
||||
end
|
||||
|
||||
def pbOnStartUse(user, targets)
|
||||
@accCheckPerHit = !user.hasActiveAbility?(:SKILLLINK) && !user.hasActiveItem?(:LOADEDDICE)
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Hits 2-5 times.
|
||||
#===============================================================================
|
||||
@@ -317,8 +338,8 @@ class Battle::Move::TwoTurnAttackRaiseUserSpAtkSpDefSpd2 < Battle::Move::TwoTurn
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Two turn attack. Ups user's Defense by 1 stage first turn, attacks second turn.
|
||||
# (Skull Bash)
|
||||
# Two turn attack. On the first turn, increases the user's Defense by 1 stage.
|
||||
# On the second turn, does damage. (Skull Bash)
|
||||
#===============================================================================
|
||||
class Battle::Move::TwoTurnAttackChargeRaiseUserDefense1 < Battle::Move::TwoTurnMove
|
||||
attr_reader :statUp
|
||||
@@ -362,6 +383,29 @@ class Battle::Move::TwoTurnAttackChargeRaiseUserSpAtk1 < Battle::Move::TwoTurnMo
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Two turn attack. On the first turn, increases the user's Special Attack by 1
|
||||
# stage. On the second turn, does damage. In rain, takes 1 turn instead.
|
||||
# (Electro Shot)
|
||||
#===============================================================================
|
||||
class Battle::Move::TwoTurnAttackOneTurnInRainChargeRaiseUserSpAtk1 < Battle::Move::TwoTurnAttackChargeRaiseUserSpAtk1
|
||||
def pbIsChargingTurn?(user)
|
||||
ret = super
|
||||
if !user.effects[PBEffects::TwoTurnAttack] &&
|
||||
[:Rain, :HeavyRain].include?(user.effectiveWeather)
|
||||
@powerHerb = false
|
||||
@chargingTurn = true
|
||||
@damagingTurn = true
|
||||
return false
|
||||
end
|
||||
return ret
|
||||
end
|
||||
|
||||
def pbChargingTurnMessage(user, targets)
|
||||
@battle.pbDisplay(_INTL("{1} absorbed electricity!", user.pbThis))
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Two turn attack. Skips first turn, attacks second turn. (Dig)
|
||||
# (Handled in Battler's pbSuccessCheckPerHit): Is semi-invulnerable during use.
|
||||
@@ -488,9 +532,11 @@ class Battle::Move::TwoTurnAttackInvulnerableRemoveProtections < Battle::Move::T
|
||||
|
||||
def pbAttackingTurnEffect(user, target)
|
||||
target.effects[PBEffects::BanefulBunker] = false
|
||||
target.effects[PBEffects::BurningBulwark] = false
|
||||
target.effects[PBEffects::KingsShield] = false
|
||||
target.effects[PBEffects::Obstruct] = false
|
||||
target.effects[PBEffects::Protect] = false
|
||||
target.effects[PBEffects::SilkTrap] = false
|
||||
target.effects[PBEffects::SpikyShield] = false
|
||||
target.pbOwnSide.effects[PBEffects::CraftyShield] = false
|
||||
target.pbOwnSide.effects[PBEffects::MatBlock] = false
|
||||
|
||||
@@ -199,6 +199,19 @@ class Battle::Move::HealUserByHalfOfDamageDoneIfTargetAsleep < Battle::Move
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# User gains half the HP it inflicts as damage. Burns the target. (Matcha Gotcha)
|
||||
#===============================================================================
|
||||
class Battle::Move::HealUserByHalfOfDamageDoneBurnTarget < Battle::Move::BurnTarget
|
||||
def healingMove?; return Settings::MECHANICS_GENERATION >= 6; end
|
||||
|
||||
def pbEffectAgainstTarget(user, target)
|
||||
return if target.damageState.hpLost <= 0
|
||||
hpGain = (target.damageState.hpLost / 2.0).round
|
||||
user.pbRecoverHPFromDrain(hpGain, target)
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# User gains 3/4 the HP it inflicts as damage. (Draining Kiss, Oblivion Wing)
|
||||
#===============================================================================
|
||||
|
||||
@@ -727,6 +727,8 @@ class Battle::Move::UseLastMoveUsed < Battle::Move
|
||||
"ProtectUserFromDamagingMovesObstruct", # Obstruct # Not listed on Bulbapedia
|
||||
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
|
||||
"ProtectUserBanefulBunker", # Baneful Bunker
|
||||
"ProtectUserFromDamagingMovesSilkTrap", # Silk Trap
|
||||
"ProtectUserFromDamagingMovesBurningBulwark", # Burning Bulwark
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat (this move)
|
||||
@@ -960,6 +962,8 @@ class Battle::Move::UseRandomMove < Battle::Move
|
||||
"ProtectUserFromDamagingMovesObstruct", # Obstruct
|
||||
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
|
||||
"ProtectUserBanefulBunker", # Baneful Bunker
|
||||
"ProtectUserFromDamagingMovesSilkTrap", # Silk Trap
|
||||
"ProtectUserFromDamagingMovesBurningBulwark", # Burning Bulwark
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
@@ -1052,6 +1056,8 @@ class Battle::Move::UseRandomMoveFromUserParty < Battle::Move
|
||||
"ProtectUserFromDamagingMovesObstruct", # Obstruct # Not listed on Bulbapedia
|
||||
"ProtectUserFromTargetingMovesSpikyShield", # Spiky Shield
|
||||
"ProtectUserBanefulBunker", # Baneful Bunker
|
||||
"ProtectUserFromDamagingMovesSilkTrap", # Silk Trap
|
||||
"ProtectUserFromDamagingMovesBurningBulwark", # Burning Bulwark
|
||||
# Moves that call other moves
|
||||
"UseLastMoveUsedByTarget", # Mirror Move
|
||||
"UseLastMoveUsed", # Copycat
|
||||
|
||||
Reference in New Issue
Block a user