Changed: PokemonMap @@ -249,28 +249,0 @@ -class PokemonSystem - attr_accessor :textspeed - attr_accessor :battlestyle - attr_accessor :frame - attr_accessor :font - attr_accessor :screensize - attr_accessor :battlescene - attr_accessor :tilemap - attr_accessor :textskin - attr_accessor :language - def language - return (!@language) ? 0 : @language - end - def textskin - return (!@textskin) ? 0 : @textskin - end - def initialize - @frame=0 - @battlestyle=0 - @battlescene=0 - @textspeed=2 - @screensize=1 - @font=0 - @tilemap=1 - @textskin=0 - @language=0 - end -end Changed: PokemonOption @@ -214,0 +214,42 @@ +##################### +# +# Stores game options +# +class PokemonSystem + attr_accessor :textspeed + attr_accessor :battlestyle + attr_accessor :frame + attr_accessor :font + attr_accessor :screensize + attr_accessor :battlescene + attr_accessor :tilemap + attr_accessor :textskin + attr_accessor :language + def language + return (!@language) ? 0 : @language + end + def textskin + return (!@textskin) ? 0 : @textskin + end + def initialize + # Default window frame (see also $TextFrames in script SpriteWindow) + @frame=0 + # Battle style (0=shift, 1=set) + @battlestyle=0 + # Battle scene (animations) (0=on, 1=off) + @battlescene=0 + # Text speed (0=slow, 1=mid, 2=fast) + @textspeed=2 + # Screen size (0=240x160, 1=480x320, 2=320x240, 3=640x480) + @screensize=1 + # Font (see also $VersionStyles in script SpriteWindow) + @font=0 + @tilemap=1 + # Speech frame + @textskin=0 + # Language (see also LANGUAGES in script PokemonSystem) + @language=0 + end +end + + Changed: PBIntl @@ -440,0 +440,1 @@ + raise "Corrupted data" if !@messages.is_a?(Array) @@ -442,1 +443,0 @@ - p $!.message,$!.backtrace @@ -566,1 +566,5 @@ - string=MessageTypes.getFromMapHash(0,arg[0]) + begin + string=MessageTypes.getFromMapHash(0,arg[0]) + rescue + string=arg[0] + end @@ -579,1 +583,5 @@ - string=MessageTypes.getFromMapHash(0,arg[0]) + begin + string=MessageTypes.getFromMapHash(0,arg[0]) + rescue + string=arg[0] + end Changed: Interpreter @@ -750,1 +750,7 @@ - when 7, 8, 9, 10 # gold, item, weapon, armor + when 7 + if @parameters[2] == 0 + result = $Trainer && ($Trainer.money >= @parameters[1]) + else + result = $Trainer && ($Trainer.money <= @parameters[1]) + end + when 8, 9, 10 # item, weapon, armor @@ -955,1 +961,3 @@ - when 1 # number of party members, gold, steps + when 1, 3 # number of party members, steps + when 2 # gold + value = $Trainer ? $Trainer.money : 0 Changed: PokemonNetwork @@ -95,0 +95,1 @@ + ret="" @@ -99,1 +100,4 @@ - raise + rescue RuntimeError + disconnect + rescue Errno::ECONNABORTED, Errno::ECONNREFUSED + raise @@ -116,0 +120,1 @@ + command="" if !command @@ -258,1 +263,1 @@ - if @socket.ready? #or allow_process + if @socket && @socket.ready? #or allow_process @@ -266,0 +271,1 @@ + echoln command @@ -404,0 +410,3 @@ + if !result + return [NetworkState::Nack,$1.to_i,$2.to_i,loadBase64($3)] + end @@ -697,1 +706,6 @@ - ret=Network.register(user,pass,email) + begin + ret=Network.register(user,pass,email) + rescue Exception, Errno::ECONNABORTED, Errno::ECONNREFUSED + Kernel.pbMessage(_INTL("The connection attempt timed out or failed.\1")) + return false + end @@ -718,1 +732,1 @@ - return networkConnect("127.0.0.1",50000,useHandle1 ? "handle1" : "handle2","...") + return networkConnect("127.0.0.1",4000,useHandle1 ? "handle1" : "handle2","...") @@ -723,0 +737,1 @@ + #p "Now connecting" @@ -728,1 +743,0 @@ - print("#{$!.class}") @@ -1091,1 +1105,0 @@ - # TODO: Evolution of traded Pokemon @@ -1098,0 +1111,15 @@ + # Evolution of traded Pokemon if applicable + newspecies=pbTradeCheckEvolution($Trainer.party[otherChoice]) + Network.messageproc=Proc.new {|msgid,s,recipient,data| + networkSendNack([1,msgid],s) + next nil + } + if newspecies>0 + evo=PokemonEvolutionScene.new + evo.pbStartScreen($Trainer.party[otherChoice],newspecies) + evo.pbEvolution(false) + evo.pbEndScreen + end + if !$DEBUGNETWORK2 + Kernel.pbSave(true) + end @@ -1145,1 +1173,1 @@ - if Graphics.frame_count%160==0 + if Graphics.frame_count%40==0 @@ -1173,16 +1201,0 @@ -if $DEBUGNETWORK2 - loop do - Console::setup_console - $PokemonStorage=PokemonStorage.new - $PokemonTemp=PokemonTemp.new - $game_screen=Game_Screen.new - $PokemonSystem=PokemonSystem.new - $PokemonGlobal=PokemonGlobalMetadata.new - pbDebugTrainer - pbCreatePokemon - pbFillBag - screen=NetworkScreen.new - screen.startSemiFakeConnect - Graphics._reset - end -end Changed: PokemonMart @@ -425,1 +425,1 @@ - quantity=@scene.pbChooseNumber(_INTL("{1}? Certainly. How many would you like?",itemname), item,maxafford) + quantity=@scene.pbChooseNumber(_INTL("{1}? Certainly.\r\nHow many would you like?",itemname),item,maxafford) @@ -430,1 +430,1 @@ - if !pbConfirm(_INTL("{1}, and you want {2}. That will be ${3}. OK?",itemname,quantity,price)) + if !pbConfirm(_INTL("{1}, and you want {2}.\r\nThat will be ${3}. OK?",itemname,quantity,price)) @@ -436,1 +436,1 @@ - end + end @@ -454,1 +454,1 @@ - pbDisplayPaused(_INTL("Here you are! Thank you!")) + pbDisplayPaused(_INTL("Here you are!\r\nThank you!")) Changed: PokeBattle_ActualScene @@ -2455,4 +2455,13 @@ -end - - -end + if !@opponent + @briefmessage=false + $game_system.bgm_play("../ME/PkmRS-Caught.mid") + frames=(3.5*Graphics.frame_rate).to_i + frames.times do + pbGraphicsUpdate + pbInputUpdate + end + end +end + + +end Changed: Main @@ -34,1 +34,2 @@ - setThreadPriority.call(getCurrentThread.call(),2) +# setThreadPriority.call(getCurrentThread.call(),2) + setThreadPriority.call(getCurrentThread.call(),1) Changed: Compiler @@ -2236,0 +2236,1 @@ + raise _INTL("Regional Pokedex number cannot be 0 (section {2})",currentmap) if value==0 Added: PokemonTriad Changed: PokemonMessages @@ -772,0 +772,1 @@ + skin=PokemonSkins.getDefaultTextSkin if !skin @@ -782,1 +783,2 @@ - pbLoadSkin(msgwindow,"Graphics/Windowskins/#{skin}") if skin + skin=PokemonSkins.getDefaultTextSkin if !skin + pbLoadSkin(msgwindow,"Graphics/Windowskins/#{skin}") @@ -792,1 +794,2 @@ - pbLoadSkin(msgwindow,"Graphics/Windowskins/#{skin}") if skin + skin=PokemonSkins.getDefaultTextSkin if !skin + pbLoadSkin(msgwindow,"Graphics/Windowskins/#{skin}") @@ -802,1 +805,2 @@ - pbLoadSkin(msgwindow,"Graphics/Windowskins/#{skin}") if skin + skin=PokemonSkins.getDefaultTextSkin if !skin + pbLoadSkin(msgwindow,"Graphics/Windowskins/#{skin}") @@ -813,1 +817,2 @@ - pbLoadSkin(msgwindow,"Graphics/Windowskins/#{skin}") if skin + skin=PokemonSkins.getDefaultTextSkin if !skin + pbLoadSkin(msgwindow,"Graphics/Windowskins/#{skin}") Changed: SpriteWindow @@ -1695,0 +1695,9 @@ + def self.newWithSize(commands,x,y,width,height,viewport=nil) + ret=self.new(commands,width) + ret.x=x + ret.y=y + ret.width=width + ret.height=height + ret.viewport=viewport + return ret + end @@ -1979,1 +1988,2 @@ - drawTextEx(self.contents,0,0,self.contents.width,0,@text,@baseColor,@shadowColor) + drawTextEx(self.contents,0,0,self.contents.width,0, + @text.gsub(/\r/,""),@baseColor,@shadowColor) @@ -2649,2 +2659,2 @@ - @uparrow.visible=(self.top_row!=0 && @item_max > self.page_item_max) - @downarrow.visible=(self.top_row+self.page_item_max<@item_max && + @uparrow.visible=self.visible && self.active && (self.top_row!=0 && @item_max > self.page_item_max) + @downarrow.visible=self.visible && self.active && (self.top_row+self.page_item_max<@item_max && @@ -2652,0 +2662,2 @@ + @uparrow.z=self.z+1 + @downarrow.z=self.z+1 Changed: PokemonSystem @@ -260,2 +260,0 @@ -#tiletopng("Outside",413,"Graphics/Characters/itemball.png") -#tiletopng("Outside",411,"Graphics/Characters/rock.png") Changed: PokemonSummary @@ -65,1 +65,1 @@ - @typebitmap=BitmapCache.load_bitmap("Graphics/Pictures/types.png") + @typebitmap=BitmapCache.load_bitmap(_INTL("Graphics/Pictures/types.png")) @@ -92,1 +92,1 @@ - @typebitmap=BitmapCache.load_bitmap("Graphics/Pictures/types.png") + @typebitmap=BitmapCache.load_bitmap(_INTL("Graphics/Pictures/types.png")) Changed: PokemonUtilities @@ -32,0 +32,2 @@ +# Similar to pbFadeOutIn, but pauses the music +# as it fades out. @@ -724,0 +726,77 @@ +def pbGetRegionalNumber(region, nationalSpecies) + # Gets the regional Pokedex number of + # the national species for the specified region. + # The parameter "region" is zero-based. For + # example, if two regions are defined, they would + # each be specified as 0 and 1. + if nationalSpecies<=0 || nationalSpecies>PBSpecies.getCount + # Return 0 if national species is outside range + return 0 + end + pbRgssOpen("Data/regionals.dat","rb"){|f| + numRegions=f.fgetw + numDexDatas=f.fgetw + if region>=0 && region=0 && region=0 && region20 - } - rescue Hangup - end - for i in 0...500 - pbDebugBattle(i) - end - PBDebug.flush -end -#pbDebugBattles -def pbFillBag - $ItemData=readItemList("Data/items.dat") - itemconsts=[] - for i in PBItems.constants - itemconsts.push(PBItems.const_get(i)) - end - itemconsts.sort!{|a,b| a<=>b} - for i in itemconsts - $PokemonBag.pbStoreItem(i,99) - end -end - -def pbTestBattle(id) -$PokemonStorage=PokemonStorage.new -$PokemonTemp=PokemonTemp.new -$game_screen=Game_Screen.new -$PokemonSystem=PokemonSystem.new -$PokemonGlobal=PokemonGlobalMetadata.new -pbDebugTrainer -pbCreatePokemon -pbFillBag -pbEnterText("Some help text",0,10) - -#filename=sprintf("Battles/Battle%03d.dat",id) -#pbPlayBattleFromFile(filename) -#pbWildBattle(PBSpecies::DUSKULL,20) -end -#pbTestBattle(169) - -=begin -$PokemonGlobal=PokemonGlobalMetadata.new -$PhoneData=PhoneDatabase.new -for i in 0...20 - pbPhoneRegister(nil,i,getRandomName) -end -PokemonPhoneScene.new.start -=end + @@ -1258,0 +1145,1 @@ +# Creates wave data from the given WAV file path @@ -1390,0 +1278,2 @@ + +# Starts recording. Returns 0 if successful. @@ -1394,0 +1284,3 @@ + if retval!=0 + MciSendString.call("close RECORDER",0,0,0) + end @@ -1397,0 +1290,3 @@ +# Starts recording, and displays a message if the +# recording failed to start. Returns true if +# successful, false otherwise @@ -1415,1 +1311,3 @@ - +# Gets a single sample from the microphone. +# The beginRecord or beginRecordUI function +# must have been called beforehand. @@ -1484,0 +1382,2 @@ + # Creates a sprite from a GIF file with the specified + # optional viewport @@ -1533,0 +1433,2 @@ + # This function must be called in order to animate + # the GIF image. @@ -1564,0 +1466,6 @@ +=begin +Gets the ID number for the current region based on the player's + current position. Returns -1 if no region + was defined in the game's metadata. The ID numbers returned by this function depend + on the town map configuration. +=end Changed: PokeBattle_Battle @@ -152,1 +152,1 @@ - pbDisplay(_INTL("Gotcha! {1} was caught!",pokemon.name)) + pbDisplayBrief(_INTL("Gotcha! {1} was caught!",pokemon.name)) @@ -243,1 +243,1 @@ - pbDisplay(_INTL("Gotcha! {1} was caught!",pokemon.name)) + pbDisplayBrief(_INTL("Gotcha! {1} was caught!",pokemon.name)) Changed: PokemonMap Changed: PokemonOption Changed: PBIntl Changed: Interpreter Changed: PokemonNetwork Changed: PokemonMart Changed: PokeBattle_ActualScene Changed: Main Changed: Compiler Added: PokemonTriad Changed: PokemonMessages Changed: SpriteWindow Changed: PokemonSystem Changed: PokemonSummary Changed: PokemonUtilities Changed: PokeBattle_Battle