musicmud-2.1.6/data/
musicmud-2.1.6/data/help/
musicmud-2.1.6/data/policy/
musicmud-2.1.6/data/wild/
musicmud-2.1.6/data/world/
musicmud-2.1.6/doc/
musicmud-2.1.6/src/ident/
musicmud-2.1.6/src/lua/
musicmud-2.1.6/src/lua/include/
musicmud-2.1.6/src/lua/src/lib/
musicmud-2.1.6/src/lua/src/lua/
musicmud-2.1.6/src/lua/src/luac/
static void unarmed_do_fumble(MudObject *attacker, MudObject *victim, MudObject *w, int &selfdamage, int &delay, int mroll) {
  /* XXX : Needs ->victim messages doing possibly */

  if (mroll < -100) {
    attacker->printf("You trip and dive headfirst at the ground. Your neck snaps and you die instantly.\n");
    attacker->oprintf(cansee, "%#M trips, diving headfirst at the ground, you hear the sound of a snapped neck and %s dies instantly.\n", attacker, he_or_she(attacker));
    /* player dies */
    combat_kill(victim, attacker, "(fumble) neck broken by", "has a broken neck");
  } else

    if (mroll < -99) {
    attacker->printf("You fall to the ground.\n");
    attacker->oprintf(cansee, "%#M %[falls/fall] to the ground.\n", attacker);
    /*make player seated, make player drop all give player some damage */
    attacker->set_flag(FL_SITTING, 1);
    attacker->interpret("drop all");
    dropweapon(attacker);
    selfdamage = random_number(20);
  } else

    if (mroll < -90) {
    attacker->printf("You stumble and miss your chance to attack.\n");
    attacker->oprintf(cansee, "%#M %[stumbles/stumble] and %[misses/miss] %s chance to attack.\n", attacker, his_or_her(attacker));
    /*miss this attack and delay to next*/
    delay += 2;
  } else

    if (mroll < -80) {
    attacker->printf("You slap yourself in the face.\n");
    attacker->oprintf(cansee, "%#M %[slaps/slap] %sself in the face.\n", attacker, him_or_her(attacker));
    /*small delay to next attack and small ammount of damage  */
    delay += 1;
    selfdamage = random_number(10);
  } else

    if (mroll < -70) {
    attacker->printf("You stub your toe.\n");
    attacker->oprintf(cansee, "%#M %[stubs/stub] %s toe.\n", attacker, his_or_her(attacker));
    selfdamage = random_number(10);
    /*take a small amount of damage  */
  } else

    if (mroll < -50) {
    attacker->printf("You completely miss and spin yourself round.\n");
    attacker->oprintf(cansee, "%#M completely %[misses/miss] and %[spins/spin] %sself round.\n", attacker, him_or_her(attacker));
    delay += 2;
    /*small delay to next attack */
  } else
    {
      delay += 0;
      attacker->printf("You have second thoughts about attacking.\n");
      attacker->oprintf(cansee, "%#M %[has/have] second thoughts about attacking.\n", attacker);
      /*no attack this round*/
    }
}


static void impact_do_fumble(MudObject *attacker, MudObject *victim, MudObject *w, int &selfdamage, int &delay, int mroll) {
  /* XXX : needs ->victim stuff?, and the code coding */
              if (mroll < -100) {
	        	attacker->printf("You accidentally strike yourself in the back of the neck, snapping several vertibrae and crushing your windpipe. You are dead!\n");
                attacker->oprintf(cansee, "%#M accidentally %[strikes/strike] %sself in the back of the neck, snapping several vertibrae and crushing %s windpipe.\n", attacker, him_or_her(attacker), his_or_her(attacker));
		combat_kill(victim, attacker, "(fumble) spine hit", "has a broken spine");
              } else
         
              if (mroll < -99) {
                attacker->printf("You stumble badly, dropping your equipment and twisting your neck.\n");
                attacker->oprintf(cansee, "%#M %[stumbles/stumble] badly, dropping %s equipment and twisting %s neck.\n", attacker, his_or_her(attacker), his_or_her(attacker));
	            /* drop all, be 'sitting', take 150 hits */
                    attacker->set_flag(FL_SITTING, 1);
                    attacker->interpret("drop all");
                    selfdamage = random_number(50) + 100;
                    dropweapon(attacker);
                    delay += 8;
              } else
        
              if (mroll < -90) {
                attacker->printf("You manage to club yourself in the chest.\n");
                attacker->oprintf(cansee, "%#M %[manages/manage] to club %sself in the chest.\n", attacker, him_or_her(attacker));
	            /*take full max damage from the weapon and large decrease to next attack speed */
                selfdamage = damage(w);
                delay += 4;
              } else
        
              if (mroll < -80) {
                if (dropweapon(attacker)) {
		  attacker->printf("You trip, dropping %Y on your foot.\n", w);
		  attacker->oprintf(cansee, "%#M %[trips/trip], dropping %P on %s foot.\n", attacker, w, his_or_her(attacker));
		  /* take half the max damage of the weapon, and move the weapon to the floor*/
		  selfdamage = damage(w) / 2;
		}
                delay += 3;

              } else
        
              if (mroll < -70) {
                attacker->printf("You manage to hit yourself with %Y.\n", w);
                attacker->oprintf(cansee, "%#M %[manages/manage] to hit %sself with %P.\n", attacker, him_or_her(attacker), w);
	            /* take an unmodified hit on yourself and medium decrease to next attack speed*/
                selfdamage = random_number(damage(w));
                delay += 3;

              } else

              if (mroll < -50) {
                attacker->printf("You completely miss and the weight of %Y spins you round.\n", w);
                attacker->oprintf(cansee, "%#M completely %[misses/miss] and the weight of %P spins %s round.\n", attacker, w, him_or_her(attacker));
	            /* larger decrease in next attack speed */
                delay += 2;


              } else {
                attacker->printf("You lose grip of %Y.\n", w);
                attacker->oprintf(cansee, "%#M %[loses/lose] grip of %P.\n", attacker, w);
	            /* slight decrease in next attack speed */
                delay += 2;
              }
}


static void energy_do_fumble(MudObject *attacker, MudObject *victim, MudObject *w, int &selfdamage, int &delay, int mroll) {
  /* XXX : needs ->victim stuff?,  needs weapon name macros doing*/
              if (mroll < -100) {
	             attacker->printf("%Y overloads causing a large explosion. Your chest implodes from the force and you fall over dead!\n", w);
                 attacker->oprintf(cansee, "%#M's ^o%s^n overloads causing a large explosion. %#s chest implodes from the force and %s falls over dead!\n", attacker, w->get("short"), his_or_her(attacker), he_or_she(attacker));
	             /* well... er  dead player*/
		 combat_kill(victim, attacker, "(fumble) weapon exploded", "has major chest wounds");
              } else
         
              if (mroll < -99) {
                attacker->printf("You stumble badly, dropping your equipment and twisting your neck.\n");
                attacker->oprintf(cansee, "%#M %[stumbles/stumble] badly, dropping %s equipment and twisting %s neck.\n", attacker, his_or_her(attacker), his_or_her(attacker));
             /* drop all, be 'sitting', take 150 hits */
                attacker->set_flag(FL_SITTING, 1);
                attacker->interpret("drop all");
                dropweapon(attacker);
                selfdamage = random_number(50) + 100;
                delay += 8;

              } else
        
              if (mroll < -90) {
                attacker->printf("%Y misfires and you get hit in the chest, in the shock you drop your weapon.\n");
                attacker->oprintf(cansee, "%#M's %[misfires/misfire] %P and %s gets hit in the chest, causing %s to drop %P.\n", attacker, w, he_or_she(attacker), him_or_her(attacker), w );
	            /* take a hit in the chest, and move the weapon to the floor and large decrease to next attack speed */
                selfdamage = random_number(damage(w));
                dropweapon(attacker);
                delay += 4;

              } else
        
              if (mroll < -80) {
                attacker->printf("You accidentally throw %Y to the floor permanently damaging it.\n", w);
                attacker->oprintf(cansee, "%#M accidentally %[throws/throw] %P to the floor permanently damaging it.\n", attacker, w);
	            /*decrease the max charges of the weapon by 50% */
                delay += 8;
                dropweapon(attacker);
              } else
        
              if (mroll < -70) {
                attacker->printf("You drop %Y on the ground causing a discharge. You and any attackers are hit.\n", w);
                attacker->oprintf(cansee, "%#M %[drops/drop] %P on the ground causing a discharge. You are hit by the blast.\n", attacker, w);
	            /*move weapon to floor,  you and your opponents take an unmodified hit in the legs, and medium decrease to next  attack speed*/
                dropweapon(attacker);
                delay += 4;
                damageroom(attacker, random_number( damage(w) ) );
              } else

              if (mroll < -50) {
                attacker->printf("You realise you are not holding %Y straight and completely miss. Your next attack is delayed while you regrip.\n", w);
                attacker->oprintf(cansee, "%#M %[realises/realise] %s is not holding %P straight and completely misses.\n", attacker, he_or_she(attacker), w);
	            /* larger decrease in next attack speed */
                delay +=3;
              } else {
        
                attacker->printf("You lose grip of %Y.\n", w);
                attacker->oprintf(cansee, "%#M %[loses/lose] grip of %P.\n", attacker, w);
             /* slight decrease in next attack speed */
                delay +=2;
              }
}

static void cutting_do_fumble(MudObject *attacker, MudObject *victim, MudObject *w, int &selfdamage, int &delay, int mroll) {
  /* XXX : needs ->victim stuff?, */
              if (mroll < -100) {
	             attacker->printf("You accidentally stab yourself in the throat, severing your jugular. You make gargling noises then fall over dead!\n");
                 attacker->oprintf(cansee, "%#M accidentally %[stabs/stab] %sself in the throat, severing %s jugular. %#s makes gargling noises then falls over dead!\n", attacker, him_or_her(attacker), his_or_her(attacker), he_or_she(attacker));
	             /* well... er  dead player*/
		 combat_kill(victim, attacker, "(fumble) throat cut", "has a cut throat");
              } else
         
              if (mroll < -99) {
                attacker->printf("You stumble badly, dropping your equipment and twisting your neck.\n");
                attacker->oprintf(cansee, "%#M %[stumbles/stumble] badly, dropping %s equipment and twisting %s neck.\n", attacker, his_or_her(attacker), his_or_her(attacker) );
            	/* drop all, be 'sitting', take 150 hits */
                attacker->set_flag(FL_SITTING, 1);
                attacker->interpret("drop all");
                dropweapon(attacker);
                selfdamage = random_number(50) + 100;
                delay += 6;


              } else
        
              if (mroll < -90) {
                attacker->printf("You fumble and stab yourself in the leg.\n");
                attacker->oprintf(cansee, "%#M %[fumbles/fumble] and %[stabs/stab] %sself in the leg.\n", attacker,  him_or_her(attacker));
	            /*take full max damage from the weapon and large decrease to next
                attack speed */
                selfdamage = damage(w);
                delay += 6;
              } else
        
              if (mroll < -80) {
                attacker->printf("You trip, dropping %Y on your foot.\n", w);
                attacker->oprintf(cansee, "%#M %[trips/trip], dropping %P on %s foot.\n", attacker, w, his_or_her(attacker));
	            /* take half the max damage of the weapon, and move the weapon to the floor*/
                selfdamage = damage(w) /2;
                delay +=3;
                dropweapon(attacker);
              } else
        
              if (mroll < -70) {
                attacker->printf("You manage to hit yourself with %Y.\n", w);
                attacker->oprintf(cansee, "%#M %[manages/manage] to hit %sself with %P.\n", attacker, him_or_her(attacker), w);
	            /* take an unmodified hit on yourself and medium decrease to next attack speed*/
                selfdamage = random_number( damage(w) );
                delay += 2;
              } else

              if (mroll < -50) {
                attacker->printf("You completely miss and the weight of %Y spins you round.\n", w);
                attacker->oprintf(cansee, "%#M completely %[misses/miss] and the weight of %P spins %s round.\n", attacker, w,  him_or_her(attacker));
	            /* larger decrease in next attack speed */
                delay += 4;
              } else {
        
                attacker->printf("You lose grip of %Y.\n", w);
                attacker->oprintf(cansee, "%#M %[loses/lose] grip of %P.\n", attacker, w);
            	/* slight decrease in next attack speed */
                delay += 2;
              }
}