Exemple #1
0
    public int pushDown;  //百分之几

    public void ReadFromJson(JsonData json)
    {
        id         = json.ReadInt("id");
        name       = json.ReadString("name");
        effectType = (BuffEffectType)json.ReadInt("effectType");
        addAttack  = json.ReadInt("addAttack");
        addSpeed   = json.ReadInt("addSpeed");
        pullUp     = json.ReadInt("pullUp");
        pushDown   = json.ReadInt("pushDown");
    }
Exemple #2
0
        /// <summary>
        /// 移除状态
        /// </summary>
        /// <param name="state">状态</param>
        internal void RemoveState(BuffEffectType state)
        {
            if (IsDead)
            {
                return;
            }
            switch (state)
            {
            case BuffEffectType.kAttackMiss:
                Trace.Assert(mAttackMissCount > 0);
                mAttackMissCount--;
                break;

            case BuffEffectType.kMagicDamageImmunity:
                Trace.Assert(mMagicDamageImmunityCount > 0);
                mMagicDamageImmunityCount--;
                break;

            case BuffEffectType.kNotarget:
                Trace.Assert(mNotargetCount > 0);
                mNotargetCount--;
                break;

            case BuffEffectType.kPhysicalDamageImmunity:
                Trace.Assert(mPhysicalDamageImmunityCount > 0);
                mPhysicalDamageImmunityCount--;
                break;

            case BuffEffectType.kUnableAttack:
                Trace.Assert(mUnableAttackCount > 0);
                mUnableAttackCount--;
                break;

            case BuffEffectType.kUnableCast:
                Trace.Assert(mUnableCastCount > 0);
                mUnableCastCount--;
                break;

            case BuffEffectType.kUnmovable:
                Trace.Assert(mUnmovableCount > 0);
                mUnmovableCount--;
                break;

            case BuffEffectType.kDeathless:
                Trace.Assert(mDeathlessCount > 0);
                mDeathlessCount--;
                break;

            case BuffEffectType.kNegativeEffectImmunity:
                Trace.Assert(mNegativeEffectImmunityCount > 0);
                mNegativeEffectImmunityCount--;
                break;
            }
        }
Exemple #3
0
        public BuffEffect(int templateID)
        {
            //根据模板ID获取参数
            var config = ConfigManager.BuffEffect.getRow(templateID);

            this.Type        = config.BuffEffectType;
            this.isPermanent = config.isPermanent;
            this.BaseDelta   = config.BaseDelta;
            this.BasePercent = config.BasePercent;
            this.CurDelta    = config.CurDelta;
            this.CurPercent  = config.CurPercent;
        }
Exemple #4
0
    /// <summary>
    /// 获取buff
    /// </summary>
    /// <param name="buffEffectType"></param>
    /// <returns></returns>
    public ActorBuff[] GetBuff(BuffEffectType buffEffectType)
    {
        List <ActorBuff> buffdatas = new List <ActorBuff>();

        for (int i = 0; i < _BuffList.Count; i++)
        {
            if (_BuffList[i].buffEffectType == buffEffectType)
            {
                buffdatas.Add(_BuffList[i]);
            }
        }
        return(buffdatas.ToArray());
    }
 public BuffBase(RofBuffRow mRofBuffRow)
 {
     BuffID            = mRofBuffRow.ID;
     BuffName          = mRofBuffRow.BuffName;
     buffEffectType    = (BuffEffectType)mRofBuffRow.BuffEffectType;
     buffRepeatType    = (BuffRepeatType)mRofBuffRow.BuffRepeatType;
     buffOverlapType   = (BuffOverlapType)mRofBuffRow.BuffOverlapType;
     buffShutDownType  = (BuffShutDownType)mRofBuffRow.BuffShutDownType;
     MaxLimit          = mRofBuffRow.MaxLimit;
     TotalFrame        = mRofBuffRow.TotalFrame;
     CallIntervalFrame = mRofBuffRow.CallIntervalFrame;
     Num    = mRofBuffRow.Num;
     Effect = mRofBuffRow.Effect;
 }
Exemple #6
0
        /// <summary>
        /// 加状态
        /// </summary>
        /// <param name="state">状态</param>
        internal void AddState(BuffEffectType state)
        {
            if (IsDead)
            {
                return;
            }
            switch (state)
            {
            case BuffEffectType.kAttackMiss:
                mAttackMissCount++;
                break;

            case BuffEffectType.kMagicDamageImmunity:
                mMagicDamageImmunityCount++;
                break;

            case BuffEffectType.kNotarget:
                mNotargetCount++;
                break;

            case BuffEffectType.kPhysicalDamageImmunity:
                mPhysicalDamageImmunityCount++;
                break;

            case BuffEffectType.kUnableAttack:
                mUnableAttackCount++;
                break;

            case BuffEffectType.kUnableCast:
                mUnableCastCount++;
                break;

            case BuffEffectType.kUnmovable:
                mUnmovableCount++;
                break;

            case BuffEffectType.kDeathless:
                mDeathlessCount++;
                break;

            case BuffEffectType.kNegativeEffectImmunity:
                mNegativeEffectImmunityCount++;
                break;
            }
        }
Exemple #7
0
    /// <summary>
    /// 根据Buff效果的类型获取Buff的效果函数
    /// </summary>
    /// <param name="buffType"></param>
    /// <returns></returns>
    public static BuffEffectBase GetBuffEffectByType(BuffEffectType buffType, Buff buff)
    {
        switch (buffType)
        {
        case BuffEffectType.Invisible:
            return(new BuffEffectInvisible(buff));

        case BuffEffectType.Shield:
            return(new BuffEffectShield(buff));

        case BuffEffectType.Link_1:                                                 //线1,线2 表现一致
        case BuffEffectType.Link_2:
            return(new BuffEffectLink(buff));

        default:
            return(new BuffEffectBase(buff));
        }
    }
    //构建添加buffer
    private void createBufferAdd(BattleSkillMsg msg, ErlArray array)
    {
        //技能释放者
        string str1 = array.Value [0].getValueString();

        msg.userID = StringKit.toInt(str1);
        //技能编号sid
        string str2 = array.Value [1].getValueString();

        msg.skillSID = StringKit.toInt(str2);
        //技能编号id
        string str3 = array.Value [2].getValueString();

        msg.skillID = StringKit.toInt(str3);
        //buff影响效果
        if (!(array.Value [3] is ErlNullList))           //控制型buffer无效果
        {
            ErlList list = array.Value [3] as ErlList;
            if (list.Value.Length > 0)
            {
                BuffEffectType[] effects = new BuffEffectType[list.Value.Length];
                for (int i = 0; i < list.Value.Length; i++)
                {
                    ErlArray       arr    = list.Value [i] as ErlArray;
                    string         str41  = (arr.Value [0] as ErlAtom).Value;
                    int            effect = StringKit.toInt(arr.Value [1].getValueString());
                    BuffEffectType eff    = new BuffEffectType();
                    eff.type    = str41;
                    eff.effect  = effect;
                    effects [i] = eff;
                }
                msg.effects = effects;
            }
        }

        //被添加buffer者
        string str5 = array.Value [4].getValueString();

        int[] arrInt4 = new int[1] {
            StringKit.toInt(str5)
        };
        msg.targets = arrInt4;
    }
Exemple #9
0
        private static List <BuffValuePair> GetBuffLine(Dictionary <BuffEffectType, List <BuffValuePair> > buff, BuffEffectType type)
        {
            List <BuffValuePair> buffline;

            if (buff.TryGetValue(type, out buffline))
            {
                return(buffline);
            }
            buffline = new List <BuffValuePair>();
            buff.Add(type, buffline);
            return(buffline);
        }