Herb Type and Planter Box Type enums.

This commit is contained in:
mountaindrew10 committed 2025-05-07 14:46:11 -05:00
1 parent 9b1eabcf5f
commit 6100ed4140
4 files changed
+50 -28

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
namespace CalamityMod
{
public enum HerbType
{
Daybloom,
Moonglow,
Blinkroot,
Deathweed,
Waterleaf,
Fireblossom,
Shiverthorn
}
}
+14
View File
@@ -0,0 +1,14 @@
namespace CalamityMod
{
public enum PlanterBoxType
{
Daybloom,
Moonglow,
Deathweed,
DeathweedCrimson,
Blinkroot,
Waterleaf,
Shiverthorn,
Fireblossom
}
}
+15 -21
View File
@@ -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;
}
+8 -7
View File
@@ -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;
}