Browse Source

dev command for item requirement info

combat-2
FatBoy-DOTC 9 months ago
parent
commit
c1de1f148b
  1. 80
      src/engine/devcmd/cmds/ItemInfoCmd.java
  2. 1
      src/engine/gameManager/DevCmdManager.java

80
src/engine/devcmd/cmds/ItemInfoCmd.java

@ -0,0 +1,80 @@ @@ -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'";
}
}

1
src/engine/gameManager/DevCmdManager.java

@ -58,6 +58,7 @@ public enum DevCmdManager { @@ -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());

Loading…
Cancel
Save