Beispiel #1
0
        private static void ApplySpiritWalkCollisionFriction_Mana(Player player)
        {
            var config = SpiritWalkingConfig.Instance;

            if (SpiritWalkLogic.ManaCostDuration > 0)
            {
                return;
            }

            int manaDraw = config.Get <int>(nameof(config.PerRateSpiritWalkFrictionAddedManaCost));

            SpiritWalkLogic.ApplyManaDraw(player, manaDraw);
        }
Beispiel #2
0
        public static void ApplySpiritWalkOpenAirFriction_Mana(Player player)
        {
            var config = SpiritWalkingConfig.Instance;

            if (SpiritWalkLogic.ManaCostDuration > 0)
            {
                return;
            }

            int manaDraw = config.Get <int>(nameof(config.PerRateSpiritWalkManaCostInOpenAir));

            SpiritWalkLogic.ApplyManaDraw(player, manaDraw);
        }
Beispiel #3
0
        private static bool ApplyActivateManaCostIf(Player player)
        {
            var config   = SpiritWalkingConfig.Instance;
            int manaCost = config.Get <int>(nameof(config.InitialSpiritWalkManaCost));

            if (!SpiritWalkLogic.HasMana(player, manaCost, out string status))
            {
                Main.NewText(status, Color.Yellow);

                return(false);
            }

            SpiritWalkLogic.EmulatedMana = player.statMana;

            SpiritWalkLogic.ApplyManaDraw(player, manaCost);

            return(true);
        }
        private static void UpdateSpiritWalkCost_Mana(Player player)
        {
            var config = SpiritWalkingConfig.Instance;

            int tickRate = config.Get <int>(nameof(config.SpiritWalkManaCostTickRate));

            if (SpiritWalkLogic.ManaCostDuration++ >= tickRate)
            {
                SpiritWalkLogic.ManaCostDuration = 0;
            }

            if (SpiritWalkLogic.ManaCostDuration == 0)
            {
                int manaCost = config.Get <int>(nameof(config.PerRateSpiritWalkManaCost));

                SpiritWalkLogic.ApplyManaDraw(player, manaCost);
            }

            player.statMana = SpiritWalkLogic.EmulatedMana;
        }