mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
Added class GameData::Status
This commit is contained in:
@@ -106,11 +106,11 @@ class PokeBattle_Battler
|
||||
attr_reader :status
|
||||
|
||||
def status=(value)
|
||||
@effects[PBEffects::Truant] = false if @status==PBStatuses::SLEEP && value!=PBStatuses::SLEEP
|
||||
@effects[PBEffects::Toxic] = 0 if value!=PBStatuses::POISON
|
||||
@effects[PBEffects::Truant] = false if @status == :SLEEP && value != :SLEEP
|
||||
@effects[PBEffects::Toxic] = 0 if value != :POISON
|
||||
@status = value
|
||||
@pokemon.status = value if @pokemon
|
||||
self.statusCount = 0 if value!=PBStatuses::POISON && value!=PBStatuses::SLEEP
|
||||
self.statusCount = 0 if value != :POISON && value != :SLEEP
|
||||
@battle.scene.pbRefreshOne(@index)
|
||||
end
|
||||
|
||||
@@ -254,7 +254,7 @@ class PokeBattle_Battler
|
||||
speedMult *= 2 if pbOwnSide.effects[PBEffects::Tailwind]>0
|
||||
speedMult /= 2 if pbOwnSide.effects[PBEffects::Swamp]>0
|
||||
# Paralysis
|
||||
if status==PBStatuses::PARALYSIS && !hasActiveAbility?(:QUICKFEET)
|
||||
if status == :PARALYSIS && !hasActiveAbility?(:QUICKFEET)
|
||||
speedMult /= (Settings::MECHANICS_GENERATION >= 7) ? 2 : 4
|
||||
end
|
||||
# Badge multiplier
|
||||
|
||||
@@ -25,7 +25,7 @@ class PokeBattle_Battler
|
||||
@item_id = nil
|
||||
@gender = 0
|
||||
@attack = @defense = @spatk = @spdef = @speed = 0
|
||||
@status = PBStatuses::NONE
|
||||
@status = :NONE
|
||||
@statusCount = 0
|
||||
@pokemon = nil
|
||||
@pokemonIndex = -1
|
||||
@@ -309,7 +309,7 @@ class PokeBattle_Battler
|
||||
pbInitEffects(false)
|
||||
@participants = []
|
||||
# Reset status
|
||||
@status = PBStatuses::NONE
|
||||
@status = :NONE
|
||||
@statusCount = 0
|
||||
# Reset choice
|
||||
@battle.pbClearChoice(@index)
|
||||
|
||||
@@ -57,7 +57,7 @@ class PokeBattle_Battler
|
||||
@battle.scene.pbFaintBattler(self)
|
||||
pbInitEffects(false)
|
||||
# Reset status
|
||||
self.status = PBStatuses::NONE
|
||||
self.status = :NONE
|
||||
self.statusCount = 0
|
||||
# Lose happiness
|
||||
if @pokemon && @battle.internalBattle
|
||||
|
||||
@@ -5,7 +5,7 @@ class PokeBattle_Battler
|
||||
# NOTE: Not all "does it have this status?" checks use this method. If the
|
||||
# check is leading up to curing self of that status condition, then it
|
||||
# will look at the value of @status directly instead - if it is that
|
||||
# PBStatuses value then it is curable. This method only checks for
|
||||
# status condition then it is curable. This method only checks for
|
||||
# "counts as having that status", which includes Comatose which can't be
|
||||
# cured.
|
||||
def pbHasStatus?(checkStatus)
|
||||
@@ -19,7 +19,7 @@ class PokeBattle_Battler
|
||||
if BattleHandlers.triggerStatusCheckAbilityNonIgnorable(self.ability,self,nil)
|
||||
return true
|
||||
end
|
||||
return @status!=PBStatuses::NONE
|
||||
return @status != :NONE
|
||||
end
|
||||
|
||||
def pbCanInflictStatus?(newStatus,user,showMessages,move=nil,ignoreStatus=false)
|
||||
@@ -30,18 +30,18 @@ class PokeBattle_Battler
|
||||
if showMessages
|
||||
msg = ""
|
||||
case self.status
|
||||
when PBStatuses::SLEEP then msg = _INTL("{1} is already asleep!",pbThis)
|
||||
when PBStatuses::POISON then msg = _INTL("{1} is already poisoned!",pbThis)
|
||||
when PBStatuses::BURN then msg = _INTL("{1} already has a burn!",pbThis)
|
||||
when PBStatuses::PARALYSIS then msg = _INTL("{1} is already paralyzed!",pbThis)
|
||||
when PBStatuses::FROZEN then msg = _INTL("{1} is already frozen solid!",pbThis)
|
||||
when :SLEEP then msg = _INTL("{1} is already asleep!", pbThis)
|
||||
when :POISON then msg = _INTL("{1} is already poisoned!", pbThis)
|
||||
when :BURN then msg = _INTL("{1} already has a burn!", pbThis)
|
||||
when :PARALYSIS then msg = _INTL("{1} is already paralyzed!", pbThis)
|
||||
when :FROZEN then msg = _INTL("{1} is already frozen solid!", pbThis)
|
||||
end
|
||||
@battle.pbDisplay(msg)
|
||||
end
|
||||
return false
|
||||
end
|
||||
# Trying to replace a status problem with another one
|
||||
if self.status!=PBStatuses::NONE && !ignoreStatus && !selfInflicted
|
||||
if self.status != :NONE && !ignoreStatus && !selfInflicted
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",pbThis(true))) if showMessages
|
||||
return false
|
||||
end
|
||||
@@ -52,7 +52,7 @@ class PokeBattle_Battler
|
||||
return false
|
||||
end
|
||||
# Weather immunity
|
||||
if newStatus==PBStatuses::FROZEN &&
|
||||
if newStatus == :FROZEN &&
|
||||
(@battle.pbWeather==PBWeather::Sun || @battle.pbWeather==PBWeather::HarshSun)
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",pbThis(true))) if showMessages
|
||||
return false
|
||||
@@ -61,7 +61,7 @@ class PokeBattle_Battler
|
||||
if affectedByTerrain?
|
||||
case @battle.field.terrain
|
||||
when PBBattleTerrains::Electric
|
||||
if newStatus==PBStatuses::SLEEP
|
||||
if newStatus == :SLEEP
|
||||
@battle.pbDisplay(_INTL("{1} surrounds itself with electrified terrain!",
|
||||
pbThis(true))) if showMessages
|
||||
return false
|
||||
@@ -72,8 +72,7 @@ class PokeBattle_Battler
|
||||
end
|
||||
end
|
||||
# Uproar immunity
|
||||
if newStatus==PBStatuses::SLEEP &&
|
||||
!(hasActiveAbility?(:SOUNDPROOF) && !@battle.moldBreaker)
|
||||
if newStatus == :SLEEP && !(hasActiveAbility?(:SOUNDPROOF) && !@battle.moldBreaker)
|
||||
@battle.eachBattler do |b|
|
||||
next if b.effects[PBEffects::Uproar]==0
|
||||
@battle.pbDisplay(_INTL("But the uproar kept {1} awake!",pbThis(true))) if showMessages
|
||||
@@ -83,18 +82,18 @@ class PokeBattle_Battler
|
||||
# Type immunities
|
||||
hasImmuneType = false
|
||||
case newStatus
|
||||
when PBStatuses::SLEEP
|
||||
when :SLEEP
|
||||
# No type is immune to sleep
|
||||
when PBStatuses::POISON
|
||||
when :POISON
|
||||
if !(user && user.hasActiveAbility?(:CORROSION))
|
||||
hasImmuneType |= pbHasType?(:POISON)
|
||||
hasImmuneType |= pbHasType?(:STEEL)
|
||||
end
|
||||
when PBStatuses::BURN
|
||||
when :BURN
|
||||
hasImmuneType |= pbHasType?(:FIRE)
|
||||
when PBStatuses::PARALYSIS
|
||||
when :PARALYSIS
|
||||
hasImmuneType |= pbHasType?(:ELECTRIC) && Settings::MORE_TYPE_EFFECTS
|
||||
when PBStatuses::FROZEN
|
||||
when :FROZEN
|
||||
hasImmuneType |= pbHasType?(:ICE)
|
||||
end
|
||||
if hasImmuneType
|
||||
@@ -124,37 +123,37 @@ class PokeBattle_Battler
|
||||
msg = ""
|
||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
case newStatus
|
||||
when PBStatuses::SLEEP then msg = _INTL("{1} stays awake!",pbThis)
|
||||
when PBStatuses::POISON then msg = _INTL("{1} cannot be poisoned!",pbThis)
|
||||
when PBStatuses::BURN then msg = _INTL("{1} cannot be burned!",pbThis)
|
||||
when PBStatuses::PARALYSIS then msg = _INTL("{1} cannot be paralyzed!",pbThis)
|
||||
when PBStatuses::FROZEN then msg = _INTL("{1} cannot be frozen solid!",pbThis)
|
||||
when :SLEEP then msg = _INTL("{1} stays awake!", pbThis)
|
||||
when :POISON then msg = _INTL("{1} cannot be poisoned!", pbThis)
|
||||
when :BURN then msg = _INTL("{1} cannot be burned!", pbThis)
|
||||
when :PARALYSIS then msg = _INTL("{1} cannot be paralyzed!", pbThis)
|
||||
when :FROZEN then msg = _INTL("{1} cannot be frozen solid!", pbThis)
|
||||
end
|
||||
elsif immAlly
|
||||
case newStatus
|
||||
when PBStatuses::SLEEP
|
||||
when :SLEEP
|
||||
msg = _INTL("{1} stays awake because of {2}'s {3}!",
|
||||
pbThis,immAlly.pbThis(true),immAlly.abilityName)
|
||||
when PBStatuses::POISON
|
||||
when :POISON
|
||||
msg = _INTL("{1} cannot be poisoned because of {2}'s {3}!",
|
||||
pbThis,immAlly.pbThis(true),immAlly.abilityName)
|
||||
when PBStatuses::BURN
|
||||
when :BURN
|
||||
msg = _INTL("{1} cannot be burned because of {2}'s {3}!",
|
||||
pbThis,immAlly.pbThis(true),immAlly.abilityName)
|
||||
when PBStatuses::PARALYSIS
|
||||
when :PARALYSIS
|
||||
msg = _INTL("{1} cannot be paralyzed because of {2}'s {3}!",
|
||||
pbThis,immAlly.pbThis(true),immAlly.abilityName)
|
||||
when PBStatuses::FROZEN
|
||||
when :FROZEN
|
||||
msg = _INTL("{1} cannot be frozen solid because of {2}'s {3}!",
|
||||
pbThis,immAlly.pbThis(true),immAlly.abilityName)
|
||||
end
|
||||
else
|
||||
case newStatus
|
||||
when PBStatuses::SLEEP then msg = _INTL("{1} stays awake because of its {2}!",pbThis,abilityName)
|
||||
when PBStatuses::POISON then msg = _INTL("{1}'s {2} prevents poisoning!",pbThis,abilityName)
|
||||
when PBStatuses::BURN then msg = _INTL("{1}'s {2} prevents burns!",pbThis,abilityName)
|
||||
when PBStatuses::PARALYSIS then msg = _INTL("{1}'s {2} prevents paralysis!",pbThis,abilityName)
|
||||
when PBStatuses::FROZEN then msg = _INTL("{1}'s {2} prevents freezing!",pbThis,abilityName)
|
||||
when :SLEEP then msg = _INTL("{1} stays awake because of its {2}!", pbThis, abilityName)
|
||||
when :POISON then msg = _INTL("{1}'s {2} prevents poisoning!", pbThis, abilityName)
|
||||
when :BURN then msg = _INTL("{1}'s {2} prevents burns!", pbThis, abilityName)
|
||||
when :PARALYSIS then msg = _INTL("{1}'s {2} prevents paralysis!", pbThis, abilityName)
|
||||
when :FROZEN then msg = _INTL("{1}'s {2} prevents freezing!", pbThis, abilityName)
|
||||
end
|
||||
end
|
||||
@battle.pbDisplay(msg)
|
||||
@@ -174,21 +173,21 @@ class PokeBattle_Battler
|
||||
def pbCanSynchronizeStatus?(newStatus,target)
|
||||
return false if fainted?
|
||||
# Trying to replace a status problem with another one
|
||||
return false if self.status!=PBStatuses::NONE
|
||||
return false if self.status != :NONE
|
||||
# Terrain immunity
|
||||
return false if @battle.field.terrain==PBBattleTerrains::Misty && affectedByTerrain?
|
||||
# Type immunities
|
||||
hasImmuneType = false
|
||||
case newStatus
|
||||
when PBStatuses::POISON
|
||||
when :POISON
|
||||
# NOTE: target will have Synchronize, so it can't have Corrosion.
|
||||
if !(target && target.hasActiveAbility?(:CORROSION))
|
||||
hasImmuneType |= pbHasType?(:POISON)
|
||||
hasImmuneType |= pbHasType?(:STEEL)
|
||||
end
|
||||
when PBStatuses::BURN
|
||||
when :BURN
|
||||
hasImmuneType |= pbHasType?(:FIRE)
|
||||
when PBStatuses::PARALYSIS
|
||||
when :PARALYSIS
|
||||
hasImmuneType |= pbHasType?(:ELECTRIC) && Settings::MORE_TYPE_EFFECTS
|
||||
end
|
||||
return false if hasImmuneType
|
||||
@@ -222,10 +221,10 @@ class PokeBattle_Battler
|
||||
@effects[PBEffects::Toxic] = 0
|
||||
# Record status change in debug log, generate default message, show animation
|
||||
case newStatus
|
||||
when PBStatuses::SLEEP
|
||||
when :SLEEP
|
||||
@battle.pbCommonAnimation("Sleep",self)
|
||||
msg = _INTL("{1} fell asleep!",pbThis) if !msg || msg==""
|
||||
when PBStatuses::POISON
|
||||
when :POISON
|
||||
if newStatusCount>0
|
||||
@battle.pbCommonAnimation("Toxic",self)
|
||||
msg = _INTL("{1} was badly poisoned!",pbThis) if !msg || msg==""
|
||||
@@ -233,19 +232,19 @@ class PokeBattle_Battler
|
||||
@battle.pbCommonAnimation("Poison",self)
|
||||
msg = _INTL("{1} was poisoned!",pbThis) if !msg || msg==""
|
||||
end
|
||||
when PBStatuses::BURN
|
||||
when :BURN
|
||||
@battle.pbCommonAnimation("Burn",self)
|
||||
msg = _INTL("{1} was burned!",pbThis) if !msg || msg==""
|
||||
when PBStatuses::PARALYSIS
|
||||
when :PARALYSIS
|
||||
@battle.pbCommonAnimation("Paralysis",self)
|
||||
msg = _INTL("{1} is paralyzed! It may be unable to move!",pbThis) if !msg || msg==""
|
||||
when PBStatuses::FROZEN
|
||||
when :FROZEN
|
||||
@battle.pbCommonAnimation("Frozen",self)
|
||||
msg = _INTL("{1} was frozen solid!",pbThis) if !msg || msg==""
|
||||
end
|
||||
# Show message
|
||||
@battle.pbDisplay(msg) if msg && msg!=""
|
||||
PBDebug.log("[Status change] #{pbThis}'s sleep count is #{newStatusCount}") if newStatus==PBStatuses::SLEEP
|
||||
PBDebug.log("[Status change] #{pbThis}'s sleep count is #{newStatusCount}") if newStatus == :SLEEP
|
||||
pbCheckFormOnStatusChange
|
||||
# Synchronize
|
||||
if abilityActive?
|
||||
@@ -259,7 +258,7 @@ class PokeBattle_Battler
|
||||
# asleep (i.e. it doesn't cancel Rollout/Uproar/other multi-turn
|
||||
# moves, and it doesn't cancel any moves if self becomes frozen/
|
||||
# disabled/anything else). This behaviour was tested in Gen 5.
|
||||
if @status==PBStatuses::SLEEP && @effects[PBEffects::Outrage]>0
|
||||
if @status == :SLEEP && @effects[PBEffects::Outrage] > 0
|
||||
@effects[PBEffects::Outrage] = 0
|
||||
@currentMove = nil
|
||||
end
|
||||
@@ -269,15 +268,15 @@ class PokeBattle_Battler
|
||||
# Sleep
|
||||
#=============================================================================
|
||||
def asleep?
|
||||
return pbHasStatus?(PBStatuses::SLEEP)
|
||||
return pbHasStatus?(:SLEEP)
|
||||
end
|
||||
|
||||
def pbCanSleep?(user,showMessages,move=nil,ignoreStatus=false)
|
||||
return pbCanInflictStatus?(PBStatuses::SLEEP,user,showMessages,move,ignoreStatus)
|
||||
def pbCanSleep?(user, showMessages, move = nil, ignoreStatus = false)
|
||||
return pbCanInflictStatus?(:SLEEP, user, showMessages, move, ignoreStatus)
|
||||
end
|
||||
|
||||
def pbCanSleepYawn?
|
||||
return false if self.status!=PBStatuses::NONE
|
||||
return false if self.status != :NONE
|
||||
if affectedByTerrain?
|
||||
return false if @battle.field.terrain==PBBattleTerrains::Electric
|
||||
return false if @battle.field.terrain==PBBattleTerrains::Misty
|
||||
@@ -287,18 +286,18 @@ class PokeBattle_Battler
|
||||
return false if b.effects[PBEffects::Uproar]>0
|
||||
end
|
||||
end
|
||||
if BattleHandlers.triggerStatusImmunityAbilityNonIgnorable(self.ability,self,PBStatuses::SLEEP)
|
||||
if BattleHandlers.triggerStatusImmunityAbilityNonIgnorable(self.ability, self, :SLEEP)
|
||||
return false
|
||||
end
|
||||
# NOTE: Bulbapedia claims that Flower Veil shouldn't prevent sleep due to
|
||||
# drowsiness, but I disagree because that makes no sense. Also, the
|
||||
# comparable Sweet Veil does prevent sleep due to drowsiness.
|
||||
if abilityActive? && BattleHandlers.triggerStatusImmunityAbility(self.ability,self,PBStatuses::SLEEP)
|
||||
if abilityActive? && BattleHandlers.triggerStatusImmunityAbility(self.ability, self, :SLEEP)
|
||||
return false
|
||||
end
|
||||
eachAlly do |b|
|
||||
next if !b.abilityActive?
|
||||
next if !BattleHandlers.triggerStatusImmunityAllyAbility(b.ability,self,PBStatuses::SLEEP)
|
||||
next if !BattleHandlers.triggerStatusImmunityAllyAbility(b.ability, self, :SLEEP)
|
||||
return false
|
||||
end
|
||||
# NOTE: Bulbapedia claims that Safeguard shouldn't prevent sleep due to
|
||||
@@ -308,17 +307,17 @@ class PokeBattle_Battler
|
||||
return true
|
||||
end
|
||||
|
||||
def pbSleep(msg=nil)
|
||||
pbInflictStatus(PBStatuses::SLEEP,pbSleepDuration,msg)
|
||||
def pbSleep(msg = nil)
|
||||
pbInflictStatus(:SLEEP, pbSleepDuration, msg)
|
||||
end
|
||||
|
||||
def pbSleepSelf(msg=nil,duration=-1)
|
||||
pbInflictStatus(PBStatuses::SLEEP,pbSleepDuration(duration),msg)
|
||||
def pbSleepSelf(msg = nil, duration = -1)
|
||||
pbInflictStatus(:SLEEP, pbSleepDuration(duration), msg)
|
||||
end
|
||||
|
||||
def pbSleepDuration(duration=-1)
|
||||
duration = 2+@battle.pbRandom(3) if duration<=0
|
||||
duration = (duration/2).floor if hasActiveAbility?(:EARLYBIRD)
|
||||
def pbSleepDuration(duration = -1)
|
||||
duration = 2 + @battle.pbRandom(3) if duration <= 0
|
||||
duration = (duration / 2).floor if hasActiveAbility?(:EARLYBIRD)
|
||||
return duration
|
||||
end
|
||||
|
||||
@@ -326,112 +325,113 @@ class PokeBattle_Battler
|
||||
# Poison
|
||||
#=============================================================================
|
||||
def poisoned?
|
||||
return pbHasStatus?(PBStatuses::POISON)
|
||||
return pbHasStatus?(:POISON)
|
||||
end
|
||||
|
||||
def pbCanPoison?(user,showMessages,move=nil)
|
||||
return pbCanInflictStatus?(PBStatuses::POISON,user,showMessages,move)
|
||||
def pbCanPoison?(user, showMessages, move = nil)
|
||||
return pbCanInflictStatus?(:POISON, user, showMessages, move)
|
||||
end
|
||||
|
||||
def pbCanPoisonSynchronize?(target)
|
||||
return pbCanSynchronizeStatus?(PBStatuses::POISON,target)
|
||||
return pbCanSynchronizeStatus?(:POISON, target)
|
||||
end
|
||||
|
||||
def pbPoison(user=nil,msg=nil,toxic=false)
|
||||
pbInflictStatus(PBStatuses::POISON,(toxic) ? 1 : 0,msg,user)
|
||||
def pbPoison(user = nil, msg = nil, toxic = false)
|
||||
pbInflictStatus(:POISON, (toxic) ? 1 : 0, msg, user)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
# Burn
|
||||
#=============================================================================
|
||||
def burned?
|
||||
return pbHasStatus?(PBStatuses::BURN)
|
||||
return pbHasStatus?(:BURN)
|
||||
end
|
||||
|
||||
def pbCanBurn?(user,showMessages,move=nil)
|
||||
return pbCanInflictStatus?(PBStatuses::BURN,user,showMessages,move)
|
||||
def pbCanBurn?(user, showMessages, move = nil)
|
||||
return pbCanInflictStatus?(:BURN, user, showMessages, move)
|
||||
end
|
||||
|
||||
def pbCanBurnSynchronize?(target)
|
||||
return pbCanSynchronizeStatus?(PBStatuses::BURN,target)
|
||||
return pbCanSynchronizeStatus?(:BURN, target)
|
||||
end
|
||||
|
||||
def pbBurn(user=nil,msg=nil)
|
||||
pbInflictStatus(PBStatuses::BURN,0,msg,user)
|
||||
def pbBurn(user = nil, msg = nil)
|
||||
pbInflictStatus(:BURN, 0, msg, user)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
# Paralyze
|
||||
#=============================================================================
|
||||
def paralyzed?
|
||||
return pbHasStatus?(PBStatuses::PARALYSIS)
|
||||
return pbHasStatus?(:PARALYSIS)
|
||||
end
|
||||
|
||||
def pbCanParalyze?(user,showMessages,move=nil)
|
||||
return pbCanInflictStatus?(PBStatuses::PARALYSIS,user,showMessages,move)
|
||||
def pbCanParalyze?(user, showMessages, move = nil)
|
||||
return pbCanInflictStatus?(:PARALYSIS, user, showMessages, move)
|
||||
end
|
||||
|
||||
def pbCanParalyzeSynchronize?(target)
|
||||
return pbCanSynchronizeStatus?(PBStatuses::PARALYSIS,target)
|
||||
return pbCanSynchronizeStatus?(:PARALYSIS, target)
|
||||
end
|
||||
|
||||
def pbParalyze(user=nil,msg=nil)
|
||||
pbInflictStatus(PBStatuses::PARALYSIS,0,msg,user)
|
||||
def pbParalyze(user = nil, msg = nil)
|
||||
pbInflictStatus(:PARALYSIS, 0, msg, user)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
# Freeze
|
||||
#=============================================================================
|
||||
def frozen?
|
||||
return pbHasStatus?(PBStatuses::FROZEN)
|
||||
return pbHasStatus?(:FROZEN)
|
||||
end
|
||||
|
||||
def pbCanFreeze?(user,showMessages,move=nil)
|
||||
return pbCanInflictStatus?(PBStatuses::FROZEN,user,showMessages,move)
|
||||
def pbCanFreeze?(user, showMessages, move = nil)
|
||||
return pbCanInflictStatus?(:FROZEN, user, showMessages, move)
|
||||
end
|
||||
|
||||
def pbFreeze(msg=nil)
|
||||
pbInflictStatus(PBStatuses::FROZEN,0,msg)
|
||||
def pbFreeze(msg = nil)
|
||||
pbInflictStatus(:FROZEN, 0, msg)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
# Generalised status displays
|
||||
#=============================================================================
|
||||
def pbContinueStatus
|
||||
anim = ""; msg = ""
|
||||
anim = ""
|
||||
msg = ""
|
||||
case self.status
|
||||
when PBStatuses::SLEEP
|
||||
when :SLEEP
|
||||
anim = "Sleep"
|
||||
msg = _INTL("{1} is fast asleep.", pbThis)
|
||||
when PBStatuses::POISON
|
||||
when :POISON
|
||||
anim = (@statusCount>0) ? "Toxic" : "Poison"
|
||||
msg = _INTL("{1} was hurt by poison!", pbThis)
|
||||
when PBStatuses::BURN
|
||||
when :BURN
|
||||
anim = "Burn"
|
||||
msg = _INTL("{1} was hurt by its burn!", pbThis)
|
||||
when PBStatuses::PARALYSIS
|
||||
when :PARALYSIS
|
||||
anim = "Paralysis"
|
||||
msg = _INTL("{1} is paralyzed! It can't move!", pbThis)
|
||||
when PBStatuses::FROZEN
|
||||
when :FROZEN
|
||||
anim = "Frozen"
|
||||
msg = _INTL("{1} is frozen solid!", pbThis)
|
||||
end
|
||||
@battle.pbCommonAnimation(anim,self) if anim!=""
|
||||
yield if block_given?
|
||||
@battle.pbDisplay(msg) if msg!=""
|
||||
PBDebug.log("[Status continues] #{pbThis}'s sleep count is #{@statusCount}") if self.status==PBStatuses::SLEEP
|
||||
PBDebug.log("[Status continues] #{pbThis}'s sleep count is #{@statusCount}") if self.status == :SLEEP
|
||||
end
|
||||
|
||||
def pbCureStatus(showMessages=true)
|
||||
oldStatus = status
|
||||
self.status = PBStatuses::NONE
|
||||
self.status = :NONE
|
||||
if showMessages
|
||||
case oldStatus
|
||||
when PBStatuses::SLEEP then @battle.pbDisplay(_INTL("{1} woke up!",pbThis))
|
||||
when PBStatuses::POISON then @battle.pbDisplay(_INTL("{1} was cured of its poisoning.",pbThis))
|
||||
when PBStatuses::BURN then @battle.pbDisplay(_INTL("{1}'s burn was healed.",pbThis))
|
||||
when PBStatuses::PARALYSIS then @battle.pbDisplay(_INTL("{1} was cured of paralysis.",pbThis))
|
||||
when PBStatuses::FROZEN then @battle.pbDisplay(_INTL("{1} thawed out!",pbThis))
|
||||
when :SLEEP then @battle.pbDisplay(_INTL("{1} woke up!", pbThis))
|
||||
when :POISON then @battle.pbDisplay(_INTL("{1} was cured of its poisoning.", pbThis))
|
||||
when :BURN then @battle.pbDisplay(_INTL("{1}'s burn was healed.", pbThis))
|
||||
when :PARALYSIS then @battle.pbDisplay(_INTL("{1} was cured of paralysis.", pbThis))
|
||||
when :FROZEN then @battle.pbDisplay(_INTL("{1} thawed out!", pbThis))
|
||||
end
|
||||
end
|
||||
PBDebug.log("[Status change] #{pbThis}'s status was cured") if !showMessages
|
||||
|
||||
@@ -314,7 +314,7 @@ class PokeBattle_Battler
|
||||
# Messages include Magnitude's number and Pledge moves' "it's a combo!"
|
||||
move.pbOnStartUse(user,targets)
|
||||
# Self-thawing due to the move
|
||||
if user.status==PBStatuses::FROZEN && move.thawsUser?
|
||||
if user.status == :FROZEN && move.thawsUser?
|
||||
user.pbCureStatus(false)
|
||||
@battle.pbDisplay(_INTL("{1} melted the ice!",user.pbThis))
|
||||
end
|
||||
@@ -435,7 +435,7 @@ class PokeBattle_Battler
|
||||
end
|
||||
realNumHits += 1
|
||||
break if user.fainted?
|
||||
break if user.status==PBStatuses::SLEEP || user.status==PBStatuses::FROZEN
|
||||
break if [:SLEEP, :FROZEN].include?(user.status)
|
||||
# NOTE: If a multi-hit move becomes disabled partway through doing those
|
||||
# hits (e.g. by Cursed Body), the rest of the hits continue as
|
||||
# normal.
|
||||
|
||||
@@ -126,7 +126,7 @@ class PokeBattle_Battler
|
||||
PBDebug.log("[Disobedience] #{pbThis} disobeyed")
|
||||
@effects[PBEffects::Rage] = false
|
||||
# Do nothing if using Snore/Sleep Talk
|
||||
if @status==PBStatuses::SLEEP && move.usableWhenAsleep?
|
||||
if @status == :SLEEP && move.usableWhenAsleep?
|
||||
@battle.pbDisplay(_INTL("{1} ignored orders and kept sleeping!",pbThis))
|
||||
return false
|
||||
end
|
||||
@@ -156,7 +156,7 @@ class PokeBattle_Battler
|
||||
end
|
||||
# Hurt self in confusion
|
||||
r -= c
|
||||
if r<c && @status!=PBStatuses::SLEEP
|
||||
if r < c && @status != :SLEEP
|
||||
pbConfusionDamage(_INTL("{1} won't obey! It hurt itself in its confusion!",pbThis))
|
||||
return false
|
||||
end
|
||||
@@ -200,7 +200,7 @@ class PokeBattle_Battler
|
||||
return true if skipAccuracyCheck
|
||||
# Check status problems and continue their effects/cure them
|
||||
case @status
|
||||
when PBStatuses::SLEEP
|
||||
when :SLEEP
|
||||
self.statusCount -= 1
|
||||
if @statusCount<=0
|
||||
pbCureStatus
|
||||
@@ -211,7 +211,7 @@ class PokeBattle_Battler
|
||||
return false
|
||||
end
|
||||
end
|
||||
when PBStatuses::FROZEN
|
||||
when :FROZEN
|
||||
if !move.thawsUser?
|
||||
if @battle.pbRandom(100)<20
|
||||
pbCureStatus
|
||||
@@ -262,7 +262,7 @@ class PokeBattle_Battler
|
||||
end
|
||||
end
|
||||
# Paralysis
|
||||
if @status==PBStatuses::PARALYSIS
|
||||
if @status == :PARALYSIS
|
||||
if @battle.pbRandom(100)<25
|
||||
pbContinueStatus
|
||||
@lastMoveFailed = true
|
||||
|
||||
@@ -69,7 +69,7 @@ class PokeBattle_Battler
|
||||
if move.damagingMove?
|
||||
targets.each do |b|
|
||||
next if b.damageState.unaffected || b.damageState.substitute
|
||||
next if b.status!=PBStatuses::FROZEN
|
||||
next if b.status != :FROZEN
|
||||
# NOTE: Non-Fire-type moves that thaw the user will also thaw the
|
||||
# target (in Gen 6+).
|
||||
if move.calcType == :FIRE || (Settings::MECHANICS_GENERATION >= 6 && move.thawsUser?)
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
begin
|
||||
module PBEnvironment
|
||||
None = 0
|
||||
Grass = 1
|
||||
TallGrass = 2
|
||||
MovingWater = 3
|
||||
StillWater = 4
|
||||
Puddle = 5
|
||||
Underwater = 6
|
||||
Cave = 7
|
||||
Rock = 8
|
||||
Sand = 9
|
||||
Forest = 10
|
||||
ForestGrass = 11
|
||||
Snow = 12
|
||||
Ice = 13
|
||||
Volcano = 14
|
||||
Graveyard = 15
|
||||
Sky = 16
|
||||
Space = 17
|
||||
UltraSpace = 18
|
||||
|
||||
def self.maxValue; return 18; end
|
||||
end
|
||||
|
||||
rescue Exception
|
||||
if $!.is_a?(SystemExit) || "#{$!.class}"=="Reset"
|
||||
raise $!
|
||||
end
|
||||
end
|
||||
@@ -418,7 +418,7 @@ class PokeBattle_Move
|
||||
# Type effectiveness
|
||||
multipliers[:final_damage_multiplier] *= target.damageState.typeMod.to_f / PBTypeEffectiveness::NORMAL_EFFECTIVE
|
||||
# Burn
|
||||
if user.status==PBStatuses::BURN && physicalMove? && damageReducedByBurn? &&
|
||||
if user.status == :BURN && physicalMove? && damageReducedByBurn? &&
|
||||
!user.hasActiveAbility?(:GUTS)
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
end
|
||||
|
||||
@@ -366,9 +366,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_018 < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.status!=PBStatuses::BURN &&
|
||||
user.status!=PBStatuses::POISON &&
|
||||
user.status!=PBStatuses::PARALYSIS
|
||||
if ![:BURN, :POISON, :PARALYSIS].include?(user.status)
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -376,14 +374,14 @@ class PokeBattle_Move_018 < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
t = user.status
|
||||
old_status = user.status
|
||||
user.pbCureStatus(false)
|
||||
case t
|
||||
when PBStatuses::BURN
|
||||
case old_status
|
||||
when :BURN
|
||||
@battle.pbDisplay(_INTL("{1} healed its burn!",user.pbThis))
|
||||
when PBStatuses::POISON
|
||||
when :POISON
|
||||
@battle.pbDisplay(_INTL("{1} cured its poisoning!",user.pbThis))
|
||||
when PBStatuses::PARALYSIS
|
||||
when :PARALYSIS
|
||||
@battle.pbDisplay(_INTL("{1} cured its paralysis!",user.pbThis))
|
||||
end
|
||||
end
|
||||
@@ -407,13 +405,13 @@ class PokeBattle_Move_019 < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
failed = true
|
||||
@battle.eachSameSideBattler(user) do |b|
|
||||
next if b.status==PBStatuses::NONE
|
||||
next if b.status == :NONE
|
||||
failed = false
|
||||
break
|
||||
end
|
||||
if !failed
|
||||
@battle.pbParty(user.index).each do |pkmn|
|
||||
next if !pkmn || !pkmn.able? || pkmn.status==PBStatuses::NONE
|
||||
next if !pkmn || !pkmn.able? || pkmn.status == :NONE
|
||||
failed = false
|
||||
break
|
||||
end
|
||||
@@ -426,7 +424,7 @@ class PokeBattle_Move_019 < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
return target.status==PBStatuses::NONE
|
||||
return target.status == :NONE
|
||||
end
|
||||
|
||||
def pbAromatherapyHeal(pkmn,battler=nil)
|
||||
@@ -435,19 +433,19 @@ class PokeBattle_Move_019 < PokeBattle_Move
|
||||
if battler
|
||||
battler.pbCureStatus(false)
|
||||
else
|
||||
pkmn.status = PBStatuses::NONE
|
||||
pkmn.status = :NONE
|
||||
pkmn.statusCount = 0
|
||||
end
|
||||
case oldStatus
|
||||
when PBStatuses::SLEEP
|
||||
when :SLEEP
|
||||
@battle.pbDisplay(_INTL("{1} was woken from sleep.",curedName))
|
||||
when PBStatuses::POISON
|
||||
when :POISON
|
||||
@battle.pbDisplay(_INTL("{1} was cured of its poisoning.",curedName))
|
||||
when PBStatuses::BURN
|
||||
when :BURN
|
||||
@battle.pbDisplay(_INTL("{1}'s burn was healed.",curedName))
|
||||
when PBStatuses::PARALYSIS
|
||||
when :PARALYSIS
|
||||
@battle.pbDisplay(_INTL("{1} was cured of paralysis.",curedName))
|
||||
when PBStatuses::FROZEN
|
||||
when :FROZEN
|
||||
@battle.pbDisplay(_INTL("{1} was thawed out.",curedName))
|
||||
end
|
||||
end
|
||||
@@ -462,7 +460,7 @@ class PokeBattle_Move_019 < PokeBattle_Move
|
||||
# 5 version of this move, to make Pokémon out in battle get cured first.
|
||||
if pbTarget(user)!=PBTargets::UserAndAllies
|
||||
@battle.eachSameSideBattler(user) do |b|
|
||||
next if b.status==PBStatuses::NONE
|
||||
next if b.status == :NONE
|
||||
pbAromatherapyHeal(b.pokemon,b)
|
||||
end
|
||||
end
|
||||
@@ -470,7 +468,7 @@ class PokeBattle_Move_019 < PokeBattle_Move
|
||||
# NOTE: This intentionally affects the partner trainer's inactive Pokémon
|
||||
# too.
|
||||
@battle.pbParty(user.index).each_with_index do |pkmn,i|
|
||||
next if !pkmn || !pkmn.able? || pkmn.status==PBStatuses::NONE
|
||||
next if !pkmn || !pkmn.able? || pkmn.status == :NONE
|
||||
next if @battle.pbFindBattler(i,user) # Skip Pokémon in battle
|
||||
pbAromatherapyHeal(pkmn)
|
||||
end
|
||||
@@ -514,7 +512,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_01B < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
if user.status==0
|
||||
if user.status == :NONE
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -532,19 +530,19 @@ class PokeBattle_Move_01B < PokeBattle_Move
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
msg = ""
|
||||
case user.status
|
||||
when PBStatuses::SLEEP
|
||||
when :SLEEP
|
||||
target.pbSleep
|
||||
msg = _INTL("{1} woke up.",user.pbThis)
|
||||
when PBStatuses::POISON
|
||||
when :POISON
|
||||
target.pbPoison(user,nil,user.statusCount!=0)
|
||||
msg = _INTL("{1} was cured of its poisoning.",user.pbThis)
|
||||
when PBStatuses::BURN
|
||||
when :BURN
|
||||
target.pbBurn(user)
|
||||
msg = _INTL("{1}'s burn was healed.",user.pbThis)
|
||||
when PBStatuses::PARALYSIS
|
||||
when :PARALYSIS
|
||||
target.pbParalyze(user)
|
||||
msg = _INTL("{1} was cured of paralysis.",user.pbThis)
|
||||
when PBStatuses::FROZEN
|
||||
when :FROZEN
|
||||
target.pbFreeze
|
||||
msg = _INTL("{1} was thawed out.",user.pbThis)
|
||||
end
|
||||
@@ -2665,7 +2663,7 @@ class PokeBattle_Move_07C < PokeBattle_Move
|
||||
def pbEffectAfterAllHits(user,target)
|
||||
return if target.fainted?
|
||||
return if target.damageState.unaffected || target.damageState.substitute
|
||||
return if target.status!=PBStatuses::PARALYSIS
|
||||
return if target.status != :PARALYSIS
|
||||
target.pbCureStatus
|
||||
end
|
||||
end
|
||||
@@ -2687,7 +2685,7 @@ class PokeBattle_Move_07D < PokeBattle_Move
|
||||
def pbEffectAfterAllHits(user,target)
|
||||
return if target.fainted?
|
||||
return if target.damageState.unaffected || target.damageState.substitute
|
||||
return if target.status!=PBStatuses::SLEEP
|
||||
return if target.status != :SLEEP
|
||||
target.pbCureStatus
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1984,7 +1984,7 @@ class PokeBattle_Move_0C1 < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
@beatUpList = []
|
||||
@battle.eachInTeamFromBattlerIndex(user.index) do |pkmn,i|
|
||||
next if !pkmn.able? || pkmn.status!=PBStatuses::NONE
|
||||
next if !pkmn.able? || pkmn.status != :NONE
|
||||
@beatUpList.push(i)
|
||||
end
|
||||
if @beatUpList.length==0
|
||||
@@ -2353,7 +2353,7 @@ class PokeBattle_Move_0D1 < PokeBattle_Move
|
||||
user.currentMove = @id
|
||||
@battle.pbDisplay(_INTL("{1} caused an uproar!",user.pbThis))
|
||||
@battle.pbPriority(true).each do |b|
|
||||
next if b.fainted? || b.status!=PBStatuses::SLEEP
|
||||
next if b.fainted? || b.status != :SLEEP
|
||||
next if b.hasActiveAbility?(:SOUNDPROOF)
|
||||
b.pbCureStatus
|
||||
end
|
||||
|
||||
@@ -1897,7 +1897,7 @@ end
|
||||
class PokeBattle_Move_15A < PokeBattle_Move
|
||||
def pbAdditionalEffect(user,target)
|
||||
return if target.fainted? || target.damageState.substitute
|
||||
return if target.status!=PBStatuses::BURN
|
||||
return if target.status != :BURN
|
||||
target.pbCureStatus
|
||||
end
|
||||
end
|
||||
@@ -1910,7 +1910,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_15B < PokeBattle_HealingMove
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if target.status==PBStatuses::NONE
|
||||
if target.status == :NONE
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
begin
|
||||
module PBWeather
|
||||
None = 0
|
||||
Sun = 1
|
||||
Rain = 2
|
||||
Sandstorm = 3
|
||||
Hail = 4
|
||||
HarshSun = 5
|
||||
HeavyRain = 6
|
||||
StrongWinds = 7
|
||||
ShadowSky = 8
|
||||
|
||||
def self.animationName(weather)
|
||||
case weather
|
||||
when Sun then return "Sun"
|
||||
when Rain then return "Rain"
|
||||
when Sandstorm then return "Sandstorm"
|
||||
when Hail then return "Hail"
|
||||
when HarshSun then return "HarshSun"
|
||||
when HeavyRain then return "HeavyRain"
|
||||
when StrongWinds then return "StrongWinds"
|
||||
when ShadowSky then return "ShadowSky"
|
||||
end
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
rescue Exception
|
||||
if $!.is_a?(SystemExit) || "#{$!.class}"=="Reset"
|
||||
raise $!
|
||||
end
|
||||
end
|
||||
@@ -180,9 +180,9 @@ module PokeBattle_BattleCommon
|
||||
b = battler.hp
|
||||
x = ((3*a-2*b)*catch_rate.to_f)/(3*a)
|
||||
# Calculation modifiers
|
||||
if battler.status==PBStatuses::SLEEP || battler.status==PBStatuses::FROZEN
|
||||
if battler.status == :SLEEP || battler.status == :FROZEN
|
||||
x *= 2.5
|
||||
elsif battler.status!=PBStatuses::NONE
|
||||
elsif battler.status != :NONE
|
||||
x *= 1.5
|
||||
end
|
||||
x = x.floor
|
||||
|
||||
@@ -48,7 +48,7 @@ class PokeBattle_Battle
|
||||
else
|
||||
pbDisplay(_INTL("But nothing happened!"))
|
||||
end
|
||||
elsif battler.status==PBStatuses::SLEEP
|
||||
elsif battler.status == :SLEEP
|
||||
battler.pbCureStatus
|
||||
elsif battler.pbCanRaiseStatStage?(PBStats::ACCURACY,battler)
|
||||
battler.pbRaiseStatStage(PBStats::ACCURACY,1,battler)
|
||||
|
||||
@@ -29,7 +29,7 @@ class PokeBattle_Battle
|
||||
# Check whether Pursuit can be used
|
||||
next unless pbMoveCanTarget?(b.index,idxSwitcher,@choices[b.index][2].target)
|
||||
next unless pbCanChooseMove?(b.index,@choices[b.index][1],false)
|
||||
next if b.status==PBStatuses::SLEEP || b.status==PBStatuses::FROZEN
|
||||
next if b.status == :SLEEP || b.status == :FROZEN
|
||||
next if b.effects[PBEffects::SkyDrop]>=0
|
||||
next if b.hasActiveAbility?(:TRUANT) && b.effects[PBEffects::Truant]
|
||||
# Mega Evolve
|
||||
|
||||
@@ -340,7 +340,7 @@ class PokeBattle_Battle
|
||||
# Damage from poisoning
|
||||
priority.each do |b|
|
||||
next if b.fainted?
|
||||
next if b.status!=PBStatuses::POISON
|
||||
next if b.status != :POISON
|
||||
if b.statusCount>0
|
||||
b.effects[PBEffects::Toxic] += 1
|
||||
b.effects[PBEffects::Toxic] = 15 if b.effects[PBEffects::Toxic]>15
|
||||
@@ -368,7 +368,7 @@ class PokeBattle_Battle
|
||||
end
|
||||
# Damage from burn
|
||||
priority.each do |b|
|
||||
next if b.status!=PBStatuses::BURN || !b.takesIndirectDamage?
|
||||
next if b.status != :BURN || !b.takesIndirectDamage?
|
||||
oldHP = b.hp
|
||||
dmg = (Settings::MECHANICS_GENERATION >= 7) ? b.totalhp/16 : b.totalhp/8
|
||||
dmg = (dmg/2.0).round if b.hasActiveAbility?(:HEATPROOF)
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
# These are in-battle terrain effects caused by moves like Electric Terrain.
|
||||
begin
|
||||
module PBBattleTerrains
|
||||
None = 0
|
||||
Electric = 1
|
||||
Grassy = 2
|
||||
Misty = 3
|
||||
Psychic = 4
|
||||
|
||||
def self.animationName(terrain)
|
||||
case terrain
|
||||
when Electric then return "ElectricTerrain"
|
||||
when Grassy then return "GrassyTerrain"
|
||||
when Misty then return "MistyTerrain"
|
||||
when Psychic then return "PsychicTerrain"
|
||||
end
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
rescue Exception
|
||||
if $!.is_a?(SystemExit) || "#{$!.class}"=="Reset"
|
||||
raise $!
|
||||
end
|
||||
end
|
||||
@@ -96,7 +96,7 @@ class PokeBattle_AI
|
||||
}
|
||||
losthp = battler.totalhp - battler.hp
|
||||
preferFullRestore = (battler.hp <= battler.totalhp * 2 / 3 &&
|
||||
(battler.status != PBStatuses::NONE || battler.effects[PBEffects::Confusion] > 0))
|
||||
(battler.status != :NONE || battler.effects[PBEffects::Confusion] > 0))
|
||||
# Find all usable items
|
||||
usableHPItems = []
|
||||
usableStatusItems = []
|
||||
@@ -115,7 +115,7 @@ class PokeBattle_AI
|
||||
end
|
||||
end
|
||||
# Log Full Restores (HP healer and status curer)
|
||||
if losthp > 0 || battler.status != PBStatuses::NONE
|
||||
if losthp > 0 || battler.status != :NONE
|
||||
if fullRestoreItems.include?(i)
|
||||
usableHPItems.push([i, (preferFullRestore) ? 3 : 7, 999])
|
||||
usableStatusItems.push([i, (preferFullRestore) ? 3 : 9])
|
||||
|
||||
@@ -44,7 +44,7 @@ class PokeBattle_AI
|
||||
end
|
||||
# Pokémon will faint because of bad poisoning at the end of this round, but
|
||||
# would survive at least one more round if it were regular poisoning instead
|
||||
if battler.status==PBStatuses::POISON && battler.statusCount>0 &&
|
||||
if battler.status == :POISON && battler.statusCount > 0 &&
|
||||
skill>=PBTrainerAI.highSkill
|
||||
toxicHP = battler.totalhp/16
|
||||
nextToxicHP = toxicHP*(battler.effects[PBEffects::Toxic]+1)
|
||||
|
||||
@@ -199,7 +199,7 @@ class PokeBattle_AI
|
||||
end
|
||||
end
|
||||
# If user is asleep, prefer moves that are usable while asleep
|
||||
if user.status==PBStatuses::SLEEP && !move.usableWhenAsleep?
|
||||
if user.status == :SLEEP && !move.usableWhenAsleep?
|
||||
user.eachMove do |m|
|
||||
next unless m.usableWhenAsleep?
|
||||
score -= 60
|
||||
@@ -207,7 +207,7 @@ class PokeBattle_AI
|
||||
end
|
||||
end
|
||||
# If user is frozen, prefer a move that can thaw the user
|
||||
if user.status==PBStatuses::FROZEN
|
||||
if user.status == :FROZEN
|
||||
if move.thawsUser?
|
||||
score += 40
|
||||
else
|
||||
@@ -219,7 +219,7 @@ class PokeBattle_AI
|
||||
end
|
||||
end
|
||||
# If target is frozen, don't prefer moves that could thaw them
|
||||
if target.status==PBStatuses::FROZEN
|
||||
if target.status == :FROZEN
|
||||
user.eachMove do |m|
|
||||
next if m.thawsUser?
|
||||
score -= 60
|
||||
|
||||
@@ -180,11 +180,11 @@ class PokeBattle_AI
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "017"
|
||||
score += 30 if target.status==PBStatuses::NONE
|
||||
score += 30 if target.status == :NONE
|
||||
#---------------------------------------------------------------------------
|
||||
when "018"
|
||||
case user.status
|
||||
when PBStatuses::POISON
|
||||
when :POISON
|
||||
score += 40
|
||||
if skill>=PBTrainerAI.mediumSkill
|
||||
if user.hp<user.totalhp/8
|
||||
@@ -194,7 +194,7 @@ class PokeBattle_AI
|
||||
score += 60
|
||||
end
|
||||
end
|
||||
when PBStatuses::BURN, PBStatuses::PARALYSIS
|
||||
when :BURN, :PARALYSIS
|
||||
score += 40
|
||||
else
|
||||
score -= 90
|
||||
@@ -203,7 +203,7 @@ class PokeBattle_AI
|
||||
when "019"
|
||||
statuses = 0
|
||||
@battle.pbParty(user.index).each do |pkmn|
|
||||
statuses += 1 if pkmn && pkmn.status!=PBStatuses::NONE
|
||||
statuses += 1 if pkmn && pkmn.status != :NONE
|
||||
end
|
||||
if statuses==0
|
||||
score -= 80
|
||||
@@ -214,14 +214,14 @@ class PokeBattle_AI
|
||||
when "01A"
|
||||
if user.pbOwnSide.effects[PBEffects::Safeguard]>0
|
||||
score -= 80
|
||||
elsif user.status!=0
|
||||
elsif user.status != :NONE
|
||||
score -= 40
|
||||
else
|
||||
score += 30
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "01B"
|
||||
if user.status==PBStatuses::NONE
|
||||
if user.status == :NONE
|
||||
score -= 90
|
||||
else
|
||||
score += 40
|
||||
@@ -1567,11 +1567,11 @@ class PokeBattle_AI
|
||||
when "07B"
|
||||
#---------------------------------------------------------------------------
|
||||
when "07C"
|
||||
score -= 20 if target.status==PBStatuses::PARALYSIS # Will cure status
|
||||
score -= 20 if target.status == :PARALYSIS # Will cure status
|
||||
#---------------------------------------------------------------------------
|
||||
when "07D"
|
||||
score -= 20 if target.status==PBStatuses::SLEEP && # Will cure status
|
||||
target.statusCount>1
|
||||
score -= 20 if target.status == :SLEEP && # Will cure status
|
||||
target.statusCount > 1
|
||||
#---------------------------------------------------------------------------
|
||||
when "07E"
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -1870,7 +1870,7 @@ class PokeBattle_AI
|
||||
else
|
||||
score += 70
|
||||
score -= user.hp*140/user.totalhp
|
||||
score += 30 if user.status!=0
|
||||
score += 30 if user.status != :NONE
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "0DA"
|
||||
@@ -2811,13 +2811,13 @@ class PokeBattle_AI
|
||||
#---------------------------------------------------------------------------
|
||||
when "15A"
|
||||
if target.opposes?(user)
|
||||
score -= 40 if target.status==PBStatuses::BURN
|
||||
score -= 40 if target.status == :BURN
|
||||
else
|
||||
score += 40 if target.status==PBStatuses::BURN
|
||||
score += 40 if target.status == :BURN
|
||||
end
|
||||
#---------------------------------------------------------------------------
|
||||
when "15B"
|
||||
if target.status==PBStatuses::NONE
|
||||
if target.status == :NONE
|
||||
score -= 90
|
||||
elsif user.hp==user.totalhp && target.opposes?(user)
|
||||
score -= 90
|
||||
|
||||
@@ -215,7 +215,7 @@ class PokeBattle_AI
|
||||
when "0C1" # Beat Up
|
||||
mult = 0
|
||||
@battle.eachInTeamFromBattlerIndex(user.index) do |pkmn,_i|
|
||||
mult += 1 if pkmn && pkmn.able? && pkmn.status==PBStatuses::NONE
|
||||
mult += 1 if pkmn && pkmn.able? && pkmn.status == :NONE
|
||||
end
|
||||
baseDmg *= mult
|
||||
when "0C4" # Solar Beam
|
||||
@@ -472,7 +472,7 @@ class PokeBattle_AI
|
||||
end
|
||||
# Burn
|
||||
if skill>=PBTrainerAI.highSkill
|
||||
if user.status==PBStatuses::BURN && move.physicalMove?(type) &&
|
||||
if user.status == :BURN && move.physicalMove?(type) &&
|
||||
!user.hasActiveAbility?(:GUTS) &&
|
||||
!(Settings::MECHANICS_GENERATION >= 6 && move.function == "07E") # Facade
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
module PBTargets
|
||||
# NOTE: These numbers are all over the place because of backwards
|
||||
# compatibility. As untidy as they are, they need to be left like this.
|
||||
None = 1 # Bide, Counter, Metal Burst, Mirror Coat (calculate a target)
|
||||
User = 10
|
||||
NearAlly = 100 # Aromatic Mist, Helping Hand, Hold Hands
|
||||
UserOrNearAlly = 200 # Acupressure
|
||||
UserAndAllies = 5 # Aromatherapy, Gear Up, Heal Bell, Life Dew, Magnetic Flux, Howl (in Gen 8+)
|
||||
NearFoe = 400 # Me First
|
||||
RandomNearFoe = 2 # Petal Dance, Outrage, Struggle, Thrash, Uproar
|
||||
AllNearFoes = 4
|
||||
Foe = 9 # For throwing a Poké Ball
|
||||
AllFoes = 6 # Unused (for completeness)
|
||||
NearOther = 0
|
||||
AllNearOthers = 8
|
||||
Other = 3 # Most Flying-type moves, pulse moves (hits non-near targets)
|
||||
AllBattlers = 7 # Flower Shield, Perish Song, Rototiller, Teatime
|
||||
UserSide = 40
|
||||
FoeSide = 80 # Entry hazards
|
||||
BothSides = 20
|
||||
|
||||
def self.noTargets?(target)
|
||||
return target==None ||
|
||||
target==User ||
|
||||
target==UserSide ||
|
||||
target==FoeSide ||
|
||||
target==BothSides
|
||||
end
|
||||
|
||||
# Used to determine if you are able to choose a target for the move.
|
||||
def self.oneTarget?(target)
|
||||
return !PBTargets.noTargets?(target) &&
|
||||
!PBTargets.multipleTargets?(target)
|
||||
end
|
||||
|
||||
def self.multipleTargets?(target)
|
||||
return target==AllNearFoes ||
|
||||
target==AllNearOthers ||
|
||||
target==UserAndAllies ||
|
||||
target==AllFoes ||
|
||||
target==AllBattlers
|
||||
end
|
||||
|
||||
# These moves do not target specific Pokémon but are still affected by Pressure.
|
||||
def self.targetsFoeSide?(target)
|
||||
return target==FoeSide ||
|
||||
target==BothSides
|
||||
end
|
||||
|
||||
def self.canChooseDistantTarget?(target)
|
||||
return target==Other
|
||||
end
|
||||
|
||||
# These moves can be redirected to a different target.
|
||||
def self.canChooseOneFoeTarget?(target)
|
||||
return target==NearFoe ||
|
||||
target==NearOther ||
|
||||
target==Other ||
|
||||
target==RandomNearFoe
|
||||
end
|
||||
|
||||
# Used by the AI to avoid targeting an ally with a move if that move could
|
||||
# target an opponent instead.
|
||||
def self.canChooseFoeTarget?(target)
|
||||
return target==NearFoe ||
|
||||
target==NearOther ||
|
||||
target==Other ||
|
||||
target==RandomNearFoe
|
||||
end
|
||||
end
|
||||
@@ -166,7 +166,7 @@ class LineupAppearAnimation < PokeBattle_Animation
|
||||
if idxParty>=0 && idxParty<@party.length && @party[idxParty]
|
||||
if !@party[idxParty].able?
|
||||
graphicFilename = "Graphics/Pictures/Battle/icon_ball_faint"
|
||||
elsif @party[idxParty].status!=PBStatuses::NONE
|
||||
elsif @party[idxParty].status != :NONE
|
||||
graphicFilename = "Graphics/Pictures/Battle/icon_ball_status"
|
||||
else
|
||||
graphicFilename = "Graphics/Pictures/Battle/icon_ball"
|
||||
|
||||
@@ -245,9 +245,11 @@ class PokemonDataBox < SpriteWrapper
|
||||
imagePos.push(["Graphics/Pictures/Battle/icon_own",@spriteBaseX+8,36])
|
||||
end
|
||||
# Draw status icon
|
||||
if @battler.status>0
|
||||
s = @battler.status
|
||||
s = 6 if s==PBStatuses::POISON && @battler.statusCount>0 # Badly poisoned
|
||||
if @battler.status != :NONE
|
||||
s = GameData::Status.get(@battler.status).id_number
|
||||
if s == :POISON && @battler.statusCount > 0 # Badly poisoned
|
||||
s = GameData::Status::DATA.keys.length / 2
|
||||
end
|
||||
imagePos.push(["Graphics/Pictures/Battle/icon_statuses",@spriteBaseX+24,36,
|
||||
0,(s-1)*STATUS_ICON_HEIGHT,-1,STATUS_ICON_HEIGHT])
|
||||
end
|
||||
|
||||
@@ -94,7 +94,7 @@ class PokeBattle_BattlePalace < PokeBattle_Battle
|
||||
|
||||
def pbPinchChange(idxPokemon)
|
||||
thispkmn = @battlers[idxPokemon]
|
||||
if !thispkmn.effects[PBEffects::Pinch] && thispkmn.status!=PBStatuses::SLEEP &&
|
||||
if !thispkmn.effects[PBEffects::Pinch] && thispkmn.status != :SLEEP &&
|
||||
thispkmn.hp<=thispkmn.totalhp/2
|
||||
nature = thispkmn.nature
|
||||
thispkmn.effects[PBEffects::Pinch] = true
|
||||
@@ -222,11 +222,11 @@ class PokeBattle_AI
|
||||
factor = (maxpercent<hppercent) ? 30 : 50
|
||||
end
|
||||
case thispkmn.status
|
||||
when PBStatuses::SLEEP, PBStatuses::FROZEN
|
||||
when :SLEEP, :FROZEN
|
||||
factor += 20
|
||||
when PBStatuses::POISON, PBStatuses::BURN
|
||||
when :POISON, :BURN
|
||||
factor += 10
|
||||
when PBStatuses::PARALYSIS
|
||||
when :PARALYSIS
|
||||
factor += 15
|
||||
end
|
||||
if @justswitched[idxBattler]
|
||||
|
||||
@@ -62,7 +62,7 @@ class PokeBattle_Battler
|
||||
def pbCanSleep?(user,showMessages,move=nil,ignoreStatus=false)
|
||||
selfsleep = (user && user.index==@index)
|
||||
if ((@battle.rules["modifiedsleepclause"]) || (!selfsleep && @battle.rules["sleepclause"])) &&
|
||||
pbHasStatusPokemon?(PBStatuses::SLEEP)
|
||||
pbHasStatusPokemon?(:SLEEP)
|
||||
if showMessages
|
||||
@battle.pbDisplay(_INTL("But {1} couldn't sleep!",pbThis(true)))
|
||||
end
|
||||
@@ -73,14 +73,14 @@ class PokeBattle_Battler
|
||||
|
||||
def pbCanSleepYawn?
|
||||
if (@battle.rules["sleepclause"] || @battle.rules["modifiedsleepclause"]) &&
|
||||
pbHasStatusPokemon?(PBStatuses::SLEEP)
|
||||
pbHasStatusPokemon?(:SLEEP)
|
||||
return false
|
||||
end
|
||||
return __clauses__pbCanSleepYawn?
|
||||
end
|
||||
|
||||
def pbCanFreeze?(*arg)
|
||||
if @battle.rules["freezeclause"] && pbHasStatusPokemon?(PBStatuses::FROZEN)
|
||||
if @battle.rules["freezeclause"] && pbHasStatusPokemon?(:FROZEN)
|
||||
return false
|
||||
end
|
||||
return __clauses__pbCanFreeze?(*arg)
|
||||
|
||||
@@ -121,7 +121,7 @@ BattleHandlers::AbilityOnHPDroppedBelowHalf.copy(:EMERGENCYEXIT,:WIMPOUT)
|
||||
BattleHandlers::StatusCheckAbilityNonIgnorable.add(:COMATOSE,
|
||||
proc { |ability,battler,status|
|
||||
next false if !battler.isSpecies?(:KOMALA)
|
||||
next true if status.nil? || status==PBStatuses::SLEEP
|
||||
next true if status.nil? || status == :SLEEP
|
||||
}
|
||||
)
|
||||
|
||||
@@ -137,13 +137,13 @@ BattleHandlers::StatusImmunityAbility.add(:FLOWERVEIL,
|
||||
|
||||
BattleHandlers::StatusImmunityAbility.add(:IMMUNITY,
|
||||
proc { |ability,battler,status|
|
||||
next true if status==PBStatuses::POISON
|
||||
next true if status == :POISON
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::StatusImmunityAbility.add(:INSOMNIA,
|
||||
proc { |ability,battler,status|
|
||||
next true if status==PBStatuses::SLEEP
|
||||
next true if status == :SLEEP
|
||||
}
|
||||
)
|
||||
|
||||
@@ -158,19 +158,19 @@ BattleHandlers::StatusImmunityAbility.add(:LEAFGUARD,
|
||||
|
||||
BattleHandlers::StatusImmunityAbility.add(:LIMBER,
|
||||
proc { |ability,battler,status|
|
||||
next true if status==PBStatuses::PARALYSIS
|
||||
next true if status == :PARALYSIS
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::StatusImmunityAbility.add(:MAGMAARMOR,
|
||||
proc { |ability,battler,status|
|
||||
next true if status==PBStatuses::FROZEN
|
||||
next true if status == :FROZEN
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::StatusImmunityAbility.add(:WATERVEIL,
|
||||
proc { |ability,battler,status|
|
||||
next true if status==PBStatuses::BURN
|
||||
next true if status == :BURN
|
||||
}
|
||||
)
|
||||
|
||||
@@ -204,7 +204,7 @@ BattleHandlers::StatusImmunityAllyAbility.add(:FLOWERVEIL,
|
||||
|
||||
BattleHandlers::StatusImmunityAbility.add(:SWEETVEIL,
|
||||
proc { |ability,battler,status|
|
||||
next true if status==PBStatuses::SLEEP
|
||||
next true if status == :SLEEP
|
||||
}
|
||||
)
|
||||
|
||||
@@ -216,7 +216,7 @@ BattleHandlers::AbilityOnStatusInflicted.add(:SYNCHRONIZE,
|
||||
proc { |ability,battler,user,status|
|
||||
next if !user || user.index==battler.index
|
||||
case status
|
||||
when PBStatuses::POISON
|
||||
when :POISON
|
||||
if user.pbCanPoisonSynchronize?(battler)
|
||||
battler.battle.pbShowAbilitySplash(battler)
|
||||
msg = nil
|
||||
@@ -226,7 +226,7 @@ BattleHandlers::AbilityOnStatusInflicted.add(:SYNCHRONIZE,
|
||||
user.pbPoison(nil,msg,(battler.statusCount>0))
|
||||
battler.battle.pbHideAbilitySplash(battler)
|
||||
end
|
||||
when PBStatuses::BURN
|
||||
when :BURN
|
||||
if user.pbCanBurnSynchronize?(battler)
|
||||
battler.battle.pbShowAbilitySplash(battler)
|
||||
msg = nil
|
||||
@@ -236,7 +236,7 @@ BattleHandlers::AbilityOnStatusInflicted.add(:SYNCHRONIZE,
|
||||
user.pbBurn(nil,msg)
|
||||
battler.battle.pbHideAbilitySplash(battler)
|
||||
end
|
||||
when PBStatuses::PARALYSIS
|
||||
when :PARALYSIS
|
||||
if user.pbCanParalyzeSynchronize?(battler)
|
||||
battler.battle.pbShowAbilitySplash(battler)
|
||||
msg = nil
|
||||
@@ -257,7 +257,7 @@ BattleHandlers::AbilityOnStatusInflicted.add(:SYNCHRONIZE,
|
||||
|
||||
BattleHandlers::StatusCureAbility.add(:IMMUNITY,
|
||||
proc { |ability,battler|
|
||||
next if battler.status!=PBStatuses::POISON
|
||||
next if battler.status != :POISON
|
||||
battler.battle.pbShowAbilitySplash(battler)
|
||||
battler.pbCureStatus(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
|
||||
if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@@ -269,7 +269,7 @@ BattleHandlers::StatusCureAbility.add(:IMMUNITY,
|
||||
|
||||
BattleHandlers::StatusCureAbility.add(:INSOMNIA,
|
||||
proc { |ability,battler|
|
||||
next if battler.status!=PBStatuses::SLEEP
|
||||
next if battler.status != :SLEEP
|
||||
battler.battle.pbShowAbilitySplash(battler)
|
||||
battler.pbCureStatus(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
|
||||
if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@@ -283,7 +283,7 @@ BattleHandlers::StatusCureAbility.copy(:INSOMNIA,:VITALSPIRIT)
|
||||
|
||||
BattleHandlers::StatusCureAbility.add(:LIMBER,
|
||||
proc { |ability,battler|
|
||||
next if battler.status!=PBStatuses::PARALYSIS
|
||||
next if battler.status != :PARALYSIS
|
||||
battler.battle.pbShowAbilitySplash(battler)
|
||||
battler.pbCureStatus(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
|
||||
if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@@ -295,7 +295,7 @@ BattleHandlers::StatusCureAbility.add(:LIMBER,
|
||||
|
||||
BattleHandlers::StatusCureAbility.add(:MAGMAARMOR,
|
||||
proc { |ability,battler|
|
||||
next if battler.status!=PBStatuses::FROZEN
|
||||
next if battler.status != :FROZEN
|
||||
battler.battle.pbShowAbilitySplash(battler)
|
||||
battler.pbCureStatus(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
|
||||
if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@@ -349,7 +349,7 @@ BattleHandlers::StatusCureAbility.add(:OWNTEMPO,
|
||||
|
||||
BattleHandlers::StatusCureAbility.add(:WATERVEIL,
|
||||
proc { |ability,battler|
|
||||
next if battler.status!=PBStatuses::BURN
|
||||
next if battler.status != :BURN
|
||||
battler.battle.pbShowAbilitySplash(battler)
|
||||
battler.pbCureStatus(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
|
||||
if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@@ -1849,21 +1849,21 @@ BattleHandlers::EORHealingAbility.add(:HEALER,
|
||||
proc { |ability,battler,battle|
|
||||
next unless battle.pbRandom(100)<30
|
||||
battler.eachAlly do |b|
|
||||
next if b.status==PBStatuses::NONE
|
||||
next if b.status == :NONE
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
oldStatus = b.status
|
||||
b.pbCureStatus(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
|
||||
if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
case oldStatus
|
||||
when PBStatuses::SLEEP
|
||||
when :SLEEP
|
||||
battle.pbDisplay(_INTL("{1}'s {2} woke its partner up!",battler.pbThis,battler.abilityName))
|
||||
when PBStatuses::POISON
|
||||
when :POISON
|
||||
battle.pbDisplay(_INTL("{1}'s {2} cured its partner's poison!",battler.pbThis,battler.abilityName))
|
||||
when PBStatuses::BURN
|
||||
when :BURN
|
||||
battle.pbDisplay(_INTL("{1}'s {2} healed its partner's burn!",battler.pbThis,battler.abilityName))
|
||||
when PBStatuses::PARALYSIS
|
||||
when :PARALYSIS
|
||||
battle.pbDisplay(_INTL("{1}'s {2} cured its partner's paralysis!",battler.pbThis,battler.abilityName))
|
||||
when PBStatuses::FROZEN
|
||||
when :FROZEN
|
||||
battle.pbDisplay(_INTL("{1}'s {2} defrosted its partner!",battler.pbThis,battler.abilityName))
|
||||
end
|
||||
end
|
||||
@@ -1874,7 +1874,7 @@ BattleHandlers::EORHealingAbility.add(:HEALER,
|
||||
|
||||
BattleHandlers::EORHealingAbility.add(:HYDRATION,
|
||||
proc { |ability,battler,battle|
|
||||
next if battler.status==PBStatuses::NONE
|
||||
next if battler.status == :NONE
|
||||
curWeather = battle.pbWeather
|
||||
next if curWeather!=PBWeather::Rain && curWeather!=PBWeather::HeavyRain
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
@@ -1882,15 +1882,15 @@ BattleHandlers::EORHealingAbility.add(:HYDRATION,
|
||||
battler.pbCureStatus(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
|
||||
if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
case oldStatus
|
||||
when PBStatuses::SLEEP
|
||||
when :SLEEP
|
||||
battle.pbDisplay(_INTL("{1}'s {2} woke it up!",battler.pbThis,battler.abilityName))
|
||||
when PBStatuses::POISON
|
||||
when :POISON
|
||||
battle.pbDisplay(_INTL("{1}'s {2} cured its poison!",battler.pbThis,battler.abilityName))
|
||||
when PBStatuses::BURN
|
||||
when :BURN
|
||||
battle.pbDisplay(_INTL("{1}'s {2} healed its burn!",battler.pbThis,battler.abilityName))
|
||||
when PBStatuses::PARALYSIS
|
||||
when :PARALYSIS
|
||||
battle.pbDisplay(_INTL("{1}'s {2} cured its paralysis!",battler.pbThis,battler.abilityName))
|
||||
when PBStatuses::FROZEN
|
||||
when :FROZEN
|
||||
battle.pbDisplay(_INTL("{1}'s {2} defrosted it!",battler.pbThis,battler.abilityName))
|
||||
end
|
||||
end
|
||||
@@ -1900,22 +1900,22 @@ BattleHandlers::EORHealingAbility.add(:HYDRATION,
|
||||
|
||||
BattleHandlers::EORHealingAbility.add(:SHEDSKIN,
|
||||
proc { |ability,battler,battle|
|
||||
next if battler.status==PBStatuses::NONE
|
||||
next if battler.status == :NONE
|
||||
next unless battle.pbRandom(100)<30
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
oldStatus = battler.status
|
||||
battler.pbCureStatus(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
|
||||
if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
case oldStatus
|
||||
when PBStatuses::SLEEP
|
||||
when :SLEEP
|
||||
battle.pbDisplay(_INTL("{1}'s {2} woke it up!",battler.pbThis,battler.abilityName))
|
||||
when PBStatuses::POISON
|
||||
when :POISON
|
||||
battle.pbDisplay(_INTL("{1}'s {2} cured its poison!",battler.pbThis,battler.abilityName))
|
||||
when PBStatuses::BURN
|
||||
when :BURN
|
||||
battle.pbDisplay(_INTL("{1}'s {2} healed its burn!",battler.pbThis,battler.abilityName))
|
||||
when PBStatuses::PARALYSIS
|
||||
when :PARALYSIS
|
||||
battle.pbDisplay(_INTL("{1}'s {2} cured its paralysis!",battler.pbThis,battler.abilityName))
|
||||
when PBStatuses::FROZEN
|
||||
when :FROZEN
|
||||
battle.pbDisplay(_INTL("{1}'s {2} defrosted it!",battler.pbThis,battler.abilityName))
|
||||
end
|
||||
end
|
||||
@@ -2387,7 +2387,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:UNNERVE,
|
||||
BattleHandlers::AbilityOnSwitchOut.add(:NATURALCURE,
|
||||
proc { |ability,battler,endOfBattle|
|
||||
PBDebug.log("[Ability triggered] #{battler.pbThis}'s #{battler.abilityName}")
|
||||
battler.status = PBStatuses::NONE
|
||||
battler.status = :NONE
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ BattleHandlers::HPHealItem.add(:WIKIBERRY,
|
||||
BattleHandlers::StatusCureItem.add(:ASPEARBERRY,
|
||||
proc { |item,battler,battle,forced|
|
||||
next false if !forced && !battler.canConsumeBerry?
|
||||
next false if battler.status!=PBStatuses::FROZEN
|
||||
next false if battler.status != :FROZEN
|
||||
itemName = GameData::Item.get(item).name
|
||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
||||
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
||||
@@ -225,7 +225,7 @@ BattleHandlers::StatusCureItem.add(:ASPEARBERRY,
|
||||
BattleHandlers::StatusCureItem.add(:CHERIBERRY,
|
||||
proc { |item,battler,battle,forced|
|
||||
next false if !forced && !battler.canConsumeBerry?
|
||||
next false if battler.status!=PBStatuses::PARALYSIS
|
||||
next false if battler.status != :PARALYSIS
|
||||
itemName = GameData::Item.get(item).name
|
||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
||||
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
||||
@@ -238,7 +238,7 @@ BattleHandlers::StatusCureItem.add(:CHERIBERRY,
|
||||
BattleHandlers::StatusCureItem.add(:CHESTOBERRY,
|
||||
proc { |item,battler,battle,forced|
|
||||
next false if !forced && !battler.canConsumeBerry?
|
||||
next false if battler.status!=PBStatuses::SLEEP
|
||||
next false if battler.status != :SLEEP
|
||||
itemName = GameData::Item.get(item).name
|
||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
||||
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
||||
@@ -251,7 +251,7 @@ BattleHandlers::StatusCureItem.add(:CHESTOBERRY,
|
||||
BattleHandlers::StatusCureItem.add(:LUMBERRY,
|
||||
proc { |item,battler,battle,forced|
|
||||
next false if !forced && !battler.canConsumeBerry?
|
||||
next false if battler.status==PBStatuses::NONE &&
|
||||
next false if battler.status == :NONE &&
|
||||
battler.effects[PBEffects::Confusion]==0
|
||||
itemName = GameData::Item.get(item).name
|
||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
||||
@@ -264,15 +264,15 @@ BattleHandlers::StatusCureItem.add(:LUMBERRY,
|
||||
battle.pbDisplay(_INTL("{1} snapped out of its confusion.",battler.pbThis)) if oldConfusion
|
||||
else
|
||||
case oldStatus
|
||||
when PBStatuses::SLEEP
|
||||
when :SLEEP
|
||||
battle.pbDisplay(_INTL("{1}'s {2} woke it up!",battler.pbThis,itemName))
|
||||
when PBStatuses::POISON
|
||||
when :POISON
|
||||
battle.pbDisplay(_INTL("{1}'s {2} cured its poisoning!",battler.pbThis,itemName))
|
||||
when PBStatuses::BURN
|
||||
when :BURN
|
||||
battle.pbDisplay(_INTL("{1}'s {2} healed its burn!",battler.pbThis,itemName))
|
||||
when PBStatuses::PARALYSIS
|
||||
when :PARALYSIS
|
||||
battle.pbDisplay(_INTL("{1}'s {2} cured its paralysis!",battler.pbThis,itemName))
|
||||
when PBStatuses::FROZEN
|
||||
when :FROZEN
|
||||
battle.pbDisplay(_INTL("{1}'s {2} defrosted it!",battler.pbThis,itemName))
|
||||
end
|
||||
if oldConfusion
|
||||
@@ -321,7 +321,7 @@ BattleHandlers::StatusCureItem.add(:MENTALHERB,
|
||||
BattleHandlers::StatusCureItem.add(:PECHABERRY,
|
||||
proc { |item,battler,battle,forced|
|
||||
next false if !forced && !battler.canConsumeBerry?
|
||||
next false if battler.status!=PBStatuses::POISON
|
||||
next false if battler.status != :POISON
|
||||
itemName = GameData::Item.get(item).name
|
||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
||||
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
||||
@@ -352,7 +352,7 @@ BattleHandlers::StatusCureItem.add(:PERSIMBERRY,
|
||||
BattleHandlers::StatusCureItem.add(:RAWSTBERRY,
|
||||
proc { |item,battler,battle,forced|
|
||||
next false if !forced && !battler.canConsumeBerry?
|
||||
next false if battler.status!=PBStatuses::BURN
|
||||
next false if battler.status != :BURN
|
||||
itemName = GameData::Item.get(item).name
|
||||
PBDebug.log("[Item triggered] #{battler.pbThis}'s #{itemName}") if forced
|
||||
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
||||
|
||||
@@ -213,7 +213,7 @@ BallHandlers::ModifyCatchRate.add(:SPORTBALL,proc { |ball,catchRate,battle,battl
|
||||
})
|
||||
|
||||
BallHandlers::ModifyCatchRate.add(:DREAMBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||
catchRate *= 4 if battler.status==PBStatuses::SLEEP
|
||||
catchRate *= 4 if battler.status == :SLEEP
|
||||
next catchRate
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user