diff --git a/Data/Scripts/001_Technical/008_Sprite_Resizer.rb b/Data/Scripts/001_Technical/008_Sprite_Resizer.rb index d18f46bc7..dca5b569f 100644 --- a/Data/Scripts/001_Technical/008_Sprite_Resizer.rb +++ b/Data/Scripts/001_Technical/008_Sprite_Resizer.rb @@ -21,15 +21,17 @@ def pbSetResizeFactor(factor) Graphics.resize_screen(SCREEN_WIDTH, SCREEN_HEIGHT) $ResizeInitialized = true end - if factor < 0 || factor == 3 + if factor < 0 || factor == 4 Graphics.fullscreen = true if !Graphics.fullscreen else Graphics.fullscreen = false if Graphics.fullscreen - Graphics.scale = factor + Graphics.scale = (factor + 1) * 0.5 Graphics.center end end +=begin +# Unused def pbRefreshResizeFactor ObjectSpace.each_object(Sprite) { |o| next if o.disposed? @@ -119,6 +121,7 @@ def pbConfigureWindowedScreen(value) pbSetResizeFactor2(value,true) Win32API.restoreScreen end +=end def setScreenBorderName(border) if !$HaveResizeBorder @@ -187,6 +190,8 @@ module Graphics @@haveresizescreen = true @@deletefailed = false +=begin + # TODO: Can this be removed? def self.snap_to_bitmap(resize=true) tempPath = ENV["TEMP"]+"\\tempscreen.bmp" if safeExists?(tempPath) && @@deletefailed @@ -243,10 +248,11 @@ module Graphics end return bm end +=end end - +=begin class Sprite unless @SpriteResizerMethodsAliased alias _initialize_SpriteResizer initialize @@ -570,7 +576,7 @@ class Plane @resizedZoomY=val end end - +=end diff --git a/Data/Scripts/011_Data/001_Game data/001_Game data.rb b/Data/Scripts/011_Data/001_Game data/001_Game data.rb index b96d8af0c..b71661605 100644 --- a/Data/Scripts/011_Data/001_Game data/001_Game data.rb +++ b/Data/Scripts/011_Data/001_Game data/001_Game data.rb @@ -117,4 +117,13 @@ module GameData return false end end + + def self.load_all + Ability.load + Item.load + Move.load + BerryPlant.load + Metadata.load + MapMetadata.load + end end diff --git a/Data/Scripts/013_Overworld/007_PField_Encounters.rb b/Data/Scripts/013_Overworld/007_PField_Encounters.rb index d12cc843d..63eec4aeb 100644 --- a/Data/Scripts/013_Overworld/007_PField_Encounters.rb +++ b/Data/Scripts/013_Overworld/007_PField_Encounters.rb @@ -415,7 +415,7 @@ def pbGenerateWildPokemon(species,level,isRoamer=false) if GameData::Item.exists?(:SHINYCHARM) && $PokemonBag.pbHasItem?(:SHINYCHARM) 2.times do # 3 times as likely break if genwildpoke.shiny? - genwildpoke.personalID = rand(65536)|(rand(65536)<<16) + genwildpoke.personalID = rand(2**16) | rand(2**16) << 16 end end # Give Pokérus diff --git a/Data/Scripts/013_Overworld/013_PField_DayCare.rb b/Data/Scripts/013_Overworld/013_PField_DayCare.rb index 01929ef72..6436cf136 100644 --- a/Data/Scripts/013_Overworld/013_PField_DayCare.rb +++ b/Data/Scripts/013_Overworld/013_PField_DayCare.rb @@ -351,7 +351,7 @@ def pbDayCareGenerateEgg if shinyretries>0 shinyretries.times do break if egg.shiny? - egg.personalID = rand(65536)|(rand(65536)<<16) + egg.personalID = rand(2**16) | rand(2**16) << 16 end end # Inheriting ability from the mother diff --git a/Data/Scripts/016_Pokemon/001_Pokemon.rb b/Data/Scripts/016_Pokemon/001_Pokemon.rb index 7dd6314c9..bb128011b 100644 --- a/Data/Scripts/016_Pokemon/001_Pokemon.rb +++ b/Data/Scripts/016_Pokemon/001_Pokemon.rb @@ -1047,7 +1047,7 @@ class Pokemon end @species = realSpecies @name = PBSpecies.getName(@species) - @personalID = rand(2**32) + @personalID = rand(2**16) | rand(2**16) << 16 @hp = 1 @totalhp = 1 @iv = [] diff --git a/Data/Scripts/017_UI/013_PScreen_Load.rb b/Data/Scripts/017_UI/013_PScreen_Load.rb index 4902726f2..8a724ea52 100644 --- a/Data/Scripts/017_UI/013_PScreen_Load.rb +++ b/Data/Scripts/017_UI/013_PScreen_Load.rb @@ -355,7 +355,6 @@ class PokemonLoadScreen $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") magicNumberMatches = ($game_system.magic_number==$data_system.magic_number) @@ -427,7 +426,6 @@ class PokemonLoadScreen $PokemonStorage = PokemonStorage.new $PokemonEncounters = PokemonEncounters.new $PokemonTemp.begunNewGame = true - pbRefreshResizeFactor # To fix Game_Screen pictures $data_system = pbLoadRxData("Data/System") $MapFactory = PokemonMapFactory.new($data_system.start_map_id) # calls setMapChanged $game_player.moveto($data_system.start_x, $data_system.start_y) diff --git a/Data/Scripts/017_UI/015_PScreen_Options.rb b/Data/Scripts/017_UI/015_PScreen_Options.rb index 5e558ba4d..9477a3451 100644 --- a/Data/Scripts/017_UI/015_PScreen_Options.rb +++ b/Data/Scripts/017_UI/015_PScreen_Options.rb @@ -20,7 +20,7 @@ class PokemonSystem @frame = 0 # Default window frame (see also $TextFrames) @textskin = 0 # Speech frame @font = 0 # Font (see also $VersionStyles) - @screensize = (SCREEN_ZOOM.floor).to_i # 0=half size, 1=full size, 2=double size + @screensize = (SCREEN_ZOOM * 2).floor - 1 # 0=half size, 1=full size, 2=full-and-a-half size, 3=double size @border = 0 # Screen border (0=off, 1=on) @language = 0 # Language (see also LANGUAGES in script PokemonSystem) @runstyle = 0 # Run key functionality (0=hold to run, 1=toggle auto-run) @@ -508,8 +508,8 @@ class PokemonOption_Scene proc { $PokemonSystem.textinput }, proc { |value| $PokemonSystem.textinput = value } ), - EnumOption.new(_INTL("Screen Size"),[_INTL("S"),_INTL("M"),_INTL("L"),_INTL("Full")], - proc { [$PokemonSystem.screensize,3].min }, + EnumOption.new(_INTL("Screen Size"),[_INTL("S"),_INTL("M"),_INTL("L"),_INTL("XL"),_INTL("Full")], + proc { [$PokemonSystem.screensize,4].min }, proc { |value| oldvalue = $PokemonSystem.screensize $PokemonSystem.screensize = value diff --git a/Data/Scripts/017_UI/026_PScreen_MysteryGift.rb b/Data/Scripts/017_UI/026_PScreen_MysteryGift.rb index 0a421172e..d255aef16 100644 --- a/Data/Scripts/017_UI/026_PScreen_MysteryGift.rb +++ b/Data/Scripts/017_UI/026_PScreen_MysteryGift.rb @@ -380,11 +380,7 @@ def pbReceiveMysteryGift(id) end gift=$Trainer.mysterygift[index] if gift[1]==0 # Pokémon - pID=rand(256) - pID|=rand(256)<<8 - pID|=rand(256)<<16 - pID|=rand(256)<<24 - gift[2].personalID=pID + gift[2].personalID = rand(2**16) | rand(2**16) << 16 gift[2].calcStats time=pbGetTimeNow gift[2].timeReceived=time.getgm.to_i diff --git a/Data/Scripts/019_Other battles/003_PBattle_OrgBattle.rb b/Data/Scripts/019_Other battles/003_PBattle_OrgBattle.rb index b0905ee6e..f23ad110f 100644 --- a/Data/Scripts/019_Other battles/003_PBattle_OrgBattle.rb +++ b/Data/Scripts/019_Other battles/003_PBattle_OrgBattle.rb @@ -158,11 +158,10 @@ class PBPokemon def createPokemon(level,iv,trainer) pokemon=Pokemon.new(@species,level,trainer,false) pokemon.setItem(@item) - pokemon.personalID=rand(65536) - pokemon.personalID|=rand(65536)<<8 - pokemon.personalID-=pokemon.personalID%25 - pokemon.personalID+=nature - pokemon.personalID&=0xFFFFFFFF + pokemon.personalID = rand(2**16) | rand(2**16) << 16 + pokemon.personalID -= pokemon.personalID % 25 + pokemon.personalID += nature + pokemon.personalID &= 0xFFFFFFFF pokemon.happiness=0 pokemon.moves[0]=PBMove.new(self.convertMove(@move1)) pokemon.moves[1]=PBMove.new(self.convertMove(@move2)) diff --git a/Data/Scripts/020_System and utilities/002_PSystem_System.rb b/Data/Scripts/020_System and utilities/002_PSystem_System.rb index 1499e455d..486314d8b 100644 --- a/Data/Scripts/020_System and utilities/002_PSystem_System.rb +++ b/Data/Scripts/020_System and utilities/002_PSystem_System.rb @@ -73,12 +73,6 @@ def pbSetUpSystem begin consts = pbSafeLoad("Data/Constants.rxdata") consts = [] if !consts - GameData::Ability.load - GameData::Item.load - GameData::Move.load - GameData::BerryPlant.load - GameData::Metadata.load - GameData::MapMetadata.load rescue consts = [] end @@ -86,6 +80,7 @@ def pbSetUpSystem next if !script eval(Zlib::Inflate.inflate(script[2]),nil,script[1]) end + GameData.load_all if LANGUAGES.length>=2 pokemonSystem.language = pbChooseLanguage if !havedata pbLoadMessages("Data/"+LANGUAGES[pokemonSystem.language][1]) @@ -96,11 +91,12 @@ def pbScreenCapture t = pbGetTimeNow filestart = t.strftime("[%Y-%m-%d] %H_%M_%S") filestart = sprintf("%s.%03d",filestart,(t.to_f-t.to_i)*1000) # milliseconds - capturefile = RTP.getSaveFileName(sprintf("%s.png",filestart)) - if capturefile && safeExists?("rubyscreen.dll") + capturefile = RTP.getSaveFileName(sprintf("%s.bmp",filestart)) +# if capturefile && safeExists?("rubyscreen.dll") Graphics.screenshot(capturefile) +# Graphics.snap_to_bitmap.saveToPng(capturefile) pbSEPlay("Pkmn exp full") if FileTest.audio_exist?("Audio/SE/Pkmn exp full") - end +# end end def pbDebugF7 diff --git a/Data/Scripts/021_Debug/003_Debug_Pokemon.rb b/Data/Scripts/021_Debug/003_Debug_Pokemon.rb index 9133f4098..874b6c7c5 100644 --- a/Data/Scripts/021_Debug/003_Debug_Pokemon.rb +++ b/Data/Scripts/021_Debug/003_Debug_Pokemon.rb @@ -299,10 +299,7 @@ module PokemonDebugMixin end end when 2 # Randomise pID - pkmn.personalID = rand(256) - pkmn.personalID |= rand(256)<<8 - pkmn.personalID |= rand(256)<<16 - pkmn.personalID |= rand(256)<<24 + pkmn.personalID = rand(2**16) | rand(2**16) << 16 pkmn.calcStats pbRefreshSingle(pkmnid) end