Changed: PokemonMap @@ -815,3 +815,6 @@ - x=(x+conn[4]-conn[1]) - y=(y+conn[5]-conn[2]) - return [conn[3],x,y] + newX=(x+conn[4]-conn[1]) + newY=(y+conn[5]-conn[2]) + next if newX<0 || newY<0 + dims=MapFactoryHelper.getMapDims(conn[3]) + next if newX>=dims[0] || newY>=dims[1] + return [conn[3],newX,newY] @@ -819,3 +822,6 @@ - x=(x+conn[1]-conn[4]) - y=(y+conn[2]-conn[5]) - return [conn[0],x,y] + newX=(x+conn[1]-conn[4]) + newY=(y+conn[2]-conn[5]) + next if newX<0 || newY<0 + dims=MapFactoryHelper.getMapDims(conn[0]) + next if newX>=dims[0] || newY>=dims[1] + return [conn[0],newX,newY] Changed: PokeBattle_MoveEffects @@ -2214,7 +2214,0 @@ -def pbBaseDamage(basedmg,attacker,opponent) - if opponent.effects[PBEffects::TwoTurnAttack]==PBMoves::FLY || - opponent.effects[PBEffects::TwoTurnAttack]==PBMoves::BOUNCE - return basedmg*2 - end - return basedmg -end Changed: DrawText @@ -203,0 +203,4 @@ +def isWaitChar(x) + return (x=="\1" || x=="\2") +end + @@ -258,1 +262,1 @@ - width=bitmap.text_size(textchars[position]).width + width=isWaitChar(textchars[position]) ? 0 : bitmap.text_size(textchars[position]).width @@ -286,1 +290,1 @@ - isspace=(textchars[position][/\s/]||textchars[position]=="\1") ? true : false + isspace=(textchars[position][/\s/]||isWaitChar(textchars[position])) ? true : false @@ -301,1 +305,1 @@ - havenl=true if textchars[position]=="\1" + havenl=true if isWaitChar(textchars[position]) @@ -336,1 +340,1 @@ - elsif (characters[i][0]=="\n" || characters[i][0]=="\1") && + elsif (characters[i][0]=="\n" || isWaitChar(characters[i][0])) && @@ -531,1 +535,1 @@ - width=bitmap.text_size(textchars[position]).width + width=isWaitChar(textchars[position]) ? 0 : bitmap.text_size(textchars[position]).width @@ -572,1 +576,1 @@ - isspace=(textchars[position][/\s/]||textchars[position]=="\1") ? true : false + isspace=(textchars[position][/\s/]||isWaitChar(textchars[position])) ? true : false @@ -588,1 +592,1 @@ - havenl=true if !graphic && textchars[position]=="\1" + havenl=true if !graphic && isWaitChar(textchars[position]) @@ -626,1 +630,1 @@ - elsif (characters[i][0]=="\n" || characters[i][0]=="\1") && + elsif (characters[i][0]=="\n" || isWaitChar(characters[i][0])) && @@ -721,1 +725,1 @@ - elsif ch[0]!="\n" && ch[0]!="\1" + elsif ch[0]!="\n" && !isWaitChar(ch[0]) @@ -770,0 +774,18 @@ + +def drawTextTable(bitmap,x,y,totalWidth,rowHeight,columnWidthPercents,table) + yPos=y + for i in 0...table.length + row=table[i] + xPos=x + for j in 0...row.length + cell=row[j] + cellwidth=columnWidthPercents[j]*totalWidth/100 + chars=getFormattedText( + bitmap,xPos,yPos,cellwidth,-1,cell,rowHeight) + drawFormattedChars(bitmap,chars) + xPos+=cellwidth + end + yPos+=rowHeight + end +end + Changed: Scene_Map @@ -43,0 +43,1 @@ + @spritesets={} if !@spritesets @@ -207,0 +208,1 @@ + Graphics.frame_reset Changed: Interpreter @@ -246,0 +246,1 @@ + s.gsub!(/Section(\d+)/){$RGSS_SCRIPTS[$1.to_i][1]} Changed: PokemonField @@ -1849,0 +1849,1 @@ + echoln [currentTag,facingTag] @@ -1909,0 +1910,6 @@ + end + def command_314 + if @parameters[0] == 0 && $Trainer && $Trainer.party + for i in $Trainer.party; i.heal; end + end + return true Changed: PokeBattle_ActualScene @@ -1270,0 +1270,3 @@ + if @sprites["trainer"].bitmap + @sprites["trainer"].y-=@sprites["trainer"].bitmap.height-128 + end @@ -1441,0 +1444,6 @@ + end + if @sprites["trainer"].bitmap + @sprites["trainer"].y-=@sprites["trainer"].bitmap.height-128 + end + if @sprites["trainer2"] && @sprites["trainer2"].bitmap + @sprites["trainer2"].y-=@sprites["trainer2"].bitmap.height-128 Changed: PokemonTrainers @@ -66,2 +66,7 @@ - f.write(sprintf("%d,%s,%s,%d,%s,%s,%s,%s\r\n", - i,getConstantName(PBTrainers,record[0]),record[2], + begin + constName=getConstantName(PBTrainers,i) + rescue RuntimeError + constName="TRAINER#{i}" + end + dataline=sprintf("%d,%s,%s,%d,%s,%s,%s,%s\r\n", + i,constName,record[2], @@ -73,1 +78,2 @@ - )) + ) + f.write(dataline) @@ -159,1 +165,1 @@ - if !ret + if !ret Changed: PokemonTilesetEditor @@ -26,1 +26,1 @@ - @sprites["tileset"].src_rect=Rect.new(0,@y,256,256) + @sprites["tileset"].src_rect=Rect.new(0,@y,256,Graphics.height-64) @@ -32,1 +32,1 @@ - for yy in 0...8 + for yy in 0...(Graphics.height-64)/32 @@ -79,1 +79,1 @@ - @sprites["tileset"].src_rect=Rect.new(0,0,256,256) + @sprites["tileset"].src_rect=Rect.new(0,0,256,Graphics.height-64) @@ -83,1 +83,1 @@ - @sprites["overlay"].bitmap=Bitmap.new(256,256) + @sprites["overlay"].bitmap=Bitmap.new(256,Graphics.height-64) @@ -100,2 +100,1 @@ - end - if Input.trigger?(Input::B) + elsif Input.trigger?(Input::B) @@ -118,2 +117,1 @@ - end - if Input.repeat?(Input::RIGHT) + elsif Input.repeat?(Input::RIGHT) @@ -123,2 +121,1 @@ - end - if Input.repeat?(Input::LEFT) + elsif Input.repeat?(Input::LEFT) @@ -128,2 +125,1 @@ - end - if Input.repeat?(Input::DOWN) + elsif Input.repeat?(Input::DOWN) @@ -133,2 +129,1 @@ - end - if Input.repeat?(Input::UP) + elsif Input.repeat?(Input::UP) @@ -138,2 +133,1 @@ - end - if Input.repeat?(Input::R) + elsif Input.repeat?(Input::R) @@ -143,2 +137,1 @@ - end - if Input.repeat?(Input::L) + elsif Input.repeat?(Input::L) @@ -148,2 +141,1 @@ - end - if Input.trigger?(Input::C) + elsif Input.trigger?(Input::C) @@ -155,2 +147,1 @@ - end - if Input.trigger?(Input::A) + elsif Input.trigger?(Input::A) Changed: PokemonLoad @@ -176,0 +176,4 @@ + oldInterpreter=nil + if $game_system && $game_system.map_interpreter + oldInterpreter=$game_system.map_interpreter + end @@ -231,1 +235,10 @@ - @scene.pbEndScene + @scene.pbEndScene + if $game_map && $game_map.events + for event in $game_map.events.values + event.clear_starting + end + end + $game_temp.common_event_id=0 if $game_temp + if oldInterpreter + oldInterpreter.setup(nil,0) + end Changed: WindowAndTilemap @@ -857,1 +857,6 @@ - anim=autotileFrame(id) + frames=@framecount[id/48-1] + if frames<=1 + anim=0 + else + anim=(Graphics.frame_count/Animated_Autotiles_Frames)%frames + end @@ -865,1 +870,3 @@ - sprite.bitmap=bitmap if !sprite.equal?(bitmap) || sprite.bitmap!=bitmap + if !sprite.bitmap.equal?(bitmap) || sprite.bitmap!=bitmap + sprite.bitmap=bitmap + end @@ -880,1 +887,3 @@ - sprite.bitmap=bitmap if !sprite.equal?(bitmap) || sprite.bitmap!=bitmap + if !sprite.bitmap.equal?(bitmap) || sprite.bitmap!=bitmap + sprite.bitmap=bitmap + end @@ -1250,1 +1259,6 @@ - frame=autotileFrame(id) + frames=@framecount[id/48-1] + if frames<=1 + frame=0 + else + frame=(Graphics.frame_count/Animated_Autotiles_Frames)%frames + end Changed: Compiler @@ -1258,0 +1258,7 @@ +def hasConstValue?(mod,value) + for c in mod.constants + return true if mod.const_get(c.to_sym)==value + end + return false +end + @@ -1390,0 +1397,1 @@ + movelist=[] @@ -1393,0 +1401,6 @@ + movelist.push([j,alevel,move]) + end + movelist.sort!{|a,b| a[1]==b[1] ? a[0]<=>b[0] : a[1]<=>b[1] } + for j in 0...movelist.length + alevel=movelist[j][1] + move=movelist[j][2] @@ -1774,0 +1788,1 @@ + movelist=[] @@ -1778,1 +1793,6 @@ -# move=equivmoves[move-355] if move>=355 + movelist.push([j,alevel,move]) + end + movelist.sort!{|a,b| a[1]==b[1] ? a[0]<=>b[0] : a[1]<=>b[1] } + for j in 0...movelist.length + move=movelist[j][1] + alevel=movelist[j][2] @@ -1783,1 +1803,1 @@ - print("???: #{oldmove}") +# print("???: #{oldmove}") @@ -2538,1 +2558,1 @@ - if command[/^(Battle\:|Type\:|Name\:|EndSpeech\:|EndBattle\:|RegSpeech\:|BattleID\:)/] + if command[/^(Battle\:|Type\:|Name\:|EndSpeech\:|EndBattle\:|RegSpeech\:|BattleID\:|EndIfSwitch\:)/] @@ -2557,0 +2577,1 @@ + endifswitch=[] @@ -2572,0 +2593,4 @@ + pbPushComment(firstpage.list,command) + end + if command[/^EndIfSwitch\:\s*([\s\S]+)$/] + endifswitch.push(($~[1].gsub(/^\s+/,"").gsub(/\s+$/,"")).to_i) @@ -2659,1 +2684,1 @@ - ebattle=(endbattles[0]) ? endbattles[0] : "" + ebattle=(endbattles[0]) ? endbattles[0] : "..." @@ -2667,0 +2692,11 @@ + end + for endswitch in endifswitch + ebattle=(endbattles[0]) ? endbattles[0] : "..." + endIfSwitchPage=secondpage.clone + endIfSwitchPage.condition=RPG::Event::Page::Condition.new + endIfSwitchPage.condition.switch1_valid=true + endIfSwitchPage.condition.switch1_id=endswitch + endIfSwitchPage.list=[] + pbPushText(endIfSwitchPage.list,ebattle) + pbPushEnd(endIfSwitchPage.list) + ret.pages.push(endIfSwitchPage) Changed: PokemonMessages @@ -21,2 +21,2 @@ - @spriteset.update - @message_window.update + @spriteset.update if @spriteset + @message_window.update if @message_window @@ -52,1 +52,1 @@ - begin + if $scene.respond_to?("miniupdate") @@ -54,1 +54,1 @@ - rescue NoMethodError + else @@ -64,1 +64,1 @@ - begin + if $scene.respond_to?("miniupdate") @@ -66,1 +66,1 @@ - rescue NoMethodError + else @@ -285,0 +285,1 @@ + Input.update # Must call Input.update again to avoid extra triggers @@ -290,0 +291,1 @@ + Input.update # Must call Input.update again to avoid extra triggers @@ -804,0 +806,4 @@ + control=controls[i][0] + if control=="wt" || control=="wtnp" + textchunks[i]+="\2" + end @@ -959,1 +965,0 @@ - Changed: SpriteWindow @@ -1968,6 +1968,0 @@ - def textspeed=(value) - @frameskip=value - end - def textspeed - @frameskip - end @@ -2022,1 +2016,2 @@ - chars=getFormattedTextForDims(self.contents,0,0,cwidth,-1,text,32) + chars=getFormattedTextForDims( + self.contents,0,0,cwidth-self.borderX-2-6,-1,text,32) @@ -2028,0 +2023,9 @@ + end + def resizeToFit2(text,maxwidth,maxheight) + dims=resizeToFitInternal(text,maxwidth) + oldstarting=@starting + @starting=true + self.width=[dims[0]+self.borderX+2+6,maxwidth].min + self.height=[dims[1]+self.borderY,maxheight].min + @starting=oldstarting + self.text=self.text @@ -2090,0 +2094,8 @@ + end + def maxPosition + pos=0 + for ch in @fmtchars + # index after the last character's index + pos=ch[14]+1 if pos