Re: Multiple attacks?

From: Brian Jones (balif@nacs.net)
Date: 02/22/96


On Thu, 22 Feb 1996 BODE@juncol.juniata.edu wrote:

> I'm attempting to implement some new skills for fighter-types, and I noticed
> that each character has one attack per round (not counting kick, punch, etc.).
> Now I'm sure that someone has done this many times before, but how the ?????
> would you go about doing multiple automatic attacks per round?  I figure that
> you would have to change both act.violent.c and fight.c in some way.  Any
> answers?
> 
>  ------------------------------------------------------------------------------
> (    Wyatt J. Bode    |   Macintosh Specialist/Manager   |   Juniata College   )
> (                    /      bode@juncol.juniata.edu       \                    )
>  ------------------------------------------------------------------------------
> 

	this was one of my first modifications in circle mud. Look at the 
very very end of fight.c .. it says hit(stuff);
thats the one attack you get.

	What I did is add skills second_attack, third_attack, 
fourth_attack. First off I did a hit(); because I always wanted players 
to get at least one attack. Then I checked to see if the player was 
hasted via the haste spell I added. If they where and not slowed they 
instantly got another hit();. 

	Then it got their second_attack percentage, and rolled it to see 
if they made their second attack. If they are slowed second_attack is 
automaticaly ignored. If they successfuly second attacked hit() is called 
again. third_attack and fourth_attack came soon after. Later, I added a 
-20%/+20% roll to modify the *_attacks since I wanted combat to be a bit 
more random not 4 hits bam bam bam bam every round. 

	There are two ways I came up with of making mobs get more than 
one attack. I added an e-type flag called Att: that said how many times 
the mob could attack, and mobs first rolled between 60-90% for their 
skill, and attempted to make that roll to attack more than once. If the 
mob was e-type but did not have the Att: var it would do a foruma based 
on level, number/size of damage dice, and dex. S type mobs would only get 
one attack per round.

	the code for multiple attacks for players is not hard at all 
using this method. the mob attacks took me a bit to work out a good method.
I also created dogdge and parry by doing some modding of the code.. if 
the player had dodge he tried to dodge a successfull hit, and if he had 
parry and a weapon he tried to parry.. If he made it damage was changed 
to -2 or -1, and approrpiate messages where displayed. I then made a few 
IF statements to ensure that when damage was -2 or -1 it didn't do 
anything like try to give the player hits, sanct shift it, calculate exp, 
range check it, or anything like that. Getting that code to work took a 
little more effort (many small bugs;)

	-Balif



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