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:
Maruno17
2021-07-17 20:48:06 +01:00
parent 78f5530cbe
commit 14748f4999
22 changed files with 206 additions and 152 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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?