diff --git a/Data/Scripts/004_Sprites/002_Sprite_Timer.rb b/Data/Scripts/004_Sprites/002_Sprite_Timer.rb index dd3b97362..4e5b26274 100644 --- a/Data/Scripts/004_Sprites/002_Sprite_Timer.rb +++ b/Data/Scripts/004_Sprites/002_Sprite_Timer.rb @@ -19,6 +19,7 @@ class Sprite_Timer def update return if disposed? if $game_system.timer_working + @timer.visible = true if @timer if !@timer @timer=Window_AdvancedTextPokemon.newWithSize("",Graphics.width-120,0,120,64) @timer.width=@timer.borderX+96 diff --git a/Data/Scripts/012_Battle/001_Battler/001_PokeBattle_Battler.rb b/Data/Scripts/012_Battle/001_Battler/001_PokeBattle_Battler.rb index 9a97c20ae..45729251c 100644 --- a/Data/Scripts/012_Battle/001_Battler/001_PokeBattle_Battler.rb +++ b/Data/Scripts/012_Battle/001_Battler/001_PokeBattle_Battler.rb @@ -119,6 +119,7 @@ class PokeBattle_Battler def statusCount=(value) @statusCount = value @pokemon.statusCount = value if @pokemon + @battle.scene.pbRefreshOne(@index) end #============================================================================= diff --git a/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb b/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb index d7898c229..98a2d5109 100644 --- a/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb +++ b/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb @@ -48,7 +48,7 @@ class PokeBattle_Move_003 < PokeBattle_SleepMove return if @id != :RELICSONG return if !user.isSpecies?(:MELOETTA) return if user.hasActiveAbility?(:SHEERFORCE) && @addlEffect>0 - newForm = (oldForm+1)%2 + newForm = (user.Form+1)%2 user.pbChangeForm(newForm,_INTL("{1} transformed!",user.pbThis)) end end diff --git a/Data/Scripts/012_Battle/002_Move/006_Move_Effects_080-0FF.rb b/Data/Scripts/012_Battle/002_Move/006_Move_Effects_080-0FF.rb index 1791e539c..08ed4d4ef 100644 --- a/Data/Scripts/012_Battle/002_Move/006_Move_Effects_080-0FF.rb +++ b/Data/Scripts/012_Battle/002_Move/006_Move_Effects_080-0FF.rb @@ -3019,7 +3019,7 @@ class PokeBattle_Move_0EB < PokeBattle_Move next if b.fainted? || b.damageState.unaffected || switchedBattlers.include?(b.index) newPkmn = @battle.pbGetReplacementPokemonIndex(b.index,true) # Random next if newPkmn<0 - @battle.pbRecallAndReplace(b.index,newPkmn) + @battle.pbRecallAndReplace(b.index, newPkmn, true) @battle.pbDisplay(_INTL("{1} was dragged out!",b.pbThis)) @battle.pbClearChoice(b.index) # Replacement Pokémon does nothing this round switchedBattlers.push(b.index) @@ -3061,7 +3061,7 @@ class PokeBattle_Move_0EC < PokeBattle_Move next if b.hasActiveAbility?(:SUCTIONCUPS) && !@battle.moldBreaker newPkmn = @battle.pbGetReplacementPokemonIndex(b.index,true) # Random next if newPkmn<0 - @battle.pbRecallAndReplace(b.index,newPkmn) + @battle.pbRecallAndReplace(b.index, newPkmn, true) @battle.pbDisplay(_INTL("{1} was dragged out!",b.pbThis)) @battle.pbClearChoice(b.index) # Replacement Pokémon does nothing this round switchedBattlers.push(b.index) @@ -3098,7 +3098,7 @@ class PokeBattle_Move_0ED < PokeBattle_Move return if user.fainted? newPkmn = @battle.pbGetReplacementPokemonIndex(user.index) # Owner chooses return if newPkmn<0 - @battle.pbRecallAndReplace(user.index,newPkmn,true) + @battle.pbRecallAndReplace(user.index, newPkmn, false, true) @battle.pbClearChoice(user.index) # Replacement Pokémon does nothing this round @battle.moldBreaker = false switchedBattlers.push(user.index) diff --git a/Data/Scripts/012_Battle/003_Battle/006_Battle_Action_Switching.rb b/Data/Scripts/012_Battle/003_Battle/006_Battle_Action_Switching.rb index f9b49f727..65ff9a614 100644 --- a/Data/Scripts/012_Battle/003_Battle/006_Battle_Action_Switching.rb +++ b/Data/Scripts/012_Battle/003_Battle/006_Battle_Action_Switching.rb @@ -223,11 +223,11 @@ class PokeBattle_Battle end # Actually performs the recalling and sending out in all situations. - def pbRecallAndReplace(idxBattler,idxParty,batonPass=false) + def pbRecallAndReplace(idxBattler,idxParty,randomReplacement=false,batonPass=false) @scene.pbRecall(idxBattler) if !@battlers[idxBattler].fainted? @battlers[idxBattler].pbAbilitiesOnSwitchOut # Inc. primordial weather check @scene.pbShowPartyLineup(idxBattler&1) if pbSideSize(idxBattler)==1 - pbMessagesOnReplace(idxBattler,idxParty) + pbMessagesOnReplace(idxBattler,idxParty) if !randomReplacement pbReplace(idxBattler,idxParty,batonPass) end diff --git a/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb b/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb index 95b22d9a2..5ac71c702 100644 --- a/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb +++ b/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb @@ -1238,7 +1238,7 @@ BattleHandlers::TargetItemAfterMoveUse.add(:REDCARD, battle.pbDisplay(_INTL("{1} held up its {2} against {3}!", battler.pbThis,battler.itemName,user.pbThis(true))) battler.pbConsumeItem - battle.pbRecallAndReplace(user.index,newPkmn) + battle.pbRecallAndReplace(user.index, newPkmn, true) battle.pbDisplay(_INTL("{1} was dragged out!",user.pbThis)) battle.pbClearChoice(user.index) # Replacement Pokémon does nothing this round switched.push(user.index) diff --git a/Data/Scripts/013_Overworld/006_PField_Battles.rb b/Data/Scripts/013_Overworld/006_PField_Battles.rb index fe57f9220..9ed9f1357 100644 --- a/Data/Scripts/013_Overworld/006_PField_Battles.rb +++ b/Data/Scripts/013_Overworld/006_PField_Battles.rb @@ -266,6 +266,7 @@ def pbWildBattleCore(*args) $Trainer.party.each { |pkmn| playerParty.push(pkmn) } playerPartyStarts.push(playerParty.length) ally.party.each { |pkmn| playerParty.push(pkmn) } + setBattleRule("double") if !$PokemonTemp.battleRules["size"] end # Create the battle scene (the visual side of it) scene = pbNewBattleScene @@ -411,6 +412,7 @@ def pbTrainerBattleCore(*args) $Trainer.party.each { |pkmn| playerParty.push(pkmn) } playerPartyStarts.push(playerParty.length) ally.party.each { |pkmn| playerParty.push(pkmn) } + setBattleRule("double") if !$PokemonTemp.battleRules["size"] end # Create the battle scene (the visual side of it) scene = pbNewBattleScene diff --git a/Data/Scripts/014_Trainers/001_PokeBattle_Trainer.rb b/Data/Scripts/014_Trainers/001_PokeBattle_Trainer.rb index 77ffef5a5..590d5437d 100644 --- a/Data/Scripts/014_Trainers/001_PokeBattle_Trainer.rb +++ b/Data/Scripts/014_Trainers/001_PokeBattle_Trainer.rb @@ -169,13 +169,13 @@ class PokeBattle_Trainer def pokedexSeen(region=-1) # Number of Pokémon seen ret=0 if region==-1 - for i in 0..PBSpecies.maxValue + for i in 1..PBSpecies.maxValue ret+=1 if @seen[i] end else regionlist=pbAllRegionalSpecies(region) for i in regionlist - ret+=1 if @seen[i] + ret+=1 if i > 0 && @seen[i] end end return ret diff --git a/Data/Scripts/015_Items/001_PItem_Items.rb b/Data/Scripts/015_Items/001_PItem_Items.rb index f4d0a1647..f0dac6e50 100644 --- a/Data/Scripts/015_Items/001_PItem_Items.rb +++ b/Data/Scripts/015_Items/001_PItem_Items.rb @@ -255,14 +255,12 @@ def pbRestorePP(pkmn,idxMove,pp) return newpp-oldpp end -def pbBattleRestorePP(pkmn,battler,idxMove,pp) - if pbRestorePP(pkmn,idxMove,pp)>0 - if battler && !battler.effects[PBEffects::Transform] && - battler.moves[idxMove] && battler.moves[idxMove].id==pkmn.moves[idxMove].id - battler.pbSetPP(battler.moves[idxMove],pkmn.moves[idxMove].pp) - end +def pbBattleRestorePP(pkmn, battler, idxMove, pp) + return if pbRestorePP(pkmn,idxMove,pp) == 0 + if battler && !battler.effects[PBEffects::Transform] && + battler.moves[idxMove] && battler.moves[idxMove].id == pkmn.moves[idxMove].id + battler.pbSetPP(battler.moves[idxMove], pkmn.moves[idxMove].pp) end - return ret end #=============================================================================== diff --git a/Data/Scripts/016_Pokemon/005_Pokemon_Evolution.rb b/Data/Scripts/016_Pokemon/005_Pokemon_Evolution.rb index 860d2645e..4826b3ea0 100644 --- a/Data/Scripts/016_Pokemon/005_Pokemon_Evolution.rb +++ b/Data/Scripts/016_Pokemon/005_Pokemon_Evolution.rb @@ -163,7 +163,7 @@ def pbGetBabySpecies(species, check_items = false, item1 = nil, item2 = nil) end break end - ret = pbGetBabySpecies(ret) if ret != species + ret = pbGetBabySpecies(ret, item1, item2) if ret != species return ret end diff --git a/Data/Scripts/018_Minigames/001_PMinigame_Duel.rb b/Data/Scripts/018_Minigames/001_PMinigame_Duel.rb index 99942e94a..7a1bb3d13 100644 --- a/Data/Scripts/018_Minigames/001_PMinigame_Duel.rb +++ b/Data/Scripts/018_Minigames/001_PMinigame_Duel.rb @@ -64,7 +64,7 @@ class PokemonDuel @sprites["player"].x += distance_per_frame @sprites["playerwindow"].x += distance_per_frame @sprites["opponent"].x -= distance_per_frame - @sprites["opponentwindow"].x -= distandistance_per_framecePerFrame + @sprites["opponentwindow"].x -= distance_per_frame Graphics.update Input.update pbUpdateSceneMap diff --git a/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb b/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb index 7813548b8..e04f18164 100644 --- a/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb +++ b/Data/Scripts/020_System and utilities/005_PSystem_Utilities.rb @@ -908,7 +908,7 @@ def pbAllRegionalSpecies(region) dexList = pbLoadRegionalDexes[region] return ret if !dexList || dexList.length==0 for i in 0...dexList.length - ret[dexList[i]] = i if dexList[i] + ret[dexList[i]] = i if dexList[i] && dexList[i] > 0 end ret.map! { |e| e ? e : 0 } # Replace nils with 0s return ret diff --git a/Data/Scripts/021_Debug/005_Editor_SaveData.rb b/Data/Scripts/021_Debug/005_Editor_SaveData.rb index 8a0f879e9..5b3effaf6 100644 --- a/Data/Scripts/021_Debug/005_Editor_SaveData.rb +++ b/Data/Scripts/021_Debug/005_Editor_SaveData.rb @@ -1330,7 +1330,7 @@ end # Save Shadow move data to PBS file #=============================================================================== def pbSaveShadowMoves - moves = pbLoadShadowMovesets + shadow_movesets = pbLoadShadowMovesets File.open("PBS/shadowmoves.txt","wb") { |f| f.write(0xEF.chr) f.write(0xBB.chr) @@ -1338,14 +1338,14 @@ def pbSaveShadowMoves f.write("\# "+_INTL("See the documentation on the wiki to learn how to edit this file.")) f.write("\r\n") f.write("\#-------------------------------\r\n") - for i in 0...moves.length - move = moves[i] - next if !move || moves.length==0 + for i in 0...shadow_movesets.length + moveset = shadow_movesets[i] + next if !moveset || moveset.length==0 constname = (getConstantName(PBSpecies,i) rescue pbGetSpeciesConst(i) rescue nil) next if !constname f.write(sprintf("%s = ",constname)) movenames = [] - for m in move + for m in moveset movenames.push(GameData::Move.get(m).id.to_s) end f.write(sprintf("%s\r\n",movenames.compact.join(","))) diff --git a/Data/Scripts/021_Debug/010_Editor_TilesetEditor.rb b/Data/Scripts/021_Debug/010_Editor_TilesetEditor.rb index 2471519de..7650c6125 100644 --- a/Data/Scripts/021_Debug/010_Editor_TilesetEditor.rb +++ b/Data/Scripts/021_Debug/010_Editor_TilesetEditor.rb @@ -101,9 +101,9 @@ class PokemonTilesetScene @x = 0 @y = -TILE_SIZE @topy = -TILE_SIZE + height = @sprites["tileset"].bitmap.height pbUpdateTileset pbFadeInAndShow(@sprites) - height = @sprites["tileset"].bitmap.height ######## loop do Graphics.update @@ -161,6 +161,7 @@ class PokemonTilesetScene pbUpdateTileset when 2 pbChooseTileset + height = @sprites["tileset"].bitmap.height end elsif Input.trigger?(Input::B) if pbConfirmMessage(_INTL("Save changes?"))