<commit_before>import React from 'react';
import Analyzer from 'parser/core/Analyzer';

import Combatants from 'parser/core/modules/Combatants';
import { formatNumber } from 'common/format';
import SPELLS from 'common/SPELLS';
import SpellIcon from 'common/SpellIcon';
import RACES from 'game/RACES';
import StatisticBox from 'interface/others/StatisticBox';

const STONEFORM_DAMAGE_REDUCTION = 0.1;
const FALLING_DAMAGE_ABILITY_ID = 3;
const PHYSICAL_EVENT_TYPE = 1;

class Stoneform extends Analyzer {
  static dependencies = {
    combatants: Combatants,
  };
  
  damageReduced = 0;
  physicalDamageTaken = 0;
  constructor(...args) {
    super(...args);
    this.active = this.selectedCombatant.race && this.selectedCombatant.race === RACES.Dwarf;
  }

  on_toPlayer_damage(event) {
    const spellId = event.ability.guid;
    if (spellId === FALLING_DAMAGE_ABILITY_ID) {
      return;
    }
    
    const damageTaken = event.amount + (event.absorbed || 0);
    const isStoneformActive = this.selectedCombatant.hasBuff(SPELLS.STONEFORM_BUFF.id, event.timestamp, this.owner.playerId);
    
    if (isStoneformActive && event.ability.type === PHYSICAL_EVENT_TYPE) { 
      this.physicalDamageTaken += damageTaken;
      this.damageReduced += damageTaken / (1 - STONEFORM_DAMAGE_REDUCTION) * STONEFORM_DAMAGE_REDUCTION;
    }
  }

  statistic() {
    return(
      <StatisticBox
        icon={<SpellIcon id={SPELLS.STONEFORM_BUFF.id} />}
        value={`${formatNumber(this.damageReduced)}`}
        label="Stoneform Damage Reduced"
        tooltip={`Over the course of the encounter you took ${formatNumber(this.physicalDamageTaken)} physical damage while Stoneform was active`}
      />
    );

  }

}

export default Stoneform;<commit_msg>tooltip update, comments and log example<commit_after>import React from 'react';
import Analyzer from 'parser/core/Analyzer';

import Combatants from 'parser/core/modules/Combatants';
import { formatNumber } from 'common/format';
import RACES from 'game/RACES';
import SpellIcon from 'common/SpellIcon';
import SPELLS from 'common/SPELLS';
import StatisticBox from 'interface/others/StatisticBox';

/**
 * Removes all poison, disease, curse, magic, and bleed effects and reduces all physical damage taken by 10% for 8 sec.
 *
 * Example log: https://www.warcraftlogs.com/reports/gYCR2kZaJHVbjfxP/#fight=52&source=16&type=damage-taken
 */

const STONEFORM_DAMAGE_REDUCTION = 0.1;
const FALLING_DAMAGE_ABILITY_ID = 3;
const PHYSICAL_EVENT_TYPE = 1;

class Stoneform extends Analyzer {
  static dependencies = {
    combatants: Combatants,
  };
  
  damageReduced = 0;
  physicalDamageTaken = 0;

  constructor(...args) {
    super(...args);
    this.active = this.selectedCombatant.race && this.selectedCombatant.race === RACES.Dwarf;
  }

  on_toPlayer_damage(event) {
    const spellId = event.ability.guid;
    if (spellId === FALLING_DAMAGE_ABILITY_ID) { // Falling damage is the same type as physical but ignores DRs.
      return;
    }
    
    const damageTaken = event.amount + (event.absorbed || 0);
    const isStoneformActive = this.selectedCombatant.hasBuff(SPELLS.STONEFORM_BUFF.id, event.timestamp, this.owner.playerId);
    
    if (isStoneformActive && event.ability.type === PHYSICAL_EVENT_TYPE) { 
      this.physicalDamageTaken += damageTaken;
      this.damageReduced += damageTaken / (1 - STONEFORM_DAMAGE_REDUCTION) * STONEFORM_DAMAGE_REDUCTION;
    }
  }

  statistic() {
    return(
      <StatisticBox
        icon={<SpellIcon id={SPELLS.STONEFORM_BUFF.id} />}
        value={`≈${formatNumber(this.damageReduced)}`}
        label="Stoneform Damage Reduced"
        tooltip={`Over the course of the encounter you took ${formatNumber(this.physicalDamageTaken)} physical damage while Stoneform was active`}
      />
    );

  }

}

export default Stoneform;
{'fraction_non_alphanumeric': 0.11064608945854042, 'fraction_numerical': 0.006277792309704421, 'mean_word_length': 3.9405684754521966, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, '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': '2362424', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1260, 'n_words': 268}