1 | #! perl |
1 | #! perl # depends=irc |
2 | #CONVERSION: PARTIAL |
2 | #CONVERSION: PARTIAL |
3 | |
3 | |
4 | # implement a replacement for the built-in say/chat/shout/tell/reply commands |
4 | # implement a replacement for the built-in say/chat/shout/tell/reply commands |
5 | # adds ignore/unignore functionality |
5 | # adds ignore/unignore functionality |
6 | |
6 | |
7 | use NPC_Dialogue; |
7 | use NPC_Dialogue; |
8 | use POSIX (); # for strftime only |
8 | use POSIX (); # for strftime only |
|
|
9 | |
|
|
10 | our $SAY_CHANNEL = { |
|
|
11 | id => "say", |
|
|
12 | title => "Map", |
|
|
13 | reply => "say ", |
|
|
14 | tooltip => "Things said to and replied from npcs near you and other players on the same map only.", |
|
|
15 | }; |
|
|
16 | |
|
|
17 | our $CHAT_CHANNEL = { |
|
|
18 | id => "chat", |
|
|
19 | title => "Chat", |
|
|
20 | reply => "chat ", |
|
|
21 | tooltip => "Player chat and shouts, global to the server.", |
|
|
22 | }; |
9 | |
23 | |
10 | sub clean_timeouts($) { |
24 | sub clean_timeouts($) { |
11 | my ($player) = @_; |
25 | my ($player) = @_; |
12 | my $NOW = time; |
26 | my $NOW = time; |
13 | |
27 | |
… | |
… | |
22 | } |
36 | } |
23 | } |
37 | } |
24 | } |
38 | } |
25 | } |
39 | } |
26 | |
40 | |
|
|
41 | # send_irc ($format, @args, $msg) |
|
|
42 | # make sure the last argument is the message! |
|
|
43 | sub send_irc { |
|
|
44 | my ($format, @args) = @_; |
|
|
45 | my $msg = pop @args; |
|
|
46 | for (split /\n/, $msg) { |
|
|
47 | ext::irc::do_notice (sprintf $format, @args, $_) |
|
|
48 | } |
|
|
49 | } |
|
|
50 | |
27 | cf::player->attach ( |
51 | cf::player->attach ( |
28 | prio => -1000, |
52 | prio => -1000, |
29 | on_login => sub { |
53 | on_login => sub { |
30 | my ($pl) = @_; |
54 | my ($pl) = @_; |
31 | |
55 | |
32 | clean_timeouts $pl->ob; |
56 | clean_timeouts $pl->ob; |
|
|
57 | $pl->ns->send_msg ($SAY_CHANNEL); |
|
|
58 | $pl->ns->send_msg ($CHAT_CHANNEL); |
33 | }, |
59 | }, |
34 | |
|
|
35 | 1 |
|
|
36 | ); |
60 | ); |
37 | |
61 | |
38 | cf::register_command listen => sub { |
62 | cf::register_command listen => sub { |
39 | my ($who, $msg) = @_; |
63 | my ($pl, $msg) = @_; |
40 | my $player = cf::player::find_active $who->name; |
64 | my $player = cf::player::find_active $pl->name; |
41 | |
65 | |
42 | if ($msg ne "") { |
66 | if ($msg ne "") { |
|
|
67 | $msg = 10 if $msg > 10; |
|
|
68 | |
43 | my $prev_listen = $player->listening; |
69 | my $prev_listen = $player->listening; |
44 | $player->listening ($msg); |
70 | $player->listening ($msg); |
45 | if ($prev_listen == $player->listening) { |
71 | if ($prev_listen == $player->listening) { |
46 | $who->message ("Your verbose level stayed $prev_listen.", cf::NDI_UNIQUE); |
72 | $pl->message ("Your verbose level stays at $prev_listen.", cf::NDI_UNIQUE); |
47 | } else { |
73 | } else { |
48 | $who->message ("Your verbose level is now " . $player->listening . ". (previously: $prev_listen)", cf::NDI_UNIQUE); |
74 | $pl->message ("Your verbose level is now " . $player->listening . ". (previously: $prev_listen)", cf::NDI_UNIQUE); |
49 | } |
75 | } |
50 | } else { |
76 | } else { |
51 | $who->message ("Your verbose level is " . $player->listening . ".", cf::NDI_UNIQUE); |
77 | $pl->message ("Your verbose level is " . $player->listening . ".", cf::NDI_UNIQUE); |
52 | } |
78 | } |
|
|
79 | }; |
53 | |
80 | |
|
|
81 | cf::register_command cointoss => sub { |
|
|
82 | my ($pl, $msg) = @_; |
|
|
83 | |
|
|
84 | my $name = $pl->name; |
|
|
85 | my $coin = int rand 2 ? "Heads" : "Tails"; |
|
|
86 | |
|
|
87 | for my $other ( grep { $pl->on_same_map_as ($_->ob) } cf::player::list ) { |
|
|
88 | next |
|
|
89 | if $other->ob == $pl; |
|
|
90 | $other->ob->message ("$name flips a coin.... $coin!", cf::NDI_GREY | cf::NDI_UNIQUE); |
|
|
91 | } |
54 | 1 |
92 | |
|
|
93 | $pl->message ("You flip a coin.... $coin!", cf::NDI_GREY | cf::NDI_UNIQUE); |
|
|
94 | }; |
|
|
95 | |
|
|
96 | cf::register_command orcknuckle => sub { |
|
|
97 | my ($pl, $msg) = @_; |
|
|
98 | my @orcknuckle = ("none", "beholder", "ghost", "knight", "princess", "dragon", "orc"); |
|
|
99 | |
|
|
100 | my $name = $pl->name; |
|
|
101 | |
|
|
102 | my ($i, $j, $k, $l) = ((int rand 5) + 1, (int rand 5) + 1, (int rand 5) + 1, (int rand 6) + 1); |
|
|
103 | my $result = "$orcknuckle[$i], $orcknuckle[$j], $orcknuckle[$k], $orcknuckle[$l]"; |
|
|
104 | |
|
|
105 | for my $other ( grep { $pl->on_same_map_as ($_->ob) } cf::player::list ) { |
|
|
106 | next |
|
|
107 | if $other->ob == $pl; |
|
|
108 | $other->ob->message ("$name rolls $result!", cf::NDI_GREY | cf::NDI_UNIQUE); |
|
|
109 | } |
|
|
110 | |
|
|
111 | $pl->message ("You roll $result!", cf::NDI_GREY | cf::NDI_UNIQUE); |
55 | }; |
112 | }; |
56 | |
113 | |
57 | my $emotes = { |
114 | my $emotes = { |
58 | growl => { |
115 | growl => { |
59 | noparams => { |
116 | noparams => { |
60 | other => "<self> growls." |
117 | other => "<self> growls.", |
61 | self => "Grrrrrrrrr...." |
118 | self => "Grrrrrrrrr....", |
62 | }, |
119 | }, |
63 | params => { |
120 | params => { |
64 | }, |
121 | }, |
65 | self => { |
122 | self => { |
66 | }, |
123 | }, |
67 | }, |
124 | }, |
68 | giggle => { |
125 | giggle => { |
69 | noparams => { |
126 | noparams => { |
70 | other => "<self> giggles." |
127 | other => "<self> giggles.", |
71 | self => "You giggle." |
128 | self => "You giggle.", |
72 | }, |
129 | }, |
73 | params => { |
130 | params => { |
74 | }, |
131 | }, |
75 | self => { |
132 | self => { |
76 | }, |
133 | }, |
77 | }, |
134 | }, |
78 | shiver => { |
135 | shiver => { |
79 | noparams => { |
136 | noparams => { |
80 | other => "<self> shivers uncomfortably." |
137 | other => "<self> shivers uncomfortably.", |
81 | self => "Brrrrrrrrr." |
138 | self => "Brrrrrrrrr.", |
82 | }, |
139 | }, |
83 | params => { |
140 | params => { |
84 | }, |
141 | }, |
85 | self => { |
142 | self => { |
86 | }, |
143 | }, |
87 | }, |
144 | }, |
88 | chuckle => { |
145 | chuckle => { |
89 | noparams => { |
146 | noparams => { |
90 | other => "<self> chuckles politely." |
147 | other => "<self> chuckles politely.", |
91 | self => "You chuckle politely" |
148 | self => "You chuckle politely", |
92 | }, |
149 | }, |
93 | params => { |
150 | params => { |
94 | }, |
151 | }, |
95 | self => { |
152 | self => { |
96 | }, |
153 | }, |
97 | }, |
154 | }, |
98 | sigh => { |
155 | sigh => { |
99 | noparams => { |
156 | noparams => { |
100 | other => "<self> sighs loudly." |
157 | other => "<self> sighs loudly.", |
101 | self => "You sigh." |
158 | self => "You sigh.", |
102 | }, |
159 | }, |
103 | params => { |
160 | params => { |
104 | }, |
161 | }, |
105 | self => { |
162 | self => { |
106 | }, |
163 | }, |
107 | }, |
164 | }, |
108 | scream => { |
165 | scream => { |
109 | noparams => { |
166 | noparams => { |
110 | other => "<self> screams at the top of his lungs!" |
167 | other => "<self> screams at the top of his lungs!", |
111 | self => "ARRRRRRRRRRGH!!!!!" |
168 | self => "ARRRRRRRRRRGH!!!!!", |
112 | }, |
169 | }, |
113 | params => { |
170 | params => { |
114 | }, |
171 | }, |
115 | self => { |
172 | self => { |
116 | }, |
173 | }, |
117 | }, |
174 | }, |
118 | puke => { |
175 | puke => { |
119 | noparams => { |
176 | noparams => { |
120 | other => "<self> pukes." |
177 | other => "<self> pukes.", |
121 | self => "Bleaaaaaghhhhhhh!" |
178 | self => "Bleaaaaaghhhhhhh!", |
122 | }, |
179 | }, |
123 | params => { |
180 | params => { |
124 | target => "<self> pukes on your clothes!" |
181 | target => "<self> pukes on your clothes!", |
125 | other => "<self> pukes on <other>." |
182 | other => "<self> pukes on <other>.", |
126 | self => "You puke on <other>." |
183 | self => "You puke on <other>.", |
127 | }, |
184 | }, |
128 | self => { |
185 | self => { |
129 | other => "<self> pukes on his clothes." |
186 | other => "<self> pukes on his clothes.", |
130 | self => "You puke on yourself." |
187 | self => "You puke on yourself.", |
131 | }, |
188 | }, |
132 | }, |
189 | }, |
133 | strut => { |
190 | strut => { |
134 | noparams => { |
191 | noparams => { |
135 | other => "<self> struts proudly." |
192 | other => "<self> struts proudly.", |
136 | self => "Strut your stuff." |
193 | self => "Strut your stuff.", |
137 | }, |
194 | }, |
138 | params => { |
195 | params => { |
139 | }, |
196 | }, |
140 | self => { |
197 | self => { |
141 | }, |
198 | }, |
142 | }, |
199 | }, |
143 | cringe => { |
200 | cringe => { |
144 | noparams => { |
201 | noparams => { |
145 | other => "<self> cringes in terror!" |
202 | other => "<self> cringes in terror!", |
146 | self => "You cringe in terror." |
203 | self => "You cringe in terror.", |
147 | }, |
204 | }, |
148 | params => { |
205 | params => { |
149 | target => "<self> cringes away from <other> in mortal terror." |
206 | target => "<self> cringes away from <other> in mortal terror.", |
150 | self => "You cringe away from <other>." |
207 | self => "You cringe away from <other>.", |
151 | }, |
208 | }, |
152 | self => { |
209 | self => { |
153 | }, |
210 | }, |
154 | }, |
211 | }, |
155 | hiccup => { |
212 | hiccup => { |
156 | noparams => { |
213 | noparams => { |
157 | other => "<self> hiccups." |
214 | other => "<self> hiccups.", |
158 | self => "*HIC*" |
215 | self => "*HIC*", |
159 | }, |
216 | }, |
160 | params => { |
217 | params => { |
161 | }, |
218 | }, |
162 | self => { |
219 | self => { |
163 | }, |
220 | }, |
164 | }, |
221 | }, |
165 | clap => { |
222 | clap => { |
166 | noparams => { |
223 | noparams => { |
167 | other => "<self> gives a round of applause." |
224 | other => "<self> gives a round of applause.", |
168 | self => "Clap, clap, clap." |
225 | self => "Clap, clap, clap.", |
169 | }, |
226 | }, |
170 | params => { |
227 | params => { |
171 | }, |
228 | }, |
172 | self => { |
229 | self => { |
173 | }, |
230 | }, |
174 | }, |
231 | }, |
175 | kiss => { |
232 | kiss => { |
176 | noparams => { |
233 | noparams => { |
177 | other => "<self> makes a weird facial contortion" |
234 | other => "<self> makes a weird facial contortion", |
178 | self => "All the lonely people.." |
235 | self => "All the lonely people..", |
179 | }, |
236 | }, |
180 | params => { |
237 | params => { |
181 | target => "<self> kisses you." |
238 | target => "<self> kisses you.", |
182 | other => "<self> kisses <other>." |
239 | other => "<self> kisses <other>.", |
183 | self => "You kiss <other>." |
240 | self => "You kiss <other>.", |
184 | }, |
241 | }, |
185 | self => { |
242 | self => { |
186 | }, |
243 | }, |
187 | }, |
244 | }, |
188 | wink => { |
245 | wink => { |
189 | noparams => { |
246 | noparams => { |
190 | other => "<self> winks suggestively." |
247 | other => "<self> winks suggestively.", |
191 | self => "Have you got something in your eye?" |
248 | self => "Have you got something in your eye?", |
192 | }, |
249 | }, |
193 | params => { |
250 | params => { |
|
|
251 | target => "<self> winks at you.", |
194 | target => "<self> winks at <other>." |
252 | other => "<self> winks at <other>.", |
195 | self => "You wink suggestively at <other>." |
253 | self => "You wink suggestively at <other>.", |
196 | }, |
254 | }, |
197 | self => { |
255 | self => { |
198 | other => "<self> winks at himself - something strange is going on..." |
256 | other => "<self> winks at himself - something strange is going on...", |
199 | self => "You wink at yourself?? What are you up to?" |
257 | self => "You wink at yourself?? What are you up to?", |
200 | }, |
258 | }, |
201 | }, |
259 | }, |
202 | pout => { |
260 | pout => { |
203 | noparams => { |
261 | noparams => { |
204 | other => "<self> pouts." |
262 | other => "<self> pouts.", |
205 | self => "Aww, don't take it so hard." |
263 | self => "Aww, don't take it so hard.", |
206 | }, |
264 | }, |
207 | params => { |
265 | params => { |
208 | }, |
266 | }, |
209 | self => { |
267 | self => { |
210 | }, |
268 | }, |
211 | }, |
269 | }, |
212 | cackle => { |
270 | cackle => { |
213 | noparams => { |
271 | noparams => { |
214 | other => "<self> throws back his head and cackles with insane glee!" |
272 | other => "<self> throws back his head and cackles with insane glee!", |
215 | self => "You cackle gleefully." |
273 | self => "You cackle gleefully.", |
216 | }, |
274 | }, |
217 | params => { |
275 | params => { |
218 | }, |
276 | }, |
219 | self => { |
277 | self => { |
220 | }, |
278 | }, |
221 | }, |
279 | }, |
222 | sniff => { |
280 | sniff => { |
223 | noparams => { |
281 | noparams => { |
224 | other => "<self> sniffs sadly." |
282 | other => "<self> sniffs sadly.", |
225 | self => "You sniff sadly. *SNIFF*" |
283 | self => "You sniff sadly. *SNIFF*", |
226 | }, |
284 | }, |
227 | params => { |
285 | params => { |
228 | target => "<self> sniffs you." |
286 | target => "<self> sniffs you.", |
229 | other => "<self> sniffs <other>" |
287 | other => "<self> sniffs <other>", |
230 | self => "You sniff <other>." |
288 | self => "You sniff <other>.", |
231 | }, |
289 | }, |
232 | self => { |
290 | self => { |
233 | other => "<self> sniffs himself." |
291 | other => "<self> sniffs himself.", |
234 | self => "You sniff yourself." |
292 | self => "You sniff yourself.", |
235 | }, |
293 | }, |
236 | }, |
294 | }, |
237 | nod => { |
295 | nod => { |
238 | noparams => { |
296 | noparams => { |
239 | other => "<self> nods solemnly." |
297 | other => "<self> nods solemnly.", |
240 | self => "You nod solemnly." |
298 | self => "You nod solemnly.", |
241 | }, |
299 | }, |
242 | params => { |
300 | params => { |
243 | target => "<self> nods solemnly to you." |
301 | target => "<self> nods solemnly to you.", |
244 | other => "<self> nods solemnly to <other>." |
302 | other => "<self> nods solemnly to <other>.", |
245 | self => "You nod solemnly to <other>." |
303 | self => "You nod solemnly to <other>.", |
246 | }, |
304 | }, |
247 | self => { |
305 | self => { |
248 | }, |
306 | }, |
249 | }, |
307 | }, |
250 | frown => { |
308 | frown => { |
251 | noparams => { |
309 | noparams => { |
252 | other => "<self> frowns." |
310 | other => "<self> frowns.", |
253 | self => "What's bothering you?" |
311 | self => "What's bothering you?", |
254 | }, |
312 | }, |
255 | params => { |
313 | params => { |
256 | target => "<self> frowns darkly at you." |
314 | target => "<self> frowns darkly at you.", |
257 | other => "<self> frowns darkly at <other>." |
315 | other => "<self> frowns darkly at <other>.", |
258 | self => "You frown darkly at <other>." |
316 | self => "You frown darkly at <other>.", |
259 | }, |
317 | }, |
260 | self => { |
318 | self => { |
261 | other => "<self> frowns at himself." |
319 | other => "<self> frowns at himself.", |
262 | self => "You frown at yourself." |
320 | self => "You frown at yourself.", |
263 | }, |
321 | }, |
264 | }, |
322 | }, |
265 | snicker => { |
323 | snicker => { |
266 | noparams => { |
324 | noparams => { |
267 | other => "<self> snickers softly." |
325 | other => "<self> snickers softly.", |
268 | self => "You snicker softly." |
326 | self => "You snicker softly.", |
269 | }, |
327 | }, |
270 | params => { |
328 | params => { |
271 | }, |
329 | }, |
272 | self => { |
330 | self => { |
273 | }, |
331 | }, |
274 | }, |
332 | }, |
275 | shrug => { |
333 | shrug => { |
276 | noparams => { |
334 | noparams => { |
277 | other => "<self> shrugs helplessly." |
335 | other => "<self> shrugs helplessly.", |
278 | self => "You shrug." |
336 | self => "You shrug.", |
279 | }, |
337 | }, |
280 | params => { |
338 | params => { |
281 | target => "<self> shrugs at you." |
339 | target => "<self> shrugs at you.", |
282 | other => "<self> shrugs at <other>." |
340 | other => "<self> shrugs at <other>.", |
283 | self => "You shrug at <other>." |
341 | self => "You shrug at <other>.", |
284 | }, |
342 | }, |
285 | self => { |
343 | self => { |
286 | }, |
344 | }, |
287 | }, |
345 | }, |
288 | bleed => { |
346 | bleed => { |
289 | noparams => { |
347 | noparams => { |
290 | other => "<self> is bleeding all over the carpet - got a spare tourniquet?" |
348 | other => "<self> is bleeding all over the carpet - got a spare tourniquet?", |
291 | self => "You bleed all over your nice new armour." |
349 | self => "You bleed all over your nice new armour.", |
292 | }, |
350 | }, |
293 | params => { |
351 | params => { |
|
|
352 | target => "<self> slashes his wrist and bleeds all over you.", |
294 | target => "<self> slashes his wrist and bleeds all over <other>." |
353 | other => "<self> slashes his wrist and bleeds all over <other>.", |
295 | self => "You slash your wrist and bleed all over <other>" |
354 | self => "You slash your wrist and bleed all over <other>", |
296 | }, |
355 | }, |
297 | self => { |
356 | self => { |
298 | other => "<self> performs some satanic ritual while wiping his blood on himself." |
357 | other => "<self> performs some satanic ritual while wiping his blood on himself.", |
299 | self => "Very impressive! You wipe your blood all over yourself." |
358 | self => "Very impressive! You wipe your blood all over yourself.", |
300 | }, |
359 | }, |
301 | }, |
360 | }, |
302 | twiddle => { |
361 | twiddle => { |
303 | noparams => { |
362 | noparams => { |
304 | other => "<self> patiently twiddles his thumbs." |
363 | other => "<self> patiently twiddles his thumbs.", |
305 | self => "You patiently twiddle your thumbs." |
364 | self => "You patiently twiddle your thumbs.", |
306 | }, |
365 | }, |
307 | params => { |
366 | params => { |
308 | }, |
367 | }, |
309 | self => { |
368 | self => { |
310 | }, |
369 | }, |
311 | }, |
370 | }, |
312 | spit => { |
371 | spit => { |
313 | noparams => { |
372 | noparams => { |
314 | other => "<self> spits over his left shoulder." |
373 | other => "<self> spits over his left shoulder.", |
315 | self => "You spit over your left shoulder." |
374 | self => "You spit over your left shoulder.", |
316 | }, |
375 | }, |
317 | params => { |
376 | params => { |
318 | target => "<self> spits in your face!" |
377 | target => "<self> spits in your face!", |
319 | other => "<self> spits in <other>'s face." |
378 | other => "<self> spits in <other>'s face.", |
320 | self => "You spit on <other>." |
379 | self => "You spit on <other>.", |
321 | }, |
380 | }, |
322 | self => { |
381 | self => { |
323 | other => "<self> drools all over himself." |
382 | other => "<self> drools all over himself.", |
324 | self => "You drool all over yourself." |
383 | self => "You drool all over yourself.", |
325 | }, |
384 | }, |
326 | }, |
385 | }, |
327 | glare => { |
386 | glare => { |
328 | noparams => { |
387 | noparams => { |
329 | other => "<self> glares around him." |
388 | other => "<self> glares around him.", |
330 | self => "You glare at nothing in particular." |
389 | self => "You glare at nothing in particular.", |
331 | }, |
390 | }, |
332 | params => { |
391 | params => { |
333 | target => "<self> glares icily at you, you feel cold to your bones." |
392 | target => "<self> glares icily at you, you feel cold to your bones.", |
334 | other => "<self> glares at <other>." |
393 | other => "<self> glares at <other>.", |
335 | self => "You glare icily at <other>." |
394 | self => "You glare icily at <other>.", |
336 | }, |
395 | }, |
337 | self => { |
396 | self => { |
338 | other => "<self> glares at his feet, what is bothering him?" |
397 | other => "<self> glares at his feet, what is bothering him?", |
339 | self => "You glare icily at your feet, they are suddenly very cold." |
398 | self => "You glare icily at your feet, they are suddenly very cold.", |
340 | }, |
399 | }, |
341 | }, |
400 | }, |
342 | bow => { |
401 | bow => { |
343 | noparams => { |
402 | noparams => { |
344 | other => "<self> bows deeply." |
403 | other => "<self> bows deeply.", |
345 | self => "You bow deeply." |
404 | self => "You bow deeply.", |
346 | }, |
405 | }, |
347 | params => { |
406 | params => { |
348 | target => "<self> bows before you." |
407 | target => "<self> bows before you.", |
349 | other => "<self> bows before <other>." |
408 | other => "<self> bows before <other>.", |
350 | self => "You bow before <other>." |
409 | self => "You bow before <other>.", |
351 | }, |
410 | }, |
352 | self => { |
411 | self => { |
353 | other => "<self> folds up like a jackknife and kisses his own toes." |
412 | other => "<self> folds up like a jackknife and kisses his own toes.", |
354 | self => "You kiss your toes." |
413 | self => "You kiss your toes.", |
355 | }, |
414 | }, |
356 | }, |
415 | }, |
357 | dance => { |
416 | dance => { |
358 | noparams => { |
417 | noparams => { |
359 | other => "<self> expresses himself through interpretive dance." |
418 | other => "<self> expresses himself through interpretive dance.", |
360 | self => "You dance with glee." |
419 | self => "You dance with glee.", |
361 | }, |
420 | }, |
362 | params => { |
421 | params => { |
363 | target => "<self> grabs you, and begins dancing!" |
422 | target => "<self> grabs you, and begins dancing!", |
364 | other => "Yipe! <self> and <other> are doing the Macarena!" |
423 | other => "Yipe! <self> and <other> are doing the Macarena!", |
365 | self => "You grab <other> and begin doing the Cha-Cha!" |
424 | self => "You grab <other> and begin doing the Cha-Cha!", |
366 | }, |
425 | }, |
367 | self => { |
426 | self => { |
368 | other => "<self> embraces himself and begins to dance!" |
427 | other => "<self> embraces himself and begins to dance!", |
369 | self => "You skip and dance around by yourself." |
428 | self => "You skip and dance around by yourself.", |
370 | }, |
|
|
371 | }, |
|
|
372 | other => { |
|
|
373 | noparams => { |
|
|
374 | other => "<self> dances with glee." |
|
|
375 | self => "You are a nut." |
|
|
376 | }, |
|
|
377 | params => { |
|
|
378 | target => "You get the distinct feeling that <other> is nuts." |
|
|
379 | other => "<self> is eyeing <other> quizzically." |
|
|
380 | self => "You are still nuts." |
|
|
381 | }, |
|
|
382 | self => { |
|
|
383 | other => "You look away from <self>." |
|
|
384 | self => "My god! Is that LEGAL?" |
|
|
385 | }, |
429 | }, |
386 | }, |
430 | }, |
387 | snore => { |
431 | snore => { |
388 | noparams => { |
432 | noparams => { |
389 | other => "<self> snores loudly." |
433 | other => "<self> snores loudly.", |
390 | self => "Zzzzzzzzzzzzzzz." |
434 | self => "Zzzzzzzzzzzzzzz.", |
391 | }, |
435 | }, |
392 | params => { |
436 | params => { |
393 | }, |
437 | }, |
394 | self => { |
438 | self => { |
395 | }, |
439 | }, |
396 | }, |
440 | }, |
397 | blush => { |
441 | blush => { |
398 | noparams => { |
442 | noparams => { |
399 | other => "<self> blushes." |
443 | other => "<self> blushes.", |
400 | self => "Your cheeks are burning." |
444 | self => "Your cheeks are burning.", |
401 | }, |
445 | }, |
402 | params => { |
446 | params => { |
403 | }, |
447 | }, |
404 | self => { |
448 | self => { |
405 | }, |
449 | }, |
406 | }, |
450 | }, |
407 | snap => { |
451 | snap => { |
408 | noparams => { |
452 | noparams => { |
409 | other => "<self> snaps his fingers." |
453 | other => "<self> snaps his fingers.", |
410 | self => "PRONTO! you snap your fingers." |
454 | self => "PRONTO! you snap your fingers.", |
411 | }, |
455 | }, |
412 | params => { |
456 | params => { |
413 | }, |
457 | }, |
414 | self => { |
458 | self => { |
415 | }, |
459 | }, |
416 | }, |
460 | }, |
417 | wave => { |
461 | wave => { |
418 | noparams => { |
462 | noparams => { |
419 | other => "<self> waves happily." |
463 | other => "<self> waves happily.", |
420 | self => "You wave." |
464 | self => "You wave.", |
421 | }, |
465 | }, |
422 | params => { |
466 | params => { |
423 | target => "<self> waves goodbye to you. Have a good journey." |
467 | target => "<self> waves goodbye to you. Have a good journey.", |
424 | other => "<self> waves goodbye to <other>." |
468 | other => "<self> waves goodbye to <other>.", |
425 | self => "You wave goodbye to <other>." |
469 | self => "You wave goodbye to <other>.", |
426 | }, |
470 | }, |
427 | self => { |
471 | self => { |
428 | other => "<self> waves goodbye to himself." |
472 | other => "<self> waves goodbye to himself.", |
429 | self => "Are you going on adventures as well??" |
473 | self => "Are you going on adventures as well??", |
430 | }, |
474 | }, |
431 | }, |
475 | }, |
432 | smile => { |
476 | smile => { |
433 | noparams => { |
477 | noparams => { |
434 | other => "<self> smiles happily." |
478 | other => "<self> smiles happily.", |
435 | self => "You smile happily." |
479 | self => "You smile happily.", |
436 | }, |
480 | }, |
437 | params => { |
481 | params => { |
438 | target => "<self> smiles at you." |
482 | target => "<self> smiles at you.", |
439 | other => "<self> beams a smile at <other>." |
483 | other => "<self> beams a smile at <other>.", |
440 | self => "You smile at <other>." |
484 | self => "You smile at <other>.", |
441 | }, |
485 | }, |
442 | self => { |
486 | self => { |
443 | }, |
487 | }, |
444 | }, |
488 | }, |
445 | sneeze => { |
489 | sneeze => { |
446 | noparams => { |
490 | noparams => { |
447 | other => "<self> sneezes." |
491 | other => "<self> sneezes.", |
448 | self => "Gesundheit!" |
492 | self => "Gesundheit!", |
449 | }, |
493 | }, |
450 | params => { |
494 | params => { |
451 | target => "<self> sneezes on you, you feel the snot cover you. EEEEEEW." |
495 | target => "<self> sneezes on you, you feel the snot cover you. EEEEEEW.", |
452 | other => "<self> sneezes on <other> and a film of snot covers him." |
496 | other => "<self> sneezes on <other> and a film of snot covers him.", |
453 | self => "You sneeze at <other> and a film of snot shoots onto him." |
497 | self => "You sneeze at <other> and a film of snot shoots onto him.", |
454 | }, |
498 | }, |
455 | self => { |
499 | self => { |
456 | other => "<self> sneezes, and covers himself in a slimy substance." |
500 | other => "<self> sneezes, and covers himself in a slimy substance.", |
457 | self => "You sneeze on yourself, what a mess!" |
501 | self => "You sneeze on yourself, what a mess!", |
458 | }, |
502 | }, |
459 | }, |
503 | }, |
460 | bounce => { |
504 | bounce => { |
461 | noparams => { |
505 | noparams => { |
462 | other => "<self> bounces around." |
506 | other => "<self> bounces around.", |
463 | self => "BOIINNNNNNGG!" |
507 | self => "BOIINNNNNNGG!", |
464 | }, |
508 | }, |
465 | params => { |
509 | params => { |
466 | target => "<self> bounces around the room with you." |
510 | target => "<self> bounces around the room with you.", |
467 | other => "<self> bounces around the room with <other>." |
511 | other => "<self> bounces around the room with <other>.", |
468 | self => "You bounce around the room with <other>." |
512 | self => "You bounce around the room with <other>.", |
469 | }, |
513 | }, |
470 | self => { |
514 | self => { |
471 | }, |
515 | }, |
472 | }, |
516 | }, |
473 | shake => { |
517 | shake => { |
474 | noparams => { |
518 | noparams => { |
475 | other => "<self> shakes his head." |
519 | other => "<self> shakes his head.", |
476 | self => "You shake your head." |
520 | self => "You shake your head.", |
477 | }, |
521 | }, |
478 | params => { |
522 | params => { |
479 | target => "<self> shakes your hand." |
523 | target => "<self> shakes your hand.", |
480 | other => "<self> shakes <other>'s hand." |
524 | other => "<self> shakes <other>'s hand.", |
481 | self => "You shake <other>'s hand." |
525 | self => "You shake <other>'s hand.", |
482 | }, |
526 | }, |
483 | self => { |
527 | self => { |
484 | other => "<self> shakes and quivers like a bowlful of jelly." |
528 | other => "<self> shakes and quivers like a bowlful of jelly.", |
485 | self => "You are shaken by yourself." |
529 | self => "You are shaken by yourself.", |
486 | }, |
530 | }, |
487 | }, |
531 | }, |
488 | lick => { |
532 | lick => { |
489 | noparams => { |
533 | noparams => { |
490 | other => "<self> licks his mouth and smiles." |
534 | other => "<self> licks his mouth and smiles.", |
491 | self => "You lick your mouth and smile." |
535 | self => "You lick your mouth and smile.", |
492 | }, |
536 | }, |
493 | params => { |
537 | params => { |
494 | target => "<self> licks you." |
538 | target => "<self> licks you.", |
495 | other => "<self> licks <other>." |
539 | other => "<self> licks <other>.", |
496 | self => "You lick <other>." |
540 | self => "You lick <other>.", |
497 | }, |
541 | }, |
498 | self => { |
542 | self => { |
499 | other => "<self> licks himself - YUCK." |
543 | other => "<self> licks himself - YUCK.", |
500 | self => "You lick yourself." |
544 | self => "You lick yourself.", |
501 | }, |
545 | }, |
502 | }, |
546 | }, |
503 | flip => { |
547 | flip => { |
504 | noparams => { |
548 | noparams => { |
505 | other => "<self> flips head over heels." |
549 | other => "<self> flips head over heels.", |
506 | self => "You flip head over heels." |
550 | self => "You flip head over heels.", |
507 | }, |
551 | }, |
508 | params => { |
552 | params => { |
509 | }, |
553 | }, |
510 | self => { |
554 | self => { |
511 | }, |
555 | }, |
512 | }, |
556 | }, |
513 | think => { |
557 | think => { |
514 | noparams => { |
558 | noparams => { |
515 | other => "<self> closes his eyes and thinks really hard." |
559 | other => "<self> closes his eyes and thinks really hard.", |
516 | self => "Anything in particular that you'd care to think about?" |
560 | self => "Anything in particular that you'd care to think about?", |
517 | }, |
561 | }, |
518 | params => { |
562 | params => { |
519 | }, |
563 | }, |
520 | self => { |
564 | self => { |
521 | }, |
565 | }, |
522 | }, |
566 | }, |
523 | yawn => { |
567 | yawn => { |
524 | noparams => { |
568 | noparams => { |
525 | other => "<self> yawns sleepily." |
569 | other => "<self> yawns sleepily.", |
526 | self => "You open up your yap and let out a big breeze of stale air." |
570 | self => "You open up your yap and let out a big breeze of stale air.", |
527 | }, |
571 | }, |
528 | params => { |
572 | params => { |
529 | }, |
573 | }, |
530 | self => { |
574 | self => { |
531 | }, |
575 | }, |
532 | }, |
576 | }, |
533 | laugh => { |
577 | laugh => { |
534 | noparams => { |
578 | noparams => { |
535 | other => "<self> falls down laughing." |
579 | other => "<self> falls down laughing.", |
536 | self => "You fall down laughing." |
580 | self => "You fall down laughing.", |
537 | }, |
581 | }, |
538 | params => { |
582 | params => { |
539 | target => "<self> looks at you and falls down on the ground laughing." |
583 | target => "<self> looks at you and falls down on the ground laughing.", |
540 | other => "<self> looks at <other> and falls down on the ground laughing." |
584 | other => "<self> looks at <other> and falls down on the ground laughing.", |
541 | self => "You take one look at <other> and fall down laughing." |
585 | self => "You take one look at <other> and fall down laughing.", |
542 | }, |
586 | }, |
543 | self => { |
587 | self => { |
544 | other => "<self> is laughing at something." |
588 | other => "<self> is laughing at something.", |
545 | self => "Laugh at yourself all you want, the others won't understand." |
589 | self => "Laugh at yourself all you want, the others won't understand.", |
546 | }, |
590 | }, |
547 | }, |
591 | }, |
548 | burp => { |
592 | burp => { |
549 | noparams => { |
593 | noparams => { |
550 | other => "<self> burps loudly." |
594 | other => "<self> burps loudly.", |
551 | self => "You burp loudly." |
595 | self => "You burp loudly.", |
552 | }, |
596 | }, |
553 | params => { |
597 | params => { |
554 | }, |
598 | }, |
555 | self => { |
599 | self => { |
556 | }, |
600 | }, |
557 | }, |
601 | }, |
558 | gasp => { |
602 | gasp => { |
559 | noparams => { |
603 | noparams => { |
560 | other => "<self> gasps in astonishment." |
604 | other => "<self> gasps in astonishment.", |
561 | self => "You gasp in astonishment." |
605 | self => "You gasp in astonishment.", |
562 | }, |
606 | }, |
563 | params => { |
607 | params => { |
564 | }, |
608 | }, |
565 | self => { |
609 | self => { |
566 | }, |
610 | }, |
567 | }, |
611 | }, |
568 | smirk => { |
612 | smirk => { |
569 | noparams => { |
613 | noparams => { |
570 | other => "<self> smirks." |
614 | other => "<self> smirks.", |
571 | self => "You smirk." |
615 | self => "You smirk.", |
572 | }, |
616 | }, |
573 | params => { |
617 | params => { |
574 | }, |
618 | }, |
575 | self => { |
619 | self => { |
576 | }, |
620 | }, |
577 | }, |
621 | }, |
578 | cry => { |
622 | cry => { |
579 | noparams => { |
623 | noparams => { |
580 | other => "<self> bursts into tears." |
624 | other => "<self> bursts into tears.", |
581 | self => "Waaaaaaahhh.." |
625 | self => "Waaaaaaahhh..", |
582 | }, |
626 | }, |
583 | params => { |
627 | params => { |
584 | target => "<self> cries on your shoulder." |
628 | target => "<self> cries on your shoulder.", |
585 | other => "<self> cries on <other>'s shoulder." |
629 | other => "<self> cries on <other>'s shoulder.", |
586 | self => "You cry on <other>'s shoulder." |
630 | self => "You cry on <other>'s shoulder.", |
587 | }, |
631 | }, |
588 | self => { |
632 | self => { |
589 | other => "<self> sobs quietly to himself." |
633 | other => "<self> sobs quietly to himself.", |
590 | self => "You cry to yourself." |
634 | self => "You cry to yourself.", |
591 | }, |
635 | }, |
592 | }, |
636 | }, |
593 | sulk => { |
637 | sulk => { |
594 | noparams => { |
638 | noparams => { |
595 | other => "<self> sulks in the corner." |
639 | other => "<self> sulks in the corner.", |
596 | self => "You sulk." |
640 | self => "You sulk.", |
597 | }, |
641 | }, |
598 | params => { |
642 | params => { |
599 | }, |
643 | }, |
600 | self => { |
644 | self => { |
601 | }, |
645 | }, |
602 | }, |
646 | }, |
603 | whistle => { |
647 | whistle => { |
604 | noparams => { |
648 | noparams => { |
605 | other => "<self> whistles appreciatively." |
649 | other => "<self> whistles appreciatively.", |
606 | self => "You whistle appreciatively." |
650 | self => "You whistle appreciatively.", |
607 | }, |
651 | }, |
608 | params => { |
652 | params => { |
609 | target => "<self> whistles at <other>." |
653 | target => "<self> whistles at <other>.", |
610 | self => "You whistle at <other>." |
654 | self => "You whistle at <other>.", |
611 | }, |
655 | }, |
612 | self => { |
656 | self => { |
613 | other => "<self> whistles to himself in boredom." |
657 | other => "<self> whistles to himself in boredom.", |
614 | self => "You whistle while you work." |
658 | self => "You whistle while you work.", |
615 | }, |
659 | }, |
616 | }, |
660 | }, |
617 | groan => { |
661 | groan => { |
618 | noparams => { |
662 | noparams => { |
619 | other => "<self> groans loudly." |
663 | other => "<self> groans loudly.", |
620 | self => "You groan loudly." |
664 | self => "You groan loudly.", |
621 | }, |
665 | }, |
622 | params => { |
666 | params => { |
623 | }, |
667 | }, |
624 | self => { |
668 | self => { |
625 | }, |
669 | }, |
626 | }, |
670 | }, |
627 | cough => { |
671 | cough => { |
628 | noparams => { |
672 | noparams => { |
629 | other => "<self> coughs loudly." |
673 | other => "<self> coughs loudly.", |
630 | self => "Yuck, try to cover your mouth next time!" |
674 | self => "Yuck, try to cover your mouth next time!", |
631 | }, |
675 | }, |
632 | params => { |
676 | params => { |
633 | }, |
677 | }, |
634 | self => { |
678 | self => { |
635 | }, |
679 | }, |
636 | }, |
680 | }, |
637 | grin => { |
681 | grin => { |
638 | noparams => { |
682 | noparams => { |
639 | other => "<self> grins evilly." |
683 | other => "<self> grins evilly.", |
640 | self => "You grin evilly." |
684 | self => "You grin evilly.", |
641 | }, |
685 | }, |
642 | params => { |
686 | params => { |
643 | target => "<self> grins evilly at you." |
687 | target => "<self> grins evilly at you.", |
644 | other => "<self> grins evilly at <other>." |
688 | other => "<self> grins evilly at <other>.", |
645 | self => "You grin at <other>." |
689 | self => "You grin at <other>.", |
646 | }, |
|
|
647 | self => { |
|
|
648 | }, |
|
|
649 | }, |
690 | }, |
|
|
691 | self => { |
|
|
692 | }, |
|
|
693 | }, |
650 | }; |
694 | }; |
|
|
695 | |
651 | for my $emotion (keys %$emotes) { |
696 | for my $emotion (keys %$emotes) { |
652 | cf::register_command $emotion => sub { |
697 | cf::register_command $emotion => sub { |
653 | my ($ob, $tname) = @_; |
698 | my ($pl, $tname) = @_; |
654 | |
699 | |
655 | cf::async { |
700 | cf::async { |
656 | my $name = $ob->name; |
701 | my $name = $pl->name; |
657 | |
702 | |
658 | if ($tname eq $name) { |
703 | if ($tname eq $name) { |
659 | my $emote = $emotes->{$emotion}->{self}; |
704 | my $emote = $emotes->{$emotion}->{self}; |
|
|
705 | |
|
|
706 | $emote->{other} = "You look away from <self>." |
|
|
707 | if !$emote->{other}; |
|
|
708 | $emote->{self} = "My god! Is that LEGAL?" |
|
|
709 | if !$emote->{self}; |
|
|
710 | |
660 | $emote->{other} =~ s/<self>/$name/; |
711 | $emote->{other} =~ s/<self>/$name/; |
661 | |
712 | |
662 | for my $other ( grep { $ob->on_same_map_as ($_->ob) } cf::player::list ) { |
713 | for my $other ( grep { $pl->on_same_map_as ($_->ob) } cf::player::list ) { |
663 | next |
714 | next |
664 | if $other->ob == $ob; |
715 | if $other->ob == $pl; |
665 | $other->ob->message ($emote->{other}, cf::NDI_GREY | cf::NDI_UNIQUE); |
716 | $other->ob->message ($emote->{other}, cf::NDI_GREY | cf::NDI_UNIQUE); |
666 | } |
717 | } |
667 | |
718 | |
668 | $ob->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); |
719 | $pl->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); |
669 | } elsif ($tname) { |
720 | } elsif ($tname) { |
670 | my $target = cf::player::find $tname |
721 | my $target = cf::player::find $tname |
671 | or return $ob->reply (undef, "$tname is not around."); |
722 | or return $pl->reply (undef, "$tname is not around."); |
672 | |
723 | |
673 | my $emote = $emotes->{$emotion}->{params}; |
724 | my $emote = $emotes->{$emotion}->{params}; |
|
|
725 | |
|
|
726 | $emote->{other} = "<self> is eyeing <other> quizzically." |
|
|
727 | if !$emote->{other}; |
|
|
728 | $emote->{self} = "You are still nuts." |
|
|
729 | if !$emote->{self}; |
|
|
730 | $emote->{target} = "You get the distinct feeling that <other> is nuts." |
|
|
731 | if !$emote->{target}; |
|
|
732 | |
674 | $emote->{self} =~ s/<other>/$tname/; |
733 | $emote->{self} =~ s/<other>/$tname/; |
675 | $emote->{target} =~ s/<self>/$name/; |
734 | $emote->{target} =~ s/<self>/$name/; |
676 | $emote->{other} =~ s/<other>/$tname/; |
735 | $emote->{other} =~ s/<other>/$tname/; |
677 | $emote->{other} =~ s/<self>/$name/; |
736 | $emote->{other} =~ s/<self>/$name/; |
678 | |
737 | |
679 | for my $other ( grep { $ob->on_same_map_as ($_->ob) } cf::player::list ) { |
738 | for my $other ( grep { $pl->on_same_map_as ($_->ob) } cf::player::list ) { |
680 | next |
739 | next |
681 | if $other->ob == $ob or $other == $target; |
740 | if $other->ob == $pl or $other == $target; |
682 | $other->ob->message ($emote->{other}, cf::NDI_GREY | cf::NDI_UNIQUE); |
741 | $other->ob->message ($emote->{other}, cf::NDI_GREY | cf::NDI_UNIQUE); |
683 | } |
742 | } |
684 | |
743 | |
685 | $target->ob->message ($emote->{target}, cf::NDI_GREY | cf::NDI_UNIQUE); |
744 | $target->ob->message ($emote->{target}, cf::NDI_GREY | cf::NDI_UNIQUE); |
686 | $ob->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); |
745 | $pl->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); |
687 | } else { |
746 | } else { |
688 | my $emote = $emotes->{$emotion}->{noparams}; |
747 | my $emote = $emotes->{$emotion}->{noparams}; |
689 | $emote->{other} =~ s/<self>/$name/; |
748 | $emote->{other} =~ s/<self>/$name/; |
|
|
749 | |
|
|
750 | $emote->{other} = "<self> dances with glee." |
|
|
751 | if !$emote->{other}; |
|
|
752 | $emote->{self} = "You are a nut." |
|
|
753 | if !$emote->{self}; |
690 | |
754 | |
691 | for my $other ( grep { $ob->on_same_map_as ($_->ob) } cf::player::list ) { |
755 | for my $other ( grep { $pl->on_same_map_as ($_->ob) } cf::player::list ) { |
692 | next |
756 | next |
693 | if $other->ob == $ob; |
757 | if $other->ob == $pl; |
694 | $other->ob->message ($emote->{other}, cf::NDI_GREY | cf::NDI_UNIQUE); |
758 | $other->ob->message ($emote->{other}, cf::NDI_GREY | cf::NDI_UNIQUE); |
695 | } |
759 | } |
696 | |
760 | |
697 | $ob->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); |
761 | $pl->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); |
698 | } |
762 | } |
699 | }; |
763 | }; |
700 | |
|
|
701 | 1 |
|
|
702 | }; |
764 | }; |
703 | } |
765 | } |
704 | |
766 | |
|
|
767 | cf::register_command me => sub { |
|
|
768 | my ($pl, $msg) = @_; |
|
|
769 | |
|
|
770 | my $name = $pl->name; |
|
|
771 | |
|
|
772 | $_->ns->send_msg ($SAY_CHANNEL => "* $name $msg", cf::NDI_GREY, $_ == $pl ? (reply => 1) : ()) |
|
|
773 | for grep $pl->on_same_map_as ($_->ob), cf::player::list; |
|
|
774 | }; |
|
|
775 | |
705 | cf::register_command say => sub { |
776 | cf::register_command say => sub { |
706 | my ($who, $msg) = @_; |
777 | my ($ob, $msg) = @_; |
707 | |
778 | |
708 | utf8::decode $msg; |
779 | utf8::decode $msg; |
709 | |
780 | |
710 | return if $who->contr->invoke (cf::EVENT_PLAYER_SAY, $msg); |
781 | return if $ob->contr->invoke (cf::EVENT_PLAYER_SAY, $msg); |
711 | |
782 | |
712 | if ($msg) { |
783 | if ($msg) { |
713 | my $name = $who->name; |
784 | my $name = $ob->name; |
714 | |
|
|
715 | utf8::encode $msg; # ->message not yet utf8-ified |
|
|
716 | $_->ob->message ("$name says: $msg", cf::NDI_GREY | cf::NDI_UNIQUE) |
|
|
717 | for grep $who->on_same_map_as ($_->ob), cf::player::list; |
785 | my @plonmap = grep $ob->on_same_map_as ($_->ob), cf::player::list; |
718 | utf8::decode $msg; |
786 | |
|
|
787 | $_->ns->send_msg ($SAY_CHANNEL => "$name says: $msg", cf::NDI_GREY, $_ == $ob ? (reply => 1) : ()) |
|
|
788 | for @plonmap; |
719 | |
789 | |
720 | # npcs, magic_ears etc. |
790 | # npcs, magic_ears etc. |
721 | # first find all objects and theirt-level inventories |
791 | # first find all objects and their first-level inventories |
722 | # within a 5x5 square # that have something resembling |
792 | # within a 5x5 square that have something resembling |
723 | # dialogue or support on_say. |
793 | # dialogue or support on_say. |
724 | my ($map, $x, $y) = ($who->map, $who->x - 2, $who->y - 2); |
794 | my ($map, $x, $y) = ($ob->map, $ob->x - 2, $ob->y - 2); |
725 | |
795 | |
726 | for my $npc ( |
796 | for my $npc ( |
727 | grep +($_->invoke (cf::EVENT_OBJECT_SAY, $who->contr, $msg) && return) || NPC_Dialogue::has_dialogue $_, |
797 | grep +($_->invoke (cf::EVENT_OBJECT_SAY, $ob->contr, $msg) && return) || NPC_Dialogue::has_dialogue $_, |
728 | map +($_, $_->inv), |
798 | map +($_, $_->inv), |
729 | grep $_, |
799 | grep $_, |
730 | map $map->at ($x + $_ % 5, $y + (int $_ / 5)), |
800 | map $map->at ($x + $_ % 5, $y + (int $_ / 5)), |
731 | 0..24 |
801 | 0..24 |
732 | ) { |
802 | ) { |
733 | # if some listener teleported us somewhere else, stop right here |
803 | # if some listener teleported us somewhere else, stop right here |
734 | last unless $map->path == $who->map->path; |
804 | last unless $map->path == $ob->map->path; |
735 | |
805 | |
736 | my $dialog = new NPC_Dialogue ob => $who, npc => $npc; |
806 | my $dialog = new NPC_Dialogue pl => $ob->contr, npc => $npc; |
737 | my ($reply, @kw) = $dialog->tell ($msg); |
807 | my ($reply, @kw) = $dialog->tell ($msg); |
738 | |
808 | |
739 | if (defined $reply) { |
809 | if (defined $reply) { |
740 | if ($npc->type == cf::MAGIC_EAR) { |
810 | if ($npc->type == cf::MAGIC_EAR) { |
741 | if (length $reply) { |
811 | if (length $reply) { |
742 | $_->ob->message ($reply, cf::NDI_BROWN | cf::NDI_UNIQUE) |
812 | $_->ns->send_msg ($SAY_CHANNEL => $reply, cf::NDI_BROWN) |
743 | for grep $who->on_same_map_as ($_->ob), cf::player::list; |
813 | for @plonmap; |
744 | } |
814 | } |
745 | $npc->use_trigger; |
815 | $npc->use_trigger; |
746 | } else { |
816 | } else { |
747 | if (length $reply) { |
817 | if (length $reply) { |
748 | $_->ob->message ($npc->name . " says: $reply", cf::NDI_BROWN | cf::NDI_UNIQUE) |
818 | $_->ns->send_msg ($SAY_CHANNEL => $npc->name . " says: $reply", cf::NDI_BROWN) |
749 | for grep $who->on_same_map_as ($_->ob), cf::player::list; |
819 | for @plonmap; |
750 | } |
820 | } |
751 | } |
821 | } |
752 | } |
822 | } |
753 | |
823 | |
754 | if (@kw) { |
824 | if (@kw) { |
755 | $_->ob->message ("[further topics: " . (join ", ", @kw) . "]", cf::NDI_BROWN | cf::NDI_UNIQUE) |
825 | $_->ns->send_msg ($SAY_CHANNEL => "[further topics: " . (join ", ", @kw) . "]", cf::NDI_BROWN) |
756 | for grep $who->on_same_map_as ($_->ob), cf::player::list; |
826 | for @plonmap; |
757 | } |
827 | } |
758 | } |
828 | } |
759 | |
829 | |
760 | } else { |
830 | } else { |
761 | $who->message ("What do you want to say?", cf::NDI_UNIQUE); |
831 | $ob->contr->ns->send_msg ($SAY_CHANNEL => "What do you want to say?", 0, reply => 1); |
762 | } |
832 | } |
763 | |
|
|
764 | 1 |
|
|
765 | }; |
833 | }; |
766 | |
834 | |
767 | cf::register_command chat => sub { |
835 | cf::register_command chat => sub { |
768 | my ($who, $msg) = @_; |
836 | my ($ob, $msg) = @_; |
769 | |
837 | |
770 | utf8::decode $msg; |
838 | utf8::decode $msg; |
771 | |
839 | |
|
|
840 | my $pl = $ob->contr; |
|
|
841 | |
772 | return if $who->contr->invoke (cf::EVENT_PLAYER_CHAT, $msg); |
842 | return if $pl->invoke (cf::EVENT_PLAYER_CHAT, $msg); |
773 | |
843 | |
774 | if ($msg) { |
844 | if ($msg) { |
775 | my $name = $who->name; |
845 | my $name = $ob->name; |
776 | my $NOW = time; |
846 | my $NOW = time; |
777 | |
847 | |
778 | utf8::encode $msg; # ->message not yet utf8-ified |
|
|
779 | cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; |
848 | cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; |
780 | ext::schmorp_irc::do_notice (sprintf "[%s] %s", $name, $msg); |
849 | send_irc ("[%s] %s", $name, $msg); |
781 | |
850 | |
782 | $_->ob->message ("$name chats: $msg", cf::NDI_BLUE) |
851 | $_->ns->send_msg ($CHAT_CHANNEL => "$name chats: $msg", cf::NDI_BLUE, $_ == $pl ? (reply => 1) : ()) |
783 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; |
852 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; |
784 | |
853 | |
785 | } else { |
854 | } else { |
786 | $who->message ("Chat what?", cf::NDI_UNIQUE); |
855 | $pl->ns->send_msg ($CHAT_CHANNEL => "Chat what?"); |
787 | } |
856 | } |
788 | |
|
|
789 | 1 |
|
|
790 | }; |
857 | }; |
791 | |
858 | |
792 | cf::register_command shout => sub { |
859 | cf::register_command shout => sub { |
793 | my ($who, $msg) = @_; |
860 | my ($ob, $msg) = @_; |
794 | |
861 | |
795 | utf8::decode $msg; |
862 | utf8::decode $msg; |
796 | |
863 | |
|
|
864 | my $pl = $ob->contr; |
|
|
865 | |
797 | return if $who->contr->invoke (cf::EVENT_PLAYER_SHOUT, $msg); |
866 | return if $pl->invoke (cf::EVENT_PLAYER_SHOUT, $msg); |
798 | |
867 | |
799 | if ($msg) { |
868 | if ($msg) { |
800 | my $NOW = time; |
869 | my $NOW = time; |
801 | my $name = $who->name; |
870 | my $name = $ob->name; |
802 | |
871 | |
803 | cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; |
872 | cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; |
804 | ext::schmorp_irc::do_notice (sprintf "\007\0034{%s} %s\n", $name, $msg); |
873 | send_irc ("\007\0034{%s} %s\n", $name, $msg); |
805 | |
874 | |
806 | utf8::encode $msg; # ->message not yet utf8-ified |
875 | $_->ns->send_msg ($CHAT_CHANNEL => "$name shouts: $msg", cf::NDI_RED, $_ == $pl ? (reply => 1) : ()) |
807 | $_->ob->message ("$name shouts: $msg", cf::NDI_RED) |
|
|
808 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 2 } cf::player::list; |
876 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 2 } cf::player::list; |
809 | |
877 | |
810 | } else { |
878 | } else { |
811 | $who->message ("Shout what?", cf::NDI_UNIQUE); |
879 | $pl->ns->send_msg ($CHAT_CHANNEL => "Shout what?"); |
812 | } |
880 | } |
813 | |
|
|
814 | 1 |
|
|
815 | }; |
881 | }; |
816 | |
882 | |
817 | cf::register_command tell => sub { |
883 | cf::register_command tell => sub { |
818 | my ($who, $args) = @_; |
884 | my ($ob, $args) = @_; |
819 | my ($target, $msg) = split /\s+/, $args, 2; |
885 | my ($target, $msg) = split /\s+/, $args, 2; |
820 | |
886 | |
821 | utf8::decode $msg; |
887 | utf8::decode $msg; |
822 | |
888 | |
823 | return if $who->contr->invoke (cf::EVENT_PLAYER_TELL, $target, $msg); |
889 | my $pl = $ob->contr; |
824 | |
890 | my $ns = $pl->ns |
|
|
891 | or return; |
825 | my $name = $who->name; |
892 | my $name = $ob->name; |
|
|
893 | |
|
|
894 | return if $pl->invoke (cf::EVENT_PLAYER_TELL, $target, $msg); |
|
|
895 | |
|
|
896 | my $pl_channel = { |
|
|
897 | id => "tell-$target", |
|
|
898 | title => "$target", |
|
|
899 | reply => "tell $target ", |
|
|
900 | tooltip => "Private messages from/to $target", |
|
|
901 | }; |
826 | |
902 | |
827 | if ($target =~ /irc\//) { |
903 | if ($target =~ /irc\//) { |
828 | my (undef, $nick) = split /\//, $target, 2; |
904 | my (undef, $nick) = split /\//, $target, 2; |
829 | $who->message ("You tell $target: $args"); |
905 | $ns->send_msg ($pl_channel => "You tell $target: $args", reply => 1); |
830 | ext::schmorp_irc::do_notice (sprintf "(%s) %s: %s\n", $name, $nick, $msg); |
906 | send_irc ("(%s) %s: %s\n", $name, $nick, $msg); |
831 | } elsif (my $other = cf::player::find_active $target) { |
907 | } elsif (my $other = cf::player::find_active $target) { |
|
|
908 | my $other_channel = { |
|
|
909 | id => "tell-$name", |
|
|
910 | title => "$name", |
|
|
911 | reply => "tell $name ", |
|
|
912 | tooltip => "Private messages from/to $name", |
|
|
913 | }; |
832 | |
914 | |
833 | if ($msg) { |
915 | if ($msg) { |
834 | if ($target eq $name) { |
916 | if ($target eq $name) { |
835 | $who->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE); |
917 | $ns->send_msg ($pl_channel => "You are talking to yourself, you freak!", reply => 1); |
836 | } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) { |
918 | } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) { |
837 | $who->message ("$target ignores what you say. Give up on it.", cf::NDI_UNIQUE); |
919 | $ns->send_msg ($pl_channel => "$target ignores what you say. Give up on it.", reply => 1); |
838 | } else { |
920 | } else { |
839 | utf8::encode $msg; # ->message not yet utf8-ified |
921 | return if $other->invoke (cf::EVENT_PLAYER_TOLD, $pl, $msg); |
840 | cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $target, $msg; |
922 | cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $target, $msg; |
841 | |
923 | |
842 | $who->message ("You tell $target: $msg"); |
924 | $ns->send_msg ($pl_channel => "You tell $target: $msg", reply => 1); |
843 | $other->ob->message ("$name tells you: $msg"); |
925 | $other->ns->send_msg ($other_channel => "$name tells you: $msg"); |
844 | $other->ob->{ext_last_tell} = $name; |
|
|
845 | } |
926 | } |
846 | } else { |
927 | } else { |
847 | $who->message ("What do you want to tell $target?", cf::NDI_UNIQUE); |
928 | $ns->send_msg ($pl_channel => "What do you want to tell $target?"); |
848 | } |
929 | } |
849 | |
930 | |
850 | } else { |
931 | } else { |
851 | $who->message ("No such player. Your message: $msg", cf::NDI_UNIQUE); |
932 | $ns->send_msg ($pl_channel => "No such player. Your message: $msg"); |
852 | } |
933 | } |
853 | |
|
|
854 | 1 |
|
|
855 | }; |
934 | }; |
856 | |
935 | |
857 | cf::register_command reply => sub { |
936 | cf::register_command ignore => sub { |
858 | my ($who, $args) = @_; |
937 | my ($pl, $args) = @_; |
859 | my $name = $who->name; |
938 | my ($target, $type, $timeout) = split /\s+/, $args; |
860 | |
939 | |
861 | utf8::decode $args; |
940 | if ($args eq "list") { |
|
|
941 | clean_timeouts $pl; |
862 | |
942 | |
863 | return if $who->contr->invoke (cf::EVENT_PLAYER_TELL, $who->{ext_last_tell}, $args); |
943 | if ((my @ignored_tell = sort keys %{$pl->{ext_ignore_tell}}) |
|
|
944 | + (my @ignored_shout = sort keys %{$pl->{ext_ignore_shout}})) { |
|
|
945 | $pl->message ("Currently ignoring private messages from: ", cf::NDI_UNIQUE); |
|
|
946 | $pl->message ((join ", ", @ignored_tell), cf::NDI_UNIQUE); |
|
|
947 | $pl->message ("Currently ignoring shouts from: ", cf::NDI_UNIQUE); |
|
|
948 | $pl->message ((join ", ", @ignored_shout), cf::NDI_UNIQUE); |
|
|
949 | $pl->message ("To stop ignoring one, use unignore.", cf::NDI_UNIQUE); |
|
|
950 | } else { |
|
|
951 | $pl->message ("Not ignoring anyone", cf::NDI_UNIQUE); |
|
|
952 | } |
864 | |
953 | |
865 | if ($who->{ext_last_tell} =~ /irc\//) { |
954 | } elsif ($target && $type) { |
866 | my (undef, $nick) = split /\//, $who->{ext_last_tell}, 2; |
|
|
867 | $who->message ("You tell " . $who->{ext_last_tell} . ": $args"); |
|
|
868 | ext::schmorp_irc::do_notice (sprintf "(%s) %s: %s\n", $name, $nick, $args); |
|
|
869 | } elsif (my $other = cf::player::find_active $who->{ext_last_tell}) { |
|
|
870 | |
955 | |
871 | if ($args) { |
956 | $timeout ne "" or $timeout = 24; |
872 | $other->ob->{ext_ignore_tell}{$name} >= time |
957 | my $absolute_timeout = time + $timeout * 3600; |
873 | or delete $other->ob->{ext_ignore_tell}{$name}; |
|
|
874 | |
958 | |
875 | if ($other->ob->{ext_ignore_tell}{$name} < time) { |
959 | if (cf::player::exists $target) { |
876 | utf8::encode $args; # ->message not yet utf8-ified |
960 | if ($type eq "tell") { |
877 | cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $other->ob->name, $args; |
961 | $pl->message ("Now ignoring private messages from $target for $timeout hours.", cf::NDI_UNIQUE); |
878 | |
962 | $pl->{ext_ignore_tell}{$target} = $absolute_timeout; |
879 | $who->message ("You tell " . $other->ob->name . ": $args"); |
963 | } elsif ($type eq "shout") { |
880 | $other->ob->message ("$name tells you: $args"); |
964 | $pl->message ("Now ignoring shouts from $target for $timeout hours.", cf::NDI_UNIQUE); |
881 | $who->{ext_last_tell} = $other->ob->name; |
965 | $pl->{ext_ignore_shout}{$target} = $absolute_timeout; |
|
|
966 | } elsif ($type eq "all") { |
|
|
967 | $pl->message ("Now ignoring everything from $target for $timeout hours.", cf::NDI_UNIQUE); |
|
|
968 | $pl->{ext_ignore_tell}{$target} = $absolute_timeout; |
|
|
969 | $pl->{ext_ignore_shout}{$target} = $absolute_timeout; |
882 | } else { |
970 | } else { |
883 | $who->message ($other->ob->name . " ignores what you say. Give up on it.", cf::NDI_UNIQUE); |
971 | $pl->message ("You need to specify tell, shout or all.", cf::NDI_UNIQUE); |
884 | } |
972 | } |
885 | } else { |
973 | } else { |
886 | $who->message ("What do you want to tell ".$other->ob->name."?", cf::NDI_UNIQUE); |
974 | $pl->message ("No such player: $target", cf::NDI_UNIQUE); |
887 | } |
975 | } |
888 | |
976 | |
889 | } else { |
977 | } else { |
890 | $who->message ("Can't reply, player left. Your message: $args".$who->{ext_last_tell}, cf::NDI_UNIQUE); |
|
|
891 | } |
|
|
892 | |
|
|
893 | 1 |
|
|
894 | }; |
|
|
895 | |
|
|
896 | cf::register_command ignore => sub { |
|
|
897 | my ($who, $args) = @_; |
|
|
898 | my ($target, $type, $timeout) = split /\s+/, $args; |
|
|
899 | |
|
|
900 | if ($args eq "list") { |
|
|
901 | clean_timeouts $who; |
|
|
902 | |
|
|
903 | if ((my @ignored_tell = sort keys %{$who->{ext_ignore_tell}}) |
|
|
904 | + (my @ignored_shout = sort keys %{$who->{ext_ignore_shout}})) { |
|
|
905 | $who->message ("Currently ignoring private messages from: ", cf::NDI_UNIQUE); |
|
|
906 | $who->message ((join ", ", @ignored_tell), cf::NDI_UNIQUE); |
|
|
907 | $who->message ("Currently ignoring shouts from: ", cf::NDI_UNIQUE); |
|
|
908 | $who->message ((join ", ", @ignored_shout), cf::NDI_UNIQUE); |
|
|
909 | $who->message ("To stop ignoring one, use unignore.", cf::NDI_UNIQUE); |
|
|
910 | } else { |
|
|
911 | $who->message ("Not ignoring anyone", cf::NDI_UNIQUE); |
|
|
912 | } |
|
|
913 | |
|
|
914 | } elsif ($target && $type) { |
|
|
915 | |
|
|
916 | $timeout ne "" or $timeout = 24; |
|
|
917 | my $absolute_timeout = time + $timeout * 3600; |
|
|
918 | |
|
|
919 | if (cf::player::exists $target) { |
|
|
920 | if ($type eq "tell") { |
|
|
921 | $who->message ("Now ignoring private messages from $target for $timeout hours.", cf::NDI_UNIQUE); |
|
|
922 | $who->{ext_ignore_tell}{$target} = $absolute_timeout; |
|
|
923 | } elsif ($type eq "shout") { |
|
|
924 | $who->message ("Now ignoring shouts from $target for $timeout hours.", cf::NDI_UNIQUE); |
|
|
925 | $who->{ext_ignore_shout}{$target} = $absolute_timeout; |
|
|
926 | } elsif ($type eq "all") { |
|
|
927 | $who->message ("Now ignoring everything from $target for $timeout hours.", cf::NDI_UNIQUE); |
|
|
928 | $who->{ext_ignore_tell}{$target} = $absolute_timeout; |
|
|
929 | $who->{ext_ignore_shout}{$target} = $absolute_timeout; |
|
|
930 | } else { |
|
|
931 | $who->message ("You need to specify tell, shout or all.", cf::NDI_UNIQUE); |
|
|
932 | } |
|
|
933 | } else { |
|
|
934 | $who->message ("No such player: $target", cf::NDI_UNIQUE); |
|
|
935 | } |
|
|
936 | |
|
|
937 | } else { |
|
|
938 | $who->message ("Usage: ignore <player> <tell|shout|all> <timeout>\n" |
978 | $pl->message ("Usage: ignore <player> <tell|shout|all> <timeout>\n" |
939 | . "will ignore a player for <timeout> hours.\n" |
979 | . "will ignore a player for <timeout> hours.\n" |
940 | . "Usage: ignore list\n" |
980 | . "Usage: ignore list\n" |
941 | . "will show you a list of players currently ignored.", cf::NDI_UNIQUE); |
981 | . "will show you a list of players currently ignored.", cf::NDI_UNIQUE); |
942 | } |
982 | } |
943 | |
|
|
944 | 1 |
|
|
945 | }; |
983 | }; |
946 | |
984 | |
947 | cf::register_command unignore => sub { |
985 | cf::register_command unignore => sub { |
948 | my ($who, $args) = @_; |
986 | my ($pl, $args) = @_; |
949 | my ($target, $type) = split /\s+/, $args; |
987 | my ($target, $type) = split /\s+/, $args; |
950 | |
988 | |
951 | if ($args eq "") { |
989 | if ($args eq "") { |
952 | if ($who->{ext_ignore_tell}) { |
990 | if ($pl->{ext_ignore_tell}) { |
953 | $who->message ("Currently ignoring private messages from: ", cf::NDI_UNIQUE); |
991 | $pl->message ("Currently ignoring private messages from: ", cf::NDI_UNIQUE); |
954 | $who->message ((join ", ", sort keys %{ $who->{ext_ignore_tell} }), cf::NDI_UNIQUE); |
992 | $pl->message ((join ", ", sort keys %{ $pl->{ext_ignore_tell} }), cf::NDI_UNIQUE); |
955 | $who->message ("Currently ignoring shouts from: ", cf::NDI_UNIQUE); |
993 | $pl->message ("Currently ignoring shouts from: ", cf::NDI_UNIQUE); |
956 | $who->message ((join ", ", sort keys %{ $who->{ext_ignore_shout} }), cf::NDI_UNIQUE); |
994 | $pl->message ((join ", ", sort keys %{ $pl->{ext_ignore_shout} }), cf::NDI_UNIQUE); |
957 | } else { |
995 | } else { |
958 | $who->message ("Not ignoring anyone", cf::NDI_UNIQUE); |
996 | $pl->message ("Not ignoring anyone", cf::NDI_UNIQUE); |
959 | } |
997 | } |
960 | } else { |
998 | } else { |
961 | if (cf::player::exists $target) { |
999 | if (cf::player::exists $target) { |
962 | if ($type eq "tell") { |
1000 | if ($type eq "tell") { |
963 | $who->message ("Not ignoring private messages from $target anymore.", cf::NDI_UNIQUE); |
1001 | $pl->message ("Not ignoring private messages from $target anymore.", cf::NDI_UNIQUE); |
964 | delete $who->{ext_ignore_tell} {$target}; |
1002 | delete $pl->{ext_ignore_tell} {$target}; |
965 | } elsif ($type eq "shout") { |
1003 | } elsif ($type eq "shout") { |
966 | $who->message ("Not ignoring shouts from $target anymore.", cf::NDI_UNIQUE); |
1004 | $pl->message ("Not ignoring shouts from $target anymore.", cf::NDI_UNIQUE); |
967 | delete $who->{ext_ignore_shout}{$target}; |
1005 | delete $pl->{ext_ignore_shout}{$target}; |
968 | } elsif ($type eq "all") { |
1006 | } elsif ($type eq "all") { |
969 | $who->message ("Not ignoring anything from $target anymore.", cf::NDI_UNIQUE); |
1007 | $pl->message ("Not ignoring anything from $target anymore.", cf::NDI_UNIQUE); |
970 | delete $who->{ext_ignore_tell} {$target}; |
1008 | delete $pl->{ext_ignore_tell} {$target}; |
971 | delete $who->{ext_ignore_shout}{$target}; |
1009 | delete $pl->{ext_ignore_shout}{$target}; |
972 | } else { |
1010 | } else { |
973 | $who->message ("You need to specify tell, shout or all.", cf::NDI_UNIQUE); |
1011 | $pl->message ("You need to specify tell, shout or all.", cf::NDI_UNIQUE); |
974 | } |
1012 | } |
975 | } else { |
1013 | } else { |
976 | $who->message ("No such player or ambiguous name: $target", cf::NDI_UNIQUE); |
1014 | $pl->message ("No such player or ambiguous name: $target", cf::NDI_UNIQUE); |
977 | } |
1015 | } |
978 | } |
1016 | } |
979 | |
|
|
980 | 1 |
|
|
981 | }; |
1017 | }; |
982 | |
1018 | |
983 | cf::register_command seen => sub { |
|
|
984 | my ($who, $args) = @_; |
|
|
985 | |
|
|
986 | if (my ($login) = $args =~ /(\S+)/) { |
|
|
987 | if ($login eq $who->name) { |
|
|
988 | $who->message ("Very funny, $login. Ha. Ha.", cf::NDI_UNIQUE); |
|
|
989 | } elsif (cf::player::find_active $login) { |
|
|
990 | $who->message ("$login is right here on this server!", cf::NDI_UNIQUE); |
|
|
991 | } elsif (cf::player::exists $login |
|
|
992 | and stat sprintf "%s/%s/%s/%s.pl", cf::localdir, cf::playerdir, ($login) x 2) { |
|
|
993 | my $time = (stat _)[9]; |
|
|
994 | |
|
|
995 | $who->message ("$login was last seen here " |
|
|
996 | . (POSIX::strftime "%Y-%m-%d %H:%M:%S +0000", gmtime $time) |
|
|
997 | . " which was " . (int +(time - $time) / 3600) . " hours ago.", cf::NDI_UNIQUE); |
|
|
998 | } else { |
|
|
999 | $who->message ("No player named $login is known to me.", cf::NDI_UNIQUE); |
|
|
1000 | } |
|
|
1001 | } else { |
|
|
1002 | $who->message ("Usage: seen <player>", cf::NDI_UNIQUE); |
|
|
1003 | } |
|
|
1004 | |
|
|
1005 | 1 |
|
|
1006 | }; |
|
|
1007 | |
|
|