basic_symbol.c

skylib_mudos_v1/mudlib/obj/faith/symbols/basic_symbol.c · 2.3 KB

From the archive skylib_mudos_v1.tar.gz

Download the archive   « Back to the archive contents

/**
 * The Holy Symbol Inherit.
 * Sandoz, 24th July 2001
 */

inherit ARMOUR_OBJ;

nosave string deity, long_desc;

/** @ignore yes */
void set_long_desc( string _long ) { long_desc = _long; }
/** @ignore yes */
string query_long_desc() { return long_desc; }

/** @ignore yes */
string query_deity() { return deity; }
/** @ignore yes */
void set_deity( string _name ) {
    deity = _name;
    add_adjective( lower_case(deity) );
    add_property( deity, 1 );
} /* set_deity() */

/** @ignore yes */
string get_long() {
    return long_desc+( TP->query_deity() == deity ? "  You get the feeling "
                       "that it might be possible to get some info about your "
                       "fellow followers with the 'list' command.\n" : "\n" );
} /* get_long() */

/** @ignore yes */
void create() {
    ::create();
    set_name("symbol");
    set_short("holy symbol");
    add_adjective("holy");
    add_alias( ({"amulet", "jewellery"}) );
    add_plural( ({"amulets", "jewellery"}) );

    add_property("holy symbol", 1 );
    add_property("no_recycle", 1 );

    set_long( (: get_long :) );

    set_type("necklace");
    setup_armour(1200);
    set_damage_chance(10);
    set_value(6000);
    set_weight(4);

    TO->setup();

} /* setup() */

/** @ignore yes */
void init() {
    add_command("list", "worshippers");
} /* init() */

/** @ignore yes */
int do_list() {
    string *worshippers;

    if( TP->query_deity() != deity ) {
        add_failed_mess("Your connection with "+deity+" is too weak to get "
            "anything useful out of "+the_short()+".\n");
        return 0;
    }

    worshippers = (string *)DEITY_H->query_worshippers( deity );
    worshippers = filter( worshippers, (: !creatorp($1) :) );
    worshippers = map( worshippers, (: CAP($1) :) );

    if( !sizeof( worshippers = sort_array( worshippers, 1 ) ) ) {
        add_failed_mess("There are no worshippers currently in the service "
            "of "+deity+".\n");
        return 0;
    }
    add_succeeded_mess( ({ query_multiple_short(worshippers)+" are the "
        "players currently in the service of "+deity+", with a total of "+
        query_num( sizeof(worshippers) )+" worshipper"+
        ( sizeof(worshippers) > 1 ? "s" : "" )+".\n",
        "$N briefly clasp$s "+TO->poss_short()+" in $p hand.\n" }));
    return 1;

} /* do_list() */

Site Stats

Snippets: 1791
Codebases: 571