noname/card/yunchou.js

1074 lines
31 KiB
JavaScript
Raw Normal View History

2024-04-15 18:36:20 +00:00
import { lib, game, ui, get, ai, _status } from "../noname.js";
game.import("card", function () {
2020-04-03 12:09:26 +00:00
return {
2024-04-15 18:36:20 +00:00
name: "yunchou",
card: {
diaobingqianjiang: {
fullskin: true,
type: "trick",
enable: true,
selectTarget: -1,
filterTarget: function (card, player, target) {
return player == target || target.countCards("h");
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
contentBefore: function () {
"step 0";
2020-04-03 12:09:26 +00:00
game.delay();
player.draw();
2024-04-15 18:36:20 +00:00
"step 1";
if (get.is.versus()) {
player
.chooseControl("顺时针", "逆时针", function (event, player) {
if (player.next.side == player.side) return "逆时针";
return "顺时针";
})
.set("prompt", "选择" + get.translation(card) + "的结算方向");
} else {
2020-04-03 12:09:26 +00:00
event.goto(3);
}
2024-04-15 18:36:20 +00:00
"step 2";
if (result && result.control == "顺时针") {
var evt = event.getParent();
evt.fixedSeat = true;
2020-04-03 12:09:26 +00:00
evt.targets.sortBySeat();
evt.targets.reverse();
2024-04-15 18:36:20 +00:00
if (evt.targets[evt.targets.length - 1] == player) {
2020-04-03 12:09:26 +00:00
evt.targets.unshift(evt.targets.pop());
}
}
2024-04-15 18:36:20 +00:00
"step 3";
2020-04-03 12:09:26 +00:00
ui.clear();
2024-04-15 18:36:20 +00:00
var cards = get.cards(Math.ceil(game.countPlayer() / 2));
var dialog = ui.create.dialog("调兵遣将", cards, true);
2020-04-03 12:09:26 +00:00
_status.dieClose.push(dialog);
2024-04-15 18:36:20 +00:00
dialog.videoId = lib.status.videoId++;
game.addVideo("cardDialog", null, ["调兵遣将", get.cardsInfo(cards), dialog.videoId]);
event.getParent().preResult = dialog.videoId;
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
content: function () {
"step 0";
for (var i = 0; i < ui.dialogs.length; i++) {
if (ui.dialogs[i].videoId == event.preResult) {
event.dialog = ui.dialogs[i];
break;
2020-04-03 12:09:26 +00:00
}
}
2024-04-15 18:36:20 +00:00
if (!event.dialog || !target.countCards("h")) {
2020-04-03 12:09:26 +00:00
event.finish();
return;
}
2024-04-15 18:36:20 +00:00
var minValue = 20;
var hs = target.getCards("h");
for (var i = 0; i < hs.length; i++) {
minValue = Math.min(minValue, get.value(hs[i], target));
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
if (target.isUnderControl(true)) {
event.dialog.setCaption("选择一张牌并用一张手牌替换之");
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
var next = target.chooseButton(function (button) {
return get.value(button.link, _status.event.player) - minValue;
2020-04-03 12:09:26 +00:00
});
2024-04-15 18:36:20 +00:00
next.set("dialog", event.preResult);
next.set("closeDialog", false);
next.set("dialogdisplay", true);
"step 1";
event.dialog.setCaption("调兵遣将");
if (result.bool) {
event.button = result.buttons[0];
target.chooseCard("用一张牌牌替换" + get.translation(result.links), true).ai =
function (card) {
return -get.value(card);
};
} else {
target.popup("不换");
2020-04-03 12:09:26 +00:00
event.finish();
}
2024-04-15 18:36:20 +00:00
"step 2";
if (result.bool) {
target.lose(result.cards, ui.special);
2020-04-03 12:09:26 +00:00
target.$throw(result.cards);
2024-04-15 18:36:20 +00:00
game.log(target, "用", result.cards, "替换了", event.button.link);
2020-04-03 12:09:26 +00:00
target.gain(event.button.link);
target.$gain2(event.button.link);
event.dialog.buttons.remove(event.button);
2024-04-15 18:36:20 +00:00
event.dialog.buttons.push(
ui.create.button(result.cards[0], "card", event.button.parentNode)
);
2020-04-03 12:09:26 +00:00
event.button.remove();
}
2024-04-15 18:36:20 +00:00
"step 3";
2020-04-03 12:09:26 +00:00
game.delay(2);
},
2024-04-15 18:36:20 +00:00
contentAfter: function () {
"step 0";
event.dialog = get.idDialog(event.preResult);
if (!event.dialog) {
2020-04-03 12:09:26 +00:00
event.finish();
return;
}
2024-04-15 18:36:20 +00:00
var nextSeat = _status.currentPhase.next;
var att = get.attitude(player, nextSeat);
if (player.isUnderControl(true) && !_status.auto) {
event.dialog.setCaption("将任意张牌以任意顺序置于牌堆顶(先选择的在上)");
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
var next = player.chooseButton([1, event.dialog.buttons.length], event.dialog);
next.ai = function (button) {
if (att > 0) {
return get.value(button.link, nextSeat) - 5;
} else {
return 5 - get.value(button.link, nextSeat);
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
};
next.set("closeDialog", false);
next.set("dialogdisplay", true);
"step 1";
if (result && result.bool && result.links && result.links.length) {
for (var i = 0; i < result.buttons.length; i++) {
2020-04-03 12:09:26 +00:00
event.dialog.buttons.remove(result.buttons[i]);
}
2024-04-15 18:36:20 +00:00
var cards = result.links.slice(0);
while (cards.length) {
ui.cardPile.insertBefore(cards.pop(), ui.cardPile.firstChild);
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
game.log(player, "将" + get.cnNumber(result.links.length) + "张牌置于牌堆顶");
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
for (var i = 0; i < event.dialog.buttons.length; i++) {
2020-04-03 12:09:26 +00:00
event.dialog.buttons[i].link.discard();
}
2024-04-15 18:36:20 +00:00
"step 2";
var dialog = event.dialog;
2020-04-03 12:09:26 +00:00
dialog.close();
_status.dieClose.remove(dialog);
2024-04-15 18:36:20 +00:00
game.addVideo("cardDialog", null, event.preResult);
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
ai: {
wuxie: function () {
2020-04-03 12:09:26 +00:00
return 0;
},
2024-04-15 18:36:20 +00:00
basic: {
order: 2,
useful: [3, 1],
value: [5, 1],
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
result: {
player: 1,
target: function (player, target) {
if (target.countCards("h") == 0) return 0;
return (
(Math.sqrt(target.countCards("h")) -
get.distance(player, target, "absolute") / game.countPlayer() / 3) /
2
);
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
tag: {
loseCard: 1,
multitarget: 1,
},
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
caochuanjiejian: {
fullskin: true,
type: "trick",
enable: true,
filterTarget: function (card, player, target) {
return target.countCards("h") > 0 && target != player;
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
content: function () {
"step 0";
if (target.countCards("h", "sha")) {
var name = get.translation(player.name);
target
.chooseControl()
.set("prompt", get.translation("caochuanjiejian"))
.set(
"choiceList",
[
"将手牌中的所有杀交给" + name + ",并视为对" + name + "使用一张杀",
"展示手牌并令" + name + "弃置任意一张",
],
function () {
if (get.effect(player, { name: "sha" }, target, target) < 0) return 1;
if (target.countCards("h", "sha") >= 3) return 1;
return 0;
}
);
} else {
event.directfalse = true;
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
"step 1";
if (event.directfalse || result.control == "选项二") {
if (target.countCards("h")) {
if (!player.isUnderControl(true)) {
2020-04-03 12:09:26 +00:00
target.showHandcards();
2024-04-15 18:36:20 +00:00
} else {
game.log(target, "展示了", target.getCards("h"));
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
player.discardPlayerCard(target, "h", true, "visible");
2020-04-03 12:09:26 +00:00
}
event.finish();
2024-04-15 18:36:20 +00:00
} else {
var hs = target.getCards("h", "sha");
player.gain(hs, target);
target.$give(hs, player);
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
"step 2";
target.useCard({ name: "sha" }, player);
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
ai: {
order: 4,
value: [5, 1],
result: {
target: function (player, target) {
if (player.hasShan()) return -1;
2020-04-03 12:09:26 +00:00
return 0;
2024-04-15 18:36:20 +00:00
},
},
},
2020-04-03 12:09:26 +00:00
},
// xiaolicangdao:{
// fullskin:true,
// type:'trick',
// enable:true,
// filterTarget:function(card,player,target){
// return target!=player;
// },
// multitarget:true,
// content:function(){
// 'step 0'
// if(cards&&cards.length){
// target.gain(cards,player);
// target.$gain2(cards);
// if(cards.length==1){
// event.card1=cards[0];
// }
// }
// 'step 1'
// event.card2=target.getCards('h').randomGet();
// if(event.card2){
// target.discard(event.card2);
// }
// else{
// event.finish();
// }
// 'step 2'
// if(event.card1&&event.card1.name==event.card2.name){
// target.damage();
// }
// },
// ai:{
// order:6,
// value:[3,1],
// result:{
// target:function(player,target){
// return -2/Math.sqrt(1+target.countCards('h'));
// },
// },
// tag:{
// damage:1,
// discard:1,
// loseCard:1,
// }
// }
// },
2024-04-15 18:36:20 +00:00
geanguanhuo: {
fullskin: true,
type: "trick",
filterTarget: function (card, player, target) {
if (target == player) return false;
return (
target.countCards("h") > 0 &&
game.hasPlayer(function (current) {
return target.canCompare(current);
})
);
//return ui.selected.targets[0].canCompare(target);
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
filterAddedTarget: function (card, player, target, preTarget) {
return target != player && preTarget.canCompare(target);
2022-05-09 16:59:02 +00:00
},
2024-04-15 18:36:20 +00:00
enable: function () {
return game.countPlayer() > 2;
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
recastable: function () {
return game.countPlayer() <= 2;
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
multicheck: function (card, player) {
return (
game.countPlayer(function (current) {
return current != player && current.countCards("h");
}) > 1
);
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
multitarget: true,
multiline: true,
singleCard: true,
complexSelect: true,
content: function () {
"step 0";
if (!event.addedTarget || !target.canCompare(event.addedTarget)) {
2022-05-09 16:59:02 +00:00
event.finish();
return;
}
2020-04-03 12:09:26 +00:00
target.chooseToCompare(event.addedTarget);
2024-04-15 18:36:20 +00:00
"step 1";
if (!result.tie) {
if (result.bool) {
if (event.addedTarget.countCards("he")) {
2020-04-03 12:09:26 +00:00
target.line(event.addedTarget);
2024-04-15 18:36:20 +00:00
target.gainPlayerCard(event.addedTarget, true);
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
} else {
if (target.countCards("he")) {
2020-04-03 12:09:26 +00:00
event.addedTarget.line(target);
2024-04-15 18:36:20 +00:00
event.addedTarget.gainPlayerCard(target, true);
2020-04-03 12:09:26 +00:00
}
}
event.finish();
}
2024-04-15 18:36:20 +00:00
"step 2";
2020-04-03 12:09:26 +00:00
target.discardPlayerCard(player);
target.line(player);
},
2024-04-15 18:36:20 +00:00
ai: {
order: 5,
value: [7, 1],
useful: [4, 1],
result: {
target: -1,
},
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
shezhanqunru: {
fullskin: true,
type: "trick",
enable: true,
toself: true,
filterTarget: function (card, player, target) {
return target == player;
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
selectTarget: -1,
modTarget: true,
content: function () {
"step 0";
var list = game.filterPlayer(function (current) {
return current != target && target.canCompare(current);
2020-04-03 12:09:26 +00:00
});
2024-04-15 18:36:20 +00:00
if (!list.length) {
2020-04-03 12:09:26 +00:00
target.draw(3);
event.finish();
2024-04-15 18:36:20 +00:00
} else {
2020-04-03 12:09:26 +00:00
list.sortBySeat(target);
2024-04-15 18:36:20 +00:00
event.list = list;
event.torespond = [];
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
"step 1";
if (event.list.length) {
event.current = event.list.shift();
event.current
.chooseBool(
"是否响应" + get.translation(target) + "的舌战群儒?",
function (event, player) {
if (get.attitude(player, _status.event.source) >= 0) return false;
var hs = player.getCards("h");
var dutag = player.hasSkillTag("nodu");
for (var i = 0; i < hs.length; i++) {
var value = get.value(hs[i], player);
if (hs[i].name == "du" && dutag) continue;
if (value < 0) return true;
if (!_status.event.hasTarget) {
if (hs[i].number >= 8 && value <= 7) return true;
if (value <= 3) return true;
} else if (_status.event.hasTarget % 2 == 1) {
if (hs[i].number >= 11 && value <= 6) return true;
}
}
return false;
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
)
.set("source", target)
.set("hasTarget", event.torespond.length);
} else {
2020-04-03 12:09:26 +00:00
event.goto(3);
}
2024-04-15 18:36:20 +00:00
"step 2";
if (result.bool) {
2020-04-03 12:09:26 +00:00
event.torespond.push(event.current);
2024-04-15 18:36:20 +00:00
event.current.line(target, "green");
event.current.popup("响应");
game.log(event.current, "响应了舌战群儒");
2020-04-03 12:09:26 +00:00
game.delayx(0.5);
}
event.goto(1);
2024-04-15 18:36:20 +00:00
"step 3";
if (event.torespond.length == 0) {
event.num = 1;
} else {
event.num = 0;
target.chooseToCompare(event.torespond).callback = lib.card.shezhanqunru.callback;
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
"step 4";
if (event.num > 0) {
2020-04-03 12:09:26 +00:00
target.draw(3);
}
},
2024-04-15 18:36:20 +00:00
callback: function () {
if (event.card1.number > event.card2.number) {
2020-04-03 12:09:26 +00:00
event.parent.parent.num++;
2024-04-15 18:36:20 +00:00
} else {
2020-04-03 12:09:26 +00:00
event.parent.parent.num--;
}
},
2024-04-15 18:36:20 +00:00
ai: {
order: 8.5,
value: [6, 1],
useful: [3, 1],
tag: {
draw: 3,
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
result: {
target: function (player, target) {
var hs = target.getCards("h");
for (var i = 0; i < hs.length; i++) {
var value = get.value(hs[i]);
if (hs[i].number >= 7 && value <= 6) return 1;
if (value <= 3) return 1;
2020-04-03 12:09:26 +00:00
}
return 0;
2024-04-15 18:36:20 +00:00
},
},
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
youdishenru: {
fullskin: true,
type: "trick",
notarget: true,
wuxieable: true,
global: "g_youdishenru",
content: function () {
"step 0";
var info = event.getParent(2).youdiinfo || event.getParent(3).youdiinfo;
if (!info) {
2020-04-03 12:09:26 +00:00
event.finish();
return;
}
info.evt.cancel();
2024-04-15 18:36:20 +00:00
event.source = info.source;
event.source.storage.youdishenru = player;
event.source.addSkill("youdishenru");
"step 1";
var next = event.source
.chooseToUse(
{ name: "sha" },
player,
-1,
"对" + get.translation(player) + "使用一张杀或受到1点伤害"
)
.set("addCount", false);
next.ai2 = function () {
2020-04-03 12:09:26 +00:00
return 1;
};
2024-04-15 18:36:20 +00:00
"step 2";
if (result.bool) {
if (event.source.storage.youdishenru) {
2020-04-03 12:09:26 +00:00
event.goto(1);
2024-04-15 18:36:20 +00:00
} else {
event.source.removeSkill("youdishenru");
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
} else {
2020-04-03 12:09:26 +00:00
event.source.damage(player);
2024-04-15 18:36:20 +00:00
event.source.removeSkill("youdishenru");
2020-04-03 12:09:26 +00:00
}
},
2024-04-15 18:36:20 +00:00
ai: {
value: [5, 1],
useful: [5, 1],
order: 1,
wuxie: function (target, card, player, current, state) {
return -state * get.attitude(player, current);
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
result: {
player: function (player) {
if (
_status.event.parent.youdiinfo &&
get.attitude(player, _status.event.parent.youdiinfo.source) <= 0
) {
2020-04-03 12:09:26 +00:00
return 1;
}
return 0;
2024-04-15 18:36:20 +00:00
},
},
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
wangmeizhike: {
fullskin: true,
type: "trick",
enable: true,
filterTarget: true,
content() {
"step 0";
if (target.isMinHp() && target.isDamaged()) {
2020-04-03 12:09:26 +00:00
target.recover();
2024-04-15 18:36:20 +00:00
event.rec = true;
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
"step 1";
if (target.isMinHandcard()) target.draw(event.rec ? 1 : 2);
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
ai: {
order() {
let player = _status.event.player,
nan = player.hasCard((card) => {
return get.name(card) === "nanman";
}, "hs"),
wan = player.hasCard((card) => {
return get.name(card) === "wanjian";
}, "hs"),
aoe = 0,
max = 0;
game.countPlayer((current) => {
if (get.attitude(player, current) <= 0) return false;
let hp = current.isMinHp(),
hc = current.isMinHandcard();
if ((nan || wan) && (hp || hc)) aoe = 1;
if (hp && hc && max !== 1) max = current === player ? 1 : -1;
2024-03-17 04:02:07 +00:00
});
2024-04-15 18:36:20 +00:00
if (aoe) {
if (nan) aoe = Math.max(aoe, get.order("nanman"));
if (wan) aoe = Math.max(aoe, get.order("wanjian"));
return aoe + 0.2;
2024-03-17 04:02:07 +00:00
}
2024-04-15 18:36:20 +00:00
if (max) return 5.8;
if (player.isDamaged() && player.isMinHp() && player.countCards("hs", "tao"))
return get.order("tao") + 0.2;
2024-03-17 04:02:07 +00:00
return 0.5;
},
2024-04-15 18:36:20 +00:00
value: 7,
result: {
target(player, target) {
let num = 0,
current = player.next,
mei = 1,
draw = target.hasSkillTag("nogain") ? 0.1 : 1;
if (!ui.selected.cards) mei = 0;
let mine = player.countCards("h", (card) => {
if (mei > 0 && ui.selected.cards.includes(card)) return false;
if (!mei && get.name(card) === "phd_wmzk") {
mei = -1;
2024-03-17 04:02:07 +00:00
return false;
2020-04-03 12:09:26 +00:00
}
2024-03-17 04:02:07 +00:00
return true;
});
2024-04-15 18:36:20 +00:00
if (player.hasSkillTag("noh") && player.countCards("h")) mine++;
let min = mine;
while (current !== player) {
if (current.countCards("h") < min) min = current.countCards("h");
current = current.next;
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
if (target.isMinHp() && target.isDamaged() && get.recoverEffect(target) > 0) {
if (target.hp === 1) num += 3;
else num += 2;
2024-03-17 04:02:07 +00:00
}
2024-04-15 18:36:20 +00:00
if (player === target) {
if (mine <= min) num += (num ? 2 : 1) * draw;
} else if (target.countCards("h") <= min) num += (num ? 2 : 1) * draw;
2020-04-03 12:09:26 +00:00
return num;
2024-04-15 18:36:20 +00:00
},
2024-03-17 04:02:07 +00:00
},
2024-04-15 18:36:20 +00:00
tag: {
draw: 1.2,
recover: 0.5,
},
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
suolianjia: {
fullskin: true,
type: "equip",
subtype: "equip2",
skills: ["suolianjia"],
onEquip: function () {
if (player.isLinked() == false) player.link();
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
onLose: function () {
if (player.isLinked()) player.link();
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
ai: {
basic: {
equipValue: 5,
2020-04-03 12:09:26 +00:00
},
},
},
2024-04-15 18:36:20 +00:00
chenhuodajie: {
fullskin: true,
type: "trick",
filterTarget: true,
global: "g_chenhuodajie",
content: function () {
if (target.countCards("he")) {
player.gainPlayerCard("he", target, true);
2020-04-03 12:09:26 +00:00
}
},
2024-04-15 18:36:20 +00:00
ai: {
order: 1,
useful: 6,
value: 6,
result: {
target: -1,
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
tag: {
loseCard: 1,
},
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
fudichouxin: {
fullskin: true,
type: "trick",
enable: true,
filterTarget: function (card, player, target) {
2020-11-13 07:36:36 +00:00
return player.canCompare(target);
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
content: function () {
"step 0";
player.chooseToCompare(target).set("preserve", "win").clear = false;
"step 1";
if (result.bool) {
player.gain([result.player, result.target]);
2020-04-03 12:09:26 +00:00
result.player.clone.moveDelete(player);
result.target.clone.moveDelete(player);
2024-04-15 18:36:20 +00:00
game.addVideo("gain2", player, get.cardsInfo([result.player, result.target]));
} else if (!result.cancelled) {
2020-04-03 12:09:26 +00:00
result.player.clone.delete();
result.target.clone.delete();
2024-04-15 18:36:20 +00:00
game.addVideo("deletenode", player, get.cardsInfo([result.player, result.target]));
2020-04-03 12:09:26 +00:00
}
},
2024-04-15 18:36:20 +00:00
ai: {
order: 4,
value: [4, 1],
result: {
target: function (player) {
if (player.countCards("h") <= 1) return 0;
2020-04-03 12:09:26 +00:00
return -1;
},
2024-04-15 18:36:20 +00:00
player: function (player) {
if (player.countCards("h") <= 1) return 0;
2020-04-03 12:09:26 +00:00
return 0.5;
2024-04-15 18:36:20 +00:00
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
tag: {
loseCard: 1,
},
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
shuiyanqijun: {
fullskin: true,
type: "trick",
enable: true,
filterTarget: function (card, player, target) {
return target.countCards("e");
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
selectTarget: -1,
content: function () {
if (target.countCards("e")) target.chooseToDiscard("e", true);
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
reverseOrder: true,
ai: {
order: 9,
result: {
target: function (player, target) {
if (target.countCards("e")) return -1;
2020-04-03 12:09:26 +00:00
return 0;
2024-04-15 18:36:20 +00:00
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
tag: {
multitarget: 1,
multineg: 1,
},
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
toulianghuanzhu: {
fullskin: true,
type: "trick",
enable: true,
filterTarget: function (card, player, target) {
return target.countCards("h") > 0;
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
content: function () {
"step 0";
if (!target.countCards("h")) {
2020-04-03 12:09:26 +00:00
event.finish();
return;
}
2024-04-15 18:36:20 +00:00
var hs = player.getCards("h");
if (hs.length) {
var minval = get.value(hs[0]);
var colors = [get.color(hs[0])];
for (var i = 1; i < hs.length; i++) {
var val = get.value(hs[i], player, "raw");
if (val < minval) {
minval = val;
colors = [get.color(hs[i])];
} else if (val == minval) {
2020-04-03 12:09:26 +00:00
colors.add(get.color(hs[i]));
}
}
2024-04-15 18:36:20 +00:00
player.chooseCardButton("偷梁换柱", target.getCards("h")).ai = function (button) {
var val = get.value(button.link, player, "raw") - minval;
if (val >= 0) {
if (colors.includes(get.color(button.link))) {
val += 3;
2020-04-03 12:09:26 +00:00
}
}
return val;
2024-04-15 18:36:20 +00:00
};
} else {
2020-04-03 12:09:26 +00:00
player.viewHandcards(target);
event.finish();
}
2024-04-15 18:36:20 +00:00
"step 1";
if (result.bool) {
event.card = result.links[[0]];
player.chooseCard("h", true, "用一张手牌替换" + get.translation(event.card)).ai =
function (card) {
return -get.value(card);
};
} else {
2020-04-03 12:09:26 +00:00
event.finish();
}
2024-04-15 18:36:20 +00:00
"step 2";
if (result.bool) {
player.gain(event.card, target);
target.gain(result.cards, player);
player.$giveAuto(result.cards, target);
target.$giveAuto(event.card, player);
game.log(player, "与", target, "交换了一张手牌");
if (get.color(event.card) == get.color(result.cards[0])) {
2020-04-03 12:09:26 +00:00
player.draw();
}
2024-04-15 18:36:20 +00:00
target.addTempSkill("toulianghuanzhu_ai1");
} else {
target.addTempSkill("toulianghuanzhu_ai2");
2020-04-03 12:09:26 +00:00
}
},
2024-04-15 18:36:20 +00:00
ai: {
order: 8,
tag: {
loseCard: 1,
norepeat: 1,
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
result: {
target: function (player, target) {
if (player.countCards("h") <= 1) return 0;
if (target.hasSkill("toulianghuanzhu_ai2")) return 0;
if (target.hasSkill("toulianghuanzhu_ai1")) return 0.5;
2020-04-03 12:09:26 +00:00
return -1;
2024-04-15 18:36:20 +00:00
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
useful: [4, 1],
value: [6, 1],
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
huoshan: {
fullskin: true,
type: "delay",
cardcolor: "red",
cardnature: "fire",
toself: true,
modTarget: function (card, player, target) {
return lib.filter.judge(card, player, target);
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
enable: function (card, player) {
2020-04-03 12:09:26 +00:00
return player.canAddJudge(card);
},
2024-04-15 18:36:20 +00:00
filterTarget: function (card, player, target) {
return lib.filter.judge(card, player, target) && player == target;
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
selectTarget: [-1, -1],
judge: function (card) {
if (get.suit(card) == "heart" && get.number(card) > 1 && get.number(card) < 10) return -6;
2024-02-16 14:17:48 +00:00
return 1;
},
2024-04-15 18:36:20 +00:00
judge2: function (result) {
if (result.bool == false) return true;
2024-02-16 14:17:48 +00:00
return false;
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
effect: function () {
if (result.bool == false) {
player.damage(2, "fire", "nosource");
var players = game.filterPlayer(function (current) {
return get.distance(player, current) <= 1 && player != current;
2020-04-03 12:09:26 +00:00
});
players.sort(lib.sort.seat);
2024-04-15 18:36:20 +00:00
for (var i = 0; i < players.length; i++) {
players[i].damage(1, "fire", "nosource");
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
} else {
2020-04-03 12:09:26 +00:00
player.addJudgeNext(card);
}
},
2024-04-15 18:36:20 +00:00
cancel: function () {
2020-04-03 12:09:26 +00:00
player.addJudgeNext(card);
},
2024-04-15 18:36:20 +00:00
ai: {
basic: {
useful: 0,
value: 0,
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
order: 1,
result: {
target: function (player, target) {
return lib.card.shandian.ai.result.target(player, target);
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
tag: {
2020-04-03 12:09:26 +00:00
// damage:1,
// natureDamage:1,
// fireDamage:1,
2024-04-15 18:36:20 +00:00
},
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
hongshui: {
type: "delay",
toself: true,
enable: function (card, player) {
2020-04-03 12:09:26 +00:00
return player.canAddJudge(card);
},
2024-04-15 18:36:20 +00:00
modTarget: function (card, player, target) {
return lib.filter.judge(card, player, target);
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
filterTarget: function (card, player, target) {
return lib.filter.judge(card, player, target) && player == target;
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
selectTarget: [-1, -1],
judge: function (card) {
if (get.suit(card) == "club" && get.number(card) > 1 && get.number(card) < 10) return -3;
2024-02-16 14:17:48 +00:00
return 1;
},
2024-04-15 18:36:20 +00:00
judge2: function (result) {
if (result.bool == false) return true;
2024-02-16 14:17:48 +00:00
return false;
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
fullskin: true,
effect: function () {
if (result.bool == false) {
if (player.countCards("he") == 0) player.loseHp();
else {
player.discard(player.getCards("he").randomGets(3));
2020-04-03 12:09:26 +00:00
}
2024-04-15 18:36:20 +00:00
var players = get.players();
for (var i = 0; i < players.length; i++) {
var dist = get.distance(player, players[i]);
if (dist <= 2 && player != players[i]) {
var cs = players[i].getCards("he");
if (cs.length == 0) players[i].loseHp();
else {
players[i].discard(cs.randomGets(3 - Math.max(1, dist)));
2020-04-03 12:09:26 +00:00
}
}
}
2024-04-15 18:36:20 +00:00
} else {
2020-04-03 12:09:26 +00:00
player.addJudgeNext(card);
}
},
2024-04-15 18:36:20 +00:00
cancel: function () {
2020-04-03 12:09:26 +00:00
player.addJudgeNext(card);
},
2024-04-15 18:36:20 +00:00
ai: {
basic: {
useful: 0,
value: 0,
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
order: 1,
result: {
target: function (player, target) {
return lib.card.shandian.ai.result.target(player, target);
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
},
2020-04-03 12:09:26 +00:00
},
},
2024-04-15 18:36:20 +00:00
skill: {
toulianghuanzhu_ai1: {},
toulianghuanzhu_ai2: {},
suolianjia: {
trigger: { player: "damageBefore" },
filter: function (event, player) {
if (
event.source &&
event.source.hasSkillTag("unequip", false, {
name: event.card ? event.card.name : null,
target: player,
card: event.card,
})
)
return;
if (event.nature) return true;
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
forced: true,
content: function () {
2020-04-03 12:09:26 +00:00
trigger.cancel();
},
2024-04-15 18:36:20 +00:00
ai: {
nofire: true,
nothunder: true,
effect: {
target: function (card, player, target, current) {
if (target.hasSkillTag("unequip2")) return;
if (
player.hasSkillTag("unequip", false, {
name: card ? card.name : null,
target: player,
card: card,
}) ||
player.hasSkillTag("unequip_ai", false, {
name: card ? card.name : null,
target: target,
card: card,
})
)
return;
if (card.name == "tiesuo" || get.tag(card, "natureDamage"))
return "zeroplayertarget";
},
},
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
toulianghuanzhu2: {},
youdishenru: {
trigger: { source: "damageEnd" },
silent: true,
onremove: true,
filter: function (event, player) {
return (
event.card && event.card.name == "sha" && event.player == player.storage.youdishenru
);
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
content: function () {
2020-04-03 12:09:26 +00:00
delete player.storage.youdishenru;
2024-04-15 18:36:20 +00:00
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
g_youdishenru: {
trigger: { target: "shaBefore" },
direct: true,
filter: function (event, player) {
return (
!event.getParent().directHit.includes(player) && player.hasUsableCard("youdishenru")
);
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
content: function () {
event.youdiinfo = {
source: trigger.player,
evt: trigger,
2020-04-03 12:09:26 +00:00
};
2024-04-15 18:36:20 +00:00
player
.chooseToUse(function (card, player) {
if (get.name(card) != "youdishenru") return false;
return lib.filter.cardEnabled(card, player, "forceEnable");
}, "是否使用诱敌深入?")
.set("source", trigger.player);
},
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
g_chenhuodajie: {
trigger: { global: "damageEnd" },
direct: true,
filter: function (event, player) {
if (event.player == player) return false;
if (!event.player.countCards("he")) return false;
if (!lib.filter.targetEnabled({ name: "chenhuodajie" }, player, event.player))
return false;
if (event._notrigger.includes(event.player)) return false;
return player.hasUsableCard("chenhuodajie");
},
content: function () {
player.chooseToUse(
get.prompt("chenhuodajie", trigger.player).replace(/发动/, "使用"),
function (card, player) {
if (card.name != "chenhuodajie") return false;
return lib.filter.cardEnabled(card, player, "forceEnable");
},
trigger.player,
-1
).targetRequired = true;
2020-04-03 12:09:26 +00:00
},
},
},
2024-04-15 18:36:20 +00:00
translate: {
diaobingqianjiang: "调兵遣将",
diaobingqianjiang_info:
"出牌阶段对你及其他有手牌的角色使用。你摸一张牌然后亮出牌堆顶的X张牌X为存活角色数的一半向上取整目标可以用一张手牌替换其中的一张牌。结算后你可以将剩余的牌中的任意张以任意顺序置于牌堆顶。",
caochuanjiejian: "草船借箭",
caochuanjiejian_info:
"出牌阶段对一名有手牌的其他角色使用目标选择一项将手牌中的所有杀至少1张交给你并视为对你使用一张杀或展示手牌并令你弃置任意张。",
2020-04-03 12:09:26 +00:00
// xiaolicangdao:'笑里藏刀',
2023-10-15 08:29:56 +00:00
// xiaolicangdao_info:'出牌阶段对一名其他角色使用。你将此【笑里藏刀】交给目标然后弃置其一张手牌若这两张牌牌名相同你对其造成1点伤害。',
2024-04-15 18:36:20 +00:00
shezhanqunru: "舌战群儒",
shezhanqunru_info:
"出牌阶段,对你使用。你请求所有有手牌的其他角色响应,然后同时与响应的角色拼点。若有角色响应且结果中你赢的次数更多,或若没有角色响应,你摸三张牌。",
youdishenru: "诱敌深入",
youdishenru_info:
"当以你为目标的【杀】生效前对此【杀】使用。抵消此【杀】然后此【杀】的使用者需对你使用【杀】在此【杀】结算结束之后若此【杀】未对你造成伤害其重复此流程否则受到你造成的1点伤害。",
suolianjia: "锁链甲",
suolianjia_info: "锁定技,你防止即将受到的属性伤害,当装备时进入连环状态,当卸下时解除连环状态。",
suolianjia_bg: "链",
geanguanhuo: "隔岸观火",
geanguanhuo_info:
"出牌阶段对一名其他角色使用令目标与一名你指定的另一名角色拼点赢的角色获得对方的一张牌若点数相同目标可弃置你一张牌存活角色不超过2时可重铸。",
toulianghuanzhu: "偷梁换柱",
toulianghuanzhu_info:
"出牌阶段对一名其他角色使用,你观看其手牌,然后可以用一张手牌替牌其中的一张;若两张牌颜色相同,你摸一张牌。",
toulianghuanzhu_bg: "柱",
fudichouxin: "釜底抽薪",
fudichouxin_info: "与一名角色进行拼点,若成功则获得双方拼点牌。",
shuiyanqijun: "水攻",
shuiyanqijun_info: "令所有有装备的角色各弃置一张装备牌。",
wangmeizhike: "望梅止渴",
wangmeizhike_info:
"出牌阶段对一名角色使用若没有角色体力比目标少目标回复1点体力若没有角色手牌比目标少目标摸两张牌若因此牌回复了体力则改为摸一张。",
chenhuodajie: "趁火打劫",
chenhuodajie_info: "任意一名其他角色受到伤害时对其使用,获得其一张牌。",
huoshan: "火山",
huoshan_info:
"出牌阶段对自己使用。若判定结果为红桃2~9则目标角色受到2点火焰伤害距离目标1以内的其他角色受到1点火焰伤害。若判定结果不为红桃2~9将之移动到下家的判定区里。",
hongshui: "洪水",
hongshui_info:
"出牌阶段对自己使用。若判定结果为梅花2~9该角色随机弃置三张牌距离该角色为X的角色随机弃置3-X张牌若没有牌则失去1点体力。若判定结果不为梅花2~9将之移动到下家的判定区里。",
2020-04-03 12:09:26 +00:00
},
2024-04-15 18:36:20 +00:00
list: [
["heart", 6, "huoshan", "fire"],
["club", 7, "hongshui"],
["diamond", 3, "guohe"],
2024-04-15 18:36:20 +00:00
["diamond", 4, "fudichouxin"],
["club", 6, "fudichouxin"],
["spade", 1, "fudichouxin"],
["club", 7, "shuiyanqijun"],
["club", 8, "shuiyanqijun"],
["club", 8, "guohe"],
["spade", 9, "shuiyanqijun"],
["heart", 9, "toulianghuanzhu"],
["club", 10, "toulianghuanzhu"],
["spade", 13, "guohe"],
["heart", 6, "wangmeizhike"],
["club", 1, "wangmeizhike"],
["diamond", 6, "chenhuodajie"],
["diamond", 9, "chenhuodajie"],
["club", 3, "chenhuodajie"],
2024-04-15 18:36:20 +00:00
["club", 13, "suolianjia"],
2024-04-15 18:36:20 +00:00
["club", 3, "caochuanjiejian"],
["spade", 7, "caochuanjiejian"],
2020-04-03 12:09:26 +00:00
// ['spade',5,'xiaolicangdao'],
// ['diamond',11,'xiaolicangdao'],
2024-04-15 18:36:20 +00:00
["heart", 1, "geanguanhuo"],
["spade", 6, "geanguanhuo"],
["heart", 4, "shezhanqunru"],
["club", 8, "shezhanqunru"],
["diamond", 1, "diaobingqianjiang"],
["spade", 2, "diaobingqianjiang"],
["heart", 12, "youdishenru"],
["club", 2, "youdishenru"],
["spade", 9, "youdishenru"],
2020-04-03 12:09:26 +00:00
],
};
});