mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 06:34:59 +00:00
More aligning of code
This commit is contained in:
@@ -701,8 +701,8 @@ class Battle
|
||||
@field.weather = newWeather
|
||||
duration = (fixedDuration) ? 5 : -1
|
||||
if duration > 0 && user && user.itemActive?
|
||||
duration = Battle::ItemEffects.triggerWeatherExtender(user.item,
|
||||
@field.weather, duration, user, self)
|
||||
duration = Battle::ItemEffects.triggerWeatherExtender(user.item, @field.weather,
|
||||
duration, user, self)
|
||||
end
|
||||
@field.weatherDuration = duration
|
||||
weather_data = GameData::BattleWeather.try_get(@field.weather)
|
||||
@@ -779,8 +779,8 @@ class Battle
|
||||
@field.terrain = newTerrain
|
||||
duration = (fixedDuration) ? 5 : -1
|
||||
if duration > 0 && user && user.itemActive?
|
||||
duration = Battle::ItemEffects.triggerTerrainExtender(user.item,
|
||||
newTerrain, duration, user, self)
|
||||
duration = Battle::ItemEffects.triggerTerrainExtender(user.item, newTerrain,
|
||||
duration, user, self)
|
||||
end
|
||||
@field.terrainDuration = duration
|
||||
terrain_data = GameData::BattleTerrain.try_get(@field.terrain)
|
||||
|
||||
@@ -56,14 +56,14 @@ class Battle
|
||||
# Compare the have values with the need values
|
||||
if requireds.length > sideCounts.length
|
||||
raise _INTL("Error: def pbGetOwnerIndexFromBattlerIndex gives invalid owner index ({1} for battle type {2}v{3}, trainers {4}v{5})",
|
||||
requireds.length - 1, @sideSizes[0], @sideSizes[1], side1counts.length, side2counts.length)
|
||||
requireds.length - 1, @sideSizes[0], @sideSizes[1], side1counts.length, side2counts.length)
|
||||
end
|
||||
sideCounts.each_with_index do |_count, i|
|
||||
if !requireds[i] || requireds[i] == 0
|
||||
raise _INTL("Player-side trainer {1} has no battler position for their Pokémon to go (trying {2}v{3} battle)",
|
||||
i + 1, @sideSizes[0], @sideSizes[1]) if side == 0
|
||||
i + 1, @sideSizes[0], @sideSizes[1]) if side == 0
|
||||
raise _INTL("Opposing trainer {1} has no battler position for their Pokémon to go (trying {2}v{3} battle)",
|
||||
i + 1, @sideSizes[0], @sideSizes[1]) if side == 1
|
||||
i + 1, @sideSizes[0], @sideSizes[1]) if side == 1
|
||||
end
|
||||
next if requireds[i] <= sideCounts[i] # Trainer has enough Pokémon to fill their positions
|
||||
if requireds[i] == 1
|
||||
@@ -166,10 +166,10 @@ class Battle
|
||||
pbDisplayPaused(_INTL("Oh! A wild {1} appeared!", foeParty[0].name))
|
||||
when 2
|
||||
pbDisplayPaused(_INTL("Oh! A wild {1} and {2} appeared!", foeParty[0].name,
|
||||
foeParty[1].name))
|
||||
foeParty[1].name))
|
||||
when 3
|
||||
pbDisplayPaused(_INTL("Oh! A wild {1}, {2} and {3} appeared!", foeParty[0].name,
|
||||
foeParty[1].name, foeParty[2].name))
|
||||
foeParty[1].name, foeParty[2].name))
|
||||
end
|
||||
else # Trainer battle
|
||||
case @opponent.length
|
||||
@@ -177,10 +177,10 @@ class Battle
|
||||
pbDisplayPaused(_INTL("You are challenged by {1}!", @opponent[0].full_name))
|
||||
when 2
|
||||
pbDisplayPaused(_INTL("You are challenged by {1} and {2}!", @opponent[0].full_name,
|
||||
@opponent[1].full_name))
|
||||
@opponent[1].full_name))
|
||||
when 3
|
||||
pbDisplayPaused(_INTL("You are challenged by {1}, {2} and {3}!",
|
||||
@opponent[0].full_name, @opponent[1].full_name, @opponent[2].full_name))
|
||||
@opponent[0].full_name, @opponent[1].full_name, @opponent[2].full_name))
|
||||
end
|
||||
end
|
||||
# Send out Pokémon (opposing trainers first)
|
||||
@@ -199,10 +199,10 @@ class Battle
|
||||
msg += _INTL("{1} sent out {2}!", t.full_name, @battlers[sent[0]].name)
|
||||
when 2
|
||||
msg += _INTL("{1} sent out {2} and {3}!", t.full_name,
|
||||
@battlers[sent[0]].name, @battlers[sent[1]].name)
|
||||
@battlers[sent[0]].name, @battlers[sent[1]].name)
|
||||
when 3
|
||||
msg += _INTL("{1} sent out {2}, {3} and {4}!", t.full_name,
|
||||
@battlers[sent[0]].name, @battlers[sent[1]].name, @battlers[sent[2]].name)
|
||||
@battlers[sent[0]].name, @battlers[sent[1]].name, @battlers[sent[2]].name)
|
||||
end
|
||||
toSendOut.concat(sent)
|
||||
end
|
||||
@@ -217,7 +217,7 @@ class Battle
|
||||
msg += _INTL("Go! {1} and {2}!", @battlers[sent[0]].name, @battlers[sent[1]].name)
|
||||
when 3
|
||||
msg += _INTL("Go! {1}, {2} and {3}!", @battlers[sent[0]].name,
|
||||
@battlers[sent[1]].name, @battlers[sent[2]].name)
|
||||
@battlers[sent[1]].name, @battlers[sent[2]].name)
|
||||
end
|
||||
toSendOut.concat(sent)
|
||||
end
|
||||
@@ -403,10 +403,10 @@ class Battle
|
||||
pbDisplayPaused(_INTL("You defeated {1}!", @opponent[0].full_name))
|
||||
when 2
|
||||
pbDisplayPaused(_INTL("You defeated {1} and {2}!", @opponent[0].full_name,
|
||||
@opponent[1].full_name))
|
||||
@opponent[1].full_name))
|
||||
when 3
|
||||
pbDisplayPaused(_INTL("You defeated {1}, {2} and {3}!", @opponent[0].full_name,
|
||||
@opponent[1].full_name, @opponent[2].full_name))
|
||||
@opponent[1].full_name, @opponent[2].full_name))
|
||||
end
|
||||
@opponent.each_with_index do |_t, i|
|
||||
@scene.pbShowOpponent(i)
|
||||
@@ -431,10 +431,10 @@ class Battle
|
||||
pbDisplayPaused(_INTL("You lost against {1}!", @opponent[0].full_name))
|
||||
when 2
|
||||
pbDisplayPaused(_INTL("You lost against {1} and {2}!",
|
||||
@opponent[0].full_name, @opponent[1].full_name))
|
||||
@opponent[0].full_name, @opponent[1].full_name))
|
||||
when 3
|
||||
pbDisplayPaused(_INTL("You lost against {1}, {2} and {3}!",
|
||||
@opponent[0].full_name, @opponent[1].full_name, @opponent[2].full_name))
|
||||
@opponent[0].full_name, @opponent[1].full_name, @opponent[2].full_name))
|
||||
end
|
||||
end
|
||||
# Lose money from losing a battle
|
||||
|
||||
@@ -174,7 +174,7 @@ class Battle
|
||||
if newLevel < curLevel
|
||||
debugInfo = "Levels: #{curLevel}->#{newLevel} | Exp: #{pkmn.exp}->#{expFinal} | gain: #{expGained}"
|
||||
raise _INTL("{1}'s new level is less than its\r\ncurrent level, which shouldn't happen.\r\n[Debug: {2}]",
|
||||
pkmn.name, debugInfo)
|
||||
pkmn.name, debugInfo)
|
||||
end
|
||||
# Give Exp
|
||||
if pkmn.shadowPokemon?
|
||||
@@ -219,7 +219,7 @@ class Battle
|
||||
@scene.pbRefreshOne(battler.index) if battler
|
||||
pbDisplayPaused(_INTL("{1} grew to Lv. {2}!", pkmn.name, curLevel))
|
||||
@scene.pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense,
|
||||
oldSpAtk, oldSpDef, oldSpeed)
|
||||
oldSpAtk, oldSpDef, oldSpeed)
|
||||
# Learn all moves learned at this level
|
||||
moveList = pkmn.getMoveList
|
||||
moveList.each { |m| pbLearnMove(idxParty, m[1]) if m[0] == curLevel }
|
||||
@@ -249,7 +249,7 @@ class Battle
|
||||
end
|
||||
# Pokémon already knows the maximum number of moves; try to forget one to learn the new move
|
||||
pbDisplayPaused(_INTL("{1} wants to learn {2}, but it already knows {3} moves.",
|
||||
pkmnName, moveName, pkmn.numMoves.to_word))
|
||||
pkmnName, moveName, pkmn.numMoves.to_word))
|
||||
if pbDisplayConfirm(_INTL("Should {1} forget a move to learn {2}?", pkmnName, moveName))
|
||||
loop do
|
||||
forgetMove = @scene.pbForgetMove(pkmn, newMove)
|
||||
|
||||
@@ -19,18 +19,16 @@ class Battle
|
||||
if partyScene
|
||||
owner = pbGetOwnerFromPartyIndex(idxBattler, idxParty)
|
||||
partyScene.pbDisplay(_INTL("You can't switch {1}'s Pokémon with one of yours!",
|
||||
owner.name))
|
||||
owner.name))
|
||||
end
|
||||
return false
|
||||
end
|
||||
if party[idxParty].fainted?
|
||||
partyScene.pbDisplay(_INTL("{1} has no energy left to battle!",
|
||||
party[idxParty].name)) if partyScene
|
||||
partyScene.pbDisplay(_INTL("{1} has no energy left to battle!", party[idxParty].name)) if partyScene
|
||||
return false
|
||||
end
|
||||
if pbFindBattler(idxParty, idxBattler)
|
||||
partyScene.pbDisplay(_INTL("{1} is already in battle!",
|
||||
party[idxParty].name)) if partyScene
|
||||
partyScene.pbDisplay(_INTL("{1} is already in battle!", party[idxParty].name)) if partyScene
|
||||
return false
|
||||
end
|
||||
return true
|
||||
@@ -48,7 +46,7 @@ class Battle
|
||||
allSameSideBattlers(idxBattler).each do |b|
|
||||
next if choices[b.index][0] != :SwitchOut || choices[b.index][1] != idxParty
|
||||
partyScene.pbDisplay(_INTL("{1} has already been selected.",
|
||||
pbParty(idxBattler)[idxParty].name)) if partyScene
|
||||
pbParty(idxBattler)[idxParty].name)) if partyScene
|
||||
return false
|
||||
end
|
||||
# Check whether battler can switch out
|
||||
@@ -77,7 +75,7 @@ class Battle
|
||||
next if !b.abilityActive?
|
||||
if Battle::AbilityEffects.triggerTrappingByTarget(b.ability, battler, b, self)
|
||||
partyScene.pbDisplay(_INTL("{1}'s {2} prevents switching!",
|
||||
b.pbThis, b.abilityName)) if partyScene
|
||||
b.pbThis, b.abilityName)) if partyScene
|
||||
return false
|
||||
end
|
||||
end
|
||||
@@ -85,7 +83,7 @@ class Battle
|
||||
next if !b.itemActive?
|
||||
if Battle::ItemEffects.triggerTrappingByTarget(b.item, battler, b, self)
|
||||
partyScene.pbDisplay(_INTL("{1}'s {2} prevents switching!",
|
||||
b.pbThis, b.itemName)) if partyScene
|
||||
b.pbThis, b.itemName)) if partyScene
|
||||
return false
|
||||
end
|
||||
end
|
||||
@@ -172,7 +170,7 @@ class Battle
|
||||
idxPartyForName = new_index if new_index >= 0 && new_index != idxPartyNew
|
||||
end
|
||||
if pbDisplayConfirm(_INTL("{1} is about to send in {2}. Will you switch your Pokémon?",
|
||||
opponent.full_name, enemyParty[idxPartyForName].name))
|
||||
opponent.full_name, enemyParty[idxPartyForName].name))
|
||||
idxPlayerPartyNew = pbSwitchInBetween(0, false, true)
|
||||
if idxPlayerPartyNew >= 0
|
||||
pbMessageOnRecall(@battlers[0])
|
||||
|
||||
@@ -10,7 +10,7 @@ class Battle
|
||||
# Embargo
|
||||
if battler && battler.effects[PBEffects::Embargo] > 0
|
||||
scene.pbDisplay(_INTL("Embargo's effect prevents the item's use on {1}!",
|
||||
battler.pbThis(true))) if showMessages
|
||||
battler.pbThis(true))) if showMessages
|
||||
return false
|
||||
end
|
||||
return true
|
||||
|
||||
@@ -140,7 +140,7 @@ class Battle
|
||||
pbDisplay(_INTL("{1}'s fervent wish has reached {2}!", trainerName, battler.pbThis))
|
||||
else
|
||||
pbDisplay(_INTL("{1}'s {2} is reacting to {3}'s {4}!",
|
||||
battler.pbThis, battler.itemName, trainerName, pbGetMegaRingName(idxBattler)))
|
||||
battler.pbThis, battler.itemName, trainerName, pbGetMegaRingName(idxBattler)))
|
||||
end
|
||||
pbCommonAnimation("MegaEvolution", battler)
|
||||
battler.pokemon.makeMega
|
||||
|
||||
@@ -128,8 +128,8 @@ class Battle
|
||||
next false
|
||||
end
|
||||
next false if !pkmn
|
||||
next false if !ItemHandlers.triggerCanUseInBattle(item,
|
||||
pkmn, battler, idxMove, firstAction, self, itemScene)
|
||||
next false if !ItemHandlers.triggerCanUseInBattle(item, pkmn, battler, idxMove,
|
||||
firstAction, self, itemScene)
|
||||
next false if !pbRegisterItem(idxBattler, item, idxPkmn, idxMove)
|
||||
ret = true
|
||||
next true
|
||||
|
||||
@@ -231,7 +231,7 @@ class Battle
|
||||
next if !moveUser # User is fainted
|
||||
move = pos.effects[PBEffects::FutureSightMove]
|
||||
pbDisplay(_INTL("{1} took the {2} attack!", @battlers[idxPos].pbThis,
|
||||
GameData::Move.get(move).name))
|
||||
GameData::Move.get(move).name))
|
||||
# NOTE: Future Sight failing against the target here doesn't count towards
|
||||
# Stomping Tantrum.
|
||||
userLastMoveFailed = moveUser.lastMoveFailed
|
||||
@@ -332,7 +332,7 @@ class Battle
|
||||
pbCommonAnimation("LeechSeed", recipient, b)
|
||||
b.pbTakeEffectDamage(b.totalhp / 8) { |hp_lost|
|
||||
recipient.pbRecoverHPFromDrain(hp_lost, b,
|
||||
_INTL("{1}'s health is sapped by Leech Seed!", b.pbThis))
|
||||
_INTL("{1}'s health is sapped by Leech Seed!", b.pbThis))
|
||||
recipient.pbAbilitiesOnDamageTaken
|
||||
}
|
||||
recipient.pbFaint if recipient.fainted?
|
||||
@@ -519,53 +519,53 @@ class Battle
|
||||
for side in 0...2
|
||||
# Reflect
|
||||
pbEORCountDownSideEffect(side, PBEffects::Reflect,
|
||||
_INTL("{1}'s Reflect wore off!", @battlers[side].pbTeam))
|
||||
_INTL("{1}'s Reflect wore off!", @battlers[side].pbTeam))
|
||||
# Light Screen
|
||||
pbEORCountDownSideEffect(side, PBEffects::LightScreen,
|
||||
_INTL("{1}'s Light Screen wore off!", @battlers[side].pbTeam))
|
||||
_INTL("{1}'s Light Screen wore off!", @battlers[side].pbTeam))
|
||||
# Safeguard
|
||||
pbEORCountDownSideEffect(side, PBEffects::Safeguard,
|
||||
_INTL("{1} is no longer protected by Safeguard!", @battlers[side].pbTeam))
|
||||
_INTL("{1} is no longer protected by Safeguard!", @battlers[side].pbTeam))
|
||||
# Mist
|
||||
pbEORCountDownSideEffect(side, PBEffects::Mist,
|
||||
_INTL("{1} is no longer protected by mist!", @battlers[side].pbTeam))
|
||||
_INTL("{1} is no longer protected by mist!", @battlers[side].pbTeam))
|
||||
# Tailwind
|
||||
pbEORCountDownSideEffect(side, PBEffects::Tailwind,
|
||||
_INTL("{1}'s Tailwind petered out!", @battlers[side].pbTeam))
|
||||
_INTL("{1}'s Tailwind petered out!", @battlers[side].pbTeam))
|
||||
# Lucky Chant
|
||||
pbEORCountDownSideEffect(side, PBEffects::LuckyChant,
|
||||
_INTL("{1}'s Lucky Chant wore off!", @battlers[side].pbTeam))
|
||||
_INTL("{1}'s Lucky Chant wore off!", @battlers[side].pbTeam))
|
||||
# Pledge Rainbow
|
||||
pbEORCountDownSideEffect(side, PBEffects::Rainbow,
|
||||
_INTL("The rainbow on {1}'s side disappeared!", @battlers[side].pbTeam(true)))
|
||||
_INTL("The rainbow on {1}'s side disappeared!", @battlers[side].pbTeam(true)))
|
||||
# Pledge Sea of Fire
|
||||
pbEORCountDownSideEffect(side, PBEffects::SeaOfFire,
|
||||
_INTL("The sea of fire around {1} disappeared!", @battlers[side].pbTeam(true)))
|
||||
_INTL("The sea of fire around {1} disappeared!", @battlers[side].pbTeam(true)))
|
||||
# Pledge Swamp
|
||||
pbEORCountDownSideEffect(side, PBEffects::Swamp,
|
||||
_INTL("The swamp around {1} disappeared!", @battlers[side].pbTeam(true)))
|
||||
_INTL("The swamp around {1} disappeared!", @battlers[side].pbTeam(true)))
|
||||
# Aurora Veil
|
||||
pbEORCountDownSideEffect(side, PBEffects::AuroraVeil,
|
||||
_INTL("{1}'s Aurora Veil wore off!", @battlers[side].pbTeam(true)))
|
||||
_INTL("{1}'s Aurora Veil wore off!", @battlers[side].pbTeam(true)))
|
||||
end
|
||||
# Trick Room
|
||||
pbEORCountDownFieldEffect(PBEffects::TrickRoom,
|
||||
_INTL("The twisted dimensions returned to normal!"))
|
||||
_INTL("The twisted dimensions returned to normal!"))
|
||||
# Gravity
|
||||
pbEORCountDownFieldEffect(PBEffects::Gravity,
|
||||
_INTL("Gravity returned to normal!"))
|
||||
_INTL("Gravity returned to normal!"))
|
||||
# Water Sport
|
||||
pbEORCountDownFieldEffect(PBEffects::WaterSportField,
|
||||
_INTL("The effects of Water Sport have faded."))
|
||||
_INTL("The effects of Water Sport have faded."))
|
||||
# Mud Sport
|
||||
pbEORCountDownFieldEffect(PBEffects::MudSportField,
|
||||
_INTL("The effects of Mud Sport have faded."))
|
||||
_INTL("The effects of Mud Sport have faded."))
|
||||
# Wonder Room
|
||||
pbEORCountDownFieldEffect(PBEffects::WonderRoom,
|
||||
_INTL("Wonder Room wore off, and Defense and Sp. Def stats returned to normal!"))
|
||||
_INTL("Wonder Room wore off, and Defense and Sp. Def stats returned to normal!"))
|
||||
# Magic Room
|
||||
pbEORCountDownFieldEffect(PBEffects::MagicRoom,
|
||||
_INTL("Magic Room wore off, and held items' effects returned to normal!"))
|
||||
_INTL("Magic Room wore off, and held items' effects returned to normal!"))
|
||||
# End of terrains
|
||||
pbEORTerrain
|
||||
priority.each do |b|
|
||||
|
||||
@@ -62,7 +62,7 @@ class Battle::Battler
|
||||
when :Electric
|
||||
if newStatus == :SLEEP
|
||||
@battle.pbDisplay(_INTL("{1} surrounds itself with electrified terrain!",
|
||||
pbThis(true))) if showMessages
|
||||
pbThis(true))) if showMessages
|
||||
return false
|
||||
end
|
||||
when :Misty
|
||||
@@ -133,19 +133,19 @@ class Battle::Battler
|
||||
case newStatus
|
||||
when :SLEEP
|
||||
msg = _INTL("{1} stays awake because of {2}'s {3}!",
|
||||
pbThis, immAlly.pbThis(true), immAlly.abilityName)
|
||||
pbThis, immAlly.pbThis(true), immAlly.abilityName)
|
||||
when :POISON
|
||||
msg = _INTL("{1} cannot be poisoned because of {2}'s {3}!",
|
||||
pbThis, immAlly.pbThis(true), immAlly.abilityName)
|
||||
pbThis, immAlly.pbThis(true), immAlly.abilityName)
|
||||
when :BURN
|
||||
msg = _INTL("{1} cannot be burned because of {2}'s {3}!",
|
||||
pbThis, immAlly.pbThis(true), immAlly.abilityName)
|
||||
pbThis, immAlly.pbThis(true), immAlly.abilityName)
|
||||
when :PARALYSIS
|
||||
msg = _INTL("{1} cannot be paralyzed because of {2}'s {3}!",
|
||||
pbThis, immAlly.pbThis(true), immAlly.abilityName)
|
||||
pbThis, immAlly.pbThis(true), immAlly.abilityName)
|
||||
when :FROZEN
|
||||
msg = _INTL("{1} cannot be frozen solid because of {2}'s {3}!",
|
||||
pbThis, immAlly.pbThis(true), immAlly.abilityName)
|
||||
pbThis, immAlly.pbThis(true), immAlly.abilityName)
|
||||
end
|
||||
else
|
||||
case newStatus
|
||||
|
||||
@@ -15,7 +15,7 @@ class Battle::Battler
|
||||
# Check the stat stage
|
||||
if statStageAtMax?(stat)
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} won't go any higher!",
|
||||
pbThis, GameData::Stat.get(stat).name)) if showFailMsg
|
||||
pbThis, GameData::Stat.get(stat).name)) if showFailMsg
|
||||
return false
|
||||
end
|
||||
return true
|
||||
@@ -142,22 +142,25 @@ class Battle::Battler
|
||||
end
|
||||
if abilityActive?
|
||||
return false if !@battle.moldBreaker && Battle::AbilityEffects.triggerStatLossImmunity(
|
||||
self.ability, self, stat, @battle, showFailMsg)
|
||||
self.ability, self, stat, @battle, showFailMsg
|
||||
)
|
||||
return false if Battle::AbilityEffects.triggerStatLossImmunityNonIgnorable(
|
||||
self.ability, self, stat, @battle, showFailMsg)
|
||||
self.ability, self, stat, @battle, showFailMsg
|
||||
)
|
||||
end
|
||||
if !@battle.moldBreaker
|
||||
allAllies.each do |b|
|
||||
next if !b.abilityActive?
|
||||
return false if Battle::AbilityEffects.triggerStatLossImmunityFromAlly(
|
||||
b.ability, b, self, stat, @battle, showFailMsg)
|
||||
b.ability, b, self, stat, @battle, showFailMsg
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
# Check the stat stage
|
||||
if statStageAtMin?(stat)
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} won't go any lower!",
|
||||
pbThis, GameData::Stat.get(stat).name)) if showFailMsg
|
||||
pbThis, GameData::Stat.get(stat).name)) if showFailMsg
|
||||
return false
|
||||
end
|
||||
return true
|
||||
@@ -298,7 +301,7 @@ class Battle::Battler
|
||||
@battle.pbDisplay(_INTL("{1} is protected by its substitute!", pbThis))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1}'s substitute protected it from {2}'s {3}!",
|
||||
pbThis, user.pbThis(true), user.abilityName))
|
||||
pbThis, user.pbThis(true), user.abilityName))
|
||||
end
|
||||
return false
|
||||
end
|
||||
@@ -308,7 +311,7 @@ class Battle::Battler
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} cannot be lowered!", pbThis, GameData::Stat.get(:ATTACK).name))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} prevents {3} loss!", pbThis, abilityName,
|
||||
GameData::Stat.get(:ATTACK).name))
|
||||
GameData::Stat.get(:ATTACK).name))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(self)
|
||||
return false
|
||||
@@ -322,14 +325,14 @@ class Battle::Battler
|
||||
if !hasActiveAbility?(:CONTRARY)
|
||||
if pbOwnSide.effects[PBEffects::Mist] > 0
|
||||
@battle.pbDisplay(_INTL("{1} is protected from {2}'s {3} by Mist!",
|
||||
pbThis, user.pbThis(true), user.abilityName))
|
||||
pbThis, user.pbThis(true), user.abilityName))
|
||||
return false
|
||||
end
|
||||
if abilityActive?
|
||||
if Battle::AbilityEffects.triggerStatLossImmunity(self.ability, self, :ATTACK, @battle, false) ||
|
||||
Battle::AbilityEffects.triggerStatLossImmunityNonIgnorable(self.ability, self, :ATTACK, @battle, false)
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} prevented {3}'s {4} from working!",
|
||||
pbThis, abilityName, user.pbThis(true), user.abilityName))
|
||||
pbThis, abilityName, user.pbThis(true), user.abilityName))
|
||||
return false
|
||||
end
|
||||
end
|
||||
@@ -337,7 +340,7 @@ class Battle::Battler
|
||||
next if !b.abilityActive?
|
||||
if Battle::AbilityEffects.triggerStatLossImmunityFromAlly(b.ability, b, self, :ATTACK, @battle, false)
|
||||
@battle.pbDisplay(_INTL("{1} is protected from {2}'s {3} by {4}'s {5}!",
|
||||
pbThis, user.pbThis(true), user.abilityName, b.pbThis(true), b.abilityName))
|
||||
pbThis, user.pbThis(true), user.abilityName, b.pbThis(true), b.abilityName))
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
@@ -124,7 +124,7 @@ class Battle::Battler
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
|
||||
pbThis, abilityName, move.name))
|
||||
pbThis, abilityName, move.name))
|
||||
end
|
||||
end
|
||||
@battle.pbHideAbilitySplash(self)
|
||||
@@ -154,7 +154,7 @@ class Battle::Battler
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...", pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
|
||||
pbThis, abilityName, move.name))
|
||||
pbThis, abilityName, move.name))
|
||||
end
|
||||
end
|
||||
@battle.pbHideAbilitySplash(self)
|
||||
@@ -249,10 +249,10 @@ class Battle::Battler
|
||||
@battle.pbShowAbilitySplash(b)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("{1} shared its {2} with {3}!",
|
||||
b.pbThis, b.itemName, pbThis(true)))
|
||||
b.pbThis, b.itemName, pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} let it share its {3} with {4}!",
|
||||
b.pbThis, b.abilityName, b.itemName, pbThis(true)))
|
||||
b.pbThis, b.abilityName, b.itemName, pbThis(true)))
|
||||
end
|
||||
self.item = b.item
|
||||
b.item = nil
|
||||
|
||||
@@ -557,7 +557,7 @@ class Battle::Battler
|
||||
@battle.pbHideAbilitySplash(nextUser)
|
||||
if !Battle::Scene::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("{1} kept the dance going with {2}!",
|
||||
nextUser.pbThis, nextUser.abilityName))
|
||||
nextUser.pbThis, nextUser.abilityName))
|
||||
end
|
||||
nextUser.effects[PBEffects::Dancer] = true
|
||||
if nextUser.pbCanChooseMove?(move, false)
|
||||
@@ -641,7 +641,7 @@ class Battle::Battler
|
||||
# actual removal of the item happens in def pbEffectsAfterMove.
|
||||
@battle.pbCommonAnimation("UseItem", user)
|
||||
@battle.pbDisplay(_INTL("The {1} strengthened {2}'s power!",
|
||||
GameData::Item.get(user.effects[PBEffects::GemConsumed]).name, move.name))
|
||||
GameData::Item.get(user.effects[PBEffects::GemConsumed]).name, move.name))
|
||||
end
|
||||
# Messages about missed target(s) (relevant for multi-target moves only)
|
||||
if !move.pbRepeatHit?
|
||||
|
||||
@@ -87,8 +87,7 @@ class Battle::Battler
|
||||
# executing them)
|
||||
if hasActiveItem?(:ASSAULTVEST) && move.statusMove? && move.id != :MEFIRST && commandPhase
|
||||
if showMessages
|
||||
msg = _INTL("The effects of the {1} prevent status moves from being used!",
|
||||
itemName)
|
||||
msg = _INTL("The effects of the {1} prevent status moves from being used!", itemName)
|
||||
(commandPhase) ? @battle.pbDisplayPaused(msg) : @battle.pbDisplay(msg)
|
||||
end
|
||||
return false
|
||||
@@ -277,7 +276,7 @@ class Battle::Battler
|
||||
if @effects[PBEffects::Attract] >= 0
|
||||
@battle.pbCommonAnimation("Attract", self)
|
||||
@battle.pbDisplay(_INTL("{1} is in love with {2}!", pbThis,
|
||||
@battle.battlers[@effects[PBEffects::Attract]].pbThis(true)))
|
||||
@battle.battlers[@effects[PBEffects::Attract]].pbThis(true)))
|
||||
if @battle.pbRandom(100) < 50
|
||||
@battle.pbDisplay(_INTL("{1} is immobilized by love!", pbThis))
|
||||
@lastMoveFailed = true
|
||||
|
||||
@@ -71,7 +71,7 @@ class Battle::Battler
|
||||
if target.effects[PBEffects::Grudge] && target.fainted?
|
||||
move.pp = 0
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} lost all of its PP due to the grudge!",
|
||||
user.pbThis, move.name))
|
||||
user.pbThis, move.name))
|
||||
end
|
||||
# Destiny Bond (recording that it should apply)
|
||||
if target.effects[PBEffects::DestinyBond] && target.fainted?
|
||||
|
||||
@@ -86,8 +86,8 @@ class Battle::Move
|
||||
return false if @battle.moldBreaker
|
||||
ret = false
|
||||
if target.abilityActive?
|
||||
ret = Battle::AbilityEffects.triggerMoveImmunity(target.ability,
|
||||
user, target, self, @calcType, @battle, show_message)
|
||||
ret = Battle::AbilityEffects.triggerMoveImmunity(target.ability, user, target,
|
||||
self, @calcType, @battle, show_message)
|
||||
end
|
||||
return ret
|
||||
end
|
||||
@@ -131,7 +131,7 @@ class Battle::Move
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!",
|
||||
target.pbThis, target.abilityName))
|
||||
target.pbThis, target.abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(target)
|
||||
end
|
||||
@@ -145,7 +145,7 @@ class Battle::Move
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected because of {2}'s {3}!",
|
||||
target.pbThis, b.pbThis(true), b.abilityName))
|
||||
target.pbThis, b.pbThis(true), b.abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(target)
|
||||
end
|
||||
@@ -294,7 +294,7 @@ class Battle::Move
|
||||
if target.damageState.affection_critical
|
||||
if numTargets > 1
|
||||
@battle.pbDisplay(_INTL("{1} landed a critical hit on {2}, wishing to be praised!",
|
||||
user.pbThis, target.pbThis(true)))
|
||||
user.pbThis, target.pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} landed a critical hit, wishing to be praised!", user.pbThis))
|
||||
end
|
||||
|
||||
@@ -131,26 +131,31 @@ class Battle::Move
|
||||
def pbCalcAccuracyModifiers(user, target, modifiers)
|
||||
# Ability effects that alter accuracy calculation
|
||||
if user.abilityActive?
|
||||
Battle::AbilityEffects.triggerAccuracyCalcFromUser(user.ability,
|
||||
modifiers, user, target, self, @calcType)
|
||||
Battle::AbilityEffects.triggerAccuracyCalcFromUser(
|
||||
user.ability, modifiers, user, target, self, @calcType
|
||||
)
|
||||
end
|
||||
user.allAllies.each do |b|
|
||||
next if !b.abilityActive?
|
||||
Battle::AbilityEffects.triggerAccuracyCalcFromAlly(b.ability,
|
||||
modifiers, user, target, self, @calcType)
|
||||
Battle::AbilityEffects.triggerAccuracyCalcFromAlly(
|
||||
b.ability, modifiers, user, target, self, @calcType
|
||||
)
|
||||
end
|
||||
if target.abilityActive? && !@battle.moldBreaker
|
||||
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(target.ability,
|
||||
modifiers, user, target, self, @calcType)
|
||||
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(
|
||||
target.ability, modifiers, user, target, self, @calcType
|
||||
)
|
||||
end
|
||||
# Item effects that alter accuracy calculation
|
||||
if user.itemActive?
|
||||
Battle::ItemEffects.triggerAccuracyCalcFromUser(user.item,
|
||||
modifiers, user, target, self, @calcType)
|
||||
Battle::ItemEffects.triggerAccuracyCalcFromUser(
|
||||
user.item, modifiers, user, target, self, @calcType
|
||||
)
|
||||
end
|
||||
if target.itemActive?
|
||||
Battle::ItemEffects.triggerAccuracyCalcFromTarget(target.item,
|
||||
modifiers, user, target, self, @calcType)
|
||||
Battle::ItemEffects.triggerAccuracyCalcFromTarget(
|
||||
target.item, modifiers, user, target, self, @calcType
|
||||
)
|
||||
end
|
||||
# Other effects, inc. ones that set accuracy_multiplier or evasion_stage to
|
||||
# specific values
|
||||
@@ -295,8 +300,9 @@ class Battle::Move
|
||||
end
|
||||
# Ability effects that alter damage
|
||||
if user.abilityActive?
|
||||
Battle::AbilityEffects.triggerDamageCalcFromUser(user.ability,
|
||||
user, target, self, multipliers, baseDmg, type)
|
||||
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
|
||||
@@ -304,29 +310,35 @@ class Battle::Move
|
||||
# how it works.
|
||||
user.allAllies.each do |b|
|
||||
next if !b.abilityActive?
|
||||
Battle::AbilityEffects.triggerDamageCalcFromAlly(b.ability,
|
||||
user, target, self, multipliers, baseDmg, type)
|
||||
Battle::AbilityEffects.triggerDamageCalcFromAlly(
|
||||
b.ability, user, target, self, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
if target.abilityActive?
|
||||
Battle::AbilityEffects.triggerDamageCalcFromTarget(target.ability,
|
||||
user, target, self, multipliers, baseDmg, type) if !@battle.moldBreaker
|
||||
Battle::AbilityEffects.triggerDamageCalcFromTargetNonIgnorable(target.ability,
|
||||
user, target, self, multipliers, baseDmg, type)
|
||||
Battle::AbilityEffects.triggerDamageCalcFromTarget(
|
||||
target.ability, user, target, self, multipliers, baseDmg, type
|
||||
)
|
||||
Battle::AbilityEffects.triggerDamageCalcFromTargetNonIgnorable(
|
||||
target.ability, user, target, self, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
target.allAllies.each do |b|
|
||||
next if !b.abilityActive?
|
||||
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(b.ability,
|
||||
user, target, self, multipliers, baseDmg, type)
|
||||
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(
|
||||
b.ability, user, target, self, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
end
|
||||
# Item effects that alter damage
|
||||
if user.itemActive?
|
||||
Battle::ItemEffects.triggerDamageCalcFromUser(user.item,
|
||||
user, target, self, multipliers, baseDmg, type)
|
||||
Battle::ItemEffects.triggerDamageCalcFromUser(
|
||||
user.item, user, target, self, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
if target.itemActive?
|
||||
Battle::ItemEffects.triggerDamageCalcFromTarget(target.item,
|
||||
user, target, self, multipliers, baseDmg, type)
|
||||
Battle::ItemEffects.triggerDamageCalcFromTarget(
|
||||
target.item, user, target, self, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
# Parental Bond's second attack
|
||||
if user.effects[PBEffects::ParentalBond] == 1
|
||||
|
||||
@@ -256,7 +256,7 @@ class Battle::Move::TargetMultiStatDownMove < Battle::Move
|
||||
for i in 0...@statDown.length / 2
|
||||
next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
if target.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user,
|
||||
showAnim, false, (showMirrorArmorSplash) ? 1 : 3)
|
||||
showAnim, false, (showMirrorArmorSplash) ? 1 : 3)
|
||||
showAnim = false
|
||||
end
|
||||
showMirrorArmorSplash = false
|
||||
@@ -567,7 +567,7 @@ class Battle::Move::PledgeMove < Battle::Move
|
||||
user.effects[PBEffects::FirstPledge] = nil
|
||||
return if !@pledgeSetup
|
||||
@battle.pbDisplay(_INTL("{1} is waiting for {2}'s move...",
|
||||
user.pbThis, @pledgeOtherUser.pbThis(true)))
|
||||
user.pbThis, @pledgeOtherUser.pbThis(true)))
|
||||
@pledgeOtherUser.effects[PBEffects::FirstPledge] = @function
|
||||
@pledgeOtherUser.effects[PBEffects::MoveNext] = true
|
||||
user.lastMoveFailed = true # Treated as a failure for Stomping Tantrum
|
||||
|
||||
@@ -386,7 +386,7 @@ class Battle::Move::AddSpikesToFoeSide < Battle::Move
|
||||
def pbEffectGeneral(user)
|
||||
user.pbOpposingSide.effects[PBEffects::Spikes] += 1
|
||||
@battle.pbDisplay(_INTL("Spikes were scattered all around {1}'s feet!",
|
||||
user.pbOpposingTeam(true)))
|
||||
user.pbOpposingTeam(true)))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -408,7 +408,7 @@ class Battle::Move::AddToxicSpikesToFoeSide < Battle::Move
|
||||
def pbEffectGeneral(user)
|
||||
user.pbOpposingSide.effects[PBEffects::ToxicSpikes] += 1
|
||||
@battle.pbDisplay(_INTL("Poison spikes were scattered all around {1}'s feet!",
|
||||
user.pbOpposingTeam(true)))
|
||||
user.pbOpposingTeam(true)))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -429,7 +429,7 @@ class Battle::Move::AddStealthRocksToFoeSide < Battle::Move
|
||||
def pbEffectGeneral(user)
|
||||
user.pbOpposingSide.effects[PBEffects::StealthRock] = true
|
||||
@battle.pbDisplay(_INTL("Pointed stones float in the air around {1}!",
|
||||
user.pbOpposingTeam(true)))
|
||||
user.pbOpposingTeam(true)))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -450,7 +450,7 @@ class Battle::Move::AddStickyWebToFoeSide < Battle::Move
|
||||
def pbEffectGeneral(user)
|
||||
user.pbOpposingSide.effects[PBEffects::StickyWeb] = true
|
||||
@battle.pbDisplay(_INTL("A sticky web has been laid out beneath {1}'s feet!",
|
||||
user.pbOpposingTeam(true)))
|
||||
user.pbOpposingTeam(true)))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -672,7 +672,7 @@ class Battle::Move::UserSwapsPositionsWithAlly < Battle::Move
|
||||
idxB = @idxAlly
|
||||
if @battle.pbSwapBattlers(idxA, idxB)
|
||||
@battle.pbDisplay(_INTL("{1} and {2} switched places!",
|
||||
@battle.battlers[idxB].pbThis, @battle.battlers[idxA].pbThis(true)))
|
||||
@battle.battlers[idxB].pbThis, @battle.battlers[idxA].pbThis(true)))
|
||||
[idxA, idxB].each { |idx| @battle.pbEffectsOnBattlerEnteringPosition(@battle.battlers[idx]) }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1386,7 +1386,7 @@ class Battle::Move::LowerPoisonedTargetAtkSpAtkSpd1 < Battle::Move
|
||||
for i in 0...@statDown.length / 2
|
||||
next if !target.pbCanLowerStatStage?(@statDown[i * 2], user, self)
|
||||
if target.pbLowerStatStage(@statDown[i * 2], @statDown[i * 2 + 1], user,
|
||||
showAnim, false, (showMirrorArmorSplash) ? 1 : 3)
|
||||
showAnim, false, (showMirrorArmorSplash) ? 1 : 3)
|
||||
showAnim = false
|
||||
end
|
||||
showMirrorArmorSplash = false
|
||||
|
||||
@@ -820,7 +820,7 @@ class Battle::Move::SetUserTypesToTargetTypes < Battle::Move
|
||||
def pbEffectAgainstTarget(user, target)
|
||||
user.pbChangeTypes(target)
|
||||
@battle.pbDisplay(_INTL("{1}'s type changed to match {2}'s!",
|
||||
user.pbThis, target.pbThis(true)))
|
||||
user.pbThis, target.pbThis(true)))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1067,7 +1067,7 @@ class Battle::Move::SetUserAbilityToTargetAbility < Battle::Move
|
||||
user.ability = target.ability
|
||||
@battle.pbReplaceAbilitySplash(user)
|
||||
@battle.pbDisplay(_INTL("{1} copied {2}'s {3}!",
|
||||
user.pbThis, target.pbThis(true), target.abilityName))
|
||||
user.pbThis, target.pbThis(true), target.abilityName))
|
||||
@battle.pbHideAbilitySplash(user)
|
||||
user.pbOnLosingAbility(oldAbil)
|
||||
user.pbTriggerAbilityOnGainingIt
|
||||
@@ -1169,7 +1169,7 @@ class Battle::Move::UserTargetSwapAbilities < Battle::Move
|
||||
@battle.pbDisplay(_INTL("{1} swapped Abilities with its target!", user.pbThis))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} swapped its {2} Ability with its target's {3} Ability!",
|
||||
user.pbThis, target.abilityName, user.abilityName))
|
||||
user.pbThis, target.abilityName, user.abilityName))
|
||||
end
|
||||
if user.opposes?(target)
|
||||
@battle.pbHideAbilitySplash(user)
|
||||
@@ -1359,7 +1359,7 @@ class Battle::Move::StartGravity < Battle::Move
|
||||
showMessage = true
|
||||
end
|
||||
@battle.pbDisplay(_INTL("{1} couldn't stay airborne because of gravity!",
|
||||
b.pbThis)) if showMessage
|
||||
b.pbThis)) if showMessage
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -80,7 +80,7 @@ class Battle::Move::OHKO < Battle::Move::FixedDamageMove
|
||||
@battle.pbDisplay(_INTL("But it failed to affect {1}!", target.pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("But it failed to affect {1} because of its {2}!",
|
||||
target.pbThis(true), target.abilityName))
|
||||
target.pbThis(true), target.abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(target)
|
||||
end
|
||||
@@ -149,12 +149,12 @@ class Battle::Move::DamageTargetAlly < Battle::Move
|
||||
end
|
||||
if hitAlly.length == 2
|
||||
@battle.pbDisplay(_INTL("The bursting flame hit {1} and {2}!",
|
||||
@battle.battlers[hitAlly[0][0]].pbThis(true),
|
||||
@battle.battlers[hitAlly[1][0]].pbThis(true)))
|
||||
@battle.battlers[hitAlly[0][0]].pbThis(true),
|
||||
@battle.battlers[hitAlly[1][0]].pbThis(true)))
|
||||
elsif hitAlly.length > 0
|
||||
hitAlly.each do |b|
|
||||
@battle.pbDisplay(_INTL("The bursting flame hit {1}!",
|
||||
@battle.battlers[b[0]].pbThis(true)))
|
||||
@battle.battlers[b[0]].pbThis(true)))
|
||||
end
|
||||
end
|
||||
hitAlly.each { |b| @battle.battlers[b[0]].pbItemHPHealCheck }
|
||||
@@ -824,7 +824,7 @@ class Battle::Move::StartWeakenDamageAgainstUserSideIfHail < Battle::Move
|
||||
user.pbOwnSide.effects[PBEffects::AuroraVeil] = 5
|
||||
user.pbOwnSide.effects[PBEffects::AuroraVeil] = 8 if user.hasActiveItem?(:LIGHTCLAY)
|
||||
@battle.pbDisplay(_INTL("{1} made {2} stronger against physical and special moves!",
|
||||
@name, user.pbTeam(true)))
|
||||
@name, user.pbTeam(true)))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -468,7 +468,7 @@ class Battle::Move::UserLosesHalfOfTotalHPExplosive < Battle::Move
|
||||
@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))
|
||||
user.pbThis, @name, bearer.pbThis(true), bearer.abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(bearer)
|
||||
return true
|
||||
@@ -500,7 +500,7 @@ class Battle::Move::UserFaintsExplosive < Battle::Move
|
||||
@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))
|
||||
user.pbThis, @name, bearer.pbThis(true), bearer.abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(bearer)
|
||||
return true
|
||||
|
||||
@@ -98,7 +98,7 @@ class Battle::Move::UserTargetSwapItems < Battle::Move
|
||||
@battle.pbDisplay(_INTL("But it failed to affect {1}!", target.pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("But it failed to affect {1} because of its {2}!",
|
||||
target.pbThis(true), target.abilityName))
|
||||
target.pbThis(true), target.abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(target)
|
||||
end
|
||||
@@ -223,7 +223,7 @@ class Battle::Move::CorrodeTargetItem < Battle::Move
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!",
|
||||
target.pbThis(true), target.abilityName))
|
||||
target.pbThis(true), target.abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(target)
|
||||
end
|
||||
@@ -239,7 +239,7 @@ class Battle::Move::CorrodeTargetItem < Battle::Move
|
||||
def pbEffectAgainstTarget(user, target)
|
||||
@battle.corrosiveGas[target.index % 2][target.pokemonIndex] = true
|
||||
@battle.pbDisplay(_INTL("{1} corroded {2}'s {3}!",
|
||||
user.pbThis, target.pbThis(true), target.itemName))
|
||||
user.pbThis, target.pbThis(true), target.itemName))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -521,7 +521,7 @@ class Battle::Move::UserAddStockpileRaiseDefSpDef1 < Battle::Move
|
||||
def pbEffectGeneral(user)
|
||||
user.effects[PBEffects::Stockpile] += 1
|
||||
@battle.pbDisplay(_INTL("{1} stockpiled {2}!",
|
||||
user.pbThis, user.effects[PBEffects::Stockpile]))
|
||||
user.pbThis, user.effects[PBEffects::Stockpile]))
|
||||
showAnim = true
|
||||
if user.pbCanRaiseStatStage?(:DEFENSE, user, self)
|
||||
if user.pbRaiseStatStage(:DEFENSE, 1, user, showAnim)
|
||||
|
||||
@@ -37,7 +37,7 @@ class Battle::Move::SwitchOutUserStatusMove < Battle::Move
|
||||
def pbEndOfMoveUsageEffect(user, targets, numHits, switchedBattlers)
|
||||
return if user.wild?
|
||||
@battle.pbDisplay(_INTL("{1} went back to {2}!", user.pbThis,
|
||||
@battle.pbGetOwnerName(user.index)))
|
||||
@battle.pbGetOwnerName(user.index)))
|
||||
@battle.pbPursuit(user.index)
|
||||
return if user.fainted?
|
||||
newPkmn = @battle.pbGetReplacementPokemonIndex(user.index) # Owner chooses
|
||||
@@ -71,7 +71,7 @@ class Battle::Move::SwitchOutUserDamagingMove < Battle::Move
|
||||
return if targetSwitched
|
||||
return if !@battle.pbCanChooseNonActive?(user.index)
|
||||
@battle.pbDisplay(_INTL("{1} went back to {2}!", user.pbThis,
|
||||
@battle.pbGetOwnerName(user.index)))
|
||||
@battle.pbGetOwnerName(user.index)))
|
||||
@battle.pbPursuit(user.index)
|
||||
return if user.fainted?
|
||||
newPkmn = @battle.pbGetReplacementPokemonIndex(user.index) # Owner chooses
|
||||
@@ -103,7 +103,7 @@ class Battle::Move::LowerTargetAtkSpAtk1SwitchOutUser < Battle::Move::TargetMult
|
||||
return if switcher.fainted? || numHits == 0
|
||||
return if !@battle.pbCanChooseNonActive?(switcher.index)
|
||||
@battle.pbDisplay(_INTL("{1} went back to {2}!", switcher.pbThis,
|
||||
@battle.pbGetOwnerName(switcher.index)))
|
||||
@battle.pbGetOwnerName(switcher.index)))
|
||||
@battle.pbPursuit(switcher.index)
|
||||
return if switcher.fainted?
|
||||
newPkmn = @battle.pbGetReplacementPokemonIndex(switcher.index) # Owner chooses
|
||||
@@ -673,7 +673,7 @@ class Battle::Move::LowerPPOfTargetLastMoveBy3 < Battle::Move
|
||||
reduction = [3, last_move.pp].min
|
||||
target.pbSetPP(last_move, last_move.pp - reduction)
|
||||
@battle.pbDisplay(_INTL("It reduced the PP of {1}'s {2} by {3}!",
|
||||
target.pbThis(true), last_move.name, reduction))
|
||||
target.pbThis(true), last_move.name, reduction))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -698,7 +698,7 @@ class Battle::Move::LowerPPOfTargetLastMoveBy4 < Battle::Move
|
||||
reduction = [4, last_move.pp].min
|
||||
target.pbSetPP(last_move, last_move.pp - reduction)
|
||||
@battle.pbDisplay(_INTL("It reduced the PP of {1}'s {2} by {3}!",
|
||||
target.pbThis(true), last_move.name, reduction))
|
||||
target.pbThis(true), last_move.name, reduction))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -733,7 +733,7 @@ class Battle::Move::DisableTargetLastMoveUsed < Battle::Move
|
||||
target.effects[PBEffects::Disable] = 5
|
||||
target.effects[PBEffects::DisableMove] = target.lastRegularMoveUsed
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} was disabled!", target.pbThis,
|
||||
GameData::Move.get(target.lastRegularMoveUsed).name))
|
||||
GameData::Move.get(target.lastRegularMoveUsed).name))
|
||||
target.pbItemStatusCureCheck
|
||||
end
|
||||
end
|
||||
@@ -853,7 +853,7 @@ class Battle::Move::DisableTargetStatusMoves < Battle::Move
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("But it failed because of {1}'s {2}!",
|
||||
target.pbThis(true), target.abilityName))
|
||||
target.pbThis(true), target.abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(target)
|
||||
end
|
||||
@@ -897,8 +897,10 @@ end
|
||||
class Battle::Move::DisableTargetSoundMoves < Battle::Move
|
||||
def pbAdditionalEffect(user, target)
|
||||
return if target.fainted? || target.damageState.substitute
|
||||
@battle.pbDisplay(_INTL("The effects of {1} prevent {2} from using certain moves!",
|
||||
@name, target.pbThis(true))) if target.effects[PBEffects::ThroatChop] == 0
|
||||
if target.effects[PBEffects::ThroatChop] == 0
|
||||
@battle.pbDisplay(_INTL("The effects of {1} prevent {2} from using certain moves!",
|
||||
@name, target.pbThis(true)))
|
||||
end
|
||||
target.effects[PBEffects::ThroatChop] = 3
|
||||
end
|
||||
end
|
||||
|
||||
@@ -28,11 +28,12 @@ class Battle::Scene
|
||||
pbCreateBackdropSprites
|
||||
# Create message box graphic
|
||||
messageBox = pbAddSprite("messageBox", 0, Graphics.height - 96,
|
||||
"Graphics/Pictures/Battle/overlay_message", @viewport)
|
||||
"Graphics/Pictures/Battle/overlay_message", @viewport)
|
||||
messageBox.z = 195
|
||||
# Create message window (displays the message)
|
||||
msgWindow = Window_AdvancedTextPokemon.newWithSize("",
|
||||
16, Graphics.height - 96 + 2, Graphics.width - 32, 96, @viewport)
|
||||
msgWindow = Window_AdvancedTextPokemon.newWithSize(
|
||||
"", 16, Graphics.height - 96 + 2, Graphics.width - 32, 96, @viewport
|
||||
)
|
||||
msgWindow.z = 200
|
||||
msgWindow.opacity = 0
|
||||
msgWindow.baseColor = MESSAGE_BASE_COLOR
|
||||
@@ -49,7 +50,7 @@ class Battle::Scene
|
||||
# The party lineup graphics (bar and balls) for both sides
|
||||
for side in 0...2
|
||||
partyBar = pbAddSprite("partyBar_#{side}", 0, 0,
|
||||
"Graphics/Pictures/Battle/overlay_lineup", @viewport)
|
||||
"Graphics/Pictures/Battle/overlay_lineup", @viewport)
|
||||
partyBar.z = 120
|
||||
partyBar.mirror = true if side == 0 # Player's lineup bar only
|
||||
partyBar.visible = false
|
||||
@@ -139,7 +140,7 @@ class Battle::Scene
|
||||
for side in 0...2
|
||||
baseX, baseY = Battle::Scene.pbBattlerPosition(side)
|
||||
base = pbAddSprite("base_#{side}", baseX, baseY,
|
||||
(side == 0) ? playerBase : enemyBase, @viewport)
|
||||
(side == 0) ? playerBase : enemyBase, @viewport)
|
||||
base.z = 1
|
||||
if base.bitmap
|
||||
base.ox = base.bitmap.width / 2
|
||||
|
||||
@@ -200,10 +200,10 @@ class Battle::Scene
|
||||
# Start Bag screen
|
||||
itemScene = PokemonBag_Scene.new
|
||||
itemScene.pbStartScene($bag, true,
|
||||
proc { |item|
|
||||
useType = GameData::Item.get(item).battle_use
|
||||
next useType && useType > 0
|
||||
}, false)
|
||||
proc { |item|
|
||||
useType = GameData::Item.get(item).battle_use
|
||||
next useType && useType > 0
|
||||
}, false)
|
||||
# Loop while in Bag screen
|
||||
wasTargeting = false
|
||||
loop do
|
||||
|
||||
@@ -58,8 +58,9 @@ class Battle::Scene
|
||||
# Animates a party lineup appearing for the given side
|
||||
#=============================================================================
|
||||
def pbShowPartyLineup(side, fullAnim = false)
|
||||
@animations.push(Animation::LineupAppear.new(@sprites, @viewport,
|
||||
side, @battle.pbParty(side), @battle.pbPartyStarts(side), fullAnim))
|
||||
@animations.push(Animation::LineupAppear.new(
|
||||
@sprites, @viewport, side, @battle.pbParty(side), @battle.pbPartyStarts(side), fullAnim
|
||||
))
|
||||
if !fullAnim
|
||||
while inPartyAnimation?
|
||||
pbUpdate
|
||||
@@ -112,13 +113,15 @@ class Battle::Scene
|
||||
pbChangePokemon(b[0], pkmn)
|
||||
pbRefresh
|
||||
if @battle.opposes?(b[0])
|
||||
sendOutAnim = Animation::PokeballTrainerSendOut.new(@sprites, @viewport,
|
||||
@battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1,
|
||||
@battle.battlers[b[0]], startBattle, i)
|
||||
sendOutAnim = Animation::PokeballTrainerSendOut.new(
|
||||
@sprites, @viewport, @battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1,
|
||||
@battle.battlers[b[0]], startBattle, i
|
||||
)
|
||||
else
|
||||
sendOutAnim = Animation::PokeballPlayerSendOut.new(@sprites, @viewport,
|
||||
@battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1,
|
||||
@battle.battlers[b[0]], startBattle, i)
|
||||
sendOutAnim = Animation::PokeballPlayerSendOut.new(
|
||||
@sprites, @viewport, @battle.pbGetOwnerIndexFromBattlerIndex(b[0]) + 1,
|
||||
@battle.battlers[b[0]], startBattle, i
|
||||
)
|
||||
end
|
||||
dataBoxAnim = Animation::DataBoxAppear.new(@sprites, @viewport, b[0])
|
||||
sendOutAnims.push([sendOutAnim, dataBoxAnim, false])
|
||||
@@ -296,11 +299,13 @@ class Battle::Scene
|
||||
def pbLevelUp(pkmn, _battler, oldTotalHP, oldAttack, oldDefense, oldSpAtk, oldSpDef, oldSpeed)
|
||||
pbTopRightWindow(
|
||||
_INTL("Max. HP<r>+{1}\r\nAttack<r>+{2}\r\nDefense<r>+{3}\r\nSp. Atk<r>+{4}\r\nSp. Def<r>+{5}\r\nSpeed<r>+{6}",
|
||||
pkmn.totalhp - oldTotalHP, pkmn.attack - oldAttack, pkmn.defense - oldDefense,
|
||||
pkmn.spatk - oldSpAtk, pkmn.spdef - oldSpDef, pkmn.speed - oldSpeed))
|
||||
pkmn.totalhp - oldTotalHP, pkmn.attack - oldAttack, pkmn.defense - oldDefense,
|
||||
pkmn.spatk - oldSpAtk, pkmn.spdef - oldSpDef, pkmn.speed - oldSpeed)
|
||||
)
|
||||
pbTopRightWindow(
|
||||
_INTL("Max. HP<r>{1}\r\nAttack<r>{2}\r\nDefense<r>{3}\r\nSp. Atk<r>{4}\r\nSp. Def<r>{5}\r\nSpeed<r>{6}",
|
||||
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed))
|
||||
pkmn.totalhp, pkmn.attack, pkmn.defense, pkmn.spatk, pkmn.spdef, pkmn.speed)
|
||||
)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -326,8 +331,9 @@ class Battle::Scene
|
||||
#=============================================================================
|
||||
def pbThrow(ball, shakes, critical, targetBattler, showPlayer = false)
|
||||
@briefMessage = false
|
||||
captureAnim = Animation::PokeballThrowCapture.new(@sprites, @viewport,
|
||||
ball, shakes, critical, @battle.battlers[targetBattler], showPlayer)
|
||||
captureAnim = Animation::PokeballThrowCapture.new(
|
||||
@sprites, @viewport, ball, shakes, critical, @battle.battlers[targetBattler], showPlayer
|
||||
)
|
||||
loop do
|
||||
captureAnim.update
|
||||
pbUpdate
|
||||
@@ -367,8 +373,9 @@ class Battle::Scene
|
||||
|
||||
def pbThrowAndDeflect(ball, idxBattler)
|
||||
@briefMessage = false
|
||||
throwAnim = Animation::PokeballThrowDeflect.new(@sprites, @viewport,
|
||||
ball, @battle.battlers[idxBattler])
|
||||
throwAnim = Animation::PokeballThrowDeflect.new(
|
||||
@sprites, @viewport, ball, @battle.battlers[idxBattler]
|
||||
)
|
||||
loop do
|
||||
throwAnim.update
|
||||
pbUpdate
|
||||
@@ -533,8 +540,9 @@ class Battle::Scene
|
||||
targetHeight = userHeight
|
||||
end
|
||||
animPlayer.setLineTransform(
|
||||
FOCUSUSER_X, FOCUSUSER_Y, FOCUSTARGET_X, FOCUSTARGET_Y,
|
||||
oldUserX, oldUserY - userHeight / 2, oldTargetX, oldTargetY - targetHeight / 2)
|
||||
FOCUSUSER_X, FOCUSUSER_Y, FOCUSTARGET_X, FOCUSTARGET_Y,
|
||||
oldUserX, oldUserY - userHeight / 2, oldTargetX, oldTargetY - targetHeight / 2
|
||||
)
|
||||
# Play the animation
|
||||
animPlayer.start
|
||||
loop do
|
||||
|
||||
@@ -118,8 +118,9 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
|
||||
self.x = 0
|
||||
self.y = Graphics.height - 96
|
||||
# Create message box (shows "What will X do?")
|
||||
@msgBox = Window_UnformattedTextPokemon.newWithSize("",
|
||||
self.x + 16, self.y + 2, 220, Graphics.height - self.y, viewport)
|
||||
@msgBox = Window_UnformattedTextPokemon.newWithSize(
|
||||
"", self.x + 16, self.y + 2, 220, Graphics.height - self.y, viewport
|
||||
)
|
||||
@msgBox.baseColor = TEXT_BASE_COLOR
|
||||
@msgBox.shadowColor = TEXT_SHADOW_COLOR
|
||||
@msgBox.windowskin = nil
|
||||
@@ -146,8 +147,9 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase
|
||||
end
|
||||
else
|
||||
# Create command window (shows Fight/Bag/Pokémon/Run)
|
||||
@cmdWindow = Window_CommandPokemon.newWithSize([],
|
||||
self.x + Graphics.width - 240, self.y, 240, Graphics.height - self.y, viewport)
|
||||
@cmdWindow = Window_CommandPokemon.newWithSize(
|
||||
[], self.x + Graphics.width - 240, self.y, 240, Graphics.height - self.y, viewport
|
||||
)
|
||||
@cmdWindow.columns = 2
|
||||
@cmdWindow.columnSpacing = 4
|
||||
@cmdWindow.ignore_input = true
|
||||
@@ -287,15 +289,17 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
|
||||
addSprite("shiftButton", @shiftButton)
|
||||
else
|
||||
# Create message box (shows type and PP of selected move)
|
||||
@msgBox = Window_AdvancedTextPokemon.newWithSize("",
|
||||
self.x + 320, self.y, Graphics.width - 320, Graphics.height - self.y, viewport)
|
||||
@msgBox = Window_AdvancedTextPokemon.newWithSize(
|
||||
"", self.x + 320, self.y, Graphics.width - 320, Graphics.height - self.y, viewport
|
||||
)
|
||||
@msgBox.baseColor = TEXT_BASE_COLOR
|
||||
@msgBox.shadowColor = TEXT_SHADOW_COLOR
|
||||
pbSetNarrowFont(@msgBox.contents)
|
||||
addSprite("msgBox", @msgBox)
|
||||
# Create command window (shows moves)
|
||||
@cmdWindow = Window_CommandPokemon.newWithSize([],
|
||||
self.x, self.y, 320, Graphics.height - self.y, viewport)
|
||||
@cmdWindow = Window_CommandPokemon.newWithSize(
|
||||
[], self.x, self.y, 320, Graphics.height - self.y, viewport
|
||||
)
|
||||
@cmdWindow.columns = 2
|
||||
@cmdWindow.columnSpacing = 4
|
||||
@cmdWindow.ignore_input = true
|
||||
@@ -392,7 +396,7 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
|
||||
@msgBox.text = _INTL("PP: ---<br>TYPE/{1}", moveType)
|
||||
else
|
||||
@msgBox.text = _ISPRINTF("PP: {1: 2d}/{2: 2d}<br>TYPE/{3:s}",
|
||||
move.pp, move.total_pp, moveType)
|
||||
move.pp, move.total_pp, moveType)
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
@@ -42,7 +42,7 @@ class Battle::Scene::Animation::Intro < Battle::Scene::Animation
|
||||
blackScreen.moveOpacity(0, 8, 0)
|
||||
# Fading blackness over command bar
|
||||
blackBar = addNewSprite(@sprites["cmdBar_bg"].x, @sprites["cmdBar_bg"].y,
|
||||
"Graphics/Battle animations/black_bar")
|
||||
"Graphics/Battle animations/black_bar")
|
||||
blackBar.setZ(0, 998)
|
||||
blackBar.moveOpacity(appearTime * 3 / 4, appearTime / 4, 0)
|
||||
end
|
||||
@@ -448,7 +448,7 @@ class Battle::Scene::Animation::PokeballPlayerSendOut < Battle::Scene::Animation
|
||||
delay = ball.totalDuration # 0 or 7
|
||||
# Poké Ball trajectory animation
|
||||
createBallTrajectory(ball, delay, 12,
|
||||
ballStartX, ballStartY, ballMidX, ballMidY, battlerStartX, battlerStartY - 18)
|
||||
ballStartX, ballStartY, ballMidX, ballMidY, battlerStartX, battlerStartY - 18)
|
||||
ball.setZ(9, batSprite.z - 1)
|
||||
delay = ball.totalDuration + 4
|
||||
delay += 10 * @idxOrder # Stagger appearances if multiple Pokémon are sent out at once
|
||||
@@ -651,8 +651,7 @@ class Battle::Scene::Animation::BattlerFaint < Battle::Scene::Animation
|
||||
shadow = addSprite(shaSprite, PictureOrigin::Center)
|
||||
# Get approx duration depending on sprite's position/size. Min 20 frames.
|
||||
battlerTop = batSprite.y - batSprite.height
|
||||
cropY = Battle::Scene.pbBattlerPosition(@idxBattler,
|
||||
@battle.pbSideSize(@idxBattler))[1]
|
||||
cropY = Battle::Scene.pbBattlerPosition(@idxBattler, @battle.pbSideSize(@idxBattler))[1]
|
||||
cropY += 8
|
||||
duration = (cropY - battlerTop) / 8
|
||||
duration = 10 if duration < 10 # Min 0.5 seconds
|
||||
@@ -734,7 +733,7 @@ class Battle::Scene::Animation::PokeballThrowCapture < Battle::Scene::Animation
|
||||
# Poké Ball arc animation
|
||||
ball.setSE(delay, "Battle throw")
|
||||
createBallTrajectory(ball, delay, 16,
|
||||
ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY)
|
||||
ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY)
|
||||
ball.setZ(9, batSprite.z + 1)
|
||||
ball.setSE(delay + 16, "Battle ball hit")
|
||||
# Poké Ball opens up
|
||||
@@ -867,7 +866,7 @@ class Battle::Scene::Animation::PokeballThrowDeflect < Battle::Scene::Animation
|
||||
# Poké Ball arc animation
|
||||
ball.setSE(0, "Battle throw")
|
||||
createBallTrajectory(ball, 0, 16,
|
||||
ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY)
|
||||
ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY)
|
||||
# Poké Ball knocked back
|
||||
delay = ball.totalDuration
|
||||
ball.setSE(delay, "Battle ball drop")
|
||||
|
||||
@@ -105,7 +105,7 @@ class Battle::AI
|
||||
next if !i
|
||||
next if !@battle.pbCanUseItemOnPokemon?(i, pkmn, battler, @battle.scene, false)
|
||||
next if !ItemHandlers.triggerCanUseInBattle(i, pkmn, battler, nil,
|
||||
false, self, @battle.scene, false)
|
||||
false, self, @battle.scene, false)
|
||||
# Log HP healing items
|
||||
if losthp > 0
|
||||
power = hpItems[i]
|
||||
|
||||
@@ -271,11 +271,13 @@ class Battle::AI
|
||||
if GameData::Type.exists?(:FLYING)
|
||||
if skill >= PBTrainerAI.highSkill
|
||||
targetTypes = target.pbTypes(true)
|
||||
mult = Effectiveness.calculate(:FLYING,
|
||||
targetTypes[0], targetTypes[1], targetTypes[2])
|
||||
mult = Effectiveness.calculate(
|
||||
:FLYING, targetTypes[0], targetTypes[1], targetTypes[2]
|
||||
)
|
||||
else
|
||||
mult = Effectiveness.calculate(:FLYING,
|
||||
target.types[0], target.types[1], target.effects[PBEffects::Type3])
|
||||
mult = Effectiveness.calculate(
|
||||
:FLYING, target.types[0], target.types[1], target.effects[PBEffects::Type3]
|
||||
)
|
||||
end
|
||||
baseDmg = (baseDmg.to_f * mult / Effectiveness::NORMAL_EFFECTIVE).round
|
||||
end
|
||||
@@ -338,15 +340,17 @@ class Battle::AI
|
||||
break
|
||||
end
|
||||
if canCheck
|
||||
Battle::AbilityEffects.triggerDamageCalcFromUser(user.ability,
|
||||
user, target, move, multipliers, baseDmg, type)
|
||||
Battle::AbilityEffects.triggerDamageCalcFromUser(
|
||||
user.ability, user, target, move, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
end
|
||||
if skill >= PBTrainerAI.mediumSkill && !moldBreaker
|
||||
user.allAllies.each do |b|
|
||||
next if !b.abilityActive?
|
||||
Battle::AbilityEffects.triggerDamageCalcFromAlly(b.ability,
|
||||
user, target, move, multipliers, baseDmg, type)
|
||||
Battle::AbilityEffects.triggerDamageCalcFromAlly(
|
||||
b.ability, user, target, move, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
end
|
||||
if skill >= PBTrainerAI.bestSkill && !moldBreaker && target.abilityActive?
|
||||
@@ -360,15 +364,17 @@ class Battle::AI
|
||||
break
|
||||
end
|
||||
if canCheck
|
||||
Battle::AbilityEffects.triggerDamageCalcFromTarget(target.ability,
|
||||
user, target, move, multipliers, baseDmg, type)
|
||||
Battle::AbilityEffects.triggerDamageCalcFromTarget(
|
||||
target.ability, user, target, move, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
end
|
||||
if skill >= PBTrainerAI.bestSkill && !moldBreaker
|
||||
target.allAllies.each do |b|
|
||||
next if !b.abilityActive?
|
||||
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(b.ability,
|
||||
user, target, move, multipliers, baseDmg, type)
|
||||
Battle::AbilityEffects.triggerDamageCalcFromTargetAlly(
|
||||
b.ability, user, target, move, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
end
|
||||
# Item effects that alter damage
|
||||
@@ -379,16 +385,18 @@ class Battle::AI
|
||||
# round.
|
||||
itemBlacklist = [:EXPERTBELT, :LIFEORB]
|
||||
if !itemBlacklist.include?(user.item_id)
|
||||
Battle::ItemEffects.triggerDamageCalcFromUser(user.item,
|
||||
user, target, move, multipliers, baseDmg, type)
|
||||
Battle::ItemEffects.triggerDamageCalcFromUser(
|
||||
user.item, user, target, move, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
end
|
||||
if skill >= PBTrainerAI.bestSkill && target.itemActive?
|
||||
# NOTE: Type-weakening berries aren't suitable for checking at the start
|
||||
# of the round.
|
||||
if target.item && !target.item.is_berry?
|
||||
Battle::ItemEffects.triggerDamageCalcFromTarget(target.item,
|
||||
user, target, move, multipliers, baseDmg, type)
|
||||
Battle::ItemEffects.triggerDamageCalcFromTarget(
|
||||
target.item, user, target, move, multipliers, baseDmg, type
|
||||
)
|
||||
end
|
||||
end
|
||||
# Global abilities
|
||||
@@ -640,32 +648,37 @@ class Battle::AI
|
||||
# Ability effects that alter accuracy calculation
|
||||
if skill >= PBTrainerAI.mediumSkill
|
||||
if user.abilityActive?
|
||||
Battle::AbilityEffects.triggerAccuracyCalcFromUser(user.ability,
|
||||
modifiers, user, target, move, type)
|
||||
Battle::AbilityEffects.triggerAccuracyCalcFromUser(
|
||||
user.ability, modifiers, user, target, move, type
|
||||
)
|
||||
end
|
||||
user.allAllies.each do |b|
|
||||
next if !b.abilityActive?
|
||||
Battle::AbilityEffects.triggerAccuracyCalcFromAlly(b.ability,
|
||||
modifiers, user, target, move, type)
|
||||
Battle::AbilityEffects.triggerAccuracyCalcFromAlly(
|
||||
b.ability, modifiers, user, target, move, type
|
||||
)
|
||||
end
|
||||
end
|
||||
if skill >= PBTrainerAI.bestSkill
|
||||
if target.abilityActive? && !moldBreaker
|
||||
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(target.ability,
|
||||
modifiers, user, target, move, type)
|
||||
Battle::AbilityEffects.triggerAccuracyCalcFromTarget(
|
||||
target.ability, modifiers, user, target, move, type
|
||||
)
|
||||
end
|
||||
end
|
||||
# Item effects that alter accuracy calculation
|
||||
if skill >= PBTrainerAI.mediumSkill
|
||||
if user.itemActive?
|
||||
Battle::ItemEffects.triggerAccuracyCalcFromUser(user.item,
|
||||
modifiers, user, target, move, type)
|
||||
Battle::ItemEffects.triggerAccuracyCalcFromUser(
|
||||
user.item, modifiers, user, target, move, type
|
||||
)
|
||||
end
|
||||
end
|
||||
if skill >= PBTrainerAI.bestSkill
|
||||
if target.itemActive?
|
||||
Battle::ItemEffects.triggerAccuracyCalcFromTarget(target.item,
|
||||
modifiers, user, target, move, type)
|
||||
Battle::ItemEffects.triggerAccuracyCalcFromTarget(
|
||||
target.item, modifiers, user, target, move, type
|
||||
)
|
||||
end
|
||||
end
|
||||
# Other effects, inc. ones that set accuracy_multiplier or evasion_stage to specific values
|
||||
|
||||
@@ -222,7 +222,8 @@ class RPG::Animation
|
||||
timing.se = RPG::AudioFile.new(
|
||||
othertiming.se.name.clone,
|
||||
othertiming.se.volume,
|
||||
othertiming.se.pitch)
|
||||
othertiming.se.pitch
|
||||
)
|
||||
timing.flash_scope = othertiming.flash_scope
|
||||
timing.flash_color = othertiming.flash_color.clone
|
||||
timing.flash_duration = othertiming.flash_duration
|
||||
@@ -290,57 +291,57 @@ class PBAnimTiming
|
||||
when 1
|
||||
text = sprintf("[%d] Set BG: \"%s\"", @frame + 1, name)
|
||||
text += sprintf(" (color=%s,%s,%s,%s)",
|
||||
(@colorRed != nil) ? @colorRed.to_i : "-",
|
||||
(@colorGreen != nil) ? @colorGreen.to_i : "-",
|
||||
(@colorBlue != nil) ? @colorBlue.to_i : "-",
|
||||
(@colorAlpha != nil) ? @colorAlpha.to_i : "-")
|
||||
(@colorRed != nil) ? @colorRed.to_i : "-",
|
||||
(@colorGreen != nil) ? @colorGreen.to_i : "-",
|
||||
(@colorBlue != nil) ? @colorBlue.to_i : "-",
|
||||
(@colorAlpha != nil) ? @colorAlpha.to_i : "-")
|
||||
text += sprintf(" (opacity=%s)", @opacity.to_i)
|
||||
text += sprintf(" (coords=%s,%s)",
|
||||
(@bgX != nil) ? @bgX : "-",
|
||||
(@bgY != nil) ? @bgY : "-")
|
||||
(@bgX != nil) ? @bgX : "-",
|
||||
(@bgY != nil) ? @bgY : "-")
|
||||
return text
|
||||
when 2
|
||||
text = sprintf("[%d] Change BG: @%d", @frame + 1, duration)
|
||||
if @colorRed != nil || @colorGreen != nil || @colorBlue != nil || @colorAlpha != nil
|
||||
text += sprintf(" (color=%s,%s,%s,%s)",
|
||||
(@colorRed != nil) ? @colorRed.to_i : "-",
|
||||
(@colorGreen != nil) ? @colorGreen.to_i : "-",
|
||||
(@colorBlue != nil) ? @colorBlue.to_i : "-",
|
||||
(@colorAlpha != nil) ? @colorAlpha.to_i : "-")
|
||||
(@colorRed != nil) ? @colorRed.to_i : "-",
|
||||
(@colorGreen != nil) ? @colorGreen.to_i : "-",
|
||||
(@colorBlue != nil) ? @colorBlue.to_i : "-",
|
||||
(@colorAlpha != nil) ? @colorAlpha.to_i : "-")
|
||||
end
|
||||
text += sprintf(" (opacity=%s)", @opacity.to_i) if @opacity != nil
|
||||
if @bgX != nil || @bgY != nil
|
||||
text += sprintf(" (coords=%s,%s)",
|
||||
(@bgX != nil) ? @bgX : "-",
|
||||
(@bgY != nil) ? @bgY : "-")
|
||||
(@bgX != nil) ? @bgX : "-",
|
||||
(@bgY != nil) ? @bgY : "-")
|
||||
end
|
||||
return text
|
||||
when 3
|
||||
text = sprintf("[%d] Set FG: \"%s\"", @frame + 1, name)
|
||||
text += sprintf(" (color=%s,%s,%s,%s)",
|
||||
(@colorRed != nil) ? @colorRed.to_i : "-",
|
||||
(@colorGreen != nil) ? @colorGreen.to_i : "-",
|
||||
(@colorBlue != nil) ? @colorBlue.to_i : "-",
|
||||
(@colorAlpha != nil) ? @colorAlpha.to_i : "-")
|
||||
(@colorRed != nil) ? @colorRed.to_i : "-",
|
||||
(@colorGreen != nil) ? @colorGreen.to_i : "-",
|
||||
(@colorBlue != nil) ? @colorBlue.to_i : "-",
|
||||
(@colorAlpha != nil) ? @colorAlpha.to_i : "-")
|
||||
text += sprintf(" (opacity=%s)", @opacity.to_i)
|
||||
text += sprintf(" (coords=%s,%s)",
|
||||
(@bgX != nil) ? @bgX : "-",
|
||||
(@bgY != nil) ? @bgY : "-")
|
||||
(@bgX != nil) ? @bgX : "-",
|
||||
(@bgY != nil) ? @bgY : "-")
|
||||
return text
|
||||
when 4
|
||||
text = sprintf("[%d] Change FG: @%d", @frame + 1, duration)
|
||||
if @colorRed != nil || @colorGreen != nil || @colorBlue != nil || @colorAlpha != nil
|
||||
text += sprintf(" (color=%s,%s,%s,%s)",
|
||||
(@colorRed != nil) ? @colorRed.to_i : "-",
|
||||
(@colorGreen != nil) ? @colorGreen.to_i : "-",
|
||||
(@colorBlue != nil) ? @colorBlue.to_i : "-",
|
||||
(@colorAlpha != nil) ? @colorAlpha.to_i : "-")
|
||||
(@colorRed != nil) ? @colorRed.to_i : "-",
|
||||
(@colorGreen != nil) ? @colorGreen.to_i : "-",
|
||||
(@colorBlue != nil) ? @colorBlue.to_i : "-",
|
||||
(@colorAlpha != nil) ? @colorAlpha.to_i : "-")
|
||||
end
|
||||
text += sprintf(" (opacity=%s)", @opacity.to_i) if @opacity != nil
|
||||
if @bgX != nil || @bgY != nil
|
||||
text += sprintf(" (coords=%s,%s)",
|
||||
(@bgX != nil) ? @bgX : "-",
|
||||
(@bgY != nil) ? @bgY : "-")
|
||||
(@bgX != nil) ? @bgX : "-",
|
||||
(@bgY != nil) ? @bgY : "-")
|
||||
end
|
||||
return text
|
||||
end
|
||||
@@ -638,11 +639,11 @@ def pbSpriteSetAnimFrame(sprite, frame, user = nil, target = nil, inEditor = fal
|
||||
if pattern >= 0
|
||||
animwidth = 192
|
||||
sprite.src_rect.set((pattern % 5) * animwidth, (pattern / 5) * animwidth,
|
||||
animwidth, animwidth)
|
||||
animwidth, animwidth)
|
||||
else
|
||||
sprite.src_rect.set(0, 0,
|
||||
(sprite.bitmap) ? sprite.bitmap.width : 128,
|
||||
(sprite.bitmap) ? sprite.bitmap.height : 128)
|
||||
(sprite.bitmap) ? sprite.bitmap.width : 128,
|
||||
(sprite.bitmap) ? sprite.bitmap.height : 128)
|
||||
end
|
||||
sprite.zoom_x = frame[AnimFrame::ZOOMX] / 100.0
|
||||
sprite.zoom_y = frame[AnimFrame::ZOOMY] / 100.0
|
||||
@@ -807,7 +808,7 @@ class PBAnimationPlayerX
|
||||
# Load the animation's spritesheet and assign it to all the sprites.
|
||||
if !@animbitmap || @animbitmap.disposed?
|
||||
@animbitmap = AnimatedBitmap.new("Graphics/Animations/" + @animation.graphic,
|
||||
@animation.hue).deanimate
|
||||
@animation.hue).deanimate
|
||||
for i in 0...MAX_SPRITES
|
||||
@animsprites[i].bitmap = @animbitmap if @animsprites[i]
|
||||
end
|
||||
@@ -851,10 +852,9 @@ class PBAnimationPlayerX
|
||||
sprite.y = cel[AnimFrame::Y] + @userOrig[1] - Battle::Scene::FOCUSUSER_Y
|
||||
when 3 # Focused on user and target
|
||||
next if !@srcLine || !@dstLine
|
||||
point = transformPoint(
|
||||
@srcLine[0], @srcLine[1], @srcLine[2], @srcLine[3],
|
||||
@dstLine[0], @dstLine[1], @dstLine[2], @dstLine[3],
|
||||
sprite.x, sprite.y)
|
||||
point = transformPoint(@srcLine[0], @srcLine[1], @srcLine[2], @srcLine[3],
|
||||
@dstLine[0], @dstLine[1], @dstLine[2], @dstLine[3],
|
||||
sprite.x, sprite.y)
|
||||
sprite.x = point[0]
|
||||
sprite.y = point[1]
|
||||
if isReversed(@srcLine[0], @srcLine[2], @dstLine[0], @dstLine[2]) &&
|
||||
|
||||
@@ -122,7 +122,7 @@ class Battle::Scene::Animation::ThrowBait < Battle::Scene::Animation
|
||||
trainer = addSprite(traSprite, PictureOrigin::Bottom)
|
||||
# Set up bait sprite
|
||||
ball = addNewSprite(ballStartX, ballStartY,
|
||||
"Graphics/Battle animations/safari_bait", PictureOrigin::Center)
|
||||
"Graphics/Battle animations/safari_bait", PictureOrigin::Center)
|
||||
ball.setZ(0, batSprite.z + 1)
|
||||
# Trainer animation
|
||||
if traSprite.bitmap.width >= traSprite.bitmap.height * 2
|
||||
@@ -132,7 +132,7 @@ class Battle::Scene::Animation::ThrowBait < Battle::Scene::Animation
|
||||
# Bait arc animation
|
||||
ball.setSE(delay, "Battle throw")
|
||||
createBallTrajectory(ball, delay, 12,
|
||||
ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY)
|
||||
ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY)
|
||||
ball.setZ(9, batSprite.z + 1)
|
||||
delay = ball.totalDuration
|
||||
ball.moveOpacity(delay + 8, 2, 0)
|
||||
@@ -187,7 +187,7 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation
|
||||
trainer = addSprite(traSprite, PictureOrigin::Bottom)
|
||||
# Set up bait sprite
|
||||
ball = addNewSprite(ballStartX, ballStartY,
|
||||
"Graphics/Battle animations/safari_rock", PictureOrigin::Center)
|
||||
"Graphics/Battle animations/safari_rock", PictureOrigin::Center)
|
||||
ball.setZ(0, batSprite.z + 1)
|
||||
# Trainer animation
|
||||
if traSprite.bitmap.width >= traSprite.bitmap.height * 2
|
||||
@@ -197,7 +197,7 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation
|
||||
# Bait arc animation
|
||||
ball.setSE(delay, "Battle throw")
|
||||
createBallTrajectory(ball, delay, 12,
|
||||
ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY)
|
||||
ballStartX, ballStartY, ballMidX, ballMidY, ballEndX, ballEndY)
|
||||
ball.setZ(9, batSprite.z + 1)
|
||||
delay = ball.totalDuration
|
||||
ball.setSE(delay, "Battle damage weak")
|
||||
@@ -205,7 +205,7 @@ class Battle::Scene::Animation::ThrowRock < Battle::Scene::Animation
|
||||
ball.setVisible(delay + 4, false)
|
||||
# Set up anger sprite
|
||||
anger = addNewSprite(ballEndX - 42, ballEndY - 36,
|
||||
"Graphics/Battle animations/safari_anger", PictureOrigin::Center)
|
||||
"Graphics/Battle animations/safari_anger", PictureOrigin::Center)
|
||||
anger.setVisible(0, false)
|
||||
anger.setZ(0, batSprite.z + 1)
|
||||
# Show anger appearing
|
||||
|
||||
@@ -63,9 +63,8 @@ class BugContestBattle < Battle
|
||||
lastPokemon = pbBugContestState.lastPokemon
|
||||
pbDisplayPaused(_INTL("You already caught a {1}.", lastPokemon.name))
|
||||
helptext = _INTL("STOCK POKéMON:\n {1} Lv.{2} MaxHP: {3}\nTHIS POKéMON:\n {4} Lv.{5} MaxHP: {6}",
|
||||
lastPokemon.name, lastPokemon.level, lastPokemon.totalhp,
|
||||
pkmn.name, pkmn.level, pkmn.totalhp
|
||||
)
|
||||
lastPokemon.name, lastPokemon.level, lastPokemon.totalhp,
|
||||
pkmn.name, pkmn.level, pkmn.totalhp)
|
||||
@scene.pbShowHelp(helptext)
|
||||
if pbDisplayConfirm(_INTL("Switch Pokémon?"))
|
||||
pbBugContestState.lastPokemon = pkmn
|
||||
|
||||
@@ -182,7 +182,7 @@ class BattleArenaBattle < Battle
|
||||
# Make judgment
|
||||
if points[0] == points[1]
|
||||
pbDisplay(_INTL("{1} tied the opponent\n{2} in a referee's decision!",
|
||||
@battlers[0].name, @battlers[1].name))
|
||||
@battlers[0].name, @battlers[1].name))
|
||||
# NOTE: Pokémon doesn't really lose HP, but the effect is mostly the
|
||||
# same.
|
||||
@battlers[0].hp = 0
|
||||
@@ -191,12 +191,12 @@ class BattleArenaBattle < Battle
|
||||
@battlers[1].pbFaint(false)
|
||||
elsif points[0] > points[1]
|
||||
pbDisplay(_INTL("{1} defeated the opponent\n{2} in a referee's decision!",
|
||||
@battlers[0].name, @battlers[1].name))
|
||||
@battlers[0].name, @battlers[1].name))
|
||||
@battlers[1].hp = 0
|
||||
@battlers[1].pbFaint(false)
|
||||
else
|
||||
pbDisplay(_INTL("{1} lost to the opponent\n{2} in a referee's decision!",
|
||||
@battlers[0].name, @battlers[1].name))
|
||||
@battlers[0].name, @battlers[1].name))
|
||||
@battlers[0].hp = 0
|
||||
@battlers[0].pbFaint(false)
|
||||
end
|
||||
@@ -266,7 +266,7 @@ class Battle::Scene
|
||||
|
||||
def pbBattleArenaBattlers(battler1, battler2)
|
||||
pbMessage(_INTL("REFEREE: {1} VS {2}!\nCommence battling!\\wtnp[20]",
|
||||
battler1.name, battler2.name)) { pbBattleArenaUpdate }
|
||||
battler1.name, battler2.name)) { pbBattleArenaUpdate }
|
||||
end
|
||||
|
||||
def pbBattleArenaJudgment(battler1, battler2, ratings1, ratings2)
|
||||
@@ -277,7 +277,7 @@ class Battle::Scene
|
||||
msgwindow = pbCreateMessageWindow
|
||||
dimmingvp = Viewport.new(0, 0, Graphics.width, Graphics.height - msgwindow.height)
|
||||
pbMessageDisplay(msgwindow,
|
||||
_INTL("REFEREE: That's it! We will now go to judging to determine the winner!\\wtnp[20]")) {
|
||||
_INTL("REFEREE: That's it! We will now go to judging to determine the winner!\\wtnp[20]")) {
|
||||
pbBattleArenaUpdate
|
||||
dimmingvp.update
|
||||
}
|
||||
@@ -305,21 +305,21 @@ class Battle::Scene
|
||||
end
|
||||
updateJudgment(infowindow, 1, battler1, battler2, ratings1, ratings2)
|
||||
pbMessageDisplay(msgwindow,
|
||||
_INTL("REFEREE: Judging category 1, Mind!\nThe Pokémon showing the most guts!\\wtnp[40]")) {
|
||||
_INTL("REFEREE: Judging category 1, Mind!\nThe Pokémon showing the most guts!\\wtnp[40]")) {
|
||||
pbBattleArenaUpdate
|
||||
dimmingvp.update
|
||||
infowindow.update
|
||||
}
|
||||
updateJudgment(infowindow, 2, battler1, battler2, ratings1, ratings2)
|
||||
pbMessageDisplay(msgwindow,
|
||||
_INTL("REFEREE: Judging category 2, Skill!\nThe Pokémon using moves the best!\\wtnp[40]")) {
|
||||
_INTL("REFEREE: Judging category 2, Skill!\nThe Pokémon using moves the best!\\wtnp[40]")) {
|
||||
pbBattleArenaUpdate
|
||||
dimmingvp.update
|
||||
infowindow.update
|
||||
}
|
||||
updateJudgment(infowindow, 3, battler1, battler2, ratings1, ratings2)
|
||||
pbMessageDisplay(msgwindow,
|
||||
_INTL("REFEREE: Judging category 3, Body!\nThe Pokémon with the most vitality!\\wtnp[40]")) {
|
||||
_INTL("REFEREE: Judging category 3, Body!\nThe Pokémon with the most vitality!\\wtnp[40]")) {
|
||||
pbBattleArenaUpdate
|
||||
dimmingvp.update
|
||||
infowindow.update
|
||||
@@ -332,23 +332,23 @@ class Battle::Scene
|
||||
end
|
||||
if total1 == total2
|
||||
pbMessageDisplay(msgwindow,
|
||||
_INTL("REFEREE: Judgment: {1} to {2}!\nWe have a draw!\\wtnp[40]", total1, total2)) {
|
||||
_INTL("REFEREE: Judgment: {1} to {2}!\nWe have a draw!\\wtnp[40]", total1, total2)) {
|
||||
pbBattleArenaUpdate
|
||||
dimmingvp.update
|
||||
infowindow.update
|
||||
}
|
||||
elsif total1 > total2
|
||||
pbMessageDisplay(msgwindow,
|
||||
_INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}'s {4}!\\wtnp[40]",
|
||||
total1, total2, @battle.pbGetOwnerName(battler1.index), battler1.name)) {
|
||||
_INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}'s {4}!\\wtnp[40]",
|
||||
total1, total2, @battle.pbGetOwnerName(battler1.index), battler1.name)) {
|
||||
pbBattleArenaUpdate
|
||||
dimmingvp.update
|
||||
infowindow.update
|
||||
}
|
||||
else
|
||||
pbMessageDisplay(msgwindow,
|
||||
_INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}!\\wtnp[40]",
|
||||
total1, total2, battler2.name)) {
|
||||
_INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}!\\wtnp[40]",
|
||||
total1, total2, battler2.name)) {
|
||||
pbBattleArenaUpdate
|
||||
dimmingvp.update
|
||||
infowindow.update
|
||||
|
||||
Reference in New Issue
Block a user