Fixed Liquid Ooze not applying if the bearer faints, fixed two-turn moves being used in one turn charging up after failing instead of before

This commit is contained in:
Maruno17
2022-11-05 17:48:01 +00:00
parent c984fda1cf
commit 096957bc20
5 changed files with 45 additions and 32 deletions

View File

@@ -34,7 +34,7 @@ class Battle::Battler
end
def pbRecoverHPFromDrain(amt, target, msg = nil)
if target.hasActiveAbility?(:LIQUIDOOZE)
if target.hasActiveAbility?(:LIQUIDOOZE, true)
@battle.pbShowAbilitySplash(target)
pbReduceHP(amt)
@battle.pbDisplay(_INTL("{1} sucked up the liquid ooze!", pbThis))

View File

@@ -363,6 +363,8 @@ class Battle::Battler
targets = pbFindTargets(choice, move, user)
end
end
# For two-turn moves when they charge and attack in the same turn
move.pbQuickChargingMove(user, targets)
#---------------------------------------------------------------------------
magicCoater = -1
magicBouncer = -1

View File

@@ -27,8 +27,8 @@ class Battle::Move
#=============================================================================
#
#=============================================================================
# Whether the move is currently in the "charging" turn of a two turn attack.
# Is false if Power Herb or another effect lets a two turn move charge and
# Whether the move is currently in the "charging" turn of a two-turn move.
# Is false if Power Herb or another effect lets a two-turn move charge and
# attack in the same turn.
# user.effects[PBEffects::TwoTurnAttack] is set to the move's ID during the
# charging turn, and is nil during the attack turn.
@@ -52,6 +52,9 @@ class Battle::Move
return 1
end
# For two-turn moves when they charge and attack in the same turn.
def pbQuickChargingMove(user, targets); end
#=============================================================================
# Effect methods per hit
#=============================================================================

View File

@@ -315,33 +315,41 @@ class Battle::Move::TwoTurnMove < Battle::Move
return super
end
# Does the charging part of this move, for when this move only takes one round
# to use.
def pbQuickChargingMove(user, targets)
return if !@chargingTurn || !@damagingTurn # Move only takes one turn to use
pbChargingTurnMessage(user, targets)
pbShowAnimation(@id, user, targets, 1) # Charging anim
targets.each { |b| pbChargingTurnEffect(user, b) }
if @powerHerb
# Moves that would make the user semi-invulnerable will hide the user
# after the charging animation, so the "UseItem" animation shouldn't show
# for it
if !["TwoTurnAttackInvulnerableInSky",
"TwoTurnAttackInvulnerableUnderground",
"TwoTurnAttackInvulnerableUnderwater",
"TwoTurnAttackInvulnerableInSkyParalyzeTarget",
"TwoTurnAttackInvulnerableRemoveProtections",
"TwoTurnAttackInvulnerableInSkyTargetCannotAct"].include?(@function)
@battle.pbCommonAnimation("UseItem", user)
end
@battle.pbDisplay(_INTL("{1} became fully charged due to its Power Herb!", user.pbThis))
user.pbConsumeItem
end
end
def pbAccuracyCheck(user, target)
return true if !@damagingTurn
return super
end
def pbInitialEffect(user, targets, hitNum)
pbChargingTurnMessage(user, targets) if @chargingTurn
if @chargingTurn && @damagingTurn # Move only takes one turn to use
pbShowAnimation(@id, user, targets, 1) # Charging anim
targets.each { |b| pbChargingTurnEffect(user, b) }
if @powerHerb
# Moves that would make the user semi-invulnerable will hide the user
# after the charging animation, so the "UseItem" animation shouldn't show
# for it
if !["TwoTurnAttackInvulnerableInSky",
"TwoTurnAttackInvulnerableUnderground",
"TwoTurnAttackInvulnerableUnderwater",
"TwoTurnAttackInvulnerableInSkyParalyzeTarget",
"TwoTurnAttackInvulnerableRemoveProtections",
"TwoTurnAttackInvulnerableInSkyTargetCannotAct"].include?(@function)
@battle.pbCommonAnimation("UseItem", user)
end
@battle.pbDisplay(_INTL("{1} became fully charged due to its Power Herb!", user.pbThis))
user.pbConsumeItem
end
if @damagingTurn
pbAttackingTurnMessage(user, targets)
elsif @chargingTurn
pbChargingTurnMessage(user, targets)
end
pbAttackingTurnMessage(user, targets) if @damagingTurn
end
def pbChargingTurnMessage(user, targets)
@@ -351,14 +359,6 @@ class Battle::Move::TwoTurnMove < Battle::Move
def pbAttackingTurnMessage(user, targets)
end
def pbChargingTurnEffect(user, target)
# Skull Bash/Sky Drop are the only two-turn moves with an effect here, and
# the latter just records the target is being Sky Dropped
end
def pbAttackingTurnEffect(user, target)
end
def pbEffectAgainstTarget(user, target)
if @damagingTurn
pbAttackingTurnEffect(user, target)
@@ -367,6 +367,14 @@ class Battle::Move::TwoTurnMove < Battle::Move
end
end
def pbChargingTurnEffect(user, target)
# Skull Bash/Sky Drop are the only two-turn moves with an effect here, and
# the latter just records the target is being Sky Dropped
end
def pbAttackingTurnEffect(user, target)
end
def pbShowAnimation(id, user, targets, hitNum = 0, showAnimation = true)
hitNum = 1 if @chargingTurn && !@damagingTurn # Charging anim
super

View File

@@ -141,7 +141,7 @@ class Battle::Move::HealUserByTargetAttackLowerTargetAttack1 < Battle::Move
target.pbLowerStatStage(:ATTACK, 1, user)
end
# Heal user
if target.hasActiveAbility?(:LIQUIDOOZE)
if target.hasActiveAbility?(:LIQUIDOOZE, true)
@battle.pbShowAbilitySplash(target)
user.pbReduceHP(healAmt)
@battle.pbDisplay(_INTL("{1} sucked up the liquid ooze!", user.pbThis))