Exemple #1
0
    public IBuff NewBuff(IBuff.BuffType type)
    {
        IBuff buff = null;

        if (mRecoveryBuffList[(int)type].Count > 0)
        {
            buff = mRecoveryBuffList[(int)type].Pop();
        }
        else
        {
            if (type == IBuff.BuffType.Move)
            {
                buff = new MoveBuff();
            }
            else if (type == IBuff.BuffType.Behavior)
            {
                buff = new BehaviorBuff();
            }
            else if (type == IBuff.BuffType.Hurt)
            {
                buff = new HurtBuff();
            }
            else if (type == IBuff.BuffType.Control)
            {
                buff = new ControlBuff();
            }
        }

        buff.mInstId = ++mInstId;
        return(buff);
    }
Exemple #2
0
    public bool CanAtk()
    {
        bool atk = true;

        foreach (var item in mCurrBuffList[(int)IBuff.BuffType.Behavior])
        {
            if (item.Value is BehaviorBuff)
            {
                BehaviorBuff bb = item.Value as BehaviorBuff;
                if (bb.mBehaviorBuffConfig.mCanAtk == false)
                {
                    atk = false;
                    break;
                }
            }
        }

        return(atk);
    }
Exemple #3
0
    public bool CanMove()
    {
        bool move = true;

        foreach (var item in mCurrBuffList[(int)IBuff.BuffType.Behavior])
        {
            if (item.Value is BehaviorBuff)
            {
                BehaviorBuff bb = item.Value as BehaviorBuff;
                if (bb.mBehaviorBuffConfig.mCanMove == false)
                {
                    move = false;
                    break;
                }
            }
        }

        return(move);
    }