Exemplo n.º 1
0
    void    ModifySkillProperty(
        HeaderProto.ESkillInfoPro PropertyType,
        HeaderProto.EOpreationFlag opType,
        HeaderProto.EOpreationFlag dataType,
        int data,
        HeaderProto.EEffectSkillBuffOptType optType,
        int skill_UID,
        bool bBegin
        )
    {
        string PropertyName = sdActorInterface.SkillPropertyName[(int)PropertyType];

        if (PropertyName.Length == 0)
        {
            return;
        }
        Hashtable baseProperty = GetActor().GetBaseSkillProperty();
        Hashtable Property     = GetActor().GetSkillProperty();

        int iSkillID = skill_UID / 100;

        Hashtable baseSkill = baseProperty[iSkillID] as Hashtable;
        Hashtable Skill     = Property[iSkillID] as Hashtable;

        int Orgin   = (int)baseSkill[PropertyName];
        int Current = (int)Skill[PropertyName];
        int iValue  = ConvertValue(dataType, data, Orgin);

        Skill[PropertyName] = GetModifyValue(bBegin, opType, Orgin, Current, iValue);;
        //t[]
    }
Exemplo n.º 2
0
    void    ModifySkillEffectProperty(
        HeaderProto.ESkillEffectPro PropertyType,
        HeaderProto.EOpreationFlag opType,
        HeaderProto.EOpreationFlag dataType,
        int data,
        HeaderProto.EEffectSkillBuffOptType optType,
        int SkillEffect_UID,
        bool bBegin
        )
    {
        string PropertyName = sdActorInterface.SkillEffectName[(int)PropertyType];

        if (PropertyName.Length == 0)
        {
            return;
        }
        SkillEffect baseSkillEffect  = sdConfDataMgr.Instance().m_BaseSkillEffect[SkillEffect_UID] as SkillEffect;
        Hashtable   skillEffectArray = GetActor().GetSkillEffect();
        SkillEffect skillEffect      = skillEffectArray[SkillEffect_UID] as SkillEffect;

        int Orgin   = (int)sdConfDataMgr.GetMemberValue(baseSkillEffect, PropertyName);
        int Current = (int)sdConfDataMgr.GetMemberValue(skillEffect, PropertyName);
        int iValue  = ConvertValue(dataType, data, Orgin);

        Current = GetModifyValue(bBegin, opType, Orgin, Current, iValue);

        sdConfDataMgr.SetMemberValue(skillEffect, PropertyName, Current);
    }
Exemplo n.º 3
0
    //PropertyType < PROPERTY_CanModMax
    //opType  取值范围
    //	OPREATION_FLAG_ADD     = 0,
    //	OPREATION_FLAG_REDUCE  = 1,
    //	OPREATION_FLAG_SET     = 3,
    //dataType 取值范围
    //	OPREATION_FLAG_INTEGER = 0,
    //	OPREATION_FLAG_PERCENT = 1,
    void    ModifyActorProperty(
        HeaderProto.EProperty PropertyType,
        HeaderProto.EOpreationFlag opType,
        HeaderProto.EOpreationFlag dataType,
        int data,
        bool bBegin)
    {
        string PropertyName = sdActorInterface.BasePropertyName[(int)PropertyType];

        if (PropertyName.Length == 0)
        {
            return;
        }
        Hashtable baseProperty = GetActor().GetBaseProperty();
        Hashtable Property     = GetActor().GetProperty();

        int Orgin   = (int)baseProperty[PropertyName];
        int Current = (int)Property[PropertyName];
        int iValue  = ConvertValue(dataType, data, Orgin);


        Property[PropertyName] = GetModifyValue(bBegin, opType, Orgin, Current, iValue);
        if (bBegin && PropertyType == HeaderProto.EProperty.PROPERTY_MaxHP)
        {
            GetActor().AddHP(iValue);
        }
        else if (bBegin && PropertyType == HeaderProto.EProperty.PROPERTY_MaxSP)
        {
            GetActor().AddSP(iValue);
        }
    }
Exemplo n.º 4
0
    void    ModifySkillActionProperty(
        HeaderProto.ESkillActionPro PropertyType,
        HeaderProto.EOpreationFlag opType,
        HeaderProto.EOpreationFlag dataType,
        int data,
        HeaderProto.EEffectSkillBuffOptType optType,
        int action_UID,
        bool bBegin
        )
    {
        string PropertyName = sdActorInterface.SkillActionName[(int)PropertyType];

        if (PropertyName.Length == 0)
        {
            return;
        }
        Hashtable baseProperty = GetActor().GetBaseSkillAction();
        Hashtable Property     = GetActor().GetSkillAction();

        Hashtable baseAction   = baseProperty[action_UID] as Hashtable;
        Hashtable Action       = Property[action_UID] as Hashtable;
        object    orginValue   = baseAction[PropertyName];
        object    currentValue = Action[PropertyName];

        if (orginValue.GetType() == typeof(int[]))
        {
            int[] Orgin   = (int[])orginValue;
            int[] Current = (int[])currentValue;
            int   index   = -1;
            if (PropertyName == "naMoreDamagePer[MONSTER_BODY_TYPE_max]")
            {
                int nType  = (int)PropertyType;
                int nSmall = (int)HeaderProto.ESkillActionPro.SKILL_ACTION_PRO_MoreDamagePer_BODY_TYPE_small;
                index = nType >= nSmall ? nType - nSmall:-1;
            }

            for (int i = 0; i < Orgin.Length; i++)
            {
                if (index != -1 && i != index)
                {
                    continue;
                }
                int iValue = ConvertValue(dataType, data, Orgin[i]);
                Current[i] = GetModifyValue(bBegin, opType, Orgin[i], Current[i], iValue);
            }
            Action[PropertyName] = Current;
        }
        else if (orginValue.GetType() == typeof(int))
        {
            int Orgin   = (int)orginValue;
            int Current = (int)currentValue;
            int iValue  = ConvertValue(dataType, data, Orgin);
            Action[PropertyName] = GetModifyValue(bBegin, opType, Orgin, Current, iValue);
        }
    }
Exemplo n.º 5
0
    int     ConvertValue(HeaderProto.EOpreationFlag dataType, int iValue, int Orgin)
    {
        switch (dataType)
        {
        case HeaderProto.EOpreationFlag.OPREATION_FLAG_INTEGER: {
        } break;

        case HeaderProto.EOpreationFlag.OPREATION_FLAG_PERCENT: {
            iValue = (Orgin * iValue) / 10000;
        } break;
        }
        return(iValue);
    }
Exemplo n.º 6
0
    void ModifySummonObjectProperty(
        HeaderProto.ESummonObjectPro PropertyType,
        HeaderProto.EOpreationFlag opType,
        HeaderProto.EOpreationFlag dataType,
        int dwOperationData1,
        int data,
        int summonID,
        bool bBegin)
    {
        string strProName = sdSkillSummon.SummonProperty[(int)PropertyType];

        if (strProName.Length == 0)
        {
            return;
        }
        Hashtable summonTabel    = GetActor().GetSummonInfo();
        Hashtable summonInfo     = summonTabel[summonID] as Hashtable;
        Hashtable baseSummonInfo = sdConfDataMgr.Instance().m_BaseSummon[summonID] as Hashtable;
        object    OrginValue     = baseSummonInfo[strProName];
        object    CurrentValue   = summonInfo[strProName];

        if (OrginValue.GetType() == typeof(int[]))
        {
            int[] Orgin   = (int[])OrginValue;
            int[] Current = (int[])CurrentValue;
            int   index   = -1;
            if (strProName == "naMoreDamagePer[MONSTER_BODY_TYPE_max]")
            {
                int nType  = (int)PropertyType;
                int nSmall = (int)HeaderProto.ESummonObjectPro.SUMMONOBJECT_PRO_BodyType_Small;
                index = (nType >= nSmall ? nType - nSmall : -1);
            }
            for (int i = 0; i < Orgin.Length; i++)
            {
                if (index != -1 && i != index)
                {
                    continue;
                }
                int iValue = ConvertValue(dataType, dwOperationData1, Orgin[i]);
                Current[i] = GetModifyValue(bBegin, opType, Orgin[i], Current[i], iValue);
            }
            summonInfo[strProName] = Current;
        }
        else if (OrginValue.GetType() == typeof(int))
        {
            int Orgin   = (int)OrginValue;
            int Current = (int)CurrentValue;
            int iValue  = ConvertValue(dataType, dwOperationData1, Orgin);
            summonInfo[strProName] = GetModifyValue(bBegin, opType, Orgin, Current, iValue);
        }
    }
Exemplo n.º 7
0
    int     GetModifyValue(bool bBegin, HeaderProto.EOpreationFlag opType, int Orgin, int Current, int iValue)
    {
        int iLayerValue = iValue * m_Layer;

        if (bBegin)
        {
            switch (opType)
            {
            case HeaderProto.EOpreationFlag.OPREATION_FLAG_ADD: {
                Current += iLayerValue;
            } break;

            case HeaderProto.EOpreationFlag.OPREATION_FLAG_REDUCE: {
                Current -= iLayerValue;
            } break;

            case HeaderProto.EOpreationFlag.OPREATION_FLAG_SET: {
                Current = iValue;
            } break;

            default: {
                Current = iValue;
            } break;
            }
        }
        else
        {
            switch (opType)
            {
            case HeaderProto.EOpreationFlag.OPREATION_FLAG_ADD: {
                Current -= iLayerValue;
            } break;

            case HeaderProto.EOpreationFlag.OPREATION_FLAG_REDUCE: {
                Current += iLayerValue;
            } break;

            case HeaderProto.EOpreationFlag.OPREATION_FLAG_SET: {
                Current = Orgin;
            } break;

            default: {
                Current = Orgin;
            } break;
            }
        }
        return(Current);
    }