Fixed various bugs found when generating Battle Frontier challenge lists

This commit is contained in:
Maruno17
2021-12-29 14:37:41 +00:00
parent a7e8005f53
commit fb29f19a28
8 changed files with 34 additions and 24 deletions

View File

@@ -346,7 +346,7 @@ class Battle
count = 0
eachInTeamFromBattlerIndex(idxBattler) do |pkmn, i|
next if !pkmn || !pkmn.able?
next if inBattleIndices.include?(idxParty)
next if inBattleIndices.include?(i)
count += 1
end
return count

View File

@@ -32,7 +32,7 @@ class Battle::Move::Confusion < Battle::Move
@category = 0
@accuracy = 100
@pp = -1
@target = 0
@target = :User
@priority = 0
@flags = []
@addlEffect = 0
@@ -61,7 +61,7 @@ class Battle::Move::Struggle < Battle::Move
@category = 0
@accuracy = 0
@pp = -1
@target = 0
@target = :NearOther
@priority = 0
@flags = ["Contact", "CanProtect"]
@addlEffect = 0

View File

@@ -1315,13 +1315,13 @@ end
#===============================================================================
class Battle::Move::TypeDependsOnUserIVs < Battle::Move
def pbBaseType(user)
hp = pbHiddenPower(user)
hp = pbHiddenPower(user.pokemon)
return hp[0]
end
def pbBaseDamage(baseDmg, user, target)
return super if Settings::MECHANICS_GENERATION >= 6
hp = pbHiddenPower(user)
hp = pbHiddenPower(user.pokemon)
return hp[1]
end
end

View File

@@ -22,19 +22,28 @@ class Battle::DebugSceneNoLogging
# Called whenever a new round begins.
def pbBeginCommandPhase; end
def pbBeginAttackPhase; end
def pbBeginEndOfRoundPhase; end
def pbShowOpponent(idxTrainer); end
def pbDamageAnimation(battler, effectiveness = 0); end
def pbCommonAnimation(animName, user = nil, target = nil); 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 pbWildBattleSuccess; end
def pbTrainerBattleSuccess; end
def pbBattleArenaJudgment(b1, b2, r1, r2); end
def pbBattleArenaBattlers(b1, b2); end
def pbUpdate(cw = nil); end
def pbRefresh; end
def pbRefreshOne(idxBattler); end
def pbDisplayMessage(msg, brief = false); end
alias pbDisplay pbDisplayMessage
def pbDisplayPausedMessage(msg); end
def pbDisplayConfirmMessage(msg); return true; end
def pbShowCommands(msg, commands, defaultValue); return 0; end
@@ -45,6 +54,7 @@ class Battle::DebugSceneNoLogging
def pbResetMoveIndex(idxBattler); end
def pbHPChanged(battler, oldHP, showAnim = false); end
def pbChangePokemon(idxBattler, pkmn); end
def pbFaintBattler(battler); end
def pbEXPBar(battler, startExp, endExp, tempExp1, tempExp2); end
def pbLevelUp(pkmn, battler, oldTotalHP, oldAttack, oldDefense,

View File

@@ -1527,7 +1527,7 @@ Battle::AbilityEffects::DamageCalcFromTarget.add(:FLOWERGIFT,
Battle::AbilityEffects::DamageCalcFromTarget.add(:FLUFFY,
proc { |ability, user, target, move, mults, baseDmg, type|
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,
proc { |ability, user, target, move, battle|
next if battle.allBattlers.none? { |b| b.pbCanLowerStatStage?(:DEFENSE, target) }
battle.pbShowAbilitySplash(battler)
battle.pbShowAbilitySplash(target)
battle.allBattlers.each do |b|
b.pbLowerStatStageByAbility(:SPEED, 1, target, false)
end
battle.pbHideAbilitySplash(battler)
battle.pbHideAbilitySplash(target)
}
)
@@ -1972,7 +1972,7 @@ Battle::AbilityEffects::OnBeingHit.add(:RATTLED,
Battle::AbilityEffects::OnBeingHit.add(:SANDSPIT,
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
b.effects[PBEffects::Truant] = false
# Gorilla Tactics - end choice lock
if !hasActiveItem?([:CHOICEBAND, :CHOICESPECS, :CHOICESCARF])
if !b.hasActiveItem?([:CHOICEBAND, :CHOICESPECS, :CHOICESCARF])
b.effects[PBEffects::ChoiceBand] = nil
end
# Illusion - end illusions
@@ -2977,12 +2977,12 @@ Battle::AbilityEffects::OnSwitchIn.add(:SANDSTREAM,
Battle::AbilityEffects::OnSwitchIn.add(:SCREENCLEANER,
proc { |ability, battler, battle, switch_in|
next if target.pbOwnSide.effects[PBEffects::AuroraVeil] == 0 &&
target.pbOwnSide.effects[PBEffects::LightScreen] == 0 &&
target.pbOwnSide.effects[PBEffects::Reflect] == 0 &&
target.pbOpposingSide.effects[PBEffects::AuroraVeil] == 0 &&
target.pbOpposingSide.effects[PBEffects::LightScreen] == 0 &&
target.pbOpposingSide.effects[PBEffects::Reflect] == 0
next if battler.pbOwnSide.effects[PBEffects::AuroraVeil] == 0 &&
battler.pbOwnSide.effects[PBEffects::LightScreen] == 0 &&
battler.pbOwnSide.effects[PBEffects::Reflect] == 0 &&
battler.pbOpposingSide.effects[PBEffects::AuroraVeil] == 0 &&
battler.pbOpposingSide.effects[PBEffects::LightScreen] == 0 &&
battler.pbOpposingSide.effects[PBEffects::Reflect] == 0
battle.pbShowAbilitySplash(battler)
if battler.pbOpposingSide.effects[PBEffects::AuroraVeil] > 0
battler.pbOpposingSide.effects[PBEffects::AuroraVeil] = 0