From 4a88e12bdb7f6de9a21da2fdae1f040750bc323e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 13 Dec 2019 15:44:38 -0500 Subject: [PATCH 01/21] weapon balancing --- Items/Weapons/Magic/ClamorNoctus.cs | 1 - Items/Weapons/Magic/WyvernsCall.cs | 3 +-- Items/Weapons/Ranged/FirestormCannon.cs | 3 ++- Items/Weapons/Rogue/InfernalKris.cs | 4 ++-- Items/Weapons/Rogue/Nychthemeron.cs | 4 ++-- Items/Weapons/Rogue/Turbulance.cs | 2 +- NPCs/CalamityGlobalNPCLoot.cs | 3 ++- NPCs/TownNPCs/THIEF.cs | 6 +++--- Projectiles/Rogue/InfernalKrisProjectile.cs | 2 +- Projectiles/Rogue/NychthemeronOrb.cs | 2 ++ Projectiles/Rogue/NychthemeronProjectile.cs | 1 + Projectiles/Rogue/TurbulanceProjectile.cs | 4 ++-- 12 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Items/Weapons/Magic/ClamorNoctus.cs b/Items/Weapons/Magic/ClamorNoctus.cs index 7f62a883c7..ec83019c32 100644 --- a/Items/Weapons/Magic/ClamorNoctus.cs +++ b/Items/Weapons/Magic/ClamorNoctus.cs @@ -13,7 +13,6 @@ namespace CalamityMod.Items.Weapons.Magic { DisplayName.SetDefault("Clamor Noctus"); Tooltip.SetDefault(@"Let the sky fall - Fires night wyverns and stars from the sky that stick to enemies and tiles and explode"); Item.staff[item.type] = true; } diff --git a/Items/Weapons/Magic/WyvernsCall.cs b/Items/Weapons/Magic/WyvernsCall.cs index 54fbfdc074..299416db6b 100644 --- a/Items/Weapons/Magic/WyvernsCall.cs +++ b/Items/Weapons/Magic/WyvernsCall.cs @@ -13,14 +13,13 @@ namespace CalamityMod.Items.Weapons.Magic { DisplayName.SetDefault("Wyvern's Call"); Tooltip.SetDefault(@"I call upon the mythical Wyvern to shower the lands with its grace - Fires wyverns and colored feathers from the sky that stick to enemies and tiles and explode"); Item.staff[item.type] = true; } public override void SetDefaults() { - item.damage = 50; + item.damage = 30; item.magic = true; item.mana = 10; item.width = 52; diff --git a/Items/Weapons/Ranged/FirestormCannon.cs b/Items/Weapons/Ranged/FirestormCannon.cs index 4c57fada4d..6bf6fed861 100644 --- a/Items/Weapons/Ranged/FirestormCannon.cs +++ b/Items/Weapons/Ranged/FirestormCannon.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Items.Weapons.Ranged { float SpeedX = speedX + (float)Main.rand.Next(-50, 51) * 0.05f; float SpeedY = speedY + (float)Main.rand.Next(-50, 51) * 0.05f; - int flare = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage * 1.6), knockBack, player.whoAmI, 0.0f, 0.0f); + int flare = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage * 1.4), knockBack, player.whoAmI, 0.0f, 0.0f); Main.projectile[flare].penetrate = 1; Main.projectile[flare].timeLeft = 600; Main.projectile[flare].Calamity().forceRanged = true; @@ -87,6 +87,7 @@ namespace CalamityMod.Items.Weapons.Ranged int projectile = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); Main.projectile[projectile].Calamity().forceRanged = true; Main.projectile[projectile].timeLeft = 200; + Main.projectile[projectile].penetrate = 3; } return false; } diff --git a/Items/Weapons/Rogue/InfernalKris.cs b/Items/Weapons/Rogue/InfernalKris.cs index 534ecee897..2b2893c5db 100644 --- a/Items/Weapons/Rogue/InfernalKris.cs +++ b/Items/Weapons/Rogue/InfernalKris.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 32; - item.damage = 18; + item.damage = 24; item.noMelee = true; item.noUseGraphic = true; item.consumable = true; @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.autoReuse = true; item.height = 30; item.maxStack = 999; - item.value = Item.buyPrice(0, 1, 0, 0); + item.value = Item.buyPrice(0, 0, 5, 0); item.rare = 3; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 15f; diff --git a/Items/Weapons/Rogue/Nychthemeron.cs b/Items/Weapons/Rogue/Nychthemeron.cs index a19b55202b..8ac54ed53c 100644 --- a/Items/Weapons/Rogue/Nychthemeron.cs +++ b/Items/Weapons/Rogue/Nychthemeron.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 18; - item.damage = 30; + item.damage = 60; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 20; @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.value = Item.buyPrice(0, 3, 60, 0); item.rare = 6; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 5f; + item.shootSpeed = 6f; item.Calamity().rogue = true; } diff --git a/Items/Weapons/Rogue/Turbulance.cs b/Items/Weapons/Rogue/Turbulance.cs index 811c3fe105..7e3ab46e2b 100644 --- a/Items/Weapons/Rogue/Turbulance.cs +++ b/Items/Weapons/Rogue/Turbulance.cs @@ -20,7 +20,7 @@ Stealth strikes are trailed by homing wind slashes"); public override void SafeSetDefaults() { item.width = 14; - item.damage = 20; + item.damage = 18; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 18; diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 92f1a25581..c65b5fd83c 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -90,7 +90,7 @@ namespace CalamityMod.NPCs int maxGel = Main.expertMode ? 120 : 80; DropHelper.DropItemSpray(npc, ItemID.Gel, minGel, maxGel, 2); - // King Slime doesn't have a lore item yet + DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !NPC.downedSlimeKing); DropHelper.DropResidentEvilAmmo(npc, NPC.downedSlimeKing, 2, 0, 0); } else if (npc.type == NPCID.EyeofCthulhu) @@ -1346,6 +1346,7 @@ namespace CalamityMod.NPCs case NPCID.DarkCaster: DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 20 : 25); + DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 20 : 25); break; case NPCID.BigMimicHallow: diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index 0c20b3b5a6..e7f05636b4 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -277,12 +277,12 @@ namespace CalamityMod.NPCs.TownNPCs shop.item[nextSlot].shopCustomPrice = Item.buyPrice(2, 0, 0, 0); nextSlot++; } - /*if (CalamityWorld.downedProvidence) + if (CalamityWorld.downedProvidence) { shop.item[nextSlot].SetDefaults(ModContent.ItemType()); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(5, 0, 0, 0); nextSlot++; - }*/ + } if (CalamityWorld.buffedEclipse && !CalamityWorld.dragonScalesBought) { shop.item[nextSlot].SetDefaults(ModContent.ItemType()); @@ -290,7 +290,7 @@ namespace CalamityMod.NPCs.TownNPCs nextSlot++; } //:BearWatchingYou: - if (npc.modNPC.TownNPCName() == "Laura") + if (npc.GivenName == "Laura") { shop.item[nextSlot].SetDefaults(ModContent.ItemType()); nextSlot++; diff --git a/Projectiles/Rogue/InfernalKrisProjectile.cs b/Projectiles/Rogue/InfernalKrisProjectile.cs index 4e387d0914..38e2cbbb7d 100644 --- a/Projectiles/Rogue/InfernalKrisProjectile.cs +++ b/Projectiles/Rogue/InfernalKrisProjectile.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.width = 10; projectile.height = 10; projectile.friendly = true; - projectile.penetrate = 5; + projectile.penetrate = 3; projectile.timeLeft = 300; projectile.Calamity().rogue = true; } diff --git a/Projectiles/Rogue/NychthemeronOrb.cs b/Projectiles/Rogue/NychthemeronOrb.cs index 8f426053fa..d454c4dde4 100644 --- a/Projectiles/Rogue/NychthemeronOrb.cs +++ b/Projectiles/Rogue/NychthemeronOrb.cs @@ -27,6 +27,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.penetrate = -1; projectile.timeLeft = 600; projectile.Calamity().rogue = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; } public override void AI() diff --git a/Projectiles/Rogue/NychthemeronProjectile.cs b/Projectiles/Rogue/NychthemeronProjectile.cs index 9c858fd40b..bfaa6e74f4 100644 --- a/Projectiles/Rogue/NychthemeronProjectile.cs +++ b/Projectiles/Rogue/NychthemeronProjectile.cs @@ -45,6 +45,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.velocity = toPlayer; projectile.ai[0] += 0.5f; + projectile.extraUpdates = 1; if (projectile.ai[0] > 20f) { projectile.ai[0] = 20f; diff --git a/Projectiles/Rogue/TurbulanceProjectile.cs b/Projectiles/Rogue/TurbulanceProjectile.cs index 7b548027aa..eb6a4e7283 100644 --- a/Projectiles/Rogue/TurbulanceProjectile.cs +++ b/Projectiles/Rogue/TurbulanceProjectile.cs @@ -60,9 +60,9 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.Calamity().stealthStrike) //Stealth strike { stealthStrikeTimer++; - if (stealthStrikeTimer >= 18) + if (stealthStrikeTimer >= 14) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage / 3, projectile.knockBack / 3, projectile.owner, 1f, 1f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack / 2, projectile.owner, 1f, 1f); stealthStrikeTimer = 0; } } From e0396debec77898fe4605b01b741341b77f64b55 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 13 Dec 2019 19:52:29 -0500 Subject: [PATCH 02/21] reduced shinobi blade stealth spreaed --- Items/Weapons/Rogue/ShinobiBlade.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/ShinobiBlade.cs b/Items/Weapons/Rogue/ShinobiBlade.cs index 9ec1b5ad54..d54227b538 100644 --- a/Items/Weapons/Rogue/ShinobiBlade.cs +++ b/Items/Weapons/Rogue/ShinobiBlade.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - float spreadAngle = MathHelper.ToRadians(10f); + float spreadAngle = MathHelper.ToRadians(7.5f); Vector2 direction = new Vector2(speedX, speedY); Vector2 baseDirection = direction.RotatedBy(-spreadAngle); From 7bad9a77b55fca8e374b2fcd05a0d559f3dbf686 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 13 Dec 2019 23:14:13 -0500 Subject: [PATCH 03/21] terror talons reworked and fixed --- Items/Weapons/Rogue/TerrorTalons.cs | 25 +++++---- Projectiles/Rogue/TalonLargeProj.cs | 10 ++-- Projectiles/Rogue/TalonSmallProj.cs | 80 ++++++++++++++--------------- 3 files changed, 61 insertions(+), 54 deletions(-) diff --git a/Items/Weapons/Rogue/TerrorTalons.cs b/Items/Weapons/Rogue/TerrorTalons.cs index 4db66b9cdb..f840113785 100644 --- a/Items/Weapons/Rogue/TerrorTalons.cs +++ b/Items/Weapons/Rogue/TerrorTalons.cs @@ -8,30 +8,32 @@ namespace CalamityMod.Items.Weapons.Rogue { public class TerrorTalons : RogueWeapon { + private float sign = 1f; + public override void SetStaticDefaults() { DisplayName.SetDefault("Terror Talons"); Tooltip.SetDefault("Fires small wavering claws\n" + - "Stealth strikes launch a bigger, faster claw that flies straight and pierces indefinitely"); + "Stealth strikes launch a large, high speed claw which pierces"); } public override void SafeSetDefaults() { item.width = 40; - item.damage = 103; + item.damage = 54; item.noMelee = true; item.noUseGraphic = true; - item.useAnimation = 11; item.useStyle = 1; - item.useTime = 11; + item.useTime = 7; + item.useAnimation = 7; item.knockBack = 3f; - item.UseSound = SoundID.Item1; + item.UseSound = SoundID.Item39; item.autoReuse = true; item.height = 24; item.value = Item.buyPrice(0, 48, 0, 0); item.rare = 6; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 12.5f; + item.shootSpeed = 10.5f; item.Calamity().rogue = true; } @@ -39,12 +41,17 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - float stealthDamageMult = 1.1f; + float stealthDamageMult = 2.0f; int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * stealthDamageMult), knockBack, player.whoAmI, 0f, 0f); Main.projectile[stealth].Calamity().stealthStrike = true; - return false; } - return true; + else + { + // flip flop every standard projectile + Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, sign); + sign = -sign; + } + return false; } /*public override void AddRecipes() diff --git a/Projectiles/Rogue/TalonLargeProj.cs b/Projectiles/Rogue/TalonLargeProj.cs index be21329979..9dc80be83a 100644 --- a/Projectiles/Rogue/TalonLargeProj.cs +++ b/Projectiles/Rogue/TalonLargeProj.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Rogue { public override void SetStaticDefaults() { - DisplayName.SetDefault("Talon"); + DisplayName.SetDefault("Huge Terror Talon"); ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; ProjectileID.Sets.TrailingMode[projectile.type] = 0; } @@ -21,13 +21,13 @@ namespace CalamityMod.Projectiles.Rogue projectile.width = 20; projectile.height = 20; projectile.friendly = true; - projectile.penetrate = -1; + projectile.penetrate = 10; projectile.tileCollide = false; - projectile.timeLeft = 600; + projectile.timeLeft = 180; projectile.Calamity().rogue = true; - projectile.extraUpdates = 1; + projectile.extraUpdates = 2; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; + projectile.localNPCHitCooldown = -1; } public override void AI() diff --git a/Projectiles/Rogue/TalonSmallProj.cs b/Projectiles/Rogue/TalonSmallProj.cs index 3502f25c8c..e08e5ce3ad 100644 --- a/Projectiles/Rogue/TalonSmallProj.cs +++ b/Projectiles/Rogue/TalonSmallProj.cs @@ -1,22 +1,19 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { public class TalonSmallProj : ModProjectile { - private int x; - private double speed = 10; - private float startSpeedY = 0f; - private bool sign = true; + private static float SineFrequency = 0.05f; + private static float SineAmplitude = 0.008f; + private static float RotationIncrement = 0.26f; public override void SetStaticDefaults() { - DisplayName.SetDefault("Talon"); + DisplayName.SetDefault("Terror Talon"); } public override void SetDefaults() @@ -28,48 +25,51 @@ namespace CalamityMod.Projectiles.Rogue projectile.tileCollide = false; projectile.timeLeft = 600; projectile.Calamity().rogue = true; + + SineFrequency = 0.15f; + SineAmplitude = 0.06f; + RotationIncrement = 0.26f; } public override void AI() { - if (projectile.ai[0] == 0f) //only happens once - { - if (Main.rand.NextBool(2)) - sign = false; - } + // On-spawn effects + if (projectile.ai[0] == 0) + { + // Store the X and Y of the spawn velocity so it can be used for trig calculations + projectile.localAI[0] = projectile.velocity.X; + projectile.localAI[1] = projectile.velocity.Y; + } + + // Doesn't collide with tiles for the first 2 frames + projectile.tileCollide = projectile.ai[0] > 2f; + + // Apply fancy sine movement, then slight gravity, then cap velocity. + // Original velocity is reconstructed so that it can be used in the calculation + Vector2 originalVelocity = new Vector2(projectile.localAI[0], projectile.localAI[1]); + ApplySineVelocity(originalVelocity); + // projectile.velocity.Y += 0.08f; + float currentSpeed = projectile.velocity.Length(); + float maxSpeed = 1.4f * originalVelocity.Length(); + if (currentSpeed > maxSpeed) + projectile.velocity *= maxSpeed / currentSpeed; + + // spawn dust if (Main.rand.Next(5) == 0) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 85, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } - projectile.ai[0]++; - if (projectile.ai[0] > 2f) - { - projectile.tileCollide = true; - } - if (projectile.localAI[0] == 0f) - { - projectile.velocity.X = projectile.velocity.X + (Main.player[projectile.owner].velocity.X * 0.5f); - startSpeedY = projectile.velocity.Y + (Main.player[projectile.owner].velocity.Y * 0.5f); - projectile.velocity.Y = startSpeedY; - } - projectile.localAI[0] += 1f; - if (projectile.localAI[0] >= 5f) - { - if (sign == true) - { - x++; - speed += 0.01; - projectile.velocity.Y = startSpeedY + (float)(speed * Math.Sin(x / 4)); - } - else - { - x++; - speed += 0.01; - projectile.velocity.Y = startSpeedY + (float)(speed * -Math.Sin(x / 4)); - } - } + + // freely spins instead of facing forwards + projectile.rotation += RotationIncrement; projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); - projectile.rotation = projectile.velocity.ToRotation(); + projectile.ai[0]++; + } + + private void ApplySineVelocity(Vector2 baseVelocity) + { + float radians = projectile.ai[1] * (-MathHelper.PiOver2 + SineFrequency * projectile.ai[0]); + projectile.velocity += SineAmplitude * baseVelocity.RotatedBy(radians); } public override void Kill(int timeLeft) From ce807191b060df1f498ce8614ff568deb975cedf Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 13 Dec 2019 23:17:17 -0500 Subject: [PATCH 04/21] reduced infernal kris piercing --- Projectiles/Rogue/InfernalKrisProjectile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Rogue/InfernalKrisProjectile.cs b/Projectiles/Rogue/InfernalKrisProjectile.cs index 38e2cbbb7d..7e733e70e3 100644 --- a/Projectiles/Rogue/InfernalKrisProjectile.cs +++ b/Projectiles/Rogue/InfernalKrisProjectile.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.width = 10; projectile.height = 10; projectile.friendly = true; - projectile.penetrate = 3; + projectile.penetrate = 2; projectile.timeLeft = 300; projectile.Calamity().rogue = true; } From 84d4bd0893b60bbec7f9b00cd7c094a4eab551bd Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 13 Dec 2019 23:20:28 -0500 Subject: [PATCH 05/21] 10 iframes not -1 --- Projectiles/Rogue/TalonLargeProj.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Rogue/TalonLargeProj.cs b/Projectiles/Rogue/TalonLargeProj.cs index 9dc80be83a..69cee8ed1b 100644 --- a/Projectiles/Rogue/TalonLargeProj.cs +++ b/Projectiles/Rogue/TalonLargeProj.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.Calamity().rogue = true; projectile.extraUpdates = 2; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = -1; + projectile.localNPCHitCooldown = 10; } public override void AI() From 5cda4cbac203928be4b4c53f1298eb108d368f70 Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Sat, 14 Dec 2019 02:28:10 -0600 Subject: [PATCH 06/21] Latcher Mines (unobtainable) --- Items/Weapons/Rogue/LatcherMine.cs | 50 ++++ Items/Weapons/Rogue/LatcherMine.png | Bin 0 -> 538 bytes Projectiles/Rogue/BarrelShrapnel.cs | 17 +- Projectiles/Rogue/BouncingBettyProjectile.cs | 1 - Projectiles/Rogue/BouncingBettyShrapnel.cs | 7 +- Projectiles/Rogue/LatcherMineProjectile.cs | 231 +++++++++++++++++++ Projectiles/Rogue/LatcherMineProjectile.png | Bin 0 -> 470 bytes 7 files changed, 299 insertions(+), 7 deletions(-) create mode 100644 Items/Weapons/Rogue/LatcherMine.cs create mode 100644 Items/Weapons/Rogue/LatcherMine.png create mode 100644 Projectiles/Rogue/LatcherMineProjectile.cs create mode 100644 Projectiles/Rogue/LatcherMineProjectile.png diff --git a/Items/Weapons/Rogue/LatcherMine.cs b/Items/Weapons/Rogue/LatcherMine.cs new file mode 100644 index 0000000000..3d2b857dc8 --- /dev/null +++ b/Items/Weapons/Rogue/LatcherMine.cs @@ -0,0 +1,50 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class LatcherMine : RogueWeapon + { + public const int BaseDamage = 50; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Latcher Mine"); + Tooltip.SetDefault("Sticks to enemies on hit and detonates after 3 seconds.\n" + + "Breaks upon hitting blocks\n" + + "Stealth Strike Effect: On explosion, fire and shrapnel are released\n" + + "Stealth strike mines can stick to the ground and last much longer when doing so"); + } + + public override void SafeSetDefaults() + { + item.height = 32; + item.width = 26; + item.damage = BaseDamage; + item.noMelee = true; + item.consumable = true; + item.noUseGraphic = true; + item.useAnimation = item.useTime = 15; + item.useStyle = ItemUseStyleID.SwingThrow; + item.knockBack = 6f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.maxStack = 999; + item.value = Item.buyPrice(0, 0, 3, 0); + item.rare = 5; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + 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) + { + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + Main.projectile[stealth].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + } +} diff --git a/Items/Weapons/Rogue/LatcherMine.png b/Items/Weapons/Rogue/LatcherMine.png new file mode 100644 index 0000000000000000000000000000000000000000..ff63f84b56b51bcb78fc7ef19f6ac150f2ac6d55 GIT binary patch literal 538 zcmV+#0_FXQP)! z!7f8V6o$W{P1^-GNR{MXY!I8qMtFigfOr6jSa=BwFJU1P4Sf$=H?B%2DHhhsN#DqYv zx5;=zM9G7Tgb?AMmZprcO-AC33P$yBoY98-#~Re9|5K%I1a_UV4*xblI+s@96A_z)t!!ZefXRX$ zM=O~`Ki4`@qjqJCZ8F{vQN#IS;%zE#JU2fMz~t1lF&~aai2ex4-t6~GIn1PxvEMs{B2$&eWUfNJFs_m zjapt^17K%s6EJRJz_^2ctS(nIq%yrKUT@g_|3Y&qp{hi#>Pn31`g#}rA0oC~)#a*& cZsiS;4;16L(}>!NV*mgE07*qoM6N<$f& false; - public override void AI() { - if (projectile.velocity != Vector2.Zero) + projectile.ai[0] += 1f; + if (hitTile) + { + projectile.velocity.X = 0f; + projectile.rotation = MathHelper.Pi; + } + else { projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; } projectile.velocity.Y += 0.2f; } + public override bool OnTileCollide(Vector2 oldVelocity) + { + hitTile = true; + return false; + } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.OnFire, 60 * 4); diff --git a/Projectiles/Rogue/BouncingBettyProjectile.cs b/Projectiles/Rogue/BouncingBettyProjectile.cs index 9b7e588785..08a94f8012 100644 --- a/Projectiles/Rogue/BouncingBettyProjectile.cs +++ b/Projectiles/Rogue/BouncingBettyProjectile.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Rogue private void Explode() { Main.PlaySound(2, projectile.Center, 14); - //This is definitely not a near copy of the Blast Barrel nosiree :> bool stealthS = projectile.Calamity().stealthStrike; Projectile.NewProjectile(projectile.Center, new Vector2(0f, 0f), ModContent.ProjectileType(), projectile.damage, 8f, projectile.owner); if (stealthS) diff --git a/Projectiles/Rogue/BouncingBettyShrapnel.cs b/Projectiles/Rogue/BouncingBettyShrapnel.cs index 8422f39467..0d82d1f9ec 100644 --- a/Projectiles/Rogue/BouncingBettyShrapnel.cs +++ b/Projectiles/Rogue/BouncingBettyShrapnel.cs @@ -1,6 +1,6 @@ using Microsoft.Xna.Framework; +using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue @@ -27,13 +27,14 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (projectile.velocity != Vector2.Zero) + if (Math.Abs(projectile.position.Y - projectile.oldPosition.Y) > 4f) { + projectile.velocity.X = 0f; projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; } else { - projectile.rotation = MathHelper.PiOver2; + projectile.rotation = MathHelper.Pi; } projectile.velocity.Y += 0.2f; } diff --git a/Projectiles/Rogue/LatcherMineProjectile.cs b/Projectiles/Rogue/LatcherMineProjectile.cs new file mode 100644 index 0000000000..d344d02ecd --- /dev/null +++ b/Projectiles/Rogue/LatcherMineProjectile.cs @@ -0,0 +1,231 @@ +using CalamityMod.Items.Weapons.Rogue; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class LatcherMineProjectile : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Latcher Mine"); + Main.projFrames[projectile.type] = 4; + } + + public override void SetDefaults() + { + projectile.width = 27; + projectile.height = 15; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.scale = 1.5f; + projectile.alpha = 0; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + if (projectile.ai[0] == 0f) + { + projectile.rotation += (projectile.velocity.X > 0) ? 0.3f : -0.3f; + if (projectile.velocity.Y < 7f) + { + projectile.velocity.Y += 0.24f; + } + } + if (projectile.ai[0] == 1f) + { + projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2; + projectile.tileCollide = false; + int secondsToLive = (projectile.Calamity().stealthStrike ? 14 : 6); + bool readyToKillSelf = false; + //There was something along the lines of "var_2_2CB4E_cp_0" doing this exact iterative expression, but in 4 times as many lines and barely decipherable variables and copies of arrays. + //*shudder* + projectile.localAI[0] += 1f; + if (projectile.localAI[0] >= (float)(60 * secondsToLive)) + { + readyToKillSelf = true; + } + else if ((int)projectile.ai[1] < 0 || (int)projectile.ai[1] >= 200) + { + readyToKillSelf = true; + } + else if (Main.npc[(int)projectile.ai[1]].active && !Main.npc[(int)projectile.ai[1]].dontTakeDamage) + { + projectile.Center = Main.npc[(int)projectile.ai[1]].Center - projectile.velocity * 2f; + projectile.gfxOffY = Main.npc[(int)projectile.ai[1]].gfxOffY; + projectile.timeLeft = (int)MathHelper.Min(projectile.timeLeft, 120); + } + else + { + readyToKillSelf = true; + } + if (readyToKillSelf) + { + projectile.Kill(); + } + if (projectile.timeLeft == 1) + { + projectile.Kill(); + } + } + if (projectile.ai[0] == 2f) + { + projectile.velocity = Vector2.UnitY * 3f; + projectile.rotation = 0f; + } + if (projectile.timeLeft == 110 * (projectile.Calamity().stealthStrike ? 2 : 1) || + projectile.timeLeft == 60 * (projectile.Calamity().stealthStrike ? 2 : 1) || + projectile.timeLeft == 24 * (projectile.Calamity().stealthStrike ? 2 : 1)) + { + projectile.frame++; + } + if (projectile.timeLeft < 24 * (projectile.Calamity().stealthStrike ? 2 : 1)) + { + projectile.frameCounter += 1; + if (projectile.frameCounter % 2 == 1) + { + projectile.frame += 1; + if (projectile.frame >= 4) + { + projectile.frame = 0; + } + } + } + } + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (projectile.Calamity().stealthStrike) + { + projectile.height = 10; + if (projectile.localAI[1] == 0f) + { + projectile.timeLeft = 14 * 60; + projectile.localAI[1] = 1f; + } + projectile.ai[0] = 2f; + } + return !projectile.Calamity().stealthStrike; + } + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < Main.npc.Length; i++) + { + if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) + { + if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) + { + bool colliding; + if (Main.npc[i].type == NPCID.SolarCrawltipedeTail) + { + Rectangle rect = Main.npc[i].getRect(); + rect.X -= 8; + rect.Y -= 8; + rect.Width += 16; + rect.Height += 16; + colliding = projectile.Colliding(myRect, rect); + } + else + { + colliding = projectile.Colliding(myRect, Main.npc[i].getRect()); + } + if (colliding) + { + if (Main.npc[i].reflectingProjectiles && projectile.CanReflect()) + { + Main.npc[i].ReflectProjectile(projectile.whoAmI); + return; + } + projectile.ai[0] = 1f; + projectile.ai[1] = (float)i; + projectile.velocity = (Main.npc[i].Center - projectile.Center) * 0.75f; + projectile.netUpdate = true; + projectile.StatusNPC(i); + projectile.damage = 0; + const int maxNumberOfMines = 6; + Point[] otherMinesArray = new Point[maxNumberOfMines]; + int otherMinesIndex = 0; + for (int l = 0; l < Main.projectile.Length; l++) + { + if (l != projectile.whoAmI && Main.projectile[l].active && + Main.projectile[l].owner == Main.myPlayer && + Main.projectile[l].type == projectile.type && + Main.projectile[l].ai[0] == 1f && + Main.projectile[l].ai[1] == (float)i) + { + otherMinesArray[otherMinesIndex++] = new Point(l, Main.projectile[l].timeLeft); + if (otherMinesIndex >= otherMinesArray.Length) + { + break; + } + } + } + if (otherMinesIndex >= otherMinesArray.Length) + { + int idx = 0; + for (int m = 1; m < otherMinesArray.Length; m++) + { + if (otherMinesArray[m].Y < otherMinesArray[idx].Y) + { + idx = m; + } + } + Main.projectile[otherMinesArray[idx].X].Kill(); + } + } + } + } + } + } + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (targetHitbox.Width > 8 && targetHitbox.Height > 8) + { + targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); + } + return null; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); + projectile.position = projectile.Center; + projectile.width = projectile.height = (projectile.Calamity().stealthStrike ? 240 : 100); + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.Damage(); + for (int i = 0; i < 6; i++) + { + if (Main.rand.NextBool(2) && projectile.Calamity().stealthStrike) + { + Vector2 shrapnelVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(40f)); + Projectile.NewProjectile(projectile.Top, shrapnelVelocity, + ModContent.ProjectileType(), LatcherMine.BaseDamage, 3f, projectile.owner); + } + else + { + Vector2 fireVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(40f)); + int fireIndex = Projectile.NewProjectile(projectile.Top, fireVelocity, + Main.rand.Next(ProjectileID.MolotovFire, ProjectileID.MolotovFire3 + 1), + LatcherMine.BaseDamage, 1f, projectile.owner); + Main.projectile[fireIndex].Calamity().forceRogue = true; + Main.projectile[fireIndex].penetrate = -1; + Main.projectile[fireIndex].usesLocalNPCImmunity = true; + Main.projectile[fireIndex].localNPCHitCooldown = 8; + } + } + } + } +} diff --git a/Projectiles/Rogue/LatcherMineProjectile.png b/Projectiles/Rogue/LatcherMineProjectile.png new file mode 100644 index 0000000000000000000000000000000000000000..d54b9166bb0bfd566be4925e10fa19a1b2b2c889 GIT binary patch literal 470 zcmV;{0V)28P)O&?}CG-wy#26)IML*bIQ*mYr+#M}JQYVAu;L z8CDz%&F_bpE3zHq)$ literal 0 HcmV?d00001 From 28863e9125693c5f792a9fe2e424e82eb4cfcc48 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 14 Dec 2019 08:27:30 -0500 Subject: [PATCH 07/21] weapon balancing --- Items/Weapons/Ranged/TheBallista.cs | 6 +++--- Items/Weapons/Rogue/InfernalKris.cs | 4 ++-- Items/Weapons/Rogue/Nychthemeron.cs | 22 +++++++++++----------- Items/Weapons/Rogue/PoisonPack.cs | 2 +- Items/Weapons/Rogue/TerrorTalons.cs | 2 +- Items/Weapons/Rogue/Turbulance.cs | 4 ++-- Projectiles/Ranged/BallistaGreatArrow.cs | 4 ++-- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Items/Weapons/Ranged/TheBallista.cs b/Items/Weapons/Ranged/TheBallista.cs index 0d2a6b55ed..be663e605b 100644 --- a/Items/Weapons/Ranged/TheBallista.cs +++ b/Items/Weapons/Ranged/TheBallista.cs @@ -16,12 +16,12 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 106; + item.damage = 90; item.ranged = true; item.width = 40; item.height = 70; - item.useTime = 20; - item.useAnimation = 20; + item.useTime = 22; + item.useAnimation = 22; item.useStyle = 5; item.noMelee = true; item.knockBack = 8f; diff --git a/Items/Weapons/Rogue/InfernalKris.cs b/Items/Weapons/Rogue/InfernalKris.cs index 2b2893c5db..3809a131e7 100644 --- a/Items/Weapons/Rogue/InfernalKris.cs +++ b/Items/Weapons/Rogue/InfernalKris.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Rogue return true; } - /*public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.HellstoneBar); @@ -56,6 +56,6 @@ namespace CalamityMod.Items.Weapons.Rogue recipe.AddTile(TileID.Anvils); recipe.SetResult(this, 100); recipe.AddRecipe(); - }*/ + } } } diff --git a/Items/Weapons/Rogue/Nychthemeron.cs b/Items/Weapons/Rogue/Nychthemeron.cs index 183663667f..4367a0e180 100644 --- a/Items/Weapons/Rogue/Nychthemeron.cs +++ b/Items/Weapons/Rogue/Nychthemeron.cs @@ -84,17 +84,17 @@ namespace CalamityMod.Items.Weapons.Rogue return player.ownedProjectileCounts[item.shoot] < item.stack && player.altFunctionUse != 2; } - //public override void AddRecipes() - //{ - // ModRecipe recipe = new ModRecipe(mod); - // recipe.AddIngredient(ItemID.SpikyBall, 15); - // recipe.AddIngredient(ItemID.LightShard); - // recipe.AddIngredient(ItemID.DarkShard); - // recipe.AddIngredient(ItemID.HallowedBar, 2); - // recipe.AddTile(TileID.Anvils); - // recipe.SetResult(this); - // recipe.AddRecipe(); - //} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpikyBall, 30); + recipe.AddIngredient(ItemID.LightShard); + recipe.AddIngredient(ItemID.DarkShard); + recipe.AddIngredient(ItemID.HallowedBar, 2); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } private static void CreateOrbs(Vector2 position, int damage, float knockBack, int projectileID, Player player) { diff --git a/Items/Weapons/Rogue/PoisonPack.cs b/Items/Weapons/Rogue/PoisonPack.cs index 66a6dc526f..aff9ab53ca 100644 --- a/Items/Weapons/Rogue/PoisonPack.cs +++ b/Items/Weapons/Rogue/PoisonPack.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Rogue { public class PoisonPack : RogueWeapon { - private static int damage = 35; + private static int damage = 20; private static float knockBack = 1.8f; public override void SetStaticDefaults() diff --git a/Items/Weapons/Rogue/TerrorTalons.cs b/Items/Weapons/Rogue/TerrorTalons.cs index f840113785..1db6b061d4 100644 --- a/Items/Weapons/Rogue/TerrorTalons.cs +++ b/Items/Weapons/Rogue/TerrorTalons.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 40; - item.damage = 54; + item.damage = 47; item.noMelee = true; item.noUseGraphic = true; item.useStyle = 1; diff --git a/Items/Weapons/Rogue/Turbulance.cs b/Items/Weapons/Rogue/Turbulance.cs index 7e3ab46e2b..33af5d8363 100644 --- a/Items/Weapons/Rogue/Turbulance.cs +++ b/Items/Weapons/Rogue/Turbulance.cs @@ -48,7 +48,7 @@ Stealth strikes are trailed by homing wind slashes"); return true; } - /*public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); @@ -57,6 +57,6 @@ Stealth strikes are trailed by homing wind slashes"); recipe.AddTile(TileID.SkyMill); recipe.SetResult(this); recipe.AddRecipe(); - }*/ + } } } diff --git a/Projectiles/Ranged/BallistaGreatArrow.cs b/Projectiles/Ranged/BallistaGreatArrow.cs index 50060023f2..8d18430c0b 100644 --- a/Projectiles/Ranged/BallistaGreatArrow.cs +++ b/Projectiles/Ranged/BallistaGreatArrow.cs @@ -54,8 +54,8 @@ namespace CalamityMod.Projectiles.Ranged for (i = 0; i < 3; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)((double)projectile.damage * 0.3f), projectile.knockBack, projectile.owner, 0f, 0f); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)((double)projectile.damage * 0.3f), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)((double)projectile.damage * 0.2f), projectile.knockBack / 5, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)((double)projectile.damage * 0.2f), projectile.knockBack / 5, projectile.owner, 0f, 0f); } } } From 43199c51e3ea12eef52e8ec193eb3c4ccddb0820 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 14 Dec 2019 08:27:51 -0500 Subject: [PATCH 08/21] fixed latcher mines doing flat dmg --- Projectiles/Rogue/LatcherMineProjectile.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Projectiles/Rogue/LatcherMineProjectile.cs b/Projectiles/Rogue/LatcherMineProjectile.cs index d344d02ecd..dc4930fa9e 100644 --- a/Projectiles/Rogue/LatcherMineProjectile.cs +++ b/Projectiles/Rogue/LatcherMineProjectile.cs @@ -205,6 +205,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.width = projectile.height = (projectile.Calamity().stealthStrike ? 240 : 100); projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; projectile.Damage(); for (int i = 0; i < 6; i++) { @@ -212,14 +214,14 @@ namespace CalamityMod.Projectiles.Rogue { Vector2 shrapnelVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(40f)); Projectile.NewProjectile(projectile.Top, shrapnelVelocity, - ModContent.ProjectileType(), LatcherMine.BaseDamage, 3f, projectile.owner); + ModContent.ProjectileType(), projectile.damage, 3f, projectile.owner); } else { Vector2 fireVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(40f)); int fireIndex = Projectile.NewProjectile(projectile.Top, fireVelocity, Main.rand.Next(ProjectileID.MolotovFire, ProjectileID.MolotovFire3 + 1), - LatcherMine.BaseDamage, 1f, projectile.owner); + projectile.damage, 1f, projectile.owner); Main.projectile[fireIndex].Calamity().forceRogue = true; Main.projectile[fireIndex].penetrate = -1; Main.projectile[fireIndex].usesLocalNPCImmunity = true; From 9fac5dd49c3be19783efc9a3f46d85a874f55620 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 14 Dec 2019 09:33:18 -0500 Subject: [PATCH 09/21] buffed star of destruction a bit --- Items/Weapons/Rogue/StarofDestruction.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/StarofDestruction.cs b/Items/Weapons/Rogue/StarofDestruction.cs index 17fef1d3e8..803ad072e4 100644 --- a/Items/Weapons/Rogue/StarofDestruction.cs +++ b/Items/Weapons/Rogue/StarofDestruction.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 86; - item.damage = 150; + item.damage = 175; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 38; From d00012ff6111ae0dd638e9724d6e5d05f14c42cf Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 14 Dec 2019 10:48:12 -0500 Subject: [PATCH 10/21] made wyvern's call obtainable --- Items/Weapons/Magic/WyvernsCall.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Magic/WyvernsCall.cs b/Items/Weapons/Magic/WyvernsCall.cs index 299416db6b..30cea4dc31 100644 --- a/Items/Weapons/Magic/WyvernsCall.cs +++ b/Items/Weapons/Magic/WyvernsCall.cs @@ -115,7 +115,7 @@ Fires wyverns and colored feathers from the sky that stick to enemies and tiles return false; } - /*public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.SoulofFlight, 15); @@ -124,6 +124,6 @@ Fires wyverns and colored feathers from the sky that stick to enemies and tiles recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); - }*/ + } } } From b490f87812bfd9c0562815bd2933c62e05df667a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 14 Dec 2019 11:04:03 -0500 Subject: [PATCH 11/21] xeroc armor tweak --- Items/Weapons/Magic/WyvernsCall.cs | 1 + Projectiles/CalamityGlobalProjectile.cs | 402 ++++++++++++------------ 2 files changed, 202 insertions(+), 201 deletions(-) diff --git a/Items/Weapons/Magic/WyvernsCall.cs b/Items/Weapons/Magic/WyvernsCall.cs index 30cea4dc31..a5d115e18f 100644 --- a/Items/Weapons/Magic/WyvernsCall.cs +++ b/Items/Weapons/Magic/WyvernsCall.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using System; using Terraria; diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index e61523dd45..730cc5e7b2 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1146,89 +1146,6 @@ namespace CalamityMod.Projectiles Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, projectile.owner, (float)num14, num12); } } - else if (Main.player[projectile.owner].Calamity().xerocSet && Main.player[projectile.owner].Calamity().xerocDmg <= 0) - { - int num = projectile.damage / 2; - Main.player[projectile.owner].Calamity().xerocDmg += (float)num; - int[] array = new int[200]; - int num3 = 0; - int num4 = 0; - for (int i = 0; i < 200; i++) - { - if (Main.npc[i].CanBeChasedBy(projectile, false)) - { - float num5 = Math.Abs(Main.npc[i].position.X + (float)(Main.npc[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); - if (num5 < 800f) - { - if (Collision.CanHit(projectile.position, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height) && num5 > 50f) - { - array[num4] = i; - num4++; - } - else if (num4 == 0) - { - array[num3] = i; - num3++; - } - } - } - } - if (num3 == 0 && num4 == 0) - { - return; - } - int num6; - if (num4 > 0) - { - num6 = array[Main.rand.Next(num4)]; - } - else - { - num6 = array[Main.rand.Next(num3)]; - } - float num7 = 30f; - float num8 = (float)Main.rand.Next(-100, 101); - float num9 = (float)Main.rand.Next(-100, 101); - float num10 = (float)Math.Sqrt((double)(num8 * num8 + num9 * num9)); - num10 = num7 / num10; - num8 *= num10; - num9 *= num10; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, ModContent.ProjectileType(), (int)((double)num * 1.25), 0f, projectile.owner, (float)num6, 0f); - if (target.canGhostHeal) - { - if (Main.player[Main.myPlayer].lifeSteal <= 0f) - { - return; - } - float num11 = 0.1f; - num11 -= (float)projectile.numHits * 0.05f; - if (num11 <= 0f) - { - return; - } - float num12 = (float)projectile.damage * num11; - if ((int)num12 <= 0) - { - return; - } - Main.player[Main.myPlayer].lifeSteal -= num12 * 1.5f; - float num13 = 0f; - int num14 = projectile.owner; - for (int i = 0; i < 255; i++) - { - if (Main.player[i].active && !Main.player[i].dead && ((!Main.player[projectile.owner].hostile && !Main.player[i].hostile) || Main.player[projectile.owner].team == Main.player[i].team)) - { - float num15 = Math.Abs(Main.player[i].position.X + (float)(Main.player[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.player[i].position.Y + (float)(Main.player[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); - if (num15 < 1200f && (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife) > num13) - { - num13 = (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife); - num14 = i; - } - } - } - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, projectile.owner, (float)num14, num12); - } - } else if (Main.player[projectile.owner].Calamity().godSlayerMage && Main.player[projectile.owner].Calamity().godSlayerDmg <= 0) { int num = projectile.damage / 2; @@ -1325,79 +1242,211 @@ namespace CalamityMod.Projectiles } Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), newDamage, 0f, projectile.owner, 0f, 0f); } - else if (Main.player[projectile.owner].Calamity().xerocSet && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 3) - { - int newDamage = (int)((double)projectile.damage * 0.2); - if (newDamage > 40) - { - newDamage = 40; - } - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), newDamage, 0f, projectile.owner, 0f, 0f); - } - } - else if (projectile.ranged) - { - if (Main.player[projectile.owner].Calamity().xerocSet && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 3) - { - int newDamage = (int)((double)projectile.damage * 0.15); - if (newDamage > 40) - { - newDamage = 40; - } - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), newDamage, 0f, projectile.owner, 0f, 0f); - } } else if (rogue) { - if (Main.player[projectile.owner].Calamity().xerocSet && Main.player[projectile.owner].Calamity().xerocDmg <= 0) + if (Main.player[projectile.owner].Calamity().xerocSet && Main.player[projectile.owner].Calamity().xerocDmg <= 0 && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 3 && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()] < 3) { - int num = projectile.damage / 2; - Main.player[projectile.owner].Calamity().xerocDmg += (float)num; - int[] array = new int[200]; - int num3 = 0; - int num4 = 0; - for (int i = 0; i < 200; i++) - { - if (Main.npc[i].CanBeChasedBy(projectile, false)) - { - float num5 = Math.Abs(Main.npc[i].position.X + (float)(Main.npc[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); - if (num5 < 800f) - { - if (Collision.CanHit(projectile.position, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height) && num5 > 50f) - { - array[num4] = i; - num4++; - } - else if (num4 == 0) - { - array[num3] = i; - num3++; - } - } - } - } - if (num3 == 0 && num4 == 0) - { - return; - } - int num6; - if (num4 > 0) - { - num6 = array[Main.rand.Next(num4)]; - } - else - { - num6 = array[Main.rand.Next(num3)]; - } - float num7 = Main.rand.Next(15, 30); - float num8 = (float)Main.rand.Next(-100, 101); - float num9 = (float)Main.rand.Next(-100, 101); - float num10 = (float)Math.Sqrt((double)(num8 * num8 + num9 * num9)); - num10 = num7 / num10; - num8 *= num10; - num9 *= num10; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, ModContent.ProjectileType(), (int)((double)num * 1.6), 0f, projectile.owner, (float)num6, 0f); - } + if (Main.rand.NextBool(5)) + { + int num = projectile.damage / 2; + Main.player[projectile.owner].Calamity().xerocDmg += (float)num; + int[] array = new int[200]; + int num3 = 0; + int num4 = 0; + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].CanBeChasedBy(projectile, false)) + { + float num5 = Math.Abs(Main.npc[i].position.X + (float)(Main.npc[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); + if (num5 < 800f) + { + if (Collision.CanHit(projectile.position, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height) && num5 > 50f) + { + array[num4] = i; + num4++; + } + else if (num4 == 0) + { + array[num3] = i; + num3++; + } + } + } + } + if (num3 == 0 && num4 == 0) + { + return; + } + int num6; + if (num4 > 0) + { + num6 = array[Main.rand.Next(num4)]; + } + else + { + num6 = array[Main.rand.Next(num3)]; + } + float num7 = Main.rand.Next(15, 30); + float num8 = (float)Main.rand.Next(-100, 101); + float num9 = (float)Main.rand.Next(-100, 101); + float num10 = (float)Math.Sqrt((double)(num8 * num8 + num9 * num9)); + num10 = num7 / num10; + num8 *= num10; + num9 *= num10; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, ModContent.ProjectileType(), (int)((double)num * 1.6), 0f, projectile.owner, (float)num6, 0f); + } + else if (Main.rand.NextBool(4)) + { + int num = projectile.damage / 2; + Main.player[projectile.owner].Calamity().xerocDmg += (float)num; + int[] array = new int[200]; + int num3 = 0; + int num4 = 0; + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].CanBeChasedBy(projectile, false)) + { + float num5 = Math.Abs(Main.npc[i].position.X + (float)(Main.npc[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); + if (num5 < 800f) + { + if (Collision.CanHit(projectile.position, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height) && num5 > 50f) + { + array[num4] = i; + num4++; + } + else if (num4 == 0) + { + array[num3] = i; + num3++; + } + } + } + } + if (num3 == 0 && num4 == 0) + { + return; + } + int num6; + if (num4 > 0) + { + num6 = array[Main.rand.Next(num4)]; + } + else + { + num6 = array[Main.rand.Next(num3)]; + } + float num7 = 30f; + float num8 = (float)Main.rand.Next(-100, 101); + float num9 = (float)Main.rand.Next(-100, 101); + float num10 = (float)Math.Sqrt((double)(num8 * num8 + num9 * num9)); + num10 = num7 / num10; + num8 *= num10; + num9 *= num10; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, ModContent.ProjectileType(), (int)((double)num * 1.25), 0f, projectile.owner, (float)num6, 0f); + if (target.canGhostHeal) + { + if (Main.player[Main.myPlayer].lifeSteal <= 0f) + { + return; + } + float num11 = 0.1f; + num11 -= (float)projectile.numHits * 0.05f; + if (num11 <= 0f) + { + return; + } + float num12 = (float)projectile.damage * num11; + if ((int)num12 <= 0) + { + return; + } + Main.player[Main.myPlayer].lifeSteal -= num12 * 1.5f; + float num13 = 0f; + int num14 = projectile.owner; + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && !Main.player[i].dead && ((!Main.player[projectile.owner].hostile && !Main.player[i].hostile) || Main.player[projectile.owner].team == Main.player[i].team)) + { + float num15 = Math.Abs(Main.player[i].position.X + (float)(Main.player[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.player[i].position.Y + (float)(Main.player[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); + if (num15 < 1200f && (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife) > num13) + { + num13 = (float)(Main.player[i].statLifeMax2 - Main.player[i].statLife); + num14 = i; + } + } + } + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, projectile.owner, (float)num14, num12); + } + } + else if (Main.rand.NextBool(3)) + { + int newDamage = (int)((double)projectile.damage * 0.15); + if (newDamage > 40) + { + newDamage = 40; + } + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), newDamage, 0f, projectile.owner, 0f, 0f); + } + else if (Main.rand.NextBool(2)) + { + int newDamage = (int)((double)projectile.damage * 0.2); + if (newDamage > 40) + { + newDamage = 40; + } + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), newDamage, 0f, projectile.owner, 0f, 0f); + } + else + { + int num = projectile.damage / 2; + Main.player[projectile.owner].Calamity().xerocDmg += (float)num; + int[] array = new int[200]; + int num3 = 0; + int num4 = 0; + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].CanBeChasedBy(projectile, false)) + { + float num5 = Math.Abs(Main.npc[i].position.X + (float)(Main.npc[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); + if (num5 < 800f) + { + if (Collision.CanHit(projectile.position, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height) && num5 > 50f) + { + array[num4] = i; + num4++; + } + else if (num4 == 0) + { + array[num3] = i; + num3++; + } + } + } + } + if (num3 == 0 && num4 == 0) + { + return; + } + int num6; + if (num4 > 0) + { + num6 = array[Main.rand.Next(num4)]; + } + else + { + num6 = array[Main.rand.Next(num3)]; + } + float num7 = 15f; + float num8 = (float)Main.rand.Next(-100, 101); + float num9 = (float)Main.rand.Next(-100, 101); + float num10 = (float)Math.Sqrt((double)(num8 * num8 + num9 * num9)); + num10 = num7 / num10; + num8 *= num10; + num9 *= num10; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, ModContent.ProjectileType(), (int)((double)num * 1.2), 0f, projectile.owner, (float)num6, 0f); + } + } Player playerC = Main.player[projectile.owner]; if (playerC.Calamity().featherCrown && stealthStrike && playerC.Calamity().featherCrownCooldown <= 0) { @@ -1492,55 +1541,6 @@ namespace CalamityMod.Projectiles num9 *= num10; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, ModContent.ProjectileType(), (int)((double)num * 2.0), 0f, projectile.owner, 0f, ai1); } - else if (Main.player[projectile.owner].Calamity().xerocSet && Main.player[projectile.owner].Calamity().xerocDmg <= 0) - { - int num = projectile.damage / 2; - Main.player[projectile.owner].Calamity().xerocDmg += (float)num; - int[] array = new int[200]; - int num3 = 0; - int num4 = 0; - for (int i = 0; i < 200; i++) - { - if (Main.npc[i].CanBeChasedBy(projectile, false)) - { - float num5 = Math.Abs(Main.npc[i].position.X + (float)(Main.npc[i].width / 2) - projectile.position.X + (float)(projectile.width / 2)) + Math.Abs(Main.npc[i].position.Y + (float)(Main.npc[i].height / 2) - projectile.position.Y + (float)(projectile.height / 2)); - if (num5 < 800f) - { - if (Collision.CanHit(projectile.position, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height) && num5 > 50f) - { - array[num4] = i; - num4++; - } - else if (num4 == 0) - { - array[num3] = i; - num3++; - } - } - } - } - if (num3 == 0 && num4 == 0) - { - return; - } - int num6; - if (num4 > 0) - { - num6 = array[Main.rand.Next(num4)]; - } - else - { - num6 = array[Main.rand.Next(num3)]; - } - float num7 = 15f; - float num8 = (float)Main.rand.Next(-100, 101); - float num9 = (float)Main.rand.Next(-100, 101); - float num10 = (float)Math.Sqrt((double)(num8 * num8 + num9 * num9)); - num10 = num7 / num10; - num8 *= num10; - num9 *= num10; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, ModContent.ProjectileType(), (int)((double)num * 1.2), 0f, projectile.owner, (float)num6, 0f); - } } } } From f897f857b6cbe19488728ae855bcb79ebb325c19 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 14 Dec 2019 11:04:47 -0500 Subject: [PATCH 12/21] terror talons made obtainable/Stealth strike buff --- Items/Weapons/Rogue/TerrorTalons.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Rogue/TerrorTalons.cs b/Items/Weapons/Rogue/TerrorTalons.cs index 1db6b061d4..3c5e2f1516 100644 --- a/Items/Weapons/Rogue/TerrorTalons.cs +++ b/Items/Weapons/Rogue/TerrorTalons.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - float stealthDamageMult = 2.0f; + float stealthDamageMult = 3.25f; int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * stealthDamageMult), knockBack, player.whoAmI, 0f, 0f); Main.projectile[stealth].Calamity().stealthStrike = true; } @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Rogue return false; } - /*public override void AddRecipes() + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.FeralClaws); @@ -63,6 +63,6 @@ namespace CalamityMod.Items.Weapons.Rogue recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); - }*/ + } } } From 79e1840ac0c74c13a049041fbb17be3de2fde0aa Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 14 Dec 2019 12:47:25 -0500 Subject: [PATCH 13/21] buffed stem cells --- Items/CalamityGlobalItem.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 7d0d8d81a5..f22cfbbded 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -292,6 +292,8 @@ namespace CalamityMod.Items { double damageMult = 1.0; damageMult = (double)(item.useTime) / 30.0; + if (damageMult < 0.35) + damageMult = 0.35; double newDamage = (double)damage * 2 * damageMult; From aee1b53608fce3b2cca1bf3e5699e9af6425052c Mon Sep 17 00:00:00 2001 From: Shucks Date: Sat, 14 Dec 2019 16:51:19 -0600 Subject: [PATCH 14/21] crimslime and gael nerf --- Items/Weapons/Melee/GaelsGreatsword.cs | 2 +- Items/Weapons/Summon/CorroslimeStaff.cs | 2 +- Items/Weapons/Summon/CrimslimeStaff.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Melee/GaelsGreatsword.cs b/Items/Weapons/Melee/GaelsGreatsword.cs index a36466a014..cf5b603291 100644 --- a/Items/Weapons/Melee/GaelsGreatsword.cs +++ b/Items/Weapons/Melee/GaelsGreatsword.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee //Weapon attribute constants - public static readonly int BaseDamage = 11145; + public static readonly int BaseDamage = 5900; public static readonly float TrueMeleeBoost = 2.5f; diff --git a/Items/Weapons/Summon/CorroslimeStaff.cs b/Items/Weapons/Summon/CorroslimeStaff.cs index 7c5f6132f5..df2b11eff5 100644 --- a/Items/Weapons/Summon/CorroslimeStaff.cs +++ b/Items/Weapons/Summon/CorroslimeStaff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 26; + item.damage = 24; item.mana = 10; item.width = 50; item.height = 50; diff --git a/Items/Weapons/Summon/CrimslimeStaff.cs b/Items/Weapons/Summon/CrimslimeStaff.cs index 7aebcdd100..9798c1fea6 100644 --- a/Items/Weapons/Summon/CrimslimeStaff.cs +++ b/Items/Weapons/Summon/CrimslimeStaff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 26; + item.damage = 24; item.mana = 10; item.width = 50; item.height = 50; From d180cce7e656addc9e48fa6722f3d59d2a6fbef8 Mon Sep 17 00:00:00 2001 From: Shucks Date: Sat, 14 Dec 2019 17:00:39 -0600 Subject: [PATCH 15/21] Nerfed consecrated water too --- Items/Weapons/Rogue/ConsecratedWater.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/ConsecratedWater.cs b/Items/Weapons/Rogue/ConsecratedWater.cs index 134659b1b5..de240b70ad 100644 --- a/Items/Weapons/Rogue/ConsecratedWater.cs +++ b/Items/Weapons/Rogue/ConsecratedWater.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Items.Weapons.Rogue { public class ConsecratedWater : RogueWeapon { - public const int BaseDamage = 55; + public const int BaseDamage = 48; public override void SetStaticDefaults() { DisplayName.SetDefault("Consecrated Water"); From 4d0c0b722492ebabb07ff4ce5a76ed68f2c93ea8 Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Sat, 14 Dec 2019 19:27:47 -0600 Subject: [PATCH 16/21] Hopefully last Gael nerf --- Items/Weapons/Melee/GaelsGreatsword.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Melee/GaelsGreatsword.cs b/Items/Weapons/Melee/GaelsGreatsword.cs index cf5b603291..83b1da372d 100644 --- a/Items/Weapons/Melee/GaelsGreatsword.cs +++ b/Items/Weapons/Melee/GaelsGreatsword.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee //Weapon attribute constants - public static readonly int BaseDamage = 5900; + public static readonly int BaseDamage = 5660; public static readonly float TrueMeleeBoost = 2.5f; From 3048860e175c2246ca5c83b767d5eb6c37bfa189 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sat, 14 Dec 2019 19:31:30 -0600 Subject: [PATCH 17/21] build.txt update --- build.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.txt b/build.txt index 49dce9b7a5..4fcd074af9 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = Fabsol and the Dev Team -version = 1.4.2.108 +version = 1.4.2.109 displayName = Calamity Mod (No Calamity Music) homepage = https://forums.terraria.org/index.php?threads/calamity-mod.44065/ buildIgnore = .vs\*, Properties\*, *.csproj, *.user, obj\*, bin\*, *.config, .git\*, LICENSE, README.md, .editorconfig, .gitignore, .gitattributes From f87d53b281c2bccd25c64542e6e7207fb89c031c Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Sat, 14 Dec 2019 21:59:03 -0600 Subject: [PATCH 18/21] Gods Paranoia bugfix --- Projectiles/Rogue/GodsParanoiaProj.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs index a6e3aa9f10..93dd511324 100644 --- a/Projectiles/Rogue/GodsParanoiaProj.cs +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -94,6 +94,10 @@ namespace CalamityMod.Projectiles.Rogue flag55 = true; } int num989 = (int)projectile.ai[1]; + if (!Main.npc[num989].active) + { + projectile.Kill(); + } if ((projectile.localAI[0] <= (float)(60 * num988)) && (num989 > 0 || num989 <= 200) && Main.npc[num989].active && !Main.npc[num989].dontTakeDamage) { projectile.Center = Main.npc[num989].Center - projectile.velocity * 2f; From 9a4308c5b7bfd797bba26f7c16ddd80d3f784ba3 Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Sun, 15 Dec 2019 07:49:37 -0600 Subject: [PATCH 19/21] Gael was dropping before Yharon --- NPCs/Crags/ScryllarRage.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NPCs/Crags/ScryllarRage.cs b/NPCs/Crags/ScryllarRage.cs index 2b1bc4e56b..b6608d1aad 100644 --- a/NPCs/Crags/ScryllarRage.cs +++ b/NPCs/Crags/ScryllarRage.cs @@ -269,7 +269,10 @@ namespace CalamityMod.NPCs.Crags { Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); } - DropHelper.DropItemChance(npc, ModContent.ItemType(), CalamityWorld.defiled ? 0.05f : 0.02f); + if (CalamityWorld.downedYharon) + { + DropHelper.DropItemChance(npc, ModContent.ItemType(), CalamityWorld.defiled ? 0.05f : 0.02f); + } } public override void HitEffect(int hitDirection, double damage) From 19d7b1ed8023f3719cce477500dd6b03e5cc4a81 Mon Sep 17 00:00:00 2001 From: Shucks Date: Sun, 15 Dec 2019 21:08:43 -0600 Subject: [PATCH 20/21] Added Burning Strife and a recipe group --- Items/Accessories/SilencingSheath.cs | 2 +- Items/Weapons/Rogue/BurningStrife.cs | 52 ++++++++++++ Items/Weapons/Rogue/BurningStrife.png | Bin 0 -> 465 bytes NPCs/CalamityGlobalNPCLoot.cs | 1 + Projectiles/Rogue/BurningStrifeProj.cs | 79 ++++++++++++++++++ Projectiles/Rogue/BurningStrifeProj.png | Bin 0 -> 294 bytes Projectiles/Typeless/ShadowflameExplosion.cs | 50 +++++++++++ Projectiles/Typeless/ShadowflameExplosion.png | Bin 0 -> 148 bytes .../Typeless/ShadowflameExplosionBig.cs | 52 ++++++++++++ .../Typeless/ShadowflameExplosionBig.png | Bin 0 -> 148 bytes Utilities/CalamityRecipes.cs | 7 ++ 11 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 Items/Weapons/Rogue/BurningStrife.cs create mode 100644 Items/Weapons/Rogue/BurningStrife.png create mode 100644 Projectiles/Rogue/BurningStrifeProj.cs create mode 100644 Projectiles/Rogue/BurningStrifeProj.png create mode 100644 Projectiles/Typeless/ShadowflameExplosion.cs create mode 100644 Projectiles/Typeless/ShadowflameExplosion.png create mode 100644 Projectiles/Typeless/ShadowflameExplosionBig.cs create mode 100644 Projectiles/Typeless/ShadowflameExplosionBig.png diff --git a/Items/Accessories/SilencingSheath.cs b/Items/Accessories/SilencingSheath.cs index c751a8f490..f86d8790db 100644 --- a/Items/Accessories/SilencingSheath.cs +++ b/Items/Accessories/SilencingSheath.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.DemoniteBar, 8); + recipe.AddRecipeGroup("AnyEvilBar", 8); recipe.AddIngredient(ItemID.Silk, 10); recipe.AddRecipeGroup("Boss2Material", 3); recipe.AddTile(TileID.TinkerersWorkbench); diff --git a/Items/Weapons/Rogue/BurningStrife.cs b/Items/Weapons/Rogue/BurningStrife.cs new file mode 100644 index 0000000000..e4f5fc7907 --- /dev/null +++ b/Items/Weapons/Rogue/BurningStrife.cs @@ -0,0 +1,52 @@ +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class BurningStrife : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Burning Strife"); + Tooltip.SetDefault("Throws a shadowflame spiky ball that bursts into flames\n" + + "Stealth Strikes make the ball linger and explode more violently\n" + + "'Definitely not pocket safe'"); + } + + public override void SafeSetDefaults() + { + item.width = 16; + item.height = 28; + item.UseSound = SoundID.Item1; + item.useStyle = ItemUseStyleID.SwingThrow; + item.value = Item.buyPrice(0, 36, 0, 0); + item.rare = 4; + item.autoReuse = true; + item.noUseGraphic = true; + item.noMelee = true; + + item.useAnimation = 25; + item.useTime = 25; + item.damage = 50; + item.crit = 8; + item.shootSpeed = 8f; + item.shoot = ModContent.ProjectileType(); + + 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) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI); + if (player.Calamity().StealthStrikeAvailable()) + { + Main.projectile[proj].Calamity().stealthStrike = true; + Main.projectile[proj].penetrate = 8; + } + return false; + } + } +} diff --git a/Items/Weapons/Rogue/BurningStrife.png b/Items/Weapons/Rogue/BurningStrife.png new file mode 100644 index 0000000000000000000000000000000000000000..df0e5f1ab463a77078b85e543431d101dba8fd83 GIT binary patch literal 465 zcmV;?0WSWDP)8Jb)AM7_&88GUK3z7i0D#DN zSOLt$EiIFLdQ~2^_fu9>8BrkqaW~EZh{q-XuqL}11inKaz*;V;4PI3r3}tZQl*JPO zuW#>N#^t2%fG`V2S5R%%0mzZkyk@s;t?_iPqSdu_)6f<+vqu0lUfSB8?{1C(SX|ll zt&L@%hVO%&^(_D{Yu5lAIt~B_#Uk)~G7FWG83p}+VJWeodd%J+lR#=wCjI6V+_oOI z4E{O~f4px$}%0OqG{U+<0Qj`SPOK$s;1*)wT0=7H~qGhpb>6OW>7 zxE748;0LVnb3lja7b^e&01|XXSad~LNk%$Pa%p95bYXO9Z*BlFgjnqF00000NkvXX Hu0mjf2GPjt literal 0 HcmV?d00001 diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index c65b5fd83c..b22f88c20b 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -1434,6 +1434,7 @@ namespace CalamityMod.NPCs case NPCID.GoblinSummoner: DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 5 : 7); + DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 3 : 6); break; case NPCID.SandElemental: diff --git a/Projectiles/Rogue/BurningStrifeProj.cs b/Projectiles/Rogue/BurningStrifeProj.cs new file mode 100644 index 0000000000..ab200a6f8d --- /dev/null +++ b/Projectiles/Rogue/BurningStrifeProj.cs @@ -0,0 +1,79 @@ +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class BurningStrifeProj : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shadow Flame Spiky Ball"); + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.timeLeft = 720; + projectile.friendly = true; + projectile.extraUpdates = 1; + projectile.Calamity().rogue = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 30; + } + + public override void AI() + { + projectile.ai[0]++; + //Rotation code + projectile.rotation += projectile.velocity.X * 0.05f * projectile.direction; + //Gravity + projectile.velocity.Y += 0.1f; + if (projectile.velocity.Y > 16f) + projectile.velocity.Y = 16f; + //Dust + if (projectile.ai[0] >= 25f) + { + Dust.NewDust(projectile.Center, 1, 1, DustID.Shadowflame, -projectile.velocity.X * 0.3f, -projectile.velocity.Y * 0.3f, 0, default, 1.1f); + projectile.ai[0] = 0f; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (projectile.velocity.X != oldVelocity.X) + projectile.velocity.X = -oldVelocity.X; + if (projectile.velocity.Y != oldVelocity.Y) + projectile.velocity.Y = -oldVelocity.Y * 0.7f; + projectile.velocity.X *= 0.9f; + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.ShadowFlame, 180); + if (projectile.Calamity().stealthStrike && projectile.penetrate != 1) + { + Main.PlaySound(2, projectile.Center, 103); + int proj = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), projectile.knockBack, projectile.owner); + Main.projectile[proj].Center = projectile.Center; + Main.projectile[proj].Calamity().rogue = true; + } + } + + public override void Kill(int timeLeft) + { + int proj; + Main.PlaySound(2, projectile.Center, 103); + if(projectile.Calamity().stealthStrike) + proj = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), projectile.knockBack, projectile.owner); + else + proj = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), projectile.knockBack, projectile.owner); + Main.projectile[proj].Center = projectile.Center; + Main.projectile[proj].Calamity().rogue = true; + } + } +} diff --git a/Projectiles/Rogue/BurningStrifeProj.png b/Projectiles/Rogue/BurningStrifeProj.png new file mode 100644 index 0000000000000000000000000000000000000000..93f29acb9bd52b9fe4bdbc2cb87c77802e118a02 GIT binary patch literal 294 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xawj^(N7l!{JxM1({$v~04o-U3d z8t0czGUPhsAmDnxD_tOn#nGjgqsd81P`diyIqrxkj%${U;vU(06YPAsW|uSxunHbg zdZ2nOD?vCYwcd38%!g;w!+Y;GAG?rb5y)`;dF=Jd!0xsz?~U=f3?83+m}C0X8JaXM zrP=!=dq2AJR(tZ6Z+|W|{7^a1FyZI3Be%bYp4u>npJB$^Ik#F3dbf%O=KeKi=zp}B zu}XHi+3nxq3o<^ByS6;OXk;vd$@?2>|ywa+?4E literal 0 HcmV?d00001 diff --git a/Projectiles/Typeless/ShadowflameExplosion.cs b/Projectiles/Typeless/ShadowflameExplosion.cs new file mode 100644 index 0000000000..a2157362e0 --- /dev/null +++ b/Projectiles/Typeless/ShadowflameExplosion.cs @@ -0,0 +1,50 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Projectiles.Typeless +{ + public class ShadowflameExplosion : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shadowflame Explosion"); + } + + public override void SetDefaults() + { + projectile.width = 75; + projectile.height = 75; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft = 30; + projectile.tileCollide = false; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + public override void AI() + { + projectile.ai[1]++; + if (projectile.ai[1] >= 3f) + { + for (int i = 0; i < 2; i++) + { + Vector2 Dspeed = new Vector2(2.3f, 2.3f).RotatedBy(MathHelper.ToRadians(projectile.ai[0])); + float Dscale = Main.rand.NextFloat(1f, 1.3f); + Dust.NewDust(projectile.Center, 1, 1, DustID.Shadowflame, Dspeed.X, Dspeed.Y, 0, default, Dscale); + Dust.NewDust(projectile.Center, 1, 1, DustID.Shadowflame, -Dspeed.X, -Dspeed.Y, 0, default, Dscale); + projectile.ai[0] += 19f; + } + projectile.ai[1] = 0f; + } + + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.ShadowFlame, 180); + } + } +} diff --git a/Projectiles/Typeless/ShadowflameExplosion.png b/Projectiles/Typeless/ShadowflameExplosion.png new file mode 100644 index 0000000000000000000000000000000000000000..983260eb072b8727c0a51e9d46e9d6a08bc460b1 GIT binary patch literal 148 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VTavfC3&Vd9T(EcfWS|IVfk$L9 z0|Vb-5N14{zaj-F$X?><>&pIsor6J7WfsE<1)z|kr;B5V#p&cf|Nq-Fn=%SBPd&Jz maWPw;lttEq6^+hE9T+mXnN^!s2qgd&GkCiCxvX= 3f) + { + for (int i = 0; i < 3; i++) + { + Vector2 Dspeed = new Vector2(4.3f, 4.3f).RotatedBy(MathHelper.ToRadians(projectile.ai[0])); + float Dscale = Main.rand.NextFloat(1f, 1.5f); + Dust.NewDust(projectile.Center, 1, 1, DustID.Shadowflame, Dspeed.X, Dspeed.Y, 0, default, Dscale); + Vector2 Ds2 = Dspeed.RotatedBy(MathHelper.ToRadians(120)); + Dust.NewDust(projectile.Center, 1, 1, DustID.Shadowflame, Ds2.X, Ds2.Y, 0, default, Dscale); + Vector2 Ds3 = Dspeed.RotatedBy(MathHelper.ToRadians(240)); + Dust.NewDust(projectile.Center, 1, 1, DustID.Shadowflame, Ds3.X, Ds3.Y, 0, default, Dscale); + projectile.ai[0] += 19f; + } + projectile.ai[1] = 0f; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.ShadowFlame, 180); + } + } +} diff --git a/Projectiles/Typeless/ShadowflameExplosionBig.png b/Projectiles/Typeless/ShadowflameExplosionBig.png new file mode 100644 index 0000000000000000000000000000000000000000..983260eb072b8727c0a51e9d46e9d6a08bc460b1 GIT binary patch literal 148 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VTavfC3&Vd9T(EcfWS|IVfk$L9 z0|Vb-5N14{zaj-F$X?><>&pIsor6J7WfsE<1)z|kr;B5V#p&cf|Nq-Fn=%SBPd&Jz maWPw;lttEq6^+hE9T+mXnN^!s2qgd&GkCiCxvX "Any Evil Bar", new int[] + { + ItemID.DemoniteBar, + ItemID.CrimtaneBar + }); + RecipeGroup.RegisterGroup("AnyEvilBar", group); + group = new RecipeGroup(() => "Any Cobalt Bar", new int[] { ItemID.CobaltBar, From 2e276c274886bcc8de5d42bfbd210a39a1cde970 Mon Sep 17 00:00:00 2001 From: Shucks Date: Mon, 16 Dec 2019 22:20:11 -0600 Subject: [PATCH 21/21] Added metal monstrosity, added a function for sticky projectiles and fixed the rarity of burning strife --- Items/Weapons/Rogue/BurningStrife.cs | 2 +- Items/Weapons/Rogue/MetalMonstrosity.cs | 59 +++++++++++ Items/Weapons/Rogue/MetalMonstrosity.png | Bin 0 -> 727 bytes Projectiles/Rogue/MetalChunk.cs | 65 ++++++++++++ Projectiles/Rogue/MetalChunk.png | Bin 0 -> 727 bytes Projectiles/Rogue/MetalShard.cs | 90 ++++++++++++++++ Projectiles/Rogue/MetalShard.png | Bin 0 -> 281 bytes Projectiles/Rogue/MetalShard2.png | Bin 0 -> 319 bytes Projectiles/Rogue/MetalShard3.png | Bin 0 -> 269 bytes Utilities/CalamityUtils.cs | 124 +++++++++++++++++++++++ 10 files changed, 339 insertions(+), 1 deletion(-) create mode 100644 Items/Weapons/Rogue/MetalMonstrosity.cs create mode 100644 Items/Weapons/Rogue/MetalMonstrosity.png create mode 100644 Projectiles/Rogue/MetalChunk.cs create mode 100644 Projectiles/Rogue/MetalChunk.png create mode 100644 Projectiles/Rogue/MetalShard.cs create mode 100644 Projectiles/Rogue/MetalShard.png create mode 100644 Projectiles/Rogue/MetalShard2.png create mode 100644 Projectiles/Rogue/MetalShard3.png diff --git a/Items/Weapons/Rogue/BurningStrife.cs b/Items/Weapons/Rogue/BurningStrife.cs index e4f5fc7907..35635ed188 100644 --- a/Items/Weapons/Rogue/BurningStrife.cs +++ b/Items/Weapons/Rogue/BurningStrife.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.UseSound = SoundID.Item1; item.useStyle = ItemUseStyleID.SwingThrow; item.value = Item.buyPrice(0, 36, 0, 0); - item.rare = 4; + item.rare = 5; item.autoReuse = true; item.noUseGraphic = true; item.noMelee = true; diff --git a/Items/Weapons/Rogue/MetalMonstrosity.cs b/Items/Weapons/Rogue/MetalMonstrosity.cs new file mode 100644 index 0000000000..c0928f66d5 --- /dev/null +++ b/Items/Weapons/Rogue/MetalMonstrosity.cs @@ -0,0 +1,59 @@ +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class MetalMonstrosity : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Metal Monstrosity"); + Tooltip.SetDefault("Hurls a heavy metal ball that shatters on impact \n" + + "Stealth Strikes makes the ball release spikes as it travels \n" + + "'This has to hurt'"); + } + + public override void SafeSetDefaults() + { + item.width = 32; + item.height = 32; + item.useStyle = ItemUseStyleID.SwingThrow; + item.autoReuse = true; + item.noUseGraphic = true; + item.noMelee = true; + item.UseSound = SoundID.Item1; + item.rare = 3; + item.value = Item.buyPrice(0, 4, 0, 0); + + item.damage = 40; + item.useAnimation = 40; + item.useTime = 40; + item.knockBack = 7f; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 7f; + + 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) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + if (player.Calamity().StealthStrikeAvailable()) + Main.projectile[proj].Calamity().stealthStrike = true; + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpikyBall, 500); + recipe.AddIngredient(ItemID.Spike, 80); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Rogue/MetalMonstrosity.png b/Items/Weapons/Rogue/MetalMonstrosity.png new file mode 100644 index 0000000000000000000000000000000000000000..a9984302ef420c1ccf6d53342d00de9a4b95faab GIT binary patch literal 727 zcmV;|0x127P)8e_rBzwuSwMD-gimPJ%@A8 z_nhy%-?^?_sszL|JW_Q48_O#IY}QukrgEtQK;`;P0KRf zFP;N1`FK14IA1Ee_&^(hA|D>90e$ziZ`xM z=m%h9dBuzTf0Z5rEA#IGsNNa%28e`|$((cmjmAy@aQVs&Z@lKQQqI_1N)Lh0pFV~J z7;Q^p@y!ANyY)?v$hWN;08Jd2Q92#0g~g0zYt@<=QKo)spsDgcPYg z9rA%@vjM>OTG*dBfnzyfy;qDv{JwQ?c^JlMDhf-j*fuV{a&|RMQp3t%+yQZxVIC10TJDRtP@H$ zCz2=dE2;&5yWiU{9qa9uL^jjwMcPS;6L8~^6V4p`?z+<3rBax+Kequm 16f) + projectile.velocity.Y = 16f; + //Rotation + projectile.rotation += 0.14f * projectile.direction; + if (projectile.Calamity().stealthStrike) + { + projectile.ai[0]++; + if(projectile.ai[0] >= 10f) + { + Vector2 speed = new Vector2(Main.rand.NextFloat(-6f, 6f), Main.rand.NextFloat(-6f, 6f)); + Projectile.NewProjectile(projectile.Center, speed, ModContent.ProjectileType(), (int)(projectile.damage * 0.3f), 0f, projectile.owner, 0f, 0f); + projectile.ai[0] = 0f; + } + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.NPCHit42, projectile.Center); + for (int i = 0; i < 3; i++) + { + Vector2 S1 = new Vector2(-projectile.velocity.X, -projectile.velocity.Y).RotatedBy(MathHelper.ToRadians(Main.rand.Next(-45, 46))); + int proj = Projectile.NewProjectile(projectile.Center, S1, ProjectileID.SpikyBall, (int)(projectile.damage * 0.3), 0f, projectile.owner, 0f, 0f); + Main.projectile[proj].timeLeft = 600; + Main.projectile[proj].usesLocalNPCImmunity = true; + Main.projectile[proj].localNPCHitCooldown = 20; + S1 = new Vector2(-projectile.velocity.X * 0.7f, -projectile.velocity.Y*0.7f).RotatedBy(MathHelper.ToRadians(Main.rand.Next(-45, 46))); + Projectile.NewProjectile(projectile.Center, S1, ModContent.ProjectileType(), (int)(projectile.damage * 0.3), 0f, projectile.owner, 0f, 0f); + } + //Dust + for (int i = 0; i < 20; i++) + { + Dust.NewDust(projectile.Center, 1, 1, DustID.Lead, 0f, 0f, 0, default, 1.1f); + } + } + } +} diff --git a/Projectiles/Rogue/MetalChunk.png b/Projectiles/Rogue/MetalChunk.png new file mode 100644 index 0000000000000000000000000000000000000000..a9984302ef420c1ccf6d53342d00de9a4b95faab GIT binary patch literal 727 zcmV;|0x127P)8e_rBzwuSwMD-gimPJ%@A8 z_nhy%-?^?_sszL|JW_Q48_O#IY}QukrgEtQK;`;P0KRf zFP;N1`FK14IA1Ee_&^(hA|D>90e$ziZ`xM z=m%h9dBuzTf0Z5rEA#IGsNNa%28e`|$((cmjmAy@aQVs&Z@lKQQqI_1N)Lh0pFV~J z7;Q^p@y!ANyY)?v$hWN;08Jd2Q92#0g~g0zYt@<=QKo)spsDgcPYg z9rA%@vjM>OTG*dBfnzyfy;qDv{JwQ?c^JlMDhf-j*fuV{a&|RMQp3t%+yQZxVIC10TJDRtP@H$ zCz2=dE2;&5yWiU{9qa9uL^jjwMcPS;6L8~^6V4p`?z+<3rBax+Kequm 16f) + projectile.velocity.Y = 16f; + //Sticky Behaviour + CalamityUtils.StickyProjAI(projectile); + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + CalamityUtils.ModifyHitNPCSticky(projectile, 8 , true); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (targetHitbox.Width > 8 && targetHitbox.Height > 8) + { + targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); + } + return null; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture; + if (projectile.localAI[1] == 0f) + projectile.localAI[1] = Main.rand.Next(1, 4); + switch (projectile.localAI[1]) + { + + case 2f: texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/MetalShard2"); + break; + case 3f: texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/MetalShard3"); + break; + default: texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/MetalShard"); + break; + } + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 6; i++) + { + Dust.NewDust(projectile.Center, projectile.width, projectile.height, DustID.Lead, 0f, 0f, 0, default, 1f); + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Main.PlaySound(SoundID.Dig, projectile.Center); + return true; + } + } +} diff --git a/Projectiles/Rogue/MetalShard.png b/Projectiles/Rogue/MetalShard.png new file mode 100644 index 0000000000000000000000000000000000000000..fd91eb1b32bb50906523d971645f5d630a7dfc14 GIT binary patch literal 281 zcmeAS@N?(olHy`uVBq!ia0vp^Ahr+(8<0%e?(Yqx*pj^6T^Rm@;DWu&Cj&(`c)B=- zXq;bqX)hn6qe$Ds@*^g}3t}g((Qw(iFmQ)z>pj*NqVHV26{R*#6c9;by}f8gTGz!J zNv$dM`(CL$e{wQh=Ainz$BYk3s~KYW%(*{QurY{uNC#f%Oyo zbi7v9dENKalUl6nu=LF_v415~1AE%C&USh}ziha?Vt*UM6=`3FvfHW*UQ=E6^>zQ$ zDO>PWJN@{J=p`Xc2PEbO{!wRrs5bWp+xctOS2H(N7=gT2;u--&o^DqDMVYC2C5a`O Y`FRY6EfH_t17#UJUHx3vIVCg!0D!x06aWAK literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/MetalShard2.png b/Projectiles/Rogue/MetalShard2.png new file mode 100644 index 0000000000000000000000000000000000000000..6ab3926f2d650336ad805005938857a3c66260cd GIT binary patch literal 319 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~i!3HGN^yhQ|DYhhUcNd2LAh=-f^2tDvYo0ES zAsXk`UNZDzP82x$@&5AN9AbtMJC$-YHKL-UxZ@5oM=U$TsKd%#++dQ)>X@^YBa>xz zL_|lNgUJFFmq_XGI|(XBzps*fcJ{+_L&fvk&aQY=zIoD9#%F1F=PgV5^yz#;oub1e zwFHYA=IY<<4<7A_bx~$Gds+BGmR$4n>&uz!?A#NQi=Uro{>X7IO17Zl$_j}*{d}#z zj}OR7`fe$e%M(~DKIOhKx8UA-mV z=YQPY&m1l>H`v{cli~dJ!&i%!1~De&zWiFw;c{#v(}GoNe#fvaxNge8($d&1_ptvMggr|e>QP_&P!V7GYO-u1m1XAf{s@nYPt z?aP^zDI7m)UwUsiDE(%h#;XZc^+iDU3YEA<0FkGgm48uYYF + /// Call this function in the ai of your projectile so it can stick to enemies, also requires ModifyHitNPCSticky to be called in ModifyHitNPC + /// + /// The projectile you're adding sticky behaviour to + public static void StickyProjAI (Projectile projectile) + { + if (projectile.ai[0] == 1f) + { + projectile.tileCollide = false; + int num988 = 15; + bool flag54 = false; + bool flag55 = false; + projectile.localAI[0]++; + if (projectile.localAI[0] % 30f == 0f) + { + flag55 = true; + } + int num989 = (int)projectile.ai[1]; + if (projectile.localAI[0] >= (float)(60 * num988)) + { + flag54 = true; + } + else if (num989 < 0 || num989 >= 200) + { + flag54 = true; + } + else if (Main.npc[num989].active && !Main.npc[num989].dontTakeDamage) + { + projectile.Center = Main.npc[num989].Center - projectile.velocity * 2f; + projectile.gfxOffY = Main.npc[num989].gfxOffY; + if (flag55) + { + Main.npc[num989].HitEffect(0, 1.0); + } + } + else + { + flag54 = true; + } + if (flag54) + { + projectile.Kill(); + } + } + } + + /// + /// Call this function in ModifyHitNPC to make your projectiles stick to enemies, needs StickyProjAI to be called in the AI of the projectile + /// + /// The projectile you're giving sticky behaviour to + /// How many projectiles of this type can stick to one enemy + /// Decides if you want the projectile to deal damage while its sticked to enemies or not + public static void ModifyHitNPCSticky(Projectile projectile, int maxStick, bool constantDamage) + { + Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + if (projectile.owner == Main.myPlayer) + { + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && + ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || + (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) + { + if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) + { + bool flag3; + if (Main.npc[i].type == 414) + { + Rectangle rect = Main.npc[i].getRect(); + int num5 = 8; + rect.X -= num5; + rect.Y -= num5; + rect.Width += num5 * 2; + rect.Height += num5 * 2; + flag3 = projectile.Colliding(myRect, rect); + } + else + { + flag3 = projectile.Colliding(myRect, Main.npc[i].getRect()); + } + if (flag3) + { + if (Main.npc[i].reflectingProjectiles && projectile.CanReflect()) + { + Main.npc[i].ReflectProjectile(projectile.whoAmI); + return; + } + projectile.ai[0] = 1f; + projectile.ai[1] = (float)i; + projectile.velocity = (Main.npc[i].Center - projectile.Center) * 0.75f; + projectile.netUpdate = true; + if (!constantDamage) + projectile.damage = 0; + Point[] array2 = new Point[maxStick]; + int num29 = 0; + for (int l = 0; l < 1000; l++) + { + if (l != projectile.whoAmI && Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type && Main.projectile[l].ai[0] == 1f && Main.projectile[l].ai[1] == (float)i) + { + array2[num29++] = new Point(l, Main.projectile[l].timeLeft); + if (num29 >= array2.Length) + { + break; + } + } + } + if (num29 >= array2.Length) + { + int num30 = 0; + for (int m = 1; m < array2.Length; m++) + { + if (array2[m].Y < array2[num30].Y) + { + num30 = m; + } + } + Main.projectile[array2[num30].X].Kill(); + } + } + } + } + } + } + } #endregion #region Tile Utilities