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-11-07 21:45:16 -06:00
|
|
|
import engine.gameManager.NavigationManager;
|
2023-10-27 20:07:43 -05:00
|
|
|
import engine.gameManager.ZoneManager;
|
2023-10-27 22:42:17 -05:00
|
|
|
import engine.math.Vector3f;
|
2023-11-07 19:18:46 -06:00
|
|
|
import engine.math.Vector3fImmutable;
|
2023-09-13 21:07:57 -05:00
|
|
|
import engine.objects.*;
|
2022-04-30 09:41:17 -04:00
|
|
|
|
2023-11-07 19:18:46 -06:00
|
|
|
import java.awt.*;
|
2023-11-07 20:17:51 -06:00
|
|
|
import java.awt.geom.AffineTransform;
|
2023-11-07 19:18:46 -06:00
|
|
|
import java.awt.geom.Area;
|
2023-11-07 19:50:29 -06:00
|
|
|
import java.awt.geom.Path2D;
|
2023-11-07 20:17:51 -06:00
|
|
|
import java.awt.geom.Rectangle2D;
|
2022-04-30 09:41:17 -04:00
|
|
|
import java.lang.reflect.Field;
|
|
|
|
|
|
2023-11-07 20:17:51 -06:00
|
|
|
import static java.awt.geom.Path2D.WIND_EVEN_ODD;
|
|
|
|
|
import static java.awt.geom.Path2D.WIND_NON_ZERO;
|
|
|
|
|
|
2022-04-30 09:41:17 -04:00
|
|
|
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;
|
2023-10-27 22:42:17 -05:00
|
|
|
output += "In Floor: " + ((AbstractCharacter) target).getInFloorID() + newline;
|
|
|
|
|
output += "In Building: " + ((AbstractCharacter) target).getInBuilding() + newline;
|
2023-09-13 21:07:57 -05:00
|
|
|
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;
|
2023-10-27 23:29:54 -05:00
|
|
|
output += "Region Height: " + region.lerpY(((AbstractCharacter)target).loc) + 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 22:42:17 -05:00
|
|
|
for(Vector3f point : region.regionPoints)
|
|
|
|
|
output += point + 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-11-07 19:18:46 -06: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;
|
|
|
|
|
//}
|
2023-11-07 21:45:16 -06:00
|
|
|
|
|
|
|
|
output += "pointBlocked: " + NavigationManager.pointIsBlocked(((AbstractCharacter)target).loc);
|
|
|
|
|
|
2023-11-07 19:18:46 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-27 21:55:31 -05:00
|
|
|
this.throwbackInfo(pc, output);
|
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
|
|
|
|
|
|
|
|
}
|