<commit_before>import SPELLS from 'common/SPELLS';
import Combatants from 'parser/shared/modules/Combatants';
import COVENANTS from 'game/shadowlands/COVENANTS';
import Analyzer, { Options, SELECTED_PLAYER } from 'parser/core/Analyzer';
import Events, { ApplyBuffEvent, ApplyDebuffEvent, CastEvent } from 'parser/core/Events';
import BoringSpellValueText from 'parser/ui/BoringSpellValueText';
import Statistic from 'parser/ui/Statistic';
import STATISTIC_CATEGORY from 'parser/ui/STATISTIC_CATEGORY';
import { STATISTIC_ORDER } from 'parser/ui/StatisticBox';

class FaelineStompHealing extends Analyzer {
  static dependencies = {
    combatants: Combatants,
  };
  protected combatants!: Combatants;

  totalCasts = 0;
  totalBuffs = 0;
  totalDebuffs = 0;
  castMap: Map<number, number> = new Map<number, number>();

  constructor(options: Options) {
    super(options);

    this.active = this.selectedCombatant.hasCovenant(COVENANTS.NECROLORD.id);

   
    if (!this.active) {
      return;
    }

    this.addEventListener(
      Events.cast.by(SELECTED_PLAYER).spell(SPELLS.BONEDUST_BREW_CAST),
      this.cast,
    );

    this.addEventListener(
      Events.applybuff.by(SELECTED_PLAYER).spell(SPELLS.BONEDUST_BREW_CAST),
      this.friendlyBuffs,
    );

    this.addEventListener(
      Events.applydebuff.by(SELECTED_PLAYER).spell(SPELLS.BONEDUST_BREW_CAST),
      this.enemyDebuffs,
    );
  }

  cast(event: CastEvent) {
    this.totalCasts += 1;
  }

  friendlyBuffs(event: ApplyBuffEvent) {
    const target = this.combatants.players[event.targetID];
    //filter out pets
    if (!target) {
      return;
    }

    this.totalBuffs += 1;
    const currentTotal = (this.castMap.get(this.totalCasts) || 0) + 1;
    this.castMap.set(this.totalCasts, currentTotal);
  }

  enemyDebuffs(event: ApplyDebuffEvent)  {
    this.totalDebuffs += 1;
  }

  statistic() {
    return (
      <Statistic
        size="flexible"
        position={STATISTIC_ORDER.OPTIONAL(0)}
        category={STATISTIC_CATEGORY.COVENANTS}
        dropdown={this.baseTable}
      >
        <BoringSpellValueText spellId={SPELLS.BONEDUST_BREW_CAST.id}>
          <>
            {(this.totalBuffs / this.totalCasts).toFixed(2)} <small>average allies hit per cast</small>
          </>
        </BoringSpellValueText>
      </Statistic>
    );
  }

   /** The dropdown table in the base form of this statistic */
   get baseTable(): React.ReactNode {
    return (
      <>
        <table className="table table-condensed">
          <thead>
            <tr>
              <th>Cast #</th>
              <th>Allies Hit</th>
            </tr>
          </thead>
          <tbody>
            {Array.from(this.castMap.keys()).map((value) => (
              <tr key={value}>
                <td>{value}</td>
                <td>{this.castMap.get(value)}</td>
              </tr>
            ))}
          </tbody>
        </table>
      </>
    );
  }
}

export default FaelineStompHealing;
<commit_msg>Prettier?<commit_after>import SPELLS from 'common/SPELLS';
import Combatants from 'parser/shared/modules/Combatants';
import COVENANTS from 'game/shadowlands/COVENANTS';
import Analyzer, { Options, SELECTED_PLAYER } from 'parser/core/Analyzer';
import Events, { ApplyBuffEvent, ApplyDebuffEvent, CastEvent } from 'parser/core/Events';
import BoringSpellValueText from 'parser/ui/BoringSpellValueText';
import Statistic from 'parser/ui/Statistic';
import STATISTIC_CATEGORY from 'parser/ui/STATISTIC_CATEGORY';
import { STATISTIC_ORDER } from 'parser/ui/StatisticBox';

class FaelineStompHealing extends Analyzer {
  static dependencies = {
    combatants: Combatants,
  };
  protected combatants!: Combatants;

  totalCasts = 0;
  totalBuffs = 0;
  totalDebuffs = 0;
  castMap: Map<number, number> = new Map<number, number>();

  constructor(options: Options) {
    super(options);

    this.active = this.selectedCombatant.hasCovenant(COVENANTS.NECROLORD.id);


    if (!this.active) {
      return;
    }

    this.addEventListener(
      Events.cast.by(SELECTED_PLAYER).spell(SPELLS.BONEDUST_BREW_CAST),
      this.cast,
    );

    this.addEventListener(
      Events.applybuff.by(SELECTED_PLAYER).spell(SPELLS.BONEDUST_BREW_CAST),
      this.friendlyBuffs,
    );

    this.addEventListener(
      Events.applydebuff.by(SELECTED_PLAYER).spell(SPELLS.BONEDUST_BREW_CAST),
      this.enemyDebuffs,
    );
  }

  cast(event: CastEvent) {
    this.totalCasts += 1;
  }

  friendlyBuffs(event: ApplyBuffEvent) {
    const target = this.combatants.players[event.targetID];
    //filter out pets
    if (!target) {
      return;
    }

    this.totalBuffs += 1;
    const currentTotal = (this.castMap.get(this.totalCasts) || 0) + 1;
    this.castMap.set(this.totalCasts, currentTotal);
  }

  enemyDebuffs(event: ApplyDebuffEvent) {
    this.totalDebuffs += 1;
  }

  statistic() {
    return (
      <Statistic
        size="flexible"
        position={STATISTIC_ORDER.OPTIONAL(0)}
        category={STATISTIC_CATEGORY.COVENANTS}
        dropdown={this.baseTable}
      >
        <BoringSpellValueText spellId={SPELLS.BONEDUST_BREW_CAST.id}>
          <>
            {(this.totalBuffs / this.totalCasts).toFixed(2)} <small>average allies hit per cast</small>
          </>
        </BoringSpellValueText>
      </Statistic>
    );
  }

  /** The dropdown table in the base form of this statistic */
  get baseTable(): React.ReactNode {
    return (
      <>
        <table className="table table-condensed">
          <thead>
            <tr>
              <th>Cast #</th>
              <th>Allies Hit</th>
            </tr>
          </thead>
          <tbody>
            {Array.from(this.castMap.keys()).map((value) => (
              <tr key={value}>
                <td>{value}</td>
                <td>{this.castMap.get(value)}</td>
              </tr>
            ))}
          </tbody>
        </table>
      </>
    );
  }
}

export default FaelineStompHealing;

{'fraction_non_alphanumeric': 0.12621848739495797, 'fraction_numerical': 0.0033613445378151263, 'mean_word_length': 2.6486817903126916, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 65, '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': '5741735', 'n_tokens_mistral': 2050, 'n_tokens_neox': 1970, 'n_words': 328}