镇念塔:消耗使用系统参数表
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { HeroModel } from './../db/Hero';
|
||||
import { HangUpRecordModel } from './../db/HangUpRecord';
|
||||
import { pinus } from 'pinus';
|
||||
import { HANG_UP_CONSTS, TOWER_TASK_CONST, REDIS_KEY, TASK_TYPE, TIME_OUTPUT_TYPE, GOLD_COST_RATIO, TOWER_TASK_STATUS, MAIL_TYPE } from './../consts';
|
||||
import { HANG_UP_CONSTS, REDIS_KEY, TASK_TYPE, TIME_OUTPUT_TYPE, GOLD_COST_RATIO, TOWER_TASK_STATUS, MAIL_TYPE } from './../consts';
|
||||
import { BattleRecordModel } from './../db/BattleRecord';
|
||||
import { TowerRecordModel } from './../db/TowerRecord';
|
||||
import { RoleModel, RoleType } from './../db/Role';
|
||||
@@ -18,6 +18,7 @@ import { getTimeFunM } from '../pubUtils/timeUtil';
|
||||
import { ComRoleStatusHero } from '../db/ComBattleTeam';
|
||||
import { sendMailByContent } from './mailService';
|
||||
import { DicTowerTask } from '../pubUtils/dictionary/DicTowerTask';
|
||||
import { TOWER_SEARCH } from '../pubUtils/dicParam';
|
||||
|
||||
/**
|
||||
* 获取当前镇念塔状态
|
||||
@@ -65,7 +66,7 @@ export async function getHungupRewards(roleId: string) {
|
||||
hangUpSpdUpCnt = HANG_UP_CONSTS.MAX_SPD_UP_CNT;
|
||||
}
|
||||
let num = HANG_UP_CONSTS.MAX_SPD_UP_CNT - hangUpSpdUpCnt + 1;
|
||||
let nextCostGold = calculateNum(GOLD_COST_RATIO.TOWER_HANG_SPDUP, {num}, 50);
|
||||
let nextCostGold = getTowerTaskSpdUpCostGold(num);
|
||||
|
||||
return {
|
||||
status: 0,
|
||||
@@ -105,7 +106,7 @@ export async function getTasks(role: RoleType) {
|
||||
}
|
||||
|
||||
let refRemainTime = getRemainTime(curTime);
|
||||
let nextCostGold = calculateNum(GOLD_COST_RATIO.TOWER_TASK_REF, {num: towerTaskReCnt + 1}, 50);
|
||||
let nextCostGold = getTowerTaskCostGold(towerTaskReCnt + 1);
|
||||
|
||||
return {curTasks: treatTask(curTasks, curTime), refRemainTime, nextCostGold}
|
||||
}
|
||||
@@ -379,7 +380,7 @@ export async function refreshTasks(towerLv: number, batchCode: string, roleId: s
|
||||
|
||||
let ridTaskIds: number[] = [];
|
||||
let positions = new Map<number, TowerTaskRecType> (); // 需要创建或更新
|
||||
for(let i = 1; i <= TOWER_TASK_CONST.RAND_CNT; i++) { // TODO 改为系统参数表
|
||||
for(let i = 1; i <= TOWER_SEARCH.TOWER_SEARCH_LIMITED; i++) {
|
||||
positions.set(i, null);
|
||||
}
|
||||
for(let task of oldTasks) {
|
||||
@@ -573,3 +574,15 @@ export function transBossHpArr(source: Array<{ dataId: number, hp: number, actor
|
||||
});
|
||||
return cloneDeep(desArr);
|
||||
}
|
||||
|
||||
export function getTowerTaskCostGold(times: number) {
|
||||
let cost = times * TOWER_SEARCH.TOWER_SEARCH_REFRESHRULE_FEE;
|
||||
if(cost > TOWER_SEARCH.TOWER_SEARCH_REFRESHRULE_MAX) cost = TOWER_SEARCH.TOWER_SEARCH_REFRESHRULE_MAX;
|
||||
return cost;
|
||||
}
|
||||
|
||||
export function getTowerTaskSpdUpCostGold(times:number) {
|
||||
let cost = times * TOWER_SEARCH.TOWER_SEARCH_REFRESHRULE_FEE; // TODO 改成系统参数表
|
||||
if(cost > TOWER_SEARCH.TOWER_SEARCH_REFRESHRULE_MAX) cost = TOWER_SEARCH.TOWER_SEARCH_REFRESHRULE_MAX;
|
||||
return cost;
|
||||
}
|
||||
Reference in New Issue
Block a user