json:配置提交
This commit is contained in:
parent
c52f9b4b9a
commit
12f768d887
@ -30,7 +30,7 @@
|
||||
"tips":"单日获取黄旗兑换达到10000"
|
||||
},
|
||||
{
|
||||
"key": "event/huangqijiuguan/ZhaoMu",
|
||||
"key": "huangqijiuguan/ZhaoMu",
|
||||
"limit": 1000,
|
||||
"tips": "单日获取黄旗招募超过1000抽"
|
||||
},
|
||||
|
@ -20,6 +20,9 @@ import { addGameLog } from "../gameLog";
|
||||
import { PushGiftFun } from "./pushgift";
|
||||
import { ActionLog } from './actionLog/actionLog';
|
||||
import HeroSkinFun from './heroskin';
|
||||
import { roleDataType } from '../shared/fightControl/fightType';
|
||||
import { PlayerShared } from '../shared/public/player';
|
||||
|
||||
|
||||
export type call = {
|
||||
get otherBuff(): otherBuff;
|
||||
@ -41,6 +44,41 @@ export type call = {
|
||||
};
|
||||
|
||||
export class PlayerFun {
|
||||
/**
|
||||
* 通过uid获取战斗数据
|
||||
* @param uid
|
||||
* @returns
|
||||
*/
|
||||
static async getDefaultFightDataByUid(uid:string){
|
||||
let gud = await getGud(uid);
|
||||
let posObj = gud.heroPos;
|
||||
let roles: k_v<roleDataType> = {};
|
||||
if (gud.selectMatrix && gud.matrixPos) {
|
||||
posObj = gud.matrixPos[gud.selectMatrix];
|
||||
}
|
||||
let heros = await HeroFun.getHeros({uid:uid}, Object.values(posObj).filter(_id => _id != '') as string[]);
|
||||
let otherBuff = UserFun.getOtherBuff(gud)
|
||||
|
||||
Object.entries(posObj).forEach(obj => {
|
||||
let pos = obj[0];
|
||||
let _id = obj[1];
|
||||
let hero = heros.filter(h => h._id == _id)[0];
|
||||
|
||||
if (hero) {
|
||||
roles[pos] = {
|
||||
...hero,
|
||||
attr: {
|
||||
...HeroShared.getHeroBasicAttr(hero, { ...otherBuff, allBuff: HeroShared.getAllBuff(heros) }, Number(pos))
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
player: { ...gud, buff: PlayerShared.getBuff(gud) },
|
||||
roles: roles
|
||||
};
|
||||
}
|
||||
/**
|
||||
* 获取玩家atn数量
|
||||
*/
|
||||
@ -195,6 +233,11 @@ export class PlayerFun {
|
||||
ActionLog.addDayLog(call.conn.uid, { key: 'got_' + atn.t, val: atn.n });
|
||||
}
|
||||
|
||||
if (["huangqijinbi", "huangqiduihuan"].includes(atn.t) && atn.n > 0) {
|
||||
//统计今日获取的黄旗金币和黄旗对换币
|
||||
ActionLog.addDayLog(call.conn.uid, { key: 'got_' + atn.t, val: atn.n });
|
||||
}
|
||||
|
||||
// 增加vip经验的任务监听
|
||||
if (atn.t == "payExp" && atn.n > 0) {
|
||||
G.emit("Class_task_157", 'Class_task_157', call, atn.n, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user