mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-01-24 23:35:59 +00:00
Coded some Gen 9 ability/item/move effects
This commit is contained in:
@@ -462,13 +462,19 @@ Battle::AbilityEffects::StatusImmunity.add(:MAGMAARMOR,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::StatusImmunity.add(:PURIFYINGSALT,
|
||||
proc { |ability, battler, status|
|
||||
next true
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::StatusImmunity.add(:WATERVEIL,
|
||||
proc { |ability, battler, status|
|
||||
next true if status == :BURN
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::StatusImmunity.copy(:WATERVEIL, :WATERBUBBLE)
|
||||
Battle::AbilityEffects::StatusImmunity.copy(:WATERVEIL, :THERMALEXCHANGE, :WATERBUBBLE)
|
||||
|
||||
#===============================================================================
|
||||
# StatusImmunityNonIgnorable handlers
|
||||
@@ -661,7 +667,7 @@ Battle::AbilityEffects::StatusCure.add(:WATERVEIL,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::StatusCure.copy(:WATERVEIL, :WATERBUBBLE)
|
||||
Battle::AbilityEffects::StatusCure.copy(:WATERVEIL, :THERMALEXCHANGE, :WATERBUBBLE)
|
||||
|
||||
#===============================================================================
|
||||
# StatLossImmunity handlers
|
||||
@@ -751,6 +757,8 @@ Battle::AbilityEffects::StatLossImmunity.add(:KEENEYE,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::StatLossImmunity.copy(:KEENEYE, :MINDSEYE)
|
||||
|
||||
#===============================================================================
|
||||
# StatLossImmunityNonIgnorable handlers
|
||||
#===============================================================================
|
||||
@@ -916,6 +924,12 @@ Battle::AbilityEffects::MoveImmunity.add(:BULLETPROOF,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::MoveImmunity.add(:EARTHEATER,
|
||||
proc { |ability, user, target, move, type, battle, show_message|
|
||||
next target.pbMoveImmunityHealingAbility(user, move, type, :GROUND, show_message)
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::MoveImmunity.add(:FLASHFIRE,
|
||||
proc { |ability, user, target, move, type, battle, show_message|
|
||||
next false if user.index == target.index
|
||||
@@ -1019,6 +1033,36 @@ Battle::AbilityEffects::MoveImmunity.add(:WATERABSORB,
|
||||
|
||||
Battle::AbilityEffects::MoveImmunity.copy(:WATERABSORB, :DRYSKIN)
|
||||
|
||||
Battle::AbilityEffects::MoveImmunity.add(:WELLBAKEDBODY,
|
||||
proc { |ability, user, target, move, type, battle, show_message|
|
||||
next target.pbMoveImmunityStatRaisingAbility(user, move, type,
|
||||
:FIRE, :DEFENSE, 2, show_message)
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::MoveImmunity.add(:WINDRIDER,
|
||||
proc { |ability, user, target, move, type, battle, show_message|
|
||||
next false if user.index == target.index
|
||||
next false if !move.windMove?
|
||||
if show_message
|
||||
battle.pbShowAbilitySplash(target)
|
||||
if target.pbCanRaiseStatStage?(:ATTACK, target)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
target.pbRaiseStatStage(:ATTACK, 1, target)
|
||||
else
|
||||
target.pbRaiseStatStageByCause(:ATTACK, 1, target, target.abilityName)
|
||||
end
|
||||
elsif Battle::Scene::USE_ABILITY_SPLASH
|
||||
battle.pbDisplay(_INTL("It doesn't affect {1}...", target.pbThis(true)))
|
||||
else
|
||||
battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!", target.pbThis, target.abilityName, move.name))
|
||||
end
|
||||
battle.pbHideAbilitySplash(target)
|
||||
end
|
||||
next true
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::MoveImmunity.add(:WONDERGUARD,
|
||||
proc { |ability, user, target, move, type, battle, show_message|
|
||||
next false if move.statusMove?
|
||||
@@ -1351,6 +1395,12 @@ Battle::AbilityEffects::DamageCalcFromUser.add(:RIVALRY,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::DamageCalcFromUser.add(:ROCKYPAYLOAD,
|
||||
proc { |ability, user, target, move, mults, power, type|
|
||||
mults[:attack_multiplier] *= 1.5 if type == :ROCK
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::DamageCalcFromUser.add(:SANDFORCE,
|
||||
proc { |ability, user, target, move, mults, power, type|
|
||||
if user.effectiveWeather == :Sandstorm &&
|
||||
@@ -1360,6 +1410,12 @@ Battle::AbilityEffects::DamageCalcFromUser.add(:SANDFORCE,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::DamageCalcFromUser.add(:SHARPNESS,
|
||||
proc { |ability, user, target, move, mults, power, type|
|
||||
mults[:power_multiplier] *= 1.5 if move.slicingMove?
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::DamageCalcFromUser.add(:SHEERFORCE,
|
||||
proc { |ability, user, target, move, mults, power, type|
|
||||
mults[:power_multiplier] *= 1.3 if move.addlEffect > 0
|
||||
@@ -1443,7 +1499,7 @@ Battle::AbilityEffects::DamageCalcFromUser.add(:TORRENT,
|
||||
|
||||
Battle::AbilityEffects::DamageCalcFromUser.add(:TOUGHCLAWS,
|
||||
proc { |ability, user, target, move, mults, power, type|
|
||||
mults[:power_multiplier] *= 4 / 3.0 if move.contactMove?
|
||||
mults[:power_multiplier] *= 4 / 3.0 if move.pbContactMove?(user)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1578,6 +1634,12 @@ Battle::AbilityEffects::DamageCalcFromTarget.add(:PUNKROCK,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::DamageCalcFromTarget.add(:PURIFYINGSALT,
|
||||
proc { |ability, user, target, move, mults, power, type|
|
||||
mults[:attack_multiplier] /= 2 if move.calcType == :GHOST
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::DamageCalcFromTarget.add(:THICKFAT,
|
||||
proc { |ability, user, target, move, mults, power, type|
|
||||
mults[:power_multiplier] /= 2 if [:FIRE, :ICE].include?(type)
|
||||
@@ -1663,20 +1725,18 @@ Battle::AbilityEffects::OnBeingHit.add(:AFTERMATH,
|
||||
next if !target.fainted?
|
||||
next if !move.pbContactMove?(user)
|
||||
battle.pbShowAbilitySplash(target)
|
||||
if !battle.moldBreaker
|
||||
dampBattler = battle.pbCheckGlobalAbility(:DAMP)
|
||||
if dampBattler
|
||||
battle.pbShowAbilitySplash(dampBattler)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
battle.pbDisplay(_INTL("{1} cannot use {2}!", target.pbThis, target.abilityName))
|
||||
else
|
||||
battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!",
|
||||
target.pbThis, target.abilityName, dampBattler.pbThis(true), dampBattler.abilityName))
|
||||
end
|
||||
battle.pbHideAbilitySplash(dampBattler)
|
||||
battle.pbHideAbilitySplash(target)
|
||||
next
|
||||
dampBattler = battle.pbCheckGlobalAbility(:DAMP, true)
|
||||
if dampBattler
|
||||
battle.pbShowAbilitySplash(dampBattler)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
battle.pbDisplay(_INTL("{1} cannot use {2}!", target.pbThis, target.abilityName))
|
||||
else
|
||||
battle.pbDisplay(_INTL("{1} cannot use {2} because of {3}'s {4}!",
|
||||
target.pbThis, target.abilityName, dampBattler.pbThis(true), dampBattler.abilityName))
|
||||
end
|
||||
battle.pbHideAbilitySplash(dampBattler)
|
||||
battle.pbHideAbilitySplash(target)
|
||||
next
|
||||
end
|
||||
if user.takesIndirectDamage?(Battle::Scene::USE_ABILITY_SPLASH) &&
|
||||
user.affectedByContactEffect?(Battle::Scene::USE_ABILITY_SPLASH)
|
||||
@@ -1922,6 +1982,8 @@ Battle::AbilityEffects::OnBeingHit.add(:MUMMY,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnBeingHit.copy(:MUMMY, :LINGERINGAROMA)
|
||||
|
||||
Battle::AbilityEffects::OnBeingHit.add(:PERISHBODY,
|
||||
proc { |ability, user, target, move, battle|
|
||||
next if !move.pbContactMove?(user)
|
||||
@@ -1980,6 +2042,15 @@ Battle::AbilityEffects::OnBeingHit.add(:STAMINA,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnBeingHit.add(:SEEDSOWER,
|
||||
proc { |ability, user, target, move, battle|
|
||||
next if battle.field.terrain == :Grassy
|
||||
battle.pbShowAbilitySplash(target)
|
||||
battle.pbStartTerrain(target, :Grassy)
|
||||
# NOTE: The ability splash is hidden again in def pbStartTerrain.
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnBeingHit.add(:STATIC,
|
||||
proc { |ability, user, target, move, battle|
|
||||
next if !move.pbContactMove?(user)
|
||||
@@ -1998,6 +2069,30 @@ Battle::AbilityEffects::OnBeingHit.add(:STATIC,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnBeingHit.add(:THERMALEXCHANGE,
|
||||
proc { |ability, user, target, move, battle|
|
||||
next if move.calcType != :FIRE
|
||||
target.pbRaiseStatStageByAbility(:ATTACK, 1, target)
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnBeingHit.add(:TOXICDEBRIS,
|
||||
proc { |ability, user, target, move, battle|
|
||||
next if !move.physicalMove?
|
||||
next if target.pbOpposingSide.effects[PBEffects::ToxicSpikes] >= 2
|
||||
battle.pbShowAbilitySplash(target)
|
||||
target.pbOpposingSide.effects[PBEffects::ToxicSpikes] += 1
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
battle.pbDisplay(_INTL("Poison spikes were scattered all around {1}'s feet!",
|
||||
target.pbOpposingTeam(true)))
|
||||
else
|
||||
battle.pbDisplay(_INTL("{1}'s {2} scattered poison spikes all around {3}'s feet!",
|
||||
target.pbThis, target.abilityName, target.pbOpposingTeam(true)))
|
||||
end
|
||||
battle.pbHideAbilitySplash(target)
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnBeingHit.add(:WANDERINGSPIRIT,
|
||||
proc { |ability, user, target, move, battle|
|
||||
next if !move.pbContactMove?(user)
|
||||
@@ -2060,10 +2155,10 @@ Battle::AbilityEffects::OnBeingHit.add(:WEAKARMOR,
|
||||
|
||||
Battle::AbilityEffects::OnDealingHit.add(:POISONTOUCH,
|
||||
proc { |ability, user, target, move, battle|
|
||||
next if !move.contactMove?
|
||||
next if !move.pbContactMove?(user)
|
||||
next if battle.pbRandom(100) >= 30
|
||||
battle.pbShowAbilitySplash(user)
|
||||
if target.hasActiveAbility?(:SHIELDDUST) && !battle.moldBreaker
|
||||
if target.hasActiveAbility?(:SHIELDDUST) && !target.being_mold_broken?
|
||||
battle.pbShowAbilitySplash(target)
|
||||
if !Battle::Scene::USE_ABILITY_SPLASH
|
||||
battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis))
|
||||
@@ -2080,6 +2175,27 @@ Battle::AbilityEffects::OnDealingHit.add(:POISONTOUCH,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnDealingHit.add(:TOXICCHAIN,
|
||||
proc { |ability, user, target, move, battle|
|
||||
next if battle.pbRandom(100) >= 30
|
||||
battle.pbShowAbilitySplash(user)
|
||||
if target.hasActiveAbility?(:SHIELDDUST) && !target.being_mold_broken?
|
||||
battle.pbShowAbilitySplash(target)
|
||||
if !Battle::Scene::USE_ABILITY_SPLASH
|
||||
battle.pbDisplay(_INTL("{1} is unaffected!", target.pbThis))
|
||||
end
|
||||
battle.pbHideAbilitySplash(target)
|
||||
elsif target.pbCanPoison?(user, Battle::Scene::USE_ABILITY_SPLASH)
|
||||
msg = nil
|
||||
if !Battle::Scene::USE_ABILITY_SPLASH
|
||||
msg = _INTL("{1}'s {2} badly poisoned {3}!", user.pbThis, user.abilityName, target.pbThis(true))
|
||||
end
|
||||
target.pbPoison(user, msg, true)
|
||||
end
|
||||
battle.pbHideAbilitySplash(user)
|
||||
}
|
||||
)
|
||||
|
||||
#===============================================================================
|
||||
# OnEndOfUsingMove handlers
|
||||
#===============================================================================
|
||||
@@ -2215,7 +2331,7 @@ Battle::AbilityEffects::AfterMoveUseFromTarget.add(:PICKPOCKET,
|
||||
# sense, so this code doesn't do it.
|
||||
next if target.wild?
|
||||
next if switched_battlers.include?(user.index) # User was switched out
|
||||
next if !move.contactMove?
|
||||
next if !move.pbContactMove?(user)
|
||||
next if user.effects[PBEffects::Substitute] > 0 || target.damageState.substitute
|
||||
next if target.item || !user.item
|
||||
next if user.unlosableItem?(user.item) || target.unlosableItem?(user.item)
|
||||
@@ -3057,6 +3173,13 @@ Battle::AbilityEffects::OnSwitchIn.add(:UNNERVE,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::AbilityEffects::OnSwitchIn.add(:WINDRIDER,
|
||||
proc { |ability, battler, battle, switch_in|
|
||||
next if battler.pbOwnSide.effects[PBEffects::Tailwind] == 0
|
||||
battler.pbRaiseStatStageByAbility(:ATTACK, 1, battler)
|
||||
}
|
||||
)
|
||||
|
||||
#===============================================================================
|
||||
# OnSwitchOut handlers
|
||||
#===============================================================================
|
||||
|
||||
@@ -9,6 +9,8 @@ module Battle::ItemEffects
|
||||
OnStatLoss = ItemHandlerHash.new
|
||||
# Battler's status problem
|
||||
StatusCure = ItemHandlerHash.new
|
||||
# Battler's stat stages
|
||||
StatLossImmunity = ItemHandlerHash.new
|
||||
# Priority and turn order
|
||||
PriorityBracketChange = ItemHandlerHash.new
|
||||
PriorityBracketUse = ItemHandlerHash.new
|
||||
@@ -83,6 +85,12 @@ module Battle::ItemEffects
|
||||
|
||||
#=============================================================================
|
||||
|
||||
def self.triggerStatLossImmunity(item, battler, stat, battle, show_messages)
|
||||
return trigger(StatLossImmunity, item, battler, stat, battle, show_messages)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
|
||||
def self.triggerPriorityBracketChange(item, battler, battle)
|
||||
return trigger(PriorityBracketChange, item, battler, battle, ret: 0)
|
||||
end
|
||||
@@ -627,6 +635,18 @@ Battle::ItemEffects::StatusCure.add(:RAWSTBERRY,
|
||||
}
|
||||
)
|
||||
|
||||
#===============================================================================
|
||||
# StatLossImmunity handlers
|
||||
#===============================================================================
|
||||
|
||||
Battle::ItemEffects::StatLossImmunity.add(:CLEARAMULET,
|
||||
proc { |item, battler, stat, battle, showMessages|
|
||||
battle.pbDisplay(_INTL("The effects of {1}'s {2} prevent its stats from being lowered!",
|
||||
battler.pbThis, GameData::Item.get(item).name)) if showMessages
|
||||
next true
|
||||
}
|
||||
)
|
||||
|
||||
#===============================================================================
|
||||
# PriorityBracketChange handlers
|
||||
#===============================================================================
|
||||
@@ -730,6 +750,8 @@ Battle::ItemEffects::DamageCalcFromUser.add(:ADAMANTORB,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::ItemEffects::DamageCalcFromUser.copy(:ADAMANTORB, :ADAMANTCRYSTAL)
|
||||
|
||||
Battle::ItemEffects::DamageCalcFromUser.add(:BLACKBELT,
|
||||
proc { |item, user, target, move, mults, power, type|
|
||||
mults[:power_multiplier] *= 1.2 if type == :FIGHTING
|
||||
@@ -772,6 +794,14 @@ Battle::ItemEffects::DamageCalcFromUser.add(:CHOICESPECS,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::ItemEffects::DamageCalcFromUser.add(:CORNERSTONEMASK,
|
||||
proc { |item, user, target, move, mults, power, type|
|
||||
mults[:power_multiplier] *= 1.2 if user.isSpecies?(:OGERPON)
|
||||
}
|
||||
)
|
||||
|
||||
Battle::ItemEffects::DamageCalcFromUser.copy(:CORNERSTONEMASK, :HEARTHFLAMEEMASK, :WELLSPRINGMASK)
|
||||
|
||||
Battle::ItemEffects::DamageCalcFromUser.add(:DARKGEM,
|
||||
proc { |item, user, target, move, mults, power, type|
|
||||
user.pbMoveTypePoweringUpGem(:DARK, move, type, mults)
|
||||
@@ -858,6 +888,8 @@ Battle::ItemEffects::DamageCalcFromUser.add(:GRISEOUSORB,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::ItemEffects::DamageCalcFromUser.copy(:GRISEOUSORB, :GRISEOUSCORE)
|
||||
|
||||
Battle::ItemEffects::DamageCalcFromUser.add(:GROUNDGEM,
|
||||
proc { |item, user, target, move, mults, power, type|
|
||||
user.pbMoveTypePoweringUpGem(:GROUND, move, type, mults)
|
||||
@@ -900,6 +932,8 @@ Battle::ItemEffects::DamageCalcFromUser.add(:LUSTROUSORB,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::ItemEffects::DamageCalcFromUser.copy(:LUSTROUSORB, :LUSTROUSGLOBE)
|
||||
|
||||
Battle::ItemEffects::DamageCalcFromUser.add(:MAGNET,
|
||||
proc { |item, user, target, move, mults, power, type|
|
||||
mults[:power_multiplier] *= 1.2 if type == :ELECTRIC
|
||||
@@ -987,6 +1021,12 @@ Battle::ItemEffects::DamageCalcFromUser.add(:PSYCHICGEM,
|
||||
}
|
||||
)
|
||||
|
||||
Battle::ItemEffects::DamageCalcFromUser.add(:PUNCHINGGLOVE,
|
||||
proc { |item, user, target, move, mults, power, type|
|
||||
mults[:power_multiplier] *= 1.1 if move.punchingMove?
|
||||
}
|
||||
)
|
||||
|
||||
Battle::ItemEffects::DamageCalcFromUser.add(:ROCKGEM,
|
||||
proc { |item, user, target, move, mults, power, type|
|
||||
user.pbMoveTypePoweringUpGem(:ROCK, move, type, mults)
|
||||
@@ -1551,7 +1591,7 @@ Battle::ItemEffects::AfterMoveUseFromTarget.add(:REDCARD,
|
||||
battle.pbDisplay(_INTL("{1} held up its {2} against {3}!",
|
||||
battler.pbThis, battler.itemName, user.pbThis(true)))
|
||||
battler.pbConsumeItem
|
||||
if user.hasActiveAbility?(:SUCTIONCUPS) && !battle.moldBreaker
|
||||
if user.hasActiveAbility?(:SUCTIONCUPS) && !user.being_mold_broken?
|
||||
battle.pbShowAbilitySplash(user)
|
||||
if Battle::Scene::USE_ABILITY_SPLASH
|
||||
battle.pbDisplay(_INTL("{1} anchors itself!", user.pbThis))
|
||||
|
||||
Reference in New Issue
Block a user