Files
Server/src/engine/devcmd/cmds/RegionCmd.java
T

72 lines
2.9 KiB
Java
Raw Normal View History

2022-04-30 09:41:17 -04:00
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.devcmd.cmds;
2023-09-13 21:07:57 -05:00
import engine.Enum;
2022-04-30 09:41:17 -04:00
import engine.devcmd.AbstractDevCmd;
2023-10-18 18:23:14 -05:00
import engine.gameManager.BuildingManager;
2023-10-27 20:07:43 -05:00
import engine.gameManager.ZoneManager;
2023-09-13 21:07:57 -05:00
import engine.objects.*;
2022-04-30 09:41:17 -04:00
import java.lang.reflect.Field;
public class RegionCmd extends AbstractDevCmd {
2023-07-15 09:23:48 -04:00
public RegionCmd() {
2022-04-30 09:41:17 -04:00
super("region");
}
2023-07-15 09:23:48 -04:00
@Override
protected void _doCmd(PlayerCharacter pc, String[] words,
AbstractGameObject target) {
2022-04-30 09:41:17 -04:00
2023-10-18 18:45:50 -05:00
String newline = "\r\n ";
String output;
output = "Target Region Information:" + newline;
2023-10-18 18:23:14 -05:00
Building building = BuildingManager.getBuildingAtLocation(((AbstractCharacter) target).loc);
if(building == null){
this.throwbackInfo(pc, "No Building At This Location.") ;
}
2023-09-13 21:07:57 -05:00
Regions region = ((AbstractCharacter)target).region;
if (region == null) {
2023-10-27 20:28:18 -05:00
output += "No Region Found." + newline;
}else{
2023-10-18 18:45:50 -05:00
output += "Player Info: " + ((AbstractCharacter) target).getName() + newline;
output += "Region Building: " + building.getName() + newline;
output += "Region Height: " + region.lerpY((AbstractCharacter)target) + newline;
2023-10-18 20:03:41 -05:00
output += "is Stairs: " + region.isStairs() + newline;
2023-10-27 20:28:18 -05:00
output += "is Outside: " + region.isOutside() + newline;
2023-10-27 20:07:43 -05:00
output += "NavMesh Data" + newline;
2023-10-18 18:45:50 -05:00
this.throwbackInfo(pc, output);
2023-07-15 09:23:48 -04:00
}
2023-10-27 20:28:18 -05:00
Zone zone = ZoneManager.findSmallestZone(((AbstractCharacter) target).loc);
if(zone != null) {
output += "zone: " + zone.zoneName + newline;
output += "on navmesh: " + zone.navMesh.contains(((AbstractCharacter) target).loc.x,((AbstractCharacter) target).loc.z) + newline;
}else {
output += "zone: null" + newline;
}
this.throwbackInfo(pc, "No Region Found.");
2023-07-15 09:23:48 -04:00
}
@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";
}
2022-04-30 09:41:17 -04:00
}