public override void Draw(SpriteBatch spriteBatch, Vector2 pos) { if (!isVisible) { return; } ConvergePlayer controller = represented.controller; // attack beam if (represented.zone.zoneId == ConvergeZoneId.Attack && !represented.dying && ( (!represented.tapped && represented.effectivePower > 0 && ((represented.controller == Game1.activePlayer) == (Game1.countdown > 0))) || represented.attackVictim != null ) ) { Rectangle targetFrame; if (represented.attackVictim != null) { targetFrame = represented.attackVictim.ui.gfxFrame; } else { targetFrame = represented.controller.opponent.homeBase.ui.gfxFrame; } int thickness = Game1.countdown == 0? 16: 16 + (120 - Game1.countdown) / 6; spriteBatch.DrawBeam(Game1.attackBeam, new Vector2(gfxFrame.Center.X, gfxFrame.Bottom), new Vector2(targetFrame.Center.X, targetFrame.Bottom - 5), thickness, Color.White); } Texture2D art = represented.art; Color artTint = Color.White; if (represented.zone.zoneId == ConvergeZoneId.DiscardPile) { artTint = Color.Black; } else if (represented.tapped) { artTint = TappedTint; } spriteBatch.Draw( represented.art, new Rectangle(gfxFrame.Center.X - art.Width / 2, gfxFrame.Bottom - art.Height, art.Width, art.Height), null, artTint, 0.0f, Vector2.Zero, controller.faceLeft ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0.0f ); if (represented.tapped) { spriteBatch.Draw(Game1.tappedicon, new Vector2(gfxFrame.Right - 16, gfxFrame.Top), Color.White); } if (represented.zone.zoneId == ConvergeZoneId.DiscardPile) { return; } if (represented.cardType.HasFlag(ConvergeCardType.Unit)) { if (represented.power > 0) { spriteBatch.Draw(Game1.powerbg, new Rectangle(gfxFrame.Left + 8, gfxFrame.Bottom, 16, 16), Color.White); spriteBatch.DrawString(Game1.font, "" + represented.effectivePower, new Vector2(gfxFrame.Left + 16, gfxFrame.Bottom), TextAlignment.CENTER, represented.powerUsed > 0 ? Color.Red : Color.Yellow); } Rectangle toughnessRect = new Rectangle(gfxFrame.Right - 24, gfxFrame.Bottom, 16, 16); Vector2 toughnessTextPos = new Vector2(gfxFrame.Right - 16, gfxFrame.Bottom); if (represented.destroyed) { spriteBatch.Draw(Game1.woundbg, toughnessRect, Color.White); spriteBatch.DrawString(Game1.font, "X", toughnessTextPos, TextAlignment.CENTER, Color.Red); } else if (represented.effectiveToughness <= 0) { spriteBatch.Draw(Game1.woundbg, toughnessRect, Color.White); spriteBatch.DrawString(Game1.font, "" + represented.effectiveToughness, toughnessTextPos, TextAlignment.CENTER, Color.Red); } else { spriteBatch.Draw(Game1.shieldbg, new Rectangle(gfxFrame.Right - 24, gfxFrame.Bottom, 16, 16), Color.White); spriteBatch.DrawString(Game1.font, "" + represented.effectiveToughness, toughnessTextPos, TextAlignment.CENTER, represented.damage > 0 ? Color.Red : Color.White); } } if (represented.cardType.HasFlag(ConvergeCardType.Home)) { spriteBatch.DrawString(Game1.font, "" + controller.life, new Vector2(gfxFrame.Center.X, gfxFrame.Top + 20), TextAlignment.CENTER, Color.Black); Vector2 resourcePos; if (controller.faceLeft) { resourcePos = new Vector2(gfxFrame.Left, gfxFrame.Bottom); } else { resourcePos = new Vector2(gfxFrame.Center.X, gfxFrame.Bottom); } controller.resources.DrawResources(spriteBatch, controller.showResources, resourcePos); } bool drawHighlight = isMouseOver; Color highlightColor = Color.White; if (represented.zone.zoneId == ConvergeZoneId.Hand) { if (represented.CanBePlayed(Game1.activePlayer)) { drawHighlight = true; if (isBadDrag) { highlightColor = Color.Red; } else if (isMouseOver) { highlightColor = Color.Yellow; } else { highlightColor = Color.Orange; } } /* if (isMouseOver && represented.cost != null) * { * represented.cost.DrawCost(spriteBatch, new Vector2(gfxFrame.Left, gfxFrame.Top)); * }*/ } else if (drawHighlight && !controller.isActivePlayer) { highlightColor = Color.Red; } if (drawHighlight) { spriteBatch.Draw(Game1.mouseOverGlow, gfxFrame, highlightColor); } foreach (ConvergeUIAbility abilityUI in abilityUIs) { abilityUI.Draw(spriteBatch); } }