use of com.teamwizardry.wizardry.api.spell.annotation.ContextSuper in project Wizardry by TeamWizardry.
the class ModuleEffectLightning method onRunTouch.
@ModuleOverride("shape_touch_run")
public void onRunTouch(@ContextSuper ModuleOverrideSuper ovdSuper, World world, SpellData data, SpellRing shape, @ContextRing SpellRing childRing) {
if (ovdSuper.hasSuper())
ovdSuper.invoke(true, world, data, shape);
Vec3d look = data.getData(LOOK);
Entity caster = data.getCaster(world);
Vec3d origin = data.getOriginWithFallback(world);
if (look == null || caster == null || origin == null)
return;
if (!childRing.taxCaster(world, data, true))
return;
double range = childRing.getAttributeValue(world, AttributeRegistry.RANGE, data);
double potency = childRing.getAttributeValue(world, AttributeRegistry.POTENCY, data);
double duration = childRing.getAttributeValue(world, AttributeRegistry.DURATION, data);
RayTraceResult trace = new RayTrace(world, look, origin, caster instanceof EntityLivingBase ? ((EntityLivingBase) caster).getEntityAttribute(EntityPlayer.REACH_DISTANCE).getAttributeValue() : 5).setEntityFilter(input -> input != caster).setReturnLastUncollidableBlock(true).setIgnoreBlocksWithoutBoundingBoxes(true).trace();
doLightning(RandUtil.nextLong(100, 100000), world, caster, origin, trace.hitVec, range, potency, duration);
}
Aggregations