from .. import Region, Node, Ifc, Utl, Map, Monster, g from ..data import Species, Items def ScifiRegion(origin, region, direction): origin.color = Ifc.RED origin.name = "Noisy Tunnel" origin.description = "You hear here the distant sounds of conversation." newnode, oldnode = origin, None length = 2 * (Utl.d(1, 4) + 1) for x in xrange(length): oldnode, newnode = newnode, ScifiCorridor(region=region) Region.makelink(newnode, oldnode, direction) if (x + 1) % 2 == 0 and x + 1 < length: generate_side(newnode, region, Map.rotate(direction, -1)) generate_side(newnode, region, Map.rotate(direction, 1)) Region.makelink(ScifiFurry(region=region), newnode, Map.rotate(direction, -1)) Region.makelink(ScifiManga(region=region), newnode, Map.rotate(direction, 1)) Region.makelink(ScifiTrek(region=region), newnode, direction) def generate_side(origin, region, direction): newnode, oldnode = origin, None for x in xrange(6): oldnode, newnode = newnode, ScifiCorridor(region=region) Region.makelink(newnode, oldnode, direction) corridor_descs = [ "The tones of nerdly conversation fill the air.", "You hear someone speaking Klingon.", "A nearby sign invites people to a trading-card game tournament.", "A sign advertises role-playing games.", "You see an astonishing variety of interesting-looking people.", "There is a giant statue of some fictional robot here." ] class ScifiCorridor(Node.Node): def xinit(self): self.color = Ifc.BRIGHT_RED self.name = "Hidden Science-Fiction Convention" self.description = Utl.rn_seq(corridor_descs) self.unique = True self.tunnel = True self.spawn = Species.scifi_spawn self.spawn_chance = 1 for x in xrange(Utl.d(1, 5) + 1): self.add(Utl.rn_seq(Species.scifi_spawn).make()) class ScifiTrek(Node.Node): def xinit(self): self.special_symbol = '#' self.color = Ifc.MAJOR_RED self.name = "Convention Auditorium" self.description = """You are in a large convention hall. You smell what you assume are Klingon pheremones.""" self.unique = True self.tunnel = False self.spawn = Species.scifi_spawn self.spawn_chance = 1 for x in xrange(Utl.d(6, 6)): self.add(Species.trekie.make()) self.add(Species.geek.make()) self.add(Species.geek.make()) class ScifiManga(Node.Node): def xinit(self): self.special_symbol = '#' self.color = Ifc.MAJOR_RED self.name = "Manga Book Signing" self.description = "In this hall, a manga artist is signing copies of his work for fans." self.unique = True self.tunnel = False self.spawn = Species.scifi_spawn self.spawn_chance = 1 for x in xrange(Utl.d(2, 4)): self.add(Species.geek.make()) if Utl.rn(): self.add(Species.nerd.make()) self.add(Species.manga_artist.make()) self.add(Species.furry.make()) class ScifiFurry(Node.Node): def xinit(self): self.special_symbol = '#' self.color = Ifc.MAJOR_RED self.name = "Furvert Lair" self.description = "You see unpleasentness." self.unique = True self.locked = True self.tunnel = False self.spawn = Species.scifi_spawn self.spawn_chance = 1 for x in xrange(Utl.d(2, 4)): self.add(Species.furvert.make()) if Utl.rn(4) == 0: self.add(Species.furry.make()) tmp = Species.furvert.make(name='Stephanie', gender=2, hp=120, mhp=120) tmp.add(Items.fox_box.make()) self.add(tmp)