Cleaned out pretty much all rogue items
This commit is contained in:
1 parent
ab231e3aba
commit
4e8426744b
150 files changed
+566
-408
No files matched your search
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -36,13 +37,13 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
speedX *= 0.7f;
|
||||
speedY *= 0.7f;
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
velocity.X *= 0.7f;
|
||||
velocity.Y *= 0.7f;
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
@@ -56,7 +57,15 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MangroveChakram>()).AddIngredient(ModContent.ItemType<FlameScythe>()).AddIngredient(ModContent.ItemType<TerraDisk>()).AddIngredient(ModContent.ItemType<GalacticaSingularity>(), 5).AddIngredient(ModContent.ItemType<BarofLife>(), 5).AddIngredient(ItemID.LunarBar, 5).AddTile(TileID.LunarCraftingStation).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MangroveChakram>()).
|
||||
AddIngredient(ModContent.ItemType<FlameScythe>()).
|
||||
AddIngredient(ModContent.ItemType<TerraDisk>()).
|
||||
AddIngredient(ModContent.ItemType<GalacticaSingularity>(), 5).
|
||||
AddIngredient(ModContent.ItemType<BarofLife>(), 5).
|
||||
AddIngredient(ItemID.LunarBar, 5).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -35,12 +36,12 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.shootSpeed = 14f;
|
||||
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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
speedY *= 0.667f;
|
||||
Vector2 initialVelocity = new Vector2(speedX, speedY);
|
||||
velocity.Y *= 0.667f;
|
||||
Vector2 initialVelocity = velocity;
|
||||
|
||||
int p = Projectile.NewProjectile(position - Vector2.UnitY * 12f, initialVelocity, type, damage, knockBack, player.whoAmI);
|
||||
int p = Projectile.NewProjectile(source, position - Vector2.UnitY * 12f, initialVelocity, type, damage, knockback, player.whoAmI);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -35,11 +36,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -38,11 +39,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, Item.shootSpeed, 0f);
|
||||
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, Item.shootSpeed, 0f);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
@@ -40,14 +41,14 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 20;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 20;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
//Check if stealth is full
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 1.25f), knockBack, player.whoAmI);
|
||||
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, (int)(damage * 1.25f), knockback, player.whoAmI);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -36,7 +37,7 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
@@ -44,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
float stealthSpeedMult = 0.6f;
|
||||
float stealthDamageMult = 1.15f;
|
||||
float stealthKnockbackMult = 2.5f;
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX * stealthSpeedMult, speedY * stealthSpeedMult, stealthType, (int)(damage * stealthDamageMult), (int)(knockBack * stealthKnockbackMult), player.whoAmI, 0f, 1f);
|
||||
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X * stealthSpeedMult, velocity.Y * stealthSpeedMult, stealthType, (int)(damage * stealthDamageMult), (int)(knockback * stealthKnockbackMult), player.whoAmI, 0f, 1f);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -37,12 +38,12 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
damage = (int)(damage * 1.2f);
|
||||
|
||||
int star = Projectile.NewProjectile(player.Center, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int star = Projectile.NewProjectile(source, player.Center, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (star.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[star].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
@@ -38,15 +39,15 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int spread = 5;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(position, perturbedspeed, type, Math.Max(damage / 3, 1), knockBack, player.whoAmI);
|
||||
Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-3,4), velocity.Y + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(source, position, perturbedspeed, type, Math.Max(damage / 3, 1), knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
spread -= Main.rand.Next(2,6);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -36,13 +37,13 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.shootSpeed = 12f;
|
||||
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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
speedY *= 0.85f;
|
||||
Vector2 initialVelocity = new Vector2(speedX, speedY);
|
||||
velocity.Y *= 0.85f;
|
||||
Vector2 initialVelocity = velocity;
|
||||
|
||||
// A vertical offset is added to ensure that the barrel does not immediately collide with tiles and explode.
|
||||
int p = Projectile.NewProjectile(position - Vector2.UnitY * 12f, initialVelocity, type, damage, knockBack, player.whoAmI);
|
||||
int p = Projectile.NewProjectile(source, position - Vector2.UnitY * 12f, initialVelocity, type, damage, knockback, player.whoAmI);
|
||||
if (player.Calamity().StealthStrikeAvailable() && p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -39,9 +40,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 4;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 4;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
@@ -51,12 +52,12 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
|
||||
for (int i = 0; i < Item.stack; i++)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.Lerp(-MathHelper.ToRadians(8f), MathHelper.ToRadians(8f), i / (float)(Item.stack - 1)));
|
||||
Projectile proj = Projectile.NewProjectileDirect(position, perturbedSpeed, type, damage, knockBack, player.whoAmI);
|
||||
Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.Lerp(-MathHelper.ToRadians(8f), MathHelper.ToRadians(8f), i / (float)(Item.stack - 1)));
|
||||
Projectile proj = Projectile.NewProjectileDirect(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI);
|
||||
if (proj.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
proj.Calamity().stealthStrike = true;
|
||||
|
||||
Projectile projectile = Projectile.NewProjectileDirect(position, perturbedSpeed, type, damage, knockBack, player.whoAmI);
|
||||
Projectile projectile = Projectile.NewProjectileDirect(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI);
|
||||
if (projectile.whoAmI.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
projectile.penetrate = -1;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -38,9 +39,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.Calamity().customRarity = CalamityRarity.Turquoise;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -36,10 +37,10 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.shootSpeed = 16f;
|
||||
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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
int projectileIndex = Projectile.NewProjectile(position, velocity, type, damage, knockBack, player.whoAmI);
|
||||
|
||||
int projectileIndex = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (player.Calamity().StealthStrikeAvailable() && projectileIndex.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[projectileIndex].Calamity().stealthStrike = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -34,18 +35,18 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.shootSpeed = 10f;
|
||||
Item.autoReuse = 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
bool bloodMoon = Main.bloodMoon;
|
||||
Vector2 initialVelocity = new Vector2(speedX, speedY);
|
||||
Vector2 initialVelocity = velocity;
|
||||
if (bloodMoon)
|
||||
{
|
||||
knockBack *= 3f;
|
||||
knockback *= 3f;
|
||||
}
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
initialVelocity *= 2f;
|
||||
int p = Projectile.NewProjectile(position, initialVelocity, ModContent.ProjectileType<BouncingEyeballProjectileStealthStrike>(), damage, knockBack, player.whoAmI);
|
||||
int p = Projectile.NewProjectile(source, position, initialVelocity, ModContent.ProjectileType<BouncingEyeballProjectileStealthStrike>(), damage, knockback, player.whoAmI);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
}
|
||||
@@ -53,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
initialVelocity *= Main.rand.NextFloat(0.85f, 1.3f);
|
||||
initialVelocity = initialVelocity.RotatedByRandom(MathHelper.ToRadians(10f)); //random spread
|
||||
Projectile.NewProjectile(position, initialVelocity, ModContent.ProjectileType<BouncingEyeballProjectile>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, initialVelocity, ModContent.ProjectileType<BouncingEyeballProjectile>(), damage, knockback, player.whoAmI);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -38,11 +39,11 @@ Stealth strikes provide a bigger boost after richocheting");
|
||||
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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -35,11 +36,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 0.85f), knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, (int)(damage * 0.85f), knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
@@ -37,18 +38,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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int blade = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int blade = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (blade.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[blade].Calamity().stealthStrike = true;
|
||||
|
||||
for (int i = -6; i <= 6; i += 4)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i));
|
||||
int dart = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType<SeethingDischargeBrimstoneBarrage>(), damage, knockBack * 0.5f, player.whoAmI);
|
||||
Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i));
|
||||
int dart = Projectile.NewProjectile(source, position, perturbedSpeed, ModContent.ProjectileType<SeethingDischargeBrimstoneBarrage>(), damage, knockback * 0.5f, player.whoAmI);
|
||||
if (dart.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[dart].Calamity().forceRogue = true;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -38,9 +39,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 8;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 8;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
float speedMult = 1f;
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
@@ -48,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
speedMult = 1.25f;
|
||||
damage = (int)(damage * 1.3f);
|
||||
}
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX * speedMult, speedY * speedMult), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, new Vector2(velocity.X * speedMult, velocity.Y * speedMult), type, damage, knockback, player.whoAmI);
|
||||
if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -38,15 +39,15 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
bool usingStealth = player.Calamity().StealthStrikeAvailable();
|
||||
float strikeValue = usingStealth.ToInt(); //0 if false, 1 if true
|
||||
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
|
||||
// Directly nerf stealth strikes by 10%, but only stealth strikes.
|
||||
int finalDamage = (int)(damage * (usingStealth ? 0.9f : 1.0f));
|
||||
int p = Projectile.NewProjectile(position, velocity, ModContent.ProjectileType<CelestialReaperProjectile>(), finalDamage, knockBack, player.whoAmI, strikeValue);
|
||||
int p = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<CelestialReaperProjectile>(), finalDamage, knockback, player.whoAmI, strikeValue);
|
||||
if (player.Calamity().StealthStrikeAvailable() && p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
@@ -37,11 +38,11 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.Calamity().customRarity = CalamityRarity.Violet;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 0.4), knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, (int)(damage * 0.4), knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -39,13 +40,13 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 8;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 8;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int p = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<CinquedeaProj>(), damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
int p = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<CinquedeaProj>(), damage, knockback, player.whoAmI, 0f, 1f);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -35,7 +36,7 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
@@ -43,8 +44,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
|
||||
for (int i = -6; i <= 6; i += 6)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i));
|
||||
int stealth = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType<CobaltEnergy>(), damage, knockBack, player.whoAmI);
|
||||
Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i));
|
||||
int stealth = Projectile.NewProjectile(source, position, perturbedSpeed, ModContent.ProjectileType<CobaltEnergy>(), damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -39,11 +40,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
|
||||
float strikeValue = player.Calamity().StealthStrikeAvailable().ToInt(); //0 if false, 1 if true
|
||||
int p = Projectile.NewProjectile(position, velocity, ModContent.ProjectileType<ConsecratedWaterProjectile>(), damage, knockBack, player.whoAmI, ai1: strikeValue);
|
||||
int p = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<ConsecratedWaterProjectile>(), damage, knockback, player.whoAmI, ai1: strikeValue);
|
||||
if (player.Calamity().StealthStrikeAvailable() && p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -33,10 +34,10 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.shootSpeed = 15f;
|
||||
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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
int p = Projectile.NewProjectile(position, velocity, type, damage, knockBack, player.whoAmI);
|
||||
|
||||
int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -47,11 +48,11 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
flat += lifeAmount * 0.1f * player.RogueDamage();
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int dagger = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<CorpusAvertorStealth>(), (int)(damage * 3.5f), knockBack * 2f, player.whoAmI);
|
||||
int dagger = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<CorpusAvertorStealth>(), (int)(damage * 3.5f), knockback * 2f, player.whoAmI);
|
||||
if (dagger.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[dagger].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -40,9 +41,9 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (player.Calamity().StealthStrikeAvailable() && player.ownedProjectileCounts[ModContent.ProjectileType<CosmicScythe>()] < 10 && counter == 0 && stealth.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
damage = (int)(damage * 3.21);
|
||||
@@ -51,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
for (float i = 0; i < 5; i++)
|
||||
{
|
||||
float angle = MathHelper.TwoPi / 5f * i;
|
||||
Projectile.NewProjectile(player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType<CosmicScythe>(), (int)(damage * 0.8f), knockBack, player.whoAmI, angle, 0f);
|
||||
Projectile.NewProjectile(source, player.Center, angle.ToRotationVector2() * 8f, ModContent.ProjectileType<CosmicScythe>(), (int)(damage * 0.8f), knockback, player.whoAmI, angle, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -35,7 +36,7 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
@@ -51,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
type = ModContent.ProjectileType<CraniumSmasherProj>();
|
||||
}
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -35,15 +36,15 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int spread = 3;
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(position, perturbedspeed, type, Math.Max(damage / 5, 1), knockBack, player.whoAmI);
|
||||
Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-3,4), velocity.Y + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(source, position, perturbedspeed, type, Math.Max(damage / 5, 1), knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -38,11 +39,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -36,18 +37,18 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 4;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 4;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<WulfrumKnife>(), 50).AddIngredient(ItemID.Diamond, 3).AddIngredient(ItemID.FallenStar, 3).AddTile(TileID.Anvils).Register();
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -35,11 +36,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -73,11 +74,11 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
|
||||
// Reset flex multiplier on direct hits.
|
||||
public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit) => flexMult = 1f;
|
||||
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) => flexMult = 1f;
|
||||
public override void OnHitPvp(Player player, Player target, int damage, bool crit) => flexMult = 1f;
|
||||
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
// Alt fire doesn't actually shoot anything. It flexes, increasing the damage of the next attack.
|
||||
if (player.altFunctionUse == 2)
|
||||
@@ -89,7 +90,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
damage = (int)(damage * 1.3);
|
||||
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -36,16 +37,16 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
float stealthSpeedMult = 1.5f;
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
|
||||
velocity.Normalize();
|
||||
velocity *= Item.shootSpeed * stealthSpeedMult;
|
||||
|
||||
int p = Projectile.NewProjectile(position, velocity, type, damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -61,7 +62,7 @@ Stealth strikes launch all 4 sphere types at once");
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int sphereType = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
@@ -85,15 +86,15 @@ Stealth strikes launch all 4 sphere types at once");
|
||||
|
||||
foreach (int projectileType in projectilesToShoot)
|
||||
{
|
||||
Vector2 shootVelocity = new Vector2(speedX, speedY) + Main.rand.NextVector2Square(-1.5f, 1.5f);
|
||||
int stealth = Projectile.NewProjectile(position, shootVelocity, projectileType, (int)(damage * 0.625f), knockBack, player.whoAmI);
|
||||
Vector2 shootVelocity = velocity + Main.rand.NextVector2Square(-1.5f, 1.5f);
|
||||
int stealth = Projectile.NewProjectile(source, position, shootVelocity, projectileType, (int)(damage * 0.625f), knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), sphereType, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position, velocity, sphereType, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Terraria;
|
||||
@@ -42,9 +43,9 @@ Stealth strikes summon more lightning and travel faster");
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 12;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 12;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
float stealthSpeedMult = 1f;
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
@@ -53,7 +54,7 @@ Stealth strikes summon more lightning and travel faster");
|
||||
if (Main.raining)
|
||||
rainSpeedMult = 1.5f;
|
||||
|
||||
int thunder = Projectile.NewProjectile(position.X, position.Y, speedX * rainSpeedMult * stealthSpeedMult, speedY * rainSpeedMult * stealthSpeedMult, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
int thunder = Projectile.NewProjectile(source, position.X, position.Y, velocity.X * rainSpeedMult * stealthSpeedMult, velocity.Y * rainSpeedMult * stealthSpeedMult, type, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
if (player.Calamity().StealthStrikeAvailable() && thunder.WithinBounds(Main.maxProjectiles)) //setting the stealth strike
|
||||
{
|
||||
Main.projectile[thunder].Calamity().stealthStrike = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -36,11 +37,11 @@ Stealth strikes spawn additional bubbles that inflict Ichor and Cursed Inferno")
|
||||
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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -12,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
DisplayName.SetDefault("Duke's Decapitator");
|
||||
Tooltip.SetDefault("Throws a hydro axe which shreds enemies when it comes into contact with them\n"
|
||||
+"The faster it’s spinning, the more times it hits before disappearing\n"
|
||||
+"The faster it�s spinning, the more times it hits before disappearing\n"
|
||||
+"Stealth Strikes make it emit short-ranged bubbles.");
|
||||
}
|
||||
|
||||
@@ -36,12 +37,12 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
damage = (int)(damage * 1.2f);
|
||||
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (Main.projectile.IndexInRange(proj))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
@@ -38,7 +39,7 @@ Stealth strikes throw three high speed spears");
|
||||
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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
@@ -46,8 +47,8 @@ Stealth strikes throw three high speed spears");
|
||||
float rotation = MathHelper.ToRadians(3);
|
||||
for (int i = 0; i < numProj + 1; i++)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(speedX - 3f, speedY - 3f).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
|
||||
int stealth = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType<DuneHopperProjectile>(), Math.Max(damage / 3, 1), knockBack, player.whoAmI);
|
||||
Vector2 perturbedSpeed = new Vector2(velocity.X - 3f, velocity.Y - 3f).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
|
||||
int stealth = Projectile.NewProjectile(source, position, perturbedSpeed, ModContent.ProjectileType<DuneHopperProjectile>(), Math.Max(damage / 3, 1), knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -36,11 +37,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
@@ -38,12 +39,12 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.Calamity().customRarity = CalamityRarity.DarkBlue;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
type = ModContent.ProjectileType<EclipsesStealth>();
|
||||
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -39,11 +40,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 1f);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -36,11 +37,11 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.shootSpeed = 18f;
|
||||
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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
|
||||
float strikeValue = player.Calamity().StealthStrikeAvailable().ToInt(); //0 if false, 1 if true
|
||||
int projectileIndex = Projectile.NewProjectile(position, velocity, ModContent.ProjectileType<EpidemicShredderProjectile>(), damage, knockBack, player.whoAmI, ai1: strikeValue);
|
||||
int projectileIndex = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<EpidemicShredderProjectile>(), damage, knockback, player.whoAmI, ai1: strikeValue);
|
||||
if (player.Calamity().StealthStrikeAvailable() && projectileIndex.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[projectileIndex].Calamity().stealthStrike = strikeValue == 1f;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -37,11 +38,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 1f);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -39,12 +40,12 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
damage = (int)(damage * 0.5f);
|
||||
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[proj].timeLeft += EradicatorProjectile.StealthExtraLifetime;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
@@ -52,13 +53,13 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<CosmiliteBar>(), 12).AddTile(ModContent.TileType<CosmicAnvil>()).Register();
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
bool usingStealth = player.Calamity().StealthStrikeAvailable() && counter == 0;
|
||||
if (usingStealth)
|
||||
damage = (int)(damage * 3.61);
|
||||
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (usingStealth && stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -37,17 +38,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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 1.15f), knockBack, player.whoAmI, 2f, damage);
|
||||
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, (int)(damage * 1.15f), knockback, player.whoAmI, 2f, damage);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 1f, damage);
|
||||
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 1f, damage);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -39,11 +40,11 @@ Stealth strikes release more souls and leave behind souls as they travel");
|
||||
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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<FantasyTalismanStealth>(), (int)(damage * 0.8f), knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<FantasyTalismanStealth>(), (int)(damage * 0.8f), knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -44,15 +45,15 @@ Stealth strike throws a volley of knives");
|
||||
CreateRecipe(100).AddIngredient(ModContent.ItemType<AerialiteBar>()).AddTile(TileID.SkyMill).Register();
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int spread = 6;
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3, 4), speedY + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(position, perturbedspeed, type, damage, knockBack, player.whoAmI);
|
||||
Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-3, 4), velocity.Y + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(source, position, perturbedspeed, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -36,9 +37,9 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Items.Materials;
|
||||
@@ -42,9 +43,9 @@ Stealth strikes throw three short ranged boomerangs along with a spread of icicl
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 16;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 16;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
CalamityPlayer modPlayer = Main.player[Main.myPlayer].Calamity();
|
||||
//If stealth is full, shoot a spread of 3 boomerangs with reduced range and 6 to 10 icicles
|
||||
@@ -53,8 +54,8 @@ Stealth strikes throw three short ranged boomerangs along with a spread of icicl
|
||||
int spread = 10;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Vector2 perturbedspeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(position, perturbedspeed, type, Math.Max((int)(damage / 2.7272f), 1), knockBack / 3f, player.whoAmI, 0f, 1f);
|
||||
Vector2 perturbedspeed = velocity.RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(source, position, perturbedspeed, type, Math.Max((int)(damage / 2.7272f), 1), knockback / 3f, player.whoAmI, 0f, 1f);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
spread -= 10;
|
||||
@@ -63,8 +64,8 @@ Stealth strikes throw three short ranged boomerangs along with a spread of icicl
|
||||
int icicleAmt = Main.rand.Next(6,11);
|
||||
for (int i = 0; i < icicleAmt; i++)
|
||||
{
|
||||
Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread2));
|
||||
Projectile.NewProjectile(position, perturbedspeed, (Main.rand.NextBool(2) ? ModContent.ProjectileType<Valaricicle>() : ModContent.ProjectileType<Valaricicle2>()), Math.Max((int)(damage / 2.7272f), 1), 0f, player.whoAmI, 0f, 0f);
|
||||
Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-3,4), velocity.Y + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread2));
|
||||
Projectile.NewProjectile(source, position, perturbedspeed, (Main.rand.NextBool(2) ? ModContent.ProjectileType<Valaricicle>() : ModContent.ProjectileType<Valaricicle2>()), Math.Max((int)(damage / 2.7272f), 1), 0f, player.whoAmI, 0f, 0f);
|
||||
spread2 -= Main.rand.Next(1,4);
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -40,11 +41,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int flare = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<FrostyFlareStealth>(), (int)(damage * 0.9f), knockBack, player.whoAmI);
|
||||
int flare = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<FrostyFlareStealth>(), (int)(damage * 0.9f), knockback, player.whoAmI);
|
||||
if (flare.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[flare].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -38,11 +39,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -44,9 +45,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Rogue/GhoulishGougerGlow"));
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -37,11 +38,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 1f);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -42,19 +43,19 @@ Stealth strikes are super fast and pierce infinitely");
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 4;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 4;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
float ai1 = 0f;
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
speedX *= StealthSpeedMult;
|
||||
speedY *= StealthSpeedMult;
|
||||
velocity.X *= StealthSpeedMult;
|
||||
velocity.Y *= StealthSpeedMult;
|
||||
ai1 = 1f;
|
||||
}
|
||||
|
||||
int p = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, ai1);
|
||||
int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, ai1);
|
||||
if (player.Calamity().StealthStrikeAvailable() && p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -37,11 +38,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 1f);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
@@ -64,14 +65,14 @@ Right click to delete all existing spiky balls");
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.killSpikyBalls = false;
|
||||
if (modPlayer.StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
damage = (int)(damage * 1.345);
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -38,11 +39,11 @@ Stealth strikes can bounce off walls and enemies");
|
||||
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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -37,19 +38,19 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 20;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 20;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, 0f, -10f, type, (int)(damage * 1.25f), knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position.X, position.Y, 0f, -10f, type, (int)(damage * 1.25f), knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, 0f, -10f, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, 0f, -10f, type, damage, knockback, player.whoAmI);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -63,13 +64,13 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.killSpikyBalls = false;
|
||||
if (modPlayer.StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<HellsSunProj>(), (int)(damage * SdamageMult), knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<HellsSunProj>(), (int)(damage * SdamageMult), knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
@@ -45,17 +46,17 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 16;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 16;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int stealthDamage = (int)(damage * 1.2f);
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
Vector2 chunkVelocity = new Vector2(speedX, speedY).RotatedByRandom(0.07f) * Main.rand.NextFloat(1.1f, 1.18f);
|
||||
int stealth = Projectile.NewProjectile(position, chunkVelocity, ModContent.ProjectileType<HypothermiaChunk>(), stealthDamage, knockBack, player.whoAmI);
|
||||
Vector2 chunkVelocity = velocity.RotatedByRandom(0.07f) * Main.rand.NextFloat(1.1f, 1.18f);
|
||||
int stealth = Projectile.NewProjectile(source, position, chunkVelocity, ModContent.ProjectileType<HypothermiaChunk>(), stealthDamage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
}
|
||||
@@ -70,10 +71,10 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
|
||||
for (int i = 0; i < projAmt; ++i)
|
||||
{
|
||||
float SpeedX = speedX + Main.rand.NextFloat(-2f, 2f);
|
||||
float SpeedY = speedY + Main.rand.NextFloat(-2f, 2f);
|
||||
float SpeedX = velocity.X + Main.rand.NextFloat(-2f, 2f);
|
||||
float SpeedY = velocity.Y + Main.rand.NextFloat(-2f, 2f);
|
||||
int texID = Main.rand.Next(4);
|
||||
Projectile.NewProjectile(position, new Vector2(SpeedX, SpeedY), type, damage, knockBack, player.whoAmI, texID, 0f);
|
||||
Projectile.NewProjectile(source, position, new Vector2(SpeedX, SpeedY), type, damage, knockback, player.whoAmI, texID, 0f);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -38,13 +39,13 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 7;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 7;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -34,11 +35,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -35,11 +36,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.6), knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, (int)(damage * 1.6), knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -37,11 +38,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 1f);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -37,11 +38,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 1f);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -38,10 +39,10 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
float spreadAngle = MathHelper.ToRadians(2.5f);
|
||||
Vector2 direction = new Vector2(speedX, speedY);
|
||||
Vector2 direction = velocity;
|
||||
Vector2 baseDirection = direction.RotatedBy(-spreadAngle * 2.5f);
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
@@ -51,13 +52,13 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int p = Projectile.NewProjectile(position, currentDirection, type, (int)(damage * 1.8), knockBack + 6f, player.whoAmI);
|
||||
int p = Projectile.NewProjectile(source, position, currentDirection, type, (int)(damage * 1.8), knockback + 6f, player.whoAmI);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.NewProjectile(position, currentDirection, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, currentDirection, type, damage, knockback, player.whoAmI);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
@@ -40,9 +41,9 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -38,9 +39,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 16;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 16;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
CalamityPlayer p = Main.player[Main.myPlayer].Calamity();
|
||||
//If stealth is full, shoot a spread of 3 boomerangs with reduced range
|
||||
@@ -49,8 +50,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
int spread = 10;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Vector2 perturbedspeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(position, perturbedspeed, ModContent.ProjectileType<KylieBoomerang>(), Math.Max(damage / 3, 1), knockBack / 3f, player.whoAmI, 0f, 1f);
|
||||
Vector2 perturbedspeed = velocity.RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(source, position, perturbedspeed, ModContent.ProjectileType<KylieBoomerang>(), Math.Max(damage / 3, 1), knockback / 3f, player.whoAmI, 0f, 1f);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
spread -= 10;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -39,9 +40,9 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -37,11 +38,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 1f);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -65,13 +66,13 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
return 0.75f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
float stealthDamageFactor = player.Calamity().StealthStrikeAvailable() ? 1.25f : 1f;
|
||||
|
||||
if (player.Calamity().StealthStrikeAvailable() || player.altFunctionUse != 2)
|
||||
{
|
||||
int bomb = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * stealthDamageFactor), knockBack, player.whoAmI);
|
||||
int bomb = Projectile.NewProjectile(source, position, velocity, type, (int)(damage * stealthDamageFactor), knockback, player.whoAmI);
|
||||
if (bomb.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[bomb].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
@@ -81,8 +82,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
float dmgMult = 0.5f;
|
||||
for (float i = -2.5f; i < 3f; ++i)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i));
|
||||
Projectile.NewProjectile(position, perturbedSpeed, type, (int)(damage * dmgMult * stealthDamageFactor), knockBack, player.whoAmI);
|
||||
Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i));
|
||||
Projectile.NewProjectile(source, position, perturbedSpeed, type, (int)(damage * dmgMult * stealthDamageFactor), knockback, player.whoAmI);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -36,7 +37,7 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
bool stealthStrike = false;
|
||||
int teethCount;
|
||||
@@ -55,12 +56,12 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
|
||||
for (int i = 0; i < teethCount; i++)
|
||||
{
|
||||
float offsetSpeedX = speedX + Main.rand.NextFloat(-4f, 4f);
|
||||
float offsetSpeedY = speedY + Main.rand.NextFloat(-4f, 4f);
|
||||
float offsetSpeedX = velocity.X + Main.rand.NextFloat(-4f, 4f);
|
||||
float offsetSpeedY = velocity.Y + Main.rand.NextFloat(-4f, 4f);
|
||||
|
||||
if (stealthStrike)
|
||||
{
|
||||
int tooth = Projectile.NewProjectile(position.X, position.Y, offsetSpeedX * 1.5f, offsetSpeedY * 1.5f, type, damage, knockBack * 10f, player.whoAmI);
|
||||
int tooth = Projectile.NewProjectile(source, position.X, position.Y, offsetSpeedX * 1.5f, offsetSpeedY * 1.5f, type, damage, knockback * 10f, player.whoAmI);
|
||||
if (tooth.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[tooth].Calamity().stealthStrike = true;
|
||||
@@ -69,7 +70,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
else
|
||||
{
|
||||
int tooth = Projectile.NewProjectile(position.X, position.Y, offsetSpeedX, offsetSpeedY, type, damage, knockBack, player.whoAmI);
|
||||
int tooth = Projectile.NewProjectile(source, position.X, position.Y, offsetSpeedX, offsetSpeedY, type, damage, knockback, player.whoAmI);
|
||||
if (tooth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[tooth].Calamity().lineColor = Main.rand.Next(3);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -35,11 +36,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -38,9 +39,9 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.25f), knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, (int)(damage * 1.25f), knockback, player.whoAmI);
|
||||
if (Main.projectile.IndexInRange(proj))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -39,7 +40,7 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
float num72 = Item.shootSpeed;
|
||||
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
@@ -77,7 +78,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
num149 *= num80;
|
||||
float x4 = vector2.X;
|
||||
float y4 = vector2.Y;
|
||||
int stealth = Projectile.NewProjectile(x4, y4, num148, num149, ModContent.ProjectileType<LunarKunaiProj>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
int stealth = Projectile.NewProjectile(source, x4, y4, num148, num149, ModContent.ProjectileType<LunarKunaiProj>(), damage, knockback, player.whoAmI, 0f, 0f);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
}
|
||||
@@ -97,7 +98,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
num149 *= num80;
|
||||
float x4 = vector2.X;
|
||||
float y4 = vector2.Y;
|
||||
Projectile.NewProjectile(x4, y4, num148, num149, ModContent.ProjectileType<LunarKunaiProj>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, x4, y4, num148, num149, ModContent.ProjectileType<LunarKunaiProj>(), damage, knockback, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -65,15 +66,15 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
return 2f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
float dmgMult = 1f;
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
for (float i = -6.5f; i <= 6.5f; i += 6.5f)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i));
|
||||
int stealth = Projectile.NewProjectile(position, perturbedSpeed, type, damage * 2, knockBack, player.whoAmI);
|
||||
Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i));
|
||||
int stealth = Projectile.NewProjectile(source, position, perturbedSpeed, type, damage * 2, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
}
|
||||
@@ -87,7 +88,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
dmgMult = 1f;
|
||||
}
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * dmgMult), knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, velocity, type, (int)(damage * dmgMult), knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -35,12 +36,12 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
damage = (int)(damage * 1.25f);
|
||||
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -38,9 +39,9 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<MetalChunk>(), damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<MetalChunk>(), damage, knockback, player.whoAmI);
|
||||
if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -41,11 +42,11 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
CreateRecipe(1).AddIngredient(ItemID.MeteoriteBar, 10).AddTile(TileID.Anvils).Register();
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<MeteorFistProj>(), damage, knockBack, player.whoAmI, 0f, 4f);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<MeteorFistProj>(), damage, knockback, player.whoAmI, 0f, 4f);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -38,12 +39,12 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
damage = (int)(damage * 1.07);
|
||||
int ss = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int ss = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (ss.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[ss].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
@@ -38,9 +39,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 18;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 18;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
//Checks if stealth is avalaible to shoot a spread of 3 darts
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
@@ -48,8 +49,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
float spread = 7;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Vector2 perturbedspeed = new Vector2(speedX * 1.25f, speedY * 1.25f).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int p = Projectile.NewProjectile(position, perturbedspeed, ModContent.ProjectileType<MonkeyDart>(), Math.Max(damage / 3, 1), knockBack, player.whoAmI, 1);
|
||||
Vector2 perturbedspeed = new Vector2(velocity.X * 1.25f, velocity.Y * 1.25f).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int p = Projectile.NewProjectile(source, position, perturbedspeed, ModContent.ProjectileType<MonkeyDart>(), Math.Max(damage / 3, 1), knockback, player.whoAmI, 1);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
spread -= 7;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -35,16 +36,16 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
if (player.Calamity().StealthStrikeAvailable() && player.ownedProjectileCounts[ModContent.ProjectileType<ShroomerangSpore>()] < 20 && stealth.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
for (float i = 0; i < Main.rand.Next(7,11); i++)
|
||||
{
|
||||
Vector2 velocity = CalamityUtils.RandomVelocity(50f, 10f, 50f, 0.01f);
|
||||
int spore = Projectile.NewProjectile(player.Center, velocity, ModContent.ProjectileType<ShroomerangSpore>(), (int)(damage * 0.5f), knockBack, player.whoAmI);
|
||||
|
||||
int spore = Projectile.NewProjectile(source, player.Center, velocity, ModContent.ProjectileType<ShroomerangSpore>(), (int)(damage * 0.5f), knockback, player.whoAmI);
|
||||
if (spore.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[spore].ai[1] = 1f;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -35,11 +36,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
@@ -47,12 +48,12 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.shootSpeed = Speed;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
damage = (int)(damage * 1.2);
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -40,15 +41,15 @@ Stealth strikes throw five at once");
|
||||
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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int spread = 3;
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, damage, knockBack, player.whoAmI);
|
||||
Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-3,4), velocity.Y + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(source, position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
spread -= Main.rand.Next(1,4);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Ores;
|
||||
@@ -40,12 +41,12 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
damage = (int)(damage * 1.22);
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
||||
if (p.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[p].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
@@ -53,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
return 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int orbDamage = (int)(damage * 0.75f);
|
||||
|
||||
@@ -62,21 +63,21 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
for (int j = 0; j < Item.stack - player.ownedProjectileCounts[ModContent.ProjectileType<NychthemeronProjectile>()]; j++)
|
||||
{
|
||||
float spread = 2;
|
||||
int pIndex = Projectile.NewProjectile(position.X, position.Y, speedX + Main.rand.NextFloat(-spread, spread), speedY + Main.rand.NextFloat(-spread, spread), type, Math.Max(damage / 3, 1), knockBack, player.whoAmI, 0f, 1f);
|
||||
int pIndex = Projectile.NewProjectile(source, position.X, position.Y, velocity.X + Main.rand.NextFloat(-spread, spread), velocity.Y + Main.rand.NextFloat(-spread, spread), type, Math.Max(damage / 3, 1), knockback, player.whoAmI, 0f, 1f);
|
||||
Projectile p = Main.projectile[pIndex];
|
||||
if (pIndex.WithinBounds(Main.maxProjectiles))
|
||||
p.Calamity().stealthStrike = true;
|
||||
int pID = p.identity;
|
||||
|
||||
CreateOrbs(position, (int)(orbDamage * 0.675f), knockBack, pID, player, true);
|
||||
CreateOrbs(position, (int)(orbDamage * 0.675f), knockback, pID, player, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int pIndex = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
int pIndex = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 1f);
|
||||
int pID = Main.projectile[pIndex].identity;
|
||||
|
||||
CreateOrbs(position, orbDamage, knockBack, pID, player, false);
|
||||
CreateOrbs(position, orbDamage, knockback, pID, player, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -103,7 +104,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
CreateRecipe(1).AddIngredient(ItemID.SpikyBall, 30).AddIngredient(ItemID.LightShard).AddIngredient(ItemID.DarkShard).AddRecipeGroup("AnyMythrilBar", 2).AddTile(TileID.MythrilAnvil).Register();
|
||||
}
|
||||
|
||||
private static void CreateOrbs(Vector2 position, int damage, float knockBack, int projectileID, Player player, bool stealth)
|
||||
private static void CreateOrbs(Vector2 position, int damage, float knockback, int projectileID, Player player, bool stealth)
|
||||
{
|
||||
float rotationOffset = 0f;
|
||||
|
||||
@@ -149,8 +150,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
rotationOffset += MathHelper.ToRadians(72f);
|
||||
}
|
||||
|
||||
int orb1 = Projectile.NewProjectile(position, Vector2.Zero, ModContent.ProjectileType<NychthemeronOrb>(), damage, knockBack, player.whoAmI, orb1Col, projectileID);
|
||||
int orb2 = Projectile.NewProjectile(position, Vector2.Zero, ModContent.ProjectileType<NychthemeronOrb>(), damage, knockBack, player.whoAmI, orb2Col, projectileID);
|
||||
int orb1 = Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType<NychthemeronOrb>(), damage, knockback, player.whoAmI, orb1Col, projectileID);
|
||||
int orb2 = Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType<NychthemeronOrb>(), damage, knockback, player.whoAmI, orb2Col, projectileID);
|
||||
if (orb1.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[orb1].localAI[1] = pos;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -36,11 +37,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int gemstone = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int gemstone = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (gemstone.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[gemstone].Calamity().stealthStrike = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -36,12 +37,12 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
damage = (int)(damage * 1.425f);
|
||||
|
||||
int javelin = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int javelin = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (javelin.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[javelin].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
@@ -42,9 +43,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 16;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 16;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
@@ -61,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
num79 = 0f;
|
||||
}
|
||||
vector2 += new Vector2(num78, num79);
|
||||
int proj = Projectile.NewProjectile(vector2, new Vector2(0f,-0.5f), ModContent.ProjectileType<PenumbraBomb>(), damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
int proj = Projectile.NewProjectile(source, vector2, new Vector2(0f,-0.5f), ModContent.ProjectileType<PenumbraBomb>(), damage, knockback, player.whoAmI, 0f, 1f);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Terraria;
|
||||
@@ -39,12 +40,12 @@ Stealth strikes continuously leave spectral clones in their wake");
|
||||
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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
damage = (int)(damage * 1.22);
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Terraria;
|
||||
@@ -43,11 +44,11 @@ Stealth strikes don't slow down and souls always deal full damage");
|
||||
Item.shoot = ModContent.ProjectileType<PhantomLanceProj>();
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.75f), knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, (int)(damage * 1.75f), knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -39,11 +40,11 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -42,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 4;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 4;
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
@@ -61,13 +62,13 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.killSpikyBalls = false;
|
||||
if (modPlayer.StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
@@ -38,13 +39,13 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 4;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 4;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.15f), knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, (int)(damage * 1.15f), knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Terraria;
|
||||
@@ -41,13 +42,13 @@ Stealth strikes spawn smaller spears to fly along side it");
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 15;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 15;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -35,12 +36,12 @@ 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)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
damage = (int)(damage * 0.85f);
|
||||
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
@@ -38,18 +39,18 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 8;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 8;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<Prismalline>()).AddIngredient(ModContent.ItemType<AstralBar>(), 10).AddIngredient(ModContent.ItemType<Stardust>(), 15).AddIngredient(ItemID.FallenStar, 10).AddTile(TileID.LunarCraftingStation).Register();
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -36,12 +37,12 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.Calamity().customRarity = CalamityRarity.Violet;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
damage = (int)(damage * 0.75D);
|
||||
|
||||
int shuriken = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int shuriken = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (player.Calamity().StealthStrikeAvailable() && Main.projectile.IndexInRange(shuriken))
|
||||
Main.projectile[shuriken].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -38,11 +39,11 @@ Stealth strikes explode into energy stars");
|
||||
Item.shoot = ModContent.ProjectileType<RegulusRiotProj>();
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.2f), knockBack, player.whoAmI);
|
||||
int stealth = Projectile.NewProjectile(source, position, velocity, type, (int)(damage * 1.2f), knockback, player.whoAmI);
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
|
||||
Loaded 100 of 150 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user