From 8d7e4b204e4cba0a0d9820297fbfb3c3189f3a7c Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sun, 22 May 2022 02:03:15 -0400 Subject: [PATCH] clean up of all todos + standard formatting --- CalPlayer/CalamityPlayer.cs | 2 +- CalPlayer/CalamityPlayerOnHit.cs | 4 ---- CalamityNetcode.cs | 2 +- Items/Accessories/BlunderBooster.cs | 2 +- Items/Accessories/PlaguedFuelPack.cs | 2 +- Items/Armor/BrimflameScowl.cs | 1 - Items/CalamityGlobalItemTooltip.cs | 2 +- Items/CalamityGlobalItemTweaks.cs | 3 ++- Items/Weapons/Melee/SoulEdge.cs | 2 +- Localization/CalamityLocalization.cs | 2 +- Projectiles/Pets/Sparks.cs | 2 +- Projectiles/Summon/VoidConcentrationBlackhole.cs | 11 ++++++----- Systems/EntityUpdateInterceptionSystem.cs | 2 +- Utilities/GenericAIUtils.cs | 1 - 14 files changed, 17 insertions(+), 21 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 078d1240a0..9beef243df 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -2710,7 +2710,7 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(SoundID.Item34, Player.Center); } - //TODO : It would be nice if triggerable set bonuses used interfaces instead of having to go through this large if chain. + // TODO -- It would be nice if triggerable set bonuses used interfaces instead of having to go through this large if chain. if (CalamityKeybinds.SetBonusHotKey.JustPressed) { if (brimflameSet && !Player.HasCooldown(BrimflameFrenzy.ID)) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 7f7f6d98f7..ab6ff5616b 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -351,10 +351,6 @@ namespace CalamityMod.CalPlayer break; } - // TODO -- This should be removed, why is this here? - if (ProjectileID.Sets.StardustDragon[proj.type]) - target.immune[proj.owner] = 10; - if ((proj.arrow && Player.hasMoltenQuiver) || hellfireTreads) { if (Main.rand.Next(4) == 0) diff --git a/CalamityNetcode.cs b/CalamityNetcode.cs index 47fa562069..e37f1f7e59 100644 --- a/CalamityNetcode.cs +++ b/CalamityNetcode.cs @@ -390,7 +390,7 @@ namespace CalamityMod EncounteredOldDukeSync, // Reforge syncs - ItemTypeLastReforgedSync, // TODO -- there has to be a better way to do this, but I don't know what it is + ItemTypeLastReforgedSync, // TODO -- reforge netcode is no longer needed thanks to 1.4 clone fixes ReforgeTierSafetySync, // Mouse Controls syncs diff --git a/Items/Accessories/BlunderBooster.cs b/Items/Accessories/BlunderBooster.cs index 10e5f90c34..5267d15f17 100644 --- a/Items/Accessories/BlunderBooster.cs +++ b/Items/Accessories/BlunderBooster.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - //Todo - Check if its trying to replace the other rogue jetpack. If its the case, return true. + // TODO -- Check if its trying to replace the other rogue jetpack. If its the case, return true. public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().hasJetpack; public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/PlaguedFuelPack.cs b/Items/Accessories/PlaguedFuelPack.cs index 33019c558c..498fcfe9d7 100644 --- a/Items/Accessories/PlaguedFuelPack.cs +++ b/Items/Accessories/PlaguedFuelPack.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - //Todo : Check if the slot contains the other rogue jetpack, in which case, let the player swap accs + // TODO -- Check if the slot contains the other rogue jetpack, in which case, let the player swap accs public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().hasJetpack; public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Armor/BrimflameScowl.cs b/Items/Armor/BrimflameScowl.cs index 22b18176c6..fb7e5e1276 100644 --- a/Items/Armor/BrimflameScowl.cs +++ b/Items/Armor/BrimflameScowl.cs @@ -57,7 +57,6 @@ namespace CalamityMod.Items.Armor player.GetDamage(DamageClass.Magic) += 0.05f; player.GetCritChance(DamageClass.Magic) += 5; player.statManaMax2 += 70; - // TODO -- oh god. player.manaCost -= 0.1f; player.manaCost *= 0.9f; player.buffImmune[ModContent.BuffType()] = true; player.buffImmune[BuffID.OnFire] = true; diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 1b1d7e3799..d558d6b7f3 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -922,7 +922,7 @@ namespace CalamityMod.Items AddGrappleStats(25f, 13f, 11f, 11f); if (item.type == ItemID.IvyWhip) AddGrappleStats(25f, 13f, 15f, 11f); - if (item.type == ItemID.BatHook) // TODO -- This item should be dropped by Vampires in the Eclipse. It is very overpowered. + if (item.type == ItemID.BatHook) AddGrappleStats(31.25f, 13.5f, 20f, 13f); if (item.type == ItemID.CandyCaneHook) AddGrappleStats(25f, 11.5f, 11f, 11f); diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 9690bc46af..20bfeaec7d 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -135,7 +135,8 @@ namespace CalamityMod.Items { ItemID.DarkLance, Do(AutoReuse, TrueMelee, DamageExact(68)) }, { ItemID.DartPistol, pointBlank }, { ItemID.DartRifle, pointBlank }, - { ItemID.DayBreak, Do(DamageRatio(1.5f)) }, // TODO -- replace with 1.4 behavior of Daybreak spears exploding on death for 100% damage + // if Daybreak still needs a buff after the 1.4 explosion change, apply it here + // { ItemID.DayBreak, Do(DamageRatio(1.0f)) } { ItemID.DD2BallistraTowerT1Popper, Do(UseExact(30)) }, { ItemID.DD2BallistraTowerT2Popper, Do(UseExact(25)) }, { ItemID.DD2BallistraTowerT3Popper, Do(UseExact(20)) }, diff --git a/Items/Weapons/Melee/SoulEdge.cs b/Items/Weapons/Melee/SoulEdge.cs index 6131364c26..325d7de2e4 100644 --- a/Items/Weapons/Melee/SoulEdge.cs +++ b/Items/Weapons/Melee/SoulEdge.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Melee float SpeedY = velocity.Y + (float)Main.rand.Next(-40, 41) * 0.05f; float ai1 = Main.rand.NextFloat() + 0.5f; // TODO -- unchecked type addition math assumes we can guarantee load order - // this is extremely unsafe and load order may become non deterministic in 1.4 + // this is extremely unsafe and if TML optimizes autoloading or asset loading it could fail Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, Main.rand.Next(type, type + 3), damage, knockback, player.whoAmI, 0.0f, ai1); } return false; diff --git a/Localization/CalamityLocalization.cs b/Localization/CalamityLocalization.cs index e574c16203..2cda2bfa96 100644 --- a/Localization/CalamityLocalization.cs +++ b/Localization/CalamityLocalization.cs @@ -2,7 +2,7 @@ namespace CalamityMod.Localization { - // TODO - At some point change this to use proper localization files. + // TODO -- At some point change this to use proper localization files. public class CalamityLocalization { private static string[][] _localizations; diff --git a/Projectiles/Pets/Sparks.cs b/Projectiles/Pets/Sparks.cs index d78a5075f2..464e1eda36 100644 --- a/Projectiles/Pets/Sparks.cs +++ b/Projectiles/Pets/Sparks.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Pets { if (Projectile.owner == Main.myPlayer && (player.ActiveItem().type != ItemID.None || player.itemAnimation <= 0)) { - // TODO, fix this maybe? + // TODO -- fix this maybe? (what is it?) if (!ItemLoader.OnPickup(item, player)) { Main.item[itemIndex] = new Item(); diff --git a/Projectiles/Summon/VoidConcentrationBlackhole.cs b/Projectiles/Summon/VoidConcentrationBlackhole.cs index 74cd8678c5..d8e7e23dcc 100644 --- a/Projectiles/Summon/VoidConcentrationBlackhole.cs +++ b/Projectiles/Summon/VoidConcentrationBlackhole.cs @@ -1,11 +1,12 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; +using System; using System.IO; +using CalamityMod.NPCs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; namespace CalamityMod.Projectiles.Summon { @@ -167,7 +168,7 @@ namespace CalamityMod.Projectiles.Summon for (int i = 0; i < Main.npc.Length; i++) { - if (Main.npc[i].active && !Main.npc[i].friendly /*&& CalamityGlobalNPC.ShouldAffectNPC(Main.npc[i])*/) //TODO - REMOVE COMMENT BEFORE MERGE + if (Main.npc[i].active && !Main.npc[i].friendly && CalamityGlobalNPC.ShouldAffectNPC(Main.npc[i])) { if (Vector2.Distance(Projectile.Center, Main.npc[i].Center) <= radius) ApplySucc(Main.npc[i]); diff --git a/Systems/EntityUpdateInterceptionSystem.cs b/Systems/EntityUpdateInterceptionSystem.cs index 581d74cbd5..7dca2a36eb 100644 --- a/Systems/EntityUpdateInterceptionSystem.cs +++ b/Systems/EntityUpdateInterceptionSystem.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Systems #endregion Ash Drawing #region Post NPC Updating - // TODO - Apply caching to this process. For now most of the looping issues should be eradicated but it can be reduced further. + // TODO -- Apply caching to this process. For now most of the looping issues should be eradicated but it can be reduced further. public override void PostUpdateNPCs() => CalamityGlobalNPC.ResetTownNPCNameBools(); #endregion diff --git a/Utilities/GenericAIUtils.cs b/Utilities/GenericAIUtils.cs index 9377f52a2d..e42282fb65 100644 --- a/Utilities/GenericAIUtils.cs +++ b/Utilities/GenericAIUtils.cs @@ -8,7 +8,6 @@ using static Terraria.ModLoader.ModContent; namespace CalamityMod { - // TODO -- This does not properly utilize OOP. Destroy this file and convert everything here into a base entity at some point. public static partial class CalamityUtils { public static void ChargingMinionAI(this Projectile projectile, float range, float maxPlayerDist, float extraMaxPlayerDist, float safeDist, int initialUpdates, float chargeDelayTime, float goToSpeed, float goBackSpeed, Vector2 returnOffset, float chargeCounterMax, float chargeSpeed, bool tileVision, bool ignoreTilesWhenCharging, int updateDifference = 1)