Damage multipliers now effect damage modifiers - this also fixes a bug!

This commit is contained in:
Cheese 2015-04-11 16:33:18 +10:00
parent 1378dcb815
commit d290078790

View File

@ -50,7 +50,7 @@ public class CustomDamageEvent extends Event implements Cancellable
{
_eventCause = cause;
if (initialSource == null || initialReason == null)
//if (initialSource == null || initialReason == null)
_initialDamage = damage;
_damageeEntity = damagee;
@ -66,7 +66,7 @@ public class CustomDamageEvent extends Event implements Cancellable
_ignoreArmor = ignoreArmor;
if (initialSource != null && initialReason != null)
AddMod(initialSource, initialReason, damage, true);
AddMod(initialSource, initialReason, 0, true);
if (_eventCause == DamageCause.FALL)
_ignoreArmor = true;
@ -116,11 +116,11 @@ public class CustomDamageEvent extends Event implements Cancellable
{
double damage = GetDamageInitial();
for (DamageChange mult : _damageMult)
damage *= mult.GetDamage();
for (DamageChange mult : _damageMod)
damage += mult.GetDamage();
for (DamageChange mult : _damageMult)
damage *= mult.GetDamage();
return damage;
}