Bunch of misc balance stuff I've been sitting on

This commit is contained in:
CongratsIsTrash committed 2025-05-31 11:20:17 -04:00
1 parent 7f823eacb2
commit a5f2cc1fca
7 files changed
+117 -38

No files matched your search

-1
View File
@@ -113,7 +113,6 @@ namespace CalamityMod.Items
{ ItemID.FairyQueenMagicItem, Do(DamageExact(54)) }, // Nightglow
{ ItemID.FalconBlade, Do(UseTurn, UseExact(13)) },
{ ItemID.FireworksLauncher, Do(DamageExact(50), UseExact(25)) }, // Celebration
{ ItemID.Flairon, Do(DamageExact(65)) },
{ ItemID.Flamarang, Do(DamageExact(40)) },
{ ItemID.Flamelash, Do(DamageExact(40)) },
{ ItemID.Flamethrower, Do(DamageExact(21), ShootSpeedDelta(+3f)) },
+1 -1
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged
{
Item.width = 68;
Item.height = 36;
Item.damage = 89;
Item.damage = 80;
Item.DamageType = DamageClass.Ranged;
Item.useTime = 5;
Item.useAnimation = 30;
+10 -16
View File
@@ -10,8 +10,8 @@ namespace CalamityMod.Items.Weapons.Rogue
public class Glaive : RogueWeapon
{
//These 2 are used on the Projectile AI and thus remain here
public static float Speed = 10f;
public static float StealthSpeedMult = 1.8f;
public static float Speed = 13f;
public static float StealthSpeedMult = 1.3f;
public override void SetDefaults()
{
@@ -29,29 +29,23 @@ namespace CalamityMod.Items.Weapons.Rogue
Item.rare = ItemRarityID.Orange;
Item.UseSound = SoundID.Item1;
Item.shootSpeed = 10;
Item.shootSpeed = Speed;
Item.shoot = ModContent.ProjectileType<GlaiveProj>();
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4;
public override float StealthVelocityMultiplier => StealthSpeedMult;
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 6;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float ai1 = 0f;
if (player.Calamity().StealthStrikeAvailable())
{
ai1 = 1f;
}
int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, ai1);
int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, -1f);
if (player.Calamity().StealthStrikeAvailable() && p.WithinBounds(Main.maxProjectiles))
{
Main.projectile[p].Calamity().stealthStrike = true;
Main.projectile[p].penetrate = 4;
}
return false;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] < 3;
}
}
@@ -1874,7 +1874,7 @@ TheAmalgam: {
Tooltip:
'''
10% increased damage
All attacks inflict a variety of debuffs and multiplies all elemental debuff damage by 3.5x
All attacks inflict a variety of debuffs and multiplies all elemental debuff damage by 3x
Most buffs last twice as long, and persist after dying
Taking damage confuses nearby enemies and spawns a dank creeper
The dank creeper flies above you, exploding into several shaderain clouds
@@ -504,8 +504,8 @@ Glaive: {
DisplayName: Glaive
Tooltip:
'''
Tosses up to 3 sharp returning glaives
Stealth strikes are super fast and pierce infinitely
Tosses a very fast and sharp returning glaive
Stealth strikes are faster and can ricochet between enemies, or stick into a single enemy
'''
}
+5 -5
View File
@@ -1004,11 +1004,11 @@ namespace CalamityMod.NPCs
//Amalgam triples all elemental debuff damage. Ironically this excludes Elemental Mix
if (IncreasedDebuffEffects_Amalgam)
{
heatDamageMult += 3.5;
coldDamageMult += 3.5;
waterDamageMult += 3.5;
sicknessDamageMult += 3.5;
electricityDamageMult += 3.5;
heatDamageMult += 3;
coldDamageMult += 3;
waterDamageMult += 3;
sicknessDamageMult += 3;
electricityDamageMult += 3;
}
// Subtract 1 for the vanilla damage multiplier because it's already dealing DoT in the vanilla regen code.
+98 -12
View File
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using CalamityMod.Items.Weapons.Rogue;
using Microsoft.Xna.Framework;
using Terraria;
@@ -14,7 +15,9 @@ namespace CalamityMod.Projectiles.Rogue
public override string Texture => "CalamityMod/Items/Weapons/Rogue/Glaive";
private static int Lifetime = 180;
private static int ReboundTime = 45;
private static int ReboundTime = 40;
private List<int> HitNPCs = [];
public ref float AIState => ref Projectile.ai[0]; // 0 - Going out. 1 - Returning. 2 - Stealth stuck to enemy.
public override void SetStaticDefaults()
{
@@ -29,21 +32,18 @@ namespace CalamityMod.Projectiles.Rogue
Projectile.friendly = true;
Projectile.tileCollide = true;
Projectile.penetrate = 3;
Projectile.MaxUpdates = 3;
Projectile.timeLeft = Lifetime;
DrawOffsetX = -10;
Projectile.DamageType = RogueDamageClass.Instance;
Projectile.usesIDStaticNPCImmunity = true;
Projectile.idStaticNPCHitCooldown = 10;
Projectile.idStaticNPCHitCooldown = 20;
}
public override void AI()
{
// ai[1] = 1 means that the projectile is a stealth strike, in which case it pierces infinitely.
if (Projectile.ai[1] == 1f)
Projectile.penetrate = Projectile.maxPenetrate = -1;
// Boomerang rotation
Projectile.rotation += 0.4f * (float)Projectile.direction;
Projectile.rotation += 0.175f * Projectile.direction;
// Boomerang sound
if (Projectile.soundDelay == 0)
@@ -54,16 +54,22 @@ namespace CalamityMod.Projectiles.Rogue
// Returns after some number of frames in the air
if (Projectile.timeLeft < Lifetime - ReboundTime)
Projectile.ai[0] = 1f;
AIState = 1f;
if (Projectile.ai[0] != 0f)
if (AIState == 0f && Projectile.ai[1] >= 0)
{
if (Projectile.timeLeft % 10 == 0)
Projectile.velocity = Utils.DirectionTo(Projectile.Center, Main.npc[(int)Projectile.ai[1]].Center) * Projectile.velocity.Length();
}
if (AIState == 1f)
{
Projectile.tileCollide = false;
float returnSpeed = Glaive.Speed * 1.6f;
float acceleration = 1.4f;
if (Projectile.ai[1] == 1f)
if (Projectile.Calamity().stealthStrike)
{
returnSpeed *= Glaive.StealthSpeedMult;
acceleration *= Glaive.StealthSpeedMult;
@@ -114,6 +120,24 @@ namespace CalamityMod.Projectiles.Rogue
if (Projectile.Hitbox.Intersects(owner.Hitbox))
Projectile.Kill();
}
if (AIState == 2f)
{
Projectile.tileCollide = false;
Projectile.velocity = Vector2.Zero;
if (Main.npc[(int)Projectile.ai[1]].active)
{
if (Projectile.FinalExtraUpdate())
Projectile.Center += Main.npc[(int)Projectile.ai[1]].velocity;
}
else
AIState = 1f;
if (Projectile.penetrate == -1)
{
AIState = 1f;
}
}
}
public override bool PreDraw(ref Color lightColor)
@@ -124,11 +148,73 @@ namespace CalamityMod.Projectiles.Rogue
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Projectile.Calamity().stealthStrike)
{
if (AIState != 2f)
{
HitNPCs.Add(target.whoAmI);
float maxDistance = 1000f;
float npcDistCompare = 1000f;
int index = -1;
foreach (NPC n in Main.ActiveNPCs) // Find an NPC to ricochet to
{
if (!n.CanBeChasedBy(Projectile) || !Projectile.WithinRange(n.Center, maxDistance) || HitNPCs.Contains(n.whoAmI))
continue;
float currentNPCDist = Vector2.Distance(n.Center, Projectile.Center);
if ((currentNPCDist < npcDistCompare) && (Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1)))
{
npcDistCompare = currentNPCDist;
index = n.whoAmI;
}
}
// If you find an NPC, ricochet in their direction and reset iframes for them
if (index != -1)
{
Projectile.ai[1] = index;
Projectile.velocity = Utils.DirectionTo(Projectile.Center, Main.npc[index].Center) * Projectile.velocity.Length();
Projectile.perIDStaticNPCImmunity[Type][index] = Main.GameUpdateCount; // Resets the iframes
}
else // If there are no new NPCs to ricochet to, try to go back to an already hit NPC
{
maxDistance = 1000f;
npcDistCompare = 1000f;
index = -1;
foreach (NPC n in Main.ActiveNPCs)
{
if (!n.CanBeChasedBy(Projectile) || !Projectile.WithinRange(n.Center, maxDistance) || n.whoAmI == target.whoAmI)
continue;
float currentNPCDist = Vector2.Distance(n.Center, Projectile.Center);
if ((currentNPCDist < npcDistCompare) && (Collision.CanHit(Projectile.Center, 1, 1, n.Center, 1, 1)))
{
npcDistCompare = currentNPCDist;
index = n.whoAmI;
}
}
// If this can find an NPC, ricochet back to them
if (index != -1)
{
Projectile.ai[1] = index;
Projectile.velocity = Utils.DirectionTo(Projectile.Center, Main.npc[index].Center) * Projectile.velocity.Length();
Projectile.perIDStaticNPCImmunity[Type][index] = Main.GameUpdateCount; // Resets the iframes
}
else // If you still find no one new, stick to the hit NPC
{
Projectile.ai[1] = target.whoAmI;
AIState = 2f;
}
}
}
Projectile.timeLeft = Lifetime + ReboundTime * 3;
}
// After its last hit, starts returning instead of vanishing. Can pierce infinitely on the way back.
if (Projectile.penetrate == 1)
{
Projectile.penetrate = -1;
Projectile.ai[0] = 1f;
AIState = 1f;
}
}
@@ -147,7 +233,7 @@ namespace CalamityMod.Projectiles.Rogue
{
Projectile.velocity.Y = -oldVelocity.Y;
}
Projectile.ai[0] = 1f;
AIState = 1f;
return false;
}
}