koishi-plugin-ggcevo-game 1.4.39 → 1.4.41
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/boss/BattleEffectProcessor.d.ts +3 -4
- package/lib/database.d.ts +43 -43
- package/lib/index.js +98 -76
- package/lib/utils.d.ts +1 -1
- package/package.json +2 -2
|
@@ -80,14 +80,14 @@ export declare const BattleEffectProcessor: {
|
|
|
80
80
|
nerfMultiplier: number;
|
|
81
81
|
messages: string[];
|
|
82
82
|
};
|
|
83
|
-
handleSurvivalInstinctI: (targetBoss: any) => {
|
|
83
|
+
handleSurvivalInstinctI: (targetBoss: any, damageAmount: number) => {
|
|
84
84
|
messages: string[];
|
|
85
85
|
targetUpdates: {
|
|
86
86
|
name: string;
|
|
87
87
|
updates: Partial<BattleStatistics>;
|
|
88
88
|
} | null;
|
|
89
89
|
} | null;
|
|
90
|
-
handleSurvivalInstinctII: (targetBoss: any) => {
|
|
90
|
+
handleSurvivalInstinctII: (targetBoss: any, damageAmount: number) => {
|
|
91
91
|
messages: string[];
|
|
92
92
|
targetUpdates: {
|
|
93
93
|
name: string;
|
|
@@ -301,8 +301,7 @@ export declare const BattleEffectProcessor: {
|
|
|
301
301
|
updates: Partial<BattleStatistics>;
|
|
302
302
|
} | null;
|
|
303
303
|
} | null;
|
|
304
|
-
|
|
305
|
-
handleRevival: (targetBoss: any) => {
|
|
304
|
+
handleRevival: (targetBoss: any, damageAmount: number) => {
|
|
306
305
|
messages: string[];
|
|
307
306
|
targetUpdates: {
|
|
308
307
|
name: string;
|
package/lib/database.d.ts
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
declare module 'koishi' {
|
|
2
2
|
interface Tables {
|
|
3
|
-
ggcevo_backpack:
|
|
4
|
-
ggcevo_sign:
|
|
5
|
-
ggcevo_records:
|
|
6
|
-
ggcevo_welfare:
|
|
7
|
-
ggcevo_activity:
|
|
8
|
-
ggcevo_rank:
|
|
9
|
-
|
|
10
|
-
ggcevo_exchange:
|
|
11
|
-
ggcevo_adminbenefit:
|
|
12
|
-
ggcevo_blacklist:
|
|
13
|
-
ggcevo_pk:
|
|
14
|
-
ggcevo_pk_logs:
|
|
15
|
-
|
|
16
|
-
ggcevo_boss:
|
|
17
|
-
ggcevo_boss_damage:
|
|
18
|
-
|
|
19
|
-
ggcevo_careers:
|
|
20
|
-
ggcevo_warehouse:
|
|
21
|
-
ggcevo_tech:
|
|
22
|
-
ggcevo_Mining:
|
|
23
|
-
ggcevo_task:
|
|
24
|
-
|
|
3
|
+
ggcevo_backpack: Backpack;
|
|
4
|
+
ggcevo_sign: SignRecord;
|
|
5
|
+
ggcevo_records: GachaRecord;
|
|
6
|
+
ggcevo_welfare: WelfareClaim;
|
|
7
|
+
ggcevo_activity: ActivityInfo;
|
|
8
|
+
ggcevo_rank: RankRecord;
|
|
9
|
+
ggcevo_punishment: PunishmentRecord;
|
|
10
|
+
ggcevo_exchange: ExchangeLog;
|
|
11
|
+
ggcevo_adminbenefit: AdminBenefit;
|
|
12
|
+
ggcevo_blacklist: Blacklist;
|
|
13
|
+
ggcevo_pk: PKProfile;
|
|
14
|
+
ggcevo_pk_logs: PKLogs;
|
|
15
|
+
ggcevo_weapons: WeaponInventory;
|
|
16
|
+
ggcevo_boss: BossInfo;
|
|
17
|
+
ggcevo_boss_damage: BossDamage;
|
|
18
|
+
ggcevo_wish: WishRecord;
|
|
19
|
+
ggcevo_careers: CareerInfo;
|
|
20
|
+
ggcevo_warehouse: Warehouse;
|
|
21
|
+
ggcevo_tech: TechProgress;
|
|
22
|
+
ggcevo_Mining: MiningRecord;
|
|
23
|
+
ggcevo_task: TaskProgress;
|
|
24
|
+
ggcevo_permissions: Permissions;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
export interface
|
|
27
|
+
export interface Backpack {
|
|
28
28
|
handle: string;
|
|
29
29
|
itemId: number;
|
|
30
30
|
quantity: number;
|
|
31
31
|
}
|
|
32
|
-
export interface
|
|
32
|
+
export interface SignRecord {
|
|
33
33
|
handle: string;
|
|
34
34
|
lastSign: Date;
|
|
35
35
|
monthlyDays: number;
|
|
36
36
|
totalRewards: number;
|
|
37
37
|
}
|
|
38
|
-
export interface
|
|
38
|
+
export interface GachaRecord {
|
|
39
39
|
handle: string;
|
|
40
40
|
totalPulls: number;
|
|
41
41
|
pityCounter: number;
|
|
42
42
|
fullPityCount: number;
|
|
43
43
|
hiddenawards: number;
|
|
44
44
|
}
|
|
45
|
-
export interface
|
|
45
|
+
export interface WelfareClaim {
|
|
46
46
|
handle: string;
|
|
47
47
|
activity: number;
|
|
48
48
|
lastdate: Date;
|
|
49
49
|
}
|
|
50
|
-
export interface
|
|
50
|
+
export interface ActivityInfo {
|
|
51
51
|
id: number;
|
|
52
52
|
name: string;
|
|
53
53
|
description: string;
|
|
@@ -58,7 +58,7 @@ export interface Activity {
|
|
|
58
58
|
creator: string;
|
|
59
59
|
status: '未开始' | '进行中' | '已结束';
|
|
60
60
|
}
|
|
61
|
-
export interface
|
|
61
|
+
export interface RankRecord {
|
|
62
62
|
handle: string;
|
|
63
63
|
name: string;
|
|
64
64
|
rank: number;
|
|
@@ -67,7 +67,7 @@ export interface rank {
|
|
|
67
67
|
rankseason: string;
|
|
68
68
|
Blacklist: boolean;
|
|
69
69
|
}
|
|
70
|
-
export interface
|
|
70
|
+
export interface PunishmentRecord {
|
|
71
71
|
id: number;
|
|
72
72
|
name: string;
|
|
73
73
|
handle: string;
|
|
@@ -78,7 +78,7 @@ export interface Punishment {
|
|
|
78
78
|
date: string;
|
|
79
79
|
comment?: string;
|
|
80
80
|
}
|
|
81
|
-
export interface
|
|
81
|
+
export interface ExchangeLog {
|
|
82
82
|
userId: string;
|
|
83
83
|
handle: string;
|
|
84
84
|
item: string;
|
|
@@ -87,17 +87,17 @@ export interface exchange {
|
|
|
87
87
|
GlobalLimit: boolean;
|
|
88
88
|
season: string;
|
|
89
89
|
}
|
|
90
|
-
export interface
|
|
90
|
+
export interface AdminBenefit {
|
|
91
91
|
userId: string;
|
|
92
92
|
handle: string;
|
|
93
93
|
signmonth: number;
|
|
94
94
|
lastSign: Date;
|
|
95
95
|
}
|
|
96
|
-
export interface
|
|
96
|
+
export interface Blacklist {
|
|
97
97
|
handle: string;
|
|
98
98
|
createdAt: Date;
|
|
99
99
|
}
|
|
100
|
-
export interface
|
|
100
|
+
export interface PKProfile {
|
|
101
101
|
handle: string;
|
|
102
102
|
name: string;
|
|
103
103
|
total: number;
|
|
@@ -107,13 +107,13 @@ export interface PKRecord {
|
|
|
107
107
|
enable: boolean;
|
|
108
108
|
lastToggle: Date;
|
|
109
109
|
}
|
|
110
|
-
export interface
|
|
110
|
+
export interface PKLogs {
|
|
111
111
|
id: number;
|
|
112
112
|
initiator_handle: string;
|
|
113
113
|
target_handle: string;
|
|
114
114
|
date: Date;
|
|
115
115
|
}
|
|
116
|
-
export interface
|
|
116
|
+
export interface WeaponInventory {
|
|
117
117
|
handle: string;
|
|
118
118
|
weaponId: number;
|
|
119
119
|
level: number;
|
|
@@ -121,7 +121,7 @@ export interface equipment {
|
|
|
121
121
|
installedMods: string[];
|
|
122
122
|
equipped: boolean;
|
|
123
123
|
}
|
|
124
|
-
export interface
|
|
124
|
+
export interface BossInfo {
|
|
125
125
|
name: string;
|
|
126
126
|
groupId: number;
|
|
127
127
|
type: string;
|
|
@@ -137,7 +137,7 @@ export interface Boss {
|
|
|
137
137
|
isActive: boolean;
|
|
138
138
|
respawnTime: Date;
|
|
139
139
|
}
|
|
140
|
-
export interface
|
|
140
|
+
export interface BossDamage {
|
|
141
141
|
handle: string;
|
|
142
142
|
playerName: string;
|
|
143
143
|
totalDamage: number;
|
|
@@ -153,35 +153,35 @@ export interface WishRecord {
|
|
|
153
153
|
endTime: Date;
|
|
154
154
|
isused: boolean;
|
|
155
155
|
}
|
|
156
|
-
export interface
|
|
156
|
+
export interface CareerInfo {
|
|
157
157
|
handle: string;
|
|
158
158
|
group: string;
|
|
159
159
|
career: string;
|
|
160
160
|
redcrystal: number;
|
|
161
161
|
date: Date;
|
|
162
162
|
}
|
|
163
|
-
export interface
|
|
163
|
+
export interface Warehouse {
|
|
164
164
|
handle: string;
|
|
165
165
|
itemId: number;
|
|
166
166
|
quantity: number;
|
|
167
167
|
}
|
|
168
|
-
export interface
|
|
168
|
+
export interface TechProgress {
|
|
169
169
|
handle: string;
|
|
170
170
|
techId: number;
|
|
171
171
|
level: number;
|
|
172
172
|
}
|
|
173
|
-
export interface
|
|
173
|
+
export interface MiningRecord {
|
|
174
174
|
handle: string;
|
|
175
175
|
startTime: Date;
|
|
176
176
|
totalMined: number;
|
|
177
177
|
}
|
|
178
|
-
export interface
|
|
178
|
+
export interface TaskProgress {
|
|
179
179
|
handle: string;
|
|
180
180
|
taskId: number;
|
|
181
181
|
progress: number;
|
|
182
182
|
Completions: number;
|
|
183
183
|
}
|
|
184
|
-
export interface
|
|
184
|
+
export interface Permissions {
|
|
185
185
|
handle: string;
|
|
186
186
|
legendarypermissions: number;
|
|
187
187
|
explosiondoorauthority: number;
|
package/lib/index.js
CHANGED
|
@@ -697,7 +697,7 @@ async function checkTransferRequirements(ctx, handle, profession) {
|
|
|
697
697
|
const damageRecords = await ctx.database.get("ggcevo_boss_damage", { handle });
|
|
698
698
|
const totalAttack = damageRecords.reduce((sum, r) => sum + r.attackCount, 0);
|
|
699
699
|
const totalDamage = damageRecords.reduce((sum, r) => sum + r.totalDamage, 0);
|
|
700
|
-
const weapons = await ctx.database.get("
|
|
700
|
+
const weapons = await ctx.database.get("ggcevo_weapons", {
|
|
701
701
|
handle,
|
|
702
702
|
level: { $gte: 3 }
|
|
703
703
|
});
|
|
@@ -1442,7 +1442,7 @@ var passiveConfig = {
|
|
|
1442
1442
|
},
|
|
1443
1443
|
"复苏": {
|
|
1444
1444
|
type: "生存强化(生命/能量回复)",
|
|
1445
|
-
description: "免疫致命伤害,回复
|
|
1445
|
+
description: "免疫致命伤害,回复60%最大生命与100%能量值,并获得「灵能构造炉」技能(生效后移除)"
|
|
1446
1446
|
},
|
|
1447
1447
|
"光影之刃": {
|
|
1448
1448
|
type: "状态叠加(层数叠加)",
|
|
@@ -1576,7 +1576,7 @@ async function calculateTotalDamage(ctx, session, config, equippedWeapon, target
|
|
|
1576
1576
|
}
|
|
1577
1577
|
__name(calculateTotalDamage, "calculateTotalDamage");
|
|
1578
1578
|
async function checkCritRhythm(ctx, handle) {
|
|
1579
|
-
const [record] = await ctx.database.get("
|
|
1579
|
+
const [record] = await ctx.database.get("ggcevo_wish", {
|
|
1580
1580
|
handle,
|
|
1581
1581
|
wishname: "暴击韵律",
|
|
1582
1582
|
startTime: { $lte: /* @__PURE__ */ new Date() },
|
|
@@ -1680,7 +1680,7 @@ __name(calculateCareerAdditive, "calculateCareerAdditive");
|
|
|
1680
1680
|
async function calculateWishAdditive(ctx, handle, weapon) {
|
|
1681
1681
|
let value = 0;
|
|
1682
1682
|
const messages = [];
|
|
1683
|
-
const [sovereign] = await ctx.database.get("
|
|
1683
|
+
const [sovereign] = await ctx.database.get("ggcevo_wish", {
|
|
1684
1684
|
handle,
|
|
1685
1685
|
wishname: "王权增幅",
|
|
1686
1686
|
startTime: { $lte: /* @__PURE__ */ new Date() },
|
|
@@ -1690,7 +1690,7 @@ async function calculateWishAdditive(ctx, handle, weapon) {
|
|
|
1690
1690
|
value += 0.1;
|
|
1691
1691
|
messages.push("👑 王权增幅祈愿:攻击伤害+10%");
|
|
1692
1692
|
}
|
|
1693
|
-
const [lament] = await ctx.database.get("
|
|
1693
|
+
const [lament] = await ctx.database.get("ggcevo_wish", {
|
|
1694
1694
|
handle,
|
|
1695
1695
|
wishname: "悲鸣之锋",
|
|
1696
1696
|
startTime: { $lte: /* @__PURE__ */ new Date() },
|
|
@@ -1701,7 +1701,7 @@ async function calculateWishAdditive(ctx, handle, weapon) {
|
|
|
1701
1701
|
value += levelBonus;
|
|
1702
1702
|
messages.push(`🗡️ 悲鸣之锋祈愿:攻击伤害+${Math.round(levelBonus * 100)}%`);
|
|
1703
1703
|
}
|
|
1704
|
-
const [critRhythm] = await ctx.database.get("
|
|
1704
|
+
const [critRhythm] = await ctx.database.get("ggcevo_wish", {
|
|
1705
1705
|
handle,
|
|
1706
1706
|
wishname: "暴击韵律",
|
|
1707
1707
|
startTime: { $lte: /* @__PURE__ */ new Date() },
|
|
@@ -1930,7 +1930,7 @@ async function calculateTotalPower(ctx, config, handle) {
|
|
|
1930
1930
|
else if (["警卫员下士", "警卫长", "武器中士"].includes(career)) total += 3500;
|
|
1931
1931
|
else if (["能量武器专家", "枪手", "猩红杀手", "纵火狂"].includes(career)) total += 4e3;
|
|
1932
1932
|
}
|
|
1933
|
-
const weapons = await ctx.database.get("
|
|
1933
|
+
const weapons = await ctx.database.get("ggcevo_weapons", { handle });
|
|
1934
1934
|
for (const { weaponId, level, installedMods } of weapons) {
|
|
1935
1935
|
const weapon = weaponConfigById[weaponId];
|
|
1936
1936
|
if (!weapon) continue;
|
|
@@ -2123,9 +2123,9 @@ async function handleTechUpgrade(ctx, handle, target) {
|
|
|
2123
2123
|
level: nextLevel
|
|
2124
2124
|
}], ["handle", "techId"]);
|
|
2125
2125
|
if (permissionGrantInfo) {
|
|
2126
|
-
const [permissionRecord] = await ctx.database.get("
|
|
2126
|
+
const [permissionRecord] = await ctx.database.get("ggcevo_permissions", { handle });
|
|
2127
2127
|
const currentValue = permissionRecord?.[permissionGrantInfo.field] || 0;
|
|
2128
|
-
await ctx.database.upsert("
|
|
2128
|
+
await ctx.database.upsert("ggcevo_permissions", [{
|
|
2129
2129
|
handle,
|
|
2130
2130
|
[permissionGrantInfo.field]: currentValue + permissionGrantInfo.amount
|
|
2131
2131
|
}], ["handle"]);
|
|
@@ -2141,7 +2141,7 @@ async function handleTechUpgrade(ctx, handle, target) {
|
|
|
2141
2141
|
const costInfo = discountApplied ? `💸 花费金币:${actualCost} (原价${originalCost})` : `💸 花费金币:${actualCost}`;
|
|
2142
2142
|
let permissionMessage = [];
|
|
2143
2143
|
if (permissionGrantInfo) {
|
|
2144
|
-
const [permissionRecord] = await ctx.database.get("
|
|
2144
|
+
const [permissionRecord] = await ctx.database.get("ggcevo_permissions", { handle });
|
|
2145
2145
|
const newValue = permissionRecord?.[permissionGrantInfo.field] || permissionGrantInfo.amount;
|
|
2146
2146
|
permissionMessage.push(
|
|
2147
2147
|
permissionGrantInfo.message
|
|
@@ -2161,7 +2161,7 @@ async function handleTechUpgrade(ctx, handle, target) {
|
|
|
2161
2161
|
__name(handleTechUpgrade, "handleTechUpgrade");
|
|
2162
2162
|
async function handleWeaponUpgrade(ctx, handle, target) {
|
|
2163
2163
|
const weaponData = weaponConfig[target];
|
|
2164
|
-
const [equipment] = await ctx.database.get("
|
|
2164
|
+
const [equipment] = await ctx.database.get("ggcevo_weapons", {
|
|
2165
2165
|
handle,
|
|
2166
2166
|
weaponId: weaponData.id
|
|
2167
2167
|
});
|
|
@@ -2216,7 +2216,7 @@ async function handleWeaponUpgrade(ctx, handle, target) {
|
|
|
2216
2216
|
totalRewards: signInfo.totalRewards - actualCost
|
|
2217
2217
|
});
|
|
2218
2218
|
await ctx.database.set(
|
|
2219
|
-
"
|
|
2219
|
+
"ggcevo_weapons",
|
|
2220
2220
|
{ handle, weaponId: weaponData.id },
|
|
2221
2221
|
{
|
|
2222
2222
|
level: newLevel,
|
|
@@ -2225,7 +2225,7 @@ async function handleWeaponUpgrade(ctx, handle, target) {
|
|
|
2225
2225
|
);
|
|
2226
2226
|
if (activeWish) {
|
|
2227
2227
|
await ctx.database.set(
|
|
2228
|
-
"
|
|
2228
|
+
"ggcevo_wish",
|
|
2229
2229
|
{ id: activeWish.id },
|
|
2230
2230
|
{ isused: true }
|
|
2231
2231
|
);
|
|
@@ -2250,7 +2250,7 @@ async function handleWeaponUpgrade(ctx, handle, target) {
|
|
|
2250
2250
|
}
|
|
2251
2251
|
__name(handleWeaponUpgrade, "handleWeaponUpgrade");
|
|
2252
2252
|
async function checkFoxBlessing(ctx, handle) {
|
|
2253
|
-
return ctx.database.get("
|
|
2253
|
+
return ctx.database.get("ggcevo_wish", {
|
|
2254
2254
|
handle,
|
|
2255
2255
|
wishname: "灵狐升运",
|
|
2256
2256
|
startTime: { $lte: /* @__PURE__ */ new Date() },
|
|
@@ -2642,22 +2642,25 @@ var BattleEffectProcessor = {
|
|
|
2642
2642
|
}
|
|
2643
2643
|
return null;
|
|
2644
2644
|
}, "handleStressShellII"),
|
|
2645
|
-
|
|
2645
|
+
// 求生本能I (修改后)
|
|
2646
|
+
handleSurvivalInstinctI: /* @__PURE__ */ __name(function(targetBoss, damageAmount) {
|
|
2646
2647
|
const messages = [];
|
|
2647
2648
|
if (!targetBoss.skills.includes("求生本能I")) {
|
|
2648
2649
|
return null;
|
|
2649
2650
|
}
|
|
2650
2651
|
const targetMaxHP = getMaxHPByName(targetBoss.name);
|
|
2651
|
-
const
|
|
2652
|
-
if (
|
|
2652
|
+
const isLethal = damageAmount >= targetBoss.HP;
|
|
2653
|
+
if (!isLethal) {
|
|
2653
2654
|
return null;
|
|
2654
2655
|
}
|
|
2655
2656
|
const selfHealAmount = Math.round(targetMaxHP * 0.3);
|
|
2656
2657
|
const updates = {
|
|
2657
2658
|
hpChange: selfHealAmount,
|
|
2659
|
+
// 回复生命值
|
|
2658
2660
|
skillsRemoved: ["求生本能I"]
|
|
2661
|
+
// 移除技能
|
|
2659
2662
|
};
|
|
2660
|
-
messages.push(`❤️ 【求生本能I
|
|
2663
|
+
messages.push(`❤️ 【求生本能I】触发:承受致命伤害时,回复${selfHealAmount}点生命值`);
|
|
2661
2664
|
messages.push(`❤️ 【求生本能I】技能移除`);
|
|
2662
2665
|
return {
|
|
2663
2666
|
messages,
|
|
@@ -2667,14 +2670,15 @@ var BattleEffectProcessor = {
|
|
|
2667
2670
|
}
|
|
2668
2671
|
};
|
|
2669
2672
|
}, "handleSurvivalInstinctI"),
|
|
2670
|
-
|
|
2673
|
+
// 求生本能II (修改后)
|
|
2674
|
+
handleSurvivalInstinctII: /* @__PURE__ */ __name(function(targetBoss, damageAmount) {
|
|
2671
2675
|
const messages = [];
|
|
2672
2676
|
if (!targetBoss.skills.includes("求生本能II")) {
|
|
2673
2677
|
return null;
|
|
2674
2678
|
}
|
|
2675
2679
|
const targetMaxHP = getMaxHPByName(targetBoss.name);
|
|
2676
|
-
const
|
|
2677
|
-
if (
|
|
2680
|
+
const isLethal = damageAmount >= targetBoss.HP;
|
|
2681
|
+
if (!isLethal) {
|
|
2678
2682
|
return null;
|
|
2679
2683
|
}
|
|
2680
2684
|
const selfHealAmount = Math.round(targetMaxHP * 0.5);
|
|
@@ -2684,7 +2688,7 @@ var BattleEffectProcessor = {
|
|
|
2684
2688
|
skillsRemoved: ["求生本能II"]
|
|
2685
2689
|
// 移除的技能
|
|
2686
2690
|
};
|
|
2687
|
-
messages.push(`❤️ 【求生本能II
|
|
2691
|
+
messages.push(`❤️ 【求生本能II】触发:承受致命伤害时,回复${selfHealAmount}点生命值`);
|
|
2688
2692
|
messages.push(`❤️ 【求生本能II】技能移除`);
|
|
2689
2693
|
return {
|
|
2690
2694
|
messages,
|
|
@@ -3549,24 +3553,25 @@ var BattleEffectProcessor = {
|
|
|
3549
3553
|
}
|
|
3550
3554
|
};
|
|
3551
3555
|
}, "handleCosmicEnergy"),
|
|
3552
|
-
|
|
3553
|
-
handleRevival: /* @__PURE__ */ __name(function(targetBoss) {
|
|
3556
|
+
// 复苏 (修改后)
|
|
3557
|
+
handleRevival: /* @__PURE__ */ __name(function(targetBoss, damageAmount) {
|
|
3554
3558
|
const messages = [];
|
|
3555
3559
|
if (!targetBoss.skills.includes("复苏")) {
|
|
3556
3560
|
return null;
|
|
3557
3561
|
}
|
|
3558
|
-
|
|
3562
|
+
const isLethal = damageAmount >= targetBoss.HP;
|
|
3563
|
+
if (!isLethal) {
|
|
3559
3564
|
return null;
|
|
3560
3565
|
}
|
|
3561
3566
|
const maxHP = getMaxHPByName(targetBoss.name);
|
|
3562
3567
|
const maxEnergy = getMaxEnergyByName(targetBoss.name);
|
|
3563
|
-
const healAmount = Math.round(maxHP * 0.
|
|
3568
|
+
const healAmount = Math.round(maxHP * 0.6);
|
|
3564
3569
|
const energyGain = maxEnergy;
|
|
3565
3570
|
const targetUpdates = {
|
|
3566
3571
|
name: targetBoss.name,
|
|
3567
3572
|
updates: {
|
|
3568
3573
|
hpChange: healAmount,
|
|
3569
|
-
// 回复
|
|
3574
|
+
// 回复60%最大生命值
|
|
3570
3575
|
energyChange: energyGain,
|
|
3571
3576
|
// 回复100%能量
|
|
3572
3577
|
skillsRemoved: ["复苏"],
|
|
@@ -4088,14 +4093,11 @@ function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, ignor
|
|
|
4088
4093
|
{ effect: BattleEffectProcessor.handleFrostRegeneration, args: [targetBoss, activeBosses] },
|
|
4089
4094
|
{ effect: BattleEffectProcessor.handleFrostAura, args: [targetBoss, activeBosses] },
|
|
4090
4095
|
{ effect: BattleEffectProcessor.handleSentryGun, args: [targetBoss, activeBosses] },
|
|
4091
|
-
{ effect: BattleEffectProcessor.handleSurvivalInstinctI, args: [targetBoss] },
|
|
4092
|
-
{ effect: BattleEffectProcessor.handleSurvivalInstinctII, args: [targetBoss] },
|
|
4093
4096
|
{ effect: BattleEffectProcessor.handleMoldGrowth, args: [targetBoss, activeBosses] },
|
|
4094
4097
|
{ effect: BattleEffectProcessor.handleElectricShockwave, args: [targetBoss] },
|
|
4095
4098
|
{ effect: BattleEffectProcessor.handlePulse, args: [targetBoss, activeBosses] },
|
|
4096
4099
|
{ effect: BattleEffectProcessor.handleFeeding, args: [targetBoss] },
|
|
4097
4100
|
{ effect: BattleEffectProcessor.handleBurningBurrow, args: [targetBoss] },
|
|
4098
|
-
{ effect: BattleEffectProcessor.handleRevival, args: [targetBoss] },
|
|
4099
4101
|
{ effect: BattleEffectProcessor.handleCosmicEnergy, args: [targetBoss, damage] },
|
|
4100
4102
|
{ effect: BattleEffectProcessor.handleBombardmentGuide, args: [targetBoss] },
|
|
4101
4103
|
{ effect: BattleEffectProcessor.handleOverdriveShield, args: [targetBoss, activeBosses] }
|
|
@@ -4180,18 +4182,38 @@ function applyPassiveEffects(targetBoss, activeBosses, weaponName, damage, ignor
|
|
|
4180
4182
|
layerReduced = layerReduceResult.reductionSuccess || false;
|
|
4181
4183
|
}
|
|
4182
4184
|
let finalDamage = damage;
|
|
4185
|
+
const isLethal = finalDamage >= targetBoss.HP && finalDamage > 0;
|
|
4183
4186
|
if (!immune) {
|
|
4184
4187
|
let adjustedNerfMultiplier = totalNerfMultiplier * (1 - ignoreRate);
|
|
4185
4188
|
const damageMultiplier = 1 + totalBuffMultiplier - adjustedNerfMultiplier;
|
|
4186
4189
|
finalDamage = Math.max(1, Math.round(damage * damageMultiplier));
|
|
4187
|
-
if (finalDamage > 0) {
|
|
4188
|
-
updateStatsByName(targetBoss.name, {
|
|
4189
|
-
hpChange: -finalDamage
|
|
4190
|
-
});
|
|
4191
|
-
}
|
|
4192
4190
|
} else {
|
|
4193
4191
|
finalDamage = 0;
|
|
4194
4192
|
}
|
|
4193
|
+
const survivalSkills = [
|
|
4194
|
+
{ func: BattleEffectProcessor.handleSurvivalInstinctI, name: "求生本能I" },
|
|
4195
|
+
{ func: BattleEffectProcessor.handleSurvivalInstinctII, name: "求生本能II" },
|
|
4196
|
+
{ func: BattleEffectProcessor.handleRevival, name: "复苏" }
|
|
4197
|
+
];
|
|
4198
|
+
let revivalTriggered = false;
|
|
4199
|
+
if (isLethal) {
|
|
4200
|
+
for (const skill of survivalSkills) {
|
|
4201
|
+
if (targetBoss.skills.includes(skill.name)) {
|
|
4202
|
+
const result = skill.func(targetBoss, finalDamage);
|
|
4203
|
+
if (result) {
|
|
4204
|
+
updateStatsByName(result.targetUpdates.name, result.targetUpdates.updates);
|
|
4205
|
+
messages.push(...result.messages);
|
|
4206
|
+
revivalTriggered = true;
|
|
4207
|
+
break;
|
|
4208
|
+
}
|
|
4209
|
+
}
|
|
4210
|
+
}
|
|
4211
|
+
}
|
|
4212
|
+
if (!revivalTriggered && !immune && finalDamage > 0) {
|
|
4213
|
+
updateStatsByName(targetBoss.name, {
|
|
4214
|
+
hpChange: -finalDamage
|
|
4215
|
+
});
|
|
4216
|
+
}
|
|
4195
4217
|
return {
|
|
4196
4218
|
finalDamage,
|
|
4197
4219
|
messages,
|
|
@@ -4241,7 +4263,7 @@ async function handleBossDefeatRewards(ctx, targetBoss) {
|
|
|
4241
4263
|
return { rewardMessages };
|
|
4242
4264
|
}
|
|
4243
4265
|
const handles = damageRecords.map((r) => r.handle);
|
|
4244
|
-
const doubleWishRecords = await ctx.database.get("
|
|
4266
|
+
const doubleWishRecords = await ctx.database.get("ggcevo_wish", {
|
|
4245
4267
|
handle: { $in: handles },
|
|
4246
4268
|
wishname: "精灵双倍",
|
|
4247
4269
|
startTime: { $lte: /* @__PURE__ */ new Date() },
|
|
@@ -4344,7 +4366,7 @@ async function handleBossDefeatRewards(ctx, targetBoss) {
|
|
|
4344
4366
|
}], ["handle", "itemId"]);
|
|
4345
4367
|
}
|
|
4346
4368
|
if (doubleWishIds.length > 0) {
|
|
4347
|
-
await ctx.database.set("
|
|
4369
|
+
await ctx.database.set("ggcevo_wish", { id: { $in: doubleWishIds } }, {
|
|
4348
4370
|
isused: true
|
|
4349
4371
|
// 将使用过的双倍祈愿标记为已使用
|
|
4350
4372
|
});
|
|
@@ -4701,7 +4723,7 @@ async function handleIgnoreReductionEffects(ctx, handle, weaponName, targetBoss)
|
|
|
4701
4723
|
const handlePiercingMod = /* @__PURE__ */ __name(async () => {
|
|
4702
4724
|
const weaponConfigData = weaponConfig[weaponName];
|
|
4703
4725
|
if (!weaponConfigData) return;
|
|
4704
|
-
const [equippedWeapon] = await ctx.database.get("
|
|
4726
|
+
const [equippedWeapon] = await ctx.database.get("ggcevo_weapons", {
|
|
4705
4727
|
weaponId: weaponConfigData.id,
|
|
4706
4728
|
handle,
|
|
4707
4729
|
equipped: true
|
|
@@ -4839,7 +4861,7 @@ function apply(ctx, config) {
|
|
|
4839
4861
|
}, {
|
|
4840
4862
|
primary: "handle"
|
|
4841
4863
|
});
|
|
4842
|
-
ctx.model.extend("
|
|
4864
|
+
ctx.model.extend("ggcevo_punishment", {
|
|
4843
4865
|
id: "unsigned",
|
|
4844
4866
|
// 自增序号
|
|
4845
4867
|
name: "string",
|
|
@@ -4916,7 +4938,7 @@ function apply(ctx, config) {
|
|
|
4916
4938
|
primary: "id",
|
|
4917
4939
|
autoInc: true
|
|
4918
4940
|
});
|
|
4919
|
-
ctx.model.extend("
|
|
4941
|
+
ctx.model.extend("ggcevo_weapons", {
|
|
4920
4942
|
handle: "string",
|
|
4921
4943
|
weaponId: "unsigned",
|
|
4922
4944
|
level: "unsigned",
|
|
@@ -4954,7 +4976,7 @@ function apply(ctx, config) {
|
|
|
4954
4976
|
}, {
|
|
4955
4977
|
primary: "handle"
|
|
4956
4978
|
});
|
|
4957
|
-
ctx.model.extend("
|
|
4979
|
+
ctx.model.extend("ggcevo_wish", {
|
|
4958
4980
|
id: "unsigned",
|
|
4959
4981
|
handle: "string",
|
|
4960
4982
|
wishname: "string",
|
|
@@ -5003,7 +5025,7 @@ function apply(ctx, config) {
|
|
|
5003
5025
|
}, {
|
|
5004
5026
|
primary: ["handle", "taskId"]
|
|
5005
5027
|
});
|
|
5006
|
-
ctx.model.extend("
|
|
5028
|
+
ctx.model.extend("ggcevo_permissions", {
|
|
5007
5029
|
handle: "string",
|
|
5008
5030
|
legendarypermissions: "unsigned",
|
|
5009
5031
|
explosiondoorauthority: "unsigned"
|
|
@@ -5134,7 +5156,7 @@ function apply(ctx, config) {
|
|
|
5134
5156
|
// 保留名称用于后续展示
|
|
5135
5157
|
}))
|
|
5136
5158
|
);
|
|
5137
|
-
const punishmentRecords = await ctx.database.select("
|
|
5159
|
+
const punishmentRecords = await ctx.database.select("ggcevo_punishment").where({
|
|
5138
5160
|
$and: [
|
|
5139
5161
|
{ handle: { $in: allPlayers.map((p) => p.handle) } },
|
|
5140
5162
|
{ id: { $gte: 1889 } },
|
|
@@ -5303,7 +5325,7 @@ function apply(ctx, config) {
|
|
|
5303
5325
|
const [itemName, itemData] = entry;
|
|
5304
5326
|
return itemData.description ? `${itemName} x ${userItem.quantity}:${itemData.description}` : `${itemName} x ${userItem.quantity}`;
|
|
5305
5327
|
});
|
|
5306
|
-
return `【${
|
|
5328
|
+
return `【${session.username}的背包】
|
|
5307
5329
|
${itemDetails.join("\n")}`;
|
|
5308
5330
|
});
|
|
5309
5331
|
ctx.command("ggcevo/签到").action(async (argv) => {
|
|
@@ -5409,7 +5431,7 @@ ${itemDetails.join("\n")}`;
|
|
|
5409
5431
|
messages.push(`💎 CRED-17生效:+${totalBonusPercent}%金币`);
|
|
5410
5432
|
}
|
|
5411
5433
|
}
|
|
5412
|
-
const [meowEffect] = await ctx.database.get("
|
|
5434
|
+
const [meowEffect] = await ctx.database.get("ggcevo_wish", {
|
|
5413
5435
|
handle,
|
|
5414
5436
|
wishname: "喵喵财源",
|
|
5415
5437
|
startTime: { $lte: now },
|
|
@@ -6006,8 +6028,8 @@ ${ticketMessage}${effectMessage}`;
|
|
|
6006
6028
|
handle = `${regionId}-S2-${realmId}-${profileId}`;
|
|
6007
6029
|
}
|
|
6008
6030
|
if (pageNum < 1) return "请输入有效的页码。";
|
|
6009
|
-
const totalPages = await ctx.database.select("
|
|
6010
|
-
const records = await ctx.database.select("
|
|
6031
|
+
const totalPages = await ctx.database.select("ggcevo_punishment").where({ handle }).execute((row) => import_koishi.$.count(row.id));
|
|
6032
|
+
const records = await ctx.database.select("ggcevo_punishment").where({ handle }).orderBy("id", "desc").limit(1).offset(pageNum - 1).execute();
|
|
6011
6033
|
if (!records.length) {
|
|
6012
6034
|
return pageNum === 1 ? `【${handle}】暂无违规记录` : `【${handle}】第 ${pageNum} 条记录不存在`;
|
|
6013
6035
|
}
|
|
@@ -6683,7 +6705,7 @@ ${items.join("、")}
|
|
|
6683
6705
|
if (careerData?.career === "武器中士") {
|
|
6684
6706
|
discountDetails.push(`▸ 🎖️ 武器中士职业:50%折扣`);
|
|
6685
6707
|
}
|
|
6686
|
-
const activeWish = await ctx.database.get("
|
|
6708
|
+
const activeWish = await ctx.database.get("ggcevo_wish", {
|
|
6687
6709
|
handle,
|
|
6688
6710
|
wishname: "蚱蜢优购",
|
|
6689
6711
|
startTime: { $lte: /* @__PURE__ */ new Date() },
|
|
@@ -6815,14 +6837,14 @@ ${validTypes.join("、")}`;
|
|
|
6815
6837
|
const isWeapon = ["能量武器", "热能武器", "实弹武器", "传奇武器"].includes(config2.category);
|
|
6816
6838
|
const isLegendaryWeapon = config2.category === "传奇武器";
|
|
6817
6839
|
if (isWeapon) {
|
|
6818
|
-
const existingWeapon = await ctx.database.get("
|
|
6840
|
+
const existingWeapon = await ctx.database.get("ggcevo_weapons", {
|
|
6819
6841
|
handle,
|
|
6820
6842
|
weaponId: config2.id
|
|
6821
6843
|
});
|
|
6822
6844
|
if (existingWeapon.length > 0) return `❌ 您已经拥有${item},无法重复购买`;
|
|
6823
6845
|
}
|
|
6824
6846
|
if (isLegendaryWeapon) {
|
|
6825
|
-
const [permissions] = await ctx.database.get("
|
|
6847
|
+
const [permissions] = await ctx.database.get("ggcevo_permissions", { handle });
|
|
6826
6848
|
if (!permissions || permissions.legendarypermissions <= 0) {
|
|
6827
6849
|
return '❌ 购买传奇武器需要"传奇武器购买权限",您当前没有购买权限。';
|
|
6828
6850
|
}
|
|
@@ -6850,7 +6872,7 @@ ${validTypes.join("、")}`;
|
|
|
6850
6872
|
discountDetails.push(`🎖️ 武器中士职业:${specialistDiscount}%折扣`);
|
|
6851
6873
|
}
|
|
6852
6874
|
if (!isLegendaryWeapon && isWeapon) {
|
|
6853
|
-
activeWish = await ctx.database.get("
|
|
6875
|
+
activeWish = await ctx.database.get("ggcevo_wish", {
|
|
6854
6876
|
handle,
|
|
6855
6877
|
wishname: "蚱蜢优购",
|
|
6856
6878
|
startTime: { $lte: /* @__PURE__ */ new Date() },
|
|
@@ -6882,32 +6904,32 @@ ${validTypes.join("、")}`;
|
|
|
6882
6904
|
totalRewards: signInfo.totalRewards - actualPrice
|
|
6883
6905
|
});
|
|
6884
6906
|
if (activeWish) {
|
|
6885
|
-
await ctx.database.set("
|
|
6907
|
+
await ctx.database.set("ggcevo_wish", { id: activeWish.id }, {
|
|
6886
6908
|
isused: true
|
|
6887
6909
|
});
|
|
6888
6910
|
}
|
|
6889
6911
|
if (isLegendaryWeapon) {
|
|
6890
|
-
const [permissionRecord] = await ctx.database.get("
|
|
6912
|
+
const [permissionRecord] = await ctx.database.get("ggcevo_permissions", { handle });
|
|
6891
6913
|
if (!permissionRecord || permissionRecord.legendarypermissions <= 0) {
|
|
6892
6914
|
throw new Error("传奇武器购买权限不足");
|
|
6893
6915
|
}
|
|
6894
6916
|
const remaining = permissionRecord.legendarypermissions - 1;
|
|
6895
|
-
await ctx.database.set("
|
|
6917
|
+
await ctx.database.set("ggcevo_permissions", { handle }, {
|
|
6896
6918
|
legendarypermissions: remaining
|
|
6897
6919
|
});
|
|
6898
6920
|
}
|
|
6899
6921
|
if (isWeapon) {
|
|
6900
|
-
await ctx.database.upsert("
|
|
6922
|
+
await ctx.database.upsert("ggcevo_weapons", [{
|
|
6901
6923
|
handle,
|
|
6902
6924
|
weaponId: config2.id,
|
|
6903
6925
|
level: 0,
|
|
6904
6926
|
modificationSlots: 1,
|
|
6905
6927
|
equipped: false
|
|
6906
6928
|
}], ["handle", "weaponId"]);
|
|
6907
|
-
const equippedCount = await ctx.database.select("
|
|
6929
|
+
const equippedCount = await ctx.database.select("ggcevo_weapons").where({ handle, equipped: true }).execute((row) => import_koishi.$.count(row.weaponId));
|
|
6908
6930
|
if (equippedCount === 0) {
|
|
6909
6931
|
await ctx.database.set(
|
|
6910
|
-
"
|
|
6932
|
+
"ggcevo_weapons",
|
|
6911
6933
|
{ handle, weaponId: config2.id },
|
|
6912
6934
|
{ equipped: true }
|
|
6913
6935
|
);
|
|
@@ -6936,7 +6958,7 @@ ${validTypes.join("、")}`;
|
|
|
6936
6958
|
message += `花费 ${actualPrice} 金币`;
|
|
6937
6959
|
}
|
|
6938
6960
|
if (isLegendaryWeapon) {
|
|
6939
|
-
const [permissions] = await ctx.database.get("
|
|
6961
|
+
const [permissions] = await ctx.database.get("ggcevo_permissions", { handle });
|
|
6940
6962
|
message += `
|
|
6941
6963
|
扣除 1 次传奇武器购买权限,剩余次数:${permissions?.legendarypermissions || 0}`;
|
|
6942
6964
|
}
|
|
@@ -6956,7 +6978,7 @@ ${validTypes.join("、")}`;
|
|
|
6956
6978
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
6957
6979
|
if (!profile) return "🔒 需要先绑定游戏句柄。";
|
|
6958
6980
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
6959
|
-
const weapons = await ctx.database.get("
|
|
6981
|
+
const weapons = await ctx.database.get("ggcevo_weapons", {
|
|
6960
6982
|
handle
|
|
6961
6983
|
});
|
|
6962
6984
|
const weaponDetails = await Promise.all(weapons.map(async (w) => {
|
|
@@ -6974,7 +6996,7 @@ ${validTypes.join("、")}`;
|
|
|
6974
6996
|
].join("\n");
|
|
6975
6997
|
}));
|
|
6976
6998
|
return [
|
|
6977
|
-
`🛡️ ${
|
|
6999
|
+
`🛡️ ${session.username}的武器列表`,
|
|
6978
7000
|
'使用"装备 武器名称"来装备武器',
|
|
6979
7001
|
"⚡表示当前装备武器",
|
|
6980
7002
|
"──────────────",
|
|
@@ -6995,14 +7017,14 @@ ${validTypes.join("、")}`;
|
|
|
6995
7017
|
if (!weapon) return "请输入“装备 武器名称”来装备一把你拥有的武器。";
|
|
6996
7018
|
if (!weaponConfig[weapon]) return "武器名称错误,请输入“装备 武器名称”来装备一把你拥有的武器。";
|
|
6997
7019
|
const config2 = weaponConfig[weapon];
|
|
6998
|
-
const [owned] = await ctx.database.get("
|
|
7020
|
+
const [owned] = await ctx.database.get("ggcevo_weapons", {
|
|
6999
7021
|
handle,
|
|
7000
7022
|
weaponId: config2.id
|
|
7001
7023
|
});
|
|
7002
7024
|
if (!owned) return "您尚未获得该武器。";
|
|
7003
7025
|
await ctx.database.withTransaction(async () => {
|
|
7004
7026
|
await ctx.database.set(
|
|
7005
|
-
"
|
|
7027
|
+
"ggcevo_weapons",
|
|
7006
7028
|
{
|
|
7007
7029
|
handle,
|
|
7008
7030
|
weaponId: { $ne: config2.id }
|
|
@@ -7010,7 +7032,7 @@ ${validTypes.join("、")}`;
|
|
|
7010
7032
|
},
|
|
7011
7033
|
{ equipped: false }
|
|
7012
7034
|
);
|
|
7013
|
-
await ctx.database.upsert("
|
|
7035
|
+
await ctx.database.upsert("ggcevo_weapons", [{
|
|
7014
7036
|
handle,
|
|
7015
7037
|
weaponId: config2.id,
|
|
7016
7038
|
equipped: true
|
|
@@ -7054,7 +7076,7 @@ ${validTypes.join("、")}`;
|
|
|
7054
7076
|
return `❌ 无效武器名称。可选武器:${validWeapons.join("、")}`;
|
|
7055
7077
|
}
|
|
7056
7078
|
const weaponId = weaponConfig[weapon].id;
|
|
7057
|
-
const [equipment] = await ctx.database.get("
|
|
7079
|
+
const [equipment] = await ctx.database.get("ggcevo_weapons", {
|
|
7058
7080
|
handle,
|
|
7059
7081
|
weaponId
|
|
7060
7082
|
// 使用已验证的weaponId
|
|
@@ -7097,7 +7119,7 @@ ${validTypes.join("、")}`;
|
|
|
7097
7119
|
return `改装需要 ${actualCost} 金币,当前持有:${signInfo?.totalRewards || 0}`;
|
|
7098
7120
|
}
|
|
7099
7121
|
await ctx.database.set(
|
|
7100
|
-
"
|
|
7122
|
+
"ggcevo_weapons",
|
|
7101
7123
|
{ handle, weaponId: weaponConfig[weapon].id },
|
|
7102
7124
|
{ installedMods: [...equipment.installedMods, mod] }
|
|
7103
7125
|
);
|
|
@@ -7182,7 +7204,7 @@ ${validTypes.join("、")}`;
|
|
|
7182
7204
|
if (!modInfo) return "❌ 请输入“拆卸 武器名称 模块名称”\n注意:通用模块返还80%金币,专属模块返还50%金币";
|
|
7183
7205
|
const refundRate = modInfo.isExclusive ? 0.5 : 0.8;
|
|
7184
7206
|
const refundType = modInfo.isExclusive ? "专属模块返还50%" : "通用模块返还80%";
|
|
7185
|
-
const [equipment] = await ctx.database.get("
|
|
7207
|
+
const [equipment] = await ctx.database.get("ggcevo_weapons", {
|
|
7186
7208
|
handle,
|
|
7187
7209
|
weaponId
|
|
7188
7210
|
});
|
|
@@ -7193,7 +7215,7 @@ ${validTypes.join("、")}`;
|
|
|
7193
7215
|
const refund = Math.floor(modInfo.cost * refundRate);
|
|
7194
7216
|
const newMods = equipment.installedMods.filter((m) => m !== mod);
|
|
7195
7217
|
await ctx.database.set(
|
|
7196
|
-
"
|
|
7218
|
+
"ggcevo_weapons",
|
|
7197
7219
|
{ handle, weaponId },
|
|
7198
7220
|
{ installedMods: newMods }
|
|
7199
7221
|
);
|
|
@@ -7243,7 +7265,7 @@ ${validTypes.join("、")}`;
|
|
|
7243
7265
|
}
|
|
7244
7266
|
}
|
|
7245
7267
|
}
|
|
7246
|
-
const [equippedWeapon] = await ctx.database.get("
|
|
7268
|
+
const [equippedWeapon] = await ctx.database.get("ggcevo_weapons", { handle, equipped: true });
|
|
7247
7269
|
if (!equippedWeapon) return '请先输入"装备 武器名称"后再攻击。';
|
|
7248
7270
|
const weaponConfigEntry = Object.entries(weaponConfig).find(([_, c]) => c.id === equippedWeapon.weaponId);
|
|
7249
7271
|
const [weaponName, weaponData] = weaponConfigEntry;
|
|
@@ -7355,7 +7377,7 @@ ${validTypes.join("、")}`;
|
|
|
7355
7377
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
7356
7378
|
const existingEntries = await ctx.database.get("ggcevo_blacklist", { handle });
|
|
7357
7379
|
if (existingEntries.length > 0) return "⛔ 您已被列入黑名单。";
|
|
7358
|
-
const [equippedWeapon] = await ctx.database.get("
|
|
7380
|
+
const [equippedWeapon] = await ctx.database.get("ggcevo_weapons", {
|
|
7359
7381
|
handle,
|
|
7360
7382
|
equipped: true
|
|
7361
7383
|
});
|
|
@@ -7544,7 +7566,7 @@ ${validTypes.join("、")}`;
|
|
|
7544
7566
|
const [sign] = await ctx.database.get("ggcevo_sign", { handle });
|
|
7545
7567
|
if (!sign || sign.totalRewards < 50) return "需要50金币进行祈愿,您的金币不足。";
|
|
7546
7568
|
const now = /* @__PURE__ */ new Date();
|
|
7547
|
-
const [latestWish] = await ctx.database.get("
|
|
7569
|
+
const [latestWish] = await ctx.database.get("ggcevo_wish", { handle }, {
|
|
7548
7570
|
sort: { endTime: "desc" },
|
|
7549
7571
|
limit: 1
|
|
7550
7572
|
});
|
|
@@ -7592,7 +7614,7 @@ ${validTypes.join("、")}`;
|
|
|
7592
7614
|
await ctx.database.set("ggcevo_sign", { handle }, { totalRewards: newGold });
|
|
7593
7615
|
const startTime = /* @__PURE__ */ new Date();
|
|
7594
7616
|
const endTime = new Date(startTime.getTime() + 7 * 24 * 60 * 60 * 1e3);
|
|
7595
|
-
await ctx.database.create("
|
|
7617
|
+
await ctx.database.create("ggcevo_wish", {
|
|
7596
7618
|
handle,
|
|
7597
7619
|
wishname: effect.name,
|
|
7598
7620
|
startTime,
|
|
@@ -8060,7 +8082,7 @@ ${validTypes.join("、")}`;
|
|
|
8060
8082
|
return `❌ 红晶不足!需要:${finalCost}${discountMessage} 当前拥有红晶:${careerData.redcrystal}`;
|
|
8061
8083
|
}
|
|
8062
8084
|
if (isWeapon) {
|
|
8063
|
-
const existing = await ctx.database.get("
|
|
8085
|
+
const existing = await ctx.database.get("ggcevo_weapons", {
|
|
8064
8086
|
handle,
|
|
8065
8087
|
weaponId: itemConfig2.id
|
|
8066
8088
|
});
|
|
@@ -8072,7 +8094,7 @@ ${validTypes.join("、")}`;
|
|
|
8072
8094
|
redcrystal: careerData.redcrystal - finalCost
|
|
8073
8095
|
});
|
|
8074
8096
|
if (isWeapon) {
|
|
8075
|
-
await ctx.database.create("
|
|
8097
|
+
await ctx.database.create("ggcevo_weapons", {
|
|
8076
8098
|
handle,
|
|
8077
8099
|
weaponId: itemConfig2.id,
|
|
8078
8100
|
level: 0,
|
|
@@ -8080,10 +8102,10 @@ ${validTypes.join("、")}`;
|
|
|
8080
8102
|
installedMods: [],
|
|
8081
8103
|
equipped: false
|
|
8082
8104
|
});
|
|
8083
|
-
const equippedCount = await ctx.database.select("
|
|
8105
|
+
const equippedCount = await ctx.database.select("ggcevo_weapons").where({ handle, equipped: true }).execute((row) => import_koishi.$.count(row.weaponId));
|
|
8084
8106
|
if (equippedCount === 0) {
|
|
8085
8107
|
await ctx.database.set(
|
|
8086
|
-
"
|
|
8108
|
+
"ggcevo_weapons",
|
|
8087
8109
|
{ handle, weaponId: itemConfig2.id },
|
|
8088
8110
|
{ equipped: true }
|
|
8089
8111
|
);
|
|
@@ -8151,7 +8173,7 @@ ${validTypes.join("、")}`;
|
|
|
8151
8173
|
]);
|
|
8152
8174
|
const totalRewards = signData[0]?.totalRewards || 0;
|
|
8153
8175
|
const redcrystal = careerData[0]?.redcrystal || 0;
|
|
8154
|
-
const message = [`【${
|
|
8176
|
+
const message = [`【${session.username}的仓库】`];
|
|
8155
8177
|
message.push(`💰 金币:${totalRewards}`);
|
|
8156
8178
|
if (careerData[0]?.group === "辛迪加海盗") {
|
|
8157
8179
|
message.push(`🔴 红晶:${redcrystal}`);
|
package/lib/utils.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare function isSameHalfDay(a: Date, b: Date): boolean;
|
|
|
10
10
|
export declare function convertUTCtoChinaTime(input: Date | string | number): Date;
|
|
11
11
|
export declare function formatDate(d: Date): string;
|
|
12
12
|
export declare function createHpBar(current: number, max: number): string;
|
|
13
|
-
export declare function activateNextBossGroup(ctx: Context, currentBossId?: number | null): Promise<import("./database").
|
|
13
|
+
export declare function activateNextBossGroup(ctx: Context, currentBossId?: number | null): Promise<import("./database").BossInfo>;
|
|
14
14
|
export declare function calculateTotalPower(ctx: Context, config: Config, handle: string): Promise<number>;
|
|
15
15
|
export declare function applyItemEffect(ctx: Context, session: any, handle: string, itemConfig: any, target?: string): Promise<{
|
|
16
16
|
success: boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-ggcevo-game",
|
|
3
3
|
"description": "《星际争霸2》咕咕虫-evolved地图的专属游戏助手插件,集成天梯排行、抽奖系统、签到福利、兑换商城等丰富功能。",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.41",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@koishijs/plugin-proxy-agent": "^0.3.3",
|
|
21
21
|
"koishi": "^4.18.7",
|
|
22
|
-
"koishi-plugin-sc2arcade-search": "^1.1.
|
|
22
|
+
"koishi-plugin-sc2arcade-search": "^1.1.19"
|
|
23
23
|
},
|
|
24
24
|
"koishi": {
|
|
25
25
|
"service": {
|