package th; // Globals // Really only the player character is here. // Yes, globals can invite bad programming. However, some thing are // just supposed to be global, and work best that way. import java.util.Random; import java.util.Scanner; import java.util.Vector; public final class g { public static boolean tall = true; public static Mon player; // The player character public static Mon pet; public static Random rng = new Random(); public static Scanner in = new Scanner(System.in); // Just run the constructor... public static Species species = new Species(); public static Items items = new Items(); public static Node here = null; public static Node center = null; public static int turns = 0; public static int major = 0; public static String from = null; public static Itm artifact; // debug mode? public static boolean debug = false; // Conducts public static int vegetarian = 0; // Times eaten non-vegetarian food public static int vegan = 0; public static int food = 0; // ate food public static int pets_lost = 0; public static int used_wand = 0; // check public static int used_weapon = 0; public static int illiterate = 0; public static int killed_zeius = 0; public static int teleported = 0; public static int polymorphed = 0; public static int controlled_polymorph = 0; public static Vector special_merits = new Vector(); // Allow score bonus public static int bonus = 0; // The player can get away with 0-5 murders. public static int allow_murder = Utl.rn(6); // There is a list of nodes here so that we don't have to // traverse the maze every turn to do updating. public static Vector nodes = new Vector(); public static Vector deadends = new Vector(); public static Vector monsters = new Vector(); public static Vector update = new Vector(); public static int highest_ap = 0; public static int phase = 0; public static int visited = 0; public static Node glide; public static boolean glidetrigger = false; public static void addInPlace(Mon m) { int pos = 0; if (m.ap > highest_ap) highest_ap = m.ap; for (int i = 0; i < monsters.size(); ++i) { pos = i; Mon tmp = (Mon)monsters.elementAt(i); if (tmp.ap <= m.ap && tmp.dx < m.dx) { monsters.add(i, m); return; } } monsters.addElement(m); } public static void delMon(Mon m) { boolean tmp = monsters.remove((Object)m); } public static void readdMon(Mon m) { delMon(m); addInPlace(m); } public static void doUpdate () { for (int i = 0; i < update.size(); ++i) readdMon((Mon)update.elementAt(i)); update.removeAllElements(); } }