koishi-plugin-ggcevo-game 1.5.22 → 1.5.23
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/careersystem/technology.d.ts +8 -0
- package/lib/database.d.ts +18 -0
- package/lib/index.js +803 -125
- package/lib/items.d.ts +9 -0
- package/lib/spaceship.d.ts +50 -0
- package/lib/wish.d.ts +3 -3
- package/package.json +1 -1
|
@@ -10,3 +10,11 @@ export declare const Spacestationtechnology: {
|
|
|
10
10
|
careerBonus: string;
|
|
11
11
|
}[];
|
|
12
12
|
}[];
|
|
13
|
+
export declare const itemupgrades: {
|
|
14
|
+
id: number;
|
|
15
|
+
name: string;
|
|
16
|
+
upgradeCostBase: number;
|
|
17
|
+
minUpgrade: number;
|
|
18
|
+
maxUpgrade: number;
|
|
19
|
+
maxBonus: number;
|
|
20
|
+
}[];
|
package/lib/database.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ declare module 'koishi' {
|
|
|
23
23
|
ggcevo_task: TaskProgress;
|
|
24
24
|
ggcevo_permissions: Permissions;
|
|
25
25
|
ggcevo_pk_protection: PKProtection;
|
|
26
|
+
ggcevo_spaceship: spaceship;
|
|
27
|
+
ggcevo_explore: explore;
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
export interface Backpack {
|
|
@@ -170,6 +172,7 @@ export interface Warehouse {
|
|
|
170
172
|
handle: string;
|
|
171
173
|
itemId: number;
|
|
172
174
|
quantity: number;
|
|
175
|
+
bonus: number;
|
|
173
176
|
}
|
|
174
177
|
export interface TechProgress {
|
|
175
178
|
handle: string;
|
|
@@ -205,3 +208,18 @@ export interface PKProtection {
|
|
|
205
208
|
*/
|
|
206
209
|
status: 'active' | 'expired' | 'canceled';
|
|
207
210
|
}
|
|
211
|
+
export interface spaceship {
|
|
212
|
+
handle: string;
|
|
213
|
+
id: number;
|
|
214
|
+
status: string;
|
|
215
|
+
createTime: Date;
|
|
216
|
+
}
|
|
217
|
+
export interface explore {
|
|
218
|
+
handle: string;
|
|
219
|
+
name: string;
|
|
220
|
+
startTime: Date;
|
|
221
|
+
galaxy: string;
|
|
222
|
+
returns: number;
|
|
223
|
+
plunderbonus: number;
|
|
224
|
+
status: string;
|
|
225
|
+
}
|
package/lib/index.js
CHANGED
|
@@ -411,7 +411,7 @@ var weaponConfig = {
|
|
|
411
411
|
damage: 100,
|
|
412
412
|
armorDamageReduction: 1,
|
|
413
413
|
description: "一件传奇武器",
|
|
414
|
-
specialeffect: "攻击触发散射,对次要目标造成
|
|
414
|
+
specialeffect: "攻击触发散射,对次要目标造成50%基础伤害;每次攻击消耗目标500点能量值",
|
|
415
415
|
price: 6400,
|
|
416
416
|
redCrystalCost: 200,
|
|
417
417
|
isantiair: true,
|
|
@@ -562,7 +562,7 @@ var SyndicatedItems = {
|
|
|
562
562
|
type: "爆破物",
|
|
563
563
|
description: "一种小型的机械装置,用于吸收空间站能量并进行爆破",
|
|
564
564
|
price: 0,
|
|
565
|
-
redCrystalCost:
|
|
565
|
+
redCrystalCost: 0,
|
|
566
566
|
condition: "空间站哨枪塔存活",
|
|
567
567
|
effects: "对空间站哨枪塔造成其当前血量值的伤害(获得等同于伤害值的金币)"
|
|
568
568
|
},
|
|
@@ -580,9 +580,9 @@ var SyndicatedItems = {
|
|
|
580
580
|
type: "设备工具",
|
|
581
581
|
description: "一个小型辛迪加机器人,可以破坏电子银行账户",
|
|
582
582
|
price: 0,
|
|
583
|
-
redCrystalCost:
|
|
583
|
+
redCrystalCost: 30,
|
|
584
584
|
condition: "辛迪加海盗阵营",
|
|
585
|
-
effects: "每日签到金币奖励+50
|
|
585
|
+
effects: "每日签到金币奖励+50%"
|
|
586
586
|
},
|
|
587
587
|
"脉冲手雷": {
|
|
588
588
|
id: 4,
|
|
@@ -619,6 +619,15 @@ var SyndicatedItems = {
|
|
|
619
619
|
redCrystalCost: 30,
|
|
620
620
|
condition: "辛迪加海盗阵营",
|
|
621
621
|
effects: "主动发起的PK对战结果为胜利时将获得辛迪加海盗总部发放的等额抢夺金币作为奖励"
|
|
622
|
+
},
|
|
623
|
+
"自动采掘机器人": {
|
|
624
|
+
id: 8,
|
|
625
|
+
type: "设备工具",
|
|
626
|
+
description: "建造机器人,用于自动采集太空矿物",
|
|
627
|
+
price: 0,
|
|
628
|
+
redCrystalCost: 20,
|
|
629
|
+
condition: "辛迪加海盗阵营",
|
|
630
|
+
effects: "挖矿收益提高10%;可使用红晶升级(每次升级提高5%-10%,最多提高100%)"
|
|
622
631
|
}
|
|
623
632
|
};
|
|
624
633
|
var initDefaultItems = {
|
|
@@ -673,10 +682,10 @@ var itemConfig = {
|
|
|
673
682
|
var spaceStationCrewConfig = [
|
|
674
683
|
{
|
|
675
684
|
professionName: "深空矿工",
|
|
676
|
-
effect: "
|
|
677
|
-
requirements: "
|
|
685
|
+
effect: "挖矿的收益提高50%",
|
|
686
|
+
requirements: "挖矿累计收益达到500金币",
|
|
678
687
|
Jobtransfer: true,
|
|
679
|
-
costcoins:
|
|
688
|
+
costcoins: 2e3
|
|
680
689
|
},
|
|
681
690
|
{
|
|
682
691
|
professionName: "警卫员下士",
|
|
@@ -715,10 +724,10 @@ var spaceStationCrewConfig = [
|
|
|
715
724
|
},
|
|
716
725
|
{
|
|
717
726
|
professionName: "总工程师",
|
|
718
|
-
effect: "
|
|
719
|
-
requirements: "",
|
|
720
|
-
Jobtransfer:
|
|
721
|
-
costcoins:
|
|
727
|
+
effect: "探索获得的金币收益提高50%",
|
|
728
|
+
requirements: "探索次数达到4次及以上",
|
|
729
|
+
Jobtransfer: true,
|
|
730
|
+
costcoins: 2e3
|
|
722
731
|
},
|
|
723
732
|
{
|
|
724
733
|
professionName: "舰长",
|
|
@@ -794,10 +803,10 @@ var syndicatePirateConfig = [
|
|
|
794
803
|
},
|
|
795
804
|
{
|
|
796
805
|
professionName: "指挥官",
|
|
797
|
-
effect: "
|
|
806
|
+
effect: "使用红晶升级物品享有50%的折扣;购买光剑(传奇)享有50%的折扣",
|
|
798
807
|
requirements: "PK胜利20次及以上;非辛迪加炮灰新兵职业",
|
|
799
808
|
Jobtransfer: true,
|
|
800
|
-
costredcrystal:
|
|
809
|
+
costredcrystal: 40
|
|
801
810
|
},
|
|
802
811
|
{
|
|
803
812
|
professionName: "装甲兵",
|
|
@@ -844,10 +853,21 @@ async function checkTransferRequirements(ctx, handle, profession) {
|
|
|
844
853
|
});
|
|
845
854
|
switch (profession) {
|
|
846
855
|
case "深空矿工":
|
|
856
|
+
const [miningRecord] = await ctx.database.get("ggcevo_Mining", { handle });
|
|
857
|
+
const totalMined = miningRecord?.totalMined || 0;
|
|
858
|
+
return {
|
|
859
|
+
success: totalMined >= 500,
|
|
860
|
+
message: totalMined >= 500 ? "" : `需要挖矿累计收益达到500金币(当前${totalMined}金币)`
|
|
861
|
+
};
|
|
862
|
+
// +++ 新增总工程师检查 +++
|
|
863
|
+
case "总工程师": {
|
|
864
|
+
const exploreRecords = await ctx.database.get("ggcevo_explore", { handle });
|
|
865
|
+
const totalReturns = exploreRecords.reduce((sum, r) => sum + (r.returns || 0), 0);
|
|
847
866
|
return {
|
|
848
|
-
success:
|
|
849
|
-
message:
|
|
867
|
+
success: totalReturns >= 4,
|
|
868
|
+
message: totalReturns >= 4 ? "" : `需要探索返回次数达到4次及以上(当前${totalReturns}次)`
|
|
850
869
|
};
|
|
870
|
+
}
|
|
851
871
|
case "警卫员下士":
|
|
852
872
|
if (!mainBoss) return { success: false, message: "当前暂无伤害榜。" };
|
|
853
873
|
return {
|
|
@@ -1009,32 +1029,32 @@ var Spacestationtechnology = [
|
|
|
1009
1029
|
{
|
|
1010
1030
|
level: 1,
|
|
1011
1031
|
cost: 500,
|
|
1012
|
-
description: "
|
|
1013
|
-
careerBonus: "
|
|
1032
|
+
description: "提高挖矿效率,获得的收益提高5%",
|
|
1033
|
+
careerBonus: "挖矿的收益额外提高5%"
|
|
1014
1034
|
},
|
|
1015
1035
|
{
|
|
1016
1036
|
level: 2,
|
|
1017
1037
|
cost: 1750,
|
|
1018
|
-
description: "
|
|
1019
|
-
careerBonus: "
|
|
1038
|
+
description: "提高挖矿效率,获得的收益提高10%",
|
|
1039
|
+
careerBonus: "挖矿的收益额外提高10%"
|
|
1020
1040
|
},
|
|
1021
1041
|
{
|
|
1022
1042
|
level: 3,
|
|
1023
1043
|
cost: 2950,
|
|
1024
|
-
description: "
|
|
1025
|
-
careerBonus: "
|
|
1044
|
+
description: "提高挖矿效率,获得的收益提高15%",
|
|
1045
|
+
careerBonus: "挖矿的收益额外提高15%"
|
|
1026
1046
|
},
|
|
1027
1047
|
{
|
|
1028
1048
|
level: 4,
|
|
1029
1049
|
cost: 4250,
|
|
1030
|
-
description: "
|
|
1031
|
-
careerBonus: "
|
|
1050
|
+
description: "提高挖矿效率,获得的收益提高20%",
|
|
1051
|
+
careerBonus: "挖矿的收益额外提高20%"
|
|
1032
1052
|
},
|
|
1033
1053
|
{
|
|
1034
1054
|
level: 5,
|
|
1035
1055
|
cost: 5375,
|
|
1036
|
-
description: "
|
|
1037
|
-
careerBonus: "
|
|
1056
|
+
description: "提高挖矿效率,获得的收益提高25%",
|
|
1057
|
+
careerBonus: "挖矿的收益额外提高25%,并且单次挖矿时间上限增加至48小时"
|
|
1038
1058
|
}
|
|
1039
1059
|
]
|
|
1040
1060
|
},
|
|
@@ -1159,23 +1179,76 @@ var Spacestationtechnology = [
|
|
|
1159
1179
|
level: 3,
|
|
1160
1180
|
cost: 2250,
|
|
1161
1181
|
description: "升级空间站关键系统,完成任务奖励+15%",
|
|
1162
|
-
careerBonus: "完成任务奖励额外+15
|
|
1182
|
+
careerBonus: "完成任务奖励额外+15%"
|
|
1163
1183
|
},
|
|
1164
1184
|
{
|
|
1165
1185
|
level: 4,
|
|
1166
1186
|
cost: 2950,
|
|
1167
1187
|
description: "升级空间站关键系统,完成任务奖励+20%",
|
|
1168
|
-
careerBonus: "完成任务奖励额外+20
|
|
1188
|
+
careerBonus: "完成任务奖励额外+20%"
|
|
1169
1189
|
},
|
|
1170
1190
|
{
|
|
1171
1191
|
level: 5,
|
|
1172
1192
|
cost: 3550,
|
|
1173
1193
|
description: "升级空间站关键系统,完成任务奖励+25%",
|
|
1174
|
-
careerBonus: "完成任务奖励额外+25
|
|
1194
|
+
careerBonus: "完成任务奖励额外+25%"
|
|
1195
|
+
}
|
|
1196
|
+
]
|
|
1197
|
+
},
|
|
1198
|
+
{
|
|
1199
|
+
techId: 6,
|
|
1200
|
+
techname: "反应堆",
|
|
1201
|
+
careerNames: ["总工程师", "情报副官"],
|
|
1202
|
+
// 新增职业名称字段
|
|
1203
|
+
maxLevel: 5,
|
|
1204
|
+
levels: [
|
|
1205
|
+
{
|
|
1206
|
+
level: 1,
|
|
1207
|
+
cost: 500,
|
|
1208
|
+
description: "升级空间站聚变反应堆控制,探索的金币收益提高5%",
|
|
1209
|
+
careerBonus: "探索的金币收益额外提高5%"
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
level: 2,
|
|
1213
|
+
cost: 1450,
|
|
1214
|
+
description: "升级空间站聚变反应堆控制,探索的金币收益提高10%",
|
|
1215
|
+
careerBonus: "探索的金币收益额外提高10%"
|
|
1216
|
+
},
|
|
1217
|
+
{
|
|
1218
|
+
level: 3,
|
|
1219
|
+
cost: 2250,
|
|
1220
|
+
description: "升级空间站聚变反应堆控制,探索的金币收益提高15%",
|
|
1221
|
+
careerBonus: "探索的金币收益额外提高15%"
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
level: 4,
|
|
1225
|
+
cost: 2950,
|
|
1226
|
+
description: "升级空间站聚变反应堆控制,探索的金币收益提高20%",
|
|
1227
|
+
careerBonus: "探索的金币收益额外提高20%"
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
level: 5,
|
|
1231
|
+
cost: 3550,
|
|
1232
|
+
description: "升级空间站聚变反应堆控制,探索的金币收益提高25%",
|
|
1233
|
+
careerBonus: "探索的金币收益额外提高25%"
|
|
1175
1234
|
}
|
|
1176
1235
|
]
|
|
1177
1236
|
}
|
|
1178
1237
|
];
|
|
1238
|
+
var itemupgrades = [
|
|
1239
|
+
{
|
|
1240
|
+
id: 1,
|
|
1241
|
+
name: "自动采掘机器人",
|
|
1242
|
+
upgradeCostBase: 20,
|
|
1243
|
+
// 升级基础成本
|
|
1244
|
+
minUpgrade: 5,
|
|
1245
|
+
// 每次升级最小提升
|
|
1246
|
+
maxUpgrade: 10,
|
|
1247
|
+
// 每次升级最大提升
|
|
1248
|
+
maxBonus: 90
|
|
1249
|
+
// 总提升上限
|
|
1250
|
+
}
|
|
1251
|
+
];
|
|
1179
1252
|
|
|
1180
1253
|
// src/tasks.ts
|
|
1181
1254
|
var Tasklist = {
|
|
@@ -5030,7 +5103,7 @@ var wishConfig = {
|
|
|
5030
5103
|
},
|
|
5031
5104
|
{
|
|
5032
5105
|
name: "王权增幅",
|
|
5033
|
-
effect: "
|
|
5106
|
+
effect: "攻击伤害提高5%"
|
|
5034
5107
|
},
|
|
5035
5108
|
{
|
|
5036
5109
|
name: "金柚赐福",
|
|
@@ -5045,7 +5118,7 @@ var wishConfig = {
|
|
|
5045
5118
|
rare: [
|
|
5046
5119
|
{
|
|
5047
5120
|
name: "悲鸣之锋",
|
|
5048
|
-
effect: "
|
|
5121
|
+
effect: "攻击伤害提高10%,武器每等级提高5%伤害"
|
|
5049
5122
|
},
|
|
5050
5123
|
{
|
|
5051
5124
|
name: "精灵双倍",
|
|
@@ -5057,7 +5130,7 @@ var wishConfig = {
|
|
|
5057
5130
|
},
|
|
5058
5131
|
{
|
|
5059
5132
|
name: "暴击韵律",
|
|
5060
|
-
effect: "
|
|
5133
|
+
effect: "攻击暴击率提高20%"
|
|
5061
5134
|
},
|
|
5062
5135
|
{
|
|
5063
5136
|
name: "酥手空空",
|
|
@@ -5176,6 +5249,22 @@ var ggcevoUpdates = [
|
|
|
5176
5249
|
content: `
|
|
5177
5250
|
- 增强了寒冰王蛇的冰霜环绕技能,使其可以清空自身燃烧层数
|
|
5178
5251
|
`.trim()
|
|
5252
|
+
},
|
|
5253
|
+
{
|
|
5254
|
+
version: "1.5.23",
|
|
5255
|
+
time: "2025-07-07",
|
|
5256
|
+
content: `
|
|
5257
|
+
- 重制了采掘科技加成和深空矿工职业加成
|
|
5258
|
+
- 重制了关键系统固件科技加成
|
|
5259
|
+
- 新增了反应堆科技和总工程师职业
|
|
5260
|
+
- 重制了“挖矿”机制,使得所有人都可以进行挖矿
|
|
5261
|
+
- 新增了飞船机制
|
|
5262
|
+
- 新增了“探索”机制
|
|
5263
|
+
- 新增了辛迪加黑市设备工具“自动采掘机器人”
|
|
5264
|
+
- 重制了辛迪加海盗阵营的“指挥官”加成
|
|
5265
|
+
- 新增了辛迪加海盗阵营升级物品机制
|
|
5266
|
+
- 修改了异形主宰复活逻辑,现在只会在12点和0点复活
|
|
5267
|
+
`.trim()
|
|
5179
5268
|
}
|
|
5180
5269
|
];
|
|
5181
5270
|
function compareVersions(a, b) {
|
|
@@ -5588,7 +5677,7 @@ async function handleTechUpgrade(ctx, handle, target) {
|
|
|
5588
5677
|
type: "安防系统",
|
|
5589
5678
|
field: "explosiondoorauthority",
|
|
5590
5679
|
amount: 1,
|
|
5591
|
-
message: "🔓 解锁安全军械库防爆门权限1
|
|
5680
|
+
message: "🔓 解锁安全军械库防爆门权限1次!(使用指令“开启军械库防爆门”)"
|
|
5592
5681
|
};
|
|
5593
5682
|
}
|
|
5594
5683
|
await ctx.database.withTransaction(async () => {
|
|
@@ -6098,7 +6187,7 @@ async function calculateWishAdditive(ctx, handle, weapon) {
|
|
|
6098
6187
|
endTime: { $gte: /* @__PURE__ */ new Date() }
|
|
6099
6188
|
});
|
|
6100
6189
|
if (lament) {
|
|
6101
|
-
const levelBonus = 0.
|
|
6190
|
+
const levelBonus = 0.05 * weapon.level + 0.1;
|
|
6102
6191
|
value += levelBonus;
|
|
6103
6192
|
messages.push(`🗡️ 悲鸣之锋祈愿:攻击伤害+${Math.round(levelBonus * 100)}%`);
|
|
6104
6193
|
}
|
|
@@ -6359,7 +6448,7 @@ async function handleScatterAttack(ctx, session, handle, config, equippedWeapon,
|
|
|
6359
6448
|
scatterRatio = 1.2;
|
|
6360
6449
|
} else if (weaponName === "DG-3电弧步枪") {
|
|
6361
6450
|
scatterEffectMessages.push("【DG-3电弧步枪】触发散射攻击!");
|
|
6362
|
-
scatterRatio = 0.
|
|
6451
|
+
scatterRatio = 0.5;
|
|
6363
6452
|
}
|
|
6364
6453
|
for (const secondaryTarget of secondaryTargets) {
|
|
6365
6454
|
const damageResult = await calculateTotalDamage(
|
|
@@ -6447,13 +6536,28 @@ async function handleDeathTargets(ctx, deadTargets, killerName, killerHandle) {
|
|
|
6447
6536
|
isActive: false,
|
|
6448
6537
|
HP: 0
|
|
6449
6538
|
});
|
|
6450
|
-
const
|
|
6451
|
-
|
|
6452
|
-
|
|
6539
|
+
const now = /* @__PURE__ */ new Date();
|
|
6540
|
+
let nextRespawn = /* @__PURE__ */ new Date();
|
|
6541
|
+
const hours = now.getHours();
|
|
6542
|
+
console.log(`当前小时:${hours}`);
|
|
6543
|
+
if (hours < 12) {
|
|
6544
|
+
nextRespawn.setHours(12, 0, 0, 0);
|
|
6545
|
+
} else {
|
|
6546
|
+
nextRespawn.setDate(nextRespawn.getDate() + 1);
|
|
6547
|
+
nextRespawn.setHours(0, 0, 0, 0);
|
|
6548
|
+
}
|
|
6549
|
+
await ctx.database.set("ggcevo_boss", { name: deadBoss.name }, {
|
|
6550
|
+
respawnTime: nextRespawn
|
|
6551
|
+
});
|
|
6453
6552
|
const { rewardMessages } = await handleBossDefeatRewards(ctx, deadBoss);
|
|
6553
|
+
const timeFormat = nextRespawn.toLocaleTimeString("zh-CN", {
|
|
6554
|
+
hour: "2-digit",
|
|
6555
|
+
minute: "2-digit",
|
|
6556
|
+
hour12: false
|
|
6557
|
+
});
|
|
6454
6558
|
bossBroadcast.push(
|
|
6455
6559
|
`🎯 主宰 ${deadBoss.name} 已被 ${killerName} 击败!`,
|
|
6456
|
-
|
|
6560
|
+
`所有子代已消失,主宰将在 ${timeFormat} 重生`,
|
|
6457
6561
|
"",
|
|
6458
6562
|
"🏆 伤害排行榜奖励:",
|
|
6459
6563
|
...rewardMessages
|
|
@@ -6804,6 +6908,60 @@ async function createNestlingBosses(ctx, nestlingNames) {
|
|
|
6804
6908
|
}
|
|
6805
6909
|
__name(createNestlingBosses, "createNestlingBosses");
|
|
6806
6910
|
|
|
6911
|
+
// src/spaceship.ts
|
|
6912
|
+
var spaceship = {
|
|
6913
|
+
"TX-12星际巡洋舰": {
|
|
6914
|
+
id: 1,
|
|
6915
|
+
description: "TX-12是为商业用途开发的标准通用星际巡洋舰",
|
|
6916
|
+
miningbonus: 10,
|
|
6917
|
+
explorebonus: 0,
|
|
6918
|
+
effect: "",
|
|
6919
|
+
price: 1e3
|
|
6920
|
+
},
|
|
6921
|
+
"TX-12S隐形巡洋舰": {
|
|
6922
|
+
id: 2,
|
|
6923
|
+
description: "TX-12S是标准星际巡洋舰的改型",
|
|
6924
|
+
miningbonus: 10,
|
|
6925
|
+
explorebonus: 10,
|
|
6926
|
+
effect: "探索的成功率提高20%",
|
|
6927
|
+
price: 1500
|
|
6928
|
+
},
|
|
6929
|
+
"TX-12A突击巡洋舰": {
|
|
6930
|
+
id: 3,
|
|
6931
|
+
description: "TX-12S是标准星际巡洋舰的改型",
|
|
6932
|
+
miningbonus: 0,
|
|
6933
|
+
explorebonus: 20,
|
|
6934
|
+
effect: "探索发生掠夺的概率提高20%",
|
|
6935
|
+
price: 2e3
|
|
6936
|
+
},
|
|
6937
|
+
"庞兽号歼星舰": {
|
|
6938
|
+
id: 4,
|
|
6939
|
+
description: "巨兽级歼星舰的小型化版本",
|
|
6940
|
+
miningbonus: 0,
|
|
6941
|
+
explorebonus: 50,
|
|
6942
|
+
effect: "探索发生掠夺的概率提高50%;掠夺的收益提高50%",
|
|
6943
|
+
price: 6e3
|
|
6944
|
+
}
|
|
6945
|
+
};
|
|
6946
|
+
var galaxy = {
|
|
6947
|
+
"联盟星系": {
|
|
6948
|
+
description: "这一片都是人类联盟的地区,但是并非一切都很安全",
|
|
6949
|
+
success: 0.6,
|
|
6950
|
+
bonus: 1,
|
|
6951
|
+
// 金币加成系数(1.0表示无加成)
|
|
6952
|
+
available: "金币,爆破物,手榴弹",
|
|
6953
|
+
effect: "人类联盟阵营探索时成功率提高10%"
|
|
6954
|
+
},
|
|
6955
|
+
"辛迪加星系": {
|
|
6956
|
+
description: "这一片都是辛迪加海盗的地区,充满欺诈与混乱",
|
|
6957
|
+
success: 0.4,
|
|
6958
|
+
bonus: 1.2,
|
|
6959
|
+
// 金币加成系数(1.2表示+20%)
|
|
6960
|
+
available: "金币,爆破物,手榴弹",
|
|
6961
|
+
effect: "辛迪加海盗阵营探索时成功率提高10%"
|
|
6962
|
+
}
|
|
6963
|
+
};
|
|
6964
|
+
|
|
6807
6965
|
// src/index.ts
|
|
6808
6966
|
var name = "ggcevo-game";
|
|
6809
6967
|
var inject = {
|
|
@@ -7046,7 +7204,8 @@ function apply(ctx, config) {
|
|
|
7046
7204
|
ctx.model.extend("ggcevo_warehouse", {
|
|
7047
7205
|
handle: "string",
|
|
7048
7206
|
itemId: "unsigned",
|
|
7049
|
-
quantity: "unsigned"
|
|
7207
|
+
quantity: "unsigned",
|
|
7208
|
+
bonus: "unsigned"
|
|
7050
7209
|
}, {
|
|
7051
7210
|
primary: ["handle", "itemId"]
|
|
7052
7211
|
});
|
|
@@ -7089,6 +7248,25 @@ function apply(ctx, config) {
|
|
|
7089
7248
|
primary: "id",
|
|
7090
7249
|
autoInc: true
|
|
7091
7250
|
});
|
|
7251
|
+
ctx.model.extend("ggcevo_spaceship", {
|
|
7252
|
+
handle: "string",
|
|
7253
|
+
id: "unsigned",
|
|
7254
|
+
status: "string",
|
|
7255
|
+
createTime: "timestamp"
|
|
7256
|
+
}, {
|
|
7257
|
+
primary: "handle"
|
|
7258
|
+
});
|
|
7259
|
+
ctx.model.extend("ggcevo_explore", {
|
|
7260
|
+
handle: "string",
|
|
7261
|
+
name: "string",
|
|
7262
|
+
startTime: "timestamp",
|
|
7263
|
+
galaxy: "string",
|
|
7264
|
+
returns: "unsigned",
|
|
7265
|
+
plunderbonus: "unsigned",
|
|
7266
|
+
status: "string"
|
|
7267
|
+
}, {
|
|
7268
|
+
primary: "handle"
|
|
7269
|
+
});
|
|
7092
7270
|
ctx.setInterval(async () => {
|
|
7093
7271
|
const totalBosses = await ctx.database.select("ggcevo_boss").execute((row) => import_koishi.$.count(row.name));
|
|
7094
7272
|
const groupId = [...config.groupId];
|
|
@@ -7433,69 +7611,22 @@ ${itemDetails.join("\n")}`;
|
|
|
7433
7611
|
else if (monthlyDays === 28) baseTickets = 7;
|
|
7434
7612
|
else baseTickets = 3;
|
|
7435
7613
|
let tickets = baseTickets;
|
|
7436
|
-
const [systemFirmwareTech] = await ctx.database.get("ggcevo_tech", { handle, techId: 5 }).catch(() => [{ level: 0 }]);
|
|
7437
|
-
const systemFirmwareLevel = Math.min(systemFirmwareTech?.level || 0, 5);
|
|
7438
7614
|
const [careerData] = await ctx.database.get("ggcevo_careers", { handle });
|
|
7439
|
-
const shouldApplyFirmwareEffect = careerData?.group === "人类联盟" && ["舰长", "情报副官"].includes(careerData.career) && systemFirmwareLevel >= 3;
|
|
7440
7615
|
let basePoints;
|
|
7441
|
-
if (
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
} else if (systemFirmwareLevel >= 4) {
|
|
7447
|
-
if (monthlyDays < 21) basePoints = getRandomInt(60, 80);
|
|
7448
|
-
else if (monthlyDays < 28) basePoints = getRandomInt(80, 100);
|
|
7449
|
-
else basePoints = getRandomInt(100, 200);
|
|
7450
|
-
messages.push(`🛰️ 关键系统固件Lv.4:移除签到14日以下奖励区间`);
|
|
7451
|
-
} else if (systemFirmwareLevel >= 3) {
|
|
7452
|
-
if (monthlyDays < 14) basePoints = getRandomInt(40, 60);
|
|
7453
|
-
else if (monthlyDays < 21) basePoints = getRandomInt(60, 80);
|
|
7454
|
-
else if (monthlyDays < 28) basePoints = getRandomInt(80, 100);
|
|
7455
|
-
else basePoints = getRandomInt(100, 200);
|
|
7456
|
-
messages.push(`🛰️ 关键系统固件Lv.3:移除签到7日以下奖励区间`);
|
|
7457
|
-
}
|
|
7458
|
-
} else {
|
|
7459
|
-
if (monthlyDays < 7) basePoints = getRandomInt(20, 40);
|
|
7460
|
-
else if (monthlyDays < 14) basePoints = getRandomInt(40, 60);
|
|
7461
|
-
else if (monthlyDays < 21) basePoints = getRandomInt(60, 80);
|
|
7462
|
-
else if (monthlyDays < 28) basePoints = getRandomInt(80, 100);
|
|
7463
|
-
else basePoints = getRandomInt(100, 200);
|
|
7464
|
-
}
|
|
7616
|
+
if (monthlyDays < 7) basePoints = getRandomInt(20, 40);
|
|
7617
|
+
else if (monthlyDays < 14) basePoints = getRandomInt(40, 60);
|
|
7618
|
+
else if (monthlyDays < 21) basePoints = getRandomInt(60, 80);
|
|
7619
|
+
else if (monthlyDays < 28) basePoints = getRandomInt(80, 100);
|
|
7620
|
+
else basePoints = getRandomInt(100, 200);
|
|
7465
7621
|
if (careerData?.group === "人类联盟") {
|
|
7466
7622
|
totalBonus += 0.2;
|
|
7467
7623
|
messages.push("🏛️ 人类联盟阵营:+20%金币");
|
|
7468
|
-
const [userMiningTech] = await ctx.database.get("ggcevo_tech", { handle, techId: 1 }).catch(() => [{ level: 0 }]);
|
|
7469
|
-
const techLevel = Math.min(userMiningTech?.level || 0, 5);
|
|
7470
|
-
const miningTechConfig = Spacestationtechnology.find((t) => t.techId === 1);
|
|
7471
|
-
if (miningTechConfig) {
|
|
7472
|
-
const BASE_BONUS = [5, 10, 15, 20, 25];
|
|
7473
|
-
const baseTechBonus = techLevel > 0 ? BASE_BONUS[techLevel - 1] : 0;
|
|
7474
|
-
let careerTechBonus = 0;
|
|
7475
|
-
if (careerData.career && miningTechConfig.careerNames.includes(careerData.career)) {
|
|
7476
|
-
const CAREER_BONUS = [10, 20, 30, 40, 50];
|
|
7477
|
-
careerTechBonus = techLevel > 0 ? CAREER_BONUS[techLevel - 1] : 0;
|
|
7478
|
-
}
|
|
7479
|
-
const finalBonus = Math.max(baseTechBonus, careerTechBonus);
|
|
7480
|
-
if (finalBonus > 0) {
|
|
7481
|
-
totalBonus += finalBonus / 100;
|
|
7482
|
-
messages.push(`⚙️ 采掘系统Lv.${techLevel}:+${finalBonus}%金币`);
|
|
7483
|
-
}
|
|
7484
|
-
}
|
|
7485
|
-
if (careerData.career === "深空矿工") {
|
|
7486
|
-
totalBonus += 0.5;
|
|
7487
|
-
messages.push("⛏️ 深空矿工职业:+50%金币");
|
|
7488
|
-
}
|
|
7489
7624
|
}
|
|
7490
7625
|
if (careerData?.group === "辛迪加海盗") {
|
|
7491
7626
|
const [cred17Item] = await ctx.database.get("ggcevo_warehouse", { handle, itemId: 3 });
|
|
7492
7627
|
if (cred17Item?.quantity >= 1) {
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
const credBonus = 0.5 + additionalBonus / 100;
|
|
7496
|
-
const totalBonusPercent = Math.round(credBonus * 100);
|
|
7497
|
-
totalBonus += credBonus;
|
|
7498
|
-
messages.push(`💎 CRED-17生效:+${totalBonusPercent}%金币`);
|
|
7628
|
+
totalBonus += 0.5;
|
|
7629
|
+
messages.push("💎 CRED-17生效:+50%金币");
|
|
7499
7630
|
}
|
|
7500
7631
|
}
|
|
7501
7632
|
const [meowEffect] = await ctx.database.get("ggcevo_wish", {
|
|
@@ -9794,7 +9925,7 @@ ${testResult.passiveMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
9794
9925
|
});
|
|
9795
9926
|
ctx.command("ggcevo/异形信息", "查看当前主宰信息").alias("yx信息").action(async () => {
|
|
9796
9927
|
const activeBosses = await ctx.database.get("ggcevo_boss", { isActive: true });
|
|
9797
|
-
if (!activeBosses.length) return "
|
|
9928
|
+
if (!activeBosses.length) return "当前没有存活的异形,请等待12点或0点刷新。";
|
|
9798
9929
|
const mainBoss = activeBosses.find((b) => b.type === "主宰");
|
|
9799
9930
|
const minions = activeBosses.filter((b) => b.type === "子代");
|
|
9800
9931
|
if (!mainBoss) return "当前数据异常,请联系管理员";
|
|
@@ -10795,14 +10926,21 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
10795
10926
|
return "⛔ 您已被列入黑名单。";
|
|
10796
10927
|
}
|
|
10797
10928
|
const [career] = await ctx.database.get("ggcevo_careers", { handle });
|
|
10798
|
-
if (!career
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
return "🚫 需要职业为深空矿工或情报副官";
|
|
10929
|
+
if (!career) return "🚫 需要阵营为【人类联盟】或【辛迪加海盗】";
|
|
10930
|
+
const allowedGroups = ["人类联盟", "辛迪加海盗"];
|
|
10931
|
+
if (!allowedGroups.includes(career.group)) {
|
|
10932
|
+
return `🚫 需要阵营为【人类联盟】或【辛迪加海盗】,您当前是${career.group}`;
|
|
10803
10933
|
}
|
|
10804
10934
|
const [tech] = await ctx.database.get("ggcevo_tech", { handle, techId: 1 });
|
|
10805
|
-
|
|
10935
|
+
const techLevel = tech?.level || 0;
|
|
10936
|
+
const warehouseItems = await ctx.database.get("ggcevo_warehouse", { handle });
|
|
10937
|
+
let itemBonusRate = 0;
|
|
10938
|
+
let miningRobotBonus = 0;
|
|
10939
|
+
const miningItem = warehouseItems.find((item) => item.itemId === 8);
|
|
10940
|
+
if (miningItem) {
|
|
10941
|
+
miningRobotBonus = (10 + miningItem.bonus) / 100;
|
|
10942
|
+
itemBonusRate += miningRobotBonus;
|
|
10943
|
+
}
|
|
10806
10944
|
const [record] = await ctx.database.get("ggcevo_Mining", { handle });
|
|
10807
10945
|
const [sign] = await ctx.database.get("ggcevo_sign", { handle });
|
|
10808
10946
|
if (!record) {
|
|
@@ -10812,7 +10950,7 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
10812
10950
|
totalMined: 0
|
|
10813
10951
|
// 初始化总收益
|
|
10814
10952
|
});
|
|
10815
|
-
return "⛏️ 首次挖矿作业已开始,请至少等待1小时后才可收获。\n提示:基础收益为每半小时
|
|
10953
|
+
return "⛏️ 首次挖矿作业已开始,请至少等待1小时后才可收获。\n提示:基础收益为每半小时3枚金币";
|
|
10816
10954
|
}
|
|
10817
10955
|
const nowtime = /* @__PURE__ */ new Date();
|
|
10818
10956
|
const chinaStart = record.startTime;
|
|
@@ -10826,27 +10964,52 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
10826
10964
|
`🕒 开始时间:${record.startTime.toLocaleString("zh-CN", { hour12: false })}`,
|
|
10827
10965
|
`⏱️ 当前时间:${nowtime.toLocaleString("zh-CN", { hour12: false })}`,
|
|
10828
10966
|
`⏳ 还需等待:${remaining}分钟`,
|
|
10829
|
-
`💡 提示:本轮挖矿1
|
|
10967
|
+
`💡 提示:本轮挖矿1小时后才可收获并自动开始下一轮挖矿
|
|
10968
|
+
基础收益为每半小时3枚金币`
|
|
10830
10969
|
].join("\n");
|
|
10831
10970
|
}
|
|
10832
|
-
|
|
10833
|
-
let base = halfHours *
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
base = Math.min(base, maxHalfHours *
|
|
10837
|
-
let
|
|
10838
|
-
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
|
|
10971
|
+
let halfHours = Math.floor(duration / 30);
|
|
10972
|
+
let base = halfHours * 3;
|
|
10973
|
+
const maxHalfHours = career.group === "人类联盟" && techLevel === 5 ? 96 : 48;
|
|
10974
|
+
halfHours = Math.min(halfHours, maxHalfHours);
|
|
10975
|
+
base = Math.round(Math.min(base, maxHalfHours * 3));
|
|
10976
|
+
let techBonusRate = 0;
|
|
10977
|
+
let careerBonusRate = 0;
|
|
10978
|
+
let shipBonusRate = 0;
|
|
10979
|
+
let minerBonusRate = 0;
|
|
10980
|
+
if (career.group === "人类联盟") {
|
|
10981
|
+
const baseTechRates = [0, 0.05, 0.1, 0.15, 0.2, 0.25];
|
|
10982
|
+
techBonusRate = techLevel > 0 ? baseTechRates[Math.min(techLevel, 5)] : 0;
|
|
10983
|
+
const techCareers = ["深空矿工", "情报副官"];
|
|
10984
|
+
if (techCareers.includes(career.career)) {
|
|
10985
|
+
const careerBonusRates = [0, 0.1, 0.2, 0.3, 0.4, 0.5];
|
|
10986
|
+
careerBonusRate = techLevel > 0 ? careerBonusRates[Math.min(techLevel, 5)] : 0;
|
|
10987
|
+
}
|
|
10988
|
+
}
|
|
10989
|
+
if (career.career === "深空矿工") {
|
|
10990
|
+
minerBonusRate = 0.5;
|
|
10991
|
+
}
|
|
10992
|
+
let shipName = "";
|
|
10993
|
+
const [equippedShip] = await ctx.database.get("ggcevo_spaceship", {
|
|
10994
|
+
handle
|
|
10995
|
+
});
|
|
10996
|
+
if (equippedShip) {
|
|
10997
|
+
const allowedShips = {
|
|
10998
|
+
"TX-12星际巡洋舰": 0.1,
|
|
10999
|
+
"TX-12S隐形巡洋舰": 0.1
|
|
11000
|
+
};
|
|
11001
|
+
for (const [name2, data] of Object.entries(spaceship)) {
|
|
11002
|
+
if (data.id === equippedShip.id) {
|
|
11003
|
+
shipName = name2;
|
|
11004
|
+
break;
|
|
11005
|
+
}
|
|
11006
|
+
}
|
|
11007
|
+
if (shipName && allowedShips[shipName]) {
|
|
11008
|
+
shipBonusRate = allowedShips[shipName];
|
|
11009
|
+
}
|
|
10848
11010
|
}
|
|
10849
|
-
const
|
|
11011
|
+
const totalBonusRate = Math.max(techBonusRate, careerBonusRate) + shipBonusRate + itemBonusRate + minerBonusRate;
|
|
11012
|
+
const total = Math.round(base * (1 + totalBonusRate));
|
|
10850
11013
|
await ctx.database.withTransaction(async () => {
|
|
10851
11014
|
await ctx.database.upsert("ggcevo_sign", [{
|
|
10852
11015
|
handle,
|
|
@@ -10855,7 +11018,6 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
10855
11018
|
await ctx.database.set("ggcevo_Mining", { handle }, {
|
|
10856
11019
|
startTime: /* @__PURE__ */ new Date(),
|
|
10857
11020
|
totalMined: (record.totalMined || 0) + total
|
|
10858
|
-
// 新增累加
|
|
10859
11021
|
});
|
|
10860
11022
|
});
|
|
10861
11023
|
const formatTime2 = /* @__PURE__ */ __name((mins) => {
|
|
@@ -10869,21 +11031,41 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
10869
11031
|
`⏱️ 结束时间:${nowtime.toLocaleString("zh-CN", { hour12: false })}`,
|
|
10870
11032
|
`⏳ 持续时间:${formatTime2(duration)}`
|
|
10871
11033
|
];
|
|
10872
|
-
const maxHours =
|
|
11034
|
+
const maxHours = maxHalfHours / 2;
|
|
10873
11035
|
if (duration > maxHours * 60) {
|
|
10874
11036
|
reportLines.push(`⚠️ 注意:收益已在${maxHours}小时达到上限`);
|
|
10875
11037
|
}
|
|
10876
11038
|
let rewardLine = `💰 实际获得:${total}金币`;
|
|
10877
|
-
if (
|
|
11039
|
+
if (totalBonusRate > 0) {
|
|
10878
11040
|
rewardLine += ` (基础值:${base}金币)`;
|
|
10879
11041
|
}
|
|
10880
11042
|
reportLines.push(rewardLine);
|
|
10881
|
-
|
|
11043
|
+
const hasMainBonus = Math.max(techBonusRate, careerBonusRate) > 0;
|
|
11044
|
+
const hasShipBonus = shipBonusRate > 0;
|
|
11045
|
+
const hasItemBonus = itemBonusRate > 0;
|
|
11046
|
+
const hasMinerBonus = minerBonusRate > 0;
|
|
11047
|
+
if (hasMainBonus || hasShipBonus || hasItemBonus || hasMinerBonus) {
|
|
10882
11048
|
reportLines.push(`⚡ 加成效果:`);
|
|
10883
|
-
|
|
11049
|
+
if (hasMainBonus) {
|
|
11050
|
+
const bonusRate = Math.max(techBonusRate, careerBonusRate);
|
|
11051
|
+
let bonusDesc = `⚙️ 采掘系统科技Lv.${techLevel}:+${(bonusRate * 100).toFixed(0)}%金币`;
|
|
11052
|
+
reportLines.push(`▸ ${bonusDesc}`);
|
|
11053
|
+
}
|
|
11054
|
+
if (hasShipBonus) {
|
|
11055
|
+
reportLines.push(`▸ 🚀 ${shipName}:+${(shipBonusRate * 100).toFixed(0)}%金币`);
|
|
11056
|
+
}
|
|
11057
|
+
if (hasItemBonus) {
|
|
11058
|
+
reportLines.push(`▸ 📦 自动采掘机器人:+${(miningRobotBonus * 100).toFixed(0)}%金币`);
|
|
11059
|
+
}
|
|
11060
|
+
if (hasMinerBonus) {
|
|
11061
|
+
reportLines.push(`▸ ⛏️ 深空矿工专业加成:+${(minerBonusRate * 100).toFixed(0)}%金币`);
|
|
11062
|
+
}
|
|
11063
|
+
if (techLevel === 5 && career.group === "人类联盟") {
|
|
11064
|
+
reportLines.push(`▸ ⏱️ 单次挖矿时间上限增加至48小时`);
|
|
11065
|
+
}
|
|
10884
11066
|
}
|
|
10885
11067
|
reportLines.push(`🏆 历史总挖矿收益:${record.totalMined + total}金币`);
|
|
10886
|
-
reportLines.push("💡
|
|
11068
|
+
reportLines.push("💡 已自动开始下一轮挖矿\n基础收益为每半小时3枚金币");
|
|
10887
11069
|
return reportLines.join("\n");
|
|
10888
11070
|
});
|
|
10889
11071
|
ctx.command("ggcevo/任务 [name]").usage('输入"任务"查看所有任务列表,或"任务 任务名称"查看详细任务信息').action(async ({ session }, name2) => {
|
|
@@ -11240,6 +11422,502 @@ ${Spacestationtechnology.map((t) => t.techname).join("、")}`;
|
|
|
11240
11422
|
return "🛠️ 系统维护中,请稍后再试";
|
|
11241
11423
|
}
|
|
11242
11424
|
});
|
|
11425
|
+
ctx.command("ggcevo/探索 [galaxyName]").action(async ({ session }, galaxyName) => {
|
|
11426
|
+
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
11427
|
+
if (!profile) return "🔒 需要先绑定游戏句柄。";
|
|
11428
|
+
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
11429
|
+
const name2 = session.userId;
|
|
11430
|
+
if (await ctx.database.get("ggcevo_blacklist", { handle }).then((r) => r.length)) {
|
|
11431
|
+
return "⛔ 您已被列入黑名单。";
|
|
11432
|
+
}
|
|
11433
|
+
const [career] = await ctx.database.get("ggcevo_careers", { handle });
|
|
11434
|
+
if (!career) return "🚫 需要阵营为【人类联盟】或【辛迪加海盗】";
|
|
11435
|
+
const allowedGroups = ["人类联盟", "辛迪加海盗"];
|
|
11436
|
+
if (!allowedGroups.includes(career.group)) {
|
|
11437
|
+
return `🚫 需要阵营为【人类联盟】或【辛迪加海盗】,您当前是${career.group}`;
|
|
11438
|
+
}
|
|
11439
|
+
const careerName = career.career;
|
|
11440
|
+
const careerCoinBonus = careerName === "总工程师" ? 50 : 0;
|
|
11441
|
+
const [shipRecord] = await ctx.database.get("ggcevo_spaceship", { handle });
|
|
11442
|
+
let shipBonus = 0;
|
|
11443
|
+
let shipEffect = "";
|
|
11444
|
+
let plunderRateBonus = 0;
|
|
11445
|
+
let plunderBonusEffect = 0;
|
|
11446
|
+
if (shipRecord) {
|
|
11447
|
+
const ship = Object.values(spaceship).find((s) => s.id === shipRecord.id);
|
|
11448
|
+
if (ship) {
|
|
11449
|
+
shipBonus = ship.explorebonus || 0;
|
|
11450
|
+
shipEffect = ship.effect || "";
|
|
11451
|
+
if (ship.id === 3) {
|
|
11452
|
+
plunderRateBonus = 20;
|
|
11453
|
+
} else if (ship.id === 4) {
|
|
11454
|
+
plunderRateBonus = 50;
|
|
11455
|
+
plunderBonusEffect = 50;
|
|
11456
|
+
}
|
|
11457
|
+
}
|
|
11458
|
+
}
|
|
11459
|
+
const [techReactor] = await ctx.database.get("ggcevo_tech", { handle, techId: 6 });
|
|
11460
|
+
const techLevel = techReactor?.level || 0;
|
|
11461
|
+
let techBonusRate = 0;
|
|
11462
|
+
let careerBonusRate = 0;
|
|
11463
|
+
if (career.group === "人类联盟" && techLevel > 0) {
|
|
11464
|
+
const baseRates = [0, 0.05, 0.1, 0.15, 0.2, 0.25];
|
|
11465
|
+
techBonusRate = baseRates[techLevel];
|
|
11466
|
+
const specialCareers = ["总工程师", "情报副官"];
|
|
11467
|
+
if (specialCareers.includes(careerName)) {
|
|
11468
|
+
careerBonusRate = baseRates[techLevel];
|
|
11469
|
+
}
|
|
11470
|
+
}
|
|
11471
|
+
const totalTechBonusRate = techBonusRate + careerBonusRate;
|
|
11472
|
+
const techBonusPercent = totalTechBonusRate * 100;
|
|
11473
|
+
const [record] = await ctx.database.get("ggcevo_explore", { handle });
|
|
11474
|
+
const now = /* @__PURE__ */ new Date();
|
|
11475
|
+
if (record && record.status === "探索中") {
|
|
11476
|
+
const duration = Math.floor((now.getTime() - record.startTime.getTime()) / 1e3 / 60);
|
|
11477
|
+
const remainingMinutes = 12 * 60 - duration;
|
|
11478
|
+
if (remainingMinutes > 0) {
|
|
11479
|
+
return [
|
|
11480
|
+
"🪐 正在进行探索任务",
|
|
11481
|
+
`🌌 星系:${record.galaxy}`,
|
|
11482
|
+
`⏱️ 开始时间:${record.startTime.toLocaleString("zh-CN", { hour12: false })}`,
|
|
11483
|
+
`⏳ 剩余时间:${Math.floor(remainingMinutes / 60)}小时${remainingMinutes % 60}分钟`,
|
|
11484
|
+
"💡 提示:探索将持续12小时,完成后可再次进行探索"
|
|
11485
|
+
].join("\n");
|
|
11486
|
+
} else {
|
|
11487
|
+
const returnsIncrement = (record.returns || 0) + 1;
|
|
11488
|
+
const galaxyData2 = galaxy[record.galaxy];
|
|
11489
|
+
let successRate = galaxyData2.success;
|
|
11490
|
+
if (career.group === "人类联盟" && record.galaxy === "联盟星系") {
|
|
11491
|
+
successRate += 0.1;
|
|
11492
|
+
} else if (career.group === "辛迪加海盗" && record.galaxy === "辛迪加星系") {
|
|
11493
|
+
successRate += 0.1;
|
|
11494
|
+
}
|
|
11495
|
+
successRate += shipBonus / 100;
|
|
11496
|
+
successRate = Math.min(successRate, 1);
|
|
11497
|
+
const isSuccess = Math.random() < successRate;
|
|
11498
|
+
let baseCoinReward = Math.floor(Math.random() * 101) + 100;
|
|
11499
|
+
const baseCoinBeforeBonus = baseCoinReward;
|
|
11500
|
+
baseCoinReward = Math.floor(baseCoinReward * galaxyData2.bonus);
|
|
11501
|
+
const bonusPercent2 = Math.round((galaxyData2.bonus - 1) * 100);
|
|
11502
|
+
let totalBonus = 0;
|
|
11503
|
+
const bonusEffects = [];
|
|
11504
|
+
if (galaxyData2.bonus > 1) {
|
|
11505
|
+
bonusEffects.push(`星系金币加成:+${bonusPercent2}%`);
|
|
11506
|
+
}
|
|
11507
|
+
if (shipBonus !== 0) {
|
|
11508
|
+
totalBonus += shipBonus;
|
|
11509
|
+
bonusEffects.push(`飞船:+${shipBonus}%`);
|
|
11510
|
+
}
|
|
11511
|
+
if (record.plunderbonus) {
|
|
11512
|
+
totalBonus += record.plunderbonus;
|
|
11513
|
+
bonusEffects.push(`掠夺事件:${record.plunderbonus > 0 ? "+" : ""}${record.plunderbonus}%`);
|
|
11514
|
+
}
|
|
11515
|
+
totalBonus += techBonusPercent;
|
|
11516
|
+
if (totalTechBonusRate > 0) {
|
|
11517
|
+
const careerDesc = careerBonusRate > 0 ? ` (${careerName})` : "";
|
|
11518
|
+
bonusEffects.push(`⚙️ 反应堆科技Lv.${techLevel}:+${techBonusPercent.toFixed(0)}%${careerDesc}`);
|
|
11519
|
+
}
|
|
11520
|
+
if (careerCoinBonus > 0) {
|
|
11521
|
+
totalBonus += careerCoinBonus;
|
|
11522
|
+
bonusEffects.push(`🧑🚀 ${careerName}职业:+${careerCoinBonus}%`);
|
|
11523
|
+
}
|
|
11524
|
+
let finalCoin = baseCoinReward * (1 + totalBonus / 100);
|
|
11525
|
+
if (!isSuccess) {
|
|
11526
|
+
finalCoin *= 0.5;
|
|
11527
|
+
bonusEffects.push("探索失败:-50%");
|
|
11528
|
+
}
|
|
11529
|
+
finalCoin = Math.floor(finalCoin);
|
|
11530
|
+
const [signRecord] = await ctx.database.get("ggcevo_sign", { handle });
|
|
11531
|
+
let newTotalRewards = finalCoin;
|
|
11532
|
+
if (signRecord) {
|
|
11533
|
+
newTotalRewards = signRecord.totalRewards + finalCoin;
|
|
11534
|
+
await ctx.database.set("ggcevo_sign", { handle }, {
|
|
11535
|
+
totalRewards: newTotalRewards
|
|
11536
|
+
});
|
|
11537
|
+
} else {
|
|
11538
|
+
await ctx.database.create("ggcevo_sign", {
|
|
11539
|
+
handle,
|
|
11540
|
+
lastSign: null,
|
|
11541
|
+
monthlyDays: 0,
|
|
11542
|
+
totalRewards: finalCoin
|
|
11543
|
+
});
|
|
11544
|
+
}
|
|
11545
|
+
let itemRewards = [];
|
|
11546
|
+
if (isSuccess) {
|
|
11547
|
+
const itemsToCheck = [
|
|
11548
|
+
{ id: 2, name: "闪光弹" },
|
|
11549
|
+
{ id: 4, name: "脉冲手雷" }
|
|
11550
|
+
];
|
|
11551
|
+
for (const item of itemsToCheck) {
|
|
11552
|
+
if (Math.random() < 0.05) {
|
|
11553
|
+
const [existing] = await ctx.database.get("ggcevo_warehouse", {
|
|
11554
|
+
handle,
|
|
11555
|
+
itemId: item.id
|
|
11556
|
+
});
|
|
11557
|
+
if (existing) {
|
|
11558
|
+
await ctx.database.set("ggcevo_warehouse", {
|
|
11559
|
+
handle,
|
|
11560
|
+
itemId: item.id
|
|
11561
|
+
}, {
|
|
11562
|
+
quantity: existing.quantity + 1
|
|
11563
|
+
});
|
|
11564
|
+
} else {
|
|
11565
|
+
await ctx.database.create("ggcevo_warehouse", {
|
|
11566
|
+
handle,
|
|
11567
|
+
itemId: item.id,
|
|
11568
|
+
quantity: 1,
|
|
11569
|
+
bonus: 0
|
|
11570
|
+
});
|
|
11571
|
+
}
|
|
11572
|
+
itemRewards.push(item.name);
|
|
11573
|
+
}
|
|
11574
|
+
}
|
|
11575
|
+
}
|
|
11576
|
+
await ctx.database.set("ggcevo_explore", { handle }, {
|
|
11577
|
+
status: "空闲",
|
|
11578
|
+
startTime: null,
|
|
11579
|
+
galaxy: null,
|
|
11580
|
+
returns: returnsIncrement,
|
|
11581
|
+
plunderbonus: 0
|
|
11582
|
+
// 重置加成
|
|
11583
|
+
});
|
|
11584
|
+
let resultMessage = isSuccess ? "🎉 探索成功!" : "⚠️ 探索失败!";
|
|
11585
|
+
let coinDisplay = `💰金币 +${finalCoin}`;
|
|
11586
|
+
if (totalBonus !== 0 || !isSuccess) {
|
|
11587
|
+
let baseInfo = `基础 ${baseCoinBeforeBonus}`;
|
|
11588
|
+
if (galaxyData2.bonus > 1) {
|
|
11589
|
+
baseInfo += ` → ${baseCoinReward}(+${bonusPercent2}%)`;
|
|
11590
|
+
}
|
|
11591
|
+
coinDisplay += ` (${baseInfo})`;
|
|
11592
|
+
}
|
|
11593
|
+
let rewardMessage = coinDisplay;
|
|
11594
|
+
if (itemRewards.length > 0) {
|
|
11595
|
+
rewardMessage += `
|
|
11596
|
+
📦 获得:${itemRewards.join("、")}`;
|
|
11597
|
+
}
|
|
11598
|
+
if (bonusEffects.length > 0) {
|
|
11599
|
+
rewardMessage += `
|
|
11600
|
+
⚡ 加成效果:${bonusEffects.join(",")}`;
|
|
11601
|
+
}
|
|
11602
|
+
return [
|
|
11603
|
+
resultMessage,
|
|
11604
|
+
`🌌 星系:${record.galaxy}`,
|
|
11605
|
+
`🔮 实际成功率:${(successRate * 100).toFixed(1)}%`,
|
|
11606
|
+
`🏆 已探索次数:${returnsIncrement}`,
|
|
11607
|
+
"--------------------------------",
|
|
11608
|
+
rewardMessage,
|
|
11609
|
+
"💡 已自动结束探索任务"
|
|
11610
|
+
].join("\n");
|
|
11611
|
+
}
|
|
11612
|
+
}
|
|
11613
|
+
if (!galaxyName) {
|
|
11614
|
+
const exploreOptions = [];
|
|
11615
|
+
for (const [name3, info] of Object.entries(galaxy)) {
|
|
11616
|
+
const bonusPercent2 = Math.round((info.bonus - 1) * 100);
|
|
11617
|
+
exploreOptions.push([
|
|
11618
|
+
`【${name3}】`,
|
|
11619
|
+
`- 成功率:${(info.success * 100).toFixed(0)}%`,
|
|
11620
|
+
`- 金币加成:${bonusPercent2 > 0 ? "+" : ""}${bonusPercent2}%`,
|
|
11621
|
+
`- 可获得:${info.available}`,
|
|
11622
|
+
`- 特殊效果:${info.effect}`
|
|
11623
|
+
].join("\n"));
|
|
11624
|
+
}
|
|
11625
|
+
return [
|
|
11626
|
+
"🌌 可探索的星系:",
|
|
11627
|
+
...exploreOptions.map((opt) => `▸ ${opt}`),
|
|
11628
|
+
"\n使用格式:探索 [星系名称]",
|
|
11629
|
+
"示例:探索 联盟星系"
|
|
11630
|
+
].join("\n");
|
|
11631
|
+
}
|
|
11632
|
+
if (!galaxy[galaxyName]) {
|
|
11633
|
+
return `❌ 未知的星系:"${galaxyName}"`;
|
|
11634
|
+
}
|
|
11635
|
+
const basePlunderRate = 0.2;
|
|
11636
|
+
const actualPlunderRate = basePlunderRate + plunderRateBonus / 100;
|
|
11637
|
+
const canPlunder = Math.random() < actualPlunderRate;
|
|
11638
|
+
if (canPlunder) {
|
|
11639
|
+
const otherPlayers = await ctx.database.get("ggcevo_explore", {
|
|
11640
|
+
galaxy: galaxyName,
|
|
11641
|
+
status: "探索中",
|
|
11642
|
+
handle: { $ne: handle },
|
|
11643
|
+
// 排除自己
|
|
11644
|
+
plunderbonus: { $gte: 0 }
|
|
11645
|
+
// 只选择plunderbonus>=0的玩家
|
|
11646
|
+
});
|
|
11647
|
+
if (otherPlayers.length > 0) {
|
|
11648
|
+
const target = otherPlayers[Math.floor(Math.random() * otherPlayers.length)];
|
|
11649
|
+
await session.send(`❗ 您在探索过程中发现了【${target.name}】的飞船,是否掠夺?(30秒内输入"是"来进行掠夺)`);
|
|
11650
|
+
const response = await session.prompt(3e4);
|
|
11651
|
+
if (response === "是") {
|
|
11652
|
+
const success = Math.random() < 0.2;
|
|
11653
|
+
let playerBonus, targetBonus;
|
|
11654
|
+
if (success) {
|
|
11655
|
+
let baseReward = 20;
|
|
11656
|
+
if (plunderBonusEffect > 0) {
|
|
11657
|
+
baseReward *= 1 + plunderBonusEffect / 100;
|
|
11658
|
+
}
|
|
11659
|
+
playerBonus = Math.round(baseReward);
|
|
11660
|
+
targetBonus = -20;
|
|
11661
|
+
} else {
|
|
11662
|
+
playerBonus = -20;
|
|
11663
|
+
targetBonus = 20;
|
|
11664
|
+
}
|
|
11665
|
+
await ctx.database.upsert("ggcevo_explore", [{
|
|
11666
|
+
handle,
|
|
11667
|
+
name: name2,
|
|
11668
|
+
startTime: /* @__PURE__ */ new Date(),
|
|
11669
|
+
galaxy: galaxyName,
|
|
11670
|
+
returns: record?.returns || 0,
|
|
11671
|
+
plunderbonus: playerBonus,
|
|
11672
|
+
status: "探索中"
|
|
11673
|
+
}], ["handle"]);
|
|
11674
|
+
await ctx.database.set("ggcevo_explore", { handle: target.handle }, {
|
|
11675
|
+
plunderbonus: targetBonus
|
|
11676
|
+
});
|
|
11677
|
+
return success ? `✅ 掠夺成功!您获得${playerBonus}%金币加成(基础20%${plunderBonusEffect > 0 ? `+飞船加成${plunderBonusEffect}%` : ""})` : `❌ 掠夺失败!您的金币收益被降低了20%。${target.name}获得了20%的金币收益加成。`;
|
|
11678
|
+
}
|
|
11679
|
+
}
|
|
11680
|
+
}
|
|
11681
|
+
await ctx.database.upsert("ggcevo_explore", [{
|
|
11682
|
+
handle,
|
|
11683
|
+
name: name2,
|
|
11684
|
+
startTime: /* @__PURE__ */ new Date(),
|
|
11685
|
+
galaxy: galaxyName,
|
|
11686
|
+
returns: record?.returns || 0,
|
|
11687
|
+
plunderbonus: 0,
|
|
11688
|
+
status: "探索中"
|
|
11689
|
+
}], ["handle"]);
|
|
11690
|
+
const galaxyData = galaxy[galaxyName];
|
|
11691
|
+
let bonusInfo = [];
|
|
11692
|
+
const bonusPercent = Math.round((galaxyData.bonus - 1) * 100);
|
|
11693
|
+
if (bonusPercent > 0) {
|
|
11694
|
+
bonusInfo.push(`💰 星系金币加成:+${bonusPercent}%`);
|
|
11695
|
+
}
|
|
11696
|
+
if (career.group === "人类联盟" && galaxyName === "联盟星系") {
|
|
11697
|
+
bonusInfo.push("人类联盟阵营:成功率+10%");
|
|
11698
|
+
} else if (career.group === "辛迪加海盗" && galaxyName === "辛迪加星系") {
|
|
11699
|
+
bonusInfo.push("辛迪加海盗阵营:成功率+10%");
|
|
11700
|
+
}
|
|
11701
|
+
if (shipBonus > 0) {
|
|
11702
|
+
bonusInfo.push(`飞船加成:成功率+${shipBonus}%`);
|
|
11703
|
+
}
|
|
11704
|
+
if (shipEffect) {
|
|
11705
|
+
bonusInfo.push(`飞船效果:${shipEffect}`);
|
|
11706
|
+
}
|
|
11707
|
+
if (plunderRateBonus > 0) {
|
|
11708
|
+
bonusInfo.push(`🗡️ 掠夺概率提升:+${plunderRateBonus}%`);
|
|
11709
|
+
}
|
|
11710
|
+
if (plunderBonusEffect > 0) {
|
|
11711
|
+
bonusInfo.push(`💰 掠夺收益加成:+${plunderBonusEffect}%`);
|
|
11712
|
+
}
|
|
11713
|
+
if (totalTechBonusRate > 0) {
|
|
11714
|
+
const careerDesc = careerBonusRate > 0 ? ` (${careerName})` : "";
|
|
11715
|
+
bonusInfo.push(`⚙️ 反应堆科技Lv.${techLevel}:金币收益+${techBonusPercent.toFixed(0)}%${careerDesc}`);
|
|
11716
|
+
}
|
|
11717
|
+
if (careerCoinBonus > 0) {
|
|
11718
|
+
bonusInfo.push(`🧑🚀 ${careerName}职业:金币收益提高${careerCoinBonus}%`);
|
|
11719
|
+
}
|
|
11720
|
+
let estimatedRate = galaxyData.success;
|
|
11721
|
+
if (career.group === "人类联盟" && galaxyName === "联盟星系") estimatedRate += 0.1;
|
|
11722
|
+
if (career.group === "辛迪加海盗" && galaxyName === "辛迪加星系") estimatedRate += 0.1;
|
|
11723
|
+
estimatedRate += shipBonus / 100;
|
|
11724
|
+
estimatedRate = Math.min(estimatedRate, 1) * 100;
|
|
11725
|
+
return [
|
|
11726
|
+
`🚀 开始探索 ${galaxyName}`,
|
|
11727
|
+
`⏱️ 开始时间:${(/* @__PURE__ */ new Date()).toLocaleString("zh-CN", { hour12: false })}`,
|
|
11728
|
+
`⏳ 持续时间:12小时`,
|
|
11729
|
+
`📊 预计成功率:${estimatedRate.toFixed(0)}%`,
|
|
11730
|
+
// 显示所有加成信息
|
|
11731
|
+
...bonusInfo.length ? bonusInfo.map((info) => `⭐ ${info}`) : ["⭐ 无加成效果"],
|
|
11732
|
+
`🏆 可获得:${galaxyData.available}`,
|
|
11733
|
+
`✨ 星系效果:${galaxyData.effect}`,
|
|
11734
|
+
"💡 探索完成后将获得奖励,可持续进行探索任务"
|
|
11735
|
+
].join("\n");
|
|
11736
|
+
});
|
|
11737
|
+
const shipIdToName = {};
|
|
11738
|
+
for (const [name2, data] of Object.entries(spaceship)) {
|
|
11739
|
+
shipIdToName[data.id] = name2;
|
|
11740
|
+
}
|
|
11741
|
+
ctx.command("飞船").action(async ({ session }) => {
|
|
11742
|
+
const shipList = Object.keys(spaceship).map((name2) => {
|
|
11743
|
+
const ship = spaceship[name2];
|
|
11744
|
+
return [
|
|
11745
|
+
`【${name2}】`,
|
|
11746
|
+
`- 价格: ${ship.price}金币`,
|
|
11747
|
+
`- 探索加成: +${ship.explorebonus}%成功率`,
|
|
11748
|
+
`- 采矿加成: +${ship.miningbonus}%效率`,
|
|
11749
|
+
`- 特殊效果: ${ship.effect || "无"}`
|
|
11750
|
+
].join("\n");
|
|
11751
|
+
});
|
|
11752
|
+
return [
|
|
11753
|
+
"🚀 可购买的飞船列表:",
|
|
11754
|
+
...shipList.map((ship) => `▸ ${ship}`),
|
|
11755
|
+
"\n🛒 购买指令:购买飞船 [飞船名称]",
|
|
11756
|
+
"例如:购买飞船 TX-12S隐形巡洋舰",
|
|
11757
|
+
"\n📡 查询您当前的飞船:飞船信息",
|
|
11758
|
+
'\n💡 提示:购买飞船后使用"飞船信息"查看您的飞船'
|
|
11759
|
+
].join("\n");
|
|
11760
|
+
});
|
|
11761
|
+
ctx.command("ggcevo/飞船信息").action(async ({ session }) => {
|
|
11762
|
+
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
11763
|
+
if (!profile) return "🔒 需要先绑定游戏句柄。";
|
|
11764
|
+
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
11765
|
+
const [shipRecord] = await ctx.database.get("ggcevo_spaceship", { handle });
|
|
11766
|
+
const [signRecord] = await ctx.database.get("ggcevo_sign", { handle });
|
|
11767
|
+
const coins = signRecord?.totalRewards || 0;
|
|
11768
|
+
if (!shipRecord) {
|
|
11769
|
+
return [
|
|
11770
|
+
"🚀 您目前没有拥有任何飞船",
|
|
11771
|
+
`💰 当前金币余额:${coins}`,
|
|
11772
|
+
"购买飞船指令:购买飞船 [飞船名称]",
|
|
11773
|
+
"可购买飞船列表:" + Object.keys(spaceship).join(", ")
|
|
11774
|
+
].join("\n");
|
|
11775
|
+
}
|
|
11776
|
+
const shipName = shipIdToName[shipRecord.id];
|
|
11777
|
+
if (!shipName) return "⚠️ 飞船配置数据异常,请联系管理员";
|
|
11778
|
+
const ship = spaceship[shipName];
|
|
11779
|
+
return [
|
|
11780
|
+
`🚀 飞船名称:${shipName}`,
|
|
11781
|
+
`📝 描述:${ship.description}`,
|
|
11782
|
+
`🔭 探索加成:+${ship.explorebonus}%成功率`,
|
|
11783
|
+
`⛏️ 采矿加成:+${ship.miningbonus}%效率`,
|
|
11784
|
+
`💡 特殊效果:${ship.effect || "无"}`,
|
|
11785
|
+
`🛒 购买价格:${ship.price}金币`,
|
|
11786
|
+
`📅 获得时间:${shipRecord.createTime.toLocaleString("zh-CN", { hour12: false })}`,
|
|
11787
|
+
`🔋 状态:${shipRecord.status}`,
|
|
11788
|
+
`💰 当前金币余额:${coins}`
|
|
11789
|
+
].join("\n");
|
|
11790
|
+
});
|
|
11791
|
+
ctx.command("ggcevo/购买飞船 [shipName]").action(async ({ session }, shipName) => {
|
|
11792
|
+
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
11793
|
+
if (!profile) return "🔒 需要先绑定游戏句柄。";
|
|
11794
|
+
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
11795
|
+
const name2 = session.userId;
|
|
11796
|
+
const [signRecord] = await ctx.database.get("ggcevo_sign", { handle });
|
|
11797
|
+
if (!signRecord) return "⛔ 请先进行至少一次签到获得金币后购买飞船";
|
|
11798
|
+
const coins = signRecord.totalRewards;
|
|
11799
|
+
if (!shipName) {
|
|
11800
|
+
const shipList = Object.keys(spaceship).map((name3) => {
|
|
11801
|
+
const ship2 = spaceship[name3];
|
|
11802
|
+
return [
|
|
11803
|
+
`【${name3}】`,
|
|
11804
|
+
`- 价格: ${ship2.price}金币`,
|
|
11805
|
+
`- 探索加成: ${ship2.explorebonus}%`,
|
|
11806
|
+
`- 采矿加成: ${ship2.miningbonus}%`,
|
|
11807
|
+
`- 效果: ${ship2.effect || "无"}`
|
|
11808
|
+
].join("\n");
|
|
11809
|
+
});
|
|
11810
|
+
return [
|
|
11811
|
+
"🚀 可购买的飞船:",
|
|
11812
|
+
...shipList.map((ship2) => `▸ ${ship2}`),
|
|
11813
|
+
"\n使用格式:购买飞船 [飞船名称]",
|
|
11814
|
+
"示例:购买飞船 TX-12S隐形巡洋舰",
|
|
11815
|
+
`💡 当前金币余额:${coins}`
|
|
11816
|
+
].join("\n");
|
|
11817
|
+
}
|
|
11818
|
+
const ship = spaceship[shipName];
|
|
11819
|
+
if (!ship) return `❌ 未知飞船:"${shipName}"`;
|
|
11820
|
+
if (coins < ship.price) {
|
|
11821
|
+
return `❌ 金币不足!购买需要${ship.price}金币,当前余额${coins}金币`;
|
|
11822
|
+
}
|
|
11823
|
+
const [existingShip] = await ctx.database.get("ggcevo_spaceship", { handle });
|
|
11824
|
+
const now = /* @__PURE__ */ new Date();
|
|
11825
|
+
if (existingShip) {
|
|
11826
|
+
const existingShipName = shipIdToName[existingShip.id] || "未知飞船";
|
|
11827
|
+
await session.send(
|
|
11828
|
+
`⚠️ 您已拥有飞船【${existingShipName}】,是否替换为【${shipName}】?
|
|
11829
|
+
✔️ 更换需支付 ${ship.price}金币(原飞船无退款)
|
|
11830
|
+
请在30秒内输入"是"确认更换,或输入其他内容取消。`
|
|
11831
|
+
);
|
|
11832
|
+
const confirm = await session.prompt(3e4);
|
|
11833
|
+
if (confirm !== "是") return "🚫 已取消购买";
|
|
11834
|
+
await ctx.database.set("ggcevo_spaceship", { handle }, {
|
|
11835
|
+
id: ship.id,
|
|
11836
|
+
createTime: now
|
|
11837
|
+
});
|
|
11838
|
+
} else {
|
|
11839
|
+
await ctx.database.create("ggcevo_spaceship", {
|
|
11840
|
+
handle,
|
|
11841
|
+
id: ship.id,
|
|
11842
|
+
status: "空闲",
|
|
11843
|
+
// 设置初始状态
|
|
11844
|
+
createTime: now
|
|
11845
|
+
});
|
|
11846
|
+
}
|
|
11847
|
+
const newCoins = coins - ship.price;
|
|
11848
|
+
await ctx.database.set("ggcevo_sign", { handle }, {
|
|
11849
|
+
totalRewards: newCoins
|
|
11850
|
+
});
|
|
11851
|
+
return [
|
|
11852
|
+
`🎉 成功购买 ${shipName}!`,
|
|
11853
|
+
`🔭 探索加成:+${ship.explorebonus}%成功率`,
|
|
11854
|
+
`⛏️ 采矿加成:+${ship.miningbonus}%效率`,
|
|
11855
|
+
`💡 特殊效果:${ship.effect || "无"}`,
|
|
11856
|
+
`📅 购买时间:${now.toLocaleString("zh-CN", { hour12: false })}`,
|
|
11857
|
+
`💰 剩余金币:${newCoins}`,
|
|
11858
|
+
existingShip ? `🔁 已替换原有飞船` : "🚀 祝你星系探险愉快!",
|
|
11859
|
+
'\n📡 使用"飞船信息"查看您的飞船详情'
|
|
11860
|
+
// 新增的提示
|
|
11861
|
+
].join("\n");
|
|
11862
|
+
});
|
|
11863
|
+
ctx.command("ggcevo/升级物品 [itemName]", "升级辛迪加海盗物品").userFields(["id"]).action(async ({ session }, itemName) => {
|
|
11864
|
+
const handle = session.userId;
|
|
11865
|
+
if (!itemName) return "请输入要升级的物品名称,例如:升级物品 自动采掘机器人";
|
|
11866
|
+
const careers = await ctx.database.get("ggcevo_careers", { handle });
|
|
11867
|
+
if (!careers || careers.length === 0) return "🚫 未查询到您的阵营信息";
|
|
11868
|
+
const career = careers[0];
|
|
11869
|
+
if (career.group !== "辛迪加海盗") {
|
|
11870
|
+
return `🚫 仅限辛迪加海盗阵营使用,您当前是${career.group}`;
|
|
11871
|
+
}
|
|
11872
|
+
const itemConfig2 = SyndicatedItems[itemName];
|
|
11873
|
+
if (!itemConfig2) return `🚫 未找到物品【${itemName}】的配置信息`;
|
|
11874
|
+
const upgradeConfig = itemupgrades.find((cfg) => cfg.name === itemName);
|
|
11875
|
+
if (!upgradeConfig) return `🚫 物品【${itemName}】缺少升级配置`;
|
|
11876
|
+
const warehouseItems = await ctx.database.get("ggcevo_warehouse", {
|
|
11877
|
+
handle,
|
|
11878
|
+
itemId: itemConfig2.id
|
|
11879
|
+
});
|
|
11880
|
+
if (!warehouseItems || warehouseItems.length === 0) {
|
|
11881
|
+
return `🚫 您的仓库中没有【${itemName}】`;
|
|
11882
|
+
}
|
|
11883
|
+
const warehouseItem = warehouseItems[0];
|
|
11884
|
+
if (warehouseItem.bonus >= upgradeConfig.maxBonus) {
|
|
11885
|
+
return `🚫 【${itemName}】已达到最大升级上限(${upgradeConfig.maxBonus}%)`;
|
|
11886
|
+
}
|
|
11887
|
+
let upgradeCost = upgradeConfig.upgradeCostBase;
|
|
11888
|
+
let discountNotice = "";
|
|
11889
|
+
if (career.career === "指挥官") {
|
|
11890
|
+
upgradeCost = Math.floor(upgradeCost * 0.5);
|
|
11891
|
+
discountNotice = `
|
|
11892
|
+
✨ 指挥官职业生效!实际消耗: ${upgradeCost} (原价${upgradeConfig.upgradeCostBase}的50%)`;
|
|
11893
|
+
}
|
|
11894
|
+
if (career.redcrystal < upgradeCost) {
|
|
11895
|
+
return `🚫 红晶不足!升级需要${upgradeCost}红晶,您当前有${career.redcrystal}红晶`;
|
|
11896
|
+
}
|
|
11897
|
+
const upgradeValue = Math.floor(
|
|
11898
|
+
Math.random() * (upgradeConfig.maxUpgrade - upgradeConfig.minUpgrade + 1)
|
|
11899
|
+
) + upgradeConfig.minUpgrade;
|
|
11900
|
+
const actualUpgrade = Math.min(
|
|
11901
|
+
upgradeValue,
|
|
11902
|
+
upgradeConfig.maxBonus - warehouseItem.bonus
|
|
11903
|
+
);
|
|
11904
|
+
const newRedCrystal = career.redcrystal - upgradeCost;
|
|
11905
|
+
await ctx.database.upsert("ggcevo_careers", [{
|
|
11906
|
+
handle,
|
|
11907
|
+
redcrystal: newRedCrystal
|
|
11908
|
+
}], ["handle"]);
|
|
11909
|
+
await ctx.database.upsert("ggcevo_warehouse", [{
|
|
11910
|
+
handle,
|
|
11911
|
+
itemId: itemConfig2.id,
|
|
11912
|
+
bonus: warehouseItem.bonus + actualUpgrade
|
|
11913
|
+
}], ["handle", "itemId"]);
|
|
11914
|
+
const totalBonus = warehouseItem.bonus + actualUpgrade;
|
|
11915
|
+
return `✅ 【${itemName}】升级成功!${discountNotice}
|
|
11916
|
+
- 消耗红晶: ${upgradeCost}
|
|
11917
|
+
- 本次提升: ${actualUpgrade}%
|
|
11918
|
+
- 当前加成: ${totalBonus}%
|
|
11919
|
+
- 剩余红晶: ${newRedCrystal}`;
|
|
11920
|
+
});
|
|
11243
11921
|
}
|
|
11244
11922
|
__name(apply, "apply");
|
|
11245
11923
|
// Annotate the CommonJS export names for ESM import in node:
|
package/lib/items.d.ts
CHANGED
|
@@ -62,6 +62,15 @@ export declare const SyndicatedItems: {
|
|
|
62
62
|
condition: string;
|
|
63
63
|
effects: string;
|
|
64
64
|
};
|
|
65
|
+
自动采掘机器人: {
|
|
66
|
+
id: number;
|
|
67
|
+
type: string;
|
|
68
|
+
description: string;
|
|
69
|
+
price: number;
|
|
70
|
+
redCrystalCost: number;
|
|
71
|
+
condition: string;
|
|
72
|
+
effects: string;
|
|
73
|
+
};
|
|
65
74
|
};
|
|
66
75
|
export declare const initDefaultItems: {
|
|
67
76
|
咕咕币: {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare const spaceship: {
|
|
2
|
+
'TX-12\u661F\u9645\u5DE1\u6D0B\u8230': {
|
|
3
|
+
id: number;
|
|
4
|
+
description: string;
|
|
5
|
+
miningbonus: number;
|
|
6
|
+
explorebonus: number;
|
|
7
|
+
effect: string;
|
|
8
|
+
price: number;
|
|
9
|
+
};
|
|
10
|
+
'TX-12S\u9690\u5F62\u5DE1\u6D0B\u8230': {
|
|
11
|
+
id: number;
|
|
12
|
+
description: string;
|
|
13
|
+
miningbonus: number;
|
|
14
|
+
explorebonus: number;
|
|
15
|
+
effect: string;
|
|
16
|
+
price: number;
|
|
17
|
+
};
|
|
18
|
+
'TX-12A\u7A81\u51FB\u5DE1\u6D0B\u8230': {
|
|
19
|
+
id: number;
|
|
20
|
+
description: string;
|
|
21
|
+
miningbonus: number;
|
|
22
|
+
explorebonus: number;
|
|
23
|
+
effect: string;
|
|
24
|
+
price: number;
|
|
25
|
+
};
|
|
26
|
+
庞兽号歼星舰: {
|
|
27
|
+
id: number;
|
|
28
|
+
description: string;
|
|
29
|
+
miningbonus: number;
|
|
30
|
+
explorebonus: number;
|
|
31
|
+
effect: string;
|
|
32
|
+
price: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare const galaxy: {
|
|
36
|
+
联盟星系: {
|
|
37
|
+
description: string;
|
|
38
|
+
success: number;
|
|
39
|
+
bonus: number;
|
|
40
|
+
available: string;
|
|
41
|
+
effect: string;
|
|
42
|
+
};
|
|
43
|
+
辛迪加星系: {
|
|
44
|
+
description: string;
|
|
45
|
+
success: number;
|
|
46
|
+
bonus: number;
|
|
47
|
+
available: string;
|
|
48
|
+
effect: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
package/lib/wish.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const wishConfig: {
|
|
|
7
7
|
readonly effect: "下一次升级武器享有20%的折扣";
|
|
8
8
|
}, {
|
|
9
9
|
readonly name: "王权增幅";
|
|
10
|
-
readonly effect: "
|
|
10
|
+
readonly effect: "攻击伤害提高5%";
|
|
11
11
|
}, {
|
|
12
12
|
readonly name: "金柚赐福";
|
|
13
13
|
readonly effect: "立即获得250枚金币";
|
|
@@ -17,7 +17,7 @@ export declare const wishConfig: {
|
|
|
17
17
|
}];
|
|
18
18
|
readonly rare: readonly [{
|
|
19
19
|
readonly name: "悲鸣之锋";
|
|
20
|
-
readonly effect: "
|
|
20
|
+
readonly effect: "攻击伤害提高10%,武器每等级提高5%伤害";
|
|
21
21
|
}, {
|
|
22
22
|
readonly name: "精灵双倍";
|
|
23
23
|
readonly effect: "下一次击败主宰时可获得双倍的金币和咕咕币奖励";
|
|
@@ -26,7 +26,7 @@ export declare const wishConfig: {
|
|
|
26
26
|
readonly effect: "签到获得双倍的金币和咕咕币";
|
|
27
27
|
}, {
|
|
28
28
|
readonly name: "暴击韵律";
|
|
29
|
-
readonly effect: "
|
|
29
|
+
readonly effect: "攻击暴击率提高20%";
|
|
30
30
|
}, {
|
|
31
31
|
readonly name: "酥手空空";
|
|
32
32
|
readonly effect: "立即失去50枚金币";
|