Re: [CODE] [QUESTION] Fighting procedure

From: Daniel Koepke (dkoepke@CALIFORNIA.COM)
Date: 05/02/98


On Sat, 2 May 1998, Christoffer Lundberg wrote:

->What can be done? Any suggestions. (I have the Multi_attacks snippet).

This may or may not be what you are looking for.  It is something of a
repost from a long while ago (I posted a method very similar to this
before), but here goes anyway.

In structs.h change PULSE_VIOLENCE to 1 RL_SEC and add an 'int
wait_hit;' to char_special_data.  Now, add a function for calculating
the speed of a hit to fight.c,

  int calculate_speed(struct char_data * ch)
  {
    int retval = 2; /* default is 2 PULSE_VIOLENCEs */
    retval += number(-1, 2);
    /* add spell affects, class/level modifiers, dex mod, etc. here */
    return MAX(1, MIN(retval, MAX_COMBAT_SPEED));
  }

Also add the MAX_COMBAT_SPEED to structs.h.  I put it around 7.  It
defines how slow a hit can be at maximum, and is used for making sure
combat doesn't get _really_ slow (e.g., two people having to wait 15
seconds between attacks is bad)...Also, you may want to add a macro to
utils.h to point to ch->char_specials.wait_hit (if you like macros,
that is :), I'll call it GET_HITSPEED(ch).

Now, in hit(), pretty much at the top (it doesn't matter where you put
it really, but it's probably safer and easier to put it at the top of
the function to ensure it doesn't get skipped over) put,

  GET_HITSPEED(ch) = calculate_hit_speed(ch);

And finally in perform_violence before the hit() call add,

  if (GET_HITSPEED(ch)--)
    continue;

Now what does this do?  Well, it makes the hits timed.  Instead of
having multiple attacks you have slow and fast people.  Faster people
will get off more attacks than slower people.  Of course, you should
balance this so that slower people tend to be bigger and stronger,
doing more damage at the cost of being fast.  In addition, you might
want to add multiple attacks for certain weapons (the 5 headed whip)
by doing the old loop around the hit().  In this way, you get timed
attacks and the affect of having a five-headed whip (of course, tune
down the damage done by one hit of the five-headed whip, first, since
the person will be getting hit 5 times).

This can actually be a lot of fun to play with...:)

-dak


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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