Exemple #1
0
    protected override bool AddPowerSourceAndTargets(PowerTaskList taskList)
    {
        if (!this.HasSourceCard(taskList))
        {
            return(false);
        }
        this.m_joustTaskIndex = -1;
        List <PowerTask> list = taskList.GetTaskList();

        for (int i = 0; i < list.Count; i++)
        {
            PowerTask            task  = list[i];
            Network.HistMetaData power = task.GetPower() as Network.HistMetaData;
            if ((power != null) && (power.MetaType == HistoryMeta.Type.JOUST))
            {
                this.m_joustTaskIndex = i;
            }
        }
        if (this.m_joustTaskIndex < 0)
        {
            return(false);
        }
        Card card = taskList.GetSourceEntity().GetCard();

        base.SetSource(card);
        return(true);
    }
Exemple #2
0
    private string FindRevealedCardId(PowerTaskList taskList)
    {
        Network.HistActionStart sourceAction = taskList.GetSourceAction();
        List <PowerTask>        list         = taskList.GetTaskList();

        for (int i = 0; i < list.Count; i++)
        {
            PowerTask task = list[i];
            Network.HistShowEntity power = task.GetPower() as Network.HistShowEntity;
            if ((power != null) && (power.Entity.ID == sourceAction.Entity))
            {
                return(power.Entity.CardID);
            }
        }
        return(null);
    }
    public static void DoDamageTasks(PowerTaskList powerTaskList, Card sourceCard, Card targetCard)
    {
        List <PowerTask> taskList = powerTaskList.GetTaskList();

        if ((taskList != null) && (taskList.Count != 0))
        {
            int entityId = sourceCard.GetEntity().GetEntityId();
            int num2     = targetCard.GetEntity().GetEntityId();
            foreach (PowerTask task in taskList)
            {
                Network.PowerHistory power = task.GetPower();
                if (power.Type == Network.PowerType.META_DATA)
                {
                    Network.HistMetaData data = (Network.HistMetaData)power;
                    if ((data.MetaType == HistoryMeta.Type.DAMAGE) || (data.MetaType == HistoryMeta.Type.HEALING))
                    {
                        foreach (int num3 in data.Info)
                        {
                            if ((num3 == entityId) || (num3 == num2))
                            {
                                task.DoTask();
                            }
                        }
                    }
                }
                else if (power.Type == Network.PowerType.TAG_CHANGE)
                {
                    Network.HistTagChange change = (Network.HistTagChange)power;
                    if ((change.Entity == entityId) || (change.Entity == num2))
                    {
                        switch (((GAME_TAG)change.Tag))
                        {
                        case GAME_TAG.DAMAGE:
                        case GAME_TAG.EXHAUSTED:
                            task.DoTask();
                            break;
                        }
                    }
                }
            }
        }
    }
Exemple #4
0
 private static object Extract(PowerTaskList list)
 {
     if (list == null) return null;
     List<object> l = new List<object>();
     foreach (var item in list.GetTaskList())
     {
         l.Add(Extract(item));
     }
     return l.ToArray();
 }