コード例 #1
0
 def talk_with_poet(self, Poet, surface):
     engine.displayMessage(
         (Poet.lines['l1a'], Poet.lines['l1b'], Poet.lines['l1c'],
          Poet.lines['l1d'], Poet.lines['l1e']), surface)
     engine.wait()
     engine.displayMessage((Poet.lines['l2a'], ), surface)
     engine.wait()
コード例 #2
0
    def talk_with_bob(self, Bob, surface):
        status = progress.getProgress('bi_bob')
        name = progress.getProgress('name')
        if status == 0:
            answer = engine.getInput((Bob.lines['l1a'], ), Bob.lines['l1q'],
                                     surface, 2)
            progress.setProgress('bi_library', 2)
            if answer == 'yes':
                answer = engine.getInput((Bob.lines['l2yes'], ),
                                         Bob.lines['l2q'], surface, 2)
                progress.setProgress('name', answer)
                engine.displayMessage(
                    ((Bob.lines['l3a'] +
                      cryptofunctions.encrypt(answer, 'bob')),
                     Bob.lines['l3b']), surface)
                engine.wait()
                engine.getInput((Bob.lines['l4a'], ), Bob.lines['l4q'],
                                surface, 2)
                engine.displayMessage((Bob.lines['l5'], ), surface)
                progress.setProgress('bi_bob', 1)
            else:
                engine.displayMessage((Bob.lines['l2no'], ), surface)
        elif status == 1:
            engine.displayMessage((Bob.lines['l6'], ), surface)

        engine.wait()
コード例 #3
0
	def talk_with_save(self, Save, surface):
		name = progress.get_progress('name')
		answer = engine.get_input((Save.lines['l1a'], (Save.lines['l1b'] + name)), Save.lines['l1q'], surface, 1)
		if answer == 'yes':
			engine.display_message((Save.lines['l2'],), surface)
			engine.wait()
		elif answer == 'change name':
			answer = engine.get_input((Save.lines['l3'],), ' ', surface, 2)
			progress.set_progress('name', answer)
コード例 #4
0
ファイル: default_room.py プロジェクト: dhevi/CryptoGame
 def talk_with_sign1(self, Sign, surface):
     answer = engine.getInput((Sign.lines['l1a'], Sign.lines['l1b']),
                              Sign.lines['q1'], surface)
     engine.displayMessage((
         Sign.lines['l2a'],
         Sign.lines['l2b'],
         answer,
     ), surface)
     engine.wait()
コード例 #5
0
ファイル: library.py プロジェクト: dhevi/CryptoGame
 def talk_with_bookbi(self, Book_bi, surface):
     engine.displayMessage(
         (Book_bi.lines['l1a'], Book_bi.lines['l1b'], Book_bi.lines['l0'],
          Book_bi.lines['l1d'], Book_bi.lines['l1e'], Book_bi.lines['l1f'],
          Book_bi.lines['l1g']), surface)
     engine.wait()
     engine.displayMessage((Book_bi.lines['l2a'], Book_bi.lines['l0'],
                            Book_bi.lines['l2b'], Book_bi.lines['l2c']),
                           surface)
     engine.wait()
コード例 #6
0
ファイル: library.py プロジェクト: dhevi/CryptoGame
 def talk_with_bookbob(self, Book_bob, surface):
     engine.displayMessage((Book_bob.lines['l1a'], Book_bob.lines['l0'],
                            Book_bob.lines['l1b'], Book_bob.lines['l1c']),
                           surface)
     engine.wait()
     engine.displayMessage((Book_bob.lines['l2'], ), surface)
     engine.wait()
     engine.displayMessage((Book_bob.lines['l3a'], Book_bob.lines['l0'],
                            Book_bob.lines['l3b']), surface)
     engine.wait()
     engine.displayMessage((Book_bob.lines['l4a'], Book_bob.lines['l4b'],
                            Book_bob.lines['l4c'], Book_bob.lines['l4d']),
                           surface)
     engine.wait()
コード例 #7
0
    def talk_with_bartender(self, Bartender, Player, surface):
        for item in self.items:
            if item.ID == 'PICKLEJUICE':
                Picklejuice = item
            if item.ID == 'BEER':
                Beer = item

        for item in Player.inventory:
            if item.ID == 'PICKLE':
                Pickle = item

        answer = engine.getInput(
            (Bartender.lines['l1a'], Bartender.lines['l1b'],
             Bartender.lines['l0']), Bartender.lines['q1'], surface, 2)
        while not answer in ('bebiebir', 'pibicklebi jubiibicebi',
                             'webit mabirtibinibi', 'picklej'):
            answer = engine.getInput(
                (Bartender.lines['l2c'], Bartender.lines['l1a'],
                 Bartender.lines['l1b']), Bartender.lines['q1'], surface, 2)

        if answer == 'webit mabirtibinibi':
            engine.displayMessage(
                (Bartender.lines['l2a'] + answer + Bartender.lines['l2b'], ),
                surface)
        elif answer == 'bebiebir':
            engine.displayMessage(
                (Bartender.lines['l2a'] + answer + Bartender.lines['l2b'], ),
                surface)
            engine.wait()
            engine.displayMessage((Bartender.lines['l5a'], ), surface)
            Player.inventory.add(Beer)
        elif answer == 'pibicklebi jubiibicebi' or answer == 'picklej':
            status = progress.getProgress('bi_pickle')
            if status == 0 or status == 1:
                engine.displayMessage((Bartender.lines['l3a'], ), surface)
                progress.setProgress('bi_pickle', 1)
            elif status == 2:
                engine.displayMessage((Bartender.lines['l4a'], ), surface)
                engine.wait()
                engine.displayMessage((Bartender.lines['l4b'], ), surface)
                Player.inventory.remove(Pickle)
                Player.inventory.add(Picklejuice)
                progress.setProgress('bi_pickle', 0)
        elif answer == 'esc':
            pass

        engine.wait()
コード例 #8
0
	def talk_with_load(self, Load, surface):
		answer = engine.get_input((Load.lines['l1a'], Load.lines['l1b']), ' ', surface, 1)
		if answer == 'yes':
			answer = engine.get_input((Load.lines['l2'],), ' ', surface, 1)
			engine.wait()
コード例 #9
0
ファイル: bitown.py プロジェクト: dhevi/CryptoGame
    def mainloop(self, surface, event):

        for sprite in self.sprites:  # pull sprites from sprite group to make it easier
            if sprite.ID == 'PLAYER':
                Player = sprite
            elif sprite.ID == 'DOOR':
                Door = sprite
            elif sprite.ID == 'DOOR_BAR':
                Door_bar = sprite
            elif sprite.ID == 'DOOR_BOB':
                Door_bob = sprite
            elif sprite.ID == 'DOOR_PPSHED':
                Door_pickleshed = sprite
            elif sprite.ID == 'DOOR_LIB':
                Door_library = sprite
            elif sprite.ID == 'PICKLEPLANT':
                Pickle_plant = sprite

        for item in self.items:
            if item.ID == 'PICKLE':
                Pickle = item

        surface.blit(self.image, (1, 1))
        self.sprites.draw(surface)

        new_room = 'bitown'
        from_room = 'bitown'

        if event.type == KEYDOWN:
            if event.key == K_RETURN:
                if engine.checkBordering(Player, Door):
                    tmp = self.exit('house1')
                    from_room = tmp[0]
                    new_room = tmp[1]

                elif engine.checkBordering(Player, Door_bar):
                    tmp = self.exit('bar')
                    from_room = tmp[0]
                    new_room = tmp[1]

                elif engine.checkBordering(Player, Door_bob):
                    tmp = self.exit('house_bob')
                    from_room = tmp[0]
                    new_room = tmp[1]

                elif engine.checkBordering(Player, Door_pickleshed):
                    tmp = self.exit('pickleshed')
                    from_room = tmp[0]
                    new_room = tmp[1]

                elif engine.checkBordering(Player, Door_library):
                    tmp = self.exit('library')
                    from_room = tmp[0]
                    new_room = tmp[1]

                elif engine.checkBordering(Player, Pickle_plant):
                    status = progress.getProgress('bi_pickle')
                    #if not Pickle in Player.inventory:
                    if status == 0:
                        ans = ''

                        while not ans in ('yes', 'no'):
                            ans = engine.getInput(
                                (Pickle_plant.lines['unpicked'], ),
                                Pickle_plant.lines['q1'], surface)

                        if ans == 'yes':
                            progress.setProgress('bi_pickle', 2)
                            Player.add_to_inventory((Pickle, ))
                            Pickle_plant.picked = True
                            Pickle_plant.changePicture(2)

                            engine.displayMessage(
                                (Pickle_plant.lines['unpicked2'], ), surface)
                            engine.wait()

                    else:
                        engine.displayMessage((Pickle_plant.lines['picked'], ),
                                              surface)
                        engine.wait()

            elif event.key in (K_d, K_s, K_a, K_w):
                Player.move(event.key, self.collide_group)

        return (from_room, new_room)