From faa727c8528b7cf9a749c0b05215bfce459e36ec Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Mon, 22 Jul 2024 11:58:39 -0400 Subject: [PATCH] Removed unnecessary uses of "ModContent" --- CalPlayer/CalamityPlayerOnHit.cs | 26 +++++++++---------- Items/Armor/GemTech/GemTechHeadgear.cs | 4 +-- .../MarniteArchitect/MarniteArchitectSet.cs | 6 ++--- Items/Armor/Wulfrum/WulfrumSet.cs | 6 ++--- Items/Tools/BobbitHook.cs | 2 +- Items/Weapons/Melee/ArkoftheCosmos.cs | 2 +- Items/Weapons/Melee/Exoblade.cs | 2 +- Items/Weapons/Rogue/TheFinalDawn.cs | 2 +- Items/Weapons/Summon/Cnidarian.cs | 6 ++--- ModSupport/WeakReferenceSupport.cs | 4 +-- NPCs/CalamityGlobalNPC.cs | 26 +++++++++---------- NPCs/CalamityGlobalTownNPC.cs | 6 ++--- Projectiles/CalamityGlobalProjectile.cs | 10 +++---- Systems/WorldMiscUpdateSystem.cs | 26 +++++++++---------- Utilities/ProjectileUtils.cs | 2 +- Utilities/TileEntityUtils.cs | 2 +- Utilities/TileUtils.cs | 8 +++--- 17 files changed, 70 insertions(+), 70 deletions(-) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 6a28807da3..6d91907074 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -199,11 +199,11 @@ namespace CalamityMod.CalPlayer GemTechState.MeleeOnHitEffects(target); // Handle on-hit ranged effects for the gem tech armor set. - if (proj.CountsAsClass() && proj.type != ModContent.ProjectileType()) + if (proj.CountsAsClass() && proj.type != ProjectileType()) GemTechState.RangedOnHitEffects(target, proj.damage); // Handle on-hit projectiles effects for the mythril armor set. - if (proj.type != ModContent.ProjectileType()) + if (proj.type != ProjectileType()) MythrilArmorSetChange.OnHitEffects(target, damageDone, Player); if (witheringWeaponEnchant) @@ -494,7 +494,7 @@ namespace CalamityMod.CalPlayer if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) return; - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); + CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType(), BalancingConstants.LifeStealRange); } if ((cgp.betterLifeBullet1 || cgp.betterLifeBullet2) && proj.numHits == 0) @@ -516,7 +516,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i <= 2; i++) { - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); + CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType(), BalancingConstants.LifeStealRange); } } @@ -622,13 +622,13 @@ namespace CalamityMod.CalPlayer if (!proj.CountsAsClass() && !proj.CountsAsClass() && Player.meleeEnchant == 7) Projectile.NewProjectile(source, position, proj.velocity, ProjectileID.ConfettiMelee, 0, 0f, proj.owner); - if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ModContent.ProjectileType()) + if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ProjectileType()) { int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(10); seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage); Vector2 seekerVelocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f); - Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ModContent.ProjectileType(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2); + Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ProjectileType(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2); bee.ArmorPenetration = 20; bee.penetrate = 2; bee.extraUpdates = 1; @@ -671,7 +671,7 @@ namespace CalamityMod.CalPlayer { AbaddonCooldown = 15; int AbaddonExploDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.03f, 25); - Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType(), AbaddonExploDamage, 0f, Player.whoAmI); + Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), AbaddonExploDamage, 0f, Player.whoAmI); } if (ursaSergeant && ursaSergeantCooldown <= 0) @@ -681,7 +681,7 @@ namespace CalamityMod.CalPlayer int ursaSlashdamage = (int)Player.GetBestClassDamage().ApplyTo(333); ursaSlashdamage = Player.ApplyArmorAccDamageBonusesTo(ursaSlashdamage); - Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType(), ursaSlashdamage, 0f, Player.whoAmI); + Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), ursaSlashdamage, 0f, Player.whoAmI); } if (proj.CountsAsClass()) @@ -804,7 +804,7 @@ namespace CalamityMod.CalPlayer // Bloodflare Mage Explosion: 50%, softcap starts at 500 base damage to not overly punish slow weapons int bloodflareFireballDamage = Player.ApplyArmorAccDamageBonusesTo(CalamityUtils.DamageSoftCap(proj.damage * 0.5, 250)); - int fire = Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType(), bloodflareFireballDamage, 0f, Player.whoAmI, 0f, 0f, 1f); + int fire = Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), bloodflareFireballDamage, 0f, Player.whoAmI, 0f, 0f, 1f); if (fire.WithinBounds(Main.maxProjectiles)) { Main.projectile[fire].DamageType = DamageClass.Generic; @@ -1199,7 +1199,7 @@ namespace CalamityMod.CalPlayer { if (eGauntlet) { - CalamityUtils.Inflict246DebuffsNPC(target, ModContent.BuffType()); + CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); } if (ataxiaFire) { @@ -1282,7 +1282,7 @@ namespace CalamityMod.CalPlayer //20% chance for Voltaic Jelly if (Main.rand.NextBool(starTaintedGenerator ? 1 : 5)) { - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffType(), 60); } } @@ -1346,7 +1346,7 @@ namespace CalamityMod.CalPlayer if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5) { target.Calamity().gladiatorOnKill = false; - Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center.X, target.Center.Y, target.velocity.X / 2, target.velocity.Y / 2, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center.X, target.Center.Y, target.velocity.X / 2, target.velocity.Y / 2, ProjectileType(), 0, 0f); } if (Main.player[Main.myPlayer].lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5) @@ -1512,7 +1512,7 @@ namespace CalamityMod.CalPlayer if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5) { target.Calamity().gladiatorOnKill = false; - Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType(), 0, 0f); } if (reaverDefense) diff --git a/Items/Armor/GemTech/GemTechHeadgear.cs b/Items/Armor/GemTech/GemTechHeadgear.cs index 006989a52d..1a7dd7e305 100644 --- a/Items/Armor/GemTech/GemTechHeadgear.cs +++ b/Items/Armor/GemTech/GemTechHeadgear.cs @@ -61,13 +61,13 @@ namespace CalamityMod.Items.Armor.GemTech Item.height = 32; Item.defense = 14; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = RarityType(); Item.Calamity().donorItem = true; } public override bool IsArmorSet(Item head, Item body, Item legs) { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); + return body.type == ItemType() && legs.type == ItemType(); } public static bool HasArmorSet(Player player) => player.armor[0].type == ItemType() && player.armor[1].type == ItemType() && player.armor[2].type == ItemType(); diff --git a/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs b/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs index e2fae35316..34eb51bc23 100644 --- a/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs +++ b/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Items.Armor.MarniteArchitect orig(self); } - public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType(); + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ItemType(); public static bool HasArmorSet(Player player) => player.armor[0].type == ItemType() && player.armor[1].type == ItemType(); public bool IsPartOfSet(Item item) => item.type == ItemType() || item.type == ItemType(); @@ -205,7 +205,7 @@ namespace CalamityMod.Items.Armor.MarniteArchitect public override void PostUpdateMiscEffects() { - if (!setEquipped && Player.mount.Type == ModContent.MountType() && Player.mount.Active) + if (!setEquipped && Player.mount.Type == MountType() && Player.mount.Active) Player.mount.Dismount(Player); if (mounted) @@ -368,7 +368,7 @@ namespace CalamityMod.Items.Armor.MarniteArchitect //Sprites if (Main.netMode != NetmodeID.Server) { - MountData.frontTextureGlow = ModContent.Request("CalamityMod/Items/Armor/MarniteArchitect/MarniteLiftFire"); + MountData.frontTextureGlow = Request("CalamityMod/Items/Armor/MarniteArchitect/MarniteLiftFire"); } } diff --git a/Items/Armor/Wulfrum/WulfrumSet.cs b/Items/Armor/Wulfrum/WulfrumSet.cs index 6d5858ea5e..0ed6f4412c 100644 --- a/Items/Armor/Wulfrum/WulfrumSet.cs +++ b/Items/Armor/Wulfrum/WulfrumSet.cs @@ -82,9 +82,9 @@ namespace CalamityMod.Items.Armor.Wulfrum } } - else if (player.HasItem(ModContent.ItemType())) + else if (player.HasItem(ItemType())) { - player.ConsumeItem(ModContent.ItemType()); + player.ConsumeItem(ItemType()); //I Thiiiinnnk there's no need to add mp syncing packets since cooldowns get auto synced right. player.AddCooldown(WulfrumBastion.ID, BastionCooldown + BastionTime); //Though do i need to sync that or is the player inventory auto synced? @@ -234,7 +234,7 @@ namespace CalamityMod.Items.Armor.Wulfrum setBonus1.OverrideColor = Color.Lerp(new Color(194, 255, 67), new Color(112, 244, 244), 0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f)); tooltips.Insert(setBonusIndex + 1, setBonus1); - int AmmoItem = ModContent.ItemType(); + int AmmoItem = ItemType(); string AmmoDisplay = $"[i:{AmmoItem}] {CalamityUtils.GetItemName(AmmoItem)}"; TooltipLine setBonus2 = new TooltipLine(item.Mod, "CalamityMod:SetBonus2", CalamityUtils.GetTextFromModItem("AbilityDescription").Format(AmmoDisplay)); setBonus2.OverrideColor = new Color(110, 192, 93); diff --git a/Items/Tools/BobbitHook.cs b/Items/Tools/BobbitHook.cs index f67d9f7fe3..34c55f4352 100644 --- a/Items/Tools/BobbitHook.cs +++ b/Items/Tools/BobbitHook.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Tools Item.shootSpeed = BobbitHead.LaunchSpeed; // How quickly the hook is shot. Item.shoot = ProjectileType(); Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = RarityType(); } } } diff --git a/Items/Weapons/Melee/ArkoftheCosmos.cs b/Items/Weapons/Melee/ArkoftheCosmos.cs index b2075df53f..7521476b79 100644 --- a/Items/Weapons/Melee/ArkoftheCosmos.cs +++ b/Items/Weapons/Melee/ArkoftheCosmos.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 28f; - Item.rare = ModContent.RarityType(); + Item.rare = RarityType(); } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Melee/Exoblade.cs b/Items/Weapons/Melee/Exoblade.cs index 3b47ca0784..f531b3b86b 100644 --- a/Items/Weapons/Melee/Exoblade.cs +++ b/Items/Weapons/Melee/Exoblade.cs @@ -138,7 +138,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Melee/ExobladeGlow").Value); + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Request("CalamityMod/Items/Weapons/Melee/ExobladeGlow").Value); } public override void AddRecipes() diff --git a/Items/Weapons/Rogue/TheFinalDawn.cs b/Items/Weapons/Rogue/TheFinalDawn.cs index 45f45c9fe6..833894bfcf 100644 --- a/Items/Weapons/Rogue/TheFinalDawn.cs +++ b/Items/Weapons/Rogue/TheFinalDawn.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 4; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = RarityType(); Item.Calamity().donorItem = true; Item.autoReuse = false; diff --git a/Items/Weapons/Summon/Cnidarian.cs b/Items/Weapons/Summon/Cnidarian.cs index 836c151c26..01f80f495b 100644 --- a/Items/Weapons/Summon/Cnidarian.cs +++ b/Items/Weapons/Summon/Cnidarian.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.channel = true; Item.noMelee = true; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ProjectileType(); Item.shootSpeed = 10f; Item.rare = ItemRarityID.Green; @@ -124,7 +124,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) { - Texture2D properSprite = ModContent.Request("CalamityMod/Items/Weapons/Summon/Cnidarian").Value; + Texture2D properSprite = Request("CalamityMod/Items/Weapons/Summon/Cnidarian").Value; spriteBatch.DrawNewInventorySprite(properSprite, new Vector2(42f, 34), position, drawColor, origin, scale); return false; @@ -132,7 +132,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { - Texture2D properSprite = ModContent.Request("CalamityMod/Items/Weapons/Summon/Cnidarian").Value; + Texture2D properSprite = Request("CalamityMod/Items/Weapons/Summon/Cnidarian").Value; spriteBatch.Draw(properSprite, Item.position - Main.screenPosition, null, lightColor, rotation, properSprite.Size() / 2f, scale, 0, 0); return false; diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 73ab93575a..1ec0ce7533 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -1074,8 +1074,8 @@ namespace CalamityMod double Damage(DamageClass damageClass) => Math.Round(Main.LocalPlayer.GetTotalDamage(damageClass).Additive * Main.LocalPlayer.GetTotalDamage(damageClass).Multiplicative * 100 - 100); int Crit(DamageClass damageClass) => (int)Main.LocalPlayer.GetTotalCritChance(damageClass); - int rogueItem = ModContent.ItemType(); - DamageClass rogueDamageClass = ModContent.GetInstance(); + int rogueItem = ItemType(); + DamageClass rogueDamageClass = GetInstance(); Func rogueDamage = () => $"Rogue Damage: {Damage(rogueDamageClass)}%"; Func rogueCrit = () => $"Rogue Critical: {Crit(rogueDamageClass)}%"; fargos.Call("AddStat", rogueItem, rogueDamage); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 86e7d40742..f7ecc4c21c 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -1444,7 +1444,7 @@ namespace CalamityMod.NPCs npc.scale *= Main.zenithWorld ? 2f : CalamityWorld.death ? 1.4f : 1.2f; } - else if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType()) + else if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType()) { // HP boosted in Master Mode due to having two heads (piercing can make them die faster than normal here since they share an HP bar) npc.lifeMax = (int)Math.Round(npc.lifeMax * (Main.masterMode ? 1.7 : 1.2)); @@ -1455,7 +1455,7 @@ namespace CalamityMod.NPCs npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.65); npc.scale = 1.2f; } - else if (npc.type == NPCID.Retinazer || npc.type == NPCID.Spazmatism || npc.type == ModContent.NPCType()) + else if (npc.type == NPCID.Retinazer || npc.type == NPCID.Spazmatism || npc.type == NPCType()) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); npc.npcSlots = 10f; @@ -2468,7 +2468,7 @@ namespace CalamityMod.NPCs { if (!NPC.downedMechBossAny) { - if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.Probe || CalamityLists.SkeletronPrimeIDs.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == ModContent.NPCType()) + if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.Probe || CalamityLists.SkeletronPrimeIDs.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType()) { double multiplier = Main.expertMode ? EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic; npc.lifeMax = (int)Math.Round(npc.lifeMax * multiplier); @@ -2478,7 +2478,7 @@ namespace CalamityMod.NPCs } else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) { - if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.Probe || CalamityLists.SkeletronPrimeIDs.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == ModContent.NPCType()) + if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.Probe || CalamityLists.SkeletronPrimeIDs.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType()) { double multiplier = Main.expertMode ? EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic; npc.lifeMax = (int)Math.Round(npc.lifeMax * multiplier); @@ -3429,7 +3429,7 @@ namespace CalamityMod.NPCs public override bool PreAI(NPC npc) { // Change Spaz and Ret weaknesses and resistances when phase 2 starts. - if (npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == ModContent.NPCType()) + if (npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType()) { if (npc.ai[0] >= 2f) { @@ -5422,7 +5422,7 @@ namespace CalamityMod.NPCs SoundEngine.PlaySound(explode with { Pitch = 0.8f }, touchedTile.ToWorldCoordinates()); GenericSparkle sparker = new GenericSparkle(touchedTile.ToWorldCoordinates(), Vector2.Zero, Color.Goldenrod, Color.Gold, 2.5f, 9, Main.rand.NextFloat(-0.01f, 0.01f), 2.68f); GeneralParticleHandler.SpawnParticle(sparker); - Projectile.NewProjectile(new EntitySource_TileInteraction(npc, touchedTile.X, touchedTile.Y), touchedTile.ToWorldCoordinates(), Vector2.Zero, ModContent.ProjectileType(), 40000, 0f); + Projectile.NewProjectile(new EntitySource_TileInteraction(npc, touchedTile.X, touchedTile.Y), touchedTile.ToWorldCoordinates(), Vector2.Zero, ProjectileType(), 40000, 0f); WorldGen.KillTile(touchedTile.X, touchedTile.Y, noItem: true); continue; } @@ -5444,7 +5444,7 @@ namespace CalamityMod.NPCs if (tile.TileType == auricOreID) { npc.SimpleStrikeNPC((int)(npc.lifeMax * 0.2f), 0); - npc.AddBuff(ModContent.BuffType(), 120); + npc.AddBuff(BuffType(), 120); } SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot1"), npc.Center); break; @@ -5909,7 +5909,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < Main.maxNPCs; i++) { NPC nPC = Main.npc[i]; - if (nPC.active && nPC.type == ModContent.NPCType() && nPC.life > 0) + if (nPC.active && nPC.type == NPCType() && nPC.life > 0) { nPC.life = 0; nPC.HitEffect(); @@ -5974,7 +5974,7 @@ namespace CalamityMod.NPCs if (npc.life <= 0) { if (Main.netMode != NetmodeID.MultiplayerClient) - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), ModContent.NPCType()); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), NPCType()); } break; @@ -6516,7 +6516,7 @@ namespace CalamityMod.NPCs { if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { - if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType()) + if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType()) npc.frameCounter = 0D; } } @@ -6747,7 +6747,7 @@ namespace CalamityMod.NPCs return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR); if (npc.type == NPCID.KingSlime && Main.masterMode && CalamityWorld.revenge) - return NPC.AnyNPCs(ModContent.NPCType()) ? Color.Lerp(new Color(0, 0, 150, npc.alpha), new Color(125, 125, 255, npc.alpha), (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 0.5f) : null; + return NPC.AnyNPCs(NPCType()) ? Color.Lerp(new Color(0, 0, 150, npc.alpha), new Color(125, 125, 255, npc.alpha), (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 0.5f) : null; if (npc.type == NPCID.QueenBee && Main.zenithWorld) { @@ -6945,7 +6945,7 @@ namespace CalamityMod.NPCs if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { - if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType() || CalamityLists.DestroyerIDs.Contains(npc.type)) + if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType() || CalamityLists.DestroyerIDs.Contains(npc.type)) return false; } @@ -7719,7 +7719,7 @@ namespace CalamityMod.NPCs } // His afterimages I can't get to work, so fuck it - else if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType()) + else if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType()) { Texture2D npcTexture = (masterMode && revenge && npc.type == NPCID.SkeletronPrime) ? CalamityMod.ChadPrime.Value : TextureAssets.Npc[npc.type].Value; int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type]; diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 0a5383e8ee..8048c24997 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1001,7 +1001,7 @@ namespace CalamityMod.NPCs break; case NPCID.Wizard: - if (Main.rand.NextBool(6) && !Main.LocalPlayer.InventoryHas(ItemID.RodofDiscord) && !Main.LocalPlayer.InventoryHas(ModContent.ItemType()) && !Main.LocalPlayer.ZoneHallow) + if (Main.rand.NextBool(6) && !Main.LocalPlayer.InventoryHas(ItemID.RodofDiscord) && !Main.LocalPlayer.InventoryHas(ItemType()) && !Main.LocalPlayer.ZoneHallow) chat = CalamityUtils.GetTextValue("Vanilla.WizardChat.MentionRoD"); if (Main.rand.NextBool(10) && Main.hardMode) chat = CalamityUtils.GetTextValue("Vanilla.WizardChat.Hardmode"); @@ -1071,7 +1071,7 @@ namespace CalamityMod.NPCs public override bool? CanBeHitByProjectile(NPC npc, Projectile projectile) { //Not an axe but close enough - if (npc.type == NPCID.TaxCollector && projectile.type == ModContent.ProjectileType()) + if (npc.type == NPCID.TaxCollector && projectile.type == ProjectileType()) return true; return base.CanBeHitByProjectile(npc, projectile); } @@ -1116,7 +1116,7 @@ namespace CalamityMod.NPCs if (type == NPCID.Demolitionist) { - shop.Add(ModContent.ItemType(), Condition.DownedMechBossAny); + shop.Add(ItemType(), Condition.DownedMechBossAny); } if (type == NPCID.ArmsDealer) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index d3699c8109..083e4dcb55 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2671,7 +2671,7 @@ namespace CalamityMod.Projectiles { int totalProjectiles = masterMode ? 12 : 8; float radians = MathHelper.TwoPi / totalProjectiles; - int type = ModContent.ProjectileType(); + int type = ProjectileType(); float velocity = 1f; Vector2 spinningPoint = new Vector2(0f, -velocity); for (int k = 0; k < totalProjectiles; k++) @@ -3811,7 +3811,7 @@ namespace CalamityMod.Projectiles } break; case CalamityGlobalBuff.ModdedFlaskEnchant: - int dustType = player.Calamity().flaskHoly ? (Main.rand.NextBool() ? 87 : (int)CalamityDusts.ProfanedFire) : player.Calamity().flaskBrimstone ? (Main.rand.NextBool() ? 114 : ModContent.DustType()) : (Main.rand.NextBool() ? 121 : DustID.Stone); + int dustType = player.Calamity().flaskHoly ? (Main.rand.NextBool() ? 87 : (int)CalamityDusts.ProfanedFire) : player.Calamity().flaskBrimstone ? (Main.rand.NextBool() ? 114 : DustType()) : (Main.rand.NextBool() ? 121 : DustID.Stone); if (Main.rand.NextBool(4)) { Dust dust = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, Main.rand.NextFloat(0.6f, 0.9f)); @@ -3831,7 +3831,7 @@ namespace CalamityMod.Projectiles { if ((player.Calamity().flaskBrimstone || player.Calamity().flaskCrumbling || player.Calamity().flaskHoly) && !projectile.noEnchantments && !projectile.noEnchantmentVisuals) { - int dustType = player.Calamity().flaskHoly ? (Main.rand.NextBool() ? 87 : (int)CalamityDusts.ProfanedFire) : player.Calamity().flaskBrimstone ? (Main.rand.NextBool() ? 114 : ModContent.DustType()) : (Main.rand.NextBool() ? 121 : DustID.Stone); + int dustType = player.Calamity().flaskHoly ? (Main.rand.NextBool() ? 87 : (int)CalamityDusts.ProfanedFire) : player.Calamity().flaskBrimstone ? (Main.rand.NextBool() ? 114 : DustType()) : (Main.rand.NextBool() ? 121 : DustID.Stone); if (Main.rand.NextBool(player.Calamity().flaskCrumbling ? 5 : 4)) { Dust dust = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, Main.rand.NextFloat(0.6f, 0.9f)); @@ -3898,7 +3898,7 @@ namespace CalamityMod.Projectiles PointParticle spark = new PointParticle(projectile.Center + projectile.velocity * 3, projectile.velocity, false, 2, 0.9f, Color.Crimson * 0.7f); GeneralParticleHandler.SpawnParticle(spark); - Dust dust = Dust.NewDustPerfect(projectile.Center - projectile.velocity, Main.rand.NextBool(3) ? 90 : ModContent.DustType(), projectile.velocity * Main.rand.NextFloat(0.05f, 0.9f)); + Dust dust = Dust.NewDustPerfect(projectile.Center - projectile.velocity, Main.rand.NextBool(3) ? 90 : DustType(), projectile.velocity * Main.rand.NextFloat(0.05f, 0.9f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(0.5f, 1f); } @@ -4806,7 +4806,7 @@ namespace CalamityMod.Projectiles int beeType = Main.rand.Next(NPCID.Bee, NPCID.BeeSmall + 1); if (Main.zenithWorld) { - beeType = Main.rand.NextBool(3) ? ModContent.NPCType() : ModContent.NPCType(); + beeType = Main.rand.NextBool(3) ? NPCType() : NPCType(); } else if (Main.masterMode || BossRushEvent.BossRushActive) { diff --git a/Systems/WorldMiscUpdateSystem.cs b/Systems/WorldMiscUpdateSystem.cs index c172445a7b..cc580cd0d9 100644 --- a/Systems/WorldMiscUpdateSystem.cs +++ b/Systems/WorldMiscUpdateSystem.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Systems // Reset this int because it causes bugs with other mods if you delete Dr. Draedon through abnormal means. if (CalamityGlobalNPC.draedon != -1) { - if (!NPC.AnyNPCs(ModContent.NPCType())) + if (!NPC.AnyNPCs(NPCType())) CalamityGlobalNPC.draedon = -1; } @@ -132,13 +132,13 @@ namespace CalamityMod.Systems if (DraedonSummonCountdown == DraedonSummonCountdownMax - 45) { IEntitySource source = new EntitySource_WorldEvent(); - Projectile.NewProjectile(source, DraedonSummonPosition + Vector2.UnitY * 80f, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(source, DraedonSummonPosition + Vector2.UnitY * 80f, Vector2.Zero, ProjectileType(), 0, 0f); } if (DraedonSummonCountdown == 0) { IEntitySource source = new EntitySource_WorldEvent(); - NPC.NewNPC(source, (int)DraedonSummonPosition.X, (int)DraedonSummonPosition.Y, ModContent.NPCType()); + NPC.NewNPC(source, (int)DraedonSummonPosition.X, (int)DraedonSummonPosition.Y, NPCType()); } } #endregion Handle Draedon Summoning @@ -242,7 +242,7 @@ namespace CalamityMod.Systems if (CalamityGlobalTile.GrowthTiles.Contains(tileType) && growthTile.Slope == SlopeType.Solid && !growthTile.IsHalfBlock) { int growthChance = 2; - if (tileType == ModContent.TileType()) + if (tileType == TileType()) growthChance *= 5; if (Main.rand.NextBool(growthChance)) @@ -269,18 +269,18 @@ namespace CalamityMod.Systems { Tile tile = Main.tile[x, y]; bool growTile = !tile.HasTile && tile.LiquidAmount >= 128; - bool isSunkenSeaTile = tileType == ModContent.TileType() || tileType == ModContent.TileType(); + bool isSunkenSeaTile = tileType == TileType() || tileType == TileType(); bool meetsAdditionalGrowConditions = tile.Slope == SlopeType.Solid && !tile.IsHalfBlock && tile.LiquidType != LiquidID.Lava; if (growTile && meetsAdditionalGrowConditions) { - int tileType2 = ModContent.TileType(); + int tileType2 = TileType(); - if (tileType == ModContent.TileType()) - tileType2 = ModContent.TileType(); + if (tileType == TileType()) + tileType2 = TileType(); bool canPlaceBasedOnAttached = true; - if (tileType2 == ModContent.TileType() && !isSunkenSeaTile) + if (tileType2 == TileType() && !isSunkenSeaTile) canPlaceBasedOnAttached = false; if (canPlaceBasedOnAttached && CanPlaceBasedOnProximity(x, y, tileType2)) @@ -395,7 +395,7 @@ namespace CalamityMod.Systems public static bool CanPlaceBasedOnProximity(int x, int y, int tileType) { - if (tileType == ModContent.TileType() && !DownedBossSystem.downedLeviathan) + if (tileType == TileType() && !DownedBossSystem.downedLeviathan) return false; int minDistanceFromOtherTiles = 10; @@ -458,10 +458,10 @@ namespace CalamityMod.Systems int chance = (int)spawnRate; if (Main.rand.NextBool(chance)) { - if (!NPC.AnyNPCs(ModContent.NPCType()) && Main.netMode != NetmodeID.MultiplayerClient && + if (!NPC.AnyNPCs(NPCType()) && Main.netMode != NetmodeID.MultiplayerClient && ArmoredDiggerSpawnCooldown <= 0) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + NPC.SpawnOnPlayer(player.whoAmI, NPCType()); ArmoredDiggerSpawnCooldown = 36000; } } @@ -507,7 +507,7 @@ namespace CalamityMod.Systems bool adultWyrmAlive = CalamityGlobalNPC.adultEidolonWyrmHead != -1 && Main.npc[CalamityGlobalNPC.adultEidolonWyrmHead].active; if (!adultWyrmAlive) - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + NPC.SpawnOnPlayer(player.whoAmI, NPCType()); } #endregion } diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index 5979a32adb..a9611366dd 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -707,7 +707,7 @@ namespace CalamityMod public static void DrawStarTrail(this Projectile projectile, Color outer, Color inner, float auraHeight = 10f) { - Texture2D aura = ModContent.Request("CalamityMod/Projectiles/StarTrail").Value; + Texture2D aura = Request("CalamityMod/Projectiles/StarTrail").Value; Vector2 offsets = new Vector2(0f, projectile.gfxOffY) - Main.screenPosition; Rectangle auraRec = aura.Frame(); float auraRotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; diff --git a/Utilities/TileEntityUtils.cs b/Utilities/TileEntityUtils.cs index 4508e9c84c..3e5fae0989 100644 --- a/Utilities/TileEntityUtils.cs +++ b/Utilities/TileEntityUtils.cs @@ -77,7 +77,7 @@ namespace CalamityMod // This check is done twice because the draw order matters. We want to draw the background icon before any text. if (item.stack > 0) { - if (item.type == ModContent.ItemType()) + if (item.type == ItemType()) { slotBackgroundTex = Request("CalamityMod/UI/DraedonsArsenal/PowerCellSlot_Blood").Value; } diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index 7f9f60001e..fa2cb36748 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -696,10 +696,10 @@ namespace CalamityMod if (ignoreAbyss) { - tileExcludeList.Add(ModContent.TileType()); - tileExcludeList.Add(ModContent.TileType()); - tileExcludeList.Add(ModContent.TileType()); - tileExcludeList.Add(ModContent.TileType()); + tileExcludeList.Add(TileType()); + tileExcludeList.Add(TileType()); + tileExcludeList.Add(TileType()); + tileExcludeList.Add(TileType()); } return !Main.tileContainer[tile.TileType] && !tileExcludeList.Contains(tile.TileType);