Пример #1
0
    def setup(self):
        self.killed_wife = False
        self.allow_jump = False
        self.jumped = False

        self.engine.player.can_run = False
        self.engine.player.set_running(False)

        self.wife = Wife()
        self.wife.move_to(*self.eventboxes["infected-wife"].rects[0].topleft)
        self.main_layer.add(self.wife)
        self.wife.dead.connect(self._on_wife_dead)
        self.wife.transitioned.connect(self._on_wife_transitioned)

        self.add_monologue("finding-wife", "This is where I told Laura to meet me. She must " "be here somewhere.")

        self.add_monologue(
            "found-wife",
            [
                "Laura! NO! No no no, God no.. My wife...",
                "What is she doing? Is she going to kill me?! What do I do?!!",
            ],
        )

        pygame.mixer.music.queue(get_music_path("oppressive_gloom.mp3"))
Пример #2
0
    def setup(self):
        self.has_items = {}

        self.add_item('vials',
                      'Found the equipment I need. Time to leave town and '
                      'get the rest.')
        self.add_item('mushroom',
                      'This looks like the right kind of mushroom. Lucky '
                      'nothing ate it...')
        self.add_item('sea-crystal',
                      'Shiny... I must be careful not to drop this.')
        self.add_item('web',
                      'This thing is gigantic. I\'m not sticking around to '
                      'see what made this.')
        self.add_item('flower',
                      'These aren\'t usually in bloom this time of year.\n'
                      'Another month and we\'d be screwed.')
        #self.add_item('sulfur',
        #              'Hot hot hot! I better scoop this up carefully.')

        # Town
        self.add_monologue('exit-lab',
                           '*cough* *cough* I can\'t believe I made it out '
                           'of there alive!')
        self.add_monologue('my-house',
            'My house seems to be okay. My wife would kill\n'
            'me if something happened to it.')
        self.add_monologue('kids',
            'Even the kids are infected. What have I done...')
        self.add_monologue('johnsons',
            'This is where the Johnsons lived. I never really liked them.')
        self.add_monologue('near-equipment',
            'The equipment I ordered should be in this shipment somewhere.')
        self.add_monologue('zombies',
            'I\'ve always wondered why the movies never use the word "zombie."')
        self.add_monologue('my-fault',
            "It's all gone to hell. All of it. This town is done for. It's "
            "all my fault.")

        for info in self.INFECTED_HUMANS:
            human = InfectedHuman(info['name'])
            human.move_to(*info['pos'])
            self.main_layer.add(human)
            human.set_direction(info['dir'])
            human.auto_wander = info['wander']

        # Forest
        self.add_monologue('find-flower',
                           'This forest has a special kind of flower '
                           'that could help, if I can find it.')
        self.add_monologue('campsite',
                           'A campsite? So close to town? That\'s hardly '
                           'camping, guys.')
        self.add_monologue('turned-around',
                           "I think I'm starting to get turned around "
                           "out here.")
        self.add_monologue('see-flower',
                           "Oh! I see the flower!")
        self.add_monologue('people-everywhere',
                           "Geeze, people everywhere. Must have "
                           "ran panicking into the woods.")

        # Grove
        self.lost_boy = LostBoy()
        self.lost_boy.move_to(*self.eventboxes['lostboy'].rects[0].topleft)
        self.layer_map['fg'].add(self.lost_boy)

        self.connect_eventbox_enter('lostboy-fadeout', self._on_lostboy_enter,
                                    only_once=True)

        # Swamp
        self.add_monologue('snakes-everywhere',
                           'Snakes... Why did it have to be snakes...')
        self.add_monologue('filty-boots',
                           'My boots are pretty much ruined now. First world '
                           'problems.')

        # Graveyard
        self.add_monologue('near-graveyard',
                           'This place is spooky. I need to find this web '
                           'and get out fast.')

        # Bridge
        self.add_monologue('bridge-fixed',
                           'Someone should probably fix that bridge when all '
                           'this is over.')

        # Salt Lake
        self.add_monologue('near-salt-crystal',
                           'This is the salt lake. The crystal should be '
                           'nearby.')

        # Mountain
        self.add_monologue('climbing-mountain',
                           'This is a steep climb. I hope Laura made it '
                           'safely.')
        self.add_monologue('near-cliff',
                           'Almost there.')

        self.connect_eventbox_enter('to-cliff', self._on_to_cliff)

        # Spawn the mobs
        for region in self.MOB_SPAWN_REGIONS:
            mob_count = random.randint(region['min'], region['max'])
            rect = region['rect']
            mob_classes = region['mobs']

            for i in xrange(mob_count):
                while 1:
                    x = random.randint(rect.left, rect.right)
                    y = random.randint(rect.top, rect.bottom)

                    if self._allowed_spawn_bitmap[y][x]:
                        break

                mob_cls = random.choice(mob_classes)
                mob = mob_cls()
                mob.direction = Direction.random()
                mob.update_image()
                mob.rect.bottomleft = (x * Tile.WIDTH, (y + 1) * Tile.HEIGHT)
                mob.move_to(x * Tile.WIDTH, y * Tile.HEIGHT)
                self.main_layer.add(mob)
                self._allowed_spawn_bitmap[y][x] = 0

        pygame.mixer.music.load(get_music_path('the_snow_queen.mp3'))
        pygame.mixer.music.play(-1)