Code Cleanup

This commit is contained in:
Xyk authored and Cameron Ewell committed 2025-02-02 14:42:51 -05:00
1 parent a51efd7621
commit 341cecc6ce
6 files changed
+8 -30

No files matched your search

-2
View File
@@ -4,8 +4,6 @@ using System.Linq;
using CalamityMod.Balancing;
using CalamityMod.BiomeManagers;
using CalamityMod.Buffs;
using CalamityMod.Buffs.Alcohol;
using CalamityMod.Buffs.Placeables;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.CalPlayer.Dashes;
+1 -13
View File
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq;
using CalamityMod.Balancing;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Placeables;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Buffs.Summon;
@@ -1521,18 +1520,7 @@ namespace CalamityMod.CalPlayer
if (transformer && Player.Calamity().transformerCooldown == 0) // The code for this acursed thing took much... MUCH, too long to make
{
float zoneSize = 150;
// This is a visualizer used to easily see the area
/*
for (int i = 0; i < 13; i++)
{
Vector2 vel1 = new Vector2(zoneSize, 0).RotatedByRandom(100);
Vector2 vel2 = new Vector2(zoneSize, 0).RotatedByRandom(100);
Particle spark2 = new CustomSpark(Player.Center + vel1, -vel1 * 0.01f, "CalamityMod/Particles/GlowSquareParticle", false, 8, Main.rand.NextFloat(0.3f, 0.5f), Color.Cyan, new Vector2(2f, 1f), true, false, 0, false, false, -1.5f);
GeneralParticleHandler.SpawnParticle(spark2);
Particle spark = new CustomSpark(Player.Center + vel2, -vel2 * 0.01f, "CalamityMod/Particles/GlowSquareParticle", false, 8, Main.rand.NextFloat(0.3f, 0.5f), Color.Cyan, new Vector2(2f, 1f), true, false, 0, false, false, -1.5f);
GeneralParticleHandler.SpawnParticle(spark);
}
*/
// GFB changes are that projectiles slow and have lifetime decay when in the aura, also they can add charges way faster than normal, deal more damage the more you collect, and the number of blobs is uncapped
for (int x = 0; x < Main.maxProjectiles; x++)
{
Projectile projectile = Main.projectile[x];
@@ -1875,8 +1875,8 @@ TheTransformer: {
The globs encircle you and deal low damage and knockback to enemies they collide with
The circle can contain up to 30 globs at once
Press [KEY] to transform all globs into needles and launch them at your cursor
[c/1FFBFF:'What you hold now is an unstable blueprint of a substance far more potent.]
[c/1FFBFF:Though, perhaps the material instability of this matter can still be of service.']
[c/1FFBFF:'What you hold now is an unstable blueprint of a substance far more potent.] REMOVE DRAEDON
[c/1FFBFF:Though, perhaps the material instability of this matter can still be of service.'] REMOVE DRAEDON
'''
TooltipGFB:
'''
@@ -1884,8 +1884,7 @@ TheTransformer: {
The globs encircle you and deal low damage and knockback to enemies they collide with
The circle has no limit to the number of globs it can hold, but your PC might
Press [KEY] to transform all globs into needles and launch them at your cursor
[c/1FFBFF:'What IS this thing? How did you even make this?]
[c/1FFBFF:It looks like shit.']
'It's like catch and release if the release was a particle accelerator'
'''
}
-4
View File
@@ -1,14 +1,10 @@
using System;
using System.Collections.Generic;
using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Typeless
+4 -7
View File
@@ -1,15 +1,11 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.CalPlayer;
using CalamityMod.Dusts;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Typeless
@@ -33,7 +29,7 @@ namespace CalamityMod.Projectiles.Typeless
public float rotSpeed = 1f;
public int savedFrame = 0;
public bool powered => Projectile.localAI[0] == 5;
public int poweredTimerMax => (int)(140 + (MathHelper.Clamp(Utils.Remap(Owner.ownedProjectileCounts[ModContent.ProjectileType<TransformerBlob>()], 1, 30, 7, 6, false), 3, 7)) * Projectile.ai[1]);
public int poweredTimerMax = 140;
public int poweredTimer = -1;
public Color cl1 = Color.LightSkyBlue;
public Color cl2 = Color.DodgerBlue;
@@ -64,7 +60,8 @@ namespace CalamityMod.Projectiles.Typeless
Lighting.AddLight(Projectile.Center, cl1.ToVector3() * 0.5f);
sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * (Projectile.ai[1] % 2 == 0 ? 10 : 6) / MathHelper.Pi) * 0.4f;
if (!powered)
poweredTimerMax = (int)(140 + (MathHelper.Clamp(Utils.Remap(Owner.ownedProjectileCounts[ModContent.ProjectileType<TransformerBlob>()], 1, 30, 7, 6, false), 1, 120)) * Projectile.ai[1]);
if (time == 0)
{
rotationAngle = Projectile.ai[2];
@@ -75,7 +72,7 @@ namespace CalamityMod.Projectiles.Typeless
poweredTimer = poweredTimerMax;
savedFrame = Projectile.frame;
}
if (time >= 40)
{
Projectile.frameCounter++;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB