Updated the Hour Hand.
This commit is contained in:
parent
c8b07494c3
commit
c6ec7a0208
@ -22,7 +22,7 @@ namespace Decimation.Content.Items.Weapons.DuneWyrm
|
|||||||
item.width = 36;
|
item.width = 36;
|
||||||
item.height = 42;
|
item.height = 42;
|
||||||
item.shootSpeed = 1f;
|
item.shootSpeed = 1f;
|
||||||
item.mana = 10; // TODO
|
item.mana = 10;
|
||||||
item.autoReuse = true;
|
item.autoReuse = true;
|
||||||
item.useStyle = 5;
|
item.useStyle = 5;
|
||||||
item.useTime = 24;
|
item.useTime = 24;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using Decimation.Content.Projectiles;
|
using Decimation.Content.Projectiles.DuneWyrm;
|
||||||
using Decimation.Lib.Items;
|
using Decimation.Lib.Items;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Terraria;
|
using Terraria;
|
||||||
|
|||||||
@ -1,18 +1,20 @@
|
|||||||
using Decimation.Lib.Items;
|
using Decimation.Lib.Items;
|
||||||
|
using Decimation.Lib.Util;
|
||||||
using Terraria;
|
using Terraria;
|
||||||
|
using Terraria.ID;
|
||||||
|
|
||||||
namespace Decimation.Content.Projectiles
|
namespace Decimation.Content.Projectiles.DuneWyrm
|
||||||
{
|
{
|
||||||
public class HourHandProjectile : DecimationProjectile
|
public class HourHandProjectile : DecimationProjectile
|
||||||
{
|
{
|
||||||
protected override int AnimationFrames => 4;
|
protected override int AnimationFrames => 3;
|
||||||
protected override DecimationWeapon.DamageType DamageType => DecimationWeapon.DamageType.Ranged;
|
protected override DecimationWeapon.DamageType DamageType => DecimationWeapon.DamageType.Ranged;
|
||||||
protected override int Damages => 45;
|
protected override int Damages => 45;
|
||||||
|
|
||||||
protected override void Init()
|
protected override void Init()
|
||||||
{
|
{
|
||||||
projectile.width = 10;
|
projectile.width = 30;
|
||||||
projectile.height = 10;
|
projectile.height = 30;
|
||||||
projectile.timeLeft = 600;
|
projectile.timeLeft = 600;
|
||||||
projectile.penetrate = -1;
|
projectile.penetrate = -1;
|
||||||
projectile.aiStyle = 8;
|
projectile.aiStyle = 8;
|
||||||
@ -26,5 +28,12 @@ namespace Decimation.Content.Projectiles
|
|||||||
|
|
||||||
return base.PreAI();
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BIN
Content/Projectiles/DuneWyrm/HourHandProjectile.png
Normal file
BIN
Content/Projectiles/DuneWyrm/HourHandProjectile.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 828 B |
Binary file not shown.
|
Before Width: | Height: | Size: 384 B |
@ -35,13 +35,9 @@ namespace Decimation.Content.Projectiles
|
|||||||
|
|
||||||
public override void OnHitPlayer(Player target, int damage, bool crit)
|
public override void OnHitPlayer(Player target, int damage, bool crit)
|
||||||
{
|
{
|
||||||
int dustAmount = 16;
|
DustUtils.NewDustCircle(16, target.position, target.width, target.height, DustID.Fire,
|
||||||
for (int i = 0; i < dustAmount; i++)
|
projectile.scale * 3f);
|
||||||
{
|
|
||||||
Dust.NewDust(target.position, target.width, target.height, DustID.Fire, 0,
|
|
||||||
0, 0, default, projectile.scale * 3f);
|
|
||||||
}
|
|
||||||
|
|
||||||
target.AddBuff(ModContent.BuffType<Singed>(), 300);
|
target.AddBuff(ModContent.BuffType<Singed>(), 300);
|
||||||
|
|
||||||
HitPlayer = true;
|
HitPlayer = true;
|
||||||
@ -52,13 +48,7 @@ namespace Decimation.Content.Projectiles
|
|||||||
{
|
{
|
||||||
if (HitPlayer) return;
|
if (HitPlayer) return;
|
||||||
|
|
||||||
int dustAmount = 4;
|
DustUtils.NewDustCircle(4, projectile.position, projectile.width, projectile.height, DustID.Fire, projectile.scale * 3f);
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
Tile currentTile = Framing.GetTileSafely((int) Math.Floor(projectile.position.X / 16f),
|
Tile currentTile = Framing.GetTileSafely((int) Math.Floor(projectile.position.X / 16f),
|
||||||
(int) Math.Ceiling(projectile.position.Y / 16f));
|
(int) Math.Ceiling(projectile.position.Y / 16f));
|
||||||
|
|||||||
19
Lib/Util/DustUtils.cs
Normal file
19
Lib/Util/DustUtils.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user