… | |
… | |
36 | cf::register_command listen => sub { |
36 | cf::register_command listen => sub { |
37 | my ($pl, $msg) = @_; |
37 | my ($pl, $msg) = @_; |
38 | my $player = cf::player::find_active $pl->name; |
38 | my $player = cf::player::find_active $pl->name; |
39 | |
39 | |
40 | if ($msg ne "") { |
40 | if ($msg ne "") { |
|
|
41 | $msg = 10 if $msg > 10; |
|
|
42 | |
41 | my $prev_listen = $player->listening; |
43 | my $prev_listen = $player->listening; |
42 | $player->listening ($msg); |
44 | $player->listening ($msg); |
43 | if ($prev_listen == $player->listening) { |
45 | if ($prev_listen == $player->listening) { |
44 | $pl->message ("Your verbose level stayed $prev_listen.", cf::NDI_UNIQUE); |
46 | $pl->message ("Your verbose level stayed $prev_listen.", cf::NDI_UNIQUE); |
45 | } else { |
47 | } else { |
… | |
… | |
227 | noparams => { |
229 | noparams => { |
228 | other => "<self> winks suggestively.", |
230 | other => "<self> winks suggestively.", |
229 | self => "Have you got something in your eye?", |
231 | self => "Have you got something in your eye?", |
230 | }, |
232 | }, |
231 | params => { |
233 | params => { |
|
|
234 | target => "<self> winks at you.", |
232 | target => "<self> winks at <other>.", |
235 | other => "<self> winks at <other>.", |
233 | self => "You wink suggestively at <other>.", |
236 | self => "You wink suggestively at <other>.", |
234 | }, |
237 | }, |
235 | self => { |
238 | self => { |
236 | other => "<self> winks at himself - something strange is going on...", |
239 | other => "<self> winks at himself - something strange is going on...", |
237 | self => "You wink at yourself?? What are you up to?", |
240 | self => "You wink at yourself?? What are you up to?", |
… | |
… | |
327 | noparams => { |
330 | noparams => { |
328 | other => "<self> is bleeding all over the carpet - got a spare tourniquet?", |
331 | other => "<self> is bleeding all over the carpet - got a spare tourniquet?", |
329 | self => "You bleed all over your nice new armour.", |
332 | self => "You bleed all over your nice new armour.", |
330 | }, |
333 | }, |
331 | params => { |
334 | params => { |
|
|
335 | target => "<self> slashes his wrist and bleeds all over you.", |
332 | target => "<self> slashes his wrist and bleeds all over <other>.", |
336 | other => "<self> slashes his wrist and bleeds all over <other>.", |
333 | self => "You slash your wrist and bleed all over <other>", |
337 | self => "You slash your wrist and bleed all over <other>", |
334 | }, |
338 | }, |
335 | self => { |
339 | self => { |
336 | other => "<self> performs some satanic ritual while wiping his blood on himself.", |
340 | other => "<self> performs some satanic ritual while wiping his blood on himself.", |
337 | self => "Very impressive! You wipe your blood all over yourself.", |
341 | self => "Very impressive! You wipe your blood all over yourself.", |
… | |
… | |
821 | |
825 | |
822 | if ($msg) { |
826 | if ($msg) { |
823 | my $name = $pl->name; |
827 | my $name = $pl->name; |
824 | my $NOW = time; |
828 | my $NOW = time; |
825 | |
829 | |
826 | utf8::encode $msg; # ->message not yet utf8-ified |
|
|
827 | cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; |
830 | cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; |
828 | ext::schmorp_irc::do_notice (sprintf "[%s] %s", $name, $msg); |
831 | ext::schmorp_irc::do_notice (sprintf "[%s] %s", $name, $msg); |
829 | |
832 | |
830 | $_->ob->message ("$name chats: $msg", cf::NDI_BLUE) |
833 | $_->ob->message ("$name chats: $msg", cf::NDI_BLUE) |
831 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; |
834 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; |
… | |
… | |
878 | if ($target eq $name) { |
881 | if ($target eq $name) { |
879 | $pl->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE); |
882 | $pl->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE); |
880 | } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) { |
883 | } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) { |
881 | $pl->message ("$target ignores what you say. Give up on it.", cf::NDI_UNIQUE); |
884 | $pl->message ("$target ignores what you say. Give up on it.", cf::NDI_UNIQUE); |
882 | } else { |
885 | } else { |
|
|
886 | return if $other->invoke (cf::EVENT_PLAYER_TOLD, $pl->contr, $msg); |
883 | utf8::encode $msg; # ->message not yet utf8-ified |
887 | utf8::encode $msg; # ->message not yet utf8-ified |
884 | cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $target, $msg; |
888 | cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $target, $msg; |
885 | |
889 | |
886 | $pl->message ("You tell $target: $msg"); |
890 | $pl->message ("You tell $target: $msg"); |
887 | $other->ob->message ("$name tells you: $msg"); |
891 | $other->ob->message ("$name tells you: $msg"); |
… | |
… | |
1014 | $pl->message ("No such player or ambiguous name: $target", cf::NDI_UNIQUE); |
1018 | $pl->message ("No such player or ambiguous name: $target", cf::NDI_UNIQUE); |
1015 | } |
1019 | } |
1016 | } |
1020 | } |
1017 | }; |
1021 | }; |
1018 | |
1022 | |
1019 | cf::register_command seen => sub { |
|
|
1020 | my ($pl, $args) = @_; |
|
|
1021 | |
|
|
1022 | if (my ($login) = $args =~ /(\S+)/) { |
|
|
1023 | if ($login eq $pl->name) { |
|
|
1024 | $pl->message ("Very funny, $login. Ha. Ha.", cf::NDI_UNIQUE); |
|
|
1025 | } elsif (cf::player::find_active $login) { |
|
|
1026 | $pl->message ("$login is right here on this server!", cf::NDI_UNIQUE); |
|
|
1027 | } elsif (cf::player::exists $login |
|
|
1028 | and stat sprintf "%s/%s/%s/%s.pl", cf::localdir, cf::playerdir, ($login) x 2) { |
|
|
1029 | my $time = (stat _)[9]; |
|
|
1030 | |
|
|
1031 | $pl->message ("$login was last seen here " |
|
|
1032 | . (POSIX::strftime "%Y-%m-%d %H:%M:%S +0000", gmtime $time) |
|
|
1033 | . " which was " . (int +(time - $time) / 3600) . " hours ago.", cf::NDI_UNIQUE); |
|
|
1034 | } else { |
|
|
1035 | $pl->message ("No player named $login is known to me.", cf::NDI_UNIQUE); |
|
|
1036 | } |
|
|
1037 | } else { |
|
|
1038 | $pl->message ("Usage: seen <player>", cf::NDI_UNIQUE); |
|
|
1039 | } |
|
|
1040 | }; |
|
|
1041 | |
|
|