/// <summary>
        /// Creates fire embers.
        /// </summary>
        /// <param name="position"></param>
        /// <param name="smallEmbers"></param>
        /// <param name="largeEmbers"></param>
        /// <param name="pouringEmbers"></param>
        /// <param name="floaters"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <param name="scale"></param>
        public static void MakeFireEmbers(
            Vector2 position,
            int smallEmbers,
            int largeEmbers,
            int pouringEmbers,
            int floaters,
            int width   = 30,
            int height  = 30,
            float scale = 1f)
        {
            void makeDust(int type, int num)
            {
                DustLibraries.CreateMany(
                    dustType: type,
                    position: position,
                    quantity: num,
                    width: width,
                    height: height,
                    scale: scale
                    );
            }

            makeDust(6, smallEmbers);
            makeDust(271, largeEmbers);
            makeDust(170, pouringEmbers);
            makeDust(259, floaters);
        }
        /// <summary>
        /// Creates teleportation particles.
        /// </summary>
        /// <param name="position"></param>
        /// <param name="quantity">Dust particles.</param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <param name="scale"></param>
        public static void MakeTeleportFx(Vector2 position, int quantity, int width = 30, int height = 30, float scale = 1f)
        {
            void makeDust(int type, int num)
            {
                DustLibraries.CreateMany(
                    dustType: type,
                    position: position,
                    quantity: num,
                    width: width,
                    height: height,
                    scale: scale
                    );
            }

            makeDust(DustLibraries.TeleportSparkleTypeID, quantity);
        }
Ejemplo n.º 3
0
        ////

        public static bool HealAtCost(Player player, float healAmount)
        {
            var myplayer = player.GetModPlayer <NecrotisPlayer>();
            int cost     = NecrotisPlayer.CalculateHealCostFromWitchDoctor(player, healAmount);

            if (cost == 0)
            {
                return(false);
            }

            if (!player.BuyItem(cost))
            {
                return(false);
            }

            myplayer.AnimaPercent += healAmount;

            DustLibraries.CreateMany(dustType: DustLibraries.GoldGlitterTypeID, position: player.Center, quantity: 8);
            Main.PlaySound(SoundID.Item4);

            return(true);
        }