From 4bab1307858580b3460e50c9badc23bc17507e70 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Thu, 20 Apr 2023 18:04:15 +0100 Subject: [PATCH] =?UTF-8?q?Fixed=20Magic=20Guard=20not=20being=20checked?= =?UTF-8?q?=20for=20damage=20from=20Shadow=20Sky=20weather/Spiky=20Shield/?= =?UTF-8?q?Dry=20Skin/Solar=20Power,=20fixed=20As=20One=20not=20having=20U?= =?UTF-8?q?nnerve's=20effect,=20fixed=20Gulp=20Missile=20paralysing=20the?= =?UTF-8?q?=20wrong=20Pok=C3=A9mon,=20added=20message=20for=20obtaining=20?= =?UTF-8?q?multiple=20machine=20items=20at=20once?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../002_Battler/001_Battle_Battler.rb | 2 +- .../002_Battler/006_Battler_AbilityAndItem.rb | 9 ++++--- .../009_Battler_UseMoveSuccessChecks.rb | 2 +- .../010_Battler_UseMoveTriggerEffects.rb | 2 +- .../008_Battle_AbilityEffects.rb | 25 +++++++++++-------- Data/Scripts/012_Overworld/001_Overworld.rb | 22 +++++++++++++--- 6 files changed, 41 insertions(+), 21 deletions(-) diff --git a/Data/Scripts/011_Battle/002_Battler/001_Battle_Battler.rb b/Data/Scripts/011_Battle/002_Battler/001_Battle_Battler.rb index 7a9829e9a..350cc2b39 100644 --- a/Data/Scripts/011_Battle/002_Battler/001_Battle_Battler.rb +++ b/Data/Scripts/011_Battle/002_Battler/001_Battle_Battler.rb @@ -547,7 +547,7 @@ class Battle::Battler end def takesShadowSkyDamage? - return false if fainted? + return false if !takesIndirectDamage? return false if shadowPokemon? return true end diff --git a/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb b/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb index c377c06df..a3ae55112 100644 --- a/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb +++ b/Data/Scripts/011_Battle/002_Battler/006_Battler_AbilityAndItem.rb @@ -13,7 +13,7 @@ class Battle::Battler @fainted = true # Check for end of Neutralizing Gas/Unnerve pbAbilitiesOnNeutralizingGasEnding if hasActiveAbility?(:NEUTRALIZINGGAS, true) - pbItemsOnUnnerveEnding if hasActiveAbility?(:UNNERVE, true) + pbItemsOnUnnerveEnding if hasActiveAbility?([:UNNERVE, :ASONECHILLINGNEIGH, :ASONEGRIMNEIGH], true) # Check for end of primordial weather @battle.pbEndPrimordialWeather end @@ -29,7 +29,7 @@ class Battle::Battler Battle::AbilityEffects.triggerOnBattlerFainting(b.ability, b, self, @battle) end pbAbilitiesOnNeutralizingGasEnding if hasActiveAbility?(:NEUTRALIZINGGAS, true) - pbItemsOnUnnerveEnding if hasActiveAbility?(:UNNERVE, true) + pbItemsOnUnnerveEnding if hasActiveAbility?([:UNNERVE, :ASONECHILLINGNEIGH, :ASONEGRIMNEIGH], true) end # Used for Emergency Exit/Wimp Out. Returns whether self has switched out. @@ -162,7 +162,8 @@ class Battle::Battler def pbOnLosingAbility(oldAbil, suppressed = false) if oldAbil == :NEUTRALIZINGGAS && (suppressed || !@effects[PBEffects::GastroAcid]) pbAbilitiesOnNeutralizingGasEnding - elsif oldAbil == :UNNERVE && (suppressed || !@effects[PBEffects::GastroAcid]) + elsif [:UNNERVE, :ASONECHILLINGNEIGH, :ASONEGRIMNEIGH].include?(oldAbil) && + (suppressed || !@effects[PBEffects::GastroAcid]) pbItemsOnUnnerveEnding elsif oldAbil == :ILLUSION && @effects[PBEffects::Illusion] @effects[PBEffects::Illusion] = nil @@ -200,7 +201,7 @@ class Battle::Battler # Held item consuming/removing #============================================================================= def canConsumeBerry? - return false if @battle.pbCheckOpposingAbility(:UNNERVE, @index) + return false if @battle.pbCheckOpposingAbility([:UNNERVE, :ASONECHILLINGNEIGH, :ASONEGRIMNEIGH], @index) return true end diff --git a/Data/Scripts/011_Battle/002_Battler/009_Battler_UseMoveSuccessChecks.rb b/Data/Scripts/011_Battle/002_Battler/009_Battler_UseMoveSuccessChecks.rb index b7bc076f7..e05ca4cb3 100644 --- a/Data/Scripts/011_Battle/002_Battler/009_Battler_UseMoveSuccessChecks.rb +++ b/Data/Scripts/011_Battle/002_Battler/009_Battler_UseMoveSuccessChecks.rb @@ -370,7 +370,7 @@ class Battle::Battler end target.damageState.protected = true @battle.successStates[user.index].protected = true - if move.pbContactMove?(user) && user.affectedByContactEffect? + if move.pbContactMove?(user) && user.affectedByContactEffect? && user.takesIndirectDamage? @battle.scene.pbDamageAnimation(user) user.pbReduceHP(user.totalhp / 8, false) @battle.pbDisplay(_INTL("{1} was hurt!", user.pbThis)) diff --git a/Data/Scripts/011_Battle/002_Battler/010_Battler_UseMoveTriggerEffects.rb b/Data/Scripts/011_Battle/002_Battler/010_Battler_UseMoveTriggerEffects.rb index a477720cc..a56d316af 100644 --- a/Data/Scripts/011_Battle/002_Battler/010_Battler_UseMoveTriggerEffects.rb +++ b/Data/Scripts/011_Battle/002_Battler/010_Battler_UseMoveTriggerEffects.rb @@ -26,7 +26,7 @@ class Battle::Battler when 1 # Gulping Form user.pbLowerStatStageByAbility(:DEFENSE, 1, target, false) when 2 # Gorging Form - target.pbParalyze(user) if target.pbCanParalyze?(user, false) + user.pbParalyze(target) if user.pbCanParalyze?(target, false) end @battle.pbHideAbilitySplash(target) user.pbItemHPHealCheck if user.hp < oldHP diff --git a/Data/Scripts/011_Battle/006_Other battle code/008_Battle_AbilityEffects.rb b/Data/Scripts/011_Battle/006_Other battle code/008_Battle_AbilityEffects.rb index 0608b7f77..9422840b8 100644 --- a/Data/Scripts/011_Battle/006_Other battle code/008_Battle_AbilityEffects.rb +++ b/Data/Scripts/011_Battle/006_Other battle code/008_Battle_AbilityEffects.rb @@ -2251,12 +2251,14 @@ Battle::AbilityEffects::EndOfRoundWeather.add(:DRYSKIN, proc { |ability, weather, battler, battle| case weather when :Sun, :HarshSun - battle.pbShowAbilitySplash(battler) - battle.scene.pbDamageAnimation(battler) - battler.pbReduceHP(battler.totalhp / 8, false) - battle.pbDisplay(_INTL("{1} was hurt by the sunlight!", battler.pbThis)) - battle.pbHideAbilitySplash(battler) - battler.pbItemHPHealCheck + if battler.takesIndirectDamage? + battle.pbShowAbilitySplash(battler) + battle.scene.pbDamageAnimation(battler) + battler.pbReduceHP(battler.totalhp / 8, false) + battle.pbDisplay(_INTL("{1} was hurt by the sunlight!", battler.pbThis)) + battle.pbHideAbilitySplash(battler) + battler.pbItemHPHealCheck + end when :Rain, :HeavyRain next if !battler.canHeal? battle.pbShowAbilitySplash(battler) @@ -2301,7 +2303,7 @@ Battle::AbilityEffects::EndOfRoundWeather.add(:ICEFACE, Battle::AbilityEffects::EndOfRoundWeather.add(:RAINDISH, proc { |ability, weather, battler, battle| - next unless [:Rain, :HeavyRain].include?(weather) + next if ![:Rain, :HeavyRain].include?(weather) next if !battler.canHeal? battle.pbShowAbilitySplash(battler) battler.pbRecoverHP(battler.totalhp / 16) @@ -2316,7 +2318,8 @@ Battle::AbilityEffects::EndOfRoundWeather.add(:RAINDISH, Battle::AbilityEffects::EndOfRoundWeather.add(:SOLARPOWER, proc { |ability, weather, battler, battle| - next unless [:Sun, :HarshSun].include?(weather) + next if ![:Sun, :HarshSun].include?(weather) + next if !battler.takesIndirectDamage? battle.pbShowAbilitySplash(battler) battle.scene.pbDamageAnimation(battler) battler.pbReduceHP(battler.totalhp / 8, false) @@ -2332,7 +2335,7 @@ Battle::AbilityEffects::EndOfRoundWeather.add(:SOLARPOWER, Battle::AbilityEffects::EndOfRoundHealing.add(:HEALER, proc { |ability, battler, battle| - next unless battle.pbRandom(100) < 30 + next if battle.pbRandom(100) >= 30 battler.allAllies.each do |b| next if b.status == :NONE battle.pbShowAbilitySplash(battler) @@ -2920,9 +2923,9 @@ Battle::AbilityEffects::OnSwitchIn.add(:NEUTRALIZINGGAS, end # Trigger items upon Unnerve being negated battler.ability_id = nil # Allows checking if Unnerve was active before - had_unnerve = battle.pbCheckGlobalAbility(:UNNERVE) + had_unnerve = battle.pbCheckGlobalAbility([:UNNERVE, :ASONECHILLINGNEIGH, :ASONEGRIMNEIGH]) battler.ability_id = :NEUTRALIZINGGAS - if had_unnerve && !battle.pbCheckGlobalAbility(:UNNERVE) + if had_unnerve && !battle.pbCheckGlobalAbility([:UNNERVE, :ASONECHILLINGNEIGH, :ASONEGRIMNEIGH]) battle.allBattlers.each { |b| b.pbItemsOnUnnerveEnding } end } diff --git a/Data/Scripts/012_Overworld/001_Overworld.rb b/Data/Scripts/012_Overworld/001_Overworld.rb index cb4b3c838..ba6fc6b6a 100644 --- a/Data/Scripts/012_Overworld/001_Overworld.rb +++ b/Data/Scripts/012_Overworld/001_Overworld.rb @@ -669,7 +669,13 @@ def pbItemBall(item, quantity = 1) if item == :DNASPLICERS pbMessage("\\me[#{meName}]" + _INTL("You found \\c[1]{1}\\c[0]!", itemname) + "\\wtnp[30]") elsif item.is_machine? # TM or HM - pbMessage("\\me[#{meName}]" + _INTL("You found \\c[1]{1} {2}\\c[0]!", itemname, GameData::Move.get(move).name) + "\\wtnp[30]") + if quantity > 1 + pbMessage("\\me[#{meName}]" + _INTL("You found {1} \\c[1]{2} {3}\\c[0]!", + quantity, itemname, GameData::Move.get(move).name) + "\\wtnp[30]") + else + pbMessage("\\me[#{meName}]" + _INTL("You found \\c[1]{1} {2}\\c[0]!", + itemname, GameData::Move.get(move).name) + "\\wtnp[30]") + end elsif quantity > 1 pbMessage("\\me[#{meName}]" + _INTL("You found {1} \\c[1]{2}\\c[0]!", quantity, itemname) + "\\wtnp[30]") elsif itemname.starts_with_vowel? @@ -683,7 +689,11 @@ def pbItemBall(item, quantity = 1) end # Can't add the item if item.is_machine? # TM or HM - pbMessage(_INTL("You found \\c[1]{1} {2}\\c[0]!", itemname, GameData::Move.get(move).name) + "\\wtnp[30]") + if quantity > 1 + pbMessage(_INTL("You found {1} \\c[1]{2} {3}\\c[0]!", quantity, itemname, GameData::Move.get(move).name) + "\\wtnp[30]") + else + pbMessage(_INTL("You found \\c[1]{1} {2}\\c[0]!", itemname, GameData::Move.get(move).name) + "\\wtnp[30]") + end elsif quantity > 1 pbMessage(_INTL("You found {1} \\c[1]{2}\\c[0]!", quantity, itemname) + "\\wtnp[30]") elsif itemname.starts_with_vowel? @@ -708,7 +718,13 @@ def pbReceiveItem(item, quantity = 1) if item == :DNASPLICERS pbMessage("\\me[#{meName}]" + _INTL("You obtained \\c[1]{1}\\c[0]!", itemname) + "\\wtnp[30]") elsif item.is_machine? # TM or HM - pbMessage("\\me[#{meName}]" + _INTL("You obtained \\c[1]{1} {2}\\c[0]!", itemname, GameData::Move.get(move).name) + "\\wtnp[30]") + if quantity > 1 + pbMessage("\\me[#{meName}]" + _INTL("You obtained {1} \\c[1]{2} {3}\\c[0]!", + quantity, itemname, GameData::Move.get(move).name) + "\\wtnp[30]") + else + pbMessage("\\me[#{meName}]" + _INTL("You obtained \\c[1]{1} {2}\\c[0]!", + itemname, GameData::Move.get(move).name) + "\\wtnp[30]") + end elsif quantity > 1 pbMessage("\\me[#{meName}]" + _INTL("You obtained {1} \\c[1]{2}\\c[0]!", quantity, itemname) + "\\wtnp[30]") elsif itemname.starts_with_vowel?