Merge pull request #1387 from CalamityTeam/cit-misc-seven

Cit misc seven
This commit is contained in:
Doze-Zoze authored and GitHub committed 2026-04-21 22:12:00 -05:00
commit 3d1943b4c7
15 files changed
+69 -90

No files matched your search

+26
View File
@@ -401,6 +401,32 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Flail Balance Changes
// Make flails be unaffected by player velocity
private static void FlailsNoLongerAffectedByPlayerVelocity(On_Projectile.orig_AI_015_Flails orig, Projectile self)
{
orig(self);
if (self.ai[0] == 1f && self.ai[1] == 0f)
self.velocity -= Main.player[self.owner].velocity;
}
// Increase Flower Pow's return speed
private static void IncreaseFlowerPowRetSpeed(ILContext il)
{
var cursor = new ILCursor(il);
// Move to where Flower Pow receives its specific flail stat changes. This moves it after num2 = 23f
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcR4(23f), i => i.MatchStloc(6)))
{
LogFailure("Flower Pow Buff", "Could not move to Flower Pow's specific flail stat changes.");
return;
}
// Emit an instruction setting num5 (the return speed) to 21. Vanilla is 16
cursor.Emit(OpCodes.Ldc_R4, 21f);
cursor.Emit(OpCodes.Stloc, 9);
}
#endregion
#region Terrarian Projectile Limitation for Extra Updates
private static void LimitTerrarianProjectiles(ILContext il)
{
+2 -1
View File
@@ -106,6 +106,8 @@ namespace CalamityMod.ILEditing
IL_NPC.ScaleStats_ApplyExpertTweaks += RemoveExpertHardmodeScaling;
IL_Projectile.Damage += VanillaBossResistChanges;
IL_Projectile.AI_099_2 += LimitTerrarianProjectiles;
On_Projectile.AI_015_Flails += FlailsNoLongerAffectedByPlayerVelocity;
IL_Projectile.AI_015_Flails += IncreaseFlowerPowRetSpeed;
IL_Projectile.AI_120_StardustGuardian += StardustGuardianAttackBuffs;
On_Player.ConsumeSolarFlare += SolarWingsDashChange;
On_Projectile.IsDamageDodgable += GFBNurseMeteorUndodgeable;
@@ -150,7 +152,6 @@ namespace CalamityMod.ILEditing
IL_Item.TryGetPrefixStatMultipliersForItem += RelaxPrefixRequirements;
On_NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns;
On_ShimmerTransforms.IsItemTransformLocked += AdjustShimmerRequirements;
On_Projectile.AI_015_Flails += FlailsNoLongerAffectedByPlayerVelocity;
IL_Projectile.AI_061_FishingBobber += WhitelistVictideBobber;
On_Player.ItemCheck_CheckFishingBobbers += PreventVictideBobberFromJamming;
@@ -318,15 +318,6 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Remove Flail Throw Velocity Being Affected By Player Velocity
private static void FlailsNoLongerAffectedByPlayerVelocity(On_Projectile.orig_AI_015_Flails orig, Projectile self)
{
orig(self);
if (self.ai[0] == 1f && self.ai[1] == 0f)
self.velocity -= Main.player[self.owner].velocity;
}
#endregion
#region Allow Victide Bobber to Exist
private static void WhitelistVictideBobber(ILContext il)
{
+3 -3
View File
@@ -49,7 +49,7 @@ namespace CalamityMod.Items
{ ItemID.Anchor, Do(DamageExact(107), UseExact(30)) }, // VANILLA: 70 DMG, 20 UT
{ ItemID.AntlionClaw, Do(UseExact(10)) }, // Mandible Blade. VANILLA: 18 UT
{ ItemID.AquaScepter, Do(DamageRatio(0.9f)) }, // VANILLA: 27 DMG. Uses ratios due to remix seed
{ ItemID.Bananarang, Do(DamageExact(76), UseExact(14)) }, // VANILLA: 45 DMG, 11 UT
{ ItemID.Bananarang, Do(DamageExact(60)) }, // VANILLA: 45 DMG
{ ItemID.BatScepter, Do(DamageExact(50)) }, // VANILLA: 45 DMG
{ ItemID.BeamSword, Do(UseMeleeSpeed, DamageExact(131), UseAnimationExact(40), KnockbackExact(8)) }, // VANILLA: 52 DMG, 20 UT, 6.5 KB
{ ItemID.BeeGun, Do(DamageExact(11)) }, // VANILLA: 9 DMG
@@ -95,7 +95,7 @@ namespace CalamityMod.Items
{ ItemID.DarkLance, Do(TrueMelee, DamageExact(40)) }, // VANILLA: 34 DMG
{ ItemID.DartRifle, Do(DamageExact(58)) }, // VANILLA: 52 DMG
{ ItemID.DayBreak, Do(DamageExact(125), UseExact(22)) }, // VANILLA: 150 DMG, 16 UT
{ ItemID.DD2BetsyBow, Do(DamageExact(42)) }, // VANILLA: 39 DMG. Compensation for removing aerial multiplier
{ ItemID.DD2BetsyBow, Do(DamageExact(42)) }, // Aerial Bane. VANILLA: 39 DMG. Compensation for removing aerial multiplier
{ ItemID.DD2SquireBetsySword, Do(UseMeleeSpeed, DamageExact(150)) }, // Flying Dragon. VANILLA: 180 DMG
{ ItemID.DeadlySphereStaff, Do(DamageExact(50)) }, // VANILLA: 40 DMG
{ ItemID.DeathSickle, Do(UseMeleeSpeed, DamageExact(65), ShootSpeedExact(15f)) }, // VANILLA: 57 DMG, 9 VEL
@@ -116,6 +116,7 @@ namespace CalamityMod.Items
{ ItemID.Flamelash, Do(DamageExact(36)) }, // VANILLA: 32 DMG
{ ItemID.Flamethrower, Do(DamageExact(21), ShootSpeedDelta(+3f)) }, // VANILLA: 35 DMG, 7 VEL
{ ItemID.FlowerofFire, Do(DamageRatio(0.78f)) }, // VANILLA: 48 DMG. Uses ratios due to remix seed
{ ItemID.FlowerPow, Do(DamageExact(80)) }, // Displays as 160 damage. VANILLA: 65 DMG (displays as 130)
{ ItemID.FlyingKnife, Do(DamageExact(53)) }, // VANILLA: 40 DMG
{ ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(88)) }, // VANILLA: 49 DMG
{ ItemID.Gatligator, Do(UseExact(6)) }, // VANILLA: 7 UT
@@ -156,7 +157,6 @@ namespace CalamityMod.Items
{ ItemID.Marrow, Do(DamageExact(60)) }, // VANILLA: 53 DMG
{ ItemID.MedusaHead, Do(DamageExact(75)) }, // VANILLA: 40 DMG
{ ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)) }, // VANILLA: 200 DMG
{ ItemID.MeteorStaff, Do(DamageExact(58), ShootSpeedExact(13f)) }, // VANILLA: 50 DMG, 10 VEL
{ ItemID.MiniNukeI, Do(DamageExact(90)) }, // VANILLA: 75 DMG
{ ItemID.MiniNukeII, Do(DamageExact(90)) },
{ ItemID.Minishark, Do(DamageExact(4)) }, // VANILLA: 6 DMG
@@ -61,6 +61,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
"Cooper",
"CosmaticMango",
"CrabBar",
"Critaquil",
"Dandy",
"Dia",
"Done",
@@ -68,9 +69,9 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
"Flowaria",
"Fluffy",
"fryzahh",
"Gpscorpion",
"jasper",
"LordMetarex",
"math2",
"Moonburn",
"Ozzatron",
"Piky",
@@ -147,6 +148,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
"Lompl Allimath",
"Lucille Karma",
"MarieArk",
"math2",
"Mercutio 'Merkalto' Takle",
"Mihaii",
"Minecat",
+1 -1
View File
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = 28;
Item.height = 30;
Item.damage = 69;
Item.damage = 56;
Item.DamageType = DamageClass.Magic;
Item.mana = 8;
Item.useTime = 20;
+1 -1
View File
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon
Item.width = 28;
Item.height = 20;
Item.mana = 10;
Item.damage = 8;
Item.damage = 7;
Item.useAnimation = Item.useTime = 30;
Item.useStyle = ItemUseStyleID.HoldUp;
Item.noMelee = true;
+2 -2
View File
@@ -32,8 +32,8 @@ namespace CalamityMod.NPCs.Cryogen
NPC.width = 216;
NPC.height = 216;
NPC.scale *= (CalamityWorld.death || BossRushEvent.BossRushActive || Main.getGoodWorld) ? 0.8f : 1f;
NPC.DR_NERD(0.4f);
NPC.LifeMaxNERB(2800, 3360, 33600);
NPC.DR_NERD(0.25f);
NPC.LifeMaxNERB(2500, 3000, 30000);
NPC.Opacity = 0f;
NPC.HitSound = Cryogen.HitSound;
NPC.DeathSound = BreakSound;
@@ -352,6 +352,8 @@ public class BrainOfCthulhuAI : VanillaAIOverride
NPC.defense = NPC.defDefense;
NPC.chaseable = (AIState != BrainAIState.IllusionDash && AIState != BrainAIState.IllusionTrick);
if (Main.getGoodWorld && AIState >= BrainAIState.Phase2TransitionOpen)
NPC.brainOfGravity = NPC.whoAmI;
}
else
NPC.defense = (int)(NPC.defDefense * Phase1DefenseMultiplier);
@@ -155,18 +155,19 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Start other phases; if arms are dead, start with spin phase
if (phase2 || Main.getGoodWorld || allArmsDead)
{
// Start spin phase after 1.5 seconds
// Start spin phase after 1.5 seconds if close enough; forced after 4.5 seconds
NPC.ai[2] += phase3 ? 1.5f : 1f;
if (NPC.ai[2] >= (90f - (death ? 15f * (1f - lifeRatio) : 0f)))
{
bool shouldSpinAround = NPC.ai[1] == 4f && NPC.position.Y < Main.player[NPC.target].position.Y - 320f &&
Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) < 600f && Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 400f;
bool shouldSpinAround = NPC.ai[1] == 4f && ((NPC.position.Y < Main.player[NPC.target].position.Y - 320f &&
Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) < 600f && Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 400f) ||
NPC.ai[2] >= (270f - (death ? 15f * (1f - lifeRatio) : 0f)));
if (shouldSpinAround || NPC.ai[1] != 4f)
{
if (shouldSpinAround)
{
NPC.localAI[3] = 300f;
NPC.localAI[3] = 200f;
NPC.localAI[1] = 0;
NPC.SyncVanillaLocalAI();
}
@@ -309,7 +310,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
{
CalamityUtils.CalamityTargeting(NPC, CalamityTargetingParameters.BossDefaults);
NPC.ai[2] = 0f;
NPC.ai[1] = 4f;
// Fly overhead and spit missiles if on low health
NPC.ai[1] = phase3 ? 6f : 4f;
NPC.localAI[0] = 0f;
}
@@ -475,7 +477,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Spin for about 3 seconds
// Decreasing this number will INCREASE how fast he moves while spinning
float spinVelocity = 30f;
float spinVelocity = 25f;
if (NPC.ai[2] == 2f)
{
// Play angry noise
@@ -540,8 +542,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
{
NPC.velocity = NPC.velocity.SafeNormalize(Vector2.UnitY);
// Fly overhead and spit missiles if on low health
NPC.ai[1] = phase3 ? 6f : 1f;
NPC.ai[1] = 1f;
NPC.ai[2] = 0f;
NPC.localAI[3] = 0f;
NPC.localAI[0] = 0f;
@@ -590,8 +591,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (NPC.localAI[0] >= totalMissiles)
{
NPC.ai[1] = 0f;
NPC.ai[2] = 0f;
NPC.ai[1] = 4f;
NPC.ai[2] = -60f;
NPC.localAI[3] = 0f;
calamityGlobalNPC.newAI[0] = 0f;
NPC.localAI[0] = 0f;
+5 -36
View File
@@ -253,7 +253,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
else
NPC.rotation = NPC.velocity.ToRotation() - MathHelper.PiOver2;
float delayBeforeChargingAgain = death ? 48f : 56f;
float delayBeforeChargingAgain = death ? 50f : 60f;
if (NPC.ai[2] >= delayBeforeChargingAgain)
{
NPC.ai[3] += 1f;
@@ -314,21 +314,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
NPC.rotation += NPC.ai[2];
NPC.ai[1] += 1f;
if (death && NPC.ai[2] >= 0.2f)
{
if (NPC.ai[1] % 10f == 0f)
{
SoundEngine.PlaySound(SoundID.Item33, NPC.Center);
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int type = ProjectileID.DeathLaser;
Vector2 projectileVelocity = NPC.rotation.ToRotationVector2() * 7f;
float offset = 90f;
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projectileVelocity) * offset, projectileVelocity, type, LaserDamage.CalculateMechDamage(), 0f, Main.myPlayer);
}
}
}
if (NPC.ai[1] == 100f)
{
@@ -620,7 +605,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
else if (NPC.ai[1] == 4f)
{
float chargeLineUpDistance = spazAlive ? 600f : 500f;
float chargeSpeed = (death ? 20f : 18f) + (death ? 1.5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f);
float chargeSpeed = death ? 5f : 3f;
float chargeAcceleration = death ? 0.495f : 0.45f;
if (spazAlive)
@@ -844,7 +829,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Rotation and velocity
NPC.rotation = hoverRotation;
float chargeSpeed = death ? 19.25f + (phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio))) : 18f;
float chargeSpeed = 16f;
if (death)
chargeSpeed += (phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)));
if (Main.getGoodWorld)
chargeSpeed *= 1.2f;
@@ -935,20 +922,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
NPC.rotation += NPC.ai[2];
NPC.ai[1] += 1f;
if (death && NPC.ai[2] >= 0.2f)
{
if (NPC.ai[1] % 10f == 0f)
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int type = NPC.ai[1] % 20f == 0f ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType<ShadowflameFireball>();
Vector2 projectileVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * 16f + Main.rand.NextVector2CircularEdge(3f, 3f);
int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 50f, projectileVelocity, type, FireballDamage.CalculateMechDamage(), 0f, Main.myPlayer, 0f, 1f);
Main.projectile[proj].tileCollide = false;
}
}
}
if (NPC.ai[1] == 100f)
{
@@ -1025,10 +998,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (!NPC.IsMechQueenUp)
{
// Boost speed if too far from target
if (distanceFromDestination > distanceFromTarget)
maxVelocity += MathHelper.Lerp(0f, 6f, MathHelper.Clamp((distanceFromDestination - distanceFromTarget) / 1000f, 0f, 1f));
if (Main.getGoodWorld)
{
maxVelocity *= 1.15f;
@@ -91,12 +91,9 @@ public class BloodScythe : ModProjectile, ILocalizedModType
public override bool PreDraw(ref Color lightColor)
{
Main.spriteBatch.SetBlendState(BlendState.Additive);
Texture2D tex = TextureAssets.Projectile[Type].Value;
Vector2 drawPos = Projectile.Center - Main.screenPosition;
Color drawColor = Color.Red;
if (!ChildSafety.Disabled)
drawColor = Main.DiscoColor;
Color drawColor = (ChildSafety.Disabled ? Color.Red : Main.DiscoColor) with { A = 0 };
for (int i = 0; i < (CalamityClientConfig.Instance.Afterimages ? Projectile.oldPos.Length : 1); ++i)
{
@@ -107,11 +104,9 @@ public class BloodScythe : ModProjectile, ILocalizedModType
// DO NOT REMOVE THESE "UNNECESSARY" FLOAT CASTS. THIS WILL BREAK THE AFTERIMAGES.
float interpolant = ((float)(Projectile.oldPos.Length - i) / (float)Projectile.oldPos.Length);
Main.spriteBatch.Draw(tex, drawPos, null, drawColor, afterimageRot, tex.Size() * 0.5f, Projectile.scale * interpolant, SpriteEffects.None, 0f);
Main.EntitySpriteDraw(tex, drawPos, null, drawColor, afterimageRot, tex.Size() * 0.5f, Projectile.scale * interpolant, SpriteEffects.None);
}
Main.spriteBatch.SetBlendState(BlendState.AlphaBlend);
return false;
}
}
+5 -16
View File
@@ -3887,20 +3887,14 @@ namespace CalamityMod.Projectiles
}
#region Flail Extendo Hacks
// Very hacky solution for making Dao of Pow's flail throw travel farther and faster
// Very hacky solution for making Dao of Pow's flail throw travel faster
if (projectile.type == ProjectileID.TheDaoofPow)
{
// Guide to ai[0]:
// 0: Spinning. 1: Being thrown. 2: Return after throw. 6: Dropped on ground. 4: Return after being dropped.
if (projectile.ai[0] == 1f)
{
if (projectile.ai[1] > 0f)
{
projectile.ai[2]++;
if (projectile.ai[2] <= 11f) // When ai[1] reaches 14, it starts returning, so this makes it take an extra 11 frames to return
projectile.ai[1]--;
}
else
if (projectile.ai[1] == 0f)
projectile.velocity *= 1.33f;
}
}
@@ -3922,15 +3916,10 @@ namespace CalamityMod.Projectiles
{
if (projectile.ai[0] == 1f)
{
if (projectile.ai[1] > 0f)
{
projectile.ai[2]++;
if (projectile.ai[2] <= 5f) // When ai[1] reaches 12, it starts returning, so this makes it take an extra 5 frames to return
projectile.ai[1]--;
}
else
projectile.velocity *= 1.33f;
if (projectile.ai[1] == 0f)
projectile.velocity *= 1.25f;
}
// Return speed is also increased using an IL edit, because why does it have a slower return speed than Dao of Pow???
}
#endregion
@@ -188,6 +188,7 @@ namespace CalamityMod.Projectiles
{ ProjectileID.PalladiumDrill, standardDrillTweaks },
{ ProjectileID.PartyBullet, Do(ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) },
{ ProjectileID.PurpleCounterweight, counterweightTweaks },
{ ProjectileID.PurpleLaser, Do(LocalIFrames(10 * 5)) }, // Laser Rifle, accounting for extra updates
{ ProjectileID.QueenSlimeGelAttack, Do(NoPiercing) },
{ ProjectileID.QueenSlimeMinionPinkBall, Do(NoPiercing) },
{ ProjectileID.RedCounterweight, counterweightTweaks },
@@ -491,7 +492,6 @@ namespace CalamityMod.Projectiles
{ ProjectileID.PulseBolt, defaultIFrames },
{ ProjectileID.PureSpray, defaultIFrames },
{ ProjectileID.PurificationPowder, defaultIFrames },
{ ProjectileID.PurpleLaser, defaultIFrames },
{ ProjectileID.PygmySpear, defaultIFrames },
{ ProjectileID.QuarterNote, defaultIFrames },
{ ProjectileID.RainbowFlare, defaultIFrames },
+5 -2
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Magic
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 12;
Projectile.localNPCHitCooldown = 10;
Projectile.hide = true;
}
@@ -152,7 +152,7 @@ namespace CalamityMod.Projectiles.Magic
}
// Can only deal damage while not fizzling out.
public override bool? CanDamage() => !Released;
public override bool? CanDamage() => !Released && Timer % Projectile.localNPCHitCooldown == 0;
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
@@ -160,6 +160,9 @@ namespace CalamityMod.Projectiles.Magic
SoundEngine.PlaySound(Burn, target.Center);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180);
if (damageDone > 2 && !target.Calamity().IsArmored())
Projectile.damage = (int)(Projectile.damage * 0.7f);
// Whoa buddy no smoking allowed
for (int i = 0; i < 4; i++)
{