Fixed a ton of compiler warnings

This commit is contained in:
CongratsIsTrash committed 2025-10-17 12:36:26 -04:00
1 parent 81cb5b2c12
commit b50c3821a3
38 files changed
+82 -133

No files matched your search

+3 -3
View File
@@ -1831,7 +1831,7 @@ namespace CalamityMod.ILEditing
droids.velocity = -self.velocity.RotatedByRandom(MathHelper.Pi / 20f) * 2f;
droids.netUpdate = true;
droids.shimmerTransparency = 1f;
NetMessage.SendData(146, -1, -1, null, 2, droids.whoAmI);
NetMessage.SendData(MessageID.ShimmerActions, -1, -1, null, 2, droids.whoAmI);
}
self.TurnToAir();
@@ -1844,8 +1844,8 @@ namespace CalamityMod.ILEditing
}
else
{
NetMessage.SendData(146, -1, -1, null, 0, (int)self.Center.X, (int)self.Center.Y);
NetMessage.SendData(145, -1, -1, null, self.whoAmI, 1f);
NetMessage.SendData(MessageID.ShimmerActions, -1, -1, null, 0, (int)self.Center.X, (int)self.Center.Y);
NetMessage.SendData(MessageID.SyncItemsWithShimmer, -1, -1, null, self.whoAmI, 1f);
}
}
}
+1 -7
View File
@@ -1,20 +1,14 @@
using System;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Projectiles.BaseProjectiles;
using CalamityMod.Projectiles.Boss;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Rarities;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Mono.Cecil;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
using Terraria.Audio;
using CalamityMod.Items.Weapons.Summon;
using Terraria.ModLoader;
using static System.Net.Mime.MediaTypeNames;
namespace CalamityMod.Items.Weapons.Melee
{
+3 -6
View File
@@ -998,7 +998,6 @@ namespace CalamityMod.NPCs
#endregion
bool hasModHotOil = false;
//Apply DoT Debuffs
for (var index = 0; index < npc.buffType.Count(); index++)
{
@@ -1007,8 +1006,6 @@ namespace CalamityMod.NPCs
if (debuffData == null || debuffData == DebuffData.Oiled) //Oiled is done after
continue;
debuffData.NPCLifeRegenMethod(npc, type, ref index,ref damage);
if (debuffData.HeatDebuffScaling > 0)
hasModHotOil = true;
}
//Oiled comes after so that we can detect if they have a heat debuff in the above loop
bool hasVanillaOil = npc.onFrostBurn || npc.onFrostBurn2 || npc.onFire || npc.onFire2 || npc.onFire3 || npc.shadowFlame;
@@ -6872,13 +6869,13 @@ namespace CalamityMod.NPCs
// Draw the glowmasks.
int frameCounter = (int)npc.frameCounter / 4;
Rectangle frame = TextureAssets.Extra[106].Value.Frame(1, 8);
Rectangle frame = TextureAssets.Extra[ExtrasID.GolemLights4].Value.Frame(1, 8);
frame.Y += frame.Height * 2 * frameCounter + npc.frame.Y;
Rectangle glowFrame = frame;
spriteBatch.Draw(TextureAssets.Extra[106].Value, eyesDrawPosition, glowFrame, eyeColor, 0f, glowFrame.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f);
spriteBatch.Draw(TextureAssets.Extra[ExtrasID.GolemLights4].Value, eyesDrawPosition, glowFrame, eyeColor, 0f, glowFrame.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f);
frame = npc.frame;
Rectangle glowFrame2 = frame;
spriteBatch.Draw(TextureAssets.Extra[107].Value, eyesDrawPosition, glowFrame2, eyeColor, 0f, glowFrame2.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f);
spriteBatch.Draw(TextureAssets.Extra[ExtrasID.GolemLights5].Value, eyesDrawPosition, glowFrame2, eyeColor, 0f, glowFrame2.Size() * 0.5f, npc.scale, SpriteEffects.None, 0f);
// Draw the sparkle telegraphs for the laser spread attack if applicable.
if (npc.ai[0] == 3f && npc.ai[1] <= 60f)
+1 -1
View File
@@ -73,7 +73,7 @@ namespace CalamityMod.NPCs.SunkenSea
bonePos = NPC.Center + new Vector2(Main.rand.Next(-extraDistX, extraDistX + 1), Main.rand.Next(-extraDistY, extraDistY + 1));
}
}
Particle bone = new ChumBone(bonePos, Vector2.Zero, NPC.GetAlpha(Color.White), Main.rand.NextFloat(-MathHelper.PiOver4, MathHelper.PiOver4), Main.rand.NextFloat(0.8f, 1.6f), 4, Main.rand.NextBool(), Main.rand.NextBool());
Particle bone = new ChumBone(bonePos, Vector2.Zero, NPC.GetAlpha(Color.White), Main.rand.NextFloat(-MathHelper.PiOver4, MathHelper.PiOver4), Main.rand.NextFloat(0.8f, 1.6f), 4, Main.rand.NextBool());
GeneralParticleHandler.SpawnParticle(bone);
// Add to a list of bones
bones.Add(bone);
@@ -1858,7 +1858,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (trueEyeSphereDirection.HasNaNs())
trueEyeSphereDirection = Vector2.UnitY * -1f;
float spreadVelocity = 4f;
trueEyeSphereDirection *= 4f;
int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + freeEyeRotation.X, npc.Center.Y + freeEyeRotation.Y, trueEyeSphereDirection.X, trueEyeSphereDirection.Y, type, 0, 0f, Main.myPlayer, 30f, npc.whoAmI);
Main.projectile[proj].timeLeft = 1200;
+5 -5
View File
@@ -14,11 +14,10 @@ namespace CalamityMod.Particles
public override bool UseCustomDraw => true;
public override bool SetLifetime => true;
private bool direction;
private bool variant;
private bool TexVariant;
public static string Texture2 => "CalamityMod/Particles/ChumBone2";
public ChumBone(Vector2 position, Vector2 velocity, Color color, float rotation, float scale, int lifeTime, bool variant, bool direction)
public ChumBone(Vector2 position, Vector2 velocity, Color color, float rotation, float scale, int lifeTime, bool variant)
{
Position = position;
Velocity = velocity;
@@ -26,6 +25,7 @@ namespace CalamityMod.Particles
Lifetime = lifeTime;
Rotation = rotation;
Color = color;
TexVariant = variant;
}
public override void Update()
@@ -54,8 +54,8 @@ namespace CalamityMod.Particles
public override void CustomDraw(SpriteBatch spriteBatch)
{
Texture2D tex = variant ? ModContent.Request<Texture2D>(Texture2).Value : ModContent.Request<Texture2D>(Texture).Value;
SpriteEffects spriteDir = direction ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
Texture2D tex = TexVariant ? ModContent.Request<Texture2D>(Texture2).Value : ModContent.Request<Texture2D>(Texture).Value;
SpriteEffects spriteDir = SpriteEffects.FlipHorizontally;
spriteBatch.Draw(tex, Position - Main.screenPosition, null, Lighting.GetColor(Position.ToTileCoordinates()), Rotation, new Vector2(tex.Width / 2, tex.Height), Scale, spriteDir, 0);
}
}
@@ -265,20 +265,17 @@ namespace CalamityMod.Projectiles.BaseProjectiles
public override void ModifyDamageHitbox(ref Rectangle hitbox)
{
Vector2 cen = Projectile.Center + new Vector2(HitboxOutset, 0).RotatedBy(FinalRotation + HitboxRotationOffset);
hitbox = new Rectangle((int)cen.X - (int)(HitboxSize.X / 2), (int)cen.Y - (int)(HitboxSize.Y / 2), (int)HitboxSize.X, (int)HitboxSize.Y);
if (false) // Turn this on to show the hitbox, useful for testing if it's working how you want
{
Particle blastRing = new CustomPulse(hitbox.TopLeft(), Vector2.Zero, Color.Red, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.2f, 0.2f, 4);
GeneralParticleHandler.SpawnParticle(blastRing);
Particle blastRing2 = new CustomPulse(hitbox.TopRight(), Vector2.Zero, Color.Gold, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.2f, 0.2f, 4);
GeneralParticleHandler.SpawnParticle(blastRing2);
Particle blastRing3 = new CustomPulse(hitbox.BottomLeft(), Vector2.Zero, Color.Green, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.2f, 0.2f, 4);
GeneralParticleHandler.SpawnParticle(blastRing3);
Particle blastRing4 = new CustomPulse(hitbox.BottomRight(), Vector2.Zero, Color.Cyan, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.2f, 0.2f, 4);
GeneralParticleHandler.SpawnParticle(blastRing4);
}
// Turn this on to show the hitbox, useful for testing if it's working how you want
/*Particle blastRing = new CustomPulse(hitbox.TopLeft(), Vector2.Zero, Color.Red, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.2f, 0.2f, 4);
GeneralParticleHandler.SpawnParticle(blastRing);
Particle blastRing2 = new CustomPulse(hitbox.TopRight(), Vector2.Zero, Color.Gold, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.2f, 0.2f, 4);
GeneralParticleHandler.SpawnParticle(blastRing2);
Particle blastRing3 = new CustomPulse(hitbox.BottomLeft(), Vector2.Zero, Color.Green, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.2f, 0.2f, 4);
GeneralParticleHandler.SpawnParticle(blastRing3);
Particle blastRing4 = new CustomPulse(hitbox.BottomRight(), Vector2.Zero, Color.Cyan, "CalamityMod/Particles/LargeBloom", Vector2.One, Main.rand.NextFloat(-10, 10), 0.2f, 0.2f, 4);
GeneralParticleHandler.SpawnParticle(blastRing4);*/
base.ModifyDamageHitbox(ref hitbox);
}
+8 -8
View File
@@ -448,7 +448,7 @@ namespace CalamityMod.Projectiles
if (Main.rand.NextBool(24))
SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, projectile.Center);
Dust fire = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(projectile.width, projectile.height) * 0.42f, 267);
Dust fire = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(projectile.width, projectile.height) * 0.42f, DustID.RainbowMk2);
fire.color = Color.Lerp(Color.Orange, Color.Red, Main.rand.NextFloat(0.45f, 1f));
fire.scale = Main.rand.NextFloat(1.4f, 1.65f);
fire.fadeIn = 0.5f;
@@ -1444,7 +1444,7 @@ namespace CalamityMod.Projectiles
{
float x2 = projectile.position.X - projectile.velocity.X / (float)totalDust * (float)i;
float y2 = projectile.position.Y - projectile.velocity.Y / (float)totalDust * (float)i;
int dust = Dust.NewDust(new Vector2(x2, y2), 1, 1, 75);
int dust = Dust.NewDust(new Vector2(x2, y2), 1, 1, DustID.CursedTorch);
Main.dust[dust].alpha = projectile.alpha;
Main.dust[dust].position.X = x2;
Main.dust[dust].position.Y = y2;
@@ -2061,14 +2061,14 @@ namespace CalamityMod.Projectiles
projectile.rotation = projectile.velocity.ToRotation();
for (int dustIndex = 0; dustIndex < 5; dustIndex++)
{
Dust dust = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(24f, 24f), 16, projectile.velocity * MathHelper.Lerp(0.2f, 0.7f, Main.rand.NextFloat()));
Dust dust = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(24f, 24f), DustID.Cloud, projectile.velocity * MathHelper.Lerp(0.2f, 0.7f, Main.rand.NextFloat()));
dust.velocity += Main.rand.NextVector2Circular(0.5f, 0.5f);
dust.scale = 0.8f + Main.rand.NextFloat() * 0.5f;
}
for (int dustIndex = 0; dustIndex < 5; dustIndex++)
{
Dust dust = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(24f, 24f), 16, Main.rand.NextVector2Circular(2f, 2f) + projectile.velocity * MathHelper.Lerp(0.2f, 0.5f, Main.rand.NextFloat()));
Dust dust = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(24f, 24f), DustID.Cloud, Main.rand.NextVector2Circular(2f, 2f) + projectile.velocity * MathHelper.Lerp(0.2f, 0.5f, Main.rand.NextFloat()));
dust.velocity += Main.rand.NextVector2Circular(0.5f, 0.5f);
dust.scale = 0.8f + Main.rand.NextFloat() * 0.5f;
dust.fadeIn = 1f;
@@ -4254,7 +4254,7 @@ namespace CalamityMod.Projectiles
for (int i = 0; i < 2; ++i)
{
Dust dust = Dust.NewDustPerfect(projectile.Center + projectile.velocity, 261, -projectile.velocity * Main.rand.NextFloat(0.1f, 0.9f));
Dust dust = Dust.NewDustPerfect(projectile.Center + projectile.velocity, DustID.AncientLight, -projectile.velocity * Main.rand.NextFloat(0.1f, 0.9f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.65f, 0.9f);
dust.alpha = 100;
@@ -4277,7 +4277,7 @@ namespace CalamityMod.Projectiles
for (int i = 0; i < 3; ++i)
{
Dust dust = Dust.NewDustPerfect(projectile.Center + spawnOffset, 278, projectile.velocity * Main.rand.NextFloat(0.05f, 0.2f));
Dust dust = Dust.NewDustPerfect(projectile.Center + spawnOffset, DustID.FireworksRGB, projectile.velocity * Main.rand.NextFloat(0.05f, 0.2f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.35f, 0.45f);
dust.color = color;
@@ -4306,7 +4306,7 @@ namespace CalamityMod.Projectiles
for (int i = 0; i < 3; ++i)
{
Dust dust = Dust.NewDustPerfect(projectile.Center + spawnOffset, 278, projectile.velocity * Main.rand.NextFloat(0.05f, 0.2f));
Dust dust = Dust.NewDustPerfect(projectile.Center + spawnOffset, DustID.FireworksRGB, projectile.velocity * Main.rand.NextFloat(0.05f, 0.2f));
dust.noGravity = true;
dust.scale = Main.rand.NextFloat(0.35f, 0.45f);
dust.color = color;
@@ -4875,7 +4875,7 @@ namespace CalamityMod.Projectiles
if (projectile.spriteDirection == -1)
spriteEffects = SpriteEffects.FlipHorizontally;
Main.EntitySpriteDraw(TextureAssets.Extra[98].Value, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY) - projectile.velocity * projectile.scale * 0.5f, null, projectile.GetAlpha(new Color(vector41.X, vector41.Y, vector41.Z, vector41.W)), projectile.rotation + MathHelper.PiOver2, TextureAssets.Extra[98].Value.Size() / 2f, projectile.scale * 0.9f, spriteEffects);
Main.EntitySpriteDraw(TextureAssets.Extra[ExtrasID.SharpTears].Value, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY) - projectile.velocity * projectile.scale * 0.5f, null, projectile.GetAlpha(new Color(vector41.X, vector41.Y, vector41.Z, vector41.W)), projectile.rotation + MathHelper.PiOver2, TextureAssets.Extra[ExtrasID.SharpTears].Value.Size() / 2f, projectile.scale * 0.9f, spriteEffects);
Color color49 = projectile.GetAlpha(Color.White) * Utils.Remap(projectile.ai[0], 0f, killGateValue, 0.5f, 0f);
color49.A = 0;
@@ -151,17 +151,11 @@ namespace CalamityMod.Projectiles.Damageable
}
if (wasHit && Life > 0)
{
if (HitSound != null)
{
SoundEngine.PlaySound(HitSound, Projectile.Center);
}
SoundEngine.PlaySound(HitSound, Projectile.Center);
}
else if (Life <= 0)
{
if (DeathSound != null)
{
SoundEngine.PlaySound(DeathSound, Projectile.Center);
}
SoundEngine.PlaySound(DeathSound, Projectile.Center);
DamageKillEffect();
Projectile.Kill();
}
@@ -18,7 +18,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
public new string LocalizationCategory => "Projectiles.Misc";
public override int AssociatedItemID => ModContent.ItemType<Nidhogg>();
public Player Owner => Main.player[Projectile.owner];
public float offsetBase = 30;
public override float MaxOffsetLengthFromArm => offsetBase;
public override float RecoilResolveSpeed => (shootingTimer < 0) ? 0.02f : 0.1f;
@@ -17,7 +17,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
public new string LocalizationCategory => "Projectiles.Misc";
public override int AssociatedItemID => ModContent.ItemType<PhalanxSurge>();
public Player Owner => Main.player[Projectile.owner];
public float offsetBase = 30;
public override float MaxOffsetLengthFromArm => doingChargeAttack ? 100f : offsetBase;
public override float RecoilResolveSpeed => doingChargeAttack ? 2f : (shootingTimer < 0) ? 0.2f : 0.1f;
@@ -11,7 +11,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
public new string LocalizationCategory => "Projectiles.Misc";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
private int dust = 127;
public int time = 0;
public override void SetDefaults()
{
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
public bool canStick = true;
public int stuckTimer = 420;
public Vector2 placementCenter;
Vector2 placementVelocity;
public override void SetDefaults()
{
Projectile.width = Projectile.height = 35;
+2 -2
View File
@@ -132,8 +132,8 @@ namespace CalamityMod.Projectiles.Enemy
int boltPoints = 12; // How many times can a bolt bend
int minimumBolts = 6; // Minimum number of bolts
int maximumBolts = 12; // Maximum number of bolts
int minimumSplits = 0; // Minimum number of split bolts
int maximumSplits = 2; // Maximum number of split bolts
//int minimumSplits = 0; // Minimum number of split bolts
//int maximumSplits = 2; // Maximum number of split bolts
points.Clear();
bolts.Clear();
jellyBolts.Clear();
+2 -2
View File
@@ -6,6 +6,7 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Utilities;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;
@@ -38,7 +39,6 @@ namespace CalamityMod.Projectiles.Magic
private Player Owner { get; set; }
private SlotId BigBeamSoundSlot;
public int time = 0;
public override void SetDefaults()
{
@@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Magic
if (Main.rand.NextBool() || isBigLaser)
{
Dust laserDust = Dust.NewDustPerfect(randomLineEffectPosition, 278, Projectile.velocity * Main.rand.NextFloat(5f, 40f), Scale: Main.rand.NextFloat(0.8f, 1.1f));
Dust laserDust = Dust.NewDustPerfect(randomLineEffectPosition, DustID.FireworksRGB, Projectile.velocity * Main.rand.NextFloat(5f, 40f), Scale: Main.rand.NextFloat(0.8f, 1.1f));
laserDust.noGravity = true;
laserDust.color = Main.rand.NextBool(3) ? color2 : color1;
}
-1
View File
@@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
public override LocalizedText DisplayName => CalamityUtils.GetItemName<TheMicrowave>();
public const int MaxUpdates = 3;
private const float Radius = 100f;
private SlotId mmmmmm;
private bool spawnedAura = false;
public int soundCooldown = 0;
+3 -3
View File
@@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Ranged
// Muzzle flash textures
public static Asset<Texture2D> MuzzleFlash;
public static Asset<Texture2D> GlowTexture;
public static Asset<Texture2D> HoldoutGlow;
public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/WulfrumBlunderbussFire") { PitchVariance = 0.1f };
public static readonly SoundStyle PingSound = new("CalamityMod/Sounds/Item/M1GarandPing");
@@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Ranged
public override void Load()
{
MuzzleFlash = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Ranged/M1GarandMuzzleFlash", AssetRequestMode.ImmediateLoad);
GlowTexture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Ranged/M1GarandHoldoutGlow", AssetRequestMode.ImmediateLoad);
HoldoutGlow = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Ranged/M1GarandHoldoutGlow", AssetRequestMode.ImmediateLoad);
}
public override void SetStaticDefaults() => Main.projFrames[Type] = 6;
@@ -344,7 +344,7 @@ namespace CalamityMod.Projectiles.Ranged
{
Texture2D texture = TextureAssets.Projectile[Type].Value;
Rectangle frame = texture.Frame(verticalFrames: Main.projFrames[Type], frameY: Math.Clamp(Projectile.frame, 0, Main.projFrames[Type] - 1));
Texture2D glowTexture = GlowTexture.Value;
Texture2D glowTexture = HoldoutGlow.Value;
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f);
+5 -2
View File
@@ -9,6 +9,7 @@ using ReLogic.Content;
using ReLogic.Utilities;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Projectiles.Ranged
@@ -255,7 +256,7 @@ namespace CalamityMod.Projectiles.Ranged
float randomRadius = Utils.Remap(Timer, 0f, TimePerCharge * 3f, 5f, 15f);
Dust orbDust = Dust.NewDustPerfect(
GunTipPosition + Main.rand.NextVector2Circular(randomRadius, randomRadius),
278,
DustID.FireworksRGB,
-Vector2.UnitY.RotatedByRandom(100) * Main.rand.NextFloat(2f, 5f) * Utils.Remap(Timer, 0f, TimePerCharge * 3f, 1f, 5f),
Scale: Main.rand.NextFloat(0.3f, 0.9f));
orbDust.noGravity = true;
@@ -299,13 +300,14 @@ namespace CalamityMod.Projectiles.Ranged
AIState.Level3 => 36,
AIState.Level2 => 24,
AIState.Level1 => 12,
_ => 0
};
for (int i = 0; i < dustAmount; i++)
{
float angle = MathHelper.TwoPi / dustAmount * i;
Vector2 velocity = angle.ToRotationVector2() * 8f;
Dust chargeDust = Dust.NewDustPerfect(GunTipPosition, 267, velocity, Scale: Utils.Remap(dustAmount, 10f, 30f, 1.5f, 2.2f));
Dust chargeDust = Dust.NewDustPerfect(GunTipPosition, DustID.RainbowMk2, velocity, Scale: Utils.Remap(dustAmount, 10f, 30f, 1.5f, 2.2f));
chargeDust.noGravity = true;
chargeDust.noLight = true;
chargeDust.noLightEmittence = true;
@@ -328,6 +330,7 @@ namespace CalamityMod.Projectiles.Ranged
AIState.Level3 => ChargeLV2Sound,
AIState.Level2 => ChargeLV1Sound,
AIState.Level1 => ChargeLV1Sound,
_ => ChargeLV1Sound
};
SoundEngine.PlaySound(chargeSound, GunTipPosition);
+3 -5
View File
@@ -166,7 +166,7 @@ namespace CalamityMod.Projectiles.Rogue
if (!spawnedDust && toothNum > 1)
{
Dust dust = Dust.NewDustPerfect(finalDrawPos, 5, (rotation.ToRotationVector2().RotatedBy(MathHelper.PiOver2)).RotatedByRandom(0.5f).RotatedBy(1.2f * (isTopJaw ? -1 : 1)) * Main.rand.NextFloat(5f, 8f), 100, default, Main.rand.NextFloat(1.1f, 1.9f) * scale);
Dust dust = Dust.NewDustPerfect(finalDrawPos, DustID.Blood, (rotation.ToRotationVector2().RotatedBy(MathHelper.PiOver2)).RotatedByRandom(0.5f).RotatedBy(1.2f * (isTopJaw ? -1 : 1)) * Main.rand.NextFloat(5f, 8f), 100, default, Main.rand.NextFloat(1.1f, 1.9f) * scale);
dust.noGravity = true;
dust.alpha = (int)(255 * (1 - toothOpacity));
Particle blood = new CustomSpark(finalDrawPos, (rotation.ToRotationVector2().RotatedBy(MathHelper.PiOver2)).RotatedByRandom(0.4f).RotatedBy(1.2f * (isTopJaw ? -1 : 1)) * Main.rand.NextFloat(5f, 8f), "CalamityMod/Particles/LargeBloom",
@@ -187,15 +187,13 @@ namespace CalamityMod.Projectiles.Rogue
if (!canDamage)
return false;
Player Owner = Main.player[Projectile.owner];
Vector2 start = Projectile.Center;
float length = jawLength;
float size = 165;
float _ = float.NaN;
bool hit = Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), start, start + Projectile.velocity.SafeNormalize(Vector2.UnitX) * length, size, ref _);
return (hit);
return CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.Calamity().stealthStrike ? 50 : 18, targetHitbox);
bool hit = Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), start, start + Projectile.velocity.SafeNormalize(Vector2.UnitX) * length, size, ref _);
return hit;
}
}
}
@@ -9,7 +9,6 @@ namespace CalamityMod.Projectiles.Rogue
public class SamsaraSlicerSmallDisk : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Rogue";
private double rotation = 0;
public Projectile Parent = null;
public override void SetStaticDefaults()
{
@@ -69,7 +69,6 @@ namespace CalamityMod.Projectiles.Summon
float projX = Projectile.position.X;
float projY = Projectile.position.Y;
float attackDistance = 100000f;
bool canAttack = false;
Projectile.ai[0] += 1f;
NPC target = null;
+1 -2
View File
@@ -14,7 +14,6 @@ namespace CalamityMod.Projectiles.Summon
public class LuxorsGiftSummon : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
private int dust = 3;
public NPC targeted;
public int attackTime = 0;
public override void SetStaticDefaults()
@@ -57,7 +56,7 @@ namespace CalamityMod.Projectiles.Summon
{
bool sparkly = Main.rand.NextBool(3);
Vector2 dustVel = -(Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.5f) * Main.rand.NextFloat(0.8f, 1.3f);
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(8, 8), sparkly ? 278 : ModContent.DustType<LightDust>(), dustVel * Main.rand.NextFloat(0.5f, 1.2f));
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(8, 8), sparkly ? DustID.FireworksRGB : ModContent.DustType<LightDust>(), dustVel * Main.rand.NextFloat(0.5f, 1.2f));
dust.noGravity = !sparkly;
dust.scale = Main.rand.NextFloat(0.45f, 0.6f) * (sparkly ? 1.6f : 1);
dust.color = Color.Lime;
@@ -49,7 +49,6 @@ namespace CalamityMod.Projectiles.Typeless
public bool inTiles = false;
public float respawnMult = 0;
int postHitTimer = 0;
public Color bColor = Color.White;
public SlotId digSoundSlot;
public int digFXCooldown = 0;
+3 -3
View File
@@ -23,12 +23,12 @@ namespace CalamityMod.Projectiles.Typeless
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public Player Owner => Main.player[Projectile.owner];
public static Asset<Texture2D> GlowTexture;
public static Asset<Texture2D> SpiritGlow;
public ref float SubmergedTimer => ref Projectile.ai[0];
public ref float DustCounter => ref Projectile.ai[1];
public override void Load() => GlowTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
public override void Load() => SpiritGlow = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
public override void SetStaticDefaults()
{
@@ -289,7 +289,7 @@ namespace CalamityMod.Projectiles.Typeless
if (Projectile.timeLeft < 180)
{
Main.spriteBatch.EnterShaderRegion(BlendState.Additive);
Texture2D glow = GlowTexture.Value;
Texture2D glow = SpiritGlow.Value;
Vector2 drawPos = Projectile.Center + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition;
Color glowColor = new Color(255, 170, 204) * (0.2f * MathF.Sin(Projectile.timeLeft * MathHelper.Pi * 0.25f) + Utils.Remap(Projectile.timeLeft, 180f, 0f, 0.2f, 0.6f, true));
Main.EntitySpriteDraw(glow, drawPos, null, glowColor, Projectile.rotation, glow.Size() * 0.5f, new Vector2(0.6f, 0.5f), SpriteEffects.None);
-5
View File
@@ -760,13 +760,8 @@ namespace CalamityMod.Systems
int num34 = -1;
int num45 = -1;
float num47 = 0f;
float num48 = 99999f;
float num49 = 99999f;
int num50 = -1;
int num2 = -1;
Rectangle value = default(Rectangle);
Rectangle value2 = default(Rectangle);
Vector2 origin = default(Vector2);
for (int i = 0; i < currentMax; i++)
{
if (waterfalls[i].type != 1)
+2 -2
View File
@@ -10,11 +10,11 @@ namespace CalamityMod.Tiles.Abyss
{
public class RustyChestTile : ModTile
{
public static int Type;
public static int TileType;
public override void SetStaticDefaults()
{
Type = (ushort)ModContent.TileType<RustyChestTile>();
TileType = (ushort)ModContent.TileType<RustyChestTile>();
this.SetUpChest(ModContent.ItemType<RustyChest>());
AddMapEntry(new Color(113, 90, 71), CalamityUtils.GetItemName<RustyChest>(), CalamityUtils.GetMapChestName);
+1 -1
View File
@@ -90,7 +90,7 @@ namespace CalamityMod.Tiles.Furniture
Tile t = Main.tile[i, j];
Texture2D texture = TextureAssets.Tile[Type].Value;
TECanvasPainting cube = CalamityUtils.FindTileEntity<TECanvasPainting>(i, j, 1, 1);
float baseDimension = 80; // 5 * 16
Vector2 pos = new Vector2(i * 16, j * 16) + CalamityUtils.TileDrawOffset;
if (cube != null && t.TileFrameX == 0)
{
+1 -1
View File
@@ -82,7 +82,7 @@ namespace CalamityMod.Tiles.Furniture
Tile t = Main.tile[i, j];
Texture2D texture = TextureAssets.Tile[Type].Value;
TECanvasPainting cube = CalamityUtils.FindTileEntity<TECanvasPainting>(i, j, 1, 1);
float baseDimension = 80; // 5 * 16
Vector2 pos = new Vector2(i * 16, j * 16) + CalamityUtils.TileDrawOffset;
if (cube != null && t.TileFrameX == 0)
{
+6 -13
View File
@@ -99,10 +99,10 @@ namespace CalamityMod.UI.ResourceSets
if (drawingLife)
{
if (!CalPlayer.chaliceOfTheBloodGod) return;
var bleed = CalPlayer.chaliceBleedoutBuffer;
var hearts = snapshot.AmountOfLifeHearts;
var height = 0;
if (!CalPlayer.chaliceOfTheBloodGod)
return;
var bleed = CalPlayer.chaliceBleedoutBuffer;
var hearts = snapshot.AmountOfLifeHearts;
int drawType = -1; //0 - bars 1- regular heart 2 - fancy heart
Vector2 position = new Vector2(Main.screenWidth - 60, 28);
@@ -110,16 +110,13 @@ namespace CalamityMod.UI.ResourceSets
switch (displaySet.NameKey)
{
case "HorizontalBarsWithText":
height = 12;
drawType = 0;
break;
case "HorizontalBarsWithFullText":
height = 12;
position.Y -= 2;
drawType = 0;
break;
case "HorizontalBars":
height = 12;
position.Y -= 4;
drawType = 0;
break;
@@ -200,9 +197,8 @@ namespace CalamityMod.UI.ResourceSets
// This is where Mana Burn is drawn
else if (Player.statMana < 0)
{
var mana = -Player.statMana;
var stars = snapshot.AmountOfManaStars;
var height = 0;
var mana = -Player.statMana;
var stars = snapshot.AmountOfManaStars;
int drawType = -1; //0 - bars 1- regular heart 2 - fancy heart
Vector2 position = new Vector2(Main.screenWidth - 70, 52);
@@ -210,16 +206,13 @@ namespace CalamityMod.UI.ResourceSets
switch (displaySet.NameKey)
{
case "HorizontalBarsWithText":
height = 12;
drawType = 0;
break;
case "HorizontalBarsWithFullText":
height = 12;
position.Y -= 2;
drawType = 0;
break;
case "HorizontalBars":
height = 12;
position.Y -= 4;
drawType = 0;
break;
+1 -1
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.Waters
if (outputColor == Vector3.One || outputColor == new Vector3(0.25f, 0.25f, 0.25f) || outputColor == new Vector3(0.5f, 0.5f, 0.5f))
return;
if (tile.TileType != RustyChestTile.Type)
if (tile.TileType != RustyChestTile.TileType)
{
CalamityUtils.SunkenSeaWaterLighting(i, j, WaterGlowColor, ref outputColor.X, ref outputColor.Y, ref outputColor.Z);
}
+1 -1
View File
@@ -48,7 +48,7 @@ namespace CalamityMod.Waters
{
Vector3 outputColor = new Vector3(r, g, b);
if (tile.TileType != RustyChestTile.Type)
if (tile.TileType != RustyChestTile.TileType)
{
outputColor = Vector3.Lerp(outputColor, Color.MediumSeaGreen.ToVector3(), 0.18f);
}
+1 -1
View File
@@ -60,7 +60,7 @@ namespace CalamityMod.Waters
GeneralParticleHandler.SpawnParticle(acidFoam);
}
if (tile.TileType != RustyChestTile.Type)
if (tile.TileType != RustyChestTile.TileType)
{
if (Main.dayTime && !Main.raining)
{
+1 -1
View File
@@ -40,7 +40,7 @@ namespace CalamityMod.Waters
{
Vector3 outputColor = new Vector3(r, g, b);
if (tile.TileType != RustyChestTile.Type)
if (tile.TileType != RustyChestTile.TileType)
{
CalamityUtils.SunkenSeaWaterLighting(i, j, WaterGlowColor, ref outputColor.X, ref outputColor.Y, ref outputColor.Z);
}
+1 -1
View File
@@ -33,7 +33,7 @@ namespace CalamityMod.Waters
{
Vector3 outputColor = new Vector3(r, g, b);
if (tile.TileType != RustyChestTile.Type)
if (tile.TileType != RustyChestTile.TileType)
{
CalamityUtils.SunkenSeaWaterLighting(i, j, WaterGlowColor, ref outputColor.X, ref outputColor.Y, ref outputColor.Z);
}
+1 -1
View File
@@ -33,7 +33,7 @@ namespace CalamityMod.Waters
{
Vector3 outputColor = new Vector3(r, g, b);
if (tile.TileType != RustyChestTile.Type)
if (tile.TileType != RustyChestTile.TileType)
{
CalamityUtils.SunkenSeaWaterLighting(i, j, WaterGlowColor, ref outputColor.X, ref outputColor.Y, ref outputColor.Z);
}
+1 -1
View File
@@ -33,7 +33,7 @@ namespace CalamityMod.Waters
{
Vector3 outputColor = new Vector3(r, g, b);
if (tile.TileType != RustyChestTile.Type)
if (tile.TileType != RustyChestTile.TileType)
{
CalamityUtils.SunkenSeaWaterLighting(i, j, WaterGlowColor, ref outputColor.X, ref outputColor.Y, ref outputColor.Z);
}
+1 -1
View File
@@ -241,7 +241,7 @@ namespace CalamityMod.World
}
// Honey chests
Vector2 honeyChestLocation = default;
//Vector2 honeyChestLocation = default;
//for (int l = 0; l < maxAttempts; l++)
//{
// Vector2 newStructureLocation = larvaLocation;
+12 -25
View File
@@ -1547,7 +1547,7 @@ namespace CalamityMod.World
if (caveNoiseMap * caveNoiseMap > caveCreationThreshold)
{
t.HasTile = false;
t.LiquidType = 1;
t.LiquidType = LiquidID.Lava;
}
float horizontalOffsetNoiseWallsinner = CalamityUtils.PerlinNoise2D(X / 80, Y / 80, 5, unchecked(cavePerlinSeedWalls + 1)) * 0.01f;
@@ -1630,7 +1630,7 @@ namespace CalamityMod.World
//get rid of water
if (Main.tile[X, Y].LiquidType == LiquidID.Water)
{
t.LiquidType = 1;
t.LiquidType = LiquidID.Lava;
}
//get rid of obsidian blocks
@@ -1694,12 +1694,9 @@ namespace CalamityMod.World
//Timeless Shores ambiant tiles
if (Main.tile[X, Y].TileType == ModContent.TileType<Dunesand>())
{
int Rand3() => WorldGen.genRand.Next(3);
int MediumShorePileVariants = Rand3();
int Rand6() => WorldGen.genRand.Next(6);
int DriftwoodVariants = Rand6();
int Rand9() => WorldGen.genRand.Next(9);
int ShorePileVariants = Rand9();
int MediumShorePileVariants = WorldGen.genRand.Next(3);
int DriftwoodVariants = WorldGen.genRand.Next(6);
int ShorePileVariants = WorldGen.genRand.Next(9);
//Driftwood Ambiance
if (WorldGen.genRand.NextBool(100))
{
@@ -1749,8 +1746,7 @@ namespace CalamityMod.World
if (Main.tile[X, Y].TileType == ModContent.TileType<Runestone>())
{
int Rand6() => WorldGen.genRand.Next(6);
int DriftwoodVariants = Rand6();
int DriftwoodVariants = WorldGen.genRand.Next(6);
//Driftwood Ambiance
if (WorldGen.genRand.NextBool(80))
{
@@ -1771,8 +1767,7 @@ namespace CalamityMod.World
//gleaming burrows ambient tiles
if (Main.tile[X, Y].TileType == ModContent.TileType<HardenedEutrophicSand>())
{
int Rand6() => WorldGen.genRand.Next(6);
int NavystonePileVariants = Rand6();
int NavystonePileVariants = WorldGen.genRand.Next(6);
//brain coral
if (WorldGen.genRand.NextBool(30))
{
@@ -1883,11 +1878,9 @@ namespace CalamityMod.World
}
if (Main.tile[X, Y].TileType == ModContent.TileType<Navystone>())
{
int Rand3() => WorldGen.genRand.Next(3);
int TableCoralVariants = WorldGen.genRand.Next(3);
int SpeleothemsVariants = WorldGen.genRand.Next(3);
int Rand6() => WorldGen.genRand.Next(6);
int NavystonePileVariants = Rand6();
int NavystonePileVariants = WorldGen.genRand.Next(6);
if (WorldGen.genRand.NextBool(30) && !Main.tile[X + 1, Y].HasTile)
{
@@ -1970,14 +1963,9 @@ namespace CalamityMod.World
}
if (Main.tile[X, Y].TileType == ModContent.TileType<ScarletSeaGrassTile>())
{
int Rand8() => WorldGen.genRand.Next(8);
int BranchCoralVariants = Rand8();
int Rand4() => WorldGen.genRand.Next(4);
int WideScarletSeagrassVariants = Rand4();
int Rand6() => WorldGen.genRand.Next(6);
int DriftwoodVariants = Rand6();
int BranchCoralVariants = WorldGen.genRand.Next(8);
int WideScarletSeagrassVariants = WorldGen.genRand.Next(4);
int DriftwoodVariants = WorldGen.genRand.Next(6);
//BranchCoralsOnSand
if (WorldGen.genRand.NextBool(25))
@@ -2078,8 +2066,7 @@ namespace CalamityMod.World
}));
}
int Rand6() => WorldGen.genRand.Next(6);
int DriftwoodVariants = Rand6();
int DriftwoodVariants = WorldGen.genRand.Next(6);
//Driftwood Ambiance
if (WorldGen.genRand.NextBool(30))
{