summaryrefslogtreecommitdiff
path: root/NET/worlds/console/ArmyOfZombies.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/console/ArmyOfZombies.java')
-rw-r--r--NET/worlds/console/ArmyOfZombies.java142
1 files changed, 142 insertions, 0 deletions
diff --git a/NET/worlds/console/ArmyOfZombies.java b/NET/worlds/console/ArmyOfZombies.java
new file mode 100644
index 0000000..5cfaca2
--- /dev/null
+++ b/NET/worlds/console/ArmyOfZombies.java
@@ -0,0 +1,142 @@
+/* */ package NET.worlds.console;
+/* */
+/* */ import NET.worlds.network.URL;
+/* */ import NET.worlds.scape.DeepEnumeration;
+/* */ import NET.worlds.scape.Drone;
+/* */ import NET.worlds.scape.Pilot;
+/* */ import NET.worlds.scape.Point3Temp;
+/* */ import NET.worlds.scape.Room;
+/* */ import NET.worlds.scape.SuperRoot;
+/* */ import NET.worlds.scape.WObject;
+/* */ import NET.worlds.scape.World;
+/* */ import java.util.Enumeration;
+/* */ import java.util.Hashtable;
+/* */
+/* */
+/* */
+/* */ class ArmyOfZombies
+/* */ {
+/* */ Hashtable<String, Drone> zombies;
+/* 20 */ private static ArmyOfZombies instance = new ArmyOfZombies();
+/* */
+/* */ public static ArmyOfZombies instance() {
+/* 23 */ return instance;
+/* */ }
+/* */
+/* */ protected ArmyOfZombies() {
+/* 27 */ this.zombies = new Hashtable();
+/* */ }
+/* */
+/* */ public void killZombies()
+/* */ {
+/* 32 */ Enumeration<Drone> e = this.zombies.elements();
+/* 33 */ while (e.hasMoreElements()) {
+/* 34 */ Drone id = (Drone)e.nextElement();
+/* 35 */ Enumeration<WObject> en = id.getContents();
+/* 36 */ while (en.hasMoreElements()) {
+/* 37 */ WObject wob = (WObject)en.nextElement();
+/* 38 */ wob.detach();
+/* */ }
+/* 40 */ id.detach();
+/* 41 */ id.discard();
+/* */ }
+/* 43 */ this.zombies.clear();
+/* */ }
+/* */
+/* */ public void addZombie(Drone id) {
+/* 47 */ String name = id.getName();
+/* 48 */ if (name.charAt(0) == '!') {
+/* 49 */ name = name.substring(1);
+/* */ }
+/* */
+/* 52 */ this.zombies.put(name, id);
+/* */ }
+/* */
+/* */ public void replaceZombie(String name, Drone id) {
+/* 56 */ Drone oldId = get(name);
+/* 57 */ if (oldId == id)
+/* 58 */ return;
+/* 59 */ this.zombies.remove(name);
+/* 60 */ addZombie(id);
+/* 61 */ id.makeTag(true);
+/* */ }
+/* */
+/* */ public void killZombie(String name) {
+/* 65 */ Drone id = get(name);
+/* 66 */ if (id != null) {
+/* 67 */ this.zombies.remove(name);
+/* 68 */ id.detach();
+/* */ }
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public void zombify()
+/* */ {
+/* 78 */ if (Pilot.getActive() == null)
+/* 79 */ return;
+/* 80 */ if (Pilot.getActive().getRoom() == null)
+/* 81 */ return;
+/* 82 */ if (Pilot.getActive().getRoom().getWorld() == null) {
+/* 83 */ return;
+/* */ }
+/* 85 */ Enumeration<Object> rooms = Pilot.getActive().getRoom().getWorld().getRooms();
+/* 86 */ while (rooms.hasMoreElements()) {
+/* 87 */ Room r = (Room)rooms.nextElement();
+/* 88 */ if (r != null)
+/* */ {
+/* */
+/* 91 */ DeepEnumeration<Object> de = new DeepEnumeration();
+/* 92 */ r.getChildren(de);
+/* */
+/* 94 */ while (de.hasMoreElements()) {
+/* 95 */ Object o = de.nextElement();
+/* 96 */ if ((o instanceof Drone))
+/* */ {
+/* */
+/* 99 */ Drone d = (Drone)o;
+/* */
+/* 101 */ Point3Temp pos = d.getPosition();
+/* 102 */ short dir = (short)(int)(-d.getYaw() + 90.0F);
+/* 103 */ dir = (short)(dir % 360);
+/* 104 */ while (dir < 0) {
+/* 105 */ dir = (short)(dir + 360);
+/* */ }
+/* */
+/* 108 */ SuperRoot wobj = d.getOwner();
+/* 109 */ if (wobj != null)
+/* */ {
+/* 111 */ Room rm = wobj.getRoom();
+/* 112 */ if (rm != null)
+/* */ {
+/* 114 */ if (d.getName() != null)
+/* */ {
+/* 116 */ BlackBox.getInstance().submitEvent(
+/* 117 */ new BBAppearDroneCommand(r.getRoom().toString(), d
+/* 118 */ .getName(), (short)(int)pos.x, (short)(int)pos.y,
+/* 119 */ (short)(int)pos.z, dir));
+/* 120 */ if (d.getCurrentURL() != null)
+/* */ {
+/* 122 */ BlackBox.getInstance().submitEvent(
+/* 123 */ new BBDroneBitmapCommand(d.getName(), d.getCurrentURL()
+/* 124 */ .toString())); }
+/* */ } }
+/* */ }
+/* */ }
+/* */ }
+/* */ } } }
+/* */
+/* 131 */ Drone get(String name) { if (name.charAt(0) == '!') {
+/* 132 */ name = name.substring(1);
+/* */ }
+/* 134 */ return (Drone)this.zombies.get(name);
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\ArmyOfZombies.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file