Healing Wish/Lunar Dance now linger until they will do something, as per Gen 8

This commit is contained in:
Maruno17
2021-08-30 00:38:06 +01:00
parent c92bb2fb42
commit 0405497868
4 changed files with 40 additions and 20 deletions

View File

@@ -24,6 +24,40 @@ class PokeBattle_Battler
pbAbilityStatusCureCheck
end
#=============================================================================
# Called when a Pokémon enters battle, and when Ally Switch is used.
#=============================================================================
def pbEffectsOnEnteringPosition
position = @battle.positions[@index]
# Healing Wish
if position.effects[PBEffects::HealingWish]
if canHeal? || self.status != :NONE
@battle.pbCommonAnimation("HealingWish", self)
@battle.pbDisplay(_INTL("The healing wish came true for {1}!", pbThis(true)))
pbRecoverHP(@totalhp)
pbCureStatus(false)
position.effects[PBEffects::HealingWish] = false
elsif Settings::MECHANICS_GENERATION < 8
position.effects[PBEffects::HealingWish] = false
end
end
# Lunar Dance
if position.effects[PBEffects::LunarDance]
full_pp = true
eachMove { |m| full_pp = false if m.pp < m.total_pp }
if canHeal? || self.status != :NONE || !full_pp
@battle.pbCommonAnimation("LunarDance", self)
@battle.pbDisplay(_INTL("{1} became cloaked in mystical moonlight!", pbThis))
pbRecoverHP(@totalhp)
pbCureStatus(false)
eachMove { |m| m.pp = m.total_pp }
position.effects[PBEffects::LunarDance] = false
elsif Settings::MECHANICS_GENERATION < 8
position.effects[PBEffects::LunarDance] = false
end
end
end
#=============================================================================
# Ability effects
#=============================================================================

View File

@@ -933,6 +933,7 @@ class PokeBattle_Move_120 < PokeBattle_Move
if @battle.pbSwapBattlers(idxA,idxB)
@battle.pbDisplay(_INTL("{1} and {2} switched places!",
@battle.battlers[idxB].pbThis,@battle.battlers[idxA].pbThis(true)))
[idxA, idxB].each { |idx| @battle.battlers[idx].pbEffectsOnEnteringPosition }
end
end
end

View File

@@ -327,23 +327,8 @@ class PokeBattle_Battle
end
# Update battlers' participants (who will gain Exp/EVs when a battler faints)
eachBattler { |b| b.pbUpdateParticipants }
# Healing Wish
if @positions[battler.index].effects[PBEffects::HealingWish]
pbCommonAnimation("HealingWish",battler)
pbDisplay(_INTL("The healing wish came true for {1}!",battler.pbThis(true)))
battler.pbRecoverHP(battler.totalhp)
battler.pbCureStatus(false)
@positions[battler.index].effects[PBEffects::HealingWish] = false
end
# Lunar Dance
if @positions[battler.index].effects[PBEffects::LunarDance]
pbCommonAnimation("LunarDance",battler)
pbDisplay(_INTL("{1} became cloaked in mystical moonlight!",battler.pbThis))
battler.pbRecoverHP(battler.totalhp)
battler.pbCureStatus(false)
battler.eachMove { |m| m.pp = m.total_pp }
@positions[battler.index].effects[PBEffects::LunarDance] = false
end
# Healing Wish/Lunar Dance
battler.pbEffectsOnEnteringPosition
# Entry hazards
# Stealth Rock
if battler.pbOwnSide.effects[PBEffects::StealthRock] && battler.takesIndirectDamage? &&