2
from twisted.python import components
4
from imagination.text import english
5
from imagination.templates import basic
6
from imagination import simulacrum, containment
8
from templates import RoomTemplate, TrinketTemplate
11
demoMetaRoom = RoomTemplate.fill(
14
description=('This is the Twisted Reality Demo Center. '
15
'Thanks for playing! This meta-room is accessible '
16
"only to authors, and will give you a bird's eye "
17
"view of what's going on in the game. You can "
18
'look at any room, and even interact with objects '
19
'in those rooms, although that may produce bizarre '
20
'effects. See the development documentation for '
22
).fill(containment.ILocatable, location=None).new()
25
DemoRoomTemplate = RoomTemplate.fill(containment.ILocatable, location=demoMetaRoom)
27
startRoom = DemoRoomTemplate.fill(
29
name='Twisted Reality Corporate Demo Center',
30
description=('A spacious, open room with a high, arched ceiling. '
31
'The walls are an almost gleaming, immaculate white, '
32
'contrasting sharply with the polished black marble '
33
'floor. The room becomes wider as it continues on to '
34
'the north, and is dotted with bright green potted '
35
'plants at regular intervals. The southern wall is '
36
'covered by a ten-foot-tall billboard labelled with '
37
'the legend: "\'look at board\' for help!"')
40
ActorTemplate = basic.Actor[
41
actions.IWindActor: actions.Winder,
42
actions.IDrinkActor: actions.Drinker,
43
actions.IPushActor: actions.Pusher,
44
actions.ITypeActor: actions.Typer,
45
].fill(containment.ILocatable, location=startRoom)
47
demoRoom = DemoRoomTemplate.fill(
49
name='Demo Center Waiting Room',
50
description=('This is a comfortable waiting room with high-backed '
51
'leather chairs and wooden-paneled walls. There is a '
52
'solid oak coffee table here, with a tasteful gold '
53
'inlay. To the northeast, there is a gold-lined '
54
'archway leading into a room with white walls and a '
58
DemoTrinketTemplate = TrinketTemplate.fill(
59
containment.ILocatable,
62
DemoTrinketTemplate.fill(
65
description='omg I can not write this'
68
DemoTrinketTemplate.fill(
71
description=('This is a ten-foot-tall gleaming white billboard, with '
72
'clear, black, sans-serif writing that begins in huge '
73
'three-foot-tall letters and proceeds down to a small '
74
'ten-point font. It reads:'
76
'"Welcome to the Twisted Reality Demo Center! A few basic '
77
'commands that will guide you through this magical land of '
78
'corporation fun are: '
80
'LOOK: this lets you look at stuff. Try it on objects '
81
'both in the room\'s description and in the object-list '
82
'in the upper right hand corner.'
83
'\nSAY: This command is macro-bound to your \' key. You '
84
'can use this to interact with other players.'
86
'GO: This lets you move. You can also use the numeric '
87
'keypad (with NUM-LOCK on) to move in the cardinal and '
88
'secondary compass directions - also, 0 is \'up\' and 5 is '
91
'SMILE: it\'s polite. You can just SMILE or SMILE AT someone.'
93
'These are not all of the verbs you can use, by any stretch of '
94
'the imagination. Some situations may also call for OPEN, CLOSE, '
95
'TURN or SIT. If the game says something snide to you, it\'s '
96
'likely that the verb you\'re looking for doesn\'t work in that '
97
'context. Another good rule to keep in mind is that the parser will '
98
'understand you in the form: "verb [direct-object] [preposition '
99
'indirect-object] so sentences like "slowly use the tongs to give '
100
'bob the fish", "north, please" or "I\'d sure like to go north right '
101
'now, wouldn\'t you?" are not going to work quite right. Try instead '
102
'"give fish to bob with tongs" or "go north".'
104
'Thanks for playing, and we hope you enjoy the demo!'),
106
RoachTemplate = DemoTrinketTemplate[
107
actions.IWindTarget: actions.Roach]
111
name="brass cockroach",
112
description=('A small mechanical cockroach, intricately designed with '
113
'all of the parts and details of a real insect, made '
114
'entirely of polished brass. There is a small hexagonal '
115
'keyhole between two of the plates of its thorax.')
119
actions.IWindTool: actions.Winder
122
name="small brass key"
126
(actions.IPushTarget, actions.IDrinkTarget): actions.Fountain
133
actions.IPushTarget: actions.GenderChanger
136
name="gender changer"
140
(actions.IPushTarget, actions.ITypeTarget): actions.Register