spider_venom.c
skylib_fluffos_v3/mudlib/std/effects/ingested/spider_venom.c · 2.2 KB
From the archive skylib_fluffos_v3.zip
Download the archive « Back to the archive contents
/* -*- LPC -*- */
/*
* $Locker: $
* $Id: spider_venom.c,v 1.1 1998/01/06 04:14:00 ceres Exp $
* $Log: spider_venom.c,v $
* Revision 1.1 1998/01/06 04:14:00 ceres
* Initial revision
*
*/
/**
* This is the effect skelton docs. This effect
* has a classification of "body.poison".
* <p>
* Describe the arguments in here.
* <p>
* This effect has a shadow associated with it.
* @classification body.poison
* @see help::effects
*/
#include "path.h"
#include <effect.h>
#define MIN_TIME 60
string *wretch_msg = ({
"Your stomach turns inside out, and you lose your lunch.\n",
"You double over in pain.\n"
});
string *room_msg = ({
" convulses violently, and you're presented with a grand view " +
" of a recent meal.\n",
" groans and doubles over.\n",
" seethes in agony.\n"
});
/** @ignore yes */
string query_classification() { return "body.poison"; }
/** @ignore yes */
string query_shadow_ob() { return SHADOWS + "poison"; }
/** @ignore yes */
int beginning( object player, int time, int id ) {
if (time < MIN_TIME) {
player->submit_ee( 0, 0, EE_REMOVE );
return 0;
}
player->submit_ee("wretch", ({ 30, 60 }), EE_CONTINUOUS);
player->submit_ee( 0, time, EE_REMOVE );
player->set_active("poison");
tell_object(player, "Seething pains radiate from the wounds "
"inflicted upon you by the spider.\n");
return time;
} /* beginning() */
/** @ignore yes */
int merge_effect( object player, int time1, int time2 ) {
player->set_active("poison");
player->submit_ee( 0, time1 + time2 - (int)player->expected_tt(),
EE_REMOVE );
return time1 + time2;
} /* merge_effect() */
/** @ignore yes */
void end( object player, int time, int id ) {
// No message for "short" effects
if (time < MIN_TIME) return;
tell_object( player, "You feel better now.\n" );
player->set_inactive("poison");
} /* end() */
void wretch(object player, int time, int id) {
int msg_no;
msg_no = random(sizeof(wretch_msg));
tell_object(player, wretch_msg[msg_no]);
tell_room(environment(player), (string)player->short() +
room_msg[msg_no], player);
player->adjust_hp(-(int)player->query_hp()/10);
} /* wretch() */