nightmare3_fluffos_v2/
nightmare3_fluffos_v2/bin/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/ChangeLog.old/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/Win32/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/compat/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/compat/simuls/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/include/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/clone/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/command/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/data/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/etc/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/include/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/inherit/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/inherit/master/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/log/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/tests/compiler/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/tests/efuns/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/single/tests/operators/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/testsuite/u/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/tmp/
nightmare3_fluffos_v2/fluffos-2.9-ds2.08/windows/
nightmare3_fluffos_v2/lib/cmds/ambassador/
nightmare3_fluffos_v2/lib/cmds/database/
nightmare3_fluffos_v2/lib/cmds/hm/
nightmare3_fluffos_v2/lib/cmds/soul/
nightmare3_fluffos_v2/lib/daemon/cfg/
nightmare3_fluffos_v2/lib/daemon/cfg/mon_races/
nightmare3_fluffos_v2/lib/daemon/cfg/races/
nightmare3_fluffos_v2/lib/daemon/include/
nightmare3_fluffos_v2/lib/daemon/save/
nightmare3_fluffos_v2/lib/daemon/services/
nightmare3_fluffos_v2/lib/daemon/soul/
nightmare3_fluffos_v2/lib/doc/
nightmare3_fluffos_v2/lib/doc/TestPlans/
nightmare3_fluffos_v2/lib/doc/approval/
nightmare3_fluffos_v2/lib/doc/approval/QC/
nightmare3_fluffos_v2/lib/doc/approval/balance/
nightmare3_fluffos_v2/lib/doc/build/
nightmare3_fluffos_v2/lib/doc/build/armours/
nightmare3_fluffos_v2/lib/doc/build/economy/
nightmare3_fluffos_v2/lib/doc/build/etc/
nightmare3_fluffos_v2/lib/doc/build/monster/
nightmare3_fluffos_v2/lib/doc/build/room/
nightmare3_fluffos_v2/lib/doc/build/virtual/
nightmare3_fluffos_v2/lib/doc/build/weapon/
nightmare3_fluffos_v2/lib/doc/classes/
nightmare3_fluffos_v2/lib/doc/efun/
nightmare3_fluffos_v2/lib/doc/etc/
nightmare3_fluffos_v2/lib/doc/help/creator/
nightmare3_fluffos_v2/lib/doc/help/hm/
nightmare3_fluffos_v2/lib/doc/law/
nightmare3_fluffos_v2/lib/doc/lpc/basic/
nightmare3_fluffos_v2/lib/doc/lpc/data_types/
nightmare3_fluffos_v2/lib/doc/lpc/etc/
nightmare3_fluffos_v2/lib/doc/lpc/intermediate/
nightmare3_fluffos_v2/lib/doc/lpc/types/
nightmare3_fluffos_v2/lib/doc/mudlib/
nightmare3_fluffos_v2/lib/doc/mudlib/features/
nightmare3_fluffos_v2/lib/domains/Examples/etc/
nightmare3_fluffos_v2/lib/domains/Examples/room/
nightmare3_fluffos_v2/lib/domains/Examples/virtual/
nightmare3_fluffos_v2/lib/domains/Examples/virtual/exaA/
nightmare3_fluffos_v2/lib/domains/Examples/virtual/exaB/
nightmare3_fluffos_v2/lib/domains/Examples/weapon/
nightmare3_fluffos_v2/lib/domains/Praxis/
nightmare3_fluffos_v2/lib/domains/Praxis/adm/
nightmare3_fluffos_v2/lib/domains/Praxis/attic/
nightmare3_fluffos_v2/lib/domains/Praxis/cemetary/
nightmare3_fluffos_v2/lib/domains/Praxis/cemetary/mon/
nightmare3_fluffos_v2/lib/domains/Praxis/data/
nightmare3_fluffos_v2/lib/domains/Praxis/death/
nightmare3_fluffos_v2/lib/domains/Praxis/mountains/
nightmare3_fluffos_v2/lib/domains/Praxis/obj/armour/
nightmare3_fluffos_v2/lib/domains/Praxis/obj/magic/
nightmare3_fluffos_v2/lib/domains/Praxis/obj/weapon/
nightmare3_fluffos_v2/lib/domains/Praxis/orc_valley/
nightmare3_fluffos_v2/lib/domains/Praxis/quests/
nightmare3_fluffos_v2/lib/domains/Praxis/standardOld/
nightmare3_fluffos_v2/lib/include/
nightmare3_fluffos_v2/lib/log/
nightmare3_fluffos_v2/lib/log/errors/
nightmare3_fluffos_v2/lib/log/reports/
nightmare3_fluffos_v2/lib/log/watch/
nightmare3_fluffos_v2/lib/news/
nightmare3_fluffos_v2/lib/secure/cfg/
nightmare3_fluffos_v2/lib/secure/cmds/ambassador/
nightmare3_fluffos_v2/lib/secure/cmds/mortal/
nightmare3_fluffos_v2/lib/secure/save/users/d/
nightmare3_fluffos_v2/lib/secure/std/
nightmare3_fluffos_v2/lib/std/hm/
nightmare3_fluffos_v2/lib/std/living/
nightmare3_fluffos_v2/lib/std/room/
nightmare3_fluffos_v2/lib/std/user/
nightmare3_fluffos_v2/lib/std/virtual/
nightmare3_fluffos_v2/lib/www/
nightmare3_fluffos_v2/lib/www/errors/
nightmare3_fluffos_v2/lib/www/gateways/
nightmare3_fluffos_v2/win32/
//      /bin/user/_yell.c
//      from the Nightmare mudlib
//      yells to adjacent rooms, good for muds who want to axe shout
//      created by Descartes of Borg 20 april 1993
 
#include <std.h>
 
inherit DAEMON;
 
void do_yell(object env, string prompt, string str);
 
int cmd_yell(string str) {
    string *primary, *secondary, *tmp_arr;
    string char_arr;
    int i, j, tmp, tmp2;
    object env;
 
    if(this_player()->query_ghost()) {
        write("You howl pitifully.\n");
        say("You hear the howling of a ghost.\n");
        return 1;
    }
 
    if((int)this_player()->query_sp()<5) {
        notify_fail("You are just too tired to yell now.\n");
        return 0;}
 
    if(!str) {
        notify_fail("Sore throat?\n");
        return 0;
    }
   
    this_player()->add_sp(-5);
    env = environment(this_player());
    if(env->query_property("no shout")) {
        notify_fail("Your voice does not travel far.\n");
        return 0;
    }
 
    
    log_file("shouts", this_player()->query_name()+" (yell): "+str+"\n");
    primary = (string *)env->query_destinations();
    message("my_action", "%^BLUE%^%^BOLD%^You yell: "+str, this_player());
    message("their_action", "%^BLUE%^%^BOLD%^"+this_player()->query_cap_name()+" yells: "+str, environment(this_player()), this_player());
    do_yell(env, "You hear a "+this_player()->query_gender()+" "+
      this_player()->query_race()+" yell: ", str);
    for(i=0, tmp_arr = ({}), secondary=({}), tmp=sizeof(primary);i<tmp;i++){
        char_arr = (string)env->query_direction(primary[i]);
        if(char_arr) {
            if(env->query_door(char_arr)) secondary += ({primary[i]});
            else tmp_arr += ({ primary[i] });
        }
    }
    primary = tmp_arr;
    for(i=0, tmp=sizeof(primary); i<tmp; i++) {
        call_other(primary[i], "???");
        if(!(env = find_object(primary[i]))) continue;
        do_yell(env, "You hear a "+this_player()->query_gender()+" "+
          this_player()->query_race()+" yell: ", str);
        tmp_arr = (string *)env->query_destinations();
        for(j=0, tmp2 = sizeof(tmp_arr); j<tmp2; j++) {
            if(!(char_arr = (string)env->query_direction(tmp_arr[j])))
                continue;
            if(env->query_door(char_arr)) continue;
            secondary += ({ tmp_arr[j] });
        }
    }
    secondary = distinct_array(secondary);
    for(i=0, tmp=sizeof(secondary); i<tmp; i++) {
        if(member_array(secondary[i], primary) != -1) continue;
        call_other(secondary[i], "???");
        if(!(env = find_object(secondary[i]))) continue;
        do_yell(env, "You hear a voice yell from nearby.","");
    }
    return 1;
}
 
void do_yell(object env, string prompt, string str) {
    object *inv;
    int i, tmp;
 
    if(env == environment(this_player())) return;
    if(env->query_property("no shout")) return;
    for(i=0, tmp=(sizeof(inv=all_inventory(env))); i<tmp; i++) {
        if(!living(inv[i])) continue;
        if(inv[i] == this_player()) continue;
        if(inv[i]->query_ansi()) tell_object(inv[i], 
          (prompt)+str+"\n");
        else tell_object(inv[i], prompt+str+"\n");
    }
}
 
void help() {
    write("Syntax: <yell [message]>\n\n"
        "It yells a message to surrounding rooms.\n"
        "The sound does dissipate over distance, however.\n"
        "It also takes a bit of strength to do this.\n"
        "See also: say, whisper, emote, shout\n"
    );
}