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
This commit is contained in:
CongratsIsTrash committed 2024-09-12 19:05:18 -04:00
1 parent 63dc06769b
commit 56bc3f2c69
7 files changed
+130 -84

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

+1
View File
@@ -274,6 +274,7 @@ namespace CalamityMod.Items
case ItemID.WoodenCrate:
case ItemID.WoodenCrateHard:
loot.Add(ModContent.ItemType<WulfrumMetalScrap>(), 4, 3, 5); // 25% 3-5 Wulfrum Scrap
loot.Add(ModContent.ItemType<Kylie>(), 20);
break;
case ItemID.IronCrate:
+5 -10
View File
@@ -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;
}
+1 -2
View File
@@ -309,12 +309,11 @@ namespace CalamityMod.NPCs.TownNPCs
NPCShop shop = new(Type);
shop.AddWithCustomValue(ModContent.ItemType<Cinquedea>(), Item.buyPrice(gold: 9))
.AddWithCustomValue(ModContent.ItemType<Glaive>(), Item.buyPrice(gold: 9))
.AddWithCustomValue(ModContent.ItemType<Kylie>(), Item.buyPrice(gold: 9))
.AddWithCustomValue(ModContent.ItemType<SlickCane>(), Item.buyPrice(gold: 25))
.AddWithCustomValue(ModContent.ItemType<OldDie>(), 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<SlickCane>(), Item.buyPrice(gold: 25))
.Add(ModContent.ItemType<ThiefsDime>(), Condition.DownedPirates)
.AddWithCustomValue(ModContent.ItemType<MomentumCapacitor>(), Item.buyPrice(gold: 60), Condition.DownedMechBossAll)
.Add(ModContent.ItemType<DeepWounder>(), downedCalclone)
+111 -71
View File
@@ -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<ModGore>("KylieGore1").Type);
Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, splinterVel, Mod.Find<ModGore>("KylieGore2").Type);
}
}
}
}
+12 -1
View File
@@ -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<Kylie>());
}
}
// Give Dead Man's Chests better loot.
if (isDeadManChest)
{