… | |
… | |
29 | on_login => sub { |
29 | on_login => sub { |
30 | my ($pl) = @_; |
30 | my ($pl) = @_; |
31 | |
31 | |
32 | clean_timeouts $pl->ob; |
32 | clean_timeouts $pl->ob; |
33 | }, |
33 | }, |
|
|
34 | |
|
|
35 | 1 |
34 | ); |
36 | ); |
35 | |
37 | |
36 | cf::register_command listen => sub { |
38 | cf::register_command listen => sub { |
37 | my ($who, $msg) = @_; |
39 | my ($who, $msg) = @_; |
38 | my $player = cf::player::find_active $who->name; |
40 | my $player = cf::player::find_active $who->name; |
… | |
… | |
46 | $who->message ("Your verbose level is now " . $player->listening . ". (previously: $prev_listen)", cf::NDI_UNIQUE); |
48 | $who->message ("Your verbose level is now " . $player->listening . ". (previously: $prev_listen)", cf::NDI_UNIQUE); |
47 | } |
49 | } |
48 | } else { |
50 | } else { |
49 | $who->message ("Your verbose level is " . $player->listening . ".", cf::NDI_UNIQUE); |
51 | $who->message ("Your verbose level is " . $player->listening . ".", cf::NDI_UNIQUE); |
50 | } |
52 | } |
|
|
53 | |
|
|
54 | 1 |
51 | }; |
55 | }; |
|
|
56 | |
|
|
57 | my $emotes = { |
|
|
58 | growl => { |
|
|
59 | noparams => { |
|
|
60 | other => "<self> growls." |
|
|
61 | self => "Grrrrrrrrr...." |
|
|
62 | }, |
|
|
63 | params => { |
|
|
64 | }, |
|
|
65 | self => { |
|
|
66 | }, |
|
|
67 | }, |
|
|
68 | giggle => { |
|
|
69 | noparams => { |
|
|
70 | other => "<self> giggles." |
|
|
71 | self => "You giggle." |
|
|
72 | }, |
|
|
73 | params => { |
|
|
74 | }, |
|
|
75 | self => { |
|
|
76 | }, |
|
|
77 | }, |
|
|
78 | shiver => { |
|
|
79 | noparams => { |
|
|
80 | other => "<self> shivers uncomfortably." |
|
|
81 | self => "Brrrrrrrrr." |
|
|
82 | }, |
|
|
83 | params => { |
|
|
84 | }, |
|
|
85 | self => { |
|
|
86 | }, |
|
|
87 | }, |
|
|
88 | chuckle => { |
|
|
89 | noparams => { |
|
|
90 | other => "<self> chuckles politely." |
|
|
91 | self => "You chuckle politely" |
|
|
92 | }, |
|
|
93 | params => { |
|
|
94 | }, |
|
|
95 | self => { |
|
|
96 | }, |
|
|
97 | }, |
|
|
98 | sigh => { |
|
|
99 | noparams => { |
|
|
100 | other => "<self> sighs loudly." |
|
|
101 | self => "You sigh." |
|
|
102 | }, |
|
|
103 | params => { |
|
|
104 | }, |
|
|
105 | self => { |
|
|
106 | }, |
|
|
107 | }, |
|
|
108 | scream => { |
|
|
109 | noparams => { |
|
|
110 | other => "<self> screams at the top of his lungs!" |
|
|
111 | self => "ARRRRRRRRRRGH!!!!!" |
|
|
112 | }, |
|
|
113 | params => { |
|
|
114 | }, |
|
|
115 | self => { |
|
|
116 | }, |
|
|
117 | }, |
|
|
118 | puke => { |
|
|
119 | noparams => { |
|
|
120 | other => "<self> pukes." |
|
|
121 | self => "Bleaaaaaghhhhhhh!" |
|
|
122 | }, |
|
|
123 | params => { |
|
|
124 | target => "<self> pukes on your clothes!" |
|
|
125 | other => "<self> pukes on <other>." |
|
|
126 | self => "You puke on <other>." |
|
|
127 | }, |
|
|
128 | self => { |
|
|
129 | other => "<self> pukes on his clothes." |
|
|
130 | self => "You puke on yourself." |
|
|
131 | }, |
|
|
132 | }, |
|
|
133 | strut => { |
|
|
134 | noparams => { |
|
|
135 | other => "<self> struts proudly." |
|
|
136 | self => "Strut your stuff." |
|
|
137 | }, |
|
|
138 | params => { |
|
|
139 | }, |
|
|
140 | self => { |
|
|
141 | }, |
|
|
142 | }, |
|
|
143 | cringe => { |
|
|
144 | noparams => { |
|
|
145 | other => "<self> cringes in terror!" |
|
|
146 | self => "You cringe in terror." |
|
|
147 | }, |
|
|
148 | params => { |
|
|
149 | target => "<self> cringes away from <other> in mortal terror." |
|
|
150 | self => "You cringe away from <other>." |
|
|
151 | }, |
|
|
152 | self => { |
|
|
153 | }, |
|
|
154 | }, |
|
|
155 | hiccup => { |
|
|
156 | noparams => { |
|
|
157 | other => "<self> hiccups." |
|
|
158 | self => "*HIC*" |
|
|
159 | }, |
|
|
160 | params => { |
|
|
161 | }, |
|
|
162 | self => { |
|
|
163 | }, |
|
|
164 | }, |
|
|
165 | clap => { |
|
|
166 | noparams => { |
|
|
167 | other => "<self> gives a round of applause." |
|
|
168 | self => "Clap, clap, clap." |
|
|
169 | }, |
|
|
170 | params => { |
|
|
171 | }, |
|
|
172 | self => { |
|
|
173 | }, |
|
|
174 | }, |
|
|
175 | kiss => { |
|
|
176 | noparams => { |
|
|
177 | other => "<self> makes a weird facial contortion" |
|
|
178 | self => "All the lonely people.." |
|
|
179 | }, |
|
|
180 | params => { |
|
|
181 | target => "<self> kisses you." |
|
|
182 | other => "<self> kisses <other>." |
|
|
183 | self => "You kiss <other>." |
|
|
184 | }, |
|
|
185 | self => { |
|
|
186 | }, |
|
|
187 | }, |
|
|
188 | wink => { |
|
|
189 | noparams => { |
|
|
190 | other => "<self> winks suggestively." |
|
|
191 | self => "Have you got something in your eye?" |
|
|
192 | }, |
|
|
193 | params => { |
|
|
194 | target => "<self> winks at <other>." |
|
|
195 | self => "You wink suggestively at <other>." |
|
|
196 | }, |
|
|
197 | self => { |
|
|
198 | other => "<self> winks at himself - something strange is going on..." |
|
|
199 | self => "You wink at yourself?? What are you up to?" |
|
|
200 | }, |
|
|
201 | }, |
|
|
202 | pout => { |
|
|
203 | noparams => { |
|
|
204 | other => "<self> pouts." |
|
|
205 | self => "Aww, don't take it so hard." |
|
|
206 | }, |
|
|
207 | params => { |
|
|
208 | }, |
|
|
209 | self => { |
|
|
210 | }, |
|
|
211 | }, |
|
|
212 | cackle => { |
|
|
213 | noparams => { |
|
|
214 | other => "<self> throws back his head and cackles with insane glee!" |
|
|
215 | self => "You cackle gleefully." |
|
|
216 | }, |
|
|
217 | params => { |
|
|
218 | }, |
|
|
219 | self => { |
|
|
220 | }, |
|
|
221 | }, |
|
|
222 | sniff => { |
|
|
223 | noparams => { |
|
|
224 | other => "<self> sniffs sadly." |
|
|
225 | self => "You sniff sadly. *SNIFF*" |
|
|
226 | }, |
|
|
227 | params => { |
|
|
228 | target => "<self> sniffs you." |
|
|
229 | other => "<self> sniffs <other>" |
|
|
230 | self => "You sniff <other>." |
|
|
231 | }, |
|
|
232 | self => { |
|
|
233 | other => "<self> sniffs himself." |
|
|
234 | self => "You sniff yourself." |
|
|
235 | }, |
|
|
236 | }, |
|
|
237 | nod => { |
|
|
238 | noparams => { |
|
|
239 | other => "<self> nods solemnly." |
|
|
240 | self => "You nod solemnly." |
|
|
241 | }, |
|
|
242 | params => { |
|
|
243 | target => "<self> nods solemnly to you." |
|
|
244 | other => "<self> nods solemnly to <other>." |
|
|
245 | self => "You nod solemnly to <other>." |
|
|
246 | }, |
|
|
247 | self => { |
|
|
248 | }, |
|
|
249 | }, |
|
|
250 | frown => { |
|
|
251 | noparams => { |
|
|
252 | other => "<self> frowns." |
|
|
253 | self => "What's bothering you?" |
|
|
254 | }, |
|
|
255 | params => { |
|
|
256 | target => "<self> frowns darkly at you." |
|
|
257 | other => "<self> frowns darkly at <other>." |
|
|
258 | self => "You frown darkly at <other>." |
|
|
259 | }, |
|
|
260 | self => { |
|
|
261 | other => "<self> frowns at himself." |
|
|
262 | self => "You frown at yourself." |
|
|
263 | }, |
|
|
264 | }, |
|
|
265 | snicker => { |
|
|
266 | noparams => { |
|
|
267 | other => "<self> snickers softly." |
|
|
268 | self => "You snicker softly." |
|
|
269 | }, |
|
|
270 | params => { |
|
|
271 | }, |
|
|
272 | self => { |
|
|
273 | }, |
|
|
274 | }, |
|
|
275 | shrug => { |
|
|
276 | noparams => { |
|
|
277 | other => "<self> shrugs helplessly." |
|
|
278 | self => "You shrug." |
|
|
279 | }, |
|
|
280 | params => { |
|
|
281 | target => "<self> shrugs at you." |
|
|
282 | other => "<self> shrugs at <other>." |
|
|
283 | self => "You shrug at <other>." |
|
|
284 | }, |
|
|
285 | self => { |
|
|
286 | }, |
|
|
287 | }, |
|
|
288 | bleed => { |
|
|
289 | noparams => { |
|
|
290 | other => "<self> is bleeding all over the carpet - got a spare tourniquet?" |
|
|
291 | self => "You bleed all over your nice new armour." |
|
|
292 | }, |
|
|
293 | params => { |
|
|
294 | target => "<self> slashes his wrist and bleeds all over <other>." |
|
|
295 | self => "You slash your wrist and bleed all over <other>" |
|
|
296 | }, |
|
|
297 | self => { |
|
|
298 | other => "<self> performs some satanic ritual while wiping his blood on himself." |
|
|
299 | self => "Very impressive! You wipe your blood all over yourself." |
|
|
300 | }, |
|
|
301 | }, |
|
|
302 | twiddle => { |
|
|
303 | noparams => { |
|
|
304 | other => "<self> patiently twiddles his thumbs." |
|
|
305 | self => "You patiently twiddle your thumbs." |
|
|
306 | }, |
|
|
307 | params => { |
|
|
308 | }, |
|
|
309 | self => { |
|
|
310 | }, |
|
|
311 | }, |
|
|
312 | spit => { |
|
|
313 | noparams => { |
|
|
314 | other => "<self> spits over his left shoulder." |
|
|
315 | self => "You spit over your left shoulder." |
|
|
316 | }, |
|
|
317 | params => { |
|
|
318 | target => "<self> spits in your face!" |
|
|
319 | other => "<self> spits in <other>'s face." |
|
|
320 | self => "You spit on <other>." |
|
|
321 | }, |
|
|
322 | self => { |
|
|
323 | other => "<self> drools all over himself." |
|
|
324 | self => "You drool all over yourself." |
|
|
325 | }, |
|
|
326 | }, |
|
|
327 | glare => { |
|
|
328 | noparams => { |
|
|
329 | other => "<self> glares around him." |
|
|
330 | self => "You glare at nothing in particular." |
|
|
331 | }, |
|
|
332 | params => { |
|
|
333 | target => "<self> glares icily at you, you feel cold to your bones." |
|
|
334 | other => "<self> glares at <other>." |
|
|
335 | self => "You glare icily at <other>." |
|
|
336 | }, |
|
|
337 | self => { |
|
|
338 | other => "<self> glares at his feet, what is bothering him?" |
|
|
339 | self => "You glare icily at your feet, they are suddenly very cold." |
|
|
340 | }, |
|
|
341 | }, |
|
|
342 | bow => { |
|
|
343 | noparams => { |
|
|
344 | other => "<self> bows deeply." |
|
|
345 | self => "You bow deeply." |
|
|
346 | }, |
|
|
347 | params => { |
|
|
348 | target => "<self> bows before you." |
|
|
349 | other => "<self> bows before <other>." |
|
|
350 | self => "You bow before <other>." |
|
|
351 | }, |
|
|
352 | self => { |
|
|
353 | other => "<self> folds up like a jackknife and kisses his own toes." |
|
|
354 | self => "You kiss your toes." |
|
|
355 | }, |
|
|
356 | }, |
|
|
357 | dance => { |
|
|
358 | noparams => { |
|
|
359 | other => "<self> expresses himself through interpretive dance." |
|
|
360 | self => "You dance with glee." |
|
|
361 | }, |
|
|
362 | params => { |
|
|
363 | target => "<self> grabs you, and begins dancing!" |
|
|
364 | other => "Yipe! <self> and <other> are doing the Macarena!" |
|
|
365 | self => "You grab <other> and begin doing the Cha-Cha!" |
|
|
366 | }, |
|
|
367 | self => { |
|
|
368 | other => "<self> embraces himself and begins to dance!" |
|
|
369 | 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 | }, |
|
|
386 | }, |
|
|
387 | snore => { |
|
|
388 | noparams => { |
|
|
389 | other => "<self> snores loudly." |
|
|
390 | self => "Zzzzzzzzzzzzzzz." |
|
|
391 | }, |
|
|
392 | params => { |
|
|
393 | }, |
|
|
394 | self => { |
|
|
395 | }, |
|
|
396 | }, |
|
|
397 | blush => { |
|
|
398 | noparams => { |
|
|
399 | other => "<self> blushes." |
|
|
400 | self => "Your cheeks are burning." |
|
|
401 | }, |
|
|
402 | params => { |
|
|
403 | }, |
|
|
404 | self => { |
|
|
405 | }, |
|
|
406 | }, |
|
|
407 | snap => { |
|
|
408 | noparams => { |
|
|
409 | other => "<self> snaps his fingers." |
|
|
410 | self => "PRONTO! you snap your fingers." |
|
|
411 | }, |
|
|
412 | params => { |
|
|
413 | }, |
|
|
414 | self => { |
|
|
415 | }, |
|
|
416 | }, |
|
|
417 | wave => { |
|
|
418 | noparams => { |
|
|
419 | other => "<self> waves happily." |
|
|
420 | self => "You wave." |
|
|
421 | }, |
|
|
422 | params => { |
|
|
423 | target => "<self> waves goodbye to you. Have a good journey." |
|
|
424 | other => "<self> waves goodbye to <other>." |
|
|
425 | self => "You wave goodbye to <other>." |
|
|
426 | }, |
|
|
427 | self => { |
|
|
428 | other => "<self> waves goodbye to himself." |
|
|
429 | self => "Are you going on adventures as well??" |
|
|
430 | }, |
|
|
431 | }, |
|
|
432 | smile => { |
|
|
433 | noparams => { |
|
|
434 | other => "<self> smiles happily." |
|
|
435 | self => "You smile happily." |
|
|
436 | }, |
|
|
437 | params => { |
|
|
438 | target => "<self> smiles at you." |
|
|
439 | other => "<self> beams a smile at <other>." |
|
|
440 | self => "You smile at <other>." |
|
|
441 | }, |
|
|
442 | self => { |
|
|
443 | }, |
|
|
444 | }, |
|
|
445 | sneeze => { |
|
|
446 | noparams => { |
|
|
447 | other => "<self> sneezes." |
|
|
448 | self => "Gesundheit!" |
|
|
449 | }, |
|
|
450 | params => { |
|
|
451 | 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." |
|
|
453 | self => "You sneeze at <other> and a film of snot shoots onto him." |
|
|
454 | }, |
|
|
455 | self => { |
|
|
456 | other => "<self> sneezes, and covers himself in a slimy substance." |
|
|
457 | self => "You sneeze on yourself, what a mess!" |
|
|
458 | }, |
|
|
459 | }, |
|
|
460 | bounce => { |
|
|
461 | noparams => { |
|
|
462 | other => "<self> bounces around." |
|
|
463 | self => "BOIINNNNNNGG!" |
|
|
464 | }, |
|
|
465 | params => { |
|
|
466 | target => "<self> bounces around the room with you." |
|
|
467 | other => "<self> bounces around the room with <other>." |
|
|
468 | self => "You bounce around the room with <other>." |
|
|
469 | }, |
|
|
470 | self => { |
|
|
471 | }, |
|
|
472 | }, |
|
|
473 | shake => { |
|
|
474 | noparams => { |
|
|
475 | other => "<self> shakes his head." |
|
|
476 | self => "You shake your head." |
|
|
477 | }, |
|
|
478 | params => { |
|
|
479 | target => "<self> shakes your hand." |
|
|
480 | other => "<self> shakes <other>'s hand." |
|
|
481 | self => "You shake <other>'s hand." |
|
|
482 | }, |
|
|
483 | self => { |
|
|
484 | other => "<self> shakes and quivers like a bowlful of jelly." |
|
|
485 | self => "You are shaken by yourself." |
|
|
486 | }, |
|
|
487 | }, |
|
|
488 | lick => { |
|
|
489 | noparams => { |
|
|
490 | other => "<self> licks his mouth and smiles." |
|
|
491 | self => "You lick your mouth and smile." |
|
|
492 | }, |
|
|
493 | params => { |
|
|
494 | target => "<self> licks you." |
|
|
495 | other => "<self> licks <other>." |
|
|
496 | self => "You lick <other>." |
|
|
497 | }, |
|
|
498 | self => { |
|
|
499 | other => "<self> licks himself - YUCK." |
|
|
500 | self => "You lick yourself." |
|
|
501 | }, |
|
|
502 | }, |
|
|
503 | flip => { |
|
|
504 | noparams => { |
|
|
505 | other => "<self> flips head over heels." |
|
|
506 | self => "You flip head over heels." |
|
|
507 | }, |
|
|
508 | params => { |
|
|
509 | }, |
|
|
510 | self => { |
|
|
511 | }, |
|
|
512 | }, |
|
|
513 | think => { |
|
|
514 | noparams => { |
|
|
515 | other => "<self> closes his eyes and thinks really hard." |
|
|
516 | self => "Anything in particular that you'd care to think about?" |
|
|
517 | }, |
|
|
518 | params => { |
|
|
519 | }, |
|
|
520 | self => { |
|
|
521 | }, |
|
|
522 | }, |
|
|
523 | yawn => { |
|
|
524 | noparams => { |
|
|
525 | other => "<self> yawns sleepily." |
|
|
526 | self => "You open up your yap and let out a big breeze of stale air." |
|
|
527 | }, |
|
|
528 | params => { |
|
|
529 | }, |
|
|
530 | self => { |
|
|
531 | }, |
|
|
532 | }, |
|
|
533 | laugh => { |
|
|
534 | noparams => { |
|
|
535 | other => "<self> falls down laughing." |
|
|
536 | self => "You fall down laughing." |
|
|
537 | }, |
|
|
538 | params => { |
|
|
539 | 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." |
|
|
541 | self => "You take one look at <other> and fall down laughing." |
|
|
542 | }, |
|
|
543 | self => { |
|
|
544 | other => "<self> is laughing at something." |
|
|
545 | self => "Laugh at yourself all you want, the others won't understand." |
|
|
546 | }, |
|
|
547 | }, |
|
|
548 | burp => { |
|
|
549 | noparams => { |
|
|
550 | other => "<self> burps loudly." |
|
|
551 | self => "You burp loudly." |
|
|
552 | }, |
|
|
553 | params => { |
|
|
554 | }, |
|
|
555 | self => { |
|
|
556 | }, |
|
|
557 | }, |
|
|
558 | gasp => { |
|
|
559 | noparams => { |
|
|
560 | other => "<self> gasps in astonishment." |
|
|
561 | self => "You gasp in astonishment." |
|
|
562 | }, |
|
|
563 | params => { |
|
|
564 | }, |
|
|
565 | self => { |
|
|
566 | }, |
|
|
567 | }, |
|
|
568 | smirk => { |
|
|
569 | noparams => { |
|
|
570 | other => "<self> smirks." |
|
|
571 | self => "You smirk." |
|
|
572 | }, |
|
|
573 | params => { |
|
|
574 | }, |
|
|
575 | self => { |
|
|
576 | }, |
|
|
577 | }, |
|
|
578 | cry => { |
|
|
579 | noparams => { |
|
|
580 | other => "<self> bursts into tears." |
|
|
581 | self => "Waaaaaaahhh.." |
|
|
582 | }, |
|
|
583 | params => { |
|
|
584 | target => "<self> cries on your shoulder." |
|
|
585 | other => "<self> cries on <other>'s shoulder." |
|
|
586 | self => "You cry on <other>'s shoulder." |
|
|
587 | }, |
|
|
588 | self => { |
|
|
589 | other => "<self> sobs quietly to himself." |
|
|
590 | self => "You cry to yourself." |
|
|
591 | }, |
|
|
592 | }, |
|
|
593 | sulk => { |
|
|
594 | noparams => { |
|
|
595 | other => "<self> sulks in the corner." |
|
|
596 | self => "You sulk." |
|
|
597 | }, |
|
|
598 | params => { |
|
|
599 | }, |
|
|
600 | self => { |
|
|
601 | }, |
|
|
602 | }, |
|
|
603 | whistle => { |
|
|
604 | noparams => { |
|
|
605 | other => "<self> whistles appreciatively." |
|
|
606 | self => "You whistle appreciatively." |
|
|
607 | }, |
|
|
608 | params => { |
|
|
609 | target => "<self> whistles at <other>." |
|
|
610 | self => "You whistle at <other>." |
|
|
611 | }, |
|
|
612 | self => { |
|
|
613 | other => "<self> whistles to himself in boredom." |
|
|
614 | self => "You whistle while you work." |
|
|
615 | }, |
|
|
616 | }, |
|
|
617 | groan => { |
|
|
618 | noparams => { |
|
|
619 | other => "<self> groans loudly." |
|
|
620 | self => "You groan loudly." |
|
|
621 | }, |
|
|
622 | params => { |
|
|
623 | }, |
|
|
624 | self => { |
|
|
625 | }, |
|
|
626 | }, |
|
|
627 | cough => { |
|
|
628 | noparams => { |
|
|
629 | other => "<self> coughs loudly." |
|
|
630 | self => "Yuck, try to cover your mouth next time!" |
|
|
631 | }, |
|
|
632 | params => { |
|
|
633 | }, |
|
|
634 | self => { |
|
|
635 | }, |
|
|
636 | }, |
|
|
637 | grin => { |
|
|
638 | noparams => { |
|
|
639 | other => "<self> grins evilly." |
|
|
640 | self => "You grin evilly." |
|
|
641 | }, |
|
|
642 | params => { |
|
|
643 | target => "<self> grins evilly at you." |
|
|
644 | other => "<self> grins evilly at <other>." |
|
|
645 | self => "You grin at <other>." |
|
|
646 | }, |
|
|
647 | self => { |
|
|
648 | }, |
|
|
649 | }, |
|
|
650 | }; |
|
|
651 | for my $emotion (keys %$emotes) { |
|
|
652 | cf::register_command $emotion => sub { |
|
|
653 | my ($ob, $tname) = @_; |
|
|
654 | |
|
|
655 | cf::async { |
|
|
656 | my $name = $ob->name; |
|
|
657 | |
|
|
658 | if ($tname eq $name) { |
|
|
659 | my $emote = $emotes->{$emotion}->{self}; |
|
|
660 | $emote->{other} =~ s/<self>/$name/; |
|
|
661 | |
|
|
662 | for my $other ( grep { $ob->on_same_map_as ($_->ob) } cf::player::list ) { |
|
|
663 | next |
|
|
664 | if $other->ob == $ob; |
|
|
665 | $other->ob->message ($emote->{other}, cf::NDI_GREY | cf::NDI_UNIQUE); |
|
|
666 | } |
|
|
667 | |
|
|
668 | $ob->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); |
|
|
669 | } elsif ($tname) { |
|
|
670 | my $target = cf::player::find $tname |
|
|
671 | or return $ob->reply (undef, "$tname is not around."); |
|
|
672 | |
|
|
673 | my $emote = $emotes->{$emotion}->{params}; |
|
|
674 | $emote->{self} =~ s/<other>/$tname/; |
|
|
675 | $emote->{target} =~ s/<self>/$name/; |
|
|
676 | $emote->{other} =~ s/<other>/$tname/; |
|
|
677 | $emote->{other} =~ s/<self>/$name/; |
|
|
678 | |
|
|
679 | for my $other ( grep { $ob->on_same_map_as ($_->ob) } cf::player::list ) { |
|
|
680 | next |
|
|
681 | if $other->ob == $ob or $other == $target; |
|
|
682 | $other->ob->message ($emote->{other}, cf::NDI_GREY | cf::NDI_UNIQUE); |
|
|
683 | } |
|
|
684 | |
|
|
685 | $target->ob->message ($emote->{target}, cf::NDI_GREY | cf::NDI_UNIQUE); |
|
|
686 | $ob->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); |
|
|
687 | } else { |
|
|
688 | my $emote = $emotes->{$emotion}->{noparams}; |
|
|
689 | $emote->{other} =~ s/<self>/$name/; |
|
|
690 | |
|
|
691 | for my $other ( grep { $ob->on_same_map_as ($_->ob) } cf::player::list ) { |
|
|
692 | next |
|
|
693 | if $other->ob == $ob; |
|
|
694 | $other->ob->message ($emote->{other}, cf::NDI_GREY | cf::NDI_UNIQUE); |
|
|
695 | } |
|
|
696 | |
|
|
697 | $ob->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); |
|
|
698 | } |
|
|
699 | }; |
|
|
700 | |
|
|
701 | 1 |
|
|
702 | }; |
|
|
703 | } |
52 | |
704 | |
53 | cf::register_command say => sub { |
705 | cf::register_command say => sub { |
54 | my ($who, $msg) = @_; |
706 | my ($who, $msg) = @_; |
55 | |
707 | |
56 | utf8::decode $msg; |
708 | utf8::decode $msg; |
… | |
… | |
106 | } |
758 | } |
107 | |
759 | |
108 | } else { |
760 | } else { |
109 | $who->message ("What do you want to say?", cf::NDI_UNIQUE); |
761 | $who->message ("What do you want to say?", cf::NDI_UNIQUE); |
110 | } |
762 | } |
|
|
763 | |
|
|
764 | 1 |
111 | }; |
765 | }; |
112 | |
766 | |
113 | cf::register_command chat => sub { |
767 | cf::register_command chat => sub { |
114 | my ($who, $msg) = @_; |
768 | my ($who, $msg) = @_; |
115 | |
769 | |
… | |
… | |
129 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; |
783 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; |
130 | |
784 | |
131 | } else { |
785 | } else { |
132 | $who->message ("Chat what?", cf::NDI_UNIQUE); |
786 | $who->message ("Chat what?", cf::NDI_UNIQUE); |
133 | } |
787 | } |
|
|
788 | |
|
|
789 | 1 |
134 | }; |
790 | }; |
135 | |
791 | |
136 | cf::register_command shout => sub { |
792 | cf::register_command shout => sub { |
137 | my ($who, $msg) = @_; |
793 | my ($who, $msg) = @_; |
138 | |
794 | |
… | |
… | |
153 | |
809 | |
154 | } else { |
810 | } else { |
155 | $who->message ("Shout what?", cf::NDI_UNIQUE); |
811 | $who->message ("Shout what?", cf::NDI_UNIQUE); |
156 | } |
812 | } |
157 | |
813 | |
|
|
814 | 1 |
158 | }; |
815 | }; |
159 | |
816 | |
160 | cf::register_command tell => sub { |
817 | cf::register_command tell => sub { |
161 | my ($who, $args) = @_; |
818 | my ($who, $args) = @_; |
162 | my ($target, $msg) = split /\s+/, $args, 2; |
819 | my ($target, $msg) = split /\s+/, $args, 2; |
… | |
… | |
191 | } |
848 | } |
192 | |
849 | |
193 | } else { |
850 | } else { |
194 | $who->message ("No such player. Your message: $msg", cf::NDI_UNIQUE); |
851 | $who->message ("No such player. Your message: $msg", cf::NDI_UNIQUE); |
195 | } |
852 | } |
|
|
853 | |
|
|
854 | 1 |
196 | }; |
855 | }; |
197 | |
856 | |
198 | cf::register_command reply => sub { |
857 | cf::register_command reply => sub { |
199 | my ($who, $args) = @_; |
858 | my ($who, $args) = @_; |
200 | my $name = $who->name; |
859 | my $name = $who->name; |
… | |
… | |
228 | } |
887 | } |
229 | |
888 | |
230 | } else { |
889 | } else { |
231 | $who->message ("Can't reply, player left. Your message: $args".$who->{ext_last_tell}, cf::NDI_UNIQUE); |
890 | $who->message ("Can't reply, player left. Your message: $args".$who->{ext_last_tell}, cf::NDI_UNIQUE); |
232 | } |
891 | } |
|
|
892 | |
|
|
893 | 1 |
233 | }; |
894 | }; |
234 | |
895 | |
235 | cf::register_command ignore => sub { |
896 | cf::register_command ignore => sub { |
236 | my ($who, $args) = @_; |
897 | my ($who, $args) = @_; |
237 | my ($target, $type, $timeout) = split /\s+/, $args; |
898 | my ($target, $type, $timeout) = split /\s+/, $args; |
… | |
… | |
277 | $who->message ("Usage: ignore <player> <tell|shout|all> <timeout>\n" |
938 | $who->message ("Usage: ignore <player> <tell|shout|all> <timeout>\n" |
278 | . "will ignore a player for <timeout> hours.\n" |
939 | . "will ignore a player for <timeout> hours.\n" |
279 | . "Usage: ignore list\n" |
940 | . "Usage: ignore list\n" |
280 | . "will show you a list of players currently ignored.", cf::NDI_UNIQUE); |
941 | . "will show you a list of players currently ignored.", cf::NDI_UNIQUE); |
281 | } |
942 | } |
|
|
943 | |
|
|
944 | 1 |
282 | }; |
945 | }; |
283 | |
946 | |
284 | cf::register_command unignore => sub { |
947 | cf::register_command unignore => sub { |
285 | my ($who, $args) = @_; |
948 | my ($who, $args) = @_; |
286 | my ($target, $type) = split /\s+/, $args; |
949 | my ($target, $type) = split /\s+/, $args; |
… | |
… | |
311 | } |
974 | } |
312 | } else { |
975 | } else { |
313 | $who->message ("No such player or ambiguous name: $target", cf::NDI_UNIQUE); |
976 | $who->message ("No such player or ambiguous name: $target", cf::NDI_UNIQUE); |
314 | } |
977 | } |
315 | } |
978 | } |
|
|
979 | |
|
|
980 | 1 |
316 | }; |
981 | }; |
317 | |
982 | |
318 | cf::register_command seen => sub { |
983 | cf::register_command seen => sub { |
319 | my ($who, $args) = @_; |
984 | my ($who, $args) = @_; |
320 | |
985 | |
… | |
… | |
334 | $who->message ("No player named $login is known to me.", cf::NDI_UNIQUE); |
999 | $who->message ("No player named $login is known to me.", cf::NDI_UNIQUE); |
335 | } |
1000 | } |
336 | } else { |
1001 | } else { |
337 | $who->message ("Usage: seen <player>", cf::NDI_UNIQUE); |
1002 | $who->message ("Usage: seen <player>", cf::NDI_UNIQUE); |
338 | } |
1003 | } |
|
|
1004 | |
|
|
1005 | 1 |
339 | }; |
1006 | }; |
340 | |
1007 | |