From ff465a78a694078a7d65a2e1e837cbab5e77916c Mon Sep 17 00:00:00 2001 From: Golisopod-User <70828713+Golisopod-User@users.noreply.github.com> Date: Wed, 12 Jan 2022 03:06:01 +0530 Subject: [PATCH] More bugfixes (and one Gen 8 addition) (#155) * Added comment indicating unused method pbRefreshSceneMap * Removed superfluous ending of Beak Blast's effect * Fixed crash when playing an animation in the animation player * Added SwSh Terrain effects --- Data/Scripts/001_Settings.rb | 5 +++++ .../Scripts/007_Objects and windows/011_Messages.rb | 1 + .../011_Battle/002_Battler/007_Battler_UseMove.rb | 1 - .../007_BattleAnimationPlayer.rb | 8 -------- .../001_Overworld_BattleStarting.rb | 13 +++++++++++-- Data/Scripts/016_UI/015_UI_Options.rb | 2 +- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Data/Scripts/001_Settings.rb b/Data/Scripts/001_Settings.rb index 4b570ac42..5e0740024 100644 --- a/Data/Scripts/001_Settings.rb +++ b/Data/Scripts/001_Settings.rb @@ -177,6 +177,11 @@ module Settings # Whether more abilities affect whether wild Pokémon appear, which Pokémon # they are, etc. MORE_ABILITIES_AFFECT_WILD_ENCOUNTERS = (MECHANICS_GENERATION >= 8) + # Whether weather effects set the default terrains in battle (true) or + # not (false). Eg.: + # * Storm weather sets Electric Terrain + # * Fog weather sets Misty Terrain + OVERWORLD_WEATHERS_SET_TERRAINS = (MECHANICS_GENERATION >= 8) #============================================================================= diff --git a/Data/Scripts/007_Objects and windows/011_Messages.rb b/Data/Scripts/007_Objects and windows/011_Messages.rb index b2929668b..aba65ddbf 100644 --- a/Data/Scripts/007_Objects and windows/011_Messages.rb +++ b/Data/Scripts/007_Objects and windows/011_Messages.rb @@ -10,6 +10,7 @@ def pbMapInterpreterRunning? return interp&.running? end +# Unused def pbRefreshSceneMap $scene.miniupdate if $scene.is_a?(Scene_Map) end diff --git a/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb b/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb index a0c1b7c4b..2e8209c8f 100644 --- a/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb +++ b/Data/Scripts/011_Battle/002_Battler/007_Battler_UseMove.rb @@ -70,7 +70,6 @@ class Battle::Battler #============================================================================= def pbBeginTurn(_choice) # Cancel some lingering effects which only apply until the user next moves - @effects[PBEffects::BeakBlast] = false @effects[PBEffects::DestinyBondPrevious] = @effects[PBEffects::DestinyBond] @effects[PBEffects::DestinyBond] = false @effects[PBEffects::Grudge] = false diff --git a/Data/Scripts/011_Battle/006_Other battle code/007_BattleAnimationPlayer.rb b/Data/Scripts/011_Battle/006_Other battle code/007_BattleAnimationPlayer.rb index b1cb0c0e2..7480b6ac3 100644 --- a/Data/Scripts/011_Battle/006_Other battle code/007_BattleAnimationPlayer.rb +++ b/Data/Scripts/011_Battle/006_Other battle code/007_BattleAnimationPlayer.rb @@ -730,31 +730,23 @@ class PBAnimationPlayerX end # Create background colour sprite @bgColor = ColoredPlane.new(Color.new(0, 0, 0), @viewport) - @bgColor.borderX = 64 if @inEditor - @bgColor.borderY = 64 if @inEditor @bgColor.z = 5 @bgColor.opacity = 0 @bgColor.refresh # Create background graphic sprite @bgGraphic = AnimatedPlane.new(@viewport) @bgGraphic.setBitmap(nil) - @bgGraphic.borderX = 64 if @inEditor - @bgGraphic.borderY = 64 if @inEditor @bgGraphic.z = 5 @bgGraphic.opacity = 0 @bgGraphic.refresh # Create foreground colour sprite @foColor = ColoredPlane.new(Color.new(0, 0, 0), @viewport) - @foColor.borderX = 64 if @inEditor - @foColor.borderY = 64 if @inEditor @foColor.z = 85 @foColor.opacity = 0 @foColor.refresh # Create foreground graphic sprite @foGraphic = AnimatedPlane.new(@viewport) @foGraphic.setBitmap(nil) - @foGraphic.borderX = 64 if @inEditor - @foGraphic.borderY = 64 if @inEditor @foGraphic.z = 85 @foGraphic.opacity = 0 @foGraphic.refresh diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb index 5ea0469f7..15b1a1556 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb @@ -109,11 +109,20 @@ def pbPrepareBattle(battle) battle.showAnims = ($PokemonSystem.battlescene == 0) battle.showAnims = battleRules["battleAnims"] if !battleRules["battleAnims"].nil? # Terrain - battle.defaultTerrain = battleRules["defaultTerrain"] if !battleRules["defaultTerrain"].nil? + if battleRules["defaultTerrain"].nil? && Settings::OVERWORLD_WEATHERS_SET_TERRAINS + case $game_screen.weather_type + when :Storm + battle.defaultTerrain = :Electric + when :Fog + battle.defaultTerrain = :Misty + end + else + battle.defaultTerrain = battleRules["defaultTerrain"] + end # Weather if battleRules["defaultWeather"].nil? case GameData::Weather.get($game_screen.weather_type).category - when :Rain + when :Rain, :Storm battle.defaultWeather = :Rain when :Hail battle.defaultWeather = :Hail diff --git a/Data/Scripts/016_UI/015_UI_Options.rb b/Data/Scripts/016_UI/015_UI_Options.rb index 9831bf5e3..a9f3b76f9 100644 --- a/Data/Scripts/016_UI/015_UI_Options.rb +++ b/Data/Scripts/016_UI/015_UI_Options.rb @@ -352,7 +352,7 @@ class PokemonOption_Scene end pbDisposeMessageWindow(@sprites["textbox"]) pbDisposeSpriteHash(@sprites) - pbRefreshSceneMap + pbUpdateSceneMap @viewport.dispose end