Draedon works properly in MP
This commit is contained in:
1 parent
825a1fb1a9
commit
2e52bebfca
2 files changed
+7
-9
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user