diff --git a/Enums/ExoMech.cs b/Enums/ExoMech.cs new file mode 100644 index 0000000000..bc83c71dda --- /dev/null +++ b/Enums/ExoMech.cs @@ -0,0 +1,10 @@ +namespace CalamityMod +{ + public enum ExoMech + { + None, + Destroyer, + Prime, + Twins + } +} diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index ad9fa558c6..c44df34746 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -16,14 +16,6 @@ namespace CalamityMod.NPCs.ExoMechs { public class Draedon : ModNPC { - public enum ExoMech - { - None, - Destroyer, - Prime, - Twins - } - public Vector2 HoverDestinationOffset { get => new Vector2(npc.ai[1], npc.ai[2]); diff --git a/UI/ExoMechSelectionUI.cs b/UI/ExoMechSelectionUI.cs index 0a37d95086..13963df5a5 100644 --- a/UI/ExoMechSelectionUI.cs +++ b/UI/ExoMechSelectionUI.cs @@ -31,12 +31,12 @@ namespace CalamityMod.UI Vector2 primeIconDrawOffset = new Vector2(0f, -140f); Vector2 twinsIconDrawOffset = new Vector2(78f, -124f); - HandleInteractionWithButton(baseDrawPosition + destroyerIconDrawOffset, Draedon.ExoMech.Destroyer); - HandleInteractionWithButton(baseDrawPosition + primeIconDrawOffset, Draedon.ExoMech.Prime); - HandleInteractionWithButton(baseDrawPosition + twinsIconDrawOffset, Draedon.ExoMech.Twins); + HandleInteractionWithButton(baseDrawPosition + destroyerIconDrawOffset, ExoMech.Destroyer); + HandleInteractionWithButton(baseDrawPosition + primeIconDrawOffset, ExoMech.Prime); + HandleInteractionWithButton(baseDrawPosition + twinsIconDrawOffset, ExoMech.Twins); } - public static bool HandleInteractionWithButton(Vector2 drawPosition, Draedon.ExoMech exoMech) + public static bool HandleInteractionWithButton(Vector2 drawPosition, ExoMech exoMech) { float iconScale; string description; @@ -44,18 +44,18 @@ namespace CalamityMod.UI switch (exoMech) { - case Draedon.ExoMech.Destroyer: + case ExoMech.Destroyer: iconScale = DestroyerIconScale; iconMechTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/HeadIcon_THanos"); description = "Thanatos, a serpentine terror with impervious armor and innumerable laser turrets."; break; - case Draedon.ExoMech.Prime: + case ExoMech.Prime: iconScale = PrimeIconScale; iconMechTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/HeadIcon_Ares"); description = "Ares, a heavyweight, diabolical monstrosity with four Exo superweapons."; break; default: - case Draedon.ExoMech.Twins: + case ExoMech.Twins: iconScale = TwinsIconScale; iconMechTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/HeadIcon_ArtemisApollo"); description = "Artemis and Apollo, a pair of extremely agile destroyers with pulse cannons."; @@ -63,7 +63,7 @@ namespace CalamityMod.UI } // Check for mouse collision/clicks. - Rectangle clickArea = Utils.CenteredRectangle(drawPosition, iconMechTexture.Size() * iconScale); + Rectangle clickArea = Utils.CenteredRectangle(drawPosition, iconMechTexture.Size() * iconScale * 0.9f); // Check if the mouse is hovering over the contact button area. bool hoveringOverIcon = MouseScreenArea.Intersects(clickArea); @@ -99,14 +99,14 @@ namespace CalamityMod.UI // And update to reflect the new scale. switch (exoMech) { - case Draedon.ExoMech.Destroyer: + case ExoMech.Destroyer: DestroyerIconScale = iconScale; break; - case Draedon.ExoMech.Prime: + case ExoMech.Prime: PrimeIconScale = iconScale; break; default: - case Draedon.ExoMech.Twins: + case ExoMech.Twins: TwinsIconScale = iconScale; break; } diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 49252e0ef3..3ee1d71aa5 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -164,7 +164,7 @@ namespace CalamityMod.World // Draedon Summoning stuff. public static int DraedonSummonCountdown = 0; - public static Draedon.ExoMech DraedonMechToSummon; + public static ExoMech DraedonMechToSummon; public static Vector2 DraedonSummonPosition = Vector2.Zero; public static bool AbleToSummonDraedon { @@ -1012,7 +1012,7 @@ namespace CalamityMod.World Reforges = reader.ReadInt32(); MoneyStolenByBandit = reader.ReadInt32(); DraedonSummonCountdown = reader.ReadInt32(); - DraedonMechToSummon = (Draedon.ExoMech)reader.ReadInt32(); + DraedonMechToSummon = (ExoMech)reader.ReadInt32(); DraedonSummonPosition = reader.ReadVector2(); } #endregion diff --git a/World/WorldUpdateMiscEffects.cs b/World/WorldUpdateMiscEffects.cs index 0cd51ebf93..e20d4186d8 100644 --- a/World/WorldUpdateMiscEffects.cs +++ b/World/WorldUpdateMiscEffects.cs @@ -39,9 +39,9 @@ namespace CalamityMod.World public static void PerformWorldUpdates() { // Reset the exo mech to summon if Draedon is absent. - if (Main.netMode != NetmodeID.MultiplayerClient && DraedonMechToSummon != Draedon.ExoMech.None && CalamityGlobalNPC.draedon == -1) + if (Main.netMode != NetmodeID.MultiplayerClient && DraedonMechToSummon != ExoMech.None && CalamityGlobalNPC.draedon == -1) { - DraedonMechToSummon = Draedon.ExoMech.None; + DraedonMechToSummon = ExoMech.None; CalamityNetcode.SyncWorld(); }