The Great Enspacening begins!

This commit is contained in:
Maruno17
2021-12-18 12:20:31 +00:00
parent 2480ab0f9e
commit f7b76ae62e
138 changed files with 567 additions and 567 deletions

View File

@@ -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)

View File

@@ -491,7 +491,7 @@ class Battle
#=============================================================================
# Judging
#=============================================================================
def pbJudgeCheckpoint(user,move=nil); end
def pbJudgeCheckpoint(user,move = nil); end
def pbDecisionOnTime
counts = [0,0]

View File

@@ -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

View File

@@ -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.

View File

@@ -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|

View File

@@ -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

View File

@@ -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?

View File

@@ -208,7 +208,7 @@ class Battle::Battler
return (itm) ? itm.name : ""
end
def pbThis(lowerCase=false)
def pbThis(lowerCase = false)
if opposes?
if @battle.trainerBattle?
return lowerCase ? _INTL("the opposing {1}",name) : _INTL("The opposing {1}",name)
@@ -221,14 +221,14 @@ class Battle::Battler
return name
end
def pbTeam(lowerCase=false)
def pbTeam(lowerCase = false)
if opposes?
return lowerCase ? _INTL("the opposing team") : _INTL("The opposing team")
end
return lowerCase ? _INTL("your team") : _INTL("Your team")
end
def pbOpposingTeam(lowerCase=false)
def pbOpposingTeam(lowerCase = false)
if opposes?
return lowerCase ? _INTL("your team") : _INTL("Your team")
end
@@ -301,7 +301,7 @@ class Battle::Battler
# Returns the active types of this Pokémon. The array should not include the
# same type more than once, and should not include any invalid types.
def pbTypes(withType3=false)
def pbTypes(withType3 = false)
ret = @types.uniq
# Burn Up erases the Fire-type.
ret.delete(:FIRE) if @effects[PBEffects::BurnUp]
@@ -413,7 +413,7 @@ class Battle::Battler
return ability_blacklist.include?(abil.id)
end
def itemActive?(ignoreFainted=false)
def itemActive?(ignoreFainted = false)
return false if fainted? && !ignoreFainted
return false if @effects[PBEffects::Embargo]>0
return false if @battle.field.effects[PBEffects::MagicRoom]>0
@@ -509,7 +509,7 @@ class Battle::Battler
return true
end
def takesIndirectDamage?(showMsg=false)
def takesIndirectDamage?(showMsg = false)
return false if fainted?
if hasActiveAbility?(:MAGICGUARD)
if showMsg
@@ -558,7 +558,7 @@ class Battle::Battler
return ret
end
def affectedByPowder?(showMsg=false)
def affectedByPowder?(showMsg = false)
return false if fainted?
if pbHasType?(:GRASS) && Settings::MORE_TYPE_EFFECTS
@battle.pbDisplay(_INTL("{1} is unaffected!",pbThis)) if showMsg
@@ -593,7 +593,7 @@ class Battle::Battler
return true
end
def affectedByContactEffect?(showMsg=false)
def affectedByContactEffect?(showMsg = false)
return false if fainted?
if hasActiveItem?(:PROTECTIVEPADS)
@battle.pbDisplay(_INTL("{1} protected itself with the {2}!",pbThis,itemName)) if showMsg
@@ -687,7 +687,7 @@ class Battle::Battler
# Methods relating to this battler's position on the battlefield
#=============================================================================
# Returns whether the given position belongs to the opposing Pokémon's side.
def opposes?(i=0)
def opposes?(i = 0)
i = i.index if i.respond_to?("index")
return (@index&1)!=(i&1)
end
@@ -755,7 +755,7 @@ class Battle::Battler
# Returns the battler that is most directly opposite to self. unfaintedOnly is
# whether it should prefer to return a non-fainted battler.
def pbDirectOpposing(unfaintedOnly=false)
def pbDirectOpposing(unfaintedOnly = false)
@battle.pbGetOpposingIndicesInOrder(@index).each do |i|
next if !@battle.battlers[i]
break if unfaintedOnly && @battle.battlers[i].fainted?

View File

@@ -57,7 +57,7 @@ class Battle::Battler
@dummy = true
end
def pbInitialize(pkmn,idxParty,batonPass=false)
def pbInitialize(pkmn,idxParty,batonPass = false)
pbInitPokemon(pkmn,idxParty)
pbInitEffects(batonPass)
@damageState.reset
@@ -288,7 +288,7 @@ class Battle::Battler
#=============================================================================
# Refreshing a battler's properties
#=============================================================================
def pbUpdate(fullChange=false)
def pbUpdate(fullChange = false)
return if !@pokemon
@pokemon.calc_stats
@level = @pokemon.level

View File

@@ -2,7 +2,7 @@ class Battle::Battler
#=============================================================================
# Change HP
#=============================================================================
def pbReduceHP(amt,anim=true,registerDamage=true,anyAnim=true)
def pbReduceHP(amt,anim = true,registerDamage = true,anyAnim = true)
amt = amt.round
amt = @hp if amt>@hp
amt = 1 if amt<1 && !fainted?
@@ -19,7 +19,7 @@ class Battle::Battler
return amt
end
def pbRecoverHP(amt,anim=true,anyAnim=true)
def pbRecoverHP(amt,anim = true,anyAnim = true)
amt = amt.round
amt = @totalhp-@hp if amt>@totalhp-@hp
amt = 1 if amt<1 && @hp<@totalhp
@@ -33,7 +33,7 @@ class Battle::Battler
return amt
end
def pbRecoverHPFromDrain(amt,target,msg=nil)
def pbRecoverHPFromDrain(amt,target,msg = nil)
if target.hasActiveAbility?(:LIQUIDOOZE)
@battle.pbShowAbilitySplash(target)
pbReduceHP(amt)
@@ -60,7 +60,7 @@ class Battle::Battler
@droppedBelowHalfHP = false
end
def pbFaint(showMessage=true)
def pbFaint(showMessage = true)
if !fainted?
PBDebug.log("!!!***Can't faint with HP greater than 0")
return
@@ -227,7 +227,7 @@ class Battle::Battler
# Checks the Pokémon's form and updates it if necessary. Used for when a
# Pokémon enters battle (endOfRound=false) and at the end of each round
# (endOfRound=true).
def pbCheckForm(endOfRound=false)
def pbCheckForm(endOfRound = false)
return if fainted? || @effects[PBEffects::Transform]
# Form changes upon entering battle and when the weather changes
pbCheckFormOnWeatherChange if !endOfRound

View File

@@ -22,7 +22,7 @@ class Battle::Battler
return @status != :NONE
end
def pbCanInflictStatus?(newStatus,user,showMessages,move=nil,ignoreStatus=false)
def pbCanInflictStatus?(newStatus,user,showMessages,move = nil,ignoreStatus = false)
return false if fainted?
selfInflicted = (user && user.index==@index)
# Already have that status problem
@@ -214,7 +214,7 @@ class Battle::Battler
#=============================================================================
# Generalised infliction of status problem
#=============================================================================
def pbInflictStatus(newStatus,newStatusCount=0,msg=nil,user=nil)
def pbInflictStatus(newStatus,newStatusCount = 0,msg = nil,user = nil)
# Inflict the new status
self.status = newStatus
self.statusCount = newStatusCount
@@ -420,7 +420,7 @@ class Battle::Battler
PBDebug.log("[Status continues] #{pbThis}'s sleep count is #{@statusCount}") if self.status == :SLEEP
end
def pbCureStatus(showMessages=true)
def pbCureStatus(showMessages = true)
oldStatus = status
self.status = :NONE
if showMessages
@@ -438,7 +438,7 @@ class Battle::Battler
#=============================================================================
# Confusion
#=============================================================================
def pbCanConfuse?(user=nil,showMessages=true,move=nil,selfInflicted=false)
def pbCanConfuse?(user = nil,showMessages = true,move = nil,selfInflicted = false)
return false if fainted?
if @effects[PBEffects::Confusion]>0
@battle.pbDisplay(_INTL("{1} is already confused.",pbThis)) if showMessages
@@ -480,7 +480,7 @@ class Battle::Battler
return pbCanConfuse?(nil,showMessages,nil,true)
end
def pbConfuse(msg=nil)
def pbConfuse(msg = nil)
@effects[PBEffects::Confusion] = pbConfusionDuration
@battle.pbCommonAnimation("Confusion",self)
msg = _INTL("{1} became confused!",pbThis) if nil_or_empty?(msg)
@@ -491,7 +491,7 @@ class Battle::Battler
pbAbilityStatusCureCheck
end
def pbConfusionDuration(duration=-1)
def pbConfusionDuration(duration = -1)
duration = 2+@battle.pbRandom(4) if duration<=0
return duration
end
@@ -503,7 +503,7 @@ class Battle::Battler
#=============================================================================
# Attraction
#=============================================================================
def pbCanAttract?(user,showMessages=true)
def pbCanAttract?(user,showMessages = true)
return false if fainted?
return false if !user || user.fainted?
if @effects[PBEffects::Attract]>=0
@@ -547,7 +547,7 @@ class Battle::Battler
return true
end
def pbAttract(user,msg=nil)
def pbAttract(user,msg = nil)
@effects[PBEffects::Attract] = user.index
@battle.pbCommonAnimation("Attract",self)
msg = _INTL("{1} fell in love!",pbThis) if nil_or_empty?(msg)
@@ -568,7 +568,7 @@ class Battle::Battler
#=============================================================================
# Flinching
#=============================================================================
def pbFlinch(_user=nil)
def pbFlinch(_user = nil)
return if hasActiveAbility?(:INNERFOCUS) && !@battle.moldBreaker
@effects[PBEffects::Flinch] = true
end

View File

@@ -6,7 +6,7 @@ class Battle::Battler
return @stages[stat]>=6
end
def pbCanRaiseStatStage?(stat,user=nil,move=nil,showFailMsg=false,ignoreContrary=false)
def pbCanRaiseStatStage?(stat,user = nil,move = nil,showFailMsg = false,ignoreContrary = false)
return false if fainted?
# Contrary
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
@@ -21,7 +21,7 @@ class Battle::Battler
return true
end
def pbRaiseStatStageBasic(stat,increment,ignoreContrary=false)
def pbRaiseStatStageBasic(stat,increment,ignoreContrary = false)
if !@battle.moldBreaker
# Contrary
if hasActiveAbility?(:CONTRARY) && !ignoreContrary
@@ -42,7 +42,7 @@ class Battle::Battler
return increment
end
def pbRaiseStatStage(stat,increment,user,showAnim=true,ignoreContrary=false)
def pbRaiseStatStage(stat,increment,user,showAnim = true,ignoreContrary = false)
# Contrary
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
return pbLowerStatStage(stat,increment,user,showAnim,true)
@@ -65,7 +65,7 @@ class Battle::Battler
return true
end
def pbRaiseStatStageByCause(stat,increment,user,cause,showAnim=true,ignoreContrary=false)
def pbRaiseStatStageByCause(stat,increment,user,cause,showAnim = true,ignoreContrary = false)
# Contrary
if hasActiveAbility?(:CONTRARY) && !ignoreContrary && !@battle.moldBreaker
return pbLowerStatStageByCause(stat,increment,user,cause,showAnim,true)
@@ -96,7 +96,7 @@ class Battle::Battler
return true
end
def pbRaiseStatStageByAbility(stat,increment,user,splashAnim=true)
def pbRaiseStatStageByAbility(stat,increment,user,splashAnim = true)
return false if fainted?
ret = false
@battle.pbShowAbilitySplash(user) if splashAnim
@@ -163,7 +163,7 @@ class Battle::Battler
return true
end
def pbLowerStatStageBasic(stat,increment,ignoreContrary=false)
def pbLowerStatStageBasic(stat,increment,ignoreContrary = false)
if !@battle.moldBreaker
# Contrary
if hasActiveAbility?(:CONTRARY) && !ignoreContrary
@@ -275,7 +275,7 @@ class Battle::Battler
return true
end
def pbLowerStatStageByAbility(stat,increment,user,splashAnim=true,checkContact=false)
def pbLowerStatStageByAbility(stat,increment,user,splashAnim = true,checkContact = false)
ret = false
@battle.pbShowAbilitySplash(user) if splashAnim
if pbCanLowerStatStage?(stat,user,nil,Battle::Scene::USE_ABILITY_SPLASH) &&

View File

@@ -63,7 +63,7 @@ class Battle::Battler
# Called when a Pokémon (self) enters battle, at the end of each move used,
# and at the end of each round.
def pbContinualAbilityChecks(onSwitchIn=false)
def pbContinualAbilityChecks(onSwitchIn = false)
# Check for end of primordial weather
@battle.pbEndPrimordialWeather
# Trace
@@ -227,7 +227,7 @@ class Battle::Battler
self.item = nil
end
def pbConsumeItem(recoverable=true,symbiosis=true,belch=true)
def pbConsumeItem(recoverable = true,symbiosis = true,belch = true)
PBDebug.log("[Item consumed] #{pbThis} consumed its held #{itemName}")
if recoverable
setRecycleItem(@item_id)

View File

@@ -2,7 +2,7 @@ class Battle::Battler
#=============================================================================
# Turn processing
#=============================================================================
def pbProcessTurn(choice,tryFlee=true)
def pbProcessTurn(choice,tryFlee = true)
return false if fainted?
# Wild roaming Pokémon always flee if possible
if tryFlee && wild? &&
@@ -144,7 +144,7 @@ class Battle::Battler
# Simple "use move" method, used when a move calls another move and for Future
# Sight's attack
#=============================================================================
def pbUseMoveSimple(moveID,target=-1,idxMove=-1,specialUsage=true)
def pbUseMoveSimple(moveID,target = -1,idxMove = -1,specialUsage = true)
choice = []
choice[0] = :UseMove # "Use move"
choice[1] = idxMove # Index of move to be used in user's moveset
@@ -162,7 +162,7 @@ class Battle::Battler
#=============================================================================
# Master "use move" method
#=============================================================================
def pbUseMove(choice,specialUsage=false)
def pbUseMove(choice,specialUsage = false)
# NOTE: This is intentionally determined before a multi-turn attack can
# set specialUsage to true.
skipAccuracyCheck = (specialUsage && choice[2]!=@battle.struggle)

View File

@@ -170,7 +170,7 @@ class Battle::Battler
#=============================================================================
# Register target
#=============================================================================
def pbAddTarget(targets,user,target,move,nearOnly=true,allowUser=false)
def pbAddTarget(targets,user,target,move,nearOnly = true,allowUser = false)
return false if !target || (target.fainted? && !move.targetsPosition?)
return false if !allowUser && target == user
return false if nearOnly && !user.near?(target) && target != user
@@ -190,7 +190,7 @@ class Battle::Battler
end
end
def pbAddTargetRandomFoe(targets, user, move, nearOnly =true)
def pbAddTargetRandomFoe(targets, user, move, nearOnly = true)
choices = []
user.allOpposing.each do |b|
next if nearOnly && !user.near?(b)

View File

@@ -7,7 +7,7 @@ class Battle::Battler
# earlier in the same round (after choosing the command but before using the
# move) or an unusable move may be called by another move such as Metronome.
#=============================================================================
def pbCanChooseMove?(move,commandPhase,showMessages=true,specialUsage=false)
def pbCanChooseMove?(move,commandPhase,showMessages = true,specialUsage = false)
# Disable
if @effects[PBEffects::DisableMove]==move.id && !specialUsage
if showMessages

View File

@@ -74,7 +74,7 @@ class Battle::Move
# NOTE: This method is only ever called while using a move (and also by the
# AI), so using @calcType here is acceptable.
def physicalMove?(thisType=nil)
def physicalMove?(thisType = nil)
return (@category==0) if Settings::MOVE_CATEGORY_PER_MOVE
thisType ||= @calcType
thisType ||= @type
@@ -84,7 +84,7 @@ class Battle::Move
# NOTE: This method is only ever called while using a move (and also by the
# AI), so using @calcType here is acceptable.
def specialMove?(thisType=nil)
def specialMove?(thisType = nil)
return (@category==1) if Settings::MOVE_CATEGORY_PER_MOVE
thisType ||= @calcType
thisType ||= @type
@@ -134,7 +134,7 @@ class Battle::Move
def danceMove?; return @flags.any? { |f| f[/^Dance$/i] }; end
# Causes perfect accuracy (param=1) and double damage (param=2).
def tramplesMinimize?(_param=1); return false; end
def tramplesMinimize?(_param = 1); return false; end
def nonLethal?(_user,_target); return false; end # For False Swipe
def ignoresSubstitute?(user) # user is the Pokémon using this move

View File

@@ -61,7 +61,7 @@ class Battle::Move
def pbDesignateTargetsForHit(targets, hitNum); return targets; end # For Dragon Darts
def pbRepeatHit?; return false; end # For Dragon Darts
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
return if !showAnimation
if user.effects[PBEffects::ParentalBond]==1
@battle.pbCommonAnimation("ParentalBond",user,targets)
@@ -122,7 +122,7 @@ class Battle::Move
return false
end
def pbMoveFailedAromaVeil?(user,target,showMessage=true)
def pbMoveFailedAromaVeil?(user,target,showMessage = true)
return false if @battle.moldBreaker
if target.hasActiveAbility?(:AROMAVEIL)
if showMessage
@@ -265,7 +265,7 @@ class Battle::Move
#=============================================================================
# Messages upon being hit
#=============================================================================
def pbEffectivenessMessage(user,target,numTargets=1)
def pbEffectivenessMessage(user,target,numTargets = 1)
return if target.damageState.disguise || target.damageState.iceFace
if Effectiveness.super_effective?(target.damageState.typeMod)
if numTargets>1
@@ -282,7 +282,7 @@ class Battle::Move
end
end
def pbHitEffectivenessMessages(user,target,numTargets=1)
def pbHitEffectivenessMessages(user,target,numTargets = 1)
return if target.damageState.disguise || target.damageState.iceFace
if target.damageState.substitute
@battle.pbDisplay(_INTL("The substitute took damage for {1}!",target.pbThis(true)))

View File

@@ -240,7 +240,7 @@ class Battle::Move
return target.defense, target.stages[:DEFENSE]+6
end
def pbCalcDamage(user,target,numTargets=1)
def pbCalcDamage(user,target,numTargets = 1)
return if statusMove?
if target.damageState.disguise || target.damageState.iceFace
target.damageState.calcDamage = 1
@@ -476,7 +476,7 @@ class Battle::Move
#=============================================================================
# Additional effect chance
#=============================================================================
def pbAdditionalEffectChance(user,target,effectChance=0)
def pbAdditionalEffectChance(user,target,effectChance = 0)
return 0 if target.hasActiveAbility?(:SHIELDDUST) && !@battle.moldBreaker
ret = (effectChance>0) ? effectChance : @addlEffect
if Settings::MECHANICS_GENERATION >= 6 || @function != "EffectDependsOnEnvironment"

View File

@@ -41,8 +41,8 @@ class Battle::Move::Confusion < Battle::Move
@snatched = false
end
def physicalMove?(thisType=nil); return true; end
def specialMove?(thisType=nil); return false; end
def physicalMove?(thisType = nil); return true; end
def specialMove?(thisType = nil); return false; end
def pbCritialOverride(user,target); return -1; end
end
@@ -70,8 +70,8 @@ class Battle::Move::Struggle < Battle::Move
@snatched = false
end
def physicalMove?(thisType=nil); return true; end
def specialMove?(thisType=nil); return false; end
def physicalMove?(thisType = nil); return true; end
def specialMove?(thisType = nil); return false; end
def pbEffectAfterAllHits(user,target)
return if target.damageState.unaffected
@@ -279,7 +279,7 @@ end
class Battle::Move::FixedDamageMove < Battle::Move
def pbFixedDamage(user,target); return 1; end
def pbCalcDamage(user,target,numTargets=1)
def pbCalcDamage(user,target,numTargets = 1)
target.damageState.critical = false
target.damageState.calcDamage = pbFixedDamage(user,target)
target.damageState.calcDamage = 1 if target.damageState.calcDamage<1
@@ -367,7 +367,7 @@ class Battle::Move::TwoTurnMove < Battle::Move
end
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
hitNum = 1 if @chargingTurn && !@damagingTurn # Charging anim
super
end
@@ -601,7 +601,7 @@ class Battle::Move::PledgeMove < Battle::Move
@battle.pbCommonAnimation(animName) if animName
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
return if @pledgeSetup # No animation for setting up
id = @overrideAnim if @overrideAnim
return super

View File

@@ -640,7 +640,7 @@ class Battle::Move::AttackTwoTurnsLater < Battle::Move
end
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
hitNum = 1 if !@battle.futureSight # Charging anim
super
end

View File

@@ -1721,7 +1721,7 @@ end
class Battle::Move::UserStealTargetPositiveStatStages < Battle::Move
def ignoresSubstitute?(user); return true; end
def pbCalcDamage(user,target,numTargets=1)
def pbCalcDamage(user,target,numTargets = 1)
if target.hasRaisedStatStages?
pbShowAnimation(@id,user,target,1) # Stat stage-draining animation
@battle.pbDisplay(_INTL("{1} stole the target's boosted stats!",user.pbThis))
@@ -1931,7 +1931,7 @@ class Battle::Move::StartSwapAllBattlersBaseDefensiveStats < Battle::Move
end
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
return if @battle.field.effects[PBEffects::WonderRoom]>0 # No animation
super
end

View File

@@ -174,7 +174,7 @@ end
# Minimized. (Body Slam (Gen 6+))
#===============================================================================
class Battle::Move::ParalyzeTargetTrampleMinimize < Battle::Move::ParalyzeTarget
def tramplesMinimize?(param=1)
def tramplesMinimize?(param = 1)
return true if param==1 && Settings::MECHANICS_GENERATION >= 6 # Perfect accuracy
return true if param==2 # Double damage
return super
@@ -442,7 +442,7 @@ class Battle::Move::CureUserPartyStatus < Battle::Move
return target.status == :NONE
end
def pbAromatherapyHeal(pkmn,battler=nil)
def pbAromatherapyHeal(pkmn,battler = nil)
oldStatus = (battler) ? battler.status : pkmn.status
curedName = (battler) ? battler.pbThis : pkmn.name
if battler
@@ -488,7 +488,7 @@ class Battle::Move::CureUserPartyStatus < Battle::Move
end
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
super
if @id == :AROMATHERAPY
@battle.pbDisplay(_INTL("A soothing aroma wafted through the area!"))
@@ -552,7 +552,7 @@ end
# the target is Minimized. (Dragon Rush (Gen 6+), Steamroller, Stomp)
#===============================================================================
class Battle::Move::FlinchTargetTrampleMinimize < Battle::Move::FlinchTarget
def tramplesMinimize?(param=1)
def tramplesMinimize?(param = 1)
return true if param==1 && Settings::MECHANICS_GENERATION >= 6 # Perfect accuracy
return true if param==2 # Double damage
return super
@@ -1388,7 +1388,7 @@ class Battle::Move::TransformUserIntoTarget < Battle::Move
user.pbTransform(target)
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
super
@battle.scene.pbChangePokemon(user,targets[0].pokemon)
end

View File

@@ -98,7 +98,7 @@ class Battle::Move::OHKO < Battle::Move::FixedDamageMove
return target.totalhp
end
def pbHitEffectivenessMessages(user,target,numTargets=1)
def pbHitEffectivenessMessages(user,target,numTargets = 1)
super
if target.fainted?
@battle.pbDisplay(_INTL("It's a one-hit KO!"))
@@ -310,7 +310,7 @@ end
# Does double damage and has perfect accuracy if the target is Minimized.
#===============================================================================
class Battle::Move::PowerHigherWithUserHeavierThanTarget < Battle::Move
def tramplesMinimize?(param=1)
def tramplesMinimize?(param = 1)
return true if Settings::MECHANICS_GENERATION >= 7 # Perfect accuracy and double damage
return super
end
@@ -850,7 +850,7 @@ class Battle::Move::RemoveScreens < Battle::Move
end
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
if user.pbOpposingSide.effects[PBEffects::LightScreen]>0 ||
user.pbOpposingSide.effects[PBEffects::Reflect]>0 ||
user.pbOpposingSide.effects[PBEffects::AuroraVeil]>0
@@ -1121,7 +1121,7 @@ end
# Minimized. (Flying Press)
#===============================================================================
class Battle::Move::EffectivenessIncludesFlyingType < Battle::Move
def tramplesMinimize?(param=1)
def tramplesMinimize?(param = 1)
return true if param==1 && Settings::MECHANICS_GENERATION >= 6 # Perfect accuracy
return true if param==2 # Double damage
return super
@@ -1195,8 +1195,8 @@ class Battle::Move::CategoryDependsOnHigherDamageIgnoreTargetAbility < Battle::M
@calcCategory = 1
end
def physicalMove?(thisType=nil); return (@calcCategory==0); end
def specialMove?(thisType=nil); return (@calcCategory==1); end
def physicalMove?(thisType = nil); return (@calcCategory==0); end
def specialMove?(thisType = nil); return (@calcCategory==1); end
def pbOnStartUse(user,targets)
# Calculate user's effective attacking value
@@ -1568,7 +1568,7 @@ class Battle::Move::TypeDependsOnUserDrive < Battle::Move
return ret
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
t = pbBaseType(user)
hitNum = 0
hitNum = 1 if t == :ELECTRIC
@@ -1623,7 +1623,7 @@ class Battle::Move::TypeAndPowerDependOnWeather < Battle::Move
return ret
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
t = pbBaseType(user)
hitNum = 1 if t == :FIRE # Type-specific anims
hitNum = 2 if t == :WATER

View File

@@ -19,9 +19,9 @@ end
# accuracy if the target is Minimized. (Double Iron Bash)
#===============================================================================
class Battle::Move::HitTwoTimesFlinchTarget < Battle::Move::FlinchTarget
def multiHitMove?; return true; end
def pbNumHits(user,targets); return 2; end
def tramplesMinimize?(param=1); return Settings::MECHANICS_GENERATION <= 7; end
def multiHitMove?; return true; end
def pbNumHits(user, targets); return 2; end
def tramplesMinimize?(param = 1); return Settings::MECHANICS_GENERATION <= 7; end
end
#===============================================================================
@@ -615,7 +615,7 @@ class Battle::Move::MultiTurnAttackBideThenReturnDoubleDamage < Battle::Move::Fi
user.effects[PBEffects::Bide] -= 1
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
hitNum = 1 if !@damagingTurn # Charging anim
super
end

View File

@@ -649,7 +649,7 @@ class Battle::Move::StartPerishCountsForAllBattlers < Battle::Move
target.effects[PBEffects::PerishSongUser] = user.index
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
super
@battle.pbDisplay(_INTL("All Pokémon that hear the song will faint in three turns!"))
end

View File

@@ -279,7 +279,7 @@ class Battle::Move::StartNegateHeldItems < Battle::Move
end
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
return if @battle.field.effects[PBEffects::MagicRoom]>0 # No animation
super
end

View File

@@ -80,7 +80,7 @@ class Battle::Move::RandomlyDamageOrHealTarget < Battle::Move
@battle.pbDisplay(_INTL("{1}'s HP was restored.",target.pbThis))
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
hitNum = 1 if @presentDmg==0 # Healing anim
super
end
@@ -125,7 +125,7 @@ class Battle::Move::HealAllyOrDamageFoe < Battle::Move
@battle.pbDisplay(_INTL("{1}'s HP was restored.",target.pbThis))
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
hitNum = 1 if @healing # Healing anim
super
end
@@ -193,7 +193,7 @@ class Battle::Move::CurseTargetOrLowerUserSpd1RaiseUserAtkDef1 < Battle::Move
user.pbItemHPHealCheck
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
hitNum = 1 if !user.pbHasType?(:GHOST) # Non-Ghost anim
super
end
@@ -288,7 +288,7 @@ class Battle::Move::EffectDependsOnEnvironment < Battle::Move
end
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
id = :BODYSLAM # Environment-specific anim
case @secretPower
when 1 then id = :THUNDERSHOCK if GameData::Move.exists?(:THUNDERSHOCK)
@@ -371,7 +371,7 @@ class Battle::Move::DoublePowerAfterFusionFlare < Battle::Move
@battle.field.effects[PBEffects::FusionBolt] = true
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
hitNum = 1 if (targets.length>0 && targets[0].damageState.critical) ||
@doublePower # Charged anim
super
@@ -396,7 +396,7 @@ class Battle::Move::DoublePowerAfterFusionBolt < Battle::Move
@battle.field.effects[PBEffects::FusionFlare] = true
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
hitNum = 1 if (targets.length>0 && targets[0].damageState.critical) ||
@doublePower # Charged anim
super
@@ -777,7 +777,7 @@ class Battle::Move::UseLastMoveUsedByTarget < Battle::Move
user.pbUseMoveSimple(target.lastRegularMoveUsed,target.index)
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
# No animation
end
end

View File

@@ -637,7 +637,7 @@ class Battle::Move::StartSlowerBattlersActFirst < Battle::Move
end
end
def pbShowAnimation(id,user,targets,hitNum=0,showAnimation=true)
def pbShowAnimation(id,user,targets,hitNum = 0,showAnimation = true)
return if @battle.field.effects[PBEffects::TrickRoom]>0 # No animation
super
end

View File

@@ -76,7 +76,7 @@ class Battle::Scene
#=============================================================================
# Updating and refreshing
#=============================================================================
def pbUpdate(cw=nil)
def pbUpdate(cw = nil)
pbGraphicsUpdate
pbInputUpdate
pbFrameUpdate(cw)
@@ -111,7 +111,7 @@ class Battle::Scene
end
end
def pbFrameUpdate(cw=nil)
def pbFrameUpdate(cw = nil)
cw.update if cw
@battle.battlers.each_with_index do |b,i|
next if !b
@@ -185,7 +185,7 @@ class Battle::Scene
# NOTE: A regular message is displayed for 1 second after it fully appears (or
# less if Back/Use is pressed). Disappears automatically after that time.
def pbDisplayMessage(msg,brief=false)
def pbDisplayMessage(msg,brief = false)
pbWaitMessage
pbShowWindow(MESSAGE_BOX)
cw = @sprites["messageWindow"]
@@ -379,7 +379,7 @@ class Battle::Scene
#=============================================================================
#
#=============================================================================
def pbSelectBattler(idxBattler,selectMode=1)
def pbSelectBattler(idxBattler,selectMode = 1)
numWindows = @battle.sideSizes.max*2
for i in 0...numWindows
sel = (idxBattler.is_a?(Array)) ? !idxBattler[i].nil? : i==idxBattler

View File

@@ -150,7 +150,7 @@ class Battle::Scene
cmdBarBG.z = 180
end
def pbCreateTrainerBackSprite(idxTrainer,trainerType,numTrainers=1)
def pbCreateTrainerBackSprite(idxTrainer,trainerType,numTrainers = 1)
if idxTrainer==0 # Player's sprite
trainerFile = GameData::TrainerType.player_back_sprite_filename(trainerType)
else # Partner trainer's sprite
@@ -169,7 +169,7 @@ class Battle::Scene
trainer.oy = trainer.bitmap.height
end
def pbCreateTrainerFrontSprite(idxTrainer,trainerType,numTrainers=1)
def pbCreateTrainerFrontSprite(idxTrainer,trainerType,numTrainers = 1)
trainerFile = GameData::TrainerType.front_sprite_filename(trainerType)
spriteX, spriteY = Battle::Scene.pbTrainerPosition(1,idxTrainer,numTrainers)
trainer = pbAddSprite("trainer_#{idxTrainer+1}",spriteX,spriteY,trainerFile,@viewport)

View File

@@ -23,7 +23,7 @@ class Battle::Scene
# 2 = regular battle with "Call" (for Shadow Pokémon battles)
# 3 = Safari Zone
# 4 = Bug Catching Contest
def pbCommandMenuEx(idxBattler,texts,mode=0)
def pbCommandMenuEx(idxBattler,texts,mode = 0)
pbShowWindow(COMMAND_BOX)
cw = @sprites["commandWindow"]
cw.setTexts(texts)
@@ -65,7 +65,7 @@ class Battle::Scene
#=============================================================================
# The player chooses a move for a Pokémon to use
#=============================================================================
def pbFightMenu(idxBattler,megaEvoPossible=false)
def pbFightMenu(idxBattler,megaEvoPossible = false)
battler = @battle.battlers[idxBattler]
cw = @sprites["fightWindow"]
cw.battler = battler
@@ -140,7 +140,7 @@ class Battle::Scene
# Opens the party screen to choose a Pokémon to switch in (or just view its
# summary screens)
#=============================================================================
def pbPartyScreen(idxBattler,canCancel=false)
def pbPartyScreen(idxBattler,canCancel = false)
# Fade out and hide all sprites
visibleSprites = pbFadeOutAndHide(@sprites)
# Get player's party
@@ -373,7 +373,7 @@ class Battle::Scene
return idxBattler # Target the user initially
end
def pbChooseTarget(idxBattler,target_data,visibleSprites=nil)
def pbChooseTarget(idxBattler,target_data,visibleSprites = nil)
pbShowWindow(TARGET_BOX)
cw = @sprites["targetWindow"]
# Create an array of battler names (only valid targets are named)

View File

@@ -57,7 +57,7 @@ class Battle::Scene
#=============================================================================
# Animates a party lineup appearing for the given side
#=============================================================================
def pbShowPartyLineup(side,fullAnim=false)
def pbShowPartyLineup(side,fullAnim = false)
@animations.push(Animation::LineupAppear.new(@sprites,@viewport,
side,@battle.pbParty(side),@battle.pbPartyStarts(side),fullAnim))
if !fullAnim
@@ -88,7 +88,7 @@ class Battle::Scene
# animation for it if relevant.
# sendOuts is an array; each element is itself an array: [idxBattler,pkmn]
#=============================================================================
def pbSendOutBattlers(sendOuts,startBattle=false)
def pbSendOutBattlers(sendOuts,startBattle = false)
return if sendOuts.length==0
# If party balls are still appearing, wait for them to finish showing up, as
# the FadeAnimation will make them disappear.
@@ -216,7 +216,7 @@ class Battle::Scene
#=============================================================================
# Shows a HP-changing common animation and animates a data box's HP bar.
# Called by def pbReduceHP, def pbRecoverHP.
def pbHPChanged(battler,oldHP,showAnim=false)
def pbHPChanged(battler,oldHP,showAnim = false)
@briefMessage = false
if battler.hp>oldHP
pbCommonAnimation("HealthUp",battler) if showAnim && @battle.showAnims
@@ -229,7 +229,7 @@ class Battle::Scene
end
end
def pbDamageAnimation(battler,effectiveness=0)
def pbDamageAnimation(battler,effectiveness = 0)
@briefMessage = false
# Damage animation
damageAnim = Animation::BattlerDamage.new(@sprites,@viewport,battler.index,effectiveness)
@@ -324,7 +324,7 @@ class Battle::Scene
#=============================================================================
# Animates throwing a Poké Ball at a Pokémon in an attempt to catch it
#=============================================================================
def pbThrow(ball,shakes,critical,targetBattler,showPlayer=false)
def pbThrow(ball,shakes,critical,targetBattler,showPlayer = false)
@briefMessage = false
captureAnim = Animation::PokeballThrowCapture.new(@sprites,@viewport,
ball,shakes,critical,@battle.battlers[targetBattler],showPlayer)
@@ -403,7 +403,7 @@ class Battle::Scene
#=============================================================================
# Returns the animation ID to use for a given move/user. Returns nil if that
# move has no animations defined for it.
def pbFindMoveAnimDetails(move2anim,moveID,idxUser,hitNum=0)
def pbFindMoveAnimDetails(move2anim,moveID,idxUser,hitNum = 0)
real_move_id = GameData::Move.get(moveID).id
noFlip = false
if (idxUser&1)==0 # On player's side
@@ -483,7 +483,7 @@ class Battle::Scene
# Plays a move/common animation
#=============================================================================
# Plays a move animation.
def pbAnimation(moveID,user,targets,hitNum=0)
def pbAnimation(moveID,user,targets,hitNum = 0)
animID = pbFindMoveAnimation(moveID,user.index,hitNum)
return if !animID
anim = animID[0]
@@ -500,7 +500,7 @@ class Battle::Scene
end
# Plays a common animation.
def pbCommonAnimation(animName,user=nil,target=nil)
def pbCommonAnimation(animName,user = nil,target = nil)
return if nil_or_empty?(animName)
target = target[0] if target && target.is_a?(Array)
animations = pbLoadBattleAnimations
@@ -512,7 +512,7 @@ class Battle::Scene
end
end
def pbAnimationCore(animation,user,target,oppMove=false)
def pbAnimationCore(animation,user,target,oppMove = false)
return if !animation
@briefMessage = false
userSprite = (user) ? @sprites["pokemon_#{user.index}"] : nil

View File

@@ -15,7 +15,7 @@ class Battle::Scene::MenuBase
TEXT_BASE_COLOR = Battle::Scene::MESSAGE_BASE_COLOR
TEXT_SHADOW_COLOR = Battle::Scene::MESSAGE_SHADOW_COLOR
def initialize(viewport=nil)
def initialize(viewport = nil)
@x = 0
@y = 0
@z = 0

View File

@@ -19,7 +19,7 @@ class Battle::Scene::PokemonDataBox < SpriteWrapper
FEMALE_BASE_COLOR = Color.new(248,88,40)
FEMALE_SHADOW_COLOR = NAME_SHADOW_COLOR
def initialize(battler,sideSize,viewport=nil)
def initialize(battler,sideSize,viewport = nil)
super(viewport)
@battler = battler
@sprites = {}
@@ -193,7 +193,7 @@ class Battle::Scene::PokemonDataBox < SpriteWrapper
pbSEPlay("Pkmn exp gain") if @showExp
end
def pbDrawNumber(number,btmp,startX,startY,align=0)
def pbDrawNumber(number,btmp,startX,startY,align = 0)
# -1 means draw the / character
n = (number == -1) ? [10] : number.to_i.digits.reverse
charWidth = @numbersBitmap.width/11
@@ -363,7 +363,7 @@ class Battle::Scene::PokemonDataBox < SpriteWrapper
end
end
def update(frameCounter=0)
def update(frameCounter = 0)
super()
# Animate HP bar
updateHPAnimation
@@ -386,7 +386,7 @@ class Battle::Scene::AbilitySplashBar < SpriteWrapper
TEXT_BASE_COLOR = Color.new(0,0,0)
TEXT_SHADOW_COLOR = Color.new(248,248,248)
def initialize(side,viewport=nil)
def initialize(side,viewport = nil)
super(viewport)
@side = side
@battler = nil
@@ -550,7 +550,7 @@ class Battle::Scene::BattlerSprite < RPG::Sprite
@pkmn.species_data.apply_metrics_to_sprite(self, @index)
end
def setPokemonBitmap(pkmn,back=false)
def setPokemonBitmap(pkmn,back = false)
@pkmn = pkmn
@_iconBitmap.dispose if @_iconBitmap
@_iconBitmap = GameData::Species.sprite_bitmap_from_pokemon(@pkmn, back)
@@ -562,14 +562,14 @@ class Battle::Scene::BattlerSprite < RPG::Sprite
# this is just playing the Pokémon's cry, but you can expand on it. The
# recommendation is to create a PictureEx animation and push it into
# the @battleAnimations array.
def pbPlayIntroAnimation(pictureEx=nil)
def pbPlayIntroAnimation(pictureEx = nil)
@pkmn.play_cry if @pkmn
end
QUARTER_ANIM_PERIOD = Graphics.frame_rate*3/20
SIXTH_ANIM_PERIOD = Graphics.frame_rate*2/20
def update(frameCounter=0)
def update(frameCounter = 0)
return if !@_iconBitmap
@updating = true
# Update bitmap
@@ -653,7 +653,7 @@ class Battle::Scene::BattlerShadowSprite < RPG::Sprite
pbSetPosition
end
def update(frameCounter=0)
def update(frameCounter = 0)
return if !@_iconBitmap
# Update bitmap
@_iconBitmap.update

View File

@@ -17,7 +17,7 @@ class Battle::Scene::Animation
def empty?; return @pictureEx.length==0; end
def animDone?; return @animDone; end
def addSprite(s,origin=PictureOrigin::TopLeft)
def addSprite(s,origin = PictureOrigin::TopLeft)
num = @pictureEx.length
picture = PictureEx.new(s.z)
picture.x = s.x
@@ -31,7 +31,7 @@ class Battle::Scene::Animation
return picture
end
def addNewSprite(x,y,name,origin=PictureOrigin::TopLeft)
def addNewSprite(x,y,name,origin = PictureOrigin::TopLeft)
num = @pictureEx.length
picture = PictureEx.new(num)
picture.setXY(0,x,y)
@@ -96,7 +96,7 @@ module Battle::Scene::Animation::BallAnimationMixin
return ball
end
def ballTracksHand(ball,traSprite,safariThrow=false)
def ballTracksHand(ball,traSprite,safariThrow = false)
# Back sprite isn't animated, no hand-tracking needed
if traSprite.bitmap.width<traSprite.bitmap.height*2
ball.setVisible(7,true)

View File

@@ -47,7 +47,7 @@ class Battle::Scene::Animation::Intro < Battle::Scene::Animation
blackBar.moveOpacity(appearTime*3/4,appearTime/4,0)
end
def makeSlideSprite(spriteName,deltaMult,appearTime,origin=nil)
def makeSlideSprite(spriteName,deltaMult,appearTime,origin = nil)
# If deltaMult is positive, the sprite starts off to the right and moves
# left (for sprites on the player's side and the background).
return if !@sprites[spriteName]
@@ -304,7 +304,7 @@ end
# Doesn't show the ball thrown or the Pokémon.
#===============================================================================
class Battle::Scene::Animation::PlayerFade < Battle::Scene::Animation
def initialize(sprites,viewport,fullAnim=false)
def initialize(sprites,viewport,fullAnim = false)
@fullAnim = fullAnim # True at start of battle, false when switching
super(sprites,viewport)
end
@@ -357,7 +357,7 @@ end
# Doesn't show the ball thrown or the Pokémon.
#===============================================================================
class Battle::Scene::Animation::TrainerFade < Battle::Scene::Animation
def initialize(sprites,viewport,fullAnim=false)
def initialize(sprites,viewport,fullAnim = false)
@fullAnim = fullAnim # True at start of battle, false when switching
super(sprites,viewport)
end
@@ -404,7 +404,7 @@ end
class Battle::Scene::Animation::PokeballPlayerSendOut < Battle::Scene::Animation
include Battle::Scene::Animation::BallAnimationMixin
def initialize(sprites,viewport,idxTrainer,battler,startBattle,idxOrder=0)
def initialize(sprites,viewport,idxTrainer,battler,startBattle,idxOrder = 0)
@idxTrainer = idxTrainer
@battler = battler
@showingTrainer = startBattle

View File

@@ -23,9 +23,9 @@ class Battle::DebugSceneNoLogging
def pbBeginCommandPhase; end
def pbBeginAttackPhase; end
def pbShowOpponent(idxTrainer); end
def pbDamageAnimation(battler,effectiveness=0); end
def pbCommonAnimation(animName,user=nil,target=nil); end
def pbAnimation(moveID,user,targets,hitNum=0); end
def pbDamageAnimation(battler,effectiveness = 0); end
def pbCommonAnimation(animName,user = nil,target = nil); end
def pbAnimation(moveID,user,targets,hitNum = 0); end
def pbEndBattle(result); end
def pbWildBattleSuccess; end
def pbTrainerBattleSuccess; end
@@ -34,17 +34,17 @@ class Battle::DebugSceneNoLogging
def pbRefresh; end
def pbDisplayMessage(msg,brief=false); end
def pbDisplayMessage(msg,brief = false); end
def pbDisplayPausedMessage(msg); end
def pbDisplayConfirmMessage(msg); return true; end
def pbShowCommands(msg,commands,defaultValue); return 0; end
def pbSendOutBattlers(sendOuts,startBattle=false); end
def pbSendOutBattlers(sendOuts,startBattle = false); end
def pbRecall(idxBattler); end
def pbItemMenu(idxBattler,firstAction); return -1; end
def pbResetMoveIndex(idxBattler); end
def pbHPChanged(battler,oldHP,showAnim=false); end
def pbHPChanged(battler,oldHP,showAnim = false); end
def pbFaintBattler(battler); end
def pbEXPBar(battler,startExp,endExp,tempExp1,tempExp2); end
def pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense,
@@ -57,20 +57,20 @@ class Battle::DebugSceneNoLogging
return 0 # Fight
end
def pbFightMenu(idxBattler,megaEvoPossible=false)
def pbFightMenu(idxBattler,megaEvoPossible = false)
battler = @battle.battlers[idxBattler]
50.times do
break if yield rand(battler.move.length)
end
end
def pbChooseTarget(idxBattler,target_data,visibleSprites=nil)
def pbChooseTarget(idxBattler,target_data,visibleSprites = nil)
targets = @battle.allOtherSideBattlers(idxBattler).map { |b| b.index }
return -1 if targets.length==0
return targets.sample
end
def pbPartyScreen(idxBattler,canCancel=false)
def pbPartyScreen(idxBattler,canCancel = false)
replacements = []
@battle.eachInTeamFromBattlerIndex(idxBattler) do |_b,idxParty|
replacements.push(idxParty) if !@battle.pbFindBattler(idxParty,idxBattler)

View File

@@ -152,7 +152,7 @@ class Battle::AI
#=============================================================================
# Get a score for the given move being used against the given target
#=============================================================================
def pbGetMoveScore(move,user,target,skill=100)
def pbGetMoveScore(move,user,target,skill = 100)
skill = PBTrainerAI.minimumSkill if skill<PBTrainerAI.minimumSkill
score = 100
score = pbGetMoveScoreFunctionCode(score,move,user,target,skill)

View File

@@ -2,7 +2,7 @@ class Battle::AI
#=============================================================================
# Get a score for the given move based on its effect
#=============================================================================
def pbGetMoveScoreFunctionCode(score,move,user,target,skill=100)
def pbGetMoveScoreFunctionCode(score,move,user,target,skill = 100)
case move.function
#---------------------------------------------------------------------------
when "None" # No extra effect

View File

@@ -44,7 +44,7 @@ class Battle::Peer
end
# For switching out, including due to fainting, and for the end of battle
def pbOnLeavingBattle(battle,pkmn,usedInBattle,endBattle=false)
def pbOnLeavingBattle(battle,pkmn,usedInBattle,endBattle = false)
return if !pkmn
f = MultipleForms.call("getFormOnLeavingBattle",pkmn,battle,usedInBattle,endBattle)
pkmn.form = f if f && pkmn.form!=f
@@ -58,7 +58,7 @@ end
#===============================================================================
class Battle::NullPeer
def pbOnEnteringBattle(battle, battler, pkmn, wild = false); end
def pbOnLeavingBattle(battle,pkmn,usedInBattle,endBattle=false); end
def pbOnLeavingBattle(battle,pkmn,usedInBattle,endBattle = false); end
def pbStorePokemon(player,pkmn)
player.party[player.party.length] = pkmn if !player.party_full?

View File

@@ -47,7 +47,7 @@ module Battle::CatchAndStoreMixin
#=============================================================================
# Throw a Poké Ball
#=============================================================================
def pbThrowPokeBall(idxBattler,ball,catch_rate=nil,showPlayer=false)
def pbThrowPokeBall(idxBattler,ball,catch_rate = nil,showPlayer = false)
# Determine which Pokémon you're throwing the Poké Ball at
battler = nil
if opposes?(idxBattler)

View File

@@ -22,7 +22,7 @@ class Battle
return __clauses__pbDecisionOnDraw
end
def pbJudgeCheckpoint(user,move=nil)
def pbJudgeCheckpoint(user,move = nil)
if pbAllFainted?(0) && pbAllFainted?(1)
if @rules["drawclause"] # NOTE: Also includes Life Orb (not implemented)
if !(move && move.function=="HealUserByHalfOfDamageDone")
@@ -62,7 +62,7 @@ class Battle::Battler
@__clauses__aliased = true
end
def pbCanSleep?(user,showMessages,move=nil,ignoreStatus=false)
def pbCanSleep?(user,showMessages,move = nil,ignoreStatus = false)
selfsleep = (user && user.index==@index)
if ((@battle.rules["modifiedsleepclause"]) || (!selfsleep && @battle.rules["sleepclause"])) &&
pbHasStatusPokemon?(:SLEEP)

View File

@@ -74,7 +74,7 @@ def isReversed(src0,src1,dst0,dst1)
return (dst0<dst1)
end
def pbCreateCel(x,y,pattern,focus=4)
def pbCreateCel(x,y,pattern,focus = 4)
frame = []
frame[AnimFrame::X] = x
frame[AnimFrame::Y] = y
@@ -256,7 +256,7 @@ class PBAnimTiming
attr_accessor :flashColor
attr_accessor :flashDuration
def initialize(type=0)
def initialize(type = 0)
@frame = 0
@timingType = type
@name = ""
@@ -358,7 +358,7 @@ class PBAnimations < Array
attr_reader :array
attr_accessor :selected
def initialize(size=1)
def initialize(size = 1)
@array = []
@selected = 0
size = 1 if size<1 # Always create at least one animation
@@ -433,7 +433,7 @@ class PBAnimation < Array
return @speed || 20
end
def initialize(size=1)
def initialize(size = 1)
@id = -1
@name = ""
@graphic = ""
@@ -494,7 +494,7 @@ class PBAnimation < Array
return @array[pos]
end
def playTiming(frame,bgGraphic,bgColor,foGraphic,foColor,oldbg=[],oldfo=[],user=nil)
def playTiming(frame,bgGraphic,bgColor,foGraphic,foColor,oldbg = [],oldfo = [],user = nil)
for i in @timing
next if i.frame!=frame
case i.timingType
@@ -617,7 +617,7 @@ end
#===============================================================================
#
#===============================================================================
def pbSpriteSetAnimFrame(sprite,frame,user=nil,target=nil,inEditor=false)
def pbSpriteSetAnimFrame(sprite,frame,user = nil,target = nil,inEditor = false)
return if !sprite
if !frame
sprite.visible = false
@@ -702,7 +702,7 @@ class PBAnimationPlayerX
MAX_SPRITES = 60
def initialize(animation,user,target,scene=nil,oppMove=false,inEditor=false)
def initialize(animation,user,target,scene = nil,oppMove = false,inEditor = false)
@animation = animation
@user = (oppMove) ? target : user # Just used for playing user's cry
@usersprite = (user) ? scene.sprites["pokemon_#{user.index}"] : nil

View File

@@ -42,7 +42,7 @@ class Battle::FakeBattler
return $player.owned?(pokemon.species)
end
def pbThis(lowerCase=false)
def pbThis(lowerCase = false)
return (lowerCase) ? _INTL("the wild {1}",name) : _INTL("The wild {1}",name)
end
@@ -62,7 +62,7 @@ end
class Battle::Scene::SafariDataBox < SpriteWrapper
attr_accessor :selected
def initialize(battle,viewport=nil)
def initialize(battle,viewport = nil)
super(viewport)
@selected = 0
@battle = battle
@@ -88,7 +88,7 @@ class Battle::Scene::SafariDataBox < SpriteWrapper
pbDrawTextPositions(self.bitmap,textpos)
end
def update(frameCounter=0)
def update(frameCounter = 0)
super()
end
end
@@ -381,12 +381,12 @@ class SafariBattle
return (opposes?(idxBattler)) ? @party2 : nil
end
def pbAllFainted?(idxBattler=0); return false; end
def pbAllFainted?(idxBattler = 0); return false; end
#=============================================================================
# Battler-related
#=============================================================================
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)

View File

@@ -93,7 +93,7 @@ class BattlePalaceBattle < Battle
return true
end
def pbRegisterMove(idxBattler,idxMove,_showMessages=true)
def pbRegisterMove(idxBattler,idxMove,_showMessages = true)
this_battler = @battlers[idxBattler]
if idxMove==-2
@choices[idxBattler][0] = :UseMove # "Use move"

View File

@@ -9,7 +9,7 @@ class Battle::SuccessState
def initialize; clear; end
def clear(full=true)
def clear(full = true)
@typeMod = Effectiveness::NORMAL_EFFECTIVE
@useState = 0
@protected = false
@@ -51,14 +51,14 @@ class BattleArenaBattle < Battle
@battleAI.battleArena = true
end
def pbCanSwitchLax?(idxBattler,_idxParty,partyScene=nil)
def pbCanSwitchLax?(idxBattler,_idxParty,partyScene = nil)
if partyScene
partyScene.pbDisplay(_INTL("{1} can't be switched out!",@battlers[idxBattler].pbThis))
end
return false
end
def pbEORSwitch(favorDraws=false)
def pbEORSwitch(favorDraws = false)
return if favorDraws && @decision==5
return if !favorDraws && @decision>0
pbJudge

View File

@@ -73,13 +73,13 @@ module RecordedBattleModule
return Marshal.dump([pbGetBattleType,@properties,@rounds,@randomnumbers,@switches])
end
def pbSwitchInBetween(idxBattler,checkLaxOnly=false,canCancel=false)
def pbSwitchInBetween(idxBattler,checkLaxOnly = false,canCancel = false)
ret = super
@switches.push(ret)
return ret
end
def pbRegisterMove(idxBattler,idxMove,showMessages=true)
def pbRegisterMove(idxBattler,idxMove,showMessages = true)
if super
@rounds[@roundindex][idxBattler] = [Commands::Fight,idxMove]
return true
@@ -92,13 +92,13 @@ module RecordedBattleModule
@rounds[@roundindex][idxBattler][2] = idxTarget
end
def pbRun(idxBattler,duringBattle=false)
def pbRun(idxBattler,duringBattle = false)
ret = super
@rounds[@roundindex][idxBattler] = [Commands::Run,@decision]
return ret
end
def pbAutoChooseMove(idxBattler,showMessages=true)
def pbAutoChooseMove(idxBattler,showMessages = true)
ret = super
@rounds[@roundindex][idxBattler] = [Commands::Fight,-1]
return ret
@@ -112,7 +112,7 @@ module RecordedBattleModule
return false
end
def pbRegisterItem(idxBattler,item,idxTarget=nil,idxMove=nil)
def pbRegisterItem(idxBattler,item,idxTarget = nil,idxMove = nil)
if super
@rounds[@roundindex][idxBattler] = [Commands::Bag,item,idxTarget,idxMove]
return true
@@ -183,7 +183,7 @@ module RecordedBattlePlaybackModule
super
end
def pbSwitchInBetween(_idxBattler,_checkLaxOnly=false,_canCancel=false)
def pbSwitchInBetween(_idxBattler,_checkLaxOnly = false,_canCancel = false)
ret = @switches[@switchindex]
@switchindex += 1
return ret