Coded some Gen 9 ability/item/move effects

This commit is contained in:
Maruno17
2024-06-15 15:58:31 +01:00
parent 454d5a216a
commit 22b33ca6c2
35 changed files with 596 additions and 234 deletions

View File

@@ -37,6 +37,7 @@ class Battle::Move
def pbContactMove?(user)
return false if user.hasActiveAbility?(:LONGREACH)
return false if punchingMove? && user.hasActiveItem?(:PUNCHINGGLOVE)
return contactMove?
end
@@ -86,9 +87,8 @@ class Battle::Move
# Check if target is immune to the move because of its ability
#=============================================================================
def pbImmunityByAbility(user, target, show_message)
return false if @battle.moldBreaker
ret = false
if target.abilityActive?
if target.abilityActive? && !target.beingMoldBroken?
ret = Battle::AbilityEffects.triggerMoveImmunity(target.ability, user, target,
self, @calcType, @battle, show_message)
end
@@ -126,8 +126,7 @@ class Battle::Move
end
def pbMoveFailedAromaVeil?(user, target, showMessage = true)
return false if @battle.moldBreaker
if target.hasActiveAbility?(:AROMAVEIL)
if target.hasActiveAbility?(:AROMAVEIL) && !target.beingMoldBroken?
if showMessage
@battle.pbShowAbilitySplash(target)
if Battle::Scene::USE_ABILITY_SPLASH
@@ -141,7 +140,7 @@ class Battle::Move
return true
end
target.allAllies.each do |b|
next if !b.hasActiveAbility?(:AROMAVEIL)
next if !b.hasActiveAbility?(:AROMAVEIL) || b.beingMoldBroken?
if showMessage
@battle.pbShowAbilitySplash(b)
if Battle::Scene::USE_ABILITY_SPLASH
@@ -168,13 +167,13 @@ class Battle::Move
return
end
# Ice Face will take the damage
if !@battle.moldBreaker && target.isSpecies?(:EISCUE) &&
if !target.beingMoldBroken? && target.isSpecies?(:EISCUE) &&
target.form == 0 && target.ability == :ICEFACE && physicalMove?
target.damageState.iceFace = true
return
end
# Disguise will take the damage
if !@battle.moldBreaker && target.isSpecies?(:MIMIKYU) &&
if !target.beingMoldBroken? && target.isSpecies?(:MIMIKYU) &&
target.form == 0 && target.ability == :DISGUISE
target.damageState.disguise = true
return
@@ -202,7 +201,7 @@ class Battle::Move
target.damageState.endured = true
damage -= 1
elsif damage == target.totalhp
if target.hasActiveAbility?(:STURDY) && !@battle.moldBreaker
if target.hasActiveAbility?(:STURDY) && !target.beingMoldBroken?
target.damageState.sturdy = true
damage -= 1
elsif target.hasActiveItem?(:FOCUSSASH) && target.hp == target.totalhp