diff --git a/Data/Scripts/012_Battle/001_Battler/001_PokeBattle_Battler.rb b/Data/Scripts/012_Battle/001_Battler/001_PokeBattle_Battler.rb index 33f333d63..00bbbda2b 100644 --- a/Data/Scripts/012_Battle/001_Battler/001_PokeBattle_Battler.rb +++ b/Data/Scripts/012_Battle/001_Battler/001_PokeBattle_Battler.rb @@ -220,7 +220,7 @@ class PokeBattle_Battler stageDiv = [8,7,6,5,4,3, 2, 2,2,2,2,2,2] stage = @stages[PBStats::SPEED] + 6 speed = @speed*stageMul[stage]/stageDiv[stage] - speedMult = 0x1000 + speedMult = 1.0 # Ability effects that alter calculated Speed if abilityActive? speedMult = BattleHandlers.triggerSpeedCalcAbility(@ability,self,speedMult) @@ -242,7 +242,7 @@ class PokeBattle_Battler speedMult *= 1.1 end # Calculation - return [(speed.to_f*speedMult/0x1000).round,1].max + return [(speed*speedMult).round,1].max end def pbWeight diff --git a/Data/Scripts/012_Battle/001_Battler/007_Battler_UseMove.rb b/Data/Scripts/012_Battle/001_Battler/007_Battler_UseMove.rb index a7211b8e4..1ccabad81 100644 --- a/Data/Scripts/012_Battle/001_Battler/007_Battler_UseMove.rb +++ b/Data/Scripts/012_Battle/001_Battler/007_Battler_UseMove.rb @@ -323,7 +323,7 @@ class PokeBattle_Battler @battle.pbDisplay(_INTL("When the flame touched the powder on the Pokémon, it exploded!")) user.lastMoveFailed = true w = @battle.pbWeather - if w!=PBWeather.RAINDANCE && w!=PBWeather.HEAVYRAIN && user.takesIndirectDamage? + if w!=PBWeather::Rain && w!=PBWeather::HeavyRain && user.takesIndirectDamage? oldHP = user.hp user.pbReduceHP((user.totalhp/4.0).round,false) user.pbFaint if user.fainted? diff --git a/Data/Scripts/012_Battle/002_Move/003_Move_Usage_Calculations.rb b/Data/Scripts/012_Battle/002_Move/003_Move_Usage_Calculations.rb index 41bb7f38d..ba817641a 100644 --- a/Data/Scripts/012_Battle/002_Move/003_Move_Usage_Calculations.rb +++ b/Data/Scripts/012_Battle/002_Move/003_Move_Usage_Calculations.rb @@ -95,8 +95,8 @@ class PokeBattle_Move modifiers[BASE_ACC] = baseAcc modifiers[ACC_STAGE] = user.stages[PBStats::ACCURACY] modifiers[EVA_STAGE] = target.stages[PBStats::EVASION] - modifiers[ACC_MULT] = 0x1000 - modifiers[EVA_MULT] = 0x1000 + modifiers[ACC_MULT] = 1.0 + modifiers[EVA_MULT] = 1.0 pbCalcAccuracyModifiers(user,target,modifiers) # Check if move can't miss return true if modifiers[BASE_ACC]==0 @@ -107,8 +107,8 @@ class PokeBattle_Move 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] / 0x1000).round - evasion = (evasion * modifiers[EVA_MULT] / 0x1000).round + accuracy = (accuracy * modifiers[ACC_MULT]).round + evasion = (evasion * modifiers[EVA_MULT]).round evasion = 1 if evasion<1 # Calculation return @battle.pbRandom(100) < modifiers[BASE_ACC] * accuracy / evasion @@ -140,11 +140,11 @@ class PokeBattle_Move 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] = (modifiers[ACC_MULT]*5/3).round + modifiers[ACC_MULT] *= 5/3.0 end if user.effects[PBEffects::MicleBerry] user.effects[PBEffects::MicleBerry] = false - modifiers[ACC_MULT] = (modifiers[ACC_MULT]*1.2).round + modifiers[ACC_MULT] *= 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 @@ -244,14 +244,14 @@ class PokeBattle_Move defense = (defense.to_f*stageMul[defStage]/stageDiv[defStage]).floor end # Calculate all multiplier effects - multipliers = [0x1000,0x1000,0x1000,0x1000] + multipliers = [1.0, 1.0, 1.0, 1.0] pbCalcDamageMultipliers(user,target,numTargets,type,baseDmg,multipliers) # Main damage calculation - baseDmg = [(baseDmg * multipliers[BASE_DMG_MULT] / 0x1000).round,1].max - atk = [(atk * multipliers[ATK_MULT] / 0x1000).round,1].max - defense = [(defense * multipliers[DEF_MULT] / 0x1000).round,1].max - damage = (((2.0*user.level/5+2).floor*baseDmg*atk/defense).floor/50).floor+2 - damage = [(damage * multipliers[FINAL_DMG_MULT] / 0x1000).round,1].max + 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 + damage = (((2.0 * user.level / 5 + 2).floor * baseDmg * atk / defense).floor / 50).floor + 2 + damage = [(damage * multipliers[FINAL_DMG_MULT]).round, 1].max target.damageState.calcDamage = damage end @@ -306,10 +306,10 @@ class PokeBattle_Move end # Other if user.effects[PBEffects::MeFirst] - multipliers[BASE_DMG_MULT] = (multipliers[BASE_DMG_MULT]*1.5).round + multipliers[BASE_DMG_MULT] *= 1.5 end if user.effects[PBEffects::HelpingHand] && !self.is_a?(PokeBattle_Confusion) - multipliers[BASE_DMG_MULT] = (multipliers[BASE_DMG_MULT]*1.5).round + multipliers[BASE_DMG_MULT] *= 1.5 end if user.effects[PBEffects::Charge]>0 && isConst?(type,PBTypes,:ELECTRIC) multipliers[BASE_DMG_MULT] *= 2 @@ -341,15 +341,15 @@ class PokeBattle_Move case @battle.field.terrain when PBBattleTerrains::Electric if isConst?(type,PBTypes,:ELECTRIC) - multipliers[BASE_DMG_MULT] = (multipliers[BASE_DMG_MULT]*1.5).round + multipliers[BASE_DMG_MULT] *= 1.5 end when PBBattleTerrains::Grassy if isConst?(type,PBTypes,:GRASS) - multipliers[BASE_DMG_MULT] = (multipliers[BASE_DMG_MULT]*1.5).round + multipliers[BASE_DMG_MULT] *= 1.5 end when PBBattleTerrains::Psychic if isConst?(type,PBTypes,:PSYCHIC) - multipliers[BASE_DMG_MULT] = (multipliers[BASE_DMG_MULT]*1.5).round + multipliers[BASE_DMG_MULT] *= 1.5 end end end @@ -361,28 +361,28 @@ class PokeBattle_Move if @battle.internalBattle if user.pbOwnedByPlayer? if physicalMove? && @battle.pbPlayer.numbadges>=NUM_BADGES_BOOST_ATTACK - multipliers[ATK_MULT] = (multipliers[ATK_MULT]*1.1).round + multipliers[ATK_MULT] *= 1.1 elsif specialMove? && @battle.pbPlayer.numbadges>=NUM_BADGES_BOOST_SPATK - multipliers[ATK_MULT] = (multipliers[ATK_MULT]*1.1).round + multipliers[ATK_MULT] *= 1.1 end end if target.pbOwnedByPlayer? if physicalMove? && @battle.pbPlayer.numbadges>=NUM_BADGES_BOOST_DEFENSE - multipliers[DEF_MULT] = (multipliers[DEF_MULT]*1.1).round + multipliers[DEF_MULT] *= 1.1 elsif specialMove? && @battle.pbPlayer.numbadges>=NUM_BADGES_BOOST_SPDEF - multipliers[DEF_MULT] = (multipliers[DEF_MULT]*1.1).round + multipliers[DEF_MULT] *= 1.1 end end end # Multi-targeting attacks if numTargets>1 - multipliers[FINAL_DMG_MULT] = (multipliers[FINAL_DMG_MULT]*0.75).round + multipliers[FINAL_DMG_MULT] *= 0.75 end # Weather case @battle.pbWeather when PBWeather::Sun, PBWeather::HarshSun if isConst?(type,PBTypes,:FIRE) - multipliers[FINAL_DMG_MULT] = (multipliers[FINAL_DMG_MULT]*1.5).round + multipliers[FINAL_DMG_MULT] *= 1.5 elsif isConst?(type,PBTypes,:WATER) multipliers[FINAL_DMG_MULT] /= 2 end @@ -390,17 +390,17 @@ class PokeBattle_Move if isConst?(type,PBTypes,:FIRE) multipliers[FINAL_DMG_MULT] /= 2 elsif isConst?(type,PBTypes,:WATER) - multipliers[FINAL_DMG_MULT] = (multipliers[FINAL_DMG_MULT]*1.5).round + multipliers[FINAL_DMG_MULT] *= 1.5 end when PBWeather::Sandstorm if target.pbHasType?(:ROCK) && specialMove? && @function!="122" # Psyshock - multipliers[DEF_MULT] = (multipliers[DEF_MULT]*1.5).round + multipliers[DEF_MULT] *= 1.5 end end # Critical hits if target.damageState.critical if NEWEST_BATTLE_MECHANICS - multipliers[FINAL_DMG_MULT] = (multipliers[FINAL_DMG_MULT]*1.5).round + multipliers[FINAL_DMG_MULT] *= 1.5 else multipliers[FINAL_DMG_MULT] *= 2 end @@ -415,12 +415,11 @@ class PokeBattle_Move if user.hasActiveAbility?(:ADAPTABILITY) multipliers[FINAL_DMG_MULT] *= 2 else - multipliers[FINAL_DMG_MULT] = (multipliers[FINAL_DMG_MULT]*1.5).round + multipliers[FINAL_DMG_MULT] *= 1.5 end end # Type effectiveness multipliers[FINAL_DMG_MULT] *= target.damageState.typeMod.to_f/PBTypeEffectiveness::NORMAL_EFFECTIVE - multipliers[FINAL_DMG_MULT] = multipliers[FINAL_DMG_MULT].round # Burn if user.status==PBStatuses::BURN && physicalMove? && damageReducedByBurn? && !user.hasActiveAbility?(:GUTS) @@ -431,19 +430,19 @@ class PokeBattle_Move !user.hasActiveAbility?(:INFILTRATOR) if target.pbOwnSide.effects[PBEffects::AuroraVeil]>0 if @battle.pbSideBattlerCount(target)>1 - multipliers[FINAL_DMG_MULT] = (multipliers[FINAL_DMG_MULT]*2/3).round + multipliers[FINAL_DMG_MULT] *= 2/3.0 else multipliers[FINAL_DMG_MULT] /= 2 end elsif target.pbOwnSide.effects[PBEffects::Reflect]>0 && physicalMove? if @battle.pbSideBattlerCount(target)>1 - multipliers[FINAL_DMG_MULT] = (multipliers[FINAL_DMG_MULT]*2/3).round + multipliers[FINAL_DMG_MULT] *= 2/3.0 else multipliers[FINAL_DMG_MULT] /= 2 end elsif target.pbOwnSide.effects[PBEffects::LightScreen]>0 && specialMove? if @battle.pbSideBattlerCount(target)>1 - multipliers[FINAL_DMG_MULT] = (multipliers[FINAL_DMG_MULT]*2/3).round + multipliers[FINAL_DMG_MULT] *= 2/3.0 else multipliers[FINAL_DMG_MULT] /= 2 end diff --git a/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb b/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb index 562007bad..629551f20 100644 --- a/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb +++ b/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb @@ -2465,7 +2465,7 @@ end class PokeBattle_Move_073 < PokeBattle_FixedDamageMove def pbAddTarget(targets,user) return if user.lastFoeAttacker.length==0 - lastAttacker = user.lastFoeAttacker[user.lastFoeAttacker.last] + lastAttacker = user.lastFoeAttacker.last return if lastAttacker<0 || !user.opposes?(lastAttacker) user.pbAddTarget(targets,user,@battle.battlers[lastAttacker],self,false) end @@ -2546,7 +2546,7 @@ class PokeBattle_Move_076 < PokeBattle_Move def pbModifyDamage(damageMult,user,target) damageMult *= 2 if target.inTwoTurnAttack?("0CA") # Dig - damageMult = (damageMult/2.0).round if @battle.field.terrain==PBBattleTerrains::Grassy + damageMult /= 2 if @battle.field.terrain==PBBattleTerrains::Grassy return damageMult end end diff --git a/Data/Scripts/012_Battle/002_Move/006_Move_Effects_080-0FF.rb b/Data/Scripts/012_Battle/002_Move/006_Move_Effects_080-0FF.rb index 04af86e83..050a889de 100644 --- a/Data/Scripts/012_Battle/002_Move/006_Move_Effects_080-0FF.rb +++ b/Data/Scripts/012_Battle/002_Move/006_Move_Effects_080-0FF.rb @@ -422,7 +422,7 @@ class PokeBattle_Move_095 < PokeBattle_Move def pbModifyDamage(damageMult,user,target) damageMult *= 2 if target.inTwoTurnAttack?("0CA") # Dig - damageMult = (damageMult/2.0).round if @battle.field.terrain==PBBattleTerrains::Grassy + damageMult /= 2 if @battle.field.terrain==PBBattleTerrains::Grassy return damageMult end end @@ -2070,9 +2070,7 @@ class PokeBattle_Move_0C4 < PokeBattle_TwoTurnMove def pbBaseDamageMultiplier(damageMult,user,target) w = @battle.pbWeather - if w>0 && w!=PBWeather::Sun && w!=PBWeather::HarshSun - damageMult = (damageMult/2.0).round - end + damageMult /= 2 if w>0 && w!=PBWeather::Sun && w!=PBWeather::HarshSun return damageMult end end diff --git a/Data/Scripts/012_Battle/004_AI/006_AI_Move_Utilities.rb b/Data/Scripts/012_Battle/004_AI/006_AI_Move_Utilities.rb index da0ddc614..2bb76a15f 100644 --- a/Data/Scripts/012_Battle/004_AI/006_AI_Move_Utilities.rb +++ b/Data/Scripts/012_Battle/004_AI/006_AI_Move_Utilities.rb @@ -275,7 +275,7 @@ class PokeBattle_AI defense = pbRoughStat(target,PBStats::SPDEF,skill) end ##### Calculate all multiplier effects ##### - multipliers = [0x1000,0x1000,0x1000,0x1000] + multipliers = [1.0, 1.0, 1.0, 1.0] # Ability effects that alter damage moldBreaker = false if skill>=PBTrainerAI.highSkill && target.hasMoldBreaker? @@ -364,7 +364,7 @@ class PokeBattle_AI end # Parental Bond if skill>=PBTrainerAI.mediumSkill && user.hasActiveAbility?(:PARENTALBOND) - multipliers[BASE_DMG_MULT] = (multipliers[BASE_DMG_MULT]*1.25).floor + multipliers[BASE_DMG_MULT] *= 1.25 end # Me First # TODO @@ -403,15 +403,15 @@ class PokeBattle_AI case @battle.field.terrain when PBBattleTerrains::Electric if isConst?(type,PBTypes,:ELECTRIC) - multipliers[BASE_DMG_MULT] = (multipliers[BASE_DMG_MULT]*1.5).round + multipliers[BASE_DMG_MULT] *= 1.5 end when PBBattleTerrains::Grassy if isConst?(type,PBTypes,:GRASS) - multipliers[BASE_DMG_MULT] = (multipliers[BASE_DMG_MULT]*1.5).round + multipliers[BASE_DMG_MULT] *= 1.5 end when PBBattleTerrains::Psychic if isConst?(type,PBTypes,:PSYCHIC) - multipliers[BASE_DMG_MULT] = (multipliers[BASE_DMG_MULT]*1.5).round + multipliers[BASE_DMG_MULT] *= 1.5 end end end @@ -427,9 +427,9 @@ class PokeBattle_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] = (multipliers[DEF_MULT]*1.1).round + multipliers[DEF_MULT] *= 1.1 elsif move.specialMove?(type) && @battle.pbPlayer.numbadges>=NUM_BADGES_BOOST_SPDEF - multipliers[DEF_MULT] = (multipliers[DEF_MULT]*1.1).round + multipliers[DEF_MULT] *= 1.1 end end end @@ -437,7 +437,7 @@ class PokeBattle_AI # Multi-targeting attacks if skill>=PBTrainerAI.highSkill if pbTargetsMultiple?(move,user) - multipliers[FINAL_DMG_MULT] = (multipliers[FINAL_DMG_MULT]*0.75).round + multipliers[FINAL_DMG_MULT] *= 0.75 end end # Weather @@ -445,7 +445,7 @@ class PokeBattle_AI case @battle.pbWeather when PBWeather::Sun, PBWeather::HarshSun if isConst?(type,PBTypes,:FIRE) - multipliers[FINAL_DMG_MULT] = (multipliers[FINAL_DMG_MULT]*1.5).round + multipliers[FINAL_DMG_MULT] *= 1.5 elsif isConst?(type,PBTypes,:WATER) multipliers[FINAL_DMG_MULT] /= 2 end @@ -453,11 +453,11 @@ class PokeBattle_AI if isConst?(type,PBTypes,:FIRE) multipliers[FINAL_DMG_MULT] /= 2 elsif isConst?(type,PBTypes,:WATER) - multipliers[FINAL_DMG_MULT] = (multipliers[FINAL_DMG_MULT]*1.5).round + multipliers[FINAL_DMG_MULT] *= 1.5 end when PBWeather::Sandstorm if target.pbHasType?(:ROCK) && move.specialMove?(type) && move.function!="122" # Psyshock - multipliers[DEF_MULT] = (multipliers[DEF_MULT]*1.5).round + multipliers[DEF_MULT] *= 1.5 end end end @@ -469,7 +469,7 @@ class PokeBattle_AI if user.hasActiveAbility?(:ADAPTABILITY) multipliers[FINAL_DMG_MULT] *= 2 else - multipliers[FINAL_DMG_MULT] = (multipliers[FINAL_DMG_MULT]*1.5).round + multipliers[FINAL_DMG_MULT] *= 1.5 end end end @@ -477,7 +477,6 @@ class PokeBattle_AI if skill>=PBTrainerAI.mediumSkill typemod = pbCalcTypeMod(type,user,target) multipliers[FINAL_DMG_MULT] *= typemod.to_f/PBTypeEffectiveness::NORMAL_EFFECTIVE - multipliers[FINAL_DMG_MULT] = multipliers[FINAL_DMG_MULT].round end # Burn if skill>=PBTrainerAI.highSkill @@ -492,19 +491,19 @@ class PokeBattle_AI if !move.ignoresReflect? && !user.hasActiveAbility?(:INFILTRATOR) if target.pbOwnSide.effects[PBEffects::AuroraVeil]>0 if @battle.pbSideBattlerCount(target)>1 - multipliers[FINAL_DMG_MULT] = (multipliers[FINAL_DMG_MULT]*2/3).round + multipliers[FINAL_DMG_MULT] *= 2/3.0 else multipliers[FINAL_DMG_MULT] /= 2 end elsif target.pbOwnSide.effects[PBEffects::Reflect]>0 && move.physicalMove?(type) if @battle.pbSideBattlerCount(target)>1 - multipliers[FINAL_DMG_MULT] = (multipliers[FINAL_DMG_MULT]*2/3).round + multipliers[FINAL_DMG_MULT] *= 2/3.0 else multipliers[FINAL_DMG_MULT] /= 2 end elsif target.pbOwnSide.effects[PBEffects::LightScreen]>0 && move.specialMove?(type) if @battle.pbSideBattlerCount(target)>1 - multipliers[FINAL_DMG_MULT] = (multipliers[FINAL_DMG_MULT]*2/3).round + multipliers[FINAL_DMG_MULT] *= 2/3.0 else multipliers[FINAL_DMG_MULT] /= 2 end @@ -522,11 +521,11 @@ class PokeBattle_AI # Move-specific final damage modifiers # TODO ##### Main damage calculation ##### - baseDmg = [(baseDmg * multipliers[BASE_DMG_MULT] / 0x1000).round,1].max - atk = [(atk * multipliers[ATK_MULT] / 0x1000).round,1].max - defense = [(defense * multipliers[DEF_MULT] / 0x1000).round,1].max - damage = (((2.0*user.level/5+2).floor*baseDmg*atk/defense).floor/50).floor+2 - damage = [(damage * multipliers[FINAL_DMG_MULT] / 0x1000).round,1].max + 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 + damage = (((2.0 * user.level / 5 + 2).floor * baseDmg * atk / defense).floor / 50).floor + 2 + damage = [(damage * multipliers[FINAL_DMG_MULT]).round, 1].max # "AI-specific calculations below" # Increased critical hit rates if skill>=PBTrainerAI.mediumSkill @@ -585,8 +584,8 @@ class PokeBattle_AI modifiers[BASE_ACC] = baseAcc modifiers[ACC_STAGE] = user.stages[PBStats::ACCURACY] modifiers[EVA_STAGE] = target.stages[PBStats::EVASION] - modifiers[ACC_MULT] = 0x1000 - modifiers[EVA_MULT] = 0x1000 + modifiers[ACC_MULT] = 1.0 + modifiers[EVA_MULT] = 1.0 pbCalcAccuracyModifiers(user,target,modifiers,move,type,skill) # Check if move can't miss return 125 if modifiers[BASE_ACC]==0 @@ -597,8 +596,8 @@ class PokeBattle_AI 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] / 0x1000).round - evasion = (evasion * modifiers[EVA_MULT] / 0x1000).round + accuracy = (accuracy * modifiers[ACC_MULT]).round + evasion = (evasion * modifiers[EVA_MULT]).round evasion = 1 if evasion<1 return modifiers[BASE_ACC] * accuracy / evasion end @@ -642,10 +641,10 @@ class PokeBattle_AI # Other effects, inc. ones that set ACC_MULT or EVA_STAGE to specific values if skill>=PBTrainerAI.mediumSkill if @battle.field.effects[PBEffects::Gravity]>0 - modifiers[ACC_MULT] = (modifiers[ACC_MULT]*5/3).round + modifiers[ACC_MULT] *= 5/3.0 end if user.effects[PBEffects::MicleBerry] - modifiers[ACC_MULT] = (modifiers[ACC_MULT]*1.2).round + modifiers[ACC_MULT] *= 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 diff --git a/Data/Scripts/012_Battle/006_BattleHandlers.rb b/Data/Scripts/012_Battle/006_BattleHandlers.rb index e159defcd..b0080dba5 100644 --- a/Data/Scripts/012_Battle/006_BattleHandlers.rb +++ b/Data/Scripts/012_Battle/006_BattleHandlers.rb @@ -578,16 +578,16 @@ def pbBattleGem(user,type,move,mults,moveType) return if !isConst?(moveType,PBTypes,type) user.effects[PBEffects::GemConsumed] = user.item if NEWEST_BATTLE_MECHANICS - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.3).round + mults[BASE_DMG_MULT] *= 1.3 else - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.5).round + mults[BASE_DMG_MULT] *= 1.5 end end def pbBattleTypeWeakingBerry(type,moveType,target,mults) return if !isConst?(moveType,PBTypes,type) return if PBTypes.resistant?(target.damageState.typeMod) && !isConst?(moveType,PBTypes,:NORMAL) - mults[FINAL_DMG_MULT] = (mults[FINAL_DMG_MULT]/2).round + mults[FINAL_DMG_MULT] /= 2 target.damageState.berryWeakened = true target.battle.pbCommonAnimation("EatBerry",target) end diff --git a/Data/Scripts/012_Battle/007_BattleHandlers_Abilities.rb b/Data/Scripts/012_Battle/007_BattleHandlers_Abilities.rb index 031aab5f7..6f685224d 100644 --- a/Data/Scripts/012_Battle/007_BattleHandlers_Abilities.rb +++ b/Data/Scripts/012_Battle/007_BattleHandlers_Abilities.rb @@ -11,7 +11,7 @@ BattleHandlers::SpeedCalcAbility.add(:CHLOROPHYLL, BattleHandlers::SpeedCalcAbility.add(:QUICKFEET, proc { |ability,battler,mult| - next (mult*1.5).round if battler.pbHasAnyStatus? + next mult*1.5 if battler.pbHasAnyStatus? } ) @@ -767,13 +767,13 @@ BattleHandlers::MoveBaseTypeModifierAbility.add(:REFRIGERATE, BattleHandlers::AccuracyCalcUserAbility.add(:COMPOUNDEYES, proc { |ability,mods,user,target,move,type| - mods[ACC_MULT] = (mods[ACC_MULT]*1.3).round + mods[ACC_MULT] *= 1.3 } ) BattleHandlers::AccuracyCalcUserAbility.add(:HUSTLE, proc { |ability,mods,user,target,move,type| - mods[ACC_MULT] = (mods[ACC_MULT]*0.8).round if move.physicalMove? + mods[ACC_MULT] *= 0.8 if move.physicalMove? } ) @@ -797,7 +797,7 @@ BattleHandlers::AccuracyCalcUserAbility.add(:UNAWARE, BattleHandlers::AccuracyCalcUserAbility.add(:VICTORYSTAR, proc { |ability,mods,user,target,move,type| - mods[ACC_MULT] = (mods[ACC_MULT]*1.1).round + mods[ACC_MULT] *= 1.1 } ) @@ -807,7 +807,7 @@ BattleHandlers::AccuracyCalcUserAbility.add(:VICTORYSTAR, BattleHandlers::AccuracyCalcUserAllyAbility.add(:VICTORYSTAR, proc { |ability,mods,user,target,move,type| - mods[ACC_MULT] = (mods[ACC_MULT]*1.1).round + mods[ACC_MULT] *= 1.1 } ) @@ -830,7 +830,7 @@ BattleHandlers::AccuracyCalcTargetAbility.add(:NOGUARD, BattleHandlers::AccuracyCalcTargetAbility.add(:SANDVEIL, proc { |ability,mods,user,target,move,type| if target.battle.pbWeather==PBWeather::Sandstorm - mods[EVA_MULT] = (mods[EVA_MULT]*1.25).round + mods[EVA_MULT] *= 1.25 end } ) @@ -838,7 +838,7 @@ BattleHandlers::AccuracyCalcTargetAbility.add(:SANDVEIL, BattleHandlers::AccuracyCalcTargetAbility.add(:SNOWCLOAK, proc { |ability,mods,user,target,move,type| if target.battle.pbWeather==PBWeather::Hail - mods[EVA_MULT] = (mods[EVA_MULT]*1.25).round + mods[EVA_MULT] *= 1.25 end } ) @@ -875,7 +875,7 @@ BattleHandlers::AccuracyCalcTargetAbility.add(:WONDERSKIN, BattleHandlers::DamageCalcUserAbility.add(:AERILATE, proc { |ability,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if move.powerBoost + mults[BASE_DMG_MULT] *= 1.2 if move.powerBoost } ) @@ -886,7 +886,7 @@ 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] = (mults[BASE_DMG_MULT]*1.3).round + mults[BASE_DMG_MULT] *= 1.3 end } ) @@ -894,21 +894,21 @@ BattleHandlers::DamageCalcUserAbility.add(:ANALYTIC, BattleHandlers::DamageCalcUserAbility.add(:BLAZE, proc { |ability,user,target,move,mults,baseDmg,type| if user.hp<=user.totalhp/3 && isConst?(type,PBTypes,:FIRE) - mults[ATK_MULT] = (mults[ATK_MULT]*1.5).round + mults[ATK_MULT] *= 1.5 end } ) BattleHandlers::DamageCalcUserAbility.add(:DEFEATIST, proc { |ability,user,target,move,mults,baseDmg,type| - mults[ATK_MULT] = (mults[ATK_MULT]*0.5).round if user.hp<=user.totalhp/2 + mults[ATK_MULT] /= 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] = (mults[BASE_DMG_MULT]*1.5).round + mults[BASE_DMG_MULT] *= 1.5 end } ) @@ -916,7 +916,7 @@ BattleHandlers::DamageCalcUserAbility.add(:FLAREBOOST, BattleHandlers::DamageCalcUserAbility.add(:FLASHFIRE, proc { |ability,user,target,move,mults,baseDmg,type| if user.effects[PBEffects::FlashFire] && isConst?(type,PBTypes,:FIRE) - mults[ATK_MULT] = (mults[ATK_MULT]*1.5).round + mults[ATK_MULT] *= 1.5 end } ) @@ -925,7 +925,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] = (mults[ATK_MULT]*1.5).round + mults[ATK_MULT] *= 1.5 end } ) @@ -933,7 +933,7 @@ BattleHandlers::DamageCalcUserAbility.add(:FLOWERGIFT, BattleHandlers::DamageCalcUserAbility.add(:GUTS, proc { |ability,user,target,move,mults,baseDmg,type| if user.pbHasAnyStatus? && move.physicalMove? - mults[ATK_MULT] = (mults[ATK_MULT]*1.5).round + mults[ATK_MULT] *= 1.5 end } ) @@ -948,19 +948,19 @@ BattleHandlers::DamageCalcUserAbility.copy(:HUGEPOWER,:PUREPOWER) BattleHandlers::DamageCalcUserAbility.add(:HUSTLE, proc { |ability,user,target,move,mults,baseDmg,type| - mults[ATK_MULT] = (mults[ATK_MULT]*1.5).round if move.physicalMove? + mults[ATK_MULT] *= 1.5 if move.physicalMove? } ) BattleHandlers::DamageCalcUserAbility.add(:IRONFIST, proc { |ability,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if move.punchingMove? + mults[BASE_DMG_MULT] *= 1.2 if move.punchingMove? } ) BattleHandlers::DamageCalcUserAbility.add(:MEGALAUNCHER, proc { |ability,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.5).round if move.pulseMove? + mults[BASE_DMG_MULT] *= 1.5 if move.pulseMove? } ) @@ -969,7 +969,7 @@ BattleHandlers::DamageCalcUserAbility.add(:MINUS, next if !move.specialMove? user.eachAlly do |b| next if !b.hasActiveAbility?([:MINUS,:PLUS]) - mults[ATK_MULT] = (mults[ATK_MULT]*1.5).round + mults[ATK_MULT] *= 1.5 break end } @@ -980,7 +980,7 @@ BattleHandlers::DamageCalcUserAbility.copy(:MINUS,:PLUS) BattleHandlers::DamageCalcUserAbility.add(:NEUROFORCE, proc { |ability,user,target,move,mults,baseDmg,type| if PBTypes.superEffective?(target.damageState.typeMod) - mults[FINAL_DMG_MULT] = (mults[FINAL_DMG_MULT]*1.25).round + mults[FINAL_DMG_MULT] *= 1.25 end } ) @@ -988,14 +988,14 @@ BattleHandlers::DamageCalcUserAbility.add(:NEUROFORCE, BattleHandlers::DamageCalcUserAbility.add(:OVERGROW, proc { |ability,user,target,move,mults,baseDmg,type| if user.hp<=user.totalhp/3 && isConst?(type,PBTypes,:GRASS) - mults[ATK_MULT] = (mults[ATK_MULT]*1.5).round + mults[ATK_MULT] *= 1.5 end } ) BattleHandlers::DamageCalcUserAbility.add(:RECKLESS, proc { |ability,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if move.recoilMove? + mults[BASE_DMG_MULT] *= 1.2 if move.recoilMove? } ) @@ -1003,9 +1003,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] = (mults[BASE_DMG_MULT]*1.25).round + mults[BASE_DMG_MULT] *= 1.25 else - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*0.75).round + mults[BASE_DMG_MULT] *= 0.75 end end } @@ -1017,22 +1017,20 @@ BattleHandlers::DamageCalcUserAbility.add(:SANDFORCE, (isConst?(type,PBTypes,:ROCK) || isConst?(type,PBTypes,:GROUND) || isConst?(type,PBTypes,:STEEL)) - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.3).round + mults[BASE_DMG_MULT] *= 1.3 end } ) BattleHandlers::DamageCalcUserAbility.add(:SHEERFORCE, proc { |ability,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.3).round if move.addlEffect>0 + mults[BASE_DMG_MULT] *= 1.3 if move.addlEffect>0 } ) BattleHandlers::DamageCalcUserAbility.add(:SLOWSTART, proc { |ability,user,target,move,mults,baseDmg,type| - if user.turnCount<=5 && move.physicalMove? - mults[ATK_MULT] = (mults[ATK_MULT]*0.5).round - end + mults[ATK_MULT] /= 2 if user.turnCount<=5 && move.physicalMove? } ) @@ -1040,7 +1038,7 @@ 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] = (mults[ATK_MULT]*1.5).round + mults[ATK_MULT] *= 1.5 end } ) @@ -1048,7 +1046,7 @@ BattleHandlers::DamageCalcUserAbility.add(:SOLARPOWER, BattleHandlers::DamageCalcUserAbility.add(:SNIPER, proc { |ability,user,target,move,mults,baseDmg,type| if target.damageState.critical - mults[FINAL_DMG_MULT] = (mults[FINAL_DMG_MULT]*1.5).round + mults[FINAL_DMG_MULT] *= 1.5 end } ) @@ -1061,28 +1059,28 @@ BattleHandlers::DamageCalcUserAbility.add(:STAKEOUT, BattleHandlers::DamageCalcUserAbility.add(:STEELWORKER, proc { |ability,user,target,move,mults,baseDmg,type| - mults[ATK_MULT] = (mults[ATK_MULT]*1.5).round if isConst?(type,PBTypes,:STEEL) + mults[ATK_MULT] *= 1.5 if isConst?(type,PBTypes,:STEEL) } ) BattleHandlers::DamageCalcUserAbility.add(:STRONGJAW, proc { |ability,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.5).round if move.bitingMove? + mults[BASE_DMG_MULT] *= 1.5 if move.bitingMove? } ) BattleHandlers::DamageCalcUserAbility.add(:SWARM, proc { |ability,user,target,move,mults,baseDmg,type| if user.hp<=user.totalhp/3 && isConst?(type,PBTypes,:BUG) - mults[ATK_MULT] = (mults[ATK_MULT]*1.5).round + mults[ATK_MULT] *= 1.5 end } ) BattleHandlers::DamageCalcUserAbility.add(:TECHNICIAN, proc { |ability,user,target,move,mults,baseDmg,type| - if user.index!=target.index && move.id>0 && baseDmg*mults[BASE_DMG_MULT]/0x1000<=60 - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.5).round + if user.index!=target.index && move.id>0 && baseDmg*mults[BASE_DMG_MULT]<=60 + mults[BASE_DMG_MULT] *= 1.5 end } ) @@ -1096,21 +1094,21 @@ BattleHandlers::DamageCalcUserAbility.add(:TINTEDLENS, BattleHandlers::DamageCalcUserAbility.add(:TORRENT, proc { |ability,user,target,move,mults,baseDmg,type| if user.hp<=user.totalhp/3 && isConst?(type,PBTypes,:WATER) - mults[ATK_MULT] = (mults[ATK_MULT]*1.5).round + mults[ATK_MULT] *= 1.5 end } ) BattleHandlers::DamageCalcUserAbility.add(:TOUGHCLAWS, proc { |ability,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*4/3.0).round if move.contactMove? + mults[BASE_DMG_MULT] *= 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] = (mults[BASE_DMG_MULT]*1.5).round + mults[BASE_DMG_MULT] *= 1.5 end } ) @@ -1128,7 +1126,7 @@ BattleHandlers::DamageCalcUserAbility.add(:WATERBUBBLE, BattleHandlers::DamageCalcUserAllyAbility.add(:BATTERY, proc { |ability,user,target,move,mults,baseDmg,type| next if !move.specialMove? - mults[FINAL_DMG_MULT] = (mults[FINAL_DMG_MULT]*1.3).round + mults[FINAL_DMG_MULT] *= 1.3 } ) @@ -1136,7 +1134,7 @@ 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] = (mults[ATK_MULT]*1.5).round + mults[ATK_MULT] *= 1.5 end } ) @@ -1148,7 +1146,7 @@ BattleHandlers::DamageCalcUserAllyAbility.add(:FLOWERGIFT, BattleHandlers::DamageCalcTargetAbility.add(:DRYSKIN, proc { |ability,user,target,move,mults,baseDmg,type| if isConst?(type,PBTypes,:FIRE) - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.25).round + mults[BASE_DMG_MULT] *= 1.25 end } ) @@ -1156,7 +1154,7 @@ BattleHandlers::DamageCalcTargetAbility.add(:DRYSKIN, BattleHandlers::DamageCalcTargetAbility.add(:FILTER, proc { |ability,user,target,move,mults,baseDmg,type| if PBTypes.superEffective?(target.damageState.typeMod) - mults[FINAL_DMG_MULT] = (mults[FINAL_DMG_MULT]*0.75).round + mults[FINAL_DMG_MULT] *= 0.75 end } ) @@ -1167,7 +1165,7 @@ 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] = (mults[DEF_MULT]*1.5).round + mults[DEF_MULT] *= 1.5 end } ) @@ -1175,7 +1173,7 @@ BattleHandlers::DamageCalcTargetAbility.add(:FLOWERGIFT, BattleHandlers::DamageCalcTargetAbility.add(:FLUFFY, proc { |ability,user,target,move,mults,baseDmg,type| mults[FINAL_DMG_MULT] *= 2 if isConst?(move.calcType,PBTypes,:FIRE) - mults[FINAL_DMG_MULT] = (mults[FINAL_DMG_MULT]*0.5).round if move.contactMove? + mults[FINAL_DMG_MULT] /= 2 if move.contactMove? } ) @@ -1188,21 +1186,21 @@ BattleHandlers::DamageCalcTargetAbility.add(:FURCOAT, BattleHandlers::DamageCalcTargetAbility.add(:GRASSPELT, proc { |ability,user,target,move,mults,baseDmg,type| if user.battle.field.terrain==PBBattleTerrains::Grassy - mults[DEF_MULT] = (mults[DEF_MULT]*1.5).round + mults[DEF_MULT] *= 1.5 end } ) BattleHandlers::DamageCalcTargetAbility.add(:HEATPROOF, proc { |ability,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*0.5).round if isConst?(type,PBTypes,:FIRE) + mults[BASE_DMG_MULT] /= 2 if isConst?(type,PBTypes,:FIRE) } ) BattleHandlers::DamageCalcTargetAbility.add(:MARVELSCALE, proc { |ability,user,target,move,mults,baseDmg,type| if target.pbHasAnyStatus? && move.physicalMove? - mults[DEF_MULT] = (mults[DEF_MULT]*1.5).round + mults[DEF_MULT] *= 1.5 end } ) @@ -1210,7 +1208,7 @@ BattleHandlers::DamageCalcTargetAbility.add(:MARVELSCALE, BattleHandlers::DamageCalcTargetAbility.add(:MULTISCALE, proc { |ability,user,target,move,mults,baseDmg,type| if target.hp==target.totalhp - mults[FINAL_DMG_MULT] = (mults[FINAL_DMG_MULT]*0.5).round + mults[FINAL_DMG_MULT] /= 2 end } ) @@ -1218,7 +1216,7 @@ BattleHandlers::DamageCalcTargetAbility.add(:MULTISCALE, BattleHandlers::DamageCalcTargetAbility.add(:THICKFAT, proc { |ability,user,target,move,mults,baseDmg,type| if isConst?(type,PBTypes,:FIRE) || isConst?(type,PBTypes,:ICE) - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*0.5).round + mults[BASE_DMG_MULT] /= 2 end } ) @@ -1226,7 +1224,7 @@ BattleHandlers::DamageCalcTargetAbility.add(:THICKFAT, BattleHandlers::DamageCalcTargetAbility.add(:WATERBUBBLE, proc { |ability,user,target,move,mults,baseDmg,type| if isConst?(type,PBTypes,:FIRE) - mults[FINAL_DMG_MULT] = (mults[FINAL_DMG_MULT]*0.5).round + mults[FINAL_DMG_MULT] /= 2 end } ) @@ -1238,7 +1236,7 @@ BattleHandlers::DamageCalcTargetAbility.add(:WATERBUBBLE, BattleHandlers::DamageCalcTargetAbilityNonIgnorable.add(:PRISMARMOR, proc { |ability,user,target,move,mults,baseDmg,type| if PBTypes.superEffective?(target.damageState.typeMod) - mults[FINAL_DMG_MULT] = (mults[FINAL_DMG_MULT]*0.75).round + mults[FINAL_DMG_MULT] *= 0.75 end } ) @@ -1246,7 +1244,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] = (mults[FINAL_DMG_MULT]*0.5).round + mults[FINAL_DMG_MULT] /= 2 end } ) @@ -1259,14 +1257,14 @@ 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] = (mults[DEF_MULT]*1.5).round + mults[DEF_MULT] *= 1.5 end } ) BattleHandlers::DamageCalcTargetAllyAbility.add(:FRIENDGUARD, proc { |ability,user,target,move,mults,baseDmg,type| - mults[FINAL_DMG_MULT] = (mults[FINAL_DMG_MULT]*0.75).round + mults[FINAL_DMG_MULT] *= 0.75 } ) diff --git a/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb b/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb index edd3ff257..541d16c79 100644 --- a/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb +++ b/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb @@ -4,7 +4,7 @@ BattleHandlers::SpeedCalcItem.add(:CHOICESCARF, proc { |item,battler,mult| - next (mult*1.5).round + next mult*1.5 } ) @@ -414,7 +414,7 @@ BattleHandlers::PriorityBracketUseItem.add(:QUICKCLAW, BattleHandlers::AccuracyCalcUserItem.add(:WIDELENS, proc { |item,mods,user,target,move,type| - mods[ACC_MULT] = (mods[ACC_MULT]*1.1).round + mods[ACC_MULT] *= 1.1 } ) @@ -423,7 +423,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] = (mods[ACC_MULT]*1.2).round + mods[ACC_MULT] *= 1.2 end } ) @@ -434,7 +434,7 @@ BattleHandlers::AccuracyCalcUserItem.add(:ZOOMLENS, BattleHandlers::AccuracyCalcTargetItem.add(:BRIGHTPOWDER, proc { |item,mods,user,target,move,type| - mods[ACC_MULT] = (mods[ACC_MULT]*0.9).round + mods[ACC_MULT] *= 0.9 } ) @@ -448,14 +448,14 @@ BattleHandlers::DamageCalcUserItem.add(:ADAMANTORB, proc { |item,user,target,move,mults,baseDmg,type| if user.isSpecies?(:DIALGA) && (isConst?(type,PBTypes,:DRAGON) || isConst?(type,PBTypes,:STEEL)) - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round + mults[BASE_DMG_MULT] *= 1.2 end } ) BattleHandlers::DamageCalcUserItem.add(:BLACKBELT, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:FIGHTING) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:FIGHTING) } ) @@ -463,7 +463,7 @@ BattleHandlers::DamageCalcUserItem.copy(:BLACKBELT,:FISTPLATE) BattleHandlers::DamageCalcUserItem.add(:BLACKGLASSES, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:DARK) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:DARK) } ) @@ -477,7 +477,7 @@ BattleHandlers::DamageCalcUserItem.add(:BUGGEM, BattleHandlers::DamageCalcUserItem.add(:CHARCOAL, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:FIRE) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:FIRE) } ) @@ -485,13 +485,13 @@ BattleHandlers::DamageCalcUserItem.copy(:CHARCOAL,:FLAMEPLATE) BattleHandlers::DamageCalcUserItem.add(:CHOICEBAND, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.5).round if move.physicalMove? + mults[BASE_DMG_MULT] *= 1.5 if move.physicalMove? } ) BattleHandlers::DamageCalcUserItem.add(:CHOICESPECS, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.5).round if move.specialMove? + mults[BASE_DMG_MULT] *= 1.5 if move.specialMove? } ) @@ -511,7 +511,7 @@ BattleHandlers::DamageCalcUserItem.add(:DEEPSEATOOTH, BattleHandlers::DamageCalcUserItem.add(:DRAGONFANG, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:DRAGON) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:DRAGON) } ) @@ -532,7 +532,7 @@ BattleHandlers::DamageCalcUserItem.add(:ELECTRICGEM, BattleHandlers::DamageCalcUserItem.add(:EXPERTBELT, proc { |item,user,target,move,mults,baseDmg,type| if PBTypes.superEffective?(target.damageState.typeMod) - mults[FINAL_DMG_MULT] = (mults[FINAL_DMG_MULT]*1.2).round + mults[FINAL_DMG_MULT] *= 1.2 end } ) @@ -577,7 +577,7 @@ BattleHandlers::DamageCalcUserItem.add(:GRISEOUSORB, proc { |item,user,target,move,mults,baseDmg,type| if user.isSpecies?(:GIRATINA) && (isConst?(type,PBTypes,:DRAGON) || isConst?(type,PBTypes,:GHOST)) - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round + mults[BASE_DMG_MULT] *= 1.2 end } ) @@ -590,7 +590,7 @@ BattleHandlers::DamageCalcUserItem.add(:GROUNDGEM, BattleHandlers::DamageCalcUserItem.add(:HARDSTONE, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:ROCK) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:ROCK) } ) @@ -605,7 +605,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] = (mults[FINAL_DMG_MULT]*1.3).round + mults[FINAL_DMG_MULT] *= 1.3 end } ) @@ -622,14 +622,14 @@ BattleHandlers::DamageCalcUserItem.add(:LUSTROUSORB, proc { |item,user,target,move,mults,baseDmg,type| if user.isSpecies?(:PALKIA) && (isConst?(type,PBTypes,:DRAGON) || isConst?(type,PBTypes,:WATER)) - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round + mults[BASE_DMG_MULT] *= 1.2 end } ) BattleHandlers::DamageCalcUserItem.add(:MAGNET, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:ELECTRIC) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:ELECTRIC) } ) @@ -637,7 +637,7 @@ BattleHandlers::DamageCalcUserItem.copy(:MAGNET,:ZAPPLATE) BattleHandlers::DamageCalcUserItem.add(:METALCOAT, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:STEEL) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:STEEL) } ) @@ -646,13 +646,13 @@ 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] = (mults[FINAL_DMG_MULT]*met).round + mults[FINAL_DMG_MULT] *= met } ) BattleHandlers::DamageCalcUserItem.add(:MIRACLESEED, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:GRASS) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:GRASS) } ) @@ -660,13 +660,13 @@ BattleHandlers::DamageCalcUserItem.copy(:MIRACLESEED,:MEADOWPLATE,:ROSEINCENSE) BattleHandlers::DamageCalcUserItem.add(:MUSCLEBAND, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.1).round if move.physicalMove? + mults[BASE_DMG_MULT] *= 1.1 if move.physicalMove? } ) BattleHandlers::DamageCalcUserItem.add(:MYSTICWATER, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:WATER) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:WATER) } ) @@ -674,7 +674,7 @@ BattleHandlers::DamageCalcUserItem.copy(:MYSTICWATER,:SPLASHPLATE,:SEAINCENSE,:W BattleHandlers::DamageCalcUserItem.add(:NEVERMELTICE, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:ICE) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:ICE) } ) @@ -688,13 +688,13 @@ BattleHandlers::DamageCalcUserItem.add(:NORMALGEM, BattleHandlers::DamageCalcUserItem.add(:PIXIEPLATE, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:FAIRY) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:FAIRY) } ) BattleHandlers::DamageCalcUserItem.add(:POISONBARB, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:POISON) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:POISON) } ) @@ -720,7 +720,7 @@ BattleHandlers::DamageCalcUserItem.add(:ROCKGEM, BattleHandlers::DamageCalcUserItem.add(:SHARPBEAK, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:FLYING) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:FLYING) } ) @@ -728,13 +728,13 @@ BattleHandlers::DamageCalcUserItem.copy(:SHARPBEAK,:SKYPLATE) BattleHandlers::DamageCalcUserItem.add(:SILKSCARF, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:NORMAL) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:NORMAL) } ) BattleHandlers::DamageCalcUserItem.add(:SILVERPOWDER, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:BUG) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:BUG) } ) @@ -742,7 +742,7 @@ BattleHandlers::DamageCalcUserItem.copy(:SILVERPOWDER,:INSECTPLATE) BattleHandlers::DamageCalcUserItem.add(:SOFTSAND, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:GROUND) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:GROUND) } ) @@ -753,11 +753,11 @@ BattleHandlers::DamageCalcUserItem.add(:SOULDEW, next if !user.isSpecies?(:LATIAS) && !user.isSpecies?(:LATIOS) if NEWEST_BATTLE_MECHANICS if isConst?(type,PBTypes,:PSYCHIC) || isConst?(type,PBTypes,:DRAGON) - mults[FINAL_DMG_MULT] = (mults[FINAL_DMG_MULT]*1.2).round + mults[FINAL_DMG_MULT] *= 1.2 end else if move.specialMove? && !user.battle.rules["souldewclause"] - mults[ATK_MULT] = (mults[ATK_MULT]*1.5).round + mults[ATK_MULT] *= 1.5 end end } @@ -765,7 +765,7 @@ BattleHandlers::DamageCalcUserItem.add(:SOULDEW, BattleHandlers::DamageCalcUserItem.add(:SPELLTAG, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:GHOST) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:GHOST) } ) @@ -787,7 +787,7 @@ BattleHandlers::DamageCalcUserItem.add(:THICKCLUB, BattleHandlers::DamageCalcUserItem.add(:TWISTEDSPOON, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.2).round if isConst?(type,PBTypes,:PSYCHIC) + mults[BASE_DMG_MULT] *= 1.2 if isConst?(type,PBTypes,:PSYCHIC) } ) @@ -801,7 +801,7 @@ BattleHandlers::DamageCalcUserItem.add(:WATERGEM, BattleHandlers::DamageCalcUserItem.add(:WISEGLASSES, proc { |item,user,target,move,mults,baseDmg,type| - mults[BASE_DMG_MULT] = (mults[BASE_DMG_MULT]*1.1).round if move.specialMove? + mults[BASE_DMG_MULT] *= 1.1 if move.specialMove? } ) @@ -814,7 +814,7 @@ BattleHandlers::DamageCalcUserItem.add(:WISEGLASSES, BattleHandlers::DamageCalcTargetItem.add(:ASSAULTVEST, proc { |item,user,target,move,mults,baseDmg,type| - mults[DEF_MULT] = (mults[DEF_MULT]*1.5).round if move.specialMove? + mults[DEF_MULT] *= 1.5 if move.specialMove? } ) @@ -869,7 +869,7 @@ BattleHandlers::DamageCalcTargetItem.add(:EVIOLITE, # evolve even if the species generally can, and such forms are not # affected by Eviolite. evos = pbGetEvolvedFormData(target.pokemon.fSpecies,true) - mults[DEF_MULT] = (mults[DEF_MULT]*1.5).round if evos && evos.length>0 + mults[DEF_MULT] *= 1.5 if evos && evos.length>0 } ) @@ -894,7 +894,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] = (mults[DEF_MULT]*1.5).round + mults[DEF_MULT] *= 1.5 end } ) @@ -940,7 +940,7 @@ BattleHandlers::DamageCalcTargetItem.add(:SOULDEW, next if NEWEST_BATTLE_MECHANICS next if !target.isSpecies?(:LATIAS) && !target.isSpecies?(:LATIOS) if move.specialMove? && !user.battle.rules["souldewclause"] - mults[DEF_MULT] = (mults[DEF_MULT]*1.5).round + mults[DEF_MULT] *= 1.5 end } )