Changed: PokemonMap @@ -273,0 +273,142 @@ + + +EVOTYPEMASK=0x3F +EVODATAMASK=0xC0 +EVONEXTFORM=0x00 +EVOPREVFORM=0x40 + +module EncounterTypes + Land=0 + Cave=1 + Water=2 + RockSmash=3 + OldRod=4 + GoodRod=5 + SuperRod=6 + HeadbuttLow=7 + HeadbuttHigh=8 + LandMorning=9 + LandDay=10 + LandNight=11 + BugContest=12 + Names=[ + "Land", + "Cave", + "Water", + "RockSmash", + "OldRod", + "GoodRod", + "SuperRod", + "HeadbuttLow", + "HeadbuttHigh", + "LandMorning", + "LandDay", + "LandNight", + "BugContest" + ] + EnctypeChances=[ + [20,20,10,10,10,10,5,5,4,4,1,1], + [20,20,10,10,10,10,5,5,4,4,1,1], + [60,30,5,4,1], + [60,30,5,4,1], + [70,30], + [60,20,20], + [40,40,15,4,1], + [30,25,20,10,5,5,4,1], + [30,25,20,10,5,5,4,1], + [20,20,10,10,10,10,5,5,4,4,1,1], + [20,20,10,10,10,10,5,5,4,4,1,1], + [20,20,10,10,10,10,5,5,4,4,1,1], + [20,20,10,10,10,10,5,5,4,4,1,1] + ] +end + + +module PBNatures +HARDY=0 +LONELY=1 +BRAVE=2 +ADAMANT=3 +NAUGHTY=4 +BOLD=5 +DOCILE=6 +RELAXED=7 +IMPISH=8 +LAX=9 +TIMID=10 +HASTY=11 +SERIOUS=12 +JOLLY=13 +NAIVE=14 +MODEST=15 +MILD=16 +QUIET=17 +BASHFUL=18 +RASH=19 +CALM=20 +GENTLE=21 +SASSY=22 +CAREFUL=23 +QUIRKY=24 + +def PBNatures.getName(id) +names=[ +_INTL("HARDY"), +_INTL("LONELY"), +_INTL("BRAVE"), +_INTL("ADAMANT"), +_INTL("NAUGHTY"), +_INTL("BOLD"), +_INTL("DOCILE"), +_INTL("RELAXED"), +_INTL("IMPISH"), +_INTL("LAX"), +_INTL("TIMID"), +_INTL("HASTY"), +_INTL("SERIOUS"), +_INTL("JOLLY"), +_INTL("NAIVE"), +_INTL("MODEST"), +_INTL("MILD"), +_INTL("QUIET"), +_INTL("BASHFUL"), +_INTL("RASH"), +_INTL("CALM"), +_INTL("GENTLE"), +_INTL("SASSY"), +_INTL("CAREFUL"), +_INTL("QUIRKY") +] +return names[id] +end + +end + +class PhoneDatabase + attr_accessor :generics + attr_accessor :greetings + attr_accessor :greetingsMorning + attr_accessor :greetingsEvening + attr_accessor :battleRequests + attr_accessor :bodies1 + attr_accessor :bodies2 + attr_accessor :trainers + def initialize + @generics=[] + @greetings=[] + @greetingsMorning=[] + @greetingsEvening=[] + @battleRequests=[] + @bodies1=[] + @bodies2=[] + @trainers=[] + end +end + +module PhoneMsgType + Generic=0 + Greeting=1 + Body=2 + BattleRequest=3 +end + Changed: PokemonPokedex @@ -355,2 +355,1 @@ - @sprites["infowindow"].text=_ISPRINTF("SEEN: {1:d}\r\nOWN: {2:d}\r\nZ: MENU\r\nF5: SEARCH", - $Trainer.pokedexSeen,$Trainer.pokedexOwned) + @sprites["infowindow"].text=_ISPRINTF("SEEN: {1:d}\r\nOWN: {2:d}\r\nZ: MENU\r\nF5: SEARCH",$Trainer.pokedexSeen,$Trainer.pokedexOwned) Changed: StringIO @@ -1,0 +1,1 @@ +#31931740 Changed: PokemonAnimEditor @@ -1832,0 +1832,49 @@ +def getCubicPoint(src,t) + x0=src[0].x; + y0=src[0].y; + cx0=src[1].x; + cy0=src[1].y; + cx1=src[2].x; + cy1=src[2].y; + x1=src[3].x; + y1=src[3].y; + x1=cx1+(x1-cx1)*t; + y1=cy1+(y1-cy1)*t; + x0=x0+(cx0-x0)*t; + y0=y0+(cy0-y0)*t; + cx0=cx0+(cx1-cx0)*t; + cy0=cy0+(cy1-cy0)*t; + cx1=cx0+(x1-cx0)*t; + cy1=cy0+(y1-cy0)*t; + cx0=x0+(cx0-x0)*t; + cy0=y0+(cy0-y0)*t; + cx=cx0+(cx1-cx0)*t; + cy=cy0+(cy1-cy0)*t; + return [cx,cy] +end + +def getCubicPoint2(src,t) + x0=src[0]; + y0=src[1]; + cx0=src[2]; + cy0=src[3]; + cx1=src[4]; + cy1=src[5]; + x1=src[6]; + y1=src[7]; + x1=cx1+(x1-cx1)*t; + y1=cy1+(y1-cy1)*t; + x0=x0+(cx0-x0)*t; + y0=y0+(cy0-y0)*t; + cx0=cx0+(cx1-cx0)*t; + cy0=cy0+(cy1-cy0)*t; + cx1=cx0+(x1-cx0)*t; + cy1=cy0+(y1-cy0)*t; + cx0=x0+(cx0-x0)*t; + cy0=y0+(cy0-y0)*t; + cx=cx0+(cx1-cx0)*t; + cy=cy0+(cy1-cy0)*t; + return [cx,cy] +end + + @@ -1884,0 +1933,3 @@ + File.open("pointpath.txt","wb"){|f| + f.write(path.inspect) + } @@ -2475,1 +2527,5 @@ - return @points.inspect + p=[] + for point in @points + p.push([point[0].to_i,point[1].to_i]) + end + return p.inspect Added: RTPAndRegistry Changed: PBIntl @@ -198,1 +198,1 @@ - key=section[i] # key is already normalized + key=MessageTypes.denormalizeValue(section[i]) @@ -300,3 +300,0 @@ - key.gsub!(/\r/,"<>") - key.gsub!(/\n/,"<>") - key.gsub!(/\t/,"<>") @@ -309,1 +306,1 @@ - if value[/[\r\n\t]/] + if value[/[\r\n\t]|^[\[\]]/] @@ -314,0 +311,2 @@ + ret.gsub!(/\[/,"<<[>>") + ret.gsub!(/\]/,"<<]>>") @@ -319,1 +318,1 @@ - if value[/<<[rnt]>>/] + if value[/<<[rnt\[\]]>>/] @@ -323,0 +322,2 @@ + ret.gsub!(/<<\[>>/,"[") + ret.gsub!(/<<\]>>/,"]") @@ -345,0 +346,1 @@ + valkey=self.normalizeValue(key) @@ -346,1 +348,1 @@ - f.write(key+"\r\n") + f.write(valkey+"\r\n") Deleted: RTP and Registry Changed: PokemonPhone @@ -1,27 +1,1 @@ -class PhoneDatabase - attr_accessor :generics - attr_accessor :greetings - attr_accessor :greetingsMorning - attr_accessor :greetingsEvening - attr_accessor :battleRequests - attr_accessor :bodies1 - attr_accessor :bodies2 - attr_accessor :trainers - def initialize - @generics=[] - @greetings=[] - @greetingsMorning=[] - @greetingsEvening=[] - @battleRequests=[] - @bodies1=[] - @bodies2=[] - @trainers=[] - end -end - -module PhoneMsgType - Generic=0 - Greeting=1 - Body=2 - BattleRequest=3 -end + @@ -125,34 +99,0 @@ -end - -def pbEachSection(f) - lineno=1 - havesection=false - sectionname=nil - lastsection=[] - f.each_line {|line| - if lineno==1&&line[0]==0xEF&&line[1]==0xBB&&line[2]==0xBF - line=line[3,line.length-3] - end - if !line[/^\#/] && !line[/^\s*$/] - if line[/^\s*\[\s*(.+?)\s*\]\s*$/] - if havesection - yield lastsection,sectionname - end - sectionname=$~[1] - lastsection=[] - havesection=true - else - if sectionname==nil - raise _INTL("Expected a section at the beginning of the file (line {1})",lineno) - end - lastsection.push(line.gsub(/^\s+/,"").gsub(/\s+$/,"")) - end - end - lineno+=1 - if lineno%500==0 - Graphics.update - end - } - if havesection - yield lastsection,sectionname - end Changed: EventScene @@ -425,5 +425,5 @@ - LowerRight=5 - Top=6 - Bottom=7 - Left=8 - Right=9 + LowerRight=4 + Top=5 + Bottom=6 + Left=7 + Right=8 Changed: PokemonField @@ -104,0 +104,3 @@ +class Game_Temp + attr_accessor :background_bitmap +end @@ -129,1 +132,5 @@ - if Bitmap.method_defined?(:radial_blur) && rand(15)==0 + if $game_temp.background_bitmap + $game_temp.background_bitmap.dispose + end + $game_temp.background_bitmap=Graphics.snap_to_bitmap + if Sprite.method_defined?(:wave_amp) && rand(15)==0 @@ -134,3 +141,0 @@ - mask=Sprite.new - mask.bitmap = Bitmap.new(640,480) - mask.bitmap.fill_rect(0,0,640,480, Color.new(0,0,0,255)) @@ -139,5 +143,6 @@ - mask.z=99999 - for i in 0..15 - bm.blt(0,0,bitmap,bitmap.rect) - bm.radial_blur(i*3,i) - mask.opacity=i*10 + sprite.wave_speed=500 + for i in 0..25 + sprite.opacity-=10 + sprite.wave_amp+=60 + sprite.update + sprite.wave_speed+=30 @@ -151,1 +156,17 @@ - mask.dispose + elsif Bitmap.method_defined?(:radial_blur) && rand(15)==0 + viewport.color=Color.new(0,0,0,255) + sprite = Sprite.new + bitmap=Graphics.snap_to_bitmap + bm=bitmap.clone + sprite.z=99999 + sprite.bitmap = bm + for i in 0..15 + bm.radial_blur(i,2) + sprite.opacity-=15 + 2.times do + Graphics.update + end + end + bitmap.dispose + bm.dispose + sprite.dispose @@ -944,1 +965,1 @@ - if status[2]<5 # Less than 5 percent + if status[2]<3 # Less than 3 percent @@ -1087,1 +1108,1 @@ - pbSceneMapUpdate + pbUpdateSceneMap @@ -1102,1 +1123,1 @@ - pbSceneMapUpdate + pbUpdateSceneMap @@ -1789,1 +1810,1 @@ - return if !pbTrainerTypeCheck(symbol) + return if !Kernel.pbTrainerTypeCheck(symbol) @@ -1793,1 +1814,1 @@ - pbPlayTrainerIntroME(trtype) + Kernel.pbPlayTrainerIntroME(trtype) Changed: PokeBattle_ActualScene @@ -831,1 +831,1 @@ - Graphics.update + pbGraphicsUpdate @@ -967,2 +967,28 @@ - pawidth=(pa && pa.bitmap && !pa.bitmap.disposed?) ? pa.bitmap.width : 128 - pbwidth=(pb && pb.bitmap && !pb.bitmap.disposed?) ? pb.bitmap.width : 128 + pawidth=128 + pbwidth=128 + if (pa && pa.bitmap && !pa.bitmap.disposed?) + if pa.bitmap.height0 + @sprites["player"].src_rect.x=pawidth*2 if @frame>8 + @sprites["player"].src_rect.x=pawidth*3 if @frame>11 + @sprites["player"].src_rect.width=pawidth + else + pawidth=pa.bitmap.width + @sprites["player"].src_rect.x=0 + @sprites["player"].src_rect.width=pawidth + end + end + if (pb && pb.bitmap && !pb.bitmap.disposed?) + if pb.bitmap.height0 + @sprites["playerB"].src_rect.x=pbwidth*2 if @frame>8 + @sprites["playerB"].src_rect.x=pbwidth*3 if @frame>11 + @sprites["playerB"].src_rect.width=pbwidth + else + pbwidth=pb.bitmap.width + @sprites["playerB"].src_rect.x=0 + @sprites["playerB"].src_rect.width=pbwidth + end + end @@ -1020,0 +1046,4 @@ +def pbGraphicsUpdate + @sprites["battlebg"].update if @sprites["battlebg"].is_a?(Sprite) + Graphics.update +end @@ -1029,1 +1059,2 @@ - @sprites["messagebox"].visible=(windowtype==MESSAGEBOX||windowtype==COMMANDBOX||windowtype==FIGHTBOX||windowtype==BLANK) + @sprites["messagebox"].visible=(windowtype==MESSAGEBOX||windowtype==COMMANDBOX||windowtype==FIGHTBOX|| + windowtype==BLANK) @@ -1063,1 +1094,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1080,1 +1111,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1115,1 +1146,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1147,1 +1178,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1239,1 +1270,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1247,1 +1278,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1294,0 +1325,1 @@ +if !$game_temp.background_bitmap.respond_to?("radial_blur") @@ -1295,0 +1327,13 @@ +else + source = $game_temp.background_bitmap + bitmap = Bitmap.new(Graphics.width+32,Graphics.height) + bitmap.stretch_blt(bitmap.rect, source, source.rect) + bitmap.radial_blur(90, 12) + @sprites["battlebg"] = Sprite.new(@viewport) + @sprites["battlebg"].bitmap = bitmap + @sprites["battlebg"].x = -16 + @sprites["battlebg"].y = 0 + @sprites["battlebg"].wave_amp = 8 + @sprites["battlebg"].wave_length = 240 + @sprites["battlebg"].wave_speed = 120 +end @@ -1362,0 +1407,12 @@ + if @sprites["player"].bitmap + if @sprites["player"].bitmap.width>@sprites["player"].bitmap.height + @sprites["player"].src_rect.x=0 + @sprites["player"].src_rect.width=@sprites["player"].bitmap.width/4 + end + end + if @sprites["playerB"].bitmap + if @sprites["playerB"].bitmap.width>@sprites["playerB"].bitmap.height + @sprites["playerB"].src_rect.x=0 + @sprites["playerB"].src_rect.width=@sprites["playerB"].bitmap.width/4 + end + end @@ -1365,0 +1422,6 @@ + if @sprites["player"].bitmap + if @sprites["player"].bitmap.width>@sprites["player"].bitmap.height + @sprites["player"].src_rect.x=0 + @sprites["player"].src_rect.width=@sprites["player"].bitmap.width/4 + end + end @@ -1437,1 +1500,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1451,1 +1514,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1475,1 +1538,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1487,1 +1550,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1533,1 +1596,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1554,1 +1617,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1583,0 +1646,26 @@ +balltype=pkmn.ballused +ballbitmap=sprintf("Graphics/Pictures/ball%02d_0.png",balltype) +pictureBall=PictureEx.new(0) +delay=1 +pictureBall.moveVisible(delay,true) +pictureBall.moveName(delay,ballbitmap) +pictureBall.moveOrigin(delay,PictureOrigin::Center) +# Setting the ball's movement path +path=[[111, 164], [112, 156], [114, 148], [116, 140], +[118, 133], [121, 125], [124, 118], [130, 113], +[136, 117], [139, 124], [140, 132], [141, 140], +[142, 147], [143, 155], [144, 163], [144, 171], +[145, 179], [145, 187], [146, 195], [146, 203], +[146, 211], [146, 219], [147, 227], [147, 235], +[147, 243], [147, 251], [147, 251]] +spriteBall=IconSprite.new(0,0,@viewport) +spriteBall.visible=false +angle=0 +for coord in path + delay=pictureBall.totalDuration + pictureBall.moveAngle(0,delay,angle) + pictureBall.moveXY(1,delay,coord[0],coord[1]) + angle+=80 + angle%=360 +end + @sprites["battler#{battlerindex}"].visible=false @@ -1597,2 +1686,3 @@ - frame+=1 - if frame==1 + frame+=1 + if frame>1 && !pictureBall.running? && + !@sprites["battler#{battlerindex}"].appearing @@ -1601,1 +1691,1 @@ - if frame>=3 + if frame>=3 && !pictureBall.running? @@ -1604,0 +1694,4 @@ + if (frame>=10 || !fadeanim) && pictureBall.running? + pictureBall.update + setPictureIconSprite(spriteBall,pictureBall) + end @@ -1605,1 +1699,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1612,0 +1706,1 @@ + spriteBall.dispose @@ -1658,1 +1753,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1674,1 +1769,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1745,1 +1840,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1883,1 +1978,1 @@ - Graphics.update + pbGraphicsUpdate @@ -1998,1 +2093,1 @@ - Graphics.update + pbGraphicsUpdate @@ -2012,1 +2107,1 @@ - Graphics.update + pbGraphicsUpdate @@ -2035,1 +2130,1 @@ - Graphics.update + pbGraphicsUpdate @@ -2046,1 +2141,1 @@ - Graphics.update + pbGraphicsUpdate @@ -2065,1 +2160,1 @@ - Graphics.update + pbGraphicsUpdate @@ -2072,1 +2167,1 @@ - Graphics.update + pbGraphicsUpdate @@ -2129,1 +2224,1 @@ - Graphics.update + pbGraphicsUpdate @@ -2196,1 +2291,1 @@ - Graphics.update + pbGraphicsUpdate Changed: SpriteResizer @@ -11,2 +11,2 @@ - @width=480 - @height=320 + @@width=480 + @@height=320 @@ -14,1 +14,1 @@ - return @width + return @@width.to_i @@ -17,1 +17,1 @@ - return @height + return @@height.to_i @@ -55,9 +55,14 @@ - if !method_defined?(:oldresizescreen) - begin - alias oldresizescreen resize_screen - @@haveresizescreen=true - rescue - @@haveresizescreen=false - end - else - @@haveresizescreen=false + begin + x=@@haveresizescreen + rescue NameError # If exception is caught, + # the class variable wasn't defined yet + if !method_defined?(:oldresizescreen) + begin + alias oldresizescreen resize_screen + @@haveresizescreen=true + rescue + @@haveresizescreen=false + end + else + @@haveresizescreen=false + end @@ -70,2 +75,2 @@ - @width=w - @height=h + @@width=w + @@height=h @@ -333,0 +338,1 @@ + return if !val @@ -340,0 +346,1 @@ + return if !val @@ -347,4 +354,6 @@ - newRect=NotifiableRect.new(0,0,100,100) - newRect.setNotifyProc(@resizedRectProc) - newRect.set(val.x.to_i,val.y.to_i,val.width.to_i,val.height.to_i) - @resizedRect=newRect + if val + newRect=NotifiableRect.new(0,0,100,100) + newRect.setNotifyProc(@resizedRectProc) + newRect.set(val.x.to_i,val.y.to_i,val.width.to_i,val.height.to_i) + @resizedRect=newRect + end @@ -376,0 +385,1 @@ + return if !val @@ -383,0 +393,1 @@ + return if !val @@ -390,0 +401,1 @@ + return if !val @@ -397,0 +409,1 @@ + return if !val Changed: Transitions @@ -344,1 +344,1 @@ - bands.times { |i| + bands.to_i.times { |i| Changed: WindowAndTilemap @@ -1135,0 +1135,2 @@ + xpos=(x<<5)-@oxLayer0 + ypos=(y<<5)-@oyLayer0 @@ -1138,1 +1140,3 @@ - temprect.set(((id - 384)&7)<<5,((id - 384)>>3)<<5,32,32) + temprect.set(((id - 384)&7)<<5,((id - 384)>>3)<<5,32,32) + xpos=(x<<5)-@oxLayer0 + ypos=(y<<5)-@oyLayer0 @@ -1149,0 +1153,2 @@ + xpos=(x<<5)-@oxLayer0 + ypos=(y<<5)-@oyLayer0 Changed: Compiler @@ -258,1 +258,1 @@ - strm.write(_INTL("F")) + strm.write("F") @@ -278,1 +278,1 @@ - when _INTL("F") + when "F" @@ -414,1 +414,1 @@ - if file.nil? + if rec[i].nil? @@ -417,1 +417,1 @@ - file.write(rec[i]) + file.write(csvquote(rec[i])) @@ -533,1 +533,0 @@ - echo name+"\r\n" @@ -759,1 +758,1 @@ - if x==_INTL(".") + if x=="." @@ -2008,0 +2007,36 @@ +end + + + +def pbEachSection(f) + lineno=1 + havesection=false + sectionname=nil + lastsection=[] + f.each_line {|line| + if lineno==1&&line[0]==0xEF&&line[1]==0xBB&&line[2]==0xBF + line=line[3,line.length-3] + end + if !line[/^\#/] && !line[/^\s*$/] + if line[/^\s*\[\s*(.+?)\s*\]\s*$/] + if havesection + yield lastsection,sectionname + end + sectionname=$~[1] + lastsection=[] + havesection=true + else + if sectionname==nil + raise _INTL("Expected a section at the beginning of the file (line {1})",lineno) + end + lastsection.push(line.gsub(/^\s+/,"").gsub(/\s+$/,"")) + end + end + lineno+=1 + if lineno%500==0 + Graphics.update + end + } + if havesection + yield lastsection,sectionname + end Changed: TileDrawingHelper @@ -1,130 +1,130 @@ -class TileDrawingHelper - Autotiles = [ - [ [27, 28, 33, 34], [ 5, 28, 33, 34], [27, 6, 33, 34], [ 5, 6, 33, 34], - [27, 28, 33, 12], [ 5, 28, 33, 12], [27, 6, 33, 12], [ 5, 6, 33, 12] ], - [ [27, 28, 11, 34], [ 5, 28, 11, 34], [27, 6, 11, 34], [ 5, 6, 11, 34], - [27, 28, 11, 12], [ 5, 28, 11, 12], [27, 6, 11, 12], [ 5, 6, 11, 12] ], - [ [25, 26, 31, 32], [25, 6, 31, 32], [25, 26, 31, 12], [25, 6, 31, 12], - [15, 16, 21, 22], [15, 16, 21, 12], [15, 16, 11, 22], [15, 16, 11, 12] ], - [ [29, 30, 35, 36], [29, 30, 11, 36], [ 5, 30, 35, 36], [ 5, 30, 11, 36], - [39, 40, 45, 46], [ 5, 40, 45, 46], [39, 6, 45, 46], [ 5, 6, 45, 46] ], - [ [25, 30, 31, 36], [15, 16, 45, 46], [13, 14, 19, 20], [13, 14, 19, 12], - [17, 18, 23, 24], [17, 18, 11, 24], [41, 42, 47, 48], [ 5, 42, 47, 48] ], - [ [37, 38, 43, 44], [37, 6, 43, 44], [13, 18, 19, 24], [13, 14, 43, 44], - [37, 42, 43, 48], [17, 18, 47, 48], [13, 18, 43, 48], [ 1, 2, 7, 8] ] - ] - - # converts neighbors returned from tableNeighbors to tile indexes - NeighborsToTiles=[ - 46, 44, 46, 44, 43, 41, 43, 40, 46, 44, 46, 44, 43, 41, 43, 40, - 42, 32, 42, 32, 35, 19, 35, 18, 42, 32, 42, 32, 34, 17, 34, 16, - 46, 44, 46, 44, 43, 41, 43, 40, 46, 44, 46, 44, 43, 41, 43, 40, - 42, 32, 42, 32, 35, 19, 35, 18, 42, 32, 42, 32, 34, 17, 34, 16, - 45, 39, 45, 39, 33, 31, 33, 29, 45, 39, 45, 39, 33, 31, 33, 29, - 37, 27, 37, 27, 23, 15, 23, 13, 37, 27, 37, 27, 22, 11, 22, 9, - 45, 39, 45, 39, 33, 31, 33, 29, 45, 39, 45, 39, 33, 31, 33, 29, - 36, 26, 36, 26, 21, 7, 21, 5, 36, 26, 36, 26, 20, 3, 20, 1, 46, - 44, 46, 44, 43, 41, 43, 40, 46, 44, 46, 44, 43, 41, 43, 40, 42, - 32, 42, 32, 35, 19, 35, 18, 42, 32, 42, 32, 34, 17, 34, 16, 46, - 44, 46, 44, 43, 41, 43, 40, 46, 44, 46, 44, 43, 41, 43, 40, 42, - 32, 42, 32, 35, 19, 35, 18, 42, 32, 42, 32, 34, 17, 34, 16, 45, - 38, 45, 38, 33, 30, 33, 28, 45, 38, 45, 38, 33, 30, 33, 28, 37, - 25, 37, 25, 23, 14, 23, 12, 37, 25, 37, 25, 22, 10, 22, 8, 45, - 38, 45, 38, 33, 30, 33, 28, 45, 38, 45, 38, 33, 30, 33, 28, 36, - 24, 36, 24, 21, 6, 21, 4, 36, 24, 36, 24, 20, 2, 20, 0 - ] - def self.tableNeighbors(data,x,y) - return 0 if x>=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 +class TileDrawingHelper + Autotiles = [ + [ [27, 28, 33, 34], [ 5, 28, 33, 34], [27, 6, 33, 34], [ 5, 6, 33, 34], + [27, 28, 33, 12], [ 5, 28, 33, 12], [27, 6, 33, 12], [ 5, 6, 33, 12] ], + [ [27, 28, 11, 34], [ 5, 28, 11, 34], [27, 6, 11, 34], [ 5, 6, 11, 34], + [27, 28, 11, 12], [ 5, 28, 11, 12], [27, 6, 11, 12], [ 5, 6, 11, 12] ], + [ [25, 26, 31, 32], [25, 6, 31, 32], [25, 26, 31, 12], [25, 6, 31, 12], + [15, 16, 21, 22], [15, 16, 21, 12], [15, 16, 11, 22], [15, 16, 11, 12] ], + [ [29, 30, 35, 36], [29, 30, 11, 36], [ 5, 30, 35, 36], [ 5, 30, 11, 36], + [39, 40, 45, 46], [ 5, 40, 45, 46], [39, 6, 45, 46], [ 5, 6, 45, 46] ], + [ [25, 30, 31, 36], [15, 16, 45, 46], [13, 14, 19, 20], [13, 14, 19, 12], + [17, 18, 23, 24], [17, 18, 11, 24], [41, 42, 47, 48], [ 5, 42, 47, 48] ], + [ [37, 38, 43, 44], [37, 6, 43, 44], [13, 18, 19, 24], [13, 14, 43, 44], + [37, 42, 43, 48], [17, 18, 47, 48], [13, 18, 43, 48], [ 1, 2, 7, 8] ] + ] + + # converts neighbors returned from tableNeighbors to tile indexes + NeighborsToTiles=[ + 46, 44, 46, 44, 43, 41, 43, 40, 46, 44, 46, 44, 43, 41, 43, 40, + 42, 32, 42, 32, 35, 19, 35, 18, 42, 32, 42, 32, 34, 17, 34, 16, + 46, 44, 46, 44, 43, 41, 43, 40, 46, 44, 46, 44, 43, 41, 43, 40, + 42, 32, 42, 32, 35, 19, 35, 18, 42, 32, 42, 32, 34, 17, 34, 16, + 45, 39, 45, 39, 33, 31, 33, 29, 45, 39, 45, 39, 33, 31, 33, 29, + 37, 27, 37, 27, 23, 15, 23, 13, 37, 27, 37, 27, 22, 11, 22, 9, + 45, 39, 45, 39, 33, 31, 33, 29, 45, 39, 45, 39, 33, 31, 33, 29, + 36, 26, 36, 26, 21, 7, 21, 5, 36, 26, 36, 26, 20, 3, 20, 1, 46, + 44, 46, 44, 43, 41, 43, 40, 46, 44, 46, 44, 43, 41, 43, 40, 42, + 32, 42, 32, 35, 19, 35, 18, 42, 32, 42, 32, 34, 17, 34, 16, 46, + 44, 46, 44, 43, 41, 43, 40, 46, 44, 46, 44, 43, 41, 43, 40, 42, + 32, 42, 32, 35, 19, 35, 18, 42, 32, 42, 32, 34, 17, 34, 16, 45, + 38, 45, 38, 33, 30, 33, 28, 45, 38, 45, 38, 33, 30, 33, 28, 37, + 25, 37, 25, 23, 14, 23, 12, 37, 25, 37, 25, 22, 10, 22, 8, 45, + 38, 45, 38, 33, 30, 33, 28, 45, 38, 45, 38, 33, 30, 33, 28, 36, + 24, 36, 24, 21, 6, 21, 4, 36, 24, 36, 24, 20, 2, 20, 0 + ] + def self.tableNeighbors(data,x,y) + return 0 if x>=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 Changed: PokeBattle_BattlePalace @@ -2,59 +2,0 @@ -module PBNatures -HARDY=0 -LONELY=1 -BRAVE=2 -ADAMANT=3 -NAUGHTY=4 -BOLD=5 -DOCILE=6 -RELAXED=7 -IMPISH=8 -LAX=9 -TIMID=10 -HASTY=11 -SERIOUS=12 -JOLLY=13 -NAIVE=14 -MODEST=15 -MILD=16 -QUIET=17 -BASHFUL=18 -RASH=19 -CALM=20 -GENTLE=21 -SASSY=22 -CAREFUL=23 -QUIRKY=24 - -def PBNatures.getName(id) -names=[ -_INTL("HARDY"), -_INTL("LONELY"), -_INTL("BRAVE"), -_INTL("ADAMANT"), -_INTL("NAUGHTY"), -_INTL("BOLD"), -_INTL("DOCILE"), -_INTL("RELAXED"), -_INTL("IMPISH"), -_INTL("LAX"), -_INTL("TIMID"), -_INTL("HASTY"), -_INTL("SERIOUS"), -_INTL("JOLLY"), -_INTL("NAIVE"), -_INTL("MODEST"), -_INTL("MILD"), -_INTL("QUIET"), -_INTL("BASHFUL"), -_INTL("RASH"), -_INTL("CALM"), -_INTL("GENTLE"), -_INTL("SASSY"), -_INTL("CAREFUL"), -_INTL("QUIRKY") -] -return names[id] -end - -end Changed: PokemonEvolution @@ -565,6 +565,0 @@ - -EVOTYPEMASK=0x3F -EVODATAMASK=0xC0 -EVONEXTFORM=0x00 -EVOPREVFORM=0x40 - Changed: Audio @@ -233,1 +233,1 @@ - AudioState::AudioContextSetVolume.call(AudioState.meContext,0) + AudioState::AudioContextStop.call(AudioState.meContext) Changed: PokemonEditor @@ -428,1 +428,1 @@ - for i in 0...PokemonEncounters::EnctypeChances.length + for i in 0...EncounterTypes::EnctypeChances.length @@ -453,1 +453,1 @@ - for i in 0...PokemonEncounters::EnctypeChances.length + for i in 0...EncounterTypes::EnctypeChances.length @@ -476,1 +476,1 @@ - chances=PokemonEncounters::EnctypeChances[ret] + chances=EncounterTypes::EnctypeChances[ret] @@ -489,1 +489,1 @@ - chances=PokemonEncounters::EnctypeChances[etype] + chances=EncounterTypes::EnctypeChances[etype] @@ -744,0 +744,12 @@ + def getPlayingBGM + $game_system ? $game_system.getPlayingBGM : nil + end + def bgm_play(bgm) + if $game_system && bgm + $game_system.bgm_play(bgm) + elsif bgm + Audio.bgm_play("Audio/BGM/"+bgm) + else + Audio.bgm_stop + end + end @@ -745,1 +757,1 @@ - @oldbgm=$game_system.getPlayingBGM + @oldbgm=getPlayingBGM @@ -777,1 +789,1 @@ - $game_system.bgm_play(@oldbgm) + bgm_play(@oldbgm) @@ -782,1 +794,1 @@ - $game_system.bgm_play(@commands[index]) + bgm_play(@commands[index]) @@ -784,1 +796,1 @@ - $game_system.bgm_play("../../Audio/ME/"+@commands[index]) + bgm_play("../../Audio/ME/"+@commands[index]) @@ -1462,0 +1474,25 @@ +# Returns the maps within _keys_ that are directly +# connected to this map, _map_. +def getDirectConnections(keys,map) + thissprite=getMapSprite(map) + thisdims=MapFactoryHelper.getMapDims(map) + ret=[] + for i in keys + next if i==map + othersprite=getMapSprite(i) + otherdims=MapFactoryHelper.getMapDims(i) + x1=(thissprite.x-othersprite.x)/4 + y1=(thissprite.y-othersprite.y)/4 + if(x1==otherdims[0] || x1==-thisdims[0] || + y1==otherdims[1] || y1==-thisdims[1]) + ret.push(i) + end + end + # If no direct connections, add an indirect connection + if ret.length==0 + key=(map==keys[0]) ? keys[1] : keys[0] + ret.push(key) + end + return ret +end + @@ -1464,0 +1501,1 @@ + # Create a clone of current map connection @@ -1469,0 +1507,2 @@ + # Remove all connections containing + # any sprites on the canvas from the array @@ -1472,0 +1512,1 @@ + # Rebuild connections @@ -1473,11 +1514,13 @@ - refmap=(i==keys[0]) ? keys[1] : keys[0] - othersprite=getMapSprite(i) - refsprite=getMapSprite(refmap) - c1=(refsprite.x-othersprite.x)/4 - c2=(refsprite.y-othersprite.y)/4 - conn=[refmap,0,0,i,c1,c2] - i=0;while i0 + if $game_temp + return $game_temp.fadestate>0 + else + return false + end @@ -1404,1 +1412,1 @@ - return (@item_max + @column_max - 1) / @column_max + return ((@item_max + @column_max - 1) / @column_max).to_i @@ -1407,1 +1415,1 @@ - return @virtualOy / 32 + return (@virtualOy / 32).to_i @@ -1422,1 +1430,1 @@ - return priv_page_row_max + return priv_page_row_max.to_i @@ -1425,1 +1433,1 @@ - return priv_page_item_max + return priv_page_item_max.to_i Changed: PokemonUtilities @@ -1009,0 +1009,1 @@ + @@ -1019,6 +1020,4 @@ -#pbPlayBattleFromFile(filename) -#pbWildBattle(PBSpecies::DUSKULL,20) - -end - -pbTestBattle(0) +pbPlayBattleFromFile(filename) +pbWildBattle(PBSpecies::DUSKULL,20) +end +#pbTestBattle(169) Changed: PokeBattle_Battle @@ -879,0 +879,5 @@ + if $DEBUG && Input.press?(Input::CTRL) + pbDisplayPaused(_INTL("Got away safely!")) + @decision=3 + return 1 + end @@ -881,3 +886,3 @@ - pbDisplay(_INTL("Got away safely!")) - else - pbDisplay(_INTL("{1} fled using its Smoke Ball!",thispkmn.pbThis)) + pbDisplayPaused(_INTL("Got away safely!")) + else + pbDisplayPaused(_INTL("{1} fled using its Smoke Ball!",thispkmn.pbThis)) @@ -890,3 +895,3 @@ - pbDisplay(_INTL("Got away safely!")) - else - pbDisplay(_INTL("{1} fled using Run Away!",thispkmn.pbThis)) + pbDisplayPaused(_INTL("Got away safely!")) + else + pbDisplayPaused(_INTL("{1} fled using Run Away!",thispkmn.pbThis)) Changed: PokemonRegionMap @@ -53,1 +53,7 @@ -def pbStartScene +LEFT=0 +TOP=0 +RIGHT=28 +BOTTOM=16 + +def pbStartScene(aseditor) + @editor=aseditor @@ -64,2 +70,2 @@ - @mapX=0 - @mapY=0 + @mapX=LEFT + @mapY=TOP @@ -85,0 +91,1 @@ + @changed=false @@ -87,0 +94,16 @@ +end + +def pbSaveMapData + File.open("PBS/townmap.txt","wb"){|f| + for i in 0...@mapdata.length + map=@mapdata[i] + return if !map + f.write(sprintf("[%d]\r\n",i)) + f.write(sprintf("Name=%s\r\nFilename=%s\r\n",csvquote(map[0]),csvquote(map[1]))) + for loc in @map[2] + f.write("Point=") + pbWriteCsvRecord(loc,f,[nil,"uussUUUU"]) + f.write("\r\n") + end + end + } @@ -102,1 +125,1 @@ - return loc[2] + return @editor ? loc[2] : maploc @@ -109,0 +132,25 @@ +end + +def pbChangeMapLocation(x,y) + return if !@editor + return "" if !@map[2] + currentname="" + currentobj=nil + for loc in @map[2] + if loc[0]==x && loc[1]==y + currentobj=loc + currentname=loc[2] + break + end + end + currentname=Kernel.pbMessageFreeText(_INTL("Set the name for this point."), + currentname,false,256) + if currentname + if currentobj + currentobj[2]=currentname + else + newobj=[x,y,currentname,""] + @map[2].push(newobj) + end + @changed=true + end @@ -163,2 +211,2 @@ - oy=1 if @mapY<=16 - ox=-1 if @mapX>0 + oy=1 if @mapY<=BOTTOM + ox=-1 if @mapX>LEFT @@ -166,1 +214,1 @@ - oy=1 if @mapY<=16 + oy=1 if @mapY<=BOTTOM @@ -168,2 +216,2 @@ - oy=1 if @mapY<=16 - ox=1 if @mapX<=28 + oy=1 if @mapY<=BOTTOM + ox=1 if @mapX<=RIGHT @@ -171,1 +219,1 @@ - ox=-1 if @mapX>0 + ox=-1 if @mapX>LEFT @@ -173,1 +221,1 @@ - ox=1 if @mapX<=28 + ox=1 if @mapX<=RIGHT @@ -175,2 +223,2 @@ - oy=-1 if @mapY>0 - ox=-1 if @mapX>0 + oy=-1 if @mapY>TOP + ox=-1 if @mapX>LEFT @@ -178,1 +226,1 @@ - oy=-1 if @mapY>0 + oy=-1 if @mapY>TOP @@ -180,2 +228,2 @@ - oy=-1 if @mapY>0 - ox=1 if @mapX<=28 + oy=-1 if @mapY>TOP + ox=1 if @mapX<=RIGHT @@ -192,3 +240,13 @@ - break - end - if Input.trigger?(Input::C) && mode==1 # Choosing an area to fly to + if @editor && @changed + if Kernel.pbConfirmMessage(_INTL("Save changes?")) + pbSaveMapData + end + if Kernel.pbConfirmMessage(_INTL("Exit from the map?")) + break + end + else + break + end + elsif Input.trigger?(Input::C) && @editor + pbChangeMapLocation(@mapX,@mapY) + elsif Input.trigger?(Input::C) && mode==1 # Choosing an area to fly to @@ -220,1 +278,1 @@ - @scene.pbStartScene + @scene.pbStartScene($DEBUG) Changed: PokemonScreen @@ -360,1 +360,1 @@ - @itemsprite.z=self.z+1 # For compatibility with RGSS2 + @itemsprite.z=self.z+3 # For compatibility with RGSS2 Changed: PokemonEncounters @@ -2,30 +2,0 @@ -module EncounterTypes - Land=0 - Cave=1 - Water=2 - RockSmash=3 - OldRod=4 - GoodRod=5 - SuperRod=6 - HeadbuttLow=7 - HeadbuttHigh=8 - LandMorning=9 - LandDay=10 - LandNight=11 - BugContest=12 - Names=[ - "Land", - "Cave", - "Water", - "RockSmash", - "OldRod", - "GoodRod", - "SuperRod", - "HeadbuttLow", - "HeadbuttHigh", - "LandMorning", - "LandDay", - "LandNight", - "BugContest" - ] -end @@ -34,15 +4,0 @@ - EnctypeChances=[ - [20,20,10,10,10,10,5,5,4,4,1,1], - [20,20,10,10,10,10,5,5,4,4,1,1], - [60,30,5,4,1], - [60,30,5,4,1], - [70,30], - [60,20,20], - [40,40,15,4,1], - [30,25,20,10,5,5,4,1], - [30,25,20,10,5,5,4,1], - [20,20,10,10,10,10,5,5,4,4,1,1], - [20,20,10,10,10,10,5,5,4,4,1,1], - [20,20,10,10,10,10,5,5,4,4,1,1], - [20,20,10,10,10,10,5,5,4,4,1,1] - ] @@ -98,1 +53,1 @@ - if enctype<0 || enctype>EnctypeChances.length + if enctype<0 || enctype>EncounterTypes::EnctypeChances.length @@ -108,1 +63,1 @@ - chances=EnctypeChances[enctype] + chances=EncounterTypes::EnctypeChances[enctype] @@ -124,1 +79,1 @@ - if enctype<0 || enctype>EnctypeChances.length + if enctype<0 || enctype>EncounterTypes::EnctypeChances.length @@ -128,1 +83,1 @@ - chances=EnctypeChances[enctype] + chances=EncounterTypes::EnctypeChances[enctype] @@ -145,1 +100,1 @@ - if enctype<0 || enctype>EnctypeChances.length + if enctype<0 || enctype>EncounterTypes::EnctypeChances.length Changed: PokemonStorage @@ -1872,1 +1872,3 @@ - commands.push(_INTL("{1} ({2}/{3})",box.name,box.nitems,maxpokemon)) + if box + commands.push(_INTL("{1} ({2}/{3})",box.name,box.nitems,maxpokemon)) + end Changed: PokemonDebug @@ -173,1 +173,1 @@ - for k in 0...PokemonEncounters::EnctypeChances[j].length + for k in 0...EncounterTypes::EnctypeChances[j].length @@ -741,0 +741,29 @@ +end + +def pbExtractText + msgwindow=Kernel.pbCreateMessageWindow + Kernel.pbDisplayMessageFancy(msgwindow,_INTL("Please wait."),-1,0) + MessageTypes.extract("intl.txt") + Kernel.pbDisplayMessageFancy(msgwindow, + _INTL("All text in the game was extracted and saved to intl.txt.\1")) + Kernel.pbDisplayMessageFancy(msgwindow, + _INTL("To localize the text for a particular language, translate every second line in the file.\1")) + Kernel.pbDisplayMessageFancy(msgwindow, + _INTL("After translating, choose \"Compile Text.\"")) + Kernel.pbDisposeMessageWindow(msgwindow) +end + +def pbCompileTextUI + msgwindow=Kernel.pbCreateMessageWindow + Kernel.pbDisplayMessageFancy(msgwindow,_INTL("Please wait."),-1,0) + begin + pbCompileText + Kernel.pbDisplayMessageFancy(msgwindow, + _INTL("Successfully compiled text and saved it to intl.dat.")) + Kernel.pbDisplayMessageFancy(msgwindow, + _INTL("To use the file in a game, add the text \"pbLoadMessages(X)\" to a script in the project, where X is the filename (such as \"intl.dat\").")) + rescue RuntimeError + Kernel.pbDisplayMessageFancy(msgwindow, + _INTL("Failed to compile text: {1}",$!.message)) + end + Kernel.pbDisposeMessageWindow(msgwindow) @@ -902,10 +931,1 @@ - msgwindow=Kernel.pbCreateMessageWindow - Kernel.pbDisplayMessageFancy(msgwindow,_INTL("Please wait."),-1,0) - MessageTypes.extract("intl.txt") - Kernel.pbDisplayMessageFancy(msgwindow, - _INTL("All text in the game was extracted and saved to intl.txt.\1")) - Kernel.pbDisplayMessageFancy(msgwindow, - _INTL("To localize the text for a particular language, translate every second line in the file.\1")) - Kernel.pbDisplayMessageFancy(msgwindow, - _INTL("After translating, choose \"Compile Text.\"")) - Kernel.pbDisposeMessageWindow(msgwindow) + pbExtractText @@ -913,13 +933,1 @@ - msgwindow=Kernel.pbCreateMessageWindow - Kernel.pbDisplayMessageFancy(msgwindow,_INTL("Please wait."),-1,0) - begin - pbCompileText - Kernel.pbDisplayMessageFancy(msgwindow, - _INTL("Successfully compiled text and saved it to intl.dat.")) - Kernel.pbDisplayMessageFancy(msgwindow, - _INTL("To use the file in a game, use pbLoadMessages(X) where X is the filename.")) - rescue RuntimeError - Kernel.pbDisplayMessageFancy(msgwindow, - _INTL("Failed to compile text: {1}",$!.message)) - end - Kernel.pbDisposeMessageWindow(msgwindow) + pbCompileTextUI Changed: RandomMaps @@ -1,131 +1,0 @@ -class TileDrawingHelper - Autotiles = [ - [ [27, 28, 33, 34], [ 5, 28, 33, 34], [27, 6, 33, 34], [ 5, 6, 33, 34], - [27, 28, 33, 12], [ 5, 28, 33, 12], [27, 6, 33, 12], [ 5, 6, 33, 12] ], - [ [27, 28, 11, 34], [ 5, 28, 11, 34], [27, 6, 11, 34], [ 5, 6, 11, 34], - [27, 28, 11, 12], [ 5, 28, 11, 12], [27, 6, 11, 12], [ 5, 6, 11, 12] ], - [ [25, 26, 31, 32], [25, 6, 31, 32], [25, 26, 31, 12], [25, 6, 31, 12], - [15, 16, 21, 22], [15, 16, 21, 12], [15, 16, 11, 22], [15, 16, 11, 12] ], - [ [29, 30, 35, 36], [29, 30, 11, 36], [ 5, 30, 35, 36], [ 5, 30, 11, 36], - [39, 40, 45, 46], [ 5, 40, 45, 46], [39, 6, 45, 46], [ 5, 6, 45, 46] ], - [ [25, 30, 31, 36], [15, 16, 45, 46], [13, 14, 19, 20], [13, 14, 19, 12], - [17, 18, 23, 24], [17, 18, 11, 24], [41, 42, 47, 48], [ 5, 42, 47, 48] ], - [ [37, 38, 43, 44], [37, 6, 43, 44], [13, 18, 19, 24], [13, 14, 43, 44], - [37, 42, 43, 48], [17, 18, 47, 48], [13, 18, 43, 48], [ 1, 2, 7, 8] ] - ] - - # converts neighbors returned from tableNeighbors to tile indexes - NeighborsToTiles=[ - 46, 44, 46, 44, 43, 41, 43, 40, 46, 44, 46, 44, 43, 41, 43, 40, - 42, 32, 42, 32, 35, 19, 35, 18, 42, 32, 42, 32, 34, 17, 34, 16, - 46, 44, 46, 44, 43, 41, 43, 40, 46, 44, 46, 44, 43, 41, 43, 40, - 42, 32, 42, 32, 35, 19, 35, 18, 42, 32, 42, 32, 34, 17, 34, 16, - 45, 39, 45, 39, 33, 31, 33, 29, 45, 39, 45, 39, 33, 31, 33, 29, - 37, 27, 37, 27, 23, 15, 23, 13, 37, 27, 37, 27, 22, 11, 22, 9, - 45, 39, 45, 39, 33, 31, 33, 29, 45, 39, 45, 39, 33, 31, 33, 29, - 36, 26, 36, 26, 21, 7, 21, 5, 36, 26, 36, 26, 20, 3, 20, 1, 46, - 44, 46, 44, 43, 41, 43, 40, 46, 44, 46, 44, 43, 41, 43, 40, 42, - 32, 42, 32, 35, 19, 35, 18, 42, 32, 42, 32, 34, 17, 34, 16, 46, - 44, 46, 44, 43, 41, 43, 40, 46, 44, 46, 44, 43, 41, 43, 40, 42, - 32, 42, 32, 35, 19, 35, 18, 42, 32, 42, 32, 34, 17, 34, 16, 45, - 38, 45, 38, 33, 30, 33, 28, 45, 38, 45, 38, 33, 30, 33, 28, 37, - 25, 37, 25, 23, 14, 23, 12, 37, 25, 37, 25, 22, 10, 22, 8, 45, - 38, 45, 38, 33, 30, 33, 28, 45, 38, 45, 38, 33, 30, 33, 28, 36, - 24, 36, 24, 21, 6, 21, 4, 36, 24, 36, 24, 20, 2, 20, 0 - ] - def self.tableNeighbors(data,x,y) - return 0 if x>=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 - Changed: PokemonMap Changed: PokemonPokedex Changed: StringIO Changed: PokemonAnimEditor Added: RTPAndRegistry Changed: PBIntl Deleted: RTP and Registry Changed: PokemonPhone Changed: EventScene Changed: PokemonField Changed: PokeBattle_ActualScene Changed: SpriteResizer Changed: Transitions Changed: WindowAndTilemap Changed: Compiler Changed: TileDrawingHelper Changed: PokeBattle_BattlePalace Changed: PokemonEvolution Changed: Audio Changed: PokemonEditor Changed: PokemonMessages Changed: SpriteWindow Changed: PokemonUtilities Changed: PokeBattle_Battle Changed: PokemonRegionMap Changed: PokemonScreen Changed: PokemonEncounters Changed: PokemonStorage Changed: PokemonDebug Changed: RandomMaps