Example #1
0
from __future__ import absolute_import, print_function, division, unicode_literals
import os
import sys
import tale
from tale.io.vfs import vfs

if __name__=="__main__":
    # story is invoked as a script, start it in the Tale Driver.
    from tale.driver import Driver
    driver = Driver()
    with vfs.open_read("demo/__init__.py") as x:
        gamedir = os.path.dirname(x.name)
    args = ["-g", gamedir]
    if len(sys.argv) > 1 and sys.argv[1]=="--gui":
        args.append("--gui")
    driver.start(args)
    raise SystemExit(0)


class Story(object):
    config = dict(
        name = "Tale demo story",
        author = "Irmen de Jong",
        author_address = "*****@*****.**",
        version = tale.__version__,      # arbitrary but is used to check savegames for compatibility
        requires_tale = tale.__version__,  # tale library required to run the game
        supported_modes = {"if", "mud"}, # what driver modes (if/mud) are supported by this story
        player_name = "julie",           # set a name to create a prebuilt player, None to use the character builder
        player_gender = "f",             # m/f/n
        player_race = "human",           # default is "human" ofcourse, but you can select something else if you want
        money_type = "modern",           # money type modern/fantasy
Example #2
0
"""
Demo story.

'Tale' mud driver, mudlib and interactive fiction framework
Copyright by Irmen de Jong ([email protected])
"""
from __future__ import absolute_import, print_function, division, unicode_literals
import datetime
from tale.hints import Hint

if __name__=="__main__":
    # story is invoked as a script, start it in the Tale Driver.
    import sys
    from tale.driver import Driver
    driver = Driver()
    driver.start(["-g", sys.path[0]])
    raise SystemExit(0)


class Story(object):
    config = dict(
        name = "Tale Demo",
        author = "Irmen de Jong",
        author_address = "*****@*****.**",
        version = "1.0",                 # arbitrary but is used to check savegames for compatibility
        requires_tale = "1.4",           # tale library required to run the game
        supported_modes = {"if", "mud"}, # what driver modes (if/mud) are supported by this story
        player_name = None,              # set a name to create a prebuilt player, None to use the character builder
        player_gender = None,            # m/f/n
        player_race = None,              # default is "human" ofcourse, but you can select something else if you want
        money_type = "modern",           # money type modern/fantasy/None