public override void PostUpdate() { if (player.HeldItem.type == ItemType <Ultrashark>()) { Ultrashark item = (Ultrashark)player.HeldItem.modItem; if (item.turretDeployed && item.turretDirection != 0) { player.direction = item.turretDirection; } } }
public override void PreUpdate() { if (player.HeldItem.type == ItemType <Ultrashark>()) { Ultrashark item = (Ultrashark)player.HeldItem.modItem; if (player.releaseUseItem) { item.spinup = 0; } if (item.turretDeployed) { if (player.velocity.X <= -0.2f || player.velocity.X >= 0.2f || player.velocity.Y <= -0.2f || player.velocity.Y >= 0.2f) //cancel if moving { item.turretDeployed = false; item.turretSetup = false; item.standFrame = 0; item.sharkFrame = 0; item.spinup = 0; } } StarlightPlayer sPlayer = player.GetModPlayer <StarlightPlayer>(); if (item.turretDeployed) { if (sPlayer.Timer % 6 == 0) //animate stand { if (item.standFrame < item.standFrameCount - 1) { item.standFrame++; } else if (!item.turretSetup) { item.turretSetup = true; } } if (sPlayer.Timer - item.spinup * 6f == 0) //animate gun { if (item.sharkFrame < item.sharkFrameCount - 1) { item.sharkFrame++; } } } } }