Beispiel #1
0
        public override void Do(Game g)
        {
            Player p = Player.Value(g);

            prev = p.LandsPlayedThisTurn;
            p.LandsPlayedThisTurn = 0;
        }
Beispiel #2
0
        public override void Do(Game g)
        {
            Card c = CardID.Value(g);

            Player owner      = c.Owner.Value(g);
            Player controller = c.Controller.Value(g);

            orig = g.GetZoneOf(CardID);

            if (Destination == ZoneType.Stack)
            {
                dest = g.StackZone;
            }
            else if (Destination != ZoneType.Battlefield)
            {
                dest = owner.MyZones[Destination];
            }
            else
            {
                dest = controller.MyZones[Destination];
            }

            if (Destination == ZoneType.Battlefield)
            {
                g.MyExecutor.Do(new CommandSetSummoningSickness(CardID.ID, true));
            }

            orig.Contents.Remove(CardID);
            dest.Contents.Add(CardID);
        }
Beispiel #3
0
        public override void Do(Game g)
        {
            Card c = Card.Value(g);

            oldState = c.CurrentCharacteristicName;
            c.CurrentCharacteristicName = NewState;
        }
        public override void Do(Game g)
        {
            Player p = Player.Value(g);

            prevDrawnNum         = p.CardsDrawnThisTurn;
            p.CardsDrawnThisTurn = 0;
        }
Beispiel #5
0
        public override void Do(Game g)
        {
            Card c = Card.Value(g);

            prevTapState = c.IsTapped;

            c.IsTapped = Mode;
        }
Beispiel #6
0
        public override void Do(Game g)
        {
            Card        c   = Card.Value(g);
            Activatable act = c.CurrentCharacteristics.Activatables[ActivatableIndex];

            go = Target.Value(g);

            act.MyTargeting.Targeted.Add(go);
        }
        public override void Do(Game g)
        {
            g.MyCombatHandler.AttackerToBlockersMap[Attacker.Value(g)].Remove(Blocker.Value(g));

            if (g.MyCombatHandler.AttackerToBlockersMap[Attacker.Value(g)].Count == 0)
            {
                removedAttacker = true;
                g.MyCombatHandler.AttackerToBlockersMap.Remove(Attacker.Value(g));
            }
        }
        public override void Do(Game g)
        {
            prevPool = new List <LazyGameObject <ManaPoint> >();

            Player p = PlayerID.Value(g);

            prevPool.AddRange(p.ManaPool);

            p.ManaPool.Clear();
        }
        public override void Do(Game g)
        {
            ICanHaveCounters ichc = (ICanHaveCounters)Target.Value(g);

            addedCounter = new Counter(Type);

            g.RegisterGameObject(addedCounter);

            ichc.AddCounter(addedCounter);
        }
        public override void Do(Game g)
        {
            Card           c   = CardID.Value(g);
            Activatable    act = c.CurrentCharacteristics.Activatables[ActivatableIndex];
            ActionCostPart acp = act.MyCost.ActionParts[CostPartIndex];

            act.MyCost.PaidActions.Add(acp);

            acp.Pay(g);
        }
Beispiel #11
0
        public override void Do(Game g)
        {
            Player p = Player.Value(g);

            point         = new ManaPoint();
            point.MyColor = Color;

            g.RegisterGameObject(point);

            p.ManaPool.Add(new LazyGameObject <ManaPoint>(point));
        }
Beispiel #12
0
 public override bool CanBeDone(Game g)
 {
     if (Target.Value(g).HasSummoningSickness&& Target.Value(g).CurrentCharacteristics.CardTypes.Contains("Creature"))
     {
         return(false);
     }
     if (Target.Value(g).IsTapped)
     {
         return(false);
     }
     return(true);
 }
Beispiel #13
0
        public override void Do(Game g)
        {
            ICanHaveCounters ichc = (ICanHaveCounters)Source.Value(g);
            Counter          cnt  = ichc.GetAllCounters(g).Where(x => { return(x.MyType == Type); }).FirstOrDefault(); //Default is null for reference types

            if (cnt != null)
            {
                removedCounter = new LazyGameObject <Counter>(cnt);
                ichc.RemoveCounter(cnt);
                g.GameObjects.Remove(cnt);
            }
        }
Beispiel #14
0
        public override void Undo(Game g)
        {
            if (removedCounter == null)
            {
                return;
            }

            ICanHaveCounters ichc = (ICanHaveCounters)Source.Value(g);

            ichc.AddCounter(removedCounter.Value(g));
            g.GameObjects.Add(removedCounter.Value(g));
        }
        public override void Do(Game g)
        {
            Card c = CardID.Value(g);

            Player owner = c.Owner.Value(g);

            Zone orig = g.GetZoneOf(CardID);
            Zone dest = owner.MyZones[ZoneType.Graveyard];

            orig.Contents.Remove(CardID);
            dest.Contents.Add(CardID);
        }
        public override void Do(Game g)
        {
            Player       p   = Payer.Value(g);
            InputHandler IH  = g.InputHandlers[Payer.ID];
            PayManaCost  pmc = (PayManaCost)IH.CurrentInputState;

            mp = ManaPoint.Value(g);

            pmc.MyActivatable.MyCost.ManaParts[CostIndex].Pay(mp, g);
            pmc.MyActivatable.MyCost.PaidMana.Add(pmc.MyActivatable.MyCost.ManaParts[CostIndex]);
            p.ManaPool.Remove(ManaPoint);
            g.GameObjects.Remove(mp);
        }
Beispiel #17
0
        public override void Do(Game g)
        {
            Player p = Player.Value(g);

            if (p.MyZones[ZoneType.Library].Contents.Count == 0)
            {
                return; //TEMPORARY
            }
            LazyGameObject <Card> TopCard = p.MyZones[ZoneType.Library].Contents[0];

            p.CardsDrawnThisTurn++;

            g.MyExecutor.Do(new CommandSetCardState(TopCard.ID, CharacteristicName.Front));
            g.MyExecutor.Do(new CommandMoveCard(TopCard.ID, ZoneType.Hand));
        }
Beispiel #18
0
        public override void Do(Game g)
        {
            Card           att  = Attacker.Value(g);
            ICanBeAttacked ICBA = (ICanBeAttacked)g.GetGameObjectByID(Defender);

            if (g.MyCombatHandler.AttackerToTargetMap.ContainsKey(att))
            {
                prev = g.MyCombatHandler.AttackerToTargetMap[att];
                g.MyCombatHandler.AttackerToTargetMap[att] = ICBA;
            }
            else
            {
                g.MyCombatHandler.AttackerToTargetMap.Add(att, ICBA);
            }
        }
        public override void Do(Game g)
        {
            Card att = Attacker.Value(g);
            Card blo = Blocker.Value(g);

            if (!g.MyCombatHandler.AttackerToBlockersMap.ContainsKey(att))
            {
                shouldDeleteOnUndo = true;
                g.MyCombatHandler.AttackerToBlockersMap.Add(att, new List <Card>());
                g.MyCombatHandler.AttackerToBlockersMap[att].Add(blo);
            }
            else
            {
                g.MyCombatHandler.AttackerToBlockersMap[att].Add(blo);
            }
        }
Beispiel #20
0
 public override void Do(Game g)
 {
     blockers = new List <Card>();
     blockers.AddRange(g.MyCombatHandler.AttackerToBlockersMap[Attacker.Value(g)]);
     g.MyCombatHandler.AttackerToBlockersMap.Remove(Attacker.Value(g));
     icba = g.MyCombatHandler.AttackerToTargetMap[Attacker.Value(g)];
     g.MyCombatHandler.AttackerToTargetMap.Remove(Attacker.Value(g));
 }
Beispiel #21
0
        public override void Do(Game g)
        {
            Activatable act = null;

            if (Mode == AbilityType.Activatable)
            {
                act = CardID.Value(g).CurrentCharacteristics.Activatables[ActivatableIndex];
            }
            else if (Mode == AbilityType.Replacement)
            {
            }
            else
            {
                act = CardID.Value(g).CurrentCharacteristics.Triggers[ActivatableIndex].myAbility;
            }

            StackInstance si = new StackInstance(act);

            g.RegisterGameObject(si);
            siID = si.ID;

            g.SpellStack.Push(new LazyGameObject <StackInstance>(si));
        }
Beispiel #22
0
 public override void Do(Game g)
 {
     if (AbilityType == AbilityType.Activatable)
     {
         prev = Card.Value(g).CurrentCharacteristics.Activatables[ActivatableIndex].IsBeingActivated;
         Card.Value(g).CurrentCharacteristics.Activatables[ActivatableIndex].IsBeingActivated = Mode;
     }
     else if (AbilityType == AbilityType.Trigger)
     {
         prev = Card.Value(g).CurrentCharacteristics.Triggers[ActivatableIndex].myAbility.IsBeingActivated;
         Card.Value(g).CurrentCharacteristics.Triggers[ActivatableIndex].myAbility.IsBeingActivated = Mode;
     }
 }
Beispiel #23
0
        public void DoTrigger(Game g)
        {
            if (myAbility != null)
            {
                g.DebugAlert(DebugMode.Triggers, "Triggering for player ID " + host.Value(g).Controller.ID);
                CommandBase com = new CommandGroup(
                    new CommandMarker(CommandMarkerType.StartActivating),
                    new CommandSetIsActivating(host.ID, host.Value(g).CurrentCharacteristics.Triggers.IndexOf(this), true, AbilityType.Trigger),
                    new CommandSetTargetState(host.Value(g).Controller.ID, host.ID, host.Value(g).CurrentCharacteristics.Triggers.IndexOf(this), AbilityType.Trigger),
                    new CommandEnterInputState());

                g.MyExecutor.Do(com);
            }
        }
        public override void Do(Game g)
        {
            Zone lib = Player.Value(g).MyZones[ZoneType.Library];

            originalOrder = new List <LazyGameObject <Card> >();
            foreach (LazyGameObject <Card> lgo in lib.Contents)
            {
                originalOrder.Add(lgo);
            }

            Random rng = new Random(Seed);

            int n = lib.Contents.Count;

            while (n > 1)
            {
                n--;
                int k = rng.Next(n + 1);
                LazyGameObject <Card> value = lib.Contents[k];
                lib.Contents[k] = lib.Contents[n];
                lib.Contents[n] = value;
            }
        }
Beispiel #25
0
 public override void Do(Game g)
 {
     Player.Value(g).LandsPlayedThisTurn++;
 }
 public override bool CanBeDone(Game g)
 {
     return(Target.Value(g).IsTapped);
 }
Beispiel #27
0
 public override void Do(Game g)
 {
     prev = Card.Value(g).HasSummoningSickness;
     Card.Value(g).HasSummoningSickness = Mode;
 }
Beispiel #28
0
 public override string ToString(Game g)
 {
     return(DefinedPlayer.Value(g).ToString() + " gains " + Amount.ToString() + " life.");
 }
 public override void Do(Game g)
 {
     Target.Value(g).AssignedDamage += Amount;
 }
Beispiel #30
0
 public override void Do(Game g)
 {
     Player.Value(g).Life -= Amount;
 }