koishi-plugin-ggcevo-game 1.3.29 → 1.3.31
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 +7 -0
- package/lib/index.js +208 -49
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ declare module 'koishi' {
|
|
|
41
41
|
ggcevo_warehouse: warehouse;
|
|
42
42
|
ggcevo_tech: tech;
|
|
43
43
|
ggcevo_Mining: Mining;
|
|
44
|
+
ggcevo_task: task;
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
export interface backpack {
|
|
@@ -189,4 +190,10 @@ export interface Mining {
|
|
|
189
190
|
handle: string;
|
|
190
191
|
startTime: Date;
|
|
191
192
|
}
|
|
193
|
+
export interface task {
|
|
194
|
+
handle: string;
|
|
195
|
+
taskId: number;
|
|
196
|
+
progress: number;
|
|
197
|
+
Completions: number;
|
|
198
|
+
}
|
|
192
199
|
export declare function apply(ctx: Context, config: Config): void;
|
package/lib/index.js
CHANGED
|
@@ -284,6 +284,14 @@ function apply(ctx, config) {
|
|
|
284
284
|
}, {
|
|
285
285
|
primary: "handle"
|
|
286
286
|
});
|
|
287
|
+
ctx.model.extend("ggcevo_task", {
|
|
288
|
+
handle: "string",
|
|
289
|
+
taskId: "unsigned",
|
|
290
|
+
progress: "unsigned",
|
|
291
|
+
Completions: "unsigned"
|
|
292
|
+
}, {
|
|
293
|
+
primary: ["handle", "taskId"]
|
|
294
|
+
});
|
|
287
295
|
const weaponConfig = {
|
|
288
296
|
// 武器配置
|
|
289
297
|
"高斯步枪": {
|
|
@@ -458,7 +466,7 @@ function apply(ctx, config) {
|
|
|
458
466
|
description: "非致命军用炸药",
|
|
459
467
|
price: 75,
|
|
460
468
|
redCrystalCost: 0,
|
|
461
|
-
effects: "
|
|
469
|
+
effects: "对目标使用后,重置其技能计数(无法对重型和建筑目标使用)"
|
|
462
470
|
},
|
|
463
471
|
"CRED-17": {
|
|
464
472
|
id: 3,
|
|
@@ -466,7 +474,7 @@ function apply(ctx, config) {
|
|
|
466
474
|
description: "一个小型辛迪加机器人,可以破坏电子银行账户",
|
|
467
475
|
price: 0,
|
|
468
476
|
redCrystalCost: 60,
|
|
469
|
-
effects: "此物品存放于仓库,仅在处于辛迪加海盗阵营时生效。每日签到金币奖励+50%,每拥有100金币,增加1%(至多增加100%)
|
|
477
|
+
effects: "此物品存放于仓库,仅在处于辛迪加海盗阵营时生效。每日签到金币奖励+50%,每拥有100金币,增加1%(至多增加100%)"
|
|
470
478
|
}
|
|
471
479
|
};
|
|
472
480
|
const modConfig = {
|
|
@@ -515,11 +523,11 @@ function apply(ctx, config) {
|
|
|
515
523
|
common: [
|
|
516
524
|
{
|
|
517
525
|
name: "蚱蜢优购",
|
|
518
|
-
effect: "
|
|
526
|
+
effect: "下一次购买武器的价格变为80%"
|
|
519
527
|
},
|
|
520
528
|
{
|
|
521
529
|
name: "灵狐升运",
|
|
522
|
-
effect: "
|
|
530
|
+
effect: "下一次升级武器的价格变为80%"
|
|
523
531
|
},
|
|
524
532
|
{
|
|
525
533
|
name: "王权增幅",
|
|
@@ -554,7 +562,7 @@ function apply(ctx, config) {
|
|
|
554
562
|
},
|
|
555
563
|
{
|
|
556
564
|
name: "酥手空空",
|
|
557
|
-
effect: "
|
|
565
|
+
effect: "立即失去50枚金币"
|
|
558
566
|
}
|
|
559
567
|
]
|
|
560
568
|
};
|
|
@@ -631,11 +639,11 @@ function apply(ctx, config) {
|
|
|
631
639
|
},
|
|
632
640
|
"吸血唾液": {
|
|
633
641
|
effect: 0,
|
|
634
|
-
description: "受到攻击将会获得一层“吸血”,每层“吸血”提供5%的减伤(至多
|
|
642
|
+
description: "受到攻击将会获得一层“吸血”,每层“吸血”提供5%的减伤(至多20层)"
|
|
635
643
|
},
|
|
636
644
|
"进食": {
|
|
637
645
|
effect: 0,
|
|
638
|
-
description: "当“吸血”达到
|
|
646
|
+
description: "当“吸血”达到20层后,下一次受到攻击将会消耗所有层数回复自身20%的最大生命值"
|
|
639
647
|
},
|
|
640
648
|
"嗜血狂暴": {
|
|
641
649
|
effect: 0,
|
|
@@ -643,7 +651,7 @@ function apply(ctx, config) {
|
|
|
643
651
|
},
|
|
644
652
|
"吐血": {
|
|
645
653
|
effect: 0,
|
|
646
|
-
description: "当无“吸血”层数时,受到的伤害+
|
|
654
|
+
description: "当无“吸血”层数时,受到的伤害+20%"
|
|
647
655
|
},
|
|
648
656
|
"辐射": {
|
|
649
657
|
effect: 0,
|
|
@@ -666,7 +674,7 @@ function apply(ctx, config) {
|
|
|
666
674
|
name: "异齿猛兽",
|
|
667
675
|
type: "子代",
|
|
668
676
|
maxHP: 5e3,
|
|
669
|
-
tags: asBossTags(["重甲", "生物", "异形"]),
|
|
677
|
+
tags: asBossTags(["重甲", "生物", "重型", "异形"]),
|
|
670
678
|
passive: asPassives(["弱化形态", "异形甲壳"])
|
|
671
679
|
}
|
|
672
680
|
]
|
|
@@ -677,7 +685,7 @@ function apply(ctx, config) {
|
|
|
677
685
|
name: "寒冰王蛇",
|
|
678
686
|
type: "主宰",
|
|
679
687
|
maxHP: 15e3,
|
|
680
|
-
tags: asBossTags(["重甲", "惧热", "
|
|
688
|
+
tags: asBossTags(["重甲", "生物", "惧热", "重型", "异形"]),
|
|
681
689
|
passive: asPassives(["冰霜环绕", "冰霜进化"])
|
|
682
690
|
},
|
|
683
691
|
minions: [
|
|
@@ -685,7 +693,7 @@ function apply(ctx, config) {
|
|
|
685
693
|
name: "冰蛇",
|
|
686
694
|
type: "子代",
|
|
687
695
|
maxHP: 5e3,
|
|
688
|
-
tags: asBossTags(["
|
|
696
|
+
tags: asBossTags(["生物", "惧热", "异形"]),
|
|
689
697
|
passive: asPassives(["弱化形态", "冰霜回复", "冰霜进化"])
|
|
690
698
|
}
|
|
691
699
|
]
|
|
@@ -696,7 +704,7 @@ function apply(ctx, config) {
|
|
|
696
704
|
name: "莽兽",
|
|
697
705
|
type: "主宰",
|
|
698
706
|
maxHP: 12e3,
|
|
699
|
-
tags: asBossTags(["重甲", "生物", "异形"]),
|
|
707
|
+
tags: asBossTags(["重甲", "生物", "重型", "异形"]),
|
|
700
708
|
passive: asPassives(["应激甲壳II", "求生本能II", "冷适应"])
|
|
701
709
|
},
|
|
702
710
|
minions: [
|
|
@@ -704,14 +712,14 @@ function apply(ctx, config) {
|
|
|
704
712
|
name: "狂暴畸变体",
|
|
705
713
|
type: "子代",
|
|
706
714
|
maxHP: 4e3,
|
|
707
|
-
tags: asBossTags(["重甲", "生物", "异形"]),
|
|
715
|
+
tags: asBossTags(["重甲", "生物", "重型", "异形"]),
|
|
708
716
|
passive: asPassives(["弱化形态", "应激甲壳I", "求生本能I", "冷适应"])
|
|
709
717
|
},
|
|
710
718
|
{
|
|
711
719
|
name: "剧毒畸变体",
|
|
712
720
|
type: "子代",
|
|
713
721
|
maxHP: 4e3,
|
|
714
|
-
tags: asBossTags(["重甲", "生物", "异形"]),
|
|
722
|
+
tags: asBossTags(["重甲", "生物", "重型", "异形"]),
|
|
715
723
|
passive: asPassives(["弱化形态", "应激甲壳I", "求生本能I", "冷适应"])
|
|
716
724
|
}
|
|
717
725
|
]
|
|
@@ -956,19 +964,19 @@ function apply(ctx, config) {
|
|
|
956
964
|
level: 3,
|
|
957
965
|
cost: 2950,
|
|
958
966
|
description: "提高挖矿效率,每日签到金币奖励+15%",
|
|
959
|
-
careerBonus: "深空矿工/情报副官: 每日签到金币奖励+30%;
|
|
967
|
+
careerBonus: "深空矿工/情报副官: 每日签到金币奖励+30%; 解锁太空“挖矿”权限; 建造矿骡协同挖矿,效率提高20%"
|
|
960
968
|
},
|
|
961
969
|
{
|
|
962
970
|
level: 4,
|
|
963
971
|
cost: 4250,
|
|
964
972
|
description: "提高挖矿效率,每日签到金币奖励+20%",
|
|
965
|
-
careerBonus: "深空矿工/情报副官: 每日签到金币奖励+40%; 解锁太空“挖矿”权限; 建造矿骡协同挖矿,效率提高
|
|
973
|
+
careerBonus: "深空矿工/情报副官: 每日签到金币奖励+40%; 解锁太空“挖矿”权限; 建造矿骡协同挖矿,效率提高40%"
|
|
966
974
|
},
|
|
967
975
|
{
|
|
968
976
|
level: 5,
|
|
969
977
|
cost: 5375,
|
|
970
978
|
description: "提高挖矿效率,每日签到金币奖励+25%",
|
|
971
|
-
careerBonus: "深空矿工/情报副官: 每日签到金币奖励+50%; 解锁太空“挖矿”权限; 建造矿骡协同挖矿,效率提高
|
|
979
|
+
careerBonus: "深空矿工/情报副官: 每日签到金币奖励+50%; 解锁太空“挖矿”权限; 建造矿骡协同挖矿,效率提高60%,并且单次挖矿时间上限增加至48小时"
|
|
972
980
|
}
|
|
973
981
|
]
|
|
974
982
|
},
|
|
@@ -1032,6 +1040,17 @@ function apply(ctx, config) {
|
|
|
1032
1040
|
]
|
|
1033
1041
|
}
|
|
1034
1042
|
];
|
|
1043
|
+
const Tasklist = {
|
|
1044
|
+
"成人之美": {
|
|
1045
|
+
id: 1,
|
|
1046
|
+
type: "可重复任务",
|
|
1047
|
+
description: "每一个成功人士的背后总有默默付出的辅助,而你,我的朋友,理应获得补助",
|
|
1048
|
+
target: 2,
|
|
1049
|
+
price: 100,
|
|
1050
|
+
redCrystalCost: 0,
|
|
1051
|
+
condition: "使用伽马枪攻击异形并成功使辐射层数+1"
|
|
1052
|
+
}
|
|
1053
|
+
};
|
|
1035
1054
|
async function calculateTotalDamage(ctx2, session, equippedWeapon, targetBoss, options) {
|
|
1036
1055
|
let effectMessage = [];
|
|
1037
1056
|
const finalTags = options?.customTags || targetBoss.tags || [];
|
|
@@ -1669,8 +1688,8 @@ function apply(ctx, config) {
|
|
|
1669
1688
|
messages.push(`🔥 【嗜血狂暴】生效:血量低于50%,进入狂暴状态,受到的伤害-20%`);
|
|
1670
1689
|
}
|
|
1671
1690
|
if (targetBoss.skills.includes("吐血") && bloodStacks < 1) {
|
|
1672
|
-
damageMultiplier += 0.
|
|
1673
|
-
messages.push(`💔 【吐血】生效:无“吸血”层数,受到的伤害+
|
|
1691
|
+
damageMultiplier += 0.2;
|
|
1692
|
+
messages.push(`💔 【吐血】生效:无“吸血”层数,受到的伤害+20%`);
|
|
1674
1693
|
}
|
|
1675
1694
|
return { damageMultiplier, messages };
|
|
1676
1695
|
}, "handleBloodEffects"),
|
|
@@ -1682,7 +1701,7 @@ function apply(ctx, config) {
|
|
|
1682
1701
|
let updatedHP = currentHP;
|
|
1683
1702
|
let newStacks;
|
|
1684
1703
|
const oldStacks = targetBoss.Skillcountpoints || 0;
|
|
1685
|
-
if (oldStacks >=
|
|
1704
|
+
if (oldStacks >= 20 && targetBoss.skills.includes("进食")) {
|
|
1686
1705
|
const heal = Math.floor(maxHP * 0.2);
|
|
1687
1706
|
updatedHP = Math.min(currentHP + heal, maxHP);
|
|
1688
1707
|
await ctx2.database.set("ggcevo_boss", { name: targetBoss.name }, { Skillcountpoints: 0 });
|
|
@@ -1697,8 +1716,8 @@ function apply(ctx, config) {
|
|
|
1697
1716
|
newStacks += 1;
|
|
1698
1717
|
messages.push(`🔥 【嗜血狂暴】生效:额外获得1层“吸血”`);
|
|
1699
1718
|
}
|
|
1700
|
-
newStacks = Math.min(newStacks,
|
|
1701
|
-
if (oldStacks <
|
|
1719
|
+
newStacks = Math.min(newStacks, 20);
|
|
1720
|
+
if (oldStacks < 20 && newStacks >= 20) {
|
|
1702
1721
|
messages.push(`🩸 “吸血”层数达到${newStacks},下次受到攻击将触发【进食】`);
|
|
1703
1722
|
}
|
|
1704
1723
|
await ctx2.database.set("ggcevo_boss", { name: targetBoss.name }, { Skillcountpoints: newStacks });
|
|
@@ -1710,21 +1729,24 @@ function apply(ctx, config) {
|
|
|
1710
1729
|
return null;
|
|
1711
1730
|
}
|
|
1712
1731
|
const messages = [];
|
|
1732
|
+
let radiationApplied = false;
|
|
1713
1733
|
const hasRadiation = targetBoss.skills.includes("辐射");
|
|
1714
1734
|
const currentLayers = targetBoss.Vulnerability || 0;
|
|
1715
1735
|
const skillUpdates = [];
|
|
1716
1736
|
const newLayers = hasRadiation ? Math.min(currentLayers + 1, 100) : 1;
|
|
1717
1737
|
let layerMsg;
|
|
1718
1738
|
if (!hasRadiation) {
|
|
1719
|
-
layerMsg = `☢️ ${targetBoss.name}
|
|
1739
|
+
layerMsg = `☢️ ${targetBoss.name} 获得【辐射】效果(初始层数1)`;
|
|
1720
1740
|
skillUpdates.push({
|
|
1721
1741
|
name: targetBoss.name,
|
|
1722
1742
|
add: ["辐射"]
|
|
1723
1743
|
});
|
|
1744
|
+
radiationApplied = true;
|
|
1724
1745
|
} else if (newLayers === currentLayers) {
|
|
1725
1746
|
layerMsg = `☢️ 辐射层数已达上限(100层)`;
|
|
1726
1747
|
} else {
|
|
1727
1748
|
layerMsg = `☢️ 辐射层数+1`;
|
|
1749
|
+
radiationApplied = true;
|
|
1728
1750
|
}
|
|
1729
1751
|
await ctx2.database.set(
|
|
1730
1752
|
"ggcevo_boss",
|
|
@@ -1734,7 +1756,12 @@ function apply(ctx, config) {
|
|
|
1734
1756
|
}
|
|
1735
1757
|
);
|
|
1736
1758
|
messages.push(layerMsg);
|
|
1737
|
-
return {
|
|
1759
|
+
return {
|
|
1760
|
+
messages,
|
|
1761
|
+
skillUpdates,
|
|
1762
|
+
radiationApplied
|
|
1763
|
+
// 返回辐射应用标志
|
|
1764
|
+
};
|
|
1738
1765
|
}, "handleGammaRadiation"),
|
|
1739
1766
|
// 伽马枪辐射计算(返回增伤系数)
|
|
1740
1767
|
calculateRadiationDamage: /* @__PURE__ */ __name((targetBoss) => {
|
|
@@ -1751,6 +1778,7 @@ function apply(ctx, config) {
|
|
|
1751
1778
|
let messages = [];
|
|
1752
1779
|
let skillUpdates = [];
|
|
1753
1780
|
let totalMultiplier = 0;
|
|
1781
|
+
let radiationApplied = false;
|
|
1754
1782
|
const frostEvoResult = this.handleFrostEvolution(targetBoss, weaponName, initialDamage, maxHP);
|
|
1755
1783
|
if (frostEvoResult) {
|
|
1756
1784
|
return {
|
|
@@ -1769,9 +1797,6 @@ function apply(ctx, config) {
|
|
|
1769
1797
|
initialDamage: 0
|
|
1770
1798
|
};
|
|
1771
1799
|
}
|
|
1772
|
-
if (currentHP <= 0 && !targetBoss.skills.includes("求生本能I") && !targetBoss.skills.includes("求生本能II")) {
|
|
1773
|
-
return { currentHP, messages: [], skillUpdates: [], initialDamage };
|
|
1774
|
-
}
|
|
1775
1800
|
targetBoss.skills.forEach((skill) => {
|
|
1776
1801
|
const config2 = passiveConfig[skill];
|
|
1777
1802
|
if (config2 && config2.effect !== void 0 && config2.effect !== 0) {
|
|
@@ -1801,14 +1826,16 @@ function apply(ctx, config) {
|
|
|
1801
1826
|
messages.push(...radiationCalc.messages);
|
|
1802
1827
|
}
|
|
1803
1828
|
const originalMultiplier = totalMultiplier;
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
messages.push(`⚠️ 减伤效果已达上限(99%)`);
|
|
1829
|
+
if (originalMultiplier < -1) {
|
|
1830
|
+
messages.push(`⚠️ 触发伤害保底机制:强制造成1点伤害`);
|
|
1807
1831
|
}
|
|
1808
1832
|
let finalDamage = initialDamage * (1 + totalMultiplier);
|
|
1809
1833
|
finalDamage = Math.floor(finalDamage);
|
|
1810
1834
|
finalDamage = Math.max(finalDamage, 1);
|
|
1811
1835
|
currentHP = targetBoss.HP - finalDamage;
|
|
1836
|
+
if (currentHP <= 0 && !targetBoss.skills.includes("求生本能I") && !targetBoss.skills.includes("求生本能II")) {
|
|
1837
|
+
return { currentHP, messages: [], skillUpdates: [], initialDamage };
|
|
1838
|
+
}
|
|
1812
1839
|
const frostSurroundResult = await this.handleFrostSurround(ctx2, targetBoss, currentHP, maxHP);
|
|
1813
1840
|
if (frostSurroundResult) {
|
|
1814
1841
|
currentHP = frostSurroundResult.updatedHP;
|
|
@@ -1848,12 +1875,15 @@ function apply(ctx, config) {
|
|
|
1848
1875
|
if (gammaRadResult) {
|
|
1849
1876
|
messages.push(...gammaRadResult.messages);
|
|
1850
1877
|
skillUpdates.push(...gammaRadResult.skillUpdates);
|
|
1878
|
+
radiationApplied = gammaRadResult.radiationApplied;
|
|
1851
1879
|
}
|
|
1852
1880
|
return {
|
|
1853
1881
|
currentHP,
|
|
1854
1882
|
messages,
|
|
1855
1883
|
skillUpdates,
|
|
1856
|
-
initialDamage: finalDamage
|
|
1884
|
+
initialDamage: finalDamage,
|
|
1885
|
+
radiationApplied
|
|
1886
|
+
// 新增返回辐射应用标记
|
|
1857
1887
|
};
|
|
1858
1888
|
}, "handlePassives"),
|
|
1859
1889
|
// 应用技能更新到数据库(优化合并同名boss的更新)
|
|
@@ -2136,7 +2166,7 @@ function apply(ctx, config) {
|
|
|
2136
2166
|
});
|
|
2137
2167
|
if (!activeSentry.length) return {
|
|
2138
2168
|
success: false,
|
|
2139
|
-
message: "⚠️
|
|
2169
|
+
message: "⚠️ 目标「空间站哨枪塔」未存活"
|
|
2140
2170
|
};
|
|
2141
2171
|
const [SentryTower] = await ctx.database.get("ggcevo_boss", {
|
|
2142
2172
|
name: "空间站哨枪塔",
|
|
@@ -2177,9 +2207,9 @@ function apply(ctx, config) {
|
|
|
2177
2207
|
name: target,
|
|
2178
2208
|
isActive: true
|
|
2179
2209
|
});
|
|
2180
|
-
if (!targetboss.length || targetboss[0].Skillcountpoints === 0 || targetboss[0].tags.includes("建筑")) return {
|
|
2210
|
+
if (!targetboss.length || targetboss[0].Skillcountpoints === 0 || targetboss[0].tags.includes("建筑") || targetboss[0].tags.includes("重型")) return {
|
|
2181
2211
|
success: false,
|
|
2182
|
-
message: "您选择的不是合法目标(目标已死亡/目标的技能计数为0
|
|
2212
|
+
message: "您选择的不是合法目标(目标已死亡/目标的技能计数为0/目标拥有“建筑”或“重型”标签)。"
|
|
2183
2213
|
};
|
|
2184
2214
|
await ctx.database.set(
|
|
2185
2215
|
"ggcevo_boss",
|
|
@@ -2292,7 +2322,8 @@ ${discountHint}${costLine}
|
|
|
2292
2322
|
const actualCost = Math.floor(discountedCost);
|
|
2293
2323
|
const [signInfo] = await ctx.database.get("ggcevo_sign", { handle });
|
|
2294
2324
|
if (signInfo?.totalRewards < actualCost) {
|
|
2295
|
-
|
|
2325
|
+
const priceInfo2 = totalDiscount > 0 ? `需要 ${actualCost} 金币(原价${baseCost})` : `需要 ${actualCost} 金币`;
|
|
2326
|
+
return `❌ ${priceInfo2},当前持有:${signInfo?.totalRewards || 0}`;
|
|
2296
2327
|
}
|
|
2297
2328
|
await ctx.database.withTransaction(async () => {
|
|
2298
2329
|
await ctx.database.set("ggcevo_sign", { handle }, {
|
|
@@ -4648,6 +4679,7 @@ ${validTypes.join("、")}`;
|
|
|
4648
4679
|
let initialDamage = Math.min(damage, targetBoss.HP);
|
|
4649
4680
|
let currentHP = targetBoss.HP - initialDamage;
|
|
4650
4681
|
let passiveMessages = [];
|
|
4682
|
+
let radiationApplied;
|
|
4651
4683
|
const passiveResult = await PassiveHandler.handlePassives(
|
|
4652
4684
|
ctx,
|
|
4653
4685
|
targetBoss,
|
|
@@ -4662,6 +4694,7 @@ ${validTypes.join("、")}`;
|
|
|
4662
4694
|
currentHP = passiveResult.currentHP;
|
|
4663
4695
|
initialDamage = passiveResult.initialDamage;
|
|
4664
4696
|
passiveMessages.push(...passiveResult.messages);
|
|
4697
|
+
radiationApplied = passiveResult.radiationApplied;
|
|
4665
4698
|
if (passiveResult.skillUpdates.length > 0) {
|
|
4666
4699
|
await PassiveHandler.applySkillUpdates(ctx, passiveResult.skillUpdates);
|
|
4667
4700
|
}
|
|
@@ -4680,6 +4713,15 @@ ${validTypes.join("、")}`;
|
|
|
4680
4713
|
attackCount: (existingRecord?.attackCount || 0) + 1,
|
|
4681
4714
|
lastattackDate: /* @__PURE__ */ new Date()
|
|
4682
4715
|
}], ["handle"]);
|
|
4716
|
+
const [RadiationRecord] = await ctx.database.get("ggcevo_task", {
|
|
4717
|
+
handle,
|
|
4718
|
+
taskId: 1
|
|
4719
|
+
});
|
|
4720
|
+
await ctx.database.upsert("ggcevo_task", [{
|
|
4721
|
+
handle,
|
|
4722
|
+
taskId: 1,
|
|
4723
|
+
progress: (RadiationRecord?.progress || 0) + 1
|
|
4724
|
+
}], ["handle"]);
|
|
4683
4725
|
if (isDefeated) {
|
|
4684
4726
|
if (targetBoss.type === "主宰") {
|
|
4685
4727
|
await ctx.database.set(
|
|
@@ -4867,7 +4909,7 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
4867
4909
|
...effectMessage.map((m) => `▸ ${m}`)
|
|
4868
4910
|
// 这里添加符号
|
|
4869
4911
|
] : [],
|
|
4870
|
-
`📊 理论伤害值:${damage}${hasCrit ? " (✨
|
|
4912
|
+
`📊 理论伤害值:${damage}${hasCrit ? " (✨ 暴击)" : ""}`,
|
|
4871
4913
|
"💡 提示:使用 -t 重甲,生物……(标签之间用英文逗号分隔) 添加测试标签"
|
|
4872
4914
|
].filter((line) => line).join("\n");
|
|
4873
4915
|
});
|
|
@@ -5288,6 +5330,7 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5288
5330
|
const joinDate = new Date(careerData.date);
|
|
5289
5331
|
const formattedDate = `${joinDate.getFullYear()}年${joinDate.getMonth() + 1}月${joinDate.getDate()}日`;
|
|
5290
5332
|
const infoCard = [
|
|
5333
|
+
`🎮 游戏句柄:${handle}`,
|
|
5291
5334
|
`🎯 当前阵营:${careerData.group}`,
|
|
5292
5335
|
`👔 当前职业:${careerData.career}`,
|
|
5293
5336
|
`✨ 职业效果:${effectDisplay}`,
|
|
@@ -5305,7 +5348,7 @@ ${passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5305
5348
|
}
|
|
5306
5349
|
const promptMessage = careerData.group === "辛迪加海盗" ? "💡 提示:红晶可通过主动PK获得(无论胜负)" : "💡 提示:使用「转职」指令可变更职业";
|
|
5307
5350
|
return [
|
|
5308
|
-
`〓
|
|
5351
|
+
`〓 职业档案 〓`,
|
|
5309
5352
|
...infoCard,
|
|
5310
5353
|
"〓═════════〓\n" + promptMessage
|
|
5311
5354
|
// 提示信息放在分隔线下方
|
|
@@ -5631,7 +5674,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
5631
5674
|
startTime: /* @__PURE__ */ new Date()
|
|
5632
5675
|
// 记录当前时间为开始时间
|
|
5633
5676
|
});
|
|
5634
|
-
return "⛏️
|
|
5677
|
+
return "⛏️ 首次挖矿作业已开始,等待至少1小时后可收获。";
|
|
5635
5678
|
}
|
|
5636
5679
|
const nowtime = /* @__PURE__ */ new Date();
|
|
5637
5680
|
const chinaStart = convertUTCtoChinaTime(record.startTime);
|
|
@@ -5646,22 +5689,25 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
5646
5689
|
`🕒 开始时间:${record.startTime.toLocaleString("zh-CN", { hour12: false })}`,
|
|
5647
5690
|
`⏱️ 当前时间:${nowtime.toLocaleString("zh-CN", { hour12: false })}`,
|
|
5648
5691
|
`⏳ 还需等待:${remaining}分钟`,
|
|
5649
|
-
`💡 提示:挖矿1
|
|
5692
|
+
`💡 提示:挖矿1小时后可随时收获并自动开始下一轮挖矿`
|
|
5650
5693
|
].join("\n");
|
|
5651
5694
|
}
|
|
5652
5695
|
const halfHours = Math.floor(duration / 30);
|
|
5653
|
-
let base = halfHours * 6
|
|
5696
|
+
let base = halfHours * 6;
|
|
5654
5697
|
base = Math.round(base);
|
|
5655
|
-
|
|
5698
|
+
const maxHalfHours = tech.level === 5 ? 96 : 48;
|
|
5699
|
+
base = Math.min(base, maxHalfHours * 6);
|
|
5656
5700
|
let multiplier = 0;
|
|
5657
5701
|
switch (tech.level) {
|
|
5658
|
-
case
|
|
5702
|
+
case 3:
|
|
5659
5703
|
multiplier = 0.2;
|
|
5660
5704
|
break;
|
|
5661
|
-
|
|
5662
|
-
case 5:
|
|
5705
|
+
case 4:
|
|
5663
5706
|
multiplier = 0.4;
|
|
5664
5707
|
break;
|
|
5708
|
+
case 5:
|
|
5709
|
+
multiplier = 0.6;
|
|
5710
|
+
break;
|
|
5665
5711
|
}
|
|
5666
5712
|
const total = Math.round(base * (1 + multiplier));
|
|
5667
5713
|
await ctx.database.withTransaction(async () => {
|
|
@@ -5679,14 +5725,127 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
5679
5725
|
const minutes = mins % 60;
|
|
5680
5726
|
return `${hours}小时${minutes}分钟`;
|
|
5681
5727
|
}, "formatTime");
|
|
5682
|
-
|
|
5728
|
+
const reportLines = [
|
|
5683
5729
|
"⛏️ 挖矿报告",
|
|
5684
5730
|
`🕒 开始时间:${record.startTime.toLocaleString("zh-CN", { hour12: false })}`,
|
|
5685
5731
|
`⏱️ 结束时间:${nowtime.toLocaleString("zh-CN", { hour12: false })}`,
|
|
5686
|
-
`⏳ 持续时间:${formatTime(duration)}
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5732
|
+
`⏳ 持续时间:${formatTime(duration)}`
|
|
5733
|
+
];
|
|
5734
|
+
const maxHours = tech.level === 5 ? 48 : 24;
|
|
5735
|
+
if (duration > maxHours * 60) {
|
|
5736
|
+
reportLines.push(`⚠️ 注意:收益已在${maxHours}小时达到上限`);
|
|
5737
|
+
}
|
|
5738
|
+
let rewardLine = `💰 实际获得:${total}金币`;
|
|
5739
|
+
if (tech.level >= 3) {
|
|
5740
|
+
rewardLine += ` (基础值:${base}金币)`;
|
|
5741
|
+
}
|
|
5742
|
+
reportLines.push(rewardLine);
|
|
5743
|
+
if (tech.level >= 3) {
|
|
5744
|
+
reportLines.push(`🔧 挖矿系统 Lv.${tech.level}:金币+${multiplier * 100}%`);
|
|
5745
|
+
}
|
|
5746
|
+
reportLines.push("💡 已自动开始下一轮挖矿");
|
|
5747
|
+
return reportLines.join("\n");
|
|
5748
|
+
});
|
|
5749
|
+
ctx.command("ggcevo/任务 [name]").usage('输入"任务"查看所有任务列表,或"任务 任务名称"查看详细任务信息').action(async ({ session }, name2) => {
|
|
5750
|
+
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
5751
|
+
if (!profile) return "⚠️ 需要先绑定游戏句柄";
|
|
5752
|
+
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
5753
|
+
if (!name2) {
|
|
5754
|
+
const taskList = [];
|
|
5755
|
+
for (const [taskName, task2] of Object.entries(Tasklist)) {
|
|
5756
|
+
const [playerTask2] = await ctx.database.get("ggcevo_task", {
|
|
5757
|
+
handle,
|
|
5758
|
+
taskId: task2.id
|
|
5759
|
+
}).catch(() => [null]);
|
|
5760
|
+
const completionStatus = playerTask2 ? `进度: ${playerTask2.progress}/${task2.target}` : "尚未开始";
|
|
5761
|
+
taskList.push([
|
|
5762
|
+
`▸ 【${taskName}】`,
|
|
5763
|
+
`类型: ${task2.type}`,
|
|
5764
|
+
`目标: ${task2.target}次`,
|
|
5765
|
+
`奖励: ${task2.price}金币`,
|
|
5766
|
+
`状态: ${completionStatus}`
|
|
5767
|
+
].join("\n"));
|
|
5768
|
+
}
|
|
5769
|
+
return [
|
|
5770
|
+
"📋 任务列表",
|
|
5771
|
+
'使用"任务 任务名称"查看详细任务信息',
|
|
5772
|
+
"====================",
|
|
5773
|
+
...taskList,
|
|
5774
|
+
"===================="
|
|
5775
|
+
].join("\n\n");
|
|
5776
|
+
}
|
|
5777
|
+
const task = Object.entries(Tasklist).find(
|
|
5778
|
+
([taskName]) => taskName === name2
|
|
5779
|
+
)?.[1];
|
|
5780
|
+
if (!task) return "⚠️ 未找到该任务,请检查任务名称是否正确";
|
|
5781
|
+
const [playerTask] = await ctx.database.get("ggcevo_task", {
|
|
5782
|
+
handle,
|
|
5783
|
+
taskId: task.id
|
|
5784
|
+
}).catch(() => [null]);
|
|
5785
|
+
const progress = playerTask ? playerTask.progress : 0;
|
|
5786
|
+
const completions = playerTask ? playerTask.Completions : 0;
|
|
5787
|
+
return [
|
|
5788
|
+
`📝 任务详情: ${name2}`,
|
|
5789
|
+
"====================",
|
|
5790
|
+
`任务名称: ${name2}`,
|
|
5791
|
+
`任务类型: ${task.type}`,
|
|
5792
|
+
`任务目标: ${task.target}次`,
|
|
5793
|
+
`任务奖励: ${task.price}金币`,
|
|
5794
|
+
`当前进度: ${progress}/${task.target}`,
|
|
5795
|
+
`累计完成: ${completions}次`,
|
|
5796
|
+
"-------------------",
|
|
5797
|
+
"任务描述:",
|
|
5798
|
+
task.description,
|
|
5799
|
+
"-------------------",
|
|
5800
|
+
"完成条件:",
|
|
5801
|
+
task.condition,
|
|
5802
|
+
"====================",
|
|
5803
|
+
`📌 使用"完成任务 ${name2}"领取奖励`
|
|
5804
|
+
].join("\n");
|
|
5805
|
+
});
|
|
5806
|
+
ctx.command("ggcevo/完成任务 <name:text>", "完成指定任务领取奖励").usage('输入"完成任务 任务名称"来完成任务并领取奖励').action(async ({ session }, name2) => {
|
|
5807
|
+
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
5808
|
+
if (!profile) return "⚠️ 需要先绑定游戏句柄";
|
|
5809
|
+
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
5810
|
+
if (await ctx.database.get("ggcevo_blacklist", { handle }).then((r) => r.length)) {
|
|
5811
|
+
return "⛔ 您已被列入黑名单";
|
|
5812
|
+
}
|
|
5813
|
+
const taskEntry = Object.entries(Tasklist).find(
|
|
5814
|
+
([taskName2]) => taskName2.includes(name2)
|
|
5815
|
+
);
|
|
5816
|
+
if (!name2) return "请输入“完成任务 任务名称”领取任务奖励";
|
|
5817
|
+
if (!taskEntry) return `⚠️ 未找到名称包含"${name2}"的任务`;
|
|
5818
|
+
const [taskName, taskConfig] = taskEntry;
|
|
5819
|
+
const [taskData] = await ctx.database.get("ggcevo_task", {
|
|
5820
|
+
handle,
|
|
5821
|
+
taskId: taskConfig.id
|
|
5822
|
+
});
|
|
5823
|
+
if (!taskData) return `⚠️ 您尚未开始"${taskName}"任务`;
|
|
5824
|
+
if (taskData.progress < taskConfig.target) {
|
|
5825
|
+
return `⚠️ 任务进度不足!当前进度:${taskData.progress}/${taskConfig.target}`;
|
|
5826
|
+
}
|
|
5827
|
+
const newProgress = taskData.progress - taskConfig.target;
|
|
5828
|
+
const newCompletions = taskData.Completions + 1;
|
|
5829
|
+
await ctx.database.set("ggcevo_task", {
|
|
5830
|
+
handle,
|
|
5831
|
+
taskId: taskConfig.id
|
|
5832
|
+
}, {
|
|
5833
|
+
progress: newProgress,
|
|
5834
|
+
Completions: newCompletions
|
|
5835
|
+
});
|
|
5836
|
+
const [signData] = await ctx.database.get("ggcevo_sign", { handle });
|
|
5837
|
+
await ctx.database.upsert("ggcevo_sign", [{
|
|
5838
|
+
handle,
|
|
5839
|
+
totalRewards: (signData?.totalRewards || 0) + taskConfig.price
|
|
5840
|
+
}], ["handle"]);
|
|
5841
|
+
const [updatedSignData] = await ctx.database.get("ggcevo_sign", { handle });
|
|
5842
|
+
return [
|
|
5843
|
+
`🎉 恭喜您成功完成【${taskName}】任务!`,
|
|
5844
|
+
`任务奖励:${taskConfig.price}金币`,
|
|
5845
|
+
`累计完成次数:${newCompletions}次`,
|
|
5846
|
+
`剩余进度点数:${newProgress}`,
|
|
5847
|
+
`当前拥有金币:${updatedSignData.totalRewards}`,
|
|
5848
|
+
newProgress >= taskConfig.target ? `💡 当前剩余进度可再完成${Math.floor(newProgress / taskConfig.target)}次任务` : ``
|
|
5690
5849
|
].join("\n");
|
|
5691
5850
|
});
|
|
5692
5851
|
}
|