/
Pending Actions.i7xp
46 lines (32 loc) · 1.06 KB
/
Pending Actions.i7xp
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
Version 1.0.0 of Pending Events by Stephen Norris begins here.
"Add a phrase to test for upcoming timed events."
Include (-
[ PendingTimedEvent rule i b;
for (i=1: i<=(TimedEventsTable-->0): i++) {
if (rule == TimedEventsTable-->i) { b=i; rtrue; }
}
rfalse;
];
-).
To decide if (R - a rule) is pending:(- (PendingTimedEvent({R})) -).
Pending Events ends here.
---- DOCUMENTATION ----
This adds one phrase, "rule is pending" to test for upcoming timed events.
Example: * The Ducks Quacks
*: "The Duck Quacks"
Include Pending Events by Stephen Norris.
Duck Pond is a room.
When play begins:
The duck quacks in 2 turns from now.
At the time when the duck quacks:
say "'Quack!' quacks the duck!".
At the time when the duck is agitated:
The duck quacks in 2 turns from now.
Every turn:
if the duck quacks is pending:
say "The duck looks agitated. A quack is coming!";
otherwise:
say "The duck looks relaxed, for now.";
unless the duck is agitated is pending:
The duck is agitated in 2 turns from now.
test me with "z/z/z/z/z/z/z/z".