<commit_before>#include "handler.h"
#include "being.h"
#include "combat.h"
#include "obj_general_weapon.h"
#include "materials.h"
#include "skills.h"

//#define ALLOW_STAB_SEVER
#define USE_NEW_STAB

spellNumT doStabMsg(TBeing *tThief, TBeing *tSucker, TGenWeapon *tWeapon, wearSlotT tLimb, int & tDamage, int tSever)
{
  const float tDamageValues[MAX_WEAR] =
  { 0.00, // Nowhere
    1.50, // Head
    1.10, // Neck
    1.05, // Body
    1.10, // Back
    0.90, // Arm-R
    0.90, // Arm-L
    0.80, // Wrist-R
    0.80, // Wrist-L
    0.40, // Hand-R
    0.40, // Hand-L
    0.20, // Finger-R
    0.20, // Finger-L
    1.20, // Waist
    1.10, // Leg-R
    1.10, // Leg-L
    0.30, // Foot-R
    0.30, // Foot-L
    0.00, // Hold-R
    0.00, // Hold-L
    1.10, // Ex-Leg-R
    1.10, // Ex-Leg-L
    0.30, // Ex-Foot-R
    0.30, // Ex-Foot-L
  };

  spellNumT tDamageType = DAMAGE_NORMAL;

  switch (tLimb) {
    case WEAR_HEAD:
      tDamageType = (!(rand() % 5) ? DAMAGE_CAVED_SKULL : SKILL_STABBING);
      break;
    case WEAR_NECK:
      tDamageType = (!(rand() % 5) ? DAMAGE_BEHEADED : SKILL_STABBING);
      break;
    case WEAR_BODY:
      tDamageType = DAMAGE_IMPALE;
      break;
    case WEAR_WAIST:
      tDamageType = DAMAGE_DISEMBOWLED_VR;
      break;
    case WEAR_BACK:
      tDamageType = SKILL_STABBING;
      break;
    default:
      tDamageType = TYPE_STAB;
      break;
  }

  // Basically damage is varied based on the limb here.
  tDamage = (int) ((float) tDamage * tDamageValues[tLimb]);

  bool tKill = tThief->willKill(tSucker, tDamage, tDamageType, FALSE);

  sstring tStLimb(tSucker->describeBodySlot(tLimb));
  sstring tStringChar, tStringVict, tStringOthr, tStringMess;

  if (tLimb == WEAR_HEAD && !(rand() % 99) && !tSucker->hasDisease(DISEASE_EYEBALL)) {
    affectedData tAff;

    tStringChar="You glance $N's eyes with your $o, slicing them wide open!";
    tStringVict="$n glances your eyes with $s $o, slicing them wide open!  YOUR BLIND!";
    tStringOthr="$n glances $N's eyes with $s $o, slicing them wide open!";

    tAff.type      = AFFECT_DISEASE;
    tAff.level     = 0;
    tAff.duration  = PERMANENT_DURATION;
    tAff.modifier  = DISEASE_EYEBALL;
    tAff.location  = APPLY_NONE;
    tAff.bitvector = AFF_BLIND;
    tSucker->affectTo(&tAff);
    tSucker->rawBlind(tThief->GetMaxLevel(), tAff.duration, SAVE_NO);
  } else switch (::number(0, 5)) {
    case 0:
      tStringChar=format("You thrust your $o into $N's %s!") % tStLimb;
      tStringVict=format("$n thrusts $s $o into your %s!") % tStLimb;
      tStringOthr=format("$n thrusts $s $o into $N's %s!") % tStLimb;
      break;

    case 1:
      tStringChar=format("You stab $N in $S %s!") % tStLimb;
      tStringVict=format("$n stabs you in your %s!") % tStLimb;
      tStringOthr=format("$n stabs $N in $S %s!") % tStLimb;
      break;

    case 2:
      tStringChar=format("You gouge $N in $S %s!") % tStLimb;
      tStringVict=format("$n gouges you in your %s!") % tStLimb;
      tStringOthr=format("$n gouges $N in $S %s!") % tStLimb;

    default:
      tStringChar=format("You puncture $N's %s with your $o!") % tStLimb;
      tStringVict=format("$n punctures your %s with $s $o!") % tStLimb;
      tStringOthr=format("$n punctures $N's %s with $s $o!") % tStLimb;
      break;
  }

  act(tStringChar, FALSE, tThief, tWeapon, tSucker, TO_CHAR);
  act(tStringVict, FALSE, tThief, tWeapon, tSucker, TO_VICT);
  act(tStringOthr, FALSE, tThief, tWeapon, tSucker, TO_NOTVICT);

  if (tKill) {
    switch (tLimb) {
      case WEAR_HEAD:
        if (tDamageType == SKILL_STABBING) {
          tStringChar="Your weapon sinks DEEP into $N's skull!";
          tStringVict="$n's weapon sinks DEEP into your skull!";
	  tStringOthr="$n's weapon sinks DEEP into $N's skull!";
        } else {
          tStringChar="You cause $N's skull to cave in!";
          tStringVict="$n caused your skull to cave in!";
          tStringOthr="$n caused $N's skull to cave in!";
          tStringMess="You get a good look at $N's grey matter...";
        }

        break;

      case WEAR_NECK:
        if (tDamageType == SKILL_STABBING) {
          tStringChar="You slice $N's neck wide open!";
          tStringVict="$n slices your neck wide open!";
          tStringOthr="$n slices $N's neck wide open!";
          tStringMess="Blood spews forth from $N's severed jugular!";
        } else {
          tStringChar="You sever $N at the neck!";
          tStringVict="$n severs you at the neck!";
          tStringOthr="$n severs $N at the neck!";
          tStringMess="Blood gushes from $N's neck!";
        }

        break;

      case WEAR_BODY:
        if (!(rand() % 9)) {
          tStringChar="You thrust $p DEEP into $N's gut!";
          tStringVict="$n thusts $p DEEP into your gut, good thing you are dead now!";
          tStringOthr="$n thrusts $p DEEP into $N's gut!";
        } else {
          tStringChar="You plunge $p DEEP into $N's chest, you can feel $S heart slow then stop through your weapon";
          tStringVict="$n plunges $p DEEP into your chest, piercing your heart!";
          tStringOthr="$n plunges $p DEEP into $N's chest, looks like he nailed them in the heart!";
          tStringMess="Blood spews forth from the stab wound!";
        }

        break;

      case WEAR_WAIST:
        tStringChar="You slice $N from love handle to love handle!";
        tStringVict="$n slices you from love handle to love handle!";
	tStringOthr="$n slices $N from love handle to love handle!";
        break;

      case WEAR_BACK:
        if (!(rand() % 9) && !tSucker->raceHasNoBones()) {
          tStringChar="You rake $p down $N's back, slicing the spine!";
          tStringVict="$n rakes $p down your back, slicing your spine!";
          tStringOthr="$n rakes $p down the back, slicing their spine!";
        } else {
          tStringChar="You carve a rather nice hole in $N's back!";
          tStringVict="$n carves you a good sized hole in your back!";
          tStringOthr="$n carves $N a good sized hole in the back!";
        }

        break;

      default:
        tStringChar=format("Your stab to $N's %s ceases their existence!") %
	  tStLimb;
        tStringVict=format("$n stabs you in your %s, ceasing your existence!") %
	  tStLimb;
        tStringOthr=format("$n stabs $N in $S %s, ceasing their existence!") %
	  tStLimb;
        break;
    }

    act(tStringChar, FALSE, tThief, tWeapon, tSucker, TO_CHAR);
    act(tStringVict, FALSE, tThief, tWeapon, tSucker, TO_VICT);
    act(tStringOthr, FALSE, tThief, tWeapon, tSucker, TO_NOTVICT);

    if(!tStringMess.empty()){
      act(tStringMess, FALSE, tThief, tWeapon, tSucker, TO_CHAR);
      act(tStringMess, FALSE, tThief, tWeapon, tSucker, TO_ROOM);
    }

    if (tLimb == WEAR_NECK){
      if (tDamageType == DAMAGE_BEHEADED)
        tSucker->makeBodyPart(WEAR_HEAD, tThief);
      else
        tSucker->dropPool(50, LIQ_BLOOD);
    }
  } else {
    // Apply some limb damage and have a *Very* remote chance of whacking the limb off.

    int tHardness = material_nums[tSucker->getMaterial(tLimb)].hardness *
                    tSucker->getCurLimbHealth(tLimb) /<commit_msg>Changing superficial wording<commit_after>#include "handler.h"
#include "being.h"
#include "combat.h"
#include "obj_general_weapon.h"
#include "materials.h"
#include "skills.h"

//#define ALLOW_STAB_SEVER
#define USE_NEW_STAB

spellNumT doStabMsg(TBeing *tThief, TBeing *tSucker, TGenWeapon *tWeapon, wearSlotT tLimb, int & tDamage, int tSever)
{
  const float tDamageValues[MAX_WEAR] =
  { 0.00, // Nowhere
    1.50, // Head
    1.10, // Neck
    1.05, // Body
    1.10, // Back
    0.90, // Arm-R
    0.90, // Arm-L
    0.80, // Wrist-R
    0.80, // Wrist-L
    0.40, // Hand-R
    0.40, // Hand-L
    0.20, // Finger-R
    0.20, // Finger-L
    1.20, // Waist
    1.10, // Leg-R
    1.10, // Leg-L
    0.30, // Foot-R
    0.30, // Foot-L
    0.00, // Hold-R
    0.00, // Hold-L
    1.10, // Ex-Leg-R
    1.10, // Ex-Leg-L
    0.30, // Ex-Foot-R
    0.30, // Ex-Foot-L
  };

  spellNumT tDamageType = DAMAGE_NORMAL;

  switch (tLimb) {
    case WEAR_HEAD:
      tDamageType = (!(rand() % 5) ? DAMAGE_CAVED_SKULL : SKILL_STABBING);
      break;
    case WEAR_NECK:
      tDamageType = (!(rand() % 5) ? DAMAGE_BEHEADED : SKILL_STABBING);
      break;
    case WEAR_BODY:
      tDamageType = DAMAGE_IMPALE;
      break;
    case WEAR_WAIST:
      tDamageType = DAMAGE_DISEMBOWLED_VR;
      break;
    case WEAR_BACK:
      tDamageType = SKILL_STABBING;
      break;
    default:
      tDamageType = TYPE_STAB;
      break;
  }

  // Basically damage is varied based on the limb here.
  tDamage = (int) ((float) tDamage * tDamageValues[tLimb]);

  bool tKill = tThief->willKill(tSucker, tDamage, tDamageType, FALSE);

  sstring tStLimb(tSucker->describeBodySlot(tLimb));
  sstring tStringChar, tStringVict, tStringOthr, tStringMess;

  if (tLimb == WEAR_HEAD && !(rand() % 99) && !tSucker->hasDisease(DISEASE_EYEBALL)) {
    affectedData tAff;

    tStringChar="You glance $N's eyes with your $o, slicing them wide open!";
    tStringVict="$n glances your eyes with $s $o, slicing them wide open!  YOUR BLIND!";
    tStringOthr="$n glances $N's eyes with $s $o, slicing them wide open!";

    tAff.type      = AFFECT_DISEASE;
    tAff.level     = 0;
    tAff.duration  = PERMANENT_DURATION;
    tAff.modifier  = DISEASE_EYEBALL;
    tAff.location  = APPLY_NONE;
    tAff.bitvector = AFF_BLIND;
    tSucker->affectTo(&tAff);
    tSucker->rawBlind(tThief->GetMaxLevel(), tAff.duration, SAVE_NO);
  } else switch (::number(0, 5)) {
    case 0:
      tStringChar=format("You thrust your $o into $N's %s!") % tStLimb;
      tStringVict=format("$n thrusts $s $o into your %s!") % tStLimb;
      tStringOthr=format("$n thrusts $s $o into $N's %s!") % tStLimb;
      break;

    case 1:
      tStringChar=format("You stab $N in $S %s!") % tStLimb;
      tStringVict=format("$n stabs you in your %s!") % tStLimb;
      tStringOthr=format("$n stabs $N in $S %s!") % tStLimb;
      break;

    case 2:
      tStringChar=format("You gouge $N in $S %s!") % tStLimb;
      tStringVict=format("$n gouges you in your %s!") % tStLimb;
      tStringOthr=format("$n gouges $N in $S %s!") % tStLimb;

    default:
      tStringChar=format("You puncture $N's %s with your $o!") % tStLimb;
      tStringVict=format("$n punctures your %s with $s $o!") % tStLimb;
      tStringOthr=format("$n punctures $N's %s with $s $o!") % tStLimb;
      break;
  }

  act(tStringChar, FALSE, tThief, tWeapon, tSucker, TO_CHAR);
  act(tStringVict, FALSE, tThief, tWeapon, tSucker, TO_VICT);
  act(tStringOthr, FALSE, tThief, tWeapon, tSucker, TO_NOTVICT);

  if (tKill) {
    switch (tLimb) {
      case WEAR_HEAD:
        if (tDamageType == SKILL_STABBING) {
          tStringChar="Your weapon sinks DEEP into $N's skull!";
          tStringVict="$n's weapon sinks DEEP into your skull!";
	  tStringOthr="$n's weapon sinks DEEP into $N's skull!";
        } else {
          tStringChar="You cause $N's skull to cave in!";
          tStringVict="$n caused your skull to cave in!";
          tStringOthr="$n caused $N's skull to cave in!";
          tStringMess="You get a good look at $N's grey matter...";
        }

        break;

      case WEAR_NECK:
        if (tDamageType == SKILL_STABBING) {
          tStringChar="You slice $N's neck wide open!";
          tStringVict="$n slices your neck wide open!";
          tStringOthr="$n slices $N's neck wide open!";
          tStringMess="Blood spews forth from $N's severed jugular!";
        } else {
          tStringChar="You sever $N at the neck!";
          tStringVict="$n severs you at the neck!";
          tStringOthr="$n severs $N at the neck!";
          tStringMess="Blood gushes from $N's neck!";
        }

        break;

      case WEAR_BODY:
        if (!(rand() % 9)) {
          tStringChar="You thrust $p DEEP into $N's gut!";
          tStringVict="$n thusts $p DEEP into your gut, good thing you are dead now!";
          tStringOthr="$n thrusts $p DEEP into $N's gut!";
        } else {
          tStringChar="You plunge $p DEEP into $N's chest, you can feel $S heart slow then stop through your weapon";
          tStringVict="$n plunges $p DEEP into your chest, piercing your heart!";
          tStringOthr="$n plunges $p DEEP into $N's chest, looks like he nailed them in the heart!";
          tStringMess="Blood spews forth from the stab wound!";
        }

        break;

      case WEAR_WAIST:
        tStringChar="You slice $N from love handle to love handle!";
        tStringVict="$n slices you from love handle to love handle!";
	tStringOthr="$n slices $N from love handle to love handle!";
        break;

      case WEAR_BACK:
        if (!(rand() % 9) && !tSucker->raceHasNoBones()) {
          tStringChar="You rake $p down $N's back, slicing the spine!";
          tStringVict="$n rakes $p down your back, slicing your spine!";
          tStringOthr="$n rakes $p down the back, slicing their spine!";
        } else {
          tStringChar="You carve a rather nice hole in $N's back!";
          tStringVict="$n carves you a good sized hole in your back!";
          tStringOthr="$n carves $N a good sized hole in the back!";
        }

        break;

      default:
        tStringChar=format("Your stab to $N's %s ends their life in a final <r>spray of blood<z>!") %
	  tStLimb;
        tStringVict=format("$n stabs you in your %s, ending your life in a final <r>spray of blood<z>!") %
	  tStLimb;
        tStringOthr=format("$n stabs $N in $S %s, ending their life in a final <r>spray of blood<z>!") %
	  tStLimb;
        break;
    }

    act(tStringChar, FALSE, tThief, tWeapon, tSucker, TO_CHAR);
    act(tStringVict, FALSE, tThief, tWeapon, tSucker, TO_VICT);
    act(tStringOthr, FALSE, tThief, tWeapon, tSucker, TO_NOTVICT);

    if(!tStringMess.empty()){
      act(tStringMess, FALSE, tThief, tWeapon, tSucker, TO_CHAR);
      act(tStringMess, FALSE, tThief, tWeapon, tSucker, TO_ROOM);
    }

    if (tLimb == WEAR_NECK){
      if (tDamageType == DAMAGE_BEHEADED)
        tSucker->makeBodyPart(WEAR_HEAD, tThief);
      else
        tSucker->dropPool(50, LIQ_BLOOD);
    }
  } else {
    // Apply some limb damage and have a *Very* remote chance of whacking the limb off.

    int tHardness = material_nums[tSucker->getMaterial(tLimb)].hardness *
                    tSucker->getCurLimbHealth(tLimb) /
{'fraction_non_alphanumeric': 0.13112711160343396, 'fraction_numerical': 0.011908058709498754, 'mean_word_length': 2.617580766341097, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2194901', 'n_tokens_mistral': 5621, 'n_tokens_neox': 5348, 'n_words': 1452}