镇念塔:节点奖励

This commit is contained in:
luying
2022-04-19 16:45:16 +08:00
parent b8a54fc592
commit 9095b67fab
8 changed files with 1905 additions and 4 deletions

View File

@@ -543,6 +543,7 @@ export const FILENAME = {
DIC_JEWEL_CONDITION: 'dic_zyz_jewel_condition',
DIC_MAIN_STAR_BOX: 'dic_zyz_main_star_reward',
DIC_EQUIP_STRENGTH_ATTR: 'dic_zyz_equipStrengthAttr',
DIC_TOWER_GIFT: 'dic_zyz_towerGift',
}
export const WAR_RELATE_TABLES = [
@@ -1016,7 +1017,8 @@ export enum ITEM_CHANGE_REASON {
ACT_GUILD_PAY_REWARD = 144, // 活动-军团人数奖励
RECEIVE_CHAPTER_BOX = 145, // 领取主线章节宝箱
JEWEL_INHERIT = 146, // 天晶继承
RESET_TALENT = 147, // 洗点
RESET_TALENT = 147, // 洗点
RECEIVE_TOWER_BOX = 148, // 领取镇念塔节点奖励
}
export enum TA_EVENT {

View File

@@ -106,6 +106,9 @@ export const STATUS = {
TOWER_HERO_FORBIDDEN: { code: 20520, simStr: '该武将不可使用' },
TOWER_CANNOT_SKIP: { code: 20521, simStr: '该层不可跳过' },
TOWER_SKIP_POWER_NOT_ENOUGH: { code: 20522, simStr: '战力不足不可跳过' },
TOWER_LV_NOT_ENOUGH: { code: 20523, simStr: '层数不足不可领取奖励' },
TOWER_BOX_NO_RECEIVE: { code: 20524, simStr: '无可领取奖励' },
TOWER_BOX_HAS_RECEIVED: { code: 20525, simStr: '奖励已领取' },
// 寻宝(共斗) 20600 - 20699
COM_BATTLE_DUP_ENTER: { code: 20601, simStr: '不能重复加入' },
COM_BATTLE_BLUEPRT_NOT_FOUND: { code: 20602, simStr: '藏宝图不足' },

View File

@@ -209,6 +209,8 @@ export default class Role extends BaseModel {
towerLv: number; // 天梯当前层数
@prop({ required: true, default: new Date() })
towerUpTime: Date; // 天梯爬到这一层的时间
@prop({ required: true, default: [], type: Number })
towerReceived: number[]; // 已领取节点
@prop({ required: true, default: 0 })
hangUpSpdUpCnt: number; // 挂机加速次数
@@ -364,6 +366,11 @@ export default class Role extends BaseModel {
return role;
}
public static async receiveTowerBox(roleId: string, ids: number[] = []) {
let role: RoleType = await RoleModel.findOneAndUpdate({ roleId }, { $push: { towerReceived: { $each: ids }} }, { new: true }).lean();
return role;
}
public static async increaseExpeditionPoint(roleId: string, point: number, lean = true) {
let role: RoleType = await RoleModel.findOneAndUpdate({ roleId }, { $inc: { expeditionPoint: point } }, { new: true }).lean(lean);
return role;

View File

@@ -104,6 +104,7 @@ import { dicMainStarBox, dicMainStarBoxByChapter, loadMainStarBox } from './dict
import { dicHeroTalent, initTalents, loadHeroTalent } from './dictionary/DicHeroTalent';
import { Talent } from "../db/Hero";
import { dicEquipStrengthAttr, loadEquipStrengthAttr } from './dictionary/DicEquipStrengthAttr';
import { dicTowerGift, loadTowerGift } from './dictionary/DicTowerGift';
export const gameData = {
daily: dicDaily,
@@ -127,6 +128,7 @@ export const gameData = {
se: dicSe,
tower: dicTower,
towerTask: dicTowerTask,
towerGift: dicTowerGift,
war: dicWar,
warJson: dicWarJson,
dailyWarByType: dicDailyWarByType,
@@ -974,6 +976,7 @@ function loadDatas() {
loadSe();
loadTower();
loadTowerTask();
loadTowerGift();
loadWar();
loadWarJson();
loadXunbao();

View File

@@ -0,0 +1,34 @@
// 物品表
import { readFileAndParse, parseGoodStr, } from '../util'
import { FILENAME, } from '../../consts'
import { RewardInter } from '../interface';
const _ = require('lodash');
export interface DicTowerGift {
// 奖励id
readonly id: number;
// 镇念塔层数
readonly towerLv: number;
// 奖励
readonly reward: RewardInter[];
}
type KeysEnum<T> = { [P in keyof Required<T>]: true };
const DicTowerGiftKeys: KeysEnum<DicTowerGift> = {
id: true,
towerLv: true,
reward: true,
}
export const dicTowerGift = new Map<number, DicTowerGift>();
export function loadTowerGift() {
dicTowerGift.clear();
let arr = readFileAndParse(FILENAME.DIC_TOWER_GIFT);
arr.forEach(o => {
o.reward = parseGoodStr(o.reward);
dicTowerGift.set(o.id, _.pick(o, Object.keys(DicTowerGiftKeys)));
});
arr = undefined;
}

File diff suppressed because it is too large Load Diff