koishi-plugin-ggcevo-game 1.6.42 → 1.6.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -0
- package/lib/index.js +38 -25
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export interface Config {
|
|
|
18
18
|
pointBonusEnabled: boolean;
|
|
19
19
|
enableViolationAlert: boolean;
|
|
20
20
|
enableCurfew: boolean;
|
|
21
|
+
enablePlayRequirement: boolean;
|
|
21
22
|
}
|
|
22
23
|
export declare const Config: Schema<Config>;
|
|
23
24
|
export declare function apply(ctx: Context, config: Config): void;
|
package/lib/index.js
CHANGED
|
@@ -825,7 +825,7 @@ var syndicatePirateConfig = [
|
|
|
825
825
|
professionName: "清洁工",
|
|
826
826
|
effect: "每次攻击额外获得1枚红晶,每造成100伤害额外获得1枚红晶(至多额外获得3枚)",
|
|
827
827
|
requirements: "当期伤害榜累计攻击4次及以上",
|
|
828
|
-
Jobtransfer:
|
|
828
|
+
Jobtransfer: false,
|
|
829
829
|
costredcrystal: 20
|
|
830
830
|
},
|
|
831
831
|
{
|
|
@@ -5480,6 +5480,14 @@ var ggcevoUpdates = [
|
|
|
5480
5480
|
- 新增了斩杀机制,当触发斩杀机制后,攻击周期变为6小时(0点、6点、12点或18点)
|
|
5481
5481
|
- 暂时关闭人类转职“警卫长”
|
|
5482
5482
|
`.trim()
|
|
5483
|
+
},
|
|
5484
|
+
{
|
|
5485
|
+
version: "1.6.43",
|
|
5486
|
+
time: "2025-07-19",
|
|
5487
|
+
content: `
|
|
5488
|
+
- 暂时关闭辛迪加海盗转职“清洁工”
|
|
5489
|
+
- 关闭了签到验证机制
|
|
5490
|
+
`.trim()
|
|
5483
5491
|
}
|
|
5484
5492
|
];
|
|
5485
5493
|
function compareVersions(a, b) {
|
|
@@ -7341,6 +7349,7 @@ var Config = import_koishi.Schema.intersect([
|
|
|
7341
7349
|
// 基础配置组
|
|
7342
7350
|
import_koishi.Schema.object({
|
|
7343
7351
|
proxyAgent: import_koishi.Schema.string().description("代理服务器地址"),
|
|
7352
|
+
enablePlayRequirement: import_koishi.Schema.boolean().description("开启签到需3天游戏记录(关闭时无限制)").default(false),
|
|
7344
7353
|
enableCurfew: import_koishi.Schema.boolean().description("是否开启宵禁模式(18:00-24:00禁止群聊指令)").default(false)
|
|
7345
7354
|
}).description("基础设置"),
|
|
7346
7355
|
// 赛季与兑换配置组
|
|
@@ -8003,6 +8012,7 @@ ${itemDetails.join("\n")}`;
|
|
|
8003
8012
|
if (!profile) return "🔒 需要先绑定游戏句柄。";
|
|
8004
8013
|
const { regionId, realmId, profileId } = profile;
|
|
8005
8014
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
8015
|
+
const config2 = ctx.config;
|
|
8006
8016
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
8007
8017
|
if (existingEntries.length > 0) return "⛔ 您已被列入黑名单。";
|
|
8008
8018
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -8015,21 +8025,28 @@ ${itemDetails.join("\n")}`;
|
|
|
8015
8025
|
return `您今天已经签到过了!本月累计签到${record.monthlyDays}天。`;
|
|
8016
8026
|
}
|
|
8017
8027
|
}
|
|
8018
|
-
let hasRecentPlay =
|
|
8019
|
-
const
|
|
8020
|
-
|
|
8021
|
-
const
|
|
8022
|
-
|
|
8023
|
-
|
|
8024
|
-
|
|
8025
|
-
|
|
8026
|
-
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8028
|
+
let hasRecentPlay = true;
|
|
8029
|
+
const messages = [];
|
|
8030
|
+
if (config2.enablePlayRequirement) {
|
|
8031
|
+
const threeDaysAgo = new Date(now.getTime() - 3 * 24 * 60 * 60 * 1e3);
|
|
8032
|
+
try {
|
|
8033
|
+
const requestOptions = config2.proxyAgent ? { proxyAgent: config2.proxyAgent } : void 0;
|
|
8034
|
+
const matchData = await ctx.http.get(
|
|
8035
|
+
`https://api.sc2arcade.com/profiles/${regionId}/${realmId}/${profileId}/matches?orderDirection=desc`,
|
|
8036
|
+
requestOptions
|
|
8037
|
+
);
|
|
8038
|
+
hasRecentPlay = matchData.results.some((match) => {
|
|
8039
|
+
const matchDate = new Date(match.date);
|
|
8040
|
+
return matchDate >= threeDaysAgo;
|
|
8041
|
+
});
|
|
8042
|
+
if (!hasRecentPlay) {
|
|
8043
|
+
messages.push("⚠️ 未检测到最近3天游戏记录:无法获得咕咕币");
|
|
8044
|
+
}
|
|
8045
|
+
} catch (apiError) {
|
|
8046
|
+
console.error("游戏记录API请求失败:", apiError);
|
|
8047
|
+
messages.push("⚠️ 游戏记录验证失败:无法获得咕咕币");
|
|
8048
|
+
hasRecentPlay = false;
|
|
8049
|
+
}
|
|
8033
8050
|
}
|
|
8034
8051
|
let monthlyDays = 1;
|
|
8035
8052
|
if (record) {
|
|
@@ -8040,18 +8057,15 @@ ${itemDetails.join("\n")}`;
|
|
|
8040
8057
|
monthlyDays = record.monthlyDays + 1;
|
|
8041
8058
|
}
|
|
8042
8059
|
}
|
|
8043
|
-
const messages = [];
|
|
8044
8060
|
let totalBonus = 0;
|
|
8045
8061
|
let baseTickets = 0;
|
|
8046
|
-
if (hasRecentPlay) {
|
|
8062
|
+
if (!config2.enablePlayRequirement || hasRecentPlay) {
|
|
8047
8063
|
if (monthlyDays < 7) baseTickets = 3;
|
|
8048
8064
|
else if (monthlyDays === 7) baseTickets = 4;
|
|
8049
8065
|
else if (monthlyDays === 14) baseTickets = 5;
|
|
8050
8066
|
else if (monthlyDays === 21) baseTickets = 6;
|
|
8051
8067
|
else if (monthlyDays === 28) baseTickets = 7;
|
|
8052
8068
|
else baseTickets = 3;
|
|
8053
|
-
} else {
|
|
8054
|
-
messages.push("⚠️ 未检测到最近3天游戏记录:无法获得咕咕币");
|
|
8055
8069
|
}
|
|
8056
8070
|
const basePoints = getRandomInt(50, 100);
|
|
8057
8071
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
@@ -8126,8 +8140,7 @@ ${itemDetails.join("\n")}`;
|
|
|
8126
8140
|
});
|
|
8127
8141
|
let effectMessage = "";
|
|
8128
8142
|
if (messages.length > 0) {
|
|
8129
|
-
effectMessage =
|
|
8130
|
-
⚡ 加成效果:
|
|
8143
|
+
effectMessage = `⚡ 加成效果:
|
|
8131
8144
|
▸ ${messages.join("\n▸ ")}`;
|
|
8132
8145
|
}
|
|
8133
8146
|
let coinMessage = `💰 金币 x ${finalPoints}`;
|
|
@@ -10158,9 +10171,9 @@ ${discountDetails.join("\n")}`;
|
|
|
10158
10171
|
const lastDate = convertUTCtoChinaTime(new Date(lastAttack.lastattackDate));
|
|
10159
10172
|
const today = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
|
|
10160
10173
|
if (verification.verificationPassed) {
|
|
10161
|
-
const lastQuarter = Math.floor(lastDate.
|
|
10162
|
-
const currentQuarter = Math.floor(today.
|
|
10163
|
-
const sameDay = lastDate.
|
|
10174
|
+
const lastQuarter = Math.floor(lastDate.getUTCHours() / 6);
|
|
10175
|
+
const currentQuarter = Math.floor(today.getUTCHours() / 6);
|
|
10176
|
+
const sameDay = lastDate.getUTCDate() === today.getUTCDate() && lastDate.getUTCMonth() === today.getUTCMonth() && lastDate.getUTCFullYear() === today.getUTCFullYear();
|
|
10164
10177
|
if (sameDay && lastQuarter === currentQuarter) {
|
|
10165
10178
|
return "您在当前时间段内已参与过斩杀攻击,请等待下一个6小时周期(0点、6点、12点或18点)再挑战!";
|
|
10166
10179
|
}
|