Blessed soulshot fixes and adjustments.

This commit is contained in:
MobiusDevelopment
2020-06-01 13:14:16 +00:00
parent c3524035b2
commit 9b8f27f819
46 changed files with 286 additions and 135 deletions

View File

@@ -1086,7 +1086,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
setHeading(Util.calculateHeadingFrom(this, target));
// Always try to charge soulshots.
if (!isChargedShot(ShotType.SOULSHOTS))
if (!isChargedShot(ShotType.SOULSHOTS) && !isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
rechargeShots(true, false, false);
}
@@ -1261,10 +1261,19 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
byte shld = 0;
boolean crit = false;
boolean shotConsumed = shotConsumedValue;
boolean shotBlessed = false;
final boolean miss = Formulas.calcHitMiss(this, target);
if (!shotConsumed)
{
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
if (isChargedShot(ShotType.BLESSED_SOULSHOTS))
{
shotBlessed = true;
shotConsumed = !miss && unchargeShot(ShotType.BLESSED_SOULSHOTS);
}
else
{
shotConsumed = !miss && unchargeShot(ShotType.SOULSHOTS);
}
}
final int ssGrade = (shotConsumed && (weapon != null)) ? weapon.getItemGrade().ordinal() : 0;
@@ -1274,7 +1283,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
{
shld = Formulas.calcShldUse(this, target);
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null);
damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed);
damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed, shotBlessed);
if (halfDamage)
{
damage /= 2;

View File

@@ -1395,9 +1395,10 @@ public class Formulas
* @param shld
* @param crit if the ATTACK have critical success
* @param ss if weapon item was charged by soulshot
* @param ssBlessed if shot was blessed
* @return
*/
public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss)
public static double calcAutoAttackDamage(Creature attacker, Creature target, byte shld, boolean crit, boolean ss, boolean ssBlessed)
{
// DEFENCE CALCULATION (pDef + sDef)
double defence = target.getPDef();
@@ -1422,10 +1423,10 @@ public class Formulas
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;
final double random_damage = attacker.getRandomDamageMultiplier();
final double ssBonus = ss ? (ssBlessed ? 2.15 : 2) * shotsBonus : 1;
final double randomDamage = attacker.getRandomDamageMultiplier();
final double proxBonus = (attacker.isInFrontOf(target) ? 0 : (attacker.isBehind(target) ? 0.2 : 0.05)) * attacker.getPAtk();
double attack = (attacker.getPAtk() * random_damage) + proxBonus;
double attack = (attacker.getPAtk() * randomDamage) + proxBonus;
// ....................______________Critical Section___________________...._______Non-Critical Section______
// ATTACK CALCULATION (((pAtk * cAtk * ss + cAtkAdd) * crit) * weaponMod) + (pAtk (1 - crit) * ss * weaponMod)