adamantite and mythril rogue stealth strikes
This commit is contained in:
1 parent
d4a3ef10df
commit
5fd0ef337f
6 files changed
+98
-5
No files matched your search
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
@@ -8,6 +10,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Adamantite Throwing Axe");
|
||||
Tooltip.SetDefault("Stealth strikes summon lightning bolts on enemy hits");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
@@ -32,6 +35,18 @@ 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;
|
||||
Main.projectile[stealth].usesLocalNPCImmunity = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
@@ -8,6 +10,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Mythril Knife");
|
||||
Tooltip.SetDefault("Stealth strikes inflict a wide assortment of debuffs");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
@@ -32,6 +35,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);
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
projectile.timeLeft = 600;
|
||||
aiType = ProjectileID.Shuriken;
|
||||
projectile.Calamity().rogue = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
@@ -39,5 +40,47 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, ModContent.ItemType<AdamantiteThrowingAxe>());
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (projectile.Calamity().stealthStrike && Main.myPlayer == projectile.owner)
|
||||
{
|
||||
for (int n = 0; n < 3; n++)
|
||||
{
|
||||
float xStart = projectile.position.X + Main.rand.Next(-400, 400);
|
||||
float yStart = projectile.position.Y + Main.rand.Next(500, 800);
|
||||
Vector2 startPos = new Vector2(xStart, yStart);
|
||||
Vector2 velocity = projectile.Center - startPos;
|
||||
velocity.X += (float)Main.rand.Next(-100, 101);
|
||||
float travelDist = velocity.Length();
|
||||
float lightningSpeed = 8f;
|
||||
travelDist = lightningSpeed / travelDist;
|
||||
velocity.X *= travelDist;
|
||||
velocity.Y *= travelDist;
|
||||
Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType<BlunderBoosterLightning>(), projectile.damage, projectile.knockBack, projectile.owner, Main.rand.Next(2), 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
if (projectile.Calamity().stealthStrike && Main.myPlayer == projectile.owner)
|
||||
{
|
||||
for (int n = 0; n < Main.rand.Next(3,6); n++)
|
||||
{
|
||||
float xStart = projectile.position.X + Main.rand.Next(-400, 400);
|
||||
float yStart = projectile.position.Y + Main.rand.Next(500, 800);
|
||||
Vector2 startPos = new Vector2(xStart, yStart);
|
||||
Vector2 velocity = projectile.Center - startPos;
|
||||
velocity.X += (float)Main.rand.Next(-100, 101);
|
||||
float travelDist = velocity.Length();
|
||||
float lightningSpeed = 16f;
|
||||
travelDist = lightningSpeed / travelDist;
|
||||
velocity.X *= travelDist;
|
||||
velocity.Y *= travelDist;
|
||||
Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType<BlunderBoosterLightning>(), projectile.damage, projectile.knockBack, projectile.owner, Main.rand.Next(2), 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
|
||||
|
||||
if (projectile.timeLeft < 55)
|
||||
if (projectile.timeLeft < 55 && projectile.ai[1] != 1f)
|
||||
{
|
||||
projectile.tileCollide = true;
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Vector2 velocity = projectile.Center - startPos;
|
||||
velocity.X += (float)Main.rand.Next(-100, 101);
|
||||
float travelDist = velocity.Length();
|
||||
float starSpeed = 29f;
|
||||
travelDist = starSpeed / travelDist;
|
||||
float spearSpeed = 29f;
|
||||
travelDist = spearSpeed / travelDist;
|
||||
velocity.X *= travelDist;
|
||||
velocity.Y *= travelDist;
|
||||
Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType<EclipsesSmol>(), (int)(projectile.damage * dmgKBMult), projectile.knockBack * dmgKBMult, projectile.owner, 0f, 0f);
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
@@ -64,7 +66,26 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(BuffID.Venom, 200);
|
||||
if (!projectile.Calamity().stealthStrike)
|
||||
return;
|
||||
|
||||
target.AddBuff(BuffID.CursedInferno, 300);
|
||||
target.AddBuff(BuffID.Venom, 300);
|
||||
target.AddBuff(ModContent.BuffType<ArmorCrunch>(), 300);
|
||||
target.AddBuff(ModContent.BuffType<Irradiated>(), 300);
|
||||
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 300);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
if (!projectile.Calamity().stealthStrike)
|
||||
return;
|
||||
|
||||
target.AddBuff(BuffID.CursedInferno, 300);
|
||||
target.AddBuff(BuffID.Venom, 300);
|
||||
target.AddBuff(ModContent.BuffType<ArmorCrunch>(), 300);
|
||||
target.AddBuff(ModContent.BuffType<Irradiated>(), 300);
|
||||
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user