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 end
def pbRecoverHPFromDrain(amt, target, msg = nil) def pbRecoverHPFromDrain(amt, target, msg = nil)
if target.hasActiveAbility?(:LIQUIDOOZE) if target.hasActiveAbility?(:LIQUIDOOZE, true)
@battle.pbShowAbilitySplash(target) @battle.pbShowAbilitySplash(target)
pbReduceHP(amt) pbReduceHP(amt)
@battle.pbDisplay(_INTL("{1} sucked up the liquid ooze!", pbThis)) @battle.pbDisplay(_INTL("{1} sucked up the liquid ooze!", pbThis))

View File

@@ -363,6 +363,8 @@ class Battle::Battler
targets = pbFindTargets(choice, move, user) targets = pbFindTargets(choice, move, user)
end end
end end
# For two-turn moves when they charge and attack in the same turn
move.pbQuickChargingMove(user, targets)
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
magicCoater = -1 magicCoater = -1
magicBouncer = -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. # 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 # Is false if Power Herb or another effect lets a two-turn move charge and
# attack in the same turn. # attack in the same turn.
# user.effects[PBEffects::TwoTurnAttack] is set to the move's ID during the # user.effects[PBEffects::TwoTurnAttack] is set to the move's ID during the
# charging turn, and is nil during the attack turn. # charging turn, and is nil during the attack turn.
@@ -52,6 +52,9 @@ class Battle::Move
return 1 return 1
end end
# For two-turn moves when they charge and attack in the same turn.
def pbQuickChargingMove(user, targets); end
#============================================================================= #=============================================================================
# Effect methods per hit # Effect methods per hit
#============================================================================= #=============================================================================

View File

@@ -315,33 +315,41 @@ class Battle::Move::TwoTurnMove < Battle::Move
return super return super
end 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) def pbAccuracyCheck(user, target)
return true if !@damagingTurn return true if !@damagingTurn
return super return super
end end
def pbInitialEffect(user, targets, hitNum) def pbInitialEffect(user, targets, hitNum)
pbChargingTurnMessage(user, targets) if @chargingTurn if @damagingTurn
if @chargingTurn && @damagingTurn # Move only takes one turn to use pbAttackingTurnMessage(user, targets)
pbShowAnimation(@id, user, targets, 1) # Charging anim elsif @chargingTurn
targets.each { |b| pbChargingTurnEffect(user, b) } pbChargingTurnMessage(user, targets)
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 end
pbAttackingTurnMessage(user, targets) if @damagingTurn
end end
def pbChargingTurnMessage(user, targets) def pbChargingTurnMessage(user, targets)
@@ -351,14 +359,6 @@ class Battle::Move::TwoTurnMove < Battle::Move
def pbAttackingTurnMessage(user, targets) def pbAttackingTurnMessage(user, targets)
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 pbEffectAgainstTarget(user, target) def pbEffectAgainstTarget(user, target)
if @damagingTurn if @damagingTurn
pbAttackingTurnEffect(user, target) pbAttackingTurnEffect(user, target)
@@ -367,6 +367,14 @@ class Battle::Move::TwoTurnMove < Battle::Move
end end
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) def pbShowAnimation(id, user, targets, hitNum = 0, showAnimation = true)
hitNum = 1 if @chargingTurn && !@damagingTurn # Charging anim hitNum = 1 if @chargingTurn && !@damagingTurn # Charging anim
super super

View File

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