koishi-plugin-ggcevo-game 1.3.52 → 1.3.54
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 +133 -136
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -193,7 +193,7 @@ function apply(ctx, config) {
|
|
|
193
193
|
lastPK: "timestamp",
|
|
194
194
|
enable: {
|
|
195
195
|
type: "boolean",
|
|
196
|
-
initial:
|
|
196
|
+
initial: false
|
|
197
197
|
// 默认开启
|
|
198
198
|
},
|
|
199
199
|
lastToggle: "timestamp"
|
|
@@ -3075,56 +3075,39 @@ ${discountDetails.join("\n▸ ")}`;
|
|
|
3075
3075
|
for (const key in weaponConfig) {
|
|
3076
3076
|
weaponConfigById[weaponConfig[key].id] = weaponConfig[key];
|
|
3077
3077
|
}
|
|
3078
|
-
async function calculateTotalPower(handle
|
|
3079
|
-
const
|
|
3080
|
-
|
|
3081
|
-
|
|
3078
|
+
async function calculateTotalPower(handle) {
|
|
3079
|
+
const [rankData] = await ctx.database.get("ggcevo_rank", {
|
|
3080
|
+
handle,
|
|
3081
|
+
rankseason: config.rankseason
|
|
3082
|
+
});
|
|
3083
|
+
const baseRank = rankData?.rank || 0;
|
|
3082
3084
|
let total = baseRank;
|
|
3085
|
+
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
3086
|
+
const career = careerData?.career;
|
|
3083
3087
|
if (career) {
|
|
3084
|
-
if (career === "联盟新兵")
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
"医疗专家",
|
|
3091
|
-
"情报副官",
|
|
3092
|
-
"总工程师",
|
|
3093
|
-
"舰长",
|
|
3094
|
-
"机械化专家"
|
|
3095
|
-
].includes(career)) {
|
|
3096
|
-
total += 2500;
|
|
3097
|
-
} else if ([
|
|
3098
|
-
"清洁工",
|
|
3099
|
-
"辛迪加财务经理",
|
|
3100
|
-
"计算机专家",
|
|
3101
|
-
"指挥官",
|
|
3102
|
-
"装甲兵",
|
|
3103
|
-
"破坏者",
|
|
3104
|
-
"征募官"
|
|
3105
|
-
].includes(career)) {
|
|
3106
|
-
total += 3e3;
|
|
3107
|
-
} else if ([
|
|
3108
|
-
"警卫员下士",
|
|
3109
|
-
"警卫长",
|
|
3110
|
-
"武器中士"
|
|
3111
|
-
].includes(career)) {
|
|
3112
|
-
total += 3500;
|
|
3113
|
-
} else if ([
|
|
3114
|
-
"能量武器专家",
|
|
3115
|
-
"枪手",
|
|
3116
|
-
"猩红杀手",
|
|
3117
|
-
"纵火狂"
|
|
3118
|
-
].includes(career)) {
|
|
3119
|
-
total += 4e3;
|
|
3120
|
-
}
|
|
3088
|
+
if (career === "联盟新兵") total += 1e3;
|
|
3089
|
+
else if (career === "辛迪加炮灰新兵") total += 2e3;
|
|
3090
|
+
else if (["深空矿工", "医疗专家", "情报副官", "总工程师", "舰长", "机械化专家"].includes(career)) total += 2500;
|
|
3091
|
+
else if (["清洁工", "辛迪加财务经理", "计算机专家", "指挥官", "装甲兵", "破坏者", "征募官"].includes(career)) total += 3e3;
|
|
3092
|
+
else if (["警卫员下士", "警卫长", "武器中士"].includes(career)) total += 3500;
|
|
3093
|
+
else if (["能量武器专家", "枪手", "猩红杀手", "纵火狂"].includes(career)) total += 4e3;
|
|
3121
3094
|
}
|
|
3095
|
+
const weapons = await ctx.database.get("ggcevo_equipment", { handle });
|
|
3122
3096
|
for (const { weaponId, level, installedMods } of weapons) {
|
|
3123
3097
|
const weapon = weaponConfigById[weaponId];
|
|
3124
3098
|
if (!weapon) continue;
|
|
3125
3099
|
total += weapon.damage * 100;
|
|
3126
|
-
total += level * 1e3;
|
|
3127
|
-
|
|
3100
|
+
total += level * (level + 1) / 2 * 1e3;
|
|
3101
|
+
for (const modName of installedMods || []) {
|
|
3102
|
+
const mod = modConfig[modName];
|
|
3103
|
+
if (mod) {
|
|
3104
|
+
if (mod.isExclusive) {
|
|
3105
|
+
total += 4e3;
|
|
3106
|
+
} else {
|
|
3107
|
+
total += 2e3;
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3128
3111
|
}
|
|
3129
3112
|
return total;
|
|
3130
3113
|
}
|
|
@@ -3817,7 +3800,7 @@ ${itemDetails.join("\n")}`;
|
|
|
3817
3800
|
].join("\n");
|
|
3818
3801
|
});
|
|
3819
3802
|
ctx.command("ggcevo/赛季结算", "进行赛季结算并发放奖励", { authority: 3 }).action(async ({ session }) => {
|
|
3820
|
-
await session.send(`确定要进行赛季结算吗?(请在30
|
|
3803
|
+
await session.send(`确定要进行赛季结算吗?(请在30秒内回复"是"确认)`);
|
|
3821
3804
|
const confirm = await session.prompt(3e4);
|
|
3822
3805
|
if (confirm !== "是") return "已取消操作。";
|
|
3823
3806
|
const currentSeason = config.rankseason;
|
|
@@ -3886,23 +3869,31 @@ ${itemDetails.join("\n")}`;
|
|
|
3886
3869
|
const otherPlayers = await ctx.database.get("ggcevo_rank", {
|
|
3887
3870
|
Blacklist: false,
|
|
3888
3871
|
rankseason: currentSeason,
|
|
3889
|
-
handle: { $nin: rankedPlayers.map((p) => p.handle) }
|
|
3890
|
-
rank: { $ne: 0 }
|
|
3872
|
+
handle: { $nin: rankedPlayers.map((p) => p.handle) }
|
|
3891
3873
|
});
|
|
3892
3874
|
for (const player of otherPlayers) {
|
|
3893
|
-
if (player.rank > 0)
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3875
|
+
if (player.rank > 0) {
|
|
3876
|
+
positiveCount++;
|
|
3877
|
+
const gold = 1e3;
|
|
3878
|
+
const [signData] = await ctx.database.get("ggcevo_sign", { handle: player.handle });
|
|
3879
|
+
await ctx.database.upsert("ggcevo_sign", [{
|
|
3880
|
+
handle: player.handle,
|
|
3881
|
+
totalRewards: (signData?.totalRewards || 0) + gold
|
|
3882
|
+
}], ["handle"]);
|
|
3883
|
+
} else if (player.rank <= 0) {
|
|
3884
|
+
negativeCount++;
|
|
3885
|
+
const gold = 500;
|
|
3886
|
+
const [signData] = await ctx.database.get("ggcevo_sign", { handle: player.handle });
|
|
3887
|
+
await ctx.database.upsert("ggcevo_sign", [{
|
|
3888
|
+
handle: player.handle,
|
|
3889
|
+
totalRewards: (signData?.totalRewards || 0) + gold
|
|
3890
|
+
}], ["handle"]);
|
|
3891
|
+
}
|
|
3901
3892
|
}
|
|
3902
3893
|
report += "🎉 参与奖励发放:\n";
|
|
3903
3894
|
report += `✦ 积极玩家(分数>0):${positiveCount}人,每人获得1000枚金币
|
|
3904
3895
|
`;
|
|
3905
|
-
report += `✦ 奋斗玩家(
|
|
3896
|
+
report += `✦ 奋斗玩家(分数≤0):${negativeCount}人,每人获得500枚金币
|
|
3906
3897
|
|
|
3907
3898
|
`;
|
|
3908
3899
|
report += `✅ 总计发放:
|
|
@@ -4502,12 +4493,42 @@ ${items.join("、")}
|
|
|
4502
4493
|
ctx.database.get("ggcevo_rank", { handle: initiatorHandle, rankseason: config.rankseason }),
|
|
4503
4494
|
ctx.database.get("ggcevo_rank", { handle: targetHandle, rankseason: config.rankseason })
|
|
4504
4495
|
]);
|
|
4505
|
-
const
|
|
4506
|
-
const
|
|
4507
|
-
const initiatorPower = await calculateTotalPower(initiatorHandle, initiatorRank);
|
|
4508
|
-
const targetPower = await calculateTotalPower(targetHandle, targetRank);
|
|
4496
|
+
const initiatorPower = await calculateTotalPower(initiatorHandle);
|
|
4497
|
+
const targetPower = await calculateTotalPower(targetHandle);
|
|
4509
4498
|
const initiatorRankname = initiatorData[0]?.name || session.username;
|
|
4510
4499
|
const targetRankname = targetData[0]?.name || (targetUsername.name || targetUsername.user.name);
|
|
4500
|
+
const [initiatorCareer] = await ctx.database.get("ggcevo_careers", {
|
|
4501
|
+
handle: initiatorHandle
|
|
4502
|
+
});
|
|
4503
|
+
const [targetCareer] = await ctx.database.get("ggcevo_careers", {
|
|
4504
|
+
handle: targetHandle
|
|
4505
|
+
});
|
|
4506
|
+
const validGroups = /* @__PURE__ */ new Set(["人类联盟", "辛迪加海盗"]);
|
|
4507
|
+
if (!initiatorCareer?.group || !validGroups.has(initiatorCareer.group)) {
|
|
4508
|
+
return "❌ 您尚未加入人类联盟或辛迪加海盗,不能参与PK";
|
|
4509
|
+
}
|
|
4510
|
+
if (!targetCareer?.group || !validGroups.has(targetCareer.group)) {
|
|
4511
|
+
return "❌ 对方尚未加入人类联盟或辛迪加海盗,不能参与PK";
|
|
4512
|
+
}
|
|
4513
|
+
if (targetCareer.group === "人类联盟") {
|
|
4514
|
+
let joinDate;
|
|
4515
|
+
if (typeof targetCareer.date === "string") {
|
|
4516
|
+
joinDate = convertUTCtoChinaTime(new Date(targetCareer.date));
|
|
4517
|
+
} else if (typeof targetCareer.date === "number") {
|
|
4518
|
+
joinDate = convertUTCtoChinaTime(new Date(targetCareer.date));
|
|
4519
|
+
} else {
|
|
4520
|
+
joinDate = convertUTCtoChinaTime(targetCareer.date);
|
|
4521
|
+
}
|
|
4522
|
+
if (isNaN(joinDate.getTime())) {
|
|
4523
|
+
return "❌ 对方阵营加入阵营日期无效";
|
|
4524
|
+
}
|
|
4525
|
+
const now2 = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
|
|
4526
|
+
const timeDiff = now2.getTime() - joinDate.getTime();
|
|
4527
|
+
const diffInDays = Math.floor(timeDiff / (1e3 * 60 * 60 * 24));
|
|
4528
|
+
if (diffInDays < 30) {
|
|
4529
|
+
return `🛡️ 该玩家是人类联盟成员,尚在30天保护期内(剩余${30 - diffInDays}天),无法挑战`;
|
|
4530
|
+
}
|
|
4531
|
+
}
|
|
4511
4532
|
let initiatorPK = {
|
|
4512
4533
|
handle: initiatorHandle,
|
|
4513
4534
|
name: initiatorRankname,
|
|
@@ -4516,7 +4537,7 @@ ${items.join("、")}
|
|
|
4516
4537
|
todayCount: 0,
|
|
4517
4538
|
lastPK: /* @__PURE__ */ new Date(0),
|
|
4518
4539
|
// 明确初始化 lastPK
|
|
4519
|
-
enable:
|
|
4540
|
+
enable: false,
|
|
4520
4541
|
// 新增默认值
|
|
4521
4542
|
lastToggle: /* @__PURE__ */ new Date(0)
|
|
4522
4543
|
// 新增默认值
|
|
@@ -4528,7 +4549,7 @@ ${items.join("、")}
|
|
|
4528
4549
|
wins: 0,
|
|
4529
4550
|
todayCount: 0,
|
|
4530
4551
|
lastPK: /* @__PURE__ */ new Date(0),
|
|
4531
|
-
enable:
|
|
4552
|
+
enable: false,
|
|
4532
4553
|
// 新增默认值
|
|
4533
4554
|
lastToggle: /* @__PURE__ */ new Date(0)
|
|
4534
4555
|
// 新增默认值
|
|
@@ -4539,17 +4560,28 @@ ${items.join("、")}
|
|
|
4539
4560
|
const [dbTarget] = await ctx.database.get("ggcevo_pk", { handle: targetHandle });
|
|
4540
4561
|
if (dbTarget) Object.assign(targetPK, dbTarget);
|
|
4541
4562
|
});
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4563
|
+
if (initiatorCareer.group === "人类联盟" && !initiatorPK.enable) {
|
|
4564
|
+
let joinDate;
|
|
4565
|
+
if (typeof initiatorCareer.date === "string") joinDate = convertUTCtoChinaTime(new Date(initiatorCareer.date));
|
|
4566
|
+
else if (typeof initiatorCareer.date === "number") joinDate = convertUTCtoChinaTime(new Date(initiatorCareer.date));
|
|
4567
|
+
else joinDate = convertUTCtoChinaTime(initiatorCareer.date);
|
|
4568
|
+
if (!isNaN(joinDate.getTime())) {
|
|
4569
|
+
const now2 = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
|
|
4570
|
+
const timeDiff = now2.getTime() - joinDate.getTime();
|
|
4571
|
+
const remainingDays = 30 - Math.floor(timeDiff / (1e3 * 60 * 60 * 24));
|
|
4572
|
+
if (remainingDays > 0) {
|
|
4573
|
+
await session.send(`⚠️ 您的人类联盟保护期剩余 ${remainingDays} 天,发起PK将永久失去保护期!请确认是否继续?
|
|
4574
|
+
回复"是"继续PK,或"取消"退出`);
|
|
4575
|
+
const confirm = await session.prompt(3e4);
|
|
4576
|
+
if (confirm !== "是") return "已取消PK操作,保护期仍有效";
|
|
4577
|
+
}
|
|
4578
|
+
}
|
|
4579
|
+
initiatorPK.enable = true;
|
|
4580
|
+
initiatorPK.lastToggle = /* @__PURE__ */ new Date();
|
|
4581
|
+
await ctx.database.set("ggcevo_pk", initiatorHandle, {
|
|
4582
|
+
enable: true,
|
|
4583
|
+
lastToggle: /* @__PURE__ */ new Date()
|
|
4584
|
+
});
|
|
4553
4585
|
}
|
|
4554
4586
|
const now = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
|
|
4555
4587
|
if (!isSameDate(convertUTCtoChinaTime(initiatorPK.lastPK), now)) {
|
|
@@ -4599,12 +4631,15 @@ ${items.join("、")}
|
|
|
4599
4631
|
hasMP3 = mp3Item && mp3Item.quantity > 0;
|
|
4600
4632
|
}
|
|
4601
4633
|
const powerDiff = initiatorPower - targetPower;
|
|
4602
|
-
let winRate = 50 + powerDiff /
|
|
4634
|
+
let winRate = 50 + powerDiff / 100 * 0.1;
|
|
4603
4635
|
winRate = Math.min(Math.max(winRate, 5), 95);
|
|
4604
4636
|
const randInt = Math.floor(Math.random() * 1e4);
|
|
4605
4637
|
const winRateInt = Math.floor(winRate * 100);
|
|
4606
4638
|
const isWin = randInt < winRateInt;
|
|
4607
4639
|
let stealPercentage = getRandomInt(1, 5);
|
|
4640
|
+
if (targetCareer.group === "人类联盟" && isWin) {
|
|
4641
|
+
stealPercentage = 1;
|
|
4642
|
+
}
|
|
4608
4643
|
let goldTransfer = Math.floor(
|
|
4609
4644
|
(isWin ? targetGold : initiatorGold) * stealPercentage / 100
|
|
4610
4645
|
);
|
|
@@ -4691,7 +4726,7 @@ ${items.join("、")}
|
|
|
4691
4726
|
}
|
|
4692
4727
|
});
|
|
4693
4728
|
const result = [
|
|
4694
|
-
`⚔️【对战结果】${isWin ? "胜利" : "失败"}
|
|
4729
|
+
`⚔️【对战结果】${isWin ? "胜利" : "失败"}`,
|
|
4695
4730
|
`🏅 挑战者:${initiatorRankname}(战斗力 ${initiatorPower})`,
|
|
4696
4731
|
` 👨💼 职业:${initiatorCareer?.career || "无"}`,
|
|
4697
4732
|
// 显示职业
|
|
@@ -4701,6 +4736,9 @@ ${items.join("、")}
|
|
|
4701
4736
|
`📊 胜率预测:${winRate.toFixed(1)}%`,
|
|
4702
4737
|
`🎰 金币变动:${stealPercentage}%`
|
|
4703
4738
|
];
|
|
4739
|
+
if (targetCareer.group === "人类联盟" && isWin) {
|
|
4740
|
+
result.push(`🛡️ 人类联盟保护:应战者失败仅损失1%金币`);
|
|
4741
|
+
}
|
|
4704
4742
|
if (computerExpertProtection) {
|
|
4705
4743
|
result.push(`💻 计算机专家职业加成:被动PK失败不损失金币`);
|
|
4706
4744
|
} else if (isWin) {
|
|
@@ -4757,54 +4795,6 @@ ${items.join("、")}
|
|
|
4757
4795
|
pageNum < totalPages ? `输入 pk榜 ${pageNum + 1} 查看下一页` : "已是最后一页"
|
|
4758
4796
|
].join("\n");
|
|
4759
4797
|
});
|
|
4760
|
-
ctx.command("ggcevo/切换pk", "切换玩家对战状态").alias("切换pk状态").action(async ({ session }) => {
|
|
4761
|
-
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4762
|
-
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
4763
|
-
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4764
|
-
const [pkRecord] = await ctx.database.get("ggcevo_pk", { handle }) || [null];
|
|
4765
|
-
const currentState = pkRecord?.enable ?? true;
|
|
4766
|
-
const lastToggle = pkRecord?.lastToggle ?? /* @__PURE__ */ new Date(0);
|
|
4767
|
-
if (!pkRecord) {
|
|
4768
|
-
await ctx.database.create("ggcevo_pk", {
|
|
4769
|
-
handle,
|
|
4770
|
-
total: 0,
|
|
4771
|
-
wins: 0,
|
|
4772
|
-
todayCount: 0,
|
|
4773
|
-
lastPK: /* @__PURE__ */ new Date(0),
|
|
4774
|
-
enable: true,
|
|
4775
|
-
// 默认初始状态为开启
|
|
4776
|
-
lastToggle: /* @__PURE__ */ new Date(0)
|
|
4777
|
-
});
|
|
4778
|
-
}
|
|
4779
|
-
const now = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
|
|
4780
|
-
const lastToggleTime = convertUTCtoChinaTime(lastToggle);
|
|
4781
|
-
const diffDays = Math.floor((now.getTime() - lastToggleTime.getTime()) / (1e3 * 3600 * 24));
|
|
4782
|
-
const [careers] = await ctx.database.get("ggcevo_careers", { handle });
|
|
4783
|
-
if (careers?.group === "辛迪加海盗") return "您已经加入了辛迪加海盗阵营,无法切换PK状态!";
|
|
4784
|
-
if (diffDays < 3 && lastToggleTime.getTime() !== 0) {
|
|
4785
|
-
const remaining = 3 - diffDays;
|
|
4786
|
-
return `状态切换冷却中,${remaining}天后再试(下次可切换时间:${new Date(lastToggle.getTime() + 3 * 864e5).toLocaleDateString("zh-CN")})。`;
|
|
4787
|
-
}
|
|
4788
|
-
const action = currentState ? "关闭" : "开启";
|
|
4789
|
-
await session.send(`您当前的PK状态为【${currentState ? "开启" : "关闭"}】,确认要${action}吗?(请在30秒内回复“是”确认)`);
|
|
4790
|
-
const confirm = await session.prompt(3e4);
|
|
4791
|
-
if (confirm !== "是") return "已取消操作。";
|
|
4792
|
-
await ctx.database.upsert("ggcevo_pk", [{
|
|
4793
|
-
handle,
|
|
4794
|
-
enable: !currentState,
|
|
4795
|
-
lastToggle: /* @__PURE__ */ new Date(),
|
|
4796
|
-
// 保持其他字段不变
|
|
4797
|
-
total: pkRecord?.total || 0,
|
|
4798
|
-
wins: pkRecord?.wins || 0,
|
|
4799
|
-
todayCount: pkRecord?.todayCount || 0,
|
|
4800
|
-
lastPK: pkRecord?.lastPK || /* @__PURE__ */ new Date(0)
|
|
4801
|
-
}], ["handle"]);
|
|
4802
|
-
return `PK状态已${!currentState ? "开启" : "关闭"},下次可切换时间:${new Date(Date.now() + 3 * 864e5).toLocaleDateString("zh-CN", {
|
|
4803
|
-
year: "numeric",
|
|
4804
|
-
month: "2-digit",
|
|
4805
|
-
day: "2-digit"
|
|
4806
|
-
})}`;
|
|
4807
|
-
});
|
|
4808
4798
|
ctx.command("ggcevo/武器库 [type]").usage("输入“武器库”查看类型,或“武器库 类型”查看详细武器信息").action(async ({ session }, type) => {
|
|
4809
4799
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4810
4800
|
if (!profile) return "⚠️ 需要先绑定游戏句柄";
|
|
@@ -5145,11 +5135,19 @@ ${validTypes.join("、")}`;
|
|
|
5145
5135
|
const processModInstallation = /* @__PURE__ */ __name(async () => {
|
|
5146
5136
|
const modInfo = modConfig[mod];
|
|
5147
5137
|
if (!modInfo) return "无效模块名称。";
|
|
5138
|
+
if (!weapon || !weaponConfig[weapon]?.id) {
|
|
5139
|
+
const validWeapons = Object.keys(weaponConfig).filter((k) => weaponConfig[k].id);
|
|
5140
|
+
return `❌ 无效武器名称。可选武器:${validWeapons.join("、")}`;
|
|
5141
|
+
}
|
|
5142
|
+
const weaponId = weaponConfig[weapon].id;
|
|
5148
5143
|
const [equipment] = await ctx.database.get("ggcevo_equipment", {
|
|
5149
5144
|
handle,
|
|
5150
|
-
weaponId
|
|
5145
|
+
weaponId
|
|
5146
|
+
// 使用已验证的weaponId
|
|
5151
5147
|
});
|
|
5152
|
-
if (!equipment)
|
|
5148
|
+
if (!equipment) {
|
|
5149
|
+
return `❌ 尚未获得【${weapon}】或武器名称错误`;
|
|
5150
|
+
}
|
|
5153
5151
|
if (modInfo.isExclusive) {
|
|
5154
5152
|
if (modInfo.exclusiveTo !== weapon) return `❌ 该模块只能安装在${modInfo.exclusiveTo}上。`;
|
|
5155
5153
|
const hasExclusive = equipment.installedMods.some((m) => modConfig[m]?.isExclusive);
|
|
@@ -5963,9 +5961,9 @@ ${scatterEffectMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5963
5961
|
try {
|
|
5964
5962
|
if (faction === "人类联盟") {
|
|
5965
5963
|
if (userCoins < 1e3) {
|
|
5966
|
-
return `加入人类联盟需要1000
|
|
5964
|
+
return `加入人类联盟需要1000金币,您当前拥有${userCoins}金币`;
|
|
5967
5965
|
}
|
|
5968
|
-
await session.send(
|
|
5966
|
+
await session.send(`请问您确定要缴纳1000金币加入人类联盟吗?(请在30秒内输入“是”确定加入)`);
|
|
5969
5967
|
const cost = await session.prompt(3e4);
|
|
5970
5968
|
if (cost !== "是") return "已取消加入。";
|
|
5971
5969
|
await ctx.database.upsert("ggcevo_sign", [{
|
|
@@ -5982,12 +5980,9 @@ ${scatterEffectMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5982
5980
|
} else if (faction === "辛迪加海盗") {
|
|
5983
5981
|
const [pkData] = await ctx.database.get("ggcevo_pk", { handle });
|
|
5984
5982
|
if (userCoins < 2e3) {
|
|
5985
|
-
return `加入辛迪加海盗需要缴纳2000
|
|
5986
|
-
}
|
|
5987
|
-
if (pkData && !pkData?.enable) {
|
|
5988
|
-
return "当前PK功能未开启,无法加入辛迪加海盗。";
|
|
5983
|
+
return `加入辛迪加海盗需要缴纳2000金币,您当前拥有${userCoins}金币`;
|
|
5989
5984
|
}
|
|
5990
|
-
await session.send(
|
|
5985
|
+
await session.send(`请问您确定要缴纳2000金币加入辛迪加海盗吗?(请在30秒内输入“是”确定加入)`);
|
|
5991
5986
|
const cost = await session.prompt(3e4);
|
|
5992
5987
|
if (cost !== "是") return "已取消加入。";
|
|
5993
5988
|
await ctx.database.upsert("ggcevo_sign", [{
|
|
@@ -6081,8 +6076,7 @@ ${scatterEffectMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
6081
6076
|
}
|
|
6082
6077
|
await ctx.database.upsert("ggcevo_careers", [{
|
|
6083
6078
|
handle,
|
|
6084
|
-
career: profession
|
|
6085
|
-
date: /* @__PURE__ */ new Date()
|
|
6079
|
+
career: profession
|
|
6086
6080
|
}], ["handle"]);
|
|
6087
6081
|
return `${careerData.group === "辛迪加海盗" ? `花费${targetProfession.costredcrystal}红晶` : `花费${targetProfession.costcoins}金币`}转职成功!当前职业:${profession}`;
|
|
6088
6082
|
} catch (err) {
|
|
@@ -6102,14 +6096,17 @@ ${scatterEffectMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
6102
6096
|
const config2 = careerData.group === "辛迪加海盗" ? syndicatePirateConfig : spaceStationCrewConfig;
|
|
6103
6097
|
const profession = config2.find((p) => p.professionName === careerData.career);
|
|
6104
6098
|
const effectDisplay = profession?.effect || "暂无特殊效果";
|
|
6105
|
-
const joinDate = new Date(careerData.date);
|
|
6099
|
+
const joinDate = convertUTCtoChinaTime(new Date(careerData.date));
|
|
6106
6100
|
const formattedDate = `${joinDate.getFullYear()}年${joinDate.getMonth() + 1}月${joinDate.getDate()}日`;
|
|
6101
|
+
const powerValue = await calculateTotalPower(handle);
|
|
6107
6102
|
const infoCard = [
|
|
6108
6103
|
`🎮 游戏句柄:${handle}`,
|
|
6104
|
+
`⚔️ 当前战力:${powerValue}`,
|
|
6105
|
+
// 新增战力显示行
|
|
6109
6106
|
`🎯 当前阵营:${careerData.group}`,
|
|
6110
6107
|
`👔 当前职业:${careerData.career}`,
|
|
6111
6108
|
`✨ 职业效果:${effectDisplay}`,
|
|
6112
|
-
`🗓️
|
|
6109
|
+
`🗓️ 加入时间:${formattedDate}`
|
|
6113
6110
|
];
|
|
6114
6111
|
if (careerData.group === "人类联盟") {
|
|
6115
6112
|
const techEntries = await ctx.database.get("ggcevo_tech", { handle });
|