Re: [NEWBIE] Double Hit

From: Chris Jacobson (fear@ATHENET.NET)
Date: 12/25/97


On 12/24/97 10:22 PM, Jory Graham (Treimor@STRATOS.NET) stated:

>Sorry about posting so much...I am getting all the questions i have had
>built up for a while...I got a problem with double hit.  It seems when i
>throw it into perform_violence, and i execute the skill, it works fine.
>The problem is when the first hit kills the mob, the second one tries to
>hit something that isnt there and crashes the mud.  I tried everything I
>could think of but it kept crashing. I used the code from the circle ftp
>site.

The solution to this, that i did, is to have damage/hit/etc return a
boolean, "false" if the target is still alive and "true" if it is dead.
This allows you to check if you have killed it or not, and whether or not
you should continue doing damage.

Another trick is to have all the damage and number of hits tallied
beforehand (if they are of the same type), and pass that into damage.
This is also what I do, so that players see such as:

(2 misses) You try to shoot Jake a couple times, but miss.
or
(2 hits) You graze Jake with your shoot a couple times, which he hardly
notices.
or
(1 hit) You graze Jake with your shoot, which he hardly notices.

Its something I termed, "Less Combat Spam".  Also, with this, "hit" has a
special subroutine loop that does the calculations of hits for each
attack, and totals damage.  We needed this since our combat allows up to
12 hits with a single weapon (although for safety reasons staff can only
OLC edit it to a max of 10).

- Chris Jacobson


     +------------------------------------------------------------+
     | 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/08/00 PST