更新通知:solo attack

This commit is contained in:
李万一 2021-11-04 09:16:25 +00:00 committed by Gitee
parent f97c387be8
commit c8c97ee75d

View File

@ -12,7 +12,6 @@
!(function () {
'use strict';
const $ = window.jQuery;
let invervalID;
/**
* 飞行
@ -387,26 +386,111 @@
}
return;
}
if ($(e).text().indexOf('mugged') >= 0) { // 被mug
if ($(e).text().indexOf('Someone') >= 0) { // 被匿名mug
return;
/**
* 被mug
*/
if ($(e).text().indexOf('mugged') >= 0) {
const spl = $(e).text().trim().split(' ');
if (spl.length > 7) return; // 多人运动暂时跳过
const money = spl[spl.length - 2];
if (spl[0] === 'Someone') { // 被匿名mug
e.firstChild.nodeValue = '有人打劫了你 ' + money + ' [';
e.childNodes[1].firstChild.nodeValue = '查看';
} else {
e.childNodes[1].nodeValue = ' 打劫了你 ' + money + ' [';
e.childNodes[2].firstChild.nodeValue = '查看';
}
return;
}
}
/**
* 被打
*/
if ($(e).text().indexOf('attacked') >= 0) { // 被打
if ($(e).text().indexOf('Someone') >= 0) { // 被匿名
if ($(e).text().indexOf('hospitalized') >= 0) { // 被打住院
/**
* 攻击方式 词数=spl.length
* 匿名 4 Someone attacked you [view]
* - hosp 6 Someone attacked and hospitalized you [view]
* -- 有人袭击了你并安排你住院
* 实名 4 EternalSoulFire attacked you [view]
* - lost 6 EternalSoulFire attacked you but lost [view]
* - hosp 6
* - 逃跑esc 6 Dr_Bugsy_Siegel attacked you but escaped [view]
* - 25回合平手stale 6 Tharizdun attacked you but stalemated [view]
* - 起飞或bug 6 Mrew tried to attack you [view]
*
* You attacked Cherreh but timed out [view]
*
* 多人运动 todo
* 10 Pual (and 2 others) attached you and hospitalized you [view]
* 9 Argozdoc attacked you but Norm fought him off [view]
*/
const spl = $(e).text().trim().split(' ');
if (spl.length > 6) { // 多人运动暂时跳过
/**
* 超时自动失败
*/
if (spl[4] === 'timed') {
if (e.firstChild.firstChild) { // 由第一个节点是否有子节点判断 被攻击
e.childNodes[1].nodeValue = ' 袭击你但是超时了 [';
e.childNodes[2].firstChild.nodeValue = '查看';
return;
}
e.firstChild.nodeValue = '你袭击 ';
e.childNodes[2].nodeValue = ' 但是超时了 [';
e.childNodes[3].firstChild.nodeValue = '查看';
return;
}
return;
;
}
if ($(e).text().indexOf('but lost') >= 0) { // 收lost
if (spl[0] === 'Someone') { // 被匿名
if (spl.length === 6 && spl[3] === 'hospitalized') { // 匿名hos
e.firstChild.nodeValue = '有人袭击你并安排你住院 [';
e.childNodes[1].firstChild.nodeValue = '查看';
return;
}
if ($(e).text().indexOf('hospitalized') >= 0) { // 被实名打住院
e.firstChild.nodeValue = '有人袭击了你 [';
e.childNodes[1].firstChild.nodeValue = '查看';
return;
}
if (spl.length === 4) { // 实名leave
e.childNodes[1].nodeValue = ' 袭击了你 [';
e.childNodes[2].firstChild.nodeValue = '查看';
return;
}
if (spl.length === 6) { // 实名的情况
switch (spl[4]) {
case 'lost':
e.childNodes[1].nodeValue = ' 袭击你但输了 [';
e.childNodes[2].firstChild.nodeValue = '查看';
return;
case 'escaped':
e.childNodes[1].nodeValue = ' 袭击你但逃跑了 [';
e.childNodes[2].firstChild.nodeValue = '查看';
return;
case 'stalemated':
e.childNodes[1].nodeValue = ' 袭击你但打成了平手 [';
e.childNodes[2].firstChild.nodeValue = '查看';
return;
}
switch (spl[3]) {
case 'attack': // Mrew tried to attack you [view]
e.childNodes[1].nodeValue = ' 尝试袭击你 [';
e.childNodes[2].firstChild.nodeValue = '查看';
return;
case 'hospitalized':
e.childNodes[1].nodeValue = ' 袭击你并安排你住院 [';
e.childNodes[2].firstChild.nodeValue = '查看';
return;
}
}
}
/**
@ -415,7 +499,6 @@
* zstorm won $5,574,200 in the Daily Dime lottery!
*/
if ($(e).text().indexOf('lottery') >= 0) {
//console.log('彩票')
const split = e.childNodes[1].nodeValue.split(' ');
const type = split[split.length - 3] + ' ' + split[split.length - 2];
const money = split[2];
@ -436,7 +519,7 @@
*/
if ($(e).text().indexOf('bust') >= 0) { // 劫狱成功
if ($(e).text().indexOf('to bust') >= 0) { // 劫狱失败
e.childNodes[1].nodeValue = ' 想捞你出来但是把自己搭进去。';
e.childNodes[1].nodeValue = ' 想捞你出来但是把自己搭进去。';
return;
}
e.childNodes[1].nodeValue = ' 成功把你捞了出来。';