From b86d5b5b57c6f73d65ebac19ccf8f08cb51e2546 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Thu, 16 May 2024 19:18:35 +0100 Subject: [PATCH] Fixed incorrect reflection layering, fixed Metal Burst counting damage taken by a substitute, fixed Metal Burst not trying to target all battlers that hit it, fixed Mega Scizor's stats --- Data/Scripts/005_Sprites/004_Sprite_Reflection.rb | 3 ++- Data/Scripts/006_Map renderer/001_TilemapRenderer.rb | 2 +- Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb | 8 ++++---- .../003_Move/012_MoveEffects_ChangeMoveEffect.rb | 9 ++++++--- PBS/Gen 6 backup/pokemon_forms.txt | 2 +- PBS/Gen 7 backup/pokemon_forms.txt | 2 +- PBS/Gen 8 backup/pokemon_forms.txt | 2 +- PBS/pokemon_forms.txt | 2 +- 8 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Data/Scripts/005_Sprites/004_Sprite_Reflection.rb b/Data/Scripts/005_Sprites/004_Sprite_Reflection.rb index 504037bc0..97c38b2ed 100644 --- a/Data/Scripts/005_Sprites/004_Sprite_Reflection.rb +++ b/Data/Scripts/005_Sprites/004_Sprite_Reflection.rb @@ -63,7 +63,8 @@ class Sprite_Reflection @sprite.ox = width / 2 @sprite.oy = (height / 2) - 2 # Hard-coded 2 pixel shift up @sprite.oy -= event.bob_height * 2 - @sprite.z = -50 # Still water is -100, map is 0 and above + @sprite.z = @parent_sprite.groundY - (Graphics.height / 2) + @sprite.z -= 1000 # Still water is -2000, map is 0 and above @sprite.z += 1 if event == $game_player @sprite.zoom_x = @parent_sprite.zoom_x if Settings::ANIMATE_REFLECTIONS && !GameData::MapMetadata.try_get(event.map_id)&.still_reflections diff --git a/Data/Scripts/006_Map renderer/001_TilemapRenderer.rb b/Data/Scripts/006_Map renderer/001_TilemapRenderer.rb index 3d556b40d..19873d0e6 100644 --- a/Data/Scripts/006_Map renderer/001_TilemapRenderer.rb +++ b/Data/Scripts/006_Map renderer/001_TilemapRenderer.rb @@ -420,7 +420,7 @@ class TilemapRenderer def refresh_tile_z(tile, map, y, layer, tile_id) if tile.shows_reflection - tile.z = -100 + tile.z = -2000 elsif tile.bridge && $PokemonGlobal.bridge > 0 tile.z = 0 else 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 10b06a44e..3d0435fd7 100644 --- a/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb +++ b/Data/Scripts/011_Battle/003_Move/002_Move_Usage.rb @@ -382,6 +382,10 @@ class Battle::Move target.effects[PBEffects::MirrorCoat] = damage target.effects[PBEffects::MirrorCoatTarget] = user.index end + if target.opposes?(user) + target.lastHPLostFromFoe = damage # For Metal Burst + target.lastFoeAttacker.push(user.pokemonIndex) # For Metal Burst + end end if target.effects[PBEffects::Bide] > 0 target.effects[PBEffects::BideDamage] += damage @@ -392,10 +396,6 @@ class Battle::Move target.tookMoveDamageThisRound = true if damage > 0 && !target.damageState.substitute # For Focus Punch target.tookDamageThisRound = true if damage > 0 # For Assurance target.lastAttacker.push(user.index) # For Revenge - if target.opposes?(user) - target.lastHPLostFromFoe = damage # For Metal Burst - target.lastFoeAttacker.push(user.index) # For Metal Burst - end if $game_temp.party_direct_damage_taken && $game_temp.party_direct_damage_taken[target.pokemonIndex] && target.pbOwnedByPlayer? diff --git a/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb b/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb index d76510224..2ee8d1b28 100644 --- a/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb +++ b/Data/Scripts/011_Battle/003_Move/012_MoveEffects_ChangeMoveEffect.rb @@ -505,9 +505,12 @@ end class Battle::Move::CounterDamagePlusHalf < Battle::Move::FixedDamageMove def pbAddTarget(targets, user) return if user.lastFoeAttacker.length == 0 - lastAttacker = user.lastFoeAttacker.last - return if lastAttacker < 0 || !user.opposes?(lastAttacker) - user.pbAddTarget(targets, user, @battle.battlers[lastAttacker], self, false) + user.lastFoeAttacker.reverse_each do |party_index| + battler = @battle.pbFindBattler(party_index, user.index + 1) + next if !battler + user.pbAddTarget(targets, user, battler, self, false) + break + end end def pbMoveFailed?(user, targets) diff --git a/PBS/Gen 6 backup/pokemon_forms.txt b/PBS/Gen 6 backup/pokemon_forms.txt index 5959aa278..e599dcd96 100644 --- a/PBS/Gen 6 backup/pokemon_forms.txt +++ b/PBS/Gen 6 backup/pokemon_forms.txt @@ -276,7 +276,7 @@ Generation = 6 [SCIZOR,1] FormName = Mega Scizor MegaStone = SCIZORITE -BaseStats = 70,150,140,65,100,75 +BaseStats = 70,150,140,75,65,100 Abilities = TECHNICIAN HiddenAbilities = TECHNICIAN Height = 2.0 diff --git a/PBS/Gen 7 backup/pokemon_forms.txt b/PBS/Gen 7 backup/pokemon_forms.txt index 0e1fc76b1..7c6c02983 100644 --- a/PBS/Gen 7 backup/pokemon_forms.txt +++ b/PBS/Gen 7 backup/pokemon_forms.txt @@ -554,7 +554,7 @@ Generation = 6 [SCIZOR,1] FormName = Mega Scizor MegaStone = SCIZORITE -BaseStats = 70,150,140,65,100,75 +BaseStats = 70,150,140,75,65,100 BaseExp = 210 Abilities = TECHNICIAN HiddenAbilities = TECHNICIAN diff --git a/PBS/Gen 8 backup/pokemon_forms.txt b/PBS/Gen 8 backup/pokemon_forms.txt index 08ae264e4..ab3e8aec6 100644 --- a/PBS/Gen 8 backup/pokemon_forms.txt +++ b/PBS/Gen 8 backup/pokemon_forms.txt @@ -727,7 +727,7 @@ Generation = 6 [SCIZOR,1] FormName = Mega Scizor MegaStone = SCIZORITE -BaseStats = 70,150,140,65,100,75 +BaseStats = 70,150,140,75,65,100 BaseExp = 210 Abilities = TECHNICIAN HiddenAbilities = TECHNICIAN diff --git a/PBS/pokemon_forms.txt b/PBS/pokemon_forms.txt index 08ae264e4..ab3e8aec6 100644 --- a/PBS/pokemon_forms.txt +++ b/PBS/pokemon_forms.txt @@ -727,7 +727,7 @@ Generation = 6 [SCIZOR,1] FormName = Mega Scizor MegaStone = SCIZORITE -BaseStats = 70,150,140,65,100,75 +BaseStats = 70,150,140,75,65,100 BaseExp = 210 Abilities = TECHNICIAN HiddenAbilities = TECHNICIAN