<commit_before>import React from 'react';
import SPELLS from 'common/SPELLS';
import SpellLink from 'common/SpellLink';
import SpellIcon from 'common/SpellIcon';
import { formatPercentage, formatThousands } from 'common/format';
import Analyzer from 'Parser/Core/Analyzer';
import Combatants from 'Parser/Core/Modules/Combatants';
import StatisticBox, { STATISTIC_ORDER } from 'Main/StatisticBox';

const debug = false;

class IronSkinBrew extends Analyzer {
  static dependencies = {
    combatants: Combatants,
  }

  lastIronSkinBrewBuffApplied = 0;

  hitsWithIronSkinBrew = 0;
  damageWithIronSkinBrew = 0;
  hitsWithoutIronSkinBrew = 0;
  damageWithoutIronSkinBrew = 0;

  // duration tracking to record clipping of buff
  lastDurationCheck = 0;
  totalDuration = 0;
  durationLost = 0;
  currentDuration = 0;
  durationPerCast = 6000; // base
  durationPerPurify = 0;
  durationCap = -1;

  on_initialized() {
    this.durationPerCast += 500 * this.combatants.selected.traitsBySpellId[SPELLS.POTENT_KICK.id];
    this.durationCap = 3 * this.durationPerCast;
    this.durationPerPurify = 1000 * this.combatants.selected.traitsBySpellId[SPELLS.QUICK_SIP.id];
  }

  on_byPlayer_cast(event) {
    const spellId = event.ability.guid;
    if (SPELLS.IRONSKIN_BREW.id === spellId || SPELLS.PURIFYING_BREW.id === spellId) {
      // determine the current duration on ISB
      if (this.currentDuration > 0) {
        this.currentDuration -= event.timestamp - this.lastDurationCheck;
        this.currentDuration = Math.max(this.currentDuration, 0);
      }
      // add the duration from this buff application (?)
      let addedDuration = 0;
      if (SPELLS.IRONSKIN_BREW.id === spellId) {
        addedDuration = this.durationPerCast;
      } else if (SPELLS.PURIFYING_BREW.id === spellId) {
        addedDuration = this.durationPerPurify;
      }
      this.currentDuration += addedDuration;
      if (this.currentDuration > this.durationCap) {
        this.durationLost += this.currentDuration - this.durationCap;
        this.currentDuration = this.durationCap;
      }
      console.log(`ISB buff applied: ${this.currentDuration}`);
      // add this duration to the total duration
      this.totalDuration += addedDuration;
      this.lastDurationCheck = event.timestamp;
    }
  }<commit_msg>Removed stray console.log<commit_after>import React from 'react';
import SPELLS from 'common/SPELLS';
import SpellLink from 'common/SpellLink';
import SpellIcon from 'common/SpellIcon';
import { formatPercentage, formatThousands } from 'common/format';
import Analyzer from 'Parser/Core/Analyzer';
import Combatants from 'Parser/Core/Modules/Combatants';
import StatisticBox, { STATISTIC_ORDER } from 'Main/StatisticBox';

const debug = false;

class IronSkinBrew extends Analyzer {
  static dependencies = {
    combatants: Combatants,
  }

  lastIronSkinBrewBuffApplied = 0;

  hitsWithIronSkinBrew = 0;
  damageWithIronSkinBrew = 0;
  hitsWithoutIronSkinBrew = 0;
  damageWithoutIronSkinBrew = 0;

  // duration tracking to record clipping of buff
  lastDurationCheck = 0;
  totalDuration = 0;
  durationLost = 0;
  currentDuration = 0;
  durationPerCast = 6000; // base
  durationPerPurify = 0;
  durationCap = -1;

  on_initialized() {
    this.durationPerCast += 500 * this.combatants.selected.traitsBySpellId[SPELLS.POTENT_KICK.id];
    this.durationCap = 3 * this.durationPerCast;
    this.durationPerPurify = 1000 * this.combatants.selected.traitsBySpellId[SPELLS.QUICK_SIP.id];
  }

  on_byPlayer_cast(event) {
    const spellId = event.ability.guid;
    if (SPELLS.IRONSKIN_BREW.id === spellId || SPELLS.PURIFYING_BREW.id === spellId) {
      // determine the current duration on ISB
      if (this.currentDuration > 0) {
        this.currentDuration -= event.timestamp - this.lastDurationCheck;
        this.currentDuration = Math.max(this.currentDuration, 0);
      }
      // add the duration from this buff application (?)
      let addedDuration = 0;
      if (SPELLS.IRONSKIN_BREW.id === spellId) {
        addedDuration = this.durationPerCast;
      } else if (SPELLS.PURIFYING_BREW.id === spellId) {
        addedDuration = this.durationPerPurify;
      }
      this.currentDuration += addedDuration;
      if (this.currentDuration > this.durationCap) {
        this.durationLost += this.currentDuration - this.durationCap;
        this.currentDuration = this.durationCap;
      }
      // add this duration to the total duration
      this.totalDuration += addedDuration;
      this.lastDurationCheck = event.timestamp;
    }
  }
{'fraction_non_alphanumeric': 0.10021978021978022, 'fraction_numerical': 0.011428571428571429, 'mean_word_length': 3.551, 'pattern_counts': {'":': 0, '<': 3, '<?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': '674819', 'n_tokens_mistral': 1507, 'n_tokens_neox': 1425, 'n_words': 312}