package th; class ConferenceRegion extends Region { public static String name = "Manhole"; public static String description = "At one end of the tunnel, you see a ladder leading up" + " through\na hole into a bright light."; public static String color = Ifc.BRIGHT_GREEN; public ConferenceRegion (Node start, int region) { super(start, region); } private static int[] rotation = {1, 1, 1, -1, 1, -1, -1}; private static Class ConferenceNode = Utl.gclass("ConferenceMainPassage"); private static Class ConferenceBranch = Utl.gclass("ConferenceBranchRoom"); private static Class ConferenceEncounter = Utl.gclass("ConferenceFinalRoom"); public void generate (Node origin, int region, int direction) { origin.description = description; origin.name = name; origin.color = color; origin.unique = true; Node newnode = origin; Node oldnode; int size = Utl.d(10, 4); int curdir = direction; int phase = 0; int hold = 3; while (size > 0) { oldnode = newnode; newnode = (Node)Utl.newInstance(ConferenceNode); newnode.region = region; if (hold > 0) --hold; else --size; if (Utl.rn(3) == 0 && hold < 2) { Node spawn = (Node)Utl.newInstance(ConferenceBranch); spawn.region = region; Map.makelink(spawn, newnode, Map.rotate(curdir, -rotation[phase])); } Map.makelink(newnode, oldnode, curdir); if (Utl.rn(4) == 0 && hold <= 0 && phase < 6) { ++phase; hold = 2; curdir = Map.rotate(curdir, rotation[phase]); } } oldnode = newnode; newnode = (Node)Utl.newInstance(ConferenceEncounter); newnode.region = region; Map.makelink(newnode, oldnode, curdir); } } class ConferenceMainPassage extends Node { public ConferenceMainPassage() { super(); description = "You're walking along a corridor in what looks like a building."; name = "Corridor"; color = Ifc.GREEN; tunnel = true; spawn = Species.conference_spawn; spawn_chance = 1; } } class ConferenceBranchRoom extends Node { private static String[] descriptions = { "There is a small coffee machine and a table crammed into the room.", "The room is dominated by an array of pipes against the far wall.", "This room is furnished only with a wall mirror and small dresser.", "The only feature in this room is a sink against one wall." }; public ConferenceBranchRoom() { super(); color = Ifc.GREEN; spawn = Species.conference_spawn; spawn_chance = 1; name = "Cramped Side Room"; description = Utl.rn(descriptions); int f = Utl.rn(4); for (int i = 0; i < f; ++i) add(Utl.rn(Species.conference_spawn).make()); } } class Senator_MonSpecial extends MonSpecial { public void die (Mon self, Mon killer, Node location) { if (killer == g.player) { g.special_merits.add("+150 for killing the corrupt senator"); g.bonus += 150; } } } class ConferenceFinalRoom extends Node { public ConferenceFinalRoom() { super(); color = Ifc.MAJOR_GREEN; name = "Dressing Room"; description = "The pre-press-conference dressing room of an infamous " + "corrupt\npolitician. Walls are lined with pictures of opponents and " + "various\nlegal documents."; spawn = Species.conference_spawn; spawn_chance = 1; tunnel = false; unique = true; Mon senator = Species.senator.make(); senator.inventory.add(Items.briefcase.make()); senator.special = new Senator_MonSpecial(); add(senator); } }