shield sync fix + fix the donor set

This commit is contained in:
Dreitone authored and Cameron Ewell committed 2026-02-06 12:59:51 -05:00
1 parent cce279ec2d
commit 480ee26464
4 files changed
+43 -9

No files matched your search

+12 -9
View File
@@ -2214,15 +2214,18 @@ namespace CalamityMod.CalPlayer
Player.AddCooldown(Starburst.ID, MaxStratusStarburst);
}
}
// Shields. Has to intentionally be above resetting accessories and armor or the shields would clear instantly
if (!roverDrive)
RoverDriveShieldDurability = 0;
if (!lunicCorpsSet)
LunicCorpsShieldDurability = 0;
if (!sponge)
SpongeShieldDurability = 0;
if (!pSoulArtifact)
pSoulShieldDurability = 0;
if (Player.whoAmI == Main.myPlayer)
{
if (!roverDrive)
RoverDriveShieldDurability = 0;
if (!lunicCorpsSet)
LunicCorpsShieldDurability = 0;
if (!sponge)
SpongeShieldDurability = 0;
if (!pSoulArtifact)
pSoulShieldDurability = 0;
}
pSoulShieldVisible = false;
roverDrive = false;
roverDriveShieldVisible = false;
+3
View File
@@ -4515,6 +4515,9 @@ namespace CalamityMod.CalPlayer
#region Energy Shields
private void EnergyShields()
{
if (Player.whoAmI != Main.myPlayer)
return;
// Because later tier shields are brighter, shields are handled from highest tier to lowest tier here.
bool shieldAddedLight = false;
@@ -62,6 +62,21 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers
{
public override bool InstancePerEntity => false;
public override string IsArmorSet(Item head, Item body, Item legs)
{
if (head.ModItem is IDyeableShaderRenderer && head.ModItem.IsArmorSet(head, body, legs))
return "DyeableShaderSet";
if (body.ModItem is IDyeableShaderRenderer && body.ModItem.IsArmorSet(head, body, legs))
return "DyeableShaderSet";
if (legs.ModItem is IDyeableShaderRenderer && legs.ModItem.IsArmorSet(head, body, legs))
return "DyeableShaderSet";
return "";
}
public override void UpdateItemDye(Item item, Player player, int dye, bool hideVisual)
{
if (item.ModItem is not IDyeableShaderRenderer drawer)
@@ -21,6 +21,11 @@ namespace CalamityMod.Packets
packet.Write((Half)player.drawingParameters.ProfanedShieldCharge); // 2b
packet.WriteRGB(player.drawingParameters.ProfanedShieldColor); // 3b
packet.Write((Half)player.drawingParameters.SpongeShieldCharge); // 2b
packet.Write((short)player.RoverDriveShieldDurability);
packet.Write((short)player.LunicCorpsShieldDurability);
packet.Write((short)player.pSoulShieldDurability);
packet.Write((short)player.SpongeShieldDurability);
packet.Send(toClient, ignoreClient);
}
@@ -32,6 +37,10 @@ namespace CalamityMod.Packets
var profanedCharge = (float)packet.ReadHalf();
var profanedColor = packet.ReadRGB();
var spongeCharge = (float)packet.ReadHalf();
var roverDurability = packet.ReadInt16();
var lunicDurability = packet.ReadInt16();
var pSoulDurability = packet.ReadInt16();
var spongeDurability = packet.ReadInt16();
if (player is null)
return;
@@ -41,6 +50,10 @@ namespace CalamityMod.Packets
player.drawingParameters.ProfanedShieldCharge = profanedCharge;
player.drawingParameters.ProfanedShieldColor = profanedColor;
player.drawingParameters.SpongeShieldCharge = spongeCharge;
player.RoverDriveShieldDurability = roverDurability;
player.LunicCorpsShieldDurability = lunicDurability;
player.pSoulShieldDurability = pSoulDurability;
player.SpongeShieldDurability = spongeDurability;
if (Main.dedServ)
Send(player, ignoreClient: sender);