Changed: Game_Screen --- Left +++ Right @@ -10,4 +10,5 @@ # * Public Instance Variables #-------------------------------------------------------------------------- + attr_reader :brightness # brightness attr_reader :tone # color tone attr_reader :flash_color # flash color @@ -20,4 +21,7 @@ #-------------------------------------------------------------------------- def initialize + @brightness = 255 + @fadeout_duration = 0 + @fadein_duration = 0 @tone = Tone.new(0, 0, 0, 0) @tone_target = Tone.new(0, 0, 0, 0) @@ -98,4 +102,14 @@ #-------------------------------------------------------------------------- def update + if @fadeout_duration && @fadeout_duration >= 1 + d = @fadeout_duration + @brightness = (@brightness * (d - 1)) / d + @fadeout_duration -= 1 + end + if @fadein_duration && @fadein_duration >= 1 + d = @fadein_duration + @brightness = (@brightness * (d - 1) + 255) / d + @fadein_duration -= 1 + end if @tone_duration >= 1 d = @tone_duration Changed: Game_Player_ --- Left +++ Right @@ -447,11 +447,4 @@ Kernel.pbOnStepTaken(result) # *Added function call if result == false - # Disregard if debug mode is ON and ctrl key was pressed - unless $DEBUG and Input.press?(Input::CTRL) - # Encounter countdown - if @encounter_count > 0 - @encounter_count -= 1 - end - end end end Changed: PokemonMessages --- Left +++ Right @@ -19,4 +19,10 @@ end +class Game_Message + attr_writer :background, :visible + def visible; return @visible ? @visible : false; end + def background; return @background ? @background : 0; end +end + class Game_System attr_writer :message_position @@ -33,5 +39,7 @@ def updatemini oldmws=$game_temp.message_window_showing + oldvis=$game_message ? $game_message.visible : false $game_temp.message_window_showing=true + $game_message.visible=true if $game_message loop do $game_map.update @@ -52,4 +60,5 @@ end $game_temp.message_window_showing=oldmws + $game_message.visible=oldvis if $game_message @spriteset.update if @spriteset @message_window.update if @message_window @@ -62,5 +71,5 @@ update_basic(true) update_info_viewport # Update information viewport - if $game_message.visible + if $game_message && $game_message.visible @info_viewport.visible = false @message_window.visible = true @@ -94,4 +103,18 @@ end +def pbMapInterpreterRunning? + interp=pbMapInterpreter + return interp && interp.running? +end + +def pbMapInterpreter + if $game_map && $game_map.respond_to?("interpreter") + return $game_map.interpreter + elsif $game_system + return $game_system.map_interpreter + end + return nil +end + def pbRefreshSceneMap if $scene && $scene.is_a?(Scene_Map) @@ -194,6 +217,6 @@ def pbCurrentEventCommentInput(elements,trigger) return nil - return nil if !$game_system || !$game_system.map_interpreter.running? - event=$game_system.map_interpreter.get_character(0) + return nil if !pbMapInterpreterRunning? + event=pbMapInterpreter.get_character(0) return nil if !event return pbEventCommentInput(event,elements,trigger) @@ -372,4 +395,8 @@ end +class Game_Temp + attr_accessor :background +end + class Game_Interpreter include InterpreterMixin @@ -382,4 +409,5 @@ return false end + $game_message=Game_Message.new if !$game_message message="" commands=nil @@ -392,5 +420,7 @@ text+="\\ff[#{facename},#{faceindex}]" end - $game_message.background=@list[@index].parameters[2] + if $game_message + $game_message.background=@list[@index].parameters[2] + end $game_system.message_position=@list[@index].parameters[3] message+=text @@ -401,5 +431,5 @@ if code == 401 text=@list[nextIndex].parameters[0] - text+=" " if text[text.length-1,1]!=" " + text+=" " if text!="" && text[text.length-1,1]!=" " message+=text @index=nextIndex @@ -899,4 +929,5 @@ pbBottomLeftLines(msgwindow,2) $game_temp.message_window_showing=true if $game_temp + $game_message.visible=true if $game_message return msgwindow end @@ -904,4 +935,5 @@ def Kernel.pbDisposeMessageWindow(msgwindow) $game_temp.message_window_showing=false if $game_temp + $game_message.visible=false if $game_message msgwindow.dispose end @@ -1278,7 +1310,7 @@ if pbCurrentEventCommentInput(1,"Cut Scene") && Input.trigger?(Input::F5) - event=$game_system.map_interpreter.get_character(0) - $game_system.map_interpreter.pbSetSelfSwitch(event.id,"A",true) - $game_system.map_interpreter.command_end + event=pbMapInterpreter.get_character(0) + pbMapInterpreter.pbSetSelfSwitch(event.id,"A",true) + pbMapInterpreter.command_end event.start break Changed: SpriteWindow --- Left +++ Right @@ -328,5 +328,5 @@ def pbGetDecisionSE if $data_system && $data_system.respond_to?("decision_se") && - $data_system.decision_se.name!="" + $data_system.decision_se && $data_system.decision_se.name!="" return "Audio/SE/"+$data_system.decision_se.name elsif $data_system && $data_system.respond_to?("sounds") && Changed: PBIntl --- Left +++ Right @@ -24,5 +24,5 @@ Graphics.update begin - mapinfos = load_data("Data/MapInfos.rxdata") + mapinfos = pbLoadRxData("Data/MapInfos") t = Time.now.to_i messages=[] @@ -49,5 +49,5 @@ Graphics.update end - filename=sprintf("Data/Map%03d.rxdata",id) + filename=sprintf("Data/Map%03d.%s",id,$RPGVX ? "rvdata" : "rxdata") next if !pbRgssExists?(filename) map = load_data(filename) @@ -74,5 +74,5 @@ end if list.code == 101 - lastitem+="#{list.parameters[0]}" + lastitem+="#{list.parameters[0]}" if !$RPGVX neednewline=true elsif list.code == 102 @@ -82,5 +82,6 @@ neednewline=false elsif list.code == 401 - lastitem+=" #{list.parameters[0]}" + lastitem+=" " if lastitem!="" + lastitem+="#{list.parameters[0]}" neednewline=true elsif list.code == 355 || list.code==655 Changed: Game_Map_ --- Left +++ Right @@ -31,5 +31,5 @@ def setup(map_id) @map_id = map_id - @map = load_data(sprintf("Data/Map%03d.rxdata", @map_id)) + @map = load_data(sprintf("Data/Map%03d.%s", @map_id,$RPGVX ? "rvdata" : "rxdata")) tileset = $data_tilesets[@map.tileset_id] @tileset_name = tileset.tileset_name Changed: PokemonPhone --- Left +++ Right @@ -135,5 +135,5 @@ end if !$game_player.move_route_forcing && - !$game_system.map_interpreter.running? && + !pbMapInterpreterRunning? && !$game_temp.message_window_showing $PokemonGlobal.phoneTime-=1 Changed: Walk_Run --- Left +++ Right @@ -34,5 +34,5 @@ return @defaultCharacterName end - if !$game_system.map_interpreter.running? && + if !pbMapInterpreterRunning? && !moving? && !@move_route_forcing && $PokemonGlobal meta=pbGetMetadata(0,MetadataPlayerA+$PokemonGlobal.playerID) @@ -54,12 +54,12 @@ alias update_old update def update -if !$game_system.map_interpreter.running? && +if !pbMapInterpreterRunning? && !moving? && !@move_route_forcing && $PokemonGlobal if $PokemonGlobal.bicycle - @move_speed = 5.2 + @move_speed = $RPGVX ? 8 : 5.2 elsif pbCanRun? - @move_speed = 4.8 + @move_speed = $RPGVX ? 6.5 : 4.8 else - @move_speed = 3.8 + @move_speed = $RPGVX ? 4.5 : 3.8 end end Changed: PokemonSystem --- Left +++ Right @@ -208,18 +208,22 @@ width=self.width x="" + ttt=Time.now + noswaps=0 while row>=0 - x+="\0" + x.concat("\0") thisRow=data[row,bytesPerScan] - i=0;while i3599 + return realMinutes +end + +def pbSetDayNightTone(toneToSet) + # Gets the time of day in minutes that the current time "feels like" + realMinutes=pbGetDayNightMinutes() hour=realMinutes/60 minute=realMinutes%60 Changed: PokemonMap --- Left +++ Right @@ -430,4 +430,7 @@ $data_tilesets=load_data("Data/Tilesets.rxdata") end + if pbRgssExists?("Data/Tilesets.rvdata") + $data_tilesets=load_data("Data/Tilesets.rvdata") + end end @@ -561,6 +564,6 @@ return false if dispx>=map.width*Game_Map.realResX+768 return false if dispy>=map.height*Game_Map.realResY+768 - return false if dispx<=-(Graphics.width*4+768) - return false if dispy<=-(Graphics.height*4+768) + return false if dispx<=-(Graphics.width*Game_Map::XSUBPIXEL+768) + return false if dispy<=-(Graphics.height*Game_Map::YSUBPIXEL+768) return true end @@ -569,6 +572,6 @@ return false if dispx>=dims[0]*Game_Map.realResX+768 return false if dispy>=dims[1]*Game_Map.realResY+768 - return false if dispx<=-(Graphics.width*4+768) - return false if dispy<=-(Graphics.height*4+768) + return false if dispx<=-(Graphics.width*Game_Map::XSUBPIXEL+768) + return false if dispy<=-(Graphics.height*Game_Map::XSUBPIXEL+768) return true end @@ -770,4 +773,24 @@ return 0 if !tile return getTerrainTag(tile[0],tile[1],tile[2]) + end + def getThisAndOtherEventRelativePos(thisEvent,otherEvent) + return [0,0] if !thisEvent || !otherEvent + if thisEvent.map.map_id==otherEvent.map.map_id + # Both events share the same map + return [otherEvent.x-thisEvent.x,otherEvent.y-thisEvent.y] + end + conns=MapFactoryHelper.getMapConnections + for conn in conns + if conn[0]==thisEvent.map.map_id && conn[1]==otherEvent.map.map_id + posX=(thisEvent.x+conn[4]-conn[1])+otherEvent.x + posY=(thisEvent.y+conn[5]-conn[2])+otherEvent.y + return [posX,posY] + elsif conn[1]==thisEvent.map.map_id && conn[0]==otherEvent.map.map_id + posX=(thisEvent.x+conn[1]-conn[4])+otherEvent.x + posY=(thisEvent.y+conn[2]-conn[5])+otherEvent.y + return [posX,posY] + end + end + return [0,0] end def getFacingTile(direction=nil,event=nil) Changed: PokemonTrainers --- Left +++ Right @@ -171,6 +171,6 @@ pbTrainerTypeEditorNew(symbol.to_s) end - if $game_system - $game_system.map_interpreter.command_end + if pbMapInterpreter + pbMapInterpreter.command_end end end @@ -355,6 +355,6 @@ end if !$PokemonTemp.waitingTrainer && $Trainer.pokemonCount>1 && - $game_system.map_interpreter.running? - thisEvent=$game_system.map_interpreter.get_character(0) + pbMapInterpreterRunning? + thisEvent=pbMapInterpreter.get_character(0) if !thisEvent.keypress triggeredEvents=$game_player.pbTriggeredTrainerEvents([2],false) @@ -468,5 +468,5 @@ Kernel.pbMessage(battle.endspeech2) if battle.endspeech2 if $PokemonTemp.waitingTrainer - $game_system.map_interpreter.pbSetSelfSwitch( + pbMapInterpreter.pbSetSelfSwitch( $PokemonTemp.waitingTrainer[1],"A",true ) @@ -506,5 +506,5 @@ if decision==1 if $PokemonTemp.waitingTrainer - $game_system.map_interpreter.pbSetSelfSwitch( + pbMapInterpreter.pbSetSelfSwitch( $PokemonTemp.waitingTrainer[1],"A",true ) Changed: Game_Temp --- Left +++ Right @@ -7,7 +7,6 @@ class Game_Temp - #-------------------------------------------------------------------------- - # * Public Instance Variables - #-------------------------------------------------------------------------- + attr_accessor :next_scene + attr_accessor :map_bgm # map music (for battle memory) attr_accessor :message_text # message text @@ -53,6 +52,4 @@ attr_accessor :to_title # return to title screen flag attr_accessor :last_file_index # last save file no. - attr_accessor :debug_top_row # debug screen: for saving conditions - attr_accessor :debug_index # debug screen: for saving conditions #-------------------------------------------------------------------------- # * Object Initialization Changed: Scene_Intro --- Left +++ Right @@ -33,5 +33,5 @@ def main # Loads Data System and Game System - data_system = load_data("Data/System.rxdata") + data_system = pbLoadRxData("Data/System") game_system = Game_System.new # Loads the Title.mid in Audio/BGM Changed: PokemonDebug --- Left +++ Right @@ -102,5 +102,5 @@ def pbMapTree - mapinfos=load_data("Data/MapInfos.rxdata") + mapinfos=pbLoadRxData("Data/MapInfos") maplevels=[] retarray=[] @@ -152,5 +152,5 @@ def dumpencdata(encdata) - mapinfos=load_data("Data/MapInfos.rxdata") + mapinfos=pbLoadRxData("Data/MapInfos") save_data(encdata,"Data/encounters.dat") File.open("PBS/encounters.txt","wb"){|f| Changed: Main --- Left +++ Right @@ -44,8 +44,8 @@ setThreadPriority=Win32API.new("kernel32.dll","SetThreadPriority",%w(l i),"") setPriorityClass.call(getCurrentProcess.call(),32768) # "Above normal" priority class - $data_animations = load_data("Data/Animations.rxdata") - $data_tilesets = load_data("Data/Tilesets.rxdata") - $data_common_events = load_data("Data/CommonEvents.rxdata") - $data_system = load_data("Data/System.rxdata") + $data_animations = pbLoadRxData("Data/Animations") + $data_tilesets = pbLoadRxData("Data/Tilesets") + $data_common_events = pbLoadRxData("Data/CommonEvents") + $data_system = pbLoadRxData("Data/System") $game_system = Game_System.new setScreenBorderName("border.png") Changed: Game_System --- Left +++ Right @@ -15,6 +15,11 @@ attr_accessor :bgm_position def initialize - @map_interpreter = Interpreter.new(0, true) - @battle_interpreter = Interpreter.new(0, false) + if $RPGVX + @map_interpreter = Game_Interpreter.new(0, true) + @battle_interpreter = Game_Interpreter.new(0, false) + else + @map_interpreter = Interpreter.new(0, true) + @battle_interpreter = Interpreter.new(0, false) + end @timer = 0 @timer_working = false Changed: Compiler --- Left +++ Right @@ -2566,4 +2566,7 @@ +def pbPushEvent(list,cmd,params=nil,indent=0) + list.push(RPG::EventCommand.new(cmd,indent,params ? params : [])) +end def pbPushEnd(list) list.push(RPG::EventCommand.new(0,0,[])) @@ -2579,7 +2582,16 @@ textsplit=text.split(/\\m/) for t in textsplit + first=true + if $RPGVX + list.push(RPG::EventCommand.new(101,indent,["",0,0,2])) + first=false + end textsplit2=t.split(/\n/) for i in 0...textsplit2.length - list.push(RPG::EventCommand.new(i==0 ? 101 : 401,indent,[textsplit2[i].gsub(/\s+$/,"")])) + textchunk=textsplit2[i].gsub(/\s+$/,"") + if textchunk && textchunk!="" + list.push(RPG::EventCommand.new(first ? 101 : 401,indent,[textchunk])) + first=false + end end end @@ -2720,5 +2732,5 @@ end def saveMap(mapID) - save_data(getMap(mapID),mapFilename(mapID)) + save_data(getMap(mapID),mapFilename(mapID)) rescue nil end def getEventFromXY(mapID,x,y) @@ -2775,5 +2787,7 @@ @trainernames=nil end - $game_system.map_interpreter.command_end if $game_system + if pbMapInterpreter + pbMapInterpreter.command_end rescue nil + end end end @@ -2805,4 +2819,6 @@ + + def pbCompileTrainerEvents(mustcompile) mapdata=MapData.new @@ -2846,4 +2862,7 @@ end end + if !$RPGVX && $INTERNAL + #convertVXProject(mapdata) + end end @@ -2942,18 +2961,10 @@ while i0 @light.ox=32 @@ -1146,5 +1152,5 @@ !$PokemonTemp.batterywarning && !$game_player.move_route_forcing && - !$game_system.map_interpreter.running? && + !pbMapInterpreterRunning? && !$game_temp.message_window_showing && pbBatteryLow? @@ -1560,5 +1566,5 @@ def Kernel.pbPokerus? - return false if $game_switches[POKéRUS_SWITCH] + return false if $game_switches[POKeRUS_SWITCH] for i in $Trainer.party return true if i.pokerus==1 && !i.egg? @@ -2075,5 +2081,5 @@ end -class Interpreter +module InterpreterFieldMixin def pbPushThisBoulder if $PokemonMap.strengthUsed @@ -2100,4 +2106,7 @@ return true end + def pbParams + @parameters ? @parameters : @params + end def pbSetEventTime(*arg) $PokemonGlobal.eventvars={} if !$PokemonGlobal.eventvars @@ -2132,5 +2141,5 @@ end def command_314 - if @parameters[0] == 0 && $Trainer && $Trainer.party + if pbParams[0] == 0 && $Trainer && $Trainer.party for i in $Trainer.party; i.heal; end end @@ -2144,5 +2153,5 @@ end def command_125 - value = operate_value(@parameters[0], @parameters[1], @parameters[2]) + value = operate_value(pbParams[0], pbParams[1], pbParams[2]) $Trainer.money+=value $Trainer.money=0 if $Trainer.money<0 @@ -2151,12 +2160,15 @@ end def command_132 - $PokemonGlobal.nextBattleBGM=(@parameters[0]) ? @parameters[0].clone : nil + $PokemonGlobal.nextBattleBGM=(pbParams[0]) ? pbParams[0].clone : nil return true end def command_133 - $PokemonGlobal.nextBattleME=(@parameters[0]) ? @parameters[0].clone : nil + $PokemonGlobal.nextBattleME=(pbParams[0]) ? pbParams[0].clone : nil return true end end +class Interpreter; include InterpreterFieldMixin; end +class Game_Interpreter; include InterpreterFieldMixin; end + def Kernel.pbCanUseHiddenMove?(pkmn,move) Changed: Resolution_ --- Left +++ Right @@ -3,9 +3,11 @@ TILEWIDTH = 32 TILEHEIGHT = 32 +XSUBPIXEL = $RPGVX ? 8 : 4 +YSUBPIXEL = $RPGVX ? 8 : 4 def self.realResX - return 4 * TILEWIDTH + return XSUBPIXEL * TILEWIDTH end def self.realResY - return 4 * TILEHEIGHT + return YSUBPIXEL * TILEHEIGHT end def display_x=(value) @@ -42,6 +44,6 @@ class Game_Player < Game_Character def center(x, y) - center_x = (Graphics.width/2 - Game_Map::TILEWIDTH/2) * 4 # X coordinate in the center of the screen - center_y = (Graphics.height/2 - Game_Map::TILEHEIGHT/2) * 4 # Y coordinate in the center of the screen + center_x = (Graphics.width/2 - Game_Map::TILEWIDTH/2) * Game_Map::XSUBPIXEL # X coordinate in the center of the screen + center_y = (Graphics.height/2 - Game_Map::TILEHEIGHT/2) * Game_Map::YSUBPIXEL # Y coordinate in the center of the screen max_x = ($game_map.width - Graphics.width*1.0/Game_Map::TILEWIDTH) * Game_Map.realResX max_y = ($game_map.height - Graphics.height*1.0/Game_Map::TILEHEIGHT) * Game_Map.realResY Changed: Game_Character_1 --- Left +++ Right @@ -62,7 +62,4 @@ @prelock_direction = 0 end - def map - return @map - end def moving? return (@real_x != @x * 4 * Game_Map::TILEWIDTH or @real_y != @y * 4 * Game_Map::TILEHEIGHT) Changed: Shadow --- Left +++ Right @@ -136,9 +136,7 @@ # ? CLASS Sprite_Character edit #=================================================== - class Sprite_Character < RPG::Sprite - alias shadow_initialize initialize + alias :shadow_initialize :initialize def initialize(viewport, character = nil) - super(viewport) @ombrelist=[] @character = character @@ -175,5 +173,4 @@ end end - #=================================================== # ? CLASS Game_Event edit Changed: Interpreter --- Left +++ Right @@ -272,14 +272,16 @@ end s.gsub!(/Section(\d+)/){$RGSS_SCRIPTS[$1.to_i][1]} + message=$!.message + message+="\r\n***Full script:\r\n#{script}" if event && $game_map mapname="???" mapname=$game_map.name rescue nil - raise "Script error within event #{event.id}, map #{$game_map.map_id} (#{mapname}):\r\n#{$!.message}\r\n#{s}" + raise "Script error within event #{event.id}, map #{$game_map.map_id} (#{mapname}):\r\n#{message}\r\n#{s}" elsif $game_map mapname="???" mapname=$game_map.name rescue nil - raise "Script error within map #{$game_map.map_id} (#{mapname}):\r\n#{$!.message}\r\n#{s}" + raise "Script error within map #{$game_map.map_id} (#{mapname}):\r\n#{message}\r\n#{s}" else - raise "Script error in interpreter:\r\n#{$!.message}\r\n#{s}" + raise "Script error in interpreter:\r\n#{message}\r\n#{s}" end return false @@ -311,9 +313,9 @@ when 103 # Input Number return command_103 - when 104 # Change Text Options + when 104 # Change Text Options [not in VX] return command_104 - when 105 # Button Input Processing + when 105 # Button Input Processing [not in VX] return command_105 - when 106 # Wait + when 106 # Wait [in VX: 230] return command_106 when 111 # Conditional Branch @@ -329,5 +331,5 @@ when 115 # Exit Event Processing return command_115 - when 116 # Erase Event + when 116 # Erase Event [in VX: 214] return command_116 when 117 # Call Common Event @@ -355,5 +357,5 @@ when 129 # Change Party Member return command_129 - when 131 # Change Windowskin + when 131 # Change Windowskin [not in VX] return command_131 when 132 # Change Battle BGM @@ -375,19 +377,19 @@ when 204 # Change Map Settings return command_204 - when 205 # Change Fog Color Tone + when 205 # Change Fog Color Tone [in VX: Set Move Route] return command_205 - when 206 # Change Fog Opacity + when 206 # Change Fog Opacity [in VX: Get on/off Vehicle] return command_206 - when 207 # Show Animation + when 207 # Show Animation [in VX: 212] return command_207 - when 208 # Change Transparent Flag + when 208 # Change Transparent Flag [in VX: 211] return command_208 - when 209 # Set Move Route + when 209 # Set Move Route [in VX: 205] return command_209 when 210 # Wait for Move's Completion return command_210 - when 221 # Prepare for Transition + when 221 # Prepare for Transition [Not in VX, now called Fadeout Screen] return command_221 - when 222 # Execute Transition + when 222 # Execute Transition [Not in VX, now called Fadein Screen] return command_222 when 223 # Change Screen Color Tone @@ -417,7 +419,7 @@ when 246 # Fade Out BGS return command_246 - when 247 # Memorize BGM/BGS + when 247 # Memorize BGM/BGS [not in VX] return command_247 - when 248 # Restore BGM/BGS + when 248 # Restore BGM/BGS [not in VX] return command_248 when 249 # Play ME Changed: DependentEvents --- Left +++ Right @@ -232,9 +232,22 @@ return -1 end - def pbFollowEventAcrossMaps(leader,follower,instant=false) + def pbFollowEventAcrossMaps(leader,follower,instant=false,leaderIsTrueLeader=true) d=leader.direction + # Get relative position of the follower from the leader + relativePos=$MapFactory.getThisAndOtherEventRelativePos(leader, follower) # Get the rear facing tile of leader - rearDirection=[0,0,8,0,6,0,4,0,2][d] - mapTile=$MapFactory.getFacingTile(rearDirection,leader) + facingDirection=[0,0,8,0,6,0,4,0,2][d] + if !leaderIsTrueLeader + if (relativePos[1]==0 && relativePos[0]==2) # 2 spaces to the right of leader + facingDirection=6 + elsif (relativePos[1]==0 && relativePos[0]==-2) # 2 spaces to the left of leader + facingDirection=4 + elsif relativePos[1]==-2 && relativePos[0]==0 # 2 spaces above leader + facingDirection=8 + elsif relativePos[1]==2 && relativePos[0]==0 # 2 spaces below leader + facingDirection=2 + end + end + mapTile=$MapFactory.getFacingTile(facingDirection,leader) if !mapTile # No room behind, just place the event at leader's position @@ -254,6 +267,11 @@ (follower.x-newX==1 && follower.y==newY) || (follower.y-newY==-1 && follower.x==newX) || - (follower.y-newY==1 && follower.x==newX) || - (follower.x-newX==-2 && follower.y==newY) || + (follower.y-newY==1 && follower.x==newX) + if instant + follower.moveto(newX,newY) + else + pbFancyMoveTo(follower,newX,newY) + end + elsif (follower.x-newX==-2 && follower.y==newY) || (follower.x-newX==2 && follower.y==newY) || (follower.y-newY==-2 && follower.x==newX) || @@ -301,5 +319,5 @@ for i in 0...events.length event=@realEvents[i] - pbFollowEventAcrossMaps(leader,event,true) + pbFollowEventAcrossMaps(leader,event,true,i==0) # Update X and Y for this event events[i][3]=event.x @@ -316,5 +334,5 @@ for i in 0...events.length event=@realEvents[i] - pbFollowEventAcrossMaps(leader,event) + pbFollowEventAcrossMaps(leader,event,false,i==0) # Update X and Y for this event events[i][3]=event.x @@ -352,6 +370,5 @@ for i in 0...events.length event=@realEvents[i] - if (event.jumping? || event.moving?) || - !($game_player.jumping? || $game_player.moving?) + if (event.jumping? || event.moving?) || !($game_player.jumping? || $game_player.moving?) then event.update elsif !event.starting @@ -365,5 +382,5 @@ end # Check event triggers - if Input.trigger?(Input::C) && !$game_system.map_interpreter.running? + if Input.trigger?(Input::C) && !pbMapInterpreterRunning? # Get position of tile facing the player facingTile=$MapFactory.getFacingTile() @@ -372,5 +389,5 @@ if e.x==$game_player.x && e.y==$game_player.y # On same position - if not e.jumping? and e.over_trigger? + if not e.jumping? # and e.over_trigger? ##TODO: Commented out for VX compat $game_temp.common_event_id = d[9] end @@ -378,11 +395,11 @@ e.x==facingTile[1] && e.y==facingTile[2] # On facing tile - if not e.jumping? and !e.over_trigger? + if not e.jumping? # and !e.over_trigger? ##TODO: Commented out for VX compat $game_temp.common_event_id = d[9] end end - } + } + end end - end def removeEvent(event) events=$PokemonGlobal.dependentEvents @@ -393,7 +410,9 @@ events[i][1]==event.id events[i]=nil + @realEvents[i]=nil @lastUpdate+=1 end events.compact! + @realEvents.compact! end end @@ -404,7 +423,9 @@ if events[i] && events[i][8]==name # Arbitrary name given to dependent event events[i]=nil + @realEvents[i]=nil @lastUpdate+=1 end events.compact! + @realEvents.compact! end end Changed: PokemonLoad --- Left +++ Right @@ -70,10 +70,10 @@ # names (not filenames) of fonts to be installed Names = [ - 'Pokémon Emerald', - 'Pokémon Emerald Narrow', - 'Pokémon Emerald Small', - 'Pokémon RS', - 'Pokémon DP', - 'Pokémon FireLeaf' + 'Pokemon Emerald', + 'Pokemon Emerald Narrow', + 'Pokemon Emerald Small', + 'Pokemon RS', + 'Pokemon DP', + 'Pokemon FireLeaf' ] # whether to notify player (via pop-up message) that fonts were installed @@ -372,6 +372,6 @@ end if !magicNumberMatches || $PokemonGlobal.safesave - if $game_system.map_interpreter.running? - $game_system.map_interpreter.setup(nil,0) + if pbMapInterpreterRunning? + pbMapInterpreter.setup(nil,0) end $MapFactory.setup($game_map.map_id) # calls setMapChanged Changed: Sprite_Timer --- Left +++ Right @@ -1,4 +1,5 @@ class Sprite_Timer - def initialize + def initialize(viewport=nil) + @viewport=viewport @timer=nil @total_sec=nil @@ -19,7 +20,9 @@ @timer=Window_AdvancedTextPokemon.newWithSize("", Graphics.width-120,0,120,64) + @timer.viewport=@viewport @timer.z=99998 end curtime=$game_system.timer / Graphics.frame_rate + curtime=0 if curtime<0 if curtime != @total_sec # Calculate total number of seconds @@ -30,5 +33,7 @@ @timer.text = _ISPRINTF("{1:02d}:{2:02d}", min, sec) end + else + @timer.visible=false if @timer end end end Changed: PokemonBugContest --- Left +++ Right @@ -333,5 +333,5 @@ # do nothing elsif !$game_player.move_route_forcing && - !$game_system.map_interpreter.running? && + !pbMapInterpreterRunning? && !$game_temp.message_window_showing if pbBugContestState.expired? Changed: PerspectiveTilemap --- Left +++ Right @@ -398,9 +398,9 @@ class Sprite_Character + alias perspectivetilemap_initialize initialize attr_accessor :character def initialize(viewport, character = nil) - super(viewport) @character = character - update + perspectivetilemap_initialize(viewport,character) end alias update_or :update