diff --git a/Backgrounds/SunkenSeaBurrowsBG.cs b/Backgrounds/SunkenSeaBurrowsBG.cs
index e096f3fdfd..d464073728 100644
--- a/Backgrounds/SunkenSeaBurrowsBG.cs
+++ b/Backgrounds/SunkenSeaBurrowsBG.cs
@@ -3,26 +3,52 @@ using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
+using ReLogic.Content;
+using Terraria.ID;
namespace CalamityMod.Backgrounds
{
- internal static class SunkenSeaBurrowsBG
+ public class SunkenSeaBurrowsBG : ModSystem
{
- public static void Load()
+ public override void Load()
{
if (Main.dedServ)
{
return;
}
- On_Main.DrawBackgroundBlackFill += DrawBurrowsBG;
+ On_Main.DrawBackgroundBlackFill += On_Main_DrawBackgroundBlackFill;
}
- public static float Transparency;
+ ///
+ /// This code runs because there is a system in vanilla that causes backgrounds to not draw if lighting is too low.
+ /// That would be fine, the problem arises because sloped tiles still block light the same way normal tiles do.
+ /// Which means that the background will occasionally be blocked by slopes as though said slopes were full squares.
+ /// This is a hacky method that sets the light level of every sloped tile *AT LEAST* high enough to render the background while in the Burrows.
+ ///
+ /// ENNWAY's note:
+ /// if this doesn't get fixed in 1.4.5 i am throwing really big rocks at unsuspecting re logic employees
+ ///
+ public override void PreUpdatePlayers()
+ {
+ if (!Main.dedServ && Main.LocalPlayer.InModBiome())
+ {
+ for (int i = 0; i < Main.screenWidth / 16; i++)
+ {
+ for (int j = 0; j < Main.screenWidth / 16; j++)
+ {
+ Point pos = (Main.screenPosition / 16).ToPoint() + new Point(i, j);
- public static float TransitionSpeed => 0.02f;
+ if (Main.tile[pos.X, pos.Y].Slope != SlopeType.Solid)
+ {
+ Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.1f);
+ }
+ }
+ }
+ }
+ }
- private static void DrawBurrowsBG(On_Main.orig_DrawBackgroundBlackFill orig, Main self)
+ private void On_Main_DrawBackgroundBlackFill(On_Main.orig_DrawBackgroundBlackFill orig, Main self)
{
if (Main.gameMenu || Main.screenPosition.Y + Main.screenHeight < ((int)Main.worldSurface) * 16f)
{
@@ -33,6 +59,15 @@ namespace CalamityMod.Backgrounds
orig(self);
+ DrawBurrowsBG();
+ }
+
+ public static float Transparency;
+
+ public static float TransitionSpeed => 0.02f;
+
+ private static void DrawBurrowsBG()
+ {
if (Main.LocalPlayer.InModBiome(ModContent.GetInstance()))
{
Transparency += TransitionSpeed;
@@ -75,54 +110,54 @@ namespace CalamityMod.Backgrounds
switch (Layers)
{
case 0:
- {
- zero.Y += 800f;
- break;
- }
+ {
+ zero.Y += 800f;
+ break;
+ }
case 1:
- {
- zero.Y += 200f;
- break;
- }
+ {
+ zero.Y += 200f;
+ break;
+ }
case 2:
- {
- zero.Y += 450f;
- break;
- }
+ {
+ zero.Y += 450f;
+ break;
+ }
case 3:
- {
- zero.Y += 45f;
- break;
- }
+ {
+ zero.Y += 45f;
+ break;
+ }
case 4:
- {
- zero.Y += 45f;
- break;
- }
+ {
+ zero.Y += 45f;
+ break;
+ }
}
vector2 *= Scale;
zero.Y -= num;
float LoopWidth = Scale * rectangle.Width;
- //float LoopHeight = Scale * rectangle.Height;
+ float LoopHeight = Scale * rectangle.Height;
int LoopX = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / LoopWidth);
- //int LoopY = (int)((vector.Y * vector3.Y - vector2.Y + zero.Y - (Main.screenWidth >> 1)) / LoopWidth);
+ int LoopY = (int)((vector.Y * vector3.Y - vector2.Y + zero.Y - (Main.screenWidth >> 1)) / LoopWidth);
- //for (int i = LoopY - 2; i < LoopY + 4 + (int)(Main.screenWidth / LoopHeight); i++)
- //{
+ for (int i = LoopY - 2; i < LoopY + 4 + (int)(Main.screenWidth / LoopHeight); i++)
+ {
for (int j = LoopX - 2; j < LoopX + 4 + (int)(Main.screenWidth / LoopWidth); j++)
{
Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), ((Main.LocalPlayer.Center.Y / 16f) - 90) * 16f) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero;
var frame = rectangle;
- var color = Color.MediumTurquoise * Transparency;
+ var color = Color.White * Transparency;
Main.spriteBatch.Draw(BGTexture, drawPosition, frame, color, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f);
}
- //}
+ }
}
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Buffs/Potions/ShadowBuff.cs b/Buffs/Potions/ShadowBuff.cs
index 72ee6c1d8b..0244cb7c0b 100644
--- a/Buffs/Potions/ShadowBuff.cs
+++ b/Buffs/Potions/ShadowBuff.cs
@@ -15,7 +15,7 @@ namespace CalamityMod.Buffs.Potions
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().shadow = true;
- if (player.yoraiz0rEye < 2 && CalamityConfig.Instance.StealthInvisibility)
+ if (player.yoraiz0rEye < 2 && CalamityClientConfig.Instance.StealthInvisibility)
player.yoraiz0rEye = 2;
}
}
diff --git a/Buffs/StatBuffs/BossEffects.cs b/Buffs/StatBuffs/BossEffects.cs
index 46022d0e27..e32088eaa6 100644
--- a/Buffs/StatBuffs/BossEffects.cs
+++ b/Buffs/StatBuffs/BossEffects.cs
@@ -24,7 +24,7 @@ namespace CalamityMod.Buffs.StatBuffs
public override void ModifyBuffText(ref string buffName, ref string tip, ref int rare)
{
- if (CalamityConfig.Instance.BossZen)
+ if (CalamityServerConfig.Instance.BossZen)
tip = tip.Replace(":", ":\n" + this.GetLocalizedValue("ZenDescription"));
}
}
diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs
index e24b2f9184..7efa1af247 100644
--- a/CalPlayer/CalamityPlayer.cs
+++ b/CalPlayer/CalamityPlayer.cs
@@ -87,7 +87,7 @@ namespace CalamityMod.CalPlayer
public const float projectileMeleeWeaponMeleeSpeedMultiplier = 0f;
public int evilSmasherBoost = 0;
public int burningSeaBurnOut = 0;
- public int hellbornBoost = 0;
+ public int hellbornShots = 0;
public int searedPanCounter = 0;
public int searedPanTimer = 0;
public int potionTimer = 0;
@@ -2287,13 +2287,13 @@ namespace CalamityMod.CalPlayer
#region Screen Position Movements
public override void ModifyScreenPosition()
{
- if (CalamityConfig.Instance.ScreenshakePower == 0)
+ if (CalamityClientConfig.Instance.ScreenshakePower == 0)
return;
if (GeneralScreenShakePower > 0f)
{
- Main.screenPosition += Main.rand.NextVector2Circular(GeneralScreenShakePower * CalamityConfig.Instance.ScreenshakePower, GeneralScreenShakePower * CalamityConfig.Instance.ScreenshakePower);
- GeneralScreenShakePower = MathHelper.Clamp(GeneralScreenShakePower - 0.185f, 0f, 20f * CalamityConfig.Instance.ScreenshakePower);
+ Main.screenPosition += Main.rand.NextVector2Circular(GeneralScreenShakePower * CalamityClientConfig.Instance.ScreenshakePower, GeneralScreenShakePower * CalamityClientConfig.Instance.ScreenshakePower);
+ GeneralScreenShakePower = MathHelper.Clamp(GeneralScreenShakePower - 0.185f, 0f, 20f * CalamityClientConfig.Instance.ScreenshakePower);
}
}
#endregion
@@ -2705,7 +2705,7 @@ namespace CalamityMod.CalPlayer
ascendantTrail = false;
evilSmasherBoost = 0;
burningSeaBurnOut = 0;
- hellbornBoost = 0;
+ hellbornShots = 0;
searedPanCounter = 0;
searedPanTimer = 0;
potionTimer = 0;
@@ -2729,7 +2729,7 @@ namespace CalamityMod.CalPlayer
// Respawn the player faster
// 3 seconds normally and configurable while a boss is alive between 15 and 60 seconds
- int respawnTimerSet = areThereAnyDamnBosses ? (CalamityConfig.Instance.PlayerRespawnTime_BossAlive * 60) : 180;
+ int respawnTimerSet = areThereAnyDamnBosses ? (CalamityServerConfig.Instance.PlayerRespawnTime_BossAlive * 60) : 180;
if (Player.respawnTimer > respawnTimerSet)
Player.respawnTimer = respawnTimerSet;
}
@@ -3401,14 +3401,14 @@ namespace CalamityMod.CalPlayer
public override void UpdateEquips()
{
// TODO -- why is boss health bar code in Player.UpdateEquips and not a ModSystem
- CalamityConfig.Instance.BossHealthBarExtraInfo = shouldDrawSmallText;
+ CalamityClientConfig.Instance.BossHealthBarExtraInfo = shouldDrawSmallText;
// Putting this in GlobalItem will run multiple times for each slot, which this system already does, creating a slew of problems.
VanillaArmorChangeManager.ApplyPotentialEffectsTo(Player);
// If the config is enabled, vastly increase the player's base tile and wall placement speeds
// This stacks with the Brick Layer and Portable Cement Mixer
- if (CalamityConfig.Instance.FasterTilePlacement)
+ if (CalamityServerConfig.Instance.FasterTilePlacement)
{
Player.tileSpeed += 0.5f;
Player.wallSpeed += 0.5f;
@@ -3671,7 +3671,7 @@ namespace CalamityMod.CalPlayer
#region PostUpdateBuffs
public override void PostUpdateBuffs()
{
- if (Player.whoAmI == Main.myPlayer && CalamityConfig.Instance.VanillaCooldownDisplay)
+ if (Player.whoAmI == Main.myPlayer && CalamityClientConfig.Instance.VanillaCooldownDisplay)
{
if (Player.whoAmI == Main.myPlayer && Player.potionDelay != 0)
potionSick = true;
@@ -4942,11 +4942,11 @@ namespace CalamityMod.CalPlayer
// Enabling the config while a player is loaded will show the timer immediately.
// But it won't start running until you save and quit and re-enter a world.
- if (CalamityConfig.Instance.SpeedrunTimer)
+ if (CalamityClientConfig.Instance.SpeedrunTimer)
CalamityMod.SpeedrunTimer.Restart();
- bool showWikiMessage = CalamityConfig.Instance.WikiStatusMessage;
- bool showVCMMMessage = CalamityConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable;
+ bool showWikiMessage = CalamityClientConfig.Instance.WikiStatusMessage;
+ bool showVCMMMessage = CalamityClientConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable;
bool showStartupMessages = showWikiMessage || showVCMMMessage;
// Set a random delay between 12 and 20 seconds. When this delay hits zero, startup messages display
diff --git a/CalPlayer/CalamityPlayerDashEffects.cs b/CalPlayer/CalamityPlayerDashEffects.cs
index 5c45619b75..1d37410d2e 100644
--- a/CalPlayer/CalamityPlayerDashEffects.cs
+++ b/CalPlayer/CalamityPlayerDashEffects.cs
@@ -21,7 +21,7 @@ namespace CalamityMod.CalPlayer
{
get
{
- return (String.IsNullOrEmpty(dashID) && Player.dashType == 0 && CalamityConfig.Instance.DefaultDashEnabled) ? DefaultDash.ID : dashID; //gives default dash ONLY if no custom or vanilla dash.
+ return (String.IsNullOrEmpty(dashID) && Player.dashType == 0 && CalamityServerConfig.Instance.DefaultDashEnabled) ? DefaultDash.ID : dashID; //gives default dash ONLY if no custom or vanilla dash.
}
set => dashID = value;
}
diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs
index fa9ae52cdf..88af62a2d8 100644
--- a/CalPlayer/CalamityPlayerDrawEffects.cs
+++ b/CalPlayer/CalamityPlayerDrawEffects.cs
@@ -110,7 +110,7 @@ namespace CalamityMod.CalPlayer
}
// TODO -- rogue stealth visuals are an utter catastrophe and should be fully destroyed on next stealth rework
- if (calamityPlayer.rogueStealth > 0f && calamityPlayer.rogueStealthMax > 0f && Player.townNPCs < 3f && CalamityConfig.Instance.StealthInvisibility)
+ if (calamityPlayer.rogueStealth > 0f && calamityPlayer.rogueStealthMax > 0f && Player.townNPCs < 3f && CalamityClientConfig.Instance.StealthInvisibility)
{
// A translucent orchid color, the rogue class color
float colorValue = calamityPlayer.rogueStealth / calamityPlayer.rogueStealthMax * 0.9f; //0 to 0.9
diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs
index 47e8360482..0b99c5dae4 100644
--- a/CalPlayer/CalamityPlayerHitHurt.cs
+++ b/CalPlayer/CalamityPlayerHitHurt.cs
@@ -2137,11 +2137,12 @@ namespace CalamityMod.CalPlayer
// If the player was just hit by something capable of dealing defense damage, then apply defense damage.
// Bloodflare Core makes every hit deal defense damage (to enable its function).
- // Defense damage is not applied if the player has iframes.
- // This function will be ignored if the player is wearing Chalice, as it handles its defense damage elsewhere.
+ // Defense damage is not applied if the player has iframes or godmode.
bool hitCanApplyDefenseDamage = nextHitDealsDefenseDamage || bloodflareCore;
+ bool defenseDamageShouldApply = hitCanApplyDefenseDamage && !hasIFrames && !Player.creativeGodMode;
- if (hitCanApplyDefenseDamage && !hasIFrames && !Player.creativeGodMode)
+ // 15AUG2024: Ozzatron: External flag which completely disables defense damage. This overrides Bloodflare Core.
+ if (defenseDamageShouldApply && !CalamityMod.ExternalFlag_DisableDefenseDamage)
{
double halfDefense = Player.statDefense / 2.0;
int netMitigation = hurtInfo.SourceDamage - hurtInfo.Damage;
@@ -2293,8 +2294,6 @@ namespace CalamityMod.CalPlayer
if (evilSmasherBoost > 0)
evilSmasherBoost -= 1;
- hellbornBoost = 0;
-
if (trinketOfChi)
chiBuffTimer = 0;
diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs
index abb82966da..e8f325b942 100644
--- a/CalPlayer/CalamityPlayerMiscEffects.cs
+++ b/CalPlayer/CalamityPlayerMiscEffects.cs
@@ -86,7 +86,7 @@ namespace CalamityMod.CalPlayer
// Give the player a 24% jump speed boost while wings are equipped, otherwise grant 4% more jump speed so that players can jump 7 tiles high
if (Player.wingsLogic > 0)
Player.jumpSpeedBoost += 1.2f;
- else if (CalamityConfig.Instance.FasterJumpSpeed)
+ else if (CalamityServerConfig.Instance.FasterJumpSpeed)
Player.jumpSpeedBoost += 0.2f;
// Decrease the counter on Fearmonger set turbo regeneration
@@ -1001,7 +1001,7 @@ namespace CalamityMod.CalPlayer
{
Player.buffImmune[ModContent.BuffType()] = true;
}
- if (CalamityConfig.Instance.ChilledWaterRework)
+ if (CalamityServerConfig.Instance.ChilledWaterRework)
{
if (Main.expertMode && Player.ZoneSnow && Player.wet && !Player.lavaWet && !Player.honeyWet)
{
@@ -1124,7 +1124,7 @@ namespace CalamityMod.CalPlayer
Player.noFallDmg = true;
}
- if (CalamityConfig.Instance.FasterFallHotkey)
+ if (CalamityClientConfig.Instance.FasterFallHotkey)
{
// Allow the player to double their gravity (but NOT max fall speed!) by holding the down button while in midair.
bool holdingDown = Player.controlDown && !Player.controlJump;
@@ -1154,7 +1154,7 @@ namespace CalamityMod.CalPlayer
}
// Increase Rope climb velocities, if enabled
- if (CalamityConfig.Instance.FasterRopeClimbSpeed)
+ if (CalamityServerConfig.Instance.FasterRopeClimbSpeed)
{
if (Player.pulley)
{
@@ -1553,8 +1553,6 @@ namespace CalamityMod.CalPlayer
burnOutDust.noGravity = true;
}
}
- if (hellbornBoost > 0)
- hellbornBoost--;
if (persecutedEnchantSummonTimer < 1800)
persecutedEnchantSummonTimer++;
else
@@ -2854,7 +2852,7 @@ namespace CalamityMod.CalPlayer
// 50% movement speed bonus so that you don't feel like a snail in the early game
// Disabled while Overhaul is enabled, because Overhaul does very similar things to make movement more snappy
- if (CalamityMod.Instance.overhaul is null && CalamityConfig.Instance.FasterBaseSpeed)
+ if (CalamityMod.Instance.overhaul is null && CalamityServerConfig.Instance.FasterBaseSpeed)
Player.moveSpeed += BalancingConstants.DefaultMoveSpeedBoost;
// Reduce how slow Chilled makes the player, because it's cancerous right now
@@ -4301,13 +4299,13 @@ namespace CalamityMod.CalPlayer
{
if (startMessageDisplayDelay == 0)
{
- if (CalamityConfig.Instance.WikiStatusMessage)
+ if (CalamityClientConfig.Instance.WikiStatusMessage)
{
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus1");
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus2");
}
- if (CalamityConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable)
+ if (CalamityClientConfig.Instance.VCMMStatusMessage && !CalamityMod.Instance.VCMMAvailable)
{
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.VCMMStatus");
}
diff --git a/CalamityConditions.cs b/CalamityConditions.cs
index 8cce78968e..0bba1b6e52 100644
--- a/CalamityConditions.cs
+++ b/CalamityConditions.cs
@@ -19,7 +19,7 @@ namespace CalamityMod
// Config based conditions
//
- public static readonly Condition PotionSellingConfig = Create("PotionConfig", () => CalamityConfig.Instance.PotionSelling);
+ public static readonly Condition PotionSellingConfig = Create("PotionConfig", () => CalamityServerConfig.Instance.PotionSelling);
//
// Player conditions
diff --git a/CalamityConfig.cs b/CalamityConfig.cs
index 9633a4a45b..6d19bd6f3e 100644
--- a/CalamityConfig.cs
+++ b/CalamityConfig.cs
@@ -5,25 +5,22 @@ using CalamityMod.UI.DraedonsArsenal;
using CalamityMod.UI.Rippers;
using CalamityMod.UI.SulphurousWaterMeter;
using Terraria;
+using Terraria.Localization;
using Terraria.ModLoader.Config;
namespace CalamityMod
{
[BackgroundColor(49, 32, 36, 216)]
- public class CalamityConfig : ModConfig
+ public class CalamityClientConfig : ModConfig
{
- public static CalamityConfig Instance;
+ public static CalamityClientConfig Instance;
- // TODO -- Not all Calamity config settings should be considered client side.
- // There are many configs which are server side and should stay that way.
public override ConfigScope Mode => ConfigScope.ClientSide;
- public override bool AcceptClientChanges(ModConfig pendingConfig, int whoAmI, ref string message) => true;
// Clamps values that would cause ugly problems if loaded directly without sanitization.
[OnDeserialized]
internal void ClampValues(StreamingContext context)
{
- BossHealthBoost = Utils.Clamp(BossHealthBoost, MinBossHealthBoost, MaxBossHealthBoost);
RipperMeterShake = Utils.Clamp(RipperMeterShake, MinMeterShake, MaxMeterShake);
ParticleLimit = (int)Utils.Clamp(ParticleLimit, MinParticleLimit, MaxParticleLimit);
}
@@ -48,10 +45,6 @@ namespace CalamityMod
[DefaultValue(5000)]
public int ParticleLimit { get; set; }
- [BackgroundColor(192, 54, 64, 192)]
- [DefaultValue(false)]
- public bool BossesStopWeather { get; set; }
-
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 10f)]
@@ -106,6 +99,33 @@ namespace CalamityMod
[DefaultValue(true)]
public bool StealthMeter { get; set; }
+ [BackgroundColor(192, 54, 64, 192)]
+ [DefaultValue(true)]
+ public bool ChargeMeter { get; set; }
+
+ private const float MinMeterShake = 0f;
+ private const float MaxMeterShake = 4f;
+
+ [BackgroundColor(192, 54, 64, 192)]
+ [SliderColor(224, 165, 56, 128)]
+ [Range(MinMeterShake, MaxMeterShake)]
+ [Increment(1f)]
+ [DrawTicks]
+ [DefaultValue(2f)]
+ public float RipperMeterShake { get; set; }
+
+ [BackgroundColor(192, 54, 64, 192)]
+ [DefaultValue(false)]
+ public bool SpeedrunTimer { get; set; }
+
+ [BackgroundColor(192, 54, 64, 192)]
+ [DefaultValue(true)]
+ public bool FlightBar { get; set; }
+ #endregion
+
+ #region Meter Positions
+ [Header("MeterPositions")]
+
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
@@ -130,10 +150,6 @@ namespace CalamityMod
[DefaultValue(SulphurousWaterMeterUI.DefaultPosY)]
public float SulphuricWaterMeterPosY { get; set; }
- [BackgroundColor(192, 54, 64, 192)]
- [DefaultValue(true)]
- public bool ChargeMeter { get; set; }
-
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
@@ -147,8 +163,28 @@ namespace CalamityMod
public float ChargeMeterPosY { get; set; }
[BackgroundColor(192, 54, 64, 192)]
- [DefaultValue(false)]
- public bool SpeedrunTimer { get; set; }
+ [SliderColor(224, 165, 56, 128)]
+ [Range(0f, 100f)]
+ [DefaultValue(RipperUI.DefaultRagePosX)]
+ public float RageMeterPosX { get; set; }
+
+ [BackgroundColor(192, 54, 64, 192)]
+ [SliderColor(224, 165, 56, 128)]
+ [Range(0f, 100f)]
+ [DefaultValue(RipperUI.DefaultRagePosY)]
+ public float RageMeterPosY { get; set; }
+
+ [BackgroundColor(192, 54, 64, 192)]
+ [SliderColor(224, 165, 56, 128)]
+ [Range(0f, 100f)]
+ [DefaultValue(RipperUI.DefaultAdrenPosX)]
+ public float AdrenalineMeterPosX { get; set; }
+
+ [BackgroundColor(192, 54, 64, 192)]
+ [SliderColor(224, 165, 56, 128)]
+ [Range(0f, 100f)]
+ [DefaultValue(RipperUI.DefaultAdrenPosY)]
+ public float AdrenalineMeterPosY { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
@@ -162,10 +198,6 @@ namespace CalamityMod
[DefaultValue(SpeedrunTimerUI.DefaultTimerPosY)]
public float SpeedrunTimerPosY { get; set; }
- [BackgroundColor(192, 54, 64, 192)]
- [DefaultValue(true)]
- public bool FlightBar { get; set; }
-
[BackgroundColor(192, 54, 64, 192)]
[SliderColor(224, 165, 56, 128)]
[Range(0f, 100f)]
@@ -206,7 +238,37 @@ namespace CalamityMod
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool FasterFallHotkey { get; set; }
+ #endregion
+ }
+ [BackgroundColor(49, 32, 36, 216)]
+ public class CalamityServerConfig : ModConfig
+ {
+ public static CalamityServerConfig Instance;
+ public override ConfigScope Mode => ConfigScope.ServerSide;
+ public override bool AcceptClientChanges(ModConfig pendingConfig, int whoAmI, ref NetworkText message)
+ {
+ if (whoAmI == 0)
+ {
+ return true;
+ }
+ if (whoAmI != 0)
+ {
+ message = CalamityUtils.GetText("Configs.CalamityServerConfig.Denied").ToNetworkText();
+ return false;
+ }
+ return false;
+ }
+
+ // Clamps values that would cause ugly problems if loaded directly without sanitization.
+ [OnDeserialized]
+ internal void ClampValues(StreamingContext context)
+ {
+ BossHealthBoost = Utils.Clamp(BossHealthBoost, MinBossHealthBoost, MaxBossHealthBoost);
+ }
+
+ [Header("Gameplay")]
+ #region General Gameplay Changes
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool RemoveReforgeRNG { get; set; }
@@ -257,6 +319,10 @@ namespace CalamityMod
[DrawTicks]
[DefaultValue(MinBossHealthBoost)]
public float BossHealthBoost { get; set; }
+
+ [BackgroundColor(192, 54, 64, 192)]
+ [DefaultValue(false)]
+ public bool BossesStopWeather { get; set; }
#endregion
#region Default Player Stat Boosts
@@ -306,44 +372,5 @@ namespace CalamityMod
[DefaultValue(false)]
public bool ForceTownSafety { get; set; }
#endregion
-
- #region Revengeance Mode Changes
- [Header("Revengeance")]
-
- private const float MinMeterShake = 0f;
- private const float MaxMeterShake = 4f;
-
- [BackgroundColor(192, 54, 64, 192)]
- [SliderColor(224, 165, 56, 128)]
- [Range(MinMeterShake, MaxMeterShake)]
- [Increment(1f)]
- [DrawTicks]
- [DefaultValue(2f)]
- public float RipperMeterShake { get; set; }
-
- [BackgroundColor(192, 54, 64, 192)]
- [SliderColor(224, 165, 56, 128)]
- [Range(0f, 100f)]
- [DefaultValue(RipperUI.DefaultRagePosX)]
- public float RageMeterPosX { get; set; }
-
- [BackgroundColor(192, 54, 64, 192)]
- [SliderColor(224, 165, 56, 128)]
- [Range(0f, 100f)]
- [DefaultValue(RipperUI.DefaultRagePosY)]
- public float RageMeterPosY { get; set; }
-
- [BackgroundColor(192, 54, 64, 192)]
- [SliderColor(224, 165, 56, 128)]
- [Range(0f, 100f)]
- [DefaultValue(RipperUI.DefaultAdrenPosX)]
- public float AdrenalineMeterPosX { get; set; }
-
- [BackgroundColor(192, 54, 64, 192)]
- [SliderColor(224, 165, 56, 128)]
- [Range(0f, 100f)]
- [DefaultValue(RipperUI.DefaultAdrenPosY)]
- public float AdrenalineMeterPosY { get; set; }
- #endregion
}
}
diff --git a/CalamityLists.cs b/CalamityLists.cs
index 1ddd34c96c..1d288f932b 100644
--- a/CalamityLists.cs
+++ b/CalamityLists.cs
@@ -817,6 +817,7 @@ namespace CalamityMod
ProjectileType(),
ProjectileType(),
ProjectileType(),
+ ProjectileType(),
ProjectileType(),
ProjectileType(),
ProjectileType(),
@@ -1994,6 +1995,7 @@ namespace CalamityMod
ProjectileType(),
ProjectileType(),
ProjectileType(),
+ ProjectileType(),
ProjectileType(),
ProjectileType(),
ProjectileType(),
diff --git a/CalamityMod.cs b/CalamityMod.cs
index 6c83147131..fcf4eb3679 100644
--- a/CalamityMod.cs
+++ b/CalamityMod.cs
@@ -135,6 +135,11 @@ namespace CalamityMod
// This can be edited by other mods using reflection to prevent compatibility issues
public static bool ExternalFlag_DisableNonRevBossAI = false;
+ // External flag to disable Defense Damage
+ // This can be edited by other mods using reflection if desired
+ // Note that this flag trumps Bloodflare Core and will stop that accessory from working properly.
+ public static bool ExternalFlag_DisableDefenseDamage = false;
+
internal static CalamityMod Instance;
// TODO -- Mod references should be contained in a ModSystem (example name "ModLoadedChecker")
@@ -447,6 +452,7 @@ namespace CalamityMod
NPCStats.Unload();
CalamityGlobalItem.UnloadTweaks();
CalamityGlobalProjectile.UnloadTweaks();
+ FramedGlowMask.UnloadTexCache();
PopupGUIManager.UnloadGUIs();
InvasionProgressUIManager.UnloadGUIs();
@@ -498,7 +504,7 @@ namespace CalamityMod
#endregion Render Target Management
#region Force ModConfig save (Reflection)
- internal static void SaveConfig(CalamityConfig cfg)
+ internal static void SaveConfig(CalamityClientConfig cfg)
{
// There is no current way to manually save a mod configuration file in tModLoader.
// The method which saves mod config files is private in ConfigManager, so reflection is used to invoke it.
diff --git a/CalamityNetcode.cs b/CalamityNetcode.cs
index 5271a6b1d2..60e108c2c2 100644
--- a/CalamityNetcode.cs
+++ b/CalamityNetcode.cs
@@ -325,6 +325,47 @@ namespace CalamityMod
MusicEventSystem.ReceiveSyncResponse(reader);
break;
+ //
+ // Bandit refund syncs
+ //
+ case CalamityModMessageType.SomeoneGotScammedByTinkerer:
+ int scammedOne = reader.ReadByte();
+ int stolen = reader.Read7BitEncodedInt();
+
+ CalamityWorld.MoneyStolenByBandit += stolen;
+ CalamityWorld.Reforges++;
+
+ // Broadcast back for tragic event
+ // WorldSync DO sync the MoneyStolenByBandit and Refores variable, But spamming SyncWorld is not a ideal action
+ if (Main.dedServ)
+ {
+ ModPacket packet = CalamityMod.Instance.GetPacket();
+ packet.Write((byte)CalamityModMessageType.SomeoneGotScammedByTinkerer);
+ packet.Write((byte)scammedOne);
+ packet.Write7BitEncodedInt(stolen);
+ packet.Send(ignoreClient: scammedOne);
+ }
+
+ break;
+
+ case CalamityModMessageType.WantToRefundReforges:
+ int requester = reader.ReadByte();
+
+ // Only Server should handle this action!
+ if (!Main.dedServ)
+ break;
+
+ int banditIdx = NPC.FindFirstNPC(ModContent.NPCType());
+ if (banditIdx == -1)
+ break;
+
+ NPC bandit = Main.npc[banditIdx];
+ if (bandit == null || !bandit.active)
+ break;
+
+ THIEF.DoRefund(bandit);
+ break;
+
//
// Default case: with no idea how long the packet is, we can't safely read data.
// Throw an exception now instead of allowing the network stream to corrupt.
@@ -450,6 +491,10 @@ namespace CalamityMod
// Music events
MusicEventSyncRequest,
- MusicEventSyncResponse
+ MusicEventSyncResponse,
+
+ // Bandit Reforge Refund
+ SomeoneGotScammedByTinkerer,
+ WantToRefundReforges
}
}
diff --git a/Cooldowns/ChaosState.cs b/Cooldowns/ChaosState.cs
index 4759b9b42c..a049141f3d 100644
--- a/Cooldowns/ChaosState.cs
+++ b/Cooldowns/ChaosState.cs
@@ -8,7 +8,7 @@ namespace CalamityMod.Cooldowns
{
public static new string ID => "ChaosState";
- public override bool ShouldDisplay => CalamityConfig.Instance.VanillaCooldownDisplay && instance.player.chaosState;
+ public override bool ShouldDisplay => CalamityClientConfig.Instance.VanillaCooldownDisplay && instance.player.chaosState;
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
public override string Texture => "CalamityMod/Cooldowns/ChaosState" + skinTexture;
public override Color OutlineColor => outlineColor;
diff --git a/Cooldowns/PotionSickness.cs b/Cooldowns/PotionSickness.cs
index 2127706e4e..d7a8708f80 100644
--- a/Cooldowns/PotionSickness.cs
+++ b/Cooldowns/PotionSickness.cs
@@ -7,7 +7,7 @@ namespace CalamityMod.Cooldowns
public class PotionSickness : CooldownHandler
{
public static new string ID => "PotionSickness";
- public override bool ShouldDisplay => CalamityConfig.Instance.VanillaCooldownDisplay && instance.player.potionDelay > 0;
+ public override bool ShouldDisplay => CalamityClientConfig.Instance.VanillaCooldownDisplay && instance.player.potionDelay > 0;
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
public override string Texture => "CalamityMod/Cooldowns/PotionSickness";
public override Color OutlineColor => new Color(255, 142, 165);
diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs
index ef06ec1d55..6dabd88c65 100644
--- a/ILEditing/BalancingILChanges.cs
+++ b/ILEditing/BalancingILChanges.cs
@@ -114,7 +114,7 @@ namespace CalamityMod.ILEditing
cursor.Remove();
// Increase by 10% if the higher jump speed is enabled.
- cursor.EmitDelegate>(() => CalamityConfig.Instance.HigherJumpHeight ? BalancingConstants.ConfigBoostedBaseJumpHeight : VanillaBaseJumpHeight);
+ cursor.EmitDelegate>(() => CalamityServerConfig.Instance.HigherJumpHeight ? BalancingConstants.ConfigBoostedBaseJumpHeight : VanillaBaseJumpHeight);
}
#endregion
diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs
index c17cf1a6e1..b7a22291dc 100644
--- a/ILEditing/MechanicILChanges.cs
+++ b/ILEditing/MechanicILChanges.cs
@@ -345,7 +345,7 @@ namespace CalamityMod.ILEditing
{
// A cached delegate is used here instead of direct reflection for performance reasons
// since UpdateTime is called every frame.
- if (Main.dayTime || CalamityConfig.Instance.TownNPCsSpawnAtNight)
+ if (Main.dayTime || CalamityServerConfig.Instance.TownNPCsSpawnAtNight)
VanillaSpawnTownNPCs();
});
@@ -361,7 +361,7 @@ namespace CalamityMod.ILEditing
private static void AlterTownNPCSpawnRate(Terraria.On_Main.orig_UpdateTime_SpawnTownNPCs orig)
{
double oldWorldRate = Main.desiredWorldTilesUpdateRate;
- Main.desiredWorldTilesUpdateRate *= CalamityConfig.Instance.TownNPCSpawnRateMultiplier;
+ Main.desiredWorldTilesUpdateRate *= CalamityServerConfig.Instance.TownNPCSpawnRateMultiplier;
orig();
Main.desiredWorldTilesUpdateRate = oldWorldRate;
}
diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs
index 9503ec198d..64b2461c1e 100644
--- a/ILEditing/VanillaStupidityFixingILChanges.cs
+++ b/ILEditing/VanillaStupidityFixingILChanges.cs
@@ -123,7 +123,7 @@ namespace CalamityMod.ILEditing
#region Prevention of Slime Rain Spawns When Near Bosses
private static void PreventBossSlimeRainSpawns(Terraria.On_NPC.orig_SlimeRainSpawns orig, int plr)
{
- if (!Main.player[plr].Calamity().isNearbyBoss && CalamityConfig.Instance.BossZen)
+ if (!Main.player[plr].Calamity().isNearbyBoss && CalamityServerConfig.Instance.BossZen)
orig(plr);
}
#endregion Prevention of Slime Rain Spawns When Near Bosses
diff --git a/ILEditing/WorldgenILChanges.cs b/ILEditing/WorldgenILChanges.cs
index 345bb65fac..2347363be0 100644
--- a/ILEditing/WorldgenILChanges.cs
+++ b/ILEditing/WorldgenILChanges.cs
@@ -68,7 +68,7 @@ namespace CalamityMod.ILEditing
#region Removal of Hardmode Ore Generation from Evil Altars
private static void PreventSmashAltarCode(Terraria.On_WorldGen.orig_SmashAltar orig, int i, int j)
{
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework)
return;
orig(i, j);
diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs
index 1f5f64a2b6..9acc1ea443 100644
--- a/Items/CalamityGlobalItem.cs
+++ b/Items/CalamityGlobalItem.cs
@@ -1802,7 +1802,7 @@ namespace CalamityMod.Items
return keepPrefix ? prefix : 0;
}
- if (!CalamityConfig.Instance.RemoveReforgeRNG || Main.gameMenu || storedPrefix == -1)
+ if (!CalamityServerConfig.Instance.RemoveReforgeRNG || Main.gameMenu || storedPrefix == -1)
return -1;
// Pick a prefix using the new system.
@@ -1821,11 +1821,21 @@ namespace CalamityMod.Items
ItemLoader.ReforgePrice(item, ref value, ref p.discountAvailable);
// Steal 20% of that money.
- CalamityWorld.MoneyStolenByBandit += value / 5;
+ int stolen = value / 5;
+ CalamityWorld.MoneyStolenByBandit += stolen;
// Increment the reforge counter to allow the Bandit to refund
// Also triggers Tinkerer dialogue that hints to the player that money is being stolen
CalamityWorld.Reforges++;
+
+ if (Main.netMode == NetmodeID.MultiplayerClient)
+ {
+ ModPacket packet = CalamityMod.Instance.GetPacket();
+ packet.Write((byte)CalamityModMessageType.SomeoneGotScammedByTinkerer);
+ packet.Write((byte)p.whoAmI);
+ packet.Write7BitEncodedInt(stolen);
+ packet.Send();
+ }
}
}
#endregion
diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs
index 241996369d..72dc5d99c3 100644
--- a/Items/CalamityGlobalItemTooltip.cs
+++ b/Items/CalamityGlobalItemTooltip.cs
@@ -488,7 +488,7 @@ namespace CalamityMod.Items
EditTooltipByNum(1, (line) => line.Text += ", including Mighty Wind");
// If Early Hardmode Rework is enabled: Remind users that ores will NOT spawn when an altar is smashed.
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && (item.type == ItemID.Pwnhammer || item.type == ItemID.Hammush))
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && (item.type == ItemID.Pwnhammer || item.type == ItemID.Hammush))
EditTooltipByNum(0, (line) => line.Text += "\nDemon Altars now drop Souls of Night instead of generating ores when destroyed" +
"\nHardmode ores now generate after defeating Mechanical Bosses for the first time");
diff --git a/Items/Placeables/CelestialRemains.cs b/Items/Placeables/CelestialRemains.cs
index c597021aad..91bbe5daf6 100644
--- a/Items/Placeables/CelestialRemains.cs
+++ b/Items/Placeables/CelestialRemains.cs
@@ -132,22 +132,22 @@ namespace CalamityMod.Items.Placeables
}
else if (val < 85.03f)
{
- resultType = CalamityConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.CobaltOre : ItemID.MythrilOre) : ItemID.MythrilOre;
+ resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.CobaltOre : ItemID.MythrilOre) : ItemID.MythrilOre;
resultStack = Main.rand.Next(1, 17);
}
else if (val < 87.03f)
{
- resultType = CalamityConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : ItemID.OrichalcumOre) : ItemID.OrichalcumOre;
+ resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : ItemID.OrichalcumOre) : ItemID.OrichalcumOre;
resultStack = Main.rand.Next(1, 17);
}
else if (val < 88.78f)
{
- resultType = CalamityConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.CobaltOre : !twoMechsDowned ? ItemID.MythrilOre : ItemID.AdamantiteOre) : ItemID.AdamantiteOre;
+ resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.CobaltOre : !twoMechsDowned ? ItemID.MythrilOre : ItemID.AdamantiteOre) : ItemID.AdamantiteOre;
resultStack = Main.rand.Next(1, 17);
}
else if (val < 89.53f)
{
- resultType = CalamityConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre) : ItemID.TitaniumOre;
+ resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre) : ItemID.TitaniumOre;
resultStack = Main.rand.Next(1, 17);
}
else if (DownedBossSystem.downedAstrumDeus)
diff --git a/Items/Placeables/NovaeSlag.cs b/Items/Placeables/NovaeSlag.cs
index 78983dd0f0..14b3cdb79f 100644
--- a/Items/Placeables/NovaeSlag.cs
+++ b/Items/Placeables/NovaeSlag.cs
@@ -120,22 +120,22 @@ namespace CalamityMod.Items.Placeables
}
else if (val < 83.03f)
{
- resultType = CalamityConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.CobaltOre : ItemID.MythrilOre) : ItemID.MythrilOre;
+ resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.CobaltOre : ItemID.MythrilOre) : ItemID.MythrilOre;
resultStack = Main.rand.Next(1, 17);
}
else if (val < 85.03f)
{
- resultType = CalamityConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : ItemID.OrichalcumOre) : ItemID.OrichalcumOre;
+ resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : ItemID.OrichalcumOre) : ItemID.OrichalcumOre;
resultStack = Main.rand.Next(1, 17);
}
else if (val < 86.78f)
{
- resultType = CalamityConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.CobaltOre : !twoMechsDowned ? ItemID.MythrilOre : ItemID.AdamantiteOre) : ItemID.AdamantiteOre;
+ resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.CobaltOre : !twoMechsDowned ? ItemID.MythrilOre : ItemID.AdamantiteOre) : ItemID.AdamantiteOre;
resultStack = Main.rand.Next(1, 17);
}
else if (val < 88.53f)
{
- resultType = CalamityConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre) : ItemID.TitaniumOre;
+ resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? (!NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre) : ItemID.TitaniumOre;
resultStack = Main.rand.Next(1, 17);
}
else if (DownedBossSystem.downedAstrumDeus)
diff --git a/Items/SummonItems/Invasion/CausticTear.cs b/Items/SummonItems/Invasion/CausticTear.cs
index 9e11870259..75deb7d52b 100644
--- a/Items/SummonItems/Invasion/CausticTear.cs
+++ b/Items/SummonItems/Invasion/CausticTear.cs
@@ -38,8 +38,13 @@ namespace CalamityMod.Items.SummonItems.Invasion
public override bool? UseItem(Player player)
{
- AcidRainEvent.TryStartEvent(forceRain: true);
- //CalamityNetcode.SyncWorld(); //TryStartEvent(forceRain: true) already sync the world data
+ // Only Single Player client and Server should call this!
+ if (Main.netMode != NetmodeID.MultiplayerClient)
+ {
+ AcidRainEvent.TryStartEvent(forceRain: true);
+ // TryStartEvent already syncs the world data
+ }
+
return true;
}
diff --git a/Items/SummonItems/Invasion/MartianDistressRemote.cs b/Items/SummonItems/Invasion/MartianDistressRemote.cs
index 0ec3bb1df7..880a169570 100644
--- a/Items/SummonItems/Invasion/MartianDistressRemote.cs
+++ b/Items/SummonItems/Invasion/MartianDistressRemote.cs
@@ -1,4 +1,5 @@
-using Microsoft.Xna.Framework;
+using System.Linq;
+using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
@@ -35,20 +36,38 @@ namespace CalamityMod.Items.SummonItems.Invasion
itemGroup = ContentSamples.CreativeHelper.ItemGroup.EventItem;
}
- public override bool CanUseItem(Player player) => Main.invasionType == InvasionID.None;
+ public override bool CanUseItem(Player player)
+ {
+ // Do not start new invasion when it's already on going
+ if (Main.invasionType != InvasionID.None)
+ return false;
+
+ // This is the requirement for StartInvasion for some reason
+ // If this part is missing MartianRemote will show DD2 invasion GUI without any enemy spawn on MP
+ if (!Main.player.Any(p => p.active && p.ConsumedLifeCrystals >= 5))
+ return false;
+
+ return true;
+ }
public override bool? UseItem(Player player)
{
- if (Main.netMode != NetmodeID.MultiplayerClient)
+ // Single Player case
+ if (Main.netMode == NetmodeID.SinglePlayer)
{
Main.invasionDelay = 0;
Main.StartInvasion(InvasionID.MartianMadness);
+ return true;
}
- else
+
+ // MP case: only owner should send Spawn Message to Master
+ if (player.whoAmI == Main.myPlayer)
{
//-7.0 is hardcoded id for MartianMadness Event
NetMessage.SendData(MessageID.SpawnBossUseLicenseStartEvent, number: player.whoAmI, number2: -7.0f);
+ return true;
}
+
return true;
}
diff --git a/Items/Tools/ClimateChange/AridArtifact.cs b/Items/Tools/ClimateChange/AridArtifact.cs
index 759f43754d..3e83a71ec6 100644
--- a/Items/Tools/ClimateChange/AridArtifact.cs
+++ b/Items/Tools/ClimateChange/AridArtifact.cs
@@ -1,8 +1,13 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
+
+using SandstormEvent = Terraria.GameContent.Events.Sandstorm;
+
namespace CalamityMod.Items.Tools.ClimateChange
{
+
+
public class AridArtifact : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Tools";
@@ -27,13 +32,17 @@ namespace CalamityMod.Items.Tools.ClimateChange
return DownedBossSystem.downedDesertScourge || Main.hardMode;
}
- // this is extremely ugly and has to be fully qualified because we add an item called Sandstorm
public override bool? UseItem(Player player)
{
- if (Terraria.GameContent.Events.Sandstorm.Happening)
+ // Only SinglePlayer and Server need to sync those parameters
+ if (Main.netMode == NetmodeID.MultiplayerClient)
+ return true;
+
+ if (SandstormEvent.Happening)
CalamityUtils.StopSandstorm();
else
CalamityUtils.StartSandstorm();
+
return true;
}
diff --git a/Items/Tools/ClimateChange/Cosmolight.cs b/Items/Tools/ClimateChange/Cosmolight.cs
index 8f63502ece..b380c4f384 100644
--- a/Items/Tools/ClimateChange/Cosmolight.cs
+++ b/Items/Tools/ClimateChange/Cosmolight.cs
@@ -32,17 +32,14 @@ namespace CalamityMod.Items.Tools.ClimateChange
itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.ToolsOther;
}
- public override bool CanUseItem(Player player)
+ public override bool CanUseItem(Player player) => !CalamityPlayer.areThereAnyDamnBosses;
+
+ public override bool? UseItem(Player player)
{
//Only SinglePlayer or DedServ should change time to prevent unwanted race condition
if (Main.netMode == NetmodeID.MultiplayerClient)
return true;
- if (CalamityPlayer.areThereAnyDamnBosses)
- return false;
-
-
-
// Early Morning -> Noon
if (Main.dayTime && Main.time < NoonCutoff)
Main.SkipToTime(NoonCutoff, true);
diff --git a/Items/Tools/ClimateChange/TorrentialTear.cs b/Items/Tools/ClimateChange/TorrentialTear.cs
index fca095ca74..ed9eb51f0b 100644
--- a/Items/Tools/ClimateChange/TorrentialTear.cs
+++ b/Items/Tools/ClimateChange/TorrentialTear.cs
@@ -31,16 +31,19 @@ namespace CalamityMod.Items.Tools.ClimateChange
public override bool? UseItem(Player player)
{
+ // Only SinglePlayer and Server need to sync those parameters
+ if (Main.netMode == NetmodeID.MultiplayerClient)
+ return true;
+
if (!Main.raining)
{
- CalamityUtils.StartRain(true);
+ CalamityUtils.StartRain(torrentialTear: true, worldSync: true);
}
else
{
- Main.raining = false;
+ CalamityUtils.StopRain(clearWeather: false, worldSync: true);
}
- CalamityNetcode.SyncWorld();
return true;
}
diff --git a/Items/Weapons/Magic/VitriolicViper.cs b/Items/Weapons/Magic/VitriolicViper.cs
index 91a8a0774a..dffd45ed93 100644
--- a/Items/Weapons/Magic/VitriolicViper.cs
+++ b/Items/Weapons/Magic/VitriolicViper.cs
@@ -11,43 +11,37 @@ namespace CalamityMod.Items.Weapons.Magic
public class VitriolicViper : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
- public override void SetStaticDefaults()
- {
- Item.staff[Item.type] = true;
- }
public override void SetDefaults()
{
Item.width = 60;
Item.height = 62;
- Item.damage = 93;
+ Item.damage = 2893;
Item.DamageType = DamageClass.Magic;
- Item.mana = 15;
- Item.useAnimation = Item.useTime = 16;
+ Item.mana = 45;
+ Item.useTime = Item.useAnimation = 16;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
- Item.knockBack = 4f;
- Item.UseSound = SoundID.Item46;
+ Item.noUseGraphic = true;
+ Item.channel = true;
+ Item.knockBack = 6.5f;
+ Item.UseSound = null;
Item.autoReuse = true;
- Item.shoot = ModContent.ProjectileType();
+ Item.shoot = ModContent.ProjectileType();
Item.shootSpeed = 20f;
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
Item.rare = ModContent.RarityType();
}
+ public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
+
+ public override void HoldItem(Player player) => player.Calamity().mouseRotationListener = true;
+
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
- for (int i = -4; i <= 4; i += 1)
- {
- Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i));
- Projectile.NewProjectile(source, position.X, position.Y, perturbedSpeed.X * 1.65f, perturbedSpeed.Y * 1.65f, type, (int)(damage * 0.7f), knockback * 0.7f, player.whoAmI, 0f, 0f);
- }
- for (int j = -2; j <= 2; j += 1)
- {
- Vector2 perturbedSpeed2 = velocity.RotatedBy(MathHelper.ToRadians(j));
- Projectile.NewProjectile(source, position.X, position.Y, perturbedSpeed2.X, perturbedSpeed2.Y, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0f);
- }
+ Vector2 spawnPosition = player.RotatedRelativePoint(player.MountedCenter, true);
+ Projectile.NewProjectileDirect(source, spawnPosition, player.Calamity().mouseWorld - spawnPosition, type, damage, knockback, player.whoAmI);
return false;
}
}
diff --git a/Items/Weapons/Melee/InsidiousImpaler.cs b/Items/Weapons/Melee/InsidiousImpaler.cs
index 89be9745df..f127aea5dd 100644
--- a/Items/Weapons/Melee/InsidiousImpaler.cs
+++ b/Items/Weapons/Melee/InsidiousImpaler.cs
@@ -1,7 +1,9 @@
using CalamityMod.Projectiles.Melee;
using CalamityMod.Projectiles.Melee.Spears;
using CalamityMod.Rarities;
+using Microsoft.Xna.Framework;
using Terraria;
+using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -15,21 +17,26 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.width = 66;
Item.height = 70;
- Item.damage = 198;
+ Item.damage = 417;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.noMelee = true;
Item.useTurn = true;
Item.noUseGraphic = true;
- Item.useAnimation = Item.useTime = 20;
+ Item.useAnimation = Item.useTime = 13;
Item.useStyle = ItemUseStyleID.Swing;
- Item.knockBack = 8f;
+ Item.knockBack = 12f;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType();
- Item.shootSpeed = 15f;
+ Item.shootSpeed = 18f;
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
Item.rare = ModContent.RarityType();
}
+ public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
+ {
+ Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0, 0, 0);
+ return false;
+ }
}
}
diff --git a/Items/Weapons/Ranged/Hellborn.cs b/Items/Weapons/Ranged/Hellborn.cs
index 6ec064fecf..42ce03ed24 100644
--- a/Items/Weapons/Ranged/Hellborn.cs
+++ b/Items/Weapons/Ranged/Hellborn.cs
@@ -1,4 +1,6 @@
-using Microsoft.Xna.Framework;
+using System.Linq;
+using CalamityMod.Projectiles.Ranged;
+using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
@@ -10,121 +12,62 @@ namespace CalamityMod.Items.Weapons.Ranged
public class Hellborn : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Ranged";
- public const float ExplosionDamageMultiplier = 3f;
+ public override void SetStaticDefaults() => ItemID.Sets.IsRangedSpecialistWeapon[Type] = true;
public override void SetDefaults()
{
Item.width = 62;
Item.height = 34;
- Item.damage = 20;
+ Item.damage = 475;
Item.DamageType = DamageClass.Ranged;
- Item.useAnimation = Item.useTime = 20;
+ Item.useAnimation = Item.useTime = 35;
Item.useStyle = ItemUseStyleID.Shoot;
- Item.knockBack = 2f;
+ Item.knockBack = 2.5f;
+
Item.value = CalamityGlobalItem.RarityPinkBuyPrice;
Item.rare = ItemRarityID.Pink;
- Item.UseSound = SoundID.Item11;
+
+ Item.noMelee = true;
+ Item.UseSound = null;
+ Item.noUseGraphic = true;
+ Item.channel = true;
Item.autoReuse = true;
- Item.shoot = ProjectileID.PurificationPowder;
+
+ Item.shoot = ModContent.ProjectileType();
Item.shootSpeed = 12f;
- Item.useAmmo = AmmoID.Bullet;
- Item.Calamity().canFirePointBlankShots = true;
}
-
- public override float UseTimeMultiplier(Player player) => 1f - 0.5f * (player.Calamity().hellbornBoost * (1f / 600f));
-
- public override void ModifyWeaponDamage(Player player, ref StatModifier damage) => damage *= 1f + player.Calamity().hellbornBoost * (1f / 600f);
-
- public override void ModifyWeaponKnockback(Player player, ref StatModifier knockback) => knockback *= 1f + (player.Calamity().hellbornBoost * (1f / 600f));
-
- public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
-
- //Custom melee hitbox
- public override bool? CanHitNPC(Player player, NPC target)
+ public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
+ public override bool AltFunctionUse(Player player) => true;
+ public override void HoldItem(Player player)
{
- Rectangle targetHitbox = target.Hitbox;
+ if (player.whoAmI != Main.myPlayer)
+ return;
- float collisionPoint = 0f;
- float gunLength = 66f;
- float gunHeight = 15;
+ // Right-click channeling
+ player.Calamity().rightClickListener = true;
- return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), player.MountedCenter, player.MountedCenter + ((player.itemRotation + (player.direction < 0 ? MathHelper.Pi : 0f)).ToRotationVector2() * gunLength), gunHeight, ref collisionPoint) ? null : false;
+ if (player.Calamity().mouseRight && CanUseItem(player) && !Main.mapFullscreen && !Main.blockMouse)
+ {
+ // Only one out at a time
+ if (Main.projectile.Any(n => n.active && n.type == Item.shoot && n.owner == player.whoAmI))
+ return;
+
+ var source = player.GetSource_ItemUse(player.ActiveItem());
+ Projectile holdout = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, Item.shoot, player.ActiveItem().damage, 0f, player.whoAmI, 0, 0, 5);
+ holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero);
+ }
}
-
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
- for (int index = 0; index < 3; index++)
- {
- float SpeedX = velocity.X + Main.rand.Next(-15, 16) * 0.05f;
- float SpeedY = velocity.Y + Main.rand.Next(-15, 16) * 0.05f;
+ // Only one out at a time
+ if (Main.projectile.Any(n => n.active && n.type == Item.shoot && n.owner == player.whoAmI))
+ return false;
- if (type == ProjectileID.Bullet)
- {
- int bullet = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ProjectileID.ExplosiveBullet, damage, knockback, player.whoAmI);
- Main.projectile[bullet].usesLocalNPCImmunity = true;
- Main.projectile[bullet].localNPCHitCooldown = 10;
- }
- else
- Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI);
- }
+ Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, 0);
+
+ // We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out.
+ holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero);
return false;
}
-
- public override void ModifyHitNPC(Player player, NPC target, ref NPC.HitModifiers modifiers)
- {
- player.Calamity().hellbornBoost = 600;
- modifiers.SourceDamage *= ExplosionDamageMultiplier;
- int touchDamage = player.CalcIntDamage(Item.damage);
- player.ApplyDamageToNPC(target, touchDamage, 0f, 0, false);
- float firstDustScale = 3.4f;
- float secondDustScale = 1.6f;
- float thirdDustScale = 4f;
- Vector2 dustRotation = (target.rotation - MathHelper.PiOver2).ToRotationVector2();
- Vector2 dustVelocity = dustRotation * target.velocity.Length();
- SoundEngine.PlaySound(SoundID.Item14, target.Center);
- for (int i = 0; i < 80; i++)
- {
- int contactDust = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, DustID.InfernoFork, 0f, 0f, 200, default, firstDustScale);
- Dust dust = Main.dust[contactDust];
- dust.position = target.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * target.width / 2f;
- dust.noGravity = true;
- dust.velocity.Y -= 6f;
- dust.velocity *= 3f;
- dust.velocity += dustVelocity * Main.rand.NextFloat();
- contactDust = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, DustID.InfernoFork, 0f, 0f, 100, default, secondDustScale);
- dust.position = target.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * target.width / 2f;
- dust.velocity.Y -= 6f;
- dust.velocity *= 2f;
- dust.noGravity = true;
- dust.fadeIn = 1f;
- dust.color = Color.Crimson * 0.5f;
- dust.velocity += dustVelocity * Main.rand.NextFloat();
- }
- for (int j = 0; j < 40; j++)
- {
- int contactDust2 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, DustID.InfernoFork, 0f, 0f, 0, default, thirdDustScale);
- Dust dust = Main.dust[contactDust2];
- dust.position = target.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(target.velocity.ToRotation()) * target.width / 3f;
- dust.noGravity = true;
- dust.velocity.Y -= 6f;
- dust.velocity *= 0.5f;
- dust.velocity += dustVelocity * (0.6f + 0.6f * Main.rand.NextFloat());
- }
- }
-
- public override void ModifyHitPvp(Player player, Player target, ref Player.HurtModifiers modifiers)
- {
- modifiers.SourceDamage *= 10;
- }
-
- public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
- {
- target.AddBuff(BuffID.OnFire3, 360);
- }
-
- public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
- {
- target.AddBuff(BuffID.OnFire3, 360);
- }
}
}
diff --git a/Items/Weapons/Ranged/SepticSkewer.cs b/Items/Weapons/Ranged/SepticSkewer.cs
index 739a0214ff..ba2b78ccf3 100644
--- a/Items/Weapons/Ranged/SepticSkewer.cs
+++ b/Items/Weapons/Ranged/SepticSkewer.cs
@@ -1,40 +1,105 @@
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
+using Terraria.DataStructures;
+using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
+using System;
+using CalamityMod.Items.Weapons.Melee;
+using CalamityMod.Projectiles.Boss;
+using Terraria.Audio;
namespace CalamityMod.Items.Weapons.Ranged
{
public class SepticSkewer : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Ranged";
-
+ public bool pulled = false;
public override void SetStaticDefaults()
{
ItemID.Sets.IsRangedSpecialistWeapon[Item.type] = true;
+ ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true;
}
public override void SetDefaults()
{
Item.width = 46;
Item.height = 24;
- Item.damage = 272;
+ Item.damage = 1272;
Item.DamageType = DamageClass.Ranged;
- Item.useTime = 12;
- Item.useAnimation = 12;
+ Item.useTime = 30;
+ Item.useAnimation = 30;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
- Item.knockBack = 7.5f;
- Item.UseSound = SoundID.Item10;
+ Item.knockBack = 3.5f;
+ Item.UseSound = null;
Item.autoReuse = true;
- Item.shootSpeed = 20f;
+ Item.shootSpeed = 18f;
Item.shoot = ModContent.ProjectileType();
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
Item.rare = ModContent.RarityType();
- Item.Calamity().canFirePointBlankShots = true;
+ }
+ public override bool AltFunctionUse(Player player) => true;
+ public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
+ {
+ pulled = false;
+ if (player.altFunctionUse == 2)
+ {
+ for (int x = 0; x < Main.maxProjectiles; x++)
+ {
+ Projectile projectile = Main.projectile[x];
+ if (projectile.active && projectile.type == type)
+ {
+ projectile.ai[2] = 5;
+ pulled = true;
+ }
+ }
+
+ SoundStyle fire = new("CalamityMod/Sounds/Item/GunShotMid");
+ SoundEngine.PlaySound(fire with { Volume = 0.7f, Pitch = Main.rand.NextFloat(0.7f, 0.8f) }, position);
+ if (pulled)
+ player.Calamity().GeneralScreenShakePower = 5.5f;
+ }
+ else
+ {
+ SoundStyle fire = new("CalamityMod/Sounds/Item/GunShotHeavy");
+ SoundEngine.PlaySound(fire with { Volume = 0.45f, Pitch = Main.rand.NextFloat(0.4f, 0.65f) }, position);
+ Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0, 0, 0);
+ }
+ return false;
+ }
+ public override void UseStyle(Player player, Rectangle heldItemFrame)
+ {
+ player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
+ float itemRotation = player.compositeFrontArm.rotation + MathHelper.PiOver2 * player.gravDir;
+
+ float pullback = 7f;
+
+ float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax;
+ float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2;
+ if (animProgress < 0.4f)
+ pullback -= (2.75f) * (float)Math.Pow((0.6f - animProgress) / 0.6f, 2);
+
+ Vector2 itemPosition = player.MountedCenter + itemRotation.ToRotationVector2() * pullback;
+ Vector2 itemSize = new Vector2(46, 24);
+ Vector2 itemOrigin = new Vector2(-24, 4);
+
+ CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin);
+
+ base.UseStyle(player, heldItemFrame);
}
- public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
+ public override void UseItemFrame(Player player)
+ {
+ player.ChangeDir(Math.Sign((player.Calamity().mouseWorld - player.Center).X));
+
+ float animProgress = 0.5f - player.itemTime / (float)player.itemTimeMax;
+ float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2;
+ if (animProgress < 0.4f)
+ rotation += (player.altFunctionUse == 2 ? -0.25f : 0) * (float)Math.Pow((0.6f - animProgress) / 0.6f, 2) * player.direction;
+
+ player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation);
+ }
}
}
diff --git a/Items/Weapons/Rogue/TheOldReaper.cs b/Items/Weapons/Rogue/TheOldReaper.cs
index dffec98bbb..6cb3f9b9b3 100644
--- a/Items/Weapons/Rogue/TheOldReaper.cs
+++ b/Items/Weapons/Rogue/TheOldReaper.cs
@@ -15,17 +15,16 @@ namespace CalamityMod.Items.Weapons.Rogue
{
Item.width = 106;
Item.height = 104;
- Item.damage = 180;
+ Item.damage = 1280;
Item.noMelee = true;
Item.noUseGraphic = true;
- Item.useAnimation = 20;
- Item.useTime = 20;
+ Item.useAnimation = 53;
+ Item.useTime = 53;
Item.useStyle = ItemUseStyleID.Swing;
Item.knockBack = 4f;
- Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType();
- Item.shootSpeed = 16f;
+ Item.shootSpeed = 10f;
Item.DamageType = RogueDamageClass.Instance;
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
@@ -39,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Rogue
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
{
int spread = 15;
- for (int i = 0; i < 3; i++)
+ for (int i = 0; i < 1; i++)
{
Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-2, 3), velocity.Y + Main.rand.Next(-2, 3)).RotatedBy(MathHelper.ToRadians(spread));
int proj = Projectile.NewProjectile(source, position, perturbedspeed, type, (int)(damage * 0.45), knockback, player.whoAmI);
diff --git a/Items/Weapons/Rogue/ToxicantTwister.cs b/Items/Weapons/Rogue/ToxicantTwister.cs
index d5dce99ce1..5eb869a46b 100644
--- a/Items/Weapons/Rogue/ToxicantTwister.cs
+++ b/Items/Weapons/Rogue/ToxicantTwister.cs
@@ -14,34 +14,50 @@ namespace CalamityMod.Items.Weapons.Rogue
{
Item.width = 42;
Item.height = 46;
- Item.damage = 333;
+ Item.damage = 150;
Item.noMelee = true;
Item.noUseGraphic = true;
- Item.useAnimation = Item.useTime = 20;
+ Item.useAnimation = Item.useTime = 50;
Item.useStyle = ItemUseStyleID.Swing;
- Item.knockBack = 5f;
+ Item.knockBack = 4f;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
- Item.shoot = ModContent.ProjectileType();
- Item.shootSpeed = 18f;
+ Item.shoot = ModContent.ProjectileType();
+ Item.shootSpeed = 20f;
Item.DamageType = RogueDamageClass.Instance;
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
Item.rare = ModContent.RarityType();
}
- public override float StealthDamageMultiplier => 1.3f;
+ public override float StealthDamageMultiplier => 0.4f;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
+ float angle1 = MathHelper.ToRadians(20f);
if (player.Calamity().StealthStrikeAvailable())
{
- int boomer = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
- if (boomer.WithinBounds(Main.maxProjectiles))
- Main.projectile[boomer].Calamity().stealthStrike = true;
- return false;
+ for (int i = 0; i < 2; i++)
+ {
+ int proj = Projectile.NewProjectile(source, position, velocity.RotatedBy(angle1), type, damage, knockback, player.whoAmI, 0, 0, 0 + i);
+ int proj2 = Projectile.NewProjectile(source, position, velocity.RotatedBy(angle1 * 0.5f) * 0.9f, type, damage, knockback, player.whoAmI, 0, 0, 2 + i);
+ angle1 *= -1;
+ if (proj.WithinBounds(Main.maxProjectiles))
+ Main.projectile[proj].Calamity().stealthStrike = true;
+ if (proj2.WithinBounds(Main.maxProjectiles))
+ Main.projectile[proj2].Calamity().stealthStrike = true;
+ }
}
- return true;
+ else
+ {
+ for (int i = 0; i < 2; i++)
+ {
+ int proj = Projectile.NewProjectile(source, position, velocity.RotatedBy(angle1), type, damage, knockback, player.whoAmI, 0, 0, 0 + i);
+ int proj2 = Projectile.NewProjectile(source, position, velocity.RotatedBy(angle1 * 0.5f) * 0.9f, type, damage, knockback, player.whoAmI, 0, 0, 2 + i);
+ angle1 *= -1;
+ }
+ }
+ return false;
}
}
}
diff --git a/Localization/en-US/Mods.CalamityMod.Configs.hjson b/Localization/en-US/Mods.CalamityMod.Configs.hjson
index 821007ffbc..cdc61f30bc 100644
--- a/Localization/en-US/Mods.CalamityMod.Configs.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Configs.hjson
@@ -1,14 +1,12 @@
-CalamityConfig: {
- DisplayName: Main Config
+CalamityClientConfig: {
+ DisplayName: Client Config
Headers: {
- ExpertMaster: Expert and Master Mode Changes
Gameplay: General Gameplay Changes
Graphics: Graphics Changes
- Revengeance: Revengeance Mode Changes
UI: UI Changes
- BaseBoosts: Base Stat Boosts
- MusicEvents: Music Events
+ MeterPositions: Meter Positions
+ MusicEvents: In-Game Music Events
}
AdrenalineMeterPosX: {
@@ -38,15 +36,6 @@ CalamityConfig: {
'''
}
- BossesStopWeather: {
- Label: "[i:CalamityMod/TorrentialTear] Bosses Stop Weather"
- Tooltip:
- '''
- When enabled, many late game bosses will stop all rain and related weather when spawned.
- Enable if you have performance issues during late game boss fights.
- '''
- }
-
BossHealthBarExtraInfo: {
Label: "[i:CalamityMod/EncryptedSchematicPlanetoid] Boss Health Bar Extra Info"
Tooltip:
@@ -56,35 +45,6 @@ CalamityConfig: {
'''
}
- BossHealthBoost: {
- Label: "[i:LifeCrystal] Boss Health Boost Percentage"
- Tooltip:
- '''
- Globally boosts the health of all bosses by the specified percentage.
- This stacks with multiplayer boss health boosts.
- Does not affect bosses that are already spawned.
- '''
- }
-
- DefaultDashEnabled: {
- Label: "[i:Tabi] Default Dash"
- Tooltip:
- '''
- Gives the player a very weak dash by default that requires no equipment or items to use.
- This dash will be replaced by any other available dash, including those from other mods.
- '''
- }
-
- BossZen: {
- Label: "[i:CalamityMod/ZenPotion] Bosses Drastically Reduce Spawn Rates"
- Tooltip:
- '''
- All living bosses will drastically reduce the spawn rates of regular enemies.
- This also prevents Slime Rain from occurring while a boss is alive.
- Calamity is balanced around this setting being enabled.
- '''
- }
-
ChargeMeter: {
Label: "[i:CalamityMod/DraedonPowerCell] Display Charge Meter"
Tooltip:
@@ -112,11 +72,6 @@ CalamityConfig: {
'''
}
- ChilledWaterRework: {
- Label: "[i:ArcticDivingGear] Chilled Water Rework"
- Tooltip: When enabled, water in the Snow and Ice biomes will rapidly drain the player's breath instead of inflicting Chilled.
- }
-
CooldownDisplay: {
Label: "[i:CalamityMod/NebulousCore] Cooldown Rack Display Mode"
Tooltip:
@@ -136,37 +91,6 @@ CalamityConfig: {
Tooltip: Plays Calamity Mod OST - "Scourge of the Universe (Eulogy for the Ego)", after the Devourer of Gods has been defeated.
}
- EarlyHardmodeProgressionRework: {
- Label: "[i:Pwnhammer] Early Hardmode Progression Rework"
- Tooltip:
- '''
- Demon Altars no longer spawn ores and crimson/corruption blocks when broken.
- Wall of Flesh spawns Cobalt and Palladium ore on first kill.
- The first mech boss you fight has 20% (10% in Expert and Master) less HP and damage and spawns Mythril and Orichalcum ore on first kill.
- The second mech boss you fight has 10% (5% in Expert and Master) less HP and damage and spawns Adamantite and Titanium ore on first kill.
- The third mech boss spawns Hallowed Ore on first kill.
- '''
- }
-
- FasterBaseSpeed: {
- Label: "[i:HermesBoots] Increase Base Movement Speed"
- Tooltip:
- '''
- Increases the player's base movement speed substantially by always giving them +50% movement speed.
- This setting does nothing if the mod Terraria Overhaul is loaded.
- Calamity is balanced around this setting being enabled.
- '''
- }
-
- FasterRopeClimbSpeed: {
- Label: "[i:Rope] Increase Rope Climb Speed"
- Tooltip:
- '''
- Increases the player's rope climb speed substantially by increasing acceleration and deceleration while on a rope.
- Calamity is balanced around this setting being enabled.
- '''
- }
-
FasterFallHotkey: {
Label: "[i:CalamityMod/BallAndChain] Enable Fast Falling"
Tooltip:
@@ -177,24 +101,6 @@ CalamityConfig: {
'''
}
- FasterJumpSpeed: {
- Label: "[i:FrogLeg] Increase Base Jump Speed"
- Tooltip:
- '''
- Slightly increases the player's base jump speed.
- Calamity is balanced around this setting being enabled.
- '''
- }
-
- FasterTilePlacement: {
- Label: "[i:ArchitectGizmoPack] Increase Base Building Speed"
- Tooltip:
- '''
- Substantially increases how rapidly the player can place tiles and walls.
- This config stacks with the Brick Layer, Portable Cement Mixer and other accessories.
- '''
- }
-
FlightBar: {
Label: "[i:CalamityMod/DrewsWings] Display Flight Bar"
Tooltip:
@@ -223,24 +129,6 @@ CalamityConfig: {
'''
}
- ForceTownSafety: {
- Label: "[i:Sunflower] Force Town Safety"
- Tooltip:
- '''
- Counteracts Expert and Master Mode allowing enemies to spawn near towns by vastly decreasing spawn rates.
- This can have unintended side effects such as making critters difficult to find.
- '''
- }
-
- HigherJumpHeight: {
- Label: "[i:ShinyRedBalloon] Increase Base Jump Height"
- Tooltip:
- '''
- Increases the player's base jump height by 10% so that they can jump 7 tiles.
- Calamity is balanced around this setting being enabled.
- '''
- }
-
Interlude1: {
Label: "[i:CalamityModMusic/Interlude1MusicBox] Interlude 1"
Tooltip: Plays Calamity Mod OST - "Silence before the storms", after Calamitas Clone has been defeated.
@@ -265,24 +153,6 @@ CalamityConfig: {
'''
}
- MusicModReminderMessage: {
- Label: "[i:MusicBoxMartians] Music Mod Reminder Message"
- Tooltip:
- '''
- Enable or disable the status message which reminds users to install the Calamity Music Mod.
- This message plays on world entry.
- '''
- }
-
- NerfExpertDebuffs: {
- Label: "[i:AnkhCharm] Remove Increased Debuff Duration"
- Tooltip:
- '''
- Disables Expert Mode doubling (and Master Mode tripling) the duration of debuffs on the player.
- Calamity is balanced around this setting being enabled.
- '''
- }
-
NewVanillaTextures: {
Label: "[i:Paintbrush] New Vanilla Textures"
Tooltip:
@@ -321,20 +191,6 @@ CalamityConfig: {
'''
}
- RemoveLavaDropsFromLavaSlimes: {
- Label: "[i:LavaWaders] Remove Lava Drops From Lava Slimes"
- Tooltip: When enabled, Lava Slimes will be replaced with a new Lava Slime that no longer drops lava.
- }
-
- RemoveReforgeRNG: {
- Label: "[i:TinHammer] Remove Reforge RNG"
- Tooltip:
- '''
- Removes randomness from the Goblin Tinkerer's reforges for both weapons and accessories.
- Disable this if using mods that change reforging on their own to prevent conflicts.
- '''
- }
-
RipperMeterShake: {
Label: "[i:CalamityMod/RedLightningContainer] Rage and Adrenaline Meter Shake"
Tooltip:
@@ -442,6 +298,169 @@ CalamityConfig: {
'''
}
+ VanillaCooldownDisplay: {
+ Label: "[i:HealingPotion] Display Vanilla Cooldowns"
+ Tooltip:
+ '''
+ Adds the vanilla debuffs Potion Sickness and Chaos State to the Cooldown Rack.
+ The debuffs will still appear in the buffs array, but this may help make them more visible.
+ '''
+ }
+
+ VCMMStatusMessage: {
+ Label: "[i:MusicBoxMartians] VCMM Status Message"
+ Tooltip: Enable or disable the status message promoting the Vanilla Calamity Music Mod that plays on world entry.
+ }
+
+ WikiStatusMessage: {
+ Label: "[i:Book] Wiki Status Message"
+ Tooltip: Enable or disable the status message promoting the Official Calamity Wiki that plays on world entry.
+ }
+}
+
+CalamityServerConfig: {
+ DisplayName: Server Config
+ Denied: You have no permission to change this config
+
+ Headers: {
+ ExpertMaster: Expert and Master Mode Changes
+ Gameplay: General Gameplay Changes
+ BaseBoosts: Base Stat Boosts
+ }
+
+ BossesStopWeather: {
+ Label: "[i:CalamityMod/TorrentialTear] Bosses Stop Weather"
+ Tooltip:
+ '''
+ When enabled, many late game bosses will stop all rain and related weather when spawned.
+ Enable if you have performance issues during late game boss fights.
+ '''
+ }
+
+ BossHealthBoost: {
+ Label: "[i:LifeCrystal] Boss Health Boost Percentage"
+ Tooltip:
+ '''
+ Globally boosts the health of all bosses by the specified percentage.
+ This stacks with multiplayer boss health boosts.
+ Does not affect bosses that are already spawned.
+ '''
+ }
+
+ DefaultDashEnabled: {
+ Label: "[i:Tabi] Default Dash"
+ Tooltip:
+ '''
+ Gives the player a very weak dash by default that requires no equipment or items to use.
+ This dash will be replaced by any other available dash, including those from other mods.
+ '''
+ }
+
+ BossZen: {
+ Label: "[i:CalamityMod/ZenPotion] Bosses Drastically Reduce Spawn Rates"
+ Tooltip:
+ '''
+ All living bosses will drastically reduce the spawn rates of regular enemies.
+ This also prevents Slime Rain from occurring while a boss is alive.
+ Calamity is balanced around this setting being enabled.
+ '''
+ }
+
+ ChilledWaterRework: {
+ Label: "[i:ArcticDivingGear] Chilled Water Rework"
+ Tooltip: When enabled, water in the Snow and Ice biomes will rapidly drain the player's breath instead of inflicting Chilled.
+ }
+
+ EarlyHardmodeProgressionRework: {
+ Label: "[i:Pwnhammer] Early Hardmode Progression Rework"
+ Tooltip:
+ '''
+ Demon Altars no longer spawn ores and crimson/corruption blocks when broken.
+ Wall of Flesh spawns Cobalt and Palladium ore on first kill.
+ The first mech boss you fight has 20% (10% in Expert and Master) less HP and damage and spawns Mythril and Orichalcum ore on first kill.
+ The second mech boss you fight has 10% (5% in Expert and Master) less HP and damage and spawns Adamantite and Titanium ore on first kill.
+ The third mech boss spawns Hallowed Ore on first kill.
+ '''
+ }
+
+ FasterBaseSpeed: {
+ Label: "[i:HermesBoots] Increase Base Movement Speed"
+ Tooltip:
+ '''
+ Increases the player's base movement speed substantially by always giving them +50% movement speed.
+ This setting does nothing if the mod Terraria Overhaul is loaded.
+ Calamity is balanced around this setting being enabled.
+ '''
+ }
+
+ FasterRopeClimbSpeed: {
+ Label: "[i:Rope] Increase Rope Climb Speed"
+ Tooltip:
+ '''
+ Increases the player's rope climb speed substantially by increasing acceleration and deceleration while on a rope.
+ Calamity is balanced around this setting being enabled.
+ '''
+ }
+
+ FasterJumpSpeed: {
+ Label: "[i:FrogLeg] Increase Base Jump Speed"
+ Tooltip:
+ '''
+ Slightly increases the player's base jump speed.
+ Calamity is balanced around this setting being enabled.
+ '''
+ }
+
+ FasterTilePlacement: {
+ Label: "[i:ArchitectGizmoPack] Increase Base Building Speed"
+ Tooltip:
+ '''
+ Substantially increases how rapidly the player can place tiles and walls.
+ This config stacks with the Brick Layer, Portable Cement Mixer and other accessories.
+ '''
+ }
+
+ ForceTownSafety: {
+ Label: "[i:Sunflower] Force Town Safety"
+ Tooltip:
+ '''
+ Counteracts Expert and Master Mode allowing enemies to spawn near towns by vastly decreasing spawn rates.
+ This can have unintended side effects such as making critters difficult to find.
+ '''
+ }
+
+ HigherJumpHeight: {
+ Label: "[i:ShinyRedBalloon] Increase Base Jump Height"
+ Tooltip:
+ '''
+ Increases the player's base jump height by 10% so that they can jump 7 tiles.
+ Calamity is balanced around this setting being enabled.
+ '''
+ }
+
+ NerfExpertDebuffs: {
+ Label: "[i:AnkhCharm] Remove Increased Debuff Duration"
+ Tooltip:
+ '''
+ Disables Expert Mode doubling (and Master Mode tripling) the duration of debuffs on the player.
+ Calamity is balanced around this setting being enabled.
+ '''
+ }
+
+ RemoveLavaDropsFromLavaSlimes: {
+ Label: "[i:LavaWaders] Remove Lava Drops From Lava Slimes"
+ Tooltip: When enabled, Lava Slimes will be replaced with a new Lava Slime that no longer drops lava.
+ }
+
+ RemoveReforgeRNG: {
+ Label: "[i:TinHammer] Remove Reforge RNG"
+ Tooltip:
+ '''
+ Removes randomness from the Goblin Tinkerer's reforges for both weapons and accessories.
+ Disable this if using mods that change reforging on their own to prevent conflicts.
+ '''
+ }
+
PotionSelling: {
Label: "[i:SpelunkerPotion] Town NPC Potion Selling"
Tooltip:
@@ -477,23 +496,4 @@ CalamityConfig: {
This includes the Old Man.
'''
}
-
- VanillaCooldownDisplay: {
- Label: "[i:HealingPotion] Display Vanilla Cooldowns"
- Tooltip:
- '''
- Adds the vanilla debuffs Potion Sickness and Chaos State to the Cooldown Rack.
- The debuffs will still appear in the buffs array, but this may help make them more visible.
- '''
- }
-
- VCMMStatusMessage: {
- Label: "[i:MusicBoxMartians] VCMM Status Message"
- Tooltip: Enable or disable the status message promoting the Vanilla Calamity Music Mod that plays on world entry.
- }
-
- WikiStatusMessage: {
- Label: "[i:Book] Wiki Status Message"
- Tooltip: Enable or disable the status message promoting the Official Calamity Wiki that plays on world entry.
- }
}
diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson
index fcd606153f..9e1fa68771 100644
--- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson
@@ -968,7 +968,11 @@ Viscera: {
VitriolicViper: {
DisplayName: Vitriolic Viper
- Tooltip: Releases a volley of venomous fangs and spit
+ Tooltip:
+ '''
+ Charges up and fires a slithering beam of radiation
+ If fully charged, instead fires a huge spread of short range fangs which quickly vanish
+ '''
}
VividClarity: {
diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson
index d2254d5bc5..970d8177e7 100644
--- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson
@@ -729,7 +729,11 @@ IllustriousKnives: {
InsidiousImpaler: {
DisplayName: Insidious Impaler
- Tooltip: Fires infected harpoons that stick to enemies and explode
+ Tooltip:
+ '''
+ Throws self-propelling radioactive harpoons which chase foes
+ Harpoons ricochet at close range for additional hits
+ '''
}
IridescentExcalibur: {
diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson
index 0cc85f6ce8..0f076074cf 100644
--- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson
@@ -622,11 +622,11 @@ Hellborn: {
DisplayName: Hellborn
Tooltip:
'''
- Fires a spread of 3 bullets
- Enemies that touch the gun while it's being fired trigger a massive explosion
- After the explosion, this gun gains a massive boost to damage, fire rate and knockback for 10 seconds
- These stat bonuses slowly decay over time
- Converts musket balls into explosive bullets
+ An ornate firearm created during the Draconic Era by Azafure's finest forgemaster
+ Hold to twirl the gun in your hand, rapidly hitting nearby enemies
+ Hits with the gun itself add rounds to the gun, up to a max of 8
+ At the cost of one round, hold to fire a giant energy sphere with potent recoil
+ [c/E1B65F:'Know the grace of a gun forged through beauteous inspiration']
'''
}
@@ -1087,8 +1087,12 @@ SepticSkewer: {
DisplayName: Septic Skewer
Tooltip:
'''
- Launches a spiky harpoon infested with toxins
- Releases bacteria when returning to the player
+ Launches a vile chained harpoon infested with toxins
+ Harpoons stick into enemies and inflict Sulphuric Poisoning for a long time
+ After being impaled for one second, harpoons rip themselves back out and spray damaging gores
+ Press to manually rip out all harpoons, dealing bonus damage
+ Enemies close to death are dragged back with returning harpoons and executed when they reach you
+ Executions heal you for 25 health and launch an additional harpoon automatically
'''
}
diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson
index 592540295f..da591d6c91 100644
--- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson
@@ -1275,9 +1275,10 @@ TheOldReaper: {
DisplayName: The Old Reaper
Tooltip:
'''
- Throws a homing reaper scythe that shreds enemies
- Stealth strikes throw three at once
- 'Slice 'n dice'
+ Throws an irradiated scythe that cuts through enemies
+ Deposits unstable isotopes on hit, which create delayed nuclear explosions when they decay
+ Stealth strikes are thrown into the sky and fall upon enemies a few seconds later
+ On hit, stealth strikes create a focused deluge of acid rain
'''
}
@@ -1336,9 +1337,8 @@ ToxicantTwister: {
DisplayName: Toxicant Twister
Tooltip:
'''
- Throws a slow moving boomerang
- After a few moments, the boomerang chooses a target and rapidly homes in
- Stealth strikes home in faster and rapidly release sand
+ Throws a fan of four spinning disks that swirl around your cursor
+ Stealth strikes swirl in a wider range and create a vortex of toxic raindrops that home in on enemies
'''
}
diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson
index 389293cecf..ca2f0ddedb 100644
--- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson
@@ -183,7 +183,7 @@ SeaDragonRocket.DisplayName: Seadragon RPG
SeasSearingBubble.DisplayName: Searing Bubble
SeasSearingSecondary.DisplayName: Hydroshower
SeasSearingSpout.DisplayName: Spout
-SepticSkewerBacteria.DisplayName: Bacteria
+SepticSkewerBacteria.DisplayName: Septic Gore
SepticSkewerHarpoon.DisplayName: Septic Skewer
SevensStrikerBrick.DisplayName: Brick
SevensStrikerCherry.DisplayName: Cherry
@@ -244,3 +244,5 @@ WaterSpout.DisplayName: Spout
WildfireBloomFire.DisplayName: Wildfire Fire
WildfireBloomFlare.DisplayName: Wildfire Flare
WulfrumScrapBullet.DisplayName: High Speed Scrap
+HellbornProj.DisplayName: Hell-born Gunblast
+HellbornShell.DisplayName: Hell's Shell
diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson
index 2a9058f92e..ab2a36b632 100644
--- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson
@@ -311,8 +311,8 @@ TotalityFire.DisplayName: Totality Fire
TotalityFlask.DisplayName: Totality Flask
TotalityTar.DisplayName: Totality Tar
TotalMeltdown.DisplayName: Explosion
-ToxicantTwisterDust.DisplayName: Toxicant Dust
-ToxicantTwisterTwoPointZero.DisplayName: Toxicant Twister
+ToxicantTwisterDust.DisplayName: Toxicant Raindrop
+ToxicantTwisterProj.DisplayName: Toxicant Twister
TurbulanceProjectile.DisplayName: Turbulance
TurbulanceWindSlash.DisplayName: Wind Slash
TwistingThunderProj.DisplayName: Twisting Thunder
@@ -329,3 +329,5 @@ WrathwingCinder.DisplayName: Wrathwing Eruption
WrathwingFireball.DisplayName: Wrathwing Fireball
WrathwingSpear.DisplayName: Wrathwing
WulfrumKnifeProj.DisplayName: Wulfrum Knife
+RadiationBurst.DisplayName: Radiation Burst
+RadiationRain.DisplayName: Radiation Rain
diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs
index a5a69d421a..7857a0df85 100644
--- a/ModSupport/ModCalls.cs
+++ b/ModSupport/ModCalls.cs
@@ -2180,7 +2180,7 @@ namespace CalamityMod
case "GetBossHealthBoost":
case "BossHealthMultiplier":
case "GetBossHealthMultiplier":
- return CalamityConfig.Instance.BossHealthBoost;
+ return CalamityServerConfig.Instance.BossHealthBoost;
case "HasPermanentPowerup":
case "GetPermanentPowerup":
diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs
index 9cb628306b..a4bdeaa7b9 100644
--- a/NPCs/AstrumAureus/AstrumAureus.cs
+++ b/NPCs/AstrumAureus/AstrumAureus.cs
@@ -319,7 +319,7 @@ namespace CalamityMod.NPCs.AstrumAureus
if (NPC.ai[0] == 3f || NPC.ai[0] == 4f)
afterimageAmt = 10;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -349,7 +349,7 @@ namespace CalamityMod.NPCs.AstrumAureus
attackingColor = slimePhase == 0 ? Color.Violet : Color.Yellow;
}
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs
index 97f8fea0ce..eaecff22bf 100644
--- a/NPCs/AstrumAureus/AureusSpawn.cs
+++ b/NPCs/AstrumAureus/AureusSpawn.cs
@@ -244,7 +244,7 @@ namespace CalamityMod.NPCs.AstrumAureus
Color whiteColor = Color.White;
int afterimageAmt = 10;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -267,7 +267,7 @@ namespace CalamityMod.NPCs.AstrumAureus
texture2D15 = GlowTexture.Value;
Color afterimageColorLerp = Color.Lerp(Color.White, Color.Orange, 0.5f) * NPC.Opacity;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs
index 9ef4b90ec1..02f6ab223d 100644
--- a/NPCs/Bumblebirb/Bumblefuck.cs
+++ b/NPCs/Bumblebirb/Bumblefuck.cs
@@ -280,7 +280,7 @@ namespace CalamityMod.NPCs.Bumblebirb
color = altColor;
}
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += afterimageIncrement)
{
@@ -333,7 +333,7 @@ namespace CalamityMod.NPCs.Bumblebirb
}
}
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 0; j < extraAfterimageAmt; j++)
{
@@ -375,7 +375,7 @@ namespace CalamityMod.NPCs.Bumblebirb
glowmaskColor *= glowmaskDampener;
}
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int k = 1; k < afterimageAmt; k += afterimageIncrement)
{
diff --git a/NPCs/Bumblebirb/Bumblefuck2.cs b/NPCs/Bumblebirb/Bumblefuck2.cs
index a42507bd10..b3db2d2a5e 100644
--- a/NPCs/Bumblebirb/Bumblefuck2.cs
+++ b/NPCs/Bumblebirb/Bumblefuck2.cs
@@ -104,7 +104,7 @@ namespace CalamityMod.NPCs.Bumblebirb
Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2);
int afterimageAmt = NPC.ai[0] == 2.1f ? 7 : 0;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
diff --git a/NPCs/CalClone/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs
index 6d40ea4a90..4ab499038a 100644
--- a/NPCs/CalClone/CalamitasClone.cs
+++ b/NPCs/CalClone/CalamitasClone.cs
@@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.CalClone
float colorLerpAmt = 0.5f;
int afterimageAmt = 7;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -176,7 +176,7 @@ namespace CalamityMod.NPCs.CalClone
color = Color.CornflowerBlue;
}
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i++)
{
diff --git a/NPCs/CalClone/Cataclysm.cs b/NPCs/CalClone/Cataclysm.cs
index ab7be72dab..b9b30e4821 100644
--- a/NPCs/CalClone/Cataclysm.cs
+++ b/NPCs/CalClone/Cataclysm.cs
@@ -122,7 +122,7 @@ namespace CalamityMod.NPCs.CalClone
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
int afterimageAmt = 7;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -145,7 +145,7 @@ namespace CalamityMod.NPCs.CalClone
texture2D15 = GlowTexture.Value;
Color pinkLerp = Color.Lerp(Color.White, Color.Red, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/CalClone/Catastrophe.cs b/NPCs/CalClone/Catastrophe.cs
index 79ea1ef840..6c37e6c00b 100644
--- a/NPCs/CalClone/Catastrophe.cs
+++ b/NPCs/CalClone/Catastrophe.cs
@@ -116,7 +116,7 @@ namespace CalamityMod.NPCs.CalClone
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
int afterimageAmt = 7;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -139,7 +139,7 @@ namespace CalamityMod.NPCs.CalClone
texture2D15 = GlowTexture.Value;
Color pinkLerp = Color.Lerp(Color.White, Color.Red, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/CalClone/SoulSeeker.cs b/NPCs/CalClone/SoulSeeker.cs
index 40fa624d73..42fc4b91c2 100644
--- a/NPCs/CalClone/SoulSeeker.cs
+++ b/NPCs/CalClone/SoulSeeker.cs
@@ -194,7 +194,7 @@ namespace CalamityMod.NPCs.CalClone
float colorLerpAmt = 0.5f;
int afterImageAmt = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int a = 1; a < afterImageAmt; a += 2)
{
@@ -217,7 +217,7 @@ namespace CalamityMod.NPCs.CalClone
texture = GlowTexture.Value;
Color glow = Color.Lerp(Color.White, Color.Red, colorLerpAmt);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int a = 1; a < afterImageAmt; a++)
{
diff --git a/NPCs/CalamityAIs/CalamityBossAIs/CeaselessVoidAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/CeaselessVoidAI.cs
index 203ecf35ff..e183bfe89f 100644
--- a/NPCs/CalamityAIs/CalamityBossAIs/CeaselessVoidAI.cs
+++ b/NPCs/CalamityAIs/CalamityBossAIs/CeaselessVoidAI.cs
@@ -391,7 +391,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs
// Destroy all Dark Energies if their total HP is below 20%
int darkEnergyMaxHP = bossRush ? DarkEnergy.MaxBossRushHP : DarkEnergy.MaxHP;
//These are still needed so that CV Dark energy despawn works properly
- double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
+ double HPBoost = CalamityServerConfig.Instance.BossHealthBoost * 0.01;
darkEnergyMaxHP += (int)(darkEnergyMaxHP * HPBoost);
int totalDarkEnergiesSpawned = darkEnergyAmt * 3 + 2;
diff --git a/NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs
index ad6d55af05..a4b0716412 100644
--- a/NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs
+++ b/NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs
@@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs
float greenLight = (phase3AI ? 1.2f : phase2AI ? 0.8f : 0.4f) * alphaScale;
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), redLight, greenLight, 0f);
- if (CalamityConfig.Instance.BossesStopWeather)
+ if (CalamityServerConfig.Instance.BossesStopWeather)
CalamityMod.StopRain();
else if (!Main.raining && !BossRushEvent.BossRushActive)
CalamityUtils.StartRain();
diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs
index 809e1f3f5c..1ae7b0bb99 100644
--- a/NPCs/CalamityGlobalNPC.cs
+++ b/NPCs/CalamityGlobalNPC.cs
@@ -2324,7 +2324,7 @@ namespace CalamityMod.NPCs
}
if ((npc.boss && npc.type != NPCID.MartianSaucerCore) || CalamityLists.bossHPScaleList.Contains(npc.type))
{
- double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
+ double HPBoost = CalamityServerConfig.Instance.BossHealthBoost * 0.01;
npc.lifeMax += (int)Math.Round(npc.lifeMax * HPBoost);
}
@@ -2527,7 +2527,7 @@ namespace CalamityMod.NPCs
}
// Reduce mech boss HP and damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
if (!NPC.downedMechBossAny)
{
@@ -3227,7 +3227,7 @@ namespace CalamityMod.NPCs
Texture2D npcTexture = texture ?? TextureAssets.Npc[npc.type].Value;
Vector2 screenOffset = npc.IsABestiaryIconDummy ? Vector2.Zero : Main.screenPosition;
int afterimageCounter = 1;
- while (afterimageCounter < NPCID.Sets.TrailCacheLength[npc.type] && CalamityConfig.Instance.Afterimages)
+ while (afterimageCounter < NPCID.Sets.TrailCacheLength[npc.type] && CalamityClientConfig.Instance.Afterimages)
{
Color colorToDraw = Color.Lerp(drawColor, endingColor, afterimageCounter / (float)NPCID.Sets.TrailCacheLength[npc.type]);
colorToDraw *= afterimageCounter / (float)NPCID.Sets.TrailCacheLength[npc.type];
@@ -6301,12 +6301,12 @@ namespace CalamityMod.NPCs
spawnRate = (int)(spawnRate * 1.4);
maxSpawns = (int)(maxSpawns * 0.4f);
}
- if (player.Calamity().zen || (CalamityConfig.Instance.ForceTownSafety && player.townNPCs > 1f && Main.expertMode))
+ if (player.Calamity().zen || (CalamityServerConfig.Instance.ForceTownSafety && player.townNPCs > 1f && Main.expertMode))
{
spawnRate = (int)(spawnRate * 2.5);
maxSpawns = (int)(maxSpawns * 0.3f);
}
- if (player.Calamity().isNearbyBoss && CalamityConfig.Instance.BossZen)
+ if (player.Calamity().isNearbyBoss && CalamityServerConfig.Instance.BossZen)
{
spawnRate *= 5;
maxSpawns = (int)(maxSpawns * 0.001f);
@@ -6424,7 +6424,7 @@ namespace CalamityMod.NPCs
}
// Replace vanilla Lava Slimes with Calamity Lava Slimes to avoid annoying lava drops
- if (spawnInfo.Player.ZoneUnderworldHeight && !calamityBiomeZone && CalamityConfig.Instance.RemoveLavaDropsFromLavaSlimes && Main.expertMode)
+ if (spawnInfo.Player.ZoneUnderworldHeight && !calamityBiomeZone && CalamityServerConfig.Instance.RemoveLavaDropsFromLavaSlimes && Main.expertMode)
{
pool.Add(NPCType(), SpawnCondition.Underworld.Chance);
pool.Remove(NPCID.LavaSlime);
@@ -6943,7 +6943,7 @@ namespace CalamityMod.NPCs
{
if (npc.type != NPCID.BrainofCthulhu && (npc.type != NPCID.DukeFishron || npc.ai[0] <= 9f) && npc.active)
{
- if (CalamityConfig.Instance.DebuffDisplay && (npc.boss || BossHealthBarManager.MinibossHPBarList.Contains(npc.type) || BossHealthBarManager.OneToMany.ContainsKey(npc.type) || CalamityLists.needsDebuffIconDisplayList.Contains(npc.type)))
+ if (CalamityClientConfig.Instance.DebuffDisplay && (npc.boss || BossHealthBarManager.MinibossHPBarList.Contains(npc.type) || BossHealthBarManager.OneToMany.ContainsKey(npc.type) || CalamityLists.needsDebuffIconDisplayList.Contains(npc.type)))
{
List currentDebuffs = new List() { };
@@ -7459,7 +7459,7 @@ namespace CalamityMod.NPCs
}
}
- Texture2D glowTexture = CalamityConfig.Instance.NewVanillaTextures ? CalamityMod.DestroyerGlowmasks[0].Value : TextureAssets.Dest[0].Value;
+ Texture2D glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? CalamityMod.DestroyerGlowmasks[0].Value : TextureAssets.Dest[0].Value;
switch (npc.type)
{
default:
@@ -7467,11 +7467,11 @@ namespace CalamityMod.NPCs
break;
case NPCID.TheDestroyerBody:
- glowTexture = CalamityConfig.Instance.NewVanillaTextures ? CalamityMod.DestroyerGlowmasks[1].Value : TextureAssets.Dest[1].Value;
+ glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? CalamityMod.DestroyerGlowmasks[1].Value : TextureAssets.Dest[1].Value;
break;
case NPCID.TheDestroyerTail:
- glowTexture = CalamityConfig.Instance.NewVanillaTextures ? CalamityMod.DestroyerGlowmasks[2].Value : TextureAssets.Dest[2].Value;
+ glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? CalamityMod.DestroyerGlowmasks[2].Value : TextureAssets.Dest[2].Value;
break;
}
@@ -7481,7 +7481,7 @@ namespace CalamityMod.NPCs
}
// Laser telegraph
- else if (npc.type == NPCID.Probe && CalamityConfig.Instance.NewVanillaTextures)
+ else if (npc.type == NPCID.Probe && CalamityClientConfig.Instance.NewVanillaTextures)
{
float eyeTelegraphGateValue = (NPC.IsMechQueenUp ? DestroyerAI.ProbeLaserGateValue_Mechdusa : BossRushEvent.BossRushActive ? DestroyerAI.ProbeLaserGateValue_BossRush : revenge ? DestroyerAI.ProbeLaserGateValue_Rev : DestroyerAI.ProbeLaserGateValue) - DestroyerAI.ProbeLaserTelegraphTime;
Texture2D glowTexture = CalamityMod.ProbeGlowmask.Value;
@@ -7795,7 +7795,7 @@ namespace CalamityMod.NPCs
float eyeTelegraphGateValue = WallOfFleshAI.LaserShootGateValue - WallOfFleshAI.LaserShootTelegraphTime;
if (npc.localAI[1] > eyeTelegraphGateValue || npc.localAI[2] > 0f || enraged)
{
- Texture2D glowTexture = CalamityConfig.Instance.NewVanillaTextures ? CalamityMod.WallOfFleshEyeGlowmask.Value : TextureAssets.Npc[npc.type].Value;
+ Texture2D glowTexture = CalamityClientConfig.Instance.NewVanillaTextures ? CalamityMod.WallOfFleshEyeGlowmask.Value : TextureAssets.Npc[npc.type].Value;
Vector2 halfSize = npc.frame.Size() / 2;
SpriteEffects spriteEffects = SpriteEffects.None;
if (npc.spriteDirection == 1)
@@ -7947,7 +7947,7 @@ namespace CalamityMod.NPCs
float telegraphScalar = MathHelper.Clamp((Math.Abs(PlanteraAI.StopChargeGateValue) - telegraphTimer) / Math.Abs(PlanteraAI.StopChargeGateValue), 0f, 1f);
Color telegraphColor = Color.Lerp(originalColor, newColor, telegraphScalar);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
int afterimageAmount = 10;
int afterImageIncrement = 2;
diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs
index 3e7777ce5d..96db52e4c2 100644
--- a/NPCs/CalamityGlobalNPCLoot.cs
+++ b/NPCs/CalamityGlobalNPCLoot.cs
@@ -1816,7 +1816,7 @@ DukeEditFailed:
if (!Main.hardMode && !BossRushEvent.BossRushActive)
{
// Increase altar count to allow natural mech boss spawning.
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework)
WorldGen.altarCount++;
string key2 = "Mods.CalamityMod.Status.Progression.UglyBossText";
@@ -1840,7 +1840,7 @@ DukeEditFailed:
SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3);
SetNewBossJustDowned(npc);
- if (!NPC.downedMechBoss1 && CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (!NPC.downedMechBoss1 && CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
SpawnMechBossHardmodeOres();
break;
@@ -1852,7 +1852,7 @@ DukeEditFailed:
SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, !NPC.downedMechBoss1 || NPC.downedMechBoss2 || !NPC.downedMechBoss3);
SetNewBossJustDowned(npc);
- if (!NPC.downedMechBoss2 && CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (!NPC.downedMechBoss2 && CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
SpawnMechBossHardmodeOres();
}
break;
@@ -1862,7 +1862,7 @@ DukeEditFailed:
SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, !NPC.downedMechBoss1 || !NPC.downedMechBoss2 || NPC.downedMechBoss3);
SetNewBossJustDowned(npc);
- if (!NPC.downedMechBoss3 && CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (!NPC.downedMechBoss3 && CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
SpawnMechBossHardmodeOres();
break;
diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs
index 5ecc59c8db..fe1b6ba5a6 100644
--- a/NPCs/CalamityGlobalTownNPC.cs
+++ b/NPCs/CalamityGlobalTownNPC.cs
@@ -681,7 +681,7 @@ namespace CalamityMod.NPCs
public void TownNPCAlertSystem(NPC npc, Mod mod, SpriteBatch spriteBatch)
{
- if (CalamityConfig.Instance.ShopNewAlert && npc.townNPC)
+ if (CalamityClientConfig.Instance.ShopNewAlert && npc.townNPC)
{
for (int i = 0; i < npcAlertList.Count; i++)
{
diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs
index 3561ac61c7..06e39a1b66 100644
--- a/NPCs/CeaselessVoid/CeaselessVoid.cs
+++ b/NPCs/CeaselessVoid/CeaselessVoid.cs
@@ -164,7 +164,7 @@ namespace CalamityMod.NPCs.CeaselessVoid
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
int afterimageAmt = 7;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -187,7 +187,7 @@ namespace CalamityMod.NPCs.CeaselessVoid
texture2D15 = GlowTexture.Value;
Color cyanLerp = Color.Lerp(Color.White, Color.Cyan, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs
index 591887a1cc..0d9e18a7a9 100644
--- a/NPCs/CeaselessVoid/DarkEnergy.cs
+++ b/NPCs/CeaselessVoid/DarkEnergy.cs
@@ -228,7 +228,7 @@ namespace CalamityMod.NPCs.CeaselessVoid
drawPos -= new Vector2(mainTexture.Width, mainTexture.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f;
drawPos += drawOrigin * NPC.scale + new Vector2(0f, NPC.gfxOffY);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < trailCount; i += 2)
{
@@ -251,7 +251,7 @@ namespace CalamityMod.NPCs.CeaselessVoid
Texture2D glowTexture = GlowTexture.Value;
Color glowColor = Color.Lerp(Color.White, Color.Fuchsia, 0.5f) * NPC.Opacity;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < trailCount; i++)
{
diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs
index c701e45f48..3497368010 100644
--- a/NPCs/Crags/SoulSlurper.cs
+++ b/NPCs/Crags/SoulSlurper.cs
@@ -252,7 +252,7 @@ namespace CalamityMod.NPCs.Crags
Vector2 halfSizeTexture = new Vector2((float)(texture.Width / 2), (float)(texture.Height / 2));
int afterimageAmt = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -275,7 +275,7 @@ namespace CalamityMod.NPCs.Crags
texture = GlowTexture.Value;
Color redGlow = Color.Lerp(Color.White, Color.Red, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs
index 0a92d506bf..90eb0bb145 100644
--- a/NPCs/Cryogen/Cryogen.cs
+++ b/NPCs/Cryogen/Cryogen.cs
@@ -263,7 +263,7 @@ namespace CalamityMod.NPCs.Cryogen
NPC.ai[2] = 0f;
}
- if (CalamityConfig.Instance.BossesStopWeather)
+ if (CalamityServerConfig.Instance.BossesStopWeather)
CalamityMod.StopRain();
else if (!Main.raining && !BossRushEvent.BossRushActive)
CalamityUtils.StartRain();
diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs
index 08cec3bd8a..77d1994073 100644
--- a/NPCs/DevourerofGods/DevourerofGodsHead.cs
+++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs
@@ -353,7 +353,7 @@ namespace CalamityMod.NPCs.DevourerofGods
CalamityGlobalNPC.DoGP2 = -1;
// Stop rain
- if (CalamityConfig.Instance.BossesStopWeather)
+ if (CalamityServerConfig.Instance.BossesStopWeather)
CalamityMod.StopRain();
// Get a target (time is checked in the second check to ensure a new target isn't being set constantly)
diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs
index 92b9bf0991..67238d32a2 100644
--- a/NPCs/ExoMechs/Apollo/Apollo.cs
+++ b/NPCs/ExoMechs/Apollo/Apollo.cs
@@ -1529,7 +1529,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo
// This is created to allow easy duplication of them when drawing the charge.
void drawInstance(Vector2 drawOffset, Color baseColor)
{
- if (CalamityConfig.Instance.Afterimages && !NPC.IsABestiaryIconDummy)
+ if (CalamityClientConfig.Instance.Afterimages && !NPC.IsABestiaryIconDummy)
{
for (int i = 1; i < numAfterimages; i += 2)
{
@@ -1600,7 +1600,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo
}
texture = GlowTexture.Value;
- if (CalamityConfig.Instance.Afterimages && !NPC.IsABestiaryIconDummy)
+ if (CalamityClientConfig.Instance.Afterimages && !NPC.IsABestiaryIconDummy)
{
for (int i = 1; i < numAfterimages; i += 2)
{
diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs
index ea1654d11d..560d082ee9 100644
--- a/NPCs/ExoMechs/Ares/AresBody.cs
+++ b/NPCs/ExoMechs/Ares/AresBody.cs
@@ -1242,7 +1242,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
Vector2 vector = new Vector2(NPC.width / 2, NPC.height / 2);
int numAfterimages = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < numAfterimages; i += 2)
{
@@ -1262,7 +1262,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
texture = GlowTexture.Value;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < numAfterimages; i += 2)
{
diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs
index 25711cd7e6..a0255e00a9 100644
--- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs
+++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs
@@ -552,7 +552,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
Color afterimageBaseColor = Main.npc[(int)NPC.ai[2]].localAI[1] == (float)AresBody.Enraged.Yes ? Color.Red : Color.White;
int numAfterimages = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < numAfterimages; i += 2)
{
@@ -593,7 +593,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
Texture2D glowTexture = GlowTexture.Value;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < numAfterimages; i += 2)
{
diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs
index e3cae35c3b..50e90dd8ee 100644
--- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs
+++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs
@@ -600,7 +600,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
Color afterimageBaseColor = Main.npc[(int)NPC.ai[2]].localAI[1] == (float)AresBody.Enraged.Yes ? Color.Red : Color.White;
int numAfterimages = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < numAfterimages; i += 2)
{
@@ -639,7 +639,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
Texture2D glowTexture = GlowTexture.Value;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < numAfterimages; i += 2)
{
diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs
index 92d41aaa67..3cd116c063 100644
--- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs
+++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs
@@ -551,7 +551,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
Color afterimageBaseColor = Main.npc[(int)NPC.ai[2]].localAI[1] == (float)AresBody.Enraged.Yes ? Color.Red : Color.White;
int numAfterimages = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < numAfterimages; i += 2)
{
@@ -591,7 +591,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
Texture2D glowTexture = GlowTexture.Value;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < numAfterimages; i += 2)
{
diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs
index ad5752378b..f98d292391 100644
--- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs
+++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs
@@ -546,7 +546,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
Color afterimageBaseColor = Main.npc[(int)NPC.ai[2]].localAI[1] == (float)AresBody.Enraged.Yes ? Color.Red : Color.White;
int numAfterimages = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < numAfterimages; i += 2)
{
@@ -585,7 +585,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
Texture2D glowTexture = GlowTexture.Value;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < numAfterimages; i += 2)
{
diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs
index e1b8f140a2..70737fc4e4 100644
--- a/NPCs/ExoMechs/Artemis/Artemis.cs
+++ b/NPCs/ExoMechs/Artemis/Artemis.cs
@@ -1424,7 +1424,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
// This is created to allow easy duplication of them when drawing the charge.
void drawInstance(Vector2 drawOffset, Color baseColor)
{
- if (CalamityConfig.Instance.Afterimages && !NPC.IsABestiaryIconDummy)
+ if (CalamityClientConfig.Instance.Afterimages && !NPC.IsABestiaryIconDummy)
{
for (int i = 1; i < numAfterimages; i += 2)
{
@@ -1495,7 +1495,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis
}
texture = GlowTexture.Value;
- if (CalamityConfig.Instance.Afterimages && !NPC.IsABestiaryIconDummy)
+ if (CalamityClientConfig.Instance.Afterimages && !NPC.IsABestiaryIconDummy)
{
for (int i = 1; i < numAfterimages; i += 2)
{
diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs
index 3d1673db94..c0d7469cc5 100644
--- a/NPCs/GreatSandShark/GreatSandShark.cs
+++ b/NPCs/GreatSandShark/GreatSandShark.cs
@@ -609,7 +609,7 @@ namespace CalamityMod.NPCs.GreatSandShark
int eightConst = 8;
int afterimageInc = 2;
int afterimageCounter = 1;
- while (((afterimageInc > 0 && afterimageCounter < eightConst) || (afterimageInc < 0 && afterimageCounter > eightConst)) && CalamityConfig.Instance.Afterimages)
+ while (((afterimageInc > 0 && afterimageCounter < eightConst) || (afterimageInc < 0 && afterimageCounter > eightConst)) && CalamityClientConfig.Instance.Afterimages)
{
Color alphaAfterimageColor = NPC.GetAlpha(extraAfterimageColor);
{
diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs
index 19bd36f3e3..67d2544e02 100644
--- a/NPCs/HiveMind/HiveMind.cs
+++ b/NPCs/HiveMind/HiveMind.cs
@@ -316,7 +316,7 @@ namespace CalamityMod.NPCs.HiveMind
Color afterimageBaseColor = Color.White;
int numAfterimages = 5;
- if (CalamityConfig.Instance.Afterimages && state != 0)
+ if (CalamityClientConfig.Instance.Afterimages && state != 0)
{
for (int i = 1; i < numAfterimages; i += 2)
{
diff --git a/NPCs/NormalNPCs/BloodlettingServant.cs b/NPCs/NormalNPCs/BloodlettingServant.cs
index 7111f3a916..8a13965c80 100644
--- a/NPCs/NormalNPCs/BloodlettingServant.cs
+++ b/NPCs/NormalNPCs/BloodlettingServant.cs
@@ -264,7 +264,7 @@ namespace CalamityMod.NPCs.NormalNPCs
float telegraphScalar = MathHelper.Clamp((NPC.ai[0] - ChargeTelegraphGateValue) / ChargeTelegraphGateValue, 0f, 1f);
Color telegraphColor = Color.Lerp(originalColor, newColor, telegraphScalar);
- if (CalamityConfig.Instance.Afterimages && NPC.ai[1] > 0f)
+ if (CalamityClientConfig.Instance.Afterimages && NPC.ai[1] > 0f)
{
int afterimageAmount = 10;
int afterImageIncrement = 2;
diff --git a/NPCs/NormalNPCs/Foveanator.cs b/NPCs/NormalNPCs/Foveanator.cs
index 853bbd3c42..52c801fef7 100644
--- a/NPCs/NormalNPCs/Foveanator.cs
+++ b/NPCs/NormalNPCs/Foveanator.cs
@@ -382,7 +382,7 @@ namespace CalamityMod.NPCs.NormalNPCs
int damage = NPC.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -513,7 +513,7 @@ namespace CalamityMod.NPCs.NormalNPCs
int damage = NPC.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -702,7 +702,7 @@ namespace CalamityMod.NPCs.NormalNPCs
int damage = NPC.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs
index 675ddbfb27..ff467680b6 100644
--- a/NPCs/NormalNPCs/IceClasper.cs
+++ b/NPCs/NormalNPCs/IceClasper.cs
@@ -342,7 +342,7 @@ namespace CalamityMod.NPCs.NormalNPCs
(MathHelper.Clamp(AITimer, 0f, TimeBeforeDash) / TimeBeforeDash);
float AfterimageFade = MathHelper.Lerp(0f, 1f, interpolant);
- if (CurrentState == IceClasperAIState.Dashing && CalamityConfig.Instance.Afterimages)
+ if (CurrentState == IceClasperAIState.Dashing && CalamityClientConfig.Instance.Afterimages)
{
for (int i = 0; i < NPC.oldPos.Length; i++)
{
diff --git a/NPCs/NormalNPCs/SkeletronPrime2.cs b/NPCs/NormalNPCs/SkeletronPrime2.cs
index b60a5c739e..69040e26ec 100644
--- a/NPCs/NormalNPCs/SkeletronPrime2.cs
+++ b/NPCs/NormalNPCs/SkeletronPrime2.cs
@@ -418,7 +418,7 @@ namespace CalamityMod.NPCs.NormalNPCs
int damage = NPC.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -683,7 +683,7 @@ namespace CalamityMod.NPCs.NormalNPCs
int damage = NPC.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -751,7 +751,7 @@ namespace CalamityMod.NPCs.NormalNPCs
int damage = NPC.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
diff --git a/NPCs/NormalNPCs/WildBumblefuck.cs b/NPCs/NormalNPCs/WildBumblefuck.cs
index 8421f495ff..95f5122d35 100644
--- a/NPCs/NormalNPCs/WildBumblefuck.cs
+++ b/NPCs/NormalNPCs/WildBumblefuck.cs
@@ -129,7 +129,7 @@ namespace CalamityMod.NPCs.NormalNPCs
Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2);
int afterimageAmt = NPC.ai[0] == 2.1f ? 7 : 0;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs
index 6a35998d40..43851176ba 100644
--- a/NPCs/OldDuke/OldDuke.cs
+++ b/NPCs/OldDuke/OldDuke.cs
@@ -259,7 +259,7 @@ namespace CalamityMod.NPCs.OldDuke
color = drawColor;
}
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += afterimageIncrement)
{
@@ -310,7 +310,7 @@ namespace CalamityMod.NPCs.OldDuke
afterimageScale = 20f;
}
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 0; j < secondAfterimageAmt; j++)
{
@@ -366,7 +366,7 @@ namespace CalamityMod.NPCs.OldDuke
yellowLerpColor *= ai2Opacity;
}
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int k = 1; k < afterimageAmt; k += afterimageIncrement)
{
diff --git a/NPCs/OldDuke/SulphurousSharkron.cs b/NPCs/OldDuke/SulphurousSharkron.cs
index f49346796a..8058d64f08 100644
--- a/NPCs/OldDuke/SulphurousSharkron.cs
+++ b/NPCs/OldDuke/SulphurousSharkron.cs
@@ -243,7 +243,7 @@ namespace CalamityMod.NPCs.OldDuke
Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2);
int afterimageAmt = 10;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
diff --git a/NPCs/PlagueEnemies/PlagueCharger.cs b/NPCs/PlagueEnemies/PlagueCharger.cs
index 1f79c757cc..94015d6530 100644
--- a/NPCs/PlagueEnemies/PlagueCharger.cs
+++ b/NPCs/PlagueEnemies/PlagueCharger.cs
@@ -77,7 +77,7 @@ namespace CalamityMod.NPCs.PlagueEnemies
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
int afterimageAmt = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -100,7 +100,7 @@ namespace CalamityMod.NPCs.PlagueEnemies
texture2D15 = GlowTexture.Value;
Color redEyeColor = Color.Lerp(Color.White, Color.Red, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/PlagueEnemies/PlagueChargerLarge.cs b/NPCs/PlagueEnemies/PlagueChargerLarge.cs
index c6b4e66b75..c0aadd70db 100644
--- a/NPCs/PlagueEnemies/PlagueChargerLarge.cs
+++ b/NPCs/PlagueEnemies/PlagueChargerLarge.cs
@@ -72,7 +72,7 @@ namespace CalamityMod.NPCs.PlagueEnemies
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
int afterimageAmt = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.PlagueEnemies
texture2D15 = ModContent.Request("CalamityMod/NPCs/PlagueEnemies/PlagueChargerGlow").Value;
Color redEyeColor = Color.Lerp(Color.White, Color.Red, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs
index 9ad8a39ed9..959a9b51c0 100644
--- a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs
+++ b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs
@@ -383,7 +383,7 @@ namespace CalamityMod.NPCs.PlagueEnemies
Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value;
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
if (NPC.ai[0] == 0f && NPC.localAI[0] == 1f)
{
diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs
index 9b7de91cea..a229e8f164 100644
--- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs
+++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs
@@ -176,7 +176,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
spriteBatch.Draw(texture, drawLocation + drawOffset, NPC.frame, backAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
}
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -198,7 +198,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
texture = GlowTexture.Value;
Color redLerpColor = Color.Lerp(Color.White, Color.Red, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs
index e9acfe7182..22d6fefa56 100644
--- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs
+++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs
@@ -1267,7 +1267,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
Vector2 posOffset = new Vector2(charging ? 175 : 125, 0);
int chargeAfterimageAmount = 10;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
if ((NPC.ai[0] == 0f || NPC.ai[0] == 4f) && charging)
{
@@ -1292,7 +1292,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
Color redLerpColor = Color.Lerp(Color.White, Color.Red, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
if ((NPC.ai[0] == 0f || NPC.ai[0] == 4f) && charging)
{
diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs
index f1920158ab..7f7cc5a745 100644
--- a/NPCs/Polterghast/PhantomFuckYou.cs
+++ b/NPCs/Polterghast/PhantomFuckYou.cs
@@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.Polterghast
Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2);
int afterimageAmt = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs
index e8796595e5..d8246eedc2 100644
--- a/NPCs/Polterghast/PolterPhantom.cs
+++ b/NPCs/Polterghast/PolterPhantom.cs
@@ -455,7 +455,7 @@ namespace CalamityMod.NPCs.Polterghast
Color lightRed = new Color(255, 100, 100, 255) * NPC.Opacity;
int afterimageAmt = 7;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -490,7 +490,7 @@ namespace CalamityMod.NPCs.Polterghast
Color blackWhiteLerp = Color.Lerp(Color.White, c, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs
index 695428ba63..20138b1ba8 100644
--- a/NPCs/Polterghast/Polterghast.cs
+++ b/NPCs/Polterghast/Polterghast.cs
@@ -307,7 +307,7 @@ namespace CalamityMod.NPCs.Polterghast
}
// Stop rain
- if (CalamityConfig.Instance.BossesStopWeather)
+ if (CalamityServerConfig.Instance.BossesStopWeather)
CalamityMod.StopRain();
// Set time left
@@ -1169,7 +1169,7 @@ namespace CalamityMod.NPCs.Polterghast
Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2);
int afterimageAmt = 7;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -1213,7 +1213,7 @@ namespace CalamityMod.NPCs.Polterghast
Color veinColor = Color.Lerp(Color.White, (NPC.ai[2] >= changeColorGateValue || NPC.Calamity().newAI[0] > changeColorGateValue) ? Color.Red : Color.Black, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs
index 50c6039a49..be8e568245 100644
--- a/NPCs/Polterghast/PolterghastHook.cs
+++ b/NPCs/Polterghast/PolterghastHook.cs
@@ -375,7 +375,7 @@ namespace CalamityMod.NPCs.Polterghast
Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2);
int afterimageAmt = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -401,7 +401,7 @@ namespace CalamityMod.NPCs.Polterghast
if (Main.npc[CalamityGlobalNPC.ghostBoss].Calamity().newAI[0] > changeColorGateValue)
cyanLerp2 = Color.Lerp(cyanLerp2, lightRed, MathHelper.Clamp((Main.npc[CalamityGlobalNPC.ghostBoss].Calamity().newAI[0] - changeColorGateValue) / timeToReachFullColor, 0f, 1f));
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs
index e190c43eef..a6e87d6042 100644
--- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs
+++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs
@@ -1017,7 +1017,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
if (NPC.ai[0] == 2f)
afterimageAmt = 10;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -1055,7 +1055,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
if (colorOverride != null)
timeBasedColorLerp = colorOverride.Value;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs
index b7df246a38..aa680b5966 100644
--- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs
+++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs
@@ -737,7 +737,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
if (NPC.ai[0] == 2f)
afterimageAmt = 10;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -775,7 +775,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
if (colorOverride != null)
timeBasedGlowColor = colorOverride.Value;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs
index 9414e06ee0..2688f01f1c 100644
--- a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs
+++ b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs
@@ -442,7 +442,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2);
int afterimageAmt = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -484,7 +484,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
overrideColor = colorOverride.Value;
}
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs
index 87c76906fb..15f6e2eae4 100644
--- a/NPCs/Providence/ProvSpawnDefense.cs
+++ b/NPCs/Providence/ProvSpawnDefense.cs
@@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.Providence
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
int afterimageAmt = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.Providence
texture2D15 = ProfanedGuardianDefender.Texture_Glow.Value;
Color yellowLerp = Color.Lerp(Color.White, Color.Yellow, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs
index 624647f339..1cc6651765 100644
--- a/NPCs/Providence/ProvSpawnHealer.cs
+++ b/NPCs/Providence/ProvSpawnHealer.cs
@@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.Providence
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
int afterimageAmt = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -142,7 +142,7 @@ namespace CalamityMod.NPCs.Providence
Color yellowLerp = Color.Lerp(Color.White, Color.Yellow, 0.5f);
Color violetLerp = Color.Lerp(Color.White, Color.Violet, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs
index 2441f94f06..e430b70422 100644
--- a/NPCs/Providence/ProvSpawnOffense.cs
+++ b/NPCs/Providence/ProvSpawnOffense.cs
@@ -120,7 +120,7 @@ namespace CalamityMod.NPCs.Providence
if (NPC.ai[0] == 2f)
afterimageAmt = 10;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -143,7 +143,7 @@ namespace CalamityMod.NPCs.Providence
texture2D15 = ProfanedGuardianCommander.Texture_Glow.Value;
Color yellowLerpColor = Color.Lerp(Color.White, Color.Yellow, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs
index 7755ae0bd7..7f44eb2afb 100644
--- a/NPCs/Providence/Providence.cs
+++ b/NPCs/Providence/Providence.cs
@@ -632,7 +632,7 @@ namespace CalamityMod.NPCs.Providence
NPC.chaseable = normalAttackRate;
// Prevent lag by stopping rain
- if (CalamityConfig.Instance.BossesStopWeather)
+ if (CalamityServerConfig.Instance.BossesStopWeather)
CalamityMod.StopRain();
// Set target biome type
@@ -2220,7 +2220,7 @@ namespace CalamityMod.NPCs.Providence
float Brightness = 0.5f; // Ranges from 0 (full vibrance) to 1 (pure white)
int maxAfterimages = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < maxAfterimages; i += 2)
{
@@ -2295,7 +2295,7 @@ namespace CalamityMod.NPCs.Providence
Color GlowWingColor = ProvUtils.GetProjectileColor(NPC.GetAlpha(drawColor), true);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < maxAfterimages; j++)
{
diff --git a/NPCs/Signus/CosmicLantern.cs b/NPCs/Signus/CosmicLantern.cs
index 9fc04d2558..1fe444ffe1 100644
--- a/NPCs/Signus/CosmicLantern.cs
+++ b/NPCs/Signus/CosmicLantern.cs
@@ -131,7 +131,7 @@ namespace CalamityMod.NPCs.Signus
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
int afterimageAmt = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -154,7 +154,7 @@ namespace CalamityMod.NPCs.Signus
texture2D15 = GlowTexture.Value;
Color cyanLerp = Color.Lerp(Color.White, Color.Cyan, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/Signus/CosmicMine.cs b/NPCs/Signus/CosmicMine.cs
index 72c7f2a6e0..b61fb27b14 100644
--- a/NPCs/Signus/CosmicMine.cs
+++ b/NPCs/Signus/CosmicMine.cs
@@ -177,7 +177,7 @@ namespace CalamityMod.NPCs.Signus
Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / 2);
int afterimageAmt = 5;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs
index a213b3dfff..21fe2459d0 100644
--- a/NPCs/Signus/Signus.cs
+++ b/NPCs/Signus/Signus.cs
@@ -852,7 +852,7 @@ namespace CalamityMod.NPCs.Signus
transparency = (100 - (stealthTimer - 300)) * 0.01f;
}
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -878,7 +878,7 @@ namespace CalamityMod.NPCs.Signus
eyeGlowColor = Color.MediumBlue;
}
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs
index a0e8754706..4da12c3fb8 100644
--- a/NPCs/SlimeGod/SlimeGodCore.cs
+++ b/NPCs/SlimeGod/SlimeGodCore.cs
@@ -596,7 +596,7 @@ namespace CalamityMod.NPCs.SlimeGod
spriteBatch.Draw(pog, NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY), NPC.frame, drawColorAlpha, NPC.rotation, NPC.frame.Size() / 2, NPC.scale, spriteEffects, 0);
}
if (!Main.zenithWorld)
- while (((twoConst > 0 && coreID < 8) || (twoConst < 0 && coreID > 8)) && CalamityConfig.Instance.Afterimages)
+ while (((twoConst > 0 && coreID < 8) || (twoConst < 0 && coreID > 8)) && CalamityClientConfig.Instance.Afterimages)
{
Color colorLightingAlpha = NPC.GetAlpha(colorLightingArea);
{
diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs
index 732303ca07..47dfaf2b44 100644
--- a/NPCs/StormWeaver/StormWeaverHead.cs
+++ b/NPCs/StormWeaver/StormWeaverHead.cs
@@ -176,7 +176,7 @@ namespace CalamityMod.NPCs.StormWeaver
bool revenge = CalamityWorld.revenge || bossRush;
bool expertMode = Main.expertMode || bossRush;
- if (CalamityConfig.Instance.BossesStopWeather)
+ if (CalamityServerConfig.Instance.BossesStopWeather)
CalamityMod.StopRain();
else if (!Main.raining && !bossRush)
CalamityUtils.StartRain();
diff --git a/NPCs/SunkenSea/LostShoal.cs b/NPCs/SunkenSea/LostShoal.cs
index 3f2cfc9766..00765eb533 100644
--- a/NPCs/SunkenSea/LostShoal.cs
+++ b/NPCs/SunkenSea/LostShoal.cs
@@ -406,7 +406,7 @@ namespace CalamityMod.NPCs.SunkenSea
float colorLerpAmt = 0.5f;
int afterimageAmt = 7;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs
index a5a6484c86..14a68f3be3 100644
--- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs
+++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs
@@ -266,7 +266,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[NPC.type].Value.Width / 2), (float)(TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2));
int afterimageAmt = 2;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += 2)
{
@@ -289,7 +289,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
texture2D15 = GlowTexture.Value;
Color redLerp = Color.Lerp(Color.White, Color.Red, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int j = 1; j < afterimageAmt; j++)
{
diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs
index b633e8c7af..36ee5887fd 100644
--- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs
+++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs
@@ -456,7 +456,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
CalamityNetcode.SyncWorld();
}
- if (CalamityConfig.Instance.BossesStopWeather)
+ if (CalamityServerConfig.Instance.BossesStopWeather)
CalamityMod.StopRain();
bool bossRush = BossRushEvent.BossRushActive;
@@ -3632,7 +3632,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
ponyPos -= new Vector2(pony.Width / 2f, pony.Height / 15) * NPC.scale / 2f;
ponyPos += ponyOrigin * NPC.scale + new Vector2(-20, NPC.gfxOffY);
- if (CalamityConfig.Instance.Afterimages && !(cirrus && NPC.ai[1] == 2f))
+ if (CalamityClientConfig.Instance.Afterimages && !(cirrus && NPC.ai[1] == 2f))
{
for (int i = 1; i < afterimageAmt; i += 2)
{
diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs
index dfe67d8368..ea353dd396 100644
--- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs
+++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs
@@ -475,7 +475,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
Vector2 origin = NPC.frame.Size() * 0.5f;
int afterimageCount = 4;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageCount; i += 2)
{
@@ -492,7 +492,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
Color primarycolor = Main.zenithWorld ? Color.Blue : Color.Red; // why? because blue fire is awesome!!
Color baseGlowmaskColor = NPC.IsABestiaryIconDummy ? Color.White : Color.Lerp(Color.White, primarycolor, 0.5f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageCount; i++)
{
diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs
index 60631d4c6e..3211f265b3 100644
--- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs
+++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs
@@ -511,7 +511,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
Vector2 origin = NPC.frame.Size() * 0.5f;
int afterimageCount = 4;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageCount; i += 2)
{
@@ -527,7 +527,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
texture = GlowTexture.Value;
Color baseGlowmaskColor = Color.Lerp(Color.White, Color.Cyan, 0.35f);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageCount; i++)
{
diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs
index ff591a3aea..6f9d0a7d19 100644
--- a/NPCs/TownNPCs/THIEF.cs
+++ b/NPCs/TownNPCs/THIEF.cs
@@ -10,6 +10,7 @@ using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
+using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.GameContent.Bestiary;
using Terraria.GameContent.Events;
@@ -217,20 +218,26 @@ namespace CalamityMod.NPCs.TownNPCs
int goblinIndex = NPC.FindFirstNPC(NPCID.GoblinTinkerer);
if (goblinIndex != -1 && CalamityWorld.Reforges >= 1)
{
- CalamityWorld.Reforges = 0;
- int[] coinCounts = Utils.CoinsSplit(CalamityWorld.MoneyStolenByBandit);
- if (coinCounts[0] > 0)
- Item.NewItem(NPC.GetSource_Loot(), NPC.Hitbox, ItemID.CopperCoin, coinCounts[0]);
- if (coinCounts[1] > 0)
- Item.NewItem(NPC.GetSource_Loot(), NPC.Hitbox, ItemID.SilverCoin, coinCounts[1]);
- if (coinCounts[2] > 0)
- Item.NewItem(NPC.GetSource_Loot(), NPC.Hitbox, ItemID.GoldCoin, coinCounts[2]);
- if (coinCounts[3] > 0)
- Item.NewItem(NPC.GetSource_Loot(), NPC.Hitbox, ItemID.PlatinumCoin, coinCounts[3]);
+ if (Main.netMode == NetmodeID.SinglePlayer)
+ {
+ DoRefund(bandit: NPC);
+ }
+ else if (Main.netMode == NetmodeID.MultiplayerClient)
+ {
+ // Possible Bug here: Minor text bug when two players send request this simultaneously
+ // Which result to both player to have successful message but only one request got accepted on server
+ // But since this is how base gamecode works theres no way to fix this clean way (Unless someone implement net queued response for NPC dialog)
+ // And as this does not duplicate the coin amount, It's not that bad I think...?
+ //
+ // Other way possible is to having bandit stolen inventory per player
+ // But I didn't wanted to change system too much
+ ModPacket packet = CalamityMod.Instance.GetPacket();
+ packet.Write((byte)CalamityModMessageType.WantToRefundReforges);
+ packet.Write((byte)Main.myPlayer);
+ packet.Send();
+ }
- CalamityWorld.MoneyStolenByBandit = 0;
SoundEngine.PlaySound(SoundID.Coins); // Money dink sound
- CalamityNetcode.SyncWorld();
switch (Main.rand.Next(2))
{
case 0:
@@ -242,6 +249,29 @@ namespace CalamityMod.NPCs.TownNPCs
return this.GetLocalizedValue("NoRefund");
}
+ public static void DoRefund(NPC bandit)
+ {
+ if (bandit == null)
+ return;
+
+ if (CalamityWorld.Reforges <= 0)
+ return;
+
+ int[] coinCounts = Utils.CoinsSplit(CalamityWorld.MoneyStolenByBandit);
+ if (coinCounts[0] > 0)
+ Item.NewItem(new EntitySource_Gift(bandit), bandit.Hitbox, ItemID.CopperCoin, coinCounts[0]);
+ if (coinCounts[1] > 0)
+ Item.NewItem(new EntitySource_Gift(bandit), bandit.Hitbox, ItemID.SilverCoin, coinCounts[1]);
+ if (coinCounts[2] > 0)
+ Item.NewItem(new EntitySource_Gift(bandit), bandit.Hitbox, ItemID.GoldCoin, coinCounts[2]);
+ if (coinCounts[3] > 0)
+ Item.NewItem(new EntitySource_Gift(bandit), bandit.Hitbox, ItemID.PlatinumCoin, coinCounts[3]);
+
+ CalamityWorld.MoneyStolenByBandit = 0;
+ CalamityWorld.Reforges = 0;
+ CalamityNetcode.SyncWorld();
+ }
+
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
if (Main.LocalPlayer.Calamity().trippy)
diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs
index 66835d789d..19474d1d09 100644
--- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs
+++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs
@@ -397,7 +397,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -589,7 +589,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(projectileType);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -1293,7 +1293,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic;
double secondMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic;
@@ -1873,7 +1873,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -2056,7 +2056,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic;
double secondMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic;
diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs
index 9a2852dcb5..f98bc6c82d 100644
--- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs
+++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs
@@ -441,7 +441,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -705,7 +705,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -786,7 +786,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -994,7 +994,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -1062,7 +1062,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -1297,7 +1297,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -1344,7 +1344,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -2542,7 +2542,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic;
double secondMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic;
@@ -2642,7 +2642,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic;
double secondMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic;
diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs
index f1b49d5934..4bfee885d7 100644
--- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs
+++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs
@@ -309,7 +309,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -448,7 +448,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -639,7 +639,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -733,7 +733,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = (int)Math.Round(npc.GetProjectileDamage(type) * 0.75);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -844,7 +844,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -1268,7 +1268,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -1416,7 +1416,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -1598,7 +1598,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -1798,7 +1798,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -1949,7 +1949,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert;
double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert;
@@ -2203,7 +2203,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic;
double secondMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic;
@@ -2344,7 +2344,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic;
double secondMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic;
@@ -2524,7 +2524,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic;
double secondMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic;
@@ -2615,7 +2615,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = (int)Math.Round(npc.GetProjectileDamage(type) * 0.75);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic;
double secondMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic;
@@ -2863,7 +2863,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic;
double secondMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic;
@@ -3001,7 +3001,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic;
double secondMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic;
@@ -3159,7 +3159,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int damage = npc.GetProjectileDamage(type);
// Reduce mech boss projectile damage depending on the new ore progression changes
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive)
{
double firstMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic;
double secondMechMultiplier = Main.expertMode ? CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic;
diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs
index 8b492036f8..ce447fe3be 100644
--- a/NPCs/Yharon/Yharon.cs
+++ b/NPCs/Yharon/Yharon.cs
@@ -197,7 +197,7 @@ namespace CalamityMod.NPCs.Yharon
float lifeRatio = NPC.life / (float)NPC.lifeMax;
// Stop rain
- if (CalamityConfig.Instance.BossesStopWeather)
+ if (CalamityServerConfig.Instance.BossesStopWeather)
CalamityMod.StopRain();
// Variables
@@ -2773,7 +2773,7 @@ namespace CalamityMod.NPCs.Yharon
else
color = drawColor;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 1; i < afterimageAmt; i += afterimageIncrement)
{
@@ -2822,7 +2822,7 @@ namespace CalamityMod.NPCs.Yharon
afterimageScale = 20f;
}
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int k = 0; k < additionalAfterimageAmt; k++)
{
@@ -2899,7 +2899,7 @@ namespace CalamityMod.NPCs.Yharon
blueGlowColor *= teleportGlowColorScaler;
}
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int l = 1; l < afterimageAmt; l += afterimageIncrement)
{
diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs
index 9f8a4c652f..eaa9d59dec 100644
--- a/Particles/GeneralParticleHandler.cs
+++ b/Particles/GeneralParticleHandler.cs
@@ -90,7 +90,7 @@ namespace CalamityMod.Particles
if (Main.gamePaused || Main.netMode == NetmodeID.Server || particles == null)
return;
- if (particles.Count >= CalamityConfig.Instance.ParticleLimit && !particle.Important)
+ if (particles.Count >= CalamityClientConfig.Instance.ParticleLimit && !particle.Important)
return;
particles.Add(particle);
@@ -239,7 +239,7 @@ namespace CalamityMod.Particles
if (Main.dedServ || particles == null)
return 0;
- return CalamityConfig.Instance.ParticleLimit - particles.Count();
+ return CalamityClientConfig.Instance.ParticleLimit - particles.Count();
}
///
diff --git a/Particles/VerticalSmear.png b/Particles/VerticalSmear.png
new file mode 100644
index 0000000000..74d237ccaa
Binary files /dev/null and b/Particles/VerticalSmear.png differ
diff --git a/Projectiles/BaseProjectiles/BaseMaceFlailProjectile.cs b/Projectiles/BaseProjectiles/BaseMaceFlailProjectile.cs
index ff5bc54ab3..44249a02b3 100644
--- a/Projectiles/BaseProjectiles/BaseMaceFlailProjectile.cs
+++ b/Projectiles/BaseProjectiles/BaseMaceFlailProjectile.cs
@@ -544,7 +544,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles
// By default, maces have afterimages when launched.
// This can still be disabled via config or set individually by the projectile.
// (Does not use utils due to set trail length conditions)
- if (CurrentFlailState == FlailState.LaunchingForward && CalamityConfig.Instance.Afterimages && AfterimageLength > 0)
+ if (CurrentFlailState == FlailState.LaunchingForward && CalamityClientConfig.Instance.Afterimages && AfterimageLength > 0)
{
Texture2D maceTex = TextureAssets.Projectile[Type].Value;
Vector2 drawOrigin = new Vector2(maceTex.Width * 0.5f, maceTex.Height * 0.5f);
diff --git a/Projectiles/Boss/HolySpear.cs b/Projectiles/Boss/HolySpear.cs
index 2cd2e6925c..8f1d475119 100644
--- a/Projectiles/Boss/HolySpear.cs
+++ b/Projectiles/Boss/HolySpear.cs
@@ -195,7 +195,7 @@ namespace CalamityMod.Projectiles.Boss
if (Projectile.spriteDirection == -1)
spriteEffects = SpriteEffects.FlipHorizontally;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 0; i < Projectile.oldPos.Length; i++)
{
diff --git a/Projectiles/Boss/YharonFireball.cs b/Projectiles/Boss/YharonFireball.cs
index aa5a68dc69..553a32d527 100644
--- a/Projectiles/Boss/YharonFireball.cs
+++ b/Projectiles/Boss/YharonFireball.cs
@@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Boss
int frameHeight = texture.Height / Main.projFrames[Projectile.type];
int frameY = frameHeight * Projectile.frame;
Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 0; i < Projectile.oldPos.Length; i++)
{
diff --git a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs
index 2ef6443d46..9cf0a0aff5 100644
--- a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs
+++ b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs
@@ -178,7 +178,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
Texture2D tex = TextureAssets.Projectile[Type].Value;
Color drawColor = Projectile.GetAlpha(lightColor);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 0; i < Projectile.oldPos.Length; i++)
{
diff --git a/Projectiles/Enemy/IceClasperEnemyProjectile.cs b/Projectiles/Enemy/IceClasperEnemyProjectile.cs
index f9c5b9df8e..05065edba3 100644
--- a/Projectiles/Enemy/IceClasperEnemyProjectile.cs
+++ b/Projectiles/Enemy/IceClasperEnemyProjectile.cs
@@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Enemy
public override bool PreDraw(ref Color lightColor)
{
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor);
return true;
diff --git a/Projectiles/Magic/VitriolicViperFang.cs b/Projectiles/Magic/VitriolicViperFang.cs
index 692d1cc032..b011911b30 100644
--- a/Projectiles/Magic/VitriolicViperFang.cs
+++ b/Projectiles/Magic/VitriolicViperFang.cs
@@ -1,6 +1,9 @@
-using CalamityMod.Buffs.DamageOverTime;
+using System;
+using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using ReLogic.Content;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -12,56 +15,61 @@ namespace CalamityMod.Projectiles.Magic
public new string LocalizationCategory => "Projectiles.Magic";
public override void SetStaticDefaults()
{
- ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10;
- ProjectileID.Sets.TrailingMode[Projectile.type] = 1;
+ ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15;
+ ProjectileID.Sets.TrailingMode[Projectile.type] = 2;
}
-
public override void SetDefaults()
{
Projectile.width = 16;
Projectile.height = 34;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Magic;
- Projectile.penetrate = 4;
- Projectile.timeLeft = 300;
+ Projectile.penetrate = 3;
+ Projectile.tileCollide = false;
+ Projectile.ignoreWater = true;
+ Projectile.timeLeft = 90;
+ Projectile.extraUpdates = 2;
Projectile.usesLocalNPCImmunity = true;
- Projectile.localNPCHitCooldown = 6;
+ Projectile.localNPCHitCooldown = 30 * Projectile.MaxUpdates;
}
public override void AI()
{
+ Projectile.velocity *= 0.96f;
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
- if (Projectile.penetrate == 0)
+ Projectile.alpha = (int)(255 * Utils.GetLerpValue(70, 0, Projectile.timeLeft, true));
+ if (Main.rand.NextBool(3) && Projectile.timeLeft <= 70)
{
- Projectile.alpha += 4;
- if (Projectile.alpha >= 255)
- {
- Projectile.Kill();
- }
+ Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(8, 8), Main.rand.NextBool(6) ? 215 : (int)CalamityDusts.SulphurousSeaAcid);
+ dust.noGravity = true;
+ dust.scale = Main.rand.NextFloat(0.9f, 1.3f) * Utils.GetLerpValue(255, 0, Projectile.alpha);
+ dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.7f);
}
}
public override void OnKill(int timeLeft)
{
- for (int i = 0; i < 10; i++)
- {
- Dust dust = Dust.NewDustDirect(Projectile.position, 10, 10, (int)CalamityDusts.SulphurousSeaAcid);
- dust.noGravity = true;
- }
+
}
public override bool PreDraw(ref Color lightColor)
{
- CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2);
- return false;
+ Asset tex = ModContent.Request(Texture);
+
+ for (int i = 0; i < 3; i++)
+ {
+ Color auraColor = Color.Lerp(Color.Chartreuse, Color.Lime, Utils.GetLerpValue(0, 3, i)) * 0.5f;
+ Vector2 rotationalDrawOffset = (MathHelper.TwoPi * i / 7f + Main.GlobalTimeWrappedHourly * 27f).ToRotationVector2();
+ rotationalDrawOffset *= MathHelper.Lerp(3f, 5.25f, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 15f) * 0.5f + 0.5f);
+ Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + rotationalDrawOffset, null, auraColor with { A = 0 } * Utils.GetLerpValue(255, 0, Projectile.alpha), Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None);
+ }
+
+ CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor * 0.5f, 2);
+ return true;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType(), 180);
}
-
- public override void OnHitPlayer(Player target, Player.HurtInfo info)
- {
- target.AddBuff(ModContent.BuffType(), 180);
- }
+ public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 35, targetHitbox);
}
}
diff --git a/Projectiles/Magic/VitriolicViperHoldout.cs b/Projectiles/Magic/VitriolicViperHoldout.cs
new file mode 100644
index 0000000000..e969041603
--- /dev/null
+++ b/Projectiles/Magic/VitriolicViperHoldout.cs
@@ -0,0 +1,237 @@
+using System;
+using CalamityMod.Dusts;
+using CalamityMod.Items.Weapons.Magic;
+using CalamityMod.Particles;
+using CalamityMod.Projectiles.BaseProjectiles;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using ReLogic.Utilities;
+using Terraria;
+using Terraria.Audio;
+using Terraria.GameContent;
+using Terraria.ModLoader;
+
+namespace CalamityMod.Projectiles.Magic
+{
+ internal class VitriolicViperHoldout : BaseGunHoldoutProjectile
+ {
+ public override int AssociatedItemID => ModContent.ItemType();
+ public override float MaxOffsetLengthFromArm => 40f;
+ public override float BaseOffsetY => 0f;
+ public override float RecoilResolveSpeed => 0.4f;
+ public override string Texture => "CalamityMod/Items/Weapons/Magic/VitriolicViper";
+ public override Vector2 GunTipPosition => base.GunTipPosition - Vector2.UnitX.RotatedBy(Projectile.rotation) * -20;
+
+ private ref float CurrentChargingFrames => ref Projectile.ai[0];
+ private ref float CurrentOverchargeFrames => ref Projectile.ai[2];
+ public int FirstChargeFrames = 30;
+ public int FullyChargedFrames = 30;
+ private bool FirstCharge => CurrentChargingFrames >= FirstChargeFrames;
+ private bool FullCharge => CurrentOverchargeFrames >= FullyChargedFrames;
+ public SlotId ChargeSlot;
+ public static float BulletSpeed = 15f;
+ public int time = 0;
+ public float chargePower = 0;
+ public float overchargePower = 0;
+ public Color bColor = Color.Chartreuse; // Base color
+
+ public float vortexRotation = 0;
+
+ public override void KillHoldoutLogic()
+ {
+ if (Owner.CantUseHoldout(false) || HeldItem.type != Owner.ActiveItem().type)
+ Projectile.Kill();
+ }
+
+ public override void HoldoutAI()
+ {
+ if (SoundEngine.TryGetActiveSound(ChargeSlot, out var ChargeSound) && ChargeSound.IsPlaying)
+ ChargeSound.Position = Projectile.Center;
+
+ chargePower = Utils.GetLerpValue(0, FirstChargeFrames, CurrentChargingFrames, true) * (FullCharge ? 1.3f : 1);
+ if (CurrentOverchargeFrames < FullyChargedFrames)
+ overchargePower = MathHelper.Clamp(Utils.GetLerpValue(FullyChargedFrames * 2, 0, CurrentOverchargeFrames, true), 0.5f, 1);
+ else
+ overchargePower = MathHelper.Lerp(overchargePower, 1, 0.09f);
+
+ vortexRotation += 0.4f * chargePower;
+
+ // Fire if the owner stops channeling or otherwise cannot use the weapon.
+ if (Owner.CantUseHoldout())
+ {
+ KeepRefreshingLifetime = false;
+
+ if (Projectile.ai[1] != 1f)
+ {
+ Projectile.timeLeft = 30;
+
+ ChargeSound?.Stop();
+
+ Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed;
+ if (FullCharge)
+ {
+ OffsetLengthFromArm -= 25;
+ SoundStyle fire = new("CalamityMod/Sounds/Item/ViperSpit");
+ SoundEngine.PlaySound(fire with { Pitch = -0.3f + Main.rand.NextFloat(-0.1f, 0.1f) + (FirstCharge ? 0.2f : 0) }, Projectile.Center);
+ SoundStyle fire2 = new("CalamityMod/Sounds/Item/MeldShoot");
+ SoundEngine.PlaySound(fire2 with { Pitch = -0.3f, Volume = 0.5f }, Projectile.Center);
+
+ // Vipers can apparently have 33 teeth or something like that
+ Owner.Calamity().GeneralScreenShakePower = 4f;
+ for (int i = 0; i < 33; i++)
+ {
+ Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, (shootVelocity * 2).RotatedByRandom(0.5f) * Main.rand.NextFloat(0.8f, 1.2f), ModContent.ProjectileType(), Projectile.damage / 10, Projectile.knockBack, Projectile.owner, 0);
+ }
+
+ Particle pulse = new CustomPulse(GunTipPosition, Vector2.Zero, bColor, "CalamityMod/Particles/HighResFoggyCircleHardEdge", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.05f, 14);
+ GeneralParticleHandler.SpawnParticle(pulse);
+
+ for (int i = 0; i < 17; i++)
+ {
+ Dust chargefull = Dust.NewDustPerfect(GunTipPosition, 278);
+ chargefull.velocity = Projectile.velocity.RotatedByRandom(0.4f) * Main.rand.NextFloat(5, 25);
+ chargefull.scale = Main.rand.NextFloat(0.45f, 0.75f);
+ chargefull.noGravity = true;
+ chargefull.color = Color.Lerp(Color.White, Main.rand.NextBool(4) ? Color.Green : bColor, 0.7f);
+ }
+
+ Vector2 shootDirection = Projectile.velocity.SafeNormalize(Vector2.Zero);
+ for (int i = 0; i <= 18; i++)
+ {
+ Vector2 sparkVelocity = shootVelocity / 2f;
+
+ float sparkScale1 = Main.rand.NextFloat(0.3f, 0.8f);
+ Vector2 sparkvelocity1 = sparkVelocity.RotatedByRandom(0.45f) * Main.rand.NextFloat(0.5f, 0.7f);
+ Particle spark1 = new LineParticle(GunTipPosition, sparkvelocity1, false, 40, sparkScale1, Main.rand.NextBool() ? bColor : Color.Green);
+ GeneralParticleHandler.SpawnParticle(spark1);
+
+ float sparkScale2 = Main.rand.NextFloat(0.4f, 1f);
+ Vector2 sparkvelocity2 = sparkVelocity.RotatedByRandom(0.2f) * Main.rand.NextFloat(0.9f, 1.6f);
+ Particle spark2 = new LineParticle(GunTipPosition, sparkvelocity2, false, 40, sparkScale2, Main.rand.NextBool() ? bColor : Color.Green);
+ GeneralParticleHandler.SpawnParticle(spark2);
+ }
+ }
+ else
+ {
+ OffsetLengthFromArm -= 15;
+ SoundStyle fire = new("CalamityMod/Sounds/Item/ViperSpit");
+ SoundEngine.PlaySound(fire with { Pitch = (chargePower * 0.3f) + Main.rand.NextFloat(-0.1f, 0.1f), Volume = 0.5f }, Projectile.Center);
+
+ Projectile hiss = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity * MathHelper.Clamp(chargePower, 0.3f, 1), ModContent.ProjectileType(), (int)(Projectile.damage * MathHelper.Clamp(chargePower, 0.3f, 1)), Projectile.knockBack, Projectile.owner, 0, 0, chargePower);
+ hiss.extraUpdates = (int)(Utils.Remap(chargePower, 0, 1, 2, 13, true));
+ for (int i = 0; i < 17; i++)
+ {
+ Dust chargefull = Dust.NewDustPerfect(GunTipPosition, 278);
+ chargefull.velocity = Projectile.velocity.RotatedByRandom(0.4f) * Main.rand.NextFloat(5, 25);
+ chargefull.scale = Main.rand.NextFloat(0.55f, 0.75f) * chargePower + 0.1f;
+ chargefull.noGravity = true;
+ chargefull.color = Color.Lerp(Color.White, Main.rand.NextBool(4) ? Color.Green : bColor, 0.7f);
+ }
+
+ Vector2 shootDirection = Projectile.velocity.SafeNormalize(Vector2.Zero);
+ Particle pulse3 = new GlowSparkParticle(GunTipPosition, shootDirection * 18, false, 6, 0.057f * chargePower, bColor, new Vector2(1.7f, 0.8f), true);
+ GeneralParticleHandler.SpawnParticle(pulse3);
+ }
+ Projectile.ai[1] = 1f;
+ }
+ }
+ else
+ {
+ if (Projectile.ai[1] != 1f)
+ {
+ if (!FirstCharge)
+ CurrentChargingFrames++;
+ else
+ CurrentOverchargeFrames++;
+ }
+
+ // Charge-up visuals
+ if (CurrentChargingFrames >= 10)
+ {
+ if (FirstCharge)
+ {
+ for (int i = 0; i < 2; i++)
+ {
+ Vector2 dustPos = GunTipPosition + (i * MathHelper.Pi + vortexRotation * 0.35f + MathHelper.PiOver2).ToRotationVector2() * 20f * chargePower * overchargePower;
+ Dust dust = Dust.NewDustPerfect(dustPos, (int)CalamityDusts.SulphurousSeaAcid, (i * MathHelper.Pi + vortexRotation * 0.35f * Math.Sign(Projectile.velocity.Length())).ToRotationVector2() * 4);
+ dust.noGravity = true;
+ dust.scale = Main.rand.NextFloat(0.85f, 0.9f);
+ }
+ }
+ else
+ {
+ Dust dust = Dust.NewDustPerfect(GunTipPosition, (int)CalamityDusts.SulphurousSeaAcid, new Vector2(12, 12).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f) * chargePower * overchargePower);
+ dust.noGravity = true;
+ dust.scale = Main.rand.NextFloat(0.6f, 0.7f);
+ }
+ }
+
+ // Full charge effects
+ if (CurrentChargingFrames == FirstChargeFrames && CurrentOverchargeFrames == 0)
+ {
+ SoundStyle fire = new("CalamityMod/Sounds/NPCHit/NuclearTerrorHit");
+ SoundEngine.PlaySound(fire with { Volume = 1f, Pitch = -0.2f }, Projectile.Center);
+ for (int i = 0; i < 18; i++)
+ {
+ Vector2 dustVel = Vector2.One.RotatedByRandom(100) * Main.rand.NextFloat(1, 5);
+ Dust dust2 = Dust.NewDustPerfect(GunTipPosition + dustVel, 278, dustVel * 0.7f);
+ dust2.scale = Main.rand.NextFloat(0.45f, 0.9f);
+ dust2.noGravity = true;
+ dust2.color = Color.Lerp(Color.White, Main.rand.NextBool(4) ? bColor : Color.Green, 0.7f);
+ }
+ }
+ if (CurrentOverchargeFrames == FullyChargedFrames)
+ {
+ SoundStyle fire = new("CalamityMod/Sounds/NPCHit/NuclearTerrorHit");
+ SoundEngine.PlaySound(fire with { Volume = 1f, Pitch = 0.2f }, Projectile.Center);
+ for (int i = 0; i < 12; i++)
+ {
+ Dust dust2 = Dust.NewDustPerfect(GunTipPosition, 278, Vector2.One.RotatedByRandom(100) * Main.rand.NextFloat(2f, 5.5f));
+ dust2.scale = Main.rand.NextFloat(0.75f, 1.1f);
+ dust2.noGravity = false;
+ dust2.color = Color.Lerp(Color.White, Main.rand.NextBool(4) ? Color.Green : bColor, 0.7f);
+ }
+ }
+ }
+ if (Projectile.ai[1] == 1f)
+ {
+ CurrentChargingFrames = 0;
+ CurrentOverchargeFrames = 0;
+ }
+
+ Lighting.AddLight(GunTipPosition, bColor.ToVector3() * 1.5f * chargePower);
+
+ time++;
+ }
+
+ public override void OnKill(int timeLeft)
+ {
+ if (SoundEngine.TryGetActiveSound(ChargeSlot, out var ChargeSound))
+ ChargeSound?.Stop();
+ }
+
+ public override bool PreDraw(ref Color lightColor)
+ {
+ if (time < 2)
+ return false;
+
+ Texture2D texture = TextureAssets.Projectile[Type].Value;
+ Vector2 drawPosition = Projectile.Center - Main.screenPosition;
+ float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f);
+ Vector2 rotationPoint = texture.Size() * 0.5f;
+ SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
+
+ Texture2D rechargeTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleVortex").Value;
+
+ // Glow Orb
+ for (int i = 0; i < 3; i++)
+ Main.EntitySpriteDraw(rechargeTexture, GunTipPosition - Main.screenPosition, null, Color.Chartreuse with { A = 0 } * 0.4f, vortexRotation * (i * 0.3f), rechargeTexture.Size() * 0.5f, (0.5f * 0.14f + i * 0.015f) * chargePower * overchargePower, SpriteEffects.None, 0);
+
+ Main.EntitySpriteDraw(rechargeTexture, GunTipPosition - Main.screenPosition, null, Color.White with { A = 0 } * chargePower, vortexRotation, rechargeTexture.Size() * 0.5f, 0.25f * chargePower * 0.14f * overchargePower, SpriteEffects.None, 0);
+
+ // Main staff
+ Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), drawRotation + (MathHelper.ToRadians(45f * (Projectile.spriteDirection))), rotationPoint, Projectile.scale * Owner.gravDir, flipSprite);
+ return false;
+ }
+ }
+}
diff --git a/Projectiles/Magic/VitriolicViperSpit.cs b/Projectiles/Magic/VitriolicViperSpit.cs
index 5006073273..6e3dae08c5 100644
--- a/Projectiles/Magic/VitriolicViperSpit.cs
+++ b/Projectiles/Magic/VitriolicViperSpit.cs
@@ -1,6 +1,10 @@
-using CalamityMod.Buffs.DamageOverTime;
+using System;
+using CalamityMod.Buffs.DamageOverTime;
+using CalamityMod.Dusts;
+using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
+using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
@@ -9,37 +13,75 @@ namespace CalamityMod.Projectiles.Magic
public class VitriolicViperSpit : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Magic";
+ public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
+ public int time = 0;
+ public int direction = 0;
public override void SetDefaults()
{
Projectile.width = 16;
Projectile.height = 26;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Magic;
- Projectile.penetrate = 1;
- Projectile.timeLeft = 300;
+ Projectile.penetrate = -1;
+ Projectile.tileCollide = false;
+ Projectile.ignoreWater = true;
+ Projectile.extraUpdates = 13;
+ Projectile.usesLocalNPCImmunity = true;
+ Projectile.timeLeft = 300 * Projectile.MaxUpdates;
+ Projectile.localNPCHitCooldown = -1;
}
public override void AI()
{
- Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
- }
- public override void OnKill(int timeLeft)
- {
- for (int i = 0; i < 14; i++)
+ Player Owner = Main.player[Projectile.owner];
+ float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
+
+ float sine = (float)Math.Sin(Projectile.timeLeft * 0.575f / MathHelper.Pi);
+
+ Vector2 offset = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * sine * 4.5f * MathHelper.Clamp(Projectile.ai[2], 0.25f, 1f);
+
+ if (time == 0)
{
- Dust dust = Dust.NewDustDirect(Projectile.position, 10, 10, DustID.Shadowflame);
- dust.noGravity = true;
+ direction = Main.rand.NextBool() ? 1 : -1;
}
- }
- public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
- {
- target.AddBuff(ModContent.BuffType(), 60);
- }
+ if (time > 3)
+ Projectile.Center += offset * direction;
- public override void OnHitPlayer(Player target, Player.HurtInfo info)
- {
- target.AddBuff(ModContent.BuffType(), 60);
+ if (time > 3 && targetDist < 1400)
+ {
+ Particle spark = new GlowSparkParticle(Projectile.Center, -Projectile.velocity * 0.3f, false, (int)(15 * MathHelper.Clamp(Projectile.ai[2], 0.5f, 1f)), 0.07f * MathHelper.Clamp(Projectile.ai[2], 0.25f, 1f), Color.Chartreuse, new Vector2(1, 0.7f), false, true);
+ GeneralParticleHandler.SpawnParticle(spark);
+
+ if (Main.rand.NextBool((int)(MathHelper.Clamp((1 - Projectile.ai[2]) * 5, 1, 15))))
+ {
+ int area = (int)(25 * MathHelper.Clamp(Projectile.ai[2], 0.5f, 1f));
+ Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(area, area), (int)CalamityDusts.SulphurousSeaAcid);
+ dust.noGravity = true;
+ dust.scale = Main.rand.NextFloat(0.9f, 1.3f);
+ dust.velocity = Projectile.velocity.RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 0.7f);
+ }
+ }
+ time++;
}
+ public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
+ {
+ target.AddBuff(ModContent.BuffType(), 230);
+
+ SoundStyle fire = new("CalamityMod/Sounds/NPCHit/NuclearTerrorHit");
+ SoundEngine.PlaySound(fire with { Volume = 0.5f, Pitch = 0.7f }, Projectile.Center);
+
+ for (int i = 0; i < (MathHelper.Clamp(6 - Projectile.numHits * 2, 1, 10)); i++)
+ {
+ DirectionalPulseRing pulse = new DirectionalPulseRing(target.Center, Projectile.velocity.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.2f, 1), Main.rand.NextBool() ? Color.Chartreuse : Color.GreenYellow, new Vector2(1f, 1), 0, Main.rand.NextFloat(0.28f, 0.44f) * MathHelper.Clamp(Projectile.ai[2], 0.5f, 1f), 0f, 50);
+ GeneralParticleHandler.SpawnParticle(pulse);
+ }
+
+ if (Projectile.numHits > 0)
+ Projectile.damage = (int)(Projectile.damage * 0.9f);
+ if (Projectile.damage < 1)
+ Projectile.damage = 1;
+ }
+ public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 60 * MathHelper.Clamp(Projectile.ai[2], 0.25f, 1f), targetHitbox);
}
}
diff --git a/Projectiles/Magic/VividExplosion.cs b/Projectiles/Magic/VividExplosion.cs
index 141dd92601..2ab46185d6 100644
--- a/Projectiles/Magic/VividExplosion.cs
+++ b/Projectiles/Magic/VividExplosion.cs
@@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Magic
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
- Projectile.DamageType = RogueDamageClass.Instance;
+ Projectile.DamageType = DamageClass.Magic;
Projectile.penetrate = -1;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 6;
diff --git a/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs b/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs
index 9e78cc627b..69c3d25b70 100644
--- a/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs
+++ b/Projectiles/Melee/ArkOfTheAncients_SwungBlade.cs
@@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Melee
Vector2 drawOrigin = new Vector2(Owner.direction < 0 ? sword.Width : 0f, sword.Height);
Vector2 drawOffset = Owner.Center + drawAngle.ToRotationVector2() * 10f - Main.screenPosition;
- if (CalamityConfig.Instance.Afterimages && Timer > ProjectileID.Sets.TrailCacheLength[Projectile.type])
+ if (CalamityClientConfig.Instance.Afterimages && Timer > ProjectileID.Sets.TrailCacheLength[Projectile.type])
{
for (int i = 0; i < Projectile.oldRot.Length; ++i)
{
diff --git a/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs b/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs
index 5b3bb7fb7e..7ef7023edc 100644
--- a/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs
+++ b/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs
@@ -489,7 +489,7 @@ namespace CalamityMod.Projectiles.Melee
Vector2 drawOrigin = new Vector2(flipped ? sword.Width : 0f, sword.Height);
Vector2 drawOffset = Owner.Center + drawAngle.ToRotationVector2() * 10f - Main.screenPosition;
- if (CalamityConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Projectile.type] && Combo == 0f)
+ if (CalamityClientConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Projectile.type] && Combo == 0f)
{
for (int i = 1; i < Projectile.oldRot.Length; ++i)
{
@@ -544,7 +544,7 @@ namespace CalamityMod.Projectiles.Melee
Vector2 backScissorDrawPosition = Owner.Center + drawAngle.ToRotationVector2() * 10f + (drawAngle.ToRotationVector2() * 56f + (drawAngle - MathHelper.PiOver2).ToRotationVector2() * 11 * Owner.direction) * Projectile.scale - Main.screenPosition; //Lined up with the hole in the front blade
- if (CalamityConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Projectile.type])
+ if (CalamityClientConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Projectile.type])
{
Texture2D afterimage = Request("CalamityMod/Projectiles/Melee/SunderingScissorsGlow").Value;
diff --git a/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs b/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs
index 6ad36b293e..7afe20cae8 100644
--- a/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs
+++ b/Projectiles/Melee/ArkOfTheElements_SwungBlade.cs
@@ -308,7 +308,7 @@ namespace CalamityMod.Projectiles.Melee
Vector2 drawOrigin = new Vector2(Combo == 1 ? sword.Width / 2f : flipped ? sword.Width : 0f, sword.Height);
Vector2 drawOffset = Owner.Center + drawAngle.ToRotationVector2() * 10f - Main.screenPosition;
- if (CalamityConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Projectile.type])
+ if (CalamityClientConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Projectile.type])
{
for (int i = 0; i < Projectile.oldRot.Length; ++i)
{
@@ -362,7 +362,7 @@ namespace CalamityMod.Projectiles.Melee
Vector2 backScissorDrawPosition = Owner.Center + drawAngle.ToRotationVector2() * 10f + functionalDrawAngle.ToRotationVector2() * 70f * Projectile.scale - Main.screenPosition; //Lined up with the hole in the front blade
float backScissorRotation = drawRotation + (Combo == 1 ? (!flipped ? MathHelper.PiOver4 * 0.75f : MathHelper.PiOver4 * -0.75f) : 0f);
- if (CalamityConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Projectile.type])
+ if (CalamityClientConfig.Instance.Afterimages && SwingTimer > ProjectileID.Sets.TrailCacheLength[Projectile.type])
{
for (int i = 0; i < Projectile.oldRot.Length; ++i)
{
diff --git a/Projectiles/Melee/Galaxia_PhoenixsPride.cs b/Projectiles/Melee/Galaxia_PhoenixsPride.cs
index dea78a8c39..3bb96e5877 100644
--- a/Projectiles/Melee/Galaxia_PhoenixsPride.cs
+++ b/Projectiles/Melee/Galaxia_PhoenixsPride.cs
@@ -286,7 +286,7 @@ namespace CalamityMod.Projectiles.Melee
Vector2 drawOffset = Projectile.Center - Main.screenPosition;
//Afterimages
- if (CalamityConfig.Instance.Afterimages && CurrentState == 0f && Empowerment / maxEmpowerment > 0.4f)
+ if (CalamityClientConfig.Instance.Afterimages && CurrentState == 0f && Empowerment / maxEmpowerment > 0.4f)
{
for (int i = 0; i < Projectile.oldRot.Length; ++i)
{
diff --git a/Projectiles/Melee/GayBeam.cs b/Projectiles/Melee/GayBeam.cs
index 243cf93949..fdfe26c180 100644
--- a/Projectiles/Melee/GayBeam.cs
+++ b/Projectiles/Melee/GayBeam.cs
@@ -340,7 +340,7 @@ namespace CalamityMod.Projectiles.Melee
Vector2 origin = rectangle.Size() / 2f;
Color alphaColor = Projectile.GetAlpha(lightColor);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
Vector2 centerOffset = Projectile.Size / 2f;
int totalAfterimages = TotalAfterimages;
diff --git a/Projectiles/Melee/InsidiousHarpoon.cs b/Projectiles/Melee/InsidiousHarpoon.cs
index dc2c3c4ba3..162c726b27 100644
--- a/Projectiles/Melee/InsidiousHarpoon.cs
+++ b/Projectiles/Melee/InsidiousHarpoon.cs
@@ -1,6 +1,11 @@
-using CalamityMod.Buffs.DamageOverTime;
+using System;
+using CalamityMod.Buffs.DamageOverTime;
+using CalamityMod.Dusts;
using CalamityMod.Items.Weapons.Melee;
+using CalamityMod.Particles;
using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
@@ -13,127 +18,179 @@ namespace CalamityMod.Projectiles.Melee
{
public new string LocalizationCategory => "Projectiles.Melee";
public override LocalizedText DisplayName => CalamityUtils.GetItemName();
+ public int time = 0;
+ public float fade = 0;
+
+ public int strongTimeMax = 60;
+ public int strongTimer = 0;
+
+ public bool isPowered = false;
+ public bool canBePowered = false;
+ public Vector2 storedVel = Vector2.Zero;
+ public NPC targetedNPC;
+ public bool hasHitTarget = false;
public override void SetStaticDefaults()
{
- ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8;
- ProjectileID.Sets.TrailingMode[Projectile.type] = 1;
+ ProjectileID.Sets.TrailCacheLength[Projectile.type] = 11;
+ ProjectileID.Sets.TrailingMode[Projectile.type] = 2;
}
public override void SetDefaults()
{
- Projectile.width = 20;
- Projectile.height = 20;
+ Projectile.width = 66;
+ Projectile.height = 70;
Projectile.friendly = true;
- Projectile.penetrate = 8;
- Projectile.alpha = 255;
+ Projectile.penetrate = -1;
Projectile.DamageType = DamageClass.MeleeNoSpeed;
- Projectile.scale = 1.3f;
Projectile.extraUpdates = 1;
Projectile.usesLocalNPCImmunity = true;
- Projectile.localNPCHitCooldown = 20 * Projectile.extraUpdates;
- Projectile.tileCollide = true;
+ Projectile.localNPCHitCooldown = 10 * Projectile.MaxUpdates;
+ Projectile.timeLeft = 600;
+ Projectile.alpha = 255;
+ Projectile.tileCollide = false;
}
public override void AI()
{
- if (Projectile.alpha > 0)
- {
- Projectile.alpha -= 25;
- }
- if (Projectile.alpha < 0)
+ Projectile.rotation = storedVel.ToRotation() + MathHelper.ToRadians(45f);
+
+ Player Owner = Main.player[Projectile.owner];
+ float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
+
+ if (time > 2)
{
+ if (!canBePowered)
+ canBePowered = true;
Projectile.alpha = 0;
+ if (fade < 1)
+ fade += 0.008f;
}
- if (Projectile.ai[0] == 0f)
- {
- Projectile.localAI[1] += 1f;
- if (Projectile.localAI[1] >= 60f)
- {
- Projectile.velocity.X *= 0.99f;
- Projectile.velocity.Y += 0.3f;
- if (Projectile.velocity.Y > 16f)
- Projectile.velocity.Y = 16f;
+ if (canBePowered && !isPowered)
+ {
+ Projectile.velocity *= 0.975f;
+ strongTimer++;
+ if (strongTimer >= strongTimeMax)
+ {
+ SoundStyle fire = new("CalamityMod/Sounds/Item/ImpalerLaunch");
+ SoundEngine.PlaySound(fire with { Volume = 0.8f, Pitch = Main.rand.NextFloat(0.2f, 0.3f) }, Projectile.Center);
+
+ targetedNPC = Projectile.Center.ClosestNPCAt(1200);
+ if (targetedNPC != null)
+ storedVel = (Projectile.Center - targetedNPC.Center).SafeNormalize(Vector2.UnitX) * -30;
+ Projectile.velocity = storedVel * 1.15f;
+ Particle pulse2 = new CustomPulse(Projectile.Center - storedVel * 3, -storedVel * 0.1f, Color.Chartreuse * 0.7f, "CalamityMod/Particles/DustyCircleHardEdge", new Vector2(0.4f, 1f), storedVel.ToRotation(), 0f, 0.13f, 25);
+ GeneralParticleHandler.SpawnParticle(pulse2);
+ Particle pulse = new CustomPulse(Projectile.Center - storedVel * 3, -storedVel * 0.2f, Color.Chartreuse * 0.7f, "CalamityMod/Particles/FlameExplosion", new Vector2(0.4f, 1f), storedVel.ToRotation(), 0f, 0.25f, 25);
+ GeneralParticleHandler.SpawnParticle(pulse);
+ Projectile.extraUpdates = 3;
+ strongTimer = 0;
+ isPowered = true;
}
}
-
- int dustType = 171;
- if (Main.rand.NextBool(3))
+ if (isPowered)
{
- dustType = 46;
- }
- if (Main.rand.NextBool(9))
- {
- Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, dustType, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f);
- }
- if (Projectile.ai[0] == 0f)
- {
- Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt();
- Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi);
- Projectile.rotation += Projectile.spriteDirection * MathHelper.ToRadians(45f);
- }
- //Sticky Behaviour
- Projectile.StickyProjAI(15);
- if (Projectile.ai[0] == 2f)
- {
- Projectile.velocity *= 0f;
- }
- }
-
- public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => Projectile.ModifyHitNPCSticky(20);
-
- public override bool OnTileCollide(Vector2 oldVelocity)
- {
- Projectile.ai[0] = 2f;
- Projectile.timeLeft = 300;
- return false;
- }
-
- public override void OnKill(int timeLeft)
- {
- int dustType = 171;
- if (Main.rand.NextBool(3))
- {
- dustType = 46;
- }
- SoundEngine.PlaySound(SoundID.Item14, Projectile.position);
- Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2);
- Projectile.position.Y = Projectile.position.Y + (float)(Projectile.height / 2);
- Projectile.width = 50;
- Projectile.height = 50;
- Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
- Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
- Projectile.Damage();
- for (int i = 0; i < 15; i++)
- {
- int deathDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 1.2f);
- Main.dust[deathDust].velocity *= 3f;
- if (Main.rand.NextBool())
+ if (targetDist < 1400)
{
- Main.dust[deathDust].scale = 0.5f;
- Main.dust[deathDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
+ if (Main.rand.NextBool(7))
+ {
+ Particle trail = new SparkParticle(Projectile.Center + Main.rand.NextVector2Circular(30, 30), -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.8f), false, 60, Main.rand.NextFloat(0.8f, 1.3f), Color.Chartreuse);
+ GeneralParticleHandler.SpawnParticle(trail);
+ }
+ if (time % 10 == 0)
+ {
+ Particle pulse2 = new CustomPulse(Projectile.Center - Projectile.velocity, Projectile.velocity * 0.1f, Color.Chartreuse, "CalamityMod/Particles/DustyCircleHardEdge", new Vector2(0.4f, 1.1f), Projectile.velocity.ToRotation(), 0f, 0.075f, 14);
+ GeneralParticleHandler.SpawnParticle(pulse2);
+ }
+
+ Particle spark = new GlowSparkParticle(Projectile.Center + Projectile.velocity * Main.rand.NextFloat(-2, -1), -Projectile.velocity * 0.3f, false, 6, 0.07f, Color.Lerp(Color.Green, Color.Chartreuse, 0.8f) * 0.65f, new Vector2(1, 0.3f), true, false, 1);
+ GeneralParticleHandler.SpawnParticle(spark);
+ }
+
+ targetedNPC = Projectile.Center.ClosestNPCAt(600);
+ if (targetedNPC != null && !hasHitTarget)
+ {
+ Vector2 position = targetedNPC.Center;
+ Vector2 moveToMouse = (position - Projectile.Center).SafeNormalize(Vector2.UnitX);
+ if (Projectile.velocity.Length() < 23)
+ Projectile.velocity += moveToMouse * 0.45f;
+ else
+ Projectile.velocity *= 0.9f;
+ }
+ else if (Projectile.velocity.Length() < 23)
+ Projectile.velocity *= 1.1f;
+ }
+ else if (Main.rand.NextBool(3))
+ {
+ Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(13, 13), Main.rand.NextBool(7) ? 28 : 215);
+ dust.noGravity = true;
+ dust.scale = Main.rand.NextFloat(0.9f, 1.3f);
+ dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.7f);
+ }
+ if (strongTimer == 0)
+ {
+ storedVel = Projectile.velocity;
+ }
+ if (Main.rand.NextBool(5))
+ {
+ Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(13, 13), (int)CalamityDusts.SulphurousSeaAcid);
+ dust.noGravity = true;
+ dust.scale = Main.rand.NextFloat(0.9f, 1.3f);
+ dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.7f);
+ }
+ time++;
+ }
+
+ public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
+ {
+ if (Projectile.numHits < 1)
+ {
+ canBePowered = true;
+ strongTimer = 1;
+ Particle pulse3 = new GlowSparkParticle(Projectile.Center, storedVel * 1.5f, false, 7, 0.057f, Color.Chartreuse, new Vector2(1.7f, 0.8f), true);
+ GeneralParticleHandler.SpawnParticle(pulse3);
+ for (int i = 0; i <= 15; i++)
+ {
+ Dust dust = Dust.NewDustPerfect(Projectile.Center, (int)CalamityDusts.SulphurousSeaAcid, storedVel.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.3f, 1.8f), 0, default, Main.rand.NextFloat(1.3f, 1.8f));
+ dust.noGravity = true;
+ }
+ if (!isPowered)
+ {
+ Projectile.velocity *= -1f;
+ SoundStyle fire = new("CalamityMod/Sounds/NPCHit/NuclearTerrorHit");
+ SoundEngine.PlaySound(fire with { Volume = 0.8f, Pitch = 0.7f }, Projectile.Center);
+ SoundStyle fir2e = new("CalamityMod/Sounds/NPCHit/PerfMediumHit2");
+ SoundEngine.PlaySound(fir2e with { Volume = 0.65f, Pitch = -0.6f }, Projectile.Center);
}
}
- for (int j = 0; j < 30; j++)
- {
- int deathDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 1.7f);
- Main.dust[deathDust2].noGravity = true;
- Main.dust[deathDust2].velocity *= 5f;
- deathDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 1f);
- Main.dust[deathDust2].velocity *= 2f;
- }
- }
+ target.AddBuff(ModContent.BuffType(), 180);
+ modifiers.SourceDamage *= isPowered ? 1.2f : 1f;
+ if (targetedNPC != null && target == targetedNPC)
+ hasHitTarget = true;
+ }
public override bool PreDraw(ref Color lightColor)
{
- CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2);
- return false;
- }
+ if (time < 7)
+ return false;
- public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
- {
- target.AddBuff(ModContent.BuffType(), 120);
- target.AddBuff(BuffID.Venom, 60);
+ Asset tex = ModContent.Request(Texture);
+
+ if (isPowered || canBePowered)
+ {
+ for (int i = 0; i < 3; i++)
+ {
+ Color auraColor = Color.Lerp(Color.Chartreuse, Color.Lime, Utils.GetLerpValue(0, 3, i)) * 0.7f * fade;
+ Vector2 rotationalDrawOffset = (MathHelper.TwoPi * i / 7f + Main.GlobalTimeWrappedHourly * 27f).ToRotationVector2();
+ rotationalDrawOffset *= MathHelper.Lerp(3f, 5.25f, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 15f) * 0.5f + (isPowered ? 1.5f : 4.5f * Utils.GetLerpValue(0, strongTimeMax, strongTimer)));
+ Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + rotationalDrawOffset, null, auraColor with { A = 0 }, storedVel.ToRotation() + MathHelper.ToRadians(45f), tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None);
+ }
+ }
+
+ if (!isPowered)
+ CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2);
+ return true;
}
+ public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 40, targetHitbox);
}
}
diff --git a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs
index 10dbf2ddde..719e2b7024 100644
--- a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs
+++ b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs
@@ -215,7 +215,7 @@ namespace CalamityMod.Projectiles.Melee
Vector2 drawOffset = Projectile.Center - Main.screenPosition;
//Afterimages
- if (CalamityConfig.Instance.Afterimages && CurrentState == 0f && Empowerment / maxEmpowerment > 0.4f)
+ if (CalamityClientConfig.Instance.Afterimages && CurrentState == 0f && Empowerment / maxEmpowerment > 0.4f)
{
for (int i = 0; i < Projectile.oldRot.Length; ++i)
{
diff --git a/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs
index e3b784cf55..dbf5921c89 100644
--- a/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs
+++ b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs
@@ -133,7 +133,7 @@ namespace CalamityMod.Projectiles.Melee
Vector2 drawOrigin = new Vector2(Owner.direction < 0 ? sword.Width : 0f, sword.Height);
Vector2 drawOffset = Owner.Center + drawAngle.ToRotationVector2() * 10f - Main.screenPosition;
- if (CalamityConfig.Instance.Afterimages && Timer > ProjectileID.Sets.TrailCacheLength[Projectile.type])
+ if (CalamityClientConfig.Instance.Afterimages && Timer > ProjectileID.Sets.TrailCacheLength[Projectile.type])
{
for (int i = 0; i < Projectile.oldRot.Length; ++i)
{
diff --git a/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs b/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs
index 8c8351f8f7..6404dc74ae 100644
--- a/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs
+++ b/Projectiles/Melee/TrueBiomeBlade_SwordsmithsPride.cs
@@ -310,7 +310,7 @@ namespace CalamityMod.Projectiles.Melee
drawOrigin = new Vector2(0f, blade.Height);
//Afterimages
- if (CalamityConfig.Instance.Afterimages && CurrentState == 0f && Empowerment / maxEmpowerment > 0.4f)
+ if (CalamityClientConfig.Instance.Afterimages && CurrentState == 0f && Empowerment / maxEmpowerment > 0.4f)
{
for (int i = 0; i < Projectile.oldRot.Length; ++i)
{
diff --git a/Projectiles/Ranged/BuzzkillHoldout.cs b/Projectiles/Ranged/BuzzkillHoldout.cs
index a0e818b0f7..44db5dd77a 100644
--- a/Projectiles/Ranged/BuzzkillHoldout.cs
+++ b/Projectiles/Ranged/BuzzkillHoldout.cs
@@ -239,7 +239,7 @@ namespace CalamityMod.Projectiles.Ranged
if (Time / ChargeupTime >= 0.25f)
Main.EntitySpriteDraw(smallSlashTexture, GunTipPosition - Main.screenPosition, null, slashColor, Time * MathHelper.ToRadians(42f), smallSlashTexture.Size() * 0.5f, 1f, SpriteEffects.None);
- if (!CalamityConfig.Instance.Afterimages)
+ if (!CalamityClientConfig.Instance.Afterimages)
return false;
// Special afterimage drawing for the slashes only
diff --git a/Projectiles/Ranged/BuzzkillSaw.cs b/Projectiles/Ranged/BuzzkillSaw.cs
index c4ef59e32b..be7825b949 100644
--- a/Projectiles/Ranged/BuzzkillSaw.cs
+++ b/Projectiles/Ranged/BuzzkillSaw.cs
@@ -189,7 +189,7 @@ namespace CalamityMod.Projectiles.Ranged
}
}
- if (!CalamityConfig.Instance.Afterimages)
+ if (!CalamityClientConfig.Instance.Afterimages)
return true;
// Special afterimage drawing to include the slashes
diff --git a/Projectiles/Ranged/EmesisGore.cs b/Projectiles/Ranged/EmesisGore.cs
index 05d52851f7..7e23091bf4 100644
--- a/Projectiles/Ranged/EmesisGore.cs
+++ b/Projectiles/Ranged/EmesisGore.cs
@@ -1,6 +1,7 @@
using System;
using System.IO;
using CalamityMod.Buffs.DamageOverTime;
+using CalamityMod.Dusts;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -47,14 +48,17 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.alpha = (int)(Utils.Remap(Projectile.timeLeft, 70, 0, 0, 255, true));
if (targetDist < 1400f && Projectile.timeLeft > 70 && Projectile.timeLeft < 790)
{
- if (Projectile.timeLeft % 6 == 0)
+ if (Projectile.timeLeft % 5 == 0)
{
- Particle spark = new LineParticle(Projectile.Center - Projectile.velocity + Main.rand.NextVector2Circular(20, 20), -Projectile.velocity * Main.rand.NextFloat(0.2f, 1.8f), false, Main.rand.Next(9, 20 + 1), Main.rand.NextFloat(0.8f, 1.2f), Color.Chartreuse * Main.rand.NextFloat(0.15f, 0.5f));
+ //Particle spark = new LineParticle(Projectile.Center - Projectile.velocity + Main.rand.NextVector2Circular(20, 20), -Projectile.velocity * Main.rand.NextFloat(0.2f, 1.8f), false, Main.rand.Next(9, 20 + 1), Main.rand.NextFloat(0.8f, 1.2f), Color.Chartreuse * Main.rand.NextFloat(0.15f, 0.5f));
+ //GeneralParticleHandler.SpawnParticle(spark);
+
+ Particle spark = new GlowSparkParticle(Projectile.Center + Projectile.velocity * Main.rand.NextFloat(-2, -1), -Projectile.velocity * 0.3f, false, 6, 0.07f, Color.Lerp(Color.Green, Color.Chartreuse, 0.8f) * 0.5f, new Vector2(1, 0.3f), true, false, 1);
GeneralParticleHandler.SpawnParticle(spark);
}
- if (Main.rand.NextBool(6))
+ if (Main.rand.NextBool(5))
{
- Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), 75, -Projectile.velocity.RotatedByRandom(0.1) * Main.rand.NextFloat(0.1f, 0.3f), 0, default, Main.rand.NextFloat(0.5f, 1.2f));
+ Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(20, 20), Main.rand.NextBool(4) ? 215 : (int)CalamityDusts.SulphurousSeaAcid, -Projectile.velocity.RotatedByRandom(0.1) * Main.rand.NextFloat(0.1f, 0.3f), 0, default, Main.rand.NextFloat(0.5f, 1.2f));
dust.noGravity = true;
}
}
diff --git a/Projectiles/Ranged/HellbornHoldout.cs b/Projectiles/Ranged/HellbornHoldout.cs
new file mode 100644
index 0000000000..5d41469ad0
--- /dev/null
+++ b/Projectiles/Ranged/HellbornHoldout.cs
@@ -0,0 +1,230 @@
+using System;
+using CalamityMod.Items.Weapons.Ranged;
+using CalamityMod.Particles;
+using CalamityMod.Projectiles.BaseProjectiles;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using ReLogic.Utilities;
+using Terraria;
+using Terraria.Audio;
+using Terraria.ID;
+using Terraria.ModLoader;
+
+namespace CalamityMod.Projectiles.Ranged
+{
+ public class HellbornHoldout : BaseGunHoldoutProjectile
+ {
+ public override int AssociatedItemID => ModContent.ItemType();
+ public override float MaxOffsetLengthFromArm => 24f;
+ public override float OffsetXUpwards => -5f;
+ public override float BaseOffsetY => -5f;
+ public override float OffsetYDownwards => 5f;
+ public override float RecoilResolveSpeed => 0.5f;
+
+ public ref float time => ref Projectile.ai[0];
+ public float cooldownTimer = 0;
+ public bool onCooldown => cooldownTimer > 0;
+ public SlotId SoundSlot;
+
+ public bool Spinning => Projectile.ai[2] == 0;
+ public bool failedShot = false;
+ public float drawRot = 0;
+ public bool hasPlayedSound = false;
+ public bool hasPlayedReloadSound = false;
+ public float fade = 0;
+
+ public override void SetStaticDefaults()
+ {
+ ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12;
+ ProjectileID.Sets.TrailingMode[Projectile.type] = 2;
+ }
+ public override void SetDefaults()
+ {
+ Projectile.width = 62;
+ Projectile.height = 34;
+ Projectile.penetrate = -1;
+ Projectile.friendly = true;
+ Projectile.DamageType = DamageClass.Ranged;
+ Projectile.usesLocalNPCImmunity = true;
+ Projectile.localNPCHitCooldown = 4;
+ Projectile.tileCollide = false;
+ Projectile.ArmorPenetration = 25;
+ }
+ public override void HoldoutAI()
+ {
+ fade = Utils.GetLerpValue(0, 40, time, true);
+ if (SoundEngine.TryGetActiveSound(SoundSlot, out var sSound) && sSound.IsPlaying)
+ {
+ sSound.Volume = fade * 100 * 0.5f;
+ sSound.Position = Projectile.Center;
+ }
+
+ if (onCooldown)
+ {
+ PostFiringCooldown();
+ if (!Spinning)
+ return;
+ }
+ if (Spinning)
+ {
+ float armRot = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f);
+ float spinArmRot = (((Projectile.Center + new Vector2(0, -3).RotatedBy(drawRot * 0.6f)) - Owner.Center).SafeNormalize(Vector2.UnitX) * 5).ToRotation();
+ Owner.SetCompositeArmBack(true, FrontArmStretch, armRot + 0.6f * Projectile.direction);
+ Owner.SetCompositeArmFront(true, BackArmStretch, spinArmRot + MathHelper.ToRadians(-90f));
+ }
+ if (time > 3)
+ {
+ if (Spinning)
+ {
+ if (Owner.CantUseHoldout())
+ {
+ Projectile.Kill();
+ sSound?.Stop();
+ }
+ else
+ {
+ OffsetLengthFromArm = MathHelper.Lerp(OffsetLengthFromArm, 9, 0.5f);
+ drawRot += 0.75f * Projectile.direction * MathHelper.Clamp(fade, 0.3f, 1f);
+
+ Lighting.AddLight(Projectile.Center, Color.Lerp(Color.OrangeRed, Color.White, 0.6f).ToVector3() * fade * 0.7f);
+ if (!hasPlayedSound)
+ {
+ SoundStyle spin = new("CalamityMod/Sounds/Item/SpinningWoosh");
+ SoundSlot = SoundEngine.PlaySound(spin with { Volume = 0.01f, Pitch = -0.1f, IsLooped = true }, Projectile.Center);
+ hasPlayedSound = true;
+ }
+
+ Particle Smear = new CircularSmearVFX(Projectile.Center, Color.Red * Main.rand.NextFloat(0.45f, 0.6f), Main.rand.NextFloat(-8, 8), Main.rand.NextFloat(1.13f, 1.25f) * fade);
+ GeneralParticleHandler.SpawnParticle(Smear);
+
+ Particle Smear2 = new CircularSmearVFX(Projectile.Center, Color.OrangeRed * Main.rand.NextFloat(0.45f, 0.6f), Main.rand.NextFloat(-8, 8), Main.rand.NextFloat(0.65f, 0.72f) * fade);
+ GeneralParticleHandler.SpawnParticle(Smear2);
+
+ if (Main.rand.NextBool() && fade > 0.2f)
+ {
+ for (int i = 0; i < 2; i++)
+ {
+ Vector2 dustPos = Projectile.Center + (i * MathHelper.Pi + drawRot * 0.25f + MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.5f) * 35f * fade;
+ Dust dust = Dust.NewDustPerfect(dustPos, 278, (i * MathHelper.Pi + (drawRot * Projectile.direction) * 0.25f * Math.Sign(Projectile.velocity.X)).ToRotationVector2().RotatedBy(MathHelper.ToRadians(180f) * (Projectile.direction == 1 ? 0 : 1)) * -3f * Main.rand.NextFloat(0.5f, 1f) * fade);
+ dust.noGravity = true;
+ dust.scale = Main.rand.NextFloat(0.42f, 0.62f);
+ dust.color = Color.Lerp(Color.Orange, Color.Red, Main.rand.NextFloat(0f, 1f));
+
+ }
+ }
+ else if (fade > 0.2f)
+ {
+ for (int i = 0; i < 3; i++)
+ {
+ Vector2 dustPos = Projectile.Center + (i * MathHelper.Pi + drawRot * 0.5f + MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.5f) * 87f * fade;
+ Dust dust = Dust.NewDustPerfect(dustPos, 267, (i * MathHelper.Pi + (drawRot * Projectile.direction) * 0.5f * Math.Sign(Projectile.velocity.X)).ToRotationVector2().RotatedBy(MathHelper.ToRadians(180f) * (Projectile.direction == 1 ? 0 : 1)) * -7f * Main.rand.NextFloat(0.5f, 1f) * fade);
+ dust.noGravity = true;
+ dust.scale = Main.rand.NextFloat(0.62f, 0.82f);
+ dust.color = Color.Lerp(Color.Orange, Color.Red, Main.rand.NextFloat(0f, 1f));
+ }
+ }
+ }
+ }
+ else if (!onCooldown)
+ {
+ if (Owner.Calamity().hellbornShots > 0)
+ {
+ Owner.Calamity().GeneralScreenShakePower = 5f;
+ OffsetLengthFromArm -= 35f;
+ cooldownTimer = Owner.itemAnimationMax * 2;
+ Owner.Calamity().hellbornShots--;
+ SoundStyle bigShot = new("CalamityMod/Sounds/Item/HellbornShoot");
+ SoundEngine.PlaySound(bigShot with { PitchVariance = 0.15f, Volume = 0.9f }, Projectile.Center);
+
+ Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 7;
+
+ Owner.velocity += shootVelocity * -0.68f;
+
+ Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, shootVelocity, ModContent.ProjectileType(), Projectile.damage, 0, Projectile.owner);
+ Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -shootVelocity.RotatedBy(0.75f * Projectile.direction) * 1f, ModContent.ProjectileType(), 0, 0, Projectile.owner);
+
+ for (int i = 0; i <= 13; i++)
+ {
+ Dust dust = Dust.NewDustPerfect(GunTipPosition, 303, shootVelocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.2f, 1.5f), 80, default, Main.rand.NextFloat(0.4f, 1.3f));
+ dust.noGravity = false;
+ dust.color = Color.White;
+
+ Dust dust2 = Dust.NewDustPerfect(GunTipPosition, 278, shootVelocity.RotatedByRandom(0.5f) * Main.rand.NextFloat(0.1f, 1f));
+ dust2.noGravity = true;
+ dust2.scale = Main.rand.NextFloat(0.52f, 0.72f);
+ dust2.color = Color.Lerp(Color.Orange, Color.Red, Main.rand.NextFloat(0f, 1f));
+ }
+ for (int i = 0; i < 14; i++)
+ {
+ Particle smoke = new HeavySmokeParticle(GunTipPosition, shootVelocity.RotatedByRandom(0.6f) * Main.rand.NextFloat(0.2f, 1.5f), Color.White, Main.rand.Next(40, 60 + 1), Main.rand.NextFloat(0.3f, 0.6f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: true);
+ GeneralParticleHandler.SpawnParticle(smoke);
+ }
+ }
+ else
+ {
+ OffsetLengthFromArm -= 8f;
+ failedShot = true;
+ SoundStyle bigShot = new("CalamityMod/Sounds/Item/DudFire");
+ SoundEngine.PlaySound(bigShot with { PitchVariance = 0.15f, Volume = 0.75f }, Projectile.Center);
+ cooldownTimer = Owner.itemAnimationMax;
+ }
+ }
+ }
+
+ time++;
+ }
+ private void PostFiringCooldown()
+ {
+ Owner.channel = true;
+ cooldownTimer -= (Spinning ? 1 : 2f);
+
+ if (cooldownTimer > 1)
+ {
+ if (!Owner.Calamity().mouseRight && cooldownTimer < Owner.itemAnimationMax * 1.7f && !failedShot)
+ Projectile.ai[2] = 0;
+ if (cooldownTimer <= 18 && !hasPlayedReloadSound)
+ {
+ if (!failedShot)
+ {
+ SoundStyle fire = new("CalamityMod/Sounds/Item/HellbornReload");
+ SoundEngine.PlaySound(fire with { Volume = 0.8f }, Projectile.Center);
+ }
+ hasPlayedReloadSound = true;
+ }
+ }
+ else if (!Spinning)
+ {
+ if (SoundEngine.TryGetActiveSound(SoundSlot, out var sSound) && sSound.IsPlaying)
+ sSound?.Stop();
+ Projectile.Kill();
+ }
+ }
+ public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
+ {
+ modifiers.SourceDamage *= 0.08f;
+ if (Owner.Calamity().hellbornShots < 8)
+ {
+ Owner.Calamity().hellbornShots++;
+ }
+ }
+ public override bool PreDraw(ref Color lightColor)
+ {
+ if (time < 2)
+ return false;
+ Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/Ranged/Hellborn").Value;
+ Texture2D spinTexture = ModContent.Request("CalamityMod/Items/Weapons/Ranged/Hellborn").Value;
+ Vector2 drawPosition = Projectile.Center - Main.screenPosition;
+ float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f);
+ Vector2 rotationPoint = texture.Size() * 0.5f;
+ SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
+
+ Main.EntitySpriteDraw(texture, drawPosition + (Spinning ? new Vector2(0, -8).RotatedBy(drawRot * 0.6f) : Vector2.Zero), null, Projectile.GetAlpha(lightColor), drawRotation + drawRot, rotationPoint, Projectile.scale, flipSprite);
+ return false;
+ }
+ public override bool? CanDamage() => Spinning && time > 5 ? null : false;
+ public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 100, targetHitbox);
+ public override void KillHoldoutLogic()
+ {
+ }
+ }
+}
diff --git a/Projectiles/Ranged/HellbornProj.cs b/Projectiles/Ranged/HellbornProj.cs
new file mode 100644
index 0000000000..9f12d7abfb
--- /dev/null
+++ b/Projectiles/Ranged/HellbornProj.cs
@@ -0,0 +1,135 @@
+using System;
+using CalamityMod.Particles;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using Terraria;
+using Terraria.Audio;
+using Terraria.ModLoader;
+
+namespace CalamityMod.Projectiles.Ranged
+{
+ public class HellbornProj : ModProjectile, ILocalizedModType
+ {
+ public new string LocalizationCategory => "Projectiles.Ranged";
+ public override void SetStaticDefaults()
+ {
+ Main.projFrames[Projectile.type] = 6;
+ }
+
+ public override void SetDefaults()
+ {
+ Projectile.width = 38;
+ Projectile.height = 38;
+ Projectile.friendly = true;
+ Projectile.ignoreWater = true;
+ Projectile.penetrate = 1;
+ Projectile.timeLeft = 600;
+ Projectile.DamageType = DamageClass.Ranged;
+ Projectile.extraUpdates = 2;
+ Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
+ }
+
+ public override void AI()
+ {
+ Player Owner = Main.player[Projectile.owner];
+ float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
+
+ //Animation
+ if (Projectile.frame == 0 || Projectile.frame == 3)
+ Projectile.frameCounter++;
+ else
+ Projectile.frameCounter += 2;
+ if (Projectile.frameCounter > 20)
+ {
+ Projectile.frame++;
+ Projectile.frameCounter = 0;
+ }
+ if (Projectile.frame > 5)
+ {
+ Projectile.frame = 0;
+ }
+ if (Projectile.velocity.Length() < 18)
+ Projectile.velocity *= 1.035f;
+
+ //Rotation
+ Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(90);
+
+ Lighting.AddLight(Projectile.Center, Color.Orange.ToVector3());
+
+ if (targetDist < 1400f)
+ {
+ // Spawn in a helix-style pattern
+ float sine = (float)Math.Sin(Projectile.timeLeft * 0.575f / MathHelper.Pi);
+
+ Vector2 offset = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * sine * 16f;
+ if (Main.rand.NextBool(2))
+ {
+ Particle orb = new GlowOrbParticle(Projectile.Center + offset, -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.8f), false, Main.rand.Next(20, 28 + 1), Main.rand.NextFloat(0.6f, 1.3f), Main.rand.NextBool() ? Color.Orange : Color.OrangeRed);
+ GeneralParticleHandler.SpawnParticle(orb);
+ }
+ if (Main.rand.NextBool(2))
+ {
+ Particle orb2 = new GlowOrbParticle(Projectile.Center - offset, -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.8f), false, Main.rand.Next(20, 28 + 1), Main.rand.NextFloat(0.6f, 1.3f), Main.rand.NextBool() ? Color.Orange : Color.OrangeRed);
+ GeneralParticleHandler.SpawnParticle(orb2);
+ }
+ }
+ Vector2 dustPos = Projectile.Center + Main.rand.NextVector2Circular(30, 30);
+ Dust dust = Dust.NewDustPerfect(dustPos, 267, -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.4f));
+ dust.noGravity = true;
+ dust.scale = Main.rand.NextFloat(0.72f, 1.12f);
+ dust.color = Color.Lerp(Color.Orange, Color.Red, Main.rand.NextFloat(0f, 1f));
+ }
+ public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
+ {
+ Player Owner = Main.player[Projectile.owner];
+ if (target.CanBeMoved(true))
+ {
+ // Launch
+ Vector2 launchVel = (Projectile.Center - target.Center).SafeNormalize(Vector2.UnitY) * -17;
+ target.velocity = launchVel * (target.knockBackResist == 0 ? 0.5f : 1f);
+ }
+ }
+ public override void OnKill(int timeLeft)
+ {
+ for (int l = 0; l < 17; l++)
+ {
+ Dust dust = Dust.NewDustPerfect(Projectile.Center, 278, new Vector2(8, 8).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 0.8f));
+ dust.noGravity = false;
+ dust.scale = Main.rand.NextFloat(0.62f, 0.82f);
+ dust.color = Color.Lerp(Color.Orange, Color.Red, Main.rand.NextFloat(0f, 1f));
+ }
+
+ Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.OrangeRed * 0.7f, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 1.2f, 1.7f, 16, true);
+ GeneralParticleHandler.SpawnParticle(blastRing);
+ Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White * 0.7f, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.7f, 0.9f, 16, true);
+ GeneralParticleHandler.SpawnParticle(blastRing2);
+
+ SoundStyle bigShot = new("CalamityMod/Sounds/Item/HellbornImpact");
+ SoundEngine.PlaySound(bigShot with { PitchVariance = 0.15f, Volume = 0.8f }, Projectile.Center);
+ }
+ public override bool PreDraw(ref Color lightColor)
+ {
+ Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Ranged/HellbornProj").Value;
+
+ Vector2 drawPosition = Projectile.Center - Main.screenPosition;
+ float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f);
+ Vector2 rotationPoint = texture.Size() * 0.5f;
+
+ Rectangle frame = texture.Frame(1, 6, 0, Projectile.frame);
+ Vector2 origin = frame.Size() * 0.5f;
+
+ Texture2D rechargeTexture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value;
+
+ // Glow Orb
+ float randSize = Main.rand.NextFloat(0.8f, 1.2f);
+ Main.EntitySpriteDraw(rechargeTexture, Projectile.Center - Main.screenPosition, null, Color.OrangeRed with { A = 0 }, Projectile.rotation, rechargeTexture.Size() * 0.5f, 0.5f * randSize, SpriteEffects.None, 0);
+ Main.EntitySpriteDraw(rechargeTexture, Projectile.Center - Main.screenPosition, null, Color.White with { A = 0 } * 0.75f, Projectile.rotation, rechargeTexture.Size() * 0.5f, 0.35f * randSize, SpriteEffects.None, 0);
+
+ for (int i = 0; i < 1; i++)
+ Main.EntitySpriteDraw(texture, drawPosition, frame, Color.White, 0, origin, Projectile.scale * (i == 0 ? 1.15f : 1), SpriteEffects.None, 0);
+
+ return false;
+ }
+ public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 35, targetHitbox);
+ }
+}
diff --git a/Projectiles/Ranged/HellbornProj.png b/Projectiles/Ranged/HellbornProj.png
new file mode 100644
index 0000000000..f99f640dfa
Binary files /dev/null and b/Projectiles/Ranged/HellbornProj.png differ
diff --git a/Projectiles/Ranged/HellbornShell.cs b/Projectiles/Ranged/HellbornShell.cs
new file mode 100644
index 0000000000..7647aaf586
--- /dev/null
+++ b/Projectiles/Ranged/HellbornShell.cs
@@ -0,0 +1,66 @@
+using Microsoft.Xna.Framework;
+using Terraria;
+using Terraria.ModLoader;
+
+namespace CalamityMod.Projectiles.Ranged
+{
+ public class HellbornShell : ModProjectile, ILocalizedModType
+ {
+ public new string LocalizationCategory => "Projectiles.Ranged";
+ public override string Texture => "CalamityMod/Projectiles/Ranged/HellbornShell";
+ public int Time = 0;
+ public bool TouchedGrass = false;
+
+ public override void SetDefaults()
+ {
+ Projectile.width = 12;
+ Projectile.height = 26;
+ Projectile.friendly = true;
+ Projectile.ignoreWater = false;
+ Projectile.DamageType = DamageClass.Ranged;
+ Projectile.penetrate = -1;
+ Projectile.timeLeft = 300;
+ Projectile.tileCollide = false;
+ Projectile.usesLocalNPCImmunity = true;
+ Projectile.localNPCHitCooldown = -1;
+ }
+ public override void AI()
+ {
+ Projectile.scale = 0.8f;
+ Projectile.extraUpdates = 1;
+ Time++;
+ Player Owner = Main.player[Projectile.owner];
+ if (!TouchedGrass)
+ {
+ if (Projectile.timeLeft <= 240)
+ Projectile.rotation += 0.04f * Projectile.direction;
+ else
+ Projectile.rotation = (new Vector2(0, -5 * Projectile.direction) + Projectile.velocity * -1.2f).ToRotation();
+
+ Projectile.velocity.Y += 0.087f;
+ Projectile.velocity.X *= 0.99f;
+
+ if (Main.rand.NextBool(4))
+ {
+ Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity, 303, -Projectile.velocity.RotatedByRandom(0.1f) * Main.rand.NextFloat(0.2f, 1f), 180, default, Main.rand.NextFloat(0.4f, 1.3f));
+ dust.noGravity = false;
+ dust.color = Color.White;
+ }
+ }
+ else
+ {
+ Projectile.velocity = Vector2.Zero;
+ }
+ Projectile.alpha = (int)(255 * Utils.GetLerpValue(60, 0, Projectile.timeLeft, true));
+ if (Collision.SolidCollision(Projectile.Center - Projectile.velocity * 1.5f, 2, 2))
+ Projectile.tileCollide = true;
+ }
+ public override bool OnTileCollide(Vector2 oldVelocity)
+ {
+ Projectile.damage = 0;
+ TouchedGrass = true;
+ Projectile.velocity = Vector2.Zero;
+ return false;
+ }
+ }
+}
diff --git a/Projectiles/Ranged/HellbornShell.png b/Projectiles/Ranged/HellbornShell.png
new file mode 100644
index 0000000000..03dd40086a
Binary files /dev/null and b/Projectiles/Ranged/HellbornShell.png differ
diff --git a/Projectiles/Ranged/MineralMortarProjectile.cs b/Projectiles/Ranged/MineralMortarProjectile.cs
index bbda255676..98a7ae6fec 100644
--- a/Projectiles/Ranged/MineralMortarProjectile.cs
+++ b/Projectiles/Ranged/MineralMortarProjectile.cs
@@ -179,7 +179,7 @@ namespace CalamityMod.Projectiles.Ranged
GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SwordSlashTexture"));
PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(TrailWidthFunction, ColorTrailFunction, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:TrailStreak"]), 50);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 0; i < 3; i++)
{
diff --git a/Projectiles/Ranged/SepticChain.png b/Projectiles/Ranged/SepticChain.png
new file mode 100644
index 0000000000..cf87d1f927
Binary files /dev/null and b/Projectiles/Ranged/SepticChain.png differ
diff --git a/Projectiles/Ranged/SepticSkewerBacteria.cs b/Projectiles/Ranged/SepticSkewerBacteria.cs
index b6e487b778..23e8884714 100644
--- a/Projectiles/Ranged/SepticSkewerBacteria.cs
+++ b/Projectiles/Ranged/SepticSkewerBacteria.cs
@@ -1,5 +1,8 @@
using CalamityMod.Buffs.DamageOverTime;
+using CalamityMod.Dusts;
+using CalamityMod.Particles;
using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -10,146 +13,57 @@ namespace CalamityMod.Projectiles.Ranged
{
public new string LocalizationCategory => "Projectiles.Ranged";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
-
+ public bool setStats = true;
+ public int rotDirection = 1;
+ public int time = 0;
public override void SetDefaults()
{
- Projectile.width = 6;
- Projectile.height = 6;
+ Projectile.width = 45;
+ Projectile.height = 45;
Projectile.friendly = true;
- Projectile.alpha = 255;
- Projectile.penetrate = 1;
+ Projectile.penetrate = -1;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
- Projectile.timeLeft = 300;
+ Projectile.timeLeft = 80;
+ Projectile.extraUpdates = 2;
+ Projectile.usesLocalNPCImmunity = true;
+ Projectile.localNPCHitCooldown = -1;
Projectile.DamageType = DamageClass.Ranged;
}
public override void AI()
{
- int dustType = 171;
+ if (setStats)
+ {
+ Projectile.timeLeft += Main.rand.Next(0, 25 + 1);
+ rotDirection = (Main.rand.NextBool() ? -1 : 1);
+ Projectile.rotation = Main.rand.NextFloat(-20, 20);
+ Projectile.scale = Main.rand.NextFloat(0.55f, 0.8f);
+ setStats = false;
+ }
+ if (time % 8 == 0 && time > 40)
+ {
+ Particle spark = new CustomSpark(Projectile.Center - Projectile.velocity + Main.rand.NextVector2Circular(20, 20), -Projectile.velocity * Main.rand.NextFloat(0.1f, 0.4f), "CalamityMod/Projectiles/Boss/OldDukeGore", false, Main.rand.Next(9, 20 + 1), Main.rand.NextFloat(0.4f, 0.6f), Color.Lerp(Color.White, Color.Chartreuse, 0.5f) * Main.rand.NextFloat(0.55f, 0.7f) * Utils.GetLerpValue(255, 0, Projectile.alpha), new Vector2(1, 1), false, false, Main.rand.NextFloat(-1f, 1f));
+ GeneralParticleHandler.SpawnParticle(spark);
+ }
+ if (Main.rand.NextBool(15))
+ {
+ Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(13, 13), (int)CalamityDusts.SulphurousSeaAcid);
+ dust.noGravity = true;
+ dust.scale = Main.rand.NextFloat(0.9f, 1.3f) * Utils.GetLerpValue(255, 0, Projectile.alpha);
+ dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.7f);
+ }
if (Main.rand.NextBool(3))
{
- dustType = 46;
- }
- int toxicDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f);
- Main.dust[toxicDust].noGravity = true;
- float scaleAlpha = 1f - (float)Projectile.alpha / 255f;
- scaleAlpha *= Projectile.scale;
- Projectile.localAI[0] += 1f;
- if (Projectile.localAI[0] >= 90f)
- {
- Projectile.localAI[0] *= -1f;
- }
- if (Projectile.localAI[0] >= 0f)
- {
- Projectile.scale += 0.003f;
- }
- else
- {
- Projectile.scale -= 0.003f;
- }
- Projectile.rotation += 0.0025f * Projectile.scale;
- float yVelControl = 1f;
- float xVelControl = 1f;
- if (Projectile.identity % 6 == 0)
- {
- xVelControl *= -1f;
- }
- if (Projectile.identity % 6 == 1)
- {
- yVelControl *= -1f;
- }
- if (Projectile.identity % 6 == 2)
- {
- xVelControl *= -1f;
- yVelControl *= -1f;
- }
- if (Projectile.identity % 6 == 3)
- {
- xVelControl = 0f;
- }
- if (Projectile.identity % 6 == 4)
- {
- yVelControl = 0f;
- }
- Projectile.localAI[1] += 1f;
- if (Projectile.localAI[1] > 60f)
- {
- Projectile.localAI[1] = -180f;
- }
- if (Projectile.localAI[1] >= -60f)
- {
- Projectile.velocity.X = Projectile.velocity.X + 0.002f * xVelControl;
- Projectile.velocity.Y = Projectile.velocity.Y + 0.002f * yVelControl;
- }
- else
- {
- Projectile.velocity.X = Projectile.velocity.X - 0.002f * xVelControl;
- Projectile.velocity.Y = Projectile.velocity.Y - 0.002f * yVelControl;
- }
- Projectile.ai[0] += 1f;
- if (Projectile.ai[0] > 5400f)
- {
- Projectile.damage = 0;
- Projectile.ai[1] = 1f;
- if (Projectile.alpha < 255)
- {
- Projectile.alpha += 5;
- if (Projectile.alpha > 255)
- {
- Projectile.alpha = 255;
- }
- }
- else if (Projectile.owner == Main.myPlayer)
- {
- Projectile.Kill();
- }
- }
- else
- {
- float playerDist = (Projectile.Center - Main.player[Projectile.owner].Center).Length() / 100f;
- if (playerDist > 4f)
- {
- playerDist *= 1.1f;
- }
- if (playerDist > 5f)
- {
- playerDist *= 1.2f;
- }
- if (playerDist > 6f)
- {
- playerDist *= 1.3f;
- }
- if (playerDist > 7f)
- {
- playerDist *= 1.4f;
- }
- if (playerDist > 8f)
- {
- playerDist *= 1.5f;
- }
- if (playerDist > 9f)
- {
- playerDist *= 1.6f;
- }
- if (playerDist > 10f)
- {
- playerDist *= 1.7f;
- }
- Projectile.ai[0] += playerDist;
- if (Projectile.alpha > 50)
- {
- Projectile.alpha -= 10;
- if (Projectile.alpha < 50)
- {
- Projectile.alpha = 50;
- }
- }
- }
- if ((double)Projectile.velocity.Length() > 0.2)
- {
- Projectile.velocity *= 0.98f;
+ Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 3 + Main.rand.NextVector2Circular(6, 6), 5, (-Projectile.velocity.SafeNormalize(Vector2.UnitX) * 4).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.1f, 0.8f), 100, default, Main.rand.NextFloat(0.8f, 1.4f));
+ dust.noGravity = true;
+ dust.alpha = (int)MathHelper.Clamp(Projectile.alpha, 0, 255);
}
+ Projectile.rotation += 0.035f * rotDirection * Utils.GetLerpValue(0, 100, Projectile.timeLeft, true);
+ Projectile.velocity *= 0.965f;
+ if (Projectile.timeLeft < 60)
+ Projectile.alpha += 5;
+ time++;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
@@ -159,21 +73,20 @@ namespace CalamityMod.Projectiles.Ranged
public override void OnKill(int timeLeft)
{
- Projectile.position = Projectile.Center;
- Projectile.width = Projectile.height = 56;
- Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
- Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
- int constant = 36;
- for (int i = 0; i < constant; i++)
- {
- Vector2 rotate = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f;
- rotate = rotate.RotatedBy((double)((float)(i - (constant / 2 - 1)) * 6.28318548f / (float)constant), default) + Projectile.Center;
- Vector2 faceDirection = rotate - Projectile.Center;
- int dust = Dust.NewDust(rotate + faceDirection, 0, 0, DustID.Venom, faceDirection.X, faceDirection.Y, 100, default, 0.5f);
- Main.dust[dust].noGravity = true;
- Main.dust[dust].noLight = true;
- Main.dust[dust].velocity = faceDirection;
- }
+
+ }
+ public override bool PreDraw(ref Color lightColor)
+ {
+
+ Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Boss/OldDukeGore").Value;
+ Vector2 drawPosition = Projectile.Center - Main.screenPosition;
+ Color drawColor = Projectile.GetAlpha(lightColor);
+ float drawRotation = Projectile.rotation;
+ Vector2 rotationPoint = texture.Size() * 0.5f;
+
+
+ Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, drawRotation, rotationPoint, Projectile.scale, SpriteEffects.None);
+ return false;
}
}
}
diff --git a/Projectiles/Ranged/SepticSkewerHarpoon.cs b/Projectiles/Ranged/SepticSkewerHarpoon.cs
index 5e4628a6e4..8532758f96 100644
--- a/Projectiles/Ranged/SepticSkewerHarpoon.cs
+++ b/Projectiles/Ranged/SepticSkewerHarpoon.cs
@@ -1,7 +1,14 @@
using System;
+using System.Collections.Generic;
+using System.Linq;
using CalamityMod.Buffs.DamageOverTime;
+using CalamityMod.DataStructures;
+using CalamityMod.Particles;
+using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
using Terraria;
+using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
@@ -10,119 +17,388 @@ namespace CalamityMod.Projectiles.Ranged
public class SepticSkewerHarpoon : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Ranged";
+ public ref float time => ref Projectile.ai[0];
+
+ public Vector2[] OldVelocities = new Vector2[20];
+ public bool canDamage = true;
+ public bool returning = false;
+ public float CenterX;
+ public float CenterY;
+ public bool setPosition = true;
+ public int returnTime = 75;
+
+ public NPC chosenTarget;
+ public bool stuckInTarget = false;
+ public bool canStick = true;
+ public Vector2 placementCenter;
+ float placementDistance;
+ Vector2 placementVelocity;
+ public Vector2 storedVelocity;
+ public bool collideWithTiles = true;
+ public bool hasHitTile = false;
+ public Color bColor = Color.Chartreuse;
+
+ public bool ripped = false;
+ public bool pullingTarget = false;
+ public bool spawnPullBlood = true;
+ public override void SetStaticDefaults()
+ {
+ ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000;
+ }
+ public Vector2 DrawStartPosition
+ {
+ get
+ {
+ if (Projectile.owner < 0 || Projectile.owner >= Main.player.Length)
+ return Vector2.Zero;
+ return Main.player[Projectile.owner].Center;
+ }
+ }
public override void SetDefaults()
{
Projectile.width = 4;
Projectile.height = 4;
Projectile.friendly = true;
Projectile.penetrate = -1;
- Projectile.alpha = 255;
Projectile.ignoreWater = true;
+ Projectile.tileCollide = false;
Projectile.DamageType = DamageClass.Ranged;
- Projectile.extraUpdates = 1;
+ Projectile.extraUpdates = 2;
Projectile.usesLocalNPCImmunity = true;
- Projectile.localNPCHitCooldown = 8;
+ Projectile.localNPCHitCooldown = -1;
+ Projectile.extraUpdates = 1;
Projectile.timeLeft = 900;
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
}
public override void AI()
{
- Player player = Main.player[Projectile.owner];
- if (Main.rand.NextBool(5))
+ Player Owner = Main.player[Projectile.owner];
+ float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
+
+ bool pullCheckValid = ((chosenTarget != null && chosenTarget.life < Projectile.damage * 15f && Projectile.ai[2] != 5 && chosenTarget.CanBeMoved(true)) || Main.zenithWorld);
+
+ if (Projectile.ai[2] == 5)
{
- Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Venom, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f);
+ ripped = true;
+ pullingTarget = false;
}
- Vector2 playerDist = player.Center - Projectile.Center;
- Projectile.ai[1] += 1f;
- if (Projectile.ai[1] > 5f)
+ if (Projectile.ai[1] > 0)
+ Projectile.extraUpdates = (int)(MathHelper.Clamp(Projectile.ai[1], 1, 18));
+
+ if (!stuckInTarget && (!hasHitTile && !returning))
+ storedVelocity = Projectile.velocity;
+
+ if (Main.zenithWorld)
{
- Projectile.alpha = 0;
+ returnTime = 90;
+ Projectile.extraUpdates = 7;
}
- if (Projectile.ai[1] % 8f == 0f && Projectile.owner == Main.myPlayer && Main.rand.NextBool(5))
+
+ if (time >= returnTime * (pullCheckValid ? 0.9f : stuckInTarget ? 5 : 1) || ripped)
{
- Vector2 harpoonPos = playerDist * -1f;
- harpoonPos.Normalize();
- harpoonPos *= Main.rand.Next(45, 65) * 0.1f;
- harpoonPos = harpoonPos.RotatedBy((Main.rand.NextDouble() - 0.5) * MathHelper.PiOver2);
- Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, harpoonPos.X, harpoonPos.Y, ModContent.ProjectileType(), (int)(Projectile.damage * 0.175), Projectile.knockBack * 0.2f, Projectile.owner, -10f, 0f);
- }
- if (player.dead)
- {
- Projectile.Kill();
- return;
- }
- if (Projectile.alpha == 0)
- {
- if (Projectile.position.X + (float)(Projectile.width / 2) > player.position.X + (float)(player.width / 2))
+ stuckInTarget = false;
+ returning = true;
+ if (pullCheckValid && chosenTarget != null)
{
- player.ChangeDir(1);
+ pullingTarget = true;
+ canDamage = false;
+ chosenTarget.damage = 0;
+ chosenTarget.Center = Projectile.Center;
+ chosenTarget.velocity = Projectile.velocity;
}
else
{
- player.ChangeDir(-1);
+ canDamage = true;
}
}
- if (Projectile.ai[0] == 0f)
+
+ if (returning)
{
- Projectile.extraUpdates = 2;
- }
- else
- {
- Projectile.extraUpdates = 3;
- }
- Vector2 halfDist = Projectile.Center;
- float xDist = player.position.X + (float)(player.width / 2) - halfDist.X;
- float yDist = player.position.Y + (float)(player.height / 2) - halfDist.Y;
- float playerDistance = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist));
- if (Projectile.ai[0] == 0f)
- {
- if (playerDistance > 2000f)
+ int startTime = 1000;
+ int endTime = startTime + (int)((pullingTarget ? 45 : ripped ? 25 : 85));
+ if (setPosition)
{
- Projectile.ai[0] = 1f;
+ SoundStyle pull3 = new("CalamityMod/Sounds/Item/ChainPull");
+ SoundEngine.PlaySound(pull3 with { Pitch = (Main.rand.NextFloat(0, 0.05f)), Volume = (Projectile.numHits > 0 && ripped ? 0.6f : 0.4f) }, Owner.Center);
+
+ for (int i = 0; i < Main.maxNPCs; i++)
+ Projectile.localNPCImmunity[i] = 0;
+ canStick = false;
+ time = 1000;
+ CenterX = Projectile.Center.X;
+ CenterY = Projectile.Center.Y;
+ setPosition = false;
+ if (Projectile.numHits > 0 && !pullingTarget)
+ {
+ float ripIntensity = ripped ? 2 : 1;
+ if (ripped)
+ {
+ SoundStyle pull = new("CalamityMod/Sounds/Custom/Perforator/PerfHiveIchorShoot");
+ SoundStyle pull2 = new("CalamityMod/Sounds/Item/FinalDawnSlash");
+ SoundEngine.PlaySound(pull with { Pitch = Main.rand.NextFloat(0, -0.2f), Volume = 0.7f }, Projectile.Center);
+ SoundEngine.PlaySound(pull2 with { Pitch = Main.rand.NextFloat(0.3f, 0.4f), Volume = 0.9f }, Projectile.Center);
+ }
+ else
+ {
+ SoundStyle pull = new("CalamityMod/Sounds/Custom/Perforator/PerfHiveShoot3");
+ SoundStyle pull2 = new("CalamityMod/Sounds/Item/WulfrumKnifeTileHit2");
+ SoundEngine.PlaySound(pull with { Pitch = -0.2f, Volume = 0.6f }, Projectile.Center);
+ SoundEngine.PlaySound(pull2 with { Pitch = -0.6f, Volume = 0.5f }, Projectile.Center);
+ }
+
+ for (int i = 0; i < 7 * ripIntensity; i++)
+ {
+ Vector2 vel = ((Projectile.Center - Owner.Center).SafeNormalize(Vector2.UnitX) * -18).RotatedByRandom(0.2f * ripIntensity) * Main.rand.NextFloat(0.2f, 0.6f) * ripIntensity;
+ if (i % 3 == 0)
+ {
+ Particle spark = new AltLineParticle(Projectile.Center, vel, true, (int)(18 * ripIntensity), Main.rand.NextFloat(0.55f, 0.8f) * ripIntensity, Color.DarkRed * 0.8f);
+ GeneralParticleHandler.SpawnParticle(spark);
+ }
+ else
+ {
+ Particle spark = new GlowOrbParticle(Projectile.Center, vel, true, (int)(18 * ripIntensity), Main.rand.NextFloat(0.55f, 0.8f) * ripIntensity, Color.DarkRed * 0.8f, false, false, false);
+ GeneralParticleHandler.SpawnParticle(spark);
+ }
+
+ Dust dust = Dust.NewDustPerfect(Projectile.Center, 5, vel * 3, 100, default, Main.rand.NextFloat(0.8f, 1.4f));
+ dust.noGravity = true;
+ }
+
+ if (!pullingTarget)
+ {
+ for (int i = 0; i < 4 + (ripped ? 2 : 0); i++)
+ Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, ((Projectile.Center - Owner.Center).SafeNormalize(Vector2.UnitX) * -18).RotatedByRandom(0.5f) * Main.rand.NextFloat(0.3f, 1.2f), ModContent.ProjectileType(), Projectile.damage / 9, Projectile.knockBack, Projectile.owner, 0);
+ }
+ }
}
- Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
- Projectile.ai[1] += 1f;
- if (Projectile.ai[1] > 5f)
- {
- Projectile.alpha = 0;
- }
- if (Projectile.ai[1] > 8f)
- {
- Projectile.ai[1] = 8f;
- }
- if (Projectile.ai[1] >= 10f)
- {
- Projectile.ai[1] = 15f;
- Projectile.velocity.Y = Projectile.velocity.Y + 0.3f;
- }
- }
- else if (Projectile.ai[0] == 1f)
- {
- Projectile.tileCollide = false;
- Projectile.rotation = (float)Math.Atan2((double)yDist, (double)xDist) - MathHelper.PiOver2;
- float returnSpeed = 20f;
- if (playerDistance < 50f)
- {
+
+ storedVelocity += (Projectile.Center - Owner.Center).SafeNormalize(Vector2.UnitX) * 0.5f;
+ Projectile.Center = new Vector2(MathHelper.Lerp(CenterX, Owner.Center.X, Utils.GetLerpValue(startTime, endTime, time, true)), MathHelper.Lerp(CenterY, Owner.Center.Y, Utils.GetLerpValue(startTime, endTime, time, true)));
+ if (time >= endTime)
Projectile.Kill();
+
+ if (time >= endTime - 2 && pullingTarget)
+ {
+ if (spawnPullBlood && chosenTarget != null && chosenTarget.life > 0)
+ {
+ SoundStyle die = new("CalamityMod/Sounds/NPCKilled/PerfLargeDeath");
+ SoundEngine.PlaySound(die with { Pitch = Main.rand.NextFloat(0, 0.1f), Volume = 0.85f }, Projectile.Center);
+ for (int i = 0; i < 40; i++)
+ {
+ Vector2 vel = (Vector2.One * -28).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 0.9f);
+ if (i % 3 == 0)
+ {
+ Particle spark = new AltLineParticle(Projectile.Center, vel, true, (int)(35), Main.rand.NextFloat(0.55f, 1.3f), Color.DarkRed * 0.8f);
+ GeneralParticleHandler.SpawnParticle(spark);
+ }
+ else
+ {
+ Particle spark = new GlowOrbParticle(Projectile.Center, vel, true, (int)(35), Main.rand.NextFloat(0.55f, 1.3f), Color.DarkRed * 0.8f, false, false, false);
+ GeneralParticleHandler.SpawnParticle(spark);
+ }
+
+ for (int r = 0; r < 2; r++)
+ {
+ Vector2 vel2 = (Vector2.One * -28).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 0.8f);
+ Dust dust = Dust.NewDustPerfect(Projectile.Center, 5, vel2, 100, default, Main.rand.NextFloat(0.9f, 1.7f));
+ dust.noGravity = false;
+ }
+ }
+
+ NPC closestTarget = null;
+ float distance = 2000;
+ for (int index = 0; index < Main.npc.Length; index++)
+ {
+ if (Main.npc[index].CanBeChasedBy(null, false))
+ {
+ float extraDistance = (Main.npc[index].width / 2) + (Main.npc[index].height / 2);
+
+ bool canHit = true;
+
+ if (Vector2.Distance(Projectile.Center, Main.npc[index].Center) < distance && canHit && Main.npc[index] != chosenTarget)
+ {
+ distance = Vector2.Distance(Projectile.Center, Main.npc[index].Center);
+ closestTarget = Main.npc[index];
+ }
+ }
+ if (Main.zenithWorld && Main.npc[index] != null && Main.rand.NextBool(15) && index < 80 && Main.npc[index].realLife == -1 && Owner.ownedProjectileCounts[Projectile.type] < 80)
+ {
+ closestTarget = Main.npc[index];
+ Projectile harpoon = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, ((closestTarget.Center - Owner.Center + closestTarget.velocity * 1.5f).SafeNormalize(Vector2.UnitX) * 18), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Projectile.ai[1] + 1);
+ }
+ }
+ if (closestTarget != null)
+ {
+ Projectile harpoon = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, ((closestTarget.Center - Owner.Center + closestTarget.velocity * 1.5f).SafeNormalize(Vector2.UnitX) * 18), Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, 0, Projectile.ai[1] + 1);
+ }
+
+ int heal = 25;
+ Owner.statLife += heal;
+ Owner.HealEffect(heal);
+ if (Owner.statLife > Owner.statLifeMax2)
+ Owner.statLife = Owner.statLifeMax2;
+
+ spawnPullBlood = false;
+ }
+ canDamage = true;
}
- playerDistance = returnSpeed / playerDistance;
- xDist *= playerDistance;
- yDist *= playerDistance;
- Projectile.velocity.X = xDist;
- Projectile.velocity.Y = yDist;
}
+
+ if ((time <= returnTime * 0.6f && !stuckInTarget || returning && Main.rand.NextBool(5)))
+ {
+ Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(9, 9), Main.rand.NextBool(7) ? 28 : 215, storedVelocity * Main.rand.NextFloat(0.05f, 0.15f), 0, default, Main.rand.NextFloat(0.5f, 0.9f));
+ dust.noGravity = true;
+ }
+
+ if (stuckInTarget)
+ {
+ placementCenter = chosenTarget.Center + placementVelocity * placementDistance + storedVelocity * 2;
+
+ Projectile.Center = placementCenter;
+
+ if (chosenTarget.life <= 0 || chosenTarget == null)
+ {
+ returning = true;
+ stuckInTarget = false;
+ }
+ }
+ else if (time >= returnTime * 0.4f && !returning)
+ {
+ Projectile.velocity *= 0.95f;
+ }
+
+ if (collideWithTiles && Collision.SolidCollision(Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 30, 4, 4) && !Main.zenithWorld && Projectile.ai[1] < 1)
+ {
+ hasHitTile = true;
+ Projectile.velocity *= -0.5f;
+ Vector2 sparkVelocity = Projectile.velocity * 3;
+ for (int i = 0; i < 6; i++)
+ {
+ float sparkScale1 = Main.rand.NextFloat(0.3f, 0.8f);
+ Vector2 sparkvelocity1 = sparkVelocity.RotatedByRandom(0.45f) * Main.rand.NextFloat(0.5f, 0.7f);
+ Particle spark1 = new LineParticle(Projectile.Center, sparkvelocity1, true, 40, sparkScale1, Main.rand.NextBool() ? bColor : Color.Green);
+ GeneralParticleHandler.SpawnParticle(spark1);
+ SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/CeramicImpact", 2) with { Pitch = 0.4f, Volume = 0.5f }, Projectile.Center);
+ }
+
+ time = returnTime * 0.5f;
+ collideWithTiles = false;
+ canStick = false;
+ }
+
+ if (!hasHitTile || returning)
+ {
+ Projectile.rotation = storedVelocity.ToRotation() + MathHelper.ToRadians(90f);
+ }
+ AdjustOldVelocityArray();
+ time++;
+ }
+ public void AdjustOldVelocityArray()
+ {
+ for (int i = OldVelocities.Length - 1; i > 0; i--)
+ OldVelocities[i] = OldVelocities[i - 1];
+
+ OldVelocities[0] = storedVelocity;
}
- public override bool OnTileCollide(Vector2 oldVelocity)
+ public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
- Projectile.ai[0] = 1f;
- return false;
- }
+ bool pullCheckValid = ((chosenTarget != null && chosenTarget.life < Projectile.damage * 15f && Projectile.ai[2] != 5 && chosenTarget.CanBeMoved(true)) || Main.zenithWorld);
- public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
+ if (!stuckInTarget && canStick)
+ {
+ for (int i = 0; i <= 8; i++)
+ {
+ Vector2 sparkVelocity = Projectile.velocity * 0.5f;
+
+ float sparkScale1 = Main.rand.NextFloat(0.3f, 0.8f);
+ Vector2 sparkvelocity1 = sparkVelocity.RotatedByRandom(0.45f) * Main.rand.NextFloat(0.5f, 0.7f);
+ Particle spark1 = new LineParticle(Projectile.Center, sparkvelocity1, false, 40, sparkScale1, Main.rand.NextBool() ? bColor : Color.Green);
+ GeneralParticleHandler.SpawnParticle(spark1);
+
+ float sparkScale2 = Main.rand.NextFloat(0.4f, 1f);
+ Vector2 sparkvelocity2 = sparkVelocity.RotatedByRandom(0.2f) * Main.rand.NextFloat(0.9f, 1.6f);
+ Particle spark2 = new LineParticle(Projectile.Center, sparkvelocity2, false, 40, sparkScale2, Main.rand.NextBool() ? bColor : Color.Green);
+ GeneralParticleHandler.SpawnParticle(spark2);
+
+ Dust dust = Dust.NewDustPerfect(Projectile.Center, 5, sparkvelocity2, 100, default, Main.rand.NextFloat(0.8f, 1.4f));
+ dust.noGravity = true;
+ }
+
+ time = 1;
+ collideWithTiles = false;
+ canDamage = false;
+ placementDistance = -Vector2.Distance(target.Center, Projectile.Center);
+ placementVelocity = (target.Center - Projectile.Center).SafeNormalize(Vector2.UnitX);
+ placementCenter = placementVelocity * (placementDistance * 0.01f);
+ chosenTarget = target;
+ stuckInTarget = true;
+ canStick = false;
+ storedVelocity = Projectile.velocity;
+ Projectile.velocity = Vector2.Zero;
+ SoundStyle sound = new("CalamityMod/Sounds/Item/WulfrumKnifeTileHit2");
+ SoundEngine.PlaySound(sound with { Volume = 0.5f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) }, Projectile.Center);
+
+ pullCheckValid = ((chosenTarget != null && chosenTarget.life < Projectile.damage * 15f && Projectile.ai[2] != 5 && chosenTarget.CanBeMoved(true)) || Main.zenithWorld);
+ if (pullCheckValid)
+ {
+ SoundStyle sound5 = new("CalamityMod/Sounds/Item/HeliumFlashCoreImpact");
+ SoundEngine.PlaySound(sound5 with { Volume = 0.55f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) }, Projectile.Center);
+ }
+ }
+
+ bool hitTarget = chosenTarget != null && target == chosenTarget;
+ modifiers.SourceDamage *= hitTarget ? pullingTarget ? 20 : (ripped ? 2 : Projectile.numHits < 1 ? 0.01f : 1) : 0.2f;
+
+ pullCheckValid = ((chosenTarget != null && chosenTarget.life < Projectile.damage * 15f && Projectile.ai[2] != 5 && chosenTarget.CanBeMoved(true)) || Main.zenithWorld);
+ if (!pullCheckValid)
+ target.AddBuff(ModContent.BuffType(), 180);
+ }
+ public override bool? CanDamage() => canDamage ? null : false;
+ public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, !spawnPullBlood ? 150 : 25, targetHitbox);
+
+ public override bool PreDraw(ref Color lightColor)
{
- target.AddBuff(ModContent.BuffType(), 180);
+ Texture2D chain = ModContent.Request("CalamityMod/Projectiles/Ranged/SepticChain").Value;
+ Vector2 end = Projectile.Center - storedVelocity.SafeNormalize(Vector2.UnitX) * 35;
+
+ List controlPoints = new List
+ {
+ DrawStartPosition
+ };
+ for (int i = 0; i < OldVelocities.Length; i++)
+ {
+ float swayResponsiveness = Utils.GetLerpValue(0f, 6f, i, true) * Utils.GetLerpValue(OldVelocities.Length, OldVelocities.Length - 6f, i, true);
+ Vector2 swayTotalOffset = OldVelocities[i] * swayResponsiveness;
+ controlPoints.Add(Vector2.Lerp(DrawStartPosition, end, i / (float)OldVelocities.Length) + swayTotalOffset);
+ }
+ controlPoints.Add(end);
+
+ int chainPointCount = (int)(Vector2.Distance(controlPoints.First(), controlPoints.Last()) / 7f);
+ if (chainPointCount < 12)
+ chainPointCount = 12;
+ BezierCurve bezierCurve = new BezierCurve(controlPoints.ToArray());
+ List chainPoints = bezierCurve.GetPoints(chainPointCount);
+
+ for (int i = 0; i < chainPoints.Count; i++)
+ {
+ Vector2 positionAtPoint = chainPoints[i];
+ if (Vector2.Distance(positionAtPoint, Projectile.Center) < 10f)
+ continue;
+ float angleAtPoint = i == chainPoints.Count - 1 ? (end - chainPoints[i]).ToRotation() : (chainPoints[i + 1] - chainPoints[i]).ToRotation();
+ angleAtPoint += MathHelper.PiOver2;
+ Main.EntitySpriteDraw(chain,
+ positionAtPoint - Main.screenPosition,
+ null,
+ Lighting.GetColor(positionAtPoint.ToTileCoordinates()),
+ angleAtPoint,
+ chain.Size() / 2f,
+ 0.85f,
+ SpriteEffects.None,
+ 0);
+ }
+ return true;
}
}
}
diff --git a/Projectiles/Ranged/SuperradiantSaw.cs b/Projectiles/Ranged/SuperradiantSaw.cs
index 023582e299..5e43af296a 100644
--- a/Projectiles/Ranged/SuperradiantSaw.cs
+++ b/Projectiles/Ranged/SuperradiantSaw.cs
@@ -363,7 +363,7 @@ namespace CalamityMod.Projectiles.Ranged
Main.EntitySpriteDraw(outline, Projectile.Center - Main.screenPosition, null, Main.DiscoColor, Projectile.rotation, outline.Size() * 0.5f, 1f, SpriteEffects.None);
}
- if (!CalamityConfig.Instance.Afterimages)
+ if (!CalamityClientConfig.Instance.Afterimages)
return false;
// Special afterimage drawing to include the slashes
diff --git a/Projectiles/Ranged/SuperradiantSawLingering.cs b/Projectiles/Ranged/SuperradiantSawLingering.cs
index e576590ff9..49529f2016 100644
--- a/Projectiles/Ranged/SuperradiantSawLingering.cs
+++ b/Projectiles/Ranged/SuperradiantSawLingering.cs
@@ -181,7 +181,7 @@ namespace CalamityMod.Projectiles.Ranged
Texture2D outline = SawOutline.Value;
Main.EntitySpriteDraw(outline, Projectile.Center - Main.screenPosition, null, Main.DiscoColor, Projectile.rotation, outline.Size() * 0.5f, 1f, SpriteEffects.None);
- if (!CalamityConfig.Instance.Afterimages)
+ if (!CalamityClientConfig.Instance.Afterimages)
return false;
// Special afterimage drawing to include the slashes
diff --git a/Projectiles/Ranged/SuperradiantSlaughtererHoldout.cs b/Projectiles/Ranged/SuperradiantSlaughtererHoldout.cs
index 0306b7f797..16e78c01b0 100644
--- a/Projectiles/Ranged/SuperradiantSlaughtererHoldout.cs
+++ b/Projectiles/Ranged/SuperradiantSlaughtererHoldout.cs
@@ -328,7 +328,7 @@ namespace CalamityMod.Projectiles.Ranged
if (Time / ChargeupTime >= 0.25f)
Main.EntitySpriteDraw(smallSlashTexture, GunTipPosition - Main.screenPosition, null, slashColor, Time * MathHelper.ToRadians(42f), smallSlashTexture.Size() * 0.5f, 1f, SpriteEffects.None);
- if (!CalamityConfig.Instance.Afterimages)
+ if (!CalamityClientConfig.Instance.Afterimages)
return false;
// Special afterimage drawing for the slashes only
diff --git a/Projectiles/Rogue/RadiationBurst.cs b/Projectiles/Rogue/RadiationBurst.cs
new file mode 100644
index 0000000000..36ae2c6f25
--- /dev/null
+++ b/Projectiles/Rogue/RadiationBurst.cs
@@ -0,0 +1,93 @@
+using System;
+using CalamityMod.Buffs.DamageOverTime;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework;
+using ReLogic.Content;
+using Terraria;
+using Terraria.Audio;
+using Terraria.ID;
+using Terraria.ModLoader;
+using CalamityMod.Dusts;
+using CalamityMod.Particles;
+
+namespace CalamityMod.Projectiles.Rogue
+{
+ public class RadiationBurst : ModProjectile, ILocalizedModType
+ {
+ public new string LocalizationCategory => "Projectiles.Rogue";
+ public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
+ public NPC targetedNPC;
+ public int time = 0;
+ public int boomTime = 50;
+
+ public override void SetDefaults()
+ {
+ Projectile.width = 6;
+ Projectile.height = 6;
+ Projectile.friendly = true;
+ Projectile.tileCollide = false;
+ Projectile.ignoreWater = true;
+ Projectile.penetrate = -1;
+ Projectile.timeLeft = boomTime + 2;
+ Projectile.DamageType = RogueDamageClass.Instance;
+ Projectile.usesLocalNPCImmunity = true;
+ Projectile.localNPCHitCooldown = -1;
+ }
+
+ public override void AI()
+ {
+ Player Owner = Main.player[Projectile.owner];
+ float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
+ if (time < boomTime)
+ {
+ float fade = Utils.GetLerpValue(boomTime + 3, 0, time);
+ float numberOfDusts = 2f;
+ float rotFactor = 360f / numberOfDusts;
+ for (int i = 0; i < numberOfDusts; i++)
+ {
+ float rot = MathHelper.ToRadians(i * rotFactor);
+ Vector2 velOffset = CalamityUtils.RandomVelocity(100f, 70f, 250f, 0.04f);
+ velOffset *= Main.rand.NextFloat(25, 45) * fade;
+ Particle energy = new GlowOrbParticle(Projectile.Center + velOffset * 2.5f, -velOffset * Main.rand.NextFloat(0.08f, 0.12f) * 1.5f, false, (int)(14 - (5 * fade)), Main.rand.NextFloat(1.1f, 1.25f) - 0.5f * fade, Color.Chartreuse);
+ GeneralParticleHandler.SpawnParticle(energy);
+ Dust dust = Dust.NewDustPerfect(Projectile.Center + velOffset * 2.5f, 278, -velOffset * Main.rand.NextFloat(0.08f, 0.12f) * 1.5f, 0, default, Main.rand.NextFloat(0.4f, 0.6f));
+ dust.noGravity = true;
+ dust.color = Color.Chartreuse;
+ }
+ }
+ if (time == boomTime && targetDist < 1400)
+ {
+ for (int i = 0; i <= 30; i++)
+ {
+ Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool() ? 278 : (int)CalamityDusts.SulphurousSeaAcid, new Vector2(15, 15).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1.8f), 0, default, Main.rand.NextFloat(0.9f, 1.3f));
+ dust.noGravity = true;
+ if (dust.type == 278)
+ {
+ dust.noGravity = false;
+ dust.color = Color.Chartreuse;
+ }
+ else
+ dust.scale *= 1.5f;
+
+ }
+ for (int i = 0; i < 3; i++)
+ {
+ Particle Smear = new CustomPulse(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 18, Projectile.velocity, Color.Chartreuse * 0.7f, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(-5, 5), 0, 0.25f + i * 0.11f, 18 - i * 3);
+ GeneralParticleHandler.SpawnParticle(Smear);
+ }
+ Particle orb = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Chartreuse, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 1.5f, 0.5f, 32);
+ GeneralParticleHandler.SpawnParticle(orb);
+ Particle orb2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 1f, 0.2f, 32);
+ GeneralParticleHandler.SpawnParticle(orb2);
+
+ Owner.Calamity().GeneralScreenShakePower = 3.5f;
+ }
+ time++;
+ }
+ public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
+ {
+ target.AddBuff(ModContent.BuffType(), 180);
+ }
+ public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => time >= boomTime ? CalamityUtils.CircularHitboxCollision(Projectile.Center, 350, targetHitbox) : false;
+ }
+}
diff --git a/Projectiles/Rogue/RadiationRain.cs b/Projectiles/Rogue/RadiationRain.cs
new file mode 100644
index 0000000000..fec93913a9
--- /dev/null
+++ b/Projectiles/Rogue/RadiationRain.cs
@@ -0,0 +1,113 @@
+using System;
+using CalamityMod.Buffs.DamageOverTime;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework;
+using ReLogic.Content;
+using Terraria;
+using Terraria.Audio;
+using Terraria.ID;
+using Terraria.ModLoader;
+using CalamityMod.Dusts;
+using CalamityMod.Particles;
+
+namespace CalamityMod.Projectiles.Rogue
+{
+ public class RadiationRain : ModProjectile, ILocalizedModType
+ {
+ public new string LocalizationCategory => "Projectiles.Rogue";
+ public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
+ public NPC targetedNPC;
+ public int time = 0;
+ public Vector2 spawnSpot;
+
+ public override void SetDefaults()
+ {
+ Projectile.width = 60;
+ Projectile.height = 60;
+ Projectile.friendly = true;
+ Projectile.tileCollide = false;
+ Projectile.ignoreWater = true;
+ Projectile.penetrate = -1;
+ Projectile.extraUpdates = 10;
+ Projectile.timeLeft = 200;
+ Projectile.DamageType = RogueDamageClass.Instance;
+ Projectile.usesLocalNPCImmunity = true;
+ Projectile.localNPCHitCooldown = 30 * Projectile.MaxUpdates;
+ Projectile.ArmorPenetration = 30;
+ }
+
+ public override void AI()
+ {
+ Player Owner = Main.player[Projectile.owner];
+ float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
+
+ if (time == 0)
+ {
+ float orbScale = 0.6f * Main.rand.NextFloat(0.8f, 1.1f);
+ Color smokeColor = Color.Lerp(Color.DimGray, Color.DarkGreen, Main.rand.NextFloat(0.2f, 0.6f));
+ Particle orb = new CustomPulse(Projectile.Center, Vector2.Zero, smokeColor * 0.7f, "CalamityMod/ExtraTextures/GreyscaleVortex", new Vector2(1, 1), Projectile.ai[2] * 0.45f, orbScale, orbScale * 1.1f, 12, false);
+ GeneralParticleHandler.SpawnParticle(orb);
+ Particle orb3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Chartreuse, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.8f, 0.4f, 18);
+ GeneralParticleHandler.SpawnParticle(orb3);
+ Particle orb2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.4f, 0.2f, 18);
+ GeneralParticleHandler.SpawnParticle(orb2);
+
+ for (int i = 0; i < 2; i++)
+ {
+ int dir = (i == 0 ? 1 : -1);
+ Particle pulse3 = new GlowSparkParticle(Projectile.Center + new Vector2(20 * dir, 0), new Vector2(10 * dir, 0), false, 12, 0.087f, Color.Chartreuse, new Vector2(1.7f, 0.8f), true, true, 0.8f);
+ GeneralParticleHandler.SpawnParticle(pulse3);
+ }
+
+ for (int i = 0; i < 3; i++)
+ {
+ smokeColor = Color.Lerp(Color.DimGray, Color.DarkGreen, Main.rand.NextFloat(0.2f, 0.6f));
+ Particle smoke = new HeavySmokeParticle(Projectile.Center, new Vector2(27, 27).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f), smokeColor, Main.rand.Next(25, 40 + 1), Main.rand.NextFloat(0.7f, 1.3f), 0.5f, Main.rand.NextFloat(-0.2f, 0.2f), Main.rand.NextBool(), required: false);
+ GeneralParticleHandler.SpawnParticle(smoke);
+ }
+ spawnSpot = Projectile.Center;
+
+ targetedNPC = Projectile.Center.ClosestNPCAt(1200);
+ if (targetedNPC != null)
+ Projectile.velocity = (targetedNPC.Center - Projectile.Center + targetedNPC.velocity * 1.5f).SafeNormalize(Vector2.UnitX) * 8;
+ else
+ Projectile.velocity = (Owner.Calamity().mouseWorld - Projectile.Center).SafeNormalize(Vector2.UnitX) * 8;
+ }
+
+ if (targetDist < 1400 && time > 5)
+ {
+ Particle spark = new GlowSparkParticle(Projectile.Center + Main.rand.NextVector2Circular(70, 70), Projectile.velocity * Main.rand.NextFloat(1.5f, 5f), false, 2, Main.rand.NextFloat(0.04f, 0.06f), Color.Lerp(Color.Green, Color.Chartreuse, Main.rand.NextFloat(0.2f, 1f)), new Vector2(0.2f * (3 * Utils.GetLerpValue(40, 0, time, true) + 1), 1.5f), true, false, 0.3f);
+ GeneralParticleHandler.SpawnParticle(spark);
+ if (time % 6 == 0)
+ {
+ Particle spark2 = new AltLineParticle(Projectile.Center + Main.rand.NextVector2Circular(70, 70), Projectile.velocity * Main.rand.NextFloat(4.5f, 9f), false, 12, Main.rand.NextFloat(0.9f, 1.1f) * (2 * Utils.GetLerpValue(40, 0, time, true) + 1), Color.Lerp(Color.Green, Color.Chartreuse, Main.rand.NextFloat(0.2f, 1f)));
+ GeneralParticleHandler.SpawnParticle(spark2);
+ }
+ if (time % 4 == 0)
+ {
+ Dust c = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(70, 70), 267);
+ c.velocity = Projectile.velocity * Main.rand.NextFloat(0.5f, 3f);
+ c.scale = Main.rand.NextFloat(0.45f, 0.75f);
+ c.noGravity = true;
+ c.color = Color.Lerp(Color.White, Main.rand.NextBool(4) ? Color.Green : Color.Chartreuse, 0.7f);
+ c.noLight = true;
+ c.noLightEmittence = true;
+ }
+ }
+ if (time % 10 * Projectile.MaxUpdates == 0)
+ {
+ Owner.Calamity().GeneralScreenShakePower = 1.5f;
+ }
+
+ if (Projectile.ai[2] > 0 && time == 30)
+ Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnSpot, Projectile.velocity, ModContent.ProjectileType(), (int)(Projectile.damage), 0f, Projectile.owner, 0, 0, Projectile.ai[2] - 1);
+
+ time++;
+ }
+ public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
+ {
+ target.AddBuff(ModContent.BuffType(), 60);
+ }
+ public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 60, targetHitbox);
+ }
+}
diff --git a/Projectiles/Rogue/ReaperProjectile.cs b/Projectiles/Rogue/ReaperProjectile.cs
index b1f15611b0..4081ba6f1e 100644
--- a/Projectiles/Rogue/ReaperProjectile.cs
+++ b/Projectiles/Rogue/ReaperProjectile.cs
@@ -1,22 +1,39 @@
-using CalamityMod.Buffs.DamageOverTime;
+using System;
+using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Dusts;
+using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Particles;
using Microsoft.CodeAnalysis;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Graphics.PackedVector;
+using ReLogic.Content;
+using ReLogic.Utilities;
using Terraria;
using Terraria.Audio;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
+using static CalamityMod.CalamityUtils;
namespace CalamityMod.Projectiles.Rogue
{
public class ReaperProjectile : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Rogue";
+ public int time = 0;
+ public int ChargeupTime = 56;
+ public int Lifetime = 500;
+ public bool spinning = false;
public override string Texture => "CalamityMod/Items/Weapons/Rogue/TheOldReaper";
+ public float OverallProgress => 1 - Projectile.timeLeft / (float)Lifetime;
+ public float ThrowProgress => 1 - Projectile.timeLeft / (float)(Lifetime);
+ public float ChargeProgress => 1 - (Projectile.timeLeft - Lifetime) / (float)(ChargeupTime);
+ public Player Owner => Main.player[Projectile.owner];
+ public SlotId SpinSoundSlot;
+
+ Vector2 squash = Vector2.One;
public override void SetStaticDefaults()
{
@@ -33,168 +50,242 @@ namespace CalamityMod.Projectiles.Rogue
Projectile.ignoreWater = true;
Projectile.penetrate = -1;
Projectile.extraUpdates = 2;
- Projectile.timeLeft = Projectile.MaxUpdates * 120;
+ Projectile.timeLeft = Lifetime + ChargeupTime;
Projectile.usesLocalNPCImmunity = true;
- Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 9; // can't hit too fast, but can hit many many times
+ Projectile.localNPCHitCooldown = 15 * Projectile.MaxUpdates;
Projectile.DamageType = RogueDamageClass.Instance;
}
+ public override bool ShouldUpdatePosition()
+ {
+ return ChargeProgress >= 1;
+ }
+
+ public override bool? CanDamage()
+ {
+ //We don't want the anticipation to deal damage.
+ if (ChargeProgress < 1)
+ return false;
+
+ return base.CanDamage();
+ }
+ //Swing animation keys
+ public CurveSegment pullback = new CurveSegment(EasingType.PolyOut, 0f, 0f, MathHelper.PiOver4 * -1.2f, 2);
+ public CurveSegment throwout = new CurveSegment(EasingType.PolyOut, 0.7f, MathHelper.PiOver4 * -1.2f, MathHelper.PiOver4 * 1.2f + MathHelper.PiOver2, 3);
+ internal float ArmAnticipationMovement() => PiecewiseAnimation(ChargeProgress, new CurveSegment[] { pullback, throwout });
public override void AI()
{
- Projectile.rotation += 0.4f;
- if (Projectile.soundDelay == 0)
+ float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
+
+ Projectile.spriteDirection = Projectile.direction;
+
+ if (SoundEngine.TryGetActiveSound(SpinSoundSlot, out var SpinSound) && SpinSound.IsPlaying)
+ SpinSound.Position = Projectile.Center;
+
+ //Anticipation animation. Make the player look like theyre holding the weapon
+ if (ChargeProgress < 1)
{
- Projectile.soundDelay = 8;
- SoundEngine.PlaySound(SoundID.Item7, Projectile.position);
+ Owner.ChangeDir(MathF.Sign(Main.MouseWorld.X - Owner.Center.X));
+
+ float armRotation = ArmAnticipationMovement() * Owner.direction;
+
+ Owner.heldProj = Projectile.whoAmI;
+ Projectile.spriteDirection = Owner.direction;
+ Projectile.direction = Owner.direction;
+
+ Projectile.Center = Owner.MountedCenter + Vector2.UnitY.RotatedBy(armRotation * Owner.gravDir) * -70f * Owner.gravDir + new Vector2(14 * Owner.direction, 0);
+ Projectile.rotation = (-MathHelper.PiOver4 * Projectile.direction + armRotation) * Owner.gravDir;
+
+ Owner.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, MathHelper.Pi + armRotation);
+
+ time++;
+ return;
}
- if (Projectile.localAI[0] == 0f)
+
+ //Play the throw sound when the throw ACTUALLY BEGINS.
+ //Additionally, make the projectile collide and set its speed and velocity
+ if (Projectile.timeLeft == Lifetime)
{
- Projectile.ai[1] += 1f;
+ Projectile.netUpdate = true;
- // If the Reaper lands a hit, switch to second behavior mode immediately.
- if (Projectile.ai[1] >= 60f || Projectile.numHits > 0)
+ SoundStyle fire = new("CalamityMod/Sounds/Item/SwingMid");
+ SoundEngine.PlaySound(fire with { Volume = 0.8f, Pitch = Main.rand.NextFloat(0.2f, 0.3f) }, Projectile.Center);
+
+ Projectile.Center = Owner.MountedCenter + Projectile.velocity * 4f;
+ if (Projectile.Calamity().stealthStrike)
{
- Projectile.localAI[0] = 1f;
- Projectile.ai[1] = 0f;
- Projectile.netUpdate = true;
+ Projectile.velocity = new Vector2(0.5f * Owner.direction, -1) * 18;
}
-
- // Initial homing before landing a hit.
else
- CalamityUtils.HomeInOnNPC(Projectile, true, 250f, 14f, 14f);
+ {
+ Projectile.velocity = (Main.MouseWorld - Owner.Center).SafeNormalize(Vector2.UnitX * Owner.direction) * 15;
+ }
+ Projectile.spriteDirection = Projectile.direction;
+ SpinSoundSlot = SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/SpinningWoosh") with { Pitch = -0.3f, Volume = 0.75f }, Projectile.Center);
+
+ time = 0;
+ spinning = true;
}
- // Homing after landing a hit. This homing repeatedly turns on and off.
+ if (Projectile.velocity.X > 0)
+ Projectile.direction = 1;
else
+ Projectile.direction = -1;
+
+ if (spinning)
{
- float homingRange = 1100f; //tbh 700 works for fat targets but then we'll get so many bug reports cuz it doesnt work on dummies
- bool noHomingThisFrame = false;
- if (Projectile.ai[0] == 1f)
+ if (Projectile.velocity.Length() < 15)
+ Projectile.velocity *= 1.01f;
+ if (time == 0)
+ Projectile.rotation += Main.rand.NextFloat(0, 10) * Projectile.direction;
+ squash = new Vector2(1.3f, 0.8f);
+ Projectile.rotation += 0.2f * Projectile.direction;
+
+ if (targetDist < 1400)
{
- Projectile.ai[1] += 1f;
- if (Projectile.ai[1] > 30f)
+ for (int i = 0; i < 2; i++)
{
- Projectile.ai[1] = 0f;
- Projectile.ai[0] = 0f;
- Projectile.netUpdate = true;
+ float rot = Main.rand.NextFloat(-5.5f, 5.5f);
+ float scale = Main.rand.NextFloat(1f, 1.15f);
+ Particle Smear = new CustomPulse(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 18, Projectile.velocity, Color.Chartreuse * Main.rand.NextFloat(0.68f, 0.75f), "CalamityMod/Particles/CircularSmearSmokey", squash.RotatedBy(rot), Projectile.velocity.ToRotation() + MathHelper.ToRadians(150f) - rot, scale, scale, 3);
+ GeneralParticleHandler.SpawnParticle(Smear);
+ }
+
+ if (time % 7 == 0)
+ {
+ Particle trail = new SparkParticle(Projectile.Center + Main.rand.NextVector2Circular(80, 80), -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.8f), false, 60, Main.rand.NextFloat(0.9f, 1.5f), Color.Chartreuse);
+ GeneralParticleHandler.SpawnParticle(trail);
+ }
+ for (int i = 0; i < 2; i++)
+ {
+ float rot2 = (Projectile.rotation * Projectile.direction);
+ Vector2 dustPos = Projectile.Center + (i * MathHelper.Pi + Projectile.rotation * 0.3f + MathHelper.PiOver2).ToRotationVector2() * 70f;
+ Dust dust = Dust.NewDustPerfect(dustPos, 267);
+ dust.noGravity = true;
+ dust.scale = 0.8f;
+ dust.color = Color.Chartreuse;
+ dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.45f, 0.6f);
+ }
+ if (Main.rand.NextBool())
+ {
+ Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(23, 23), Main.rand.NextBool(7) ? 28 : 215);
+ dust.noGravity = true;
+ dust.scale = Main.rand.NextFloat(0.9f, 1.3f);
+ dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.7f);
}
- else
- noHomingThisFrame = true;
}
- if (noHomingThisFrame)
- return;
-
- Vector2 homingTarget = Projectile.Center;
- bool foundTarget = false;
- Vector2 targetVelocity = new Vector2(0f);
- foreach (NPC potentialTarget in Main.ActiveNPCs)
+ if (Projectile.Calamity().stealthStrike)
{
- if (potentialTarget.CanBeChasedBy(Projectile, false) && Projectile.WithinRange(potentialTarget.Center, homingRange))
+ if (time == 30)
{
- if (!foundTarget)
+ SpinSound?.Stop();
+ SoundStyle fire = new("CalamityMod/Sounds/Item/RadiationBurst");
+ SpinSoundSlot = SoundEngine.PlaySound(fire with { Volume = 1f, Pitch = 0.3f }, Projectile.Center);
+ }
+ if (time >= 150)
+ {
+ NPC target = Owner.Calamity().mouseWorld.ClosestNPCAt(4000);
+ if (time == 150)
{
- homingRange = Vector2.Distance(Projectile.Center, potentialTarget.Center);
- homingTarget = potentialTarget.Center;
- targetVelocity = potentialTarget.velocity;
- foundTarget = true;
- break;
+ Projectile.extraUpdates = 25;
+ }
+ if (target != null)
+ {
+ if (Projectile.numHits <= 0 && Projectile.velocity.Length() < 15)
+ Projectile.velocity += (target.Center - Projectile.Center).SafeNormalize(Vector2.UnitX) * 0.9f;
+ else if (Projectile.numHits <= 0)
+ Projectile.velocity *= 0.9f;
+ }
+ else if (time == 150)
+ {
+ Projectile.velocity = (Owner.Calamity().mouseWorld - Projectile.Center).SafeNormalize(Vector2.UnitX * Owner.direction) * 15;
+ }
+ Particle spark = new GlowSparkParticle(Projectile.Center + Projectile.velocity * Main.rand.NextFloat(-2, -1), -Projectile.velocity * 0.3f, false, 7, 0.13f, Color.Lerp(Color.Green, Color.Chartreuse, 0.8f) * 0.65f, new Vector2(1, 0.3f), true, false, 1.3f);
+ GeneralParticleHandler.SpawnParticle(spark);
+ }
+ else if (time > 30)
+ {
+ Projectile.velocity *= 0.955f;
+ float fade = Utils.GetLerpValue(150, 0, time);
+ float numberOfDusts = 2f;
+ float rotFactor = 360f / numberOfDusts;
+ for (int i = 0; i < numberOfDusts; i++)
+ {
+ float rot = MathHelper.ToRadians(i * rotFactor);
+ Vector2 velOffset = CalamityUtils.RandomVelocity(100f, 70f, 250f, 0.04f);
+ velOffset *= Main.rand.NextFloat(25, 45) * fade;
+ Particle energy = new GlowOrbParticle(Projectile.Center + velOffset * 2.5f, -velOffset * Main.rand.NextFloat(0.08f, 0.12f) * 1.5f, false, (int)(14 - (5 * fade)), Main.rand.NextFloat(1.1f, 1.25f) - 0.5f * fade, Color.Chartreuse);
+ GeneralParticleHandler.SpawnParticle(energy);
+ Dust dust = Dust.NewDustPerfect(Projectile.Center + velOffset * 2.5f, 278, -velOffset * Main.rand.NextFloat(0.08f, 0.12f) * 1.5f, 0, default, Main.rand.NextFloat(0.4f, 0.6f));
+ dust.noGravity = true;
+ dust.color = Color.Chartreuse;
}
}
}
-
-
- if (foundTarget && Projectile.ai[0] == 0f)
- {
- bool perfectAim = Main.rand.NextBool(3);
- if (perfectAim)
- Projectile.velocity = CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, homingTarget, targetVelocity, Main.rand.NextFloat(18f, 20f));
- else
- {
- float angularTurnSpeed = 0.35f;
- float angleToTargetCoords = Projectile.AngleTo(homingTarget);
- Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(angleToTargetCoords, angularTurnSpeed).ToRotationVector2() * Main.rand.NextFloat(18f, 20f);
- }
- }
-
- if (Projectile.ai[1] > 0f)
- Projectile.ai[1] += (float)Main.rand.Next(1, 5);
- if (Projectile.ai[1] > 30f)
- {
- Projectile.ai[1] = 0f;
- Projectile.netUpdate = true;
- }
-
- if (Projectile.ai[0] == 0f)
- {
- if (Projectile.ai[1] == 0f && foundTarget && homingRange < 500f)
- {
- Projectile.ai[1] += 1f;
- if (Main.myPlayer == Projectile.owner)
- Projectile.ai[0] = 1f;
- }
- }
}
- }
- public override bool PreDraw(ref Color lightColor)
+ time++;
+ }
+ public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
- if (Projectile.ai[0] == 1)
+ if (Projectile.Calamity().stealthStrike && time <= 151)
+ Projectile.numHits--;
+ if (Projectile.numHits == 0)
{
- //Glowing
- Main.spriteBatch.EnterShaderRegion();
- GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(1.64f, 0.8f, 0.5f)); //Using RGB directly fails, gotta use HSL
- float opacityFactor = Projectile.ai[1] - 5;
- if (opacityFactor < 0f)
- opacityFactor = 0f;
- GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(opacityFactor / 40f);
- GameShaders.Misc["CalamityMod:BasicTint"].Apply();
- CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
- Main.spriteBatch.ExitShaderRegion();
+ if (Projectile.Calamity().stealthStrike) // Rainstorm
+ {
+ Vector2 rainSpot = Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 490;
+ SoundStyle fire = new("CalamityMod/Sounds/Item/RadiationRain");
+ SoundEngine.PlaySound(fire with { Volume = 1f, Pitch = 0 }, rainSpot);
+ SoundStyle fire2 = new("CalamityMod/Sounds/Item/ViperSpit");
+ SoundEngine.PlaySound(fire2 with { Volume = 1f, Pitch = -0.3f }, rainSpot);
+ for (int i = 0; i < 37; i++)
+ {
+ Dust chargefull = Dust.NewDustPerfect(rainSpot, 278);
+ chargefull.velocity = Projectile.velocity.RotatedByRandom(100) * Main.rand.NextFloat(1, 8);
+ chargefull.scale = Main.rand.NextFloat(0.45f, 0.75f);
+ chargefull.noGravity = true;
+ chargefull.color = Color.Lerp(Color.White, Main.rand.NextBool(4) ? Color.Green : Color.Chartreuse, 0.7f);
+ }
+ Particle Smear = new CustomPulse(rainSpot, Vector2.Zero, Color.Chartreuse * 0.7f, "CalamityMod/Particles/DustyCircleHardEdge", Vector2.One, Main.rand.NextFloat(-5, 5), 0, 0.35f, 12);
+ GeneralParticleHandler.SpawnParticle(Smear);
+ Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), rainSpot, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), 0f, Projectile.owner, 0, 0, 100);
+ }
+ else // Radiation Burst
+ {
+ SoundStyle fire = new("CalamityMod/Sounds/Item/RadiationBurst");
+ SoundEngine.PlaySound(fire with { Volume = 1f, Pitch = 0, MaxInstances = -1 }, Projectile.Center);
+ Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage), Projectile.knockBack * 3, Projectile.owner, 0, 0, 0);
+ }
}
- else
- CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
- return false;
- }
+ target.AddBuff(ModContent.BuffType(), 90);
- public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
- {
- target.AddBuff(ModContent.BuffType(), 180);
- target.AddBuff(ModContent.BuffType(), 180);
- }
-
- public override void OnHitPlayer(Player target, Player.HurtInfo info)
- {
- target.AddBuff(ModContent.BuffType(), 180);
- target.AddBuff(ModContent.BuffType(), 180);
+ float minMult = 0.25f;
+ int hitsToMinMult = 8;
+ float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true);
+ modifiers.SourceDamage *= damageMult;
}
public override void OnKill(int timeLeft)
{
- SoundEngine.PlaySound(SoundID.Item21, Projectile.position);
- Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2);
- Projectile.position.Y = Projectile.position.Y + (float)(Projectile.height / 2);
- Projectile.width = 100;
- Projectile.height = 100;
- Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
- Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
- for (int i = 0; i < 5; i++)
- {
- int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.SulphurousSeaAcid, 0f, 0f, 100, default, 2f);
- Main.dust[dust].velocity *= 3f;
- if (Main.rand.NextBool())
- {
- Main.dust[dust].scale = 0.5f;
- Main.dust[dust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
- }
- }
- for (int j = 0; j < 8; j++)
- {
- int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.SulphurousSeaAcid, 0f, 0f, 100, default, 3f);
- Main.dust[dust2].noGravity = true;
- Main.dust[dust2].velocity *= 5f;
- dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.SulphurousSeaAcid, 0f, 0f, 100, default, 2f);
- Main.dust[dust2].velocity *= 2f;
- }
+ if (SoundEngine.TryGetActiveSound(SpinSoundSlot, out var SpinSound))
+ SpinSound?.Stop();
}
+ public override bool PreDraw(ref Color lightColor)
+ {
+ Vector2 drawPos = Projectile.Center - Main.screenPosition;
+ Asset tex = ModContent.Request(Texture);
+ Main.EntitySpriteDraw(tex.Value, drawPos, null, spinning ? Color.White : Color.Lerp(lightColor, Color.White, Utils.GetLerpValue(0, ChargeupTime, time, true)), Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, Projectile.spriteDirection > 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally);
+
+ Asset p = ModContent.Request("CalamityMod/Particles/VerticalSmear");
+
+ if (spinning)
+ {
+ Main.EntitySpriteDraw(p.Value, drawPos + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 4, null, Color.Chartreuse with { A = 0 } * 0.45f, Projectile.velocity.ToRotation() + MathHelper.PiOver2, p.Size() * 0.5f, new Vector2(0.9f - 0.3f * Utils.GetLerpValue(25, 0, time, true), 1 + 0.6f * Utils.GetLerpValue(25, 0, time, true)) * Main.rand.NextFloat(1.25f, 1.4f), SpriteEffects.None);
+ CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Chartreuse * 0.5f, 1);
+ }
+ return false;
+ }
+ public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 70, targetHitbox);
}
}
diff --git a/Projectiles/Rogue/ToxicantTwisterDust.cs b/Projectiles/Rogue/ToxicantTwisterDust.cs
index e7c66ff3e9..690eabffda 100644
--- a/Projectiles/Rogue/ToxicantTwisterDust.cs
+++ b/Projectiles/Rogue/ToxicantTwisterDust.cs
@@ -1,7 +1,14 @@
-using CalamityMod.Buffs.DamageOverTime;
+using System;
+using CalamityMod.Buffs.DamageOverTime;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework;
+using ReLogic.Content;
using Terraria;
+using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
+using CalamityMod.Dusts;
+using CalamityMod.Particles;
namespace CalamityMod.Projectiles.Rogue
{
@@ -9,29 +16,82 @@ namespace CalamityMod.Projectiles.Rogue
{
public new string LocalizationCategory => "Projectiles.Rogue";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
+ public NPC targetedNPC;
public override void SetDefaults()
{
Projectile.width = 6;
Projectile.height = 6;
Projectile.friendly = true;
- Projectile.tileCollide = true;
+ Projectile.tileCollide = false;
Projectile.ignoreWater = true;
- Projectile.penetrate = 1;
+ Projectile.penetrate = -1;
+ Projectile.extraUpdates = 3;
Projectile.timeLeft = 180;
Projectile.DamageType = RogueDamageClass.Instance;
+ Projectile.usesLocalNPCImmunity = true;
+ Projectile.localNPCHitCooldown = 30;
}
public override void AI()
{
- int idx = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedBrown, 0f, 0f, 100, default, 1f);
- Main.dust[idx].noGravity = true;
- Main.dust[idx].velocity *= 0f;
+ Player Owner = Main.player[Projectile.owner];
+ float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
+ if (Projectile.ai[1] % 2 == 0 && targetDist < 1400)
+ {
+ Particle spark = new GlowSparkParticle(Projectile.Center + Projectile.velocity * Main.rand.NextFloat(-2, -1), -Projectile.velocity * 0.3f, false, 5, 0.04f, Color.Lerp(Color.Green, Color.Chartreuse, 0.8f) * 0.65f, new Vector2(1, 0.3f), true, false, 1.5f);
+ GeneralParticleHandler.SpawnParticle(spark);
+ }
+
+ Projectile.rotation += 0.2f;
+
+ targetedNPC = (Projectile.ai[1] > 90) ? Projectile.Center.ClosestNPCAt(1200) : null;
+ float moveSpeed = Utils.GetLerpValue(200, 0, Projectile.timeLeft);
+ if (targetedNPC == null)
+ {
+ Vector2 position = (Owner.Calamity().mouseWorld + ((new Vector2(0, -250).RotatedBy(Projectile.rotation * 0.2f)).RotatedBy(MathHelper.ToRadians(90f) * Projectile.ai[2])));
+ Vector2 moveToMouse = (position - Projectile.Center).SafeNormalize(Vector2.UnitX);
+ if (Projectile.velocity.Length() < 8)
+ Projectile.velocity += moveToMouse * (0.7f);
+ else
+ Projectile.velocity *= 0.9f;
+ }
+ else
+ {
+ Vector2 position = targetedNPC.Center;
+ Vector2 moveToMouse = (position - Projectile.Center).SafeNormalize(Vector2.UnitX);
+ if (Projectile.velocity.Length() < 13 * moveSpeed)
+ Projectile.velocity += moveToMouse * moveSpeed;
+ else
+ Projectile.velocity *= 0.9f;
+ if (Projectile.ai[1] % 2 == 0)
+ Projectile.timeLeft++; // Lasts longer if it has a target
+ }
+ if (targetedNPC != null && targetedNPC.life <= 0)
+ targetedNPC = null;
+
+ Projectile.ai[1]++;
+ }
+ public override void OnKill(int timeLeft)
+ {
+ for (int i = 0; i <= 2; i++)
+ {
+ Dust dust = Dust.NewDustPerfect(Projectile.Center, (int)CalamityDusts.SulphurousSeaAcid, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.3f, 1.8f), 0, default, Main.rand.NextFloat(1.3f, 1.8f));
+ dust.noGravity = true;
+ }
+ }
+ public override bool PreDraw(ref Color lightColor)
+ {
+ Asset tex = ModContent.Request(Texture);
+ return true;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
- target.AddBuff(ModContent.BuffType(), 120);
+ target.AddBuff(ModContent.BuffType(), 180);
+ if (target == targetedNPC)
+ Projectile.Kill();
}
+ public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 40, targetHitbox);
}
}
diff --git a/Projectiles/Rogue/ToxicantTwisterProj.cs b/Projectiles/Rogue/ToxicantTwisterProj.cs
new file mode 100644
index 0000000000..34bdbd5884
--- /dev/null
+++ b/Projectiles/Rogue/ToxicantTwisterProj.cs
@@ -0,0 +1,125 @@
+using System;
+using CalamityMod.Buffs.DamageOverTime;
+using CalamityMod.Dusts;
+using CalamityMod.Particles;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using ReLogic.Content;
+using Terraria;
+using Terraria.Audio;
+using Terraria.ID;
+using Terraria.ModLoader;
+
+namespace CalamityMod.Projectiles.Rogue
+{
+ public class ToxicantTwisterProj : ModProjectile, ILocalizedModType
+ {
+ public new string LocalizationCategory => "Projectiles.Rogue";
+ public override string Texture => "CalamityMod/Items/Weapons/Rogue/ToxicantTwister";
+
+ private int targetIndex = -1;
+ public float circleRange = -150;
+ public float circleSpeed = 1;
+ public override void SetStaticDefaults()
+ {
+ ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15;
+ ProjectileID.Sets.TrailingMode[Projectile.type] = 2;
+ }
+ public override void SetDefaults()
+ {
+ Projectile.width = 42;
+ Projectile.height = 46;
+ Projectile.friendly = true;
+ Projectile.tileCollide = false;
+ Projectile.ignoreWater = true;
+ Projectile.penetrate = -1;
+ Projectile.extraUpdates = 1;
+ Projectile.timeLeft = 300;
+ Projectile.DamageType = RogueDamageClass.Instance;
+ Projectile.usesLocalNPCImmunity = true;
+ Projectile.localNPCHitCooldown = 15 * Projectile.MaxUpdates;
+ }
+
+ public override void AI()
+ {
+ Player Owner = Main.player[Projectile.owner];
+ if (Projectile.Calamity().stealthStrike)
+ {
+ Projectile.extraUpdates = 2;
+ if (Projectile.ai[1] == 0)
+ {
+ Projectile.timeLeft = 600;
+ circleRange *= 5;
+ circleSpeed *= 3;
+ }
+ if (Projectile.timeLeft % 30 == 0)
+ {
+ Projectile dustProjectile = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedByRandom(0.1f) * -0.6f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5), 0f, Projectile.owner, 0, 0, Projectile.ai[2]);
+ dustProjectile.timeLeft = 240;
+ }
+ }
+
+ if (Main.rand.NextBool(4) && Projectile.ai[1] > 7)
+ {
+ Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(13, 13), Main.rand.NextBool(3) ? 215 : (int)CalamityDusts.SulphurousSeaAcid);
+ dust.noGravity = true;
+ dust.scale = Main.rand.NextFloat(0.9f, 1.3f) * Utils.GetLerpValue(255, 0, Projectile.alpha);
+ dust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.7f);
+ }
+
+ float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
+ if (Projectile.ai[1] % 2 == 0 && Projectile.ai[1] > 7 && targetDist < 1400)
+ {
+ Particle spark = new GlowSparkParticle(Projectile.Center + Projectile.velocity * Main.rand.NextFloat(-2, -1), -Projectile.velocity * 0.3f, false, 6, 0.07f, Color.Lerp(Color.Green, Color.Chartreuse, 0.8f) * 0.65f, new Vector2(1, 0.3f), true, false, 1);
+ GeneralParticleHandler.SpawnParticle(spark);
+ }
+
+ // Boomerang rotation
+ Projectile.rotation += 0.5f / circleSpeed;
+
+ if (Projectile.ai[1] > 20f)
+ {
+ Vector2 position = (Owner.Calamity().mouseWorld + ((new Vector2(0, circleRange).RotatedBy(Projectile.rotation * 0.2f)).RotatedBy(MathHelper.ToRadians(90f) * Projectile.ai[2])));
+ Vector2 moveToMouse = (position - Projectile.Center).SafeNormalize(Vector2.UnitX);
+ if (Projectile.velocity.Length() < 18)
+ Projectile.velocity += moveToMouse * circleSpeed;
+ else
+ Projectile.velocity *= 0.9f;
+ }
+ else
+ {
+ Projectile.velocity *= 0.985f;
+ }
+ Projectile.ai[1]++;
+ }
+ public override void OnKill(int timeLeft)
+ {
+ for (int i = 0; i <= 5; i++)
+ {
+ Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(3) ? 215 : (int)CalamityDusts.SulphurousSeaAcid, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.3f, 1.8f), 0, default, Main.rand.NextFloat(1.3f, 1.8f));
+ dust.noGravity = true;
+ }
+ }
+ public override bool PreDraw(ref Color lightColor)
+ {
+ Asset tex = ModContent.Request(Texture);
+
+ for (int i = 0; i < 3; i++)
+ {
+ Color auraColor = Color.Lerp(Color.Chartreuse, Color.Lime, Utils.GetLerpValue(0, 3, i)) * 0.7f;
+ Vector2 rotationalDrawOffset = (MathHelper.TwoPi * i / 7f + Main.GlobalTimeWrappedHourly * 27f).ToRotationVector2();
+ rotationalDrawOffset *= MathHelper.Lerp(3f, 5.25f, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 15f) * 0.5f + 1f);
+ Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + rotationalDrawOffset, null, auraColor with { A = 0 } * Utils.GetLerpValue(255, 0, Projectile.alpha), Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None);
+ }
+
+ CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor * 0.3f, 2);
+ return true;
+ }
+
+ public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
+ {
+ target.AddBuff(ModContent.BuffType(), 180);
+ }
+ public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 55, targetHitbox);
+ }
+}
diff --git a/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs b/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs
deleted file mode 100644
index 66788be39e..0000000000
--- a/Projectiles/Rogue/ToxicantTwisterTwoPointZero.cs
+++ /dev/null
@@ -1,151 +0,0 @@
-using CalamityMod.Buffs.DamageOverTime;
-using CalamityMod.Dusts;
-using Microsoft.Xna.Framework;
-using Terraria;
-using Terraria.Audio;
-using Terraria.ID;
-using Terraria.ModLoader;
-
-namespace CalamityMod.Projectiles.Rogue
-{
- public class ToxicantTwisterTwoPointZero : ModProjectile, ILocalizedModType
- {
- public new string LocalizationCategory => "Projectiles.Rogue";
- public override string Texture => "CalamityMod/Items/Weapons/Rogue/ToxicantTwister";
-
- private int lifeTime = 300;
- private int targetIndex = -1;
-
- public override void SetDefaults()
- {
- Projectile.width = 42;
- Projectile.height = 46;
- Projectile.friendly = true;
- Projectile.tileCollide = false;
- Projectile.ignoreWater = true;
- Projectile.penetrate = -1;
- Projectile.timeLeft = lifeTime;
- Projectile.DamageType = RogueDamageClass.Instance;
- Projectile.usesLocalNPCImmunity = true;
- Projectile.localNPCHitCooldown = 12;
- }
-
- public override void AI()
- {
- if (Projectile.Calamity().stealthStrike)
- {
- if (Projectile.timeLeft % 20 == 0 && Main.myPlayer == Projectile.owner)
- {
- for (int i = 0; i < 2; i++)
- Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity.RotatedByRandom(0.1f) * -0.6f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.25), 0f, Projectile.owner);
- }
- Projectile.rotation += 0.06f * (Projectile.velocity.X > 0).ToDirectionInt();
- }
- // Boomerang rotation
- Projectile.rotation += 0.4f * Projectile.direction;
-
- // Boomerang sound
- if (Projectile.soundDelay == 0)
- {
- Projectile.soundDelay = 8;
- SoundEngine.PlaySound(SoundID.Item7, Projectile.position);
- }
-
- Projectile.ai[1]++;
- if (Projectile.ai[0] != 0f)
- {
- float returnSpeed = 30f;
- float acceleration = 1.4f;
-
- Player owner = Main.player[Projectile.owner];
-
- // Delete the projectile if it's excessively far away.
- Vector2 projVector = owner.Center - Projectile.Center;
- float dist = projVector.Length();
- if (dist > 3000f)
- Projectile.Kill();
-
- dist = returnSpeed / dist;
- projVector.X *= dist;
- projVector.Y *= dist;
-
- // Home back in on the player.
- if (Projectile.velocity.X < projVector.X)
- {
- Projectile.velocity.X += acceleration;
- if (Projectile.velocity.X < 0f && projVector.X > 0f)
- Projectile.velocity.X += acceleration;
- }
- else if (Projectile.velocity.X > projVector.X)
- {
- Projectile.velocity.X -= acceleration;
- if (Projectile.velocity.X > 0f && projVector.X < 0f)
- Projectile.velocity.X -= acceleration;
- }
- if (Projectile.velocity.Y < projVector.Y)
- {
- Projectile.velocity.Y += acceleration;
- if (Projectile.velocity.Y < 0f && projVector.Y > 0f)
- Projectile.velocity.Y += acceleration;
- }
- else if (Projectile.velocity.Y > projVector.Y)
- {
- Projectile.velocity.Y -= acceleration;
- if (Projectile.velocity.Y > 0f && projVector.Y < 0f)
- Projectile.velocity.Y -= acceleration;
- }
-
- // Delete the projectile if it touches its owner.
- if (Main.myPlayer == Projectile.owner)
- if (Projectile.Hitbox.Intersects(owner.Hitbox))
- Projectile.Kill();
- }
- else if (Projectile.ai[1] > 40f)
- {
- NPC closestTarget = Projectile.Center.ClosestNPCAt(1769f, true, true);
- if (closestTarget != null)
- {
- Projectile.extraUpdates = 1;
- targetIndex = closestTarget.whoAmI;
- float inertia = 20f;
- float homingVelocity = Projectile.Calamity().stealthStrike ? 30f : 20f;
- Vector2 moveDirection = Projectile.SafeDirectionTo(closestTarget.Center, Vector2.UnitY);
-
- Projectile.velocity = (Projectile.velocity * inertia + moveDirection * homingVelocity) / (inertia + 1f);
- }
- }
- else
- {
- Projectile.velocity *= 0.985f;
- }
- }
-
- public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
- {
- if (Projectile.ai[1] <= 40f && Projectile.ai[0] != 1f)
- {
- modifiers.SourceDamage *= 0.3333f;
- }
- }
-
- public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
- {
- if (targetIndex == target.whoAmI)
- Projectile.ai[0] = 1f;
-
- target.AddBuff(ModContent.BuffType(), 180);
- SoundEngine.PlaySound(SoundID.Item20, Projectile.position);
- for (int k = 0; k < 10; k++)
- Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.SulphurousSeaAcid, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
- }
-
- public override void OnHitPlayer(Player target, Player.HurtInfo info)
- {
- Projectile.ai[0] = 1f;
- target.AddBuff(ModContent.BuffType(), 180);
- SoundEngine.PlaySound(SoundID.Item20, Projectile.position);
- for (int k = 0; k < 10; k++)
- Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (int)CalamityDusts.SulphurousSeaAcid, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
- }
- }
-}
diff --git a/Projectiles/Rogue/WrathwingFireball.cs b/Projectiles/Rogue/WrathwingFireball.cs
index ea87dc0f35..2d3428e84c 100644
--- a/Projectiles/Rogue/WrathwingFireball.cs
+++ b/Projectiles/Rogue/WrathwingFireball.cs
@@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Rogue
int frameHeight = texture.Height / Main.projFrames[Projectile.type];
int frameY = frameHeight * Projectile.frame;
Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 0; i < Projectile.oldPos.Length; i++)
{
diff --git a/Projectiles/Summon/IceClasperMinion.cs b/Projectiles/Summon/IceClasperMinion.cs
index 94aca8ef17..89aded9c6b 100644
--- a/Projectiles/Summon/IceClasperMinion.cs
+++ b/Projectiles/Summon/IceClasperMinion.cs
@@ -199,7 +199,7 @@ namespace CalamityMod.Projectiles.Summon
AfterimageInterpolant = MathHelper.Clamp(AfterimageInterpolant, 0f, 1f);
float AfterimageFade = MathHelper.Lerp(0f, 1f, AfterimageInterpolant);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 0; i < Projectile.oldPos.Length; i++)
{
diff --git a/Projectiles/Summon/MidnightSunUFO.cs b/Projectiles/Summon/MidnightSunUFO.cs
index 78ac6024cb..fe93e7ab10 100644
--- a/Projectiles/Summon/MidnightSunUFO.cs
+++ b/Projectiles/Summon/MidnightSunUFO.cs
@@ -142,7 +142,7 @@ namespace CalamityMod.Projectiles.Summon
Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame);
Color drawColor = Projectile.GetAlpha(lightColor);
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 0; i < Projectile.oldPos.Length; i++)
{
diff --git a/Projectiles/Summon/MiniGuardianRock.cs b/Projectiles/Summon/MiniGuardianRock.cs
index 5f7c775d22..f4030d1c70 100644
--- a/Projectiles/Summon/MiniGuardianRock.cs
+++ b/Projectiles/Summon/MiniGuardianRock.cs
@@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Summon
lerpVal = Utils.GetLerpValue(psc ? 87 : 57, psc ? 150 : 120, ownerDist, true);
mult = MathHelper.Lerp(0.42f, 1f, lerpVal);
}
- if (CalamityConfig.Instance.Afterimages && Projectile.ai[0] >= 1f) //handle afterimages manually since the utility broke it and didn't render correctly
+ if (CalamityClientConfig.Instance.Afterimages && Projectile.ai[0] >= 1f) //handle afterimages manually since the utility broke it and didn't render correctly
{
for (int i = 0; i < Projectile.oldPos.Length; ++i)
{
diff --git a/Projectiles/Summon/MirrorofKalandraMinions/HopeShredderArrow.cs b/Projectiles/Summon/MirrorofKalandraMinions/HopeShredderArrow.cs
index 5e064d63a7..1d1faac2f7 100644
--- a/Projectiles/Summon/MirrorofKalandraMinions/HopeShredderArrow.cs
+++ b/Projectiles/Summon/MirrorofKalandraMinions/HopeShredderArrow.cs
@@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions
Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame);
Vector2 origin = frame.Size() * 0.5f;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 0; i < Projectile.oldPos.Length; i++)
{
diff --git a/Projectiles/Summon/MirrorofKalandraMinions/Paradoxica.cs b/Projectiles/Summon/MirrorofKalandraMinions/Paradoxica.cs
index a504571104..98bab8425f 100644
--- a/Projectiles/Summon/MirrorofKalandraMinions/Paradoxica.cs
+++ b/Projectiles/Summon/MirrorofKalandraMinions/Paradoxica.cs
@@ -190,7 +190,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions
Vector2 origin = frame.Size() * 0.5f;
float rotation = (Target is not null) ? Projectile.rotation : Projectile.rotation + MathHelper.PiOver4;
- if (CalamityConfig.Instance.Afterimages && Target is not null)
+ if (CalamityClientConfig.Instance.Afterimages && Target is not null)
{
for (int i = 0; i < Projectile.oldPos.Length; i++)
{
diff --git a/Projectiles/Summon/MirrorofKalandraMinions/Starforge.cs b/Projectiles/Summon/MirrorofKalandraMinions/Starforge.cs
index 2ddb451933..c2fdddd74b 100644
--- a/Projectiles/Summon/MirrorofKalandraMinions/Starforge.cs
+++ b/Projectiles/Summon/MirrorofKalandraMinions/Starforge.cs
@@ -138,7 +138,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions
DrawSpin -= MathHelper.ToRadians(MirrorofKalandra.Purple_SpinSpeed);
float rotation = (Target is not null) ? DrawSpin : Projectile.rotation + MathHelper.Pi - MathHelper.PiOver4;
- if (CalamityConfig.Instance.Afterimages && Target is not null)
+ if (CalamityClientConfig.Instance.Afterimages && Target is not null)
{
for (int i = 0; i < Projectile.oldPos.Length; i++)
{
diff --git a/Projectiles/Summon/MirrorofKalandraMinions/WindRipperArrow.cs b/Projectiles/Summon/MirrorofKalandraMinions/WindRipperArrow.cs
index e972745785..006b16a2e1 100644
--- a/Projectiles/Summon/MirrorofKalandraMinions/WindRipperArrow.cs
+++ b/Projectiles/Summon/MirrorofKalandraMinions/WindRipperArrow.cs
@@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions
Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame);
Vector2 origin = frame.Size() * 0.5f;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 0; i < Projectile.oldPos.Length; i++)
{
diff --git a/Projectiles/Summon/MutatedTruffleMinion.cs b/Projectiles/Summon/MutatedTruffleMinion.cs
index 20ca2992a1..498383c09d 100644
--- a/Projectiles/Summon/MutatedTruffleMinion.cs
+++ b/Projectiles/Summon/MutatedTruffleMinion.cs
@@ -267,7 +267,7 @@ namespace CalamityMod.Projectiles.Summon
float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 && State != AIState.Idle ? MathHelper.Pi : 0f);
SpriteEffects effects = (Projectile.spriteDirection == 1) ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
- if (CalamityConfig.Instance.Afterimages && (State == AIState.Dashing || State == AIState.Vortex))
+ if (CalamityClientConfig.Instance.Afterimages && (State == AIState.Dashing || State == AIState.Vortex))
{
for (int i = 0; i < Projectile.oldPos.Length; i++)
{
diff --git a/Projectiles/Summon/PhantomicDagger.cs b/Projectiles/Summon/PhantomicDagger.cs
index 7ffcd03e5a..1d62639829 100644
--- a/Projectiles/Summon/PhantomicDagger.cs
+++ b/Projectiles/Summon/PhantomicDagger.cs
@@ -91,7 +91,7 @@ namespace CalamityMod.Projectiles.Summon
public override bool PreDraw(ref Color lightColor)
{
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
}
diff --git a/Projectiles/Summon/PlantationStaffSeed.cs b/Projectiles/Summon/PlantationStaffSeed.cs
index 86f09239fc..e891f75ec4 100644
--- a/Projectiles/Summon/PlantationStaffSeed.cs
+++ b/Projectiles/Summon/PlantationStaffSeed.cs
@@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Summon
Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame);
Vector2 origin = frame.Size() * 0.5f;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 0; i < Projectile.oldPos.Length; i++)
{
diff --git a/Projectiles/Summon/PlantationStaffSummon.cs b/Projectiles/Summon/PlantationStaffSummon.cs
index 8e0f6380f5..7d8bd78097 100644
--- a/Projectiles/Summon/PlantationStaffSummon.cs
+++ b/Projectiles/Summon/PlantationStaffSummon.cs
@@ -341,7 +341,7 @@ namespace CalamityMod.Projectiles.Summon
Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame);
Vector2 origin = frame.Size() * 0.5f;
- if (State == AIState.Ramming && CalamityConfig.Instance.Afterimages)
+ if (State == AIState.Ramming && CalamityClientConfig.Instance.Afterimages)
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor);
Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
diff --git a/Projectiles/Summon/PlantationStaffTentacle.cs b/Projectiles/Summon/PlantationStaffTentacle.cs
index a713ee71f3..e1cd5ad274 100644
--- a/Projectiles/Summon/PlantationStaffTentacle.cs
+++ b/Projectiles/Summon/PlantationStaffTentacle.cs
@@ -229,7 +229,7 @@ namespace CalamityMod.Projectiles.Summon
}
}
}
- else if (CalamityConfig.Instance.Afterimages)
+ else if (CalamityClientConfig.Instance.Afterimages)
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor);
return true;
diff --git a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs
index 3d7c55e6ed..218ceafe13 100644
--- a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs
+++ b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs
@@ -1639,7 +1639,7 @@ namespace CalamityMod.Projectiles.Summon
drawPos -= new Vector2(texture.Width, texture.Height) * Projectile.scale / 2f;
drawPos += drawOrigin * Projectile.scale + new Vector2(0f, Projectile.gfxOffY);
Rectangle frame = new Rectangle(0, 0, texture.Width, texture.Height);
- if (CalamityConfig.Instance.Afterimages) //handle afterimages manually since the utility broke it and didn't render correctly
+ if (CalamityClientConfig.Instance.Afterimages) //handle afterimages manually since the utility broke it and didn't render correctly
{
for (int i = 0; i < Projectile.oldPos.Length; ++i)
{
diff --git a/Projectiles/Summon/Umbrella/MagicHat.cs b/Projectiles/Summon/Umbrella/MagicHat.cs
index 663c9df9e3..3da5df70a1 100644
--- a/Projectiles/Summon/Umbrella/MagicHat.cs
+++ b/Projectiles/Summon/Umbrella/MagicHat.cs
@@ -128,7 +128,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella
// Use a different texture if the player is invisible or has at least 50% stealth
Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
float stealthPercent = player.Calamity().rogueStealthMax != 0 ? (player.Calamity().rogueStealth / player.Calamity().rogueStealthMax) : 0f; //0 to 1
- bool hasStealth = player.Calamity().rogueStealth > 0f && stealthPercent > 0.5f && player.townNPCs < 3f && CalamityConfig.Instance.StealthInvisibility;
+ bool hasStealth = player.Calamity().rogueStealth > 0f && stealthPercent > 0.5f && player.townNPCs < 3f && CalamityClientConfig.Instance.StealthInvisibility;
if (player.ShouldNotDraw || hasStealth)
texture = ModContent.Request("CalamityMod/Projectiles/Summon/Umbrella/MagicHatInvis").Value;
diff --git a/Projectiles/Summon/YharonMinionFireball.cs b/Projectiles/Summon/YharonMinionFireball.cs
index 61c54b2438..e85bf8136c 100644
--- a/Projectiles/Summon/YharonMinionFireball.cs
+++ b/Projectiles/Summon/YharonMinionFireball.cs
@@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Summon
if (Projectile.spriteDirection == -1)
direction = SpriteEffects.FlipHorizontally;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
for (int i = 0; i < Projectile.oldPos.Length; i++)
{
diff --git a/Sounds/Item/ChainPull.ogg b/Sounds/Item/ChainPull.ogg
new file mode 100644
index 0000000000..f0e5d4ab00
Binary files /dev/null and b/Sounds/Item/ChainPull.ogg differ
diff --git a/Sounds/Item/HellbornImpact.ogg b/Sounds/Item/HellbornImpact.ogg
new file mode 100644
index 0000000000..630befa59a
Binary files /dev/null and b/Sounds/Item/HellbornImpact.ogg differ
diff --git a/Sounds/Item/HellbornReload.ogg b/Sounds/Item/HellbornReload.ogg
new file mode 100644
index 0000000000..098e08b0e0
Binary files /dev/null and b/Sounds/Item/HellbornReload.ogg differ
diff --git a/Sounds/Item/HellbornShoot.ogg b/Sounds/Item/HellbornShoot.ogg
new file mode 100644
index 0000000000..f136ea748b
Binary files /dev/null and b/Sounds/Item/HellbornShoot.ogg differ
diff --git a/Sounds/Item/ImpalerLaunch.ogg b/Sounds/Item/ImpalerLaunch.ogg
new file mode 100644
index 0000000000..78d57487ca
Binary files /dev/null and b/Sounds/Item/ImpalerLaunch.ogg differ
diff --git a/Sounds/Item/RadiationBurst.ogg b/Sounds/Item/RadiationBurst.ogg
new file mode 100644
index 0000000000..df865e2b1c
Binary files /dev/null and b/Sounds/Item/RadiationBurst.ogg differ
diff --git a/Sounds/Item/RadiationRain.ogg b/Sounds/Item/RadiationRain.ogg
new file mode 100644
index 0000000000..29823ce07b
Binary files /dev/null and b/Sounds/Item/RadiationRain.ogg differ
diff --git a/Sounds/Item/ViperSpit.ogg b/Sounds/Item/ViperSpit.ogg
new file mode 100644
index 0000000000..b7fb928fa1
Binary files /dev/null and b/Sounds/Item/ViperSpit.ogg differ
diff --git a/Systems/MusicEventSystem.cs b/Systems/MusicEventSystem.cs
index 8349dca788..676a712615 100644
--- a/Systems/MusicEventSystem.cs
+++ b/Systems/MusicEventSystem.cs
@@ -53,20 +53,20 @@ namespace CalamityMod.Systems
}
AddEntry("CloneDefeated", "Interlude1", TimeSpan.FromSeconds(214.577d),
- () => DownedBossSystem.downedCalamitasClone, () => CalamityConfig.Instance.Interlude1);
+ () => DownedBossSystem.downedCalamitasClone, () => CalamityClientConfig.Instance.Interlude1);
AddEntry("MLDefeated", "Interlude2", TimeSpan.FromSeconds(191.912d), () => NPC.downedMoonlord,
- () => CalamityConfig.Instance.Interlude2, outroSilence: TimeSpan.FromSeconds(1f));
+ () => CalamityClientConfig.Instance.Interlude2, outroSilence: TimeSpan.FromSeconds(1f));
// Alternative Interlude 2 -> AddEntry("MLDefeated", "Interlude2_CutIntro", TimeSpan.FromSeconds(160.989d),
- // () => NPC.downedMoonlord, () => CalamityConfig.Instance.Interlude2,
+ // () => NPC.downedMoonlord, () => CalamityClientConfig.Instance.Interlude2,
// outroSilence: TimeSpan.FromSeconds(1f));
AddEntry("YharonDefeated", "Interlude3", TimeSpan.FromSeconds(295.932d),
- () => DownedBossSystem.downedYharon, () => CalamityConfig.Instance.Interlude3);
+ () => DownedBossSystem.downedYharon, () => CalamityClientConfig.Instance.Interlude3);
AddEntry("DoGDefeated", "DevourerofGodsEulogy", TimeSpan.FromSeconds(203.620d),
- () => DownedBossSystem.downedDoG, () => CalamityConfig.Instance.DevourerofGodsEulogy,
+ () => DownedBossSystem.downedDoG, () => CalamityClientConfig.Instance.DevourerofGodsEulogy,
introSilence: TimeSpan.FromSeconds(7.5f));
// Acceptance is NOT toggleable in the config
diff --git a/Systems/NerfExpertDebuffsSystem.cs b/Systems/NerfExpertDebuffsSystem.cs
index 49a6da275c..67ea9cdaaa 100644
--- a/Systems/NerfExpertDebuffsSystem.cs
+++ b/Systems/NerfExpertDebuffsSystem.cs
@@ -10,7 +10,7 @@ namespace CalamityMod.Systems
public override void PostUpdateTime()
{
// Reduce the expert+ debuff time multiplier to the normal mode multiplier
- if (CalamityConfig.Instance.NerfExpertDebuffs)
+ if (CalamityServerConfig.Instance.NerfExpertDebuffs)
{
var copy = Main.RegisteredGameModes[GameModeID.Expert];
copy.DebuffTimeMultiplier = 1f;
diff --git a/Systems/WorldgenManagementSystem.cs b/Systems/WorldgenManagementSystem.cs
index 72124efd39..e791568ddc 100644
--- a/Systems/WorldgenManagementSystem.cs
+++ b/Systems/WorldgenManagementSystem.cs
@@ -343,7 +343,7 @@ namespace CalamityMod.Systems
// Disable gen pass if Early Hardmode Rework is disabled.
// Could just not add/remove gen pass, but that could lead to mod conflicts
// in case whatever mod targets this specific gen pass.
- if (!CalamityConfig.Instance.EarlyHardmodeProgressionRework)
+ if (!CalamityServerConfig.Instance.EarlyHardmodeProgressionRework)
{
hardmodeOreT1Pass.Disable();
}
diff --git a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1.cs b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1.cs
index 97a4ee60a2..dce2106312 100644
--- a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1.cs
+++ b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1.cs
@@ -12,8 +12,16 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
{
public class AbyssGiantKelp1 : ModTile
{
+ protected virtual string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1Glow";
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
+ if (!string.IsNullOrEmpty(GlowAsset))
+ {
+ GlowMask = new(GlowAsset, 18, 18);
+ }
+
Main.tileLighted[Type] = true;
Main.tileFrameImportant[Type] = true;
TileObjectData.newTile.Width = 2;
@@ -65,23 +73,20 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp1Glow").Value;
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
+ if (GlowMask is not null && GlowMask.HasContentInFramePos(tile.TileFrameX, tile.TileFrameY))
+ {
+ Vector2 pos = new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero;
+ Rectangle frame = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16);
+ spriteBatch.Draw(GlowMask.Texture, pos, frame, Color.White);
+ }
}
}
//just clone the first one its literally the same size
public class AbyssGiantKelp2 : AbyssGiantKelp1
{
- public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
- {
- Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp2Glow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
-
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
- }
+ protected override string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp2Glow";
}
}
diff --git a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.cs b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.cs
index 0178df170f..77ed6250f1 100644
--- a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.cs
+++ b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3.cs
@@ -12,8 +12,12 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
{
public class AbyssGiantKelp3 : ModTile
{
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
+ GlowMask = new("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3Glow", 18, 18);
+
Main.tileLighted[Type] = true;
Main.tileFrameImportant[Type] = true;
TileObjectData.newTile.Width = 2;
@@ -65,10 +69,12 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp3Glow").Value;
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
+ if (GlowMask.HasContentInFramePos(tile.TileFrameX, tile.TileFrameY))
+ {
+ spriteBatch.Draw(GlowMask.Texture, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
+ }
}
}
}
diff --git a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.cs b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.cs
index 5d7deca65d..d239d0098b 100644
--- a/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.cs
+++ b/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4.cs
@@ -12,8 +12,12 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
{
public class AbyssGiantKelp4 : ModTile
{
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
+ GlowMask = new("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4Glow", 18, 18);
+
Main.tileLighted[Type] = true;
Main.tileFrameImportant[Type] = true;
TileObjectData.newTile.Width = 2;
@@ -65,10 +69,12 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/AbyssGiantKelp4Glow").Value;
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
+ if (GlowMask.HasContentInFramePos(tile.TileFrameX, tile.TileFrameY))
+ {
+ spriteBatch.Draw(GlowMask.Texture, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
+ }
}
}
}
diff --git a/Tiles/Abyss/AbyssAmbient/BulbTree.cs b/Tiles/Abyss/AbyssAmbient/BulbTree.cs
index b8fcb75a47..146de972b3 100644
--- a/Tiles/Abyss/AbyssAmbient/BulbTree.cs
+++ b/Tiles/Abyss/AbyssAmbient/BulbTree.cs
@@ -11,8 +11,16 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
{
public class BulbTree1 : ModTile
{
+ protected virtual string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree1Glow";
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
+ if (!string.IsNullOrEmpty(GlowAsset))
+ {
+ GlowMask = new(GlowAsset, 18, 18);
+ }
+
Main.tileLighted[Type] = true;
Main.tileFrameImportant[Type] = true;
TileObjectData.newTile.Width = 3;
@@ -48,34 +56,24 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree1Glow").Value;
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
+ if (GlowMask is not null && GlowMask.HasContentInFramePos(tile.TileFrameX, tile.TileFrameY))
+ {
+ Vector2 pos = new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero;
+ Rectangle frame = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16);
+ spriteBatch.Draw(GlowMask.Texture, pos, frame, Color.White);
+ }
}
}
public class BulbTree2 : BulbTree1
{
- public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
- {
- Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree2Glow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
-
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
- }
+ protected override string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree3Glow";
}
public class BulbTree3 : BulbTree1
{
- public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
- {
- Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree3Glow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
-
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
- }
+ protected override string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/BulbTree3Glow";
}
}
diff --git a/Tiles/Abyss/AbyssAmbient/PirateCrate.cs b/Tiles/Abyss/AbyssAmbient/PirateCrate.cs
index bc6831691d..af87b809f4 100644
--- a/Tiles/Abyss/AbyssAmbient/PirateCrate.cs
+++ b/Tiles/Abyss/AbyssAmbient/PirateCrate.cs
@@ -9,11 +9,22 @@ using Terraria.ObjectData;
namespace CalamityMod.Tiles.Abyss.AbyssAmbient
{
+ //
+ // Pirate Crate With Glow
+
public class PirateCrate1 : ModTile
{
+ protected virtual string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/PirateCrate1Glow";
+ internal static FramedGlowMask GlowMask;
+
public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/CrateBreak", 3) { Volume = 0.8f };
public override void SetStaticDefaults()
{
+ if (!string.IsNullOrEmpty(GlowAsset))
+ {
+ GlowMask = new(GlowAsset, 18, 18);
+ }
+
Main.tileFrameImportant[Type] = true;
Main.tileLavaDeath[Type] = true;
Main.tileWaterDeath[Type] = false;
@@ -46,37 +57,30 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/PirateCrate1Glow").Value;
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
+ if (GlowMask is not null && GlowMask.HasContentInFramePos(tile.TileFrameX, tile.TileFrameY))
+ {
+ Vector2 pos = new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero;
+ Rectangle frame = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16);
+ spriteBatch.Draw(GlowMask.Texture, pos, frame, Color.White);
+ }
}
}
public class PirateCrate2 : PirateCrate1
{
- public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
- {
- Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/PirateCrate2Glow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
-
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
- }
+ protected override string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/PirateCrate2Glow";
}
public class PirateCrate3 : PirateCrate1
{
- public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
- {
- Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/PirateCrate3Glow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
-
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
- }
+ protected override string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/PirateCrate3Glow";
}
+ //
+ // Pirate Crate Without Glow
+
public class PirateCrate4 : ModTile
{
public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/CrateBreak", 3) { Volume = 0.8f };
diff --git a/Tiles/Abyss/AbyssAmbient/SpiderCoral.cs b/Tiles/Abyss/AbyssAmbient/SpiderCoral.cs
index 11f62b915d..c9fbaa387a 100644
--- a/Tiles/Abyss/AbyssAmbient/SpiderCoral.cs
+++ b/Tiles/Abyss/AbyssAmbient/SpiderCoral.cs
@@ -13,8 +13,16 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
{
public class SpiderCoral1 : ModTile
{
+ protected virtual string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/SpiderCoral1Glow";
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
+ if (!string.IsNullOrEmpty(GlowAsset))
+ {
+ GlowMask = new(GlowAsset, 18, 18);
+ }
+
Main.tileLighted[Type] = true;
Main.tileFrameImportant[Type] = true;
Main.tileNoAttach[Type] = true;
@@ -36,58 +44,34 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SpiderCoral1Glow").Value;
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
+ if (GlowMask is not null && GlowMask.HasContentInFramePos(tile.TileFrameX, tile.TileFrameY))
+ {
+ Vector2 pos = new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero;
+ Rectangle frame = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16);
+ spriteBatch.Draw(GlowMask.Texture, pos, frame, Color.White);
+ }
}
}
public class SpiderCoral2 : SpiderCoral1
{
- public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
- {
- Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SpiderCoral2Glow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
-
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
- }
+ protected override string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/SpiderCoral2Glow";
}
public class SpiderCoral3 : SpiderCoral1
{
- public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
- {
- Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SpiderCoral3Glow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
-
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
- }
+ protected override string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/SpiderCoral3Glow";
}
public class SpiderCoral4 : SpiderCoral1
{
- public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
- {
- Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SpiderCoral4Glow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
-
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
- }
+ protected override string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/SpiderCoral4Glow";
}
public class SpiderCoral5 : SpiderCoral1
{
- public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
- {
- Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SpiderCoral5Glow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
-
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
- }
+ protected override string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/SpiderCoral5Glow";
}
}
diff --git a/Tiles/Abyss/AbyssAmbient/SulphurPireCoral.cs b/Tiles/Abyss/AbyssAmbient/SulphurPireCoral.cs
index 0c5ee30a41..0e4c74303f 100644
--- a/Tiles/Abyss/AbyssAmbient/SulphurPireCoral.cs
+++ b/Tiles/Abyss/AbyssAmbient/SulphurPireCoral.cs
@@ -11,8 +11,16 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
{
public class SulphurPireCoral1 : ModTile
{
+ protected virtual string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/SulphurPireCoral2Glow";
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
+ if (!string.IsNullOrEmpty(GlowAsset))
+ {
+ GlowMask = new(GlowAsset, 18, 18);
+ }
+
Main.tileLighted[Type] = true;
Main.tileFrameImportant[Type] = true;
TileObjectData.newTile.Width = 3;
@@ -48,34 +56,24 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SulphurPireCoral1Glow").Value;
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
+ if (GlowMask is not null && GlowMask.HasContentInFramePos(tile.TileFrameX, tile.TileFrameY))
+ {
+ Vector2 pos = new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero;
+ Rectangle frame = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16);
+ spriteBatch.Draw(GlowMask.Texture, pos, frame, Color.White);
+ }
}
}
public class SulphurPireCoral2 : SulphurPireCoral1
{
- public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
- {
- Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SulphurPireCoral2Glow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
-
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
- }
+ protected override string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/SulphurPireCoral2Glow";
}
public class SulphurPireCoral3 : SulphurPireCoral1
{
- public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
- {
- Tile tile = Framing.GetTileSafely(i, j);
- Texture2D tex = ModContent.Request("CalamityMod/Tiles/Abyss/AbyssAmbient/SulphurPireCoral3Glow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange);
-
- spriteBatch.Draw(tex, new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + zero, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), Color.White);
- }
+ protected override string GlowAsset => "CalamityMod/Tiles/Abyss/AbyssAmbient/SulphurPireCoral3Glow";
}
}
diff --git a/Tiles/Abyss/AbyssAmbient/ThermalVent.cs b/Tiles/Abyss/AbyssAmbient/ThermalVent.cs
index a37f2547ef..b126b95158 100644
--- a/Tiles/Abyss/AbyssAmbient/ThermalVent.cs
+++ b/Tiles/Abyss/AbyssAmbient/ThermalVent.cs
@@ -71,13 +71,18 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient
if (!Main.gamePaused && t.TileFrameX % 36 == 0 && t.TileFrameY % 36 == 0 && Collision.CanHitLine(spawnPosition, 1, 1, spawnPosition - Vector2.UnitY * 100f, 1, 1))
{
+ if (steamTimer <= 450)
+ return;
+
+ if (!Main.rand.NextBool(3))
+ return;
+
float positionInterpolant = (i + j) * 0.041f % 1f;
Vector2 smokeVelocity = -Vector2.UnitY.RotatedByRandom(0.11f) * MathHelper.Lerp(4.8f, 8.1f, positionInterpolant);
smokeVelocity.X += (float)Math.Cos(MathHelper.TwoPi * positionInterpolant) * 1.1f;
smokeVelocity.Y -= Main.rand.Next(3, 6);
- if (steamTimer >= 450 && Main.rand.NextBool(3))
- Projectile.NewProjectile(new EntitySource_WorldEvent(), spawnPosition, smokeVelocity, ModContent.ProjectileType(), Main.expertMode ? 20 : 30, 0f);
+ Projectile.NewProjectile(new EntitySource_WorldEvent(), spawnPosition, smokeVelocity, ModContent.ProjectileType(), Main.expertMode ? 20 : 30, 0f);
}
}
}
diff --git a/Tiles/Abyss/PyreMantleMolten.cs b/Tiles/Abyss/PyreMantleMolten.cs
index f6e031ce93..48a803f6df 100644
--- a/Tiles/Abyss/PyreMantleMolten.cs
+++ b/Tiles/Abyss/PyreMantleMolten.cs
@@ -15,12 +15,12 @@ namespace CalamityMod.Tiles.Abyss
public class PyreMantleMolten : ModTile
{
public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/VoidstoneMine", 3) { Volume = 0.4f };
- internal static Texture2D GlowTexture;
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
- if (!Main.dedServ)
- GlowTexture = ModContent.Request("CalamityMod/Tiles/Abyss/PyreMantleMolten_Glowmask", AssetRequestMode.ImmediateLoad).Value;
+ GlowMask = new("CalamityMod/Tiles/Abyss/PyreMantleMolten_Glowmask", 18, 18);
Main.tileLighted[Type] = true;
Main.tileSolid[Type] = true;
@@ -77,23 +77,26 @@ namespace CalamityMod.Tiles.Abyss
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
- if (GlowTexture is null)
+ if (GlowMask.Texture is null)
return;
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Color drawColour = GetDrawColour(i, j, new Color(200, 200, 200, 200));
- Tile trackTile = Main.tile[i, j];
- float glowbrightness = 1f;
- float glowspeed = Main.GameUpdateCount * 0.01f;
- glowbrightness *= (float)MathF.Sin(i / 60f + glowspeed);
- drawColour *= glowbrightness;
- double num6 = Main.time * 0.08;
- TileFramingSystem.SlopedGlowmask(i, j, 0, GlowTexture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
- glowbrightness += 0.3f;
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Color drawColour = GetDrawColour(i, j, new Color(200, 200, 200, 200));
+ Tile trackTile = Main.tile[i, j];
+ float glowbrightness = 1f;
+ float glowspeed = Main.GameUpdateCount * 0.01f;
+ glowbrightness *= (float)MathF.Sin(i / 60f + glowspeed);
+ drawColour *= glowbrightness;
+ double num6 = Main.time * 0.08;
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ glowbrightness += 0.3f;
+ }
}
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
diff --git a/Tiles/Abyss/SteamGeyser.cs b/Tiles/Abyss/SteamGeyser.cs
index 7056860026..eddcede916 100644
--- a/Tiles/Abyss/SteamGeyser.cs
+++ b/Tiles/Abyss/SteamGeyser.cs
@@ -54,13 +54,18 @@ namespace CalamityMod.Tiles.Abyss
if (!Main.gamePaused && t.TileFrameX % 36 == 0 && t.TileFrameY % 36 == 0 && Collision.CanHitLine(spawnPosition, 1, 1, spawnPosition - Vector2.UnitY * 100f, 1, 1))
{
+ if (steamTimer <= 180)
+ return;
+
+ if (!Main.rand.NextBool(3))
+ return;
+
float positionInterpolant = (i + j) * 0.041f % 1f;
Vector2 smokeVelocity = -Vector2.UnitY.RotatedByRandom(0.11f) * MathHelper.Lerp(4.8f, 8.1f, positionInterpolant);
smokeVelocity.X += (float)Math.Cos(MathHelper.TwoPi * positionInterpolant) * 1.1f;
smokeVelocity.Y -= Main.rand.Next(3, 6);
- if (steamTimer >= 180 && Main.rand.NextBool(3))
- Projectile.NewProjectile(new EntitySource_WorldEvent(), spawnPosition, smokeVelocity, ModContent.ProjectileType(), Main.expertMode ? 15 : 23, 0f);
+ Projectile.NewProjectile(new EntitySource_WorldEvent(), spawnPosition, smokeVelocity, ModContent.ProjectileType(), Main.expertMode ? 15 : 23, 0f);
}
}
}
diff --git a/Tiles/Abyss/Voidstone.cs b/Tiles/Abyss/Voidstone.cs
index af545c680f..c63eefe42f 100644
--- a/Tiles/Abyss/Voidstone.cs
+++ b/Tiles/Abyss/Voidstone.cs
@@ -15,12 +15,11 @@ namespace CalamityMod.Tiles.Abyss
public class Voidstone : ModTile
{
public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/VoidstoneMine", 3) { Volume = 0.4f };
- internal static Texture2D GlowTexture;
+ internal static FramedGlowMask GlowMask;
public override void SetStaticDefaults()
{
- if (!Main.dedServ)
- GlowTexture = ModContent.Request("CalamityMod/Tiles/Abyss/Voidstone_Glowmask", AssetRequestMode.ImmediateLoad).Value;
+ GlowMask = new("CalamityMod/Tiles/Abyss/Voidstone_Glowmask", 18, 18);
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
@@ -168,7 +167,7 @@ namespace CalamityMod.Tiles.Abyss
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
- if (GlowTexture is null)
+ if (GlowMask.Texture is null)
return;
int xPos = Main.tile[i, j].TileFrameX;
@@ -262,19 +261,23 @@ namespace CalamityMod.Tiles.Abyss
xOffset *= 234;
xPos += xOffset;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Color drawColour = GetDrawColour(i, j, new Color(255, 255, 255, 255));
- Tile trackTile = Main.tile[i, j];
- float brightness = 1f;
- float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.007f;
- brightness *= (float)MathF.Sin(i / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- brightness *= (float)MathF.Sin(j / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- brightness *= (float)MathF.Sin(i * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- brightness *= (float)MathF.Sin(j * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- drawColour *= brightness;
- TileFramingSystem.SlopedGlowmask(i, j, 0, GlowTexture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Color drawColour = GetDrawColour(i, j, new Color(255, 255, 255, 255));
+ Tile trackTile = Main.tile[i, j];
+ float brightness = 1f;
+ float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.007f;
+ brightness *= (float)MathF.Sin(i / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ brightness *= (float)MathF.Sin(j / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ brightness *= (float)MathF.Sin(i * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ brightness *= (float)MathF.Sin(j * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ brightness *= 0.5f;
+ drawColour *= brightness;
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
diff --git a/Tiles/AstralBrick.cs b/Tiles/AstralBrick.cs
index 2ea9214d4b..f7f937fcec 100644
--- a/Tiles/AstralBrick.cs
+++ b/Tiles/AstralBrick.cs
@@ -15,9 +15,13 @@ namespace CalamityMod.Tiles
private const short subsheetWidth = 324;
private const short subsheetHeight = 90;
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
+ GlowMask = new("CalamityMod/Tiles/AstralBrickGlow", 18, 18);
+
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
HitSound = SoundID.Tink;
@@ -56,13 +60,16 @@ namespace CalamityMod.Tiles
yOffset *= subsheetHeight;
xPos += xOffset;
yPos += yOffset;
- Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/AstralBrickGlow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Color drawColour = GetDrawColour(i, j, new Color(50, 50, 50, 50));
- Tile trackTile = Main.tile[i, j];
- TileFramingSystem.SlopedGlowmask(i, j, 0, glowmask, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Color drawColour = GetDrawColour(i, j, new Color(50, 50, 50, 50));
+ Tile trackTile = Main.tile[i, j];
+
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs
index ca33e90c31..a40f0dd4fe 100644
--- a/Tiles/CalamityGlobalTile.cs
+++ b/Tiles/CalamityGlobalTile.cs
@@ -351,7 +351,7 @@ namespace CalamityMod.Tiles
Vector2 spreadMinMax = new Vector2(-32.0f, 32.0f);
// Drop 4 Soul of Night
- if (CalamityConfig.Instance.EarlyHardmodeProgressionRework)
+ if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework)
{
DropItem(i, j, ItemID.SoulofNight, quantity: 4, asStack: false, spreadMinMax);
WorldGen.altarCount++; // altarCount does not update automatically if ProgressionRework is enabled!
diff --git a/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs b/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs
index c43658ab80..44abdceee6 100644
--- a/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs
+++ b/Tiles/FurnitureAshen/SmoothBrimstoneSlag.cs
@@ -10,8 +10,12 @@ namespace CalamityMod.Tiles.FurnitureAshen
{
public class SmoothBrimstoneSlag : ModTile
{
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
+ GlowMask = new("CalamityMod/Tiles/FurnitureAshen/SmoothBrimstoneSlagGlow", 18, 18);
+
Main.tileSolid[Type] = true;
Main.tileMergeDirt[Type] = false;
Main.tileBlockLight[Type] = true;
@@ -37,13 +41,16 @@ namespace CalamityMod.Tiles.FurnitureAshen
{
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
- Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureAshen/SmoothBrimstoneSlagGlow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Color drawColour = GetDrawColour(i, j, new Color(25, 25, 25, 25));
- Tile trackTile = Main.tile[i, j];
- TileFramingSystem.SlopedGlowmask(i, j, 0, glowmask, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Color drawColour = GetDrawColour(i, j, new Color(25, 25, 25, 25));
+ Tile trackTile = Main.tile[i, j];
+
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
diff --git a/Tiles/FurnitureAuric/ActivatedAuricPanelTile.cs b/Tiles/FurnitureAuric/ActivatedAuricPanelTile.cs
index adf9d77758..0cb0752600 100644
--- a/Tiles/FurnitureAuric/ActivatedAuricPanelTile.cs
+++ b/Tiles/FurnitureAuric/ActivatedAuricPanelTile.cs
@@ -11,11 +11,12 @@ namespace CalamityMod.Tiles.FurnitureAuric
{
public class ActivatedAuricPanelTile : ModTile
{
- internal static Texture2D GlowTexture;
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
- if (!Main.dedServ)
- GlowTexture = ModContent.Request("CalamityMod/Tiles/FurnitureAuric/ActivatedAuricPanelTile_Glow", AssetRequestMode.ImmediateLoad).Value;
+ GlowMask = new("CalamityMod/Tiles/FurnitureAuric/ActivatedAuricPanelTile_Glow", 18, 18);
+
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
HitSound = AuricOre.MineSound;
@@ -34,13 +35,17 @@ namespace CalamityMod.Tiles.FurnitureAuric
{
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Color drawColour = GetDrawColour(i, j, Color.White);
- Tile trackTile = Main.tile[i, j];
- double num6 = Main.time * 0.08;
- TileFramingSystem.SlopedGlowmask(i, j, 0, GlowTexture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Color drawColour = GetDrawColour(i, j, Color.White);
+ Tile trackTile = Main.tile[i, j];
+ double num6 = Main.time * 0.08;
+
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
diff --git a/Tiles/FurnitureAuric/AuricRepulserPanelTile.cs b/Tiles/FurnitureAuric/AuricRepulserPanelTile.cs
index 740c2d764d..4b38dc3aac 100644
--- a/Tiles/FurnitureAuric/AuricRepulserPanelTile.cs
+++ b/Tiles/FurnitureAuric/AuricRepulserPanelTile.cs
@@ -11,11 +11,12 @@ namespace CalamityMod.Tiles.FurnitureAuric
{
public class AuricRepulserPanelTile : ModTile
{
- internal static Texture2D GlowTexture;
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
- if (!Main.dedServ)
- GlowTexture = ModContent.Request("CalamityMod/Tiles/FurnitureAuric/AuricRepulserPanelTile_Glow", AssetRequestMode.ImmediateLoad).Value;
+ GlowMask = new("CalamityMod/Tiles/FurnitureAuric/AuricRepulserPanelTile_Glow", 18, 18);
+
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
HitSound = AuricOre.MineSound;
@@ -34,13 +35,17 @@ namespace CalamityMod.Tiles.FurnitureAuric
{
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Color drawColour = GetDrawColour(i, j, Color.White);
- Tile trackTile = Main.tile[i, j];
- double num6 = Main.time * 0.08;
- TileFramingSystem.SlopedGlowmask(i, j, 0, GlowTexture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Color drawColour = GetDrawColour(i, j, Color.White);
+ Tile trackTile = Main.tile[i, j];
+ double num6 = Main.time * 0.08;
+
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
diff --git a/Tiles/FurnitureAuric/ExoAuricPanelTile.cs b/Tiles/FurnitureAuric/ExoAuricPanelTile.cs
index 8431ec84e0..23738fec60 100644
--- a/Tiles/FurnitureAuric/ExoAuricPanelTile.cs
+++ b/Tiles/FurnitureAuric/ExoAuricPanelTile.cs
@@ -11,11 +11,12 @@ namespace CalamityMod.Tiles.FurnitureAuric
{
public class ExoAuricPanelTile : ModTile
{
- internal static Texture2D GlowTexture;
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
- if (!Main.dedServ)
- GlowTexture = ModContent.Request("CalamityMod/Tiles/FurnitureAuric/ExoAuricPanelTile_Glow", AssetRequestMode.ImmediateLoad).Value;
+ GlowMask = new("CalamityMod/Tiles/FurnitureAuric/ExoAuricPanelTile_Glow", 18, 18);
+
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
HitSound = AuricOre.MineSound;
@@ -34,13 +35,17 @@ namespace CalamityMod.Tiles.FurnitureAuric
{
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Color drawColour = GetDrawColour(i, j, Color.White);
- Tile trackTile = Main.tile[i, j];
- double num6 = Main.time * 0.08;
- TileFramingSystem.SlopedGlowmask(i, j, 0, GlowTexture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Color drawColour = GetDrawColour(i, j, Color.White);
+ Tile trackTile = Main.tile[i, j];
+ double num6 = Main.time * 0.08;
+
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
diff --git a/Tiles/FurnitureCosmilite/CosmiliteBrick.cs b/Tiles/FurnitureCosmilite/CosmiliteBrick.cs
index b8af599897..56c0145275 100644
--- a/Tiles/FurnitureCosmilite/CosmiliteBrick.cs
+++ b/Tiles/FurnitureCosmilite/CosmiliteBrick.cs
@@ -10,8 +10,12 @@ namespace CalamityMod.Tiles.FurnitureCosmilite
{
public class CosmiliteBrick : ModTile
{
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
+ GlowMask = new("CalamityMod/Tiles/FurnitureCosmilite/CosmiliteBrickGlow", 18, 18);
+
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
HitSound = SoundID.Tink;
@@ -30,14 +34,17 @@ namespace CalamityMod.Tiles.FurnitureCosmilite
{
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
- Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureCosmilite/CosmiliteBrickGlow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Color drawColour = GetDrawColour(i, j, Color.White);
- Tile trackTile = Main.tile[i, j];
- double num6 = Main.time * 0.08;
- TileFramingSystem.SlopedGlowmask(i, j, 0, glowmask, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Color drawColour = GetDrawColour(i, j, Color.White);
+ Tile trackTile = Main.tile[i, j];
+ double num6 = Main.time * 0.08;
+
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
diff --git a/Tiles/FurnitureExo/ExoPlatingTile.cs b/Tiles/FurnitureExo/ExoPlatingTile.cs
index 44edc712ae..e9362c3376 100644
--- a/Tiles/FurnitureExo/ExoPlatingTile.cs
+++ b/Tiles/FurnitureExo/ExoPlatingTile.cs
@@ -11,14 +11,11 @@ namespace CalamityMod.Tiles.FurnitureExo
{
public class ExoPlatingTile : ModTile
{
- internal static Texture2D GlowTexture;
+ internal static FramedGlowMask GlowMask;
public override void SetStaticDefaults()
{
- if (!Main.dedServ)
- {
- GlowTexture = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoPlatingTileGlow", AssetRequestMode.ImmediateLoad).Value;
- }
+ GlowMask = new("CalamityMod/Tiles/FurnitureExo/ExoPlatingTileGlow", 18, 18);
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
@@ -49,18 +46,22 @@ namespace CalamityMod.Tiles.FurnitureExo
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
// If the cached textures don't exist for some reason, don't bother using them.
- if (GlowTexture is null)
+ if (GlowMask.Texture is null)
return;
Tile tile = CalamityUtils.ParanoidTileRetrieval(i, j);
int xPos = tile.TileFrameX;
int frameOffset = j % 2 * AnimationFrameHeight;
int yPos = tile.TileFrameY + frameOffset;
- Color drawColour = GetDrawColour(i, j, Color.White);
- Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffset;
- TileFramingSystem.SlopedGlowmask(i, j, 0, GlowTexture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Color drawColour = GetDrawColour(i, j, Color.White);
+ Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffset;
+
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
{
diff --git a/Tiles/FurnitureExo/ExoPrismPanelTile.cs b/Tiles/FurnitureExo/ExoPrismPanelTile.cs
index f3c9429df2..5d531fb550 100644
--- a/Tiles/FurnitureExo/ExoPrismPanelTile.cs
+++ b/Tiles/FurnitureExo/ExoPrismPanelTile.cs
@@ -11,14 +11,11 @@ namespace CalamityMod.Tiles.FurnitureExo
{
public class ExoPrismPanelTile : ModTile
{
- internal static Texture2D GlowTexture;
+ internal static FramedGlowMask GlowMask;
public override void SetStaticDefaults()
{
- if (!Main.dedServ)
- {
- GlowTexture = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoPrismPanelTileGlow", AssetRequestMode.ImmediateLoad).Value;
- }
+ GlowMask = new("CalamityMod/Tiles/FurnitureExo/ExoPrismPanelTileGlow", 18, 18);
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
@@ -49,18 +46,22 @@ namespace CalamityMod.Tiles.FurnitureExo
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
// If the cached textures don't exist for some reason, don't bother using them.
- if (GlowTexture is null)
+ if (GlowMask.Texture is null)
return;
Tile tile = CalamityUtils.ParanoidTileRetrieval(i, j);
int xPos = tile.TileFrameX;
int frameOffset = (i + j) % 6 * AnimationFrameHeight;
int yPos = tile.TileFrameY + frameOffset;
- Color drawColour = GetDrawColour(i, j, Color.White);
- Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffset;
- TileFramingSystem.SlopedGlowmask(i, j, 0, GlowTexture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Color drawColour = GetDrawColour(i, j, Color.White);
+ Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffset;
+
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
{
diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs
index 1cebc94b13..8df409c0d9 100644
--- a/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs
+++ b/Tiles/FurniturePlaguedPlate/PlaguedPlate.cs
@@ -10,8 +10,12 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate
{
public class PlaguedPlate : ModTile
{
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
+ GlowMask = new("CalamityMod/Tiles/FurniturePlaguedPlate/PlaguedPlateGlow", 18, 18);
+
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
HitSound = SoundID.Tink;
@@ -39,12 +43,15 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate
{
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
- Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurniturePlaguedPlate/PlaguedPlateGlow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Color drawColour = GetDrawColour(i, j, new Color(128, 128, 128, 128));
- Tile trackTile = Main.tile[i, j];
- TileFramingSystem.SlopedGlowmask(i, j, 0, glowmask, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Color drawColour = GetDrawColour(i, j, new Color(128, 128, 128, 128));
+ Tile trackTile = Main.tile[i, j];
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
diff --git a/Tiles/FurnitureProfaned/ProfanedRock.cs b/Tiles/FurnitureProfaned/ProfanedRock.cs
index 609d66f9b3..da4358dccc 100644
--- a/Tiles/FurnitureProfaned/ProfanedRock.cs
+++ b/Tiles/FurnitureProfaned/ProfanedRock.cs
@@ -11,8 +11,12 @@ namespace CalamityMod.Tiles.FurnitureProfaned
{
public class ProfanedRock : ModTile
{
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
+ GlowMask = new("CalamityMod/Tiles/FurnitureProfaned/ProfanedRockGlow", 18, 18);
+
Main.tileSolid[Type] = true;
Main.tileMergeDirt[Type] = true;
Main.tileBlockLight[Type] = true;
@@ -128,6 +132,9 @@ namespace CalamityMod.Tiles.FurnitureProfaned
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
+ if (GlowMask.Texture is null)
+ return;
+
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
int xOffset = 0;
@@ -218,13 +225,15 @@ namespace CalamityMod.Tiles.FurnitureProfaned
}
xOffset *= 288;
xPos += xOffset;
- Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureProfaned/ProfanedRockGlow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Color drawColour = GetDrawColour(i, j, new Color(25, 25, 25, 25));
- Tile trackTile = Main.tile[i, j];
- TileFramingSystem.SlopedGlowmask(i, j, 0, glowmask, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Color drawColour = GetDrawColour(i, j, new Color(25, 25, 25, 25));
+ Tile trackTile = Main.tile[i, j];
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
diff --git a/Tiles/FurnitureProfaned/RunicProfanedBrick.cs b/Tiles/FurnitureProfaned/RunicProfanedBrick.cs
index d734338fe6..d3b35e775b 100644
--- a/Tiles/FurnitureProfaned/RunicProfanedBrick.cs
+++ b/Tiles/FurnitureProfaned/RunicProfanedBrick.cs
@@ -11,8 +11,12 @@ namespace CalamityMod.Tiles.FurnitureProfaned
{
public class RunicProfanedBrick : ModTile
{
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
+ GlowMask = new("CalamityMod/Tiles/FurnitureProfaned/RunicProfanedBrickGlow", 18, 18);
+
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
@@ -50,13 +54,16 @@ namespace CalamityMod.Tiles.FurnitureProfaned
yOffset *= AnimationFrameHeight;
xPos += xOffset;
yPos += yOffset;
- Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureProfaned/RunicProfanedBrickGlow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Color drawColour = GetDrawColour(i, j, new Color(128, 128, 128, 128));
- Tile trackTile = Main.tile[i, j];
- TileFramingSystem.SlopedGlowmask(i, j, 0, glowmask, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Color drawColour = GetDrawColour(i, j, new Color(128, 128, 128, 128));
+ Tile trackTile = Main.tile[i, j];
+
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
diff --git a/Tiles/FurnitureStratus/StratusBricks.cs b/Tiles/FurnitureStratus/StratusBricks.cs
index 5f124a73a4..da0b76cb1d 100644
--- a/Tiles/FurnitureStratus/StratusBricks.cs
+++ b/Tiles/FurnitureStratus/StratusBricks.cs
@@ -10,8 +10,12 @@ namespace CalamityMod.Tiles.FurnitureStratus
{
public class StratusBricks : ModTile
{
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
+ GlowMask = new("CalamityMod/Tiles/FurnitureStratus/StratusBricksGlow", 18, 18);
+
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
TileID.Sets.HasSlopeFrames[Type] = true;
@@ -39,13 +43,16 @@ namespace CalamityMod.Tiles.FurnitureStratus
{
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
- Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureStratus/StratusBricksGlow").Value;
- Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Tile trackTile = Main.tile[i, j];
- TileFramingSystem.SlopedGlowmask(i, j, 0, glowmask, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Color drawColour = GetDrawColour(i, j, new Color(100, 100, 100, 100));
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Tile trackTile = Main.tile[i, j];
+
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
diff --git a/Tiles/FurnitureVoid/SmoothVoidstone.cs b/Tiles/FurnitureVoid/SmoothVoidstone.cs
index cc0cf79aa6..2332a12843 100644
--- a/Tiles/FurnitureVoid/SmoothVoidstone.cs
+++ b/Tiles/FurnitureVoid/SmoothVoidstone.cs
@@ -11,8 +11,12 @@ namespace CalamityMod.Tiles.FurnitureVoid
{
public class SmoothVoidstone : ModTile
{
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
+ GlowMask = new("CalamityMod/Tiles/FurnitureVoid/SmoothVoidstoneGlow", 18, 18);
+
Main.tileSolid[Type] = true;
Main.tileMergeDirt[Type] = true;
Main.tileBlockLight[Type] = true;
@@ -217,20 +221,23 @@ namespace CalamityMod.Tiles.FurnitureVoid
}
xOffset *= 288;
xPos += xOffset;
- Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureVoid/SmoothVoidstoneGlow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Color drawColour = GetDrawColour(i, j, new Color(255, 255, 255, 255));
- Tile trackTile = Main.tile[i, j];
- float brightness = 1f;
- float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.007f;
- brightness *= (float)MathF.Sin(i / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- brightness *= (float)MathF.Sin(j / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- brightness *= (float)MathF.Sin(i * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- brightness *= (float)MathF.Sin(j * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- drawColour *= brightness;
- TileFramingSystem.SlopedGlowmask(i, j, 0, glowmask, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Color drawColour = GetDrawColour(i, j, new Color(255, 255, 255, 255));
+ Tile trackTile = Main.tile[i, j];
+ float brightness = 1f;
+ float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.007f;
+ brightness *= (float)MathF.Sin(i / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ brightness *= (float)MathF.Sin(j / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ brightness *= (float)MathF.Sin(i * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ brightness *= (float)MathF.Sin(j * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ drawColour *= brightness;
+
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
diff --git a/Tiles/GiantPlanteraBulb.cs b/Tiles/GiantPlanteraBulb.cs
index f2c9e3c6d7..0d14f8dfcf 100644
--- a/Tiles/GiantPlanteraBulb.cs
+++ b/Tiles/GiantPlanteraBulb.cs
@@ -15,14 +15,11 @@ namespace CalamityMod.Tiles
{
public class GiantPlanteraBulb : ModTile
{
- public static Asset Glow { get; private set; }
+ public static FramedGlowMask GlowMask { get; private set; }
public override void Load()
{
- if (!Main.dedServ)
- {
- Glow = ModContent.Request($"{Texture}Glow");
- }
+ GlowMask = new($"{Texture}Glow", 18, 18);
}
public override void SetStaticDefaults()
@@ -65,12 +62,6 @@ namespace CalamityMod.Tiles
HitSound = SoundID.Grass;
}
- public override void Unload()
- {
- // Textures are auto disposed by tModLoader, all we need to do is get rid of the asset wrapper reference
- Glow = null;
- }
-
// Use the second map entry in Hardmode
public override ushort GetMapOption(int i, int j)
{
@@ -205,12 +196,18 @@ namespace CalamityMod.Tiles
{
var tile = Main.tile[i, j];
- spriteBatch.Draw(
- Glow.Value,
- new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + CalamityUtils.TileDrawOffset,
- new Rectangle(tile.TileFrameX, tile.TileFrameY + AnimationFrameHeight * Main.tileFrame[Type], 16, 16),
- Color.Yellow
- );
+ var xPos = tile.TileFrameX;
+ var yPos = tile.TileFrameY + AnimationFrameHeight * Main.tileFrame[Type];
+
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ spriteBatch.Draw(
+ GlowMask.Texture,
+ new Vector2(i * 16, j * 16 + 2) - Main.screenPosition + CalamityUtils.TileDrawOffset,
+ new Rectangle(xPos, yPos, 16, 16),
+ Color.Yellow
+ );
+ }
}
}
}
diff --git a/Tiles/Ores/AuricOre.cs b/Tiles/Ores/AuricOre.cs
index 8ae1f84b8b..851a2ab95b 100644
--- a/Tiles/Ores/AuricOre.cs
+++ b/Tiles/Ores/AuricOre.cs
@@ -19,13 +19,14 @@ namespace CalamityMod.Tiles.Ores
{
public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/AuricMine", 3);
public static bool Animate;
- internal static Texture2D GlowTexture;
+
+ internal static FramedGlowMask GlowMask;
public override void SetStaticDefaults()
{
- if (!Main.dedServ)
- GlowTexture = ModContent.Request("CalamityMod/Tiles/Ores/AuricOreGlow", AssetRequestMode.ImmediateLoad).Value;
+ GlowMask = new("CalamityMod/Tiles/Ores/AuricOreGlow", 18, 18);
+
AnimationFrameHeight = 90;
Main.tileLighted[Type] = true;
Main.tileSolid[Type] = true;
@@ -89,13 +90,16 @@ namespace CalamityMod.Tiles.Ores
{
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY + AnimationFrameHeight * Main.tileFrame[Type];
- Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/Ores/AuricOreGlow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Color drawColour = GetDrawColour(i, j, new Color(225, 255, 255, 255));
- Tile trackTile = Main.tile[i, j];
- double num6 = Main.time * 0.08;
- TileFramingSystem.SlopedGlowmask(i, j, 0, glowmask, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Color drawColour = GetDrawColour(i, j, new Color(225, 255, 255, 255));
+ Tile trackTile = Main.tile[i, j];
+ double num6 = Main.time * 0.08;
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
diff --git a/Tiles/Ores/PerennialOre.cs b/Tiles/Ores/PerennialOre.cs
index ab3dcf4236..5e163d274f 100644
--- a/Tiles/Ores/PerennialOre.cs
+++ b/Tiles/Ores/PerennialOre.cs
@@ -15,12 +15,12 @@ namespace CalamityMod.Tiles.Ores
{
public class PerennialOre : ModTile
{
- internal static Texture2D GlowTexture;
+ internal static FramedGlowMask GlowMask;
public override void SetStaticDefaults()
{
- if (!Main.dedServ)
- GlowTexture = ModContent.Request("CalamityMod/Tiles/Ores/PerennialOreGlow", AssetRequestMode.ImmediateLoad).Value;
+ GlowMask = new("CalamityMod/Tiles/Ores/PerennialOreGlow", 18, 18);
+
Main.tileLighted[Type] = true;
Main.tileSolid[Type] = true;
Main.tileMergeDirt[Type] = true;
@@ -198,7 +198,7 @@ namespace CalamityMod.Tiles.Ores
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
- if (GlowTexture is null)
+ if (GlowMask.Texture is null)
return;
int xPos = Main.tile[i, j].TileFrameX;
@@ -292,11 +292,15 @@ namespace CalamityMod.Tiles.Ores
xOffset *= 234;
xPos += xOffset;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Color drawColour = GetDrawColour(i, j, new Color(175, 175, 175, 175));
- Tile trackTile = Main.tile[i, j];
- TileFramingSystem.SlopedGlowmask(i, j, 0, GlowTexture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Color drawColour = GetDrawColour(i, j, new Color(175, 175, 175, 175));
+ Tile trackTile = Main.tile[i, j];
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
diff --git a/Tiles/Ores/ScoriaOre.cs b/Tiles/Ores/ScoriaOre.cs
index 7ae960e3d9..6801b8e6de 100644
--- a/Tiles/Ores/ScoriaOre.cs
+++ b/Tiles/Ores/ScoriaOre.cs
@@ -15,8 +15,12 @@ namespace CalamityMod.Tiles.Ores
[LegacyName("ChaoticOre")]
public class ScoriaOre : ModTile
{
+ internal static FramedGlowMask GlowMask;
+
public override void SetStaticDefaults()
{
+ GlowMask = new("CalamityMod/Tiles/Ores/ScoriaOreGlow", 18, 18);
+
Main.tileLighted[Type] = true;
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
@@ -92,13 +96,16 @@ namespace CalamityMod.Tiles.Ores
{
int xPos = Main.tile[i, j].TileFrameX;
int yPos = Main.tile[i, j].TileFrameY;
- Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/Ores/ScoriaOreGlow").Value;
- Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
- Color drawColour = GetDrawColour(i, j, new Color(50, 50, 50, 50));
- Tile trackTile = Main.tile[i, j];
- double num6 = Main.time * 0.08;
- TileFramingSystem.SlopedGlowmask(i, j, 0, glowmask, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
+ Color drawColour = GetDrawColour(i, j, new Color(50, 50, 50, 50));
+ Tile trackTile = Main.tile[i, j];
+ double num6 = Main.time * 0.08;
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawOffset, null, GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
diff --git a/Tiles/ScoriaBrick.cs b/Tiles/ScoriaBrick.cs
index 0db0749b05..46f061f57b 100644
--- a/Tiles/ScoriaBrick.cs
+++ b/Tiles/ScoriaBrick.cs
@@ -14,15 +14,13 @@ namespace CalamityMod.Tiles
public class ScoriaBrick : ModTile
{
int subsheetHeight = 72;
- internal static Texture2D GlowTexture;
+ internal static FramedGlowMask GlowMask;
public override void SetStaticDefaults()
{
- if (!Main.dedServ)
- {
- GlowTexture = ModContent.Request("CalamityMod/Tiles/ScoriaBrickGlow", AssetRequestMode.ImmediateLoad).Value;
- }
+ GlowMask = new("CalamityMod/Tiles/ScoriaBrickGlow", 18, 18);
+
Main.tileLighted[Type] = true;
Main.tileSolid[Type] = true;
Main.tileBlockLight[Type] = true;
@@ -61,17 +59,21 @@ namespace CalamityMod.Tiles
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
{
// If the cached textures don't exist for some reason, don't bother using them.
- if (GlowTexture is null)
+ if (GlowMask.Texture is null)
return;
Tile tile = CalamityUtils.ParanoidTileRetrieval(i, j);
int xPos = tile.TileFrameX;
int frameOffset = j % 2 * 72;
int yPos = tile.TileFrameY + frameOffset;
- Color drawColour = GetDrawColour(i, j, Color.White);
- Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
- Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffset;
- TileFramingSystem.SlopedGlowmask(i, j, 0, GlowTexture, drawPosition + new Vector2(0f, 8f), new Rectangle?(new Rectangle(xPos, yPos, 18, 8)), GetDrawColour(i, j, drawColour), default);
+
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
+ {
+ Color drawColour = GetDrawColour(i, j, Color.White);
+ Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
+ Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffset;
+ TileFramingSystem.SlopedGlowmask(i, j, 0, GlowMask.Texture, drawPosition + new Vector2(0f, 8f), new Rectangle?(new Rectangle(xPos, yPos, 18, 8)), GetDrawColour(i, j, drawColour), default);
+ }
}
private Color GetDrawColour(int i, int j, Color colour)
{
diff --git a/UI/CooldownRackUI.cs b/UI/CooldownRackUI.cs
index acd23acbd4..8c0469ba29 100644
--- a/UI/CooldownRackUI.cs
+++ b/UI/CooldownRackUI.cs
@@ -19,7 +19,7 @@ namespace CalamityMod.UI
get
{
// Option 1: Always use compact icons if configured to do so.
- if (CalamityConfig.Instance.CooldownDisplay == 1)
+ if (CalamityClientConfig.Instance.CooldownDisplay == 1)
return true;
// Option 2: If there are too many cooldowns, auto switch to compact mode.
@@ -43,7 +43,7 @@ namespace CalamityMod.UI
// 1 - The game isn't even on the game screen yet.
// 2 - The player's inventory is open.
// 3 - Cooldown display is completely disabled.
- if (Main.gameMenu || Main.playerInventory || CalamityConfig.Instance.CooldownDisplay < 1)
+ if (Main.gameMenu || Main.playerInventory || CalamityClientConfig.Instance.CooldownDisplay < 1)
return;
IList cooldownsToDraw = Main.LocalPlayer.GetDisplayedCooldowns();
diff --git a/UI/DraedonsArsenal/ChargeMeterUI.cs b/UI/DraedonsArsenal/ChargeMeterUI.cs
index 709f36a8dd..b3c159411e 100644
--- a/UI/DraedonsArsenal/ChargeMeterUI.cs
+++ b/UI/DraedonsArsenal/ChargeMeterUI.cs
@@ -38,7 +38,7 @@ namespace CalamityMod.UI.DraedonsArsenal
public static void Draw(SpriteBatch spriteBatch, Player player)
{
// Sanity check the planned position before drawing
- Vector2 screenRatioPosition = new Vector2(CalamityConfig.Instance.ChargeMeterPosX, CalamityConfig.Instance.ChargeMeterPosY);
+ Vector2 screenRatioPosition = new Vector2(CalamityClientConfig.Instance.ChargeMeterPosX, CalamityClientConfig.Instance.ChargeMeterPosY);
if (screenRatioPosition.X < 0f || screenRatioPosition.X > 100f)
screenRatioPosition.X = DefaultChargePosX;
if (screenRatioPosition.Y < 0f || screenRatioPosition.Y > 100f)
@@ -54,23 +54,23 @@ namespace CalamityMod.UI.DraedonsArsenal
void SavePosition()
{
bool changed = false;
- if (CalamityConfig.Instance.ChargeMeterPosX != screenRatioPosition.X)
+ if (CalamityClientConfig.Instance.ChargeMeterPosX != screenRatioPosition.X)
{
- CalamityConfig.Instance.ChargeMeterPosX = screenRatioPosition.X;
+ CalamityClientConfig.Instance.ChargeMeterPosX = screenRatioPosition.X;
changed = true;
}
- if (CalamityConfig.Instance.ChargeMeterPosY != screenRatioPosition.Y)
+ if (CalamityClientConfig.Instance.ChargeMeterPosY != screenRatioPosition.Y)
{
- CalamityConfig.Instance.ChargeMeterPosY = screenRatioPosition.Y;
+ CalamityClientConfig.Instance.ChargeMeterPosY = screenRatioPosition.Y;
changed = true;
}
if (changed)
- CalamityMod.SaveConfig(CalamityConfig.Instance);
+ CalamityMod.SaveConfig(CalamityClientConfig.Instance);
}
// If the Charge Meter is turned off or the player is not holding an item, stop.
Item heldItem = player.ActiveItem();
- if (!CalamityConfig.Instance.ChargeMeter || heldItem is null || heldItem.IsAir)
+ if (!CalamityClientConfig.Instance.ChargeMeter || heldItem is null || heldItem.IsAir)
{
Reset();
SavePosition();
@@ -96,7 +96,7 @@ namespace CalamityMod.UI.DraedonsArsenal
if (chargeBar.Intersects(mouseHitbox))
{
- if (!CalamityConfig.Instance.MeterPosLock)
+ if (!CalamityClientConfig.Instance.MeterPosLock)
Main.LocalPlayer.mouseInterface = true;
// If the mouse is on top of the meter, show the exact numeric charge.
@@ -106,7 +106,7 @@ namespace CalamityMod.UI.DraedonsArsenal
Vector2 newScreenRatioPosition = screenRatioPosition;
// Handle mouse dragging
- if (!CalamityConfig.Instance.MeterPosLock && ms.LeftButton == ButtonState.Pressed)
+ if (!CalamityClientConfig.Instance.MeterPosLock && ms.LeftButton == ButtonState.Pressed)
{
// If the drag offset doesn't exist yet, create it.
if (!dragOffset.HasValue)
@@ -124,15 +124,15 @@ namespace CalamityMod.UI.DraedonsArsenal
Vector2 delta = newScreenRatioPosition - screenRatioPosition;
if (Math.Abs(delta.X) >= MouseDragEpsilon || Math.Abs(delta.Y) >= MouseDragEpsilon)
{
- CalamityConfig.Instance.ChargeMeterPosX = newScreenRatioPosition.X;
- CalamityConfig.Instance.ChargeMeterPosY = newScreenRatioPosition.Y;
+ CalamityClientConfig.Instance.ChargeMeterPosX = newScreenRatioPosition.X;
+ CalamityClientConfig.Instance.ChargeMeterPosY = newScreenRatioPosition.Y;
}
// When the mouse is released, save the config and destroy the drag offset.
if (ms.LeftButton == ButtonState.Released)
{
dragOffset = null;
- CalamityMod.SaveConfig(CalamityConfig.Instance);
+ CalamityMod.SaveConfig(CalamityClientConfig.Instance);
}
}
}
diff --git a/UI/FlightBar/FlightBar.cs b/UI/FlightBar/FlightBar.cs
index 63f8b34142..9ceab28314 100644
--- a/UI/FlightBar/FlightBar.cs
+++ b/UI/FlightBar/FlightBar.cs
@@ -90,7 +90,7 @@ namespace CalamityMod.UI
public static void Draw(SpriteBatch spriteBatch, Player player)
{
// Sanity check the planned position before drawing
- Vector2 screenRatioPosition = new Vector2(CalamityConfig.Instance.FlightBarPosX, CalamityConfig.Instance.FlightBarPosY);
+ Vector2 screenRatioPosition = new Vector2(CalamityClientConfig.Instance.FlightBarPosX, CalamityClientConfig.Instance.FlightBarPosY);
if (screenRatioPosition.X < 0f || screenRatioPosition.X > 100f)
screenRatioPosition.X = DefaultFlightPosX;
if (screenRatioPosition.Y < 0f || screenRatioPosition.Y > 100f)
@@ -106,26 +106,26 @@ namespace CalamityMod.UI
CalamityPlayer modPlayer = player.Calamity();
// If not drawing the flight bar, save its latest position to config and leave.
- if (CalamityConfig.Instance.FlightBar && ((player.wingsLogic > 0 && player.wingTimeMax > 0) || (player.mount.Active && player.mount._data.flightTimeMax > 0) || player.carpet && !player.canCarpet))
+ if (CalamityClientConfig.Instance.FlightBar && ((player.wingsLogic > 0 && player.wingTimeMax > 0) || (player.mount.Active && player.mount._data.flightTimeMax > 0) || player.carpet && !player.canCarpet))
{
DrawFlightBar(spriteBatch, modPlayer, screenPos);
}
else
{
bool changed = false;
- if (CalamityConfig.Instance.FlightBarPosX != screenRatioPosition.X)
+ if (CalamityClientConfig.Instance.FlightBarPosX != screenRatioPosition.X)
{
- CalamityConfig.Instance.FlightBarPosX = screenRatioPosition.X;
+ CalamityClientConfig.Instance.FlightBarPosX = screenRatioPosition.X;
changed = true;
}
- if (CalamityConfig.Instance.FlightBarPosY != screenRatioPosition.Y)
+ if (CalamityClientConfig.Instance.FlightBarPosY != screenRatioPosition.Y)
{
- CalamityConfig.Instance.FlightBarPosY = screenRatioPosition.Y;
+ CalamityClientConfig.Instance.FlightBarPosY = screenRatioPosition.Y;
changed = true;
}
if (changed)
- CalamityMod.SaveConfig(CalamityConfig.Instance);
+ CalamityMod.SaveConfig(CalamityClientConfig.Instance);
return;
}
@@ -138,7 +138,7 @@ namespace CalamityMod.UI
// Handle mouse dragging
if (flightBar.Intersects(mouseHitbox))
{
- if (!CalamityConfig.Instance.MeterPosLock)
+ if (!CalamityClientConfig.Instance.MeterPosLock)
Main.LocalPlayer.mouseInterface = true;
if (modPlayer.Player.equippedWings != null && modPlayer.Player.wingTimeMax > 0 || (player.mount.Active && modPlayer.Player.mount._data.flightTimeMax > 0) || player.carpet && !player.canCarpet) //equipped wings or riding a flying mount and max wingtime/flighttime above 0 (so not disabled bar)
@@ -149,7 +149,7 @@ namespace CalamityMod.UI
Vector2 newScreenRatioPosition = screenRatioPosition;
// As long as the mouse button is held down, drag the meter along with an offset.
- if (!CalamityConfig.Instance.MeterPosLock && ms.LeftButton == ButtonState.Pressed)
+ if (!CalamityClientConfig.Instance.MeterPosLock && ms.LeftButton == ButtonState.Pressed)
{
// If the drag offset doesn't exist yet, create it.
if (!dragOffset.HasValue)
@@ -167,15 +167,15 @@ namespace CalamityMod.UI
Vector2 delta = newScreenRatioPosition - screenRatioPosition;
if (Math.Abs(delta.X) >= MouseDragEpsilon || Math.Abs(delta.Y) >= MouseDragEpsilon)
{
- CalamityConfig.Instance.FlightBarPosX = newScreenRatioPosition.X;
- CalamityConfig.Instance.FlightBarPosY = newScreenRatioPosition.Y;
+ CalamityClientConfig.Instance.FlightBarPosX = newScreenRatioPosition.X;
+ CalamityClientConfig.Instance.FlightBarPosY = newScreenRatioPosition.Y;
}
// When the mouse is released, save the config and destroy the drag offset.
if (ms.LeftButton == ButtonState.Released)
{
dragOffset = null;
- CalamityMod.SaveConfig(CalamityConfig.Instance);
+ CalamityMod.SaveConfig(CalamityClientConfig.Instance);
}
}
}
diff --git a/UI/Rippers/RipperUI.cs b/UI/Rippers/RipperUI.cs
index 6c8a3cde57..2f9cce458e 100644
--- a/UI/Rippers/RipperUI.cs
+++ b/UI/Rippers/RipperUI.cs
@@ -105,14 +105,14 @@ namespace CalamityMod.UI.Rippers
public static void Draw(SpriteBatch spriteBatch, Player player)
{
// Sanity check the planned Rage Meter position
- Vector2 rageScreenRatioPos = new Vector2(CalamityConfig.Instance.RageMeterPosX, CalamityConfig.Instance.RageMeterPosY);
+ Vector2 rageScreenRatioPos = new Vector2(CalamityClientConfig.Instance.RageMeterPosX, CalamityClientConfig.Instance.RageMeterPosY);
if (rageScreenRatioPos.X < 0f || rageScreenRatioPos.X > 100f)
rageScreenRatioPos.X = DefaultRagePosX;
if (rageScreenRatioPos.Y < 0f || rageScreenRatioPos.Y > 100f)
rageScreenRatioPos.Y = DefaultRagePosY;
// Sanity check the planned Adrenaline Meter position
- Vector2 adrenScreenRatioPos = new Vector2(CalamityConfig.Instance.AdrenalineMeterPosX, CalamityConfig.Instance.AdrenalineMeterPosY);
+ Vector2 adrenScreenRatioPos = new Vector2(CalamityClientConfig.Instance.AdrenalineMeterPosX, CalamityClientConfig.Instance.AdrenalineMeterPosY);
if (adrenScreenRatioPos.X < 0f || adrenScreenRatioPos.X > 100f)
adrenScreenRatioPos.X = DefaultAdrenPosX;
if (adrenScreenRatioPos.Y < 0f || adrenScreenRatioPos.Y > 100f)
@@ -135,18 +135,18 @@ namespace CalamityMod.UI.Rippers
else
{
bool changed = false;
- if (CalamityConfig.Instance.RageMeterPosX != rageScreenRatioPos.X)
+ if (CalamityClientConfig.Instance.RageMeterPosX != rageScreenRatioPos.X)
{
- CalamityConfig.Instance.RageMeterPosX = rageScreenRatioPos.X;
+ CalamityClientConfig.Instance.RageMeterPosX = rageScreenRatioPos.X;
changed = true;
}
- if (CalamityConfig.Instance.RageMeterPosY != rageScreenRatioPos.Y)
+ if (CalamityClientConfig.Instance.RageMeterPosY != rageScreenRatioPos.Y)
{
- CalamityConfig.Instance.RageMeterPosY = rageScreenRatioPos.Y;
+ CalamityClientConfig.Instance.RageMeterPosY = rageScreenRatioPos.Y;
changed = true;
}
if (changed)
- CalamityMod.SaveConfig(CalamityConfig.Instance);
+ CalamityMod.SaveConfig(CalamityClientConfig.Instance);
}
if (modPlayer.AdrenalineEnabled)
@@ -154,18 +154,18 @@ namespace CalamityMod.UI.Rippers
else
{
bool changed = false;
- if (CalamityConfig.Instance.AdrenalineMeterPosX != adrenScreenRatioPos.X)
+ if (CalamityClientConfig.Instance.AdrenalineMeterPosX != adrenScreenRatioPos.X)
{
- CalamityConfig.Instance.AdrenalineMeterPosX = adrenScreenRatioPos.X;
+ CalamityClientConfig.Instance.AdrenalineMeterPosX = adrenScreenRatioPos.X;
changed = true;
}
- if (CalamityConfig.Instance.AdrenalineMeterPosY != adrenScreenRatioPos.Y)
+ if (CalamityClientConfig.Instance.AdrenalineMeterPosY != adrenScreenRatioPos.Y)
{
- CalamityConfig.Instance.AdrenalineMeterPosY = adrenScreenRatioPos.Y;
+ CalamityClientConfig.Instance.AdrenalineMeterPosY = adrenScreenRatioPos.Y;
changed = true;
}
if (changed)
- CalamityMod.SaveConfig(CalamityConfig.Instance);
+ CalamityMod.SaveConfig(CalamityClientConfig.Instance);
}
#region Mouse Interaction
@@ -190,7 +190,7 @@ namespace CalamityMod.UI.Rippers
if (rageHover && !adrenHover)
{
// If the meter isn't locked, then the player's mouse counts as being over interface
- if (!CalamityConfig.Instance.MeterPosLock)
+ if (!CalamityClientConfig.Instance.MeterPosLock)
Main.LocalPlayer.mouseInterface = true;
// Add hover text if the mouse is over Rage bar
@@ -199,7 +199,7 @@ namespace CalamityMod.UI.Rippers
// The bar is draggable if enabled in config.
Vector2 newScreenRatioPosition = rageScreenRatioPos;
- if (!CalamityConfig.Instance.MeterPosLock && ms.LeftButton == ButtonState.Pressed)
+ if (!CalamityClientConfig.Instance.MeterPosLock && ms.LeftButton == ButtonState.Pressed)
{
// If the drag offset doesn't exist yet, create it.
if (!rageDragOffset.HasValue)
@@ -217,21 +217,21 @@ namespace CalamityMod.UI.Rippers
Vector2 delta = newScreenRatioPosition - rageScreenRatioPos;
if (Math.Abs(delta.X) >= MouseDragEpsilon || Math.Abs(delta.Y) >= MouseDragEpsilon)
{
- CalamityConfig.Instance.RageMeterPosX = newScreenRatioPosition.X;
- CalamityConfig.Instance.RageMeterPosY = newScreenRatioPosition.Y;
+ CalamityClientConfig.Instance.RageMeterPosX = newScreenRatioPosition.X;
+ CalamityClientConfig.Instance.RageMeterPosY = newScreenRatioPosition.Y;
}
// When the mouse is released, save the config and destroy the drag offset.
if (ms.LeftButton == ButtonState.Released)
{
rageDragOffset = null;
- CalamityMod.SaveConfig(CalamityConfig.Instance);
+ CalamityMod.SaveConfig(CalamityClientConfig.Instance);
}
}
else if (adrenHover)
{
// If the meter isn't locked, then the player's mouse counts as being over interface
- if (!CalamityConfig.Instance.MeterPosLock)
+ if (!CalamityClientConfig.Instance.MeterPosLock)
Main.LocalPlayer.mouseInterface = true;
// Add hover text if the mouse is over the bar
@@ -241,7 +241,7 @@ namespace CalamityMod.UI.Rippers
// The bar is draggable if enabled in config.
Vector2 newScreenRatioPosition = adrenScreenRatioPos;
- if (!CalamityConfig.Instance.MeterPosLock && ms.LeftButton == ButtonState.Pressed)
+ if (!CalamityClientConfig.Instance.MeterPosLock && ms.LeftButton == ButtonState.Pressed)
{
// If the drag offset doesn't exist yet, create it.
if (!adrenDragOffset.HasValue)
@@ -259,15 +259,15 @@ namespace CalamityMod.UI.Rippers
Vector2 delta = newScreenRatioPosition - adrenScreenRatioPos;
if (Math.Abs(delta.X) >= MouseDragEpsilon || Math.Abs(delta.Y) >= MouseDragEpsilon)
{
- CalamityConfig.Instance.AdrenalineMeterPosX = newScreenRatioPosition.X;
- CalamityConfig.Instance.AdrenalineMeterPosY = newScreenRatioPosition.Y;
+ CalamityClientConfig.Instance.AdrenalineMeterPosX = newScreenRatioPosition.X;
+ CalamityClientConfig.Instance.AdrenalineMeterPosY = newScreenRatioPosition.Y;
}
// When the mouse is released, save the config and destroy the drag offset.
if (ms.LeftButton == ButtonState.Released)
{
adrenDragOffset = null;
- CalamityMod.SaveConfig(CalamityConfig.Instance);
+ CalamityMod.SaveConfig(CalamityClientConfig.Instance);
}
}
#endregion
@@ -446,7 +446,7 @@ namespace CalamityMod.UI.Rippers
#endregion
private static Vector2 GetShakeOffset()
{
- float shake = CalamityConfig.Instance.RipperMeterShake;
+ float shake = CalamityClientConfig.Instance.RipperMeterShake;
float shakeX = Main.rand.NextFloat(-shake, shake);
float shakeY = Main.rand.NextFloat(-shake, shake);
return new Vector2(shakeX, shakeY);
diff --git a/UI/SpeedrunTimerUI.cs b/UI/SpeedrunTimerUI.cs
index 6f340be742..7835193f47 100644
--- a/UI/SpeedrunTimerUI.cs
+++ b/UI/SpeedrunTimerUI.cs
@@ -44,11 +44,11 @@ namespace CalamityMod.UI
public static void Draw(Player player)
{
- if (Main.gameMenu || !CalamityConfig.Instance.SpeedrunTimer)
+ if (Main.gameMenu || !CalamityClientConfig.Instance.SpeedrunTimer)
return;
// Sanity check the planned position before drawing
- Vector2 screenRatioPosition = new Vector2(CalamityConfig.Instance.SpeedrunTimerPosX, CalamityConfig.Instance.SpeedrunTimerPosY);
+ Vector2 screenRatioPosition = new Vector2(CalamityClientConfig.Instance.SpeedrunTimerPosX, CalamityClientConfig.Instance.SpeedrunTimerPosY);
if (screenRatioPosition.X < 0f || screenRatioPosition.X > 100f)
screenRatioPosition.X = DefaultTimerPosX;
if (screenRatioPosition.Y < 0f || screenRatioPosition.Y > 100f)
diff --git a/UI/StealthUI.cs b/UI/StealthUI.cs
index 4562d8a1fe..5abcc3896f 100644
--- a/UI/StealthUI.cs
+++ b/UI/StealthUI.cs
@@ -41,7 +41,7 @@ namespace CalamityMod.UI
public static void Draw(SpriteBatch spriteBatch, Player player)
{
// Sanity check the planned position before drawing
- Vector2 screenRatioPosition = new Vector2(CalamityConfig.Instance.StealthMeterPosX, CalamityConfig.Instance.StealthMeterPosY);
+ Vector2 screenRatioPosition = new Vector2(CalamityClientConfig.Instance.StealthMeterPosX, CalamityClientConfig.Instance.StealthMeterPosY);
if (screenRatioPosition.X < 0f || screenRatioPosition.X > 100f)
screenRatioPosition.X = DefaultStealthPosX;
if (screenRatioPosition.Y < 0f || screenRatioPosition.Y > 100f)
@@ -57,26 +57,26 @@ namespace CalamityMod.UI
CalamityPlayer modPlayer = player.Calamity();
// If not drawing the stealth meter, save its latest position to config and leave.
- if (modPlayer.stealthUIAlpha > 0f && CalamityConfig.Instance.StealthMeter && modPlayer.rogueStealthMax > 0f && modPlayer.wearingRogueArmor)
+ if (modPlayer.stealthUIAlpha > 0f && CalamityClientConfig.Instance.StealthMeter && modPlayer.rogueStealthMax > 0f && modPlayer.wearingRogueArmor)
{
DrawStealthBar(spriteBatch, modPlayer, screenPos);
}
else
{
bool changed = false;
- if (CalamityConfig.Instance.StealthMeterPosX != screenRatioPosition.X)
+ if (CalamityClientConfig.Instance.StealthMeterPosX != screenRatioPosition.X)
{
- CalamityConfig.Instance.StealthMeterPosX = screenRatioPosition.X;
+ CalamityClientConfig.Instance.StealthMeterPosX = screenRatioPosition.X;
changed = true;
}
- if (CalamityConfig.Instance.StealthMeterPosY != screenRatioPosition.Y)
+ if (CalamityClientConfig.Instance.StealthMeterPosY != screenRatioPosition.Y)
{
- CalamityConfig.Instance.StealthMeterPosY = screenRatioPosition.Y;
+ CalamityClientConfig.Instance.StealthMeterPosY = screenRatioPosition.Y;
changed = true;
}
if (changed)
- CalamityMod.SaveConfig(CalamityConfig.Instance);
+ CalamityMod.SaveConfig(CalamityClientConfig.Instance);
}
Rectangle mouseHitbox = new Rectangle((int)Main.MouseScreen.X, (int)Main.MouseScreen.Y, 8, 8);
@@ -88,7 +88,7 @@ namespace CalamityMod.UI
// Handle mouse dragging
if (stealthBar.Intersects(mouseHitbox))
{
- if (!CalamityConfig.Instance.MeterPosLock)
+ if (!CalamityClientConfig.Instance.MeterPosLock)
Main.LocalPlayer.mouseInterface = true;
// If the mouse is on top of the meter, show the player's exact numeric stealth.
@@ -113,7 +113,7 @@ namespace CalamityMod.UI
Vector2 newScreenRatioPosition = screenRatioPosition;
// As long as the mouse button is held down, drag the meter along with an offset.
- if (!CalamityConfig.Instance.MeterPosLock && ms.LeftButton == ButtonState.Pressed)
+ if (!CalamityClientConfig.Instance.MeterPosLock && ms.LeftButton == ButtonState.Pressed)
{
// If the drag offset doesn't exist yet, create it.
if (!dragOffset.HasValue)
@@ -131,15 +131,15 @@ namespace CalamityMod.UI
Vector2 delta = newScreenRatioPosition - screenRatioPosition;
if (Math.Abs(delta.X) >= MouseDragEpsilon || Math.Abs(delta.Y) >= MouseDragEpsilon)
{
- CalamityConfig.Instance.StealthMeterPosX = newScreenRatioPosition.X;
- CalamityConfig.Instance.StealthMeterPosY = newScreenRatioPosition.Y;
+ CalamityClientConfig.Instance.StealthMeterPosX = newScreenRatioPosition.X;
+ CalamityClientConfig.Instance.StealthMeterPosY = newScreenRatioPosition.Y;
}
// When the mouse is released, save the config and destroy the drag offset.
if (ms.LeftButton == ButtonState.Released)
{
dragOffset = null;
- CalamityMod.SaveConfig(CalamityConfig.Instance);
+ CalamityMod.SaveConfig(CalamityClientConfig.Instance);
}
}
}
diff --git a/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs b/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs
index a1a4899dab..97a3df2f64 100644
--- a/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs
+++ b/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs
@@ -37,7 +37,7 @@ namespace CalamityMod.UI.SulphurousWaterMeter
public static void Draw(SpriteBatch spriteBatch, Player player)
{
// Sanity check the planned position before drawing. This is done relative.
- Vector2 screenRatioPosition = new Vector2(CalamityConfig.Instance.SulphuricWaterMeterPosX, CalamityConfig.Instance.SulphuricWaterMeterPosY);
+ Vector2 screenRatioPosition = new Vector2(CalamityClientConfig.Instance.SulphuricWaterMeterPosX, CalamityClientConfig.Instance.SulphuricWaterMeterPosY);
if (screenRatioPosition.X < 0f || screenRatioPosition.X > 100f)
screenRatioPosition.X = DefaultPosX;
if (screenRatioPosition.Y < 0f || screenRatioPosition.Y > 100f)
@@ -58,19 +58,19 @@ namespace CalamityMod.UI.SulphurousWaterMeter
else
{
bool changed = false;
- if (CalamityConfig.Instance.SulphuricWaterMeterPosX != screenRatioPosition.X)
+ if (CalamityClientConfig.Instance.SulphuricWaterMeterPosX != screenRatioPosition.X)
{
- CalamityConfig.Instance.SulphuricWaterMeterPosX = screenRatioPosition.X;
+ CalamityClientConfig.Instance.SulphuricWaterMeterPosX = screenRatioPosition.X;
changed = true;
}
- if (CalamityConfig.Instance.SulphuricWaterMeterPosY != screenRatioPosition.Y)
+ if (CalamityClientConfig.Instance.SulphuricWaterMeterPosY != screenRatioPosition.Y)
{
- CalamityConfig.Instance.SulphuricWaterMeterPosY = screenRatioPosition.Y;
+ CalamityClientConfig.Instance.SulphuricWaterMeterPosY = screenRatioPosition.Y;
changed = true;
}
if (changed)
- CalamityMod.SaveConfig(CalamityConfig.Instance);
+ CalamityMod.SaveConfig(CalamityClientConfig.Instance);
}
Rectangle mouseHitbox = new Rectangle((int)Main.MouseScreen.X, (int)Main.MouseScreen.Y, 8, 8);
@@ -82,7 +82,7 @@ namespace CalamityMod.UI.SulphurousWaterMeter
// Handle mouse dragging
if (waterBarArea.Intersects(mouseHitbox))
{
- if (!CalamityConfig.Instance.MeterPosLock)
+ if (!CalamityClientConfig.Instance.MeterPosLock)
Main.LocalPlayer.mouseInterface = true;
// If the mouse is on top of the meter, show the player's accumulated sulphuric poisoning.
@@ -97,7 +97,7 @@ namespace CalamityMod.UI.SulphurousWaterMeter
Vector2 newScreenRatioPosition = screenRatioPosition;
// As long as the mouse button is held down, drag the meter along with an offset.
- if (!CalamityConfig.Instance.MeterPosLock && ms.LeftButton == ButtonState.Pressed)
+ if (!CalamityClientConfig.Instance.MeterPosLock && ms.LeftButton == ButtonState.Pressed)
{
// If the drag offset doesn't exist yet, create it.
if (!dragOffset.HasValue)
@@ -115,15 +115,15 @@ namespace CalamityMod.UI.SulphurousWaterMeter
Vector2 delta = newScreenRatioPosition - screenRatioPosition;
if (Math.Abs(delta.X) >= MouseDragEpsilon || Math.Abs(delta.Y) >= MouseDragEpsilon)
{
- CalamityConfig.Instance.SulphuricWaterMeterPosX = newScreenRatioPosition.X;
- CalamityConfig.Instance.SulphuricWaterMeterPosY = newScreenRatioPosition.Y;
+ CalamityClientConfig.Instance.SulphuricWaterMeterPosX = newScreenRatioPosition.X;
+ CalamityClientConfig.Instance.SulphuricWaterMeterPosY = newScreenRatioPosition.Y;
}
// When the mouse is released, save the config and destroy the drag offset.
if (ms.LeftButton == ButtonState.Released)
{
dragOffset = null;
- CalamityMod.SaveConfig(CalamityConfig.Instance);
+ CalamityMod.SaveConfig(CalamityClientConfig.Instance);
}
}
else
diff --git a/Utilities/DrawingUtils.cs b/Utilities/DrawingUtils.cs
index fc1e6af50b..2396f26e4c 100644
--- a/Utilities/DrawingUtils.cs
+++ b/Utilities/DrawingUtils.cs
@@ -72,7 +72,7 @@ namespace CalamityMod
// If no afterimages are drawn due to an invalid mode being specified, ensure the projectile itself is drawn anyway.
bool failedToDrawAfterimages = false;
- if (CalamityConfig.Instance.Afterimages)
+ if (CalamityClientConfig.Instance.Afterimages)
{
Vector2 centerOffset = drawCentered ? proj.Size / 2f : Vector2.Zero;
Color alphaColor = proj.GetAlpha(lightColor);
@@ -139,7 +139,7 @@ namespace CalamityMod
}
// Draw the projectile itself. Only do this if no afterimages are drawn because afterimage 0 is the projectile itself.
- if (!CalamityConfig.Instance.Afterimages || ProjectileID.Sets.TrailCacheLength[proj.type] <= 0 || failedToDrawAfterimages)
+ if (!CalamityClientConfig.Instance.Afterimages || ProjectileID.Sets.TrailCacheLength[proj.type] <= 0 || failedToDrawAfterimages)
{
Vector2 startPos = drawCentered ? proj.Center : proj.position;
Main.spriteBatch.Draw(texture, startPos - Main.screenPosition + new Vector2(0f, proj.gfxOffY), rectangle, proj.GetAlpha(lightColor), rotation, origin, scale, spriteEffects, 0f);
diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs
index 2fa654b869..b137434c5f 100644
--- a/Utilities/DropHelper.cs
+++ b/Utilities/DropHelper.cs
@@ -487,7 +487,7 @@ namespace CalamityMod
public static IItemDropRuleCondition HallowedBarsCondition = If((info) =>
{
// If the Early Hardmode Progression Rework is not enabled, then Hallowed Bars can always drop from Mechanical Bosses.
- if (!CalamityConfig.Instance.EarlyHardmodeProgressionRework)
+ if (!CalamityServerConfig.Instance.EarlyHardmodeProgressionRework)
return true;
// If the Early Hardmode Progression Rework is enabled, then all 3 Mechanical Bosses must be defeated for Hallowed Bars to drop.
diff --git a/Utilities/FramedGlowMask.cs b/Utilities/FramedGlowMask.cs
new file mode 100644
index 0000000000..5581bf5782
--- /dev/null
+++ b/Utilities/FramedGlowMask.cs
@@ -0,0 +1,144 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using ReLogic.Content;
+using Terraria;
+using Terraria.ModLoader;
+
+namespace CalamityMod
+{
+ public sealed class FramedGlowMask
+ {
+ ///
+ /// Cached Texture2D reference, null on server
+ ///
+ public Texture2D Texture { get; private set; }
+
+ ///
+ /// X axis's frame count, 0 on server
+ ///
+ public int FrameXCount { get; private set; } = 0;
+
+ ///
+ /// Y axis's frame count, 0 on server
+ ///
+ public int FrameYCount { get; private set; } = 0;
+
+ ///
+ /// Pixel width for each frame
+ ///
+ public int FrameWidth { get; private set; }
+
+ ///
+ /// Pixel height for each frame
+ ///
+ public int FrameHeight { get; private set; }
+
+ private static event Action _OnUnload;
+ private readonly bool[,] _HasGlowContent;
+
+ internal static void UnloadTexCache()
+ {
+ _OnUnload?.Invoke();
+ }
+
+ public FramedGlowMask(string asset, int frameWidth, int frameHeight, bool pretendEveryFrameHaveGlow = false)
+ {
+ FrameWidth = frameWidth;
+ FrameHeight = frameHeight;
+
+ // Don't do anything further on server
+ if (Main.dedServ)
+ return;
+
+ Texture = ModContent.Request(asset, AssetRequestMode.ImmediateLoad).Value;
+ if (Texture is null)
+ return;
+
+ _OnUnload += () =>
+ {
+ Texture = null;
+ FrameWidth = 0;
+ FrameHeight = 0;
+ FrameXCount = 0;
+ FrameYCount = 0;
+ };
+
+ FrameXCount = Texture.Width / frameWidth;
+ FrameYCount = Texture.Height / frameHeight;
+
+ _HasGlowContent = new bool[FrameXCount, FrameYCount];
+
+
+ if (pretendEveryFrameHaveGlow)
+ {
+ for(int x = 0; x
+ {
+ var colData = Texture.GetColorsFromTexture();
+ Parallel.For(0, FrameXCount * FrameYCount, (i) =>
+ {
+ int xFrame = i % FrameXCount;
+ int yFrame = i / FrameXCount;
+
+ int xStart = xFrame * frameWidth;
+ int xEnd = xStart + frameWidth;
+
+ int yStart = yFrame * frameHeight;
+ int yEnd = yStart + frameHeight;
+
+ bool frameHasData = false;
+ for (int x = xStart; x < xEnd; x++)
+ {
+ if (frameHasData)
+ {
+ break;
+ }
+
+ for (int y = yStart; y < yEnd; y++)
+ {
+ Color col = colData[x, y];
+ if (col.A >= 1)
+ {
+ frameHasData = true;
+ break;
+ }
+ }
+ }
+
+ _HasGlowContent[xFrame, yFrame] = frameHasData;
+ });
+ });
+ }
+ }
+
+ public bool HasContentInFrameIndex(int xFrame, int yFrame)
+ {
+ if (Texture is null)
+ return false;
+
+ return _HasGlowContent[xFrame, yFrame];
+ }
+
+ public bool HasContentInFramePos(int xPos, int yPos)
+ {
+ if (Texture is null)
+ return false;
+
+ return _HasGlowContent[xPos / FrameWidth, yPos / FrameHeight];
+ }
+ }
+}
diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs
index 041d19cb35..08ab4456c4 100644
--- a/Utilities/MiscUtils.cs
+++ b/Utilities/MiscUtils.cs
@@ -197,7 +197,7 @@ namespace CalamityMod
sfx.Volume = MathHelper.Clamp(sfx.Volume * volumeMultiplier, 0f, 1f);
}
- public static void StartRain(bool torrentialTear = false, bool maxSeverity = false)
+ public static void StartRain(bool torrentialTear = false, bool maxSeverity = false, bool worldSync = true)
{
int framesInDay = 86400;
int framesInHour = framesInDay / 24;
@@ -247,7 +247,20 @@ namespace CalamityMod
Main.raining = true;
if (torrentialTear)
TorrentialTear.AdjustRainSeverity(maxSeverity);
- CalamityNetcode.SyncWorld();
+
+ if (worldSync)
+ CalamityNetcode.SyncWorld();
+ }
+
+ public static void StopRain(bool clearWeather = false, bool worldSync = true)
+ {
+ if (clearWeather)
+ Main.StopRain();
+ else
+ Main.raining = false;
+
+ if (worldSync)
+ CalamityNetcode.SyncWorld();
}
public static void StartSandstorm()
@@ -278,7 +291,10 @@ namespace CalamityMod
public static void StopSandstorm()
{
- Terraria.GameContent.Events.Sandstorm.Happening = false;
+ if (Main.netMode != NetmodeID.MultiplayerClient)
+ {
+ Sandstorm.StopSandstorm();
+ }
}
public static void AddWithCondition(this List list, T type, bool condition)
diff --git a/Walls/VoidstoneWall.cs b/Walls/VoidstoneWall.cs
index f4881eb777..5e4ef10005 100644
--- a/Walls/VoidstoneWall.cs
+++ b/Walls/VoidstoneWall.cs
@@ -11,13 +11,13 @@ namespace CalamityMod.Walls
{
public class VoidstoneWall : ModWall
{
- internal static Texture2D GlowTexture;
+ internal static FramedGlowMask GlowMask;
public override void SetStaticDefaults()
{
- Main.wallHouse[Type] = true;
- GlowTexture = ModContent.Request("CalamityMod/Walls/VoidstoneWall_Glowmask", AssetRequestMode.ImmediateLoad).Value;
+ GlowMask = new("CalamityMod/Walls/VoidstoneWall_Glowmask", 36, 36);
+ Main.wallHouse[Type] = true;
AddMapEntry(new Color(0, 0, 0));
}
@@ -29,37 +29,44 @@ namespace CalamityMod.Walls
public static void DrawWallGlow(int wallType, int i, int j, SpriteBatch spriteBatch)
{
- if (GlowTexture is null)
+ if (GlowMask.Texture is null)
return;
Tile tile = Main.tile[i, j];
int xLength = 32;
int xOff = 0;
- Rectangle frame = new Rectangle(tile.WallFrameX + xOff, tile.WallFrameY, xLength, 32);
+ int xPos = tile.WallFrameX + xOff;
+ int yPos = tile.WallFrameY;
+
+ Rectangle frame = new Rectangle(xPos, yPos, xLength, 32);
Color drawcolor;
drawcolor = WorldGen.paintColor(tile.WallColor);
drawcolor.A = 255;
Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange);
- float brightness = 1f;
- float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.007f;
- brightness *= (float)MathF.Sin(i / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- brightness *= (float)MathF.Sin(j / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- brightness *= (float)MathF.Sin(i * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- brightness *= (float)MathF.Sin(j * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- drawcolor *= brightness;
-
if (Main.drawToScreen)
zero = Vector2.Zero;
Vector2 pos = new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero;
- Main.spriteBatch.Draw(TextureAssets.Wall[wallType].Value, pos + new Vector2(-8 + xOff, -8), frame, Lighting.GetColor(i, j, Color.White), 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
- Color glowColor = drawcolor * 0.4f;
- for (int k = 0; k < 3; k++)
+ spriteBatch.Draw(TextureAssets.Wall[wallType].Value, pos + new Vector2(-8 + xOff, -8), frame, Lighting.GetColor(i, j, Color.White), 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
+
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
{
- Vector2 offset = new Vector2(Main.rand.NextFloat(-1, 1f), Main.rand.NextFloat(-1, 1f)) * 0.2f * k;
- Main.spriteBatch.Draw(GlowTexture, pos + offset + new Vector2(-8 + xOff, -8), frame, glowColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
+ float brightness = 1f;
+ float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.007f;
+ brightness *= (float)MathF.Sin(i / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ brightness *= (float)MathF.Sin(j / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ brightness *= (float)MathF.Sin(i * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ brightness *= (float)MathF.Sin(j * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ drawcolor *= brightness;
+ Color glowColor = drawcolor * 0.4f;
+
+ for (int k = 0; k < 3; k++)
+ {
+ Vector2 offset = new Vector2(Main.rand.NextFloat(-1, 1f), Main.rand.NextFloat(-1, 1f)) * 0.2f * k;
+ spriteBatch.Draw(GlowMask.Texture, pos + offset + new Vector2(-8 + xOff, -8), frame, glowColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
+ }
}
}
diff --git a/Walls/VoidstoneWallUnsafe.cs b/Walls/VoidstoneWallUnsafe.cs
index 5f7348b9ee..0f0b24ea66 100644
--- a/Walls/VoidstoneWallUnsafe.cs
+++ b/Walls/VoidstoneWallUnsafe.cs
@@ -11,11 +11,14 @@ namespace CalamityMod.Walls
{
public class VoidstoneWallUnsafe : ModWall
{
- internal static Texture2D GlowTexture;
+ internal static FramedGlowMask GlowMask;
public override void SetStaticDefaults()
{
- GlowTexture = ModContent.Request("CalamityMod/Walls/VoidstoneWall_Glowmask", AssetRequestMode.ImmediateLoad).Value;
+ // We basically have same copy in VoidstoneWall
+ // But leaving this in case of changing to Unsafe variant specific glowmask
+ GlowMask = new("CalamityMod/Walls/VoidstoneWall_Glowmask", 36, 36);
+
DustType = 187;
AddMapEntry(new Color(0, 0, 0));
}
@@ -34,37 +37,46 @@ namespace CalamityMod.Walls
public static void DrawWallGlow(int wallType, int i, int j, SpriteBatch spriteBatch)
{
- if (GlowTexture is null)
+ if (GlowMask.Texture is null)
return;
Tile tile = Main.tile[i, j];
int xLength = 32;
int xOff = 0;
- Rectangle frame = new Rectangle(tile.WallFrameX + xOff, tile.WallFrameY, xLength, 32);
+ int xPos = tile.WallFrameX + xOff;
+ int yPos = tile.WallFrameY;
+
+ Rectangle frame = new Rectangle(xPos, yPos, xLength, 32);
Color drawcolor;
drawcolor = WorldGen.paintColor(tile.WallColor);
drawcolor.A = 255;
Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange);
- float brightness = 1f;
- float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.007f;
- brightness *= (float)MathF.Sin(i / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- brightness *= (float)MathF.Sin(j / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- brightness *= (float)MathF.Sin(i * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- brightness *= (float)MathF.Sin(j * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
- drawcolor *= brightness;
-
if (Main.drawToScreen)
zero = Vector2.Zero;
Vector2 pos = new Vector2((i * 16 - (int)Main.screenPosition.X), (j * 16 - (int)Main.screenPosition.Y)) + zero;
- Main.spriteBatch.Draw(TextureAssets.Wall[wallType].Value, pos + new Vector2(-8 + xOff, -8), frame, Lighting.GetColor(i, j, Color.White), 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
- Color glowColor = drawcolor * 0.4f;
- for (int k = 0; k < 3; k++)
+ spriteBatch.Draw(TextureAssets.Wall[wallType].Value, pos + new Vector2(-8 + xOff, -8), frame, Lighting.GetColor(i, j, Color.White), 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
+
+ if (GlowMask.HasContentInFramePos(xPos, yPos))
{
- Vector2 offset = new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, 1f)) * 0.2f * k;
- Main.spriteBatch.Draw(GlowTexture, pos + offset + new Vector2(-8 + xOff, -8), frame, glowColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
+ float brightness = 1f;
+ float declareThisHereToPreventRunningTheSameCalculationMultipleTimes = Main.GameUpdateCount * 0.007f;
+ brightness *= (float)MathF.Sin(i / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ brightness *= (float)MathF.Sin(j / 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ brightness *= (float)MathF.Sin(i * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ brightness *= (float)MathF.Sin(j * 18f + declareThisHereToPreventRunningTheSameCalculationMultipleTimes);
+ drawcolor *= brightness;
+ Color glowColor = drawcolor * 0.4f;
+
+ // For now checking for glowing frames greatly reducing the bottleneck
+ // But maybe we could squeeze bit more by removing the loop
+ for (int k = 0; k < 3; k++)
+ {
+ Vector2 offset = new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, 1f)) * 0.2f * k;
+ spriteBatch.Draw(GlowMask.Texture, pos + offset + new Vector2(-8 + xOff, -8), frame, glowColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
+ }
}
}