mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-11 23:24:59 +00:00
Merge branch 'dev' into ai
This commit is contained in:
@@ -48,9 +48,7 @@ class Battle::Battler
|
||||
end
|
||||
# Use the move
|
||||
PBDebug.log("[Use move] #{pbThis} (#{@index}) used #{choice[2].name}")
|
||||
PBDebug.logonerr {
|
||||
pbUseMove(choice, choice[2] == @battle.struggle)
|
||||
}
|
||||
PBDebug.logonerr { pbUseMove(choice, choice[2] == @battle.struggle) }
|
||||
@battle.pbJudge
|
||||
# Update priority order
|
||||
@battle.pbCalculatePriority if Settings::RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
|
||||
@@ -315,9 +313,9 @@ class Battle::Battler
|
||||
@battle.pbDisplay(_INTL("When the flame touched the powder on the Pokémon, it exploded!"))
|
||||
user.lastMoveFailed = true
|
||||
if ![:Rain, :HeavyRain].include?(user.effectiveWeather) && user.takesIndirectDamage?
|
||||
user.pbTakeEffectDamage((user.totalhp / 4.0).round, false) { |hp_lost|
|
||||
user.pbTakeEffectDamage((user.totalhp / 4.0).round, false) do |hp_lost|
|
||||
@battle.pbDisplay(_INTL("{1} is hurt by its {2}!", battler.pbThis, battler.itemName))
|
||||
}
|
||||
end
|
||||
@battle.pbGainExp # In case user is KO'd by this
|
||||
end
|
||||
pbCancelMoves
|
||||
@@ -531,9 +529,9 @@ class Battle::Battler
|
||||
@battle.pbDisplay(_INTL("{1} used the move instructed by {2}!", b.pbThis, user.pbThis(true)))
|
||||
b.effects[PBEffects::Instructed] = true
|
||||
if b.pbCanChooseMove?(@moves[idxMove], false)
|
||||
PBDebug.logonerr {
|
||||
PBDebug.logonerr do
|
||||
b.pbUseMoveSimple(b.lastMoveUsed, b.lastRegularMoveTarget, idxMove, false)
|
||||
}
|
||||
end
|
||||
b.lastRoundMoved = oldLastRoundMoved
|
||||
@battle.pbJudge
|
||||
return if @battle.decision > 0
|
||||
@@ -567,9 +565,7 @@ class Battle::Battler
|
||||
end
|
||||
nextUser.effects[PBEffects::Dancer] = true
|
||||
if nextUser.pbCanChooseMove?(move, false)
|
||||
PBDebug.logonerr {
|
||||
nextUser.pbUseMoveSimple(move.id, preTarget)
|
||||
}
|
||||
PBDebug.logonerr { nextUser.pbUseMoveSimple(move.id, preTarget) }
|
||||
nextUser.lastRoundMoved = oldLastRoundMoved
|
||||
nextUser.effects[PBEffects::Outrage] = oldOutrage
|
||||
nextUser.currentMove = oldCurrentMove
|
||||
@@ -716,9 +712,7 @@ class Battle::Battler
|
||||
next if b.damageState.calcDamage == 0
|
||||
chance = move.pbAdditionalEffectChance(user, b)
|
||||
next if chance <= 0
|
||||
if @battle.pbRandom(100) < chance
|
||||
move.pbAdditionalEffect(user, b)
|
||||
end
|
||||
move.pbAdditionalEffect(user, b) if @battle.pbRandom(100) < chance
|
||||
end
|
||||
end
|
||||
# Make the target flinch (because of an item/ability)
|
||||
|
||||
Reference in New Issue
Block a user