tModLoader Wings creating a dust effect

Hello :), I would like to give my modded wings
WillsDeveloper.png
the dust effect 169, if anyone could provide some code of vanilla wings like FLAME WINGS that produce a dust type, that'd be great, or just direct me to where I can find it. Thanks, any reply is welcome.

Here's my code
using Terraria;
using.Terraria.ID;
using Terraria.ModLoader;

namespace willsweaponpack.Items.Accessories
{
[AutoloadEquip(EquipType.Wings)]
public class WillsDeveloper : ModItem
{
int frameCounter = 0;

public override void SetStaticDefaults()
{
DisplayName.SetDefault("Will's Developer Wings");
Tooltip.SetDefault("'Great for impersonating Mod Devs!'");
}

public override void SetDefaults()
{
item.width = 26;
item.height = 38;
item.value = 300000;
item.rare = 10;
item.accessory = true;
}

public override void UpdateAccessory(Player player, bool hideVisual)
{
frameCounter++;
player.wingTimeMax = 999;
if (!hideVisual)
{
if (frameCounter >= 15)
{
frameCounter = 0;
int deloc = 0;
if (player.direction < 0)
{
deloc = Main.rand.Next(12, 25);
}
else
{
deloc = Main.rand.Next(-24, -11);
}
//this is where the dust code would go
}
}
}

public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising,
ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
{
ascentWhenFalling = 0.85f;
ascentWhenRising = 0.2f;
maxCanAscendMultiplier = 1.2f;
maxAscentMultiplier = 4f;
constantAscend = 0.2f;
}

public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration)
{
speed = 14f;
acceleration *= 4f;
}
}
 
Hi,
I'm really new to tModLoader, and I had the same problem.
If you draw dusts in the UpdateAccessory, you will have dust even when you are not flying.
So I found this :

You should use WingUpdate if you want to draw dusts only when flying
Code:
public override bool WingUpdate(Player player, bool inUse)
        {
            Dust.NewDust(player.position, player.width, player.height, 15, 0f, 0f, 150, default(Color), 1.5f); //the dust you want, I've found this one in the example
            return true;
        }

Hope i could help you
 
Back
Top Bottom