Fix: Made the "Battle flee" sound effect play before the "Fled from b… (#51)

* Fix: Made the "Battle flee" sound effect play before the "Fled from battle" messages
This commit is contained in:
Derxwna Kapsyla
2020-10-28 14:41:18 -04:00
committed by GitHub
parent e290d1dd45
commit a28eadb9af
4 changed files with 20 additions and 10 deletions

View File

@@ -8,7 +8,8 @@ class PokeBattle_Battler
if tryFlee && @battle.wildBattle? && opposes? &&
@battle.rules["alwaysflee"] && @battle.pbCanRun?(@index)
pbBeginTurn(choice)
@battle.pbDisplay(_INTL("{1} fled from battle!",pbThis)) { pbSEPlay("Battle flee") }
pbSEPlay("Battle flee")
@battle.pbDisplay(_INTL("{1} fled from battle!",pbThis))
@battle.decision = 3
pbEndTurn(choice)
return true

View File

@@ -52,7 +52,8 @@ class PokeBattle_Battle
elsif @internalBattle
pbDisplayPaused(_INTL("No! There's no running from a Trainer battle!"))
elsif pbDisplayConfirm(_INTL("Would you like to forfeit the match and quit now?"))
pbDisplay(_INTL("{1} forfeited the match!",self.pbPlayer.name)) { pbSEPlay("Battle flee") }
pbSEPlay("Battle flee")
pbDisplay(_INTL("{1} forfeited the match!",self.pbPlayer.name))
@decision = 3
return 1
end
@@ -60,7 +61,8 @@ class PokeBattle_Battle
end
# Fleeing from wild battles
if $DEBUG && Input.press?(Input::CTRL)
pbDisplayPaused(_INTL("You got away safely!")) { pbSEPlay("Battle flee") }
pbSEPlay("Battle flee")
pbDisplayPaused(_INTL("You got away safely!"))
@decision = 3
return 1
end
@@ -70,7 +72,8 @@ class PokeBattle_Battle
end
if !duringBattle
if battler.pbHasType?(:GHOST) && NEWEST_BATTLE_MECHANICS
pbDisplayPaused(_INTL("You got away safely!")) { pbSEPlay("Battle flee") }
pbSEPlay("Battle flee")
pbDisplayPaused(_INTL("You got away safely!"))
@decision = 3
return 1
end
@@ -79,7 +82,8 @@ class PokeBattle_Battle
if BattleHandlers.triggerRunFromBattleAbility(battler.ability,battler)
pbShowAbilitySplash(battler,true)
pbHideAbilitySplash(battler)
pbDisplayPaused(_INTL("You got away safely!")) { pbSEPlay("Battle flee") }
pbSEPlay("Battle flee")
pbDisplayPaused(_INTL("You got away safely!"))
@decision = 3
return 1
end
@@ -87,8 +91,9 @@ class PokeBattle_Battle
# Held items that guarantee escape
if battler.itemActive?
if BattleHandlers.triggerRunFromBattleItem(battler.item,battler)
pbSEPlay("Battle flee")
pbDisplayPaused(_INTL("{1} fled using its {2}!",
battler.pbThis,battler.itemName)) { pbSEPlay("Battle flee") }
battler.pbThis,battler.itemName))
@decision = 3
return 1
end
@@ -135,7 +140,8 @@ class PokeBattle_Battle
rate += @runCommand*30
end
if rate>=256 || @battleAI.pbAIRandom(256)<rate
pbDisplayPaused(_INTL("You got away safely!")) { pbSEPlay("Battle flee") }
pbSEPlay("Battle flee")
pbDisplayPaused(_INTL("You got away safely!"))
@decision = 3
return 1
end

View File

@@ -462,7 +462,8 @@ class PokeBattle_SafariZone
catchFactor *= 2 # Easier to catch
escapeFactor *= 2 if pbRandom(100)<90 # More likely to escape
when 3 # Run
pbDisplayPaused(_INTL("You got away safely!")) { pbSEPlay("Battle flee") }
pbSEPlay("Battle flee")
pbDisplayPaused(_INTL("You got away safely!"))
@decision = 3
end
catchFactor = [[catchFactor,3].max,20].min
@@ -473,7 +474,8 @@ class PokeBattle_SafariZone
pbDisplay(_INTL("PA: You have no Safari Balls left! Game over!"))
@decision = 2
elsif pbRandom(100)<5*escapeFactor
pbDisplay(_INTL("{1} fled!",wildpoke.name)) { pbSEPlay("Battle flee") }
pbSEPlay("Battle flee")
pbDisplay(_INTL("{1} fled!",wildpoke.name))
@decision = 3
elsif cmd==1 # Bait
pbDisplay(_INTL("{1} is eating!",wildpoke.name))

View File

@@ -83,7 +83,8 @@ BattleHandlers::AbilityOnHPDroppedBelowHalf.add(:EMERGENCYEXIT,
next false if !battle.pbCanRun?(battler.index)
battle.pbShowAbilitySplash(battler,true)
battle.pbHideAbilitySplash(battler)
battle.pbDisplay(_INTL("{1} fled from battle!",battler.pbThis)) { pbSEPlay("Battle flee") }
pbSEPlay("Battle flee")
battle.pbDisplay(_INTL("{1} fled from battle!",battler.pbThis))
battle.decision = 3 # Escaped
next true
end