diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 9ab071f6e4..84e0fe0465 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -5859,6 +5859,12 @@ namespace CalamityMod.CalPlayer Player.waist = (sbyte)EquipLoader.GetEquipSlot(Mod, "DaedalusBreastplate", EquipType.Waist); } + if (Player.body == EquipLoader.GetEquipSlot(Mod, "DemonshadeBreastplate", EquipType.Body)) + { + //Use an extra front layers to have the players arms draw above the shoulderpads that droop + Player.front = (sbyte)EquipLoader.GetEquipSlot(Mod, "DemonshadeBreastplate", EquipType.Front); + } + bool victideBreastplateVisible = Player.body == EquipLoader.GetEquipSlot(Mod, "VictideBreastplate", EquipType.Body); //Give the player faulds if either the body armor or the leggings are equipped if (victideBreastplateVisible || Player.legs == EquipLoader.GetEquipSlot(Mod, "VictideGreaves", EquipType.Legs)) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index beb4696f06..d7000ed1d7 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -304,7 +304,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Main.maxNPCs; ++i) { NPC npc = Main.npc[i]; - if (npc is null || !npc.IsAnEnemy() || npc.Calamity().DoesNotGenerateRage) + if (npc is null || !npc.IsAnEnemy() || !npc.Calamity().ProvidesProximityRage) continue; // Take the longer of the two directions for the NPC's hitbox to be generous. diff --git a/Items/Armor/Demonshade/DemonshadeBreastplate.cs b/Items/Armor/Demonshade/DemonshadeBreastplate.cs index 7a3aef92e9..e7e84c325c 100644 --- a/Items/Armor/Demonshade/DemonshadeBreastplate.cs +++ b/Items/Armor/Demonshade/DemonshadeBreastplate.cs @@ -3,12 +3,21 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ModLoader; +using Terraria.ID; namespace CalamityMod.Items.Armor.Demonshade { [AutoloadEquip(EquipType.Body)] public class DemonshadeBreastplate : ModItem { + public override void Load() + { + if (Main.netMode != NetmodeID.Server) + { + EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Demonshade/DemonshadeBreastplate_Arms", EquipType.Front, this); + } + } + public override void SetStaticDefaults() { SacrificeTotal = 1; diff --git a/Items/Armor/Demonshade/DemonshadeBreastplate_Arms.png b/Items/Armor/Demonshade/DemonshadeBreastplate_Arms.png index 02fd47f83a..e25e1c4e17 100644 Binary files a/Items/Armor/Demonshade/DemonshadeBreastplate_Arms.png and b/Items/Armor/Demonshade/DemonshadeBreastplate_Arms.png differ diff --git a/Items/Armor/Sulphurous/SulphurousBreastplate_Body.png b/Items/Armor/Sulphurous/SulphurousBreastplate_Body.png index 4cd98aeed5..3d7ff2ebdd 100644 Binary files a/Items/Armor/Sulphurous/SulphurousBreastplate_Body.png and b/Items/Armor/Sulphurous/SulphurousBreastplate_Body.png differ diff --git a/Items/Armor/Umbraphile/UmbraphileRegalia_Body.png b/Items/Armor/Umbraphile/UmbraphileRegalia_Body.png index 6dd1eb8afa..3f8580f26a 100644 Binary files a/Items/Armor/Umbraphile/UmbraphileRegalia_Body.png and b/Items/Armor/Umbraphile/UmbraphileRegalia_Body.png differ diff --git a/Items/Armor/Vanity/SCalRobes.cs b/Items/Armor/Vanity/SCalRobes.cs index 3ddbfc80f4..65298ce54a 100644 --- a/Items/Armor/Vanity/SCalRobes.cs +++ b/Items/Armor/Vanity/SCalRobes.cs @@ -1,5 +1,6 @@ using Terraria.ModLoader; using Terraria.ID; +using Terraria; namespace CalamityMod.Items.Armor.Vanity { @@ -10,6 +11,13 @@ namespace CalamityMod.Items.Armor.Vanity { SacrificeTotal = 1; DisplayName.SetDefault("Calamitous Robes"); + + if (Main.netMode != NetmodeID.Server) + { + var equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); + ArmorIDs.Body.Sets.HidesArms[equipSlot] = true; + ArmorIDs.Body.Sets.HidesTopSkin[equipSlot] = true; + } } public override void SetDefaults() diff --git a/Items/Armor/Vanity/SCalRobes_Body.png b/Items/Armor/Vanity/SCalRobes_Body.png index facccaeb4b..d1857041fb 100644 Binary files a/Items/Armor/Vanity/SCalRobes_Body.png and b/Items/Armor/Vanity/SCalRobes_Body.png differ diff --git a/Items/Armor/Wulfrum/WulfrumArmor_Body.png b/Items/Armor/Wulfrum/WulfrumArmor_Body.png index 26d48c76f4..2145298e8e 100644 Binary files a/Items/Armor/Wulfrum/WulfrumArmor_Body.png and b/Items/Armor/Wulfrum/WulfrumArmor_Body.png differ diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 7e774195af..ac384494cd 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -163,8 +163,8 @@ namespace CalamityMod.NPCs public int shopAlertAnimTimer = 0; public int shopAlertAnimFrame = 0; - // Rage interactions - public bool DoesNotGenerateRage = false; + // Set to false for this NPC to be unable to generate proximity Rage, regardless of other factors + public bool ProvidesProximityRage = true; // NewAI internal const int maxAIMod = 4; @@ -361,7 +361,7 @@ namespace CalamityMod.NPCs myClone.shopAlertAnimTimer = shopAlertAnimTimer; myClone.shopAlertAnimFrame = shopAlertAnimFrame; - myClone.DoesNotGenerateRage = DoesNotGenerateRage; + myClone.ProvidesProximityRage = ProvidesProximityRage; myClone.newAI = new float[maxAIMod]; for (int i = 0; i < maxAIMod; ++i) diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index e19962c554..eb5ab0cf2a 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -100,7 +100,7 @@ namespace CalamityMod.NPCs.ExoMechs NPC.aiStyle = AIType = -1; NPC.knockBackResist = 0f; NPC.DeathSound = SoundID.NPCDeath14; - NPC.Calamity().DoesNotGenerateRage = true; + NPC.Calamity().ProvidesProximityRage = false; } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Other/DemonPortal.cs b/NPCs/Other/DemonPortal.cs index 2619edf51b..33d38fdb56 100644 --- a/NPCs/Other/DemonPortal.cs +++ b/NPCs/Other/DemonPortal.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Other NPC.knockBackResist = 0f; NPC.netAlways = true; NPC.aiStyle = -1; - NPC.Calamity().DoesNotGenerateRage = true; + NPC.Calamity().ProvidesProximityRage = false; NPC.Calamity().DoesNotDisappearInBossRush = true; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; diff --git a/NPCs/Other/ExhumedHeart.cs b/NPCs/Other/ExhumedHeart.cs index 8f71aa48e6..e77c4c69ce 100644 --- a/NPCs/Other/ExhumedHeart.cs +++ b/NPCs/Other/ExhumedHeart.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.Other NPC.knockBackResist = 0f; NPC.netAlways = true; NPC.aiStyle = -1; - NPC.Calamity().DoesNotGenerateRage = true; + NPC.Calamity().ProvidesProximityRage = false; NPC.Calamity().DoesNotDisappearInBossRush = true; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; diff --git a/NPCs/Other/LecherousOrb.cs b/NPCs/Other/LecherousOrb.cs index a1687bc6a9..6093fbd18e 100644 --- a/NPCs/Other/LecherousOrb.cs +++ b/NPCs/Other/LecherousOrb.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Other NPC.netAlways = true; NPC.aiStyle = -1; NPC.canGhostHeal = false; - NPC.Calamity().DoesNotGenerateRage = true; + NPC.Calamity().ProvidesProximityRage = false; NPC.Calamity().DoesNotDisappearInBossRush = true; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; diff --git a/Projectiles/Melee/CnidarianJellyfishOnTheString.cs b/Projectiles/Melee/CnidarianJellyfishOnTheString.cs index e80e07da83..e3178d3559 100644 --- a/Projectiles/Melee/CnidarianJellyfishOnTheString.cs +++ b/Projectiles/Melee/CnidarianJellyfishOnTheString.cs @@ -205,6 +205,14 @@ namespace CalamityMod.Projectiles.Melee public void SimulateSegments() { + // TODO -- Ozzatron put this here to stop multiplayer errors. + if (Segments is null) + { + Segments = new List(SegmentCount); + for (int i = 0; i < SegmentCount; ++i) + Segments[i] = new VerletSimulatedSegment(Projectile.Center, false); + } + Segments[0].oldPosition = Segments[0].position; Segments[0].position = Projectile.Center; @@ -327,7 +335,17 @@ namespace CalamityMod.Projectiles.Melee public override void ReceiveExtraAI(BinaryReader reader) { - Segments[SegmentCount - 1].position = reader.ReadVector2(); + Vector2 sentPos = reader.ReadVector2(); + if (Segments is not null) + { + try + { + Segments[SegmentCount - 1].position = sentPos; + } + catch (Exception) { + CalamityMod.Instance.Logger.Warn("IbanPlay Victide Cnidarian Position Netcode failed safely"); + } + } } } } diff --git a/Projectiles/Summon/StormjawBaby.cs b/Projectiles/Summon/StormjawBaby.cs index a663a5efe5..94d00e3053 100644 --- a/Projectiles/Summon/StormjawBaby.cs +++ b/Projectiles/Summon/StormjawBaby.cs @@ -464,7 +464,7 @@ namespace CalamityMod.Projectiles.Summon int x = xPos + direction + (int) Projectile.velocity.X; for (int y = yPos; y < yPos + Projectile.height / 16 + 1; ++y) { - if (WorldGen.SolidTile(x, y)) + if (WorldGen.InWorld(x, y) && WorldGen.SolidTile(x, y)) flag3 = true; } } @@ -480,7 +480,7 @@ namespace CalamityMod.Projectiles.Summon x = (int)Projectile.Right.X / 16; int y = (int)Projectile.Bottom.Y / 16; Tile tile = Main.tile[x, y]; - if (WorldGen.SolidTile(x, y) || tile.IsHalfBlock || tile.Slope > 0 || TileID.Sets.Platforms[tile.TileType] && tile.HasTile && !tile.HasActuator) + if ((WorldGen.InWorld(x, y) && WorldGen.SolidTile(x, y)) || tile.IsHalfBlock || tile.Slope > 0 || TileID.Sets.Platforms[tile.TileType] && tile.HasTile && !tile.HasActuator) { try { diff --git a/Systems/WorldMiscUpdateSystem.cs b/Systems/WorldMiscUpdateSystem.cs index 3c6341cca3..e7bddbcd1c 100644 --- a/Systems/WorldMiscUpdateSystem.cs +++ b/Systems/WorldMiscUpdateSystem.cs @@ -44,8 +44,13 @@ namespace CalamityMod.Systems // Player variable, always finds the closest player relative to the center of the map int closestPlayer = Player.FindClosest(new Vector2(Main.maxTilesX / 2, (float)Main.worldSurface / 2f) * 16f, 0, 0); - Player player = Main.player[closestPlayer]; - CalamityPlayer modPlayer = player.Calamity(); + Player player = null; + CalamityPlayer modPlayer = null; + if (closestPlayer > -1) + { + player = Main.player[closestPlayer]; + modPlayer = player.Calamity(); + } // Force boss rush to off if necessary. if (!BossRushEvent.DeactivateStupidFuckingBullshit) @@ -75,9 +80,12 @@ namespace CalamityMod.Systems BossRushEvent.Update(); // Handle conditional summons. - TrySpawnArmoredDigger(player, modPlayer); - TrySpawnDungeonGuardian(player); - TrySpawnAEoW(player, modPlayer); + if (player is not null) + { + TrySpawnArmoredDigger(player, modPlayer); + TrySpawnDungeonGuardian(player); + TrySpawnAEoW(player, modPlayer); + } // Very, very, very rarely display a Lorde joke text if the system clock is set to April Fools Day. if (Main.rand.NextBool(100000000) && DateTime.Now.Month == 4 && DateTime.Now.Day == 1)