Changed: Spriteset_Map --- Left +++ Right @@ -282,6 +282,14 @@ sprite.update end + # Avoids overlap effect of player sprites if player is near edge of + # a connected map + @playersprite.visible=@playersprite.visible && ( + self.map==$game_map || + $game_player.x<=0||$game_player.y<=0|| + ($game_map && ($game_player.x>=$game_map.width|| + $game_player.y>=$game_map.height))) if self.map!=$game_map @weather.max-=2 if @weather.max>0 + @weather.max=0 if @weather.max<0 @weather.type = 0 if @weather.max==0 @weather.ox = 0 if @weather.max==0 Changed: SpriteWindow --- Left +++ Right @@ -3966,5 +3966,5 @@ if @__bitmap!=nil @__bitmap=nil - refresh + @__sprite.visible=(@__visible && !@__bitmap.nil?) end elsif @__bitmap!=value && !value.disposed? @@ -3974,5 +3974,5 @@ if @__bitmap!=nil @__bitmap=nil - refresh + @__sprite.visible=(@__visible && !@__bitmap.nil?) end end @@ -4005,12 +4005,16 @@ def update; ;end def refresh + @__sprite.visible=(@__visible && !@__bitmap.nil?) if @__bitmap - dwidth=Graphics.width - dheight=Graphics.height - @__sprite.bitmap=ensureBitmap(@__sprite.bitmap,dwidth,dheight) - @__sprite.bitmap.clear - tileBitmap(@__sprite.bitmap,@__bitmap,@__bitmap.rect) + if !@__bitmap.disposed? + dwidth=(Graphics.width/@__sprite.zoom_x+2).to_i + dheight=(Graphics.height/@__sprite.zoom_y+2).to_i + @__sprite.bitmap=ensureBitmap(@__sprite.bitmap,dwidth,dheight) + @__sprite.bitmap.clear + tileBitmap(@__sprite.bitmap,@__bitmap,@__bitmap.rect) + else + @__sprite.visible=false + end end - @__sprite.visible=(@__visible && !@__bitmap.nil?) end private Changed: PokemonUtilities --- Left +++ Right @@ -6,4 +6,8 @@ ################################## +class PokemonGlobalMetadata + attr_accessor :latlon,:latlontd +end + module PBDayNight @@ -35,5 +39,4 @@ @getGeoInfo=nil @realLatLong=nil - @gettingRealLatLong=nil @cachedTone=nil @dayNightToneLastUpdate=nil @@ -61,6 +64,6 @@ Thread.critical=true; begin x=@realLatLong - b=@gettingRealLatLong;@gettingRealLatLong=true if !x ensure; Thread.critical=false; end + b=!x.nil? # Whether real latitude or longitude found yet if !x # Use an approximation @@ -97,5 +100,14 @@ @realLatLong=x ensure; Thread.critical=false; end - if !b + if !b # No real latitude or longitude found yet + Thread.critical; begin + if $PokemonGlobal && $PokemonGlobal.latlon && + $PokemonGlobal.latlontd==Time.now.gmt_offset + @realLatLong=$PokemonGlobal.latlon + b=true; + end + ensure; Thread.critical=false; end + end + if !b # No real latitude or longitude found yet # Run a thread that calls the Internet Thread.new { @@ -123,4 +135,8 @@ Thread.critical=true; begin @realLatLong=[lat,lon] + if $PokemonGlobal + $PokemonGlobal.latlon=@realLatLong + $PokemonGlobal.latlontd=Time.now.gmt_offset + end ensure; Thread.critical=false; end end @@ -1215,14 +1231,24 @@ def pbGetWildBattleBGM(species) - if $PokemonGlobal.nextBattleBGM - return $PokemonGlobal.nextBattleBGM.clone - end - wildbgm=pbGetMetadata(0,MetadataWildBattleBGM) - if wildbgm - wildbgm="#{wildbgm}" - else - wildbgm="002-Battle02" - end - return pbStringToAudioFile(wildbgm) + if $PokemonGlobal.nextBattleBGM + return $PokemonGlobal.nextBattleBGM.clone + end + ret=nil + if !ret && $game_map + # Check map-specific metadata + music=pbGetMetadata($game_map.map_id,MetadataMapWildBattleBGM) + if music && music!="" + ret=pbStringToAudioFile("#{music}") + end + end + if !ret + # Check global metadata + music=pbGetMetadata(0,MetadataWildBattleBGM) + if music && music!="" + ret=pbStringToAudioFile("#{music}") + end + end + ret=pbStringToAudioFile("002-Battle02") if !ret + return ret end @@ -1240,9 +1266,9 @@ end -def pbGetTrainerBattleBGM(trainer) +def pbGetTrainerBattleBGM(trainer) # can be a PokeBattle_Trainer or an array of PokeBattle_Trainer if $PokemonGlobal.nextBattleBGM return $PokemonGlobal.nextBattleBGM.clone end - trainerbgm=pbGetMetadata(0,MetadataTrainerBattleBGM) + music=nil pbRgssOpen("Data/trainernames.dat","rb"){|f| trainernames=Marshal.load(f) @@ -1255,48 +1281,39 @@ trainertype=trainerarray[i].trainertype if trainernames[trainertype] - bgm=trainernames[trainertype][4] - trainerbgm=bgm if bgm + music=trainernames[trainertype][4] end end } - if trainerbgm - trainerbgm="#{trainerbgm}" - else - trainerbgm="005-Boss01" - end - return pbStringToAudioFile(trainerbgm) + ret=nil + if music && music!="" + ret=pbStringToAudioFile("#{music}") + end + if !ret && $game_map + # Check map-specific metadata + music=pbGetMetadata($game_map.map_id,MetadataMapTrainerBattleBGM) + if music && music!="" + ret=pbStringToAudioFile("#{music}") + end + end + if !ret + # Check global metadata + music=pbGetMetadata(0,MetadataTrainerBattleBGM) + if music && music!="" + ret=pbStringToAudioFile("#{music}") + end + end + ret=pbStringToAudioFile("005-Boss01") if !ret + return ret end def pbGetTrainerBattleBGMFromType(trainertype) - if $PokemonGlobal.nextBattleBGM - return $PokemonGlobal.nextBattleBGM.clone - end - trainerbgm=pbGetMetadata(0,MetadataTrainerBattleBGM) - pbRgssOpen("Data/trainernames.dat","rb"){|f| - trainernames=Marshal.load(f) - trainertype=trainertype - if trainernames[trainertype] - bgm=trainernames[trainertype][4] - trainerbgm=bgm if bgm - end - } - if trainerbgm - trainerbgm="#{trainerbgm}" - else - trainerbgm="005-Boss01" - end - return pbStringToAudioFile(trainerbgm) -end - - -def pbGetTrainerVictoryME(trainer) - if $PokemonGlobal.nextBattleME - return $PokemonGlobal.nextBattleME.clone + if $PokemonGlobal.nextBattleBGM + return $PokemonGlobal.nextBattleBGM.clone end music=nil pbRgssOpen("Data/trainernames.dat","rb"){|f| trainernames=Marshal.load(f) - if trainernames[trainer.trainertype] - music=trainernames[trainer.trainertype][5] + if trainernames[trainertype] + music=trainernames[trainertype][4] end } @@ -1304,12 +1321,62 @@ if music && music!="" ret=pbStringToAudioFile("#{music}") - else + end + if !ret && $game_map + # Check map-specific metadata + music=pbGetMetadata($game_map.map_id,MetadataMapTrainerBattleBGM) + if music && music!="" + ret=pbStringToAudioFile("#{music}") + end + end + if !ret + # Check global metadata + music=pbGetMetadata(0,MetadataTrainerBattleBGM) + if music && music!="" + ret=pbStringToAudioFile("#{music}") + end + end + ret=pbStringToAudioFile("005-Boss01") if !ret + return ret +end + + +def pbGetTrainerVictoryME(trainer) # can be a PokeBattle_Trainer or an array of PokeBattle_Trainer + if $PokemonGlobal.nextBattleME + return $PokemonGlobal.nextBattleME.clone + end + music=nil + pbRgssOpen("Data/trainernames.dat","rb"){|f| + trainernames=Marshal.load(f) + if !trainer.is_a?(Array) + trainerarray=[trainer] + else + trainerarray=trainer + end + for i in 0...trainerarray.length + trainertype=trainerarray[i].trainertype + if trainernames[trainertype] + music=trainernames[trainertype][5] + end + end + } + ret=nil + if music && music!="" + ret=pbStringToAudioFile("#{music}") + end + if !ret && $game_map + # Check map-specific metadata + music=pbGetMetadata($game_map.map_id,MetadataMapTrainerVictoryME) + if music && music!="" + ret=pbStringToAudioFile("#{music}") + end + end + if !ret + # Check global metadata music=pbGetMetadata(0,MetadataTrainerVictoryME) if music && music!="" ret=pbStringToAudioFile("#{music}") - else - ret=pbStringToAudioFile("001-Victory01") end end + ret=pbStringToAudioFile("001-Victory01") if !ret ret.name="../../Audio/ME/"+ret.name return ret @@ -1320,11 +1387,20 @@ return $PokemonGlobal.nextBattleME.clone end - music=pbGetMetadata(0,MetadataWildVictoryME) ret=nil - if music && music!="" + if !ret && $game_map + # Check map-specific metadata + music=pbGetMetadata($game_map.map_id,MetadataMapWildVictoryME) + if music && music!="" ret=pbStringToAudioFile("#{music}") - else - ret=pbStringToAudioFile("001-Victory01") + end end + if !ret + # Check global metadata + music=pbGetMetadata(0,MetadataWildVictoryME) + if music && music!="" + ret=pbStringToAudioFile("#{music}") + end + end + ret=pbStringToAudioFile("001-Victory01") if !ret ret.name="../../Audio/ME/"+ret.name return ret Changed: PokeBattle_Battle --- Left +++ Right @@ -27,4 +27,41 @@ end + + +class PokeBattle_NullBattlePeer + def isBall?(item) + return false + end + def isPokeDoll?(item) + return false + end + def boxesFull?(player) + return player.party.length>=6 + end + def pbStorePokemon(player,pokemon) + if player.party.length<6 + player.party[player.party.length]=pokemon + return -1 + else + return -1 + end + end + def pbGetStorageCreator() + return nil + end + def pbCurrentBox() + return -1 + end + def pbBoxName(box) + return "" + end +end + +class PokeBattle_BattlePeer + def self.create + return PokeBattle_NullBattlePeer.new() + end +end + class PokeBattle_SuccessState attr_accessor :typemod @@ -70,18 +107,10 @@ pokemon.name=nickname if nickname!="" end - if self.pbPlayer.party.length<6 - self.pbPlayer.party[self.pbPlayer.party.length]=pokemon - else - oldcurbox=$PokemonStorage.currentBox - storedbox=$PokemonStorage.pbStoreCaught(pokemon) - if storedbox<0 - pbDisplayPaused(_INTL("Can't catch any more...")) - else - curboxname=$PokemonStorage[oldcurbox].name - boxname=$PokemonStorage[storedbox].name - creator=nil - if $PokemonGlobal.seenStorageCreator - creator=pbGetStorageCreator - end + oldcurbox=@peer.pbCurrentBox() + storedbox=@peer.pbStorePokemon(self.pbPlayer,pokemon) + creator=@peer.pbGetStorageCreator() + return if storedbox<0 + curboxname=@peer.pbBoxName(oldcurbox) + boxname=@peer.pbBoxName(storedbox) if storedbox!=oldcurbox if creator @@ -99,6 +128,4 @@ pbDisplayPaused(_INTL("It was stored in box \"{1}.\"",boxname)) end - end - end end @@ -257,4 +284,5 @@ @party1=p1 @party2=p2 + @peer=PokeBattle_BattlePeer.create() if opponent && player.is_a?(Array) && player.length==0 player=player[0] @@ -615,5 +643,6 @@ sendout2=pbFindNextUnfainted(@party1,pbSecondPartyBegin(0)) raise _INTL("Player 2 has no unfainted Pokémon") if sendout2<0 - pbDisplayBrief(_INTL("{1} sent\r\nout {2}! Go! {3}!",@player[1].fullname,@party1[sendout2].name,@party1[sendout1].name)) + pbDisplayBrief(_INTL("{1} sent\r\nout {2}! Go! {3}!", + @player[1].fullname,@party1[sendout2].name,@party1[sendout1].name)) self.pbPlayer.seen[@party1[sendout1].species]=true self.pbPlayer.seen[@party1[sendout2].species]=true @@ -1281,10 +1310,10 @@ def pbUseItemOnBattler(item,index,scene) battler=@battlers[index] - if $ItemData[item][ITEMPOCKET]==2 # Any Ball + if @peer.isBall?(item) # Any Ball if !@opponent && @battlers[1].hp>0 && @battlers[3].hp>0 scene.pbDisplay(_INTL("It's no good! It's impossible to aim when there are two Pokémon!")) return false end - if self.pbPlayer.party.length==6 && $PokemonStorage.full? + if @peer.boxesFull?(self.pbPlayer) scene.pbDisplay(_INTL("There is no room left in the PC!")) return false @@ -1292,5 +1321,5 @@ return true end - if $ItemData[item][ITEMTYPE]==4 # Pokedoll-like item + if @peer.isPokeDoll?(item) # Pokedoll-like item if @opponent scene.pbDisplay(_INTL("Can't use that here.")) @@ -1311,8 +1340,8 @@ @choices[idxPokemon][1]=idxItem # item used @choices[idxPokemon][2]=nil - if $ItemData[idxItem][ITEMTYPE]==4 + if @peer.isPokeDoll?(idxItem) @decision=3 pbDisplayPaused(_INTL("Got away safely!")) - elsif $ItemData[idxItem][ITEMPOCKET]==2 # Any Ball + elsif @peer.isBall?(idxItem) pbThrowPokeBall(idxItem) end @@ -1742,5 +1771,6 @@ for j in 0..@party1.length-1 next if !@party1[j] || !pbIsOwner?(0,j) - expshare+=1 if @party1[j].hp>0 && !@party1[j].egg? && isConst?(@party1[j].item,PBItems,:EXPSHARE) + expshare+=1 if @party1[j].hp>0 && !@party1[j].egg? && + isConst?(@party1[j].item,PBItems,:EXPSHARE) end # Now calculate EXP for the participants Changed: PokemonMap --- Left +++ Right @@ -300,4 +300,9 @@ MetadataSnapEdges=12 MetadataDungeon=13 + MetadataBattleBack=14 + MetadataMapWildBattleBGM=15 + MetadataMapTrainerBattleBGM=16 + MetadataMapWildVictoryME=17 + MetadataMapTrainerVictoryME=18 module PokemonMetadata @@ -330,5 +335,10 @@ "SafariMap"=>[11,"b"], "SnapEdges"=>[12,"b"], - "Dungeon"=>[13,"b"] + "Dungeon"=>[13,"b"], + "BattleBack"=>[14,"s"], + "WildBattleBGM"=>[15,"s"], + "TrainerBattleBGM"=>[16,"s"], + "WildVictoryME"=>[17,"s"], + "TrainerVictoryME"=>[18,"s"], } end Changed: PokemonShadow --- Left +++ Right @@ -442,6 +442,6 @@ @battle.sides[0].effects[PBEffects::Safeguard]=0 @battle.sides[1].effects[PBEffects::Reflect]=0 - @battle.sides[2].effects[PBEffects::LightScreen]=0 - @battle.sides[3].effects[PBEffects::Safeguard]=0 + @battle.sides[1].effects[PBEffects::LightScreen]=0 + @battle.sides[1].effects[PBEffects::Safeguard]=0 @battle.pbDisplay(_INTL("It broke all barriers!")) @battle.pbAnimation(@id,attacker,nil) @@ -607,5 +607,5 @@ class PurificationChamber NUMCHAMBERS=9 - setsIZE=4 + SETSIZE=4 def initialize @sets=[] @@ -658,10 +658,10 @@ def [](chamber,slot) return nil if chamber<0 || chamber>=NUMCHAMBERS - return nil if slot<0 || slot>=setsIZE + return nil if slot<0 || slot>=SETSIZE return @sets[chamber][slot] end def []=(chamber,slot,value) # allow only "non-shadow" Pokemon return if chamber<0 || chamber>=NUMCHAMBERS - return if slot<0 || slot>=setsIZE + return if slot<0 || slot>=SETSIZE @sets[chamber][slot]=value end Changed: PokemonDebug --- Left +++ Right @@ -800,4 +800,10 @@ end +def pbDefaultMap() + return $game_map.map_id if $game_map + return $data_system.edit_map_id if $data_system + return 0 +end + def pbDebugMenu viewport=Viewport.new(0,0,Graphics.width,Graphics.height) @@ -820,9 +826,11 @@ commands.add("testwildbattle",_INTL("TEST WILD BATTLE")) commands.add("testtrainer",_INTL("TEST TRAINER")) - commands.add("quickhatch",_INTL("QUICK HATCH")) - commands.add("compiledata",_INTL("COMPILE DATA")) + commands.add("visualeditor",_INTL("VISUAL EDITOR")) + commands.add("setmetadata",_INTL("SET METADATA")) + commands.add("setencounters",_INTL("SET ENCOUNTERS")) commands.add("extracttext",_INTL("EXTRACT TEXT")) commands.add("compiletext",_INTL("COMPILE TEXT")) - commands.add("visualeditor",_INTL("VISUAL EDITOR")) + commands.add("quickhatch",_INTL("QUICK HATCH")) + commands.add("compiledata",_INTL("COMPILE DATA")) commands.add("terraintags",_INTL("SET TERRAIN TAGS")) commands.add("animeditor",_INTL("ANIMATION EDITOR")) @@ -862,5 +870,5 @@ pbFadeOutIn(99999) { pbTilesetScreen } elsif cmd=="warp" - mapid=pbListScreen(_INTL("WARP TO MAP"),MapLister.new($data_system.edit_map_id)) + mapid=pbListScreen(_INTL("WARP TO MAP"),MapLister.new(pbDefaultMap())) if mapid>0 map=Game_Map.new @@ -943,4 +951,20 @@ Kernel.pbMessage(_INTL("The Bag was filled with {1} of each item.",qty)) end + elsif cmd=="setmetadata" + pbMetadataScreen(pbDefaultMap()) + pbClearData() + elsif cmd=="setencounters" + encdata=load_data("Data/encounters.dat") + oldencdata=Marshal.dump(encdata) + mapedited=false + map=pbDefaultMap() + loop do + map=pbListScreen(_INTL("SET ENCOUNTERS"),MapLister.new(map)) + break if map<=0 + mapedited=true if map==pbDefaultMap() + pbEncounterEditorMap(encdata,map) + end + Kernel.dumpencdata(encdata) + pbClearData() elsif cmd=="extracttext" pbExtractText Changed: Compiler --- Left +++ Right @@ -3136,4 +3136,23 @@ end end + elsif params[4]==0 && i>3 + for j in 0...i + if list[j].code==209 && list[j].parameters[0]==-1 + route=list[j].parameters[1] + oldlistlength=list.length + if route && route.list.length<=2 + # Delete superfluous move route command if necessary + if route.list[0].code==16 # Player/Turn Down + deleteMoveRouteAt.call(list,j); params[4]=2; changed=true;i-=(oldlistlength-list.length) + elsif route.list[0].code==17 # Left + deleteMoveRouteAt.call(list,j); params[4]=4; changed=true;i-=(oldlistlength-list.length) + elsif route.list[0].code==18 # Right + deleteMoveRouteAt.call(list,j); params[4]=6; changed=true;i-=(oldlistlength-list.length) + elsif route.list[0].code==19 # Up + deleteMoveRouteAt.call(list,j); params[4]=8; changed=true;i-=(oldlistlength-list.length) + end + end + end + end elsif params[4]==0 && # Retain direction i+21024 @@ -38,5 +38,5 @@ def PBDebug.dump(msg) - if $DEBUG + if $DEBUG && $INTERNAL File.open("Data/dumplog.txt", "a+b") { |f| f.write("#{msg}\r\n") } end Changed: Dungeon --- Left +++ Right @@ -42,5 +42,5 @@ TILEWIDTH=13 TILEHEIGHT=13 - def self.paintRect(tile,x,y,w,h) + def self.paintRect(tile,x,y,w,h) # paints a room for j in 0...h for i in 0...w @@ -49,5 +49,5 @@ end end - def self.paintTile(dungeon,dstX,dstY,tile,rotation) + def self.paintTile(dungeon,dstX,dstY,tile,rotation) # paints a tile if rotation==None for y in 0...TILEHEIGHT;for x in 0...TILEWIDTH @@ -83,4 +83,5 @@ width=MINWIDTH+rand(MAXWIDTH-MINWIDTH+1) height=MINHEIGHT+rand(MAXHEIGHT-MINHEIGHT+1) + return false if width<=0 || height<=0 centerX=TILEWIDTH/2 centerY=TILEHEIGHT/2 @@ -494,5 +495,5 @@ y=ar2.get() if dungeon.isRoom?(x,y) && (!tiles.any?{|item| - (item[0]-x).abs>=2 && (item[1]-y).abs>=2 }) + (item[0]-x).abs<2 && (item[1]-y).abs<2 }) ret=[x,y] tiles.push(ret) Changed: PokemonSummary --- Left +++ Right @@ -223,15 +223,29 @@ "\\[043C3AFF]{1}\\[0000675A] nature, obtained in a trade.",naturename)) elsif pokemon.obtainMode==1 - drawColoredTextEx(overlay,176,228,300,_INTL( - "\\[043C3AFF]{1}\\[0000675A] nature, hatched from an egg at Lv\\[043C3AFF]{2}\\[0000675A] at \\[043C3AFF]{3}\\[0000675A].", - naturename,pokemon.obtainLevel,pbGetMapNameFromId(pokemon.obtainMap))) + mapname=pbGetMapNameFromId(pokemon.obtainMap) + if mapname && mapname!="" + drawColoredTextEx(overlay,176,228,300,_INTL( + "\\[043C3AFF]{1}\\[0000675A] nature, hatched from an egg at Lv\\[043C3AFF]{2}\\[0000675A] at \\[043C3AFF]{3}\\[0000675A].", + naturename,pokemon.obtainLevel,mapname)) + else + drawColoredTextEx(overlay,176,228,300,_INTL( + "\\[043C3AFF]{1}\\[0000675A] nature, hatched from an egg at Lv\\[043C3AFF]{2}\\[0000675A].", + naturename,pokemon.obtainLevel,mapname)) + end elsif pokemon.obtainMode==0 && pokemon.obtainMap>0 - drawColoredTextEx(overlay,176,228,300,_INTL( + mapname=pbGetMapNameFromId(pokemon.obtainMap) + if mapname && mapname!="" + drawColoredTextEx(overlay,176,228,300,_INTL( "\\[043C3AFF]{1}\\[0000675A] nature, met at Lv\\[043C3AFF]{2}\\[0000675A], \\[043C3AFF]{3}\\[0000675A].", - naturename,pokemon.obtainLevel,pbGetMapNameFromId(pokemon.obtainMap))) + naturename,pokemon.obtainLevel,mapname)) + else + drawColoredTextEx(overlay,176,228,300,_INTL( + "\\[043C3AFF]{1}\\[0000675A] nature, met at Lv\\[043C3AFF]{2}\\[0000675A].", + naturename,pokemon.obtainLevel,mapname)) + end elsif pokemon.obtainMode==0 drawColoredTextEx(overlay,176,228,300,_INTL( "\\[043C3AFF]{1}\\[0000675A] nature, obtained in a fateful encounter.", - naturename,pokemon.obtainLevel,pbGetMapNameFromId(pokemon.obtainMap))) + naturename)) end pbSetSmallFont(overlay) Changed: PokeBattle_ActualScene --- Left +++ Right @@ -1412,4 +1412,9 @@ if $PokemonGlobal && $PokemonGlobal.nextBattleBack id=$PokemonGlobal.nextBattleBack + elsif $game_map + back=pbGetMetadata($game_map.map_id,MetadataBattleBack) + if back && back!="" + id=pbGetMetadata($game_map.map_id,MetadataBattleBack) + end end battlebg="Graphics/Pictures/battlebg#{id}" @@ -1525,10 +1530,10 @@ end @sprites["shadow0"]=IconSprite.new(0,0,@viewport) - pbAddSprite("shadow1",0,0+@yoffset,"Graphics/Pictures/enemyshadow.png",@viewport) + pbAddSprite("shadow1",0,0+@yoffset,"Graphics/Pictures/enemyshadow",@viewport) @sprites["shadow1"].visible=false @sprites["pokemon0"]=PokemonBattlerSprite.new(battle.doublebattle,0,@viewport) @sprites["pokemon1"]=PokemonBattlerSprite.new(battle.doublebattle,1,@viewport) if battle.doublebattle - pbAddSprite("shadow3",0,0+@yoffset,"Graphics/Pictures/enemyshadow.png",@viewport) + pbAddSprite("shadow3",0,0+@yoffset,"Graphics/Pictures/enemyshadow",@viewport) @sprites["shadow3"].visible=false @sprites["shadow2"]=IconSprite.new(0,0,@viewport) @@ -2346,10 +2351,5 @@ # This method is called when the player wins a Trainer battle. # This method can change the battle's music for example. - if @battle.opponent.is_a?(Array) - opp=@battle.opponent[0] - else - opp=@battle.opponent - end - pbBGMPlay(pbGetTrainerVictoryME(opp)) + pbBGMPlay(pbGetTrainerVictoryME(@battle.opponent)) end Changed: PokemonTilesetEditor --- Left +++ Right @@ -138,5 +138,5 @@ elsif Input.repeat?(Input::LEFT) @x-=32 - @x=0 if @x<0 + @x=-32 if @x<-32 pbUpdateTileset elsif Input.repeat?(Input::DOWN) Changed: DependentEvents --- Left +++ Right @@ -456,4 +456,5 @@ end def addEvent(event,eventName=nil,commonEvent=nil) + return if !event events=$PokemonGlobal.dependentEvents for i in 0...events.length Changed: PokemonLoad --- Left +++ Right @@ -422,4 +422,10 @@ end } + if !$game_map.events # Map wasn't set up + $game_map=nil + $scene=nil + Kernel.pbMessage(_INTL("The map is corrupt. The game cannot continue.")) + return + end $PokemonMap=metadata $PokemonEncounters=PokemonEncounters.new