// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ . // ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌· // ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀ // ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌ // ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀ // Magicbane Emulator Project © 2013 - 2022 // www.magicbane.com package engine.devcmd.cmds; import engine.InterestManagement.HeightMap; import engine.devcmd.AbstractDevCmd; import engine.gameManager.ZoneManager; import engine.math.Vector2f; import engine.objects.AbstractGameObject; import engine.objects.PlayerCharacter; import engine.objects.Zone; public class GetHeightCmd extends AbstractDevCmd { public GetHeightCmd() { super("getHeight"); this.addCmdString("height"); } @Override protected void _doCmd(PlayerCharacter playerCharacter, String[] words, AbstractGameObject target) { Zone currentZone; Zone parentZone; currentZone = ZoneManager.findSmallestZone(playerCharacter.getLoc()); parentZone = HeightMap.getNextZoneWithTerrain(currentZone.getParent()); float currentHeight = HeightMap.getWorldHeight(currentZone, playerCharacter.getLoc()); float parentHeight = HeightMap.getWorldHeight(parentZone, playerCharacter.getLoc()); this.throwbackInfo(playerCharacter, "Zone : " + currentZone.getName()); this.throwbackInfo(playerCharacter, "Altitude : " + currentHeight); Vector2f zoneLoc = ZoneManager.worldToZoneSpace(playerCharacter.getLoc(), currentZone); Vector2f gridSquare = currentZone.getHeightMap().getGridSquare(zoneLoc); this.throwbackInfo(playerCharacter, "Grid : " + gridSquare.toString()); this.throwbackInfo(playerCharacter, "Parent : " + parentZone.getName()); this.throwbackInfo(playerCharacter, "Altitude : " + parentHeight); this.throwbackInfo(playerCharacter, "Character Height: " + playerCharacter.getCharacterHeight()); } @Override protected String _getHelpString() { return "Queries heightmap engine"; } @Override protected String _getUsageString() { return "' /getheight"; } }