drain_energy.c

skylib_mudos_v1/mudlib/std/shadows/rituals/drain_energy.c · 757 B

From the archive skylib_mudos_v1.tar.gz

Download the archive   « Back to the archive contents

/**
 * This is the effect shadow for the drain energy ritual.
 * @author Sandoz, 2001.
 */

inherit "/std/effect_shadow";

#define CASTER  arg[ 1 ]
#define AMOUNT  arg[ 2 ]

int total;

/** @ignore yes */
int adjust_gp( int number ) {
    mixed arg;

    arg = arg();

    if( number < 1 )
        return player->adjust_gp( number );

    if( !CASTER || CASTER->query_property("dead") ) {
        remove_this_effect();
    } else {
        number -= AMOUNT;
        total += number;
    }

    return player->adjust_gp( number );

} /* adjust_gp() */

/** @ignore yes */
void remove_effect_shadow( int i ) {
    if( i == id )
        TCRE("sandoz", sprintf("Total GP Drain : %i", total ) );

    ::remove_effect_shadow( i );

} /* remove_effect_shadow() */

Site Stats

Snippets: 1791
Codebases: 571