From 4d760146339488bafd622d48eb3649963e74cacd Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 24 Apr 2023 16:41:25 -0400 Subject: [PATCH] Dev cmd to test new system. --- src/engine/devcmd/cmds/SlotTestCmd.java | 71 +++++++++++++++++++++++ src/engine/gameManager/DevCmdManager.java | 1 + 2 files changed, 72 insertions(+) create mode 100644 src/engine/devcmd/cmds/SlotTestCmd.java diff --git a/src/engine/devcmd/cmds/SlotTestCmd.java b/src/engine/devcmd/cmds/SlotTestCmd.java new file mode 100644 index 00000000..3058b5d6 --- /dev/null +++ b/src/engine/devcmd/cmds/SlotTestCmd.java @@ -0,0 +1,71 @@ +// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . +// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· +// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ +// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ +// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ +// Magicbane Emulator Project © 2013 - 2022 +// www.magicbane.com + + + +package engine.devcmd.cmds; + +import engine.Enum.GameObjectType; +import engine.devcmd.AbstractDevCmd; +import engine.gameManager.BuildingManager; +import engine.gameManager.ChatManager; +import engine.objects.*; + +public class SlotTestCmd extends AbstractDevCmd { + + public SlotTestCmd() { + super("slottest"); + } + + @Override + protected void _doCmd(PlayerCharacter playerCharacter, String[] args, + AbstractGameObject target) { + + String outString = "Available Slots\r\n"; + + if (target == null) + return; + + if (target.getObjectType() != GameObjectType.Building) + return; + + Building building = (Building)target; + + for (BuildingLocation buildingLocation : BuildingManager._slotLocations.get(building.meshUUID)) + outString += buildingLocation.getSlot() + buildingLocation.getLoc().toString() + "\r\n"; + + outString += "\r\nNeext Available Slot: " + BuildingManager.getAvailableSlot(building); + + if (building.getHirelings().isEmpty() == false) { + + outString += "\r\n\r\n"; + outString += "Hirelings List: name / slot / floor"; + + for (AbstractCharacter hireling : building.getHirelings().keySet()) { + + outString += "\r\n" + hireling.getName() + " slot " + building.getHirelings().get(hireling); + outString += "\r\n" + "location " + hireling.getLoc(); + } + } + + ChatManager.chatSystemInfo(playerCharacter,outString); + + } + + @Override + protected String _getHelpString() { + return "Temporarily Changes SubRace"; + } + + @Override + protected String _getUsageString() { + return "' /setBuildingCollidables add/remove 'add creates a collision line.' needs 4 integers. startX, endX, startY, endY"; + + } + +} diff --git a/src/engine/gameManager/DevCmdManager.java b/src/engine/gameManager/DevCmdManager.java index 698d92dd..c42bf426 100644 --- a/src/engine/gameManager/DevCmdManager.java +++ b/src/engine/gameManager/DevCmdManager.java @@ -149,6 +149,7 @@ public enum DevCmdManager { DevCmdManager.registerDevCmd(new SetMaintCmd()); DevCmdManager.registerDevCmd(new ApplyBonusCmd()); DevCmdManager.registerDevCmd(new AuditFailedItemsCmd()); + DevCmdManager.registerDevCmd(new SlotTestCmd()); }