/* command, trial out by Turrican for a commands daemon. */
#include <language.h>
#include <player.h>
#include <drinks.h>
inherit COMMAND_BASE;
inherit SPEECH_BASE;
int cmd(string emote, string mess) {
string word, s1, cur_lang;
cur_lang = this_player()->query_current_language();
if (!LANGUAGE_HAND->query_language_spoken(cur_lang))
return notify_fail(capitalize(cur_lang) + " is not a spoken language.\n");
if(TP->query_gagged()) {
return notify_fail("You have been gagged! You will not be able "
"to say things again until the gag is removed. Perhaps you should "
"talk to a creator about this.\n");
}
if (!interactive(this_player())) {
mess = this_player()->convert_message(mess);
mess = this_player()->fit_message(mess);
}
word = query_word_type(mess);
if (this_player()->query_volume(D_ALCOHOL))
mess = drunk_speech(mess);
// General speech modifications (curses, etc)
s1 = this_player()->mangle_speech(mess);
if (stringp(s1))
mess = s1;
mess = de_eight(mess);
this_player()->remove_hide_invis("hiding");
if (!environment(this_player()))
write("You are in limbo, noone can hear you.\n");
this_player()->comm_event(environment(this_player()), "person_say",
"$one_short:" + file_name(this_player()) + "$ "
"$V$0=" + word + "s," + word + "$V$ " + emote + ": ", mess, cur_lang);
word += " " + emote;
if (cur_lang != "common")
word += " in " + cur_lang;
my_mess("You " + word + ": ", mess);
this_player()->adjust_time_left(-5);
return 1;
}
mixed *query_patterns() {
return ({ "<word'emotion'> <string'message'>", (: cmd($4[0], $4[1]) :) });
}