Someone mentioned multihitting in relation to a fountain of code or
something and since it's pretty easy, here goes:
void perform_violence(void)
{
[code snip]
int numhits;
int HIT_CLERIC = (LVL_IMMORT - 1) / 3; < The numbers at the
int HIT_WARRIOR = (LVL_IMMORT - 1) / 4; < end basically mean
int HIT_THIEF = (LVL_IMMORT - 1) / 2.5; < that at the max
int HIT_MAGIC = (LVL_IMMORT - 1) / 2; < mortal level, you get
int HIT_MOB = (LVL_IMMORT - 1) / 3.5; < that many attacks.
/* And the decimals are there so when it rounds, some get them faster */
for (j = 1;j <= 4;j++) {
^^^-- Change the 4 if you add more than 4 attacks/round
for (ch = combat_list; ch; ch = next_combat_list) {
next_combat_list = ch->next_fighting;
switch GET_CLASS(ch) {
case CLASS_CLERIC:
numhits = GET_LEVEL(ch) / HIT_CLERIC;
break;
case CLASS_WARRIOR:
numhits = GET_LEVEL(ch) / HIT_WARRIOR;
break;
case CLASS_THIEF:
numhits = GET_LEVEL(ch) / HIT_THIEF;
break;
case CLASS_MAGIC_USER:
numhits = GET_LEVEL(ch) / HIT_MAGIC;
break;
default:
numhits = GET_LEVEL(ch) / HIT_MOB;
}
numhits = MAX(1, numhits); << Without this line you will have _0_
attacks per round (you just sit there)
if (numhits >= j) {
if (FIGHTING(ch) == NULL || ch->in_room != FIGHTING(ch)->in_room) {
stop_fighting(ch);
continue;
}
[npc scrambling snip]
hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
if (MOB_FLAGGED(ch, MOB_SPEC) && mob_index[GET_MOB_RNUM(ch)].func != NULL)
(mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0, "");
}
}
Note: The {}'s might not line up as I had to cut out some of my custom
code, but you should get the idea...
-George
This archive was generated by hypermail 2b30 : 12/18/00 PST