public PermanentCountManaOutput(ManaColor color, Func <Card, bool> filter, ControlledBy controlledBy = ControlledBy.SpellOwner) { _color = color; _filter = filter; _controlledBy = controlledBy; }
public EffectRankBy(Func<Card, int> rank, ControlledBy controlledBy = ControlledBy.Any, Func<Card, int> forceRank = null) { _rank = rank; _forceRank = forceRank ?? _rank; _controlledBy = controlledBy; }
public TargetValidatorParameters Card(Func<Card, bool> filter = null, ControlledBy? controlledBy = null) { filter = filter ?? delegate { return true; }; _p.IsValidTarget = p => { var hasValidController = controlledBy == null || HasValidController( p.Target.Controller(), p.Controller, controlledBy.Value); if (p.Target.IsCard()) { return hasValidController && filter(p.Target.Card()); } if (p.Target.IsEffect()) { return hasValidController && filter(p.Target.Effect().Source.OwningCard); } return false; }; return _p; }
public ApplyModifiersToPermanents(Func<Effect, Card, bool> selector, ControlledBy controlledBy = ControlledBy.Any, params CardModifierFactory[] modifiers) { _controlledBy = controlledBy; _selector = selector ?? delegate { return true; }; _modifiers.AddRange(modifiers); }
public ApplyModifiersToPermanents(Func <Effect, Card, bool> selector, ControlledBy controlledBy = ControlledBy.Any, params CardModifierFactory[] modifiers) { _controlledBy = controlledBy; _selector = selector ?? delegate { return(true); }; _modifiers.AddRange(modifiers); }
public EffectRankBy(Func <Card, int> rank, ControlledBy controlledBy = ControlledBy.Any, Func <Card, int> forceRank = null) { _rank = rank; _forceRank = forceRank ?? _rank; _controlledBy = controlledBy; }
public Town(Vector2 position, ControlledBy controlledBy, ElementTypes type, bool playerPresent) { _position = position; _controlledBy = controlledBy; _elementType = type; _playerPresent = playerPresent; _adjacentTownIndexes = new List<int>(); _underAttack = false; _turnsUntilTaken = 0; }
public void Send(string message) { if (ControlledBy != null) { ControlledBy.Send(message); } if (ImpersonatedBy != null) { ImpersonatedBy.Send(message); } }
public CreaturesOfChosenTypeGainPT(int power, int toughness, ControlledBy controlledBy = ControlledBy.Any) { _power = power; _toughness = toughness; _controlledBy = controlledBy; if (_toughness < 0) { ToughnessReduction = Math.Abs(_toughness); } }
public ModifyPowerToughnessForEachPermanent(int?power, int?toughness, CardSelector filter, Func <IntegerModifier> modifier, ControlledBy controlledBy = ControlledBy.SpellOwner) { _modifyPower = power; _modifyToughness = toughness; _filter = filter; _controlledBy = controlledBy; _toughnessModifier = modifier(); _powerModifier = modifier(); }
public IEnumerable <T> Candidates <T>( ControlledBy controlledBy = ControlledBy.Any, int selectorIndex = 0, Func <TargetsCandidates, IList <TargetCandidates> > selector = null) where T : ITarget { Asrt.True(_candidates.HasCost || _candidates.HasEffect, "No target selectors found, use AddEffect or AddCost to add them!"); TargetCandidates candidates = null; if (selector == null) { candidates = _candidates.HasCost ? _candidates.Cost[selectorIndex] : _candidates.Effect[selectorIndex]; } else { candidates = selector(_candidates)[selectorIndex]; } switch (controlledBy) { case (ControlledBy.Opponent): { return(candidates .Where(x => x.Controller() == Controller.Opponent && x is T) .Select(x => (T)x)); } case (ControlledBy.SpellOwner): { return(candidates .Where(x => x.Controller() == Controller && x is T) .Select(x => (T)x)); } } return(candidates.OfType <T>()); }
public void setControlledBy(ControlledBy controlledBy) { _controlledBy = controlledBy; }
public TargetValidatorParameters Creature(ControlledBy? controlledBy = null) { return Card(x => x.Is().Creature, controlledBy); }
public int GetElementCountForCharacter(ControlledBy character) { int elementCount = 0; foreach (Town town in _towns) { if (town._controlledBy == character) { elementCount++; } } return elementCount; }
private static bool HasValidController(Player targetController, Player sourceController, ControlledBy controlledBy) { switch (controlledBy) { case (ControlledBy.Opponent): return targetController != sourceController; case (ControlledBy.SpellOwner): return targetController == sourceController; } return true; }
public void ManaAmount(ManaColor color, Func<Card, bool> filter, ControlledBy controlledBy = ControlledBy.SpellOwner) { ManaOutput = new PermanentCountManaOutput(color, filter, controlledBy); Colors = color.Indices; }
public EffectLandEnchantment(ControlledBy controlledBy) { _controlledBy = controlledBy; }
public WhenTopSpellIs(Func <Card, bool> selector, ControlledBy controlledBy = ControlledBy.Any) { _selector = selector; _controlledBy = controlledBy; }
public UntapEachPermanent(Func <Card, bool> filter, ControlledBy controlledBy = ControlledBy.Any) { _filter = filter ?? delegate { return(true); }; _controlledBy = controlledBy; }
public void ManaAmount(ManaColor color, Func <Card, bool> filter, ControlledBy controlledBy = ControlledBy.SpellOwner) { ManaOutput = new PermanentCountManaOutput(color, filter, controlledBy); Colors = color.Indices; }
private static bool HasValidController(Player targetController, Player sourceController, ControlledBy controlledBy) { switch (controlledBy) { case (ControlledBy.Opponent): return(targetController != sourceController); case (ControlledBy.SpellOwner): return(targetController == sourceController); } return(true); }