关卡添加消耗品结算,奇遇的坐标改为点id
This commit is contained in:
@@ -129,14 +129,14 @@ export async function refreshEvent(num: number, roleId: string, roleName: string
|
||||
|
||||
let index = Math.floor(Math.random() * randomList.length);
|
||||
let dic = randomList[index];
|
||||
let position = randomPosition(dic.position);
|
||||
let point = randomPosition(dic.movePointArray);
|
||||
let question = dic.eventType == EVENT_TYPE.QUIZ?randomQuestion(EVENT_QUIZ_NUM): undefined;
|
||||
let eventCode = genCode(8);
|
||||
let data = await EventRecordModel.saveEventRecord(eventCode, {
|
||||
roleId, refTime: t, eventId: dic.eventID,
|
||||
roleName, turn, type: dic.eventType, battleId: dic.warId||0, quality: dic.quality,
|
||||
status: EVENT_RECORD_STATUS.WAITING,
|
||||
position, question
|
||||
point, question
|
||||
});
|
||||
event.push(data);
|
||||
randomList.splice(index, 1);
|
||||
@@ -148,14 +148,14 @@ export async function refreshEvent(num: number, roleId: string, roleName: string
|
||||
let {dic} = getRandomWithWeight(randomList);
|
||||
console.log(JSON.stringify(dic))
|
||||
// if(!dic) break;
|
||||
let position = randomPosition(dic.position);
|
||||
let point = randomPosition(dic.movePointArray);
|
||||
let eventCode = genCode(8);
|
||||
let question = dic.eventType == EVENT_TYPE.QUIZ?randomQuestion(EVENT_QUIZ_NUM): [];
|
||||
let data = await EventRecordModel.saveEventRecord(eventCode, {
|
||||
roleId, refTime: t, eventId: dic.eventID,
|
||||
roleName, type: dic.eventType, battleId: dic.warId||0, quality: dic.quality,
|
||||
status: EVENT_RECORD_STATUS.WAITING,
|
||||
position, question
|
||||
point, question
|
||||
});
|
||||
event.push(data)
|
||||
}
|
||||
@@ -165,7 +165,7 @@ export async function refreshEvent(num: number, roleId: string, roleName: string
|
||||
}
|
||||
|
||||
function randomPosition(positionStr: string) {
|
||||
let positionArr = decodeStr('position', positionStr);
|
||||
let positionArr = decodeStr('point', positionStr, '&');
|
||||
let index = Math.floor(Math.random() * positionArr.length);
|
||||
return positionArr[index]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user