koishi-plugin-ggcevo-game 1.6.38 → 1.6.40
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.js +22 -5
- package/lib/utils.d.ts +8 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -6295,7 +6295,7 @@ var GUESSING_ITEMS = [
|
|
|
6295
6295
|
{
|
|
6296
6296
|
id: 1,
|
|
6297
6297
|
description: "猜测下一个复活主宰的名字",
|
|
6298
|
-
odds: 9
|
|
6298
|
+
odds: 9,
|
|
6299
6299
|
minBet: 10,
|
|
6300
6300
|
status: "open"
|
|
6301
6301
|
}
|
|
@@ -6313,6 +6313,17 @@ function fixedCurfewCheck(session, config) {
|
|
|
6313
6313
|
return true;
|
|
6314
6314
|
}
|
|
6315
6315
|
__name(fixedCurfewCheck, "fixedCurfewCheck");
|
|
6316
|
+
function privateChatCurfewCheck(session, config) {
|
|
6317
|
+
if (!config.enableCurfew || !session.isDirect) return true;
|
|
6318
|
+
const now = /* @__PURE__ */ new Date();
|
|
6319
|
+
const hours = now.getUTCHours() + 8;
|
|
6320
|
+
const currentHour = hours >= 24 ? hours - 24 : hours;
|
|
6321
|
+
if (currentHour < 18) {
|
|
6322
|
+
return false;
|
|
6323
|
+
}
|
|
6324
|
+
return true;
|
|
6325
|
+
}
|
|
6326
|
+
__name(privateChatCurfewCheck, "privateChatCurfewCheck");
|
|
6316
6327
|
|
|
6317
6328
|
// src/boss/damagecalculation.ts
|
|
6318
6329
|
async function calculateTotalDamage(ctx, session, config, equippedWeapon, targetBoss, careerData) {
|
|
@@ -7679,7 +7690,7 @@ function apply(ctx, config) {
|
|
|
7679
7690
|
);
|
|
7680
7691
|
const winMessages = [];
|
|
7681
7692
|
for (const winner of winners) {
|
|
7682
|
-
const prize = Math.floor(winner.amount * 9
|
|
7693
|
+
const prize = Math.floor(winner.amount * 9);
|
|
7683
7694
|
const [signInfo] = await ctx.database.get("ggcevo_sign", {
|
|
7684
7695
|
handle: winner.handle
|
|
7685
7696
|
});
|
|
@@ -8040,7 +8051,7 @@ ${itemDetails.join("\n")}`;
|
|
|
8040
8051
|
else if (monthlyDays === 28) baseTickets = 7;
|
|
8041
8052
|
else baseTickets = 3;
|
|
8042
8053
|
} else {
|
|
8043
|
-
messages.push("⚠️ 未检测到最近3
|
|
8054
|
+
messages.push("⚠️ 未检测到最近3天游戏记录:无法获得咕咕币");
|
|
8044
8055
|
}
|
|
8045
8056
|
const basePoints = getRandomInt(50, 100);
|
|
8046
8057
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
@@ -10104,8 +10115,14 @@ ${discountDetails.join("\n")}`;
|
|
|
10104
10115
|
const session = argv.session;
|
|
10105
10116
|
let bossEventBroadcast = null;
|
|
10106
10117
|
let cleanerRewardBroadcast = null;
|
|
10107
|
-
const
|
|
10108
|
-
if (!
|
|
10118
|
+
const isDirect = session.isDirect;
|
|
10119
|
+
if (!isDirect) {
|
|
10120
|
+
const Curfew = fixedCurfewCheck(session, config);
|
|
10121
|
+
if (!Curfew) return "⛔ 宵禁时段 (18:00-24:00) 禁止在群聊中使用咕咕之战指令。\n请添加C.O.R.E为好友使用私聊指令,好友验证信息为【咕咕之战】。";
|
|
10122
|
+
} else {
|
|
10123
|
+
const Curfew = privateChatCurfewCheck(session, config);
|
|
10124
|
+
if (!Curfew) return "⛔ 非宵禁时段 (0:00-18:00) 禁止在私聊中使用攻击指令。";
|
|
10125
|
+
}
|
|
10109
10126
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
10110
10127
|
if (!profile) return "🔒 需要先绑定游戏句柄。";
|
|
10111
10128
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
package/lib/utils.d.ts
CHANGED
|
@@ -42,3 +42,11 @@ export declare const GUESSING_ITEMS: {
|
|
|
42
42
|
status: string;
|
|
43
43
|
}[];
|
|
44
44
|
export declare function fixedCurfewCheck(session: any, config: Config): true | false;
|
|
45
|
+
/**
|
|
46
|
+
* 私聊宵禁检查函数
|
|
47
|
+
* 在非固定宵禁时段(18:00-24:00之外)禁止私聊
|
|
48
|
+
* @param session 会话对象
|
|
49
|
+
* @param config 配置对象
|
|
50
|
+
* @returns 是否允许私聊
|
|
51
|
+
*/
|
|
52
|
+
export declare function privateChatCurfewCheck(session: any, config: Config): boolean;
|