koishi-plugin-ggcevo-game 1.3.59 → 1.3.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +237 -154
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -417,7 +417,7 @@ function apply(ctx, config) {
|
|
|
417
417
|
type: "能量武器",
|
|
418
418
|
damage: 25,
|
|
419
419
|
description: "一种经过改造的电动工具,可对近距离的目标放出高压电",
|
|
420
|
-
specialeffect: "攻击拥有能量的目标将会消耗其
|
|
420
|
+
specialeffect: "攻击拥有能量的目标将会消耗其200点能量",
|
|
421
421
|
price: 750,
|
|
422
422
|
redCrystalCost: 10,
|
|
423
423
|
isantiair: true,
|
|
@@ -959,7 +959,7 @@ function apply(ctx, config) {
|
|
|
959
959
|
},
|
|
960
960
|
{
|
|
961
961
|
professionName: "清洁工",
|
|
962
|
-
effect: "
|
|
962
|
+
effect: "当有异形被击败时获得红晶(击败者获得双倍红晶); 每次攻击额外获得红晶",
|
|
963
963
|
requirements: "当期伤害榜前二十名",
|
|
964
964
|
Jobtransfer: true,
|
|
965
965
|
costcoins: 0,
|
|
@@ -999,7 +999,7 @@ function apply(ctx, config) {
|
|
|
999
999
|
},
|
|
1000
1000
|
{
|
|
1001
1001
|
professionName: "计算机专家",
|
|
1002
|
-
effect: "黑市订购设备工具类物品享有50%折扣;
|
|
1002
|
+
effect: "黑市订购设备工具类物品享有50%折扣; 被动应战的PK对战结果为失败时,不会损失金币",
|
|
1003
1003
|
requirements: "仓库中拥有一个黑市订购的设备工具类物品",
|
|
1004
1004
|
Jobtransfer: true,
|
|
1005
1005
|
costcoins: 0,
|
|
@@ -2135,7 +2135,7 @@ function apply(ctx, config) {
|
|
|
2135
2135
|
const currentEnergy = targetBoss.energy || 0;
|
|
2136
2136
|
const messages = [];
|
|
2137
2137
|
if (currentEnergy > 0) {
|
|
2138
|
-
const energyDrain = Math.min(
|
|
2138
|
+
const energyDrain = Math.min(200, currentEnergy);
|
|
2139
2139
|
const newEnergy = currentEnergy - energyDrain;
|
|
2140
2140
|
await ctx2.database.set(
|
|
2141
2141
|
"ggcevo_boss",
|
|
@@ -2395,151 +2395,156 @@ function apply(ctx, config) {
|
|
|
2395
2395
|
}).orderBy("totalDamage", "desc").execute();
|
|
2396
2396
|
const rewardMessages = [];
|
|
2397
2397
|
const rewardMap = /* @__PURE__ */ new Map();
|
|
2398
|
+
if (damageRecords.length === 0) {
|
|
2399
|
+
return { rewardMessages };
|
|
2400
|
+
}
|
|
2398
2401
|
const handles = damageRecords.map((r) => r.handle);
|
|
2399
|
-
const
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
//
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
wishname: "精灵双倍",
|
|
2409
|
-
startTime: { $lte: /* @__PURE__ */ new Date() },
|
|
2410
|
-
endTime: { $gte: /* @__PURE__ */ new Date() },
|
|
2411
|
-
isused: false
|
|
2412
|
-
})
|
|
2413
|
-
]);
|
|
2414
|
-
const cleanerHandles = new Set(pirateCleaners.map((c) => c.handle));
|
|
2402
|
+
const doubleWishRecords = await ctx2.database.get("ggcevo_Wish_Record", {
|
|
2403
|
+
handle: { $in: handles },
|
|
2404
|
+
wishname: "精灵双倍",
|
|
2405
|
+
startTime: { $lte: /* @__PURE__ */ new Date() },
|
|
2406
|
+
endTime: { $gte: /* @__PURE__ */ new Date() },
|
|
2407
|
+
isused: false
|
|
2408
|
+
// 只查询未使用过的双倍祈愿
|
|
2409
|
+
});
|
|
2410
|
+
const doubleWishIds = doubleWishRecords.map((r) => r.id);
|
|
2415
2411
|
const doubleWishHandles = new Set(doubleWishRecords.map((r) => r.handle));
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2412
|
+
const top20 = damageRecords.slice(0, 20);
|
|
2413
|
+
top20.forEach((record, index) => {
|
|
2414
|
+
const rank = index + 1;
|
|
2415
|
+
let guguCoins = 10, gold = 1e3;
|
|
2416
|
+
switch (true) {
|
|
2417
|
+
case rank === 1:
|
|
2418
|
+
guguCoins = 30;
|
|
2419
|
+
gold = 3e3;
|
|
2420
|
+
break;
|
|
2421
|
+
case rank === 2:
|
|
2422
|
+
guguCoins = 25;
|
|
2423
|
+
gold = 2500;
|
|
2424
|
+
break;
|
|
2425
|
+
case rank === 3:
|
|
2426
|
+
guguCoins = 20;
|
|
2427
|
+
gold = 2e3;
|
|
2428
|
+
break;
|
|
2429
|
+
case rank <= 10:
|
|
2430
|
+
guguCoins = 15;
|
|
2431
|
+
gold = 1500;
|
|
2432
|
+
break;
|
|
2433
|
+
}
|
|
2434
|
+
const hasDoubleWish = doubleWishHandles.has(record.handle);
|
|
2435
|
+
if (hasDoubleWish) {
|
|
2436
|
+
guguCoins *= 2;
|
|
2437
|
+
gold *= 2;
|
|
2438
|
+
}
|
|
2439
|
+
const reward = {
|
|
2440
|
+
guguCoins,
|
|
2441
|
+
gold,
|
|
2442
|
+
playerName: record.playerName,
|
|
2443
|
+
hasDoubleWish
|
|
2444
|
+
// 标记该记录使用了双倍祈愿
|
|
2445
|
+
};
|
|
2446
|
+
rewardMap.set(record.handle, reward);
|
|
2447
|
+
const bonusNote = hasDoubleWish ? " (🧝♀ 精灵双倍祈愿生效)" : "";
|
|
2448
|
+
rewardMessages.push(
|
|
2449
|
+
`${rank}. ${record.playerName}`,
|
|
2450
|
+
` 获得奖励: ${guguCoins} 咕咕币 + ${gold} 金币${bonusNote}`
|
|
2451
|
+
);
|
|
2452
|
+
});
|
|
2453
|
+
const others = damageRecords.slice(20);
|
|
2454
|
+
const doubleWishOthers = [];
|
|
2455
|
+
if (others.length > 0) {
|
|
2456
|
+
others.forEach((record) => {
|
|
2457
|
+
let guguCoins = 3;
|
|
2458
|
+
let gold = 500;
|
|
2440
2459
|
const hasDoubleWish = doubleWishHandles.has(record.handle);
|
|
2441
2460
|
if (hasDoubleWish) {
|
|
2442
2461
|
guguCoins *= 2;
|
|
2443
2462
|
gold *= 2;
|
|
2463
|
+
doubleWishOthers.push({
|
|
2464
|
+
playerName: record.playerName,
|
|
2465
|
+
guguCoins,
|
|
2466
|
+
gold
|
|
2467
|
+
});
|
|
2444
2468
|
}
|
|
2445
|
-
|
|
2446
|
-
if (isCleaner) {
|
|
2447
|
-
switch (true) {
|
|
2448
|
-
case rank === 1:
|
|
2449
|
-
redCrystal = 30;
|
|
2450
|
-
break;
|
|
2451
|
-
case rank === 2:
|
|
2452
|
-
redCrystal = 25;
|
|
2453
|
-
break;
|
|
2454
|
-
case rank === 3:
|
|
2455
|
-
redCrystal = 20;
|
|
2456
|
-
break;
|
|
2457
|
-
case rank <= 10:
|
|
2458
|
-
redCrystal = 15;
|
|
2459
|
-
break;
|
|
2460
|
-
case rank <= 20:
|
|
2461
|
-
redCrystal = 10;
|
|
2462
|
-
break;
|
|
2463
|
-
}
|
|
2464
|
-
}
|
|
2465
|
-
const reward = {
|
|
2469
|
+
rewardMap.set(record.handle, {
|
|
2466
2470
|
guguCoins,
|
|
2467
2471
|
gold,
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
let bonusNote = "";
|
|
2473
|
-
if (isCleaner && hasDoubleWish) {
|
|
2474
|
-
bonusNote = " (清洁工职业加成+精灵双倍祈愿)";
|
|
2475
|
-
} else if (isCleaner) {
|
|
2476
|
-
bonusNote = " (清洁工职业加成)";
|
|
2477
|
-
} else if (hasDoubleWish) {
|
|
2478
|
-
bonusNote = " (精灵双倍祈愿)";
|
|
2479
|
-
}
|
|
2480
|
-
rewardMessages.push(
|
|
2481
|
-
`${rank}. ${record.playerName}`,
|
|
2482
|
-
` 获得奖励: ${guguCoins} 咕咕币 + ${gold} 金币` + (redCrystal > 0 ? ` + ${redCrystal} 红晶` : "") + bonusNote
|
|
2483
|
-
);
|
|
2472
|
+
playerName: record.playerName,
|
|
2473
|
+
hasDoubleWish
|
|
2474
|
+
// 标记该记录使用了双倍祈愿
|
|
2475
|
+
});
|
|
2484
2476
|
});
|
|
2485
|
-
|
|
2486
|
-
if (
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
otherRewardNotes.push("精灵双倍祈愿金币和咕咕币奖励翻倍");
|
|
2493
|
-
}
|
|
2494
|
-
const noteText = otherRewardNotes.length > 0 ? ` (${otherRewardNotes.join(", ")})` : "";
|
|
2495
|
-
others.forEach((record) => {
|
|
2496
|
-
let guguCoins = 3;
|
|
2497
|
-
let gold = 500;
|
|
2498
|
-
const isCleaner = cleanerHandles.has(record.handle);
|
|
2499
|
-
const hasDoubleWish = doubleWishHandles.has(record.handle);
|
|
2500
|
-
if (hasDoubleWish) {
|
|
2501
|
-
guguCoins *= 2;
|
|
2502
|
-
gold *= 2;
|
|
2503
|
-
}
|
|
2504
|
-
const baseReward = {
|
|
2505
|
-
guguCoins,
|
|
2506
|
-
gold,
|
|
2507
|
-
redCrystal: isCleaner ? 3 : 0,
|
|
2508
|
-
playerName: record.playerName
|
|
2509
|
-
};
|
|
2510
|
-
rewardMap.set(record.handle, baseReward);
|
|
2477
|
+
rewardMessages.push(`其他参与者获得基础奖励: 3 咕咕币 + 500 金币`);
|
|
2478
|
+
if (doubleWishOthers.length > 0) {
|
|
2479
|
+
rewardMessages.push("🧝♀ 触发精灵双倍祈愿的参与者:");
|
|
2480
|
+
doubleWishOthers.forEach((player) => {
|
|
2481
|
+
rewardMessages.push(
|
|
2482
|
+
` ${player.playerName}: +${player.guguCoins} 咕咕币 +${player.gold} 金币`
|
|
2483
|
+
);
|
|
2511
2484
|
});
|
|
2512
|
-
rewardMessages.push(`其他参与者各获得: 3 咕咕币 + 500 金币${noteText}`);
|
|
2513
2485
|
}
|
|
2514
|
-
await ctx2.database.withTransaction(async () => {
|
|
2515
|
-
for (const [handle, reward] of rewardMap) {
|
|
2516
|
-
const [signData] = await ctx2.database.get("ggcevo_sign", { handle });
|
|
2517
|
-
await ctx2.database.upsert("ggcevo_sign", [{
|
|
2518
|
-
handle,
|
|
2519
|
-
totalRewards: (signData?.totalRewards || 0) + reward.gold
|
|
2520
|
-
}], ["handle"]);
|
|
2521
|
-
const [backpackData] = await ctx2.database.get("ggcevo_backpack", {
|
|
2522
|
-
handle,
|
|
2523
|
-
itemId: 1
|
|
2524
|
-
});
|
|
2525
|
-
await ctx2.database.upsert("ggcevo_backpack", [{
|
|
2526
|
-
handle,
|
|
2527
|
-
itemId: 1,
|
|
2528
|
-
quantity: (backpackData?.quantity || 0) + reward.guguCoins
|
|
2529
|
-
}], ["handle", "itemId"]);
|
|
2530
|
-
if (reward.redCrystal > 0) {
|
|
2531
|
-
const [careerData] = await ctx2.database.get("ggcevo_careers", { handle });
|
|
2532
|
-
await ctx2.database.upsert("ggcevo_careers", [{
|
|
2533
|
-
handle,
|
|
2534
|
-
redcrystal: (careerData?.redcrystal || 0) + reward.redCrystal
|
|
2535
|
-
}], ["handle"]);
|
|
2536
|
-
}
|
|
2537
|
-
}
|
|
2538
|
-
});
|
|
2539
2486
|
}
|
|
2487
|
+
await ctx2.database.withTransaction(async () => {
|
|
2488
|
+
for (const [handle, reward] of rewardMap) {
|
|
2489
|
+
const [signData] = await ctx2.database.get("ggcevo_sign", { handle });
|
|
2490
|
+
await ctx2.database.upsert("ggcevo_sign", [{
|
|
2491
|
+
handle,
|
|
2492
|
+
totalRewards: (signData?.totalRewards || 0) + reward.gold
|
|
2493
|
+
}], ["handle"]);
|
|
2494
|
+
const [backpackData] = await ctx2.database.get("ggcevo_backpack", {
|
|
2495
|
+
handle,
|
|
2496
|
+
itemId: 1
|
|
2497
|
+
});
|
|
2498
|
+
await ctx2.database.upsert("ggcevo_backpack", [{
|
|
2499
|
+
handle,
|
|
2500
|
+
itemId: 1,
|
|
2501
|
+
quantity: (backpackData?.quantity || 0) + reward.guguCoins
|
|
2502
|
+
}], ["handle", "itemId"]);
|
|
2503
|
+
}
|
|
2504
|
+
if (doubleWishIds.length > 0) {
|
|
2505
|
+
await ctx2.database.set("ggcevo_Wish_Record", { id: { $in: doubleWishIds } }, {
|
|
2506
|
+
isused: true
|
|
2507
|
+
// 将使用过的双倍祈愿标记为已使用
|
|
2508
|
+
});
|
|
2509
|
+
}
|
|
2510
|
+
});
|
|
2540
2511
|
return { rewardMessages };
|
|
2541
2512
|
}
|
|
2542
2513
|
__name(handleBossDefeatRewards, "handleBossDefeatRewards");
|
|
2514
|
+
async function getCleanerRewardBroadcast(ctx2, boss, killerHandle, killerName) {
|
|
2515
|
+
try {
|
|
2516
|
+
const bossType = boss.type;
|
|
2517
|
+
const bossName = boss.name;
|
|
2518
|
+
const baseReward = bossType === "主宰" ? 10 : 5;
|
|
2519
|
+
const allCleaners = await ctx2.database.get("ggcevo_careers", {
|
|
2520
|
+
career: "清洁工"
|
|
2521
|
+
});
|
|
2522
|
+
if (!allCleaners.length) return [];
|
|
2523
|
+
let killerBonus = false;
|
|
2524
|
+
for (const cleaner of allCleaners) {
|
|
2525
|
+
let rewardAmount = baseReward;
|
|
2526
|
+
if (cleaner.handle === killerHandle) {
|
|
2527
|
+
rewardAmount *= 2;
|
|
2528
|
+
killerBonus = true;
|
|
2529
|
+
}
|
|
2530
|
+
await ctx2.database.upsert("ggcevo_careers", [{
|
|
2531
|
+
handle: cleaner.handle,
|
|
2532
|
+
redcrystal: (cleaner.redcrystal || 0) + rewardAmount
|
|
2533
|
+
}], ["handle"]);
|
|
2534
|
+
}
|
|
2535
|
+
const rewardMessages = [
|
|
2536
|
+
`🧹 全体清洁工因清理 ${bossName} 尸体获得 ${baseReward} 红晶!`
|
|
2537
|
+
];
|
|
2538
|
+
if (killerBonus) {
|
|
2539
|
+
rewardMessages.push(`🎖️ ${killerName}(致命一击)获得双倍红晶奖励!`);
|
|
2540
|
+
}
|
|
2541
|
+
return rewardMessages;
|
|
2542
|
+
} catch (error) {
|
|
2543
|
+
ctx2.logger("ggcevo").warn("清洁工奖励发放失败", error);
|
|
2544
|
+
return [];
|
|
2545
|
+
}
|
|
2546
|
+
}
|
|
2547
|
+
__name(getCleanerRewardBroadcast, "getCleanerRewardBroadcast");
|
|
2543
2548
|
async function handleSecondaryTargets(ctx2, session, equippedWeapon, targetBoss, weaponName, weaponData, activeBosses, bossGroup) {
|
|
2544
2549
|
const scatterEffectMessages = [];
|
|
2545
2550
|
const extraDamages = [];
|
|
@@ -2566,6 +2571,7 @@ function apply(ctx, config) {
|
|
|
2566
2571
|
scatterEffectMessages.push(scatterMsg);
|
|
2567
2572
|
const baseDamage = weaponData.damage * (1 + 0.1 * equippedWeapon.level);
|
|
2568
2573
|
const secondaryDamage = Math.round(baseDamage * scatterRatio);
|
|
2574
|
+
const cleanerRewards = [];
|
|
2569
2575
|
for (const secondaryTarget of secondaryTargets) {
|
|
2570
2576
|
const secondaryMaxHP = getBossMaxHP(secondaryTarget.name);
|
|
2571
2577
|
let currentDamage = secondaryDamage;
|
|
@@ -2578,7 +2584,6 @@ function apply(ctx, config) {
|
|
|
2578
2584
|
weaponName,
|
|
2579
2585
|
weaponData,
|
|
2580
2586
|
secondaryTargets,
|
|
2581
|
-
// 传入所有次要目标作为上下文
|
|
2582
2587
|
bossGroup
|
|
2583
2588
|
);
|
|
2584
2589
|
const finalDamage = passiveResult.initialDamage;
|
|
@@ -2605,6 +2610,41 @@ function apply(ctx, config) {
|
|
|
2605
2610
|
);
|
|
2606
2611
|
if (isDead) {
|
|
2607
2612
|
actuallyDead.push(secondaryTarget.name);
|
|
2613
|
+
const handle = equippedWeapon.handle;
|
|
2614
|
+
const playerName = session.username;
|
|
2615
|
+
const bossType = secondaryTarget.type;
|
|
2616
|
+
const bossName = secondaryTarget.name;
|
|
2617
|
+
const baseReward = bossType === "主宰" ? 10 : 5;
|
|
2618
|
+
const allCleaners = await ctx2.database.get("ggcevo_careers", {
|
|
2619
|
+
career: "清洁工"
|
|
2620
|
+
});
|
|
2621
|
+
if (allCleaners.length > 0) {
|
|
2622
|
+
let killerBonus = false;
|
|
2623
|
+
for (const cleaner of allCleaners) {
|
|
2624
|
+
let rewardAmount = baseReward;
|
|
2625
|
+
if (cleaner.handle === handle) {
|
|
2626
|
+
rewardAmount *= 2;
|
|
2627
|
+
killerBonus = true;
|
|
2628
|
+
}
|
|
2629
|
+
await ctx2.database.upsert("ggcevo_careers", [{
|
|
2630
|
+
handle: cleaner.handle,
|
|
2631
|
+
redcrystal: (cleaner.redcrystal || 0) + rewardAmount
|
|
2632
|
+
}], ["handle"]);
|
|
2633
|
+
}
|
|
2634
|
+
let rewardMsg = `🧹 全体清洁工因清理 ${bossName} 尸体获得 ${baseReward} 红晶!`;
|
|
2635
|
+
if (killerBonus) {
|
|
2636
|
+
rewardMsg += `
|
|
2637
|
+
🎖️ ${playerName}(致命一击)获得双倍红晶奖励!`;
|
|
2638
|
+
}
|
|
2639
|
+
if (!scatterBroadcast) {
|
|
2640
|
+
scatterBroadcast = [];
|
|
2641
|
+
}
|
|
2642
|
+
if (Array.isArray(scatterBroadcast)) {
|
|
2643
|
+
scatterBroadcast.push(rewardMsg);
|
|
2644
|
+
} else {
|
|
2645
|
+
scatterBroadcast = [rewardMsg];
|
|
2646
|
+
}
|
|
2647
|
+
}
|
|
2608
2648
|
if (secondaryTarget.type === "子代") {
|
|
2609
2649
|
if (secondaryTarget.name === "机械感染虫") {
|
|
2610
2650
|
const [mainBoss] = await ctx2.database.get("ggcevo_boss", {
|
|
@@ -2616,7 +2656,14 @@ function apply(ctx, config) {
|
|
|
2616
2656
|
await ctx2.database.set("ggcevo_boss", { name: mainBoss.name }, {
|
|
2617
2657
|
skills: [...mainBoss.skills, "孤立无援"]
|
|
2618
2658
|
});
|
|
2619
|
-
|
|
2659
|
+
const isolationMsg = "💥 机械感染虫已阵亡,空间站感染虫进入【孤立无援】状态,受到的伤害+20%!";
|
|
2660
|
+
if (!scatterBroadcast) {
|
|
2661
|
+
scatterBroadcast = isolationMsg;
|
|
2662
|
+
} else if (Array.isArray(scatterBroadcast)) {
|
|
2663
|
+
scatterBroadcast.push(isolationMsg);
|
|
2664
|
+
} else {
|
|
2665
|
+
scatterBroadcast = [scatterBroadcast, isolationMsg];
|
|
2666
|
+
}
|
|
2620
2667
|
}
|
|
2621
2668
|
} else {
|
|
2622
2669
|
const remainingMinions = await ctx2.database.get("ggcevo_boss", {
|
|
@@ -2634,7 +2681,14 @@ function apply(ctx, config) {
|
|
|
2634
2681
|
await ctx2.database.set("ggcevo_boss", { name: mainBoss.name }, {
|
|
2635
2682
|
skills: [...mainBoss.skills, "孤立无援"]
|
|
2636
2683
|
});
|
|
2637
|
-
|
|
2684
|
+
const isolationMsg = `💥 所有子代已阵亡,${mainBoss.name}进入【孤立无援】状态,受到的伤害+20%!`;
|
|
2685
|
+
if (!scatterBroadcast) {
|
|
2686
|
+
scatterBroadcast = isolationMsg;
|
|
2687
|
+
} else if (Array.isArray(scatterBroadcast)) {
|
|
2688
|
+
scatterBroadcast.push(isolationMsg);
|
|
2689
|
+
} else {
|
|
2690
|
+
scatterBroadcast = [scatterBroadcast, isolationMsg];
|
|
2691
|
+
}
|
|
2638
2692
|
}
|
|
2639
2693
|
}
|
|
2640
2694
|
}
|
|
@@ -2655,13 +2709,20 @@ function apply(ctx, config) {
|
|
|
2655
2709
|
await ctx2.database.remove("ggcevo_boss_damage", {
|
|
2656
2710
|
bossGroupId: secondaryTarget.groupId
|
|
2657
2711
|
});
|
|
2658
|
-
|
|
2712
|
+
const defeatMsg = [
|
|
2659
2713
|
`🎯 主宰 ${secondaryTarget.name} 已被 ${session.username} 的散射伤害击败!`,
|
|
2660
2714
|
`所有子代已消失,下一个主宰将在1小时后重生`,
|
|
2661
2715
|
"",
|
|
2662
2716
|
"🏆 伤害排行榜奖励:",
|
|
2663
2717
|
...rewardMessages
|
|
2664
2718
|
];
|
|
2719
|
+
if (!scatterBroadcast) {
|
|
2720
|
+
scatterBroadcast = defeatMsg;
|
|
2721
|
+
} else if (Array.isArray(scatterBroadcast)) {
|
|
2722
|
+
scatterBroadcast.push(...defeatMsg);
|
|
2723
|
+
} else {
|
|
2724
|
+
scatterBroadcast = [scatterBroadcast, ...defeatMsg];
|
|
2725
|
+
}
|
|
2665
2726
|
}
|
|
2666
2727
|
}
|
|
2667
2728
|
}
|
|
@@ -4716,10 +4777,10 @@ ${items.join("、")}
|
|
|
4716
4777
|
`🎰 金币变动:${stealPercentage}%`
|
|
4717
4778
|
];
|
|
4718
4779
|
if (targetCareer.group === "人类联盟" && isWin) {
|
|
4719
|
-
result.push(`🛡️ 人类联盟保护:${targetRankname}
|
|
4780
|
+
result.push(`🛡️ 人类联盟保护:${targetRankname} 被动应战的PK失败时仅损失1%的金币`);
|
|
4720
4781
|
}
|
|
4721
4782
|
if (computerExpertProtection) {
|
|
4722
|
-
result.push(`💻 计算机专家职业加成:${targetRankname}
|
|
4783
|
+
result.push(`💻 计算机专家职业加成:${targetRankname} 被动应战的PK失败时不损失金币`);
|
|
4723
4784
|
} else if (isWin) {
|
|
4724
4785
|
result.push(`💰 您从对方的口袋里抢夺了${goldTransfer}枚金币`);
|
|
4725
4786
|
} else {
|
|
@@ -5269,8 +5330,9 @@ ${validTypes.join("、")}`;
|
|
|
5269
5330
|
});
|
|
5270
5331
|
ctx.command("ggcevo/攻击 <bossName>").usage("请输入要攻击的异形名称(例如:攻击 异齿猛兽 或 攻击 寒冰王蛇)").action(async (argv, bossName) => {
|
|
5271
5332
|
const session = argv.session;
|
|
5272
|
-
let
|
|
5333
|
+
let bossEventBroadcast = null;
|
|
5273
5334
|
let scatterBroadcast = null;
|
|
5335
|
+
let cleanerRewardBroadcast = null;
|
|
5274
5336
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
5275
5337
|
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
5276
5338
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
@@ -5431,13 +5493,19 @@ ${validTypes.join("、")}`;
|
|
|
5431
5493
|
await ctx.database.remove("ggcevo_boss_damage", {
|
|
5432
5494
|
bossGroupId: targetBoss.groupId
|
|
5433
5495
|
});
|
|
5434
|
-
|
|
5496
|
+
bossEventBroadcast = [
|
|
5435
5497
|
`🎯 主宰 ${targetBoss.name} 已被 ${session.username} 击败!`,
|
|
5436
5498
|
`所有子代已消失,下一个主宰将在1小时后重生`,
|
|
5437
5499
|
"",
|
|
5438
5500
|
"🏆 伤害排行榜奖励:",
|
|
5439
5501
|
...rewardMessages
|
|
5440
5502
|
];
|
|
5503
|
+
cleanerRewardBroadcast = await getCleanerRewardBroadcast(
|
|
5504
|
+
ctx,
|
|
5505
|
+
targetBoss,
|
|
5506
|
+
handle,
|
|
5507
|
+
session.username
|
|
5508
|
+
);
|
|
5441
5509
|
} else {
|
|
5442
5510
|
await ctx.database.set(
|
|
5443
5511
|
"ggcevo_boss",
|
|
@@ -5447,12 +5515,12 @@ ${validTypes.join("、")}`;
|
|
|
5447
5515
|
HP: 0
|
|
5448
5516
|
}
|
|
5449
5517
|
);
|
|
5450
|
-
const
|
|
5518
|
+
const groupId2 = targetBoss.groupId;
|
|
5451
5519
|
let remainingMinions = [];
|
|
5452
|
-
let
|
|
5520
|
+
let broadcastMessages2 = [];
|
|
5453
5521
|
if (targetBoss.name === "机械感染虫") {
|
|
5454
5522
|
const [mainBoss] = await ctx.database.get("ggcevo_boss", {
|
|
5455
|
-
groupId,
|
|
5523
|
+
groupId: groupId2,
|
|
5456
5524
|
type: "主宰",
|
|
5457
5525
|
isActive: true
|
|
5458
5526
|
});
|
|
@@ -5460,17 +5528,17 @@ ${validTypes.join("、")}`;
|
|
|
5460
5528
|
await ctx.database.set("ggcevo_boss", { name: mainBoss.name }, {
|
|
5461
5529
|
skills: [...mainBoss.skills, "孤立无援"]
|
|
5462
5530
|
});
|
|
5463
|
-
|
|
5531
|
+
broadcastMessages2.push("💥 机械感染虫已阵亡,空间站感染虫进入【孤立无援】状态,受到的伤害+20%!");
|
|
5464
5532
|
}
|
|
5465
5533
|
} else {
|
|
5466
5534
|
remainingMinions = await ctx.database.get("ggcevo_boss", {
|
|
5467
|
-
groupId,
|
|
5535
|
+
groupId: groupId2,
|
|
5468
5536
|
type: "子代",
|
|
5469
5537
|
isActive: true
|
|
5470
5538
|
});
|
|
5471
5539
|
if (remainingMinions.length === 0) {
|
|
5472
5540
|
const [mainBoss] = await ctx.database.get("ggcevo_boss", {
|
|
5473
|
-
groupId,
|
|
5541
|
+
groupId: groupId2,
|
|
5474
5542
|
type: "主宰",
|
|
5475
5543
|
isActive: true
|
|
5476
5544
|
});
|
|
@@ -5478,11 +5546,17 @@ ${validTypes.join("、")}`;
|
|
|
5478
5546
|
await ctx.database.set("ggcevo_boss", { name: mainBoss.name }, {
|
|
5479
5547
|
skills: [...mainBoss.skills, "孤立无援"]
|
|
5480
5548
|
});
|
|
5481
|
-
|
|
5549
|
+
broadcastMessages2.push(`💥 所有子代已阵亡,${mainBoss.name}进入【孤立无援】状态,受到的伤害+20%!`);
|
|
5482
5550
|
}
|
|
5483
5551
|
}
|
|
5484
5552
|
}
|
|
5485
|
-
|
|
5553
|
+
bossEventBroadcast = broadcastMessages2;
|
|
5554
|
+
cleanerRewardBroadcast = await getCleanerRewardBroadcast(
|
|
5555
|
+
ctx,
|
|
5556
|
+
targetBoss,
|
|
5557
|
+
handle,
|
|
5558
|
+
session.username
|
|
5559
|
+
);
|
|
5486
5560
|
}
|
|
5487
5561
|
} else {
|
|
5488
5562
|
await ctx.database.set(
|
|
@@ -5571,12 +5645,21 @@ ${scatterEffectMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5571
5645
|
isDefeated ? `🎉 恭喜,已成功击败 ${targetBoss.name}!` : ""
|
|
5572
5646
|
].filter((line) => line).join("\n");
|
|
5573
5647
|
await session.send(resultMessage);
|
|
5648
|
+
const broadcastMessages = [];
|
|
5649
|
+
const groupId = [...config2.groupId];
|
|
5574
5650
|
if (scatterBroadcast) {
|
|
5575
|
-
const
|
|
5576
|
-
|
|
5577
|
-
}
|
|
5578
|
-
|
|
5579
|
-
|
|
5651
|
+
const scatterMsg = Array.isArray(scatterBroadcast) ? scatterBroadcast.join("\n") : scatterBroadcast;
|
|
5652
|
+
broadcastMessages.push(scatterMsg);
|
|
5653
|
+
}
|
|
5654
|
+
if (bossEventBroadcast) {
|
|
5655
|
+
const bossMsg = Array.isArray(bossEventBroadcast) ? bossEventBroadcast.join("\n") : bossEventBroadcast;
|
|
5656
|
+
broadcastMessages.push(bossMsg);
|
|
5657
|
+
}
|
|
5658
|
+
if (cleanerRewardBroadcast && cleanerRewardBroadcast.length > 0) {
|
|
5659
|
+
broadcastMessages.push(cleanerRewardBroadcast.join("\n"));
|
|
5660
|
+
}
|
|
5661
|
+
if (broadcastMessages.length > 0) {
|
|
5662
|
+
await ctx.broadcast(groupId, broadcastMessages.join("\n\n"));
|
|
5580
5663
|
}
|
|
5581
5664
|
});
|
|
5582
5665
|
ctx.command("ggcevo/攻击假人").option("tags", "-t <tags:string> 添加BOSS标签(逗号分隔)").action(async (argv) => {
|