mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-10 06:34:59 +00:00
Added effects of Mimicry/Room Service/Catching Charm, tweaked Sinistea's form chances, fixed bug in Fling about TRs.
This commit is contained in:
@@ -1719,8 +1719,8 @@ BattleHandlers::TargetAbilityAfterMoveUse.add(:COLORCHANGE,
|
||||
typeName = GameData::Type.get(move.calcType).name
|
||||
battle.pbShowAbilitySplash(target)
|
||||
target.pbChangeTypes(move.calcType)
|
||||
battle.pbDisplay(_INTL("{1}'s {2} made it the {3} type!",target.pbThis,
|
||||
target.abilityName,typeName))
|
||||
battle.pbDisplay(_INTL("{1}'s type changed to {2} because of its {3}!",
|
||||
target.pbThis, typeName, target.abilityName))
|
||||
battle.pbHideAbilitySplash(target)
|
||||
}
|
||||
)
|
||||
@@ -2475,6 +2475,43 @@ BattleHandlers::AbilityOnBattlerFainting.add(:SOULHEART,
|
||||
}
|
||||
)
|
||||
|
||||
#===============================================================================
|
||||
# AbilityOnTerrainChange handlers
|
||||
#===============================================================================
|
||||
|
||||
BattleHandlers::AbilityOnTerrainChange.add(:MIMICRY,
|
||||
proc { |ability, battler, battle, ability_changed|
|
||||
if battle.field.terrain == :None
|
||||
# Revert to original typing
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battler.pbResetTypes
|
||||
battle.pbDisplay(_INTL("{1} changed back to its regular type!", battler.pbThis))
|
||||
battle.pbHideAbilitySplash(battler)
|
||||
else
|
||||
# Change to new typing
|
||||
terrain_hash = {
|
||||
:Electric => :ELECTRIC,
|
||||
:Grassy => :GRASS,
|
||||
:Misty => :FAIRY,
|
||||
:Psychic => :PSYCHIC
|
||||
}
|
||||
new_type = terrain_hash[battle.field.terrain]
|
||||
new_type_name = nil
|
||||
if new_type
|
||||
type_data = GameData::Type.try_get(new_type)
|
||||
new_type = nil if !type_data
|
||||
new_type_name = type_data.name if type_data
|
||||
end
|
||||
if new_type
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
battler.pbChangeTypes(new_type)
|
||||
battle.pbDisplay(_INTL("{1}'s type changed to {2}!", battler.pbThis, new_type_name))
|
||||
battle.pbHideAbilitySplash(battler)
|
||||
end
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
#===============================================================================
|
||||
# AbilityOnIntimidated handlers
|
||||
#===============================================================================
|
||||
|
||||
Reference in New Issue
Block a user