mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-12 15:44:57 +00:00
Added some more Gen 8 item effects, added Intimidate being blocked by some abilities, fixed Nectars being usable on fainted Oricorio
This commit is contained in:
@@ -541,6 +541,12 @@ class PokeBattle_Battler
|
||||
return true
|
||||
end
|
||||
|
||||
def effectiveWeather
|
||||
ret = @battle.pbWeather
|
||||
ret = :None if [:Sun, :Rain, :HarshSun, :HeavyRain].include?(ret) && hasActiveItem?(:UTILITYUMBRELLA)
|
||||
return ret
|
||||
end
|
||||
|
||||
def affectedByPowder?(showMsg=false)
|
||||
return false if fainted?
|
||||
if pbHasType?(:GRASS) && Settings::MORE_TYPE_EFFECTS
|
||||
|
||||
@@ -169,7 +169,7 @@ class PokeBattle_Battler
|
||||
if isSpecies?(:CASTFORM)
|
||||
if hasActiveAbility?(:FORECAST)
|
||||
newForm = 0
|
||||
case @battle.pbWeather
|
||||
case effectiveWeather
|
||||
when :Sun, :HarshSun then newForm = 1
|
||||
when :Rain, :HeavyRain then newForm = 2
|
||||
when :Hail then newForm = 3
|
||||
@@ -187,7 +187,7 @@ class PokeBattle_Battler
|
||||
if isSpecies?(:CHERRIM)
|
||||
if hasActiveAbility?(:FLOWERGIFT)
|
||||
newForm = 0
|
||||
newForm = 1 if [:Sun, :HarshSun].include?(@battle.pbWeather)
|
||||
newForm = 1 if [:Sun, :HarshSun].include?(effectiveWeather)
|
||||
if @form!=newForm
|
||||
@battle.pbShowAbilitySplash(self,true)
|
||||
@battle.pbHideAbilitySplash(self)
|
||||
@@ -199,7 +199,7 @@ class PokeBattle_Battler
|
||||
end
|
||||
# Eiscue - Ice Face
|
||||
if !ability_changed && isSpecies?(:EISCUE) && self.ability = :ICEFACE &&
|
||||
@form == 1 && @battle.pbWeather == :Hail
|
||||
@form == 1 && effectiveWeather == :Hail
|
||||
@canRestoreIceFace = true # Changed form at end of round
|
||||
end
|
||||
end
|
||||
|
||||
@@ -52,7 +52,7 @@ class PokeBattle_Battler
|
||||
return false
|
||||
end
|
||||
# Weather immunity
|
||||
if newStatus == :FROZEN && [:Sun, :HarshSun].include?(@battle.pbWeather)
|
||||
if newStatus == :FROZEN && [:Sun, :HarshSun].include?(effectiveWeather)
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",pbThis(true))) if showMessages
|
||||
return false
|
||||
end
|
||||
|
||||
@@ -253,6 +253,17 @@ class PokeBattle_Battler
|
||||
end
|
||||
return false
|
||||
end
|
||||
if Settings::MECHANICS_GENERATION >= 8 && hasActiveAbility?([:OBLIVIOUS, :OWNTEMPO, :INNERFOCUS, :SCRAPPY])
|
||||
@battle.pbShowAbilitySplash(self)
|
||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} cannot be lowered!", pbThis, GameData::Stat.get(:ATTACK).name))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} prevents {3} loss!", pbThis, abilityName,
|
||||
GameData::Stat.get(:ATTACK).name))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(self)
|
||||
return false
|
||||
end
|
||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
return pbLowerStatStageByAbility(:ATTACK,1,user,false)
|
||||
end
|
||||
|
||||
@@ -324,7 +324,7 @@ class PokeBattle_Battler
|
||||
@battle.pbCommonAnimation("Powder",user)
|
||||
@battle.pbDisplay(_INTL("When the flame touched the powder on the Pokémon, it exploded!"))
|
||||
user.lastMoveFailed = true
|
||||
if ![:Rain, :HeavyRain].include?(@battle.pbWeather) && user.takesIndirectDamage?
|
||||
if ![:Rain, :HeavyRain].include?(user.effectiveWeather) && user.takesIndirectDamage?
|
||||
oldHP = user.hp
|
||||
user.pbReduceHP((user.totalhp/4.0).round,false)
|
||||
user.pbFaint if user.fainted?
|
||||
|
||||
Reference in New Issue
Block a user