Skip to content

Commit

Permalink
Skeleton Shaman [WIP]
Browse files Browse the repository at this point in the history
Courtesy of @Foreck1
  • Loading branch information
IcarussOne committed Dec 28, 2024
1 parent d786354 commit e4dfe9d
Show file tree
Hide file tree
Showing 5 changed files with 279 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
package mod.emt.harkenscythe.client.model;

import net.minecraft.client.model.ModelBox;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.model.ModelSkeleton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;

// TODO: Add 3D fire on arms and clean up
// Courtesy of Foreck
public class HSModelEntitySkeletonShaman extends ModelSkeleton
{
public ModelRenderer beads;
public ModelRenderer cube_r1;
public ModelRenderer cube_r2;
public ModelRenderer cube_r3;
public ModelRenderer cube_r4;
public ModelRenderer cube_r5;
public ModelRenderer rightArm;
public ModelRenderer rightFire_r1;
public ModelRenderer leftArm;
public ModelRenderer leftFire_r1;

public HSModelEntitySkeletonShaman()
{
this(0.0F, false);
}

public HSModelEntitySkeletonShaman(float modelSize, boolean p_i46303_2_)
{
textureWidth = 64;
textureHeight = 32;

if (!p_i46303_2_)
{
bipedBody = new ModelRenderer(this);
bipedBody.setRotationPoint(0.0F, 0.0F, 0.0F);
bipedBody.cubeList.add(new ModelBox(bipedBody, 16, 16, -4.0F, 0.0F, -2.0F, 8, 12, 4, 0.0F, false));

beads = new ModelRenderer(this);
beads.setRotationPoint(0.0F, 24.0F, 0.0F);
bipedBody.addChild(beads);


cube_r1 = new ModelRenderer(this);
cube_r1.setRotationPoint(-5.1452F, -21.6779F, -3.1731F);
beads.addChild(cube_r1);
setRotationAngle(cube_r1, -0.784F, 0.6467F, 0.7466F);
cube_r1.cubeList.add(new ModelBox(cube_r1, 50, 20, -1.5F, -1.5F, -1.9F, 2, 2, 2, 0.0F, false));

cube_r2 = new ModelRenderer(this);
cube_r2.setRotationPoint(5.1452F, -21.6779F, -3.1731F);
beads.addChild(cube_r2);
setRotationAngle(cube_r2, -0.784F, -0.6467F, -0.7466F);
cube_r2.cubeList.add(new ModelBox(cube_r2, 50, 20, -0.5F, -1.5F, -1.9F, 2, 2, 2, 0.0F, true));

cube_r3 = new ModelRenderer(this);
cube_r3.setRotationPoint(3.5F, -21.0314F, -3.513F);
beads.addChild(cube_r3);
setRotationAngle(cube_r3, -1.0498F, -0.1899F, -0.3744F);
cube_r3.cubeList.add(new ModelBox(cube_r3, 50, 20, -1.5F, -1.0F, -1.0F, 2, 2, 2, 0.0F, true));

cube_r4 = new ModelRenderer(this);
cube_r4.setRotationPoint(-3.5F, -21.0314F, -3.513F);
beads.addChild(cube_r4);
setRotationAngle(cube_r4, -1.0498F, 0.1899F, 0.3744F);
cube_r4.cubeList.add(new ModelBox(cube_r4, 50, 20, -0.5F, -1.0F, -1.0F, 2, 2, 2, 0.0F, false));

cube_r5 = new ModelRenderer(this);
cube_r5.setRotationPoint(0.0F, -20.5F, -3.6F);
beads.addChild(cube_r5);
setRotationAngle(cube_r5, 0.2182F, 0.0F, 0.0F);
cube_r5.cubeList.add(new ModelBox(cube_r5, 49, 26, -1.5F, -1.0F, -2.0F, 3, 3, 3, 0.0F, false));

rightFire_r1 = new ModelRenderer(this);
rightFire_r1.setRotationPoint(1.0F, 4.5F, 0.0F);
rightArm.addChild(rightFire_r1);
setRotationAngle(rightFire_r1, 0.0F, -1.5708F, 0.0F);
rightFire_r1.cubeList.add(new ModelBox(rightFire_r1, 33, 2, -1.809F, -3.5489F, -1.02F, 3, 10, 3, 0.0F, false));

leftFire_r1 = new ModelRenderer(this);
leftFire_r1.setRotationPoint(11.0F, 4.5F, 0.0F);
leftArm.addChild(leftFire_r1);
setRotationAngle(leftFire_r1, 0.0F, 1.5708F, 0.0F);
leftFire_r1.cubeList.add(new ModelBox(leftFire_r1, 33, 2, -1.191F, -3.5489F, -12.97F, 3, 10, 3, 0.0F, false));

bipedHead = new ModelRenderer(this);
bipedHead.setRotationPoint(0.0F, 0.0F, 0.0F);
bipedHead.cubeList.add(new ModelBox(bipedHead, 0, 0, -4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F, false));
bipedHead.cubeList.add(new ModelBox(bipedHead, 45, 9, -2.0F, -12.0F, -4.125F, 4, 6, 0, 0.0F, false));
}
}

@Override
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
GlStateManager.pushMatrix();

if (this.isChild)
{
GlStateManager.scale(0.75F, 0.75F, 0.75F);
GlStateManager.translate(0.0F, 16.0F * scale, 0.0F);
this.bipedHead.render(scale);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
this.bipedBody.render(scale);
this.bipedRightArm.render(scale);
this.bipedLeftArm.render(scale);
this.bipedRightLeg.render(scale);
this.bipedLeftLeg.render(scale);
} else
{
if (entityIn.isSneaking())
{
GlStateManager.translate(0.0F, 0.2F, 0.0F);
}

this.bipedHead.render(scale);
this.bipedBody.render(scale);
this.bipedRightArm.render(scale);
this.bipedLeftArm.render(scale);
this.bipedRightLeg.render(scale);
this.bipedLeftLeg.render(scale);
}

GlStateManager.popMatrix();
}

public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z)
{
modelRenderer.rotateAngleX = x;
modelRenderer.rotateAngleY = y;
modelRenderer.rotateAngleZ = z;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package mod.emt.harkenscythe.client.renderer;

import javax.annotation.Nullable;

import mod.emt.harkenscythe.HarkenScythe;
import mod.emt.harkenscythe.client.model.HSModelEntitySkeletonShaman;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.layers.LayerBipedArmor;
import net.minecraft.client.renderer.entity.layers.LayerHeldItem;
import net.minecraft.entity.monster.AbstractSkeleton;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

// TODO: Clean up and add glow layer
@SideOnly(Side.CLIENT)
public class HSRendererEntitySkeletonShaman extends RenderBiped<AbstractSkeleton>
{
public static final ResourceLocation TEXTURES = new ResourceLocation(HarkenScythe.MOD_ID, "textures/entities/skeleton_shaman.png");

public HSRendererEntitySkeletonShaman(RenderManager renderManager)
{
super(renderManager, new HSModelEntitySkeletonShaman(), 0.5F);
//this.addLayer(new LayerShamanSkeletonFlames(this));
this.addLayer(new LayerHeldItem(this));
this.addLayer(new LayerBipedArmor(this) {
protected void initArmor() {
this.modelLeggings = new HSModelEntitySkeletonShaman(0.5F, true);
this.modelArmor = new HSModelEntitySkeletonShaman(1.0F, true);
}
});
}

public void transformHeldFull3DItemLayer()
{
GlStateManager.translate(0.09375F, 0.1875F, 0.0F);
}

protected void preRenderCallback(AbstractSkeleton entitylivingbaseIn, float partialTickTime)
{
GlStateManager.scale(0.9F, 0.9F, 0.9F);
}

@Nullable
@Override
protected ResourceLocation getEntityTexture(AbstractSkeleton entity)
{
return TEXTURES;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
package mod.emt.harkenscythe.entity;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.monster.AbstractSkeleton;
import net.minecraft.init.SoundEvents;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.World;

// TODO: Add actual mechanics and make it more related to souls
public class HSEntitySkeletonShaman extends AbstractSkeleton
{
public HSEntitySkeletonShaman(World world)
{
super(world);
this.setSize(0.55F, 1.8F);
this.isImmuneToFire = true;
}

@Override
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(3.0D);
}

public void onLivingUpdate()
{
super.onLivingUpdate();

if (this.world.isRemote) {
for (int i = 0; i < 2; ++i)
{
this.world.spawnParticle(EnumParticleTypes.PORTAL, this.posX + (this.rand.nextDouble() - 0.5D) * (double) this.width, this.posY + this.rand.nextDouble() * (double) this.height - 0.25D,
this.posZ + (this.rand.nextDouble() - 0.5D) * (double) this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D);
}
}
}

@Override
public float getEyeHeight()
{
return 1.55F;
}

@Nullable
@Override
protected ResourceLocation getLootTable()
{
return null;
}

@Nonnull
@Override
protected SoundEvent getAmbientSound()
{
return SoundEvents.ENTITY_STRAY_AMBIENT;
}

@Nonnull
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return SoundEvents.ENTITY_STRAY_HURT;
}

@Nonnull
@Override
protected SoundEvent getDeathSound()
{
return SoundEvents.ENTITY_STRAY_DEATH;
}

@Nonnull
@Override
protected SoundEvent getStepSound()
{
return SoundEvents.ENTITY_STRAY_STEP;
}
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/harkenscythe/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,14 @@ entity.harkenscythe.ectoglobin.name=Ectoglobin
entity.harkenscythe.exospider.name=Exoskeletal Spider
entity.harkenscythe.harbinger.name=Harbinger
entity.harkenscythe.hemoglobin.name=Hemoglobin
entity.harkenscythe.hothead.name=Hothead
entity.harkenscythe.skeleton_shaman.name=Skeleton Shaman
entity.harkenscythe.soul.name=Soul Essence
entity.harkenscythe.soulbearer.name=Soulbearer
entity.harkenscythe.spectral_human.name=Spectral Human
entity.harkenscythe.spectral_miner.name=Spectral Miner
entity.harkenscythe.spectral_potion.name=Spectral Potion
entity.harkenscythe.titanbearer.name=Titanbearer

# ENCHANTMENTS
enchantment.harkenscythe.blight=Blight
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e4dfe9d

Please sign in to comment.