From 19535b81607aca2aad4d364e7afaeab41e560dc9 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Thu, 12 Aug 2021 20:00:42 +0100 Subject: [PATCH 1/2] Fixed Symbiosis, fixed Roost not roosting, fixed Normalize not boosting damage, fixed crash in Bug Catching Contest, fixed old format moves.txt compiling, added cache size text to console --- .../Scripts/001_Technical/001_Debugging/002_DebugConsole.rb | 1 + .../011_Battle/001_Battler/006_Battler_AbilityAndItem.rb | 2 +- .../Scripts/011_Battle/002_Move/006_Move_Effects_080-0FF.rb | 3 ++- Data/Scripts/011_Battle/003_BattleHandlers_Abilities.rb | 2 +- .../002_Battle triggering/003_Overworld_WildEncounters.rb | 6 +----- Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb | 3 ++- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Data/Scripts/001_Technical/001_Debugging/002_DebugConsole.rb b/Data/Scripts/001_Technical/001_Debugging/002_DebugConsole.rb index 2b87d941f..85a2600be 100644 --- a/Data/Scripts/001_Technical/001_Debugging/002_DebugConsole.rb +++ b/Data/Scripts/001_Technical/001_Debugging/002_DebugConsole.rb @@ -4,6 +4,7 @@ module Console def self.setup_console return unless $DEBUG + echoln "GPU Cache Max: #{Bitmap.max_size}" echoln "--------------------------------" echoln "#{System.game_title} Output Window" echoln "--------------------------------" diff --git a/Data/Scripts/011_Battle/001_Battler/006_Battler_AbilityAndItem.rb b/Data/Scripts/011_Battle/001_Battler/006_Battler_AbilityAndItem.rb index 577773957..b7d139003 100644 --- a/Data/Scripts/011_Battle/001_Battler/006_Battler_AbilityAndItem.rb +++ b/Data/Scripts/011_Battle/001_Battler/006_Battler_AbilityAndItem.rb @@ -159,7 +159,7 @@ class PokeBattle_Battler def pbSymbiosis return if fainted? - return if !self.item + return if self.item @battle.pbPriority(true).each do |b| next if b.opposes? next if !b.hasActiveAbility?(:SYMBIOSIS) diff --git a/Data/Scripts/011_Battle/002_Move/006_Move_Effects_080-0FF.rb b/Data/Scripts/011_Battle/002_Move/006_Move_Effects_080-0FF.rb index 637f6ca51..c6a7a5958 100644 --- a/Data/Scripts/011_Battle/002_Move/006_Move_Effects_080-0FF.rb +++ b/Data/Scripts/011_Battle/002_Move/006_Move_Effects_080-0FF.rb @@ -2494,7 +2494,8 @@ class PokeBattle_Move_0D6 < PokeBattle_HealingMove return (user.totalhp/2.0).round end - def pbEffectAfterAllHits(user,target) + def pbEffectGeneral(user) + super user.effects[PBEffects::Roost] = true end end diff --git a/Data/Scripts/011_Battle/003_BattleHandlers_Abilities.rb b/Data/Scripts/011_Battle/003_BattleHandlers_Abilities.rb index 030a4e300..802929fb1 100644 --- a/Data/Scripts/011_Battle/003_BattleHandlers_Abilities.rb +++ b/Data/Scripts/011_Battle/003_BattleHandlers_Abilities.rb @@ -871,7 +871,7 @@ BattleHandlers::DamageCalcUserAbility.add(:AERILATE, } ) -BattleHandlers::DamageCalcUserAbility.copy(:AERILATE,:PIXILATE,:REFRIGERATE,:GALVANIZE) +BattleHandlers::DamageCalcUserAbility.copy(:AERILATE, :PIXILATE, :REFRIGERATE, :GALVANIZE, :NORMALIZE) BattleHandlers::DamageCalcUserAbility.add(:ANALYTIC, proc { |ability,user,target,move,mults,baseDmg,type| diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb b/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb index c391e078f..816509815 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/003_Overworld_WildEncounters.rb @@ -346,11 +346,7 @@ class PokemonEncounters chance_total = 0 enc_list.each { |a| chance_total += a[0] } # Choose a random entry in the encounter table based on entry probabilities - rnd = 0 - chance_rolls.times do - r = rand(chance_total) - rnd = r if r > rnd # Prefer rarer entries if rolling repeatedly - end + rnd = rand(chance_total) encounter = nil enc_list.each do |enc| rnd -= enc[0] diff --git a/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb b/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb index c4eccfda7..6b1f9fc38 100644 --- a/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb +++ b/Data/Scripts/021_Compiler/002_Compiler_CompilePBS.rb @@ -1322,7 +1322,8 @@ module Compiler end # Write all line data to hash moves = [line_data[3], line_data[4], line_data[5], line_data[6]] - moves.uniq!.compact! + moves.uniq! + moves.compact! ivs = {} if line_data[12] GameData::Stat.each_main do |s| From 4b768bec320d1243f431782c639053bfbd1a1fce Mon Sep 17 00:00:00 2001 From: FL Date: Thu, 12 Aug 2021 16:23:27 -0300 Subject: [PATCH 2/2] Fix event command "Return to Title Screen" (#124) Fix loading a game after event command "Return to Title Screen" starting a loop. --- Data/Scripts/002_Save data/002_SaveData_Value.rb | 12 ++++++++++++ Data/Scripts/003_Game processing/002_Scene_Map.rb | 2 ++ 2 files changed, 14 insertions(+) diff --git a/Data/Scripts/002_Save data/002_SaveData_Value.rb b/Data/Scripts/002_Save data/002_SaveData_Value.rb index 92d2d2077..7e5bdf9da 100644 --- a/Data/Scripts/002_Save data/002_SaveData_Value.rb +++ b/Data/Scripts/002_Save data/002_SaveData_Value.rb @@ -75,6 +75,11 @@ module SaveData return @loaded end + # Marks value as unloaded. + def mark_as_unloaded + @loaded = false + end + # Uses the {#from_old_format} proc to select the correct data from # +old_format+ and return it. # Returns nil if the proc is undefined. @@ -221,6 +226,13 @@ module SaveData load_values(save_data) { |value| !value.loaded? } end + # Marks all values that aren't loaded on bootup as unloaded. + def self.mark_values_as_unloaded + @values.each do |value| + value.mark_as_unloaded unless value.load_in_bootup? + end + end + # Loads each value from the given save data that has # been set to be loaded during bootup. Done when a save file exists. # @param save_data [Hash] save data to load diff --git a/Data/Scripts/003_Game processing/002_Scene_Map.rb b/Data/Scripts/003_Game processing/002_Scene_Map.rb index d36e424fb..8b5996f2a 100644 --- a/Data/Scripts/003_Game processing/002_Scene_Map.rb +++ b/Data/Scripts/003_Game processing/002_Scene_Map.rb @@ -164,6 +164,8 @@ class Scene_Map end updateSpritesets if $game_temp.to_title + $game_temp.to_title = false + SaveData.mark_values_as_unloaded $scene = pbCallTitle return end