Esempio n. 1
0
        public void Apply(Unit unit)
        {
            if (Expired)
                return;

            switch (OpType) {
                case OperationType.Multiply:
                    unit.Attribute[Attribute] *= Amount;
                    break;
                case OperationType.Add:
                    if (Amount < 0 && Attribute == UnitAttribute.Health) {
                        unit.Hurt(Amount * -1);
                    }
                    else {
                        unit.Attribute[Attribute] += Amount;
                    }

                    break;
                case OperationType.Set:
                    unit.Attribute[Attribute] = Amount;
                    break;
            }
        }