Add mark sacrifice spell

This commit is contained in:
Electroblob77
2020-07-30 22:54:37 +01:00
parent a321e4ef66
commit 0d7d36c0b5
9 changed files with 106 additions and 1 deletions
@@ -493,7 +493,7 @@ public class ItemArtefact extends Item {
}
@SubscribeEvent
public static void onSpellCastPostEvent(SpellCastEvent.Pre event){
public static void onSpellCastPostEvent(SpellCastEvent.Post event){
if(event.getCaster() instanceof EntityPlayer){
@@ -241,6 +241,7 @@ public final class Spells {
// Wizardry 4.3 spells
public static final Spell blinding_flash = placeholder();
public static final Spell mark_sacrifice = placeholder();
public static final Spell stormcloud = placeholder();
public static final Spell fangs = placeholder();
@@ -452,6 +453,7 @@ public final class Spells {
// Wizardry 4.3 spells
registry.register(new BlindingFlash());
registry.register(new MarkSacrifice());
registry.register(new Stormcloud());
registry.register(new Fangs());
@@ -55,6 +55,7 @@ public final class WizardryPotions {
public static final Potion curse_of_undeath = placeholder();
public static final Potion containment = placeholder();
public static final Potion frost_step = placeholder();
public static final Potion mark_of_sacrifice = placeholder();
/**
* Sets both the registry and unlocalised names of the given potion, then registers it with the given registry. Use
@@ -190,6 +191,9 @@ public final class WizardryPotions {
registerPotion(registry, "frost_step", new PotionFrostStep(false, 0).setBeneficial());
registerPotion(registry, "mark_of_sacrifice", new PotionMagicEffect(true, 0xe90e48,
new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icons/mark_of_sacrifice.png")));
}
}
@@ -0,0 +1,71 @@
package electroblob.wizardry.spell;
import electroblob.wizardry.item.SpellActions;
import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.util.EntityUtils;
import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.SpellModifiers;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@EventBusSubscriber
public class MarkSacrifice extends SpellRay {
private static final float DAMAGE_INCREASE_PER_LEVEL = 0.6f;
public MarkSacrifice(){
super("mark_sacrifice", SpellActions.POINT, false);
this.soundValues(1, 1.1f, 0.2f);
addProperties(EFFECT_DURATION, EFFECT_STRENGTH);
}
@Override
protected boolean onEntityHit(World world, Entity target, Vec3d hit, EntityLivingBase caster, Vec3d origin, int ticksInUse, SpellModifiers modifiers){
if(EntityUtils.isLiving(target)){
((EntityLivingBase)target).addPotionEffect(new PotionEffect(WizardryPotions.mark_of_sacrifice,
(int)(getProperty(EFFECT_DURATION).floatValue() * modifiers.get(WizardryItems.duration_upgrade)),
getProperty(EFFECT_STRENGTH).intValue() + SpellBuff.getStandardBonusAmplifier(modifiers.get(SpellModifiers.POTENCY))));
}
return true;
}
@Override
protected boolean onBlockHit(World world, BlockPos pos, EnumFacing side, Vec3d hit, EntityLivingBase caster, Vec3d origin, int ticksInUse, SpellModifiers modifiers){
return false;
}
@Override
protected boolean onMiss(World world, EntityLivingBase caster, Vec3d origin, Vec3d direction, int ticksInUse, SpellModifiers modifiers){
return true;
}
@Override
protected void spawnParticle(World world, double x, double y, double z, double vx, double vy, double vz){
ParticleBuilder.create(Type.DARK_MAGIC).pos(x, y, z).clr(0xe90e48).spawn(world);
ParticleBuilder.create(Type.SPARKLE).pos(x, y, z).time(12 + world.rand.nextInt(8)).clr(0xff7bbb).spawn(world);
}
@SubscribeEvent
public static void onLivingHurtEvent(LivingHurtEvent event){
PotionEffect effect = event.getEntityLiving().getActivePotionEffect(WizardryPotions.mark_of_sacrifice);
if(effect != null && event.getSource().isMagicDamage()){
event.setAmount(event.getAmount() * (1 + effect.getAmplifier() * DAMAGE_INCREASE_PER_LEVEL));
event.getEntityLiving().removePotionEffect(WizardryPotions.mark_of_sacrifice);
}
}
}
@@ -852,6 +852,7 @@ spell.ebwizardry\:lightning_ray=Lightning Ray
spell.ebwizardry\:lightning_sigil=Lightning Sigil
spell.ebwizardry\:lightning_web=Lightning Web
spell.ebwizardry\:magic_missile=Magic Missile
spell.ebwizardry\:mark_sacrifice=Mark Sacrifice
spell.ebwizardry\:metamorphosis=Metamorphosis
spell.ebwizardry\:meteor=Meteor
spell.ebwizardry\:mind_control=Mind Control
@@ -1033,6 +1034,7 @@ spell.ebwizardry\:lightning_ray.desc=Creates a stream of lightning in the direct
spell.ebwizardry\:lightning_sigil.desc=Places a magical lightning trap on the ground which damages the creature that triggers it and chains lightning to other nearby creatures.
spell.ebwizardry\:lightning_web.desc="Focus. Channel the storm in your mind through your wand and unleash its fury."
spell.ebwizardry\:magic_missile.desc=Fires a bolt of magical energy in the direction you are pointing.
spell.ebwizardry\:mark_sacrifice.desc=Marks the target as a divine sacrifice. The next magical attack on a marked creature deals 60%% extra damage for each level of the effect.
spell.ebwizardry\:metamorphosis.desc=Changes the target into another form. Only works on some creatures.
spell.ebwizardry\:meteor.desc=Some wizards just want to see the world burn...
spell.ebwizardry\:mind_control.desc=Takes control of the target's mind for 30 seconds, causing it switch sides and fight for the caster instead. Will not work on creatures that are too strong-willed.
@@ -852,6 +852,7 @@ spell.ebwizardry\:lightning_ray=Lightning Ray
spell.ebwizardry\:lightning_sigil=Lightning Sigil
spell.ebwizardry\:lightning_web=Lightning Web
spell.ebwizardry\:magic_missile=Magic Missile
spell.ebwizardry\:mark_sacrifice=Mark Sacrifice
spell.ebwizardry\:metamorphosis=Metamorphosis
spell.ebwizardry\:meteor=Meteor
spell.ebwizardry\:mind_control=Mind Control
@@ -1033,6 +1034,7 @@ spell.ebwizardry\:lightning_ray.desc=Creates a stream of lightning in the direct
spell.ebwizardry\:lightning_sigil.desc=Places a magical lightning trap on the ground which damages the creature that triggers it and chains lightning to other nearby creatures.
spell.ebwizardry\:lightning_web.desc="Focus. Channel the storm in your mind through your wand and unleash its fury."
spell.ebwizardry\:magic_missile.desc=Fires a bolt of magical energy in the direction you are pointing.
spell.ebwizardry\:mark_sacrifice.desc=Marks the target as a divine sacrifice. The next magical attack on a marked creature deals 60%% extra damage for each level of the effect.
spell.ebwizardry\:metamorphosis.desc=Changes the target into another form. Only works on some creatures.
spell.ebwizardry\:meteor.desc=Some wizards just want to see the world burn...
spell.ebwizardry\:mind_control.desc=Takes control of the target's mind for 30 seconds, causing it switch sides and fight for the caster instead. Will not work on creatures that are too strong-willed.
@@ -0,0 +1,24 @@
{
"enabled": {
"book": true,
"scroll": true,
"wands": true,
"npcs": true,
"dispensers": true,
"commands": true,
"treasure": true,
"trades": true,
"looting": true
},
"tier": "apprentice",
"element": "healing",
"type": "alteration",
"cost": 15,
"chargeup": 0,
"cooldown": 30,
"base_properties": {
"range": 10,
"effect_duration": 300,
"effect_strength": 0
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB