diff --git a/CalamityMod.cs b/CalamityMod.cs index d8bd5a0e21..ffa17d5ffe 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -302,6 +302,7 @@ namespace CalamityMod // Centralizing head texture registration like this seems absurdly stiff Apollo.LoadHeadIcons(); Artemis.LoadHeadIcons(); + Cryogen.LoadHeadIcons(); DevourerofGodsHead.LoadHeadIcons(); DevourerofGodsBody.LoadHeadIcons(); DevourerofGodsTail.LoadHeadIcons(); diff --git a/Items/SummonItems/CryoKey.cs b/Items/SummonItems/CryoKey.cs index c61beec655..133a7bac1b 100644 --- a/Items/SummonItems/CryoKey.cs +++ b/Items/SummonItems/CryoKey.cs @@ -1,15 +1,20 @@ using CalamityMod.Events; using CalamityMod.Items.Materials; using CalamityMod.NPCs.Cryogen; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System.Linq; +using System.Collections.Generic; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; namespace CalamityMod.Items.SummonItems { public class CryoKey : ModItem { + // Todo: Change all Main.getGoodWorlds here once 1.4.4 porting has begun public override void SetStaticDefaults() { SacrificeTotal = 1; @@ -22,8 +27,8 @@ namespace CalamityMod.Items.SummonItems public override void SetDefaults() { - Item.width = 28; - Item.height = 18; + Item.width = 26; + Item.height = 48; Item.rare = ItemRarityID.Pink; Item.useAnimation = 10; Item.useTime = 10; @@ -51,6 +56,40 @@ namespace CalamityMod.Items.SummonItems return true; } + public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + Texture2D texture = ModContent.Request("CalamityMod/Items/SummonItems/CryoKey").Value; + Color overlay = Main.getGoodWorld ? Color.Red : Color.White; + spriteBatch.Draw(texture, position, null, overlay, 0f, origin, scale, 0, 0); + return false; + } + + public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) + { + Texture2D texture = ModContent.Request("CalamityMod/Items/SummonItems/CryoKey").Value; + Color overlay = Main.getGoodWorld ? Color.Red : lightColor; + spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, overlay, 0f, Vector2.Zero, 1f, 0, 0); + return false; + } + + public override void ModifyTooltips(List list) + { + Player player = Main.LocalPlayer; + TooltipLine name = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "ItemName"); + TooltipLine line0 = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip0"); + + if (Main.getGoodWorld) + { + name.Text = "Pyro Key"; + line0.Text = "Summons Cryogen when used in the tundra...?"; + } + else + { + name.Text = "Cryo Key"; + line0.Text = "Summons Cryogen when used in the tundra"; + } + } + public override void AddRecipes() { CreateRecipe(). diff --git a/Localization/CalamityLocalization.cs b/Localization/CalamityLocalization.cs index 5a17418ff7..440c385d7e 100644 --- a/Localization/CalamityLocalization.cs +++ b/Localization/CalamityLocalization.cs @@ -105,6 +105,7 @@ namespace CalamityMod.Localization new [] { "SandSharkText3", "The desert sand shifts intensely!" }, new [] { "CryogenBossText", "Cryogen is derping out!" }, + new [] { "PyrogenBossText", "Pyrogen is derping out!" }, new [] { "DraedonIntroductionText1", "I have waited long for this moment." }, new [] { "DraedonIntroductionText2", "Your nature fascinates me, for I do not understand it." }, diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index ca42e4cd9c..ce9b0b7e9b 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -1,4 +1,6 @@ -using CalamityMod.Events; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Effects; +using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Wings; using CalamityMod.Items.Armor.Vanity; @@ -14,6 +16,7 @@ using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.TownNPCs; +using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.Tiles.AstralSnow; using CalamityMod.Tiles.Ores; @@ -29,6 +32,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using Terraria.GameContent.ItemDropRules; +using Terraria.Graphics.Shaders; namespace CalamityMod.NPCs.Cryogen { @@ -43,6 +47,23 @@ namespace CalamityMod.NPCs.Cryogen public override string Texture => "CalamityMod/NPCs/Cryogen/Cryogen_Phase1"; + public FireParticleSet FireDrawer = null; + + public static int cryoIconIndex; + public static int pyroIconIndex; + + internal static void LoadHeadIcons() + { + string cryoIconPath = "CalamityMod/NPCs/Cryogen/Cryogen_Phase1_Head_Boss"; + string pyroIconPath = "CalamityMod/NPCs/Cryogen/Pyrogen_Head_Boss"; + + CalamityMod.Instance.AddBossHeadTexture(cryoIconPath, -1); + cryoIconIndex = ModContent.GetModBossHeadSlot(cryoIconPath); + + CalamityMod.Instance.AddBossHeadTexture(pyroIconPath, -1); + pyroIconIndex = ModContent.GetModBossHeadSlot(pyroIconPath); + } + public override void SetStaticDefaults() { DisplayName.SetDefault("Cryogen"); @@ -72,12 +93,30 @@ namespace CalamityMod.NPCs.Cryogen NPC.coldDamage = true; NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath15; - NPC.Calamity().VulnerableToHeat = true; - NPC.Calamity().VulnerableToCold = false; - NPC.Calamity().VulnerableToSickness = false; if (Main.getGoodWorld) + { NPC.scale *= 0.8f; + // Move these to zenith seed later + NPC.Calamity().VulnerableToHeat = false; + NPC.Calamity().VulnerableToCold = true; + NPC.Calamity().VulnerableToWater = true; + } + else + { + NPC.Calamity().VulnerableToHeat = true; + NPC.Calamity().VulnerableToCold = false; + NPC.Calamity().VulnerableToSickness = false; + } + } + + public override void BossHeadSlot(ref int index) + { + // Move to zenith seed later + if (Main.getGoodWorld) + index = pyroIconIndex; + else + index = cryoIconIndex; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -114,6 +153,9 @@ namespace CalamityMod.NPCs.Cryogen Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 0f, 1f, 1f); + if (FireDrawer != null) + FireDrawer.Update(); + // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) NPC.TargetClosest(); @@ -164,6 +206,17 @@ namespace CalamityMod.NPCs.Cryogen bool phase6 = lifeRatio < (death ? 0.35f : 0.25f) && revenge; bool phase7 = lifeRatio < (death ? 0.25f : 0.15f) && revenge; + // Projectile and sound variables + // Move to zenith seed later + int iceBlast = Main.getGoodWorld ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int iceBomb = Main.getGoodWorld ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int iceRain = Main.getGoodWorld ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int dustType = Main.getGoodWorld ? 235 : 67; + + SoundStyle frostSound = Main.getGoodWorld ? SoundID.Item20 : SoundID.Item28; + NPC.HitSound = Main.getGoodWorld ? SoundID.NPCHit41 : SoundID.NPCHit5; + NPC.DeathSound = Main.getGoodWorld ? SoundID.NPCDeath14 : SoundID.NPCDeath15; + // Reset damage NPC.damage = NPC.defDamage; @@ -249,10 +302,10 @@ namespace CalamityMod.NPCs.Cryogen if (calamityGlobalNPC.newAI[3] >= (bossRush ? 660f : 900f)) { calamityGlobalNPC.newAI[3] = 0f; - SoundEngine.PlaySound(SoundID.Item28, NPC.Center); + SoundEngine.PlaySound(frostSound, NPC.Center); int totalProjectiles = 3; float radians = MathHelper.TwoPi / totalProjectiles; - int type = ModContent.ProjectileType(); + int type = iceBomb; int damage = NPC.GetProjectileDamage(type); float velocity = 2f + NPC.ai[0]; double angleA = radians * 0.5; @@ -280,10 +333,10 @@ namespace CalamityMod.NPCs.Cryogen NPC.TargetClosest(); if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { - SoundEngine.PlaySound(SoundID.Item28, NPC.Center); + SoundEngine.PlaySound(frostSound, NPC.Center); int totalProjectiles = bossRush ? 24 : 16; float radians = MathHelper.TwoPi / totalProjectiles; - int type = ModContent.ProjectileType(); + int type = iceBlast; int damage = NPC.GetProjectileDamage(type); float velocity = 9f + enrageScale; Vector2 spinningPoint = new Vector2(0f, -velocity); @@ -340,10 +393,10 @@ namespace CalamityMod.NPCs.Cryogen NPC.TargetClosest(); if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { - SoundEngine.PlaySound(SoundID.Item28, NPC.Center); + SoundEngine.PlaySound(frostSound, NPC.Center); int totalProjectiles = bossRush ? 18 : 12; float radians = MathHelper.TwoPi / totalProjectiles; - int type = ModContent.ProjectileType(); + int type = iceBlast; int damage = NPC.GetProjectileDamage(type); float velocity2 = 9f + enrageScale; Vector2 spinningPoint = new Vector2(0f, -velocity2); @@ -414,8 +467,8 @@ namespace CalamityMod.NPCs.Cryogen { if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { - SoundEngine.PlaySound(SoundID.Item28, NPC.Center); - int type = ModContent.ProjectileType(); + SoundEngine.PlaySound(frostSound, NPC.Center); + int type = iceRain; int damage = NPC.GetProjectileDamage(type); float maxVelocity = 9f + enrageScale; float velocity = maxVelocity - (calamityGlobalNPC.newAI[0] * maxVelocity * 0.5f); @@ -514,10 +567,10 @@ namespace CalamityMod.NPCs.Cryogen NPC.TargetClosest(); if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { - SoundEngine.PlaySound(SoundID.Item28, NPC.Center); + SoundEngine.PlaySound(frostSound, NPC.Center); int totalProjectiles = bossRush ? 18 : 12; float radians = MathHelper.TwoPi / totalProjectiles; - int type = ModContent.ProjectileType(); + int type = iceBlast; int damage = NPC.GetProjectileDamage(type); float velocity = 9f + enrageScale; Vector2 spinningPoint = new Vector2(0f, -velocity); @@ -560,8 +613,8 @@ namespace CalamityMod.NPCs.Cryogen { if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { - SoundEngine.PlaySound(SoundID.Item28, NPC.Center); - int type = ModContent.ProjectileType(); + SoundEngine.PlaySound(frostSound, NPC.Center); + int type = iceRain; int damage = NPC.GetProjectileDamage(type); float maxVelocity = 9f + enrageScale; float velocity = maxVelocity - (calamityGlobalNPC.newAI[0] * maxVelocity * 0.5f); @@ -662,10 +715,10 @@ namespace CalamityMod.NPCs.Cryogen NPC.localAI[0] = 0f; if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { - SoundEngine.PlaySound(SoundID.Item28, NPC.Center); + SoundEngine.PlaySound(frostSound, NPC.Center); int totalProjectiles = bossRush ? 18 : 12; float radians = MathHelper.TwoPi / totalProjectiles; - int type = ModContent.ProjectileType(); + int type = iceBlast; int damage = NPC.GetProjectileDamage(type); float velocity = 10f + enrageScale; Vector2 spinningPoint = new Vector2(0f, -velocity); @@ -751,7 +804,7 @@ namespace CalamityMod.NPCs.Cryogen Vector2 position = new Vector2(teleportLocationX * 16f - (NPC.width / 2), calamityGlobalNPC.newAI[2] * 16f - (NPC.height / 2)); for (int m = 0; m < 5; m++) { - int dust = Dust.NewDust(position, NPC.width, NPC.height, 67, 0f, 0f, 100, default, 2f); + int dust = Dust.NewDust(position, NPC.width, NPC.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[dust].noGravity = true; } @@ -763,7 +816,7 @@ namespace CalamityMod.NPCs.Cryogen for (int n = 0; n < 15; n++) { - int num39 = Dust.NewDust(NPC.position, NPC.width, NPC.height, 67, 0f, 0f, 100, default, 3f); + int num39 = Dust.NewDust(NPC.position, NPC.width, NPC.height, dustType, 0f, 0f, 100, default, 3f); Main.dust[num39].noGravity = true; } @@ -772,8 +825,8 @@ namespace CalamityMod.NPCs.Cryogen if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { NPC.localAI[0] = 0f; - SoundEngine.PlaySound(SoundID.Item28, NPC.Center); - int type = ModContent.ProjectileType(); + SoundEngine.PlaySound(frostSound, NPC.Center); + int type = iceRain; int damage = NPC.GetProjectileDamage(type); float velocity = 9f + enrageScale; for (int i = 0; i < 3; i++) @@ -832,11 +885,13 @@ namespace CalamityMod.NPCs.Cryogen int chance = 100; if (DateTime.Now.Month == 4 && DateTime.Now.Day == 1) chance = 20; + if (Main.getGoodWorld) // Move to zenith seed later + chance = 1; if (Main.rand.NextBool(chance)) { - string key = "Mods.CalamityMod.CryogenBossText"; - Color messageColor = Color.Cyan; + string key = Main.getGoodWorld ? "Mods.CalamityMod.PyrogenBossText" : "Mods.CalamityMod.CryogenBossText"; + Color messageColor = Main.getGoodWorld ? Color.Orange : Color.Cyan; CalamityUtils.DisplayLocalizedText(key, messageColor); } } @@ -853,8 +908,8 @@ namespace CalamityMod.NPCs.Cryogen { if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) { - SoundEngine.PlaySound(SoundID.Item28, NPC.Center); - int type = ModContent.ProjectileType(); + SoundEngine.PlaySound(frostSound, NPC.Center); + int type = iceBlast; int damage = NPC.GetProjectileDamage(type); float velocity = 1.5f + enrageScale * 0.5f; int totalSpreads = phase7 ? 3 : 2; @@ -966,10 +1021,10 @@ namespace CalamityMod.NPCs.Cryogen if (calamityGlobalNPC.newAI[3] >= (bossRush ? 50f : 75f)) { calamityGlobalNPC.newAI[3] = 0f; - SoundEngine.PlaySound(SoundID.Item28, NPC.Center); + SoundEngine.PlaySound(frostSound, NPC.Center); int totalProjectiles = 2; float radians = MathHelper.TwoPi / totalProjectiles; - int type = ModContent.ProjectileType(); + int type = iceBomb; int damage = NPC.GetProjectileDamage(type); float velocity2 = 6f; double angleA = radians * 0.5; @@ -1045,8 +1100,10 @@ namespace CalamityMod.NPCs.Cryogen private void HandlePhaseTransition(int newPhase) { - SoundEngine.PlaySound(SoundID.NPCDeath15, NPC.Center); - if (Main.netMode != NetmodeID.Server) + // Move to zenith seed later + SoundStyle sound = Main.getGoodWorld ? SoundID.NPCDeath14 : SoundID.NPCDeath15; + SoundEngine.PlaySound(sound, NPC.Center); + if (Main.netMode != NetmodeID.Server && !Main.getGoodWorld) { int chipGoreAmount = newPhase >= 5 ? 3 : newPhase >= 3 ? 2 : 1; for (int i = 1; i < chipGoreAmount; i++) @@ -1082,23 +1139,43 @@ namespace CalamityMod.NPCs.Cryogen public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - if (currentPhase > 1) + if (Main.getGoodWorld) // Move to zenith seed later { - string phase = "CalamityMod/NPCs/Cryogen/Cryogen_Phase" + currentPhase; - Texture2D texture = ModContent.Request(phase).Value; + float compactness = NPC.width * 0.6f; + if (compactness < 10f) + compactness = 10f; - SpriteEffects spriteEffects = SpriteEffects.None; - if (NPC.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; + float power = NPC.height / 100f; + if (power > 2.75f) + power = 2.75f; - Vector2 origin = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); - Vector2 drawPos = NPC.Center - screenPos; - drawPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; - drawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture, drawPos, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, origin, NPC.scale, spriteEffects, 0f); - return false; + if (FireDrawer is null) + { + FireDrawer = new FireParticleSet(int.MaxValue, 1, Color.Red * 1.25f, Color.Red, compactness, power); + } + else + { + FireDrawer.DrawSet(NPC.Bottom - Vector2.UnitY * (12f - NPC.gfxOffY)); + } } - return true; + else + FireDrawer = null; + + string phase = "CalamityMod/NPCs/Cryogen/Cryogen_Phase" + currentPhase; + Texture2D texture = ModContent.Request(phase).Value; + + SpriteEffects spriteEffects = SpriteEffects.None; + if (NPC.spriteDirection == 1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Vector2 origin = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Vector2 drawPos = NPC.Center - screenPos; + drawPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); + Color overlay = Main.getGoodWorld ? Color.Red : drawColor; // Move to zenith seed later + spriteBatch.Draw(texture, drawPos, NPC.frame, NPC.GetAlpha(overlay), NPC.rotation, origin, NPC.scale, spriteEffects, 0f); + + return false; } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) @@ -1107,17 +1184,27 @@ namespace CalamityMod.NPCs.Cryogen NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } + public override void ModifyTypeName(ref string typeName) + { + // Move to zenith seed later + if (Main.getGoodWorld) + { + typeName = "Pyrogen"; + } + } + public override void HitEffect(int hitDirection, double damage) { + int dusttype = Main.getGoodWorld ? 235 : 67; // Move to zenith seed later for (int k = 0; k < 3; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 67, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, dusttype, hitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 67, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, dusttype, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -1127,13 +1214,13 @@ namespace CalamityMod.NPCs.Cryogen } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 67, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, dusttype, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 67, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, dusttype, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (Main.netMode != NetmodeID.Server && !Main.getGoodWorld) // Move to zenith seed later { float randomSpread = Main.rand.Next(-200, 201) / 100f; for (int i = 1; i < 4; i++) @@ -1243,8 +1330,16 @@ namespace CalamityMod.NPCs.Cryogen { if (damage > 0) { - player.AddBuff(BuffID.Frostburn, 240, true); - player.AddBuff(BuffID.Chilled, 120, true); + if (Main.getGoodWorld) // Move to zenith seed later + { + player.AddBuff(ModContent.BuffType(), 240, true); + player.AddBuff(ModContent.BuffType(), 120, true); + } + else + { + player.AddBuff(BuffID.Frostburn, 240, true); + player.AddBuff(BuffID.Chilled, 120, true); + } } } } diff --git a/NPCs/Cryogen/CryogenShield.cs b/NPCs/Cryogen/CryogenShield.cs index d23f730837..f83c7b9091 100644 --- a/NPCs/Cryogen/CryogenShield.cs +++ b/NPCs/Cryogen/CryogenShield.cs @@ -1,9 +1,10 @@ -using CalamityMod.Events; -using CalamityMod.Projectiles.Boss; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Events; using CalamityMod.World; using Microsoft.Xna.Framework; -using System; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -38,13 +39,25 @@ namespace CalamityMod.NPCs.Cryogen NPC.alpha = 255; NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath7; - NPC.Calamity().VulnerableToHeat = true; - NPC.Calamity().VulnerableToCold = false; - NPC.Calamity().VulnerableToSickness = false; + if (Main.getGoodWorld) // Move to zenith seed later + { + NPC.Calamity().VulnerableToHeat = false; + NPC.Calamity().VulnerableToCold = true; + NPC.Calamity().VulnerableToWater = true; + } + { + NPC.Calamity().VulnerableToHeat = true; + NPC.Calamity().VulnerableToCold = false; + NPC.Calamity().VulnerableToSickness = false; + } } public override void AI() { + // Move to zenith seed later + NPC.HitSound = Main.getGoodWorld ? SoundID.NPCHit41 : SoundID.NPCHit5; + NPC.DeathSound = Main.getGoodWorld ? SoundID.NPCDeath14 : SoundID.NPCDeath7; + NPC.alpha -= 3; if (NPC.alpha < 0) NPC.alpha = 0; @@ -96,27 +109,58 @@ namespace CalamityMod.NPCs.Cryogen { if (damage > 0) { - player.AddBuff(BuffID.Frostburn, 240, true); - player.AddBuff(BuffID.Chilled, 120, true); + if (Main.getGoodWorld) // Move to zenith seed later + { + player.AddBuff(ModContent.BuffType(), 240, true); + player.AddBuff(ModContent.BuffType(), 120, true); + } + else + { + player.AddBuff(BuffID.Frostburn, 240, true); + player.AddBuff(BuffID.Chilled, 120, true); + } } } + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + Texture2D texture = ModContent.Request("CalamityMod/NPCs/Cryogen/CryogenShield").Value; + + Vector2 origin = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); + Vector2 drawPos = NPC.Center - screenPos; + drawPos -= new Vector2(texture.Width, texture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; + drawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); + Color overlay = Main.getGoodWorld ? Color.Red : drawColor; // Move to zenith seed later + spriteBatch.Draw(texture, drawPos, NPC.frame, NPC.GetAlpha(overlay), NPC.rotation, origin, NPC.scale, SpriteEffects.None, 0f); + return false; + } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { NPC.lifeMax = (int)(NPC.lifeMax * 0.5f * bossLifeScale); } + public override void ModifyTypeName(ref string typeName) + { + // Move to zenith seed later + if (Main.getGoodWorld) + { + typeName = "Pyrogen's Shield"; + } + } + public override void HitEffect(int hitDirection, double damage) { + int dusttype = Main.getGoodWorld ? 235 : 67; // Move to zenith seed later for (int k = 0; k < 3; k++) { - Dust.NewDust(NPC.position, NPC.width, NPC.height, 67, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(NPC.position, NPC.width, NPC.height, dusttype, hitDirection, -1f, 0, default, 1f); } if (NPC.life <= 0) { for (int num621 = 0; num621 < 25; num621++) { - int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 67, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, dusttype, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -127,14 +171,14 @@ namespace CalamityMod.NPCs.Cryogen for (int num623 = 0; num623 < 50; num623++) { - int num624 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 67, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, dusttype, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 67, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, dusttype, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (Main.netMode != NetmodeID.Server && !Main.getGoodWorld) // Move to zenith seed later { int totalGores = 16; double radians = MathHelper.TwoPi / totalGores; diff --git a/NPCs/Cryogen/Pyrogen_Head_Boss.png b/NPCs/Cryogen/Pyrogen_Head_Boss.png new file mode 100644 index 0000000000..09ee44e931 Binary files /dev/null and b/NPCs/Cryogen/Pyrogen_Head_Boss.png differ