diff --git a/src/engine/devcmd/cmds/ItemInfoCmd.java b/src/engine/devcmd/cmds/ItemInfoCmd.java new file mode 100644 index 00000000..5c18572f --- /dev/null +++ b/src/engine/devcmd/cmds/ItemInfoCmd.java @@ -0,0 +1,80 @@ +// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . +// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· +// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ +// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ +// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ +// Magicbane Emulator Project © 2013 - 2022 +// www.magicbane.com + + +package engine.devcmd.cmds; + +import engine.Enum; +import engine.Enum.BuildingGroup; +import engine.Enum.GameObjectType; +import engine.Enum.TargetColor; +import engine.devcmd.AbstractDevCmd; +import engine.gameManager.BuildingManager; +import engine.gameManager.SessionManager; +import engine.math.Vector3fImmutable; +import engine.objects.*; +import engine.util.StringUtils; + +import java.text.DecimalFormat; +import java.util.ArrayList; +import java.util.concurrent.ConcurrentHashMap; + + +/** + * @author + */ +public class ItemInfoCmd extends AbstractDevCmd { + + public ItemInfoCmd() { + super("iteminfo"); + } + + @Override + protected void _doCmd(PlayerCharacter pc, String[] words,AbstractGameObject target) { + if (pc == null) { + return; + } + if(target.getObjectType().equals(GameObjectType.Item) == false){ + throwbackInfo(pc, "Must Select An Item"); + return; + } + Item item = (Item)target; + String newline = "\r\n "; + String output = ""; + output += "Required Races:" + newline; + for(Enum.MonsterType required : item.getItemBase().requiredRaces) + output += " " + required.name() + newline; + output += "Restricted Races:" + newline; + for(Enum.MonsterType required : item.getItemBase().restrictedRaces) + output += " " + required.name() + newline; + output += "Required Classes:" + newline; + for(Enum.ClassType required : item.getItemBase().requiredClasses) + output += " " + required.name() + newline; + output += "Restricted Classes:" + newline; + for(Enum.ClassType required : item.getItemBase().restrictedClasses) + output += " " + required.name() + newline; + output += "Required Disciplines:" + newline; + for(Enum.DisciplineType required : item.getItemBase().requiredDiscs) + output += " " + required.name() + newline; + output += "Restricted Disciplines:" + newline; + for(Enum.DisciplineType required : item.getItemBase().restrictedDiscs) + output += " " + required.name() + newline; + throwbackInfo(pc, output); + } + + @Override + protected String _getHelpString() { + return "Gets information on an Object."; + } + + @Override + protected String _getUsageString() { + return "' /iteminfo'"; + } + +} diff --git a/src/engine/gameManager/DevCmdManager.java b/src/engine/gameManager/DevCmdManager.java index 52c730b6..b79cb8de 100644 --- a/src/engine/gameManager/DevCmdManager.java +++ b/src/engine/gameManager/DevCmdManager.java @@ -58,6 +58,7 @@ public enum DevCmdManager { DevCmdManager.registerDevCmd(new PrintResistsCmd()); DevCmdManager.registerDevCmd(new PrintLocationCmd()); DevCmdManager.registerDevCmd(new InfoCmd()); + DevCmdManager.registerDevCmd(new ItemInfoCmd()); DevCmdManager.registerDevCmd(new aiInfoCmd()); DevCmdManager.registerDevCmd(new SimulateBootyCmd()); DevCmdManager.registerDevCmd(new GetHeightCmd());