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

@@ -125,7 +125,7 @@ class Battle::Move::HealUserByTargetAttackLowerTargetAttack1 < Battle::Move
# has Contrary and is at +6" check too for symmetry. This move still
# works even if the stat stage cannot be changed due to an ability or
# other effect.
if !@battle.moldBreaker && target.hasActiveAbility?(:CONTRARY)
if target.hasActiveAbility?(:CONTRARY) && !target.beingMoldBroken?
if target.statStageAtMax?(@statDown[0])
@battle.pbDisplay(_INTL("But it failed!")) if show_message
return true
@@ -469,19 +469,17 @@ class Battle::Move::UserLosesHalfOfTotalHPExplosive < Battle::Move
def worksWithNoTargets?; return true; end
def pbMoveFailed?(user, targets)
if !@battle.moldBreaker
bearer = @battle.pbCheckGlobalAbility(:DAMP)
if bearer
@battle.pbShowAbilitySplash(bearer)
if Battle::Scene::USE_ABILITY_SPLASH
@battle.pbDisplay(_INTL("{1} cannot use {2}!", user.pbThis, @name))
else
@battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!",
user.pbThis, @name, bearer.pbThis(true), bearer.abilityName))
end
@battle.pbHideAbilitySplash(bearer)
return true
bearer = @battle.pbCheckGlobalAbility(:DAMP, true)
if bearer
@battle.pbShowAbilitySplash(bearer)
if Battle::Scene::USE_ABILITY_SPLASH
@battle.pbDisplay(_INTL("{1} cannot use {2}!", user.pbThis, @name))
else
@battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!",
user.pbThis, @name, bearer.pbThis(true), bearer.abilityName))
end
@battle.pbHideAbilitySplash(bearer)
return true
end
return false
end
@@ -501,19 +499,17 @@ class Battle::Move::UserFaintsExplosive < Battle::Move
def pbNumHits(user, targets); return 1; end
def pbMoveFailed?(user, targets)
if !@battle.moldBreaker
bearer = @battle.pbCheckGlobalAbility(:DAMP)
if bearer
@battle.pbShowAbilitySplash(bearer)
if Battle::Scene::USE_ABILITY_SPLASH
@battle.pbDisplay(_INTL("{1} cannot use {2}!", user.pbThis, @name))
else
@battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!",
user.pbThis, @name, bearer.pbThis(true), bearer.abilityName))
end
@battle.pbHideAbilitySplash(bearer)
return true
bearer = @battle.pbCheckGlobalAbility(:DAMP, true)
if bearer
@battle.pbShowAbilitySplash(bearer)
if Battle::Scene::USE_ABILITY_SPLASH
@battle.pbDisplay(_INTL("{1} cannot use {2}!", user.pbThis, @name))
else
@battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!",
user.pbThis, @name, bearer.pbThis(true), bearer.abilityName))
end
@battle.pbHideAbilitySplash(bearer)
return true
end
return false
end