diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 8133b175a2..06e7287c0e 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -6532,186 +6532,59 @@ namespace CalamityMod.CalPlayer player.palladiumRegen = false; player.iceBarrier = false; player.crystalLeaf = false; + + PlayerDeathReason damageSource = PlayerDeathReason.ByOther(player.Male ? 14 : 15); if (abyssDeath) { if (Main.rand.NextBool(2)) { - PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason(player.name + " is food for the Wyrms."); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); + damageSource = PlayerDeathReason.ByCustomReason(player.name + " is food for the Wyrms."); } else { - PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason("Oxygen failed to reach " + player.name + " from the depths of the Abyss."); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); + damageSource = PlayerDeathReason.ByCustomReason("Oxygen failed to reach " + player.name + " from the depths of the Abyss."); } } else if (specialDeath) { - PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason(player.name + " was defeated."); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); - } - else if (SCalLore) - { - PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason(player.Male ? player.name + " was consumed by his inner hatred." : player.name + " was consumed by her inner hatred."); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); - } - else if (CalamityWorld.armageddon && areThereAnyDamnBosses) - { - PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason(player.name + " failed the challenge at hand."); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); - } - else if (CalamityWorld.bossRushActive && bossRushImmunityFrameCurseTimer > 0) - { - PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason(player.name + " was destroyed by a mysterious force."); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); + damageSource = PlayerDeathReason.ByCustomReason(player.name + " was defeated."); } else if (CalamityWorld.death && deathModeBlizzardTime > 1980) { deathModeBlizzardTime = 0; - PlayerDeathReason damageSource = PlayerDeathReason.ByCustomReason(player.name + " was chilled to the bone by the frigid environment."); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); + damageSource = PlayerDeathReason.ByCustomReason(player.name + " was chilled to the bone by the frigid environment."); } - else + else if (SCalLore) { - PlayerDeathReason damageSource = PlayerDeathReason.ByOther(player.Male ? 14 : 15); - NetworkText deathText = damageSource.GetDeathText(player.name); - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - { - NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); - } - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); - } - else if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(deathText.ToString(), 225, 25, 25, false); - } - if (player.whoAmI == Main.myPlayer && player.difficulty == 0) - { - player.DropCoins(); - } - player.DropTombstone(coinsOwned, deathText, 0); + damageSource = PlayerDeathReason.ByCustomReason(player.Male ? player.name + " was consumed by his inner hatred." : player.name + " was consumed by her inner hatred."); } + else if (CalamityWorld.armageddon && areThereAnyDamnBosses) + { + damageSource = PlayerDeathReason.ByCustomReason(player.name + " failed the challenge at hand."); + } + else if (CalamityWorld.bossRushActive && bossRushImmunityFrameCurseTimer > 0) + { + damageSource = PlayerDeathReason.ByCustomReason(player.name + " was destroyed by a mysterious force."); + } + NetworkText deathText = damageSource.GetDeathText(player.name); + if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) + { + NetMessage.SendPlayerDeath(player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); + } + if (Main.netMode == NetmodeID.Server) + { + NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25), -1); + } + else if (Main.netMode == NetmodeID.SinglePlayer) + { + Main.NewText(deathText.ToString(), 225, 25, 25, false); + } + if (player.whoAmI == Main.myPlayer && player.difficulty == 0) + { + player.DropCoins(); + } + player.DropTombstone(coinsOwned, deathText, 0); + if (player.whoAmI == Main.myPlayer) { try diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 00b4e73538..cdc407611f 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -297,7 +297,8 @@ namespace CalamityMod.CalPlayer player.buffImmune[BuffID.Electrified] = true; // Reduce breath meter while in icy water instead of chilling - if (player.arcticDivingGear) + bool canBreath = ((modPlayer.sirenBoobs && NPC.downedBoss3) || (modPlayer.sirenBoobsAlt && NPC.downedBoss3) || player.gills || player.merman); + if (player.arcticDivingGear || canBreath) { player.buffImmune[ModContent.BuffType()] = true; } @@ -308,7 +309,7 @@ namespace CalamityMod.CalPlayer player.buffImmune[BuffID.Chilled] = true; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { - if (Main.myPlayer == player.whoAmI && !player.gills && !player.merman) + if (Main.myPlayer == player.whoAmI) { player.AddBuff(ModContent.BuffType(), 2, false); } diff --git a/Items/Weapons/Summon/LanternoftheSoul.cs b/Items/Weapons/Summon/LanternoftheSoul.cs index cba56d8f19..812ea0b3e1 100644 --- a/Items/Weapons/Summon/LanternoftheSoul.cs +++ b/Items/Weapons/Summon/LanternoftheSoul.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Guidelight of Oblivion"); - Tooltip.SetDefault("Summons a lantern turret to fight for you"); + Tooltip.SetDefault("Shadows dream of endless fire, flames devour and embers swoop\n" + + "Summons a lantern turret to fight for you"); } public override void SetDefaults() diff --git a/Items/Weapons/Summon/LanternoftheSoul.png b/Items/Weapons/Summon/LanternoftheSoul.png index 2f2f239a4b..14f434d0b6 100644 Binary files a/Items/Weapons/Summon/LanternoftheSoul.png and b/Items/Weapons/Summon/LanternoftheSoul.png differ diff --git a/Projectiles/Summon/ElementalAxeMinion.cs b/Projectiles/Summon/ElementalAxeMinion.cs index e8a29c54ae..00d3c6afe2 100644 --- a/Projectiles/Summon/ElementalAxeMinion.cs +++ b/Projectiles/Summon/ElementalAxeMinion.cs @@ -34,6 +34,8 @@ namespace CalamityMod.Projectiles.Summon projectile.minion = true; projectile.tileCollide = false; projectile.extraUpdates = 1; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 4; } public override void AI() @@ -260,7 +262,6 @@ namespace CalamityMod.Projectiles.Summon public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.immune[projectile.owner] = 4; target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); diff --git a/Projectiles/Summon/LanternFlame.cs b/Projectiles/Summon/LanternFlame.cs index d912c1f3a3..61f464b669 100644 --- a/Projectiles/Summon/LanternFlame.cs +++ b/Projectiles/Summon/LanternFlame.cs @@ -3,10 +3,13 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.Projectiles.Summon { public class LanternFlame : ModProjectile { + private bool playSound = true; + public override void SetStaticDefaults() { DisplayName.SetDefault("Flame"); @@ -28,14 +31,14 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.65f / 255f); + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 1f / 255f, 0f, 0f); projectile.frameCounter++; if (projectile.frameCounter > 4) { projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame > 3) + if (projectile.frame >= 4) { projectile.frame = 0; } @@ -113,10 +116,9 @@ namespace CalamityMod.Projectiles.Summon projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); - Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 74); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -126,17 +128,22 @@ namespace CalamityMod.Projectiles.Summon } for (int num623 = 0; num623 < 15; num623++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(BuffID.ShadowFlame, 180); + target.AddBuff(ModContent.BuffType(), 180); + if (playSound) + { + Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 74); + } + playSound = false; } } } diff --git a/Projectiles/Summon/LanternFlame.png b/Projectiles/Summon/LanternFlame.png index 3009ead213..70b7fc439e 100644 Binary files a/Projectiles/Summon/LanternFlame.png and b/Projectiles/Summon/LanternFlame.png differ diff --git a/Projectiles/Summon/LanternSoul.cs b/Projectiles/Summon/LanternSoul.cs index 15adccf180..ccbe72b1b2 100644 --- a/Projectiles/Summon/LanternSoul.cs +++ b/Projectiles/Summon/LanternSoul.cs @@ -7,11 +7,12 @@ namespace CalamityMod.Projectiles.Summon { public class LanternSoul : ModProjectile { - public float count = 0; + public float count = 0f; public override void SetStaticDefaults() { DisplayName.SetDefault("Lantern"); + Main.projFrames[projectile.type] = 4; ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; } @@ -28,13 +29,24 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.65f / 255f); + Lighting.AddLight(projectile.Center, 1f, 0f, 0f); + projectile.frameCounter++; + if (projectile.frameCounter > 4) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 4) + { + projectile.frame = 0; + } + Player player = Main.player[projectile.owner]; - if (projectile.localAI[0] == 0f) + if (count == 0f) { projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; - projectile.localAI[0] += 1f; + count += 1f; } if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { diff --git a/Projectiles/Summon/LanternSoul.png b/Projectiles/Summon/LanternSoul.png index 335f855c50..b7f6c92e8c 100644 Binary files a/Projectiles/Summon/LanternSoul.png and b/Projectiles/Summon/LanternSoul.png differ