全局:属性修改

This commit is contained in:
luying
2021-02-27 15:35:16 +08:00
parent d4561c2e3d
commit 0966f025cf
35 changed files with 1186 additions and 1130 deletions

View File

@@ -2,8 +2,6 @@ import { Service } from 'egg';
import { addSkins, addBags, addEquips } from '@pubUtils/itemUtils';
import * as pubUtils from '@pubUtils/util';
import * as pubGamedata from '@pubUtils/gamedata'
import { HeroType } from '@db/Hero';
import { calPlayerCeAndSave } from '@pubUtils/playerCe';
import { BagInter, EquipInter } from '@pubUtils/interface';
const csprng = require('csprng');
@@ -47,10 +45,6 @@ export default class Utils extends Service {
return pubUtils.resResult(status, data, customMsg);
}
public calPlayerCeAndSave(roleId: string, heros: HeroType[], type: number, args: number[]) {
return calPlayerCeAndSave(roleId, heros, type, args)
}
public addSkins(roleId: string, id: number) {
return addSkins(roleId, id);
}

View File

@@ -24,7 +24,7 @@ import { STATUS, HERO_SYSTEM_TYPE } from '@consts';
import { ITID, COUNTER } from '@consts';
import { ItemModel } from '@db/Item';
import { gameData, getHeroExpByLv } from '@pubUtils/data';
import { calPlayerCeAndSave, calculatetopLineup, calEquipSeids } from '@pubUtils/playerCe';
import { calPlayerCeAndSave, calculatetopLineup, calEquipSeids, initRoleAtrr } from '@pubUtils/playerCe';
import { SchoolModel } from '@db/School';
import { CeAttrNumber } from '@domain/roleField/attribute';
import { smsModel } from '@db/Sms';
@@ -267,7 +267,7 @@ export default class GMUsers extends Service {
try {
for(let heroInfo of heroInfos) {
let hero = await HeroModel.createHero(heroInfo);
await calPlayerCeAndSave(heroInfo.roleId, [hero], HERO_SYSTEM_TYPE.INIT);
await calPlayerCeAndSave(HERO_SYSTEM_TYPE.INIT, heroInfo.roleId, hero, {});
}
return ctx.service.utils.resResult(STATUS.SUCCESS, { uids });
} catch(e) {
@@ -540,9 +540,9 @@ export default class GMUsers extends Service {
let hero = await HeroModel.findByHidAndRole(equip.hid, roleId);
let index = hero.ePlace.findIndex(cur => cur.id == equip.ePlaceId);
if (index < 0) continue;
hero.ePlace[index].equip = null;
let args = calEquipSeids(hero);
await calPlayerCeAndSave(roleId, [hero], HERO_SYSTEM_TYPE.EQUIP, args);
hero.ePlace[index].equip = null;
await calPlayerCeAndSave(HERO_SYSTEM_TYPE.EQUIP, roleId, hero, {}, null, args);
}
seqIds.push(seqId);
}
@@ -617,8 +617,7 @@ export default class GMUsers extends Service {
let hero = await HeroModel.findByHidAndRole(hid, roleId);
console.log(hid, roleId, !!hero);
if(!hero) continue;
hero.lv = hlv;
await calPlayerCeAndSave(roleId, [hero], HERO_SYSTEM_TYPE.LVUP, [hid]);
await calPlayerCeAndSave(HERO_SYSTEM_TYPE.LVUP, roleId, hero, {lv: hlv});
}
return ctx.service.utils.resResult(STATUS.SUCCESS);