コード例 #1
0
ファイル: conditions.py プロジェクト: pepperoni666/TextAdv
	def conditInput(self, player, input):
		if input == "ok   +1 item":
			if self.item == "key":
				player.loot.append(items.Key(self.args[0]))
			pos[self.room] += 1
			return 2
		if input == "back":
			return 1
コード例 #2
0
 def __init__(self):
     super(Alice, self).__init__()
     self.name = "Alice"
     self.intro = "'Hey, could you deliver this super-secret message to Bob for me?'"
     self.dialog = "'I'd give it to Bob myself, but I don't want Eve to know we're communicating.'"
     self.acceptDialog = "'So you managed to deliver the message without Eve noticing?  Thanks!'"
     self.giveDialog = "'You seem like a trustworthy person.  Here, have my public key.'"
     self.wantedItem = "Reply"
     self.returnedItem = items.Key()
コード例 #3
0
 def __init__(self, y, x):
     super().__init__(y, x)
     self.item = items.Key()
コード例 #4
0
 def __init__(self, x, y):
     super().__init__(x, y, [items.Key()])
     self.inventory[0].value = 300
コード例 #5
0
 def __init__(self, name):
     self.name = name
     self.loot = [items.Key("a")]
     pass
コード例 #6
0
 def __init__(self, x, y):
     super().__init__(x, y, items.Key())
コード例 #7
0
ファイル: world.py プロジェクト: Sailt/xkcd-codejam
    def createRooms(self):
        meganHouse = self.Room()
        self.stallmanHouse = self.Room()
        self.cueballHouse = self.Room()
        street0_0 = self.Room()
        street0_1 = self.Room()
        street0_2 = self.Room()
        street1_0 = self.Room()
        street1_2 = self.Room()
        street2_0 = self.Room()
        street2_1 = self.Room()
        street2_2 = self.Room()
        street2_3 = self.Room()
        street3_0 = self.Room()
        street3_1 = self.Room()
        street3_2 = self.Room()
        street3_3 = self.Room()
        street4_1 = self.Room()
        street4_2 = self.Room()

        meganHouse.name = "Megan's house"
        meganHouse.desc = "The entire house is filled waist deep in playpen balls.  Megan stands in a corner, throwing balls across the room.  She seems to be sorting them by colour."
        meganHouse.exits.append({"room": street0_0, "localName": "out"})

        self.stallmanHouse.name = "Richard Stallman's house"
        self.stallmanHouse.desc = ""
        self.stallmanHouse.exits.append({
            "room": street0_1,
            "localName": "out"
        })
        self.stallmanHouse.isLocked = True

        self.cueballHouse.name = "Cueball's house"
        self.cueballHouse.desc = "You have finally made it inside.  Congratulations!"
        self.cueballHouse.exits.append({"room": street0_2, "localName": "out"})
        self.cueballHouse.isLocked = True

        street0_0.name = "In front of Megan's house"
        street0_0.desc = "You stand on the street in front of Megan's house."
        street0_0.exits.append({"room": meganHouse, "localName": "house"})
        street0_0.exits.append({"room": street0_1, "localName": "east"})
        street0_0.exits.append({"room": street1_0, "localName": "south"})

        street0_1.name = "In front of Stallman's house"
        street0_1.desc = "You stand on the street in front of Richard Stallman's house."
        street0_1.exits.append({
            "room": self.stallmanHouse,
            "localName": "house"
        })
        street0_1.exits.append({"room": street0_2, "localName": "east"})
        street0_1.exits.append({"room": street0_0, "localName": "west"})
        street0_1.items.append(items.Key())

        street0_2.name = "In front of Cueball's house"
        street0_2.desc = "You stand on the street in front of your house."
        street0_2.exits.append({
            "room": self.cueballHouse,
            "localName": "house"
        })
        street0_2.exits.append({"room": street0_1, "localName": "west"})
        street0_2.exits.append({"room": street1_2, "localName": "south"})

        self.curRoom = street0_2
コード例 #8
0
ファイル: app.py プロジェクト: JHay0112/Draculas-Castle
                    room.add_entrance(entrance_name, self._map.boss_room())
                    # Set flag true to exit loop
                    entrance_added = True
                    break  # Break for loop


# - Main

root = tk.Tk()  # Tkinter root object

# -- Items

# --- Keys

# Key to Dracula's crypt
draculas_key = items.Key("THE KEY TO THE CRYPT")

# --- Weapons

weapons = [
    items.Weapon("Pointy Stick", 2, 5),
    items.Weapon("Crowbar", 3, 8),
    items.Weapon("Molten Cheese", 5, 9),
    items.Weapon("Boomerang", 10, 15),
    items.Weapon("Laser Jet Printer", 12, 18),
    items.Weapon("Red Syringe", 10, 25)
]

# --- Armour

armour = [