mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 14:44:58 +00:00
The Great Enspacening begins!
This commit is contained in:
@@ -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?
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) &&
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user