public override void OnExecute()
        {
            switch (this.BuffData.BuffWorkType)
            {
            case BuffWorkTypes.ChangeAttackValue:
                ConstantModifier constantModifier_AttackValue = ReferencePool.Acquire <ConstantModifier>();
                constantModifier_AttackValue.ChangeValue = BuffDataCalculateHelper.CalculateCurrentData(this, this.BuffData);
                dataModifier = constantModifier_AttackValue;

                this.GetBuffTarget().GetComponent <DataModifierComponent>()
                .AddDataModifier(NumericType.AttackAdd.ToString(), dataModifier, NumericType.AttackAdd);
                break;

            case BuffWorkTypes.ChangeMagic:
                PercentageModifier constantModifier_Magic = ReferencePool.Acquire <PercentageModifier>();
                constantModifier_Magic.Percentage = BuffDataCalculateHelper.CalculateCurrentData(this, this.BuffData);
                this.dataModifier = constantModifier_Magic;

                this.GetBuffTarget().GetComponent <DataModifierComponent>()
                .AddDataModifier(NumericType.Mp.ToString(), this.dataModifier, NumericType.Mp);
                break;

            case BuffWorkTypes.ChangeSpeed:
                PercentageModifier percentageModifier_Speed = ReferencePool.Acquire <PercentageModifier>();
                percentageModifier_Speed.Percentage = BuffDataCalculateHelper.CalculateCurrentData(this, this.BuffData);
                this.dataModifier = percentageModifier_Speed;

                this.GetBuffTarget().GetComponent <DataModifierComponent>()
                .AddDataModifier(NumericType.SpeedAdd.ToString(), this.dataModifier, NumericType.SpeedAdd);
                break;
            }

            this.BuffState = BuffState.Running;
        }
Beispiel #2
0
    internal override ConstantModifier _Clone()
    {
        ConstantModifier mod = ScriptableObject.CreateInstance <ActorModifier>();

        mod.name             = this.name;
        mod.Name             = this.Name;
        mod.NegativeEffect   = this.NegativeEffect;
        mod.TriggeredEffects = new List <TriggeredEffect>();
        for (int i = 0; i < TriggeredEffects.Count; i++)
        {
            mod.TriggeredEffects.Add(this.TriggeredEffects[i].Clone());
        }
        return(mod);
    }
    public ConstantModifier Clone()
    {
        ConstantModifier ret = _Clone();

        ret.name             = this.name;
        ret.Name             = this.Name;
        ret.NegativeEffect   = this.NegativeEffect;
        ret.TriggeredEffects = new List <TriggeredEffect>();
        for (int i = 0; i < TriggeredEffects.Count; i++)
        {
            ret.TriggeredEffects.Add(this.TriggeredEffects[i].Clone());
        }
        ret.IsClone = true;
        return(ret);
    }
 internal override ConstantModifier _Clone()
 {
     ConstantModifier mod = ScriptableObject.CreateInstance<FeatureModifier>();
     return mod;
 }