任务:添加每日主公经验

This commit is contained in:
luying
2021-07-01 19:02:39 +08:00
parent 0903959d5d
commit c94e2a40e5
8 changed files with 70 additions and 31 deletions
+4 -1
View File
@@ -87,6 +87,7 @@ import { dicTaskTypeDesc, loadTaskType } from './dictionary/DicTaskType';
import { dicServerName, dicServerGroupName, loadServerName } from "./dictionary/DicServerName";
import { dicAp, loadAp, dicApMaxLevel } from './dictionary/DicAp';
import { dicApBuy, dicApMaxBuyTimes, loadApBuy } from "./dictionary/DicApBuy";
import { dicTaskExp, loadTskExp} from './dictionary/DicTaskExp';
export const gameData = {
blurprtCompose: dicBlueprtCompose,
@@ -213,7 +214,8 @@ export const gameData = {
ap: dicAp,
apMaxLevel: dicApMaxLevel,
apBuy: dicApBuy,
apMaxBuyTimes: dicApMaxBuyTimes
apMaxBuyTimes: dicApMaxBuyTimes,
taskExp: dicTaskExp
};
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
@@ -815,6 +817,7 @@ function loadDatas() {
loadServerName();
loadAp();
loadApBuy();
loadTskExp();
}
// 重载dicParam
+7 -1
View File
@@ -52,7 +52,7 @@ export interface DicDailyTask extends DicTaskBase {
// 活跃
readonly point: number;
// 经验基数
readonly exp: number;
readonly exp: RewardInter;
// 获得积分关联的活动id
readonly addPointActivityId: number;
}
@@ -112,6 +112,7 @@ export function loadTask() {
arrDailyTask.forEach(o => {
o.taskParam = parseNumberList(o.taskParam);
o.taskReward = parseGoodStr(o.taskReward);
o.exp = parseExp(o.exp);
dicDailyTask.set(o.id, _.pick(o, Object.keys(DicDailyTaskKeys)));
pushDicTaskType(o.taskType, TASK_FUN_TYPE.DAILY, o);
});
@@ -133,4 +134,9 @@ function pushDicTaskType(taskType: number, type: number, o: any) {
let newObj = _.pick(o, Object.keys(DicTaskKeys));
newObj.type = type;
dicTaskType.get(taskType).push(newObj)
}
function parseExp(exp: string) {
let [ id, count ] = parseNumberList(exp);
return {id, count}
}
+20
View File
@@ -0,0 +1,20 @@
// 任务奖励主公经验
import {readFileAndParse, parseGoodStr} from '../util'
import { FILENAME, TASK_FUN_TYPE } from '../../consts'
export interface DicTaskExp {
// 主公等级
readonly lv: number;
// 主公经验
readonly exp: number;
}
export const dicTaskExp = new Map<number, number>();
export function loadTskExp() {
let arr1 = readFileAndParse(FILENAME.DIC_TASK_EXP);
arr1.forEach(o => {
dicTaskExp.set(o.lv, o.exp);
});
arr1 = undefined;
}