/// <summary> /// sets the scale for the slime based on getSlimeSize in EntitySlime /// </summary> protected virtual void ScaleSlime(EntitySlime par1EntitySlime, float par2) { int i = par1EntitySlime.GetSlimeSize(); float f = (par1EntitySlime.Field_767_b + (par1EntitySlime.Field_768_a - par1EntitySlime.Field_767_b) * par2) / ((float)i * 0.5F + 1.0F); float f1 = 1.0F / (f + 1.0F); float f2 = i; //GL.Scale(f1 * f2, (1.0F / f1) * f2, f1 * f2); }
protected virtual int Func_40287_a(EntitySlime par1EntitySlime, int par2, float par3) { if (par2 == 0) { SetRenderPassModel(ScaleAmount); //GL.Enable(EnableCap.Normalize); //GL.Enable(EnableCap.Blend); //GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); return(1); } if (par2 == 1) { //GL.Disable(EnableCap.Blend); //GL.Color4(1.0F, 1.0F, 1.0F, 1.0F); } return(-1); }
/// <summary> /// Will get destroyed next tick. /// </summary> public override void SetDead() { int i = GetSlimeSize(); if (!WorldObj.IsRemote && i > 1 && GetHealth() <= 0) { int j = 2 + Rand.Next(3); for (int k = 0; k < j; k++) { float f = (((float)(k % 2) - 0.5F) * (float)i) / 4F; float f1 = (((float)(k / 2) - 0.5F) * (float)i) / 4F; EntitySlime entityslime = CreateInstance(); entityslime.SetSlimeSize(i / 2); entityslime.SetLocationAndAngles(PosX + f, PosY + 0.5F, PosZ + f1, Rand.NextFloat() * 360F, 0.0F); WorldObj.SpawnEntityInWorld(entityslime); } } base.SetDead(); }