public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) { if (!inFG) //if not in foreground stop drawing { return(false); } GetRotation(out float realRot, out SpriteEffects effect); Color col = Lighting.GetColor((int)(npc.Center.X / 16f), (int)(npc.Center.Y / 16f)); spriteBatch.Draw(Main.npcTexture[npc.type], npc.Center - Main.screenPosition, npc.frame, StarjinxGlobalNPC.GetColorBrightness(col), realRot, npc.frame.Size() / 2f, 1f, effect, 0f); if (enchantment != Enchantment.Void) { DrawSword(); } return(false); }
public void DrawSword(bool gloop = false) { GetRotation(out float realRot, out SpriteEffects effect); if (gloop) { Main.spriteBatch.Draw(SwordExtra, (npc.Center - Main.screenPosition) / 2f, npc.frame, Color.White, realRot, npc.frame.Size() / 2f, 1 / 2f, effect, 0f); } else { Color col = Lighting.GetColor((int)(npc.Center.X / 16f), (int)(npc.Center.Y / 16f)); Main.spriteBatch.Draw(SwordExtra, npc.Center - Main.screenPosition, npc.frame, StarjinxGlobalNPC.GetColorBrightness(col), realRot, npc.frame.Size() / 2f, 1f, effect, 0f); } }
public override Color?GetAlpha(Color drawColor) => StarjinxGlobalNPC.GetColorBrightness(drawColor);