More Gen 9 move effects

This commit is contained in:
Maruno17
2024-06-24 21:51:49 +01:00
parent 8e9417c3b7
commit ff2d8e5f55
21 changed files with 673 additions and 55 deletions

View File

@@ -66,7 +66,7 @@ class Battle::Battler
def form=(value)
@form = value
@pokemon.form = value if @pokemon
@pokemon.form = value if @pokemon && !@effects[PBEffects::Transform]
end
def ability
@@ -308,15 +308,17 @@ class Battle::Battler
# same type more than once, and should not include any invalid types.
def pbTypes(withExtraType = false)
ret = @types.uniq
# Burn Up erases the Fire-type.
# Burn Up erases the Fire-type
ret.delete(:FIRE) if @effects[PBEffects::BurnUp]
# Roost erases the Flying-type. If there are no types left, adds the Normal-
# type.
# Double Shock erases the Electric-type
ret.delete(:ELECTRIC) if @effects[PBEffects::DoubleShock]
# Roost erases the Flying-type (if there are no types left, adds the Normal-
# type)
if @effects[PBEffects::Roost]
ret.delete(:FLYING)
ret.push(:NORMAL) if ret.length == 0
end
# Add the third type specially.
# Add the third type specially
if withExtraType && @effects[PBEffects::ExtraType] && !ret.include?(@effects[PBEffects::ExtraType])
ret.push(@effects[PBEffects::ExtraType])
end

View File

@@ -152,6 +152,7 @@ class Battle::Battler
b.effects[PBEffects::Attract] = -1 if b.effects[PBEffects::Attract] == @index
end
@effects[PBEffects::BanefulBunker] = false
@effects[PBEffects::BurningBulwark] = false
@effects[PBEffects::BeakBlast] = false
@effects[PBEffects::Bide] = 0
@effects[PBEffects::BideDamage] = 0
@@ -168,6 +169,7 @@ class Battle::Battler
@effects[PBEffects::DestinyBondTarget] = -1
@effects[PBEffects::Disable] = 0
@effects[PBEffects::DisableMove] = nil
@effects[PBEffects::DoubleShock] = false
@effects[PBEffects::Electrify] = false
@effects[PBEffects::Encore] = 0
@effects[PBEffects::EncoreMove] = nil
@@ -243,6 +245,7 @@ class Battle::Battler
@effects[PBEffects::RagePowder] = false
@effects[PBEffects::Rollout] = 0
@effects[PBEffects::Roost] = false
@effects[PBEffects::SilkTrap] = false
@effects[PBEffects::SkyDrop] = -1
@battle.allBattlers.each do |b| # Other battlers no longer Sky Dropped by self
b.effects[PBEffects::SkyDrop] = -1 if b.effects[PBEffects::SkyDrop] == @index

View File

@@ -135,6 +135,7 @@ class Battle::Battler
@effects[PBEffects::ExtraType] = nil
end
@effects[PBEffects::BurnUp] = false
@effects[PBEffects::DoubleShock] = false
@effects[PBEffects::Roost] = false
end
@@ -142,6 +143,7 @@ class Battle::Battler
@types = @pokemon.types
@effects[PBEffects::ExtraType] = nil
@effects[PBEffects::BurnUp] = false
@effects[PBEffects::DoubleShock] = false
@effects[PBEffects::Roost] = false
end
@@ -293,6 +295,7 @@ class Battle::Battler
oldAbil = @ability_id
@effects[PBEffects::Transform] = true
@effects[PBEffects::TransformSpecies] = target.species
self.form = target.form
pbChangeTypes(target)
self.ability = target.ability
@attack = target.attack

View File

@@ -106,7 +106,9 @@ class Battle::Battler
end
end
@effects[PBEffects::BeakBlast] = false
@effects[PBEffects::Charge] = 0 if @effects[PBEffects::Charge] == 1
if Settings::MECHANICS_GENERATION < 9 || @lastMoveUsedType == :ELECTRIC
@effects[PBEffects::Charge] = 0 if @effects[PBEffects::Charge] == 1
end
@effects[PBEffects::GemConsumed] = nil
@effects[PBEffects::ShellTrap] = false
@battle.allBattlers.each { |b| b.pbContinualAbilityChecks } # Trace, end primordial weathers

View File

@@ -369,6 +369,14 @@ class Battle::Battler
@battle.successStates[user.index].protected = true
return false
end
# Mat Block
if target.pbOwnSide.effects[PBEffects::MatBlock] && move.damagingMove?
# NOTE: Confirmed no common animation for this effect.
@battle.pbDisplay(_INTL("{1} was blocked by the kicked-up mat!", move.name)) if show_message
target.damageState.protected = true
@battle.successStates[user.index].protected = true
return false
end
# King's Shield
if target.effects[PBEffects::KingsShield] && move.damagingMove?
if show_message
@@ -383,6 +391,34 @@ class Battle::Battler
end
return false
end
# Obstruct
if target.effects[PBEffects::Obstruct] && move.damagingMove?
if show_message
@battle.pbCommonAnimation("Obstruct", target)
@battle.pbDisplay(_INTL("{1} protected itself!", target.pbThis))
end
target.damageState.protected = true
@battle.successStates[user.index].protected = true
if move.pbContactMove?(user) && user.affectedByContactEffect? &&
user.pbCanLowerStatStage?(:DEFENSE, target)
user.pbLowerStatStage(:DEFENSE, 2, target)
end
return false
end
# Silk Trap
if target.effects[PBEffects::SilkTrap] && move.damagingMove?
if show_message
@battle.pbCommonAnimation("SilkTrap", target)
@battle.pbDisplay(_INTL("{1} protected itself!", target.pbThis))
end
target.damageState.protected = true
@battle.successStates[user.index].protected = true
if move.pbContactMove?(user) && user.affectedByContactEffect? &&
user.pbCanLowerStatStage?(:SPEED, target)
user.pbLowerStatStage(:SPEED, 1, target)
end
return false
end
# Spiky Shield
if target.effects[PBEffects::SpikyShield]
if show_message
@@ -413,28 +449,20 @@ class Battle::Battler
end
return false
end
# Obstruct
if target.effects[PBEffects::Obstruct] && move.damagingMove?
# Burning Bulwark
if target.effects[PBEffects::BurningBulwark]
if show_message
@battle.pbCommonAnimation("Obstruct", target)
@battle.pbCommonAnimation("BurningBulwark", target)
@battle.pbDisplay(_INTL("{1} protected itself!", target.pbThis))
end
target.damageState.protected = true
@battle.successStates[user.index].protected = true
if move.pbContactMove?(user) && user.affectedByContactEffect? &&
user.pbCanLowerStatStage?(:DEFENSE, target)
user.pbLowerStatStage(:DEFENSE, 2, target)
user.pbCanBurn?(target, false)
user.pbBurn(target)
end
return false
end
# Mat Block
if target.pbOwnSide.effects[PBEffects::MatBlock] && move.damagingMove?
# NOTE: Confirmed no common animation for this effect.
@battle.pbDisplay(_INTL("{1} was blocked by the kicked-up mat!", move.name)) if show_message
target.damageState.protected = true
@battle.successStates[user.index].protected = true
return false
end
end
end
# Magic Coat/Magic Bounce