… | |
… | |
61 | $pl->send_msg ($cf::SAY_CHANNEL); |
61 | $pl->send_msg ($cf::SAY_CHANNEL); |
62 | $pl->send_msg ($cf::CHAT_CHANNEL); |
62 | $pl->send_msg ($cf::CHAT_CHANNEL); |
63 | }, |
63 | }, |
64 | ); |
64 | ); |
65 | |
65 | |
|
|
66 | # TODO: remove once safe |
66 | cf::register_command listen => sub { |
67 | cf::register_command listen => sub { |
67 | my ($pl, $msg) = @_; |
|
|
68 | my $player = cf::player::find_active $pl->name; |
|
|
69 | |
|
|
70 | if ($msg ne "") { |
|
|
71 | $msg = 10 if $msg > 10; |
|
|
72 | |
|
|
73 | my $prev_listen = $player->listening; |
|
|
74 | $player->listening ($msg); |
|
|
75 | if ($prev_listen == $player->listening) { |
|
|
76 | $pl->message ("Your verbose level stays at $prev_listen.", cf::NDI_REPLY); |
|
|
77 | } else { |
|
|
78 | $pl->message ("Your verbose level is now " . $player->listening . ". (previously: $prev_listen)", cf::NDI_REPLY); |
|
|
79 | } |
|
|
80 | } else { |
|
|
81 | $pl->message ("Your verbose level is " . $player->listening . ".", cf::NDI_REPLY); |
|
|
82 | } |
|
|
83 | }; |
68 | }; |
84 | |
69 | |
85 | cf::register_command cointoss => sub { |
70 | cf::register_command cointoss => sub { |
86 | my ($ob, $msg) = @_; |
71 | my ($ob, $msg) = @_; |
87 | |
72 | |
… | |
… | |
850 | |
835 | |
851 | cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; |
836 | cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; |
852 | send_irc ("[%s] %s", $name, $msg); |
837 | send_irc ("[%s] %s", $name, $msg); |
853 | |
838 | |
854 | send_msg $_, $cf::CHAT_CHANNEL => "$name chats: $msg", cf::NDI_BLUE | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_chat" |
839 | send_msg $_, $cf::CHAT_CHANNEL => "$name chats: $msg", cf::NDI_BLUE | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_chat" |
855 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; |
840 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW } cf::player::list; |
856 | |
841 | |
857 | } else { |
842 | } else { |
858 | $pl->send_msg ($cf::CHAT_CHANNEL => "Chat what?", cf::NDI_BLUE | cf::NDI_DEF | cf::NDI_REPLY); |
843 | $pl->send_msg ($cf::CHAT_CHANNEL => "Chat what?", cf::NDI_BLUE | cf::NDI_DEF | cf::NDI_REPLY); |
859 | } |
844 | } |
860 | }; |
845 | }; |
… | |
… | |
874 | |
859 | |
875 | cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; |
860 | cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; |
876 | send_irc ("\007\0034{%s} %s\n", $name, $msg); |
861 | send_irc ("\007\0034{%s} %s\n", $name, $msg); |
877 | |
862 | |
878 | send_msg $_, $cf::CHAT_CHANNEL => "$name shouts: $msg", cf::NDI_RED | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_shout" |
863 | send_msg $_, $cf::CHAT_CHANNEL => "$name shouts: $msg", cf::NDI_RED | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_shout" |
879 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 2 } cf::player::list; |
864 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW } cf::player::list; |
880 | |
865 | |
881 | } else { |
866 | } else { |
882 | $pl->send_msg ($cf::CHAT_CHANNEL => "Shout what?", cf::NDI_RED | cf::NDI_DEF | cf::NDI_REPLY); |
867 | $pl->send_msg ($cf::CHAT_CHANNEL => "Shout what?", cf::NDI_RED | cf::NDI_DEF | cf::NDI_REPLY); |
883 | } |
868 | } |
884 | }; |
869 | }; |