ScoreForModifiers = function (card, onlyRemovable) {
  let score = 0;

  const modifiers = card.getModifiers();
  const fixedAttributeBuffScores = { atk: CONFIG.INFINITY, maxHP: CONFIG.INFINITY, manaCost: CONFIG.INFINITY }; // TODO: speed
  for (let i = 0, il = modifiers.length; i < il; i++) {
    const modifier = modifiers[i];
    if ((!onlyRemovable || modifier.getIsRemovable()) && getIsScoredModifierForCard(card, modifier)) {
      // generic modifier score
      score += BOUNTY.MODIFIER;

      // add scores for stat changes
      if (modifier.getBuffsAttributes()) {
        score += getAttributeScoreForModifierForCard(card, modifier, 'atk', BOUNTY.UNIT_ATK, fixedAttributeBuffScores);
        score += getAttributeScoreForModifierForCard(card, modifier, 'maxHP', BOUNTY.UNIT_HP, fixedAttributeBuffScores);
        score += getAttributeScoreForModifierForCard(card, modifier, 'manaCost', -BOUNTY.MANA_COST, fixedAttributeBuffScores);
      }

      // add score for artifact durability
      if (modifier.getIsFromArtifact()) {
        score += modifier.getDurability() * BOUNTY.ARTIFACT_DURABILITY; // for each artifact, add its durability to bounty
      }
    }
  }

  // add scores for specific modifiers
  // search through the card.hasModifierClass method
  // as it correctly checks for modifiers on cards that haven't been added to a game session
  // these cards don't have any modifiers but do have modifier context objects
  if (card.hasModifierClass(ModifierProvoke)) score += BOUNTY.MODIFIER_PROVOKE;
  else if (card.hasModifierClass(ModifierRanged)) score += BOUNTY.MODIFIER_RANGED;
  else if (card.hasModifierClass(ModifierBlastAttack)) score += BOUNTY.MODIFIER_BLAST;
  else if (card.hasModifierClass(ModifierDeathWatch)) {
    if (card.hasModifierClass(ModifierDeathWatchSpawnEntity)) score += BOUNTY.MODIFIER_DEATHWATCHSPAWNENTITY;
    else {
      score += BOUNTY.MODIFIER_DEATHWATCH;
    }
  } else if (card.hasModifierClass(ModifierSpellWatch)) score += BOUNTY.MODIFIER_SPELLWATCH;
  else if (card.hasModifierClass(ModifierGrow)) score += BOUNTY.MODIFIER_GROW;
  else if (card.hasModifierClass(ModifierFrenzy)) score += BOUNTY.MODIFIER_FRENZY;
  else if (card.hasModifierClass(ModifierCelerity)) score += BOUNTY.MODIFIER_CELERITY;
  else if (card.hasModifierClass(ModifierBackstab)) score += BOUNTY.MODIFIER_BACKSTAB;
  else if (card.hasModifierClass(ModifierRebirth)) score += BOUNTY.MODIFIER_REBIRTH;
  else if (card.hasModifierClass(ModifierFlying)) score += BOUNTY.MODIFIER_FLYING;
  else if (card.hasModifierClass(ModifierHealWatch)) {
    if (card.hasModifierClass(ModifierHealWatchBuffSelf)) score += BOUNTY.MODIFIER_HEALWATCHBUFFSELF;
    else {
      score += BOUNTY.MODIFIER_HEALWATCH;
    }
  } else if (card.hasModifierClass(ModifierForcefield)) score += BOUNTY.MODIFIER_FORCEFIELD;

  return score;
}
Returns the score for the modifiers applied to a card.
@param {Card} card
@param {Boolean} [onlyRemovable=false] whether to only score removable/dispellable modifiers
@returns {Number}
@static
@public