Merge branch 'dev' into ai

This commit is contained in:
Maruno17
2023-02-05 19:10:25 +00:00
208 changed files with 3123 additions and 3331 deletions

View File

@@ -143,9 +143,9 @@ class Battle
next if battler.opposes?(side)
next if !battler.takesIndirectDamage? || battler.pbHasType?(:FIRE)
@scene.pbDamageAnimation(battler)
battler.pbTakeEffectDamage(battler.totalhp / 8, false) { |hp_lost|
battler.pbTakeEffectDamage(battler.totalhp / 8, false) do |hp_lost|
pbDisplay(_INTL("{1} is hurt by the sea of fire!", battler.pbThis))
}
end
end
end
end
@@ -192,11 +192,11 @@ class Battle
recipient = @battlers[battler.effects[PBEffects::LeechSeed]]
next if !recipient || recipient.fainted?
pbCommonAnimation("LeechSeed", recipient, battler)
battler.pbTakeEffectDamage(battler.totalhp / 8) { |hp_lost|
battler.pbTakeEffectDamage(battler.totalhp / 8) do |hp_lost|
recipient.pbRecoverHPFromDrain(hp_lost, battler,
_INTL("{1}'s health is sapped by Leech Seed!", battler.pbThis))
recipient.pbAbilitiesOnDamageTaken
}
end
recipient.pbFaint if recipient.fainted?
end
end
@@ -259,16 +259,16 @@ class Battle
priority.each do |battler|
battler.effects[PBEffects::Nightmare] = false if !battler.asleep?
next if !battler.effects[PBEffects::Nightmare] || !battler.takesIndirectDamage?
battler.pbTakeEffectDamage(battler.totalhp / 4) { |hp_lost|
battler.pbTakeEffectDamage(battler.totalhp / 4) do |hp_lost|
pbDisplay(_INTL("{1} is locked in a nightmare!", battler.pbThis))
}
end
end
# Curse
priority.each do |battler|
next if !battler.effects[PBEffects::Curse] || !battler.takesIndirectDamage?
battler.pbTakeEffectDamage(battler.totalhp / 4) { |hp_lost|
battler.pbTakeEffectDamage(battler.totalhp / 4) do |hp_lost|
pbDisplay(_INTL("{1} is afflicted by the curse!", battler.pbThis))
}
end
end
end
@@ -301,9 +301,9 @@ class Battle
hpLoss = (Settings::MECHANICS_GENERATION >= 6) ? battler.totalhp / 6 : battler.totalhp / 8
end
@scene.pbDamageAnimation(battler)
battler.pbTakeEffectDamage(hpLoss, false) { |hp_lost|
battler.pbTakeEffectDamage(hpLoss, false) do |hp_lost|
pbDisplay(_INTL("{1} is hurt by {2}!", battler.pbThis, move_name))
}
end
end
#=============================================================================
@@ -319,9 +319,9 @@ class Battle
def pbEOREndBattlerEffects(priority)
# Taunt
pbEORCountDownBattlerEffect(priority, PBEffects::Taunt) { |battler|
pbEORCountDownBattlerEffect(priority, PBEffects::Taunt) do |battler|
pbDisplay(_INTL("{1}'s taunt wore off!", battler.pbThis))
}
end
# Encore
priority.each do |battler|
next if battler.fainted? || battler.effects[PBEffects::Encore] == 0
@@ -339,34 +339,34 @@ class Battle
end
end
# Disable/Cursed Body
pbEORCountDownBattlerEffect(priority, PBEffects::Disable) { |battler|
pbEORCountDownBattlerEffect(priority, PBEffects::Disable) do |battler|
battler.effects[PBEffects::DisableMove] = nil
pbDisplay(_INTL("{1} is no longer disabled!", battler.pbThis))
}
end
# Magnet Rise
pbEORCountDownBattlerEffect(priority, PBEffects::MagnetRise) { |battler|
pbEORCountDownBattlerEffect(priority, PBEffects::MagnetRise) do |battler|
pbDisplay(_INTL("{1}'s electromagnetism wore off!", battler.pbThis))
}
end
# Telekinesis
pbEORCountDownBattlerEffect(priority, PBEffects::Telekinesis) { |battler|
pbEORCountDownBattlerEffect(priority, PBEffects::Telekinesis) do |battler|
pbDisplay(_INTL("{1} was freed from the telekinesis!", battler.pbThis))
}
end
# Heal Block
pbEORCountDownBattlerEffect(priority, PBEffects::HealBlock) { |battler|
pbEORCountDownBattlerEffect(priority, PBEffects::HealBlock) do |battler|
pbDisplay(_INTL("{1}'s Heal Block wore off!", battler.pbThis))
}
end
# Embargo
pbEORCountDownBattlerEffect(priority, PBEffects::Embargo) { |battler|
pbEORCountDownBattlerEffect(priority, PBEffects::Embargo) do |battler|
pbDisplay(_INTL("{1} can use items again!", battler.pbThis))
battler.pbItemTerrainStatBoostCheck
}
end
# Yawn
pbEORCountDownBattlerEffect(priority, PBEffects::Yawn) { |battler|
pbEORCountDownBattlerEffect(priority, PBEffects::Yawn) do |battler|
if battler.pbCanSleepYawn?
PBDebug.log("[Lingering effect] #{battler.pbThis} fell asleep because of Yawn")
battler.pbSleep
end
}
end
# Perish Song
perishSongUsers = []
priority.each do |battler|