diff --git a/Enums/HerbType.cs b/Enums/HerbType.cs new file mode 100644 index 0000000000..42e672407e --- /dev/null +++ b/Enums/HerbType.cs @@ -0,0 +1,13 @@ +namespace CalamityMod +{ + public enum HerbType + { + Daybloom, + Moonglow, + Blinkroot, + Deathweed, + Waterleaf, + Fireblossom, + Shiverthorn + } +} diff --git a/Enums/PlanterBoxType.cs b/Enums/PlanterBoxType.cs new file mode 100644 index 0000000000..60447d4ac5 --- /dev/null +++ b/Enums/PlanterBoxType.cs @@ -0,0 +1,14 @@ +namespace CalamityMod +{ + public enum PlanterBoxType + { + Daybloom, + Moonglow, + Deathweed, + DeathweedCrimson, + Blinkroot, + Waterleaf, + Shiverthorn, + Fireblossom + } +} diff --git a/Systems/World/WorldMiscUpdateSystem.cs b/Systems/World/WorldMiscUpdateSystem.cs index 6fc3f24c6c..3056ee31a6 100644 --- a/Systems/World/WorldMiscUpdateSystem.cs +++ b/Systems/World/WorldMiscUpdateSystem.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.CalPlayer; +using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.NPCs; using CalamityMod.NPCs.ExoMechs; @@ -526,45 +527,38 @@ namespace CalamityMod.Systems default: break; - // Daybloom - case 0: - if (planterBoxType == 0) + case (int)HerbType.Daybloom: + if (planterBoxType == (int)PlanterBoxType.Daybloom) usingCorrectPlanterBox = true; break; - // Moonglow - case 1: - if (planterBoxType == 1) + case (int)HerbType.Moonglow: + if (planterBoxType == (int)PlanterBoxType.Moonglow) usingCorrectPlanterBox = true; break; - // Blinkroot - case 2: - if (planterBoxType == 4) + case (int)HerbType.Blinkroot: + if (planterBoxType == (int)PlanterBoxType.Blinkroot) usingCorrectPlanterBox = true; break; - // Deathweed - case 3: - if (planterBoxType == 2 || planterBoxType == 3) + case (int)HerbType.Deathweed: + if (planterBoxType == (int)PlanterBoxType.Deathweed || planterBoxType == (int)PlanterBoxType.DeathweedCrimson) usingCorrectPlanterBox = true; break; - // Waterleaf - case 4: - if (planterBoxType == 5) + case (int)HerbType.Waterleaf: + if (planterBoxType == (int)PlanterBoxType.Waterleaf) usingCorrectPlanterBox = true; break; - // Fireblossom - case 5: - if (planterBoxType == 7) + case (int)HerbType.Fireblossom: + if (planterBoxType == (int)PlanterBoxType.Fireblossom) usingCorrectPlanterBox = true; break; - // Shiverthorn - case 6: - if (planterBoxType == 6) + case (int)HerbType.Shiverthorn: + if (planterBoxType == (int)PlanterBoxType.Shiverthorn) usingCorrectPlanterBox = true; break; } diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index c247e4736b..ec394acc9d 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using CalamityMod.Enums; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Melee; @@ -321,31 +322,31 @@ namespace CalamityMod.Tiles default: break; - case 0: + case (int)HerbType.Daybloom: DropItem(i, j, ItemID.DaybloomSeeds, quantity: 1, asStack: true); break; - case 1: + case (int)HerbType.Moonglow: DropItem(i, j, ItemID.MoonglowSeeds, quantity: 1, asStack: true); break; - case 2: + case (int)HerbType.Blinkroot: DropItem(i, j, ItemID.BlinkrootSeeds, quantity: 1, asStack: true); break; - case 3: + case (int)HerbType.Deathweed: DropItem(i, j, ItemID.DeathweedSeeds, quantity: 1, asStack: true); break; - case 4: + case (int)HerbType.Waterleaf: DropItem(i, j, ItemID.WaterleafSeeds, quantity: 1, asStack: true); break; - case 5: + case (int)HerbType.Fireblossom: DropItem(i, j, ItemID.FireblossomSeeds, quantity: 1, asStack: true); break; - case 6: + case (int)HerbType.Shiverthorn: DropItem(i, j, ItemID.ShiverthornSeeds, quantity: 1, asStack: true); break; }