drain_life.c
skylib_mudos_v1/mudlib/std/shadows/rituals/drain_life.c · 907 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 life ritual.
* @author Sandoz, 2001.
*/
inherit "/std/effect_shadow";
#define CASTER arg[ 1 ]
#define AMOUNT arg[ 2 ]
int total;
/** @ignore yes */
varargs void adjust_hp( int number, object attacker, object weapon, string attack ) {
mixed arg;
arg = arg();
if( number < 1 )
return player->adjust_hp( number, attacker, weapon, attack );
if( !CASTER || CASTER->query_property("dead") ) {
remove_this_effect();
} else {
if( ( number -= AMOUNT ) < 0 )
attacker = CASTER;
total += number;
}
return player->adjust_hp( number, attacker, weapon, attack );
} /* adjust_hp() */
/** @ignore yes */
void remove_effect_shadow( int i ) {
if( i == id )
TCRE("sandoz", sprintf("Total HP Drain : %i", total ) );
::remove_effect_shadow( i );
} /* remove_effect_shadow() */