<commit_before>//////////////////////////////////////////////////////////////////////////
//
// SneezyMUD - All rights reserved, SneezyMUD Coding Team
//
// $Log: materials.cc,v $
// Revision 1.1  1999/09/12 17:24:04  sneezy
// Initial revision
//
//
//////////////////////////////////////////////////////////////////////////


//
//      SneezyMUD - All rights reserved, SneezyMUD Coding Team
//      "materials.cc" - Various functions related to materials.
//
//      Last major revision : August 1996
//
//////////////////////////////////////////////////////////////////////////


#include "stdsneezy.h"
#include "statistics.h"

static bool genericDamCheck(int susc, int sharp)
{
  int chance = 1000 - (int) (1000 * gold_modifier[GOLD_REPAIR]); 
  if (::number(0,999) < chance)
    return false;

  // num is the hardness of what i a hitting
  // susc is the hardness of the hitter
  // for the NPC vs PC situation, sharp comes from sharpness[] which
  // we can roughly figure is "30"
  // we should shoot for the randomness being roughly what the susc would
  // be : implying (num + susc) > number(30,130)
  // but make the chance fairly high and let the global modifier above
  // suck up the slack to make economy come out right
  // the min(30, sharp) case is to keep PC v NPC from shredding equipment
  if (sharp && susc && ((min(30, sharp) + susc) > ::number(20, 120)))
    return TRUE;

  return false;
}
<commit_msg>*** empty log message ***<commit_after>//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 1996, SneezyMUD Coding Team
// All rights reserved.
//
// "materials.cc" - Various functions related to materials.
//
// $Log: materials.cc,v $
// Revision 1.2  1999/09/13 13:52:13  batopr
// *** empty log message ***
//
// Revision 1.1  1999/09/12 17:24:04  sneezy
//
//////////////////////////////////////////////////////////////////////////

#include "stdsneezy.h"
#include "statistics.h"

static bool genericDamCheck(int susc, int sharp)
{
  int chance = 1000 - (int) (1000 * gold_modifier[GOLD_REPAIR]); 
  if (::number(0,999) < chance)
    return false;

  // num is the hardness of what i a hitting
  // susc is the hardness of the hitter
  // for the NPC vs PC situation, sharp comes from sharpness[] which
  // we can roughly figure is "30"
  // we should shoot for the randomness being roughly what the susc would
  // be : implying (num + susc) > number(30,130)
  // but make the chance fairly high and let the global modifier above
  // suck up the slack to make economy come out right
  // the min(30, sharp) case is to keep PC v NPC from shredding equipment
  if (sharp && susc && ((min(30, sharp) + susc) > ::number(20, 120)))
    return TRUE;

  return false;
}

{'fraction_non_alphanumeric': 0.24078803356439255, 'fraction_numerical': 0.04086099963516965, 'mean_word_length': 1.8123076923076924, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '4179892', 'n_tokens_mistral': 885, 'n_tokens_neox': 771, 'n_words': 306}