Re: bite

From: Rasmus R\xnlev (raro94ab@hp4.econ.cbs.dk)
Date: 04/24/96


On Tue, 23 Apr 1996, Marcelo Valle Moreira wrote:

> My code is basically a cut&paste of any other skill like kick or bash, 
> my problem is: > 
> biting someone you do a damage, and I'd like to add it to your hit 
> points, like this: > 	GET_HIT(ch) = GET_HIT(ch) + damage
> 
> 	I also don't want ACMD(do_bite) to start a fight in every bite. I think about checking ch and vict attributes, like int dex and wis, or even levels  before starting a fight.
> 	I got deeply lost, and if someone has an idea of what I'm talking about or how to do it, please I need help =o)
> 	Can someone of you who really know C (that's NOT my case) help me to "trasnfer" this hitpoints from vict to ch, checking if ch is able to do it without starting a fight? it's not a spell, but a skill.
> 	Thanks, in advance.

*grin* Well, I'll do my best to make a few lines of code to possibly help 
you implement it..

to do damage on the mob try this:

	GET_HIT(mob) =- damage;
	GET_HIT(plr) = MIN(GET_MAX_HIT(plr), GET_HIT(plr) + damage);

Thats the damage part of it... you need to make mob, and plr be pointers 
to a struct of the type char_data, and have damage be an int for example..

Now if you wanna set up a fight bewtween the two (without any checks..)

	FIGHTING(mob) = plr;

Same rules needs to be followed as above..
Before doing that FIGHTING() stuff, you shoudl check to see if the mob is 
allready fighting someone else, and stuff like that..

Hope this helps,
Regards,
Con.

d.
--
***************************************************************************
*                            *    Visit my homepage:                      *
*   Rasmus Rønlev DOEK'94    *    http://www.econ.cbs.dk/people/raro94ab  *
*   Student instructor       *    Visit my Multi User Dungeon (MUD):      *
*   Mailto: rr@cbs.dk        *    ns3.ptd.net 5000 or 198.80.46.3 5000    *   
***************************************************************************
*                                                                         *
*      Student, B.Sc in Computer Science and Business Administration      *
*                                                                         *
***************************************************************************



This archive was generated by hypermail 2b30 : 12/18/00 PST