… | |
… | |
4 | generate the event-list itself, so is always complete. Be careful wehn |
4 | generate the event-list itself, so is always complete. Be careful wehn |
5 | changing it, though. |
5 | changing it, though. |
6 | |
6 | |
7 | =head2 NOTATION |
7 | =head2 NOTATION |
8 | |
8 | |
9 | the event description below uses a variant of the forth stack notation - |
9 | The event description below uses a variant of the forth stack notation - |
10 | an opening parenthesis followed by the type of each parameter, optionally |
10 | an opening parenthesis followed by the type of each parameter, optionally |
11 | followed by two dashes and the returning parameters. If the latter is |
11 | followed by two dashes and the returning parameters. If the latter part is |
12 | missing, the event will be invoked but cannot change wether the event gets |
12 | missing, the event will be invoked but cannot change wether the event gets |
13 | processed. |
13 | processed. |
14 | |
14 | |
15 | If it is specified (even if no return values are supported), a plug-in |
15 | Return values are given by overriding (in Perl by calling C<cf::override>) |
16 | can override (e.g. using C<cf::override> in Perl) event processing, |
16 | with the return values, which will both stop further event processing and |
17 | basically short-circuiting it. For example, if you override from within a |
17 | tell the caller that it wants to override normal processing. |
18 | player BIRTH event, nothing much will happen with respect to the built-in |
18 | |
|
|
19 | Even if no return values are supported, a plug-in can override (e.g. using |
|
|
20 | C<cf::override> in Perl) event processing, basically short-circuiting |
|
|
21 | it. For example, if you override from within a player BIRTH event, |
|
|
22 | nothing much will happen with respect to the built-in processing, but if |
19 | processing, but if you override from within a player TELL event, the tell |
23 | you override from within a player TELL event, the tell will be ignored |
20 | will be ignored (presumably your plug-in took care of it). |
24 | (presumably your plug-in took care of it). |
21 | |
25 | |
22 | |
26 | |
23 | =head2 ATTACHABLE EVENTS |
27 | =head2 ATTACHABLE EVENTS |
24 | |
28 | |
25 | No time to document this, screw me. |
29 | No time to document this, screw me. |
… | |
… | |
110 | |
114 | |
111 | =item B<2> objects of that type can't be applied if not in inventory |
115 | =item B<2> objects of that type can't be applied if not in inventory |
112 | |
116 | |
113 | =back |
117 | =back |
114 | |
118 | |
|
|
119 | =head3 reset (object) |
|
|
120 | |
|
|
121 | Invoked whenever the object is initialised on a map after it was |
|
|
122 | loaded. This can be used to emulate shop-floor behaviour for example. |
|
|
123 | |
115 | =head3 throw (object thrower) |
124 | =head3 throw (object thrower) |
116 | |
125 | |
117 | Invoked when an B<object> is thrown by B<thrower>. |
126 | Invoked when an B<object> is thrown by B<thrower>. |
118 | |
127 | |
119 | =head3 stop (object -- ) |
128 | =head3 stop (object -- ) |
… | |
… | |
181 | damage that has been dealt. |
190 | damage that has been dealt. |
182 | |
191 | |
183 | =head3 skill_attack (attacker victim message skill -- success) |
192 | =head3 skill_attack (attacker victim message skill -- success) |
184 | |
193 | |
185 | Invoked whenever an B<attacker> attacks B<victim> using a B<skill> (skill |
194 | Invoked whenever an B<attacker> attacks B<victim> using a B<skill> (skill |
186 | cna be C<undef>). B<message> is the message that describes the attack when |
195 | can be C<undef>). B<message> is the message that describes the attack when |
187 | damage is done. |
196 | damage is done. |
188 | |
197 | |
189 | =head3 weapon_attack (weapon hitter victim) |
198 | =head3 weapon_attack (weapon hitter victim) |
190 | |
199 | |
191 | Invoked whenever an object is used as a B<weapon> by B<hitter> to attack |
200 | Invoked whenever an object is used as a B<weapon> by B<hitter> to attack |
… | |
… | |
215 | |
224 | |
216 | Invoked whenever a container gets closed. When overriden, the container |
225 | Invoked whenever a container gets closed. When overriden, the container |
217 | will not get closed, but you must tell op about the reason. This event |
226 | will not get closed, but you must tell op about the reason. This event |
218 | is not crash-safe, i.e. containers might be closed due to a server crash |
227 | is not crash-safe, i.e. containers might be closed due to a server crash |
219 | without this event being invoked. |
228 | without this event being invoked. |
|
|
229 | |
|
|
230 | =head3 blocked_move (self who -- do_blocked) |
|
|
231 | |
|
|
232 | Invoked when an C<who> tries to move to the same space as C<self>, |
|
|
233 | C<self>'s C<move_block> causes blocked movement for C<who> and nothing |
|
|
234 | else explicitly allows movement to this space. |
|
|
235 | |
|
|
236 | Should return true when C<who> is blocked, i.e., should not be allowed to |
|
|
237 | move onto C<self>. |
|
|
238 | |
|
|
239 | When not overriding, normal blocked_move (blocked_link) processing will |
|
|
240 | happen. |
220 | |
241 | |
221 | |
242 | |
222 | =head2 GLOBAL EVENTS |
243 | =head2 GLOBAL EVENTS |
223 | |
244 | |
224 | Global events have no relation to specific objects. |
245 | Global events have no relation to specific objects. |
… | |
… | |
372 | =head3 leave (map player -- ) |
393 | =head3 leave (map player -- ) |
373 | |
394 | |
374 | Invoked whenever a player tries to leave the B<map>. Overriding means the |
395 | Invoked whenever a player tries to leave the B<map>. Overriding means the |
375 | player won't be able to leave. |
396 | player won't be able to leave. |
376 | |
397 | |
377 | =head3 trigger (map connection state -- ) |
398 | =head3 trigger (map connection state what? who? -- ) |
378 | |
399 | |
379 | Invoked whenever something activates a B<connection> on the B<map>. If B<state> |
400 | Invoked whenever something activates a B<connection> on the B<map>. If B<state> |
380 | is true the connection was 'state' and if false it is 'released'. |
401 | is true the connection was 'state' and if false it is 'released'. |
381 | |
402 | |
382 | |
403 | |