using SoulHarvest.Common; using SoulHarvest.Items; using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; namespace SoulHarvest.Commands; public sealed class ReaperDebugItemsCommand : ModCommand { public override string Command => "reaperdebugitems"; public override CommandType Type => CommandType.World; public override string Usage => "/reaperdebugitems"; public override string Description => Language.GetTextValue("Mods.SoulHarvest.Commands.ItemsDescription"); public override void Action(CommandCaller caller, string input, string[] args) { if (!ReaperDebugMode.TryGetPlayer(caller, out Player player)) return; int spawnedItemTypes = 0; foreach (ModItem modItem in Mod.GetContent()) { // DeathDomain is an altar-only virtual entry. Soul Seal items mirror an // authoritative character ledger and must be issued through its service. if (modItem is DeathDomain or ReaperSoulSealItem) continue; player.QuickSpawnItem( player.GetSource_Misc("SoulHarvest:DebugAllItems"), modItem.Type); spawnedItemTypes++; } int grantedSealPoints = 0; for (ReaperStage stage = ReaperStage.StageI; stage <= ReaperStage.StageIII; stage++) { if (ReaperProgressionSoulSealService.TryGrant(player, stage)) grantedSealPoints++; } caller.Reply(Language.GetTextValue( "Mods.SoulHarvest.Commands.ItemsSuccess", spawnedItemTypes, grantedSealPoints), new Color(115, 225, 190)); } }