from .. import Region, Ifc, Utl, Map, Node, Monster, g from ..data import Species, Items, Nodes # BEHOLD, THE ANCIENT PIKACHU HIVE def PikachuRegion(origin, region, direction): origin.description = "This tunnel reaks of pikachu and looks ancient. Perhaps it is the source of the infestation." origin.name = "Reaking Tunnel" origin.color = Ifc.BRIGHT_WHITE origin.unique = True oldnode, newnode = None, origin size, phase = Utl.d(4, 10), 1 curdir = direction for x in xrange(size): oldnode, newnode = newnode, PikachuTunnel(region=region) Region.makelink(newnode, oldnode, curdir) if Utl.rn(2) == 0: phase = -phase curdir = Map.rotate(curdir, phase) oldnode, newnode = newnode, PikachuHive(region=region) Region.makelink(newnode, oldnode, curdir) Region.makelink(PikachuQueenLair(region=region), newnode, curdir) Region.makelink(PikachuEggChamber(region=region), newnode, Map.rotate(curdir,1)) Region.makelink(PikachuEggChamber(region=region), newnode, Map.rotate(curdir,-1)) class PikachuTunnel(Node.Node): def xinit(self): self.color = Ifc.BRIGHT_WHITE self.name = "Pikachu Infested Tunnel" self.description = ("This tunnel is " +Utl.rn_seq(["low and cramped","cramped and low","low","cramped"]) +Utl.rn_seq([", and it reaks of rodent urine.", ". You fear hantavirus.", ", and it smells like a poorly cleaned hamster cage.", ", smelling of a rodent cage.", ". There are tufts of yellow fur on the ground."])) self.tunnel = True self.spawn_chance = 1 self.spawn = [Species.raichu, Species.pikachu, Species.pikachu_warrior, Species.ancient_pikachu] for x in xrange(Utl.rn(5)+1): mon=Utl.rn_seq(self.spawn).make(ai=Monster.SLEEPING) mon.hive_minded = True self.add(mon) if Utl.rn(): self.add(Utl.rn_seq([Items.pikachu_egg,Items.wonderful_egg,Items.pikachu_corpse,Items.fur_scrap]).make()) class PikachuHive(Node.Node): def xinit(self): self.color = Ifc.BRIGHT_WHITE self.name = "Pikachu Hive Tunnel" self.description = """This area is filled with swarming yellow pikachu larvae and older specimines.""" self.special_symbol = '+' self.tunnel = True self.spawn_chance = 1 self.spawn = [Species.pikachu_warrior, Species.ancient_pikachu, Species.pikachu_lord] for x in xrange(Utl.rn(6)+4): mon=Utl.rn_seq(self.spawn).make(ai=Monster.SLEEPING) mon.hive_minded = True self.add(mon) for x in xrange(Utl.rn(4)): self.add(Utl.rn_seq([Items.pikachu_egg,Items.wonderful_egg,Items.pikachu_corpse,Items.fur_scrap]).make()) class PikachuEggChamber(Node.Node): def xinit(self): self.color = Ifc.BRIGHT_WHITE self.name = "Egg Chamber" self.description = """This room is filled with pikachu eggs.""" self.special_symbol = '0' self.tunnel = True self.spawn_chance = 1 self.spawn = [Species.pikachu_warrior, Species.pikachu_lord] for x in xrange(6): mon=Utl.rn_seq(self.spawn).make(ai=Monster.SLEEPING) mon.hive_minded = True self.add(mon) for x in xrange(8): egg = Utl.rn_seq([Items.pikachu_egg,Items.wonderful_egg]).make() egg.tainted = Utl.rn() egg.blessed = Utl.rn() self.add(egg) class PikachuQueenLair(Node.Node): def xinit(self): self.color = Ifc.BRIGHT_WHITE self.name = "Queen's Lair" self.description = """This room is the chamber of a Queen Pikachu.""" self.special_symbol = '@' self.tunnel = False self.spawn_chance = 1 self.spawn = [Species.pikachu_warrior, Species.pikachu_lord] for x in xrange(6): mon=Utl.rn_seq(self.spawn).make(ai=Monster.SLEEPING) mon.hive_minded = True self.add(mon) for x in xrange(6): egg = Utl.rn_seq([Items.pikachu_egg,Items.wonderful_egg]).make() egg.tainted = Utl.rn() egg.blessed = Utl.rn() self.add(egg) self.add(Species.pikachu_queen.make())