武将:一键获得武将debug

This commit is contained in:
luying
2021-07-23 18:35:00 +08:00
parent 9a9569b2f5
commit 64944990f0
4 changed files with 1550 additions and 1534 deletions

View File

@@ -1,5 +1,5 @@
import { Application, BackendSession, ChannelService, HandlerService, } from 'pinus';
import { handleCost, addItems, unlockFigure, createHero } from '../../../services/rewardService';
import { handleCost, addItems, unlockFigure, createHeroes, createHero } from '../../../services/rewardService';
import { calPlayerCeAndSave, calAllHeroCe } from '../../../services/playerCeService';
import { resResult, deepCopy } from '../../../pubUtils/util';
import { STATUS } from '../../../consts/statusCode';
@@ -633,4 +633,38 @@ export class HeroHandler {
hero = await calPlayerCeAndSave(HERO_SYSTEM_TYPE.SKIN, sid, roleId, hero, { skins: newHeroSkins }, [id, lastSkinId]);
return resResult(STATUS.SUCCESS, { curHero: { hid: hero.hid, skins: hero.skins } });
}
// ! debug接口 一键全武将
public async debugGetAllHeroes(msg: { magicWord: string }, session: BackendSession) {
let roleId: string = session.get('roleId');
let roleName: string = session.get('roleName');
let sid: string = session.get('sid');
let serverId: number = session.get('serverId');
let funcs: number[] = session.get('funcs');
const { magicWord } = msg;
if (magicWord !== DEBUG_MAGIC_WORD) {
return resResult(STATUS.TOKEN_ERR);
}
let dicHero = gameData.hero;
if (!dicHero) return resResult(STATUS.HERO_NOT_FIND);
let heroes = await HeroModel.findByRole(roleId);
let heroInfos = [];
for (let [hid, dic] of dicHero) {
if(hid < 300 && dic.initialSkin > 0) {
let hasHero = heroes.findIndex(cur => cur.hid == hid);
if(hasHero == -1) {
heroInfos.push({
hid, star: 6, colorStar: 6, quality: 4
});
}
}
}
let resultHeroes = await createHeroes(roleId, roleName, sid, serverId, funcs, heroInfos);
return resResult(STATUS.SUCCESS, resultHeroes);
}
}

View File

@@ -96,30 +96,13 @@ export const ITEM_TABLE = {
}
const itid_array = [
{ id: 1, name: '短兵(神兵', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 2, name: '枪矛(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 3, name: '重兵(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 4, name: '弓弩(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 5, name: '奇门(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 6, name: '羽扇(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 7, name: '法器(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 8, name: '杖(神兵)', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 9, name: '头盔(冠冕)', table: 'equip', type: EQUIP_TYPE.CAP, equipJewel: JEWEL_TYPE.CAP },
{ id: 10, name: '头冠(冠冕)', table: 'equip', type: EQUIP_TYPE.CAP, equipJewel: JEWEL_TYPE.CAP },
{ id: 11, name: '头巾(冠冕)', table: 'equip', type: EQUIP_TYPE.CAP, equipJewel: JEWEL_TYPE.CAP },
{ id: 12, name: '重铠(宝甲)', table: 'equip', type: EQUIP_TYPE.CLOTHES, equipJewel: JEWEL_TYPE.CLOTHES },
{ id: 13, name: '皮甲(宝甲)', table: 'equip', type: EQUIP_TYPE.CLOTHES, equipJewel: JEWEL_TYPE.CLOTHES },
{ id: 14, name: '布衣(宝甲)', table: 'equip', type: EQUIP_TYPE.CLOTHES, equipJewel: JEWEL_TYPE.CLOTHES },
{ id: 15, name: '兵书(典籍)', table: 'equip', type: EQUIP_TYPE.BOOK, equipJewel: JEWEL_TYPE.BOOK },
{ id: 16, name: '杂记(典籍)', table: 'equip', type: EQUIP_TYPE.BOOK, equipJewel: JEWEL_TYPE.BOOK },
{ id: 17, name: '经典(典籍)', table: 'equip', type: EQUIP_TYPE.BOOK, equipJewel: JEWEL_TYPE.BOOK },
{ id: 18, name: '马(行具)', table: 'equip', type: EQUIP_TYPE.SHOES, equipJewel: JEWEL_TYPE.SHOES },
{ id: 19, name: '鞋(行具)', table: 'equip', type: EQUIP_TYPE.SHOES, equipJewel: JEWEL_TYPE.SHOES },
{ id: 20, name: '车(行具)', table: 'equip', type: EQUIP_TYPE.SHOES, equipJewel: JEWEL_TYPE.SHOES },
{ id: 21, name: '佩饰(礼器)', table: 'equip', type: EQUIP_TYPE.ACCESSORY, equipJewel: JEWEL_TYPE.ACCESSORY },
{ id: 22, name: '钟鼎(礼器)', table: 'equip', type: EQUIP_TYPE.ACCESSORY, equipJewel: JEWEL_TYPE.ACCESSORY },
{ id: 23, name: '印章(礼器)', table: 'equip', type: EQUIP_TYPE.ACCESSORY, equipJewel: JEWEL_TYPE.ACCESSORY },
{ id: 1, name: '神兵', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.WEAPON },
{ id: 2, name: '宝甲', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.CLOTHES },
{ id: 3, name: '冠冕', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.CAP },
{ id: 4, name: '行具', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.SHOES },
{ id: 5, name: '典籍', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.BOOK },
{ id: 6, name: '饰品', table: 'equip', type: EQUIP_TYPE.WEAPON, equipJewel: JEWEL_TYPE.ACCESSORY },
{ id: 24, name: '消耗品', table: 'item', type: CONSUME_TYPE.CONSUME },
{ id: 37, name: '消耗类物品(图纸类)', table: 'item', type: CONSUME_TYPE.CONSUME },

View File

@@ -535,7 +535,6 @@ export function calHeroJobAttr(originHero: HeroType, hero: HeroUpdate, addSeidLi
*/
export function calHeroWearSkinIncAttr(originHero: HeroType, wearSkinId: number, pullSkinId: number, addSeidList: number[], removeSeidList: number[], isInit: boolean = false) {
let { attr: heroAttrs } = originHero;
let addSkin = gameData.fashion.get(wearSkinId);
let delSkin = gameData.fashion.get(pullSkinId);

File diff suppressed because it is too large Load Diff