<commit_before>//////////////////////////////////////////////////////////////////////////
//
// SneezyMUD - All rights reserved, SneezyMUD Coding Team
//
// $Log: disc_sorcery.cc,v $
// Revision 1.2  1999/09/18 06:03:56  brutius
// Fixed typo in energy drain
//
// Revision 1.1  1999/09/12 17:24:04  sneezy
// Initial revision
//
//
//////////////////////////////////////////////////////////////////////////


#include <cmath>

#include "stdsneezy.h"
#include "disease.h"
#include "combat.h"
#include "spelltask.h"
#include "disc_sorcery.h"

int mysticDarts(TBeing *caster, TBeing *victim, int level, byte bKnown, int adv_learn)
{
  char buf[256];
  string misBuf;

  if (caster->isNotPowerful(victim, level, SPELL_MYSTIC_DARTS, SILENT_NO))
    return SPELL_FAIL;

  level = min(level, 10);

  int dam = caster->getSkillDam(victim, SPELL_MYSTIC_DARTS, level, adv_learn);
  // Lets make the missiles at least partly dependant on damage.
  int missiles = (dam / 3) + ::number(0, (caster->GetMaxLevel() / 10));

  caster->reconcileHurt(victim, discArray[SPELL_MYSTIC_DARTS]->alignMod);

  if (bSuccess(caster, bKnown,SPELL_MYSTIC_DARTS)) {
    switch (critSuccess(caster, SPELL_MYSTIC_DARTS)) {
      case CRIT_S_DOUBLE:
        CS(SPELL_MYSTIC_DARTS);
        dam *= 2;
        missiles *= 2;
        sprintf(buf, "%d", missiles);
        misBuf = buf;
        misBuf += " gigantic mystical dart";
        if (missiles != 1)
          misBuf += "s stream";
        else
          misBuf += " streams";

        sprintf(buf, "%s from $n's fingertips, blasting $N!", misBuf.c_str());
        act(buf, FALSE, caster, NULL, victim, TO_NOTVICT);
        sprintf(buf, "%s from your fingertips, blasting $N!", misBuf.c_str());<commit_msg>Fixed "0 missiles" problem in mystic darts<commit_after>//////////////////////////////////////////////////////////////////////////
//
// SneezyMUD - All rights reserved, SneezyMUD Coding Team
//
// $Log: disc_sorcery.cc,v $
// Revision 1.3  1999/10/09 05:23:15  batopr
// Fixed "0 missiles" problem in mystic darts
//
// Revision 1.2  1999/09/18 06:03:56  brutius
// Fixed typo in energy drain
//
// Revision 1.1  1999/09/12 17:24:04  sneezy
// Initial revision
//
//
//////////////////////////////////////////////////////////////////////////


#include <cmath>

#include "stdsneezy.h"
#include "disease.h"
#include "combat.h"
#include "spelltask.h"
#include "disc_sorcery.h"

int mysticDarts(TBeing *caster, TBeing *victim, int level, byte bKnown, int adv_learn)
{
  char buf[256];
  string misBuf;

  if (caster->isNotPowerful(victim, level, SPELL_MYSTIC_DARTS, SILENT_NO))
    return SPELL_FAIL;

  level = min(level, 10);

  int dam = caster->getSkillDam(victim, SPELL_MYSTIC_DARTS, level, adv_learn);
  // Lets make the missiles at least partly dependant on damage.
  int missiles = (dam / 3) + ::number(0, (caster->GetMaxLevel() / 10));
  missiles = max(missiles, 1);

  caster->reconcileHurt(victim, discArray[SPELL_MYSTIC_DARTS]->alignMod);

  if (bSuccess(caster, bKnown,SPELL_MYSTIC_DARTS)) {
    switch (critSuccess(caster, SPELL_MYSTIC_DARTS)) {
      case CRIT_S_DOUBLE:
        CS(SPELL_MYSTIC_DARTS);
        dam *= 2;
        missiles *= 2;
        sprintf(buf, "%d", missiles);
        misBuf = buf;
        misBuf += " gigantic mystical dart";
        if (missiles != 1)
          misBuf += "s stream";
        else
          misBuf += " streams";

        sprintf(buf, "%s from $n's fingertips, blasting $N!", misBuf.c_str());
        act(buf, FALSE, caster, NULL, victim, TO_NOTVICT);
        sprintf(buf, "%s from your fingertips, blasting $N!", misBuf.c_str());
{'fraction_non_alphanumeric': 0.21096345514950166, 'fraction_numerical': 0.0296234772978959, 'mean_word_length': 2.329953917050691, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '5680523', 'n_tokens_mistral': 1374, 'n_tokens_neox': 1235, 'n_words': 304}