Esempio n. 1
0
    public void TriggerEvent(EventTriggerEnum requestTrigger, IAttackCard card, IBattelBase battel, Action finish)
    {
        this.finish = finish;

        if (isReady == false || triggers.Contains(requestTrigger) == false || conditionsAbility.IsConditions(card, battel) == false)
        {
            finish?.Invoke();
        }
        else
        {
            Finish(card, effectAbility.IsResult(card, battel, specificityFactory));
        }
    }
Esempio n. 2
0
    /// <summary>
    /// 获取前置条件
    /// </summary>
    /// <returns></returns>
    public static List <EventTriggerBean> GetListTriggerData(string data)
    {
        List <EventTriggerBean> listTriggerData = new List <EventTriggerBean>();
        List <string>           listData        = StringUtil.SplitBySubstringForListStr(data, '|');

        foreach (string itemData in listData)
        {
            if (CheckUtil.StringIsNull(itemData))
            {
                continue;
            }
            List <string>    itemListData = StringUtil.SplitBySubstringForListStr(itemData, ':');
            EventTriggerEnum triggerType  = EnumUtil.GetEnum <EventTriggerEnum>(itemListData[0]);
            string           triggerValue = itemListData[1];
            listTriggerData.Add(new EventTriggerBean(triggerType, triggerValue));
        }
        return(listTriggerData);
    }
Esempio n. 3
0
 private void ApplyAbility(EventTriggerEnum eventTrigger, IAttackCard current, Action nextAct) =>
 current.ExecuteAbility(eventTrigger, battel, () => CheckForDeath(nextAct));
Esempio n. 4
0
 public EventTriggerBean(EventTriggerEnum triggerType, string triggerData)
 {
     this.triggerType = triggerType;
     this.triggerData = triggerData;
 }
        private void updateEventState(EventTriggerEnum e, bool used)
        {
            int num = (int)e - (int)EventTriggerEnum.EV_PLAYER_TALK_TO_ME;

            this.eventsList.Items[num].ForeColor = (used ? Color.Black : Color.Gray);
        }
Esempio n. 6
0
 // Карта совершает анимацию и показывает специфект способности
 public void ExecuteAbility(EventTriggerEnum trigger, IBattelBase battel, Action finish)
 {
     View.Frame(true);
     Ability.TriggerEvent(trigger, this, battel, () => { View.Frame(false); finish?.Invoke(); });
 }