Unified formula for critical skill damage.

This commit is contained in:
MobiusDev 2018-05-01 15:37:20 +00:00
parent d2ed161dda
commit e5b93371db
18 changed files with 30 additions and 30 deletions

View File

@ -130,7 +130,7 @@ public final class EnergyAttack extends AbstractEffect
// Skill specific mods.
final double energyChargesBoost = 1 + (charge * 0.1); // 10% bonus damage for each charge used.
final double critMod = critical ? (2 * Formulas.calcCritDamage(attacker, effected, skill)) : 1;
final double critMod = critical ? Formulas.calcCritDamage(attacker, effected, skill) : 1;
double ssmod = 1;
if (skill.useSoulShot())
{

View File

@ -110,7 +110,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
// Skill specific mods.
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
final double critMod = critical ? (2 * Formulas.calcCritDamage(effector, effected, skill)) : 1;
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
double ssmod = 1;
if (skill.useSoulShot())
{

View File

@ -134,7 +134,7 @@ public final class Formulas
{
// Bonus Spirit shot
final double shotsBonus = bss ? (4 * attacker.getStat().getValue(Stats.SHOTS_BONUS)) : sps ? (2 * attacker.getStat().getValue(Stats.SHOTS_BONUS)) : 1;
final double critMod = mcrit ? (2 * calcCritDamage(attacker, target, skill)) : 1; // TODO not really a proper way... find how it works then implement. // damage += attacker.getStat().getValue(Stats.MAGIC_CRIT_DMG_ADD, 0);
final double critMod = mcrit ? calcCritDamage(attacker, target, skill) : 1; // TODO not really a proper way... find how it works then implement. // damage += attacker.getStat().getValue(Stats.MAGIC_CRIT_DMG_ADD, 0);
// Trait, elements
final double generalTraitMod = calcGeneralTraitBonus(attacker, target, skill.getTraitType(), true);
@ -328,7 +328,7 @@ public final class Formulas
defenceCriticalDamage = target.getStat().getValue(Stats.DEFENCE_CRITICAL_DAMAGE, 1);
}
return criticalDamage * defenceCriticalDamage;
return 2 * criticalDamage * defenceCriticalDamage;
}
/**
@ -1335,7 +1335,7 @@ public final class Formulas
final boolean isRanged = (weapon != null) && weapon.getItemType().isRanged();
final double shotsBonus = attacker.getStat().getValue(Stats.SHOTS_BONUS);
final double cAtk = crit ? (2 * calcCritDamage(attacker, target, null)) : 1;
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1;

View File

@ -130,7 +130,7 @@ public final class EnergyAttack extends AbstractEffect
// Skill specific mods.
final double energyChargesBoost = 1 + (charge * 0.1); // 10% bonus damage for each charge used.
final double critMod = critical ? (2 * Formulas.calcCritDamage(attacker, effected, skill)) : 1;
final double critMod = critical ? Formulas.calcCritDamage(attacker, effected, skill) : 1;
double ssmod = 1;
if (skill.useSoulShot())
{

View File

@ -110,7 +110,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
// Skill specific mods.
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
final double critMod = critical ? (2 * Formulas.calcCritDamage(effector, effected, skill)) : 1;
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
double ssmod = 1;
if (skill.useSoulShot())
{

View File

@ -134,7 +134,7 @@ public final class Formulas
{
// Bonus Spirit shot
final double shotsBonus = bss ? (4 * attacker.getStat().getValue(Stats.SHOTS_BONUS)) : sps ? (2 * attacker.getStat().getValue(Stats.SHOTS_BONUS)) : 1;
final double critMod = mcrit ? (2 * calcCritDamage(attacker, target, skill)) : 1; // TODO not really a proper way... find how it works then implement. // damage += attacker.getStat().getValue(Stats.MAGIC_CRIT_DMG_ADD, 0);
final double critMod = mcrit ? calcCritDamage(attacker, target, skill) : 1; // TODO not really a proper way... find how it works then implement. // damage += attacker.getStat().getValue(Stats.MAGIC_CRIT_DMG_ADD, 0);
// Trait, elements
final double generalTraitMod = calcGeneralTraitBonus(attacker, target, skill.getTraitType(), true);
@ -328,7 +328,7 @@ public final class Formulas
defenceCriticalDamage = target.getStat().getValue(Stats.DEFENCE_CRITICAL_DAMAGE, 1);
}
return criticalDamage * defenceCriticalDamage;
return 2 * criticalDamage * defenceCriticalDamage;
}
/**
@ -1335,7 +1335,7 @@ public final class Formulas
final boolean isRanged = (weapon != null) && weapon.getItemType().isRanged();
final double shotsBonus = attacker.getStat().getValue(Stats.SHOTS_BONUS);
final double cAtk = crit ? (2 * calcCritDamage(attacker, target, null)) : 1;
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1;

View File

@ -130,7 +130,7 @@ public final class EnergyAttack extends AbstractEffect
// Skill specific mods.
final double energyChargesBoost = 1 + (charge * 0.1); // 10% bonus damage for each charge used.
final double critMod = critical ? (2 * Formulas.calcCritDamage(attacker, effected, skill)) : 1;
final double critMod = critical ? Formulas.calcCritDamage(attacker, effected, skill) : 1;
double ssmod = 1;
if (skill.useSoulShot())
{

View File

@ -110,7 +110,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
// Skill specific mods.
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
final double critMod = critical ? (2 * Formulas.calcCritDamage(effector, effected, skill)) : 1;
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
double ssmod = 1;
if (skill.useSoulShot())
{

View File

@ -134,7 +134,7 @@ public final class Formulas
{
// Bonus Spirit shot
final double shotsBonus = bss ? (4 * attacker.getStat().getValue(Stats.SHOTS_BONUS)) : sps ? (2 * attacker.getStat().getValue(Stats.SHOTS_BONUS)) : 1;
final double critMod = mcrit ? (2 * calcCritDamage(attacker, target, skill)) : 1; // TODO not really a proper way... find how it works then implement. // damage += attacker.getStat().getValue(Stats.MAGIC_CRIT_DMG_ADD, 0);
final double critMod = mcrit ? calcCritDamage(attacker, target, skill) : 1; // TODO not really a proper way... find how it works then implement. // damage += attacker.getStat().getValue(Stats.MAGIC_CRIT_DMG_ADD, 0);
// Trait, elements
final double generalTraitMod = calcGeneralTraitBonus(attacker, target, skill.getTraitType(), true);
@ -328,7 +328,7 @@ public final class Formulas
defenceCriticalDamage = target.getStat().getValue(Stats.DEFENCE_CRITICAL_DAMAGE, 1);
}
return criticalDamage * defenceCriticalDamage;
return 2 * criticalDamage * defenceCriticalDamage;
}
/**
@ -1335,7 +1335,7 @@ public final class Formulas
final boolean isRanged = (weapon != null) && weapon.getItemType().isRanged();
final double shotsBonus = attacker.getStat().getValue(Stats.SHOTS_BONUS);
final double cAtk = crit ? (2 * calcCritDamage(attacker, target, null)) : 1;
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1;

View File

@ -130,7 +130,7 @@ public final class EnergyAttack extends AbstractEffect
// Skill specific mods.
final double energyChargesBoost = 1 + (charge * 0.1); // 10% bonus damage for each charge used.
final double critMod = critical ? (2 * Formulas.calcCritDamage(attacker, effected, skill)) : 1;
final double critMod = critical ? Formulas.calcCritDamage(attacker, effected, skill) : 1;
double ssmod = 1;
if (skill.useSoulShot())
{

View File

@ -110,7 +110,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
// Skill specific mods.
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
final double critMod = critical ? (2 * Formulas.calcCritDamage(effector, effected, skill)) : 1;
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
double ssmod = 1;
if (skill.useSoulShot())
{

View File

@ -134,7 +134,7 @@ public final class Formulas
{
// Bonus Spirit shot
final double shotsBonus = bss ? (4 * attacker.getStat().getValue(Stats.SHOTS_BONUS)) : sps ? (2 * attacker.getStat().getValue(Stats.SHOTS_BONUS)) : 1;
final double critMod = mcrit ? (2 * calcCritDamage(attacker, target, skill)) : 1; // TODO not really a proper way... find how it works then implement. // damage += attacker.getStat().getValue(Stats.MAGIC_CRIT_DMG_ADD, 0);
final double critMod = mcrit ? calcCritDamage(attacker, target, skill) : 1; // TODO not really a proper way... find how it works then implement. // damage += attacker.getStat().getValue(Stats.MAGIC_CRIT_DMG_ADD, 0);
// Trait, elements
final double generalTraitMod = calcGeneralTraitBonus(attacker, target, skill.getTraitType(), true);
@ -328,7 +328,7 @@ public final class Formulas
defenceCriticalDamage = target.getStat().getValue(Stats.DEFENCE_CRITICAL_DAMAGE, 1);
}
return criticalDamage * defenceCriticalDamage;
return 2 * criticalDamage * defenceCriticalDamage;
}
/**
@ -1335,7 +1335,7 @@ public final class Formulas
final boolean isRanged = (weapon != null) && weapon.getItemType().isRanged();
final double shotsBonus = attacker.getStat().getValue(Stats.SHOTS_BONUS);
final double cAtk = crit ? (2 * calcCritDamage(attacker, target, null)) : 1;
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1;

View File

@ -130,7 +130,7 @@ public final class EnergyAttack extends AbstractEffect
// Skill specific mods.
final double energyChargesBoost = 1 + (charge * 0.1); // 10% bonus damage for each charge used.
final double critMod = critical ? (2 * Formulas.calcCritDamage(attacker, effected, skill)) : 1;
final double critMod = critical ? Formulas.calcCritDamage(attacker, effected, skill) : 1;
double ssmod = 1;
if (skill.useSoulShot())
{

View File

@ -110,7 +110,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
// Skill specific mods.
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
final double critMod = critical ? (2 * Formulas.calcCritDamage(effector, effected, skill)) : 1;
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
double ssmod = 1;
if (skill.useSoulShot())
{

View File

@ -134,7 +134,7 @@ public final class Formulas
{
// Bonus Spirit shot
final double shotsBonus = bss ? (4 * attacker.getStat().getValue(Stats.SHOTS_BONUS)) : sps ? (2 * attacker.getStat().getValue(Stats.SHOTS_BONUS)) : 1;
final double critMod = mcrit ? (2 * calcCritDamage(attacker, target, skill)) : 1; // TODO not really a proper way... find how it works then implement. // damage += attacker.getStat().getValue(Stats.MAGIC_CRIT_DMG_ADD, 0);
final double critMod = mcrit ? calcCritDamage(attacker, target, skill) : 1; // TODO not really a proper way... find how it works then implement. // damage += attacker.getStat().getValue(Stats.MAGIC_CRIT_DMG_ADD, 0);
// Trait, elements
final double generalTraitMod = calcGeneralTraitBonus(attacker, target, skill.getTraitType(), true);
@ -328,7 +328,7 @@ public final class Formulas
defenceCriticalDamage = target.getStat().getValue(Stats.DEFENCE_CRITICAL_DAMAGE, 1);
}
return criticalDamage * defenceCriticalDamage;
return 2 * criticalDamage * defenceCriticalDamage;
}
/**
@ -1335,7 +1335,7 @@ public final class Formulas
final boolean isRanged = (weapon != null) && weapon.getItemType().isRanged();
final double shotsBonus = attacker.getStat().getValue(Stats.SHOTS_BONUS);
final double cAtk = crit ? (2 * calcCritDamage(attacker, target, null)) : 1;
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1;

View File

@ -130,7 +130,7 @@ public final class EnergyAttack extends AbstractEffect
// Skill specific mods.
final double energyChargesBoost = 1 + (charge * 0.1); // 10% bonus damage for each charge used.
final double critMod = critical ? (2 * Formulas.calcCritDamage(attacker, effected, skill)) : 1;
final double critMod = critical ? Formulas.calcCritDamage(attacker, effected, skill) : 1;
double ssmod = 1;
if (skill.useSoulShot())
{

View File

@ -110,7 +110,7 @@ public final class PhysicalAttackHpLink extends AbstractEffect
// Skill specific mods.
final double wpnMod = effector.getAttackType().isRanged() ? 70 : 77;
final double rangedBonus = effector.getAttackType().isRanged() ? (attack + _power) : 0;
final double critMod = critical ? (2 * Formulas.calcCritDamage(effector, effected, skill)) : 1;
final double critMod = critical ? Formulas.calcCritDamage(effector, effected, skill) : 1;
double ssmod = 1;
if (skill.useSoulShot())
{

View File

@ -134,7 +134,7 @@ public final class Formulas
{
// Bonus Spirit shot
final double shotsBonus = bss ? (4 * attacker.getStat().getValue(Stats.SHOTS_BONUS)) : sps ? (2 * attacker.getStat().getValue(Stats.SHOTS_BONUS)) : 1;
final double critMod = mcrit ? (2 * calcCritDamage(attacker, target, skill)) : 1; // TODO not really a proper way... find how it works then implement. // damage += attacker.getStat().getValue(Stats.MAGIC_CRIT_DMG_ADD, 0);
final double critMod = mcrit ? calcCritDamage(attacker, target, skill) : 1; // TODO not really a proper way... find how it works then implement. // damage += attacker.getStat().getValue(Stats.MAGIC_CRIT_DMG_ADD, 0);
// Trait, elements
final double generalTraitMod = calcGeneralTraitBonus(attacker, target, skill.getTraitType(), true);
@ -328,7 +328,7 @@ public final class Formulas
defenceCriticalDamage = target.getStat().getValue(Stats.DEFENCE_CRITICAL_DAMAGE, 1);
}
return criticalDamage * defenceCriticalDamage;
return 2 * criticalDamage * defenceCriticalDamage;
}
/**
@ -1335,7 +1335,7 @@ public final class Formulas
final boolean isRanged = (weapon != null) && weapon.getItemType().isRanged();
final double shotsBonus = attacker.getStat().getValue(Stats.SHOTS_BONUS);
final double cAtk = crit ? (2 * calcCritDamage(attacker, target, null)) : 1;
final double cAtk = crit ? calcCritDamage(attacker, target, null) : 1;
final double cAtkAdd = crit ? calcCritDamageAdd(attacker, target, null) : 0;
final double critMod = crit ? (isRanged ? 0.5 : 1) : 0;
final double ssBonus = ss ? 2 * shotsBonus : 1;