From c6ec7a0208f1c39e26cb92e7ca97363794398ad3 Mon Sep 17 00:00:00 2001 From: FyloZ Date: Mon, 6 Jul 2020 20:53:39 -0400 Subject: [PATCH] Updated the Hour Hand. --- Content/Items/Weapons/DuneWyrm/Sundial.cs | 2 +- Content/Items/Weapons/HourHand.cs | 2 +- .../{ => DuneWyrm}/HourHandProjectile.cs | 17 ++++++++++++---- .../DuneWyrm/HourHandProjectile.png | Bin 0 -> 828 bytes Content/Projectiles/HourHandProjectile.png | Bin 384 -> 0 bytes Content/Projectiles/MagmaBall.cs | 18 ++++------------- Lib/Util/DustUtils.cs | 19 ++++++++++++++++++ 7 files changed, 38 insertions(+), 20 deletions(-) rename Content/Projectiles/{ => DuneWyrm}/HourHandProjectile.cs (58%) create mode 100644 Content/Projectiles/DuneWyrm/HourHandProjectile.png delete mode 100644 Content/Projectiles/HourHandProjectile.png create mode 100644 Lib/Util/DustUtils.cs 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 0000000000000000000000000000000000000000..f6d70d7eb83a155fa0c23a7f37fcaddec365b2bb GIT binary patch literal 828 zcmV-C1H=4@P)N*VtfU@K4aE@aend5_G5iZL<{1I8HQ?!vYt z88F_Tom_X9WYOaLR37IkfrPIPEH9KoLi1A|gw?Hfqr_BZP!x;I0Ik)d0pm#BiUTTF zW(r!&y&pFR##keBxvy$B$z!HG4hFWE3KPpaDbGZh7rVt~z)VB2*rM7L#-dEnbD3_@GU7@M z5=lgXS!^xGuiT^MnY?Z>3|I+z!~JO*9Y51#EZt1+G(Irq6YM(FGl`B) z|Ibc;vUidfWyVp!)GfjQurje4E^3r*o3>kQ1&lhH9Z4{$gZYfQ+kKWf8nERS*%1ZC z)KVhmeoVJRnERE1S9ObMvU6ryNgx zXpBb#X8mDS^f7iaaP}PtJrM{8w%j6Z=aQJx{7%oiYjqf~_RU^(;I%bv-@qt;YhyqKz5oCK07*qoM6N<$ Gf&c*Nba86{ literal 0 HcmV?d00001 diff --git a/Content/Projectiles/HourHandProjectile.png b/Content/Projectiles/HourHandProjectile.png deleted file mode 100644 index dd8df3bb0be8673a58db5031232c9372bbec63c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 384 zcmV-`0e}99P)%(AB{^I2RO~hT4?yl9v=kU4&x4{ISXZ{$|1W z$&B}hG2n84yrA_G(8pp}qFgQ73wfTm_c{W)%GDey?q~3QfP!JS1u0F_3?%gmk^$X~ zh(!hG4P1Hac~BXZWWfwTZlncNLLa;MKi~n_LRkPzsHC3*Gr%~@6YPRg(N8HLBdzxX zZ@_7t=m+=|6hK0mu$uKEN%+I^u*P2QY?0GgAC`?=*5DOB^t0R^pV5bE2{pK4>a;!eJMb75S8w z2>ON=n3yNe2X27KDD!8da01nbEBC&j_5=FD!2?K6pq?0C=VSn5>(v#`g}5J>0f|fG ecs71o!4p;f?Fsw@RnY(d002ovPDHLkV1fX(), 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