koishi-plugin-ggcevo-game 1.6.39 → 1.6.41
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 +23 -6
- package/lib/utils.d.ts +8 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -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) {
|
|
@@ -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}`;
|
|
@@ -12657,10 +12674,10 @@ ${validBossNames.join("、")}`;
|
|
|
12657
12674
|
});
|
|
12658
12675
|
return [
|
|
12659
12676
|
"💰 资源兑换商店 💰",
|
|
12660
|
-
'使用 "兑换资源 物品名称
|
|
12677
|
+
'使用 "兑换资源 物品名称 数量" 进行兑换',
|
|
12661
12678
|
`您当前持有: ${coupon?.quantity || 0}张资源兑换券`,
|
|
12662
12679
|
"====================",
|
|
12663
|
-
...Object.entries(resourceItems).map(([itemName, config2]) => `▸ ${itemName}:1
|
|
12680
|
+
...Object.entries(resourceItems).map(([itemName, config2]) => `▸ ${itemName}:1张资源兑换券兑换${config2.valuePerCoupon}${itemName === "金币" ? "金币" : "红晶"}`),
|
|
12664
12681
|
"====================",
|
|
12665
12682
|
'输入示例:"兑换资源 金币 5"(兑换500金币)'
|
|
12666
12683
|
].join("\n");
|
|
@@ -12789,7 +12806,7 @@ PK同玩家限战:1次/日
|
|
|
12789
12806
|
30 资源兑换券
|
|
12790
12807
|
3️⃣ 第3名:
|
|
12791
12808
|
25 资源兑换券
|
|
12792
|
-
|
|
12809
|
+
🏅 第4-10名:
|
|
12793
12810
|
20 资源兑换券
|
|
12794
12811
|
🎖 第11-20名:
|
|
12795
12812
|
15 资源兑换券
|
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;
|