koishi-plugin-ggcevo-game 1.2.10 → 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 -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")}`;
|
|
@@ -784,19 +790,15 @@ ${itemDetails.join("\n")}`;
|
|
|
784
790
|
switch (newMonthlyDays) {
|
|
785
791
|
case 7:
|
|
786
792
|
tickets = 4;
|
|
787
|
-
points = getRandomInt(20, 30);
|
|
788
793
|
break;
|
|
789
794
|
case 14:
|
|
790
795
|
tickets = 5;
|
|
791
|
-
points = getRandomInt(30, 50);
|
|
792
796
|
break;
|
|
793
797
|
case 21:
|
|
794
798
|
tickets = 6;
|
|
795
|
-
points = getRandomInt(50, 70);
|
|
796
799
|
break;
|
|
797
800
|
case 28:
|
|
798
801
|
tickets = 7;
|
|
799
|
-
points = getRandomInt(70, 100);
|
|
800
802
|
break;
|
|
801
803
|
}
|
|
802
804
|
await ctx.database.set("ggcevo_sign", { handle }, {
|
|
@@ -1584,7 +1586,7 @@ ${output}`;
|
|
|
1584
1586
|
return `${regionId}-S2-${realmId}-${profileId} 已获得的成就:
|
|
1585
1587
|
${achievementList.join("\n")}`;
|
|
1586
1588
|
});
|
|
1587
|
-
ctx.command("ggcevo
|
|
1589
|
+
ctx.command("ggcevo/信息").alias("个人信息").action(async (argv) => {
|
|
1588
1590
|
const session = argv.session;
|
|
1589
1591
|
const output = [];
|
|
1590
1592
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
@@ -1623,27 +1625,6 @@ ${achievementList.join("\n")}`;
|
|
|
1623
1625
|
"──────────────"
|
|
1624
1626
|
);
|
|
1625
1627
|
}
|
|
1626
|
-
const achievements = await ctx.database.get("ggcevo_achievements", { handle });
|
|
1627
|
-
if (achievements.length) {
|
|
1628
|
-
output.push("🏆 最近成就:");
|
|
1629
|
-
achievements.sort((a, b) => {
|
|
1630
|
-
const aTime = new Date(a.gaintime).getTime();
|
|
1631
|
-
const bTime = new Date(b.gaintime).getTime();
|
|
1632
|
-
return bTime - aTime;
|
|
1633
|
-
}).slice(0, 3).forEach((ach) => {
|
|
1634
|
-
const time = new Date(ach.gaintime).toLocaleDateString("zh-CN", {
|
|
1635
|
-
timeZone: "Asia/Shanghai",
|
|
1636
|
-
year: "numeric",
|
|
1637
|
-
month: "2-digit",
|
|
1638
|
-
day: "2-digit"
|
|
1639
|
-
});
|
|
1640
|
-
output.push(`├ ${ach.achievementname} (${time})`);
|
|
1641
|
-
});
|
|
1642
|
-
output.push(
|
|
1643
|
-
`└ 共获得 ${achievements.length} 个成就`,
|
|
1644
|
-
"──────────────"
|
|
1645
|
-
);
|
|
1646
|
-
}
|
|
1647
1628
|
const exchanges = await ctx.database.get("ggcevo_exchange", { handle });
|
|
1648
1629
|
if (exchanges.length) {
|
|
1649
1630
|
output.push("📜 兑换记录:");
|
|
@@ -1666,7 +1647,6 @@ ${achievementList.join("\n")}`;
|
|
|
1666
1647
|
const existModules = [
|
|
1667
1648
|
sign && "签到",
|
|
1668
1649
|
lottery && "抽奖",
|
|
1669
|
-
achievements.length && "成就",
|
|
1670
1650
|
exchanges.length && "兑换"
|
|
1671
1651
|
].filter(Boolean);
|
|
1672
1652
|
output.push(`📊 共查询到 ${existModules.length} 类信息`);
|
|
@@ -1958,7 +1938,7 @@ ${achievementList.join("\n")}`;
|
|
|
1958
1938
|
day: "2-digit"
|
|
1959
1939
|
})}`;
|
|
1960
1940
|
});
|
|
1961
|
-
ctx.command("ggcevo
|
|
1941
|
+
ctx.command("ggcevo/武器库").action(async ({ session }) => {
|
|
1962
1942
|
const items = Object.entries(weaponConfig).map(([name2, config2]) => {
|
|
1963
1943
|
const tagEffectsDesc = config2.tagEffects ? Object.entries(config2.tagEffects).map(([tag, multiplier]) => `▸ 对${tag}目标造成${(multiplier * 100).toFixed(0)}%伤害`).join("\n") : "▸ 无特殊加成效果";
|
|
1964
1944
|
return [
|
|
@@ -1972,7 +1952,7 @@ ${achievementList.join("\n")}`;
|
|
|
1972
1952
|
].join("\n");
|
|
1973
1953
|
});
|
|
1974
1954
|
return [
|
|
1975
|
-
"🏪
|
|
1955
|
+
"🏪 咕咕军火武器库 🏪",
|
|
1976
1956
|
"使用“购买 武器名称”命令进行购买",
|
|
1977
1957
|
"====================",
|
|
1978
1958
|
...items
|
|
@@ -2006,11 +1986,11 @@ ${achievementList.join("\n")}`;
|
|
|
2006
1986
|
equipped: false
|
|
2007
1987
|
}], ["handle", "weaponId"]);
|
|
2008
1988
|
});
|
|
2009
|
-
return `成功购买 ${weapon}
|
|
1989
|
+
return `成功购买 ${weapon}!输入“武器列表”查看你的武器库`;
|
|
2010
1990
|
});
|
|
2011
|
-
ctx.command("ggcevo
|
|
1991
|
+
ctx.command("ggcevo/武器列表").action(async ({ session }) => {
|
|
2012
1992
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2013
|
-
if (!profile) return "
|
|
1993
|
+
if (!profile) return "您暂未绑定句柄";
|
|
2014
1994
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
2015
1995
|
const weapons = await ctx.database.get("ggcevo_equipment", {
|
|
2016
1996
|
handle
|
|
@@ -2030,13 +2010,13 @@ ${achievementList.join("\n")}`;
|
|
|
2030
2010
|
].join("\n");
|
|
2031
2011
|
}));
|
|
2032
2012
|
return [
|
|
2033
|
-
"🛡️
|
|
2034
|
-
'使用"装备 武器名称"
|
|
2013
|
+
"🛡️ 当前武器列表",
|
|
2014
|
+
'使用"装备 武器名称"切换武器',
|
|
2035
2015
|
"⚡表示当前装备武器",
|
|
2036
2016
|
"────────────────",
|
|
2037
|
-
...weaponDetails.length ? weaponDetails : ["
|
|
2017
|
+
...weaponDetails.length ? weaponDetails : ["空空如也,快去武器库看看吧!"],
|
|
2038
2018
|
"────────────────",
|
|
2039
|
-
"💡
|
|
2019
|
+
"💡 武器效果说明:",
|
|
2040
2020
|
"⚡ 已装备武器会在战斗中生效",
|
|
2041
2021
|
"🔧 改装效果仅在战斗时计算"
|
|
2042
2022
|
].join("\n");
|
|
@@ -2070,7 +2050,7 @@ ${achievementList.join("\n")}`;
|
|
|
2070
2050
|
});
|
|
2071
2051
|
return `已成功装备 ${weapon}!`;
|
|
2072
2052
|
});
|
|
2073
|
-
ctx.command("ggcevo/升级 <weapon>", "升级武器伤害").action(async ({ session }, weapon) => {
|
|
2053
|
+
ctx.command("ggcevo/升级 <weapon>", "升级武器伤害").alias("升级武器").action(async ({ session }, weapon) => {
|
|
2074
2054
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
2075
2055
|
if (!profile) return "您暂未绑定句柄";
|
|
2076
2056
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
@@ -2079,6 +2059,7 @@ ${achievementList.join("\n")}`;
|
|
|
2079
2059
|
handle,
|
|
2080
2060
|
weaponId: weaponConfig[weapon]?.id
|
|
2081
2061
|
});
|
|
2062
|
+
if (!weapon) return "您没有输入需要升级的武器名称。";
|
|
2082
2063
|
if (!equipment) return "尚未获得该武器";
|
|
2083
2064
|
if (equipment.level >= 6) return "该武器已达最大升级等级";
|
|
2084
2065
|
const upgradeCost = [1050, 1450, 1850, 2250, 2650, 3050][equipment.level];
|
|
@@ -2099,7 +2080,7 @@ ${achievementList.join("\n")}`;
|
|
|
2099
2080
|
const slots = Math.floor(newLevel / 3) + 1;
|
|
2100
2081
|
return `${weapon} 升级成功!当前等级:${newLevel},伤害:${baseDamage},可用改装槽:${slots}个`;
|
|
2101
2082
|
});
|
|
2102
|
-
ctx.command("ggcevo/改装 <weapon> [mod]", "安装武器改装件").action(async ({ session }, weapon, mod) => {
|
|
2083
|
+
ctx.command("ggcevo/改装 <weapon> [mod]", "安装武器改装件").alias("改装武器").action(async ({ session }, weapon, mod) => {
|
|
2103
2084
|
const isValidWeapon = weapon && weaponConfig[weapon]?.id !== void 0;
|
|
2104
2085
|
const generateModList = /* @__PURE__ */ __name(() => {
|
|
2105
2086
|
if (!isValidWeapon) {
|
|
@@ -2224,20 +2205,31 @@ ${achievementList.join("\n")}`;
|
|
|
2224
2205
|
let damage = weaponData.damage * (1 + 0.1 * equippedWeapon.level);
|
|
2225
2206
|
let totalModAdd = 0;
|
|
2226
2207
|
let hasCrit = false;
|
|
2208
|
+
let hasCrystal = false;
|
|
2209
|
+
let hasOverload = false;
|
|
2227
2210
|
equippedWeapon.installedMods.forEach((mod) => {
|
|
2228
2211
|
if (mod === "动能增幅") {
|
|
2229
2212
|
totalModAdd += 0.2;
|
|
2230
2213
|
}
|
|
2231
|
-
if (mod === "
|
|
2232
|
-
if (
|
|
2233
|
-
|
|
2234
|
-
totalModAdd += 1;
|
|
2214
|
+
if (mod === "裂甲核心") {
|
|
2215
|
+
if (weaponName === modConfig["裂甲核心"].exclusiveTo) {
|
|
2216
|
+
totalModAdd += 0.4;
|
|
2235
2217
|
}
|
|
2236
2218
|
}
|
|
2237
|
-
if (mod === "
|
|
2238
|
-
|
|
2219
|
+
if (mod === "棱镜水晶") {
|
|
2220
|
+
hasCrystal = true;
|
|
2221
|
+
}
|
|
2222
|
+
if (mod === "棱镜超载核心") {
|
|
2223
|
+
if (weaponName === modConfig["棱镜超载核心"].exclusiveTo) {
|
|
2224
|
+
hasOverload = true;
|
|
2225
|
+
}
|
|
2239
2226
|
}
|
|
2240
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
|
+
}
|
|
2241
2233
|
damage = damage * (1 + totalModAdd);
|
|
2242
2234
|
const targetBossConfig = targetBoss.type === "主宰" ? bossGroup.main : bossGroup.minions[0];
|
|
2243
2235
|
if (targetBossConfig.tags && targetBossConfig.tags.length > 0) {
|