修复【渐营】同回合不同出牌阶段仍然可以“连营”的bug

This commit is contained in:
157 2024-05-06 13:29:07 +08:00
parent 535284a943
commit 0796ce86c7
2 changed files with 7 additions and 4 deletions

View File

@ -6837,7 +6837,7 @@ game.import("character", function () {
content() { content() {
var num = (get.is.altered("guozai") ? 3 : 4) - player.countCards("h"); var num = (get.is.altered("guozai") ? 3 : 4) - player.countCards("h");
player.draw(num); player.draw(num);
player.addTempSkill("guozai2", "phaseUseAfter"); player.addSkill("guozai2");
player.storage.guozai2 += num; player.storage.guozai2 += num;
game.addVideo("storage", player, ["guozai2", player.storage.guozai2]); game.addVideo("storage", player, ["guozai2", player.storage.guozai2]);
}, },
@ -6858,6 +6858,7 @@ game.import("character", function () {
content() { content() {
player.chooseToDiscard("he", true, player.storage.guozai2); player.chooseToDiscard("he", true, player.storage.guozai2);
player.storage.guozai2 = 0; player.storage.guozai2 = 0;
player.removeSkill("guozai2");
}, },
}, },
guozaix: { guozaix: {
@ -6872,7 +6873,7 @@ game.import("character", function () {
content() { content() {
var num = 4 - player.countCards("h"); var num = 4 - player.countCards("h");
player.draw(num); player.draw(num);
player.addTempSkill("guozaix2", "phaseUseAfter"); player.addSkill("guozaix2");
player.storage.guozaix2 += num; player.storage.guozaix2 += num;
game.addVideo("storage", player, ["guozaix2", player.storage.guozaix2]); game.addVideo("storage", player, ["guozaix2", player.storage.guozaix2]);
}, },
@ -6893,6 +6894,7 @@ game.import("character", function () {
content() { content() {
player.chooseToDiscard("he", true, player.storage.guozaix2); player.chooseToDiscard("he", true, player.storage.guozaix2);
player.storage.guozaix2 = 0; player.storage.guozaix2 = 0;
player.removeSkill("guozaix2");
}, },
}, },
hanshuang: { hanshuang: {

View File

@ -14447,7 +14447,8 @@ const skills = {
aiOrder: function (player, card, num) { aiOrder: function (player, card, num) {
if (typeof card == "object" && player.isPhaseUsing()) { if (typeof card == "object" && player.isPhaseUsing()) {
var evt = player.getLastUsed(); var evt = player.getLastUsed();
if (evt && evt.card && ((get.suit(evt.card) && get.suit(evt.card) == get.suit(card)) || (evt.card.number && evt.card.number == get.number(card)))) { if (!evt || !evt.card || evt.getParent("phaseUse") !== _status.event.getParent("phaseUse")) return num;
if ((get.suit(evt.card) && get.suit(evt.card) == get.suit(card)) || (evt.card.number && evt.card.number == get.number(card))) {
return num + 10; return num + 10;
} }
} }
@ -14460,7 +14461,7 @@ const skills = {
if (!evt || !evt.card) return false; if (!evt || !evt.card) return false;
if (!player.isPhaseUsing()) return false; if (!player.isPhaseUsing()) return false;
var evt2 = evt.getParent("phaseUse"); var evt2 = evt.getParent("phaseUse");
if (!evt2 || evt2.name != "phaseUse" || evt2.player != player) return false; if (!evt2 || evt2.name != "phaseUse" || evt2 !== event.getParent("phaseUse")) return false;
return (get.suit(evt.card) != "none" && get.suit(evt.card) == get.suit(event.card)) || (typeof get.number(evt.card, false) == "number" && get.number(evt.card, false) == get.number(event.card)); return (get.suit(evt.card) != "none" && get.suit(evt.card) == get.suit(event.card)) || (typeof get.number(evt.card, false) == "number" && get.number(evt.card, false) == get.number(event.card));
}, },
content: function () { content: function () {