package com.elmakers.mine.bukkit.action.builtin;

import com.elmakers.mine.bukkit.api.action.CastContext;
import com.elmakers.mine.bukkit.api.spell.SpellResult;
import com.elmakers.mine.bukkit.action.BaseSpellAction;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;

public class KillAction extends BaseSpellAction
{
	@Override
	public SpellResult perform(CastContext context)
	{
        Entity entity = context.getTargetEntity();
		if (!(entity instanceof LivingEntity))
		{
			return SpellResult.NO_TARGET;
		}

        LivingEntity targetEntity = (LivingEntity)entity;
        // Overkill to bypass protection
        if (!targetEntity.isDead()) {
            targetEntity.damage(targetEntity.getMaxHealth() * 100);
        }
		return SpellResult.CAST;
	}

	@Override
	public boolean isUndoable()
	{
		return true;
	}

    @Override
    public boolean requiresTargetEntity()
    {
        return true;
    }
}

@@ -99,16 +99,122 @@
 ontext;%0A
+import com.elmakers.mine.bukkit.api.magic.Mage;%0Aimport com.elmakers.mine.bukkit.api.magic.MageController;%0A
 import c
@@ -694,16 +694,295 @@
 entity;%0A
+        MageController controller = context.getController();%0A        if (controller.isMage(targetEntity)) %7B%0A            Mage mage = controller.getMage(targetEntity);%0A            if (mage.isSuperProtected()) %7B%0A                return SpellResult.NO_TARGET;%0A            %7D%0A        %7D%0A
         

Add explicit Superprotected check to Kill action