Beispiel #1
0
        public static StateTaskList <ISimpleTask> Chain(params ISimpleTask[] list)
        {
            var newList = new StateTaskList <ISimpleTask>();

            newList.AddRange(list);
            return(newList);
        }
Beispiel #2
0
        public ISimpleTask Clone()
        {
            var cloneList = new StateTaskList <ISimpleTask>();

            cloneList.Copy(this);
            ForEach(p => cloneList.Add(p.Clone()));
            return(cloneList);
        }
Beispiel #3
0
        public static ISimpleTask Secret(params ISimpleTask[] list)
        {
            var secretList = list.ToList();

            secretList.Add(new SetGameTagTask(GameTag.REVEALED, 1, EntityType.SOURCE));
            secretList.Add(new MoveToGraveYard(EntityType.SOURCE));
            return(StateTaskList.Chain(secretList.ToArray()));
        }
Beispiel #4
0
        public static ISimpleTask Secret(params ISimpleTask[] list)
        {
            var secretList = list.ToList();

            secretList.Add(new SetGameTagTask(GameTag.REVEALED, 1, EntityType.SOURCE));
            secretList.Add(new MoveToGraveYard(EntityType.SOURCE));
            var checkIsOpponentTurnTask = new ConditionTask(EntityType.SOURCE, SelfCondition.IsOpTurn);

            return(Create(checkIsOpponentTurnTask, new FlagTask(true, StateTaskList <ISimpleTask> .Chain(secretList.ToArray()))));
        }
Beispiel #5
0
 public static ISimpleTask RecursiveTask(ConditionTask repeatCondition, params ISimpleTask[] tasks)
 {
     ISimpleTask[] taskList = new ISimpleTask[tasks.Length + 2];
     tasks.CopyTo(taskList, 0);
     taskList[tasks.Length]     = repeatCondition;
     taskList[tasks.Length + 1] =
         new FlagTask(true,
                      new FuncNumberTask(p =>
     {
         p.ActivateTask(PowerActivation.POWER);
         return(0);
     }
                                         ));
     return(StateTaskList.Chain(taskList));
 }
Beispiel #6
0
        public static ISimpleTask RecursiveSpellTask(ConditionTask repeatCondition, params ISimpleTask[] tasks)
        {
            var taskList = tasks.ToList();

            taskList.Add(repeatCondition);
            taskList.Add(
                new FlagTask(true,
                             new EnqueueTask(1, Create(
                                                 new IncludeTask(EntityType.SOURCE),
                                                 new FuncPlayablesTask(p =>
            {
                p[0].ApplyEnchantments(EnchantmentActivation.SPELL, Zone.GRAVEYARD);
                return(p);
            }
                                                                       )))));
            return(StateTaskList <ISimpleTask> .Chain(taskList.ToArray()));
        }
Beispiel #7
0
 public static ISimpleTask Create(params ISimpleTask[] list)
 {
     return(StateTaskList.Chain(list));
 }