Ejemplo n.º 1
0
        public int AddTimer(float dtTime, int callTimes, Action <float, bool> callBack)
        {
            int   guid  = GetNewGuid();
            Timer timer = new Timer(this, guid, dtTime, callTimes, callBack);

            m_TimerMap.Add(guid, timer);
            return(guid);
        }
Ejemplo n.º 2
0
        public void AddBuff(AiBuffType buffType, float effectTime, double val, float dtTime = 0)
        {
            AiBaseBuff buff;
            int        buffId = (int)buffType;

            if (m_BuffMap.TryGetValue(buffId, out buff))
            {
                buff.Reload(effectTime, val, dtTime);
            }
            else
            {
                if (buffType == AiBuffType.MoveSpeed)
                {
                    buff = new AiMoveSpeedBuff(m_Monster, this, effectTime, buffId, val, dtTime);
                    m_BuffMap.Add(buffId, buff);
                }
                else if (buffType == AiBuffType.FireBuff)
                {
                    buff = new AiFiringSpeedBuff(m_Monster, this, effectTime, buffId, val, dtTime);
                    m_BuffMap.Add(buffId, buff);
                }
            }
        }
Ejemplo n.º 3
0
        public void AddBuff(BuffType buffType, float effectTime, float val, float val2 = 0, float val3 = 0, GameObject effectPrefab = null)
        {
            BaseBuff buff;
            int      buffId = (int)buffType;

            if (m_BuffMap.TryGetValue(buffId, out buff))
            {
                buff.Reload(effectTime, val, val2, val3);
            }
            else
            {
                if (buffType == BuffType.ShieldBuff)
                {
                    buff = new ShieldBuff(m_Player, this, effectTime, buffId, effectPrefab);
                    m_BuffMap.Add(buffId, buff);
                }
                else if (buffType == BuffType.FireSpeed)
                {
                    buff = new FireSpeedBuff(m_Player, this, effectTime, buffId, val);
                    m_BuffMap.Add(buffId, buff);
                }
                else if (buffType == BuffType.FireSpeedX)
                {
                    buff = new FireSpeedXBuff(m_Player, this, effectTime, buffId, val);
                    m_BuffMap.Add(buffId, buff);
                }
                else if (buffType == BuffType.FireCountTimes)
                {
                    buff = new FireCountTimesBuff(m_Player, this, effectTime, buffId, val);
                    m_BuffMap.Add(buffId, buff);
                }
                else if (buffType == BuffType.FireCountTimesX)
                {
                    buff = new FireCountTimesXBuff(m_Player, this, effectTime, buffId, val);
                    m_BuffMap.Add(buffId, buff);
                }
                else if (buffType == BuffType.FireCurveInc)
                {
                    buff = new FireCurveInc(m_Player, this, effectTime, buffId, val);
                    m_BuffMap.Add(buffId, buff);
                }
                else if (buffType == BuffType.FireCurveIncX)
                {
                    buff = new FireCurveIncX(m_Player, this, effectTime, buffId, val);
                    m_BuffMap.Add(buffId, buff);
                }
                else if (buffType == BuffType.Atk)
                {
                    buff = new FireAtk(m_Player, this, effectTime, buffId, val);
                    m_BuffMap.Add(buffId, buff);
                }
                else if (buffType == BuffType.AtkX)
                {
                    buff = new FireAtkX(m_Player, this, effectTime, buffId, val);
                    m_BuffMap.Add(buffId, buff);
                }
                else if (buffType == BuffType.MoveSpeed)
                {
                    buff = new MoveSpeedBuff(m_Player, this, effectTime, buffId, val);
                    m_BuffMap.Add(buffId, buff);
                }
                else if (buffType == BuffType.MoveSpeedX)
                {
                    buff = new MoveSpeedXBuff(m_Player, this, effectTime, buffId, val);
                    m_BuffMap.Add(buffId, buff);
                }
                else if (buffType == BuffType.PlayerEnergy)
                {
                    buff = new PlayerEnergy(m_Player, this, effectTime, buffId, val);
                    m_BuffMap.Add(buffId, buff);
                }
                else if (buffType == BuffType.NaNoboostBuff)
                {
                    buff = new NaNoboostBuff(m_Player, this, effectTime, buffId, val, val2, val3, effectPrefab);
                    m_BuffMap.Add(buffId, buff);
                }
                else if (buffType == BuffType.CritBuff)
                {
                }
                else if (buffType == BuffType.CritBuffX)
                {
                }
                else if (buffType == BuffType.DodgeBuff)
                {
                }
                else if (buffType == BuffType.DodgeBuffX)
                {
                }
                else if (buffType == BuffType.OneKillBuff)
                {
                }
                else if (buffType == BuffType.MaxHpBuff)
                {
                }
            }
        }