|
|
@ -11,9 +11,7 @@ package engine.devcmd.cmds; |
|
|
|
|
|
|
|
|
|
|
|
import engine.Enum.GameObjectType; |
|
|
|
import engine.Enum.GameObjectType; |
|
|
|
import engine.devcmd.AbstractDevCmd; |
|
|
|
import engine.devcmd.AbstractDevCmd; |
|
|
|
import engine.gameManager.BuildingManager; |
|
|
|
|
|
|
|
import engine.objects.AbstractGameObject; |
|
|
|
import engine.objects.AbstractGameObject; |
|
|
|
import engine.objects.Building; |
|
|
|
|
|
|
|
import engine.objects.Mob; |
|
|
|
import engine.objects.Mob; |
|
|
|
import engine.objects.PlayerCharacter; |
|
|
|
import engine.objects.PlayerCharacter; |
|
|
|
|
|
|
|
|
|
|
@ -30,46 +28,31 @@ public class aiInfoCmd extends AbstractDevCmd { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void _doCmd(PlayerCharacter pc, String[] words, |
|
|
|
protected void _doCmd(PlayerCharacter playerCharacter, String[] words, |
|
|
|
AbstractGameObject target) { |
|
|
|
AbstractGameObject target) { |
|
|
|
|
|
|
|
|
|
|
|
// Arg Count Check
|
|
|
|
// Arg Count Check
|
|
|
|
|
|
|
|
|
|
|
|
if (words.length != 1) { |
|
|
|
if (words.length != 1) { |
|
|
|
this.sendUsage(pc); |
|
|
|
this.sendUsage(playerCharacter); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (pc == null) { |
|
|
|
|
|
|
|
|
|
|
|
if (playerCharacter == null) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String newline = "\r\n "; |
|
|
|
String newline = "\r\n "; |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
int targetID = Integer.parseInt(words[0]); |
|
|
|
|
|
|
|
Building b = BuildingManager.getBuilding(targetID); |
|
|
|
|
|
|
|
if (b == null) |
|
|
|
|
|
|
|
throwbackError(pc, "Building with ID " + targetID |
|
|
|
|
|
|
|
+ " not found"); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
target = b; |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (target == null) { |
|
|
|
|
|
|
|
throwbackError(pc, "Target is unknown or of an invalid type." |
|
|
|
|
|
|
|
+ newline + "Type ID: 0x" |
|
|
|
|
|
|
|
+ pc.getLastTargetType().toString() |
|
|
|
|
|
|
|
+ " Table ID: " + pc.getLastTargetID()); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GameObjectType objType = target.getObjectType(); |
|
|
|
GameObjectType objType = target.getObjectType(); |
|
|
|
int objectUUID = target.getObjectUUID(); |
|
|
|
|
|
|
|
String output; |
|
|
|
String output; |
|
|
|
|
|
|
|
|
|
|
|
if (objType != GameObjectType.Mob) { |
|
|
|
if (objType != GameObjectType.Mob) { |
|
|
|
output = "Please Select A Mob For AI Info" + newline; |
|
|
|
output = "Please Select A Mob For AI Info" + newline; |
|
|
|
} else { |
|
|
|
throwbackInfo(playerCharacter, output); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Mob mob = (Mob) target; |
|
|
|
Mob mob = (Mob) target; |
|
|
|
output = "Mob AI Information:" + newline; |
|
|
|
output = "Mob AI Information:" + newline; |
|
|
|
output += mob.getName() + newline; |
|
|
|
output += mob.getName() + newline; |
|
|
@ -100,8 +83,11 @@ public class aiInfoCmd extends AbstractDevCmd { |
|
|
|
output += "Current Target: " + mob.getCombatTarget().getName() + newline; |
|
|
|
output += "Current Target: " + mob.getCombatTarget().getName() + newline; |
|
|
|
else |
|
|
|
else |
|
|
|
output += "Current Target: NULL" + newline; |
|
|
|
output += "Current Target: NULL" + newline; |
|
|
|
} |
|
|
|
|
|
|
|
throwbackInfo(pc, output); |
|
|
|
for (int token : mob.mobPowers.keySet()) |
|
|
|
|
|
|
|
output += token + newline; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
throwbackInfo(playerCharacter, output); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|