Make all radiant damage set fire to undead entities

This commit is contained in:
Electroblob77
2020-06-30 16:10:46 +01:00
parent 429f74393e
commit 02ab4a9014
7 changed files with 14 additions and 14 deletions
@@ -107,11 +107,6 @@ public class EntityRadiantTotem extends EntityScaledConstruct {
float damage = Spells.radiant_totem.getProperty(Spell.DAMAGE).floatValue(); float damage = Spells.radiant_totem.getProperty(Spell.DAMAGE).floatValue();
if(target.isEntityUndead()){
target.setFire(Spells.radiant_totem.getProperty(Spell.BURN_DURATION).intValue());
// damage *= getProperty(UNDEAD_DAMAGE_MULTIPLIER).floatValue();
}
EntityUtils.attackEntityWithoutKnockback(target, MagicDamage.causeIndirectMagicDamage(this, EntityUtils.attackEntityWithoutKnockback(target, MagicDamage.causeIndirectMagicDamage(this,
getCaster(), DamageType.RADIANT), damage); getCaster(), DamageType.RADIANT), damage);
} }
@@ -13,7 +13,7 @@ public class RadiantTotem extends SpellConstructRanged<EntityRadiantTotem> {
public RadiantTotem(){ public RadiantTotem(){
super("radiant_totem", EntityRadiantTotem::new, false); super("radiant_totem", EntityRadiantTotem::new, false);
this.addProperties(EFFECT_RADIUS, MAX_TARGETS, HEALTH, DAMAGE, BURN_DURATION); this.addProperties(EFFECT_RADIUS, MAX_TARGETS, HEALTH, DAMAGE);
this.floor(false); this.floor(false);
} }
@@ -3,9 +3,12 @@ package electroblob.wizardry.spell;
import electroblob.wizardry.Wizardry; import electroblob.wizardry.Wizardry;
import electroblob.wizardry.item.SpellActions; import electroblob.wizardry.item.SpellActions;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.util.*; import electroblob.wizardry.util.EntityUtils;
import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.SpellModifiers;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@@ -26,7 +29,7 @@ public class RayOfPurification extends SpellRay {
public RayOfPurification(){ public RayOfPurification(){
super("ray_of_purification", SpellActions.POINT, true); super("ray_of_purification", SpellActions.POINT, true);
addProperties(DAMAGE, EFFECT_DURATION, BURN_DURATION, UNDEAD_DAMAGE_MULTIPLIER); addProperties(DAMAGE, EFFECT_DURATION, UNDEAD_DAMAGE_MULTIPLIER);
} }
// The following three methods serve as a good example of how to implement continuous spell sounds (hint: it's easy) // The following three methods serve as a good example of how to implement continuous spell sounds (hint: it's easy)
@@ -60,7 +63,6 @@ public class RayOfPurification extends SpellRay {
float damage = getProperty(DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY); float damage = getProperty(DAMAGE).floatValue() * modifiers.get(SpellModifiers.POTENCY);
// Fire // Fire
if(((EntityLivingBase)target).isEntityUndead()){ if(((EntityLivingBase)target).isEntityUndead()){
target.setFire((int)(getProperty(BURN_DURATION).floatValue() * modifiers.get(WizardryItems.duration_upgrade)));
damage *= getProperty(UNDEAD_DAMAGE_MULTIPLIER).floatValue(); damage *= getProperty(UNDEAD_DAMAGE_MULTIPLIER).floatValue();
} }
// Damage // Damage
@@ -42,6 +42,11 @@ public interface IElementalDamage {
// Charges creepers when they are hit by shock damage // Charges creepers when they are hit by shock damage
EntityUtils.chargeCreeper((EntityCreeper)event.getEntityLiving()); EntityUtils.chargeCreeper((EntityCreeper)event.getEntityLiving());
} }
if(event.getEntityLiving().isEntityUndead()
&& ((IElementalDamage)event.getSource()).getType() == DamageType.RADIANT){
event.getEntityLiving().setFire(8); // Same as zombies/skeletons in sunlight
}
} }
} }
} }
@@ -71,7 +71,7 @@ public class MagicDamage extends EntityDamageSource implements IElementalDamage
FIRE, FIRE,
/** Frost (ice) damage from wizardry. Snow golems, ice wraiths and ice giants are immune. */ /** Frost (ice) damage from wizardry. Snow golems, ice wraiths and ice giants are immune. */
FROST, FROST,
/** Shock (lightning) damage from wizardry. Lightning wraiths and storm elementals are immune. */ /** Shock (lightning) damage from wizardry. Charges creepers. Lightning wraiths and storm elementals are immune. */
SHOCK, SHOCK,
/** Wither damage from wizardry. Withers, wither skeletons and shadow wraiths are immune. */ /** Wither damage from wizardry. Withers, wither skeletons and shadow wraiths are immune. */
WITHER, WITHER,
@@ -81,7 +81,7 @@ public class MagicDamage extends EntityDamageSource implements IElementalDamage
FORCE, FORCE,
/** Blast damage from wizardry. Affected by the blast protection enchantment. */ /** Blast damage from wizardry. Affected by the blast protection enchantment. */
BLAST, BLAST,
/** Radiant damage from wizardry. */ /** Radiant damage from wizardry. Sets fire to undead entities. */
RADIANT RADIANT
} }
@@ -22,7 +22,6 @@
"effect_radius": 6, "effect_radius": 6,
"max_targets": 1, "max_targets": 1,
"health": 1, "health": 1,
"damage": 1, "damage": 1
"burn_duration": 5
} }
} }
@@ -20,7 +20,6 @@
"range": 10, "range": 10,
"damage": 2, "damage": 2,
"effect_duration": 60, "effect_duration": 60,
"burn_duration": 5,
"undead_damage_multiplier": 2 "undead_damage_multiplier": 2
} }
} }