Пример #1
0

carpark = CarPark("Car Parking", "There are a few cars still parked over here. Their owners are nowhere to be seen. "
                                 "One yellow convertible grabs your attention.")
carpark.add_extradesc({"cars"}, "They look abandoned. The doors are all locked, except the doors of the yellow convertible.")
carpark.add_extradesc({"convertible", "yellow"}, "It is a small two-seater and the doors are open. You can't believe your eyes, "
                                                 "but the key is actually still in the ignition!")

# not enough to buy the medicine, player needs to find more, or haggle:
carpark.init_inventory([Money("wallet", 16.0, title="someone's wallet",
    short_descr="Someone's wallet lies on the pavement, they seem to have lost it. There's some money in it.")])


parking_gate, _ = Door.connect(north_street, ["gate", "parking"],
    "Through the iron gate you can see the car parking. A few cars are still parked there, it seems.", None,
    carpark, ["gate", "street"],
    "Rose street is back through the gate.", None,
    locked=True, opened=False, key_code="carpark-gate")

parking_key = Key("key", "rusty key", descr="It is what appears to be an old key, with a label on it.",
                  short_descr="On the ground is a key, it's become quite rusty.")
parking_key.key_for(parking_gate)
parking_key.add_extradesc({"label"}, "The label says: `parking area gate'.")


class StorageRoom(Location):
    @call_periodically(5.0, 20.0)
    def shiver_from_cold(self, ctx: Context) -> None:
        # it's cold in the storage room, it makes people shiver
        if self.livings:
            living = random.choice(list(self.livings))
Пример #2
0

carpark = CarPark("Car Parking", "There are a few cars still parked over here. Their owners are nowhere to be seen. "
                                 "One yellow convertible grabs your attention.")
carpark.add_extradesc({"cars"}, "They look abandoned. The doors are all locked, except the doors of the yellow convertible.")
carpark.add_extradesc({"convertible", "yellow"}, "It is a small two-seater and the doors are open. You can't believe your eyes, "
                                                 "but the key is actually still in the ignition!")

# not enough to buy the medicine, player needs to find more, or haggle:
carpark.init_inventory([Money("wallet", 16.0, title="someone's wallet",
                              short_descr="Someone's wallet lies on the pavement, "
                                          "they seem to have lost it. There's some money in it.")])


parking_gate, _ = Door.connect(north_street, ["gate", "parking"],
                               "Through the iron gate you can see the car parking. A few cars are still parked there, it seems.",
                               None, carpark, ["gate", "street"], "Rose street is back through the gate.", None,
                               locked=True, opened=False, key_code="carpark-gate")

parking_key = Key("key", "rusty key", descr="It is what appears to be an old key, with a label on it.",
                  short_descr="On the ground is a key, it's become quite rusty.")
parking_key.key_for(parking_gate)
parking_key.add_extradesc({"label"}, "The label says: `parking area gate'.")


class StorageRoom(Location):
    @call_periodically(5.0, 20.0)
    def shiver_from_cold(self, ctx: Context) -> None:
        # it's cold in the storage room, it makes people shiver
        if self.livings:
            living = random.choice(list(self.livings))
            living.do_socialize("shiver")
Пример #3
0
import random
from tale.base import Location, Exit, Door, Item, Living
from tale.util import call_periodically, Context
from zones.npcs import Zombie, Trader
from zones import house

street1 = Location(
    "Lake Drive", "Your house is on Lake Drive, it overlooks the lake. "
    "The rest of the town lies eastwards.")
lot = Location("Parking Lot",
               "A small parking lot with a few cars parked in it.")

Door.connect(
    house.livingroom, ["door", "outside", "street"],
    "Your front door leads outside, to the street.\n",
    "There's a heavy front door here that leads to the streets outside.",
    street1, ["house", "door", "inside"], "You can go back inside your house.",
    "It's your house, on the north side of the street.")

deli = Location(
    "Deli",
    "A deli. It is completely empty, all the food and items seem to be gone.")

Exit.connect(deli, ["lake drive", "outside", "street", "back"],
             "Lake drive is the street you came from.", None, street1,
             ["deli", "east"], "The east end of the street leads to a deli.",
             None)
Exit.connect(lot, ["back"], "Go back home.", None, street1, ["lot", "parking"],
             "There is a parking lot next to the deli.", None)

zombie = w = Zombie("zombie",
Пример #4
0
import random
from tale.base import Location, Exit, Door, Item
from tale.util import call_periodically, Context
from zones import houses, rose_st
from zones.npcs import Apothecary, Wanderer


street1 = Location("Magnolia Street", "Your house is on Magnolia Street, one of the larger streets in town. "
                                      "The rest of the town lies eastwards.")
street2 = Location("Magnolia Street", "Another part of the street.")
street3 = Location("Magnolia Street (east)", "The eastern part of Magnolia Street.")


Door.connect(houses.livingroom,
             ["door", "outside", "street"], "Your front door leads outside, to the street.",
             "There's a heavy front door here that leads to the streets outside.",
             street1,
             ["house", "north", "inside"], "You can go back inside your house.",
             "It's your house, on the north side of the street.")


pharmacy = Location("Pharmacy", "A pharmacy. It is completely empty, all medicine seems gone.")

Exit.connect(pharmacy, ["east", "outside", "street"], "Magnolia street is outside towards the east.", None,
             street1, ["pharmacy", "west"], "The west end of the street leads to the pharmacy.", None)


class Factory(Location):
    @call_periodically(30, 60)
    def spawn_wanderer(self, ctx: Context) -> None:
        w = Wanderer("blankly staring person", random.choice("mf"), descr="A person staring blankly somewhere.")
        w.aliases = {"person", "staring person"}
Пример #5
0
from tale.util import call_periodically, Context
from zones import houses, rose_st
from zones.npcs import Apothecary, Wanderer

street1 = Location(
    "Magnolia Street",
    "Your house is on Magnolia Street, one of the larger streets in town. "
    "The rest of the town lies eastwards.")
street2 = Location("Magnolia Street", "Another part of the street.")
street3 = Location("Magnolia Street (east)",
                   "The eastern part of Magnolia Street.")

Door.connect(
    houses.livingroom, ["door", "outside", "street"],
    "Your front door leads outside, to the street.",
    "There's a heavy front door here that leads to the streets outside.",
    street1, ["house", "north", "inside"],
    "You can go back inside your house.",
    "It's your house, on the north side of the street.")

pharmacy = Location(
    "Pharmacy", "A pharmacy. It is completely empty, all medicine seems gone.")

Exit.connect(pharmacy, ["east", "outside", "street"],
             "Magnolia street is outside towards the east.", None, street1,
             ["pharmacy", "west"],
             "The west end of the street leads to the pharmacy.", None)


class Factory(Location):
    @call_periodically(30, 60)