~divmod-dev/divmod.org/no-addperson-2190

« back to all changes in this revision

Viewing changes to Imaginary/TRDemo/trmap.py

  • Committer: exarkun
  • Date: 2006-02-26 02:37:39 UTC
  • Revision ID: svn-v4:866e43f7-fbfc-0310-8f2a-ec88d1da2979:trunk:4991
Merge move-pottery-to-trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
from twisted.python import components
 
3
 
 
4
from imagination.text import english
 
5
from imagination.templates import basic
 
6
from imagination import simulacrum, containment
 
7
 
 
8
from templates import RoomTemplate, TrinketTemplate
 
9
import actions
 
10
 
 
11
demoMetaRoom = RoomTemplate.fill(
 
12
    english.INoun,
 
13
    name='Demo',
 
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 '
 
21
                 'more details.')
 
22
    ).fill(containment.ILocatable, location=None).new()
 
23
 
 
24
 
 
25
DemoRoomTemplate = RoomTemplate.fill(containment.ILocatable, location=demoMetaRoom)
 
26
 
 
27
startRoom = DemoRoomTemplate.fill(
 
28
    english.INoun,
 
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!"')
 
38
    ).new()
 
39
 
 
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)
 
46
 
 
47
demoRoom = DemoRoomTemplate.fill(
 
48
    english.INoun,
 
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 '
 
55
                 'black floor.')
 
56
    ).new()
 
57
 
 
58
DemoTrinketTemplate = TrinketTemplate.fill(
 
59
    containment.ILocatable,
 
60
    location=demoRoom)
 
61
 
 
62
DemoTrinketTemplate.fill(
 
63
    english.INoun,
 
64
    name='bauble',
 
65
    description='omg I can not write this'
 
66
    ).new()
 
67
 
 
68
DemoTrinketTemplate.fill(
 
69
    english.INoun,
 
70
    name='billboard',
 
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:'
 
75
                 '\n\n'
 
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: '
 
79
                 '\n\n'
 
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.'
 
85
                 '\n\n'
 
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 '
 
89
                 '\'down\'.'
 
90
                 '\n\n'
 
91
                 'SMILE: it\'s polite.  You can just SMILE or SMILE AT someone.'
 
92
                 '\n\n'
 
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".'
 
103
                 '\n\n'
 
104
                 'Thanks for playing, and we hope you enjoy the demo!'),
 
105
    ).new()
 
106
RoachTemplate = DemoTrinketTemplate[
 
107
    actions.IWindTarget: actions.Roach]
 
108
 
 
109
RoachTemplate.fill(
 
110
    english.INoun,
 
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.')
 
116
    ).new()
 
117
 
 
118
DemoTrinketTemplate[
 
119
    actions.IWindTool: actions.Winder
 
120
].fill(
 
121
    english.INoun,
 
122
    name="small brass key"
 
123
).new()
 
124
 
 
125
DemoTrinketTemplate[
 
126
    (actions.IPushTarget, actions.IDrinkTarget): actions.Fountain
 
127
].fill(
 
128
    english.INoun,
 
129
    name="fountain"
 
130
).new()
 
131
    
 
132
DemoTrinketTemplate[
 
133
    actions.IPushTarget: actions.GenderChanger
 
134
].fill(
 
135
    english.INoun,
 
136
    name="gender changer"
 
137
).new()
 
138
 
 
139
DemoTrinketTemplate[
 
140
    (actions.IPushTarget, actions.ITypeTarget): actions.Register
 
141
].fill(
 
142
    english.INoun,
 
143
    name="register",
 
144
).new()