… | |
… | |
54 | cf::player->attach ( |
54 | cf::player->attach ( |
55 | prio => -1000, |
55 | prio => -1000, |
56 | on_login => sub { |
56 | on_login => sub { |
57 | my ($pl) = @_; |
57 | my ($pl) = @_; |
58 | |
58 | |
|
|
59 | cf::async { |
59 | clean_timeouts $pl->ob; |
60 | clean_timeouts $pl->ob; |
|
|
61 | }; |
60 | |
62 | |
61 | $pl->send_msg ($cf::SAY_CHANNEL); |
63 | $pl->send_msg ($cf::SAY_CHANNEL); |
62 | $pl->send_msg ($cf::CHAT_CHANNEL); |
64 | $pl->send_msg ($cf::CHAT_CHANNEL); |
63 | }, |
65 | }, |
64 | ); |
66 | ); |
… | |
… | |
148 | self => { |
150 | self => { |
149 | }, |
151 | }, |
150 | }, |
152 | }, |
151 | scream => { |
153 | scream => { |
152 | noparams => { |
154 | noparams => { |
153 | other => "<self> screams at the top of his lungs!", |
155 | other => "<self> screams at the top of G<his|her> lungs!", |
154 | self => "ARRRRRRRRRRGH!!!!!", |
156 | self => "ARRRRRRRRRRGH!!!!!", |
155 | }, |
157 | }, |
156 | params => { |
158 | params => { |
157 | }, |
159 | }, |
158 | self => { |
160 | self => { |
… | |
… | |
167 | target => "<self> pukes on your clothes!", |
169 | target => "<self> pukes on your clothes!", |
168 | other => "<self> pukes on <other>.", |
170 | other => "<self> pukes on <other>.", |
169 | self => "You puke on <other>.", |
171 | self => "You puke on <other>.", |
170 | }, |
172 | }, |
171 | self => { |
173 | self => { |
172 | other => "<self> pukes on his clothes.", |
174 | other => "<self> pukes on G<his|her> clothes.", |
173 | self => "You puke on yourself.", |
175 | self => "You puke on yourself.", |
174 | }, |
176 | }, |
175 | }, |
177 | }, |
176 | strut => { |
178 | strut => { |
177 | noparams => { |
179 | noparams => { |
… | |
… | |
216 | }, |
218 | }, |
217 | }, |
219 | }, |
218 | kiss => { |
220 | kiss => { |
219 | noparams => { |
221 | noparams => { |
220 | other => "<self> makes a weird facial contortion", |
222 | other => "<self> makes a weird facial contortion", |
221 | self => "All the lonely people..", |
223 | self => "All the lonely people...", |
222 | }, |
224 | }, |
223 | params => { |
225 | params => { |
224 | target => "<self> kisses you.", |
226 | target => "<self> kisses you.", |
225 | other => "<self> kisses <other>.", |
227 | other => "<self> kisses <other>.", |
226 | self => "You kiss <other>.", |
228 | self => "You kiss <other>.", |
227 | }, |
229 | }, |
228 | self => { |
230 | self => { |
229 | }, |
231 | }, |
230 | }, |
232 | }, |
|
|
233 | hug => { |
|
|
234 | noparams => { |
|
|
235 | other => "<self> makes weird body movements.", |
|
|
236 | self => "All the lonely people...", |
|
|
237 | }, |
|
|
238 | params => { |
|
|
239 | target => "<self> suddenly grabs and hugs you.", |
|
|
240 | other => "<self> hugs <other>.", |
|
|
241 | self => "You hug <other>.", |
|
|
242 | }, |
|
|
243 | self => { |
|
|
244 | other => "<self> tries to hug G<himself|herself>, but stumbles and now feels stupid.", |
|
|
245 | self => "You try and fail to hug yourself.", |
|
|
246 | }, |
|
|
247 | }, |
231 | smother => { |
248 | smother => { |
232 | noparams => { |
249 | noparams => { |
233 | other => "<self> makes weird facial contortions", |
250 | other => "<self> makes weird facial contortions", |
234 | self => "All the lonely people..", |
251 | self => "All the lonely people...", |
235 | }, |
252 | }, |
236 | params => { |
253 | params => { |
237 | target => "<self> smothers you with kisses.", |
254 | target => "<self> smothers you with kisses.", |
238 | other => "<self> smothers <other> with kisses.", |
255 | other => "<self> smothers <other> with kisses.", |
239 | self => "You smother <other> with kisses.", |
256 | self => "You smother <other> with kisses.", |
… | |
… | |
250 | target => "<self> winks at you.", |
267 | target => "<self> winks at you.", |
251 | other => "<self> winks at <other>.", |
268 | other => "<self> winks at <other>.", |
252 | self => "You wink suggestively at <other>.", |
269 | self => "You wink suggestively at <other>.", |
253 | }, |
270 | }, |
254 | self => { |
271 | self => { |
255 | other => "<self> winks at himself - something strange is going on...", |
272 | other => "<self> winks at G<him|her>self - something strange is going on...", |
256 | self => "You wink at yourself?? What are you up to?", |
273 | self => "You wink at yourself?? What are you up to?", |
257 | }, |
274 | }, |
258 | }, |
275 | }, |
259 | pout => { |
276 | pout => { |
260 | noparams => { |
277 | noparams => { |
… | |
… | |
266 | self => { |
283 | self => { |
267 | }, |
284 | }, |
268 | }, |
285 | }, |
269 | cackle => { |
286 | cackle => { |
270 | noparams => { |
287 | noparams => { |
271 | other => "<self> throws back his head and cackles with insane glee!", |
288 | other => "<self> throws back G<his|her> head and cackles with insane glee!", |
272 | self => "You cackle gleefully.", |
289 | self => "You cackle gleefully.", |
273 | }, |
290 | }, |
274 | params => { |
291 | params => { |
275 | }, |
292 | }, |
276 | self => { |
293 | self => { |
… | |
… | |
285 | target => "<self> sniffs you.", |
302 | target => "<self> sniffs you.", |
286 | other => "<self> sniffs <other>", |
303 | other => "<self> sniffs <other>", |
287 | self => "You sniff <other>.", |
304 | self => "You sniff <other>.", |
288 | }, |
305 | }, |
289 | self => { |
306 | self => { |
290 | other => "<self> sniffs himself.", |
307 | other => "<self> sniffs G<him|her>self.", |
291 | self => "You sniff yourself.", |
308 | self => "You sniff yourself.", |
292 | }, |
309 | }, |
293 | }, |
310 | }, |
294 | nod => { |
311 | nod => { |
295 | noparams => { |
312 | noparams => { |
296 | other => "<self> nods solemnly.", |
313 | other => "<self> nods solemnly.", |
297 | self => "You nod solemnly.", |
314 | self => "You nod solemnly.", |
298 | }, |
315 | }, |
299 | params => { |
316 | params => { |
300 | target => "<self> nods solemnly to you.", |
317 | target => "<self> nods solemnly at you.", |
301 | other => "<self> nods solemnly to <other>.", |
318 | other => "<self> nods solemnly at <other>.", |
302 | self => "You nod solemnly to <other>.", |
319 | self => "You nod solemnly at <other>.", |
303 | }, |
320 | }, |
304 | self => { |
321 | self => { |
305 | }, |
322 | }, |
306 | }, |
323 | }, |
307 | frown => { |
324 | frown => { |
… | |
… | |
313 | target => "<self> frowns darkly at you.", |
330 | target => "<self> frowns darkly at you.", |
314 | other => "<self> frowns darkly at <other>.", |
331 | other => "<self> frowns darkly at <other>.", |
315 | self => "You frown darkly at <other>.", |
332 | self => "You frown darkly at <other>.", |
316 | }, |
333 | }, |
317 | self => { |
334 | self => { |
318 | other => "<self> frowns at himself.", |
335 | other => "<self> frowns at G<him|her>self.", |
319 | self => "You frown at yourself.", |
336 | self => "You frown at yourself.", |
320 | }, |
337 | }, |
321 | }, |
338 | }, |
322 | snicker => { |
339 | snicker => { |
323 | noparams => { |
340 | noparams => { |
… | |
… | |
346 | noparams => { |
363 | noparams => { |
347 | other => "<self> is bleeding all over the carpet - got a spare tourniquet?", |
364 | other => "<self> is bleeding all over the carpet - got a spare tourniquet?", |
348 | self => "You bleed all over your nice new armour.", |
365 | self => "You bleed all over your nice new armour.", |
349 | }, |
366 | }, |
350 | params => { |
367 | params => { |
351 | target => "<self> slashes his wrist and bleeds all over you.", |
368 | target => "<self> slashes G<his|her> wrist and bleeds all over you.", |
352 | other => "<self> slashes his wrist and bleeds all over <other>.", |
369 | other => "<self> slashes G<his|her> wrist and bleeds all over <other>.", |
353 | self => "You slash your wrist and bleed all over <other>", |
370 | self => "You slash your wrist and bleed all over <other>", |
354 | }, |
371 | }, |
355 | self => { |
372 | self => { |
356 | other => "<self> performs some satanic ritual while wiping his blood on himself.", |
373 | other => "<self> performs some satanic ritual while wiping G<his|her> blood on G<him|her>self.", |
357 | self => "Very impressive! You wipe your blood all over yourself.", |
374 | self => "Very impressive! You wipe your blood all over yourself.", |
358 | }, |
375 | }, |
359 | }, |
376 | }, |
360 | twiddle => { |
377 | twiddle => { |
361 | noparams => { |
378 | noparams => { |
362 | other => "<self> patiently twiddles his thumbs.", |
379 | other => "<self> patiently twiddles G<his|her> thumbs.", |
363 | self => "You patiently twiddle your thumbs.", |
380 | self => "You patiently twiddle your thumbs.", |
364 | }, |
381 | }, |
365 | params => { |
382 | params => { |
366 | }, |
383 | }, |
367 | self => { |
384 | self => { |
368 | }, |
385 | }, |
369 | }, |
386 | }, |
370 | spit => { |
387 | spit => { |
371 | noparams => { |
388 | noparams => { |
372 | other => "<self> spits over his left shoulder.", |
389 | other => "<self> spits over G<his|her> left shoulder.", |
373 | self => "You spit over your left shoulder.", |
390 | self => "You spit over your left shoulder.", |
374 | }, |
391 | }, |
375 | params => { |
392 | params => { |
376 | target => "<self> spits in your face!", |
393 | target => "<self> spits in your face!", |
377 | other => "<self> spits in <other>'s face.", |
394 | other => "<self> spits in <other>'s face.", |
378 | self => "You spit on <other>.", |
395 | self => "You spit on <other>.", |
379 | }, |
396 | }, |
380 | self => { |
397 | self => { |
381 | other => "<self> drools all over himself.", |
398 | other => "<self> drools all over G<him|her>self.", |
382 | self => "You drool all over yourself.", |
399 | self => "You drool all over yourself.", |
383 | }, |
400 | }, |
384 | }, |
401 | }, |
385 | glare => { |
402 | glare => { |
386 | noparams => { |
403 | noparams => { |
387 | other => "<self> glares around him.", |
404 | other => "<self> glares around G<him|her>.", |
388 | self => "You glare at nothing in particular.", |
405 | self => "You glare at nothing in particular.", |
389 | }, |
406 | }, |
390 | params => { |
407 | params => { |
391 | target => "<self> glares icily at you, you feel cold to your bones.", |
408 | target => "<self> glares icily at you, you feel cold to your bones.", |
392 | other => "<self> glares at <other>.", |
409 | other => "<self> glares at <other>.", |
393 | self => "You glare icily at <other>.", |
410 | self => "You glare icily at <other>.", |
394 | }, |
411 | }, |
395 | self => { |
412 | self => { |
396 | other => "<self> glares at his feet, what is bothering him?", |
413 | other => "<self> glares at G<his|her> feet, what is bothering G<him|her>?", |
397 | self => "You glare icily at your feet, they are suddenly very cold.", |
414 | self => "You glare icily at your feet, they are suddenly very cold.", |
398 | }, |
415 | }, |
399 | }, |
416 | }, |
400 | bow => { |
417 | bow => { |
401 | noparams => { |
418 | noparams => { |
… | |
… | |
406 | target => "<self> bows before you.", |
423 | target => "<self> bows before you.", |
407 | other => "<self> bows before <other>.", |
424 | other => "<self> bows before <other>.", |
408 | self => "You bow before <other>.", |
425 | self => "You bow before <other>.", |
409 | }, |
426 | }, |
410 | self => { |
427 | self => { |
411 | other => "<self> folds up like a jackknife and kisses his own toes.", |
428 | other => "<self> folds up like a jackknife and kisses G<his|her> own toes.", |
412 | self => "You kiss your toes.", |
429 | self => "You kiss your toes.", |
413 | }, |
430 | }, |
414 | }, |
431 | }, |
415 | dance => { |
432 | dance => { |
416 | noparams => { |
433 | noparams => { |
417 | other => "<self> expresses himself through interpretive dance.", |
434 | other => "<self> expresses G<him|her>self through interpretive dance.", |
418 | self => "You dance with glee.", |
435 | self => "You dance with glee.", |
419 | }, |
436 | }, |
420 | params => { |
437 | params => { |
421 | target => "<self> grabs you, and begins dancing!", |
438 | target => "<self> grabs you, and begins dancing!", |
422 | other => "Yipe! <self> and <other> are doing the Macarena!", |
439 | other => "Yipe! <self> and <other> are doing the Macarena!", |
423 | self => "You grab <other> and begin doing the Cha-Cha!", |
440 | self => "You grab <other> and begin doing the Cha-Cha!", |
424 | }, |
441 | }, |
425 | self => { |
442 | self => { |
426 | other => "<self> embraces himself and begins to dance!", |
443 | other => "<self> embraces G<him|her>self and begins to dance!", |
427 | self => "You skip and dance around by yourself.", |
444 | self => "You skip and dance around by yourself.", |
428 | }, |
445 | }, |
429 | }, |
446 | }, |
430 | snore => { |
447 | snore => { |
431 | noparams => { |
448 | noparams => { |
… | |
… | |
447 | self => { |
464 | self => { |
448 | }, |
465 | }, |
449 | }, |
466 | }, |
450 | snap => { |
467 | snap => { |
451 | noparams => { |
468 | noparams => { |
452 | other => "<self> snaps his fingers.", |
469 | other => "<self> snaps G<his|her> fingers.", |
453 | self => "PRONTO! you snap your fingers.", |
470 | self => "PRONTO! you snap your fingers.", |
454 | }, |
471 | }, |
455 | params => { |
472 | params => { |
456 | }, |
473 | }, |
457 | self => { |
474 | self => { |
… | |
… | |
466 | target => "<self> waves goodbye to you. Have a good journey.", |
483 | target => "<self> waves goodbye to you. Have a good journey.", |
467 | other => "<self> waves goodbye to <other>.", |
484 | other => "<self> waves goodbye to <other>.", |
468 | self => "You wave goodbye to <other>.", |
485 | self => "You wave goodbye to <other>.", |
469 | }, |
486 | }, |
470 | self => { |
487 | self => { |
471 | other => "<self> waves goodbye to himself.", |
488 | other => "<self> waves goodbye to G<him|her>self.", |
472 | self => "Are you going on adventures as well??", |
489 | self => "Are you going on adventures as well??", |
473 | }, |
490 | }, |
474 | }, |
491 | }, |
475 | smile => { |
492 | smile => { |
476 | noparams => { |
493 | noparams => { |
… | |
… | |
490 | other => "<self> sneezes.", |
507 | other => "<self> sneezes.", |
491 | self => "Gesundheit!", |
508 | self => "Gesundheit!", |
492 | }, |
509 | }, |
493 | params => { |
510 | params => { |
494 | target => "<self> sneezes on you, you feel the snot cover you. EEEEEEW.", |
511 | target => "<self> sneezes on you, you feel the snot cover you. EEEEEEW.", |
495 | other => "<self> sneezes on <other> and a film of snot covers him.", |
512 | other => "<self> sneezes on <other> and a film of snot covers G<him|her>.", |
496 | self => "You sneeze at <other> and a film of snot shoots onto him.", |
513 | self => "You sneeze at <other> and a film of snot shoots onto G<him|her>.", |
497 | }, |
514 | }, |
498 | self => { |
515 | self => { |
499 | other => "<self> sneezes, and covers himself in a slimy substance.", |
516 | other => "<self> sneezes, and covers G<him|her>self in a slimy substance.", |
500 | self => "You sneeze on yourself, what a mess!", |
517 | self => "You sneeze on yourself, what a mess!", |
501 | }, |
518 | }, |
502 | }, |
519 | }, |
503 | bounce => { |
520 | bounce => { |
504 | noparams => { |
521 | noparams => { |
… | |
… | |
513 | self => { |
530 | self => { |
514 | }, |
531 | }, |
515 | }, |
532 | }, |
516 | shake => { |
533 | shake => { |
517 | noparams => { |
534 | noparams => { |
518 | other => "<self> shakes his head.", |
535 | other => "<self> shakes G<his|her> head.", |
519 | self => "You shake your head.", |
536 | self => "You shake your head.", |
520 | }, |
537 | }, |
521 | params => { |
538 | params => { |
522 | target => "<self> shakes your hand.", |
539 | target => "<self> shakes your hand.", |
523 | other => "<self> shakes <other>'s hand.", |
540 | other => "<self> shakes <other>'s hand.", |
… | |
… | |
528 | self => "You are shaken by yourself.", |
545 | self => "You are shaken by yourself.", |
529 | }, |
546 | }, |
530 | }, |
547 | }, |
531 | lick => { |
548 | lick => { |
532 | noparams => { |
549 | noparams => { |
533 | other => "<self> licks his mouth and smiles.", |
550 | other => "<self> licks G<his|her> mouth and smiles.", |
534 | self => "You lick your mouth and smile.", |
551 | self => "You lick your mouth and smile.", |
535 | }, |
552 | }, |
536 | params => { |
553 | params => { |
537 | target => "<self> licks you.", |
554 | target => "<self> licks you.", |
538 | other => "<self> licks <other>.", |
555 | other => "<self> licks <other>.", |
539 | self => "You lick <other>.", |
556 | self => "You lick <other>.", |
540 | }, |
557 | }, |
541 | self => { |
558 | self => { |
542 | other => "<self> licks himself - YUCK.", |
559 | other => "<self> licks G<him|her>self - YUCK.", |
543 | self => "You lick yourself.", |
560 | self => "You lick yourself.", |
544 | }, |
561 | }, |
545 | }, |
562 | }, |
546 | flip => { |
563 | flip => { |
547 | noparams => { |
564 | noparams => { |
… | |
… | |
553 | self => { |
570 | self => { |
554 | }, |
571 | }, |
555 | }, |
572 | }, |
556 | think => { |
573 | think => { |
557 | noparams => { |
574 | noparams => { |
558 | other => "<self> closes his eyes and thinks really hard.", |
575 | other => "<self> closes G<his|her> eyes and thinks really hard.", |
559 | self => "Anything in particular that you'd care to think about?", |
576 | self => "Anything in particular that you'd care to think about?", |
560 | }, |
577 | }, |
561 | params => { |
578 | params => { |
562 | }, |
579 | }, |
563 | self => { |
580 | self => { |
… | |
… | |
627 | target => "<self> cries on your shoulder.", |
644 | target => "<self> cries on your shoulder.", |
628 | other => "<self> cries on <other>'s shoulder.", |
645 | other => "<self> cries on <other>'s shoulder.", |
629 | self => "You cry on <other>'s shoulder.", |
646 | self => "You cry on <other>'s shoulder.", |
630 | }, |
647 | }, |
631 | self => { |
648 | self => { |
632 | other => "<self> sobs quietly to himself.", |
649 | other => "<self> sobs quietly to G<him|her>self.", |
633 | self => "You cry to yourself.", |
650 | self => "You cry to yourself.", |
634 | }, |
651 | }, |
635 | }, |
652 | }, |
636 | sulk => { |
653 | sulk => { |
637 | noparams => { |
654 | noparams => { |
… | |
… | |
651 | params => { |
668 | params => { |
652 | target => "<self> whistles at <other>.", |
669 | target => "<self> whistles at <other>.", |
653 | self => "You whistle at <other>.", |
670 | self => "You whistle at <other>.", |
654 | }, |
671 | }, |
655 | self => { |
672 | self => { |
656 | other => "<self> whistles to himself in boredom.", |
673 | other => "<self> whistles to G<him|her>self in boredom.", |
657 | self => "You whistle while you work.", |
674 | self => "You whistle while you work.", |
658 | }, |
675 | }, |
659 | }, |
676 | }, |
660 | groan => { |
677 | groan => { |
661 | noparams => { |
678 | noparams => { |
… | |
… | |
707 | |
724 | |
708 | $emote{other} ||= "You look away from <self>."; |
725 | $emote{other} ||= "You look away from <self>."; |
709 | $emote{self} ||= "My god! Is that LEGAL?"; |
726 | $emote{self} ||= "My god! Is that LEGAL?"; |
710 | |
727 | |
711 | $emote{other} =~ s/<self>/$name/; |
728 | $emote{other} =~ s/<self>/$name/; |
|
|
729 | |
|
|
730 | $_ = $pl->expand_cfpod ($_) |
|
|
731 | for values %emote; |
712 | |
732 | |
713 | send_msg $_, $cf::CHAT_CHANNEL, $emote{other}, cf::NDI_GREY, "msg_chat" |
733 | send_msg $_, $cf::CHAT_CHANNEL, $emote{other}, cf::NDI_GREY | cf::NDI_VERBATIM, "msg_chat" |
714 | for grep { $ob->on_same_map_as ($_->ob) && $_ != $ob} cf::player::list; |
734 | for grep { $ob->on_same_map_as ($_->ob) && $_ != $ob} cf::player::list; |
715 | |
735 | |
716 | $pl->send_msg ($emote{self}, cf::NDI_GREY | cf::NDI_REPLY); |
736 | $pl->send_msg ($emote{self}, cf::NDI_GREY | cf::NDI_REPLY | cf::NDI_VERBATIM); |
717 | } elsif ($tname) { |
737 | } elsif ($tname) { |
718 | my $target = cf::player::find $tname |
738 | my $target = cf::player::find $tname |
719 | or return send_msg $pl, tell_channel $tname, "$tname is not around.", cf::NDI_DK_ORANGE | cf::NDI_REPLY, "msg_chat"; |
739 | or return send_msg $pl, tell_channel $tname, "$tname is not around.", cf::NDI_DK_ORANGE | cf::NDI_REPLY, "msg_chat"; |
720 | |
740 | |
721 | my %emote = %{ $emotes->{$emotion}->{params} || {} }; |
741 | my %emote = %{ $emotes->{$emotion}->{params} || {} }; |
… | |
… | |
727 | $emote{self} =~ s/<other>/$tname/; |
747 | $emote{self} =~ s/<other>/$tname/; |
728 | $emote{target} =~ s/<self>/$name/; |
748 | $emote{target} =~ s/<self>/$name/; |
729 | $emote{other} =~ s/<other>/$tname/; |
749 | $emote{other} =~ s/<other>/$tname/; |
730 | $emote{other} =~ s/<self>/$name/; |
750 | $emote{other} =~ s/<self>/$name/; |
731 | |
751 | |
|
|
752 | $_ = $pl->expand_cfpod ($_) |
|
|
753 | for values %emote; |
|
|
754 | |
732 | send_msg $_, $cf::CHAT_CHANNEL, $emote{other}, cf::NDI_GREY, "msg_chat" |
755 | send_msg $_, $cf::CHAT_CHANNEL, $emote{other}, cf::NDI_GREY | cf::NDI_VERBATIM, "msg_chat" |
733 | for grep { $_ != $pl && $_ != $target && $ob->on_same_map_as ($_->ob) } cf::player::list; |
756 | for grep { $_ != $pl && $_ != $target && $ob->on_same_map_as ($_->ob) } cf::player::list; |
734 | |
757 | |
735 | send_msg $target, tell_channel $name, $emote{target}, cf::NDI_GREY, "msg_shout"; |
758 | send_msg $target, tell_channel $name, $emote{target}, cf::NDI_GREY | cf::NDI_VERBATIM, "msg_shout"; |
736 | $pl->send_msg (tell_channel $tname, $emote{self}, cf::NDI_GREY | cf::NDI_REPLY); |
759 | $pl->send_msg (tell_channel $tname, $emote{self}, cf::NDI_GREY | cf::NDI_REPLY | cf::NDI_VERBATIM); |
737 | } else { |
760 | } else { |
738 | my %emote = %{ $emotes->{$emotion}->{noparams} || {} }; |
761 | my %emote = %{ $emotes->{$emotion}->{noparams} || {} }; |
739 | |
762 | |
740 | $emote{other} ||= "<self> dances with glee."; |
763 | $emote{other} ||= "<self> dances with glee."; |
741 | $emote{self} ||= "You are a nut."; |
764 | $emote{self} ||= "You are a nut."; |
742 | |
765 | |
743 | $emote{other} =~ s/<self>/$name/; |
766 | $emote{other} =~ s/<self>/$name/; |
744 | |
767 | |
|
|
768 | $_ = $pl->expand_cfpod ($_) |
|
|
769 | for values %emote; |
|
|
770 | |
745 | send_msg $_, $cf::CHAT_CHANNEL, $emote{other}, cf::NDI_GREY, "msg_chat" |
771 | send_msg $_, $cf::CHAT_CHANNEL, $emote{other}, cf::NDI_GREY | cf::NDI_VERBATIM, "msg_chat" |
746 | for grep { $ob->on_same_map_as ($_->ob) && $_ != $pl } cf::player::list; |
772 | for grep { $ob->on_same_map_as ($_->ob) && $_ != $pl } cf::player::list; |
747 | |
773 | |
748 | $pl->send_msg ($cf::CHAT_CHANNEL, $emote{self}, cf::NDI_GREY | cf::NDI_REPLY); |
774 | $pl->send_msg ($cf::CHAT_CHANNEL, $emote{self}, cf::NDI_GREY | cf::NDI_REPLY | cf::NDI_VERBATIM); |
749 | } |
775 | } |
750 | }; |
776 | }; |
751 | }; |
777 | }; |
752 | } |
778 | } |
753 | |
|
|
754 | cf::register_command me => sub { |
|
|
755 | my ($pl, $msg) = @_; |
|
|
756 | |
|
|
757 | my $name = $pl->name; |
|
|
758 | |
|
|
759 | send_msg $_, $cf::SAY_CHANNEL => "* $name $msg", cf::NDI_GREY | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_say" |
|
|
760 | for grep $pl->on_same_map_as ($_->ob), cf::player::list; |
|
|
761 | }; |
|
|
762 | |
779 | |
763 | cf::register_command say => sub { |
780 | cf::register_command say => sub { |
764 | my ($ob, $msg) = @_; |
781 | my ($ob, $msg) = @_; |
765 | |
782 | |
766 | utf8::decode $msg; |
783 | utf8::decode $msg; |
… | |
… | |
794 | my $dialog = new NPC_Dialogue pl => $ob->contr, npc => $npc; |
811 | my $dialog = new NPC_Dialogue pl => $ob->contr, npc => $npc; |
795 | my ($reply, @kw) = $dialog->tell ($msg); |
812 | my ($reply, @kw) = $dialog->tell ($msg); |
796 | |
813 | |
797 | if (defined $reply) { |
814 | if (defined $reply) { |
798 | if ($npc->type == cf::MAGIC_EAR) { |
815 | if ($npc->type == cf::MAGIC_EAR) { |
799 | if (length $reply) { |
|
|
800 | send_msg $_, $cf::SAY_CHANNEL => $reply, cf::NDI_BROWN, "msg_say" |
816 | send_msg $_, $cf::SAY_CHANNEL => $reply, cf::NDI_BROWN, "msg_say" |
801 | for @plonmap; |
817 | for @plonmap; |
802 | } |
|
|
803 | $npc->use_trigger; |
|
|
804 | } else { |
818 | } else { |
805 | if (length $reply) { |
|
|
806 | send_msg $_, $cf::SAY_CHANNEL => $npc->name . " says: $reply", cf::NDI_BROWN, "msg_say" |
819 | send_msg $_, $cf::SAY_CHANNEL => $npc->name . " says: $reply", cf::NDI_BROWN, "msg_say" |
807 | for @plonmap; |
820 | for @plonmap; |
808 | } |
|
|
809 | } |
821 | } |
810 | } |
822 | } |
811 | |
823 | |
812 | if (@kw) { |
824 | if (@kw) { |
813 | $_->send_msg ($cf::SAY_CHANNEL => "[further topics: " . (join ", ", @kw) . "]", cf::NDI_BROWN) |
825 | $_->send_msg ($cf::SAY_CHANNEL => "[further topics: " . (join ", ", @kw) . "]", cf::NDI_BROWN) |
… | |
… | |
818 | } else { |
830 | } else { |
819 | $ob->send_msg ($cf::SAY_CHANNEL => "What do you want to say?", cf::NDI_GREY | cf::NDI_REPLY); |
831 | $ob->send_msg ($cf::SAY_CHANNEL => "What do you want to say?", cf::NDI_GREY | cf::NDI_REPLY); |
820 | } |
832 | } |
821 | }; |
833 | }; |
822 | |
834 | |
823 | cf::register_command chat => sub { |
835 | |
|
|
836 | sub _chat { |
824 | my ($ob, $msg) = @_; |
837 | my ($ob, $msg) = @_; |
825 | |
|
|
826 | utf8::decode $msg; |
|
|
827 | |
838 | |
828 | my $pl = $ob->contr; |
839 | my $pl = $ob->contr; |
829 | |
840 | |
830 | return if $pl->invoke (cf::EVENT_PLAYER_CHAT, $msg); |
841 | return if $pl->invoke (cf::EVENT_PLAYER_CHAT, $msg); |
831 | |
842 | |
832 | if ($msg) { |
843 | if ($msg) { |
833 | my $name = $ob->name; |
844 | my $name = $ob->name; |
834 | my $NOW = time; |
845 | my $NOW = time; |
835 | |
846 | |
836 | cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; |
847 | cf::LOG cf::llevDebug, sprintf "QBERT %s\n", $msg; |
837 | send_irc ("[%s] %s", $name, $msg); |
848 | send_irc ("%s", $msg); |
838 | |
849 | |
839 | send_msg $_, $cf::CHAT_CHANNEL => "$name chats: $msg", cf::NDI_BLUE | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_chat" |
850 | send_msg $_, $cf::CHAT_CHANNEL => $msg, cf::NDI_BLUE | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_chat" |
840 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; |
851 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW } cf::player::list; |
841 | |
852 | |
842 | } else { |
853 | } else { |
843 | $pl->send_msg ($cf::CHAT_CHANNEL => "Chat what?", cf::NDI_BLUE | cf::NDI_DEF | cf::NDI_REPLY); |
854 | $pl->send_msg ($cf::CHAT_CHANNEL => "Chat what?", cf::NDI_BLUE | cf::NDI_DEF | cf::NDI_REPLY); |
844 | } |
855 | } |
|
|
856 | } |
|
|
857 | |
|
|
858 | cf::register_command chat => sub { |
|
|
859 | my ($ob, $msg) = @_; |
|
|
860 | |
|
|
861 | utf8::decode $msg; |
|
|
862 | _chat $ob, $ob->name . " chats: $msg"; |
|
|
863 | }; |
|
|
864 | |
|
|
865 | cf::register_command me => sub { |
|
|
866 | my ($ob, $msg) = @_; |
|
|
867 | |
|
|
868 | utf8::decode $msg; |
|
|
869 | _chat $ob, "* " . $ob->name . " $msg"; |
845 | }; |
870 | }; |
846 | |
871 | |
847 | cf::register_command shout => sub { |
872 | cf::register_command shout => sub { |
848 | my ($ob, $msg) = @_; |
873 | my ($ob, $msg) = @_; |
849 | |
874 | |
… | |
… | |
859 | |
884 | |
860 | cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; |
885 | cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; |
861 | send_irc ("\007\0034{%s} %s\n", $name, $msg); |
886 | send_irc ("\007\0034{%s} %s\n", $name, $msg); |
862 | |
887 | |
863 | send_msg $_, $cf::CHAT_CHANNEL => "$name shouts: $msg", cf::NDI_RED | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_shout" |
888 | send_msg $_, $cf::CHAT_CHANNEL => "$name shouts: $msg", cf::NDI_RED | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_shout" |
864 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 2 } cf::player::list; |
889 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW } cf::player::list; |
865 | |
890 | |
866 | } else { |
891 | } else { |
867 | $pl->send_msg ($cf::CHAT_CHANNEL => "Shout what?", cf::NDI_RED | cf::NDI_DEF | cf::NDI_REPLY); |
892 | $pl->send_msg ($cf::CHAT_CHANNEL => "Shout what?", cf::NDI_RED | cf::NDI_DEF | cf::NDI_REPLY); |
868 | } |
893 | } |
869 | }; |
894 | }; |
… | |
… | |
914 | |
939 | |
915 | cf::register_command ignore => sub { |
940 | cf::register_command ignore => sub { |
916 | my ($pl, $args) = @_; |
941 | my ($pl, $args) = @_; |
917 | my ($target, $type, $timeout) = split /\s+/, $args; |
942 | my ($target, $type, $timeout) = split /\s+/, $args; |
918 | |
943 | |
|
|
944 | cf::async { |
919 | if ($args eq "list") { |
945 | if ($args eq "list") { |
920 | clean_timeouts $pl; |
946 | clean_timeouts $pl; |
921 | |
947 | |
922 | if ((my @ignored_tell = sort keys %{$pl->{ext_ignore_tell}}) |
948 | if ((my @ignored_tell = sort keys %{$pl->{ext_ignore_tell}}) |
923 | + (my @ignored_shout = sort keys %{$pl->{ext_ignore_shout}})) { |
949 | + (my @ignored_shout = sort keys %{$pl->{ext_ignore_shout}})) { |
924 | $pl->message ("Currently ignoring private messages from: ", cf::NDI_REPLY); |
950 | $pl->message ("Currently ignoring private messages from: ", cf::NDI_REPLY); |
925 | $pl->message ((join ", ", @ignored_tell), cf::NDI_REPLY); |
951 | $pl->message ((join ", ", @ignored_tell), cf::NDI_REPLY); |
926 | $pl->message ("Currently ignoring shouts from: ", cf::NDI_REPLY); |
952 | $pl->message ("Currently ignoring shouts from: ", cf::NDI_REPLY); |
927 | $pl->message ((join ", ", @ignored_shout), cf::NDI_REPLY); |
953 | $pl->message ((join ", ", @ignored_shout), cf::NDI_REPLY); |
928 | $pl->message ("To stop ignoring one, use unignore.", cf::NDI_REPLY); |
954 | $pl->message ("To stop ignoring one, use unignore.", cf::NDI_REPLY); |
|
|
955 | } else { |
|
|
956 | $pl->message ("Not ignoring anyone", cf::NDI_REPLY); |
|
|
957 | } |
|
|
958 | |
|
|
959 | } elsif ($target && $type) { |
|
|
960 | $timeout ne "" or $timeout = 24; |
|
|
961 | my $absolute_timeout = time + $timeout * 3600; |
|
|
962 | |
|
|
963 | if (cf::player::exists $target) { |
|
|
964 | if ($type eq "tell") { |
|
|
965 | $pl->message ("Now ignoring private messages from $target for $timeout hours.", cf::NDI_REPLY); |
|
|
966 | $pl->{ext_ignore_tell}{$target} = $absolute_timeout; |
|
|
967 | } elsif ($type eq "shout") { |
|
|
968 | $pl->message ("Now ignoring shouts from $target for $timeout hours.", cf::NDI_REPLY); |
|
|
969 | $pl->{ext_ignore_shout}{$target} = $absolute_timeout; |
|
|
970 | } elsif ($type eq "all") { |
|
|
971 | $pl->message ("Now ignoring everything from $target for $timeout hours.", cf::NDI_REPLY); |
|
|
972 | $pl->{ext_ignore_tell}{$target} = $absolute_timeout; |
|
|
973 | $pl->{ext_ignore_shout}{$target} = $absolute_timeout; |
|
|
974 | } else { |
|
|
975 | $pl->message ("You need to specify tell, shout or all.", cf::NDI_REPLY); |
|
|
976 | } |
|
|
977 | } else { |
|
|
978 | $pl->message ("No such player: $target", cf::NDI_REPLY); |
|
|
979 | } |
|
|
980 | |
929 | } else { |
981 | } else { |
930 | $pl->message ("Not ignoring anyone", cf::NDI_REPLY); |
982 | $pl->message ("Usage: ignore <player> <tell|shout|all> <timeout>\n" |
|
|
983 | . "will ignore a player for <timeout> hours.\n" |
|
|
984 | . "Usage: ignore list\n" |
|
|
985 | . "will show you a list of players currently ignored.", cf::NDI_REPLY); |
931 | } |
986 | } |
932 | |
|
|
933 | } elsif ($target && $type) { |
|
|
934 | |
|
|
935 | $timeout ne "" or $timeout = 24; |
|
|
936 | my $absolute_timeout = time + $timeout * 3600; |
|
|
937 | |
|
|
938 | if (cf::player::exists $target) { |
|
|
939 | if ($type eq "tell") { |
|
|
940 | $pl->message ("Now ignoring private messages from $target for $timeout hours.", cf::NDI_REPLY); |
|
|
941 | $pl->{ext_ignore_tell}{$target} = $absolute_timeout; |
|
|
942 | } elsif ($type eq "shout") { |
|
|
943 | $pl->message ("Now ignoring shouts from $target for $timeout hours.", cf::NDI_REPLY); |
|
|
944 | $pl->{ext_ignore_shout}{$target} = $absolute_timeout; |
|
|
945 | } elsif ($type eq "all") { |
|
|
946 | $pl->message ("Now ignoring everything from $target for $timeout hours.", cf::NDI_REPLY); |
|
|
947 | $pl->{ext_ignore_tell}{$target} = $absolute_timeout; |
|
|
948 | $pl->{ext_ignore_shout}{$target} = $absolute_timeout; |
|
|
949 | } else { |
|
|
950 | $pl->message ("You need to specify tell, shout or all.", cf::NDI_REPLY); |
|
|
951 | } |
|
|
952 | } else { |
|
|
953 | $pl->message ("No such player: $target", cf::NDI_REPLY); |
|
|
954 | } |
|
|
955 | |
|
|
956 | } else { |
|
|
957 | $pl->message ("Usage: ignore <player> <tell|shout|all> <timeout>\n" |
|
|
958 | . "will ignore a player for <timeout> hours.\n" |
|
|
959 | . "Usage: ignore list\n" |
|
|
960 | . "will show you a list of players currently ignored.", cf::NDI_REPLY); |
|
|
961 | } |
987 | }; |
962 | }; |
988 | }; |
963 | |
989 | |
964 | cf::register_command unignore => sub { |
990 | cf::register_command unignore => sub { |
965 | my ($pl, $args) = @_; |
991 | my ($pl, $args) = @_; |
966 | my ($target, $type) = split /\s+/, $args; |
992 | my ($target, $type) = split /\s+/, $args; |
967 | |
993 | |
|
|
994 | cf::async { |
968 | if ($args eq "") { |
995 | if ($args eq "") { |
969 | if ($pl->{ext_ignore_tell}) { |
996 | if ($pl->{ext_ignore_tell}) { |
970 | $pl->message ("Currently ignoring private messages from: ", cf::NDI_REPLY); |
997 | $pl->message ("Currently ignoring private messages from: ", cf::NDI_REPLY); |
971 | $pl->message ((join ", ", sort keys %{ $pl->{ext_ignore_tell} }), cf::NDI_REPLY); |
998 | $pl->message ((join ", ", sort keys %{ $pl->{ext_ignore_tell} }), cf::NDI_REPLY); |
972 | $pl->message ("Currently ignoring shouts from: ", cf::NDI_REPLY); |
999 | $pl->message ("Currently ignoring shouts from: ", cf::NDI_REPLY); |
973 | $pl->message ((join ", ", sort keys %{ $pl->{ext_ignore_shout} }), cf::NDI_REPLY); |
1000 | $pl->message ((join ", ", sort keys %{ $pl->{ext_ignore_shout} }), cf::NDI_REPLY); |
974 | } else { |
|
|
975 | $pl->message ("Not ignoring anyone", cf::NDI_REPLY); |
|
|
976 | } |
|
|
977 | } else { |
|
|
978 | if (cf::player::exists $target) { |
|
|
979 | if ($type eq "tell") { |
|
|
980 | $pl->message ("Not ignoring private messages from $target anymore.", cf::NDI_REPLY); |
|
|
981 | delete $pl->{ext_ignore_tell} {$target}; |
|
|
982 | } elsif ($type eq "shout") { |
|
|
983 | $pl->message ("Not ignoring shouts from $target anymore.", cf::NDI_REPLY); |
|
|
984 | delete $pl->{ext_ignore_shout}{$target}; |
|
|
985 | } elsif ($type eq "all") { |
|
|
986 | $pl->message ("Not ignoring anything from $target anymore.", cf::NDI_REPLY); |
|
|
987 | delete $pl->{ext_ignore_tell} {$target}; |
|
|
988 | delete $pl->{ext_ignore_shout}{$target}; |
|
|
989 | } else { |
1001 | } else { |
990 | $pl->message ("You need to specify tell, shout or all.", cf::NDI_REPLY); |
1002 | $pl->message ("Not ignoring anyone", cf::NDI_REPLY); |
991 | } |
1003 | } |
992 | } else { |
1004 | } else { |
|
|
1005 | if (cf::player::exists $target) { |
|
|
1006 | if ($type eq "tell") { |
|
|
1007 | $pl->message ("Not ignoring private messages from $target anymore.", cf::NDI_REPLY); |
|
|
1008 | delete $pl->{ext_ignore_tell} {$target}; |
|
|
1009 | } elsif ($type eq "shout") { |
|
|
1010 | $pl->message ("Not ignoring shouts from $target anymore.", cf::NDI_REPLY); |
|
|
1011 | delete $pl->{ext_ignore_shout}{$target}; |
|
|
1012 | } elsif ($type eq "all") { |
|
|
1013 | $pl->message ("Not ignoring anything from $target anymore.", cf::NDI_REPLY); |
|
|
1014 | delete $pl->{ext_ignore_tell} {$target}; |
|
|
1015 | delete $pl->{ext_ignore_shout}{$target}; |
|
|
1016 | } else { |
|
|
1017 | $pl->message ("You need to specify tell, shout or all.", cf::NDI_REPLY); |
|
|
1018 | } |
|
|
1019 | } else { |
993 | $pl->message ("No such player or ambiguous name: $target", cf::NDI_REPLY); |
1020 | $pl->message ("No such player or ambiguous name: $target", cf::NDI_REPLY); |
|
|
1021 | } |
994 | } |
1022 | } |
995 | } |
1023 | }; |
996 | }; |
1024 | }; |
997 | |
1025 | |