Updated the Hour Hand.

This commit is contained in:
FyloZ 2020-07-06 20:53:39 -04:00
parent c8b07494c3
commit c6ec7a0208
7 changed files with 38 additions and 20 deletions

View File

@ -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;

View File

@ -1,4 +1,4 @@
using Decimation.Content.Projectiles;
using Decimation.Content.Projectiles.DuneWyrm;
using Decimation.Lib.Items;
using Microsoft.Xna.Framework;
using Terraria;

View File

@ -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);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 B

View File

@ -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<Singed>(), 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));

19
Lib/Util/DustUtils.cs Normal file
View File

@ -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;
}
}
}
}