Re: Multiple Attacks

From: ShadowLord (dkoepke@california.com)
Date: 07/01/96


On Mon, 1 Jul 1996, Brian Burrell wrote:

> 
> 
> there is a easy way to do this... but at the expsence of a bit of lag..
> 
> just make a new perform_violence... i'll call it handle_violence..  in
> comm.c add it to the heartbeat at whatever speed you have perform_violence
> at (hehe *whine* can't set hits to faster than 1 second intervals) the
> heartbeat...   then have whatever your doing to get that second hit in
> over at the other handle_violence..ex..
> 
> if (FIGHTING(ch) && IS_AFFECTED(AFF_BLART))
> 	hit(bing, bong);
> 
> this will be called ever 1 to 2 seconds so even tho it will look nicer it
> has a nice potentional at adding on some lag..  but i dunno for sure..

I personally think it's better to just do it within the perform_violence()
function.  You may place a loop wherever you want (it's even possible to
place the loop outside of the combat_list loop (provided you be careful)
to give the same kind of scattering effect of attacks that is done with
your suggested method.  It's also possible to do it within the loop, which
is (probably) the easiest way to do it, taking up maybe 3-4 lines of code.
I posted some code (which I wrote in the mailer) earlier on, which you
might want to reference if anyone saved it (I personally have never saw
any reason to save my own e-mail messages until now :)).

> I also tried a buncha whacky ass stuff like setting up 2 to 3 different
> 'perform_vioence's all at different speed intervals.. i was attemping to
> set different speeds for the chars and having it hit them 'not so
> regularly'.. but i ended up having too many that would come up at the same
> time.. kinda demolishing my main idea...

The way I did it was to create a temporary variable in char_speicals_data
(is that the proper name of the structure?  Where "fighting" is cast...)
called 'rounds_till_hit.'  Then I created a procedure to calculate the
speed of the hits.  This basically consisted of some random number
generation, affects to it via equipment (weapon weight/affects, armor
weight and position, etc.), spells, and some more randomness added to get
the rounds down to a sane number (anything over 5s is really too long).

Then, in perform_violence() I made it so it decremented the
rounds_till_hit variable of the player until it was zero before they could
hit.  In perform_violence() I also added a call to the calculate_speed()
function I wrote [just before the hit() call, but it doesn't matter where
you add it, provided it's somewhere where it will be reached every time
perform_violence() calls hit()].

It wasn't too time consuming and from the looks of things, no bugs have
resulted, although I've not tested it extensively.

	-dak



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