koishi-plugin-ggcevo-game 1.2.64 → 1.2.65
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 +48 -37
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -369,7 +369,7 @@ function apply(ctx, config) {
|
|
|
369
369
|
"弧焊枪": {
|
|
370
370
|
id: 9,
|
|
371
371
|
type: "能量武器",
|
|
372
|
-
damage:
|
|
372
|
+
damage: 25,
|
|
373
373
|
description: "一种经过改造的电动工具,可对近距离的目标放出高压电",
|
|
374
374
|
price: 750,
|
|
375
375
|
tagEffects: {
|
|
@@ -528,7 +528,7 @@ function apply(ctx, config) {
|
|
|
528
528
|
},
|
|
529
529
|
"结构装甲": {
|
|
530
530
|
effect: 0,
|
|
531
|
-
description: "拥有结构装甲,受到的伤害-20
|
|
531
|
+
description: "拥有结构装甲,受到的伤害-20%;若伤害来源于热能武器,则受到的伤害-40%"
|
|
532
532
|
}
|
|
533
533
|
};
|
|
534
534
|
const bossPool = [
|
|
@@ -708,8 +708,8 @@ function apply(ctx, config) {
|
|
|
708
708
|
const syndicatePirateConfig = [
|
|
709
709
|
{
|
|
710
710
|
professionName: "能量武器专家",
|
|
711
|
-
effect: "能量武器攻击伤害+15
|
|
712
|
-
requirements: "拥有一把武器等级为
|
|
711
|
+
effect: "能量武器攻击伤害+15%,解锁传奇激光购买权限",
|
|
712
|
+
requirements: "拥有一把武器等级为3的能量武器",
|
|
713
713
|
Jobtransfer: true,
|
|
714
714
|
costcoins: 0,
|
|
715
715
|
costredcrystal: 20
|
|
@@ -1118,10 +1118,10 @@ function apply(ctx, config) {
|
|
|
1118
1118
|
__name(activateNextBossGroup, "activateNextBossGroup");
|
|
1119
1119
|
ctx.setInterval(async () => {
|
|
1120
1120
|
const totalBosses = await ctx.database.select("ggcevo_boss").execute((row) => import_koishi.$.count(row.name));
|
|
1121
|
-
const
|
|
1121
|
+
const groupId = [...config.groupId];
|
|
1122
1122
|
if (totalBosses === 0) {
|
|
1123
1123
|
await activateNextBossGroup();
|
|
1124
|
-
await ctx.broadcast(
|
|
1124
|
+
await ctx.broadcast(groupId, `🔄 咕咕PVE系统已初始化,首个主宰已登场!`);
|
|
1125
1125
|
return;
|
|
1126
1126
|
}
|
|
1127
1127
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -1135,8 +1135,8 @@ function apply(ctx, config) {
|
|
|
1135
1135
|
groupId: group.groupId
|
|
1136
1136
|
});
|
|
1137
1137
|
await activateNextBossGroup(group.groupId);
|
|
1138
|
-
const
|
|
1139
|
-
await ctx.broadcast(
|
|
1138
|
+
const groupId2 = [...config.groupId];
|
|
1139
|
+
await ctx.broadcast(groupId2, `🔄 新的主宰已刷新,快去挑战吧!`);
|
|
1140
1140
|
}
|
|
1141
1141
|
}, 60 * 1e3);
|
|
1142
1142
|
const PassiveHandler = {
|
|
@@ -1383,9 +1383,9 @@ function apply(ctx, config) {
|
|
|
1383
1383
|
}
|
|
1384
1384
|
let reduction = 0.2;
|
|
1385
1385
|
let msg = "常规减伤20%";
|
|
1386
|
-
if (weaponData.type === "
|
|
1386
|
+
if (weaponData.type === "热能武器") {
|
|
1387
1387
|
reduction = 0.4;
|
|
1388
|
-
msg = "
|
|
1388
|
+
msg = "热能武器减伤40%";
|
|
1389
1389
|
}
|
|
1390
1390
|
const newDamage = Math.floor(initialDamage * (1 - reduction));
|
|
1391
1391
|
return {
|
|
@@ -1687,11 +1687,11 @@ function apply(ctx, config) {
|
|
|
1687
1687
|
case "能量武器专家":
|
|
1688
1688
|
const weapons = await ctx2.database.get("ggcevo_equipment", {
|
|
1689
1689
|
handle,
|
|
1690
|
-
level: { $gte:
|
|
1690
|
+
level: { $gte: 3 }
|
|
1691
1691
|
});
|
|
1692
1692
|
const hasEnergyWeapon = weapons.some((weapon) => {
|
|
1693
1693
|
const weaponConfigEntry = Object.values(weaponConfig).find((c) => c.id === weapon.weaponId);
|
|
1694
|
-
return weaponConfigEntry?.type === "
|
|
1694
|
+
return weaponConfigEntry?.type === "能量武器";
|
|
1695
1695
|
});
|
|
1696
1696
|
return {
|
|
1697
1697
|
success: hasEnergyWeapon,
|
|
@@ -2602,33 +2602,44 @@ ${itemDetails.join("\n")}`;
|
|
|
2602
2602
|
if (!handle || !itemName || amount <= 0) {
|
|
2603
2603
|
return "参数格式错误,正确格式:给予 用户句柄 物品名称 数量";
|
|
2604
2604
|
}
|
|
2605
|
+
const parsedAmount = Math.floor(amount);
|
|
2605
2606
|
if (itemName === "金币") {
|
|
2606
2607
|
const [signData] = await ctx.database.get("ggcevo_sign", { handle });
|
|
2608
|
+
const newTotal = (signData?.totalRewards || 0) + parsedAmount;
|
|
2607
2609
|
await ctx.database.upsert("ggcevo_sign", [{
|
|
2608
2610
|
handle,
|
|
2609
|
-
totalRewards:
|
|
2611
|
+
totalRewards: newTotal,
|
|
2610
2612
|
lastSign: signData?.lastSign || /* @__PURE__ */ new Date(0),
|
|
2611
|
-
// 保持原有最后签到时间
|
|
2612
2613
|
monthlyDays: signData?.monthlyDays || 0
|
|
2613
|
-
// 保持月签到天数
|
|
2614
2614
|
}]);
|
|
2615
|
-
return `成功为 ${handle} 添加 ${
|
|
2616
|
-
}
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2615
|
+
return `成功为 ${handle} 添加 ${parsedAmount} 金币!当前总数:${newTotal}`;
|
|
2616
|
+
} else if (itemName === "红晶") {
|
|
2617
|
+
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
2618
|
+
const currentRed = careerData?.redcrystal || 0;
|
|
2619
|
+
const newRed = currentRed + parsedAmount;
|
|
2620
|
+
await ctx.database.upsert("ggcevo_careers", [{
|
|
2621
|
+
handle,
|
|
2622
|
+
redcrystal: newRed,
|
|
2623
|
+
group: careerData?.group || "",
|
|
2624
|
+
career: careerData?.career || "",
|
|
2625
|
+
date: careerData?.date || /* @__PURE__ */ new Date()
|
|
2626
|
+
}]);
|
|
2627
|
+
return `成功为 ${handle} 添加 ${parsedAmount} 红晶!当前总数:${newRed}`;
|
|
2628
|
+
} else {
|
|
2629
|
+
const validItems = Object.keys(initDefaultItems);
|
|
2630
|
+
if (!validItems.includes(itemName)) {
|
|
2631
|
+
return `无效物品名称,可用物品:${validItems.join("、")}`;
|
|
2632
|
+
}
|
|
2633
|
+
const itemId = initDefaultItems[itemName].id;
|
|
2634
|
+
const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId });
|
|
2635
|
+
const newQuantity = (backpack?.quantity || 0) + parsedAmount;
|
|
2636
|
+
await ctx.database.upsert("ggcevo_backpack", [{
|
|
2637
|
+
handle,
|
|
2638
|
+
itemId,
|
|
2639
|
+
quantity: newQuantity
|
|
2640
|
+
}], ["handle", "itemId"]);
|
|
2641
|
+
return `成功为 ${handle} 添加 ${parsedAmount} 个${itemName}!当前总数:${newQuantity}`;
|
|
2620
2642
|
}
|
|
2621
|
-
const itemId = initDefaultItems[itemName].id;
|
|
2622
|
-
const [backpack] = await ctx.database.get("ggcevo_backpack", {
|
|
2623
|
-
handle,
|
|
2624
|
-
itemId
|
|
2625
|
-
});
|
|
2626
|
-
await ctx.database.upsert("ggcevo_backpack", [{
|
|
2627
|
-
handle,
|
|
2628
|
-
itemId,
|
|
2629
|
-
quantity: (backpack?.quantity || 0) + Math.floor(amount)
|
|
2630
|
-
}], ["handle", "itemId"]);
|
|
2631
|
-
return `成功为 ${handle} 添加 ${amount} 个${itemName}!当前总数:${(backpack?.quantity || 0) + amount}`;
|
|
2632
2643
|
} catch (err) {
|
|
2633
2644
|
console.error("[给予命令错误]", err);
|
|
2634
2645
|
return "操作失败:" + (err instanceof Error ? err.message : "数据库异常");
|
|
@@ -3092,8 +3103,8 @@ ${achievementList.join("\n")}`;
|
|
|
3092
3103
|
`玩家数: ${lobby.slotsHumansTaken}/${lobby.slotsHumansTotal}`,
|
|
3093
3104
|
`🏆 安全玩家:${atElements || "无"}`
|
|
3094
3105
|
].join("\n");
|
|
3095
|
-
const
|
|
3096
|
-
await ctx.broadcast(
|
|
3106
|
+
const groupId = [...config.groupId];
|
|
3107
|
+
await ctx.broadcast(groupId, message);
|
|
3097
3108
|
processedLobbies.add(lobby.id);
|
|
3098
3109
|
}
|
|
3099
3110
|
}
|
|
@@ -3881,8 +3892,8 @@ ${validTypes.join("、")}`;
|
|
|
3881
3892
|
await session.send(resultMessage);
|
|
3882
3893
|
if (broadcastMessage) {
|
|
3883
3894
|
const finalBroadcast = Array.isArray(broadcastMessage) ? broadcastMessage.join("\n") : broadcastMessage;
|
|
3884
|
-
const
|
|
3885
|
-
await ctx.broadcast(
|
|
3895
|
+
const groupId = [...config2.groupId];
|
|
3896
|
+
await ctx.broadcast(groupId, finalBroadcast);
|
|
3886
3897
|
}
|
|
3887
3898
|
});
|
|
3888
3899
|
ctx.command("ggcevo/伤害榜 [page]", "查看当前主宰伤害排名").usage("输入 伤害榜 [页码] 查看对应页的排行榜,每页10条").action(async (_, page) => {
|
|
@@ -4023,8 +4034,8 @@ ${validTypes.join("、")}`;
|
|
|
4023
4034
|
case "酥手空空":
|
|
4024
4035
|
newGold = Math.max(0, newGold - 50);
|
|
4025
4036
|
const kfcMsg = '🍗【疯狂星期四警报】有人抽中了"酥手空空"!钱包空空如也,现在急需好心人V他50金币!慈悲为怀的指挥官,速带黄金救场,解救同袍于水火!🆘';
|
|
4026
|
-
const
|
|
4027
|
-
await ctx.broadcast(
|
|
4037
|
+
const groupId = [...config.groupId];
|
|
4038
|
+
await ctx.broadcast(groupId, kfcMsg);
|
|
4028
4039
|
break;
|
|
4029
4040
|
case "夜市赠礼":
|
|
4030
4041
|
const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 1 });
|