public static Card[] getAvaliableTargets(this Card card, THHGame game) { IActiveEffect effect = card.define.getEffectOn <THHPlayer.ActiveEventArg>(game.triggers) as IActiveEffect; if (effect == null) { return(null); } List <Card> targetList = new List <Card>(); foreach (THHPlayer player in game.players) { if (effect.checkTarget(game, null, card, new object[] { player.master })) { targetList.Add(player.master); } foreach (Card servant in player.field) { if (effect.checkTarget(game, null, card, new object[] { servant })) { targetList.Add(servant); } } } return(targetList.ToArray()); }
public static bool isValidTarget(this Card card, THHGame game, Card target) { IActiveEffect effect = card.define.getEffectOn <THHPlayer.ActiveEventArg>(game.triggers) as IActiveEffect; if (effect == null) { return(false); } if (target.isStealth()) { return(false); } return(effect.checkTarget(game, null, card, new object[] { target })); }