From fc538a09f780ce9d0160c97695ee06154854cdb3 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Mon, 30 Sep 2024 21:44:36 +0100 Subject: [PATCH] Fixed Focus Band only triggering at full HP, made more text translatable --- .../005_SpriteWindow_text.rb | 1 - .../011_Battle/001_Battle/001_Battle.rb | 6 ++-- .../011_Battle/003_Move/002_Move_Usage.rb | 30 +++++++++---------- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb b/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb index 2569e6e4d..544f746f8 100644 --- a/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb +++ b/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb @@ -571,7 +571,6 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base end end - # TODO: Why is this called 4 times per loop in pbMessageDisplay? def update super @pausesprite.update if @pausesprite&.visible diff --git a/Data/Scripts/011_Battle/001_Battle/001_Battle.rb b/Data/Scripts/011_Battle/001_Battle/001_Battle.rb index 0be402f9b..53723a5b2 100644 --- a/Data/Scripts/011_Battle/001_Battle/001_Battle.rb +++ b/Data/Scripts/011_Battle/001_Battle/001_Battle.rb @@ -785,17 +785,17 @@ class Battle when :HarshSun if !pbCheckGlobalAbility(:DESOLATELAND) @field.weather = :None - pbDisplay("The harsh sunlight faded!") + pbDisplay(_INTL("The harsh sunlight faded!")) end when :HeavyRain if !pbCheckGlobalAbility(:PRIMORDIALSEA) @field.weather = :None - pbDisplay("The heavy rain has lifted!") + pbDisplay(_INTL("The heavy rain has lifted!")) end when :StrongWinds if !pbCheckGlobalAbility(:DELTASTREAM) @field.weather = :None - pbDisplay("The mysterious air current has dissipated!") + pbDisplay(_INTL("The mysterious air current has dissipated!")) end end if @field.weather != oldWeather diff --git a/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb b/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb index 15615ca75..d3bf9afbd 100644 --- a/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb +++ b/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb @@ -209,23 +209,21 @@ class Battle::Move elsif target.effects[PBEffects::Endure] target.damageState.endured = true damage -= 1 - elsif damage == target.totalhp - if target.hasActiveAbility?(:STURDY) && !target.beingMoldBroken? - target.damageState.sturdy = true + elsif target.hasActiveAbility?(:STURDY) && !target.beingMoldBroken? && target.hp == target.totalhp + target.damageState.sturdy = true + damage -= 1 + elsif target.hasActiveItem?(:FOCUSSASH) && target.hp == target.totalhp + target.damageState.focusSash = true + damage -= 1 + elsif target.hasActiveItem?(:FOCUSBAND) && @battle.pbRandom(100) < 10 + target.damageState.focusBand = true + damage -= 1 + elsif Settings::AFFECTION_EFFECTS && @battle.internalBattle && + target.pbOwnedByPlayer? && !target.mega? + chance = [0, 0, 0, 10, 15, 25][target.affection_level] + if chance > 0 && @battle.pbRandom(100) < chance + target.damageState.affection_endured = true damage -= 1 - elsif target.hasActiveItem?(:FOCUSSASH) && target.hp == target.totalhp - target.damageState.focusSash = true - damage -= 1 - elsif target.hasActiveItem?(:FOCUSBAND) && @battle.pbRandom(100) < 10 - target.damageState.focusBand = true - damage -= 1 - elsif Settings::AFFECTION_EFFECTS && @battle.internalBattle && - target.pbOwnedByPlayer? && !target.mega? - chance = [0, 0, 0, 10, 15, 25][target.affection_level] - if chance > 0 && @battle.pbRandom(100) < chance - target.damageState.affection_endured = true - damage -= 1 - end end end end