Merge pull request #1323 from PZ157/PR-Branch

bugfix,ai优化
This commit is contained in:
Spmario233 2024-05-07 18:29:09 +08:00 committed by GitHub
commit 2fccd10d68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 11 additions and 8 deletions

View File

@ -5178,7 +5178,7 @@ const skills = {
trigger: { player: "dieBefore" }, trigger: { player: "dieBefore" },
forced: true, forced: true,
filter(event, player) { filter(event, player) {
return player.maxHp > 0; return player.maxHp > 0 && event.getParent().name != "giveup";
}, },
content() { content() {
trigger.cancel(); trigger.cancel();

View File

@ -6323,6 +6323,7 @@ const skills = {
combo: "sbaiyin", combo: "sbaiyin",
effect: { effect: {
target(card, player, target) { target(card, player, target) {
if (!target.hasSkill("sbaiyin") && !target.hasSkill("jilue") || !target.hasFriend()) return;
if (player.hasSkillTag("jueqing", false, target)) return [1, -2]; if (player.hasSkillTag("jueqing", false, target)) return [1, -2];
if (get.tag(card, "damage")) { if (get.tag(card, "damage")) {
if (target.hp == target.maxHp) { if (target.hp == target.maxHp) {

View File

@ -12437,7 +12437,7 @@ const skills = {
var target = event.player; var target = event.player;
var att = get.attitude(player, target); var att = get.attitude(player, target);
var num2 = Math.min(5, target.hp) - target.countCards("h"); var num2 = Math.min(5, target.hp) - target.countCards("h");
if (num2 <= 0) return att <= 0; if (num2 <= 0) return false;
var num = target.countCards("h", function (card) { var num = target.countCards("h", function (card) {
return target.hasValueTarget(card, null, true); return target.hasValueTarget(card, null, true);
}); });

View File

@ -7170,10 +7170,11 @@ const skills = {
}, },
check: function (event, player) { check: function (event, player) {
return ( return (
get.damageEffect(event.player, player, player) < 0 || get.damageEffect(event.player, player, player) <= 0 ||
(!event.player.hasSkillTag("noe") && (get.attitude(player, event.player) <= 0 &&
!event.player.hasSkillTag("noe") &&
event.player.hasCard(function (card) { event.player.hasCard(function (card) {
return get.value(card) > 6; return get.value(card) > 9 - event.player.hp;
}, "e")) }, "e"))
); );
}, },

View File

@ -2828,7 +2828,7 @@ const skills = {
}, },
checkx: function (event, player) { checkx: function (event, player) {
var target = event.source; var target = event.source;
return get.damageEffect(player, target, target) <= 0; return get.damageEffect(player, target, player) <= 0;
}, },
forced: true, forced: true,
content: function () { content: function () {
@ -22183,6 +22183,7 @@ const skills = {
player.awakenSkill("zhiri"); player.awakenSkill("zhiri");
player.loseMaxHp(); player.loseMaxHp();
player.storage.zhiri = true; player.storage.zhiri = true;
player.addSkills("xintan");
}, },
ai: { ai: {
combo: "fentian", combo: "fentian",

View File

@ -14737,12 +14737,12 @@ const skills = {
order: 2.9, order: 2.9,
result: { result: {
target: function (player, target) { target: function (player, target) {
if (get.attitude(player, target) >= 0) return -20;
var cards = ui.selected.cards.slice(0); var cards = ui.selected.cards.slice(0);
var names = []; var names = [];
for (var i of cards) names.add(i.name); for (var i of cards) names.add(i.name);
if (names.length < player.hp) return 0; if (names.length < player.hp) return 0;
if (player.hasUnknown() && (player.identity != "fan" || !target.isZhu)) return 0; if (player.hasUnknown() && (player.identity != "fan" || !target.isZhu)) return 0;
if (get.attitude(player, target) >= 0) return -20;
return lib.card.sha.ai.result.target.apply(this, arguments); return lib.card.sha.ai.result.target.apply(this, arguments);
}, },
}, },

View File

@ -11661,7 +11661,7 @@ const skills = {
threaten: 0.8, threaten: 0.8,
effect: { effect: {
target: function (card, player, target) { target: function (card, player, target) {
if (get.tag(card, "damage")) { if (get.tag(card, "damage") && (player.hasSkill("paiyi") || player.hasSkill("zili"))) {
if (player.hasSkillTag("jueqing", false, target)) return [1, -2]; if (player.hasSkillTag("jueqing", false, target)) return [1, -2];
if (!target.hasFriend()) return; if (!target.hasFriend()) return;
if (target.hp >= 4) return [0.5, get.tag(card, "damage") * 2]; if (target.hp >= 4) return [0.5, get.tag(card, "damage") * 2];