Merge pull request #1252 from lieren2023/PR-Branch

bug fix
This commit is contained in:
Spmario233 2024-04-21 16:29:49 +08:00 committed by GitHub
commit 782aa2eea2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 11 deletions

View File

@ -12962,14 +12962,13 @@ game.import("character", function () {
}, },
usable: 1, usable: 1,
async cost(event, trigger, player) { async cost(event, trigger, player) {
"step 0";
var num = player.getFriends().length; var num = player.getFriends().length;
if ( if (
!game.hasPlayer(function (current) { !game.hasPlayer(function (current) {
return current != player && current.getFriends().length > num; return current != player && current.getFriends().length > num;
}) })
) { ) {
player event.result = await player
.chooseToDiscard( .chooseToDiscard(
"h", "h",
get.prompt("rewangzu"), get.prompt("rewangzu"),
@ -12978,12 +12977,11 @@ game.import("character", function () {
) )
.set("ai", function (card) { .set("ai", function (card) {
return 7 - get.value(card); return 7 - get.value(card);
}); })
.forResult();
} else { } else {
player.chooseBool(get.prompt("rewangzu"), "随机弃置一张牌并令伤害-1"); event.result = await player.chooseBool(get.prompt("rewangzu"), "随机弃置一张牌并令伤害-1").forResult();
} }
"step 1";
event.result = result;
}, },
async content(event, trigger, player) { async content(event, trigger, player) {
trigger.num--; trigger.num--;

View File

@ -23921,17 +23921,16 @@ game.import("character", function () {
filter: function (event, player) { filter: function (event, player) {
if (event.name == "loseAsync") { if (event.name == "loseAsync") {
if (event.type != "gain") return false; if (event.type != "gain") return false;
var hs = current.getCards("h"),
cards = event.getl(player).cards2;
return game.hasPlayer(function (current) { return game.hasPlayer(function (current) {
if (current == player) return false; if (current == player) return false;
var hs = current.getCards("h"),
cards = event.getl(player).cards2;
var cardsx = event.getg(current); var cardsx = event.getg(current);
for (var i of cardsx) { for (var i of cardsx) {
if ( if (
hs.includes(i) &&
cards.includes(i) && cards.includes(i) &&
hs.includes(card) && get.color(i, player) == "black"
cards.includes(card) &&
get.color(card, player) == "black"
) )
return true; return true;
} }