From c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 12 Feb 2026 22:33:32 -0800 Subject: Initial commit --- NET/worlds/console/BBMoveDroneCommand.java | 75 ++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 NET/worlds/console/BBMoveDroneCommand.java (limited to 'NET/worlds/console/BBMoveDroneCommand.java') diff --git a/NET/worlds/console/BBMoveDroneCommand.java b/NET/worlds/console/BBMoveDroneCommand.java new file mode 100644 index 0000000..464bd12 --- /dev/null +++ b/NET/worlds/console/BBMoveDroneCommand.java @@ -0,0 +1,75 @@ +package NET.worlds.console; + +import NET.worlds.scape.Drone; +import NET.worlds.scape.HoloPilot; +import NET.worlds.scape.Pilot; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +public class BBMoveDroneCommand extends BlackBoxCommand { + private short x; + private short y; + private short z; + private short dir; + private String droneID; + + public BBMoveDroneCommand() { + this.commandType = 3; + } + + public BBMoveDroneCommand(String pdroneID, short px, short py, short pz, short pdir) { + this(); + this.droneID = pdroneID; + this.x = px; + this.y = py; + this.z = pz; + this.dir = pdir; + } + + @Override + public boolean execute() { + Drone id = null; + if (this.droneID.equals("@Pilot")) { + Pilot p = Pilot.getActive(); + if (p != null && p instanceof HoloPilot) { + HoloPilot hp = (HoloPilot)p; + id = hp.getInternalDrone(); + } + } else { + id = ArmyOfZombies.instance().get(this.droneID); + } + + if (id != null) { + short _dir = this.dir; + _dir = (short)(90 - _dir); + _dir = (short)(360 - _dir); + id.longLoc(this.x, this.y, this.z, _dir); + this.doCallback(true); + return true; + } else { + this.doCallback(true); + return true; + } + } + + @Override + public void save(DataOutputStream dos) throws IOException { + super.save(dos); + dos.writeUTF(this.droneID); + dos.writeShort(this.x); + dos.writeShort(this.y); + dos.writeShort(this.z); + dos.writeShort(this.dir); + } + + @Override + public void load(DataInputStream dis) throws IOException { + super.load(dis); + this.droneID = dis.readUTF(); + this.x = dis.readShort(); + this.y = dis.readShort(); + this.z = dis.readShort(); + this.dir = dis.readShort(); + } +} -- cgit v1.2.3