Apoctolith, Refraction Rotor, Titanium Shuriken
This commit is contained in:
1 parent
f05601aa02
commit
35ecc9e561
10 files changed
+101
-120
No files matched your search
@@ -17,11 +17,10 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
Item.width = 66;
|
||||
Item.height = 64;
|
||||
Item.damage = 228;
|
||||
Item.damage = 238;
|
||||
Item.shootSpeed = 18f;
|
||||
Item.shoot = ModContent.ProjectileType<ApoctolithProj>();
|
||||
Item.useTime = 26;
|
||||
Item.useAnimation = 26;
|
||||
Item.useAnimation = Item.useTime = 26;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.knockBack = 10f;
|
||||
Item.value = CalamityGlobalItem.RarityLimeBuyPrice;
|
||||
@@ -36,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20;
|
||||
|
||||
public override float StealthDamageMultiplier => 1.3f;
|
||||
public override void UseStyle(Player player, Rectangle heldItemFrame)
|
||||
{
|
||||
ExtraArmAnimations.ThrowArmAnimationFast(player, Item);
|
||||
|
||||
@@ -14,9 +14,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = Item.height = 120;
|
||||
Item.damage = 332;
|
||||
Item.damage = 240;
|
||||
Item.knockBack = 8.5f;
|
||||
Item.useAnimation = Item.useTime = 55;
|
||||
Item.useAnimation = Item.useTime = 40;
|
||||
Item.DamageType = RogueDamageClass.Instance;
|
||||
Item.autoReuse = true;
|
||||
Item.shootSpeed = 18f;
|
||||
@@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.rare = ModContent.RarityType<Violet>();
|
||||
}
|
||||
|
||||
public override float StealthDamageMultiplier => 0.25f;
|
||||
public override float StealthDamageMultiplier => 0.3f;
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
@@ -38,14 +38,13 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
//If stealth is full, shoot a spread of 3 shurikens
|
||||
if (p.StealthStrikeAvailable())
|
||||
{
|
||||
int spread = 30;
|
||||
for (int i = 0; i < 3; i++)
|
||||
int spread = 20;
|
||||
for (int i = -1; i <= 1; i++)
|
||||
{
|
||||
Vector2 perturbedspeed = velocity.RotatedBy(MathHelper.ToRadians(spread));
|
||||
Vector2 perturbedspeed = velocity.RotatedBy(MathHelper.ToRadians(spread * i));
|
||||
int proj = Projectile.NewProjectile(source, position, perturbedspeed, type, damage, knockback, player.whoAmI, 0f, 1f);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
spread -= 30;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -12,12 +12,11 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
Item.width = 34;
|
||||
Item.height = 34;
|
||||
Item.damage = 41;
|
||||
Item.damage = 38;
|
||||
Item.useAnimation = Item.useTime = 9;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.noMelee = true;
|
||||
Item.noUseGraphic = true;
|
||||
Item.useAnimation = 9;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.useTime = 9;
|
||||
Item.knockBack = 3f;
|
||||
Item.UseSound = SoundID.Item1;
|
||||
Item.autoReuse = true;
|
||||
@@ -27,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
Item.shootSpeed = 16f;
|
||||
Item.DamageType = RogueDamageClass.Instance;
|
||||
}
|
||||
public override float StealthDamageMultiplier => 1.3f;
|
||||
public override float StealthDamageMultiplier => 1f;
|
||||
public override float StealthVelocityMultiplier => 1.25f;
|
||||
|
||||
|
||||
@@ -42,9 +41,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
if (stealth.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
Main.projectile[stealth].usesLocalNPCImmunity = true;
|
||||
Main.projectile[stealth].aiStyle = -1;
|
||||
Main.projectile[stealth].extraUpdates = 1;
|
||||
Main.projectile[stealth].localNPCHitCooldown = -1;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ AcidBarrelDrop.DisplayName: Barrel Acid Drop
|
||||
AcidShrapnel.DisplayName: Acidic Shrapnel
|
||||
AdamantiteThrowingAxeProjectile.DisplayName: Adamantite Throwing Axe
|
||||
AntumbraShardProjectile.DisplayName: Antumbra Shard
|
||||
ApoctolithExplosion.DisplayName: Apoctolith Boom
|
||||
ApoctolithProj.DisplayName: Apoctolith
|
||||
ApoctolithShard.DisplayName: Apoctolith Shard
|
||||
AshenStalactiteDebris.DisplayName: Ashen Debris
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class ApoctolithExplosion : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Rogue";
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = Projectile.height = 300;
|
||||
Projectile.friendly = true;
|
||||
Projectile.DamageType = RogueDamageClass.Instance;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.timeLeft = 20;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = -1;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Projectile.ai[0] == 0f)
|
||||
{
|
||||
float screenShakePower = 7 * Utils.GetLerpValue(1300f, 0f, Projectile.Distance(Main.LocalPlayer.Center), true);
|
||||
if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < screenShakePower)
|
||||
Main.LocalPlayer.Calamity().GeneralScreenShakePower = screenShakePower;
|
||||
|
||||
CustomPulse blastRing1 = new(Projectile.Center, Vector2.Zero, Color.Blue, "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(-10, 10), 0.05f, 0.35f, 15);
|
||||
GeneralParticleHandler.SpawnParticle(blastRing1);
|
||||
|
||||
CustomPulse blastRing2 = new(Projectile.Center, Vector2.Zero, Color.Blue, "CalamityMod/Particles/FlameExplosion", new(1f, 0.5f), 0, 0.05f, 0.35f, 20);
|
||||
GeneralParticleHandler.SpawnParticle(blastRing2);
|
||||
|
||||
Projectile.ai[0] = 1f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<CrushDepth>(), 240);
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType<CrushDepth>(), 240);
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
public static Color LowBlueColor => Color.Blue;
|
||||
public static Color HighBlueColor => Color.DodgerBlue;
|
||||
|
||||
public int ShardDamage => (int)(Projectile.damage * 0.12f);
|
||||
public int ShardDamage => (int)(Projectile.damage * 0.15f);
|
||||
public int ExplosionDamage => (int)(Projectile.damage * 0.5f);
|
||||
public int ExplosionRadius => 150;
|
||||
|
||||
@@ -98,92 +98,35 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
#region Long convoluted particle code
|
||||
|
||||
if (Projectile.Calamity().stealthStrike)
|
||||
{
|
||||
float screenShakePower = 7 * Utils.GetLerpValue(1300f, 0f, Projectile.Distance(Main.LocalPlayer.Center), true);
|
||||
if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < screenShakePower)
|
||||
Main.LocalPlayer.Calamity().GeneralScreenShakePower = screenShakePower;
|
||||
|
||||
Particle blastRing = new CustomPulse(
|
||||
Projectile.Center,
|
||||
Vector2.Zero,
|
||||
Projectile.Calamity().stealthStrike ? Color.Black : LowBlueColor,
|
||||
"CalamityMod/Particles/FlameExplosion",
|
||||
Vector2.One,
|
||||
Main.rand.NextFloat(-10, 10),
|
||||
0.05f,
|
||||
Projectile.Calamity().stealthStrike ? 0.5f : 0.2f,
|
||||
15);
|
||||
GeneralParticleHandler.SpawnParticle(blastRing);
|
||||
|
||||
Particle blastRing1 = new CustomPulse(
|
||||
Projectile.Center,
|
||||
Vector2.Zero,
|
||||
LowBlueColor,
|
||||
"CalamityMod/Particles/FlameExplosion",
|
||||
Vector2.One,
|
||||
Main.rand.NextFloat(-10, 10),
|
||||
0.05f,
|
||||
0.35f,
|
||||
15);
|
||||
GeneralParticleHandler.SpawnParticle(blastRing1);
|
||||
|
||||
Particle blastRing2 = new CustomPulse(
|
||||
Projectile.Center,
|
||||
Vector2.Zero,
|
||||
LowBlueColor,
|
||||
"CalamityMod/Particles/FlameExplosion",
|
||||
new(1f, 0.5f),
|
||||
0,
|
||||
0.05f,
|
||||
0.35f,
|
||||
20);
|
||||
GeneralParticleHandler.SpawnParticle(blastRing2);
|
||||
}
|
||||
|
||||
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, LowBlueColor, "CalamityMod/Particles/LargeBloom", Vector2.One, 0f, 1f, 0f, 25));
|
||||
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", Vector2.One, 0f, 0.5f, 0f, 15));
|
||||
|
||||
for (int i = 0; i < 5; i++) GeneralParticleHandler.SpawnParticle(new BloodParticle2(Projectile.Center, new Vector2(Main.rand.NextFloat(6, 12), 0).RotatedBy(Main.rand.NextFloat(MathHelper.TwoPi)), 12, Main.rand.NextFloat(0.2f, 0.8f), HighBlueColor));
|
||||
|
||||
GlowSparkParticle gs = new GlowSparkParticle(Projectile.Center, Vector2.Zero, false, 20, Projectile.Calamity().stealthStrike ? 0.06f : 0.03f, HighBlueColor, Vector2.One, true);
|
||||
GlowSparkParticle gs = new(Projectile.Center, Vector2.Zero, false, 20, Projectile.Calamity().stealthStrike ? 0.06f : 0.03f, HighBlueColor, Vector2.One, true);
|
||||
gs.Rotation = Main.rand.NextFloat(-10, 10);
|
||||
|
||||
GeneralParticleHandler.SpawnParticle(gs);
|
||||
|
||||
#endregion
|
||||
|
||||
// Sounds
|
||||
|
||||
SoundEngine.PlaySound(AbyssGravel.MineSound, Projectile.position);
|
||||
SoundEngine.PlaySound(GiantClam.SlamSound, Projectile.position);
|
||||
SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode.WithPitchOffset(0.5f), Projectile.position);
|
||||
if (Projectile.Calamity().stealthStrike) SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/MineralMortarExplode"), Projectile.position);
|
||||
|
||||
|
||||
// This only triggers if stealth is full
|
||||
if (Projectile.Calamity().stealthStrike)
|
||||
if (Projectile.Calamity().stealthStrike && Main.myPlayer == Projectile.owner)
|
||||
{
|
||||
// Explosion damage
|
||||
// Explosion
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<ApoctolithExplosion>(), ExplosionDamage, 0, Projectile.owner);
|
||||
|
||||
foreach (NPC npc in Main.npc)
|
||||
// Split shards
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
if (npc.active && npc.Distance(Projectile.Center) < ExplosionRadius && !npc.justHit)
|
||||
{
|
||||
npc.AddBuff(ModContent.BuffType<CrushDepth>(), 240);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), npc.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), ExplosionDamage, 0, Projectile.owner, npc.whoAmI);
|
||||
}
|
||||
}
|
||||
|
||||
int split = 0;
|
||||
while (split < 5)
|
||||
{
|
||||
//Calculate the velocity of the projectile
|
||||
// Calculate the velocity of the projectile
|
||||
float shardspeedX = -Projectile.velocity.X * Main.rand.NextFloat(.5f, .7f) + Main.rand.NextFloat(-3f, 3f);
|
||||
float shardspeedY = -Projectile.velocity.Y * Main.rand.Next(50, 70) * 0.01f + Main.rand.Next(-8, 9) * 0.2f;
|
||||
//Prevents the projectile speed from being too low
|
||||
|
||||
// Prevents the projectile speed from being too low
|
||||
if (shardspeedX < 2f && shardspeedX > -2f)
|
||||
{
|
||||
shardspeedX += -Projectile.velocity.X;
|
||||
@@ -192,14 +135,12 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
shardspeedY += -Projectile.velocity.Y;
|
||||
}
|
||||
|
||||
shardspeedX *= 2f;
|
||||
shardspeedY *= 2f;
|
||||
|
||||
//Spawn the projectile
|
||||
int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position.X + shardspeedX, Projectile.position.Y + shardspeedY, shardspeedX, shardspeedY, ModContent.ProjectileType<ApoctolithShard>(), ShardDamage, Projectile.knockBack / 2f, Projectile.owner);
|
||||
// Spawn the projectile
|
||||
int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X + shardspeedX, Projectile.Center.Y + shardspeedY, shardspeedX, shardspeedY, ModContent.ProjectileType<ApoctolithShard>(), ShardDamage, Projectile.knockBack / 2f, Projectile.owner);
|
||||
Main.projectile[shard].frame = Main.rand.Next(3);
|
||||
split += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,13 +27,14 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
TimeBeforeHoming = Main.rand.Next(30, 60);
|
||||
Projectile.friendly = true;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.width = 13;
|
||||
Projectile.scale = Main.rand.NextFloat(0.7f, 1.2f);
|
||||
Projectile.height = 13;
|
||||
Projectile.friendly = true;
|
||||
Projectile.DamageType = RogueDamageClass.Instance;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.scale = Main.rand.NextFloat(0.7f, 1.2f);
|
||||
Projectile.timeLeft = 240;
|
||||
TimeBeforeHoming = Main.rand.Next(30, 60);
|
||||
}
|
||||
public override bool? CanDamage()
|
||||
{
|
||||
@@ -52,10 +53,18 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
Projectile.ai[2] = MathHelper.Lerp(Projectile.ai[2], 10, 0.05f);
|
||||
CalamityUtils.HomeInOnNPC(Projectile, false, 400, Projectile.ai[2], 0.2f);
|
||||
Projectile.velocity.Y += 0.4f;
|
||||
Projectile.velocity.Y += 0.25f;
|
||||
}
|
||||
|
||||
}
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
if (Projectile.velocity.X != oldVelocity.X)
|
||||
Projectile.velocity.X = -Projectile.velocity.X;
|
||||
if (Projectile.velocity.Y != oldVelocity.Y)
|
||||
Projectile.velocity.Y = -Projectile.velocity.Y;
|
||||
return false;
|
||||
}
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Asset<Texture2D> tex = ModContent.Request<Texture2D>(Texture);
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Rogue";
|
||||
public const int EnergyShotCount = 6;
|
||||
public const int StealthEnergyShotCount = 4;
|
||||
private static float RotationIncrement = 0.5f;
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/RefractionRotor";
|
||||
|
||||
@@ -111,11 +112,12 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
if (CalamityUtils.CountProjectiles(shootType) > 24)
|
||||
return;
|
||||
|
||||
int energyDamage = (int)(Projectile.damage * 0.495);
|
||||
int energyDamage = (int)(Projectile.damage * 0.5f);
|
||||
int shotAmt = Projectile.Calamity().stealthStrike ? StealthEnergyShotCount : EnergyShotCount;
|
||||
float baseDirectionRotation = Main.rand.NextFloat(MathHelper.TwoPi);
|
||||
for (int i = 0; i < EnergyShotCount; i++)
|
||||
for (int i = 0; i < shotAmt; i++)
|
||||
{
|
||||
Vector2 shootVelocity = (MathHelper.TwoPi * i / EnergyShotCount + baseDirectionRotation).ToRotationVector2() * 9f;
|
||||
Vector2 shootVelocity = (MathHelper.TwoPi * i / shotAmt + baseDirectionRotation).ToRotationVector2() * 9f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + shootVelocity, shootVelocity, shootType, energyDamage, Projectile.knockBack, Projectile.owner);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Projectile.ai[0] += 1f;
|
||||
if (Projectile.ai[0] > 30f)
|
||||
{
|
||||
CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f);
|
||||
CalamityUtils.HomeInOnNPC(Projectile, true, 320f, 12f, 20f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Projectile.ai[0] = 1f;
|
||||
Projectile.ai[1] = 0f;
|
||||
Projectile.netUpdate = true;
|
||||
Projectile.ResetLocalNPCHitImmunity(); // Stealth uses -1 local and resets it when returning to guarantee it can hit again on the way back
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -144,32 +145,16 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => SpawnStealthClones();
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info) => SpawnStealthClones();
|
||||
private void SpawnStealthClones()
|
||||
{
|
||||
if (Projectile.owner == Main.myPlayer && Projectile.Calamity().stealthStrike && Projectile.numHits < 3)
|
||||
if (Projectile.Calamity().stealthStrike && Projectile.numHits < 3)
|
||||
{
|
||||
for (int index2 = 0; index2 < 4; index2++)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
float xVector = (float)Main.rand.Next(-35, 36) * 0.02f;
|
||||
float yVector = (float)Main.rand.Next(-35, 36) * 0.02f;
|
||||
xVector *= 10f;
|
||||
yVector *= 10f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, xVector, yVector, ModContent.ProjectileType<TitaniumClone>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
if (Projectile.owner == Main.myPlayer && Projectile.Calamity().stealthStrike && Projectile.numHits < 3)
|
||||
{
|
||||
for (int index2 = 0; index2 < 4; index2++)
|
||||
{
|
||||
float xVector = (float)Main.rand.Next(-35, 36) * 0.02f;
|
||||
float yVector = (float)Main.rand.Next(-35, 36) * 0.02f;
|
||||
xVector *= 10f;
|
||||
yVector *= 10f;
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, xVector, yVector, ModContent.ProjectileType<TitaniumClone>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
Vector2 randSpeed = Main.rand.NextVector2CircularEdge(6.5f, 6.5f) * Main.rand.NextFloat(0.4f, 1f);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, randSpeed, ModContent.ProjectileType<TitaniumClone>(), (int)(Projectile.damage * 0.8f), Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user