<commit_before>define((require, exports, module) => {
  let TRHMasterData = require('app/core/master')
  return (store) => {
    store.subscribe((mutation, state) => {
      if (mutation.type === 'battle/updateBattle') {
        let { updateData } = mutation.payload
        let resultParty = _(_.get(updateData, ['result', 'player', 'party', 'slot']))
          .values()
          .keyBy(o => o.serial_id)
          .value()
        let playerParty = _(_.get(updateData, ['player', 'party']))
          .values()
          .keyBy(o => o.serial_id)
          .mapValues((v, k) => {
            return {
              serial_id: v.serial_id,
              hp: _.toNumber(v.hp) - _.toNumber(_.get(resultParty, [k, 'hp'], 0)),
              battleStatus: _.toNumber(_.get(resultParty, [k, 'status'], 0))
            }
          })
          .filter(o => o.hp > 0)
          .mapValues((v, k) => {
            let sword = _.get(state, ['swords', 'serial', v.serial_id], {})
            return _.extend(v, {
              name: sword.name,
              injury: sword.injury,
              baseId: sword.baseId,
              battleStatusText: ['正常', '軽傷', '中傷', '重傷', 'RING_OUT', '破壞'][v.battleStatus]
            })
          })
          .values()
          .value()
        let getSwordId = _.get(updateData, ['result', 'get_sword_id'])
        if (playerParty.length) {
          let swordName = _.get(TRHMasterData.getMasterData('Sword'), [getSwordId, 'name'], '无')
          store.dispatch('notice/addNotice', {
            title: `战斗报告`,
            message: _.map(playerParty, o => `[${o.battleStatusText}] ${o.name} HP -${o.hp}`).join('<br>'),
            context: `掉落：${swordName}！`,
            swordBaseId: playerParty[0].baseId,
            icon: `static/icon.png`,
          })
        }
        else if (!getSwordId) {
          let swordName = _.get(TRHMasterData.getMasterData('Sword'), [getSwordId, 'name'], '无')
          store.dispatch('notice/addNotice', {
            title: `战斗报告`,
            message: '本场无受伤',
            context: `掉落：${swordName}！`,
            icon: `static/sword/${getSwordId}.png`
          })
        }
      }
    })
  }
})<commit_msg>hurt notice bug fixed<commit_after>define((require, exports, module) => {
  let TRHMasterData = require('app/core/master')
  return (store) => {
    store.subscribe((mutation, state) => {
      if (mutation.type === 'battle/updateBattle') {
        let { updateData } = mutation.payload
        let resultParty = _(_.get(updateData, ['result', 'player', 'party', 'slot']))
          .values()
          .keyBy(o => o.serial_id)
          .value()
        let playerParty = _(_.get(updateData, ['player', 'party']))
          .values()
          .keyBy(o => o.serial_id)
          .mapValues((v, k) => {
            return {
              serial_id: v.serial_id,
              hp: _.toNumber(v.hp) - _.toNumber(_.get(resultParty, [k, 'hp'], 0)),
              battleStatus: _.toNumber(_.get(resultParty, [k, 'status'], 0))
            }
          })
          .filter(o => o.hp > 0)
          .mapValues((v, k) => {
            let sword = _.get(state, ['swords', 'serial', v.serial_id], {})
            return _.extend(v, {
              name: sword.name,
              injury: sword.injury,
              baseId: sword.baseId,
              battleStatusText: ['正常', '軽傷', '中傷', '重傷', 'RING_OUT', '破壞'][v.battleStatus]
            })
          })
          .values()
          .value()
        let getSwordId = _.get(updateData, ['result', 'get_sword_id'])
        if (playerParty.length) {
          let swordName = _.get(TRHMasterData.getMasterData('Sword'), [getSwordId, 'name'], '无')
          store.dispatch('notice/addNotice', {
            title: `战斗报告`,
            message: _.map(playerParty, o => `[${o.battleStatusText}] ${o.name} HP -${o.hp}`).join('<br>'),
            context: `掉落：${swordName}！`,
            swordBaseId: playerParty[0].baseId,
            icon: `static/icon.png`,
          })
        }
        else if (getSwordId !== 0) {
          let swordName = _.get(TRHMasterData.getMasterData('Sword'), [getSwordId, 'name'], '无')
          store.dispatch('notice/addNotice', {
            title: `战斗报告`,
            message: '本场无受伤',
            context: `掉落：${swordName}！`,
            icon: `static/sword/${getSwordId}.png`
          })
        }
      }
    })
  }
})
{'fraction_non_alphanumeric': 0.1792819574662703, 'fraction_numerical': 0.002058083695403613, 'mean_word_length': 1.8439531859557867, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '3710774', 'n_tokens_mistral': 1456, 'n_tokens_neox': 1462, 'n_words': 256}