<commit_before>import React from 'react';
import Analyzer from 'Parser/Core/Analyzer';
import SPELLS from 'common/SPELLS';
import SpellLink from 'common/SpellLink';
import { formatNumber } from 'common/format';

class UnempoweredLS extends Analyzer {
  _castQueue = {
    empowered: false,
    enemies: 0,
  };
  casts = [];
  _lunarEmpsOn = false;
  _warriorOfEluneOn = false;
  _owlkinFrenzyOn = false;

  suboptUmempLS = 0;

  isLunarStrike(event) {
    const spellId = event.ability.guid;
    return spellId === SPELLS.LUNAR_STRIKE.id;
  }
  isLunarEmpowerment(event) {
    const spellId = event.ability.guid;
    return spellId === SPELLS.LUNAR_EMP_BUFF.id;
  }
  isOwlkinFrenzy(event) {
    const spellId = event.ability.guid;
    return spellId === SPELLS.OWLKIN_FRENZY.id;
  }
  isWarriorOfElune(event) {
    const spellId = event.ability.guid;
    return spellId === SPELLS.WARRIOR_OF_ELUNE_TALENT.id;
  }

  on_byPlayer_cast(event) {
    if (!this.isLunarStrike(event)) {
      return;
    }
    this.casts.push(this._castQueue);
    this._castQueue = {
      empowered: this._lunarEmpsOn || this._warriorOfEluneOn || this._owlkinFrenzyOn,
      enemies: 0,
    };
  }

  on_byPlayer_damage(event) {
    if (!this.isLunarStrike(event)) {
      return;
    }
    this._castQueue.enemies += 1;
  }

  on_toPlayer_applybuff(event) {
    if (this.isLunarEmpowerment(event)) {
      this._lunarEmpsOn = true;
    } else if (this.isWarriorOfElune(event)) {
      this._warriorOfEluneOn = true;
    }  else if (this.isOwlkinFrenzy(event)) {
      this._owlkinFrenzyOn = true;
    }  
  }
  on_toPlayer_removebuff(event) {
    if (this.isLunarEmpowerment(event)) {
      this._lunarEmpsOn = false;
    } else if (this.isWarriorOfElune(event)) {
      this._warriorOfEluneOn = false;
    } else if (this.isOwlkinFrenzy(event)) {
      this._owlkinFrenzyOn = false;
    }
  }

  on_finished() {
    this.casts.push(this._castQueue);

    this.suboptUmempLS = this.casts.filter((cast) =>  !cast.empowered && cast.enemies > 0 && cast.enemies < 4).length;
  }

  suggestions(when) {
    const suboptPerMin = ((this.suboptUmempLS) / (this.owner.fightDuration / 1000)) * 60;
    when(suboptPerMin).isGreaterThan(0)
      .addSuggestion((suggest, actual, recommended) => {
        return suggest(<span>You casted {this.suboptUmempLS} unempowered <SpellLink id={SPELLS.LUNAR_STRIKE.id} /> that hit less than 4 targets. Always prioritize Solar Wrath as a filler if there are less than 4 targets.</span>)
          .icon(SPELLS.LUNAR_STRIKE.icon)
          .actual(`${formatNumber(actual)} Unempowered LS per minute`)
          .recommended(`${recommended} Unempowered LS that hits less than 4 targets are recomended`)
          .regular(recommended + 2).major(recommended + 4);
      });
  }
}

export default UnempoweredLS;<commit_msg>suggestion text change<commit_after>import React from 'react';
import Analyzer from 'Parser/Core/Analyzer';
import SPELLS from 'common/SPELLS';
import SpellLink from 'common/SpellLink';
import { formatNumber } from 'common/format';

class UnempoweredLS extends Analyzer {
  _castQueue = {
    empowered: false,
    enemies: 0,
  };
  casts = [];
  _lunarEmpsOn = false;
  _warriorOfEluneOn = false;
  _owlkinFrenzyOn = false;

  suboptUmempLS = 0;

  isLunarStrike(event) {
    const spellId = event.ability.guid;
    return spellId === SPELLS.LUNAR_STRIKE.id;
  }
  isLunarEmpowerment(event) {
    const spellId = event.ability.guid;
    return spellId === SPELLS.LUNAR_EMP_BUFF.id;
  }
  isOwlkinFrenzy(event) {
    const spellId = event.ability.guid;
    return spellId === SPELLS.OWLKIN_FRENZY.id;
  }
  isWarriorOfElune(event) {
    const spellId = event.ability.guid;
    return spellId === SPELLS.WARRIOR_OF_ELUNE_TALENT.id;
  }

  on_byPlayer_cast(event) {
    if (!this.isLunarStrike(event)) {
      return;
    }
    this.casts.push(this._castQueue);
    this._castQueue = {
      empowered: this._lunarEmpsOn || this._warriorOfEluneOn || this._owlkinFrenzyOn,
      enemies: 0,
    };
  }

  on_byPlayer_damage(event) {
    if (!this.isLunarStrike(event)) {
      return;
    }
    this._castQueue.enemies += 1;
  }

  on_toPlayer_applybuff(event) {
    if (this.isLunarEmpowerment(event)) {
      this._lunarEmpsOn = true;
    } else if (this.isWarriorOfElune(event)) {
      this._warriorOfEluneOn = true;
    }  else if (this.isOwlkinFrenzy(event)) {
      this._owlkinFrenzyOn = true;
    }  
  }
  on_toPlayer_removebuff(event) {
    if (this.isLunarEmpowerment(event)) {
      this._lunarEmpsOn = false;
    } else if (this.isWarriorOfElune(event)) {
      this._warriorOfEluneOn = false;
    } else if (this.isOwlkinFrenzy(event)) {
      this._owlkinFrenzyOn = false;
    }
  }

  on_finished() {
    this.casts.push(this._castQueue);

    this.suboptUmempLS = this.casts.filter((cast) =>  !cast.empowered && cast.enemies > 0 && cast.enemies < 4).length;
  }

  suggestions(when) {
    const suboptPerMin = ((this.suboptUmempLS) / (this.owner.fightDuration / 1000)) * 60;
    when(suboptPerMin).isGreaterThan(0)
      .addSuggestion((suggest, actual, recommended) => {
        return suggest(<span>You casted {this.suboptUmempLS} unempowered and non instant cast <SpellLink id={SPELLS.LUNAR_STRIKE.id} /> that hit less than 4 targets. Always prioritize Solar Wrath as a filler if there are less than 4 targets.</span>)
          .icon(SPELLS.LUNAR_STRIKE.icon)
          .actual(`${formatNumber(actual)} Unempowered LS per minute`)
          .recommended(`${recommended} Unempowered LS that hits less than 4 targets are recomended`)
          .regular(recommended + 2).major(recommended + 4);
      });
  }
}

export default UnempoweredLS;
{'fraction_non_alphanumeric': 0.12099894477664438, 'fraction_numerical': 0.006331340133661625, 'mean_word_length': 3.3445378151260505, 'pattern_counts': {'":': 0, '<': 11, '<?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': '7656844', 'n_tokens_mistral': 2175, 'n_tokens_neox': 2074, 'n_words': 373}