koishi-plugin-ggcevo-game 1.6.36 → 1.6.37
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/boss/attackhandling.d.ts +1 -0
- package/lib/index.js +72 -43
- package/package.json +1 -1
|
@@ -59,4 +59,5 @@ export declare function createNestlingBosses(ctx: any, nestlingNames: string | s
|
|
|
59
59
|
export declare function verifyFinalBlow(ctx: any, session: any, bossName: string, targetBoss: any): Promise<{
|
|
60
60
|
success: boolean;
|
|
61
61
|
updatedBoss?: any;
|
|
62
|
+
verificationPassed?: boolean;
|
|
62
63
|
}>;
|
package/lib/index.js
CHANGED
|
@@ -760,7 +760,7 @@ var spaceStationCrewConfig = [
|
|
|
760
760
|
professionName: "警卫长",
|
|
761
761
|
effect: "攻击伤害+5%,当有异形被击败时获得金币(击败者获得双倍金币)",
|
|
762
762
|
requirements: "当期伤害榜累计攻击4次及以上",
|
|
763
|
-
Jobtransfer:
|
|
763
|
+
Jobtransfer: false,
|
|
764
764
|
costcoins: 3e3
|
|
765
765
|
},
|
|
766
766
|
{
|
|
@@ -5471,6 +5471,15 @@ var ggcevoUpdates = [
|
|
|
5471
5471
|
- 增加了签到验证机制(需近3日内玩过地图)
|
|
5472
5472
|
- 增加了宵禁机制(夜间18:00-24:00将无法在群聊中使用咕咕之战功能,可私聊使用)
|
|
5473
5473
|
`.trim()
|
|
5474
|
+
},
|
|
5475
|
+
{
|
|
5476
|
+
version: "1.6.37",
|
|
5477
|
+
time: "2025-07-17",
|
|
5478
|
+
content: `
|
|
5479
|
+
- 修改了签到验证机制(近3日内游玩地图的才能获得咕咕币)
|
|
5480
|
+
- 新增了斩杀机制,当触发斩杀机制后,攻击周期变为6小时(0点、6点、12点或18点)
|
|
5481
|
+
- 暂时关闭人类转职“警卫长”
|
|
5482
|
+
`.trim()
|
|
5474
5483
|
}
|
|
5475
5484
|
];
|
|
5476
5485
|
function compareVersions(a, b) {
|
|
@@ -7212,19 +7221,18 @@ async function verifyFinalBlow(ctx, session, bossName, targetBoss) {
|
|
|
7212
7221
|
const hasResurrectionSkill = forbiddenSkills.some(
|
|
7213
7222
|
(skill) => targetBoss.skills.includes(skill)
|
|
7214
7223
|
);
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
return { success: true, updatedBoss: targetBoss };
|
|
7224
|
+
if (!(isDominationBoss && isLowHealth && !hasResurrectionSkill)) {
|
|
7225
|
+
return {
|
|
7226
|
+
success: true,
|
|
7227
|
+
updatedBoss: targetBoss,
|
|
7228
|
+
verificationPassed: false
|
|
7229
|
+
};
|
|
7222
7230
|
}
|
|
7223
7231
|
const verificationCode = Array(6).fill(0).map(
|
|
7224
7232
|
() => Math.floor(Math.random() * 10)
|
|
7225
7233
|
).join("");
|
|
7226
7234
|
await session.send(
|
|
7227
|
-
`<quote id="${session.messageId}"/>⚠️ ${bossName}
|
|
7235
|
+
`<quote id="${session.messageId}"/>⚠️ ${bossName}进入斩杀阶段!每6小时周期(0点、6点、12点或18点)即可攻击一次,但需完成安全验证
|
|
7228
7236
|
请在30秒内输入验证码:【${verificationCode}】`
|
|
7229
7237
|
);
|
|
7230
7238
|
const userInput = (await session.prompt(3e4))?.trim();
|
|
@@ -7244,7 +7252,11 @@ async function verifyFinalBlow(ctx, session, bossName, targetBoss) {
|
|
|
7244
7252
|
await session.send(`✅ 验证通过!但${bossName}已被其他玩家消灭。`);
|
|
7245
7253
|
return { success: false };
|
|
7246
7254
|
}
|
|
7247
|
-
return {
|
|
7255
|
+
return {
|
|
7256
|
+
success: true,
|
|
7257
|
+
updatedBoss,
|
|
7258
|
+
verificationPassed: true
|
|
7259
|
+
};
|
|
7248
7260
|
}
|
|
7249
7261
|
__name(verifyFinalBlow, "verifyFinalBlow");
|
|
7250
7262
|
|
|
@@ -7992,6 +8004,7 @@ ${itemDetails.join("\n")}`;
|
|
|
7992
8004
|
return `您今天已经签到过了!本月累计签到${record.monthlyDays}天。`;
|
|
7993
8005
|
}
|
|
7994
8006
|
}
|
|
8007
|
+
let hasRecentPlay = false;
|
|
7995
8008
|
const threeDaysAgo = new Date(now.getTime() - 3 * 24 * 60 * 60 * 1e3);
|
|
7996
8009
|
try {
|
|
7997
8010
|
const requestOptions = config.proxyAgent ? { proxyAgent: config.proxyAgent } : void 0;
|
|
@@ -7999,16 +8012,13 @@ ${itemDetails.join("\n")}`;
|
|
|
7999
8012
|
`https://api.sc2arcade.com/profiles/${regionId}/${realmId}/${profileId}/matches?orderDirection=desc`,
|
|
8000
8013
|
requestOptions
|
|
8001
8014
|
);
|
|
8002
|
-
|
|
8015
|
+
hasRecentPlay = matchData.results.some((match) => {
|
|
8003
8016
|
const matchDate = new Date(match.date);
|
|
8004
8017
|
return matchDate >= threeDaysAgo;
|
|
8005
8018
|
});
|
|
8006
|
-
if (!hasRecentPlay) {
|
|
8007
|
-
return "🚫 需要最近3天内游玩过至少1次游戏才能签到。";
|
|
8008
|
-
}
|
|
8009
8019
|
} catch (apiError) {
|
|
8010
8020
|
console.error("游戏记录API请求失败:", apiError);
|
|
8011
|
-
|
|
8021
|
+
hasRecentPlay = false;
|
|
8012
8022
|
}
|
|
8013
8023
|
let monthlyDays = 1;
|
|
8014
8024
|
if (record) {
|
|
@@ -8022,12 +8032,16 @@ ${itemDetails.join("\n")}`;
|
|
|
8022
8032
|
const messages = [];
|
|
8023
8033
|
let totalBonus = 0;
|
|
8024
8034
|
let baseTickets = 0;
|
|
8025
|
-
if (
|
|
8026
|
-
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8035
|
+
if (hasRecentPlay) {
|
|
8036
|
+
if (monthlyDays < 7) baseTickets = 3;
|
|
8037
|
+
else if (monthlyDays === 7) baseTickets = 4;
|
|
8038
|
+
else if (monthlyDays === 14) baseTickets = 5;
|
|
8039
|
+
else if (monthlyDays === 21) baseTickets = 6;
|
|
8040
|
+
else if (monthlyDays === 28) baseTickets = 7;
|
|
8041
|
+
else baseTickets = 3;
|
|
8042
|
+
} else {
|
|
8043
|
+
messages.push("⚠️ 未检测到最近3天游戏记录:不获得咕咕币");
|
|
8044
|
+
}
|
|
8031
8045
|
const basePoints = getRandomInt(50, 100);
|
|
8032
8046
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
8033
8047
|
let tech5Bonus = 0;
|
|
@@ -8036,7 +8050,6 @@ ${itemDetails.join("\n")}`;
|
|
|
8036
8050
|
handle,
|
|
8037
8051
|
techId: 5,
|
|
8038
8052
|
level: 5
|
|
8039
|
-
// 只获取5级科技
|
|
8040
8053
|
});
|
|
8041
8054
|
if (tech5Data) {
|
|
8042
8055
|
tech5Bonus = 1;
|
|
@@ -8086,11 +8099,13 @@ ${itemDetails.join("\n")}`;
|
|
|
8086
8099
|
monthlyDays,
|
|
8087
8100
|
totalRewards: (record?.totalRewards || 0) + finalPoints
|
|
8088
8101
|
}]);
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8102
|
+
if (finalTickets > 0) {
|
|
8103
|
+
await ctx.database.upsert("ggcevo_backpack", [{
|
|
8104
|
+
handle,
|
|
8105
|
+
itemId: 1,
|
|
8106
|
+
quantity: (backpack?.quantity || 0) + finalTickets
|
|
8107
|
+
}]);
|
|
8108
|
+
}
|
|
8094
8109
|
if (redCrystal > 0) {
|
|
8095
8110
|
await ctx.database.upsert("ggcevo_careers", [{
|
|
8096
8111
|
handle,
|
|
@@ -8108,9 +8123,13 @@ ${itemDetails.join("\n")}`;
|
|
|
8108
8123
|
if (totalBonus > 0 || multiplier > 1) {
|
|
8109
8124
|
coinMessage += ` (基础值:${basePoints}金币)`;
|
|
8110
8125
|
}
|
|
8111
|
-
let ticketMessage =
|
|
8112
|
-
if (
|
|
8113
|
-
ticketMessage
|
|
8126
|
+
let ticketMessage = "";
|
|
8127
|
+
if (finalTickets > 0) {
|
|
8128
|
+
ticketMessage = `🪙 咕咕币 x ${finalTickets}`;
|
|
8129
|
+
if (multiplier > 1) {
|
|
8130
|
+
ticketMessage += ` (基础值:${baseTickets}枚)`;
|
|
8131
|
+
}
|
|
8132
|
+
ticketMessage += "\n";
|
|
8114
8133
|
}
|
|
8115
8134
|
return `签到成功!本月累计签到${monthlyDays}天,获得:
|
|
8116
8135
|
${coinMessage}
|
|
@@ -10086,19 +10105,6 @@ ${discountDetails.join("\n")}`;
|
|
|
10086
10105
|
return `当前没有找到名为 ${bossName} 的可攻击目标。
|
|
10087
10106
|
请攻击当前存活的异形:${activeNames || "无"}。`;
|
|
10088
10107
|
}
|
|
10089
|
-
const unlimitedBossAttack = config.unlimitedBossAttack;
|
|
10090
|
-
if (!unlimitedBossAttack) {
|
|
10091
|
-
const lastAttack = await ctx.database.get("ggcevo_boss_damage", { handle });
|
|
10092
|
-
if (lastAttack.length > 0) {
|
|
10093
|
-
const lastDate = convertUTCtoChinaTime(new Date(lastAttack[0].lastattackDate));
|
|
10094
|
-
const today = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
|
|
10095
|
-
if (isSameHalfDay(lastDate, today)) {
|
|
10096
|
-
return "您在当前时段内已经攻击过了,请在12点或0点后再来挑战!";
|
|
10097
|
-
}
|
|
10098
|
-
}
|
|
10099
|
-
}
|
|
10100
|
-
const [equippedWeapon] = await ctx.database.get("ggcevo_weapons", { handle, equipped: true });
|
|
10101
|
-
if (!equippedWeapon) return '请先输入"装备 武器名称"后再攻击。';
|
|
10102
10108
|
const verification = await verifyFinalBlow(
|
|
10103
10109
|
ctx,
|
|
10104
10110
|
session,
|
|
@@ -10110,6 +10116,29 @@ ${discountDetails.join("\n")}`;
|
|
|
10110
10116
|
return "攻击已取消";
|
|
10111
10117
|
}
|
|
10112
10118
|
const verifiedBoss = verification.updatedBoss || targetBoss;
|
|
10119
|
+
const unlimitedBossAttack = config.unlimitedBossAttack;
|
|
10120
|
+
if (!unlimitedBossAttack) {
|
|
10121
|
+
const lastAttacks = await ctx.database.get("ggcevo_boss_damage", { handle });
|
|
10122
|
+
if (lastAttacks.length > 0) {
|
|
10123
|
+
const lastAttack = lastAttacks[0];
|
|
10124
|
+
const lastDate = convertUTCtoChinaTime(new Date(lastAttack.lastattackDate));
|
|
10125
|
+
const today = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
|
|
10126
|
+
if (verification.verificationPassed) {
|
|
10127
|
+
const lastQuarter = Math.floor(lastDate.getHours() / 6);
|
|
10128
|
+
const currentQuarter = Math.floor(today.getHours() / 6);
|
|
10129
|
+
const sameDay = lastDate.getDate() === today.getDate() && lastDate.getMonth() === today.getMonth() && lastDate.getFullYear() === today.getFullYear();
|
|
10130
|
+
if (sameDay && lastQuarter === currentQuarter) {
|
|
10131
|
+
return "您在当前时间段内已参与过斩杀攻击,请等待下一个6小时周期(0点、6点、12点或18点)再挑战!";
|
|
10132
|
+
}
|
|
10133
|
+
} else {
|
|
10134
|
+
if (isSameHalfDay(lastDate, today)) {
|
|
10135
|
+
return "您在当前时段内已经攻击过了,请在12点或0点后再来挑战!";
|
|
10136
|
+
}
|
|
10137
|
+
}
|
|
10138
|
+
}
|
|
10139
|
+
}
|
|
10140
|
+
const [equippedWeapon] = await ctx.database.get("ggcevo_weapons", { handle, equipped: true });
|
|
10141
|
+
if (!equippedWeapon) return '请先输入"装备 武器名称"后再攻击。';
|
|
10113
10142
|
const weaponConfigEntry = Object.entries(weaponConfig).find(([_, c]) => c.id === equippedWeapon.weaponId);
|
|
10114
10143
|
const [weaponName, weaponData] = weaponConfigEntry;
|
|
10115
10144
|
if (!weaponData.isantiair && (verifiedBoss.groupId === 5 || verifiedBoss.groupId === 10)) {
|