Changed: TilemapXP --- Left +++ Right @@ -49,8 +49,8 @@ attr_accessor :color def graphicsHeight - return 480 + return @graphicsHeight end def graphicsWidth - return 640 + return @graphicsWidth end def initialize(viewport) @@ -64,6 +64,14 @@ @oy = 0 # bitmap Offsets @plane = false - @tileWidth = Game_Map::TILEWIDTH - @tileHeight = Game_Map::TILEHEIGHT + @haveGraphicsWH=Graphics.width!=nil rescue false + if @haveGraphicsWH + @graphicsWidth=Graphics.width + @graphicsHeight=Graphics.height + else + @graphicsWidth=640 + @graphicsHeight=480 + end + @tileWidth = Game_Map::TILEWIDTH rescue 32 + @tileHeight = Game_Map::TILEHEIGHT rescue 32 @tileSrcWidth = 32 @tileSrcHeight = 32 @@ -117,4 +125,8 @@ end def update + if @haveGraphicsWH + @graphicsWidth=Graphics.width + @graphicsHeight=Graphics.height + end if @oldtone!=@tone @layer0.tone=@tone Changed: PokemonMap --- Left +++ Right @@ -526,9 +526,7 @@ for i in 0...conns.length conn=conns[i] - begin - v=getMapEdge(conn[0],conn[1]) - rescue - next - end + v=getMapEdge(conn[0],conn[1]) + dims=getMapDims(conn[0]) + next if dims[0]==0 || dims[1]==0 if conn[1]=="N"||conn[1]=="S" conn[1]=conn[2] @@ -537,9 +535,7 @@ conn[1]=v end - begin - v=getMapEdge(conn[3],conn[4]) - rescue - next - end + v=getMapEdge(conn[3],conn[4]) + dims=getMapDims(conn[3]) + next if dims[0]==0 || dims[1]==0 if conn[4]=="N"||conn[4]=="S" conn[4]=conn[5] Changed: PokemonBerryTag --- Left +++ Right @@ -12,6 +12,5 @@ @viewport=Viewport.new(0,0,Graphics.width,Graphics.height) @viewport.z=99999 - @sprites["background"]=Plane.new(@viewport) - @sprites["background"].bitmap=BitmapCache.load_bitmap("Graphics/Pictures/trcardbg.png") + addBackgroundPlane(@sprites,"background","trcardbg",@viewport) @sprites["card"]=SpriteWrapper.new(@viewport) @sprites["card"].bitmap=BitmapCache.load_bitmap("Graphics/Pictures/berrytag.png") Changed: PokeBattle_Pokemon --- Left +++ Right @@ -1,6 +1,6 @@ =begin -This class stores data on each Pokemon. Refer to $Trainer.party for an array of each -Pokemon in the Trainer's current party. +This class stores data on each Pokémon. Refer to $Trainer.party for an array of each +Pokémon in the Trainer's current party. =end @@ -82,5 +82,5 @@ attr_accessor(:statusCount) # Sleep count/Toxic flag attr_accessor(:ev) # Effort Values -attr_accessor(:eggsteps) # Steps to hatch egg, 0 if Pokemon is not an egg +attr_accessor(:eggsteps) # Steps to hatch egg, 0 if Pokémon is not an egg attr_accessor(:moves) # Moves (PBMove) attr_accessor(:ballused) # Ball used Changed: PokemonOption --- Left +++ Right @@ -5,4 +5,5 @@ attr_reader :baseColor attr_reader :shadowColor + attr_reader :mustUpdateOptions def initialize(options,x,y,width,height) super(x,y,width,height) @@ -17,4 +18,5 @@ @selShadowColor=Color.new(31*8,17*8,16*8) @optvalues=[] + @mustUpdateOptions=false for i in 0...@options.length @optvalues[i]=0 @@ -105,4 +107,5 @@ dorefresh=false oldindex=self.index + @mustUpdateOptions=false super dorefresh=self.index!=oldindex @@ -111,9 +114,9 @@ self[self.index]=@options[self.index].prev(self[self.index]) dorefresh=true - pbUpdateOptions(self) + @mustUpdateOptions=true elsif Input.repeat?(Input::RIGHT) self[self.index]=@options[self.index].next(self[self.index]) dorefresh=true - pbUpdateOptions(self) + @mustUpdateOptions=true end end @@ -122,10 +125,22 @@ end +module PropertyMixin + def get + @getProc ? @getProc.call() : nil + end + def set(value) + @setProc.call(value) if @setProc + end +end + class EnumOption + include PropertyMixin attr_reader :values attr_reader :name - def initialize(name,options) + def initialize(name,options,getProc,setProc) @values=options @name=name + @getProc=getProc + @setProc=setProc end def next(current) @@ -142,9 +157,12 @@ class EnumOption2 + include PropertyMixin attr_reader :values attr_reader :name - def initialize(name,options) + def initialize(name,options,getProc,setProc) @values=options @name=name + @getProc=getProc + @setProc=setProc end def next(current) @@ -162,11 +180,14 @@ class NumberOption + include PropertyMixin attr_reader :name attr_reader :optstart - def initialize(name,format,optstart,optend) + def initialize(name,format,optstart,optend,getProc,setProc) @name=name @format=format @optstart=optstart @optend=optend + @getProc=getProc + @setProc=setProc end def next(current) @@ -188,28 +209,4 @@ end - -def pbUpdateOptions(option) - $PokemonSystem.textspeed=option[0] - $PokemonSystem.battlescene=option[1] - $PokemonSystem.battlestyle=option[2] - $PokemonSystem.font=option[3] - $PokemonSystem.frame=option[4] - oldscreensize=$PokemonSystem.screensize - $PokemonSystem.screensize=option[5] - $ResizeOffsetX=[0,0,80,80][option[5]] - $ResizeOffsetY=[0,0,80,80][option[5]] - pbSetResizeFactor([0.5,1.0,0.5,1.0][option[5]]) - oldtilemap=$PokemonSystem.tilemap - $PokemonSystem.tilemap=option[6] - $PokemonSystem.textskin=option[7] - if oldscreensize!=option[5] || oldtilemap!=option[6] - ObjectSpace.each_object(TilemapLoader){|o| - next if o.disposed? - o.updateClass - } - end -end - - ##################### # @@ -262,14 +259,55 @@ @sprites["title"]=Window_UnformattedTextPokemon.newWithSize( _INTL("OPTION"),0,0,Graphics.width,64,@viewport) + # These are the different options in the game. To add an option, define a setter and + # a getter for that option. To delete an option, comment it out or delete it. + # The game's options may be placed in any order. @PokemonOptions=[ - EnumOption.new(_INTL("TEXT SPEED"),[_INTL("SLOW"),_INTL("MID"),_INTL("FAST")]), - EnumOption.new(_INTL("BATTLE SCENE"),[_INTL("ON"),_INTL("OFF")]), - EnumOption.new(_INTL("BATTLE STYLE"),[_INTL("SHIFT"),_INTL("SET")]), - EnumOption.new(_INTL("FONT STYLE"),[_INTL("Em"),_INTL("R/S"),_INTL("FRLG"),_INTL("DP")]), - NumberOption.new(_INTL("FRAME"),_INTL("TYPE%d"),1,$TextFrames.length), - EnumOption2.new(_INTL("SCREEN SIZE"),[_INTL("240x160"),_INTL("480x320"),_INTL("320x240"),_INTL("640x480")]), - EnumOption2.new(_INTL("MAP VIEW"),[_INTL("ORIGINAL"),_INTL("CUSTOM"),_INTL("PERSPECTIVE")]), - NumberOption.new(_INTL("SPEECH FRAME"),_INTL("TYPE%d"),1,$SpeechFrames.length) -# EnumOption2.new(_INTL("SPEECH FRAME"),[_INTL("DEFAULT"),_INTL("R/S"),_INTL("FIRE/LEAF"),_INTL("EMERALD")]) + EnumOption.new(_INTL("TEXT SPEED"),[_INTL("SLOW"),_INTL("MID"),_INTL("FAST")], + proc { $PokemonSystem.textspeed }, # Getter + proc {|value| $PokemonSystem.textspeed=value } # Setter + ), + EnumOption.new(_INTL("BATTLE SCENE"),[_INTL("ON"),_INTL("OFF")], + proc { $PokemonSystem.battlescene }, + proc {|value| $PokemonSystem.battlescene=value } + ), + EnumOption.new(_INTL("BATTLE STYLE"),[_INTL("SHIFT"),_INTL("SET")], + proc { $PokemonSystem.battlestyle }, + proc {|value| $PokemonSystem.battlestyle=value } + ), + EnumOption.new(_INTL("FONT STYLE"),[_INTL("Em"),_INTL("R/S"),_INTL("FRLG"),_INTL("DP")], + proc { $PokemonSystem.font }, + proc {|value| $PokemonSystem.font=value } + ), + NumberOption.new(_INTL("FRAME"),_INTL("TYPE%d"),1,$TextFrames.length, + proc { $PokemonSystem.frame }, + proc {|value| $PokemonSystem.frame=value } + ), + EnumOption2.new(_INTL("SCREEN SIZE"),[_INTL("240x160"),_INTL("480x320"),_INTL("320x240"),_INTL("640x480")], + proc { $PokemonSystem.screensize }, + proc {|value| + oldvalue=$PokemonSystem.screensize + $PokemonSystem.screensize=value + $ResizeOffsetX=[0,0,80,80][value] + $ResizeOffsetY=[0,0,80,80][value] + pbSetResizeFactor([0.5,1.0,0.5,1.0][value]) + if value!=oldvalue + ObjectSpace.each_object(TilemapLoader){|o| next if o.disposed?; o.updateClass } + end + } + ), + EnumOption2.new(_INTL("MAP VIEW"),[_INTL("ORIGINAL"),_INTL("CUSTOM"),_INTL("PERSPECTIVE")], + proc { $PokemonSystem.tilemap ? $PokemonSystem.tilemap : 0 }, + proc {|value| + oldvalue=$PokemonSystem.tilemap + $PokemonSystem.tilemap=value + if value!=oldvalue + ObjectSpace.each_object(TilemapLoader){|o| next if o.disposed?; o.updateClass } + end + } + ), + NumberOption.new(_INTL("SPEECH FRAME"),_INTL("TYPE%d"),1,$SpeechFrames.length, + proc { $PokemonSystem.textskin }, + proc {|value| $PokemonSystem.textskin=value } + ) ] @sprites["option"]=Window_PokemonOption.new(@PokemonOptions,0, @@ -278,12 +316,8 @@ @sprites["option"].viewport=@viewport @sprites["option"].visible=true - @sprites["option"][0]=$PokemonSystem.textspeed - @sprites["option"][1]=$PokemonSystem.battlescene - @sprites["option"][2]=$PokemonSystem.battlestyle - @sprites["option"][3]=$PokemonSystem.font - @sprites["option"][4]=$PokemonSystem.frame - @sprites["option"][5]=$PokemonSystem.screensize - @sprites["option"][6]=$PokemonSystem.tilemap ? $PokemonSystem.tilemap : 0 - @sprites["option"][7]=$PokemonSystem.textskin + # Get the values of each option + for i in 0...@PokemonOptions.length + @sprites["option"][i]=(@PokemonOptions[i].get || 0) + end pbFadeInAndShow(@sprites) end @@ -294,4 +328,10 @@ @sprites["title"].update @sprites["option"].update + if @sprites["option"].mustUpdateOptions + # Set the values of each option + for i in 0...@PokemonOptions.length + @PokemonOptions[i].set(@sprites["option"][i]) + end + end if Input.trigger?(Input::B) break @@ -304,5 +344,8 @@ def pbEndScene pbFadeOutAndHide(@sprites) - pbUpdateOptions(@sprites["option"]) + # Set the values of each option + for i in 0...@PokemonOptions.length + @PokemonOptions[i].set(@sprites["option"][i]) + end pbDisposeSpriteHash(@sprites) pbRefreshSceneMap Changed: PokeBattle_BattleArena --- Left +++ Right @@ -98,5 +98,5 @@ return if @decision!=0 # Update mind rating (asserting that a move was chosen) - # TODO: Actually done at Pokemon's turn + # TODO: Actually done at Pokémon's turn for i in 0..1 if @choices[i][2] @@ -115,5 +115,5 @@ @battlers[1].pbCancelMoves pbDisplay(_INTL("REFEREE: That's it! We will now go to judging to determine the winner!")) if !self.debug - pbDisplayPaused(_INTL("REFEREE: Judging category 1, Mind! The Pokemon showing the most guts!")) if !self.debug + pbDisplayPaused(_INTL("REFEREE: Judging category 1, Mind! The Pokémon showing the most guts!")) if !self.debug if @mind[0]==@mind[1] points[0]+=1 @@ -125,5 +125,5 @@ end pbDisplayPaused(_INTL("{1}: {2}\n{3}: {4}",@battlers[0].pbThis,points[0],@battlers[1].pbThis,points[1])) - pbDisplayPaused(_INTL("REFEREE: Judging category 2, Skill! The Pokemon using moves the best!")) if !self.debug + pbDisplayPaused(_INTL("REFEREE: Judging category 2, Skill! The Pokémon using moves the best!")) if !self.debug # TODO: Skill rating not determined yet if @skill[0]==@skill[1] @@ -136,5 +136,5 @@ end pbDisplayPaused(_INTL("{1}: {2}\n{3}: {4}",@battlers[0].pbThis,points[0],@battlers[1].pbThis,points[1])) - pbDisplayPaused(_INTL("REFEREE: Judging category 3, Body! The Pokemon with the most vitality!")) if !self.debug + pbDisplayPaused(_INTL("REFEREE: Judging category 3, Body! The Pokémon with the most vitality!")) if !self.debug body=[0,0] body[0]=((@battlers[0].hp*100)/@starthp[0]).floor Changed: PokemonDayCare --- Left +++ Right @@ -31,5 +31,5 @@ end end - raise _INTL("No room to deposit a Pokemon") + raise _INTL("No room to deposit a Pokémon") end @@ -53,5 +53,5 @@ end end - raise _INTL("Can't find deposited Pokemon") + raise _INTL("Can't find deposited Pokémon") end @@ -102,7 +102,7 @@ def pbDayCareWithdraw(index) if !$PokemonGlobal.daycare[index][0] - raise _INTL("There's no Pokemon here...") + raise _INTL("There's no Pokémon here...") elsif $Trainer.party.length>=6 - raise _INTL("Can't store the Pokemon...") + raise _INTL("Can't store the Pokémon...") else $Trainer.party[$Trainer.party.length]=$PokemonGlobal.daycare[index][0] @@ -116,5 +116,5 @@ count=pbDayCareDeposited if count==0 - raise _INTL("There's no Pokemon here...") + raise _INTL("There's no Pokémon here...") elsif count==1 $game_variables[variable]=$PokemonGlobal.daycare[0][0] ? 0 : 1 Changed: PokemonPokedex --- Left +++ Right @@ -239,5 +239,5 @@ # -# Gets the region used for displaying Pokedex entries. +# Gets the region used for displaying Pokédex entries. # Species will be listed according to the given region's # numbering and the returned region can have any value @@ -283,7 +283,7 @@ # Suggestion for changing the background depending on region. You # can change the line below with the following: - if pbGetPokedexRegion()==-1 # Using national Pokedex + if pbGetPokedexRegion()==-1 # Using national Pokédex addBackgroundPlane(@sprites,"background","pokedexbg_national.png",@viewport) - elsif pbGetPokedexRegion()==0 # Using regional Pokedex + elsif pbGetPokedexRegion()==0 # Using regional Pokédex addBackgroundPlane(@sprites,"background","pokedexbg_regional.png",@viewport) end @@ -354,5 +354,5 @@ if regionalSpecies.length==1 # No regional species defined, - # use national Pokedex order + # use national Pokédex order for i in 1..PBSpecies.getCount regionalSpecies.push(i) @@ -505,18 +505,18 @@ ] helptexts=[ - _INTL("Search for Pokemon based on selected parameters."),[ - _INTL("List by the first letter in the name.\r\nSpotted Pokemon only."), - _INTL("List by body color.\r\nSpotted Pokemon only."), - _INTL("List by type.\r\nOwned Pokemon only."), - _INTL("List by type.\r\nOwned Pokemon only."), - _INTL("Select the Pokedex listing mode."), + _INTL("Search for Pokémon based on selected parameters."),[ + _INTL("List by the first letter in the name.\r\nSpotted Pokémon only."), + _INTL("List by body color.\r\nSpotted Pokémon only."), + _INTL("List by type.\r\nOwned Pokémon only."), + _INTL("List by type.\r\nOwned Pokémon only."), + _INTL("Select the Pokédex listing mode."), _INTL("Execute search."), ], - _INTL("Switch Pokedex listings."),[ - _INTL("Select the Pokedex listing mode."), + _INTL("Switch Pokédex listings."),[ + _INTL("Select the Pokédex listing mode."), _INTL("Execute switch."), ], - _INTL("Return to the Pokedex."),[ - _INTL("Return to the Pokedex.") + _INTL("Return to the Pokédex."),[ + _INTL("Return to the Pokédex.") ] ] @@ -568,6 +568,5 @@ pkmnbitmap,pkmnbitmap.rect) pkmnbitmap.dispose - pkmnwav=sprintf("Audio/SE/%03dCry",species) - Audio.se_play(pkmnwav,100,100) rescue nil + pbPlayCry(species) pbFadeInAndShow(@sprites) end @@ -616,6 +615,5 @@ break elsif Input.trigger?(Input::A) - pkmnwav=sprintf("Audio/SE/%03dCry",@dexlist[curindex][0]) - Audio.se_play(pkmnwav,100,100) rescue nil + pbPlayCry(@dexlist[curindex][0]) elsif Input.trigger?(Input::UP) nextindex=-1 @@ -700,10 +698,10 @@ ] @orderHelp=[ - _INTL("Pokemon are listed according to their number."), - _INTL("Spotted and owned Pokemon are listed alphabetically."), - _INTL("Owned Pokemon are listed from the heaviest to the lightest."), - _INTL("Owned Pokemon are listed from the lightest to the heaviest."), - _INTL("Owned Pokemon are listed from the tallest to the smallest."), - _INTL("Owned Pokemon are listed from the smallest to the tallest.") + _INTL("Pokémon are listed according to their number."), + _INTL("Spotted and owned Pokémon are listed alphabetically."), + _INTL("Owned Pokémon are listed from the heaviest to the lightest."), + _INTL("Owned Pokémon are listed from the lightest to the heaviest."), + _INTL("Owned Pokémon are listed from the tallest to the smallest."), + _INTL("Owned Pokémon are listed from the smallest to the tallest.") ] @sprites["searchlist"].index=1 @@ -747,5 +745,5 @@ dexlist=pbSearchDexList(params) if dexlist.length==0 - Kernel.pbMessage(_INTL("No matching Pokemon were found.")) + Kernel.pbMessage(_INTL("No matching Pokémon were found.")) else @dexlist=dexlist Changed: PokemonRoaming --- Left +++ Right @@ -10,6 +10,6 @@ module PokemonRoaming RoamingAreas={ -# Keys indicate the Pokemon's current map; -# Values indicate one or more maps that the Pokemon +# Keys indicate the Pokémon's current map; +# Values indicate one or more maps that the Pokémon # will move to # Example: Changed: PokeBattle_MoveEffects --- Left +++ Right @@ -1409,6 +1409,6 @@ next if attacker.pbIsOpposing?(i.index) activepkmn[activepkmn.length]=i.pokemonIndex - if @id==PBMoves::HEALBELL && i.ability==PBAbilities::SOUNDPROOF - @battle.pbDisplay(_INTL("{1}'s Soundproof blocks {2}!",i.pbThis,name)) + if @id==PBMoves::HEALBELL + @battle.pbDisplay(_INTL("{1}'s {2} blocks {3}!",i.pbThis,PBAbilities.getName(i.ability),name)) else i.status=0 @@ -1632,5 +1632,5 @@ end @battle.pbAnimation(@id,nil,nil) - @battle.pbDisplay(_INTL("All affected Pokemon will faint in three turns!")) + @battle.pbDisplay(_INTL("All affected Pokémon will faint in three turns!")) for i in 0..3 if @battle.battlers[i].effects[PBEffects::PerishSong]==0 Changed: PokeBattle_Move --- Left +++ Right @@ -173,5 +173,5 @@ def pbTargetsAll?(attacker) - if @target==0x08 # All opposing Pokemon + if @target==0x08 # All opposing Pokémon # TODO: should apply even if partner faints during an attack return attacker.pbOpposing1.hp>0 && attacker.pbOpposing2.hp>0 Changed: PBIntl --- Left +++ Right @@ -441,5 +441,8 @@ @messages=Marshal.load(f) } - raise "Corrupted data" if !@messages.is_a?(Array) + if !@messages.is_a?(Array) + @messages=nil + raise "Corrupted data" + end return @messages rescue Changed: Scene_Map --- Left +++ Right @@ -1,5 +1,5 @@ =begin -Modified Scene_Map class for Pokemon. +Modified Scene_Map class for Pokémon. =end Changed: PokeBattle_BattleRecord --- Left +++ Right @@ -6,5 +6,5 @@ Fight=0 Bag=1 - Pokemon=2 + Pokémon=2 Run=3 end @@ -86,5 +86,5 @@ def pbRegisterSwitch(i1,i2) if super - @rounds[@roundindex][i1]=[Commands::Pokemon,i2] + @rounds[@roundindex][i1]=[Commands::Pokémon,i2] return true end @@ -141,5 +141,5 @@ Fight=0 Bag=1 - Pokemon=2 + Pokémon=2 Run=3 end @@ -207,5 +207,5 @@ pbRegisterTarget(i,@rounds[@roundindex][i][2]) end - when Commands::Pokemon + when Commands::Pokémon pbRegisterSwitch(i,@rounds[@roundindex][i][1]) when Commands::Bag Changed: Pokegear --- Left +++ Right @@ -29,6 +29,6 @@ @command_window.x = (Graphics.width - @command_window.width) - 8 @command_window.y = 640 - @card = Sprite.new - @card.bitmap = RPG::Cache.picture("Pokegearback") + @card = GifSprite.new + @card.setBitmap("Graphics/Pictures/Pokegearback") @card.x = 0 @card.y = 0 Changed: PokemonField --- Left +++ Right @@ -29,4 +29,52 @@ end +def moveFromSymbol(item) + if item.is_a?(Symbol) || item.is_a?(String) + begin + return PBMoves.const_get(item.to_sym) + rescue + return nil + end + else + return item + end +end + +module HiddenMoveHandlers + @@canUseMove={} + @@useMove={} + def self.addCanUseMove(item,proc) + return if (item=moveFromSymbol(item))==nil + @@canUseMove[item]=proc + end + def self.addUseMove(item,proc) + return if (item=moveFromSymbol(item))==nil + @@useMove[item]=proc + end + def self.hasHandler(item) + return false if (item=moveFromSymbol(item))==nil + return @@canUseMove[item]!=nil && @@useMove[item]!=nil + end + def self.triggerCanUseMove(item,pokemon) + # Returns whether move can be used + return if (item=moveFromSymbol(item))==nil + if !@@canUseMove[item] + return false + else + return @@canUseMove[item].call(item,pokemon) + end + end + def self.triggerUseMove(item,pokemon) + # Returns whether move was used + return if (item=moveFromSymbol(item))==nil + if !@@useMove[item] + return false + else + return @@useMove[item].call(item,pokemon) + end + end +end + + module Events # This module stores events that can happen during @@ -84,8 +132,8 @@ @@OnWildBattleOverride end - # Triggers whenever a wild Pokemon battle ends + # Triggers whenever a wild Pokémon battle ends # Parameters: - # e[0] - Pokemon species - # e[1] - Pokemon level + # e[0] - Pokémon species + # e[1] - Pokémon level # e[2] - Battle result (1-win, 2-loss, 3-escaped, 4-caught) def self.onWildBattleEnd=(v) @@ -95,7 +143,7 @@ @@OnWildBattleEnd end - # Triggers whenever a wild Pokemon is created + # Triggers whenever a wild Pokémon is created # Parameters: - # e[0] - Pokemon being created + # e[0] - Pokémon being created def self.onWildPokemonCreate=(v) @@OnWildPokemonCreate=v @@ -678,5 +726,5 @@ end if pbAllFainted - Kernel.pbMessage(_INTL("{1} has no usable Pokemon!",$Trainer.name)) + Kernel.pbMessage(_INTL("{1} has no usable Pokémon!",$Trainer.name)) Kernel.pbMessage(_INTL("{1} whited out!",$Trainer.name)) $game_system.bgm_fade(1.0) @@ -1307,4 +1355,19 @@ endRecord("record.wav") wave=getWaveDataUI("record.wav",true) + if wave + Kernel.pbDisplayMessageFancy(msgwindow, + _INTL("PLAYING BACK..."),nil,0) + textwindow.update + msgwindow.update + Graphics.update + Input.update + wave.play + (Graphics.frame_rate*wave.time).to_i.times do + Graphics.update + Input.update + textwindow.update + msgwindow.update + end + end end Kernel.Audio_bgm_set_volume(oldvolume) @@ -1345,5 +1408,5 @@ rnd=rand(100) if rnd=0 if gameover - Kernel.pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]After the unfortunate defeat, {1} scurried to a Pokemon Center.",$Trainer.name)) + Kernel.pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]After the unfortunate defeat, {1} scurried to a Pokémon Center.",$Trainer.name)) else - Kernel.pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]{1} scurried to a Pokemon Center, protecting the exhausted and fainted Pokemon from further harm.",$Trainer.name)) + Kernel.pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]{1} scurried to a Pokémon Center, protecting the exhausted and fainted Pokémon from further harm.",$Trainer.name)) end Kernel.pbCancelVehicles @@ -1402,12 +1473,21 @@ $game_map.refresh else + homedata=pbGetMetadata(0,MetadataHome) + if (homedata && !pbRxdataExists?(sprintf("Data/Map%03d",homedata[0])) ) + if $DEBUG + Kernel.pbMessage(_ISPRINTF("Can't find the map 'Map{1:03d}' in the Data folder. The game will resume at the player's position.",homedata[0])) + end + for i in $Trainer.party + i.heal + end + return + end if gameover Kernel.pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]After the unfortunate defeat, {1} scurried home.",$Trainer.name)) else - Kernel.pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]{1} scurried home, protecting the exhausted and fainted Pokemon from further harm.",$Trainer.name)) + Kernel.pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]{1} scurried home, protecting the exhausted and fainted Pokémon from further harm.",$Trainer.name)) end - homedata=pbGetMetadata(0,MetadataHome) if homedata - Kernel.pbCancelVehicles + Kernel.pbCancelVehicles $game_switches[STARTING_OVER_SWITCH]=true $game_temp.player_new_map_id=homedata[0] @@ -1730,5 +1810,5 @@ movefinder=Kernel.pbCheckMove(PBMoves::HEADBUTT) if $DEBUG || movefinder - if Kernel.pbConfirmMessage(_INTL("A Pokemon could be in this tree. Want to headbutt it?")) + if Kernel.pbConfirmMessage(_INTL("A Pokémon could be in this tree. Want to headbutt it?")) speciesname=!movefinder ? PBSpecies.getName(0) : movefinder.name Kernel.pbMessage(_INTL("{1} did a headbutt!",speciesname)) @@ -1736,5 +1816,5 @@ end else - Kernel.pbMessage(_INTL("A Pokemon could be in this tree. Maybe a Pokemon could shake it.")) + Kernel.pbMessage(_INTL("A Pokémon could be in this tree. Maybe a Pokémon could shake it.")) end Input.update @@ -1754,8 +1834,8 @@ end else - Kernel.pbMessage(_INTL("It's a rugged rock, but a Pokemon may be able to smash it.")) + Kernel.pbMessage(_INTL("It's a rugged rock, but a Pokémon may be able to smash it.")) end else - Kernel.pbMessage(_INTL("It's a rugged rock, but a Pokemon may be able to smash it.")) + Kernel.pbMessage(_INTL("It's a rugged rock, but a Pokémon may be able to smash it.")) end return false @@ -1768,5 +1848,5 @@ movefinder=Kernel.pbCheckMove(PBMoves::STRENGTH) if $DEBUG || movefinder - Kernel.pbMessage(_INTL("It's a big boulder, but a Pokemon may be able to push it aside.")) + Kernel.pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside.")) if Kernel.pbConfirmMessage(_INTL("Would you like to use Strength?")) speciesname=!movefinder ? PBSpecies.getName(0) : movefinder.name @@ -1778,8 +1858,8 @@ end else - Kernel.pbMessage(_INTL("It's a big boulder, but a Pokemon may be able to push it aside.")) + Kernel.pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside.")) end else - Kernel.pbMessage(_INTL("It's a big boulder, but a Pokemon may be able to push it aside.")) + Kernel.pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside.")) end return false @@ -1853,5 +1933,5 @@ end else - raise _INTL("Can't find Pokemon with Dive...") + raise _INTL("Can't find Pokémon with Dive...") end return false @@ -1967,8 +2047,8 @@ end else - Kernel.pbMessage(_INTL("The sea is deep here. A Pokemon may be able to go underwater.")) + Kernel.pbMessage(_INTL("The sea is deep here. A Pokémon may be able to go underwater.")) end else - Kernel.pbMessage(_INTL("The sea is deep here. A Pokemon may be able to go underwater.")) + Kernel.pbMessage(_INTL("The sea is deep here. A Pokémon may be able to go underwater.")) end return false @@ -2243,4 +2323,6 @@ when PBMoves::SWEETSCENT return true + else + return HiddenMoveHandlers.triggerCanUseMove(move,pkmn) end return false @@ -2411,4 +2493,6 @@ end return false + else + return HiddenMoveHandlers.triggerUseMove(move,pokemon) end end Changed: PokemonSave --- Left +++ Right @@ -111,5 +111,5 @@ Kernel.pbMessage(_INTL("WARNING!")) Kernel.pbMessage(_INTL("There is a different game file that is already saved.")) - Kernel.pbMessage(_INTL("If you save now, the other file's adventure, including items and Pokemon, will be entirely lost.")) + Kernel.pbMessage(_INTL("If you save now, the other file's adventure, including items and Pokémon, will be entirely lost.")) confirm=_INTL("Are you sure you want to save now and overwrite the other save file?") else Changed: PokemonNetwork --- Left +++ Right @@ -1172,5 +1172,5 @@ pbHideStatus Kernel.pbMessage(_INTL("The trade ended successfully.")) - # Evolution of traded Pokemon if applicable + # Evolution of traded Pokémon if applicable newspecies=pbTradeCheckEvolution($Trainer.party[otherChoice]) Network.messageproc=Proc.new {|msgid,s,recipient,data| Changed: PokemonMart --- Left +++ Right @@ -453,5 +453,5 @@ $Trainer.money=0 if $Trainer.money<0 pbDisplayPaused(_INTL("Here you are!\r\nThank you!")) - if quantity>=10 && isConst?(item,PBItems,:POKeBALL) && hasConst?(PBItems,:PREMIERBALL) + if quantity>=10 && isConst?(item,PBItems,:POKéBALL) && hasConst?(PBItems,:PREMIERBALL) if $PokemonBag.pbStoreItem(PBItems::PREMIERBALL) pbDisplayPaused(_INTL("I'll throw in a Premier Ball, too.")) Changed: PokeBattle_ActualScene --- Left +++ Right @@ -3,5 +3,5 @@ - def pbChooseNewEnemy(index,party) -Use this method to choose a new Pokemon for the enemy +Use this method to choose a new Pokémon for the enemy The enemy's party is guaranteed to have at least one choosable member. @@ -11,5 +11,5 @@ - def pbWildBattleSuccess -This method is called when the player wins a wild Pokemon battle. +This method is called when the player wins a wild Pokémon battle. This method can change the battle's music for example. @@ -19,6 +19,6 @@ - def pbFainted(pkmn) -This method is called whenever a Pokemon faints. -pkmn - PokeBattle_Battler object indicating the Pokemon that fainted +This method is called whenever a Pokémon faints. +pkmn - PokeBattle_Battler object indicating the Pokémon that fainted - def pbChooseEnemyCommand(index) @@ -34,5 +34,5 @@ Return values: 0 - Fight -1 - Pokemon +1 - Pokémon 2 - Bag 3 - Run @@ -384,5 +384,5 @@ @frame+=1 @updating=true - if ((@frame/9).floor&1)==1 && @selected==1 # When choosing commands for this Pokemon + if ((@frame/9).floor&1)==1 && @selected==1 # When choosing commands for this Pokémon self.x=@spriteX self.y=@spriteY+2 @@ -475,5 +475,5 @@ @statusCX=64 @statusY=28 - if (@battler.index&1)==0 # if player's Pokemon + if (@battler.index&1)==0 # if player's Pokémon @spritebaseX=16 else @@ -567,5 +567,5 @@ self.visible=true self.opacity=255 - if (@battler.index&1)==0 # if player's Pokemon + if (@battler.index&1)==0 # if player's Pokémon self.x=@spriteX+320 else @@ -670,5 +670,5 @@ end if @appearing - if (@battler.index&1)==0 # if player's Pokemon + if (@battler.index&1)==0 # if player's Pokémon self.x-=8 @appearing=false if self.x<=@spriteX @@ -680,5 +680,5 @@ return end - if ((@frame/10).floor&1)==1 && @selected==1 # When choosing commands for this Pokemon + if ((@frame/10).floor&1)==1 && @selected==1 # When choosing commands for this Pokémon self.x=@spriteX self.y=@spriteY+2 @@ -758,6 +758,5 @@ @pokemonsprite.zoom_y=STARTZOOM pbSpriteSetCenter(@pokemonsprite,@spritex,@spritey) - pkmnwav=sprintf("Audio/SE/%03dCry",@pkmn.species) - Audio.se_play(pkmnwav,100,(@pkmn.hp*25/@pkmn.totalhp)+75) rescue nil + pbPlayCry(@pkmn.pokemon ? @pkmn.pokemon : @pkmn.species) end if @frame==8 @@ -925,6 +924,5 @@ Audio.se_play("Audio/SE/recall.wav") pbSpriteSetCenter(@pokemonsprite,@spritex,@spritey) - pkmnwav=sprintf("Audio/SE/%03dCry",@pkmn.species) - Audio.se_play(pkmnwav,100,(@pkmn.hp*25/@pkmn.totalhp)+75) rescue nil + pbPlayCry(@pkmn.pokemon ? @pkmn.pokemon : @pkmn.species) end if @frame>8 && @frame<=16 @@ -1125,5 +1123,5 @@ @messagemode=mode msgwindow=@sprites["messagewindow"] - if mode # Within Pokemon command + if mode # Within Pokémon command msgwindow.baseColor=MENUBASECOLOR msgwindow.shadowColor=MENUSHADOWCOLOR @@ -1283,7 +1281,7 @@ def pbAddSprite(id,x,y,filename,viewport) - sprite=Sprite.new(viewport) + sprite=GifSprite.new(nil,viewport) if filename - sprite.bitmap=BitmapCache.load_bitmap(filename) rescue sprite.bitmap=nil + sprite.setBitmap(filename) rescue sprite.bitmap=nil end sprite.x=x @@ -1297,7 +1295,7 @@ def pbAddPlane(id,filename,viewport) - sprite=Plane.new(viewport) + sprite=AnimatedPlane.new(viewport) if filename - sprite.bitmap=BitmapCache.load_bitmap(filename) + sprite.setBitmap(filename) end @sprites[id]=sprite @@ -1840,5 +1838,5 @@ def pbForgetMove(pokemon,moveToLearn) -# Called whenever a Pokemon should forget a move. It +# Called whenever a Pokémon should forget a move. It # should return -1 if the selection is canceled, or 0 to 3 # to indicate the move to forget. The function should not @@ -1912,5 +1910,5 @@ # Return values: # 0 - Fight -# 1 - Pokemon +# 1 - Pokémon # 2 - Bag # 3 - Run @@ -1938,5 +1936,5 @@ def pbFightMenu(index) -# Use this method to display the list of moves for a Pokemon +# Use this method to display the list of moves for a Pokémon pbShowWindow(FIGHTBOX) cw = @sprites["fightwindow"] @@ -2001,5 +1999,5 @@ pkmnscreen=PokemonScreen.new(pkmnlist,@battle.party1) itemscene.pbEndScene - pkmnlist.pbStartScene(@battle.party1,_INTL("Use on which Pokemon?")) + pkmnlist.pbStartScene(@battle.party1,_INTL("Use on which Pokémon?")) pkmnid=pkmnlist.pbChoosePokemon if pkmnid>=0 && @battle.pbUseItemOnPokemon(item,pkmnid,pkmnscreen) @@ -2150,5 +2148,5 @@ partypos[1]=battler.pokemonIndex end - # Add all non-active Pokemon + # Add all non-active Pokémon for i in 0...6 partypos[partypos.length]=i if inactives[i]==1 @@ -2160,8 +2158,8 @@ scene=PokemonScreen_Scene.new @switchscreen=PokemonScreen.new(scene,modparty) - @switchscreen.pbStartScene(_INTL("Choose a Pokemon."), + @switchscreen.pbStartScene(_INTL("Choose a Pokémon."), @battle.doublebattle && !@battle.fullparty1) loop do - scene.pbSetHelpText(_INTL("Choose a Pokemon.")) + scene.pbSetHelpText(_INTL("Choose a Pokémon.")) activecmd=@switchscreen.pbChoosePokemon if cancancel && activecmd==-1 @@ -2230,5 +2228,5 @@ def pbHPChanged(pkmn,oldhp) -# This method is called whenever a Pokemon's HP changes. +# This method is called whenever a Pokémon's HP changes. # Used to animate the HP bar. @briefmessage=false @@ -2250,7 +2248,6 @@ def pbFainted(pkmn) -# This method is called whenever a Pokemon faints - pkmnsnd=sprintf("Audio/SE/%03dCry",pkmn.species) - Audio.se_play(pkmnsnd,90,75) rescue nil +# This method is called whenever a Pokémon faints + pbPlayCry(pkmn.pokemon) 30.times do pbGraphicsUpdate @@ -2300,5 +2297,5 @@ def pbChooseNewEnemy(index,party) -# Use this method to choose a new Pokemon for the enemy +# Use this method to choose a new Pokémon for the enemy # The enemy's party is guaranteed to have at least one choosable member. for i in 0..party.length-1 @@ -2309,5 +2306,5 @@ def pbWildBattleSuccess -# This method is called when the player wins a wild Pokemon battle. +# This method is called when the player wins a wild Pokémon battle. # This method can change the battle's music for example. $game_system.bgm_play(pbGetWildVictoryME()) Changed: Shadow --- Left +++ Right @@ -2,5 +2,5 @@ # Sprite_Shadow (Sprite_Ombre ) # Based on Genzai Kawakami's shadows, dynamisme&features by Rataime, extra features Boushy -# Modified by Peter O. to be compatible with Pokemon Essentials +# Modified by Peter O. to be compatible with Pokémon Essentials #============================================================================== CATERPILLAR_COMPATIBLE = true Changed: PokemonTrainers --- Left +++ Right @@ -127,7 +127,7 @@ for i in 1..6 if i==1 - Kernel.pbMessage(_INTL("Please enter the first Pokemon.",i)) + Kernel.pbMessage(_INTL("Please enter the first Pokémon.",i)) else - if !Kernel.pbConfirmMessage(_INTL("Add another Pokemon?")) + if !Kernel.pbConfirmMessage(_INTL("Add another Pokémon?")) break end @@ -415,8 +415,8 @@ if false if $PokemonTemp.waitingTrainer[0][2].length>3 - raise _INTL("Opponent 1's party has more than three Pokemon, which is not allowed") + raise _INTL("Opponent 1's party has more than three Pokémon, which is not allowed") end if trainer[2].length>3 - raise _INTL("Opponent 2's party has more than three Pokemon, which is not allowed") + raise _INTL("Opponent 2's party has more than three Pokémon, which is not allowed") end elsif $PokemonTemp.waitingTrainer[0][2].length>3 || trainer[2].length>3 Changed: PokemonRadar --- Left +++ Right @@ -199,9 +199,9 @@ # -ItemHandlers.addUseInField(:POKeRADAR, proc { +ItemHandlers.addUseInField(:POKéRADAR, proc { next pbUsePokeRadar }) -ItemHandlers.addUseFromBag(:POKeRADAR, proc { +ItemHandlers.addUseFromBag(:POKéRADAR, proc { next pbCanUsePokeRadar? ? 2 : 0 }) Changed: PokeBattle_Trainer --- Left +++ Right @@ -14,5 +14,5 @@ attr_accessor(:owned) attr_accessor(:party) -attr_accessor(:pokedex) # Whether the Pokedex was obtained +attr_accessor(:pokedex) # Whether the Pokédex was obtained attr_accessor(:pokegear) @@ -79,5 +79,5 @@ end -def pokedexSeen # Number of Pokemon seen +def pokedexSeen # Number of Pokémon seen ret=0 for i in 0..PBSpecies.getCount @@ -87,5 +87,5 @@ end -def pokedexOwned # Number of Pokemon owned +def pokedexOwned # Number of Pokémon owned ret=0 for i in 0..PBSpecies.getCount Changed: Transitions --- Left +++ Right @@ -16,5 +16,11 @@ filename="" end - transition_KGC_SpecialTransition(duration, filename, vague) + begin + transition_KGC_SpecialTransition(duration, filename, vague) + rescue Exception + if filename!="" + transition_KGC_SpecialTransition(duration, "", vague) + end + end if STOP_WHILE_TRANSITION && !@_interrupt_transition while @@transition && !@@transition.disposed? Changed: PokeBattle_SafariZone --- Left +++ Right @@ -101,5 +101,5 @@ when 0 # Ball if pbBoxesFull? - pbDisplay(_INTL("The boxes are full! You can't catch any more Pokemon!")) + pbDisplay(_INTL("The boxes are full! You can't catch any more Pokémon!")) next end Changed: PokemonLoad --- Left +++ Right @@ -36,4 +36,5 @@ @sprites["cmdwindow"].update @sprites["locwindow"].update + @sprites["clrvp"].update if Input.trigger?(Input::C) return @sprites["cmdwindow"].index Changed: Main --- Left +++ Right @@ -19,4 +19,8 @@ return Scene_DebugIntro.new else + # First parameter is an array of images in the Titles + # directory without a file extension, to show before the + # actual title screen. Second parameter is the actual + # title screen filename, also in Titles with no extension. return Scene_Intro.new(['Pic_1'], 'Pic_2') end Changed: BitmapCache --- Left +++ Right @@ -169,5 +169,5 @@ def self.load_bitmap(folder_name, filename, hue = 0) cached=true - path = folder_name + filename + path = folder_name + filename.to_s path=canonicalize(path) objPath=fromCache(path) Changed: Compiler --- Left +++ Right @@ -532,7 +532,9 @@ def pbCompileBattlePokemon btpokemon=[] + if File.exists?("PBS/btpokemon.txt") pbCompilerEachCommentedLine("PBS/btpokemon.txt"){|line,lineno| btpokemon.push(PBPokemon.fromInspected(line)) } + end save_data(btpokemon,"Data/btpokemon.dat") end @@ -549,19 +551,21 @@ "PokemonNos"=>[5,"*u"] } - File.open("PBS/bttrainers.txt","rb"){|f| - FileLineData.file="PBS/bttrainers.txt" - pbEachFileSectionEx(f){|section,name| - next if name!="Trainer" - rsection=[] - for key in section.keys - FileLineData.setSection(name,key,section[key]) - schema=requiredtypes[key] - next if !schema - record=pbGetCsvRecord(section[key],0,schema) - rsection[schema[0]]=record - end - sections.push(rsection) + if File.exists?("PBS/bttrainers.txt") + File.open("PBS/bttrainers.txt","rb"){|f| + FileLineData.file="PBS/bttrainers.txt" + pbEachFileSectionEx(f){|section,name| + next if name!="Trainer" + rsection=[] + for key in section.keys + FileLineData.setSection(name,key,section[key]) + schema=requiredtypes[key] + next if !schema + record=pbGetCsvRecord(section[key],0,schema) + rsection[schema[0]]=record + end + sections.push(rsection) + } } - } + end save_data(sections,"Data/bttrainers.dat") end @@ -999,4 +1003,28 @@ end +class PBMoveDataOld + attr_reader :function,:basedamage,:type,:accuracy + attr_reader :totalpp,:addlEffect,:target,:priority + attr_reader :flags + attr_reader :contestType,:category + def initialize(moveid) + movedata=pbRgssOpen("Data/rsattacks.dat") + movedata.pos=moveid*9 + @function=movedata.fgetb + @basedamage=movedata.fgetb + @type=movedata.fgetb + @accuracy=movedata.fgetb + @totalpp=movedata.fgetb + @addlEffect=movedata.fgetb + @target=movedata.fgetb + @priority=movedata.fgetsb + @flags=movedata.fgetb + movedata.close + end + def category + return 2 if @basedamage==0 + return @type<10 ? 0 : 1 + end +end def pbCompileMoves @@ -1005,9 +1033,47 @@ movedescs=[] movedata=[] +haveRsAttacks=pbRgssExists?("Data/rsattacks.dat") pbCompilerEachPreppedLine("PBS/moves.txt"){|line,lineno| - record=pbGetCsvRecord(line,lineno,[0,"unsxueeuuuxises", - nil,nil,nil,nil,nil,PBTypes,["Physical","Special","Status"], - nil,nil,nil,nil,nil,nil,["Cool","Beauty","Cute","Smart","Tough"],nil - ]) + thisline=line.clone + record=[] + flags=0 + begin + record=pbGetCsvRecord(line,lineno,[0,"unsxueeuuuxises", + nil,nil,nil,nil,nil,PBTypes,["Physical","Special","Status"], + nil,nil,nil,nil,nil,nil,["Cool","Beauty","Cute","Smart","Tough"],nil + ]) + pbCheckWord(record[3],_INTL("Function code")) + flags|=1 if record[12][/a/] + flags|=2 if record[12][/b/] + flags|=4 if record[12][/c/] + flags|=8 if record[12][/d/] + flags|=16 if record[12][/e/] + flags|=32 if record[12][/f/] + rescue + oldmessage=$!.message + raise if !haveRsAttacks + begin + oldrecord=pbGetCsvRecord(thisline,lineno,[0,"unss", + nil,nil,nil,nil + ]) + rescue + raise $!.message+"\r\n"+oldmessage + end + oldmovedata=PBMoveDataOld.new(oldrecord[0]) + flags=oldmovedata.flags + record=[oldrecord[0],oldrecord[1],oldrecord[2], + oldmovedata.function, + oldmovedata.basedamage, + oldmovedata.type, + oldmovedata.category, + oldmovedata.accuracy, + oldmovedata.totalpp, + oldmovedata.addlEffect, + oldmovedata.target, + oldmovedata.priority, + oldmovedata.flags, + 0, # No contest type defined + oldrecord[3]] + end pbCheckWord(record[3],_INTL("Function code")) pbCheckByte(record[4],_INTL("Base damage")) @@ -1016,5 +1082,6 @@ end if record[6]!=2 && record[4]==0 - print _INTL("Warning: Physical and special moves can't have a base damage of 0, changing to a Status move\r\n{1}",FileLineData.linereport) + print _INTL( + "Warning: Physical and special moves can't have a base damage of 0, changing to a Status move\r\n{1}",FileLineData.linereport) record[6]=2 end @@ -1024,11 +1091,4 @@ pbCheckWord(record[10],_INTL("Target")) pbCheckSignedByte(record[11],_INTL("Priority")) - flags=0 - flags|=1 if record[12][/a/] - flags|=2 if record[12][/b/] - flags|=4 if record[12][/c/] - flags|=8 if record[12][/d/] - flags|=16 if record[12][/e/] - flags|=32 if record[12][/f/] movedata[record[0]]=[ record[3], @@ -1061,5 +1121,7 @@ end code+="\r\ndef self.getName(id)\r\nreturn pbGetMessage(MessageTypes::Moves,id)\r\nend" -code+="\r\ndef self.getCount\r\nreturn #{records.length}\r\nend\r\nend" +code+="\r\ndef self.getCount\r\nreturn #{records.length}\r\nend" +maxID=movedata.length-1 +code+="\r\ndef self.getMaximumID\r\nreturn #{maxID}\r\nend\r\nend" eval(code) pbAddScript(code,"PBMoves") @@ -1223,10 +1285,10 @@ itemsize=9 # Trainer name, name offset, namelength, party ID items[0].gsub!(/^\s+/,"") - raise _INTL("Expected a number for the number of Pokemon\r\n{1}",FileLineData.linereport) if !items[0][/^\d+$/] + raise _INTL("Expected a number for the number of Pokémon\r\n{1}",FileLineData.linereport) if !items[0][/^\d+$/] numpoke=items[0].to_i - itemsize+=2 # Number of Pokemon, num. of items + itemsize+=2 # Number of Pokémon, num. of items raise _INTL("Too many items (max. 4)\r\n{1}",FileLineData.linereport) if items.length>5 realitems=[] - for j in 1...items.length # Number of Pokemon and items held by Trainer + for j in 1...items.length # Number of Pokémon and items held by Trainer realitems.push(parseItem(items[j])) itemsize+=2 @@ -2209,5 +2271,5 @@ if !lastsection["Type2"] || lastsection["Type2"]=="" if !lastsection["Type1"] || lastsection["Type1"]=="" - raise _INTL("No Pokemon type is defined in section {2} (PBS/pokemon.txt)",key,sectionDisplay) if hash==requiredtypes + raise _INTL("No Pokémon type is defined in section {2} (PBS/pokemon.txt)",key,sectionDisplay) if hash==requiredtypes next end @@ -2266,5 +2328,5 @@ thesemoves.push(value) elsif key=="RegionalNumbers" - raise _INTL("Regional Pokedex number cannot be 0 (section {2}, PBS/pokemon.txt)",currentmap) if value==0 + raise _INTL("Regional Pokédex number cannot be 0 (section {2}, PBS/pokemon.txt)",currentmap) if value==0 regionals[valueindex]=[] if !regionals[valueindex] regionals[valueindex][currentmap]=value @@ -2315,5 +2377,5 @@ } if dexdatas.length==0 - raise _INTL("No Pokemon species are defined in pokemon.txt") + raise _INTL("No Pokémon species are defined in pokemon.txt") end code="module PBSpecies\r\n#{constants}" @@ -2880,4 +2942,16 @@ while i0 && + attacker.species==PBSpecies::CHATOT && + !attacker.effects[PBEffects::Transform] && + attacker.pokemon && + opponent.ability!=PBAbilities::SHIELDDUST && + opponent.hp>0 + chance=1 + if attacker.pokemon.chatter + chance=attacker.pokemon.chatter.intensity*30/127 + chance+=1 + end + if rand(100)b[1]} @@ -511,5 +513,5 @@ end -# Displays a sorted list of Pokemon species, and returns the ID of the species +# Displays a sorted list of Pokémon species, and returns the ID of the species # selected or 0 if the selection was canceled. # defaultMoveID, if specified, indicates the ID of the species @@ -699,9 +701,9 @@ end def pbEncounterEditorDensity(enc) - enc[0][EncounterTypes::Land]=Kernel.pbMessageChooseNumber(_INTL("Set the density of Pokemon on land (default 25)."), + enc[0][EncounterTypes::Land]=Kernel.pbMessageChooseNumber(_INTL("Set the density of Pokémon on land (default 25)."), enc[0][EncounterTypes::Land],2) - enc[0][EncounterTypes::Cave]=Kernel.pbMessageChooseNumber(_INTL("Set the density of Pokemon in caves (default 10)."), + enc[0][EncounterTypes::Cave]=Kernel.pbMessageChooseNumber(_INTL("Set the density of Pokémon in caves (default 10)."), enc[0][EncounterTypes::Cave],2) - enc[0][EncounterTypes::Water]=Kernel.pbMessageChooseNumber(_INTL("Set the density of Pokemon on water (default 10)."), + enc[0][EncounterTypes::Water]=Kernel.pbMessageChooseNumber(_INTL("Set the density of Pokémon on water (default 10)."), enc[0][EncounterTypes::Water],2) enc[0][EncounterTypes::LandMorning]=enc[0][EncounterTypes::Land] @@ -1895,6 +1897,5 @@ @dragOffsetY=0 @selmapid=-1 - @sprites["bg"]=Plane.new(@viewport) - @sprites["bg"].bitmap=BitmapCache.load_bitmap("Graphics/Pictures/trcardbg.png") + addBackgroundPlane(@sprites,"background","trcardbg",@viewport) @sprites["selsprite"]=SelectionSprite.new(@viewport) @sprites["title"]=Window_UnformattedTextPokemon.new(_INTL("F5: Help")) @@ -1989,5 +1990,5 @@ _INTL("If true, the bicycle will be mounted automatically on this map.")], ["HealingSpot",MapCoordsProperty, - _INTL("Map ID and X and Y coordinates of this map's entrance. Use only if this map is a Pokemon Center, etc.")], + _INTL("Map ID and X and Y coordinates of this map's entrance. Use only if this map is a Pokémon Center, etc.")], ["Weather",WeatherEffectProperty, _INTL("Weather conditions in effect for this map.")], @@ -2003,5 +2004,5 @@ GLOBALMETADATA=[ ["Home",MapCoordsFacingProperty, - _INTL("Map ID and X and Y coordinates of where the player goes if no Pokemon Center was entered after a loss.")], + _INTL("Map ID and X and Y coordinates of where the player goes if no Pokémon Center was entered after a loss.")], ["PlayerA",PlayerProperty, _INTL("Specifies player A.")], @@ -2013,11 +2014,11 @@ _INTL("Specifies player D.")], ["StorageCreator",StringProperty, - _INTL("Creator of the Pokemon Storage System.")], + _INTL("Creator of the Pokémon Storage System.")], ["WildBattleBGM",BGMProperty, - _INTL("Default BGM for wild Pokemon battles.")], + _INTL("Default BGM for wild Pokémon battles.")], ["TrainerBattleBGM",BGMProperty, _INTL("Default BGM for trainer battles.")], ["WildVictoryME",MEProperty, - _INTL("Default ME played after winning a wild Pokemon battle.")], + _INTL("Default ME played after winning a wild Pokémon battle.")], ["TrainerVictoryME",MEProperty, _INTL("Default ME played after winning a Trainer battle.")], @@ -2416,5 +2417,5 @@ @ids.clear if @includeNew - @commands.push(_ISPRINTF("[NEW POKeMON]")) + @commands.push(_ISPRINTF("[NEW POKéMON]")) @ids.push(-1) end @@ -2472,11 +2473,11 @@ properties=[ [_INTL("Species"),SpeciesProperty, - _INTL("Species of this Pokemon.")], + _INTL("Species of this Pokémon.")], [_INTL("Level"),LimitProperty.new(PBExperience::MAXLEVEL), - _INTL("Level of the Pokemon.")], + _INTL("Level of the Pokémon.")], [_INTL("IVs"),LimitProperty.new(31), - _INTL("Individual values of each of the Pokemon's stats.")], + _INTL("Individual values of each of the Pokémon's stats.")], [_INTL("Held item"),ItemProperty, - _INTL("Item held by the Pokemon.")], + _INTL("Item held by the Pokémon.")], [_INTL("Move 1"),MoveProperty2.new(oldsetting), _INTL("First move. Leave all moves blank (use Z key) to give it a wild move set.")], @@ -2611,6 +2612,8 @@ end commands2=[] - for i in 1..PBMoves.getCount - commands2.push([i,PBMoves.getName(i)]) + for i in 1..PBMoves.getMaximumID + if PBMoves.getName(i)!=nil && PBMoves.getName(i)!="" + commands2.push([i,PBMoves.getName(i)]) + end end commands2.sort! {|a,b| a[1]<=>b[1]} @@ -2645,16 +2648,16 @@ [_INTL("Battle ID"),LimitProperty.new(255), _INTL("ID used to distinguish Trainers with the same name and trainer type")], - [_INTL("Pokemon 1"),TrainerPokemonProperty, - _INTL("First Pokemon.")], - [_INTL("Pokemon 2"),TrainerPokemonProperty, - _INTL("Second Pokemon.")], - [_INTL("Pokemon 3"),TrainerPokemonProperty, - _INTL("Third Pokemon.")], - [_INTL("Pokemon 4"),TrainerPokemonProperty, - _INTL("Fourth Pokemon.")], - [_INTL("Pokemon 5"),TrainerPokemonProperty, - _INTL("Fifth Pokemon.")], - [_INTL("Pokemon 6"),TrainerPokemonProperty, - _INTL("Sixth Pokemon.")], + [_INTL("Pokémon 1"),TrainerPokemonProperty, + _INTL("First Pokémon.")], + [_INTL("Pokémon 2"),TrainerPokemonProperty, + _INTL("Second Pokémon.")], + [_INTL("Pokémon 3"),TrainerPokemonProperty, + _INTL("Third Pokémon.")], + [_INTL("Pokémon 4"),TrainerPokemonProperty, + _INTL("Fourth Pokémon.")], + [_INTL("Pokémon 5"),TrainerPokemonProperty, + _INTL("Fifth Pokémon.")], + [_INTL("Pokémon 6"),TrainerPokemonProperty, + _INTL("Sixth Pokémon.")], [_INTL("Item 1"),ItemProperty, _INTL("Item used by the trainer during battle.")], @@ -2766,5 +2769,5 @@ ] if trainerdata[3].length==0 - Kernel.pbMessage(_INTL("Can't save. The Pokemon list is empty.")) + Kernel.pbMessage(_INTL("Can't save. The Pokémon list is empty.")) elsif !trainerdata[1] || trainerdata[1].length==0 Kernel.pbMessage(_INTL("Can't save. No name was entered.")) @@ -2793,15 +2796,15 @@ trainerTypes=[ ["Name",LimitStringProperty.new(10), - _INTL("Name of the Pokemon.")], + _INTL("Name of the Pokémon.")], ["InternalName",ReadOnlyProperty, - _INTL("Internal name of the Pokemon.")], + _INTL("Internal name of the Pokémon.")], ["Kind",LimitStringProperty.new(12), - _INTL("Kind of Pokemon species.")], - ["Pokedex",StringProperty, - _INTL("Description of the Pokemon as displayed in the Pokedex.")], + _INTL("Kind of Pokémon species.")], + ["Pokédex",StringProperty, + _INTL("Description of the Pokémon as displayed in the Pokédex.")], ["Type1",TypeProperty, - _INTL("Pokemon's type. If same as type 2, this Pokemon has a single type.")], + _INTL("Pokémon's type. If same as type 2, this Pokémon has a single type.")], ["Type2",TypeProperty, - _INTL("Pokemon's type. If same as type 1, this Pokemon has a single type.")], + _INTL("Pokémon's type. If same as type 1, this Pokémon has a single type.")], ["BaseHP",LimitProperty.new(255), _INTL("Base HP.")], @@ -2819,5 +2822,5 @@ _INTL("Yellow"),_INTL("Green"),_INTL("Black"),_INTL("Brown"), _INTL("Purple"),_INTL("Gray"),_INTL("White"),_INTL("Pink")]), - _INTL("Pokemon's body color.")], + _INTL("Pokémon's body color.")], ["Compat1",EnumProperty.new([ "Undefined","Monster","Water1","Bug","Flying", @@ -2831,7 +2834,7 @@ _INTL("Compatibility group (egg group) for breeding purposes.")], ["WildItemCommon",ItemProperty, - _INTL("Item commonly held by wild Pokemon of this species.")], + _INTL("Item commonly held by wild Pokémon of this species.")], ["WildItemRare",ItemProperty, - _INTL("Item rarely held by wild Pokemon of this species.")], + _INTL("Item rarely held by wild Pokémon of this species.")], ["EffortHP",LimitProperty.new(3), _INTL("HP effort values earned when this species is defeated.")], @@ -2848,5 +2851,5 @@ ] messages=Messages.new("Data/messages.dat") - pbListScreenBlock(_INTL("Pokemon"),PokemonLister.new(selection,true)){|button,trtype| + pbListScreenBlock(_INTL("Pokémon"),PokemonLister.new(selection,true)){|button,trtype| if trtype if button==Input::A @@ -2854,5 +2857,5 @@ selection=trtype if selection<0 - Kernel.pbMessage("New Pokemon would be created here.") + Kernel.pbMessage("New Pokémon would be created here.") # newid=pbTrainerTypeEditorNew(nil) # if newid>=0 @@ -2899,5 +2902,5 @@ _INTL("Name of the trainer type as displayed by the game.")], [_INTL("Money per level"),LimitProperty.new(255), - _INTL("Player earns this amount times the highest level among the trainer type's Pokemon.")], + _INTL("Player earns this amount times the highest level among the trainer type's Pokémon.")], [_INTL("Battle BGM"),BGMProperty, _INTL("BGM played in battles against trainers of this type.")], Changed: SpriteWindow --- Left +++ Right @@ -23,4 +23,295 @@ ############################# +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 AnimatedBitmap + def initialize(file,hue=0) + if file[/^\[(\d+)\]/] + @bitmap=PngAnimatedBitmap.new(file,hue) + else + @bitmap=GifBitmap.new(file,hue) + end + end + def [](index); @bitmap[index]; end + def length; @bitmap.length; end + def each; @bitmap.each { yield }; end + def bitmap; @bitmap.bitmap; end + def currentIndex; @bitmap.currentIndex; end + def frameDelay; @bitmap.frameDelay; end + def totalFrames; @bitmap.totalFrames; end + def disposed?; @bitmap.disposed?; end + def update; @bitmap.update; end + def dispose; @bitmap.dispose; end +end + +class PngAnimatedBitmap + # Creates an animated bitmap from a PNG file. + def initialize(file,hue=0) + @frames=[] + @currentFrame=0 + @framecount=0 + panorama=BitmapCache.load_bitmap(file,hue) + if file[/^\[(\d+)\]/] + # File has a frame count + numFrames=$1.to_i + if numFrames<=0 + raise "Invalid frame count in #{file}" + end + if panorama.width % numFrames != 0 + raise "Bitmap's width (#{panorama.width}) is not divisible by frame count: #{file}" + end + subWidth=panorama.width/numFrames + for i in 0...numFrames + subBitmap=Bitmap.new(subWidth,panorama.height) + subBitmap.blt(0,0,panorama,Rect.new(subWidth*i,0,subWidth,panorama.height)) + @frames.push(subBitmap) + end + panorama.dispose + else + @frames=[panorama] + self.bitmap=@frames[0] + end + end + def [](index) + return @frames[index] + end + def bitmap + @gifbitmaps[@currentFrame] + end + def currentIndex + @currentFrame + end + def frameDelay(index) + return 10 + end + def length + @frames.length + end + def each + @frames.each { yield } + end + def totalFrames + 10*@frames.length + end + def disposed? + @disposed + end + def update + return if disposed? + if @frames.length>1 + @framecount+=1 + if @framecount>=10 + @framecount=0 + @currentFrame+=1 + @currentFrame%=@frames.length + end + end + end + def dispose + for i in @frames + i.dispose + end + @disposed=true + end +end + +class GifBitmap + # Creates a bitmap from a GIF file with the specified + # optional viewport. Can also load non-animated bitmaps. + def initialize(file,hue=0) + @gifbitmaps=[] + @gifdelays=[] + @totalframes=0 + @framecount=0 + @currentIndex=0 + @disposed=false + bitmap=nil + filestring=pbGetFileString(file) + filestring=pbGetFileString(file+".gif") if !filestring + filestring=pbGetFileString(file+".png") if !filestring + filestring=pbGetFileString(file+".jpg") if !filestring + filestring=pbGetFileString(file+".bmp") if !filestring + if filestring && filestring[0]!=0x47 + begin + bitmap=BitmapCache.load_bitmap(file) + rescue + bitmap=nil + end + end + if bitmap + # Have a regular non-animated bitmap + @totalframes=1 + @framecount=0 + @gifbitmaps=[bitmap] + @gifdelays=[1] + else + 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(32,32)) + end + end + end + if @gifbitmaps.length==0 + @gifbitmaps=[Bitmap.new(32,32)] + @gifdelays=[1] + end + end + end + def [](index) + return @gifbitmaps[index] + end + def bitmap + @gifbitmaps[@currentIndex] + end + def currentIndex + @currentIndex + end + def frameDelay(index) + return @gifdelay[index]/2 # Due to frame count being incremented by 2 + end + def length + @gifbitmaps.length + end + def each + @gifbitmaps.each { yield } + end + def totalFrames + @totalframes/2 # Due to frame count being incremented by 2 + end + def disposed? + @disposed + end + def width + @gifbitmaps.length==0 ? 0 : @gifbitmaps[0].width + end + def height + @gifbitmaps.length==0 ? 0 : @gifbitmaps[0].height + end + # This function must be called in order to animate + # the GIF image. + def update + return if disposed? + if @gifbitmaps.length>0 + @framecount+=2 + @framecount=@totalframes<=0 ? 0 : @framecount%@totalframes + frametoshow=0 + for i in 0...@gifdelays.length + frametoshow=i if @gifdelays[i]<=@framecount + end + @currentIndex=frametoshow + end + end + def dispose + for i in @gifbitmaps + i.dispose + end + @disposed=true + end +end + +class GifSprite + # Creates a sprite from a GIF file with the specified + # optional viewport. Can also load non-animated bitmaps. + # 'File' can be nil. + def initialize(file=nil,viewport=nil) + @sprite=SpriteWrapper.new(viewport) + if file + @bitmap=AnimatedBitmap.new(file) + @sprite.bitmap=@bitmap.bitmap + end + end + def [](index); @bitmap[index]; end + def length; @bitmap.length; end + def each; @bitmap.each { yield }; end + def currentIndex; @bitmap.currentIndex; end + def frameDelay; @bitmap.frameDelay; end + def totalFrames; @bitmap.totalFrames; end + def setBitmap(file) + @bitmap.dispose if @bitmap + @bitmap=AnimatedBitmap.new(file) + @sprite.bitmap=@bitmap.bitmap + end + def bitmap + @sprite.bitmap + end + def bitmap=(value) + @sprite.bitmap=value + end + def disposed? + @sprite.disposed? + end + def width + @bitmap.bitmap.width + end + def height + @bitmap.bitmap.height + end + # This function must be called in order to animate + # the GIF image. + def update + @bitmap.update + @sprite.update + if @sprite.bitmap!=@bitmap.bitmap + oldsrc=@sprite.src_rect ? @sprite.src_rect.clone : nil + @sprite.bitmap=@bitmap.bitmap + @sprite.src_rect=oldsrc if oldsrc + end + end + def dispose + @bitmap.dispose + @sprite.dispose + 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 src_rect viewport + ].each do |s| + eval <<-__END__ + def #{s}; @sprite.#{s}; end + def #{s}=(value); @sprite.#{s}=value; end + __END__ + end +end + +############################# +############################# + + def pbGetSystemFrame return $PokemonSystem ? $PokemonSystem.frame : 0 @@ -402,17 +693,43 @@ end +def pbHaveString(x) + ret=pbGetFileString(x) + return (ret!=nil && ret!="") +end + +def pbHaveBitmap(x) + return BitmapCache.load_bitmap(x) rescue nil +end + +def pbTryString(x) + return pbHaveString(x) ? x : nil +end + +def pbTryBitmap(x) + return pbHaveBitmap(x) ? x : nil +end + +def pbResolveBitmap(x) + return nil if !x + noext=x.gsub(/\.(bmp|png|gif|jpg|jpeg)$/,"") + filename=pbTryBitmap(x) + filename=pbTryBitmap("#{noext}.png") if !filename + filename=pbTryString("#{x}.gif") if !filename + filename=pbTryString("#{noext}.gif") if !filename + filename=pbTryBitmap("#{noext}.jpg") if !filename + filename=pbTryBitmap("#{noext}.jpeg") if !filename + filename=pbTryBitmap("#{noext}.bmp") if !filename + return filename +end + def addBackgroundPlane(sprites,planename,background,viewport=nil) - sprites[planename]=Plane.new(viewport) - havebitmap=false - begin - bitmap=BitmapCache.load_bitmap("Graphics/Pictures/#{background}") - havebitmap=true - rescue + sprites[planename]=AnimatedPlane.new(viewport) + bitmapName=pbResolveBitmap("Graphics/Pictures/#{background}") + if bitmapName==nil # Plane should exist in any case sprites[planename].bitmap=nil sprites[planename].visible=false - end - if havebitmap - sprites[planename].bitmap=bitmap + else + sprites[planename].setBitmap(bitmapName) for spr in sprites.values if spr.is_a?(Window) @@ -424,10 +741,16 @@ def addBackgroundOrColoredPlane(sprites,planename,background,color,viewport=nil) - begin - bitmap=BitmapCache.load_bitmap("Graphics/Pictures/#{background}") - sprites[planename]=Plane.new(viewport) - sprites[planename].bitmap=bitmap - rescue + bitmapName=pbResolveBitmap("Graphics/Pictures/#{background}") + if bitmapName==nil + # Plane should exist in any case sprites[planename]=ColoredPlane.new(color,@viewport) + else + sprites[planename]=AnimatedPlane.new(viewport) + sprites[planename].setBitmap(bitmapName) + for spr in sprites.values + if spr.is_a?(Window) + spr.windowskin=nil + end + end end end @@ -865,6 +1188,4 @@ if @sprites[i].is_a?(Sprite) @sprites[i]=Sprite.new(@viewport) - elsif @sprites[i].is_a?(Plane) - @sprites[i]=Plane.new(@viewport) else @sprites[i]=nil @@ -2705,4 +3026,5 @@ super end + def update; end def setPlaneColor(value) self.bitmap.fill_rect(0,0,self.bitmap.width,self.bitmap.height,value) @@ -2774,66 +3096,41 @@ def initialize(viewport=nil) super(viewport) - @frames=[] - @currentFrame=0 + @bitmap=nil end def dispose - clearBitmaps + clearBitmaps() super end def update - if @frames.length>1 - currentFrame=(Graphics.frame_count/10) % @frames.length - self.bitmap=@frames[currentFrame] + if @bitmap + @bitmap.update + self.bitmap=@bitmap.bitmap end end def clearBitmaps - for bitmap in @frames - bitmap.dispose - end - @frames.clear + @bitmap.dispose if @bitmap + @bitmap=nil self.bitmap=nil if !self.disposed? end - def setupBitmaps(file,panorama) - if file[/^\[(\d+)\]/] - # File has a frame count - numFrames=$1.to_i - if numFrames<=0 - raise "Invalid frame count in #{file}" - end - if panorama.width % numFrames != 0 - raise "Bitmap's width (#{panorama.width}) is not divisible by frame count: #{file}" - end - subWidth=panorama.width/numFrames - for i in 0...numFrames - subBitmap=Bitmap.new(subWidth,panorama.height) - subBitmap.blt(0,0,panorama,Rect.new(subWidth*i,0,subWidth,panorama.height)) - @frames.push(subBitmap) - end - panorama.dispose - else - @frames=[panorama] - self.bitmap=@frames[0] - end - end def setPanorama(file, hue=0) clearBitmaps() return if file==nil - panorama=BitmapCache.panorama(file, hue) - setupBitmaps(file,panorama) + @bitmap=AnimatedBitmap.new("Graphics/Panoramas/"+file,hue) end def setFog(file, hue=0) clearBitmaps() return if file==nil - panorama=BitmapCache.fog(file, hue) - setupBitmaps(file,panorama) + @bitmap=AnimatedBitmap.new("Graphics/Fogs/"+file,hue) end def setBitmap(file, hue=0) clearBitmaps() return if file==nil - panorama=BitmapCache.load_bitmap(file, hue) - setupBitmaps(file,panorama) + @bitmap=AnimatedBitmap.new(file,hue) end end +=begin +Accepts bitmaps and paths to bitmap files in its constructor +=end class PictureWindow < SpriteWindow_Base def initialize(file) @@ -2845,10 +3142,10 @@ def dispose self.contents.dispose if self.contents - @iconbitmap.dispose if @iconbitmap + @iconbitmap.dispose if @iconbitmap && @disposeBitmap super end def clearBitmap self.contents.clear if self.contents && !self.contents.disposed? - @iconbitmap.dispose if @iconbitmap + @iconbitmap.dispose if @iconbitmap && @disposeBitmap @iconbitmap=nil end @@ -2857,6 +3154,13 @@ end def setBitmapPriv(file) - @iconbitmap.dispose if @iconbitmap - @iconbitmap=BitmapCache.load_bitmap(file) + @iconbitmap.dispose if @iconbitmap && @disposeBitmap + @disposeBitmap=!file.is_a?(Bitmap) + @iconbitmap=file.is_a?(Bitmap) ? file : BitmapCache.load_bitmap(file) + if !@iconbitmap + self.contents.clear if self.contents && !self.contents.disposed? + self.width=64 + self.height=64 + return + end dwidth=@iconbitmap.width dheight=@iconbitmap.height @@ -2875,5 +3179,4 @@ end end - module UpDownArrowMixin Changed: PokemonSystem --- Left +++ Right @@ -32,4 +32,6 @@ end + + def pbSetUpSystem ############# Changed: PokemonSummary --- Left +++ Right @@ -151,5 +151,5 @@ numbershadow=(pokemon.isShiny?) ? Color.new(20*8,20*8,12*8) : shadow textpos=[ - [_INTL("POKeMON INFO"),4,0,0,base,shadow], + [_INTL("POKéMON INFO"),4,0,0,base,shadow], [_ISPRINTF("No. {1:03d}",pokemon.species),16,36,0,numberbase,numbershadow], [pokemon.name,16,196,0,base,shadow], @@ -199,5 +199,5 @@ pbSetSystemFont(overlay) textpos=[ - [_INTL("POKeMON INFO"),4,0,0,base,shadow], + [_INTL("POKéMON INFO"),4,0,0,base,shadow], [pokemon.name,16,196,0,base,shadow], [_INTL("TYPE/"),176,96,0,Color.new(0,0,0),Color.new(208,208,200)], @@ -212,5 +212,5 @@ drawColoredTextEx(overlay,176,64,300,_INTL("\\[7FFF318C]OT/?????")) drawColoredTextEx(overlay,176,144,300,_INTL("\\[0000675A]{1}",eggstate)) - drawColoredTextEx(overlay,176,228,300,_INTL("\\[0000675A]Pokemon Egg")) + drawColoredTextEx(overlay,176,228,300,_INTL("\\[0000675A]Pokémon Egg")) pbSetSmallFont(overlay) textpos=[ @@ -258,5 +258,5 @@ numbershadow=(pokemon.isShiny?) ? Color.new(20*8,20*8,12*8) : shadow textpos=[ - [_INTL("POKeMON SKILLS"),4,0,0,base,shadow], + [_INTL("POKéMON SKILLS"),4,0,0,base,shadow], [_ISPRINTF("No. {1:03d}",pokemon.species),16,36,0,numberbase,numbershadow], [pokemon.name,16,196,0,base,shadow], @@ -620,8 +620,5 @@ def pbScene - if @pokemon && !@pokemon.egg? - pkmnwav=sprintf("Audio/SE/%03dCry.wav",@pokemon.species) - Audio.se_play(pkmnwav,100,(@pokemon.hp*25/@pokemon.totalhp)+75) rescue nil - end + pbPlayCry(@pokemon) loop do Graphics.update @@ -647,8 +644,5 @@ pbPositionPokemonSprite(@sprites["pokemon"],16,64) dorefresh=true - if @pokemon && !@pokemon.egg? - pkmnwav=sprintf("Audio/SE/%03dCry.wav",@pokemon.species) - Audio.se_play(pkmnwav,100,(@pokemon.hp*25/@pokemon.totalhp)+75) rescue nil - end + pbPlayCry(@pokemon) end if Input.trigger?(Input::DOWN) @@ -659,8 +653,5 @@ pbPositionPokemonSprite(@sprites["pokemon"],16,64) dorefresh=true - if @pokemon && !@pokemon.egg? - pkmnwav=sprintf("Audio/SE/%03dCry.wav",@pokemon.species) - Audio.se_play(pkmnwav,100,(@pokemon.hp*25/@pokemon.totalhp)+75) rescue nil - end + pbPlayCry(@pokemon) end if Input.trigger?(Input::LEFT) && !@pokemon.egg? Changed: PokemonUtilities --- Left +++ Right @@ -19,8 +19,8 @@ Tone.new(0,0,0,0), Tone.new(0,0,0,0), - Tone.new(0,0,0,0), - Tone.new(0,0,0,0), - Tone.new(-34,-68,-17,0), - Tone.new(-68,-136,-34,0), + Tone.new(-3,-7,-2,0), + Tone.new(-10,-18,-5,0), + Tone.new(-36,-75,-13,0), + Tone.new(-72,-136,-34,3), Tone.new(-88.5,-133,-31,34), Tone.new(-108.5,-129,-28,68), @@ -28,4 +28,16 @@ Tone.new(-142.5,-142.5,-22.5,68) ] + SummerAdjustment=[ + 0, 0.5, 1, 1.5, 2, 3.5, + 5, 6.5, 7.5, 9, 10, 11, + 12, 13, 15, 17, 17.75, 19.25, + 21, 21, 22, 22, 23, 23] + WinterAdjustment=[ + 0, 0.5, 1, 1.5, 2, 3.5, + 5, 6.5, 7.5, 9, 10, 11, + 12, 14, 16, 18.5, 19.5, 20.75, + 21.5, 22, 22.25, 22.75, 23.25, 23.75] + SummerMultiplier=[0.0, 0.1, 0.2, 0.5, 0.7, 0.8, 1.0, 0.95, 0.8, 0.5, 0.2, 0.05] + WinterMultiplier= [1.0, 0.9, 0.8, 0.5, 0.3, 0.2, 0.0, 0.05, 0.2, 0.5, 0.8, 0.95] end @@ -50,12 +62,28 @@ hour=now.hour minute=now.min + month=now.mon-1 + nextMonth=(month+1)%12 + nextHour=hour==0 ? 23 : hour-1 + dayPosition=month==1 ? ([28,now.mday].min-1)/28.0 : ([30,now.mday].min-1)/30.0 + summerMult=PBDayNight::SummerMultiplier[month]*1.0; + summerMult+=(PBDayNight::SummerMultiplier[nextMonth]-PBDayNight::SummerMultiplier[month])*dayPosition + winterMult=PBDayNight::WinterMultiplier[month]*1.0; + winterMult+=(PBDayNight::WinterMultiplier[nextMonth]-PBDayNight::WinterMultiplier[month])*dayPosition + realHour=PBDayNight::SummerAdjustment[hour]*summerMult+ + PBDayNight::WinterAdjustment[hour]*winterMult + realNextHour=PBDayNight::SummerAdjustment[nextHour]*summerMult+ + PBDayNight::WinterAdjustment[nextHour]*winterMult + realMinutes=realHour+((realNextHour-realHour)*(minute/60.0)) + realMinutes=((realMinutes*60).to_i)%(60*24) + hour=realMinutes/60 + minute=realMinutes%60 tone=PBDayNight::HourlyTones[hour] nexthourtone=PBDayNight::HourlyTones[(hour+1)%24] # Calculate current tint according to current and next hour's tint and # depending on current minute - toneToSet.red = (minute*(nexthourtone.red-tone.red)/60.0)+tone.red - toneToSet.green = (minute*(nexthourtone.green-tone.green)/60.0)+tone.green - toneToSet.blue = (minute*(nexthourtone.blue-tone.blue)/60.0)+tone.blue - toneToSet.gray = (minute*(nexthourtone.gray-tone.gray)/60.0)+tone.gray + toneToSet.red = ((nexthourtone.red-tone.red)*minute/60.0)+tone.red + toneToSet.green = ((nexthourtone.green-tone.green)*minute/60.0)+tone.green + toneToSet.blue = ((nexthourtone.blue-tone.blue)*minute/60.0)+tone.blue + toneToSet.gray = ((nexthourtone.gray-tone.gray)*minute/60.0)+tone.gray end @@ -132,8 +160,8 @@ party.push(PBSpecies::CHIMCHAR) if hasConst?(PBSpecies,:CHIMCHAR) party.push(PBSpecies::PIPLUP) if hasConst?(PBSpecies,:PIPLUP) - # Species IDs of the Pokemon to be created + # Species IDs of the Pokémon to be created for i in 0...party.length species=party[i] - # Generate Pokemon with species and level 20 + # Generate Pokémon with species and level 20 $Trainer.party[i]=PokeBattle_Pokemon.new(species,20,$Trainer) $Trainer.seen[species]=true # Set this species to seen and owned @@ -146,13 +174,23 @@ end -def pbPlayCry(species) - pkmnwav=sprintf("Audio/SE/%03dCry",species) - Audio.se_play(pkmnwav,100,100) +def pbPlayCry(pokemon,volume=90,pitch=nil) + return if !pokemon + if pokemon.is_a?(Numeric) + pkmnwav=sprintf("Audio/SE/%03dCry",pokemon) + Audio.se_play(pkmnwav,volume,pitch ? pitch : 100) rescue nil + elsif !pokemon.egg? + if pokemon.respond_to?("chatter") && pokemon.chatter + pokemon.chatter.play + else + pkmnwav=sprintf("Audio/SE/%03dCry.wav",pokemon.species) + Audio.se_play(pkmnwav,volume,pitch ? pitch : (pokemon.hp*25/pokemon.totalhp)+75) rescue nil + end + end end def pbStorePokemon(pokemon) if pbBoxesFull? - Kernel.pbMessage(_INTL("There's no more room for Pokemon!\1")) - Kernel.pbMessage(_INTL("The Pokemon Boxes are full and can't accept any more!")) + Kernel.pbMessage(_INTL("There's no more room for Pokémon!\1")) + Kernel.pbMessage(_INTL("The Pokémon Boxes are full and can't accept any more!")) return end @@ -188,6 +226,6 @@ def pbNicknameAndStore(pokemon) if pbBoxesFull? - Kernel.pbMessage(_INTL("There's no more room for Pokemon!\1")) - Kernel.pbMessage(_INTL("The Pokemon Boxes are full and can't accept any more!")) + Kernel.pbMessage(_INTL("There's no more room for Pokémon!\1")) + Kernel.pbMessage(_INTL("The Pokémon Boxes are full and can't accept any more!")) return end @@ -208,5 +246,5 @@ end speciesname=PBSpecies.getName(species) - Kernel.pbMessage(_INTL("{1} received a Pokemon from {2}.\1",$Trainer.name,ownername)) + Kernel.pbMessage(_INTL("{1} received a Pokémon from {2}.\1",$Trainer.name,ownername)) pokemon=PokeBattle_Pokemon.new(species,level,$Trainer) # Set ID and OT name to a foreign one @@ -237,6 +275,6 @@ def pbAddPokemon(species,level) if pbBoxesFull? - Kernel.pbMessage(_INTL("There's no more room for Pokemon!\1")) - Kernel.pbMessage(_INTL("The Pokemon Boxes are full and can't accept any more!")) + Kernel.pbMessage(_INTL("There's no more room for Pokémon!\1")) + Kernel.pbMessage(_INTL("The Pokémon Boxes are full and can't accept any more!")) return false end @@ -699,5 +737,5 @@ end # Stores result in variable _variableNumber_ and -#name in variable _nameVarNumber_; result is -1 if no Pokemon was chosen +#name in variable _nameVarNumber_; result is -1 if no Pokémon was chosen def pbChoosePokemon(variableNumber,nameVarNumber,ableProc=nil) chosen=0 @@ -708,5 +746,5 @@ chosen=screen.pbChooseAblePokemon(ableProc) else - screen.pbStartScene(_INTL("Choose a Pokemon."),false) + screen.pbStartScene(_INTL("Choose a Pokémon."),false) chosen=screen.pbChoosePokemon screen.pbEndScene @@ -748,5 +786,5 @@ def pbGetRegionalNumber(region, nationalSpecies) - # Gets the regional Pokedex number of + # Gets the regional Pokédex number of # the national species for the specified region. # The parameter "region" is zero-based. For @@ -770,5 +808,5 @@ def pbGetNationalNumber(region, regionalSpecies) - # Gets the national Pokedex number of + # Gets the national Pokédex number of # the specified species and region. # The parameter "region" is zero-based. For @@ -794,8 +832,8 @@ def pbAllRegionalSpecies(region) # Gets an array of all national species - # within a regional Pokedex, sorted by - # regional Pokedex number. + # within a regional Pokédex, sorted by + # regional Pokédex number. # The number of items in the array should be - # the number of species in the regional Pokedex plus + # the number of species in the regional Pokédex plus # 1, since index 0 is considered to be empty. # The parameter "region" is zero-based. For @@ -884,5 +922,5 @@ screen=PokemonScreen.new(scene,$Trainer.party) annot=pbMoveTutorAnnotations(move,movelist) - screen.pbStartScene(_INTL("Teach which Pokemon?"),false,annot) + screen.pbStartScene(_INTL("Teach which Pokémon?"),false,annot) chosen=screen.pbChoosePokemon if chosen>=0 @@ -919,5 +957,5 @@ end - # Opens the Pokemon screen + # Opens the Pokémon screen def pbPokemonScreen PBDebug.logonerr{ @@ -1169,6 +1207,23 @@ return Marshal.dump([@freq,Zlib::Deflate.deflate(@samples)]) end + def intensity + distance=@samples.length/2000 + i=distance/2 + count=0 + volume=0 + while i<@samples.length + vol=(@samples[i]-128).abs + vol=127 if vol>127 + if vol>=16 + volume+=vol + count+=1 + end + i+=distance + end + return 0 if count==0 + return volume/count # from 0 through 127 + end def time - return @freq==0 ? 0.0 : (@samples.length/2)*1.0/@freq + return @freq==0 ? 0.0 : (@samples.length)*1.0/@freq end def play @@ -1179,5 +1234,5 @@ 0x01,0x01, # PCM,mono @freq,@freq, - 1,8, # 16-bit + 1,8, # 8-bit 0x61746164,@samples.length ].pack("VVVVVvvVVvvVV") @@ -1319,5 +1374,4 @@ Kernel.pbMessage(_INTL("There was no sound in the recording. Please ensure that a microphone is attached to the computer and is ready.")) else - Kernel.pbMessage(_INTL("Recording was successful.")) return error end @@ -1403,135 +1457,4 @@ end return false -end - - -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 - # Creates a sprite from a GIF file with the specified - # optional viewport. Can also load non-animated bitmaps. - def initialize(file,viewport=nil) - @gifbitmaps=[] - @gifdelays=[] - @totalframes=0 - @framecount=0 - @sprite=Sprite.new(viewport) - bitmap=nil - filestring=pbGetFileString(file) - filestring=pbGetFileString(file+".gif") if !filestring - filestring=pbGetFileString(file+".png") if !filestring - filestring=pbGetFileString(file+".jpg") if !filestring - filestring=pbGetFileString(file+".bmp") if !filestring - if filestring && filestring[0]!=0x47 - begin - bitmap=BitmapCache.load_bitmap(file) - rescue - bitmap=nil - end - end - if bitmap - # Have a regular non-animated bitmap - @totalframes=1 - @framecount=0 - @gifbitmaps=[bitmap] - @gifdelays=[1] - @sprite.bitmap=@gifbitmaps[0] - else - 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 - end - def bitmap - @totalframes<=0 ? nil : @gifbitmaps[0] - 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 - # This function must be called in order to animate - # the GIF image. - 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 --- Left +++ Right @@ -133,4 +133,5 @@ shakes=4 else + x=1 if x==0 y = 0x000FFFF0 / (Math.sqrt(Math.sqrt( 0x00FF0000/x ) ) ) shakes+=1 if pbRandom(65536)2 && !opponent - raise ArgumentError.new(_INTL("Wild battles with more than two Pokemon are not allowed.")) + raise ArgumentError.new(_INTL("Wild battles with more than two Pokémon are not allowed.")) return end @@ -552,16 +554,16 @@ def pbStartBattleCore if !@fullparty1 && @party1.length>MAXPARTYSIZE - raise ArgumentError.new(_INTL("Party 1 has more than six Pokemon.")) + raise ArgumentError.new(_INTL("Party 1 has more than six Pokémon.")) end if !@fullparty2 && @party2.length>MAXPARTYSIZE - raise ArgumentError.new(_INTL("Party 2 has more than six Pokemon.")) + raise ArgumentError.new(_INTL("Party 2 has more than six Pokémon.")) end if !@opponent # - # Initialize wild Pokemon + # Initialize wild Pokémon # if @party2.length==1 if @doublebattle - raise _INTL("Only two wild Pokemon are allowed in double battles") + raise _INTL("Only two wild Pokémon are allowed in double battles") end wildpoke=@party2[0] @@ -572,5 +574,5 @@ elsif @party2.length==2 if !@doublebattle - raise _INTL("Only one wild Pokemon is allowed in single battles") + raise _INTL("Only one wild Pokémon is allowed in single battles") end @battlers[1].pbInitialize(@party2[0],0,false) @@ -582,5 +584,5 @@ @party2[0].name,@party2[1].name)) else - raise _INTL("Only one or two wild Pokemon are allowed") + raise _INTL("Only one or two wild Pokémon are allowed") end elsif @doublebattle @@ -606,7 +608,7 @@ pbDisplayPaused(_INTL("{1} and {2} want to battle!",@opponent[0].fullname,@opponent[1].fullname)) sendout1=pbFindNextUnfainted(@party2,0,pbSecondPartyBegin(1)) - raise _INTL("Opponent 1 has no unfainted Pokemon") if sendout1<0 + raise _INTL("Opponent 1 has no unfainted Pokémon") if sendout1<0 sendout2=pbFindNextUnfainted(@party2,pbSecondPartyBegin(1)) - raise _INTL("Opponent 2 has no unfainted Pokemon") if sendout2<0 + raise _INTL("Opponent 2 has no unfainted Pokémon") if sendout2<0 pbDisplay(_INTL("{1} sent\r\nout {2}!",@opponent[0].fullname,@party2[sendout1].name)) pbDisplayBrief(_INTL("{1} sent\r\nout {2}!",@opponent[1].fullname,@party2[sendout2].name)) @@ -616,5 +618,5 @@ sendout2=pbFindNextUnfainted(@party2,sendout1+1) if sendout1<0 || sendout2<0 - raise _INTL("Opponent doesn't have two unfainted Pokemon") + raise _INTL("Opponent doesn't have two unfainted Pokémon") end pbDisplayBrief(_INTL("{1} sent\r\nout {2} and {3}!",@opponent.fullname,@party2[sendout1].name,@party2[sendout2].name)) @@ -632,5 +634,5 @@ sendout=pbFindNextUnfainted(@party2,0) if sendout<0 - raise _INTL("Trainer has no unfainted Pokemon") + raise _INTL("Trainer has no unfainted Pokémon") end if @opponent.is_a?(Array) @@ -656,7 +658,7 @@ if @player.is_a?(Array) sendout1=pbFindNextUnfainted(@party1,0,pbSecondPartyBegin(0)) - raise _INTL("Player 1 has no unfainted Pokemon") if sendout1<0 + raise _INTL("Player 1 has no unfainted Pokémon") if sendout1<0 sendout2=pbFindNextUnfainted(@party1,pbSecondPartyBegin(0)) - raise _INTL("Player 2 has no unfainted Pokemon") if sendout2<0 + raise _INTL("Player 2 has no unfainted Pokémon") if sendout2<0 pbDisplayBrief(_INTL("{1} sent\r\nout {2}! Go! {3}!",@player[1].fullname,@party1[sendout2].name,@party1[sendout1].name)) self.pbPlayer.seen[@party1[sendout1].species]=true @@ -666,5 +668,5 @@ sendout2=pbFindNextUnfainted(@party1,sendout1+1) if sendout1<0 || sendout2<0 - raise _INTL("Player doesn't have two unfainted Pokemon") + raise _INTL("Player doesn't have two unfainted Pokémon") end pbDisplayBrief(_INTL("Go! {1} and {2}!",@party1[sendout1].name,@party1[sendout2].name)) @@ -680,5 +682,5 @@ sendout=pbFindNextUnfainted(@party1,0) if sendout<0 - raise _INTL("Player has no unfainted Pokemon") + raise _INTL("Player has no unfainted Pokémon") end playerpoke=@party1[sendout] @@ -781,5 +783,5 @@ when 2 #lose if @internalbattle - pbDisplayPaused(_INTL("{1} is out of usable Pokemon!",self.pbPlayer.name)) + pbDisplayPaused(_INTL("{1} is out of usable Pokémon!",self.pbPlayer.name)) moneylost=pbMaxLevel(@party1) multiplier=[8,16,24,32,48,64,80,100,120] @@ -1206,5 +1208,5 @@ if !pbIsOwner?(idxPokemon,pkmnidxTo) owner=pbPartyGetOwner(idxPokemon,pkmnidxTo) - pbDisplayPaused(_INTL("You can't switch {1}'s Pokemon with one of yours!",owner.name)) if showMessages + pbDisplayPaused(_INTL("You can't switch {1}'s Pokémon with one of yours!",owner.name)) if showMessages return false end @@ -1275,6 +1277,6 @@ return false else - @choices[idxPokemon][0]=2 # Pokemon - @choices[idxPokemon][1]=idxOther # Pokemon to switch to + @choices[idxPokemon][0]=2 # Pokémon + @choices[idxPokemon][1]=idxOther # Pokémon to switch to @choices[idxPokemon][2]=nil return true @@ -1284,5 +1286,5 @@ =begin -Uses an item on a Pokemon in the player's party. +Uses an item on a Pokémon in the player's party. =end def pbUseItemOnPokemon(item,pkmnIndex,scene) @@ -1533,5 +1535,5 @@ end =begin -Uses an item on an active Pokemon. +Uses an item on an active Pokémon. =end def pbUseItemOnBattler(item,index,scene) @@ -1539,5 +1541,5 @@ if $ItemData[item][ITEMPOCKET]==2 # Any Ball if !@opponent && @battlers[1].hp>0 && @battlers[3].hp>0 - scene.pbDisplay(_INTL("It's no good! It's impossible to aim when there are two Pokemon!")) + scene.pbDisplay(_INTL("It's no good! It's impossible to aim when there are two Pokémon!")) return false end @@ -1792,5 +1794,5 @@ maxpri=0 minpri=0 - # Calculate each Pokemon's speed + # Calculate each Pokémon's speed speeds[0]=@battlers[0].pbSpeed speeds[1]=@battlers[1].pbSpeed @@ -1842,5 +1844,5 @@ end if cmp<0 - # put higher-speed Pokemon first + # put higher-speed Pokémon first swaptmp=temp[i] temp[i]=temp[i-1] @@ -2144,5 +2146,5 @@ debuginfo="#{thispoke.name}: #{thispoke.level}/#{newlevel} | #{thispoke.exp}/#{newexp} | gain: #{exp}" raise RuntimeError.new( - _INTL("The new level ({1}) is less than the Pokemon's\r\ncurrent level ({2}), which shouldn't happen.\r\n[Debug: {3}]", + _INTL("The new level ({1}) is less than the Pokémon's\r\ncurrent level ({2}), which shouldn't happen.\r\n[Debug: {3}]", newlevel,curlevel,debuginfo)) return @@ -2238,5 +2240,5 @@ @opponent && @internalbattle && pbCanChooseNonActive?(0) && pbIsOpposing?(index) pbDisplayPaused(_INTL("{1} is about to send in {2}.",opponent.fullname,@party2[newenemy].name)) - if pbDisplayConfirm(_INTL("Will {1} change Pokemon?",self.pbPlayer.name)) + if pbDisplayConfirm(_INTL("Will {1} change Pokémon?",self.pbPlayer.name)) newpoke=pbSwitchPlayer(0,true,true) if newpoke>=0 @@ -2253,5 +2255,5 @@ else switch=false - if !pbDisplayConfirm(_INTL("Use next Pokemon?")) + if !pbDisplayConfirm(_INTL("Use next Pokémon?")) switch=(pbRun(index,true)<=0) else @@ -2424,5 +2426,5 @@ commandDone=true end - elsif cmd==1 # Pokemon + elsif cmd==1 # Pokémon pkmn=pbSwitchPlayer(i,false,true) if pkmn>=0 @@ -2495,5 +2497,5 @@ for i in 0..3 # in order from own first, opposing first, own second, opposing second if @choices[i][0]==2 - index=@choices[i][1]# party position of Pokemon to switch to + index=@choices[i][1]# party position of Pokémon to switch to if !pbOwnedByPlayer?(i) owner=pbGetOwner(i) @@ -2686,5 +2688,5 @@ end # Speed Boost - # A Pokemon's turncount is 0 if it became active after the beginning of a round + # A Pokémon's turncount is 0 if it became active after the beginning of a round if i.turncount>0 && i.ability==PBAbilities::SPEEDBOOST if !i.pbTooHigh?(PBStats::SPEED) @@ -2819,5 +2821,5 @@ if i.effects[PBEffects::Outrage]>0 i.effects[PBEffects::Outrage]-=1 - if i.effects[PBEffects::Outrage]==0&&i.ability!=PBAbilities::OWNTEMPO&&i.effects[PBEffects::Confusion]<=0 + if i.effects[PBEffects::Outrage]==0 && i.ability!=PBAbilities::OWNTEMPO && i.effects[PBEffects::Confusion]<=0 i.effects[PBEffects::Confusion]=2+pbRandom(4) pbCommonAnimation("Confusion",i,nil) Changed: PokemonBag --- Left +++ Right @@ -989,5 +989,5 @@ return @scene.pbConfirm(text) end - # UI logic for the item screen when an item is to be held by a Pokemon. + # UI logic for the item screen when an item is to be held by a Pokémon. def pbGiveItemScreen @scene.pbStartScene(@bag) @@ -1092,5 +1092,5 @@ elsif command==1 # Give if $Trainer.pokemonCount==0 - @scene.pbDisplay(_INTL("There is no Pokemon.")) + @scene.pbDisplay(_INTL("There is no Pokémon.")) return 0 elsif $ItemData[item][ITEMPOCKET]==5 || pbIsHiddenMachine?(item) @@ -1215,11 +1215,11 @@ @bag.pbRegisterKeyItem(item) @scene.pbRefresh - elsif cmdGive>=0 && command==cmdGive # Give item to Pokemon + elsif cmdGive>=0 && command==cmdGive # Give item to Pokémon if $Trainer.pokemonCount==0 - @scene.pbDisplay(_INTL("There is no Pokemon.")) + @scene.pbDisplay(_INTL("There is no Pokémon.")) elsif $ItemData[item][ITEMPOCKET]==5 || pbIsHiddenMachine?(item) @scene.pbDisplay(_INTL("The {1} can't be held.",itemname)) else - # Give item to a Pokemon + # Give item to a Pokémon pbFadeOutIn(99999){ sscene=PokemonScreen_Scene.new Changed: PokemonItems --- Left +++ Right @@ -75,5 +75,5 @@ # 2 - Item used, end screen # 3 - Item used, consume item - return if (item=itemFromSymbol(item))==nil + return 0 if (item=itemFromSymbol(item))==nil if !@@useFromBag[item] # Check the UseInField handler if present @@ -89,5 +89,5 @@ def self.triggerUseInField(item) # No return value - return if (item=itemFromSymbol(item))==nil + return false if (item=itemFromSymbol(item))==nil if !@@useInField[item] return false @@ -99,5 +99,5 @@ def self.triggerUseOnPokemon(item,pokemon,scene) # Returns whether item was used - return if (item=itemFromSymbol(item))==nil + return false if (item=itemFromSymbol(item))==nil if !@@useOnPokemon[item] return false @@ -108,5 +108,5 @@ def self.triggerBattleUseOnBattler(item,battler,scene) # Returns whether item was used - return if (item=itemFromSymbol(item))==nil + return false if (item=itemFromSymbol(item))==nil if !@@battleUseOnBattler[item] return false @@ -117,5 +117,5 @@ def self.triggerBattleUseOnPokemon(item,pokemon,battler,scene) # Returns whether item was used - return if (item=itemFromSymbol(item))==nil + return false if (item=itemFromSymbol(item))==nil if !@@battleUseOnPokemon[item] return false @@ -236,5 +236,5 @@ when PBItems::BLACKFLUTE Kernel.pbMessage(_INTL("{1} used the Black Flute.",$Trainer.name)) - Kernel.pbMessage(_INTL("Wild Pokemon will be repelled.")) + Kernel.pbMessage(_INTL("Wild Pokémon will be repelled.")) $PokemonMap.blackFluteUsed=true $PokemonMap.whiteFluteUsed=false @@ -242,5 +242,5 @@ when PBItems::WHITEFLUTE Kernel.pbMessage(_INTL("{1} used the White Flute.",$Trainer.name)) - Kernel.pbMessage(_INTL("Wild Pokemon will be lured.")) + Kernel.pbMessage(_INTL("Wild Pokémon will be lured.")) $PokemonMap.blackFluteUsed=false $PokemonMap.whiteFluteUsed=true @@ -287,5 +287,5 @@ revived=0 if $Trainer.pokemonCount==0 - Kernel.pbMessage(_INTL("There is no Pokemon.")) + Kernel.pbMessage(_INTL("There is no Pokémon.")) return 0 end @@ -541,5 +541,5 @@ return false if machine==nil if $Trainer.pokemonCount==0 - Kernel.pbMessage(_INTL("There is no Pokemon.")) + Kernel.pbMessage(_INTL("There is no Pokémon.")) return false end @@ -552,5 +552,5 @@ Kernel.pbMessage(_INTL("It contained {1}.\1",movename)) end - if !Kernel.pbConfirmMessage(_INTL("Teach {1} to a Pokemon?",movename)) + if !Kernel.pbConfirmMessage(_INTL("Teach {1} to a Pokémon?",movename)) return false end @@ -559,5 +559,5 @@ screen=PokemonScreen.new(scene,$Trainer.party) annot=pbMachineAnnotations(machine) - screen.pbStartScene(_INTL("Teach which Pokemon?"),false,annot) + screen.pbStartScene(_INTL("Teach which Pokémon?"),false,annot) chosen=screen.pbChoosePokemon if chosen>=0 @@ -929,7 +929,7 @@ def pbUseItem(bag,item) found=false - if $ItemData[item][ITEMUSE]==1 # Item is usable on a Pokemon + if $ItemData[item][ITEMUSE]==1 # Item is usable on a Pokémon if $Trainer.pokemonCount==0 - Kernel.pbMessage(_INTL("There is no Pokemon.")) + Kernel.pbMessage(_INTL("There is no Pokémon.")) return 0 end @@ -938,5 +938,5 @@ scene=PokemonScreen_Scene.new screen=PokemonScreen.new(scene,$Trainer.party) - screen.pbStartScene(_INTL("Use on which Pokemon?"),false) + screen.pbStartScene(_INTL("Use on which Pokémon?"),false) chosen=screen.pbChoosePokemon if chosen>=0 Changed: PokemonScreen --- Left +++ Right @@ -1,3 +1,3 @@ -# Data structure representing mail that the Pokemon can hold +# Data structure representing mail that the Pokémon can hold class PokemonMail attr_accessor :item,:message,:sender @@ -27,5 +27,5 @@ def pbStoreMail(pkmn,item,message) if pkmn.mail - raise _INTL("Pokemon already has mail") + raise _INTL("Pokémon already has mail") end pkmn.mail=PokemonMail.new(item,message,$Trainer.name) @@ -36,6 +36,5 @@ viewport=Viewport.new(0,0,Graphics.width,Graphics.height) viewport.z=99999 - sprites["background"]=Plane.new(viewport) - sprites["background"].bitmap=BitmapCache.load_bitmap("Graphics/Pictures/mailbg.png") + addBackgroundPlane(@sprites,"background","mailbg",@viewport) sprites["card"]=Sprite.new(viewport) sprites["card"].bitmap=BitmapCache.load_bitmap(sprintf("Graphics/Pictures/item%03d.png",mail.item)) @@ -584,4 +583,5 @@ @rightcolumn=(@doublebattle) ? 2 : 1 @multiselect=multiselect + addBackgroundPlane(@sprites,"partybg","pokeselbg",@viewport) @sprites["messagebox"]=Window_AdvancedTextPokemon.new("") @sprites["helpwindow"]=Window_UnformattedTextPokemon.new(starthelptext) @@ -594,7 +594,5 @@ pbBottomLeftLines(@sprites["helpwindow"],1) pbSetHelpText(starthelptext) - @sprites["partybg"]=Plane.new(@viewport) - @sprites["partybg"].bitmap=BitmapCache.load_bitmap("Graphics/Pictures/pokeselbg.png") - # Add party Pokemon sprites + # Add party Pokémon sprites for i in 0...6 if @party[i] @@ -615,5 +613,5 @@ @sprites["pokemon6"]=PokeSelectionCancelSprite.new(@viewport) end - # Select first Pokemon + # Select first Pokémon @activecmd=0 @sprites["pokemon0"].selected=true @@ -911,5 +909,5 @@ return true else - if pbConfirm(_INTL("Stop giving the Pokemon Mail?")) + if pbConfirm(_INTL("Stop giving the Pokémon Mail?")) return false end @@ -922,5 +920,5 @@ pbDisplay(_INTL("{1} isn't holding anything.",pkmn.name)) elsif !$PokemonBag.pbCanStore?(pkmn.item) - pbDisplay(_INTL("The Bag is full. The Pokemon's item could not be removed.")) + pbDisplay(_INTL("The Bag is full. The Pokémon's item could not be removed.")) elsif pkmn.mail if pbConfirm(_INTL("Send the removed mail to your PC?")) @@ -932,5 +930,5 @@ end elsif pbConfirm(_INTL("If the mail is removed, the message will be lost. OK?")) - pbDisplay(_INTL("Mail was taken from the Pokemon.")) + pbDisplay(_INTL("Mail was taken from the Pokémon.")) $PokemonBag.pbStoreItem(pkmn.item) pkmn.item=0 @@ -964,5 +962,5 @@ raise _INTL("Can't re-store deleted item in bag") end - pbDisplay(_INTL("The Bag is full. The Pokemon's item could not be removed.")) + pbDisplay(_INTL("The Bag is full. The Pokémon's item could not be removed.")) else if pbIsMail?(item) @@ -995,5 +993,5 @@ def pbPokemonGiveScreen(item) - @scene.pbStartScene(@party,_INTL("Give to which Pokemon?")) + @scene.pbStartScene(@party,_INTL("Give to which Pokémon?")) pkmnid=@scene.pbChoosePokemon ret=false @@ -1007,10 +1005,10 @@ def pbPokemonGiveMailScreen(mailIndex) - @scene.pbStartScene(@party,_INTL("Give to which Pokemon?")) + @scene.pbStartScene(@party,_INTL("Give to which Pokémon?")) pkmnid=@scene.pbChoosePokemon if pkmnid>=0 pkmn=@party[pkmnid] if pkmn.item!=0 || pkmn.mail - pbDisplay(_INTL("This Pokemon is holding an item. It can't hold mail.")) + pbDisplay(_INTL("This Pokémon is holding an item. It can't hold mail.")) elsif pkmn.egg? pbDisplay(_INTL("Eggs can't hold mail.")) @@ -1082,5 +1080,5 @@ _INTL("SIXTH") ] - raise _INTL("Can't choose {1} Pokemon out of {2}",number,@party.length) if number>@party.length + raise _INTL("Can't choose {1} Pokémon out of {2}",number,@party.length) if number>@party.length ret=nil addedEntry=false @@ -1095,5 +1093,5 @@ annot[i]=ordinals[statuses[i]] end - @scene.pbStartScene(@party,_INTL("Choose Pokemon and confirm."),false,annot,true) + @scene.pbStartScene(@party,_INTL("Choose Pokémon and confirm."),false,annot,true) loop do realorder=[] @@ -1116,10 +1114,10 @@ @scene.pbSelect(6) end - @scene.pbSetHelpText(_INTL("Choose Pokemon and confirm.")) + @scene.pbSetHelpText(_INTL("Choose Pokémon and confirm.")) pkmnid=@scene.pbChoosePokemon addedEntry=false if pkmnid==6 # Confirm was chosen if realorder.length!=number - pbDisplay(_INTL("{1} Pokemon are needed.",number)) + pbDisplay(_INTL("{1} Pokémon are needed.",number)) next else @@ -1129,5 +1127,5 @@ end if !pbCheckSpecies(ret) - pbDisplay(_INTL("Pokemon can't be the same.")) + pbDisplay(_INTL("Pokémon can't be the same.")) ret=nil next @@ -1159,5 +1157,5 @@ if cmdEntry>=0 && command==cmdEntry if realorder.length>=number - pbDisplay(_INTL("No more than {1} Pokemon may enter.",number)) + pbDisplay(_INTL("No more than {1} Pokémon may enter.",number)) else statuses[pkmnid]=realorder.length+3 @@ -1184,12 +1182,12 @@ end ret=-1 - @scene.pbStartScene(@party,_INTL("Choose a Pokemon."),false,annot) + @scene.pbStartScene(@party,_INTL("Choose a Pokémon."),false,annot) loop do - @scene.pbSetHelpText(_INTL("Choose a Pokemon.")) + @scene.pbSetHelpText(_INTL("Choose a Pokémon.")) pkmnid=@scene.pbChoosePokemon if pkmnid<0 break elsif !eligibility[pkmnid] - pbDisplay(_INTL("This Pokemon can't be chosen.")) + pbDisplay(_INTL("This Pokémon can't be chosen.")) else ret=pkmnid @@ -1201,7 +1199,7 @@ end def pbPokemonScreen - @scene.pbStartScene(@party,_INTL("Choose a Pokemon."),false,nil) + @scene.pbStartScene(@party,_INTL("Choose a Pokémon."),false,nil) loop do - @scene.pbSetHelpText(_INTL("Choose a Pokemon.")) + @scene.pbSetHelpText(_INTL("Choose a Pokémon.")) pkmnid=@scene.pbChoosePokemon if pkmnid<0 @@ -1238,5 +1236,7 @@ move.id==PBMoves::MILKDRINK|| move.id==PBMoves::SOFTBOILED|| - move.id==PBMoves::SWEETSCENT) + move.id==PBMoves::SWEETSCENT|| + HiddenMoveHandlers.hasHandler(move.id) + ) commands[cmdMoves[i]=commands.length]=PBMoves.getName(move.id) end @@ -1262,5 +1262,5 @@ break end - @scene.pbSetHelpText(_INTL("Use on which Pokemon?")) + @scene.pbSetHelpText(_INTL("Use on which Pokémon?")) oldpkmnid=pkmnid loop do @@ -1270,5 +1270,5 @@ newpkmn=@party[pkmnid] if newpkmn.egg? || newpkmn.hp==0 || newpkmn.hp==newpkmn.totalhp || pkmnid==oldpkmnid - pbDisplay(_INTL("This item can't be used on that Pokemon.")) + pbDisplay(_INTL("This item can't be used on that Pokémon.")) else pkmn.hp-=pkmn.totalhp/5 @@ -1288,5 +1288,5 @@ return [pkmn,pkmn.moves[i].id,ret] end - @scene.pbStartScene(@party,_INTL("Choose a Pokemon.")) + @scene.pbStartScene(@party,_INTL("Choose a Pokémon.")) break end @@ -1328,8 +1328,8 @@ when 1 # Cheat Codes pkmn.genCodes("codes.txt") - pbDisplay(_INTL("Codes for this Pokemon were saved in codes.txt.")) + pbDisplay(_INTL("Codes for this Pokémon were saved in codes.txt.")) when 2 # Set Level level=Kernel.pbMessageChooseNumberEx( - _INTL("Set the Pokemon's level."),pkmn.level,1,PBExperience::MAXLEVEL,pkmn.level) + _INTL("Set the Pokémon's level."),pkmn.level,1,PBExperience::MAXLEVEL,pkmn.level) if level!=pkmn.level pkmn.level=level @@ -1366,7 +1366,7 @@ pkmn.calcStats if pkmn.nature!=command - pbDisplay(_INTL("The Pokemon's nature couldn't be changed.")) + pbDisplay(_INTL("The Pokémon's nature couldn't be changed.")) else - pbDisplay(_INTL("The Pokemon's nature was changed.")) + pbDisplay(_INTL("The Pokémon's nature was changed.")) pbRefreshSingle(pkmnid) end @@ -1374,7 +1374,7 @@ when 5 # Set Gender if pkmn.gender==2 - pbDisplay(_INTL("This Pokemon's gender can't be set.")) + pbDisplay(_INTL("This Pokémon's gender can't be set.")) elsif pkmn.gender==0 - if pbConfirm(_INTL("Make this Pokemon female?")) + if pbConfirm(_INTL("Make this Pokémon female?")) oldnature=pkmn.nature 2000.times do @@ -1383,12 +1383,12 @@ end if pkmn.gender==0 - pbDisplay(_INTL("The Pokemon's gender couldn't be changed.")) + pbDisplay(_INTL("The Pokémon's gender couldn't be changed.")) else - pbDisplay(_INTL("The Pokemon's gender was changed.")) + pbDisplay(_INTL("The Pokémon's gender was changed.")) pbRefreshSingle(pkmnid) end end elsif pkmn.gender==1 - if pbConfirm(_INTL("Make this Pokemon male?")) + if pbConfirm(_INTL("Make this Pokémon male?")) oldnature=pkmn.nature 2000.times do @@ -1397,7 +1397,7 @@ end if pkmn.gender==1 - pbDisplay(_INTL("The Pokemon's gender couldn't be changed.")) + pbDisplay(_INTL("The Pokémon's gender couldn't be changed.")) else - pbDisplay(_INTL("The Pokemon's gender was changed.")) + pbDisplay(_INTL("The Pokémon's gender was changed.")) pbRefreshSingle(pkmnid) end @@ -1411,8 +1411,8 @@ @scene.pbHardRefresh when 7 # Delete - if pbConfirm(_INTL("Are you sure you want to delete this Pokemon?")) + if pbConfirm(_INTL("Are you sure you want to delete this Pokémon?")) @party[pkmnid]=nil @party.compact! - pbDisplay(_INTL("The Pokemon was deleted.")) + pbDisplay(_INTL("The Pokémon was deleted.")) @scene.pbHardRefresh end Changed: PokeBattle_Battler --- Left +++ Right @@ -130,5 +130,5 @@ def pbInitPokemon(pkmn,pkmnIndex) if pkmn.egg? - raise _INTL("An egg can't be an active Pokemon") + raise _INTL("An egg can't be an active Pokémon") end @name=pkmn.name @@ -193,5 +193,5 @@ def pbInitPermanentEffects - # These effects are retained even if a Pokemon is replaced + # These effects are retained even if a Pokémon is replaced @effects[PBEffects::Wish]=0 @effects[PBEffects::WishMaker]=-1 @@ -410,10 +410,10 @@ end -# Returns the data structure for the opposing Pokemon's side +# Returns the data structure for the opposing Pokémon's side def pbOpposingSide return @battle.sides[(index&1)^1] # Player: 1 and 3; Foe: 0 and 2 end -# Returns whether the position belongs to the opposing Pokemon's side +# Returns whether the position belongs to the opposing Pokémon's side def pbIsOpposing?(i) return (@index&1)!=(i&1) @@ -425,10 +425,10 @@ end -# Returns the battler's first opposing Pokemon +# Returns the battler's first opposing Pokémon def pbOpposing1 return @battle.battlers[((@index&1)^1)] end -# Returns the battler's second opposing Pokemon +# Returns the battler's second opposing Pokémon def pbOpposing2 return @battle.battlers[((@index&1)^1)+2] @@ -440,5 +440,5 @@ -# Update Pokemon who will gain EXP if this battler is defeated +# Update Pokémon who will gain EXP if this battler is defeated def pbUpdateParticipants return if hp<=0 # can't update if already fainted @@ -918,5 +918,5 @@ target.ability!=PBAbilities::LIGHTNINGROD # all damaging Electric attacks have a target of "single non-user" - for i in priority # use Pokemon earliest in priority + for i in priority # use Pokémon earliest in priority next if !pbIsOpposing?(i.index) if i.ability==PBAbilities::LIGHTNINGROD @@ -930,5 +930,5 @@ # because check for Magic Coat below uses this target) if thismove.target==0 # target is a single non-user - for i in priority # use Pokemon latest in priority + for i in priority # use Pokémon latest in priority next if !pbIsOpposing?(i.index) if i.effects[PBEffects::FollowMe] @@ -1146,5 +1146,5 @@ end if miss || !thismove.pbAccuracyCheck(user,target)#Includes Counter/Mirror Coat - if thismove.target==0x08||thismove.target==0x20 # All opposing Pokemon or all non-users + if thismove.target==0x08||thismove.target==0x20 # All opposing Pokémon or all non-users @battle.pbDisplay(_INTL("{1}\r\navoided the attack!",target.pbThis)) elsif thismove.function==0x54 # LEECH SEED @@ -1258,5 +1258,5 @@ if target.hp>0 && target.effects[PBEffects::Rage] && target.pbIsOpposing?(user.index) && damage>0 - # TODO: Apparently triggers if opposing Pokemon uses Future Sight after a Future Sight attack + # TODO: Apparently triggers if opposing Pokémon uses Future Sight after a Future Sight attack if !target.pbTooHigh?(PBStats::ATTACK) target.stages[PBStats::ATTACK]+=1 @@ -1560,4 +1560,5 @@ choice[1]=@effects[PBEffects::EncoreIndex] choice[2]=@moves[@effects[PBEffects::EncoreIndex]] + choice[3]=-1 # No target chosen end end Changed: Window --- Left +++ Right @@ -66,4 +66,5 @@ attr_reader :cursor_rect attr_reader :openness + attr_reader :stretch def windowskin @_windowskin @@ -92,5 +93,5 @@ @contents=@blankcontents @_windowskin=nil - @rpgvx=false + @rpgvx=false # Set to true to emulate RPGVX windows @x=0 @y=0 @@ -157,6 +158,4 @@ if @sprites[i].is_a?(Sprite) @sprites[i]=Sprite.new(@viewport) - elsif @sprites[i].is_a?(Plane) - @sprites[i]=Plane.new(@viewport) else @sprites[i]=nil @@ -546,6 +545,4 @@ 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 Changed: PokemonStorage --- Left +++ Right @@ -56,5 +56,5 @@ else for i in @boxes - raise _INTL("Box is a Pokemon, not a box") if i.is_a?(PokeBattle_Pokemon) + raise _INTL("Box is a Pokémon, not a box") if i.is_a?(PokeBattle_Pokemon) end return (x==-1) ? $Trainer.party[y] : @boxes[x][y] @@ -195,8 +195,8 @@ end if box==-1 && pbAbleCount<=1 && pbAble?(pokemon) && !heldpoke - pbDisplay(_INTL("That's your last Pokemon!")) + pbDisplay(_INTL("That's your last Pokémon!")) return end - command=pbShowCommands(_INTL("Release this Pokemon?"),[_INTL("NO"),_INTL("YES")]) + command=pbShowCommands(_INTL("Release this Pokémon?"),[_INTL("NO"),_INTL("YES")]) if command==1 pkmnname=pokemon.name @@ -236,5 +236,5 @@ end if pbAbleCount<=1 && pbAble?(@storage[box,index]) && !heldpoke - pbDisplay(_INTL("That's your last Pokemon!")) + pbDisplay(_INTL("That's your last Pokémon!")) elsif @storage[box,index].mail pbDisplay(_INTL("Please remove the Mail.")) @@ -299,5 +299,5 @@ index=selected[1] if box==-1 && pbAble?(@storage[box,index]) && pbAbleCount<=1 - pbDisplay(_INTL("That's your last Pokemon!")) + pbDisplay(_INTL("That's your last Pokémon!")) return end @@ -315,5 +315,5 @@ end if box==-1 && pbAble?(@storage[box,index]) && pbAbleCount<=1 && !pbAble?(@heldpkmn) - pbDisplay(_INTL("That's your last Pokemon!")) + pbDisplay(_INTL("That's your last Pokémon!")) return false end @@ -388,15 +388,15 @@ commands=[ - _INTL("WITHDRAW POKeMON"), - _INTL("DEPOSIT POKeMON"), - _INTL("MOVE POKeMON"), + _INTL("WITHDRAW POKéMON"), + _INTL("DEPOSIT POKéMON"), + _INTL("MOVE POKéMON"), _INTL("MOVE ITEMS"), _INTL("SEE YA!") ] helptext=[ - _INTL("Move Pokemon stored in boxes to your party."), - _INTL("Store Pokemon in your party in Boxes."), - _INTL("Organize the Pokemon in Boxes and in your party."), - _INTL("Move items held by any Pokemon in a Box and your party."), + _INTL("Move Pokémon stored in boxes to your party."), + _INTL("Store Pokémon in your party in Boxes."), + _INTL("Organize the Pokémon in Boxes and in your party."), + _INTL("Move items held by any Pokémon in a Box and your party."), _INTL("Return to the previous menu."), ] @@ -438,5 +438,5 @@ _INTL("SKY"), _INTL("STARS"), - _INTL("POKeCENTER"), + _INTL("POKéCENTER"), _INTL("TILES"), _INTL("SIMPLE") @@ -465,5 +465,5 @@ end end - if selected && selected[0]==-2 # Party Pokemon + if selected && selected[0]==-2 # Party Pokémon pbDisplay(_INTL("Which one will you take?")) next @@ -540,5 +540,5 @@ if selected && selected[0]==-3 # Close box if pbHeldPokemon - pbDisplay(_INTL("You're holding a Pokemon!")) + pbDisplay(_INTL("You're holding a Pokémon!")) next end @@ -551,5 +551,5 @@ if selected==nil if pbHeldPokemon - pbDisplay(_INTL("You're holding a Pokemon!")) + pbDisplay(_INTL("You're holding a Pokémon!")) next end @@ -636,8 +636,8 @@ when 1 pkmn.genCodes("codes.txt") - pbDisplay(_INTL("Codes for this Pokemon were saved in codes.txt.")) + pbDisplay(_INTL("Codes for this Pokémon were saved in codes.txt.")) when 2 level=Kernel.pbMessageChooseNumberEx( - _INTL("Set the Pokemon's level."),pkmn.level,1,PBExperience::MAXLEVEL,pkmn.level) + _INTL("Set the Pokémon's level."),pkmn.level,1,PBExperience::MAXLEVEL,pkmn.level) if level!=pkmn.level pkmn.level=level @@ -674,7 +674,7 @@ pkmn.calcStats if pkmn.nature!=command - pbDisplay(_INTL("The Pokemon's nature couldn't be changed.")) + pbDisplay(_INTL("The Pokémon's nature couldn't be changed.")) else - pbDisplay(_INTL("The Pokemon's nature was changed.")) + pbDisplay(_INTL("The Pokémon's nature was changed.")) end end @@ -682,7 +682,7 @@ when 5 if pkmn.gender==2 - pbDisplay(_INTL("This Pokemon's gender can't be set.")) + pbDisplay(_INTL("This Pokémon's gender can't be set.")) elsif pkmn.gender==0 - if pbConfirm(_INTL("Make this Pokemon female?")) + if pbConfirm(_INTL("Make this Pokémon female?")) oldnature=pkmn.nature 2000.times do @@ -691,11 +691,11 @@ end if pkmn.gender==0 - pbDisplay(_INTL("The Pokemon's gender couldn't be changed.")) + pbDisplay(_INTL("The Pokémon's gender couldn't be changed.")) else - pbDisplay(_INTL("The Pokemon's gender was changed.")) + pbDisplay(_INTL("The Pokémon's gender was changed.")) end end elsif pkmn.gender==1 - if pbConfirm(_INTL("Make this Pokemon male?")) + if pbConfirm(_INTL("Make this Pokémon male?")) oldnature=pkmn.nature 2000.times do @@ -704,7 +704,7 @@ end if pkmn.gender==1 - pbDisplay(_INTL("The Pokemon's gender couldn't be changed.")) + pbDisplay(_INTL("The Pokémon's gender couldn't be changed.")) else - pbDisplay(_INTL("The Pokemon's gender was changed.")) + pbDisplay(_INTL("The Pokémon's gender was changed.")) end end @@ -717,5 +717,5 @@ if @storage.pbMoveCaughtToParty(clonedpkmn) if selected[0]!=-1 - pbDisplay(_INTL("The duplicated Pokemon was moved to your party.")) + pbDisplay(_INTL("The duplicated Pokémon was moved to your party.")) end else @@ -725,5 +725,5 @@ pbDisplay(_INTL("All boxes are full.")) elsif newbox!=oldbox - pbDisplay(_INTL("The duplicated Pokemon was moved to box \"{1}.\"", + pbDisplay(_INTL("The duplicated Pokémon was moved to box \"{1}.\"", @storage[newbox].name)) @storage.currentBox=oldbox @@ -732,5 +732,5 @@ @scene.pbHardRefresh when 7 - if pbConfirm(_INTL("Are you sure you want to delete this Pokemon?")) + if pbConfirm(_INTL("Are you sure you want to delete this Pokémon?")) @scene.pbRelease(selected,heldpoke) if heldpoke @@ -740,5 +740,5 @@ end @scene.pbRefresh - pbDisplay(_INTL("The Pokemon was deleted.")) + pbDisplay(_INTL("The Pokémon was deleted.")) end when 8 @@ -1360,5 +1360,5 @@ arrow.y=-8 arrow.x=146*2 - when -2 # Party Pokemon + when -2 # Party Pokémon arrow.angle=180 arrow.ox=64 @@ -1695,5 +1695,5 @@ @selection=selection return [-4,-1] - elsif selection==-2 # Party Pokemon + elsif selection==-2 # Party Pokémon @selection=selection return [-2,-1] @@ -1719,5 +1719,5 @@ ret=pbSelectBoxInternal(party) end - if @choseFromParty || (ret && ret[0]==-2) # Party Pokemon + if @choseFromParty || (ret && ret[0]==-2) # Party Pokémon if !@choseFromParty pbDropDownPartyTab @@ -2081,10 +2081,10 @@ if command==0 Audio.se_play("Audio/SE/accesspc.wav") - Kernel.pbMessage(_INTL("The Pokemon Storage System was opened.")) + Kernel.pbMessage(_INTL("The Pokémon Storage System was opened.")) loop do command=Kernel.pbMessage(_INTL("What do you want to do?"),[ - _INTL("WITHDRAW POKeMON"), - _INTL("DEPOSIT POKeMON"), - _INTL("MOVE POKeMON"), + _INTL("WITHDRAW POKéMON"), + _INTL("DEPOSIT POKéMON"), + _INTL("MOVE POKéMON"), _INTL("SEE YA!") ],4) @@ -2095,5 +2095,5 @@ end if command==1 && $Trainer.pokemonCount<=1 - Kernel.pbMessage(_INTL("Can't deposit the last Pokemon!")) + Kernel.pbMessage(_INTL("Can't deposit the last Pokémon!")) next end Changed: DependentEvents --- Left +++ Right @@ -418,4 +418,7 @@ end end + # Original map ID, original event ID, current map ID, + # event X, event Y, event direction, event's filename, + # event's hue, event's name, common event ID eventData=[ $game_map.map_id,event.id,$game_map.map_id, Changed: Scene_Intro --- Left +++ Right @@ -23,8 +23,8 @@ def setTitle(sprite,title) @cache={} if !@cache - if !@cache[title] - @cache[title]=Bitmap.new("Graphics/Titles/#{title}") + if @currentTitle!=title + sprite.setBitmap("Graphics/Titles/#{title}") + @currentTitle=title end - sprite.bitmap=@cache[title] end #-------------------------------------------------------------------------- @@ -40,9 +40,9 @@ @item, @speed, @o_speed, @phase = 0, 15, 20, 0 # Background Images - @sprite = Sprite.new - setTitle(@sprite,@pics[@item]) - @sprite.opacity = 5 + @sprite = GifSprite.new + setTitle(@sprite, @pics[@item]) + @sprite.opacity = 5 # Start Logo - @start = Sprite.new + @start = GifSprite.new setTitle(@start,"Start") @start.y, @start.z, @start.opacity = 250, 10, 0 @@ -56,4 +56,5 @@ Input.update # Frame update + @sprite.update case @phase when 0; intro_update # Into Updating Changed: PokeBattle_Scene --- Left +++ Right @@ -234,5 +234,5 @@ def pbForgetMove(pkmn,move) -# Called whenever a Pokemon should forget a move. It +# Called whenever a Pokémon should forget a move. It # should return -1 if the selection is canceled, or 0 to 3 # to indicate the move to forget. The function should not @@ -248,8 +248,8 @@ # Return values: # 0 - Fight -# 1 - Pokemon +# 1 - Pokémon # 2 - Bag # 3 - Run - commands=["FIGHT","POKeMON","BAG","RUN"] + commands=["FIGHT","POKéMON","BAG","RUN"] cw = Window_Command.new(192, commands) cw.x=0 @@ -302,5 +302,5 @@ def pbFightMenu(index) -# Use this method to display the list of moves for a Pokemon +# Use this method to display the list of moves for a Pokémon moves=@battle.battlers[index].moves commands=[ @@ -484,5 +484,5 @@ def pbHPChanged(pkmn,oldhp) -# This method is called whenever a Pokemon's HP changes. +# This method is called whenever a Pokémon's HP changes. # Used to animate the HP bar. hpchange=pkmn.hp-oldhp @@ -497,5 +497,5 @@ def pbFainted(pkmn) -# This method is called whenever a Pokemon faints +# This method is called whenever a Pokémon faints end @@ -513,5 +513,5 @@ def pbChooseNewEnemy(index,party) -# Use this method to choose a new Pokemon for the enemy +# Use this method to choose a new Pokémon for the enemy # The enemy's party is guaranteed to have at least one choosable member. for i in 0..party.length-1 @@ -522,5 +522,5 @@ def pbWildBattleSuccess -# This method is called when the player wins a wild Pokemon battle. +# This method is called when the player wins a wild Pokémon battle. # This method can change the battle's music for example. end @@ -607,5 +607,5 @@ def pbForgetMove(pkmn,move) -# Called whenever a Pokemon should forget a move. It +# Called whenever a Pokémon should forget a move. It # should return -1 if the selection is canceled, or 0 to 3 # to indicate the move to forget. The function should not @@ -641,5 +641,5 @@ def pbHPChanged(pkmn,oldhp) -# This method is called whenever a Pokemon's HP changes. +# This method is called whenever a Pokémon's HP changes. # Used to animate the HP bar. hpchange=pkmn.hp-oldhp @@ -654,5 +654,5 @@ def pbFainted(pkmn) -# This method is called whenever a Pokemon faints +# This method is called whenever a Pokémon faints end @@ -670,5 +670,5 @@ def pbChooseNewEnemy(index,party) -# Use this method to choose a new Pokemon for the enemy +# Use this method to choose a new Pokémon for the enemy # The enemy's party is guaranteed to have at least one choosable member. for i in 0..party.length-1 @@ -679,5 +679,5 @@ def pbWildBattleSuccess -# This method is called when the player wins a wild Pokemon battle. +# This method is called when the player wins a wild Pokémon battle. # This method can change the battle's music for example. end Changed: PokemonDebug --- Left +++ Right @@ -909,10 +909,10 @@ $Trainer.owned[i]=true end - Kernel.pbMessage(_INTL("Boxes were filled with one Pokemon of each species.")) + Kernel.pbMessage(_INTL("Boxes were filled with one Pokémon of each species.")) elsif ret==7 for i in $Trainer.party i.heal end - Kernel.pbMessage(_INTL("Your Pokemon were healed.")) + Kernel.pbMessage(_INTL("Your Pokémon were healed.")) elsif ret==8 qty=Kernel.pbMessageChooseNumber( @@ -937,5 +937,5 @@ if !FileTest.exist?("Ruby.sav") Kernel.pbMessage(_INTL("The file \"ruby.sav\" was not found.")) - Kernel.pbMessage(_INTL("Please put a save from Pokemon Ruby/Emerald/Sapphire, name it ruby.sav, and try again.")) + Kernel.pbMessage(_INTL("Please put a save from Pokémon Ruby/Emerald/Sapphire, name it ruby.sav, and try again.")) else File.open("Ruby.sav","rb"){|f| @@ -978,5 +978,5 @@ end } - Kernel.pbMessage(_INTL("Pokemon from the save file were added to the Pokemon Boxes.")) + Kernel.pbMessage(_INTL("Pokémon from the save file were added to the Pokémon Boxes.")) end elsif ret==12 @@ -1025,5 +1025,5 @@ if species!=0 level=Kernel.pbMessageChooseNumber( - _INTL("Set the Pokemon's level."),5,3,nil,PBExperience::MAXLEVEL) + _INTL("Set the Pokémon's level."),5,3,nil,PBExperience::MAXLEVEL) pbAddPokemon(species,level) end Changed: PokemonBugContest --- Left +++ Right @@ -252,5 +252,5 @@ _INTL("Park Balls: {1}",@ballcount), _INTL("FIGHT"), - _INTL("POKeMON"), + _INTL("POKéMON"), _INTL("BALL"), _INTL("RUN") @@ -261,10 +261,10 @@ lastPokemon=pbBugContestState.lastPokemon pbDisplayPaused(_INTL("You already caught a {1}.",lastPokemon.name)) - helptext=_INTL("STOCK POKeMON:\n {1} Lv{2} MaxHP: {3}\nTHIS POKeMON:\n {4} Lv{5} MaxHP: {6}", + helptext=_INTL("STOCK POKéMON:\n {1} Lv{2} MaxHP: {3}\nTHIS POKéMON:\n {4} Lv{5} MaxHP: {6}", lastPokemon.name,lastPokemon.level,lastPokemon.totalhp, pokemon.name,pokemon.level,pokemon.totalhp ) @scene.pbShowHelp(helptext) - if pbDisplayConfirm(_INTL("Switch Pokemon?")) + if pbDisplayConfirm(_INTL("Switch Pokémon?")) pbBugContestState.lastPokemon=pokemon @scene.pbHideHelp Changed: PokemonOrgBattle --- Left +++ Right @@ -526,5 +526,5 @@ screen=PokemonScreen.new(scene,$Trainer.party) eligibility=[] - # Determine eligibility of all Pokemon + # Determine eligibility of all Pokémon for pokemon in $Trainer.party if pbIsBanned?(pokemon) @@ -540,5 +540,5 @@ # Set party pbBattleChallenge.setParty(ret) - # Continue (return true) if Pokemon were chosen + # Continue (return true) if Pokémon were chosen retval=(ret!=nil && ret.length>0) } @@ -638,5 +638,5 @@ end -# Checks whether a Pokemon can participate in an +# Checks whether a Pokémon can participate in an # organized battle def pbIsEligible?(pokemon) @@ -662,5 +662,5 @@ end =end - # Variable wasn't set, assume Pokemon is eligible + # Variable wasn't set, assume Pokémon is eligible return true end