Exemplo n.º 1
0
        void ModifyEntityAttribute <EnumType>(EntityAttribute_A_L <EnumType, double> entityAttribute, EntityAttribute_A_L <EnumType, double> mageAttribute, From getFrom)
        {
            var value = getFrom == From.StartingAttribute ?
                        mageAttribute.Value :
                        mageAttribute.ValuePerLevel;

            var applyableValue = mageAttribute.IncreasePerLevel == Increase.ByPercent ?
                                 Ext.GetPercent(entityAttribute.AppliedValue, value) :
                                 value;

            entityAttribute.AppliedValue += applyableValue;
        }
Exemplo n.º 2
0
        void ModifyNumeralAttributes <EntityData>(EntityData data, From getFrom)
        {
            var entityAttribute = new EntityAttribute_A_L <Numeral, double>();

            Mage.NumeralAttributes.ForEach(mageAttribute =>
            {
                if (data is Data.EnemyEntity.Enemy enemy)
                {
                    entityAttribute = enemy.NumeralAttributes.Find(attribute => attribute.Type == mageAttribute.Type);
                }

                if (data is SpiritData spirit)
                {
                    entityAttribute = spirit.NumeralAttributes.Find(attribute => attribute.Type == mageAttribute.Type);
                }

                ModifyEntityAttribute(entityAttribute, mageAttribute, getFrom);
            });
        }