Changed: PokemonMap @@ -359,2 +359,0 @@ - @@width=480 - @@height=320 @@ -441,2 +439,2 @@ - return false if dispx<=-(@@width*4+768) - return false if dispy<=-(@@height*4+768) + return false if dispx<=-(Graphics.width*4+768) + return false if dispy<=-(Graphics.height*4+768) @@ -449,2 +447,2 @@ - return false if dispx<=-(@@width*4+768) - return false if dispy<=-(@@height*4+768) + return false if dispx<=-(Graphics.width*4+768) + return false if dispy<=-(Graphics.height*4+768) @@ -636,1 +634,1 @@ - $game_map.autoplay + $game_map.autoplayAsCue Changed: PokemonOption @@ -1,3 +1,0 @@ -#85578723 -begin - @@ -208,8 +205,1 @@ - case option[6] - when 0 - o.setClass($ResizeFactor==1.0 ? SynchronizedTilemap : CustomTilemap) - when 1 - o.setClass(CustomTilemap) - when 2 - o.setClass(Draw_Tilemap) - end + o.updateClass @@ -290,7 +280,0 @@ - -rescue Exception -if $!.is_a?(SystemExit) || "#{$!.class}"=="Reset" -raise $! -else -end -end Changed: PokeBattle_Effects @@ -22,1 +22,1 @@ - if @ability==PBAbilities::IMMUNITY + if self.ability==PBAbilities::IMMUNITY @@ -148,1 +148,1 @@ - if @ability==PBAbilities::LIMBER + if self.ability==PBAbilities::LIMBER @@ -232,1 +232,1 @@ - if @ability==PBAbilities::WATERVEIL + if self.ability==PBAbilities::WATERVEIL @@ -262,1 +262,1 @@ - if @ability==PBAbilities::FLASHFIRE && move.type==PBTypes::FIRE + if self.ability==PBAbilities::FLASHFIRE && move.type==PBTypes::FIRE @@ -271,1 +271,1 @@ - if @ability==PBAbilities::WATERVEIL + if self.ability==PBAbilities::WATERVEIL Changed: DrawText @@ -721,1 +721,1 @@ - elsif ch[0]!="\n" + elsif ch[0]!="\n" && ch[0]!="\1" Changed: Interpreter @@ -257,1 +257,0 @@ - raise Added: RPG::Sprite Changed: Sprite_Character @@ -23,0 +23,13 @@ + def pbBushDepthTile(bitmap,depth) + ret=Bitmap.new(bitmap.width,bitmap.height) + charheight=ret.height + cy=charheight-depth-2 + y=charheight + ret.blt(0,y,bitmap, + Rect.new(0,y,ret.width,cy)) if cy>=0 + ret.blt(0,y+cy,bitmap, + Rect.new(0,y+cy,ret.width,2),170) if cy>=0 + ret.blt(0,y+cy+2,bitmap, + Rect.new(0,y+cy+2,ret.width,2),85) if cy+2>=0 + return ret + end @@ -25,0 +38,1 @@ + @bushbitmap=nil @@ -40,1 +54,1 @@ - @bushbitmap=pbBushDepthBitmap(@charbitmap,12) + @bushbitmap=nil @@ -51,1 +65,1 @@ - @bushbitmap=pbBushDepthBitmap(@charbitmap,12) + @bushbitmap=nil @@ -61,0 +75,7 @@ + if !@bushbitmap + if @tile_id >= 384 + @bushbitmap=pbBushDepthTile(@charbitmap,12) + else + @bushbitmap=pbBushDepthBitmap(@charbitmap,12) + end + end Changed: PokemonField @@ -129,1 +129,24 @@ - if rand(15)==0 + if 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 + mask=Sprite.new + mask.bitmap = Bitmap.new(640,480) + mask.bitmap.fill_rect(0,0,640,480, Color.new(0,0,0,255)) + sprite.z=99999 + sprite.bitmap = bm + 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 + 2.times do + Graphics.update + end + end + bitmap.dispose + bm.dispose + sprite.dispose + mask.dispose + elsif rand(15)==0 @@ -945,0 +968,2 @@ + attr_accessor :cueBGM + attr_accessor :cueFrames @@ -961,0 +986,7 @@ + if $PokemonTemp.cueFrames + $PokemonTemp.cueFrames-=1 + if $PokemonTemp.cueFrames<=0 + $PokemonTemp.cueFrames=nil + $game_system.bgm_play($PokemonTemp.cueBGM) + end + end @@ -962,0 +994,17 @@ + +def pbCueBGM(bgm,seconds) + return if !bgm + if bgm.is_a?(String) + bgm=RPG::AudioFile.new(bgm,100,100) + end + playingBGM=$game_system.playing_bgm + if !playingBGM || playingBGM.name!=bgm.name || playingBGM.pitch!=bgm.pitch + $game_system.bgm_fade(seconds) + if !$PokemonTemp.cueFrames + $PokemonTemp.cueFrames=(seconds*Graphics.frame_rate)*3/5 + end + $PokemonTemp.cueBGM=bgm; + elsif playingBGM + $game_system.bgm_play(bgm) + end +end @@ -1031,0 +1080,30 @@ +def pbWaitMessage(msgwindow,time) + message="" + time.times do + Kernel.pbDisplayMessageFancy(msgwindow,message,nil,0) + 20.times do + Graphics.update + Input.update + pbSceneMapUpdate + if Input.trigger?(Input::C)||Input.trigger?(Input::B) + return true + end + message+=". " + end + end + return false +end + +def pbWaitForInput(msgwindow,message,frames) + Kernel.pbDisplayMessageFancy(msgwindow,message,nil,0) + frames.times do + Graphics.update + Input.update + pbSceneMapUpdate + if Input.trigger?(Input::C)||Input.trigger?(Input::B) + return true + end + end + return false +end + @@ -1043,1 +1122,1 @@ - if Kernel.pbDisplayMessageFancy(msgwindow,message,0,0,true) + if pbWaitMessage(msgwindow,time) @@ -1053,1 +1132,1 @@ - if !Kernel.pbDisplayMessageFancy(msgwindow,message+_INTL("\r\nOh! A bite!"),nil,frames) + if !pbWaitForInput(msgwindow,message+_INTL("\r\nOh! A bite!"),frames) Changed: Game_Map* @@ -134,3 +134,15 @@ - #-------------------------------------------------------------------------- - # ● BGM / BGS 自動切り替え - #-------------------------------------------------------------------------- + def autoplayAsCue + if @map.autoplay_bgm # Checks whether the map has an autoplay BGM + if (Time.now.hour<6||Time.now.hour>=20) && # Checks if it's night time - the values are editable + FileTest.audio_exist?("Audio/BGM/"+ @map.bgm.name+ "n") + # Checks whether a BGM file with the filename [normal BGM]n exists + pbCueBGM(@map.bgm.name+"n", + @map.bgm.volume,@map.bgm.pitch,1.0) # Plays it + else + pbCueBGM(@map.bgm,1.0) # Plays the normal BGM + end + end + if @map.autoplay_bgs + $game_system.bgs_play(@map.bgs) + end + end Changed: PokeBattle_ActualScene @@ -1297,0 +1297,3 @@ + @sprites["enemybase"].z=-1 # For compatibility with RGSS2 + @sprites["playerbase"].z=-1 # For compatibility with RGSS2 + @sprites["battlebg"].z=-1 # For compatibility with RGSS2 Changed: PokemonTrainers @@ -152,1 +152,1 @@ - command_end + $game_system.map_interpreter.command_end Changed: SpriteResizer @@ -8,0 +8,2 @@ + + @@ -16,0 +18,50 @@ + end + @@fadeoutvp=Viewport.new(0,0,640,480) + @@fadeoutvp.z=0x3FFFFFFF + @@fadeoutvp.color=Color.new(0,0,0,0) + def self.brightness + return (255-@@fadeoutvp.color.alpha) + end + def self.brightness=(value) + value=0 if value<0 + value=255 if value>255 + @@fadeoutvp.color.alpha=255-value + end + def self.fadein(frames) + return if frames<=0 + curvalue=self.brightness + count=(255-self.brightness) + frames.times do |i| + self.brightness=curvalue+(count*i/frames) + self.update + end + end + def self.wait(frames) + return if frames<=0 + frames.times do |i| + self.update + end + end + def self.fadeout(frames) + return if frames<=0 + curvalue=self.brightness + count=self.brightness + frames.times do |i| + self.brightness=curvalue-(count*i/frames) + self.update + end + end + class << self + if !method_defined?(:oldresizescreen) + begin + alias oldresizescreen resize_screen + @@haveresizescreen=true + rescue + @@haveresizescreen=false + end + else + @@haveresizescreen=false + end + def haveresizescreen + @@haveresizescreen + end @@ -90,0 +142,6 @@ + if Graphics.haveresizescreen + Graphics.oldresizescreen( + (Graphics.width+$ResizeOffsetX*2)*factor, + (Graphics.height+$ResizeOffsetY*2)*factor + ) + end @@ -91,2 +149,2 @@ - (Graphics.width+$ResizeOffsetX*2)*factor, - (Graphics.height+$ResizeOffsetY*2)*factor + (Graphics.width+$ResizeOffsetX*2)*factor, + (Graphics.height+$ResizeOffsetY*2)*factor Deleted: PBMoves Changed: Main @@ -1,0 +1,15 @@ +=begin +Graphics.frame_rate=40 +window=Window.new +window.x=0 +window.y=0 +window.width=200 +window.height=200 +window.windowskin=Bitmap.new("Graphics/Windowskins/Window.png") +window.openness=255 +loop do + window.openness=(Graphics.frame_count*2)&0xFF + Graphics.update +end +exit +=end Changed: BitmapCache @@ -58,0 +58,6 @@ + def self.fromCache(i) + return nil if !@cache.include?(i) + obj=@cache[i] rescue nil + return nil if obj && obj.disposed? + return obj + end @@ -62,1 +68,2 @@ - if not @cache.include?(path) or @cache[path].disposed? + objPath=fromCache(path) + if !objPath @@ -65,1 +72,2 @@ - if !@cache[i] || @cache[i].disposed? + obj=fromCache(i) + if !obj @@ -73,1 +81,1 @@ - @cache[path] = BitmapWrapper.new(path) + bm = BitmapWrapper.new(path) @@ -76,1 +84,1 @@ - @cache[path] = BitmapWrapper.new(path) + bm = BitmapWrapper.new(path) @@ -78,1 +86,1 @@ - @cache[path] = BitmapWrapper.new(32, 32) + bm = BitmapWrapper.new(32, 32) @@ -82,1 +90,1 @@ - @cache[path] = BitmapWrapper.new(32, 32) + bm = BitmapWrapper.new(32, 32) @@ -86,2 +94,4 @@ - @cache[path] = BitmapWrapper.new(32, 32) - end + bm = BitmapWrapper.new(32, 32) + end + objPath=bm + @cache[path]=objPath @@ -91,2 +101,2 @@ - @cache[path].addRef if cached - return @cache[path] + objPath.addRef if cached + return objPath @@ -95,2 +105,3 @@ - if not @cache.include?(key) or @cache[key].disposed? - @cache[key] = @cache[path].clone + objKey=fromCache(key) + if !obj + @cache[key] = objPath.clone @@ -99,0 +110,1 @@ + objKey=@cache[key] @@ -100,3 +112,3 @@ - @cache[key].addRef - end - return @cache[key] + objKey.addRef + end + return objKey @@ -146,2 +158,3 @@ - if not @cache.include?(key) or @cache[key].disposed? - @cache[key] = BitmapWrapper.new(32, 32) + objKey=fromCache(key) + if !objKey + @cache[key]=BitmapWrapper.new(32, 32) @@ -155,0 +168,1 @@ + objKey=@cache[key] @@ -156,3 +170,3 @@ - @cache[key].addRef - end - @cache[key] + objKey.addRef + end + objKey Changed: WindowAndTilemap @@ -43,1 +43,0 @@ - @@ -64,0 +63,1 @@ + attr_reader :openness @@ -75,1 +75,1 @@ - "pause","cursor","contents" + "cursor","contents","pause" @@ -93,0 +93,1 @@ + @openness=255 @@ -131,0 +132,6 @@ + def openness=(value) + @openness=value + @openness=0 if @openness<0 + @openness=255 if @openness>255 + privRefresh + end @@ -251,0 +258,1 @@ + mustchange=false @@ -259,0 +267,1 @@ + mustchange=true @@ -260,0 +269,1 @@ + mustchange=true if @cursoropacity!=128 @@ -265,2 +275,3 @@ - end - privRefresh + mustchange=true + end + privRefresh if mustchange @@ -271,1 +282,0 @@ - @@ -332,1 +342,1 @@ - @sprites["contents"].visible=@visible + @sprites["contents"].visible=@visible && @openness==255 @@ -346,1 +356,1 @@ - @sprites["contents"].visible=@visible + @sprites["contents"].visible=@visible && @openness==255 @@ -517,0 +527,25 @@ + if @openness!=255 + opn=@openness/255.0 + for k in @spritekeys + sprite=@sprites[k] + ratio=(@height<=0) ? 0 : (sprite.y-@y)*1.0/@height + sprite.zoom_y=opn + sprite.oy=0 + sprite.y=(@y+(@height/2.0)+(@height*ratio*opn)-(@height/2*opn)).floor + oldbitmap=sprite.bitmap + oldsrcrect=sprite.src_rect.clone + end + else + for k in @spritekeys + sprite=@sprites[k] + sprite.zoom_y=1.0 + end + end + i=0 + # Ensure Z order + for k in @spritekeys + sprite=@sprites[k] + y=sprite.y + sprite.y=i + sprite.oy=(sprite.zoom_y<=0) ? 0 : (i-y)/sprite.zoom_y + end @@ -1417,0 +1452,3 @@ + updateClass + end + def updateClass @@ -1418,2 +1456,0 @@ - when 0 - setClass($ResizeFactor==1.0 ? SynchronizedTilemap : CustomTilemap) @@ -1425,1 +1461,5 @@ - setClass($ResizeFactor==1.0 ? SynchronizedTilemap : CustomTilemap) + if Tilemap.method_defined?(:passages) + setClass(CustomTilemap) + else + setClass($ResizeFactor==1.0 ? SynchronizedTilemap : CustomTilemap) + end Changed: Compiler @@ -595,0 +595,2 @@ +class PBTrainers; end + @@ -817,1 +819,4 @@ - a.each{|i| return i if i[1]==name} + a.each{|i| + next if !i + return i if i[1]==name + } @@ -822,1 +827,6 @@ - scripts=load_data("Data/Scripts.rxdata") + begin + scripts=load_data("Data/Constants.rxdata") + scripts=[] if !scripts + rescue + scripts=[] + end @@ -827,1 +837,0 @@ - mainsec=scripts.pop @@ -829,3 +838,2 @@ - scripts.push(mainsec) - end - save_data(scripts,"Data/Scripts.rxdata") + end + save_data(scripts,"Data/Constants.rxdata") @@ -1498,0 +1506,146 @@ +def nameArray(filename) + arr=[] + File.open(filename,"rb"){|f| + size=f.fgetdw>>3 + for i in 0...size + arr.push(f.readName(i).upcase.gsub(/[^A-Za-z0-9_]/,"")) + end + } + return arr +end + +def nameArrayOrig(filename) + arr=[] + File.open(filename,"rb"){|f| + size=f.fgetdw>>3 + for i in 0...size + arr.push(f.readName(i)) + end + } + return arr +end + + +def pbTMDP + tms=[ +264,#TM01 108, Focus Punch */ +337,#TM02 151, Dragon Claw */ +352,#TM03 160, Water Pulse */ +347,#TM04 15B, Calm Mind */ +46,#TM05 2E, Roar */ +92,#TM06 5C, Toxic */ +258,#TM07 102, Hail */ +339,#TM08 153, Bulk Up */ +331,#TM09 14B, Bullet Seed */ +237,#TM10 ED, Hidden Power */ +241,#TM11 F1, Sunny Day */ +269,#TM12 10D, Taunt */ +58,#TM13 3A, Ice Beam */ +59,#TM14 3B, Blizzard */ +63,#TM15 3F, Hyper Beam */ +113,#TM16 71, Light Screen */ +182,#TM17 B6, Protect */ +240,#TM18 F0, Rain Dance */ +202,#TM19 CA, Giga Drain */ +219,#TM20 DB, Safeguard */ +218,#TM21 DA, Frustration */ +76,#TM22 4C, SolarBeam */ +231,#TM23 E7, Iron Tail */ +85,#TM24 55, Thunderbolt */ +87,#TM25 57, Thunder */ +89,#TM26 59, Earthquake */ +216,#TM27 D8, Return */ +91,#TM28 5B, Dig */ +94,#TM29 5E, Psychic */ +247,#TM30 F7, Shadow Ball */ +280,#TM31 118, Brick Break */ +104,#TM32 68, Double Team */ +115,#TM33 73, Reflect */ +351,#TM34 15F, Shock Wave */ +53,#TM35 35, Flamethrower */ +188,#TM36 BC, Sludge Bomb */ +201,#TM37 C9, Sandstorm */ +126,#TM38 7E, Fire Blast */ +317,#TM39 13D, Rock Tomb */ +332,#TM40 14C, Aerial Ace */ +259,#TM41 103, Torment */ +263,#TM42 107, Facade */ +290,#TM43 122, Secret Power */ +156,#TM44 9C, Rest */ +213,#TM45 D5, Attract */ +168,#TM46 A8, Thief */ +211,#TM47 D3, Steel Wing */ +285,#TM48 11D, Skill Swap */ +289,#TM49 121, Snatch */ +315,#TM50 13B, Overheat */ +355,#TM51 163, Roost */ +411,#TM52 19B, Focus Blast */ +412,#TM53 19C, Energy Ball */ +206,#TM54 CE, False Swipe */ +362,#TM55 16A, Brine */ +374,#TM56 176, Fling */ +451,#TM57 1C3, Charge Beam */ +203,#TM58 CB, Endure */ +406,#TM59 196, Dragon Pulse */ +409,#TM60 199, Drain Punch */ +261,#TM61 105, Will-O-Wisp */ +318,#TM62 13E, Silver Wind */ +373,#TM63 175, Embargo */ +153,#TM64 99, Explosion */ +421,#TM65 1A5, Shadow Claw */ +371,#TM66 173, Payback */ +278,#TM67 116, Recycle */ +416,#TM68 1A0, Giga Impact */ +397,#TM69 18D, Rock Polish */ +148,#TM70 94, Flash */ +444,#TM71 1BC, Stone Edge */ +419,#TM72 1A3, Avalanche */ +86,#TM73 56, Thunder Wave */ +360,#TM74 168, Gyro Ball */ +14,#TM75 0E, Swords Dance */ +446,#TM76 1BE, Stealth Rock */ +244,#TM77 F4, Psych Up */ +445,#TM78 1BD, Captivate */ +399,#TM79 18F, Dark Pulse */ +157,#TM80 9D, Rock Slide */ +404,#TM81 194, X-Scissor */ +214,#TM82 D6, Sleep Talk */ +363,#TM83 16B, Natural Gift */ +398,#TM84 18E, Poison Jab */ +138,#TM85 8A, Dream Eater */ +447,#TM86 1BF, Grass Knot */ +207,#TM87 CF, Swagger */ +365,#TM88 16D, Pluck */ +369,#TM89 171, U-turn */ +164,#TM90 A4, Substitute */ +430,#TM91 1AE, Flash Cannon */ +433,#TM92 1B1, Trick Room */ +15,#HM01 0F, Cut */ +19,#HM02 13, Fly */ +57,#HM03 39, Surf */ +70,#HM04 46, Strength */ +432,#HM05 1B0, Defog */ +249,#HM06 F9, Rock Smash */ +127,#HM07 7F, Waterfall */ +431 + ] + movenames=nameArray("dp/strMovesEN.dat") + File.open("dp/tmDP.dat","rb"){|f| + File.open("dp/tmdp.txt","wb"){|fw| + for j in 0...100 + fw.write(sprintf("[%s]\r\n",movenames[tms[j]])) + specieslist=[] + for species in 1..493 + f.pos=(species-1)*16 + f.pos+=j>>3 + ret=(f.fgetb&(1<<(j&0x07)))!=0 + if ret + specieslist.push(getConstantName(PBSpecies,species)) + end + end + fw.write(sprintf("%s\r\n",specieslist.join(","))) + Graphics.update if j%5==0 + end + }} +end + @@ -1501,1 +1655,12 @@ - for i in 387..493 + movenames=nameArray("dp/strMovesEN.dat") + abilnames=nameArray("dp/strAbilitiesEN.dat") + abilorignames=nameArrayOrig("dp/strAbilitiesEN.dat") + itemnames=nameArray("dp/strItemsDPEN.dat") + File.open("dp/abilitiesdp.txt","wb"){|f| + for i in 1...abilnames.length + f.write(sprintf("%d,%s,%s,\r\n",i,abilnames[i],abilorignames[i])) + end + } + pbTMDP() + + for i in 1..493 @@ -1564,1 +1729,3 @@ -# pokedata.write("Habitat="+["Grassland","Forest","WatersEdge","Sea","Cave","Mountain","RoughTerrain","Urban","Rare"][habitat]+"\r\n") + if i<=386 + pokedata.write("Habitat="+["Grassland","Forest","WatersEdge","Sea","Cave","Mountain","RoughTerrain","Urban","Rare"][habitat]+"\r\n") + end @@ -1566,4 +1733,0 @@ - ability1+=1 if ability1==PBAbilities::CACOPHONY - ability2+=1 if ability2==PBAbilities::CACOPHONY - ability1=0 if ability1>PBAbilities::AIRLOCK - ability2=0 if ability2>PBAbilities::AIRLOCK @@ -1573,1 +1736,1 @@ - pokedata.write("Abilities="+getConstantName(PBAbilities,ability2)+"\r\n") + pokedata.write("Abilities="+abilnames[ability2]+"\r\n") @@ -1575,2 +1738,2 @@ - pokedata.write("Abilities="+getConstantName(PBAbilities,ability1)) - pokedata.write(", "+getConstantName(PBAbilities,ability2)) if ability2!=0 + pokedata.write("Abilities="+abilnames[ability1]) + pokedata.write(", "+abilnames[ability2]) if ability2!=0 @@ -1579,2 +1742,10 @@ -# pokedata.write("WildItemCommon="+getConstantName(PBItems,item1)+"\r\n") if item1>0 -# pokedata.write("WildItemRare="+getConstantName(PBItems,item2)+"\r\n") if item2>0 + if i<=386 + dexdata1=File.open("dp/dexdata1.dat","rb") + pbDexDataOffset(dexdata1,i,48) + item1=dexdata1.fgetw + pokedata.write("WildItemCommon="+getConstantName(PBItems,item1)+"\r\n") if item1>0 + pbDexDataOffset(dexdata1,i,50) + item2=dexdata1.fgetw + pokedata.write("WildItemRare="+getConstantName(PBItems,item2)+"\r\n") if item2>0 + dexdata1.close + end @@ -1608,1 +1779,1 @@ - move=equivmoves[move-355] if move>=355 +# move=equivmoves[move-355] if move>=355 @@ -1611,1 +1782,1 @@ - pokedata.write(sprintf("%d,%s",alevel,getConstantName(PBMoves,move))) + pokedata.write(sprintf("%d,%s",alevel,movenames[move])) @@ -1627,1 +1798,1 @@ - atk=equivmoves[atk-355] if atk>=355 +# atk=equivmoves[atk-355] if atk>=355 @@ -1630,1 +1801,1 @@ - pokedata.write(getConstantName(PBMoves,atk)) + pokedata.write(movenames[atk]) @@ -1636,18 +1807,0 @@ - pokedata.write("\r\n") - pokedata.write("Machines=") - first=true - for j in 0...50 - if pbSpeciesCompatibleDP?(i,j) - pokedata.write(",") if !first - pokedata.write("#{j+1}") - first=false - end - end - for j in 92...100 - next if j==96 || j==99 - if pbSpeciesCompatibleDP?(i,j) - pokedata.write(",") if !first - pokedata.write("#{j+1-42}") - first=false - end - end @@ -1677,1 +1830,0 @@ - otherpokename= @@ -1684,1 +1836,1 @@ - pokedata.write(sprintf("%s",getConstantName(PBItems,level))) rescue nil + pokedata.write(sprintf("%s",itemnames[level])) rescue nil @@ -1686,1 +1838,1 @@ - pokedata.write(sprintf("%s",getConstantName(PBMoves,level))) rescue nil + pokedata.write(sprintf("%s",movenames[level])) rescue nil @@ -1699,0 +1851,1 @@ + Graphics.update @@ -2229,1 +2382,2 @@ -"bttrainers.dat" +"bttrainers.dat", +"Constants.rxdata" @@ -2520,0 +2674,2 @@ + +#pbPokemonDataDP Deleted: PBSpecies Deleted: PBItems Added: RGSS2Compatibility Changed: PokemonEvolution @@ -182,0 +182,6 @@ +def pecho(*arg) + for i in arg + echo i.inspect+"\r\n" + end +end + @@ -217,1 +223,2 @@ - sprite.angle=value if code==SpriteMetafile::ANGLE + # prevent crashes + sprite.angle=(value==180) ? 179.9 : value if code==SpriteMetafile::ANGLE @@ -401,0 +408,1 @@ +pecho "update1" @@ -402,1 +410,3 @@ - metaplayer2.update +pecho "update2" + metaplayer2.update +pecho "Graphics.update" @@ -404,0 +414,1 @@ +pecho "Input.update" @@ -405,0 +416,1 @@ +pecho "checking trigger" @@ -411,0 +423,1 @@ +pecho "end" Deleted: PBTrainers Deleted: PBAbilities Changed: PokemonMessages @@ -20,1 +20,1 @@ - $game_temp.message_window_showing=false + $game_temp.message_window_showing=oldmws @@ -23,0 +23,24 @@ + end +end + +class Scene_Battle + def updatemini + oldmws=$game_temp.message_window_showing + $game_temp.message_window_showing=true + # Update system (timer) and screen + $game_system.update + $game_screen.update + # If timer has reached 0 + if $game_system.timer_working and $game_system.timer == 0 + # Abort battle + $game_temp.battle_abort = true + end + # Update windows + @help_window.update + @party_command_window.update + @actor_command_window.update + @status_window.update + $game_temp.message_window_showing=oldmws + @message_window.update + # Update sprite set + @spriteset.update @@ -33,0 +57,2 @@ + elsif $scene && $scene.is_a?(Scene_Battle) + $scene.updatemini @@ -43,0 +69,2 @@ + elsif $scene && $scene.is_a?(Scene_Battle) + $scene.updatemini @@ -533,1 +561,2 @@ - bitmap=Bitmap.new(skin) + skinbase=skin.sub(/\.....?$/,"") + bitmap=Bitmap.new(skinbase+".png") @@ -536,1 +565,1 @@ - window.setSkin(skin) + window.setSkin(skinbase+".png") @@ -539,2 +568,1 @@ - window.setSkin(skin) - skinbase=skin.sub(/\.....?$/,"") + window.setSkin(skinbase+".png") @@ -557,2 +585,1 @@ - Kernel.pbDisplayMessageFancy(msgwindow,message,-1,0) - ret=Kernel.pbShowCommands(msgwindow,commands,cmdIfCancel) + ret=Kernel.pbDisplayMessageFancy(msgwindow,message,-1,0,commands,cmdIfCancel) @@ -679,1 +706,2 @@ - msgwindow,message,textspeed=-1,delay=-1,cancelEvenIfBusy=false) + msgwindow,message,textspeed=-1, + delay=-1,msgCommands=nil,msgCommandsCancel=-1) @@ -698,1 +726,3 @@ - if $game_system && $game_system.respond_to?("message_position") + if $game_temp && $game_temp.in_battle + msgwindow.y=0 + elsif $game_system && $game_system.respond_to?("message_position") @@ -830,1 +860,0 @@ - ret=true @@ -836,4 +865,0 @@ - end - if (Input.trigger?(Input::C) || Input.trigger?(Input::B)) && cancelEvenIfBusy - ret=true - break @@ -846,1 +871,0 @@ - ret=true @@ -863,0 +887,3 @@ + end + if msgCommands + ret=Kernel.pbShowCommands(msgwindow,msgCommands,msgCommandsCancel) Changed: SpriteWindow @@ -661,0 +661,1 @@ + attr_reader :openness @@ -672,1 +673,1 @@ - "pause","cursor","contents" + "cursor","contents","pause" @@ -698,0 +699,1 @@ + @openness=255 @@ -744,0 +746,2 @@ + end + for i in @spritekeys @@ -780,0 +784,6 @@ + def openness=(value) + @openness=value + @openness=0 if @openness<0 + @openness=255 if @openness>255 + privRefresh + end @@ -843,0 +853,1 @@ + mustchange=false @@ -851,0 +862,1 @@ + mustchange=true @@ -852,0 +864,1 @@ + mustchange=true if @cursoropacity!=128 @@ -857,2 +870,3 @@ - end - privRefresh + mustchange=true + end + privRefresh if mustchange @@ -1017,1 +1031,1 @@ - @sprites["contents"].visible=@visible + @sprites["contents"].visible=@visible && @openness==255 @@ -1030,1 +1044,1 @@ - @sprites["contents"].visible=@visible + @sprites["contents"].visible=@visible && @openness==255 @@ -1039,2 +1053,2 @@ - for i in @sprites - i[1].z=@z + for i in @spritekeys + @sprites[i].z=@z @@ -1292,0 +1306,20 @@ + if @openness!=255 + opn=@openness/255.0 + for k in @spritekeys + sprite=@sprites[k] + ratio=(@height<=0) ? 0 : (sprite.y-@y)*1.0/@height + sprite.zoom_y=opn + sprite.oy=0 + sprite.y=(@y+(@height/2.0)+(@height*ratio*opn)-(@height/2*opn)).floor + oldbitmap=sprite.bitmap + oldsrcrect=sprite.src_rect.clone + end + end + i=0 + # Ensure Z order + for k in @spritekeys + sprite=@sprites[k] + y=sprite.y + sprite.y=i + sprite.oy=(sprite.zoom_y<=0) ? 0 : (i-y)/sprite.zoom_y + end Changed: PokemonSystem @@ -1,0 +1,7 @@ +def pbSafeLoad(file) + if FileTest.exist?("./Game.rgssad") && FileTest.exist?(file) + File.delete(file) rescue nil + end + return load_data(file) +end + @@ -23,0 +30,10 @@ + begin + consts=pbSafeLoad("Data/Constants.rxdata") + consts=[] if !consts + rescue + consts=[] + end + for script in consts + next if !script + eval(Zlib::Inflate.inflate(script[2]),nil,script[1]) + end @@ -71,0 +88,23 @@ + +def pbDebugF7 + if $DEBUG + debugBitmaps + Audio.se_play("Audio/SE/expfull.wav") + end +end + +module Input + unless defined?(update_KGC_ScreenCapture2) + class << Input + alias update_KGC_ScreenCapture2 update + end + end + def self.update + update_KGC_ScreenCapture2 + if trigger?(Input::F7) + pbDebugF7 + end + end +end + + Changed: PokemonScreen @@ -210,0 +210,1 @@ + @pokeballsprite.z=self.z+1 # For compatibility with RGSS2 @@ -358,0 +359,3 @@ + @pkmnsprite.z=self.z+2 # For compatibility with RGSS2 + @itemsprite.z=self.z+1 # For compatibility with RGSS2 + @pokeballsprite.z=self.z+1 # For compatibility with RGSS2 Changed: PokeBattle_Battler @@ -333,1 +333,1 @@ - if @hp>0 && @pokemon && @ability==PBAbilities::NATURALCURE + if @hp>0 && @pokemon && self.ability==PBAbilities::NATURALCURE @@ -358,1 +358,1 @@ - if @battle.pbWeather==PBWeather::RAINDANCE && @ability==PBAbilities::SWIFTSWIM + if @battle.pbWeather==PBWeather::RAINDANCE && self.ability==PBAbilities::SWIFTSWIM @@ -361,1 +361,1 @@ - if @battle.pbWeather==PBWeather::SUNNYDAY && @ability==PBAbilities::CHLOROPHYLL + if @battle.pbWeather==PBWeather::SUNNYDAY && self.ability==PBAbilities::CHLOROPHYLL @@ -557,1 +557,1 @@ - while @ability==PBAbilities::LIMBER && self.status==PBStatuses::PARALYSIS + while self.ability==PBAbilities::LIMBER && self.status==PBStatuses::PARALYSIS @@ -561,1 +561,1 @@ - while @ability==PBAbilities::OBLIVIOUS && @effects[PBEffects::Attract]>=0 + while self.ability==PBAbilities::OBLIVIOUS && @effects[PBEffects::Attract]>=0 @@ -565,1 +565,1 @@ - while @ability==PBAbilities::VITALSPIRIT &&self.status==PBStatuses::SLEEP + while self.ability==PBAbilities::VITALSPIRIT &&self.status==PBStatuses::SLEEP @@ -569,1 +569,1 @@ - while @ability==PBAbilities::INSOMNIA && self.status==PBStatuses::SLEEP + while self.ability==PBAbilities::INSOMNIA && self.status==PBStatuses::SLEEP @@ -573,1 +573,1 @@ - while @ability==PBAbilities::IMMUNITY && self.status==PBStatuses::POISON + while self.ability==PBAbilities::IMMUNITY && self.status==PBStatuses::POISON @@ -577,1 +577,1 @@ - while @ability==PBAbilities::OWNTEMPO && @effects[PBEffects::Confusion]>0 + while self.ability==PBAbilities::OWNTEMPO && @effects[PBEffects::Confusion]>0 @@ -581,1 +581,1 @@ - while @ability==PBAbilities::MAGMAARMOR && self.status==PBStatuses::FROZEN + while self.ability==PBAbilities::MAGMAARMOR && self.status==PBStatuses::FROZEN @@ -585,1 +585,1 @@ - while @ability==PBAbilities::WATERVEIL && self.status==PBStatuses::BURN + while self.ability==PBAbilities::WATERVEIL && self.status==PBStatuses::BURN @@ -1506,1 +1506,1 @@ - if @ability!=PBAbilities::SOUNDPROOF && self.status==PBStatuses::SLEEP + if self.ability!=PBAbilities::SOUNDPROOF && self.status==PBStatuses::SLEEP @@ -1568,1 +1568,1 @@ - if @ability==PBAbilities::EARLYBIRD + if self.ability==PBAbilities::EARLYBIRD @@ -1603,1 +1603,1 @@ - if @ability==PBAbilities::TRUANT && @effects[PBEffects::Truant] + if self.ability==PBAbilities::TRUANT && @effects[PBEffects::Truant] Changed: Win32API* @@ -2,3 +2,0 @@ - #-------------------------------------------------------------------------- - # - define constant - #-------------------------------------------------------------------------- @@ -6,4 +3,0 @@ - GAME_INI_FILE = ".\\Game.ini" # define "Game.ini" file - HWND_TOPMOST = 0 # window always active - HWND_TOP = -1 # window active when used only - SWP_NOMOVE = 0 # window pos and sizes can be changed @@ -40,1 +33,1 @@ - gps.call(section, key, "", val, 256, GAME_INI_FILE) + gps.call(section, key, "", val, 256, ".\\Game.ini") Changed: Sprite_Timer @@ -21,1 +21,1 @@ - @timer.z=99999 + @timer.z=99998 Changed: PokemonBugContest @@ -390,2 +390,2 @@ - $game_system.bgm_stop - $game_system.bgs_stop + $game_system.bgm_unpause + $game_system.bgs_unpause Changed: PokemonMap Changed: PokemonOption Changed: PokeBattle_Effects Changed: DrawText Changed: Interpreter Added: RPG::Sprite Changed: Sprite_Character Changed: PokemonField Changed: Game_Map* Changed: PokeBattle_ActualScene Changed: PokemonTrainers Changed: SpriteResizer Deleted: PBMoves Changed: Main Changed: BitmapCache Changed: WindowAndTilemap Changed: Compiler Deleted: PBSpecies Deleted: PBItems Added: RGSS2Compatibility Changed: PokemonEvolution Deleted: PBTrainers Deleted: PBAbilities Changed: PokemonMessages Changed: SpriteWindow Changed: PokemonSystem Changed: PokemonScreen Changed: PokeBattle_Battler Changed: Win32API* Changed: Sprite_Timer Changed: PokemonBugContest