Add radiant totem spell
@@ -813,6 +813,7 @@ public class ClientProxy extends CommonProxy {
|
|||||||
RenderingRegistry.registerEntityRenderingHandler(EntityIceSpike.class, RenderIceSpike::new);
|
RenderingRegistry.registerEntityRenderingHandler(EntityIceSpike.class, RenderIceSpike::new);
|
||||||
RenderingRegistry.registerEntityRenderingHandler(EntityForcefield.class, RenderForcefield::new);
|
RenderingRegistry.registerEntityRenderingHandler(EntityForcefield.class, RenderForcefield::new);
|
||||||
RenderingRegistry.registerEntityRenderingHandler(EntityZombieSpawner.class, RenderZombieSpawner::new);
|
RenderingRegistry.registerEntityRenderingHandler(EntityZombieSpawner.class, RenderZombieSpawner::new);
|
||||||
|
RenderingRegistry.registerEntityRenderingHandler(EntityRadiantTotem.class, RenderRadiantTotem::new);
|
||||||
//RenderingRegistry.registerEntityRenderingHandler(EntityContainmentField.class, RenderContainmentField::new);
|
//RenderingRegistry.registerEntityRenderingHandler(EntityContainmentField.class, RenderContainmentField::new);
|
||||||
|
|
||||||
// Stuff that doesn't render
|
// Stuff that doesn't render
|
||||||
|
|||||||
@@ -245,24 +245,4 @@ public class RenderContainmentField {
|
|||||||
buffer.pos(x, y, z).tex(u, v).color(1, 1, 1, f * alpha).endVertex();
|
buffer.pos(x, y, z).tex(u, v).color(1, 1, 1, f * alpha).endVertex();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Useful to keep this mapping in case I ever want to draw cubes again
|
|
||||||
|
|
||||||
// Vec3d[] vertices = WizardryUtilities.getVertices(entity.getEntityBoundingBox().offset(entity.getPositionVector().scale(-1)));
|
|
||||||
//
|
|
||||||
// // Outside
|
|
||||||
// drawFace(tessellator, vertices[0], vertices[1], vertices[3], vertices[2], u1, v1, u2, v2); // Bottom
|
|
||||||
// drawFace(tessellator, vertices[6], vertices[7], vertices[2], vertices[3], u1, v1, u2, v2); // South
|
|
||||||
// drawFace(tessellator, vertices[5], vertices[6], vertices[1], vertices[2], u1, v1, u2, v2); // East
|
|
||||||
// drawFace(tessellator, vertices[4], vertices[5], vertices[0], vertices[1], u1, v1, u2, v2); // North
|
|
||||||
// drawFace(tessellator, vertices[7], vertices[4], vertices[3], vertices[0], u1, v1, u2, v2); // West
|
|
||||||
// drawFace(tessellator, vertices[5], vertices[4], vertices[6], vertices[7], u1, v1, u2, v2); // Top
|
|
||||||
//
|
|
||||||
// // Inside
|
|
||||||
// drawFace(tessellator, vertices[1], vertices[0], vertices[2], vertices[3], u1, v1, u2, v2); // Bottom
|
|
||||||
// drawFace(tessellator, vertices[7], vertices[6], vertices[3], vertices[2], u1, v1, u2, v2); // South
|
|
||||||
// drawFace(tessellator, vertices[6], vertices[5], vertices[2], vertices[1], u1, v1, u2, v2); // East
|
|
||||||
// drawFace(tessellator, vertices[5], vertices[4], vertices[1], vertices[0], u1, v1, u2, v2); // North
|
|
||||||
// drawFace(tessellator, vertices[4], vertices[7], vertices[0], vertices[3], u1, v1, u2, v2); // West
|
|
||||||
// drawFace(tessellator, vertices[4], vertices[5], vertices[7], vertices[6], u1, v1, u2, v2); // Top
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,145 @@
|
|||||||
|
package electroblob.wizardry.client.renderer.entity;
|
||||||
|
|
||||||
|
import electroblob.wizardry.Wizardry;
|
||||||
|
import electroblob.wizardry.client.DrawingUtils;
|
||||||
|
import electroblob.wizardry.entity.construct.EntityRadiantTotem;
|
||||||
|
import electroblob.wizardry.util.GeometryUtils;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.BufferBuilder;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
import net.minecraft.client.renderer.OpenGlHelper;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.client.renderer.entity.Render;
|
||||||
|
import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
public class RenderRadiantTotem extends Render<EntityRadiantTotem> {
|
||||||
|
|
||||||
|
private static final ResourceLocation FLARE_TEXTURE = new ResourceLocation(Wizardry.MODID, "textures/entity/radiant_totem/flare.png");
|
||||||
|
private static final ResourceLocation[] CUBE_TEXTURES = new ResourceLocation[14];
|
||||||
|
|
||||||
|
static {
|
||||||
|
for(int i = 0; i< CUBE_TEXTURES.length; i++) CUBE_TEXTURES[i] = new ResourceLocation(Wizardry.MODID, "textures/entity/radiant_totem/cube_" + i + ".png");
|
||||||
|
}
|
||||||
|
|
||||||
|
public RenderRadiantTotem(RenderManager manager){
|
||||||
|
super(manager);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
protected ResourceLocation getEntityTexture(EntityRadiantTotem entity){
|
||||||
|
return CUBE_TEXTURES[entity.ticksExisted % CUBE_TEXTURES.length];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doRender(EntityRadiantTotem entity, double x, double y, double z, float entityYaw, float partialTicks){
|
||||||
|
|
||||||
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
|
|
||||||
|
GlStateManager.pushMatrix();
|
||||||
|
|
||||||
|
GlStateManager.enableBlend();
|
||||||
|
GlStateManager.disableLighting();
|
||||||
|
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);
|
||||||
|
GlStateManager.depthMask(false);
|
||||||
|
GlStateManager.disableCull();
|
||||||
|
|
||||||
|
GlStateManager.translate(x, y + entity.height/2, z);
|
||||||
|
|
||||||
|
float s = DrawingUtils.smoothScaleFactor(entity.lifetime, entity.ticksExisted, partialTicks, 10, 10);
|
||||||
|
GlStateManager.scale(s, s, s);
|
||||||
|
|
||||||
|
drawFlare(tessellator);
|
||||||
|
drawCube(entity, tessellator, partialTicks);
|
||||||
|
|
||||||
|
GlStateManager.disableBlend();
|
||||||
|
GlStateManager.enableLighting();
|
||||||
|
GlStateManager.depthMask(true);
|
||||||
|
GlStateManager.enableCull();
|
||||||
|
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawFlare(Tessellator tessellator){
|
||||||
|
|
||||||
|
BufferBuilder buffer = tessellator.getBuffer();
|
||||||
|
|
||||||
|
GlStateManager.pushMatrix();
|
||||||
|
|
||||||
|
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
|
bindTexture(FLARE_TEXTURE);
|
||||||
|
|
||||||
|
// This counteracts the reverse rotation behaviour when in front f5 view.
|
||||||
|
// Fun fact: this is a bug with vanilla too! Look at a snowball in front f5 view, for example.
|
||||||
|
float yaw = Minecraft.getMinecraft().gameSettings.thirdPersonView == 2
|
||||||
|
? Minecraft.getMinecraft().getRenderManager().playerViewX
|
||||||
|
: -Minecraft.getMinecraft().getRenderManager().playerViewX;
|
||||||
|
GlStateManager.rotate(180.0F - Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F);
|
||||||
|
GlStateManager.rotate(yaw, 1.0F, 0.0F, 0.0F);
|
||||||
|
|
||||||
|
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
|
||||||
|
|
||||||
|
float r = 0.5f;
|
||||||
|
|
||||||
|
buffer.pos(-r, r, 0).tex(0, 0).endVertex();
|
||||||
|
buffer.pos( r, r, 0).tex(1, 0).endVertex();
|
||||||
|
buffer.pos( r, -r, 0).tex(1, 1).endVertex();
|
||||||
|
buffer.pos(-r, -r, 0).tex(0, 1).endVertex();
|
||||||
|
|
||||||
|
tessellator.draw();
|
||||||
|
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawCube(EntityRadiantTotem entity, Tessellator tessellator, float partialTicks){
|
||||||
|
|
||||||
|
BufferBuilder buffer = tessellator.getBuffer();
|
||||||
|
|
||||||
|
GlStateManager.pushMatrix();
|
||||||
|
|
||||||
|
float age = entity.ticksExisted + partialTicks;
|
||||||
|
float rotationSpeed = 2;
|
||||||
|
|
||||||
|
// GlStateManager.rotate(age * rotationSpeed/2, 0.0F, 1.0F, 0.0F);
|
||||||
|
// GlStateManager.rotate(60.0F, 0.7071F, 0.0F, 0.7071F);
|
||||||
|
// GlStateManager.rotate(age * rotationSpeed, 0.0F, 1.0F, 0.0F);
|
||||||
|
|
||||||
|
GlStateManager.scale(0.5, 0.5, 0.5);
|
||||||
|
|
||||||
|
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||||
|
|
||||||
|
bindEntityTexture(entity);
|
||||||
|
|
||||||
|
Vec3d[] vertices = GeometryUtils.getVertices(entity.getEntityBoundingBox().offset(entity.getPositionVector()
|
||||||
|
.add(0, entity.height/2, 0).scale(-1)));
|
||||||
|
|
||||||
|
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
|
||||||
|
|
||||||
|
// Outside
|
||||||
|
drawFace(buffer, vertices[0], vertices[1], vertices[3], vertices[2], 0.5f, 0, 0.75f, 0.5f); // Bottom
|
||||||
|
drawFace(buffer, vertices[6], vertices[7], vertices[2], vertices[3], 0.75f, 0.5f, 1, 1); // South
|
||||||
|
drawFace(buffer, vertices[5], vertices[6], vertices[1], vertices[2], 0, 0.5f, 0.25f, 1); // East
|
||||||
|
drawFace(buffer, vertices[4], vertices[5], vertices[0], vertices[1], 0.25f, 0.5f, 0.5f, 1); // North
|
||||||
|
drawFace(buffer, vertices[7], vertices[4], vertices[3], vertices[0], 0.5f, 0.5f, 0.75f, 1); // West
|
||||||
|
drawFace(buffer, vertices[5], vertices[4], vertices[6], vertices[7], 0.25f, 0, 0.5f, 0.5f); // Top
|
||||||
|
|
||||||
|
tessellator.draw();
|
||||||
|
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void drawFace(BufferBuilder buffer, Vec3d topLeft, Vec3d topRight, Vec3d bottomLeft, Vec3d bottomRight, float u1, float v1, float u2, float v2){
|
||||||
|
buffer.pos(topLeft.x, topLeft.y, topLeft.z).tex(u1, v1).endVertex();
|
||||||
|
buffer.pos(topRight.x, topRight.y, topRight.z).tex(u2, v1).endVertex();
|
||||||
|
buffer.pos(bottomRight.x, bottomRight.y, bottomRight.z).tex(u2, v2).endVertex();
|
||||||
|
buffer.pos(bottomLeft.x, bottomLeft.y, bottomLeft.z).tex(u1, v2).endVertex();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -241,23 +241,12 @@ public class EntityHammer extends EntityMagicConstruct {
|
|||||||
public void writeSpawnData(ByteBuf data){
|
public void writeSpawnData(ByteBuf data){
|
||||||
super.writeSpawnData(data);
|
super.writeSpawnData(data);
|
||||||
data.writeBoolean(spin);
|
data.writeBoolean(spin);
|
||||||
if(getCaster() != null) data.writeInt(getCaster().getEntityId());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readSpawnData(ByteBuf data){
|
public void readSpawnData(ByteBuf data){
|
||||||
super.readSpawnData(data);
|
super.readSpawnData(data);
|
||||||
spin = data.readBoolean();
|
spin = data.readBoolean();
|
||||||
|
|
||||||
if(!data.isReadable()) return;
|
|
||||||
|
|
||||||
Entity entity = world.getEntityByID(data.readInt());
|
|
||||||
|
|
||||||
if(entity instanceof EntityLivingBase){
|
|
||||||
setCaster((EntityLivingBase)entity);
|
|
||||||
}else{
|
|
||||||
Wizardry.logger.warn("Lightning hammer caster with ID in spawn data not found");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import java.util.UUID;
|
|||||||
*/
|
*/
|
||||||
public abstract class EntityMagicConstruct extends Entity implements IEntityOwnable, IEntityAdditionalSpawnData {
|
public abstract class EntityMagicConstruct extends Entity implements IEntityOwnable, IEntityAdditionalSpawnData {
|
||||||
|
|
||||||
/** The UUID of the caster. As of Wizardry 4.2, this <b>is</b> synced, and rather than storing the caster
|
/** The UUID of the caster. As of Wizardry 4.3, this <b>is</b> synced, and rather than storing the caster
|
||||||
* instance via a weak reference, it is fetched from the UUID each time it is needed in
|
* instance via a weak reference, it is fetched from the UUID each time it is needed in
|
||||||
* {@link EntityMagicConstruct#getCaster()}. */
|
* {@link EntityMagicConstruct#getCaster()}. */
|
||||||
private UUID casterUUID;
|
private UUID casterUUID;
|
||||||
@@ -120,11 +120,26 @@ public abstract class EntityMagicConstruct extends Entity implements IEntityOwna
|
|||||||
@Override
|
@Override
|
||||||
public void writeSpawnData(ByteBuf data){
|
public void writeSpawnData(ByteBuf data){
|
||||||
data.writeInt(lifetime);
|
data.writeInt(lifetime);
|
||||||
|
data.writeInt(getCaster() == null ? -1 : getCaster().getEntityId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readSpawnData(ByteBuf data){
|
public void readSpawnData(ByteBuf data){
|
||||||
|
|
||||||
lifetime = data.readInt();
|
lifetime = data.readInt();
|
||||||
|
|
||||||
|
int id = data.readInt();
|
||||||
|
|
||||||
|
if(id == -1){
|
||||||
|
setCaster(null);
|
||||||
|
}else{
|
||||||
|
Entity entity = world.getEntityByID(id);
|
||||||
|
if(entity instanceof EntityLivingBase){
|
||||||
|
setCaster((EntityLivingBase)entity);
|
||||||
|
}else{
|
||||||
|
Wizardry.logger.warn("Construct caster with ID in spawn data not found");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
@@ -0,0 +1,130 @@
|
|||||||
|
package electroblob.wizardry.entity.construct;
|
||||||
|
|
||||||
|
import electroblob.wizardry.constants.Constants;
|
||||||
|
import electroblob.wizardry.registry.Spells;
|
||||||
|
import electroblob.wizardry.spell.RadiantTotem;
|
||||||
|
import electroblob.wizardry.spell.Spell;
|
||||||
|
import electroblob.wizardry.util.*;
|
||||||
|
import electroblob.wizardry.util.BlockUtils.SurfaceCriteria;
|
||||||
|
import electroblob.wizardry.util.MagicDamage.DamageType;
|
||||||
|
import electroblob.wizardry.util.ParticleBuilder.Type;
|
||||||
|
import io.netty.buffer.ByteBuf;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
public class EntityRadiantTotem extends EntityMagicConstruct {
|
||||||
|
|
||||||
|
private static final int PERIMETER_PARTICLE_DENSITY = 6;
|
||||||
|
|
||||||
|
public EntityRadiantTotem(World world){
|
||||||
|
super(world);
|
||||||
|
this.setSize(1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate(){
|
||||||
|
|
||||||
|
if(this.ticksExisted % 25 == 1){
|
||||||
|
// TODO: Sound
|
||||||
|
}
|
||||||
|
|
||||||
|
super.onUpdate();
|
||||||
|
|
||||||
|
double radius = Spells.radiant_totem.getProperty(Spell.EFFECT_RADIUS).floatValue(); // TODO: Blast modifiers
|
||||||
|
|
||||||
|
if(world.isRemote){
|
||||||
|
|
||||||
|
ParticleBuilder.create(Type.DUST, rand, posX, posY + 0.2, posZ, 0.3, false)
|
||||||
|
.vel(0, -0.02 - world.rand.nextFloat() * 0.01, 0).clr(0xffffff).fade(0xffec90).spawn(world);
|
||||||
|
|
||||||
|
for(int i=0; i<PERIMETER_PARTICLE_DENSITY; i++){
|
||||||
|
|
||||||
|
float angle = ((float)Math.PI * 2)/PERIMETER_PARTICLE_DENSITY * (i + rand.nextFloat());
|
||||||
|
|
||||||
|
double x = posX + radius * MathHelper.sin(angle);
|
||||||
|
double z = posZ + radius * MathHelper.cos(angle);
|
||||||
|
|
||||||
|
Integer y = BlockUtils.getNearestSurface(world, new BlockPos(x, posY, z), EnumFacing.UP, 5, true, SurfaceCriteria.COLLIDABLE);
|
||||||
|
|
||||||
|
if(y != null){
|
||||||
|
ParticleBuilder.create(Type.DUST).pos(x, y, z).vel(0, 0.01, 0).clr(0xffffff).fade(0xffec90).spawn(world);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<EntityLivingBase> nearby = EntityUtils.getLivingWithinRadius(radius, posX, posY, posZ, world);
|
||||||
|
nearby.sort(Comparator.comparingDouble(e -> e.getDistanceSq(this)));
|
||||||
|
|
||||||
|
List<EntityLivingBase> nearbyAllies = nearby.stream().filter(e -> e == getCaster()
|
||||||
|
|| AllyDesignationSystem.isAllied(getCaster(), e)).collect(Collectors.toList());
|
||||||
|
nearby.removeAll(nearbyAllies);
|
||||||
|
|
||||||
|
int targetsRemaining = Spells.radiant_totem.getProperty(RadiantTotem.MAX_TARGETS).intValue()
|
||||||
|
+ (int)((damageMultiplier - 1) / Constants.POTENCY_INCREASE_PER_TIER);
|
||||||
|
|
||||||
|
while(!nearbyAllies.isEmpty() && targetsRemaining > 0){
|
||||||
|
|
||||||
|
EntityLivingBase ally = nearbyAllies.remove(0);
|
||||||
|
|
||||||
|
if(ally.getHealth() < ally.getMaxHealth()){
|
||||||
|
// Slightly slower than healing aura, and it only does 1 at a time (without potency modifiers)
|
||||||
|
if(ally.ticksExisted % 8 == 0) ally.heal(Spells.radiant_totem.getProperty(Spell.HEALTH).floatValue());
|
||||||
|
targetsRemaining--;
|
||||||
|
|
||||||
|
if(world.isRemote){
|
||||||
|
ParticleBuilder.create(Type.BEAM).pos(this.getPositionVector()).target(ally)
|
||||||
|
.clr(1, 0.6f + 0.3f * world.rand.nextFloat(), 0.2f).spawn(world);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while(!nearby.isEmpty() && targetsRemaining > 0){
|
||||||
|
|
||||||
|
EntityLivingBase target = nearby.remove(0);
|
||||||
|
|
||||||
|
if(EntityUtils.isLiving(target)){
|
||||||
|
|
||||||
|
if(target.ticksExisted % target.maxHurtResistantTime == 1){
|
||||||
|
|
||||||
|
float damage = Spells.radiant_totem.getProperty(Spell.DAMAGE).floatValue();
|
||||||
|
|
||||||
|
if(target.isEntityUndead()){
|
||||||
|
target.setFire(Spells.radiant_totem.getProperty(Spell.BURN_DURATION).intValue());
|
||||||
|
// damage *= getProperty(UNDEAD_DAMAGE_MULTIPLIER).floatValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
EntityUtils.attackEntityWithoutKnockback(target, MagicDamage.causeIndirectMagicDamage(this,
|
||||||
|
getCaster(), DamageType.RADIANT), damage);
|
||||||
|
}
|
||||||
|
|
||||||
|
targetsRemaining--;
|
||||||
|
|
||||||
|
if(world.isRemote){
|
||||||
|
ParticleBuilder.create(Type.BEAM).pos(this.getPositionVector().add(0, height/2, 0))
|
||||||
|
.target(target).clr(1, 0.6f + 0.3f * world.rand.nextFloat(), 0.2f).spawn(world);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Usually damage multipliers don't need syncing, but here we're using it for the non-standard purpose of targeting
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeSpawnData(ByteBuf data){
|
||||||
|
super.writeSpawnData(data);
|
||||||
|
data.writeFloat(damageMultiplier);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSpawnData(ByteBuf data){
|
||||||
|
super.readSpawnData(data);
|
||||||
|
damageMultiplier = data.readFloat();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -95,28 +95,4 @@ public class EntityStormcloud extends EntityMagicConstruct {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Need to sync the caster so they don't have particles spawned at them
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeSpawnData(ByteBuf data){
|
|
||||||
super.writeSpawnData(data);
|
|
||||||
if(getCaster() != null) data.writeInt(getCaster().getEntityId());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void readSpawnData(ByteBuf data){
|
|
||||||
|
|
||||||
super.readSpawnData(data);
|
|
||||||
|
|
||||||
if(!data.isReadable()) return;
|
|
||||||
|
|
||||||
Entity entity = world.getEntityByID(data.readInt());
|
|
||||||
|
|
||||||
if(entity instanceof EntityLivingBase){
|
|
||||||
setCaster((EntityLivingBase)entity);
|
|
||||||
}else{
|
|
||||||
Wizardry.logger.warn("Stormcloud caster with ID in spawn data not found");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -243,6 +243,7 @@ public final class Spells {
|
|||||||
public static final Spell blinding_flash = placeholder();
|
public static final Spell blinding_flash = placeholder();
|
||||||
|
|
||||||
public static final Spell stormcloud = placeholder();
|
public static final Spell stormcloud = placeholder();
|
||||||
|
public static final Spell radiant_totem = placeholder();
|
||||||
|
|
||||||
public static final Spell firestorm = placeholder();
|
public static final Spell firestorm = placeholder();
|
||||||
public static final Spell zombie_apocalypse = placeholder();
|
public static final Spell zombie_apocalypse = placeholder();
|
||||||
@@ -451,6 +452,7 @@ public final class Spells {
|
|||||||
registry.register(new BlindingFlash());
|
registry.register(new BlindingFlash());
|
||||||
|
|
||||||
registry.register(new Stormcloud());
|
registry.register(new Stormcloud());
|
||||||
|
registry.register(new RadiantTotem());
|
||||||
|
|
||||||
registry.register(new Firestorm());
|
registry.register(new Firestorm());
|
||||||
registry.register(new ZombieApocalypse());
|
registry.register(new ZombieApocalypse());
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ public class WizardryEntities {
|
|||||||
registry.register(createEntry(EntityHealAura.class, "healing_aura", TrackingType.CONSTRUCT).build());
|
registry.register(createEntry(EntityHealAura.class, "healing_aura", TrackingType.CONSTRUCT).build());
|
||||||
registry.register(createEntry(EntityDecay.class, "decay", TrackingType.CONSTRUCT).build());
|
registry.register(createEntry(EntityDecay.class, "decay", TrackingType.CONSTRUCT).build());
|
||||||
registry.register(createEntry(EntityZombieSpawner.class, "zombie_spawner", TrackingType.CONSTRUCT).build());
|
registry.register(createEntry(EntityZombieSpawner.class, "zombie_spawner", TrackingType.CONSTRUCT).build());
|
||||||
|
registry.register(createEntry(EntityRadiantTotem.class, "radiant_totem", TrackingType.CONSTRUCT).build());
|
||||||
|
|
||||||
// These ones don't render, currently that makes no difference here but we might as well separate them
|
// These ones don't render, currently that makes no difference here but we might as well separate them
|
||||||
registry.register(createEntry(EntityArrowRain.class, "arrow_rain", TrackingType.CONSTRUCT).build());
|
registry.register(createEntry(EntityArrowRain.class, "arrow_rain", TrackingType.CONSTRUCT).build());
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package electroblob.wizardry.spell;
|
||||||
|
|
||||||
|
import electroblob.wizardry.entity.construct.EntityRadiantTotem;
|
||||||
|
import electroblob.wizardry.util.SpellModifiers;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
public class RadiantTotem extends SpellConstructRanged<EntityRadiantTotem> {
|
||||||
|
|
||||||
|
public static final String MAX_TARGETS = "max_targets";
|
||||||
|
|
||||||
|
public RadiantTotem(){
|
||||||
|
super("radiant_totem", EntityRadiantTotem::new, false);
|
||||||
|
this.addProperties(EFFECT_RADIUS, MAX_TARGETS, HEALTH, DAMAGE, BURN_DURATION);
|
||||||
|
this.floor(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addConstructExtras(EntityRadiantTotem construct, EnumFacing side, @Nullable EntityLivingBase caster, SpellModifiers modifiers){
|
||||||
|
construct.posY += 1.2;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -862,6 +862,7 @@ spell.ebwizardry\:pocket_workbench=Pocket Workbench
|
|||||||
spell.ebwizardry\:poison=Poison
|
spell.ebwizardry\:poison=Poison
|
||||||
spell.ebwizardry\:poison_bomb=Poison Bomb
|
spell.ebwizardry\:poison_bomb=Poison Bomb
|
||||||
spell.ebwizardry\:possession=Possession
|
spell.ebwizardry\:possession=Possession
|
||||||
|
spell.ebwizardry\:radiant_totem=Radiant Totem
|
||||||
spell.ebwizardry\:ray_of_purification=Ray of Purification
|
spell.ebwizardry\:ray_of_purification=Ray of Purification
|
||||||
spell.ebwizardry\:remove_curse=Remove Curse
|
spell.ebwizardry\:remove_curse=Remove Curse
|
||||||
spell.ebwizardry\:replenish_hunger=Replenish Hunger
|
spell.ebwizardry\:replenish_hunger=Replenish Hunger
|
||||||
@@ -1040,6 +1041,7 @@ spell.ebwizardry\:pocket_workbench.desc=Allows the caster to craft items as if t
|
|||||||
spell.ebwizardry\:poison.desc=Fires poison in the direction you are pointing.
|
spell.ebwizardry\:poison.desc=Fires poison in the direction you are pointing.
|
||||||
spell.ebwizardry\:poison_bomb.desc=Lanches a poison bomb in the direction you are pointing which explodes on impact, poisoning nearby creatures.
|
spell.ebwizardry\:poison_bomb.desc=Lanches a poison bomb in the direction you are pointing which explodes on impact, poisoning nearby creatures.
|
||||||
spell.ebwizardry\:possession.desc="Become thy enemy."
|
spell.ebwizardry\:possession.desc="Become thy enemy."
|
||||||
|
spell.ebwizardry\:radiant_totem.desc=Creates a radiant totem which shoots a beam of light at nearby creatures, healing allies but damaging mobs. Lasts for 30 seconds. Potency will increase the number of targets.
|
||||||
spell.ebwizardry\:ray_of_purification.desc=Emits a ray of blinding light that damages and blinds its targets. Undead creatures take double damage and are set on fire.
|
spell.ebwizardry\:ray_of_purification.desc=Emits a ray of blinding light that damages and blinds its targets. Undead creatures take double damage and are set on fire.
|
||||||
spell.ebwizardry\:remove_curse.desc=Removes any curse currently affecting the caster.
|
spell.ebwizardry\:remove_curse.desc=Removes any curse currently affecting the caster.
|
||||||
spell.ebwizardry\:replenish_hunger.desc=Replenishes the caster's food level by 3 hunger points.
|
spell.ebwizardry\:replenish_hunger.desc=Replenishes the caster's food level by 3 hunger points.
|
||||||
|
|||||||
@@ -862,6 +862,7 @@ spell.ebwizardry\:pocket_workbench=Pocket Workbench
|
|||||||
spell.ebwizardry\:poison=Poison
|
spell.ebwizardry\:poison=Poison
|
||||||
spell.ebwizardry\:poison_bomb=Poison Bomb
|
spell.ebwizardry\:poison_bomb=Poison Bomb
|
||||||
spell.ebwizardry\:possession=Possession
|
spell.ebwizardry\:possession=Possession
|
||||||
|
spell.ebwizardry\:radiant_totem=Radiant Totem
|
||||||
spell.ebwizardry\:ray_of_purification=Ray of Purification
|
spell.ebwizardry\:ray_of_purification=Ray of Purification
|
||||||
spell.ebwizardry\:remove_curse=Remove Curse
|
spell.ebwizardry\:remove_curse=Remove Curse
|
||||||
spell.ebwizardry\:replenish_hunger=Replenish Hunger
|
spell.ebwizardry\:replenish_hunger=Replenish Hunger
|
||||||
@@ -1040,6 +1041,7 @@ spell.ebwizardry\:pocket_workbench.desc=Allows the caster to craft items as if t
|
|||||||
spell.ebwizardry\:poison.desc=Fires poison in the direction you are pointing.
|
spell.ebwizardry\:poison.desc=Fires poison in the direction you are pointing.
|
||||||
spell.ebwizardry\:poison_bomb.desc=Lanches a poison bomb in the direction you are pointing which explodes on impact, poisoning nearby creatures.
|
spell.ebwizardry\:poison_bomb.desc=Lanches a poison bomb in the direction you are pointing which explodes on impact, poisoning nearby creatures.
|
||||||
spell.ebwizardry\:possession.desc="Become thy enemy."
|
spell.ebwizardry\:possession.desc="Become thy enemy."
|
||||||
|
spell.ebwizardry\:radiant_totem.desc=Creates a radiant totem which shoots a beam of light at nearby creatures, healing allies but damaging mobs. Lasts for 30 seconds. Potency will increase the number of targets.
|
||||||
spell.ebwizardry\:ray_of_purification.desc=Emits a ray of blinding light that damages and blinds its targets. Undead creatures take double damage and are set on fire.
|
spell.ebwizardry\:ray_of_purification.desc=Emits a ray of blinding light that damages and blinds its targets. Undead creatures take double damage and are set on fire.
|
||||||
spell.ebwizardry\:remove_curse.desc=Removes any curse currently affecting the caster.
|
spell.ebwizardry\:remove_curse.desc=Removes any curse currently affecting the caster.
|
||||||
spell.ebwizardry\:replenish_hunger.desc=Replenishes the caster's food level by 3 hunger points.
|
spell.ebwizardry\:replenish_hunger.desc=Replenishes the caster's food level by 3 hunger points.
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"enabled": {
|
||||||
|
"book": true,
|
||||||
|
"scroll": true,
|
||||||
|
"wands": true,
|
||||||
|
"npcs": true,
|
||||||
|
"dispensers": true,
|
||||||
|
"commands": true,
|
||||||
|
"treasure": true,
|
||||||
|
"trades": true,
|
||||||
|
"looting": true
|
||||||
|
},
|
||||||
|
"tier": "advanced",
|
||||||
|
"element": "healing",
|
||||||
|
"type": "construct",
|
||||||
|
"cost": 40,
|
||||||
|
"chargeup": 15,
|
||||||
|
"cooldown": 175,
|
||||||
|
"base_properties": {
|
||||||
|
"range": 8,
|
||||||
|
"duration": 600,
|
||||||
|
"effect_radius": 6,
|
||||||
|
"max_targets": 1,
|
||||||
|
"health": 1,
|
||||||
|
"damage": 1,
|
||||||
|
"burn_duration": 5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |