task增加新的任务类型,154是圣诞小游戏挑战 155是每日任务最终宝箱奖励

This commit is contained in:
yushunrui 2023-12-18 15:29:48 +08:00
parent 89b75bbf2b
commit 25a8e15ed3
5 changed files with 35 additions and 0 deletions

View File

@ -26,6 +26,8 @@ export default async function (call: ApiCall<ReqGame, ResGame>) {
_setData["val"] = _mydata.val
_setData["game"] = _mydata["gamenum"]
await Christmasfun.setMyData(call.uid, call.req.hdid, { $set: _setData})
// 监听任务
G.emit("Class_task_154", 'Class_task_154', call, 1, 0);
let changedata = { mydata: _mydata}
// 推送红点
HongDianChange.sendChangeKey(call.uid, ['huodonghd']);

View File

@ -42,6 +42,12 @@ export default async function (call: ApiCall<ReqAllFinsh, ResAllFinsh>) {
// 设置数据
await TaskFun.setTask(call.uid, { type: _type, taskid: { $in: _finishTaks } }, { finish: 1 })
let prize = await PlayerFun.sendPrize(call, _prize)
// 是否是每日任务奖励最终宝箱
if (_type == 4 && 25 in _finishTaks){
// 监听任务
G.emit("Class_task_155", 'Class_task_155', call, 1, 0);
}
let data = {
finishtask: _finishTaks,

View File

@ -44,6 +44,11 @@ export default async function (call: ApiCall<ReqFinsh, ResFinsh>) {
}
// 设置数据
await TaskFun.setTask(call.uid, {taskid: taskid}, {finish: 1})
// 是否是每日任务奖励最终宝箱
if (_task["type"] == 4 && 25 == taskid){
// 监听任务
G.emit("Class_task_155", 'Class_task_155', call, 1, 0);
}
let _prize = await PlayerFun.sendPrize(call, _con["prize"])
_task["finish"] = 1

View File

@ -140,6 +140,10 @@ export type gEventType = {
Class_task_152: (eventname, call, val, chkVal) => void;
/**合成x次装备 */
Class_task_153: (eventname, call, val, chkVal) => void;
/**参与圣诞活动小游戏 */
Class_task_154: (eventname, call, val, chkVal) => void;
/**每日任务宝箱领取 */
Class_task_155: (eventname, call, val, chkVal) => void;
};
export function addListener() {

View File

@ -766,6 +766,24 @@ export module manager {
return call.conn.gud?.helpHeros?.length || 0;
}
}
// 第56个任务 完成圣诞活动小游戏
export class Class_task_154 extends BaseClass {
stype = 154
isinc = 1
async initVal(call: ApiCall, con) {
return 1;
}
}
// 第57个任务 领取每日任务最终宝箱
export class Class_task_155 extends BaseClass {
stype = 155
isinc = 0
async initVal(call: ApiCall, con) {
return 1;
}
}
}