Addition of DEBUFF_BLOCK check at calcMagicAffected method.

Thanks to nasseka.
This commit is contained in:
MobiusDevelopment 2022-03-01 13:18:07 +00:00
parent caad76a9be
commit 849551ff89
21 changed files with 126 additions and 84 deletions

View File

@ -629,16 +629,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -646,8 +642,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -629,16 +629,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -646,8 +642,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -629,16 +629,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -646,8 +642,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -629,16 +629,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -646,8 +642,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -629,16 +629,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -646,8 +642,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -629,16 +629,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -646,8 +642,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -629,16 +629,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -646,8 +642,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -629,16 +629,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -646,8 +642,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -629,16 +629,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -646,8 +642,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -629,16 +629,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -646,8 +642,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -629,16 +629,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -646,8 +642,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -629,16 +629,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -646,8 +642,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -629,16 +629,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -646,8 +642,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -629,16 +629,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -646,8 +642,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -630,16 +630,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -647,8 +643,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -630,16 +630,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -647,8 +643,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -630,16 +630,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -647,8 +643,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -629,16 +629,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -646,8 +642,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -630,16 +630,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -647,8 +643,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -630,16 +630,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -647,8 +643,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }

View File

@ -630,16 +630,12 @@ public class Formulas
public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill) public static boolean calcMagicAffected(Creature actor, Creature target, Skill skill)
{ {
// TODO: CHECK/FIX THIS FORMULA UP!!
double defence = 0; double defence = 0;
if (skill.isActive() && skill.isBad()) if (skill.isActive() && skill.isBad())
{ {
defence = target.getMDef(); defence = target.getMDef();
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
if (skill.isDebuff()) if (skill.isDebuff())
{ {
if (target.getAbnormalShieldBlocks() > 0) if (target.getAbnormalShieldBlocks() > 0)
@ -647,8 +643,14 @@ public class Formulas
target.decrementAbnormalShieldBlocks(); target.decrementAbnormalShieldBlocks();
return false; return false;
} }
else if (target.isAffected(EffectFlag.DEBUFF_BLOCK))
{
return false;
}
} }
final double attack = 2 * actor.getMAtk() * calcGeneralTraitBonus(actor, target, skill.getTraitType(), false);
double d = (attack - defence) / (attack + defence);
d += 0.5 * Rnd.nextGaussian(); d += 0.5 * Rnd.nextGaussian();
return d > 0; return d > 0;
} }