族钟繇【诫厉】调整

This commit is contained in:
mengxinzxz 2024-04-30 00:58:59 +08:00
parent 2c73163628
commit a924faaa8a
1 changed files with 89 additions and 132 deletions

View File

@ -189,70 +189,29 @@ game.import("character", function () {
}); });
}, },
async cost(event, trigger, player) { async cost(event, trigger, player) {
let num = 0; const num = player.getHistory("useCard").length > 0 ? Math.max(...player.getHistory("useCard").map(history => get.cardNameLength(history.card))) : 0;
if (player.getHistory("useCard").length) { const str = num > 0 ? "并观看牌堆顶" + get.cnNumber(num) + "张牌,然后你可以交换其中任意张牌" : "";
for (const history of player.getHistory("useCard")) {
if (num < get.cardNameLength(history.card)) {
num = get.cardNameLength(history.card);
}
}
}
const str = num > 0 ? "并观看牌堆顶" + get.cnNumber(num) + "张牌,然后你可以交换其中等量的牌" : "";
event.result = await player event.result = await player
.chooseTarget(get.prompt("clanjieli"), "观看一名角色的牌名字数最多的手牌" + str, (card, player, target) => { .chooseTarget(get.prompt("clanjieli"), "观看一名角色的牌名字数最多的手牌" + str, (card, player, target) => {
return target.countCards("h"); return target.countCards("h");
}) })
.set("ai", target => { .set("ai", target => {
const player = get.event("player"), const player = get.event("player");
num = get.event("num"); const num = Math.max(...target.getCards("h").map(card => get.cardNameLength(card)));
let map = {}; return num + 0.0001 * get.attitude(player, target);
for (const i of target.getCards("h")) {
if (!map[get.cardNameLength(i)]) {
map[get.cardNameLength(i)] = 0;
}
map[get.cardNameLength(i)]++;
}
let list = Object.keys(map).sort((a, b) => map[b] - map[a]);
list = list.filter(i => map[i] == map[list[0]]).map(i => parseInt(i));
if (
num >=
target.countCards("h", card => {
return list.includes(get.cardNameLength(card));
}) })
)
return target.countCards("h") * 5 * get.sgn(get.sgn(get.attitude(player, target)) - 0.5);
return -target.countCards("h");
})
.set("num", num)
.forResult(); .forResult();
}, },
async content(event, trigger, player) { async content(event, trigger, player) {
const target = event.targets[0]; const target = event.targets[0];
let num = 0; const num = player.getHistory("useCard").length > 0 ? Math.max(...player.getHistory("useCard").map(history => get.cardNameLength(history.card))) : 0;
if (player.getHistory("useCard").length) { const limit = Math.max(...target.getCards("h").map(card => get.cardNameLength(card)));
for (const history of player.getHistory("useCard")) { const cards = target.getCards("h", card => get.cardNameLength(card) == limit);
if (num < get.cardNameLength(history.card)) { if (num > 0) {
num = get.cardNameLength(history.card);
}
}
}
let map = {};
for (const i of target.getCards("h")) {
if (!map[get.cardNameLength(i)]) {
map[get.cardNameLength(i)] = 0;
}
map[get.cardNameLength(i)]++;
}
let list = Object.keys(map).sort((a, b) => map[b] - map[a]);
list = list.filter(i => map[i] == map[list[0]]).map(i => parseInt(i));
const cards = target.getCards("h", card => {
return list.includes(get.cardNameLength(card));
});
if (num > 0 && cards.length >= num) {
const topCards = get.cards(num); const topCards = get.cards(num);
game.updateRoundNumber(); await game.cardsGotoOrdering(topCards);
const result = await player const result = await player
.chooseToMove("诫厉:交换其中" + get.cnNumber(num) + "张牌") .chooseToMove("诫厉:交换其中任意张牌")
.set("list", [ .set("list", [
[get.translation(target) + "牌名字数最多的手牌", cards, "dcsushou_tag"], [get.translation(target) + "牌名字数最多的手牌", cards, "dcsushou_tag"],
["牌堆顶", topCards], ["牌堆顶", topCards],
@ -260,23 +219,27 @@ game.import("character", function () {
.set("filterMove", (from, to) => { .set("filterMove", (from, to) => {
return typeof to != "number"; return typeof to != "number";
}) })
.set("num", num)
.set("filterOk", moved => { .set("filterOk", moved => {
return moved[1].every(card => get.owner(card)); return moved[1].some(card => get.owner(card));
}) })
.set("processAI", list => { .set("processAI", list => {
const num = Math.min(list[0][1].length, list[1][1].length);
const player = get.event("player"), const player = get.event("player"),
target = get.event().getParent().targets[0]; target = get.event().getParent().targets[0];
const sgn = get.sgn(get.sgn(get.attitude(player, target)) - 0.5); const sgn = get.sgn(get.sgn(get.attitude(player, target)) - 0.5);
const cards1 = list[0][1].slice().sort((a, b) => get.value(a, "raw") * sgn - get.value(b, "raw") * sgn); const cards1 = list[0][1].slice().sort((a, b) => get.value(a, "raw") * sgn - get.value(b, "raw") * sgn);
const cards2 = list[1][1].slice().sort((a, b) => get.value(b, "raw") * sgn - get.value(a, "raw") * sgn); const cards2 = list[1][1].slice().sort((a, b) => get.value(b, "raw") * sgn - get.value(a, "raw") * sgn);
return [cards1.slice().addArray(cards2.slice(0, get.event("num"))), cards2.slice().addArray(cards1.slice(0, get.event("num")))]; return [cards1.slice().addArray(cards2.slice(0, num)), cards2.slice().addArray(cards1.slice(0, num))];
}) })
.forResult(); .forResult();
if (result.bool) { if (result.bool) {
const lose = result.moved[1].slice(); const lose = result.moved[1].slice();
const gain = result.moved[0].slice().filter(i => !get.owner(i)); const gain = result.moved[0].slice().filter(i => !get.owner(i));
if (lose.length) await target.lose(lose, ui.special); if (lose.some(i => get.owner(i)))
await target.lose(
lose.filter(i => get.owner(i)),
ui.special
);
for (let i = lose.length - 1; i--; i >= 0) { for (let i = lose.length - 1; i--; i >= 0) {
ui.cardPile.insertBefore(lose[i], ui.cardPile.firstChild); ui.cardPile.insertBefore(lose[i], ui.cardPile.firstChild);
} }
@ -284,13 +247,7 @@ game.import("character", function () {
if (gain.length) await target.gain(gain, "draw"); if (gain.length) await target.gain(gain, "draw");
} }
} else { } else {
let content = ['<div class="text center">' + get.translation(target) + "牌名字数最多的手牌</div>", cards]; const content = ['###诫厉###<div class="text center">' + get.translation(target) + "牌名字数最多的手牌</div>", cards];
if (num > 0) {
const topCards = get.cards(num, true);
game.updateRoundNumber();
content.push('<div class="text center">牌堆顶</div>');
content.push(topCards);
}
await player.chooseControl("ok").set("dialog", content); await player.chooseControl("ok").set("dialog", content);
} }
}, },
@ -769,7 +726,7 @@ game.import("character", function () {
} else event.goto(2); } else event.goto(2);
} }
} else event.goto(2); } else event.goto(2);
("step 1"); "step 1";
if (result.bool) { if (result.bool) {
var key = `${get.suit(trigger.card)}+${get.type2(trigger.card)}`, var key = `${get.suit(trigger.card)}+${get.type2(trigger.card)}`,
name = result.links[0][2]; name = result.links[0][2];
@ -779,7 +736,7 @@ game.import("character", function () {
game.log(player, "记录了", "#y" + get.translation(name)); game.log(player, "记录了", "#y" + get.translation(name));
game.delayx(); game.delayx();
} }
("step 2"); "step 2";
if (Object.values(player.getStorage("clanbaichu")).includes(trigger.card.name)) { if (Object.values(player.getStorage("clanbaichu")).includes(trigger.card.name)) {
player.chooseDrawRecover(true); player.chooseDrawRecover(true);
} }
@ -829,7 +786,7 @@ game.import("character", function () {
return num1 >= num2 ? 1 : 0; return num1 >= num2 ? 1 : 0;
}) })
.set("target", player); .set("target", player);
("step 1"); "step 1";
player.addSkill("clanqiuxin_effect"); player.addSkill("clanqiuxin_effect");
player.markAuto("clanqiuxin_effect", [[target, result.index]]); player.markAuto("clanqiuxin_effect", [[target, result.index]]);
}, },
@ -896,7 +853,7 @@ game.import("character", function () {
player.unmarkAuto("clanqiuxin_effect", list); player.unmarkAuto("clanqiuxin_effect", list);
var targets = list.map(listx => listx[0]); var targets = list.map(listx => listx[0]);
event.targets = targets; event.targets = targets;
("step 1"); "step 1";
var target = event.targets.shift(); var target = event.targets.shift();
event.target = target; event.target = target;
var list = []; var list = [];
@ -926,7 +883,7 @@ game.import("character", function () {
}) })
.set("target", target); .set("target", target);
} }
("step 2"); "step 2";
if (result.bool) { if (result.bool) {
var card = { var card = {
name: result.links[0][2], name: result.links[0][2],
@ -934,7 +891,7 @@ game.import("character", function () {
}; };
player.useCard(card, target, false); player.useCard(card, target, false);
} }
("step 3"); "step 3";
if (event.targets.length) event.goto(1); if (event.targets.length) event.goto(1);
else if (!player.getStorage("clanqiuxin_effect").length) player.removeSkill("clanqiuxin_effect"); else if (!player.getStorage("clanqiuxin_effect").length) player.removeSkill("clanqiuxin_effect");
}, },
@ -973,7 +930,7 @@ game.import("character", function () {
return get.cardNameLength(card) == num; return get.cardNameLength(card) == num;
}) })
); );
("step 1"); "step 1";
if (result.bool) trigger.player.recast(result.cards); if (result.bool) trigger.player.recast(result.cards);
}, },
}, },
@ -996,7 +953,7 @@ game.import("character", function () {
return _status.event.getTrigger().targets.includes(target); return _status.event.getTrigger().targets.includes(target);
}) })
.set("ai", target => get.attitude(_status.event.player, target)); .set("ai", target => get.attitude(_status.event.player, target));
("step 1"); "step 1";
if (result.bool) { if (result.bool) {
var target = result.targets[0]; var target = result.targets[0];
player.logSkill("clanjiejian", target); player.logSkill("clanjiejian", target);
@ -1059,7 +1016,7 @@ game.import("character", function () {
"step 0"; "step 0";
player.draw(get.cardNameLength(trigger.card)); player.draw(get.cardNameLength(trigger.card));
if (player.isDamaged()) player.chooseToDiscard(player.getDamagedHp(), "he", true); if (player.isDamaged()) player.chooseToDiscard(player.getDamagedHp(), "he", true);
("step 1"); "step 1";
if (player.getHistory("useSkill", evt => evt.skill == "clanhuanghan").length > 1 && player.hasSkill("clanbaozu", null, false, false) && player.awakenedSkills.includes("clanbaozu")) { if (player.getHistory("useSkill", evt => evt.skill == "clanhuanghan").length > 1 && player.hasSkill("clanbaozu", null, false, false) && player.awakenedSkills.includes("clanbaozu")) {
player.restoreSkill("clanbaozu"); player.restoreSkill("clanbaozu");
player.popup("保族"); player.popup("保族");
@ -1106,7 +1063,7 @@ game.import("character", function () {
true true
).logSkill = "clanyuzhi"; ).logSkill = "clanyuzhi";
} }
("step 1"); "step 1";
player.removeGaintag("clanyuzhi"); player.removeGaintag("clanyuzhi");
var num1 = player var num1 = player
.getRoundHistory( .getRoundHistory(
@ -1143,11 +1100,11 @@ game.import("character", function () {
if (player.hasSkill("clanbaozu", null, false, false)) player.chooseBool("迂志:是否失去〖保族〗?", "若选择“否”则你受到1点雷属性伤害").set("choice", player.awakenedSkills.includes("clanbaozu")); if (player.hasSkill("clanbaozu", null, false, false)) player.chooseBool("迂志:是否失去〖保族〗?", "若选择“否”则你受到1点雷属性伤害").set("choice", player.awakenedSkills.includes("clanbaozu"));
else event._result = { bool: false }; else event._result = { bool: false };
} else event.goto(3); } else event.goto(3);
("step 2"); "step 2";
if (result.bool) { if (result.bool) {
player.removeSkills("clanbaozu"); player.removeSkills("clanbaozu");
} else player.damage(1, "thunder"); } else player.damage(1, "thunder");
("step 3"); "step 3";
if (player.countCards("h")) { if (player.countCards("h")) {
player player
.chooseCard( .chooseCard(
@ -1173,7 +1130,7 @@ game.import("character", function () {
) )
.set("num", event.num1); .set("num", event.num1);
} else event.finish(); } else event.finish();
("step 4"); "step 4";
if (result.bool) { if (result.bool) {
player.logSkill("clanyuzhi"); player.logSkill("clanyuzhi");
player.showCards(result.cards, get.translation(player) + "发动了【迂志】"); player.showCards(result.cards, get.translation(player) + "发动了【迂志】");
@ -1292,7 +1249,7 @@ game.import("character", function () {
} else { } else {
player.gainPlayerCard(target, "h", true); player.gainPlayerCard(target, "h", true);
} }
("step 1"); "step 1";
var evtx = event.getParent("phaseUse"); var evtx = event.getParent("phaseUse");
if ( if (
player.countCards("h") == target.countCards("h") && player.countCards("h") == target.countCards("h") &&
@ -1330,7 +1287,7 @@ game.import("character", function () {
}); });
} else event.finish(); } else event.finish();
} else event.finish(); } else event.finish();
("step 2"); "step 2";
if (result.bool) { if (result.bool) {
var card = { var card = {
name: result.links[0][2], name: result.links[0][2],
@ -1450,7 +1407,7 @@ game.import("character", function () {
return get.cardNameLength(card) == num; return get.cardNameLength(card) == num;
}) })
); );
("step 1"); "step 1";
if (result.bool) trigger.player.recast(result.cards); if (result.bool) trigger.player.recast(result.cards);
}, },
}, },
@ -1613,7 +1570,7 @@ game.import("character", function () {
var trigger = _status.event.getTrigger(); var trigger = _status.event.getTrigger();
return get.effect(target, trigger.card, player, player); return get.effect(target, trigger.card, player, player);
}); });
("step 1"); "step 1";
if (result.bool) { if (result.bool) {
var targets = result.targets.sortBySeat(); var targets = result.targets.sortBySeat();
player.logSkill("clanmingjie_effect", targets); player.logSkill("clanmingjie_effect", targets);
@ -1655,7 +1612,7 @@ game.import("character", function () {
var cards = player.getStorage("clanmingjie_record").slice(); var cards = player.getStorage("clanmingjie_record").slice();
cards = cards.filterInD("d"); cards = cards.filterInD("d");
event.cards = cards; event.cards = cards;
("step 1"); "step 1";
player player
.chooseButton(["铭戒:是否使用这些牌?", cards]) .chooseButton(["铭戒:是否使用这些牌?", cards])
.set("filterButton", button => { .set("filterButton", button => {
@ -1664,7 +1621,7 @@ game.import("character", function () {
.set("ai", button => { .set("ai", button => {
return _status.event.player.getUseValue(button.link); return _status.event.player.getUseValue(button.link);
}); });
("step 2"); "step 2";
if (result.bool) { if (result.bool) {
var card = result.links[0]; var card = result.links[0];
event.cards.remove(card); event.cards.remove(card);
@ -1672,7 +1629,7 @@ game.import("character", function () {
game.delayx(); game.delayx();
player.chooseUseTarget(card, true); player.chooseUseTarget(card, true);
} else event.finish(); } else event.finish();
("step 3"); "step 3";
if ( if (
event.cards.filter(card => { event.cards.filter(card => {
return get.position(card, true) == "d" && player.hasUseTarget(card); return get.position(card, true) == "d" && player.hasUseTarget(card);
@ -1800,13 +1757,13 @@ game.import("character", function () {
}) })
.set("num", ret); .set("num", ret);
} }
("step 1"); "step 1";
if (result.bool) { if (result.bool) {
event.cards = result.links; event.cards = result.links;
} else { } else {
event.finish(); event.finish();
} }
("step 2"); "step 2";
var count = cards.length; var count = cards.length;
event.getParent().viewedCount = count; event.getParent().viewedCount = count;
player player
@ -1842,7 +1799,7 @@ game.import("character", function () {
return 4; return 4;
})() })()
); );
("step 3"); "step 3";
if (result.bool) { if (result.bool) {
var card = result.links[0]; var card = result.links[0];
cards.remove(card); cards.remove(card);
@ -1979,7 +1936,7 @@ game.import("character", function () {
content() { content() {
"step 0"; "step 0";
player.awakenSkill("clanbaozu"); player.awakenSkill("clanbaozu");
("step 1"); "step 1";
trigger.player.link(true); trigger.player.link(true);
trigger.player.recover(); trigger.player.recover();
}, },
@ -2024,7 +1981,7 @@ game.import("character", function () {
return true; return true;
})() })()
); );
("step 1"); "step 1";
if (result.bool) { if (result.bool) {
var cards = result.cards; var cards = result.cards;
target.give(cards, player); target.give(cards, player);
@ -2033,7 +1990,7 @@ game.import("character", function () {
} else { } else {
player.chooseCard("驳龙:交给" + get.translation(target) + "一张牌", get.translation(target) + "拒绝给牌,请交给其一张牌然后视为对其使用一张雷【杀】", true, "he"); player.chooseCard("驳龙:交给" + get.translation(target) + "一张牌", get.translation(target) + "拒绝给牌,请交给其一张牌然后视为对其使用一张雷【杀】", true, "he");
} }
("step 2"); "step 2";
if (result.bool) { if (result.bool) {
var cards = result.cards; var cards = result.cards;
player.give(cards, target); player.give(cards, target);
@ -2225,18 +2182,18 @@ game.import("character", function () {
target.addTempSkill("clanlianzhu_targeted", "phaseUseAfter"); target.addTempSkill("clanlianzhu_targeted", "phaseUseAfter");
if (target.storage.clanlianzhu) event.goto(4); if (target.storage.clanlianzhu) event.goto(4);
target.changeZhuanhuanji("clanlianzhu"); target.changeZhuanhuanji("clanlianzhu");
("step 1"); "step 1";
player.recast(cards); player.recast(cards);
("step 2"); "step 2";
if (!target.countCards("he") && !_status.connectMode) event._result = { bool: false }; if (!target.countCards("he") && !_status.connectMode) event._result = { bool: false };
else target.chooseCard("he", "联诛:是否重铸一张牌?", lib.filter.cardRecastable); else target.chooseCard("he", "联诛:是否重铸一张牌?", lib.filter.cardRecastable);
("step 3"); "step 3";
if (result.bool) { if (result.bool) {
target.recast(result.cards); target.recast(result.cards);
if (get.color(cards[0]) === get.color(result.cards[0])) lib.skill.chenliuwushi.change(target, 1); if (get.color(cards[0]) === get.color(result.cards[0])) lib.skill.chenliuwushi.change(target, 1);
} }
event.finish(); event.finish();
("step 4"); "step 4";
target target
.chooseTarget("联诛:选择其与你使用【杀】的目标", true, (card, player, target) => { .chooseTarget("联诛:选择其与你使用【杀】的目标", true, (card, player, target) => {
if (target == player || target == _status.event.sourcex) return false; if (target == player || target == _status.event.sourcex) return false;
@ -2246,7 +2203,7 @@ game.import("character", function () {
return get.effect(target, { name: "sha" }, _status.event.player, _status.event.player); return get.effect(target, { name: "sha" }, _status.event.player, _status.event.player);
}) })
.set("sourcex", player); .set("sourcex", player);
("step 5"); "step 5";
if (result.bool) { if (result.bool) {
var targetx = result.targets[0]; var targetx = result.targets[0];
event.targetx = targetx; event.targetx = targetx;
@ -2255,7 +2212,7 @@ game.import("character", function () {
event.cards = []; event.cards = [];
if (!event.isMine() && !event.isOnline()) game.delayx(); if (!event.isMine() && !event.isOnline()) game.delayx();
} else event.finish(); } else event.finish();
("step 6"); "step 6";
var current = targets.shift(); var current = targets.shift();
current current
.chooseToUse(function (card, player, event) { .chooseToUse(function (card, player, event) {
@ -2270,10 +2227,10 @@ game.import("character", function () {
}) })
.set("sourcex", event.targetx) .set("sourcex", event.targetx)
.set("addCount", false); .set("addCount", false);
("step 7"); "step 7";
if (result.bool) cards.push(result.card); if (result.bool) cards.push(result.card);
if (targets.length > 0) event.goto(6); if (targets.length > 0) event.goto(6);
("step 8"); "step 8";
if (cards.length > 1) { if (cards.length > 1) {
const color = get.color(cards[0], false); const color = get.color(cards[0], false);
if (color != "none") { if (color != "none") {
@ -2352,7 +2309,7 @@ game.import("character", function () {
return game.hasNature(card, "linked"); return game.hasNature(card, "linked");
}) })
); );
("step 1"); "step 1";
if (result.bool) { if (result.bool) {
var target = result.targets[0]; var target = result.targets[0];
event.target = target; event.target = target;
@ -2376,7 +2333,7 @@ game.import("character", function () {
return 2 * get.effect(target, { name: "draw" }, player, player) + 0.6 * get.effect(player, { name: "draw" }, player, player) > get.recoverEffect(target, player, player) ? 0 : 1; return 2 * get.effect(target, { name: "draw" }, player, player) + 0.6 * get.effect(player, { name: "draw" }, player, player) > get.recoverEffect(target, player, player) ? 0 : 1;
}); });
} else event.finish(); } else event.finish();
("step 2"); "step 2";
if (result.control == "选项一") { if (result.control == "选项一") {
player.draw(2); player.draw(2);
if (player == target) event.finish(); if (player == target) event.finish();
@ -2384,7 +2341,7 @@ game.import("character", function () {
target.recover(); target.recover();
event.finish(); event.finish();
} }
("step 3"); "step 3";
if (!player.countCards("he")) event.finish(); if (!player.countCards("he")) event.finish();
else if (player.countCards("he") <= 2) else if (player.countCards("he") <= 2)
event._result = { event._result = {
@ -2394,7 +2351,7 @@ game.import("character", function () {
else { else {
player.chooseCard("放赈:交给" + get.translation(target) + "两张牌", "he", 2, true); player.chooseCard("放赈:交给" + get.translation(target) + "两张牌", "he", 2, true);
} }
("step 4"); "step 4";
if (result.bool) { if (result.bool) {
player.give(result.cards, target); player.give(result.cards, target);
} }
@ -2443,14 +2400,14 @@ game.import("character", function () {
} }
return get.type(ts[0]) != "basic"; return get.type(ts[0]) != "basic";
}); });
("step 1"); "step 1";
if (result.bool) { if (result.bool) {
var target = result.targets[0]; var target = result.targets[0];
event.target = target; event.target = target;
player.logSkill("clanliuju", target); player.logSkill("clanliuju", target);
player.chooseToCompare(target).set("small", true); player.chooseToCompare(target).set("small", true);
} else event.finish(); } else event.finish();
("step 2"); "step 2";
if (!result.tie) { if (!result.tie) {
var loser = result.bool ? target : player; var loser = result.bool ? target : player;
var cards = []; var cards = [];
@ -2467,7 +2424,7 @@ game.import("character", function () {
if (cards.length) event.cards = cards; if (cards.length) event.cards = cards;
else event.finish(); else event.finish();
} else event.finish(); } else event.finish();
("step 3"); "step 3";
var cardsx = cards.filter(i => get.position(i, true) == "d" && event.loser.hasUseTarget(i)); var cardsx = cards.filter(i => get.position(i, true) == "d" && event.loser.hasUseTarget(i));
if (!cardsx.length) event.goto(6); if (!cardsx.length) event.goto(6);
else else
@ -2479,7 +2436,7 @@ game.import("character", function () {
.set("ai", button => { .set("ai", button => {
return _status.event.player.getUseValue(button.link) + 0.1; return _status.event.player.getUseValue(button.link) + 0.1;
}); });
("step 4"); "step 4";
if (result.bool) { if (result.bool) {
var card = result.links[0]; var card = result.links[0];
event.cards.remove(card); event.cards.remove(card);
@ -2487,9 +2444,9 @@ game.import("character", function () {
game.delayx(); game.delayx();
event.loser.chooseUseTarget(true, card, false); event.loser.chooseUseTarget(true, card, false);
} else event.goto(6); } else event.goto(6);
("step 5"); "step 5";
if (cards.filter(i => get.position(i, true) == "d" && event.loser.hasUseTarget(i)).length) event.goto(3); if (cards.filter(i => get.position(i, true) == "d" && event.loser.hasUseTarget(i)).length) event.goto(3);
("step 6"); "step 6";
if (get.distance(player, target) != event.distance[0] || get.distance(target, player) != event.distance[1]) { if (get.distance(player, target) != event.distance[0] || get.distance(target, player) != event.distance[1]) {
player.restoreSkill("clanxumin"); player.restoreSkill("clanxumin");
game.log(player, "重置了", "#g【恤民】"); game.log(player, "重置了", "#g【恤民】");
@ -2545,7 +2502,7 @@ game.import("character", function () {
if (att > 0) att /= 1.2; if (att > 0) att /= 1.2;
return Math.abs(att); return Math.abs(att);
}); });
("step 1"); "step 1";
if (result.bool) { if (result.bool) {
var targets = result.targets.sortBySeat(); var targets = result.targets.sortBySeat();
targets.forEach(i => i.link(true)); targets.forEach(i => i.link(true));
@ -2571,7 +2528,7 @@ game.import("character", function () {
"step 0"; "step 0";
player.unmarkAuto("clanlianhe_effect", [trigger.player]); player.unmarkAuto("clanlianhe_effect", [trigger.player]);
if (trigger.name == "die") event.finish(); if (trigger.name == "die") event.finish();
("step 1"); "step 1";
if ( if (
trigger.player.hasHistory("gain", evt => { trigger.player.hasHistory("gain", evt => {
return evt.getParent().name == "draw" && evt.getParent("phaseUse") == trigger; return evt.getParent().name == "draw" && evt.getParent("phaseUse") == trigger;
@ -2599,7 +2556,7 @@ game.import("character", function () {
.set("draw", get.attitude(trigger.player, player) >= 0); .set("draw", get.attitude(trigger.player, player) >= 0);
} }
} }
("step 2"); "step 2";
if (result.bool) { if (result.bool) {
trigger.player.give(result.cards, player); trigger.player.give(result.cards, player);
} else player.draw(num + 1); } else player.draw(num + 1);
@ -2631,14 +2588,14 @@ game.import("character", function () {
} }
return 0; return 0;
}); });
("step 1"); "step 1";
if (result.bool) { if (result.bool) {
var target = result.targets[0]; var target = result.targets[0];
event.target = target; event.target = target;
player.logSkill("clanhuanjia", target); player.logSkill("clanhuanjia", target);
player.chooseToCompare(target); player.chooseToCompare(target);
} else event.finish(); } else event.finish();
("step 2"); "step 2";
if (!result.tie) { if (!result.tie) {
var winner = result.bool ? player : target; var winner = result.bool ? player : target;
var cards = []; var cards = [];
@ -2649,7 +2606,7 @@ game.import("character", function () {
if (cards.length) event.cards = cards; if (cards.length) event.cards = cards;
else event.finish(); else event.finish();
} else event.finish(); } else event.finish();
("step 3"); "step 3";
var cardsx = cards.filter(i => get.position(i, true) == "d" && event.winner.hasUseTarget(i)); var cardsx = cards.filter(i => get.position(i, true) == "d" && event.winner.hasUseTarget(i));
if (!cardsx.length) event.goto(6); if (!cardsx.length) event.goto(6);
else else
@ -2664,7 +2621,7 @@ game.import("character", function () {
return _status.event.player.getUseValue(button.link) * damage + 0.1; return _status.event.player.getUseValue(button.link) * damage + 0.1;
}) })
.set("att", get.attitude(event.winner, player)); .set("att", get.attitude(event.winner, player));
("step 4"); "step 4";
if (result.bool) { if (result.bool) {
var card = result.links[0]; var card = result.links[0];
event.card = card; event.card = card;
@ -2673,7 +2630,7 @@ game.import("character", function () {
game.delayx(); game.delayx();
event.winner.chooseUseTarget(true, card, false); event.winner.chooseUseTarget(true, card, false);
} }
("step 5"); "step 5";
if ( if (
game.hasPlayer2(current => { game.hasPlayer2(current => {
return current.hasHistory("sourceDamage", evt => evt.cards && evt.cards[0] == card); return current.hasHistory("sourceDamage", evt => evt.cards && evt.cards[0] == card);
@ -2709,7 +2666,7 @@ game.import("character", function () {
player.gain(cards, "gain2"); player.gain(cards, "gain2");
event.finish(); event.finish();
} }
("step 6"); "step 6";
player.removeSkills(result.control); player.removeSkills(result.control);
}, },
ai: { ai: {
@ -2749,7 +2706,7 @@ game.import("character", function () {
trigger.cards.map(i => get.value(i)) trigger.cards.map(i => get.value(i))
) <= 5 || trigger.cards.filterInD("oe").length == 0 ) <= 5 || trigger.cards.filterInD("oe").length == 0
); );
("step 1"); "step 1";
if (result.bool) { if (result.bool) {
var target = result.targets[0], var target = result.targets[0],
num = lib.skill.clansankuang.getNum(target), num = lib.skill.clansankuang.getNum(target),
@ -2770,13 +2727,13 @@ game.import("character", function () {
.set("prompt", num > 0 ? "是否交给" + get.translation(player) + "任意张牌" + (cards.length ? "并获得" + get.translation(cards) : "") + "" : "交给" + get.translation(player) + "至少" + get.cnNumber(num) + "张牌"); .set("prompt", num > 0 ? "是否交给" + get.translation(player) + "任意张牌" + (cards.length ? "并获得" + get.translation(cards) : "") + "" : "交给" + get.translation(player) + "至少" + get.cnNumber(num) + "张牌");
} }
} else event.finish(); } else event.finish();
("step 2"); "step 2";
if (result.bool) { if (result.bool) {
var cards = result.cards; var cards = result.cards;
target.give(cards, player); target.give(cards, player);
game.delayx(); game.delayx();
} else event.finish(); } else event.finish();
("step 3"); "step 3";
if (trigger.cards.filterInD().length) target.gain(trigger.cards.filterInD(), "gain2", "bySelf"); if (trigger.cards.filterInD().length) target.gain(trigger.cards.filterInD(), "gain2", "bySelf");
else if (trigger.cards.filterInD("e").length) target.gain(trigger.cards.filterInD("e"), get.owner(trigger.cards.filterInD("e")[0]), "give"); else if (trigger.cards.filterInD("e").length) target.gain(trigger.cards.filterInD("e"), get.owner(trigger.cards.filterInD("e")[0]), "give");
}, },
@ -2893,7 +2850,7 @@ game.import("character", function () {
nature: button.link[3], nature: button.link[3],
}); });
}); });
("step 1"); "step 1";
if (result.bool) { if (result.bool) {
var name = result.links[0][2], var name = result.links[0][2],
nature = result.links[0][3]; nature = result.links[0][3];
@ -2972,7 +2929,7 @@ game.import("character", function () {
content() { content() {
"step 0"; "step 0";
target.recover(); target.recover();
("step 1"); "step 1";
var name = get.translation(target); var name = get.translation(target);
player player
.chooseControl() .chooseControl()
@ -2993,7 +2950,7 @@ game.import("character", function () {
else return "选项二"; else return "选项二";
})() })()
); );
("step 2"); "step 2";
var players = [target, player]; var players = [target, player];
if (result.control == "选项二") players.reverse(); if (result.control == "选项二") players.reverse();
var card = { name: "sha", nature: "ice", isCard: true }; var card = { name: "sha", nature: "ice", isCard: true };
@ -3206,7 +3163,7 @@ game.import("character", function () {
var cards = player.getCards("h", choice); var cards = player.getCards("h", choice);
if (cards.length) player.discard(cards); if (cards.length) player.discard(cards);
} }
("step 1"); "step 1";
if (!player.isIn() || !game.hasPlayer(current => current != player)) event.finish(); if (!player.isIn() || !game.hasPlayer(current => current != player)) event.finish();
else else
player.chooseTarget("烈誓:令一名其他角色选择另一项", lib.filter.notMe, true).set("ai", target => { player.chooseTarget("烈誓:令一名其他角色选择另一项", lib.filter.notMe, true).set("ai", target => {
@ -3219,7 +3176,7 @@ game.import("character", function () {
} }
return get.damageEffect(target, player, player, "fire"); return get.damageEffect(target, player, player, "fire");
}); });
("step 2"); "step 2";
if (result.bool) { if (result.bool) {
var target = result.targets[0]; var target = result.targets[0];
event.target = target; event.target = target;
@ -3266,7 +3223,7 @@ game.import("character", function () {
return controls.randomGet(); return controls.randomGet();
}); });
} else event.finish(); } else event.finish();
("step 3"); "step 3";
if (result.control == "选项一") { if (result.control == "选项一") {
if (!target.isDisabledJudge()) target.disableJudge(); if (!target.isDisabledJudge()) target.disableJudge();
target.damage("fire"); target.damage("fire");
@ -3303,7 +3260,7 @@ game.import("character", function () {
player.recast(cards); player.recast(cards);
event.recast = true; event.recast = true;
} }
("step 1"); "step 1";
if (event.link && event.recast) player.draw(); if (event.link && event.recast) player.draw();
}, },
group: "clandianzhan_count", group: "clandianzhan_count",
@ -3418,13 +3375,13 @@ game.import("character", function () {
if (player.hp > 3) return "cancel2"; if (player.hp > 3) return "cancel2";
return Math.random() < 0.75 ? "clandaojie" : choices.randomGet(); return Math.random() < 0.75 ? "clandaojie" : choices.randomGet();
}); });
("step 1"); "step 1";
if (result.control != "cancel2") { if (result.control != "cancel2") {
player.removeSkills(result.control); player.removeSkills(result.control);
} else { } else {
player.loseHp(); player.loseHp();
} }
("step 2"); "step 2";
var targets = game.filterPlayer(current => current == player || current.hasClan("颍川荀氏")); var targets = game.filterPlayer(current => current == player || current.hasClan("颍川荀氏"));
if (targets.length == 1) event._result = { bool: true, targets: targets }; if (targets.length == 1) event._result = { bool: true, targets: targets };
else else
@ -3433,7 +3390,7 @@ game.import("character", function () {
return target == player || target.hasClan("颍川荀氏"); return target == player || target.hasClan("颍川荀氏");
}) })
.set("ai", target => get.attitude(_status.event.player, target)); .set("ai", target => get.attitude(_status.event.player, target));
("step 3"); "step 3";
if (result.bool) { if (result.bool) {
var target = result.targets[0]; var target = result.targets[0];
player.line(target, "green"); player.line(target, "green");
@ -3558,7 +3515,7 @@ game.import("character", function () {
num2 = player.getHandcardLimit(); num2 = player.getHandcardLimit();
if (num1 < num2) player.draw(Math.min(8, num2 - num1)); if (num1 < num2) player.draw(Math.min(8, num2 - num1));
} }
("step 1"); "step 1";
lib.skill.chenliuwushi.change(player, -1); lib.skill.chenliuwushi.change(player, -1);
}, },
ai: { ai: {
@ -3616,7 +3573,7 @@ game.import("character", function () {
.set("ai", function (target) { .set("ai", function (target) {
return get.attitude(_status.event.player, target); return get.attitude(_status.event.player, target);
}); });
("step 1"); "step 1";
if (result.bool) { if (result.bool) {
var target = result.targets[0]; var target = result.targets[0];
player.logSkill("clanmuyin", target); player.logSkill("clanmuyin", target);
@ -3819,7 +3776,7 @@ game.import("character", function () {
clanchengqi: "承启", clanchengqi: "承启",
clanchengqi_info: "你可以将至少两张手牌当作本回合未以此法转换过的基本牌或普通锦囊牌使用,且你以此法转化的牌名字数须不大于以此法转化的所有实体牌牌名字数之和,若你以此法转化的牌名字数等于以此法转化的所有实体牌牌名字数之和,则你使用此牌时可以令一名角色摸一张牌。", clanchengqi_info: "你可以将至少两张手牌当作本回合未以此法转换过的基本牌或普通锦囊牌使用,且你以此法转化的牌名字数须不大于以此法转化的所有实体牌牌名字数之和,若你以此法转化的牌名字数等于以此法转化的所有实体牌牌名字数之和,则你使用此牌时可以令一名角色摸一张牌。",
clanjieli: "诫厉", clanjieli: "诫厉",
clanjieli_info: "结束阶段,你可以选择一名角色,你观看其手牌中牌名字数最多的牌和牌堆顶X张牌然后你可以交换其中的X张牌X为你本回合使用过的牌中的牌名字数最大值。", clanjieli_info: "结束阶段,你可以选择一名角色,你观看其手牌中牌名字数最多的牌和牌堆顶的X张牌然后你可以交换其中的任意张牌X为你本回合使用过的牌中的牌名字数最大值。",
clan_wu: "陈留·吴氏", clan_wu: "陈留·吴氏",
clan_xun: "颍川·荀氏", clan_xun: "颍川·荀氏",