koishi-plugin-ggcevo-game 1.3.58 → 1.3.60
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 +229 -158
- 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,
|
|
@@ -556,11 +556,11 @@ function apply(ctx, config) {
|
|
|
556
556
|
common: [
|
|
557
557
|
{
|
|
558
558
|
name: "蚱蜢优购",
|
|
559
|
-
effect: "
|
|
559
|
+
effect: "下一次购买武器享有20%的折扣"
|
|
560
560
|
},
|
|
561
561
|
{
|
|
562
562
|
name: "灵狐升运",
|
|
563
|
-
effect: "
|
|
563
|
+
effect: "下一次升级武器享有20%的折扣"
|
|
564
564
|
},
|
|
565
565
|
{
|
|
566
566
|
name: "王权增幅",
|
|
@@ -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,144 @@ 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
|
-
ctx2.database.get("ggcevo_Wish_Record", {
|
|
2407
|
-
handle: { $in: handles },
|
|
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
|
+
});
|
|
2415
2409
|
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
|
-
|
|
2410
|
+
const top20 = damageRecords.slice(0, 20);
|
|
2411
|
+
top20.forEach((record, index) => {
|
|
2412
|
+
const rank = index + 1;
|
|
2413
|
+
let guguCoins = 10, gold = 1e3;
|
|
2414
|
+
switch (true) {
|
|
2415
|
+
case rank === 1:
|
|
2416
|
+
guguCoins = 30;
|
|
2417
|
+
gold = 3e3;
|
|
2418
|
+
break;
|
|
2419
|
+
case rank === 2:
|
|
2420
|
+
guguCoins = 25;
|
|
2421
|
+
gold = 2500;
|
|
2422
|
+
break;
|
|
2423
|
+
case rank === 3:
|
|
2424
|
+
guguCoins = 20;
|
|
2425
|
+
gold = 2e3;
|
|
2426
|
+
break;
|
|
2427
|
+
case rank <= 10:
|
|
2428
|
+
guguCoins = 15;
|
|
2429
|
+
gold = 1500;
|
|
2430
|
+
break;
|
|
2431
|
+
}
|
|
2432
|
+
const hasDoubleWish = doubleWishHandles.has(record.handle);
|
|
2433
|
+
if (hasDoubleWish) {
|
|
2434
|
+
guguCoins *= 2;
|
|
2435
|
+
gold *= 2;
|
|
2436
|
+
}
|
|
2437
|
+
const reward = {
|
|
2438
|
+
guguCoins,
|
|
2439
|
+
gold,
|
|
2440
|
+
playerName: record.playerName
|
|
2441
|
+
};
|
|
2442
|
+
rewardMap.set(record.handle, reward);
|
|
2443
|
+
const bonusNote = hasDoubleWish ? " (🧝♀ 精灵双倍祈愿生效)" : "";
|
|
2444
|
+
rewardMessages.push(
|
|
2445
|
+
`${rank}. ${record.playerName}`,
|
|
2446
|
+
` 获得奖励: ${guguCoins} 咕咕币 + ${gold} 金币${bonusNote}`
|
|
2447
|
+
);
|
|
2448
|
+
});
|
|
2449
|
+
const others = damageRecords.slice(20);
|
|
2450
|
+
const doubleWishOthers = [];
|
|
2451
|
+
if (others.length > 0) {
|
|
2452
|
+
others.forEach((record) => {
|
|
2453
|
+
let guguCoins = 3;
|
|
2454
|
+
let gold = 500;
|
|
2440
2455
|
const hasDoubleWish = doubleWishHandles.has(record.handle);
|
|
2441
2456
|
if (hasDoubleWish) {
|
|
2442
2457
|
guguCoins *= 2;
|
|
2443
2458
|
gold *= 2;
|
|
2459
|
+
doubleWishOthers.push({
|
|
2460
|
+
playerName: record.playerName,
|
|
2461
|
+
guguCoins,
|
|
2462
|
+
gold
|
|
2463
|
+
});
|
|
2444
2464
|
}
|
|
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 = {
|
|
2465
|
+
rewardMap.set(record.handle, {
|
|
2466
2466
|
guguCoins,
|
|
2467
2467
|
gold,
|
|
2468
|
-
redCrystal,
|
|
2469
2468
|
playerName: record.playerName
|
|
2470
|
-
};
|
|
2471
|
-
rewardMap.set(record.handle, reward);
|
|
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
|
-
);
|
|
2469
|
+
});
|
|
2484
2470
|
});
|
|
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);
|
|
2471
|
+
rewardMessages.push(`其他参与者获得基础奖励: 3 咕咕币 + 500 金币`);
|
|
2472
|
+
if (doubleWishOthers.length > 0) {
|
|
2473
|
+
rewardMessages.push("🧝♀ 触发精灵双倍祈愿的参与者:");
|
|
2474
|
+
doubleWishOthers.forEach((player) => {
|
|
2475
|
+
rewardMessages.push(
|
|
2476
|
+
` ${player.playerName}: +${player.guguCoins} 咕咕币 +${player.gold} 金币`
|
|
2477
|
+
);
|
|
2511
2478
|
});
|
|
2512
|
-
rewardMessages.push(`其他参与者各获得: 3 咕咕币 + 500 金币${noteText}`);
|
|
2513
2479
|
}
|
|
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
2480
|
}
|
|
2481
|
+
await ctx2.database.withTransaction(async () => {
|
|
2482
|
+
for (const [handle, reward] of rewardMap) {
|
|
2483
|
+
const [signData] = await ctx2.database.get("ggcevo_sign", { handle });
|
|
2484
|
+
await ctx2.database.upsert("ggcevo_sign", [{
|
|
2485
|
+
handle,
|
|
2486
|
+
totalRewards: (signData?.totalRewards || 0) + reward.gold
|
|
2487
|
+
}], ["handle"]);
|
|
2488
|
+
const [backpackData] = await ctx2.database.get("ggcevo_backpack", {
|
|
2489
|
+
handle,
|
|
2490
|
+
itemId: 1
|
|
2491
|
+
});
|
|
2492
|
+
await ctx2.database.upsert("ggcevo_backpack", [{
|
|
2493
|
+
handle,
|
|
2494
|
+
itemId: 1,
|
|
2495
|
+
quantity: (backpackData?.quantity || 0) + reward.guguCoins
|
|
2496
|
+
}], ["handle", "itemId"]);
|
|
2497
|
+
}
|
|
2498
|
+
});
|
|
2540
2499
|
return { rewardMessages };
|
|
2541
2500
|
}
|
|
2542
2501
|
__name(handleBossDefeatRewards, "handleBossDefeatRewards");
|
|
2502
|
+
async function getCleanerRewardBroadcast(ctx2, boss, killerHandle, killerName) {
|
|
2503
|
+
try {
|
|
2504
|
+
const bossType = boss.type;
|
|
2505
|
+
const bossName = boss.name;
|
|
2506
|
+
const baseReward = bossType === "主宰" ? 10 : 5;
|
|
2507
|
+
const allCleaners = await ctx2.database.get("ggcevo_careers", {
|
|
2508
|
+
career: "清洁工"
|
|
2509
|
+
});
|
|
2510
|
+
if (!allCleaners.length) return [];
|
|
2511
|
+
let killerBonus = false;
|
|
2512
|
+
for (const cleaner of allCleaners) {
|
|
2513
|
+
let rewardAmount = baseReward;
|
|
2514
|
+
if (cleaner.handle === killerHandle) {
|
|
2515
|
+
rewardAmount *= 2;
|
|
2516
|
+
killerBonus = true;
|
|
2517
|
+
}
|
|
2518
|
+
await ctx2.database.upsert("ggcevo_careers", [{
|
|
2519
|
+
handle: cleaner.handle,
|
|
2520
|
+
redcrystal: (cleaner.redcrystal || 0) + rewardAmount
|
|
2521
|
+
}], ["handle"]);
|
|
2522
|
+
}
|
|
2523
|
+
const rewardMessages = [
|
|
2524
|
+
`🧹 全体清洁工因清理 ${bossName} 尸体获得 ${baseReward} 红晶!`
|
|
2525
|
+
];
|
|
2526
|
+
if (killerBonus) {
|
|
2527
|
+
rewardMessages.push(`🎖️ ${killerName}(致命一击)获得双倍红晶奖励!`);
|
|
2528
|
+
}
|
|
2529
|
+
return rewardMessages;
|
|
2530
|
+
} catch (error) {
|
|
2531
|
+
ctx2.logger("ggcevo").warn("清洁工奖励发放失败", error);
|
|
2532
|
+
return [];
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
__name(getCleanerRewardBroadcast, "getCleanerRewardBroadcast");
|
|
2543
2536
|
async function handleSecondaryTargets(ctx2, session, equippedWeapon, targetBoss, weaponName, weaponData, activeBosses, bossGroup) {
|
|
2544
2537
|
const scatterEffectMessages = [];
|
|
2545
2538
|
const extraDamages = [];
|
|
@@ -2566,6 +2559,7 @@ function apply(ctx, config) {
|
|
|
2566
2559
|
scatterEffectMessages.push(scatterMsg);
|
|
2567
2560
|
const baseDamage = weaponData.damage * (1 + 0.1 * equippedWeapon.level);
|
|
2568
2561
|
const secondaryDamage = Math.round(baseDamage * scatterRatio);
|
|
2562
|
+
const cleanerRewards = [];
|
|
2569
2563
|
for (const secondaryTarget of secondaryTargets) {
|
|
2570
2564
|
const secondaryMaxHP = getBossMaxHP(secondaryTarget.name);
|
|
2571
2565
|
let currentDamage = secondaryDamage;
|
|
@@ -2578,7 +2572,6 @@ function apply(ctx, config) {
|
|
|
2578
2572
|
weaponName,
|
|
2579
2573
|
weaponData,
|
|
2580
2574
|
secondaryTargets,
|
|
2581
|
-
// 传入所有次要目标作为上下文
|
|
2582
2575
|
bossGroup
|
|
2583
2576
|
);
|
|
2584
2577
|
const finalDamage = passiveResult.initialDamage;
|
|
@@ -2605,6 +2598,41 @@ function apply(ctx, config) {
|
|
|
2605
2598
|
);
|
|
2606
2599
|
if (isDead) {
|
|
2607
2600
|
actuallyDead.push(secondaryTarget.name);
|
|
2601
|
+
const handle = equippedWeapon.handle;
|
|
2602
|
+
const playerName = session.username;
|
|
2603
|
+
const bossType = secondaryTarget.type;
|
|
2604
|
+
const bossName = secondaryTarget.name;
|
|
2605
|
+
const baseReward = bossType === "主宰" ? 10 : 5;
|
|
2606
|
+
const allCleaners = await ctx2.database.get("ggcevo_careers", {
|
|
2607
|
+
career: "清洁工"
|
|
2608
|
+
});
|
|
2609
|
+
if (allCleaners.length > 0) {
|
|
2610
|
+
let killerBonus = false;
|
|
2611
|
+
for (const cleaner of allCleaners) {
|
|
2612
|
+
let rewardAmount = baseReward;
|
|
2613
|
+
if (cleaner.handle === handle) {
|
|
2614
|
+
rewardAmount *= 2;
|
|
2615
|
+
killerBonus = true;
|
|
2616
|
+
}
|
|
2617
|
+
await ctx2.database.upsert("ggcevo_careers", [{
|
|
2618
|
+
handle: cleaner.handle,
|
|
2619
|
+
redcrystal: (cleaner.redcrystal || 0) + rewardAmount
|
|
2620
|
+
}], ["handle"]);
|
|
2621
|
+
}
|
|
2622
|
+
let rewardMsg = `🧹 全体清洁工因清理 ${bossName} 尸体获得 ${baseReward} 红晶!`;
|
|
2623
|
+
if (killerBonus) {
|
|
2624
|
+
rewardMsg += `
|
|
2625
|
+
🎖️ ${playerName}(致命一击)获得双倍红晶奖励!`;
|
|
2626
|
+
}
|
|
2627
|
+
if (!scatterBroadcast) {
|
|
2628
|
+
scatterBroadcast = [];
|
|
2629
|
+
}
|
|
2630
|
+
if (Array.isArray(scatterBroadcast)) {
|
|
2631
|
+
scatterBroadcast.push(rewardMsg);
|
|
2632
|
+
} else {
|
|
2633
|
+
scatterBroadcast = [rewardMsg];
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2608
2636
|
if (secondaryTarget.type === "子代") {
|
|
2609
2637
|
if (secondaryTarget.name === "机械感染虫") {
|
|
2610
2638
|
const [mainBoss] = await ctx2.database.get("ggcevo_boss", {
|
|
@@ -2616,7 +2644,14 @@ function apply(ctx, config) {
|
|
|
2616
2644
|
await ctx2.database.set("ggcevo_boss", { name: mainBoss.name }, {
|
|
2617
2645
|
skills: [...mainBoss.skills, "孤立无援"]
|
|
2618
2646
|
});
|
|
2619
|
-
|
|
2647
|
+
const isolationMsg = "💥 机械感染虫已阵亡,空间站感染虫进入【孤立无援】状态,受到的伤害+20%!";
|
|
2648
|
+
if (!scatterBroadcast) {
|
|
2649
|
+
scatterBroadcast = isolationMsg;
|
|
2650
|
+
} else if (Array.isArray(scatterBroadcast)) {
|
|
2651
|
+
scatterBroadcast.push(isolationMsg);
|
|
2652
|
+
} else {
|
|
2653
|
+
scatterBroadcast = [scatterBroadcast, isolationMsg];
|
|
2654
|
+
}
|
|
2620
2655
|
}
|
|
2621
2656
|
} else {
|
|
2622
2657
|
const remainingMinions = await ctx2.database.get("ggcevo_boss", {
|
|
@@ -2634,7 +2669,14 @@ function apply(ctx, config) {
|
|
|
2634
2669
|
await ctx2.database.set("ggcevo_boss", { name: mainBoss.name }, {
|
|
2635
2670
|
skills: [...mainBoss.skills, "孤立无援"]
|
|
2636
2671
|
});
|
|
2637
|
-
|
|
2672
|
+
const isolationMsg = `💥 所有子代已阵亡,${mainBoss.name}进入【孤立无援】状态,受到的伤害+20%!`;
|
|
2673
|
+
if (!scatterBroadcast) {
|
|
2674
|
+
scatterBroadcast = isolationMsg;
|
|
2675
|
+
} else if (Array.isArray(scatterBroadcast)) {
|
|
2676
|
+
scatterBroadcast.push(isolationMsg);
|
|
2677
|
+
} else {
|
|
2678
|
+
scatterBroadcast = [scatterBroadcast, isolationMsg];
|
|
2679
|
+
}
|
|
2638
2680
|
}
|
|
2639
2681
|
}
|
|
2640
2682
|
}
|
|
@@ -2655,13 +2697,20 @@ function apply(ctx, config) {
|
|
|
2655
2697
|
await ctx2.database.remove("ggcevo_boss_damage", {
|
|
2656
2698
|
bossGroupId: secondaryTarget.groupId
|
|
2657
2699
|
});
|
|
2658
|
-
|
|
2700
|
+
const defeatMsg = [
|
|
2659
2701
|
`🎯 主宰 ${secondaryTarget.name} 已被 ${session.username} 的散射伤害击败!`,
|
|
2660
2702
|
`所有子代已消失,下一个主宰将在1小时后重生`,
|
|
2661
2703
|
"",
|
|
2662
2704
|
"🏆 伤害排行榜奖励:",
|
|
2663
2705
|
...rewardMessages
|
|
2664
2706
|
];
|
|
2707
|
+
if (!scatterBroadcast) {
|
|
2708
|
+
scatterBroadcast = defeatMsg;
|
|
2709
|
+
} else if (Array.isArray(scatterBroadcast)) {
|
|
2710
|
+
scatterBroadcast.push(...defeatMsg);
|
|
2711
|
+
} else {
|
|
2712
|
+
scatterBroadcast = [scatterBroadcast, ...defeatMsg];
|
|
2713
|
+
}
|
|
2665
2714
|
}
|
|
2666
2715
|
}
|
|
2667
2716
|
}
|
|
@@ -4492,7 +4541,7 @@ ${items.join("、")}
|
|
|
4492
4541
|
const initiatorPower = await calculateTotalPower(initiatorHandle);
|
|
4493
4542
|
const targetPower = await calculateTotalPower(targetHandle);
|
|
4494
4543
|
const initiatorRankname = session.username;
|
|
4495
|
-
const targetRankname = targetUsername.nick || targetUsername.name;
|
|
4544
|
+
const targetRankname = targetUsername.nick || targetUsername.user.name;
|
|
4496
4545
|
const [initiatorCareer] = await ctx.database.get("ggcevo_careers", {
|
|
4497
4546
|
handle: initiatorHandle
|
|
4498
4547
|
});
|
|
@@ -4707,19 +4756,19 @@ ${items.join("、")}
|
|
|
4707
4756
|
const result = [
|
|
4708
4757
|
`⚔️【对战结果】${isWin ? "胜利" : "失败"}`,
|
|
4709
4758
|
`🏅 挑战者:${initiatorRankname}(战斗力 ${initiatorPower})`,
|
|
4710
|
-
|
|
4759
|
+
`💼 职业:${initiatorCareer?.career || "无"}`,
|
|
4711
4760
|
// 显示职业
|
|
4712
4761
|
`🛡️ 应战者:${targetRankname}(战斗力 ${targetPower})`,
|
|
4713
|
-
|
|
4762
|
+
`💼 职业:${targetCareer?.career || "无"}`,
|
|
4714
4763
|
// 显示职业
|
|
4715
4764
|
`📊 胜率预测:${winRate.toFixed(1)}%`,
|
|
4716
4765
|
`🎰 金币变动:${stealPercentage}%`
|
|
4717
4766
|
];
|
|
4718
4767
|
if (targetCareer.group === "人类联盟" && isWin) {
|
|
4719
|
-
result.push(`🛡️ 人类联盟保护:${targetRankname}
|
|
4768
|
+
result.push(`🛡️ 人类联盟保护:${targetRankname} 被动应战的PK失败时仅损失1%的金币`);
|
|
4720
4769
|
}
|
|
4721
4770
|
if (computerExpertProtection) {
|
|
4722
|
-
result.push(`💻 计算机专家职业加成:${targetRankname}
|
|
4771
|
+
result.push(`💻 计算机专家职业加成:${targetRankname} 被动应战的PK失败时不损失金币`);
|
|
4723
4772
|
} else if (isWin) {
|
|
4724
4773
|
result.push(`💰 您从对方的口袋里抢夺了${goldTransfer}枚金币`);
|
|
4725
4774
|
} else {
|
|
@@ -5269,8 +5318,9 @@ ${validTypes.join("、")}`;
|
|
|
5269
5318
|
});
|
|
5270
5319
|
ctx.command("ggcevo/攻击 <bossName>").usage("请输入要攻击的异形名称(例如:攻击 异齿猛兽 或 攻击 寒冰王蛇)").action(async (argv, bossName) => {
|
|
5271
5320
|
const session = argv.session;
|
|
5272
|
-
let
|
|
5321
|
+
let bossEventBroadcast = null;
|
|
5273
5322
|
let scatterBroadcast = null;
|
|
5323
|
+
let cleanerRewardBroadcast = null;
|
|
5274
5324
|
const [profile] = await ctx.database.get("sc2arcade_player", { userId: session.userId });
|
|
5275
5325
|
if (!profile) return "🔒 需要先绑定游戏句柄";
|
|
5276
5326
|
const handle = `${profile.regionId}-S2-${profile.realmId}-${profile.profileId}`;
|
|
@@ -5431,13 +5481,19 @@ ${validTypes.join("、")}`;
|
|
|
5431
5481
|
await ctx.database.remove("ggcevo_boss_damage", {
|
|
5432
5482
|
bossGroupId: targetBoss.groupId
|
|
5433
5483
|
});
|
|
5434
|
-
|
|
5484
|
+
bossEventBroadcast = [
|
|
5435
5485
|
`🎯 主宰 ${targetBoss.name} 已被 ${session.username} 击败!`,
|
|
5436
5486
|
`所有子代已消失,下一个主宰将在1小时后重生`,
|
|
5437
5487
|
"",
|
|
5438
5488
|
"🏆 伤害排行榜奖励:",
|
|
5439
5489
|
...rewardMessages
|
|
5440
5490
|
];
|
|
5491
|
+
cleanerRewardBroadcast = await getCleanerRewardBroadcast(
|
|
5492
|
+
ctx,
|
|
5493
|
+
targetBoss,
|
|
5494
|
+
handle,
|
|
5495
|
+
session.username
|
|
5496
|
+
);
|
|
5441
5497
|
} else {
|
|
5442
5498
|
await ctx.database.set(
|
|
5443
5499
|
"ggcevo_boss",
|
|
@@ -5447,12 +5503,12 @@ ${validTypes.join("、")}`;
|
|
|
5447
5503
|
HP: 0
|
|
5448
5504
|
}
|
|
5449
5505
|
);
|
|
5450
|
-
const
|
|
5506
|
+
const groupId2 = targetBoss.groupId;
|
|
5451
5507
|
let remainingMinions = [];
|
|
5452
|
-
let
|
|
5508
|
+
let broadcastMessages2 = [];
|
|
5453
5509
|
if (targetBoss.name === "机械感染虫") {
|
|
5454
5510
|
const [mainBoss] = await ctx.database.get("ggcevo_boss", {
|
|
5455
|
-
groupId,
|
|
5511
|
+
groupId: groupId2,
|
|
5456
5512
|
type: "主宰",
|
|
5457
5513
|
isActive: true
|
|
5458
5514
|
});
|
|
@@ -5460,17 +5516,17 @@ ${validTypes.join("、")}`;
|
|
|
5460
5516
|
await ctx.database.set("ggcevo_boss", { name: mainBoss.name }, {
|
|
5461
5517
|
skills: [...mainBoss.skills, "孤立无援"]
|
|
5462
5518
|
});
|
|
5463
|
-
|
|
5519
|
+
broadcastMessages2.push("💥 机械感染虫已阵亡,空间站感染虫进入【孤立无援】状态,受到的伤害+20%!");
|
|
5464
5520
|
}
|
|
5465
5521
|
} else {
|
|
5466
5522
|
remainingMinions = await ctx.database.get("ggcevo_boss", {
|
|
5467
|
-
groupId,
|
|
5523
|
+
groupId: groupId2,
|
|
5468
5524
|
type: "子代",
|
|
5469
5525
|
isActive: true
|
|
5470
5526
|
});
|
|
5471
5527
|
if (remainingMinions.length === 0) {
|
|
5472
5528
|
const [mainBoss] = await ctx.database.get("ggcevo_boss", {
|
|
5473
|
-
groupId,
|
|
5529
|
+
groupId: groupId2,
|
|
5474
5530
|
type: "主宰",
|
|
5475
5531
|
isActive: true
|
|
5476
5532
|
});
|
|
@@ -5478,11 +5534,17 @@ ${validTypes.join("、")}`;
|
|
|
5478
5534
|
await ctx.database.set("ggcevo_boss", { name: mainBoss.name }, {
|
|
5479
5535
|
skills: [...mainBoss.skills, "孤立无援"]
|
|
5480
5536
|
});
|
|
5481
|
-
|
|
5537
|
+
broadcastMessages2.push(`💥 所有子代已阵亡,${mainBoss.name}进入【孤立无援】状态,受到的伤害+20%!`);
|
|
5482
5538
|
}
|
|
5483
5539
|
}
|
|
5484
5540
|
}
|
|
5485
|
-
|
|
5541
|
+
bossEventBroadcast = broadcastMessages2;
|
|
5542
|
+
cleanerRewardBroadcast = await getCleanerRewardBroadcast(
|
|
5543
|
+
ctx,
|
|
5544
|
+
targetBoss,
|
|
5545
|
+
handle,
|
|
5546
|
+
session.username
|
|
5547
|
+
);
|
|
5486
5548
|
}
|
|
5487
5549
|
} else {
|
|
5488
5550
|
await ctx.database.set(
|
|
@@ -5571,12 +5633,21 @@ ${scatterEffectMessages.map((m) => `▸ ${m}`).join("\n")}`
|
|
|
5571
5633
|
isDefeated ? `🎉 恭喜,已成功击败 ${targetBoss.name}!` : ""
|
|
5572
5634
|
].filter((line) => line).join("\n");
|
|
5573
5635
|
await session.send(resultMessage);
|
|
5636
|
+
const broadcastMessages = [];
|
|
5637
|
+
const groupId = [...config2.groupId];
|
|
5574
5638
|
if (scatterBroadcast) {
|
|
5575
|
-
const
|
|
5576
|
-
|
|
5577
|
-
}
|
|
5578
|
-
|
|
5579
|
-
|
|
5639
|
+
const scatterMsg = Array.isArray(scatterBroadcast) ? scatterBroadcast.join("\n") : scatterBroadcast;
|
|
5640
|
+
broadcastMessages.push(scatterMsg);
|
|
5641
|
+
}
|
|
5642
|
+
if (bossEventBroadcast) {
|
|
5643
|
+
const bossMsg = Array.isArray(bossEventBroadcast) ? bossEventBroadcast.join("\n") : bossEventBroadcast;
|
|
5644
|
+
broadcastMessages.push(bossMsg);
|
|
5645
|
+
}
|
|
5646
|
+
if (cleanerRewardBroadcast && cleanerRewardBroadcast.length > 0) {
|
|
5647
|
+
broadcastMessages.push(cleanerRewardBroadcast.join("\n"));
|
|
5648
|
+
}
|
|
5649
|
+
if (broadcastMessages.length > 0) {
|
|
5650
|
+
await ctx.broadcast(groupId, broadcastMessages.join("\n\n"));
|
|
5580
5651
|
}
|
|
5581
5652
|
});
|
|
5582
5653
|
ctx.command("ggcevo/攻击假人").option("tags", "-t <tags:string> 添加BOSS标签(逗号分隔)").action(async (argv) => {
|