Merge pull request #1454 from PZ157/PR-Branch

bugfix, add tags
This commit is contained in:
Spmario233 2024-06-10 08:18:55 +08:00 committed by GitHub
commit 1c7114160c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 68 additions and 16 deletions

View File

@ -4062,6 +4062,7 @@ const skills = {
return 0;
},
},
combo: "tianren"
},
subSkill: {
effect: {

View File

@ -538,6 +538,7 @@ const skills = {
},
jsrgyangge: {
global: "jsrgyangge_mizhao",
derivation: "mizhao",
subSkill: {
mizhao: {
//直接继承mizhao
@ -574,11 +575,59 @@ const skills = {
player.addTempSkill("jsrgguanshi_effect");
},
position: "hs",
//这个AI难写交给157了
check() {
return -1;
selectTargetAi(card) {
let cache = _status.event.getTempCache("jsrgguanshi", "targets");
if (Array.isArray(cache)) return cache.length;
let player = _status.event.player,
targets = [],
shas = player.mayHaveSha(player, "respond", player.getCards("h", i => {
return card === i;
}));
game.countPlayer(tar => {
if (player === tar) return;
let eff = get.effect(tar, get.autoViewAs({ name: "juedou" }, [card]), player, player);
if (eff <= 0) return;
if (get.attitude(player, tar) > 0) targets.push([tar, eff, 0]);
else targets.push([tar, eff, tar.mayHaveSha(player, "respond", null, "count")]);
});
targets.sort((a, b) => {
if (!a[2]) return -1;
if (!b[2]) return 1;
return b[1] / b[2] - a[1] / a[2];
});
for (let i = 0; i < targets.length; i++) {
if (targets[i][2] > shas) {
targets = targets.slice(0, i);
break;
}
else shas -= targets[i][2];
}
_status.event.putTempCache("jsrgguanshi", "targets", targets);
return targets.length;
},
check(card) {
let num = lib.skill.jsrgguanshi.selectTargetAi(card);
if (!num) return -1;
if (num === 1) return 4 - get.value(card);
return num + 5 - get.value(card);
},
ai: {
order: 9,
result: {
player(player, target) {
let tars = _status.event.putTempCache("jsrgguanshi", "targets", targets);
if (!tars) return lib.card.juedou.ai.result.player(player, target);
},
target(player, target) {
let tars = _status.event.putTempCache("jsrgguanshi", "targets", targets);
if (!tars) return lib.card.juedou.ai.result.target(player, target);
for (let tar of tars) {
if (tar[0] === target) return tar[1] / get.attitude(player, target);
}
return 0;
}
}
},
ai: {},
subSkill: {
effect: {
trigger: {

View File

@ -6631,6 +6631,7 @@ const skills = {
player.removeSkills("godan_feiqu");
},
ai: {
combo: "godan_feiqu",
halfneg: true
},
},

View File

@ -4774,7 +4774,6 @@ const skills = {
if (card) player.gain(card, "gain2");
},
ai: {
combo: "fenli",
effect: {
target: function (card) {
if (card.name == "lebu" || card.name == "bingliang") return 0.5;

View File

@ -2293,7 +2293,7 @@ const skills = {
},
check: function (event, player) {
if (player.hasJudge("lebu") || player.hasJudge("bingliang")) return true;
if (player.getHistory("skipped").length > 0) return false;
if (!player.hasSkill("repingkou") || player.getHistory("skipped").length > 0) return false;
return game.hasPlayer(function (current) {
return get.attitude(player, current) < 0 && current.hp == 1 && get.damageEffect(current, player, player) > 0;
});
@ -2311,6 +2311,7 @@ const skills = {
return player.isMaxHp();
},
check: function (event, player) {
if (!player.hasSkill("repingkou")) return false;
if (!player.needsToDiscard() || (player.countCards("e") && player.isMaxEquip())) return true;
if (player.getHistory("skipped").length > 0) return false;
return game.hasPlayer(function (current) {
@ -2334,9 +2335,6 @@ const skills = {
},
},
},
ai: {
combo: "repingkou",
},
},
repingkou: {
audio: 2,

View File

@ -23146,6 +23146,9 @@ const skills = {
player.stat[player.stat.length - 1].card.sha--;
}
},
ai: {
combo: "wusheng"
},
group: "nuzhan2",
},
nuzhan2: {

View File

@ -7145,6 +7145,9 @@ const skills = {
player.addTempSkill("csyizheng2", { player: "phaseBegin" });
}
},
ai: {
combo: "cslilu"
},
},
csyizheng2: {
audio: "csyizheng",

View File

@ -336,6 +336,7 @@ const skills = {
.sortBySeat();
if (targets.length) {
for (const target of targets) {
if (!target.isIn()) continue;
const next = target.chooseToUse("挥战:是否替" + get.translation(trigger.player) + "使用一张【闪】?", { name: "shan" });
next.set("ai", () => {
const event = _status.event;

View File

@ -3677,7 +3677,7 @@ const skills = {
return player.isMaxHandcard();
},
check: function (event, player) {
if (player.getHistory("skipped").length > 0) return false;
if (!player.hasSkill("pingkou") && !player.hasSkill("xinpingkou") || player.getHistory("skipped").length > 0) return false;
return game.hasPlayer(function (current) {
return get.attitude(player, current) < 0 && current.hp == 1 && get.damageEffect(current, player, player) > 0;
});
@ -3695,6 +3695,7 @@ const skills = {
return player.isMaxHp();
},
check: function (event, player) {
if (!player.hasSkill("pingkou") && !player.hasSkill("xinpingkou")) return false;
if (!player.needsToDiscard() || (player.countCards("e") && player.isMaxEquip())) return true;
if (player.getHistory("skipped").length > 0) return false;
return game.hasPlayer(function (current) {
@ -3719,9 +3720,6 @@ const skills = {
},
},
},
ai: {
combo: "pingkou",
},
},
pingkou: {
audio: 2,
@ -3754,7 +3752,6 @@ const skills = {
}
},
ai: {
combo: "fenli",
effect: {
target: function (card) {
if (card.name == "lebu" || card.name == "bingliang") return 0.5;

View File

@ -1262,8 +1262,8 @@ export class Player extends HTMLDivElement {
*/
hasSha(respond?: string | boolean, noauto?: boolean): boolean;
hasShan(respond: any): boolean;
mayHaveSha(viewer: any, type: any, ignore: any, rvt: any): number | boolean;
mayHaveShan(viewer: any, type: any, ignore: any, rvt: any): number | boolean;
mayHaveSha(viewer: Player, type?: string, ignore?: CCards | Function, rvt?: string): number | boolean;
mayHaveShan(viewer: Player, type?: string, ignore?: CCards | Function, rvt?: string): number | boolean;
hasCard(name: any, position: any): boolean;
getEquip(name: any): import("noname-typings/nonameModules/noname/library/element/card.js").Card;
getJudge(name: any): ChildNode;