xeroc pitchfork stealth strike
This commit is contained in:
1 parent
5fd0ef337f
commit
dd67a2206c
2 files changed
+26
No files matched your search
@@ -1,5 +1,7 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -10,6 +12,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Xeroc Pitchfork");
|
||||
Tooltip.SetDefault("Stealth strikes leave homing stars in their wake");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
@@ -34,6 +37,17 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
item.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
@@ -40,6 +41,17 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
projectile.rotation -= 1.57f;
|
||||
}
|
||||
if (projectile.timeLeft % 12 == 0)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
if (projectile.Calamity().stealthStrike)
|
||||
{
|
||||
int star = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, ModContent.ProjectileType<XerocStar>(), (int)(projectile.damage * 0.5), projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
Main.projectile[star].Calamity().rogue = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
|
||||
Reference in new issue
Block a user