拆顺ai增加蓄谋牌检测

This commit is contained in:
157 2024-05-27 11:17:42 +08:00
parent 5d47247535
commit 0ae1804afe
2 changed files with 32 additions and 22 deletions

View File

@ -2111,12 +2111,13 @@ game.import("card", function () {
pos = get.position(button.link),
name = get.name(button.link);
if (pos == "j") {
if (name == "lebu") {
let viewAs = button.link.viewAs;
if (viewAs == "lebu") {
let needs = target.needsToDiscard(2);
btv *= 1.08 + 0.2 * needs;
} else if (name == "shandian" || name == "fulei" || name == "plague") btv /= 2;
} else if (viewAs == "shandian" || viewAs == "fulei") btv /= 2;
}
if (get.attitude(player, get.owner(button.link)) > 0) btv = -btv;
if (att > 0) btv = -btv;
if (pos != "e") {
if (pos == "h" && !player.hasSkillTag("viewHandcard", null, target, true))
return btv + 0.1;
@ -2156,6 +2157,7 @@ game.import("card", function () {
return get.value(card, target) > 0 && card != target.getEquip('jinhe');
}) && !js.some(card => {
var cardj = card.viewAs ? { name: card.viewAs } : card;
if (cardj.name == "xumou_jsrg") return true;
return get.effect(target, cardj, target, player) < 0;
})) return 0;
}
@ -2164,6 +2166,7 @@ game.import("card", function () {
return get.value(card, target) <= 0;
}) || js.some(card => {
var cardj = card.viewAs ? { name: card.viewAs } : card;
if (cardj.name == "xumou_jsrg") return false;
return get.effect(target, cardj, target, player) < 0;
})) ? 1.5 : 0;
}
@ -2180,6 +2183,7 @@ game.import("card", function () {
return get.value(card, target) > 0 && card != target.getEquip('jinhe');
}) || js.some(card => {
var cardj = card.viewAs ? { name: card.viewAs } : card;
if (cardj.name == "xumou_jsrg") return true;
return get.effect(target, cardj, target, player) < 0;
})) ? -1.5 : 1.5;
}
@ -2187,6 +2191,7 @@ game.import("card", function () {
return get.value(card, target) <= 0;
}) || js.some(card => {
var cardj = card.viewAs ? { name: card.viewAs } : card;
if (cardj.name == "xumou_jsrg") return false;
return get.effect(target, cardj, target, player) < 0;
})) ? 1.5 : -1.5;
},
@ -2218,6 +2223,7 @@ game.import("card", function () {
}) ||
js.some((card) => {
var cardj = card.viewAs ? { name: card.viewAs } : card;
if (cardj.name == "xumou_jsrg") return true;
return get.effect(target, cardj, target, player) < 0;
})
? -1.5
@ -2228,6 +2234,7 @@ game.import("card", function () {
}) ||
js.some((card) => {
var cardj = card.viewAs ? { name: card.viewAs } : card;
if (cardj.name == "xumou_jsrg") return false;
return get.effect(target, cardj, target, player) < 0;
})
? 1.5
@ -2250,6 +2257,7 @@ game.import("card", function () {
}) &&
!js.some((card) => {
var cardj = card.viewAs ? { name: card.viewAs } : card;
if (cardj.name == "xumou_jsrg") return true;
return get.effect(target, cardj, target, player) < 0;
})
)
@ -2260,6 +2268,7 @@ game.import("card", function () {
}) ||
js.some((card) => {
var cardj = card.viewAs ? { name: card.viewAs } : card;
if (cardj.name == "xumou_jsrg") return false;
return get.effect(target, cardj, target, player) < 0;
})
? 1.5
@ -2423,12 +2432,13 @@ game.import("card", function () {
pos = get.position(button.link),
name = get.name(button.link);
if (pos === "j") {
if (name === "lebu") {
let viewAs = button.link.viewAs;
if (viewAs === "lebu") {
let needs = target.needsToDiscard(2);
val *= 1.08 + 0.2 * needs;
} else if (name == "shandian" || name == "fulei" || name == "plague") val /= 2;
} else if (viewAs == "shandian" || viewAs == "fulei") val /= 2;
}
if (get.attitude(player, get.owner(button.link)) > 0) val = -val;
if (att > 0) val = -val;
if (pos !== "e") return val;
let sub = get.subtypes(button.link);
if (sub.includes("equip1")) return (val * Math.min(3.6, target.hp)) / 3;
@ -2466,6 +2476,7 @@ game.import("card", function () {
if (att > 0) {
if (js.some(card => {
const cardj = card.viewAs ? { name: card.viewAs } : card;
if (cardj.name == "xumou_jsrg") return false;
return get.effect(target, cardj, target, player) < 0;
})) return 3;
if (target.isDamaged() && es.some(card => card.name == 'baiyin') &&
@ -2485,6 +2496,7 @@ game.import("card", function () {
}));
const noj = (js.length == 0 || !js.some(card => {
const cardj = card.viewAs ? { name: card.viewAs } : card;
if (cardj.name == "xumou_jsrg") return true;
return get.effect(target, cardj, target, player) < 0;
}))
if (noh && noe2 && noj) return 1.5;
@ -2518,6 +2530,7 @@ game.import("card", function () {
if (
js.some((card) => {
const cardj = card.viewAs ? { name: card.viewAs } : card;
if (cardj.name == "xumou_jsrg") return false;
return get.effect(target, cardj, target, player) < 0;
})
)
@ -2548,6 +2561,7 @@ game.import("card", function () {
js.length == 0 ||
!js.some((card) => {
const cardj = card.viewAs ? { name: card.viewAs } : card;
if (cardj.name == "xumou_jsrg") return true;
return get.effect(target, cardj, target, player) < 0;
});
if (noh && noe2 && noj) return 1.5;

View File

@ -61,7 +61,7 @@ game.import("card", function () {
var base = 0;
if (get.cardtag(card, "yingbian_all")) {
if (
targets.filter(function (current) {
targets.some(function (current) {
var att = get.attitude(player, current);
if (att <= 0)
return (
@ -74,7 +74,7 @@ game.import("card", function () {
return get.position(card) == "j" || get.value(card, current) <= 0;
}) > 1
);
}).length
})
)
base += 6;
}
@ -138,13 +138,11 @@ game.import("card", function () {
? -1.5
: 1.5;
var js = target.getCards("j");
if (js.length) {
var jj = js[0].viewAs ? { name: js[0].viewAs } : js[0];
if (js.length == 1 && get.effect(target, jj, target, player) >= 0) {
return -1.5;
}
return 3;
}
if (js.length && js.some(i => {
let cardj = i.viewAs ? { name: i.viewAs } : i;
if (cardj.name == "xumou_jsrg") return false;
return get.effect(target, cardj, target, player) < 0;
})) return 3;
return -1.5;
},
player: function (player, target) {
@ -159,13 +157,11 @@ game.import("card", function () {
}
if (get.attitude(player, target) > 1) {
var js = target.getCards("j");
if (js.length) {
var jj = js[0].viewAs ? { name: js[0].viewAs } : js[0];
if (js.length == 1 && get.effect(target, jj, target, player) >= 0) {
return 0;
}
return 1;
}
if (js.length && js.some(i => {
let cardj = i.viewAs ? { name: i.viewAs } : i;
if (cardj.name == "xumou_jsrg") return false;
return get.effect(target, cardj, target, player) < 0;
})) return 1;
return 0;
}
return 1;