valediction stealth strike

This commit is contained in:
termigator1359 committed 2020-04-20 15:10:04 -04:00
1 parent 6c70f4dbc6
commit 5fa63b4545
5 files changed
+85 -4

No files matched your search

+14 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -10,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Rogue
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Valediction");
Tooltip.SetDefault("Throws a homing reaper scythe");
Tooltip.SetDefault("Throws a homing reaper scythe\n" +
"Stealth strikes spawn razorblade typhoons on enemy hits");
}
public override void SafeSetDefaults()
@@ -33,5 +35,16 @@ namespace CalamityMod.Items.Weapons.Rogue
item.Calamity().rogue = true;
item.Calamity().customRarity = CalamityRarity.PureGreen;
}
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()) //setting the stealth strike
{
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;
}
}
}
+11 -2
View File
@@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Magic
projectile.tileCollide = false;
projectile.extraUpdates = 2;
projectile.ignoreWater = true;
aiType = ProjectileID.Typhoon;
}
public override void Kill(int timeLeft)
@@ -50,9 +49,19 @@ namespace CalamityMod.Projectiles.Magic
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.immune[projectile.owner] = 5;
target.buffImmune[BuffID.Wet] = false; //I'm not sorry
target.AddBuff(BuffID.Wet, 600);
if (projectile.ai[1] != 1f) //Nuclear Fury
{
target.immune[projectile.owner] = 5;
}
}
public override void OnHitPvp(Player target, int damage, bool crit)
{
target.AddBuff(BuffID.Wet, 600);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
+1 -1
View File
@@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue
}
iAmSpeed.Normalize();
iAmSpeed *= (float)Main.rand.Next(70, 101) * 0.1f;
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, iAmSpeed.X, iAmSpeed.Y, ModContent.ProjectileType<MoltenBlobThrown>(), (int)((double)projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f);
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, iAmSpeed.X, iAmSpeed.Y, ModContent.ProjectileType<MoltenBlobThrown>(), (int)(projectile.damage * 0.25), 0f, projectile.owner, 0f, 0f);
}
}
+20
View File
@@ -46,6 +46,26 @@ namespace CalamityMod.Projectiles.Rogue
}
}
public override void OnHitPvp(Player target, int damage, bool crit)
{
int coralAmt = Main.rand.Next(1, 4);
if (projectile.owner == Main.myPlayer && projectile.Calamity().stealthStrike)
{
for (int coralCount = 0; coralCount < coralAmt; coralCount++)
{
Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
while (value15.X == 0f && value15.Y == 0f)
{
value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
}
value15.Normalize();
value15 *= (float)Main.rand.Next(70, 101) * 0.1f;
int coral = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType<SmallCoral>(), projectile.damage / 3, 0f, projectile.owner, 0f, 0f);
Main.projectile[coral].Calamity().forceRogue = true;
}
}
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
projectile.ai[0] += 0.1f;
+39
View File
@@ -1,4 +1,5 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
@@ -121,11 +122,49 @@ namespace CalamityMod.Projectiles.Rogue
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(ModContent.BuffType<CrushDepth>(), 600);
int typhoonAmt = 3;
if (projectile.owner == Main.myPlayer && projectile.Calamity().stealthStrike)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 84);
for (int typhoonCount = 0; typhoonCount < typhoonAmt; typhoonCount++)
{
Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
while (value15.X == 0f && value15.Y == 0f)
{
value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
}
value15.Normalize();
value15 *= (float)Main.rand.Next(70, 101) * 0.1f;
int typhoon = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType<NuclearFuryProjectile>(), projectile.damage / 3, 0f, projectile.owner, 0f, 0f);
Main.projectile[typhoon].Calamity().forceRogue = true;
Main.projectile[typhoon].usesLocalNPCImmunity = true;
Main.projectile[typhoon].localNPCHitCooldown = 10;
}
}
}
public override void OnHitPvp(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<CrushDepth>(), 600);
int typhoonAmt = 3;
if (projectile.owner == Main.myPlayer && projectile.Calamity().stealthStrike)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 84);
for (int typhoonCount = 0; typhoonCount < typhoonAmt; typhoonCount++)
{
Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
while (value15.X == 0f && value15.Y == 0f)
{
value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
}
value15.Normalize();
value15 *= (float)Main.rand.Next(70, 101) * 0.1f;
int typhoon = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType<NuclearFuryProjectile>(), projectile.damage / 3, 0f, projectile.owner, 0f, 1f);
Main.projectile[typhoon].Calamity().forceRogue = true;
Main.projectile[typhoon].usesLocalNPCImmunity = true;
Main.projectile[typhoon].localNPCHitCooldown = 10;
}
}
}
public override void Kill(int timeLeft)