Added effects of Mimicry/Room Service/Catching Charm, tweaked Sinistea's form chances, fixed bug in Fling about TRs.

This commit is contained in:
Maruno17
2021-08-14 19:07:57 +01:00
parent 153aa69bb8
commit 2112cdba37
15 changed files with 120 additions and 37 deletions

View File

@@ -127,6 +127,14 @@ class PokeBattle_Battler
@effects[PBEffects::Roost] = false
end
def pbResetTypes
@type1 = @pokemon.type1
@type2 = @pokemon.type2
@effects[PBEffects::Type3] = nil
@effects[PBEffects::BurnUp] = false
@effects[PBEffects::Roost] = false
end
#=============================================================================
# Forms
#=============================================================================

View File

@@ -61,6 +61,17 @@ class PokeBattle_Battler
return ret # Whether self has switched out
end
def pbAbilityOnTerrainChange(ability_changed = false)
return if !abilityActive?
BattleHandlers.triggerAbilityOnTerrainChange(self.ability, self, @battle, ability_changed)
end
# Used for Rattled's Gen 8 effect. Called when Intimidate is triggered.
def pbAbilitiesOnIntimidated
return if !abilityActive?
BattleHandlers.triggerAbilityOnIntimidated(self.ability, self, @battle)
end
# Called when a Pokémon (self) enters battle, at the end of each move used,
# and at the end of each round.
def pbContinualAbilityChecks(onSwitchIn=false)
@@ -91,12 +102,6 @@ class PokeBattle_Battler
end
end
# Used for Rattled's Gen 8 effect. Called when Intimidate is triggered.
def pbAbilitiesOnIntimidated
return if !abilityActive?
BattleHandlers.triggerAbilityOnIntimidated(self.ability, self, @battle)
end
#=============================================================================
# Ability curing
#=============================================================================
@@ -123,6 +128,8 @@ class PokeBattle_Battler
@effects[PBEffects::SlowStart] = 0 if self.ability != :SLOWSTART
# Revert form if Flower Gift/Forecast was lost
pbCheckFormOnWeatherChange(true)
# Abilities that trigger when the terrain changes
pbAbilityOnTerrainChange(true)
# Check for end of primordial weather
@battle.pbEndPrimordialWeather
end

View File

@@ -366,7 +366,7 @@ class PokeBattle_Battler
@battle.pbShowAbilitySplash(user)
user.pbChangeTypes(move.calcType)
typeName = GameData::Type.get(move.calcType).name
@battle.pbDisplay(_INTL("{1} transformed into the {2} type!",user.pbThis,typeName))
@battle.pbDisplay(_INTL("{1}'s type changed to {2}!",user.pbThis,typeName))
@battle.pbHideAbilitySplash(user)
# NOTE: The GF games say that if Curse is used by a non-Ghost-type
# Pokémon which becomes Ghost-type because of Protean, it should

View File

@@ -144,6 +144,16 @@ class PokeBattle_Battler
# after the move's animation, but the item is only consumed now.
user.pbConsumeItem
end
# Room Service
if move.function == "11F" && @battle.field.effects[PBEffects::TrickRoom] > 0 # Trick Room
@battle.battlers.each do |b|
next if !b.hasActiveItem?(:ROOMSERVICE)
next if !b.pbCanLowerStatStage?(:SPEED, b)
@battle.pbCommonAnimation("UseItem", b)
b.pbLowerStatStage(:SPEED, 1, b)
b.pbConsumeItem
end
end
# Pokémon switching caused by Roar, Whirlwind, Circle Throw, Dragon Tail
switchedBattlers = []
move.pbSwitchOutTargetsEffect(user,targets,numHits,switchedBattlers)