Decided to search through some TODOs

This commit is contained in:
CongratsIsTrash committed 2024-10-01 12:52:30 -04:00
1 parent cac6880323
commit ea83dcd55e
11 files changed
+20 -48

No files matched your search

-8
View File
@@ -21,14 +21,6 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
}
public override bool CanEquipAccessory(Player player, int slot, bool modded)
{
if (player.Calamity().gladiatorSword)
return false;
return true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
float damageIncrease = 0.2f;
-2
View File
@@ -34,8 +34,6 @@ namespace CalamityMod.Items.Accessories
Item.Calamity().donorItem = true;
}
public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().howlsHeart;
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
-8
View File
@@ -25,14 +25,6 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
}
public override bool CanEquipAccessory(Player player, int slot, bool modded)
{
if (player.Calamity().voidField)
return false;
return true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.GetCritChance<RangedDamageClass>() += 5;
-1
View File
@@ -12,7 +12,6 @@ using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Items.Accessories
{
// TODO -- this item includes a dodge accessory, Brain of Cthulhu
public class TheAmalgam : ModItem, ILocalizedModType, IHoldShiftTooltipItem
{
public new string LocalizationCategory => "Items.Accessories";
+1 -1
View File
@@ -274,7 +274,7 @@ namespace CalamityMod.Items
{
// Calculate how much damage to deal based on how much mana was consumed
int remainingMana = player.statMana;
int damagePerManaConsumed = 80; // TODO -- may not be balanced, but eating 150 mana to do 12,000 base damage seems okay
int damagePerManaConsumed = 80;
int monsterDamage = (int)player.GetTotalDamage<MagicDamageClass>().ApplyTo(remainingMana * damagePerManaConsumed);
// Spawn the Mana Monster
-1
View File
@@ -533,7 +533,6 @@ namespace CalamityMod.NPCs.ExoMechs
}
}
// TODO -- Make this work in conjunction with exo mech transitions. This requires that the exo mech AIs be finished.
public void FlyAroundInGamerChair()
{
// Define a hover destination offset if one hasn't been decided yet.
-1
View File
@@ -75,7 +75,6 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void HitEffect(NPC.HitInfo hit)
{
// TODO -- This dust was an invalid dust. Replaced with a random dust.
int dustType = 91;
for (int k = 0; k < 5; k++)
{
-1
View File
@@ -69,7 +69,6 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void HitEffect(NPC.HitInfo hit)
{
// TODO -- This dust was an invalid dust. Replaced with a random dust.
int dustType = 115;
for (int k = 0; k < 5; k++)
{
-5
View File
@@ -41,11 +41,6 @@ namespace CalamityMod.Projectiles.Boss
{
Main.player[playerTracker].statLife = Main.player[playerTracker].statLifeMax2;
}
// TODO -- but why
if (Main.player[playerTracker].statLife < 0)
{
Main.player[playerTracker].KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ProvidenceAntiHealing").Format(Main.player[playerTracker].name)), 1000.0, 0, false);
}
NetMessage.SendData(MessageID.SpiritHeal, -1, -1, null, playerTracker, (float)healAmount, 0f, 0f, 0, 0, 0);
}
Projectile.Kill();
+4 -5
View File
@@ -1,6 +1,7 @@
using System;
using System.IO;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Sounds;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -127,11 +128,9 @@ namespace CalamityMod.Projectiles.Magic
}
public void ExplosionEffect(NPC target, Player player)
{
// Apply damage to the target and register it to the owner's DPS meter.
// TODO -- why does Eternity directly StrikeNPC with its own damage variance instead of using a DirectStrike
int damage = (int)player.GetTotalDamage<MagicDamageClass>().ApplyTo(Eternity.ExplosionDamage * Main.rand.NextFloat(0.9f, 1.1f));
player.addDPS(damage);
target.StrikeNPC(target.CalculateHitInfo(damage, 0, false, 0f));
// Apply damage to the target.
int damage = (int)player.GetTotalDamage<MagicDamageClass>().ApplyTo(Eternity.ExplosionDamage);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), damage, 0f, Projectile.owner, target.whoAmI);
Vector2 randomCirclePointVector = Vector2.UnitY.RotatedBy(Projectile.rotation);
+15 -15
View File
@@ -19,6 +19,10 @@ namespace CalamityMod.Projectiles.Magic
private const float MaxManaConsumptionDelay = 15f;
private const float MinManaConsumptionDelay = 5f;
public ref float FrameCounter => ref Projectile.ai[0];
public ref float ManaConsumptionFrame => ref Projectile.ai[1];
public ref float ManaConsumptionDelay => ref Projectile.localAI[0];
public override void SetStaticDefaults()
{
Main.projFrames[Projectile.type] = 6;
@@ -35,9 +39,6 @@ namespace CalamityMod.Projectiles.Magic
Projectile.ignoreWater = true;
}
// TODO -- Make property wrappers for these variables instead of needing to explain them.
// ai[0] is a frame counter. ai[1] is the next frame mana will be consumed.
// localAI[0] is the number of frames between mana consumptions.
public override void AI()
{
Player player = Main.player[Projectile.owner];
@@ -46,13 +47,12 @@ namespace CalamityMod.Projectiles.Magic
// Update damage based on curent magic damage stat (so Mana Sickness affects it)
Projectile.damage = player.ActiveItem() is null ? 0 : player.GetWeaponDamage(player.ActiveItem());
// ai[0] is the overall frame counter.
Projectile.ai[0] += 1f;
float chargeRatio = MathHelper.Clamp(Projectile.ai[0] / MaxCharge, 0f, 1f);
FrameCounter += 1f;
float chargeRatio = MathHelper.Clamp(FrameCounter / MaxCharge, 0f, 1f);
// Update the crystal's animation, with the animation accelerating as the crystal charges
Projectile.frameCounter++;
int framesPerAnimationUpdate = Projectile.ai[0] >= MaxCharge ? 2 : Projectile.ai[0] >= (MaxCharge * 0.66f) ? 3 : 4;
int framesPerAnimationUpdate = FrameCounter >= MaxCharge ? 2 : FrameCounter >= (MaxCharge * 0.66f) ? 3 : 4;
if (Projectile.frameCounter >= framesPerAnimationUpdate)
{
Projectile.frameCounter = 0;
@@ -65,12 +65,12 @@ namespace CalamityMod.Projectiles.Magic
{
Projectile.soundDelay = SoundInterval;
// Don't play the continuous beam sound the first time around
if (Projectile.ai[0] > 1f)
if (FrameCounter > 1f)
SoundEngine.PlaySound(SoundID.Item15, Projectile.Center);
}
// Once the crystal reaches a certain charge, start producing dust. More charge = more dust.
if (Projectile.ai[0] > DustStart && Main.rand.NextFloat() < chargeRatio)
if (FrameCounter > DustStart && Main.rand.NextFloat() < chargeRatio)
SpawnEjectionDust(chargeRatio);
UpdatePlayerVisuals(player, rrp);
@@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Magic
bool crystalStillInUse = !player.CantUseHoldout() && allowContinuedUse;
// The beams are only projected once (on frame 1).
if (crystalStillInUse && Projectile.ai[0] == 1f)
if (crystalStillInUse && FrameCounter == 1f)
{
Vector2 beamVelocity = Vector2.Normalize(Projectile.velocity);
if (beamVelocity.HasNaNs())
@@ -110,16 +110,16 @@ namespace CalamityMod.Projectiles.Magic
private bool ShouldConsumeMana()
{
// If the mana consumption timer hasn't been initialized yet, initialize it and consume mana on frame 1.
if (Projectile.localAI[0] == 0f)
if (ManaConsumptionDelay == 0f)
{
Projectile.ai[1] = Projectile.localAI[0] = MaxManaConsumptionDelay;
ManaConsumptionFrame = ManaConsumptionDelay = MaxManaConsumptionDelay;
return true;
}
bool consume = Projectile.ai[0] == Projectile.ai[1];
bool consume = FrameCounter == ManaConsumptionFrame;
if (consume)
{
Projectile.localAI[0] = MathHelper.Clamp(Projectile.localAI[0] - 1f, MinManaConsumptionDelay, MaxManaConsumptionDelay);
Projectile.ai[1] += Projectile.localAI[0];
ManaConsumptionDelay = MathHelper.Clamp(ManaConsumptionDelay - 1f, MinManaConsumptionDelay, MaxManaConsumptionDelay);
ManaConsumptionFrame += ManaConsumptionDelay;
}
return consume;
}