/// <summary>
        /// 洗礼这个伤害值
        /// </summary>
        /// <param name="damageData">伤害数据</param>
        /// <returns></returns>
        public float BaptismDamageData(DamageData damageData)
        {
            DataModifierComponent dataModifierComponent = this.Entity.GetComponent <DataModifierComponent>();

            if ((damageData.BuffDamageTypes & BuffDamageTypes.Physical) == BuffDamageTypes.Physical)
            {
                damageData.DamageValue = dataModifierComponent.BaptismData(CastPhysicalType, damageData.DamageValue);
            }

            if ((damageData.BuffDamageTypes & BuffDamageTypes.Magic) == BuffDamageTypes.Magic)
            {
                damageData.DamageValue = dataModifierComponent.BaptismData(CastMagicType, damageData.DamageValue);
            }

            if ((damageData.BuffDamageTypes & BuffDamageTypes.Single) == BuffDamageTypes.Single)
            {
                damageData.DamageValue = dataModifierComponent.BaptismData(CastSingleType, damageData.DamageValue);
            }

            if ((damageData.BuffDamageTypes & BuffDamageTypes.Range) == BuffDamageTypes.Range)
            {
                damageData.DamageValue = dataModifierComponent.BaptismData(CastRangeType, damageData.DamageValue);
            }

            damageData.DamageValue = dataModifierComponent.BaptismData(CastAllType, damageData.DamageValue);
            return(damageData.DamageValue < 0? 0 : damageData.DamageValue);
        }
Пример #2
0
        /// <summary>
        /// 洗礼这个伤害值
        /// </summary>
        /// <param name="damageData">伤害数据</param>
        /// <returns></returns>
        public float BaptismDamageData(DamageData damageData)
        {
            //如果当前无敌则不计算伤害
            if (this.Entity.GetComponent <StackFsmComponent>().ContainsState(StateTypes.Invincible))
            {
                return(-1.0f);
            }

            DataModifierComponent dataModifierComponent = this.Entity.GetComponent <DataModifierComponent>();

            if ((damageData.BuffDamageTypes & BuffDamageTypes.Physical) == BuffDamageTypes.Physical)
            {
                damageData.DamageValue = dataModifierComponent.BaptismData(ReceivePhysicalType, damageData.DamageValue);
            }

            if ((damageData.BuffDamageTypes & BuffDamageTypes.Magic) == BuffDamageTypes.Magic)
            {
                damageData.DamageValue = dataModifierComponent.BaptismData(ReceiveMagicType, damageData.DamageValue);
            }

            if ((damageData.BuffDamageTypes & BuffDamageTypes.Single) == BuffDamageTypes.Single)
            {
                damageData.DamageValue = dataModifierComponent.BaptismData(ReceiveSingleType, damageData.DamageValue);
            }

            if ((damageData.BuffDamageTypes & BuffDamageTypes.Range) == BuffDamageTypes.Range)
            {
                damageData.DamageValue = dataModifierComponent.BaptismData(ReceiveRangeType, damageData.DamageValue);
            }

            damageData.DamageValue = dataModifierComponent.BaptismData(ReceiveAllType, damageData.DamageValue);

            return(damageData.DamageValue < 0? 0 : damageData.DamageValue);
        }
Пример #3
0
        public void ChangeUnitProperty()
        {
            Unit unit = UnitComponent.Instance.Get(this.Unitid);
            HeroDataComponent     heroDataComponent = unit.GetComponent <HeroDataComponent>();
            DataModifierComponent dataModifierComponent = unit.GetComponent <DataModifierComponent>();
            float oriValue, finalValue;

            switch (BuffWorkTypes)
            {
            case BuffWorkTypes.ChangeMagic:
                oriValue   = this.BelongtoRuntimeTree.GetBlackboard().Get <float>(this.NPBalckBoardRelationData.BBKey);
                finalValue = dataModifierComponent.BaptismData("CostMP", oriValue);

                unit.GetComponent <NumericComponent>()[NumericType.Mp] += finalValue;
                // Log.Info(
                //     $"减少了蓝:{((float) UnitComponent.Instance.Get(this.Unitid).GetComponent<NP_RuntimeTreeManager>().GetTreeByRuntimeID(this.RuntimeTreeID).GetBlackboard()[m_NPBalckBoardRelationData.DicKey]).ToString()}");
                break;

            case BuffWorkTypes.ChangeHP:
                oriValue   = this.BelongtoRuntimeTree.GetBlackboard().Get <float>(this.NPBalckBoardRelationData.BBKey);
                finalValue = dataModifierComponent.BaptismData("CostHP", oriValue);

                unit.GetComponent <NumericComponent>()[NumericType.Hp] += finalValue;
                break;
            }
        }