koishi-plugin-ggcevo-game 1.2.11 → 1.2.12
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 +43 -47
- 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} 类信息`);
|
|
@@ -1954,7 +1938,7 @@ ${achievementList.join("\n")}`;
|
|
|
1954
1938
|
day: "2-digit"
|
|
1955
1939
|
})}`;
|
|
1956
1940
|
});
|
|
1957
|
-
ctx.command("ggcevo
|
|
1941
|
+
ctx.command("ggcevo/武器库").action(async ({ session }) => {
|
|
1958
1942
|
const items = Object.entries(weaponConfig).map(([name2, config2]) => {
|
|
1959
1943
|
const tagEffectsDesc = config2.tagEffects ? Object.entries(config2.tagEffects).map(([tag, multiplier]) => `▸ 对${tag}目标造成${(multiplier * 100).toFixed(0)}%伤害`).join("\n") : "▸ 无特殊加成效果";
|
|
1960
1944
|
return [
|
|
@@ -1968,7 +1952,7 @@ ${achievementList.join("\n")}`;
|
|
|
1968
1952
|
].join("\n");
|
|
1969
1953
|
});
|
|
1970
1954
|
return [
|
|
1971
|
-
"🏪
|
|
1955
|
+
"🏪 咕咕军火武器库 🏪",
|
|
1972
1956
|
"使用“购买 武器名称”命令进行购买",
|
|
1973
1957
|
"====================",
|
|
1974
1958
|
...items
|
|
@@ -2002,11 +1986,11 @@ ${achievementList.join("\n")}`;
|
|
|
2002
1986
|
equipped: false
|
|
2003
1987
|
}], ["handle", "weaponId"]);
|
|
2004
1988
|
});
|
|
2005
|
-
return `成功购买 ${weapon}
|
|
1989
|
+
return `成功购买 ${weapon}!输入“武器列表”查看你的武器库`;
|
|
2006
1990
|
});
|
|
2007
|
-
ctx.command("ggcevo
|
|
1991
|
+
ctx.command("ggcevo/武器列表").action(async ({ session }) => {
|
|
2008
1992
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2009
|
-
if (!profile) return "
|
|
1993
|
+
if (!profile) return "您暂未绑定句柄";
|
|
2010
1994
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
2011
1995
|
const weapons = await ctx.database.get("ggcevo_equipment", {
|
|
2012
1996
|
handle
|
|
@@ -2026,13 +2010,13 @@ ${achievementList.join("\n")}`;
|
|
|
2026
2010
|
].join("\n");
|
|
2027
2011
|
}));
|
|
2028
2012
|
return [
|
|
2029
|
-
"🛡️
|
|
2030
|
-
'使用"装备 武器名称"
|
|
2013
|
+
"🛡️ 当前武器列表",
|
|
2014
|
+
'使用"装备 武器名称"切换武器',
|
|
2031
2015
|
"⚡表示当前装备武器",
|
|
2032
2016
|
"────────────────",
|
|
2033
|
-
...weaponDetails.length ? weaponDetails : ["
|
|
2017
|
+
...weaponDetails.length ? weaponDetails : ["空空如也,快去武器库看看吧!"],
|
|
2034
2018
|
"────────────────",
|
|
2035
|
-
"💡
|
|
2019
|
+
"💡 武器效果说明:",
|
|
2036
2020
|
"⚡ 已装备武器会在战斗中生效",
|
|
2037
2021
|
"🔧 改装效果仅在战斗时计算"
|
|
2038
2022
|
].join("\n");
|
|
@@ -2066,7 +2050,7 @@ ${achievementList.join("\n")}`;
|
|
|
2066
2050
|
});
|
|
2067
2051
|
return `已成功装备 ${weapon}!`;
|
|
2068
2052
|
});
|
|
2069
|
-
ctx.command("ggcevo/升级 <weapon>", "升级武器伤害").action(async ({ session }, weapon) => {
|
|
2053
|
+
ctx.command("ggcevo/升级 <weapon>", "升级武器伤害").alias("升级武器").action(async ({ session }, weapon) => {
|
|
2070
2054
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2071
2055
|
if (!profile) return "您暂未绑定句柄";
|
|
2072
2056
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
@@ -2075,6 +2059,7 @@ ${achievementList.join("\n")}`;
|
|
|
2075
2059
|
handle,
|
|
2076
2060
|
weaponId: weaponConfig[weapon]?.id
|
|
2077
2061
|
});
|
|
2062
|
+
if (!weapon) return "您没有输入需要升级的武器名称。";
|
|
2078
2063
|
if (!equipment) return "尚未获得该武器";
|
|
2079
2064
|
if (equipment.level >= 6) return "该武器已达最大升级等级";
|
|
2080
2065
|
const upgradeCost = [1050, 1450, 1850, 2250, 2650, 3050][equipment.level];
|
|
@@ -2095,7 +2080,7 @@ ${achievementList.join("\n")}`;
|
|
|
2095
2080
|
const slots = Math.floor(newLevel / 3) + 1;
|
|
2096
2081
|
return `${weapon} 升级成功!当前等级:${newLevel},伤害:${baseDamage},可用改装槽:${slots}个`;
|
|
2097
2082
|
});
|
|
2098
|
-
ctx.command("ggcevo/改装 <weapon> [mod]", "安装武器改装件").action(async ({ session }, weapon, mod) => {
|
|
2083
|
+
ctx.command("ggcevo/改装 <weapon> [mod]", "安装武器改装件").alias("改装武器").action(async ({ session }, weapon, mod) => {
|
|
2099
2084
|
const isValidWeapon = weapon && weaponConfig[weapon]?.id !== void 0;
|
|
2100
2085
|
const generateModList = /* @__PURE__ */ __name(() => {
|
|
2101
2086
|
if (!isValidWeapon) {
|
|
@@ -2220,20 +2205,31 @@ ${achievementList.join("\n")}`;
|
|
|
2220
2205
|
let damage = weaponData.damage * (1 + 0.1 * equippedWeapon.level);
|
|
2221
2206
|
let totalModAdd = 0;
|
|
2222
2207
|
let hasCrit = false;
|
|
2208
|
+
let hasCrystal = false;
|
|
2209
|
+
let hasOverload = false;
|
|
2223
2210
|
equippedWeapon.installedMods.forEach((mod) => {
|
|
2224
2211
|
if (mod === "动能增幅") {
|
|
2225
2212
|
totalModAdd += 0.2;
|
|
2226
2213
|
}
|
|
2227
|
-
if (mod === "
|
|
2228
|
-
if (
|
|
2229
|
-
|
|
2230
|
-
totalModAdd += 1;
|
|
2214
|
+
if (mod === "裂甲核心") {
|
|
2215
|
+
if (weaponName === modConfig["裂甲核心"].exclusiveTo) {
|
|
2216
|
+
totalModAdd += 0.4;
|
|
2231
2217
|
}
|
|
2232
2218
|
}
|
|
2233
|
-
if (mod === "
|
|
2234
|
-
|
|
2219
|
+
if (mod === "棱镜水晶") {
|
|
2220
|
+
hasCrystal = true;
|
|
2221
|
+
}
|
|
2222
|
+
if (mod === "棱镜超载核心") {
|
|
2223
|
+
if (weaponName === modConfig["棱镜超载核心"].exclusiveTo) {
|
|
2224
|
+
hasOverload = true;
|
|
2225
|
+
}
|
|
2235
2226
|
}
|
|
2236
2227
|
});
|
|
2228
|
+
const totalCritRate = (hasCrystal ? 20 : 0) + (hasOverload ? 80 : 0);
|
|
2229
|
+
if (totalCritRate > 0 && Math.random() < totalCritRate / 100) {
|
|
2230
|
+
hasCrit = true;
|
|
2231
|
+
totalModAdd += 1;
|
|
2232
|
+
}
|
|
2237
2233
|
damage = damage * (1 + totalModAdd);
|
|
2238
2234
|
const targetBossConfig = targetBoss.type === "主宰" ? bossGroup.main : bossGroup.minions[0];
|
|
2239
2235
|
if (targetBossConfig.tags && targetBossConfig.tags.length > 0) {
|