<commit_before>import React from 'react';

import SPELLS from 'common/SPELLS';
import SpellIcon from 'common/SpellIcon';
import SpellLink from 'common/SpellLink';
import { formatPercentage } from 'common/format';

import AbilityTracker from 'parser/core/modules/AbilityTracker';
import StatisticBox, { STATISTIC_ORDER } from 'interface/others/StatisticBox';
import Analyzer from 'parser/core/Analyzer';

const REFRESH_AT_STACKS_WITH_BONES_OF_THE_DAMNED = 6;
const REFRESH_AT_STACKS_WITHOUT_BONES_OF_THE_DAMNED = 7;
const REFRESH_AT_SECONDS = 6;
const BS_DURATION = 30;
const MR_GAIN = 3;

class MarrowrendUsage extends Analyzer {

  static dependencies = {
    abilityTracker: AbilityTracker,
  };

  /*
    currentBoneShieldBuffer contains the BS stacks caused by the actual MR cast
    since the applyBuffStack event happens before the cast event
  */

  currentBoneShieldStacks = 0;
  currentBoneShieldBuffer = 0;
  lastMarrowrendCast = 0;

  bsStacksWasted = 0;
  badMRCasts = 0;
  refreshMRCasts = 0;
  totalMRCasts = 0;

  hasBonesOfTheDamned = false;
  refreshAtStacks = REFRESH_AT_STACKS_WITHOUT_BONES_OF_THE_DAMNED;

  bonesOfTheDamnedProc = 0;
  totalStacksGenerated = 0;

  constructor(...args) {
    super(...args);

    if(this.selectedCombatant.hasTrait(SPELLS.BONES_OF_THE_DAMNED.id)) {
      this.hasBonesOfTheDamned = true;
    }
  }


  on_toPlayer_applybuff(event) {
    if (event.ability.guid === SPELLS.BONE_SHIELD.id){
      this.currentBoneShieldBuffer += 1;
      this.currentBoneShieldStacks += 1;
    }
  }

  on_toPlayer_applybuffstack(event) {
    if (event.ability.guid === SPELLS.BONE_SHIELD.id){<commit_msg>set refresh stacks when using BotD<commit_after>import React from 'react';

import SPELLS from 'common/SPELLS';
import SpellIcon from 'common/SpellIcon';
import SpellLink from 'common/SpellLink';
import { formatPercentage } from 'common/format';

import AbilityTracker from 'parser/core/modules/AbilityTracker';
import StatisticBox, { STATISTIC_ORDER } from 'interface/others/StatisticBox';
import Analyzer from 'parser/core/Analyzer';

const REFRESH_AT_STACKS_WITH_BONES_OF_THE_DAMNED = 6;
const REFRESH_AT_STACKS_WITHOUT_BONES_OF_THE_DAMNED = 7;
const REFRESH_AT_SECONDS = 6;
const BS_DURATION = 30;
const MR_GAIN = 3;

class MarrowrendUsage extends Analyzer {

  static dependencies = {
    abilityTracker: AbilityTracker,
  };

  /*
    currentBoneShieldBuffer contains the BS stacks caused by the actual MR cast
    since the applyBuffStack event happens before the cast event
  */

  currentBoneShieldStacks = 0;
  currentBoneShieldBuffer = 0;
  lastMarrowrendCast = 0;

  bsStacksWasted = 0;
  badMRCasts = 0;
  refreshMRCasts = 0;
  totalMRCasts = 0;

  hasBonesOfTheDamned = false;
  refreshAtStacks = REFRESH_AT_STACKS_WITHOUT_BONES_OF_THE_DAMNED;

  bonesOfTheDamnedProc = 0;
  totalStacksGenerated = 0;

  constructor(...args) {
    super(...args);

    if(this.selectedCombatant.hasTrait(SPELLS.BONES_OF_THE_DAMNED.id)) {
      this.hasBonesOfTheDamned = true;
      this.refreshAtStacks = REFRESH_AT_STACKS_WITH_BONES_OF_THE_DAMNED;
    }
  }


  on_toPlayer_applybuff(event) {
    if (event.ability.guid === SPELLS.BONE_SHIELD.id){
      this.currentBoneShieldBuffer += 1;
      this.currentBoneShieldStacks += 1;
    }
  }

  on_toPlayer_applybuffstack(event) {
    if (event.ability.guid === SPELLS.BONE_SHIELD.id){
{'fraction_non_alphanumeric': 0.0887240356083086, 'fraction_numerical': 0.010089020771513354, 'mean_word_length': 4.5444078947368425, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1792012', 'n_tokens_mistral': 1297, 'n_tokens_neox': 1222, 'n_words': 236}