From 8a10552203fcf6ed239bbbdc7b6eb65c7b710809 Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Wed, 20 Dec 2023 16:17:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=E5=9C=A3=E8=AF=9E=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E7=BA=A2=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/hongdian/fun.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api_s2c/hongdian/fun.ts b/src/api_s2c/hongdian/fun.ts index d173a22..d6b30ec 100644 --- a/src/api_s2c/hongdian/fun.ts +++ b/src/api_s2c/hongdian/fun.ts @@ -361,7 +361,10 @@ export class HuoDongHongDianFun { // 检测 htype 6 七日登录活动红点 ishd = await this.qiridengluHongDian(call, element) } - + if (element.htype == 8) { + // 检测 htype 8 圣诞活动红点 + ishd = await this.christmasHongDian(call, element) + } if (element.htype == 10) { // 检测 htype 10 破冰活动红点 ishd = await this.pobinglibao(call, element) From 16254610b035e5cc10ce5d69b830b4df41f06e6d Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Wed, 20 Dec 2023 16:25:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=E6=96=B0=E5=A2=9E=E5=9C=A3=E8=AF=9E?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=AF=8F=E6=97=A5=E6=B6=88=E8=80=97=E9=92=BB?= =?UTF-8?q?=E7=9F=B3=E4=BB=BB=E5=8A=A1=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/globalListener.ts | 2 ++ src/public/player.ts | 5 +++++ src/public/taskclass.ts | 11 ++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/globalListener.ts b/src/globalListener.ts index 594a3e3..648a0bf 100644 --- a/src/globalListener.ts +++ b/src/globalListener.ts @@ -144,6 +144,8 @@ export type gEventType = { Class_task_154: (eventname, call, val, chkVal) => void; /**每日任务宝箱领取 */ Class_task_155: (eventname, call, val, chkVal) => void; + /**每日钻石消耗 */ + Class_task_156: (eventname, call, val, chkVal) => void; }; export function addListener() { diff --git a/src/public/player.ts b/src/public/player.ts index 27d8ddc..c179fd7 100644 --- a/src/public/player.ts +++ b/src/public/player.ts @@ -172,6 +172,11 @@ export class PlayerFun { change[atn.t] = this.fixAttrLteZero(atn.t, await this.getAtnNum(call, atn) + atn.n); if (atn.t == 'rmbmoney') { this.changeAttrLog(call.conn.uid, change[atn.t], atn, call.conn.gud.rmbmoney) + // 扣除钻石时 + if (atn.n < 0) { + // 监听任务消耗任务 + G.emit("Class_task_156", 'Class_task_156', call, -atn.n, 0); + } } all.push(this.changeAttr(call.conn.uid, change)); all.push(this.upAttr(call, {...atn, n: change[atn.t]})); diff --git a/src/public/taskclass.ts b/src/public/taskclass.ts index 5266c85..332df27 100644 --- a/src/public/taskclass.ts +++ b/src/public/taskclass.ts @@ -772,7 +772,7 @@ export module manager { isinc = 1 async initVal(call: ApiCall, con) { - return 1; + return 0; } } // 第57个任务 领取每日任务最终宝箱 @@ -780,6 +780,15 @@ export module manager { stype = 155 isinc = 0 + async initVal(call: ApiCall, con) { + return 0; + } + } + // 第58个任务 每日钻石消耗 + export class Class_task_156 extends BaseClass { + stype = 156 + isinc = 1 + async initVal(call: ApiCall, con) { return 1; } From c22d471260e7f337a6a685006a7cd8ab138eab3e Mon Sep 17 00:00:00 2001 From: yushunrui <364203175@qq.com> Date: Wed, 20 Dec 2023 16:39:29 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=E6=96=B0=E5=A2=9E=E5=9C=A3=E8=AF=9E?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E7=AD=BE=E5=88=B0=E4=B9=9F=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E7=BB=8F=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/christmas/ApiQianDao.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/api_s2c/event/christmas/ApiQianDao.ts b/src/api_s2c/event/christmas/ApiQianDao.ts index 5eb2830..0dba7b9 100644 --- a/src/api_s2c/event/christmas/ApiQianDao.ts +++ b/src/api_s2c/event/christmas/ApiQianDao.ts @@ -19,17 +19,23 @@ export default async function (call: ApiCall) { _mydata.qiandao.push(i) _prize = _prize.concat(_con[i]) } - if (!_prize){ // 没有奖励可以领取 return call.error('', { code: -1, message: globalThis.lng.yangchengmubiao_2 }) } - - let _setData = {} + let _addVal = 0 + // 懒得喊后台和前端修改了,直接取prize里面的对应的经验字段去添加zhanling经验 + for (const p of _prize) { + // 战令经验 + if (p.t == "shengdanExp") { + _addVal += p.n + } + } + _mydata["val"] += _addVal + _setData["val"] = _mydata.val _setData["qiandao"] = _mydata.qiandao await Christmasfun.setMyData(call.uid, call.req.hdid, { $set: _setData }) - await PlayerFun.sendPrize(call, _prize); let changedata = { mydata: _mydata, prize: _prize} // 推送红点