public override bool PreDraw(SpriteBatch sb, Color dColor) { if (glowTex == null) { glowTex = mod.GetTexture("NPCs/Bosses/Infinity/Infinity_Glow"); } if (auraDirection) { auraPercent += 0.1f; auraDirection = auraPercent < 1f; } else { auraPercent -= 0.1f; auraDirection = auraPercent <= 0f; } if (fifthHealth) { BaseDrawing.DrawTexture(sb, Main.npcTexture[npc.type], 0, npc, dColor); BaseDrawing.DrawAura(sb, glowTex, 0, npc, auraPercent, 1f, 0f, 0f, GetRedAlpha()); BaseDrawing.DrawTexture(sb, glowTex, 0, npc, GetRedAlpha()); } else { BaseDrawing.DrawTexture(sb, Main.npcTexture[npc.type], 0, npc, BaseUtility.ColorClamp(BaseDrawing.GetNPCColor(npc, npc.Center + new Vector2(0, -30), true, 0f), GetGlowAlpha(true))); BaseDrawing.DrawAura(sb, glowTex, 0, npc, auraPercent, 1f, 0f, 0f, GetGlowAlpha(true)); BaseDrawing.DrawTexture(sb, glowTex, 0, npc, GetGlowAlpha(false)); } string ZeroTex = ("NPCs/Bosses/Infinity/IZHand1"); //bottom arms DrawZero(sb, ZeroTex, ZeroTex + "_Glow", Zero6, dColor); DrawZero(sb, ZeroTex, ZeroTex + "_Glow", Zero3, dColor); //middle arms DrawZero(sb, ZeroTex, ZeroTex + "_Glow", Zero5, dColor); DrawZero(sb, ZeroTex, ZeroTex + "_Glow", Zero2, dColor); //top arms DrawZero(sb, ZeroTex, ZeroTex + "_Glow", Zero4, dColor); DrawZero(sb, ZeroTex, ZeroTex + "_Glow", Zero1, dColor); return(false); }
public void DrawZero(SpriteBatch spriteBatch, string zeroTexture, string glowMaskTexture, NPC Zero, Color drawColor) { if (Zero != null && Zero.active && Zero.modNPC != null && (Zero.modNPC is IZHand1 || Zero.modNPC is IZHand2)) { IZHand1 handNPC = (IZHand1)Zero.modNPC; string ArmTex = ("NPCs/Bosses/Infinity/IZArm"); Texture2D ArmTex2D = mod.GetTexture(ArmTex); Texture2D zeroTex = mod.GetTexture(zeroTexture); Texture2D glowTex = mod.GetTexture(glowMaskTexture); Vector2 ArmOrigin = new Vector2(npc.Center.X, npc.Center.Y) + GetConnectionPoint(handNPC.handType); Vector2 connector = Zero.Center; BaseDrawing.DrawChain(spriteBatch, new Texture2D[] { ArmTex2D, ArmTex2D, ArmTex2D }, 0, ArmOrigin, connector, ArmTex2D.Height - 10f, null, 1f, false, null); BaseDrawing.DrawTexture(spriteBatch, zeroTex, 0, Zero, BaseUtility.ColorClamp(BaseDrawing.GetNPCColor(Zero), GetGlowAlpha(true))); if (fifthHealth) { BaseDrawing.DrawAura(spriteBatch, glowTex, 0, Zero, auraPercent, 1f, 0f, 0f, GetGlowAlpha(true)); BaseDrawing.DrawTexture(spriteBatch, glowTex, 0, Zero, GetRedAlpha()); } else { BaseDrawing.DrawTexture(spriteBatch, glowTex, 0, Zero, GetGlowAlpha(false)); } } }