haunt.c

skylib_fluffos_v3/mudlib/cmds/player/haunt.c · 1.1 KB

From the archive skylib_fluffos_v3.zip

Download the archive   « Back to the archive contents

/** 
 * Haunt command. 
 * @author Taffyd
 */

inherit COMMAND_BASE;

string ooo() {
    return implode( allocate( 3 + random( 15 ),
        (: ({ "O", "o" })[ random( 2 ) ] :) ), "" );
} /* ooo() */

int haunt_player( object *victims ) {
    if ( !this_player()->query_property("dead") ) {
        add_failed_mess( "You are no where near wispy enough to "
          "haunt people.  You could probably scare a table or "
          "chair, though.\n" );
        return -1;
    }

    add_succeeded_mess( "$N wave$s $p arms about anxiously and say$s: \""
   + ooo() + "\" at $I.\n", victims );
    return 1;
} /* haunt_player() */


int cmd() {
    if ( !this_player()->query_property("dead") ) {
        add_failed_mess( "You are no where near wispy enough to "
          "haunt people.  You could probably scare a table or "
          "chair, though.\n" );
        return -1;
    }
    add_succeeded_mess( "$N wave$s $p arms about anxiously and intone$s: \"" +
        ooo() + "\".\n" );
    return 1;
} /* cmd() */

mixed *query_patterns() {
    return ({ "", (: cmd() :),
      "<indirect:any-living>", (: haunt_player($1) :)  });
} /* query_patterns() */

Site Stats

Snippets: 1791
Codebases: 571