mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 06:34:59 +00:00
The Great Enspacening begins!
This commit is contained in:
@@ -310,7 +310,7 @@ class Battle
|
||||
|
||||
# Returns the player's team in its display order. Used when showing the party
|
||||
# screen.
|
||||
def pbPlayerDisplayParty(idxBattler=0)
|
||||
def pbPlayerDisplayParty(idxBattler = 0)
|
||||
partyOrders = pbPartyOrder(idxBattler)
|
||||
idxStart, _idxEnd = pbTeamIndexRangeFromBattlerIndex(idxBattler)
|
||||
ret = []
|
||||
@@ -318,14 +318,14 @@ class Battle
|
||||
return ret
|
||||
end
|
||||
|
||||
def pbAbleCount(idxBattler=0)
|
||||
def pbAbleCount(idxBattler = 0)
|
||||
party = pbParty(idxBattler)
|
||||
count = 0
|
||||
party.each { |pkmn| count += 1 if pkmn && pkmn.able? }
|
||||
return count
|
||||
end
|
||||
|
||||
def pbAbleNonActiveCount(idxBattler=0)
|
||||
def pbAbleNonActiveCount(idxBattler = 0)
|
||||
party = pbParty(idxBattler)
|
||||
inBattleIndices = allSameSideBattlers(idxBattler).map { |b| b.pokemonIndex }
|
||||
count = 0
|
||||
@@ -337,7 +337,7 @@ class Battle
|
||||
return count
|
||||
end
|
||||
|
||||
def pbAllFainted?(idxBattler=0)
|
||||
def pbAllFainted?(idxBattler = 0)
|
||||
return pbAbleCount(idxBattler)==0
|
||||
end
|
||||
|
||||
@@ -442,7 +442,7 @@ class Battle
|
||||
end
|
||||
|
||||
# Unused
|
||||
def eachSameSideBattler(idxBattler=0)
|
||||
def eachSameSideBattler(idxBattler = 0)
|
||||
idxBattler = idxBattler.index if idxBattler.respond_to?("index")
|
||||
@battlers.each { |b| yield b if b && !b.fainted? && !b.opposes?(idxBattler) }
|
||||
end
|
||||
@@ -453,7 +453,7 @@ class Battle
|
||||
end
|
||||
|
||||
# Unused
|
||||
def eachOtherSideBattler(idxBattler=0)
|
||||
def eachOtherSideBattler(idxBattler = 0)
|
||||
idxBattler = idxBattler.index if idxBattler.respond_to?("index")
|
||||
@battlers.each { |b| yield b if b && !b.fainted? && b.opposes?(idxBattler) }
|
||||
end
|
||||
@@ -463,11 +463,11 @@ class Battle
|
||||
return @battlers.select { |b| b && !b.fainted? && b.opposes?(idxBattler) }
|
||||
end
|
||||
|
||||
def pbSideBattlerCount(idxBattler=0)
|
||||
def pbSideBattlerCount(idxBattler = 0)
|
||||
return allSameSideBattlers(idxBattler).length
|
||||
end
|
||||
|
||||
def pbOpposingBattlerCount(idxBattler=0)
|
||||
def pbOpposingBattlerCount(idxBattler = 0)
|
||||
return allOtherSideBattlers(idxBattler).length
|
||||
end
|
||||
|
||||
@@ -481,7 +481,7 @@ class Battle
|
||||
return nil
|
||||
end
|
||||
|
||||
def pbCheckOpposingAbility(abil,idxBattler=0,nearOnly=false)
|
||||
def pbCheckOpposingAbility(abil,idxBattler = 0,nearOnly = false)
|
||||
allOtherSideBattlers(idxBattler).each do |b|
|
||||
next if nearOnly && !b.near?(idxBattler)
|
||||
return b if b.hasActiveAbility?(abil)
|
||||
@@ -536,7 +536,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# Comparing the positions of two battlers
|
||||
#=============================================================================
|
||||
def opposes?(idxBattler1,idxBattler2=0)
|
||||
def opposes?(idxBattler1,idxBattler2 = 0)
|
||||
idxBattler1 = idxBattler1.index if idxBattler1.respond_to?("index")
|
||||
idxBattler2 = idxBattler2.index if idxBattler2.respond_to?("index")
|
||||
return (idxBattler1&1)!=(idxBattler2&1)
|
||||
@@ -631,7 +631,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# Returns the battler representing the Pokémon at index idxParty in its party,
|
||||
# on the same side as a battler with battler index of idxBattlerOther.
|
||||
def pbFindBattler(idxParty,idxBattlerOther=0)
|
||||
def pbFindBattler(idxParty,idxBattlerOther = 0)
|
||||
allSameSideBattlers(idxBattlerOther).each { |b| return b if b.pokemonIndex==idxParty }
|
||||
return nil
|
||||
end
|
||||
@@ -696,7 +696,7 @@ class Battle
|
||||
end
|
||||
|
||||
# Used for causing weather by a move or by an ability.
|
||||
def pbStartWeather(user,newWeather,fixedDuration=false,showAnim=true)
|
||||
def pbStartWeather(user,newWeather,fixedDuration = false,showAnim = true)
|
||||
return if @field.weather==newWeather
|
||||
@field.weather = newWeather
|
||||
duration = (fixedDuration) ? 5 : -1
|
||||
@@ -774,7 +774,7 @@ class Battle
|
||||
@field.terrainDuration = -1
|
||||
end
|
||||
|
||||
def pbStartTerrain(user,newTerrain,fixedDuration=true)
|
||||
def pbStartTerrain(user,newTerrain,fixedDuration = true)
|
||||
return if @field.terrain==newTerrain
|
||||
@field.terrain = newTerrain
|
||||
duration = (fixedDuration) ? 5 : -1
|
||||
@@ -820,19 +820,19 @@ class Battle
|
||||
return @scene.pbDisplayConfirmMessage(msg)
|
||||
end
|
||||
|
||||
def pbShowCommands(msg,commands,canCancel=true)
|
||||
def pbShowCommands(msg,commands,canCancel = true)
|
||||
@scene.pbShowCommands(msg,commands,canCancel)
|
||||
end
|
||||
|
||||
def pbAnimation(move,user,targets,hitNum=0)
|
||||
def pbAnimation(move,user,targets,hitNum = 0)
|
||||
@scene.pbAnimation(move,user,targets,hitNum) if @showAnims
|
||||
end
|
||||
|
||||
def pbCommonAnimation(name,user=nil,targets=nil)
|
||||
def pbCommonAnimation(name,user = nil,targets = nil)
|
||||
@scene.pbCommonAnimation(name,user,targets) if @showAnims
|
||||
end
|
||||
|
||||
def pbShowAbilitySplash(battler,delay=false,logTrigger=true)
|
||||
def pbShowAbilitySplash(battler,delay = false,logTrigger = true)
|
||||
PBDebug.log("[Ability triggered] #{battler.pbThis}'s #{battler.abilityName}") if logTrigger
|
||||
return if !Scene::USE_ABILITY_SPLASH
|
||||
@scene.pbShowAbilitySplash(battler)
|
||||
|
||||
@@ -491,7 +491,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# Judging
|
||||
#=============================================================================
|
||||
def pbJudgeCheckpoint(user,move=nil); end
|
||||
def pbJudgeCheckpoint(user,move = nil); end
|
||||
|
||||
def pbDecisionOnTime
|
||||
counts = [0,0]
|
||||
|
||||
@@ -89,7 +89,7 @@ class Battle
|
||||
end
|
||||
end
|
||||
|
||||
def pbGainExpOne(idxParty,defeatedBattler,numPartic,expShare,expAll,showMessages=true)
|
||||
def pbGainExpOne(idxParty,defeatedBattler,numPartic,expShare,expAll,showMessages = true)
|
||||
pkmn = pbParty(0)[idxParty] # The Pokémon gaining Exp from defeatedBattler
|
||||
growth_rate = pkmn.growth_rate
|
||||
# Don't bother calculating if gainer is already at max Exp
|
||||
|
||||
@@ -2,7 +2,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# Choosing a move/target
|
||||
#=============================================================================
|
||||
def pbCanChooseMove?(idxBattler,idxMove,showMessages,sleepTalk=false)
|
||||
def pbCanChooseMove?(idxBattler,idxMove,showMessages,sleepTalk = false)
|
||||
battler = @battlers[idxBattler]
|
||||
move = battler.moves[idxMove]
|
||||
return false unless move
|
||||
@@ -17,7 +17,7 @@ class Battle
|
||||
return battler.pbCanChooseMove?(move,true,showMessages,sleepTalk)
|
||||
end
|
||||
|
||||
def pbCanChooseAnyMove?(idxBattler,sleepTalk=false)
|
||||
def pbCanChooseAnyMove?(idxBattler,sleepTalk = false)
|
||||
battler = @battlers[idxBattler]
|
||||
battler.eachMoveWithIndex do |m,i|
|
||||
next if m.pp==0 && m.total_pp>0 && !sleepTalk
|
||||
@@ -33,7 +33,7 @@ class Battle
|
||||
|
||||
# Called when the Pokémon is Encored, or if it can't use any of its moves.
|
||||
# Makes the Pokémon use the Encored move (if Encored), or Struggle.
|
||||
def pbAutoChooseMove(idxBattler,showMessages=true)
|
||||
def pbAutoChooseMove(idxBattler,showMessages = true)
|
||||
battler = @battlers[idxBattler]
|
||||
if battler.fainted?
|
||||
pbClearChoice(idxBattler)
|
||||
@@ -67,7 +67,7 @@ class Battle
|
||||
return true
|
||||
end
|
||||
|
||||
def pbRegisterMove(idxBattler,idxMove,showMessages=true)
|
||||
def pbRegisterMove(idxBattler,idxMove,showMessages = true)
|
||||
battler = @battlers[idxBattler]
|
||||
move = battler.moves[idxMove]
|
||||
return false if !pbCanChooseMove?(idxBattler,idxMove,showMessages)
|
||||
@@ -133,7 +133,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# Turn order calculation (priority)
|
||||
#=============================================================================
|
||||
def pbCalculatePriority(fullCalc=false,indexArray=nil)
|
||||
def pbCalculatePriority(fullCalc = false,indexArray = nil)
|
||||
needRearranging = false
|
||||
if fullCalc
|
||||
@priorityTrickRoom = (@field.effects[PBEffects::TrickRoom]>0)
|
||||
@@ -231,7 +231,7 @@ class Battle
|
||||
end
|
||||
end
|
||||
|
||||
def pbPriority(onlySpeedSort=false)
|
||||
def pbPriority(onlySpeedSort = false)
|
||||
ret = []
|
||||
if onlySpeedSort
|
||||
# Sort battlers by their speed stats and tie-breaker order only.
|
||||
|
||||
@@ -6,7 +6,7 @@ class Battle
|
||||
# battle.
|
||||
# NOTE: Messages are only shown while in the party screen when choosing a
|
||||
# command for the next round.
|
||||
def pbCanSwitchLax?(idxBattler,idxParty,partyScene=nil)
|
||||
def pbCanSwitchLax?(idxBattler,idxParty,partyScene = nil)
|
||||
return true if idxParty<0
|
||||
party = pbParty(idxBattler)
|
||||
return false if idxParty>=party.length
|
||||
@@ -40,7 +40,7 @@ class Battle
|
||||
# switch out (and that its replacement at party index idxParty can switch in).
|
||||
# NOTE: Messages are only shown while in the party screen when choosing a
|
||||
# command for the next round.
|
||||
def pbCanSwitch?(idxBattler,idxParty=-1,partyScene=nil)
|
||||
def pbCanSwitch?(idxBattler,idxParty = -1,partyScene = nil)
|
||||
# Check whether party Pokémon can switch in
|
||||
return false if !pbCanSwitchLax?(idxBattler,idxParty,partyScene)
|
||||
# Make sure another battler isn't already choosing to switch to the party
|
||||
@@ -113,7 +113,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# Open party screen and potentially choose a Pokémon to switch with. Used in
|
||||
# all instances where the party screen is opened.
|
||||
def pbPartyScreen(idxBattler,checkLaxOnly=false,canCancel=false,shouldRegister=false)
|
||||
def pbPartyScreen(idxBattler,checkLaxOnly = false,canCancel = false,shouldRegister = false)
|
||||
ret = -1
|
||||
@scene.pbPartyScreen(idxBattler,canCancel) { |idxParty,partyScene|
|
||||
if checkLaxOnly
|
||||
@@ -132,7 +132,7 @@ class Battle
|
||||
|
||||
# For choosing a replacement Pokémon when prompted in the middle of other
|
||||
# things happening (U-turn, Baton Pass, in def pbEORSwitch).
|
||||
def pbSwitchInBetween(idxBattler,checkLaxOnly=false,canCancel=false)
|
||||
def pbSwitchInBetween(idxBattler,checkLaxOnly = false,canCancel = false)
|
||||
return pbPartyScreen(idxBattler,checkLaxOnly,canCancel) if pbOwnedByPlayer?(idxBattler)
|
||||
return @battleAI.pbDefaultChooseNewEnemy(idxBattler,pbParty(idxBattler))
|
||||
end
|
||||
@@ -142,7 +142,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# General switching method that checks if any Pokémon need to be sent out and,
|
||||
# if so, does. Called at the end of each round.
|
||||
def pbEORSwitch(favorDraws=false)
|
||||
def pbEORSwitch(favorDraws = false)
|
||||
return if @decision>0 && !favorDraws
|
||||
return if @decision==5 && favorDraws
|
||||
pbJudge
|
||||
@@ -206,7 +206,7 @@ class Battle
|
||||
end
|
||||
end
|
||||
|
||||
def pbGetReplacementPokemonIndex(idxBattler,random=false)
|
||||
def pbGetReplacementPokemonIndex(idxBattler,random = false)
|
||||
if random
|
||||
choices = [] # Find all Pokémon that can switch in
|
||||
eachInTeamFromBattlerIndex(idxBattler) do |_pkmn,i|
|
||||
@@ -220,7 +220,7 @@ class Battle
|
||||
end
|
||||
|
||||
# Actually performs the recalling and sending out in all situations.
|
||||
def pbRecallAndReplace(idxBattler,idxParty,randomReplacement=false,batonPass=false)
|
||||
def pbRecallAndReplace(idxBattler,idxParty,randomReplacement = false,batonPass = false)
|
||||
@scene.pbRecall(idxBattler) if !@battlers[idxBattler].fainted?
|
||||
@battlers[idxBattler].pbAbilitiesOnSwitchOut # Inc. primordial weather check
|
||||
@scene.pbShowPartyLineup(idxBattler&1) if pbSideSize(idxBattler)==1
|
||||
@@ -274,7 +274,7 @@ class Battle
|
||||
|
||||
# Only called from def pbRecallAndReplace above and Battle Arena's def
|
||||
# pbSwitch.
|
||||
def pbReplace(idxBattler,idxParty,batonPass=false)
|
||||
def pbReplace(idxBattler,idxParty,batonPass = false)
|
||||
party = pbParty(idxBattler)
|
||||
idxPartyOld = @battlers[idxBattler].pokemonIndex
|
||||
# Initialise the new Pokémon
|
||||
@@ -289,7 +289,7 @@ class Battle
|
||||
|
||||
# Called from def pbReplace above and at the start of battle.
|
||||
# sendOuts is an array; each element is itself an array: [idxBattler,pkmn]
|
||||
def pbSendOut(sendOuts,startBattle=false)
|
||||
def pbSendOut(sendOuts,startBattle = false)
|
||||
sendOuts.each { |b| @peer.pbOnEnteringBattle(self, @battlers[b[0]], b[1]) }
|
||||
@scene.pbSendOutBattlers(sendOuts,startBattle)
|
||||
sendOuts.each do |b|
|
||||
|
||||
@@ -2,7 +2,7 @@ class Battle
|
||||
#=============================================================================
|
||||
# Choosing to use an item
|
||||
#=============================================================================
|
||||
def pbCanUseItemOnPokemon?(item,pkmn,battler,scene,showMessages=true)
|
||||
def pbCanUseItemOnPokemon?(item,pkmn,battler,scene,showMessages = true)
|
||||
if !pkmn || pkmn.egg?
|
||||
scene.pbDisplay(_INTL("It won't have any effect.")) if showMessages
|
||||
return false
|
||||
@@ -24,7 +24,7 @@ class Battle
|
||||
return false
|
||||
end
|
||||
|
||||
def pbRegisterItem(idxBattler,item,idxTarget=nil,idxMove=nil)
|
||||
def pbRegisterItem(idxBattler,item,idxTarget = nil,idxMove = nil)
|
||||
# Register for use of item on a Pokémon in the party
|
||||
@choices[idxBattler][0] = :UseItem
|
||||
@choices[idxBattler][1] = item # ID of item to be used
|
||||
|
||||
@@ -27,7 +27,7 @@ class Battle
|
||||
# 1: Succeeded at fleeing, battle will end
|
||||
# duringBattle is true for replacing a fainted Pokémon during the End Of Round
|
||||
# phase, and false for choosing the Run command.
|
||||
def pbRun(idxBattler,duringBattle=false)
|
||||
def pbRun(idxBattler,duringBattle = false)
|
||||
battler = @battlers[idxBattler]
|
||||
if battler.opposes?
|
||||
return 0 if trainerBattle?
|
||||
|
||||
Reference in New Issue
Block a user