Release 6.9.0

This commit is contained in:
chardub
2026-11-02 11:34:46 -05:00
parent 060726298d
commit ae6e2ebc64
5697 changed files with 131795 additions and 17423 deletions
@@ -76,10 +76,11 @@ module PokeBattle_BattleCommon
gave_away_pokemon = promptGiveToPartner(pkmn) if isPartneredWithAnyTrainer()
promptCaughtPokemonAction(pkmn) if !gave_away_pokemon
if $game_switches[AUTOSAVE_CATCH_SWITCH]
Kernel.tryAutosave()
end
#Removed because battle restarts right away after reloading and duplicates the Pokemon.
# if $game_switches[AUTOSAVE_CATCH_SWITCH]
# Kernel.tryAutosave()
# end
end
@caughtPokemon.clear
end
@@ -218,6 +218,16 @@ class PokeBattle_Battle
end
end
def list_all_player_participants
participating = []
pbParty(0).each_with_index do |pkmn, i|
next if !pkmn
if @usedInBattle[0][i] == true
participating.push(pkmn) unless pkmn.fainted?
end
end
return participating
end
def singleBattle?
@@ -83,7 +83,6 @@ class PokeBattle_Battle
@sideSizes[0] -= 1
end
end
PBDebug.log("Trying #{@sideSizes[0]}v#{@sideSizes[1]} battle instead")
if @sideSizes[0] <= 0 || @sideSizes[1] <= 0
raise _INTL("Couldn't reduce battle size any further, battle isn't possible")
@@ -103,6 +102,9 @@ class PokeBattle_Battle
pbClearChoice(idxBattler)
@successStates[idxBattler] = PokeBattle_SuccessState.new
@battlers[idxBattler].pbInitialize(pkmn, idxParty)
side = idxBattler % 2
@usedInBattle[side][idxParty] = true if @usedInBattle && @usedInBattle[side]
end
def pbSetUpSides
@@ -378,7 +380,7 @@ class PokeBattle_Battle
$Trainer.cosmetics_money = 0 unless $Trainer.cosmetics_money
pbPlayer.cosmetics_money += cosmetics_money
if !@moneyGain && cosmetics_money > 0 # message displayed in pbGainMoney if player wins money
pbDisplayPaused(_INTL("You got some {1} for winning!", COSMETIC_CURRENCY_NAME))
pbDisplayPaused(_INTL("You got some {1} for winning!", get_cosmetic_currency_name))
end
return cosmetics_money
end
@@ -395,7 +397,7 @@ class PokeBattle_Battle
if moneyGained > 0
if cosmetics_money > 0
pbDisplayPaused(_INTL("You got ${1} and some {2} for winning!", moneyGained.to_s_formatted, COSMETIC_CURRENCY_NAME))
pbDisplayPaused(_INTL("You got ${1} and some {2} for winning!", moneyGained.to_s_formatted, get_cosmetic_currency_name))
else
pbDisplayPaused(_INTL("You got ${1} for winning!", moneyGained.to_s_formatted))
end
@@ -457,7 +459,15 @@ class PokeBattle_Battle
@opponent.each_with_index do |_t, i|
@scene.pbShowOpponent(i)
msg = (@endSpeeches[i] && @endSpeeches[i] != "") ? @endSpeeches[i] : "..."
pbDisplayPaused(msg.gsub(/\\[Pp][Nn]/, pbPlayer.name))
msg = MessageTypes.getFromMapHash($game_map.map_id, msg)
msg = msg.gsub(/\\[Pp][Nn]/, pbPlayer.name)
msg = msg.gsub(/\\n/, "\n")
if Settings::EXPERIMENTAL_FEATURES
pbCallBubFixed(60, 4, 340, 100, true)
pbMessage(msg)
else
pbDisplayPaused(msg)
end
end
end
# Gain money from winning a trainer battle, and from Pay Day
@@ -499,7 +509,10 @@ class PokeBattle_Battle
@opponent.each_with_index do |_t, i|
@scene.pbShowOpponent(i)
msg = (@endSpeechesWin[i] && @endSpeechesWin[i] != "") ? @endSpeechesWin[i] : "..."
pbDisplayPaused(msg.gsub(/\\[Pp][Nn]/, pbPlayer.name))
msg = MessageTypes.getFromMapHash($game_map.map_id, msg)
msg = msg.gsub(/\\[Pp][Nn]/, pbPlayer.name)
msg = msg.gsub(/\\n/, "\n")
pbDisplayPaused(msg)
end
end
end
@@ -302,7 +302,8 @@ class PokeBattle_Battle
sendOuts.each do |b|
@scene.pbResetMoveIndex(b[0])
pbSetSeen(@battlers[b[0]])
@usedInBattle[b[0] & 1][b[0] / 2] = true
idxParty = @battlers[b[0]].pokemonIndex
@usedInBattle[b[0] & 1][idxParty] = true if idxParty >= 0
end
end
@@ -208,44 +208,7 @@ class PokeBattle_Battle
# Weather
pbEORWeather(priority)
# Future Sight/Doom Desire
@positions.each_with_index do |pos,idxPos|
next if !pos || pos.effects[PBEffects::FutureSightCounter]==0
pos.effects[PBEffects::FutureSightCounter] -= 1
next if pos.effects[PBEffects::FutureSightCounter]>0
next if !@battlers[idxPos] || @battlers[idxPos].fainted? # No target
moveUser = nil
eachBattler do |b|
next if b.opposes?(pos.effects[PBEffects::FutureSightUserIndex])
next if b.pokemonIndex!=pos.effects[PBEffects::FutureSightUserPartyIndex]
moveUser = b
break
end
next if moveUser && moveUser.index==idxPos # Target is the user
if !moveUser # User isn't in battle, get it from the party
party = pbParty(pos.effects[PBEffects::FutureSightUserIndex])
pkmn = party[pos.effects[PBEffects::FutureSightUserPartyIndex]]
if pkmn && pkmn.able?
moveUser = PokeBattle_Battler.new(self,pos.effects[PBEffects::FutureSightUserIndex])
moveUser.pbInitDummyPokemon(pkmn,pos.effects[PBEffects::FutureSightUserPartyIndex])
end
end
next if !moveUser # User is fainted
move = pos.effects[PBEffects::FutureSightMove]
pbDisplay(_INTL("{1} took the {2} attack!",@battlers[idxPos].pbThis,
GameData::Move.get(move).name))
# NOTE: Future Sight failing against the target here doesn't count towards
# Stomping Tantrum.
userLastMoveFailed = moveUser.lastMoveFailed
@futureSight = true
moveUser.pbUseMoveSimple(move,idxPos)
@futureSight = false
moveUser.lastMoveFailed = userLastMoveFailed
@battlers[idxPos].pbFaint if @battlers[idxPos].fainted?
pos.effects[PBEffects::FutureSightCounter] = 0
pos.effects[PBEffects::FutureSightMove] = nil
pos.effects[PBEffects::FutureSightUserIndex] = -1
pos.effects[PBEffects::FutureSightUserPartyIndex] = -1
end
@positions.each_with_index { |pos, idxPos| pbEORUseFutureSight(pos, idxPos) }
# Wish
@positions.each_with_index do |pos,idxPos|
next if !pos || pos.effects[PBEffects::Wish]==0
@@ -261,8 +224,8 @@ class PokeBattle_Battle
for side in 0...2
next if sides[side].effects[PBEffects::SeaOfFire]==0
next if [:Rain, :HeavyRain].include?(curWeather)
@battle.pbCommonAnimation("SeaOfFire") if side==0
@battle.pbCommonAnimation("SeaOfFireOpp") if side==1
pbCommonAnimation("SeaOfFire") if side==0
pbCommonAnimation("SeaOfFireOpp") if side==1
priority.each do |b|
next if b.opposes?(side)
next if !b.takesIndirectDamage? || b.pbHasType?(:FIRE)
@@ -631,7 +594,14 @@ class PokeBattle_Battle
b.effects[PBEffects::PriorityItem] = false
b.effects[PBEffects::Protect] = false
b.effects[PBEffects::RagePowder] = false
b.effects[PBEffects::Roost] = false
if b.effects[PBEffects::Roost]
b.effects[PBEffects::Roost] = false
if b.pbOwnedByPlayer?
@scene.pbRefreshOne(b.index) if $PokemonSystem.type_icons_player
else
@scene.pbRefreshOne(b.index) if $PokemonSystem.type_icons_opponent
end
end
b.effects[PBEffects::Snatch] = 0
b.effects[PBEffects::SpikyShield] = false
b.effects[PBEffects::Spotlight] = 0
@@ -663,4 +633,51 @@ class PokeBattle_Battle
@field.effects[PBEffects::FusionFlare] = false
@endOfRound = false
end
#-----------------------------------------------------------------------------
# End Of Round use delayed moves (Future Sight, Doom Desire).
#-----------------------------------------------------------------------------
def pbEORUseFutureSight(position, position_index)
return if !position || position.effects[PBEffects::FutureSightCounter] == 0
position.effects[PBEffects::FutureSightCounter] -= 1
return if position.effects[PBEffects::FutureSightCounter] > 0
move = position.effects[PBEffects::FutureSightMove]
userIdx = position.effects[PBEffects::FutureSightUserIndex]
partyIdx = position.effects[PBEffects::FutureSightUserPartyIndex]
position.effects[PBEffects::FutureSightCounter] = 0
position.effects[PBEffects::FutureSightMove] = nil
position.effects[PBEffects::FutureSightUserIndex] = -1
position.effects[PBEffects::FutureSightUserPartyIndex] = -1
return if !move # defensive: corrupted/never-set state, bail out safely
return if !@battlers[position_index] || @battlers[position_index].fainted?
moveUser = nil
allBattlers = @battlers.select { |b| b && !b.fainted? }
allBattlers.each do |battler|
next if battler.opposes?(userIdx)
next if battler.pokemonIndex != partyIdx
moveUser = battler
break
end
return if moveUser && moveUser.index == position_index
if !moveUser
party = pbParty(userIdx)
pkmn = (partyIdx >= 0) ? party[partyIdx] : nil
if pkmn&.able?
moveUser = PokeBattle_Battler.new(self, userIdx)
moveUser.pbInitDummyPokemon(pkmn, partyIdx)
end
end
return if !moveUser
pbDisplay(_INTL("{1} took the {2} attack!", @battlers[position_index].pbThis,
GameData::Move.get(move).name))
userLastMoveFailed = moveUser.lastMoveFailed
@futureSight = true
moveUser.pbUseMoveSimple(move, position_index)
@futureSight = false
moveUser.lastMoveFailed = userLastMoveFailed
@battlers[position_index].pbFaint if @battlers[position_index].fainted?
end
end