From 296b1088eca3ab056269f6419f88c148e13c2055 Mon Sep 17 00:00:00 2001 From: m3rein Date: Sat, 5 Sep 2020 12:40:30 +0200 Subject: [PATCH 1/5] Fix nil priority in addTile --- Data/Scripts/005_Map renderer/001_Tilemap_XP.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Data/Scripts/005_Map renderer/001_Tilemap_XP.rb b/Data/Scripts/005_Map renderer/001_Tilemap_XP.rb index c027af1b8..545483059 100644 --- a/Data/Scripts/005_Map renderer/001_Tilemap_XP.rb +++ b/Data/Scripts/005_Map renderer/001_Tilemap_XP.rb @@ -1,5 +1,5 @@ #=============================================================================== -# +# #=============================================================================== class CustomTilemapAutotiles attr_accessor :changed @@ -28,7 +28,7 @@ end #=============================================================================== -# +# #=============================================================================== class CustomTilemap attr_reader :tileset @@ -62,7 +62,7 @@ class CustomTilemap ] Animated_Autotiles_Frames = 5*Graphics.frame_rate/20 # Frequency of updating animated autotiles FlashOpacity = [100,90,80,70,80,90] - + def initialize(viewport) @tileset = nil # Refers to Map Tileset Name @autotiles = CustomTilemapAutotiles.new @@ -371,7 +371,7 @@ class CustomTilemap def addTile(tiles,count,xpos,ypos,id) terrain = @terrain_tags[id] - priority = @priorities[id] + priority = @priorities[id] || 0 if id>=384 if count>=tiles.length sprite = CustomTilemapSprite.new(@viewport) @@ -567,7 +567,7 @@ class CustomTilemap @fullyrefreshedautos = true end else - @fullyrefreshedautos = true + @fullyrefreshedautos = true end end @@ -823,7 +823,7 @@ class CustomTilemap @layer0.visible = false if usesprites end if @fullyrefreshed - if !@priotilesrect || !@priotilesfast || + if !@priotilesrect || !@priotilesfast || @priotilesrect[0]!=minX || @priotilesrect[1]!=minY || @priotilesrect[2]!=maxX || @@ -843,7 +843,7 @@ class CustomTilemap count = addTile(@tiles,count,xpos,ypos,prio[3]) end else - if !@priotilesrect || !@priotilesfast || + if !@priotilesrect || !@priotilesfast || @priotilesrect[0]!=minX || @priotilesrect[1]!=minY || @priotilesrect[2]!=maxX || @@ -944,4 +944,4 @@ class CustomTilemap @autotiles.changed = false @tilesetChanged = false end -end \ No newline at end of file +end From 990be3757c2fe75cda6b133b96b3e0d0282686b7 Mon Sep 17 00:00:00 2001 From: m3rein Date: Sat, 5 Sep 2020 13:01:41 +0200 Subject: [PATCH 2/5] Fix use of wrong variable in Protean --- .../Scripts/011_Battle/001_Battler/007_Battler_UseMove.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Data/Scripts/011_Battle/001_Battler/007_Battler_UseMove.rb b/Data/Scripts/011_Battle/001_Battler/007_Battler_UseMove.rb index aa32fd603..dc94eda63 100644 --- a/Data/Scripts/011_Battle/001_Battler/007_Battler_UseMove.rb +++ b/Data/Scripts/011_Battle/001_Battler/007_Battler_UseMove.rb @@ -65,7 +65,7 @@ class PokeBattle_Battler end #============================================================================= - # + # #============================================================================= def pbBeginTurn(choice) # Cancel some lingering effects which only apply until the user next moves @@ -255,7 +255,7 @@ class PokeBattle_Battler end @battle.lastMoveUsed = move.id # For Copycat @battle.lastMoveUser = @index # For "self KO" battle clause to avoid draws - @battle.successStates[@index].useState = 1 # Battle Arena - assume failure + @battle.successStates[@index].useState = 1 # Battle Arena - assume failure # Find the default user (self or Snatcher) and target(s) user = pbFindUser(choice,move) user = pbChangeUser(choice,move,user) @@ -360,7 +360,7 @@ class PokeBattle_Battler end # Protean if user.hasActiveAbility?(:PROTEAN) && !move.callsAnotherMove? && !move.snatched - if user.pbHasOtherType?(moveType) && !PBTypes.isPseudoType?(move.calcType) + if user.pbHasOtherType?(move.calcType) && !PBTypes.isPseudoType?(move.calcType) @battle.pbShowAbilitySplash(user) user.pbChangeTypes(move.calcType) typeName = PBTypes.getName(move.calcType) @@ -726,4 +726,4 @@ class PokeBattle_Battler user.pbFaint if user.fainted? return true end -end \ No newline at end of file +end From 9aebe1e4d2bcb7c2608d3316160506ac31e9d848 Mon Sep 17 00:00:00 2001 From: m3rein Date: Sat, 5 Sep 2020 13:18:11 +0200 Subject: [PATCH 3/5] Fixed swapped baseDmg and type parameters in DamageCalcUserAbility --- .../011_Battle/002_Move/003_Move_Usage_Calculations.rb | 4 ++-- Data/Scripts/011_Battle/007_BattleHandlers_Abilities.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Data/Scripts/011_Battle/002_Move/003_Move_Usage_Calculations.rb b/Data/Scripts/011_Battle/002_Move/003_Move_Usage_Calculations.rb index 497e7322b..41bb7f38d 100644 --- a/Data/Scripts/011_Battle/002_Move/003_Move_Usage_Calculations.rb +++ b/Data/Scripts/011_Battle/002_Move/003_Move_Usage_Calculations.rb @@ -255,7 +255,7 @@ class PokeBattle_Move target.damageState.calcDamage = damage end - def pbCalcDamageMultipliers(user,target,numTargets,baseDmg,type,multipliers) + def pbCalcDamageMultipliers(user,target,numTargets,type,baseDmg,multipliers) # Global abilities if (@battle.pbCheckGlobalAbility(:DARKAURA) && isConst?(type,PBTypes,:DARK)) || (@battle.pbCheckGlobalAbility(:FAIRYAURA) && isConst?(type,PBTypes,:FAIRY)) @@ -488,4 +488,4 @@ class PokeBattle_Move user.pbOwnSide.effects[PBEffects::Rainbow]>0 return ret end -end \ No newline at end of file +end diff --git a/Data/Scripts/011_Battle/007_BattleHandlers_Abilities.rb b/Data/Scripts/011_Battle/007_BattleHandlers_Abilities.rb index 687bdd2d8..53504a98e 100644 --- a/Data/Scripts/011_Battle/007_BattleHandlers_Abilities.rb +++ b/Data/Scripts/011_Battle/007_BattleHandlers_Abilities.rb @@ -656,7 +656,7 @@ BattleHandlers::MoveImmunityTargetAbility.add(:SOUNDPROOF, end battle.pbHideAbilitySplash(target) next true - + } ) @@ -2239,7 +2239,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:FOREWARN, # Counter, Mirror Coat, Metal Burst power = 120 if ["071","072","073"].include?(moveData[MOVE_FUNCTION_CODE]) # Sonic Boom, Dragon Rage, Night Shade, Endeavor, Psywave, - # Return, Frustration, Crush Grip, Gyro Ball, Hidden Power, + # Return, Frustration, Crush Grip, Gyro Ball, Hidden Power, # Natural Gift, Trump Card, Flail, Grass Knot power = 80 if ["06A","06B","06D","06E","06F", "089","08A","08C","08D","090", @@ -2504,4 +2504,4 @@ BattleHandlers::RunFromBattleAbility.add(:RUNAWAY, proc { |ability,battler| next true } -) \ No newline at end of file +) From d57e1dd0c1c546b662a14eb9c2852d81b2de36c8 Mon Sep 17 00:00:00 2001 From: m3rein Date: Sat, 5 Sep 2020 13:38:34 +0200 Subject: [PATCH 4/5] Added ESSENTIALS_VERSION to the save file (with backwards compatibility) --- Data/Scripts/016_UI/013_PScreen_Load.rb | 15 ++++++++------- Data/Scripts/016_UI/014_PScreen_Save.rb | 3 ++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Data/Scripts/016_UI/013_PScreen_Load.rb b/Data/Scripts/016_UI/013_PScreen_Load.rb index 79c32a391..8b838c743 100644 --- a/Data/Scripts/016_UI/013_PScreen_Load.rb +++ b/Data/Scripts/016_UI/013_PScreen_Load.rb @@ -1,6 +1,6 @@ class PokemonLoadPanel < SpriteWrapper attr_reader :selected - + TEXTCOLOR = Color.new(232,232,232) TEXTSHADOWCOLOR = Color.new(136,136,136) MALETEXTCOLOR = Color.new(56,160,248) @@ -19,7 +19,7 @@ class PokemonLoadPanel < SpriteWrapper @selected = (index==0) @bgbitmap = AnimatedBitmap.new("Graphics/Pictures/loadPanels") @refreshBitmap = true - @refreshing = false + @refreshing = false refresh end @@ -356,6 +356,7 @@ class PokemonLoadScreen metadata = Marshal.load(f) $PokemonBag = Marshal.load(f) $PokemonStorage = Marshal.load(f) + $SaveVersion = Marshal.load(f) unless f.eof? pbRefreshResizeFactor # To fix Game_Screen pictures magicNumberMatches = false if $data_system.respond_to?("magic_number") @@ -456,12 +457,12 @@ class PokemonLoadScreen savedata = [] if safeExists?(savefile) File.open(savefile,"rb") { |f| - 15.times { savedata.push(Marshal.load(f)) } + 16.times { savedata.push(Marshal.load(f)) } } savedata[3]=$PokemonSystem begin File.open(RTP.getSaveFileName("Game.rxdata"),"wb") { |f| - 15.times { |i| Marshal.dump(savedata[i],f) } + 16.times { |i| Marshal.dump(savedata[i],f) } } rescue end @@ -495,7 +496,7 @@ module FontInstaller 'pkmnrs.ttf', 'pkmndp.ttf', 'pkmnfl.ttf' - ] + ] # names (not filenames) of fonts to be installed Names = [ 'Power Green', @@ -520,7 +521,7 @@ module FontInstaller return ENV['windir'] + '\\Fonts\\' else return '\\Windows\\Fonts\\' - end + end end AFR = Win32API.new('gdi32', 'AddFontResource', ['P'], 'L') @@ -628,4 +629,4 @@ module FontInstaller pbMessage(_INTL("To install the necessary fonts, copy the files in this game's Fonts folder to the Fonts folder in Control Panel.")) end end -end \ No newline at end of file +end diff --git a/Data/Scripts/016_UI/014_PScreen_Save.rb b/Data/Scripts/016_UI/014_PScreen_Save.rb index de7c82b4b..d5bec2926 100644 --- a/Data/Scripts/016_UI/014_PScreen_Save.rb +++ b/Data/Scripts/016_UI/014_PScreen_Save.rb @@ -24,6 +24,7 @@ def pbSave(safesave=false) Marshal.dump($PokemonMap,f) Marshal.dump($PokemonBag,f) Marshal.dump($PokemonStorage,f) + Marshal.dump(ESSENTIALS_VERSION,f) } Graphics.frame_reset rescue @@ -153,4 +154,4 @@ def pbSaveScreen screen = PokemonSaveScreen.new(scene) ret = screen.pbSaveScreen return ret -end \ No newline at end of file +end From 866f543e97016f9c3f4a088f97eb8d5816d4b141 Mon Sep 17 00:00:00 2001 From: m3rein Date: Sat, 5 Sep 2020 17:11:36 +0200 Subject: [PATCH 5/5] Removed default tile priority --- Data/Scripts/005_Map renderer/001_Tilemap_XP.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data/Scripts/005_Map renderer/001_Tilemap_XP.rb b/Data/Scripts/005_Map renderer/001_Tilemap_XP.rb index 545483059..c56916963 100644 --- a/Data/Scripts/005_Map renderer/001_Tilemap_XP.rb +++ b/Data/Scripts/005_Map renderer/001_Tilemap_XP.rb @@ -371,7 +371,7 @@ class CustomTilemap def addTile(tiles,count,xpos,ypos,id) terrain = @terrain_tags[id] - priority = @priorities[id] || 0 + priority = @priorities[id] if id>=384 if count>=tiles.length sprite = CustomTilemapSprite.new(@viewport)