diff --git a/configs/draw_cfg.json b/configs/draw_cfg.json index 012e4b3..1a46f85 100644 --- a/configs/draw_cfg.json +++ b/configs/draw_cfg.json @@ -4,7 +4,7 @@ "type": 1, "name": "WhiteList", "amount": 1, - "probability": 100 + "probability": 50 }, { "position": 2, @@ -35,7 +35,7 @@ "type": 2, "name": "NFT", "amount": 1, - "probability": 100 + "probability": 50 }, { "position": 7, diff --git a/initdatas/activity_info.json b/initdatas/activity_info.json index 889eea0..2662338 100644 --- a/initdatas/activity_info.json +++ b/initdatas/activity_info.json @@ -419,6 +419,38 @@ "end": "2025-01-01 00:00", "checkChain": false, "params": { "time": 6, "failRate": 0 } + }, + { + "id": "g3f4f63mp73a6gsq5rr", + "task": "TwitterRetweet", + "title": "RT - Dragonscale Gameplay", + "type": 1, + "desc": "Retweet specific tweets", + "category": "Social Tasks", + "score": 50, + "autoclaim": false, + "pretasks": ["e2yhq2lj30vwcpedv7p"], + "cfg": { "icon": "twitter", "content": "1791452561419161827"}, + "start": "2024-01-01 00:00", + "end": "2025-01-01 00:00", + "checkChain": false, + "params": { "time": 6, "failRate": 0 } + }, + { + "id": "g3knsuk7c9g45npftvw", + "task": "TwitterLike", + "title": "Like - Dragonscale Gameplay", + "type": 1, + "desc": "Like specific tweets", + "category": "Social Tasks", + "score": 50, + "autoclaim": false, + "pretasks": ["e2yhq2lj30vwcpedv7p"], + "cfg": { "icon": "twitter", "content": "1791452561419161827"}, + "start": "2024-01-01 00:00", + "end": "2025-01-01 00:00", + "checkChain": false, + "params": { "time": 6, "failRate": 0 } } ], "drawTime": 1715245160457, diff --git a/src/controllers/admin.controller.ts b/src/controllers/admin.controller.ts index 3fd1ba1..55cd005 100644 --- a/src/controllers/admin.controller.ts +++ b/src/controllers/admin.controller.ts @@ -168,7 +168,7 @@ class AdminController extends BaseController { code: user.inviteCode, mapopen: gameRecord.status, enhanceCount, - inWhiteList: user.inWhiteList ? 1 : 0, + inWhiteList: user.whiteListNum || 0, googleId: user.googleId, googleMail: user.googleEmail, gameScore: ingameStat.score, diff --git a/src/controllers/chest.controller.ts b/src/controllers/chest.controller.ts index b0cef90..e2f516f 100644 --- a/src/controllers/chest.controller.ts +++ b/src/controllers/chest.controller.ts @@ -349,8 +349,7 @@ class BoxController extends BaseController { chest.items.push(item) }) if (items.find(item => item.type === 1)) { - user.inWhiteList = true - await user.save() + await ActivityUser.updateOne({ _id: user.id }, { inWhiteList: true, $inc: { whiteListNum: 1 } }) } await updateRankScore({ diff --git a/src/controllers/ingame.controller.ts b/src/controllers/ingame.controller.ts index 84f3db7..78bf0ed 100644 --- a/src/controllers/ingame.controller.ts +++ b/src/controllers/ingame.controller.ts @@ -207,8 +207,7 @@ class InGameController extends BaseController { items.push(reward) record.items = [reward] if (reward.type === 1) { - user.inWhiteList = true - await user.save() + await ActivityUser.updateOne({ _id: user.id }, { inWhiteList: true, $inc: { whiteListNum: 1 } }) } } await record.save() diff --git a/src/controllers/sign.controller.ts b/src/controllers/sign.controller.ts index bbf18c6..f78d17a 100644 --- a/src/controllers/sign.controller.ts +++ b/src/controllers/sign.controller.ts @@ -162,7 +162,7 @@ class SignController extends BaseController { code: user.inviteCode, mapopen: gameRecord.status, enhanceCount, - inWhiteList: user.inWhiteList ? 1 : 0, + inWhiteList: user.whiteListNum || 0, googleId: user.googleId, googleMail: user.googleEmail, gameScore: ingameStat.score, diff --git a/src/models/ActivityUser.ts b/src/models/ActivityUser.ts index 56ffd3a..d5554cc 100644 --- a/src/models/ActivityUser.ts +++ b/src/models/ActivityUser.ts @@ -128,6 +128,9 @@ export class ActivityUserClass extends BaseModule { @prop({ default: false }) public inWhiteList: boolean + @prop({ default: 0 }) + public whiteListNum: number + @prop({ default: 1 }) public boost: number /** diff --git a/src/services/game.svr.ts b/src/services/game.svr.ts index 16ace6e..af063d8 100644 --- a/src/services/game.svr.ts +++ b/src/services/game.svr.ts @@ -107,7 +107,7 @@ export const generateChestBonus = async (chest: DocumentType for (let i = 0; i < chestBonusItems.length; i++) { let item = chestBonusItems[i] if (Math.random() < item.probability / 100) { - if (item.type === 1 && hasWhite) { + if (item.type === 1) { continue } bonusItem = item