Ejemplo n.º 1
0
        protected void CheckCondition(ConditionMessage message)
        {
            if (message == null)
            {
                return;
            }
            if (!this.conditionTable.ContainsKey(message.type))
            {
                return;
            }
            List <ConditionItem> list = this.conditionTable.get_Item(message.type);

            for (int i = 0; i < list.get_Count(); i++)
            {
                ConditionItem conditionItem = list.get_Item(i);
                if (conditionItem.conditionData != null)
                {
                    if (this.CheckConditionCount(conditionItem))
                    {
                        if (this.CheckConditionAnnouncer(message))
                        {
                            if (this.CheckConditionTarget(conditionItem.conditionData, message.announcer))
                            {
                                if (this.CheckConditionDetail(conditionItem.conditionData, message))
                                {
                                    if (conditionItem.isUseTriggerTimes)
                                    {
                                        conditionItem.leftTimes--;
                                    }
                                    if (conditionItem.conditionData.delay > 0)
                                    {
                                        uint          timerID = 0u;
                                        ConditionItem temp    = conditionItem;
                                        timerID = TimerHeap.AddTimer((uint)conditionItem.conditionData.delay, 0, delegate
                                        {
                                            this.conditionTimer.Remove(timerID);
                                            this.TriggerCondition(temp);
                                        });
                                        this.conditionTimer.Add(timerID);
                                    }
                                    else
                                    {
                                        this.TriggerCondition(conditionItem);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
 protected void TriggerCondition(ConditionItem item)
 {
     if (item is CounterSkillConditionItem)
     {
         this.TriggerCounterSkillCondition(item as CounterSkillConditionItem);
     }
     else if (item is ThinkConditionItem)
     {
         this.TriggerThinkCondition(item as ThinkConditionItem);
     }
     else if (item is SkillConditionItem)
     {
         this.TriggerSkillCondition(item as SkillConditionItem);
     }
 }
Ejemplo n.º 3
0
 protected bool CheckConditionCount(ConditionItem conditionItem)
 {
     return(!conditionItem.isUseTriggerTimes || conditionItem.leftTimes > 0);
 }