-
Notifications
You must be signed in to change notification settings - Fork 0
/
Better Implicit Actions.i7x
579 lines (501 loc) · 20.3 KB
/
Better Implicit Actions.i7x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
Version 1/160118 of Better Implicit Actions by Ian Bollinger begins here.
"Provides alternate responses when some implicit actions occur."
Use authorial modesty.
Chapter 1 - Verbs
To enter is a verb.
To fail is a verb.
To insert is a verb.
To throw is a verb.
Chapter 2 - Implicit taking
Section 2.1 - Only print implicit taking response if taking succeeds
Include (-
[ ImplicitTake obj ks;
@push keep_silent;
keep_silent = true;
@push say__p;
@push say__pc;
ClearParagraphing(4);
TryAction(act_requester, actor, ##Take, obj, nothing);
DivideParagraphPoint();
@pull say__pc;
@pull say__p;
AdjustParagraphPoint();
@pull keep_silent;
if (obj in actor) {
if (actor == player) {
STANDARD_IMPLICIT_TAKING_RM('A', obj);
} else if (TestVisibility(player, actor)) {
STANDARD_IMPLICIT_TAKING_RM('B', obj, actor);
}
ClearParagraphing(3);
}
return obj in actor;
];
-) instead of "Implicit Take" in "Actions.i6t".
Section 2.2 - Standard implicit taking response
The standard implicit taking rule response (A) is
"[We] [take] [the noun]. ".
The standard implicit taking rule response (B) is
"[The second noun] [take] [the noun]. ".
Section 2.3 - Implicit taking before putting something on
The putting it on action has a truth state called implicitly taken before
putting something on.
The better the can't put what's not held rule is listed instead of the can't put
what's not held rule in the check putting it on rulebook.
Check an actor putting something on (this is the better the can't put what's not
held rule):
unless the actor is carrying the noun or the actor is wearing the noun:
silently try the actor trying taking the noun;
if the actor is carrying the noun:
now implicitly taken before putting something on is
true;
otherwise:
stop the action.
The implicit taking before putting rule is listed before the standard report
putting rule in the report putting it on rulebook.
Report an actor putting something on when implicitly taken before putting
something on is true (this is the implicit taking before putting rule):
if the action is not silent:
if the actor is the player:
say "[We] [take] [the noun] and [put] [it] on [the
second noun]." (A);
otherwise:
say "[The actor] [take] [the noun] and [put] [it] on
[the second noun]." (B);
stop the action.
Section 2.4 - Implicit taking before inserting something into
The inserting it into action has a truth state called implicitly taken before
inserting something into.
The better can't insert what's not held rule is listed instead of the can't
insert what's not held rule in the check inserting it into rulebook.
This is the better can't insert what's not held rule:
unless the actor is carrying the noun or the actor is wearing the noun:
silently try the actor taking the noun;
if the actor is carrying the noun:
now implicitly taken before inserting something into is
true;
otherwise:
stop the action.
The implicit taking before inserting rule is listed before the standard report
inserting rule in the report inserting it into rulebook.
Report an actor inserting something into (this is the implicit taking before
inserting rule):
if implicitly taken before inserting something into is true:
if the action is not silent:
if the actor is the player:
say "[We] [take] [the noun] and [insert] [it]
into [the second noun]." (A);
otherwise:
say "[The actor] [take] [the noun] and [insert]
[it] into [the second noun]." (B);
stop the action.
Section 2.5 - Implicit taking before eating
The eating action has a truth state called implicitly taken before eating.
The better can't eat portable food without carrying it rule is listed instead of
the can't eat portable food without carrying it rule in the check eating
rulebook.
Check an actor eating something portable (this is the better can't eat portable
food without carrying it rule):
unless the actor is carrying the noun:
silently try the actor taking the noun;
if the actor is carrying the noun:
now implicitly taken before eating is true;
otherwise:
stop the action.
The implicit taking before eating rule is listed before the standard report
eating rule in the report eating rulebook.
Report an actor eating when implicitly taken before eating is true (this is the
implicit taking before eating rule):
if the action is not silent:
if the actor is the player:
say "[We] [take] [the noun] and [eat] [it]."
(A);
otherwise:
say "[The actor] [take] [the noun] and [eat]
[it]." (B);
stop the action.
Chapter 3 - Implicit taking off
Section 3.1 - Implicit taking off before dropping
The dropping action has a truth state called implicitly taken off before
dropping.
The better can't drop clothes being worn rule is listed instead of the can't
drop clothes being worn rule in the check dropping rulebook.
Check an actor dropping something when the actor is wearing the noun (this is
the better can't drop clothes being worn rule):
silently try the actor trying taking off the noun;
unless the actor is wearing the noun:
now implicitly taken off before dropping is true;
otherwise:
stop the action.
The implicit taking off before dropping rule is listed before the standard
report dropping rule in the report dropping rulebook.
Report an actor dropping when implicitly taken off before dropping is true (this
is the implicit taking off before dropping rule):
if the action is not silent:
if the actor is the player:
say "[We] [take] off [the noun] and [drop] [it]." (A);
otherwise:
say "[The actor] [take] off [the noun] and [drop] [it]."
(B);
stop the action.
Section 3.2 - Implicit taking off before putting something on
The putting it on action has a truth state called implicitly taken off before
putting something on.
The better the can't put clothes being worn rule is listed instead of the can't
put clothes being worn rule in the check putting it on rulebook.
Check an actor putting something on when the actor is wearing the noun (this is
the better the can't put clothes being worn rule):
silently try the actor trying taking off the noun;
if the actor is not wearing the noun:
now implicitly taken off before putting something on is
true;
otherwise:
stop the action.
The implicit taking off before putting rule is listed before the standard report
putting rule in the report putting it on rulebook.
Report an actor putting something on when implicitly taken off before putting
something on is true (this is the implicit taking off before putting rule):
if the action is not silent:
if the actor is the player:
say "[We] [take] off [the noun] and [put] [it]
on [the second noun]." (A);
otherwise:
say "[The actor] [take] off [the noun] and [put]
[it] on [the second noun]." (B);
stop the action.
Section 3.3 - Implicit taking off before inserting
The inserting it into action has a truth state called implicitly taken off
before inserting something into.
The better the can't insert clothes being worn rule is listed instead of the
can't insert clothes being worn rule in the check inserting it into rulebook.
Check an actor inserting something into when the actor is wearing the noun (this
is the better the can't insert clothes being worn rule):
silently try the actor trying taking off the noun;
unless the actor is wearing the noun:
now implicitly taken off before inserting something into
is true;
otherwise:
stop the action.
The implicit taking off before inserting rule is listed before the standard
report inserting rule in the report inserting it into rulebook.
Report an actor inserting something into when implicitly taken off before
inserting something into is true (this is the implicit taking off before
inserting rule):
if the action is not silent:
if the actor is the player:
say "[We] [take] off [the noun] and [insert] [it] into
[the second noun]." (A);
otherwise:
say "[The actor] [take] off [the noun] and [insert] [it]
into [the second noun]." (B);
stop the action.
Section 3.4 - Implicit taking off before eating
The eating action has a truth state called implicitly taken off before eating.
The better can't eat clothing without removing it first rule is listed instead
of the can't eat clothing without removing it first rule in the check eating
rulebook.
Check an actor eating something when the actor is wearing the noun (this is the
better can't eat clothing without removing it first rule):
silently try the actor trying taking off the noun;
unless the actor is wearing the noun:
now implicitly taken off before eating is true;
otherwise:
stop the action.
The implicit taking off before eating rule is listed before the standard report
eating rule in the report eating rulebook.
Report an actor eating when implicitly taken off before eating is true (this is
the implicit taking off before eating rule):
if the action is not silent:
if the actor is the player:
say "[We] [take] off [the noun] and [eat] [it]." (A);
otherwise:
say "[The actor] [take] off [the noun] and [eat] [it]."
(B);
stop the action.
Section 3.5 - Implicit taking off before giving something to
The giving it to action has a truth state called implicitly taken off before
giving something to.
The better can't give clothes being worn rule is listed instead of the can't
give clothes being worn rule in the check giving it to rulebook.
Check an actor giving something to when the actor is wearing the noun (this is
the better can't give clothes being worn rule):
silently try the actor trying taking off the noun;
unless the actor is wearing the noun:
now implicitly taken off before giving something to is
true;
otherwise:
stop the action.
The implicit taking off before giving rule is listed before the standard report
giving rule in the report giving it to rulebook.
Report an actor giving something to when implicitly taken off before giving
something to is true (this is the implicit taking off before giving rule):
if the action is not silent:
if the actor is the player:
say "[We] [take] off [the noun] and [give] [it] to [the
second noun]." (A);
otherwise:
say "[The actor] [take] off [the noun] and [give] [it]
to [the second noun]." (B);
stop the action.
Section 3.6 - Implicit taking off before throwing something at
The throwing it at action has a truth state called implicitly taken off before
throwing something at.
The better implicitly remove thrown clothing rule is listed instead of the
implicitly remove thrown clothing rule in the check throwing it at rulebook.
Check an actor throwing something at when the actor is wearing the noun (this is
the better implicitly remove thrown clothing rule):
silently try the actor trying taking off the noun;
unless the actor is wearing the noun:
now implicitly taken off before throwing something at is
true;
otherwise:
stop the action.
The implicit taking off before throwing rule is listed before the block throwing
at rule in the check throwing it at rulebook.
[TODO: the action partially succeeds, so this should be a report.]
Check an actor throwing something at when implicitly taken off before throwing
something at is true (this is the implicit taking off before throwing rule):
if the action is not silent:
if the actor is the player:
say "[We] [take] off [the noun] but [fail] to [throw]
[it] at [the second noun]." (A);
otherwise:
say "[The actor] [take] off [the noun] but [fail] to
[throw] [it] at [the second noun]." (B);
stop the action.
Chapter 4 - Implicit actions before going
Section 4.1 - Implicit getting off before going
The going action has an object called enterable implicitly gotten off.
The better stand up before going rule is listed instead of the stand up before
going rule in the check going rulebook.
Check an actor going when the actor is on a supporter (called the chaise) (this
is the better stand up before going rule):
silently try the actor exiting;
unless the actor is on the chaise:
now enterable implicitly gotten off is the chaise;
otherwise:
stop the action.
The implicit getting off before going rule is listed before the describe room
gone into rule in the report going rulebook.
[TODO: what if the actor gets off a supporter and opens a door implicitly?]
Report an actor going when the enterable implicitly gotten off is something
(this is the implicit getting off before going rule):
if the action is not silent:
if the actor is the player:
say "[We] [get] off [the enterable implicitly gotten
off].[command clarification break]" (A);
otherwise:
say "[The actor] [get] off [the enterable implicitly
gotten off] and [run paragraph on]" (B);
Section 4.2 - Implicit opening before going
The going action has a truth state called implicitly opening before going.
The better can't go through closed doors rule is listed instead of the can't go
through closed doors rule in the check going rulebook.
Check an actor going when the door gone through is something (this is the better
can't go through closed doors rule):
if the door gone through is closed:
silently try the actor opening the door gone through;
if the door gone through is open:
now implicitly opening before going is true;
otherwise:
stop the action.
The implicit opening before going rule is listed before the describe room gone
into rule in the report going rulebook.
Report an actor going when implicitly opening before going is true (this is the
implicit opening before going rule):
if the action is not silent:
if the actor is the player:
say "[We] [open] the [door gone through].[command
clarification break]" (A);
otherwise:
say "[The actor] [open] the [door gone through] and [run
paragraph on]" (B);
Section 4.3 - Reporting actors' movement
The implicit action before going rule is listed before the describe room gone
into rule in the report going rulebook.
Report an actor going (this is the implicit action before going rule):
if the actor is the player or (the enterable implicitly gotten off is
nothing and implicitly opening before going is false):
continue the action;
if the noun is a direction:
if the location is the room gone from or the player is within
the vehicle gone by or the player is within the thing gone with:
if the room gone from is the room gone to:
continue the action;
otherwise:
if the noun is up:
say "[go] up" (A);
otherwise if the noun is down:
say "[go] down" (B);
otherwise:
say "[go] [noun]" (C);
otherwise:
let the back way be the opposite of the noun;
if the location is the room gone to:
let the room back the other way be the room back
way from the location;
let the room normally this way be the room noun
from the room gone from;
if the room back the other way is the room gone
from or the room back the other way is the room
normally this way:
if the back way is up:
say "[arrive] from above" (D);
otherwise if the back way is down:
say "[arrive] from below" (E);
otherwise:
say "[arrive] from [the back
way]" (F);
otherwise:
say "[arrive]" (G);
otherwise:
if the back way is up:
say "[arrive] at [the room gone to] from
above" (H);
otherwise if the back way is down:
say "[arrive] at [the room gone to] from
below" (I);
otherwise:
say "[arrive] at [the room gone to] from
[the back way]" (J);
otherwise if the location is the room gone from:
say "[go] through [the noun]" (K);
otherwise:
say "[arrive] from [the noun]" (L);
if the vehicle gone by is not nothing:
if the vehicle gone by is a supporter:
say " on [the vehicle gone by]" (M);
otherwise:
say " in [the vehicle gone by]" (N);
if the thing gone with is not nothing:
if the player is within the thing gone with:
say ", pushing [the thing gone with] in front, and [us]
along too" (O);
otherwise if the player is within the vehicle gone by:
say ", pushing [the thing gone with] in front" (P);
otherwise if the location is the room gone from:
say ", pushing [the thing gone with] away" (Q);
otherwise:
say ", pushing [the thing gone with] in" (R);
if the player is within the vehicle gone by and the player is
not within the thing gone with:
say ", taking [us] along." (S);
try looking;
continue the action;
say "." (T);
stop the action.
Chapter 5 - Implicit passing through barriers
The entering action has a truth state called implicitly passing through barriers
before entering.
The entering action has a list of objects called implicitly gotten off.
The entering action has a list of objects called implicitly gotten on.
The better implicitly pass through other barriers rule is listed instead of the
implicitly pass through other barriers rule in the check entering rulebook.
This is the better implicitly pass through other barriers rule:
if the holder of the actor is the holder of the noun:
continue the action;
now implicitly passing through barriers before entering is true;
let the local ceiling be the common ancestor of the actor with the noun;
while the holder of the actor is not the local ceiling:
let the current home be the holder of the actor;
silently try the actor trying exiting;
if the holder of the actor is the current home:
stop the action;
add the current home to implicitly gotten off;
if the holder of the actor is the noun:
stop the action;
if the holder of the actor is not the holder of the noun:
let the target be the holder of the noun;
if the noun is part of the target:
let the target be the holder of the target;
while the target is a thing:
if the holder of the target is the local ceiling:
silently try the actor trying entering the
target;
if the holder of the actor is not the target:
stop the action;
add the target to implicitly gotten on;
break;
let the target be the holder of the target;
The implicit passing through barriers before entering rule is listed before the
standard report entering rule in the report entering rulebook.
Report an actor entering when implicitly passing through barriers before
entering is true (this is the implicit passing through barriers before entering
rule):
unless the action is not silent:
stop the action;
let first item be true;
let at least two items be false;
repeat with the current home running through implicitly gotten off:
if the current home is a supporter or the current home is an
animal:
if first item is true:
if the actor is the player:
say "[We] [get] off [the current
home]" (A);
otherwise:
say "[The actor] [get] off [the current
home]" (B);
now first item is false;
otherwise:
say ", off [the current home]" (C);
now at least two items is true;
otherwise:
if first item is true:
if the actor is the player:
say "[We] [get] out of [the current
home]" (D);
otherwise:
say "[The actor] [get] out of [the
current home]" (E);
now first item is false;
otherwise:
say ", out of [the current home]" (F);
now at least two items is true;
repeat with the target running through implicitly gotten on:
if the target is a supporter:
if first item is true:
if the actor is the player:
say "[We] [get] onto [the target]" (G);
otherwise:
say "[The actor] [get] onto [the
target]" (H);
now first item is false;
otherwise:
say ", onto [the target]" (I);
now at least two items is true;
otherwise if the target is a container:
if first item is true:
if the actor is the player:
say "[We] [get] into [the target]" (J);
otherwise:
say "[The actor] [get] into [the
target]" (K);
now first item is false;
otherwise:
say ", into [the target]" (L);
now at least two items is true;
otherwise:
if first item is true:
if the actor is the player:
say "[We] [enter] [the target]" (M);
otherwise:
say "[The actor] [enter] [the target]"
(N);
now first item is false;
otherwise:
say ", [the target]" (O);
now at least two items is true;
say "[if serial comma option is active and at least two items is
true],[end if] and " (P);
if the noun is a container:
say "into [the noun]." (Q);
otherwise:
say "onto [the noun]." (R);
stop the action.
Better Implicit Actions ends here.
---- DOCUMENTATION ----
This extension provides alternate responses when some implicit actions occur.
Implicit action responses will now only be printed if the implicit action
succeeds. Additionally, this extension attempts to combine implicit actions with
their corresponding action into complete, single sentences.