fix: Increased the tick rate of continuous spells (#849)
... and added some checks to make sure the spells don't deal too much with mods that interact with the hurt resistance timer.
This commit is contained in:
@@ -53,7 +53,7 @@ public class FireBreath extends SpellRay {
|
|||||||
this.getNameForTranslationFormatted()), true);
|
this.getNameForTranslationFormatted()), true);
|
||||||
// This now only damages in line with the maxHurtResistantTime. Some mods don't play nicely and fiddle
|
// This now only damages in line with the maxHurtResistantTime. Some mods don't play nicely and fiddle
|
||||||
// with this mechanic for their own purposes, so this line makes sure that doesn't affect wizardry.
|
// with this mechanic for their own purposes, so this line makes sure that doesn't affect wizardry.
|
||||||
}else if(ticksInUse % ((EntityLivingBase)target).maxHurtResistantTime == 1){
|
}else if(ticksInUse % 10 == 0){
|
||||||
target.setFire((int)(getProperty(BURN_DURATION).floatValue() * modifiers.get(WizardryItems.duration_upgrade)));
|
target.setFire((int)(getProperty(BURN_DURATION).floatValue() * modifiers.get(WizardryItems.duration_upgrade)));
|
||||||
EntityUtils.attackEntityWithoutKnockback(target,
|
EntityUtils.attackEntityWithoutKnockback(target,
|
||||||
MagicDamage.causeDirectMagicDamage(caster, DamageType.FIRE),
|
MagicDamage.causeDirectMagicDamage(caster, DamageType.FIRE),
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class FlameRay extends SpellRay {
|
|||||||
this.getNameForTranslationFormatted()), true);
|
this.getNameForTranslationFormatted()), true);
|
||||||
// This now only damages in line with the maxHurtResistantTime. Some mods don't play nicely and fiddle
|
// This now only damages in line with the maxHurtResistantTime. Some mods don't play nicely and fiddle
|
||||||
// with this mechanic for their own purposes, so this line makes sure that doesn't affect wizardry.
|
// with this mechanic for their own purposes, so this line makes sure that doesn't affect wizardry.
|
||||||
}else if(ticksInUse % ((EntityLivingBase)target).maxHurtResistantTime == 1){
|
}else if(ticksInUse % 10 == 0){
|
||||||
target.setFire((int)(getProperty(BURN_DURATION).floatValue() * modifiers.get(WizardryItems.duration_upgrade)));
|
target.setFire((int)(getProperty(BURN_DURATION).floatValue() * modifiers.get(WizardryItems.duration_upgrade)));
|
||||||
EntityUtils.attackEntityWithoutKnockback(target,
|
EntityUtils.attackEntityWithoutKnockback(target,
|
||||||
MagicDamage.causeDirectMagicDamage(caster, DamageType.FIRE),
|
MagicDamage.causeDirectMagicDamage(caster, DamageType.FIRE),
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class FrostRay extends SpellRay {
|
|||||||
(int)(getProperty(EFFECT_DURATION).floatValue() * modifiers.get(WizardryItems.duration_upgrade)),
|
(int)(getProperty(EFFECT_DURATION).floatValue() * modifiers.get(WizardryItems.duration_upgrade)),
|
||||||
getProperty(EFFECT_STRENGTH).intValue()));
|
getProperty(EFFECT_STRENGTH).intValue()));
|
||||||
|
|
||||||
if(ticksInUse % ((EntityLivingBase)target).maxHurtResistantTime == 1){
|
if(ticksInUse % 10 == 0){
|
||||||
float damage = getProperty(DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY);
|
float damage = getProperty(DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY);
|
||||||
if(target instanceof EntityBlaze || target instanceof EntityMagmaCube) damage *= 2;
|
if(target instanceof EntityBlaze || target instanceof EntityMagmaCube) damage *= 2;
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class LifeDrain extends SpellRay {
|
|||||||
|
|
||||||
if(EntityUtils.isLiving(target)){
|
if(EntityUtils.isLiving(target)){
|
||||||
|
|
||||||
if(ticksInUse % 12 == 0){
|
if(ticksInUse % 10 == 0){
|
||||||
|
|
||||||
float damage = getProperty(DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY);
|
float damage = getProperty(DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY);
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class LightningRay extends SpellRay {
|
|||||||
this.getNameForTranslationFormatted()), true);
|
this.getNameForTranslationFormatted()), true);
|
||||||
// This now only damages in line with the maxHurtResistantTime. Some mods don't play nicely and fiddle
|
// This now only damages in line with the maxHurtResistantTime. Some mods don't play nicely and fiddle
|
||||||
// with this mechanic for their own purposes, so this line makes sure that doesn't affect wizardry.
|
// with this mechanic for their own purposes, so this line makes sure that doesn't affect wizardry.
|
||||||
}else if(ticksInUse % ((EntityLivingBase)target).maxHurtResistantTime == 1){
|
}else if(ticksInUse % 10 == 0){
|
||||||
EntityUtils.attackEntityWithoutKnockback(target,
|
EntityUtils.attackEntityWithoutKnockback(target,
|
||||||
MagicDamage.causeDirectMagicDamage(caster, DamageType.SHOCK),
|
MagicDamage.causeDirectMagicDamage(caster, DamageType.SHOCK),
|
||||||
getProperty(DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY));
|
getProperty(DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY));
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class LightningWeb extends SpellRay {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean onEntityHit(World world, Entity target, Vec3d hit, EntityLivingBase caster, Vec3d origin, int ticksInUse, SpellModifiers modifiers){
|
protected boolean onEntityHit(World world, Entity target, Vec3d hit, EntityLivingBase caster, Vec3d origin, int ticksInUse, SpellModifiers modifiers){
|
||||||
|
|
||||||
if(EntityUtils.isLiving(target)){
|
if(EntityUtils.isLiving(target) && ticksInUse % 10 == 0){
|
||||||
|
|
||||||
electrocute(world, caster, origin, target, getProperty(PRIMARY_DAMAGE).floatValue()
|
electrocute(world, caster, origin, target, getProperty(PRIMARY_DAMAGE).floatValue()
|
||||||
* modifiers.get(SpellModifiers.POTENCY), ticksInUse);
|
* modifiers.get(SpellModifiers.POTENCY), ticksInUse);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class RayOfPurification extends SpellRay {
|
|||||||
if(!world.isRemote && ticksInUse == 1 && caster instanceof EntityPlayer) ((EntityPlayer)caster)
|
if(!world.isRemote && ticksInUse == 1 && caster instanceof EntityPlayer) ((EntityPlayer)caster)
|
||||||
.sendStatusMessage(new TextComponentTranslation("spell.resist", target.getName(),
|
.sendStatusMessage(new TextComponentTranslation("spell.resist", target.getName(),
|
||||||
this.getNameForTranslationFormatted()), true);
|
this.getNameForTranslationFormatted()), true);
|
||||||
}else{
|
}else if (ticksInUse % 10 == 0) {
|
||||||
|
|
||||||
float damage = getProperty(DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY);
|
float damage = getProperty(DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY);
|
||||||
// Fire
|
// Fire
|
||||||
|
|||||||
Reference in New Issue
Block a user