Beispiel #1
0
        ////

        private void ApplyMeteorArmorShootBehaviorIf(Item shootItem)
        {
            PowerfulMagicItem.IsPoweredUp(shootItem, out bool isTreatedAsSpecialSpaceWeapon);
            if (!isTreatedAsSpecialSpaceWeapon)
            {
                return;
            }

            this.MeteorArmorTemperature += 2f;
            if (this.MeteorArmorTemperature > 125f)
            {
                this.MeteorArmorTemperature = 125f;
            }
        }
Beispiel #2
0
        public static float?GetItemDamageScale(Item item, int manaSicknessTicks)
        {
            if (!item.magic)
            {
                return(null);
            }

            var config = PowerfulMagicConfig.Instance;

            //

            // Laser weapons + meteor armor = no mana = no damage increase
            PowerfulMagicItem.IsPoweredUp(item, out bool isTreatedAsSpecialSpaceWeapon);
            if (isTreatedAsSpecialSpaceWeapon)
            {
                return(null);
            }

            //

            float maxManaSickDmgScale = config.Get <float>(nameof(config.MaxManaSicknessDamageScale));

            float scale = ((float)manaSicknessTicks / 300f) * maxManaSickDmgScale;

            scale = 1f - scale;

            if (scale <= 0.25f)
            {
                return(0.25f);
            }

            //

            var itemDef         = new ItemDefinition(item.type);
            var perItemDmgScale = config.Get <Dictionary <ItemDefinition, ItemMagicScale> >(
                nameof(PowerfulMagicConfig.PerItemDamageScale)
                );

            if (perItemDmgScale.ContainsKey(itemDef))
            {
                return(perItemDmgScale[itemDef].Scale * scale);
            }

            //

            return(config.Get <float>(nameof(PowerfulMagicConfig.BaseDamageScale)) * scale);
        }