Merge branch 'master' into dev

This commit is contained in:
Maruno17
2020-11-25 22:07:17 +00:00
14 changed files with 28 additions and 25 deletions

View File

@@ -19,6 +19,7 @@ class Sprite_Timer
def update def update
return if disposed? return if disposed?
if $game_system.timer_working if $game_system.timer_working
@timer.visible = true if @timer
if !@timer if !@timer
@timer=Window_AdvancedTextPokemon.newWithSize("",Graphics.width-120,0,120,64) @timer=Window_AdvancedTextPokemon.newWithSize("",Graphics.width-120,0,120,64)
@timer.width=@timer.borderX+96 @timer.width=@timer.borderX+96

View File

@@ -119,6 +119,7 @@ class PokeBattle_Battler
def statusCount=(value) def statusCount=(value)
@statusCount = value @statusCount = value
@pokemon.statusCount = value if @pokemon @pokemon.statusCount = value if @pokemon
@battle.scene.pbRefreshOne(@index)
end end
#============================================================================= #=============================================================================

View File

@@ -48,7 +48,7 @@ class PokeBattle_Move_003 < PokeBattle_SleepMove
return if @id != :RELICSONG return if @id != :RELICSONG
return if !user.isSpecies?(:MELOETTA) return if !user.isSpecies?(:MELOETTA)
return if user.hasActiveAbility?(:SHEERFORCE) && @addlEffect>0 return if user.hasActiveAbility?(:SHEERFORCE) && @addlEffect>0
newForm = (oldForm+1)%2 newForm = (user.Form+1)%2
user.pbChangeForm(newForm,_INTL("{1} transformed!",user.pbThis)) user.pbChangeForm(newForm,_INTL("{1} transformed!",user.pbThis))
end end
end end

View File

@@ -3019,7 +3019,7 @@ class PokeBattle_Move_0EB < PokeBattle_Move
next if b.fainted? || b.damageState.unaffected || switchedBattlers.include?(b.index) next if b.fainted? || b.damageState.unaffected || switchedBattlers.include?(b.index)
newPkmn = @battle.pbGetReplacementPokemonIndex(b.index,true) # Random newPkmn = @battle.pbGetReplacementPokemonIndex(b.index,true) # Random
next if newPkmn<0 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.pbDisplay(_INTL("{1} was dragged out!",b.pbThis))
@battle.pbClearChoice(b.index) # Replacement Pokémon does nothing this round @battle.pbClearChoice(b.index) # Replacement Pokémon does nothing this round
switchedBattlers.push(b.index) switchedBattlers.push(b.index)
@@ -3061,7 +3061,7 @@ class PokeBattle_Move_0EC < PokeBattle_Move
next if b.hasActiveAbility?(:SUCTIONCUPS) && !@battle.moldBreaker next if b.hasActiveAbility?(:SUCTIONCUPS) && !@battle.moldBreaker
newPkmn = @battle.pbGetReplacementPokemonIndex(b.index,true) # Random newPkmn = @battle.pbGetReplacementPokemonIndex(b.index,true) # Random
next if newPkmn<0 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.pbDisplay(_INTL("{1} was dragged out!",b.pbThis))
@battle.pbClearChoice(b.index) # Replacement Pokémon does nothing this round @battle.pbClearChoice(b.index) # Replacement Pokémon does nothing this round
switchedBattlers.push(b.index) switchedBattlers.push(b.index)
@@ -3098,7 +3098,7 @@ class PokeBattle_Move_0ED < PokeBattle_Move
return if user.fainted? return if user.fainted?
newPkmn = @battle.pbGetReplacementPokemonIndex(user.index) # Owner chooses newPkmn = @battle.pbGetReplacementPokemonIndex(user.index) # Owner chooses
return if newPkmn<0 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.pbClearChoice(user.index) # Replacement Pokémon does nothing this round
@battle.moldBreaker = false @battle.moldBreaker = false
switchedBattlers.push(user.index) switchedBattlers.push(user.index)

View File

@@ -223,11 +223,11 @@ class PokeBattle_Battle
end end
# Actually performs the recalling and sending out in all situations. # 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? @scene.pbRecall(idxBattler) if !@battlers[idxBattler].fainted?
@battlers[idxBattler].pbAbilitiesOnSwitchOut # Inc. primordial weather check @battlers[idxBattler].pbAbilitiesOnSwitchOut # Inc. primordial weather check
@scene.pbShowPartyLineup(idxBattler&1) if pbSideSize(idxBattler)==1 @scene.pbShowPartyLineup(idxBattler&1) if pbSideSize(idxBattler)==1
pbMessagesOnReplace(idxBattler,idxParty) pbMessagesOnReplace(idxBattler,idxParty) if !randomReplacement
pbReplace(idxBattler,idxParty,batonPass) pbReplace(idxBattler,idxParty,batonPass)
end end

View File

@@ -1238,7 +1238,7 @@ BattleHandlers::TargetItemAfterMoveUse.add(:REDCARD,
battle.pbDisplay(_INTL("{1} held up its {2} against {3}!", battle.pbDisplay(_INTL("{1} held up its {2} against {3}!",
battler.pbThis,battler.itemName,user.pbThis(true))) battler.pbThis,battler.itemName,user.pbThis(true)))
battler.pbConsumeItem battler.pbConsumeItem
battle.pbRecallAndReplace(user.index,newPkmn) battle.pbRecallAndReplace(user.index, newPkmn, true)
battle.pbDisplay(_INTL("{1} was dragged out!",user.pbThis)) battle.pbDisplay(_INTL("{1} was dragged out!",user.pbThis))
battle.pbClearChoice(user.index) # Replacement Pokémon does nothing this round battle.pbClearChoice(user.index) # Replacement Pokémon does nothing this round
switched.push(user.index) switched.push(user.index)

View File

@@ -266,6 +266,7 @@ def pbWildBattleCore(*args)
$Trainer.party.each { |pkmn| playerParty.push(pkmn) } $Trainer.party.each { |pkmn| playerParty.push(pkmn) }
playerPartyStarts.push(playerParty.length) playerPartyStarts.push(playerParty.length)
ally.party.each { |pkmn| playerParty.push(pkmn) } ally.party.each { |pkmn| playerParty.push(pkmn) }
setBattleRule("double") if !$PokemonTemp.battleRules["size"]
end end
# Create the battle scene (the visual side of it) # Create the battle scene (the visual side of it)
scene = pbNewBattleScene scene = pbNewBattleScene
@@ -411,6 +412,7 @@ def pbTrainerBattleCore(*args)
$Trainer.party.each { |pkmn| playerParty.push(pkmn) } $Trainer.party.each { |pkmn| playerParty.push(pkmn) }
playerPartyStarts.push(playerParty.length) playerPartyStarts.push(playerParty.length)
ally.party.each { |pkmn| playerParty.push(pkmn) } ally.party.each { |pkmn| playerParty.push(pkmn) }
setBattleRule("double") if !$PokemonTemp.battleRules["size"]
end end
# Create the battle scene (the visual side of it) # Create the battle scene (the visual side of it)
scene = pbNewBattleScene scene = pbNewBattleScene

View File

@@ -169,13 +169,13 @@ class PokeBattle_Trainer
def pokedexSeen(region=-1) # Number of Pokémon seen def pokedexSeen(region=-1) # Number of Pokémon seen
ret=0 ret=0
if region==-1 if region==-1
for i in 0..PBSpecies.maxValue for i in 1..PBSpecies.maxValue
ret+=1 if @seen[i] ret+=1 if @seen[i]
end end
else else
regionlist=pbAllRegionalSpecies(region) regionlist=pbAllRegionalSpecies(region)
for i in regionlist for i in regionlist
ret+=1 if @seen[i] ret+=1 if i > 0 && @seen[i]
end end
end end
return ret return ret

View File

@@ -255,14 +255,12 @@ def pbRestorePP(pkmn,idxMove,pp)
return newpp-oldpp return newpp-oldpp
end end
def pbBattleRestorePP(pkmn,battler,idxMove,pp) def pbBattleRestorePP(pkmn, battler, idxMove, pp)
if pbRestorePP(pkmn,idxMove,pp)>0 return if pbRestorePP(pkmn,idxMove,pp) == 0
if battler && !battler.effects[PBEffects::Transform] && if battler && !battler.effects[PBEffects::Transform] &&
battler.moves[idxMove] && battler.moves[idxMove].id==pkmn.moves[idxMove].id battler.moves[idxMove] && battler.moves[idxMove].id == pkmn.moves[idxMove].id
battler.pbSetPP(battler.moves[idxMove],pkmn.moves[idxMove].pp) battler.pbSetPP(battler.moves[idxMove], pkmn.moves[idxMove].pp)
end end
end
return ret
end end
#=============================================================================== #===============================================================================

View File

@@ -163,7 +163,7 @@ def pbGetBabySpecies(species, check_items = false, item1 = nil, item2 = nil)
end end
break break
end end
ret = pbGetBabySpecies(ret) if ret != species ret = pbGetBabySpecies(ret, item1, item2) if ret != species
return ret return ret
end end

View File

@@ -64,7 +64,7 @@ class PokemonDuel
@sprites["player"].x += distance_per_frame @sprites["player"].x += distance_per_frame
@sprites["playerwindow"].x += distance_per_frame @sprites["playerwindow"].x += distance_per_frame
@sprites["opponent"].x -= distance_per_frame @sprites["opponent"].x -= distance_per_frame
@sprites["opponentwindow"].x -= distandistance_per_framecePerFrame @sprites["opponentwindow"].x -= distance_per_frame
Graphics.update Graphics.update
Input.update Input.update
pbUpdateSceneMap pbUpdateSceneMap

View File

@@ -908,7 +908,7 @@ def pbAllRegionalSpecies(region)
dexList = pbLoadRegionalDexes[region] dexList = pbLoadRegionalDexes[region]
return ret if !dexList || dexList.length==0 return ret if !dexList || dexList.length==0
for i in 0...dexList.length for i in 0...dexList.length
ret[dexList[i]] = i if dexList[i] ret[dexList[i]] = i if dexList[i] && dexList[i] > 0
end end
ret.map! { |e| e ? e : 0 } # Replace nils with 0s ret.map! { |e| e ? e : 0 } # Replace nils with 0s
return ret return ret

View File

@@ -1330,7 +1330,7 @@ end
# Save Shadow move data to PBS file # Save Shadow move data to PBS file
#=============================================================================== #===============================================================================
def pbSaveShadowMoves def pbSaveShadowMoves
moves = pbLoadShadowMovesets shadow_movesets = pbLoadShadowMovesets
File.open("PBS/shadowmoves.txt","wb") { |f| File.open("PBS/shadowmoves.txt","wb") { |f|
f.write(0xEF.chr) f.write(0xEF.chr)
f.write(0xBB.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("\# "+_INTL("See the documentation on the wiki to learn how to edit this file."))
f.write("\r\n") f.write("\r\n")
f.write("\#-------------------------------\r\n") f.write("\#-------------------------------\r\n")
for i in 0...moves.length for i in 0...shadow_movesets.length
move = moves[i] moveset = shadow_movesets[i]
next if !move || moves.length==0 next if !moveset || moveset.length==0
constname = (getConstantName(PBSpecies,i) rescue pbGetSpeciesConst(i) rescue nil) constname = (getConstantName(PBSpecies,i) rescue pbGetSpeciesConst(i) rescue nil)
next if !constname next if !constname
f.write(sprintf("%s = ",constname)) f.write(sprintf("%s = ",constname))
movenames = [] movenames = []
for m in move for m in moveset
movenames.push(GameData::Move.get(m).id.to_s) movenames.push(GameData::Move.get(m).id.to_s)
end end
f.write(sprintf("%s\r\n",movenames.compact.join(","))) f.write(sprintf("%s\r\n",movenames.compact.join(",")))

View File

@@ -101,9 +101,9 @@ class PokemonTilesetScene
@x = 0 @x = 0
@y = -TILE_SIZE @y = -TILE_SIZE
@topy = -TILE_SIZE @topy = -TILE_SIZE
height = @sprites["tileset"].bitmap.height
pbUpdateTileset pbUpdateTileset
pbFadeInAndShow(@sprites) pbFadeInAndShow(@sprites)
height = @sprites["tileset"].bitmap.height
######## ########
loop do loop do
Graphics.update Graphics.update
@@ -161,6 +161,7 @@ class PokemonTilesetScene
pbUpdateTileset pbUpdateTileset
when 2 when 2
pbChooseTileset pbChooseTileset
height = @sprites["tileset"].bitmap.height
end end
elsif Input.trigger?(Input::B) elsif Input.trigger?(Input::B)
if pbConfirmMessage(_INTL("Save changes?")) if pbConfirmMessage(_INTL("Save changes?"))