Merge branch 'master' into refactor

This commit is contained in:
Maruno17
2020-11-09 19:17:24 +00:00
15 changed files with 201 additions and 140 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

@@ -83,7 +83,7 @@ class PokeBattle_Battle
end
end
# Uses an item on a Pokémon in the player's party.
# Uses an item on a Pokémon in the trainer's party.
def pbUseItemOnPokemon(item,idxParty,userBattler)
trainerName = pbGetOwnerName(userBattler.index)
pbUseItemMessage(item,trainerName)
@@ -100,14 +100,14 @@ class PokeBattle_Battle
pbReturnUnusedItemToBag(item,userBattler.index)
end
# Uses an item on a Pokémon in battle that belongs to the player.
def pbUseItemOnBattler(item,idxParty,userBattler)
# Uses an item on a Pokémon in battle that belongs to the trainer.
def pbUseItemOnBattler(item,idxBattler,userBattler)
trainerName = pbGetOwnerName(userBattler.index)
pbUseItemMessage(item,trainerName)
pkmn = pbParty(userBattler.index)[idxParty]
battler = pbFindBattler(idxParty,userBattler.index)
idxBattler = userBattler.index if idxBattler<0
battler = @battlers[idxBattler]
ch = @choices[userBattler.index]
if ItemHandlers.triggerCanUseInBattle(item,pkmn,battler,ch[3],true,self,@scene,false)
if ItemHandlers.triggerCanUseInBattle(item,battler.pokemon,battler,ch[3],true,self,@scene,false)
ItemHandlers.triggerBattleUseOnBattler(item,battler,@scene)
ch[1] = nil # Delete item from choice
return

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

@@ -326,7 +326,7 @@ class PokemonDataBox < SpriteWrapper
if @expFlash==0
pbSEStop
@expFlash = Graphics.frame_rate/5
pbSEPlay("Exp full")
pbSEPlay("Pkmn exp full")
self.flash(Color.new(64,200,248,192),@expFlash)
for i in @sprites
i[1].flash(Color.new(64,200,248,192),@expFlash) if !i[1].disposed?

View File

@@ -25,8 +25,8 @@ class PokeBattle_FakeBattler
def shiny?; return @pokemon.shiny?; end
alias isShiny? shiny?
def isSpecies?(checK_species)
return @pokemon && @pokemon.isSpecies?(checK_species)
def isSpecies?(check_species)
return @pokemon && @pokemon.isSpecies?(check_species)
end
def fainted?; return false; end
@@ -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