diff --git a/Content/Items/Weapons/DuneWyrm/Sundial.cs b/Content/Items/Weapons/DuneWyrm/Sundial.cs index 789512c..0598e23 100644 --- a/Content/Items/Weapons/DuneWyrm/Sundial.cs +++ b/Content/Items/Weapons/DuneWyrm/Sundial.cs @@ -22,7 +22,7 @@ namespace Decimation.Content.Items.Weapons.DuneWyrm item.width = 36; item.height = 42; item.shootSpeed = 1f; - item.mana = 10; // TODO + item.mana = 10; item.autoReuse = true; item.useStyle = 5; item.useTime = 24; diff --git a/Content/Items/Weapons/HourHand.cs b/Content/Items/Weapons/HourHand.cs index 097eb98..bf7a926 100644 --- a/Content/Items/Weapons/HourHand.cs +++ b/Content/Items/Weapons/HourHand.cs @@ -1,4 +1,4 @@ -using Decimation.Content.Projectiles; +using Decimation.Content.Projectiles.DuneWyrm; using Decimation.Lib.Items; using Microsoft.Xna.Framework; using Terraria; diff --git a/Content/Projectiles/HourHandProjectile.cs b/Content/Projectiles/DuneWyrm/HourHandProjectile.cs similarity index 58% rename from Content/Projectiles/HourHandProjectile.cs rename to Content/Projectiles/DuneWyrm/HourHandProjectile.cs index 0138b8b..7575340 100644 --- a/Content/Projectiles/HourHandProjectile.cs +++ b/Content/Projectiles/DuneWyrm/HourHandProjectile.cs @@ -1,18 +1,20 @@ using Decimation.Lib.Items; +using Decimation.Lib.Util; using Terraria; +using Terraria.ID; -namespace Decimation.Content.Projectiles +namespace Decimation.Content.Projectiles.DuneWyrm { public class HourHandProjectile : DecimationProjectile { - protected override int AnimationFrames => 4; + protected override int AnimationFrames => 3; protected override DecimationWeapon.DamageType DamageType => DecimationWeapon.DamageType.Ranged; protected override int Damages => 45; protected override void Init() { - projectile.width = 10; - projectile.height = 10; + projectile.width = 30; + projectile.height = 30; projectile.timeLeft = 600; projectile.penetrate = -1; projectile.aiStyle = 8; @@ -26,5 +28,12 @@ namespace Decimation.Content.Projectiles return base.PreAI(); } + + public override void Kill(int timeLeft) + { + DustUtils.NewDustCircle(12, projectile.position, projectile.width, projectile.height, 135, + projectile.scale * 3f, 4, 0); + Main.PlaySound(SoundID.Item27, projectile.Center); + } } } \ No newline at end of file diff --git a/Content/Projectiles/DuneWyrm/HourHandProjectile.png b/Content/Projectiles/DuneWyrm/HourHandProjectile.png new file mode 100644 index 0000000..f6d70d7 Binary files /dev/null and b/Content/Projectiles/DuneWyrm/HourHandProjectile.png differ diff --git a/Content/Projectiles/HourHandProjectile.png b/Content/Projectiles/HourHandProjectile.png deleted file mode 100644 index dd8df3b..0000000 Binary files a/Content/Projectiles/HourHandProjectile.png and /dev/null differ diff --git a/Content/Projectiles/MagmaBall.cs b/Content/Projectiles/MagmaBall.cs index ee7f1c0..fbb35d5 100644 --- a/Content/Projectiles/MagmaBall.cs +++ b/Content/Projectiles/MagmaBall.cs @@ -35,13 +35,9 @@ namespace Decimation.Content.Projectiles public override void OnHitPlayer(Player target, int damage, bool crit) { - int dustAmount = 16; - for (int i = 0; i < dustAmount; i++) - { - Dust.NewDust(target.position, target.width, target.height, DustID.Fire, 0, - 0, 0, default, projectile.scale * 3f); - } - + DustUtils.NewDustCircle(16, target.position, target.width, target.height, DustID.Fire, + projectile.scale * 3f); + target.AddBuff(ModContent.BuffType(), 300); HitPlayer = true; @@ -52,13 +48,7 @@ namespace Decimation.Content.Projectiles { if (HitPlayer) return; - int dustAmount = 4; - for (int i = 0; i < dustAmount; i++) - { - Vector2 velocity = Vector2.One.RotatedBy(Math.PI * (2f / dustAmount)); - Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire, velocity.X, - velocity.Y, 0, default, projectile.scale * 3f); - } + DustUtils.NewDustCircle(4, projectile.position, projectile.width, projectile.height, DustID.Fire, projectile.scale * 3f); Tile currentTile = Framing.GetTileSafely((int) Math.Floor(projectile.position.X / 16f), (int) Math.Ceiling(projectile.position.Y / 16f)); diff --git a/Lib/Util/DustUtils.cs b/Lib/Util/DustUtils.cs new file mode 100644 index 0000000..d869a8f --- /dev/null +++ b/Lib/Util/DustUtils.cs @@ -0,0 +1,19 @@ +using System; +using Microsoft.Xna.Framework; +using Terraria; + +namespace Decimation.Lib.Util +{ + public class DustUtils + { + public static void NewDustCircle(int amount, Vector2 position, int width, int height, int type, float scale = 1f, float speedX = 1f, float speedY = 1f, bool gravity = false, int alpha = 0, Color color = default) + { + for (int i = 0; i < amount; i++) + { + Vector2 velocity = new Vector2(speedX, speedY).RotatedBy(Math.PI * (2f / amount * i)); + int dust = Dust.NewDust(position, width, height, type, velocity.X, velocity.Y, alpha, color, scale); + Main.dust[dust].noGravity = !gravity; + } + } + } +} \ No newline at end of file