From 56bc3f2c69c861dee2cf81fecd545fdc24f68687 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Thu, 12 Sep 2024 19:05:18 -0400 Subject: [PATCH] Kylie retier + rebalance * Now found in Surface chests instead of being sold by the Bandit * Changed stealth strike effect from throwing 3 boomerangs to throwing a boomerang that weakly follows the cursor, Flying Knife-esque --- Gores/KylieGore1.png | Bin 0 -> 442 bytes Gores/KylieGore2.png | Bin 0 -> 338 bytes Items/CalamityGlobalItemLoot.cs | 1 + Items/Weapons/Rogue/Kylie.cs | 15 +-- NPCs/TownNPCs/THIEF.cs | 3 +- Projectiles/Rogue/KylieBoomerang.cs | 182 +++++++++++++++++----------- Systems/WorldgenManagementSystem.cs | 13 +- 7 files changed, 130 insertions(+), 84 deletions(-) create mode 100644 Gores/KylieGore1.png create mode 100644 Gores/KylieGore2.png diff --git a/Gores/KylieGore1.png b/Gores/KylieGore1.png new file mode 100644 index 0000000000000000000000000000000000000000..d6066fc50a2900f9df46912f89d4a7f90ae52c30 GIT binary patch literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^0zj<5!3HFyJAa%3QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ISV`@iy0XB4ude`@%$AjKn?z$E{-7{-pMHk7?ZAu{CA$2u;IzI+BI1- z7ns~+ID92ax^~0aJ-fOR?08~sRSTYKVwlmr;yKfdv!}{_CH(95E)?em&5yJ8(KG_053*JP;YP%VCd;lz6d9xiSHu?r&X$+vbgqzP|lFqe4DbfuiJ zze7Z#oAXnnABl?>tw;v`x;3qY!O z?-QHBcGQ;Rz$?}-Qe8#jIkQ(VmmOR!nqVh$CpE2Ylfr{H!5&dJ%Kr0Bjb&JB$gpPF ip;Tj@fEP?`Yz*ecEk{^3oG1Z?H-o3EpUXO@geCy0K&*cN literal 0 HcmV?d00001 diff --git a/Gores/KylieGore2.png b/Gores/KylieGore2.png new file mode 100644 index 0000000000000000000000000000000000000000..a32dd8c3feca71c4f9f534c05e3d7d6059b7c113 GIT binary patch literal 338 zcmeAS@N?(olHy`uVBq!ia0vp^Qa~)i!3HEJJLv8MQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ISV`@iy0XB4ude`@%$AjK*8spE{-7{-pLC@Dl}L9VNcW$S5IiVWWwGP zFe`=Ov+E2N_8I+rN0bz{g#Q!WAnSbG{j&PZrk@5I_P;fn!pgWh?hnJ|=Iic;SzQV9 zcW@Lp|1@Ce7M7S{#Q11(?)UdRmn@oox}1-cKO-*ug!wYh@AHls8VyG|&!`(1RMfP* z6E6Ai;wHC2?fXm82EFfuB_u5557sa+8_Yit!^dnOe}F-6{sD%+H7w`F6}KfchQGIO z%#>(Yy3RN}zcJIPu#x-1eRqkU%v@o*_H3z+3@hy#8GkLensNTzpI>~>4j<@c*FW)z g(Q3iuehCSNN6Ee?I@AAO1$vpm)78&qol`;+0Ba3>D*ylh literal 0 HcmV?d00001 diff --git a/Items/CalamityGlobalItemLoot.cs b/Items/CalamityGlobalItemLoot.cs index 6836ee9ae4..9d03030e9b 100644 --- a/Items/CalamityGlobalItemLoot.cs +++ b/Items/CalamityGlobalItemLoot.cs @@ -274,6 +274,7 @@ namespace CalamityMod.Items case ItemID.WoodenCrate: case ItemID.WoodenCrateHard: loot.Add(ModContent.ItemType(), 4, 3, 5); // 25% 3-5 Wulfrum Scrap + loot.Add(ModContent.ItemType(), 20); break; case ItemID.IronCrate: diff --git a/Items/Weapons/Rogue/Kylie.cs b/Items/Weapons/Rogue/Kylie.cs index 8184726764..1608b25e4a 100644 --- a/Items/Weapons/Rogue/Kylie.cs +++ b/Items/Weapons/Rogue/Kylie.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 34; Item.height = 50; - Item.damage = 63; + Item.damage = 15; Item.knockBack = 12; Item.DamageType = RogueDamageClass.Instance; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; @@ -33,22 +33,17 @@ 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 += 16; - public override float StealthDamageMultiplier => 0.3333f; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { CalamityPlayer p = Main.player[Main.myPlayer].Calamity(); //If stealth is full, shoot a spread of 3 boomerangs with reduced range if (p.StealthStrikeAvailable()) { - int spread = 10; - for (int i = 0; i < 3; i++) + int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); + if (proj.WithinBounds(Main.maxProjectiles)) { - Vector2 perturbedspeed = velocity.RotatedBy(MathHelper.ToRadians(spread)); - 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 -= 10; + Main.projectile[proj].Calamity().stealthStrike = true; + Main.projectile[proj].penetrate = 7; } return false; } diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index 9433ea95d2..5bf506ef43 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -309,12 +309,11 @@ namespace CalamityMod.NPCs.TownNPCs NPCShop shop = new(Type); shop.AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 9)) .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 9)) - .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 9)) + .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 25)) .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 40)) .Add(ItemID.TigerClimbingGear) .AddWithCustomValue(ItemID.InvisibilityPotion, Item.buyPrice(silver: 25), potionSells, Condition.HappyEnough) .AddWithCustomValue(ItemID.NightOwlPotion, Item.buyPrice(silver: 25), potionSells, Condition.HappyEnough) - .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 25)) .Add(ModContent.ItemType(), Condition.DownedPirates) .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 60), Condition.DownedMechBossAll) .Add(ModContent.ItemType(), downedCalclone) diff --git a/Projectiles/Rogue/KylieBoomerang.cs b/Projectiles/Rogue/KylieBoomerang.cs index 12d1648a1c..9c54b5bd30 100644 --- a/Projectiles/Rogue/KylieBoomerang.cs +++ b/Projectiles/Rogue/KylieBoomerang.cs @@ -13,16 +13,19 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/Kylie"; + public ref float State => ref Projectile.ai[0]; + public ref float Timer => ref Projectile.ai[1]; + //This variable will be used for the stealth strike - public float ReboundTime = 0f; - public float timer = 0f; + public const float ReboundTime = 35f; + public int TileBounceDelay = 0; public override void SetDefaults() { Projectile.friendly = true; Projectile.width = 40; Projectile.height = 40; Projectile.penetrate = -1; - Projectile.timeLeft = 360; + Projectile.timeLeft = 240; Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 30; @@ -32,11 +35,11 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { + Player Owner = Main.player[Projectile.owner]; //Constant rotation Projectile.rotation += 0.2f; - - timer++; + //Dust trail if (Main.rand.NextBool(15)) { @@ -49,88 +52,113 @@ namespace CalamityMod.Projectiles.Rogue Projectile.soundDelay = 15; SoundEngine.PlaySound(SoundID.Item7, Projectile.position); } - //Slopes REEEEEEEEEEEE - if (timer == 3f) - Projectile.tileCollide = true; - //Decide the range of the boomerang depending on stealth + + // If stealth strike, stay close to the player's cursor. if (Projectile.Calamity().stealthStrike) - ReboundTime = 36f; - else - ReboundTime = 55f; - - // ai[0] stores whether the boomerang is returning. If 0, it isn't. If 1, it is. - if (Projectile.ai[0] == 0f) { - Projectile.ai[1] += 1f; - if (Projectile.ai[1] >= ReboundTime) + Projectile.tileCollide = true; + if (TileBounceDelay > 0) + TileBounceDelay--; + + Vector2 mousePos = Owner.Calamity().mouseWorld; + if (Vector2.Distance(Projectile.Center, mousePos) > 115f && TileBounceDelay == 0) { - Projectile.ai[0] = 1f; - Projectile.ai[1] = 0f; - Projectile.netUpdate = true; + float accelerationFactor = 12f; // Higher number = Takes longer to turn around. + Projectile.velocity += (mousePos - Projectile.Center).SafeNormalize(Vector2.UnitX) * Kylie.Speed / accelerationFactor; + if (Projectile.velocity.Length() > Kylie.Speed) + { + Projectile.velocity.Normalize(); + Projectile.velocity *= Kylie.Speed; + } + } + else // Accelerate to top speed if close enough to prevent it staying slow if you move in the cursor while it's slowing down. + { + Projectile.velocity *= 1.1f; + if (Projectile.velocity.Length() > Kylie.Speed) + { + Projectile.velocity.Normalize(); + Projectile.velocity *= Kylie.Speed; + } } } else { - Projectile.tileCollide = false; - float returnSpeed = Kylie.Speed * 1.5f; - float acceleration = 3.2f; - Player owner = Main.player[Projectile.owner]; - - // Delete the boomerang if it's excessively far away. - Vector2 playerCenter = owner.Center; - float xDist = playerCenter.X - Projectile.Center.X; - float yDist = playerCenter.Y - Projectile.Center.Y; - float dist = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist)); - if (dist > 3000f) - Projectile.Kill(); - - dist = returnSpeed / dist; - xDist *= dist; - yDist *= dist; - - // Home back in on the player. - if (Projectile.velocity.X < xDist) + // State of 0 = Going out. State of 1 = Returning. + if (State == 0f) { - Projectile.velocity.X = Projectile.velocity.X + acceleration; - if (Projectile.velocity.X < 0f && xDist > 0f) - Projectile.velocity.X += acceleration; - } - else if (Projectile.velocity.X > xDist) - { - Projectile.velocity.X = Projectile.velocity.X - acceleration; - if (Projectile.velocity.X > 0f && xDist < 0f) - Projectile.velocity.X -= acceleration; - } - if (Projectile.velocity.Y < yDist) - { - Projectile.velocity.Y = Projectile.velocity.Y + acceleration; - if (Projectile.velocity.Y < 0f && yDist > 0f) - Projectile.velocity.Y += acceleration; - } - else if (Projectile.velocity.Y > yDist) - { - Projectile.velocity.Y = Projectile.velocity.Y - acceleration; - if (Projectile.velocity.Y > 0f && yDist < 0f) - Projectile.velocity.Y -= acceleration; - } + Timer += 1f; + //Slopes REEEEEEEEEEEE + if (Timer == 3f) + Projectile.tileCollide = true; - // Delete the projectile if it touches its owner. - if (Main.myPlayer == Projectile.owner) - if (Projectile.Hitbox.Intersects(owner.Hitbox)) + if (Timer >= ReboundTime) + { + State = 1f; + Timer = 0f; + Projectile.netUpdate = true; + } + } + else + { + Projectile.tileCollide = false; + float returnSpeed = Kylie.Speed * 1.5f; + float acceleration = 3.2f; + Player owner = Main.player[Projectile.owner]; + + // Delete the boomerang if it's excessively far away. + Vector2 playerCenter = owner.Center; + float xDist = playerCenter.X - Projectile.Center.X; + float yDist = playerCenter.Y - Projectile.Center.Y; + float dist = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist)); + if (dist > 3000f) Projectile.Kill(); + + dist = returnSpeed / dist; + xDist *= dist; + yDist *= dist; + + // Home back in on the player. + if (Projectile.velocity.X < xDist) + { + Projectile.velocity.X = Projectile.velocity.X + acceleration; + if (Projectile.velocity.X < 0f && xDist > 0f) + Projectile.velocity.X += acceleration; + } + else if (Projectile.velocity.X > xDist) + { + Projectile.velocity.X = Projectile.velocity.X - acceleration; + if (Projectile.velocity.X > 0f && xDist < 0f) + Projectile.velocity.X -= acceleration; + } + if (Projectile.velocity.Y < yDist) + { + Projectile.velocity.Y = Projectile.velocity.Y + acceleration; + if (Projectile.velocity.Y < 0f && yDist > 0f) + Projectile.velocity.Y += acceleration; + } + else if (Projectile.velocity.Y > yDist) + { + Projectile.velocity.Y = Projectile.velocity.Y - acceleration; + if (Projectile.velocity.Y > 0f && yDist < 0f) + Projectile.velocity.Y -= acceleration; + } + + + // Delete the projectile if it touches its owner. + if (Main.myPlayer == Projectile.owner) + if (Projectile.Hitbox.Intersects(owner.Hitbox)) + Projectile.Kill(); + } } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - //Start homing at player if you hit an enemy - Projectile.ai[0] = 1; - } + // Return to player after hitting an enemy + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => State = 1f; public override bool OnTileCollide(Vector2 oldVelocity) { - //Bounce off tiles and start homing on player if it hits a tile + //Bounce off tiles and return to player after hitting a tile Collision.HitTiles(Projectile.position + Projectile.velocity, Projectile.velocity, Projectile.width, Projectile.height); SoundEngine.PlaySound(SoundID.Dig, Projectile.position); if (Projectile.velocity.X != oldVelocity.X) @@ -141,9 +169,21 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.velocity.Y = -oldVelocity.Y; } - Projectile.ai[0] = 1; + State = 1f; + if (TileBounceDelay == 0) + TileBounceDelay = 10; return false; + } + // Spawn splinter gores on stealth strike death + public override void OnKill(int timeLeft) + { + if (Projectile.Calamity().stealthStrike) + { + Vector2 splinterVel = Projectile.velocity.RotatedByRandom(MathHelper.Pi / 12f); + Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, splinterVel, Mod.Find("KylieGore1").Type); + Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, splinterVel, Mod.Find("KylieGore2").Type); + } } } } diff --git a/Systems/WorldgenManagementSystem.cs b/Systems/WorldgenManagementSystem.cs index 3b53923a31..13290114c7 100644 --- a/Systems/WorldgenManagementSystem.cs +++ b/Systems/WorldgenManagementSystem.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using CalamityMod.Items.SummonItems; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.World; using CalamityMod.World.Minibiomes; using CalamityMod.World.Planets; @@ -136,7 +137,7 @@ namespace CalamityMod.Systems int sunkenSeaX = (GenVars.UndergroundDesertLocation.Left + GenVars.UndergroundDesertLocation.Right) / 2; int sunkenSeaY = Main.maxTilesY / 2; - //place each piece of the sunken sea based on the above positons + // place each piece of the sunken sea based on the above positons SunkenSea.PlaceRadiantReefs(sunkenSeaX - 100, sunkenSeaY + 75, true); SunkenSea.PlaceRadiantReefs(sunkenSeaX + 100, sunkenSeaY + 75, false); SunkenSea.PlacePolypForest(sunkenSeaX, sunkenSeaY + 500); @@ -415,6 +416,16 @@ namespace CalamityMod.Systems } } + // Replace Step Stool in surface Chests with Kylie + // Calamity adds a very easy recipe for this so hopefully this isn't a big deal (The 4 unironic Step Stool lovers will be out for my head) + if (isBrownChest) + { + if (chest.item[0].type == ItemID.PortableStool) + { + chest.item[0].SetDefaults(ModContent.ItemType()); + } + } + // Give Dead Man's Chests better loot. if (isDeadManChest) {