Will the Terrarian
Terrarian
Hello , I would like to give my modded wings
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;
}
}
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;
}
}