镇念塔:修复加速次数
This commit is contained in:
@@ -111,10 +111,9 @@ export class TowerBattleHandler {
|
||||
}
|
||||
const spdUpRec = await HangUpSpdUpRecModel.updateRec(roleId, roleName, msg.speedUpCnt, endLv, needReceiveGoods);
|
||||
const goods = await addItems(roleId, roleName, sid, timeReward);
|
||||
let num = getManyHangSpdUpCostGold(spdUpResult.hangUpSpdUpCnt, 1);
|
||||
let nextCostGold = getHangSpdUpCostGold(num);
|
||||
let nextCostGold = getManyHangSpdUpCostGold(spdUpResult.hangUpSpdUpCnt, 1);
|
||||
|
||||
return resResult(STATUS.SUCCESS, { goods, hangUpSpdUpCnt, nextCostGold, hangUpPassTime: Math.floor(deltaTime/1000), rewardLv: endLv, costGold });
|
||||
return resResult(STATUS.SUCCESS, { goods, hangUpSpdUpCnt: spdUpResult.hangUpSpdUpCnt, nextCostGold, hangUpPassTime: Math.floor(deltaTime/1000), rewardLv: endLv, costGold });
|
||||
}
|
||||
|
||||
async getTasks(msg: {}, session: BackendSession) {
|
||||
|
||||
@@ -299,7 +299,7 @@ export async function calcuHangUpReward(roleId: string, speedUp = false, speedUp
|
||||
}
|
||||
|
||||
if (speedUp) { // 加速,直接收取6小时收益,小数的累积和普通收取独立
|
||||
if (hangUpSpdUpCnt < speedUpCnt || !lastSpdUpTime || shouldRefresh(lastSpdUpTime, new Date)) { // 可加速
|
||||
if (hangUpSpdUpCnt + speedUpCnt < dicParam.TOWER_BOOST.TOWER_BOOSTTIME || !lastSpdUpTime || shouldRefresh(lastSpdUpTime, new Date)) { // 可加速
|
||||
let multi = Math.floor(HANG_UP_CONSTS.SPD_UP_REC_TIME / HANG_UP_CONSTS.UNIT_TIME);
|
||||
let spdUpRec = await HangUpSpdUpRecModel.getSpdUpRec(roleId, towerLv - 1);
|
||||
let goods = [];
|
||||
@@ -646,7 +646,7 @@ export function getHangSpdUpCostGold(times:number) {
|
||||
if(times <= dicParam.TOWER_BOOST.TOWER_BOOSTFREETIME) {
|
||||
return 0
|
||||
} else {
|
||||
let cost = (times - dicParam.TOWER_BOOST.TOWER_BOOSTFREETIME) * dicParam.TOWER_BOOST.TOWER_BOOSTCAST; // TODO 改成系统参数表
|
||||
let cost = (times - dicParam.TOWER_BOOST.TOWER_BOOSTFREETIME) * dicParam.TOWER_BOOST.TOWER_BOOSTCAST;
|
||||
if(cost > dicParam.TOWER_BOOST.TOWER_BOOSTCASTMAX) cost = dicParam.TOWER_BOOST.TOWER_BOOSTCASTMAX;
|
||||
return cost;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { HANG_UP_CONSTS } from './../consts';
|
||||
import BaseModel from './BaseModel';
|
||||
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
||||
import * as dicParam from '../pubUtils/dicParam';
|
||||
|
||||
Reference in New Issue
Block a user