diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 591cef7456..425eb7dd0d 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -83,6 +83,18 @@ namespace CalamityMod.Buffs tip = "22.5% increased damage"; break; + case BuffID.BeetleEndurance1: + tip = "Damage taken reduced by 10%"; + break; + + case BuffID.BeetleEndurance2: + tip = "Damage taken reduced by 20%"; + break; + + case BuffID.BeetleEndurance3: + tip = "Damage taken reduced by 30%"; + break; + case BuffID.WeaponImbueVenom: case BuffID.WeaponImbueCursedFlames: case BuffID.WeaponImbueFire: diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 1965f2ce9c..47d8968b7a 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -29,6 +29,7 @@ using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.PlaguebringerGoliath; using CalamityMod.NPCs.Polterghast; using CalamityMod.NPCs.Providence; +using CalamityMod.NPCs.Ravager; using CalamityMod.NPCs.StormWeaver; using CalamityMod.NPCs.SulphurousSea; using CalamityMod.NPCs.SunkenSea; @@ -638,6 +639,8 @@ namespace CalamityMod.CalPlayer public int plagueReaperCooldown = 0; public bool plaguebringerPatronSet = false; public bool plaguebringerCarapace = false; + public bool plaguebringerPistons = false; + public int pistonsCounter = 0; public float ataxiaDmg; public bool ataxiaMage = false; public bool ataxiaGeyser = false; @@ -1604,6 +1607,7 @@ namespace CalamityMod.CalPlayer plagueReaper = false; plaguebringerPatronSet = false; plaguebringerCarapace = false; + plaguebringerPistons = false; fathomSwarmer = false; fathomSwarmerVisage = false; fathomSwarmerBreastplate = false; @@ -2192,6 +2196,8 @@ namespace CalamityMod.CalPlayer plagueReaperCooldown = 0; plaguebringerPatronSet = false; plaguebringerCarapace = false; + plaguebringerPistons = false; + pistonsCounter = 0; ataxiaMage = false; ataxiaBolt = false; ataxiaGeyser = false; @@ -2664,7 +2670,7 @@ namespace CalamityMod.CalPlayer Main.PlaySound(SoundID.Zombie, (int)player.position.X, (int)player.position.Y, 104); for (int num502 = 0; num502 < 36; num502++) { - int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 235, 0f, 0f, 0, default, 1f); + int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f); Main.dust[dust].velocity *= 3f; Main.dust[dust].scale *= 1.15f; } @@ -2674,7 +2680,7 @@ namespace CalamityMod.CalPlayer Vector2 vector6 = Vector2.Normalize(player.velocity) * new Vector2((float)player.width / 2f, (float)player.height) * 0.75f; vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * MathHelper.TwoPi / (float)num226), default) + player.Center; Vector2 vector7 = vector6 - player.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 235, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, (int)CalamityDusts.Brimstone, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; @@ -2698,7 +2704,7 @@ namespace CalamityMod.CalPlayer Main.PlaySound(SoundID.Zombie, (int)player.position.X, (int)player.position.Y, 104); for (int num502 = 0; num502 < 64; num502++) { - int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 60, 0f, 0f, 0, default, 1f); + int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, (int)CalamityDusts.Phantoplasm, 0f, 0f, 0, default, 1f); Main.dust[dust].velocity *= 3f; Main.dust[dust].scale *= 1.15f; } @@ -2708,7 +2714,7 @@ namespace CalamityMod.CalPlayer Vector2 vector6 = Vector2.Normalize(player.velocity) * new Vector2((float)player.width / 2f, (float)player.height) * 0.75f; vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + player.Center; Vector2 vector7 = vector6 - player.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 60, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, (int)CalamityDusts.Phantoplasm, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; @@ -2753,7 +2759,7 @@ namespace CalamityMod.CalPlayer Main.PlaySound(SoundID.Zombie, (int)player.position.X, (int)player.position.Y, 104); for (int num502 = 0; num502 < 36; num502++) { - int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 235, 0f, 0f, 0, default, 1f); + int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f); Main.dust[dust].velocity *= 3f; Main.dust[dust].scale *= 1.15f; } @@ -2763,7 +2769,7 @@ namespace CalamityMod.CalPlayer Vector2 vector6 = Vector2.Normalize(player.velocity) * new Vector2((float)player.width / 2f, (float)player.height) * 0.75f; vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * MathHelper.TwoPi / (float)num226), default) + player.Center; Vector2 vector7 = vector6 - player.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 235, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, (int)CalamityDusts.Brimstone, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; @@ -2901,7 +2907,7 @@ namespace CalamityMod.CalPlayer Main.PlaySound(SoundID.Zombie, (int)player.position.X, (int)player.position.Y, 104); for (int num502 = 0; num502 < 64; num502++) { - int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, 235, 0f, 0f, 0, default, 1f); + int dust = Dust.NewDust(new Vector2(player.position.X, player.position.Y + 16f), player.width, player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f); Main.dust[dust].velocity *= 3f; Main.dust[dust].scale *= 1.15f; } @@ -2911,7 +2917,7 @@ namespace CalamityMod.CalPlayer Vector2 vector6 = Vector2.Normalize(player.velocity) * new Vector2((float)player.width / 2f, (float)player.height) * 0.75f; vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + player.Center; Vector2 vector7 = vector6 - player.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 235, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, (int)CalamityDusts.Brimstone, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); Main.dust[num228].noGravity = true; Main.dust[num228].noLight = true; Main.dust[num228].velocity = vector7; @@ -4367,37 +4373,30 @@ namespace CalamityMod.CalPlayer } if (item.Calamity().rogue) { - if (player.meleeEnchant > 0) - { - if (player.meleeEnchant == 1) - { - target.AddBuff(BuffID.Venom, 60 * Main.rand.Next(5, 10), false); - } - if (player.meleeEnchant == 2) - { - target.AddBuff(BuffID.CursedInferno, 60 * Main.rand.Next(3, 7), false); - } - if (player.meleeEnchant == 3) - { - target.AddBuff(BuffID.OnFire, 60 * Main.rand.Next(3, 7), false); - } - if (player.meleeEnchant == 5) - { - target.AddBuff(BuffID.Ichor, 60 * Main.rand.Next(10, 20), false); - } - if (player.meleeEnchant == 6) - { - target.AddBuff(BuffID.Confused, 60 * Main.rand.Next(1, 4), false); - } - if (player.meleeEnchant == 8) - { - target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(5, 10), false); - } - /*if (player.meleeEnchant == 4) - { - target.AddBuff(BuffID.Midas, 120, false); - }*/ - } + switch (player.meleeEnchant) + { + case 1: + target.AddBuff(BuffID.Venom, 60 * Main.rand.Next(5, 10), false); + break; + case 2: + target.AddBuff(BuffID.CursedInferno, 60 * Main.rand.Next(3, 7), false); + break; + case 3: + target.AddBuff(BuffID.OnFire, 60 * Main.rand.Next(3, 7), false); + break; + case 5: + target.AddBuff(BuffID.Ichor, 60 * Main.rand.Next(10, 20), false); + break; + case 6: + target.AddBuff(BuffID.Confused, 60 * Main.rand.Next(1, 4), false); + break; + case 8: + target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(5, 10), false); + break; + /*case 4: + target.AddBuff(BuffID.Midas, 120, false); + break;*/ + } } if (holyWrath) { @@ -4497,7 +4496,7 @@ namespace CalamityMod.CalPlayer { CalamityUtils.Inflict246DebuffsNPC(target, ModContent.BuffType()); } - if ((plaguebringerCarapace || uberBees) && (proj.type == 566 || proj.type == 181 || proj.type == 189)) + if ((plaguebringerCarapace || uberBees) && CalamityMod.friendlyBeeList.Contains(proj.type)) { target.AddBuff(ModContent.BuffType(), 360); } @@ -4566,37 +4565,30 @@ namespace CalamityMod.CalPlayer } if (proj.Calamity().rogue) { - if (player.meleeEnchant > 0) - { - if (player.meleeEnchant == 1) - { - target.AddBuff(BuffID.Venom, 60 * Main.rand.Next(5, 10), false); - } - if (player.meleeEnchant == 2) - { - target.AddBuff(BuffID.CursedInferno, 60 * Main.rand.Next(3, 7), false); - } - if (player.meleeEnchant == 3) - { - target.AddBuff(BuffID.OnFire, 60 * Main.rand.Next(3, 7), false); - } - if (player.meleeEnchant == 5) - { - target.AddBuff(BuffID.Ichor, 60 * Main.rand.Next(10, 20), false); - } - if (player.meleeEnchant == 6) - { - target.AddBuff(BuffID.Confused, 60 * Main.rand.Next(1, 4), false); - } - if (player.meleeEnchant == 8) - { - target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(5, 10), false); - } - if (player.meleeEnchant == 4) - { - target.AddBuff(BuffID.Midas, 120, false); - } - } + switch (player.meleeEnchant) + { + case 1: + target.AddBuff(BuffID.Venom, 60 * Main.rand.Next(5, 10), false); + break; + case 2: + target.AddBuff(BuffID.CursedInferno, 60 * Main.rand.Next(3, 7), false); + break; + case 3: + target.AddBuff(BuffID.OnFire, 60 * Main.rand.Next(3, 7), false); + break; + case 5: + target.AddBuff(BuffID.Ichor, 60 * Main.rand.Next(10, 20), false); + break; + case 6: + target.AddBuff(BuffID.Confused, 60 * Main.rand.Next(1, 4), false); + break; + case 8: + target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(5, 10), false); + break; + /*case 4: + target.AddBuff(BuffID.Midas, 120, false); + break;*/ + } if (etherealExtorter) { if (ZoneSunkenSea) @@ -4721,37 +4713,30 @@ namespace CalamityMod.CalPlayer } if (item.Calamity().rogue) { - if (player.meleeEnchant > 0) - { - if (player.meleeEnchant == 1) - { - target.AddBuff(BuffID.Venom, 60 * Main.rand.Next(5, 10), false); - } - if (player.meleeEnchant == 2) - { - target.AddBuff(BuffID.CursedInferno, 60 * Main.rand.Next(3, 7), false); - } - if (player.meleeEnchant == 3) - { - target.AddBuff(BuffID.OnFire, 60 * Main.rand.Next(3, 7), false); - } - if (player.meleeEnchant == 5) - { - target.AddBuff(BuffID.Ichor, 60 * Main.rand.Next(10, 20), false); - } - if (player.meleeEnchant == 6) - { - target.AddBuff(BuffID.Confused, 60 * Main.rand.Next(1, 4), false); - } - if (player.meleeEnchant == 8) - { - target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(5, 10), false); - } - /*if (player.meleeEnchant == 4) - { - target.AddBuff(BuffID.Midas, 120, false); - }*/ - } + switch (player.meleeEnchant) + { + case 1: + target.AddBuff(BuffID.Venom, 60 * Main.rand.Next(5, 10), false); + break; + case 2: + target.AddBuff(BuffID.CursedInferno, 60 * Main.rand.Next(3, 7), false); + break; + case 3: + target.AddBuff(BuffID.OnFire, 60 * Main.rand.Next(3, 7), false); + break; + case 5: + target.AddBuff(BuffID.Ichor, 60 * Main.rand.Next(10, 20), false); + break; + case 6: + target.AddBuff(BuffID.Confused, 60 * Main.rand.Next(1, 4), false); + break; + case 8: + target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(5, 10), false); + break; + /*case 4: + target.AddBuff(BuffID.Midas, 120, false); + break;*/ + } } if (holyWrath) { @@ -4846,7 +4831,7 @@ namespace CalamityMod.CalPlayer { CalamityUtils.Inflict246DebuffsPvp(target, ModContent.BuffType()); } - if ((plaguebringerCarapace || uberBees) && (proj.type == 566 || proj.type == 181 || proj.type == 189)) + if ((plaguebringerCarapace || uberBees) && CalamityMod.friendlyBeeList.Contains(proj.type)) { target.AddBuff(ModContent.BuffType(), 360); } @@ -4915,37 +4900,30 @@ namespace CalamityMod.CalPlayer } if (proj.Calamity().rogue) { - if (player.meleeEnchant > 0) - { - if (player.meleeEnchant == 1) - { - target.AddBuff(BuffID.Venom, 60 * Main.rand.Next(5, 10), false); - } - if (player.meleeEnchant == 2) - { - target.AddBuff(BuffID.CursedInferno, 60 * Main.rand.Next(3, 7), false); - } - if (player.meleeEnchant == 3) - { - target.AddBuff(BuffID.OnFire, 60 * Main.rand.Next(3, 7), false); - } - if (player.meleeEnchant == 5) - { - target.AddBuff(BuffID.Ichor, 60 * Main.rand.Next(10, 20), false); - } - if (player.meleeEnchant == 6) - { - target.AddBuff(BuffID.Confused, 60 * Main.rand.Next(1, 4), false); - } - if (player.meleeEnchant == 8) - { - target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(5, 10), false); - } - /*if (player.meleeEnchant == 4) - { + switch (player.meleeEnchant) + { + case 1: + target.AddBuff(BuffID.Venom, 60 * Main.rand.Next(5, 10), false); + break; + case 2: + target.AddBuff(BuffID.CursedInferno, 60 * Main.rand.Next(3, 7), false); + break; + case 3: + target.AddBuff(BuffID.OnFire, 60 * Main.rand.Next(3, 7), false); + break; + case 5: + target.AddBuff(BuffID.Ichor, 60 * Main.rand.Next(10, 20), false); + break; + case 6: + target.AddBuff(BuffID.Confused, 60 * Main.rand.Next(1, 4), false); + break; + case 8: + target.AddBuff(BuffID.Poisoned, 60 * Main.rand.Next(5, 10), false); + break; + /*case 4: target.AddBuff(BuffID.Midas, 120, false); - }*/ - } + break;*/ + } if (etherealExtorter) { if (ZoneSunkenSea) @@ -4957,10 +4935,10 @@ namespace CalamityMod.CalPlayer target.AddBuff(ModContent.BuffType(), 120, false); target.AddBuff(ModContent.BuffType(), 300, false); } - if (Main.moonPhase == 6) //first quarter + /*if (Main.moonPhase == 6) //first quarter { target.AddBuff(BuffID.Midas, 120, false); - } + }*/ if (ZoneCalamity && CalamityMod.fireWeaponList.Contains(player.ActiveItem().type)) { target.AddBuff(ModContent.BuffType(), 240, false); @@ -5203,7 +5181,7 @@ namespace CalamityMod.CalPlayer { if (proj.Calamity().rogue) { - crit = Main.rand.Next(1, 101) < throwingCrit; + crit = Main.rand.Next(1, 101) < (throwingCrit + player.thrownCrit); } if (proj.npcProj || proj.trap) @@ -5408,7 +5386,7 @@ namespace CalamityMod.CalPlayer int defenseAdd = (int)(target.defense * 0.05 * (proj.damage / 50D) * acidRoundMultiplier); //100 defense * 0.05 = 5 damage += defenseAdd; } - if (uberBees && (proj.type == ProjectileID.GiantBee || proj.type == ProjectileID.Bee || proj.type == ProjectileID.Wasp || proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType())) + if (uberBees && CalamityMod.friendlyBeeList.Contains(proj.type)) { damage += Main.rand.Next(20, 31); } @@ -5424,6 +5402,7 @@ namespace CalamityMod.CalPlayer if (miniPBG.type == ModContent.ProjectileType() && Vector2.Distance(proj.Center, miniPBG.Center) <= PlaguebringerSummon.auraRange && miniPBG.owner == proj.owner) { damage += Main.rand.Next(10, 21); + break; } } } @@ -6076,10 +6055,11 @@ namespace CalamityMod.CalPlayer if (aSparkRare) { - if (proj.type == ProjectileID.MartianTurretBolt || proj.type == ProjectileID.GigaZapperSpear || proj.type == ProjectileID.CultistBossLightningOrbArc || proj.type == ModContent.ProjectileType() || - proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet) + if (proj.type == ProjectileID.MartianTurretBolt || proj.type == ProjectileID.GigaZapperSpear || proj.type == ProjectileID.CultistBossLightningOrbArc || proj.type == ModContent.ProjectileType() || proj.type == ProjectileID.VortexLightning || + proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet || proj.type == ProjectileID.VortexLaser) projectileDamageReduction += 0.5; } + if (beeResist) { @@ -6175,7 +6155,7 @@ namespace CalamityMod.CalPlayer if (bannerNPCType == ModContent.NPCType()) reduceDamage = true; } - else if (proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType()) + else if (proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType() || proj.type == ModContent.ProjectileType()) { if (bannerNPCType == ModContent.NPCType()) reduceDamage = true; @@ -6258,17 +6238,17 @@ namespace CalamityMod.CalPlayer else if (proj.type == ProjectileID.EyeBeam) { if (bannerNPCType == ModContent.NPCType()) - reduceDamage = !NPC.AnyNPCs(NPCID.Golem); + reduceDamage = !NPC.AnyNPCs(NPCID.Golem) && !NPC.AnyNPCs(ModContent.NPCType()); } else if (proj.type == ProjectileID.CultistBossIceMist || proj.type == ProjectileID.CultistBossLightningOrbArc) { if (bannerNPCType == ModContent.NPCType() || bannerNPCType == ModContent.NPCType()) - reduceDamage = !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(NPCID.CultistBoss); + reduceDamage = !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(NPCID.CultistBoss) && proj.Calamity().lineColor != 1; } else if (proj.type == ProjectileID.SaucerScrap) { if (bannerNPCType == ModContent.NPCType()) - reduceDamage = Main.invasionType != InvasionID.MartianMadness; + reduceDamage = Main.invasionType != InvasionID.MartianMadness && (!NPC.AnyNPCs(NPCID.TheDestroyer) || !CalamityWorld.revenge); } else { @@ -6340,7 +6320,7 @@ namespace CalamityMod.CalPlayer case ProjectileID.CursedFlameHostile: if (bannerNPCType == NPCID.Clinger) { - reduceDamage = !NPC.AnyNPCs(NPCID.Spazmatism); + reduceDamage = !NPC.AnyNPCs(NPCID.Spazmatism) && (!NPC.AnyNPCs(NPCID.EaterofWorldsHead) || !CalamityWorld.revenge); } break; @@ -6355,14 +6335,14 @@ namespace CalamityMod.CalPlayer case ProjectileID.InfernoHostileBolt: if (bannerNPCType == NPCID.DiabolistRed || bannerNPCType == NPCID.DiabolistWhite) { - reduceDamage = true; + reduceDamage = !NPC.AnyNPCs(NPCID.Golem) || !CalamityWorld.revenge; } break; case ProjectileID.Shadowflames: if (bannerNPCType == NPCID.GiantCursedSkull) { - reduceDamage = true; + reduceDamage = !NPC.AnyNPCs(NPCID.SkeletronHead) || !CalamityWorld.revenge; } break; @@ -6422,8 +6402,29 @@ namespace CalamityMod.CalPlayer } break; + case ProjectileID.WoodenArrowHostile: + if (bannerNPCType == NPCID.GoblinArcher || bannerNPCType == NPCID.CultistArcherBlue || bannerNPCType == NPCID.CultistArcherWhite) + { + reduceDamage = true; + } + break; + case ProjectileID.FlamingArrow: - if (bannerNPCType == NPCID.SkeletonArcher || bannerNPCType == NPCID.PirateCrossbower || bannerNPCType == NPCID.GoblinArcher || bannerNPCType == NPCID.ElfArcher) + if (bannerNPCType == NPCID.SkeletonArcher || bannerNPCType == NPCID.PirateCrossbower || bannerNPCType == NPCID.ElfArcher) + { + reduceDamage = true; + } + break; + + case ProjectileID.SalamanderSpit: + if (bannerNPCType >= NPCID.Salamander && bannerNPCType <= NPCID.Salamander9) + { + reduceDamage = true; + } + break; + + case ProjectileID.SkeletonBone: + if (bannerNPCType == NPCID.Skeleton) { reduceDamage = true; } @@ -6457,6 +6458,13 @@ namespace CalamityMod.CalPlayer } break; + case ProjectileID.FrostShard: + if (bannerNPCType == NPCID.AngryNimbus) + { + reduceDamage = !NPC.AnyNPCs(NPCID.IceQueen) && CalamityWorld.death; + } + break; + case ProjectileID.FrostBeam: if (bannerNPCType == NPCID.IceGolem) { @@ -6496,7 +6504,7 @@ namespace CalamityMod.CalPlayer case ProjectileID.EyeLaser: if (bannerNPCType == NPCID.Eyezor) { - reduceDamage = !NPC.AnyNPCs(NPCID.Retinazer); + reduceDamage = !NPC.AnyNPCs(NPCID.Retinazer) && !NPC.AnyNPCs(NPCID.WallofFleshEye); } break; @@ -6542,6 +6550,13 @@ namespace CalamityMod.CalPlayer } break; + case ProjectileID.Twinkle: + if (bannerNPCType == NPCID.StardustSpiderBig) + { + reduceDamage = true; + } + break; + case ProjectileID.VortexAcid: if (bannerNPCType == NPCID.VortexHornetQueen) { @@ -6584,13 +6599,6 @@ namespace CalamityMod.CalPlayer } break; - case ProjectileID.ScutlixLaser: - if (bannerNPCType == NPCID.Scutlix) - { - reduceDamage = true; - } - break; - case ProjectileID.MartianTurretBolt: if ((bannerNPCType == NPCID.MartianTurret && Main.invasionType == InvasionID.MartianMadness) || (bannerNPCType == ModContent.NPCType() && Main.invasionType != InvasionID.MartianMadness)) { @@ -6725,7 +6733,7 @@ namespace CalamityMod.CalPlayer } if (aSparkRare && proj.active && !proj.friendly && proj.hostile && damage > 0) { - if (proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet) + if (proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet || proj.type == ProjectileID.VortexLaser) { proj.hostile = false; proj.friendly = true; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 1b8fe3537b..0974e1d04a 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -605,7 +605,7 @@ namespace CalamityMod.CalPlayer // Ice shards, lightning and sharknadoes bool nearPillar = player.PillarZone(); - if (player.ZoneOverworldHeight && !CalamityPlayer.areThereAnyDamnBosses && Main.invasionType == 0 && NPC.MoonLordCountdown == 0 && !player.InSpace() && !DD2Event.Ongoing && !nearPillar) + if (player.ZoneOverworldHeight && !CalamityPlayer.areThereAnyDamnBosses && Main.invasionType == InvasionID.None && NPC.MoonLordCountdown == 0 && !player.InSpace() && !DD2Event.Ongoing && !nearPillar) { Vector2 sharknadoSpawnPoint = new Vector2(player.Center.X - (float)Main.rand.Next(300, 701), player.Center.Y - (float)Main.rand.Next(700, 801)); if (point.X > Main.maxTilesX / 2) @@ -1093,7 +1093,7 @@ namespace CalamityMod.CalPlayer for (int j = 0; j < 2; j++) { - int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 5, 0f, 0f, 100, default, 2f); + int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, DustID.Blood, 0f, 0f, 100, default, 2f); Dust dust = Main.dust[num]; dust.position.X += (float)Main.rand.Next(-20, 21); dust.position.Y += (float)Main.rand.Next(-20, 21); @@ -1137,10 +1137,10 @@ namespace CalamityMod.CalPlayer { player.moveSpeed += 0.12f; player.jumpSpeedBoost += 1.2f; - player.thorns = 0.5f; + player.thorns += 0.5f; player.endurance += 0.05f; - if ((double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) + if (Math.Abs(player.velocity.X) < 0.05f && Math.Abs(player.velocity.Y) < 0.05f && player.itemAnimation == 0) player.manaRegenBonus += 2; } @@ -1168,6 +1168,7 @@ namespace CalamityMod.CalPlayer { player.buffTime[l] *= 2; modPlayer.doubledHorror = true; + break; } } } @@ -1186,7 +1187,7 @@ namespace CalamityMod.CalPlayer if (modPlayer.draedonsHeart) { player.allDamage += 0.05f; - if ((double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) + if (Math.Abs(player.velocity.X) < 0.05f && Math.Abs(player.velocity.Y) < 0.05f && player.itemAnimation == 0) player.statDefense += 25; } @@ -1542,7 +1543,7 @@ namespace CalamityMod.CalPlayer } if (modPlayer.golemLore) { - if ((double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) + if (Math.Abs(player.velocity.X) < 0.05f && Math.Abs(player.velocity.Y) < 0.05f && player.itemAnimation == 0) player.statDefense += 10; } if (modPlayer.dukeFishronLore) @@ -2112,7 +2113,7 @@ namespace CalamityMod.CalPlayer modPlayer.chiBuffTimer = 0; } - if ((double)Math.Abs(player.velocity.X) < 0.1 && (double)Math.Abs(player.velocity.Y) < 0.1 && !player.mount.Active) + if (Math.Abs(player.velocity.X) < 0.1f && Math.Abs(player.velocity.Y) < 0.1f && !player.mount.Active) { if (modPlayer.chiBuffTimer < 120) modPlayer.chiBuffTimer++; @@ -2163,12 +2164,12 @@ namespace CalamityMod.CalPlayer if (player.itemAnimation > 0) modPlayer.modStealthTimer = 5; - if ((double)Math.Abs(player.velocity.X) < 0.1 && (double)Math.Abs(player.velocity.Y) < 0.1 && !player.mount.Active) + if (Math.Abs(player.velocity.X) < 0.1f && Math.Abs(player.velocity.Y) < 0.1f && !player.mount.Active) { if (modPlayer.modStealthTimer == 0 && modPlayer.modStealth > 0f) { modPlayer.modStealth -= 0.015f; - if ((double)modPlayer.modStealth <= 0.0) + if (modPlayer.modStealth <= 0f) { modPlayer.modStealth = 0f; if (Main.netMode == NetmodeID.MultiplayerClient) @@ -2202,7 +2203,7 @@ namespace CalamityMod.CalPlayer if (player.itemAnimation > 0) modPlayer.modStealthTimer = 5; - if ((double)Math.Abs(player.velocity.X) < 0.1 && (double)Math.Abs(player.velocity.Y) < 0.1 && !player.mount.Active) + if (Math.Abs(player.velocity.X) < 0.1f && Math.Abs(player.velocity.Y) < 0.1f && !player.mount.Active) { if (modPlayer.modStealthTimer == 0 && modPlayer.modStealth > 0f) { @@ -2293,7 +2294,7 @@ namespace CalamityMod.CalPlayer if (Main.rand.NextBool(2)) { Vector2 vector = Vector2.UnitY.RotatedByRandom(6.2831854820251465); - Dust dust = Main.dust[Dust.NewDust(player.Center - vector * 30f, 0, 0, 244, 0f, 0f, 0, default, 1f)]; + Dust dust = Main.dust[Dust.NewDust(player.Center - vector * 30f, 0, 0, (int)CalamityDusts.ProfanedFire, 0f, 0f, 0, default, 1f)]; dust.noGravity = true; dust.position = player.Center - vector * (float)Main.rand.Next(5, 11); dust.velocity = vector.RotatedBy(1.5707963705062866, default) * 4f; @@ -3074,17 +3075,16 @@ namespace CalamityMod.CalPlayer int myPlayer = Main.myPlayer; if (Main.player[myPlayer].team == player.team && player.team != 0) { - float arg = player.position.X - Main.player[myPlayer].position.X; - float num3 = player.position.Y - Main.player[myPlayer].position.Y; + Vector2 otherPlayerPos = player.position - Main.player[myPlayer].position; - if ((float)Math.Sqrt(arg * arg + num3 * num3) < 800f) - Main.player[myPlayer].AddBuff(43, 20, true); + if (otherPlayerPos.Length() < 800f) + Main.player[myPlayer].AddBuff(BuffID.PaladinsShield, 20, true); } } } if (player.statLife <= (int)(player.statLifeMax2 * 0.5)) - player.AddBuff(62, 5, true); + player.AddBuff(BuffID.IceBarrier, 5, true); if (player.statLife <= (int)(player.statLifeMax2 * 0.15)) player.endurance += 0.05f; } @@ -3099,17 +3099,16 @@ namespace CalamityMod.CalPlayer int myPlayer = Main.myPlayer; if (Main.player[myPlayer].team == player.team && player.team != 0) { - float arg = player.position.X - Main.player[myPlayer].position.X; - float num3 = player.position.Y - Main.player[myPlayer].position.Y; + Vector2 otherPlayerPos = player.position - Main.player[myPlayer].position; - if ((float)Math.Sqrt(arg * arg + num3 * num3) < 800f) - Main.player[myPlayer].AddBuff(43, 20, true); + if (otherPlayerPos.Length() < 800f) + Main.player[myPlayer].AddBuff(BuffID.PaladinsShield, 20, true); } } } if (player.statLife <= (int)(player.statLifeMax2 * 0.5)) - player.AddBuff(62, 5, true); + player.AddBuff(BuffID.IceBarrier, 5, true); if (player.statLife <= (int)(player.statLifeMax2 * 0.15)) player.endurance += 0.05f; } @@ -3475,7 +3474,7 @@ namespace CalamityMod.CalPlayer bool special = player.name == "Amber" || player.name == "Nincity" || player.name == "IbanPlay" || player.name == "Chen"; //People who either helped create the item or test it. for (int i = 0; i < 3; i++) { - int num469 = Dust.NewDust(player.position, player.width, player.height, special ? 231 : 244, 0f, 0f, 100, special ? Color.DarkRed : default, 1f); + int num469 = Dust.NewDust(player.position, player.width, player.height, special ? 231 : (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, special ? Color.DarkRed : default, 1f); Main.dust[num469].scale = special ? 1.169f : 2f; Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= special ? 10f : 6.9f; @@ -3484,6 +3483,34 @@ namespace CalamityMod.CalPlayer } } + if (modPlayer.plaguebringerPistons) + { + //Spawn bees while sprinting or dashing + modPlayer.pistonsCounter++; + if (modPlayer.pistonsCounter % 12 == 0) + { + if (player.velocity.Length() >= 5f && player.whoAmI == Main.myPlayer) + { + int beeCount = 1; + if (Main.rand.NextBool(3)) + ++beeCount; + if (Main.rand.NextBool(3)) + ++beeCount; + if (player.strongBees && Main.rand.NextBool(3)) + ++beeCount; + int damage = (int)(30 * player.MinionDamage()); + for (int index = 0; index < beeCount; ++index) + { + int bee = Projectile.NewProjectile(player.Center.X, player.Center.Y, Main.rand.NextFloat(-35f, 35f) * 0.02f, Main.rand.NextFloat(-35f, 35f) * 0.02f, (Main.rand.NextBool(4) ? ModContent.ProjectileType() : player.beeType()), damage, player.beeKB(0f), player.whoAmI, 0f, 0f); + Main.projectile[bee].Calamity().forceMinion = true; + Main.projectile[bee].usesLocalNPCImmunity = true; + Main.projectile[bee].localNPCHitCooldown = 10; + Main.projectile[bee].penetrate = 2; + } + } + } + } + int brimmy = ModContent.ProjectileType(); int siren = ModContent.ProjectileType(); int healer = ModContent.ProjectileType(); @@ -3542,6 +3569,16 @@ namespace CalamityMod.CalPlayer { if (player.whoAmI == Main.myPlayer) { + //Reduce the buffTime of Electrified + for (int l = 0; l < Player.MaxBuffs; l++) + { + bool electrified = player.buffType[l] == BuffID.Electrified; + if (player.buffTime[l] > 2 && electrified) + { + player.buffTime[l]--; + } + } + //Summon the aura if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(10 * player.AverageDamage()), 0f, player.whoAmI, 0f, 0f); } diff --git a/CalamityMod.cs b/CalamityMod.cs index 4e2adb9f35..3d42028389 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -148,6 +148,7 @@ namespace CalamityMod public static List bossHPScaleList; public static List beeEnemyList; public static List beeProjectileList; + public static List friendlyBeeList; public static List hardModeNerfList; public static List debuffList; public static List fireWeaponList; @@ -373,6 +374,7 @@ namespace CalamityMod bossScaleList = null; bossHPScaleList = null; beeEnemyList = null; + friendlyBeeList = null; beeProjectileList = null; hardModeNerfList = null; debuffList = null; @@ -758,6 +760,7 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), + ModContent.ProjectileType(), //Some hostile boss projectiles ModContent.ProjectileType(), @@ -985,6 +988,17 @@ namespace CalamityMod ModContent.ProjectileType() }; + friendlyBeeList = new List() + { + ProjectileID.GiantBee, + ProjectileID.Bee, + ProjectileID.Wasp, + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType() + }; + hardModeNerfList = new List() { ProjectileID.WebSpit, @@ -2431,80 +2445,117 @@ namespace CalamityMod ItemID.SuperHealingPotion }; - livingFireBlockList = new List() - { - ModContent.TileType(), - ModContent.TileType(), - ModContent.TileType(), + livingFireBlockList = new List() + { + ModContent.TileType(), + ModContent.TileType(), + ModContent.TileType(), TileID.LivingFire, TileID.LivingCursedFire, TileID.LivingDemonFire, TileID.LivingFrostFire, TileID.LivingIchor, TileID.LivingUltrabrightFire - }; + }; - zombieList = new List() - { - NPCID.Zombie, - NPCID.ArmedZombie, - NPCID.BaldZombie, - NPCID.PincushionZombie, - NPCID.ArmedZombiePincussion, // what is this spelling - NPCID.SlimedZombie, - NPCID.ArmedZombieSlimed, - NPCID.SwampZombie, - NPCID.ArmedZombieSwamp, - NPCID.TwiggyZombie, - NPCID.ArmedZombieTwiggy, - NPCID.FemaleZombie, - NPCID.ArmedZombieCenx, - NPCID.ZombieRaincoat, - NPCID.ZombieEskimo, - NPCID.ArmedZombieEskimo - // halloween zombies not included because they don't drop shackles or zombie arms - }; + zombieList = new List() + { + NPCID.Zombie, + NPCID.ArmedZombie, + NPCID.BaldZombie, + NPCID.PincushionZombie, + NPCID.ArmedZombiePincussion, // what is this spelling + NPCID.SlimedZombie, + NPCID.ArmedZombieSlimed, + NPCID.SwampZombie, + NPCID.ArmedZombieSwamp, + NPCID.TwiggyZombie, + NPCID.ArmedZombieTwiggy, + NPCID.FemaleZombie, + NPCID.ArmedZombieCenx, + NPCID.ZombieRaincoat, + NPCID.ZombieEskimo, + NPCID.ArmedZombieEskimo, + NPCID.BigRainZombie, + NPCID.SmallRainZombie, + NPCID.BigFemaleZombie, + NPCID.SmallFemaleZombie, + NPCID.BigTwiggyZombie, + NPCID.SmallTwiggyZombie, + NPCID.BigSwampZombie, + NPCID.SmallSwampZombie, + NPCID.BigSlimedZombie, + NPCID.SmallSlimedZombie, + NPCID.BigPincushionZombie, + NPCID.SmallPincushionZombie, + NPCID.BigBaldZombie, + NPCID.SmallBaldZombie, + NPCID.BigZombie, + NPCID.SmallZombie + // halloween zombies not included because they don't drop shackles or zombie arms + }; - demonEyeList = new List() - { - NPCID.DemonEye, - NPCID.CataractEye, - NPCID.SleepyEye, - NPCID.DialatedEye, // it is spelled "dilated" - NPCID.GreenEye, - NPCID.PurpleEye, - NPCID.DemonEyeOwl, - NPCID.DemonEyeSpaceship - }; + demonEyeList = new List() + { + NPCID.DemonEye, + NPCID.CataractEye, + NPCID.SleepyEye, + NPCID.DialatedEye, // it is spelled "dilated" + NPCID.GreenEye, + NPCID.PurpleEye, + NPCID.DemonEyeOwl, + NPCID.DemonEyeSpaceship, + NPCID.DemonEye2, + NPCID.PurpleEye2, + NPCID.GreenEye2, + NPCID.DialatedEye2, + NPCID.SleepyEye2, + NPCID.CataractEye2 + }; - skeletonList = new List() - { - NPCID.Skeleton, - NPCID.ArmoredSkeleton, - NPCID.SkeletonArcher, - NPCID.HeadacheSkeleton, - NPCID.MisassembledSkeleton, - NPCID.PantlessSkeleton, - NPCID.SkeletonTopHat, - NPCID.SkeletonAstonaut, - NPCID.SkeletonAlien, - NPCID.BoneThrowingSkeleton, - NPCID.BoneThrowingSkeleton2, - NPCID.BoneThrowingSkeleton3, - NPCID.BoneThrowingSkeleton4, - NPCID.GreekSkeleton - }; + skeletonList = new List() + { + NPCID.Skeleton, + NPCID.HeadacheSkeleton, + NPCID.MisassembledSkeleton, + NPCID.PantlessSkeleton, + NPCID.BoneThrowingSkeleton, + NPCID.BoneThrowingSkeleton2, + NPCID.BoneThrowingSkeleton3, + NPCID.BoneThrowingSkeleton4, + NPCID.BigPantlessSkeleton, + NPCID.SmallPantlessSkeleton, + NPCID.BigMisassembledSkeleton, + NPCID.SmallMisassembledSkeleton, + NPCID.BigHeadacheSkeleton, + NPCID.SmallHeadacheSkeleton, + NPCID.BigSkeleton, + NPCID.SmallSkeleton, - angryBonesList = new List() - { - NPCID.AngryBones, - NPCID.AngryBonesBig, - NPCID.AngryBonesBigMuscle, - NPCID.AngryBonesBigHelmet - }; + //Note: These skeletons don't count for Skeleton Banner for some god forsaken reason + NPCID.SkeletonTopHat, + NPCID.SkeletonAstonaut, + NPCID.SkeletonAlien, - hornetList = new List() - { + //Other skeleton types + NPCID.ArmoredSkeleton, + NPCID.HeavySkeleton, + NPCID.SkeletonArcher, + NPCID.GreekSkeleton + }; + + angryBonesList = new List() + { + NPCID.AngryBones, + NPCID.AngryBonesBig, + NPCID.AngryBonesBigMuscle, + NPCID.AngryBonesBigHelmet, + NPCID.BigBoned, + NPCID.ShortBones + }; + + hornetList = new List() + { NPCID.BigHornetStingy, NPCID.LittleHornetStingy, NPCID.BigHornetSpikey, @@ -2518,21 +2569,21 @@ namespace CalamityMod NPCID.BigStinger, NPCID.LittleStinger, NPCID.Hornet, - NPCID.HornetFatty, - NPCID.HornetHoney, - NPCID.HornetLeafy, - NPCID.HornetSpikey, - NPCID.HornetStingy - }; + NPCID.HornetFatty, + NPCID.HornetHoney, + NPCID.HornetLeafy, + NPCID.HornetSpikey, + NPCID.HornetStingy + }; - mossHornetList = new List() - { - NPCID.MossHornet, - NPCID.TinyMossHornet, - NPCID.LittleMossHornet, - NPCID.BigMossHornet, - NPCID.GiantMossHornet - }; + mossHornetList = new List() + { + NPCID.MossHornet, + NPCID.TinyMossHornet, + NPCID.LittleMossHornet, + NPCID.BigMossHornet, + NPCID.GiantMossHornet + }; Mod thorium = ModLoader.GetMod("ThoriumMod"); if (CalamityConfig.Instance.BuffThoriumBosses && thorium != null) diff --git a/Events/AcidRainEvent.cs b/Events/AcidRainEvent.cs index 4d72473cef..26dc6bd101 100644 --- a/Events/AcidRainEvent.cs +++ b/Events/AcidRainEvent.cs @@ -34,6 +34,8 @@ namespace CalamityMod.Events // A partially bright pale-ish cyan with a hint of yellow. public static readonly Color TextColor = new Color(115, 194, 147); + public static int MaxNuclearToadCount = 5; // To prevent the things from spamming. This happens frequently in pre-HM. + public const int InvasionNoKillPersistTime = 14400; // How long the invasion persists, in frames, if nothing is killed. public const float BloodwormSpawnRate = 0.1f; diff --git a/Items/Accessories/Abaddon.cs b/Items/Accessories/Abaddon.cs index 8e34d287bd..e984306fa2 100644 --- a/Items/Accessories/Abaddon.cs +++ b/Items/Accessories/Abaddon.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 15, 0, 0); - item.rare = ItemRarityID.Lime; + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/AbyssalAmulet.cs b/Items/Accessories/AbyssalAmulet.cs index 89ae80a10a..80bd11538a 100644 --- a/Items/Accessories/AbyssalAmulet.cs +++ b/Items/Accessories/AbyssalAmulet.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/AbyssalDivingGear.cs b/Items/Accessories/AbyssalDivingGear.cs index 2eeb853a28..a5ca41427f 100644 --- a/Items/Accessories/AbyssalDivingGear.cs +++ b/Items/Accessories/AbyssalDivingGear.cs @@ -24,8 +24,8 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 45, 0, 0); - item.rare = 6; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; item.accessory = true; } diff --git a/Items/Accessories/AbyssalDivingSuit.cs b/Items/Accessories/AbyssalDivingSuit.cs index 7286bbb8cc..2f1554e808 100644 --- a/Items/Accessories/AbyssalDivingSuit.cs +++ b/Items/Accessories/AbyssalDivingSuit.cs @@ -33,8 +33,9 @@ namespace CalamityMod.Items.Accessories item.width = 18; item.height = 18; item.accessory = true; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity12BuyPrice; item.rare = 10; + item.Calamity().postMoonLordRarity = 12; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/AbyssalMirror.cs b/Items/Accessories/AbyssalMirror.cs index a77614f9b0..31b4576249 100644 --- a/Items/Accessories/AbyssalMirror.cs +++ b/Items/Accessories/AbyssalMirror.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Accessories { item.width = 30; item.height = 38; - item.value = Item.buyPrice(0, 6, 0, 0); - item.rare = 8; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; item.accessory = true; } diff --git a/Items/Accessories/AeroStone.cs b/Items/Accessories/AeroStone.cs index 642e4fab63..6028a09bcf 100644 --- a/Items/Accessories/AeroStone.cs +++ b/Items/Accessories/AeroStone.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Accessories { item.width = 40; item.height = 50; - item.value = Item.buyPrice(0, 15, 0, 0); - item.rare = 5; + item.value = CalamityGlobalItem.Rarity2BuyPrice; + item.rare = 2; item.accessory = true; } diff --git a/Items/Accessories/Affliction.cs b/Items/Accessories/Affliction.cs index 9da265f7e3..ea18e115c8 100644 --- a/Items/Accessories/Affliction.cs +++ b/Items/Accessories/Affliction.cs @@ -20,10 +20,10 @@ namespace CalamityMod.Items.Accessories { item.width = 38; item.height = 44; - item.value = Item.buyPrice(0, 60, 0, 0); + item.value = CalamityGlobalItem.Rarity13BuyPrice; item.accessory = true; item.expert = true; - item.rare = 9; + item.rare = 10; } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) diff --git a/Items/Accessories/AlchemicalFlask.cs b/Items/Accessories/AlchemicalFlask.cs index e5ad4cacb6..639673a0fb 100644 --- a/Items/Accessories/AlchemicalFlask.cs +++ b/Items/Accessories/AlchemicalFlask.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 24, 0, 0); + item.value = CalamityGlobalItem.Rarity8BuyPrice; item.rare = 8; item.accessory = true; } diff --git a/Items/Accessories/AlluringBait.cs b/Items/Accessories/AlluringBait.cs index e985fa4d3b..f352fd3042 100644 --- a/Items/Accessories/AlluringBait.cs +++ b/Items/Accessories/AlluringBait.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/AmalgamatedBrain.cs b/Items/Accessories/AmalgamatedBrain.cs index 9f2d57bcee..333cd53aaa 100644 --- a/Items/Accessories/AmalgamatedBrain.cs +++ b/Items/Accessories/AmalgamatedBrain.cs @@ -22,9 +22,9 @@ namespace CalamityMod.Items.Accessories { item.width = 34; item.height = 34; - item.value = Item.buyPrice(0, 15, 0, 0); + item.value = CalamityGlobalItem.Rarity4BuyPrice; item.expert = true; - item.rare = 9; + item.rare = 4; item.accessory = true; } diff --git a/Items/Accessories/AmbrosialAmpoule.cs b/Items/Accessories/AmbrosialAmpoule.cs index b64ab83459..4623368c48 100644 --- a/Items/Accessories/AmbrosialAmpoule.cs +++ b/Items/Accessories/AmbrosialAmpoule.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Items.Accessories item.defense = 4; item.width = 20; item.height = 20; - item.value = Item.buyPrice(0, 45, 0, 0); - item.rare = 10; + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/AmidiasPendant.cs b/Items/Accessories/AmidiasPendant.cs index b49b033189..9324523fb7 100644 --- a/Items/Accessories/AmidiasPendant.cs +++ b/Items/Accessories/AmidiasPendant.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 46; - item.value = Item.buyPrice(0, 3, 0, 0); + item.value = CalamityGlobalItem.Rarity2BuyPrice; item.rare = 2; item.accessory = true; } diff --git a/Items/Accessories/AmidiasSpark.cs b/Items/Accessories/AmidiasSpark.cs index 3c22b43486..d001a5fafa 100644 --- a/Items/Accessories/AmidiasSpark.cs +++ b/Items/Accessories/AmidiasSpark.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 3, 0, 0); + item.value = CalamityGlobalItem.Rarity1BuyPrice; item.rare = 1; item.accessory = true; } diff --git a/Items/Accessories/AncientFossil.cs b/Items/Accessories/AncientFossil.cs index a362702b5f..7b89e95d3f 100644 --- a/Items/Accessories/AncientFossil.cs +++ b/Items/Accessories/AncientFossil.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 3, 0, 0); + item.value = CalamityGlobalItem.Rarity1BuyPrice; item.rare = 1; item.accessory = true; } diff --git a/Items/Accessories/AnechoicPlating.cs b/Items/Accessories/AnechoicPlating.cs index 04145e4c27..a0541a997d 100644 --- a/Items/Accessories/AnechoicPlating.cs +++ b/Items/Accessories/AnechoicPlating.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/AngelTreads.cs b/Items/Accessories/AngelTreads.cs index 395224d5d1..beb02fbfac 100644 --- a/Items/Accessories/AngelTreads.cs +++ b/Items/Accessories/AngelTreads.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Items.Accessories { item.width = 36; item.height = 32; - item.value = Item.buyPrice(0, 36, 0, 0); - item.rare = 8; + item.value = CalamityGlobalItem.Rarity6BuyPrice; + item.rare = 6; item.accessory = true; } diff --git a/Items/Accessories/AquaticEmblem.cs b/Items/Accessories/AquaticEmblem.cs index 0ef1cd7087..1500b41cb3 100644 --- a/Items/Accessories/AquaticEmblem.cs +++ b/Items/Accessories/AquaticEmblem.cs @@ -1,5 +1,6 @@ using CalamityMod.CalPlayer; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -21,8 +22,8 @@ namespace CalamityMod.Items.Accessories { item.width = 18; item.height = 26; - item.value = Item.buyPrice(0, 30, 0, 0); - item.rare = 9; + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = 5; item.accessory = true; item.expert = true; } @@ -31,11 +32,11 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.aquaticEmblem = true; - player.npcTypeNoAggro[65] = true; - player.npcTypeNoAggro[220] = true; - player.npcTypeNoAggro[64] = true; - player.npcTypeNoAggro[67] = true; - player.npcTypeNoAggro[221] = true; + player.npcTypeNoAggro[NPCID.Shark] = true; + player.npcTypeNoAggro[NPCID.SeaSnail] = true; + player.npcTypeNoAggro[NPCID.PinkJellyfish] = true; + player.npcTypeNoAggro[NPCID.Crab] = true; + player.npcTypeNoAggro[NPCID.Squid] = true; player.gills = true; } } diff --git a/Items/Accessories/ArcanumoftheVoid.cs b/Items/Accessories/ArcanumoftheVoid.cs index 20668e48c7..911fcae376 100644 --- a/Items/Accessories/ArcanumoftheVoid.cs +++ b/Items/Accessories/ArcanumoftheVoid.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 60, 0, 0); + item.value = CalamityGlobalItem.Rarity13BuyPrice; item.accessory = true; item.Calamity().customRarity = CalamityRarity.PureGreen; } diff --git a/Items/Accessories/ArchaicPowder.cs b/Items/Accessories/ArchaicPowder.cs index 05235d40a9..b47b4db5f8 100644 --- a/Items/Accessories/ArchaicPowder.cs +++ b/Items/Accessories/ArchaicPowder.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 20; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/AsgardianAegis.cs b/Items/Accessories/AsgardianAegis.cs index 796adf6e9b..517c4d7edc 100644 --- a/Items/Accessories/AsgardianAegis.cs +++ b/Items/Accessories/AsgardianAegis.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories { item.width = 60; item.height = 54; - item.value = Item.buyPrice(0, 90, 0, 0); //30 gold reforge + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.defense = 10; item.accessory = true; item.Calamity().customRarity = CalamityRarity.DarkBlue; diff --git a/Items/Accessories/AsgardsValor.cs b/Items/Accessories/AsgardsValor.cs index 9f09c33d86..a939bc9242 100644 --- a/Items/Accessories/AsgardsValor.cs +++ b/Items/Accessories/AsgardsValor.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Items.Accessories { item.width = 38; item.height = 44; - item.value = Item.buyPrice(0, 45, 0, 0); - item.rare = 9; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; item.defense = 8; item.accessory = true; } diff --git a/Items/Accessories/AstralArcanum.cs b/Items/Accessories/AstralArcanum.cs index aff0160b81..31f0944cec 100644 --- a/Items/Accessories/AstralArcanum.cs +++ b/Items/Accessories/AstralArcanum.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity13BuyPrice; item.accessory = true; item.Calamity().customRarity = CalamityRarity.PureGreen; } diff --git a/Items/Accessories/AstralBulwark.cs b/Items/Accessories/AstralBulwark.cs index f40da571ca..70617569d4 100644 --- a/Items/Accessories/AstralBulwark.cs +++ b/Items/Accessories/AstralBulwark.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 15, 0, 0); + item.value = CalamityGlobalItem.Rarity9BuyPrice; item.expert = true; item.rare = 9; item.accessory = true; diff --git a/Items/Accessories/BadgeofBravery.cs b/Items/Accessories/BadgeofBravery.cs index 4a393de88f..c74096e0a6 100644 --- a/Items/Accessories/BadgeofBravery.cs +++ b/Items/Accessories/BadgeofBravery.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 30; item.height = 30; - item.value = Item.buyPrice(0, 21, 0, 0); + item.value = CalamityGlobalItem.Rarity12BuyPrice; item.accessory = true; item.Calamity().customRarity = CalamityRarity.Turquoise; } diff --git a/Items/Accessories/BlazingCore.cs b/Items/Accessories/BlazingCore.cs index 81c6160db0..2e6a725cc5 100644 --- a/Items/Accessories/BlazingCore.cs +++ b/Items/Accessories/BlazingCore.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Accessories item.accessory = true; item.expert = true; item.rare = 9; - item.value = Item.buyPrice(1, 20, 0, 0); + item.value = CalamityGlobalItem.Rarity12BuyPrice; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/BloodPact.cs b/Items/Accessories/BloodPact.cs index 3df409447a..3526c126d6 100644 --- a/Items/Accessories/BloodPact.cs +++ b/Items/Accessories/BloodPact.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories item.width = 26; item.height = 26; item.rare = 8; - item.value = Item.buyPrice(0, 24, 0, 0); + item.value = CalamityGlobalItem.Rarity8BuyPrice; item.accessory = true; } diff --git a/Items/Accessories/BloodflareCore.cs b/Items/Accessories/BloodflareCore.cs index 5e42871eae..d03121b6ea 100644 --- a/Items/Accessories/BloodflareCore.cs +++ b/Items/Accessories/BloodflareCore.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 45, 0, 0); + item.value = CalamityGlobalItem.Rarity13BuyPrice; item.expert = true; - item.rare = 9; + item.rare = ItemRarityID.Red; item.accessory = true; } diff --git a/Items/Accessories/BloodstainedGlove.cs b/Items/Accessories/BloodstainedGlove.cs index 2d84bef368..765976917e 100644 --- a/Items/Accessories/BloodstainedGlove.cs +++ b/Items/Accessories/BloodstainedGlove.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 36; - item.value = Item.buyPrice(0, 4, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.accessory = true; item.rare = 3; } diff --git a/Items/Accessories/BloodyWormScarf.cs b/Items/Accessories/BloodyWormScarf.cs index a0869e6d28..81a112b206 100644 --- a/Items/Accessories/BloodyWormScarf.cs +++ b/Items/Accessories/BloodyWormScarf.cs @@ -17,9 +17,9 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 42; - item.value = Item.buyPrice(0, 15, 0, 0); + item.value = CalamityGlobalItem.Rarity4BuyPrice; item.expert = true; - item.rare = 9; + item.rare = 4; item.accessory = true; } diff --git a/Items/Accessories/BloodyWormTooth.cs b/Items/Accessories/BloodyWormTooth.cs index c9e7bc1aa2..ec12c5aeb4 100644 --- a/Items/Accessories/BloodyWormTooth.cs +++ b/Items/Accessories/BloodyWormTooth.cs @@ -17,9 +17,9 @@ namespace CalamityMod.Items.Accessories { item.width = 12; item.height = 15; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.expert = true; - item.rare = 9; + item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/BloomStone.cs b/Items/Accessories/BloomStone.cs index d7f0c8a2ed..c2881e60f7 100644 --- a/Items/Accessories/BloomStone.cs +++ b/Items/Accessories/BloomStone.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 20; - item.value = Item.buyPrice(0, 15, 0, 0); - item.rare = 5; + item.value = CalamityGlobalItem.Rarity8BuyPrice; + item.rare = 8; item.accessory = true; } diff --git a/Items/Accessories/BlunderBooster.cs b/Items/Accessories/BlunderBooster.cs index 945a4b7476..3f9ec276eb 100644 --- a/Items/Accessories/BlunderBooster.cs +++ b/Items/Accessories/BlunderBooster.cs @@ -54,7 +54,6 @@ namespace CalamityMod.Items.Accessories ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 8); - recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Accessories/BurdenBreaker.cs b/Items/Accessories/BurdenBreaker.cs index 7eaee8d0e4..3fce200977 100644 --- a/Items/Accessories/BurdenBreaker.cs +++ b/Items/Accessories/BurdenBreaker.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 28; - item.value = Item.buyPrice(0, 5, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/CalamityRing.cs b/Items/Accessories/CalamityRing.cs index d5992874e9..168d2e83cf 100644 --- a/Items/Accessories/CalamityRing.cs +++ b/Items/Accessories/CalamityRing.cs @@ -21,50 +21,38 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 22; - item.value = Item.buyPrice(0, 24, 0, 0); - item.rare = 9; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; item.accessory = true; item.expert = true; } - public override bool CanEquipAccessory(Player player, int slot) - { - CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.calamityRing) - { - return false; - } - return true; - } + public override bool CanEquipAccessory(Player player, int slot) => !player.Calamity().calamityRing; public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.calamityRing = true; player.allDamage += 0.15f; - player.endurance -= 0.3f; + player.endurance -= 0.15f; if (player.whoAmI == Main.myPlayer) { if (player.immune) { if (Main.rand.NextBool(10)) { - for (int l = 0; l < 1; l++) - { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num15 = player.position.X + (float)(player.width / 2) - vector.X; - float num16 = player.position.Y + (float)(player.height / 2) - vector.Y; - num15 += (float)Main.rand.Next(-100, 101); - int num17 = 22; - float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); - num18 = (float)num17 / num18; - num15 *= num18; - num16 *= num18; - int num19 = Projectile.NewProjectile(x, y, num15, num16, ModContent.ProjectileType(), (int)(30 * player.AverageDamage()), 5f, player.whoAmI, 0f, 0f); - Main.projectile[num19].ai[1] = player.position.Y; - } + float x = player.position.X + (float)Main.rand.Next(-400, 400); + float y = player.position.Y - (float)Main.rand.Next(500, 800); + Vector2 source = new Vector2(x, y); + Vector2 velocity = player.Center - source; + velocity.X += (float)Main.rand.Next(-100, 101); + float speed = 22f; + float targetDist = velocity.Length(); + targetDist = speed / targetDist; + velocity.X *= targetDist; + velocity.Y *= targetDist; + int fire = Projectile.NewProjectile(source, velocity, ModContent.ProjectileType(), (int)(30 * player.AverageDamage()), 5f, player.whoAmI, 0f, 0f); + Main.projectile[fire].ai[1] = player.position.Y; } } } diff --git a/Items/Accessories/CelestialJewel.cs b/Items/Accessories/CelestialJewel.cs index 6fabf5503c..cf89883c6b 100644 --- a/Items/Accessories/CelestialJewel.cs +++ b/Items/Accessories/CelestialJewel.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 15, 0, 0); + item.value = CalamityGlobalItem.Rarity7BuyPrice; item.rare = 7; item.accessory = true; } diff --git a/Items/Accessories/ChaosAmulet.cs b/Items/Accessories/ChaosAmulet.cs index 3e55947eb8..71642a8565 100644 --- a/Items/Accessories/ChaosAmulet.cs +++ b/Items/Accessories/ChaosAmulet.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Accessories item.width = 20; item.height = 24; item.lifeRegen = 2; - item.value = Item.buyPrice(0, 15, 0, 0); - item.rare = 5; + item.value = CalamityGlobalItem.Rarity4BuyPrice; + item.rare = 4; item.accessory = true; } diff --git a/Items/Accessories/ChaosStone.cs b/Items/Accessories/ChaosStone.cs index 04277b032a..018ba06e30 100644 --- a/Items/Accessories/ChaosStone.cs +++ b/Items/Accessories/ChaosStone.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 20; - item.value = Item.buyPrice(0, 15, 0, 0); - item.rare = 5; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; item.accessory = true; } diff --git a/Items/Accessories/CheatTestThing.cs b/Items/Accessories/CheatTestThing.cs index a37be3c5f1..a6ca44adaf 100644 --- a/Items/Accessories/CheatTestThing.cs +++ b/Items/Accessories/CheatTestThing.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = 1; - item.rare = 1; + item.value = CalamityGlobalItem.Rarity16BuyPrice; + item.Calamity().postMoonLordRarity = 16; item.accessory = true; } diff --git a/Items/Accessories/CoinofDeceit.cs b/Items/Accessories/CoinofDeceit.cs index 23e4a72eed..05bf985301 100644 --- a/Items/Accessories/CoinofDeceit.cs +++ b/Items/Accessories/CoinofDeceit.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 22; - item.value = Item.buyPrice(0, 2, 0, 0); + item.value = CalamityGlobalItem.Rarity1BuyPrice; item.accessory = true; item.rare = 1; } diff --git a/Items/Accessories/CoreOfTheBloodGod.cs b/Items/Accessories/CoreOfTheBloodGod.cs index c6b3b65af3..9864386d8a 100644 --- a/Items/Accessories/CoreOfTheBloodGod.cs +++ b/Items/Accessories/CoreOfTheBloodGod.cs @@ -23,9 +23,9 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.expert = true; - item.rare = 9; + item.rare = 10; item.accessory = true; } diff --git a/Items/Accessories/CorruptFlask.cs b/Items/Accessories/CorruptFlask.cs index 7f8ec3029d..cfcc07129e 100644 --- a/Items/Accessories/CorruptFlask.cs +++ b/Items/Accessories/CorruptFlask.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 20; - item.value = Item.buyPrice(0, 3, 0, 0); + item.value = CalamityGlobalItem.Rarity2BuyPrice; item.rare = 2; item.accessory = true; } diff --git a/Items/Accessories/CounterScarf.cs b/Items/Accessories/CounterScarf.cs index df0ca83a33..e6e3e78b77 100644 --- a/Items/Accessories/CounterScarf.cs +++ b/Items/Accessories/CounterScarf.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 9, 0, 0); - item.rare = 3; + item.value = CalamityGlobalItem.Rarity2BuyPrice; + item.rare = 2; item.accessory = true; } diff --git a/Items/Accessories/CrawCarapace.cs b/Items/Accessories/CrawCarapace.cs index 8cb1b4f854..d333e95580 100644 --- a/Items/Accessories/CrawCarapace.cs +++ b/Items/Accessories/CrawCarapace.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories item.defense = 3; item.width = 28; item.height = 28; - item.value = Item.buyPrice(0, 3, 0, 0); + item.value = CalamityGlobalItem.Rarity1BuyPrice; item.rare = 1; item.accessory = true; } diff --git a/Items/Accessories/CrimsonFlask.cs b/Items/Accessories/CrimsonFlask.cs index 4884087736..9a2fa895ac 100644 --- a/Items/Accessories/CrimsonFlask.cs +++ b/Items/Accessories/CrimsonFlask.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 20; - item.value = Item.buyPrice(0, 3, 0, 0); + item.value = CalamityGlobalItem.Rarity2BuyPrice; item.rare = 2; item.accessory = true; } diff --git a/Items/Accessories/CrownJewel.cs b/Items/Accessories/CrownJewel.cs index e14f3e24c1..6dfb3ccd68 100644 --- a/Items/Accessories/CrownJewel.cs +++ b/Items/Accessories/CrownJewel.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 3, 0, 0); + item.value = CalamityGlobalItem.Rarity1BuyPrice; item.rare = 1; item.accessory = true; } diff --git a/Items/Accessories/CryoStone.cs b/Items/Accessories/CryoStone.cs index 00da5e3408..3c8f3dbb03 100644 --- a/Items/Accessories/CryoStone.cs +++ b/Items/Accessories/CryoStone.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { item.width = 40; item.height = 40; - item.value = Item.buyPrice(0, 15, 0, 0); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = 5; item.defense = 6; item.accessory = true; diff --git a/Items/Accessories/DaedalusEmblem.cs b/Items/Accessories/DaedalusEmblem.cs index 4dee335e7c..d21286cf49 100644 --- a/Items/Accessories/DaedalusEmblem.cs +++ b/Items/Accessories/DaedalusEmblem.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 32; - item.value = Item.buyPrice(0, 30, 0, 0); - item.rare = 9; + item.value = CalamityGlobalItem.Rarity8BuyPrice; + item.rare = 8; item.accessory = true; } diff --git a/Items/Accessories/DarkGodsSheath.cs b/Items/Accessories/DarkGodsSheath.cs index 8d0492ed21..6726b95ace 100644 --- a/Items/Accessories/DarkGodsSheath.cs +++ b/Items/Accessories/DarkGodsSheath.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Accessories { item.width = 48; item.height = 62; - item.value = Item.buyPrice(0, 26, 0, 0); + item.value = CalamityGlobalItem.Rarity9BuyPrice; item.rare = 9; item.accessory = true; } diff --git a/Items/Accessories/DarkSunRing.cs b/Items/Accessories/DarkSunRing.cs index 964a8acf04..5250242bb1 100644 --- a/Items/Accessories/DarkSunRing.cs +++ b/Items/Accessories/DarkSunRing.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity15BuyPrice; item.defense = 10; item.lifeRegen = 1; item.accessory = true; diff --git a/Items/Accessories/DeepDiver.cs b/Items/Accessories/DeepDiver.cs index fc72e63709..811af76c8f 100644 --- a/Items/Accessories/DeepDiver.cs +++ b/Items/Accessories/DeepDiver.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 24; item.height = 28; - item.value = Item.buyPrice(0, 3, 0, 0); + item.value = CalamityGlobalItem.Rarity2BuyPrice; item.rare = 2; item.defense = 2; item.accessory = true; diff --git a/Items/Accessories/DeificAmulet.cs b/Items/Accessories/DeificAmulet.cs index 817a2ef703..f16cee7e64 100644 --- a/Items/Accessories/DeificAmulet.cs +++ b/Items/Accessories/DeificAmulet.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.rare = 8; - item.value = Item.buyPrice(0, 45, 0, 0); + item.rare = 5; + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.accessory = true; } diff --git a/Items/Accessories/DepthCharm.cs b/Items/Accessories/DepthCharm.cs index c728b6e8a9..c4240032a6 100644 --- a/Items/Accessories/DepthCharm.cs +++ b/Items/Accessories/DepthCharm.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/DimensionalSoulArtifact.cs b/Items/Accessories/DimensionalSoulArtifact.cs index 914f1cc56a..06d11a89dd 100644 --- a/Items/Accessories/DimensionalSoulArtifact.cs +++ b/Items/Accessories/DimensionalSoulArtifact.cs @@ -22,10 +22,10 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 28; - item.value = Item.buyPrice(1, 50, 0, 0); + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.accessory = true; item.rare = 10; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().postMoonLordRarity = 14; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/DraedonsHeart.cs b/Items/Accessories/DraedonsHeart.cs index 78cd45dc35..072aaa4fe6 100644 --- a/Items/Accessories/DraedonsHeart.cs +++ b/Items/Accessories/DraedonsHeart.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 60, 0, 0); + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.accessory = true; item.Calamity().customRarity = CalamityRarity.DarkBlue; } diff --git a/Items/Accessories/DragonScales.cs b/Items/Accessories/DragonScales.cs index f421cd630d..234dc0c6ca 100644 --- a/Items/Accessories/DragonScales.cs +++ b/Items/Accessories/DragonScales.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 32; item.height = 34; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity15BuyPrice; item.rare = 10; item.Calamity().customRarity = CalamityRarity.Violet; item.accessory = true; diff --git a/Items/Accessories/DukeScales.cs b/Items/Accessories/DukeScales.cs index fc0923c027..36b9e857cf 100644 --- a/Items/Accessories/DukeScales.cs +++ b/Items/Accessories/DukeScales.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 26; - item.value = Item.buyPrice(0, 80, 0, 0); + item.value = CalamityGlobalItem.Rarity13BuyPrice; item.accessory = true; item.rare = 10; item.Calamity().postMoonLordRarity = 13; diff --git a/Items/Accessories/DynamoStemCells.cs b/Items/Accessories/DynamoStemCells.cs index 551123bb6c..4a090f28ca 100644 --- a/Items/Accessories/DynamoStemCells.cs +++ b/Items/Accessories/DynamoStemCells.cs @@ -18,7 +18,7 @@ Ranged weapons have a chance to fire mini swarmers"); { item.width = 20; item.height = 20; - item.value = Item.buyPrice(0, 60, 0, 0); + item.value = CalamityGlobalItem.Rarity12BuyPrice; item.accessory = true; item.expert = true; item.rare = 10; diff --git a/Items/Accessories/EclipseMirror.cs b/Items/Accessories/EclipseMirror.cs index e62c6a0edf..68b0199c6b 100644 --- a/Items/Accessories/EclipseMirror.cs +++ b/Items/Accessories/EclipseMirror.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Accessories { item.width = 38; item.height = 38; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity15BuyPrice; item.Calamity().customRarity = CalamityRarity.Violet; item.accessory = true; } diff --git a/Items/Accessories/EldritchSoulArtifact.cs b/Items/Accessories/EldritchSoulArtifact.cs index abc1eb938e..a0c30cd2f1 100644 --- a/Items/Accessories/EldritchSoulArtifact.cs +++ b/Items/Accessories/EldritchSoulArtifact.cs @@ -21,10 +21,10 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 28; - item.value = Item.buyPrice(1, 50, 0, 0); + item.value = CalamityGlobalItem.Rarity12BuyPrice; item.accessory = true; item.rare = 10; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().postMoonLordRarity = 12; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/ElectriciansGlove.cs b/Items/Accessories/ElectriciansGlove.cs index 4c65458df2..e383c32a24 100644 --- a/Items/Accessories/ElectriciansGlove.cs +++ b/Items/Accessories/ElectriciansGlove.cs @@ -18,9 +18,9 @@ Stealth strikes also have +30 armor penetration, deal 10% more damage, and heal { item.width = 24; item.height = 40; - item.value = Item.buyPrice(0, 36, 0, 0); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.accessory = true; - item.rare = 6; + item.rare = 5; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/ElementalGauntlet.cs b/Items/Accessories/ElementalGauntlet.cs index d42ed72689..6b2f2eae81 100644 --- a/Items/Accessories/ElementalGauntlet.cs +++ b/Items/Accessories/ElementalGauntlet.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories { item.width = 22; item.height = 38; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.accessory = true; item.Calamity().customRarity = CalamityRarity.DarkBlue; } diff --git a/Items/Accessories/ElementalQuiver.cs b/Items/Accessories/ElementalQuiver.cs index 0768cc01b8..052e452834 100644 --- a/Items/Accessories/ElementalQuiver.cs +++ b/Items/Accessories/ElementalQuiver.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 32; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.accessory = true; item.Calamity().customRarity = CalamityRarity.DarkBlue; } diff --git a/Items/Accessories/ElysianAegis.cs b/Items/Accessories/ElysianAegis.cs index 18dffeb0f3..6cbd4e0927 100644 --- a/Items/Accessories/ElysianAegis.cs +++ b/Items/Accessories/ElysianAegis.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories { item.width = 48; item.height = 42; - item.value = Item.buyPrice(0, 60, 0, 0); + item.value = CalamityGlobalItem.Rarity12BuyPrice; item.rare = 10; item.Calamity().customRarity = CalamityRarity.Turquoise; item.defense = 8; diff --git a/Items/Accessories/EnchantedPearl.cs b/Items/Accessories/EnchantedPearl.cs index a442616cf2..29815e0cce 100644 --- a/Items/Accessories/EnchantedPearl.cs +++ b/Items/Accessories/EnchantedPearl.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/EtherealExtorter.cs b/Items/Accessories/EtherealExtorter.cs index 5137bbf7b8..97b80debc1 100644 --- a/Items/Accessories/EtherealExtorter.cs +++ b/Items/Accessories/EtherealExtorter.cs @@ -19,7 +19,7 @@ Rogue projectiles rarely explode into homing souls item.width = 28; item.height = 32; item.accessory = true; - item.value = Item.buyPrice(0, 24, 0, 0); + item.value = CalamityGlobalItem.Rarity8BuyPrice; item.rare = 8; } diff --git a/Items/Accessories/EtherealTalisman.cs b/Items/Accessories/EtherealTalisman.cs index 4195c10187..0bbd4820a5 100644 --- a/Items/Accessories/EtherealTalisman.cs +++ b/Items/Accessories/EtherealTalisman.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 32; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.accessory = true; item.Calamity().customRarity = CalamityRarity.DarkBlue; } diff --git a/Items/Accessories/EyeoftheStorm.cs b/Items/Accessories/EyeoftheStorm.cs index 2141387886..504321cdfd 100644 --- a/Items/Accessories/EyeoftheStorm.cs +++ b/Items/Accessories/EyeoftheStorm.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 26; - item.value = Item.buyPrice(0, 15, 0, 0); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/FabledTortoiseShell.cs b/Items/Accessories/FabledTortoiseShell.cs index f823e69be8..3e4fe0f5f2 100644 --- a/Items/Accessories/FabledTortoiseShell.cs +++ b/Items/Accessories/FabledTortoiseShell.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories item.defense = 35; item.width = 20; item.height = 24; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = 5; item.accessory = true; item.Calamity().customRarity = CalamityRarity.RareVariant; diff --git a/Items/Accessories/FeatherCrown.cs b/Items/Accessories/FeatherCrown.cs index a81b82e21a..a4b606de33 100644 --- a/Items/Accessories/FeatherCrown.cs +++ b/Items/Accessories/FeatherCrown.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Accessories { item.width = 44; item.height = 38; - item.value = Item.buyPrice(0, 0, 80, 0); - item.rare = 4; + item.value = CalamityGlobalItem.Rarity3BuyPrice; + item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/FilthyGlove.cs b/Items/Accessories/FilthyGlove.cs index 5bef54139a..e3d57f7170 100644 --- a/Items/Accessories/FilthyGlove.cs +++ b/Items/Accessories/FilthyGlove.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { item.width = 24; item.height = 38; - item.value = Item.buyPrice(0, 4, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.accessory = true; item.rare = 3; } diff --git a/Items/Accessories/FleshTotem.cs b/Items/Accessories/FleshTotem.cs index b4ae75b762..b3d392cc8c 100644 --- a/Items/Accessories/FleshTotem.cs +++ b/Items/Accessories/FleshTotem.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories item.width = 26; item.height = 26; item.rare = 8; - item.value = Item.buyPrice(0, 24, 0, 0); + item.value = CalamityGlobalItem.Rarity8BuyPrice; item.accessory = true; } diff --git a/Items/Accessories/FrigidBulwark.cs b/Items/Accessories/FrigidBulwark.cs index ae11e4f707..e0f561e3a5 100644 --- a/Items/Accessories/FrigidBulwark.cs +++ b/Items/Accessories/FrigidBulwark.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Accessories { item.width = 38; item.height = 44; - item.value = Item.buyPrice(0, 30, 0, 0); - item.rare = 9; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; item.defense = 8; item.accessory = true; } diff --git a/Items/Accessories/FrostBarrier.cs b/Items/Accessories/FrostBarrier.cs index 63c0da9caf..8cab320dc5 100644 --- a/Items/Accessories/FrostBarrier.cs +++ b/Items/Accessories/FrostBarrier.cs @@ -1,5 +1,6 @@ using CalamityMod.CalPlayer; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -19,8 +20,8 @@ namespace CalamityMod.Items.Accessories item.defense = 4; item.width = 20; item.height = 24; - item.value = Item.buyPrice(0, 9, 0, 0); - item.rare = 3; + item.value = CalamityGlobalItem.Rarity4BuyPrice; + item.rare = 4; item.accessory = true; } @@ -28,7 +29,7 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.fBarrier = true; - player.buffImmune[46] = true; + player.buffImmune[BuffID.Chilled] = true; } } } diff --git a/Items/Accessories/FrostFlare.cs b/Items/Accessories/FrostFlare.cs index f66a8c5566..5e4c5660d3 100644 --- a/Items/Accessories/FrostFlare.cs +++ b/Items/Accessories/FrostFlare.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Accessories item.width = 20; item.height = 24; item.lifeRegen = 1; - item.value = Item.buyPrice(0, 24, 0, 0); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/FungalCarapace.cs b/Items/Accessories/FungalCarapace.cs index d7beaa3eee..9585986dde 100644 --- a/Items/Accessories/FungalCarapace.cs +++ b/Items/Accessories/FungalCarapace.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Items.Accessories item.defense = 2; item.width = 20; item.height = 24; - item.value = Item.buyPrice(0, 15, 0, 0); - item.rare = 5; + item.value = CalamityGlobalItem.Rarity4BuyPrice; + item.rare = 4; item.accessory = true; } diff --git a/Items/Accessories/FungalClump.cs b/Items/Accessories/FungalClump.cs index cd885de770..4b69a53c36 100644 --- a/Items/Accessories/FungalClump.cs +++ b/Items/Accessories/FungalClump.cs @@ -20,9 +20,9 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 26; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity2BuyPrice; item.expert = true; - item.rare = 9; + item.rare = 2; item.accessory = true; } diff --git a/Items/Accessories/FungalSymbiote.cs b/Items/Accessories/FungalSymbiote.cs index 836fdadad8..06807ba451 100644 --- a/Items/Accessories/FungalSymbiote.cs +++ b/Items/Accessories/FungalSymbiote.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 38; item.height = 36; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/Gehenna.cs b/Items/Accessories/Gehenna.cs index 71e1f63069..48d6d40aca 100644 --- a/Items/Accessories/Gehenna.cs +++ b/Items/Accessories/Gehenna.cs @@ -21,9 +21,9 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 15, 0, 0); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.expert = true; - item.rare = 9; + item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/GiantPearl.cs b/Items/Accessories/GiantPearl.cs index 0c82ffe5c3..fc2a940535 100644 --- a/Items/Accessories/GiantPearl.cs +++ b/Items/Accessories/GiantPearl.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 42; item.height = 32; - item.value = Item.buyPrice(0, 3, 0, 0); + item.value = CalamityGlobalItem.Rarity2BuyPrice; item.rare = 2; item.accessory = true; } diff --git a/Items/Accessories/GiantShell.cs b/Items/Accessories/GiantShell.cs index d298b0c214..c569253fea 100644 --- a/Items/Accessories/GiantShell.cs +++ b/Items/Accessories/GiantShell.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories item.defense = 6; item.width = 20; item.height = 24; - item.value = Item.buyPrice(0, 3, 0, 0); + item.value = CalamityGlobalItem.Rarity1BuyPrice; item.rare = 1; item.accessory = true; } diff --git a/Items/Accessories/GiantTortoiseShell.cs b/Items/Accessories/GiantTortoiseShell.cs index 797b62bd62..c1fd1e6daa 100644 --- a/Items/Accessories/GiantTortoiseShell.cs +++ b/Items/Accessories/GiantTortoiseShell.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories item.defense = 8; item.width = 20; item.height = 24; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/GladiatorsLocket.cs b/Items/Accessories/GladiatorsLocket.cs index 92d8991cd4..98e567de6d 100644 --- a/Items/Accessories/GladiatorsLocket.cs +++ b/Items/Accessories/GladiatorsLocket.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { item.width = 42; item.height = 36; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.defense = 5; item.accessory = true; diff --git a/Items/Accessories/GloveOfRecklessness.cs b/Items/Accessories/GloveOfRecklessness.cs index 8ccd8226ee..f907f1d508 100644 --- a/Items/Accessories/GloveOfRecklessness.cs +++ b/Items/Accessories/GloveOfRecklessness.cs @@ -17,9 +17,9 @@ namespace CalamityMod.Items.Accessories { item.width = 24; item.height = 40; - item.value = Item.buyPrice(0, 50, 0, 0); + item.value = CalamityGlobalItem.Rarity7BuyPrice; item.accessory = true; - item.rare = 8; + item.rare = 7; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/GloveofPrecision.cs b/Items/Accessories/GloveofPrecision.cs index afd6a5a729..1233028f28 100644 --- a/Items/Accessories/GloveofPrecision.cs +++ b/Items/Accessories/GloveofPrecision.cs @@ -16,9 +16,9 @@ namespace CalamityMod.Items.Accessories { item.width = 24; item.height = 40; - item.value = Item.buyPrice(0, 50, 0, 0); + item.value = CalamityGlobalItem.Rarity7BuyPrice; item.accessory = true; - item.rare = 8; + item.rare = 7; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/GodlySoulArtifact.cs b/Items/Accessories/GodlySoulArtifact.cs index b3afb40c51..30856db826 100644 --- a/Items/Accessories/GodlySoulArtifact.cs +++ b/Items/Accessories/GodlySoulArtifact.cs @@ -21,10 +21,10 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 28; - item.value = Item.buyPrice(1, 50, 0, 0); + item.value = CalamityGlobalItem.Rarity15BuyPrice; item.accessory = true; item.rare = 10; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.Violet; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/GoldBurdenBreaker.cs b/Items/Accessories/GoldBurdenBreaker.cs index b4fae34092..1c76b66fe3 100644 --- a/Items/Accessories/GoldBurdenBreaker.cs +++ b/Items/Accessories/GoldBurdenBreaker.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 28; - item.value = Item.buyPrice(0, 21, 0, 0); + item.value = CalamityGlobalItem.Rarity12BuyPrice; item.rare = 10; item.accessory = true; item.Calamity().customRarity = CalamityRarity.Turquoise; diff --git a/Items/Accessories/GrandGelatin.cs b/Items/Accessories/GrandGelatin.cs index c25916bf5c..a34f996431 100644 --- a/Items/Accessories/GrandGelatin.cs +++ b/Items/Accessories/GrandGelatin.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 24; - item.value = Item.buyPrice(0, 15, 0, 0); - item.rare = 6; + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/GravistarSabaton.cs b/Items/Accessories/GravistarSabaton.cs index 20d5a68d72..e000d073fc 100644 --- a/Items/Accessories/GravistarSabaton.cs +++ b/Items/Accessories/GravistarSabaton.cs @@ -17,10 +17,10 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 22; - item.value = Item.buyPrice(0, 30, 0, 0); + item.value = CalamityGlobalItem.Rarity7BuyPrice; item.accessory = true; item.expert = true; - item.rare = 9; + item.rare = 7; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/HarpyRing.cs b/Items/Accessories/HarpyRing.cs index bd7e8fea56..44321bfe6e 100644 --- a/Items/Accessories/HarpyRing.cs +++ b/Items/Accessories/HarpyRing.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 22; - item.value = Item.buyPrice(0, 3, 0, 0); - item.rare = 4; + item.value = CalamityGlobalItem.Rarity3BuyPrice; + item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/HeartofDarkness.cs b/Items/Accessories/HeartofDarkness.cs index 81e7c7d448..478ba78681 100644 --- a/Items/Accessories/HeartofDarkness.cs +++ b/Items/Accessories/HeartofDarkness.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/HeartoftheElements.cs b/Items/Accessories/HeartoftheElements.cs index c8a91869d6..8c91663429 100644 --- a/Items/Accessories/HeartoftheElements.cs +++ b/Items/Accessories/HeartoftheElements.cs @@ -32,7 +32,8 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 20; - item.value = Item.buyPrice(0, 60, 0, 0); + item.value = CalamityGlobalItem.Rarity10BuyPrice; + item.rare = 10; item.defense = 9; item.accessory = true; item.Calamity().customRarity = CalamityRarity.Rainbow; diff --git a/Items/Accessories/HideofAstrumDeus.cs b/Items/Accessories/HideofAstrumDeus.cs index 15c2f0e62f..49a1613eae 100644 --- a/Items/Accessories/HideofAstrumDeus.cs +++ b/Items/Accessories/HideofAstrumDeus.cs @@ -21,7 +21,8 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 30, 0, 0); + item.value = CalamityGlobalItem.Rarity9BuyPrice; + item.rare = 9; item.accessory = true; item.Calamity().customRarity = CalamityRarity.RareVariant; } diff --git a/Items/Accessories/HoneyDew.cs b/Items/Accessories/HoneyDew.cs index 1272f5c886..e9d1fade78 100644 --- a/Items/Accessories/HoneyDew.cs +++ b/Items/Accessories/HoneyDew.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,8 +21,8 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 20; - item.value = Item.buyPrice(0, 15, 0, 0); - item.rare = 7; + item.value = CalamityGlobalItem.Rarity4BuyPrice; + item.rare = 4; item.accessory = true; } @@ -35,8 +36,8 @@ namespace CalamityMod.Items.Accessories player.statDefense += 5; player.endurance += 0.05f; } - player.buffImmune[70] = true; - player.buffImmune[20] = true; + player.buffImmune[BuffID.Venom] = true; + player.buffImmune[BuffID.Poisoned] = true; if (!player.honey && player.lifeRegen < 0) { player.lifeRegen += 2; @@ -54,8 +55,9 @@ namespace CalamityMod.Items.Accessories ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.BottledHoney, 10); - recipe.AddIngredient(ItemID.BeeWax, 10); - recipe.AddIngredient(ItemID.Bezoar); + recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Accessories/InkBomb.cs b/Items/Accessories/InkBomb.cs index ba91beb059..a9b42a24b3 100644 --- a/Items/Accessories/InkBomb.cs +++ b/Items/Accessories/InkBomb.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { item.width = 22; item.height = 50; - item.value = Item.buyPrice(0, 3, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } @@ -28,9 +28,5 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.inkBomb = true; } - - public override void AddRecipes() - { - } } } diff --git a/Items/Accessories/IronBoots.cs b/Items/Accessories/IronBoots.cs index 17ee004f75..905159b88d 100644 --- a/Items/Accessories/IronBoots.cs +++ b/Items/Accessories/IronBoots.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/JellyChargedBattery.cs b/Items/Accessories/JellyChargedBattery.cs index 6eaf774eff..2da23872fb 100644 --- a/Items/Accessories/JellyChargedBattery.cs +++ b/Items/Accessories/JellyChargedBattery.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 22; - item.value = Item.buyPrice(0, 2, 0, 0); + item.value = CalamityGlobalItem.Rarity4BuyPrice; item.accessory = true; - item.rare = 3; + item.rare = 4; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/Laudanum.cs b/Items/Accessories/Laudanum.cs index 9cef7a4e86..7be348eff8 100644 --- a/Items/Accessories/Laudanum.cs +++ b/Items/Accessories/Laudanum.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/LeadCore.cs b/Items/Accessories/LeadCore.cs index 52fc9a0b46..96002b3fcf 100644 --- a/Items/Accessories/LeadCore.cs +++ b/Items/Accessories/LeadCore.cs @@ -15,8 +15,8 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.rare = 2; - item.value = Item.buyPrice(0, 3, 0, 0); + item.rare = 5; + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.accessory = true; } diff --git a/Items/Accessories/LeviathanAmbergris.cs b/Items/Accessories/LeviathanAmbergris.cs index 010f303042..ab037f4cf8 100644 --- a/Items/Accessories/LeviathanAmbergris.cs +++ b/Items/Accessories/LeviathanAmbergris.cs @@ -21,10 +21,10 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 22; - item.value = Item.buyPrice(0, 30, 0, 0); + item.value = CalamityGlobalItem.Rarity7BuyPrice; item.accessory = true; item.expert = true; - item.rare = 9; + item.rare = 7; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/LifeJelly.cs b/Items/Accessories/LifeJelly.cs index c7c79a17bf..bfe74550a5 100644 --- a/Items/Accessories/LifeJelly.cs +++ b/Items/Accessories/LifeJelly.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 24; - item.value = Item.buyPrice(0, 6, 0, 0); + item.value = CalamityGlobalItem.Rarity1BuyPrice; item.rare = 1; item.accessory = true; } diff --git a/Items/Accessories/LivingDew.cs b/Items/Accessories/LivingDew.cs index 1840c1cd34..43eb694e8c 100644 --- a/Items/Accessories/LivingDew.cs +++ b/Items/Accessories/LivingDew.cs @@ -10,15 +10,16 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Living Dew"); - Tooltip.SetDefault("5% increased damage reduction, +5 defense, and increased life regen while in the Jungle"); + Tooltip.SetDefault("5% increased damage reduction, +5 defense, and increased life regen while in the Jungle\n" + + "Immunity to Poison"); } public override void SetDefaults() { item.width = 20; item.height = 20; - item.value = Item.buyPrice(0, 12, 0, 0); - item.rare = 5; + item.value = CalamityGlobalItem.Rarity3BuyPrice; + item.rare = 3; item.accessory = true; } @@ -30,17 +31,17 @@ namespace CalamityMod.Items.Accessories player.statDefense += 5; player.endurance += 0.05f; } + player.buffImmune[BuffID.Poisoned] = true; } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddTile(TileID.MythrilAnvil); + recipe.AddIngredient(ItemID.BeeWax, 10); + recipe.AddIngredient(ItemID.Bezoar); + recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Accessories/LumenousAmulet.cs b/Items/Accessories/LumenousAmulet.cs index 0247f2cfd0..6e49778897 100644 --- a/Items/Accessories/LumenousAmulet.cs +++ b/Items/Accessories/LumenousAmulet.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 15, 0, 0); - item.rare = 5; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; item.accessory = true; } diff --git a/Items/Accessories/LureofEnthrallment.cs b/Items/Accessories/LureofEnthrallment.cs index 458d27f756..fc0f696056 100644 --- a/Items/Accessories/LureofEnthrallment.cs +++ b/Items/Accessories/LureofEnthrallment.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 56; item.height = 56; - item.value = Item.buyPrice(0, 30, 0, 0); + item.value = CalamityGlobalItem.Rarity7BuyPrice; item.rare = 7; item.accessory = true; } diff --git a/Items/Accessories/LuxorsGift.cs b/Items/Accessories/LuxorsGift.cs index 8909f72368..e2748a26da 100644 --- a/Items/Accessories/LuxorsGift.cs +++ b/Items/Accessories/LuxorsGift.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 58; item.height = 48; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/ManaJelly.cs b/Items/Accessories/ManaJelly.cs index 28ad8ae3ce..e44bfa8874 100644 --- a/Items/Accessories/ManaJelly.cs +++ b/Items/Accessories/ManaJelly.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 24; - item.value = Item.buyPrice(0, 6, 0, 0); + item.value = CalamityGlobalItem.Rarity1BuyPrice; item.rare = 1; item.accessory = true; } diff --git a/Items/Accessories/ManaOverloader.cs b/Items/Accessories/ManaOverloader.cs index 5d4d6691e3..f28b6d803d 100644 --- a/Items/Accessories/ManaOverloader.cs +++ b/Items/Accessories/ManaOverloader.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Accessories { item.width = 30; item.height = 30; - item.value = Item.buyPrice(0, 15, 0, 0); - item.rare = 9; + item.value = CalamityGlobalItem.Rarity4BuyPrice; + item.rare = 4; item.accessory = true; item.expert = true; } diff --git a/Items/Accessories/MirageMirror.cs b/Items/Accessories/MirageMirror.cs index 5877e21aa2..a77f7ed2aa 100644 --- a/Items/Accessories/MirageMirror.cs +++ b/Items/Accessories/MirageMirror.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Accessories { item.width = 30; item.height = 30; - item.value = Item.buyPrice(0, 2, 0, 0); - item.rare = 2; + item.value = CalamityGlobalItem.Rarity3BuyPrice; + item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/MomentumCapacitor.cs b/Items/Accessories/MomentumCapacitor.cs index 30431528d9..0d14790fb1 100644 --- a/Items/Accessories/MomentumCapacitor.cs +++ b/Items/Accessories/MomentumCapacitor.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Accessories item.height = 32; item.value = Item.buyPrice(0, 36, 0, 0); item.accessory = true; - item.rare = 6; + item.rare = 5; } public override void ModifyTooltips(List list) diff --git a/Items/Accessories/MoonstoneCrown.cs b/Items/Accessories/MoonstoneCrown.cs index 18a590a446..d913dd1257 100644 --- a/Items/Accessories/MoonstoneCrown.cs +++ b/Items/Accessories/MoonstoneCrown.cs @@ -20,7 +20,8 @@ namespace CalamityMod.Items.Accessories { item.width = 46; item.height = 40; - item.value = Item.buyPrice(0, 18, 0, 0); + item.value = CalamityGlobalItem.Rarity12BuyPrice; + item.rare = 10; item.Calamity().customRarity = CalamityRarity.Turquoise; item.accessory = true; } diff --git a/Items/Accessories/MutatedTruffle.cs b/Items/Accessories/MutatedTruffle.cs index 62f7b7c671..14263c6d8a 100644 --- a/Items/Accessories/MutatedTruffle.cs +++ b/Items/Accessories/MutatedTruffle.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 24; item.height = 26; - item.value = Item.buyPrice(0, 80, 0, 0); + item.value = CalamityGlobalItem.Rarity13BuyPrice; item.rare = 10; item.expert = true; item.accessory = true; diff --git a/Items/Accessories/Nanotech.cs b/Items/Accessories/Nanotech.cs index e0c77bf200..bd8640bb9c 100644 --- a/Items/Accessories/Nanotech.cs +++ b/Items/Accessories/Nanotech.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 32; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.accessory = true; item.Calamity().customRarity = CalamityRarity.DarkBlue; } diff --git a/Items/Accessories/NebulousCore.cs b/Items/Accessories/NebulousCore.cs index 3063cedc7e..36e10f9c87 100644 --- a/Items/Accessories/NebulousCore.cs +++ b/Items/Accessories/NebulousCore.cs @@ -21,10 +21,10 @@ namespace CalamityMod.Items.Accessories { item.width = 16; item.height = 14; - item.value = Item.buyPrice(0, 60, 0, 0); + item.value = CalamityGlobalItem.Rarity13BuyPrice; item.accessory = true; item.expert = true; - item.rare = 9; + item.rare = 10; } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Accessories/NecklaceofVexation.cs b/Items/Accessories/NecklaceofVexation.cs index 78832ad83c..6002f0375b 100644 --- a/Items/Accessories/NecklaceofVexation.cs +++ b/Items/Accessories/NecklaceofVexation.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 34; - item.value = Item.buyPrice(0, 15, 0, 0); - item.rare = 6; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; item.accessory = true; } diff --git a/Items/Accessories/NuclearRod.cs b/Items/Accessories/NuclearRod.cs index 108be9407b..bb51bbeb83 100644 --- a/Items/Accessories/NuclearRod.cs +++ b/Items/Accessories/NuclearRod.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 32; - item.value = Item.buyPrice(0, 25, 0, 0); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/Nucleogenesis.cs b/Items/Accessories/Nucleogenesis.cs index 4a53b5bd86..ab9cce1062 100644 --- a/Items/Accessories/Nucleogenesis.cs +++ b/Items/Accessories/Nucleogenesis.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 32; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.accessory = true; item.Calamity().customRarity = CalamityRarity.DarkBlue; } diff --git a/Items/Accessories/OceanCrest.cs b/Items/Accessories/OceanCrest.cs index 300b61afed..e983282be5 100644 --- a/Items/Accessories/OceanCrest.cs +++ b/Items/Accessories/OceanCrest.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories @@ -15,19 +16,19 @@ namespace CalamityMod.Items.Accessories { item.width = 18; item.height = 26; - item.value = Item.buyPrice(0, 6, 0, 0); - item.rare = 9; + item.value = CalamityGlobalItem.Rarity2BuyPrice; + item.rare = 2; item.accessory = true; item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) { - player.npcTypeNoAggro[65] = true; - player.npcTypeNoAggro[220] = true; - player.npcTypeNoAggro[64] = true; - player.npcTypeNoAggro[67] = true; - player.npcTypeNoAggro[221] = true; + player.npcTypeNoAggro[NPCID.Shark] = true; + player.npcTypeNoAggro[NPCID.SeaSnail] = true; + player.npcTypeNoAggro[NPCID.PinkJellyfish] = true; + player.npcTypeNoAggro[NPCID.Crab] = true; + player.npcTypeNoAggro[NPCID.Squid] = true; player.gills = true; } } diff --git a/Items/Accessories/OldDie.cs b/Items/Accessories/OldDie.cs index 9862cd5c82..48844d0b20 100644 --- a/Items/Accessories/OldDie.cs +++ b/Items/Accessories/OldDie.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories item.width = 24; item.height = 26; item.rare = 3; - item.value = Item.buyPrice(0, 10, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.accessory = true; } diff --git a/Items/Accessories/OrnateShield.cs b/Items/Accessories/OrnateShield.cs index bc6ac8bb02..e4b36c2695 100644 --- a/Items/Accessories/OrnateShield.cs +++ b/Items/Accessories/OrnateShield.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 36; item.height = 32; - item.value = Item.buyPrice(0, 12, 0, 0); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = 5; item.defense = 8; item.accessory = true; diff --git a/Items/Accessories/PermafrostsConcoction.cs b/Items/Accessories/PermafrostsConcoction.cs index bd0ce51854..bea2728aaf 100644 --- a/Items/Accessories/PermafrostsConcoction.cs +++ b/Items/Accessories/PermafrostsConcoction.cs @@ -21,7 +21,7 @@ Provides heat and cold protection in Death Mode"); item.accessory = true; item.width = 36; item.height = 34; - item.value = Item.buyPrice(0, 45, 0, 0); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = 5; } diff --git a/Items/Accessories/PlagueHive.cs b/Items/Accessories/PlagueHive.cs index 9684774f91..03d36ab116 100644 --- a/Items/Accessories/PlagueHive.cs +++ b/Items/Accessories/PlagueHive.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories { item.width = 30; item.height = 38; - item.value = Item.buyPrice(0, 60, 0, 0); + item.value = CalamityGlobalItem.Rarity9BuyPrice; item.expert = true; item.rare = 9; item.accessory = true; diff --git a/Items/Accessories/PlaguedFuelPack.cs b/Items/Accessories/PlaguedFuelPack.cs index 4af0f75c0e..56fd678474 100644 --- a/Items/Accessories/PlaguedFuelPack.cs +++ b/Items/Accessories/PlaguedFuelPack.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 36; - item.value = Item.buyPrice(0, 24, 0, 0); + item.value = CalamityGlobalItem.Rarity8BuyPrice; item.rare = 8; item.accessory = true; } diff --git a/Items/Accessories/ProfanedSoulArtifact.cs b/Items/Accessories/ProfanedSoulArtifact.cs index 98f96a7413..dced5e1e7f 100644 --- a/Items/Accessories/ProfanedSoulArtifact.cs +++ b/Items/Accessories/ProfanedSoulArtifact.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories { item.width = 32; item.height = 40; - item.value = Item.buyPrice(1, 40, 0, 0); + item.value = CalamityGlobalItem.Rarity12BuyPrice; item.rare = 10; item.accessory = true; item.Calamity().customRarity = CalamityRarity.Dedicated; diff --git a/Items/Accessories/PsychoticAmulet.cs b/Items/Accessories/PsychoticAmulet.cs index 6e08ca679d..86cfea1da1 100644 --- a/Items/Accessories/PsychoticAmulet.cs +++ b/Items/Accessories/PsychoticAmulet.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 15, 0, 0); - item.rare = 6; + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/RadiantOoze.cs b/Items/Accessories/RadiantOoze.cs index 2a3e432b2c..370c62d21d 100644 --- a/Items/Accessories/RadiantOoze.cs +++ b/Items/Accessories/RadiantOoze.cs @@ -17,8 +17,8 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 20; - item.value = Item.buyPrice(0, 6, 0, 0); - item.rare = 3; + item.value = CalamityGlobalItem.Rarity4BuyPrice; + item.rare = 4; item.accessory = true; } diff --git a/Items/Accessories/RaidersTalisman.cs b/Items/Accessories/RaidersTalisman.cs index 4654ecc26d..4109867459 100644 --- a/Items/Accessories/RaidersTalisman.cs +++ b/Items/Accessories/RaidersTalisman.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 20; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity2BuyPrice; item.rare = 2; item.accessory = true; } diff --git a/Items/Accessories/RampartofDeities.cs b/Items/Accessories/RampartofDeities.cs index bd38defdc1..449f87fd77 100644 --- a/Items/Accessories/RampartofDeities.cs +++ b/Items/Accessories/RampartofDeities.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Accessories { item.width = 38; item.height = 44; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.defense = 12; item.accessory = true; item.Calamity().customRarity = CalamityRarity.DarkBlue; diff --git a/Items/Accessories/ReaperToothNecklace.cs b/Items/Accessories/ReaperToothNecklace.cs index 0053e0b13f..8a7950d10e 100644 --- a/Items/Accessories/ReaperToothNecklace.cs +++ b/Items/Accessories/ReaperToothNecklace.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 60, 0, 0); + item.value = CalamityGlobalItem.Rarity13BuyPrice; item.rare = 10; item.accessory = true; item.Calamity().customRarity = CalamityRarity.PureGreen; diff --git a/Items/Accessories/Regenator.cs b/Items/Accessories/Regenator.cs index 2656f6241c..aba20fbf1c 100644 --- a/Items/Accessories/Regenator.cs +++ b/Items/Accessories/Regenator.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Accessories { item.width = 36; item.height = 32; - item.value = Item.buyPrice(0, 12, 0, 0); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = 5; item.defense = 6; item.accessory = true; diff --git a/Items/Accessories/RogueEmblem.cs b/Items/Accessories/RogueEmblem.cs index b6887e989e..27d08654c5 100644 --- a/Items/Accessories/RogueEmblem.cs +++ b/Items/Accessories/RogueEmblem.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Accessories { item.width = 24; item.height = 24; - item.value = 100000; + item.value = CalamityGlobalItem.Rarity4BuyPrice; item.rare = 4; item.accessory = true; } diff --git a/Items/Accessories/RoseStone.cs b/Items/Accessories/RoseStone.cs index a4059168c3..ff29ececd6 100644 --- a/Items/Accessories/RoseStone.cs +++ b/Items/Accessories/RoseStone.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 20; - item.value = Item.buyPrice(0, 15, 0, 0); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/RottenBrain.cs b/Items/Accessories/RottenBrain.cs index 83cbd5ed35..1f338e495d 100644 --- a/Items/Accessories/RottenBrain.cs +++ b/Items/Accessories/RottenBrain.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Items.Accessories { item.width = 34; item.height = 34; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.expert = true; - item.rare = 9; + item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/RuinMedallion.cs b/Items/Accessories/RuinMedallion.cs index b55ec290eb..3e70d33bf4 100644 --- a/Items/Accessories/RuinMedallion.cs +++ b/Items/Accessories/RuinMedallion.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 28; - item.value = Item.buyPrice(0, 13, 0, 0); - item.rare = 6; + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/SamuraiBadge.cs b/Items/Accessories/SamuraiBadge.cs index b1586154e7..6835e18af3 100644 --- a/Items/Accessories/SamuraiBadge.cs +++ b/Items/Accessories/SamuraiBadge.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 30; item.height = 30; - item.value = Item.buyPrice(0, 21, 0, 0); + item.value = CalamityGlobalItem.Rarity12BuyPrice; item.accessory = true; item.Calamity().customRarity = CalamityRarity.RareVariant; } diff --git a/Items/Accessories/SandCloak.cs b/Items/Accessories/SandCloak.cs index 3ae66ca741..f3dea286ed 100644 --- a/Items/Accessories/SandCloak.cs +++ b/Items/Accessories/SandCloak.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { item.width = 30; item.height = 44; - item.value = Item.buyPrice(0, 2, 0, 0); + item.value = CalamityGlobalItem.Rarity2BuyPrice; item.rare = 2; item.accessory = true; } diff --git a/Items/Accessories/ScuttlersJewel.cs b/Items/Accessories/ScuttlersJewel.cs index c01bd63a66..a297c7f94e 100644 --- a/Items/Accessories/ScuttlersJewel.cs +++ b/Items/Accessories/ScuttlersJewel.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 3, 0, 0); + item.value = CalamityGlobalItem.Rarity1BuyPrice; item.rare = 1; item.accessory = true; } diff --git a/Items/Accessories/SeaShell.cs b/Items/Accessories/SeaShell.cs index a3ca77070a..a9de56b345 100644 --- a/Items/Accessories/SeaShell.cs +++ b/Items/Accessories/SeaShell.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Accessories item.defense = 2; item.width = 20; item.height = 24; - item.value = Item.buyPrice(0, 3, 0, 0); - item.rare = 1; + item.value = CalamityGlobalItem.Rarity2BuyPrice; + item.rare = 2; item.accessory = true; } diff --git a/Items/Accessories/ShieldoftheOcean.cs b/Items/Accessories/ShieldoftheOcean.cs index 909b9d3835..166cce3ea0 100644 --- a/Items/Accessories/ShieldoftheOcean.cs +++ b/Items/Accessories/ShieldoftheOcean.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 24; item.height = 28; - item.value = Item.buyPrice(0, 3, 0, 0); + item.value = CalamityGlobalItem.Rarity2BuyPrice; item.rare = 2; item.defense = 2; item.accessory = true; diff --git a/Items/Accessories/SigilofCalamitas.cs b/Items/Accessories/SigilofCalamitas.cs index 2a26337511..18459b597d 100644 --- a/Items/Accessories/SigilofCalamitas.cs +++ b/Items/Accessories/SigilofCalamitas.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 32; - item.value = Item.buyPrice(0, 30, 0, 0); - item.rare = 9; + item.value = CalamityGlobalItem.Rarity8BuyPrice; + item.rare = 8; item.accessory = true; } diff --git a/Items/Accessories/SilencingSheath.cs b/Items/Accessories/SilencingSheath.cs index 9bd46f5e43..6e83f81a2e 100644 --- a/Items/Accessories/SilencingSheath.cs +++ b/Items/Accessories/SilencingSheath.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Accessories { item.width = 32; item.height = 34; - item.value = Item.buyPrice(0, 2, 0, 0); - item.rare = 2; + item.value = CalamityGlobalItem.Rarity3BuyPrice; + item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/SirensHeart.cs b/Items/Accessories/SirensHeart.cs index 5a6ff51139..b61d810c24 100644 --- a/Items/Accessories/SirensHeart.cs +++ b/Items/Accessories/SirensHeart.cs @@ -29,8 +29,8 @@ namespace CalamityMod.Items.Accessories item.width = 18; item.height = 18; item.accessory = true; - item.value = Item.buyPrice(0, 45, 0, 0); - item.rare = 7; + item.value = CalamityGlobalItem.Rarity4BuyPrice; + item.rare = 4; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/SirensHeartAlt.cs b/Items/Accessories/SirensHeartAlt.cs index 1d4a2d36a1..065f4e94f7 100644 --- a/Items/Accessories/SirensHeartAlt.cs +++ b/Items/Accessories/SirensHeartAlt.cs @@ -29,8 +29,8 @@ namespace CalamityMod.Items.Accessories item.width = 18; item.height = 18; item.accessory = true; - item.value = Item.buyPrice(0, 45, 0, 0); - item.rare = 7; + item.value = CalamityGlobalItem.Rarity4BuyPrice; + item.rare = 4; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/SpectralVeil.cs b/Items/Accessories/SpectralVeil.cs index 36cc32ba5e..df38695fce 100644 --- a/Items/Accessories/SpectralVeil.cs +++ b/Items/Accessories/SpectralVeil.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories { item.width = 30; item.height = 38; - item.value = Item.buyPrice(1, 40, 0, 0); + item.value = CalamityGlobalItem.Rarity13BuyPrice; item.Calamity().customRarity = CalamityRarity.PureGreen; item.accessory = true; } diff --git a/Items/Accessories/SpiritGenerator.cs b/Items/Accessories/SpiritGenerator.cs index bcb286e074..a549597cf5 100644 --- a/Items/Accessories/SpiritGenerator.cs +++ b/Items/Accessories/SpiritGenerator.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity2BuyPrice; item.rare = 2; item.accessory = true; } diff --git a/Items/Accessories/Sponge.cs b/Items/Accessories/Sponge.cs index 316eb68d3a..f5faacd468 100644 --- a/Items/Accessories/Sponge.cs +++ b/Items/Accessories/Sponge.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Accessories item.defense = 10; item.width = 20; item.height = 20; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.accessory = true; item.Calamity().customRarity = CalamityRarity.DarkBlue; } diff --git a/Items/Accessories/StarTaintedGenerator.cs b/Items/Accessories/StarTaintedGenerator.cs index 6a70ead983..24151976e7 100644 --- a/Items/Accessories/StarTaintedGenerator.cs +++ b/Items/Accessories/StarTaintedGenerator.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories item.width = 20; item.height = 22; item.accessory = true; - item.value = Item.buyPrice(0, 45, 0, 0); + item.value = CalamityGlobalItem.Rarity8BuyPrice; item.rare = 8; } diff --git a/Items/Accessories/StarbusterCore.cs b/Items/Accessories/StarbusterCore.cs index e7c728a60c..8c515b9b35 100644 --- a/Items/Accessories/StarbusterCore.cs +++ b/Items/Accessories/StarbusterCore.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 32; - item.value = Item.buyPrice(0, 24, 0, 0); + item.value = CalamityGlobalItem.Rarity7BuyPrice; item.rare = 7; item.accessory = true; } diff --git a/Items/Accessories/StatisBeltOfCurses.cs b/Items/Accessories/StatisBeltOfCurses.cs index cf21088fb7..bf47a82aa2 100644 --- a/Items/Accessories/StatisBeltOfCurses.cs +++ b/Items/Accessories/StatisBeltOfCurses.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 32; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.accessory = true; item.Calamity().postMoonLordRarity = 14; } diff --git a/Items/Accessories/StatisBlessing.cs b/Items/Accessories/StatisBlessing.cs index a4256bea5d..0253039d1b 100644 --- a/Items/Accessories/StatisBlessing.cs +++ b/Items/Accessories/StatisBlessing.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 32; - item.value = Item.buyPrice(0, 45, 0, 0); - item.rare = 9; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; item.accessory = true; } diff --git a/Items/Accessories/StatisCurse.cs b/Items/Accessories/StatisCurse.cs index 9ed5b61071..88e91b8c22 100644 --- a/Items/Accessories/StatisCurse.cs +++ b/Items/Accessories/StatisCurse.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 32; - item.value = Item.buyPrice(0, 60, 0, 0); + item.value = CalamityGlobalItem.Rarity10BuyPrice; item.rare = 10; item.accessory = true; } diff --git a/Items/Accessories/StatisNinjaBelt.cs b/Items/Accessories/StatisNinjaBelt.cs index 3225f87f6b..ea42449d67 100644 --- a/Items/Accessories/StatisNinjaBelt.cs +++ b/Items/Accessories/StatisNinjaBelt.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 32; - item.value = Item.buyPrice(0, 45, 0, 0); - item.rare = 9; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; item.accessory = true; } diff --git a/Items/Accessories/StressPills.cs b/Items/Accessories/StressPills.cs index c7d3180783..cb10a8ce8c 100644 --- a/Items/Accessories/StressPills.cs +++ b/Items/Accessories/StressPills.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 6, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs b/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs index 8f6d44be6e..3fabdf713a 100644 --- a/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs +++ b/Items/Accessories/SupremeBaitTackleBoxFishingStation.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 45, 0, 0); - item.rare = 10; + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/TheAbsorber.cs b/Items/Accessories/TheAbsorber.cs index 21f68cc4ab..0d620fda79 100644 --- a/Items/Accessories/TheAbsorber.cs +++ b/Items/Accessories/TheAbsorber.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Accessories item.defense = 6; item.width = 20; item.height = 24; - item.value = Item.buyPrice(0, 60, 0, 0); + item.value = CalamityGlobalItem.Rarity10BuyPrice; item.rare = 10; item.accessory = true; } diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index 370ef77780..ea29214dd9 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Accessories { item.width = 34; item.height = 34; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.expert = true; item.rare = 9; item.accessory = true; diff --git a/Items/Accessories/TheBee.cs b/Items/Accessories/TheBee.cs index f8e516400a..eef5e34a74 100644 --- a/Items/Accessories/TheBee.cs +++ b/Items/Accessories/TheBee.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 24; item.height = 28; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity4BuyPrice; item.rare = 4; item.accessory = true; item.Calamity().customRarity = CalamityRarity.RareVariant; diff --git a/Items/Accessories/TheCamper.cs b/Items/Accessories/TheCamper.cs index 9aa882e694..8decddc970 100644 --- a/Items/Accessories/TheCamper.cs +++ b/Items/Accessories/TheCamper.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 12, 0, 0); + item.value = CalamityGlobalItem.Rarity7BuyPrice; item.rare = 7; item.accessory = true; item.defense = 10; @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Accessories Lighting.AddLight(player.Center, 0.825f, 0.66f, 0f); if (Main.myPlayer == player.whoAmI) { - if ((double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05) + if (Math.Abs(player.velocity.X) < 0.05f && Math.Abs(player.velocity.Y) < 0.05f) { player.allDamage += 0.15f; auraCounter++; diff --git a/Items/Accessories/TheCommunity.cs b/Items/Accessories/TheCommunity.cs index e45b03735f..e9e32fdc1d 100644 --- a/Items/Accessories/TheCommunity.cs +++ b/Items/Accessories/TheCommunity.cs @@ -25,7 +25,8 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 20; - item.value = Item.buyPrice(0, 60, 0, 0); + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; item.accessory = true; item.Calamity().customRarity = CalamityRarity.Rainbow; } diff --git a/Items/Accessories/TheFirstShadowflame.cs b/Items/Accessories/TheFirstShadowflame.cs index b91765e2f7..b82344ab0b 100644 --- a/Items/Accessories/TheFirstShadowflame.cs +++ b/Items/Accessories/TheFirstShadowflame.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 15, 0, 0); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/TheTransformer.cs b/Items/Accessories/TheTransformer.cs index f395f0592a..544645bccf 100644 --- a/Items/Accessories/TheTransformer.cs +++ b/Items/Accessories/TheTransformer.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 3, 0, 0); + item.value = CalamityGlobalItem.Rarity1BuyPrice; item.rare = 1; item.accessory = true; item.Calamity().customRarity = CalamityRarity.RareVariant; diff --git a/Items/Accessories/ToxicHeart.cs b/Items/Accessories/ToxicHeart.cs index 6a076cb67c..2fee888283 100644 --- a/Items/Accessories/ToxicHeart.cs +++ b/Items/Accessories/ToxicHeart.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Items.Accessories { item.width = 28; item.height = 32; - item.value = Item.buyPrice(0, 30, 0, 0); + item.value = CalamityGlobalItem.Rarity8BuyPrice; item.expert = true; - item.rare = 9; + item.rare = 8; item.accessory = true; } diff --git a/Items/Accessories/TrinketofChi.cs b/Items/Accessories/TrinketofChi.cs index ac8857c96c..59bc2014ac 100644 --- a/Items/Accessories/TrinketofChi.cs +++ b/Items/Accessories/TrinketofChi.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { item.width = 34; item.height = 32; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/UnstablePrism.cs b/Items/Accessories/UnstablePrism.cs index 94a6ceb7d0..321655c51d 100644 --- a/Items/Accessories/UnstablePrism.cs +++ b/Items/Accessories/UnstablePrism.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Accessories { item.width = 22; item.height = 38; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/VampiricTalisman.cs b/Items/Accessories/VampiricTalisman.cs index d7d9d2523f..99cd052d96 100644 --- a/Items/Accessories/VampiricTalisman.cs +++ b/Items/Accessories/VampiricTalisman.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 50; item.height = 26; - item.value = Item.buyPrice(0, 40, 0, 0); + item.value = CalamityGlobalItem.Rarity6BuyPrice; item.accessory = true; item.rare = 6; } diff --git a/Items/Accessories/Vanity/Popo.cs b/Items/Accessories/Vanity/Popo.cs index d01f998f21..e7e19e90e9 100644 --- a/Items/Accessories/Vanity/Popo.cs +++ b/Items/Accessories/Vanity/Popo.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories.Vanity item.width = 26; item.height = 30; item.accessory = true; - item.value = 1000000; + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = 5; } diff --git a/Items/Accessories/VeneratedLocket.cs b/Items/Accessories/VeneratedLocket.cs index 91160edff1..f1352a1f4d 100644 --- a/Items/Accessories/VeneratedLocket.cs +++ b/Items/Accessories/VeneratedLocket.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories { item.width = 34; item.height = 36; - item.value = Item.buyPrice(25, 0, 0, 0); + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.rare = 10; item.Calamity().customRarity = CalamityRarity.DarkBlue; item.accessory = true; diff --git a/Items/Accessories/VitalJelly.cs b/Items/Accessories/VitalJelly.cs index a532c509c6..5b3b9986f8 100644 --- a/Items/Accessories/VitalJelly.cs +++ b/Items/Accessories/VitalJelly.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 24; - item.value = Item.buyPrice(0, 12, 0, 0); - item.rare = 5; + item.value = CalamityGlobalItem.Rarity4BuyPrice; + item.rare = 4; item.accessory = true; } diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index a0c53e5fe5..48c478d3a1 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using System; @@ -29,21 +30,13 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 30, 0, 0); + item.value = CalamityGlobalItem.Rarity8BuyPrice; item.expert = true; - item.rare = 9; + item.rare = 8; item.accessory = true; } - public override bool CanEquipAccessory(Player player, int slot) - { - CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.calamityRing) - { - return false; - } - return true; - } + public override bool CanEquipAccessory(Player player, int slot) => !player.Calamity().calamityRing; public override void AddRecipes() { @@ -51,6 +44,8 @@ namespace CalamityMod.Items.Accessories recipe.AddIngredient(ItemID.ObsidianRose); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); @@ -73,26 +68,21 @@ namespace CalamityMod.Items.Accessories { if (player.whoAmI == Main.myPlayer) { - for (int l = 0; l < 1; l++) - { - float x = player.position.X + (float)Main.rand.Next(-400, 400); - float y = player.position.Y - (float)Main.rand.Next(500, 800); - Vector2 vector = new Vector2(x, y); - float num15 = player.position.X + (float)(player.width / 2) - vector.X; - float num16 = player.position.Y + (float)(player.height / 2) - vector.Y; - num15 += (float)Main.rand.Next(-100, 101); - int num17 = 22; - float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); - num18 = (float)num17 / num18; - num15 *= num18; - num16 *= num18; - int num19 = Projectile.NewProjectile(x, y, num15, num16, ModContent.ProjectileType(), (int)(40 * player.AverageDamage()), 5f, player.whoAmI, 0f, 0f); - Main.projectile[num19].ai[1] = player.position.Y; - Main.projectile[num19].usesLocalNPCImmunity = true; - Main.projectile[num19].localNPCHitCooldown = 60; - Main.projectile[num19].usesIDStaticNPCImmunity = false; - - } + float x = player.position.X + (float)Main.rand.Next(-400, 400); + float y = player.position.Y - (float)Main.rand.Next(500, 800); + Vector2 source = new Vector2(x, y); + Vector2 velocity = player.Center - source; + velocity.X += (float)Main.rand.Next(-100, 101); + float speed = 22f; + float targetDist = velocity.Length(); + targetDist = speed / targetDist; + velocity.X *= targetDist; + velocity.Y *= targetDist; + int fire = Projectile.NewProjectile(source, velocity, ModContent.ProjectileType(), (int)(30 * player.AverageDamage()), 5f, player.whoAmI, 0f, 0f); + Main.projectile[fire].ai[1] = player.position.Y; + Main.projectile[fire].usesLocalNPCImmunity = true; + Main.projectile[fire].localNPCHitCooldown = 60; + Main.projectile[fire].usesIDStaticNPCImmunity = false; } } } @@ -107,20 +97,20 @@ namespace CalamityMod.Items.Accessories { if (player.whoAmI == Main.myPlayer) { - int speed2 = 25; + int projSpeed = 25; float spawnX = Main.rand.Next(1000) - 500 + player.Center.X; float spawnY = -1000 + player.Center.Y; Vector2 baseSpawn = new Vector2(spawnX, spawnY); Vector2 baseVelocity = player.Center - baseSpawn; baseVelocity.Normalize(); - baseVelocity *= speed2; + baseVelocity *= projSpeed; for (int i = 0; i < FireProjectiles; i++) { Vector2 spawn = baseSpawn; - spawn.X = spawn.X + i * 30 - (FireProjectiles * 15); + spawn.X += i * 30 - (FireProjectiles * 15); Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-FireAngleSpread / 2 + (FireAngleSpread * i / (float)FireProjectiles))); velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; - Projectile.NewProjectile(spawn.X, spawn.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), (int)(70 * player.AverageDamage()), 5f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(spawn, velocity, ModContent.ProjectileType(), (int)(70 * player.AverageDamage()), 5f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/Accessories/WifeinaBottle.cs b/Items/Accessories/WifeinaBottle.cs index e324774e6b..b9675a1466 100644 --- a/Items/Accessories/WifeinaBottle.cs +++ b/Items/Accessories/WifeinaBottle.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 26; - item.value = Item.buyPrice(0, 15, 0, 0); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/WifeinaBottlewithBoobs.cs b/Items/Accessories/WifeinaBottlewithBoobs.cs index de79d8cdb0..6eef6a546e 100644 --- a/Items/Accessories/WifeinaBottlewithBoobs.cs +++ b/Items/Accessories/WifeinaBottlewithBoobs.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 26; - item.value = Item.buyPrice(0, 15, 0, 0); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.expert = true; - item.rare = 9; + item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/Wings/AureateWings.cs b/Items/Accessories/Wings/AureateWings.cs index a3b39d14f6..89245c193c 100644 --- a/Items/Accessories/Wings/AureateWings.cs +++ b/Items/Accessories/Wings/AureateWings.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Items.Accessories.Wings { item.width = 54; item.height = 26; - item.value = Item.buyPrice(0, 39, 99, 99); - item.rare = 6; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; item.accessory = true; } diff --git a/Items/Accessories/Wings/CelestialTracers.cs b/Items/Accessories/Wings/CelestialTracers.cs index 985b528f50..893f69bc72 100644 --- a/Items/Accessories/Wings/CelestialTracers.cs +++ b/Items/Accessories/Wings/CelestialTracers.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Accessories.Wings { item.width = 36; item.height = 32; - item.value = Item.buyPrice(1, 20, 0, 0); + item.value = CalamityGlobalItem.Rarity15BuyPrice; item.accessory = true; item.Calamity().customRarity = CalamityRarity.Violet; } diff --git a/Items/Accessories/Wings/DiscordianWings.cs b/Items/Accessories/Wings/DiscordianWings.cs index 6bc9a7f7dd..cd414cbf12 100644 --- a/Items/Accessories/Wings/DiscordianWings.cs +++ b/Items/Accessories/Wings/DiscordianWings.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories.Wings { item.width = 22; item.height = 20; - item.value = Item.buyPrice(0, 39, 99, 99); + item.value = CalamityGlobalItem.Rarity8BuyPrice; item.rare = 8; item.accessory = true; } diff --git a/Items/Accessories/Wings/DrewsWings.cs b/Items/Accessories/Wings/DrewsWings.cs index a29e50298f..d5295a164b 100644 --- a/Items/Accessories/Wings/DrewsWings.cs +++ b/Items/Accessories/Wings/DrewsWings.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Accessories.Wings { item.width = 22; item.height = 20; - item.value = Item.buyPrice(1, 0, 0, 0); - item.Calamity().customRarity = CalamityRarity.DarkBlue; + item.value = CalamityGlobalItem.Rarity15BuyPrice; + item.Calamity().customRarity = CalamityRarity.Violet; item.accessory = true; } diff --git a/Items/Accessories/Wings/ElysianTracers.cs b/Items/Accessories/Wings/ElysianTracers.cs index db1c2f31b3..c3f71e9410 100644 --- a/Items/Accessories/Wings/ElysianTracers.cs +++ b/Items/Accessories/Wings/ElysianTracers.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Accessories.Wings { item.width = 36; item.height = 32; - item.value = Item.buyPrice(0, 90, 0, 0); + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.accessory = true; item.Calamity().customRarity = CalamityRarity.DarkBlue; } diff --git a/Items/Accessories/Wings/ElysianWings.cs b/Items/Accessories/Wings/ElysianWings.cs index 00fa3b003a..56799e89e8 100644 --- a/Items/Accessories/Wings/ElysianWings.cs +++ b/Items/Accessories/Wings/ElysianWings.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories.Wings { item.width = 36; item.height = 32; - item.value = Item.buyPrice(0, 45, 0, 0); + item.value = CalamityGlobalItem.Rarity12BuyPrice; item.rare = 10; item.Calamity().customRarity = CalamityRarity.Turquoise; item.accessory = true; diff --git a/Items/Accessories/Wings/HadarianWings.cs b/Items/Accessories/Wings/HadarianWings.cs index 45efc6b27f..74844d49be 100644 --- a/Items/Accessories/Wings/HadarianWings.cs +++ b/Items/Accessories/Wings/HadarianWings.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories.Wings { item.width = 24; item.height = 36; - item.value = Item.buyPrice(0, 39, 99, 99); + item.value = CalamityGlobalItem.Rarity9BuyPrice; item.rare = 9; item.accessory = true; } diff --git a/Items/Accessories/Wings/InfinityBoots.cs b/Items/Accessories/Wings/InfinityBoots.cs index dc035315e3..30e1beaae1 100644 --- a/Items/Accessories/Wings/InfinityBoots.cs +++ b/Items/Accessories/Wings/InfinityBoots.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Accessories.Wings { item.width = 36; item.height = 32; - item.value = Item.buyPrice(0, 60, 0, 0); + item.value = CalamityGlobalItem.Rarity12BuyPrice; item.accessory = true; item.Calamity().customRarity = CalamityRarity.Turquoise; } diff --git a/Items/Accessories/Wings/MOAB.cs b/Items/Accessories/Wings/MOAB.cs index 7bb6e3b45d..a66df6b8a8 100644 --- a/Items/Accessories/Wings/MOAB.cs +++ b/Items/Accessories/Wings/MOAB.cs @@ -26,8 +26,8 @@ namespace CalamityMod.Items.Accessories.Wings { item.width = 28; item.height = 32; - item.value = Item.buyPrice(0, 39, 99, 99); - item.rare = 8; + item.value = CalamityGlobalItem.Rarity6BuyPrice; + item.rare = 6; item.accessory = true; } @@ -41,46 +41,46 @@ namespace CalamityMod.Items.Accessories.Wings Main.PlaySound(SoundID.Item13, player.position); player.rocketDelay2 = 60; } - int num66 = 2; + int dustAmt = 2; if (player.controlUp) { - num66 = 4; + dustAmt = 4; } - for (int num67 = 0; num67 < num66; num67++) + for (int index = 0; index < dustAmt; index++) { - int type = 6; + int type = DustID.Fire; if (player.head == 41) { int arg_58FD_0 = player.body; } float scale = 1.75f; int alpha = 100; - float x = player.position.X + (float)(player.width / 2) + 16f; + float xStart = player.Center.X + 16f; if (player.direction > 0) { - x = player.position.X + (float)(player.width / 2) - 26f; + xStart = player.Center.X - 26f; } - float num68 = player.position.Y + (float)player.height - 18f; - if (num67 == 1 || num67 == 3) + float yStart = player.position.Y + (float)player.height - 18f; + if (index == 1 || index == 3) { - x = player.position.X + (float)(player.width / 2) + 8f; + xStart = player.Center.X + 8f; if (player.direction > 0) { - x = player.position.X + (float)(player.width / 2) - 20f; + xStart = player.Center.X - 20f; } - num68 += 6f; + yStart += 6f; } - if (num67 > 1) + if (index > 1) { - num68 += player.velocity.Y; + yStart += player.velocity.Y; } - int num69 = Dust.NewDust(new Vector2(x, num68), 8, 8, type, 0f, 0f, alpha, default, scale); + int num69 = Dust.NewDust(new Vector2(xStart, yStart), 8, 8, type, 0f, 0f, alpha, default, scale); Dust dust = Main.dust[num69]; dust.velocity.X *= 0.1f; dust.velocity.Y = Main.dust[num69].velocity.Y * 1f + 2f * player.gravDir - player.velocity.Y * 0.3f; dust.noGravity = true; dust.shader = GameShaders.Armor.GetSecondaryShader(player.cWings, player); - if (num66 == 4) + if (dustAmt == 4) { dust.velocity.Y += 6f; } diff --git a/Items/Accessories/Wings/SilvaWings.cs b/Items/Accessories/Wings/SilvaWings.cs index fb9e8dc5e0..380ab19352 100644 --- a/Items/Accessories/Wings/SilvaWings.cs +++ b/Items/Accessories/Wings/SilvaWings.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Accessories.Wings { item.width = 22; item.height = 20; - item.value = Item.buyPrice(0, 95, 0, 0); + item.value = CalamityGlobalItem.Rarity15BuyPrice; item.Calamity().postMoonLordRarity = 15; item.accessory = true; } diff --git a/Items/Accessories/Wings/SkylineWings.cs b/Items/Accessories/Wings/SkylineWings.cs index 9b51edfadc..facddd0bc4 100644 --- a/Items/Accessories/Wings/SkylineWings.cs +++ b/Items/Accessories/Wings/SkylineWings.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories.Wings { item.width = 22; item.height = 20; - item.value = Item.buyPrice(0, 9, 0, 0); + item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = 3; item.accessory = true; } diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index 615bf881f3..22d6fa0d82 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -29,9 +29,9 @@ namespace CalamityMod.Items.Accessories.Wings { item.width = 26; item.height = 26; - item.value = Item.buyPrice(0, 39, 99, 99); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.expert = true; - item.rare = 9; + item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/Wings/StarlightWings.cs b/Items/Accessories/Wings/StarlightWings.cs index bf3c1a8a7e..a38acf3375 100644 --- a/Items/Accessories/Wings/StarlightWings.cs +++ b/Items/Accessories/Wings/StarlightWings.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories.Wings { item.width = 22; item.height = 20; - item.value = Item.buyPrice(0, 39, 99, 99); + item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = 5; item.accessory = true; } diff --git a/Items/Accessories/Wings/TarragonWings.cs b/Items/Accessories/Wings/TarragonWings.cs index 004f4efcb6..6c1a04a708 100644 --- a/Items/Accessories/Wings/TarragonWings.cs +++ b/Items/Accessories/Wings/TarragonWings.cs @@ -28,21 +28,11 @@ namespace CalamityMod.Items.Accessories.Wings { item.width = 22; item.height = 20; - item.value = Item.buyPrice(0, 39, 99, 99); + item.value = CalamityGlobalItem.Rarity12BuyPrice; + item.Calamity().postMoonLordRarity = 12; item.accessory = true; } - public override void ModifyTooltips(List list) - { - foreach (TooltipLine line2 in list) - { - if (line2.mod == "Terraria" && line2.Name == "ItemName") - { - line2.overrideColor = new Color(0, 255, 200); - } - } - } - public override void UpdateAccessory(Player player, bool hideVisual) { if ((player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || diff --git a/Items/Accessories/Wings/XerocWings.cs b/Items/Accessories/Wings/XerocWings.cs index acc3672c70..8afbc8cd60 100644 --- a/Items/Accessories/Wings/XerocWings.cs +++ b/Items/Accessories/Wings/XerocWings.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories.Wings { item.width = 22; item.height = 20; - item.value = Item.buyPrice(0, 39, 99, 99); + item.value = CalamityGlobalItem.Rarity9BuyPrice; item.rare = 9; item.accessory = true; } diff --git a/Items/Accessories/YharimsGift.cs b/Items/Accessories/YharimsGift.cs index fabd3084d7..b832b69edf 100644 --- a/Items/Accessories/YharimsGift.cs +++ b/Items/Accessories/YharimsGift.cs @@ -23,10 +23,10 @@ namespace CalamityMod.Items.Accessories { item.width = 20; item.height = 22; - item.value = Item.buyPrice(1, 0, 0, 0); + item.value = CalamityGlobalItem.Rarity14BuyPrice; item.accessory = true; item.expert = true; - item.rare = 9; + item.rare = 10; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/YharimsInsignia.cs b/Items/Accessories/YharimsInsignia.cs index 4965203c9f..ad5fdfa204 100644 --- a/Items/Accessories/YharimsInsignia.cs +++ b/Items/Accessories/YharimsInsignia.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Accessories { item.width = 22; item.height = 38; - item.value = Item.buyPrice(0, 30, 0, 0); + item.value = CalamityGlobalItem.Rarity12BuyPrice; item.accessory = true; item.Calamity().customRarity = CalamityRarity.Turquoise; } diff --git a/Items/Armor/FathomSwarmerBoots.cs b/Items/Armor/FathomSwarmerBoots.cs index 9fd55c2784..778d2237aa 100644 --- a/Items/Armor/FathomSwarmerBoots.cs +++ b/Items/Armor/FathomSwarmerBoots.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Fathom Swarmer Greaves"); - Tooltip.SetDefault("7% increased minion damage\n" + + Tooltip.SetDefault("4% increased minion damage\n" + "Grants the ability to swim\n" + "Speed greatly increased while submerged in liquid"); } @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.minionDamage += 0.07f; + player.minionDamage += 0.04f; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { player.moveSpeed += 0.5f; diff --git a/Items/Armor/FathomSwarmerBreastplate.cs b/Items/Armor/FathomSwarmerBreastplate.cs index c40488a041..7543f0d3e1 100644 --- a/Items/Armor/FathomSwarmerBreastplate.cs +++ b/Items/Armor/FathomSwarmerBreastplate.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Fathom Swarmer Breastplate"); - Tooltip.SetDefault("12% increased damage reduction and minion damage\n" + - "+1 max minion\n" + + Tooltip.SetDefault("12% increased damage reduction\n" + + "6% increased minion damage and +1 max minion\n" + "Boosted defense and regen increased while submerged in liquid\n" + "Reduces defense loss within the Abyss"); } @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.minionDamage += 0.12f; + player.minionDamage += 0.06f; player.endurance += 0.12f; player.maxMinions++; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) diff --git a/Items/Armor/FathomSwarmerVisage.cs b/Items/Armor/FathomSwarmerVisage.cs index 4c32ddabd7..252bd66efa 100644 --- a/Items/Armor/FathomSwarmerVisage.cs +++ b/Items/Armor/FathomSwarmerVisage.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Fathom Swarmer Visage"); - Tooltip.SetDefault("10% increased minion damage\n" + + Tooltip.SetDefault("5% increased minion damage\n" + "Provides breathing and light underwater"); } @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Armor modPlayer.fathomSwarmer = true; player.spikedBoots = 2; player.maxMinions++; - player.minionDamage += 0.1f; + player.minionDamage += 0.05f; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { player.minionDamage += 0.3f; diff --git a/Items/Armor/PlaguebringerPistons.cs b/Items/Armor/PlaguebringerPistons.cs index 6cb56583b8..45241d0e3b 100644 --- a/Items/Armor/PlaguebringerPistons.cs +++ b/Items/Armor/PlaguebringerPistons.cs @@ -32,32 +32,7 @@ namespace CalamityMod.Items.Armor { player.minionDamage += 0.13f; player.moveSpeed += 0.15f; - - //Spawn bees while sprinting or dashing - counter++; - if (counter % 12 == 0) - { - if ((Math.Abs(player.velocity.X) >= 5 || Math.Abs(player.velocity.Y) >= 5) && player.whoAmI == Main.myPlayer) - { - int beeCount = 1; - if (Main.rand.NextBool(3)) - ++beeCount; - if (Main.rand.NextBool(3)) - ++beeCount; - if (player.strongBees && Main.rand.NextBool(3)) - ++beeCount; - int damage = 30; - damage = (int)(damage * player.MinionDamage()); - for (int index = 0; index < beeCount; ++index) - { - int bee = Projectile.NewProjectile(player.Center.X, player.Center.Y, Main.rand.NextFloat(-35f, 35f) * 0.02f, Main.rand.NextFloat(-35f, 35f) * 0.02f, (Main.rand.NextBool(4) ? ModContent.ProjectileType() : player.beeType()), damage, player.beeKB(0f), player.whoAmI, 0f, 0f); - Main.projectile[bee].Calamity().forceMinion = true; - Main.projectile[bee].usesLocalNPCImmunity = true; - Main.projectile[bee].localNPCHitCooldown = 10; - Main.projectile[bee].penetrate = 2; - } - } - } + player.Calamity().plaguebringerPistons = true; //Flower Boots code if (player.whoAmI == Main.myPlayer && player.velocity.Y == 0f && player.grappling[0] == -1) diff --git a/Items/Armor/PrismaticHelmet.cs b/Items/Armor/PrismaticHelmet.cs index cad0474c9b..1d37f3b3a7 100644 --- a/Items/Armor/PrismaticHelmet.cs +++ b/Items/Armor/PrismaticHelmet.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Armor DisplayName.SetDefault("Prismatic Helmet"); Tooltip.SetDefault("8% increased magic damage and 12% increased magic crit\n" + "20% decreased non-magic damage\n" + - "Enemies with less than 500 health deal no damage\n" + + "Enemies with less than 500 max health deal no contact damage\n" + "This does not occur while a boss is alive"); } diff --git a/Items/Armor/StatigelArmor.cs b/Items/Armor/StatigelArmor.cs index 8e5cd4fac1..86fe23c7e0 100644 --- a/Items/Armor/StatigelArmor.cs +++ b/Items/Armor/StatigelArmor.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -36,7 +37,7 @@ namespace CalamityMod.Items.Armor ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 8); recipe.AddIngredient(ItemID.HellstoneBar, 13); - recipe.AddTile(TileID.Anvils); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Armor/StatigelCap.cs b/Items/Armor/StatigelCap.cs index d7f0aa1201..c6fd840397 100644 --- a/Items/Armor/StatigelCap.cs +++ b/Items/Armor/StatigelCap.cs @@ -1,5 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -54,7 +55,7 @@ namespace CalamityMod.Items.Armor ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ItemID.HellstoneBar, 9); - recipe.AddTile(TileID.Anvils); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Armor/StatigelGreaves.cs b/Items/Armor/StatigelGreaves.cs index 4391101bd5..5c579abd68 100644 --- a/Items/Armor/StatigelGreaves.cs +++ b/Items/Armor/StatigelGreaves.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Armor ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddIngredient(ItemID.HellstoneBar, 11); - recipe.AddTile(TileID.Anvils); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Armor/StatigelHeadgear.cs b/Items/Armor/StatigelHeadgear.cs index 02c79d77f4..cb81719099 100644 --- a/Items/Armor/StatigelHeadgear.cs +++ b/Items/Armor/StatigelHeadgear.cs @@ -1,5 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -52,7 +53,7 @@ namespace CalamityMod.Items.Armor ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ItemID.HellstoneBar, 9); - recipe.AddTile(TileID.Anvils); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Armor/StatigelHelm.cs b/Items/Armor/StatigelHelm.cs index 923b2340a0..3eb6b9d3f6 100644 --- a/Items/Armor/StatigelHelm.cs +++ b/Items/Armor/StatigelHelm.cs @@ -1,5 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -53,7 +54,7 @@ namespace CalamityMod.Items.Armor ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ItemID.HellstoneBar, 9); - recipe.AddTile(TileID.Anvils); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Armor/StatigelHood.cs b/Items/Armor/StatigelHood.cs index 7fc6b4d38b..f46db6e48c 100644 --- a/Items/Armor/StatigelHood.cs +++ b/Items/Armor/StatigelHood.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -72,7 +73,7 @@ namespace CalamityMod.Items.Armor ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ItemID.HellstoneBar, 9); - recipe.AddTile(TileID.Anvils); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Armor/StatigelMask.cs b/Items/Armor/StatigelMask.cs index fa6aa180ce..215328946b 100644 --- a/Items/Armor/StatigelMask.cs +++ b/Items/Armor/StatigelMask.cs @@ -1,5 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -60,7 +61,7 @@ namespace CalamityMod.Items.Armor ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ItemID.HellstoneBar, 9); - recipe.AddTile(TileID.Anvils); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index f9f9e257c4..50ee39b2e5 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -232,7 +232,7 @@ namespace CalamityMod.Items if (item.useTime < 10) damageMult -= (double)(10 - item.useTime) / 10.0; - double newDamage = (double)damage * damageMult; + double newDamage = damage * damageMult; if (player.whoAmI == Main.myPlayer) { @@ -240,16 +240,16 @@ namespace CalamityMod.Items Projectile.NewProjectile(position.X, position.Y, speedX * 0.5f, speedY * 0.5f, ModContent.ProjectileType(), (int)(newDamage * 0.6), 0f, player.whoAmI, 0f, 0f); else if (rogue) - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)(newDamage * 0.5), 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(newDamage * 0.5), 0f, player.whoAmI, 0f, 0f); else if (item.ranged) Projectile.NewProjectile(position.X, position.Y, speedX * 1.5f, speedY * 1.5f, ModContent.ProjectileType(), (int)(newDamage * 0.4), 0f, player.whoAmI, 0f, 0f); else if (item.magic) - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)(newDamage * 0.8), 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(newDamage * 0.8), 0f, player.whoAmI, 0f, 0f); else if (item.summon && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - Projectile.NewProjectile(position.X, position.Y, 0f, 0f, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 0f, 0f); } } if (modPlayer.eArtifact && item.ranged && !rogue) @@ -263,7 +263,7 @@ namespace CalamityMod.Items { if (player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)(damage * (modPlayer.auricSet ? 4.2 : 2.6)), 1f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * (modPlayer.auricSet ? 4.2 : 2.6)), 1f, player.whoAmI, 0f, 0f); } } } @@ -273,7 +273,7 @@ namespace CalamityMod.Items { if (player.whoAmI == Main.myPlayer) { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), (int)(damage * (modPlayer.auricSet ? 2.2 : 1.6)), 2f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), (int)(damage * (modPlayer.auricSet ? 2.2 : 1.6)), 2f, player.whoAmI, 0f, 0f); } } } @@ -387,7 +387,8 @@ namespace CalamityMod.Items if (i != 0) { Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i)); - Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType(), (int)(damage * 1.3), 2f, player.whoAmI, 0f, 0f); + int rocket = Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType(), (int)(damage * 1.3), 2f, player.whoAmI, 0f, 0f); + Main.projectile[rocket].Calamity().forceTypeless = true; } } } @@ -431,7 +432,7 @@ namespace CalamityMod.Items for (int i = -8; i <= 8; i += 8) { Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i)); - Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 0f, 0f); } } return true; @@ -2081,8 +2082,8 @@ Provides heat and cold protection in Death Mode"; "Acceleration multiplier: 1\n" + "Average vertical speed\n" + "Flight time: 180\n" + - "+10 defense, 10% increased movement speed,\n" + - "and 5% increased damage and critical strike chance"; + "+8 defense, 10% increased movement speed,\n" + + "4% increased damage, and 2% increased critical strike chance"; } } } @@ -2162,7 +2163,7 @@ Provides heat and cold protection in Death Mode"; "Acceleration multiplier: 1\n" + "Average vertical speed\n" + "Flight time: 180\n" + - "+1 max minion and 5% increased minion damage while wearing the Spooky Armor"; + "Increased minion knockback and 5% increased minion damage while wearing the Spooky Armor"; } } } @@ -2209,8 +2210,7 @@ Provides heat and cold protection in Death Mode"; "Acceleration multiplier: 0\n" + "Average vertical speed\n" + "Flight time: 160\n" + - "+10 defense, 10% increased damage, " + - "5% increased critical strike chance, " + + "+5 defense, 5% increased damage, " + "10% increased movement speed and 120% increased jump speed"; } } @@ -3104,9 +3104,8 @@ Provides heat and cold protection in Death Mode"; } else if (item.type == ItemID.MothronWings) // Spawn baby mothrons over time to attack enemies, max of 3 { - player.statDefense += 10; - player.allDamage += 0.1f; - modPlayer.AllCritBoost(5); + player.statDefense += 5; + player.allDamage += 0.05f; player.moveSpeed += 0.1f; player.jumpSpeedBoost += 1.2f; player.noFallDmg = true; @@ -3217,7 +3216,7 @@ Provides heat and cold protection in Death Mode"; player.noFallDmg = true; if (player.head == ArmorIDs.Head.SpookyHelmet && player.body == ArmorIDs.Body.SpookyBreastplate && player.legs == ArmorIDs.Legs.SpookyLeggings) { - player.maxMinions++; + player.minionKB += 2f; player.minionDamage += 0.05f; } } @@ -3229,9 +3228,9 @@ Provides heat and cold protection in Death Mode"; } else if (item.type == ItemID.SteampunkWings) { - player.statDefense += 10; - player.allDamage += 0.05f; - modPlayer.AllCritBoost(5); + player.statDefense += 8; + player.allDamage += 0.04f; + modPlayer.AllCritBoost(2); player.moveSpeed += 0.1f; player.noFallDmg = true; } diff --git a/Items/Dyes/AstralSwirlDye.cs b/Items/Dyes/AstralSwirlDye.cs index 33ff3d0f06..d82a951e4d 100644 --- a/Items/Dyes/AstralSwirlDye.cs +++ b/Items/Dyes/AstralSwirlDye.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Dyes recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddTile(TileID.DyeVat); - recipe.SetResult(this); + recipe.SetResult(this, 2); recipe.AddRecipe(); } } diff --git a/Items/Dyes/CeaselessDye.cs b/Items/Dyes/CeaselessDye.cs index c865caa946..74ec09aeda 100644 --- a/Items/Dyes/CeaselessDye.cs +++ b/Items/Dyes/CeaselessDye.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Dyes recipe.AddIngredient(ItemID.ShadowDye); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.DyeVat); - recipe.SetResult(this); + recipe.SetResult(this, 2); recipe.AddRecipe(); } } diff --git a/Items/Dyes/DragonSoulDye.cs b/Items/Dyes/DragonSoulDye.cs index 7e6f265b0c..93a6009f42 100644 --- a/Items/Dyes/DragonSoulDye.cs +++ b/Items/Dyes/DragonSoulDye.cs @@ -25,10 +25,10 @@ namespace CalamityMod.Items.Dyes public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater); + recipe.AddIngredient(ItemID.BottledWater, 2); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.DyeVat); - recipe.SetResult(this); + recipe.SetResult(this, 2); recipe.AddRecipe(); } } diff --git a/Items/Dyes/ElementalDye.cs b/Items/Dyes/ElementalDye.cs index a53145c467..b9ffc2506e 100644 --- a/Items/Dyes/ElementalDye.cs +++ b/Items/Dyes/ElementalDye.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Dyes recipe.AddIngredient(ItemID.NebulaDye); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.DyeVat); - recipe.SetResult(this); + recipe.SetResult(this, 5); recipe.AddRecipe(); } } diff --git a/Items/Dyes/EndothermicDye.cs b/Items/Dyes/EndothermicDye.cs index 6630a5ac20..5812406c34 100644 --- a/Items/Dyes/EndothermicDye.cs +++ b/Items/Dyes/EndothermicDye.cs @@ -27,10 +27,10 @@ namespace CalamityMod.Items.Dyes public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater); + recipe.AddIngredient(ItemID.BottledWater, 2); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddTile(TileID.DyeVat); - recipe.SetResult(this); + recipe.SetResult(this, 2); recipe.AddRecipe(); } } diff --git a/Items/Dyes/NightmareDye.cs b/Items/Dyes/NightmareDye.cs index 9807c284bb..3f5b89ac10 100644 --- a/Items/Dyes/NightmareDye.cs +++ b/Items/Dyes/NightmareDye.cs @@ -27,10 +27,10 @@ namespace CalamityMod.Items.Dyes public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater); + recipe.AddIngredient(ItemID.BottledWater, 2); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddTile(TileID.DyeVat); - recipe.SetResult(this); + recipe.SetResult(this, 2); recipe.AddRecipe(); } } diff --git a/Items/Dyes/ReaverDye.cs b/Items/Dyes/ReaverDye.cs index 6c297af31c..3a01787ddc 100644 --- a/Items/Dyes/ReaverDye.cs +++ b/Items/Dyes/ReaverDye.cs @@ -26,10 +26,10 @@ namespace CalamityMod.Items.Dyes public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater); + recipe.AddIngredient(ItemID.BottledWater, 2); recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddTile(TileID.DyeVat); - recipe.SetResult(this); + recipe.SetResult(this, 2); recipe.AddRecipe(); } } diff --git a/Items/Dyes/ShadowspecDye.cs b/Items/Dyes/ShadowspecDye.cs index 03e6b1997f..9b6c88844c 100644 --- a/Items/Dyes/ShadowspecDye.cs +++ b/Items/Dyes/ShadowspecDye.cs @@ -27,10 +27,10 @@ namespace CalamityMod.Items.Dyes public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater); + recipe.AddIngredient(ItemID.BottledWater, 2); recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.DyeVat); - recipe.SetResult(this); + recipe.SetResult(this, 2); recipe.AddRecipe(); } } diff --git a/Items/Dyes/StratusDye.cs b/Items/Dyes/StratusDye.cs index f7e57b0be3..47f384cfa5 100644 --- a/Items/Dyes/StratusDye.cs +++ b/Items/Dyes/StratusDye.cs @@ -28,11 +28,12 @@ namespace CalamityMod.Items.Dyes public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater); + recipe.AddIngredient(ItemID.BottledWater, 2); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddTile(TileID.DyeVat); - recipe.SetResult(this); + recipe.SetResult(this, 2); recipe.AddRecipe(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/StaticRefiner.cs b/Items/Placeables/Furniture/CraftingStations/StaticRefiner.cs index f955dca894..a3ff7895a2 100644 --- a/Items/Placeables/Furniture/CraftingStations/StaticRefiner.cs +++ b/Items/Placeables/Furniture/CraftingStations/StaticRefiner.cs @@ -1,3 +1,5 @@ +using CalamityMod.Items.Materials; +using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.CraftingStations @@ -22,5 +24,15 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations item.consumable = true; item.createTile = ModContent.TileType(); } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ItemID.Solidifier); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } } } diff --git a/Items/Potions/TeslaPotion.cs b/Items/Potions/TeslaPotion.cs index db39cb952d..d920ef0e38 100644 --- a/Items/Potions/TeslaPotion.cs +++ b/Items/Potions/TeslaPotion.cs @@ -7,47 +7,48 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Potions { - public class TeslaPotion : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tesla Potion"); - Tooltip.SetDefault("Summons an aura of electricity that electrifies and slows enemies\n" + - "Slowdown does not work on bosses"); - } + public class TeslaPotion : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tesla Potion"); + Tooltip.SetDefault("Summons an aura of electricity that electrifies and slows enemies\n" + + "Slowdown does not work on bosses\n" + + "Reduces the duration of the Electrified debuff"); + } - public override void SetDefaults() - { - item.width = 24; - item.height = 26; - item.useTurn = true; - item.maxStack = 999; - item.rare = 3; - item.useAnimation = 17; - item.useTime = 17; - item.useStyle = ItemUseStyleID.EatingUsing; - item.UseSound = SoundID.Item3; - item.consumable = true; - item.buffType = ModContent.BuffType(); - item.buffTime = 18000; - item.value = Item.buyPrice(0, 2, 0, 0); - } + public override void SetDefaults() + { + item.width = 24; + item.height = 26; + item.useTurn = true; + item.maxStack = 999; + item.rare = 3; + item.useAnimation = 17; + item.useTime = 17; + item.useStyle = ItemUseStyleID.EatingUsing; + item.UseSound = SoundID.Item3; + item.consumable = true; + item.buffType = ModContent.BuffType(); + item.buffTime = 18000; + item.value = Item.buyPrice(0, 2, 0, 0); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddRecipeGroup("AnyGoldOre", 2); - recipe.AddTile(TileID.Bottles); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddTile(TileID.AlchemyTable); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddRecipeGroup("AnyGoldOre", 2); + recipe.AddTile(TileID.Bottles); + recipe.SetResult(this); + recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddTile(TileID.AlchemyTable); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/SummonItems/AncientMedallion.cs b/Items/SummonItems/AncientMedallion.cs index fc205997b2..b92a0af850 100644 --- a/Items/SummonItems/AncientMedallion.cs +++ b/Items/SummonItems/AncientMedallion.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Items.SummonItems public override bool UseItem(Player player) { + Main.PlaySound(SoundID.Roar, player.position, 2); if (Main.netMode != NetmodeID.MultiplayerClient) { int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-100, 101)), (int)(player.position.Y - 250f), ModContent.NPCType(), 1); diff --git a/Items/Tools/Gelpick.cs b/Items/Tools/Gelpick.cs index c5770c628a..84dfda6bfa 100644 --- a/Items/Tools/Gelpick.cs +++ b/Items/Tools/Gelpick.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -37,7 +38,7 @@ namespace CalamityMod.Items.Tools recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ItemID.Gel, 30); recipe.AddIngredient(ItemID.HellstoneBar, 5); - recipe.AddTile(TileID.Anvils); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/TreasureBags/SlimeGodBag.cs b/Items/TreasureBags/SlimeGodBag.cs index 267bdfc8e2..e467516e1c 100644 --- a/Items/TreasureBags/SlimeGodBag.cs +++ b/Items/TreasureBags/SlimeGodBag.cs @@ -2,7 +2,6 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.Materials; using CalamityMod.Items.PermanentBoosters; -using CalamityMod.Items.Placeables.Furniture.CraftingStations; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; @@ -43,7 +42,7 @@ namespace CalamityMod.Items.TreasureBags { // Materials DropHelper.DropItem(player, ItemID.Gel, 30, 60); - DropHelper.DropItem(player, ModContent.ItemType(), 30, 50); + DropHelper.DropItem(player, ModContent.ItemType(), 35, 55); // Weapons DropHelper.DropItemChance(player, ModContent.ItemType(), 3); @@ -57,10 +56,9 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge && !player.Calamity().adrenalineBoostOne); // Vanity - DropHelper.DropItemFromSetChance(player, 7, ModContent.ItemType(), ModContent.ItemType()); + DropHelper.DropItemFromSetChance(player, 0.142857f, ModContent.ItemType(), ModContent.ItemType()); // Other - DropHelper.DropItem(player, ModContent.ItemType()); } } } diff --git a/Items/Weapons/Magic/BelchingSaxophone.cs b/Items/Weapons/Magic/BelchingSaxophone.cs index 3477ef02db..8fc26474c8 100644 --- a/Items/Weapons/Magic/BelchingSaxophone.cs +++ b/Items/Weapons/Magic/BelchingSaxophone.cs @@ -42,8 +42,6 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { counter++; - if (counter > 1) - counter = 0; if (Main.rand.NextBool(2)) { @@ -56,22 +54,16 @@ namespace CalamityMod.Items.Weapons.Magic speedX += Main.rand.Next(-40, 41) * 0.05f; speedY += Main.rand.Next(-40, 41) * 0.05f; - Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, counter == 1 ? 1f : 0f); + Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, counter % 2 == 0 ? 1f : 0f); if (Main.rand.NextBool(2)) { - int noteProj = ProjectileID.QuarterNote; - switch (Main.rand.Next(3)) + int noteProj = Utils.SelectRandom(Main.rand, new int[] { - case 0: - noteProj = ProjectileID.EighthNote; - break; - case 1: - noteProj = ProjectileID.TiedEighthNote; - break; - default: - break; - } + ProjectileID.QuarterNote, + ProjectileID.EighthNote, + ProjectileID.TiedEighthNote + }); int note = Projectile.NewProjectile(position.X, position.Y, speedX * 0.75f, speedY * 0.75f, noteProj, (int)(damage * 0.75), knockBack, player.whoAmI); Main.projectile[note].Calamity().forceMagic = true; //why are these notes also internally ranged Main.projectile[note].usesLocalNPCImmunity = true; @@ -80,9 +72,6 @@ namespace CalamityMod.Items.Weapons.Magic return false; } - public override Vector2? HoldoutOffset() - { - return new Vector2(0, 18); - } + public override Vector2? HoldoutOffset() => new Vector2(0, 18); } } diff --git a/Items/Weapons/Magic/Climax.cs b/Items/Weapons/Magic/Climax.cs index 50b9d297db..b4be338026 100644 --- a/Items/Weapons/Magic/Climax.cs +++ b/Items/Weapons/Magic/Climax.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 80; + item.damage = 75; item.magic = true; item.mana = 30; item.width = 78; diff --git a/Items/Weapons/Magic/Eternity.cs b/Items/Weapons/Magic/Eternity.cs index 7f47f1ba3e..5c34bfbbd5 100644 --- a/Items/Weapons/Magic/Eternity.cs +++ b/Items/Weapons/Magic/Eternity.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Magic { public class Eternity : ModItem { - public const int BaseDamage = 6969; + public const int BaseDamage = 4200; public const int ExplosionDamage = 42000; public const int MaxHomers = 40; public const int dustID = 16; diff --git a/Items/Weapons/Magic/HellwingStaff.cs b/Items/Weapons/Magic/HellwingStaff.cs index c114202dfb..630737529a 100644 --- a/Items/Weapons/Magic/HellwingStaff.cs +++ b/Items/Weapons/Magic/HellwingStaff.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { DisplayName.SetDefault("Hellwing Staff"); - Tooltip.SetDefault("Casts pillars of flame"); + Tooltip.SetDefault("Casts flaming bats"); Item.staff[item.type] = true; } diff --git a/Items/Weapons/Melee/GeliticBlade.cs b/Items/Weapons/Melee/GeliticBlade.cs index 0e6388920d..e6d3c7b60b 100644 --- a/Items/Weapons/Melee/GeliticBlade.cs +++ b/Items/Weapons/Melee/GeliticBlade.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 62; - item.damage = 33; + item.damage = 38; item.melee = true; item.useAnimation = 30; item.useTime = 30; @@ -40,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Melee recipe.AddIngredient(ModContent.ItemType(), 30); recipe.AddIngredient(ItemID.Gel, 35); recipe.AddIngredient(ItemID.HellstoneBar, 10); - recipe.AddTile(TileID.Anvils); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/Melee/TheGodsGambit.cs b/Items/Weapons/Melee/TheGodsGambit.cs index 2719abf18d..f997cf0ed5 100644 --- a/Items/Weapons/Melee/TheGodsGambit.cs +++ b/Items/Weapons/Melee/TheGodsGambit.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Projectiles.Melee.Yoyos; using Terraria; using Terraria.ID; @@ -22,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.width = 40; item.height = 26; item.melee = true; - item.damage = 28; + item.damage = 33; item.knockBack = 3.5f; item.useTime = 21; item.useAnimation = 21; @@ -45,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Melee { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 30); - recipe.AddTile(TileID.Anvils); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/Melee/VirulentKatana.cs b/Items/Weapons/Melee/VirulentKatana.cs index c1244aaa8b..4e7379b522 100644 --- a/Items/Weapons/Melee/VirulentKatana.cs +++ b/Items/Weapons/Melee/VirulentKatana.cs @@ -7,47 +7,47 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class VirulentKatana : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Virulence"); - Tooltip.SetDefault("Fires a plague cloud"); - } + public class VirulentKatana : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Virulence"); + Tooltip.SetDefault("Fires a plague cloud"); + } - public override void SetDefaults() - { - item.width = 48; - item.damage = 96; - item.melee = true; - item.useAnimation = 15; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 15; - item.useTurn = true; - item.knockBack = 5.5f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 62; - item.value = Item.buyPrice(0, 80, 0, 0); - item.rare = 8; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 9f; - } + public override void SetDefaults() + { + item.damage = 96; + item.knockBack = 5.5f; + item.useAnimation = item.useTime = 15; + item.melee = true; + item.useTurn = true; + item.autoReuse = true; + item.shootSpeed = 9f; + item.shoot = ModContent.ProjectileType(); - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * 0.85), knockBack, player.whoAmI, 0f, 0f); - return false; - } + item.width = 48; + item.height = 62; + item.useStyle = ItemUseStyleID.SwingThrow; + item.UseSound = SoundID.Item1; + item.value = Item.buyPrice(0, 80, 0, 0); + item.rare = 8; + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 240); - } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 0.85), knockBack, player.whoAmI, 0f, 0f); + return false; + } - public override void OnHitPvp(Player player, Player target, int damage, bool crit) - { - target.AddBuff(ModContent.BuffType(), 240); - } - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 240); + } + + public override void OnHitPvp(Player player, Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 240); + } + } } diff --git a/Items/Weapons/Ranged/ClamorRifle.cs b/Items/Weapons/Ranged/ClamorRifle.cs index 5dd52eabfe..bc793a6355 100644 --- a/Items/Weapons/Ranged/ClamorRifle.cs +++ b/Items/Weapons/Ranged/ClamorRifle.cs @@ -3,7 +3,6 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.ID; namespace CalamityMod.Items.Weapons.Ranged { diff --git a/Items/Weapons/Ranged/Goobow.cs b/Items/Weapons/Ranged/Goobow.cs index c3d63b9085..171cd7082e 100644 --- a/Items/Weapons/Ranged/Goobow.cs +++ b/Items/Weapons/Ranged/Goobow.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -63,7 +64,7 @@ namespace CalamityMod.Items.Weapons.Ranged recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddIngredient(ItemID.Gel, 30); recipe.AddIngredient(ItemID.HellstoneBar, 5); - recipe.AddTile(TileID.Anvils); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/Ranged/GunkShot.cs b/Items/Weapons/Ranged/GunkShot.cs index f4f5f43a13..0f89a88cb3 100644 --- a/Items/Weapons/Ranged/GunkShot.cs +++ b/Items/Weapons/Ranged/GunkShot.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -57,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Ranged recipe.AddIngredient(ModContent.ItemType(), 18); recipe.AddIngredient(ItemID.Gel, 15); recipe.AddIngredient(ItemID.HellstoneBar, 5); - recipe.AddTile(TileID.Anvils); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/Rogue/HardenedHoneycomb.cs b/Items/Weapons/Rogue/HardenedHoneycomb.cs index 33c9bf8f2e..1838cbd016 100644 --- a/Items/Weapons/Rogue/HardenedHoneycomb.cs +++ b/Items/Weapons/Rogue/HardenedHoneycomb.cs @@ -57,7 +57,7 @@ Stealth strikes can bounce off walls and enemies"); recipe.AddIngredient(ItemID.CrispyHoneyBlock); recipe.AddIngredient(ItemID.BeeWax); recipe.AddTile(TileID.Anvils); - recipe.SetResult(this, 5); + recipe.SetResult(this, 10); recipe.AddRecipe(); } } diff --git a/Items/Weapons/Summon/AngryChickenStaff.cs b/Items/Weapons/Summon/AngryChickenStaff.cs index e54a19ad9f..5c6794a6f0 100644 --- a/Items/Weapons/Summon/AngryChickenStaff.cs +++ b/Items/Weapons/Summon/AngryChickenStaff.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { item.mana = 50; - item.damage = 160; + item.damage = 130; item.useStyle = ItemUseStyleID.SwingThrow; item.width = 32; item.height = 32; diff --git a/Items/Weapons/Summon/CorvidHarbringerStaff.cs b/Items/Weapons/Summon/CorvidHarbringerStaff.cs index 9087783edd..90c65ff242 100644 --- a/Items/Weapons/Summon/CorvidHarbringerStaff.cs +++ b/Items/Weapons/Summon/CorvidHarbringerStaff.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon item.UseSound = SoundID.DD2_BetsyFlyingCircleAttack; item.summon = true; item.mana = 11; - item.damage = 275; + item.damage = 250; item.knockBack = 2f; item.autoReuse = true; item.useTime = item.useAnimation = 10; diff --git a/Items/Weapons/Summon/MidnightSunBeacon.cs b/Items/Weapons/Summon/MidnightSunBeacon.cs index 19eeb8272e..c917b687e9 100644 --- a/Items/Weapons/Summon/MidnightSunBeacon.cs +++ b/Items/Weapons/Summon/MidnightSunBeacon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 260; + item.damage = 230; item.mana = 12; item.width = item.height = 32; item.useTime = item.useAnimation = 10; diff --git a/Items/Weapons/Summon/StaffoftheMechworm.cs b/Items/Weapons/Summon/StaffoftheMechworm.cs index 36eaeb83f8..3a343e2281 100644 --- a/Items/Weapons/Summon/StaffoftheMechworm.cs +++ b/Items/Weapons/Summon/StaffoftheMechworm.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Weapons.Summon { maxMinionScale = 10; } - damage = (int)(damage * ((player.minionDamage * 5 / 3) + (player.minionDamage * 0.46f * (maxMinionScale - 1)))); + damage = (int)(damage * ((player.MinionDamage() * 5 / 3) + (player.MinionDamage() * 0.46f * (maxMinionScale - 1)))); int head = -1; int tail = -1; for (int num187 = 0; num187 < Main.projectile.Length; num187++) diff --git a/NPCs/Abyss/BobbitWormHead.cs b/NPCs/Abyss/BobbitWormHead.cs index 9d64cbbeaf..54712c0335 100644 --- a/NPCs/Abyss/BobbitWormHead.cs +++ b/NPCs/Abyss/BobbitWormHead.cs @@ -253,13 +253,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BobbitWorm"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BobbitWorm2"), 1f); diff --git a/NPCs/Abyss/BoxJellyfish.cs b/NPCs/Abyss/BoxJellyfish.cs index 9c1509965a..590f58e3c0 100644 --- a/NPCs/Abyss/BoxJellyfish.cs +++ b/NPCs/Abyss/BoxJellyfish.cs @@ -200,13 +200,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index 56d54b9e29..3b89f4d891 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -240,7 +240,7 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -248,7 +248,7 @@ namespace CalamityMod.NPCs.Abyss for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index 09ff55a9bb..248cd84d61 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Enemy; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -395,7 +396,7 @@ namespace CalamityMod.NPCs.Abyss damage = 55; } Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 111); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y + 60, 0f, 2f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y + 60, 0f, 2f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } npc.rotation = npc.velocity.X * 0.05f; npc.velocity *= 0.975f; @@ -570,13 +571,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 30; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossalSquid"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossalSquid2"), 1f); diff --git a/NPCs/Abyss/Cuttlefish.cs b/NPCs/Abyss/Cuttlefish.cs index 10a59dfb8d..1342017c68 100644 --- a/NPCs/Abyss/Cuttlefish.cs +++ b/NPCs/Abyss/Cuttlefish.cs @@ -402,13 +402,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index ce796bb938..e078b35521 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -317,13 +317,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } diff --git a/NPCs/Abyss/DevilFishAlt.cs b/NPCs/Abyss/DevilFishAlt.cs index d0bce64a95..93915248ee 100644 --- a/NPCs/Abyss/DevilFishAlt.cs +++ b/NPCs/Abyss/DevilFishAlt.cs @@ -317,13 +317,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index b87541b206..86679092d5 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -277,13 +277,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 30; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GiantSquid"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GiantSquid2"), 1f); diff --git a/NPCs/Abyss/GulperEelBody.cs b/NPCs/Abyss/GulperEelBody.cs index 453fc7e2be..40c43a7968 100644 --- a/NPCs/Abyss/GulperEelBody.cs +++ b/NPCs/Abyss/GulperEelBody.cs @@ -151,13 +151,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/GulperEel2"), 1f); Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/GulperEel3"), 1f); diff --git a/NPCs/Abyss/GulperEelBodyAlt.cs b/NPCs/Abyss/GulperEelBodyAlt.cs index 4bfc45465d..d9e0a41b8e 100644 --- a/NPCs/Abyss/GulperEelBodyAlt.cs +++ b/NPCs/Abyss/GulperEelBodyAlt.cs @@ -151,13 +151,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/GulperEel2"), 1f); Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/GulperEel3"), 1f); diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index 46476534f3..82157438b9 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -367,13 +367,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GulperEel"), 1f); } diff --git a/NPCs/Abyss/GulperEelTail.cs b/NPCs/Abyss/GulperEelTail.cs index ffa21aeb66..668c670a5a 100644 --- a/NPCs/Abyss/GulperEelTail.cs +++ b/NPCs/Abyss/GulperEelTail.cs @@ -151,13 +151,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/GulperEel4"), 1f); } diff --git a/NPCs/Abyss/Laserfish.cs b/NPCs/Abyss/Laserfish.cs index 83f47b4147..4092beb2b9 100644 --- a/NPCs/Abyss/Laserfish.cs +++ b/NPCs/Abyss/Laserfish.cs @@ -126,13 +126,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Laserfish"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Laserfish2"), 1f); diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index 75c98426ea..7e7c93dab3 100644 --- a/NPCs/Abyss/MirageJelly.cs +++ b/NPCs/Abyss/MirageJelly.cs @@ -228,13 +228,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Abyss/MorayEel.cs b/NPCs/Abyss/MorayEel.cs index 2c184eece3..97d594c28d 100644 --- a/NPCs/Abyss/MorayEel.cs +++ b/NPCs/Abyss/MorayEel.cs @@ -97,13 +97,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Abyss/OarfishBody.cs b/NPCs/Abyss/OarfishBody.cs index 23560416c7..5daa4643a8 100644 --- a/NPCs/Abyss/OarfishBody.cs +++ b/NPCs/Abyss/OarfishBody.cs @@ -132,13 +132,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index 1da2c493c9..975bd8a055 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -331,13 +331,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Abyss/OarfishTail.cs b/NPCs/Abyss/OarfishTail.cs index 69628365d8..89a90fa4f0 100644 --- a/NPCs/Abyss/OarfishTail.cs +++ b/NPCs/Abyss/OarfishTail.cs @@ -133,13 +133,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Abyss/Reaper.cs b/NPCs/Abyss/Reaper.cs index 107942f748..a569c8dadf 100644 --- a/NPCs/Abyss/Reaper.cs +++ b/NPCs/Abyss/Reaper.cs @@ -675,13 +675,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 40; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index 3103d0f344..d9340663aa 100644 --- a/NPCs/Abyss/Viperfish.cs +++ b/NPCs/Abyss/Viperfish.cs @@ -146,13 +146,13 @@ namespace CalamityMod.NPCs.Abyss { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ViperFish"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ViperFish2"), 1f); diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index 87ff598a0d..c64038ed8d 100644 --- a/NPCs/AcidRain/AcidEel.cs +++ b/NPCs/AcidRain/AcidEel.cs @@ -29,6 +29,7 @@ namespace CalamityMod.NPCs.AcidRain npc.damage = 20; npc.lifeMax = 100; npc.defense = 4; + npc.knockBackResist = 0.9f; if (CalamityWorld.downedPolterghast) { @@ -36,6 +37,7 @@ namespace CalamityMod.NPCs.AcidRain npc.damage = 120; npc.lifeMax = 5500; npc.defense = 45; + npc.knockBackResist = 0.7f; } else if (CalamityWorld.downedAquaticScourge) { @@ -43,7 +45,6 @@ namespace CalamityMod.NPCs.AcidRain npc.lifeMax = 705; } - npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 0, 3, 32); for (int k = 0; k < npc.buffImmune.Length; k++) { diff --git a/NPCs/AcidRain/FlakBaby.cs b/NPCs/AcidRain/FlakBaby.cs index 9328f77d17..c1726fb879 100644 --- a/NPCs/AcidRain/FlakBaby.cs +++ b/NPCs/AcidRain/FlakBaby.cs @@ -28,7 +28,6 @@ namespace CalamityMod.NPCs.AcidRain npc.lifeMax = 5; npc.defense = 5; - npc.knockBackResist = 0f; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; diff --git a/NPCs/AcidRain/FlakCrab.cs b/NPCs/AcidRain/FlakCrab.cs index 64a564d31d..c11372763b 100644 --- a/NPCs/AcidRain/FlakCrab.cs +++ b/NPCs/AcidRain/FlakCrab.cs @@ -81,6 +81,7 @@ namespace CalamityMod.NPCs.AcidRain if (npc.ai[0] < 300f) { npc.chaseable = false; + npc.knockBackResist = 0f; } if (Math.Abs(closest.Center.X - npc.Center.X) < 320f && closest.Center.Y - npc.Top.Y < -60f && @@ -103,8 +104,9 @@ namespace CalamityMod.NPCs.AcidRain npc.chaseable = true; if (npc.velocity.Y == 0f) { + npc.knockBackResist = 0.6f; npc.TargetClosest(true); - npc.velocity.X = npc.velocity.X * 0.85f; + npc.velocity.X *= 0.85f; npc.ai[2]++; float hopRate = 10f + 15f * (npc.life / (float)npc.lifeMax); float lungeForwardSpeed = 10f; @@ -129,7 +131,7 @@ namespace CalamityMod.NPCs.AcidRain } else { - npc.knockBackResist = 0f; + npc.knockBackResist = 0.2f; npc.velocity.X *= 0.995f; } } diff --git a/NPCs/AcidRain/GammaSlime.cs b/NPCs/AcidRain/GammaSlime.cs index ed361355c4..b54bf77436 100644 --- a/NPCs/AcidRain/GammaSlime.cs +++ b/NPCs/AcidRain/GammaSlime.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.AcidRain npc.aiStyle = aiType = -1; npc.knockBackResist = 0f; - animationType = 81; + animationType = NPCID.CorruptSlime; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; diff --git a/NPCs/AcidRain/IrradiatedSlime.cs b/NPCs/AcidRain/IrradiatedSlime.cs index 82fc30c21d..2513fee920 100644 --- a/NPCs/AcidRain/IrradiatedSlime.cs +++ b/NPCs/AcidRain/IrradiatedSlime.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.AcidRain npc.defense = 5; npc.knockBackResist = 0f; - animationType = 81; + animationType = NPCID.CorruptSlime; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.AcidRain else { npc.aiStyle = 1; - aiType = 141; + aiType = NPCID.ToxicSludge; } } diff --git a/NPCs/AcidRain/NuclearToad.cs b/NPCs/AcidRain/NuclearToad.cs index c3c961341e..96de09bdc2 100644 --- a/NPCs/AcidRain/NuclearToad.cs +++ b/NPCs/AcidRain/NuclearToad.cs @@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.AcidRain npc.lifeMax = 420; } - npc.knockBackResist = 0f; + npc.knockBackResist = 0.7f; npc.value = Item.buyPrice(0, 0, 5, 0); for (int k = 0; k < npc.buffImmune.Length; k++) { diff --git a/NPCs/AcidRain/Orthocera.cs b/NPCs/AcidRain/Orthocera.cs index 2a2d1b5c4b..a5667a3df9 100644 --- a/NPCs/AcidRain/Orthocera.cs +++ b/NPCs/AcidRain/Orthocera.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.AcidRain npc.DR_NERD(0.35f); } - npc.knockBackResist = 0f; + npc.knockBackResist = 0.6f; for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; @@ -192,7 +192,7 @@ namespace CalamityMod.NPCs.AcidRain Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AcidRain/OrthoceraGore2"), npc.scale); for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/AcidRain/Skyfin.cs b/NPCs/AcidRain/Skyfin.cs index 8adcdb1bef..16f09e13ae 100644 --- a/NPCs/AcidRain/Skyfin.cs +++ b/NPCs/AcidRain/Skyfin.cs @@ -33,9 +33,11 @@ namespace CalamityMod.NPCs.AcidRain npc.damage = 12; npc.lifeMax = 150; npc.defense = 6; + npc.knockBackResist = 1f; if (CalamityWorld.downedPolterghast) { + npc.knockBackResist = 0.8f; npc.damage = 150; npc.lifeMax = 5001; npc.defense = 58; @@ -48,7 +50,6 @@ namespace CalamityMod.NPCs.AcidRain npc.DR_NERD(0.05f); } - npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 0, 3, 65); for (int k = 0; k < npc.buffImmune.Length; k++) { diff --git a/NPCs/AcidRain/SulfurousSkater.cs b/NPCs/AcidRain/SulfurousSkater.cs index 018bd4f27e..6698cbea48 100644 --- a/NPCs/AcidRain/SulfurousSkater.cs +++ b/NPCs/AcidRain/SulfurousSkater.cs @@ -47,10 +47,9 @@ namespace CalamityMod.NPCs.AcidRain npc.damage = 100; npc.lifeMax = 5000; npc.defense = 33; - npc.DR_NERD(0.15f); } - npc.knockBackResist = 0f; + npc.knockBackResist = 0.8f; npc.value = Item.buyPrice(0, 0, 5, 25); for (int k = 0; k < npc.buffImmune.Length; k++) { @@ -72,7 +71,8 @@ namespace CalamityMod.NPCs.AcidRain Player player = Main.player[npc.target]; if (!Flying) { - npc.Calamity().DR = 0.35f; + npc.knockBackResist = 0.8f; + npc.DR_NERD(0.35f); npc.noGravity = false; float minimumDistance = float.PositiveInfinity; Projectile closestBubble = null; @@ -149,7 +149,8 @@ namespace CalamityMod.NPCs.AcidRain } else { - npc.Calamity().DR = 0f; + npc.knockBackResist = 0.5f; + npc.DR_NERD(0f); float speed = CalamityWorld.downedPolterghast ? 17f : 14f; float inertia = CalamityWorld.downedPolterghast ? 20f : 24.5f; if (npc.Distance(player.Center) < 200f) diff --git a/NPCs/AcidRain/Trilobite.cs b/NPCs/AcidRain/Trilobite.cs index 5063cdb640..2a283f81c3 100644 --- a/NPCs/AcidRain/Trilobite.cs +++ b/NPCs/AcidRain/Trilobite.cs @@ -44,7 +44,7 @@ namespace CalamityMod.NPCs.AcidRain npc.DR_NERD(0.4f); } - npc.knockBackResist = 0f; + npc.knockBackResist = 0.2f; npc.value = Item.buyPrice(0, 0, 4, 0); for (int k = 0; k < npc.buffImmune.Length; k++) { diff --git a/NPCs/AcidRain/WaterLeech.cs b/NPCs/AcidRain/WaterLeech.cs index d11b3cd218..b993de950c 100644 --- a/NPCs/AcidRain/WaterLeech.cs +++ b/NPCs/AcidRain/WaterLeech.cs @@ -42,7 +42,6 @@ namespace CalamityMod.NPCs.AcidRain npc.lifeMax = 320; } - npc.knockBackResist = 0f; npc.value = Item.buyPrice(0, 0, 2, 5); for (int k = 0; k < npc.buffImmune.Length; k++) { diff --git a/NPCs/AquaticScourge/AquaticParasite.cs b/NPCs/AquaticScourge/AquaticParasite.cs index b2ea5db3d1..68d7d4ad19 100644 --- a/NPCs/AquaticScourge/AquaticParasite.cs +++ b/NPCs/AquaticScourge/AquaticParasite.cs @@ -204,13 +204,13 @@ namespace CalamityMod.NPCs.AquaticScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticParasite1"), 1f); Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticParasite2"), 1f); diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index 237bdcca83..82b3dddb13 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -84,13 +84,13 @@ namespace CalamityMod.NPCs.AquaticScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASBody"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASBody2"), 1f); diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index db1ce4db78..36599322df 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -84,13 +84,13 @@ namespace CalamityMod.NPCs.AquaticScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASBodyAlt"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASBodyAlt2"), 1f); diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index 47a72e72f6..e50a123e29 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -233,13 +233,13 @@ namespace CalamityMod.NPCs.AquaticScourge { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASHead"), 1f); } diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index e391290aae..05b29875a0 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -84,13 +84,13 @@ namespace CalamityMod.NPCs.AquaticScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASTail"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/ASTail2"), 1f); diff --git a/NPCs/AquaticScourge/AquaticSeekerBody.cs b/NPCs/AquaticScourge/AquaticSeekerBody.cs index 35c59407be..54053ab9de 100644 --- a/NPCs/AquaticScourge/AquaticSeekerBody.cs +++ b/NPCs/AquaticScourge/AquaticSeekerBody.cs @@ -153,13 +153,13 @@ namespace CalamityMod.NPCs.AquaticScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticSeekerBody"), 1f); } diff --git a/NPCs/AquaticScourge/AquaticSeekerHead.cs b/NPCs/AquaticScourge/AquaticSeekerHead.cs index 58d420a3d8..812a0741fe 100644 --- a/NPCs/AquaticScourge/AquaticSeekerHead.cs +++ b/NPCs/AquaticScourge/AquaticSeekerHead.cs @@ -272,13 +272,13 @@ namespace CalamityMod.NPCs.AquaticScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticSeekerHead"), 1f); } diff --git a/NPCs/AquaticScourge/AquaticSeekerTail.cs b/NPCs/AquaticScourge/AquaticSeekerTail.cs index 5a18e0422a..cafbb6386b 100644 --- a/NPCs/AquaticScourge/AquaticSeekerTail.cs +++ b/NPCs/AquaticScourge/AquaticSeekerTail.cs @@ -153,13 +153,13 @@ namespace CalamityMod.NPCs.AquaticScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticSeekerTail"), 1f); } diff --git a/NPCs/AquaticScourge/AquaticUrchin.cs b/NPCs/AquaticScourge/AquaticUrchin.cs index f301bfa362..a2adc34731 100644 --- a/NPCs/AquaticScourge/AquaticUrchin.cs +++ b/NPCs/AquaticScourge/AquaticUrchin.cs @@ -72,13 +72,13 @@ namespace CalamityMod.NPCs.AquaticScourge { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticUrchin"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AquaticScourgeGores/AquaticUrchin2"), 1f); diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index e6f1003bd7..a2abc3311a 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; @@ -139,7 +140,7 @@ namespace CalamityMod.NPCs.Astral if (CalamityWorld.downedAstrageldon) num8 += 6; - int num9 = 84; + int num9 = ProjectileID.PinkLaser; Projectile.NewProjectile(vector.X, vector.Y, num4, num5, num9, num8, 0f, Main.myPlayer, 0f, 0f); } } @@ -258,7 +259,7 @@ namespace CalamityMod.NPCs.Astral npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -268,41 +269,13 @@ namespace CalamityMod.NPCs.Astral } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - for (int num625 = 0; num625 < 3; num625++) - { - float scaleFactor10 = 0.33f; - if (num625 == 1) - { - scaleFactor10 = 0.66f; - } - if (num625 == 2) - { - scaleFactor10 = 1f; - } - int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Gore gore = Main.gore[num626]; - gore.velocity *= scaleFactor10; - gore.velocity.X += 1f; - gore.velocity.Y += 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - gore.velocity *= scaleFactor10; - gore.velocity.X -= 1f; - gore.velocity.Y += 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - gore.velocity *= scaleFactor10; - gore.velocity.X += 1f; - gore.velocity.Y -= 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - gore.velocity *= scaleFactor10; - gore.velocity.X -= 1f; - gore.velocity.Y -= 1f; - } + npc.ExplosionGores(3); } } diff --git a/NPCs/Astral/AstralachneaGround.cs b/NPCs/Astral/AstralachneaGround.cs index 3cea4ff667..81fa114674 100644 --- a/NPCs/Astral/AstralachneaGround.cs +++ b/NPCs/Astral/AstralachneaGround.cs @@ -41,13 +41,13 @@ namespace CalamityMod.NPCs.Astral npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); npc.knockBackResist = 0.38f; npc.value = Item.buyPrice(0, 0, 20, 0); - npc.buffImmune[20] = true; - npc.buffImmune[31] = false; npc.timeLeft = NPC.activeTime * 2; animationType = NPCID.WallCreeper; banner = npc.type; bannerItem = ModContent.ItemType(); npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffID.Poisoned] = true; + npc.buffImmune[BuffID.Confused] = false; if (CalamityWorld.downedAstrageldon) { npc.damage = 90; diff --git a/NPCs/Astral/AstralachneaWall.cs b/NPCs/Astral/AstralachneaWall.cs index c3a3cb7d01..3984620567 100644 --- a/NPCs/Astral/AstralachneaWall.cs +++ b/NPCs/Astral/AstralachneaWall.cs @@ -42,8 +42,8 @@ namespace CalamityMod.NPCs.Astral npc.knockBackResist = 0f; npc.noGravity = true; npc.value = Item.buyPrice(0, 0, 20, 0); - npc.buffImmune[20] = true; - npc.buffImmune[31] = false; + npc.buffImmune[BuffID.Poisoned] = true; + npc.buffImmune[BuffID.Confused] = false; npc.timeLeft = NPC.activeTime * 2; animationType = NPCID.BlackRecluseWall; banner = ModContent.NPCType(); diff --git a/NPCs/Astral/StellarCulex.cs b/NPCs/Astral/StellarCulex.cs index d2dd20c242..f0ec674ee5 100644 --- a/NPCs/Astral/StellarCulex.cs +++ b/NPCs/Astral/StellarCulex.cs @@ -38,11 +38,11 @@ namespace CalamityMod.NPCs.Astral npc.lifeMax = 210; npc.value = Item.buyPrice(0, 0, 10, 0); npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/AstralEnemyDeath"); - npc.buffImmune[31] = false; animationType = NPCID.GiantFlyingFox; banner = npc.type; bannerItem = ModContent.ItemType(); npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffID.Confused] = false; if (CalamityWorld.downedAstrageldon) { npc.damage = 90; diff --git a/NPCs/Astral/Twinkler.cs b/NPCs/Astral/Twinkler.cs index 506f616ee7..5ab6f2a60c 100644 --- a/NPCs/Astral/Twinkler.cs +++ b/NPCs/Astral/Twinkler.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.Astral npc.catchItem = (short)ModContent.ItemType(); npc.friendly = true; // prevents critter from getting slagged //banner = npc.type; - //bannerItem = ModContent.ItemType(); + //bannerItem = ModContent.ItemType(); } public override bool? CanBeHitByItem(Player player, Item item) => true; diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index c306f05f51..f2f4ab3a78 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -409,7 +409,7 @@ namespace CalamityMod.NPCs.AstrumAureus for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -421,7 +421,7 @@ namespace CalamityMod.NPCs.AstrumAureus npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 50; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { diff --git a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs index b5359096a3..123179660e 100644 --- a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs @@ -170,7 +170,7 @@ namespace CalamityMod.NPCs.AstrumDeus npc.position.Y = npc.position.Y - (npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { diff --git a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs index 027f0b42a3..87344adca7 100644 --- a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs @@ -165,7 +165,7 @@ namespace CalamityMod.NPCs.AstrumDeus npc.position.Y = npc.position.Y - (npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { diff --git a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs index 0920f9585f..8b9ec2618a 100644 --- a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs @@ -147,7 +147,7 @@ namespace CalamityMod.NPCs.AstrumDeus npc.position.Y = npc.position.Y - (npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { diff --git a/NPCs/BrimstoneElemental/Brimling.cs b/NPCs/BrimstoneElemental/Brimling.cs index f3256cbe44..ac6ec63800 100644 --- a/NPCs/BrimstoneElemental/Brimling.cs +++ b/NPCs/BrimstoneElemental/Brimling.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -271,13 +272,13 @@ namespace CalamityMod.NPCs.BrimstoneElemental { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index 53fd072e5b..d141e1810a 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -239,7 +240,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -249,10 +250,10 @@ namespace CalamityMod.NPCs.BrimstoneElemental } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 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, 235, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); diff --git a/NPCs/Calamitas/LifeSeeker.cs b/NPCs/Calamitas/LifeSeeker.cs index 88c1c5ea47..d12cc4334e 100644 --- a/NPCs/Calamitas/LifeSeeker.cs +++ b/NPCs/Calamitas/LifeSeeker.cs @@ -29,9 +29,9 @@ namespace CalamityMod.NPCs.Calamitas npc.lifeMax = 30000; } npc.aiStyle = 5; - aiType = 139; + aiType = NPCID.Probe; npc.knockBackResist = CalamityWorld.bossRushActive ? 0f : 0.25f; - animationType = 2; + animationType = NPCID.DemonEye; npc.noGravity = true; npc.noTileCollide = true; npc.canGhostHeal = false; diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index f89db6b11e..66f8f40ba8 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -3504,7 +3504,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < numDust; i++) { dustOffset = dustOffset.RotatedBy(angleIncrement); - int dust = Dust.NewDust(npc.Center, 1, 1, 173); + int dust = Dust.NewDust(npc.Center, 1, 1, (int)CalamityDusts.PurpleCosmolite); Main.dust[dust].position = npc.Center + dustOffset; Main.dust[dust].noGravity = true; Main.dust[dust].fadeIn = 1f; @@ -6304,19 +6304,19 @@ namespace CalamityMod.NPCs { if (npc.position.X < Main.npc[i].position.X) { - npc.velocity.X = npc.velocity.X - 0.05f; + npc.velocity.X -= 0.05f; } else { - npc.velocity.X = npc.velocity.X + 0.05f; + npc.velocity.X += 0.05f; } if (npc.position.Y < Main.npc[i].position.Y) { - npc.velocity.Y = npc.velocity.Y - 0.05f; + npc.velocity.Y -= 0.05f; } else { - npc.velocity.Y = npc.velocity.Y + 0.05f; + npc.velocity.Y += 0.05f; } } } @@ -6421,7 +6421,7 @@ namespace CalamityMod.NPCs { if (Math.Sign(npc.velocity.X) != npc.direction && !DogPhase1) { - npc.velocity.X = npc.velocity.X * 0.92f; + npc.velocity.X *= 0.92f; } float num9 = MathHelper.Lerp(0.6f, 1f, Math.Abs(Main.windSpeedSet)) * (float)Math.Sign(Main.windSpeedSet); if (!Main.player[npc.target].ZoneSandstorm) diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index ca7fa99efd..84e597c10b 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -2083,7 +2083,7 @@ namespace CalamityMod.NPCs // Blood dust for (int num621 = 0; num621 < 6; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 1f); + int num622 = Dust.NewDust(npc.position, npc.width, npc.height, 5, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -2093,10 +2093,10 @@ namespace CalamityMod.NPCs } for (int num623 = 0; num623 < 12; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 1.5f); + int num624 = Dust.NewDust(npc.position, npc.width, npc.height, 5, 0f, 0f, 100, default, 1.5f); 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, 5, 0f, 0f, 100, default, 1f); + num624 = Dust.NewDust(npc.position, npc.width, npc.height, 5, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } @@ -4401,7 +4401,7 @@ namespace CalamityMod.NPCs { for (int i = 0; i < 2; i++) { - int num = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); + int num = Dust.NewDust(npc.position, npc.width, npc.height, 182, 0f, 0f, 100, default, 2f); Main.dust[num].noGravity = true; Main.dust[num].noLight = true; } @@ -9476,7 +9476,7 @@ namespace CalamityMod.NPCs { for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Fire, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity.Y *= 6f; Main.dust[num622].velocity.X *= 3f; if (Main.rand.Next(2) == 0) @@ -9487,10 +9487,10 @@ namespace CalamityMod.NPCs } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Fire, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity.Y *= 10f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Fire, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity.X *= 2f; } @@ -9749,10 +9749,10 @@ namespace CalamityMod.NPCs { npc.ai[2] = 0f; - int num670 = 35; + int dmg = 35; if (death) - num670 += 3; - int num671 = ProjectileID.EyeBeam; + dmg += 3; + int projType = ProjectileID.EyeBeam; if (npc.localAI[1] == 0f) { @@ -9780,7 +9780,7 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { - int num677 = Projectile.NewProjectile(vector82.X, vector82.Y, num674, num675, num671, num670, 0f, Main.myPlayer, 0f, 0f); + int num677 = Projectile.NewProjectile(vector82.X, vector82.Y, num674, num675, projType, dmg, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num677].timeLeft = enrage ? 480 : 300; } } @@ -9809,7 +9809,7 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { - int num682 = Projectile.NewProjectile(vector82.X, vector82.Y, num679, num680, num671, num670, 0f, Main.myPlayer, 0f, 0f); + int num682 = Projectile.NewProjectile(vector82.X, vector82.Y, num679, num680, projType, dmg, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num682].timeLeft = enrage ? 480 : 300; } } @@ -15142,7 +15142,7 @@ namespace CalamityMod.NPCs num858 *= num859; num857 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; num858 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; - Projectile.NewProjectile(vector109.X, vector109.Y, num857, num858, Main.rand.Next(326, 329), 60, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector109.X, vector109.Y, num857, num858, ProjectileID.GreekFire1 + Main.rand.Next(3), 60, 0f, Main.myPlayer, 0f, 0f); } } } @@ -15152,13 +15152,13 @@ namespace CalamityMod.NPCs npc.TargetClosest(true); npc.ai[0] = 1f; - int num861 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)npc.position.Y + npc.height / 2, 328, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + int num861 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PumpkingBlade, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num861].ai[0] = -1f; Main.npc[num861].ai[1] = (float)npc.whoAmI; Main.npc[num861].target = npc.target; Main.npc[num861].netUpdate = true; - num861 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)npc.position.Y + npc.height / 2, 328, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + num861 = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)npc.position.Y + npc.height / 2, NPCID.PumpkingBlade, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[num861].ai[0] = 1f; Main.npc[num861].ai[1] = (float)npc.whoAmI; Main.npc[num861].ai[3] = 150f; @@ -16027,7 +16027,7 @@ namespace CalamityMod.NPCs if (npc.type == NPCID.LavaSlime || npc.type == ModContent.NPCType()) { Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 1f, 0.3f, 0.1f); - int idx = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default, 1.7f); + int idx = Dust.NewDust(npc.position, npc.width, npc.height, 6, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default, 1.7f); Main.dust[idx].noGravity = true; } if (npc.ai[2] > 1f) @@ -16431,7 +16431,7 @@ namespace CalamityMod.NPCs DemonEyeBatMovement(npc, 8f, 3.5f, 0.12f, 0.12f, 0.25f, 0.06f, 0.07f, 0.2f); if (Main.rand.NextBool(40)) { - int idx = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + (float)npc.height * 0.25f), npc.width, (int)((float)npc.height * 0.5f), 5, npc.velocity.X, 2f, 0, default, 1f); + int idx = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + (float)npc.height * 0.25f), npc.width, (int)((float)npc.height * 0.5f), DustID.Blood, npc.velocity.X, 2f, 0, default, 1f); Dust dust = Main.dust[idx]; dust.velocity.X *= 0.5f; dust.velocity.Y *= 0.1f; @@ -16463,7 +16463,7 @@ namespace CalamityMod.NPCs (npc.type >= NPCID.CataractEye && npc.type <= NPCID.PurpleEye)) && Main.rand.NextBool(40)) { - int num4 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + (float)npc.height * 0.25f), npc.width, (int)((float)npc.height * 0.5f), 5, npc.velocity.X, 2f, 0, default(Color), 1f); + int num4 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + (float)npc.height * 0.25f), npc.width, (int)((float)npc.height * 0.5f), DustID.Blood, npc.velocity.X, 2f, 0, default(Color), 1f); Dust dust = Main.dust[num4]; dust.velocity.X *= 0.5f; dust.velocity.Y *= 0.1f; @@ -16981,7 +16981,7 @@ namespace CalamityMod.NPCs } if (((player.Center.X < npc.Center.X && npc.direction < 0 && player.direction > 0) || (player.Center.X > npc.Center.X && npc.direction > 0 && player.direction < 0)) && canTurnPlayerToStone && (Collision.CanHitLine(npc.Center, 1, 1, player.Center, 1, 1) || Collision.CanHitLine(npc.Center - Vector2.UnitY * 16f, 1, 1, player.Center, 1, 1) || Collision.CanHitLine(npc.Center + Vector2.UnitY * 8f, 1, 1, player.Center, 1, 1))) { - player.AddBuff(156, debuffTime + (int)npc.ai[2] * -1, true); + player.AddBuff(BuffID.Stoned, debuffTime + (int)npc.ai[2] * -1, true); } } } @@ -17475,7 +17475,7 @@ namespace CalamityMod.NPCs // This variable seems to have a lot of purposes. // I wasn't sure what I could name it that isn't very vague int aiGateValue = 60; - if (npcType == NPCID.ChaosElemental) + if (npcType == NPCID.ChaosElemental || npcType == ModContent.NPCType()) { aiGateValue = 180; if (npc.ai[3] == -30f) @@ -17507,7 +17507,7 @@ namespace CalamityMod.NPCs } bool canIncrementAI3 = false; bool reset = true; - if (npcType == NPCID.Yeti || npcType == NPCID.CorruptBunny || npcType == NPCID.Crab || npcType == NPCID.Clown || npcType == NPCID.SkeletonArcher || npcType == NPCID.GoblinArcher || npcType == NPCID.ChaosElemental + if (npcType == NPCID.Yeti || npcType == NPCID.CorruptBunny || npcType == NPCID.Crab || npcType == NPCID.Clown || npcType == NPCID.SkeletonArcher || npcType == NPCID.GoblinArcher || npcType == NPCID.ChaosElemental || npcType == ModContent.NPCType() || npcType == NPCID.BlackRecluse || npcType == NPCID.WallCreeper || npcType == NPCID.BloodCrawler || npcType == NPCID.CorruptPenguin || npcType == NPCID.LihzahrdCrawler || npcType == NPCID.IcyMerman || npcType == NPCID.PirateDeadeye || npcType == NPCID.PirateCrossbower || npcType == NPCID.PirateCaptain || npcType == NPCID.CochinealBeetle || npcType == NPCID.CyanBeetle || npcType == NPCID.LacBeetle || npcType == NPCID.SeaSnail || npcType == NPCID.FlyingSnake || npcType == NPCID.IceGolem || npcType == NPCID.Eyezor || npcType == NPCID.AnomuraFungus || npcType == NPCID.MushiLadybug || npcType == NPCID.Paladin || npcType == NPCID.SkeletonSniper || npcType == NPCID.TacticalSkeleton @@ -17561,7 +17561,7 @@ namespace CalamityMod.NPCs goto PrepareToShoot; } } - else if (npcType - 498 > 8 && npcType != 520) + else if (npcType - 498 > 8 && npcType != NPCID.MartianWalker) { goto PrepareToShoot; } @@ -17751,7 +17751,7 @@ namespace CalamityMod.NPCs } } } - if (npc.ai[3] < (float)aiGateValue && (Main.eclipse || !Main.dayTime || (double)npc.position.Y > Main.worldSurface * 16.0 || (Main.invasionType == 1 && (npcType == NPCID.Yeti || npcType == NPCID.ElfArcher)) || (Main.invasionType == 1 && (npcType == NPCID.GoblinPeon || npcType == NPCID.GoblinThief || npcType == NPCID.GoblinWarrior || npcType == NPCID.GoblinArcher || npcType == NPCID.GoblinSummoner)) || (npcType == NPCID.GoblinScout || (Main.invasionType == 3 && npcType >= 212 && npcType <= 216)) || (Main.invasionType == 4 && (npcType == NPCID.BrainScrambler || npcType == NPCID.RayGunner || npcType == NPCID.MartianOfficer || npcType == NPCID.GrayGrunt || npcType == NPCID.MartianEngineer || npcType == NPCID.GigaZapper || npcType == NPCID.Scutlix || npcType == NPCID.MartianWalker)) || (npcType == NPCID.AngryBones || npcType == NPCID.AngryBonesBig || npcType == NPCID.AngryBonesBigMuscle || npcType == NPCID.AngryBonesBigHelmet || npcType == NPCID.CorruptBunny || npcType == NPCID.Crab || npcType == NPCID.ArmoredSkeleton || npcType == NPCID.Mummy || npcType == NPCID.DarkMummy || npcType == NPCID.LightMummy || npcType == NPCID.SkeletonArcher || npcType == NPCID.ChaosElemental || npcType == NPCID.CorruptPenguin || npcType == NPCID.FaceMonster || npcType == NPCID.SnowFlinx || npcType == NPCID.Lihzahrd || npcType == NPCID.LihzahrdCrawler || npcType == NPCID.IcyMerman || npcType == NPCID.CochinealBeetle || npcType == NPCID.CyanBeetle || npcType == NPCID.LacBeetle || npcType == NPCID.SeaSnail || npcType == NPCID.BloodCrawler || npcType == NPCID.IceGolem || npcType == NPCID.ZombieMushroom || npcType == NPCID.ZombieMushroomHat || npcType == NPCID.AnomuraFungus || npcType == NPCID.MushiLadybug || npcType == NPCID.SkeletonSniper || npcType == NPCID.TacticalSkeleton || npcType == NPCID.SkeletonCommando || npcType == NPCID.CultistArcherBlue || npcType == NPCID.CultistArcherWhite || npcType == NPCID.CrimsonBunny || npcType == NPCID.CrimsonPenguin || npcType == NPCID.NebulaSoldier || (npcType == NPCID.StardustSoldier && (npc.ai[1] >= 180f || npc.ai[1] < 90f))) || (npcType == NPCID.StardustSpiderBig || npcType == NPCID.VortexRifleman || npcType == NPCID.VortexSoldier || npcType == NPCID.VortexHornet || npcType == NPCID.VortexLarva || npcType == NPCID.WalkingAntlion || npcType == NPCID.SolarDrakomire || npcType == NPCID.SolarSolenian || (npcType >= 524 && npcType <= 527)) || npcType == NPCID.DesertLamiaLight || npcType == NPCID.DesertLamiaDark || npcType == NPCID.DesertScorpionWalk || npcType == NPCID.DesertBeast)) + if (npc.ai[3] < (float)aiGateValue && (Main.eclipse || !Main.dayTime || (double)npc.position.Y > Main.worldSurface * 16.0 || (Main.invasionType == InvasionID.GoblinArmy && (npcType == NPCID.Yeti || npcType == NPCID.ElfArcher)) || (Main.invasionType == InvasionID.GoblinArmy && (npcType == NPCID.GoblinPeon || npcType == NPCID.GoblinThief || npcType == NPCID.GoblinWarrior || npcType == NPCID.GoblinArcher || npcType == NPCID.GoblinSummoner)) || (npcType == NPCID.GoblinScout || (Main.invasionType == InvasionID.PirateInvasion && npcType >= 212 && npcType <= 216)) || (Main.invasionType == InvasionID.MartianMadness && (npcType == NPCID.BrainScrambler || npcType == NPCID.RayGunner || npcType == NPCID.MartianOfficer || npcType == NPCID.GrayGrunt || npcType == NPCID.MartianEngineer || npcType == NPCID.GigaZapper || npcType == NPCID.Scutlix || npcType == NPCID.MartianWalker)) || (npcType == NPCID.AngryBones || npcType == NPCID.AngryBonesBig || npcType == NPCID.AngryBonesBigMuscle || npcType == NPCID.AngryBonesBigHelmet || npcType == NPCID.CorruptBunny || npcType == NPCID.Crab || npcType == NPCID.ArmoredSkeleton || npcType == NPCID.Mummy || npcType == NPCID.DarkMummy || npcType == NPCID.LightMummy || npcType == NPCID.SkeletonArcher || npcType == NPCID.ChaosElemental || npcType == ModContent.NPCType() || npcType == NPCID.CorruptPenguin || npcType == NPCID.FaceMonster || npcType == NPCID.SnowFlinx || npcType == NPCID.Lihzahrd || npcType == NPCID.LihzahrdCrawler || npcType == NPCID.IcyMerman || npcType == NPCID.CochinealBeetle || npcType == NPCID.CyanBeetle || npcType == NPCID.LacBeetle || npcType == NPCID.SeaSnail || npcType == NPCID.BloodCrawler || npcType == NPCID.IceGolem || npcType == NPCID.ZombieMushroom || npcType == NPCID.ZombieMushroomHat || npcType == NPCID.AnomuraFungus || npcType == NPCID.MushiLadybug || npcType == NPCID.SkeletonSniper || npcType == NPCID.TacticalSkeleton || npcType == NPCID.SkeletonCommando || npcType == NPCID.CultistArcherBlue || npcType == NPCID.CultistArcherWhite || npcType == NPCID.CrimsonBunny || npcType == NPCID.CrimsonPenguin || npcType == NPCID.NebulaSoldier || (npcType == NPCID.StardustSoldier && (npc.ai[1] >= 180f || npc.ai[1] < 90f))) || (npcType == NPCID.StardustSpiderBig || npcType == NPCID.VortexRifleman || npcType == NPCID.VortexSoldier || npcType == NPCID.VortexHornet || npcType == NPCID.VortexLarva || npcType == NPCID.WalkingAntlion || npcType == NPCID.SolarDrakomire || npcType == NPCID.SolarSolenian || (npcType >= 524 && npcType <= 527)) || npcType == NPCID.DesertLamiaLight || npcType == NPCID.DesertLamiaDark || npcType == NPCID.DesertScorpionWalk || npcType == NPCID.DesertBeast)) { if ((npcType == NPCID.Zombie || npcType == NPCID.ZombieXmas || npcType == NPCID.ZombieSweater || npcType == NPCID.Skeleton || (npcType >= NPCID.BoneThrowingSkeleton && npcType <= NPCID.BoneThrowingSkeleton4) || npcType == NPCID.AngryBones || npcType == NPCID.AngryBonesBig || npcType == NPCID.AngryBonesBigHelmet || npcType == NPCID.AngryBonesBigMuscle || npcType == NPCID.ArmoredSkeleton || npcType == NPCID.SkeletonArcher || npcType == NPCID.BaldZombie || npcType == NPCID.UndeadViking || npcType == NPCID.ZombieEskimo || npcType == NPCID.Frankenstein || npcType == NPCID.PincushionZombie || npcType == NPCID.SlimedZombie || npcType == NPCID.SwampZombie || npcType == NPCID.TwiggyZombie || npcType == NPCID.ArmoredViking || npcType == NPCID.FemaleZombie || npcType == NPCID.HeadacheSkeleton || npcType == NPCID.MisassembledSkeleton || npcType == NPCID.PantlessSkeleton || npcType == NPCID.ZombieRaincoat || npcType == NPCID.SkeletonSniper || npcType == NPCID.TacticalSkeleton || npcType == NPCID.SkeletonCommando || npcType == NPCID.ZombieSuperman || npcType == NPCID.ZombiePixie || npcType == NPCID.ZombieDoctor || npcType == NPCID.GreekSkeleton) && Main.rand.Next(1000) == 0) { @@ -17887,7 +17887,7 @@ namespace CalamityMod.NPCs { FighterRunningAI(npc, 6f, 0.12f, 0.8f, true, 0.8f); } - else if (npcType == NPCID.ChaosElemental || npcType == NPCID.SwampThing || npcType == NPCID.PirateCorsair || npcType == NPCID.MushiLadybug || npcType == NPCID.DesertLamiaLight || npcType == NPCID.DesertLamiaDark) + else if (npcType == NPCID.ChaosElemental || npcType == ModContent.NPCType() || npcType == NPCID.SwampThing || npcType == NPCID.PirateCorsair || npcType == NPCID.MushiLadybug || npcType == NPCID.DesertLamiaLight || npcType == NPCID.DesertLamiaDark) { FighterRunningAI(npc, 4f, 0.09f, 0.8f, true, 0.8f); } @@ -19201,34 +19201,20 @@ namespace CalamityMod.NPCs distX *= magnitude; distY *= magnitude; int damage = 35; - int projectileType = 82; - if (npcType == NPCID.GoblinArcher) - { - damage = 11; - } - if (npcType == NPCID.IcyMerman) - { - damage = 37; - } - if (npcType == NPCID.CultistArcherBlue || npcType == NPCID.CultistArcherWhite) - { - damage = 40; - } + int projectileType = ProjectileID.FlamingArrow; if (npcType == NPCID.ElfArcher) { damage = 45; } - if (npcType == NPCID.DrManFly) - { - damage = 50; - } if (npcType == NPCID.GoblinArcher) { projectileType = ProjectileID.WoodenArrowHostile; + damage = 11; } if (npcType == NPCID.CultistArcherBlue || npcType == NPCID.CultistArcherWhite) { projectileType = ProjectileID.WoodenArrowHostile; + damage = 40; } if (npcType == NPCID.BrainScrambler) { @@ -19263,10 +19249,12 @@ namespace CalamityMod.NPCs if (npcType == NPCID.IcyMerman) { projectileType = ProjectileID.IcewaterSpit; + damage = 37; } if (npcType == NPCID.DrManFly) { projectileType = ProjectileID.DrManFlyFlask; + damage = 50; } if (npcType == NPCID.StardustSoldier) { @@ -19364,7 +19352,7 @@ namespace CalamityMod.NPCs } else if (npcType == NPCID.StardustSpiderBig) { - int idx = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, 410, npc.whoAmI, 0f, 0f, 0f, 0f, 255); + int idx = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.StardustSpiderSmall, npc.whoAmI, 0f, 0f, 0f, 0f, 255); Main.npc[idx].velocity = new Vector2(distX, -6f + distY); } else @@ -19888,7 +19876,7 @@ namespace CalamityMod.NPCs npc.velocity.Y = -5f; npc.netUpdate = true; } - if (npcType == NPCID.ChaosElemental && npc.velocity.Y < 0f) + if ((npcType == NPCID.ChaosElemental || npcType == ModContent.NPCType()) && npc.velocity.Y < 0f) { npc.velocity.Y *= 1.1f; } @@ -19916,7 +19904,7 @@ namespace CalamityMod.NPCs npc.ai[2] = 0f; } // Teleport (Chaos elementals) - if (Main.netMode != NetmodeID.MultiplayerClient && npcType == NPCID.ChaosElemental && npc.ai[3] >= (float)aiGateValue) + if (Main.netMode != NetmodeID.MultiplayerClient && (npcType == NPCID.ChaosElemental || npcType == ModContent.NPCType()) && npc.ai[3] >= (float)aiGateValue) { int tileCoordsX = (int)Main.player[npc.target].position.X / 16; int tileCoordsY = (int)Main.player[npc.target].position.Y / 16; @@ -21204,7 +21192,7 @@ namespace CalamityMod.NPCs { if (npc.type == NPCID.GoblinSorcerer || npc.type == NPCID.Tim) { - int num69 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 27, 0f, 0f, 100, default(Color), (float)Main.rand.Next(1, 3)); + int num69 = Dust.NewDust(npc.position, npc.width, npc.height, 27, 0f, 0f, 100, default(Color), (float)Main.rand.Next(1, 3)); Dust dust = Main.dust[num69]; dust.velocity *= 3f; if (Main.dust[num69].scale > 1f) @@ -21214,35 +21202,35 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.DarkCaster) { - int num70 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 172, 0f, 0f, 100, default(Color), 1.5f); + int num70 = Dust.NewDust(npc.position, npc.width, npc.height, 172, 0f, 0f, 100, default(Color), 1.5f); Dust dust = Main.dust[num70]; dust.velocity *= 3f; Main.dust[num70].noGravity = true; } else if (npc.type == NPCID.Necromancer || npc.type == NPCID.NecromancerArmored) { - int num71 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 0, default(Color), 1f); + int num71 = Dust.NewDust(npc.position, npc.width, npc.height, 173, 0f, 0f, 0, default(Color), 1f); Dust dust = Main.dust[num71]; dust.velocity *= 2f; Main.dust[num71].scale = 1.4f; } else if (npc.type == NPCID.DiabolistRed || npc.type == NPCID.DiabolistWhite) { - int num72 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 174, 0f, 0f, 100, default(Color), 1.5f); + int num72 = Dust.NewDust(npc.position, npc.width, npc.height, 174, 0f, 0f, 100, default(Color), 1.5f); Dust dust = Main.dust[num72]; dust.velocity *= 3f; Main.dust[num72].noGravity = true; } else if (npc.type == NPCID.RaggedCaster || npc.type == NPCID.RaggedCasterOpenCoat) { - int num73 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 175, 0f, 0f, 100, default(Color), 1.5f); + int num73 = Dust.NewDust(npc.position, npc.width, npc.height, 175, 0f, 0f, 100, default(Color), 1.5f); Dust dust = Main.dust[num73]; dust.velocity *= 3f; Main.dust[num73].noGravity = true; } else if (npc.type == NPCID.RuneWizard) { - int num74 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 106, 0f, 0f, 100, default(Color), 2.5f); + int num74 = Dust.NewDust(npc.position, npc.width, npc.height, 106, 0f, 0f, 100, default(Color), 2.5f); Dust dust = Main.dust[num74]; dust.velocity *= 3f; Main.dust[num74].noGravity = true; @@ -21256,7 +21244,7 @@ namespace CalamityMod.NPCs } else { - int num76 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default(Color), 2.5f); + int num76 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 100, default(Color), 2.5f); Dust dust = Main.dust[num76]; dust.velocity *= 3f; Main.dust[num76].noGravity = true; @@ -21274,7 +21262,7 @@ namespace CalamityMod.NPCs { if (npc.type == NPCID.GoblinSorcerer || npc.type == NPCID.Tim) { - int num78 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 27, 0f, 0f, 100, default(Color), (float)Main.rand.Next(1, 3)); + int num78 = Dust.NewDust(npc.position, npc.width, npc.height, 27, 0f, 0f, 100, default(Color), (float)Main.rand.Next(1, 3)); Dust dust = Main.dust[num78]; dust.velocity *= 3f; if (Main.dust[num78].scale > 1f) @@ -21284,35 +21272,35 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.DarkCaster) { - int num79 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 172, 0f, 0f, 100, default(Color), 1.5f); + int num79 = Dust.NewDust(npc.position, npc.width, npc.height, 172, 0f, 0f, 100, default(Color), 1.5f); Dust dust = Main.dust[num79]; dust.velocity *= 3f; Main.dust[num79].noGravity = true; } else if (npc.type == NPCID.RuneWizard) { - int num80 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 106, 0f, 0f, 100, default(Color), 2.5f); + int num80 = Dust.NewDust(npc.position, npc.width, npc.height, 106, 0f, 0f, 100, default(Color), 2.5f); Dust dust = Main.dust[num80]; dust.velocity *= 3f; Main.dust[num80].noGravity = true; } else if (npc.type == NPCID.Necromancer || npc.type == NPCID.NecromancerArmored) { - int num81 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 0, default(Color), 1f); + int num81 = Dust.NewDust(npc.position, npc.width, npc.height, 173, 0f, 0f, 0, default(Color), 1f); Dust dust = Main.dust[num81]; dust.velocity *= 2f; Main.dust[num81].scale = 1.4f; } else if (npc.type == NPCID.DiabolistRed || npc.type == NPCID.DiabolistWhite) { - int num82 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 174, 0f, 0f, 100, default(Color), 1.5f); + int num82 = Dust.NewDust(npc.position, npc.width, npc.height, 174, 0f, 0f, 100, default(Color), 1.5f); Dust dust = Main.dust[num82]; dust.velocity *= 3f; Main.dust[num82].noGravity = true; } else if (npc.type == NPCID.RaggedCaster || npc.type == NPCID.RaggedCasterOpenCoat) { - int num83 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 175, 0f, 0f, 100, default(Color), 1.5f); + int num83 = Dust.NewDust(npc.position, npc.width, npc.height, 175, 0f, 0f, 100, default(Color), 1.5f); Dust dust = Main.dust[num83]; dust.velocity *= 3f; Main.dust[num83].noGravity = true; @@ -21326,7 +21314,7 @@ namespace CalamityMod.NPCs } else { - int num85 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default(Color), 2.5f); + int num85 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 100, default(Color), 2.5f); Dust dust = Main.dust[num85]; dust.velocity *= 3f; Main.dust[num85].noGravity = true; @@ -21511,21 +21499,21 @@ namespace CalamityMod.NPCs num105 = num102 / num105; num103 *= num105; num104 *= num105; - int num106 = 16; - int num107 = 290; + int damage = 16; + int projType = ProjectileID.ShadowBeamHostile; if (npc.type == NPCID.DiabolistRed || npc.type == NPCID.DiabolistWhite) { - num107 = 291; - num106 = 32; + projType = ProjectileID.InfernoHostileBolt; + damage = 32; } if (npc.type == NPCID.RaggedCaster || npc.type == NPCID.RaggedCasterOpenCoat) { - num107 = 293; - num106 = 32; + projType = ProjectileID.LostSoulHostile; + damage = 32; } - int num108 = Projectile.NewProjectile(vector13.X, vector13.Y, num103, num104, num107, num106, 0f, Main.myPlayer, 0f, 0f); + int num108 = Projectile.NewProjectile(vector13.X, vector13.Y, num103, num104, projType, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num108].timeLeft = 300; - if (num107 == 291) + if (projType == ProjectileID.InfernoHostileBolt) { Main.projectile[num108].ai[0] = Main.player[npc.target].Center.X; Main.projectile[num108].ai[1] = Main.player[npc.target].Center.Y; @@ -21876,12 +21864,12 @@ namespace CalamityMod.NPCs { if (npc.type == NPCID.Hellbat || npc.type == NPCID.Lavabat) { - int num203 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 2f); + int num203 = Dust.NewDust(npc.position, npc.width, npc.height, 6, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default(Color), 2f); Main.dust[num203].noGravity = true; } if (npc.type == NPCID.IceBat && Main.rand.Next(10) == 0) { - int num204 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); + int num204 = Dust.NewDust(npc.position, npc.width, npc.height, 67, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); Main.dust[num204].noGravity = true; Dust dust = Main.dust[num204]; dust.velocity *= 0.2f; @@ -21983,7 +21971,8 @@ namespace CalamityMod.NPCs npc.type == NPCID.IlluminantBat || npc.type == NPCID.IceBat || npc.type == NPCID.Lavabat || - npc.type == NPCID.GiantFlyingFox) + npc.type == NPCID.GiantFlyingFox || + npc.type == ModContent.NPCType()) { maxSpeedX = 6f; maxSpeedY = 2.5f; @@ -22682,8 +22671,8 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient && flag17 && npc.ai[0] == 0f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { npc.ai[0] = 200f; - int num274 = 10; - int num275 = 31; + int damage = 10; + int projType = ProjectileID.SandBallFalling; int projAmt = Main.rand.Next(8, 14); if (Main.rand.NextBool(1000)) @@ -22693,7 +22682,7 @@ namespace CalamityMod.NPCs { num271 += (float)Main.rand.Next(-30, 31) * 0.05f; num272 += (float)Main.rand.Next(-30, 31) * 0.05f; - int num276 = Projectile.NewProjectile(vector32.X, vector32.Y, num271, num272, num275, num274, 0f, Main.myPlayer, 0f, 0f); + int num276 = Projectile.NewProjectile(vector32.X, vector32.Y, num271, num272, projType, damage, 0f, Main.myPlayer, 0f, 0f); Main.projectile[num276].ai[0] = 2f; Main.projectile[num276].timeLeft = 300; Main.projectile[num276].friendly = false; @@ -23011,9 +23000,9 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[3] == 32f && !Main.player[npc.target].npcTypeNoAggro[npc.type]) { - int num295 = 25; - int num296 = 84; - int num297 = Projectile.NewProjectile(vector33.X, vector33.Y, num292, num293, num296, num295, 0f, Main.myPlayer, 0f, 0f); + int damage = 25; + int projType = ProjectileID.PinkLaser; + int num297 = Projectile.NewProjectile(vector33.X, vector33.Y, num292, num293, projType, damage, 0f, Main.myPlayer, 0f, 0f); } num290 = 12; @@ -23100,9 +23089,9 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[3] == 16f) { - int num304 = 45; - int num305 = 128; - int num306 = Projectile.NewProjectile(vector34.X, vector34.Y, num301, num302, num305, num304, 0f, Main.myPlayer, 0f, 0f); + int dmg = 45; + int projType = ProjectileID.FrostBlastHostile; + int num306 = Projectile.NewProjectile(vector34.X, vector34.Y, num301, num302, projType, dmg, 0f, Main.myPlayer, 0f, 0f); } num290 = 15; @@ -23157,9 +23146,9 @@ namespace CalamityMod.NPCs num311 = num307 / num311; num308 *= num311; num310 *= num311; - int num312 = 40; - int num313 = 288; - int num314 = Projectile.NewProjectile(vector35.X, vector35.Y, num308, num310, num313, num312, 0f, Main.myPlayer, 0f, 0f); + int dmg = 40; + int projType = ProjectileID.GoldenShowerHostile; + int num314 = Projectile.NewProjectile(vector35.X, vector35.Y, num308, num310, projType, dmg, 0f, Main.myPlayer, 0f, 0f); } } } @@ -23673,22 +23662,22 @@ namespace CalamityMod.NPCs { if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npc.type && Math.Abs(npc.position.X - Main.npc[i].position.X) + Math.Abs(npc.position.Y - Main.npc[i].position.Y) < (float)npc.width) { - if (npc.position.X < Main.npc[i].position.X) - { - npc.velocity.X = npc.velocity.X - 0.05f; - } - else - { - npc.velocity.X = npc.velocity.X + 0.05f; - } - if (npc.position.Y < Main.npc[i].position.Y) - { - npc.velocity.Y = npc.velocity.Y - 0.05f; - } - else - { - npc.velocity.Y = npc.velocity.Y + 0.05f; - } + if (npc.position.X < Main.npc[i].position.X) + { + npc.velocity.X -= 0.05f; + } + else + { + npc.velocity.X += 0.05f; + } + if (npc.position.Y < Main.npc[i].position.Y) + { + npc.velocity.Y -= 0.05f; + } + else + { + npc.velocity.Y += 0.05f; + } } } if (flag4) @@ -23824,16 +23813,16 @@ namespace CalamityMod.NPCs } } } - else if (npc.type == NPCID.Wolf || npc.type == NPCID.Hellhound) + else if (npc.type == NPCID.Wolf || npc.type == NPCID.Hellhound || npc.type == ModContent.NPCType()) { if (npc.velocity.Y == 0f && num4 < 100f && Math.Abs(npc.velocity.X) > 3f && ((npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) && npc.velocity.X > 0f) || (npc.position.X + (float)(npc.width / 2) > Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) && npc.velocity.X < 0f))) { - npc.velocity.Y = npc.velocity.Y - 6f; + npc.velocity.Y -= 6f; } } else if (npc.type == NPCID.Tumbleweed && npc.velocity.Y == 0f && Math.Abs(npc.velocity.X) > 3f && ((npc.Center.X < Main.player[npc.target].Center.X && npc.velocity.X > 0f) || (npc.Center.X > Main.player[npc.target].Center.X && npc.velocity.X < 0f))) { - npc.velocity.Y = npc.velocity.Y - 6f; + npc.velocity.Y -= 6f; Main.PlaySound(SoundID.NPCHit, npc.Center, 11); } @@ -23881,45 +23870,45 @@ namespace CalamityMod.NPCs float num7 = 0.1f; if (!flag && (npc.velocity.Y == 0f || npc.wet || (npc.velocity.X <= 0f && npc.direction < 0) || (npc.velocity.X >= 0f && npc.direction > 0))) { - if (npc.type == NPCID.Wolf) + if (npc.type == NPCID.Wolf || npc.type == ModContent.NPCType()) { if (npc.velocity.X > 0f && npc.direction < 0) { - npc.velocity.X = npc.velocity.X * 0.9f; + npc.velocity.X *= 0.9f; } if (npc.velocity.X < 0f && npc.direction > 0) { - npc.velocity.X = npc.velocity.X * 0.9f; + npc.velocity.X *= 0.9f; } } else if (npc.type == NPCID.Hellhound) { if (npc.velocity.X > 0f && npc.direction < 0) { - npc.velocity.X = npc.velocity.X * 0.8f; + npc.velocity.X *= 0.8f; } if (npc.velocity.X < 0f && npc.direction > 0) { - npc.velocity.X = npc.velocity.X * 0.8f; + npc.velocity.X *= 0.8f; } if (npc.direction > 0 && npc.velocity.X < 3f) { - npc.velocity.X = npc.velocity.X + 0.15f; + npc.velocity.X += 0.15f; } if (npc.direction < 0 && npc.velocity.X > -3f) { - npc.velocity.X = npc.velocity.X - 0.15f; + npc.velocity.X -= 0.15f; } } else if (npc.type == NPCID.HeadlessHorseman) { if (npc.velocity.X > 0f && npc.direction < 0) { - npc.velocity.X = npc.velocity.X * 0.9f; + npc.velocity.X *= 0.9f; } if (npc.velocity.X < 0f && npc.direction > 0) { - npc.velocity.X = npc.velocity.X * 0.9f; + npc.velocity.X *= 0.9f; } if (npc.velocity.X < -num6 || npc.velocity.X > num6) { @@ -23930,7 +23919,7 @@ namespace CalamityMod.NPCs } else if (npc.velocity.X < num6 && npc.direction == 1) { - npc.velocity.X = npc.velocity.X + 0.1f; + npc.velocity.X += 0.1f; if (npc.velocity.X > num6) { npc.velocity.X = num6; @@ -23938,7 +23927,7 @@ namespace CalamityMod.NPCs } else if (npc.velocity.X > -num6 && npc.direction == -1) { - npc.velocity.X = npc.velocity.X - 0.1f; + npc.velocity.X -= 0.1f; if (npc.velocity.X < -num6) { npc.velocity.X = -num6; @@ -23949,7 +23938,7 @@ namespace CalamityMod.NPCs { if (Math.Sign(npc.velocity.X) != npc.direction) { - npc.velocity.X = npc.velocity.X * 0.8f; + npc.velocity.X *= 0.8f; } num7 = 0.2f; } @@ -23957,7 +23946,7 @@ namespace CalamityMod.NPCs { if (Math.Sign(npc.velocity.X) != npc.direction) { - npc.velocity.X = npc.velocity.X * 0.8f; + npc.velocity.X *= 0.8f; } num6 = 12f; num7 = 0.2f; @@ -23966,7 +23955,7 @@ namespace CalamityMod.NPCs { if (Math.Sign(npc.velocity.X) != npc.direction) { - npc.velocity.X = npc.velocity.X * 0.9f; + npc.velocity.X *= 0.9f; } float num8 = MathHelper.Lerp(0.6f, 1f, Math.Abs(Main.windSpeedSet)) * (float)Math.Sign(Main.windSpeedSet); if (!Main.player[npc.target].ZoneSandstorm) @@ -24235,7 +24224,7 @@ namespace CalamityMod.NPCs if (npc.type == NPCID.IceTortoise && Main.rand.Next(10) == 0) { - int num537 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); + int num537 = Dust.NewDust(npc.position, npc.width, npc.height, 67, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); Main.dust[num537].noGravity = true; Dust dust = Main.dust[num537]; dust.velocity *= 0.2f; @@ -24463,7 +24452,7 @@ namespace CalamityMod.NPCs { if (npc.type == NPCID.IceTortoise && Main.rand.Next(3) < 2) { - int num549 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 67, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); + int num549 = Dust.NewDust(npc.position, npc.width, npc.height, 67, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default(Color), 1.5f); Main.dust[num549].noGravity = true; Dust dust = Main.dust[num549]; dust.velocity *= 0.2f; @@ -24744,239 +24733,243 @@ namespace CalamityMod.NPCs } #endregion - #region Spider AI - public static bool BuffedSpiderAI(NPC npc, Mod mod) - { - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead) - { - npc.TargetClosest(true); - } - float num567 = 3f; - float num568 = 0.12f; - if (npc.type == NPCID.DesertScorpionWall) - { - num567 = 6f; - num568 = 0.24f; - } - Vector2 vector70 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num569 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); - float num570 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); - num569 = (float)((int)(num569 / 8f) * 8); - num570 = (float)((int)(num570 / 8f) * 8); - vector70.X = (float)((int)(vector70.X / 8f) * 8); - vector70.Y = (float)((int)(vector70.Y / 8f) * 8); - num569 -= vector70.X; - num570 -= vector70.Y; - float num571 = (float)Math.Sqrt((double)(num569 * num569 + num570 * num570)); - if (num571 == 0f) - { - num569 = npc.velocity.X; - num570 = npc.velocity.Y; - } - else - { - num571 = num567 / num571; - num569 *= num571; - num570 *= num571; - } - if (Main.player[npc.target].dead) - { - num569 = (float)npc.direction * num567 / 2f; - num570 = -num567 / 2f; - } - npc.spriteDirection = -1; - if (!Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - npc.ai[0] += 1f; - if (npc.ai[0] > 0f) - { - npc.velocity.Y = npc.velocity.Y + 0.023f; - } - else - { - npc.velocity.Y = npc.velocity.Y - 0.023f; - } - if (npc.ai[0] < -100f || npc.ai[0] > 100f) - { - npc.velocity.X = npc.velocity.X + 0.023f; - } - else - { - npc.velocity.X = npc.velocity.X - 0.023f; - } - if (npc.ai[0] > 200f) - { - npc.ai[0] = -200f; - } - npc.velocity.X = npc.velocity.X + num569 * 0.009f; - npc.velocity.Y = npc.velocity.Y + num570 * 0.009f; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if ((double)npc.velocity.X > 2.5) - { - npc.velocity.X = npc.velocity.X * 0.9f; - } - if ((double)npc.velocity.X < -2.5) - { - npc.velocity.X = npc.velocity.X * 0.9f; - } - if ((double)npc.velocity.Y > 2.5) - { - npc.velocity.Y = npc.velocity.Y * 0.9f; - } - if ((double)npc.velocity.Y < -2.5) - { - npc.velocity.Y = npc.velocity.Y * 0.9f; - } - if (npc.velocity.X > 4f) - { - npc.velocity.X = 4f; - } - if (npc.velocity.X < -4f) - { - npc.velocity.X = -4f; - } - if (npc.velocity.Y > 4f) - { - npc.velocity.Y = 4f; - } - if (npc.velocity.Y < -4f) - { - npc.velocity.Y = -4f; - } - } - else - { - if (npc.velocity.X < num569) - { - npc.velocity.X = npc.velocity.X + num568; - if (npc.velocity.X < 0f && num569 > 0f) - { - npc.velocity.X = npc.velocity.X + num568; - } - } - else if (npc.velocity.X > num569) - { - npc.velocity.X = npc.velocity.X - num568; - if (npc.velocity.X > 0f && num569 < 0f) - { - npc.velocity.X = npc.velocity.X - num568; - } - } - if (npc.velocity.Y < num570) - { - npc.velocity.Y = npc.velocity.Y + num568; - if (npc.velocity.Y < 0f && num570 > 0f) - { - npc.velocity.Y = npc.velocity.Y + num568; - } - } - else if (npc.velocity.Y > num570) - { - npc.velocity.Y = npc.velocity.Y - num568; - if (npc.velocity.Y > 0f && num570 < 0f) - { - npc.velocity.Y = npc.velocity.Y - num568; - } - } - npc.rotation = (float)Math.Atan2((double)num570, (double)num569); - } - if (npc.type == NPCID.DesertScorpionWall) - { - npc.rotation += MathHelper.PiOver2; - } - float num572 = 0.5f; - if (npc.collideX) - { - npc.netUpdate = true; - npc.velocity.X = npc.oldVelocity.X * -num572; - if (npc.direction == -1 && npc.velocity.X > 0f && npc.velocity.X < 2f) - { - npc.velocity.X = 2f; - } - if (npc.direction == 1 && npc.velocity.X < 0f && npc.velocity.X > -2f) - { - npc.velocity.X = -2f; - } - } - if (npc.collideY) - { - npc.netUpdate = true; - npc.velocity.Y = npc.oldVelocity.Y * -num572; - if (npc.velocity.Y > 0f && (double)npc.velocity.Y < 1.5) - { - npc.velocity.Y = 2f; - } - if (npc.velocity.Y < 0f && (double)npc.velocity.Y > -1.5) - { - npc.velocity.Y = -2f; - } - } - if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) - { - npc.netUpdate = true; - } - if (Main.netMode != NetmodeID.MultiplayerClient) - { - if (Main.netMode != NetmodeID.MultiplayerClient && npc.target >= 0 && (npc.type == NPCID.BlackRecluse || npc.type == NPCID.BlackRecluseWall) && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) - { - npc.localAI[0] += 1f; - if (npc.localAI[0] > (float)Main.rand.Next(180, 600)) - { - npc.localAI[0] = 0f; - Vector2 vector71 = Main.player[npc.target].Center - npc.Center; - vector71.Normalize(); - vector71 *= 8f; - int num573 = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector71.X, vector71.Y, ProjectileID.WebSpit, 18, 0f, Main.myPlayer, 0f, 0f); - } - } - int num574 = (int)npc.Center.X / 16; - int num575 = (int)npc.Center.Y / 16; - bool flag36 = false; - int num; - for (int num576 = num574 - 1; num576 <= num574 + 1; num576 = num + 1) - { - for (int num577 = num575 - 1; num577 <= num575 + 1; num577 = num + 1) - { - if (Main.tile[num576, num577] == null) - { - return false; - } - if (Main.tile[num576, num577].wall > 0) - { - flag36 = true; - } - num = num577; - } - num = num576; - } - if (!flag36) - { - if (npc.type == NPCID.JungleCreeperWall) - { - npc.Transform(NPCID.JungleCreeper); - return false; - } - if (npc.type == NPCID.BlackRecluseWall) - { - npc.Transform(NPCID.BlackRecluse); - return false; - } - if (npc.type == NPCID.BloodCrawlerWall) - { - npc.Transform(NPCID.BloodCrawler); - return false; - } - if (npc.type == NPCID.DesertScorpionWall) - { - npc.Transform(NPCID.DesertScorpionWalk); - return false; - } - npc.Transform(NPCID.WallCreeper); - } - } - return false; - } - #endregion + #region Spider AI + public static bool BuffedSpiderAI(NPC npc, Mod mod) + { + //Find a target + if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead) + { + npc.TargetClosest(true); + } + + float speed = 3f; + float mvtAdjust = 0.12f; + if (npc.type == NPCID.DesertScorpionWall) + { + speed = 6f; + mvtAdjust = 0.24f; + } + + //Calculate how to reach the target + Vector2 npcPos = npc.Center; + Vector2 targetPos = Main.player[npc.target].Center; + targetPos.X = (float)((int)(targetPos.X / 8f) * 8); + targetPos.Y = (float)((int)(targetPos.Y / 8f) * 8); + npcPos.X = (float)((int)(npcPos.X / 8f) * 8); + npcPos.Y = (float)((int)(npcPos.Y / 8f) * 8); + targetPos.X -= npcPos.X; + targetPos.Y -= npcPos.Y; + float targetDist = targetPos.Length(); + if (targetDist == 0f) + { + targetPos.X = npc.velocity.X; + targetPos.Y = npc.velocity.Y; + } + else + { + targetDist = speed / targetDist; + targetPos.X *= targetDist; + targetPos.Y *= targetDist; + } + + //If the target is dead, nobody cares + if (Main.player[npc.target].dead) + { + targetPos.X = (float)npc.direction * speed / 2f; + targetPos.Y = -speed / 2f; + } + + //Sprite direction + npc.spriteDirection = -1; + + //If you can't see the target, wander around + if (!Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + npc.ai[0] += 1f; + if (npc.ai[0] > 0f) + { + npc.velocity.Y += 0.023f; + } + else + { + npc.velocity.Y -= 0.023f; + } + if (npc.ai[0] < -100f || npc.ai[0] > 100f) + { + npc.velocity.X += 0.023f; + } + else + { + npc.velocity.X -= 0.023f; + } + if (npc.ai[0] > 200f) + { + npc.ai[0] = -200f; + } + npc.velocity.X += targetPos.X * 0.009f; + npc.velocity.Y += targetPos.Y * 0.009f; + npc.rotation = npc.velocity.ToRotation(); + if (npc.velocity.X > 2.5f) + { + npc.velocity.X *= 0.9f; + } + if (npc.velocity.X < -2.5f) + { + npc.velocity.X *= 0.9f; + } + if (npc.velocity.Y > 2.5f) + { + npc.velocity.Y *= 0.9f; + } + if (npc.velocity.Y < -2.5f) + { + npc.velocity.Y *= 0.9f; + } + npc.velocity.X = MathHelper.Clamp(npc.velocity.X, -4f, 4f); + npc.velocity.Y = MathHelper.Clamp(npc.velocity.Y, -4f, 4f); + } + //If target is in sight, move toward target + else + { + if (npc.velocity.X < targetPos.X) + { + npc.velocity.X += mvtAdjust; + if (npc.velocity.X < 0f && targetPos.X > 0f) + { + npc.velocity.X += mvtAdjust; + } + } + else if (npc.velocity.X > targetPos.X) + { + npc.velocity.X -= mvtAdjust; + if (npc.velocity.X > 0f && targetPos.X < 0f) + { + npc.velocity.X -= mvtAdjust; + } + } + if (npc.velocity.Y < targetPos.Y) + { + npc.velocity.Y += mvtAdjust; + if (npc.velocity.Y < 0f && targetPos.Y > 0f) + { + npc.velocity.Y += mvtAdjust; + } + } + else if (npc.velocity.Y > targetPos.Y) + { + npc.velocity.Y -= mvtAdjust; + if (npc.velocity.Y > 0f && targetPos.Y < 0f) + { + npc.velocity.Y -= mvtAdjust; + } + } + npc.rotation = targetPos.ToRotation(); + } + + //Desert Scorpion has a different sprite orientation + if (npc.type == NPCID.DesertScorpionWall) + { + npc.rotation += MathHelper.PiOver2; + } + + //Wall collision behavior? + float half = 0.5f; + if (npc.collideX) + { + npc.netUpdate = true; + npc.velocity.X = npc.oldVelocity.X * -half; + if (npc.direction == -1 && npc.velocity.X > 0f && npc.velocity.X < 2f) + { + npc.velocity.X = 2f; + } + if (npc.direction == 1 && npc.velocity.X < 0f && npc.velocity.X > -2f) + { + npc.velocity.X = -2f; + } + } + if (npc.collideY) + { + npc.netUpdate = true; + npc.velocity.Y = npc.oldVelocity.Y * -half; + if (npc.velocity.Y > 0f && npc.velocity.Y < 1.5f) + { + npc.velocity.Y = 2f; + } + if (npc.velocity.Y < 0f && npc.velocity.Y > -1.5f) + { + npc.velocity.Y = -2f; + } + } + + //Net update for changing directions + if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) + { + npc.netUpdate = true; + } + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + //Black Recluses shoot Web Spit + if (Main.netMode != NetmodeID.MultiplayerClient && npc.target >= 0 && (npc.type == NPCID.BlackRecluse || npc.type == NPCID.BlackRecluseWall) && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) + { + npc.localAI[0] += 1f; + if (npc.localAI[0] > (float)Main.rand.Next(180, 600)) + { + npc.localAI[0] = 0f; + Vector2 velocity = Main.player[npc.target].Center - npc.Center; + velocity.Normalize(); + velocity *= 8f; + Projectile.NewProjectile(npc.Center, velocity, ProjectileID.WebSpit, 18, 0f, Main.myPlayer, 0f, 0f); + } + } + + //Check for walls + int npcX = (int)npc.Center.X / 16; + int npcY = (int)npc.Center.Y / 16; + bool climbingWall = false; + for (int i = npcX - 1; i <= npcX + 1; i++) + { + for (int j = npcY - 1; j <= npcY + 1; j++) + { + if (Main.tile[i, j] == null) + { + return false; + } + if (Main.tile[i, j].wall > 0) + { + climbingWall = true; + } + } + } + //If not on a wall, transform to fighter form + if (!climbingWall) + { + if (npc.type == NPCID.JungleCreeperWall) + { + npc.Transform(NPCID.JungleCreeper); + return false; + } + if (npc.type == NPCID.BlackRecluseWall) + { + npc.Transform(NPCID.BlackRecluse); + return false; + } + if (npc.type == NPCID.BloodCrawlerWall) + { + npc.Transform(NPCID.BloodCrawler); + return false; + } + if (npc.type == NPCID.DesertScorpionWall) + { + npc.Transform(NPCID.DesertScorpionWalk); + return false; + } + npc.Transform(NPCID.WallCreeper); + } + } + return false; + } + #endregion #region Herpling AI public static bool BuffedHerplingAI(NPC npc, Mod mod) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index a0a77e51e4..1f812460ae 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -1875,7 +1875,7 @@ namespace CalamityMod.NPCs break; case 3: if (npc.type == NPCType() || npc.type == NPCType() || - npc.type == NPCType()) + npc.type == NPCType() || npc.type == NPCType()) { return CalamityGlobalAI.BuffedFighterAI(npc, mod); } @@ -2151,7 +2151,7 @@ namespace CalamityMod.NPCs } break; case 14: - if (npc.type == NPCType()) + if (npc.type == NPCType() || npc.type == NPCType() || npc.type == NPCType() || npc.type == NPCType()) { return CalamityGlobalAI.BuffedBatAI(npc, mod); } @@ -2258,27 +2258,41 @@ namespace CalamityMod.NPCs } break; case 26: - switch (npc.type) + if (npc.type == NPCType()) { - case NPCID.Unicorn: - case NPCID.Wolf: - case NPCID.HeadlessHorseman: - case NPCID.Hellhound: - case NPCID.StardustSpiderSmall: - case NPCID.NebulaBeast: - case NPCID.Tumbleweed: - return CalamityGlobalAI.BuffedUnicornAI(npc, mod); + return CalamityGlobalAI.BuffedUnicornAI(npc, mod); + } + else + { + switch (npc.type) + { + case NPCID.Unicorn: + case NPCID.Wolf: + case NPCID.HeadlessHorseman: + case NPCID.Hellhound: + case NPCID.StardustSpiderSmall: + case NPCID.NebulaBeast: + case NPCID.Tumbleweed: + return CalamityGlobalAI.BuffedUnicornAI(npc, mod); + } } break; case 39: - switch (npc.type) + if (npc.type == NPCType() || npc.type == NPCType()) { - case NPCID.GiantTortoise: - case NPCID.IceTortoise: - case NPCID.GiantShelly: - case NPCID.GiantShelly2: - case NPCID.SolarSroller: - return CalamityGlobalAI.BuffedTortoiseAI(npc, mod); + return CalamityGlobalAI.BuffedTortoiseAI(npc, mod); + } + else + { + switch (npc.type) + { + case NPCID.GiantTortoise: + case NPCID.IceTortoise: + case NPCID.GiantShelly: + case NPCID.GiantShelly2: + case NPCID.SolarSroller: + return CalamityGlobalAI.BuffedTortoiseAI(npc, mod); + } } break; case 40: @@ -2293,11 +2307,18 @@ namespace CalamityMod.NPCs } break; case 41: - switch (npc.type) + if (npc.type == NPCType()) { - case NPCID.Herpling: - case NPCID.Derpling: - return CalamityGlobalAI.BuffedHerplingAI(npc, mod); + return CalamityGlobalAI.BuffedHerplingAI(npc, mod); + } + else + { + switch (npc.type) + { + case NPCID.Herpling: + case NPCID.Derpling: + return CalamityGlobalAI.BuffedHerplingAI(npc, mod); + } } break; case 44: @@ -4089,7 +4110,7 @@ namespace CalamityMod.NPCs { pool.Clear(); - if (!(CalamityWorld.downedPolterghast && CalamityWorld.acidRainPoints == 2)) + if (!(CalamityWorld.downedPolterghast && CalamityWorld.acidRainPoints == 1)) { Dictionary PossibleEnemies = AcidRainEvent.PossibleEnemiesPreHM; Dictionary PossibleMinibosses = new Dictionary(); @@ -4151,6 +4172,10 @@ namespace CalamityMod.NPCs } } } + if (NPC.CountNPCS(NPCType()) >= AcidRainEvent.MaxNuclearToadCount) + { + pool.Remove(NPCType()); + } } } } @@ -4302,7 +4327,7 @@ namespace CalamityMod.NPCs { if (Main.rand.Next(5) < 4) { - int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, 173, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.5f); + int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, (int)CalamityDusts.PurpleCosmolite, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.5f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.2f; Main.dust[dust].velocity.Y -= 0.15f; @@ -4340,7 +4365,7 @@ namespace CalamityMod.NPCs { int num3 = Utils.SelectRandom(Main.rand, new int[] { - 173, + (int)CalamityDusts.PurpleCosmolite, 27, 234 }); @@ -4376,7 +4401,7 @@ namespace CalamityMod.NPCs { if (Main.rand.Next(5) < 4) { - int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, 173, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.5f); + int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, (int)CalamityDusts.PurpleCosmolite, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.5f); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 1.2f; Main.dust[dust].velocity.Y -= 0.15f; @@ -5845,7 +5870,7 @@ namespace CalamityMod.NPCs #region Any Events public static bool AnyEvents(Player player) { - if (Main.invasionType > 0) + if (Main.invasionType > InvasionID.None) return true; if (player.PillarZone()) return true; diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 0addaf402a..741b64d5c7 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -825,6 +825,7 @@ namespace CalamityMod.NPCs break; case NPCID.ArmoredSkeleton: + case NPCID.HeavySkeleton: DropHelper.DropItemChance(npc, ItemID.BeamSword, DropHelper.DefiledDropRateInt); DropHelper.DropItemChance(npc, ItemID.ArmorPolish, DropHelper.DefiledDropRateInt); break; @@ -1076,7 +1077,7 @@ namespace CalamityMod.NPCs } // Every type of Skeleton counts for the Bone Sword - if (CalamityMod.skeletonList.Contains(npc.type) && npc.type != NPCID.ArmoredSkeleton && npc.type != NPCID.SkeletonArcher && npc.type != NPCID.GreekSkeleton) + if (CalamityMod.skeletonList.Contains(npc.type) && npc.type != NPCID.ArmoredSkeleton && npc.type != NPCID.HeavySkeleton && npc.type != NPCID.SkeletonArcher && npc.type != NPCID.GreekSkeleton) { DropHelper.DropItemChance(npc, ItemID.BoneSword, DropHelper.DefiledDropRateInt); } @@ -1760,6 +1761,8 @@ namespace CalamityMod.NPCs case NPCID.MotherSlime: case NPCID.CorruptSlime: case NPCID.Crimslime: + case NPCID.BigCrimslime: + case NPCID.LittleCrimslime: DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 3 : 4); break; diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 63f055e6b2..34800902fa 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -1,3 +1,4 @@ +using CalamityMod.Dusts; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -189,7 +190,7 @@ namespace CalamityMod.NPCs.CeaselessVoid } for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -201,7 +202,7 @@ namespace CalamityMod.NPCs.CeaselessVoid npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -211,10 +212,10 @@ namespace CalamityMod.NPCs.CeaselessVoid } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } float randomSpread = (float)(Main.rand.Next(-200, 200) / 100); diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index a33a56a3f2..1a283e79e3 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Projectiles.Rogue; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -295,7 +296,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/CeaselessVoid/DarkEnergy2.cs b/NPCs/CeaselessVoid/DarkEnergy2.cs index 5f8fdde09f..85aa5d6b60 100644 --- a/NPCs/CeaselessVoid/DarkEnergy2.cs +++ b/NPCs/CeaselessVoid/DarkEnergy2.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Projectiles.Rogue; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -252,7 +253,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/CeaselessVoid/DarkEnergy3.cs b/NPCs/CeaselessVoid/DarkEnergy3.cs index 96fc70b461..6bc3a791d9 100644 --- a/NPCs/CeaselessVoid/DarkEnergy3.cs +++ b/NPCs/CeaselessVoid/DarkEnergy3.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Projectiles.Rogue; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -280,7 +281,7 @@ namespace CalamityMod.NPCs.CeaselessVoid { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Crags/CalamityEye.cs b/NPCs/Crags/CalamityEye.cs index c362fd2c33..bebda2e086 100644 --- a/NPCs/Crags/CalamityEye.cs +++ b/NPCs/Crags/CalamityEye.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.Crags npc.defense = 12; npc.lifeMax = 140; npc.knockBackResist = 0f; - animationType = 2; + animationType = NPCID.DemonEye; npc.value = Item.buyPrice(0, 0, 5, 0); npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; @@ -40,56 +40,57 @@ namespace CalamityMod.NPCs.Crags } banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void AI() { if ((double) npc.life < (double) npc.lifeMax * 0.5) { - if (npc.direction == -1 && (double) npc.velocity.X > -6.0) + if (npc.direction == -1 && npc.velocity.X > -6f) { npc.velocity.X -= 0.1f; - if ((double) npc.velocity.X > 6.0) + if (npc.velocity.X > 6f) npc.velocity.X -= 0.1f; - else if ((double) npc.velocity.X > 0.0) + else if (npc.velocity.X > 0f) npc.velocity.X += 0.05f; - if ((double) npc.velocity.X < -6.0) + if (npc.velocity.X < -6f) npc.velocity.X = -6f; } - else if (npc.direction == 1 && (double) npc.velocity.X < 6.0) + else if (npc.direction == 1 && npc.velocity.X < 6f) { npc.velocity.X += 0.1f; - if ((double) npc.velocity.X < -6.0) + if (npc.velocity.X < -6f) npc.velocity.X += 0.1f; - else if ((double) npc.velocity.X < 0.0) + else if (npc.velocity.X < 0f) npc.velocity.X -= 0.05f; - if ((double) npc.velocity.X > 6.0) + if (npc.velocity.X > 6f) npc.velocity.X = 6f; } - if (npc.directionY == -1 && (double) npc.velocity.Y > -4.0) + if (npc.directionY == -1 && npc.velocity.Y > -4f) { npc.velocity.Y -= 0.1f; - if ((double) npc.velocity.Y > 4.0) + if (npc.velocity.Y > 4f) npc.velocity.Y -= 0.1f; - else if ((double) npc.velocity.Y > 0.0) + else if (npc.velocity.Y > 0f) npc.velocity.Y += 0.05f; - if ((double) npc.velocity.Y < -4.0) + if (npc.velocity.Y < -4f) npc.velocity.Y = -4f; } - else if (npc.directionY == 1 && (double) npc.velocity.Y < 4.0) + else if (npc.directionY == 1 && npc.velocity.Y < 4f) { npc.velocity.Y += 0.1f; - if ((double) npc.velocity.Y < -4.0) + if (npc.velocity.Y < -4f) npc.velocity.Y += 0.1f; - else if ((double) npc.velocity.Y < 0.0) + else if (npc.velocity.Y < 0f) npc.velocity.Y -= 0.05f; - if ((double) npc.velocity.Y > 4.0) + if (npc.velocity.Y > 4f) npc.velocity.Y = 4f; } } if (Main.rand.NextBool(40)) { - int index = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + (float) npc.height * 0.25f), npc.width, (int) ((double) npc.height * 0.5), 5, npc.velocity.X, 2f, 0, new Color(), 1f); + int index = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + npc.height * 0.25f), npc.width, (int)(npc.height * 0.5), DustID.Blood, npc.velocity.X, 2f, 0, new Color(), 1f); Main.dust[index].velocity.X *= 0.5f; Main.dust[index].velocity.Y *= 0.1f; } @@ -99,13 +100,13 @@ namespace CalamityMod.NPCs.Crags { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Crags/CharredSlime.cs b/NPCs/Crags/CharredSlime.cs index 58a3c729ea..526bcf8c21 100644 --- a/NPCs/Crags/CharredSlime.cs +++ b/NPCs/Crags/CharredSlime.cs @@ -20,14 +20,14 @@ namespace CalamityMod.NPCs.Crags public override void SetDefaults() { npc.aiStyle = 1; - aiType = 59; + aiType = NPCID.LavaSlime; npc.damage = 40; npc.width = 40; npc.height = 30; npc.defense = 10; npc.lifeMax = 250; npc.knockBackResist = 0f; - animationType = 81; + animationType = NPCID.CorruptSlime; npc.value = Item.buyPrice(0, 0, 5, 0); npc.alpha = 50; npc.lavaImmune = true; diff --git a/NPCs/Crags/CultistAssassin.cs b/NPCs/Crags/CultistAssassin.cs index 724a9d55a8..24c7f826ca 100644 --- a/NPCs/Crags/CultistAssassin.cs +++ b/NPCs/Crags/CultistAssassin.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.Crags npc.defense = 25; npc.lifeMax = 80; npc.knockBackResist = 0.5f; - animationType = 331; + animationType = NPCID.ZombieXmas; aiType = NPCID.ChaosElemental; npc.value = Item.buyPrice(0, 0, 2, 0); npc.HitSound = SoundID.NPCHit1; @@ -39,6 +39,7 @@ namespace CalamityMod.NPCs.Crags } banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -50,13 +51,13 @@ namespace CalamityMod.NPCs.Crags { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Crags/DespairStone.cs b/NPCs/Crags/DespairStone.cs index 35905612e1..251247e904 100644 --- a/NPCs/Crags/DespairStone.cs +++ b/NPCs/Crags/DespairStone.cs @@ -40,11 +40,12 @@ namespace CalamityMod.NPCs.Crags } banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void AI() { - CalamityAI.UnicornAI(npc, mod, true, 4f, 5f, 0.2f); + CalamityAI.UnicornAI(npc, mod, true, CalamityWorld.death ? 6f : 4f, 5f, 0.2f); } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/Crags/Scryllar.cs b/NPCs/Crags/Scryllar.cs index e626cc9ebf..91305387a5 100644 --- a/NPCs/Crags/Scryllar.cs +++ b/NPCs/Crags/Scryllar.cs @@ -42,6 +42,7 @@ namespace CalamityMod.NPCs.Crags } banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void AI() diff --git a/NPCs/Crags/ScryllarRage.cs b/NPCs/Crags/ScryllarRage.cs index 2728702026..f7a841f738 100644 --- a/NPCs/Crags/ScryllarRage.cs +++ b/NPCs/Crags/ScryllarRage.cs @@ -42,6 +42,7 @@ namespace CalamityMod.NPCs.Crags } banner = ModContent.NPCType(); bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void AI() diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index e20eb2e1ba..8cedfd6327 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -155,7 +155,7 @@ namespace CalamityMod.NPCs.DesertScourge } for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -165,7 +165,7 @@ namespace CalamityMod.NPCs.DesertScourge Gore.NewGore(npc.position, npc.velocity * randomSpread * Main.rand.NextFloat(), mod.GetGoreSlot("Gores/ScourgeBody3"), 1f); for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DesertScourgeBodySmall.cs b/NPCs/DesertScourge/DesertScourgeBodySmall.cs index 1982f7c16b..7bef5630c7 100644 --- a/NPCs/DesertScourge/DesertScourgeBodySmall.cs +++ b/NPCs/DesertScourge/DesertScourgeBodySmall.cs @@ -75,7 +75,7 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -85,7 +85,7 @@ namespace CalamityMod.NPCs.DesertScourge Gore.NewGore(npc.position, npc.velocity * randomSpread * Main.rand.NextFloat(), mod.GetGoreSlot("Gores/ScourgeBody3"), 0.65f); for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index c658ed67f3..61d0ad9f40 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -550,7 +550,7 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -558,7 +558,7 @@ namespace CalamityMod.NPCs.DesertScourge Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScourgeHead2"), 1f); for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DesertScourgeHeadSmall.cs b/NPCs/DesertScourge/DesertScourgeHeadSmall.cs index aa8e5e76d0..25528fcf66 100644 --- a/NPCs/DesertScourge/DesertScourgeHeadSmall.cs +++ b/NPCs/DesertScourge/DesertScourgeHeadSmall.cs @@ -384,7 +384,7 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -392,7 +392,7 @@ namespace CalamityMod.NPCs.DesertScourge Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScourgeHead2"), 0.65f); for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index 84063668b7..f338fd7bbc 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -97,14 +97,14 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScourgeTail"), 1f); for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DesertScourgeTailSmall.cs b/NPCs/DesertScourge/DesertScourgeTailSmall.cs index 9fd5a57d92..2a6e06b42f 100644 --- a/NPCs/DesertScourge/DesertScourgeTailSmall.cs +++ b/NPCs/DesertScourge/DesertScourgeTailSmall.cs @@ -65,14 +65,14 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScourgeTail"), 0.65f); for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DriedSeekerBody.cs b/NPCs/DesertScourge/DriedSeekerBody.cs index e9e86211b6..620dcce6b3 100644 --- a/NPCs/DesertScourge/DriedSeekerBody.cs +++ b/NPCs/DesertScourge/DriedSeekerBody.cs @@ -62,13 +62,13 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DriedSeekerHead.cs b/NPCs/DesertScourge/DriedSeekerHead.cs index 27683c9688..0ec7821427 100644 --- a/NPCs/DesertScourge/DriedSeekerHead.cs +++ b/NPCs/DesertScourge/DriedSeekerHead.cs @@ -86,13 +86,13 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DesertScourge/DriedSeekerTail.cs b/NPCs/DesertScourge/DriedSeekerTail.cs index e457c5fbc6..95d0b199ce 100644 --- a/NPCs/DesertScourge/DriedSeekerTail.cs +++ b/NPCs/DesertScourge/DriedSeekerTail.cs @@ -57,13 +57,13 @@ namespace CalamityMod.NPCs.DesertScourge { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 53d65a157f..98b47a838e 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -266,7 +267,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -276,10 +277,10 @@ namespace CalamityMod.NPCs.DevourerofGods } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/DevourerofGods/DevourerofGodsBody2.cs b/NPCs/DevourerofGods/DevourerofGodsBody2.cs index 49e7842aff..412d3e4725 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody2.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody2.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; @@ -202,7 +203,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -212,10 +213,10 @@ namespace CalamityMod.NPCs.DevourerofGods } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/DevourerofGods/DevourerofGodsBodyS.cs b/NPCs/DevourerofGods/DevourerofGodsBodyS.cs index 310a107306..a79f6498cc 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBodyS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBodyS.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -259,7 +260,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -269,10 +270,10 @@ namespace CalamityMod.NPCs.DevourerofGods } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 2d3962f967..831c712dcc 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -811,7 +812,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -821,10 +822,10 @@ namespace CalamityMod.NPCs.DevourerofGods } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/DevourerofGods/DevourerofGodsHead2.cs b/NPCs/DevourerofGods/DevourerofGodsHead2.cs index de1a59f493..5692d8a2c4 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead2.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead2.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -366,7 +367,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -376,10 +377,10 @@ namespace CalamityMod.NPCs.DevourerofGods } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs index 532ca4481e..e1be7e17f6 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; @@ -910,7 +911,7 @@ namespace CalamityMod.NPCs.DevourerofGods dustVelocity = dustVelocityScalar / dustVelocity; dustVelocityX *= dustVelocity; dustVelocityY *= dustVelocity; - int dust = Dust.NewDust(new Vector2(dustPositionX, dustPositionY), scale, scale, 173, 0f, 0f, 100, default, 5f); + int dust = Dust.NewDust(new Vector2(dustPositionX, dustPositionY), scale, scale, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 5f); Main.dust[dust].noGravity = true; Main.dust[dust].position.X = targetVector.X; Main.dust[dust].position.Y = targetVector.Y; @@ -1133,7 +1134,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.position.Y = npc.position.Y - (npc.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -1143,10 +1144,10 @@ namespace CalamityMod.NPCs.DevourerofGods } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index d6706e9658..ddd575f3af 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -206,7 +207,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -216,10 +217,10 @@ namespace CalamityMod.NPCs.DevourerofGods } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/DevourerofGods/DevourerofGodsTail2.cs b/NPCs/DevourerofGods/DevourerofGodsTail2.cs index b30a865677..7f29baaf87 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail2.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail2.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; @@ -189,7 +190,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -199,10 +200,10 @@ namespace CalamityMod.NPCs.DevourerofGods } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/DevourerofGods/DevourerofGodsTailS.cs b/NPCs/DevourerofGods/DevourerofGodsTailS.cs index 0efaec6923..7d16ef4faf 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTailS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTailS.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; @@ -286,7 +287,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -296,10 +297,10 @@ namespace CalamityMod.NPCs.DevourerofGods } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 2f9341f382..13f47fd4eb 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -627,7 +627,7 @@ namespace CalamityMod.NPCs.GreatSandShark { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { diff --git a/NPCs/HiveMind/DankCreeper.cs b/NPCs/HiveMind/DankCreeper.cs index 07f0ca0afc..6a31dc6592 100644 --- a/NPCs/HiveMind/DankCreeper.cs +++ b/NPCs/HiveMind/DankCreeper.cs @@ -28,7 +28,6 @@ namespace CalamityMod.NPCs.HiveMind } npc.aiStyle = -1; aiType = -1; - animationType = 10; npc.knockBackResist = CalamityWorld.bossRushActive ? 0f : 0.3f; npc.noGravity = true; npc.noTileCollide = true; diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index 9418c4ebbb..0b4adc9986 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -184,13 +184,13 @@ namespace CalamityMod.NPCs.Leviathan { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 3fd0f5cfe7..3cd80f7221 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -557,7 +557,7 @@ namespace CalamityMod.NPCs.Leviathan { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index 794bd507c7..baf1a4517f 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -96,7 +96,7 @@ namespace CalamityMod.NPCs.Leviathan { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } else diff --git a/NPCs/Leviathan/Parasea.cs b/NPCs/Leviathan/Parasea.cs index cccfd93c34..8d8be97359 100644 --- a/NPCs/Leviathan/Parasea.cs +++ b/NPCs/Leviathan/Parasea.cs @@ -72,13 +72,13 @@ namespace CalamityMod.NPCs.Leviathan { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index d04dc1678d..a2ef7193da 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -717,7 +717,7 @@ namespace CalamityMod.NPCs.Leviathan public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 3; k++) - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); if (npc.life <= 0) { @@ -728,7 +728,7 @@ namespace CalamityMod.NPCs.Leviathan Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren5"), 1f); for (int k = 0; k < 50; k++) - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } diff --git a/NPCs/Leviathan/SirenClone.cs b/NPCs/Leviathan/SirenClone.cs index 4a891a1c89..cee08a3ab8 100644 --- a/NPCs/Leviathan/SirenClone.cs +++ b/NPCs/Leviathan/SirenClone.cs @@ -90,7 +90,7 @@ namespace CalamityMod.NPCs.Leviathan { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { diff --git a/NPCs/NormalNPCs/AeroSlime.cs b/NPCs/NormalNPCs/AeroSlime.cs index 11e8df88bc..7735463328 100644 --- a/NPCs/NormalNPCs/AeroSlime.cs +++ b/NPCs/NormalNPCs/AeroSlime.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.defense = 6; npc.lifeMax = 50; npc.knockBackResist = 0f; - animationType = 121; + animationType = NPCID.Slimer; npc.value = Item.buyPrice(0, 0, 1, 0); npc.alpha = 50; npc.lavaImmune = false; @@ -33,6 +33,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath1; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/NormalNPCs/AngryDog.cs b/NPCs/NormalNPCs/AngryDog.cs index a2c220b9b6..7ba85e8ff2 100644 --- a/NPCs/NormalNPCs/AngryDog.cs +++ b/NPCs/NormalNPCs/AngryDog.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.lifeMax = 1000; } npc.knockBackResist = 0.3f; - animationType = 329; + animationType = NPCID.Hellhound; aiType = -1; npc.value = Item.buyPrice(0, 0, 3, 0); npc.HitSound = mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/AngryDogHit"); @@ -41,6 +41,7 @@ namespace CalamityMod.NPCs.NormalNPCs banner = npc.type; bannerItem = ModContent.ItemType(); npc.coldDamage = true; + npc.buffImmune[BuffID.Confused] = false; } public override void SendExtraAI(BinaryWriter writer) @@ -73,10 +74,10 @@ namespace CalamityMod.NPCs.NormalNPCs { npc.ai[1] += 1f; } - CalamityAI.UnicornAI(npc, mod, true, 4f, 5f, 0.2f); + CalamityAI.UnicornAI(npc, mod, true, CalamityWorld.death ? 6f : 4f, 5f, 0.2f); return; } - CalamityAI.UnicornAI(npc, mod, false, 4f, 6f, 0.07f); + CalamityAI.UnicornAI(npc, mod, false, CalamityWorld.death ? 6f : 4f, 6f, CalamityWorld.death ? 0.1f : 0.07f); } public override void FindFrame(int frameHeight) @@ -132,13 +133,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/ArmoredDiggerBody.cs b/NPCs/NormalNPCs/ArmoredDiggerBody.cs index 9b6eb621cc..7feddec199 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerBody.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerBody.cs @@ -134,13 +134,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Fire, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Fire, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index 1a9c9fcad1..2d4385f171 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -399,13 +399,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Fire, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Fire, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/ArmoredDiggerTail.cs b/NPCs/NormalNPCs/ArmoredDiggerTail.cs index d2b51d0fc9..2dd4a7fdb8 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerTail.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerTail.cs @@ -123,13 +123,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Fire, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Fire, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/BlightedEye.cs b/NPCs/NormalNPCs/BlightedEye.cs index eba03f078a..0cd9c5ef53 100644 --- a/NPCs/NormalNPCs/BlightedEye.cs +++ b/NPCs/NormalNPCs/BlightedEye.cs @@ -16,32 +16,33 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.aiStyle = 2; - aiType = 116; + aiType = NPCID.TheHungryII; npc.damage = 32; npc.width = 30; npc.height = 32; npc.defense = 8; npc.lifeMax = 120; npc.knockBackResist = 0.6f; - animationType = 2; + animationType = NPCID.DemonEye; npc.value = Item.buyPrice(0, 0, 2, 0); npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/BloomSlime.cs b/NPCs/NormalNPCs/BloomSlime.cs index 6e13b87c8f..ac35a6f3c6 100644 --- a/NPCs/NormalNPCs/BloomSlime.cs +++ b/NPCs/NormalNPCs/BloomSlime.cs @@ -18,14 +18,14 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.aiStyle = 1; - aiType = 141; + aiType = NPCID.ToxicSludge; npc.damage = 80; npc.width = 40; npc.height = 30; npc.defense = 25; npc.lifeMax = 1000; npc.knockBackResist = 0f; - animationType = 81; + animationType = NPCID.CorruptSlime; npc.value = Item.buyPrice(0, 0, 25, 0); npc.alpha = 50; npc.lavaImmune = false; @@ -35,6 +35,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath1; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/NormalNPCs/Bohldohr.cs b/NPCs/NormalNPCs/Bohldohr.cs index 28c66dc461..41b76c135b 100644 --- a/NPCs/NormalNPCs/Bohldohr.cs +++ b/NPCs/NormalNPCs/Bohldohr.cs @@ -28,11 +28,12 @@ namespace CalamityMod.NPCs.NormalNPCs npc.behindTiles = true; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void AI() { - CalamityAI.UnicornAI(npc, mod, true, 4f, 5f, 0.2f); + CalamityAI.UnicornAI(npc, mod, true, CalamityWorld.death ? 6f : 4f, 5f, 0.2f); } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/NormalNPCs/Cnidrion.cs b/NPCs/NormalNPCs/Cnidrion.cs index 37a74c4614..49274cd525 100644 --- a/NPCs/NormalNPCs/Cnidrion.cs +++ b/NPCs/NormalNPCs/Cnidrion.cs @@ -282,7 +282,7 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { diff --git a/NPCs/NormalNPCs/CosmicElemental.cs b/NPCs/NormalNPCs/CosmicElemental.cs index 6cee0687c6..8436758e3d 100644 --- a/NPCs/NormalNPCs/CosmicElemental.cs +++ b/NPCs/NormalNPCs/CosmicElemental.cs @@ -24,12 +24,13 @@ namespace CalamityMod.NPCs.NormalNPCs npc.defense = 10; npc.lifeMax = 25; npc.knockBackResist = 0.5f; - animationType = 483; + animationType = NPCID.GraniteFlyer; npc.value = Item.buyPrice(0, 0, 3, 0); npc.HitSound = SoundID.NPCHit7; npc.DeathSound = SoundID.NPCDeath6; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/NormalNPCs/CrimulanBlightSlime.cs b/NPCs/NormalNPCs/CrimulanBlightSlime.cs index be666662c0..8b66fe1c81 100644 --- a/NPCs/NormalNPCs/CrimulanBlightSlime.cs +++ b/NPCs/NormalNPCs/CrimulanBlightSlime.cs @@ -17,14 +17,14 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.aiStyle = 1; - aiType = 71; + aiType = NPCID.DungeonSlime; npc.damage = 30; npc.width = 60; npc.height = 42; npc.defense = 8; npc.lifeMax = 130; npc.knockBackResist = 0.3f; - animationType = 244; + animationType = NPCID.RainbowSlime; npc.value = Item.buyPrice(0, 0, 2, 0); npc.alpha = 105; npc.lavaImmune = false; @@ -33,6 +33,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.buffImmune[BuffID.OnFire] = true; + npc.buffImmune[BuffID.Confused] = false; banner = npc.type; bannerItem = ModContent.ItemType(); } @@ -50,13 +51,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 40; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/CryoSlime.cs b/NPCs/NormalNPCs/CryoSlime.cs index f280c59aaf..143f6375f2 100644 --- a/NPCs/NormalNPCs/CryoSlime.cs +++ b/NPCs/NormalNPCs/CryoSlime.cs @@ -17,14 +17,14 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.aiStyle = 1; - aiType = 71; + aiType = NPCID.DungeonSlime; npc.damage = 30; npc.width = 40; npc.height = 30; npc.defense = 8; npc.lifeMax = 120; npc.knockBackResist = 0f; - animationType = 81; + animationType = NPCID.CorruptSlime; npc.value = Item.buyPrice(0, 0, 5, 0); npc.alpha = 50; npc.lavaImmune = false; @@ -34,6 +34,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath1; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/NormalNPCs/Cryon.cs b/NPCs/NormalNPCs/Cryon.cs index 1a31a56967..0c1faa63a0 100644 --- a/NPCs/NormalNPCs/Cryon.cs +++ b/NPCs/NormalNPCs/Cryon.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -31,11 +32,12 @@ namespace CalamityMod.NPCs.NormalNPCs banner = npc.type; bannerItem = ModContent.ItemType(); npc.coldDamage = true; + npc.buffImmune[BuffID.Confused] = false; } public override void AI() { - CalamityAI.UnicornAI(npc, mod, false, 4f, 5f, 0.1f); + CalamityAI.UnicornAI(npc, mod, false, CalamityWorld.death ? 6f : 4f, 5f, CalamityWorld.death ? 0.15f : 0.1f); } public override void FindFrame(int frameHeight) diff --git a/NPCs/NormalNPCs/EbonianBlightSlime.cs b/NPCs/NormalNPCs/EbonianBlightSlime.cs index d297573336..ef34eb3210 100644 --- a/NPCs/NormalNPCs/EbonianBlightSlime.cs +++ b/NPCs/NormalNPCs/EbonianBlightSlime.cs @@ -16,14 +16,14 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.aiStyle = 1; - aiType = 71; + aiType = NPCID.DungeonSlime; npc.damage = 30; npc.width = 60; npc.height = 42; npc.defense = 8; npc.lifeMax = 130; npc.knockBackResist = 0.3f; - animationType = 244; + animationType = NPCID.RainbowSlime; npc.value = Item.buyPrice(0, 0, 2, 0); npc.alpha = 105; npc.lavaImmune = false; @@ -32,6 +32,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; npc.buffImmune[BuffID.OnFire] = true; + npc.buffImmune[BuffID.Confused] = false; banner = npc.type; bannerItem = ModContent.ItemType(); } diff --git a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs index 9c066e63d5..5842f5c532 100644 --- a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs +++ b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs @@ -33,6 +33,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath1; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void AI() @@ -426,13 +427,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/Frogfish.cs b/NPCs/NormalNPCs/Frogfish.cs index 7e5361b647..1cd38c0b95 100644 --- a/NPCs/NormalNPCs/Frogfish.cs +++ b/NPCs/NormalNPCs/Frogfish.cs @@ -116,13 +116,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/HeatSpirit.cs b/NPCs/NormalNPCs/HeatSpirit.cs index 4564954fe6..b2f8bc4b9a 100644 --- a/NPCs/NormalNPCs/HeatSpirit.cs +++ b/NPCs/NormalNPCs/HeatSpirit.cs @@ -30,6 +30,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath55; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index 2d08d1d703..cda681d088 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -130,41 +130,13 @@ namespace CalamityMod.NPCs.NormalNPCs } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Fire, 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, 6, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Fire, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - for (int num625 = 0; num625 < 3; num625++) - { - float scaleFactor10 = 0.33f; - if (num625 == 1) - { - scaleFactor10 = 0.66f; - } - if (num625 == 2) - { - scaleFactor10 = 1f; - } - int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Gore gore = Main.gore[num626]; - gore.velocity *= scaleFactor10; - gore.velocity.X += 1f; - gore.velocity.Y += 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - gore.velocity *= scaleFactor10; - gore.velocity.X -= 1f; - gore.velocity.Y += 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - gore.velocity *= scaleFactor10; - gore.velocity.X += 1f; - gore.velocity.Y -= 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - gore.velocity *= scaleFactor10; - gore.velocity.X -= 1f; - gore.velocity.Y -= 1f; - } + npc.ExplosionGores(3); } } diff --git a/NPCs/NormalNPCs/ImpiousImmolator.cs b/NPCs/NormalNPCs/ImpiousImmolator.cs index 220d8c8551..abd4505594 100644 --- a/NPCs/NormalNPCs/ImpiousImmolator.cs +++ b/NPCs/NormalNPCs/ImpiousImmolator.cs @@ -1,3 +1,6 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Summon; @@ -38,6 +41,17 @@ namespace CalamityMod.NPCs.NormalNPCs } npc.buffImmune[BuffID.Ichor] = false; npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[BuffID.StardustMinionBleed] = false; + npc.buffImmune[BuffID.BetsysCurse] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.value = Item.buyPrice(0, 0, 50, 0); npc.HitSound = SoundID.NPCHit5; npc.DeathSound = SoundID.NPCDeath7; @@ -275,13 +289,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/MantisShrimp.cs b/NPCs/NormalNPCs/MantisShrimp.cs index 37796796aa..12c9971693 100644 --- a/NPCs/NormalNPCs/MantisShrimp.cs +++ b/NPCs/NormalNPCs/MantisShrimp.cs @@ -24,11 +24,12 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DR_NERD(0.1f); npc.lifeMax = 30; npc.aiStyle = 3; - aiType = 67; + aiType = NPCID.Crab; npc.value = Item.buyPrice(0, 0, 1, 0); npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - npc.buffImmune[189] = true; + npc.buffImmune[BuffID.Daybreak] = true; + npc.buffImmune[BuffID.Confused] = false; banner = npc.type; bannerItem = ModContent.ItemType(); } @@ -114,13 +115,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/OverloadedSoldier.cs b/NPCs/NormalNPCs/OverloadedSoldier.cs index 2653eca75d..ccd11d6933 100644 --- a/NPCs/NormalNPCs/OverloadedSoldier.cs +++ b/NPCs/NormalNPCs/OverloadedSoldier.cs @@ -1,6 +1,7 @@ using System; using Microsoft.Xna.Framework; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; @@ -34,6 +35,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath2; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void FindFrame(int frameHeight) @@ -420,13 +422,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/PerennialSlime.cs b/NPCs/NormalNPCs/PerennialSlime.cs index 529ea759e7..a0d29f1d89 100644 --- a/NPCs/NormalNPCs/PerennialSlime.cs +++ b/NPCs/NormalNPCs/PerennialSlime.cs @@ -16,14 +16,14 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.aiStyle = 1; - aiType = 141; + aiType = NPCID.ToxicSludge; npc.damage = 35; npc.width = 40; npc.height = 30; npc.defense = 12; npc.lifeMax = 150; npc.knockBackResist = 0f; - animationType = 81; + animationType = NPCID.CorruptSlime; npc.value = Item.buyPrice(0, 0, 10, 0); npc.alpha = 50; npc.lavaImmune = false; @@ -33,6 +33,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath1; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/NormalNPCs/PhantomDebris.cs b/NPCs/NormalNPCs/PhantomDebris.cs index 09743b48e9..307a98e315 100644 --- a/NPCs/NormalNPCs/PhantomDebris.cs +++ b/NPCs/NormalNPCs/PhantomDebris.cs @@ -1,6 +1,7 @@ using System; using Microsoft.Xna.Framework; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; @@ -34,6 +35,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath36; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void FindFrame(int frameHeight) @@ -414,13 +416,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/PhantomSpirit.cs b/NPCs/NormalNPCs/PhantomSpirit.cs index 73dd268e20..1a237a85a5 100644 --- a/NPCs/NormalNPCs/PhantomSpirit.cs +++ b/NPCs/NormalNPCs/PhantomSpirit.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; @@ -25,7 +26,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.defense = 10; npc.lifeMax = 1000; npc.knockBackResist = 0.1f; - animationType = 288; + animationType = NPCID.DungeonSpirit; aiType = -1; npc.value = Item.buyPrice(0, 0, 20, 0); npc.HitSound = SoundID.NPCHit36; @@ -40,7 +41,7 @@ namespace CalamityMod.NPCs.NormalNPCs { float speed = CalamityWorld.death ? 22f : 17f; CalamityAI.DungeonSpiritAI(npc, mod, speed, -MathHelper.PiOver2); - int num822 = Dust.NewDust(npc.position, npc.width, npc.height, 60, 0f, 0f, 0, default, 1f); + int num822 = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num822]; dust.velocity *= 0.1f; dust.scale = 1.3f; @@ -59,13 +60,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int num288 = 0; num288 < 50; num288++) { - int num289 = Dust.NewDust(npc.position, npc.width, npc.height, 60, npc.velocity.X, npc.velocity.Y, 0, default, 1f); + int num289 = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, npc.velocity.X, npc.velocity.Y, 0, default, 1f); Dust dust = Main.dust[num289]; dust.velocity *= 2f; dust.noGravity = true; diff --git a/NPCs/NormalNPCs/PhantomSpiritL.cs b/NPCs/NormalNPCs/PhantomSpiritL.cs index 62e1a60e31..bed39fe1d6 100644 --- a/NPCs/NormalNPCs/PhantomSpiritL.cs +++ b/NPCs/NormalNPCs/PhantomSpiritL.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Projectiles.Boss; @@ -50,7 +51,7 @@ namespace CalamityMod.NPCs.NormalNPCs { float speed = CalamityWorld.death ? 16f : 12f; CalamityAI.DungeonSpiritAI(npc, mod, speed, -MathHelper.PiOver2); - int num822 = Dust.NewDust(npc.position, npc.width, npc.height, 60, 0f, 0f, 0, default, 1f); + int num822 = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num822]; dust.velocity *= 0.1f; dust.scale = 1.3f; @@ -107,13 +108,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int num288 = 0; num288 < 50; num288++) { - int num289 = Dust.NewDust(npc.position, npc.width, npc.height, 60, npc.velocity.X, npc.velocity.Y, 0, default, 1f); + int num289 = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, npc.velocity.X, npc.velocity.Y, 0, default, 1f); Dust dust = Main.dust[num289]; dust.velocity *= 2f; dust.noGravity = true; diff --git a/NPCs/NormalNPCs/PhantomSpiritM.cs b/NPCs/NormalNPCs/PhantomSpiritM.cs index 956c2a36fa..ec683308b2 100644 --- a/NPCs/NormalNPCs/PhantomSpiritM.cs +++ b/NPCs/NormalNPCs/PhantomSpiritM.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; @@ -48,7 +49,7 @@ namespace CalamityMod.NPCs.NormalNPCs { float speed = CalamityWorld.death ? 18f : 13.5f; CalamityAI.DungeonSpiritAI(npc, mod, speed, -MathHelper.PiOver2); - int num822 = Dust.NewDust(npc.position, npc.width, npc.height, 60, 0f, 0f, 0, default, 1f); + int num822 = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num822]; dust.velocity *= 0.1f; dust.scale = 1.3f; @@ -68,13 +69,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int num288 = 0; num288 < 50; num288++) { - int num289 = Dust.NewDust(npc.position, npc.width, npc.height, 60, npc.velocity.X, npc.velocity.Y, 0, default, 1f); + int num289 = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, npc.velocity.X, npc.velocity.Y, 0, default, 1f); Dust dust = Main.dust[num289]; dust.velocity *= 2f; dust.noGravity = true; diff --git a/NPCs/NormalNPCs/PhantomSpiritS.cs b/NPCs/NormalNPCs/PhantomSpiritS.cs index 94b477f755..27d89ddb87 100644 --- a/NPCs/NormalNPCs/PhantomSpiritS.cs +++ b/NPCs/NormalNPCs/PhantomSpiritS.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; @@ -47,7 +48,7 @@ namespace CalamityMod.NPCs.NormalNPCs { float speed = CalamityWorld.death ? 20f : 15f; CalamityAI.DungeonSpiritAI(npc, mod, speed, -MathHelper.PiOver2); - int num822 = Dust.NewDust(npc.position, npc.width, npc.height, 60, 0f, 0f, 0, default, 1f); + int num822 = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, 0f, 0f, 0, default, 1f); Dust dust = Main.dust[num822]; dust.velocity *= 0.1f; dust.scale = 1.3f; @@ -66,13 +67,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 60, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int num288 = 0; num288 < 50; num288++) { - int num289 = Dust.NewDust(npc.position, npc.width, npc.height, 60, npc.velocity.X, npc.velocity.Y, 0, default, 1f); + int num289 = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Phantoplasm, npc.velocity.X, npc.velocity.Y, 0, default, 1f); Dust dust = Main.dust[num289]; dust.velocity *= 2f; dust.noGravity = true; diff --git a/NPCs/NormalNPCs/Piggy.cs b/NPCs/NormalNPCs/Piggy.cs index 6fd3803528..c0b7ad111f 100644 --- a/NPCs/NormalNPCs/Piggy.cs +++ b/NPCs/NormalNPCs/Piggy.cs @@ -18,13 +18,12 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { npc.chaseable = false; - npc.aiStyle = 26; npc.damage = 0; npc.width = 26; npc.height = 26; npc.lifeMax = 2000; npc.aiStyle = 7; - aiType = 299; + aiType = NPCID.Squirrel; npc.knockBackResist = 0.99f; npc.value = Item.buyPrice(0, 10, 0, 0); npc.HitSound = SoundID.NPCHit1; @@ -89,13 +88,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/Pitbull.cs b/NPCs/NormalNPCs/Pitbull.cs index e2a2fba6a4..304f6eef89 100644 --- a/NPCs/NormalNPCs/Pitbull.cs +++ b/NPCs/NormalNPCs/Pitbull.cs @@ -22,13 +22,14 @@ namespace CalamityMod.NPCs.NormalNPCs npc.defense = 4; npc.lifeMax = 60; npc.knockBackResist = 0.3f; - animationType = 329; + animationType = NPCID.Hellhound; aiType = NPCID.Wolf; npc.value = Item.buyPrice(0, 0, 2, 0); npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath5; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -49,13 +50,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/PlagueBee.cs b/NPCs/NormalNPCs/PlagueBee.cs index dedb958099..51b21d9229 100644 --- a/NPCs/NormalNPCs/PlagueBee.cs +++ b/NPCs/NormalNPCs/PlagueBee.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; @@ -27,9 +28,9 @@ namespace CalamityMod.NPCs.NormalNPCs npc.scale = 0.5f; npc.lifeMax = 200; npc.aiStyle = 5; - aiType = 210; + aiType = NPCID.Bee; npc.knockBackResist = 0f; - animationType = 210; + animationType = NPCID.Bee; npc.value = Item.buyPrice(0, 0, 5, 0); npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; @@ -123,13 +124,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/PlagueBeeLarge.cs b/NPCs/NormalNPCs/PlagueBeeLarge.cs index 0a5279d8b1..0ce7d36fcb 100644 --- a/NPCs/NormalNPCs/PlagueBeeLarge.cs +++ b/NPCs/NormalNPCs/PlagueBeeLarge.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; @@ -26,9 +27,9 @@ namespace CalamityMod.NPCs.NormalNPCs npc.scale = 0.75f; npc.lifeMax = 300; npc.aiStyle = 5; - aiType = 210; + aiType = NPCID.Bee; npc.knockBackResist = 0f; - animationType = 210; + animationType = NPCID.Bee; npc.value = Item.buyPrice(0, 0, 10, 0); npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; @@ -122,13 +123,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/PlaguedDerpling.cs b/NPCs/NormalNPCs/PlaguedDerpling.cs index 4d1bf5158c..a10ac307c4 100644 --- a/NPCs/NormalNPCs/PlaguedDerpling.cs +++ b/NPCs/NormalNPCs/PlaguedDerpling.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; @@ -146,11 +147,10 @@ namespace CalamityMod.NPCs.NormalNPCs npc.netUpdate = true; } int num13 = Dust.NewDust(new Vector2(npc.position.X - npc.velocity.X, npc.position.Y - npc.velocity.Y), npc.width, npc.height, 46, npc.velocity.X * 0.2f, npc.velocity.Y * 0.2f, 100, default, 2f); - Main.dust[num13].noGravity = true; - Dust expr_F26_cp_0 = Main.dust[num13]; - expr_F26_cp_0.velocity.X *= 0.3f; - Dust expr_F44_cp_0 = Main.dust[num13]; - expr_F44_cp_0.velocity.Y *= 0.3f; + Dust dust = Main.dust[num13]; + dust.noGravity = true; + dust.velocity.X *= 0.3f; + dust.velocity.Y *= 0.3f; } public override float SpawnChance(NPCSpawnInfo spawnInfo) @@ -171,13 +171,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Viruling"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Viruling2"), 1f); diff --git a/NPCs/NormalNPCs/PlaguedFlyingFox.cs b/NPCs/NormalNPCs/PlaguedFlyingFox.cs index 0e6c836e9d..3f15f43f35 100644 --- a/NPCs/NormalNPCs/PlaguedFlyingFox.cs +++ b/NPCs/NormalNPCs/PlaguedFlyingFox.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Terraria; @@ -18,8 +19,8 @@ namespace CalamityMod.NPCs.NormalNPCs { npc.npcSlots = 0.5f; npc.aiStyle = 14; - aiType = 152; - animationType = 152; + aiType = NPCID.GiantFlyingFox; + animationType = NPCID.GiantFlyingFox; npc.damage = 55; npc.width = 38; npc.height = 34; @@ -57,13 +58,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/PlaguedJungleSlime.cs b/NPCs/NormalNPCs/PlaguedJungleSlime.cs index 1708341dfa..916954369d 100644 --- a/NPCs/NormalNPCs/PlaguedJungleSlime.cs +++ b/NPCs/NormalNPCs/PlaguedJungleSlime.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Projectiles.Boss; @@ -28,7 +29,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.defense = 12; npc.lifeMax = 350; npc.knockBackResist = 0f; - animationType = 81; + animationType = NPCID.CorruptSlime; npc.value = Item.buyPrice(0, 0, 10, 0); npc.alpha = 60; npc.lavaImmune = false; @@ -115,13 +116,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/PlaguedTortoise.cs b/NPCs/NormalNPCs/PlaguedTortoise.cs index d4cadecabf..ae45c380f3 100644 --- a/NPCs/NormalNPCs/PlaguedTortoise.cs +++ b/NPCs/NormalNPCs/PlaguedTortoise.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Terraria; @@ -24,20 +25,16 @@ namespace CalamityMod.NPCs.NormalNPCs npc.defense = 32; npc.lifeMax = 800; npc.knockBackResist = 0.2f; - animationType = 153; + animationType = NPCID.GiantTortoise; npc.value = Item.buyPrice(0, 0, 20, 0); npc.HitSound = SoundID.NPCHit24; npc.DeathSound = SoundID.NPCDeath27; npc.noGravity = false; - npc.buffImmune[189] = true; - npc.buffImmune[153] = true; - npc.buffImmune[70] = true; - npc.buffImmune[69] = true; - npc.buffImmune[39] = true; - npc.buffImmune[24] = true; - npc.buffImmune[20] = true; + npc.buffImmune[BuffID.ShadowFlame] = true; + npc.buffImmune[BuffID.Venom] = true; + npc.buffImmune[BuffID.OnFire] = true; + npc.buffImmune[BuffID.Poisoned] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; banner = npc.type; bannerItem = ModContent.ItemType(); @@ -47,13 +44,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/ProfanedEnergyBody.cs b/NPCs/NormalNPCs/ProfanedEnergyBody.cs index 79c8c213ed..8593724ceb 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyBody.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyBody.cs @@ -1,3 +1,4 @@ +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Terraria; @@ -66,13 +67,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/ProfanedEnergyLantern.cs b/NPCs/NormalNPCs/ProfanedEnergyLantern.cs index d4cc3fcc53..ed4f99cf74 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyLantern.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyLantern.cs @@ -1,3 +1,4 @@ +using CalamityMod.Dusts; using CalamityMod.Projectiles.Boss; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -227,7 +228,7 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/SandTortoise.cs b/NPCs/NormalNPCs/SandTortoise.cs index 1f08cf8a7a..7ec3232751 100644 --- a/NPCs/NormalNPCs/SandTortoise.cs +++ b/NPCs/NormalNPCs/SandTortoise.cs @@ -24,26 +24,27 @@ namespace CalamityMod.NPCs.NormalNPCs npc.scale = 1.5f; npc.lifeMax = 580; npc.knockBackResist = 0.2f; - animationType = 153; + animationType = NPCID.GiantTortoise; npc.value = Item.buyPrice(0, 0, 15, 0); npc.HitSound = SoundID.NPCHit24; npc.DeathSound = SoundID.NPCDeath27; npc.noGravity = false; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index d5cd1f51e2..bf44d5a9bb 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -1,3 +1,6 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; @@ -33,6 +36,17 @@ namespace CalamityMod.NPCs.NormalNPCs } npc.buffImmune[BuffID.Ichor] = false; npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[BuffID.StardustMinionBleed] = false; + npc.buffImmune[BuffID.BetsysCurse] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.lavaImmune = true; npc.value = Item.buyPrice(0, 0, 50, 0); npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/ScornDeath"); @@ -170,13 +184,13 @@ namespace CalamityMod.NPCs.NormalNPCs } for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScornEater"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScornEater2"), 1f); diff --git a/NPCs/NormalNPCs/SeaUrchin.cs b/NPCs/NormalNPCs/SeaUrchin.cs index 81f65f4314..c4cc6ec4ce 100644 --- a/NPCs/NormalNPCs/SeaUrchin.cs +++ b/NPCs/NormalNPCs/SeaUrchin.cs @@ -29,6 +29,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.behindTiles = true; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void AI() @@ -59,13 +60,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/StormlionCharger.cs b/NPCs/NormalNPCs/StormlionCharger.cs index 78954750dc..4eb682ee86 100644 --- a/NPCs/NormalNPCs/StormlionCharger.cs +++ b/NPCs/NormalNPCs/StormlionCharger.cs @@ -24,25 +24,26 @@ namespace CalamityMod.NPCs.NormalNPCs npc.defense = 8; npc.lifeMax = 80; npc.knockBackResist = 0.2f; - animationType = 508; + animationType = NPCID.WalkingAntlion; npc.value = Item.buyPrice(0, 0, 2, 0); npc.HitSound = SoundID.NPCHit31; npc.DeathSound = SoundID.NPCDeath34; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/SunBat.cs b/NPCs/NormalNPCs/SunBat.cs index 3738c615ef..7506a805c1 100644 --- a/NPCs/NormalNPCs/SunBat.cs +++ b/NPCs/NormalNPCs/SunBat.cs @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.NormalNPCs { npc.lavaImmune = true; npc.aiStyle = 14; - aiType = 151; + aiType = NPCID.Lavabat; npc.damage = 35; npc.width = 26; npc.height = 20; @@ -30,6 +30,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath4; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void FindFrame(int frameHeight) diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index 22a827bbf5..3f8a47f067 100644 --- a/NPCs/NormalNPCs/Sunskater.cs +++ b/NPCs/NormalNPCs/Sunskater.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; +using Microsoft.Xna.Framework; using System; using System.IO; using Terraria; @@ -100,42 +101,28 @@ namespace CalamityMod.NPCs.NormalNPCs npc.TargetClosest(true); npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.15f; npc.velocity.Y = npc.velocity.Y + (float)npc.directionY * 0.15f; - if (npc.velocity.X > 10f) - { - npc.velocity.X = 10f; - } - if (npc.velocity.X < -10f) - { - npc.velocity.X = -10f; - } - if (npc.velocity.Y > 10f) - { - npc.velocity.Y = 10f; - } - if (npc.velocity.Y < -10f) - { - npc.velocity.Y = -10f; - } + npc.velocity.X = MathHelper.Clamp(npc.velocity.X, -10f, 10f); + npc.velocity.Y = MathHelper.Clamp(npc.velocity.Y, -10f, 10f); } else { - npc.velocity.X = npc.velocity.X + (float)npc.direction * 0.1f; + npc.velocity.X += (float)npc.direction * 0.1f; if (npc.velocity.X < -2f || npc.velocity.X > 2f) { - npc.velocity.X = npc.velocity.X * 0.95f; + npc.velocity.X *= 0.95f; } if (npc.ai[0] == -1f) { - npc.velocity.Y = npc.velocity.Y - 0.01f; - if ((double)npc.velocity.Y < -0.3) + npc.velocity.Y -= 0.01f; + if (npc.velocity.Y < -0.3f) { npc.ai[0] = 1f; } } else { - npc.velocity.Y = npc.velocity.Y + 0.01f; - if ((double)npc.velocity.Y > 0.3) + npc.velocity.Y += 0.01f; + if (npc.velocity.Y > 0.3f) { npc.ai[0] = -1f; } @@ -166,17 +153,17 @@ namespace CalamityMod.NPCs.NormalNPCs npc.ai[0] = -1f; } } - if ((double)npc.velocity.Y > 0.4 || (double)npc.velocity.Y < -0.4) + if (npc.velocity.Y > 0.4f || npc.velocity.Y < -0.4f) { - npc.velocity.Y = npc.velocity.Y * 0.95f; + npc.velocity.Y *= 0.95f; } } else { if (npc.velocity.Y == 0f) { - npc.velocity.X = npc.velocity.X * 0.94f; - if ((double)npc.velocity.X > -0.2 && (double)npc.velocity.X < 0.2) + npc.velocity.X *= 0.94f; + if (npc.velocity.X > -0.2f && npc.velocity.X < 0.2f) { npc.velocity.X = 0f; } diff --git a/NPCs/NormalNPCs/SuperDummyNPC.cs b/NPCs/NormalNPCs/SuperDummyNPC.cs index e1193b6f3a..7cff1f8b9b 100644 --- a/NPCs/NormalNPCs/SuperDummyNPC.cs +++ b/NPCs/NormalNPCs/SuperDummyNPC.cs @@ -21,6 +21,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath2; npc.value = 0f; npc.knockBackResist = 0f; + npc.buffImmune[BuffID.Confused] = false; } public override void UpdateLifeRegen(ref int damage) diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index 126d245e90..feebdb3e5f 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -18,7 +18,7 @@ namespace CalamityMod.NPCs.NormalNPCs { npc.damage = 10; npc.aiStyle = 3; - aiType = 73; + aiType = NPCID.GoblinScout; npc.width = 40; npc.height = 30; npc.defense = 4; @@ -29,6 +29,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath14; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override void PostAI() @@ -57,13 +58,13 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.GrassBlades, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 3, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.GrassBlades, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/NormalNPCs/WulfrumSlime.cs b/NPCs/NormalNPCs/WulfrumSlime.cs index e222977360..9202d0bb22 100644 --- a/NPCs/NormalNPCs/WulfrumSlime.cs +++ b/NPCs/NormalNPCs/WulfrumSlime.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.defense = 2; npc.lifeMax = 12; npc.knockBackResist = 0f; - animationType = 81; + animationType = NPCID.CorruptSlime; npc.value = Item.buyPrice(0, 0, 0, 30); npc.alpha = 60; npc.lavaImmune = false; @@ -32,6 +32,7 @@ namespace CalamityMod.NPCs.NormalNPCs npc.DeathSound = SoundID.NPCDeath1; banner = npc.type; bannerItem = ModContent.ItemType(); + npc.buffImmune[BuffID.Confused] = false; } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/OldDuke/OldDukeSharkron.cs b/NPCs/OldDuke/OldDukeSharkron.cs index 3fd351f0c3..5ce832eb15 100644 --- a/NPCs/OldDuke/OldDukeSharkron.cs +++ b/NPCs/OldDuke/OldDukeSharkron.cs @@ -224,10 +224,10 @@ namespace CalamityMod.NPCs.OldDuke for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Blood, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity.Y *= 10f; - num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity.X *= 2f; } diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index f8b53ba23f..5cff54dff9 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -181,7 +181,7 @@ namespace CalamityMod.NPCs.OldDuke for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.Next(2) == 0) { diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index b061a46aef..5cf9df800d 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -144,13 +144,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LargePerf2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LargePerf3"), 1f); diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index c789d3039e..9b90748b30 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -144,13 +144,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MediumPerf2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MediumPerf3"), 1f); diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index c86879ab83..b62936683f 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -144,13 +144,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SmallPerf2"), 1f); } diff --git a/NPCs/Perforator/PerforatorCyst.cs b/NPCs/Perforator/PerforatorCyst.cs index 57972202bc..1858f46dfe 100644 --- a/NPCs/Perforator/PerforatorCyst.cs +++ b/NPCs/Perforator/PerforatorCyst.cs @@ -84,13 +84,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(ModContent.NPCType()) < 1) { diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 4d41ba9276..d60bbf6898 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -440,13 +440,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LargePerf"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LargePerf2"), 1f); diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index c00967cffc..00d4b6cb90 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -34,7 +34,6 @@ namespace CalamityMod.NPCs.Perforator npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; - animationType = 10; npc.knockBackResist = 0f; npc.alpha = 255; npc.buffImmune[ModContent.BuffType()] = false; @@ -436,13 +435,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MediumPerf"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MediumPerf2"), 1f); diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index 57d5d9aa0f..3334a949c3 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -435,13 +435,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SmallPerf"), 1f); } diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 12236b7320..9822b9999a 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -426,7 +426,7 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < damage / npc.lifeMax * 100.0; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index 0a080fffa9..f3f3eef35d 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -88,13 +88,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LargePerf4"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LargePerf5"), 1f); diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index c6975ee410..ac8765166e 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -88,13 +88,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MediumPerf3"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MediumPerf4"), 1f); diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index 279a23f6fa..3ee50e4643 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -89,13 +89,13 @@ namespace CalamityMod.NPCs.Perforator { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SmallPerf3"), 1f); } diff --git a/NPCs/PlaguebringerGoliath/PlagueBeeG.cs b/NPCs/PlaguebringerGoliath/PlagueBeeG.cs index f0b014e617..908024d375 100644 --- a/NPCs/PlaguebringerGoliath/PlagueBeeG.cs +++ b/NPCs/PlaguebringerGoliath/PlagueBeeG.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -32,7 +33,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.aiStyle = -1; aiType = -1; npc.knockBackResist = CalamityWorld.bossRushActive ? 0f : 0.9f; - animationType = 210; + animationType = NPCID.Bee; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; npc.noGravity = true; @@ -269,13 +270,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs b/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs index 2303dc0cfe..359a096b21 100644 --- a/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs +++ b/NPCs/PlaguebringerGoliath/PlagueBeeLargeG.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -67,7 +68,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } if ((double)npc.position.Y > Main.rockLayer * 16.0) { - for (int num957 = 0; num957 < 200; num957++) + for (int num957 = 0; num957 < Main.maxNPCs; num957++) { if (Main.npc[num957].aiStyle == npc.aiStyle) { @@ -162,13 +163,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index e72d1990bb..b902dd5b2a 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -82,10 +83,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath int num3; if (npc.ai[0] == 0f && npc.ai[1] > 0f) { - float[] var_2_2065C_cp_0 = npc.ai; - int var_2_2065C_cp_1 = 1; - float num73 = var_2_2065C_cp_0[var_2_2065C_cp_1]; - var_2_2065C_cp_0[var_2_2065C_cp_1] = num73 - 1f; + npc.ai[1] -= 1f; } else if (npc.ai[0] == 0f && npc.ai[1] == 0f) { @@ -97,10 +95,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } else if (npc.ai[0] == 1f) { - float[] var_2_2087A_cp_0 = npc.localAI; - int var_2_2087A_cp_1 = 1; - float num73 = var_2_2087A_cp_0[var_2_2087A_cp_1]; - var_2_2087A_cp_0[var_2_2087A_cp_1] = num73 + 1f; + npc.localAI[1] += 1f; float num757 = 600f; float num758 = 0f; float num759 = 300f; @@ -116,23 +111,16 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath Vector2 v3 = Main.player[(int)npc.ai[1]].Center - npc.Center; float num760 = npc.velocity.ToRotation(); float num761 = v3.ToRotation(); - double num762 = (double)(num761 - num760); - if (num762 > 3.1415926535897931) - { - num762 -= 6.2831853071795862; - } - if (num762 < -3.1415926535897931) - { - num762 += 6.2831853071795862; - } - npc.velocity = npc.velocity.RotatedBy(num762 * 0.20000000298023224, default); + float angle = num761 - num760; + angle = MathHelper.WrapAngle(angle); + npc.velocity = npc.velocity.RotatedBy(angle * 0.2, default); } else { npc.noTileCollide = false; } } - for (int num767 = 0; num767 < 255; num767 = num3 + 1) + for (int num767 = 0; num767 < Main.maxPlayers; num767 = num3 + 1) { Player player5 = Main.player[num767]; if (player5.active && !player5.dead && Vector2.Distance(player5.Center, npc.Center) <= 42f) @@ -252,13 +240,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 10; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 1c89dbdf70..3b4a0d1001 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -999,7 +1000,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { for (int k = 0; k < 2; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -1013,7 +1014,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.position.Y = npc.position.Y - (npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Plague, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -1023,10 +1024,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Plague, 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, 46, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Plague, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs index 2667b3c27b..b39009f77d 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Pets; using CalamityMod.Items.Placeables.Banners; @@ -637,7 +638,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -654,7 +655,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Plague, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -664,10 +665,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 46, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Plague, 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, 46, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Plague, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index 39c2fbb14b..1290ff6cfc 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -324,7 +325,7 @@ namespace CalamityMod.NPCs.Polterghast npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Phantoplasm, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index c73ffffe41..055755fe2c 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -550,7 +551,7 @@ namespace CalamityMod.NPCs.Polterghast for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Phantoplasm, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; if (Main.rand.NextBool(2)) @@ -715,7 +716,7 @@ namespace CalamityMod.NPCs.Polterghast for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Phantoplasm, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; if (Main.rand.NextBool(2)) @@ -1024,7 +1025,7 @@ namespace CalamityMod.NPCs.Polterghast npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 60, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Phantoplasm, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index 42b8e8ecfb..f13cdc8d20 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -96,7 +97,7 @@ namespace CalamityMod.NPCs.Providence int dustType = Main.rand.Next(2); if (dustType == 0) { - dustType = 244; + dustType = (int)CalamityDusts.ProfanedFire; } else { @@ -215,7 +216,7 @@ namespace CalamityMod.NPCs.Providence { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -224,7 +225,7 @@ namespace CalamityMod.NPCs.Providence Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT3"), 1f); for (int k = 0; k < 30; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index a7271b8240..cdff9f17c6 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -97,7 +98,7 @@ namespace CalamityMod.NPCs.Providence int dustType = Main.rand.Next(2); if (dustType == 0) { - dustType = 244; + dustType = (int)CalamityDusts.ProfanedFire; } else { @@ -247,7 +248,7 @@ namespace CalamityMod.NPCs.Providence { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -258,7 +259,7 @@ namespace CalamityMod.NPCs.Providence Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH5"), 1f); for (int k = 0; k < 50; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index 4aec1cbd72..c3817fdd76 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -100,7 +101,7 @@ namespace CalamityMod.NPCs.Providence { if (Main.rand.Next(3) < num1009) { - int num1012 = Dust.NewDust(vectorCenter - new Vector2((float)num1010), num1010 * 2, num1010 * 2, 244, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 0.5f); + int num1012 = Dust.NewDust(vectorCenter - new Vector2((float)num1010), num1010 * 2, num1010 * 2, (int)CalamityDusts.ProfanedFire, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 0.5f); Main.dust[num1012].noGravity = true; Main.dust[num1012].velocity *= 0.2f; Main.dust[num1012].fadeIn = 1f; @@ -292,7 +293,7 @@ namespace CalamityMod.NPCs.Providence { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -302,7 +303,7 @@ namespace CalamityMod.NPCs.Providence Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA4"), 1f); for (int k = 0; k < 30; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index 285ece606c..66052ba09b 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -164,10 +164,10 @@ namespace CalamityMod.NPCs.Ravager } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 1, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Stone, 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, 8, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Iron, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 18fcd7d497..fc76713bbc 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -167,7 +167,7 @@ namespace CalamityMod.NPCs.Ravager bool rightClawActive = false; bool leftClawActive = false; - for (int num619 = 0; num619 < 200; num619++) + for (int num619 = 0; num619 < Main.maxNPCs; num619++) { if (Main.npc[num619].active && Main.npc[num619].type == ModContent.NPCType()) headActive = true; @@ -202,7 +202,7 @@ namespace CalamityMod.NPCs.Ravager if (!headActive) { - int rightDust = Dust.NewDust(new Vector2(npc.Center.X, npc.Center.Y - 30f), 8, 8, 5, 0f, 0f, 100, default, 2.5f); + int rightDust = Dust.NewDust(new Vector2(npc.Center.X, npc.Center.Y - 30f), 8, 8, DustID.Blood, 0f, 0f, 100, default, 2.5f); Main.dust[rightDust].alpha += Main.rand.Next(100); Main.dust[rightDust].velocity *= 0.2f; @@ -212,7 +212,7 @@ namespace CalamityMod.NPCs.Ravager if (Main.rand.NextBool(10)) { - rightDust = Dust.NewDust(new Vector2(npc.Center.X, npc.Center.Y - 30f), 8, 8, 6, 0f, 0f, 0, default, 1.5f); + rightDust = Dust.NewDust(new Vector2(npc.Center.X, npc.Center.Y - 30f), 8, 8, DustID.Fire, 0f, 0f, 0, default, 1.5f); if (Main.rand.Next(20) != 0) { Main.dust[rightDust].noGravity = true; @@ -250,7 +250,7 @@ namespace CalamityMod.NPCs.Ravager if (!rightClawActive) { - int rightDust = Dust.NewDust(new Vector2(npc.Center.X + 80f, npc.Center.Y + 45f), 8, 8, 5, 0f, 0f, 100, default, 3f); + int rightDust = Dust.NewDust(new Vector2(npc.Center.X + 80f, npc.Center.Y + 45f), 8, 8, DustID.Blood, 0f, 0f, 100, default, 3f); Main.dust[rightDust].alpha += Main.rand.Next(100); Main.dust[rightDust].velocity *= 0.2f; @@ -260,7 +260,7 @@ namespace CalamityMod.NPCs.Ravager if (Main.rand.NextBool(10)) { - rightDust = Dust.NewDust(new Vector2(npc.Center.X + 80f, npc.Center.Y + 45f), 8, 8, 6, 0f, 0f, 0, default, 2f); + rightDust = Dust.NewDust(new Vector2(npc.Center.X + 80f, npc.Center.Y + 45f), 8, 8, DustID.Fire, 0f, 0f, 0, default, 2f); if (Main.rand.Next(20) != 0) { Main.dust[rightDust].noGravity = true; @@ -290,22 +290,21 @@ namespace CalamityMod.NPCs.Ravager if (!leftClawActive) { - int leftDust = Dust.NewDust(new Vector2(npc.Center.X - 80f, npc.Center.Y + 45f), 8, 8, 5, 0f, 0f, 100, default, 3f); - Main.dust[leftDust].alpha += Main.rand.Next(100); - Main.dust[leftDust].velocity *= 0.2f; - + int leftDust = Dust.NewDust(new Vector2(npc.Center.X - 80f, npc.Center.Y + 45f), 8, 8, DustID.Blood, 0f, 0f, 100, default, 3f); Dust leftDustExpr = Main.dust[leftDust]; + leftDustExpr.alpha += Main.rand.Next(100); + leftDustExpr.velocity *= 0.2f; leftDustExpr.velocity.X -= 3f + Main.rand.Next(10) * 0.1f; - Main.dust[leftDust].fadeIn = 0.5f + Main.rand.Next(10) * 0.1f; + leftDustExpr.fadeIn = 0.5f + Main.rand.Next(10) * 0.1f; if (Main.rand.NextBool(10)) { - leftDust = Dust.NewDust(new Vector2(npc.Center.X - 80f, npc.Center.Y + 45f), 8, 8, 6, 0f, 0f, 0, default, 2f); + leftDust = Dust.NewDust(new Vector2(npc.Center.X - 80f, npc.Center.Y + 45f), 8, 8, DustID.Fire, 0f, 0f, 0, default, 2f); if (Main.rand.Next(20) != 0) { - Main.dust[leftDust].noGravity = true; - Main.dust[leftDust].scale *= 1f + Main.rand.Next(10) * 0.1f; Dust leftDustExpr2 = Main.dust[leftDust]; + leftDustExpr2.noGravity = true; + leftDustExpr2.scale *= 1f + Main.rand.Next(10) * 0.1f; leftDustExpr2.velocity.X -= 4f; } } @@ -330,22 +329,21 @@ namespace CalamityMod.NPCs.Ravager if (!rightLegActive) { - int rightDust = Dust.NewDust(new Vector2(npc.Center.X + 60f, npc.Center.Y + 60f), 8, 8, 5, 0f, 0f, 100, default, 2f); - Main.dust[rightDust].alpha += Main.rand.Next(100); - Main.dust[rightDust].velocity *= 0.2f; - + int rightDust = Dust.NewDust(new Vector2(npc.Center.X + 60f, npc.Center.Y + 60f), 8, 8, DustID.Blood, 0f, 0f, 100, default, 2f); Dust rightDustExpr = Main.dust[rightDust]; + rightDustExpr.alpha += Main.rand.Next(100); + rightDustExpr.velocity *= 0.2f; rightDustExpr.velocity.Y += 0.5f + Main.rand.Next(10) * 0.1f; - Main.dust[rightDust].fadeIn = 0.5f + Main.rand.Next(10) * 0.1f; + rightDustExpr.fadeIn = 0.5f + Main.rand.Next(10) * 0.1f; if (Main.rand.NextBool(10)) { - rightDust = Dust.NewDust(new Vector2(npc.Center.X + 60f, npc.Center.Y + 60f), 8, 8, 6, 0f, 0f, 0, default, 1.5f); + rightDust = Dust.NewDust(new Vector2(npc.Center.X + 60f, npc.Center.Y + 60f), 8, 8, DustID.Fire, 0f, 0f, 0, default, 1.5f); if (Main.rand.Next(20) != 0) { - Main.dust[rightDust].noGravity = true; - Main.dust[rightDust].scale *= 1f + Main.rand.Next(10) * 0.1f; Dust rightDustExpr2 = Main.dust[rightDust]; + rightDustExpr2.noGravity = true; + rightDustExpr2.scale *= 1f + Main.rand.Next(10) * 0.1f; rightDustExpr2.velocity.Y += 1f; } } @@ -369,7 +367,7 @@ namespace CalamityMod.NPCs.Ravager if (!leftLegActive) { - int leftDust = Dust.NewDust(new Vector2(npc.Center.X - 60f, npc.Center.Y + 60f), 8, 8, 5, 0f, 0f, 100, default, 2f); + int leftDust = Dust.NewDust(new Vector2(npc.Center.X - 60f, npc.Center.Y + 60f), 8, 8, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[leftDust].alpha += Main.rand.Next(100); Main.dust[leftDust].velocity *= 0.2f; @@ -379,7 +377,7 @@ namespace CalamityMod.NPCs.Ravager if (Main.rand.NextBool(10)) { - leftDust = Dust.NewDust(new Vector2(npc.Center.X - 60f, npc.Center.Y + 60f), 8, 8, 6, 0f, 0f, 0, default, 1.5f); + leftDust = Dust.NewDust(new Vector2(npc.Center.X - 60f, npc.Center.Y + 60f), 8, 8, DustID.Fire, 0f, 0f, 0, default, 1.5f); if (Main.rand.Next(20) != 0) { Main.dust[leftDust].noGravity = true; @@ -743,8 +741,8 @@ namespace CalamityMod.NPCs.Ravager { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 2f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Fire, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -756,7 +754,7 @@ namespace CalamityMod.NPCs.Ravager for (int k = 0; k < 50; k++) { Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Fire, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Ravager/RavagerClawLeft.cs b/NPCs/Ravager/RavagerClawLeft.cs index 2ce97164b0..fa6434c91c 100644 --- a/NPCs/Ravager/RavagerClawLeft.cs +++ b/NPCs/Ravager/RavagerClawLeft.cs @@ -327,7 +327,7 @@ namespace CalamityMod.NPCs.Ravager int num285 = 0; while ((double)num285 < damage / (double)npc.lifeMax * 100.0) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, (float)hitDirection, -1f, 0, default, 1f); num285++; } } diff --git a/NPCs/Ravager/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index d3fb95b3c0..876811a07a 100644 --- a/NPCs/Ravager/RavagerClawRight.cs +++ b/NPCs/Ravager/RavagerClawRight.cs @@ -328,7 +328,7 @@ namespace CalamityMod.NPCs.Ravager int num285 = 0; while ((double)num285 < damage / (double)npc.lifeMax * 100.0) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, (float)hitDirection, -1f, 0, default, 1f); num285++; } } diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index c81fe6dd43..8bf80ad127 100644 --- a/NPCs/Ravager/RavagerHead.cs +++ b/NPCs/Ravager/RavagerHead.cs @@ -155,7 +155,7 @@ namespace CalamityMod.NPCs.Ravager int num285 = 0; while ((double)num285 < damage / (double)npc.lifeMax * 100.0) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, (float)hitDirection, -1f, 0, default, 1f); num285++; } } diff --git a/NPCs/Ravager/RavagerHead2.cs b/NPCs/Ravager/RavagerHead2.cs index 646e48ef76..c0975bb99f 100644 --- a/NPCs/Ravager/RavagerHead2.cs +++ b/NPCs/Ravager/RavagerHead2.cs @@ -258,7 +258,7 @@ namespace CalamityMod.NPCs.Ravager { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) @@ -268,7 +268,7 @@ namespace CalamityMod.NPCs.Ravager Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerHead3"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); } } diff --git a/NPCs/Ravager/RavagerLegLeft.cs b/NPCs/Ravager/RavagerLegLeft.cs index 63c7bd86eb..1fc5f5d55e 100644 --- a/NPCs/Ravager/RavagerLegLeft.cs +++ b/NPCs/Ravager/RavagerLegLeft.cs @@ -127,8 +127,8 @@ namespace CalamityMod.NPCs.Ravager { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Fire, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -136,8 +136,8 @@ namespace CalamityMod.NPCs.Ravager Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerLegLeft2"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Fire, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Ravager/RavagerLegRight.cs b/NPCs/Ravager/RavagerLegRight.cs index 2441ba9d6c..a9d8ab3e9d 100644 --- a/NPCs/Ravager/RavagerLegRight.cs +++ b/NPCs/Ravager/RavagerLegRight.cs @@ -127,8 +127,8 @@ namespace CalamityMod.NPCs.Ravager { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Fire, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -136,8 +136,8 @@ namespace CalamityMod.NPCs.Ravager Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGores/ScavengerLegRight2"), 1f); for (int k = 0; k < 20; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Fire, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index c00ac6abc5..3c74cd50f4 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -83,7 +83,7 @@ namespace CalamityMod.NPCs.Ravager for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 8, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Iron, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -93,10 +93,10 @@ namespace CalamityMod.NPCs.Ravager } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 1, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Stone, 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, 8, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Iron, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } @@ -146,7 +146,7 @@ namespace CalamityMod.NPCs.Ravager npc.position.Y = npc.position.Y - (npc.height / 2); for (int num621 = 0; num621 < 30; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 8, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Iron, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -156,10 +156,10 @@ namespace CalamityMod.NPCs.Ravager } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 1, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Stone, 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, 8, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Iron, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } @@ -167,7 +167,7 @@ namespace CalamityMod.NPCs.Ravager { for (int num621 = 0; num621 < 2; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 8, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Iron, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -177,10 +177,10 @@ namespace CalamityMod.NPCs.Ravager } for (int num623 = 0; num623 < 2; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 1, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Stone, 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, 8, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, DustID.Iron, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 874c634b3d..afad42a2a8 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -186,7 +187,7 @@ namespace CalamityMod.NPCs.Signus { if (Main.rand.Next(3) < 1) { - int num1012 = Dust.NewDust(vectorCenter - new Vector2(70f), 70 * 2, 70 * 2, 173, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f); + int num1012 = Dust.NewDust(vectorCenter - new Vector2(70f), 70 * 2, 70 * 2, (int)CalamityDusts.PurpleCosmolite, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f); Main.dust[num1012].noGravity = true; Main.dust[num1012].velocity *= 0.2f; Main.dust[num1012].fadeIn = 1f; @@ -281,7 +282,7 @@ namespace CalamityMod.NPCs.Signus Vector2 position = new Vector2(npc.ai[1] * 16f - (npc.width / 2), npc.ai[2] * 16f - (npc.height / 2)); for (int m = 0; m < 5; m++) { - int dust = Dust.NewDust(position, npc.width, npc.height, 173, 0f, 0f, 90, default, 2f); + int dust = Dust.NewDust(position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 90, default, 2f); Main.dust[dust].noGravity = true; Main.dust[dust].fadeIn = 1f; } @@ -297,7 +298,7 @@ namespace CalamityMod.NPCs.Signus npc.position = position; for (int n = 0; n < 15; n++) { - int num39 = Dust.NewDust(npc.position, npc.width, npc.height, 173, 0f, 0f, 90, default, 3f); + int num39 = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 90, default, 3f); Main.dust[num39].noGravity = true; } npc.ai[0] = 2f; @@ -324,7 +325,7 @@ namespace CalamityMod.NPCs.Signus } for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(player.position.X + 750f, player.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(player.position.X + 750f, player.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; Main.dust[num622].noGravity = true; if (Main.rand.NextBool(2)) @@ -332,7 +333,7 @@ namespace CalamityMod.NPCs.Signus Main.dust[num622].scale = 0.5f; Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } - int num623 = Dust.NewDust(new Vector2(player.position.X - 750f, player.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num623 = Dust.NewDust(new Vector2(player.position.X - 750f, player.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num623].velocity *= 3f; Main.dust[num623].noGravity = true; if (Main.rand.NextBool(2)) @@ -343,15 +344,15 @@ namespace CalamityMod.NPCs.Signus } for (int num623 = 0; num623 < 20; num623++) { - int num624 = Dust.NewDust(new Vector2(player.position.X + 750f, player.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(player.position.X + 750f, player.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(player.position.X + 750f, player.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(player.position.X + 750f, player.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; - int num625 = Dust.NewDust(new Vector2(player.position.X - 750f, player.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num625 = Dust.NewDust(new Vector2(player.position.X - 750f, player.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 3f); Main.dust[num625].noGravity = true; Main.dust[num625].velocity *= 5f; - num625 = Dust.NewDust(new Vector2(player.position.X - 750f, player.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + num625 = Dust.NewDust(new Vector2(player.position.X - 750f, player.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num625].velocity *= 2f; } } @@ -798,7 +799,7 @@ namespace CalamityMod.NPCs.Signus { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -810,7 +811,7 @@ namespace CalamityMod.NPCs.Signus npc.position.Y = npc.position.Y - (npc.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -820,10 +821,10 @@ namespace CalamityMod.NPCs.Signus } for (int num623 = 0; num623 < 60; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } float randomSpread = Main.rand.Next(-200, 200) / 100; diff --git a/NPCs/Signus/SignusBomb.cs b/NPCs/Signus/SignusBomb.cs index 8267b2a7b7..7218ff3784 100644 --- a/NPCs/Signus/SignusBomb.cs +++ b/NPCs/Signus/SignusBomb.cs @@ -1,3 +1,4 @@ +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -179,7 +180,7 @@ namespace CalamityMod.NPCs.Signus npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 15; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -190,10 +191,10 @@ namespace CalamityMod.NPCs.Signus } for (int num623 = 0; num623 < 30; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; Main.dust[num624].noGravity = true; } diff --git a/NPCs/SlimeGod/SlimeGod.cs b/NPCs/SlimeGod/SlimeGod.cs index b30c761e24..d70d78c6d5 100644 --- a/NPCs/SlimeGod/SlimeGod.cs +++ b/NPCs/SlimeGod/SlimeGod.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.SlimeGod aiType = -1; npc.buffImmune[ModContent.BuffType()] = false; npc.knockBackResist = 0f; - animationType = 50; + animationType = NPCID.KingSlime; npc.value = 0f; npc.alpha = 55; npc.HitSound = SoundID.NPCHit1; diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index a8d20e07dd..8310cfc78f 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -3,7 +3,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Furniture.CraftingStations; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Potions; using CalamityMod.Items.TreasureBags; @@ -660,7 +659,7 @@ namespace CalamityMod.NPCs.SlimeGod if (!Main.expertMode) { // Materials - DropHelper.DropItemSpray(npc, ModContent.ItemType(), 25, 40); + DropHelper.DropItemSpray(npc, ModContent.ItemType(), 30, 45); // Weapons DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); @@ -670,10 +669,9 @@ namespace CalamityMod.NPCs.SlimeGod DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); // Vanity - DropHelper.DropItemFromSetChance(npc, 7, ModContent.ItemType(), ModContent.ItemType()); + DropHelper.DropItemFromSetChance(npc, 0.142857f, ModContent.ItemType(), ModContent.ItemType()); // Other - DropHelper.DropItem(npc, ModContent.ItemType()); } // Mark the Slime God as dead diff --git a/NPCs/SlimeGod/SlimeGodRun.cs b/NPCs/SlimeGod/SlimeGodRun.cs index e88c0d36d8..4b06132d0a 100644 --- a/NPCs/SlimeGod/SlimeGodRun.cs +++ b/NPCs/SlimeGod/SlimeGodRun.cs @@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.SlimeGod double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; - animationType = 50; + animationType = NPCID.KingSlime; npc.buffImmune[ModContent.BuffType()] = false; npc.value = 0f; npc.alpha = 55; diff --git a/NPCs/SlimeGod/SlimeGodRunSplit.cs b/NPCs/SlimeGod/SlimeGodRunSplit.cs index af11c2316b..21203b572b 100644 --- a/NPCs/SlimeGod/SlimeGodRunSplit.cs +++ b/NPCs/SlimeGod/SlimeGodRunSplit.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.defense = 10; npc.knockBackResist = 0f; npc.buffImmune[ModContent.BuffType()] = false; - animationType = 50; + animationType = NPCID.KingSlime; npc.value = Item.buyPrice(0, 1, 0, 0); npc.alpha = 55; npc.lavaImmune = false; diff --git a/NPCs/SlimeGod/SlimeGodSplit.cs b/NPCs/SlimeGod/SlimeGodSplit.cs index 6f95f4c496..c295f07f12 100644 --- a/NPCs/SlimeGod/SlimeGodSplit.cs +++ b/NPCs/SlimeGod/SlimeGodSplit.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.SlimeGod aiType = -1; npc.knockBackResist = 0f; npc.buffImmune[ModContent.BuffType()] = false; - animationType = 50; + animationType = NPCID.KingSlime; npc.value = Item.buyPrice(0, 1, 0, 0); npc.alpha = 55; npc.lavaImmune = false; diff --git a/NPCs/SlimeGod/SlimeSpawnCorrupt.cs b/NPCs/SlimeGod/SlimeSpawnCorrupt.cs index 7a1d77fc94..53c8d29f7a 100644 --- a/NPCs/SlimeGod/SlimeSpawnCorrupt.cs +++ b/NPCs/SlimeGod/SlimeSpawnCorrupt.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - npc.buffImmune[24] = true; + npc.buffImmune[BuffID.OnFire] = true; } public override bool PreNPCLoot() diff --git a/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs b/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs index d1d6cf5c9f..4050e653b9 100644 --- a/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.lifeMax = 50000; } npc.knockBackResist = 0f; - animationType = 81; + animationType = NPCID.CorruptSlime; npc.alpha = 55; npc.lavaImmune = false; npc.noGravity = false; @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - npc.buffImmune[24] = true; + npc.buffImmune[BuffID.OnFire] = true; } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson.cs b/NPCs/SlimeGod/SlimeSpawnCrimson.cs index b32e6a5628..fbd905a275 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.lifeMax = 100000; } npc.knockBackResist = 0f; - animationType = 81; + animationType = NPCID.CorruptSlime; npc.alpha = 55; npc.lavaImmune = false; npc.noGravity = false; @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - npc.buffImmune[24] = true; + npc.buffImmune[BuffID.OnFire] = true; } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs index cf24a872bd..79e8bbf526 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.lifeMax = 120000; } npc.knockBackResist = 0f; - animationType = 81; + animationType = NPCID.CorruptSlime; npc.alpha = 55; npc.lavaImmune = false; npc.noGravity = false; @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - npc.buffImmune[24] = true; + npc.buffImmune[BuffID.OnFire] = true; } public override void AI() diff --git a/NPCs/StormWeaver/StasisProbe.cs b/NPCs/StormWeaver/StasisProbe.cs index 1512bf4556..db38ddb1e9 100644 --- a/NPCs/StormWeaver/StasisProbe.cs +++ b/NPCs/StormWeaver/StasisProbe.cs @@ -1,3 +1,4 @@ +using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; using System; @@ -34,7 +35,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; - npc.buffImmune[24] = true; + npc.buffImmune[BuffID.OnFire] = true; } public override void AI() @@ -129,7 +130,7 @@ namespace CalamityMod.NPCs.StormWeaver if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { int num8 = Main.expertMode ? 50 : 60; - int num9 = 84; + int num9 = ProjectileID.PinkLaser; int beam = Projectile.NewProjectile(vector.X, vector.Y, num4, num5, num9, num8, 0f, Main.myPlayer, 0f, 0f); Main.projectile[beam].timeLeft = 200; } @@ -217,7 +218,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -227,49 +228,14 @@ namespace CalamityMod.NPCs.StormWeaver } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StasisProbe1"),1f); - for (int num625 = 0; num625 < 1; num625++) - { - float scaleFactor10 = 0.33f; - if (num625 == 1) - { - scaleFactor10 = 0.66f; - } - if (num625 == 2) - { - scaleFactor10 = 1f; - } - int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; - } + npc.ExplosionGores(1); } } diff --git a/NPCs/StormWeaver/StasisProbeNaked.cs b/NPCs/StormWeaver/StasisProbeNaked.cs index 8bc5f31d93..b62fc886a2 100644 --- a/NPCs/StormWeaver/StasisProbeNaked.cs +++ b/NPCs/StormWeaver/StasisProbeNaked.cs @@ -1,3 +1,4 @@ +using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; using System; @@ -34,7 +35,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.canGhostHeal = false; npc.HitSound = SoundID.NPCHit13; npc.DeathSound = SoundID.NPCDeath19; - npc.buffImmune[24] = true; + npc.buffImmune[BuffID.OnFire] = true; } public override void AI() @@ -129,7 +130,7 @@ namespace CalamityMod.NPCs.StormWeaver if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { int num8 = Main.expertMode ? 50 : 60; - int num9 = 84; + int num9 = ProjectileID.PinkLaser; int beam = Projectile.NewProjectile(vector.X, vector.Y, num4, num5, num9, num8, 0f, Main.myPlayer, 0f, 0f); Main.projectile[beam].timeLeft = 200; } @@ -170,11 +171,11 @@ namespace CalamityMod.NPCs.StormWeaver { npc.netUpdate = true; npc.velocity.Y = npc.oldVelocity.Y * -num12; - if (npc.velocity.Y > 0f && (double)npc.velocity.Y < 1.5) + if (npc.velocity.Y > 0f && npc.velocity.Y < 1.5f) { npc.velocity.Y = 2f; } - if (npc.velocity.Y < 0f && (double)npc.velocity.Y > -1.5) + if (npc.velocity.Y < 0f && npc.velocity.Y > -1.5f) { npc.velocity.Y = -2f; } @@ -185,12 +186,12 @@ namespace CalamityMod.NPCs.StormWeaver { if (Math.Abs(npc.velocity.X) < 12f) { - npc.velocity.X = npc.velocity.X * 1.05f; + npc.velocity.X *= 1.05f; } } else { - npc.velocity.X = npc.velocity.X * 0.9f; + npc.velocity.X *= 0.9f; } } if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) @@ -217,7 +218,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 5; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -227,49 +228,14 @@ namespace CalamityMod.NPCs.StormWeaver } for (int num623 = 0; num623 < 10; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StasisProbeNaked1"), 1f); - for (int num625 = 0; num625 < 1; num625++) - { - float scaleFactor10 = 0.33f; - if (num625 == 1) - { - scaleFactor10 = 0.66f; - } - if (num625 == 2) - { - scaleFactor10 = 1f; - } - int num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; - num626 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; - } + npc.ExplosionGores(1); } } diff --git a/NPCs/StormWeaver/StormWeaverBodyNaked.cs b/NPCs/StormWeaver/StormWeaverBodyNaked.cs index 445d0a20f3..e06a5ba1ad 100644 --- a/NPCs/StormWeaver/StormWeaverBodyNaked.cs +++ b/NPCs/StormWeaver/StormWeaverBodyNaked.cs @@ -1,4 +1,5 @@ -using CalamityMod.World; +using CalamityMod.Dusts; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; @@ -248,7 +249,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -258,10 +259,10 @@ namespace CalamityMod.NPCs.StormWeaver } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index adb60026cc..6588e7b90c 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -1,4 +1,5 @@ -using CalamityMod.World; +using CalamityMod.Dusts; +using CalamityMod.World; using Microsoft.Xna.Framework; using System; using System.IO; @@ -154,8 +155,8 @@ namespace CalamityMod.NPCs.StormWeaver npc.TargetClosest(true); npc.netUpdate = true; float xPos = Main.rand.NextBool(2) ? npc.position.X + 300f : npc.position.X - 300f; - Vector2 vector2 = new Vector2(xPos, npc.position.Y + Main.rand.Next(-300, 301)); - Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, 465, damage, 0f, Main.myPlayer, 0f, 0f); + Vector2 spawnPos = new Vector2(xPos, npc.position.Y + Main.rand.Next(-300, 301)); + Projectile.NewProjectile(spawnPos, Vector2.Zero, ProjectileID.CultistBossLightningOrb, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -182,13 +183,13 @@ namespace CalamityMod.NPCs.StormWeaver int BoltProjectiles = 1; for (int i = 0; i < BoltProjectiles; i++) { - Vector2 spawn2 = baseSpawn; - spawn2.X = spawn2.X + i * 30 - (BoltProjectiles * 15); + Vector2 source = baseSpawn; + source.X += i * 30 - (BoltProjectiles * 15); Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-BoltAngleSpread / 2 + (BoltAngleSpread * i / (float)BoltProjectiles))); velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; - Vector2 vector94 = Main.player[npc.target].Center - spawn2; + Vector2 vector94 = Main.player[npc.target].Center - source; float ai = (float)Main.rand.Next(100); - Projectile.NewProjectile(spawn2.X, spawn2.Y, velocity.X, velocity.Y, 466, damage, 0f, Main.myPlayer, vector94.ToRotation(), ai); + Projectile.NewProjectile(source, velocity, ProjectileID.CultistBossLightningOrbArc, damage, 0f, Main.myPlayer, vector94.ToRotation(), ai); } } } @@ -211,7 +212,7 @@ namespace CalamityMod.NPCs.StormWeaver netMessage.Write(CalamityWorld.DoGSecondStageCountdown); netMessage.Send(); } - for (int num957 = 0; num957 < 200; num957++) + for (int num957 = 0; num957 < Main.maxNPCs; num957++) { if (Main.npc[num957].active && (Main.npc[num957].type == ModContent.NPCType() || Main.npc[num957].type == ModContent.NPCType() @@ -232,7 +233,7 @@ namespace CalamityMod.NPCs.StormWeaver netMessage.Write(CalamityWorld.DoGSecondStageCountdown); netMessage.Send(); } - for (int num957 = 0; num957 < 200; num957++) + for (int num957 = 0; num957 < Main.maxNPCs; num957++) { if (Main.npc[num957].active && (Main.npc[num957].type == ModContent.NPCType() || Main.npc[num957].type == ModContent.NPCType() @@ -326,7 +327,7 @@ namespace CalamityMod.NPCs.StormWeaver } if (num42 > 0) { - for (int num51 = 0; num51 < 200; num51++) + for (int num51 = 0; num51 < Main.maxNPCs; num51++) { if (Main.npc[num51].active && Main.npc[num51].type == npc.type && num51 != npc.whoAmI) { @@ -343,7 +344,7 @@ namespace CalamityMod.NPCs.StormWeaver } else { - for (int num52 = 0; num52 < 200; num52++) + for (int num52 = 0; num52 < Main.maxNPCs; num52++) { if (Main.npc[num52].active && Main.npc[num52].type == npc.type && num52 != npc.whoAmI) { @@ -464,7 +465,7 @@ namespace CalamityMod.NPCs.StormWeaver } } } - npc.rotation = (float)System.Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f; + npc.rotation = (float)System.Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + MathHelper.PiOver2; } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -482,7 +483,7 @@ namespace CalamityMod.NPCs.StormWeaver { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -495,7 +496,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -505,10 +506,10 @@ namespace CalamityMod.NPCs.StormWeaver } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/StormWeaver/StormWeaverHeadNaked.cs b/NPCs/StormWeaver/StormWeaverHeadNaked.cs index 78a8e17226..e5a57ad817 100644 --- a/NPCs/StormWeaver/StormWeaverHeadNaked.cs +++ b/NPCs/StormWeaver/StormWeaverHeadNaked.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Armor.Vanity; +using CalamityMod.Dusts; +using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; @@ -186,8 +187,8 @@ namespace CalamityMod.NPCs.StormWeaver npc.TargetClosest(true); npc.netUpdate = true; float xPos = Main.rand.NextBool(2) ? npc.position.X + 300f : npc.position.X - 300f; - Vector2 vector2 = new Vector2(xPos, npc.position.Y + Main.rand.Next(-300, 301)); - Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, 465, damage, 0f, Main.myPlayer, 0f, 0f); + Vector2 spawnPos = new Vector2(xPos, npc.position.Y + Main.rand.Next(-300, 301)); + Projectile.NewProjectile(spawnPos, Vector2.Zero, ProjectileID.CultistBossLightningOrb, damage, 0f, Main.myPlayer, 0f, 0f); } } @@ -213,13 +214,13 @@ namespace CalamityMod.NPCs.StormWeaver baseVelocity *= speed2; for (int i = 0; i < BoltProjectiles; i++) { - Vector2 spawn2 = baseSpawn; - spawn2.X = spawn2.X + i * 30 - (BoltProjectiles * 15); + Vector2 source = baseSpawn; + source.X += i * 30 - (BoltProjectiles * 15); Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-BoltAngleSpread / 2 + (BoltAngleSpread * i / BoltProjectiles))); velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; - Vector2 vector94 = Main.player[npc.target].Center - spawn2; + Vector2 vector94 = Main.player[npc.target].Center - source; float ai = Main.rand.Next(100); - Projectile.NewProjectile(spawn2.X, spawn2.Y, velocity.X, velocity.Y, 466, damage, 0f, Main.myPlayer, vector94.ToRotation(), ai); + Projectile.NewProjectile(source, velocity, ProjectileID.CultistBossLightningOrbArc, damage, 0f, Main.myPlayer, vector94.ToRotation(), ai); } } } @@ -484,7 +485,7 @@ namespace CalamityMod.NPCs.StormWeaver { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -498,7 +499,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -508,10 +509,10 @@ namespace CalamityMod.NPCs.StormWeaver } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 00f5324989..ea05f6aa3f 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -1,3 +1,4 @@ +using CalamityMod.Dusts; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -167,7 +168,7 @@ namespace CalamityMod.NPCs.StormWeaver { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -181,7 +182,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -191,10 +192,10 @@ namespace CalamityMod.NPCs.StormWeaver } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/StormWeaver/StormWeaverTailNaked.cs b/NPCs/StormWeaver/StormWeaverTailNaked.cs index c565aa4c42..8d38c30e22 100644 --- a/NPCs/StormWeaver/StormWeaverTailNaked.cs +++ b/NPCs/StormWeaver/StormWeaverTailNaked.cs @@ -1,4 +1,5 @@ -using CalamityMod.World; +using CalamityMod.Dusts; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; @@ -223,7 +224,7 @@ namespace CalamityMod.NPCs.StormWeaver { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { @@ -237,7 +238,7 @@ namespace CalamityMod.NPCs.StormWeaver npc.position.Y = npc.position.Y - (float)(npc.height / 2); for (int num621 = 0; num621 < 20; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -247,10 +248,10 @@ namespace CalamityMod.NPCs.StormWeaver } for (int num623 = 0; num623 < 40; num623++) { - int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 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, 173, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.PurpleCosmolite, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/SulphurousSea/Catfish.cs b/NPCs/SulphurousSea/Catfish.cs index e25ae8eca6..59875b9a5f 100644 --- a/NPCs/SulphurousSea/Catfish.cs +++ b/NPCs/SulphurousSea/Catfish.cs @@ -102,13 +102,13 @@ namespace CalamityMod.NPCs.SulphurousSea { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/SulphurousSea/Flounder.cs b/NPCs/SulphurousSea/Flounder.cs index 95b6cd60f2..21304249d3 100644 --- a/NPCs/SulphurousSea/Flounder.cs +++ b/NPCs/SulphurousSea/Flounder.cs @@ -122,13 +122,13 @@ namespace CalamityMod.NPCs.SulphurousSea { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } } } diff --git a/NPCs/SulphurousSea/Gnasher.cs b/NPCs/SulphurousSea/Gnasher.cs index a540b0257b..620e0be1bc 100644 --- a/NPCs/SulphurousSea/Gnasher.cs +++ b/NPCs/SulphurousSea/Gnasher.cs @@ -116,13 +116,13 @@ namespace CalamityMod.NPCs.SulphurousSea { for (int k = 0; k < 3; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 15; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Gnasher"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Gnasher2"), 1f); diff --git a/NPCs/SulphurousSea/Mauler.cs b/NPCs/SulphurousSea/Mauler.cs index 023a4f0eec..bb7a967fe0 100644 --- a/NPCs/SulphurousSea/Mauler.cs +++ b/NPCs/SulphurousSea/Mauler.cs @@ -382,13 +382,13 @@ namespace CalamityMod.NPCs.SulphurousSea { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 30; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Mauler"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Mauler2"), 1f); diff --git a/NPCs/SulphurousSea/Trasher.cs b/NPCs/SulphurousSea/Trasher.cs index 1b22e75f28..e7966c8a0e 100644 --- a/NPCs/SulphurousSea/Trasher.cs +++ b/NPCs/SulphurousSea/Trasher.cs @@ -347,13 +347,13 @@ namespace CalamityMod.NPCs.SulphurousSea { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { for (int k = 0; k < 25; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Trasher"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Trasher2"), 1f); diff --git a/NPCs/SunkenSea/Clam.cs b/NPCs/SunkenSea/Clam.cs index 6a8fa5d317..c2f850bc6d 100644 --- a/NPCs/SunkenSea/Clam.cs +++ b/NPCs/SunkenSea/Clam.cs @@ -74,6 +74,7 @@ namespace CalamityMod.NPCs.SunkenSea { if (!statChange) { + npc.buffImmune[BuffID.Confused] = false; npc.defense = 6; npc.damage = Main.expertMode ? 60 : 30; if (Main.hardMode) @@ -108,7 +109,7 @@ namespace CalamityMod.NPCs.SunkenSea } if (npc.ai[2] < (float)num321) { - npc.velocity.X = npc.velocity.X * 0.9f; + npc.velocity.X *= 0.9f; return; } npc.ai[2] = 0f; diff --git a/NPCs/SunkenSea/EutrophicRay.cs b/NPCs/SunkenSea/EutrophicRay.cs index 015a2dfb45..a5e9279d71 100644 --- a/NPCs/SunkenSea/EutrophicRay.cs +++ b/NPCs/SunkenSea/EutrophicRay.cs @@ -134,11 +134,11 @@ namespace CalamityMod.NPCs.SunkenSea } npc.rotation = npc.velocity.Y * Rotation; - if ((double)npc.rotation < -0.1) + if (npc.rotation < -0.1f) { npc.rotation = -0.1f; } - if ((double)npc.rotation > 0.1) + if (npc.rotation > 0.1f) { npc.rotation = 0.1f; return; diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index c5d504bde9..40bc9749f5 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -1656,7 +1656,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas for (int num388 = 0; num388 < 50; num388++) Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); - Main.PlaySound(SoundID.Roar, npc.position); + Main.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0); } } diff --git a/NPCs/TownNPCs/DILF.cs b/NPCs/TownNPCs/DILF.cs index dabb943dcd..f1839bb6de 100644 --- a/NPCs/TownNPCs/DILF.cs +++ b/NPCs/TownNPCs/DILF.cs @@ -181,6 +181,7 @@ namespace CalamityMod.NPCs.TownNPCs shop.item[nextSlot].SetDefaults(ModContent.ItemType()); nextSlot++; shop.item[nextSlot].SetDefaults(ModContent.ItemType()); + shop.item[nextSlot].shopCustomPrice = 1000000; //I think this is 5 platinum nextSlot++; shop.item[nextSlot].SetDefaults(ModContent.ItemType()); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 15, 0, 0); diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index 66686008bd..0232319a60 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.TownNPCs if (BirthdayParty.PartyIsUp) dialogue.Add("You'll always find me at parties where booze is involved...well, you'll always find booze where I'm involved."); - if (Main.invasionType == 4) + if (Main.invasionType == InvasionID.MartianMadness) dialogue.Add("Shoot down the space invaders! Sexy time will be postponed if we are invaded by UFOs!"); if (CalamityWorld.downedCryogen) diff --git a/NPCs/Yharon/DetonatingFlare.cs b/NPCs/Yharon/DetonatingFlare.cs index 570cd234b7..e5aed4aac6 100644 --- a/NPCs/Yharon/DetonatingFlare.cs +++ b/NPCs/Yharon/DetonatingFlare.cs @@ -164,7 +164,7 @@ namespace CalamityMod.NPCs.Yharon if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { int num8 = Main.expertMode ? 75 : 90; - int num9 = 467; + int num9 = ProjectileID.CultistBossFireBall; Projectile.NewProjectile(vector.X, vector.Y, num4, num5, num9, num8, 0f, Main.myPlayer, 0f, 0f); } } diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 2b57a5cd11..4e6d9f69af 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -3026,7 +3026,7 @@ namespace CalamityMod.NPCs.Yharon { for (int k = 0; k < 5; k++) { - Dust.NewDust(npc.position, npc.width, npc.height, 5, hitDirection, -1f, 0, default, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f); } if (npc.life <= 0) { diff --git a/Prefixes/AccessoryPrefix.cs b/Prefixes/AccessoryPrefix.cs index b0646d2231..0235bbd3d0 100644 --- a/Prefixes/AccessoryPrefix.cs +++ b/Prefixes/AccessoryPrefix.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Prefixes { if (base.Autoload(ref name)) { - //Damage, Use Time, Crit, Velocity, SS Dmg AccessoryModifiers = new List(); AddAccessoryPrefix(mod, AccPrefixType.Quiet, 1.02f); AddAccessoryPrefix(mod, AccPrefixType.Cloaked, 1.04f); diff --git a/Prefixes/RoguePrefix.cs b/Prefixes/RoguePrefix.cs index 180539af9d..2ecf8e31d6 100644 --- a/Prefixes/RoguePrefix.cs +++ b/Prefixes/RoguePrefix.cs @@ -93,9 +93,11 @@ namespace CalamityMod.Prefixes public override void ValidateItem(Item item, ref bool invalid) { - if (item.damage == Math.Round(item.damage * damageMult)) + if (item.damage == Math.Round(item.damage * damageMult) && damageMult != 1f) invalid = true; - if (item.useAnimation == Math.Round(item.useAnimation * useTimeMult)) + if (item.useAnimation == Math.Round(item.useAnimation * useTimeMult) && useTimeMult != 1f) + invalid = true; + if (item.consumable) invalid = true; } } diff --git a/Projectiles/Boss/BloodClot.cs b/Projectiles/Boss/BloodClot.cs index 22cdc226b7..4eaaae4689 100644 --- a/Projectiles/Boss/BloodClot.cs +++ b/Projectiles/Boss/BloodClot.cs @@ -2,6 +2,7 @@ using CalamityMod.Dusts; using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -19,7 +20,7 @@ namespace CalamityMod.Projectiles.Boss projectile.hostile = true; projectile.penetrate = 1; projectile.aiStyle = 1; - aiType = 1; + aiType = ProjectileID.WoodenArrowFriendly; } public override void AI() diff --git a/Projectiles/Boss/BloodGeyser.cs b/Projectiles/Boss/BloodGeyser.cs index 791e10fc55..17790e3893 100644 --- a/Projectiles/Boss/BloodGeyser.cs +++ b/Projectiles/Boss/BloodGeyser.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -21,7 +22,7 @@ namespace CalamityMod.Projectiles.Boss projectile.timeLeft = 300; projectile.penetrate = 1; projectile.aiStyle = 1; - aiType = 1; + aiType = ProjectileID.WoodenArrowFriendly; } public override void AI() @@ -31,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 0.5f); + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, DustID.Blood, 0f, 0f, 100, default, 0.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } diff --git a/Projectiles/Boss/BrimstoneBall.cs b/Projectiles/Boss/BrimstoneBall.cs index 8bdf9df0af..1d3edc2464 100644 --- a/Projectiles/Boss/BrimstoneBall.cs +++ b/Projectiles/Boss/BrimstoneBall.cs @@ -2,6 +2,7 @@ using CalamityMod.Dusts; using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -20,7 +21,7 @@ namespace CalamityMod.Projectiles.Boss projectile.scale = 1.2f; projectile.penetrate = 6; projectile.aiStyle = 14; - aiType = 277; + aiType = ProjectileID.ThornBall; projectile.timeLeft = 300; } diff --git a/Projectiles/Boss/BrimstoneLaser.cs b/Projectiles/Boss/BrimstoneLaser.cs index 556e438a16..c3ed3e7129 100644 --- a/Projectiles/Boss/BrimstoneLaser.cs +++ b/Projectiles/Boss/BrimstoneLaser.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework; using System; using System.IO; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { @@ -25,7 +26,7 @@ namespace CalamityMod.Projectiles.Boss projectile.ignoreWater = true; projectile.penetrate = -1; projectile.alpha = 120; - aiType = 100; + aiType = ProjectileID.DeathLaser; } public override void SendExtraAI(BinaryWriter writer) diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index 87c4be0bae..12d60f26d9 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -162,7 +162,7 @@ namespace CalamityMod.Projectiles.Boss num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitPlayer(Player target, int damage, bool crit) diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index dda1a2988f..8f5553b635 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Boss num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); projectile.damage = Main.expertMode ? 75 : 90; projectile.Damage(); } diff --git a/Projectiles/Boss/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index e73b6b146c..2443e6de78 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -153,7 +153,7 @@ namespace CalamityMod.Projectiles.Boss num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitPlayer(Player target, int damage, bool crit) diff --git a/Projectiles/Boss/HiveBombGoliath.cs b/Projectiles/Boss/HiveBombGoliath.cs index d8caa973cb..706050c1d3 100644 --- a/Projectiles/Boss/HiveBombGoliath.cs +++ b/Projectiles/Boss/HiveBombGoliath.cs @@ -113,7 +113,7 @@ namespace CalamityMod.Projectiles.Boss num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitPlayer(Player target, int damage, bool crit) diff --git a/Projectiles/Boss/IchorShot.cs b/Projectiles/Boss/IchorShot.cs index e33da37af9..efaee0c312 100644 --- a/Projectiles/Boss/IchorShot.cs +++ b/Projectiles/Boss/IchorShot.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; - projectile.velocity.Y = projectile.velocity.Y + 0.06f; + projectile.velocity.Y += 0.06f; projectile.velocity.X *= 0.995f; } diff --git a/Projectiles/Boss/ScavengerNuke.cs b/Projectiles/Boss/ScavengerNuke.cs index c93b901a56..9b78527422 100644 --- a/Projectiles/Boss/ScavengerNuke.cs +++ b/Projectiles/Boss/ScavengerNuke.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Boss num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } } } diff --git a/Projectiles/Enemy/EarthRockBig.cs b/Projectiles/Enemy/EarthRockBig.cs index 8b12ba1d48..5da084e7a8 100644 --- a/Projectiles/Enemy/EarthRockBig.cs +++ b/Projectiles/Enemy/EarthRockBig.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Enemy num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 8, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitPlayer(Player target, int damage, bool crit) diff --git a/Projectiles/Enemy/EarthRockSmall.cs b/Projectiles/Enemy/EarthRockSmall.cs index f9fc694331..98e51b084c 100644 --- a/Projectiles/Enemy/EarthRockSmall.cs +++ b/Projectiles/Enemy/EarthRockSmall.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Enemy num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 8, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitPlayer(Player target, int damage, bool crit) diff --git a/Projectiles/Enemy/InkBomb.cs b/Projectiles/Enemy/InkBombHostile.cs similarity index 92% rename from Projectiles/Enemy/InkBomb.cs rename to Projectiles/Enemy/InkBombHostile.cs index 4328710d49..404587d035 100644 --- a/Projectiles/Enemy/InkBomb.cs +++ b/Projectiles/Enemy/InkBombHostile.cs @@ -5,7 +5,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Enemy { - public class InkBomb : ModProjectile + public class InkBombHostile : ModProjectile { public override void SetStaticDefaults() { @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Enemy if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) { projectile.velocity.X = projectile.velocity.X * 0.97f; - if ((double)projectile.velocity.X > -0.01 && (double)projectile.velocity.X < 0.01) + if (projectile.velocity.X > -0.01f && projectile.velocity.X < 0.01f) { projectile.velocity.X = 0f; projectile.netUpdate = true; @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Enemy Vector2 vector15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); vector15.Normalize(); vector15 *= (float)Main.rand.Next(50, 401) * 0.01f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector15.X, vector15.Y, ModContent.ProjectileType() + Main.rand.Next(3), (int)((double)projectile.damage * 0.66), 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector15.X, vector15.Y, ModContent.ProjectileType() + Main.rand.Next(3), (int)(projectile.damage * 0.66), 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); } } projectile.position.X = projectile.position.X + (float)(projectile.width / 2); diff --git a/Projectiles/Enemy/InkBomb.png b/Projectiles/Enemy/InkBombHostile.png similarity index 100% rename from Projectiles/Enemy/InkBomb.png rename to Projectiles/Enemy/InkBombHostile.png diff --git a/Projectiles/Healing/ShinobiHealOrb.cs b/Projectiles/Healing/ShinobiHealOrb.cs index f1a9380519..0f8802326f 100644 --- a/Projectiles/Healing/ShinobiHealOrb.cs +++ b/Projectiles/Healing/ShinobiHealOrb.cs @@ -15,7 +15,6 @@ namespace CalamityMod.Projectiles.Healing { projectile.width = 20; projectile.height = 20; - aiType = ProjectileID.FrostWave; projectile.friendly = true; projectile.melee = true; projectile.tileCollide = false; diff --git a/Projectiles/Hybrid/TerraDiskProjectile.cs b/Projectiles/Hybrid/TerraDiskProjectile.cs index a1b023665f..1c1320a3ed 100644 --- a/Projectiles/Hybrid/TerraDiskProjectile.cs +++ b/Projectiles/Hybrid/TerraDiskProjectile.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.penetrate = -1; projectile.aiStyle = 3; projectile.timeLeft = 180; - aiType = 52; + aiType = ProjectileID.WoodenBoomerang; } public override void AI() diff --git a/Projectiles/Hybrid/TerraDiskProjectile2.cs b/Projectiles/Hybrid/TerraDiskProjectile2.cs index bb7c3c1d1a..7bcd55d058 100644 --- a/Projectiles/Hybrid/TerraDiskProjectile2.cs +++ b/Projectiles/Hybrid/TerraDiskProjectile2.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Hybrid projectile.penetrate = -1; projectile.aiStyle = 3; projectile.timeLeft = 60; - aiType = 52; + aiType = ProjectileID.WoodenBoomerang; } public override void AI() diff --git a/Projectiles/Magic/AcidicSaxBubble.cs b/Projectiles/Magic/AcidicSaxBubble.cs index cdb82843ab..3d1ae98cc3 100644 --- a/Projectiles/Magic/AcidicSaxBubble.cs +++ b/Projectiles/Magic/AcidicSaxBubble.cs @@ -109,12 +109,12 @@ namespace CalamityMod.Projectiles.Magic projectile.Kill(); } } - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 3, false); + projectile.ModifyHitNPCSticky(3, false); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Magic/BeamingBolt.cs b/Projectiles/Magic/BeamingBolt.cs index d73e0d7aaf..38ad3ba37f 100644 --- a/Projectiles/Magic/BeamingBolt.cs +++ b/Projectiles/Magic/BeamingBolt.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { @@ -14,10 +15,8 @@ namespace CalamityMod.Projectiles.Magic public override void SetDefaults() { - projectile.width = 30; - projectile.height = 30; + projectile.width = projectile.height = 30; projectile.friendly = true; - projectile.alpha = 0; projectile.timeLeft = 120; projectile.penetrate = -1; projectile.magic = true; @@ -75,7 +74,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(projectile.damage * 0.75), projectile.knockBack, projectile.owner, projectile.ai[0], 0f); } } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 105); + Main.PlaySound(SoundID.Item105, projectile.position); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Magic/ForbiddenSunProjectile.cs b/Projectiles/Magic/ForbiddenSunProjectile.cs index cbb7db1bf6..e770146004 100644 --- a/Projectiles/Magic/ForbiddenSunProjectile.cs +++ b/Projectiles/Magic/ForbiddenSunProjectile.cs @@ -25,12 +25,10 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); - projectile.frameCounter++; - if (projectile.frameCounter > 4) + projectile.rotation = projectile.velocity.ToRotation(); + if (projectile.frameCounter++ % 4 == 0) { projectile.frame++; - projectile.frameCounter = 0; } if (projectile.frame >= Main.projFrames[projectile.type]) { diff --git a/Projectiles/Magic/LiquidBlade.cs b/Projectiles/Magic/LiquidBlade.cs index 0e2c572a75..46aeaeea72 100644 --- a/Projectiles/Magic/LiquidBlade.cs +++ b/Projectiles/Magic/LiquidBlade.cs @@ -149,10 +149,10 @@ namespace CalamityMod.Projectiles.Magic { Projectile.NewProjectile(vector2.X, vector2.Y, speedX, speedY, ModContent.ProjectileType(), (int)(projectile.damage * 0.75), 1f, projectile.owner); } - target.AddBuff(BuffID.Ichor, 200); - target.AddBuff(BuffID.Frostburn, 200); - target.AddBuff(BuffID.OnFire, 200); - target.AddBuff(BuffID.CursedInferno, 100); + target.AddBuff(BuffID.Ichor, 240); + target.AddBuff(BuffID.Frostburn, 240); + target.AddBuff(BuffID.OnFire, 240); + target.AddBuff(BuffID.CursedInferno, 120); } } } diff --git a/Projectiles/Magic/LiquidBlade2.cs b/Projectiles/Magic/LiquidBlade2.cs index 613abf79c2..a3e7f5672c 100644 --- a/Projectiles/Magic/LiquidBlade2.cs +++ b/Projectiles/Magic/LiquidBlade2.cs @@ -119,10 +119,10 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - target.AddBuff(BuffID.Ichor, 200); - target.AddBuff(BuffID.Frostburn, 200); - target.AddBuff(BuffID.OnFire, 200); - target.AddBuff(BuffID.CursedInferno, 100); + target.AddBuff(BuffID.Ichor, 240); + target.AddBuff(BuffID.Frostburn, 240); + target.AddBuff(BuffID.OnFire, 240); + target.AddBuff(BuffID.CursedInferno, 120); } } } diff --git a/Projectiles/Magic/Snowflake.cs b/Projectiles/Magic/Snowflake.cs index 5a147f7d12..a7ce271023 100644 --- a/Projectiles/Magic/Snowflake.cs +++ b/Projectiles/Magic/Snowflake.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Magic projectile.penetrate = -1; projectile.timeLeft = 600; projectile.magic = true; - aiType = 491; + aiType = ProjectileID.FlyingKnife; projectile.coldDamage = true; } diff --git a/Projectiles/Magic/WaterLeechProj.cs b/Projectiles/Magic/WaterLeechProj.cs index 40bff612ec..a60506e4b0 100644 --- a/Projectiles/Magic/WaterLeechProj.cs +++ b/Projectiles/Magic/WaterLeechProj.cs @@ -43,12 +43,12 @@ namespace CalamityMod.Projectiles.Magic projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + MathHelper.Pi; } //Sticky Behaviour - CalamityUtils.StickyProjAI(projectile, 5); + projectile.StickyProjAI(5); } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 3, false); + projectile.ModifyHitNPCSticky(3, false); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/BansheeHookScythe.cs b/Projectiles/Melee/BansheeHookScythe.cs index b09579d645..31e5a2e40b 100644 --- a/Projectiles/Melee/BansheeHookScythe.cs +++ b/Projectiles/Melee/BansheeHookScythe.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -22,7 +23,7 @@ namespace CalamityMod.Projectiles.Melee projectile.penetrate = 5; projectile.timeLeft = 180; projectile.ignoreWater = true; - aiType = 274; + aiType = ProjectileID.DeathSickle; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 3; } diff --git a/Projectiles/Melee/BlazingPhantomBlade.cs b/Projectiles/Melee/BlazingPhantomBlade.cs index 9266c9b913..7cfd182482 100644 --- a/Projectiles/Melee/BlazingPhantomBlade.cs +++ b/Projectiles/Melee/BlazingPhantomBlade.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Melee projectile.penetrate = 5; projectile.timeLeft = 180; projectile.ignoreWater = true; - aiType = 274; + aiType = ProjectileID.DeathSickle; } public override void AI() diff --git a/Projectiles/Melee/BlueAura.cs b/Projectiles/Melee/BlueAura.cs index 2f06f51597..ca5067e899 100644 --- a/Projectiles/Melee/BlueAura.cs +++ b/Projectiles/Melee/BlueAura.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Projectiles.Melee { projectile.width = 20; projectile.height = 20; - aiType = 348; projectile.friendly = true; projectile.melee = true; projectile.tileCollide = false; diff --git a/Projectiles/Melee/BonebreakerProjectile.cs b/Projectiles/Melee/BonebreakerProjectile.cs index 7560a3df50..cdafa10941 100644 --- a/Projectiles/Melee/BonebreakerProjectile.cs +++ b/Projectiles/Melee/BonebreakerProjectile.cs @@ -54,12 +54,12 @@ namespace CalamityMod.Projectiles.Melee projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + MathHelper.PiOver2; } //Sticky Behaviour - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 6, false); + projectile.ModifyHitNPCSticky(6, false); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Melee/BrimstoneLaserFriendly.cs b/Projectiles/Melee/BrimstoneLaserFriendly.cs index 8db8363283..762fa42ec5 100644 --- a/Projectiles/Melee/BrimstoneLaserFriendly.cs +++ b/Projectiles/Melee/BrimstoneLaserFriendly.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -19,7 +20,7 @@ namespace CalamityMod.Projectiles.Melee projectile.width = 2; projectile.height = 2; projectile.aiStyle = 1; - aiType = 100; + aiType = ProjectileID.DeathLaser; projectile.friendly = true; projectile.melee = true; projectile.scale = 2f; diff --git a/Projectiles/Melee/CrescentMoonProj.cs b/Projectiles/Melee/CrescentMoonProj.cs index 925b0ea343..e7e46a8137 100644 --- a/Projectiles/Melee/CrescentMoonProj.cs +++ b/Projectiles/Melee/CrescentMoonProj.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Melee projectile.localNPCHitCooldown = 10; projectile.extraUpdates = 1; projectile.aiStyle = 18; - aiType = 274; + aiType = ProjectileID.DeathSickle; } public override void AI() diff --git a/Projectiles/Melee/DNA.cs b/Projectiles/Melee/DNA.cs index 7c191175f4..157b1c9a72 100644 --- a/Projectiles/Melee/DNA.cs +++ b/Projectiles/Melee/DNA.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Melee projectile.penetrate = -1; projectile.tileCollide = false; projectile.melee = true; - aiType = 493; + aiType = ProjectileID.CrystalVileShardHead; } public override void AI() diff --git a/Projectiles/Melee/DNA2.cs b/Projectiles/Melee/DNA2.cs index 643b147d8c..73a8f21372 100644 --- a/Projectiles/Melee/DNA2.cs +++ b/Projectiles/Melee/DNA2.cs @@ -1,6 +1,7 @@ using CalamityMod.CalPlayer; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -21,7 +22,7 @@ namespace CalamityMod.Projectiles.Melee projectile.penetrate = -1; projectile.tileCollide = false; projectile.melee = true; - aiType = 494; + aiType = ProjectileID.CrystalVileShardShaft; } public override void AI() diff --git a/Projectiles/Melee/DragonRageProj.cs b/Projectiles/Melee/DragonRageProj.cs index 86513eade7..671018b52f 100644 --- a/Projectiles/Melee/DragonRageProj.cs +++ b/Projectiles/Melee/DragonRageProj.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Melee num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } } } diff --git a/Projectiles/Melee/Earth3.cs b/Projectiles/Melee/Earth3.cs index d4046ae419..5cadbb8afb 100644 --- a/Projectiles/Melee/Earth3.cs +++ b/Projectiles/Melee/Earth3.cs @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Melee num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/EssenceScythe.cs b/Projectiles/Melee/EssenceScythe.cs index de27177abd..1944665937 100644 --- a/Projectiles/Melee/EssenceScythe.cs +++ b/Projectiles/Melee/EssenceScythe.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee projectile.penetrate = 10; projectile.timeLeft = 300; projectile.ignoreWater = true; - aiType = 274; + aiType = ProjectileID.DeathSickle; } public override void AI() diff --git a/Projectiles/Melee/GalileosPlanet.cs b/Projectiles/Melee/GalileosPlanet.cs index 07b18d4aa5..800ba661f9 100644 --- a/Projectiles/Melee/GalileosPlanet.cs +++ b/Projectiles/Melee/GalileosPlanet.cs @@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[num21].velocity *= 2; } } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/GelWave.cs b/Projectiles/Melee/GelWave.cs index c15068673d..996d4c22a3 100644 --- a/Projectiles/Melee/GelWave.cs +++ b/Projectiles/Melee/GelWave.cs @@ -20,7 +20,6 @@ namespace CalamityMod.Projectiles.Melee { projectile.width = 30; projectile.height = 30; - aiType = ProjectileID.FrostWave; projectile.friendly = true; projectile.ignoreWater = true; projectile.melee = true; diff --git a/Projectiles/Melee/InsidiousHarpoon.cs b/Projectiles/Melee/InsidiousHarpoon.cs index 5dff9df1da..f395b7deba 100644 --- a/Projectiles/Melee/InsidiousHarpoon.cs +++ b/Projectiles/Melee/InsidiousHarpoon.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Melee projectile.rotation += projectile.spriteDirection * MathHelper.ToRadians(45f); } //Sticky Behaviour - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); if (projectile.ai[0] == 2f) { projectile.velocity *= 0f; @@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Melee public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 20, true); + projectile.ModifyHitNPCSticky(20, true); } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Melee/PlagueBeeDust.cs b/Projectiles/Melee/PlagueBeeDust.cs index 78ebebf984..148a617f39 100644 --- a/Projectiles/Melee/PlagueBeeDust.cs +++ b/Projectiles/Melee/PlagueBeeDust.cs @@ -7,126 +7,123 @@ using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Projectiles.Melee { - public class PlagueBeeDust : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dust"); - Main.projFrames[projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + public class PlagueBeeDust : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dust"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void SetDefaults() - { - projectile.width = 70; - projectile.height = 70; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.melee = true; - projectile.penetrate = -1; - projectile.extraUpdates = 3; - projectile.timeLeft = 150; - } + public override void SetDefaults() + { + projectile.width = 70; + projectile.height = 70; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.melee = true; + projectile.penetrate = -1; + projectile.extraUpdates = 3; + projectile.timeLeft = 150; + projectile.alpha = 100; + } - public override void AI() - { - projectile.ai[1]++; - Lighting.AddLight(projectile.Center, 0.05f, 0.4f, 0f); - if (projectile.ai[1] < 60f) - { - if (projectile.ai[0] > 7f) - { - float num296 = 1f; - if (projectile.ai[0] == 8f) - { - num296 = 0.25f; - } - else if (projectile.ai[0] == 9f) - { - num296 = 0.5f; - } - else if (projectile.ai[0] == 10f) - { - num296 = 0.75f; - } - projectile.ai[0] += 1f; - if (projectile.ai[0] % 2f == 0f) - { - int spawnX = (int)(projectile.width / 2); - int spawnY = (int)(projectile.width / 2); - int bee = Projectile.NewProjectile(projectile.Center.X + (float)Main.rand.Next(-spawnX, spawnX), projectile.Center.Y + (float)Main.rand.Next(-spawnY, spawnY), - projectile.velocity.X, projectile.velocity.Y, Main.player[projectile.owner].beeType(), - Main.player[projectile.owner].beeDamage(projectile.damage / 3), Main.player[projectile.owner].beeKB(0f), projectile.owner, 0f, 0f); - Main.projectile[bee].penetrate = 1; + public override void AI() + { + Player player = Main.player[projectile.owner]; + projectile.ai[1]++; + Lighting.AddLight(projectile.Center, 0.05f, 0.4f, 0f); + if (projectile.ai[1] < 60f) + { + if (projectile.ai[0] > 7f) + { + float scalar = 1f; + if (projectile.ai[0] == 8f) + { + scalar = 0.25f; + } + else if (projectile.ai[0] == 9f) + { + scalar = 0.5f; + } + else if (projectile.ai[0] == 10f) + { + scalar = 0.75f; + } + projectile.ai[0] += 1f; + if (projectile.ai[0] % 2f == 0f) + { + int spawnX = (int)(projectile.width / 2); + int spawnY = (int)(projectile.width / 2); + int bee = Projectile.NewProjectile(projectile.Center.X + (float)Main.rand.Next(-spawnX, spawnX), projectile.Center.Y + (float)Main.rand.Next(-spawnY, spawnY), projectile.velocity.X, projectile.velocity.Y, player.beeType(), player.beeDamage(projectile.damage / 3), player.beeKB(0f), projectile.owner, 0f, 0f); + Main.projectile[bee].penetrate = 1; Main.projectile[bee].Calamity().forceMelee = true; - } - int num297 = 89; - //Dust - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); - Dust dust = Main.dust[num299]; - if (Main.rand.NextBool(3)) - { - dust.noGravity = true; - dust.scale *= 1.8f; - dust.velocity.X *= 2f; - dust.velocity.Y *= 2f; - } - else - { - dust.scale *= 1.3f; - } - dust.velocity.X *= 1.2f; - dust.velocity.Y *= 1.2f; - dust.scale *= num296; + } + //Dust + int dustType = 89; + int plague = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + Dust dust = Main.dust[plague]; + if (Main.rand.NextBool(3)) + { + dust.noGravity = true; + dust.scale *= 1.8f; + dust.velocity.X *= 2f; + dust.velocity.Y *= 2f; + } + else + { + dust.scale *= 1.3f; + } + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; + dust.scale *= scalar; + } + else + { + projectile.ai[0] += 1f; + } + } + else + { + projectile.damage = (int)(projectile.damage * 0.6); + projectile.velocity *= 0.85f; + //Fade out + if (projectile.alpha < 255) + projectile.alpha += 5; + if (projectile.alpha >= 255) + projectile.Kill(); + } - } - else - { - projectile.ai[0] += 1f; - } - } - else - { - projectile.damage = 0; - projectile.velocity *= 0.99f; - //Fade out - if (projectile.alpha < 255) - projectile.alpha += 5; - if (projectile.alpha > 255) - projectile.alpha = 255; - if (projectile.ai[1] >= 150) - projectile.Kill(); - } + //Rotation + projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); - //Rotation - projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); - projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); + //Animation + projectile.frameCounter++; + if (projectile.frameCounter > 8) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + } - //Animation - projectile.frameCounter++; - if (projectile.frameCounter > 8) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - projectile.frame = 0; - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.immune[projectile.owner] = 8; + target.AddBuff(ModContent.BuffType(), 180); + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 8; - target.AddBuff(ModContent.BuffType(), 180); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } } diff --git a/Projectiles/Melee/PlagueDust.cs b/Projectiles/Melee/PlagueDust.cs index 3eb0abf276..5d1f2aa715 100644 --- a/Projectiles/Melee/PlagueDust.cs +++ b/Projectiles/Melee/PlagueDust.cs @@ -6,114 +6,113 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class PlagueDust : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dust"); - Main.projFrames[projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + public class PlagueDust : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dust"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void SetDefaults() - { - projectile.width = 70; - projectile.height = 70; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.melee = true; - projectile.penetrate = -1; - projectile.extraUpdates = 3; - projectile.timeLeft = 150; - } + public override void SetDefaults() + { + projectile.width = 70; + projectile.height = 70; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.melee = true; + projectile.penetrate = -1; + projectile.extraUpdates = 3; + projectile.timeLeft = 150; + projectile.alpha = 100; + } - public override void AI() - { - projectile.ai[1]++; - Lighting.AddLight(projectile.Center, 0.05f, 0.4f, 0f); - if (projectile.ai[1] < 60) - { - if (projectile.ai[0] > 7f) - { - float num296 = 1f; - if (projectile.ai[0] == 8f) - { - num296 = 0.25f; - } - else if (projectile.ai[0] == 9f) - { - num296 = 0.5f; - } - else if (projectile.ai[0] == 10f) - { - num296 = 0.75f; - } - projectile.ai[0] += 1f; - int num297 = 89; - //Dust - int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); - Dust dust = Main.dust[num299]; - if (Main.rand.NextBool(3)) - { - dust.noGravity = true; - dust.scale *= 1.8f; - dust.velocity.X *= 2f; - dust.velocity.Y *= 2f; - } - else - { - dust.scale *= 1.3f; - } - dust.velocity.X *= 1.2f; - dust.velocity.Y *= 1.2f; - dust.scale *= num296; - } - else - { - projectile.ai[0] += 1f; - } - } - else - { - projectile.damage = 0; - projectile.velocity *= 0.99f; - //Fade out - if (projectile.alpha < 255) - projectile.alpha += 5; - if (projectile.alpha > 255) - projectile.alpha = 255; - if (projectile.ai[1] >= 150) - projectile.Kill(); - } - //Rotation - projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); - projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); + public override void AI() + { + projectile.ai[1]++; + Lighting.AddLight(projectile.Center, 0.05f, 0.4f, 0f); + if (projectile.ai[1] < 60) + { + if (projectile.ai[0] > 7f) + { + float scalar = 1f; + if (projectile.ai[0] == 8f) + { + scalar = 0.25f; + } + else if (projectile.ai[0] == 9f) + { + scalar = 0.5f; + } + else if (projectile.ai[0] == 10f) + { + scalar = 0.75f; + } + projectile.ai[0] += 1f; + //Dust + int dustType = 89; + int plague = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + Dust dust = Main.dust[plague]; + if (Main.rand.NextBool(3)) + { + dust.noGravity = true; + dust.scale *= 1.8f; + dust.velocity.X *= 2f; + dust.velocity.Y *= 2f; + } + else + { + dust.scale *= 1.3f; + } + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; + dust.scale *= scalar; + } + else + { + projectile.ai[0] += 1f; + } + } + else + { + projectile.damage = (int)(projectile.damage * 0.6); + projectile.velocity *= 0.85f; + //Fade out + if (projectile.alpha < 255) + projectile.alpha += 5; + if (projectile.alpha >= 255) + projectile.Kill(); + } + //Rotation + projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); - //Animation - projectile.frameCounter++; - if (projectile.frameCounter > 8) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - { - projectile.frame = 0; - } - } + //Animation + projectile.frameCounter++; + if (projectile.frameCounter > 8) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 5; - target.AddBuff(ModContent.BuffType(), 120); - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.immune[projectile.owner] = 5; + target.AddBuff(ModContent.BuffType(), 120); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } } diff --git a/Projectiles/Melee/PrismaticWave.cs b/Projectiles/Melee/PrismaticWave.cs index 130da32740..eec9f82e40 100644 --- a/Projectiles/Melee/PrismaticWave.cs +++ b/Projectiles/Melee/PrismaticWave.cs @@ -50,7 +50,6 @@ namespace CalamityMod.Projectiles.Melee { projectile.width = 36; projectile.height = 36; - aiType = ProjectileID.FrostWave; projectile.friendly = true; projectile.ignoreWater = true; projectile.ranged = true; diff --git a/Projectiles/Melee/TerraEdgeBeam.cs b/Projectiles/Melee/TerraEdgeBeam.cs index f1419d3d33..7e291378f1 100644 --- a/Projectiles/Melee/TerraEdgeBeam.cs +++ b/Projectiles/Melee/TerraEdgeBeam.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Melee projectile.melee = true; projectile.penetrate = 3; projectile.timeLeft = 600; - aiType = 132; + aiType = ProjectileID.TerraBeam; } public override void AI() diff --git a/Projectiles/Melee/UrchinBallSpike.cs b/Projectiles/Melee/UrchinBallSpike.cs index 47e23b7897..6681fb93ea 100644 --- a/Projectiles/Melee/UrchinBallSpike.cs +++ b/Projectiles/Melee/UrchinBallSpike.cs @@ -33,12 +33,12 @@ namespace CalamityMod.Projectiles.Melee projectile.spriteDirection = projectile.direction; } //Sticky Behaviour - CalamityUtils.StickyProjAI(projectile, 6); + projectile.StickyProjAI(6); } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 6, false); + projectile.ModifyHitNPCSticky(6, false); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs b/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs index 9d885753b9..9407653a75 100644 --- a/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs +++ b/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs @@ -84,6 +84,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void Kill(int timeLeft) { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/MicrowaveBeep"), (int)projectile.Center.X, (int)projectile.Center.Y); mmmmmm?.Stop(); mmmmmm?.Dispose(); } diff --git a/Projectiles/Ranged/AMR2.cs b/Projectiles/Ranged/AMR2.cs index 1561160879..6f24ad444f 100644 --- a/Projectiles/Ranged/AMR2.cs +++ b/Projectiles/Ranged/AMR2.cs @@ -1,3 +1,4 @@ +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -21,7 +22,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.ignoreWater = true; projectile.aiStyle = 1; - aiType = 242; + aiType = ProjectileID.BulletHighVelocity; projectile.penetrate = 1; projectile.timeLeft = 600; } diff --git a/Projectiles/Ranged/BallistaGreatArrow.cs b/Projectiles/Ranged/BallistaGreatArrow.cs index adb0166742..f68b286d64 100644 --- a/Projectiles/Ranged/BallistaGreatArrow.cs +++ b/Projectiles/Ranged/BallistaGreatArrow.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.arrow = true; projectile.penetrate = 2; projectile.aiStyle = 1; - aiType = 1; + aiType = ProjectileID.WoodenArrowFriendly; } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Ranged/BeeRPG.cs b/Projectiles/Ranged/BeeRPG.cs index 9e4e8c21e0..a5d6284419 100644 --- a/Projectiles/Ranged/BeeRPG.cs +++ b/Projectiles/Ranged/BeeRPG.cs @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Ranged num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Ranged/BigNuke.cs b/Projectiles/Ranged/BigNuke.cs index 37922be5c9..616e02a28b 100644 --- a/Projectiles/Ranged/BigNuke.cs +++ b/Projectiles/Ranged/BigNuke.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Ranged num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 9); + projectile.ExplosionGores(9); } } } diff --git a/Projectiles/Ranged/CardDiamond.cs b/Projectiles/Ranged/CardDiamond.cs index ebb8b18787..2fdbf43907 100644 --- a/Projectiles/Ranged/CardDiamond.cs +++ b/Projectiles/Ranged/CardDiamond.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Ranged num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 30, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Ranged/ElysianArrowProj.cs b/Projectiles/Ranged/ElysianArrowProj.cs index ea2f43977c..77878e655d 100644 --- a/Projectiles/Ranged/ElysianArrowProj.cs +++ b/Projectiles/Ranged/ElysianArrowProj.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Ranged num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); float x = projectile.position.X + (float)Main.rand.Next(-400, 400); float y = projectile.position.Y - (float)Main.rand.Next(500, 800); Vector2 vector = new Vector2(x, y); diff --git a/Projectiles/Ranged/EmesisGore.cs b/Projectiles/Ranged/EmesisGore.cs index 27d0c67df6..e31c82702e 100644 --- a/Projectiles/Ranged/EmesisGore.cs +++ b/Projectiles/Ranged/EmesisGore.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Ranged } public override void AI() { - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); // Override the default DOT used in the method above. if (projectile.ai[0] == 1f) @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Ranged public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 8, true); + projectile.ModifyHitNPCSticky(8, true); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Ranged/ExoLightBurst.cs b/Projectiles/Ranged/ExoLightBurst.cs index b34a586853..f6545889c5 100644 --- a/Projectiles/Ranged/ExoLightBurst.cs +++ b/Projectiles/Ranged/ExoLightBurst.cs @@ -61,11 +61,11 @@ namespace CalamityMod.Projectiles.Ranged } } } - CalamityUtils.StickyProjAI(projectile, 5); + projectile.StickyProjAI(5); } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 4, false); + projectile.ModifyHitNPCSticky(4, false); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Ranged/ExplodingStake.cs b/Projectiles/Ranged/ExplodingStake.cs index 6e06e2293f..4e57b6f021 100644 --- a/Projectiles/Ranged/ExplodingStake.cs +++ b/Projectiles/Ranged/ExplodingStake.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.scale = 0.8f; projectile.extraUpdates = 3; projectile.aiStyle = 1; - aiType = 323; + aiType = ProjectileID.Stake; } public override void AI() diff --git a/Projectiles/Ranged/FlamingStake.cs b/Projectiles/Ranged/FlamingStake.cs index 645e97232a..aa2e150a3d 100644 --- a/Projectiles/Ranged/FlamingStake.cs +++ b/Projectiles/Ranged/FlamingStake.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.alpha = 255; projectile.extraUpdates = 3; projectile.aiStyle = 1; - aiType = 323; + aiType = ProjectileID.Stake; } public override void AI() diff --git a/Projectiles/Ranged/FossilShard.cs b/Projectiles/Ranged/FossilShard.cs index e0da13936a..6a2444b113 100644 --- a/Projectiles/Ranged/FossilShard.cs +++ b/Projectiles/Ranged/FossilShard.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.StatDebuffs; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -19,7 +20,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.aiStyle = 1; projectile.timeLeft = 120; - aiType = 1; + aiType = ProjectileID.WoodenArrowFriendly; } public override void AI() diff --git a/Projectiles/Ranged/GoliathRocket.cs b/Projectiles/Ranged/GoliathRocket.cs index 5110295332..ec81057cfc 100644 --- a/Projectiles/Ranged/GoliathRocket.cs +++ b/Projectiles/Ranged/GoliathRocket.cs @@ -156,7 +156,7 @@ namespace CalamityMod.Projectiles.Ranged num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Ranged/HandheldTankShell.cs b/Projectiles/Ranged/HandheldTankShell.cs index effbbe3a81..45df4038f5 100644 --- a/Projectiles/Ranged/HandheldTankShell.cs +++ b/Projectiles/Ranged/HandheldTankShell.cs @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Ranged } // Smoke, which counts as a Gore - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } } } diff --git a/Projectiles/Ranged/HiveBomb.cs b/Projectiles/Ranged/HiveBomb.cs index 44bcc0fcbf..5505a6dfe6 100644 --- a/Projectiles/Ranged/HiveBomb.cs +++ b/Projectiles/Ranged/HiveBomb.cs @@ -156,7 +156,7 @@ namespace CalamityMod.Projectiles.Ranged num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Ranged/HiveMissile.cs b/Projectiles/Ranged/HiveMissile.cs index 7ca2d9624d..d906d4be11 100644 --- a/Projectiles/Ranged/HiveMissile.cs +++ b/Projectiles/Ranged/HiveMissile.cs @@ -156,7 +156,7 @@ namespace CalamityMod.Projectiles.Ranged num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 90, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } } } diff --git a/Projectiles/Ranged/MagnomalyRocket.cs b/Projectiles/Ranged/MagnomalyRocket.cs index ebc84779fa..358748903c 100644 --- a/Projectiles/Ranged/MagnomalyRocket.cs +++ b/Projectiles/Ranged/MagnomalyRocket.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Ranged num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num298, 0f, 0f, 100, default, 0.75f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 10); + projectile.ExplosionGores(10); } } diff --git a/Projectiles/Ranged/MiniRocket.cs b/Projectiles/Ranged/MiniRocket.cs index 4be243b865..a627006b3f 100644 --- a/Projectiles/Ranged/MiniRocket.cs +++ b/Projectiles/Ranged/MiniRocket.cs @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Ranged num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } } } diff --git a/Projectiles/Ranged/MistArrow.cs b/Projectiles/Ranged/MistArrow.cs index 328d472513..a4c846cd12 100644 --- a/Projectiles/Ranged/MistArrow.cs +++ b/Projectiles/Ranged/MistArrow.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.aiStyle = 1; projectile.timeLeft = 300; - aiType = 1; + aiType = ProjectileID.WoodenArrowFriendly; projectile.arrow = true; projectile.coldDamage = true; } diff --git a/Projectiles/Ranged/MortarRoundProj.cs b/Projectiles/Ranged/MortarRoundProj.cs index c574334730..e5c727f691 100644 --- a/Projectiles/Ranged/MortarRoundProj.cs +++ b/Projectiles/Ranged/MortarRoundProj.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Ranged num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); if (projectile.owner == Main.myPlayer) { int num814 = 5; diff --git a/Projectiles/Ranged/NapalmArrowProj.cs b/Projectiles/Ranged/NapalmArrowProj.cs index 746ebbc87b..dedd67315a 100644 --- a/Projectiles/Ranged/NapalmArrowProj.cs +++ b/Projectiles/Ranged/NapalmArrowProj.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); if (projectile.owner == Main.myPlayer) { for (int num252 = 0; num252 < 3; num252++) diff --git a/Projectiles/Ranged/Nuke.cs b/Projectiles/Ranged/Nuke.cs index c92614ff2b..d29d635ad9 100644 --- a/Projectiles/Ranged/Nuke.cs +++ b/Projectiles/Ranged/Nuke.cs @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Ranged num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 10); + projectile.ExplosionGores(10); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Ranged/PlagueArrow.cs b/Projectiles/Ranged/PlagueArrow.cs index aec0a0cbbc..6490b0ae85 100644 --- a/Projectiles/Ranged/PlagueArrow.cs +++ b/Projectiles/Ranged/PlagueArrow.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.aiStyle = 1; projectile.timeLeft = 600; - aiType = 1; + aiType = ProjectileID.WoodenArrowFriendly; } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/PlanarRipperBolt.cs b/Projectiles/Ranged/PlanarRipperBolt.cs index 870632a0d8..60db04bcb7 100644 --- a/Projectiles/Ranged/PlanarRipperBolt.cs +++ b/Projectiles/Ranged/PlanarRipperBolt.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 600; projectile.ranged = true; projectile.aiStyle = 1; - aiType = 242; + aiType = ProjectileID.BulletHighVelocity; } public override void AI() diff --git a/Projectiles/Ranged/PlasmaBlast.cs b/Projectiles/Ranged/PlasmaBlast.cs index b852422d7e..bc6f5d6735 100644 --- a/Projectiles/Ranged/PlasmaBlast.cs +++ b/Projectiles/Ranged/PlasmaBlast.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.timeLeft = 600; projectile.ignoreWater = true; - aiType = 503; } public override void AI() diff --git a/Projectiles/Ranged/RubberMortarRoundProj.cs b/Projectiles/Ranged/RubberMortarRoundProj.cs index bd60f48538..0ed94ee191 100644 --- a/Projectiles/Ranged/RubberMortarRoundProj.cs +++ b/Projectiles/Ranged/RubberMortarRoundProj.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Ranged num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); if (projectile.owner == Main.myPlayer) { int num814 = 5; diff --git a/Projectiles/Ranged/SlashRound.cs b/Projectiles/Ranged/SlashRound.cs index 0be707d289..c95c64aa1f 100644 --- a/Projectiles/Ranged/SlashRound.cs +++ b/Projectiles/Ranged/SlashRound.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -22,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.ignoreWater = true; projectile.aiStyle = 1; - aiType = 242; + aiType = ProjectileID.BulletHighVelocity; projectile.penetrate = 1; projectile.timeLeft = 600; } diff --git a/Projectiles/Ranged/SpykerProj.cs b/Projectiles/Ranged/SpykerProj.cs index e20aa2169b..259b2d3042 100644 --- a/Projectiles/Ranged/SpykerProj.cs +++ b/Projectiles/Ranged/SpykerProj.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.extraUpdates = 2; projectile.aiStyle = 93; - aiType = 514; + aiType = ProjectileID.NailFriendly; } public override void AI() diff --git a/Projectiles/Ranged/SulphuricAcidBubble2.cs b/Projectiles/Ranged/SulphuricAcidBubble2.cs index 7535d82ea0..3ceba84047 100644 --- a/Projectiles/Ranged/SulphuricAcidBubble2.cs +++ b/Projectiles/Ranged/SulphuricAcidBubble2.cs @@ -106,12 +106,12 @@ namespace CalamityMod.Projectiles.Ranged projectile.Kill(); } } - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 3, false); + projectile.ModifyHitNPCSticky(3, false); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Ranged/TelluricGlareProj.cs b/Projectiles/Ranged/TelluricGlareProj.cs index caa48a860f..0f9c86ca28 100644 --- a/Projectiles/Ranged/TelluricGlareProj.cs +++ b/Projectiles/Ranged/TelluricGlareProj.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.aiStyle = 1; projectile.timeLeft = 300; projectile.arrow = true; - aiType = 1; + aiType = ProjectileID.WoodenArrowFriendly; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 1; } diff --git a/Projectiles/Ranged/TyphoonArrow.cs b/Projectiles/Ranged/TyphoonArrow.cs index 135b6e21c8..656ef65779 100644 --- a/Projectiles/Ranged/TyphoonArrow.cs +++ b/Projectiles/Ranged/TyphoonArrow.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { @@ -19,7 +20,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.aiStyle = 1; projectile.timeLeft = 600; - aiType = 1; + aiType = ProjectileID.WoodenArrowFriendly; } public override void Kill(int timeLeft) diff --git a/Projectiles/Ranged/Voidragon.cs b/Projectiles/Ranged/Voidragon.cs index 5e799fd498..e12926a541 100644 --- a/Projectiles/Ranged/Voidragon.cs +++ b/Projectiles/Ranged/Voidragon.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.timeLeft = 600; projectile.ignoreWater = true; - aiType = 503; } public override void AI() diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index 228ddf7dee..7b76aa05f5 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -152,7 +152,7 @@ namespace CalamityMod.Projectiles.Rogue num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Rogue/BettyExplosion.cs b/Projectiles/Rogue/BettyExplosion.cs index 96371c4c0f..d0d71d8722 100644 --- a/Projectiles/Rogue/BettyExplosion.cs +++ b/Projectiles/Rogue/BettyExplosion.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Rogue } // Smoke, which counts as a Gore - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } } diff --git a/Projectiles/Rogue/BlastBarrelProjectile.cs b/Projectiles/Rogue/BlastBarrelProjectile.cs index 2ead573d84..b57ad8b134 100644 --- a/Projectiles/Rogue/BlastBarrelProjectile.cs +++ b/Projectiles/Rogue/BlastBarrelProjectile.cs @@ -81,13 +81,9 @@ namespace CalamityMod.Projectiles.Rogue else { Vector2 fireVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(40f)); - int fireIndex = Projectile.NewProjectile(projectile.Center, projectile.velocity + fireVelocity, - Main.rand.Next(ProjectileID.MolotovFire, ProjectileID.MolotovFire3 + 1), - (int)(projectile.damage * 0.75f), 1f, projectile.owner); - Main.projectile[fireIndex].Calamity().forceRogue = true; + int fireIndex = Projectile.NewProjectile(projectile.Center, projectile.velocity + fireVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.75f), 1f, projectile.owner); Main.projectile[fireIndex].timeLeft = 300; - Main.projectile[fireIndex].usesLocalNPCImmunity = true; - Main.projectile[fireIndex].localNPCHitCooldown = -1; + Main.projectile[fireIndex].penetrate = 3; } } projectile.ai[1]--; diff --git a/Projectiles/Rogue/BouncingBettyProjectile.cs b/Projectiles/Rogue/BouncingBettyProjectile.cs index fb059edbe4..c3b1bfcbf2 100644 --- a/Projectiles/Rogue/BouncingBettyProjectile.cs +++ b/Projectiles/Rogue/BouncingBettyProjectile.cs @@ -40,13 +40,7 @@ namespace CalamityMod.Projectiles.Rogue else { Vector2 fireVelocity = (Vector2.UnitY * (-6f + Main.rand.NextFloat(-6f, 2f))).RotatedByRandom((double)MathHelper.ToRadians(40f)); - int fireIndex = Projectile.NewProjectile(projectile.Center, projectile.velocity + fireVelocity, - Main.rand.Next(ProjectileID.MolotovFire, ProjectileID.MolotovFire3 + 1), - (int)(projectile.damage * 0.6f), 1f, projectile.owner); - Main.projectile[fireIndex].thrown = false; - Main.projectile[fireIndex].Calamity().forceRogue = true; - Main.projectile[fireIndex].penetrate = -1; - Main.projectile[fireIndex].usesLocalNPCImmunity = true; + int fireIndex = Projectile.NewProjectile(projectile.Center, projectile.velocity + fireVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.6f), 1f, projectile.owner); Main.projectile[fireIndex].localNPCHitCooldown = 9; Main.projectile[fireIndex].timeLeft = 240; } diff --git a/Projectiles/Rogue/CarvingFork.cs b/Projectiles/Rogue/CarvingFork.cs index 54ce3829da..6508ed2839 100644 --- a/Projectiles/Rogue/CarvingFork.cs +++ b/Projectiles/Rogue/CarvingFork.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.penetrate = -1; projectile.aiStyle = 113; projectile.timeLeft = 600; - aiType = 598; + aiType = ProjectileID.BoneJavelin; projectile.Calamity().rogue = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 30; diff --git a/Projectiles/Rogue/CraniumSMASH.cs b/Projectiles/Rogue/CraniumSMASH.cs index 44c0ab554d..33c2da5aa8 100644 --- a/Projectiles/Rogue/CraniumSMASH.cs +++ b/Projectiles/Rogue/CraniumSMASH.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Rogue void SpawnExplosionDust() { Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); for (int num194 = 0; num194 < 25; num194++) { int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 135, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Rogue/CraniumSmasherExplosive.cs b/Projectiles/Rogue/CraniumSmasherExplosive.cs index 40c9faf471..98e1f41f97 100644 --- a/Projectiles/Rogue/CraniumSmasherExplosive.cs +++ b/Projectiles/Rogue/CraniumSmasherExplosive.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.localNPCHitCooldown = 10; projectile.Damage(); Main.PlaySound(SoundID.Item14, (int)projectile.position.X, (int)projectile.position.Y); - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); for (int num194 = 0; num194 < 25; num194++) { int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 135, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Rogue/CraniumSmasherStealth.cs b/Projectiles/Rogue/CraniumSmasherStealth.cs index 058da37834..6b68e13ac9 100644 --- a/Projectiles/Rogue/CraniumSmasherStealth.cs +++ b/Projectiles/Rogue/CraniumSmasherStealth.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.localNPCHitCooldown = 10; projectile.Damage(); Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); for (int num194 = 0; num194 < 25; num194++) { int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 135, 0f, 0f, 100, default, 2f); diff --git a/Projectiles/Rogue/DestructionBolt.cs b/Projectiles/Rogue/DestructionBolt.cs index 88a821815f..e0fd35b20f 100644 --- a/Projectiles/Rogue/DestructionBolt.cs +++ b/Projectiles/Rogue/DestructionBolt.cs @@ -167,7 +167,7 @@ namespace CalamityMod.Projectiles.Rogue num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 9); + projectile.ExplosionGores(9); } } } diff --git a/Projectiles/Rogue/DragonShit.cs b/Projectiles/Rogue/DragonShit.cs index e0ae51ace5..9786df44db 100644 --- a/Projectiles/Rogue/DragonShit.cs +++ b/Projectiles/Rogue/DragonShit.cs @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Rogue num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); diff --git a/Projectiles/Rogue/EclipsesStealth.cs b/Projectiles/Rogue/EclipsesStealth.cs index f2a28866f3..748254fc39 100644 --- a/Projectiles/Rogue/EclipsesStealth.cs +++ b/Projectiles/Rogue/EclipsesStealth.cs @@ -70,12 +70,12 @@ namespace CalamityMod.Projectiles.Rogue changedTimeLeft = true; } //Sticky Behaviour - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 1, true); + projectile.ModifyHitNPCSticky(1, true); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Rogue/FantasyTalismanProj.cs b/Projectiles/Rogue/FantasyTalismanProj.cs index 5d14ce2f96..568106cfd1 100644 --- a/Projectiles/Rogue/FantasyTalismanProj.cs +++ b/Projectiles/Rogue/FantasyTalismanProj.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Rogue { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 175, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); if (projectile.ai[0] == 1f) { if (projectile.timeLeft % 10 == 0) @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Rogue public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 3, true); + projectile.ModifyHitNPCSticky(3, true); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Rogue/FantasyTalismanStealth.cs b/Projectiles/Rogue/FantasyTalismanStealth.cs index d291322099..fb1ddd368f 100644 --- a/Projectiles/Rogue/FantasyTalismanStealth.cs +++ b/Projectiles/Rogue/FantasyTalismanStealth.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Rogue } } } - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); if (projectile.ai[0] == 1f) { if (projectile.timeLeft % 4 == 0) @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Rogue public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 1, true); + projectile.ModifyHitNPCSticky(1, true); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Rogue/FossilShardThrown.cs b/Projectiles/Rogue/FossilShardThrown.cs index c5392e9423..134deb8fa9 100644 --- a/Projectiles/Rogue/FossilShardThrown.cs +++ b/Projectiles/Rogue/FossilShardThrown.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.StatDebuffs; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { @@ -18,7 +19,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.penetrate = 1; projectile.aiStyle = 1; projectile.timeLeft = 90; - aiType = 1; + aiType = ProjectileID.WoodenArrowFriendly; projectile.Calamity().rogue = true; } diff --git a/Projectiles/Rogue/GildedDaggerProj.cs b/Projectiles/Rogue/GildedDaggerProj.cs index 6832282326..a408cb64e8 100644 --- a/Projectiles/Rogue/GildedDaggerProj.cs +++ b/Projectiles/Rogue/GildedDaggerProj.cs @@ -2,8 +2,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Collections.Generic; using Terraria; -using Terraria.ModLoader; using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { @@ -30,9 +30,9 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, DustID.GoldCoin, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } if (hasHitEnemy) { @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Rogue { previousNPCs.Add(i); } - if (!npc.friendly && !npc.townNPC && npc.active && !npc.dontTakeDamage && npc.chaseable && npc != target && !hasHitNPC) + if (!npc.friendly && !npc.townNPC && npc.active && !npc.dontTakeDamage && npc.chaseable && npc != target && !hasHitNPC && npc.type != NPCID.TargetDummy) { float dist = (projectile.Center - npc.Center).Length(); if (dist < minDist) @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int num621 = 0; num621 < 8; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, DustID.GoldCoin, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 1f; } } diff --git a/Projectiles/Rogue/GleamingDaggerProj.cs b/Projectiles/Rogue/GleamingDaggerProj.cs index 34771a7146..9e7407a93f 100644 --- a/Projectiles/Rogue/GleamingDaggerProj.cs +++ b/Projectiles/Rogue/GleamingDaggerProj.cs @@ -2,8 +2,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Collections.Generic; using Terraria; -using Terraria.ModLoader; using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { @@ -30,9 +30,9 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Main.rand.Next(7) == 0) + if (Main.rand.NextBool(7)) { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 247, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, DustID.PlatinumCoin, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } if (hasHitEnemy) { @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Rogue { previousNPCs.Add(i); } - if (!npc.friendly && !npc.townNPC && npc.active && !npc.dontTakeDamage && npc.chaseable && npc != target && !hasHitNPC) + if (!npc.friendly && !npc.townNPC && npc.active && !npc.dontTakeDamage && npc.chaseable && npc != target && !hasHitNPC && npc.type != NPCID.TargetDummy) { float dist = (projectile.Center - npc.Center).Length(); if (dist < minDist) @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int num621 = 0; num621 < 8; num621++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 247, 0f, 0f, 100, default, 1f); + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, DustID.PlatinumCoin, 0f, 0f, 100, default, 1f); Main.dust[num622].velocity *= 1f; } } diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs index 1cab7a319c..7549220f05 100644 --- a/Projectiles/Rogue/GodsParanoiaProj.cs +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[num137].noGravity = true; } - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); if (projectile.ai[0] == 1f) { @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Rogue public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 10, true); + projectile.ModifyHitNPCSticky(10, true); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Rogue/Honeycomb.cs b/Projectiles/Rogue/Honeycomb.cs index 375de85006..786ef9fd0f 100644 --- a/Projectiles/Rogue/Honeycomb.cs +++ b/Projectiles/Rogue/Honeycomb.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.penetrate = 1; projectile.aiStyle = 2; projectile.timeLeft = 300; - aiType = 48; + aiType = ProjectileID.ThrowingKnife; projectile.Calamity().rogue = true; } diff --git a/Projectiles/Rogue/JawsProjectile.cs b/Projectiles/Rogue/JawsProjectile.cs index 97a677283b..b9fd32b1e7 100644 --- a/Projectiles/Rogue/JawsProjectile.cs +++ b/Projectiles/Rogue/JawsProjectile.cs @@ -60,12 +60,12 @@ namespace CalamityMod.Projectiles.Rogue } } //Sticky Behaviour - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 6, false); + projectile.ModifyHitNPCSticky(6, false); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Rogue/LatcherMineProjectile.cs b/Projectiles/Rogue/LatcherMineProjectile.cs index ffbf73bc8b..5b59d81b0b 100644 --- a/Projectiles/Rogue/LatcherMineProjectile.cs +++ b/Projectiles/Rogue/LatcherMineProjectile.cs @@ -113,80 +113,7 @@ namespace CalamityMod.Projectiles.Rogue } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); - if (projectile.owner == Main.myPlayer) - { - for (int i = 0; i < Main.npc.Length; i++) - { - // TODO -- replace the 318 here with whatever projectileID that is - if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && - ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == NPCID.Guide && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == NPCID.Clothier && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || - (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) - { - if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) - { - bool colliding; - if (Main.npc[i].type == NPCID.SolarCrawltipedeTail) - { - Rectangle rect = Main.npc[i].getRect(); - rect.X -= 8; - rect.Y -= 8; - rect.Width += 16; - rect.Height += 16; - colliding = projectile.Colliding(myRect, rect); - } - else - { - colliding = projectile.Colliding(myRect, Main.npc[i].getRect()); - } - if (colliding) - { - if (Main.npc[i].reflectingProjectiles && projectile.CanReflect()) - { - Main.npc[i].ReflectProjectile(projectile.whoAmI); - return; - } - projectile.ai[0] = 1f; - projectile.ai[1] = (float)i; - projectile.velocity = (Main.npc[i].Center - projectile.Center) * 0.75f; - projectile.netUpdate = true; - projectile.StatusNPC(i); - projectile.damage = 0; - const int maxNumberOfMines = 6; - Point[] otherMinesArray = new Point[maxNumberOfMines]; - int otherMinesIndex = 0; - for (int l = 0; l < Main.projectile.Length; l++) - { - if (l != projectile.whoAmI && Main.projectile[l].active && - Main.projectile[l].owner == Main.myPlayer && - Main.projectile[l].type == projectile.type && - Main.projectile[l].ai[0] == 1f && - Main.projectile[l].ai[1] == (float)i) - { - otherMinesArray[otherMinesIndex++] = new Point(l, Main.projectile[l].timeLeft); - if (otherMinesIndex >= otherMinesArray.Length) - { - break; - } - } - } - if (otherMinesIndex >= otherMinesArray.Length) - { - int idx = 0; - for (int m = 1; m < otherMinesArray.Length; m++) - { - if (otherMinesArray[m].Y < otherMinesArray[idx].Y) - { - idx = m; - } - } - Main.projectile[otherMinesArray[idx].X].Kill(); - } - } - } - } - } - } + projectile.ModifyHitNPCSticky(6, false); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) @@ -211,18 +138,12 @@ namespace CalamityMod.Projectiles.Rogue if (Main.rand.NextBool(2) && projectile.Calamity().stealthStrike) { Vector2 shrapnelVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(40f)); - Projectile.NewProjectile(projectile.Top, shrapnelVelocity, - ModContent.ProjectileType(), projectile.damage, 3f, projectile.owner); + Projectile.NewProjectile(projectile.Top, shrapnelVelocity, ModContent.ProjectileType(), projectile.damage, 3f, projectile.owner); } else { Vector2 fireVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(40f)); - int fireIndex = Projectile.NewProjectile(projectile.Top, fireVelocity, - Main.rand.Next(ProjectileID.MolotovFire, ProjectileID.MolotovFire3 + 1), - projectile.damage / 3, 1f, projectile.owner); - Main.projectile[fireIndex].Calamity().forceRogue = true; - Main.projectile[fireIndex].penetrate = -1; - Main.projectile[fireIndex].usesLocalNPCImmunity = true; + int fireIndex = Projectile.NewProjectile(projectile.Top, fireVelocity, ModContent.ProjectileType(), projectile.damage / 3, 1f, projectile.owner); Main.projectile[fireIndex].localNPCHitCooldown = -2; } } diff --git a/Projectiles/Rogue/LeviathanTooth.cs b/Projectiles/Rogue/LeviathanTooth.cs index 72eebe6551..c0045d9d56 100644 --- a/Projectiles/Rogue/LeviathanTooth.cs +++ b/Projectiles/Rogue/LeviathanTooth.cs @@ -44,12 +44,12 @@ namespace CalamityMod.Projectiles.Rogue } } //Sticky Behaviour - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 6, false); + projectile.ModifyHitNPCSticky(6, false); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Rogue/LionfishProj.cs b/Projectiles/Rogue/LionfishProj.cs index 237c3334f8..1328886ff4 100644 --- a/Projectiles/Rogue/LionfishProj.cs +++ b/Projectiles/Rogue/LionfishProj.cs @@ -74,12 +74,12 @@ namespace CalamityMod.Projectiles.Rogue } } //Sticky Behaviour - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 6, false); + projectile.ModifyHitNPCSticky(6, false); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Rogue/MetalShard.cs b/Projectiles/Rogue/MetalShard.cs index c497aa702c..ecbab2f436 100644 --- a/Projectiles/Rogue/MetalShard.cs +++ b/Projectiles/Rogue/MetalShard.cs @@ -36,12 +36,12 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.velocity.Y > 16f) projectile.velocity.Y = 16f; //Sticky Behaviour - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 8 , true); + projectile.ModifyHitNPCSticky(8 , true); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Rogue/NastyChollaBol.cs b/Projectiles/Rogue/NastyChollaBol.cs index e40b858041..8b201fe22f 100644 --- a/Projectiles/Rogue/NastyChollaBol.cs +++ b/Projectiles/Rogue/NastyChollaBol.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Rogue Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 157, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } //Sticky Behaviour - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); if (projectile.ai[0] != 1f) { try @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Rogue public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 20, false); + projectile.ModifyHitNPCSticky(20, false); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Rogue/PlaguenadeProj.cs b/Projectiles/Rogue/PlaguenadeProj.cs index 904eaf1d33..f287844bcb 100644 --- a/Projectiles/Rogue/PlaguenadeProj.cs +++ b/Projectiles/Rogue/PlaguenadeProj.cs @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Rogue num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Rogue/Prismalline2.cs b/Projectiles/Rogue/Prismalline2.cs index a9e4662186..f989130189 100644 --- a/Projectiles/Rogue/Prismalline2.cs +++ b/Projectiles/Rogue/Prismalline2.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { @@ -20,7 +21,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.penetrate = 1; projectile.aiStyle = 113; projectile.timeLeft = 60; - aiType = 598; + aiType = ProjectileID.BoneJavelin; projectile.Calamity().rogue = true; } diff --git a/Projectiles/Rogue/ScourgeoftheDesertProj.cs b/Projectiles/Rogue/ScourgeoftheDesertProj.cs index 58bb1eeed1..d1b4a88457 100644 --- a/Projectiles/Rogue/ScourgeoftheDesertProj.cs +++ b/Projectiles/Rogue/ScourgeoftheDesertProj.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.height = 26; projectile.friendly = true; projectile.aiStyle = 113; - aiType = 598; + aiType = ProjectileID.BoneJavelin; projectile.penetrate = 3; projectile.Calamity().rogue = true; } diff --git a/Projectiles/Rogue/SeafoamBombProj.cs b/Projectiles/Rogue/SeafoamBombProj.cs index 5faa863b09..7bfc7c6cab 100644 --- a/Projectiles/Rogue/SeafoamBombProj.cs +++ b/Projectiles/Rogue/SeafoamBombProj.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(posX, posY, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.4), 0f, projectile.owner, 0f, 0f); } - CalamityUtils.ExplosionGores(projectile, (projectile.Calamity().stealthStrike ? 6 : 3)); + projectile.ExplosionGores((projectile.Calamity().stealthStrike ? 6 : 3)); } } } diff --git a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs index 6227275058..0493a92685 100644 --- a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs +++ b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs @@ -208,7 +208,7 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } } } diff --git a/Projectiles/Rogue/SnapClamProj.cs b/Projectiles/Rogue/SnapClamProj.cs index 1a50dbc8f0..74731836aa 100644 --- a/Projectiles/Rogue/SnapClamProj.cs +++ b/Projectiles/Rogue/SnapClamProj.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.spriteDirection = projectile.direction; } //Sticky Behaviour - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); if (openClam && !onEnemy) { projectile.frame = 1; @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Rogue if (openClam) { onEnemy = true; - CalamityUtils.ModifyHitNPCSticky(projectile, 2, false); + projectile.ModifyHitNPCSticky(2, false); } } diff --git a/Projectiles/Rogue/SnapClamStealth.cs b/Projectiles/Rogue/SnapClamStealth.cs index c7b893f59c..7b1fc44adf 100644 --- a/Projectiles/Rogue/SnapClamStealth.cs +++ b/Projectiles/Rogue/SnapClamStealth.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.spriteDirection = projectile.direction; } //Sticky Behaviour - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); if (openClam && !onEnemy) { projectile.frame = 1; @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Rogue if (openClam) { onEnemy = true; - CalamityUtils.ModifyHitNPCSticky(projectile, 5, false); + projectile.ModifyHitNPCSticky(5, false); } } diff --git a/Projectiles/Rogue/StickyBol.cs b/Projectiles/Rogue/StickyBol.cs index 047cbe81ff..b2a4316afa 100644 --- a/Projectiles/Rogue/StickyBol.cs +++ b/Projectiles/Rogue/StickyBol.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Rogue Dust.NewDust(projectile.position + Vector2.One * 6f, projectile.width - num * 2, projectile.height - num * 2, 4, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, Alpha, newColor, 1.2f); } //Sticky Behaviour - CalamityUtils.StickyProjAI(projectile, 10); + projectile.StickyProjAI(10); if (projectile.ai[0] != 1f) { try @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Rogue public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - CalamityUtils.ModifyHitNPCSticky(projectile, 5, true); + projectile.ModifyHitNPCSticky(5, true); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Rogue/SupernovaBomb.cs b/Projectiles/Rogue/SupernovaBomb.cs index 09f49bc211..8895f911ff 100644 --- a/Projectiles/Rogue/SupernovaBomb.cs +++ b/Projectiles/Rogue/SupernovaBomb.cs @@ -139,7 +139,7 @@ namespace CalamityMod.Projectiles.Rogue } //gore cloud effects - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Rogue/SylvanSlash.cs b/Projectiles/Rogue/SylvanSlash.cs index b4ee547382..8c5abd3973 100644 --- a/Projectiles/Rogue/SylvanSlash.cs +++ b/Projectiles/Rogue/SylvanSlash.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Rogue { projectile.width = 30; projectile.height = 30; - aiType = ProjectileID.FrostWave; projectile.friendly = true; projectile.ignoreWater = true; projectile.Calamity().rogue = true; diff --git a/Projectiles/Rogue/TheSyringeProj.cs b/Projectiles/Rogue/TheSyringeProj.cs index 8564f3c43b..0db04433ed 100644 --- a/Projectiles/Rogue/TheSyringeProj.cs +++ b/Projectiles/Rogue/TheSyringeProj.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.Calamity().rogue = true; projectile.ignoreWater = true; projectile.aiStyle = 1; - aiType = 242; + aiType = ProjectileID.BulletHighVelocity; projectile.penetrate = 1; projectile.timeLeft = 600; } diff --git a/Projectiles/Rogue/TotalityFire.cs b/Projectiles/Rogue/TotalityFire.cs index 22e8b7f468..b68e18a1bc 100644 --- a/Projectiles/Rogue/TotalityFire.cs +++ b/Projectiles/Rogue/TotalityFire.cs @@ -32,12 +32,11 @@ namespace CalamityMod.Projectiles.Rogue //make it face the way it's going if (projectile.ai[1] == 1f) { - projectile.rotation += projectile.velocity.X * 0.1f; projectile.rotation = -projectile.velocity.X * 0.05f; } else { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + ((3 * MathHelper.Pi) / 2); + projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2; projectile.spriteDirection = ((projectile.velocity.X > 0f) ? -1 : 1); } @@ -56,15 +55,15 @@ namespace CalamityMod.Projectiles.Rogue //movement if (projectile.velocity.X != projectile.velocity.X) { - projectile.velocity.X = projectile.velocity.X * -0.1f; + projectile.velocity.X *= -0.1f; } if (projectile.velocity.X != projectile.velocity.X) { - projectile.velocity.X = projectile.velocity.X * -0.5f; + projectile.velocity.X *= -0.5f; } if (projectile.velocity.Y != projectile.velocity.Y && projectile.velocity.Y > 1f) { - projectile.velocity.Y = projectile.velocity.Y * -0.5f; + projectile.velocity.Y *= -0.5f; } projectile.ai[0] += 1f; if (projectile.ai[0] > 5f) @@ -72,21 +71,21 @@ namespace CalamityMod.Projectiles.Rogue projectile.ai[0] = 5f; if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) { - projectile.velocity.X = projectile.velocity.X * 0.97f; - if ((double)projectile.velocity.X > -0.01 && (double)projectile.velocity.X < 0.01) + projectile.velocity.X *= 0.97f; + if (projectile.velocity.X > -0.01f && projectile.velocity.X < 0.01f) { projectile.velocity.X = 0f; projectile.netUpdate = true; } } - projectile.velocity.Y = projectile.velocity.Y + 0.2f; + projectile.velocity.Y += 0.2f; } //dust if (Main.rand.NextBool(4)) { - int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); - Dust dust = Main.dust[num199]; + int fire = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire, 0f, 0f, 100, default, 1f); + Dust dust = Main.dust[fire]; dust.position.X -= 2f; dust.position.Y += 2f; dust.scale += (float)Main.rand.Next(50) * 0.01f; @@ -95,17 +94,17 @@ namespace CalamityMod.Projectiles.Rogue } if (Main.rand.NextBool(10)) { - int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); - Dust dust = Main.dust[num200]; + int fire = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire, 0f, 0f, 100, default, 1f); + Dust dust = Main.dust[fire]; dust.position.X -= 2f; dust.position.Y += 2f; dust.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; dust.noGravity = true; dust.velocity *= 0.1f; } - if ((double)projectile.velocity.Y < 0.25 && (double)projectile.velocity.Y > 0.15) + if (projectile.velocity.Y < 0.25f && projectile.velocity.Y > 0.15f) { - projectile.velocity.X = projectile.velocity.X * 0.8f; + projectile.velocity.X *= 0.8f; } if (projectile.velocity.Y > 16f) { diff --git a/Projectiles/Rogue/UrchinStingerProj.cs b/Projectiles/Rogue/UrchinStingerProj.cs index 950f535ec0..5b4c05f8b4 100644 --- a/Projectiles/Rogue/UrchinStingerProj.cs +++ b/Projectiles/Rogue/UrchinStingerProj.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue { if (projectile.Calamity().stealthStrike) { - CalamityUtils.StickyProjAI(projectile, 15); + projectile.StickyProjAI(15); projectile.localAI[1]++; if (projectile.localAI[1] <= 20f && projectile.ai[0] != 1f) { @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.Calamity().stealthStrike) { projdmg = projectile.damage; - CalamityUtils.ModifyHitNPCSticky(projectile,4, false); + projectile.ModifyHitNPCSticky(4, false); } } diff --git a/Projectiles/Summon/AstrageldonSummon.cs b/Projectiles/Summon/AstrageldonSummon.cs index f399ab6542..eeb30a3c4f 100644 --- a/Projectiles/Summon/AstrageldonSummon.cs +++ b/Projectiles/Summon/AstrageldonSummon.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Summon projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.aiStyle = 26; - aiType = 266; + aiType = ProjectileID.BabySlime; } public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough) diff --git a/Projectiles/Summon/AstralProbeSummon.cs b/Projectiles/Summon/AstralProbeSummon.cs index 7277e5b73d..2f36a3d958 100644 --- a/Projectiles/Summon/AstralProbeSummon.cs +++ b/Projectiles/Summon/AstralProbeSummon.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Projectiles.Summon public class AstralProbeSummon : ModProjectile { private double rotation = 0; + private double rotationVariation = 0; public override void SetStaticDefaults() { @@ -41,28 +42,30 @@ namespace CalamityMod.Projectiles.Summon { projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) + + rotationVariation = Main.rand.NextDouble() * 0.015; + + int dustAmt = 36; + for (int dustIndex = 0; dustIndex < dustAmt; dustIndex++) { - Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; - Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, (Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType()), vector7.X * 1.75f, vector7.Y * 1.75f, 100, default, 1.1f); - Main.dust[num228].noGravity = true; - Main.dust[num228].velocity = vector7; + Vector2 dustSource = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; + dustSource = dustSource.RotatedBy((double)((float)(dustIndex - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + projectile.Center; + Vector2 dustVel = dustSource - projectile.Center; + int astral = Dust.NewDust(dustSource + dustVel, 0, 0, (Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType()), dustVel.X * 1.75f, dustVel.Y * 1.75f, 100, default, 1.1f); + Main.dust[astral].noGravity = true; + Main.dust[astral].velocity = dustVel; } projectile.localAI[0] += 1f; } if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / - projectile.Calamity().spawnedPlayerMinionDamageValue * - player.MinionDamage()); + projectile.Calamity().spawnedPlayerMinionDamageValue * player.MinionDamage()); projectile.damage = damage2; } - bool flag64 = projectile.type == ModContent.ProjectileType(); + bool correctMinion = projectile.type == ModContent.ProjectileType(); player.AddBuff(ModContent.BuffType(), 3600); - if (flag64) + if (correctMinion) { if (player.dead) { @@ -73,87 +76,57 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num633 = 1000f; - float num634 = 1300f; - float num635 = 2600f; - float num636 = 700f; - Vector2 vector46 = projectile.position; - bool flag25 = false; + float range = 1000f; + Vector2 targetVec = projectile.position; + bool foundTarget = false; if (player.HasMinionAttackTargetNPC) { NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false)) { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!flag25 && num646 < num633) + float npcDist = Vector2.Distance(npc.Center, projectile.Center); + if (!foundTarget && npcDist < range) { - vector46 = npc.Center; - flag25 = true; + targetVec = npc.Center; + foundTarget = true; } } } else { - for (int num645 = 0; num645 < Main.npc.Length; num645++) + for (int num645 = 0; num645 < Main.maxNPCs; num645++) { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[num645]; + if (npc.CanBeChasedBy(projectile, false)) { - float num646 = Vector2.Distance(nPC2.Center, projectile.Center); - if (!flag25 && num646 < num633) + float npcDist = Vector2.Distance(npc.Center, projectile.Center); + if (!foundTarget && npcDist < range) { - num633 = num646; - vector46 = nPC2.Center; - flag25 = true; + targetVec = npc.Center; + foundTarget = true; } } } } Vector2 vector = player.Center - projectile.Center; - projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); - if (flag25) + if (foundTarget) { - projectile.rotation = projectile.rotation.AngleLerp((vector46 - projectile.Center).ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.ToRadians(180) * projectile.direction), 0.1f); - projectile.spriteDirection *= -1; + projectile.spriteDirection = projectile.direction = ((targetVec.X - projectile.Center.X) > 0).ToDirectionInt(); + projectile.rotation = projectile.rotation.AngleTowards(projectile.AngleTo(targetVec) + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi), 0.1f); } else { - projectile.rotation = projectile.rotation.AngleLerp(vector.ToRotation() - (projectile.spriteDirection == 1 ? 0f : MathHelper.ToRadians(180) * projectile.direction), 0.1f); + projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.rotation = projectile.rotation.AngleLerp(vector.ToRotation() - (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi * projectile.direction), 0.1f); } projectile.Center = player.Center + new Vector2(80, 0).RotatedBy(rotation); - rotation += 0.03; + rotation += 0.03 + rotationVariation; if (rotation >= 360) { rotation = 0; } projectile.velocity.X = (vector.X > 0f) ? -0.000001f : 0f; - float num647 = num634; - if (flag25) - { - num647 = num635; - } - if (Vector2.Distance(player.Center, projectile.Center) > num647) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (!flag25 && projectile.ai[0] != 0f) - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -120f); - float num651 = vector48.Length(); - if (num651 < num636 && flag26) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - } if (projectile.ai[1] > 0f) { projectile.ai[1] += (float)Main.rand.Next(1, 3); @@ -163,24 +136,21 @@ namespace CalamityMod.Projectiles.Summon projectile.ai[1] = 0f; projectile.netUpdate = true; } - if (projectile.ai[0] == 0f) - { - float scaleFactor3 = 6f; - int num658 = ModContent.ProjectileType(); - if (flag25 && projectile.ai[1] == 0f && vector46 != projectile.position) - { - Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 12, 0.5f, 0f); - projectile.ai[1] += 1f; - if (Main.myPlayer == projectile.owner) - { - Vector2 value19 = vector46 - projectile.Center; - value19.Normalize(); - value19 *= scaleFactor3; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X, value19.Y, num658, projectile.damage, 0f, Main.myPlayer, 0f, 0f); - projectile.netUpdate = true; - } - } - } + float speedMult = 6f; + int projType = ModContent.ProjectileType(); + if (foundTarget && projectile.ai[1] == 0f && targetVec != projectile.position) + { + Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 12, 0.5f, 0f); + projectile.ai[1] += 1f; + if (Main.myPlayer == projectile.owner) + { + Vector2 velocity = targetVec - projectile.Center; + velocity.Normalize(); + velocity *= speedMult; + Projectile.NewProjectile(projectile.Center, velocity, projType, projectile.damage, 0f, projectile.owner, 0f, 0f); + projectile.netUpdate = true; + } + } } public override bool CanDamage() diff --git a/Projectiles/Summon/AstralProbeSummon.png b/Projectiles/Summon/AstralProbeSummon.png index e08f7efc9e..ccb3aa427d 100644 Binary files a/Projectiles/Summon/AstralProbeSummon.png and b/Projectiles/Summon/AstralProbeSummon.png differ diff --git a/Projectiles/Summon/CausticStaffSummon.cs b/Projectiles/Summon/CausticStaffSummon.cs index 6b8c0ea620..5043c3727e 100644 --- a/Projectiles/Summon/CausticStaffSummon.cs +++ b/Projectiles/Summon/CausticStaffSummon.cs @@ -175,7 +175,12 @@ namespace CalamityMod.Projectiles.Summon for (int index = 0; index < projectile.whoAmI; ++index) { Projectile proj = Main.projectile[index]; - if (proj.active && proj.owner == projectile.owner && proj.type == projectile.type) + + // Short circuits to make the loop as fast as possible + if (!proj.active || proj.owner != projectile.owner || !proj.minion) + continue; + + if (proj.type == projectile.type) ++minionPosition; } playerPos.X -= 10f * player.direction; diff --git a/Projectiles/Summon/ChaosFlame.cs b/Projectiles/Summon/ChaosFlame.cs index 0fbd4ef2c0..a657dfb348 100644 --- a/Projectiles/Summon/ChaosFlame.cs +++ b/Projectiles/Summon/ChaosFlame.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,7 +11,9 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Chaos Flame"); - ProjectileID.Sets.MinionShot[projectile.type] = true; + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; } public override void SetDefaults() @@ -27,18 +30,27 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + projectile.rotation = projectile.velocity.ToRotation(); + if (projectile.frameCounter++ % 4 == 0) + { + projectile.frame++; + } + if (projectile.frame >= Main.projFrames[projectile.type]) + { + projectile.frame = 0; + } + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0.25f / 255f, (255 - projectile.alpha) * 0f / 255f); if (projectile.localAI[0] == 0f) { - Main.PlaySound(SoundID.Item20, (int)projectile.position.X, (int)projectile.position.Y); + projectile.scale = 1f - Main.rand.NextFloat() * 0.5f; projectile.localAI[0] += 1f; } - for (int num457 = 0; num457 < 5; num457++) + if (Main.rand.NextBool(4)) { - int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1.2f); - Main.dust[num458].noGravity = true; - Main.dust[num458].velocity *= 0.5f; - Main.dust[num458].velocity += projectile.velocity * 0.1f; + int flame = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, Main.rand.NextBool(3) ? 16 : 174, 0f, 0f); + Main.dust[flame].noGravity = true; + Main.dust[flame].velocity *= 0f; } } @@ -46,5 +58,14 @@ namespace CalamityMod.Projectiles.Summon { target.AddBuff(BuffID.OnFire, 180); } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.timeLeft == 300) + return false; + + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + return false; + } } } diff --git a/Projectiles/Summon/ChaosFlame.png b/Projectiles/Summon/ChaosFlame.png index 831f72cfc8..5a1fe37e31 100644 Binary files a/Projectiles/Summon/ChaosFlame.png and b/Projectiles/Summon/ChaosFlame.png differ diff --git a/Projectiles/Summon/ChaosSpirit.cs b/Projectiles/Summon/ChaosSpirit.cs index d5f5a683f7..d166103b26 100644 --- a/Projectiles/Summon/ChaosSpirit.cs +++ b/Projectiles/Summon/ChaosSpirit.cs @@ -86,12 +86,13 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } + bool reversedGravity = player.gravDir == -1f; projectile.position.X = player.Center.X - (float)(projectile.width / 2); projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f; - if (player.gravDir == -1f) + if (reversedGravity) { - projectile.position.Y = projectile.position.Y + 120f; - projectile.rotation = 3.14f; + projectile.position.Y += 120f; + projectile.rotation = MathHelper.Pi; } else { @@ -99,6 +100,7 @@ namespace CalamityMod.Projectiles.Summon } projectile.position.X = (float)(int)projectile.position.X; projectile.position.Y = (float)(int)projectile.position.Y; + if (projectile.owner == Main.myPlayer) { if (projectile.ai[0] != 0f) @@ -106,63 +108,80 @@ namespace CalamityMod.Projectiles.Summon projectile.ai[0] -= 1f; return; } - bool flag18 = false; - float num506 = projectile.Center.X; - float num507 = projectile.Center.Y; - float num508 = 1000f; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float num539 = npc.position.X + (float)(npc.width / 2); - float num540 = npc.position.Y + (float)(npc.height / 2); - float num541 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num539) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num540); - if (num541 < num508 && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num506 = num539; - num507 = num540; - flag18 = true; - } - } - } - else - { - for (int num512 = 0; num512 < Main.maxNPCs; num512++) - { - if (Main.npc[num512].CanBeChasedBy(projectile, false)) - { - float num513 = Main.npc[num512].position.X + (float)(Main.npc[num512].width / 2); - float num514 = Main.npc[num512].position.Y + (float)(Main.npc[num512].height / 2); - float num515 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num513) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num514); - if (num515 < num508 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[num512].position, Main.npc[num512].width, Main.npc[num512].height)) - { - num508 = num515; - num506 = num513; - num507 = num514; - flag18 = true; - } - } - } - } + bool foundTarget = false; + Vector2 targetVec = projectile.Center; + Vector2 half = new Vector2(0.5f); + float range = 1000f; + int targetIndex = -1; + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + Vector2 sizeCheck = npc.position + npc.Size * half; + float npcDist = Vector2.Distance(sizeCheck, targetVec); + if (npcDist < range && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + { + range = npcDist; + targetVec = sizeCheck; + foundTarget = true; + targetIndex = npc.whoAmI; + } + } + } + else + { + for (int k = 0; k < Main.maxNPCs; k++) + { + NPC npc = Main.npc[k]; + if (npc.CanBeChasedBy(projectile, false)) + { + Vector2 sizeCheck = npc.position + npc.Size * half; + float npcDist = Vector2.Distance(sizeCheck, targetVec); + if (npcDist < range && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) + { + range = npcDist; + targetVec = sizeCheck; + foundTarget = true; + targetIndex = k; + } + } + } + } float yAdjust = player.gravDir == -1f ? 0f : 10f; - if (flag18) + if (foundTarget && targetIndex != -1) { - float num516 = num506; - float num517 = num507; - num506 -= projectile.Center.X; - num507 -= projectile.Center.Y; - int projectileType = ModContent.ProjectileType(); - float num403 = Main.rand.Next(14, 19); //modify the speed the projectile are shot. Lower number = slower projectile. - Vector2 vector29 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num404 = num516 - vector29.X; - float num405 = num517 - vector29.Y; - float num406 = (float)Math.Sqrt((double)(num404 * num404 + num405 * num405)); - num406 = num403 / num406; - num404 *= num406; - num405 *= num406; - Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y - yAdjust, num404, num405, projectileType, projectile.damage, 5f, projectile.owner, 0f, 0f); - projectile.ai[0] = 38f; + int projectileType = ModContent.ProjectileType(); + //If the target is above the minion, fire directly at it at double speed + if (reversedGravity ? (Main.npc[targetIndex].Bottom.Y > projectile.Top.Y) : (Main.npc[targetIndex].Bottom.Y < projectile.Top.Y)) + { + Vector2 source = new Vector2(projectile.Center.X - 4f, projectile.Center.Y - yAdjust); + float speed = Main.rand.Next(14, 19); //modify the speed the projectile are shot. Lower number = slower projectile. + Vector2 velocity = targetVec - projectile.Center; + float targetDist = velocity.Length(); + targetDist = speed / targetDist; + velocity.X *= targetDist; + velocity.Y *= targetDist; + Projectile.NewProjectile(source, velocity, projectileType, projectile.damage, 5f, projectile.owner, 0f, 0f); + Main.PlaySound(SoundID.Item20, projectile.position); + projectile.ai[0] = 10f; + } + //Otherwise, fire away like a volcano + else + { + int amount = Main.rand.Next(2, 4); //2 to 3 + for (int i = 0; i < amount; i++) + { + float velocityX = Main.rand.NextFloat(-10f, 10f); + float velocityY = Main.rand.NextFloat(-10f, -7f); + if (reversedGravity) + velocityY *= -1f; + int flame = Projectile.NewProjectile(projectile.oldPosition.X + (projectile.width / 2), projectile.oldPosition.Y + (projectile.height / 2), velocityX, velocityY, projectileType, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Main.projectile[flame].aiStyle = 1; + } + Main.PlaySound(SoundID.Item20, projectile.position); + projectile.ai[0] = 20f; + } } //doesn't look good @@ -176,14 +195,8 @@ namespace CalamityMod.Projectiles.Summon } } - public override Color? GetAlpha(Color lightColor) - { - return new Color(200, 200, 200, 200); - } + public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); - public override bool CanDamage() - { - return false; - } + public override bool CanDamage() => false; } } diff --git a/Projectiles/Summon/CosmicEnergySpiral.cs b/Projectiles/Summon/CosmicEnergySpiral.cs index 64fe2da558..86851d8c8e 100644 --- a/Projectiles/Summon/CosmicEnergySpiral.cs +++ b/Projectiles/Summon/CosmicEnergySpiral.cs @@ -195,9 +195,9 @@ namespace CalamityMod.Projectiles.Summon float num397 = projectile.position.Y; float num398 = 1200f; bool flag11 = false; - for (int num399 = 0; num399 < 200; num399++) + for (int num399 = 0; num399 < Main.maxNPCs; num399++) { - if (Main.npc[num399].CanBeChasedBy(projectile, true)) + if (Main.npc[num399].CanBeChasedBy(projectile, false)) { float num400 = Main.npc[num399].position.X + (float)(Main.npc[num399].width / 2); float num401 = Main.npc[num399].position.Y + (float)(Main.npc[num399].height / 2); @@ -224,7 +224,7 @@ namespace CalamityMod.Projectiles.Summon } value15.Normalize(); value15 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), 2f, projectile.owner, (float)target, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), 2f, projectile.owner, (float)target, 0f); } float num403 = 15f; Vector2 vector29 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); diff --git a/Projectiles/Summon/DormantBrimseekerBab.cs b/Projectiles/Summon/DormantBrimseekerBab.cs index ff9228c5b2..e9c08e0989 100644 --- a/Projectiles/Summon/DormantBrimseekerBab.cs +++ b/Projectiles/Summon/DormantBrimseekerBab.cs @@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Summon if ((projectile.ai[0] > 0f && projectile.ai[0] <= MaxChargeTime && projectile.velocity.Length() >= 8f) || SeekingTarget) { Texture2D projectileTexture = ModContent.GetTexture(Texture); - Texture2D flameTexture = Main.extraTexture[55]; + Texture2D flameTexture = Main.extraTexture[ExtrasID.MeteorHeadFlame]; SpriteEffects spriteEffects = SpriteEffects.None; if (projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; diff --git a/Projectiles/Summon/Dreadmine.cs b/Projectiles/Summon/Dreadmine.cs index 8fc84be450..dcc5001ecc 100644 --- a/Projectiles/Summon/Dreadmine.cs +++ b/Projectiles/Summon/Dreadmine.cs @@ -202,7 +202,7 @@ namespace CalamityMod.Projectiles.Summon num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } } } diff --git a/Projectiles/Summon/GigaFlareFriendly.cs b/Projectiles/Summon/GigaFlareFriendly.cs index 6b99b1aa30..586b346ed6 100644 --- a/Projectiles/Summon/GigaFlareFriendly.cs +++ b/Projectiles/Summon/GigaFlareFriendly.cs @@ -128,7 +128,7 @@ namespace CalamityMod.Projectiles.Summon num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Summon/MagicHat.cs b/Projectiles/Summon/MagicHat.cs index a94b6fe174..366cb81758 100644 --- a/Projectiles/Summon/MagicHat.cs +++ b/Projectiles/Summon/MagicHat.cs @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Summon for (int index = 0; index < Main.npc.Length; index++) { NPC target = Main.npc[index]; - if (target.CanBeChasedBy(projectile, true)) + if (target.CanBeChasedBy(projectile, false)) { float xDist = target.position.X + (float)(target.width / 2); float yDist = target.position.Y + (float)(target.height / 2); diff --git a/Projectiles/Summon/MechwormBody.cs b/Projectiles/Summon/MechwormBody.cs index d2f81ece1d..e79811ec5c 100644 --- a/Projectiles/Summon/MechwormBody.cs +++ b/Projectiles/Summon/MechwormBody.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft *= 5; projectile.minion = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 4; + projectile.localNPCHitCooldown = 5; } public override void AI() diff --git a/Projectiles/Summon/MechwormBody2.cs b/Projectiles/Summon/MechwormBody2.cs index 7b80be9216..db459d37b3 100644 --- a/Projectiles/Summon/MechwormBody2.cs +++ b/Projectiles/Summon/MechwormBody2.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft *= 5; projectile.minion = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 4; + projectile.localNPCHitCooldown = 5; } public override void AI() diff --git a/Projectiles/Summon/MechwormHead.cs b/Projectiles/Summon/MechwormHead.cs index b3c30b126c..ea44caeb92 100644 --- a/Projectiles/Summon/MechwormHead.cs +++ b/Projectiles/Summon/MechwormHead.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft *= 5; projectile.minion = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 4; + projectile.localNPCHitCooldown = 5; } public override void AI() diff --git a/Projectiles/Summon/MechwormTail.cs b/Projectiles/Summon/MechwormTail.cs index 7da8598496..27b8e896f8 100644 --- a/Projectiles/Summon/MechwormTail.cs +++ b/Projectiles/Summon/MechwormTail.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft *= 5; projectile.minion = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 4; + projectile.localNPCHitCooldown = 5; } public override void AI() diff --git a/Projectiles/Summon/MidnightSunLaser.cs b/Projectiles/Summon/MidnightSunLaser.cs index 58d85e89d1..3027455004 100644 --- a/Projectiles/Summon/MidnightSunLaser.cs +++ b/Projectiles/Summon/MidnightSunLaser.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Summon projectile.minionSlots = 0f; projectile.ignoreWater = true; projectile.aiStyle = 1; - aiType = 242; + aiType = ProjectileID.BulletHighVelocity; projectile.penetrate = 1; projectile.timeLeft = 600; } diff --git a/Projectiles/Summon/PlaguebringerSummon.cs b/Projectiles/Summon/PlaguebringerSummon.cs index 0f5a496e48..d889f46310 100644 --- a/Projectiles/Summon/PlaguebringerSummon.cs +++ b/Projectiles/Summon/PlaguebringerSummon.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Summon int buffType = ModContent.BuffType(); float range = auraRange; - bool dealDamage = auraCounter++ % 60 == 0; + bool dealDamage = auraCounter++ % 60 == 59; int dmg = projectile.damage; if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Summon/PlantSeed.cs b/Projectiles/Summon/PlantSeed.cs index 09548cff50..f7c7cd3949 100644 --- a/Projectiles/Summon/PlantSeed.cs +++ b/Projectiles/Summon/PlantSeed.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Summon projectile.minionSlots = 0f; projectile.ignoreWater = true; projectile.aiStyle = 1; - aiType = 242; + aiType = ProjectileID.BulletHighVelocity; projectile.penetrate = 1; projectile.timeLeft = 600; } diff --git a/Projectiles/Summon/PlantSeedGreen.cs b/Projectiles/Summon/PlantSeedGreen.cs index 54e75d676a..0e31c597c2 100644 --- a/Projectiles/Summon/PlantSeedGreen.cs +++ b/Projectiles/Summon/PlantSeedGreen.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Summon projectile.minionSlots = 0f; projectile.ignoreWater = true; projectile.aiStyle = 1; - aiType = 242; + aiType = ProjectileID.BulletHighVelocity; projectile.penetrate = 1; projectile.timeLeft = 600; } diff --git a/Projectiles/Summon/PrincessMissile.cs b/Projectiles/Summon/PrincessMissile.cs index 43765b9c89..aa74bc0fb1 100644 --- a/Projectiles/Summon/PrincessMissile.cs +++ b/Projectiles/Summon/PrincessMissile.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Summon num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Summon/SolarGod.cs b/Projectiles/Summon/SolarGod.cs index af68240636..f8ae893fd7 100644 --- a/Projectiles/Summon/SolarGod.cs +++ b/Projectiles/Summon/SolarGod.cs @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Summon { for (int num399 = 0; num399 < Main.maxNPCs; num399++) { - if (Main.npc[num399].CanBeChasedBy(projectile, true)) + if (Main.npc[num399].CanBeChasedBy(projectile, false)) { float num400 = Main.npc[num399].position.X + (float)(Main.npc[num399].width / 2); float num401 = Main.npc[num399].position.Y + (float)(Main.npc[num399].height / 2); diff --git a/Projectiles/Summon/SolarPixie.cs b/Projectiles/Summon/SolarPixie.cs index 8a253d29cc..307d0f1830 100644 --- a/Projectiles/Summon/SolarPixie.cs +++ b/Projectiles/Summon/SolarPixie.cs @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Summon { for (int num399 = 0; num399 < Main.maxNPCs; num399++) { - if (Main.npc[num399].CanBeChasedBy(projectile, true)) + if (Main.npc[num399].CanBeChasedBy(projectile, false)) { float num400 = Main.npc[num399].position.X + (float)(Main.npc[num399].width / 2); float num401 = Main.npc[num399].position.Y + (float)(Main.npc[num399].height / 2); diff --git a/Projectiles/Typeless/BlunderBoosterAura.cs b/Projectiles/Typeless/BlunderBoosterAura.cs index 4db065b94e..ac2801a301 100644 --- a/Projectiles/Typeless/BlunderBoosterAura.cs +++ b/Projectiles/Typeless/BlunderBoosterAura.cs @@ -37,6 +37,10 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { + //Protect against other mod projectile reflection like emode Granite Golems + projectile.friendly = true; + projectile.hostile = false; + projectile.frameCounter++; if (projectile.frameCounter > 3) { diff --git a/Projectiles/Typeless/FiniteUse/ExplosiveShotgunShell.cs b/Projectiles/Typeless/FiniteUse/ExplosiveShotgunShell.cs index d2b7e7a4f0..b89fd39e36 100644 --- a/Projectiles/Typeless/FiniteUse/ExplosiveShotgunShell.cs +++ b/Projectiles/Typeless/FiniteUse/ExplosiveShotgunShell.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Typeless.FiniteUse projectile.friendly = true; projectile.ignoreWater = true; projectile.aiStyle = 1; - aiType = 242; + aiType = ProjectileID.BulletHighVelocity; projectile.penetrate = 1; projectile.timeLeft = 600; } diff --git a/Projectiles/Typeless/FiniteUse/MagnumRound.cs b/Projectiles/Typeless/FiniteUse/MagnumRound.cs index 42422f79ae..1b526a8421 100644 --- a/Projectiles/Typeless/FiniteUse/MagnumRound.cs +++ b/Projectiles/Typeless/FiniteUse/MagnumRound.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Typeless.FiniteUse projectile.friendly = true; projectile.ignoreWater = true; projectile.aiStyle = 1; - aiType = 242; + aiType = ProjectileID.BulletHighVelocity; projectile.penetrate = 1; projectile.timeLeft = 600; } diff --git a/Projectiles/Typeless/Seashell.cs b/Projectiles/Typeless/Seashell.cs index 7ca2b090d1..834dade7b2 100644 --- a/Projectiles/Typeless/Seashell.cs +++ b/Projectiles/Typeless/Seashell.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { @@ -17,7 +18,7 @@ namespace CalamityMod.Projectiles.Typeless projectile.penetrate = 2; projectile.aiStyle = 3; projectile.timeLeft = 300; - aiType = 52; + aiType = ProjectileID.WoodenBoomerang; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; } diff --git a/Projectiles/Typeless/SkyFlareFriendly.cs b/Projectiles/Typeless/SkyFlareFriendly.cs index c96538d061..818f5d7898 100644 --- a/Projectiles/Typeless/SkyFlareFriendly.cs +++ b/Projectiles/Typeless/SkyFlareFriendly.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Typeless num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } - CalamityUtils.ExplosionGores(projectile, 3); + projectile.ExplosionGores(3); } } } diff --git a/Projectiles/Typeless/StickyFeatherAero.cs b/Projectiles/Typeless/StickyFeatherAero.cs index 759e899d89..4c526b30c3 100644 --- a/Projectiles/Typeless/StickyFeatherAero.cs +++ b/Projectiles/Typeless/StickyFeatherAero.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Projectiles.Typeless projectile.penetrate = 3; projectile.alpha = 255; projectile.aiStyle = 93; - aiType = 514; + aiType = ProjectileID.NailFriendly; } public override void AI() diff --git a/Projectiles/Typeless/TeslaAura.cs b/Projectiles/Typeless/TeslaAura.cs index 36832c2751..cfacfc2047 100644 --- a/Projectiles/Typeless/TeslaAura.cs +++ b/Projectiles/Typeless/TeslaAura.cs @@ -39,6 +39,10 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { + //Protect against other mod projectile reflection like emode Granite Golems + projectile.friendly = true; + projectile.hostile = false; + projectile.frameCounter++; if (projectile.frameCounter > 3) { diff --git a/Tiles/Furniture/CraftingStations/StaticRefiner.cs b/Tiles/Furniture/CraftingStations/StaticRefiner.cs index 7329f743c6..6f976e1670 100644 --- a/Tiles/Furniture/CraftingStations/StaticRefiner.cs +++ b/Tiles/Furniture/CraftingStations/StaticRefiner.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; @@ -19,6 +20,8 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations name.SetDefault("Static Refiner"); AddMapEntry(new Color(191, 142, 111), name); animationFrameHeight = 54; + //also counts as a Solidifier + adjTiles = new int[] { TileID.Solidifier }; } public override bool CreateDust(int i, int j, ref int type) @@ -115,18 +118,4 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations Item.NewItem(i * 16, j * 16, 16, 32, ModContent.ItemType()); } } - - //class ExampleAnimatedTileItem : ModItem - //{ - // public override void SetStaticDefaults() - // { - // DisplayName.SetDefault("Red Firefly in a Bottle"); - // } - - // public override void SetDefaults() - // { - // item.CloneDefaults(ItemID.FireflyinaBottle); - // item.createTile = ModContent.TileType(); - // } - //} } diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 5ce5fa184c..ca8c0ebecb 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -1112,7 +1112,8 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType(), + ModContent.ItemType() }); RecipeGroup.RegisterGroup("WingsGroup", group); } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 31b3fd9a51..0a5a02a2de 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -435,6 +435,45 @@ namespace CalamityMod return true; } + /// + /// Call this function in the Kill function of your npc to spawn cloud-like gores. + /// + /// The npc you're adding explosion clouds to + /// Number of times it loops to spawn gores + public static void ExplosionGores (this NPC npc, int goreAmt) + { + Vector2 goreVec = new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f); + for (int goreIndex = 0; goreIndex < goreAmt; goreIndex++) + { + float velocityMult = 0.33f; + if (goreIndex < (int)(goreAmt/3)) + { + velocityMult = 0.66f; + } + if (goreIndex >= (int)((2*goreAmt)/3)) + { + velocityMult = 1f; + } + int smoke = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); + Gore gore = Main.gore[smoke]; + gore.velocity *= velocityMult; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; + smoke = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); + gore.velocity *= velocityMult; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; + smoke = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); + gore.velocity *= velocityMult; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; + smoke = Gore.NewGore(goreVec, default, Main.rand.Next(61, 64), 1f); + gore.velocity *= velocityMult; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; + } + } + /// /// Check if an NPC is organic /// @@ -700,15 +739,13 @@ namespace CalamityMod public static void KillAllHostileProjectiles() { - int proj; - for (int x = 0; x < Main.maxProjectiles; x = proj + 1) + for (int x = 0; x < Main.maxProjectiles; x++) { Projectile projectile = Main.projectile[x]; if (projectile.active && projectile.hostile && !projectile.friendly && projectile.damage > 0) { projectile.Kill(); } - proj = x; } } @@ -717,7 +754,7 @@ namespace CalamityMod /// /// The projectile you're adding explosion clouds to /// Number of times it loops to spawn gores - public static void ExplosionGores (Projectile projectile, int goreAmt) + public static void ExplosionGores (this Projectile projectile, int goreAmt) { Vector2 goreVec = new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f); for (int goreIndex = 0; goreIndex < goreAmt; goreIndex++) @@ -756,7 +793,7 @@ namespace CalamityMod /// /// The projectile you're adding sticky behaviour to /// Number of seconds you want a projectile to cling to an NPC - public static void StickyProjAI (Projectile projectile, int timeLeft) + public static void StickyProjAI (this Projectile projectile, int timeLeft) { if (projectile.ai[0] == 1f) { @@ -819,7 +856,7 @@ namespace CalamityMod /// The projectile you're giving sticky behaviour to /// How many projectiles of this type can stick to one enemy /// Decides if you want the projectile to deal damage while its sticked to enemies or not - public static void ModifyHitNPCSticky(Projectile projectile, int maxStick, bool constantDamage) + public static void ModifyHitNPCSticky(this Projectile projectile, int maxStick, bool constantDamage) { Player player = Main.player[projectile.owner]; Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); diff --git a/World/Abyss.cs b/World/Abyss.cs index 876a4036c6..802985206d 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -71,7 +71,6 @@ namespace CalamityMod.World CalamityWorld.abyssSide = Main.dungeonX < Main.maxTilesX / 2; DetermineYStart(); CreateStartingBlock(); - GenerateUpperSea(); CreateWater(); GenerateHardenedSandstone(); RemoveStupidTilesAboveSea(); @@ -162,95 +161,6 @@ namespace CalamityMod.World } #endregion - #region Generating Upper Beach Outline - public static void GenerateUpperSea() - { - int seaStartX = CalamityWorld.abyssSide ? 0 : Main.maxTilesX; - int seaEndX = CalamityWorld.abyssSide ? BiomeWidth : Main.maxTilesX - BiomeWidth; - int xCounter = 80; - float depth = 1f; - int yTop = 0; - while (!Main.tile[seaEndX - 1, yTop].active()) - { - yTop++; - } - yTop += WorldGen.genRand.Next(1, 5); - for (int x = seaEndX - 1; x != seaStartX; x += (CalamityWorld.abyssSide ? -1 : 1)) - { - xCounter++; - if (xCounter < BiomeWidth * 0.05) - { - depth += WorldGen.genRand.Next(10, 20) * 0.2f; - } - else if (xCounter < BiomeWidth * 0.08) - { - depth += WorldGen.genRand.Next(10, 20) * 0.15f; - } - else if (xCounter < BiomeWidth * 0.1) - { - depth += WorldGen.genRand.Next(10, 20) * 0.1f; - } - else if (xCounter < BiomeWidth * 0.15) - { - depth += WorldGen.genRand.Next(10, 20) * 0.07f; - } - else if (xCounter < BiomeWidth * 0.2) - { - depth += WorldGen.genRand.Next(10, 20) * 0.05f; - } - else if (xCounter < BiomeWidth * 0.25) - { - depth += WorldGen.genRand.Next(10, 20) * 0.04f; - } - else if (xCounter < BiomeWidth * 0.325) - { - depth += WorldGen.genRand.Next(10, 20) * 0.03f; - } - else if (xCounter < BiomeWidth * 0.375) - { - depth += WorldGen.genRand.Next(10, 20) * 0.02f; - } - else if (xCounter < BiomeWidth * 0.45) - { - depth += WorldGen.genRand.Next(10, 20) * 0.01f; - } - else if (xCounter < BiomeWidth * 0.6) - { - depth += WorldGen.genRand.Next(10, 20) * 0.005f; - } - else if (xCounter < BiomeWidth * 0.75) - { - depth += WorldGen.genRand.Next(10, 20) * 0.001f; - } - int depthAdditive = WorldGen.genRand.Next(15, 20); - int y = 0; - while (y < yTop + depth + depthAdditive) - { - if (y < yTop + depth * 0.75f - 3f) - { - Main.tile[x, y].active(false); - if (y > yTop) - { - Main.tile[x, y].liquid = 255; - } - else if (y == yTop) - { - Main.tile[x, y].liquid = 127; - } - } - else if (y > yTop && - (Main.tile[x, y].type == (ushort)ModContent.TileType() || - Main.tile[x, y].type == (ushort)ModContent.TileType())) - { - Main.tile[x, y].active(true); - } - Main.tile[x, y].wall = 0; - y++; - } - } - } - #endregion - #region Generating Water public const int PerlinIterations = 1; public const int PerlinOctaves = 4; @@ -819,8 +729,7 @@ namespace CalamityMod.World BiomeWidth - i : Main.maxTilesX - BiomeWidth + i; int YStart = (int)WorldGen.worldSurfaceLow - 20; // 30 tiles below the absolute lowest a floating island can spawn - while (!Main.tile[xCheck, YStart].active() || !YStartWhitelist.Contains(Main.tile[xCheck, YStart].type) || - Main.tile[xCheck, YStart].type == TileID.LivingWood || Main.tile[xCheck, YStart].type == TileID.LeafBlock) + while (!Main.tile[xCheck, YStart].active() || !YStartWhitelist.Contains(Main.tile[xCheck, YStart].type)) { YStart++; if (YStart > Main.rockLayer - 40)