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
This commit is contained in:
Golisopod-User
2022-01-12 03:06:01 +05:30
committed by GitHub
parent 767a47d90f
commit ff465a78a6
6 changed files with 18 additions and 12 deletions

View File

@@ -177,6 +177,11 @@ module Settings
# Whether more abilities affect whether wild Pokémon appear, which Pokémon # Whether more abilities affect whether wild Pokémon appear, which Pokémon
# they are, etc. # they are, etc.
MORE_ABILITIES_AFFECT_WILD_ENCOUNTERS = (MECHANICS_GENERATION >= 8) 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)
#============================================================================= #=============================================================================

View File

@@ -10,6 +10,7 @@ def pbMapInterpreterRunning?
return interp&.running? return interp&.running?
end end
# Unused
def pbRefreshSceneMap def pbRefreshSceneMap
$scene.miniupdate if $scene.is_a?(Scene_Map) $scene.miniupdate if $scene.is_a?(Scene_Map)
end end

View File

@@ -70,7 +70,6 @@ class Battle::Battler
#============================================================================= #=============================================================================
def pbBeginTurn(_choice) def pbBeginTurn(_choice)
# Cancel some lingering effects which only apply until the user next moves # Cancel some lingering effects which only apply until the user next moves
@effects[PBEffects::BeakBlast] = false
@effects[PBEffects::DestinyBondPrevious] = @effects[PBEffects::DestinyBond] @effects[PBEffects::DestinyBondPrevious] = @effects[PBEffects::DestinyBond]
@effects[PBEffects::DestinyBond] = false @effects[PBEffects::DestinyBond] = false
@effects[PBEffects::Grudge] = false @effects[PBEffects::Grudge] = false

View File

@@ -730,31 +730,23 @@ class PBAnimationPlayerX
end end
# Create background colour sprite # Create background colour sprite
@bgColor = ColoredPlane.new(Color.new(0, 0, 0), @viewport) @bgColor = ColoredPlane.new(Color.new(0, 0, 0), @viewport)
@bgColor.borderX = 64 if @inEditor
@bgColor.borderY = 64 if @inEditor
@bgColor.z = 5 @bgColor.z = 5
@bgColor.opacity = 0 @bgColor.opacity = 0
@bgColor.refresh @bgColor.refresh
# Create background graphic sprite # Create background graphic sprite
@bgGraphic = AnimatedPlane.new(@viewport) @bgGraphic = AnimatedPlane.new(@viewport)
@bgGraphic.setBitmap(nil) @bgGraphic.setBitmap(nil)
@bgGraphic.borderX = 64 if @inEditor
@bgGraphic.borderY = 64 if @inEditor
@bgGraphic.z = 5 @bgGraphic.z = 5
@bgGraphic.opacity = 0 @bgGraphic.opacity = 0
@bgGraphic.refresh @bgGraphic.refresh
# Create foreground colour sprite # Create foreground colour sprite
@foColor = ColoredPlane.new(Color.new(0, 0, 0), @viewport) @foColor = ColoredPlane.new(Color.new(0, 0, 0), @viewport)
@foColor.borderX = 64 if @inEditor
@foColor.borderY = 64 if @inEditor
@foColor.z = 85 @foColor.z = 85
@foColor.opacity = 0 @foColor.opacity = 0
@foColor.refresh @foColor.refresh
# Create foreground graphic sprite # Create foreground graphic sprite
@foGraphic = AnimatedPlane.new(@viewport) @foGraphic = AnimatedPlane.new(@viewport)
@foGraphic.setBitmap(nil) @foGraphic.setBitmap(nil)
@foGraphic.borderX = 64 if @inEditor
@foGraphic.borderY = 64 if @inEditor
@foGraphic.z = 85 @foGraphic.z = 85
@foGraphic.opacity = 0 @foGraphic.opacity = 0
@foGraphic.refresh @foGraphic.refresh

View File

@@ -109,11 +109,20 @@ def pbPrepareBattle(battle)
battle.showAnims = ($PokemonSystem.battlescene == 0) battle.showAnims = ($PokemonSystem.battlescene == 0)
battle.showAnims = battleRules["battleAnims"] if !battleRules["battleAnims"].nil? battle.showAnims = battleRules["battleAnims"] if !battleRules["battleAnims"].nil?
# Terrain # 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 # Weather
if battleRules["defaultWeather"].nil? if battleRules["defaultWeather"].nil?
case GameData::Weather.get($game_screen.weather_type).category case GameData::Weather.get($game_screen.weather_type).category
when :Rain when :Rain, :Storm
battle.defaultWeather = :Rain battle.defaultWeather = :Rain
when :Hail when :Hail
battle.defaultWeather = :Hail battle.defaultWeather = :Hail

View File

@@ -352,7 +352,7 @@ class PokemonOption_Scene
end end
pbDisposeMessageWindow(@sprites["textbox"]) pbDisposeMessageWindow(@sprites["textbox"])
pbDisposeSpriteHash(@sprites) pbDisposeSpriteHash(@sprites)
pbRefreshSceneMap pbUpdateSceneMap
@viewport.dispose @viewport.dispose
end end