private List <PlayerOrOID> GetAllTargets(OID source) { var targets = new List <PlayerOrOID>(); foreach (var oid in MTG.Instance.objects.Keys) { if (oid == source) { continue; } var x = new PlayerOrOID(oid); if (condition(x)) { targets.Add(x); } } for (int player = 0; player < MTG.Instance.players.Count; player++) { var x = new PlayerOrOID(player); if (condition(x)) { targets.Add(x); } } return(targets); }
public bool IsValidAnyTarget(PlayerOrOID playerOrOID) { if (playerOrOID.IsPlayer) { return(true); } var obj = MTG.Instance.objects[playerOrOID.OID]; if (!obj.attr.cardTypes.Contains(MTGObject.CardType.Creature)) { return(false); } if (FindZoneFromOID(playerOrOID.OID) != battlefield) { return(false); } return(true); }
public DealDamageEvent(OID source, PlayerOrOID target, int amount) : base(source) { this.target = target; this.amount = amount; }