--- deliantra/server/ext/chat.ext 2008/12/18 02:49:22 1.46 +++ deliantra/server/ext/chat.ext 2009/07/19 18:15:07 1.51 @@ -220,7 +220,7 @@ kiss => { noparams => { other => " makes a weird facial contortion", - self => "All the lonely people..", + self => "All the lonely people...", }, params => { target => " kisses you.", @@ -230,10 +230,25 @@ self => { }, }, + hug => { + noparams => { + other => " makes weird body movements.", + self => "All the lonely people...", + }, + params => { + target => " suddenly grabs you and gives you a bear hug.", + other => " hugs .", + self => "You hug .", + }, + self => { + other => " tries to hug G, but stumbles and now feels stupid.", + self => "You try and fail to hug yourself.", + }, + }, smother => { noparams => { other => " makes weird facial contortions", - self => "All the lonely people..", + self => "All the lonely people...", }, params => { target => " smothers you with kisses.", @@ -762,15 +777,6 @@ }; } -cf::register_command me => sub { - my ($pl, $msg) = @_; - - my $name = $pl->name; - - send_msg $_, $cf::SAY_CHANNEL => "* $name $msg", cf::NDI_GREY | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_say" - for grep $pl->on_same_map_as ($_->ob), cf::player::list; -}; - cf::register_command say => sub { my ($ob, $msg) = @_; @@ -826,10 +832,9 @@ } }; -cf::register_command chat => sub { - my ($ob, $msg) = @_; - utf8::decode $msg; +sub _chat { + my ($ob, $msg) = @_; my $pl = $ob->contr; @@ -839,15 +844,29 @@ my $name = $ob->name; my $NOW = time; - cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; - send_irc ("[%s] %s", $name, $msg); + cf::LOG cf::llevDebug, sprintf "QBERT %s\n", $msg; + send_irc ("%s", $msg); - send_msg $_, $cf::CHAT_CHANNEL => "$name chats: $msg", cf::NDI_BLUE | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_chat" + send_msg $_, $cf::CHAT_CHANNEL => $msg, cf::NDI_BLUE | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_chat" for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW } cf::player::list; } else { $pl->send_msg ($cf::CHAT_CHANNEL => "Chat what?", cf::NDI_BLUE | cf::NDI_DEF | cf::NDI_REPLY); } +} + +cf::register_command chat => sub { + my ($ob, $msg) = @_; + + utf8::decode $msg; + _chat $ob, $ob->name . " chats: $msg"; +}; + +cf::register_command me => sub { + my ($ob, $msg) = @_; + + utf8::decode $msg; + _chat $ob, "* " . $ob->name . " $msg"; }; cf::register_command shout => sub {