Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Apr 2, 2018
2 parents 5057ac6 + a64f044 commit 0d161a6
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 44 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ npm run lint
多人战中的boss数据更新是通过一个socket.io链接进行的 目前链接的地址是
`ws://203.104.248.5:11230/socket.io/`
一般情况下是保持在ws链接,当ws连接不可用的时候会降级成长轮询
这个地址目前代理与否没有关系,这部分的功能还没有
需要加入代理才能自动提醒特动
2 changes: 1 addition & 1 deletion src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>blhx-damage-statistics</title>
<title>pooo</title>
<% if (htmlWebpackPlugin.options.nodeModules) { %>
<!-- Add `node_modules/` to global paths so `require` works properly in development -->
<script>
Expand Down
111 changes: 76 additions & 35 deletions src/lib/bossAction/index.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,82 @@
function nextKey (arr, per) {
const e = Object.keys(arr).filter(item => {
return parseFloat(item) < per
})
let max = e[0]
e.forEach(element => {
if (parseFloat(element) > parseFloat(max)) {
max = element
}
})
return max
}

function lastKey (arr, per) {
const e = Object.keys(arr).filter(item => {
return parseFloat(item) > per
})
let min = e[0]
e.forEach(element => {
if (parseFloat(element) < parseFloat(min)) {
min = element
}
})
return min
}

export default {
/**
* @return {string}
*/
'Lvl 200 Ultimate Bahamut' (bossData) {
let percent = bossData.hp / bossData.hpmax
if (percent < 0.01) {
return '1% 五彩大炮'
} if (percent < 0.05) {
return '5% 暗aoe 1w5'
} if (percent < 0.15) {
return '15% 大破'
} if (percent < 0.22) {
return '22%特动 水AOE 驱动'
} if (percent < 0.28) {
return '28 触发满豆'
} if (percent < 0.30) {
return '30 驱散'
} if (percent < 0.35) {
return '35特动 四属陨石'
} if (percent < 0.40) {
return '40特动 白字陨石'
} if (percent < 0.45) {
return '45特动 四属陨石'
} if (percent < 0.50) {
return '50特动 白字陨石'
} if (percent < 0.55) {
return '55特动 喷火 最后大伤害 附带石化'
} if (percent < 0.70) {
return '70特动 神光 附加印记'
} if (percent < 0.75) {
return '75特动 5w土伤害'
} if (percent < 0.80) {
return '80 触发满豆'
} if (percent < 0.85) {
return '85特动'
} if (percent < 0.95) {
return '95特动'

let atks = {
1.0: '',
0.75: '单体攻击 可能会上标记 有标记时下一回合五彩大炮',
0.50: '喷火AOE',
0.3: '不普攻',
0.10: '单体攻击',
0: 'aoe'
}
let nps = {
1.0: '',
0.85: '奥义不明',
0.75: '百分比白字吹风\n喷火 全体多段伤害 最后大伤害 附带灼热 降奥义',
0.5: '神光 光1w AOE',
0.3: 'DPT检查阶段 满豆超越',
0.1: '非OD:水AOE+驱散\n 土AOE+我方降连+超巴三连buff\nOD:大破',
0: '不清楚'
}
let specialActions = {
0.01: '1% 五彩大炮',
0.05: '5% 暗aoe 1w5',
0.15: '15% 大破',
0.22: '22%特动 水AOE 驱动',
0.28: '28 触发满豆',
0.3: '30 驱散',
0.35: '35特动 四属陨石',
0.4: '40特动 白字陨石',
0.45: '45特动 四属陨石',
0.5: '50特动 白字陨石',
0.55: '55特动 喷火 最后大伤害 附带石化',
0.7: '70特动 神光 附加印记',
0.75: '75特动 5w土伤害',
0.8: '80 触发满豆',
0.85: '85 喷火 全体多段伤害 最终大伤害 灼热 降奥义DB',
0.95: '95 1w风伤 高昂',
1.0: ''
}

const nKey = nextKey(specialActions, percent)
const lKey = lastKey(specialActions, percent)
const aKey = nextKey(atks, percent)
const npKey = nextKey(nps, percent)

return {
special: {
next: specialActions[nKey],
last: specialActions[lKey]
},
atk: atks[aKey],
np: nps[npKey]
}
}
}
31 changes: 24 additions & 7 deletions src/renderer/components/demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,20 @@
</el-row>

<el-row>
<pre><code>特动: {{ me }}</code></pre>
<pre><code>上一个特动: {{ lastAction }}</code></pre>
</el-row>
<el-row>
<pre><code>下一个特动: {{ nextAction }}</code></pre>
</el-row>

<el-row>
<pre><code>普攻: {{ atk }}</code></pre>
</el-row>
<el-row>
<pre><code>满豆: {{ np }}</code></pre>
</el-row>



<el-row>
<ul class="list-group">
Expand All @@ -40,9 +52,10 @@ export default {
name: 'demo',
data () {
return {
me: 'pooo',
onceStarted: false,
proxyStatus: renderBus.proxyStatus,
lastAction: 'pooo',
nextAction: '',
atk: '',
np: '',
battleID: '',
bossName: '',
voiceNotice: true,
Expand All @@ -56,9 +69,13 @@ export default {
const vm = this
renderBus.$on('boss-update', (message) => {
vm.battleData.bossData.hp = message[1].bossUpdate.param.boss1_hp
let lastMsg = vm.me
vm.me = bossAction['Lvl 200 Ultimate Bahamut'](vm.battleData.bossData)
if (lastMsg !== vm.me) {
let lastMsg = vm.lastAction
let { special, atk, np } = bossAction['Lvl 200 Ultimate Bahamut'](vm.battleData.bossData)
vm.lastAction = special.last
vm.nextAction = special.next
vm.atk = atk
vm.np = np
if (lastMsg !== vm.lastAction) {
vm.playMusic()
}
})
Expand Down

0 comments on commit 0d161a6

Please sign in to comment.