use of com.elmakers.mine.bukkit.api.magic.CasterProperties in project MagicPlugin by elBukkit.
the class BaseSpell method checkActiveCosts.
public void checkActiveCosts() {
if (activeCosts == null)
return;
long now = System.currentTimeMillis();
activeCostScale = (float) ((double) (now - lastActiveCost) / 1000);
lastActiveCost = now;
CasterProperties caster = null;
if (currentCast != null) {
caster = currentCast.getWand();
if (caster == null) {
caster = currentCast.getMageClass();
}
}
for (CastingCost cost : activeCosts) {
if (!cost.has(mage, caster, this)) {
deactivate();
break;
}
cost.deduct(mage, caster, this);
}
activeCostScale = 1;
}
Aggregations