Merge pull request #1410 from PZ157/PR-Branch

ai修复
This commit is contained in:
Spmario233 2024-05-31 18:00:43 +08:00 committed by GitHub
commit 0a0dedd091
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 39 additions and 42 deletions

View File

@ -608,6 +608,12 @@ game.import("card", function () {
if (target !== _status.event.dying) { if (target !== _status.event.dying) {
if ( if (
!player.isPhaseUsing() || !player.isPhaseUsing() ||
player.needsToDiscard(0, (i, player) => {
return (
!player.canIgnoreHandcard(i) &&
taos.includes(i)
);
}) ||
player.hasSkillTag( player.hasSkillTag(
"nokeep", "nokeep",
true, true,
@ -619,7 +625,7 @@ game.import("card", function () {
) )
) )
return 2; return 2;
let min = 7.2 - (4 * player.hp) / player.maxHp, let min = 8.1 - (4.5 * player.hp) / player.maxHp,
nd = player.needsToDiscard(0, (i, player) => { nd = player.needsToDiscard(0, (i, player) => {
return ( return (
!player.canIgnoreHandcard(i) && !player.canIgnoreHandcard(i) &&

View File

@ -5210,6 +5210,19 @@ const skills = {
subSkill: { subSkill: {
used: {}, used: {},
}, },
ai: {
effect: {
target(card, player, target) {
if (get.tag(card, "save")) {
if (_status.currentPhase == player) return 0;
if (target.maxHp > 1 && player != target) return 0;
}
if (get.tag(card, "recover")) {
if (_status.currentPhase == player) return 0;
}
},
},
}
}, },
nsshishou: { nsshishou: {
trigger: { player: "loseEnd" }, trigger: { player: "loseEnd" },
@ -5241,18 +5254,7 @@ const skills = {
}, },
}, },
ai: { ai: {
halfneg: true, neg: true,
effect: {
target(card, player, target) {
if (get.tag(card, "save")) {
if (_status.currentPhase == player) return 0;
if (target.maxHp > 1 && player != target) return 0;
}
if (get.tag(card, "recover")) {
if (_status.currentPhase == player) return 0;
}
},
},
}, },
}, },
nsduijue: { nsduijue: {

View File

@ -5769,22 +5769,25 @@ const skills = {
notemp: true, notemp: true,
effect: { effect: {
target: (card, player, target) => { target: (card, player, target) => {
if (!get.tag(card, "damage") || !target.hasFriend()) return; if (!target.hasFriend()) return;
if (player.hasSkillTag("jueqing", null, target)) return 1.7; let rec = get.tag(card, "recover"), damage = get.tag(card, "damage");
if (!rec && !damage) return;
if (damage && player.hasSkillTag("jueqing", null, target)) return 1.7;
let die = [null, 1], let die = [null, 1],
temp; temp;
game.filterPlayer(i => { game.filterPlayer(i => {
temp = i.countMark("new_wuhun"); temp = i.countMark("new_wuhun");
if (i === player && target.hp + target.hujia > 1) temp++; if (i === player && target.hp + target.hujia > 1) temp++;
if (temp >= die[1]) { if (temp > die[1]) die = [i, temp];
else if (temp === die[1]) {
if (!die[0]) die = [i, temp]; if (!die[0]) die = [i, temp];
else { else if (get.attitude(target, i) < get.attitude(target, die[0])) die = [i, temp];
let att = get.attitude(player, i);
if (att < die[1]) die = [i, temp];
}
} }
}); });
if (die[0]) return [1, 0, 1, (-6 * get.sgnAttitude(player, die[0])) / Math.max(1, target.hp)]; if (die[0]) {
if (damage) return [1, 0, 1, (-6 * get.sgnAttitude(player, die[0])) / Math.max(1, target.hp)];
return [1, (6 * get.sgnAttitude(player, die[0])) / Math.max(1, target.hp)];
}
}, },
}, },
}, },
@ -6733,7 +6736,7 @@ const skills = {
target(card, player, target, current) { target(card, player, target, current) {
if (player.getHp() <= 0) return; if (player.getHp() <= 0) return;
if (!target.hasFriend()) return; if (!target.hasFriend()) return;
if (target.hp <= 1 && get.tag(card, "damage")) return [1, 0, 0, -2]; if (target.hp <= 1 && get.tag(card, "damage")) return [1, 0, 0, -2 * player.getHp()];
}, },
}, },
}, },

View File

@ -2200,17 +2200,6 @@ game.import("character", function () {
content() { content() {
trigger.num++; trigger.num++;
}, },
},
qingtian_old: {
trigger: { player: "recoverBefore" },
forced: true,
filter(event, player) {
return player.hp > 0 && event.num > 0;
},
content() {
trigger.cancel();
player.changeHujia(trigger.num);
},
ai: { ai: {
neg: true, neg: true,
}, },

View File

@ -4049,7 +4049,6 @@ const skills = {
}, },
ai: { ai: {
threaten: 2.5, threaten: 2.5,
halfneg: true,
}, },
subSkill: { subSkill: {
block: { block: {
@ -16128,7 +16127,7 @@ const skills = {
player.draw(event.num); player.draw(event.num);
}, },
ai: { ai: {
halfneg: true, neg: true,
}, },
}, },
yixiang: { yixiang: {

View File

@ -1891,7 +1891,7 @@ const skills = {
player.markAuto("sbyijue_effect", [trigger.player]); player.markAuto("sbyijue_effect", [trigger.player]);
}, },
ai: { ai: {
halfneg: true, neg: true,
}, },
marktext: "绝", marktext: "绝",
intro: { content: "已放$一马" }, intro: { content: "已放$一马" },
@ -7407,7 +7407,6 @@ const skills = {
ai: { ai: {
threaten: 3.5, threaten: 3.5,
directHit_ai: true, directHit_ai: true,
halfneg: true,
skillTagFilter: function (player, tag, arg) { skillTagFilter: function (player, tag, arg) {
if (arg && arg.card && arg.card.name == "sha") { if (arg && arg.card && arg.card.name == "sha") {
var storage = player.getStorage("sbliegong"); var storage = player.getStorage("sbliegong");

View File

@ -7399,7 +7399,7 @@ const skills = {
}, },
ai: { ai: {
threaten: 0.8, threaten: 0.8,
halfneg: true, neg: true,
effect: { effect: {
player_use(card, player, target) { player_use(card, player, target) {
if ((!card.isCard || !card.cards) && get.itemtype(card) != "card") return; if ((!card.isCard || !card.cards) && get.itemtype(card) != "card") return;
@ -7751,7 +7751,7 @@ const skills = {
} }
}, },
ai: { ai: {
halfneg: true, neg: true,
}, },
subSkill: { subSkill: {
swap: { swap: {
@ -9700,7 +9700,6 @@ const skills = {
}, },
ai: { ai: {
halfneg: true, halfneg: true,
combo: "fenrui",
threaten: 3.2, threaten: 3.2,
}, },
}, },

View File

@ -3348,7 +3348,7 @@ const skills = {
} }
}, },
ai: { ai: {
halfneg: true, neg: true,
}, },
}, },
xiongrao: { xiongrao: {

View File

@ -5963,7 +5963,7 @@ const skills = {
trigger.num++; trigger.num++;
}, },
ai: { ai: {
halfneg: true, neg: true,
}, },
}, },
huisheng: { huisheng: {