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?

View File

@@ -46,7 +46,7 @@ class PokeBattle_Move
Effectiveness.ineffective_type?(moveType, defType)
end
# Delta Stream's weather
if @battle.pbWeather == :StrongWinds
if target.effectiveWeather == :StrongWinds
ret = Effectiveness::NORMAL_EFFECTIVE_ONE if defType == :FLYING &&
Effectiveness.super_effective_type?(moveType, defType)
end
@@ -349,13 +349,14 @@ class PokeBattle_Move
end
end
# Terrain moves
terrain_multiplier = (Settings::MECHANICS_GENERATION >= 8) ? 1.3 : 1.5
case @battle.field.terrain
when :Electric
multipliers[:base_damage_multiplier] *= 1.5 if type == :ELECTRIC && user.affectedByTerrain?
multipliers[:base_damage_multiplier] *= terrain_multiplier if type == :ELECTRIC && user.affectedByTerrain?
when :Grassy
multipliers[:base_damage_multiplier] *= 1.5 if type == :GRASS && user.affectedByTerrain?
multipliers[:base_damage_multiplier] *= terrain_multiplier if type == :GRASS && user.affectedByTerrain?
when :Psychic
multipliers[:base_damage_multiplier] *= 1.5 if type == :PSYCHIC && user.affectedByTerrain?
multipliers[:base_damage_multiplier] *= terrain_multiplier if type == :PSYCHIC && user.affectedByTerrain?
when :Misty
multipliers[:base_damage_multiplier] /= 2 if type == :DRAGON && target.affectedByTerrain?
end
@@ -381,7 +382,7 @@ class PokeBattle_Move
multipliers[:final_damage_multiplier] *= 0.75
end
# Weather
case @battle.pbWeather
case user.effectiveWeather
when :Sun, :HarshSun
if type == :FIRE
multipliers[:final_damage_multiplier] *= 1.5

View File

@@ -132,7 +132,7 @@ class PokeBattle_Move_008 < PokeBattle_ParalysisMove
def hitsFlyingTargets?; return true; end
def pbBaseAccuracy(user,target)
case @battle.pbWeather
case target.effectiveWeather
when :Sun, :HarshSun
return 50
when :Rain, :HeavyRain
@@ -203,7 +203,7 @@ end
#===============================================================================
class PokeBattle_Move_00D < PokeBattle_FreezeMove
def pbBaseAccuracy(user,target)
return 0 if @battle.pbWeather == :Hail
return 0 if target.effectiveWeather == :Hail
return super
end
end
@@ -309,7 +309,7 @@ class PokeBattle_Move_015 < PokeBattle_ConfuseMove
def hitsFlyingTargets?; return true; end
def pbBaseAccuracy(user,target)
case @battle.pbWeather
case target.effectiveWeather
when :Sun, :HarshSun
return 50
when :Rain, :HeavyRain
@@ -741,7 +741,7 @@ class PokeBattle_Move_028 < PokeBattle_MultiStatUpMove
def pbOnStartUse(user,targets)
increment = 1
increment = 2 if [:Sun, :HarshSun].include?(@battle.pbWeather)
increment = 2 if [:Sun, :HarshSun].include?(user.effectiveWeather)
@statUp[1] = @statUp[3] = increment
end
end

View File

@@ -105,13 +105,13 @@ end
#===============================================================================
class PokeBattle_Move_087 < PokeBattle_Move
def pbBaseDamage(baseDmg,user,target)
baseDmg *= 2 if @battle.pbWeather != :None
baseDmg *= 2 if user.effectiveWeather != :None
return baseDmg
end
def pbBaseType(user)
ret = :NORMAL
case @battle.pbWeather
case user.effectiveWeather
when :Sun, :HarshSun
ret = :FIRE if GameData::Type.exists?(:FIRE)
when :Rain, :HeavyRain
@@ -2064,7 +2064,7 @@ class PokeBattle_Move_0C4 < PokeBattle_TwoTurnMove
def pbIsChargingTurn?(user)
ret = super
if !user.effects[PBEffects::TwoTurnAttack]
if [:Sun, :HarshSun].include?(@battle.pbWeather)
if [:Sun, :HarshSun].include?(user.effectiveWeather)
@powerHerb = false
@chargingTurn = true
@damagingTurn = true
@@ -2079,7 +2079,7 @@ class PokeBattle_Move_0C4 < PokeBattle_TwoTurnMove
end
def pbBaseDamageMultiplier(damageMult,user,target)
damageMult /= 2 if ![:None, :Sun, :HarshSun].include?(@battle.pbWeather)
damageMult /= 2 if ![:None, :Sun, :HarshSun].include?(user.effectiveWeather)
return damageMult
end
end
@@ -2560,7 +2560,7 @@ end
#===============================================================================
class PokeBattle_Move_0D8 < PokeBattle_HealingMove
def pbOnStartUse(user,targets)
case @battle.pbWeather
case user.effectiveWeather
when :Sun, :HarshSun
@healAmount = (user.totalhp*2/3.0).round
when :None, :StrongWinds

View File

@@ -2242,7 +2242,7 @@ class PokeBattle_Move_167 < PokeBattle_Move
def canSnatch?; return true; end
def pbMoveFailed?(user,targets)
if @battle.pbWeather != :Hail
if user.effectiveWeather != :Hail
@battle.pbDisplay(_INTL("But it failed!"))
return true
end
@@ -2416,8 +2416,8 @@ end
#===============================================================================
class PokeBattle_Move_16D < PokeBattle_HealingMove
def pbHealAmount(user)
return (user.totalhp*2/3.0).round if @battle.pbWeather == :Sandstorm
return (user.totalhp/2.0).round
return (user.totalhp * 2 / 3.0).round if user.effectiveWeather == :Sandstorm
return (user.totalhp / 2.0).round
end
end

View File

@@ -80,7 +80,7 @@ class PokeBattle_Battle
attr_accessor :lastMoveUsed # Last move used
attr_accessor :lastMoveUser # Last move user
attr_accessor :first_poke_ball # ID of the first thrown Poké Ball that failed
attr_Accessor :poke_ball_failed # Set after first_poke_ball to prevent it being set again
attr_accessor :poke_ball_failed # Set after first_poke_ball to prevent it being set again
attr_reader :switching # True if during the switching phase of the round
attr_reader :futureSight # True if Future Sight is hitting
attr_reader :endOfRound # True during the end of round

View File

@@ -121,7 +121,7 @@ class PokeBattle_Battle
pbParty(1).each_with_index do |pkmn,idxPkmn|
pbCreateBattler(2*idxPkmn+side,pkmn,idxPkmn)
# Changes the Pokémon's form upon entering battle (if it should)
@peer.pbOnEnteringBattle(self,pkmn,true)
@peer.pbOnEnteringBattle(self, @battlers[2 * idxPkmn + side], pkmn, true)
pbSetSeen(@battlers[2*idxPkmn+side])
@usedInBattle[side][idxPkmn] = true
end

View File

@@ -291,7 +291,7 @@ class PokeBattle_Battle
# Called from def pbReplace above and at the start of battle.
# sendOuts is an array; each element is itself an array: [idxBattler,pkmn]
def pbSendOut(sendOuts,startBattle=false)
sendOuts.each { |b| @peer.pbOnEnteringBattle(self,b[1]) }
sendOuts.each { |b| @peer.pbOnEnteringBattle(self, @battlers[b[0]], b[1]) }
@scene.pbSendOutBattlers(sendOuts,startBattle)
sendOuts.each do |b|
@scene.pbResetMoveIndex(b[0])

View File

@@ -67,16 +67,14 @@ class PokeBattle_Battle
when :ShadowSky then pbDisplay(_INTL("The shadow sky continues."))
end
# Effects due to weather
curWeather = pbWeather
priority.each do |b|
# Weather-related abilities
if b.abilityActive?
BattleHandlers.triggerEORWeatherAbility(b.ability,curWeather,b,self)
BattleHandlers.triggerEORWeatherAbility(b.ability, b.effectiveWeather, b, self)
b.pbFaint if b.fainted?
end
# Weather damage
# NOTE:
case curWeather
case b.effectiveWeather
when :Sandstorm
next if !b.takesSandstormDamage?
pbDisplay(_INTL("{1} is buffeted by the sandstorm!",b.pbThis))
@@ -257,10 +255,8 @@ class PokeBattle_Battle
pbDisplay(_INTL("{1}'s wish came true!",wishMaker))
end
# Sea of Fire damage (Fire Pledge + Grass Pledge combination)
curWeather = pbWeather
for side in 0...2
next if sides[side].effects[PBEffects::SeaOfFire]==0
next if [:Rain, :HeavyRain].include?(curWeather)
@battle.pbCommonAnimation("SeaOfFire") if side==0
@battle.pbCommonAnimation("SeaOfFireOpp") if side==1
priority.each do |b|

View File

@@ -4,7 +4,7 @@
BattleHandlers::SpeedCalcAbility.add(:CHLOROPHYLL,
proc { |ability,battler,mult|
next mult * 2 if [:Sun, :HarshSun].include?(battler.battle.pbWeather)
next mult * 2 if [:Sun, :HarshSun].include?(battler.effectiveWeather)
}
)
@@ -16,7 +16,7 @@ BattleHandlers::SpeedCalcAbility.add(:QUICKFEET,
BattleHandlers::SpeedCalcAbility.add(:SANDRUSH,
proc { |ability,battler,mult|
next mult * 2 if [:Sandstorm].include?(battler.battle.pbWeather)
next mult * 2 if [:Sandstorm].include?(battler.effectiveWeather)
}
)
@@ -28,7 +28,7 @@ BattleHandlers::SpeedCalcAbility.add(:SLOWSTART,
BattleHandlers::SpeedCalcAbility.add(:SLUSHRUSH,
proc { |ability,battler,mult|
next mult * 2 if [:Hail].include?(battler.battle.pbWeather)
next mult * 2 if [:Hail].include?(battler.effectiveWeather)
}
)
@@ -40,7 +40,7 @@ BattleHandlers::SpeedCalcAbility.add(:SURGESURFER,
BattleHandlers::SpeedCalcAbility.add(:SWIFTSWIM,
proc { |ability,battler,mult|
next mult * 2 if [:Rain, :HeavyRain].include?(battler.battle.pbWeather)
next mult * 2 if [:Rain, :HeavyRain].include?(battler.effectiveWeather)
}
)
@@ -147,7 +147,7 @@ BattleHandlers::StatusImmunityAbility.copy(:INSOMNIA,:SWEETVEIL,:VITALSPIRIT)
BattleHandlers::StatusImmunityAbility.add(:LEAFGUARD,
proc { |ability,battler,status|
next true if [:Sun, :HarshSun].include?(battler.battle.pbWeather)
next true if [:Sun, :HarshSun].include?(battler.effectiveWeather)
}
)
@@ -826,13 +826,13 @@ BattleHandlers::AccuracyCalcTargetAbility.add(:NOGUARD,
BattleHandlers::AccuracyCalcTargetAbility.add(:SANDVEIL,
proc { |ability,mods,user,target,move,type|
mods[:evasion_multiplier] *= 1.25 if target.battle.pbWeather == :Sandstorm
mods[:evasion_multiplier] *= 1.25 if target.effectiveWeather == :Sandstorm
}
)
BattleHandlers::AccuracyCalcTargetAbility.add(:SNOWCLOAK,
proc { |ability,mods,user,target,move,type|
mods[:evasion_multiplier] *= 1.25 if target.battle.pbWeather == :Hail
mods[:evasion_multiplier] *= 1.25 if target.effectiveWeather == :Hail
}
)
@@ -916,7 +916,7 @@ BattleHandlers::DamageCalcUserAbility.add(:FLASHFIRE,
BattleHandlers::DamageCalcUserAbility.add(:FLOWERGIFT,
proc { |ability,user,target,move,mults,baseDmg,type|
if move.physicalMove? && [:Sun, :HarshSun].include?(user.battle.pbWeather)
if move.physicalMove? && [:Sun, :HarshSun].include?(user.effectiveWeather)
mults[:attack_multiplier] *= 1.5
end
}
@@ -1005,7 +1005,7 @@ BattleHandlers::DamageCalcUserAbility.add(:RIVALRY,
BattleHandlers::DamageCalcUserAbility.add(:SANDFORCE,
proc { |ability,user,target,move,mults,baseDmg,type|
if user.battle.pbWeather == :Sandstorm &&
if user.effectiveWeather == :Sandstorm &&
[:ROCK, :GROUND, :STEEL].include?(type)
mults[:base_damage_multiplier] *= 1.3
end
@@ -1026,7 +1026,7 @@ BattleHandlers::DamageCalcUserAbility.add(:SLOWSTART,
BattleHandlers::DamageCalcUserAbility.add(:SOLARPOWER,
proc { |ability,user,target,move,mults,baseDmg,type|
if move.specialMove? && [:Sun, :HarshSun].include?(user.battle.pbWeather)
if move.specialMove? && [:Sun, :HarshSun].include?(user.effectiveWeather)
mults[:attack_multiplier] *= 1.5
end
}
@@ -1122,7 +1122,7 @@ BattleHandlers::DamageCalcUserAllyAbility.add(:BATTERY,
BattleHandlers::DamageCalcUserAllyAbility.add(:FLOWERGIFT,
proc { |ability,user,target,move,mults,baseDmg,type|
if move.physicalMove? && [:Sun, :HarshSun].include?(user.battle.pbWeather)
if move.physicalMove? && [:Sun, :HarshSun].include?(user.effectiveWeather)
mults[:attack_multiplier] *= 1.5
end
}
@@ -1150,7 +1150,7 @@ BattleHandlers::DamageCalcTargetAbility.copy(:FILTER,:SOLIDROCK)
BattleHandlers::DamageCalcTargetAbility.add(:FLOWERGIFT,
proc { |ability,user,target,move,mults,baseDmg,type|
if move.specialMove? && [:Sun, :HarshSun].include?(user.battle.pbWeather)
if move.specialMove? && [:Sun, :HarshSun].include?(target.effectiveWeather)
mults[:defense_multiplier] *= 1.5
end
}
@@ -1235,7 +1235,7 @@ BattleHandlers::DamageCalcTargetAbilityNonIgnorable.add(:SHADOWSHIELD,
BattleHandlers::DamageCalcTargetAllyAbility.add(:FLOWERGIFT,
proc { |ability,user,target,move,mults,baseDmg,type|
if move.specialMove? && [:Sun, :HarshSun].include?(user.battle.pbWeather)
if move.specialMove? && [:Sun, :HarshSun].include?(target.effectiveWeather)
mults[:defense_multiplier] *= 1.5
end
}
@@ -1864,7 +1864,7 @@ BattleHandlers::EORHealingAbility.add(:HEALER,
BattleHandlers::EORHealingAbility.add(:HYDRATION,
proc { |ability,battler,battle|
next if battler.status == :NONE
next if ![:Rain, :HeavyRain].include?(battle.pbWeather)
next if ![:Rain, :HeavyRain].include?(battler.effectiveWeather)
battle.pbShowAbilitySplash(battler)
oldStatus = battler.status
battler.pbCureStatus(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
@@ -1987,7 +1987,7 @@ BattleHandlers::EORGainItemAbility.add(:HARVEST,
proc { |ability,battler,battle|
next if battler.item
next if !battler.recycleItem || !GameData::Item.get(battler.recycleItem).is_berry?
if ![:Sun, :HarshSun].include?(battle.pbWeather)
if ![:Sun, :HarshSun].include?(battler.effectiveWeather)
next unless battle.pbRandom(100)<50
end
battle.pbShowAbilitySplash(battler)

View File

@@ -455,7 +455,7 @@ class PokeBattle_AI
end
end
if move.function=="028" # Growth
score += 20 if [:Sun, :HarshSun].include?(@battle.pbWeather)
score += 20 if [:Sun, :HarshSun].include?(user.effectiveWeather)
end
end
#---------------------------------------------------------------------------
@@ -1869,7 +1869,7 @@ class PokeBattle_AI
if user.hp==user.totalhp || (skill>=PBTrainerAI.mediumSkill && !user.canHeal?)
score -= 90
else
case @battle.pbWeather
case user.effectiveWeather
when :Sun, :HarshSun
score += 30
when :None
@@ -2159,7 +2159,7 @@ class PokeBattle_AI
if @battle.pbCheckGlobalAbility(:AIRLOCK) ||
@battle.pbCheckGlobalAbility(:CLOUDNINE)
score -= 90
elsif @battle.pbWeather == :Sun
elsif @battle.field.weather == :Sun
score -= 90
else
user.eachMove do |m|
@@ -2172,7 +2172,7 @@ class PokeBattle_AI
if @battle.pbCheckGlobalAbility(:AIRLOCK) ||
@battle.pbCheckGlobalAbility(:CLOUDNINE)
score -= 90
elsif @battle.pbWeather == :Rain
elsif @battle.field.weather == :Rain
score -= 90
else
user.eachMove do |m|
@@ -2185,7 +2185,7 @@ class PokeBattle_AI
if @battle.pbCheckGlobalAbility(:AIRLOCK) ||
@battle.pbCheckGlobalAbility(:CLOUDNINE)
score -= 90
elsif @battle.pbWeather == :Sandstorm
elsif @battle.field.weather == :Sandstorm
score -= 90
end
#---------------------------------------------------------------------------
@@ -2193,7 +2193,7 @@ class PokeBattle_AI
if @battle.pbCheckGlobalAbility(:AIRLOCK) ||
@battle.pbCheckGlobalAbility(:CLOUDNINE)
score -= 90
elsif @battle.pbWeather == :Hail
elsif @battle.field.weather == :Hail
score -= 90
end
#---------------------------------------------------------------------------
@@ -2522,7 +2522,7 @@ class PokeBattle_AI
if @battle.pbCheckGlobalAbility(:AIRLOCK) ||
@battle.pbCheckGlobalAbility(:CLOUDNINE)
score -= 90
elsif @battle.pbWeather == :ShadowSky
elsif @battle.field.weather == :ShadowSky
score -= 90
end
#---------------------------------------------------------------------------
@@ -2929,7 +2929,7 @@ class PokeBattle_AI
when "166"
#---------------------------------------------------------------------------
when "167"
if user.pbOwnSide.effects[PBEffects::AuroraVeil]>0 || @battle.pbWeather != :Hail
if user.pbOwnSide.effects[PBEffects::AuroraVeil]>0 || user.effectiveWeather != :Hail
score -= 90
else
score += 40
@@ -2988,7 +2988,7 @@ class PokeBattle_AI
else
score += 50
score -= user.hp*100/user.totalhp
score += 30 if @battle.pbWeather == :Sandstorm
score += 30 if user.effectiveWeather == :Sandstorm
end
#---------------------------------------------------------------------------
when "16E"

View File

@@ -43,7 +43,7 @@ class PokeBattle_AI
Effectiveness.ineffective_type?(moveType, defType)
end
# Delta Stream's weather
if @battle.pbWeather == :StrongWinds
if target.effectiveWeather == :StrongWinds
ret = Effectiveness::NORMAL_EFFECTIVE_ONE if defType == :FLYING &&
Effectiveness.super_effective_type?(moveType, defType)
end
@@ -439,7 +439,7 @@ class PokeBattle_AI
end
# Weather
if skill>=PBTrainerAI.mediumSkill
case @battle.pbWeather
case user.effectiveWeather
when :Sun, :HarshSun
if type == :FIRE
multipliers[:final_damage_multiplier] *= 1.5

View File

@@ -3,7 +3,7 @@
#===============================================================================
# Unused class.
class PokeBattle_NullBattlePeer
def pbOnEnteringBattle(battle,pkmn,wild=false); end
def pbOnEnteringBattle(battle, battler, pkmn, wild = false); end
def pbOnLeavingBattle(battle,pkmn,usedInBattle,endBattle=false); end
def pbStorePokemon(player,pkmn)
@@ -52,9 +52,11 @@ class PokeBattle_RealBattlePeer
return (box<0) ? "" : $PokemonStorage[box].name
end
def pbOnEnteringBattle(_battle,pkmn,wild=false)
def pbOnEnteringBattle(battle, battler, pkmn, wild = false)
f = MultipleForms.call("getFormOnEnteringBattle",pkmn,wild)
pkmn.form = f if f
battler.form = pkmn.form if battler.form != pkmn.form
MultipleForms.call("changePokemonOnEnteringBattle", battler, pkmn, battle)
end
# For switching out, including due to fainting, and for the end of battle
@@ -63,6 +65,7 @@ class PokeBattle_RealBattlePeer
f = MultipleForms.call("getFormOnLeavingBattle",pkmn,battle,usedInBattle,endBattle)
pkmn.form = f if f && pkmn.form!=f
pkmn.hp = pkmn.totalhp if pkmn.hp>pkmn.totalhp
MultipleForms.call("changePokemonOnLeavingBattle", pkmn, battle, usedInBattle, endBattle)
end
end

View File

@@ -301,7 +301,7 @@ BattleHandlers::UserAbilityEndOfMove.copy(:GRIMNEIGH, :ASONEGRIMNEIGH)
BattleHandlers::AbilityOnSwitchIn.add(:ICEFACE,
proc { |ability, battler, battle|
next if !battler.isSpecies?(:EISCUE) || battler.form != 1
next if battle.pbWeather != :Hail
next if battler.effectiveWeather != :Hail
battle.pbShowAbilitySplash(battler)
if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
battle.pbDisplay(_INTL("{1}'s {2} activated!", battler.pbThis, battler.abilityName))

View File

@@ -858,8 +858,7 @@ ItemHandlers::UseOnPokemon.add(:GRACIDEA,proc { |item,pkmn,scene|
pkmn.status == :FROZEN || PBDayNight.isNight?
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.fainted?
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
@@ -874,9 +873,9 @@ ItemHandlers::UseOnPokemon.add(:REDNECTAR,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:ORICORIO) || pkmn.form==0
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.fainted?
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
pkmn.setForm(0) {
scene.pbRefresh
@@ -889,9 +888,9 @@ ItemHandlers::UseOnPokemon.add(:YELLOWNECTAR,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:ORICORIO) || pkmn.form==1
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.fainted?
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
pkmn.setForm(1) {
scene.pbRefresh
@@ -904,9 +903,9 @@ ItemHandlers::UseOnPokemon.add(:PINKNECTAR,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:ORICORIO) || pkmn.form==2
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.fainted?
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
pkmn.setForm(2) {
scene.pbRefresh
@@ -919,9 +918,9 @@ ItemHandlers::UseOnPokemon.add(:PURPLENECTAR,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:ORICORIO) || pkmn.form==3
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.fainted?
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
pkmn.setForm(3) {
scene.pbRefresh
@@ -936,8 +935,7 @@ ItemHandlers::UseOnPokemon.add(:REVEALGLASS,proc { |item,pkmn,scene|
!pkmn.isSpecies?(:LANDORUS)
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.fainted?
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
@@ -953,9 +951,9 @@ ItemHandlers::UseOnPokemon.add(:PRISONBOTTLE,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:HOOPA)
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.fainted?
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
newForm = (pkmn.form==0) ? 1 : 0
pkmn.setForm(newForm) {
@@ -969,8 +967,7 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:KYUREM)
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.fainted?
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
@@ -1022,8 +1019,7 @@ ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form == 2
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.fainted?
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
@@ -1071,8 +1067,7 @@ ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc { |item,pkmn,scene|
if !pkmn.isSpecies?(:NECROZMA) || pkmn.form == 1
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.fainted?
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end

View File

@@ -219,8 +219,7 @@ ItemHandlers::UseOnPokemon.add(:REINSOFUNITY, proc { |item, pkmn, scene|
if !pkmn.isSpecies?(:CALYREX)
scene.pbDisplay(_INTL("It had no effect."))
next false
end
if pkmn.fainted?
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
@@ -287,27 +286,54 @@ ItemHandlers::UseOnPokemon.add(:ABILITYPATCH, proc { |item, pkmn, scene|
next false
})
ItemHandlers::UseOnPokemon.add(:ROTOMCATALOG, proc { |item, pkmn, scene|
if !pkmn.isSpecies?(:ROTOM)
scene.pbDisplay(_INTL("It had no effect."))
next false
elsif pkmn.fainted?
scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
next false
end
choices = [
_INTL("Light bulb"),
_INTL("Microwave oven"),
_INTL("Washing machine"),
_INTL("Refrigerator"),
_INTL("Electric fan"),
_INTL("Lawn mower"),
_INTL("Cancel")
]
new_form = scene.pbShowCommands(_INTL("Which appliance would you like to order?"),
commands, pkmn.form)
if new_form == pkmn.form
scene.pbDisplay(_INTL("It won't have any effect."))
next false
elsif new_form > 0 && new_form < choices.length - 1
pkmn.setForm(new_form) {
scene.pbRefresh
scene.pbDisplay(_INTL("{1} transformed!", pkmn.name))
}
next true
end
next false
})
BattleHandlers::UserItemAfterMoveUse.add(:THROATSPRAY,
proc { |item, user, targets, move, numHits, battle|
next if battle.pbAllFainted?(user.idxOwnSide) ||
battle.pbAllFainted?(user.idxOpposingSide)
next if !move.soundMove? || numHits == 0
next if !user.pbCanRaiseStatStage?(:SPECIAL_ATTACK, user)
user.pbRaiseStatStage(:SPECIAL_ATTACK, 1, user)
user.pbConsumeItem
}
)
=begin
#===============================================================================
Pokémon Box Link
Key item, unusable. Enables pressing a button while in the party screen to open
the "Organise Boxes" mode of Pokémon storage. This is disabled at certain times,
perhaps when a Game Switch is on.
Rusted Sword
Changes form of Zacian holding it. In battle, changes Zacian's Iron Head to
Behemoth Blade.
Rusted Shield
Changes form of Zamazenta holding it. In battle, changes Zamazenta's Iron Head
to Behemoth Bash.
Throat Spray
After holder uses a sound-based move, consume item and holder gets +1 Special
Attack (unless battle ends).
Eject Pack
When holder's stat(s) is lowered, consume item and holder switches out. Not
triggered by Parting Shot, or if a faster mon's Eject Button/Eject Pack
@@ -322,16 +348,12 @@ Room Service
If Trick Room is used, or if holder switches in while Trick Room applies,
consume item and holder gets -1 Speed.
Utility Umbrella
Holder is unaffected by sun and rain weathers.
Pokémon Box Link
Key item, unusable. Enables pressing a button while in the party screen to open
the "Organise Boxes" mode of Pokémon storage. This is disabled at certain times,
perhaps when a Game Switch is on.
Catching Charm
Increases the chance of a critical catch. By how much?
Rotom Catalog
Changes Rotom's form (choosable).
Mark Charm
Increases the chance of a wild Pokémon having a mark.
=end

View File

@@ -212,50 +212,47 @@ MultipleForms.register(:CHERRIM,{
}
})
MultipleForms.register(:ROTOM,{
MultipleForms.register(:ROTOM, {
"onSetForm" => proc { |pkmn, form, oldForm|
form_moves = [
:OVERHEAT, # Heat, Microwave
:HYDROPUMP, # Wash, Washing Machine
:BLIZZARD, # Frost, Refrigerator
:AIRSLASH, # Fan
:LEAFSTORM # Mow, Lawnmower
:OVERHEAT, # Heat (microwave oven)
:HYDROPUMP, # Wash (washing machine)
:BLIZZARD, # Frost (refrigerator)
:AIRSLASH, # Fan (electric fan)
:LEAFSTORM # Mow (lawn mower)
]
move_index = -1
# Find a known move that should be forgotten
old_move_index = -1
pkmn.moves.each_with_index do |move, i|
next if !form_moves.any? { |m| m == move.id }
move_index = i
next if !form_moves.include?(move.id)
old_move_index = i
break
end
if form == 0
# Turned back into the base form; forget form-specific moves
if move_index >= 0
move_name = pkmn.moves[move_index].name
pkmn.forget_move_at_index(move_index)
pbMessage(_INTL("{1} forgot {2}...", pkmn.name, move_name))
pbLearnMove(pkmn, :THUNDERSHOCK) if pkmn.numMoves == 0
end
else
# Turned into an alternate form; try learning that form's unique move
new_move_id = form_moves[form - 1]
if move_index >= 0
# Knows another form's unique move; replace it
old_move_name = pkmn.moves[move_index].name
if GameData::Move.exists?(new_move_id)
pkmn.moves[move_index].id = new_move_id
new_move_name = pkmn.moves[move_index].name
pbMessage(_INTL("1,\\wt[16] 2, and\\wt[16]...\\wt[16] ...\\wt[16] ... Ta-da!\\se[Battle ball drop]\1"))
pbMessage(_INTL("{1} forgot how to use {2}.\\nAnd...\1", pkmn.name, old_move_name))
pbMessage(_INTL("\\se[]{1} learned {2}!\\se[Pkmn move learnt]", pkmn.name, new_move_name))
else
pkmn.forget_move_at_index(move_index)
pbMessage(_INTL("{1} forgot {2}...", pkmn.name, old_move_name))
pbLearnMove(pkmn, :THUNDERSHOCK) if pkmn.numMoves == 0
end
# Determine which new move to learn (if any)
new_move_id = (form > 0) ? form_moves[form - 1] : nil
new_move_id = nil if !GameData::Move.exists?(new_move_id)
if new_move_id.nil? && old_move_index >= 0 && pkmn.numMoves == 1
new_move_id = :THUNDERSHOCK
new_move_id = nil if !GameData::Move.exists?(new_move_id)
raise _INTL("Rotom is trying to forget its last move, but there isn't another move to replace it with.") if new_move_id.nil?
end
# Forget a known move (if relevant) and learn a new move (if relevant)
if old_move_index >= 0
old_move_name = pkmn.moves[old_move_index].name
if new_move_id.nil?
# Just forget the old move
pkmn.forget_move_at_index(old_move_index)
pbMessage(_INTL("{1} forgot {2}...\1", pkmn.name, old_move_name))
else
# Just try to learn this form's unique move
pbLearnMove(pkmn, new_move_id, true)
# Replace the old move with the new move (keeps the same index)
pkmn.moves[old_move_index].id = new_move_id
new_move_name = pkmn.moves[old_move_index].name
pbMessage(_INTL("{1} forgot {2}...\1", pkmn.name, old_move_name))
pbMessage(_INTL("\\se[]{1} learned {2}!\\se[Pkmn move learnt]\1", pkmn.name, new_move_name))
end
elsif !new_move_id.nil?
# Just learn the new move
pbLearnMove(pkmn, new_move_id, true)
end
}
})
@@ -657,8 +654,23 @@ MultipleForms.register(:ZACIAN, {
next 1 if pkmn.hasItem?(:RUSTEDSWORD)
next 0
},
"changePokemonOnEnteringBattle" => proc { |battler, pkmn, battle|
if GameData::Move.exists?(:BEHEMOTHBLADE) && pkmn.hasItem?(:RUSTEDSWORD)
pkmn.moves.each do |move|
next if move.id != :IRONHEAD
move.id = :BEHEMOTHBLADE
battler.moves.each_with_index do |b_move, i|
next if b_move.id != :IRONHEAD
battler.moves[i] = PokeBattle_Move.from_pokemon_move(battle, move)
end
end
end
},
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 0
},
"changePokemonOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
pkmn.moves.each { |move| move.id = :IRONHEAD if move.id == :BEHEMOTHBLADE }
}
})
@@ -667,8 +679,23 @@ MultipleForms.register(:ZAMAZENTA, {
next 1 if pkmn.hasItem?(:RUSTEDSHIELD)
next 0
},
"changePokemonOnEnteringBattle" => proc { |battler, pkmn, battle|
if GameData::Move.exists?(:BEHEMOTHBASH) && pkmn.hasItem?(:RUSTEDSHIELD)
pkmn.moves.each do |move|
next if move.id != :IRONHEAD
move.id = :BEHEMOTHBASH
battler.moves.each_with_index do |b_move, i|
next if b_move.id != :IRONHEAD
battler.moves[i] = PokeBattle_Move.from_pokemon_move(battle, move)
end
end
end
},
"getFormOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
next 0
},
"changePokemonOnLeavingBattle" => proc { |pkmn, battle, usedInBattle, endBattle|
pkmn.moves.each { |move| move.id = :IRONHEAD if move.id == :BEHEMOTHBASH }
}
})

View File

@@ -29,14 +29,10 @@ Some moves have changed properties/effects:
than the order in which they were Quashed.
- Parting Shot is able to make the user switch out if its effect is redirected
by Mirror Armor. Throat Spray is triggered and applies before the switch.
- Terrains have altered/additional effects.
- Double Iron Bash no longer has a different effect if the target is Minimized.
Some abilities have changed effects:
- Oblivious, Own Tempo, Inner Focus and Scrappy now block Intimidate.
- Intimidate now triggers Rattled.
- If Unburden is negated by Neutralizing Gas, Unburden's effect stops applying.
If Neutralizing Gas then leaves the field, Unburden's boost returns.
- If another Pokémon faints before a Pokémon with Analytic makes its move,
Analytic calculates whether it would have moved before or after the fainted
Pokémon. In Gen 8, speed- and priority-modifying effects aren't considered,
@@ -62,7 +58,6 @@ Other notes:
- Look at Sweet Scent's out of battle effect, namely whether it should try to
cause a horde battle (and what does that mean in Essentials?).
- Maybe have multiple sets of Pickup items for multiple Gens.
- Dive Ball should have an increased catch rate if surfing or fishing(?). Nah.
- Add a newer type of berry tree mechanics? Have a separate setting that
prevents deterioration?
- If a battle ends because of Rocky Helmet damage, the side that the Rocky
@@ -79,10 +74,8 @@ Make example event that combines the Gen 8 fossils.
Add AI for new moves/items/abilities.
Zacian/Zamazenta need code that changes their movesets upon entering/leaving
battle. Can't use "onSetForm" since that's called after the battler is
initialized and pbOnEnteringBattle doesn't have access to the battler (could
change this).
What happens to the PP of Iron Head when turned into/from Behemoth Blade/Bash
for Zacian/Zamazenta?
#===============================================================================
# Low priority or ignorable