战斗:参数改为使用系统参数表

This commit is contained in:
luying
2021-08-30 16:54:31 +08:00
parent 4078508505
commit 1e722c59d4
12 changed files with 76 additions and 81 deletions
@@ -9,6 +9,7 @@ import { RoleModel, RoleType } from '../db/Role';
import { gameData } from '../pubUtils/data';
import { DicWar } from '../pubUtils/dictionary/DicWar';
import { WarStar } from '../domain/dbGeneral';
import * as dicParam from '../pubUtils/dicParam';
/**
* 获取全部每日关卡列表
@@ -121,4 +122,17 @@ export async function getDailyNum(dailyRecord: DailyRecord, timesPerDay?: number
timesCanBuy += 0; // 暂留,用于处理vip等级增加最大购买次数
}
return {count: timesPerDay - count + buyCount, buyCount: timesCanBuy - buyCount}
}
/**
* 每日购买次数的花费
* @param num 如果没有买过次数,那么这里算第一次,传1
* @returns
*/
export function getDailyBuyCountCost(num: number) {
let cost = ( num - 1 ) * dicParam.DAILY_CONST.DAILY_CONST_UP + dicParam.DAILY_CONST.DAILY_CONST_BASE;
if(cost > dicParam.DAILY_CONST.DAILY_CONST_TOP) {
cost = dicParam.DAILY_CONST.DAILY_CONST_TOP;
}
return cost;
}