master
yin5th 2021-11-21 17:14:27 +08:00
parent c24bb8200d
commit 9071528f4e
1 changed files with 7 additions and 2 deletions

View File

@ -121,11 +121,15 @@ function receiveMessage(event)
let mathIndex = Math.floor(Math.random()*15) let mathIndex = Math.floor(Math.random()*15)
console.log(mathIndex, '随机因子') console.log(mathIndex, '随机因子')
let randomEvent = eventTextList[mathIndex] ? eventTextList[mathIndex] : '' let randomEvent = eventTextList[mathIndex] ? eventTextList[mathIndex] : ''
// TODO 测试后 删除弹幕随机附加事件
let dm = {text: data.danmaku, uid: data.uid, uname: data.uname, let dm = {text: data.danmaku, uid: data.uid, uname: data.uname,
event: getEvent(getFirstEventKeyword(data.danmaku+randomEvent)), event: getEvent(getFirstEventKeyword(data.danmaku+randomEvent)),
is_new: random1, is_admin: 0, is_exit: random2, is_leader: isLeader} is_new: random1, is_admin: 0, is_exit: random2, is_leader: isLeader}
// TODO 测试后 删除领舞随机
let leaderRandomEvent = getEvent(getFirstEventKeyword(data.danmaku+randomEvent))
let leader = { let leader = {
uid: 0, uname: leaderInfo, text: '', event: '' uid: 0, uname: leaderInfo, text: getEvent(getFirstEventKeyword(data.danmaku+randomEvent)), event: leaderRandomEvent
} }
if (isLeader) { if (isLeader) {
leader.uid = dm.uid leader.uid = dm.uid
@ -136,7 +140,8 @@ function receiveMessage(event)
console.log(dm, '弹幕') console.log(dm, '弹幕')
console.log(leader, '当前领舞') console.log(leader, '当前领舞')
console.log(leaderInfo, '本地缓存领舞') console.log(leaderRandomEvent, '领舞随机事件')
let actionIndex = Math.floor(Math.random()*actionArr.length); let actionIndex = Math.floor(Math.random()*actionArr.length);
let moveIndex = Math.floor(Math.random()*moveArr.length); let moveIndex = Math.floor(Math.random()*moveArr.length);