Draedon works properly in MP

This commit is contained in:
Dominic authored and Cameron Ewell committed 2021-09-21 15:15:28 -04:00
1 parent 825a1fb1a9
commit 2e52bebfca
2 files changed
+7 -9

No files matched your search

+3 -2
View File
@@ -314,8 +314,9 @@ namespace CalamityMod.NPCs.ExoMechs
public override void FindFrame(int frameHeight)
{
npc.frame.Width = 102;
int xFrame = npc.frame.X / npc.frame.Width;
int yFrame = npc.frame.Y / npc.frame.Height;
int yFrame = npc.frame.Y / frameHeight;
int frame = xFrame * Main.npcFrameCount[npc.type] + yFrame;
// Prepare to stand up if called for and not already doing so.
@@ -347,7 +348,7 @@ namespace CalamityMod.NPCs.ExoMechs
}
npc.frame.X = frame / Main.npcFrameCount[npc.type] * npc.frame.Width;
npc.frame.Y = frame % Main.npcFrameCount[npc.type] * npc.frame.Height;
npc.frame.Y = frame % Main.npcFrameCount[npc.type] * frameHeight;
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
+4 -7
View File
@@ -39,13 +39,10 @@ namespace CalamityMod.World
public static void PerformWorldUpdates()
{
// Reset the exo mech to summon if Draedon is absent.
if (Main.netMode != NetmodeID.MultiplayerClient && DraedonMechToSummon != ExoMech.None && CalamityGlobalNPC.draedon == -1)
{
if (DraedonMechToSummon != ExoMech.None && CalamityGlobalNPC.draedon == -1)
DraedonMechToSummon = ExoMech.None;
CalamityNetcode.SyncWorld();
}
if (DraedonSummonCountdown > 0)
if (Main.netMode != NetmodeID.MultiplayerClient && DraedonSummonCountdown > 0)
{
DraedonSummonCountdown--;
HandleDraedonSummoning();
@@ -131,11 +128,11 @@ namespace CalamityMod.World
public static void HandleDraedonSummoning()
{
// Fire a giant laser into the sky.
if (Main.netMode != NetmodeID.MultiplayerClient && DraedonSummonCountdown == DraedonSummonCountdownMax - 45)
if (DraedonSummonCountdown == DraedonSummonCountdownMax - 45)
Projectile.NewProjectile(DraedonSummonPosition + Vector2.UnitY * 80f, Vector2.Zero, ModContent.ProjectileType<DraedonSummonLaser>(), 70, 0f);
if (DraedonSummonCountdown == 0)
NPC.NewNPC((int)DraedonSummonPosition.X, (int)DraedonSummonPosition.Y, ModContent.NPCType<Draedon>(), 0, 0f, (int)DraedonMechToSummon);
NPC.NewNPC((int)DraedonSummonPosition.X, (int)DraedonSummonPosition.Y, ModContent.NPCType<Draedon>());
}
#endregion Handle Draedon Summoning