koishi-plugin-ggcevo-game 1.3.53 → 1.3.55
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 +119 -138
- 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
|
}
|
|
@@ -4510,12 +4493,42 @@ ${items.join("、")}
|
|
|
4510
4493
|
ctx.database.get("ggcevo_rank", { handle: initiatorHandle, rankseason: config.rankseason }),
|
|
4511
4494
|
ctx.database.get("ggcevo_rank", { handle: targetHandle, rankseason: config.rankseason })
|
|
4512
4495
|
]);
|
|
4513
|
-
const
|
|
4514
|
-
const
|
|
4515
|
-
const initiatorPower = await calculateTotalPower(initiatorHandle, initiatorRank);
|
|
4516
|
-
const targetPower = await calculateTotalPower(targetHandle, targetRank);
|
|
4496
|
+
const initiatorPower = await calculateTotalPower(initiatorHandle);
|
|
4497
|
+
const targetPower = await calculateTotalPower(targetHandle);
|
|
4517
4498
|
const initiatorRankname = initiatorData[0]?.name || session.username;
|
|
4518
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
|
+
}
|
|
4519
4532
|
let initiatorPK = {
|
|
4520
4533
|
handle: initiatorHandle,
|
|
4521
4534
|
name: initiatorRankname,
|
|
@@ -4524,7 +4537,7 @@ ${items.join("、")}
|
|
|
4524
4537
|
todayCount: 0,
|
|
4525
4538
|
lastPK: /* @__PURE__ */ new Date(0),
|
|
4526
4539
|
// 明确初始化 lastPK
|
|
4527
|
-
enable:
|
|
4540
|
+
enable: false,
|
|
4528
4541
|
// 新增默认值
|
|
4529
4542
|
lastToggle: /* @__PURE__ */ new Date(0)
|
|
4530
4543
|
// 新增默认值
|
|
@@ -4536,7 +4549,7 @@ ${items.join("、")}
|
|
|
4536
4549
|
wins: 0,
|
|
4537
4550
|
todayCount: 0,
|
|
4538
4551
|
lastPK: /* @__PURE__ */ new Date(0),
|
|
4539
|
-
enable:
|
|
4552
|
+
enable: false,
|
|
4540
4553
|
// 新增默认值
|
|
4541
4554
|
lastToggle: /* @__PURE__ */ new Date(0)
|
|
4542
4555
|
// 新增默认值
|
|
@@ -4547,17 +4560,28 @@ ${items.join("、")}
|
|
|
4547
4560
|
const [dbTarget] = await ctx.database.get("ggcevo_pk", { handle: targetHandle });
|
|
4548
4561
|
if (dbTarget) Object.assign(targetPK, dbTarget);
|
|
4549
4562
|
});
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
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
|
+
});
|
|
4561
4585
|
}
|
|
4562
4586
|
const now = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
|
|
4563
4587
|
if (!isSameDate(convertUTCtoChinaTime(initiatorPK.lastPK), now)) {
|
|
@@ -4607,12 +4631,15 @@ ${items.join("、")}
|
|
|
4607
4631
|
hasMP3 = mp3Item && mp3Item.quantity > 0;
|
|
4608
4632
|
}
|
|
4609
4633
|
const powerDiff = initiatorPower - targetPower;
|
|
4610
|
-
let winRate = 50 + powerDiff /
|
|
4634
|
+
let winRate = 50 + powerDiff / 100 * 0.1;
|
|
4611
4635
|
winRate = Math.min(Math.max(winRate, 5), 95);
|
|
4612
4636
|
const randInt = Math.floor(Math.random() * 1e4);
|
|
4613
4637
|
const winRateInt = Math.floor(winRate * 100);
|
|
4614
4638
|
const isWin = randInt < winRateInt;
|
|
4615
4639
|
let stealPercentage = getRandomInt(1, 5);
|
|
4640
|
+
if (targetCareer.group === "人类联盟" && isWin) {
|
|
4641
|
+
stealPercentage = 1;
|
|
4642
|
+
}
|
|
4616
4643
|
let goldTransfer = Math.floor(
|
|
4617
4644
|
(isWin ? targetGold : initiatorGold) * stealPercentage / 100
|
|
4618
4645
|
);
|
|
@@ -4636,11 +4663,7 @@ ${items.join("、")}
|
|
|
4636
4663
|
total: initiatorPK.total + 1,
|
|
4637
4664
|
wins: isWin ? initiatorPK.wins + 1 : initiatorPK.wins,
|
|
4638
4665
|
todayCount: initiatorPK.todayCount + 1,
|
|
4639
|
-
lastPK: /* @__PURE__ */ new Date()
|
|
4640
|
-
enable: initiatorPK.enable,
|
|
4641
|
-
// 包含新字段
|
|
4642
|
-
lastToggle: initiatorPK.lastToggle
|
|
4643
|
-
// 包含新字段
|
|
4666
|
+
lastPK: /* @__PURE__ */ new Date()
|
|
4644
4667
|
},
|
|
4645
4668
|
// 应战者记录(新增部分)
|
|
4646
4669
|
{
|
|
@@ -4651,12 +4674,8 @@ ${items.join("、")}
|
|
|
4651
4674
|
// 应战者胜利时增加
|
|
4652
4675
|
todayCount: targetPK.todayCount,
|
|
4653
4676
|
// 不消耗应战者次数
|
|
4654
|
-
lastPK: targetPK.lastPK
|
|
4677
|
+
lastPK: targetPK.lastPK
|
|
4655
4678
|
// 保留原有时间不更新
|
|
4656
|
-
enable: targetPK.enable,
|
|
4657
|
-
// 包含新字段
|
|
4658
|
-
lastToggle: targetPK.lastToggle
|
|
4659
|
-
// 包含新字段
|
|
4660
4679
|
}
|
|
4661
4680
|
]);
|
|
4662
4681
|
await ctx.database.create("ggcevo_pk_logs", {
|
|
@@ -4699,7 +4718,7 @@ ${items.join("、")}
|
|
|
4699
4718
|
}
|
|
4700
4719
|
});
|
|
4701
4720
|
const result = [
|
|
4702
|
-
`⚔️【对战结果】${isWin ? "胜利" : "失败"}
|
|
4721
|
+
`⚔️【对战结果】${isWin ? "胜利" : "失败"}`,
|
|
4703
4722
|
`🏅 挑战者:${initiatorRankname}(战斗力 ${initiatorPower})`,
|
|
4704
4723
|
` 👨💼 职业:${initiatorCareer?.career || "无"}`,
|
|
4705
4724
|
// 显示职业
|
|
@@ -4709,6 +4728,9 @@ ${items.join("、")}
|
|
|
4709
4728
|
`📊 胜率预测:${winRate.toFixed(1)}%`,
|
|
4710
4729
|
`🎰 金币变动:${stealPercentage}%`
|
|
4711
4730
|
];
|
|
4731
|
+
if (targetCareer.group === "人类联盟" && isWin) {
|
|
4732
|
+
result.push(`🛡️ 人类联盟保护:应战者失败仅损失1%金币`);
|
|
4733
|
+
}
|
|
4712
4734
|
if (computerExpertProtection) {
|
|
4713
4735
|
result.push(`💻 计算机专家职业加成:被动PK失败不损失金币`);
|
|
4714
4736
|
} else if (isWin) {
|
|
@@ -4739,10 +4761,10 @@ ${items.join("、")}
|
|
|
4739
4761
|
if (pageNum < 1) return "请输入有效的页码。";
|
|
4740
4762
|
const offset = (pageNum - 1) * 10;
|
|
4741
4763
|
const [records, total] = await Promise.all([
|
|
4742
|
-
//
|
|
4743
|
-
ctx.database.select("ggcevo_pk").
|
|
4764
|
+
// 获取当前页记录
|
|
4765
|
+
ctx.database.select("ggcevo_pk").orderBy("wins", "desc").limit(10).offset(offset).execute(),
|
|
4744
4766
|
// 获取总记录数(启用PK的用户总数)
|
|
4745
|
-
ctx.database.select("ggcevo_pk").
|
|
4767
|
+
ctx.database.select("ggcevo_pk").execute((row) => import_koishi.$.count(row.handle))
|
|
4746
4768
|
]);
|
|
4747
4769
|
const totalPages = Math.ceil(total / 10);
|
|
4748
4770
|
if (pageNum > totalPages) return `查询失败,最多有 ${totalPages} 页`;
|
|
@@ -4757,7 +4779,7 @@ ${items.join("、")}
|
|
|
4757
4779
|
].join(" | ");
|
|
4758
4780
|
}).join("\n");
|
|
4759
4781
|
return [
|
|
4760
|
-
"🏆 PK排行榜
|
|
4782
|
+
"🏆 PK排行榜 🏆",
|
|
4761
4783
|
"──────────────",
|
|
4762
4784
|
rankingText,
|
|
4763
4785
|
"──────────────",
|
|
@@ -4765,54 +4787,6 @@ ${items.join("、")}
|
|
|
4765
4787
|
pageNum < totalPages ? `输入 pk榜 ${pageNum + 1} 查看下一页` : "已是最后一页"
|
|
4766
4788
|
].join("\n");
|
|
4767
4789
|
});
|
|
4768
|
-
ctx.command("ggcevo/切换pk", "切换玩家对战状态").alias("切换pk状态").action(async ({ session }) => {
|
|
4769
|
-
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4770
|
-
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
4771
|
-
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4772
|
-
const [pkRecord] = await ctx.database.get("ggcevo_pk", { handle }) || [null];
|
|
4773
|
-
const currentState = pkRecord?.enable ?? true;
|
|
4774
|
-
const lastToggle = pkRecord?.lastToggle ?? /* @__PURE__ */ new Date(0);
|
|
4775
|
-
if (!pkRecord) {
|
|
4776
|
-
await ctx.database.create("ggcevo_pk", {
|
|
4777
|
-
handle,
|
|
4778
|
-
total: 0,
|
|
4779
|
-
wins: 0,
|
|
4780
|
-
todayCount: 0,
|
|
4781
|
-
lastPK: /* @__PURE__ */ new Date(0),
|
|
4782
|
-
enable: true,
|
|
4783
|
-
// 默认初始状态为开启
|
|
4784
|
-
lastToggle: /* @__PURE__ */ new Date(0)
|
|
4785
|
-
});
|
|
4786
|
-
}
|
|
4787
|
-
const now = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
|
|
4788
|
-
const lastToggleTime = convertUTCtoChinaTime(lastToggle);
|
|
4789
|
-
const diffDays = Math.floor((now.getTime() - lastToggleTime.getTime()) / (1e3 * 3600 * 24));
|
|
4790
|
-
const [careers] = await ctx.database.get("ggcevo_careers", { handle });
|
|
4791
|
-
if (careers?.group === "辛迪加海盗") return "您已经加入了辛迪加海盗阵营,无法切换PK状态!";
|
|
4792
|
-
if (diffDays < 3 && lastToggleTime.getTime() !== 0) {
|
|
4793
|
-
const remaining = 3 - diffDays;
|
|
4794
|
-
return `状态切换冷却中,${remaining}天后再试(下次可切换时间:${new Date(lastToggle.getTime() + 3 * 864e5).toLocaleDateString("zh-CN")})。`;
|
|
4795
|
-
}
|
|
4796
|
-
const action = currentState ? "关闭" : "开启";
|
|
4797
|
-
await session.send(`您当前的PK状态为【${currentState ? "开启" : "关闭"}】,确认要${action}吗?(请在30秒内回复“是”确认)`);
|
|
4798
|
-
const confirm = await session.prompt(3e4);
|
|
4799
|
-
if (confirm !== "是") return "已取消操作。";
|
|
4800
|
-
await ctx.database.upsert("ggcevo_pk", [{
|
|
4801
|
-
handle,
|
|
4802
|
-
enable: !currentState,
|
|
4803
|
-
lastToggle: /* @__PURE__ */ new Date(),
|
|
4804
|
-
// 保持其他字段不变
|
|
4805
|
-
total: pkRecord?.total || 0,
|
|
4806
|
-
wins: pkRecord?.wins || 0,
|
|
4807
|
-
todayCount: pkRecord?.todayCount || 0,
|
|
4808
|
-
lastPK: pkRecord?.lastPK || /* @__PURE__ */ new Date(0)
|
|
4809
|
-
}], ["handle"]);
|
|
4810
|
-
return `PK状态已${!currentState ? "开启" : "关闭"},下次可切换时间:${new Date(Date.now() + 3 * 864e5).toLocaleDateString("zh-CN", {
|
|
4811
|
-
year: "numeric",
|
|
4812
|
-
month: "2-digit",
|
|
4813
|
-
day: "2-digit"
|
|
4814
|
-
})}`;
|
|
4815
|
-
});
|
|
4816
4790
|
ctx.command("ggcevo/武器库 [type]").usage("输入“武器库”查看类型,或“武器库 类型”查看详细武器信息").action(async ({ session }, type) => {
|
|
4817
4791
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4818
4792
|
if (!profile) return "⚠️ 需要先绑定游戏句柄";
|
|
@@ -5153,11 +5127,19 @@ ${validTypes.join("、")}`;
|
|
|
5153
5127
|
const processModInstallation = /* @__PURE__ */ __name(async () => {
|
|
5154
5128
|
const modInfo = modConfig[mod];
|
|
5155
5129
|
if (!modInfo) return "无效模块名称。";
|
|
5130
|
+
if (!weapon || !weaponConfig[weapon]?.id) {
|
|
5131
|
+
const validWeapons = Object.keys(weaponConfig).filter((k) => weaponConfig[k].id);
|
|
5132
|
+
return `❌ 无效武器名称。可选武器:${validWeapons.join("、")}`;
|
|
5133
|
+
}
|
|
5134
|
+
const weaponId = weaponConfig[weapon].id;
|
|
5156
5135
|
const [equipment] = await ctx.database.get("ggcevo_equipment", {
|
|
5157
5136
|
handle,
|
|
5158
|
-
weaponId
|
|
5137
|
+
weaponId
|
|
5138
|
+
// 使用已验证的weaponId
|
|
5159
5139
|
});
|
|
5160
|
-
if (!equipment)
|
|
5140
|
+
if (!equipment) {
|
|
5141
|
+
return `❌ 尚未获得【${weapon}】或武器名称错误`;
|
|
5142
|
+
}
|
|
5161
5143
|
if (modInfo.isExclusive) {
|
|
5162
5144
|
if (modInfo.exclusiveTo !== weapon) return `❌ 该模块只能安装在${modInfo.exclusiveTo}上。`;
|
|
5163
5145
|
const hasExclusive = equipment.installedMods.some((m) => modConfig[m]?.isExclusive);
|
|
@@ -5971,9 +5953,9 @@ ${scatterEffectMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5971
5953
|
try {
|
|
5972
5954
|
if (faction === "人类联盟") {
|
|
5973
5955
|
if (userCoins < 1e3) {
|
|
5974
|
-
return `加入人类联盟需要1000
|
|
5956
|
+
return `加入人类联盟需要1000金币,您当前拥有${userCoins}金币`;
|
|
5975
5957
|
}
|
|
5976
|
-
await session.send(
|
|
5958
|
+
await session.send(`请问您确定要缴纳1000金币加入人类联盟吗?(请在30秒内输入“是”确定加入)`);
|
|
5977
5959
|
const cost = await session.prompt(3e4);
|
|
5978
5960
|
if (cost !== "是") return "已取消加入。";
|
|
5979
5961
|
await ctx.database.upsert("ggcevo_sign", [{
|
|
@@ -5990,12 +5972,9 @@ ${scatterEffectMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5990
5972
|
} else if (faction === "辛迪加海盗") {
|
|
5991
5973
|
const [pkData] = await ctx.database.get("ggcevo_pk", { handle });
|
|
5992
5974
|
if (userCoins < 2e3) {
|
|
5993
|
-
return `加入辛迪加海盗需要缴纳2000
|
|
5994
|
-
}
|
|
5995
|
-
if (pkData && !pkData?.enable) {
|
|
5996
|
-
return "当前PK功能未开启,无法加入辛迪加海盗。";
|
|
5975
|
+
return `加入辛迪加海盗需要缴纳2000金币,您当前拥有${userCoins}金币`;
|
|
5997
5976
|
}
|
|
5998
|
-
await session.send(
|
|
5977
|
+
await session.send(`请问您确定要缴纳2000金币加入辛迪加海盗吗?(请在30秒内输入“是”确定加入)`);
|
|
5999
5978
|
const cost = await session.prompt(3e4);
|
|
6000
5979
|
if (cost !== "是") return "已取消加入。";
|
|
6001
5980
|
await ctx.database.upsert("ggcevo_sign", [{
|
|
@@ -6089,8 +6068,7 @@ ${scatterEffectMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
6089
6068
|
}
|
|
6090
6069
|
await ctx.database.upsert("ggcevo_careers", [{
|
|
6091
6070
|
handle,
|
|
6092
|
-
career: profession
|
|
6093
|
-
date: /* @__PURE__ */ new Date()
|
|
6071
|
+
career: profession
|
|
6094
6072
|
}], ["handle"]);
|
|
6095
6073
|
return `${careerData.group === "辛迪加海盗" ? `花费${targetProfession.costredcrystal}红晶` : `花费${targetProfession.costcoins}金币`}转职成功!当前职业:${profession}`;
|
|
6096
6074
|
} catch (err) {
|
|
@@ -6110,14 +6088,17 @@ ${scatterEffectMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
6110
6088
|
const config2 = careerData.group === "辛迪加海盗" ? syndicatePirateConfig : spaceStationCrewConfig;
|
|
6111
6089
|
const profession = config2.find((p) => p.professionName === careerData.career);
|
|
6112
6090
|
const effectDisplay = profession?.effect || "暂无特殊效果";
|
|
6113
|
-
const joinDate = new Date(careerData.date);
|
|
6091
|
+
const joinDate = convertUTCtoChinaTime(new Date(careerData.date));
|
|
6114
6092
|
const formattedDate = `${joinDate.getFullYear()}年${joinDate.getMonth() + 1}月${joinDate.getDate()}日`;
|
|
6093
|
+
const powerValue = await calculateTotalPower(handle);
|
|
6115
6094
|
const infoCard = [
|
|
6116
6095
|
`🎮 游戏句柄:${handle}`,
|
|
6096
|
+
`⚔️ 当前战力:${powerValue}`,
|
|
6097
|
+
// 新增战力显示行
|
|
6117
6098
|
`🎯 当前阵营:${careerData.group}`,
|
|
6118
6099
|
`👔 当前职业:${careerData.career}`,
|
|
6119
6100
|
`✨ 职业效果:${effectDisplay}`,
|
|
6120
|
-
`🗓️
|
|
6101
|
+
`🗓️ 加入时间:${formattedDate}`
|
|
6121
6102
|
];
|
|
6122
6103
|
if (careerData.group === "人类联盟") {
|
|
6123
6104
|
const techEntries = await ctx.database.get("ggcevo_tech", { handle });
|