Merge branch '1.4.4' of https://github.com/CalamityTeam/CalamityMod into damage-hell

This commit is contained in:
Altixal committed 2025-07-21 00:25:26 +07:00
commit 52edc062e4
7 files changed
+44 -47

No files matched your search

+6 -2
View File
@@ -60,10 +60,14 @@ namespace CalamityMod.CalPlayer.DrawLayers
{
for (int j = TopRange; j <= BottomRange; j++)
{
Tile tile = Main.tile[i, j];
if (!tile.HasTile || !TileID.Sets.IsAContainer[tile.TileType] || TileID.Sets.BasicDresser[tile.TileType])
continue;
int PotentialChest = Chest.FindChestByGuessing(i, j);
if (PotentialChest != -1 && !TileID.Sets.BasicDresser[Main.tile[i, j].TileType])
if (PotentialChest != -1)
{
// Adjust position ot the center of the chest
// Adjust position to the center of the chest
Chest chest = Main.chest[PotentialChest];
Vector2 chestCenter = new Vector2(chest.x + 1, chest.y + 1) * 16f;
float distance = Vector2.Distance(chestCenter, drawPlayer.MountedCenter);
+9 -9
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee
#region stats
public static int BaseDamage = 115;
public static int DefaultAttunement_BaseDamage = 100;
public static int DefaultAttunement_BaseDamage = 90;
public static int DefaultAttunement_SigilTime = 900;
public static int DefaultAttunement_BeamTime = 90;
public static float DefaultAttunement_LungeDamageMult = 2f;
@@ -48,27 +48,27 @@ namespace CalamityMod.Items.Weapons.Melee
public static float EvilAttunement_SlashDamageBoost = 3f;
public static int EvilAttunement_SlashIFrames = 60;
public static int ColdAttunement_BaseDamage = 150;
public static int ColdAttunement_BaseDamage = 140;
public static float ColdAttunement_ThirdSwingBoost = 1.25f;
public static float ColdAttunement_MistDamageReduction = 0.11f;
public static int HotAttunement_BaseDamage = 135;
public static int HotAttunement_BaseDamage = 126;
public static int HotAttunement_PlayerShredIFrames = 8;
public static float HotAttunement_ShotDamageBoost = 4.5f;
public static int HotAttunement_LocalIFrames = 24; //Be warned its got one extra update so all the iframes should be divided in 2
public static float HotAttunement_ShredDecayRate = 0.65f; //How much charge is lost per frame.
public static int TropicalAttunement_BaseDamage = 150;
public static int TropicalAttunement_BaseDamage = 132;
public static float TropicalAttunement_ChainDamageReduction = 0.6f;
public static float TropicalAttunement_VineDamageReduction = 0.3f;
public static float TropicalAttunement_SweetSpotDamageMultiplier = 1.5f; //It also crits, so be mindful of that
public static int TropicalAttunement_LocalIFrames = 60; //Be warned its got 2 extra updates so all the iframes should be divided in 3
public static int HolyAttunement_BaseDamage = 66;
public static float HolyAttunement_BaseSwingDamageMult = 0.75f;
public static float HolyAttunement_FullSwingDamageMult = 1.5f;
public static float HolyAttunement_ThrowDamageBoost = 3.8f;
public static int HolyAttunement_LocalIFrames = 16; //Be warned its got 1 extra update yadda yadda
public static int HolyAttunement_BaseDamage = 84;
public static float HolyAttunement_BaseSwingDamageMult = 0.5f;
public static float HolyAttunement_FullSwingDamageMult = 1f;
public static float HolyAttunement_ThrowDamageBoost = 3f;
public static int HolyAttunement_LocalIFrames = 20; //Be warned its got 1 extra update yadda yadda
public static float HolyAttunement_MonolithDamage = 0.5f;
#endregion
+22 -29
View File
@@ -650,10 +650,9 @@ namespace CalamityMod.NPCs.CalClone
float phaseTimer = 400f - (death ? 120f * (1f - lifeRatio) : 0f);
if (NPC.ai[2] >= phaseTimer || phase4)
{
if (death && !phase4 && Main.rand.NextBool() && !brotherAlive)
NPC.ai[1] = 4f;
else
NPC.ai[1] = 1f;
// Prevent going to other positions during brothers phase
if (!brotherAlive)
NPC.ai[1] = death && !phase4 && Main.rand.NextBool() ? 4f : 1f;
NPC.ai[2] = 0f;
if (death)
@@ -662,18 +661,15 @@ namespace CalamityMod.NPCs.CalClone
NPC.netUpdate = true;
}
if (Main.netMode != NetmodeID.MultiplayerClient)
if (Main.netMode != NetmodeID.MultiplayerClient && !brotherAlive)
{
NPC.localAI[1] += 1f;
if (!brotherAlive)
{
if (expertMode)
NPC.localAI[1] += death ? 2f * (1f - lifeRatio) : 1f - lifeRatio;
if (revenge)
NPC.localAI[1] += 0.5f;
}
if (expertMode)
NPC.localAI[1] += death ? 2f * (1f - lifeRatio) : 1f - lifeRatio;
if (revenge)
NPC.localAI[1] += 0.5f;
if (NPC.localAI[1] >= (brotherAlive ? 180f : 120f))
if (NPC.localAI[1] >= 120f)
{
NPC.localAI[1] = 0f;
SoundEngine.PlaySound(BrimstoneElemental.BrimstoneElemental.HellfireballSound, NPC.Center);
@@ -697,24 +693,21 @@ namespace CalamityMod.NPCs.CalClone
// Avoid cheap bullshit
NPC.damage = 0;
if (Main.netMode != NetmodeID.MultiplayerClient)
if (Main.netMode != NetmodeID.MultiplayerClient && !brotherAlive)
{
NPC.localAI[1] += 1f;
if (!brotherAlive)
{
if (revenge)
NPC.localAI[1] += 0.5f;
if (expertMode)
NPC.localAI[1] += 0.5f;
}
if (revenge)
NPC.localAI[1] += 0.5f;
if (expertMode)
NPC.localAI[1] += 0.5f;
if (NPC.localAI[1] >= (brotherAlive ? 75f : 50f) && Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height))
if (NPC.localAI[1] >= 50f && Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height))
{
NPC.localAI[1] = 0f;
float projectileVelocity = expertMode ? 12.5f : 11f;
projectileVelocity += 3f * enrageScale;
int type = brotherAlive ? ModContent.ProjectileType<BrimstoneHellfireball>() : ModContent.ProjectileType<BrimstoneHellblast>();
int type = ModContent.ProjectileType<BrimstoneHellblast>();
int damage = brotherAlive ? HellfireballDamage : HellblastDamage;
Vector2 fireballVelocity = Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity;
Vector2 offset = Vector2.Normalize(fireballVelocity) * 40f;
@@ -726,9 +719,7 @@ namespace CalamityMod.NPCs.CalClone
}
else
{
float ai0 = type == ModContent.ProjectileType<BrimstoneHellblast>() ? 1f : player.position.X;
float ai1 = type == ModContent.ProjectileType<BrimstoneHellblast>() ? 0f : player.position.Y;
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, fireballVelocity, type, damage, 0f, Main.myPlayer, ai0, ai1);
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, fireballVelocity, type, damage, 0f, Main.myPlayer, 1f);
}
}
}
@@ -737,10 +728,12 @@ namespace CalamityMod.NPCs.CalClone
float phaseTimer = 240f - (death ? 60f * (1f - lifeRatio) : 0f);
if (NPC.ai[2] >= phaseTimer || phase4)
{
if (death && !phase4 && Main.rand.NextBool() && !brotherAlive)
if (brotherAlive)
NPC.ai[1] = 0f;
else if (death && !phase4 && Main.rand.NextBool())
NPC.ai[1] = 0f;
else
NPC.ai[1] = !brotherAlive && phase2 && revenge ? 4f : 0f;
NPC.ai[1] = phase2 && revenge ? 4f : 0f;
NPC.ai[2] = 0f;
if (death)
@@ -753,7 +746,7 @@ namespace CalamityMod.NPCs.CalClone
{
// Set damage
NPC.damage = NPC.defDamage;
SoundEngine.PlaySound(CalamitasClone.ChargeSound, NPC.Center);
SoundEngine.PlaySound(ChargeSound, NPC.Center);
NPC.rotation = rotation;
float chargeVelocity = phase4 ? 30f : death ? 28f : 25f;
@@ -66,7 +66,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.damage = (int)Math.Round(npc.defDamage * Phase2ContactDamageMult);
// Variables and target
bool enrage = !BossRushEvent.BossRushActive;
bool enrage = false;
bool despawn = false;
// Check for Jungle
@@ -24,15 +24,13 @@ namespace CalamityMod.Projectiles.Melee
public override void SetDefaults()
{
Projectile.DamageType = DamageClass.Melee;
Projectile.width = Projectile.height = 8;
Projectile.width = Projectile.height = 80;
Projectile.tileCollide = false;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 60;
Projectile.timeLeft = 20;
Projectile.usesIDStaticNPCImmunity = true;
Projectile.idStaticNPCHitCooldown = 10;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
@@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Melee
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
{
float collisionPoint = 0f;
float bladeLength = 100 * Projectile.scale;
float bladeLength = 105 * Projectile.scale;
float bladeWidth = 20 * Projectile.scale;
return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (direction * bladeLength), bladeWidth, ref collisionPoint);
}
@@ -171,7 +171,7 @@ namespace CalamityMod.Projectiles.Melee
//Manage position and rotation
Projectile.scale = 1 + Empowerment / maxEmpowerment * 1.5f;
Projectile.scale = 1 + Empowerment / maxEmpowerment * 1.85f;
oldDirection = direction;
direction = direction.RotatedBy(MathHelper.Clamp(Empowerment * 1.1f / maxEmpowerment, 0.45f, 1f) * MathHelper.PiOver4 * 0.20f);
@@ -222,6 +222,8 @@ namespace CalamityMod.Projectiles.Melee
modifiers.SourceDamage *= MathHelper.Lerp(1f, TrueBiomeBlade.HolyAttunement_ThrowDamageBoost, Empowerment / maxEmpowerment);
else
modifiers.SourceDamage *= MathHelper.Lerp(TrueBiomeBlade.HolyAttunement_BaseSwingDamageMult, TrueBiomeBlade.HolyAttunement_FullSwingDamageMult, Empowerment / maxEmpowerment);
modifiers.HitDirectionOverride = (Owner.Center.X > target.Center.X).ToDirectionInt();
}
public override void OnKill(int timeLeft)
@@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.timeLeft = 102;
Projectile.scale = Scale;
Projectile.usesIDStaticNPCImmunity = true;
Projectile.idStaticNPCHitCooldown = 10;
Projectile.idStaticNPCHitCooldown = 20;
Projectile.hide = true;
}