<commit_before>import React from 'react';

import Analyzer from 'Parser/Core/Analyzer';
import Combatants from 'Parser/Core/Modules/Combatants';
import ITEMS from 'common/ITEMS/OTHERS';
import SPELLS from 'common/SPELLS/OTHERS';

//NLC Tier 2 Traits
import MurderousIntent from 'Parser/Core/Modules/NetherlightCrucibleTraits/MurderousIntent';
import ChaoticDarkness from 'Parser/Core/Modules/NetherlightCrucibleTraits/ChaoticDarkness';
import LightsEmbrace from 'Parser/Core/Modules/NetherlightCrucibleTraits/LightsEmbrace';
import SecureInTheLight from 'Parser/Core/Modules/NetherlightCrucibleTraits/SecureInTheLight';
import InfusionOfLight from 'Parser/Core/Modules/NetherlightCrucibleTraits/InfusionOfLight';
import RefractiveShell from 'Parser/Core/Modules/NetherlightCrucibleTraits/RefractiveShell';
import Shadowbind from 'Parser/Core/Modules/NetherlightCrucibleTraits/Shadowbind';
import Shocklight from 'Parser/Core/Modules/NetherlightCrucibleTraits/Shocklight';
import TormentTheWeak from 'Parser/Core/Modules/NetherlightCrucibleTraits/TormentTheWeak';
import DarkSorrows from 'Parser/Core/Modules/NetherlightCrucibleTraits/DarkSorrows';

/*
 * Insignia of the Grand Army
 * Equip: Increase the effects of Light and Shadow powers granted by the Netherlight Crucible by 50%.
*/

const VERSATILITY_AMOUNT = 1500;
const CRIT_AMOUNT = 1500;

class InsigniaOfTheGrandArmy extends Analyzer {
  static dependencies = {
    combatants: Combatants,
    murderousIntent: MurderousIntent,
    refractiveShell: RefractiveShell,
    shocklight: Shocklight,
    secureInTheLight: SecureInTheLight,
    infusionOfLight: InfusionOfLight,
    lightsEmbrace: LightsEmbrace,
    shadowbind: Shadowbind,
    chaoticDarkness: ChaoticDarkness,
    tormentTheWeak: TormentTheWeak,
    darkSorrows: DarkSorrows,
  };

  damage = 0;
  healing = 0;
  refractiveHealing = 0;
  secureInTheLightDamage = 0;
  secureInTheLightHealing = 0;
  infusionOfLightDamage = 0;
  infusionOfLightHealing = 0;
  lightsEmbraceHealing = 0;
  shadowBindDamage = 0;
  shadowBindHealing = 0;
  chaoticDarknessDamage = 0;
  chaoticDarknessHealing = 0;
  tormentTheWeakDamage = 0;
  darkSorrowsDamage = 0;

  on_initialized() {
    this.active = this.combatants.selected.hasFinger(ITEMS.INSIGNIA_OF_THE_GRAND_ARMY.id) && Object.keys(this.constructor.dependencies)
      .map(key => this[key])
      .some(dependency => dependency.active);
  }

  on_byPlayer_damage(event) {
    const spellID = event.ability.guid;
    if (spellID !== SPELLS.SECURE_IN_THE_LIGHT_DAMAGE.id && spellID !== SPELLS.INFUSION_OF_LIGHT_DAMAGE.id && spellID !== SPELLS.SHADOWBIND_DAMAGE_HEALING.id && spellID !== SPELLS.CHAOTIC_DARKNESS_DAMAGE.id && spellID !== SPELLS.TORMENT_THE_WEAK_DAMAGE.id && spellID !== SPELLS.DARK_SORROWS_DAMAGE.id) {
      return;
    }
    if (spellID === SPELLS.SECURE_IN_THE_LIGHT_DAMAGE.id) {
      this.damage += event.amount + (event.absorbed || 0);
      this.secureInTheLightDamage += event.amount + (event.absorbed || 0);
    }
    if (spellID === SPELLS.INFUSION_OF_LIGHT_DAMAGE.id) {
      this.damage += event.amount + (event.absorbed || 0);
      this.infusionOfLightDamage += event.amount + (event.absorbed || 0);
    }
    if (spellID === SPELLS.SHADOWBIND_DAMAGE_HEALING.id) {
      this.damage += event.amount + (event.absorbed || 0);
      this.shadowBindDamage += event.amount + (event.absorbed || 0);
    }
    if (spellID === SPELLS.CHAOTIC_DARKNESS_DAMAGE.id) {
      this.damage += (event.amount || 0) + (event.absorbed || 0) + (event.overkill || 0);
      this.chaoticDarknessDamage += (event.amount || 0) + (event.absorbed || 0) + (event.overkill || 0);
    }
    if (spellID === SPELLS.TORMENT_THE_WEAK_DAMAGE.id) {
      this.damage += event.amount + (event.absorbed || 0);
      this.tormentTheWeakDamage += event.amount + (event.absorbed || 0);
    }
    if (spellID === SPELLS.DARK_SORROWS_DAMAGE.id) {
      this.damage += event.amount + (event.absorbed || 0);
      this.darkSorrowsDamage += event.amount + (event.absorbed || 0);
    }

  }
  on_byPlayer_absorbed(event) {
    const spellId = event.ability.guid;
    if (spellId === SPELLS.REFRACTIVE_SHELL_BUFF.id) {
      this.healing += event.amount;
      this.refractiveHealing += event.amount;
    }
    if (spellId === SPELLS.HOLY_BULWARK.id) {
      this.healing += event.amount;
      this.secureInTheLightHealing += event.amount;
    }
  }
  on_byPlayer_heal(event) {
    const spellId = event.ability.guid;
    if (spellId === SPELLS.INFUSION_OF_LIGHT_HEALING.id) {
      this.healing += (event.amount || 0) + (event.absorbed || 0);
      this.infusionOfLightHealing += (event.amount || 0) + (event.absorbed || 0);
    }
    if (spellId === SPELLS.LIGHTS_EMBRACE_HEALING.id) {
      this.healing += (event.amount || 0) + (event.absorbed || 0);
      this.lightsEmbraceHealing += (event.amount || 0) + (event.absorbed || 0);
    }
    if (spellId === SPELLS.SHADOWBIND_DAMAGE_HEALING.id) {
      this.healing += (event.amount || 0) + (event.absorbed || 0);
      this.shadowBindHealing += (event.amount || 0) + (event.absorbed || 0);
    }<commit_msg>add better returns<commit_after>import React from 'react';

import Analyzer from 'Parser/Core/Analyzer';
import Combatants from 'Parser/Core/Modules/Combatants';
import ITEMS from 'common/ITEMS/OTHERS';
import SPELLS from 'common/SPELLS/OTHERS';

//NLC Tier 2 Traits
import MurderousIntent from 'Parser/Core/Modules/NetherlightCrucibleTraits/MurderousIntent';
import ChaoticDarkness from 'Parser/Core/Modules/NetherlightCrucibleTraits/ChaoticDarkness';
import LightsEmbrace from 'Parser/Core/Modules/NetherlightCrucibleTraits/LightsEmbrace';
import SecureInTheLight from 'Parser/Core/Modules/NetherlightCrucibleTraits/SecureInTheLight';
import InfusionOfLight from 'Parser/Core/Modules/NetherlightCrucibleTraits/InfusionOfLight';
import RefractiveShell from 'Parser/Core/Modules/NetherlightCrucibleTraits/RefractiveShell';
import Shadowbind from 'Parser/Core/Modules/NetherlightCrucibleTraits/Shadowbind';
import Shocklight from 'Parser/Core/Modules/NetherlightCrucibleTraits/Shocklight';
import TormentTheWeak from 'Parser/Core/Modules/NetherlightCrucibleTraits/TormentTheWeak';
import DarkSorrows from 'Parser/Core/Modules/NetherlightCrucibleTraits/DarkSorrows';

/*
 * Insignia of the Grand Army
 * Equip: Increase the effects of Light and Shadow powers granted by the Netherlight Crucible by 50%.
*/

const VERSATILITY_AMOUNT = 1500;
const CRIT_AMOUNT = 1500;

class InsigniaOfTheGrandArmy extends Analyzer {
  static dependencies = {
    combatants: Combatants,
    murderousIntent: MurderousIntent,
    refractiveShell: RefractiveShell,
    shocklight: Shocklight,
    secureInTheLight: SecureInTheLight,
    infusionOfLight: InfusionOfLight,
    lightsEmbrace: LightsEmbrace,
    shadowbind: Shadowbind,
    chaoticDarkness: ChaoticDarkness,
    tormentTheWeak: TormentTheWeak,
    darkSorrows: DarkSorrows,
  };

  damage = 0;
  healing = 0;
  refractiveHealing = 0;
  secureInTheLightDamage = 0;
  secureInTheLightHealing = 0;
  infusionOfLightDamage = 0;
  infusionOfLightHealing = 0;
  lightsEmbraceHealing = 0;
  shadowBindDamage = 0;
  shadowBindHealing = 0;
  chaoticDarknessDamage = 0;
  chaoticDarknessHealing = 0;
  tormentTheWeakDamage = 0;
  darkSorrowsDamage = 0;

  on_initialized() {
    this.active = this.combatants.selected.hasFinger(ITEMS.INSIGNIA_OF_THE_GRAND_ARMY.id) && Object.keys(this.constructor.dependencies)
      .map(key => this[key])
      .some(dependency => dependency.active);
  }

  on_byPlayer_damage(event) {
    const spellID = event.ability.guid;
    if (spellID !== SPELLS.SECURE_IN_THE_LIGHT_DAMAGE.id && spellID !== SPELLS.INFUSION_OF_LIGHT_DAMAGE.id && spellID !== SPELLS.SHADOWBIND_DAMAGE_HEALING.id && spellID !== SPELLS.CHAOTIC_DARKNESS_DAMAGE.id && spellID !== SPELLS.TORMENT_THE_WEAK_DAMAGE.id && spellID !== SPELLS.DARK_SORROWS_DAMAGE.id) {
      return;
    }
    if (spellID === SPELLS.SECURE_IN_THE_LIGHT_DAMAGE.id) {
      this.damage += event.amount + (event.absorbed || 0);
      this.secureInTheLightDamage += event.amount + (event.absorbed || 0);
    }
    if (spellID === SPELLS.INFUSION_OF_LIGHT_DAMAGE.id) {
      this.damage += event.amount + (event.absorbed || 0);
      this.infusionOfLightDamage += event.amount + (event.absorbed || 0);
    }
    if (spellID === SPELLS.SHADOWBIND_DAMAGE_HEALING.id) {
      this.damage += event.amount + (event.absorbed || 0);
      this.shadowBindDamage += event.amount + (event.absorbed || 0);
    }
    if (spellID === SPELLS.CHAOTIC_DARKNESS_DAMAGE.id) {
      this.damage += (event.amount || 0) + (event.absorbed || 0) + (event.overkill || 0);
      this.chaoticDarknessDamage += (event.amount || 0) + (event.absorbed || 0) + (event.overkill || 0);
    }
    if (spellID === SPELLS.TORMENT_THE_WEAK_DAMAGE.id) {
      this.damage += event.amount + (event.absorbed || 0);
      this.tormentTheWeakDamage += event.amount + (event.absorbed || 0);
    }
    if (spellID === SPELLS.DARK_SORROWS_DAMAGE.id) {
      this.damage += event.amount + (event.absorbed || 0);
      this.darkSorrowsDamage += event.amount + (event.absorbed || 0);
    }

  }
  on_byPlayer_absorbed(event) {
    const spellId = event.ability.guid;
    if (spellId !== SPELLS.REFRACTIVE_SHELL_BUFF.id && spellId !== SPELLS.HOLY_BULWARK.id) {
      return;
    }
    if (spellId === SPELLS.REFRACTIVE_SHELL_BUFF.id) {
      this.healing += event.amount;
      this.refractiveHealing += event.amount;
    }
    if (spellId === SPELLS.HOLY_BULWARK.id) {
      this.healing += event.amount;
      this.secureInTheLightHealing += event.amount;
    }
  }
  on_byPlayer_heal(event) {
    const spellId = event.ability.guid;
    if (spellId !== SPELLS.INFUSION_OF_LIGHT_HEALING.id && spellId !== SPELLS.LIGHTS_EMBRACE_HEALING.id && spellId !== SPELLS.CHAOTIC_DARKNESS_HEALING.id && spellId !== SPELLS.SHADOWBIND_DAMAGE_HEALING.id) {
      return;
    }
    if (spellId === SPELLS.INFUSION_OF_LIGHT_HEALING.id) {
      this.healing += (event.amount || 0) + (event.absorbed || 0);
      this.infusionOfLightHealing += (event.amount || 0) + (event.absorbed || 0);
    }
    if (spellId === SPELLS.LIGHTS_EMBRACE_HEALING.id) {
      this.healing += (event.amount || 0) + (event.absorbed || 0);
      this.lightsEmbraceHealing += (event.amount || 0) + (event.absorbed || 0);
    }
    if (spellId === SPELLS.SHADOWBIND_DAMAGE_HEALING.id) {
      this.healing += (event.amount || 0) + (event.absorbed || 0);
      this.shadowBindHealing += (event.amount || 0) + (event.absorbed || 0);
    }
{'fraction_non_alphanumeric': 0.12391057218643425, 'fraction_numerical': 0.01004168245547556, 'mean_word_length': 4.132231404958677, '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': '2977458', 'n_tokens_mistral': 3976, 'n_tokens_neox': 3789, 'n_words': 630}