Changed: PokemonPokedex @@ -500,1 +500,1 @@ - textpos.push([_ISPRINTF("{1:s} POKéMON",kind),100*2,40*2,0,basecolor,shadowcolor]) + textpos.push([_ISPRINTF("{1:s} POKĂ©MON",kind),100*2,40*2,0,basecolor,shadowcolor]) @@ -508,1 +508,1 @@ - textpos.push([_INTL("????? POKéMON"),100*2,40*2,0,basecolor,shadowcolor]) + textpos.push([_INTL("????? POKĂ©MON"),100*2,40*2,0,basecolor,shadowcolor]) @@ -727,1 +727,1 @@ - commands=[_INTL("BACK TO LIST"),_INTL("LIST TOP"),_INTL("LIST BOTTOM"),_INTL("CLOSE POKeDEX")] + commands=[_INTL("BACK TO LIST"),_INTL("LIST TOP"),_INTL("LIST BOTTOM"),_INTL("CLOSE POKĂ©DEX")] Changed: Interpreter @@ -257,0 +257,1 @@ + raise Changed: PokemonField @@ -275,2 +275,2 @@ - $game_system.bgm_stop - $game_system.bgs_stop + $game_system.bgm_unpause + $game_system.bgs_unpause @@ -1334,1 +1334,2 @@ - get_character(0).erase_route + e=get_character(0) + e.erase_route if e Changed: PokeBattle_ActualScene @@ -148,1 +148,3 @@ - "",0,Graphics.height-96,@window.width,96,viewport) + "",4,Graphics.height-96, + Graphics.width-@window.width-4, + 96,viewport) Changed: PokemonTrainers @@ -293,2 +293,2 @@ - $game_system.bgm_stop - $game_system.bgs_stop + $game_system.bgm_unpause + $game_system.bgs_unpause Changed: SpriteResizer @@ -21,0 +21,30 @@ + end + def self.snap_to_bitmap + takescreen=Win32API.new("rubyscreen.dll","TakeScreenshot","%w(p)","i") + takescreen.call("./tempscreen.bmp") + bm=nil + if FileTest.exist?("./tempscreen.bmp") + bm=Bitmap.new("./tempscreen.bmp") + File.delete("./tempscreen.bmp") + end + if bm && $ResizeOffsetX && $ResizeOffsetY && + $ResizeOffsetX!=0 || $ResizeOffsetY!=0 + tmpbitmap=Bitmap.new( + Graphics.width*$ResizeFactor, + Graphics.height*$ResizeFactor) + tmpbitmap.blt(0,0,bm, + Rect.new($ResizeOffsetX*$ResizeFactor, + $ResizeOffsetY*$ResizeFactor, + tmpbitmap.width,tmpbitmap.height)) + bm.dispose + bm=tmpbitmap + end + if bm && (bm.width>5 @@ -750,1 +756,1 @@ - frames=autotile.width/32 + frames=autotile.width>>5 @@ -780,1 +786,1 @@ - sprite.src_rect.set((id - 384) % 8 * 32, (id - 384) / 8 * 32,32,32) + sprite.src_rect.set(((id - 384)&7)<<5,((id - 384)>>3)<<5,32,32) @@ -785,1 +791,1 @@ - rect=Rect.new((id - 384) % 8 * 32, (id - 384) / 8 * 32,32,32) + rect=Rect.new(((id - 384)&7)<<5,((id - 384)>>3)<<5,32,32) @@ -838,9 +844,17 @@ - for z in 0...@map_data.zsize - for y in 0...@map_data.ysize - for x in 0...@map_data.xsize - id = @map_data[x, y, z] - next if id==0 || !@priorities[id] - next if @priorities[id]==0 - @priotiles.push([x,y,z,id]) - end - end + ysize=@map_data.ysize + xsize=@map_data.xsize + zsize=@map_data.zsize + if xsize>100 || ysize>100 + @fullyrefreshed=false + else + for z in 0...zsize + for y in 0...ysize + for x in 0...xsize + id = @map_data[x, y, z] + next if id==0 || !@priorities[id] + next if @priorities[id]==0 + @priotiles.push([x,y,z,id]) + end + end + end + @fullyrefreshed=true @@ -884,1 +898,0 @@ - framecount=[] @@ -889,1 +902,1 @@ - framecount.push(numframes) + @framecount[i]=numframes @@ -892,13 +905,23 @@ - for y in 0...@map_data.ysize - for x in 0...@map_data.xsize - haveautotile=false - for z in 0...@map_data.zsize - id = @map_data[x, y, z] - next if id==0 || id>=384 || @priorities[id]!=0 || !@priorities[id] - next if framecount[id/48-1]<2 - haveautotile=true - break - end - @prioautotiles.push([x,y]) if haveautotile - end - end + ysize=@map_data.ysize + xsize=@map_data.xsize + zsize=@map_data.zsize + if xsize>100 || ysize>100 + @fullyrefreshedautos=false + else + for y in 0...ysize + for x in 0...xsize + haveautotile=false + for z in 0...zsize + id = @map_data[x, y, z] + next if id==0 || id>=384 || @priorities[id]!=0 || !@priorities[id] + next if @framecount[id/48-1]<2 + haveautotile=true + break + end + @prioautotiles.push([x,y]) if haveautotile + end + end + @fullyrefreshedautos=true + end + else + @fullyrefreshedautos=true @@ -962,1 +985,1 @@ - tmpcolor.set(r*16,g*16,b*16) + tmpcolor.set(r<<4,g<<4,b<<4) @@ -995,1 +1018,1 @@ - return true if @prioautotiles.length==0 + return true if @fullyrefreshedautos && @prioautotiles.length==0 @@ -1012,26 +1035,16 @@ - for tile in @prioautotiles - x=tile[0] - y=tile[1] - next if xxEnd - next if yyEnd - overallcount+=1 - xpos=(x<<5)-@oxLayer0 - ypos=(y<<5)-@oyLayer0 - bitmap.fill_rect(xpos,ypos,0,0,trans) if overallcount<=2000 - for z in range - id = @map_data[x,y,z] - next if id==0 || @priorities[id]!=0 || !@priorities[id] - if overallcount>2000 - count=addTile(@autosprites,count,xpos,ypos,id) - next - elsif id>=384 - temprect.set((id - 384) % 8 * 32, (id - 384) / 8 * 32,32,32) - bitmap.blt(xpos,ypos,@tileset,temprect) - else - tilebitmap=@autotileInfo[id] - if !tilebitmap - anim=autotileFrame(id) - next if anim<0 - tilebitmap=Bitmap.new(32,32) - bltAutotile(tilebitmap,0,0,id,anim) - @autotileInfo[id]=tilebitmap + if !@fullyrefreshedautos + for y in yStart..yEnd + for x in xStart..xEnd + haveautotile=false + for z in range + id = @map_data[x, y, z] + next if id<48 || id>=384 || @priorities[id]!=0 || !@priorities[id] + next if @framecount[id/48-1]<2 + if !haveautotile + haveautotile=true + overallcount+=1 + xpos=(x<<5)-@oxLayer0 + ypos=(y<<5)-@oyLayer0 + bitmap.fill_rect(xpos,ypos,0,0,trans) if overallcount<=2000 + break + end @@ -1039,1 +1052,53 @@ - bitmap.blt(xpos,ypos,tilebitmap,tilerect) + for z in range + id = @map_data[x,y,z] + next if id<48 || @priorities[id]!=0 || !@priorities[id] + if overallcount>2000 + count=addTile(@autosprites,count,xpos,ypos,id) + next + elsif id>=384 + temprect.set(((id - 384)&7)<<5,((id - 384)>>3)<<5,32,32) + bitmap.blt(xpos,ypos,@tileset,temprect) + else + tilebitmap=@autotileInfo[id] + if !tilebitmap + anim=autotileFrame(id) + next if anim<0 + tilebitmap=Bitmap.new(32,32) + bltAutotile(tilebitmap,0,0,id,anim) + @autotileInfo[id]=tilebitmap + end + bitmap.blt(xpos,ypos,tilebitmap,tilerect) + end + end + end + end + else + for tile in @prioautotiles + x=tile[0] + y=tile[1] + next if xxEnd + next if yyEnd + overallcount+=1 + xpos=(x<<5)-@oxLayer0 + ypos=(y<<5)-@oyLayer0 + bitmap.fill_rect(xpos,ypos,0,0,trans) if overallcount<=2000 + for z in range + id = @map_data[x,y,z] + next if id<48 || @priorities[id]!=0 || !@priorities[id] + if overallcount>2000 + count=addTile(@autosprites,count,xpos,ypos,id) + next + elsif id>=384 + temprect.set(((id - 384)&7)<<5,((id - 384)>>3)<<5,32,32) + bitmap.blt(xpos,ypos,@tileset,temprect) + else + tilebitmap=@autotileInfo[id] + if !tilebitmap + anim=autotileFrame(id) + next if anim<0 + tilebitmap=Bitmap.new(32,32) + bltAutotile(tilebitmap,0,0,id,anim) + @autotileInfo[id]=tilebitmap + end + bitmap.blt(xpos,ypos,tilebitmap,tilerect) + end @@ -1156,7 +1221,24 @@ - for prio in @priotiles - next if prio[0]maxX - next if prio[1]maxY - id=prio[3] - xpos=(prio[0]<<5)-@ox - ypos=(prio[1]<<5)-@oy - count=addTile(@tiles,count,xpos,ypos,id) + if @fullyrefreshed + for prio in @priotiles + x=prio[0] + y=prio[1] + next if xmaxX + next if ymaxY + id=prio[3] + xpos=(x<<5)-@ox + ypos=(y<<5)-@oy + count=addTile(@tiles,count,xpos,ypos,id) + end + else + for z in 0...@map_data.zsize + for y in minY..maxY + for x in minX..maxX + id = @map_data[x, y, z] + next if id==0 || !@priorities[id] + next if @priorities[id]==0 + xpos=(x<<5)-@ox + ypos=(y<<5)-@oy + count=addTile(@tiles,count,xpos,ypos,id) + end + end + end Changed: PokemonEntry @@ -645,0 +645,121 @@ + +class Window_TextEntry_ChineseIME < Window_TextEntry + def initialize(*arg) + super(*arg) + @mode=0 + @lastword="" + @imeaid=Window_CommandPokemon.newEmpty(0,0,120,32*6) + @imeaid.visible=false + @imeshow=0 + @imedata=load_data("PBS/codes.dat") + end + def viewport=(v) + super + @imeaid.viewport=v + end + def keyToAscii + # Letter keys + for i in 65..90 + if Input.repeatex?(i) + shift=(Input.press?(Input::SHIFT)) ? 0x41 : 0x61 + return (shift+(i-65)).chr + end + end + # Number keys + shifted=")!@\#$%^&*(" + unshifted="0123456789" + for i in 48..57 + if Input.repeatex?(i) + return (Input.press?(Input::SHIFT)) ? shifted[i-48].chr : unshifted[i-48].chr + end + end + keys=[ + [32," "," "], + [106,"*","*"], + [107,"+","+"], + [109,"-","-"], + [111,"/","/"], + [186,";",":"], + [187,"=","+"], + [188,",","<"], + [189,"-","_"], + [190,_INTL("."),">"], + [191,"/","?"], + [219,"[","{"], +# [220,"\\","|"], + [221,"]","}"], + [222,"'","\""] + ] + for i in keys + if Input.repeatex?(i[0]) + return (Input.press?(Input::SHIFT)) ? i[2] : i[1] + end + end + return "" + end + def update_ascii + c=keyToAscii + if c!="" + insert(c) + end + end + def update_chinese + c=keyToAscii + if c!="" + @lastword+=c + @imeshow=Graphics.frame_count + @imeaid.visible=false + end + if @imeshow+300 + break + end + } + @imeaid.visible=true + @imeaid.contents.font.name=["Batang","SimSun","MS Mincho","Arial Unicode MS","Code2000"] + @imeaid.commands=commands + end + if @imeaid.visible + @imeaid.update + end + end + def update + @frame+=1 + @frame%=20 + self.refresh if ((@frame%10)==0) + # Moving cursor + if Input.repeat?(Input::LEFT) + if @cursor > 0 + @cursor-=1 + @frame=0 + self.refresh + end + return + end + if Input.repeat?(Input::RIGHT) + if @cursor < self.text.scan(/./m).length + @cursor+=1 + @frame=0 + self.refresh + end + return + end + # Backspace + if Input.repeatex?(8) || Input.repeatex?(0x2E) + self.delete if @cursor > 0 + return + end + if @mode==0 + update_chinese + else + update_ascii + end + end +end + Changed: Compiler @@ -2306,0 +2306,2 @@ + Graphics.update + t = Time.now.to_i @@ -2311,0 +2313,4 @@ + if Time.now.to_i - t >= 5 + t = Time.now.to_i + Graphics.update + end Changed: Audio @@ -313,0 +313,5 @@ + def bgm_unpause; @bgm_position=0; end + def bgs_unpause; ; end + def bgs_resume(bgm,volume=80,pitch=100); + bgs_play(bgm,volume,pitch) + end @@ -338,0 +343,2 @@ + def bgm_unpause; ; end + def bgs_unpause; ; end Changed: PokemonMessages @@ -4,1 +4,3 @@ - def miniupdateOriginal + def updatemini + oldmws=$game_temp.message_window_showing + $game_temp.message_window_showing=true @@ -18,0 +20,1 @@ + $game_temp.message_window_showing=false @@ -19,2 +22,4 @@ - end -end + @message_window.update + end +end + @@ -27,4 +32,1 @@ - oldmws=$game_temp.message_window_showing - $game_temp.message_window_showing=true - $scene.miniupdateOriginal - $game_temp.message_window_showing=oldmws + $scene.updatemini @@ -659,0 +661,12 @@ + msgwindow.height=32*2+msgwindow.borderY + case $game_system.message_position + when 0 # up + msgwindow.y=0 + when 1 # middle + msgwindow.y=(Graphics.height/2)-(msgwindow.height/2) + when 2 + msgwindow.y=(Graphics.height)-(msgwindow.height) + end + if $game_system.message_frame != 0 + msgwindow.opacity = 0 + end Changed: SpriteWindow @@ -477,19 +477,0 @@ - def self.snap_to_bitmap - takescreen=Win32API.new("rubyscreen.dll","TakeScreenshot","%w(p)","i") - takescreen.call("./tempscreen.bmp") - bm=nil - if FileTest.exist?("./tempscreen.bmp") - bm=Bitmap.new("./tempscreen.bmp") - File.delete("./tempscreen.bmp") - end - if bm && (bm.width1 # "\1" means to pause the message + ret+="\1" if lines>=numlines # "\1" means to pause the message @@ -1123,1 +1104,1 @@ - ret+="\1" if lines>1 + ret+="\1" if lines>=numlines @@ -1634,1 +1615,1 @@ - normtext=getLineBrokenTextEx(bitmap,text,width,nil) + normtext=getLineBrokenTextEx(bitmap,text,width,numlines,nil) @@ -1708,0 +1689,14 @@ + +def pbGetFileString(file) + Marshal.neverload=true + str=nil + begin + str=load_data(file) + rescue Errno::ENOENT, Errno::EINVAL, Errno::EACCES, RGSSError + str=nil + ensure + Marshal.neverload=false + end + return str +end + @@ -1824,0 +1819,1 @@ + @pauseopacity=0 @@ -1910,0 +1906,1 @@ + @pauseopacity=0 if !value @@ -1967,0 +1964,1 @@ + @pauseopacity=[@pauseopacity+64,255].min @@ -2023,1 +2021,5 @@ - return !@trim || skinformat==0 ? 32 : @trim[0]+(@skinrect.width-@trim[2]+@trim[0]) + return 32 if !@trim || skinformat==0 + if @_windowskin && !@_windowskin.disposed? + return @trim[0]+(@_windowskin.width-@trim[2]-@trim[0]) + end + return 32 @@ -2026,1 +2028,5 @@ - return !@trim || skinformat==0 ? 32 : @trim[1]+(@skinrect.width-@trim[3]+@trim[1]) + return 32 if !@trim || skinformat==0 + if @_windowskin && !@_windowskin.disposed? + return @trim[1]+(@_windowskin.height-@trim[3]-@trim[1]) + end + return 32 @@ -2110,1 +2116,1 @@ - @sprites["pause"].opacity=@opacity + @sprites["pause"].opacity=@pauseopacity @@ -2817,1 +2823,2 @@ - return Kernel.getLineBrokenTextEx(self.contents,value,width-self.borderX,dims,false) + return Kernel.getLineBrokenTextEx(self.contents,value,width-self.borderX, + (self.height-self.borderY)/32,dims,false) @@ -2905,0 +2912,1 @@ + visiblelines=(self.height-self.borderY)/32 @@ -2914,1 +2922,1 @@ - if @linesdrawn>0 + if @linesdrawn>=visiblelines-1 @@ -3015,1 +3023,2 @@ - return Kernel.getLineBrokenTextEx(self.contents,value,width-self.borderX,dims,true) + return Kernel.getLineBrokenTextEx(self.contents,value,width-self.borderX, + (self.height-self.borderY)/32,dims,true) Changed: PokemonUtilities @@ -1012,0 +1012,105 @@ + +module GifLibrary + @@loadlib=Win32API.new("Kernel32.dll","LoadLibrary",'p','') + if FileTest.exist?("gif.dll") + PngDll=@@loadlib.call("gif.dll") + GifToPngFiles=Win32API.new("gif.dll","GifToPngFiles",'pp','l') + GifToPngFilesInMemory=Win32API.new("gif.dll","GifToPngFilesInMemory",'plp','l') + CopyDataString=Win32API.new("gif.dll","CopyDataString",'lpl','l') + FreeDataString=Win32API.new("gif.dll","FreeDataString",'l','') + else + PngDll=nil + end + def self.getDataFromResult(result) + datasize=CopyDataString.call(result,"",0) + ret=nil + if datasize!=0 + data="0"*datasize + CopyDataString.call(result,data,datasize) + ret=data.unpack("V*") + end + FreeDataString.call(result) + return ret + end +end + +class GifSprite + def initialize(file,viewport=nil) + @gifbitmaps=[] + @gifdelays=[] + @totalframes=0 + @framecount=0 + @sprite=Sprite.new(viewport) + filestring=pbGetFileString(file) + if !filestring + filestring=pbGetFileString(file+".gif") + end + if filestring && GifLibrary::PngDll + result=GifLibrary::GifToPngFilesInMemory.call(filestring,filestring.length,File.basename(file)) + else + result=0 + end + if result>0 + @gifdelays=GifLibrary.getDataFromResult(result) + @totalframes=@gifdelays.pop + for i in 0...@gifdelays.length + @gifdelays[i]=[@gifdelays[i],1].max + bmfile=sprintf("%s%d.png",File.basename(file),i); + if FileTest.exist?(bmfile) + @gifbitmaps.push(Bitmap.new(bmfile)) + File.delete(bmfile) + else + @gifbitmaps.push(Bitmap.new(1,1)) + end + @sprite.bitmap=@gifbitmaps[0] + end + end + end + def totalframes + @totalframes + end + def currentframe + @totalframes<=0 ? 0 : @framecount%@totalframes + end + def disposed? + @sprite.disposed? + end + def viewport + @sprite.viewport + end + def width + @gifbitmaps.length==0 ? 0 : @gifbitmaps[0].width + end + def height + @gifbitmaps.length==0 ? 0 : @gifbitmaps[0].height + end + def update + @sprite.update + if @gifbitmaps.length>0 + @framecount+=2 + frame=@totalframes<=0 ? 0 : @framecount%@totalframes + frametoshow=0 + for i in 0...@gifdelays.length + frametoshow=i if @gifdelays[i]<=frame + end + @sprite.bitmap=@gifbitmaps[frametoshow] + end + end + def dispose + @sprite.dispose + for i in @gifbitmaps + i.dispose + end + end + def flash(*arg); sprite.flash(*arg); end + %w[ + x y z ox oy visible zoom_x zoom_y + angle mirror bush_depth opacity blend_type + color tone + ].each do |s| + eval <<-__END__ + def #{s}; @sprite.#{s}; end + def #{s}=(value); @sprite.#{s}=value; end + __END__ + end +end Changed: PokeBattle_Battle @@ -72,0 +72,4 @@ + if pbIsSnagBall?(ball) + pbSnagPokeBall(ball,rareness) + return + end @@ -79,3 +83,7 @@ - if battler.hp<=0 - raise _INTL("Can't catch a fainted Pokemon") - end + if battler.hp<=0 + battler=battler.pbPartner + end + if battler.hp<=0 + pbDisplay(_INTL("But there was no target...")) + return + end @@ -160,0 +168,99 @@ + + +def pbSnagPokeBall(ball,rareness=nil) + itemname=PBItems.getName(ball) + pbDisplayBrief(_INTL("{1} threw one {2}!",self.pbPlayer.name,itemname)) + battler=self.battlers[1] + if battler.hp<=0 + battler=battler.pbPartner + end + if battler.hp<=0 + pbDisplay(_INTL("But there was no target...")) + return + end + pokemon=battler.pokemon + species=pokemon.species + if !rareness + dexdata=pbOpenDexData + pbDexDataOffset(dexdata,species,16) + rareness=dexdata.fgetb # Get rareness from dexdata file + dexdata.close + end + a=battler.totalhp + b=battler.hp + case ball + when PBItems::GREATBALL + rareness=(rareness*3/2).floor + when PBItems::SAFARIBALL + rareness=(rareness*3/2).floor + when PBItems::ULTRABALL + rareness*=2 + when PBItems::NETBALL + rareness*=3 if battler.pbHasType?(PBTypes::BUG) || battler.pbHasType?(PBTypes::WATER) + when PBItems::DIVEBALL + rareness=(rareness*7/2).floor if @environment==PBEnvironment::Underwater + when PBItems::TIMERBALL + if @turncount>30 + rareness*=4 + else + rareness=rareness*(@turncount+10)/10 + end + when PBItems::REPEATBALL + rareness*=3 if self.pbPlayer.owned[battler.species] + when PBItems::NESTBALL + if battler.level<30 + rareness*=(40-battler.level)/10 + end + end + x=(((a*3-b*2)*rareness)/(a*3)).floor + if battler.status==PBStatuses::SLEEP|| + battler.status==PBStatuses::FROZEN + x*=2 + elsif battler.status!=0 + x=(x*3/2).floor + end + shakes=0 + if x>255 || ball==PBItems::MASTERBALL + shakes=4 + else + y = 0x000FFFF0 / (Math.sqrt(Math.sqrt( 0x00FF0000/x ) ) ) + shakes+=1 if pbRandom(65536)=data.xsize || x<0 + return 0 if y>=data.ysize || y<0 + t=data[x,y] + xp1=[x+1,data.xsize-1].min + yp1=[y+1,data.ysize-1].min + xm1=[x-1,0].max + ym1=[y-1,0].max + i=0 + i|=0x01 if data[x ,ym1]==t # N + i|=0x02 if data[xp1,ym1]==t # NE + i|=0x04 if data[xp1,y ]==t # E + i|=0x08 if data[xp1,yp1]==t # SE + i|=0x10 if data[x ,yp1]==t # S + i|=0x20 if data[xm1,yp1]==t # SW + i|=0x40 if data[xm1,y ]==t # W + i|=0x80 if data[xm1,ym1]==t # NW + return i + end + + +attr_accessor :tileset +attr_accessor :autotiles + +def initialize(tileset,autotiles) + @tileset=tileset + @autotiles=autotiles +end + +def self.fromTileset(tileset) + bmtileset=RPG::Cache.tileset(tileset.tileset_name) + bmautotiles=[] + for i in 0...7 + bmautotiles.push(RPG::Cache.autotile(tileset.autotile_names[i])) + end + return self.new(bmtileset,bmautotiles) +end + +def bltSmallAutotile(bitmap,x,y,cxTile,cyTile,id,frame) + return if frame<0 || !@autotiles || id>=384 + autotile=@autotiles[id/48-1] + return if !autotile || autotile.disposed? + cxTile=[cxTile/2,1].max + cyTile=[cyTile/2,1].max + if autotile.height==32 + anim=frame*32 + src_rect=Rect.new(anim,0,32,32) + bitmap.stretch_blt(Rect.new(x,y,cxTile*2,cyTile*2),autotile,src_rect) + else + anim=frame*96 + id%=48 + tiles = TileDrawingHelper::Autotiles[id>>3][id&7] + src=Rect.new(0,0,0,0) + for i in 0...4 + tile_position = tiles[i] - 1 + src.set(tile_position % 6 * 16 + anim, + tile_position / 6 * 16, 16, 16) + bitmap.stretch_blt(Rect.new(i%2*cxTile+x,i/2*cyTile+y,cxTile,cyTile), + autotile, src) + end + end +end + + +def bltSmallRegularTile(bitmap,x,y,cxTile,cyTile,id) + return if !@tileset || id<384 || @tileset.disposed? + rect=Rect.new((id - 384) % 8 * 32, (id - 384) / 8 * 32,32,32) + bitmap.stretch_blt(Rect.new(x,y,cxTile,cyTile),@tileset,rect) +end + +def bltSmallTile(bitmap,x,y,cxTile,cyTile,id,frame=0) + if id>=384 + bltSmallRegularTile(bitmap,x,y,cxTile,cyTile,id) + elsif id>0 + bltSmallAutotile(bitmap,x,y,cxTile,cyTile,id,frame) + end +end + +def bltAutotile(bitmap,x,y,id,frame) + bltSmallAutotile(bitmap,x,y,32,32,id,frame) +end + +def bltRegularTile(bitmap,x,y,id) + bltSmallRegularTile(bitmap,x,y,32,32,id) +end + +def bltTile(bitmap,x,y,id,frame=0) + if id>=384 + bltRegularTile(bitmap,x,y,id) + elsif id>0 + bltAutotile(bitmap,x,y,id,frame) + end +end + +end @@ -206,11 +335,1 @@ -def pbGenerateMap(id,width,height) - generateMapParams=[ - # count, sticky - 20,8, # Autotile 1 - 30,8, # Autotile 2 - 75,8, # Autotile 3 - 250,15, # Autotile 4 - 0,0, # Autotile 5 - 0,0, # Autotile 6 - 0,0 # Autotile 7 - ] +def pbGenerateMap(id,width,height,generateMapParams) @@ -251,0 +370,19 @@ +=begin + #Usage: + + pbGenerateMap( + 24, # Map ID + 30, # Map Width + 30, # Map Height + [ # Map Parameters + # count, sticky + 20,8, # Autotile 1 + 30,8, # Autotile 2 + 75,8, # Autotile 3 + 250,15, # Autotile 4 + 0,0, # Autotile 5 + 0,0, # Autotile 6 + 0,0 # Autotile 7 + ] + ) +=end Changed: PokemonPokedex Changed: Interpreter Changed: PokemonField Changed: PokeBattle_ActualScene Changed: PokemonTrainers Changed: SpriteResizer Changed: PokemonLoad Changed: WindowAndTilemap Changed: PokemonEntry Changed: Compiler Changed: Audio Changed: PokemonMessages Changed: SpriteWindow Changed: PokemonUtilities Changed: PokeBattle_Battle Changed: PokemonItems Changed: PokeBattle_Battler Changed: PokemonStorage Changed: RandomMaps