public override int PreventLifeloss(int amount, Player player, bool queryOnly) { if (_player != player) return 0; var dealt = amount - CalculateLifeloss(amount); return dealt > 0 ? dealt : 0; }
public bool IsGoodTarget(ITarget target, Player controller) { return TargetingHelper.IsGoodTargetForSpell( target, OwningCard, controller, _p.TargetSelector, _p.Rules.Where(r => r is TargetingRule).Cast<TargetingRule>()); }
public Hand(Player owner) : base(owner) { }
public Battlefield(Player owner) : base(owner) { }
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 Library(Player owner) : base(owner) { }
public bool CanBeTargetBySpellsOwnedBy(Player player) { return !Has().Shroud && (player == Controller || !Has().Hexproof); }
public PreventLifelossBelowOneToPlayer(Player player) { _player = player; }
public bool IsZoneValid(Zone zone, Player zoneOwner) { return _isValidZone(new IsValidZoneParam(zone, zoneOwner, _controller)); }
public void Initialize(Game game, Player controller, Card owningCard = null) { Game = game; _owningCard = owningCard; _controller = controller; }
public bool IsGoodTarget(ITarget target, Player controller) { return _castRules.Any(x => x.IsGoodTarget(target, controller)); }
public virtual int PreventLifeloss(int amount, Player player, bool queryOnly) { return 0; }
public bool IsVisibleToPlayer(Player player) { if (_isRevealed == true) return true; if (_isHidden == true) return false; if (Zone == Zone.Battlefield || Zone == Zone.Graveyard || Zone == Zone.Exile || Zone == Zone.Stack) return true; if (Zone == Zone.Library) return _isPeeked && player == Controller; return player == Controller; }
public Card Initialize(Player owner, Game game) { Game = game; Owner = owner; Id = game.Recorder.CreateId(this); JoinedBattlefield.Initialize(ChangeTracker); LeftBattlefield.Initialize(ChangeTracker); _controller = new CardController(owner); _controller.Initialize(game, this); _strenght.Initialize(game, this); _level.Initialize(game, this); _counters.Initialize(this, game); _type.Initialize(game, this); _colors.Initialize(game, this); _protections.Initialize(ChangeTracker, this); _zone.Initialize(ChangeTracker, this); _modifiers.Initialize(ChangeTracker); _isTapped.Initialize(ChangeTracker, this); _attachedTo.Initialize(ChangeTracker, this); _attachments.Initialize(ChangeTracker, this); _hasRegenerationShield.Initialize(ChangeTracker, this); _damage.Initialize(ChangeTracker, this); _hasLeathalDamage.Initialize(ChangeTracker, this); _hasSummoningSickness.Initialize(ChangeTracker, this); _hash.Initialize(ChangeTracker); _isHidden.Initialize(ChangeTracker, this); _isRevealed.Initialize(ChangeTracker, this); _isPeeked.Initialize(ChangeTracker, this); _usageScore.Initialize(ChangeTracker, this); _castRules.Initialize(this, game); _simpleAbilities.Initialize(this, game); _triggeredAbilities.Initialize(this, game); _activatedAbilities.Initialize(this, game); _staticAbilities.Initialize(this, game); _combatRules.Initialize(this, game); _continuousEffects.Initialize(this, game); _isPreview = false; return this; }
public ReplaceDamageToPlayersCreaturesWithCounters(Player player, Func<Counter> counter, Func<Card, bool> filter = null) { _player = player; _counter = counter; _filter = filter ?? delegate { return true; }; }
public void Start(Func<bool> shouldContinue, bool skipPreGame, Player looser = null) { Turn.Step = Step.GameStart; if (skipPreGame) { Turn.Step = Step.Untap; } Turn.State = 0; _previousLooser = looser; _currentStep.Value = _steps.First(x => x.Step == Turn.Step); _currentState.Value = _currentStep.Value.Start; _currentState.Value.Execute(); Resume(shouldContinue); }
public Graveyard(Player owner) : base(owner) { }
public AssignedDamage(Player player) { _player = player; }
public int PreventLifeloss(int amount, Player player, bool queryOnly = true) { return Prevent(amount, (prevention) => prevention.PreventLifeloss(amount, player, queryOnly)); }