예제 #1
0
    protected override ErrorCode doStart(SkillEffectInitParam param)
    {
        // 如果单位免疫控制, 且该buff为控制类buff, 那么, 该buff不能被添加,
        // 无论该buff有什么其它的功能.
        if (!mOwner.CanBeStuned() && mBuffRes.IsStunBuff)
        {
            return(ErrorCode.AddEffectFailedSkillEffectImmunity);
        }

        if (mBuffRes.dotEffectTimeInterval != uint.MaxValue)
        {
            mTaskManager = new SkillUtilities.TaskManager(onTaskFinished);
        }

        mProperties     = SkillUtilities.ParseProperties(mBuffRes.properties);
        mSkillTransform = SkillUtilities.ParseSkillTransform(mBuffRes.skillTransform);
        return(base.doStart(param));
    }
예제 #2
0
    private bool checkBuff()
    {
        DataType myName           = DataType.DATA_SKILL_BUFF;
        IDictionaryEnumerator itr = DataManager.BuffTable.GetEnumerator();

        while (itr.MoveNext())
        {
            SkillBuffTableItem item = itr.Value as SkillBuffTableItem;
            if (!checkParam(item.removeCondition < BuffRemoveCondition.Count, myName, item.resID, "buff移除条件"))
            {
                return(false);
            }

            if (!checkParam(item.stackCountMax > 0, myName, item.resID, "叠加次数"))
            {
                return(false);
            }

            if (item.dotEffectTargetSelection != uint.MaxValue &&
                !checkLink(myName, item.resID, DataType.DATA_SKILL_TARGET_SELECTION, item.dotEffectTargetSelection))
            {
                return(false);
            }

            if (item.dotEffect2Others != uint.MaxValue &&
                !checkLink(myName, item.resID, DataType.DATA_SKILL_EFFECT, item.dotEffect2Others))
            {
                return(false);
            }

            if (item.randEvent != uint.MaxValue &&
                !checkLink(myName, item.resID, DataType.DATA_SKILL_RAND_EVENT, item.randEvent))
            {
                return(false);
            }

            if (item.newModelID != uint.MaxValue &&
                !checkLink(myName, item.resID, DataType.DATA_MODEL, item.newModelID))
            {
                return(false);
            }

            if (item.newWeaponID != uint.MaxValue &&
                !checkLink(myName, item.resID, DataType.DATA_WEAPON, item.newWeaponID))
            {
                return(false);
            }

            if (item.superNewWeaponID != uint.MaxValue &&
                !checkLink(myName, item.resID, DataType.DATA_WEAPON, item.superNewWeaponID))
            {
                return(false);
            }

            try
            {
                SkillUtilities.ParseProperties(item.properties);
            }
            catch (System.Exception exp)
            {
                GameDebug.LogError("buff.txt[" + item.resID + "]的属性格式错误.");
            }

            if (item.effect2OwnerOnExpired != uint.MaxValue &&
                !checkLink(myName, item.resID, DataType.DATA_SKILL_EFFECT, item.effect2OwnerOnExpired))
            {
                return(false);
            }

            if (item.targetSelectionOnExpired != uint.MaxValue &&
                !checkLink(myName, item.resID, DataType.DATA_SKILL_TARGET_SELECTION, item.targetSelectionOnExpired))
            {
                return(false);
            }

            if (item.effect2OthersOnExpired != uint.MaxValue &&
                !checkLink(myName, item.resID, DataType.DATA_SKILL_EFFECT, item.effect2OthersOnExpired))
            {
                return(false);
            }

            if (item._3DEffectID != uint.MaxValue &&
                !checkLink(myName, item.resID, DataType.DATA_EFFECT, item._3DEffectID))
            {
                return(false);
            }
        }
//      foreach (int key in DataManager.BuffTable.Keys)
//      {
//
//      }

        return(true);
    }