活动:新将抽卡添加固定奖励
This commit is contained in:
@@ -56,20 +56,19 @@ export class ActivityMonopolyHandler {
|
||||
const roleName = session.get('roleName');
|
||||
|
||||
let moveStep = 0;
|
||||
if (step >= 1 && step <= 6) {//指定
|
||||
if (step >= 1 && step <= 6) {//指定,天机骰子
|
||||
//检查资源
|
||||
let consumeResult = await handleCost(roleId, sid, [{ id: CURRENCY_BY_TYPE.get(CURRENCY_TYPE.GOLD), count: 1 }]);
|
||||
let consumeResult = await handleCost(roleId, sid, [{ id: CURRENCY_BY_TYPE.get(CURRENCY_TYPE.SPECIAL_DICE), count: 1 }]);
|
||||
if (!consumeResult) return resResult(STATUS.ACTIVITY_RES_NOT_ENOUGH);
|
||||
moveStep = step;
|
||||
} else {
|
||||
} else {//普通骰子
|
||||
//检查资源
|
||||
let consumeResult = await handleCost(roleId, sid, [{ id: CURRENCY_BY_TYPE.get(CURRENCY_TYPE.GOLD), count: 1 }]);
|
||||
let consumeResult = await handleCost(roleId, sid, [{ id: CURRENCY_BY_TYPE.get(CURRENCY_TYPE.NORMAL_DICE), count: 1 }]);
|
||||
if (!consumeResult) return resResult(STATUS.ACTIVITY_RES_NOT_ENOUGH);
|
||||
moveStep = random(5) + 1;
|
||||
}
|
||||
let playerData = await getPlayerMonopolyData(activityId, serverId, roleId)
|
||||
|
||||
let playerMonopolyData: ActivityMonopolyModelType = await ActivityMonopolyModel.findData(serverId, activityId, roleId);
|
||||
let oldPosition = playerData.curPosition;
|
||||
let newPosition = nextPosition(oldPosition, moveStep, playerData.list.length);
|
||||
await ActivityMonopolyModel.updatePosition(serverId, activityId, roleId, newPosition, 1)
|
||||
|
||||
Reference in New Issue
Block a user