mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 21:05:06 +00:00
Reformat Code
This commit is contained in:
1 parent
21e920426e
commit
1de1c4e710
169 files changed
+3967
-1556
No files matched your search
@@ -14,12 +14,12 @@ import java.util.List;
|
||||
/**
|
||||
* Renders the AbilityBeam entity with a head, tail orb, and curving trail.
|
||||
* The trail shows the path the head has traveled using laser-style rectangular segments.
|
||||
*
|
||||
* <p>
|
||||
* IMPORTANT: Trail points are stored RELATIVE to the origin position.
|
||||
* We render by translating to the origin first, then drawing all points relative to that.
|
||||
*
|
||||
* <p>
|
||||
* Trail segments now share vertices at connection points to prevent gaps during curves.
|
||||
*
|
||||
* <p>
|
||||
* Design inspired by LouisXIV's energy rendering system.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -182,7 +182,7 @@ public class RenderAbilityBeam extends RenderEnergyAbility {
|
||||
* Uses averaged perpendicular vectors at connection points to prevent gaps.
|
||||
*/
|
||||
private void renderSmoothTrail(List<Vec3> trail, float width, int innerColor, int outerColor,
|
||||
boolean outerColorEnabled, float outerColorWidth) {
|
||||
boolean outerColorEnabled, float outerColorWidth) {
|
||||
if (trail.size() < 2) return;
|
||||
|
||||
int trailSize = trail.size();
|
||||
@@ -213,7 +213,7 @@ public class RenderAbilityBeam extends RenderEnergyAbility {
|
||||
* Older trail points fade out based on their age.
|
||||
*/
|
||||
private void renderFadingTrail(EntityAbilityBeam beam, List<Vec3> trail, float width, int innerColor, int outerColor,
|
||||
boolean outerColorEnabled, float outerColorWidth) {
|
||||
boolean outerColorEnabled, float outerColorWidth) {
|
||||
if (trail.size() < 2) return;
|
||||
|
||||
List<Integer> ages = beam.getTrailPointAges();
|
||||
@@ -242,7 +242,7 @@ public class RenderAbilityBeam extends RenderEnergyAbility {
|
||||
* Render trail tube with age-based fading.
|
||||
*/
|
||||
private void renderFadingTrailTube(List<Vec3> trail, List<double[]> perpFrames, List<Integer> ages,
|
||||
int fadeTime, float width, int color, float baseAlpha) {
|
||||
int fadeTime, float width, int color, float baseAlpha) {
|
||||
float[] rgb = extractRGB(color);
|
||||
float r = rgb[0], g = rgb[1], b = rgb[2];
|
||||
float halfWidth = width * 0.5f;
|
||||
@@ -392,13 +392,17 @@ public class RenderAbilityBeam extends RenderEnergyAbility {
|
||||
dy /= len;
|
||||
dz /= len;
|
||||
} else {
|
||||
dx = 0; dy = 0; dz = 1;
|
||||
dx = 0;
|
||||
dy = 0;
|
||||
dz = 1;
|
||||
}
|
||||
|
||||
// Calculate perpendicular vectors using consistent up reference
|
||||
double upX = 0, upY = 1, upZ = 0;
|
||||
if (Math.abs(dy) > 0.9) {
|
||||
upX = 1; upY = 0; upZ = 0;
|
||||
upX = 1;
|
||||
upY = 0;
|
||||
upZ = 0;
|
||||
}
|
||||
|
||||
// Cross product for horizontal perpendicular
|
||||
@@ -417,8 +421,12 @@ public class RenderAbilityBeam extends RenderEnergyAbility {
|
||||
double vertY = dz * horzX - dx * horzZ;
|
||||
double vertZ = dx * horzY - dy * horzX;
|
||||
|
||||
frame[0] = horzX; frame[1] = horzY; frame[2] = horzZ;
|
||||
frame[3] = vertX; frame[4] = vertY; frame[5] = vertZ;
|
||||
frame[0] = horzX;
|
||||
frame[1] = horzY;
|
||||
frame[2] = horzZ;
|
||||
frame[3] = vertX;
|
||||
frame[4] = vertY;
|
||||
frame[5] = vertZ;
|
||||
frames.add(frame);
|
||||
}
|
||||
|
||||
@@ -429,7 +437,7 @@ public class RenderAbilityBeam extends RenderEnergyAbility {
|
||||
* Render the trail as a continuous tube using pre-computed perpendicular frames.
|
||||
*/
|
||||
private void renderTrailTube(List<Vec3> trail, List<double[]> perpFrames,
|
||||
float width, int color, float baseAlpha, boolean fadeFromStart) {
|
||||
float width, int color, float baseAlpha, boolean fadeFromStart) {
|
||||
float[] rgb = extractRGB(color);
|
||||
float r = rgb[0], g = rgb[1], b = rgb[2];
|
||||
float halfWidth = width * 0.5f;
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.lwjgl.opengl.GL11;
|
||||
/**
|
||||
* Renders the AbilityDisc entity as a flat spinning square.
|
||||
* Rotates only on Y axis (flat spin like a saw blade).
|
||||
*
|
||||
* <p>
|
||||
* Design inspired by LouisXIV's energy rendering system.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
/**
|
||||
* Renders the AbilityLaser entity as a rectangular beam with clear inner/outer colors.
|
||||
*
|
||||
* <p>
|
||||
* Design inspired by LouisXIV's energy rendering system.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -69,7 +69,9 @@ public class RenderAbilityLaser extends RenderEnergyAbility {
|
||||
// Calculate perpendicular vectors (one horizontal, one vertical relative to beam)
|
||||
double upX = 0, upY = 1, upZ = 0;
|
||||
if (Math.abs(dy) > 0.9) {
|
||||
upX = 1; upY = 0; upZ = 0;
|
||||
upX = 1;
|
||||
upY = 0;
|
||||
upZ = 0;
|
||||
}
|
||||
|
||||
// Cross product for horizontal perpendicular
|
||||
@@ -98,29 +100,29 @@ public class RenderAbilityLaser extends RenderEnergyAbility {
|
||||
float outerWidth = innerWidth + laser.getOuterColorWidth() * width;
|
||||
GL11.glDepthMask(false);
|
||||
renderBeamRectangle(renderStartX, renderStartY, renderStartZ,
|
||||
renderEndX, renderEndY, renderEndZ,
|
||||
horzX, horzY, horzZ, vertX, vertY, vertZ,
|
||||
outerWidth, laser.getOuterColor(), alpha * 0.4f);
|
||||
renderEndX, renderEndY, renderEndZ,
|
||||
horzX, horzY, horzZ, vertX, vertY, vertZ,
|
||||
outerWidth, laser.getOuterColor(), alpha * 0.4f);
|
||||
|
||||
// Render middle layer (halfway between inner and outer)
|
||||
float midWidth = innerWidth + (outerWidth - innerWidth) * 0.5f;
|
||||
renderBeamRectangle(renderStartX, renderStartY, renderStartZ,
|
||||
renderEndX, renderEndY, renderEndZ,
|
||||
horzX, horzY, horzZ, vertX, vertY, vertZ,
|
||||
midWidth, laser.getOuterColor(), alpha * 0.7f);
|
||||
renderEndX, renderEndY, renderEndZ,
|
||||
horzX, horzY, horzZ, vertX, vertY, vertZ,
|
||||
midWidth, laser.getOuterColor(), alpha * 0.7f);
|
||||
GL11.glDepthMask(true);
|
||||
}
|
||||
|
||||
// Render inner core (solid)
|
||||
renderBeamRectangle(renderStartX, renderStartY, renderStartZ,
|
||||
renderEndX, renderEndY, renderEndZ,
|
||||
horzX, horzY, horzZ, vertX, vertY, vertZ,
|
||||
innerWidth, laser.getInnerColor(), alpha);
|
||||
renderEndX, renderEndY, renderEndZ,
|
||||
horzX, horzY, horzZ, vertX, vertY, vertZ,
|
||||
innerWidth, laser.getInnerColor(), alpha);
|
||||
|
||||
// Render lightning along the laser beam
|
||||
if (laser.hasLightningEffect() && laser.getCurrentLength() > 0.1f) {
|
||||
renderLaserLightning(laser, renderStartX, renderStartY, renderStartZ,
|
||||
renderEndX, renderEndY, renderEndZ, width);
|
||||
renderEndX, renderEndY, renderEndZ, width);
|
||||
}
|
||||
|
||||
restoreRenderState();
|
||||
@@ -179,8 +181,8 @@ public class RenderAbilityLaser extends RenderEnergyAbility {
|
||||
* Render lightning effects along the laser beam at multiple points.
|
||||
*/
|
||||
private void renderLaserLightning(EntityAbilityLaser laser,
|
||||
double startX, double startY, double startZ,
|
||||
double endX, double endY, double endZ, float width) {
|
||||
double startX, double startY, double startZ,
|
||||
double endX, double endY, double endZ, float width) {
|
||||
AttachedLightningRenderer.LightningState state = getLightningState(laser);
|
||||
|
||||
float density = laser.getLightningDensity();
|
||||
@@ -229,10 +231,10 @@ public class RenderAbilityLaser extends RenderEnergyAbility {
|
||||
* Render a beam as a 3D rectangular prism (box along a line).
|
||||
*/
|
||||
private void renderBeamRectangle(double x1, double y1, double z1,
|
||||
double x2, double y2, double z2,
|
||||
double horzX, double horzY, double horzZ,
|
||||
double vertX, double vertY, double vertZ,
|
||||
float width, int color, float alpha) {
|
||||
double x2, double y2, double z2,
|
||||
double horzX, double horzY, double horzZ,
|
||||
double vertX, double vertY, double vertZ,
|
||||
float width, int color, float alpha) {
|
||||
float[] rgb = extractRGB(color);
|
||||
float r = rgb[0], g = rgb[1], b = rgb[2];
|
||||
|
||||
|
||||
@@ -104,8 +104,8 @@ public class RenderAbilitySweeper extends Render {
|
||||
* Uses the same approach as RenderAbilityBeam.renderBeamRectangle.
|
||||
*/
|
||||
private void renderBeamSegment(double x1, double y1, double z1,
|
||||
double x2, double y2, double z2,
|
||||
float width, float r, float g, float b, float a) {
|
||||
double x2, double y2, double z2,
|
||||
float width, float r, float g, float b, float a) {
|
||||
// Calculate direction
|
||||
double dx = x2 - x1;
|
||||
double dy = y2 - y1;
|
||||
@@ -121,7 +121,9 @@ public class RenderAbilitySweeper extends Render {
|
||||
// Calculate perpendicular vectors
|
||||
double upX = 0, upY = 1, upZ = 0;
|
||||
if (Math.abs(dy) > 0.9) {
|
||||
upX = 1; upY = 0; upZ = 0;
|
||||
upX = 1;
|
||||
upY = 0;
|
||||
upZ = 0;
|
||||
}
|
||||
|
||||
// Cross product for horizontal perpendicular
|
||||
|
||||
@@ -8,13 +8,13 @@ import kamkeel.npcs.entity.EntityAbilityZone.AccentStyle;
|
||||
import kamkeel.npcs.entity.EntityAbilityZone.ParticleMotion;
|
||||
import kamkeel.npcs.entity.EntityAbilityZone.ZoneShape;
|
||||
import kamkeel.npcs.entity.EntityAbilityZone.ZoneType;
|
||||
import noppes.npcs.client.fx.CustomFX;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.client.fx.CustomFX;
|
||||
import noppes.npcs.client.fx.ZoneParticleFX;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -373,11 +373,21 @@ public class RenderAbilityZone extends Render {
|
||||
}
|
||||
}
|
||||
|
||||
private float ringR(Ctx c) { return c.outerEnabled ? c.outerR : c.ir; }
|
||||
private float ringG(Ctx c) { return c.outerEnabled ? c.outerG : c.ig; }
|
||||
private float ringB(Ctx c) { return c.outerEnabled ? c.outerB : c.ib; }
|
||||
private float ringR(Ctx c) {
|
||||
return c.outerEnabled ? c.outerR : c.ir;
|
||||
}
|
||||
|
||||
private static float sin(double v) { return (float) Math.sin(v); }
|
||||
private float ringG(Ctx c) {
|
||||
return c.outerEnabled ? c.outerG : c.ig;
|
||||
}
|
||||
|
||||
private float ringB(Ctx c) {
|
||||
return c.outerEnabled ? c.outerB : c.ib;
|
||||
}
|
||||
|
||||
private static float sin(double v) {
|
||||
return (float) Math.sin(v);
|
||||
}
|
||||
|
||||
private void renderSwayingAccents(Ctx c, float r, float g, float b, float a, float height) {
|
||||
if (height <= 0.1f) return;
|
||||
@@ -413,10 +423,22 @@ public class RenderAbilityZone extends Render {
|
||||
float frac = (j + 0.5f) / perSide;
|
||||
double lx, lz;
|
||||
switch (side) {
|
||||
case 0: lx = -c.radius + frac * 2 * c.radius; lz = -c.radius; break;
|
||||
case 1: lx = c.radius; lz = -c.radius + frac * 2 * c.radius; break;
|
||||
case 2: lx = c.radius - frac * 2 * c.radius; lz = c.radius; break;
|
||||
default: lx = -c.radius; lz = c.radius - frac * 2 * c.radius; break;
|
||||
case 0:
|
||||
lx = -c.radius + frac * 2 * c.radius;
|
||||
lz = -c.radius;
|
||||
break;
|
||||
case 1:
|
||||
lx = c.radius;
|
||||
lz = -c.radius + frac * 2 * c.radius;
|
||||
break;
|
||||
case 2:
|
||||
lx = c.radius - frac * 2 * c.radius;
|
||||
lz = c.radius;
|
||||
break;
|
||||
default:
|
||||
lx = -c.radius;
|
||||
lz = c.radius - frac * 2 * c.radius;
|
||||
break;
|
||||
}
|
||||
float swayX = 0.15f * sin(c.time * 0.08f + idx * 1.7f);
|
||||
float swayZ = 0.15f * sin(c.time * 0.06f + idx * 2.3f);
|
||||
@@ -467,10 +489,22 @@ public class RenderAbilityZone extends Render {
|
||||
float frac = (j + 0.5f) / perSide;
|
||||
double lx, lz;
|
||||
switch (side) {
|
||||
case 0: lx = -c.radius + frac * 2 * c.radius; lz = -c.radius; break;
|
||||
case 1: lx = c.radius; lz = -c.radius + frac * 2 * c.radius; break;
|
||||
case 2: lx = c.radius - frac * 2 * c.radius; lz = c.radius; break;
|
||||
default: lx = -c.radius; lz = c.radius - frac * 2 * c.radius; break;
|
||||
case 0:
|
||||
lx = -c.radius + frac * 2 * c.radius;
|
||||
lz = -c.radius;
|
||||
break;
|
||||
case 1:
|
||||
lx = c.radius;
|
||||
lz = -c.radius + frac * 2 * c.radius;
|
||||
break;
|
||||
case 2:
|
||||
lx = c.radius - frac * 2 * c.radius;
|
||||
lz = c.radius;
|
||||
break;
|
||||
default:
|
||||
lx = -c.radius;
|
||||
lz = c.radius - frac * 2 * c.radius;
|
||||
break;
|
||||
}
|
||||
float flicker = 0.3f + 0.7f * Math.abs(sin(c.time * 0.7f + idx * 3.14f));
|
||||
float lineAlpha = baseAlpha * flicker;
|
||||
@@ -506,10 +540,14 @@ public class RenderAbilityZone extends Render {
|
||||
int side = RANDOM.nextInt(4);
|
||||
double frac = RANDOM.nextDouble() * 2 - 1;
|
||||
switch (side) {
|
||||
case 0: return new double[]{frac * c.radius, -c.radius};
|
||||
case 1: return new double[]{frac * c.radius, c.radius};
|
||||
case 2: return new double[]{-c.radius, frac * c.radius};
|
||||
default: return new double[]{c.radius, frac * c.radius};
|
||||
case 0:
|
||||
return new double[]{frac * c.radius, -c.radius};
|
||||
case 1:
|
||||
return new double[]{frac * c.radius, c.radius};
|
||||
case 2:
|
||||
return new double[]{-c.radius, frac * c.radius};
|
||||
default:
|
||||
return new double[]{c.radius, frac * c.radius};
|
||||
}
|
||||
} else {
|
||||
double angle = RANDOM.nextDouble() * Math.PI * 2;
|
||||
@@ -519,9 +557,9 @@ public class RenderAbilityZone extends Render {
|
||||
}
|
||||
|
||||
private void spawnParticle(EntityAbilityZone zone, double offsetX, double offsetY, double offsetZ,
|
||||
double mx, double my, double mz,
|
||||
float r, float g, float b, float alpha,
|
||||
float scale, int maxAge, float gravity, boolean glow) {
|
||||
double mx, double my, double mz,
|
||||
float r, float g, float b, float alpha,
|
||||
float scale, int maxAge, float gravity, boolean glow) {
|
||||
ZoneParticleFX particle = new ZoneParticleFX(
|
||||
zone.worldObj,
|
||||
zone.posX + offsetX, zone.posY + offsetY, zone.posZ + offsetZ,
|
||||
@@ -587,7 +625,7 @@ public class RenderAbilityZone extends Render {
|
||||
}
|
||||
|
||||
private void renderRingLine(ZoneShape shape, float radius,
|
||||
float r, float g, float b, float a, float yOffset) {
|
||||
float r, float g, float b, float a, float yOffset) {
|
||||
switch (shape) {
|
||||
case CIRCLE:
|
||||
renderCircleRingLine(radius, r, g, b, a, yOffset);
|
||||
@@ -621,8 +659,8 @@ public class RenderAbilityZone extends Render {
|
||||
}
|
||||
|
||||
private void renderRotatingBorder(ZoneShape shape, float radius,
|
||||
float r, float g, float b, float a,
|
||||
float rotationDeg, float yOffset) {
|
||||
float r, float g, float b, float a,
|
||||
float rotationDeg, float yOffset) {
|
||||
int dashCount = 16;
|
||||
|
||||
if (shape == ZoneShape.SQUARE) {
|
||||
@@ -688,8 +726,8 @@ public class RenderAbilityZone extends Render {
|
||||
}
|
||||
|
||||
private void renderVerticalAccents(ZoneShape shape, float radius,
|
||||
float r, float g, float b, float a,
|
||||
float height, float rotationDeg) {
|
||||
float r, float g, float b, float a,
|
||||
float height, float rotationDeg) {
|
||||
if (height <= 0.1f) return;
|
||||
|
||||
Tessellator tess = Tessellator.instance;
|
||||
@@ -701,10 +739,22 @@ public class RenderAbilityZone extends Render {
|
||||
float frac = (j + 0.5f) / perSide;
|
||||
double lx, lz;
|
||||
switch (side) {
|
||||
case 0: lx = -radius + frac * 2 * radius; lz = -radius; break;
|
||||
case 1: lx = radius; lz = -radius + frac * 2 * radius; break;
|
||||
case 2: lx = radius - frac * 2 * radius; lz = radius; break;
|
||||
default: lx = -radius; lz = radius - frac * 2 * radius; break;
|
||||
case 0:
|
||||
lx = -radius + frac * 2 * radius;
|
||||
lz = -radius;
|
||||
break;
|
||||
case 1:
|
||||
lx = radius;
|
||||
lz = -radius + frac * 2 * radius;
|
||||
break;
|
||||
case 2:
|
||||
lx = radius - frac * 2 * radius;
|
||||
lz = radius;
|
||||
break;
|
||||
default:
|
||||
lx = -radius;
|
||||
lz = radius - frac * 2 * radius;
|
||||
break;
|
||||
}
|
||||
tess.startDrawing(GL11.GL_LINES);
|
||||
tess.setColorRGBA_F(r, g, b, a);
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.lwjgl.opengl.GL12;
|
||||
/**
|
||||
* Base renderer for ability projectiles.
|
||||
* Provides common GL state setup and rendering utilities.
|
||||
*
|
||||
* <p>
|
||||
* Design inspired by LouisXIV's energy rendering system.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -212,8 +212,8 @@ public abstract class RenderEnergyAbility extends Render {
|
||||
* Render a line segment as a quad billboard facing the camera.
|
||||
*/
|
||||
protected void renderLineSegment(double x1, double y1, double z1,
|
||||
double x2, double y2, double z2,
|
||||
float width, int color, float alpha) {
|
||||
double x2, double y2, double z2,
|
||||
float width, int color, float alpha) {
|
||||
float[] rgb = extractRGB(color);
|
||||
float r = rgb[0], g = rgb[1], b = rgb[2];
|
||||
|
||||
@@ -270,9 +270,10 @@ public abstract class RenderEnergyAbility extends Render {
|
||||
|
||||
/**
|
||||
* Render attached lightning arcs around an energy entity.
|
||||
* @param entity the energy entity
|
||||
*
|
||||
* @param entity the energy entity
|
||||
* @param innerScale multiplier for inner radius (e.g. 0.3f for projectiles, 0.95f for dome)
|
||||
* @param baseSize the entity's current render size/scale
|
||||
* @param baseSize the entity's current render size/scale
|
||||
*/
|
||||
protected void renderAttachedLightning(EntityEnergyAbility entity, float innerScale, float baseSize) {
|
||||
AttachedLightningRenderer.LightningState state = getLightningState(entity);
|
||||
|
||||
@@ -95,7 +95,11 @@ public class RenderEnergyDome extends RenderEnergyBarrier {
|
||||
float ny = (y1 + y1 + y2 + y2) * 0.25f;
|
||||
float nz = (z1 + z2 + z3 + z4) * 0.25f;
|
||||
float nLen = (float) Math.sqrt(nx * nx + ny * ny + nz * nz);
|
||||
if (nLen > 0) { nx /= nLen; ny /= nLen; nz /= nLen; }
|
||||
if (nLen > 0) {
|
||||
nx /= nLen;
|
||||
ny /= nLen;
|
||||
nz /= nLen;
|
||||
}
|
||||
|
||||
tess.setNormal(nx, ny, nz);
|
||||
tess.addVertex(x1, y1, z1);
|
||||
|
||||
@@ -299,8 +299,8 @@ public class TelegraphRenderer {
|
||||
* @param partialTicks Partial ticks for interpolation
|
||||
*/
|
||||
public void renderTelegraphInGUI(TelegraphInstance instance,
|
||||
double centerX, double centerY, double centerZ,
|
||||
float scale, float partialTicks) {
|
||||
double centerX, double centerY, double centerZ,
|
||||
float scale, float partialTicks) {
|
||||
if (instance == null) return;
|
||||
|
||||
Telegraph telegraph = instance.getTelegraph();
|
||||
|
||||
@@ -165,8 +165,8 @@ public class AttachedLightningRenderer {
|
||||
* Generate a jagged lightning path between two points.
|
||||
*/
|
||||
private static List<double[]> generateLightningPath(double x1, double y1, double z1,
|
||||
double x2, double y2, double z2,
|
||||
int segments, float displacement) {
|
||||
double x2, double y2, double z2,
|
||||
int segments, float displacement) {
|
||||
List<double[]> points = new ArrayList<>();
|
||||
points.add(new double[]{x1, y1, z1});
|
||||
|
||||
@@ -257,8 +257,8 @@ public class AttachedLightningRenderer {
|
||||
* Create a lightning arc between two arbitrary points.
|
||||
*/
|
||||
public static LightningArc createArcBetween(double x1, double y1, double z1,
|
||||
double x2, double y2, double z2,
|
||||
float displacement, int outerColor, int innerColor, int maxAge) {
|
||||
double x2, double y2, double z2,
|
||||
float displacement, int outerColor, int innerColor, int maxAge) {
|
||||
int segments = 4 + rand.nextInt(3);
|
||||
List<double[]> points = generateLightningPath(x1, y1, z1, x2, y2, z2, segments, displacement);
|
||||
return new LightningArc(points, maxAge, outerColor, innerColor);
|
||||
|
||||
@@ -243,7 +243,7 @@ public class LightningBolt {
|
||||
|
||||
public Segment(Vec3d start, Vec3d end) {
|
||||
this(new BoltPoint(start, new Vec3d(0, 0, 0)),
|
||||
new BoltPoint(end, new Vec3d(0, 0, 0)), 1, 0, 0);
|
||||
new BoltPoint(end, new Vec3d(0, 0, 0)), 1, 0, 0);
|
||||
}
|
||||
|
||||
public void calcDiff() {
|
||||
|
||||
@@ -5,7 +5,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.client.renderer.lightning.LightningBolt.Segment;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -19,7 +18,7 @@ import java.awt.Color;
|
||||
/**
|
||||
* Handles rendering of lightning bolts in the world.
|
||||
* Adapted from Botania's LightningHandler by Vazkii/ChickenBones.
|
||||
*
|
||||
* <p>
|
||||
* Register this handler with: MinecraftForge.EVENT_BUS.register(new LightningHandler());
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -168,13 +167,13 @@ public class LightningHandler {
|
||||
/**
|
||||
* Spawn a lightning bolt between two points.
|
||||
*
|
||||
* @param world The world
|
||||
* @param start Start position
|
||||
* @param end End position
|
||||
* @param world The world
|
||||
* @param start Start position
|
||||
* @param end End position
|
||||
* @param ticksPerMeter Speed of bolt expansion
|
||||
* @param seed Random seed for consistent appearance
|
||||
* @param colorOuter Outer glow color (ARGB)
|
||||
* @param colorInner Inner core color (ARGB)
|
||||
* @param seed Random seed for consistent appearance
|
||||
* @param colorOuter Outer glow color (ARGB)
|
||||
* @param colorInner Inner core color (ARGB)
|
||||
*/
|
||||
public static void spawnLightningBolt(World world, Vec3d start, Vec3d end, float ticksPerMeter, long seed, int colorOuter, int colorInner) {
|
||||
LightningBolt bolt = new LightningBolt(world, start, end, ticksPerMeter, seed, colorOuter, colorInner);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package kamkeel.npcs.command;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.ChainedAbility;
|
||||
import kamkeel.npcs.controllers.data.ability.UserType;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
|
||||
@@ -11,7 +11,13 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public abstract class CommandKamkeelBase extends CommandBase {
|
||||
public Map<String, Method> subcommands = new HashMap<String, Method>();
|
||||
|
||||
@@ -9,7 +9,19 @@ import kamkeel.npcs.controllers.data.ability.IAbilityExtender;
|
||||
import kamkeel.npcs.controllers.data.ability.IAbilityFieldProvider;
|
||||
import kamkeel.npcs.controllers.data.ability.IChainedAbilityFieldProvider;
|
||||
import kamkeel.npcs.controllers.data.ability.UserType;
|
||||
import kamkeel.npcs.controllers.data.ability.type.*;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityCharge;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityCutter;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityDash;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityGuard;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityHazard;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityHeal;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityHeavyHit;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityProjectile;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityShockwave;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilitySlam;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityTeleport;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityTrap;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityVortex;
|
||||
import kamkeel.npcs.controllers.data.ability.type.energy.AbilityBeam;
|
||||
import kamkeel.npcs.controllers.data.ability.type.energy.AbilityDisc;
|
||||
import kamkeel.npcs.controllers.data.ability.type.energy.AbilityDome;
|
||||
@@ -20,16 +32,22 @@ import kamkeel.npcs.controllers.data.ability.type.energy.AbilitySlicer;
|
||||
import kamkeel.npcs.controllers.data.ability.type.energy.AbilitySweeper;
|
||||
import kamkeel.npcs.controllers.data.ability.type.energy.AbilityWall;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.api.handler.IAbilityHandler;
|
||||
import noppes.npcs.util.NBTJsonUtil;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -794,7 +812,8 @@ public class AbilityController implements IAbilityHandler {
|
||||
// If no built-in variants exist but external ones do,
|
||||
// inject a "Base" variant so the user always gets a choice
|
||||
if (result.isEmpty()) {
|
||||
result.add(new AbilityVariant("ability.variant.base", a -> {}));
|
||||
result.add(new AbilityVariant("ability.variant.base", a -> {
|
||||
}));
|
||||
}
|
||||
result.addAll(ext);
|
||||
}
|
||||
@@ -880,7 +899,7 @@ public class AbilityController implements IAbilityHandler {
|
||||
double knockbackDirX, double knockbackDirZ) {
|
||||
for (IAbilityExtender ext : extenders) {
|
||||
if (ext.onAbilityDamage(ability, caster, target, damage, knockback, knockbackUp,
|
||||
knockbackDirX, knockbackDirZ)) {
|
||||
knockbackDirX, knockbackDirZ)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import kamkeel.npcs.addon.DBCAddon;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.ChainedAbility;
|
||||
import kamkeel.npcs.network.LargeAbstractPacket;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
import kamkeel.npcs.network.enums.EnumSyncAction;
|
||||
@@ -39,8 +41,6 @@ import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.controllers.data.QuestCategory;
|
||||
import noppes.npcs.controllers.data.RecipeAnvil;
|
||||
import noppes.npcs.controllers.data.RecipeCarpentry;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.ChainedAbility;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.EnumMap;
|
||||
|
||||
@@ -7,38 +7,36 @@ import kamkeel.npcs.controllers.data.telegraph.Telegraph;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphInstance;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.DataAbilities;
|
||||
import noppes.npcs.NpcDamageSource;
|
||||
import noppes.npcs.api.INbt;
|
||||
import noppes.npcs.api.ability.IAbility;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.client.gui.advanced.SubGuiAbilityConfig;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import noppes.npcs.client.gui.util.IAbilityConfigCallback;
|
||||
import noppes.npcs.controllers.AnimationController;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import noppes.npcs.controllers.data.Frame;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
import noppes.npcs.controllers.data.Frame;
|
||||
import noppes.npcs.controllers.data.PlayerDataScript;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.event.AbilityEvent;
|
||||
import noppes.npcs.scripted.event.player.PlayerAbilityEvent;
|
||||
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public abstract class Ability implements IAbility, IAbilityAction {
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
@@ -115,10 +113,14 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
// TOGGLE CONFIGURATION (saved to NBT for custom abilities)
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
|
||||
/** Whether this ability is a toggle (ON/OFF) rather than a phased execution */
|
||||
/**
|
||||
* Whether this ability is a toggle (ON/OFF) rather than a phased execution
|
||||
*/
|
||||
protected boolean toggleable = false;
|
||||
|
||||
/** Whether the toggled-ON state ticks each game tick (e.g., Kaioken drains ki per tick) */
|
||||
/**
|
||||
* Whether the toggled-ON state ticks each game tick (e.g., Kaioken drains ki per tick)
|
||||
*/
|
||||
protected boolean hasActiveToggle = false;
|
||||
|
||||
// Configurable potion effects
|
||||
@@ -232,17 +234,20 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
* Called when this toggle ability is turned ON for an entity.
|
||||
* Override to apply effects (e.g., set a DBC flag, apply a buff).
|
||||
*/
|
||||
public void onToggleOn(EntityLivingBase caster) {}
|
||||
public void onToggleOn(EntityLivingBase caster) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this toggle ability is turned OFF for an entity.
|
||||
* Override to remove effects (e.g., clear a DBC flag, remove a buff).
|
||||
*/
|
||||
public void onToggleOff(EntityLivingBase caster) {}
|
||||
public void onToggleOff(EntityLivingBase caster) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called every tick while this toggle is active (only if hasActiveToggle is true).
|
||||
* Override for per-tick effects (e.g., ki drain for Kaioken).
|
||||
*
|
||||
* @return true to keep the toggle active, false to auto-deactivate
|
||||
*/
|
||||
public boolean onToggleTick(EntityLivingBase caster, int tickCount) {
|
||||
@@ -252,6 +257,7 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
/**
|
||||
* Whether this ability is ready for auto-completion during burst overlap mode.
|
||||
* Override to delay auto-completion until all staggered projectiles have been fired.
|
||||
*
|
||||
* @param activeTick the current tick within the ACTIVE phase
|
||||
*/
|
||||
public boolean isReadyForBurstCompletion(int activeTick) {
|
||||
@@ -554,27 +560,36 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
() -> this.getLockMovement().getDisplayKey(),
|
||||
v -> {
|
||||
for (LockMovementType t : LockMovementType.values()) {
|
||||
if (t.getDisplayKey().equals(v)) { this.setLockMovement(t); break; }
|
||||
if (t.getDisplayKey().equals(v)) {
|
||||
this.setLockMovement(t);
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
.hover("ability.hover.lockMovement")
|
||||
.tab("General"));
|
||||
.hover("ability.hover.lockMovement")
|
||||
.tab("General"));
|
||||
defs.add(FieldDef.row(
|
||||
FieldDef.stringEnumField("ability.rotationMode", RotationMode.getDisplayKeys(),
|
||||
() -> this.getRotationMode().getDisplayKey(),
|
||||
v -> {
|
||||
for (RotationMode m : RotationMode.values()) {
|
||||
if (m.getDisplayKey().equals(v)) { this.setRotationMode(m); break; }
|
||||
}
|
||||
})
|
||||
() -> this.getRotationMode().getDisplayKey(),
|
||||
v -> {
|
||||
for (RotationMode m : RotationMode.values()) {
|
||||
if (m.getDisplayKey().equals(v)) {
|
||||
this.setRotationMode(m);
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
.hover("ability.hover.rotationMode"),
|
||||
FieldDef.stringEnumField("ability.rotationPhase", getRotationPhaseKeys(),
|
||||
() -> this.getRotationPhase().getDisplayKey(),
|
||||
v -> {
|
||||
for (LockMovementType t : LockMovementType.values()) {
|
||||
if (t.getDisplayKey().equals(v)) { this.setRotationPhase(t); break; }
|
||||
}
|
||||
})
|
||||
() -> this.getRotationPhase().getDisplayKey(),
|
||||
v -> {
|
||||
for (LockMovementType t : LockMovementType.values()) {
|
||||
if (t.getDisplayKey().equals(v)) {
|
||||
this.setRotationPhase(t);
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
.hover("ability.hover.rotationPhase")
|
||||
.visibleWhen(() -> this.rotationMode != RotationMode.FREE)
|
||||
).tab("General"));
|
||||
@@ -617,15 +632,17 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
allowedKeys[i] = allowed[i].name();
|
||||
}
|
||||
defs.add(FieldDef.stringEnumField("ability.targetingMode", allowedKeys,
|
||||
() -> this.getTargetingMode().name(),
|
||||
v -> {
|
||||
try { this.setTargetingMode(TargetingMode.valueOf(v)); }
|
||||
catch (Exception ignored) {}
|
||||
})
|
||||
() -> this.getTargetingMode().name(),
|
||||
v -> {
|
||||
try {
|
||||
this.setTargetingMode(TargetingMode.valueOf(v));
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
})
|
||||
.tab("Target").hover("ability.hover.targeting"));
|
||||
} else {
|
||||
defs.add(FieldDef.enumField("ability.targetingMode", TargetingMode.class,
|
||||
this::getTargetingMode, this::setTargetingMode)
|
||||
this::getTargetingMode, this::setTargetingMode)
|
||||
.tab("Target").hover("ability.hover.targeting"));
|
||||
}
|
||||
}
|
||||
@@ -638,12 +655,12 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
.tab("Effects"));
|
||||
defs.add(FieldDef.section("ability.section.animations").tab("Effects"));
|
||||
defs.add(FieldDef.animSubGui("ability.windUpAnimation",
|
||||
this::getWindUpAnimationId, this::setWindUpAnimationId,
|
||||
this::getWindUpAnimationName, this::setWindUpAnimationName)
|
||||
this::getWindUpAnimationId, this::setWindUpAnimationId,
|
||||
this::getWindUpAnimationName, this::setWindUpAnimationName)
|
||||
.tab("Effects"));
|
||||
defs.add(FieldDef.animSubGui("ability.activeAnimation",
|
||||
this::getActiveAnimationId, this::setActiveAnimationId,
|
||||
this::getActiveAnimationName, this::setActiveAnimationName)
|
||||
this::getActiveAnimationId, this::setActiveAnimationId,
|
||||
this::getActiveAnimationName, this::setActiveAnimationName)
|
||||
.tab("Effects"));
|
||||
defs.add(FieldDef.animSubGui("ability.dazedAnimation",
|
||||
this::getDazedAnimationId, this::setDazedAnimationId,
|
||||
@@ -699,7 +716,7 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
* Create a telegraph instance for this ability.
|
||||
* Override for custom telegraph shapes.
|
||||
*
|
||||
* @param caster The caster
|
||||
* @param caster The caster
|
||||
* @param target The target (for position calculation)
|
||||
* @return The telegraph instance, or null if no telegraph
|
||||
*/
|
||||
@@ -1514,6 +1531,7 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
|
||||
/**
|
||||
* API method: Get lock movement type as integer.
|
||||
*
|
||||
* @return 0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE
|
||||
*/
|
||||
@Override
|
||||
@@ -1523,6 +1541,7 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
|
||||
/**
|
||||
* API method: Set lock movement type from integer.
|
||||
*
|
||||
* @param type 0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE
|
||||
*/
|
||||
@Override
|
||||
@@ -1532,6 +1551,7 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
|
||||
/**
|
||||
* API method: Get rotation mode as integer.
|
||||
*
|
||||
* @return 0=FREE, 1=LOCKED, 2=TRACK
|
||||
*/
|
||||
@Override
|
||||
@@ -1541,6 +1561,7 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
|
||||
/**
|
||||
* API method: Set rotation mode from integer.
|
||||
*
|
||||
* @param type 0=FREE, 1=LOCKED, 2=TRACK
|
||||
*/
|
||||
@Override
|
||||
@@ -1550,6 +1571,7 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
|
||||
/**
|
||||
* API method: Get rotation phase as integer.
|
||||
*
|
||||
* @return 0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE
|
||||
*/
|
||||
@Override
|
||||
@@ -1559,6 +1581,7 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
|
||||
/**
|
||||
* API method: Set rotation phase from integer.
|
||||
*
|
||||
* @param type 0=NO, 1=WINDUP, 2=ACTIVE, 3=WINDUP_AND_ACTIVE
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -24,14 +24,17 @@ public class AbilityAction {
|
||||
private ChainedAbility inlineChain;
|
||||
private String referenceId;
|
||||
|
||||
/** Per-slot enabled override for reference slots (null = use master's default). */
|
||||
/**
|
||||
* Per-slot enabled override for reference slots (null = use master's default).
|
||||
*/
|
||||
private Boolean enabledOverride;
|
||||
|
||||
// Cache
|
||||
private transient IAbilityAction cachedAction;
|
||||
private transient int cachedRevision = -1;
|
||||
|
||||
private AbilityAction() {}
|
||||
private AbilityAction() {
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
// FACTORY METHODS
|
||||
|
||||
@@ -18,13 +18,16 @@ public class AbilitySlot {
|
||||
private Ability inlineAbility;
|
||||
private String referenceId;
|
||||
|
||||
/** Per-slot enabled override for reference slots (null = use master's default). */
|
||||
/**
|
||||
* Per-slot enabled override for reference slots (null = use master's default).
|
||||
*/
|
||||
private Boolean enabledOverride;
|
||||
|
||||
private transient Ability cachedAbility;
|
||||
private transient int cachedVersion = -1;
|
||||
|
||||
private AbilitySlot() {}
|
||||
private AbilitySlot() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a slot with an inline (embedded) ability.
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.function.Consumer;
|
||||
* Represents a variant/template for an ability type.
|
||||
* When a user creates an ability that has registered variants,
|
||||
* they are presented with a selection dialog before the ability is created.
|
||||
*
|
||||
* <p>
|
||||
* Each variant has a display name (lang key) and a configurator that
|
||||
* applies preset values to the newly created ability.
|
||||
*/
|
||||
|
||||
@@ -50,14 +50,22 @@ public enum AnchorPoint {
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (this) {
|
||||
case FRONT: return "ability.anchor.front";
|
||||
case CENTER: return "ability.anchor.center";
|
||||
case RIGHT_HAND: return "ability.anchor.rightHand";
|
||||
case LEFT_HAND: return "ability.anchor.leftHand";
|
||||
case ABOVE_HEAD: return "ability.anchor.aboveHead";
|
||||
case CHEST: return "ability.anchor.chest";
|
||||
case EYE: return "ability.anchor.eye";
|
||||
default: return name();
|
||||
case FRONT:
|
||||
return "ability.anchor.front";
|
||||
case CENTER:
|
||||
return "ability.anchor.center";
|
||||
case RIGHT_HAND:
|
||||
return "ability.anchor.rightHand";
|
||||
case LEFT_HAND:
|
||||
return "ability.anchor.leftHand";
|
||||
case ABOVE_HEAD:
|
||||
return "ability.anchor.aboveHead";
|
||||
case CHEST:
|
||||
return "ability.anchor.chest";
|
||||
case EYE:
|
||||
return "ability.anchor.eye";
|
||||
default:
|
||||
return name();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,31 +29,48 @@ public class ChainedAbility implements IChainedAbility, IAbilityAction {
|
||||
|
||||
private boolean enabled = true;
|
||||
|
||||
/** Weight for NPC weighted random selection. */
|
||||
/**
|
||||
* Weight for NPC weighted random selection.
|
||||
*/
|
||||
private int weight = 10;
|
||||
|
||||
/** Whether each ability in the chain uses its own windup phase. */
|
||||
/**
|
||||
* Whether each ability in the chain uses its own windup phase.
|
||||
*/
|
||||
private boolean windUpAll = true;
|
||||
|
||||
/** Chain-level cooldown in ticks (applied after entire chain completes). */
|
||||
/**
|
||||
* Chain-level cooldown in ticks (applied after entire chain completes).
|
||||
*/
|
||||
private int cooldownTicks = 100;
|
||||
|
||||
/** Minimum range for NPC eligibility check. */
|
||||
/**
|
||||
* Minimum range for NPC eligibility check.
|
||||
*/
|
||||
private float minRange = 0;
|
||||
|
||||
/** Maximum range for NPC eligibility check. */
|
||||
/**
|
||||
* Maximum range for NPC eligibility check.
|
||||
*/
|
||||
private float maxRange = 20;
|
||||
|
||||
/** Chain-level conditions (individual ability conditions are ignored). */
|
||||
/**
|
||||
* Chain-level conditions (individual ability conditions are ignored).
|
||||
*/
|
||||
private List<Condition> conditions = new ArrayList<>();
|
||||
|
||||
/** Ordered list of ability entries to execute. */
|
||||
/**
|
||||
* Ordered list of ability entries to execute.
|
||||
*/
|
||||
private List<ChainedAbilityEntry> entries = new ArrayList<>();
|
||||
|
||||
/** Extension data for external mods (e.g., icons, DBC stats). */
|
||||
/**
|
||||
* Extension data for external mods (e.g., icons, DBC stats).
|
||||
*/
|
||||
private NBTTagCompound customData = new NBTTagCompound();
|
||||
|
||||
public ChainedAbility() {}
|
||||
public ChainedAbility() {
|
||||
}
|
||||
|
||||
public ChainedAbility(String name) {
|
||||
this.name = name != null ? name : "";
|
||||
|
||||
@@ -12,20 +12,27 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
*/
|
||||
public class ChainedAbilityEntry {
|
||||
|
||||
public enum EntryType { REFERENCE, INLINE }
|
||||
public enum EntryType {REFERENCE, INLINE}
|
||||
|
||||
private EntryType entryType = EntryType.REFERENCE;
|
||||
|
||||
/** Reference key (built-in name or custom ability name). Used when entryType == REFERENCE. */
|
||||
/**
|
||||
* Reference key (built-in name or custom ability name). Used when entryType == REFERENCE.
|
||||
*/
|
||||
private String abilityReference = "";
|
||||
|
||||
/** Inline ability data. Used when entryType == INLINE. */
|
||||
/**
|
||||
* Inline ability data. Used when entryType == INLINE.
|
||||
*/
|
||||
private Ability inlineAbility = null;
|
||||
|
||||
/** Delay in ticks BEFORE this ability starts (after previous entry completes). */
|
||||
/**
|
||||
* Delay in ticks BEFORE this ability starts (after previous entry completes).
|
||||
*/
|
||||
private int delayTicks = 0;
|
||||
|
||||
public ChainedAbilityEntry() {}
|
||||
public ChainedAbilityEntry() {
|
||||
}
|
||||
|
||||
public ChainedAbilityEntry(String abilityReference, int delayTicks) {
|
||||
this.entryType = EntryType.REFERENCE;
|
||||
|
||||
@@ -9,5 +9,6 @@ import net.minecraft.entity.Entity;
|
||||
*/
|
||||
public interface PreviewEntityHandler {
|
||||
void onEntitySpawned(Entity entity);
|
||||
|
||||
void onEntityRemoved(Entity entity);
|
||||
}
|
||||
@@ -27,11 +27,16 @@ public enum TargetingMode {
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (this) {
|
||||
case AGGRO_TARGET: return "ability.target.aggro_target";
|
||||
case SELF: return "ability.target.self";
|
||||
case AOE_SELF: return "ability.target.aoe_self";
|
||||
case AOE_TARGET: return "ability.target.aoe_target";
|
||||
default: return name();
|
||||
case AGGRO_TARGET:
|
||||
return "ability.target.aggro_target";
|
||||
case SELF:
|
||||
return "ability.target.self";
|
||||
case AOE_SELF:
|
||||
return "ability.target.aoe_self";
|
||||
case AOE_TARGET:
|
||||
return "ability.target.aoe_target";
|
||||
default:
|
||||
return name();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,9 @@ public class EnergyBarrierData {
|
||||
// Knockback settings
|
||||
public boolean knockbackEnabled = false;
|
||||
public float knockbackStrength = 1.0f;
|
||||
/** 0=Both, 1=Player only, 2=NPC only */
|
||||
/**
|
||||
* 0=Both, 1=Player only, 2=NPC only
|
||||
*/
|
||||
public int knockbackTarget = 0;
|
||||
|
||||
// Melee settings
|
||||
@@ -36,7 +38,8 @@ public class EnergyBarrierData {
|
||||
*/
|
||||
private Map<String, Float> damageMultipliers = new HashMap<>();
|
||||
|
||||
public EnergyBarrierData() {}
|
||||
public EnergyBarrierData() {
|
||||
}
|
||||
|
||||
public EnergyBarrierData(float maxHealth, boolean useHealth, int durationTicks, boolean useDuration) {
|
||||
this.maxHealth = maxHealth;
|
||||
@@ -70,23 +73,50 @@ public class EnergyBarrierData {
|
||||
|
||||
// ==================== GETTERS & SETTERS ====================
|
||||
|
||||
public float getMaxHealth() { return maxHealth; }
|
||||
public void setMaxHealth(float maxHealth) { this.maxHealth = Math.max(0, maxHealth); }
|
||||
public float getMaxHealth() {
|
||||
return maxHealth;
|
||||
}
|
||||
|
||||
public boolean isUseHealth() { return useHealth; }
|
||||
public void setUseHealth(boolean useHealth) { this.useHealth = useHealth; }
|
||||
public void setMaxHealth(float maxHealth) {
|
||||
this.maxHealth = Math.max(0, maxHealth);
|
||||
}
|
||||
|
||||
public int getDurationTicks() { return durationTicks; }
|
||||
public void setDurationTicks(int durationTicks) { this.durationTicks = Math.max(1, durationTicks); }
|
||||
public boolean isUseHealth() {
|
||||
return useHealth;
|
||||
}
|
||||
|
||||
public boolean isUseDuration() { return useDuration; }
|
||||
public void setUseDuration(boolean useDuration) { this.useDuration = useDuration; }
|
||||
public void setUseHealth(boolean useHealth) {
|
||||
this.useHealth = useHealth;
|
||||
}
|
||||
|
||||
public float getDefaultMultiplier() { return defaultMultiplier; }
|
||||
public void setDefaultMultiplier(float defaultMultiplier) { this.defaultMultiplier = defaultMultiplier; }
|
||||
public int getDurationTicks() {
|
||||
return durationTicks;
|
||||
}
|
||||
|
||||
public void setDurationTicks(int durationTicks) {
|
||||
this.durationTicks = Math.max(1, durationTicks);
|
||||
}
|
||||
|
||||
public boolean isUseDuration() {
|
||||
return useDuration;
|
||||
}
|
||||
|
||||
public void setUseDuration(boolean useDuration) {
|
||||
this.useDuration = useDuration;
|
||||
}
|
||||
|
||||
public float getDefaultMultiplier() {
|
||||
return defaultMultiplier;
|
||||
}
|
||||
|
||||
public void setDefaultMultiplier(float defaultMultiplier) {
|
||||
this.defaultMultiplier = defaultMultiplier;
|
||||
}
|
||||
|
||||
// Knockback target key helpers
|
||||
public static String[] getKnockbackTargetKeys() { return KNOCKBACK_TARGET_KEYS; }
|
||||
public static String[] getKnockbackTargetKeys() {
|
||||
return KNOCKBACK_TARGET_KEYS;
|
||||
}
|
||||
|
||||
public String getKnockbackTargetKey() {
|
||||
return KNOCKBACK_TARGET_KEYS[Math.max(0, Math.min(knockbackTarget, 2))];
|
||||
|
||||
@@ -15,7 +15,8 @@ public class EnergyCombatData implements IEnergyCombatData {
|
||||
public float explosionRadius = 3.0f;
|
||||
public float explosionDamageFalloff = 0.5f;
|
||||
|
||||
public EnergyCombatData() {}
|
||||
public EnergyCombatData() {
|
||||
}
|
||||
|
||||
public EnergyCombatData(float damage, float knockback, float knockbackUp,
|
||||
boolean explosive, float explosionRadius, float explosionDamageFalloff) {
|
||||
|
||||
@@ -20,7 +20,8 @@ public class EnergyDisplayData implements IEnergyDisplayData {
|
||||
// public boolean skyboxEnabled = false;
|
||||
// public String skyboxTexture = "";
|
||||
|
||||
public EnergyDisplayData() {}
|
||||
public EnergyDisplayData() {
|
||||
}
|
||||
|
||||
public EnergyDisplayData(int innerColor, int outerColor) {
|
||||
this.innerColor = innerColor;
|
||||
|
||||
@@ -14,7 +14,8 @@ public class EnergyHomingData implements IEnergyHomingData {
|
||||
public float homingStrength = 0.15f;
|
||||
public float homingRange = 20.0f;
|
||||
|
||||
public EnergyHomingData() {}
|
||||
public EnergyHomingData() {
|
||||
}
|
||||
|
||||
public EnergyHomingData(float speed, boolean homing, float homingStrength, float homingRange) {
|
||||
this.speed = speed;
|
||||
|
||||
@@ -11,7 +11,8 @@ public class EnergyLifespanData implements IEnergyLifespanData {
|
||||
public float maxDistance = 30.0f;
|
||||
public int maxLifetime = 200;
|
||||
|
||||
public EnergyLifespanData() {}
|
||||
public EnergyLifespanData() {
|
||||
}
|
||||
|
||||
public EnergyLifespanData(float maxDistance, int maxLifetime) {
|
||||
this.maxDistance = maxDistance;
|
||||
|
||||
@@ -13,7 +13,8 @@ public class EnergyLightningData implements IEnergyLightningData {
|
||||
public float lightningRadius = 0.5f;
|
||||
public int lightningFadeTime = 6;
|
||||
|
||||
public EnergyLightningData() {}
|
||||
public EnergyLightningData() {
|
||||
}
|
||||
|
||||
public EnergyLightningData(boolean lightningEffect, float lightningDensity,
|
||||
float lightningRadius, int lightningFadeTime) {
|
||||
|
||||
@@ -17,7 +17,8 @@ public class EnergyPanelData {
|
||||
public float launchDamage = 8.0f;
|
||||
public float launchKnockback = 2.0f;
|
||||
|
||||
public EnergyPanelData() {}
|
||||
public EnergyPanelData() {
|
||||
}
|
||||
|
||||
public EnergyPanelData(float panelWidth, float panelHeight, float heightOffset) {
|
||||
this.panelWidth = panelWidth;
|
||||
@@ -27,26 +28,61 @@ public class EnergyPanelData {
|
||||
|
||||
// ==================== GETTERS & SETTERS ====================
|
||||
|
||||
public float getPanelWidth() { return panelWidth; }
|
||||
public void setPanelWidth(float panelWidth) { this.panelWidth = Math.max(0.5f, panelWidth); }
|
||||
public float getPanelWidth() {
|
||||
return panelWidth;
|
||||
}
|
||||
|
||||
public float getPanelHeight() { return panelHeight; }
|
||||
public void setPanelHeight(float panelHeight) { this.panelHeight = Math.max(0.5f, panelHeight); }
|
||||
public void setPanelWidth(float panelWidth) {
|
||||
this.panelWidth = Math.max(0.5f, panelWidth);
|
||||
}
|
||||
|
||||
public float getHeightOffset() { return heightOffset; }
|
||||
public void setHeightOffset(float heightOffset) { this.heightOffset = heightOffset; }
|
||||
public float getPanelHeight() {
|
||||
return panelHeight;
|
||||
}
|
||||
|
||||
public boolean isLaunching() { return launching; }
|
||||
public void setLaunching(boolean launching) { this.launching = launching; }
|
||||
public void setPanelHeight(float panelHeight) {
|
||||
this.panelHeight = Math.max(0.5f, panelHeight);
|
||||
}
|
||||
|
||||
public float getLaunchSpeed() { return launchSpeed; }
|
||||
public void setLaunchSpeed(float launchSpeed) { this.launchSpeed = Math.max(0.1f, launchSpeed); }
|
||||
public float getHeightOffset() {
|
||||
return heightOffset;
|
||||
}
|
||||
|
||||
public float getLaunchDamage() { return launchDamage; }
|
||||
public void setLaunchDamage(float launchDamage) { this.launchDamage = Math.max(0, launchDamage); }
|
||||
public void setHeightOffset(float heightOffset) {
|
||||
this.heightOffset = heightOffset;
|
||||
}
|
||||
|
||||
public float getLaunchKnockback() { return launchKnockback; }
|
||||
public void setLaunchKnockback(float launchKnockback) { this.launchKnockback = Math.max(0, launchKnockback); }
|
||||
public boolean isLaunching() {
|
||||
return launching;
|
||||
}
|
||||
|
||||
public void setLaunching(boolean launching) {
|
||||
this.launching = launching;
|
||||
}
|
||||
|
||||
public float getLaunchSpeed() {
|
||||
return launchSpeed;
|
||||
}
|
||||
|
||||
public void setLaunchSpeed(float launchSpeed) {
|
||||
this.launchSpeed = Math.max(0.1f, launchSpeed);
|
||||
}
|
||||
|
||||
public float getLaunchDamage() {
|
||||
return launchDamage;
|
||||
}
|
||||
|
||||
public void setLaunchDamage(float launchDamage) {
|
||||
this.launchDamage = Math.max(0, launchDamage);
|
||||
}
|
||||
|
||||
public float getLaunchKnockback() {
|
||||
return launchKnockback;
|
||||
}
|
||||
|
||||
public void setLaunchKnockback(float launchKnockback) {
|
||||
this.launchKnockback = Math.max(0, launchKnockback);
|
||||
}
|
||||
|
||||
// ==================== NBT ====================
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@ public class EnergyTrajectoryData implements IEnergyTrajectoryData {
|
||||
public int currentPath = 0;
|
||||
private final List<Path> trajectory = new ArrayList<>();
|
||||
|
||||
public EnergyTrajectoryData() {}
|
||||
public EnergyTrajectoryData() {
|
||||
}
|
||||
|
||||
public EnergyTrajectoryData(int startingPath, Path... paths) {
|
||||
trajectory.addAll(Arrays.asList(paths));
|
||||
@@ -85,6 +86,7 @@ public class EnergyTrajectoryData implements IEnergyTrajectoryData {
|
||||
IPath p = getPath(path);
|
||||
return p == null ? 0 : p.getZ();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setX(int path, double x) {
|
||||
IPath p = getPath(path);
|
||||
@@ -126,8 +128,8 @@ public class EnergyTrajectoryData implements IEnergyTrajectoryData {
|
||||
@Override
|
||||
public void setPath(int path, double x, double y, double z, int delay) {
|
||||
Path newPath = new Path(
|
||||
NpcAPI.Instance().getIPos(x, y, z),
|
||||
delay
|
||||
NpcAPI.Instance().getIPos(x, y, z),
|
||||
delay
|
||||
);
|
||||
|
||||
while (trajectory.size() <= path) {
|
||||
@@ -196,7 +198,7 @@ public class EnergyTrajectoryData implements IEnergyTrajectoryData {
|
||||
}
|
||||
}
|
||||
|
||||
public static class Path implements IEnergyTrajectoryData.IPath{
|
||||
public static class Path implements IEnergyTrajectoryData.IPath {
|
||||
public IPos pos;
|
||||
public int delayTicks;
|
||||
public boolean concluded;
|
||||
|
||||
@@ -199,5 +199,7 @@ public class AbilityFieldBuilder extends GuiFieldBuilder {
|
||||
return super.handleTextFieldEvent(textFieldId, field);
|
||||
}
|
||||
|
||||
public Map<Integer, int[]> getEffectWidgetMeta() { return effectWidgetMeta; }
|
||||
public Map<Integer, int[]> getEffectWidgetMeta() {
|
||||
return effectWidgetMeta;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import kamkeel.npcs.controllers.data.telegraph.Telegraph;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphInstance;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
@@ -11,10 +12,8 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import noppes.npcs.api.ability.type.IAbilityCharge;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package kamkeel.npcs.controllers.data.ability.type;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import kamkeel.npcs.controllers.data.telegraph.Telegraph;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphInstance;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
@@ -11,15 +14,8 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import noppes.npcs.api.ability.type.IAbilityCutter;
|
||||
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
@@ -40,9 +36,12 @@ public class AbilityCutter extends Ability implements IAbilityCutter {
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (this) {
|
||||
case SWIPE: return "ability.sweep.swipe";
|
||||
case SPIN: return "ability.sweep.spin";
|
||||
default: return name();
|
||||
case SWIPE:
|
||||
return "ability.sweep.swipe";
|
||||
case SPIN:
|
||||
return "ability.sweep.spin";
|
||||
default:
|
||||
return name();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -232,7 +231,7 @@ public class AbilityCutter extends Ability implements IAbilityCutter {
|
||||
* For SWIPE mode, this covers the continuous arc from startAngle to endAngle.
|
||||
*/
|
||||
private void performSweepDamageRange(EntityLivingBase caster, World world, float minDist, float maxDist,
|
||||
float startAngle, float endAngle) {
|
||||
float startAngle, float endAngle) {
|
||||
// Calculate the angular range covered this tick
|
||||
float minAngle = Math.min(startAngle, endAngle);
|
||||
float maxAngle = Math.max(startAngle, endAngle);
|
||||
|
||||
@@ -8,9 +8,8 @@ import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import noppes.npcs.api.ability.type.IAbilityDash;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -32,9 +31,12 @@ public class AbilityDash extends AbilityMovement implements IAbilityDash {
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (this) {
|
||||
case AGGRESSIVE: return "ability.dash.aggressive";
|
||||
case DEFENSIVE: return "ability.dash.defensive";
|
||||
default: return name();
|
||||
case AGGRESSIVE:
|
||||
return "ability.dash.aggressive";
|
||||
case DEFENSIVE:
|
||||
return "ability.dash.defensive";
|
||||
default:
|
||||
return name();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,26 @@
|
||||
package kamkeel.npcs.controllers.data.ability.type;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.*;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityPhase;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
import kamkeel.npcs.controllers.data.ability.UserType;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.api.ability.type.IAbilityGuard;
|
||||
import noppes.npcs.api.handler.data.IAnimation;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import noppes.npcs.controllers.AnimationController;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import noppes.npcs.api.ability.type.IAbilityGuard;
|
||||
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -77,9 +78,12 @@ public class AbilityGuard extends Ability implements IAbilityGuard {
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (this) {
|
||||
case FLAT: return "ability.counter.flat";
|
||||
case PERCENT: return "ability.counter.percent";
|
||||
default: return name();
|
||||
case FLAT:
|
||||
return "ability.counter.flat";
|
||||
case PERCENT:
|
||||
return "ability.counter.percent";
|
||||
default:
|
||||
return name();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
package kamkeel.npcs.controllers.data.ability.type;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import kamkeel.npcs.entity.EntityAbilityZone;
|
||||
import kamkeel.npcs.entity.EntityAbilityZone.ZoneShape;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
|
||||
import noppes.npcs.api.ability.type.IAbilityHazard;
|
||||
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -106,20 +102,45 @@ public class AbilityHazard extends AbilityZone implements IAbilityHazard {
|
||||
this.affectsCaster = nbt.getBoolean("affectsCaster");
|
||||
}
|
||||
|
||||
public float getRadius() { return radius; }
|
||||
public void setRadius(float radius) { this.radius = radius; }
|
||||
public float getRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
public float getDamagePerSecond() { return damagePerSecond; }
|
||||
public void setDamagePerSecond(float damagePerSecond) { this.damagePerSecond = damagePerSecond; }
|
||||
public void setRadius(float radius) {
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public int getDamageInterval() { return damageInterval; }
|
||||
public void setDamageInterval(int damageInterval) { this.damageInterval = damageInterval; }
|
||||
public float getDamagePerSecond() {
|
||||
return damagePerSecond;
|
||||
}
|
||||
|
||||
public boolean isIgnoreInvulnFrames() { return ignoreInvulnFrames; }
|
||||
public void setIgnoreInvulnFrames(boolean ignoreInvulnFrames) { this.ignoreInvulnFrames = ignoreInvulnFrames; }
|
||||
public void setDamagePerSecond(float damagePerSecond) {
|
||||
this.damagePerSecond = damagePerSecond;
|
||||
}
|
||||
|
||||
public boolean isAffectsCaster() { return affectsCaster; }
|
||||
public void setAffectsCaster(boolean affectsCaster) { this.affectsCaster = affectsCaster; }
|
||||
public int getDamageInterval() {
|
||||
return damageInterval;
|
||||
}
|
||||
|
||||
public void setDamageInterval(int damageInterval) {
|
||||
this.damageInterval = damageInterval;
|
||||
}
|
||||
|
||||
public boolean isIgnoreInvulnFrames() {
|
||||
return ignoreInvulnFrames;
|
||||
}
|
||||
|
||||
public void setIgnoreInvulnFrames(boolean ignoreInvulnFrames) {
|
||||
this.ignoreInvulnFrames = ignoreInvulnFrames;
|
||||
}
|
||||
|
||||
public boolean isAffectsCaster() {
|
||||
return affectsCaster;
|
||||
}
|
||||
|
||||
public void setAffectsCaster(boolean affectsCaster) {
|
||||
this.affectsCaster = affectsCaster;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package kamkeel.npcs.controllers.data.ability.type;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
@@ -9,13 +11,9 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import noppes.npcs.api.ability.type.IAbilityHeal;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -5,13 +5,13 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import noppes.npcs.api.ability.type.IAbilityHeavyHit;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -5,18 +5,15 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import noppes.npcs.api.ability.type.IAbilityProjectile;
|
||||
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -94,7 +91,11 @@ public class AbilityProjectile extends Ability implements IAbilityProjectile {
|
||||
double dy = (target.posY + target.height / 2) - (caster.posY + caster.getEyeHeight());
|
||||
double dz = target.posZ - caster.posZ;
|
||||
double len = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
||||
if (len > 0) { dx /= len; dy /= len; dz /= len; }
|
||||
if (len > 0) {
|
||||
dx /= len;
|
||||
dy /= len;
|
||||
dz /= len;
|
||||
}
|
||||
|
||||
applyAbilityDamageWithDirection(caster, target, damage, knockback, dx, dz);
|
||||
world.playSoundAtEntity(caster, "random.bow", 1.0f, 0.8f);
|
||||
@@ -167,7 +168,7 @@ public class AbilityProjectile extends Ability implements IAbilityProjectile {
|
||||
* Apply explosion splash damage around a point.
|
||||
*/
|
||||
private void applyExplosionDamage(EntityLivingBase caster, EntityLivingBase primaryTarget, World world,
|
||||
double x, double y, double z) {
|
||||
double x, double y, double z) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Entity> entities = world.getEntitiesWithinAABBExcludingEntity(primaryTarget,
|
||||
primaryTarget.boundingBox.expand(explosionRadius, explosionRadius, explosionRadius));
|
||||
|
||||
@@ -5,16 +5,13 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import noppes.npcs.api.ability.type.IAbilityShockwave;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -5,6 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import kamkeel.npcs.controllers.data.telegraph.Telegraph;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphInstance;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
@@ -13,13 +14,10 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.api.ability.type.IAbilitySlam;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import noppes.npcs.api.ability.type.IAbilitySlam;
|
||||
import somehussar.gui.annotationHandling.GuiEditable;
|
||||
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package kamkeel.npcs.controllers.data.ability.type;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
import kamkeel.npcs.controllers.data.ability.UserType;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -13,15 +16,8 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import noppes.npcs.api.ability.type.IAbilityTeleport;
|
||||
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -43,10 +39,14 @@ public class AbilityTeleport extends Ability implements IAbilityTeleport {
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (this) {
|
||||
case BLINK: return "ability.teleport.blink";
|
||||
case BEHIND: return "ability.teleport.behind";
|
||||
case SINGLE: return "ability.teleport.single";
|
||||
default: return name();
|
||||
case BLINK:
|
||||
return "ability.teleport.blink";
|
||||
case BEHIND:
|
||||
return "ability.teleport.behind";
|
||||
case SINGLE:
|
||||
return "ability.teleport.single";
|
||||
default:
|
||||
return name();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package kamkeel.npcs.controllers.data.ability.type;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityPotionEffect;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
@@ -12,9 +14,6 @@ import noppes.npcs.client.gui.SubGuiTrapPresetSelector;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import noppes.npcs.constants.EnumPotionType;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -115,51 +114,80 @@ public class AbilityTrap extends AbilityZone implements IAbilityTrap {
|
||||
switch (preset) {
|
||||
case "VENOM":
|
||||
groundAlpha = 0.04f;
|
||||
particles = true; particleDensity = 0.3f; particleScale = 0.5f;
|
||||
particleMotion = 1; particleDir = "mc:mobSpell";
|
||||
colorData.innerColor = 0x44DD44; colorData.outerColor = 0x116611;
|
||||
windUpColor = 0x6044DD44; activeColor = 0xC044FF44;
|
||||
particles = true;
|
||||
particleDensity = 0.3f;
|
||||
particleScale = 0.5f;
|
||||
particleMotion = 1;
|
||||
particleDir = "mc:mobSpell";
|
||||
colorData.innerColor = 0x44DD44;
|
||||
colorData.outerColor = 0x116611;
|
||||
windUpColor = 0x6044DD44;
|
||||
activeColor = 0xC044FF44;
|
||||
effects.add(new AbilityPotionEffect(EnumPotionType.Poison, 100, 0));
|
||||
break;
|
||||
case "EXPLOSIVE":
|
||||
groundAlpha = 0.04f;
|
||||
particles = true; particleDensity = 0.3f; particleScale = 0.6f;
|
||||
particleMotion = 0; particleDir = "mc:smoke";
|
||||
colorData.innerColor = 0xFF6611; colorData.outerColor = 0xCC2200;
|
||||
windUpColor = 0x60FF6611; activeColor = 0xC0FF4400;
|
||||
particles = true;
|
||||
particleDensity = 0.3f;
|
||||
particleScale = 0.6f;
|
||||
particleMotion = 0;
|
||||
particleDir = "mc:smoke";
|
||||
colorData.innerColor = 0xFF6611;
|
||||
colorData.outerColor = 0xCC2200;
|
||||
windUpColor = 0x60FF6611;
|
||||
activeColor = 0xC0FF4400;
|
||||
effects.add(new AbilityPotionEffect(EnumPotionType.Fire, 60, 0));
|
||||
break;
|
||||
case "CURSED":
|
||||
groundAlpha = 0.04f;
|
||||
particles = true; particleDensity = 0.3f; particleScale = 0.5f;
|
||||
particleMotion = 1; particleDir = "mc:portal";
|
||||
colorData.innerColor = 0xAA44FF; colorData.outerColor = 0x6622BB;
|
||||
windUpColor = 0x60AA44FF; activeColor = 0xC0CC66FF;
|
||||
particles = true;
|
||||
particleDensity = 0.3f;
|
||||
particleScale = 0.5f;
|
||||
particleMotion = 1;
|
||||
particleDir = "mc:portal";
|
||||
colorData.innerColor = 0xAA44FF;
|
||||
colorData.outerColor = 0x6622BB;
|
||||
windUpColor = 0x60AA44FF;
|
||||
activeColor = 0xC0CC66FF;
|
||||
effects.add(new AbilityPotionEffect(EnumPotionType.Weakness, 100, 0));
|
||||
break;
|
||||
case "SHOCK":
|
||||
groundAlpha = 0.04f;
|
||||
particles = true; particleDensity = 0.3f; particleScale = 0.4f;
|
||||
particleMotion = 2; particleDir = "mc:enchantmenttable";
|
||||
colorData.innerColor = 0x4488FF; colorData.outerColor = 0x2244BB;
|
||||
windUpColor = 0x604488FF; activeColor = 0xC066AAFF;
|
||||
particles = true;
|
||||
particleDensity = 0.3f;
|
||||
particleScale = 0.4f;
|
||||
particleMotion = 2;
|
||||
particleDir = "mc:enchantmenttable";
|
||||
colorData.innerColor = 0x4488FF;
|
||||
colorData.outerColor = 0x2244BB;
|
||||
windUpColor = 0x604488FF;
|
||||
activeColor = 0xC066AAFF;
|
||||
effects.add(new AbilityPotionEffect(EnumPotionType.MiningFatigue, 80, 1));
|
||||
break;
|
||||
case "SNARE":
|
||||
groundAlpha = 0.04f;
|
||||
particles = true; particleDensity = 0.3f; particleScale = 0.5f;
|
||||
particleMotion = 1; particleDir = "mc:snowshovel";
|
||||
colorData.innerColor = 0x88CCFF; colorData.outerColor = 0x4488CC;
|
||||
windUpColor = 0x6088CCFF; activeColor = 0xC0AADDFF;
|
||||
particles = true;
|
||||
particleDensity = 0.3f;
|
||||
particleScale = 0.5f;
|
||||
particleMotion = 1;
|
||||
particleDir = "mc:snowshovel";
|
||||
colorData.innerColor = 0x88CCFF;
|
||||
colorData.outerColor = 0x4488CC;
|
||||
windUpColor = 0x6088CCFF;
|
||||
activeColor = 0xC0AADDFF;
|
||||
effects.add(new AbilityPotionEffect(EnumPotionType.Slowness, 100, 1));
|
||||
break;
|
||||
case "HIDDEN":
|
||||
default:
|
||||
groundAlpha = 0.03f;
|
||||
particles = false; particleDensity = 0.0f; particleScale = 1.0f;
|
||||
particles = false;
|
||||
particleDensity = 0.0f;
|
||||
particleScale = 1.0f;
|
||||
particleMotion = 0;
|
||||
colorData.innerColor = 0x888888; colorData.outerColor = 0x444444;
|
||||
windUpColor = 0x60888888; activeColor = 0xC0AAAAAA;
|
||||
colorData.innerColor = 0x888888;
|
||||
colorData.outerColor = 0x444444;
|
||||
windUpColor = 0x60888888;
|
||||
activeColor = 0xC0AAAAAA;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -190,22 +218,69 @@ public class AbilityTrap extends AbilityZone implements IAbilityTrap {
|
||||
this.visible = nbt.getBoolean("visible");
|
||||
}
|
||||
|
||||
public float getTriggerRadius() { return triggerRadius; }
|
||||
public void setTriggerRadius(float triggerRadius) { this.triggerRadius = triggerRadius; }
|
||||
public int getArmTime() { return armTime; }
|
||||
public void setArmTime(int armTime) { this.armTime = armTime; }
|
||||
public int getMaxTriggers() { return maxTriggers; }
|
||||
public void setMaxTriggers(int maxTriggers) { this.maxTriggers = maxTriggers; }
|
||||
public int getTriggerCooldown() { return triggerCooldown; }
|
||||
public void setTriggerCooldown(int triggerCooldown) { this.triggerCooldown = triggerCooldown; }
|
||||
public float getDamage() { return damage; }
|
||||
public void setDamage(float damage) { this.damage = damage; }
|
||||
public float getDamageRadius() { return damageRadius; }
|
||||
public void setDamageRadius(float damageRadius) { this.damageRadius = damageRadius; }
|
||||
public float getKnockback() { return knockback; }
|
||||
public void setKnockback(float knockback) { this.knockback = knockback; }
|
||||
public boolean isVisible() { return visible; }
|
||||
public void setVisible(boolean visible) { this.visible = visible; }
|
||||
public float getTriggerRadius() {
|
||||
return triggerRadius;
|
||||
}
|
||||
|
||||
public void setTriggerRadius(float triggerRadius) {
|
||||
this.triggerRadius = triggerRadius;
|
||||
}
|
||||
|
||||
public int getArmTime() {
|
||||
return armTime;
|
||||
}
|
||||
|
||||
public void setArmTime(int armTime) {
|
||||
this.armTime = armTime;
|
||||
}
|
||||
|
||||
public int getMaxTriggers() {
|
||||
return maxTriggers;
|
||||
}
|
||||
|
||||
public void setMaxTriggers(int maxTriggers) {
|
||||
this.maxTriggers = maxTriggers;
|
||||
}
|
||||
|
||||
public int getTriggerCooldown() {
|
||||
return triggerCooldown;
|
||||
}
|
||||
|
||||
public void setTriggerCooldown(int triggerCooldown) {
|
||||
this.triggerCooldown = triggerCooldown;
|
||||
}
|
||||
|
||||
public float getDamage() {
|
||||
return damage;
|
||||
}
|
||||
|
||||
public void setDamage(float damage) {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
public float getDamageRadius() {
|
||||
return damageRadius;
|
||||
}
|
||||
|
||||
public void setDamageRadius(float damageRadius) {
|
||||
this.damageRadius = damageRadius;
|
||||
}
|
||||
|
||||
public float getKnockback() {
|
||||
return knockback;
|
||||
}
|
||||
|
||||
public void setKnockback(float knockback) {
|
||||
this.knockback = knockback;
|
||||
}
|
||||
|
||||
public boolean isVisible() {
|
||||
return visible;
|
||||
}
|
||||
|
||||
public void setVisible(boolean visible) {
|
||||
this.visible = visible;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
package kamkeel.npcs.controllers.data.ability.type;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import noppes.npcs.api.ability.type.IAbilityVortex;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package kamkeel.npcs.controllers.data.ability.type;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityPotionEffect;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
@@ -14,15 +16,10 @@ import kamkeel.npcs.entity.EntityAbilityZone.ParticleMotion;
|
||||
import kamkeel.npcs.entity.EntityAbilityZone.ZoneShape;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.constants.EnumPotionType;
|
||||
import net.minecraft.util.DamageSource;
|
||||
|
||||
|
||||
import noppes.npcs.client.gui.SubGuiZonePresetSelector;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import noppes.npcs.constants.EnumPotionType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -213,57 +210,134 @@ public abstract class AbilityZone extends Ability {
|
||||
particleDir = "";
|
||||
switch (styleName) {
|
||||
case "TOXIC":
|
||||
groundFill = true; groundAlpha = 0.30f; rings = true; ringCount = 3;
|
||||
border = false; borderSpeed = 1.0f; accents = true; accentStyle = 1;
|
||||
lightning = false; particles = true; particleDensity = 1.5f; particleScale = 0.8f;
|
||||
particleMotion = 1; particleGlow = true; particleDir = "mc:mobSpell";
|
||||
colorData.innerColor = 0x44DD44; colorData.outerColor = 0x116611;
|
||||
windUpColor = 0x6044DD44; activeColor = 0xC044FF44;
|
||||
groundFill = true;
|
||||
groundAlpha = 0.30f;
|
||||
rings = true;
|
||||
ringCount = 3;
|
||||
border = false;
|
||||
borderSpeed = 1.0f;
|
||||
accents = true;
|
||||
accentStyle = 1;
|
||||
lightning = false;
|
||||
particles = true;
|
||||
particleDensity = 1.5f;
|
||||
particleScale = 0.8f;
|
||||
particleMotion = 1;
|
||||
particleGlow = true;
|
||||
particleDir = "mc:mobSpell";
|
||||
colorData.innerColor = 0x44DD44;
|
||||
colorData.outerColor = 0x116611;
|
||||
windUpColor = 0x6044DD44;
|
||||
activeColor = 0xC044FF44;
|
||||
effects.add(new AbilityPotionEffect(EnumPotionType.Poison, 100, 0));
|
||||
break;
|
||||
case "INFERNO":
|
||||
groundFill = true; groundAlpha = 0.35f; rings = true; ringCount = 3;
|
||||
border = true; borderSpeed = 2.0f; accents = true; accentStyle = 2;
|
||||
lightning = false; particles = true; particleDensity = 2.0f; particleScale = 1.2f;
|
||||
particleMotion = 0; particleGlow = true; particleDir = "mc:flame";
|
||||
colorData.innerColor = 0xFF6611; colorData.outerColor = 0xCC2200;
|
||||
windUpColor = 0x60FF6611; activeColor = 0xC0FF4400;
|
||||
groundFill = true;
|
||||
groundAlpha = 0.35f;
|
||||
rings = true;
|
||||
ringCount = 3;
|
||||
border = true;
|
||||
borderSpeed = 2.0f;
|
||||
accents = true;
|
||||
accentStyle = 2;
|
||||
lightning = false;
|
||||
particles = true;
|
||||
particleDensity = 2.0f;
|
||||
particleScale = 1.2f;
|
||||
particleMotion = 0;
|
||||
particleGlow = true;
|
||||
particleDir = "mc:flame";
|
||||
colorData.innerColor = 0xFF6611;
|
||||
colorData.outerColor = 0xCC2200;
|
||||
windUpColor = 0x60FF6611;
|
||||
activeColor = 0xC0FF4400;
|
||||
effects.add(new AbilityPotionEffect(EnumPotionType.Fire, 60, 0));
|
||||
break;
|
||||
case "ARCANE":
|
||||
groundFill = true; groundAlpha = 0.20f; rings = true; ringCount = 1;
|
||||
border = true; borderSpeed = 0.8f; accents = true; accentStyle = 0;
|
||||
lightning = false; particles = true; particleDensity = 1.0f; particleScale = 1.0f;
|
||||
particleMotion = 1; particleGlow = true; particleDir = "mc:portal";
|
||||
colorData.innerColor = 0xAA44FF; colorData.outerColor = 0x6622BB;
|
||||
windUpColor = 0x60AA44FF; activeColor = 0xC0CC66FF;
|
||||
groundFill = true;
|
||||
groundAlpha = 0.20f;
|
||||
rings = true;
|
||||
ringCount = 1;
|
||||
border = true;
|
||||
borderSpeed = 0.8f;
|
||||
accents = true;
|
||||
accentStyle = 0;
|
||||
lightning = false;
|
||||
particles = true;
|
||||
particleDensity = 1.0f;
|
||||
particleScale = 1.0f;
|
||||
particleMotion = 1;
|
||||
particleGlow = true;
|
||||
particleDir = "mc:portal";
|
||||
colorData.innerColor = 0xAA44FF;
|
||||
colorData.outerColor = 0x6622BB;
|
||||
windUpColor = 0x60AA44FF;
|
||||
activeColor = 0xC0CC66FF;
|
||||
effects.add(new AbilityPotionEffect(EnumPotionType.Weakness, 100, 0));
|
||||
break;
|
||||
case "ELECTRIC":
|
||||
groundFill = true; groundAlpha = 0.15f; rings = false; ringCount = 1;
|
||||
border = false; borderSpeed = 1.0f; accents = false; accentStyle = 0;
|
||||
lightning = true; particles = true; particleDensity = 0.8f; particleScale = 0.6f;
|
||||
particleMotion = 2; particleGlow = true; particleDir = "mc:enchantmenttable";
|
||||
colorData.innerColor = 0x4488FF; colorData.outerColor = 0x2244BB;
|
||||
windUpColor = 0x604488FF; activeColor = 0xC066AAFF;
|
||||
groundFill = true;
|
||||
groundAlpha = 0.15f;
|
||||
rings = false;
|
||||
ringCount = 1;
|
||||
border = false;
|
||||
borderSpeed = 1.0f;
|
||||
accents = false;
|
||||
accentStyle = 0;
|
||||
lightning = true;
|
||||
particles = true;
|
||||
particleDensity = 0.8f;
|
||||
particleScale = 0.6f;
|
||||
particleMotion = 2;
|
||||
particleGlow = true;
|
||||
particleDir = "mc:enchantmenttable";
|
||||
colorData.innerColor = 0x4488FF;
|
||||
colorData.outerColor = 0x2244BB;
|
||||
windUpColor = 0x604488FF;
|
||||
activeColor = 0xC066AAFF;
|
||||
effects.add(new AbilityPotionEffect(EnumPotionType.MiningFatigue, 80, 1));
|
||||
break;
|
||||
case "FROST":
|
||||
groundFill = true; groundAlpha = 0.25f; rings = true; ringCount = 3;
|
||||
border = true; borderSpeed = 0.3f; accents = true; accentStyle = 0;
|
||||
lightning = false; particles = true; particleDensity = 1.5f; particleScale = 1.0f;
|
||||
particleMotion = 1; particleGlow = true; particleDir = "mc:snowshovel";
|
||||
colorData.innerColor = 0x88CCFF; colorData.outerColor = 0x4488CC;
|
||||
windUpColor = 0x6088CCFF; activeColor = 0xC0AADDFF;
|
||||
groundFill = true;
|
||||
groundAlpha = 0.25f;
|
||||
rings = true;
|
||||
ringCount = 3;
|
||||
border = true;
|
||||
borderSpeed = 0.3f;
|
||||
accents = true;
|
||||
accentStyle = 0;
|
||||
lightning = false;
|
||||
particles = true;
|
||||
particleDensity = 1.5f;
|
||||
particleScale = 1.0f;
|
||||
particleMotion = 1;
|
||||
particleGlow = true;
|
||||
particleDir = "mc:snowshovel";
|
||||
colorData.innerColor = 0x88CCFF;
|
||||
colorData.outerColor = 0x4488CC;
|
||||
windUpColor = 0x6088CCFF;
|
||||
activeColor = 0xC0AADDFF;
|
||||
effects.add(new AbilityPotionEffect(EnumPotionType.Slowness, 100, 1));
|
||||
break;
|
||||
case "DEFAULT":
|
||||
groundFill = true; groundAlpha = 0.25f; rings = true; ringCount = 3;
|
||||
border = true; borderSpeed = 1.0f; accents = true; accentStyle = 0;
|
||||
lightning = false; particles = false; particleDensity = 1.0f; particleScale = 1.0f;
|
||||
particleMotion = 0; particleGlow = true;
|
||||
colorData.innerColor = 0xCCCCCC; colorData.outerColor = 0x666666;
|
||||
windUpColor = 0x60CCCCCC; activeColor = 0xC0FFFFFF;
|
||||
groundFill = true;
|
||||
groundAlpha = 0.25f;
|
||||
rings = true;
|
||||
ringCount = 3;
|
||||
border = true;
|
||||
borderSpeed = 1.0f;
|
||||
accents = true;
|
||||
accentStyle = 0;
|
||||
lightning = false;
|
||||
particles = false;
|
||||
particleDensity = 1.0f;
|
||||
particleScale = 1.0f;
|
||||
particleMotion = 0;
|
||||
particleGlow = true;
|
||||
colorData.innerColor = 0xCCCCCC;
|
||||
colorData.outerColor = 0x666666;
|
||||
windUpColor = 0x60CCCCCC;
|
||||
activeColor = 0xC0FFFFFF;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -310,8 +384,11 @@ public abstract class AbilityZone extends Ability {
|
||||
|
||||
protected void readZoneNBT(NBTTagCompound nbt, int defaultDuration) {
|
||||
this.durationTicks = nbt.getInteger("durationTicks");
|
||||
try { this.zoneShape = ZoneShape.valueOf(nbt.getString("zoneShape")); }
|
||||
catch (Exception e) { this.zoneShape = ZoneShape.CIRCLE; }
|
||||
try {
|
||||
this.zoneShape = ZoneShape.valueOf(nbt.getString("zoneShape"));
|
||||
} catch (Exception e) {
|
||||
this.zoneShape = ZoneShape.CIRCLE;
|
||||
}
|
||||
this.spawnRadius = nbt.getFloat("spawnRadius");
|
||||
this.zoneCount = nbt.getInteger("zoneCount");
|
||||
this.zoneHeight = nbt.getFloat("zoneHeight");
|
||||
@@ -337,73 +414,238 @@ public abstract class AbilityZone extends Ability {
|
||||
this.particleGlow = nbt.getBoolean("particleGlow");
|
||||
}
|
||||
|
||||
public int getDurationTicks() { return durationTicks; }
|
||||
public void setDurationTicks(int durationTicks) { this.durationTicks = Math.max(1, durationTicks); }
|
||||
public int getDurationTicks() {
|
||||
return durationTicks;
|
||||
}
|
||||
|
||||
public ZoneShape getZoneShapeEnum() { return zoneShape; }
|
||||
public void setZoneShapeEnum(ZoneShape shape) { this.zoneShape = shape; }
|
||||
public void setDurationTicks(int durationTicks) {
|
||||
this.durationTicks = Math.max(1, durationTicks);
|
||||
}
|
||||
|
||||
public ZoneShape getZoneShapeEnum() {
|
||||
return zoneShape;
|
||||
}
|
||||
|
||||
public void setZoneShapeEnum(ZoneShape shape) {
|
||||
this.zoneShape = shape;
|
||||
}
|
||||
|
||||
public int getZoneShapeOrdinal() {
|
||||
return zoneShape.ordinal();
|
||||
}
|
||||
|
||||
public int getZoneShapeOrdinal() { return zoneShape.ordinal(); }
|
||||
public void setZoneShapeOrdinal(int shape) {
|
||||
ZoneShape[] values = ZoneShape.values();
|
||||
this.zoneShape = shape >= 0 && shape < values.length ? values[shape] : ZoneShape.CIRCLE;
|
||||
}
|
||||
|
||||
public float getSpawnRadius() { return spawnRadius; }
|
||||
public void setSpawnRadius(float spawnRadius) { this.spawnRadius = Math.max(0, spawnRadius); }
|
||||
public int getZoneCount() { return zoneCount; }
|
||||
public void setZoneCount(int zoneCount) { this.zoneCount = Math.max(1, zoneCount); }
|
||||
public float getZoneHeight() { return zoneHeight; }
|
||||
public void setZoneHeight(float zoneHeight) { this.zoneHeight = Math.max(0.5f, zoneHeight); }
|
||||
public float getSpawnRadius() {
|
||||
return spawnRadius;
|
||||
}
|
||||
|
||||
public float getParticleDensity() { return particleDensity; }
|
||||
public void setParticleDensity(float v) { this.particleDensity = Math.max(0, Math.min(5, v)); }
|
||||
public float getParticleScale() { return particleScale; }
|
||||
public void setParticleScale(float v) { this.particleScale = Math.max(0.1f, Math.min(5, v)); }
|
||||
public float getAnimSpeed() { return animSpeed; }
|
||||
public void setAnimSpeed(float v) { this.animSpeed = Math.max(0.1f, Math.min(5, v)); }
|
||||
public float getLightningDensity() { return lightningDensity; }
|
||||
public void setLightningDensity(float v) { this.lightningDensity = Math.max(0, Math.min(3, v)); }
|
||||
public void setSpawnRadius(float spawnRadius) {
|
||||
this.spawnRadius = Math.max(0, spawnRadius);
|
||||
}
|
||||
|
||||
public int getInnerColor() { return colorData.innerColor; }
|
||||
public void setInnerColor(int color) { colorData.innerColor = color; }
|
||||
public int getOuterColor() { return colorData.outerColor; }
|
||||
public void setOuterColor(int color) { colorData.outerColor = color; }
|
||||
public boolean isOuterColorEnabled() { return colorData.outerColorEnabled; }
|
||||
public void setOuterColorEnabled(boolean enabled) { colorData.outerColorEnabled = enabled; }
|
||||
public int getZoneCount() {
|
||||
return zoneCount;
|
||||
}
|
||||
|
||||
public boolean isGroundFill() { return groundFill; }
|
||||
public void setGroundFill(boolean v) { this.groundFill = v; }
|
||||
public float getGroundAlpha() { return groundAlpha; }
|
||||
public void setGroundAlpha(float v) { this.groundAlpha = Math.max(0, Math.min(1, v)); }
|
||||
public boolean isRings() { return rings; }
|
||||
public void setRings(boolean v) { this.rings = v; }
|
||||
public int getRingCount() { return ringCount; }
|
||||
public void setRingCount(int v) { this.ringCount = Math.max(1, Math.min(5, v)); }
|
||||
public boolean isBorder() { return border; }
|
||||
public void setBorder(boolean v) { this.border = v; }
|
||||
public float getBorderSpeed() { return borderSpeed; }
|
||||
public void setBorderSpeed(float v) { this.borderSpeed = Math.max(0.1f, Math.min(5, v)); }
|
||||
public boolean isAccents() { return accents; }
|
||||
public void setAccents(boolean v) { this.accents = v; }
|
||||
public int getAccentStyle() { return accentStyle; }
|
||||
public void setAccentStyle(int v) { this.accentStyle = Math.max(0, Math.min(AccentStyle.values().length - 1, v)); }
|
||||
public AccentStyle getAccentStyleEnum() { return AccentStyle.values()[Math.max(0, Math.min(accentStyle, AccentStyle.values().length - 1))]; }
|
||||
public void setAccentStyleEnum(AccentStyle s) { this.accentStyle = s.ordinal(); }
|
||||
public boolean isLightning() { return lightning; }
|
||||
public void setLightning(boolean v) { this.lightning = v; }
|
||||
public boolean isParticles() { return particles; }
|
||||
public void setParticles(boolean v) { this.particles = v; }
|
||||
public int getParticleMotion() { return particleMotion; }
|
||||
public void setParticleMotion(int v) { this.particleMotion = Math.max(0, Math.min(ParticleMotion.values().length - 1, v)); }
|
||||
public ParticleMotion getParticleMotionEnum() { return ParticleMotion.values()[Math.max(0, Math.min(particleMotion, ParticleMotion.values().length - 1))]; }
|
||||
public void setParticleMotionEnum(ParticleMotion m) { this.particleMotion = m.ordinal(); }
|
||||
public String getParticleDir() { return particleDir; }
|
||||
public void setParticleDir(String v) { this.particleDir = v != null ? v : ""; }
|
||||
public int getParticleSize() { return particleSize; }
|
||||
public void setParticleSize(int v) { this.particleSize = Math.max(1, Math.min(256, v)); }
|
||||
public boolean isParticleGlow() { return particleGlow; }
|
||||
public void setParticleGlow(boolean v) { this.particleGlow = v; }
|
||||
public void setZoneCount(int zoneCount) {
|
||||
this.zoneCount = Math.max(1, zoneCount);
|
||||
}
|
||||
|
||||
public float getZoneHeight() {
|
||||
return zoneHeight;
|
||||
}
|
||||
|
||||
public void setZoneHeight(float zoneHeight) {
|
||||
this.zoneHeight = Math.max(0.5f, zoneHeight);
|
||||
}
|
||||
|
||||
public float getParticleDensity() {
|
||||
return particleDensity;
|
||||
}
|
||||
|
||||
public void setParticleDensity(float v) {
|
||||
this.particleDensity = Math.max(0, Math.min(5, v));
|
||||
}
|
||||
|
||||
public float getParticleScale() {
|
||||
return particleScale;
|
||||
}
|
||||
|
||||
public void setParticleScale(float v) {
|
||||
this.particleScale = Math.max(0.1f, Math.min(5, v));
|
||||
}
|
||||
|
||||
public float getAnimSpeed() {
|
||||
return animSpeed;
|
||||
}
|
||||
|
||||
public void setAnimSpeed(float v) {
|
||||
this.animSpeed = Math.max(0.1f, Math.min(5, v));
|
||||
}
|
||||
|
||||
public float getLightningDensity() {
|
||||
return lightningDensity;
|
||||
}
|
||||
|
||||
public void setLightningDensity(float v) {
|
||||
this.lightningDensity = Math.max(0, Math.min(3, v));
|
||||
}
|
||||
|
||||
public int getInnerColor() {
|
||||
return colorData.innerColor;
|
||||
}
|
||||
|
||||
public void setInnerColor(int color) {
|
||||
colorData.innerColor = color;
|
||||
}
|
||||
|
||||
public int getOuterColor() {
|
||||
return colorData.outerColor;
|
||||
}
|
||||
|
||||
public void setOuterColor(int color) {
|
||||
colorData.outerColor = color;
|
||||
}
|
||||
|
||||
public boolean isOuterColorEnabled() {
|
||||
return colorData.outerColorEnabled;
|
||||
}
|
||||
|
||||
public void setOuterColorEnabled(boolean enabled) {
|
||||
colorData.outerColorEnabled = enabled;
|
||||
}
|
||||
|
||||
public boolean isGroundFill() {
|
||||
return groundFill;
|
||||
}
|
||||
|
||||
public void setGroundFill(boolean v) {
|
||||
this.groundFill = v;
|
||||
}
|
||||
|
||||
public float getGroundAlpha() {
|
||||
return groundAlpha;
|
||||
}
|
||||
|
||||
public void setGroundAlpha(float v) {
|
||||
this.groundAlpha = Math.max(0, Math.min(1, v));
|
||||
}
|
||||
|
||||
public boolean isRings() {
|
||||
return rings;
|
||||
}
|
||||
|
||||
public void setRings(boolean v) {
|
||||
this.rings = v;
|
||||
}
|
||||
|
||||
public int getRingCount() {
|
||||
return ringCount;
|
||||
}
|
||||
|
||||
public void setRingCount(int v) {
|
||||
this.ringCount = Math.max(1, Math.min(5, v));
|
||||
}
|
||||
|
||||
public boolean isBorder() {
|
||||
return border;
|
||||
}
|
||||
|
||||
public void setBorder(boolean v) {
|
||||
this.border = v;
|
||||
}
|
||||
|
||||
public float getBorderSpeed() {
|
||||
return borderSpeed;
|
||||
}
|
||||
|
||||
public void setBorderSpeed(float v) {
|
||||
this.borderSpeed = Math.max(0.1f, Math.min(5, v));
|
||||
}
|
||||
|
||||
public boolean isAccents() {
|
||||
return accents;
|
||||
}
|
||||
|
||||
public void setAccents(boolean v) {
|
||||
this.accents = v;
|
||||
}
|
||||
|
||||
public int getAccentStyle() {
|
||||
return accentStyle;
|
||||
}
|
||||
|
||||
public void setAccentStyle(int v) {
|
||||
this.accentStyle = Math.max(0, Math.min(AccentStyle.values().length - 1, v));
|
||||
}
|
||||
|
||||
public AccentStyle getAccentStyleEnum() {
|
||||
return AccentStyle.values()[Math.max(0, Math.min(accentStyle, AccentStyle.values().length - 1))];
|
||||
}
|
||||
|
||||
public void setAccentStyleEnum(AccentStyle s) {
|
||||
this.accentStyle = s.ordinal();
|
||||
}
|
||||
|
||||
public boolean isLightning() {
|
||||
return lightning;
|
||||
}
|
||||
|
||||
public void setLightning(boolean v) {
|
||||
this.lightning = v;
|
||||
}
|
||||
|
||||
public boolean isParticles() {
|
||||
return particles;
|
||||
}
|
||||
|
||||
public void setParticles(boolean v) {
|
||||
this.particles = v;
|
||||
}
|
||||
|
||||
public int getParticleMotion() {
|
||||
return particleMotion;
|
||||
}
|
||||
|
||||
public void setParticleMotion(int v) {
|
||||
this.particleMotion = Math.max(0, Math.min(ParticleMotion.values().length - 1, v));
|
||||
}
|
||||
|
||||
public ParticleMotion getParticleMotionEnum() {
|
||||
return ParticleMotion.values()[Math.max(0, Math.min(particleMotion, ParticleMotion.values().length - 1))];
|
||||
}
|
||||
|
||||
public void setParticleMotionEnum(ParticleMotion m) {
|
||||
this.particleMotion = m.ordinal();
|
||||
}
|
||||
|
||||
public String getParticleDir() {
|
||||
return particleDir;
|
||||
}
|
||||
|
||||
public void setParticleDir(String v) {
|
||||
this.particleDir = v != null ? v : "";
|
||||
}
|
||||
|
||||
public int getParticleSize() {
|
||||
return particleSize;
|
||||
}
|
||||
|
||||
public void setParticleSize(int v) {
|
||||
this.particleSize = Math.max(1, Math.min(256, v));
|
||||
}
|
||||
|
||||
public boolean isParticleGlow() {
|
||||
return particleGlow;
|
||||
}
|
||||
|
||||
public void setParticleGlow(boolean v) {
|
||||
this.particleGlow = v;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected void addPresetFieldDef(List<FieldDef> defs) {
|
||||
|
||||
@@ -6,7 +6,11 @@ import kamkeel.npcs.controllers.data.ability.AbilityVariant;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
import kamkeel.npcs.controllers.data.ability.RotationMode;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
import kamkeel.npcs.controllers.data.ability.data.*;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyCombatData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyHomingData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLifespanData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.ProjectileData;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
import kamkeel.npcs.entity.EntityAbilityBeam;
|
||||
@@ -56,7 +60,7 @@ public class AbilityBeam extends AbilityEnergyProjectile<EntityAbilityBeam> impl
|
||||
|
||||
@Override
|
||||
protected EntityAbilityBeam createEntity(EntityLivingBase caster, EntityLivingBase target,
|
||||
Vec3 spawnPos, EnergyDisplayData resolved, int index) {
|
||||
Vec3 spawnPos, EnergyDisplayData resolved, int index) {
|
||||
return new EntityAbilityBeam(
|
||||
caster.worldObj, caster, target,
|
||||
spawnPos.xCoord, spawnPos.yCoord, spawnPos.zCoord,
|
||||
@@ -81,7 +85,7 @@ public class AbilityBeam extends AbilityEnergyProjectile<EntityAbilityBeam> impl
|
||||
|
||||
@Override
|
||||
protected void setupEntityPreview(EntityAbilityBeam beam, EntityLivingBase caster,
|
||||
EnergyDisplayData resolved, ProjectileData projData, int index) {
|
||||
EnergyDisplayData resolved, ProjectileData projData, int index) {
|
||||
beam.setupPreview(caster, beamWidth, headSize, resolved, lightningData, projData.anchor, windUpTicks, 1.0f);
|
||||
}
|
||||
|
||||
@@ -139,14 +143,29 @@ public class AbilityBeam extends AbilityEnergyProjectile<EntityAbilityBeam> impl
|
||||
|
||||
// ==================== TYPE-SPECIFIC GETTERS ====================
|
||||
|
||||
public float getSpeed() { return homingData.speed; }
|
||||
public void setSpeed(float speed) { homingData.speed = speed; }
|
||||
public float getSpeed() {
|
||||
return homingData.speed;
|
||||
}
|
||||
|
||||
public float getBeamWidth() { return beamWidth; }
|
||||
public void setBeamWidth(float beamWidth) { this.beamWidth = beamWidth; }
|
||||
public void setSpeed(float speed) {
|
||||
homingData.speed = speed;
|
||||
}
|
||||
|
||||
public float getHeadSize() { return headSize; }
|
||||
public void setHeadSize(float headSize) { this.headSize = headSize; }
|
||||
public float getBeamWidth() {
|
||||
return beamWidth;
|
||||
}
|
||||
|
||||
public void setBeamWidth(float beamWidth) {
|
||||
this.beamWidth = beamWidth;
|
||||
}
|
||||
|
||||
public float getHeadSize() {
|
||||
return headSize;
|
||||
}
|
||||
|
||||
public void setHeadSize(float headSize) {
|
||||
this.headSize = headSize;
|
||||
}
|
||||
|
||||
// ==================== TYPE-SPECIFIC GUI ====================
|
||||
|
||||
|
||||
@@ -5,7 +5,11 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityVariant;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
import kamkeel.npcs.controllers.data.ability.data.*;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyCombatData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyHomingData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLifespanData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.ProjectileData;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
import kamkeel.npcs.entity.EntityAbilityDisc;
|
||||
@@ -56,7 +60,7 @@ public class AbilityDisc extends AbilityEnergyProjectile<EntityAbilityDisc> impl
|
||||
|
||||
@Override
|
||||
protected EntityAbilityDisc createEntity(EntityLivingBase caster, EntityLivingBase target,
|
||||
Vec3 spawnPos, EnergyDisplayData resolved, int index) {
|
||||
Vec3 spawnPos, EnergyDisplayData resolved, int index) {
|
||||
return new EntityAbilityDisc(
|
||||
caster.worldObj, caster, target,
|
||||
spawnPos.xCoord, spawnPos.yCoord, spawnPos.zCoord,
|
||||
@@ -81,7 +85,7 @@ public class AbilityDisc extends AbilityEnergyProjectile<EntityAbilityDisc> impl
|
||||
|
||||
@Override
|
||||
protected void setupEntityPreview(EntityAbilityDisc disc, EntityLivingBase caster,
|
||||
EnergyDisplayData resolved, ProjectileData projData, int index) {
|
||||
EnergyDisplayData resolved, ProjectileData projData, int index) {
|
||||
disc.setupPreview(caster, discRadius, discThickness, resolved, lightningData, projData.anchor, windUpTicks, vertical);
|
||||
}
|
||||
|
||||
@@ -139,23 +143,53 @@ public class AbilityDisc extends AbilityEnergyProjectile<EntityAbilityDisc> impl
|
||||
|
||||
// ==================== TYPE-SPECIFIC GETTERS ====================
|
||||
|
||||
public float getSpeed() { return homingData.speed; }
|
||||
public void setSpeed(float speed) { homingData.speed = speed; }
|
||||
public float getSpeed() {
|
||||
return homingData.speed;
|
||||
}
|
||||
|
||||
public float getDiscRadius() { return discRadius; }
|
||||
public void setDiscRadius(float discRadius) { this.discRadius = discRadius; }
|
||||
public void setSpeed(float speed) {
|
||||
homingData.speed = speed;
|
||||
}
|
||||
|
||||
public float getDiscThickness() { return discThickness; }
|
||||
public void setDiscThickness(float discThickness) { this.discThickness = discThickness; }
|
||||
public float getDiscRadius() {
|
||||
return discRadius;
|
||||
}
|
||||
|
||||
public boolean isVertical() { return vertical; }
|
||||
public void setVertical(boolean vertical) { this.vertical = vertical; }
|
||||
public void setDiscRadius(float discRadius) {
|
||||
this.discRadius = discRadius;
|
||||
}
|
||||
|
||||
public boolean isBoomerang() { return boomerang; }
|
||||
public void setBoomerang(boolean boomerang) { this.boomerang = boomerang; }
|
||||
public float getDiscThickness() {
|
||||
return discThickness;
|
||||
}
|
||||
|
||||
public int getBoomerangDelay() { return boomerangDelay; }
|
||||
public void setBoomerangDelay(int boomerangDelay) { this.boomerangDelay = boomerangDelay; }
|
||||
public void setDiscThickness(float discThickness) {
|
||||
this.discThickness = discThickness;
|
||||
}
|
||||
|
||||
public boolean isVertical() {
|
||||
return vertical;
|
||||
}
|
||||
|
||||
public void setVertical(boolean vertical) {
|
||||
this.vertical = vertical;
|
||||
}
|
||||
|
||||
public boolean isBoomerang() {
|
||||
return boomerang;
|
||||
}
|
||||
|
||||
public void setBoomerang(boolean boomerang) {
|
||||
this.boomerang = boomerang;
|
||||
}
|
||||
|
||||
public int getBoomerangDelay() {
|
||||
return boomerangDelay;
|
||||
}
|
||||
|
||||
public void setBoomerangDelay(int boomerangDelay) {
|
||||
this.boomerangDelay = boomerangDelay;
|
||||
}
|
||||
|
||||
// ==================== TYPE-SPECIFIC GUI ====================
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
import kamkeel.npcs.entity.EntityEnergyBarrier;
|
||||
import kamkeel.npcs.entity.EntityEnergyDome;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
@@ -111,11 +110,21 @@ public class AbilityDome extends AbilityEnergyBarrier {
|
||||
|
||||
// ==================== GETTERS & SETTERS ====================
|
||||
|
||||
public float getDomeRadius() { return domeRadius; }
|
||||
public void setDomeRadius(float radius) { this.domeRadius = Math.max(1.0f, radius); }
|
||||
public float getDomeRadius() {
|
||||
return domeRadius;
|
||||
}
|
||||
|
||||
public boolean isFollowCaster() { return followCaster; }
|
||||
public void setFollowCaster(boolean follow) { this.followCaster = follow; }
|
||||
public void setDomeRadius(float radius) {
|
||||
this.domeRadius = Math.max(1.0f, radius);
|
||||
}
|
||||
|
||||
public boolean isFollowCaster() {
|
||||
return followCaster;
|
||||
}
|
||||
|
||||
public void setFollowCaster(boolean follow) {
|
||||
this.followCaster = follow;
|
||||
}
|
||||
|
||||
// ==================== TYPE-SPECIFIC GUI ====================
|
||||
|
||||
|
||||
+77
-22
@@ -26,40 +26,95 @@ public abstract class AbilityEnergy extends Ability {
|
||||
|
||||
// ==================== DISPLAY DATA ====================
|
||||
|
||||
public int getInnerColor() { return displayData.innerColor; }
|
||||
public void setInnerColor(int color) { displayData.innerColor = color; }
|
||||
public int getInnerColor() {
|
||||
return displayData.innerColor;
|
||||
}
|
||||
|
||||
public float getInnerAlpha() { return displayData.innerAlpha; }
|
||||
public void setInnerAlpha(float alpha) { displayData.innerAlpha = alpha; }
|
||||
public void setInnerColor(int color) {
|
||||
displayData.innerColor = color;
|
||||
}
|
||||
|
||||
public int getOuterColor() { return displayData.outerColor; }
|
||||
public void setOuterColor(int color) { displayData.outerColor = color; }
|
||||
public float getInnerAlpha() {
|
||||
return displayData.innerAlpha;
|
||||
}
|
||||
|
||||
public boolean isOuterColorEnabled() { return displayData.outerColorEnabled; }
|
||||
public void setOuterColorEnabled(boolean enabled) { displayData.outerColorEnabled = enabled; }
|
||||
public void setInnerAlpha(float alpha) {
|
||||
displayData.innerAlpha = alpha;
|
||||
}
|
||||
|
||||
public float getOuterColorWidth() { return displayData.outerColorWidth; }
|
||||
public void setOuterColorWidth(float width) { displayData.outerColorWidth = width; }
|
||||
public int getOuterColor() {
|
||||
return displayData.outerColor;
|
||||
}
|
||||
|
||||
public float getOuterColorAlpha() { return displayData.outerColorAlpha; }
|
||||
public void setOuterColorAlpha(float alpha) { displayData.outerColorAlpha = alpha; }
|
||||
public void setOuterColor(int color) {
|
||||
displayData.outerColor = color;
|
||||
}
|
||||
|
||||
public float getRotationSpeed() { return displayData.rotationSpeed; }
|
||||
public void setRotationSpeed(float speed) { displayData.rotationSpeed = speed; }
|
||||
public boolean isOuterColorEnabled() {
|
||||
return displayData.outerColorEnabled;
|
||||
}
|
||||
|
||||
public void setOuterColorEnabled(boolean enabled) {
|
||||
displayData.outerColorEnabled = enabled;
|
||||
}
|
||||
|
||||
public float getOuterColorWidth() {
|
||||
return displayData.outerColorWidth;
|
||||
}
|
||||
|
||||
public void setOuterColorWidth(float width) {
|
||||
displayData.outerColorWidth = width;
|
||||
}
|
||||
|
||||
public float getOuterColorAlpha() {
|
||||
return displayData.outerColorAlpha;
|
||||
}
|
||||
|
||||
public void setOuterColorAlpha(float alpha) {
|
||||
displayData.outerColorAlpha = alpha;
|
||||
}
|
||||
|
||||
public float getRotationSpeed() {
|
||||
return displayData.rotationSpeed;
|
||||
}
|
||||
|
||||
public void setRotationSpeed(float speed) {
|
||||
displayData.rotationSpeed = speed;
|
||||
}
|
||||
|
||||
// ==================== LIGHTNING DATA ====================
|
||||
|
||||
public boolean hasLightningEffect() { return lightningData.lightningEffect; }
|
||||
public void setLightningEffect(boolean enabled) { lightningData.lightningEffect = enabled; }
|
||||
public boolean hasLightningEffect() {
|
||||
return lightningData.lightningEffect;
|
||||
}
|
||||
|
||||
public float getLightningDensity() { return lightningData.lightningDensity; }
|
||||
public void setLightningDensity(float density) { lightningData.lightningDensity = density; }
|
||||
public void setLightningEffect(boolean enabled) {
|
||||
lightningData.lightningEffect = enabled;
|
||||
}
|
||||
|
||||
public float getLightningRadius() { return lightningData.lightningRadius; }
|
||||
public void setLightningRadius(float radius) { lightningData.lightningRadius = radius; }
|
||||
public float getLightningDensity() {
|
||||
return lightningData.lightningDensity;
|
||||
}
|
||||
|
||||
public int getLightningFadeTime() { return lightningData.lightningFadeTime; }
|
||||
public void setLightningFadeTime(int fadeTime) { lightningData.lightningFadeTime = fadeTime; }
|
||||
public void setLightningDensity(float density) {
|
||||
lightningData.lightningDensity = density;
|
||||
}
|
||||
|
||||
public float getLightningRadius() {
|
||||
return lightningData.lightningRadius;
|
||||
}
|
||||
|
||||
public void setLightningRadius(float radius) {
|
||||
lightningData.lightningRadius = radius;
|
||||
}
|
||||
|
||||
public int getLightningFadeTime() {
|
||||
return lightningData.lightningFadeTime;
|
||||
}
|
||||
|
||||
public void setLightningFadeTime(int fadeTime) {
|
||||
lightningData.lightningFadeTime = fadeTime;
|
||||
}
|
||||
|
||||
// ==================== NBT HELPERS ====================
|
||||
|
||||
|
||||
+81
-23
@@ -142,37 +142,95 @@ public abstract class AbilityEnergyBarrier extends AbilityEnergy {
|
||||
// Display and lightning data inherited from AbilityEnergy
|
||||
|
||||
// Barrier data
|
||||
public float getBarrierMaxHealth() { return barrierData.maxHealth; }
|
||||
public void setBarrierMaxHealth(float maxHealth) { barrierData.setMaxHealth(maxHealth); }
|
||||
public float getBarrierMaxHealth() {
|
||||
return barrierData.maxHealth;
|
||||
}
|
||||
|
||||
public boolean isUseHealth() { return barrierData.useHealth; }
|
||||
public void setUseHealth(boolean useHealth) { barrierData.useHealth = useHealth; }
|
||||
public void setBarrierMaxHealth(float maxHealth) {
|
||||
barrierData.setMaxHealth(maxHealth);
|
||||
}
|
||||
|
||||
public int getBarrierDuration() { return barrierData.durationTicks; }
|
||||
public void setBarrierDuration(int ticks) { barrierData.setDurationTicks(ticks); }
|
||||
public boolean isUseHealth() {
|
||||
return barrierData.useHealth;
|
||||
}
|
||||
|
||||
public boolean isUseDuration() { return barrierData.useDuration; }
|
||||
public void setUseDuration(boolean useDuration) { barrierData.useDuration = useDuration; }
|
||||
public void setUseHealth(boolean useHealth) {
|
||||
barrierData.useHealth = useHealth;
|
||||
}
|
||||
|
||||
public float getDefaultMultiplier() { return barrierData.defaultMultiplier; }
|
||||
public void setDefaultMultiplier(float mult) { barrierData.defaultMultiplier = mult; }
|
||||
public int getBarrierDuration() {
|
||||
return barrierData.durationTicks;
|
||||
}
|
||||
|
||||
public void setDamageMultiplier(String typeId, float mult) { barrierData.setMultiplier(typeId, mult); }
|
||||
public float getDamageMultiplier(String typeId) { return barrierData.getMultiplier(typeId); }
|
||||
public void setBarrierDuration(int ticks) {
|
||||
barrierData.setDurationTicks(ticks);
|
||||
}
|
||||
|
||||
public boolean isUseDuration() {
|
||||
return barrierData.useDuration;
|
||||
}
|
||||
|
||||
public void setUseDuration(boolean useDuration) {
|
||||
barrierData.useDuration = useDuration;
|
||||
}
|
||||
|
||||
public float getDefaultMultiplier() {
|
||||
return barrierData.defaultMultiplier;
|
||||
}
|
||||
|
||||
public void setDefaultMultiplier(float mult) {
|
||||
barrierData.defaultMultiplier = mult;
|
||||
}
|
||||
|
||||
public void setDamageMultiplier(String typeId, float mult) {
|
||||
barrierData.setMultiplier(typeId, mult);
|
||||
}
|
||||
|
||||
public float getDamageMultiplier(String typeId) {
|
||||
return barrierData.getMultiplier(typeId);
|
||||
}
|
||||
|
||||
// Knockback data
|
||||
public boolean isKnockbackEnabled() { return barrierData.knockbackEnabled; }
|
||||
public void setKnockbackEnabled(boolean enabled) { barrierData.knockbackEnabled = enabled; }
|
||||
public float getKnockbackStrength() { return barrierData.knockbackStrength; }
|
||||
public void setKnockbackStrength(float strength) { barrierData.knockbackStrength = strength; }
|
||||
public String getKnockbackTargetKey() { return barrierData.getKnockbackTargetKey(); }
|
||||
public void setKnockbackTargetKey(String key) { barrierData.setKnockbackTargetFromKey(key); }
|
||||
public boolean isKnockbackEnabled() {
|
||||
return barrierData.knockbackEnabled;
|
||||
}
|
||||
|
||||
public void setKnockbackEnabled(boolean enabled) {
|
||||
barrierData.knockbackEnabled = enabled;
|
||||
}
|
||||
|
||||
public float getKnockbackStrength() {
|
||||
return barrierData.knockbackStrength;
|
||||
}
|
||||
|
||||
public void setKnockbackStrength(float strength) {
|
||||
barrierData.knockbackStrength = strength;
|
||||
}
|
||||
|
||||
public String getKnockbackTargetKey() {
|
||||
return barrierData.getKnockbackTargetKey();
|
||||
}
|
||||
|
||||
public void setKnockbackTargetKey(String key) {
|
||||
barrierData.setKnockbackTargetFromKey(key);
|
||||
}
|
||||
|
||||
// Melee data
|
||||
public boolean isMeleeEnabled() { return barrierData.meleeEnabled; }
|
||||
public void setMeleeEnabled(boolean enabled) { barrierData.meleeEnabled = enabled; }
|
||||
public float getMeleeDamageMultiplier() { return barrierData.meleeDamageMultiplier; }
|
||||
public void setMeleeDamageMultiplier(float mult) { barrierData.meleeDamageMultiplier = mult; }
|
||||
public boolean isMeleeEnabled() {
|
||||
return barrierData.meleeEnabled;
|
||||
}
|
||||
|
||||
public void setMeleeEnabled(boolean enabled) {
|
||||
barrierData.meleeEnabled = enabled;
|
||||
}
|
||||
|
||||
public float getMeleeDamageMultiplier() {
|
||||
return barrierData.meleeDamageMultiplier;
|
||||
}
|
||||
|
||||
public void setMeleeDamageMultiplier(float mult) {
|
||||
barrierData.meleeDamageMultiplier = mult;
|
||||
}
|
||||
|
||||
// ==================== GUI ====================
|
||||
|
||||
@@ -199,7 +257,7 @@ public abstract class AbilityEnergyBarrier extends AbilityEnergy {
|
||||
FieldDef.floatField("ability.knockbackStrength", this::getKnockbackStrength, this::setKnockbackStrength)
|
||||
.range(0, 10).visibleWhen(this::isKnockbackEnabled),
|
||||
FieldDef.stringEnumField("ability.knockbackTarget", EnergyBarrierData.getKnockbackTargetKeys(),
|
||||
this::getKnockbackTargetKey, this::setKnockbackTargetKey)
|
||||
this::getKnockbackTargetKey, this::setKnockbackTargetKey)
|
||||
.visibleWhen(this::isKnockbackEnabled)
|
||||
));
|
||||
|
||||
|
||||
+191
-54
@@ -2,10 +2,14 @@ package kamkeel.npcs.controllers.data.ability.type.energy;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.AnchorPoint;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
import kamkeel.npcs.controllers.data.ability.data.*;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyCombatData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyHomingData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLifespanData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyTrajectoryData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.ProjectileData;
|
||||
import kamkeel.npcs.controllers.data.telegraph.Telegraph;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphInstance;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
@@ -24,7 +28,7 @@ import java.util.List;
|
||||
* Abstract base for energy projectile abilities (Orb, Disc, Beam, LaserShot).
|
||||
* Handles shared lifecycle (windup → execute → active → completion), multi-projectile
|
||||
* support with staggered firing, telegraph creation, NBT persistence, and GUI definitions.
|
||||
*
|
||||
* <p>
|
||||
* Subclasses provide entity creation/firing/charging logic and type-specific fields.
|
||||
*
|
||||
* @param <E> The entity type this ability spawns
|
||||
@@ -74,7 +78,7 @@ public abstract class AbilityEnergyProjectile<E extends EntityEnergyProjectile>
|
||||
* Called during windup (tick 1) and burst refire (onExecute when entities are null).
|
||||
*/
|
||||
protected abstract E createEntity(EntityLivingBase caster, EntityLivingBase target,
|
||||
Vec3 spawnPos, EnergyDisplayData resolved, int index);
|
||||
Vec3 spawnPos, EnergyDisplayData resolved, int index);
|
||||
|
||||
/**
|
||||
* Fire an entity (start moving toward target). Entity is guaranteed non-null and alive.
|
||||
@@ -90,7 +94,7 @@ public abstract class AbilityEnergyProjectile<E extends EntityEnergyProjectile>
|
||||
* Setup entity for preview mode during windup.
|
||||
*/
|
||||
protected abstract void setupEntityPreview(E entity, EntityLivingBase caster,
|
||||
EnergyDisplayData resolved, ProjectileData projData, int index);
|
||||
EnergyDisplayData resolved, ProjectileData projData, int index);
|
||||
|
||||
/**
|
||||
* Create typed array (Java generics can't create generic arrays).
|
||||
@@ -129,9 +133,12 @@ public abstract class AbilityEnergyProjectile<E extends EntityEnergyProjectile>
|
||||
*/
|
||||
protected AnchorPoint getDefaultAnchor(int index) {
|
||||
switch (index) {
|
||||
case 0: return AnchorPoint.RIGHT_HAND;
|
||||
case 1: return AnchorPoint.LEFT_HAND;
|
||||
default: return AnchorPoint.FRONT;
|
||||
case 0:
|
||||
return AnchorPoint.RIGHT_HAND;
|
||||
case 1:
|
||||
return AnchorPoint.LEFT_HAND;
|
||||
default:
|
||||
return AnchorPoint.FRONT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,15 +175,31 @@ public abstract class AbilityEnergyProjectile<E extends EntityEnergyProjectile>
|
||||
}
|
||||
}
|
||||
|
||||
public int getProjectileCount() { return projectileCount; }
|
||||
public int getProjectileCount() {
|
||||
return projectileCount;
|
||||
}
|
||||
|
||||
public int getFireDelay() { return fireDelay; }
|
||||
public void setFireDelay(int delay) { this.fireDelay = Math.max(0, delay); }
|
||||
public int getFireDelay() {
|
||||
return fireDelay;
|
||||
}
|
||||
|
||||
/** @deprecated Use {@link #getFireDelay()} */
|
||||
public int getDualFireDelay() { return fireDelay; }
|
||||
/** @deprecated Use {@link #setFireDelay(int)} */
|
||||
public void setDualFireDelay(int delay) { setFireDelay(delay); }
|
||||
public void setFireDelay(int delay) {
|
||||
this.fireDelay = Math.max(0, delay);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #getFireDelay()}
|
||||
*/
|
||||
public int getDualFireDelay() {
|
||||
return fireDelay;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #setFireDelay(int)}
|
||||
*/
|
||||
public void setDualFireDelay(int delay) {
|
||||
setFireDelay(delay);
|
||||
}
|
||||
|
||||
protected int clampIndex(int index) {
|
||||
return Math.max(0, Math.min(index, projectileCount - 1));
|
||||
@@ -317,7 +340,7 @@ public abstract class AbilityEnergyProjectile<E extends EntityEnergyProjectile>
|
||||
// Check if entity was removed from world (chunk unload, etc.)
|
||||
// Skip this check for preview entities - they're not registered in the world
|
||||
if (!isPreview() && tick > 5 && entity.worldObj != null
|
||||
&& entity.worldObj.getEntityByID(entity.getEntityId()) != entity) {
|
||||
&& entity.worldObj.getEntityByID(entity.getEntityId()) != entity) {
|
||||
entity.setDead();
|
||||
continue;
|
||||
}
|
||||
@@ -449,64 +472,163 @@ public abstract class AbilityEnergyProjectile<E extends EntityEnergyProjectile>
|
||||
// ==================== API GETTERS & SETTERS ====================
|
||||
|
||||
// Combat data
|
||||
@Override public float getDamage() { return combatData.damage; }
|
||||
@Override public void setDamage(float damage) { combatData.damage = damage; }
|
||||
@Override
|
||||
public float getDamage() {
|
||||
return combatData.damage;
|
||||
}
|
||||
|
||||
@Override public float getKnockback() { return combatData.knockback; }
|
||||
@Override public void setKnockback(float knockback) { combatData.knockback = knockback; }
|
||||
@Override
|
||||
public void setDamage(float damage) {
|
||||
combatData.damage = damage;
|
||||
}
|
||||
|
||||
@Override public float getKnockbackUp() { return combatData.knockbackUp; }
|
||||
@Override public void setKnockbackUp(float knockbackUp) { combatData.knockbackUp = knockbackUp; }
|
||||
@Override
|
||||
public float getKnockback() {
|
||||
return combatData.knockback;
|
||||
}
|
||||
|
||||
@Override public boolean isExplosive() { return combatData.explosive; }
|
||||
@Override public void setExplosive(boolean explosive) { combatData.explosive = explosive; }
|
||||
@Override
|
||||
public void setKnockback(float knockback) {
|
||||
combatData.knockback = knockback;
|
||||
}
|
||||
|
||||
@Override public float getExplosionRadius() { return combatData.explosionRadius; }
|
||||
@Override public void setExplosionRadius(float explosionRadius) { combatData.explosionRadius = explosionRadius; }
|
||||
@Override
|
||||
public float getKnockbackUp() {
|
||||
return combatData.knockbackUp;
|
||||
}
|
||||
|
||||
@Override public float getExplosionDamageFalloff() { return combatData.explosionDamageFalloff; }
|
||||
@Override public void setExplosionDamageFalloff(float falloff) { combatData.explosionDamageFalloff = falloff; }
|
||||
@Override
|
||||
public void setKnockbackUp(float knockbackUp) {
|
||||
combatData.knockbackUp = knockbackUp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExplosive() {
|
||||
return combatData.explosive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExplosive(boolean explosive) {
|
||||
combatData.explosive = explosive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExplosionRadius() {
|
||||
return combatData.explosionRadius;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExplosionRadius(float explosionRadius) {
|
||||
combatData.explosionRadius = explosionRadius;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExplosionDamageFalloff() {
|
||||
return combatData.explosionDamageFalloff;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExplosionDamageFalloff(float falloff) {
|
||||
combatData.explosionDamageFalloff = falloff;
|
||||
}
|
||||
|
||||
// Lifespan data
|
||||
@Override public float getMaxDistance() { return lifespanData.maxDistance; }
|
||||
@Override public void setMaxDistance(float maxDistance) { lifespanData.maxDistance = maxDistance; }
|
||||
@Override
|
||||
public float getMaxDistance() {
|
||||
return lifespanData.maxDistance;
|
||||
}
|
||||
|
||||
@Override public int getMaxLifetime() { return lifespanData.maxLifetime; }
|
||||
@Override public void setMaxLifetime(int maxLifetime) { lifespanData.maxLifetime = maxLifetime; }
|
||||
@Override
|
||||
public void setMaxDistance(float maxDistance) {
|
||||
lifespanData.maxDistance = maxDistance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLifetime() {
|
||||
return lifespanData.maxLifetime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMaxLifetime(int maxLifetime) {
|
||||
lifespanData.maxLifetime = maxLifetime;
|
||||
}
|
||||
|
||||
// Homing data
|
||||
public boolean isHoming() { return homingData.homing; }
|
||||
public void setHoming(boolean homing) { homingData.homing = homing; }
|
||||
public boolean isHoming() {
|
||||
return homingData.homing;
|
||||
}
|
||||
|
||||
public float getHomingStrength() { return homingData.homingStrength; }
|
||||
public void setHomingStrength(float strength) { homingData.homingStrength = strength; }
|
||||
public void setHoming(boolean homing) {
|
||||
homingData.homing = homing;
|
||||
}
|
||||
|
||||
public float getHomingRange() { return homingData.homingRange; }
|
||||
public void setHomingRange(float range) { homingData.homingRange = range; }
|
||||
public float getHomingStrength() {
|
||||
return homingData.homingStrength;
|
||||
}
|
||||
|
||||
public void setHomingStrength(float strength) {
|
||||
homingData.homingStrength = strength;
|
||||
}
|
||||
|
||||
public float getHomingRange() {
|
||||
return homingData.homingRange;
|
||||
}
|
||||
|
||||
public void setHomingRange(float range) {
|
||||
homingData.homingRange = range;
|
||||
}
|
||||
|
||||
// Display and lightning data inherited from AbilityEnergy
|
||||
|
||||
// Anchor - default to projectile 0
|
||||
public AnchorPoint getAnchorPointEnum() { return projectiles[0].anchor.anchorPoint; }
|
||||
public void setAnchorPointEnum(AnchorPoint point) { projectiles[0].anchor.anchorPoint = point; }
|
||||
public AnchorPoint getAnchorPointEnum() {
|
||||
return projectiles[0].anchor.anchorPoint;
|
||||
}
|
||||
|
||||
public float getAnchorOffsetX() { return projectiles[0].anchor.anchorOffsetX; }
|
||||
public void setAnchorOffsetX(float x) { projectiles[0].anchor.anchorOffsetX = x; }
|
||||
public void setAnchorPointEnum(AnchorPoint point) {
|
||||
projectiles[0].anchor.anchorPoint = point;
|
||||
}
|
||||
|
||||
public float getAnchorOffsetY() { return projectiles[0].anchor.anchorOffsetY; }
|
||||
public void setAnchorOffsetY(float y) { projectiles[0].anchor.anchorOffsetY = y; }
|
||||
public float getAnchorOffsetX() {
|
||||
return projectiles[0].anchor.anchorOffsetX;
|
||||
}
|
||||
|
||||
public float getAnchorOffsetZ() { return projectiles[0].anchor.anchorOffsetZ; }
|
||||
public void setAnchorOffsetZ(float z) { projectiles[0].anchor.anchorOffsetZ = z; }
|
||||
public void setAnchorOffsetX(float x) {
|
||||
projectiles[0].anchor.anchorOffsetX = x;
|
||||
}
|
||||
|
||||
@Override public int getAnchorPoint() { return projectiles[0].anchor.anchorPoint.ordinal(); }
|
||||
@Override public void setAnchorPoint(int point) { projectiles[0].anchor.anchorPoint = AnchorPoint.fromOrdinal(point); }
|
||||
public float getAnchorOffsetY() {
|
||||
return projectiles[0].anchor.anchorOffsetY;
|
||||
}
|
||||
|
||||
public void setAnchorOffsetY(float y) {
|
||||
projectiles[0].anchor.anchorOffsetY = y;
|
||||
}
|
||||
|
||||
public float getAnchorOffsetZ() {
|
||||
return projectiles[0].anchor.anchorOffsetZ;
|
||||
}
|
||||
|
||||
public void setAnchorOffsetZ(float z) {
|
||||
projectiles[0].anchor.anchorOffsetZ = z;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAnchorPoint() {
|
||||
return projectiles[0].anchor.anchorPoint.ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAnchorPoint(int point) {
|
||||
projectiles[0].anchor.anchorPoint = AnchorPoint.fromOrdinal(point);
|
||||
}
|
||||
|
||||
// Indexed API methods
|
||||
public int getInnerColor(int index) {
|
||||
ProjectileData p = projectiles[clampIndex(index)];
|
||||
return p.colorOverride ? p.innerColor : displayData.innerColor;
|
||||
}
|
||||
|
||||
public void setInnerColor(int index, int color) {
|
||||
ProjectileData p = projectiles[clampIndex(index)];
|
||||
p.colorOverride = true;
|
||||
@@ -517,17 +639,32 @@ public abstract class AbilityEnergyProjectile<E extends EntityEnergyProjectile>
|
||||
ProjectileData p = projectiles[clampIndex(index)];
|
||||
return p.colorOverride ? p.outerColor : displayData.outerColor;
|
||||
}
|
||||
|
||||
public void setOuterColor(int index, int color) {
|
||||
ProjectileData p = projectiles[clampIndex(index)];
|
||||
p.colorOverride = true;
|
||||
p.outerColor = color;
|
||||
}
|
||||
|
||||
public int getAnchorPoint(int index) { return projectiles[clampIndex(index)].anchor.anchorPoint.ordinal(); }
|
||||
public void setAnchorPoint(int index, int point) { projectiles[clampIndex(index)].anchor.anchorPoint = AnchorPoint.fromOrdinal(point); }
|
||||
public void setAnchorOffsetX(int index, float offset) { projectiles[clampIndex(index)].anchor.anchorOffsetX = offset; }
|
||||
public void setAnchorOffsetY(int index, float offset) { projectiles[clampIndex(index)].anchor.anchorOffsetY = offset; }
|
||||
public void setAnchorOffsetZ(int index, float offset) { projectiles[clampIndex(index)].anchor.anchorOffsetZ = offset; }
|
||||
public int getAnchorPoint(int index) {
|
||||
return projectiles[clampIndex(index)].anchor.anchorPoint.ordinal();
|
||||
}
|
||||
|
||||
public void setAnchorPoint(int index, int point) {
|
||||
projectiles[clampIndex(index)].anchor.anchorPoint = AnchorPoint.fromOrdinal(point);
|
||||
}
|
||||
|
||||
public void setAnchorOffsetX(int index, float offset) {
|
||||
projectiles[clampIndex(index)].anchor.anchorOffsetX = offset;
|
||||
}
|
||||
|
||||
public void setAnchorOffsetY(int index, float offset) {
|
||||
projectiles[clampIndex(index)].anchor.anchorOffsetY = offset;
|
||||
}
|
||||
|
||||
public void setAnchorOffsetZ(int index, float offset) {
|
||||
projectiles[clampIndex(index)].anchor.anchorOffsetZ = offset;
|
||||
}
|
||||
|
||||
// ==================== GUI FIELD DEFINITIONS ====================
|
||||
|
||||
@@ -555,7 +692,7 @@ public abstract class AbilityEnergyProjectile<E extends EntityEnergyProjectile>
|
||||
.visibleWhen(() -> idx < projectileCount));
|
||||
|
||||
defs.add(FieldDef.enumField("ability.anchorPoint", AnchorPoint.class,
|
||||
() -> projectiles[idx].anchor.anchorPoint, v -> projectiles[idx].anchor.anchorPoint = v)
|
||||
() -> projectiles[idx].anchor.anchorPoint, v -> projectiles[idx].anchor.anchorPoint = v)
|
||||
.tab("ability.tab.visual").visibleWhen(() -> idx < projectileCount));
|
||||
defs.add(FieldDef.row(
|
||||
FieldDef.floatField("ability.anchor.offsetX", () -> projectiles[idx].anchor.anchorOffsetX, v -> projectiles[idx].anchor.anchorOffsetX = v)
|
||||
|
||||
+28
-9
@@ -6,7 +6,11 @@ import kamkeel.npcs.controllers.data.ability.AnchorPoint;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
import kamkeel.npcs.controllers.data.ability.RotationMode;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
import kamkeel.npcs.controllers.data.ability.data.*;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyCombatData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyHomingData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLifespanData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.ProjectileData;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import kamkeel.npcs.controllers.data.telegraph.Telegraph;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphInstance;
|
||||
@@ -111,7 +115,7 @@ public class AbilityLaserShot extends AbilityEnergyProjectile<EntityAbilityLaser
|
||||
|
||||
@Override
|
||||
protected EntityAbilityLaser createEntity(EntityLivingBase caster, EntityLivingBase target,
|
||||
Vec3 spawnPos, EnergyDisplayData resolved, int index) {
|
||||
Vec3 spawnPos, EnergyDisplayData resolved, int index) {
|
||||
return new EntityAbilityLaser(
|
||||
caster.worldObj, caster, target,
|
||||
spawnPos.xCoord, spawnPos.yCoord, spawnPos.zCoord,
|
||||
@@ -133,7 +137,7 @@ public class AbilityLaserShot extends AbilityEnergyProjectile<EntityAbilityLaser
|
||||
|
||||
@Override
|
||||
protected void setupEntityPreview(EntityAbilityLaser laser, EntityLivingBase caster,
|
||||
EnergyDisplayData resolved, ProjectileData projData, int index) {
|
||||
EnergyDisplayData resolved, ProjectileData projData, int index) {
|
||||
laser.setupPreview(caster, laserWidth, resolved, lightningData, expansionSpeed, lifespanData.maxDistance);
|
||||
}
|
||||
|
||||
@@ -165,14 +169,29 @@ public class AbilityLaserShot extends AbilityEnergyProjectile<EntityAbilityLaser
|
||||
|
||||
// ==================== TYPE-SPECIFIC GETTERS ====================
|
||||
|
||||
public float getLaserWidth() { return laserWidth; }
|
||||
public void setLaserWidth(float laserWidth) { this.laserWidth = laserWidth; }
|
||||
public float getLaserWidth() {
|
||||
return laserWidth;
|
||||
}
|
||||
|
||||
public float getExpansionSpeed() { return expansionSpeed; }
|
||||
public void setExpansionSpeed(float expansionSpeed) { this.expansionSpeed = expansionSpeed; }
|
||||
public void setLaserWidth(float laserWidth) {
|
||||
this.laserWidth = laserWidth;
|
||||
}
|
||||
|
||||
public int getLingerTicks() { return lingerTicks; }
|
||||
public void setLingerTicks(int lingerTicks) { this.lingerTicks = lingerTicks; }
|
||||
public float getExpansionSpeed() {
|
||||
return expansionSpeed;
|
||||
}
|
||||
|
||||
public void setExpansionSpeed(float expansionSpeed) {
|
||||
this.expansionSpeed = expansionSpeed;
|
||||
}
|
||||
|
||||
public int getLingerTicks() {
|
||||
return lingerTicks;
|
||||
}
|
||||
|
||||
public void setLingerTicks(int lingerTicks) {
|
||||
this.lingerTicks = lingerTicks;
|
||||
}
|
||||
|
||||
// ==================== TYPE-SPECIFIC GUI ====================
|
||||
|
||||
|
||||
@@ -5,7 +5,11 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityVariant;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
import kamkeel.npcs.controllers.data.ability.data.*;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyCombatData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyHomingData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLifespanData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.ProjectileData;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
import kamkeel.npcs.entity.EntityAbilityOrb;
|
||||
@@ -51,7 +55,7 @@ public class AbilityOrb extends AbilityEnergyProjectile<EntityAbilityOrb> implem
|
||||
|
||||
@Override
|
||||
protected EntityAbilityOrb createEntity(EntityLivingBase caster, EntityLivingBase target,
|
||||
Vec3 spawnPos, EnergyDisplayData resolved, int index) {
|
||||
Vec3 spawnPos, EnergyDisplayData resolved, int index) {
|
||||
return new EntityAbilityOrb(
|
||||
caster.worldObj, caster, target,
|
||||
spawnPos.xCoord, spawnPos.yCoord, spawnPos.zCoord, orbSize,
|
||||
@@ -74,7 +78,7 @@ public class AbilityOrb extends AbilityEnergyProjectile<EntityAbilityOrb> implem
|
||||
|
||||
@Override
|
||||
protected void setupEntityPreview(EntityAbilityOrb orb, EntityLivingBase caster,
|
||||
EnergyDisplayData resolved, ProjectileData projData, int index) {
|
||||
EnergyDisplayData resolved, ProjectileData projData, int index) {
|
||||
orb.setupPreview(caster, orbSize, resolved, lightningData, projData.anchor, windUpTicks);
|
||||
}
|
||||
|
||||
@@ -137,11 +141,21 @@ public class AbilityOrb extends AbilityEnergyProjectile<EntityAbilityOrb> implem
|
||||
|
||||
// ==================== TYPE-SPECIFIC GETTERS ====================
|
||||
|
||||
public float getOrbSpeed() { return homingData.speed; }
|
||||
public void setOrbSpeed(float speed) { homingData.speed = speed; }
|
||||
public float getOrbSpeed() {
|
||||
return homingData.speed;
|
||||
}
|
||||
|
||||
public float getOrbSize() { return orbSize; }
|
||||
public void setOrbSize(float size) { this.orbSize = size; }
|
||||
public void setOrbSpeed(float speed) {
|
||||
homingData.speed = speed;
|
||||
}
|
||||
|
||||
public float getOrbSize() {
|
||||
return orbSize;
|
||||
}
|
||||
|
||||
public void setOrbSize(float size) {
|
||||
this.orbSize = size;
|
||||
}
|
||||
|
||||
// ==================== TYPE-SPECIFIC GUI ====================
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import kamkeel.npcs.controllers.data.ability.data.EnergyPanelData;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
import kamkeel.npcs.entity.EntityEnergyBarrier;
|
||||
import kamkeel.npcs.entity.EntityEnergyPanel;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
@@ -124,11 +123,21 @@ public class AbilityShield extends AbilityEnergyBarrier {
|
||||
|
||||
// ==================== GETTERS & SETTERS ====================
|
||||
|
||||
public float getShieldWidth() { return shieldWidth; }
|
||||
public void setShieldWidth(float width) { this.shieldWidth = Math.max(0.5f, width); }
|
||||
public float getShieldWidth() {
|
||||
return shieldWidth;
|
||||
}
|
||||
|
||||
public float getShieldHeight() { return shieldHeight; }
|
||||
public void setShieldHeight(float height) { this.shieldHeight = Math.max(0.5f, height); }
|
||||
public void setShieldWidth(float width) {
|
||||
this.shieldWidth = Math.max(0.5f, width);
|
||||
}
|
||||
|
||||
public float getShieldHeight() {
|
||||
return shieldHeight;
|
||||
}
|
||||
|
||||
public void setShieldHeight(float height) {
|
||||
this.shieldHeight = Math.max(0.5f, height);
|
||||
}
|
||||
|
||||
// ==================== TYPE-SPECIFIC GUI ====================
|
||||
|
||||
|
||||
+35
-11
@@ -5,7 +5,11 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityVariant;
|
||||
import kamkeel.npcs.controllers.data.ability.LockMovementType;
|
||||
import kamkeel.npcs.controllers.data.ability.TargetingMode;
|
||||
import kamkeel.npcs.controllers.data.ability.data.*;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyCombatData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyHomingData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLifespanData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.ProjectileData;
|
||||
import kamkeel.npcs.controllers.data.ability.gui.AbilityFieldDefs;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
import kamkeel.npcs.entity.EntityEnergySlicer;
|
||||
@@ -53,7 +57,7 @@ public class AbilitySlicer extends AbilityEnergyProjectile<EntityEnergySlicer> {
|
||||
|
||||
@Override
|
||||
protected EntityEnergySlicer createEntity(EntityLivingBase caster, EntityLivingBase target,
|
||||
Vec3 spawnPos, EnergyDisplayData resolved, int index) {
|
||||
Vec3 spawnPos, EnergyDisplayData resolved, int index) {
|
||||
return new EntityEnergySlicer(
|
||||
caster.worldObj, caster, target,
|
||||
spawnPos.xCoord, spawnPos.yCoord, spawnPos.zCoord,
|
||||
@@ -79,7 +83,7 @@ public class AbilitySlicer extends AbilityEnergyProjectile<EntityEnergySlicer> {
|
||||
|
||||
@Override
|
||||
protected void setupEntityPreview(EntityEnergySlicer slicer, EntityLivingBase caster,
|
||||
EnergyDisplayData resolved, ProjectileData projData, int index) {
|
||||
EnergyDisplayData resolved, ProjectileData projData, int index) {
|
||||
slicer.setupPreview(caster, sliceWidth, sliceThickness, resolved, lightningData, projData.anchor, windUpTicks);
|
||||
}
|
||||
|
||||
@@ -130,17 +134,37 @@ public class AbilitySlicer extends AbilityEnergyProjectile<EntityEnergySlicer> {
|
||||
|
||||
// ==================== TYPE-SPECIFIC GETTERS ====================
|
||||
|
||||
public float getSlicerSpeed() { return homingData.speed; }
|
||||
public void setSlicerSpeed(float speed) { homingData.speed = speed; }
|
||||
public float getSlicerSpeed() {
|
||||
return homingData.speed;
|
||||
}
|
||||
|
||||
public float getSliceWidth() { return sliceWidth; }
|
||||
public void setSliceWidth(float width) { this.sliceWidth = Math.max(0.5f, width); }
|
||||
public void setSlicerSpeed(float speed) {
|
||||
homingData.speed = speed;
|
||||
}
|
||||
|
||||
public float getSliceThickness() { return sliceThickness; }
|
||||
public void setSliceThickness(float thickness) { this.sliceThickness = Math.max(0.05f, thickness); }
|
||||
public float getSliceWidth() {
|
||||
return sliceWidth;
|
||||
}
|
||||
|
||||
public boolean isPiercing() { return piercing; }
|
||||
public void setPiercing(boolean piercing) { this.piercing = piercing; }
|
||||
public void setSliceWidth(float width) {
|
||||
this.sliceWidth = Math.max(0.5f, width);
|
||||
}
|
||||
|
||||
public float getSliceThickness() {
|
||||
return sliceThickness;
|
||||
}
|
||||
|
||||
public void setSliceThickness(float thickness) {
|
||||
this.sliceThickness = Math.max(0.05f, thickness);
|
||||
}
|
||||
|
||||
public boolean isPiercing() {
|
||||
return piercing;
|
||||
}
|
||||
|
||||
public void setPiercing(boolean piercing) {
|
||||
this.piercing = piercing;
|
||||
}
|
||||
|
||||
// ==================== TYPE-SPECIFIC GUI ====================
|
||||
|
||||
|
||||
+72
-19
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
* Sweeper ability: A low sweeping beam that rotates around the NPC.
|
||||
* Players can jump over it. The beam completes a set number of rotations before ending.
|
||||
* Telegraph shows a large circle on the ground indicating range.
|
||||
*
|
||||
* <p>
|
||||
* All damage logic is handled by the EntityAbilitySweeper entity to ensure
|
||||
* visual and damage hitbox alignment.
|
||||
*/
|
||||
@@ -173,24 +173,77 @@ public class AbilitySweeper extends AbilityEnergy implements IAbilitySweeper {
|
||||
}
|
||||
|
||||
// Getters & Setters (type-specific only; color/lightning inherited from AbilityEnergy)
|
||||
public float getBeamLength() { return beamLength; }
|
||||
public void setBeamLength(float beamLength) { this.beamLength = beamLength; }
|
||||
public float getBeamWidth() { return beamWidth; }
|
||||
public void setBeamWidth(float beamWidth) { this.beamWidth = beamWidth; }
|
||||
public float getBeamHeight() { return beamHeight; }
|
||||
public void setBeamHeight(float beamHeight) { this.beamHeight = beamHeight; }
|
||||
public float getDamage() { return damage; }
|
||||
public void setDamage(float damage) { this.damage = damage; }
|
||||
public int getDamageInterval() { return damageInterval; }
|
||||
public void setDamageInterval(int damageInterval) { this.damageInterval = damageInterval; }
|
||||
public boolean isPiercing() { return piercing; }
|
||||
public void setPiercing(boolean piercing) { this.piercing = piercing; }
|
||||
public float getSweepSpeed() { return sweepSpeed; }
|
||||
public void setSweepSpeed(float sweepSpeed) { this.sweepSpeed = sweepSpeed; }
|
||||
public int getNumberOfRotations() { return numberOfRotations; }
|
||||
public void setNumberOfRotations(int numberOfRotations) { this.numberOfRotations = numberOfRotations; }
|
||||
public boolean isLockOnTarget() { return lockOnTarget; }
|
||||
public void setLockOnTarget(boolean lockOnTarget) { this.lockOnTarget = lockOnTarget; }
|
||||
public float getBeamLength() {
|
||||
return beamLength;
|
||||
}
|
||||
|
||||
public void setBeamLength(float beamLength) {
|
||||
this.beamLength = beamLength;
|
||||
}
|
||||
|
||||
public float getBeamWidth() {
|
||||
return beamWidth;
|
||||
}
|
||||
|
||||
public void setBeamWidth(float beamWidth) {
|
||||
this.beamWidth = beamWidth;
|
||||
}
|
||||
|
||||
public float getBeamHeight() {
|
||||
return beamHeight;
|
||||
}
|
||||
|
||||
public void setBeamHeight(float beamHeight) {
|
||||
this.beamHeight = beamHeight;
|
||||
}
|
||||
|
||||
public float getDamage() {
|
||||
return damage;
|
||||
}
|
||||
|
||||
public void setDamage(float damage) {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
public int getDamageInterval() {
|
||||
return damageInterval;
|
||||
}
|
||||
|
||||
public void setDamageInterval(int damageInterval) {
|
||||
this.damageInterval = damageInterval;
|
||||
}
|
||||
|
||||
public boolean isPiercing() {
|
||||
return piercing;
|
||||
}
|
||||
|
||||
public void setPiercing(boolean piercing) {
|
||||
this.piercing = piercing;
|
||||
}
|
||||
|
||||
public float getSweepSpeed() {
|
||||
return sweepSpeed;
|
||||
}
|
||||
|
||||
public void setSweepSpeed(float sweepSpeed) {
|
||||
this.sweepSpeed = sweepSpeed;
|
||||
}
|
||||
|
||||
public int getNumberOfRotations() {
|
||||
return numberOfRotations;
|
||||
}
|
||||
|
||||
public void setNumberOfRotations(int numberOfRotations) {
|
||||
this.numberOfRotations = numberOfRotations;
|
||||
}
|
||||
|
||||
public boolean isLockOnTarget() {
|
||||
return lockOnTarget;
|
||||
}
|
||||
|
||||
public void setLockOnTarget(boolean lockOnTarget) {
|
||||
this.lockOnTarget = lockOnTarget;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxPreviewDuration() {
|
||||
|
||||
@@ -11,7 +11,6 @@ import kamkeel.npcs.controllers.data.ability.data.EnergyPanelData;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
import kamkeel.npcs.entity.EntityEnergyBarrier;
|
||||
import kamkeel.npcs.entity.EntityEnergyPanel;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.gui.builder.FieldDef;
|
||||
@@ -139,28 +138,65 @@ public class AbilityWall extends AbilityEnergyBarrier {
|
||||
|
||||
// ==================== GETTERS & SETTERS ====================
|
||||
|
||||
public EnergyPanelData getPanelData() { return panelData; }
|
||||
public EnergyPanelData getPanelData() {
|
||||
return panelData;
|
||||
}
|
||||
|
||||
public float getPanelWidth() { return panelData.panelWidth; }
|
||||
public void setPanelWidth(float width) { panelData.setPanelWidth(width); }
|
||||
public float getPanelWidth() {
|
||||
return panelData.panelWidth;
|
||||
}
|
||||
|
||||
public float getPanelHeight() { return panelData.panelHeight; }
|
||||
public void setPanelHeight(float height) { panelData.setPanelHeight(height); }
|
||||
public void setPanelWidth(float width) {
|
||||
panelData.setPanelWidth(width);
|
||||
}
|
||||
|
||||
public float getHeightOffset() { return panelData.heightOffset; }
|
||||
public void setHeightOffset(float offset) { panelData.heightOffset = offset; }
|
||||
public float getPanelHeight() {
|
||||
return panelData.panelHeight;
|
||||
}
|
||||
|
||||
public boolean isLaunching() { return panelData.launching; }
|
||||
public void setLaunching(boolean launching) { panelData.launching = launching; }
|
||||
public void setPanelHeight(float height) {
|
||||
panelData.setPanelHeight(height);
|
||||
}
|
||||
|
||||
public float getLaunchSpeed() { return panelData.launchSpeed; }
|
||||
public void setLaunchSpeed(float speed) { panelData.setLaunchSpeed(speed); }
|
||||
public float getHeightOffset() {
|
||||
return panelData.heightOffset;
|
||||
}
|
||||
|
||||
public float getLaunchDamage() { return panelData.launchDamage; }
|
||||
public void setLaunchDamage(float damage) { panelData.setLaunchDamage(damage); }
|
||||
public void setHeightOffset(float offset) {
|
||||
panelData.heightOffset = offset;
|
||||
}
|
||||
|
||||
public float getLaunchKnockback() { return panelData.launchKnockback; }
|
||||
public void setLaunchKnockback(float kb) { panelData.setLaunchKnockback(kb); }
|
||||
public boolean isLaunching() {
|
||||
return panelData.launching;
|
||||
}
|
||||
|
||||
public void setLaunching(boolean launching) {
|
||||
panelData.launching = launching;
|
||||
}
|
||||
|
||||
public float getLaunchSpeed() {
|
||||
return panelData.launchSpeed;
|
||||
}
|
||||
|
||||
public void setLaunchSpeed(float speed) {
|
||||
panelData.setLaunchSpeed(speed);
|
||||
}
|
||||
|
||||
public float getLaunchDamage() {
|
||||
return panelData.launchDamage;
|
||||
}
|
||||
|
||||
public void setLaunchDamage(float damage) {
|
||||
panelData.setLaunchDamage(damage);
|
||||
}
|
||||
|
||||
public float getLaunchKnockback() {
|
||||
return panelData.launchKnockback;
|
||||
}
|
||||
|
||||
public void setLaunchKnockback(float kb) {
|
||||
panelData.setLaunchKnockback(kb);
|
||||
}
|
||||
|
||||
// ==================== TYPE-SPECIFIC GUI ====================
|
||||
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
package kamkeel.npcs.entity;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.data.*;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyAnchorData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyCombatData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyHomingData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLifespanData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLightningData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyTrajectoryData;
|
||||
import kamkeel.npcs.util.AnchorPointHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.EventHooks;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
@@ -11,6 +16,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.EventHooks;
|
||||
import noppes.npcs.LogWriter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -19,10 +25,10 @@ import java.util.List;
|
||||
/**
|
||||
* Beam projectile - head with trailing path that curves with homing.
|
||||
* Stays attached to origin point, trail shows path of head.
|
||||
*
|
||||
* <p>
|
||||
* IMPORTANT: Trail points are stored RELATIVE to startX/Y/Z (origin).
|
||||
* This ensures rendering is stable regardless of entity position interpolation.
|
||||
*
|
||||
* <p>
|
||||
* Design inspired by LouisXIV's energy attack system.
|
||||
*/
|
||||
public class EntityAbilityBeam extends EntityEnergyProjectile {
|
||||
@@ -63,6 +69,7 @@ public class EntityAbilityBeam extends EntityEnergyProjectile {
|
||||
|
||||
/**
|
||||
* Full constructor with all parameters using data classes.
|
||||
*
|
||||
* @param anchoredMode If true, origin follows owner and tail orb is rendered.
|
||||
* If false, beam is free-moving with trailing length (no tail orb).
|
||||
*/
|
||||
@@ -214,7 +221,7 @@ public class EntityAbilityBeam extends EntityEnergyProjectile {
|
||||
/**
|
||||
* Start the beam firing (exit charging mode).
|
||||
* Called by ability when windup ends.
|
||||
*
|
||||
* <p>
|
||||
* For anchored beams: origin follows owner, head starts at charged position
|
||||
* For non-anchored beams: origin fixed at charged position, head starts there
|
||||
*/
|
||||
@@ -281,8 +288,8 @@ public class EntityAbilityBeam extends EntityEnergyProjectile {
|
||||
// Check distance using head offset (distance from origin)
|
||||
double distFromOrigin = Math.sqrt(
|
||||
headOffsetX * headOffsetX +
|
||||
headOffsetY * headOffsetY +
|
||||
headOffsetZ * headOffsetZ
|
||||
headOffsetY * headOffsetY +
|
||||
headOffsetZ * headOffsetZ
|
||||
);
|
||||
boolean exceeded = distFromOrigin >= getMaxDistance();
|
||||
if (exceeded && !worldObj.isRemote && DEBUG_LOGGING) {
|
||||
@@ -440,8 +447,8 @@ public class EntityAbilityBeam extends EntityEnergyProjectile {
|
||||
Vec3 lastPoint = trailPoints.get(trailPoints.size() - 1);
|
||||
double dist = Math.sqrt(
|
||||
(headOffsetX - lastPoint.xCoord) * (headOffsetX - lastPoint.xCoord) +
|
||||
(headOffsetY - lastPoint.yCoord) * (headOffsetY - lastPoint.yCoord) +
|
||||
(headOffsetZ - lastPoint.zCoord) * (headOffsetZ - lastPoint.zCoord)
|
||||
(headOffsetY - lastPoint.yCoord) * (headOffsetY - lastPoint.yCoord) +
|
||||
(headOffsetZ - lastPoint.zCoord) * (headOffsetZ - lastPoint.zCoord)
|
||||
);
|
||||
|
||||
if (dist >= MIN_POINT_DISTANCE) {
|
||||
|
||||
@@ -1,22 +1,28 @@
|
||||
package kamkeel.npcs.entity;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.data.*;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyAnchorData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyCombatData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyHomingData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLifespanData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLightningData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyTrajectoryData;
|
||||
import kamkeel.npcs.util.AnchorPointHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.EventHooks;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.EventHooks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Disc projectile - flat spinning disc with optional boomerang behavior.
|
||||
* Has a wider, thinner hitbox compared to Orb.
|
||||
*
|
||||
* <p>
|
||||
* Design inspired by LouisXIV's energy attack system.
|
||||
*/
|
||||
public class EntityAbilityDisc extends EntityEnergyProjectile {
|
||||
@@ -252,8 +258,8 @@ public class EntityAbilityDisc extends EntityEnergyProjectile {
|
||||
protected boolean checkMaxDistance() {
|
||||
double distTraveled = Math.sqrt(
|
||||
(posX - startX) * (posX - startX) +
|
||||
(posY - startY) * (posY - startY) +
|
||||
(posZ - startZ) * (posZ - startZ)
|
||||
(posY - startY) * (posY - startY) +
|
||||
(posZ - startZ) * (posZ - startZ)
|
||||
);
|
||||
|
||||
if (boomerang) {
|
||||
@@ -270,8 +276,8 @@ public class EntityAbilityDisc extends EntityEnergyProjectile {
|
||||
if (owner != null) {
|
||||
double distToOwner = Math.sqrt(
|
||||
(posX - owner.posX) * (posX - owner.posX) +
|
||||
(posY - owner.posY) * (posY - owner.posY) +
|
||||
(posZ - owner.posZ) * (posZ - owner.posZ)
|
||||
(posY - owner.posY) * (posY - owner.posY) +
|
||||
(posZ - owner.posZ) * (posZ - owner.posZ)
|
||||
);
|
||||
return distToOwner < 1.5;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
package kamkeel.npcs.entity;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.data.*;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyCombatData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLifespanData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLightningData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyTrajectoryData;
|
||||
import kamkeel.npcs.util.AnchorPointHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.EventHooks;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.EventHooks;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -18,7 +22,7 @@ import java.util.Set;
|
||||
/**
|
||||
* Laser projectile - fast expanding thin line that pierces through multiple targets.
|
||||
* No homing, travels in a straight line from origin to max distance.
|
||||
*
|
||||
* <p>
|
||||
* Design inspired by LouisXIV's energy attack system.
|
||||
*/
|
||||
public class EntityAbilityLaser extends EntityEnergyProjectile {
|
||||
@@ -246,8 +250,8 @@ public class EntityAbilityLaser extends EntityEnergyProjectile {
|
||||
// Laser stops at block
|
||||
currentLength = (float) Math.sqrt(
|
||||
(blockHit.hitVec.xCoord - startX) * (blockHit.hitVec.xCoord - startX) +
|
||||
(blockHit.hitVec.yCoord - startY) * (blockHit.hitVec.yCoord - startY) +
|
||||
(blockHit.hitVec.zCoord - startZ) * (blockHit.hitVec.zCoord - startZ)
|
||||
(blockHit.hitVec.yCoord - startY) * (blockHit.hitVec.yCoord - startY) +
|
||||
(blockHit.hitVec.zCoord - startZ) * (blockHit.hitVec.zCoord - startZ)
|
||||
);
|
||||
endX = blockHit.hitVec.xCoord;
|
||||
endY = blockHit.hitVec.yCoord;
|
||||
|
||||
@@ -1,22 +1,28 @@
|
||||
package kamkeel.npcs.entity;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.data.*;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyAnchorData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyCombatData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyHomingData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLifespanData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLightningData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyTrajectoryData;
|
||||
import kamkeel.npcs.util.AnchorPointHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import noppes.npcs.EventHooks;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.EventHooks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Orb projectile - spherical homing energy ball.
|
||||
* Extends EntityEnergyAbility for shared functionality.
|
||||
*
|
||||
* <p>
|
||||
* Design inspired by LouisXIV's energy attack system.
|
||||
*/
|
||||
public class EntityAbilityOrb extends EntityEnergyProjectile {
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.Set;
|
||||
* Unlike other projectiles, this handles its own damage logic since it's
|
||||
* attached to and rotates around the caster.
|
||||
* Extends EntityEnergyAbility for shared visual/owner/charging state.
|
||||
*
|
||||
* <p>
|
||||
* Design: Similar to Beam trail visuals but rotating around origin.
|
||||
*/
|
||||
public class EntityAbilitySweeper extends EntityEnergyAbility {
|
||||
@@ -65,11 +65,11 @@ public class EntityAbilitySweeper extends EntityEnergyAbility {
|
||||
}
|
||||
|
||||
public EntityAbilitySweeper(World world, EntityLivingBase owner, EntityLivingBase target,
|
||||
float beamLength, float beamWidth, float beamHeight,
|
||||
EnergyDisplayData displayData,
|
||||
float sweepSpeed, int numberOfRotations,
|
||||
float damage, int damageInterval, boolean piercing,
|
||||
boolean lockOnTarget) {
|
||||
float beamLength, float beamWidth, float beamHeight,
|
||||
EnergyDisplayData displayData,
|
||||
float sweepSpeed, int numberOfRotations,
|
||||
float damage, int damageInterval, boolean piercing,
|
||||
boolean lockOnTarget) {
|
||||
this(world);
|
||||
|
||||
this.ownerEntityId = owner.getEntityId();
|
||||
|
||||
@@ -34,16 +34,20 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD
|
||||
// ENUMS
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
|
||||
public enum ZoneType { TRAP, HAZARD }
|
||||
public enum ZoneType {TRAP, HAZARD}
|
||||
|
||||
public enum ZoneShape {
|
||||
CIRCLE, SQUARE;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (this) {
|
||||
case CIRCLE: return "ability.shape.circle";
|
||||
case SQUARE: return "ability.shape.square";
|
||||
default: return name();
|
||||
case CIRCLE:
|
||||
return "ability.shape.circle";
|
||||
case SQUARE:
|
||||
return "ability.shape.square";
|
||||
default:
|
||||
return name();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,10 +58,14 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (this) {
|
||||
case STATIC: return "ability.accentStyle.static";
|
||||
case SWAYING: return "ability.accentStyle.swaying";
|
||||
case FLICKERING: return "ability.accentStyle.flickering";
|
||||
default: return name();
|
||||
case STATIC:
|
||||
return "ability.accentStyle.static";
|
||||
case SWAYING:
|
||||
return "ability.accentStyle.swaying";
|
||||
case FLICKERING:
|
||||
return "ability.accentStyle.flickering";
|
||||
default:
|
||||
return name();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,10 +76,14 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (this) {
|
||||
case RISING: return "ability.particleMotion.rising";
|
||||
case DRIFTING: return "ability.particleMotion.drifting";
|
||||
case SPARKS: return "ability.particleMotion.sparks";
|
||||
default: return name();
|
||||
case RISING:
|
||||
return "ability.particleMotion.rising";
|
||||
case DRIFTING:
|
||||
return "ability.particleMotion.drifting";
|
||||
case SPARKS:
|
||||
return "ability.particleMotion.sparks";
|
||||
default:
|
||||
return name();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,7 +186,7 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD
|
||||
}
|
||||
|
||||
private EntityAbilityZone(World world, ZoneType type, EntityLivingBase owner,
|
||||
double x, double y, double z) {
|
||||
double x, double y, double z) {
|
||||
this(world);
|
||||
this.zoneType = type;
|
||||
this.ownerEntityId = owner.getEntityId();
|
||||
@@ -184,17 +196,17 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD
|
||||
}
|
||||
|
||||
public static EntityAbilityZone createTrap(World world, EntityLivingBase owner,
|
||||
double x, double y, double z,
|
||||
ZoneShape shape,
|
||||
float triggerRadius, int armTime, int maxTriggers,
|
||||
int triggerCooldown, float damage, float damageRadius,
|
||||
float knockback, int durationTicks,
|
||||
int innerColor, int outerColor, boolean outerColorEnabled,
|
||||
float zoneHeight,
|
||||
float particleDensity, float particleScale,
|
||||
float animSpeed, float lightningDensity,
|
||||
boolean visible,
|
||||
List<AbilityPotionEffect> effects) {
|
||||
double x, double y, double z,
|
||||
ZoneShape shape,
|
||||
float triggerRadius, int armTime, int maxTriggers,
|
||||
int triggerCooldown, float damage, float damageRadius,
|
||||
float knockback, int durationTicks,
|
||||
int innerColor, int outerColor, boolean outerColorEnabled,
|
||||
float zoneHeight,
|
||||
float particleDensity, float particleScale,
|
||||
float animSpeed, float lightningDensity,
|
||||
boolean visible,
|
||||
List<AbilityPotionEffect> effects) {
|
||||
EntityAbilityZone zone = new EntityAbilityZone(world, ZoneType.TRAP, owner, x, y, z);
|
||||
zone.shape = shape;
|
||||
zone.radius = triggerRadius;
|
||||
@@ -226,17 +238,17 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD
|
||||
}
|
||||
|
||||
public static EntityAbilityZone createHazard(World world, EntityLivingBase owner,
|
||||
double x, double y, double z,
|
||||
ZoneShape shape,
|
||||
float radius,
|
||||
float damagePerSecond, int damageInterval,
|
||||
boolean ignoreInvulnFrames, boolean affectsCaster,
|
||||
int durationTicks,
|
||||
int innerColor, int outerColor, boolean outerColorEnabled,
|
||||
float zoneHeight,
|
||||
float particleDensity, float particleScale,
|
||||
float animSpeed, float lightningDensity,
|
||||
List<AbilityPotionEffect> effects) {
|
||||
double x, double y, double z,
|
||||
ZoneShape shape,
|
||||
float radius,
|
||||
float damagePerSecond, int damageInterval,
|
||||
boolean ignoreInvulnFrames, boolean affectsCaster,
|
||||
int durationTicks,
|
||||
int innerColor, int outerColor, boolean outerColorEnabled,
|
||||
float zoneHeight,
|
||||
float particleDensity, float particleScale,
|
||||
float animSpeed, float lightningDensity,
|
||||
List<AbilityPotionEffect> effects) {
|
||||
EntityAbilityZone zone = new EntityAbilityZone(world, ZoneType.HAZARD, owner, x, y, z);
|
||||
zone.shape = shape;
|
||||
zone.radius = radius;
|
||||
@@ -268,7 +280,8 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
|
||||
@Override
|
||||
protected void entityInit() {}
|
||||
protected void entityInit() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleHealthUpdate(byte id) {
|
||||
@@ -549,45 +562,133 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD
|
||||
// GETTERS FOR RENDERER
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
|
||||
public ZoneType getZoneType() { return zoneType; }
|
||||
public ZoneShape getShape() { return shape; }
|
||||
public float getRadius() { return radius; }
|
||||
public int getInnerColor() { return innerColor; }
|
||||
public int getOuterColor() { return outerColor; }
|
||||
public boolean isOuterColorEnabled() { return outerColorEnabled; }
|
||||
public float getZoneHeight() { return zoneHeight; }
|
||||
public boolean isArmed() { return armed || ticksExisted >= armTime; }
|
||||
public boolean isVisible() { return visible; }
|
||||
public int getTriggerFlashTick() { return triggerFlashTick; }
|
||||
public int getDurationTicks() { return durationTicks; }
|
||||
public int getMaxTicks() { return maxTicks; }
|
||||
public float getParticleDensity() { return particleDensity; }
|
||||
public float getParticleScale() { return particleScale; }
|
||||
public float getAnimSpeed() { return animSpeed; }
|
||||
public float getLightningDensity() { return lightningDensity; }
|
||||
public ZoneType getZoneType() {
|
||||
return zoneType;
|
||||
}
|
||||
|
||||
public boolean isGroundFill() { return groundFill; }
|
||||
public float getGroundAlpha() { return groundAlpha; }
|
||||
public boolean isRings() { return rings; }
|
||||
public int getRingCount() { return ringCount; }
|
||||
public boolean isBorder() { return border; }
|
||||
public float getBorderSpeed() { return borderSpeed; }
|
||||
public boolean isAccents() { return accents; }
|
||||
public int getAccentStyle() { return accentStyle; }
|
||||
public boolean isLightning() { return lightning; }
|
||||
public boolean isParticles() { return particles; }
|
||||
public int getParticleMotion() { return particleMotion; }
|
||||
public String getParticleDir() { return particleDir; }
|
||||
public int getParticleSize() { return particleSize; }
|
||||
public boolean isParticleGlow() { return particleGlow; }
|
||||
public ZoneShape getShape() {
|
||||
return shape;
|
||||
}
|
||||
|
||||
public float getRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
public int getInnerColor() {
|
||||
return innerColor;
|
||||
}
|
||||
|
||||
public int getOuterColor() {
|
||||
return outerColor;
|
||||
}
|
||||
|
||||
public boolean isOuterColorEnabled() {
|
||||
return outerColorEnabled;
|
||||
}
|
||||
|
||||
public float getZoneHeight() {
|
||||
return zoneHeight;
|
||||
}
|
||||
|
||||
public boolean isArmed() {
|
||||
return armed || ticksExisted >= armTime;
|
||||
}
|
||||
|
||||
public boolean isVisible() {
|
||||
return visible;
|
||||
}
|
||||
|
||||
public int getTriggerFlashTick() {
|
||||
return triggerFlashTick;
|
||||
}
|
||||
|
||||
public int getDurationTicks() {
|
||||
return durationTicks;
|
||||
}
|
||||
|
||||
public int getMaxTicks() {
|
||||
return maxTicks;
|
||||
}
|
||||
|
||||
public float getParticleDensity() {
|
||||
return particleDensity;
|
||||
}
|
||||
|
||||
public float getParticleScale() {
|
||||
return particleScale;
|
||||
}
|
||||
|
||||
public float getAnimSpeed() {
|
||||
return animSpeed;
|
||||
}
|
||||
|
||||
public float getLightningDensity() {
|
||||
return lightningDensity;
|
||||
}
|
||||
|
||||
public boolean isGroundFill() {
|
||||
return groundFill;
|
||||
}
|
||||
|
||||
public float getGroundAlpha() {
|
||||
return groundAlpha;
|
||||
}
|
||||
|
||||
public boolean isRings() {
|
||||
return rings;
|
||||
}
|
||||
|
||||
public int getRingCount() {
|
||||
return ringCount;
|
||||
}
|
||||
|
||||
public boolean isBorder() {
|
||||
return border;
|
||||
}
|
||||
|
||||
public float getBorderSpeed() {
|
||||
return borderSpeed;
|
||||
}
|
||||
|
||||
public boolean isAccents() {
|
||||
return accents;
|
||||
}
|
||||
|
||||
public int getAccentStyle() {
|
||||
return accentStyle;
|
||||
}
|
||||
|
||||
public boolean isLightning() {
|
||||
return lightning;
|
||||
}
|
||||
|
||||
public boolean isParticles() {
|
||||
return particles;
|
||||
}
|
||||
|
||||
public int getParticleMotion() {
|
||||
return particleMotion;
|
||||
}
|
||||
|
||||
public String getParticleDir() {
|
||||
return particleDir;
|
||||
}
|
||||
|
||||
public int getParticleSize() {
|
||||
return particleSize;
|
||||
}
|
||||
|
||||
public boolean isParticleGlow() {
|
||||
return particleGlow;
|
||||
}
|
||||
|
||||
public void applyVisual(boolean groundFill, float groundAlpha,
|
||||
boolean rings, int ringCount,
|
||||
boolean border, float borderSpeed,
|
||||
boolean accents, int accentStyle,
|
||||
boolean lightning,
|
||||
boolean particles, int particleMotion,
|
||||
String particleDir, int particleSize, boolean particleGlow) {
|
||||
boolean rings, int ringCount,
|
||||
boolean border, float borderSpeed,
|
||||
boolean accents, int accentStyle,
|
||||
boolean lightning,
|
||||
boolean particles, int particleMotion,
|
||||
String particleDir, int particleSize, boolean particleGlow) {
|
||||
this.groundFill = groundFill;
|
||||
this.groundAlpha = groundAlpha;
|
||||
this.rings = rings;
|
||||
|
||||
@@ -30,7 +30,9 @@ public abstract class EntityEnergyAbility extends Entity implements IEntityAddit
|
||||
protected int ownerEntityId = -1;
|
||||
|
||||
// ==================== STATE ====================
|
||||
/** The ability that spawned this entity. Transient, not saved to NBT. */
|
||||
/**
|
||||
* The ability that spawned this entity. Transient, not saved to NBT.
|
||||
*/
|
||||
protected transient Ability sourceAbility = null;
|
||||
protected boolean previewMode = false;
|
||||
protected EntityLivingBase previewOwner = null;
|
||||
@@ -98,59 +100,137 @@ public abstract class EntityEnergyAbility extends Entity implements IEntityAddit
|
||||
return worldObj.getEntityByID(ownerEntityId);
|
||||
}
|
||||
|
||||
public int getOwnerEntityId() { return ownerEntityId; }
|
||||
public void setOwnerEntityId(int id) { this.ownerEntityId = id; }
|
||||
public int getOwnerEntityId() {
|
||||
return ownerEntityId;
|
||||
}
|
||||
|
||||
public void setOwnerEntityId(int id) {
|
||||
this.ownerEntityId = id;
|
||||
}
|
||||
|
||||
// ==================== SOURCE ABILITY ====================
|
||||
|
||||
public Ability getSourceAbility() { return sourceAbility; }
|
||||
public void setSourceAbility(Ability ability) { this.sourceAbility = ability; }
|
||||
public Ability getSourceAbility() {
|
||||
return sourceAbility;
|
||||
}
|
||||
|
||||
public void setSourceAbility(Ability ability) {
|
||||
this.sourceAbility = ability;
|
||||
}
|
||||
|
||||
// ==================== PREVIEW MODE ====================
|
||||
|
||||
public boolean isPreviewMode() { return previewMode; }
|
||||
public void setPreviewMode(boolean preview) { this.previewMode = preview; }
|
||||
public void setPreviewOwner(EntityLivingBase owner) { this.previewOwner = owner; }
|
||||
public boolean isPreviewMode() {
|
||||
return previewMode;
|
||||
}
|
||||
|
||||
public void setPreviewMode(boolean preview) {
|
||||
this.previewMode = preview;
|
||||
}
|
||||
|
||||
public void setPreviewOwner(EntityLivingBase owner) {
|
||||
this.previewOwner = owner;
|
||||
}
|
||||
|
||||
// ==================== DISPLAY GETTERS & SETTERS ====================
|
||||
|
||||
public EnergyDisplayData getDisplayData() { return displayData; }
|
||||
public EnergyLightningData getLightningData() { return lightningData; }
|
||||
public EnergyDisplayData getDisplayData() {
|
||||
return displayData;
|
||||
}
|
||||
|
||||
public int getInnerColor() { return displayData.getInnerColor(); }
|
||||
public void setInnerColor(int color) { displayData.setInnerColor(color); }
|
||||
public EnergyLightningData getLightningData() {
|
||||
return lightningData;
|
||||
}
|
||||
|
||||
public float getInnerAlpha() { return displayData.getInnerAlpha(); }
|
||||
public void setInnerAlpha(float alpha) { displayData.setInnerAlpha(alpha); }
|
||||
public int getInnerColor() {
|
||||
return displayData.getInnerColor();
|
||||
}
|
||||
|
||||
public int getOuterColor() { return displayData.getOuterColor(); }
|
||||
public void setOuterColor(int color) { displayData.setOuterColor(color); }
|
||||
public void setInnerColor(int color) {
|
||||
displayData.setInnerColor(color);
|
||||
}
|
||||
|
||||
public boolean isOuterColorEnabled() { return displayData.isOuterColorEnabled(); }
|
||||
public void setOuterColorEnabled(boolean enabled) { displayData.setOuterColorEnabled(enabled); }
|
||||
public float getInnerAlpha() {
|
||||
return displayData.getInnerAlpha();
|
||||
}
|
||||
|
||||
public float getOuterColorWidth() { return displayData.getOuterColorWidth(); }
|
||||
public void setOuterColorWidth(float width) { displayData.setOuterColorWidth(width); }
|
||||
public void setInnerAlpha(float alpha) {
|
||||
displayData.setInnerAlpha(alpha);
|
||||
}
|
||||
|
||||
public float getOuterColorAlpha() { return displayData.getOuterColorAlpha(); }
|
||||
public void setOuterColorAlpha(float alpha) { displayData.setOuterColorAlpha(alpha); }
|
||||
public int getOuterColor() {
|
||||
return displayData.getOuterColor();
|
||||
}
|
||||
|
||||
public float getRotationSpeed() { return displayData.getRotationSpeed(); }
|
||||
public void setRotationSpeed(float speed) { displayData.setRotationSpeed(speed); }
|
||||
public void setOuterColor(int color) {
|
||||
displayData.setOuterColor(color);
|
||||
}
|
||||
|
||||
public boolean isOuterColorEnabled() {
|
||||
return displayData.isOuterColorEnabled();
|
||||
}
|
||||
|
||||
public void setOuterColorEnabled(boolean enabled) {
|
||||
displayData.setOuterColorEnabled(enabled);
|
||||
}
|
||||
|
||||
public float getOuterColorWidth() {
|
||||
return displayData.getOuterColorWidth();
|
||||
}
|
||||
|
||||
public void setOuterColorWidth(float width) {
|
||||
displayData.setOuterColorWidth(width);
|
||||
}
|
||||
|
||||
public float getOuterColorAlpha() {
|
||||
return displayData.getOuterColorAlpha();
|
||||
}
|
||||
|
||||
public void setOuterColorAlpha(float alpha) {
|
||||
displayData.setOuterColorAlpha(alpha);
|
||||
}
|
||||
|
||||
public float getRotationSpeed() {
|
||||
return displayData.getRotationSpeed();
|
||||
}
|
||||
|
||||
public void setRotationSpeed(float speed) {
|
||||
displayData.setRotationSpeed(speed);
|
||||
}
|
||||
|
||||
// ==================== LIGHTNING GETTERS & SETTERS ====================
|
||||
|
||||
public boolean hasLightningEffect() { return lightningData.isLightningEffect(); }
|
||||
public void setLightningEffect(boolean enabled) { lightningData.setLightningEffect(enabled); }
|
||||
public boolean hasLightningEffect() {
|
||||
return lightningData.isLightningEffect();
|
||||
}
|
||||
|
||||
public float getLightningDensity() { return lightningData.getLightningDensity(); }
|
||||
public void setLightningDensity(float density) { lightningData.setLightningDensity(density); }
|
||||
public void setLightningEffect(boolean enabled) {
|
||||
lightningData.setLightningEffect(enabled);
|
||||
}
|
||||
|
||||
public float getLightningRadius() { return lightningData.getLightningRadius(); }
|
||||
public void setLightningRadius(float radius) { lightningData.setLightningRadius(radius); }
|
||||
public float getLightningDensity() {
|
||||
return lightningData.getLightningDensity();
|
||||
}
|
||||
|
||||
public int getLightningFadeTime() { return lightningData.getLightningFadeTime(); }
|
||||
public void setLightningFadeTime(int ticks) { lightningData.setLightningFadeTime(ticks); }
|
||||
public void setLightningDensity(float density) {
|
||||
lightningData.setLightningDensity(density);
|
||||
}
|
||||
|
||||
public float getLightningRadius() {
|
||||
return lightningData.getLightningRadius();
|
||||
}
|
||||
|
||||
public void setLightningRadius(float radius) {
|
||||
lightningData.setLightningRadius(radius);
|
||||
}
|
||||
|
||||
public int getLightningFadeTime() {
|
||||
return lightningData.getLightningFadeTime();
|
||||
}
|
||||
|
||||
public void setLightningFadeTime(int ticks) {
|
||||
lightningData.setLightningFadeTime(ticks);
|
||||
}
|
||||
|
||||
// ==================== BRIGHTNESS ====================
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
package kamkeel.npcs.entity;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyBarrierData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLightningData;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -144,6 +140,7 @@ public abstract class EntityEnergyBarrier extends EntityEnergyAbility {
|
||||
* Shared barrier tick logic for onUpdate(). Handles spawned event, owner death,
|
||||
* duration check, hit flash decay, and tick event.
|
||||
* Call this after incrementing ticksAlive in subclass onUpdate().
|
||||
*
|
||||
* @return true if barrier died this tick (caller should return early)
|
||||
*/
|
||||
protected boolean updateBarrierTick() {
|
||||
@@ -223,18 +220,33 @@ public abstract class EntityEnergyBarrier extends EntityEnergyAbility {
|
||||
|
||||
protected boolean isKnockbackTarget(EntityLivingBase entity) {
|
||||
switch (barrierData.knockbackTarget) {
|
||||
case 1: return entity instanceof EntityPlayer;
|
||||
case 2: return entity instanceof EntityNPCInterface;
|
||||
default: return entity instanceof EntityPlayer || entity instanceof EntityNPCInterface;
|
||||
case 1:
|
||||
return entity instanceof EntityPlayer;
|
||||
case 2:
|
||||
return entity instanceof EntityNPCInterface;
|
||||
default:
|
||||
return entity instanceof EntityPlayer || entity instanceof EntityNPCInterface;
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== GETTERS ====================
|
||||
|
||||
public EnergyBarrierData getBarrierData() { return barrierData; }
|
||||
public float getCurrentHealth() { return currentHealth; }
|
||||
public void setCurrentHealth(float health) { this.currentHealth = health; syncHealthPercent(); }
|
||||
public int getTicksAlive() { return ticksAlive; }
|
||||
public EnergyBarrierData getBarrierData() {
|
||||
return barrierData;
|
||||
}
|
||||
|
||||
public float getCurrentHealth() {
|
||||
return currentHealth;
|
||||
}
|
||||
|
||||
public void setCurrentHealth(float health) {
|
||||
this.currentHealth = health;
|
||||
syncHealthPercent();
|
||||
}
|
||||
|
||||
public int getTicksAlive() {
|
||||
return ticksAlive;
|
||||
}
|
||||
|
||||
// ==================== NBT HELPERS ====================
|
||||
|
||||
|
||||
@@ -195,10 +195,21 @@ public class EntityEnergyDome extends EntityEnergyBarrier {
|
||||
|
||||
// ==================== GETTERS ====================
|
||||
|
||||
public float getDomeRadius() { return domeRadius; }
|
||||
public void setDomeRadius(float radius) { this.domeRadius = Math.max(0.1f, radius); }
|
||||
public boolean isFollowCaster() { return followCaster; }
|
||||
public void setFollowCaster(boolean follow) { this.followCaster = follow; }
|
||||
public float getDomeRadius() {
|
||||
return domeRadius;
|
||||
}
|
||||
|
||||
public void setDomeRadius(float radius) {
|
||||
this.domeRadius = Math.max(0.1f, radius);
|
||||
}
|
||||
|
||||
public boolean isFollowCaster() {
|
||||
return followCaster;
|
||||
}
|
||||
|
||||
public void setFollowCaster(boolean follow) {
|
||||
this.followCaster = follow;
|
||||
}
|
||||
|
||||
// ==================== NBT ====================
|
||||
|
||||
|
||||
@@ -343,9 +343,17 @@ public class EntityEnergyPanel extends EntityEnergyBarrier {
|
||||
|
||||
// ==================== GETTERS ====================
|
||||
|
||||
public PanelMode getMode() { return mode; }
|
||||
public float getPanelYaw() { return panelYaw; }
|
||||
public EnergyPanelData getPanelData() { return panelData; }
|
||||
public PanelMode getMode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
public float getPanelYaw() {
|
||||
return panelYaw;
|
||||
}
|
||||
|
||||
public EnergyPanelData getPanelData() {
|
||||
return panelData;
|
||||
}
|
||||
|
||||
// ==================== NBT ====================
|
||||
|
||||
|
||||
@@ -5,7 +5,13 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityPotionEffect;
|
||||
import kamkeel.npcs.controllers.data.ability.AnchorPoint;
|
||||
import kamkeel.npcs.controllers.data.ability.data.*;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyAnchorData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyCombatData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyHomingData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLifespanData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLightningData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyTrajectoryData;
|
||||
import kamkeel.npcs.util.AnchorPointHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -37,7 +43,7 @@ import java.util.Map;
|
||||
* Base class for all ability projectiles (Orb, Disc, Beam, Laser, Slicer).
|
||||
* Provides common functionality for combat, effects, homing, and interpolation.
|
||||
* Extends EntityEnergyAbility for shared visual/owner/charging state.
|
||||
*
|
||||
* <p>
|
||||
* Design inspired by LouisXIV's energy attack system.
|
||||
*/
|
||||
public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
|
||||
@@ -274,13 +280,14 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
|
||||
|
||||
/**
|
||||
* Check if projectile has exceeded max distance.
|
||||
*
|
||||
* @return true if should die
|
||||
*/
|
||||
protected boolean checkMaxDistance() {
|
||||
double distTraveled = Math.sqrt(
|
||||
(posX - startX) * (posX - startX) +
|
||||
(posY - startY) * (posY - startY) +
|
||||
(posZ - startZ) * (posZ - startZ)
|
||||
(posY - startY) * (posY - startY) +
|
||||
(posZ - startZ) * (posZ - startZ)
|
||||
);
|
||||
return distTraveled >= getMaxDistance();
|
||||
}
|
||||
@@ -295,6 +302,7 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
|
||||
/**
|
||||
* Check for collision with energy barrier entities.
|
||||
* Barriers only block incoming projectiles from enemies.
|
||||
*
|
||||
* @return true if projectile was absorbed (caller should stop processing)
|
||||
*/
|
||||
protected boolean checkBarrierCollision() {
|
||||
@@ -455,8 +463,8 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
|
||||
|
||||
double dist = Math.sqrt(
|
||||
Math.pow(target.posX - posX, 2) +
|
||||
Math.pow(target.posY - posY, 2) +
|
||||
Math.pow(target.posZ - posZ, 2)
|
||||
Math.pow(target.posY - posY, 2) +
|
||||
Math.pow(target.posZ - posZ, 2)
|
||||
);
|
||||
|
||||
float radius = getExplosionRadius();
|
||||
@@ -518,7 +526,7 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
|
||||
* Update during charging state - grow size and follow anchor.
|
||||
* Default implementation grows {@code size} from 0 to {@code targetSize}.
|
||||
* Override in subclasses for type-specific charging (Disc, Beam).
|
||||
*
|
||||
* <p>
|
||||
* Note: Owner death checks are handled by onUpdate() before this is called.
|
||||
*/
|
||||
protected void updateCharging() {
|
||||
@@ -580,7 +588,7 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
|
||||
* Call from subclass constructors after initProjectile().
|
||||
*/
|
||||
protected void calculateInitialVelocity(EntityLivingBase owner, EntityLivingBase target,
|
||||
double x, double y, double z) {
|
||||
double x, double y, double z) {
|
||||
if (target != null) {
|
||||
double dx = target.posX - x;
|
||||
double dy = (target.posY + target.getEyeHeight()) - y;
|
||||
@@ -701,7 +709,10 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
|
||||
|
||||
// ==================== VISUAL GETTERS & SETTERS ====================
|
||||
|
||||
public float getSize() { return size; }
|
||||
public float getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setProjectileSize(float size) {
|
||||
this.size = size;
|
||||
this.renderCurrentSize = size;
|
||||
@@ -738,64 +749,147 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
|
||||
|
||||
// ==================== LIFESPAN GETTERS & SETTERS ====================
|
||||
|
||||
public float getMaxDistance() { return lifespanData.getMaxDistance(); }
|
||||
public void setMaxDistance(float distance) { lifespanData.setMaxDistance(distance); }
|
||||
public float getMaxDistance() {
|
||||
return lifespanData.getMaxDistance();
|
||||
}
|
||||
|
||||
public int getMaxLifetime() { return lifespanData.getMaxLifetime(); }
|
||||
public void setMaxLifetime(int ticks) { lifespanData.setMaxLifetime(ticks); }
|
||||
public void setMaxDistance(float distance) {
|
||||
lifespanData.setMaxDistance(distance);
|
||||
}
|
||||
|
||||
public int getMaxLifetime() {
|
||||
return lifespanData.getMaxLifetime();
|
||||
}
|
||||
|
||||
public void setMaxLifetime(int ticks) {
|
||||
lifespanData.setMaxLifetime(ticks);
|
||||
}
|
||||
|
||||
// ==================== COMBAT GETTERS & SETTERS ====================
|
||||
|
||||
public float getDamage() { return combatData.getDamage(); }
|
||||
public void setCombatDamage(float damage) { combatData.setDamage(damage); }
|
||||
public float getDamage() {
|
||||
return combatData.getDamage();
|
||||
}
|
||||
|
||||
public float getKnockback() { return combatData.knockback; }
|
||||
public void setCombatKnockback(float knockback) { combatData.setKnockback(knockback); }
|
||||
public void setCombatDamage(float damage) {
|
||||
combatData.setDamage(damage);
|
||||
}
|
||||
|
||||
public float getKnockbackUp() { return combatData.knockbackUp; }
|
||||
public void setCombatKnockbackUp(float knockbackUp) { combatData.setKnockbackUp(knockbackUp); }
|
||||
public float getKnockback() {
|
||||
return combatData.knockback;
|
||||
}
|
||||
|
||||
public boolean isExplosive() { return combatData.isExplosive(); }
|
||||
public void setExplosive(boolean explosive) { combatData.setExplosive(explosive); }
|
||||
public void setCombatKnockback(float knockback) {
|
||||
combatData.setKnockback(knockback);
|
||||
}
|
||||
|
||||
public float getExplosionRadius() { return combatData.explosionRadius; }
|
||||
public void setExplosionRadius(float radius) { combatData.setExplosionRadius(radius); }
|
||||
public float getKnockbackUp() {
|
||||
return combatData.knockbackUp;
|
||||
}
|
||||
|
||||
public float getExplosionDamageFalloff() { return combatData.explosionDamageFalloff; }
|
||||
public void setExplosionDamageFalloff(float falloff) { combatData.setExplosionDamageFalloff(falloff); }
|
||||
public void setCombatKnockbackUp(float knockbackUp) {
|
||||
combatData.setKnockbackUp(knockbackUp);
|
||||
}
|
||||
|
||||
public boolean isExplosive() {
|
||||
return combatData.isExplosive();
|
||||
}
|
||||
|
||||
public void setExplosive(boolean explosive) {
|
||||
combatData.setExplosive(explosive);
|
||||
}
|
||||
|
||||
public float getExplosionRadius() {
|
||||
return combatData.explosionRadius;
|
||||
}
|
||||
|
||||
public void setExplosionRadius(float radius) {
|
||||
combatData.setExplosionRadius(radius);
|
||||
}
|
||||
|
||||
public float getExplosionDamageFalloff() {
|
||||
return combatData.explosionDamageFalloff;
|
||||
}
|
||||
|
||||
public void setExplosionDamageFalloff(float falloff) {
|
||||
combatData.setExplosionDamageFalloff(falloff);
|
||||
}
|
||||
|
||||
// ==================== HOMING GETTERS & SETTERS ====================
|
||||
|
||||
public boolean isHoming() { return homingData.isHoming(); }
|
||||
public void setHomingEnabled(boolean homing) { homingData.setHoming(homing); }
|
||||
public boolean isHoming() {
|
||||
return homingData.isHoming();
|
||||
}
|
||||
|
||||
public float getHomingStrength() { return homingData.getHomingStrength(); }
|
||||
public void setHomingStrength(float strength) { homingData.setHomingStrength(strength); }
|
||||
public void setHomingEnabled(boolean homing) {
|
||||
homingData.setHoming(homing);
|
||||
}
|
||||
|
||||
public float getHomingRange() { return homingData.getHomingRange(); }
|
||||
public void setHomingRange(float range) { homingData.setHomingRange(range); }
|
||||
public float getHomingStrength() {
|
||||
return homingData.getHomingStrength();
|
||||
}
|
||||
|
||||
public void setHomingStrength(float strength) {
|
||||
homingData.setHomingStrength(strength);
|
||||
}
|
||||
|
||||
public float getHomingRange() {
|
||||
return homingData.getHomingRange();
|
||||
}
|
||||
|
||||
public void setHomingRange(float range) {
|
||||
homingData.setHomingRange(range);
|
||||
}
|
||||
|
||||
// ==================== SPEED & ANCHOR GETTERS & SETTERS ====================
|
||||
|
||||
public float getSpeed() { return homingData.getSpeed(); }
|
||||
public void setSpeed(float speed) { homingData.setSpeed(speed); }
|
||||
public float getSpeed() {
|
||||
return homingData.getSpeed();
|
||||
}
|
||||
|
||||
public AnchorPoint getAnchorPoint() { return anchorData.getAnchorPoint(); }
|
||||
public void setSpeed(float speed) {
|
||||
homingData.setSpeed(speed);
|
||||
}
|
||||
|
||||
public int getAnchor() { return anchorData.getAnchor(); }
|
||||
public float getAnchorOffsetX() { return anchorData.getAnchorOffsetX(); }
|
||||
public float getAnchorOffsetY() { return anchorData.getAnchorOffsetY(); }
|
||||
public float getAnchorOffsetZ() { return anchorData.getAnchorOffsetZ(); }
|
||||
public AnchorPoint getAnchorPoint() {
|
||||
return anchorData.getAnchorPoint();
|
||||
}
|
||||
|
||||
public int getAnchor() {
|
||||
return anchorData.getAnchor();
|
||||
}
|
||||
|
||||
public float getAnchorOffsetX() {
|
||||
return anchorData.getAnchorOffsetX();
|
||||
}
|
||||
|
||||
public float getAnchorOffsetY() {
|
||||
return anchorData.getAnchorOffsetY();
|
||||
}
|
||||
|
||||
public float getAnchorOffsetZ() {
|
||||
return anchorData.getAnchorOffsetZ();
|
||||
}
|
||||
|
||||
// ==================== MOVEMENT GETTERS ====================
|
||||
|
||||
public double getStartX() { return startX; }
|
||||
public double getStartY() { return startY; }
|
||||
public double getStartZ() { return startZ; }
|
||||
public double getStartX() {
|
||||
return startX;
|
||||
}
|
||||
|
||||
public double getStartY() {
|
||||
return startY;
|
||||
}
|
||||
|
||||
public double getStartZ() {
|
||||
return startZ;
|
||||
}
|
||||
|
||||
// ==================== STATE GETTERS ====================
|
||||
|
||||
public boolean getHasHit() { return hasHit; }
|
||||
public boolean getHasHit() {
|
||||
return hasHit;
|
||||
}
|
||||
|
||||
// ==================== NBT ====================
|
||||
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
package kamkeel.npcs.entity;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.data.*;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyAnchorData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyCombatData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyHomingData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLifespanData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyLightningData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.EnergyTrajectoryData;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -293,14 +299,29 @@ public class EntityEnergySlicer extends EntityEnergyProjectile {
|
||||
|
||||
// ==================== GETTERS ====================
|
||||
|
||||
public float getSliceWidth() { return sliceWidth; }
|
||||
public void setSliceWidth(float width) { this.sliceWidth = width; }
|
||||
public float getSliceWidth() {
|
||||
return sliceWidth;
|
||||
}
|
||||
|
||||
public float getSliceThickness() { return sliceThickness; }
|
||||
public void setSliceThickness(float thickness) { this.sliceThickness = thickness; }
|
||||
public void setSliceWidth(float width) {
|
||||
this.sliceWidth = width;
|
||||
}
|
||||
|
||||
public boolean isPiercing() { return piercing; }
|
||||
public void setPiercing(boolean piercing) { this.piercing = piercing; }
|
||||
public float getSliceThickness() {
|
||||
return sliceThickness;
|
||||
}
|
||||
|
||||
public void setSliceThickness(float thickness) {
|
||||
this.sliceThickness = thickness;
|
||||
}
|
||||
|
||||
public boolean isPiercing() {
|
||||
return piercing;
|
||||
}
|
||||
|
||||
public void setPiercing(boolean piercing) {
|
||||
this.piercing = piercing;
|
||||
}
|
||||
|
||||
// ==================== NBT ====================
|
||||
|
||||
|
||||
@@ -28,8 +28,6 @@ import kamkeel.npcs.network.packets.data.UpdateAnimationsPacket;
|
||||
import kamkeel.npcs.network.packets.data.VillagerListPacket;
|
||||
import kamkeel.npcs.network.packets.data.ability.PlayerAbilityStatePacket;
|
||||
import kamkeel.npcs.network.packets.data.ability.PlayerAbilitySyncPacket;
|
||||
import kamkeel.npcs.network.packets.data.telegraph.TelegraphRemovePacket;
|
||||
import kamkeel.npcs.network.packets.data.telegraph.TelegraphSpawnPacket;
|
||||
import kamkeel.npcs.network.packets.data.gui.GuiClosePacket;
|
||||
import kamkeel.npcs.network.packets.data.gui.GuiErrorPacket;
|
||||
import kamkeel.npcs.network.packets.data.gui.GuiOpenBookPacket;
|
||||
@@ -53,6 +51,9 @@ import kamkeel.npcs.network.packets.data.npc.WeaponNpcPacket;
|
||||
import kamkeel.npcs.network.packets.data.script.ScriptOverlayClosePacket;
|
||||
import kamkeel.npcs.network.packets.data.script.ScriptOverlayDataPacket;
|
||||
import kamkeel.npcs.network.packets.data.script.ScriptedParticlePacket;
|
||||
import kamkeel.npcs.network.packets.data.telegraph.TelegraphRemovePacket;
|
||||
import kamkeel.npcs.network.packets.data.telegraph.TelegraphSpawnPacket;
|
||||
import kamkeel.npcs.network.packets.player.AuctionActionPacket;
|
||||
import kamkeel.npcs.network.packets.player.BankActionPacket;
|
||||
import kamkeel.npcs.network.packets.player.CheckPlayerValue;
|
||||
import kamkeel.npcs.network.packets.player.CompanionActionPacket;
|
||||
@@ -61,7 +62,6 @@ import kamkeel.npcs.network.packets.player.FollowerPacket;
|
||||
import kamkeel.npcs.network.packets.player.GetNPCRole;
|
||||
import kamkeel.npcs.network.packets.player.GetTraderData;
|
||||
import kamkeel.npcs.network.packets.player.InputDevicePacket;
|
||||
import kamkeel.npcs.network.packets.player.AuctionActionPacket;
|
||||
import kamkeel.npcs.network.packets.player.MailActionPacket;
|
||||
import kamkeel.npcs.network.packets.player.SaveBookPacket;
|
||||
import kamkeel.npcs.network.packets.player.SaveSignPacket;
|
||||
@@ -94,14 +94,14 @@ import kamkeel.npcs.network.packets.request.TraderMarketSavePacket;
|
||||
import kamkeel.npcs.network.packets.request.ability.AbilitiesGetAllPacket;
|
||||
import kamkeel.npcs.network.packets.request.ability.AbilitiesNpcGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.ability.AbilitiesNpcSavePacket;
|
||||
import kamkeel.npcs.network.packets.request.ability.CustomAbilitiesGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.ability.CustomAbilityGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.ability.CustomAbilityRemovePacket;
|
||||
import kamkeel.npcs.network.packets.request.ability.BuiltInAbilityGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.ability.ChainedAbilitiesGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.ability.ChainedAbilityGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.ability.ChainedAbilityRemovePacket;
|
||||
import kamkeel.npcs.network.packets.request.ability.ChainedAbilitySavePacket;
|
||||
import kamkeel.npcs.network.packets.request.ability.CustomAbilitiesGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.ability.CustomAbilityGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.ability.CustomAbilityRemovePacket;
|
||||
import kamkeel.npcs.network.packets.request.ability.CustomAbilitySavePacket;
|
||||
import kamkeel.npcs.network.packets.request.animation.AnimationGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.animation.AnimationRemovePacket;
|
||||
@@ -116,8 +116,8 @@ import kamkeel.npcs.network.packets.request.clone.CloneAllTagsPacket;
|
||||
import kamkeel.npcs.network.packets.request.clone.CloneAllTagsShortPacket;
|
||||
import kamkeel.npcs.network.packets.request.clone.CloneFolderCrudPacket;
|
||||
import kamkeel.npcs.network.packets.request.clone.CloneFolderListPacket;
|
||||
import kamkeel.npcs.network.packets.request.clone.CloneMovePacket;
|
||||
import kamkeel.npcs.network.packets.request.clone.CloneListPacket;
|
||||
import kamkeel.npcs.network.packets.request.clone.CloneMovePacket;
|
||||
import kamkeel.npcs.network.packets.request.clone.ClonePreSavePacket;
|
||||
import kamkeel.npcs.network.packets.request.clone.CloneRemovePacket;
|
||||
import kamkeel.npcs.network.packets.request.clone.CloneSavePacket;
|
||||
|
||||
@@ -15,8 +15,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.AuctionClientConfig;
|
||||
import noppes.npcs.client.ClientCacheHandler;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.client.ScriptClientConfig;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.controllers.AuctionConfigSync;
|
||||
import noppes.npcs.controllers.ScriptConfigSync;
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import java.io.IOException;
|
||||
/**
|
||||
* Lightweight packet syncing ability lock state from server to client.
|
||||
* Sent every tick during ability execution when flags change, and once when ability ends.
|
||||
*
|
||||
* <p>
|
||||
* Flags byte layout:
|
||||
* bit 0: movement locked (suppress WASD, zero motion)
|
||||
* bit 1: rotation locked (freeze yaw/pitch)
|
||||
|
||||
@@ -40,7 +40,8 @@ public class AuctionActionPacket extends AbstractPacket {
|
||||
private long amount;
|
||||
private NBTTagCompound data;
|
||||
|
||||
public AuctionActionPacket() {}
|
||||
public AuctionActionPacket() {
|
||||
}
|
||||
|
||||
private AuctionActionPacket(Action action) {
|
||||
this.action = action;
|
||||
@@ -58,7 +59,9 @@ public class AuctionActionPacket extends AbstractPacket {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsNPC() { return false; } // Allow opening via command without NPC
|
||||
public boolean needsNPC() {
|
||||
return false;
|
||||
} // Allow opening via command without NPC
|
||||
|
||||
// =========================================
|
||||
// Client-side static methods
|
||||
@@ -117,7 +120,9 @@ public class AuctionActionPacket extends AbstractPacket {
|
||||
PacketClient.sendClient(packet);
|
||||
}
|
||||
|
||||
/** Request listings from server with filter and page */
|
||||
/**
|
||||
* Request listings from server with filter and page
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void requestListings(AuctionFilter filter, int page) {
|
||||
AuctionActionPacket packet = new AuctionActionPacket(Action.RequestListings);
|
||||
@@ -131,10 +136,14 @@ public class AuctionActionPacket extends AbstractPacket {
|
||||
// =========================================
|
||||
|
||||
@Override
|
||||
public Enum getType() { return EnumPlayerPacket.AuctionAction; }
|
||||
public Enum getType() {
|
||||
return EnumPlayerPacket.AuctionAction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketChannel getChannel() { return PacketHandler.PLAYER_PACKET; }
|
||||
public PacketChannel getChannel() {
|
||||
return PacketHandler.PLAYER_PACKET;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -291,7 +300,10 @@ public class AuctionActionPacket extends AbstractPacket {
|
||||
long startingPrice = in.readLong();
|
||||
String buyoutStr = ByteBufUtils.readString(in);
|
||||
long buyoutPrice = 0;
|
||||
try { buyoutPrice = Long.parseLong(buyoutStr); } catch (NumberFormatException ignored) {}
|
||||
try {
|
||||
buyoutPrice = Long.parseLong(buyoutStr);
|
||||
} catch (NumberFormatException ignored) {
|
||||
}
|
||||
|
||||
NBTTagCompound itemNBT = ByteBufUtils.readNBT(in);
|
||||
if (itemNBT == null) return "No item data received.";
|
||||
@@ -329,7 +341,9 @@ public class AuctionActionPacket extends AbstractPacket {
|
||||
}
|
||||
}
|
||||
|
||||
/** Send full trades data to player (listings, bids, claims) */
|
||||
/**
|
||||
* Send full trades data to player (listings, bids, claims)
|
||||
*/
|
||||
private void sendTradesData(EntityPlayerMP player, AuctionController controller) {
|
||||
NBTTagCompound response = new NBTTagCompound();
|
||||
response.setBoolean("TradesData", true);
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@ package kamkeel.npcs.network.packets.request.ability;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.network.AbstractPacket;
|
||||
import kamkeel.npcs.network.PacketChannel;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@ package kamkeel.npcs.network.packets.request.ability;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import kamkeel.npcs.controllers.data.ability.ChainedAbility;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.ability.ChainedAbility;
|
||||
import kamkeel.npcs.network.AbstractPacket;
|
||||
import kamkeel.npcs.network.PacketChannel;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@ package kamkeel.npcs.network.packets.request.ability;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import kamkeel.npcs.controllers.data.ability.ChainedAbility;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.ability.ChainedAbility;
|
||||
import kamkeel.npcs.network.AbstractPacket;
|
||||
import kamkeel.npcs.network.PacketChannel;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@ package kamkeel.npcs.network.packets.request.ability;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.network.AbstractPacket;
|
||||
import kamkeel.npcs.network.PacketChannel;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
|
||||
+1
-1
@@ -3,8 +3,8 @@ package kamkeel.npcs.network.packets.request.ability;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.network.AbstractPacket;
|
||||
import kamkeel.npcs.network.PacketChannel;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
|
||||
-1
@@ -15,7 +15,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.controllers.AnimationController;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
import noppes.npcs.controllers.data.BuiltInAnimation;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -10,10 +10,10 @@ import kamkeel.npcs.network.PacketUtil;
|
||||
import kamkeel.npcs.network.enums.EnumItemPacketType;
|
||||
import kamkeel.npcs.network.enums.EnumRequestPacket;
|
||||
import kamkeel.npcs.network.packets.data.large.GuiDataPacket;
|
||||
import kamkeel.npcs.util.ByteBufUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import kamkeel.npcs.util.ByteBufUtils;
|
||||
import noppes.npcs.controllers.ServerTagMapController;
|
||||
import noppes.npcs.controllers.data.TagMap;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package kamkeel.npcs.network.packets.request.script;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import kamkeel.npcs.network.AbstractPacket;
|
||||
import kamkeel.npcs.network.PacketChannel;
|
||||
|
||||
@@ -411,6 +411,7 @@ public class AnchorPointHelper {
|
||||
/**
|
||||
* Rotate an offset vector by the entity's body yaw so offsets are entity-relative.
|
||||
* +X = entity's right, +Y = up, +Z = entity's forward.
|
||||
*
|
||||
* @param bodyYawRad body yaw in radians
|
||||
*/
|
||||
private static Vec3 rotateOffsetByYaw(double offsetX, double offsetY, double offsetZ, float bodyYawRad) {
|
||||
@@ -444,19 +445,19 @@ public class AnchorPointHelper {
|
||||
* Apply FULL_MODEL rotation to a world-space offset from entity position.
|
||||
* Converts the offset to model space, applies FULL_MODEL rotation and pivots,
|
||||
* then converts back to world space.
|
||||
*
|
||||
* <p>
|
||||
* The rendering pipeline is: entity_pos * body_yaw * scale(-1,-1,1) * FULL_MODEL * parts
|
||||
* Combined body_yaw + scale maps model space to world space:
|
||||
* worldX = mx*cos(yaw) + mz*sin(yaw)
|
||||
* worldY = -my (model Y-down → world Y-up)
|
||||
* worldZ = mx*sin(yaw) - mz*cos(yaw)
|
||||
* worldX = mx*cos(yaw) + mz*sin(yaw)
|
||||
* worldY = -my (model Y-down → world Y-up)
|
||||
* worldZ = mx*sin(yaw) - mz*cos(yaw)
|
||||
* This transform is its own inverse for X,Z.
|
||||
*
|
||||
* <p>
|
||||
* FULL_MODEL rotation order matches renderer: vertex sees Z, then Y, then X.
|
||||
*/
|
||||
private static Vec3 applyFullModelToWorldOffset(FramePart fullModel, EntityLivingBase entity,
|
||||
double worldDX, double worldDY, double worldDZ,
|
||||
float bodyYaw, float scale) {
|
||||
double worldDX, double worldDY, double worldDZ,
|
||||
float bodyYaw, float scale) {
|
||||
float[] rotations = getRotations(fullModel, entity);
|
||||
float[] pivots = getPivots(fullModel, entity);
|
||||
|
||||
|
||||
@@ -98,6 +98,7 @@ public class BukkitUtil {
|
||||
|
||||
/**
|
||||
* Checks if a specific Bukkit plugin is enabled.
|
||||
*
|
||||
* @param pluginName the plugin name to check
|
||||
* @return true if the plugin is enabled
|
||||
*/
|
||||
@@ -115,6 +116,7 @@ public class BukkitUtil {
|
||||
|
||||
/**
|
||||
* Gets a Bukkit OfflinePlayer by name.
|
||||
*
|
||||
* @param playerName the player name
|
||||
* @return the OfflinePlayer object, or null if not available
|
||||
*/
|
||||
@@ -131,6 +133,7 @@ public class BukkitUtil {
|
||||
|
||||
/**
|
||||
* Gets a Bukkit Player by name (online players only).
|
||||
*
|
||||
* @param playerName the player name
|
||||
* @return the Player object, or null if not online or not available
|
||||
*/
|
||||
@@ -147,6 +150,7 @@ public class BukkitUtil {
|
||||
|
||||
/**
|
||||
* Gets a service provider from Bukkit's ServicesManager.
|
||||
*
|
||||
* @param serviceClass the service class to get
|
||||
* @return the service provider, or null if not available
|
||||
*/
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
package kamkeel.npcs.util;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityVariant;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.controllers.AnimationController;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
||||
@@ -178,6 +178,7 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Checks if a player has an account in the economy system.
|
||||
*
|
||||
* @param player the player to check
|
||||
* @return true if the player has an account
|
||||
*/
|
||||
@@ -187,6 +188,7 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Checks if a player has an account in the economy system.
|
||||
*
|
||||
* @param playerName the player name to check
|
||||
* @return true if the player has an account
|
||||
*/
|
||||
@@ -207,6 +209,7 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Gets the balance of a player.
|
||||
*
|
||||
* @param player the player
|
||||
* @return the player's balance, or 0 if not available
|
||||
*/
|
||||
@@ -216,6 +219,7 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Gets the balance of a player by name.
|
||||
*
|
||||
* @param playerName the player name
|
||||
* @return the player's balance, or 0 if not available
|
||||
*/
|
||||
@@ -236,6 +240,7 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Checks if a player has at least the specified amount.
|
||||
*
|
||||
* @param player the player
|
||||
* @param amount the amount to check
|
||||
* @return true if the player has at least the specified amount
|
||||
@@ -246,8 +251,9 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Checks if a player has at least the specified amount.
|
||||
*
|
||||
* @param playerName the player name
|
||||
* @param amount the amount to check
|
||||
* @param amount the amount to check
|
||||
* @return true if the player has at least the specified amount
|
||||
*/
|
||||
public static boolean has(String playerName, double amount) {
|
||||
@@ -267,6 +273,7 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Withdraws money from a player's account.
|
||||
*
|
||||
* @param player the player
|
||||
* @param amount the amount to withdraw
|
||||
* @return true if the transaction was successful
|
||||
@@ -277,8 +284,9 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Withdraws money from a player's account.
|
||||
*
|
||||
* @param playerName the player name
|
||||
* @param amount the amount to withdraw
|
||||
* @param amount the amount to withdraw
|
||||
* @return true if the transaction was successful
|
||||
*/
|
||||
public static boolean withdrawMoney(String playerName, double amount) {
|
||||
@@ -301,6 +309,7 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Adds money to a player's account (deposit).
|
||||
*
|
||||
* @param player the player
|
||||
* @param amount the amount to add
|
||||
* @return true if the transaction was successful
|
||||
@@ -311,8 +320,9 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Adds money to a player's account (deposit).
|
||||
*
|
||||
* @param playerName the player name
|
||||
* @param amount the amount to add
|
||||
* @param amount the amount to add
|
||||
* @return true if the transaction was successful
|
||||
*/
|
||||
public static boolean addMoney(String playerName, double amount) {
|
||||
@@ -336,6 +346,7 @@ public class VaultUtil {
|
||||
/**
|
||||
* Sets a player's balance to the specified amount.
|
||||
* This withdraws all money first, then deposits the new amount.
|
||||
*
|
||||
* @param player the player
|
||||
* @param amount the new balance
|
||||
* @return true if the transaction was successful
|
||||
@@ -347,8 +358,9 @@ public class VaultUtil {
|
||||
/**
|
||||
* Sets a player's balance to the specified amount.
|
||||
* This withdraws all money first, then deposits the new amount.
|
||||
*
|
||||
* @param playerName the player name
|
||||
* @param amount the new balance
|
||||
* @param amount the new balance
|
||||
* @return true if the transaction was successful
|
||||
*/
|
||||
public static boolean setBalance(String playerName, double amount) {
|
||||
@@ -368,6 +380,7 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Formats an amount according to the economy plugin's settings.
|
||||
*
|
||||
* @param amount the amount to format
|
||||
* @return the formatted string, or the raw number as string if not available
|
||||
*/
|
||||
@@ -384,6 +397,7 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Gets the plural currency name (e.g., "Dollars").
|
||||
*
|
||||
* @return the plural currency name, or "coins" if not available
|
||||
*/
|
||||
public static String getCurrencyNamePlural() {
|
||||
@@ -399,6 +413,7 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Gets the singular currency name (e.g., "Dollar").
|
||||
*
|
||||
* @return the singular currency name, or "coin" if not available
|
||||
*/
|
||||
public static String getCurrencyNameSingular() {
|
||||
@@ -414,6 +429,7 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Creates an account for the player if one doesn't exist.
|
||||
*
|
||||
* @param player the player
|
||||
* @return true if the account was created or already exists
|
||||
*/
|
||||
@@ -423,6 +439,7 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Creates an account for the player if one doesn't exist.
|
||||
*
|
||||
* @param playerName the player name
|
||||
* @return true if the account was created or already exists
|
||||
*/
|
||||
@@ -459,6 +476,7 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Gets a list of all bank names.
|
||||
*
|
||||
* @return list of bank names, or empty list if not available
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -475,6 +493,7 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Gets the balance of a bank.
|
||||
*
|
||||
* @param bankName the bank name
|
||||
* @return the bank balance, or 0 if not available
|
||||
*/
|
||||
@@ -492,8 +511,9 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Checks if a bank has at least the specified amount.
|
||||
*
|
||||
* @param bankName the bank name
|
||||
* @param amount the amount to check
|
||||
* @param amount the amount to check
|
||||
* @return true if the bank has at least the specified amount
|
||||
*/
|
||||
public static boolean bankHas(String bankName, double amount) {
|
||||
@@ -510,8 +530,9 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Withdraws money from a bank.
|
||||
*
|
||||
* @param bankName the bank name
|
||||
* @param amount the amount to withdraw
|
||||
* @param amount the amount to withdraw
|
||||
* @return true if the transaction was successful
|
||||
*/
|
||||
public static boolean bankWithdraw(String bankName, double amount) {
|
||||
@@ -528,8 +549,9 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Deposits money into a bank.
|
||||
*
|
||||
* @param bankName the bank name
|
||||
* @param amount the amount to deposit
|
||||
* @param amount the amount to deposit
|
||||
* @return true if the transaction was successful
|
||||
*/
|
||||
public static boolean bankDeposit(String bankName, double amount) {
|
||||
@@ -546,8 +568,9 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Transfers money from one player to another.
|
||||
* @param from the player to take money from
|
||||
* @param to the player to give money to
|
||||
*
|
||||
* @param from the player to take money from
|
||||
* @param to the player to give money to
|
||||
* @param amount the amount to transfer
|
||||
* @return true if the transfer was successful
|
||||
*/
|
||||
@@ -557,9 +580,10 @@ public class VaultUtil {
|
||||
|
||||
/**
|
||||
* Transfers money from one player to another.
|
||||
*
|
||||
* @param fromPlayerName the player name to take money from
|
||||
* @param toPlayerName the player name to give money to
|
||||
* @param amount the amount to transfer
|
||||
* @param toPlayerName the player name to give money to
|
||||
* @param amount the amount to transfer
|
||||
* @return true if the transfer was successful
|
||||
*/
|
||||
public static boolean transfer(String fromPlayerName, String toPlayerName, double amount) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityPhase;
|
||||
import kamkeel.npcs.controllers.data.ability.ChainedAbility;
|
||||
import kamkeel.npcs.controllers.data.ability.ChainedAbilityEntry;
|
||||
@@ -12,7 +12,12 @@ import net.minecraft.util.DamageSource;
|
||||
import noppes.npcs.controllers.AnimationController;
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Shared base class for NPC and Player ability data management.
|
||||
@@ -31,81 +36,119 @@ public abstract class AbstractDataAbilities {
|
||||
// SHARED RUNTIME STATE (not saved to NBT)
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
|
||||
/** Currently executing ability (null if none) */
|
||||
/**
|
||||
* Currently executing ability (null if none)
|
||||
*/
|
||||
protected Ability currentAbility;
|
||||
|
||||
/** World time when cooldown ends */
|
||||
/**
|
||||
* World time when cooldown ends
|
||||
*/
|
||||
protected long cooldownEndTime = 0;
|
||||
|
||||
/** Rotation lock state */
|
||||
/**
|
||||
* Rotation lock state
|
||||
*/
|
||||
protected boolean rotationLocked = false;
|
||||
protected float lockedYaw = 0;
|
||||
protected float lockedPitch = 0;
|
||||
|
||||
/** Position lock state */
|
||||
/**
|
||||
* Position lock state
|
||||
*/
|
||||
protected boolean positionLocked = false;
|
||||
protected double lockedPosX = 0;
|
||||
protected double lockedPosY = 0;
|
||||
protected double lockedPosZ = 0;
|
||||
|
||||
/** Chained ability execution state */
|
||||
/**
|
||||
* Chained ability execution state
|
||||
*/
|
||||
protected ChainedAbility currentChain;
|
||||
protected int chainEntryIndex = -1;
|
||||
protected int chainDelayRemaining = -1;
|
||||
|
||||
/** Set when interrupt already rolled cooldown (prevents double cooldown on NPC dazed completion). */
|
||||
/**
|
||||
* Set when interrupt already rolled cooldown (prevents double cooldown on NPC dazed completion).
|
||||
*/
|
||||
protected boolean interruptCooldownRolled = false;
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
// ABSTRACT METHODS - Subclasses must implement
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
|
||||
/** Get the entity this ability data belongs to (NPC or Player). */
|
||||
/**
|
||||
* Get the entity this ability data belongs to (NPC or Player).
|
||||
*/
|
||||
protected abstract EntityLivingBase getEntity();
|
||||
|
||||
/** Get the current target for ability execution. */
|
||||
/**
|
||||
* Get the current target for ability execution.
|
||||
*/
|
||||
protected abstract EntityLivingBase getTarget();
|
||||
|
||||
/** Get the current world time. */
|
||||
/**
|
||||
* Get the current world time.
|
||||
*/
|
||||
protected abstract long getWorldTime();
|
||||
|
||||
// -- Event Firing --
|
||||
|
||||
/** Fire tick event. Implementation differs between NPC (NpcAPI) and Player (ScriptController). */
|
||||
/**
|
||||
* Fire tick event. Implementation differs between NPC (NpcAPI) and Player (ScriptController).
|
||||
*/
|
||||
protected abstract void fireTickEvent(Ability ability, EntityLivingBase target);
|
||||
|
||||
/** Fire execute event. Returns true if cancelled. */
|
||||
/**
|
||||
* Fire execute event. Returns true if cancelled.
|
||||
*/
|
||||
protected abstract boolean fireExecuteEvent(Ability ability, EntityLivingBase target);
|
||||
|
||||
/** Fire complete event. */
|
||||
/**
|
||||
* Fire complete event.
|
||||
*/
|
||||
protected abstract void fireCompleteEvent(Ability ability, EntityLivingBase target);
|
||||
|
||||
/** Fire interrupt event. */
|
||||
/**
|
||||
* Fire interrupt event.
|
||||
*/
|
||||
protected abstract void fireInterruptEvent(Ability ability, EntityLivingBase target,
|
||||
DamageSource source, float damage);
|
||||
|
||||
// -- Telegraph --
|
||||
|
||||
/** Spawn telegraphs for an ability. */
|
||||
/**
|
||||
* Spawn telegraphs for an ability.
|
||||
*/
|
||||
protected abstract void spawnTelegraph(Ability ability, EntityLivingBase target);
|
||||
|
||||
/** Remove telegraphs for an ability. */
|
||||
/**
|
||||
* Remove telegraphs for an ability.
|
||||
*/
|
||||
protected abstract void removeTelegraph(Ability ability);
|
||||
|
||||
// -- Animation/Sound Data Access --
|
||||
|
||||
/** Set animation data on the entity. */
|
||||
/**
|
||||
* Set animation data on the entity.
|
||||
*/
|
||||
protected abstract void setAnimationData(Animation animation);
|
||||
|
||||
/** Clear animation data on the entity. */
|
||||
/**
|
||||
* Clear animation data on the entity.
|
||||
*/
|
||||
protected abstract void clearAnimationData();
|
||||
|
||||
/** Play a sound at the entity's location. */
|
||||
/**
|
||||
* Play a sound at the entity's location.
|
||||
*/
|
||||
protected abstract void playAbilitySound(String sound);
|
||||
|
||||
// -- Rotation (subclass handles extra fields and application) --
|
||||
|
||||
/** Capture rotation values for locking. NPC captures 4 fields, Player captures 2. */
|
||||
/**
|
||||
* Capture rotation values for locking. NPC captures 4 fields, Player captures 2.
|
||||
*/
|
||||
protected abstract void captureLockedRotation();
|
||||
|
||||
// -- Completion --
|
||||
@@ -116,7 +159,9 @@ public abstract class AbstractDataAbilities {
|
||||
*/
|
||||
protected abstract void rollCooldown(Ability ability);
|
||||
|
||||
/** Additional completion logic (NPC clears lastTarget, Player clears key/target and syncs). */
|
||||
/**
|
||||
* Additional completion logic (NPC clears lastTarget, Player clears key/target and syncs).
|
||||
*/
|
||||
protected abstract void onAbilityComplete();
|
||||
|
||||
/**
|
||||
@@ -128,17 +173,30 @@ public abstract class AbstractDataAbilities {
|
||||
|
||||
// -- Hooks (optional overrides) --
|
||||
|
||||
/** Called before onExecute in ACTIVE phase. NPC uses this for faceTarget/hitScan. */
|
||||
protected void onPreExecute(Ability ability, EntityLivingBase target) {}
|
||||
/**
|
||||
* Called before onExecute in ACTIVE phase. NPC uses this for faceTarget/hitScan.
|
||||
*/
|
||||
protected void onPreExecute(Ability ability, EntityLivingBase target) {
|
||||
}
|
||||
|
||||
/** Called after the phase switch. NPC uses this for hit scan updates and movement control. */
|
||||
protected void onPostPhaseTick(Ability ability, EntityLivingBase target) {}
|
||||
/**
|
||||
* Called after the phase switch. NPC uses this for hit scan updates and movement control.
|
||||
*/
|
||||
protected void onPostPhaseTick(Ability ability, EntityLivingBase target) {
|
||||
}
|
||||
|
||||
/** Additional lock releases in BURST_DELAY. NPC releases hitScan. */
|
||||
protected void onBurstDelayReleaseLocks() {}
|
||||
/**
|
||||
* Additional lock releases in BURST_DELAY. NPC releases hitScan.
|
||||
*/
|
||||
protected void onBurstDelayReleaseLocks() {
|
||||
}
|
||||
|
||||
/** Hook for retargeting during chain execution when target dies. NPC overrides, Player returns null. */
|
||||
protected EntityLivingBase retargetForChain() { return null; }
|
||||
/**
|
||||
* Hook for retargeting during chain execution when target dies. NPC overrides, Player returns null.
|
||||
*/
|
||||
protected EntityLivingBase retargetForChain() {
|
||||
return null;
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
// SHARED ANIMATION METHODS
|
||||
@@ -178,22 +236,30 @@ public abstract class AbstractDataAbilities {
|
||||
// STATE QUERIES
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
|
||||
/** Check if an ability is currently executing. */
|
||||
/**
|
||||
* Check if an ability is currently executing.
|
||||
*/
|
||||
public boolean isExecutingAbility() {
|
||||
return currentAbility != null && currentAbility.isExecuting();
|
||||
}
|
||||
|
||||
/** Get the currently executing ability. */
|
||||
/**
|
||||
* Get the currently executing ability.
|
||||
*/
|
||||
public Ability getCurrentAbility() {
|
||||
return currentAbility;
|
||||
}
|
||||
|
||||
/** Check if a chained ability is currently executing. */
|
||||
/**
|
||||
* Check if a chained ability is currently executing.
|
||||
*/
|
||||
public boolean isExecutingChain() {
|
||||
return currentChain != null;
|
||||
}
|
||||
|
||||
/** Get the currently executing chained ability. */
|
||||
/**
|
||||
* Get the currently executing chained ability.
|
||||
*/
|
||||
public ChainedAbility getCurrentChain() {
|
||||
return currentChain;
|
||||
}
|
||||
@@ -202,11 +268,14 @@ public abstract class AbstractDataAbilities {
|
||||
// TOGGLE STATE (active toggles, independent of currentAbility)
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
|
||||
/** Currently active toggles. Key = ability key, Value = toggle entry with tick counter. */
|
||||
/**
|
||||
* Currently active toggles. Key = ability key, Value = toggle entry with tick counter.
|
||||
*/
|
||||
protected Map<String, ToggleEntry> activeToggles = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* Toggle an ability ON or OFF. If currently on, turns off; if off, turns on.
|
||||
*
|
||||
* @param key The ability key (e.g., "npcdbc:ki_fist")
|
||||
* @return true if the toggle is now ON, false if OFF
|
||||
*/
|
||||
@@ -221,8 +290,9 @@ public abstract class AbstractDataAbilities {
|
||||
|
||||
/**
|
||||
* Set a toggle to a specific state.
|
||||
*
|
||||
* @param key The ability key
|
||||
* @param on true to activate, false to deactivate
|
||||
* @param on true to activate, false to deactivate
|
||||
*/
|
||||
public void setAbilityToggled(String key, boolean on) {
|
||||
if (on && !activeToggles.containsKey(key)) {
|
||||
@@ -300,8 +370,11 @@ public abstract class AbstractDataAbilities {
|
||||
}
|
||||
}
|
||||
|
||||
/** Hook for subclass to react to toggle state changes (sync packets, script events). */
|
||||
protected void onToggleStateChanged(String key, boolean active) {}
|
||||
/**
|
||||
* Hook for subclass to react to toggle state changes (sync packets, script events).
|
||||
*/
|
||||
protected void onToggleStateChanged(String key, boolean active) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all active toggles (e.g., on death/reset).
|
||||
@@ -336,23 +409,31 @@ public abstract class AbstractDataAbilities {
|
||||
// COOLDOWN MANAGEMENT
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
|
||||
/** Check if on cooldown. */
|
||||
/**
|
||||
* Check if on cooldown.
|
||||
*/
|
||||
public boolean isOnCooldown() {
|
||||
return getWorldTime() < cooldownEndTime;
|
||||
}
|
||||
|
||||
/** Get remaining cooldown ticks. */
|
||||
/**
|
||||
* Get remaining cooldown ticks.
|
||||
*/
|
||||
public long getRemainingCooldown() {
|
||||
long remaining = cooldownEndTime - getWorldTime();
|
||||
return remaining > 0 ? remaining : 0;
|
||||
}
|
||||
|
||||
/** Reset cooldown (allow immediate ability use). */
|
||||
/**
|
||||
* Reset cooldown (allow immediate ability use).
|
||||
*/
|
||||
public void resetCooldown() {
|
||||
cooldownEndTime = 0;
|
||||
}
|
||||
|
||||
/** Set the cooldown end time directly. */
|
||||
/**
|
||||
* Set the cooldown end time directly.
|
||||
*/
|
||||
public void setCooldownEndTime(long endTime) {
|
||||
cooldownEndTime = endTime;
|
||||
}
|
||||
@@ -381,8 +462,11 @@ public abstract class AbstractDataAbilities {
|
||||
onPositionLockChanged(false);
|
||||
}
|
||||
|
||||
/** Hook for subclass to react to position lock state changes (e.g., NPC sets data watcher flag). */
|
||||
protected void onPositionLockChanged(boolean locked) {}
|
||||
/**
|
||||
* Hook for subclass to react to position lock state changes (e.g., NPC sets data watcher flag).
|
||||
*/
|
||||
protected void onPositionLockChanged(boolean locked) {
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
// ROTATION LOCKING
|
||||
@@ -396,8 +480,11 @@ public abstract class AbstractDataAbilities {
|
||||
onRotationLockChanged(false);
|
||||
}
|
||||
|
||||
/** Hook for subclass to react to rotation lock state changes (e.g., NPC sets flag, clears hitScan). */
|
||||
protected void onRotationLockChanged(boolean locked) {}
|
||||
/**
|
||||
* Hook for subclass to react to rotation lock state changes (e.g., NPC sets flag, clears hitScan).
|
||||
*/
|
||||
protected void onRotationLockChanged(boolean locked) {
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
// CORE TICK - Phase transition logic shared between NPC and Player
|
||||
@@ -441,7 +528,7 @@ public abstract class AbstractDataAbilities {
|
||||
|
||||
// Fire extender tick hook (e.g., per-tick resource drain)
|
||||
if (!AbilityController.Instance.fireOnAbilityTick(currentAbility, entity, target,
|
||||
currentAbility.getPhase(), currentAbility.getCurrentTick())) {
|
||||
currentAbility.getPhase(), currentAbility.getCurrentTick())) {
|
||||
interruptCurrentAbility(null, 0);
|
||||
return;
|
||||
}
|
||||
@@ -711,7 +798,8 @@ public abstract class AbstractDataAbilities {
|
||||
* Hook called after interrupt completes. Subclass handles clearing state and syncing.
|
||||
* NPC: keeps currentAbility (ticks through DAZED). Player: clears immediately.
|
||||
*/
|
||||
protected void onInterruptComplete() {}
|
||||
protected void onInterruptComplete() {
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
// CHAINED ABILITY EXECUTION
|
||||
|
||||
@@ -13,13 +13,13 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import noppes.npcs.api.IWorld;
|
||||
import noppes.npcs.blocks.tiles.TileNpcContainer;
|
||||
import noppes.npcs.config.ConfigScript;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.containers.ContainerAuction;
|
||||
import noppes.npcs.containers.ContainerAnvilRepair;
|
||||
import noppes.npcs.containers.ContainerAuctionBidding;
|
||||
import noppes.npcs.containers.ContainerAuctionTrades;
|
||||
import noppes.npcs.containers.ContainerAuctionListing;
|
||||
import noppes.npcs.containers.ContainerAuctionSell;
|
||||
import noppes.npcs.containers.ContainerAnvilRepair;
|
||||
import noppes.npcs.containers.ContainerAuctionTrades;
|
||||
import noppes.npcs.containers.ContainerCarpentryBench;
|
||||
import noppes.npcs.containers.ContainerCrate;
|
||||
import noppes.npcs.containers.ContainerCustomGui;
|
||||
@@ -43,7 +43,6 @@ import noppes.npcs.containers.ContainerNpcQuestReward;
|
||||
import noppes.npcs.containers.ContainerNpcQuestTypeItem;
|
||||
import noppes.npcs.controllers.data.AnimationData;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.config.ConfigScript;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
public class CommonProxy implements IGuiHandler {
|
||||
|
||||
@@ -21,13 +21,22 @@ import io.github.somehussar.janinoloader.api.IDynamicCompilerBuilder;
|
||||
import kamkeel.npcs.addon.AddonManager;
|
||||
import kamkeel.npcs.command.CommandKamkeel;
|
||||
import kamkeel.npcs.command.profile.CommandProfile;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.AttributeController;
|
||||
import kamkeel.npcs.controllers.ProfileController;
|
||||
import kamkeel.npcs.controllers.SyncController;
|
||||
import kamkeel.npcs.controllers.TelegraphController;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.profile.CNPCData;
|
||||
import kamkeel.npcs.developer.Developer;
|
||||
import kamkeel.npcs.entity.EntityAbilityBeam;
|
||||
import kamkeel.npcs.entity.EntityAbilityDisc;
|
||||
import kamkeel.npcs.entity.EntityAbilityLaser;
|
||||
import kamkeel.npcs.entity.EntityAbilityOrb;
|
||||
import kamkeel.npcs.entity.EntityAbilitySweeper;
|
||||
import kamkeel.npcs.entity.EntityAbilityZone;
|
||||
import kamkeel.npcs.entity.EntityEnergyDome;
|
||||
import kamkeel.npcs.entity.EntityEnergyPanel;
|
||||
import kamkeel.npcs.entity.EntityEnergySlicer;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
import kamkeel.npcs.util.BukkitUtil;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -86,15 +95,6 @@ import noppes.npcs.entity.EntityNpcDragon;
|
||||
import noppes.npcs.entity.EntityNpcPony;
|
||||
import noppes.npcs.entity.EntityNpcSlime;
|
||||
import noppes.npcs.entity.EntityProjectile;
|
||||
import kamkeel.npcs.entity.EntityAbilityOrb;
|
||||
import kamkeel.npcs.entity.EntityAbilityDisc;
|
||||
import kamkeel.npcs.entity.EntityAbilityLaser;
|
||||
import kamkeel.npcs.entity.EntityAbilityBeam;
|
||||
import kamkeel.npcs.entity.EntityAbilitySweeper;
|
||||
import kamkeel.npcs.entity.EntityAbilityZone;
|
||||
import kamkeel.npcs.entity.EntityEnergyDome;
|
||||
import kamkeel.npcs.entity.EntityEnergyPanel;
|
||||
import kamkeel.npcs.entity.EntityEnergySlicer;
|
||||
import noppes.npcs.entity.old.EntityNPCDwarfFemale;
|
||||
import noppes.npcs.entity.old.EntityNPCDwarfMale;
|
||||
import noppes.npcs.entity.old.EntityNPCElfFemale;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package noppes.npcs;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityPhase;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityAction;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityPhase;
|
||||
import kamkeel.npcs.controllers.data.ability.ChainedAbility;
|
||||
import kamkeel.npcs.controllers.data.ability.IAbilityAction;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityGuard;
|
||||
@@ -86,10 +86,14 @@ public class DataAbilities extends AbstractDataAbilities {
|
||||
private transient boolean hitScanActive = false;
|
||||
private transient EntityLivingBase hitScanTarget = null;
|
||||
|
||||
/** Bit flag for rotation control (LOCKED or TRACK) in data watcher slot 15 */
|
||||
/**
|
||||
* Bit flag for rotation control (LOCKED or TRACK) in data watcher slot 15
|
||||
*/
|
||||
private static final int ROTATION_CONTROLLED_FLAG = 16;
|
||||
|
||||
/** Bit flag for position lock in data watcher slot 15 */
|
||||
/**
|
||||
* Bit flag for position lock in data watcher slot 15
|
||||
*/
|
||||
private static final int POSITION_LOCKED_FLAG = 32;
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
@@ -143,7 +147,7 @@ public class DataAbilities extends AbstractDataAbilities {
|
||||
|
||||
@Override
|
||||
protected void fireInterruptEvent(Ability ability, EntityLivingBase target,
|
||||
DamageSource source, float damage) {
|
||||
DamageSource source, float damage) {
|
||||
AbilityEvent.InterruptEvent interruptEvent = new AbilityEvent.InterruptEvent(
|
||||
npc.wrappedNPC, ability, target, source, damage);
|
||||
NpcAPI.EVENT_BUS.post(interruptEvent);
|
||||
@@ -247,7 +251,7 @@ public class DataAbilities extends AbstractDataAbilities {
|
||||
// Update hit scan state - actual facing is deferred to applyRotationControl()
|
||||
// which runs AFTER super.onLivingUpdate() to override AI look helper
|
||||
if (ability != null && ability.isExecuting()
|
||||
&& ability.isHitScanForCurrentPhase() && target != null) {
|
||||
&& ability.isHitScanForCurrentPhase() && target != null) {
|
||||
enableHitScan(target);
|
||||
} else if (hitScanActive) {
|
||||
releaseRotationControl();
|
||||
@@ -613,7 +617,7 @@ public class DataAbilities extends AbstractDataAbilities {
|
||||
* If an ability is currently executing, it will be cancelled.
|
||||
*
|
||||
* @param ability The ability to start
|
||||
* @param target The target entity (can be null for self-targeted abilities)
|
||||
* @param target The target entity (can be null for self-targeted abilities)
|
||||
* @return true if the ability was started successfully
|
||||
*/
|
||||
public boolean forceStartAbility(Ability ability, EntityLivingBase target) {
|
||||
@@ -640,7 +644,7 @@ public class DataAbilities extends AbstractDataAbilities {
|
||||
* Execute an ability on this NPC by key (built-in name or custom UUID).
|
||||
* The NPC does NOT need to have this ability assigned.
|
||||
*
|
||||
* @param key The ability key (built-in name or custom UUID)
|
||||
* @param key The ability key (built-in name or custom UUID)
|
||||
* @param target The target entity (can be null for self-targeted abilities)
|
||||
* @return true if the ability was started successfully
|
||||
*/
|
||||
@@ -729,7 +733,9 @@ public class DataAbilities extends AbstractDataAbilities {
|
||||
// ACTION SLOT MANAGEMENT
|
||||
// ═══════════════════════════════════════════════════════════════════
|
||||
|
||||
/** Get the unified action slot list. */
|
||||
/**
|
||||
* Get the unified action slot list.
|
||||
*/
|
||||
public List<AbilityAction> getAbilityActions() {
|
||||
return actionSlots;
|
||||
}
|
||||
@@ -748,17 +754,23 @@ public class DataAbilities extends AbstractDataAbilities {
|
||||
return resolved;
|
||||
}
|
||||
|
||||
/** Add an inline ability. */
|
||||
/**
|
||||
* Add an inline ability.
|
||||
*/
|
||||
public void addAbility(Ability ability) {
|
||||
actionSlots.add(AbilityAction.inline(ability));
|
||||
}
|
||||
|
||||
/** Add a reference ability by key (built-in name or custom ability name). */
|
||||
/**
|
||||
* Add a reference ability by key (built-in name or custom ability name).
|
||||
*/
|
||||
public void addAbilityReference(String key) {
|
||||
actionSlots.add(AbilityAction.abilityReference(key));
|
||||
}
|
||||
|
||||
/** Add a chained ability reference by name. */
|
||||
/**
|
||||
* Add a chained ability reference by name.
|
||||
*/
|
||||
public void addChainReference(String name) {
|
||||
if (name != null && !name.isEmpty()) {
|
||||
for (AbilityAction slot : actionSlots) {
|
||||
@@ -770,7 +782,9 @@ public class DataAbilities extends AbstractDataAbilities {
|
||||
}
|
||||
}
|
||||
|
||||
/** Remove an action slot by index. */
|
||||
/**
|
||||
* Remove an action slot by index.
|
||||
*/
|
||||
public void removeAction(int index) {
|
||||
if (index >= 0 && index < actionSlots.size()) {
|
||||
actionSlots.remove(index);
|
||||
@@ -804,13 +818,17 @@ public class DataAbilities extends AbstractDataAbilities {
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Check if a slot at a given index is a reference. */
|
||||
/**
|
||||
* Check if a slot at a given index is a reference.
|
||||
*/
|
||||
public boolean isSlotReference(int index) {
|
||||
if (index < 0 || index >= actionSlots.size()) return false;
|
||||
return actionSlots.get(index).isReference();
|
||||
}
|
||||
|
||||
/** Convert a reference slot to inline. Returns false if resolution fails or is a chain. */
|
||||
/**
|
||||
* Convert a reference slot to inline. Returns false if resolution fails or is a chain.
|
||||
*/
|
||||
public boolean convertToInline(int index) {
|
||||
if (index < 0 || index >= actionSlots.size()) return false;
|
||||
return actionSlots.get(index).convertToInline();
|
||||
@@ -934,7 +952,7 @@ public class DataAbilities extends AbstractDataAbilities {
|
||||
/**
|
||||
* Apply rotation control after super.onLivingUpdate() and super.onUpdate().
|
||||
* Handles both LOCKED (freeze at captured values) and TRACK (face target) modes.
|
||||
*
|
||||
* <p>
|
||||
* Server: computes the correct rotation (locked values or target facing).
|
||||
* Client: trusts the server-synced rotation values and prevents body smoothing override.
|
||||
*/
|
||||
|
||||
@@ -20,9 +20,9 @@ import net.minecraftforge.event.world.WorldEvent;
|
||||
import noppes.npcs.api.IBlock;
|
||||
import noppes.npcs.api.IPos;
|
||||
import noppes.npcs.api.IWorld;
|
||||
import noppes.npcs.api.entity.IEnergyProjectile;
|
||||
import noppes.npcs.api.entity.IAnimatable;
|
||||
import noppes.npcs.api.entity.ICustomNpc;
|
||||
import noppes.npcs.api.entity.IEnergyProjectile;
|
||||
import noppes.npcs.api.entity.IEntity;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.entity.IProjectile;
|
||||
@@ -64,10 +64,10 @@ import noppes.npcs.scripted.event.NpcEvent;
|
||||
import noppes.npcs.scripted.event.PartyEvent;
|
||||
import noppes.npcs.scripted.event.ProjectileEvent;
|
||||
import noppes.npcs.scripted.event.RecipeScriptEvent;
|
||||
import noppes.npcs.scripted.event.player.AuctionEvent;
|
||||
import noppes.npcs.scripted.event.player.CustomGuiEvent;
|
||||
import noppes.npcs.scripted.event.player.DialogEvent;
|
||||
import noppes.npcs.scripted.event.player.FactionEvent;
|
||||
import noppes.npcs.scripted.event.player.AuctionEvent;
|
||||
import noppes.npcs.scripted.event.player.PlayerAbilityEvent;
|
||||
import noppes.npcs.scripted.event.player.PlayerEvent;
|
||||
import noppes.npcs.scripted.event.player.PlayerEvent.ChatEvent;
|
||||
@@ -561,7 +561,7 @@ public class EventHooks {
|
||||
// ==================== ENERGY BARRIER EVENTS ====================
|
||||
|
||||
private static void dispatchBarrierEvent(net.minecraft.entity.Entity barrierEntity, int ownerEntityId,
|
||||
noppes.npcs.scripted.event.EnergyBarrierEvent event, EnumScriptType type) {
|
||||
noppes.npcs.scripted.event.EnergyBarrierEvent event, EnumScriptType type) {
|
||||
ScriptController.Instance.globalNpcScripts.callScript(type, event);
|
||||
|
||||
net.minecraft.entity.Entity owner = barrierEntity.worldObj.getEntityByID(ownerEntityId);
|
||||
|
||||
@@ -6,10 +6,10 @@ import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import kamkeel.npcs.addon.DBCAddon;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.AttributeController;
|
||||
import kamkeel.npcs.controllers.SyncController;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.util.AttributeAttackUtil;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -6,9 +6,9 @@ import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import kamkeel.npcs.controllers.ProfileController;
|
||||
import kamkeel.npcs.controllers.SyncController;
|
||||
import noppes.npcs.controllers.AuctionController;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import noppes.npcs.controllers.AuctionController;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.controllers.data.action.ActionManager;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package noppes.npcs.ai;
|
||||
|
||||
import kamkeel.npcs.addon.DBCAddon;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityGuard;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -12,10 +12,8 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.blocks.tiles.TileWaypoint;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
|
||||
public class BlockWaypoint extends BlockContainer {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
/**
|
||||
* Client-side cache for auction configuration synced from server.
|
||||
* Prevents client from using local ConfigMarket which may differ from server settings.
|
||||
*
|
||||
* <p>
|
||||
* IMPORTANT: This class is CLIENT-ONLY. Server-side NBT writing is done in
|
||||
* AuctionConfigSync to avoid @SideOnly crashes on dedicated servers.
|
||||
*/
|
||||
@@ -56,11 +56,31 @@ public class AuctionClientConfig {
|
||||
}
|
||||
|
||||
// Getters
|
||||
public static boolean isAuctionEnabled() { return auctionEnabled; }
|
||||
public static long getListingFee() { return listingFee; }
|
||||
public static String getCurrencyName() { return currencyName; }
|
||||
public static int getAuctionDurationHours() { return auctionDurationHours; }
|
||||
public static double getMinBidIncrement() { return minBidIncrement; }
|
||||
public static int getMaxActiveListings() { return maxActiveListings; }
|
||||
public static int getClaimExpirationDays() { return claimExpirationDays; }
|
||||
public static boolean isAuctionEnabled() {
|
||||
return auctionEnabled;
|
||||
}
|
||||
|
||||
public static long getListingFee() {
|
||||
return listingFee;
|
||||
}
|
||||
|
||||
public static String getCurrencyName() {
|
||||
return currencyName;
|
||||
}
|
||||
|
||||
public static int getAuctionDurationHours() {
|
||||
return auctionDurationHours;
|
||||
}
|
||||
|
||||
public static double getMinBidIncrement() {
|
||||
return minBidIncrement;
|
||||
}
|
||||
|
||||
public static int getMaxActiveListings() {
|
||||
return maxActiveListings;
|
||||
}
|
||||
|
||||
public static int getClaimExpirationDays() {
|
||||
return claimExpirationDays;
|
||||
}
|
||||
}
|
||||
@@ -20,12 +20,12 @@ import net.minecraftforge.client.event.RenderHandEvent;
|
||||
import net.minecraftforge.client.event.RenderLivingEvent;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import noppes.npcs.client.gui.player.AuctionTooltipHandler;
|
||||
import noppes.npcs.client.gui.customoverlay.OverlayCustom;
|
||||
import noppes.npcs.client.gui.hud.ClientHudManager;
|
||||
import noppes.npcs.client.gui.hud.CompassHudComponent;
|
||||
import noppes.npcs.client.gui.hud.EnumHudComponent;
|
||||
import noppes.npcs.client.gui.hud.QuestTrackingComponent;
|
||||
import noppes.npcs.client.gui.player.AuctionTooltipHandler;
|
||||
import noppes.npcs.client.renderer.MarkRenderer;
|
||||
import noppes.npcs.client.renderer.RenderCNPCPlayer;
|
||||
import noppes.npcs.constants.EnumAnimationPart;
|
||||
@@ -91,9 +91,9 @@ public class ClientEventHandler {
|
||||
// Block mouse movement during ability rotation lock.
|
||||
// Allow clicks (button >= 0) and scroll (dwheel != 0) to pass through.
|
||||
if (mc.theWorld != null && mc.thePlayer != null
|
||||
&& ClientAbilityState.shouldLockRotation()
|
||||
&& (event.dx != 0 || event.dy != 0)
|
||||
&& event.button == -1 && event.dwheel == 0) {
|
||||
&& ClientAbilityState.shouldLockRotation()
|
||||
&& (event.dx != 0 || event.dy != 0)
|
||||
&& event.button == -1 && event.dwheel == 0) {
|
||||
event.setCanceled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6,8 +6,27 @@ import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
import kamkeel.npcs.addon.client.DBCClient;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityBeam;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityDisc;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityLaser;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityOrb;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilitySweeper;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityZone;
|
||||
import kamkeel.npcs.client.renderer.RenderEnergyDome;
|
||||
import kamkeel.npcs.client.renderer.RenderEnergyPanel;
|
||||
import kamkeel.npcs.client.renderer.RenderEnergySlicer;
|
||||
import kamkeel.npcs.client.renderer.TelegraphRenderer;
|
||||
import kamkeel.npcs.client.renderer.lightning.LightningHandler;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphManager;
|
||||
import kamkeel.npcs.entity.EntityAbilityBeam;
|
||||
import kamkeel.npcs.entity.EntityAbilityDisc;
|
||||
import kamkeel.npcs.entity.EntityAbilityLaser;
|
||||
import kamkeel.npcs.entity.EntityAbilityOrb;
|
||||
import kamkeel.npcs.entity.EntityAbilitySweeper;
|
||||
import kamkeel.npcs.entity.EntityAbilityZone;
|
||||
import kamkeel.npcs.entity.EntityEnergyDome;
|
||||
import kamkeel.npcs.entity.EntityEnergyPanel;
|
||||
import kamkeel.npcs.entity.EntityEnergySlicer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
@@ -88,12 +107,12 @@ import noppes.npcs.client.gui.global.GuiNPCManageAnimations;
|
||||
import noppes.npcs.client.gui.global.GuiNPCManageBanks;
|
||||
import noppes.npcs.client.gui.global.GuiNPCManageDialogs;
|
||||
import noppes.npcs.client.gui.global.GuiNPCManageEffects;
|
||||
import noppes.npcs.client.gui.global.GuiNpcManageAbilities;
|
||||
import noppes.npcs.client.gui.global.GuiNPCManageFactions;
|
||||
import noppes.npcs.client.gui.global.GuiNPCManageLinked;
|
||||
import noppes.npcs.client.gui.global.GuiNPCManageQuest;
|
||||
import noppes.npcs.client.gui.global.GuiNPCManageTags;
|
||||
import noppes.npcs.client.gui.global.GuiNPCManageTransporters;
|
||||
import noppes.npcs.client.gui.global.GuiNpcManageAbilities;
|
||||
import noppes.npcs.client.gui.global.GuiNpcManageMagic;
|
||||
import noppes.npcs.client.gui.global.GuiNpcManageRecipes;
|
||||
import noppes.npcs.client.gui.global.GuiNpcQuestReward;
|
||||
@@ -105,15 +124,15 @@ import noppes.npcs.client.gui.mainmenu.GuiNpcAI;
|
||||
import noppes.npcs.client.gui.mainmenu.GuiNpcAdvanced;
|
||||
import noppes.npcs.client.gui.mainmenu.GuiNpcDisplay;
|
||||
import noppes.npcs.client.gui.mainmenu.GuiNpcStats;
|
||||
import noppes.npcs.client.gui.player.GuiAuctionBidding;
|
||||
import noppes.npcs.client.gui.player.GuiAuctionListing;
|
||||
import noppes.npcs.client.gui.player.GuiAuctionSell;
|
||||
import noppes.npcs.client.gui.player.GuiAuctionTrades;
|
||||
import noppes.npcs.client.gui.player.GuiBigSign;
|
||||
import noppes.npcs.client.gui.player.GuiCrate;
|
||||
import noppes.npcs.client.gui.player.GuiMailbox;
|
||||
import noppes.npcs.client.gui.player.GuiMailmanWrite;
|
||||
import noppes.npcs.client.gui.player.GuiNPCBankChest;
|
||||
import noppes.npcs.client.gui.player.GuiAuctionBidding;
|
||||
import noppes.npcs.client.gui.player.GuiAuctionTrades;
|
||||
import noppes.npcs.client.gui.player.GuiAuctionListing;
|
||||
import noppes.npcs.client.gui.player.GuiAuctionSell;
|
||||
import noppes.npcs.client.gui.player.GuiNPCTrader;
|
||||
import noppes.npcs.client.gui.player.GuiNpcAnvil;
|
||||
import noppes.npcs.client.gui.player.GuiNpcCarpentryBench;
|
||||
@@ -146,25 +165,6 @@ import noppes.npcs.client.renderer.RenderNpcCrystal;
|
||||
import noppes.npcs.client.renderer.RenderNpcDragon;
|
||||
import noppes.npcs.client.renderer.RenderNpcSlime;
|
||||
import noppes.npcs.client.renderer.RenderProjectile;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityOrb;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityDisc;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityLaser;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityBeam;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilitySweeper;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityZone;
|
||||
import kamkeel.npcs.client.renderer.RenderEnergyDome;
|
||||
import kamkeel.npcs.client.renderer.RenderEnergyPanel;
|
||||
import kamkeel.npcs.client.renderer.RenderEnergySlicer;
|
||||
import kamkeel.npcs.client.renderer.lightning.LightningHandler;
|
||||
import kamkeel.npcs.entity.EntityAbilityOrb;
|
||||
import kamkeel.npcs.entity.EntityAbilityDisc;
|
||||
import kamkeel.npcs.entity.EntityAbilityLaser;
|
||||
import kamkeel.npcs.entity.EntityAbilityBeam;
|
||||
import kamkeel.npcs.entity.EntityAbilitySweeper;
|
||||
import kamkeel.npcs.entity.EntityAbilityZone;
|
||||
import kamkeel.npcs.entity.EntityEnergyDome;
|
||||
import kamkeel.npcs.entity.EntityEnergyPanel;
|
||||
import kamkeel.npcs.entity.EntityEnergySlicer;
|
||||
import noppes.npcs.client.renderer.blocks.BlockBannerRenderer;
|
||||
import noppes.npcs.client.renderer.blocks.BlockBarrelRenderer;
|
||||
import noppes.npcs.client.renderer.blocks.BlockBeamRenderer;
|
||||
@@ -200,13 +200,16 @@ import noppes.npcs.client.renderer.items.ItemShortLampRenderer;
|
||||
import noppes.npcs.client.renderer.items.ItemTallLampRenderer;
|
||||
import noppes.npcs.client.renderer.items.ItemToolRenderer;
|
||||
import noppes.npcs.client.renderer.items.ScriptedBlockItemRenderer;
|
||||
import noppes.npcs.client.ScriptClientConfig;
|
||||
import noppes.npcs.config.ConfigClient;
|
||||
import noppes.npcs.config.ConfigItem;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.config.StringCache;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.containers.ContainerAnvilRepair;
|
||||
import noppes.npcs.containers.ContainerAuctionBidding;
|
||||
import noppes.npcs.containers.ContainerAuctionListing;
|
||||
import noppes.npcs.containers.ContainerAuctionSell;
|
||||
import noppes.npcs.containers.ContainerAuctionTrades;
|
||||
import noppes.npcs.containers.ContainerCarpentryBench;
|
||||
import noppes.npcs.containers.ContainerCrate;
|
||||
import noppes.npcs.containers.ContainerCustomGui;
|
||||
@@ -219,11 +222,6 @@ import noppes.npcs.containers.ContainerNPCFollower;
|
||||
import noppes.npcs.containers.ContainerNPCFollowerHire;
|
||||
import noppes.npcs.containers.ContainerNPCFollowerSetup;
|
||||
import noppes.npcs.containers.ContainerNPCInv;
|
||||
import noppes.npcs.containers.ContainerAuction;
|
||||
import noppes.npcs.containers.ContainerAuctionBidding;
|
||||
import noppes.npcs.containers.ContainerAuctionTrades;
|
||||
import noppes.npcs.containers.ContainerAuctionListing;
|
||||
import noppes.npcs.containers.ContainerAuctionSell;
|
||||
import noppes.npcs.containers.ContainerNPCTrader;
|
||||
import noppes.npcs.containers.ContainerNPCTraderSetup;
|
||||
import noppes.npcs.containers.ContainerNpcItemGiver;
|
||||
@@ -525,9 +523,7 @@ public class ClientProxy extends CommonProxy {
|
||||
abilityNpc.width = 0.6f;
|
||||
}
|
||||
return new GuiNpcManageAbilities(abilityNpc, npc != null);
|
||||
}
|
||||
|
||||
else if (gui == EnumGuiType.MainMenuGlobal)
|
||||
} else if (gui == EnumGuiType.MainMenuGlobal)
|
||||
return new GuiNPCGlobalMainMenu(npc);
|
||||
|
||||
else if (gui == EnumGuiType.MainMenuAI)
|
||||
|
||||
@@ -136,8 +136,8 @@ public class ClientTickHandler {
|
||||
|
||||
// Prevent jumping when locked (allow gravity only if not flying)
|
||||
if ((ClientAbilityState.movementLocked || ClientAbilityState.positionLocked)
|
||||
&& !ClientAbilityState.hasAbilityMovement
|
||||
&& !AbilityController.Instance.isPlayerFlying(mc.thePlayer)) {
|
||||
&& !ClientAbilityState.hasAbilityMovement
|
||||
&& !AbilityController.Instance.isPlayerFlying(mc.thePlayer)) {
|
||||
mc.thePlayer.motionY = Math.min(mc.thePlayer.motionY, 0);
|
||||
}
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public class ClientTickHandler {
|
||||
// Block movement keys during ability lock (only when no GUI is open and world exists).
|
||||
// Non-movement keys (ESC, chat, inventory, etc.) always pass through.
|
||||
if (mc.theWorld != null && mc.currentScreen == null && keyDown
|
||||
&& ClientAbilityState.shouldSuppressMovementInput() && isMovementKey(key)) {
|
||||
&& ClientAbilityState.shouldSuppressMovementInput() && isMovementKey(key)) {
|
||||
// Unpress the keybind so vanilla doesn't process it
|
||||
KeyBinding.setKeyBindState(key, false);
|
||||
return;
|
||||
|
||||
Loaded 100 of 169 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user