mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 06:04:59 +00:00
Refactoring and tidying
This commit is contained in:
@@ -88,27 +88,27 @@ class PokeBattle_Move
|
||||
baseAcc = pbBaseAccuracy(user,target)
|
||||
return true if baseAcc==0
|
||||
# Calculate all multiplier effects
|
||||
modifiers = []
|
||||
modifiers[BASE_ACC] = baseAcc
|
||||
modifiers[ACC_STAGE] = user.stages[PBStats::ACCURACY]
|
||||
modifiers[EVA_STAGE] = target.stages[PBStats::EVASION]
|
||||
modifiers[ACC_MULT] = 1.0
|
||||
modifiers[EVA_MULT] = 1.0
|
||||
modifiers = {}
|
||||
modifiers[:base_accuracy] = baseAcc
|
||||
modifiers[:accuracy_stage] = user.stages[PBStats::ACCURACY]
|
||||
modifiers[:evasion_stage] = target.stages[PBStats::EVASION]
|
||||
modifiers[:accuracy_multiplier] = 1.0
|
||||
modifiers[:evasion_multiplier] = 1.0
|
||||
pbCalcAccuracyModifiers(user,target,modifiers)
|
||||
# Check if move can't miss
|
||||
return true if modifiers[BASE_ACC]==0
|
||||
return true if modifiers[:base_accuracy] == 0
|
||||
# Calculation
|
||||
accStage = [[modifiers[ACC_STAGE],-6].max,6].min + 6
|
||||
evaStage = [[modifiers[EVA_STAGE],-6].max,6].min + 6
|
||||
accStage = [[modifiers[:accuracy_stage], -6].max, 6].min + 6
|
||||
evaStage = [[modifiers[:evasion_stage], -6].max, 6].min + 6
|
||||
stageMul = [3,3,3,3,3,3, 3, 4,5,6,7,8,9]
|
||||
stageDiv = [9,8,7,6,5,4, 3, 3,3,3,3,3,3]
|
||||
accuracy = 100.0 * stageMul[accStage] / stageDiv[accStage]
|
||||
evasion = 100.0 * stageMul[evaStage] / stageDiv[evaStage]
|
||||
accuracy = (accuracy * modifiers[ACC_MULT]).round
|
||||
evasion = (evasion * modifiers[EVA_MULT]).round
|
||||
evasion = 1 if evasion<1
|
||||
accuracy = (accuracy * modifiers[:accuracy_multiplier]).round
|
||||
evasion = (evasion * modifiers[:evasion_multiplier]).round
|
||||
evasion = 1 if evasion < 1
|
||||
# Calculation
|
||||
return @battle.pbRandom(100) < modifiers[BASE_ACC] * accuracy / evasion
|
||||
return @battle.pbRandom(100) < modifiers[:base_accuracy] * accuracy / evasion
|
||||
end
|
||||
|
||||
def pbCalcAccuracyModifiers(user,target,modifiers)
|
||||
@@ -135,16 +135,17 @@ class PokeBattle_Move
|
||||
BattleHandlers.triggerAccuracyCalcTargetItem(target.item,
|
||||
modifiers,user,target,self,@calcType)
|
||||
end
|
||||
# Other effects, inc. ones that set ACC_MULT or EVA_STAGE to specific values
|
||||
if @battle.field.effects[PBEffects::Gravity]>0
|
||||
modifiers[ACC_MULT] *= 5/3.0
|
||||
# Other effects, inc. ones that set accuracy_multiplier or evasion_stage to
|
||||
# specific values
|
||||
if @battle.field.effects[PBEffects::Gravity] > 0
|
||||
modifiers[:accuracy_multiplier] *= 5 / 3.0
|
||||
end
|
||||
if user.effects[PBEffects::MicleBerry]
|
||||
user.effects[PBEffects::MicleBerry] = false
|
||||
modifiers[ACC_MULT] *= 1.2
|
||||
modifiers[:accuracy_multiplier] *= 1.2
|
||||
end
|
||||
modifiers[EVA_STAGE] = 0 if target.effects[PBEffects::Foresight] && modifiers[EVA_STAGE]>0
|
||||
modifiers[EVA_STAGE] = 0 if target.effects[PBEffects::MiracleEye] && modifiers[EVA_STAGE]>0
|
||||
modifiers[:evasion_stage] = 0 if target.effects[PBEffects::Foresight] && modifiers[:evasion_stage] > 0
|
||||
modifiers[:evasion_stage] = 0 if target.effects[PBEffects::MiracleEye] && modifiers[:evasion_stage] > 0
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -241,14 +242,19 @@ class PokeBattle_Move
|
||||
defense = (defense.to_f*stageMul[defStage]/stageDiv[defStage]).floor
|
||||
end
|
||||
# Calculate all multiplier effects
|
||||
multipliers = [1.0, 1.0, 1.0, 1.0]
|
||||
multipliers = {
|
||||
:base_damage_multiplier => 1.0,
|
||||
:attack_multiplier => 1.0,
|
||||
:defense_multiplier => 1.0,
|
||||
:final_damage_multiplier => 1.0
|
||||
}
|
||||
pbCalcDamageMultipliers(user,target,numTargets,type,baseDmg,multipliers)
|
||||
# Main damage calculation
|
||||
baseDmg = [(baseDmg * multipliers[BASE_DMG_MULT]).round, 1].max
|
||||
atk = [(atk * multipliers[ATK_MULT]).round, 1].max
|
||||
defense = [(defense * multipliers[DEF_MULT]).round, 1].max
|
||||
baseDmg = [(baseDmg * multipliers[:base_damage_multiplier]).round, 1].max
|
||||
atk = [(atk * multipliers[:attack_multiplier]).round, 1].max
|
||||
defense = [(defense * multipliers[:defense_multiplier]).round, 1].max
|
||||
damage = (((2.0 * user.level / 5 + 2).floor * baseDmg * atk / defense).floor / 50).floor + 2
|
||||
damage = [(damage * multipliers[FINAL_DMG_MULT]).round, 1].max
|
||||
damage = [(damage * multipliers[:final_damage_multiplier]).round, 1].max
|
||||
target.damageState.calcDamage = damage
|
||||
end
|
||||
|
||||
@@ -257,9 +263,9 @@ class PokeBattle_Move
|
||||
if (@battle.pbCheckGlobalAbility(:DARKAURA) && type == :DARK) ||
|
||||
(@battle.pbCheckGlobalAbility(:FAIRYAURA) && type == :FAIRY)
|
||||
if @battle.pbCheckGlobalAbility(:AURABREAK)
|
||||
multipliers[BASE_DMG_MULT] *= 2/3.0
|
||||
multipliers[:base_damage_multiplier] *= 2 / 3.0
|
||||
else
|
||||
multipliers[BASE_DMG_MULT] *= 4/3.0
|
||||
multipliers[:base_damage_multiplier] *= 4 / 3.0
|
||||
end
|
||||
end
|
||||
# Ability effects that alter damage
|
||||
@@ -299,154 +305,154 @@ class PokeBattle_Move
|
||||
end
|
||||
# Parental Bond's second attack
|
||||
if user.effects[PBEffects::ParentalBond]==1
|
||||
multipliers[BASE_DMG_MULT] /= 4
|
||||
multipliers[:base_damage_multiplier] /= 4
|
||||
end
|
||||
# Other
|
||||
if user.effects[PBEffects::MeFirst]
|
||||
multipliers[BASE_DMG_MULT] *= 1.5
|
||||
multipliers[:base_damage_multiplier] *= 1.5
|
||||
end
|
||||
if user.effects[PBEffects::HelpingHand] && !self.is_a?(PokeBattle_Confusion)
|
||||
multipliers[BASE_DMG_MULT] *= 1.5
|
||||
multipliers[:base_damage_multiplier] *= 1.5
|
||||
end
|
||||
if user.effects[PBEffects::Charge]>0 && type == :ELECTRIC
|
||||
multipliers[BASE_DMG_MULT] *= 2
|
||||
multipliers[:base_damage_multiplier] *= 2
|
||||
end
|
||||
# Mud Sport
|
||||
if type == :ELECTRIC
|
||||
@battle.eachBattler do |b|
|
||||
next if !b.effects[PBEffects::MudSport]
|
||||
multipliers[BASE_DMG_MULT] /= 3
|
||||
multipliers[:base_damage_multiplier] /= 3
|
||||
break
|
||||
end
|
||||
if @battle.field.effects[PBEffects::MudSportField]>0
|
||||
multipliers[BASE_DMG_MULT] /= 3
|
||||
multipliers[:base_damage_multiplier] /= 3
|
||||
end
|
||||
end
|
||||
# Water Sport
|
||||
if type == :FIRE
|
||||
@battle.eachBattler do |b|
|
||||
next if !b.effects[PBEffects::WaterSport]
|
||||
multipliers[BASE_DMG_MULT] /= 3
|
||||
multipliers[:base_damage_multiplier] /= 3
|
||||
break
|
||||
end
|
||||
if @battle.field.effects[PBEffects::WaterSportField]>0
|
||||
multipliers[BASE_DMG_MULT] /= 3
|
||||
multipliers[:base_damage_multiplier] /= 3
|
||||
end
|
||||
end
|
||||
# Terrain moves
|
||||
if user.affectedByTerrain?
|
||||
case @battle.field.terrain
|
||||
when PBBattleTerrains::Electric
|
||||
multipliers[BASE_DMG_MULT] *= 1.5 if type == :ELECTRIC
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :ELECTRIC
|
||||
when PBBattleTerrains::Grassy
|
||||
multipliers[BASE_DMG_MULT] *= 1.5 if type == :GRASS
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :GRASS
|
||||
when PBBattleTerrains::Psychic
|
||||
multipliers[BASE_DMG_MULT] *= 1.5 if type == :PSYCHIC
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :PSYCHIC
|
||||
end
|
||||
end
|
||||
if @battle.field.terrain==PBBattleTerrains::Misty && target.affectedByTerrain? &&
|
||||
type == :DRAGON
|
||||
multipliers[BASE_DMG_MULT] /= 2
|
||||
multipliers[:base_damage_multiplier] /= 2
|
||||
end
|
||||
# Badge multipliers
|
||||
if @battle.internalBattle
|
||||
if user.pbOwnedByPlayer?
|
||||
if physicalMove? && @battle.pbPlayer.numbadges>=NUM_BADGES_BOOST_ATTACK
|
||||
multipliers[ATK_MULT] *= 1.1
|
||||
elsif specialMove? && @battle.pbPlayer.numbadges>=NUM_BADGES_BOOST_SPATK
|
||||
multipliers[ATK_MULT] *= 1.1
|
||||
if physicalMove? && @battle.pbPlayer.numbadges >= NUM_BADGES_BOOST_ATTACK
|
||||
multipliers[:attack_multiplier] *= 1.1
|
||||
elsif specialMove? && @battle.pbPlayer.numbadges >= NUM_BADGES_BOOST_SPATK
|
||||
multipliers[:attack_multiplier] *= 1.1
|
||||
end
|
||||
end
|
||||
if target.pbOwnedByPlayer?
|
||||
if physicalMove? && @battle.pbPlayer.numbadges>=NUM_BADGES_BOOST_DEFENSE
|
||||
multipliers[DEF_MULT] *= 1.1
|
||||
elsif specialMove? && @battle.pbPlayer.numbadges>=NUM_BADGES_BOOST_SPDEF
|
||||
multipliers[DEF_MULT] *= 1.1
|
||||
if physicalMove? && @battle.pbPlayer.numbadges >= NUM_BADGES_BOOST_DEFENSE
|
||||
multipliers[:defense_multiplier] *= 1.1
|
||||
elsif specialMove? && @battle.pbPlayer.numbadges >= NUM_BADGES_BOOST_SPDEF
|
||||
multipliers[:defense_multiplier] *= 1.1
|
||||
end
|
||||
end
|
||||
end
|
||||
# Multi-targeting attacks
|
||||
if numTargets>1
|
||||
multipliers[FINAL_DMG_MULT] *= 0.75
|
||||
multipliers[:final_damage_multiplier] *= 0.75
|
||||
end
|
||||
# Weather
|
||||
case @battle.pbWeather
|
||||
when PBWeather::Sun, PBWeather::HarshSun
|
||||
if type == :FIRE
|
||||
multipliers[FINAL_DMG_MULT] *= 1.5
|
||||
multipliers[:final_damage_multiplier] *= 1.5
|
||||
elsif type == :WATER
|
||||
multipliers[FINAL_DMG_MULT] /= 2
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
end
|
||||
when PBWeather::Rain, PBWeather::HeavyRain
|
||||
if type == :FIRE
|
||||
multipliers[FINAL_DMG_MULT] /= 2
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
elsif type == :WATER
|
||||
multipliers[FINAL_DMG_MULT] *= 1.5
|
||||
multipliers[:final_damage_multiplier] *= 1.5
|
||||
end
|
||||
when PBWeather::Sandstorm
|
||||
if target.pbHasType?(:ROCK) && specialMove? && @function!="122" # Psyshock
|
||||
multipliers[DEF_MULT] *= 1.5
|
||||
if target.pbHasType?(:ROCK) && specialMove? && @function != "122" # Psyshock
|
||||
multipliers[:defense_multiplier] *= 1.5
|
||||
end
|
||||
end
|
||||
# Critical hits
|
||||
if target.damageState.critical
|
||||
if NEW_CRITICAL_HIT_RATE_MECHANICS
|
||||
multipliers[FINAL_DMG_MULT] *= 1.5
|
||||
multipliers[:final_damage_multiplier] *= 1.5
|
||||
else
|
||||
multipliers[FINAL_DMG_MULT] *= 2
|
||||
multipliers[:final_damage_multiplier] *= 2
|
||||
end
|
||||
end
|
||||
# Random variance
|
||||
if !self.is_a?(PokeBattle_Confusion)
|
||||
random = 85+@battle.pbRandom(16)
|
||||
multipliers[FINAL_DMG_MULT] *= random/100.0
|
||||
multipliers[:final_damage_multiplier] *= random / 100.0
|
||||
end
|
||||
# STAB
|
||||
if type && user.pbHasType?(type)
|
||||
if user.hasActiveAbility?(:ADAPTABILITY)
|
||||
multipliers[FINAL_DMG_MULT] *= 2
|
||||
multipliers[:final_damage_multiplier] *= 2
|
||||
else
|
||||
multipliers[FINAL_DMG_MULT] *= 1.5
|
||||
multipliers[:final_damage_multiplier] *= 1.5
|
||||
end
|
||||
end
|
||||
# Type effectiveness
|
||||
multipliers[FINAL_DMG_MULT] *= target.damageState.typeMod.to_f/PBTypeEffectiveness::NORMAL_EFFECTIVE
|
||||
multipliers[:final_damage_multiplier] *= target.damageState.typeMod.to_f / PBTypeEffectiveness::NORMAL_EFFECTIVE
|
||||
# Burn
|
||||
if user.status==PBStatuses::BURN && physicalMove? && damageReducedByBurn? &&
|
||||
!user.hasActiveAbility?(:GUTS)
|
||||
multipliers[FINAL_DMG_MULT] /= 2
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
end
|
||||
# Aurora Veil, Reflect, Light Screen
|
||||
if !ignoresReflect? && !target.damageState.critical &&
|
||||
!user.hasActiveAbility?(:INFILTRATOR)
|
||||
if target.pbOwnSide.effects[PBEffects::AuroraVeil]>0
|
||||
if target.pbOwnSide.effects[PBEffects::AuroraVeil] > 0
|
||||
if @battle.pbSideBattlerCount(target)>1
|
||||
multipliers[FINAL_DMG_MULT] *= 2/3.0
|
||||
multipliers[:final_damage_multiplier] *= 2 / 3.0
|
||||
else
|
||||
multipliers[FINAL_DMG_MULT] /= 2
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
end
|
||||
elsif target.pbOwnSide.effects[PBEffects::Reflect]>0 && physicalMove?
|
||||
elsif target.pbOwnSide.effects[PBEffects::Reflect] > 0 && physicalMove?
|
||||
if @battle.pbSideBattlerCount(target)>1
|
||||
multipliers[FINAL_DMG_MULT] *= 2/3.0
|
||||
multipliers[:final_damage_multiplier] *= 2 / 3.0
|
||||
else
|
||||
multipliers[FINAL_DMG_MULT] /= 2
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
end
|
||||
elsif target.pbOwnSide.effects[PBEffects::LightScreen]>0 && specialMove?
|
||||
if @battle.pbSideBattlerCount(target)>1
|
||||
multipliers[FINAL_DMG_MULT] *= 2/3.0
|
||||
elsif target.pbOwnSide.effects[PBEffects::LightScreen] > 0 && specialMove?
|
||||
if @battle.pbSideBattlerCount(target) > 1
|
||||
multipliers[:final_damage_multiplier] *= 2 / 3.0
|
||||
else
|
||||
multipliers[FINAL_DMG_MULT] /= 2
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
end
|
||||
end
|
||||
end
|
||||
# Minimize
|
||||
if target.effects[PBEffects::Minimize] && tramplesMinimize?(2)
|
||||
multipliers[FINAL_DMG_MULT] *= 2
|
||||
multipliers[:final_damage_multiplier] *= 2
|
||||
end
|
||||
# Move-specific base damage modifiers
|
||||
multipliers[BASE_DMG_MULT] = pbBaseDamageMultiplier(multipliers[BASE_DMG_MULT],user,target)
|
||||
multipliers[:base_damage_multiplier] = pbBaseDamageMultiplier(multipliers[:base_damage_multiplier], user, target)
|
||||
# Move-specific final damage modifiers
|
||||
multipliers[FINAL_DMG_MULT] = pbModifyDamage(multipliers[FINAL_DMG_MULT],user,target)
|
||||
multipliers[:final_damage_multiplier] = pbModifyDamage(multipliers[:final_damage_multiplier], user, target)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
|
||||
@@ -1035,7 +1035,7 @@ end
|
||||
class PokeBattle_Move_0A9 < PokeBattle_Move
|
||||
def pbCalcAccuracyMultipliers(user,target,multipliers)
|
||||
super
|
||||
modifiers[EVA_STAGE] = 0 # Accuracy stat stage
|
||||
modifiers[:evasion_stage] = 0
|
||||
end
|
||||
|
||||
def pbGetDefenseStats(user,target)
|
||||
|
||||
@@ -274,7 +274,12 @@ class PokeBattle_AI
|
||||
defense = pbRoughStat(target,PBStats::SPDEF,skill)
|
||||
end
|
||||
##### Calculate all multiplier effects #####
|
||||
multipliers = [1.0, 1.0, 1.0, 1.0]
|
||||
multipliers = {
|
||||
:base_damage_multiplier => 1.0,
|
||||
:attack_multiplier => 1.0,
|
||||
:defense_multiplier => 1.0,
|
||||
:final_damage_multiplier => 1.0
|
||||
}
|
||||
# Ability effects that alter damage
|
||||
moldBreaker = false
|
||||
if skill>=PBTrainerAI.highSkill && target.hasMoldBreaker?
|
||||
@@ -349,15 +354,15 @@ class PokeBattle_AI
|
||||
if (@battle.pbCheckGlobalAbility(:DARKAURA) && type == :DARK) ||
|
||||
(@battle.pbCheckGlobalAbility(:FAIRYAURA) && type == :FAIRY)
|
||||
if @battle.pbCheckGlobalAbility(:AURABREAK)
|
||||
multipliers[BASE_DMG_MULT] *= 2/3
|
||||
multipliers[:base_damage_multiplier] *= 2 / 3.0
|
||||
else
|
||||
multipliers[BASE_DMG_MULT] *= 4/3
|
||||
multipliers[:base_damage_multiplier] *= 4 / 3.0
|
||||
end
|
||||
end
|
||||
end
|
||||
# Parental Bond
|
||||
if skill>=PBTrainerAI.mediumSkill && user.hasActiveAbility?(:PARENTALBOND)
|
||||
multipliers[BASE_DMG_MULT] *= 1.25
|
||||
multipliers[:base_damage_multiplier] *= 1.25
|
||||
end
|
||||
# Me First
|
||||
# TODO
|
||||
@@ -365,7 +370,7 @@ class PokeBattle_AI
|
||||
# Charge
|
||||
if skill>=PBTrainerAI.mediumSkill
|
||||
if user.effects[PBEffects::Charge]>0 && type == :ELECTRIC
|
||||
multipliers[BASE_DMG_MULT] *= 2
|
||||
multipliers[:base_damage_multiplier] *= 2
|
||||
end
|
||||
end
|
||||
# Mud Sport and Water Sport
|
||||
@@ -373,21 +378,21 @@ class PokeBattle_AI
|
||||
if type == :ELECTRIC
|
||||
@battle.eachBattler do |b|
|
||||
next if !b.effects[PBEffects::MudSport]
|
||||
multipliers[BASE_DMG_MULT] /= 3
|
||||
multipliers[:base_damage_multiplier] /= 3
|
||||
break
|
||||
end
|
||||
if @battle.field.effects[PBEffects::MudSportField]>0
|
||||
multipliers[BASE_DMG_MULT] /= 3
|
||||
multipliers[:base_damage_multiplier] /= 3
|
||||
end
|
||||
end
|
||||
if type == :FIRE
|
||||
@battle.eachBattler do |b|
|
||||
next if !b.effects[PBEffects::WaterSport]
|
||||
multipliers[BASE_DMG_MULT] /= 3
|
||||
multipliers[:base_damage_multiplier] /= 3
|
||||
break
|
||||
end
|
||||
if @battle.field.effects[PBEffects::WaterSportField]>0
|
||||
multipliers[BASE_DMG_MULT] /= 3
|
||||
multipliers[:base_damage_multiplier] /= 3
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -395,16 +400,16 @@ class PokeBattle_AI
|
||||
if user.affectedByTerrain? && skill>=PBTrainerAI.mediumSkill
|
||||
case @battle.field.terrain
|
||||
when PBBattleTerrains::Electric
|
||||
multipliers[BASE_DMG_MULT] *= 1.5 if type == :ELECTRIC
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :ELECTRIC
|
||||
when PBBattleTerrains::Grassy
|
||||
multipliers[BASE_DMG_MULT] *= 1.5 if type == :GRASS
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :GRASS
|
||||
when PBBattleTerrains::Psychic
|
||||
multipliers[BASE_DMG_MULT] *= 1.5 if type == :PSYCHIC
|
||||
multipliers[:base_damage_multiplier] *= 1.5 if type == :PSYCHIC
|
||||
end
|
||||
end
|
||||
if target.affectedByTerrain? && skill>=PBTrainerAI.mediumSkill
|
||||
if @battle.field.terrain==PBBattleTerrains::Misty && type == :DRAGON
|
||||
multipliers[BASE_DMG_MULT] /= 2
|
||||
multipliers[:base_damage_multiplier] /= 2
|
||||
end
|
||||
end
|
||||
# Badge multipliers
|
||||
@@ -413,10 +418,10 @@ class PokeBattle_AI
|
||||
# Don't need to check the Atk/Sp Atk-boosting badges because the AI
|
||||
# won't control the player's Pokémon.
|
||||
if target.pbOwnedByPlayer?
|
||||
if move.physicalMove?(type) && @battle.pbPlayer.numbadges>=NUM_BADGES_BOOST_DEFENSE
|
||||
multipliers[DEF_MULT] *= 1.1
|
||||
elsif move.specialMove?(type) && @battle.pbPlayer.numbadges>=NUM_BADGES_BOOST_SPDEF
|
||||
multipliers[DEF_MULT] *= 1.1
|
||||
if move.physicalMove?(type) && @battle.pbPlayer.numbadges >= NUM_BADGES_BOOST_DEFENSE
|
||||
multipliers[:defense_multiplier] *= 1.1
|
||||
elsif move.specialMove?(type) && @battle.pbPlayer.numbadges >= NUM_BADGES_BOOST_SPDEF
|
||||
multipliers[:defense_multiplier] *= 1.1
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -424,7 +429,7 @@ class PokeBattle_AI
|
||||
# Multi-targeting attacks
|
||||
if skill>=PBTrainerAI.highSkill
|
||||
if pbTargetsMultiple?(move,user)
|
||||
multipliers[FINAL_DMG_MULT] *= 0.75
|
||||
multipliers[:final_damage_multiplier] *= 0.75
|
||||
end
|
||||
end
|
||||
# Weather
|
||||
@@ -432,19 +437,19 @@ class PokeBattle_AI
|
||||
case @battle.pbWeather
|
||||
when PBWeather::Sun, PBWeather::HarshSun
|
||||
if type == :FIRE
|
||||
multipliers[FINAL_DMG_MULT] *= 1.5
|
||||
multipliers[:final_damage_multiplier] *= 1.5
|
||||
elsif type == :WATER
|
||||
multipliers[FINAL_DMG_MULT] /= 2
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
end
|
||||
when PBWeather::Rain, PBWeather::HeavyRain
|
||||
if type == :FIRE
|
||||
multipliers[FINAL_DMG_MULT] /= 2
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
elsif type == :WATER
|
||||
multipliers[FINAL_DMG_MULT] *= 1.5
|
||||
multipliers[:final_damage_multiplier] *= 1.5
|
||||
end
|
||||
when PBWeather::Sandstorm
|
||||
if target.pbHasType?(:ROCK) && move.specialMove?(type) && move.function!="122" # Psyshock
|
||||
multipliers[DEF_MULT] *= 1.5
|
||||
if target.pbHasType?(:ROCK) && move.specialMove?(type) && move.function != "122" # Psyshock
|
||||
multipliers[:defense_multiplier] *= 1.5
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -454,45 +459,45 @@ class PokeBattle_AI
|
||||
if skill>=PBTrainerAI.mediumSkill
|
||||
if type && user.pbHasType?(type)
|
||||
if user.hasActiveAbility?(:ADAPTABILITY)
|
||||
multipliers[FINAL_DMG_MULT] *= 2
|
||||
multipliers[:final_damage_multiplier] *= 2
|
||||
else
|
||||
multipliers[FINAL_DMG_MULT] *= 1.5
|
||||
multipliers[:final_damage_multiplier] *= 1.5
|
||||
end
|
||||
end
|
||||
end
|
||||
# Type effectiveness
|
||||
if skill>=PBTrainerAI.mediumSkill
|
||||
typemod = pbCalcTypeMod(type,user,target)
|
||||
multipliers[FINAL_DMG_MULT] *= typemod.to_f/PBTypeEffectiveness::NORMAL_EFFECTIVE
|
||||
multipliers[:final_damage_multiplier] *= typemod.to_f / PBTypeEffectiveness::NORMAL_EFFECTIVE
|
||||
end
|
||||
# Burn
|
||||
if skill>=PBTrainerAI.highSkill
|
||||
if user.status==PBStatuses::BURN && move.physicalMove?(type) &&
|
||||
!user.hasActiveAbility?(:GUTS) &&
|
||||
!(MECHANICS_GENERATION >= 6 && move.function == "07E") # Facade
|
||||
multipliers[FINAL_DMG_MULT] /= 2
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
end
|
||||
end
|
||||
# Aurora Veil, Reflect, Light Screen
|
||||
if skill>=PBTrainerAI.highSkill
|
||||
if !move.ignoresReflect? && !user.hasActiveAbility?(:INFILTRATOR)
|
||||
if target.pbOwnSide.effects[PBEffects::AuroraVeil]>0
|
||||
if @battle.pbSideBattlerCount(target)>1
|
||||
multipliers[FINAL_DMG_MULT] *= 2/3.0
|
||||
if target.pbOwnSide.effects[PBEffects::AuroraVeil] > 0
|
||||
if @battle.pbSideBattlerCount(target) > 1
|
||||
multipliers[:final_damage_multiplier] *= 2 / 3.0
|
||||
else
|
||||
multipliers[FINAL_DMG_MULT] /= 2
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
end
|
||||
elsif target.pbOwnSide.effects[PBEffects::Reflect]>0 && move.physicalMove?(type)
|
||||
if @battle.pbSideBattlerCount(target)>1
|
||||
multipliers[FINAL_DMG_MULT] *= 2/3.0
|
||||
elsif target.pbOwnSide.effects[PBEffects::Reflect] > 0 && move.physicalMove?(type)
|
||||
if @battle.pbSideBattlerCount(target) > 1
|
||||
multipliers[:final_damage_multiplier] *= 2 / 3.0
|
||||
else
|
||||
multipliers[FINAL_DMG_MULT] /= 2
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
end
|
||||
elsif target.pbOwnSide.effects[PBEffects::LightScreen]>0 && move.specialMove?(type)
|
||||
if @battle.pbSideBattlerCount(target)>1
|
||||
multipliers[FINAL_DMG_MULT] *= 2/3.0
|
||||
elsif target.pbOwnSide.effects[PBEffects::LightScreen] > 0 && move.specialMove?(type)
|
||||
if @battle.pbSideBattlerCount(target) > 1
|
||||
multipliers[:final_damage_multiplier] *= 2 / 3.0
|
||||
else
|
||||
multipliers[FINAL_DMG_MULT] /= 2
|
||||
multipliers[:final_damage_multiplier] /= 2
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -500,7 +505,7 @@ class PokeBattle_AI
|
||||
# Minimize
|
||||
if skill>=PBTrainerAI.highSkill
|
||||
if target.effects[PBEffects::Minimize] && move.tramplesMinimize?(2)
|
||||
multipliers[FINAL_DMG_MULT] *= 2
|
||||
multipliers[:final_damage_multiplier] *= 2
|
||||
end
|
||||
end
|
||||
# Move-specific base damage modifiers
|
||||
@@ -508,11 +513,11 @@ class PokeBattle_AI
|
||||
# Move-specific final damage modifiers
|
||||
# TODO
|
||||
##### Main damage calculation #####
|
||||
baseDmg = [(baseDmg * multipliers[BASE_DMG_MULT]).round, 1].max
|
||||
atk = [(atk * multipliers[ATK_MULT]).round, 1].max
|
||||
defense = [(defense * multipliers[DEF_MULT]).round, 1].max
|
||||
baseDmg = [(baseDmg * multipliers[:base_damage_multiplier]).round, 1].max
|
||||
atk = [(atk * multipliers[:attack_multiplier]).round, 1].max
|
||||
defense = [(defense * multipliers[:defense_multiplier]).round, 1].max
|
||||
damage = (((2.0 * user.level / 5 + 2).floor * baseDmg * atk / defense).floor / 50).floor + 2
|
||||
damage = [(damage * multipliers[FINAL_DMG_MULT]).round, 1].max
|
||||
damage = [(damage * multipliers[:final_damage_multiplier]).round, 1].max
|
||||
# "AI-specific calculations below"
|
||||
# Increased critical hit rates
|
||||
if skill>=PBTrainerAI.mediumSkill
|
||||
@@ -567,26 +572,26 @@ class PokeBattle_AI
|
||||
# Get the move's type
|
||||
type = pbRoughType(move,user,skill)
|
||||
# Calculate all modifier effects
|
||||
modifiers = []
|
||||
modifiers[BASE_ACC] = baseAcc
|
||||
modifiers[ACC_STAGE] = user.stages[PBStats::ACCURACY]
|
||||
modifiers[EVA_STAGE] = target.stages[PBStats::EVASION]
|
||||
modifiers[ACC_MULT] = 1.0
|
||||
modifiers[EVA_MULT] = 1.0
|
||||
modifiers = {}
|
||||
modifiers[:base_accuracy] = baseAcc
|
||||
modifiers[:accuracy_stage] = user.stages[PBStats::ACCURACY]
|
||||
modifiers[:evasion_stage] = target.stages[PBStats::EVASION]
|
||||
modifiers[:accuracy_multiplier] = 1.0
|
||||
modifiers[:evasion_multiplier] = 1.0
|
||||
pbCalcAccuracyModifiers(user,target,modifiers,move,type,skill)
|
||||
# Check if move can't miss
|
||||
return 125 if modifiers[BASE_ACC]==0
|
||||
return 125 if modifiers[:base_accuracy]==0
|
||||
# Calculation
|
||||
accStage = [[modifiers[ACC_STAGE],-6].max,6].min + 6
|
||||
evaStage = [[modifiers[EVA_STAGE],-6].max,6].min + 6
|
||||
accStage = [[modifiers[:accuracy_stage], -6].max, 6].min + 6
|
||||
evaStage = [[modifiers[:evasion_stage], -6].max, 6].min + 6
|
||||
stageMul = [3,3,3,3,3,3, 3, 4,5,6,7,8,9]
|
||||
stageDiv = [9,8,7,6,5,4, 3, 3,3,3,3,3,3]
|
||||
accuracy = 100.0 * stageMul[accStage] / stageDiv[accStage]
|
||||
evasion = 100.0 * stageMul[evaStage] / stageDiv[evaStage]
|
||||
accuracy = (accuracy * modifiers[ACC_MULT]).round
|
||||
evasion = (evasion * modifiers[EVA_MULT]).round
|
||||
accuracy = (accuracy * modifiers[:accuracy_multiplier]).round
|
||||
evasion = (evasion * modifiers[:evasion_multiplier]).round
|
||||
evasion = 1 if evasion<1
|
||||
return modifiers[BASE_ACC] * accuracy / evasion
|
||||
return modifiers[:base_accuracy] * accuracy / evasion
|
||||
end
|
||||
|
||||
def pbCalcAccuracyModifiers(user,target,modifiers,move,type,skill)
|
||||
@@ -625,35 +630,35 @@ class PokeBattle_AI
|
||||
modifiers,user,target,move,type)
|
||||
end
|
||||
end
|
||||
# Other effects, inc. ones that set ACC_MULT or EVA_STAGE to specific values
|
||||
# Other effects, inc. ones that set accuracy_multiplier or evasion_stage to specific values
|
||||
if skill>=PBTrainerAI.mediumSkill
|
||||
if @battle.field.effects[PBEffects::Gravity]>0
|
||||
modifiers[ACC_MULT] *= 5/3.0
|
||||
if @battle.field.effects[PBEffects::Gravity] > 0
|
||||
modifiers[:accuracy_multiplier] *= 5/3.0
|
||||
end
|
||||
if user.effects[PBEffects::MicleBerry]
|
||||
modifiers[ACC_MULT] *= 1.2
|
||||
modifiers[:accuracy_multiplier] *= 1.2
|
||||
end
|
||||
modifiers[EVA_STAGE] = 0 if target.effects[PBEffects::Foresight] && modifiers[EVA_STAGE]>0
|
||||
modifiers[EVA_STAGE] = 0 if target.effects[PBEffects::MiracleEye] && modifiers[EVA_STAGE]>0
|
||||
modifiers[:evasion_stage] = 0 if target.effects[PBEffects::Foresight] && modifiers[:evasion_stage] > 0
|
||||
modifiers[:evasion_stage] = 0 if target.effects[PBEffects::MiracleEye] && modifiers[:evasion_stage] > 0
|
||||
end
|
||||
# "AI-specific calculations below"
|
||||
if skill>=PBTrainerAI.mediumSkill
|
||||
modifiers[EVA_STAGE] = 0 if move.function=="0A9" # Chip Away
|
||||
modifiers[BASE_ACC] = 0 if ["0A5","139","13A","13B","13C", # "Always hit"
|
||||
"147"].include?(move.function)
|
||||
modifiers[BASE_ACC] = 0 if user.effects[PBEffects::LockOn]>0 &&
|
||||
user.effects[PBEffects::LockOnPos]==target.index
|
||||
modifiers[:evasion_stage] = 0 if move.function == "0A9" # Chip Away
|
||||
modifiers[:base_accuracy] = 0 if ["0A5", "139", "13A", "13B", "13C", # "Always hit"
|
||||
"147"].include?(move.function)
|
||||
modifiers[:base_accuracy] = 0 if user.effects[PBEffects::LockOn]>0 &&
|
||||
user.effects[PBEffects::LockOnPos]==target.index
|
||||
end
|
||||
if skill>=PBTrainerAI.highSkill
|
||||
if move.function=="006" # Toxic
|
||||
modifiers[BASE_ACC] = 0 if MORE_TYPE_EFFECTS && move.statusMove? &&
|
||||
user.pbHasType?(:POISON)
|
||||
modifiers[:base_accuracy] = 0 if MORE_TYPE_EFFECTS && move.statusMove? &&
|
||||
user.pbHasType?(:POISON)
|
||||
end
|
||||
if move.function=="070" # OHKO moves
|
||||
modifiers[BASE_ACC] = move.accuracy+user.level-target.level
|
||||
modifiers[ACC_MULT] = 0 if target.level>user.level
|
||||
modifiers[:base_accuracy] = move.accuracy + user.level - target.level
|
||||
modifiers[:accuracy_multiplier] = 0 if target.level > user.level
|
||||
if skill>=PBTrainerAI.bestSkill
|
||||
modifiers[ACC_MULT] = 0 if target.hasActiveAbility?(:STURDY)
|
||||
modifiers[:accuracy_multiplier] = 0 if target.hasActiveAbility?(:STURDY)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -478,17 +478,6 @@ end
|
||||
|
||||
|
||||
|
||||
BASE_ACC = 0
|
||||
ACC_STAGE = 1
|
||||
EVA_STAGE = 2
|
||||
ACC_MULT = 3
|
||||
EVA_MULT = 4
|
||||
|
||||
BASE_DMG_MULT = 0
|
||||
ATK_MULT = 1
|
||||
DEF_MULT = 2
|
||||
FINAL_DMG_MULT = 3
|
||||
|
||||
def pbBattleConfusionBerry(battler,battle,item,forced,flavor,confuseMsg)
|
||||
return false if !forced && !battler.canHeal?
|
||||
return false if !forced && !battler.canConsumePinchBerry?(MECHANICS_GENERATION >= 7)
|
||||
@@ -582,16 +571,16 @@ def pbBattleGem(user,type,move,mults,moveType)
|
||||
return if moveType != type
|
||||
user.effects[PBEffects::GemConsumed] = user.item_id
|
||||
if MECHANICS_GENERATION >= 6
|
||||
mults[BASE_DMG_MULT] *= 1.3
|
||||
mults[:base_damage_multiplier] *= 1.3
|
||||
else
|
||||
mults[BASE_DMG_MULT] *= 1.5
|
||||
mults[:base_damage_multiplier] *= 1.5
|
||||
end
|
||||
end
|
||||
|
||||
def pbBattleTypeWeakingBerry(type,moveType,target,mults)
|
||||
return if moveType != type
|
||||
return if PBTypeEffectiveness.resistant?(target.damageState.typeMod) && moveType != :NORMAL
|
||||
mults[FINAL_DMG_MULT] /= 2
|
||||
mults[:final_damage_multiplier] /= 2
|
||||
target.damageState.berryWeakened = true
|
||||
target.battle.pbCommonAnimation("EatBerry",target)
|
||||
end
|
||||
|
||||
@@ -768,37 +768,37 @@ BattleHandlers::MoveBaseTypeModifierAbility.add(:REFRIGERATE,
|
||||
|
||||
BattleHandlers::AccuracyCalcUserAbility.add(:COMPOUNDEYES,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
mods[ACC_MULT] *= 1.3
|
||||
mods[:accuracy_multiplier] *= 1.3
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::AccuracyCalcUserAbility.add(:HUSTLE,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
mods[ACC_MULT] *= 0.8 if move.physicalMove?
|
||||
mods[:accuracy_multiplier] *= 0.8 if move.physicalMove?
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::AccuracyCalcUserAbility.add(:KEENEYE,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
mods[EVA_STAGE] = 0 if mods[EVA_STAGE]>0 && MECHANICS_GENERATION >= 6
|
||||
mods[:evasion_stage] = 0 if mods[:evasion_stage] > 0 && MECHANICS_GENERATION >= 6
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::AccuracyCalcUserAbility.add(:NOGUARD,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
mods[BASE_ACC] = 0
|
||||
mods[:base_accuracy] = 0
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::AccuracyCalcUserAbility.add(:UNAWARE,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
mods[EVA_STAGE] = 0 if move.damagingMove?
|
||||
mods[:evasion_stage] = 0 if move.damagingMove?
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::AccuracyCalcUserAbility.add(:VICTORYSTAR,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
mods[ACC_MULT] *= 1.1
|
||||
mods[:accuracy_multiplier] *= 1.1
|
||||
}
|
||||
)
|
||||
|
||||
@@ -808,7 +808,7 @@ BattleHandlers::AccuracyCalcUserAbility.add(:VICTORYSTAR,
|
||||
|
||||
BattleHandlers::AccuracyCalcUserAllyAbility.add(:VICTORYSTAR,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
mods[ACC_MULT] *= 1.1
|
||||
mods[:accuracy_multiplier] *= 1.1
|
||||
}
|
||||
)
|
||||
|
||||
@@ -818,20 +818,20 @@ BattleHandlers::AccuracyCalcUserAllyAbility.add(:VICTORYSTAR,
|
||||
|
||||
BattleHandlers::AccuracyCalcTargetAbility.add(:LIGHTNINGROD,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
mods[BASE_ACC] = 0 if type == :ELECTRIC
|
||||
mods[:base_accuracy] = 0 if type == :ELECTRIC
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::AccuracyCalcTargetAbility.add(:NOGUARD,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
mods[BASE_ACC] = 0
|
||||
mods[:base_accuracy] = 0
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::AccuracyCalcTargetAbility.add(:SANDVEIL,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
if target.battle.pbWeather==PBWeather::Sandstorm
|
||||
mods[EVA_MULT] *= 1.25
|
||||
mods[:evasion_multiplier] *= 1.25
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -839,33 +839,33 @@ BattleHandlers::AccuracyCalcTargetAbility.add(:SANDVEIL,
|
||||
BattleHandlers::AccuracyCalcTargetAbility.add(:SNOWCLOAK,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
if target.battle.pbWeather==PBWeather::Hail
|
||||
mods[EVA_MULT] *= 1.25
|
||||
mods[:evasion_multiplier] *= 1.25
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::AccuracyCalcTargetAbility.add(:STORMDRAIN,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
mods[BASE_ACC] = 0 if type == :WATER
|
||||
mods[:base_accuracy] = 0 if type == :WATER
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::AccuracyCalcTargetAbility.add(:TANGLEDFEET,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
mods[ACC_MULT] /= 2 if target.effects[PBEffects::Confusion]>0
|
||||
mods[:accuracy_multiplier] /= 2 if target.effects[PBEffects::Confusion] > 0
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::AccuracyCalcTargetAbility.add(:UNAWARE,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
mods[ACC_STAGE] = 0 if move.damagingMove?
|
||||
mods[:accuracy_stage] = 0 if move.damagingMove?
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::AccuracyCalcTargetAbility.add(:WONDERSKIN,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
if move.statusMove? && user.opposes?(target)
|
||||
mods[BASE_ACC] = 0 if mods[BASE_ACC]>50
|
||||
mods[:base_accuracy] = 0 if mods[:base_accuracy] > 50
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -876,7 +876,7 @@ BattleHandlers::AccuracyCalcTargetAbility.add(:WONDERSKIN,
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:AERILATE,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if move.powerBoost
|
||||
mults[:base_damage_multiplier] *= 1.2 if move.powerBoost
|
||||
}
|
||||
)
|
||||
|
||||
@@ -887,29 +887,29 @@ BattleHandlers::DamageCalcUserAbility.add(:ANALYTIC,
|
||||
if (target.battle.choices[target.index][0]!=:UseMove &&
|
||||
target.battle.choices[target.index][0]!=:Shift) ||
|
||||
target.movedThisRound?
|
||||
mults[BASE_DMG_MULT] *= 1.3
|
||||
mults[:base_damage_multiplier] *= 1.3
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:BLAZE,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if user.hp<=user.totalhp/3 && type == :FIRE
|
||||
mults[ATK_MULT] *= 1.5
|
||||
if user.hp <= user.totalhp / 3 && type == :FIRE
|
||||
mults[:attack_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:DEFEATIST,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[ATK_MULT] /= 2 if user.hp<=user.totalhp/2
|
||||
mults[:attack_multiplier] /= 2 if user.hp <= user.totalhp / 2
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:FLAREBOOST,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if user.burned? && move.specialMove?
|
||||
mults[BASE_DMG_MULT] *= 1.5
|
||||
mults[:base_damage_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -917,7 +917,7 @@ BattleHandlers::DamageCalcUserAbility.add(:FLAREBOOST,
|
||||
BattleHandlers::DamageCalcUserAbility.add(:FLASHFIRE,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if user.effects[PBEffects::FlashFire] && type == :FIRE
|
||||
mults[ATK_MULT] *= 1.5
|
||||
mults[:attack_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -926,7 +926,7 @@ BattleHandlers::DamageCalcUserAbility.add(:FLOWERGIFT,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
w = user.battle.pbWeather
|
||||
if move.physicalMove? && (w==PBWeather::Sun || w==PBWeather::HarshSun)
|
||||
mults[ATK_MULT] *= 1.5
|
||||
mults[:attack_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -934,14 +934,14 @@ BattleHandlers::DamageCalcUserAbility.add(:FLOWERGIFT,
|
||||
BattleHandlers::DamageCalcUserAbility.add(:GUTS,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if user.pbHasAnyStatus? && move.physicalMove?
|
||||
mults[ATK_MULT] *= 1.5
|
||||
mults[:attack_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:HUGEPOWER,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[ATK_MULT] *= 2 if move.physicalMove?
|
||||
mults[:attack_multiplier] *= 2 if move.physicalMove?
|
||||
}
|
||||
)
|
||||
|
||||
@@ -949,19 +949,19 @@ BattleHandlers::DamageCalcUserAbility.copy(:HUGEPOWER,:PUREPOWER)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:HUSTLE,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[ATK_MULT] *= 1.5 if move.physicalMove?
|
||||
mults[:attack_multiplier] *= 1.5 if move.physicalMove?
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:IRONFIST,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if move.punchingMove?
|
||||
mults[:base_damage_multiplier] *= 1.2 if move.punchingMove?
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:MEGALAUNCHER,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.5 if move.pulseMove?
|
||||
mults[:base_damage_multiplier] *= 1.5 if move.pulseMove?
|
||||
}
|
||||
)
|
||||
|
||||
@@ -969,8 +969,8 @@ BattleHandlers::DamageCalcUserAbility.add(:MINUS,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
next if !move.specialMove?
|
||||
user.eachAlly do |b|
|
||||
next if !b.hasActiveAbility?([:MINUS,:PLUS])
|
||||
mults[ATK_MULT] *= 1.5
|
||||
next if !b.hasActiveAbility?([:MINUS, :PLUS])
|
||||
mults[:attack_multiplier] *= 1.5
|
||||
break
|
||||
end
|
||||
}
|
||||
@@ -981,22 +981,22 @@ BattleHandlers::DamageCalcUserAbility.copy(:MINUS,:PLUS)
|
||||
BattleHandlers::DamageCalcUserAbility.add(:NEUROFORCE,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if PBTypeEffectiveness.superEffective?(target.damageState.typeMod)
|
||||
mults[FINAL_DMG_MULT] *= 1.25
|
||||
mults[:final_damage_multiplier] *= 1.25
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:OVERGROW,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if user.hp<=user.totalhp/3 && type == :GRASS
|
||||
mults[ATK_MULT] *= 1.5
|
||||
if user.hp <= user.totalhp / 3 && type == :GRASS
|
||||
mults[:attack_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:RECKLESS,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if move.recoilMove?
|
||||
mults[:base_damage_multiplier] *= 1.2 if move.recoilMove?
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1004,9 +1004,9 @@ BattleHandlers::DamageCalcUserAbility.add(:RIVALRY,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if user.gender!=2 && target.gender!=2
|
||||
if user.gender==target.gender
|
||||
mults[BASE_DMG_MULT] *= 1.25
|
||||
mults[:base_damage_multiplier] *= 1.25
|
||||
else
|
||||
mults[BASE_DMG_MULT] *= 0.75
|
||||
mults[:base_damage_multiplier] *= 0.75
|
||||
end
|
||||
end
|
||||
}
|
||||
@@ -1016,28 +1016,28 @@ BattleHandlers::DamageCalcUserAbility.add(:SANDFORCE,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if user.battle.pbWeather==PBWeather::Sandstorm &&
|
||||
[:ROCK, :GROUND, :STEEL].include?(type)
|
||||
mults[BASE_DMG_MULT] *= 1.3
|
||||
mults[:base_damage_multiplier] *= 1.3
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:SHEERFORCE,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.3 if move.addlEffect>0
|
||||
mults[:base_damage_multiplier] *= 1.3 if move.addlEffect > 0
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:SLOWSTART,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[ATK_MULT] /= 2 if user.effects[PBEffects::SlowStart]>0 && move.physicalMove?
|
||||
mults[:attack_multiplier] /= 2 if user.effects[PBEffects::SlowStart] > 0 && move.physicalMove?
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:SOLARPOWER,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
w = user.battle.pbWeather
|
||||
if move.specialMove? && (w==PBWeather::Sun || w==PBWeather::HarshSun)
|
||||
mults[ATK_MULT] *= 1.5
|
||||
if move.specialMove? && (w == PBWeather::Sun || w == PBWeather::HarshSun)
|
||||
mults[:attack_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -1045,77 +1045,77 @@ BattleHandlers::DamageCalcUserAbility.add(:SOLARPOWER,
|
||||
BattleHandlers::DamageCalcUserAbility.add(:SNIPER,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if target.damageState.critical
|
||||
mults[FINAL_DMG_MULT] *= 1.5
|
||||
mults[:final_damage_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:STAKEOUT,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[ATK_MULT] *= 2 if target.battle.choices[target.index][0]==:SwitchOut
|
||||
mults[:attack_multiplier] *= 2 if target.battle.choices[target.index][0] == :SwitchOut
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:STEELWORKER,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[ATK_MULT] *= 1.5 if type == :STEEL
|
||||
mults[:attack_multiplier] *= 1.5 if type == :STEEL
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:STRONGJAW,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.5 if move.bitingMove?
|
||||
mults[:base_damage_multiplier] *= 1.5 if move.bitingMove?
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:SWARM,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if user.hp<=user.totalhp/3 && type == :BUG
|
||||
mults[ATK_MULT] *= 1.5
|
||||
if user.hp <= user.totalhp / 3 && type == :BUG
|
||||
mults[:attack_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:TECHNICIAN,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if user.index!=target.index && move && move.id != :STRUGGLE &&
|
||||
baseDmg*mults[BASE_DMG_MULT]<=60
|
||||
mults[BASE_DMG_MULT] *= 1.5
|
||||
if user.index != target.index && move && move.id != :STRUGGLE &&
|
||||
baseDmg * mults[:base_damage_multiplier] <= 60
|
||||
mults[:base_damage_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:TINTEDLENS,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[FINAL_DMG_MULT] *= 2 if PBTypeEffectiveness.resistant?(target.damageState.typeMod)
|
||||
mults[:final_damage_multiplier] *= 2 if PBTypeEffectiveness.resistant?(target.damageState.typeMod)
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:TORRENT,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if user.hp<=user.totalhp/3 && type == :WATER
|
||||
mults[ATK_MULT] *= 1.5
|
||||
if user.hp <= user.totalhp / 3 && type == :WATER
|
||||
mults[:attack_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:TOUGHCLAWS,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 4/3.0 if move.contactMove?
|
||||
mults[:base_damage_multiplier] *= 4 / 3.0 if move.contactMove?
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:TOXICBOOST,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if user.poisoned? && move.physicalMove?
|
||||
mults[BASE_DMG_MULT] *= 1.5
|
||||
mults[:base_damage_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAbility.add(:WATERBUBBLE,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[ATK_MULT] *= 2 if type == :WATER
|
||||
mults[:attack_multiplier] *= 2 if type == :WATER
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1126,15 +1126,15 @@ BattleHandlers::DamageCalcUserAbility.add(:WATERBUBBLE,
|
||||
BattleHandlers::DamageCalcUserAllyAbility.add(:BATTERY,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
next if !move.specialMove?
|
||||
mults[FINAL_DMG_MULT] *= 1.3
|
||||
mults[:final_damage_multiplier] *= 1.3
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserAllyAbility.add(:FLOWERGIFT,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
w = user.battle.pbWeather
|
||||
if move.physicalMove? && (w==PBWeather::Sun || w==PBWeather::HarshSun)
|
||||
mults[ATK_MULT] *= 1.5
|
||||
if move.physicalMove? && (w == PBWeather::Sun || w == PBWeather::HarshSun)
|
||||
mults[:attack_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -1145,14 +1145,14 @@ BattleHandlers::DamageCalcUserAllyAbility.add(:FLOWERGIFT,
|
||||
|
||||
BattleHandlers::DamageCalcTargetAbility.add(:DRYSKIN,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.25 if type == :FIRE
|
||||
mults[:base_damage_multiplier] *= 1.25 if type == :FIRE
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcTargetAbility.add(:FILTER,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if PBTypeEffectiveness.superEffective?(target.damageState.typeMod)
|
||||
mults[FINAL_DMG_MULT] *= 0.75
|
||||
mults[:final_damage_multiplier] *= 0.75
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -1162,62 +1162,62 @@ BattleHandlers::DamageCalcTargetAbility.copy(:FILTER,:SOLIDROCK)
|
||||
BattleHandlers::DamageCalcTargetAbility.add(:FLOWERGIFT,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
w = user.battle.pbWeather
|
||||
if move.specialMove? && (w==PBWeather::Sun || w==PBWeather::HarshSun)
|
||||
mults[DEF_MULT] *= 1.5
|
||||
if move.specialMove? && (w == PBWeather::Sun || w == PBWeather::HarshSun)
|
||||
mults[:defense_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcTargetAbility.add(:FLUFFY,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[FINAL_DMG_MULT] *= 2 if move.calcType == :FIRE
|
||||
mults[FINAL_DMG_MULT] /= 2 if move.contactMove?
|
||||
mults[:final_damage_multiplier] *= 2 if move.calcType == :FIRE
|
||||
mults[:final_damage_multiplier] /= 2 if move.contactMove?
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcTargetAbility.add(:FURCOAT,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[DEF_MULT] *= 2 if move.physicalMove? || move.function=="122" # Psyshock
|
||||
mults[:defense_multiplier] *= 2 if move.physicalMove? || move.function == "122" # Psyshock
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcTargetAbility.add(:GRASSPELT,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if user.battle.field.terrain==PBBattleTerrains::Grassy
|
||||
mults[DEF_MULT] *= 1.5
|
||||
if user.battle.field.terrain == PBBattleTerrains::Grassy
|
||||
mults[:defense_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcTargetAbility.add(:HEATPROOF,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] /= 2 if type == :FIRE
|
||||
mults[:base_damage_multiplier] /= 2 if type == :FIRE
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcTargetAbility.add(:MARVELSCALE,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if target.pbHasAnyStatus? && move.physicalMove?
|
||||
mults[DEF_MULT] *= 1.5
|
||||
mults[:defense_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcTargetAbility.add(:MULTISCALE,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[FINAL_DMG_MULT] /= 2 if target.hp==target.totalhp
|
||||
mults[:final_damage_multiplier] /= 2 if target.hp == target.totalhp
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcTargetAbility.add(:THICKFAT,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] /= 2 if type == :FIRE || type == :ICE
|
||||
mults[:base_damage_multiplier] /= 2 if type == :FIRE || type == :ICE
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcTargetAbility.add(:WATERBUBBLE,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[FINAL_DMG_MULT] /= 2 if type == :FIRE
|
||||
mults[:final_damage_multiplier] /= 2 if type == :FIRE
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1228,7 +1228,7 @@ BattleHandlers::DamageCalcTargetAbility.add(:WATERBUBBLE,
|
||||
BattleHandlers::DamageCalcTargetAbilityNonIgnorable.add(:PRISMARMOR,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if PBTypeEffectiveness.superEffective?(target.damageState.typeMod)
|
||||
mults[FINAL_DMG_MULT] *= 0.75
|
||||
mults[:final_damage_multiplier] *= 0.75
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -1236,7 +1236,7 @@ BattleHandlers::DamageCalcTargetAbilityNonIgnorable.add(:PRISMARMOR,
|
||||
BattleHandlers::DamageCalcTargetAbilityNonIgnorable.add(:SHADOWSHIELD,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
if target.hp==target.totalhp
|
||||
mults[FINAL_DMG_MULT] /= 2
|
||||
mults[:final_damage_multiplier] /= 2
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -1248,15 +1248,15 @@ BattleHandlers::DamageCalcTargetAbilityNonIgnorable.add(:SHADOWSHIELD,
|
||||
BattleHandlers::DamageCalcTargetAllyAbility.add(:FLOWERGIFT,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
w = user.battle.pbWeather
|
||||
if move.specialMove? && (w==PBWeather::Sun || w==PBWeather::HarshSun)
|
||||
mults[DEF_MULT] *= 1.5
|
||||
if move.specialMove? && (w == PBWeather::Sun || w == PBWeather::HarshSun)
|
||||
mults[:defense_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcTargetAllyAbility.add(:FRIENDGUARD,
|
||||
proc { |ability,user,target,move,mults,baseDmg,type|
|
||||
mults[FINAL_DMG_MULT] *= 0.75
|
||||
mults[:final_damage_multiplier] *= 0.75
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -412,7 +412,7 @@ BattleHandlers::PriorityBracketUseItem.add(:QUICKCLAW,
|
||||
|
||||
BattleHandlers::AccuracyCalcUserItem.add(:WIDELENS,
|
||||
proc { |item,mods,user,target,move,type|
|
||||
mods[ACC_MULT] *= 1.1
|
||||
mods[:accuracy_multiplier] *= 1.1
|
||||
}
|
||||
)
|
||||
|
||||
@@ -421,7 +421,7 @@ BattleHandlers::AccuracyCalcUserItem.add(:ZOOMLENS,
|
||||
if (target.battle.choices[target.index][0]!=:UseMove &&
|
||||
target.battle.choices[target.index][0]!=:Shift) ||
|
||||
target.movedThisRound?
|
||||
mods[ACC_MULT] *= 1.2
|
||||
mods[:accuracy_multiplier] *= 1.2
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -432,7 +432,7 @@ BattleHandlers::AccuracyCalcUserItem.add(:ZOOMLENS,
|
||||
|
||||
BattleHandlers::AccuracyCalcTargetItem.add(:BRIGHTPOWDER,
|
||||
proc { |item,mods,user,target,move,type|
|
||||
mods[ACC_MULT] *= 0.9
|
||||
mods[:accuracy_multiplier] *= 0.9
|
||||
}
|
||||
)
|
||||
|
||||
@@ -445,14 +445,14 @@ BattleHandlers::AccuracyCalcTargetItem.copy(:BRIGHTPOWDER,:LAXINCENSE)
|
||||
BattleHandlers::DamageCalcUserItem.add(:ADAMANTORB,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
if user.isSpecies?(:DIALGA) && (type == :DRAGON || type == :STEEL)
|
||||
mults[BASE_DMG_MULT] *= 1.2
|
||||
mults[:base_damage_multiplier] *= 1.2
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:BLACKBELT,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :FIGHTING
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :FIGHTING
|
||||
}
|
||||
)
|
||||
|
||||
@@ -460,7 +460,7 @@ BattleHandlers::DamageCalcUserItem.copy(:BLACKBELT,:FISTPLATE)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:BLACKGLASSES,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :DARK
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :DARK
|
||||
}
|
||||
)
|
||||
|
||||
@@ -474,7 +474,7 @@ BattleHandlers::DamageCalcUserItem.add(:BUGGEM,
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:CHARCOAL,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :FIRE
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :FIRE
|
||||
}
|
||||
)
|
||||
|
||||
@@ -482,13 +482,13 @@ BattleHandlers::DamageCalcUserItem.copy(:CHARCOAL,:FLAMEPLATE)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:CHOICEBAND,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.5 if move.physicalMove?
|
||||
mults[:base_damage_multiplier] *= 1.5 if move.physicalMove?
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:CHOICESPECS,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.5 if move.specialMove?
|
||||
mults[:base_damage_multiplier] *= 1.5 if move.specialMove?
|
||||
}
|
||||
)
|
||||
|
||||
@@ -501,14 +501,14 @@ BattleHandlers::DamageCalcUserItem.add(:DARKGEM,
|
||||
BattleHandlers::DamageCalcUserItem.add(:DEEPSEATOOTH,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
if user.isSpecies?(:CLAMPERL) && move.specialMove?
|
||||
mults[ATK_MULT] *= 2
|
||||
mults[:attack_multiplier] *= 2
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:DRAGONFANG,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :DRAGON
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :DRAGON
|
||||
}
|
||||
)
|
||||
|
||||
@@ -529,7 +529,7 @@ BattleHandlers::DamageCalcUserItem.add(:ELECTRICGEM,
|
||||
BattleHandlers::DamageCalcUserItem.add(:EXPERTBELT,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
if PBTypeEffectiveness.superEffective?(target.damageState.typeMod)
|
||||
mults[FINAL_DMG_MULT] *= 1.2
|
||||
mults[:final_damage_multiplier] *= 1.2
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -573,7 +573,7 @@ BattleHandlers::DamageCalcUserItem.add(:GRASSGEM,
|
||||
BattleHandlers::DamageCalcUserItem.add(:GRISEOUSORB,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
if user.isSpecies?(:GIRATINA) && (type == :DRAGON || type == :GHOST)
|
||||
mults[BASE_DMG_MULT] *= 1.2
|
||||
mults[:base_damage_multiplier] *= 1.2
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -586,7 +586,7 @@ BattleHandlers::DamageCalcUserItem.add(:GROUNDGEM,
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:HARDSTONE,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :ROCK
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :ROCK
|
||||
}
|
||||
)
|
||||
|
||||
@@ -601,7 +601,7 @@ BattleHandlers::DamageCalcUserItem.add(:ICEGEM,
|
||||
BattleHandlers::DamageCalcUserItem.add(:LIFEORB,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
if !move.is_a?(PokeBattle_Confusion)
|
||||
mults[FINAL_DMG_MULT] *= 1.3
|
||||
mults[:final_damage_multiplier] *= 1.3
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -609,7 +609,7 @@ BattleHandlers::DamageCalcUserItem.add(:LIFEORB,
|
||||
BattleHandlers::DamageCalcUserItem.add(:LIGHTBALL,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
if user.isSpecies?(:PIKACHU)
|
||||
mults[ATK_MULT] *= 2
|
||||
mults[:attack_multiplier] *= 2
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -617,14 +617,14 @@ BattleHandlers::DamageCalcUserItem.add(:LIGHTBALL,
|
||||
BattleHandlers::DamageCalcUserItem.add(:LUSTROUSORB,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
if user.isSpecies?(:PALKIA) && (type == :DRAGON || type == :WATER)
|
||||
mults[BASE_DMG_MULT] *= 1.2
|
||||
mults[:base_damage_multiplier] *= 1.2
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:MAGNET,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :ELECTRIC
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :ELECTRIC
|
||||
}
|
||||
)
|
||||
|
||||
@@ -632,7 +632,7 @@ BattleHandlers::DamageCalcUserItem.copy(:MAGNET,:ZAPPLATE)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:METALCOAT,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :STEEL
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :STEEL
|
||||
}
|
||||
)
|
||||
|
||||
@@ -640,14 +640,14 @@ BattleHandlers::DamageCalcUserItem.copy(:METALCOAT,:IRONPLATE)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:METRONOME,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
met = 1+0.2*[user.effects[PBEffects::Metronome],5].min
|
||||
mults[FINAL_DMG_MULT] *= met
|
||||
met = 1 + 0.2 * [user.effects[PBEffects::Metronome], 5].min
|
||||
mults[:final_damage_multiplier] *= met
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:MIRACLESEED,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :GRASS
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :GRASS
|
||||
}
|
||||
)
|
||||
|
||||
@@ -655,13 +655,13 @@ BattleHandlers::DamageCalcUserItem.copy(:MIRACLESEED,:MEADOWPLATE,:ROSEINCENSE)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:MUSCLEBAND,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.1 if move.physicalMove?
|
||||
mults[:base_damage_multiplier] *= 1.1 if move.physicalMove?
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:MYSTICWATER,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :WATER
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :WATER
|
||||
}
|
||||
)
|
||||
|
||||
@@ -669,7 +669,7 @@ BattleHandlers::DamageCalcUserItem.copy(:MYSTICWATER,:SPLASHPLATE,:SEAINCENSE,:W
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:NEVERMELTICE,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :ICE
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :ICE
|
||||
}
|
||||
)
|
||||
|
||||
@@ -683,13 +683,13 @@ BattleHandlers::DamageCalcUserItem.add(:NORMALGEM,
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:PIXIEPLATE,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :FAIRY
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :FAIRY
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:POISONBARB,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :POISON
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :POISON
|
||||
}
|
||||
)
|
||||
|
||||
@@ -715,7 +715,7 @@ BattleHandlers::DamageCalcUserItem.add(:ROCKGEM,
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:SHARPBEAK,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :FLYING
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :FLYING
|
||||
}
|
||||
)
|
||||
|
||||
@@ -723,13 +723,13 @@ BattleHandlers::DamageCalcUserItem.copy(:SHARPBEAK,:SKYPLATE)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:SILKSCARF,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :NORMAL
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :NORMAL
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:SILVERPOWDER,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :BUG
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :BUG
|
||||
}
|
||||
)
|
||||
|
||||
@@ -737,7 +737,7 @@ BattleHandlers::DamageCalcUserItem.copy(:SILVERPOWDER,:INSECTPLATE)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:SOFTSAND,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :GROUND
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :GROUND
|
||||
}
|
||||
)
|
||||
|
||||
@@ -747,10 +747,10 @@ BattleHandlers::DamageCalcUserItem.add(:SOULDEW,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
next if !user.isSpecies?(:LATIAS) && !user.isSpecies?(:LATIOS)
|
||||
if SOUL_DEW_POWERS_UP_TYPES
|
||||
mults[FINAL_DMG_MULT] *= 1.2 if type == :PSYCHIC || type == :DRAGON
|
||||
mults[:final_damage_multiplier] *= 1.2 if type == :PSYCHIC || type == :DRAGON
|
||||
else
|
||||
if move.specialMove? && !user.battle.rules["souldewclause"]
|
||||
mults[ATK_MULT] *= 1.5
|
||||
mults[:attack_multiplier] *= 1.5
|
||||
end
|
||||
end
|
||||
}
|
||||
@@ -758,7 +758,7 @@ BattleHandlers::DamageCalcUserItem.add(:SOULDEW,
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:SPELLTAG,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :GHOST
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :GHOST
|
||||
}
|
||||
)
|
||||
|
||||
@@ -773,14 +773,14 @@ BattleHandlers::DamageCalcUserItem.add(:STEELGEM,
|
||||
BattleHandlers::DamageCalcUserItem.add(:THICKCLUB,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
if (user.isSpecies?(:CUBONE) || user.isSpecies?(:MAROWAK)) && move.physicalMove?
|
||||
mults[ATK_MULT] *= 2
|
||||
mults[:attack_multiplier] *= 2
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:TWISTEDSPOON,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.2 if type == :PSYCHIC
|
||||
mults[:base_damage_multiplier] *= 1.2 if type == :PSYCHIC
|
||||
}
|
||||
)
|
||||
|
||||
@@ -794,7 +794,7 @@ BattleHandlers::DamageCalcUserItem.add(:WATERGEM,
|
||||
|
||||
BattleHandlers::DamageCalcUserItem.add(:WISEGLASSES,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[BASE_DMG_MULT] *= 1.1 if move.specialMove?
|
||||
mults[:base_damage_multiplier] *= 1.1 if move.specialMove?
|
||||
}
|
||||
)
|
||||
|
||||
@@ -807,7 +807,7 @@ BattleHandlers::DamageCalcUserItem.add(:WISEGLASSES,
|
||||
|
||||
BattleHandlers::DamageCalcTargetItem.add(:ASSAULTVEST,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
mults[DEF_MULT] *= 1.5 if move.specialMove?
|
||||
mults[:defense_multiplier] *= 1.5 if move.specialMove?
|
||||
}
|
||||
)
|
||||
|
||||
@@ -850,7 +850,7 @@ BattleHandlers::DamageCalcTargetItem.add(:COLBURBERRY,
|
||||
BattleHandlers::DamageCalcTargetItem.add(:DEEPSEASCALE,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
if target.isSpecies?(:CLAMPERL) && move.specialMove?
|
||||
mults[DEF_MULT] *= 2
|
||||
mults[:defense_multiplier] *= 2
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -863,7 +863,7 @@ BattleHandlers::DamageCalcTargetItem.add(:EVIOLITE,
|
||||
# affected by Eviolite.
|
||||
evos = target.pokemon.species_data.evolutions
|
||||
if evos.any? { |e| e[1] != PBEvolution::None && !e[3] } # Not a "None", not a prevolution
|
||||
mults[DEF_MULT] *= 1.5 if evos && evos.length > 0
|
||||
mults[:defense_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -889,7 +889,7 @@ BattleHandlers::DamageCalcTargetItem.add(:KEBIABERRY,
|
||||
BattleHandlers::DamageCalcTargetItem.add(:METALPOWDER,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
if target.isSpecies?(:DITTO) && !target.effects[PBEffects::Transform]
|
||||
mults[DEF_MULT] *= 1.5
|
||||
mults[:defense_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
@@ -935,7 +935,7 @@ BattleHandlers::DamageCalcTargetItem.add(:SOULDEW,
|
||||
next if SOUL_DEW_POWERS_UP_TYPES
|
||||
next if !target.isSpecies?(:LATIAS) && !target.isSpecies?(:LATIOS)
|
||||
if move.specialMove? && !user.battle.rules["souldewclause"]
|
||||
mults[DEF_MULT] *= 1.5
|
||||
mults[:defense_multiplier] *= 1.5
|
||||
end
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user