属性:fix
This commit is contained in:
@@ -154,7 +154,7 @@ export class RoleHandler {
|
||||
return resResult(STATUS.DIC_DATA_NOT_FOUND)
|
||||
|
||||
for(let [attrId, val] of teraph.attr) {
|
||||
if (teraph.attr.get(attrId) != teraphInfo.mainAttrMax.get(attrId))
|
||||
if (val < teraphInfo.mainAttrMax.get(attrId))
|
||||
return resResult(STATUS.ROLE_TERAPH_NOT_QUILITY);
|
||||
|
||||
teraph.attr.set(attrId, 0);
|
||||
@@ -171,7 +171,7 @@ export class RoleHandler {
|
||||
if (!result)
|
||||
return resResult(STATUS.BATTLE_CONSUMES_NOT_ENOUGH);
|
||||
|
||||
role = await calAllHeroCe(HERO_SYSTEM_TYPE.TERAPH_UP, sid, roleId, { teraphs });
|
||||
role = await calAllHeroCe(HERO_SYSTEM_TYPE.TERAPH_UP, sid, roleId, { teraphs }, [id]);
|
||||
return resResult(STATUS.SUCCESS, { roleId, teraphs: role.teraphs });
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ export class RoleHandler {
|
||||
|
||||
let { hid } = msg;
|
||||
|
||||
let curHero = await HeroModel.findByHidAndRole(hid, roleId, 'star colorStar quality scrollId scrollActive scrollStar scrollColorStar scrollQuality favour favourLv');
|
||||
let curHero = await HeroModel.findByHidAndRole(hid, roleId, 'hid star colorStar quality scrollId scrollActive scrollStar scrollColorStar scrollQuality favour favourLv connections attr ce');
|
||||
if (!curHero) return resResult(STATUS.HERO_NOT_FIND);
|
||||
|
||||
let dicHero = gameData.hero.get(hid);
|
||||
|
||||
@@ -13,7 +13,7 @@ import { RoleUpdate } from '../db/Role';
|
||||
|
||||
//修改并下发战力
|
||||
export async function calPlayerCeAndSave(type: number, sid: string, roleId: string, originHero: HeroType, update: HeroUpdate, args?: Array<number>) {
|
||||
let {role, pushHeros, topLineupCe, hero} = await pubCalPlayerCeAndSave(type, roleId, originHero, update, null, args);
|
||||
let {role, pushHeros, topLineupCe, hero} = await pubCalPlayerCeAndSave(type, roleId, originHero, update, args);
|
||||
console.log(JSON.stringify(pushHeros))
|
||||
//下发战力
|
||||
let uids = [{ uid: roleId, sid }];
|
||||
|
||||
@@ -21,9 +21,9 @@ module.exports = {
|
||||
"message Hero": {
|
||||
'required uInt32 hid': 1,
|
||||
'required uInt32 ce': 2,
|
||||
'required uInt32 incHeroCe': 3,
|
||||
'required sInt32 incHeroCe': 3,
|
||||
},
|
||||
'required uInt32 ce': 1,
|
||||
'required sInt32 ce': 1,
|
||||
'repeated Hero heros': 2,
|
||||
'required uInt32 topLineupCe': 3
|
||||
},
|
||||
|
||||
@@ -1,11 +1,26 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { CeAttrData } from '../domain/roleField/attribute';
|
||||
import { index, getModelForClass, prop, Ref, mongoose, DocumentType } from '@typegoose/typegoose';
|
||||
import Equip, { } from './Equip';
|
||||
import { CounterModel } from './Counter';
|
||||
import { COUNTER, EQUIP_TYPE } from '../consts';
|
||||
import { reduceCe } from '../pubUtils/util';
|
||||
|
||||
class CeAttrData {
|
||||
@prop({ required: true })
|
||||
id: number = 0;
|
||||
@prop({ required: true })
|
||||
base: number = 0;
|
||||
@prop({ required: true })
|
||||
ratioUp: number = 0;
|
||||
@prop({ required: true })
|
||||
fixUp: number = 0;
|
||||
@prop({ required: true })
|
||||
equipUp: number = 0;
|
||||
|
||||
constructor(id: number) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 英雄表
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { HANG_UP_CONSTS, ROLE_TERAPH, ROLE_SELECT, ABI_TYPE } from './../consts';
|
||||
import BaseModel from './BaseModel';
|
||||
import { CeAttrDataRole } from '../domain/roleField/attribute';
|
||||
import { index, getModelForClass, prop, DocumentType, Ref, mongoose } from '@typegoose/typegoose';
|
||||
import User from './User';
|
||||
import { shouldRefresh, reduceCe } from '../pubUtils/util';
|
||||
@@ -8,6 +7,20 @@ import { initRoleAtrr } from '../pubUtils/playerCe';
|
||||
import Hero,{} from '../db/Hero';
|
||||
import { nowSeconds } from '../pubUtils/timeUtil';
|
||||
|
||||
// role表属性格式
|
||||
export class CeAttrDataRole {
|
||||
@prop({ required: true })
|
||||
id: number = 0;
|
||||
@prop({ required: true })
|
||||
ratioUp: number = 0;
|
||||
@prop({ required: true })
|
||||
fixUp: number = 0;
|
||||
|
||||
constructor(id: number) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
class TopHero {
|
||||
@prop({ required: true })
|
||||
hid: number; // 武将id
|
||||
|
||||
@@ -73,6 +73,7 @@ function parseMainAttrMax(elem) {
|
||||
result.set(ABI_TYPE.ABI_ATK, elem.atkMax);
|
||||
result.set(ABI_TYPE.ABI_DEF, elem.defMax);
|
||||
result.set(ABI_TYPE.ABI_MDEF, elem.mdefMax);
|
||||
return result
|
||||
}
|
||||
|
||||
function parseMainAttrUp(elem) {
|
||||
@@ -81,4 +82,5 @@ function parseMainAttrUp(elem) {
|
||||
result.set(ABI_TYPE.ABI_ATK, elem.atkUp);
|
||||
result.set(ABI_TYPE.ABI_DEF, elem.defUp);
|
||||
result.set(ABI_TYPE.ABI_MDEF, elem.mdefUp);
|
||||
return result
|
||||
}
|
||||
@@ -21,8 +21,8 @@ import { GuildModel } from '../db/Guild';
|
||||
import { DicJob } from './dictionary/DicJob';
|
||||
|
||||
// 修改并下发战力
|
||||
export async function calPlayerCeAndSave(type: number, roleId: string, originHero: HeroType, update: HeroUpdate, role?: RoleType, args?: Array<number>) {
|
||||
if(!role) role = await RoleModel.findByRoleId(roleId);
|
||||
export async function calPlayerCeAndSave(type: number, roleId: string, originHero: HeroType, update: HeroUpdate, args?: Array<number>) {
|
||||
let role = await RoleModel.findByRoleId(roleId);
|
||||
|
||||
let { attr: roleAttrs = [] } = role;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user