Applied most Rubocop-suggested layout fixes

This commit is contained in:
Maruno17
2021-12-18 01:56:10 +00:00
parent 5dc64f1709
commit 2480ab0f9e
88 changed files with 839 additions and 783 deletions

View File

@@ -76,10 +76,10 @@ class Battle
ret = true
else # Chose a move to use
next false if cmd<0 || !@battlers[idxBattler].moves[cmd] ||
!@battlers[idxBattler].moves[cmd].id
!@battlers[idxBattler].moves[cmd].id
next false if !pbRegisterMove(idxBattler,cmd)
next false if !singleBattle? &&
!pbChooseTarget(@battlers[idxBattler],@battlers[idxBattler].moves[cmd])
!pbChooseTarget(@battlers[idxBattler],@battlers[idxBattler].moves[cmd])
ret = true
end
next true

View File

@@ -55,7 +55,8 @@ class Battle::Battler
arrStatTexts = [
_INTL("{1}'s {2} rose!",pbThis,GameData::Stat.get(stat).name),
_INTL("{1}'s {2} rose sharply!",pbThis,GameData::Stat.get(stat).name),
_INTL("{1}'s {2} rose drastically!",pbThis,GameData::Stat.get(stat).name)]
_INTL("{1}'s {2} rose drastically!",pbThis,GameData::Stat.get(stat).name)
]
@battle.pbDisplay(arrStatTexts[[increment-1,2].min])
# Trigger abilities upon stat gain
if abilityActive?
@@ -78,12 +79,14 @@ class Battle::Battler
arrStatTexts = [
_INTL("{1}'s {2} raised its {3}!",pbThis,cause,GameData::Stat.get(stat).name),
_INTL("{1}'s {2} sharply raised its {3}!",pbThis,cause,GameData::Stat.get(stat).name),
_INTL("{1}'s {2} drastically raised its {3}!",pbThis,cause,GameData::Stat.get(stat).name)]
_INTL("{1}'s {2} drastically raised its {3}!",pbThis,cause,GameData::Stat.get(stat).name)
]
else
arrStatTexts = [
_INTL("{1}'s {2} raised {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name),
_INTL("{1}'s {2} sharply raised {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name),
_INTL("{1}'s {2} drastically raised {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name)]
_INTL("{1}'s {2} drastically raised {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name)
]
end
@battle.pbDisplay(arrStatTexts[[increment-1,2].min])
# Trigger abilities upon stat gain
@@ -214,7 +217,8 @@ class Battle::Battler
arrStatTexts = [
_INTL("{1}'s {2} fell!",pbThis,GameData::Stat.get(stat).name),
_INTL("{1}'s {2} harshly fell!",pbThis,GameData::Stat.get(stat).name),
_INTL("{1}'s {2} severely fell!",pbThis,GameData::Stat.get(stat).name)]
_INTL("{1}'s {2} severely fell!",pbThis,GameData::Stat.get(stat).name)
]
@battle.pbDisplay(arrStatTexts[[increment-1,2].min])
# Trigger abilities upon stat loss
if abilityActive?
@@ -254,12 +258,14 @@ class Battle::Battler
arrStatTexts = [
_INTL("{1}'s {2} lowered its {3}!",pbThis,cause,GameData::Stat.get(stat).name),
_INTL("{1}'s {2} harshly lowered its {3}!",pbThis,cause,GameData::Stat.get(stat).name),
_INTL("{1}'s {2} severely lowered its {3}!",pbThis,cause,GameData::Stat.get(stat).name)]
_INTL("{1}'s {2} severely lowered its {3}!",pbThis,cause,GameData::Stat.get(stat).name)
]
else
arrStatTexts = [
_INTL("{1}'s {2} lowered {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name),
_INTL("{1}'s {2} harshly lowered {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name),
_INTL("{1}'s {2} severely lowered {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name)]
_INTL("{1}'s {2} severely lowered {3}'s {4}!",user.pbThis,cause,pbThis(true),GameData::Stat.get(stat).name)
]
end
@battle.pbDisplay(arrStatTexts[[increment-1,2].min])
# Trigger abilities upon stat loss

View File

@@ -56,7 +56,7 @@ class Battle::Battler
end
# Use the move
PBDebug.log("[Move usage] #{pbThis} started using #{choice[2].name}")
PBDebug.logonerr{
PBDebug.logonerr {
pbUseMove(choice,choice[2]==@battle.struggle)
}
@battle.pbJudge
@@ -173,7 +173,7 @@ class Battle::Battler
choice[2] = Battle::Move.from_pokemon_move(@battle, Pokemon::Move.new(@currentMove))
specialUsage = true
elsif @effects[PBEffects::Encore]>0 && choice[1]>=0 &&
@battle.pbCanShowCommands?(@index)
@battle.pbCanShowCommands?(@index)
idxEncoredMove = pbEncoredMoveIndex
if idxEncoredMove>=0 && @battle.pbCanChooseMove?(@index,idxEncoredMove,false)
if choice[1]!=idxEncoredMove # Change move if battler was Encored mid-round
@@ -403,7 +403,7 @@ class Battle::Battler
b.effects[PBEffects::MagicCoat] = false
break
elsif b.hasActiveAbility?(:MAGICBOUNCE) && !@battle.moldBreaker &&
!b.effects[PBEffects::MagicBounce]
!b.effects[PBEffects::MagicBounce]
magicBouncer = b.index
b.effects[PBEffects::MagicBounce] = true
break
@@ -525,7 +525,7 @@ 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 {
b.pbUseMoveSimple(b.lastMoveUsed,b.lastRegularMoveTarget,idxMove,false)
}
b.lastRoundMoved = oldLastRoundMoved
@@ -561,7 +561,7 @@ class Battle::Battler
end
nextUser.effects[PBEffects::Dancer] = true
if nextUser.pbCanChooseMove?(move, false)
PBDebug.logonerr{
PBDebug.logonerr {
nextUser.pbUseMoveSimple(move.id,preTarget)
}
nextUser.lastRoundMoved = oldLastRoundMoved

View File

@@ -209,7 +209,7 @@ class Battle::Move
target.damageState.focusBand = true
damage -= 1
elsif Settings::AFFECTION_EFFECTS && @battle.internalBattle &&
target.pbOwnedByPlayer? && !target.mega?
target.pbOwnedByPlayer? && !target.mega?
chance = [0, 0, 0, 10, 15, 25][target.affection_level]
if chance > 0 && @battle.pbRandom(100) < chance
target.damageState.affection_endured = true

View File

@@ -60,7 +60,8 @@ class Battle::Move
def pbCalcTypeMod(moveType,user,target)
return Effectiveness::NORMAL_EFFECTIVE if !moveType
return Effectiveness::NORMAL_EFFECTIVE if moveType == :GROUND &&
target.pbHasType?(:FLYING) && target.hasActiveItem?(:IRONBALL)
target.pbHasType?(:FLYING) &&
target.hasActiveItem?(:IRONBALL)
# Determine types
tTypes = target.pbTypes(true)
# Get effectivenesses

View File

@@ -631,7 +631,7 @@ end
class Battle::Move::DoublePowerIfTargetNotActed < Battle::Move
def pbBaseDamage(baseDmg, user, target)
if @battle.choices[target.index][0] == :None || # Switched in
([:UseMove, :Shift].include?(@battle.choices[target.index][0]) && !target.movedThisRound?)
([:UseMove, :Shift].include?(@battle.choices[target.index][0]) && !target.movedThisRound?)
baseDmg *= 2
end
return baseDmg

View File

@@ -144,7 +144,8 @@ class Battle::Move::HitTwoToFiveTimesRaiseUserSpd1LowerUserDef1 < Battle::Move
2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3,
4, 4, 4,
5, 5, 5]
5, 5, 5
]
r = @battle.pbRandom(hitChances.length)
r = hitChances.length - 1 if user.hasActiveAbility?(:SKILLLINK)
return hitChances[r]

View File

@@ -396,45 +396,37 @@ class Battle::Move::ThrowUserItemAtTarget < Battle::Move
# 80 => all Mega Stones
# 10 => all Berries
@flingPowers = {
130 => [:IRONBALL
],
130 => [:IRONBALL],
100 => [:HARDSTONE,:RAREBONE,
# Fossils
:ARMORFOSSIL,:CLAWFOSSIL,:COVERFOSSIL,:DOMEFOSSIL,:HELIXFOSSIL,
:JAWFOSSIL,:OLDAMBER,:PLUMEFOSSIL,:ROOTFOSSIL,:SAILFOSSIL,
:SKULLFOSSIL
],
:SKULLFOSSIL],
90 => [:DEEPSEATOOTH,:GRIPCLAW,:THICKCLUB,
# Plates
:DRACOPLATE,:DREADPLATE,:EARTHPLATE,:FISTPLATE,:FLAMEPLATE,
:ICICLEPLATE,:INSECTPLATE,:IRONPLATE,:MEADOWPLATE,:MINDPLATE,
:PIXIEPLATE,:SKYPLATE,:SPLASHPLATE,:SPOOKYPLATE,:STONEPLATE,
:TOXICPLATE,:ZAPPLATE
],
:TOXICPLATE,:ZAPPLATE],
80 => [:ASSAULTVEST,:CHIPPEDPOT,:CRACKEDPOT,:DAWNSTONE,:DUSKSTONE,
:ELECTIRIZER,:HEAVYDUTYBOOTS,:MAGMARIZER,:ODDKEYSTONE,:OVALSTONE,
:PROTECTOR,:QUICKCLAW,:RAZORCLAW,:SACHET,:SAFETYGOGGLES,
:SHINYSTONE,:STICKYBARB,:WEAKNESSPOLICY,:WHIPPEDDREAM
],
:SHINYSTONE,:STICKYBARB,:WEAKNESSPOLICY,:WHIPPEDDREAM],
70 => [:DRAGONFANG,:POISONBARB,
# EV-training items (Macho Brace is 60)
:POWERANKLET,:POWERBAND,:POWERBELT,:POWERBRACER,:POWERLENS,
:POWERWEIGHT,
# Drives
:BURNDRIVE,:CHILLDRIVE,:DOUSEDRIVE,:SHOCKDRIVE
],
:BURNDRIVE,:CHILLDRIVE,:DOUSEDRIVE,:SHOCKDRIVE],
60 => [:ADAMANTORB,:DAMPROCK,:GRISEOUSORB,:HEATROCK,:LEEK,:LUSTROUSORB,
:MACHOBRACE,:ROCKYHELMET,:STICK,:TERRAINEXTENDER
],
:MACHOBRACE,:ROCKYHELMET,:STICK,:TERRAINEXTENDER],
50 => [:DUBIOUSDISC,:SHARPBEAK,
# Memories
:BUGMEMORY,:DARKMEMORY,:DRAGONMEMORY,:ELECTRICMEMORY,:FAIRYMEMORY,
:FIGHTINGMEMORY,:FIREMEMORY,:FLYINGMEMORY,:GHOSTMEMORY,
:GRASSMEMORY,:GROUNDMEMORY,:ICEMEMORY,:POISONMEMORY,
:PSYCHICMEMORY,:ROCKMEMORY,:STEELMEMORY,:WATERMEMORY
],
40 => [:EVIOLITE,:ICYROCK,:LUCKYPUNCH
],
:PSYCHICMEMORY,:ROCKMEMORY,:STEELMEMORY,:WATERMEMORY],
40 => [:EVIOLITE,:ICYROCK,:LUCKYPUNCH],
30 => [:ABSORBBULB,:ADRENALINEORB,:AMULETCOIN,:BINDINGBAND,:BLACKBELT,
:BLACKGLASSES,:BLACKSLUDGE,:BOTTLECAP,:CELLBATTERY,:CHARCOAL,
:CLEANSETAG,:DEEPSEASCALE,:DRAGONSCALE,:EJECTBUTTON,:ESCAPEROPE,
@@ -486,15 +478,12 @@ class Battle::Move::ThrowUserItemAtTarget < Battle::Move
:RELICGOLD,:RELICSILVER,:RELICSTATUE,:RELICVASE,:STARDUST,
:STARPIECE,:STRANGESOUVENIR,:TINYMUSHROOM,
# Exp Candies
:EXPCANDYXS, :EXPCANDYS, :EXPCANDYM, :EXPCANDYL, :EXPCANDYXL
],
20 => [
# Feathers
:EXPCANDYXS, :EXPCANDYS, :EXPCANDYM, :EXPCANDYL, :EXPCANDYXL],
20 => [ # Feathers
:CLEVERFEATHER,:GENIUSFEATHER,:HEALTHFEATHER,:MUSCLEFEATHER,
:PRETTYFEATHER,:RESISTFEATHER,:SWIFTFEATHER,
:CLEVERWING,:GENIUSWING,:HEALTHWING,:MUSCLEWING,:PRETTYWING,
:RESISTWING,:SWIFTWING
],
:RESISTWING,:SWIFTWING],
10 => [:AIRBALLOON,:BIGROOT,:BRIGHTPOWDER,:CHOICEBAND,:CHOICESCARF,
:CHOICESPECS,:DESTINYKNOT,:DISCOUNTCOUPON,:EXPERTBELT,:FOCUSBAND,
:FOCUSSASH,:LAGGINGTAIL,:LEFTOVERS,:MENTALHERB,:METALPOWDER,
@@ -518,8 +507,7 @@ class Battle::Move::ThrowUserItemAtTarget < Battle::Move
:SERIOUSMINT,
# Sweets
:STRAWBERRYSWEET, :LOVESWEET, :BERRYSWEET, :CLOVERSWEET,
:FLOWERSWEET, :STARSWEET, :RIBBONSWEET
]
:FLOWERSWEET, :STARSWEET, :RIBBONSWEET]
}
end

View File

@@ -9,6 +9,7 @@ class Battle::Scene::MenuBase
attr_reader :color
attr_reader :index
attr_reader :mode
# NOTE: Button width is half the width of the graphic containing them all.
BUTTON_HEIGHT = 46
TEXT_BASE_COLOR = Battle::Scene::MESSAGE_BASE_COLOR
@@ -202,6 +203,7 @@ end
class Battle::Scene::FightMenu < Battle::Scene::MenuBase
attr_reader :battler
attr_reader :shiftMode
GET_MOVE_TEXT_COLOR_FROM_MOVE_BUTTON = true
# If true, displays graphics from Graphics/Pictures/Battle/overlay_fight.png
@@ -408,7 +410,7 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
ppFraction = [(4.0*move.pp/move.total_pp).ceil,3].min
textPos = []
textPos.push([_INTL("PP: {1}/{2}",move.pp,move.total_pp),
448,44,2,PP_COLORS[ppFraction*2],PP_COLORS[ppFraction*2+1]])
448,44,2,PP_COLORS[ppFraction*2],PP_COLORS[ppFraction*2+1]])
pbDrawTextPositions(@infoOverlay.bitmap,textPos)
end
end

View File

@@ -256,7 +256,7 @@ class Battle::Scene::PokemonDataBox < SpriteWrapper
s = GameData::Status.get(@battler.status).icon_position
end
imagePos.push(["Graphics/Pictures/Battle/icon_statuses",@spriteBaseX+24,36,
0, s * STATUS_ICON_HEIGHT, -1, STATUS_ICON_HEIGHT]) if s >= 0
0, s * STATUS_ICON_HEIGHT, -1, STATUS_ICON_HEIGHT]) if s >= 0
end
pbDrawImagePositions(self.bitmap,imagePos)
refreshHP
@@ -456,10 +456,10 @@ class Battle::Scene::AbilitySplashBar < SpriteWrapper
textX = (@side==0) ? 10 : self.bitmap.width-8
# Draw Pokémon's name
textPos.push([_INTL("{1}'s",@battler.name),textX,-4,@side==1,
TEXT_BASE_COLOR,TEXT_SHADOW_COLOR,true])
TEXT_BASE_COLOR,TEXT_SHADOW_COLOR,true])
# Draw Pokémon's ability
textPos.push([@battler.abilityName,textX,26,@side==1,
TEXT_BASE_COLOR,TEXT_SHADOW_COLOR,true])
TEXT_BASE_COLOR,TEXT_SHADOW_COLOR,true])
pbDrawTextPositions(self.bitmap,textPos)
end

View File

@@ -71,7 +71,7 @@ module Battle::Scene::Animation::BallAnimationMixin
when :ULTRABALL then return Color.new(255, 255, 123)
when :MASTERBALL then return Color.new(189, 165, 231)
when :NETBALL then return Color.new(173, 255, 206)
when :DIVEBALL then return Color.new( 99, 206, 247)
when :DIVEBALL then return Color.new(99, 206, 247)
when :NESTBALL then return Color.new(247, 222, 82)
when :REPEATBALL then return Color.new(255, 198, 132)
when :TIMERBALL then return Color.new(239, 247, 247)

View File

@@ -78,8 +78,8 @@ class Battle::AI
Effectiveness.ineffective?(pbCalcTypeMod(move.type,user,target)))
score += 30
if skill>=PBTrainerAI.mediumSkill
aspeed = pbRoughStat(user,:SPEED,skill)
ospeed = pbRoughStat(target,:SPEED,skill)
aspeed = pbRoughStat(user,:SPEED,skill)
ospeed = pbRoughStat(target,:SPEED,skill)
if aspeed<ospeed
score += 30
elsif aspeed>ospeed
@@ -197,7 +197,7 @@ class Battle::AI
if user.hp<user.totalhp/8
score += 60
elsif skill>=PBTrainerAI.highSkill &&
user.hp<(user.effects[PBEffects::Toxic]+1)*user.totalhp/16
user.hp<(user.effects[PBEffects::Toxic]+1)*user.totalhp/16
score += 60
end
end
@@ -1353,7 +1353,7 @@ class Battle::AI
if !user.canChangeType?
score -= 90
elsif !target.lastMoveUsed || !target.lastMoveUsedType ||
GameData::Type.get(target.lastMoveUsedType).pseudo_type
GameData::Type.get(target.lastMoveUsedType).pseudo_type
score -= 90
else
aType = nil
@@ -1431,7 +1431,7 @@ class Battle::AI
if !user.canChangeType? || target.pbTypes(true).length == 0
score -= 90
elsif user.pbTypes == target.pbTypes &&
user.effects[PBEffects::Type3] == target.effects[PBEffects::Type3]
user.effects[PBEffects::Type3] == target.effects[PBEffects::Type3]
score -= 90
end
#---------------------------------------------------------------------------
@@ -1477,9 +1477,9 @@ class Battle::AI
score -= 90
elsif skill>=PBTrainerAI.mediumSkill
if !user.ability || user.ability==target.ability ||
[:MULTITYPE, :RKSSYSTEM, :TRUANT].include?(target.ability_id) ||
[:FLOWERGIFT, :FORECAST, :ILLUSION, :IMPOSTER, :MULTITYPE, :RKSSYSTEM,
:TRACE, :ZENMODE].include?(user.ability_id)
[:MULTITYPE, :RKSSYSTEM, :TRUANT].include?(target.ability_id) ||
[:FLOWERGIFT, :FORECAST, :ILLUSION, :IMPOSTER, :MULTITYPE, :RKSSYSTEM,
:TRACE, :ZENMODE].include?(user.ability_id)
score -= 90
end
if skill>=PBTrainerAI.highSkill
@@ -1547,7 +1547,7 @@ class Battle::AI
when "FixedDamageUserLevelRandom"
score += 30 if target.hp<=user.level
#---------------------------------------------------------------------------
when "OHKO", "OHKOIce", "OHKOHitsUndergroundTarget"
when "OHKO", "OHKOIce", "OHKOHitsUndergroundTarget"
score -= 90 if target.hasActiveAbility?(:STURDY)
score -= 90 if target.level>user.level
#---------------------------------------------------------------------------
@@ -1764,7 +1764,7 @@ class Battle::AI
score -= 40
if skill>=PBTrainerAI.highSkill
score -= 100 if !target.lastRegularMoveUsed ||
!GameData::Move.get(target.lastRegularMoveUsed).flags.any? { |f| f[/^CanMirrorMove$/i] }
!GameData::Move.get(target.lastRegularMoveUsed).flags.any? { |f| f[/^CanMirrorMove$/i] }
end
#---------------------------------------------------------------------------
when "UseLastMoveUsed"
@@ -1817,8 +1817,8 @@ class Battle::AI
[:User, :BothSides].include?(moveData.target)
score += 60
elsif moveData.category != 2 && # Damaging move
moveData.target == :NearOther &&
Effectiveness.ineffective?(pbCalcTypeMod(moveData.type, target, user))
moveData.target == :NearOther &&
Effectiveness.ineffective?(pbCalcTypeMod(moveData.type, target, user))
score += 60
end
end
@@ -2184,8 +2184,8 @@ class Battle::AI
if target.pbCanParalyze?(user,false)
score += 30
if skill>=PBTrainerAI.mediumSkill
aspeed = pbRoughStat(user,:SPEED,skill)
ospeed = pbRoughStat(target,:SPEED,skill)
aspeed = pbRoughStat(user,:SPEED,skill)
ospeed = pbRoughStat(target,:SPEED,skill)
if aspeed<ospeed
score += 30
elsif aspeed>ospeed
@@ -2874,8 +2874,8 @@ class Battle::AI
#---------------------------------------------------------------------------
when "NegateTargetAbilityIfTargetActed"
if skill>=PBTrainerAI.mediumSkill
userSpeed = pbRoughStat(user,:SPEED,skill)
targetSpeed = pbRoughStat(target,:SPEED,skill)
userSpeed = pbRoughStat(user,:SPEED,skill)
targetSpeed = pbRoughStat(target,:SPEED,skill)
if userSpeed<targetSpeed
score += 30
end
@@ -3311,7 +3311,7 @@ class Battle::AI
if @battle.corrosiveGas[target.index % 2][target.pokemonIndex]
score -= 100
elsif !target.item || !target.itemActive? || target.unlosableItem?(target.item) ||
target.hasActiveAbility?(:STICKYHOLD)
target.hasActiveAbility?(:STICKYHOLD)
score -= 90
elsif target.effects[PBEffects::Substitute] > 0
score -= 90

View File

@@ -57,7 +57,8 @@ class Battle::AI
def pbCalcTypeMod(moveType,user,target)
return Effectiveness::NORMAL_EFFECTIVE if !moveType
return Effectiveness::NORMAL_EFFECTIVE if moveType == :GROUND &&
target.pbHasType?(:FLYING) && target.hasActiveItem?(:IRONBALL)
target.pbHasType?(:FLYING) &&
target.hasActiveItem?(:IRONBALL)
# Determine types
tTypes = target.pbTypes(true)
# Get effectivenesses

View File

@@ -166,7 +166,7 @@ module Battle::CatchAndStoreMixin
# Definite capture, no need to perform randomness checks
return 4 if x>=255 || Battle::PokeBallEffects.isUnconditional?(ball, self, battler)
# Second half of the shakes calculation
y = ( 65536 / ((255.0/x)**0.1875) ).floor
y = (65536 / ((255.0/x)**0.1875)).floor
# Critical capture check
if Settings::ENABLE_CRITICAL_CAPTURES
dex_modifier = 0

View File

@@ -426,6 +426,7 @@ class PBAnimation < Array
attr_writer :speed
attr_reader :array
attr_reader :timing
MAX_SPRITES = 60
def speed
@@ -698,6 +699,7 @@ end
#===============================================================================
class PBAnimationPlayerX
attr_accessor :looping
MAX_SPRITES = 60
def initialize(animation,user,target,scene=nil,oppMove=false,inEditor=false)

View File

@@ -198,7 +198,7 @@ module Battle::AbilityEffects
end
def self.triggerDamageCalcFromTargetNonIgnorable(ability, user, target, move, mults, base_damage, type)
DamageCalcFromTargetNonIgnorable.trigger(ability, user, target, move, mults, base_damage, type)
DamageCalcFromTargetNonIgnorable.trigger(ability, user, target, move, mults, base_damage, type)
end
def self.triggerDamageCalcFromTargetAlly(ability, user, target, move, mults, base_damage, type)

View File

@@ -68,7 +68,7 @@ class BattlePalaceBattle < Battle
if move.target == :User || move.function == "MultiTurnAttackBideThenReturnDoubleDamage"
return 1
elsif move.statusMove? ||
move.function == "CounterPhysicalDamage" || move.function == "CounterSpecialDamage"
move.function == "CounterPhysicalDamage" || move.function == "CounterSpecialDamage"
return 2
else
return 0
@@ -194,7 +194,7 @@ class Battle::AI
if thispkmn.effects[PBEffects::PerishSong]==1
shouldswitch = true
elsif !@battle.pbCanChooseAnyMove?(idxBattler) &&
thispkmn.turnCount && thispkmn.turnCount>5
thispkmn.turnCount && thispkmn.turnCount>5
shouldswitch = true
else
hppercent = thispkmn.hp*100/thispkmn.totalhp

View File

@@ -277,8 +277,8 @@ class Battle::Scene
dimmingvp = Viewport.new(0,0,Graphics.width,Graphics.height-msgwindow.height)
pbMessageDisplay(msgwindow,
_INTL("REFEREE: That's it! We will now go to judging to determine the winner!\\wtnp[20]")) {
pbBattleArenaUpdate
dimmingvp.update
pbBattleArenaUpdate
dimmingvp.update
}
dimmingvp.z = 99999
infowindow = SpriteWindow_Base.new(80,0,320,224)
@@ -305,23 +305,23 @@ class Battle::Scene
updateJudgment(infowindow,1,battler1,battler2,ratings1,ratings2)
pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judging category 1, Mind!\nThe Pokémon showing the most guts!\\wtnp[40]")) {
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
}
updateJudgment(infowindow,2,battler1,battler2,ratings1,ratings2)
pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judging category 2, Skill!\nThe Pokémon using moves the best!\\wtnp[40]")) {
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
}
updateJudgment(infowindow,3,battler1,battler2,ratings1,ratings2)
pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judging category 3, Body!\nThe Pokémon with the most vitality!\\wtnp[40]")) {
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
}
total1 = 0
total2 = 0
@@ -332,25 +332,25 @@ class Battle::Scene
if total1==total2
pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judgment: {1} to {2}!\nWe have a draw!\\wtnp[40]",total1,total2)) {
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
}
elsif total1>total2
pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}'s {4}!\\wtnp[40]",
total1,total2,@battle.pbGetOwnerName(battler1.index),battler1.name)) {
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
}
else
pbMessageDisplay(msgwindow,
_INTL("REFEREE: Judgment: {1} to {2}!\nThe winner is {3}!\\wtnp[40]",
total1,total2,battler2.name)) {
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
pbBattleArenaUpdate
dimmingvp.update
infowindow.update
}
end
infowindow.visible = false