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

66 lines
2.4 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-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-07-15 09:23:48 -04:00
this.throwbackInfo(pc, "No Region Found.");
return;
}
2023-09-13 21:07:57 -05:00
if(region != null) {
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;
output += "is Outside: " + region.isOutside();
2023-10-18 18:45:50 -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
}