Exemple #1
0
        protected void Pay(ActivationParameters p = null)
        {
            p = p ?? new ActivationParameters();

            if (p.PayCost)
            {
                _p.Cost.Pay(p.Targets, p.X, p.Repeat);
            }
        }
Exemple #2
0
        public void EnchantWithoutPayingCost(Card target)
        {
            var activationParameters = new ActivationParameters
            {
                PayManaCost = false,
                SkipStack   = true
            };

            activationParameters.Targets.Effect.Add(target);

            _castRules.Cast(0, activationParameters);
        }
Exemple #3
0
        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
            });
        }
Exemple #4
0
        public void EquipWithoutPayingCost(Card target)
        {
            var activationParameters = new ActivationParameters
            {
                PayManaCost = false,
                SkipStack   = true
            };

            activationParameters.Targets.Effect.Add(target);

            _activatedAbilities.Activate(0, activationParameters);
        }
Exemple #5
0
        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));
              }
        }
Exemple #7
0
        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);
              }
        }
Exemple #10
0
 public void Activate(int abilityIndex, ActivationParameters activationParameters)
 {
     _abilities.Value[abilityIndex].Activate(activationParameters);
 }
Exemple #11
0
        public void EnchantWithoutPayingCost(Card target)
        {
            var activationParameters = new ActivationParameters
            {
              PayCost = false,
              SkipStack = true
            };

              activationParameters.Targets.Effect.Add(target);

              _castRules.Cast(0, activationParameters);
        }
Exemple #12
0
        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));
        }
Exemple #13
0
 public void Cast(int index, ActivationParameters activationParameters)
 {
     _castRules.Cast(index, activationParameters);
       IncreaseUsageScore();
 }
Exemple #14
0
 public void Cast(int index, ActivationParameters activationParameters)
 {
     _castRules.Cast(index, activationParameters);
     IncreaseUsageScore();
 }
Exemple #15
0
 public void ActivateAbility(int index, ActivationParameters activationParameters)
 {
     _activatedAbilities.Activate(index, activationParameters);
     IncreaseUsageScore();
 }
Exemple #16
0
 public void Cast(int index, ActivationParameters activationParameters)
 {
     _castRules[index].Cast(activationParameters);
 }
Exemple #17
0
        public void EquipWithoutPayingCost(Card target)
        {
            var activationParameters = new ActivationParameters
            {
              PayCost = false,
              SkipStack = true
            };

              activationParameters.Targets.Effect.Add(target);

              _activatedAbilities.Activate(0, activationParameters);
        }
Exemple #18
0
 public void Cast(int index, ActivationParameters activationParameters)
 {
     _castRules.Value[index].Cast(activationParameters);
 }
Exemple #19
0
 public void ActivateAbility(int index, ActivationParameters activationParameters)
 {
     _activatedAbilities.Activate(index, activationParameters);
       IncreaseUsageScore();
 }