koishi-plugin-ggcevo-game 1.6.41 → 1.6.43
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 +43 -30
- 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) {
|
|
@@ -5822,7 +5830,7 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
|
|
|
5822
5830
|
if (itemConfig2.id === 9) {
|
|
5823
5831
|
if (!target) return {
|
|
5824
5832
|
success: false,
|
|
5825
|
-
message: "
|
|
5833
|
+
message: "使用燃烧弹需要指定目标。",
|
|
5826
5834
|
isDefeated: false
|
|
5827
5835
|
};
|
|
5828
5836
|
const [targetBoss] = await ctx.database.get("ggcevo_boss", {
|
|
@@ -5831,14 +5839,14 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
|
|
|
5831
5839
|
});
|
|
5832
5840
|
if (!targetBoss) return {
|
|
5833
5841
|
success: false,
|
|
5834
|
-
message: `目标「${target}
|
|
5842
|
+
message: `目标「${target}」未存活或不存在。`,
|
|
5835
5843
|
isDefeated: false
|
|
5836
5844
|
};
|
|
5837
5845
|
const aerialTargets = ["吸血蝙蝠首领", "吸血蝙蝠", "猛毒异兽", "剧毒蝙蝠"];
|
|
5838
5846
|
if (aerialTargets.includes(targetBoss.name)) {
|
|
5839
5847
|
return {
|
|
5840
5848
|
success: false,
|
|
5841
|
-
message: "
|
|
5849
|
+
message: "无法对空中目标使用。",
|
|
5842
5850
|
isDefeated: false
|
|
5843
5851
|
};
|
|
5844
5852
|
}
|
|
@@ -5848,7 +5856,7 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
|
|
|
5848
5856
|
);
|
|
5849
5857
|
if (isImmune) return {
|
|
5850
5858
|
success: false,
|
|
5851
|
-
message: `目标「${target}
|
|
5859
|
+
message: `目标「${target}」免疫燃烧效果。`,
|
|
5852
5860
|
isDefeated: false
|
|
5853
5861
|
};
|
|
5854
5862
|
const baseLayers = 5;
|
|
@@ -5883,7 +5891,7 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
|
|
|
5883
5891
|
if (itemConfig2.id === 10) {
|
|
5884
5892
|
if (!target) return {
|
|
5885
5893
|
success: false,
|
|
5886
|
-
message: "
|
|
5894
|
+
message: "使用铝热炸弹需要指定目标。",
|
|
5887
5895
|
isDefeated: false
|
|
5888
5896
|
};
|
|
5889
5897
|
const [targetBoss] = await ctx.database.get("ggcevo_boss", {
|
|
@@ -5892,14 +5900,14 @@ async function applyItemEffect(ctx, session, handle, itemConfig2, target) {
|
|
|
5892
5900
|
});
|
|
5893
5901
|
if (!targetBoss) return {
|
|
5894
5902
|
success: false,
|
|
5895
|
-
message: `目标「${target}
|
|
5903
|
+
message: `目标「${target}」未存活或不存在。`,
|
|
5896
5904
|
isDefeated: false
|
|
5897
5905
|
};
|
|
5898
5906
|
const aerialTargets = ["吸血蝙蝠首领", "吸血蝙蝠", "猛毒异兽", "剧毒蝙蝠"];
|
|
5899
5907
|
if (aerialTargets.includes(targetBoss.name)) {
|
|
5900
5908
|
return {
|
|
5901
5909
|
success: false,
|
|
5902
|
-
message: "
|
|
5910
|
+
message: "无法对空中目标使用。",
|
|
5903
5911
|
isDefeated: false
|
|
5904
5912
|
};
|
|
5905
5913
|
}
|
|
@@ -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}`;
|
|
@@ -12677,7 +12690,7 @@ ${validBossNames.join("、")}`;
|
|
|
12677
12690
|
'使用 "兑换资源 物品名称 数量" 进行兑换',
|
|
12678
12691
|
`您当前持有: ${coupon?.quantity || 0}张资源兑换券`,
|
|
12679
12692
|
"====================",
|
|
12680
|
-
...Object.entries(resourceItems).map(([itemName, config2]) => `▸ ${itemName}:1
|
|
12693
|
+
...Object.entries(resourceItems).map(([itemName, config2]) => `▸ ${itemName}:1张券兑换${config2.valuePerCoupon}${itemName === "金币" ? "金币" : "红晶"}`),
|
|
12681
12694
|
"====================",
|
|
12682
12695
|
'输入示例:"兑换资源 金币 5"(兑换500金币)'
|
|
12683
12696
|
].join("\n");
|