Multiple Attacks

From: ;P (siv@CYBERENET.NET)
Date: 05/18/98


> I have always hated the idea that if you had 3 attacks, and seemingly the
> average number of attacks characters get is about half of that. Mostly when
> your
> stats show you have 3 attacks, you should get 3 attacks. Not a percentage of
> that!

well..i made it so that each attack was a skill, so if you miss you skill
check, you don't get the attack..i also added a cumulative penalty for
missed attacks..ie, if you miss an attack, you get a 10% penalty, if you
miss that one, you get a 20% penalty on the next one..here's my code if
anyone is interested..its based originally on daniel's multi hit patch..


/* control the fights going on.  Called every 2 seconds from comm.c. */
void perform_violence(void)
{
  struct char_data *ch;
  struct char_data *vict;
  struct obj_data *weapon;
  int apr, i, missed = 0;
  int attack_skl[12] = {
        SKILL_SECOND_ATTACK, SKILL_THIRD_ATTACK, SKILL_FOURTH_ATTACK,
        SKILL_FIFTH_ATTACK, SKILL_SIXTH_ATTACK, SKILL_SEVENTH_ATTACK,
        SKILL_EIGHTH_ATTACK, SKILL_NINTH_ATTACK, SKILL_TENTH_ATTACK,
        SKILL_ELEVENTH_ATTACK, SKILL_TWELFTH_ATTACK, SKILL_THIRTEENTH_ATTACK
  };
  int attack_dual[4] = {
        SKILL_DUAL_WIELD, SKILL_SECOND_DUAL_WIELD,
        SKILL_THIRD_DUAL_WIELD, SKILL_FOURTH_DUAL_WIELD
  };


  for (ch = combat_list; ch; ch = next_combat_list) {
    next_combat_list = ch->next_fighting;
    apr = 0;
.
.
stuff snipped
.
.
    if (!IS_NPC(ch))
      for (i = 0; i <= 11; i++)
        if (GET_SKILL(ch, attack_skl[i]))
          if (skill_check(ch, attack_skl[i], "") &&
                (!missed || number(0, (10 * missed)-1))) {
            improve_skill(ch, attack_skl[i]);
            apr++;
          } else missed++;

    if (IS_NPC(ch))
      apr = (int)GET_LEVEL(ch)/10;

    if (IS_AFFECTED(ch, AFF_HASTE))
      apr++;
    if (IS_AFFECTED(ch, AFF_SLOW))
      apr--;

    if (IS_AFFECTED(ch, AFF_FRENZY)) {
      apr *= 2;
      REMOVE_BIT(AFF_FLAGS(ch), AFF_FRENZY);
    }

    if (is_ranger(ch))
      apr = MAX(-1, MIN(apr, 0));
    else
      apr = MAX(-1, MIN(apr, 30));

    if (apr >= 0)
      for (; apr >= 0 && vict; apr--)
        if (GET_POS(vict) > POS_DEAD)
          hit(ch, vict, TYPE_UNDEFINED, weapon);
        else {
          stop_fighting(ch);
          if (FIGHTING(vict))
            stop_fighting(vict);
          break;
        }

    if ((weapon = GET_EQ(ch, WEAR_WIELD_2)) &&
        GET_OBJ_TYPE(weapon) == ITEM_WEAPON) {
      apr = 0;
      missed = 0;
      for (i = 0; i <= 3; i++)
        if (GET_SKILL(ch, attack_dual[i]))
          if (skill_check(ch, attack_dual[i], "") &&
                !(missed && number(0, missed))) {
            improve_skill(ch, attack_dual[i]);
            apr++;
          } else missed++;

      if (apr >= 1)
        for (; apr >= 1 && vict; apr--)
          if (GET_POS(vict) > POS_DEAD)
            hit(ch, vict, TYPE_UNDEFINED, weapon);
          else {
            stop_fighting(ch);
            if (FIGHTING(vict))
              stop_fighting(vict);
            break;
          }
    }

siv


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