<commit_before>import { NIGHT_ACTIVITY, LANG } from '../settings/gameSettings'
import SurvivorStrings from '../strings/roles/survivor'
import miscStrings from '../strings/misc'
import Poll from '../Poll'
import { sleep } from '../utils'
import _ from 'lodash'

const str = new SurvivorStrings(LANG)
const misc = miscStrings[LANG]

let survivor = {
  name: 'Survivor',
  affiliation: 'Neutral',
  category: 'Neutral Benign',
  desc: {
    name: str.desc('name'),
    particle: str.desc('particle'),
    summary: str.desc('summary'),
    goal: str.desc('goal'),
    nightAbility: str.desc('nightAbility')
  },
  params: {
    isUnique: false,
    investigationCop: misc.investigation.innocent,
    bulletproofVest: 3
  },

  activatePreNightAbility() {

  },

  activateNightAbility() {
    if (player.role.params.bulletproofVest > 0) {
      const chan = player.id
      const text = str.activateNightAbility()
      const choices = [
        {
          name: misc.yes
        },
        {
          name: misc.no
        }]
      let poll = new Poll(player.game, chan, text, choices)
      poll.start()
      sleep(NIGHT_ACTIVITY)
        .then(() => poll.end())
        .then(() => player.poll = poll)
    } else {
      player.poll = false
    }

  },

  resolveNightAbility() {
    return new Promise((resolve, reject) => {
      if (player.poll) {
        const resPoll = player.poll.getMaxVoted()
        if (resPoll.maxVote > 0) {
          const result = _.sample(resPoll.targets)
          if (result == misc.yes) {
            const text = str.resolveNightAbility()
            player.protections += 1
            player.role.params.bulletproofVest -= 1
            player.game.postMessage(player.id, text)
              .then(() => resolve(true))
          }
        } else {
          resolve(true)
        }
      } else {<commit_msg>fix: forget variable<commit_after>import { NIGHT_ACTIVITY, LANG } from '../settings/gameSettings'
import SurvivorStrings from '../strings/roles/survivor'
import miscStrings from '../strings/misc'
import Poll from '../Poll'
import { sleep } from '../utils'
import _ from 'lodash'

const str = new SurvivorStrings(LANG)
const misc = miscStrings[LANG]

let survivor = {
  name: 'Survivor',
  affiliation: 'Neutral',
  category: 'Neutral Benign',
  desc: {
    name: str.desc('name'),
    particle: str.desc('particle'),
    summary: str.desc('summary'),
    goal: str.desc('goal'),
    nightAbility: str.desc('nightAbility')
  },
  params: {
    isUnique: false,
    investigationCop: misc.investigation.innocent,
    bulletproofVest: 3
  },

  activatePreNightAbility() {

  },

  activateNightAbility(player) {
    if (player.role.params.bulletproofVest > 0) {
      const chan = player.id
      const text = str.activateNightAbility()
      const choices = [
        {
          name: misc.yes
        },
        {
          name: misc.no
        }]
      let poll = new Poll(player.game, chan, text, choices)
      poll.start()
      sleep(NIGHT_ACTIVITY)
        .then(() => poll.end())
        .then(() => player.poll = poll)
    } else {
      player.poll = false
    }

  },

  resolveNightAbility(player) {
    return new Promise((resolve, reject) => {
      if (player.poll) {
        const resPoll = player.poll.getMaxVoted()
        if (resPoll.maxVote > 0) {
          const result = _.sample(resPoll.targets)
          if (result == misc.yes) {
            const text = str.resolveNightAbility()
            player.protections += 1
            player.role.params.bulletproofVest -= 1
            player.game.postMessage(player.id, text)
              .then(() => resolve(true))
          }
        } else {
          resolve(true)
        }
      } else {
{'fraction_non_alphanumeric': 0.1343926743872879, 'fraction_numerical': 0.00269323996768112, 'mean_word_length': 2.2436681222707424, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '7029928', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1133, 'n_words': 252}