Exemplo n.º 1
0
    public void RemoveBuff(int buffID, IResultControl control)
    {
        Buff buff = BuffList.Find(item => item.BuffID == buffID);

        if (null == buff)
        {
            return;
        }
        buff.MarkRemove(control);
    }
Exemplo n.º 2
0
 public bool HasBuff(string buffName)
 {
     return(!(BuffList.Find(b => b.IsBuffSame(buffName)) == null));
 }
Exemplo n.º 3
0
 public bool HasBuff(IBuff buff)
 {
     return(!(BuffList.Find(b => b == buff) == null));
 }
Exemplo n.º 4
0
    //所有buff结算
    private void BuffResult()
    {
        float MultiplyFHPMax = 0.0f, MultiplyFPhyAttack = 0.0f, MultiplyFMagAttack = 0.0f, MultiplyFPhyDefend = 0.0f,
              MultiplyFMagDefend = 0.0f, MultiplyFavoid = 0.0f, MultiplyFhit = 0.0f, MultiplyFcrit = 0.0f,
              MultiplyFcritparam = 0.0f, MultiplyFResist = 0.0f, MultiplyMoveSpeed = 0.0f,
              MultiplyAnitInterfereRate = 0, MultiplyAnitInterruptRate = 0, MultiplyAnitRepelRate = 0, MultiplyAnitLauncherRate = 0,
              MultiplyWoundParam = 0, MultiplyMovebackSpeed = 0, MultiplyAnimationSpeed = 0, MultiplyAttackAnimSpeed = 0, MultiplySkillCD = 0,

              AddFHPMax = 0, AddFPhyAttack = 0, AddFMagAttack = 0, AddFPhyDefend = 0,
              AddFMagDefend = 0, AddFavoid = 0, AddFhit = 0, AddFcrit = 0, AddFcritparam = 0, AddFResist = 0, AddMoveSpeed = 0,
              AddAnitInterfere = 0, AddAnitInterrupt = 0, AddAnitRepel = 0, AddAnitLauncher = 0,
              AddWoundParam = 0, AddMovebackSpeed = 0, AddAnimationSpeed = 0, AddAttackAnimSpeed = 0, AddSkillCD = 0;

        int buffEffectID = 0, buffEffectLevel = 0;

        if (m_buffIdForShader != 0 && null == BuffList.Find(item => item.BuffID == m_buffIdForShader))
        {
            AnimationShaderParamCallback callback = m_target.GetBodyParentObject().GetComponent <AnimationShaderParamCallback>();
            if (callback != null)
            {
                //恢复shader的color
                callback.RestoreShader(m_colorNameForShader, AnimationShaderParamCallback.ENParamType.enColor);
            }
            else
            {
                Debug.LogWarning("BuffControl BuffResult change shader, AnimationShaderParamCallback is null");
            }
        }
        foreach (var item in BuffList)
        {
            if (null != item && !item.IsNeedRemove && item.IsCalcProperty)
            {
                BuffInfo info = GameTable.BuffTableAsset.Lookup(item.BuffID);
                if (null != info)
                {
                    int index = 0;
                    MultiplyFHPMax            += info.PropertyPercentList[index++];
                    MultiplyFPhyAttack        += info.PropertyPercentList[index++];
                    MultiplyFMagAttack        += info.PropertyPercentList[index++];
                    MultiplyFPhyDefend        += info.PropertyPercentList[index++];
                    MultiplyFMagDefend        += info.PropertyPercentList[index++];
                    MultiplyFavoid            += info.PropertyPercentList[index++];
                    MultiplyFhit              += info.PropertyPercentList[index++];
                    MultiplyFcrit             += info.PropertyPercentList[index++];
                    MultiplyFcritparam        += info.PropertyPercentList[index++];
                    MultiplyFResist           += info.PropertyPercentList[index++];
                    MultiplyAnitInterfereRate += info.PropertyPercentList[index++];
                    MultiplyAnitInterruptRate += info.PropertyPercentList[index++];
                    MultiplyAnitRepelRate     += info.PropertyPercentList[index++];
                    MultiplyAnitLauncherRate  += info.PropertyPercentList[index++];
                    MultiplyMoveSpeed         += info.PropertyPercentList[index++];
                    MultiplyWoundParam        += info.PropertyPercentList[index++];
                    MultiplyAnimationSpeed    += info.PropertyPercentList[index++];
                    MultiplyMovebackSpeed     += info.PropertyPercentList[index++];
                    MultiplyAttackAnimSpeed   += info.PropertyPercentList[index++];
                    MultiplySkillCD           += info.PropertyPercentList[index++];

                    index               = 0;
                    AddFHPMax          += info.PropertyValueList[index++];
                    AddFPhyAttack      += info.PropertyValueList[index++];
                    AddFMagAttack      += info.PropertyValueList[index++];
                    AddFPhyDefend      += info.PropertyValueList[index++];
                    AddFMagDefend      += info.PropertyValueList[index++];
                    AddFavoid          += info.PropertyValueList[index++];
                    AddFhit            += info.PropertyValueList[index++];
                    AddFcrit           += info.PropertyValueList[index++];
                    AddFcritparam      += info.PropertyValueList[index++];
                    AddFResist         += info.PropertyValueList[index++];
                    AddAnitInterfere   += info.PropertyValueList[index++];
                    AddAnitInterrupt   += info.PropertyValueList[index++];
                    AddAnitRepel       += info.PropertyValueList[index++];
                    AddAnitLauncher    += info.PropertyValueList[index++];
                    AddMoveSpeed       += info.PropertyValueList[index++];
                    AddWoundParam      += info.PropertyValueList[index++];
                    AddAnimationSpeed  += info.PropertyValueList[index++];
                    AddMovebackSpeed   += info.PropertyValueList[index++];
                    AddAttackAnimSpeed += info.PropertyValueList[index++];
                    AddSkillCD         += info.PropertyValueList[index++];

                    BuffEffectInfo buffEInfo = GameTable.BuffEffectTableAsset.Lookup(info.BuffEffectID);
                    if (buffEInfo != null)
                    {
                        if (buffEInfo.EffectLevel >= buffEffectLevel)
                        {
                            buffEffectLevel   = buffEInfo.EffectLevel;
                            buffEffectID      = info.BuffEffectID;
                            m_buffIdForShader = info.ID;
                        }
                    }
                }
            }
        }
        CalcFloat(Props.phyAttack, MultiplyFPhyAttack, AddFPhyAttack, ENProperty.phyattack);
        CalcFloat(Props.magAttack, MultiplyFMagAttack, AddFMagAttack, ENProperty.magattack);
        CalcFloat(Props.phyDefend, MultiplyFPhyDefend, AddFPhyDefend, ENProperty.phydefend);
        CalcFloat(Props.magDefend, MultiplyFMagDefend, AddFMagDefend, ENProperty.magdefend);
        CalcFloat(Props.hpMax, MultiplyFHPMax, AddFHPMax, ENProperty.maxhp);
        CalcFloat(Props.avoid, MultiplyFavoid, AddFavoid, ENProperty.avoid);
        CalcFloat(Props.hit, MultiplyFhit, AddFhit, ENProperty.hit);
        CalcFloat(Props.crit, MultiplyFcrit, AddFcrit, ENProperty.crit);
        CalcFloat(Props.critparam, MultiplyFcritparam, AddFcritparam, ENProperty.critParam);
        CalcFloat(Props.FResist, MultiplyFResist, AddFResist, ENProperty.FResist);
        CalcFloat(Props.moveSpeed, MultiplyMoveSpeed, AddMoveSpeed, ENProperty.runSpeed);
        CalcFloat(Props.AnitInterfere, MultiplyAnitInterfereRate, AddAnitInterfere, ENProperty.AnitInterfere);
        CalcFloat(Props.AnitInterrupt, MultiplyAnitInterruptRate, AddAnitInterrupt, ENProperty.AnitInterrupt);
        CalcFloat(Props.AnitRepel, MultiplyAnitRepelRate, AddAnitRepel, ENProperty.AnitRepel);
        CalcFloat(Props.AnitLauncher, MultiplyAnitLauncherRate, AddAnitLauncher, ENProperty.AnitLauncher);
        CalcFloat(Props.WoundParam, MultiplyWoundParam, AddWoundParam, ENProperty.WoundParam);
        CalcFloat(Props.movebackSpeed, MultiplyMovebackSpeed, AddMovebackSpeed, ENProperty.MovebackSpeed);
        float animSpeed = m_target.AnimationSpeed;

        CalcFloat(Props.animationSpeed, MultiplyAnimationSpeed, AddAnimationSpeed, ENProperty.AnimationSpeed);
        float attackAnimSpeed = m_target.AttackAnimSpeed;

        CalcFloat(Props.attackAnimSpeed, MultiplyAttackAnimSpeed, AddAttackAnimSpeed, ENProperty.AttackAnimSpeed);
        if (animSpeed != m_target.AnimationSpeed || attackAnimSpeed != m_target.AttackAnimSpeed)
        {//anim速度改变
            m_target.AnimationSpeedChanged();
        }
        m_target.SkillCDModifyValue   = AddSkillCD;
        m_target.SkillCDModifyPercent = MultiplySkillCD;

        BuffEffectInfo beInfo = GameTable.BuffEffectTableAsset.Lookup(buffEffectID);

        if (beInfo != null)
        {
            if (beInfo.IsChangeShaderColor)
            {
                AnimationShaderParamCallback callback = m_target.GetBodyParentObject().GetComponent <AnimationShaderParamCallback>();
                if (callback != null)
                {
                    //改变shader的color
                    callback.ChangeShaderColor(beInfo.ShaderColorName, beInfo.ShaderColorParam);
                    m_colorNameForShader = beInfo.ShaderColorName;
                }
                else
                {
                    Debug.LogWarning("BuffControl BuffResult change shader, AnimationShaderParamCallback is null");
                }
            }
            else
            {
                m_buffIdForShader = 0;
            }
        }
        m_target.NotifyChangeModel();
    }
Exemplo n.º 5
0
    void RefreshBuffGraphics()
    {
        int buffEffectID = 0, buffEffectLevel = 0;

        if (m_buffIdForShader != 0 && null == BuffList.Find(item => item.BuffID == m_buffIdForShader))
        {
            AnimationShaderParamCallback callback = m_target.GetBodyParentObject().GetComponent <AnimationShaderParamCallback>();
            if (callback != null)
            {
                //恢复shader的color
                callback.RestoreShader(m_colorNameForShader, AnimationShaderParamCallback.ENParamType.enColor);
            }
            else
            {
                Debug.LogWarning("BuffControl BuffResult change shader, AnimationShaderParamCallback is null");
            }
        }
        foreach (var item in BuffList)
        {
            if (null != item && !item.IsNeedRemove)
            {
                BuffInfo info = GameTable.BuffTableAsset.Lookup(item.BuffID);
                if (null != info)
                {
                    BuffEffectInfo buffEInfo = GameTable.BuffEffectTableAsset.Lookup(info.BuffEffectID);
                    if (buffEInfo != null)
                    {
                        if (buffEInfo.EffectLevel >= buffEffectLevel)
                        {
                            buffEffectLevel   = buffEInfo.EffectLevel;
                            buffEffectID      = info.BuffEffectID;
                            m_buffIdForShader = info.ID;
                        }
                    }
                }
            }
        }

        BuffEffectInfo beInfo = GameTable.BuffEffectTableAsset.Lookup(buffEffectID);

        if (beInfo != null)
        {
            if (beInfo.IsChangeShaderColor)
            {
                AnimationShaderParamCallback callback = m_target.GetBodyParentObject().GetComponent <AnimationShaderParamCallback>();
                if (callback != null)
                {
                    //改变shader的color
                    callback.ChangeShaderColor(beInfo.ShaderColorName, beInfo.ShaderColorParam);
                    m_colorNameForShader = beInfo.ShaderColorName;
                }
                else
                {
                    Debug.LogWarning("BuffControl BuffResult change shader, AnimationShaderParamCallback is null");
                }
            }
            else
            {
                m_buffIdForShader = 0;
            }
        }
        m_target.NotifyChangeModel();
    }