public override void PostDraw(NPC npc, SpriteBatch spriteBatch, Color lightColor) { if (drawHestiaRunes) { if (npc != null && npc.active) { for (int j = 0; j < 3; j++) { HestiaRune rune = runes[j]; if (rune.inFront == true) { Texture2D tex2 = ModContent.GetTexture("SpiritMod/Mechanics/BoonSystem/HestiaBoon/HestiaRune"); Color color = new Color(247, 117, 42, 0); Texture2D glow = SpiritMod.Instance.GetTexture("Effects/Masks/Extra_49"); color.A = 0; float glowScale = 1 + ((float)Math.Sin(Main.GameUpdateCount) / 4); spriteBatch.Draw(glow, npc.Center + new Vector2(rune.x, rune.y) - Main.screenPosition, null, color * glowScale, 0, glow.Size() / 2, npc.scale * 0.33f, SpriteEffects.None, 0f); Main.spriteBatch.Draw(tex2, npc.Center + new Vector2(rune.x, rune.y) - Main.screenPosition, new Rectangle(0, 22 * j, 22, 22), Color.White * runeAlpha, 0f, new Vector2(11, 11), 1f, SpriteEffects.None, 0f); } //runes[j] = rune; } } } }
public override bool PreDraw(NPC npc, SpriteBatch spriteBatch, Color drawColor) { if (!setStats) { baseDamage = npc.damage; baseDefense = npc.defense; setStats = true; } if (drawHestiaRunes) { runeAlpha += 0.05f; } else { runeAlpha -= 0.05f; } runeAlpha = MathHelper.Clamp(runeAlpha, 0f, 1f); if (npc != null && npc.active && runeAlpha > 0f && (npc.modNPC is IBoonable || npc.type == NPCID.Medusa)) { npc.damage = (int)(baseDamage * 1.2f); npc.defense = baseDefense + 15; Vector2 pos = npc.Center; for (int i = 0; i < 4; i++) { Vector2 offsetPositon = Vector2.UnitY.RotatedBy(MathHelper.PiOver2 * i) * 2; Main.spriteBatch.Draw(Main.npcTexture[npc.type], pos + offsetPositon - Main.screenPosition, npc.frame, new Color(247, 117, 42, 0) * runeAlpha, npc.rotation, npc.frame.Size() * 0.5f, npc.scale, npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f); } for (int j = 0; j < 3; j++) { HestiaRune rune = runes[j]; rune.i = j; rune.Update(); if (rune.inFront == false) { Texture2D tex = ModContent.GetTexture("SpiritMod/Mechanics/BoonSystem/HestiaBoon/HestiaRune"); Color color = new Color(247, 117, 42, 0); Texture2D glow = SpiritMod.Instance.GetTexture("Effects/Masks/Extra_49"); color.A = 0; float glowScale = 1 + ((float)Math.Sin(Main.GameUpdateCount) / 4); spriteBatch.Draw(glow, npc.Center + new Vector2(rune.x, rune.y) - Main.screenPosition, null, color * glowScale, 0, glow.Size() / 2, npc.scale * 0.33f, SpriteEffects.None, 0f); Main.spriteBatch.Draw(tex, npc.Center + new Vector2(rune.x, rune.y) - Main.screenPosition, new Rectangle(0, 22 * j, 22, 22), Color.White * runeAlpha, 0f, new Vector2(11, 11), 1f, SpriteEffects.None, 0f); } runes[j] = rune; } } else { npc.damage = baseDamage; npc.defense = baseDefense; } return(true); }