koishi-plugin-ggcevo-game 1.2.11 → 1.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +46 -51
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -317,6 +317,12 @@ function apply(ctx, config) {
|
|
|
317
317
|
// 指定专属武器
|
|
318
318
|
isExclusive: true
|
|
319
319
|
// 标记为专属模块
|
|
320
|
+
},
|
|
321
|
+
"棱镜超载核心": {
|
|
322
|
+
cost: 2500,
|
|
323
|
+
effect: "暴击率+80%",
|
|
324
|
+
exclusiveTo: "激光步枪",
|
|
325
|
+
isExclusive: true
|
|
320
326
|
}
|
|
321
327
|
};
|
|
322
328
|
const passiveConfig = {
|
|
@@ -355,11 +361,11 @@ function apply(ctx, config) {
|
|
|
355
361
|
"t2级宠物扭蛋": { id: 5, type: "宠物蛋", description: "用于兑换t2系列宠物" },
|
|
356
362
|
"t1级宠物扭蛋": { id: 6, type: "宠物蛋", description: "用于兑换t1系列宠物" },
|
|
357
363
|
"t0级宠物扭蛋": { id: 7, type: "宠物蛋", description: "用于兑换t0系列宠物" },
|
|
358
|
-
"🥇先行者赛季冠军勋章": { id: 101, type: "勋章", description: "
|
|
359
|
-
"🥈先行者赛季亚军勋章": { id: 102, type: "勋章", description: "
|
|
360
|
-
"🥉先行者赛季季军勋章": { id: 103, type: "勋章", description: "
|
|
361
|
-
"🏅先行者赛季前十勋章": { id: 104, type: "勋章", description: "
|
|
362
|
-
"🎖先行者赛季前二十勋章": { id: 105, type: "勋章", description: "
|
|
364
|
+
"🥇先行者赛季冠军勋章": { id: 101, type: "勋章", description: "" },
|
|
365
|
+
"🥈先行者赛季亚军勋章": { id: 102, type: "勋章", description: "" },
|
|
366
|
+
"🥉先行者赛季季军勋章": { id: 103, type: "勋章", description: "" },
|
|
367
|
+
"🏅先行者赛季前十勋章": { id: 104, type: "勋章", description: "" },
|
|
368
|
+
"🎖先行者赛季前二十勋章": { id: 105, type: "勋章", description: "" }
|
|
363
369
|
};
|
|
364
370
|
const itemConfig = {
|
|
365
371
|
"拾荒者": { quality: "t3", type: "皮肤", cost: 3, isLimited: false },
|
|
@@ -651,7 +657,7 @@ function apply(ctx, config) {
|
|
|
651
657
|
ctx.command("ggcevo/背包").action(async (argv) => {
|
|
652
658
|
const session = argv.session;
|
|
653
659
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
654
|
-
if (!profile) return "
|
|
660
|
+
if (!profile) return "您暂未绑定句柄。";
|
|
655
661
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
656
662
|
const items = await ctx.database.get("ggcevo_backpack", { handle });
|
|
657
663
|
const validItems = items.filter((item) => item.quantity > 0);
|
|
@@ -662,7 +668,7 @@ function apply(ctx, config) {
|
|
|
662
668
|
);
|
|
663
669
|
if (!entry) return `未知物品 × ${userItem.quantity}:数据异常,请联系管理员`;
|
|
664
670
|
const [itemName, itemData] = entry;
|
|
665
|
-
return `${itemName} × ${userItem.quantity}:${itemData.description}`;
|
|
671
|
+
return itemData.description ? `${itemName} × ${userItem.quantity}:${itemData.description}` : `${itemName} × ${userItem.quantity}`;
|
|
666
672
|
});
|
|
667
673
|
return `【${handle}的背包】
|
|
668
674
|
${itemDetails.join("\n")}`;
|
|
@@ -1580,7 +1586,7 @@ ${output}`;
|
|
|
1580
1586
|
return `${regionId}-S2-${realmId}-${profileId} 已获得的成就:
|
|
1581
1587
|
${achievementList.join("\n")}`;
|
|
1582
1588
|
});
|
|
1583
|
-
ctx.command("ggcevo
|
|
1589
|
+
ctx.command("ggcevo/信息").alias("个人信息").action(async (argv) => {
|
|
1584
1590
|
const session = argv.session;
|
|
1585
1591
|
const output = [];
|
|
1586
1592
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
@@ -1619,27 +1625,6 @@ ${achievementList.join("\n")}`;
|
|
|
1619
1625
|
"──────────────"
|
|
1620
1626
|
);
|
|
1621
1627
|
}
|
|
1622
|
-
const achievements = await ctx.database.get("ggcevo_achievements", { handle });
|
|
1623
|
-
if (achievements.length) {
|
|
1624
|
-
output.push("🏆 最近成就:");
|
|
1625
|
-
achievements.sort((a, b) => {
|
|
1626
|
-
const aTime = new Date(a.gaintime).getTime();
|
|
1627
|
-
const bTime = new Date(b.gaintime).getTime();
|
|
1628
|
-
return bTime - aTime;
|
|
1629
|
-
}).slice(0, 3).forEach((ach) => {
|
|
1630
|
-
const time = new Date(ach.gaintime).toLocaleDateString("zh-CN", {
|
|
1631
|
-
timeZone: "Asia/Shanghai",
|
|
1632
|
-
year: "numeric",
|
|
1633
|
-
month: "2-digit",
|
|
1634
|
-
day: "2-digit"
|
|
1635
|
-
});
|
|
1636
|
-
output.push(`├ ${ach.achievementname} (${time})`);
|
|
1637
|
-
});
|
|
1638
|
-
output.push(
|
|
1639
|
-
`└ 共获得 ${achievements.length} 个成就`,
|
|
1640
|
-
"──────────────"
|
|
1641
|
-
);
|
|
1642
|
-
}
|
|
1643
1628
|
const exchanges = await ctx.database.get("ggcevo_exchange", { handle });
|
|
1644
1629
|
if (exchanges.length) {
|
|
1645
1630
|
output.push("📜 兑换记录:");
|
|
@@ -1662,7 +1647,6 @@ ${achievementList.join("\n")}`;
|
|
|
1662
1647
|
const existModules = [
|
|
1663
1648
|
sign && "签到",
|
|
1664
1649
|
lottery && "抽奖",
|
|
1665
|
-
achievements.length && "成就",
|
|
1666
1650
|
exchanges.length && "兑换"
|
|
1667
1651
|
].filter(Boolean);
|
|
1668
1652
|
output.push(`📊 共查询到 ${existModules.length} 类信息`);
|
|
@@ -1717,15 +1701,14 @@ ${achievementList.join("\n")}`;
|
|
|
1717
1701
|
const message = [
|
|
1718
1702
|
`📺 监测到违规大厅 ID: ${lobby.id}`,
|
|
1719
1703
|
`创建时间: ${new Date(lobby.createdAt).toLocaleString("zh-CN")}`,
|
|
1720
|
-
|
|
1721
|
-
🚨 违规玩家(${violators.length} 人):`,
|
|
1722
|
-
// 合并两行并添加换行符
|
|
1704
|
+
`🚨 违规玩家(${violators.length} 人):`,
|
|
1723
1705
|
...violators.map((v) => {
|
|
1724
1706
|
const record = punishmentRecords.find((r) => r.handle === v.handle);
|
|
1725
1707
|
return `· ${v.name}(${record?.level}级处罚)`;
|
|
1726
1708
|
}),
|
|
1727
1709
|
`房主: ${lobby.hostName}`,
|
|
1728
|
-
`玩家数: ${lobby.slotsHumansTaken}/${lobby.slotsHumansTotal}
|
|
1710
|
+
`玩家数: ${lobby.slotsHumansTaken}/${lobby.slotsHumansTotal}`,
|
|
1711
|
+
`🏆 安全玩家:${atElements || "无"}`
|
|
1729
1712
|
].join("\n");
|
|
1730
1713
|
await ctx.broadcast(config.groupId, message);
|
|
1731
1714
|
processedLobbies.add(lobby.id);
|
|
@@ -1954,7 +1937,7 @@ ${achievementList.join("\n")}`;
|
|
|
1954
1937
|
day: "2-digit"
|
|
1955
1938
|
})}`;
|
|
1956
1939
|
});
|
|
1957
|
-
ctx.command("ggcevo
|
|
1940
|
+
ctx.command("ggcevo/武器库").action(async ({ session }) => {
|
|
1958
1941
|
const items = Object.entries(weaponConfig).map(([name2, config2]) => {
|
|
1959
1942
|
const tagEffectsDesc = config2.tagEffects ? Object.entries(config2.tagEffects).map(([tag, multiplier]) => `▸ 对${tag}目标造成${(multiplier * 100).toFixed(0)}%伤害`).join("\n") : "▸ 无特殊加成效果";
|
|
1960
1943
|
return [
|
|
@@ -1968,7 +1951,7 @@ ${achievementList.join("\n")}`;
|
|
|
1968
1951
|
].join("\n");
|
|
1969
1952
|
});
|
|
1970
1953
|
return [
|
|
1971
|
-
"🏪
|
|
1954
|
+
"🏪 咕咕军火武器库 🏪",
|
|
1972
1955
|
"使用“购买 武器名称”命令进行购买",
|
|
1973
1956
|
"====================",
|
|
1974
1957
|
...items
|
|
@@ -2002,11 +1985,11 @@ ${achievementList.join("\n")}`;
|
|
|
2002
1985
|
equipped: false
|
|
2003
1986
|
}], ["handle", "weaponId"]);
|
|
2004
1987
|
});
|
|
2005
|
-
return `成功购买 ${weapon}
|
|
1988
|
+
return `成功购买 ${weapon}!输入“武器列表”查看你的武器库`;
|
|
2006
1989
|
});
|
|
2007
|
-
ctx.command("ggcevo
|
|
1990
|
+
ctx.command("ggcevo/武器列表").action(async ({ session }) => {
|
|
2008
1991
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2009
|
-
if (!profile) return "
|
|
1992
|
+
if (!profile) return "您暂未绑定句柄";
|
|
2010
1993
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
2011
1994
|
const weapons = await ctx.database.get("ggcevo_equipment", {
|
|
2012
1995
|
handle
|
|
@@ -2026,13 +2009,13 @@ ${achievementList.join("\n")}`;
|
|
|
2026
2009
|
].join("\n");
|
|
2027
2010
|
}));
|
|
2028
2011
|
return [
|
|
2029
|
-
"🛡️
|
|
2030
|
-
'使用"装备 武器名称"
|
|
2012
|
+
"🛡️ 当前武器列表",
|
|
2013
|
+
'使用"装备 武器名称"切换武器',
|
|
2031
2014
|
"⚡表示当前装备武器",
|
|
2032
2015
|
"────────────────",
|
|
2033
|
-
...weaponDetails.length ? weaponDetails : ["
|
|
2016
|
+
...weaponDetails.length ? weaponDetails : ["空空如也,快去武器库看看吧!"],
|
|
2034
2017
|
"────────────────",
|
|
2035
|
-
"💡
|
|
2018
|
+
"💡 武器效果说明:",
|
|
2036
2019
|
"⚡ 已装备武器会在战斗中生效",
|
|
2037
2020
|
"🔧 改装效果仅在战斗时计算"
|
|
2038
2021
|
].join("\n");
|
|
@@ -2066,7 +2049,7 @@ ${achievementList.join("\n")}`;
|
|
|
2066
2049
|
});
|
|
2067
2050
|
return `已成功装备 ${weapon}!`;
|
|
2068
2051
|
});
|
|
2069
|
-
ctx.command("ggcevo/升级 <weapon>", "升级武器伤害").action(async ({ session }, weapon) => {
|
|
2052
|
+
ctx.command("ggcevo/升级 <weapon>", "升级武器伤害").alias("升级武器").action(async ({ session }, weapon) => {
|
|
2070
2053
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2071
2054
|
if (!profile) return "您暂未绑定句柄";
|
|
2072
2055
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
@@ -2075,6 +2058,7 @@ ${achievementList.join("\n")}`;
|
|
|
2075
2058
|
handle,
|
|
2076
2059
|
weaponId: weaponConfig[weapon]?.id
|
|
2077
2060
|
});
|
|
2061
|
+
if (!weapon) return "您没有输入需要升级的武器名称。";
|
|
2078
2062
|
if (!equipment) return "尚未获得该武器";
|
|
2079
2063
|
if (equipment.level >= 6) return "该武器已达最大升级等级";
|
|
2080
2064
|
const upgradeCost = [1050, 1450, 1850, 2250, 2650, 3050][equipment.level];
|
|
@@ -2095,7 +2079,7 @@ ${achievementList.join("\n")}`;
|
|
|
2095
2079
|
const slots = Math.floor(newLevel / 3) + 1;
|
|
2096
2080
|
return `${weapon} 升级成功!当前等级:${newLevel},伤害:${baseDamage},可用改装槽:${slots}个`;
|
|
2097
2081
|
});
|
|
2098
|
-
ctx.command("ggcevo/改装 <weapon> [mod]", "安装武器改装件").action(async ({ session }, weapon, mod) => {
|
|
2082
|
+
ctx.command("ggcevo/改装 <weapon> [mod]", "安装武器改装件").alias("改装武器").action(async ({ session }, weapon, mod) => {
|
|
2099
2083
|
const isValidWeapon = weapon && weaponConfig[weapon]?.id !== void 0;
|
|
2100
2084
|
const generateModList = /* @__PURE__ */ __name(() => {
|
|
2101
2085
|
if (!isValidWeapon) {
|
|
@@ -2220,20 +2204,31 @@ ${achievementList.join("\n")}`;
|
|
|
2220
2204
|
let damage = weaponData.damage * (1 + 0.1 * equippedWeapon.level);
|
|
2221
2205
|
let totalModAdd = 0;
|
|
2222
2206
|
let hasCrit = false;
|
|
2207
|
+
let hasCrystal = false;
|
|
2208
|
+
let hasOverload = false;
|
|
2223
2209
|
equippedWeapon.installedMods.forEach((mod) => {
|
|
2224
2210
|
if (mod === "动能增幅") {
|
|
2225
2211
|
totalModAdd += 0.2;
|
|
2226
2212
|
}
|
|
2227
|
-
if (mod === "
|
|
2228
|
-
if (
|
|
2229
|
-
|
|
2230
|
-
totalModAdd += 1;
|
|
2213
|
+
if (mod === "裂甲核心") {
|
|
2214
|
+
if (weaponName === modConfig["裂甲核心"].exclusiveTo) {
|
|
2215
|
+
totalModAdd += 0.4;
|
|
2231
2216
|
}
|
|
2232
2217
|
}
|
|
2233
|
-
if (mod === "
|
|
2234
|
-
|
|
2218
|
+
if (mod === "棱镜水晶") {
|
|
2219
|
+
hasCrystal = true;
|
|
2220
|
+
}
|
|
2221
|
+
if (mod === "棱镜超载核心") {
|
|
2222
|
+
if (weaponName === modConfig["棱镜超载核心"].exclusiveTo) {
|
|
2223
|
+
hasOverload = true;
|
|
2224
|
+
}
|
|
2235
2225
|
}
|
|
2236
2226
|
});
|
|
2227
|
+
const totalCritRate = (hasCrystal ? 20 : 0) + (hasOverload ? 80 : 0);
|
|
2228
|
+
if (totalCritRate > 0 && Math.random() < totalCritRate / 100) {
|
|
2229
|
+
hasCrit = true;
|
|
2230
|
+
totalModAdd += 1;
|
|
2231
|
+
}
|
|
2237
2232
|
damage = damage * (1 + totalModAdd);
|
|
2238
2233
|
const targetBossConfig = targetBoss.type === "主宰" ? bossGroup.main : bossGroup.minions[0];
|
|
2239
2234
|
if (targetBossConfig.tags && targetBossConfig.tags.length > 0) {
|