mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +00:00
Fixed various bugs found when generating Battle Frontier challenge lists
This commit is contained in:
@@ -346,7 +346,7 @@ class Battle
|
|||||||
count = 0
|
count = 0
|
||||||
eachInTeamFromBattlerIndex(idxBattler) do |pkmn, i|
|
eachInTeamFromBattlerIndex(idxBattler) do |pkmn, i|
|
||||||
next if !pkmn || !pkmn.able?
|
next if !pkmn || !pkmn.able?
|
||||||
next if inBattleIndices.include?(idxParty)
|
next if inBattleIndices.include?(i)
|
||||||
count += 1
|
count += 1
|
||||||
end
|
end
|
||||||
return count
|
return count
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class Battle::Move::Confusion < Battle::Move
|
|||||||
@category = 0
|
@category = 0
|
||||||
@accuracy = 100
|
@accuracy = 100
|
||||||
@pp = -1
|
@pp = -1
|
||||||
@target = 0
|
@target = :User
|
||||||
@priority = 0
|
@priority = 0
|
||||||
@flags = []
|
@flags = []
|
||||||
@addlEffect = 0
|
@addlEffect = 0
|
||||||
@@ -61,7 +61,7 @@ class Battle::Move::Struggle < Battle::Move
|
|||||||
@category = 0
|
@category = 0
|
||||||
@accuracy = 0
|
@accuracy = 0
|
||||||
@pp = -1
|
@pp = -1
|
||||||
@target = 0
|
@target = :NearOther
|
||||||
@priority = 0
|
@priority = 0
|
||||||
@flags = ["Contact", "CanProtect"]
|
@flags = ["Contact", "CanProtect"]
|
||||||
@addlEffect = 0
|
@addlEffect = 0
|
||||||
|
|||||||
@@ -1315,13 +1315,13 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
class Battle::Move::TypeDependsOnUserIVs < Battle::Move
|
class Battle::Move::TypeDependsOnUserIVs < Battle::Move
|
||||||
def pbBaseType(user)
|
def pbBaseType(user)
|
||||||
hp = pbHiddenPower(user)
|
hp = pbHiddenPower(user.pokemon)
|
||||||
return hp[0]
|
return hp[0]
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbBaseDamage(baseDmg, user, target)
|
def pbBaseDamage(baseDmg, user, target)
|
||||||
return super if Settings::MECHANICS_GENERATION >= 6
|
return super if Settings::MECHANICS_GENERATION >= 6
|
||||||
hp = pbHiddenPower(user)
|
hp = pbHiddenPower(user.pokemon)
|
||||||
return hp[1]
|
return hp[1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,19 +22,28 @@ class Battle::DebugSceneNoLogging
|
|||||||
# Called whenever a new round begins.
|
# Called whenever a new round begins.
|
||||||
def pbBeginCommandPhase; end
|
def pbBeginCommandPhase; end
|
||||||
def pbBeginAttackPhase; end
|
def pbBeginAttackPhase; end
|
||||||
|
def pbBeginEndOfRoundPhase; end
|
||||||
def pbShowOpponent(idxTrainer); end
|
def pbShowOpponent(idxTrainer); end
|
||||||
def pbDamageAnimation(battler, effectiveness = 0); end
|
def pbDamageAnimation(battler, effectiveness = 0); end
|
||||||
def pbCommonAnimation(animName, user = nil, target = nil); end
|
def pbCommonAnimation(animName, user = nil, target = nil); end
|
||||||
def pbAnimation(moveID, user, targets, hitNum = 0); end
|
def pbAnimation(moveID, user, targets, hitNum = 0); end
|
||||||
|
def pbHitAndHPLossAnimation(targets); end
|
||||||
|
def pbShowPartyLineup(side, fullAnim = false); end
|
||||||
|
def pbShowAbilitySplash(battler, delay = false, logTrigger = true); end
|
||||||
|
def pbReplaceAbilitySplash(battler); end
|
||||||
|
def pbHideAbilitySplash(battler); end
|
||||||
def pbEndBattle(result); end
|
def pbEndBattle(result); end
|
||||||
def pbWildBattleSuccess; end
|
def pbWildBattleSuccess; end
|
||||||
def pbTrainerBattleSuccess; end
|
def pbTrainerBattleSuccess; end
|
||||||
def pbBattleArenaJudgment(b1, b2, r1, r2); end
|
def pbBattleArenaJudgment(b1, b2, r1, r2); end
|
||||||
def pbBattleArenaBattlers(b1, b2); end
|
def pbBattleArenaBattlers(b1, b2); end
|
||||||
|
|
||||||
|
def pbUpdate(cw = nil); end
|
||||||
def pbRefresh; end
|
def pbRefresh; end
|
||||||
|
def pbRefreshOne(idxBattler); end
|
||||||
|
|
||||||
def pbDisplayMessage(msg, brief = false); end
|
def pbDisplayMessage(msg, brief = false); end
|
||||||
|
alias pbDisplay pbDisplayMessage
|
||||||
def pbDisplayPausedMessage(msg); end
|
def pbDisplayPausedMessage(msg); end
|
||||||
def pbDisplayConfirmMessage(msg); return true; end
|
def pbDisplayConfirmMessage(msg); return true; end
|
||||||
def pbShowCommands(msg, commands, defaultValue); return 0; end
|
def pbShowCommands(msg, commands, defaultValue); return 0; end
|
||||||
@@ -45,6 +54,7 @@ class Battle::DebugSceneNoLogging
|
|||||||
def pbResetMoveIndex(idxBattler); end
|
def pbResetMoveIndex(idxBattler); end
|
||||||
|
|
||||||
def pbHPChanged(battler, oldHP, showAnim = false); end
|
def pbHPChanged(battler, oldHP, showAnim = false); end
|
||||||
|
def pbChangePokemon(idxBattler, pkmn); end
|
||||||
def pbFaintBattler(battler); end
|
def pbFaintBattler(battler); end
|
||||||
def pbEXPBar(battler, startExp, endExp, tempExp1, tempExp2); end
|
def pbEXPBar(battler, startExp, endExp, tempExp1, tempExp2); end
|
||||||
def pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense,
|
def pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense,
|
||||||
|
|||||||
@@ -1527,7 +1527,7 @@ Battle::AbilityEffects::DamageCalcFromTarget.add(:FLOWERGIFT,
|
|||||||
Battle::AbilityEffects::DamageCalcFromTarget.add(:FLUFFY,
|
Battle::AbilityEffects::DamageCalcFromTarget.add(:FLUFFY,
|
||||||
proc { |ability, user, target, move, mults, baseDmg, type|
|
proc { |ability, user, target, move, mults, baseDmg, type|
|
||||||
mults[:final_damage_multiplier] *= 2 if move.calcType == :FIRE
|
mults[:final_damage_multiplier] *= 2 if move.calcType == :FIRE
|
||||||
mults[:final_damage_multiplier] /= 2 if move.pbContactMove?
|
mults[:final_damage_multiplier] /= 2 if move.pbContactMove?(user)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1711,11 +1711,11 @@ Battle::AbilityEffects::OnBeingHit.add(:ANGERPOINT,
|
|||||||
Battle::AbilityEffects::OnBeingHit.add(:COTTONDOWN,
|
Battle::AbilityEffects::OnBeingHit.add(:COTTONDOWN,
|
||||||
proc { |ability, user, target, move, battle|
|
proc { |ability, user, target, move, battle|
|
||||||
next if battle.allBattlers.none? { |b| b.pbCanLowerStatStage?(:DEFENSE, target) }
|
next if battle.allBattlers.none? { |b| b.pbCanLowerStatStage?(:DEFENSE, target) }
|
||||||
battle.pbShowAbilitySplash(battler)
|
battle.pbShowAbilitySplash(target)
|
||||||
battle.allBattlers.each do |b|
|
battle.allBattlers.each do |b|
|
||||||
b.pbLowerStatStageByAbility(:SPEED, 1, target, false)
|
b.pbLowerStatStageByAbility(:SPEED, 1, target, false)
|
||||||
end
|
end
|
||||||
battle.pbHideAbilitySplash(battler)
|
battle.pbHideAbilitySplash(target)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -1972,7 +1972,7 @@ Battle::AbilityEffects::OnBeingHit.add(:RATTLED,
|
|||||||
|
|
||||||
Battle::AbilityEffects::OnBeingHit.add(:SANDSPIT,
|
Battle::AbilityEffects::OnBeingHit.add(:SANDSPIT,
|
||||||
proc { |ability, user, target, move, battle|
|
proc { |ability, user, target, move, battle|
|
||||||
battle.pbStartWeatherAbility(:Sandstorm, battler)
|
battle.pbStartWeatherAbility(:Sandstorm, target)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -2907,7 +2907,7 @@ Battle::AbilityEffects::OnSwitchIn.add(:NEUTRALIZINGGAS,
|
|||||||
# Truant - let b move on its first turn after Neutralizing Gas disappears
|
# Truant - let b move on its first turn after Neutralizing Gas disappears
|
||||||
b.effects[PBEffects::Truant] = false
|
b.effects[PBEffects::Truant] = false
|
||||||
# Gorilla Tactics - end choice lock
|
# Gorilla Tactics - end choice lock
|
||||||
if !hasActiveItem?([:CHOICEBAND, :CHOICESPECS, :CHOICESCARF])
|
if !b.hasActiveItem?([:CHOICEBAND, :CHOICESPECS, :CHOICESCARF])
|
||||||
b.effects[PBEffects::ChoiceBand] = nil
|
b.effects[PBEffects::ChoiceBand] = nil
|
||||||
end
|
end
|
||||||
# Illusion - end illusions
|
# Illusion - end illusions
|
||||||
@@ -2977,12 +2977,12 @@ Battle::AbilityEffects::OnSwitchIn.add(:SANDSTREAM,
|
|||||||
|
|
||||||
Battle::AbilityEffects::OnSwitchIn.add(:SCREENCLEANER,
|
Battle::AbilityEffects::OnSwitchIn.add(:SCREENCLEANER,
|
||||||
proc { |ability, battler, battle, switch_in|
|
proc { |ability, battler, battle, switch_in|
|
||||||
next if target.pbOwnSide.effects[PBEffects::AuroraVeil] == 0 &&
|
next if battler.pbOwnSide.effects[PBEffects::AuroraVeil] == 0 &&
|
||||||
target.pbOwnSide.effects[PBEffects::LightScreen] == 0 &&
|
battler.pbOwnSide.effects[PBEffects::LightScreen] == 0 &&
|
||||||
target.pbOwnSide.effects[PBEffects::Reflect] == 0 &&
|
battler.pbOwnSide.effects[PBEffects::Reflect] == 0 &&
|
||||||
target.pbOpposingSide.effects[PBEffects::AuroraVeil] == 0 &&
|
battler.pbOpposingSide.effects[PBEffects::AuroraVeil] == 0 &&
|
||||||
target.pbOpposingSide.effects[PBEffects::LightScreen] == 0 &&
|
battler.pbOpposingSide.effects[PBEffects::LightScreen] == 0 &&
|
||||||
target.pbOpposingSide.effects[PBEffects::Reflect] == 0
|
battler.pbOpposingSide.effects[PBEffects::Reflect] == 0
|
||||||
battle.pbShowAbilitySplash(battler)
|
battle.pbShowAbilitySplash(battler)
|
||||||
if battler.pbOpposingSide.effects[PBEffects::AuroraVeil] > 0
|
if battler.pbOpposingSide.effects[PBEffects::AuroraVeil] > 0
|
||||||
battler.pbOpposingSide.effects[PBEffects::AuroraVeil] = 0
|
battler.pbOpposingSide.effects[PBEffects::AuroraVeil] = 0
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ def pbGenerateChallenge(rule, tag)
|
|||||||
rule = rule.copy.setNumber(2)
|
rule = rule.copy.setNumber(2)
|
||||||
yield(nil)
|
yield(nil)
|
||||||
party = load_data(tag + ".rxdata") rescue []
|
party = load_data(tag + ".rxdata") rescue []
|
||||||
teams = load_data(tag + "teams.rxdata") rescue []
|
teams = load_data(tag + "_teams.rxdata") rescue []
|
||||||
if teams.length < 10
|
if teams.length < 10
|
||||||
btpokemon = pbGetBTPokemon(tag)
|
btpokemon = pbGetBTPokemon(tag)
|
||||||
if btpokemon && btpokemon.length != 0
|
if btpokemon && btpokemon.length != 0
|
||||||
@@ -218,7 +218,7 @@ def pbGenerateChallenge(rule, tag)
|
|||||||
end
|
end
|
||||||
i += 1
|
i += 1
|
||||||
end
|
end
|
||||||
save_data(teams, tag + "teams.rxdata")
|
save_data(teams, tag + "_teams.rxdata")
|
||||||
yield(nil)
|
yield(nil)
|
||||||
while teams.length < maxteams
|
while teams.length < maxteams
|
||||||
yield(nil) if teams.length % 10 == 0
|
yield(nil) if teams.length % 10 == 0
|
||||||
@@ -256,7 +256,7 @@ def pbGenerateChallenge(rule, tag)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
teams.sort! { |a, b| b.rating <=> a.rating }
|
teams.sort! { |a, b| b.rating <=> a.rating }
|
||||||
save_data(teams, tag + "teams.rxdata")
|
save_data(teams, tag + "_teams.rxdata")
|
||||||
end
|
end
|
||||||
party = []
|
party = []
|
||||||
yield(nil)
|
yield(nil)
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ def pbTrainerInfo(pokemonlist, trfile, rules)
|
|||||||
yield(nil) if block_given?
|
yield(nil) if block_given?
|
||||||
if trIndex < 0
|
if trIndex < 0
|
||||||
info = [newbttrainers, pbpokemonlist, [trfile],
|
info = [newbttrainers, pbpokemonlist, [trfile],
|
||||||
trfile + "tr.txt", trfile + "pm.txt", !hasDefault]
|
trfile + "_trainers.txt", trfile + "_pkmn.txt", !hasDefault]
|
||||||
trlists.push(info)
|
trlists.push(info)
|
||||||
end
|
end
|
||||||
yield(nil) if block_given?
|
yield(nil) if block_given?
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ def pbRuledBattle(team1, team2, rule)
|
|||||||
trainer2 = NPCTrainer.new("PLAYER2", t_type)
|
trainer2 = NPCTrainer.new("PLAYER2", t_type)
|
||||||
items1 = []
|
items1 = []
|
||||||
items2 = []
|
items2 = []
|
||||||
team1.each_with_index do |p, i|
|
team1.team.each_with_index do |p, i|
|
||||||
next if !p
|
next if !p
|
||||||
if p.level != level
|
if p.level != level
|
||||||
p.level = level
|
p.level = level
|
||||||
@@ -389,7 +389,7 @@ def pbRuledBattle(team1, team2, rule)
|
|||||||
items1[i] = p.item_id
|
items1[i] = p.item_id
|
||||||
trainer1.party.push(p)
|
trainer1.party.push(p)
|
||||||
end
|
end
|
||||||
team2.each_with_index do |p, i|
|
team2.team.each_with_index do |p, i|
|
||||||
next if !p
|
next if !p
|
||||||
if p.level != level
|
if p.level != level
|
||||||
p.level = level
|
p.level = level
|
||||||
@@ -404,12 +404,12 @@ def pbRuledBattle(team1, team2, rule)
|
|||||||
battle.controlPlayer = true
|
battle.controlPlayer = true
|
||||||
battle.internalBattle = false
|
battle.internalBattle = false
|
||||||
decision = battle.pbStartBattle
|
decision = battle.pbStartBattle
|
||||||
team1.each_with_index do |p, i|
|
team1.team.each_with_index do |p, i|
|
||||||
next if !p
|
next if !p
|
||||||
p.heal
|
p.heal
|
||||||
p.item = items1[i]
|
p.item = items1[i]
|
||||||
end
|
end
|
||||||
team2.each_with_index do |p, i|
|
team2.team.each_with_index do |p, i|
|
||||||
next if !p
|
next if !p
|
||||||
p.heal
|
p.heal
|
||||||
p.item = items2[i]
|
p.item = items2[i]
|
||||||
|
|||||||
Reference in New Issue
Block a user