diff --git a/CalamityMod.cs b/CalamityMod.cs index 3d42028389..a237b266a0 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -3912,7 +3912,14 @@ namespace CalamityMod if (Main.netMode != NetmodeID.MultiplayerClient) NPC.NewNPC(x, y, ModContent.NPCType()); break; - default: + case CalamityModMessageType.SyncCalamityNPCAIArray: + byte npcIndex2 = reader.ReadByte(); + Main.npc[npcIndex2].Calamity().newAI[0] = reader.ReadSingle(); + Main.npc[npcIndex2].Calamity().newAI[1] = reader.ReadSingle(); + Main.npc[npcIndex2].Calamity().newAI[2] = reader.ReadSingle(); + Main.npc[npcIndex2].Calamity().newAI[3] = reader.ReadSingle(); + break; + default: Logger.Error($"Failed to parse Calamity packet: No Calamity packet exists with ID {msgType}."); break; } @@ -3994,6 +4001,7 @@ namespace CalamityMod AcidRainUIDrawFadeSync, AcidRainOldDukeSummonSync, GaelsGreatswordSwingSync, - SpawnSuperDummy + SpawnSuperDummy, + SyncCalamityNPCAIArray } } diff --git a/Items/Weapons/Ranged/LunarianBow.cs b/Items/Weapons/Ranged/LunarianBow.cs index 854bc2b4aa..a5656336c7 100644 --- a/Items/Weapons/Ranged/LunarianBow.cs +++ b/Items/Weapons/Ranged/LunarianBow.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 20; + item.damage = 29; item.ranged = true; item.width = 22; item.height = 62; diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 77352320b7..33b2e38f75 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -2838,6 +2838,11 @@ namespace CalamityMod.NPCs // Phase for flying at the player bool flyAtTarget = calamityGlobalNPC.newAI[3] >= (aiSwitchTimer * 0.5f) && startFlightPhase; + // Length of worms + int phase1Length = death ? 80 : revenge ? 70 : expertMode ? 60 : 50; + int phase2Length = phase1Length / 2; + int maxLength = doubleWormPhase ? phase2Length : phase1Length; + // Split into two worms if (head) { @@ -2863,12 +2868,28 @@ namespace CalamityMod.NPCs Main.npc[npc2].velocity = Vector2.Normalize(player.Center - Main.npc[npc2].Center) * 16f; Main.npc[npc2].timeLeft *= 20; Main.npc[npc2].netUpdate = true; + if (Main.netMode == NetmodeID.Server) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.SyncCalamityNPCAIArray); + netMessage.Write(Main.npc[npc2].Calamity().newAI[0]); + netMessage.Send(); + } + int npc3 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, npc.type, 1); Main.npc[npc3].Calamity().newAI[0] = 2f; Main.npc[npc3].Calamity().newAI[3] = 600f; Main.npc[npc3].velocity = Vector2.Normalize(player.Center - Main.npc[npc3].Center) * 16f; Main.npc[npc3].timeLeft *= 20; Main.npc[npc3].netUpdate = true; + if (Main.netMode == NetmodeID.Server) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.SyncCalamityNPCAIArray); + netMessage.Write(Main.npc[npc3].Calamity().newAI[0]); + netMessage.Write(Main.npc[npc3].Calamity().newAI[3]); + netMessage.Send(); + } } } @@ -2955,7 +2976,6 @@ namespace CalamityMod.NPCs { if (npc.ai[0] == 0f) { - int maxLength = doubleWormPhase ? 45 : 90; int Previous = npc.whoAmI; int bodyType = ModContent.NPCType(); int tailType = ModContent.NPCType();