koishi-plugin-ggcevo-game 1.3.22 → 1.3.24
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.d.ts +0 -6
- package/lib/index.js +365 -472
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -41,8 +41,8 @@ var Config = import_koishi.Schema.intersect([
|
|
|
41
41
|
}).description("赛季配置"),
|
|
42
42
|
// 核心功能开关组
|
|
43
43
|
import_koishi.Schema.object({
|
|
44
|
-
signrequire: import_koishi.Schema.boolean().description("游戏对局签到要求").default(
|
|
45
|
-
autorank: import_koishi.Schema.boolean().description("自动同步天梯数据").default(
|
|
44
|
+
signrequire: import_koishi.Schema.boolean().description("游戏对局签到要求").default(false),
|
|
45
|
+
autorank: import_koishi.Schema.boolean().description("自动同步天梯数据").default(false)
|
|
46
46
|
}).description("功能开关"),
|
|
47
47
|
// 对战系统配置组
|
|
48
48
|
import_koishi.Schema.object({
|
|
@@ -184,13 +184,6 @@ function apply(ctx, config) {
|
|
|
184
184
|
}, {
|
|
185
185
|
primary: "handle"
|
|
186
186
|
});
|
|
187
|
-
ctx.model.extend("ggcevo_achievements", {
|
|
188
|
-
handle: "string",
|
|
189
|
-
achievementname: "string",
|
|
190
|
-
gaintime: "timestamp"
|
|
191
|
-
}, {
|
|
192
|
-
primary: ["handle", "achievementname"]
|
|
193
|
-
});
|
|
194
187
|
ctx.model.extend("ggcevo_pk", {
|
|
195
188
|
handle: "string",
|
|
196
189
|
name: "string",
|
|
@@ -520,11 +513,11 @@ function apply(ctx, config) {
|
|
|
520
513
|
},
|
|
521
514
|
{
|
|
522
515
|
name: "精灵双倍",
|
|
523
|
-
effect: "
|
|
516
|
+
effect: "下一次击败首领时可获得双倍的金币和咕咕币奖励"
|
|
524
517
|
},
|
|
525
518
|
{
|
|
526
519
|
name: "喵喵财源",
|
|
527
|
-
effect: "
|
|
520
|
+
effect: "签到获得双倍的金币和咕咕币"
|
|
528
521
|
},
|
|
529
522
|
{
|
|
530
523
|
name: "暴击韵律",
|
|
@@ -1671,35 +1664,36 @@ function apply(ctx, config) {
|
|
|
1671
1664
|
return { updatedHP, messages };
|
|
1672
1665
|
}, "handleBloodCount"),
|
|
1673
1666
|
// 修改后的伽马枪辐射处理
|
|
1674
|
-
handleGammaRadiation: /* @__PURE__ */ __name(async (ctx2, targetBoss,
|
|
1675
|
-
if (
|
|
1667
|
+
handleGammaRadiation: /* @__PURE__ */ __name(async (ctx2, targetBoss, weaponName) => {
|
|
1668
|
+
if (weaponName !== "伽马枪" || targetBoss.tags.includes("机械") || !targetBoss.tags.includes("生物")) {
|
|
1676
1669
|
return null;
|
|
1677
1670
|
}
|
|
1678
1671
|
const messages = [];
|
|
1679
1672
|
const hasRadiation = targetBoss.skills.includes("辐射");
|
|
1680
1673
|
const currentLayers = targetBoss.Vulnerability || 0;
|
|
1681
|
-
const
|
|
1674
|
+
const skillUpdates = [];
|
|
1682
1675
|
const newLayers = hasRadiation ? Math.min(currentLayers + 1, 100) : 1;
|
|
1683
1676
|
let layerMsg;
|
|
1684
|
-
0;
|
|
1685
1677
|
if (!hasRadiation) {
|
|
1686
1678
|
layerMsg = `☢️ ${targetBoss.name} 获得【辐射】效果`;
|
|
1679
|
+
skillUpdates.push({
|
|
1680
|
+
name: targetBoss.name,
|
|
1681
|
+
add: ["辐射"]
|
|
1682
|
+
});
|
|
1687
1683
|
} else if (newLayers === currentLayers) {
|
|
1688
1684
|
layerMsg = `☢️ 辐射层数已达上限(100层)`;
|
|
1689
1685
|
} else {
|
|
1690
|
-
layerMsg = `☢️
|
|
1686
|
+
layerMsg = `☢️ 辐射层数+1`;
|
|
1691
1687
|
}
|
|
1692
1688
|
await ctx2.database.set(
|
|
1693
1689
|
"ggcevo_boss",
|
|
1694
1690
|
{ name: targetBoss.name },
|
|
1695
1691
|
{
|
|
1696
|
-
skills: Array.from(new Set(newSkills)),
|
|
1697
|
-
// 显式类型断言
|
|
1698
1692
|
Vulnerability: newLayers
|
|
1699
1693
|
}
|
|
1700
1694
|
);
|
|
1701
1695
|
messages.push(layerMsg);
|
|
1702
|
-
return { messages };
|
|
1696
|
+
return { messages, skillUpdates };
|
|
1703
1697
|
}, "handleGammaRadiation"),
|
|
1704
1698
|
// 伽马枪辐射计算(返回增伤系数)
|
|
1705
1699
|
calculateRadiationDamage: /* @__PURE__ */ __name((targetBoss) => {
|
|
@@ -1809,14 +1803,10 @@ function apply(ctx, config) {
|
|
|
1809
1803
|
if (sentryResult) {
|
|
1810
1804
|
messages.push(...sentryResult.messages);
|
|
1811
1805
|
}
|
|
1812
|
-
const gammaRadResult = await this.handleGammaRadiation(
|
|
1813
|
-
ctx2,
|
|
1814
|
-
targetBoss,
|
|
1815
|
-
weaponData
|
|
1816
|
-
// 传入武器数据对象
|
|
1817
|
-
);
|
|
1806
|
+
const gammaRadResult = await this.handleGammaRadiation(ctx2, targetBoss, weaponName);
|
|
1818
1807
|
if (gammaRadResult) {
|
|
1819
1808
|
messages.push(...gammaRadResult.messages);
|
|
1809
|
+
skillUpdates.push(...gammaRadResult.skillUpdates);
|
|
1820
1810
|
}
|
|
1821
1811
|
return {
|
|
1822
1812
|
currentHP,
|
|
@@ -1825,40 +1815,71 @@ function apply(ctx, config) {
|
|
|
1825
1815
|
initialDamage: finalDamage
|
|
1826
1816
|
};
|
|
1827
1817
|
}, "handlePassives"),
|
|
1828
|
-
//
|
|
1818
|
+
// 应用技能更新到数据库(优化合并同名boss的更新)
|
|
1829
1819
|
applySkillUpdates: /* @__PURE__ */ __name(async (ctx2, skillUpdates) => {
|
|
1830
|
-
const
|
|
1831
|
-
const
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1820
|
+
const mergedUpdates = skillUpdates.reduce((acc, update) => {
|
|
1821
|
+
const existing = acc.find((u) => u.name === update.name);
|
|
1822
|
+
if (existing) {
|
|
1823
|
+
if (update.remove) {
|
|
1824
|
+
existing.remove = [.../* @__PURE__ */ new Set([...existing.remove, ...update.remove])];
|
|
1825
|
+
}
|
|
1826
|
+
if (update.add) {
|
|
1827
|
+
existing.add = [.../* @__PURE__ */ new Set([...existing.add, ...update.add])];
|
|
1828
|
+
}
|
|
1829
|
+
} else {
|
|
1830
|
+
acc.push({
|
|
1831
|
+
name: update.name,
|
|
1832
|
+
remove: [...new Set(update.remove || [])],
|
|
1833
|
+
add: [...new Set(update.add || [])]
|
|
1834
|
+
});
|
|
1835
|
+
}
|
|
1836
|
+
return acc;
|
|
1837
|
+
}, []);
|
|
1838
|
+
const updates = mergedUpdates.map(async (update) => {
|
|
1839
|
+
const [boss] = await ctx2.database.get("ggcevo_boss", { name: update.name });
|
|
1840
|
+
if (!boss) return;
|
|
1841
|
+
let newSkills = [...boss.skills];
|
|
1842
|
+
if (update.remove?.length) {
|
|
1843
|
+
newSkills = newSkills.filter((s) => !update.remove.includes(s));
|
|
1844
|
+
}
|
|
1845
|
+
if (update.add?.length) {
|
|
1846
|
+
newSkills = [...newSkills, ...update.add];
|
|
1847
|
+
newSkills = [...new Set(newSkills)];
|
|
1848
|
+
}
|
|
1837
1849
|
return ctx2.database.set(
|
|
1838
1850
|
"ggcevo_boss",
|
|
1839
1851
|
{ name: update.name },
|
|
1840
|
-
{ skills:
|
|
1841
|
-
// 去重
|
|
1852
|
+
{ skills: newSkills }
|
|
1842
1853
|
);
|
|
1843
1854
|
});
|
|
1844
1855
|
await Promise.all(updates);
|
|
1845
1856
|
}, "applySkillUpdates")
|
|
1846
1857
|
};
|
|
1847
|
-
async function handleBossDefeatRewards(ctx2, targetBoss
|
|
1858
|
+
async function handleBossDefeatRewards(ctx2, targetBoss) {
|
|
1848
1859
|
const damageRecords = await ctx2.database.select("ggcevo_boss_damage").where({
|
|
1849
1860
|
bossGroupId: targetBoss.groupId,
|
|
1850
1861
|
totalDamage: { $gt: 0 }
|
|
1851
1862
|
}).orderBy("totalDamage", "desc").execute();
|
|
1852
1863
|
const rewardMessages = [];
|
|
1853
1864
|
const rewardMap = /* @__PURE__ */ new Map();
|
|
1854
|
-
const updatePromises = [];
|
|
1855
1865
|
const handles = damageRecords.map((r) => r.handle);
|
|
1856
|
-
const pirateCleaners = await
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1866
|
+
const [pirateCleaners, doubleWishRecords] = await Promise.all([
|
|
1867
|
+
ctx2.database.get("ggcevo_careers", {
|
|
1868
|
+
handle: { $in: handles },
|
|
1869
|
+
group: "辛迪加海盗",
|
|
1870
|
+
career: "清洁工"
|
|
1871
|
+
}),
|
|
1872
|
+
// 获取双倍祈愿信息
|
|
1873
|
+
ctx2.database.get("ggcevo_Wish_Record", {
|
|
1874
|
+
handle: { $in: handles },
|
|
1875
|
+
wishname: "精灵双倍",
|
|
1876
|
+
startTime: { $lte: /* @__PURE__ */ new Date() },
|
|
1877
|
+
endTime: { $gte: /* @__PURE__ */ new Date() },
|
|
1878
|
+
isused: false
|
|
1879
|
+
})
|
|
1880
|
+
]);
|
|
1861
1881
|
const cleanerHandles = new Set(pirateCleaners.map((c) => c.handle));
|
|
1882
|
+
const doubleWishHandles = new Set(doubleWishRecords.map((r) => r.handle));
|
|
1862
1883
|
if (damageRecords.length > 0) {
|
|
1863
1884
|
const top20 = damageRecords.slice(0, 20);
|
|
1864
1885
|
top20.forEach((record, index) => {
|
|
@@ -1882,6 +1903,10 @@ function apply(ctx, config) {
|
|
|
1882
1903
|
gold = 1e3;
|
|
1883
1904
|
break;
|
|
1884
1905
|
}
|
|
1906
|
+
if (doubleWishHandles.has(record.handle)) {
|
|
1907
|
+
guguCoins *= 2;
|
|
1908
|
+
gold *= 2;
|
|
1909
|
+
}
|
|
1885
1910
|
let redCrystal = 0;
|
|
1886
1911
|
if (cleanerHandles.has(record.handle)) {
|
|
1887
1912
|
switch (true) {
|
|
@@ -1917,18 +1942,22 @@ function apply(ctx, config) {
|
|
|
1917
1942
|
const others = damageRecords.slice(20);
|
|
1918
1943
|
if (others.length > 0) {
|
|
1919
1944
|
others.forEach((record) => {
|
|
1945
|
+
let guguCoins = 3;
|
|
1946
|
+
let gold = 200;
|
|
1947
|
+
if (doubleWishHandles.has(record.handle)) {
|
|
1948
|
+
guguCoins *= 2;
|
|
1949
|
+
gold *= 2;
|
|
1950
|
+
}
|
|
1920
1951
|
const baseReward = {
|
|
1921
|
-
guguCoins
|
|
1922
|
-
gold
|
|
1952
|
+
guguCoins,
|
|
1953
|
+
gold,
|
|
1923
1954
|
redCrystal: cleanerHandles.has(record.handle) ? 3 : 0,
|
|
1924
1955
|
playerName: record.playerName
|
|
1925
1956
|
};
|
|
1926
1957
|
rewardMap.set(record.handle, baseReward);
|
|
1927
1958
|
});
|
|
1928
|
-
rewardMessages.push(`其他参与者各获得: 3 咕咕币 + 200 金币` + (cleanerHandles.size > 0 ? " (清洁工额外+3红晶)" : ""));
|
|
1959
|
+
rewardMessages.push(`其他参与者各获得: 3 咕咕币 + 200 金币` + (cleanerHandles.size > 0 ? " (清洁工额外+3红晶)" : "") + (doubleWishHandles.size > 0 ? " (精灵双倍祈愿玩家奖励翻倍)" : ""));
|
|
1929
1960
|
}
|
|
1930
|
-
const doubleRewardPlayers = await handleDoubleRewards(ctx2, damageRecords, rewardMap);
|
|
1931
|
-
await applyDoubleRewards(ctx2, doubleRewardPlayers, rewardMap, rewardMessages);
|
|
1932
1961
|
await ctx2.database.withTransaction(async () => {
|
|
1933
1962
|
for (const [handle, reward] of rewardMap) {
|
|
1934
1963
|
const [signData] = await ctx2.database.get("ggcevo_sign", { handle });
|
|
@@ -1958,58 +1987,6 @@ function apply(ctx, config) {
|
|
|
1958
1987
|
return { rewardMessages };
|
|
1959
1988
|
}
|
|
1960
1989
|
__name(handleBossDefeatRewards, "handleBossDefeatRewards");
|
|
1961
|
-
async function handleDoubleRewards(ctx2, damageRecords, rewardMap) {
|
|
1962
|
-
const doubleRewardPlayers = /* @__PURE__ */ new Map();
|
|
1963
|
-
for (const record of damageRecords) {
|
|
1964
|
-
const [elfEffect] = await ctx2.database.get("ggcevo_Wish_Record", {
|
|
1965
|
-
handle: record.handle,
|
|
1966
|
-
wishname: "精灵双倍",
|
|
1967
|
-
isused: false,
|
|
1968
|
-
startTime: { $lte: /* @__PURE__ */ new Date() },
|
|
1969
|
-
endTime: { $gte: /* @__PURE__ */ new Date() }
|
|
1970
|
-
});
|
|
1971
|
-
if (elfEffect) {
|
|
1972
|
-
doubleRewardPlayers.set(record.handle, {
|
|
1973
|
-
effect: elfEffect,
|
|
1974
|
-
originalReward: {
|
|
1975
|
-
guguCoins: rewardMap.get(record.handle)?.guguCoins || 0,
|
|
1976
|
-
gold: rewardMap.get(record.handle)?.gold || 0
|
|
1977
|
-
}
|
|
1978
|
-
});
|
|
1979
|
-
}
|
|
1980
|
-
}
|
|
1981
|
-
return doubleRewardPlayers;
|
|
1982
|
-
}
|
|
1983
|
-
__name(handleDoubleRewards, "handleDoubleRewards");
|
|
1984
|
-
async function applyDoubleRewards(ctx2, doubleRewardPlayers, rewardMap, rewardMessages) {
|
|
1985
|
-
if (doubleRewardPlayers.size > 0) {
|
|
1986
|
-
await ctx2.database.withTransaction(async () => {
|
|
1987
|
-
for (const [handle, data] of doubleRewardPlayers) {
|
|
1988
|
-
const reward = rewardMap.get(handle);
|
|
1989
|
-
reward.guguCoins = data.originalReward.guguCoins * 2;
|
|
1990
|
-
reward.gold = data.originalReward.gold * 2;
|
|
1991
|
-
await ctx2.database.set(
|
|
1992
|
-
"ggcevo_Wish_Record",
|
|
1993
|
-
{ id: data.effect.id },
|
|
1994
|
-
{ isused: true }
|
|
1995
|
-
);
|
|
1996
|
-
}
|
|
1997
|
-
});
|
|
1998
|
-
rewardMessages.forEach((msg, index) => {
|
|
1999
|
-
const match = msg.match(/(\d+\.) (.+?) 获得奖励/);
|
|
2000
|
-
if (match) {
|
|
2001
|
-
const playerName = match[2];
|
|
2002
|
-
const targetHandle = [...rewardMap.keys()].find(
|
|
2003
|
-
(key) => rewardMap.get(key).playerName === playerName
|
|
2004
|
-
);
|
|
2005
|
-
if (targetHandle && doubleRewardPlayers.has(targetHandle)) {
|
|
2006
|
-
rewardMessages[index] = `${match[1]} ${playerName} 🧚 获得双倍奖励: ${rewardMap.get(targetHandle).guguCoins} 咕咕币 + ${rewardMap.get(targetHandle).gold} 金币(精灵双倍祈愿生效)`;
|
|
2007
|
-
}
|
|
2008
|
-
}
|
|
2009
|
-
});
|
|
2010
|
-
}
|
|
2011
|
-
}
|
|
2012
|
-
__name(applyDoubleRewards, "applyDoubleRewards");
|
|
2013
1990
|
async function checkTransferRequirements(ctx2, handle, profession) {
|
|
2014
1991
|
const [mainBoss] = await ctx2.database.get("ggcevo_boss", {
|
|
2015
1992
|
type: "主宰",
|
|
@@ -2136,18 +2113,18 @@ function apply(ctx, config) {
|
|
|
2136
2113
|
handle,
|
|
2137
2114
|
totalRewards: (signRecords[0]?.totalRewards || 0) + damageValue
|
|
2138
2115
|
}], ["handle"]);
|
|
2139
|
-
const damageRecords = await ctx.database.get("ggcevo_boss_damage", { handle });
|
|
2116
|
+
const [damageRecords] = await ctx.database.get("ggcevo_boss_damage", { handle });
|
|
2140
2117
|
await ctx.database.upsert("ggcevo_boss_damage", [{
|
|
2141
2118
|
handle,
|
|
2142
2119
|
playerName: session.username,
|
|
2143
|
-
totalDamage: (damageRecords
|
|
2144
|
-
attackCount: damageRecords
|
|
2120
|
+
totalDamage: (damageRecords?.totalDamage || 0) + damageValue,
|
|
2121
|
+
attackCount: damageRecords?.attackCount || 0,
|
|
2145
2122
|
bossGroupId: 4
|
|
2146
2123
|
}], ["handle"]);
|
|
2147
2124
|
});
|
|
2148
2125
|
return {
|
|
2149
2126
|
success: true,
|
|
2150
|
-
message:
|
|
2127
|
+
message: `成功引爆 ${itemName},造成 ${damageValue} 点伤害,获得等额金币`
|
|
2151
2128
|
};
|
|
2152
2129
|
}
|
|
2153
2130
|
if (itemConfig2.id === 2) {
|
|
@@ -2211,7 +2188,7 @@ function apply(ctx, config) {
|
|
|
2211
2188
|
}
|
|
2212
2189
|
const [signInfo] = await ctx.database.get("ggcevo_sign", { handle });
|
|
2213
2190
|
if (signInfo?.totalRewards < actualCost) {
|
|
2214
|
-
const originalHint = careerData.career === "情报副官" ?
|
|
2191
|
+
const originalHint = careerData.career === "情报副官" ? `(原价${levelData.cost})` : "";
|
|
2215
2192
|
return `❌ 需要 ${actualCost} 金币${originalHint},当前持有:${signInfo?.totalRewards || 0}`;
|
|
2216
2193
|
}
|
|
2217
2194
|
await ctx.database.withTransaction(async () => {
|
|
@@ -2224,9 +2201,11 @@ function apply(ctx, config) {
|
|
|
2224
2201
|
level: nextLevel
|
|
2225
2202
|
}], ["handle", "techId"]);
|
|
2226
2203
|
});
|
|
2227
|
-
const
|
|
2204
|
+
const costLine = careerData.career === "情报副官" ? `💰 花费金币: ${actualCost}(原价${levelData.cost})` : `💰 花费金币: ${actualCost}`;
|
|
2205
|
+
const discountHint = careerData.career === "情报副官" ? `📉 情报副官职业加成:20%折扣
|
|
2206
|
+
` : "";
|
|
2228
2207
|
return `✅ ${tech.techname} 升级至 Lv.${nextLevel}
|
|
2229
|
-
|
|
2208
|
+
${discountHint}${costLine}
|
|
2230
2209
|
📝 ${levelData.description}
|
|
2231
2210
|
💼 ${levelData.careerBonus}`;
|
|
2232
2211
|
}
|
|
@@ -2237,36 +2216,42 @@ function apply(ctx, config) {
|
|
|
2237
2216
|
handle,
|
|
2238
2217
|
weaponId: weaponData.id
|
|
2239
2218
|
});
|
|
2240
|
-
if (!equipment) return "❌
|
|
2241
|
-
if (equipment.level >= 6) return "❌
|
|
2219
|
+
if (!equipment) return "❌ 您尚未获得该武器";
|
|
2220
|
+
if (equipment.level >= 6) return "❌ 该武器已达最高等级";
|
|
2242
2221
|
const BASE_COST = [1050, 1450, 1850, 2250, 2650, 3050];
|
|
2243
2222
|
const baseCost = BASE_COST[equipment.level];
|
|
2244
2223
|
const weaponTechConfig = Spacestationtechnology.find((t) => t.techId === 2);
|
|
2245
2224
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
2246
|
-
let
|
|
2247
|
-
let
|
|
2248
|
-
|
|
2249
|
-
let baseDiscount;
|
|
2250
|
-
let careerDiscount;
|
|
2225
|
+
let techLevel = 0;
|
|
2226
|
+
let totalDiscount = 0;
|
|
2227
|
+
const discountDetails = [];
|
|
2251
2228
|
if (careerData?.group === "人类联盟") {
|
|
2252
2229
|
const [weaponTech] = await ctx.database.get("ggcevo_tech", { handle, techId: 2 }).catch(() => [{ level: 0 }]);
|
|
2253
2230
|
techLevel = Math.min(Math.max(weaponTech?.level || 0, 0), 5);
|
|
2254
2231
|
const isCareerMatch = weaponTechConfig?.careerNames.includes(careerData?.career);
|
|
2255
2232
|
const BASE_DISCOUNTS = [5, 10, 15, 20, 25];
|
|
2256
2233
|
const CAREER_DISCOUNTS = [10, 20, 30, 40, 50];
|
|
2257
|
-
baseDiscount = techLevel > 0 ? BASE_DISCOUNTS[techLevel - 1] : 0;
|
|
2258
|
-
careerDiscount = isCareerMatch && techLevel > 0 ? CAREER_DISCOUNTS[techLevel - 1] : 0;
|
|
2259
|
-
weaponDiscount = Math.max(baseDiscount, careerDiscount)
|
|
2260
|
-
|
|
2234
|
+
const baseDiscount = techLevel > 0 ? BASE_DISCOUNTS[techLevel - 1] : 0;
|
|
2235
|
+
const careerDiscount = isCareerMatch && techLevel > 0 ? CAREER_DISCOUNTS[techLevel - 1] : 0;
|
|
2236
|
+
const weaponDiscount = Math.max(baseDiscount, careerDiscount);
|
|
2237
|
+
if (weaponDiscount > 0) {
|
|
2238
|
+
totalDiscount += weaponDiscount;
|
|
2239
|
+
discountDetails.push(
|
|
2240
|
+
`武器系统 Lv${techLevel}${isCareerMatch ? "(科技职业加成)" : ""}:${weaponDiscount}%)`
|
|
2241
|
+
);
|
|
2242
|
+
}
|
|
2261
2243
|
}
|
|
2262
2244
|
const activeWish = await checkFoxBlessing(handle);
|
|
2263
2245
|
if (activeWish) {
|
|
2264
|
-
|
|
2246
|
+
totalDiscount += 20;
|
|
2247
|
+
discountDetails.push("灵狐升运祈愿生效:20%");
|
|
2265
2248
|
}
|
|
2249
|
+
totalDiscount = Math.min(totalDiscount, 100);
|
|
2250
|
+
const discountedCost = baseCost * (100 - totalDiscount) / 100;
|
|
2266
2251
|
const actualCost = Math.floor(discountedCost);
|
|
2267
2252
|
const [signInfo] = await ctx.database.get("ggcevo_sign", { handle });
|
|
2268
2253
|
if (signInfo?.totalRewards < actualCost) {
|
|
2269
|
-
return `❌ 需要 ${actualCost}
|
|
2254
|
+
return `❌ 需要 ${actualCost} 金币(原价${baseCost}),当前持有:${signInfo?.totalRewards || 0}`;
|
|
2270
2255
|
}
|
|
2271
2256
|
await ctx.database.withTransaction(async () => {
|
|
2272
2257
|
await ctx.database.set("ggcevo_sign", { handle }, {
|
|
@@ -2291,20 +2276,14 @@ function apply(ctx, config) {
|
|
|
2291
2276
|
const newLevel = equipment.level + 1;
|
|
2292
2277
|
const damage = (weaponData.damage * (1 + 0.1 * newLevel)).toFixed(1);
|
|
2293
2278
|
let msg = `${target} 升级成功!Lv.${newLevel}`;
|
|
2294
|
-
const priceInfo =
|
|
2295
|
-
💸 消耗:${actualCost}
|
|
2296
|
-
💸 消耗:${actualCost}
|
|
2279
|
+
const priceInfo = totalDiscount > 0 ? `
|
|
2280
|
+
💸 消耗:${actualCost}金币 (原价${baseCost})` : `
|
|
2281
|
+
💸 消耗:${actualCost}金币`;
|
|
2297
2282
|
msg += priceInfo;
|
|
2298
|
-
let discountDetails = [];
|
|
2299
|
-
if (weaponDiscount > 0) {
|
|
2300
|
-
discountDetails.push(`${Math.round(weaponDiscount * 100)}% (武器系统 Lv${techLevel})`);
|
|
2301
|
-
}
|
|
2302
|
-
if (activeWish) {
|
|
2303
|
-
discountDetails.push("20% (灵狐升运祈愿生效)");
|
|
2304
|
-
}
|
|
2305
2283
|
if (discountDetails.length > 0) {
|
|
2306
2284
|
msg += `
|
|
2307
|
-
🔧
|
|
2285
|
+
🔧 折扣:
|
|
2286
|
+
${discountDetails.join("\n▸ ")}`;
|
|
2308
2287
|
}
|
|
2309
2288
|
msg += `
|
|
2310
2289
|
💥 伤害:${damage}`;
|
|
@@ -2343,14 +2322,11 @@ function apply(ctx, config) {
|
|
|
2343
2322
|
const level = `${index}→${index + 1}`;
|
|
2344
2323
|
let finalPrice = baseCost;
|
|
2345
2324
|
if (hasTechDiscount || hasFoxDiscount) {
|
|
2346
|
-
let
|
|
2347
|
-
if (hasTechDiscount)
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
discounted *= 0.8;
|
|
2352
|
-
}
|
|
2353
|
-
finalPrice = Math.floor(discounted);
|
|
2325
|
+
let totalDiscount = 0;
|
|
2326
|
+
if (hasTechDiscount) totalDiscount += techDiscountRate;
|
|
2327
|
+
if (hasFoxDiscount) totalDiscount += foxDiscount;
|
|
2328
|
+
totalDiscount = Math.min(totalDiscount, 100);
|
|
2329
|
+
finalPrice = Math.floor(baseCost * (1 - totalDiscount / 100));
|
|
2354
2330
|
}
|
|
2355
2331
|
const showOriginal = finalPrice < baseCost;
|
|
2356
2332
|
return [
|
|
@@ -2363,7 +2339,7 @@ function apply(ctx, config) {
|
|
|
2363
2339
|
discountNotice.push(`🔧 武器系统 Lv${techLevel} (${techDiscountRate}% 折扣)`);
|
|
2364
2340
|
}
|
|
2365
2341
|
if (hasFoxDiscount) {
|
|
2366
|
-
discountNotice.push("🦊
|
|
2342
|
+
discountNotice.push("🦊 灵狐升运祈愿 (20% 折扣)");
|
|
2367
2343
|
}
|
|
2368
2344
|
if (!hasTechDiscount && !hasFoxDiscount) {
|
|
2369
2345
|
discountNotice.push("💡 提示:加入人类联盟并升级武器系统可获得折扣");
|
|
@@ -2401,21 +2377,18 @@ function apply(ctx, config) {
|
|
|
2401
2377
|
let hiddenWinCount = 0;
|
|
2402
2378
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2403
2379
|
if (!profile) {
|
|
2404
|
-
return "🔒
|
|
2380
|
+
return "🔒 需要先绑定游戏句柄";
|
|
2405
2381
|
}
|
|
2406
2382
|
const { regionId, realmId, profileId } = profile;
|
|
2407
2383
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
2408
2384
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
2409
2385
|
if (existingEntries.length > 0) {
|
|
2410
|
-
return
|
|
2386
|
+
return `⛔ 您已被列入黑名单`;
|
|
2411
2387
|
}
|
|
2412
2388
|
const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 1 });
|
|
2413
|
-
|
|
2414
|
-
return "您还没有签到。";
|
|
2415
|
-
}
|
|
2416
|
-
const quantity = backpack.quantity;
|
|
2389
|
+
const quantity = backpack?.quantity;
|
|
2417
2390
|
if (quantity < 1) {
|
|
2418
|
-
return "
|
|
2391
|
+
return "您背包中的咕咕币不足";
|
|
2419
2392
|
}
|
|
2420
2393
|
await ctx.database.upsert("ggcevo_backpack", [{
|
|
2421
2394
|
handle,
|
|
@@ -2440,20 +2413,17 @@ function apply(ctx, config) {
|
|
|
2440
2413
|
const session = argv.session;
|
|
2441
2414
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2442
2415
|
if (!profile) {
|
|
2443
|
-
return "🔒
|
|
2416
|
+
return "🔒 需要先绑定游戏句柄";
|
|
2444
2417
|
}
|
|
2445
2418
|
const { regionId, realmId, profileId } = profile;
|
|
2446
2419
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
2447
2420
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
2448
2421
|
if (existingEntries.length > 0) {
|
|
2449
|
-
return
|
|
2422
|
+
return `⛔ 您已被列入黑名单`;
|
|
2450
2423
|
}
|
|
2451
2424
|
const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 1 });
|
|
2452
|
-
if (
|
|
2453
|
-
return "
|
|
2454
|
-
}
|
|
2455
|
-
if (backpack.quantity < 1) {
|
|
2456
|
-
return "您的咕咕币不足。";
|
|
2425
|
+
if (backpack?.quantity < 1) {
|
|
2426
|
+
return "您背包中的咕咕币不足";
|
|
2457
2427
|
}
|
|
2458
2428
|
await ctx.database.upsert("ggcevo_backpack", [{
|
|
2459
2429
|
handle,
|
|
@@ -2473,20 +2443,17 @@ function apply(ctx, config) {
|
|
|
2473
2443
|
let hiddenWinCount = 0;
|
|
2474
2444
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2475
2445
|
if (!profile) {
|
|
2476
|
-
return "🔒
|
|
2446
|
+
return "🔒 需要先绑定游戏句柄";
|
|
2477
2447
|
}
|
|
2478
2448
|
const { regionId, realmId, profileId } = profile;
|
|
2479
2449
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
2480
2450
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
2481
2451
|
if (existingEntries.length > 0) {
|
|
2482
|
-
return
|
|
2452
|
+
return `⛔ 您已被列入黑名单`;
|
|
2483
2453
|
}
|
|
2484
2454
|
const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 1 });
|
|
2485
|
-
if (
|
|
2486
|
-
return "
|
|
2487
|
-
}
|
|
2488
|
-
if (backpack.quantity < 10) {
|
|
2489
|
-
return "您的咕咕币不足。";
|
|
2455
|
+
if (backpack?.quantity < 10) {
|
|
2456
|
+
return "您背包中的咕咕币不足";
|
|
2490
2457
|
}
|
|
2491
2458
|
await ctx.database.upsert("ggcevo_backpack", [{
|
|
2492
2459
|
handle,
|
|
@@ -2502,35 +2469,19 @@ function apply(ctx, config) {
|
|
|
2502
2469
|
const [record] = await ctx.database.get("ggcevo_records", { handle });
|
|
2503
2470
|
return [
|
|
2504
2471
|
"十连抽结果:",
|
|
2505
|
-
...results.map((r) => r ? "
|
|
2472
|
+
...results.map((r) => r ? "🎉 获得兑换券" : "❌ 未中奖"),
|
|
2506
2473
|
`保底进度:${record.pityCounter}/90`,
|
|
2507
2474
|
...hiddenWinCount > 0 ? [`🎉 恭喜你抽中隐藏奖励,额外获得 ${hiddenWinCount} 张兑换券和 ${hiddenWinCount} 枚扭蛋币!`] : []
|
|
2508
2475
|
].join("\n");
|
|
2509
2476
|
});
|
|
2510
|
-
ctx.command("ggcevo/抽奖记录").action(async (argv) => {
|
|
2511
|
-
const session = argv.session;
|
|
2512
|
-
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2513
|
-
if (!profile) {
|
|
2514
|
-
return "🔒 需要先绑定游戏句柄。";
|
|
2515
|
-
}
|
|
2516
|
-
const { regionId, realmId, profileId } = profile;
|
|
2517
|
-
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
2518
|
-
const [record] = await ctx.database.get("ggcevo_records", { handle });
|
|
2519
|
-
return record ? [
|
|
2520
|
-
`总抽数:${record.totalPulls}`,
|
|
2521
|
-
`下次保底剩余:${90 - record.pityCounter}抽`,
|
|
2522
|
-
`已保底次数:${record.fullPityCount}`,
|
|
2523
|
-
...record.hiddenawards ? [`抽中隐藏奖励次数:${record.hiddenawards}`] : []
|
|
2524
|
-
].join("\n") : "您还没有进行过抽奖";
|
|
2525
|
-
});
|
|
2526
2477
|
ctx.command("ggcevo/背包").action(async (argv) => {
|
|
2527
2478
|
const session = argv.session;
|
|
2528
2479
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2529
|
-
if (!profile) return "🔒
|
|
2480
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
2530
2481
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
2531
2482
|
const items = await ctx.database.get("ggcevo_backpack", { handle });
|
|
2532
2483
|
const validItems = items.filter((item) => item.quantity > 0);
|
|
2533
|
-
if (!validItems.length) return "
|
|
2484
|
+
if (!validItems.length) return "您的背包空空如也。";
|
|
2534
2485
|
const itemDetails = validItems.map((userItem) => {
|
|
2535
2486
|
const entry = Object.entries(initDefaultItems).find(
|
|
2536
2487
|
([, item]) => item.id === userItem.itemId
|
|
@@ -2547,11 +2498,11 @@ ${itemDetails.join("\n")}`;
|
|
|
2547
2498
|
const session = argv.session;
|
|
2548
2499
|
let latestTime;
|
|
2549
2500
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2550
|
-
if (!profile) return "🔒
|
|
2501
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
2551
2502
|
const { regionId, realmId, profileId } = profile;
|
|
2552
2503
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
2553
2504
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
2554
|
-
if (existingEntries.length > 0) return "
|
|
2505
|
+
if (existingEntries.length > 0) return "⛔ 您已被列入黑名单";
|
|
2555
2506
|
const now = /* @__PURE__ */ new Date();
|
|
2556
2507
|
const currentChinaTime = convertUTCtoChinaTime(now);
|
|
2557
2508
|
if (config.signrequire) {
|
|
@@ -2569,7 +2520,7 @@ ${itemDetails.join("\n")}`;
|
|
|
2569
2520
|
} else {
|
|
2570
2521
|
latestTime = currentChinaTime;
|
|
2571
2522
|
}
|
|
2572
|
-
if (!latestTime) return "
|
|
2523
|
+
if (!latestTime) return "请游玩过“咕咕虫-evolved”后签到。";
|
|
2573
2524
|
const targetDateChina = new Date(latestTime);
|
|
2574
2525
|
targetDateChina.setUTCDate(targetDateChina.getUTCDate() + 1);
|
|
2575
2526
|
if (!isSameDate(latestTime, currentChinaTime) && !isSameDate(targetDateChina, currentChinaTime)) {
|
|
@@ -2592,15 +2543,10 @@ ${itemDetails.join("\n")}`;
|
|
|
2592
2543
|
monthlyDays = record.monthlyDays + 1;
|
|
2593
2544
|
}
|
|
2594
2545
|
}
|
|
2595
|
-
const
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
startTime: { $lte: now },
|
|
2599
|
-
endTime: { $gte: now },
|
|
2600
|
-
isused: false
|
|
2601
|
-
});
|
|
2546
|
+
const messages = [];
|
|
2547
|
+
let totalBonus = 0;
|
|
2548
|
+
let basePoints;
|
|
2602
2549
|
let tickets = 3;
|
|
2603
|
-
let points = getRandomInt(20, 40);
|
|
2604
2550
|
if (monthlyDays === 7) {
|
|
2605
2551
|
tickets = 4;
|
|
2606
2552
|
} else if (monthlyDays === 14) {
|
|
@@ -2610,62 +2556,61 @@ ${itemDetails.join("\n")}`;
|
|
|
2610
2556
|
} else if (monthlyDays === 28) {
|
|
2611
2557
|
tickets = 7;
|
|
2612
2558
|
}
|
|
2613
|
-
if (monthlyDays
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
points = getRandomInt(80, 100);
|
|
2619
|
-
} else if (monthlyDays >= 28) {
|
|
2620
|
-
points = getRandomInt(100, 200);
|
|
2621
|
-
}
|
|
2622
|
-
let redCrystal = 0;
|
|
2623
|
-
let effectMessage = "";
|
|
2624
|
-
let bonusMessage = "";
|
|
2625
|
-
let careerCrystalMessage = "";
|
|
2626
|
-
let cred17Message = "";
|
|
2627
|
-
let allianceBonusMessage = "";
|
|
2559
|
+
if (monthlyDays < 7) basePoints = getRandomInt(20, 40);
|
|
2560
|
+
else if (monthlyDays < 14) basePoints = getRandomInt(40, 60);
|
|
2561
|
+
else if (monthlyDays < 21) basePoints = getRandomInt(60, 80);
|
|
2562
|
+
else if (monthlyDays < 28) basePoints = getRandomInt(80, 100);
|
|
2563
|
+
else basePoints = getRandomInt(100, 200);
|
|
2628
2564
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
2629
2565
|
if (careerData?.group === "人类联盟") {
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
let miningBonus = 0;
|
|
2635
|
-
let miningMessage = "";
|
|
2636
|
-
const BASE_BONUS = [5, 10, 15, 20, 25];
|
|
2637
|
-
const CAREER_BONUS = [10, 20, 30, 40, 50];
|
|
2566
|
+
totalBonus += 0.2;
|
|
2567
|
+
messages.push("🏛️ 人类联盟阵营加成:金币+20%");
|
|
2568
|
+
const [userMiningTech] = await ctx.database.get("ggcevo_tech", { handle, techId: 1 }).catch(() => [{ level: 0 }]);
|
|
2569
|
+
const techLevel = Math.min(userMiningTech?.level || 0, 5);
|
|
2638
2570
|
const miningTechConfig = Spacestationtechnology.find((t) => t.techId === 1);
|
|
2639
2571
|
if (miningTechConfig) {
|
|
2640
|
-
const
|
|
2641
|
-
|
|
2642
|
-
techId: 1
|
|
2643
|
-
}).catch(() => [{ level: 0 }]);
|
|
2644
|
-
const techLevel = Math.min(Math.max(userMiningTech?.level || 0, 0), 5);
|
|
2645
|
-
const baseBonus = techLevel > 0 ? BASE_BONUS[techLevel - 1] : 0;
|
|
2572
|
+
const BASE_BONUS = [5, 10, 15, 20, 25];
|
|
2573
|
+
const baseTechBonus = techLevel > 0 ? BASE_BONUS[techLevel - 1] : 0;
|
|
2646
2574
|
let careerTechBonus = 0;
|
|
2647
|
-
if (careerData
|
|
2575
|
+
if (careerData.career && miningTechConfig.careerNames.includes(careerData.career)) {
|
|
2576
|
+
const CAREER_BONUS = [10, 20, 30, 40, 50];
|
|
2648
2577
|
careerTechBonus = techLevel > 0 ? CAREER_BONUS[techLevel - 1] : 0;
|
|
2649
2578
|
}
|
|
2650
|
-
|
|
2651
|
-
if (
|
|
2652
|
-
|
|
2653
|
-
|
|
2579
|
+
const finalBonus = Math.max(baseTechBonus, careerTechBonus);
|
|
2580
|
+
if (finalBonus > 0) {
|
|
2581
|
+
totalBonus += finalBonus / 100;
|
|
2582
|
+
messages.push(`⚙️ 采掘系统 Lv${techLevel} 加成:金币+${finalBonus}%`);
|
|
2654
2583
|
}
|
|
2655
2584
|
}
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
minerBonus = 50;
|
|
2660
|
-
minerMessage = `
|
|
2661
|
-
⛏️ 深空矿工职业加成:金币+50%`;
|
|
2585
|
+
if (careerData.career === "深空矿工") {
|
|
2586
|
+
totalBonus += 0.5;
|
|
2587
|
+
messages.push("⛏️ 深空矿工职业加成:金币+50%");
|
|
2662
2588
|
}
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2589
|
+
}
|
|
2590
|
+
if (careerData?.group === "辛迪加海盗") {
|
|
2591
|
+
const [cred17Item] = await ctx.database.get("ggcevo_warehouse", { handle, itemId: 3 });
|
|
2592
|
+
if (cred17Item?.quantity >= 1) {
|
|
2593
|
+
const currentGold = record?.totalRewards || 0;
|
|
2594
|
+
const additional = Math.min(Math.floor(currentGold / 100), 100);
|
|
2595
|
+
const credBonus = 0.5 + additional / 100;
|
|
2596
|
+
totalBonus += credBonus;
|
|
2597
|
+
messages.push(`💎 CRED-17生效:金币+50% 额外+${additional}%`);
|
|
2666
2598
|
}
|
|
2667
|
-
bonusMessage = miningMessage + minerMessage;
|
|
2668
2599
|
}
|
|
2600
|
+
const [meowEffect] = await ctx.database.get("ggcevo_Wish_Record", {
|
|
2601
|
+
handle,
|
|
2602
|
+
wishname: "喵喵财源",
|
|
2603
|
+
startTime: { $lte: now },
|
|
2604
|
+
endTime: { $gte: now },
|
|
2605
|
+
isused: false
|
|
2606
|
+
});
|
|
2607
|
+
if (meowEffect) {
|
|
2608
|
+
tickets *= 2;
|
|
2609
|
+
totalBonus += 1;
|
|
2610
|
+
messages.push("🐾 喵喵财源祈愿生效:咕咕币×2,金币+100%");
|
|
2611
|
+
}
|
|
2612
|
+
const finalPoints = Math.round(basePoints * (1 + totalBonus));
|
|
2613
|
+
let redCrystal = 0;
|
|
2669
2614
|
if (careerData?.group === "辛迪加海盗" && careerData.career === "辛迪加财务经理") {
|
|
2670
2615
|
if (monthlyDays < 7) {
|
|
2671
2616
|
redCrystal = 1;
|
|
@@ -2678,32 +2623,14 @@ ${itemDetails.join("\n")}`;
|
|
|
2678
2623
|
} else {
|
|
2679
2624
|
redCrystal = 5;
|
|
2680
2625
|
}
|
|
2681
|
-
|
|
2682
|
-
⚓ 辛迪加财务经理职业加成:获得 ${redCrystal} 红晶`;
|
|
2683
|
-
}
|
|
2684
|
-
if (careerData?.group === "辛迪加海盗") {
|
|
2685
|
-
const [cred17Item] = await ctx.database.get("ggcevo_warehouse", { handle, itemId: 3 });
|
|
2686
|
-
if (cred17Item?.quantity >= 1) {
|
|
2687
|
-
const currentGold = record?.totalRewards || 0;
|
|
2688
|
-
const additionalBonus = Math.min(Math.floor(currentGold / 100), 100);
|
|
2689
|
-
const totalBonus = 0.5 + additionalBonus * 0.01;
|
|
2690
|
-
points = Math.round(points * (1 + totalBonus));
|
|
2691
|
-
cred17Message = `
|
|
2692
|
-
💎 CRED-17生效:签到奖励+50%,当前金币${currentGold}(+${additionalBonus}%),总计加成+${(totalBonus * 100).toFixed(0)}%`;
|
|
2693
|
-
}
|
|
2694
|
-
}
|
|
2695
|
-
if (meowEffect) {
|
|
2696
|
-
tickets *= 2;
|
|
2697
|
-
points *= 2;
|
|
2698
|
-
effectMessage = "\n🐾 喵喵财源祈愿生效,获得双倍奖励(金币和咕咕币)!";
|
|
2626
|
+
messages.push(`⚓ 辛迪加财务经理职业加成:获得${redCrystal}枚红晶`);
|
|
2699
2627
|
}
|
|
2700
|
-
effectMessage += cred17Message;
|
|
2701
2628
|
await ctx.database.withTransaction(async () => {
|
|
2702
2629
|
await ctx.database.upsert("ggcevo_sign", [{
|
|
2703
2630
|
handle,
|
|
2704
2631
|
lastSign: now,
|
|
2705
2632
|
monthlyDays,
|
|
2706
|
-
totalRewards: (record?.totalRewards || 0) +
|
|
2633
|
+
totalRewards: (record?.totalRewards || 0) + finalPoints
|
|
2707
2634
|
}]);
|
|
2708
2635
|
await ctx.database.upsert("ggcevo_backpack", [{
|
|
2709
2636
|
handle,
|
|
@@ -2717,9 +2644,15 @@ ${itemDetails.join("\n")}`;
|
|
|
2717
2644
|
}], ["handle"]);
|
|
2718
2645
|
}
|
|
2719
2646
|
});
|
|
2647
|
+
let effectMessage = "";
|
|
2648
|
+
if (messages.length > 0) {
|
|
2649
|
+
effectMessage = `
|
|
2650
|
+
⚡ 加成效果:
|
|
2651
|
+
▸ ${messages.join("\n▸ ")}`;
|
|
2652
|
+
}
|
|
2720
2653
|
return `签到成功!本月累计签到${monthlyDays}天,获得:
|
|
2721
|
-
💰 金币 x ${
|
|
2722
|
-
🪙 咕咕币 x ${tickets}
|
|
2654
|
+
💰 金币 x ${finalPoints}(基础值 ${basePoints})
|
|
2655
|
+
🪙 咕咕币 x ${tickets}${effectMessage}`;
|
|
2723
2656
|
} catch (error) {
|
|
2724
2657
|
console.error("签到命令时发生错误:", error);
|
|
2725
2658
|
return "服务器繁忙,请稍后尝试。";
|
|
@@ -2729,13 +2662,13 @@ ${itemDetails.join("\n")}`;
|
|
|
2729
2662
|
try {
|
|
2730
2663
|
const session = argv.session;
|
|
2731
2664
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2732
|
-
if (!profile) return "🔒
|
|
2665
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
2733
2666
|
const { regionId, realmId, profileId } = profile;
|
|
2734
2667
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
2735
2668
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
2736
|
-
if (existingEntries.length > 0) return "
|
|
2669
|
+
if (existingEntries.length > 0) return "⛔ 您已被列入黑名单";
|
|
2737
2670
|
const [record] = await ctx.database.get("ggcevo_sign", { handle });
|
|
2738
|
-
if (!record) return "
|
|
2671
|
+
if (!record) return "暂未查询到您的签到记录";
|
|
2739
2672
|
const lastSignChina = convertUTCtoChinaTime(record.lastSign);
|
|
2740
2673
|
const targetDateChina = new Date(lastSignChina);
|
|
2741
2674
|
const nowChina = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
|
|
@@ -2744,7 +2677,7 @@ ${itemDetails.join("\n")}`;
|
|
|
2744
2677
|
const yesterday = new Date(targetDateChina).getUTCDate() - 1;
|
|
2745
2678
|
if (targetDateChina.getUTCFullYear() !== currentYear || targetDateChina.getUTCMonth() !== currentMonth || // 必须当月
|
|
2746
2679
|
record.monthlyDays > yesterday) {
|
|
2747
|
-
return "
|
|
2680
|
+
return "暂时没有可补签的日期";
|
|
2748
2681
|
}
|
|
2749
2682
|
const costPoints = 100;
|
|
2750
2683
|
if (record.totalRewards < costPoints) {
|
|
@@ -2781,46 +2714,16 @@ ${itemDetails.join("\n")}`;
|
|
|
2781
2714
|
return "补签失败,请稍后重试。";
|
|
2782
2715
|
}
|
|
2783
2716
|
});
|
|
2784
|
-
ctx.command("ggcevo/签到记录").action(async (argv) => {
|
|
2785
|
-
const session = argv.session;
|
|
2786
|
-
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2787
|
-
if (!profile) return "🔒 需要先绑定游戏句柄。";
|
|
2788
|
-
const { regionId, realmId, profileId } = profile;
|
|
2789
|
-
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
2790
|
-
const [record] = await ctx.database.get("ggcevo_sign", { handle });
|
|
2791
|
-
if (!record) return "您还没有签到。";
|
|
2792
|
-
const chinaTime = record.lastSign.toLocaleString("zh-CN", {
|
|
2793
|
-
timeZone: "Asia/Shanghai",
|
|
2794
|
-
year: "numeric",
|
|
2795
|
-
month: "2-digit",
|
|
2796
|
-
day: "2-digit",
|
|
2797
|
-
hour: "2-digit",
|
|
2798
|
-
minute: "2-digit",
|
|
2799
|
-
second: "2-digit",
|
|
2800
|
-
hour12: false
|
|
2801
|
-
});
|
|
2802
|
-
return [
|
|
2803
|
-
`您的句柄:${handle}`,
|
|
2804
|
-
`📅 最后签到时间:${chinaTime}`,
|
|
2805
|
-
`🔥 累计签到:${record.monthlyDays}天`,
|
|
2806
|
-
`💰 拥有金币:${record.totalRewards}枚金币`
|
|
2807
|
-
].join("\n");
|
|
2808
|
-
});
|
|
2809
2717
|
ctx.guild().command("ggcevo/每月津贴").action(async (argv) => {
|
|
2810
2718
|
const session = argv.session;
|
|
2811
2719
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2812
|
-
if (!profile) return "🔒
|
|
2720
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
2813
2721
|
const { regionId, realmId, profileId } = profile;
|
|
2814
2722
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
2815
|
-
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
2816
|
-
if (existingEntries.length > 0) {
|
|
2817
|
-
return `❌ 拒绝访问,您已被列入黑名单。`;
|
|
2818
|
-
}
|
|
2819
2723
|
const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 1 });
|
|
2820
|
-
if (!backpack) return "您还没有签到。";
|
|
2821
2724
|
const memberInfo = await session.event?.member?.roles;
|
|
2822
2725
|
if (memberInfo?.includes("member")) {
|
|
2823
|
-
return "❌
|
|
2726
|
+
return "❌ 仅限管理员和群主领取每月津贴";
|
|
2824
2727
|
}
|
|
2825
2728
|
const now = /* @__PURE__ */ new Date();
|
|
2826
2729
|
const chinatime = convertUTCtoChinaTime(now);
|
|
@@ -2847,26 +2750,26 @@ ${itemDetails.join("\n")}`;
|
|
|
2847
2750
|
await ctx.database.upsert("ggcevo_backpack", [{
|
|
2848
2751
|
handle,
|
|
2849
2752
|
itemId: 1,
|
|
2850
|
-
quantity: (backpack
|
|
2753
|
+
quantity: (backpack?.quantity || 0) + 50
|
|
2851
2754
|
}]);
|
|
2852
2755
|
return `[管理专属] 成功领取本月津贴,获得了50枚咕咕币!`;
|
|
2853
2756
|
});
|
|
2854
2757
|
ctx.command("ggcevo/领取 [name]").action(async (argv, name2) => {
|
|
2855
2758
|
const session = argv.session;
|
|
2759
|
+
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2760
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
2761
|
+
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
2762
|
+
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
2763
|
+
if (existingEntries.length > 0) return "⛔ 您已被列入黑名单";
|
|
2856
2764
|
if (!name2) {
|
|
2857
|
-
await session.send("请在30
|
|
2765
|
+
await session.send("请在30秒内输入活动名称:");
|
|
2858
2766
|
name2 = await session.prompt(3e4);
|
|
2859
|
-
if (!name2) return "
|
|
2767
|
+
if (!name2) return "已取消操作,请重新输入。";
|
|
2860
2768
|
}
|
|
2861
2769
|
const itemIdToName = {};
|
|
2862
2770
|
for (const [name3, item] of Object.entries(initDefaultItems)) {
|
|
2863
2771
|
itemIdToName[item.id] = name3;
|
|
2864
2772
|
}
|
|
2865
|
-
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2866
|
-
if (!profile) return "🔒 需要先绑定游戏句柄。";
|
|
2867
|
-
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
2868
|
-
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
2869
|
-
if (existingEntries.length > 0) return "❌ 拒绝访问,您已被列入黑名单。";
|
|
2870
2773
|
const [activity] = await ctx.database.get("ggcevo_activity", {
|
|
2871
2774
|
name: name2,
|
|
2872
2775
|
status: "进行中"
|
|
@@ -2936,7 +2839,9 @@ ${itemDetails.join("\n")}`;
|
|
|
2936
2839
|
});
|
|
2937
2840
|
return `活动【${activityName}】创建成功!奖励内容:${itemName} x${quantity}。`;
|
|
2938
2841
|
});
|
|
2939
|
-
ctx.command("ggcevo/活动列表").action(async () => {
|
|
2842
|
+
ctx.command("ggcevo/活动列表").action(async ({ session }) => {
|
|
2843
|
+
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2844
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
2940
2845
|
const activities = await ctx.database.get(
|
|
2941
2846
|
"ggcevo_activity",
|
|
2942
2847
|
{ status: "进行中" },
|
|
@@ -2951,7 +2856,7 @@ ${itemDetails.join("\n")}`;
|
|
|
2951
2856
|
`活动时间:${formatDate(a.startTime)} - ${formatDate(a.endTime)}`,
|
|
2952
2857
|
`活动描述:${a.description}`,
|
|
2953
2858
|
`活动奖励:${a.quantity} ${itemMap.get(a.itemId) || "未知物品"}`,
|
|
2954
|
-
"━".repeat(
|
|
2859
|
+
"━".repeat(14)
|
|
2955
2860
|
].join("\n")),
|
|
2956
2861
|
"请输入「领取 活动名称」领取奖励"
|
|
2957
2862
|
].join("\n") : "当前没有进行中的活动。";
|
|
@@ -3100,7 +3005,9 @@ ${itemDetails.join("\n")}`;
|
|
|
3100
3005
|
return "服务器繁忙,请稍后尝试。";
|
|
3101
3006
|
}
|
|
3102
3007
|
});
|
|
3103
|
-
ctx.command("ggcevo/胜点榜 [page]").usage("输入 胜点榜 [页码] 查看对应页的排行榜,每页10条").action(async (
|
|
3008
|
+
ctx.command("ggcevo/胜点榜 [page]").usage("输入 胜点榜 [页码] 查看对应页的排行榜,每页10条").action(async ({ session }, page) => {
|
|
3009
|
+
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3010
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
3104
3011
|
const pageNum = parseInt(page) || 1;
|
|
3105
3012
|
if (pageNum < 1) return "请输入有效的页码。";
|
|
3106
3013
|
const offset = (pageNum - 1) * 10;
|
|
@@ -3109,7 +3016,7 @@ ${itemDetails.join("\n")}`;
|
|
|
3109
3016
|
ctx.database.select("ggcevo_rank").where({ Blacklist: false, rankseason: config.rankseason }).execute((row) => import_koishi.$.count(row.handle))
|
|
3110
3017
|
]);
|
|
3111
3018
|
const totalPages = Math.ceil(total / 10);
|
|
3112
|
-
if (pageNum > totalPages) return
|
|
3019
|
+
if (pageNum > totalPages) return `查询失败,最多有 ${totalPages} 页`;
|
|
3113
3020
|
const processedRecords = await Promise.all(
|
|
3114
3021
|
records.map(async (item) => ({
|
|
3115
3022
|
...item,
|
|
@@ -3264,7 +3171,7 @@ ${itemDetails.join("\n")}`;
|
|
|
3264
3171
|
if (!player) {
|
|
3265
3172
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3266
3173
|
if (!profile) {
|
|
3267
|
-
return "🔒
|
|
3174
|
+
return "🔒 需要先绑定游戏句柄";
|
|
3268
3175
|
}
|
|
3269
3176
|
const { regionId, realmId, profileId } = profile;
|
|
3270
3177
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
@@ -3292,7 +3199,7 @@ ${itemDetails.join("\n")}`;
|
|
|
3292
3199
|
} else {
|
|
3293
3200
|
const parsedUser = import_koishi.h.parse(player)[0];
|
|
3294
3201
|
if (!parsedUser || parsedUser.type !== "at" || !parsedUser.attrs.id) {
|
|
3295
|
-
return "
|
|
3202
|
+
return "参数错误,请输入“排名 @玩家”";
|
|
3296
3203
|
}
|
|
3297
3204
|
const targetUserId = parsedUser.attrs.id;
|
|
3298
3205
|
let targetUsername = parsedUser.attrs.name || targetUserId;
|
|
@@ -3328,7 +3235,7 @@ ${itemDetails.join("\n")}`;
|
|
|
3328
3235
|
ctx.command("ggcevo/给予 <handle> <itemName:string> <amount:number>", "增加用户物品/金币", { authority: 3 }).action(async (_, handle, itemName, amount) => {
|
|
3329
3236
|
try {
|
|
3330
3237
|
if (!handle || !itemName || amount <= 0) {
|
|
3331
|
-
return "参数格式错误,正确格式:给予
|
|
3238
|
+
return "参数格式错误,正确格式:给予 句柄 物品名称 数量";
|
|
3332
3239
|
}
|
|
3333
3240
|
const parsedAmount = Math.floor(amount);
|
|
3334
3241
|
if (itemName === "金币") {
|
|
@@ -3373,19 +3280,19 @@ ${itemDetails.join("\n")}`;
|
|
|
3373
3280
|
return "操作失败:" + (err instanceof Error ? err.message : "数据库异常");
|
|
3374
3281
|
}
|
|
3375
3282
|
});
|
|
3376
|
-
ctx.command("ggcevo/违规记录 [user]", "违规记录查询").usage("输入 违规记录 [
|
|
3283
|
+
ctx.command("ggcevo/违规记录 [user]", "违规记录查询").usage("输入 违规记录 [@玩家] -p 页码 查看处罚记录,每页1条").option("p", "-p <page:number> 指定页码").action(async (argv) => {
|
|
3377
3284
|
const session = argv.session;
|
|
3378
3285
|
const pageNum = argv.options.p ? argv.options.p : 1;
|
|
3379
3286
|
const user = argv.args[0];
|
|
3380
3287
|
let handle;
|
|
3381
3288
|
if (!user) {
|
|
3382
3289
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3383
|
-
if (!profile) return "🔒
|
|
3290
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
3384
3291
|
handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
3385
3292
|
} else {
|
|
3386
3293
|
const parsedUser = import_koishi.h.parse(user)[0];
|
|
3387
3294
|
if (!parsedUser || parsedUser.type !== "at" || !parsedUser.attrs.id) {
|
|
3388
|
-
return "
|
|
3295
|
+
return "参数错误,请输入“违规记录 @玩家”";
|
|
3389
3296
|
}
|
|
3390
3297
|
const targetUserId = parsedUser.attrs.id;
|
|
3391
3298
|
let targetUsername = parsedUser.attrs.name || targetUserId;
|
|
@@ -3423,17 +3330,17 @@ ${itemDetails.join("\n")}`;
|
|
|
3423
3330
|
"------------------------------",
|
|
3424
3331
|
recordText,
|
|
3425
3332
|
"------------------------------",
|
|
3426
|
-
pageNum < totalPages ? `输入 违规记录 (
|
|
3333
|
+
pageNum < totalPages ? `输入 违规记录 (@玩家) -p ${pageNum + 1} 查看下一条` : "已是最后一页"
|
|
3427
3334
|
].join("\n");
|
|
3428
3335
|
});
|
|
3429
3336
|
ctx.command("ggcevo/兑换", "兑换物品").action(async ({ session }) => {
|
|
3430
3337
|
try {
|
|
3431
3338
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3432
|
-
if (!profile) return "🔒
|
|
3339
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
3433
3340
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
3434
3341
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
3435
3342
|
if (existingEntries.length > 0) {
|
|
3436
|
-
return
|
|
3343
|
+
return `⛔ 您已被列入黑名单`;
|
|
3437
3344
|
}
|
|
3438
3345
|
const currentSeason = config.rankseason;
|
|
3439
3346
|
const qualityGroups = {};
|
|
@@ -3477,7 +3384,7 @@ ${items.join("、")}
|
|
|
3477
3384
|
}
|
|
3478
3385
|
await session.send(message);
|
|
3479
3386
|
const name2 = await session.prompt(3e4);
|
|
3480
|
-
if (!name2) return "
|
|
3387
|
+
if (!name2) return "已取消操作,请重新输入。";
|
|
3481
3388
|
const configname = itemConfig[name2];
|
|
3482
3389
|
if (!configname) return "无效的物品名称,请重新输入。";
|
|
3483
3390
|
const userRecords = await ctx.database.get("ggcevo_exchange", { handle, item: name2 });
|
|
@@ -3516,7 +3423,7 @@ ${items.join("、")}
|
|
|
3516
3423
|
if (!coupon || coupon.quantity < cost) {
|
|
3517
3424
|
const requireMsg = petItems.has(name2) ? `需要1个${configname.quality}级宠物扭蛋 或${configname.cost}张兑奖券` : `需要${configname.cost}张兑奖券`;
|
|
3518
3425
|
return `${requireMsg}
|
|
3519
|
-
|
|
3426
|
+
您当前持有:${coupon?.quantity || 0}个${couponName}`;
|
|
3520
3427
|
}
|
|
3521
3428
|
const isGlobal = configname.isLimited || config.ignoreGlobalLimit === false;
|
|
3522
3429
|
await ctx.database.withTransaction(async () => {
|
|
@@ -3537,38 +3444,19 @@ ${items.join("、")}
|
|
|
3537
3444
|
season: currentSeason
|
|
3538
3445
|
});
|
|
3539
3446
|
});
|
|
3540
|
-
return
|
|
3447
|
+
return `🎉 恭喜!您使用 ${cost} 个 ${couponName} 兑换了 【${name2}】`;
|
|
3541
3448
|
} catch (error) {
|
|
3542
3449
|
console.error("兑换失败:", error);
|
|
3543
3450
|
return "兑换失败";
|
|
3544
3451
|
}
|
|
3545
3452
|
});
|
|
3546
|
-
ctx.command("ggcevo/兑换记录").action(async ({ session }) => {
|
|
3547
|
-
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3548
|
-
if (!profile) return "🔒 需要先绑定游戏句柄。";
|
|
3549
|
-
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
3550
|
-
const exchanges = await ctx.database.get("ggcevo_exchange", { handle });
|
|
3551
|
-
if (!exchanges.length) return "您暂无兑换记录";
|
|
3552
|
-
const output = exchanges.map((e) => {
|
|
3553
|
-
const date = new Date(e.date);
|
|
3554
|
-
const cnTime = date.toLocaleString("zh-CN", {
|
|
3555
|
-
timeZone: "Asia/Shanghai",
|
|
3556
|
-
year: "numeric",
|
|
3557
|
-
month: "2-digit",
|
|
3558
|
-
day: "2-digit"
|
|
3559
|
-
});
|
|
3560
|
-
return `${e.type}: ${e.item} | 时间: ${cnTime}`;
|
|
3561
|
-
}).join("\n");
|
|
3562
|
-
return `${handle} 的兑换记录:
|
|
3563
|
-
${output}`;
|
|
3564
|
-
});
|
|
3565
3453
|
ctx.command("ggcevo/兑换扭蛋币").action(async ({ session }) => {
|
|
3566
3454
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3567
|
-
if (!profile) return "🔒
|
|
3455
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
3568
3456
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
3569
3457
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
3570
3458
|
if (existingEntries.length > 0) {
|
|
3571
|
-
return
|
|
3459
|
+
return `⛔ 您已被列入黑名单`;
|
|
3572
3460
|
}
|
|
3573
3461
|
await session.send(`您确定要使用3张兑换券换取一枚扭蛋币吗?(请在30秒内回复“是”确认)`);
|
|
3574
3462
|
const confirm = await session.prompt(3e4);
|
|
@@ -3576,7 +3464,7 @@ ${output}`;
|
|
|
3576
3464
|
const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 3 });
|
|
3577
3465
|
const [coupon] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 2 });
|
|
3578
3466
|
if (!coupon || coupon.quantity < 3) {
|
|
3579
|
-
return `兑换扭蛋币需要3
|
|
3467
|
+
return `兑换扭蛋币需要3张兑奖券,您当前持有:${coupon?.quantity || 0}`;
|
|
3580
3468
|
}
|
|
3581
3469
|
await ctx.database.set(
|
|
3582
3470
|
"ggcevo_backpack",
|
|
@@ -3588,23 +3476,23 @@ ${output}`;
|
|
|
3588
3476
|
itemId: 3,
|
|
3589
3477
|
quantity: (backpack?.quantity || 0) + 1
|
|
3590
3478
|
}]);
|
|
3591
|
-
return
|
|
3479
|
+
return `🎉恭喜!您使用 3 张兑奖券兑换了 1 枚扭蛋币`;
|
|
3592
3480
|
});
|
|
3593
3481
|
ctx.command("ggcevo/扭蛋").action(async (argv) => {
|
|
3594
3482
|
const session = argv.session;
|
|
3595
3483
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3596
3484
|
if (!profile) {
|
|
3597
|
-
return "🔒
|
|
3485
|
+
return "🔒 需要先绑定游戏句柄";
|
|
3598
3486
|
}
|
|
3599
3487
|
const { regionId, realmId, profileId } = profile;
|
|
3600
3488
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
3601
3489
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
3602
3490
|
if (existingEntries.length > 0) {
|
|
3603
|
-
return
|
|
3491
|
+
return `⛔ 您已被列入黑名单`;
|
|
3604
3492
|
}
|
|
3605
3493
|
const [backpack] = await ctx.database.get("ggcevo_backpack", { handle, itemId: 3 });
|
|
3606
3494
|
if (!backpack || backpack.quantity < 1) {
|
|
3607
|
-
return
|
|
3495
|
+
return `当前扭蛋币不足,您拥有:${backpack?.quantity || 0}枚`;
|
|
3608
3496
|
}
|
|
3609
3497
|
const awardName = PetCapsuleToy();
|
|
3610
3498
|
const awardItem = Object.entries(initDefaultItems).find(
|
|
@@ -3626,16 +3514,18 @@ ${output}`;
|
|
|
3626
3514
|
itemId: itemData.id,
|
|
3627
3515
|
quantity: currentQuantity + 1
|
|
3628
3516
|
}]);
|
|
3629
|
-
return `🎉
|
|
3517
|
+
return `🎉 恭喜!您获得了 ${itemName}`;
|
|
3630
3518
|
});
|
|
3631
|
-
ctx.command("ggcevo/拉黑", "添加用户到黑名单").action(async (argv) => {
|
|
3519
|
+
ctx.command("ggcevo/拉黑 [handle]", "添加用户到黑名单").action(async (argv, handle) => {
|
|
3632
3520
|
const session = argv.session;
|
|
3633
3521
|
if (!ctx.config.admins.includes(session.userId)) {
|
|
3634
3522
|
return "⚠️ 没有操作权限。";
|
|
3635
3523
|
}
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3524
|
+
if (!handle) {
|
|
3525
|
+
await session.send("请在30秒内输入需要拉黑的句柄:\n(句柄格式为: [区域ID]-S2-[服务器ID]-[档案ID])");
|
|
3526
|
+
handle = await session.prompt(3e4);
|
|
3527
|
+
if (!handle) return "已取消操作,请重新输入。";
|
|
3528
|
+
}
|
|
3639
3529
|
try {
|
|
3640
3530
|
const handleRegex = /^([1235])-S2-([12])-(\d+)$/;
|
|
3641
3531
|
if (!handleRegex.test(handle)) {
|
|
@@ -3649,20 +3539,22 @@ ${output}`;
|
|
|
3649
3539
|
handle,
|
|
3650
3540
|
createdAt: /* @__PURE__ */ new Date()
|
|
3651
3541
|
});
|
|
3652
|
-
return `✅
|
|
3542
|
+
return `✅ 操作成功,用户${handle}被列入黑名单。`;
|
|
3653
3543
|
} catch (error) {
|
|
3654
3544
|
console.error("黑名单操作失败:", error);
|
|
3655
3545
|
return "操作失败,请稍后重试。错误详情已记录";
|
|
3656
3546
|
}
|
|
3657
3547
|
});
|
|
3658
|
-
ctx.command("ggcevo/标记", "标记用户到胜点榜黑名单").action(async (argv) => {
|
|
3548
|
+
ctx.command("ggcevo/标记 [handle]", "标记用户到胜点榜黑名单").action(async (argv, handle) => {
|
|
3659
3549
|
const session = argv.session;
|
|
3660
3550
|
if (!ctx.config.admins.includes(session.userId)) {
|
|
3661
3551
|
return "⚠️ 没有操作权限。";
|
|
3662
3552
|
}
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3553
|
+
if (!handle) {
|
|
3554
|
+
await session.send("请在30秒内输入需要标记的句柄:\n(句柄格式为: [区域ID]-S2-[服务器ID]-[档案ID])");
|
|
3555
|
+
handle = await session.prompt(3e4);
|
|
3556
|
+
if (!handle) return "已取消操作,请重新输入。";
|
|
3557
|
+
}
|
|
3666
3558
|
try {
|
|
3667
3559
|
const handleRegex = /^([1235])-S2-([12])-(\d+)$/;
|
|
3668
3560
|
if (!handleRegex.test(handle)) {
|
|
@@ -3670,48 +3562,24 @@ ${output}`;
|
|
|
3670
3562
|
}
|
|
3671
3563
|
const existingEntries = await ctx.database.get("ggcevo_rank", { handle, Blacklist: true, rankseason: config.rankseason });
|
|
3672
3564
|
if (existingEntries.length > 0) {
|
|
3673
|
-
return `${handle}
|
|
3565
|
+
return `${handle}已在当前赛季胜点榜上被标记。`;
|
|
3674
3566
|
}
|
|
3675
3567
|
await ctx.database.upsert("ggcevo_rank", [{
|
|
3676
3568
|
handle,
|
|
3677
3569
|
Blacklist: true,
|
|
3678
3570
|
rankseason: config.rankseason
|
|
3679
3571
|
}]);
|
|
3680
|
-
return `✅
|
|
3572
|
+
return `✅ 操作成功,用户${handle}在当前赛季胜点榜上被标记。`;
|
|
3681
3573
|
} catch (error) {
|
|
3682
3574
|
console.error("黑名单操作失败:", error);
|
|
3683
3575
|
return "操作失败,请稍后重试。错误详情已记录";
|
|
3684
3576
|
}
|
|
3685
3577
|
});
|
|
3686
|
-
ctx.command("ggcevo/成就").action(async ({ session }) => {
|
|
3687
|
-
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3688
|
-
if (!profile) {
|
|
3689
|
-
return "🔒 需要先绑定游戏句柄。";
|
|
3690
|
-
}
|
|
3691
|
-
const { regionId, realmId, profileId } = profile;
|
|
3692
|
-
const achievements = await ctx.database.get("ggcevo_achievements", {
|
|
3693
|
-
handle: `${regionId}-S2-${realmId}-${profileId}`
|
|
3694
|
-
});
|
|
3695
|
-
if (!achievements.length) {
|
|
3696
|
-
return "你还没有获得任何成就。";
|
|
3697
|
-
}
|
|
3698
|
-
const achievementList = achievements.map((achievement) => {
|
|
3699
|
-
const date = new Date(achievement.gaintime);
|
|
3700
|
-
return `${achievement.achievementname} (获得于 ${date.toLocaleDateString("zh-CN", {
|
|
3701
|
-
timeZone: "Asia/Shanghai",
|
|
3702
|
-
year: "numeric",
|
|
3703
|
-
month: "2-digit",
|
|
3704
|
-
day: "2-digit"
|
|
3705
|
-
})})`;
|
|
3706
|
-
});
|
|
3707
|
-
return `${regionId}-S2-${realmId}-${profileId} 已获得的成就:
|
|
3708
|
-
${achievementList.join("\n")}`;
|
|
3709
|
-
});
|
|
3710
3578
|
ctx.command("ggcevo/个人信息").action(async (argv) => {
|
|
3711
3579
|
const session = argv.session;
|
|
3712
3580
|
const output = [];
|
|
3713
3581
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3714
|
-
if (!profile) return "🔒
|
|
3582
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
3715
3583
|
const { regionId, realmId, profileId } = profile;
|
|
3716
3584
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
3717
3585
|
output.push(`🎮 游戏句柄:${handle}
|
|
@@ -3738,10 +3606,10 @@ ${achievementList.join("\n")}`;
|
|
|
3738
3606
|
if (lottery) {
|
|
3739
3607
|
output.push(
|
|
3740
3608
|
"🎉 抽奖统计:",
|
|
3741
|
-
|
|
3609
|
+
`总计抽奖:${lottery.totalPulls} 次`,
|
|
3742
3610
|
`距离保底剩余:${90 - lottery.pityCounter} 抽`,
|
|
3743
|
-
|
|
3744
|
-
...lottery.hiddenawards ? [
|
|
3611
|
+
`触发保底:${lottery.fullPityCount} 次`,
|
|
3612
|
+
...lottery.hiddenawards ? [`隐藏奖励:${lottery.hiddenawards} 次`] : [],
|
|
3745
3613
|
"──────────────"
|
|
3746
3614
|
);
|
|
3747
3615
|
}
|
|
@@ -3843,16 +3711,16 @@ ${achievementList.join("\n")}`;
|
|
|
3843
3711
|
ctx.command("ggcevo/pk [user]", "发起玩家对战").alias("挑战").action(async (argv, user) => {
|
|
3844
3712
|
try {
|
|
3845
3713
|
const session = argv.session;
|
|
3846
|
-
if (!user) return "请输入“pk @指定pk玩家”。";
|
|
3847
3714
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3848
|
-
if (!profile) return "🔒
|
|
3715
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
3849
3716
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
3850
3717
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
3851
3718
|
if (existingEntries.length > 0) {
|
|
3852
|
-
return
|
|
3719
|
+
return `⛔ 您已被列入黑名单`;
|
|
3853
3720
|
}
|
|
3721
|
+
if (!user) return "请输入“pk @玩家”。";
|
|
3854
3722
|
const parsedUser = import_koishi.h.parse(user)[0];
|
|
3855
|
-
if (!parsedUser || parsedUser.type !== "at" || !parsedUser.attrs.id) return "参数格式错误,请输入“pk
|
|
3723
|
+
if (!parsedUser || parsedUser.type !== "at" || !parsedUser.attrs.id) return "参数格式错误,请输入“pk @玩家”。";
|
|
3856
3724
|
const targetUserId = parsedUser.attrs.id;
|
|
3857
3725
|
const targetUsername = await session.bot.getGuildMember(session.guildId, targetUserId);
|
|
3858
3726
|
const [targetprofile] = await ctx.database.get("sc2arcade_player", { userId: targetUserId });
|
|
@@ -4021,7 +3889,7 @@ ${achievementList.join("\n")}`;
|
|
|
4021
3889
|
`🎰 金币变动:${stealPercentage}%`
|
|
4022
3890
|
];
|
|
4023
3891
|
isWin ? result.push(`💰 您从对方的口袋里抢夺了${goldTransfer}枚金币`) : result.push(`💸 您从口袋里拿出了${goldTransfer}枚金币上交给对方`);
|
|
4024
|
-
initiatorCareer?.group === "辛迪加海盗" ? result.push(`🔴
|
|
3892
|
+
initiatorCareer?.group === "辛迪加海盗" ? result.push(`🔴 辛迪加海盗阵营加成:获得1枚红晶`) : "";
|
|
4025
3893
|
result.push(`📅 剩余挑战次数:${config.dailyPKLimit - (initiatorPK.todayCount + 1)}`);
|
|
4026
3894
|
return result.join("\n");
|
|
4027
3895
|
} catch (error) {
|
|
@@ -4029,7 +3897,9 @@ ${achievementList.join("\n")}`;
|
|
|
4029
3897
|
return "对战功能暂时不可用,请稍后重试";
|
|
4030
3898
|
}
|
|
4031
3899
|
});
|
|
4032
|
-
ctx.command("ggcevo/pk榜 [page]", "查看玩家PK排行榜").usage("输入 pk榜 [页码] 查看对应页的排行榜,每页10条").action(async (
|
|
3900
|
+
ctx.command("ggcevo/pk榜 [page]", "查看玩家PK排行榜").usage("输入 pk榜 [页码] 查看对应页的排行榜,每页10条").action(async ({ session }, page) => {
|
|
3901
|
+
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
3902
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
4033
3903
|
const pageNum = parseInt(page) || 1;
|
|
4034
3904
|
if (pageNum < 1) return "请输入有效的页码。";
|
|
4035
3905
|
const offset = (pageNum - 1) * 10;
|
|
@@ -4040,7 +3910,7 @@ ${achievementList.join("\n")}`;
|
|
|
4040
3910
|
ctx.database.select("ggcevo_pk").where({ enable: true }).execute((row) => import_koishi.$.count(row.handle))
|
|
4041
3911
|
]);
|
|
4042
3912
|
const totalPages = Math.ceil(total / 10);
|
|
4043
|
-
if (pageNum > totalPages) return
|
|
3913
|
+
if (pageNum > totalPages) return `查询失败,最多有 ${totalPages} 页`;
|
|
4044
3914
|
if (!records.length) return "暂无PK记录";
|
|
4045
3915
|
const rankingText = records.map((record, index) => {
|
|
4046
3916
|
const winRate = record.total > 0 ? `${(record.wins / record.total * 100).toFixed(1)}%` : "N/A";
|
|
@@ -4062,7 +3932,7 @@ ${achievementList.join("\n")}`;
|
|
|
4062
3932
|
});
|
|
4063
3933
|
ctx.command("ggcevo/切换pk", "切换玩家对战状态").alias("切换pk状态").action(async ({ session }) => {
|
|
4064
3934
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4065
|
-
if (!profile) return "🔒
|
|
3935
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
4066
3936
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4067
3937
|
const [pkRecord] = await ctx.database.get("ggcevo_pk", { handle }) || [null];
|
|
4068
3938
|
const currentState = pkRecord?.enable ?? true;
|
|
@@ -4082,12 +3952,12 @@ ${achievementList.join("\n")}`;
|
|
|
4082
3952
|
const now = convertUTCtoChinaTime(/* @__PURE__ */ new Date());
|
|
4083
3953
|
const lastToggleTime = convertUTCtoChinaTime(lastToggle);
|
|
4084
3954
|
const diffDays = Math.floor((now.getTime() - lastToggleTime.getTime()) / (1e3 * 3600 * 24));
|
|
3955
|
+
const [careers] = await ctx.database.get("ggcevo_careers", { handle });
|
|
3956
|
+
if (careers?.group === "辛迪加海盗") return "您已经加入了辛迪加海盗阵营,无法切换PK状态!";
|
|
4085
3957
|
if (diffDays < 3 && lastToggleTime.getTime() !== 0) {
|
|
4086
3958
|
const remaining = 3 - diffDays;
|
|
4087
3959
|
return `状态切换冷却中,${remaining}天后再试(下次可切换时间:${new Date(lastToggle.getTime() + 3 * 864e5).toLocaleDateString("zh-CN")})。`;
|
|
4088
3960
|
}
|
|
4089
|
-
const [careers] = await ctx.database.get("ggcevo_careers", { handle });
|
|
4090
|
-
if (careers?.group === "辛迪加海盗") return "您已经加入了辛迪加海盗阵营,无法切换PK状态!";
|
|
4091
3961
|
const action = currentState ? "关闭" : "开启";
|
|
4092
3962
|
await session.send(`您当前的PK状态为【${currentState ? "开启" : "关闭"}】,确认要${action}吗?(请在30秒内回复“是”确认)`);
|
|
4093
3963
|
const confirm = await session.prompt(3e4);
|
|
@@ -4120,7 +3990,24 @@ ${achievementList.join("\n")}`;
|
|
|
4120
3990
|
const CAREER_DISCOUNTS = [0, 0, 10, 15, 20];
|
|
4121
3991
|
const baseDiscount = techLevel > 0 ? BASE_DISCOUNTS[techLevel - 1] : 0;
|
|
4122
3992
|
const careerDiscount = isCareerMatch ? CAREER_DISCOUNTS[techLevel - 1] : 0;
|
|
4123
|
-
const
|
|
3993
|
+
const techDiscount = Math.max(baseDiscount, careerDiscount);
|
|
3994
|
+
const activeWish = await ctx.database.get("ggcevo_Wish_Record", {
|
|
3995
|
+
handle,
|
|
3996
|
+
wishname: "蚱蜢优购",
|
|
3997
|
+
startTime: { $lte: /* @__PURE__ */ new Date() },
|
|
3998
|
+
endTime: { $gte: /* @__PURE__ */ new Date() },
|
|
3999
|
+
isused: false
|
|
4000
|
+
}).then((records) => records[0]);
|
|
4001
|
+
const grasshopperDiscount = activeWish ? 20 : 0;
|
|
4002
|
+
let totalDiscount = techDiscount + grasshopperDiscount;
|
|
4003
|
+
totalDiscount = Math.min(totalDiscount, 100);
|
|
4004
|
+
const discountDetails = [];
|
|
4005
|
+
if (techDiscount > 0) {
|
|
4006
|
+
discountDetails.push(`武器系统 Lv${techLevel}:${techDiscount}%`);
|
|
4007
|
+
}
|
|
4008
|
+
if (grasshopperDiscount > 0) {
|
|
4009
|
+
discountDetails.push(`蚱蜢优购祈愿:${grasshopperDiscount}%`);
|
|
4010
|
+
}
|
|
4124
4011
|
const typeStats = Object.values(weaponConfig).filter((weapon) => weapon.price !== 0).reduce((stats, weapon) => {
|
|
4125
4012
|
stats[weapon.type] = (stats[weapon.type] || 0) + 1;
|
|
4126
4013
|
return stats;
|
|
@@ -4132,8 +4019,9 @@ ${achievementList.join("\n")}`;
|
|
|
4132
4019
|
"====================",
|
|
4133
4020
|
...Object.entries(typeStats).map(([typeName, count]) => `▸ ${typeName} (${count}种)`),
|
|
4134
4021
|
"====================",
|
|
4135
|
-
|
|
4136
|
-
🔧
|
|
4022
|
+
totalDiscount > 0 && `
|
|
4023
|
+
🔧 当前购买折扣:
|
|
4024
|
+
${discountDetails.length ? ` ${discountDetails.join(" \n ")}` : ""}`
|
|
4137
4025
|
].filter(Boolean).join("\n");
|
|
4138
4026
|
}
|
|
4139
4027
|
if (!Object.keys(typeStats).includes(type)) {
|
|
@@ -4141,13 +4029,13 @@ ${achievementList.join("\n")}`;
|
|
|
4141
4029
|
${Object.keys(typeStats).join("、")}`;
|
|
4142
4030
|
}
|
|
4143
4031
|
const items = Object.entries(weaponConfig).filter(([_, config2]) => config2.type === type && config2.price !== 0).map(([name2, config2]) => {
|
|
4144
|
-
const actualPrice = Math.floor(config2.price * (
|
|
4032
|
+
const actualPrice = Math.floor(config2.price * (100 - totalDiscount) / 100);
|
|
4145
4033
|
const tagEffectsDesc = config2.tagEffects ? Object.entries(config2.tagEffects).map(([tag, multiplier]) => `▸ 对${tag}目标造成${(multiplier * 100).toFixed(0)}%伤害`).join("\n") : "▸ 无特殊加成效果";
|
|
4146
4034
|
return [
|
|
4147
4035
|
`【${name2}】`,
|
|
4148
4036
|
`类型:${config2.type}`,
|
|
4149
4037
|
`基础伤害:${config2.damage}`,
|
|
4150
|
-
`价格:${actualPrice}金币${
|
|
4038
|
+
`价格:${actualPrice}金币${totalDiscount > 0 ? ` (原价${config2.price})` : ""}`,
|
|
4151
4039
|
"特性:",
|
|
4152
4040
|
tagEffectsDesc,
|
|
4153
4041
|
`描述:${config2.description}`
|
|
@@ -4156,7 +4044,8 @@ ${Object.keys(typeStats).join("、")}`;
|
|
|
4156
4044
|
return [
|
|
4157
4045
|
`🏪 咕咕武器库 - ${type} 🏪`,
|
|
4158
4046
|
"使用“购买 武器名称”指令进行购买",
|
|
4159
|
-
|
|
4047
|
+
totalDiscount > 0 && `🔧 当前购买折扣:
|
|
4048
|
+
${discountDetails.length ? ` ${discountDetails.join(" \n ")}` : ""}`,
|
|
4160
4049
|
"====================",
|
|
4161
4050
|
...items,
|
|
4162
4051
|
items.length === 0 ? "⚠️ 该分类下暂无可用武器" : ""
|
|
@@ -4204,10 +4093,10 @@ ${validTypes.join("、")}`;
|
|
|
4204
4093
|
});
|
|
4205
4094
|
ctx.command("ggcevo/购买 <item>").action(async ({ session }, item) => {
|
|
4206
4095
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4207
|
-
if (!profile) return "🔒
|
|
4096
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
4208
4097
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4209
4098
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
4210
|
-
if (existingEntries.length > 0) return "
|
|
4099
|
+
if (existingEntries.length > 0) return "⛔ 您已被列入黑名单";
|
|
4211
4100
|
const allItems = { ...weaponConfig, ...SyndicatedItems };
|
|
4212
4101
|
if (!item) return "请输入“购买 物品名称”来购买所需物品。";
|
|
4213
4102
|
const config2 = allItems[item];
|
|
@@ -4224,8 +4113,8 @@ ${validTypes.join("、")}`;
|
|
|
4224
4113
|
const [signInfo] = await ctx.database.get("ggcevo_sign", { handle });
|
|
4225
4114
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
4226
4115
|
const [weaponTech] = await ctx.database.get("ggcevo_tech", { handle, techId: 2 });
|
|
4227
|
-
let discountDetails = [];
|
|
4228
4116
|
let totalDiscount = 0;
|
|
4117
|
+
let discountDetails = [];
|
|
4229
4118
|
if (isWeapon && careerData?.group === "人类联盟") {
|
|
4230
4119
|
const techDiscountTable = {
|
|
4231
4120
|
3: [0, 10],
|
|
@@ -4240,7 +4129,7 @@ ${validTypes.join("、")}`;
|
|
|
4240
4129
|
if (techDiscount > 0) {
|
|
4241
4130
|
totalDiscount += techDiscount;
|
|
4242
4131
|
discountDetails.push(
|
|
4243
|
-
`武器系统 Lv${techLevel}${isQualifiedCareer ? "(职业加成)" : ""}
|
|
4132
|
+
`武器系统 Lv${techLevel}${isQualifiedCareer ? "(职业加成)" : ""}:${techDiscount}%折扣`
|
|
4244
4133
|
);
|
|
4245
4134
|
}
|
|
4246
4135
|
}
|
|
@@ -4254,8 +4143,9 @@ ${validTypes.join("、")}`;
|
|
|
4254
4143
|
}).then((records) => records[0]) : null;
|
|
4255
4144
|
if (activeWish) {
|
|
4256
4145
|
const wishDiscount = 20;
|
|
4257
|
-
totalDiscount
|
|
4258
|
-
discountDetails.push(
|
|
4146
|
+
totalDiscount += wishDiscount;
|
|
4147
|
+
discountDetails.push(`蚱蜢优购祈愿生效:${wishDiscount}%折扣`);
|
|
4148
|
+
totalDiscount = Math.min(totalDiscount, 100);
|
|
4259
4149
|
}
|
|
4260
4150
|
let actualPrice = config2.price;
|
|
4261
4151
|
if (totalDiscount > 0) {
|
|
@@ -4265,7 +4155,7 @@ ${validTypes.join("、")}`;
|
|
|
4265
4155
|
if ((signInfo?.totalRewards || 0) < actualPrice) {
|
|
4266
4156
|
let priceInfo = `需要 ${actualPrice} 金币`;
|
|
4267
4157
|
if (discountDetails.length > 0) {
|
|
4268
|
-
priceInfo +=
|
|
4158
|
+
priceInfo += `(原价 ${config2.price})`;
|
|
4269
4159
|
}
|
|
4270
4160
|
return `❌ 金币不足,${priceInfo}`;
|
|
4271
4161
|
}
|
|
@@ -4330,7 +4220,7 @@ ${validTypes.join("、")}`;
|
|
|
4330
4220
|
});
|
|
4331
4221
|
ctx.command("ggcevo/武器仓库").action(async ({ session }) => {
|
|
4332
4222
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4333
|
-
if (!profile) return "🔒
|
|
4223
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
4334
4224
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4335
4225
|
const weapons = await ctx.database.get("ggcevo_equipment", {
|
|
4336
4226
|
handle
|
|
@@ -4350,7 +4240,7 @@ ${validTypes.join("、")}`;
|
|
|
4350
4240
|
].join("\n");
|
|
4351
4241
|
}));
|
|
4352
4242
|
return [
|
|
4353
|
-
`🛡️ ${handle}
|
|
4243
|
+
`🛡️ ${handle}拥有的武器`,
|
|
4354
4244
|
'使用"装备 武器名称"来装备武器',
|
|
4355
4245
|
"⚡表示当前装备武器",
|
|
4356
4246
|
"──────────────",
|
|
@@ -4362,20 +4252,20 @@ ${validTypes.join("、")}`;
|
|
|
4362
4252
|
});
|
|
4363
4253
|
ctx.command("ggcevo/装备 <weapon>").action(async ({ session }, weapon) => {
|
|
4364
4254
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4365
|
-
if (!profile) return "🔒
|
|
4366
|
-
if (!weapon) return "请输入“装备 武器名称”来装备一把你拥有的武器。";
|
|
4367
|
-
if (!weaponConfig[weapon]) return "请输入“装备 武器名称”来装备一把你拥有的武器。";
|
|
4368
|
-
const config2 = weaponConfig[weapon];
|
|
4255
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
4369
4256
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4370
4257
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
4371
4258
|
if (existingEntries.length > 0) {
|
|
4372
|
-
return
|
|
4259
|
+
return `⛔ 您已被列入黑名单`;
|
|
4373
4260
|
}
|
|
4261
|
+
if (!weapon) return "请输入“装备 武器名称”来装备一把你拥有的武器。";
|
|
4262
|
+
if (!weaponConfig[weapon]) return "武器名称错误,请输入“装备 武器名称”来装备一把你拥有的武器。";
|
|
4263
|
+
const config2 = weaponConfig[weapon];
|
|
4374
4264
|
const [owned] = await ctx.database.get("ggcevo_equipment", {
|
|
4375
4265
|
handle,
|
|
4376
4266
|
weaponId: config2.id
|
|
4377
4267
|
});
|
|
4378
|
-
if (!owned) return "
|
|
4268
|
+
if (!owned) return "您尚未获得该武器。";
|
|
4379
4269
|
await ctx.database.withTransaction(async () => {
|
|
4380
4270
|
await ctx.database.set(
|
|
4381
4271
|
"ggcevo_equipment",
|
|
@@ -4396,10 +4286,10 @@ ${validTypes.join("、")}`;
|
|
|
4396
4286
|
});
|
|
4397
4287
|
ctx.command("ggcevo/升级 <target>", "升级武器或科技").action(async ({ session }, target) => {
|
|
4398
4288
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4399
|
-
if (!profile) return "🔒
|
|
4289
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
4400
4290
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4401
4291
|
if ((await ctx.database.get("ggcevo_blacklist", { handle })).length) {
|
|
4402
|
-
return "
|
|
4292
|
+
return "⛔ 您已被列入黑名单";
|
|
4403
4293
|
}
|
|
4404
4294
|
if (!target) {
|
|
4405
4295
|
return generateUpgradePriceList(handle);
|
|
@@ -4417,10 +4307,10 @@ ${validTypes.join("、")}`;
|
|
|
4417
4307
|
});
|
|
4418
4308
|
ctx.command("ggcevo/改装 <weapon> [mod]", "安装武器模块").action(async ({ session }, weapon, mod) => {
|
|
4419
4309
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4420
|
-
if (!profile) return "🔒
|
|
4310
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
4421
4311
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4422
4312
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
4423
|
-
if (existingEntries.length > 0) return "
|
|
4313
|
+
if (existingEntries.length > 0) return "⛔ 您已被列入黑名单";
|
|
4424
4314
|
const isValidWeapon = weapon && weaponConfig[weapon]?.id !== void 0;
|
|
4425
4315
|
const processModInstallation = /* @__PURE__ */ __name(async () => {
|
|
4426
4316
|
const modInfo = modConfig[mod];
|
|
@@ -4429,7 +4319,7 @@ ${validTypes.join("、")}`;
|
|
|
4429
4319
|
handle,
|
|
4430
4320
|
weaponId: weaponConfig[weapon].id
|
|
4431
4321
|
});
|
|
4432
|
-
if (!equipment) return "
|
|
4322
|
+
if (!equipment) return "您尚未获得该武器。";
|
|
4433
4323
|
if (modInfo.isExclusive) {
|
|
4434
4324
|
if (modInfo.exclusiveTo !== weapon) return `❌ 该模块只能安装在${modInfo.exclusiveTo}上。`;
|
|
4435
4325
|
const hasExclusive = equipment.installedMods.some((m) => modConfig[m]?.isExclusive);
|
|
@@ -4472,7 +4362,7 @@ ${validTypes.join("、")}`;
|
|
|
4472
4362
|
return [
|
|
4473
4363
|
`✅ ${weapon} 成功安装 ${mod}!`,
|
|
4474
4364
|
discountMsg,
|
|
4475
|
-
`花费金币:${actualCost}`,
|
|
4365
|
+
`花费金币:${actualCost}${discountRate > 0 ? `(原价${modInfo.cost})` : ""}`,
|
|
4476
4366
|
`改装槽:${equipment.installedMods.length + 1}/${equipment.modificationSlots}`
|
|
4477
4367
|
].join("\n");
|
|
4478
4368
|
}, "processModInstallation");
|
|
@@ -4532,10 +4422,10 @@ ${validTypes.join("、")}`;
|
|
|
4532
4422
|
const session = argv.session;
|
|
4533
4423
|
let broadcastMessage = null;
|
|
4534
4424
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4535
|
-
if (!profile) return "🔒
|
|
4425
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
4536
4426
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4537
4427
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
4538
|
-
if (existingEntries.length > 0) return "
|
|
4428
|
+
if (existingEntries.length > 0) return "⛔ 您已被列入黑名单";
|
|
4539
4429
|
const getActiveBossNames = /* @__PURE__ */ __name(async () => {
|
|
4540
4430
|
const activeBosses2 = await ctx.database.get("ggcevo_boss", { isActive: true });
|
|
4541
4431
|
return activeBosses2.map((b) => b.name).join(",");
|
|
@@ -4574,7 +4464,7 @@ ${validTypes.join("、")}`;
|
|
|
4574
4464
|
const weaponConfigEntry = Object.entries(weaponConfig).find(([_, c]) => c.id === equippedWeapon.weaponId);
|
|
4575
4465
|
const [weaponName, weaponData] = weaponConfigEntry;
|
|
4576
4466
|
if (!weaponData.isantiair && targetBoss.groupId === 5) {
|
|
4577
|
-
return "
|
|
4467
|
+
return "您当前装备的武器无法攻击空中目标!";
|
|
4578
4468
|
}
|
|
4579
4469
|
const activeBosses = await ctx.database.get("ggcevo_boss", { isActive: true });
|
|
4580
4470
|
if (!activeBosses.length) return "当前没有存活的异形,请等待下一轮刷新。";
|
|
@@ -4635,7 +4525,7 @@ ${validTypes.join("、")}`;
|
|
|
4635
4525
|
{ name: targetBoss.name },
|
|
4636
4526
|
{ respawnTime }
|
|
4637
4527
|
);
|
|
4638
|
-
const { rewardMessages } = await handleBossDefeatRewards(ctx, targetBoss
|
|
4528
|
+
const { rewardMessages } = await handleBossDefeatRewards(ctx, targetBoss);
|
|
4639
4529
|
await ctx.database.remove("ggcevo_boss_damage", {
|
|
4640
4530
|
bossGroupId: targetBoss.groupId
|
|
4641
4531
|
});
|
|
@@ -4757,10 +4647,10 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
4757
4647
|
const parseList = /* @__PURE__ */ __name((str) => str ? str.split(",").map((s) => s.trim()).filter(Boolean) : [], "parseList");
|
|
4758
4648
|
const tags = parseList(options.tags);
|
|
4759
4649
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4760
|
-
if (!profile) return "🔒
|
|
4650
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
4761
4651
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
4762
4652
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
4763
|
-
if (existingEntries.length > 0) return "
|
|
4653
|
+
if (existingEntries.length > 0) return "⛔ 您已被列入黑名单";
|
|
4764
4654
|
const [equippedWeapon] = await ctx.database.get("ggcevo_equipment", {
|
|
4765
4655
|
handle,
|
|
4766
4656
|
equipped: true
|
|
@@ -4797,7 +4687,7 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
4797
4687
|
// 这里添加符号
|
|
4798
4688
|
] : [],
|
|
4799
4689
|
`📊 理论伤害值:${damage}${hasCrit ? " (✨ 触发暴击)" : ""}`,
|
|
4800
|
-
"💡 提示:使用 -t 重甲,生物…… 添加测试标签"
|
|
4690
|
+
"💡 提示:使用 -t 重甲,生物……(标签之间用英文逗号分隔) 添加测试标签"
|
|
4801
4691
|
].filter((line) => line).join("\n");
|
|
4802
4692
|
});
|
|
4803
4693
|
ctx.command("ggcevo/伤害榜 [page]", "查看当前主宰伤害排名").usage("输入 伤害榜 [页码] 查看对应页的排行榜,每页10条").action(async (_, page) => {
|
|
@@ -4815,7 +4705,7 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
4815
4705
|
ctx.database.select("ggcevo_boss_damage").where({ bossGroupId: mainBoss.groupId }).execute((row) => import_koishi.$.count(row.handle))
|
|
4816
4706
|
]);
|
|
4817
4707
|
const totalPages = Math.ceil(total / 10);
|
|
4818
|
-
if (pageNum > totalPages) return
|
|
4708
|
+
if (pageNum > totalPages) return `查询失败,最多有 ${totalPages} 页`;
|
|
4819
4709
|
if (!records.length) return "暂无伤害记录";
|
|
4820
4710
|
const rankingText = records.map(
|
|
4821
4711
|
(record, index) => `${offset + index + 1}. ${record.playerName || "未知玩家"} | 总伤害: ${record.totalDamage} | 攻击次数: ${record.attackCount}`
|
|
@@ -4863,7 +4753,7 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
4863
4753
|
}
|
|
4864
4754
|
return result.join("\n");
|
|
4865
4755
|
});
|
|
4866
|
-
ctx.command("ggcevo/初始化异形 <groupid:number>", "初始化指定主宰组", { authority: 3 }).action(async (_, groupid) => {
|
|
4756
|
+
ctx.command("ggcevo/初始化异形 <groupid:number>", "初始化指定主宰组", { authority: 3 }).alias("初始化yx").action(async (_, groupid) => {
|
|
4867
4757
|
if (!groupid) groupid = 1;
|
|
4868
4758
|
const bossConfig = bossPool.find((g) => g.main.id === groupid);
|
|
4869
4759
|
if (!bossConfig) {
|
|
@@ -4897,11 +4787,11 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
4897
4787
|
ctx.command("ggcevo/祈愿").action(async (argv) => {
|
|
4898
4788
|
const session = argv.session;
|
|
4899
4789
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4900
|
-
if (!profile) return "🔒
|
|
4790
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
4901
4791
|
const { regionId, realmId, profileId } = profile;
|
|
4902
4792
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
4903
4793
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
4904
|
-
if (existingEntries.length > 0) return "
|
|
4794
|
+
if (existingEntries.length > 0) return "⛔ 您已被列入黑名单";
|
|
4905
4795
|
const [sign] = await ctx.database.get("ggcevo_sign", { handle });
|
|
4906
4796
|
if (!sign || sign.totalRewards < 50) return "需要50金币进行祈愿,您的金币不足。";
|
|
4907
4797
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -4972,19 +4862,19 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
4972
4862
|
return `✨ 祈愿成功!花费50枚金币获得【${effect.name}】效果:${effect.effect}
|
|
4973
4863
|
⏳ 效果持续至 ${formattedEndTime}`;
|
|
4974
4864
|
});
|
|
4975
|
-
ctx.command("
|
|
4865
|
+
ctx.command("ggcevo/兑换金币", "使用兑换券兑换金币").action(async ({ session }) => {
|
|
4976
4866
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
4977
|
-
if (!profile) return "🔒
|
|
4867
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
4978
4868
|
const { regionId, realmId, profileId } = profile;
|
|
4979
4869
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
4980
4870
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
4981
4871
|
if (existingEntries.length > 0) {
|
|
4982
|
-
return
|
|
4872
|
+
return `⛔ 您已被列入黑名单`;
|
|
4983
4873
|
}
|
|
4984
4874
|
await session.send(`请输入你要使用多少张兑换券来兑换金币?(请在30秒内回复数字,回复“0”为取消兑换)
|
|
4985
4875
|
注意:1张兑换券=2000金币`);
|
|
4986
4876
|
const exchangeInput = await session.prompt(3e4);
|
|
4987
|
-
if (!exchangeInput) return "
|
|
4877
|
+
if (!exchangeInput) return "已取消操作,请重新输入。";
|
|
4988
4878
|
const exchangeCount = parseInt(exchangeInput, 10);
|
|
4989
4879
|
if (isNaN(exchangeCount)) return "请输入有效的数字!";
|
|
4990
4880
|
if (exchangeCount < 0) return "兑换数量不能为负数!";
|
|
@@ -5011,13 +4901,13 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5011
4901
|
});
|
|
5012
4902
|
return `成功使用${exchangeCount}张兑换券,获得${goldAmount}枚金币!`;
|
|
5013
4903
|
});
|
|
5014
|
-
ctx.command("
|
|
4904
|
+
ctx.command("ggcevo/兑换红晶", "使用金币兑换红晶").action(async ({ session }) => {
|
|
5015
4905
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
5016
|
-
if (!profile) return "🔒
|
|
4906
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
5017
4907
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
5018
4908
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
5019
4909
|
if (existingEntries.length > 0) {
|
|
5020
|
-
return
|
|
4910
|
+
return `⛔ 您已被列入黑名单`;
|
|
5021
4911
|
}
|
|
5022
4912
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
5023
4913
|
if (!careerData || careerData.group !== "辛迪加海盗") {
|
|
@@ -5026,7 +4916,7 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5026
4916
|
await session.send(`请输入你想要兑换多少红晶?(请在30秒内回复数字,回复“0”为取消兑换)
|
|
5027
4917
|
注意:每块红晶需要950金币。`);
|
|
5028
4918
|
const exchangeInput = await session.prompt(3e4);
|
|
5029
|
-
if (!exchangeInput) return "
|
|
4919
|
+
if (!exchangeInput) return "已取消操作,请重新输入。";
|
|
5030
4920
|
const exchangeCount = parseInt(exchangeInput, 10);
|
|
5031
4921
|
if (isNaN(exchangeCount)) return "请输入有效的数字!";
|
|
5032
4922
|
if (exchangeCount < 0) return "兑换数量不能为负数!";
|
|
@@ -5053,12 +4943,12 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5053
4943
|
});
|
|
5054
4944
|
ctx.command("ggcevo/加入 <faction>", "加入阵营").alias("加入阵营").action(async ({ session }, faction) => {
|
|
5055
4945
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
5056
|
-
if (!profile) return "🔒
|
|
4946
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
5057
4947
|
const { regionId, realmId, profileId } = profile;
|
|
5058
4948
|
const handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
5059
4949
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
5060
4950
|
if (existingEntries.length > 0) {
|
|
5061
|
-
return
|
|
4951
|
+
return `⛔ 您已被列入黑名单`;
|
|
5062
4952
|
}
|
|
5063
4953
|
const validFactions = ["人类联盟", "辛迪加海盗"];
|
|
5064
4954
|
if (!faction) return `请输入“加入 阵营名称”加入对应阵营
|
|
@@ -5094,7 +4984,7 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5094
4984
|
} else if (faction === "辛迪加海盗") {
|
|
5095
4985
|
const [pkData] = await ctx.database.get("ggcevo_pk", { handle });
|
|
5096
4986
|
if (userCoins < 2e3) {
|
|
5097
|
-
return
|
|
4987
|
+
return `加入辛迪加海盗需要缴纳2000金币并且永久开启PK功能,你当前拥有${userCoins}金币`;
|
|
5098
4988
|
}
|
|
5099
4989
|
if (pkData && !pkData?.enable) {
|
|
5100
4990
|
return "当前PK功能未开启,无法加入辛迪加海盗。";
|
|
@@ -5122,11 +5012,11 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5122
5012
|
});
|
|
5123
5013
|
ctx.command("ggcevo/转职 [profession]", "转职系统").action(async ({ session }, profession) => {
|
|
5124
5014
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
5125
|
-
if (!profile) return "🔒
|
|
5015
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
5126
5016
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
5127
5017
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
5128
5018
|
if (existingEntries.length > 0) {
|
|
5129
|
-
return
|
|
5019
|
+
return `⛔ 您已被列入黑名单`;
|
|
5130
5020
|
}
|
|
5131
5021
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
5132
5022
|
if (!careerData) return "请先加入阵营后使用转职功能。";
|
|
@@ -5174,7 +5064,7 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5174
5064
|
try {
|
|
5175
5065
|
if (careerData.group === "人类联盟") {
|
|
5176
5066
|
if (userCoins < targetProfession.costcoins) {
|
|
5177
|
-
return `转职需要 ${targetProfession.costcoins}
|
|
5067
|
+
return `转职需要 ${targetProfession.costcoins} 金币,您当前拥有 ${userCoins}`;
|
|
5178
5068
|
}
|
|
5179
5069
|
await ctx.database.upsert("ggcevo_sign", [{
|
|
5180
5070
|
handle,
|
|
@@ -5182,7 +5072,7 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5182
5072
|
}], ["handle"]);
|
|
5183
5073
|
} else if (careerData.group === "辛迪加海盗") {
|
|
5184
5074
|
if (userRedCrystal < (targetProfession.costredcrystal || 0)) {
|
|
5185
|
-
return `需要红晶 ${targetProfession.costredcrystal}
|
|
5075
|
+
return `需要红晶 ${targetProfession.costredcrystal},您当前拥有 ${userRedCrystal}`;
|
|
5186
5076
|
}
|
|
5187
5077
|
await Promise.all([
|
|
5188
5078
|
ctx.database.upsert("ggcevo_careers", [{
|
|
@@ -5207,7 +5097,7 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5207
5097
|
const [profile] = await ctx.database.get("sc2arcade_player", {
|
|
5208
5098
|
userId: session.userId
|
|
5209
5099
|
});
|
|
5210
|
-
if (!profile) return "🔒
|
|
5100
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
5211
5101
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
5212
5102
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
5213
5103
|
if (!careerData) return "您尚未加入任何阵营。";
|
|
@@ -5246,7 +5136,7 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5246
5136
|
});
|
|
5247
5137
|
ctx.command("ggcevo/黑市 [type]", "辛迪加海盗专属黑市").usage("输入“黑市”查看类型,或“黑市 类型”查看详细").action(async ({ session }, type) => {
|
|
5248
5138
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
5249
|
-
if (!profile) return "🔒
|
|
5139
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
5250
5140
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
5251
5141
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
5252
5142
|
if (!careerData || careerData.group !== "辛迪加海盗") {
|
|
@@ -5308,23 +5198,23 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5308
5198
|
];
|
|
5309
5199
|
return [
|
|
5310
5200
|
`🏴☠️ 辛迪加黑市 - ${normalizedType} 🏴☠️`,
|
|
5311
|
-
"使用“订购
|
|
5201
|
+
"使用“订购 物品名称”进行购买(仅消耗红晶)",
|
|
5312
5202
|
"====================",
|
|
5313
5203
|
...items
|
|
5314
5204
|
].join("\n\n");
|
|
5315
5205
|
});
|
|
5316
5206
|
ctx.command("ggcevo/订购 <item>").action(async ({ session }, item) => {
|
|
5317
5207
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
5318
|
-
if (!profile) return "🔒
|
|
5208
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
5319
5209
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
5320
5210
|
if (await ctx.database.get("ggcevo_blacklist", { handle }).then((r) => r.length)) {
|
|
5321
|
-
return "
|
|
5211
|
+
return "⛔ 您已被列入黑名单";
|
|
5322
5212
|
}
|
|
5323
5213
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
5324
5214
|
if (!careerData || careerData.group !== "辛迪加海盗") {
|
|
5325
5215
|
return "🚫 该功能需要【辛迪加海盗】阵营权限";
|
|
5326
5216
|
}
|
|
5327
|
-
if (!item) return "请输入“订购
|
|
5217
|
+
if (!item) return "请输入“订购 物品名称”向辛迪加总部订购物品。";
|
|
5328
5218
|
const isWeapon = Object.prototype.hasOwnProperty.call(weaponConfig, item);
|
|
5329
5219
|
const isSyndicatedItem = Object.prototype.hasOwnProperty.call(SyndicatedItems, item);
|
|
5330
5220
|
if (!isWeapon && !isSyndicatedItem) return "❌ 无效物品名称";
|
|
@@ -5401,7 +5291,7 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5401
5291
|
ctx.command("ggcevo/仓库").action(async (argv) => {
|
|
5402
5292
|
const session = argv.session;
|
|
5403
5293
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
5404
|
-
if (!profile) return "🔒
|
|
5294
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
5405
5295
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
5406
5296
|
const [items, signData, careerData] = await Promise.all([
|
|
5407
5297
|
ctx.database.get("ggcevo_warehouse", { handle }),
|
|
@@ -5434,7 +5324,7 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5434
5324
|
// 从warehouse表读取实际数量
|
|
5435
5325
|
`特效:${itemData.effects}`,
|
|
5436
5326
|
`描述:${itemData.description}`,
|
|
5437
|
-
"
|
|
5327
|
+
"――――――――――――――"
|
|
5438
5328
|
].join("\n");
|
|
5439
5329
|
}).join("\n\n")
|
|
5440
5330
|
);
|
|
@@ -5444,12 +5334,13 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5444
5334
|
ctx.command("ggcevo/使用 [itemName] [target]").action(async (argv, itemName, target) => {
|
|
5445
5335
|
const session = argv.session;
|
|
5446
5336
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
5447
|
-
if (!profile) return "🔒
|
|
5337
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
5448
5338
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
5449
5339
|
if (await ctx.database.get("ggcevo_blacklist", { handle }).then((r) => r.length)) {
|
|
5450
5340
|
return "⛔ 您已被列入黑名单";
|
|
5451
5341
|
}
|
|
5452
5342
|
try {
|
|
5343
|
+
if (!itemName) return "请输入“使用 物品名称 (可选目标)”使用仓库中的物品。";
|
|
5453
5344
|
const warehouseItems = await ctx.database.get("ggcevo_warehouse", { handle });
|
|
5454
5345
|
const targetItem = warehouseItems.find((item) => {
|
|
5455
5346
|
const entry = Object.entries(SyndicatedItems).find(
|
|
@@ -5484,13 +5375,14 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5484
5375
|
});
|
|
5485
5376
|
ctx.command("ggcevo/科技 [techName]", "查看空间站科技信息").usage("输入“科技”查看列表,或“科技 科技名称”查看详细信息").action(async ({ session }, techName) => {
|
|
5486
5377
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
5487
|
-
if (!profile) return "🔒
|
|
5378
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
5488
5379
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
5489
5380
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
5490
5381
|
if (!careerData || careerData.group !== "人类联盟") {
|
|
5491
5382
|
return "🚫 该功能需要【人类联盟】阵营权限";
|
|
5492
5383
|
}
|
|
5493
5384
|
const romanNumerals = { 1: "I", 2: "II", 3: "III", 4: "IV", 5: "V" };
|
|
5385
|
+
const isIntelligenceOfficer = careerData?.career === "情报副官";
|
|
5494
5386
|
if (!techName) {
|
|
5495
5387
|
const techList = Spacestationtechnology.map(
|
|
5496
5388
|
(tech2) => `▸ ${tech2.techname} (最大等级 ${romanNumerals[tech2.maxLevel]})`
|
|
@@ -5500,8 +5392,10 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5500
5392
|
'使用 "科技 科技名称" 查看详细信息',
|
|
5501
5393
|
"====================",
|
|
5502
5394
|
...techList,
|
|
5503
|
-
"===================="
|
|
5504
|
-
|
|
5395
|
+
"====================",
|
|
5396
|
+
isIntelligenceOfficer && "※ 情报副官享受20%升级折扣"
|
|
5397
|
+
// 新增折扣提示
|
|
5398
|
+
].filter(Boolean).join("\n");
|
|
5505
5399
|
}
|
|
5506
5400
|
const tech = Spacestationtechnology.find(
|
|
5507
5401
|
(t) => t.techname === techName
|
|
@@ -5509,9 +5403,13 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5509
5403
|
if (!tech) return `❌ 无效科技名称,可用科技:
|
|
5510
5404
|
${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
5511
5405
|
const techDetails = tech.levels.map((level) => {
|
|
5406
|
+
const originalCost = level.cost;
|
|
5407
|
+
const discountedCost = isIntelligenceOfficer ? Math.floor(originalCost * 0.8) : originalCost;
|
|
5408
|
+
const costDesc = isIntelligenceOfficer ? `▸ 升级花费:${discountedCost}金币 (原价${originalCost})` : `▸ 升级花费:${originalCost}金币`;
|
|
5512
5409
|
return [
|
|
5513
5410
|
`✦ 等级 ${romanNumerals[level.level]}`,
|
|
5514
|
-
|
|
5411
|
+
costDesc,
|
|
5412
|
+
// 修改后的价格显示
|
|
5515
5413
|
`▸ 基础效果:${level.description}`,
|
|
5516
5414
|
`💼 ${level.careerBonus}`,
|
|
5517
5415
|
"------------------"
|
|
@@ -5523,16 +5421,14 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
5523
5421
|
'使用 "升级 科技名称" 进行升级',
|
|
5524
5422
|
"====================",
|
|
5525
5423
|
...techDetails,
|
|
5526
|
-
"===================="
|
|
5527
|
-
|
|
5424
|
+
"====================",
|
|
5425
|
+
isIntelligenceOfficer && "※ 情报副官享受20%升级折扣"
|
|
5426
|
+
// 新增折扣提示
|
|
5427
|
+
].filter(Boolean).join("\n");
|
|
5528
5428
|
});
|
|
5529
5429
|
ctx.command("ggcevo/挖矿").action(async ({ session }) => {
|
|
5530
|
-
const convertUTCtoChinaTime2 = /* @__PURE__ */ __name((utcDate) => {
|
|
5531
|
-
const chinaOffset = 8 * 60 * 60 * 1e3;
|
|
5532
|
-
return new Date(utcDate.getTime() + chinaOffset);
|
|
5533
|
-
}, "convertUTCtoChinaTime");
|
|
5534
5430
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
5535
|
-
if (!profile) return "🔒
|
|
5431
|
+
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
5536
5432
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
5537
5433
|
if (await ctx.database.get("ggcevo_blacklist", { handle }).then((r) => r.length)) {
|
|
5538
5434
|
return "⛔ 您已被列入黑名单";
|
|
@@ -5557,8 +5453,8 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
5557
5453
|
return "⛏️ 挖矿作业已开始,至少1小时后可收获。";
|
|
5558
5454
|
}
|
|
5559
5455
|
const nowtime = /* @__PURE__ */ new Date();
|
|
5560
|
-
const chinaStart =
|
|
5561
|
-
const chinaNow =
|
|
5456
|
+
const chinaStart = convertUTCtoChinaTime(record.startTime);
|
|
5457
|
+
const chinaNow = convertUTCtoChinaTime(nowtime);
|
|
5562
5458
|
const duration = Math.floor(
|
|
5563
5459
|
(chinaNow.getTime() - chinaStart.getTime()) / 1e3 / 60
|
|
5564
5460
|
);
|
|
@@ -5569,7 +5465,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
5569
5465
|
`🕒 开始时间:${record.startTime.toLocaleString("zh-CN", { hour12: false })}`,
|
|
5570
5466
|
`⏱️ 当前时间:${nowtime.toLocaleString("zh-CN", { hour12: false })}`,
|
|
5571
5467
|
`⏳ 还需等待:${remaining}分钟`,
|
|
5572
|
-
`💡
|
|
5468
|
+
`💡 提示:挖矿1小时后可随时收获并自动开始下一轮`
|
|
5573
5469
|
].join("\n");
|
|
5574
5470
|
}
|
|
5575
5471
|
const halfHours = Math.floor(duration / 30);
|
|
@@ -5607,11 +5503,8 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
5607
5503
|
`🕒 开始时间:${record.startTime.toLocaleString("zh-CN", { hour12: false })}`,
|
|
5608
5504
|
`⏱️ 结束时间:${nowtime.toLocaleString("zh-CN", { hour12: false })}`,
|
|
5609
5505
|
`⏳ 持续时间:${formatTime(duration)}`,
|
|
5610
|
-
...tech.level >= 4 ? (
|
|
5611
|
-
// 仅当科技等级≥3时显示加成信息
|
|
5612
|
-
[`🔧 科技加成(Lv.${tech.level}):+${multiplier * 100}%`]
|
|
5613
|
-
) : [],
|
|
5614
5506
|
`💰 实际获得:${total}金币`,
|
|
5507
|
+
...tech.level >= 4 ? [`🔧 挖矿系统 Lv.${tech.level}:金币+${multiplier * 100}%`] : [],
|
|
5615
5508
|
"💡 已自动开始下一轮挖矿"
|
|
5616
5509
|
].join("\n");
|
|
5617
5510
|
});
|