Пример #1
0
 public void InvalidTicket(FCTicket et)
 {
     _ticketArrayInvalid.Add(et);
     if (!_ticketOwners.Contains(et.TicketOwner))
     {
         _ticketOwners.Add(et.TicketOwner);
     }
     et.DeActiveKey();
 }
Пример #2
0
    protected bool ActiveTicket(List <FCTicket> etList, int countMax, ActionController ac)
    {
        bool ret = false;

        if (etList.Count < countMax && (!_ticketOwners.Contains(ac) || countMax >= ActionControllerManager.Instance.GetAllEnemyAliveCount()) && ac.MonsterTicket == null)
        {
            FCTicket et = null;
            if (_ticketArrayNoUsed.Count > 0)
            {
                et = _ticketArrayNoUsed[0];
                etList.Add(_ticketArrayNoUsed[0]);
                _ticketArrayNoUsed.RemoveAt(0);
            }
            else
            {
                et = new FCTicket();
                et.Init();
                etList.Add(et);
            }
            float timeMin = _ticketLifeMin;
            float timeCD  = 0.5f;
            if (countMax >= ActionControllerManager.Instance.GetAllEnemyAliveCount())
            {
                timeMin = 0.5f;
                timeCD  = 0.1f;
            }
            if (ac.DangerLevel >= FCConst.ELITE_DANGER_LEVEL)
            {
                et.ActiveKey(_ticketLife, timeMin, _ticketUseTimes, etList, ac, 0);
            }
            else
            {
                et.ActiveKey(_ticketLife, timeMin, _ticketUseTimes, etList, ac, _timeDelayCounter);
                _timeDelayCounter += timeCD;
            }
            if (_timeDelayCounter <= 0.1f)
            {
                ret = true;
            }
        }
        return(ret);
    }