koishi-plugin-ggcevo-game 1.4.6 → 1.4.7
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 +31 -31
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1918,7 +1918,7 @@ async function handleTechUpgrade(ctx, handle, target) {
|
|
|
1918
1918
|
if (careerData.career === "情报副官") {
|
|
1919
1919
|
discountApplied = true;
|
|
1920
1920
|
actualCost = Math.floor(originalCost * 0.9);
|
|
1921
|
-
discountDetails.push("🎖️
|
|
1921
|
+
discountDetails.push("🎖️ 情报副官职业:10%折扣");
|
|
1922
1922
|
}
|
|
1923
1923
|
const [signInfo] = await ctx.database.get("ggcevo_sign", { handle });
|
|
1924
1924
|
if (signInfo?.totalRewards < actualCost) {
|
|
@@ -2007,7 +2007,7 @@ async function handleWeaponUpgrade(ctx, handle, target) {
|
|
|
2007
2007
|
const isGunslinger = careerData?.career === "枪手";
|
|
2008
2008
|
if (isGunslinger) {
|
|
2009
2009
|
totalDiscount += 10;
|
|
2010
|
-
discountDetails.push("🔫
|
|
2010
|
+
discountDetails.push("🔫 枪手职业:10%折扣");
|
|
2011
2011
|
}
|
|
2012
2012
|
if (careerData?.group === "人类联盟") {
|
|
2013
2013
|
const [weaponTech] = await ctx.database.get("ggcevo_tech", { handle, techId: 2 }).catch(() => [{ level: 0 }]);
|
|
@@ -2021,14 +2021,14 @@ async function handleWeaponUpgrade(ctx, handle, target) {
|
|
|
2021
2021
|
if (weaponDiscount > 0) {
|
|
2022
2022
|
totalDiscount += weaponDiscount;
|
|
2023
2023
|
discountDetails.push(
|
|
2024
|
-
`⚙️
|
|
2024
|
+
`⚙️ 武器系统科技Lv${techLevel}:${weaponDiscount}%折扣`
|
|
2025
2025
|
);
|
|
2026
2026
|
}
|
|
2027
2027
|
}
|
|
2028
2028
|
const activeWish = await checkFoxBlessing(ctx, handle);
|
|
2029
2029
|
if (activeWish) {
|
|
2030
2030
|
totalDiscount += 20;
|
|
2031
|
-
discountDetails.push("🦊
|
|
2031
|
+
discountDetails.push("🦊 灵狐升运祈愿:20%折扣");
|
|
2032
2032
|
}
|
|
2033
2033
|
totalDiscount = Math.min(totalDiscount, 100);
|
|
2034
2034
|
const discountedCost = baseCost * (100 - totalDiscount) / 100;
|
|
@@ -2152,29 +2152,29 @@ ${priceInfo}`);
|
|
|
2152
2152
|
discountNotice.push("💰 当前折扣:");
|
|
2153
2153
|
}
|
|
2154
2154
|
if (isGunslinger) {
|
|
2155
|
-
discountNotice.push(`🔫
|
|
2155
|
+
discountNotice.push(`🔫 枪手职业:10%升级武器折扣`);
|
|
2156
2156
|
}
|
|
2157
2157
|
if (isAlliance && hasTechDiscount) {
|
|
2158
|
-
discountNotice.push(`⚙️
|
|
2158
|
+
discountNotice.push(`⚙️ 武器系统科技Lv${techLevel}:${techDiscountRate}%折扣`);
|
|
2159
2159
|
}
|
|
2160
2160
|
if (hasFoxDiscount) {
|
|
2161
|
-
discountNotice.push(`🦊
|
|
2161
|
+
discountNotice.push(`🦊 灵狐升运祈愿:20%折扣`);
|
|
2162
2162
|
}
|
|
2163
2163
|
if (!hasTechDiscount && !hasFoxDiscount && !hasGunslingerDiscount) {
|
|
2164
2164
|
if (isAlliance) {
|
|
2165
|
-
discountNotice.push("💡
|
|
2165
|
+
discountNotice.push("💡 提示:升级武器系统科技可获得折扣");
|
|
2166
2166
|
} else if (careerData?.group === "辛迪加海盗") {
|
|
2167
|
-
discountNotice.push("💡
|
|
2167
|
+
discountNotice.push("💡 提示:转职为枪手职业可获得折扣");
|
|
2168
2168
|
} else {
|
|
2169
2169
|
discountNotice.push("💡 提示:加入人类联盟或辛迪加海盗可获得折扣");
|
|
2170
2170
|
}
|
|
2171
2171
|
}
|
|
2172
2172
|
if (isGunslinger) {
|
|
2173
|
-
discountNotice.push("🔝
|
|
2173
|
+
discountNotice.push("🔝 枪手职业:武器等级上限提升至7级");
|
|
2174
2174
|
}
|
|
2175
2175
|
return [
|
|
2176
2176
|
"⚡ 武器升级价格表 ⚡",
|
|
2177
|
-
`武器等级上限: ${maxLevel}级(${isGunslinger ? "
|
|
2177
|
+
`武器等级上限: ${maxLevel}级(${isGunslinger ? "枪手职业" : "普通玩家"})`,
|
|
2178
2178
|
"使用「升级 武器名称」对武器进行等级升级",
|
|
2179
2179
|
...discountNotice,
|
|
2180
2180
|
"====================",
|
|
@@ -3875,10 +3875,10 @@ async function calculateRewards(ctx, handle, username, totalDamage) {
|
|
|
3875
3875
|
let careerMessage = "";
|
|
3876
3876
|
if (career === "警卫员下士") {
|
|
3877
3877
|
careerMultiplier = 50;
|
|
3878
|
-
careerMessage = "🛡️
|
|
3878
|
+
careerMessage = "🛡️ 警卫员下士职业:+50%金币";
|
|
3879
3879
|
} else if (career === "警卫长") {
|
|
3880
3880
|
careerMultiplier = 100;
|
|
3881
|
-
careerMessage = "🛡️
|
|
3881
|
+
careerMessage = "🛡️ 警卫长职业:+100%金币";
|
|
3882
3882
|
}
|
|
3883
3883
|
const totalBonusPercent = careerMultiplier + techBonusPercent;
|
|
3884
3884
|
const totalBonusFactor = 1 + totalBonusPercent / 100;
|
|
@@ -3889,7 +3889,7 @@ async function calculateRewards(ctx, handle, username, totalDamage) {
|
|
|
3889
3889
|
handle,
|
|
3890
3890
|
redcrystal: (careerData?.redcrystal || 0) + 1
|
|
3891
3891
|
}], ["handle"]);
|
|
3892
|
-
redcrystalMessage = "🔴
|
|
3892
|
+
redcrystalMessage = "🔴 清洁工职业:+1枚红晶";
|
|
3893
3893
|
}
|
|
3894
3894
|
return {
|
|
3895
3895
|
finalReward,
|
|
@@ -4599,7 +4599,7 @@ ${itemDetails.join("\n")}`;
|
|
|
4599
4599
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
4600
4600
|
if (careerData?.group === "人类联盟") {
|
|
4601
4601
|
totalBonus += 0.2;
|
|
4602
|
-
messages.push("🏛️
|
|
4602
|
+
messages.push("🏛️ 人类联盟阵营:+20%金币");
|
|
4603
4603
|
const [userMiningTech] = await ctx.database.get("ggcevo_tech", { handle, techId: 1 }).catch(() => [{ level: 0 }]);
|
|
4604
4604
|
const techLevel = Math.min(userMiningTech?.level || 0, 5);
|
|
4605
4605
|
const miningTechConfig = Spacestationtechnology.find((t) => t.techId === 1);
|
|
@@ -4614,12 +4614,12 @@ ${itemDetails.join("\n")}`;
|
|
|
4614
4614
|
const finalBonus = Math.max(baseTechBonus, careerTechBonus);
|
|
4615
4615
|
if (finalBonus > 0) {
|
|
4616
4616
|
totalBonus += finalBonus / 100;
|
|
4617
|
-
messages.push(`⚙️
|
|
4617
|
+
messages.push(`⚙️ 采掘系统科技Lv${techLevel}:+${finalBonus}%金币`);
|
|
4618
4618
|
}
|
|
4619
4619
|
}
|
|
4620
4620
|
if (careerData.career === "深空矿工") {
|
|
4621
4621
|
totalBonus += 0.5;
|
|
4622
|
-
messages.push("🎖️
|
|
4622
|
+
messages.push("🎖️ 深空矿工职业:+50%金币");
|
|
4623
4623
|
}
|
|
4624
4624
|
}
|
|
4625
4625
|
if (careerData?.group === "辛迪加海盗") {
|
|
@@ -4629,7 +4629,7 @@ ${itemDetails.join("\n")}`;
|
|
|
4629
4629
|
const additionalBonus = Math.min(humanPlayersCount, 50);
|
|
4630
4630
|
const credBonus = 0.5 + additionalBonus / 100;
|
|
4631
4631
|
totalBonus += credBonus;
|
|
4632
|
-
messages.push(`💎 CRED-17
|
|
4632
|
+
messages.push(`💎 CRED-17设备:+50%金币 (额外+${additionalBonus}%金币)`);
|
|
4633
4633
|
}
|
|
4634
4634
|
}
|
|
4635
4635
|
const [meowEffect] = await ctx.database.get("ggcevo_Wish_Record", {
|
|
@@ -4642,7 +4642,7 @@ ${itemDetails.join("\n")}`;
|
|
|
4642
4642
|
if (meowEffect) {
|
|
4643
4643
|
tickets *= 2;
|
|
4644
4644
|
totalBonus += 1;
|
|
4645
|
-
messages.push("🐾
|
|
4645
|
+
messages.push("🐾 喵喵财源祈愿:咕咕币+100%,金币+100%");
|
|
4646
4646
|
}
|
|
4647
4647
|
const finalPoints = Math.round(basePoints * (1 + totalBonus));
|
|
4648
4648
|
let redCrystal = 0;
|
|
@@ -4658,7 +4658,7 @@ ${itemDetails.join("\n")}`;
|
|
|
4658
4658
|
} else {
|
|
4659
4659
|
redCrystal = 5;
|
|
4660
4660
|
}
|
|
4661
|
-
messages.push(`🎖️
|
|
4661
|
+
messages.push(`🎖️ 辛迪加财务经理职业:+${redCrystal}枚红晶`);
|
|
4662
4662
|
}
|
|
4663
4663
|
await ctx.database.withTransaction(async () => {
|
|
4664
4664
|
await ctx.database.upsert("ggcevo_sign", [{
|
|
@@ -5804,20 +5804,20 @@ ${items.join("、")}
|
|
|
5804
5804
|
result.push(`🛡️ 人类联盟:应战者PK失败时仅损失1%的金币`);
|
|
5805
5805
|
}
|
|
5806
5806
|
if (computerExpertProtection) {
|
|
5807
|
-
result.push(`💻
|
|
5807
|
+
result.push(`💻 计算机专家职业:应战者PK失败时不损失金币`);
|
|
5808
5808
|
} else if (isWin) {
|
|
5809
5809
|
result.push(`💰 您从对方的口袋里抢夺了${goldTransfer}枚金币`);
|
|
5810
5810
|
} else {
|
|
5811
5811
|
result.push(`💸 您从口袋里拿出了${goldTransfer}枚金币上交给对方`);
|
|
5812
5812
|
}
|
|
5813
5813
|
if (mp3Effect) {
|
|
5814
|
-
result.push(`💿 MP3
|
|
5814
|
+
result.push(`💿 MP3播放器设备:挑战者PK失败时上交的金币减少50%`);
|
|
5815
5815
|
}
|
|
5816
5816
|
if (initiatorCareer?.group === "辛迪加海盗") {
|
|
5817
|
-
result.push(`🔴
|
|
5817
|
+
result.push(`🔴 辛迪加海盗阵营:+1枚红晶`);
|
|
5818
5818
|
}
|
|
5819
5819
|
if (isWin && initiatorCareer?.career === "辛迪加财务经理") {
|
|
5820
|
-
result.push(`🎖️
|
|
5820
|
+
result.push(`🎖️ 辛迪加财务经理职业:+1枚红晶`);
|
|
5821
5821
|
}
|
|
5822
5822
|
result.push(`📅 剩余挑战次数:${config.dailyPKLimit - (initiatorPK.todayCount + 1)}`);
|
|
5823
5823
|
return result.join("\n");
|
|
@@ -5869,7 +5869,7 @@ ${items.join("、")}
|
|
|
5869
5869
|
if (careerData?.career === "武器中士") {
|
|
5870
5870
|
const weaponSpecialistDiscount = 20;
|
|
5871
5871
|
totalDiscount += weaponSpecialistDiscount;
|
|
5872
|
-
discountDetails.push(`🎖️
|
|
5872
|
+
discountDetails.push(`🎖️ 武器中士职业:${weaponSpecialistDiscount}%折扣`);
|
|
5873
5873
|
}
|
|
5874
5874
|
const activeWish = await ctx.database.get("ggcevo_Wish_Record", {
|
|
5875
5875
|
handle,
|
|
@@ -5881,7 +5881,7 @@ ${items.join("、")}
|
|
|
5881
5881
|
if (activeWish) {
|
|
5882
5882
|
const grasshopperDiscount = 20;
|
|
5883
5883
|
totalDiscount += grasshopperDiscount;
|
|
5884
|
-
discountDetails.push(`🦗
|
|
5884
|
+
discountDetails.push(`🦗 蚱蜢优购祈愿:${grasshopperDiscount}%折扣`);
|
|
5885
5885
|
}
|
|
5886
5886
|
totalDiscount = Math.min(totalDiscount, 100);
|
|
5887
5887
|
const categoryStats = Object.values(weaponConfig).filter((weapon) => weapon.price !== 0).reduce((stats, weapon) => {
|
|
@@ -6035,13 +6035,13 @@ ${validTypes.join("、")}`;
|
|
|
6035
6035
|
if (activeWish) {
|
|
6036
6036
|
const wishDiscount = 20;
|
|
6037
6037
|
totalDiscount += wishDiscount;
|
|
6038
|
-
discountDetails.push(`🦗
|
|
6038
|
+
discountDetails.push(`🦗 蚱蜢优购祈愿:${wishDiscount}%折扣`);
|
|
6039
6039
|
}
|
|
6040
6040
|
}
|
|
6041
6041
|
if (isWeapon && careerData?.career === "武器中士") {
|
|
6042
6042
|
const specialistDiscount = 20;
|
|
6043
6043
|
totalDiscount += specialistDiscount;
|
|
6044
|
-
discountDetails.push(`🎖️
|
|
6044
|
+
discountDetails.push(`🎖️ 武器中士职业:${specialistDiscount}%折扣`);
|
|
6045
6045
|
}
|
|
6046
6046
|
totalDiscount = Math.min(totalDiscount, 100);
|
|
6047
6047
|
}
|
|
@@ -6287,7 +6287,7 @@ ${validTypes.join("、")}`;
|
|
|
6287
6287
|
`花费金币:${actualCost}${discountRate > 0 ? ` (原价${modInfo.cost})` : ""}`,
|
|
6288
6288
|
discountRate > 0 && [
|
|
6289
6289
|
"折扣明细:",
|
|
6290
|
-
`⚙️
|
|
6290
|
+
`⚙️ 武器升级平台科技Lv${techLevel}:${discountRate}%`
|
|
6291
6291
|
].join("\n"),
|
|
6292
6292
|
`改装槽:${equipment.installedMods.length + 1}/${equipment.modificationSlots}`
|
|
6293
6293
|
].filter(Boolean).join("\n");
|
|
@@ -6325,7 +6325,7 @@ ${validTypes.join("、")}`;
|
|
|
6325
6325
|
"使用「改装 武器名称 模块名称」安装",
|
|
6326
6326
|
"※ 每个武器只能安装一个专属模块",
|
|
6327
6327
|
exclusiveDiscountRate > 0 && `💰 当前专属模块折扣:
|
|
6328
|
-
⚙️
|
|
6328
|
+
⚙️ 武器升级平台科技Lv${techLevel}:${exclusiveDiscountRate}%`,
|
|
6329
6329
|
"====================",
|
|
6330
6330
|
exclusiveMods.length ? exclusiveMods.join("\n") : "该武器暂无专属模块"
|
|
6331
6331
|
].filter(Boolean).join("\n");
|
|
@@ -6336,7 +6336,7 @@ ${validTypes.join("、")}`;
|
|
|
6336
6336
|
"使用「改装 武器名称 模块名称」安装通用模块",
|
|
6337
6337
|
"使用「改装 武器名称」查询武器专属模块",
|
|
6338
6338
|
universalDiscountRate > 0 && `💰 当前通用模块折扣:
|
|
6339
|
-
⚙️
|
|
6339
|
+
⚙️ 武器升级平台科技Lv${techLevel}:${universalDiscountRate}%`,
|
|
6340
6340
|
"====================",
|
|
6341
6341
|
universalMods.join("\n")
|
|
6342
6342
|
].filter(Boolean).join("\n");
|