镇念塔:修复加速次数

This commit is contained in:
luying
2021-08-19 12:01:06 +08:00
parent 13b0cf18d0
commit c17afa200e
3 changed files with 4 additions and 6 deletions
@@ -111,10 +111,9 @@ export class TowerBattleHandler {
} }
const spdUpRec = await HangUpSpdUpRecModel.updateRec(roleId, roleName, msg.speedUpCnt, endLv, needReceiveGoods); const spdUpRec = await HangUpSpdUpRecModel.updateRec(roleId, roleName, msg.speedUpCnt, endLv, needReceiveGoods);
const goods = await addItems(roleId, roleName, sid, timeReward); const goods = await addItems(roleId, roleName, sid, timeReward);
let num = getManyHangSpdUpCostGold(spdUpResult.hangUpSpdUpCnt, 1); let nextCostGold = getManyHangSpdUpCostGold(spdUpResult.hangUpSpdUpCnt, 1);
let nextCostGold = getHangSpdUpCostGold(num);
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) { async getTasks(msg: {}, session: BackendSession) {
+2 -2
View File
@@ -299,7 +299,7 @@ export async function calcuHangUpReward(roleId: string, speedUp = false, speedUp
} }
if (speedUp) { // 加速,直接收取6小时收益,小数的累积和普通收取独立 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 multi = Math.floor(HANG_UP_CONSTS.SPD_UP_REC_TIME / HANG_UP_CONSTS.UNIT_TIME);
let spdUpRec = await HangUpSpdUpRecModel.getSpdUpRec(roleId, towerLv - 1); let spdUpRec = await HangUpSpdUpRecModel.getSpdUpRec(roleId, towerLv - 1);
let goods = []; let goods = [];
@@ -646,7 +646,7 @@ export function getHangSpdUpCostGold(times:number) {
if(times <= dicParam.TOWER_BOOST.TOWER_BOOSTFREETIME) { if(times <= dicParam.TOWER_BOOST.TOWER_BOOSTFREETIME) {
return 0 return 0
} else { } 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; if(cost > dicParam.TOWER_BOOST.TOWER_BOOSTCASTMAX) cost = dicParam.TOWER_BOOST.TOWER_BOOSTCASTMAX;
return cost; return cost;
} }
-1
View File
@@ -1,4 +1,3 @@
import { HANG_UP_CONSTS } from './../consts';
import BaseModel from './BaseModel'; import BaseModel from './BaseModel';
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose'; import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
import * as dicParam from '../pubUtils/dicParam'; import * as dicParam from '../pubUtils/dicParam';