武将:职业天赋接口

This commit is contained in:
陆莹
2022-03-22 20:46:17 +08:00
parent 3c24e54350
commit 5d0040b8a8
20 changed files with 2811 additions and 1199 deletions

View File

@@ -7,6 +7,7 @@ import { reduceCe } from '../pubUtils/util';
import Skin from './Skin';
import { SearchHeroParam } from '../domain/backEndField/search';
import { Reward } from '../domain/battleField/pvp';
import { getHeroInitTalent } from '../pubUtils/data';
type CeAttrUpdate = Partial<CeAttrData>;
export class CeAttrData {
@@ -61,6 +62,18 @@ export class Connect {
level: number;
}
export class Talent {
@prop({ required: true })
id: number; // 天赋表id
@prop({ required: true })
level: number; // 激活等级
constructor(id: number, level = 1) {
this.id = id;
this.level = level;
}
}
export class HeroSkin {
@prop({ required: true })
id: number;
@@ -70,6 +83,19 @@ export class HeroSkin {
skin: Ref<Skin>;
@prop({ required: true })
enable: boolean;
@prop({ required: true, type: Talent, _id: false })
talent: Talent[]; // 天赋树
@prop({ required: true })
usedTalentPoint: number; // 已使用的天赋点数
constructor(id: number, skinId: number, skin: string, enable: boolean) {
this.id = id;
this.skinId = skinId;
this.skin = skin;
this.enable = enable;
this.talent = getHeroInitTalent(skinId);
this.usedTalentPoint = 0;
}
}
export class Stone {