protected void Pay(ActivationParameters p = null) { p = p ?? new ActivationParameters(); if (p.PayCost) { _p.Cost.Pay(p.Targets, p.X, p.Repeat); } }
public void EnchantWithoutPayingCost(Card target) { var activationParameters = new ActivationParameters { PayManaCost = false, SkipStack = true }; activationParameters.Targets.Effect.Add(target); _castRules.Cast(0, activationParameters); }
protected void Pay(ActivationParameters p = null) { p = p ?? new ActivationParameters(); _p.Cost.Pay(new PayCostParameters { Targets = p.Targets, X = p.X, Repeat = p.Repeat, PayManaCost = p.PayManaCost }); }
public void EquipWithoutPayingCost(Card target) { var activationParameters = new ActivationParameters { PayManaCost = false, SkipStack = true }; activationParameters.Targets.Effect.Add(target); _activatedAbilities.Activate(0, activationParameters); }
public void Cast(ActivationParameters p) { var parameters = new EffectParameters { Source = this, Targets = p.Targets, X = p.X }; var effect = _p.Effect().Initialize(parameters, Game); _p.Cost.Pay(new PayCostParameters { Targets = p.Targets, X = p.X, PayManaCost = p.PayManaCost, ConvokeTargets = p.ConvokeTargets, DelveTargets = p.DelveTargets }); if (p.SkipStack) { effect.QuickResolve(); return; } if (_card.Is().Land) { _card.Controller.LandsPlayedCount++; effect.QuickResolve(); Publish(new LandPlayedEvent(effect.Source.OwningCard)); return; } Publish(new SpellCastEvent(_card, p.Targets)); Stack.Push(effect); Publish(new SpellPutOnStackEvent(effect)); }
public void Activate(ActivationParameters p) { _lastActivation.Value = Turn.TurnCount; var effects = new List<Effect>(); for (var i = 0; i < p.Repeat; i++) { // create effect first, since some cost e.g Sacrifice can // put owning card to graveyard which will alter some card // properties e.g counters, power, toughness ... var effect = CreateEffect(); var effectParameters = new EffectParameters { Source = this, Targets = p.Targets, X = p.X }; effect.Initialize(effectParameters, Game); effects.Add(effect); } Pay(p); foreach (var effect in effects) { if (p.SkipStack) { Resolve(effect, true); continue; } Publish(new AbilityActivatedEvent(this, p.Targets)); Resolve(effect, false); Publish(new ActivatedAbilityPutOnStackEvent(this, p.Targets)); } }
public void Activate(ActivationParameters p) { _lastActivation.Value = Turn.TurnCount; var effects = new List <Effect>(); for (var i = 0; i < p.Repeat; i++) { // create effect first, since some cost e.g Sacrifice can // put owning card to graveyard which will alter some card // properties e.g counters, power, toughness ... var effect = CreateEffect(); var effectParameters = new EffectParameters { Source = this, Targets = p.Targets, X = p.X }; effect.Initialize(effectParameters, Game); effects.Add(effect); } Pay(p); foreach (var effect in effects) { if (p.SkipStack) { Resolve(effect, true); continue; } Publish(new AbilityActivatedEvent(this, p.Targets)); Resolve(effect, false); Publish(new ActivatedAbilityPutOnStackEvent(this, p.Targets)); } }
public void Activate(int abilityIndex, ActivationParameters activationParameters) { _abilities[abilityIndex].Activate(activationParameters); }
protected void Pay(ActivationParameters p = null) { p = p ?? new ActivationParameters(); if (p.PayCost) { _p.Cost.Pay(p.Targets, p.X, p.Repeat); } }
public void Activate(int abilityIndex, ActivationParameters activationParameters) { _abilities.Value[abilityIndex].Activate(activationParameters); }
public void EnchantWithoutPayingCost(Card target) { var activationParameters = new ActivationParameters { PayCost = false, SkipStack = true }; activationParameters.Targets.Effect.Add(target); _castRules.Cast(0, activationParameters); }
public void Cast(ActivationParameters p) { var parameters = new EffectParameters { Source = this, Targets = p.Targets, X = p.X }; var effect = _p.Effect().Initialize(parameters, Game); if (p.PayCost) { _p.Cost.Pay(p.Targets, p.X); } if (p.SkipStack) { effect.QuickResolve(); return; } if (_card.Is().Land) { _card.Controller.LandsPlayedCount++; effect.QuickResolve(); Publish(new LandPlayedEvent(effect.Source.OwningCard)); return; } Publish(new SpellCastEvent(_card, p.Targets)); Stack.Push(effect); Publish(new SpellPutOnStackEvent(_card, p.Targets)); }
public void Cast(int index, ActivationParameters activationParameters) { _castRules.Cast(index, activationParameters); IncreaseUsageScore(); }
public void Cast(int index, ActivationParameters activationParameters) { _castRules.Cast(index, activationParameters); IncreaseUsageScore(); }
public void ActivateAbility(int index, ActivationParameters activationParameters) { _activatedAbilities.Activate(index, activationParameters); IncreaseUsageScore(); }
public void Cast(int index, ActivationParameters activationParameters) { _castRules[index].Cast(activationParameters); }
public void EquipWithoutPayingCost(Card target) { var activationParameters = new ActivationParameters { PayCost = false, SkipStack = true }; activationParameters.Targets.Effect.Add(target); _activatedAbilities.Activate(0, activationParameters); }
public void Cast(int index, ActivationParameters activationParameters) { _castRules.Value[index].Cast(activationParameters); }
public void ActivateAbility(int index, ActivationParameters activationParameters) { _activatedAbilities.Activate(index, activationParameters); IncreaseUsageScore(); }