combat

From: Edward Glamkowski (EGlamkowski@MATHEMATICA-MPR.COM)
Date: 09/04/97


I sent this to Alex for his snippets page, but since he is
so busy and it probably won't be posted there for a while,
I'll just post it here...

With the talk about combat spam, this seems at least
remotely relevent :)
This was taken from the list archive, from almost a year
ago.  I was looking for it earlier this week, and thought
maybe some other people might be interested.
It is for a roundless combat system, using initiative
instead.  This way everyone attacks at different times.
Though I guess it could still be spammy, but in a different
sort of way ;)

I used this for my mud, and it works great!

---------------
> I was wondering if anyone had implemented an initivative
> <sp?> system for MUD combat. Where the order of attacks
> each round was not the same all the time, it could take
> into account dex mods and weapon speed and things like
> that. I have been looking around the code and wondering if
> it is even such a good idea...
>
> Anyone been down this road at all?

Did it. And it was actually quite easy! [IF ANYONE
INTREPRETS THAT AS AN INSULT TO ANYONE'S INTELLIGENCE I WILL
SLAP THE LIVING HELL OUT OF THEM] What I did was change the
combat pulses to occur every second, then I made a temp
variable for characters (where-ever they have 'fighting' and
'hunting' and all those other temporary things) that would
save how long it takes to attack. Next I created a function
called 'calculate_speed' that took into account HASTE and
SLOW, and dextrity, weapon weight, what they person was
wearing (eg., huge armor slowed them down), what they were
carrying (lots of weight slowed them down), terrain, etc.,
etc. and a bit of randomisity then returned that.  In hit()
I would do: 'NEXT_HIT(ch) = calculate_speed(ch);' and a
check to make sure that their opponent was fighting (if not
then I made them hit the person to get them fighting).
Finally, in perform_violence() I did something like:

if ((NEXT_HIT(ch)--))
  continue;

Inside my loop...

Oh, now that I think about it, my multi-code (which was very
simple) that, in response to someone else, I tried to have
mix attacks up, would benefit from this. And actually, on my
MUD, this completely replaces the multi-hit code. I figure
if the person is fast enough, they'll get off a hit or two
before their opponent does, anyway.

<*=-+Daniel+-=*>
"Forgive me father, for I am sin."

Edward Glamkowski, Programmer           Mathematica Policy Research
EGlamkowski@mathematic-MPR.COM          Princeton, NJ
                http://www.mathematica-mpr.com/

                                             eschew obfuscation


     +------------------------------------------------------------+
     | 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