谋韩当&谋公孙瓒

This commit is contained in:
copcap 2024-05-21 04:51:12 +08:00
parent fd3b95c8e6
commit 762628c69a
No known key found for this signature in database
GPG Key ID: 30E7AB6699451AEE
6 changed files with 452 additions and 6 deletions

View File

@ -1,4 +1,6 @@
const characters = {
sb_handang: ["male", "wu", 4, ["sbgongqi", "sbjiefan"]],
sb_gongsunzan: ["male", "qun", 4, ["sbyicong", "sbqiaomeng"]],
sb_gaoshun: ["male", "qun", 4, ["sbxianzhen", "sbjinjiu"]],
sb_xiahoudun: ["male", "wei", 4, ["sbganglie", "sbqingjian"]],
sb_xunyu: ["male", "wei", 3, ["sbquhu", "sbjieming"]],

View File

@ -2,6 +2,438 @@ import { lib, game, ui, get, ai, _status } from "../../noname.js";
/** @type { importCharacterConfig['skill'] } */
const skills = {
//韩当
sbgongqi: {
audio: 2,
trigger: {
player: "phaseUseBegin",
},
async cost(event, trigger, player) {
event.result = await player
.chooseToDiscard(get.prompt("sbgongqi"), "你可以弃置一张牌,令你本阶段使用牌时,其他角色不能使用或打出与你弃置的牌颜色不同的手牌进行响应。", "he", "chooseonly")
.set("ai", card => {
const ind = get.event("colors").indexOf(get.color(card)) + 1;
if (ind <= 0) return 0;
return 1.5 + 2 * ind - get.value(card);
})
.set(
"colors",
(() => {
if (!player.countCards("hs", card => player.hasValueTarget(card))) return [];
const colors = Object.keys(lib.color);
const infos = colors.map(color => {
return [
color,
game.filterPlayer().map(current => {
const att = get.attitude(player, current);
return current
.getCards("hes", card => {
if (get.color(card) !== color) return false;
if (current.hasUseTarget(card, false, false)) return false;
if (!lib.filter.cardEnabled(card, current, "forceEnable")) return false;
return true;
})
.map(card => {
return get.value(card) * (att > 0 ? -0.2 : 1);
})
.reduce((p, c) => p + c, 0);
}),
];
});
infos.sort((a, b) => {
return a[1] - b[1];
});
return infos.map(info => info[0]);
})()
)
.forResult();
},
locked: false,
async content(event, trigger, player) {
const { cards } = event;
await player.discard(cards);
await game.asyncDelayx();
player.addTempSkill("sbgongqi_effect", "phaseChange");
player.markAuto("sbgongqi_effect", [get.color(cards[0], player)]);
player.line(game.filterPlayer());
await game.asyncDelayx();
},
updateBlocker(player) {
const list = [],
storage = player.storage.sbgongqi_block;
if (storage && storage.length) {
list.addArray(...storage.map(i => i[1]));
}
player.storage.sbgongqi_blocker = list;
},
mod: {
attackRange(player, num) {
return num + 4;
},
},
subSkill: {
effect: {
trigger: {
player: "useCard",
},
onremove: true,
charlotte: true,
forced: true,
async content(event, trigger, player) {
game.countPlayer(current => {
if (current === player) return;
current.addTempSkill("sbgongqi_block", "phaseChange");
if (!current.storage.sbgongqi_block) current.storage.sbgongqi_block = [];
current.storage.sbgongqi_block.push([trigger.card, player.getStorage("sbgongqi_effect")]);
lib.skill.sbgongqi.updateBlocker(current);
});
},
},
block: {
trigger: {
player: ["damageBefore", "damageCancelled", "damageZero"],
target: ["shaMiss", "useCardToExcluded", "useCardToEnd"],
global: ["useCardEnd"],
},
forced: true,
firstDo: true,
popup: false,
charlotte: true,
onremove: ["sbgongqi_block", "sbgongqi_blocker"],
filter(event, player) {
if (!event.card || !player.storage.sbgongqi_block) return false;
return player.getStorage("sbgongqi_block").some(info => {
return info[0] === event.card;
});
},
async content(event, trigger, player) {
const storage = player.storage.sbgongqi_block;
for (let i = 0; i < storage.length; i++) {
if (storage[i][0] === trigger.card) {
storage.splice(i--, 1);
}
}
if (!storage.length) player.removeSkill("sbgongqi_block");
else lib.skill.sbgongqi.updateBlocker(trigger.target);
},
mod: {
cardEnabled(card, player) {
if (!player.storage.sbgongqi_blocker) return;
const color = get.color(card);
if (color == "none") return;
const hs = player.getCards("h"),
cards = [card];
if (Array.isArray(card.cards)) cards.addArray(card.cards);
if (cards.containsSome(...hs) && player.storage.sbgongqi_blocker.includes(color)) return false;
},
},
},
},
},
sbjiefan: {
audio: 2,
enable: "phaseUse",
usable: 1,
filterTarget: true,
async content(event, trigger, player) {
const { target } = event;
const targets = game.filterPlayer(current => {
return current.inRange(target);
});
if (!targets.length) {
target.chat("没人打得到我喔!");
return;
}
const controls = ["选项一", "选项二", "背水!"];
const control = await target
.chooseControl(controls)
.set("choiceList", [`令所有攻击范围内含有你的角色依次弃置一张牌(${get.translation(targets)}`, `你摸等同于攻击范围内含有你的角色数的牌(${get.cnNumber(targets.length)}张牌)`, `背水!令${get.translation(player)}的〖解烦〗失效直到其杀死一名角色,然后你依次执行上述所有选项`])
.set("ai", () => {
return get.event("choice");
})
.set(
"choice",
(() => {
const eff1 = targets
.map(current => {
let position = "h";
if (!current.countCards("h")) position += "e";
return get.effect(current, { name: "guohe", position }, target, target);
})
.reduce((p, c) => p + c, 0);
const eff2 = (get.effect(target, { name: "wuzhong" }, target) * targets.length) / 2;
if (
game.hasPlayer(current => {
const att1 = get.attitude(player, current),
att2 = get.attitude(target, current);
if (att1 < 0 && att2 < 0) {
return current.getHp() <= 1;
}
return false;
}) &&
eff1 > 15 &&
eff2 > 0
)
return "背水!";
if (eff1 > 3 * eff2) return "选项一";
return "选项二";
})()
)
.forResultControl();
game.log(target, "选择了", "#g" + control);
if (control === "背水!") {
player.tempBanSkill("sbjiefan", { source: "die" });
}
if (control !== "选项二") {
for (const current of targets) {
target.line(current, "thunder");
await current.chooseToDiscard("解烦:请弃置一张牌", "he", true);
}
}
if (control !== "选项一") {
target.draw(targets.length);
}
},
ai: {
order: 8,
result: {
target(player, target) {
const targets = game.filterPlayer(current => {
return current.inRange(target);
});
return targets.length / 2;
},
}
}
},
//公孙瓒
sbyicong: {
audio: 2,
trigger: {
global: "roundStart",
},
filter(event, player) {
return player.hasMark("charge");
},
chargeSkill: true,
group: "sbyicong_init",
async cost(event, trigger, player) {
const len = player.countMark("charge");
const numbers = Array.from({ length: len }, (_, i) => get.cnNumber(i + 1, true));
if (_status.connectMode) {
game.broadcastAll(() => {
_status.noclearcountdown = true;
});
}
let result, result2;
while (true) {
result = await player
.chooseControl(numbers, "cancel2")
.set("prompt", get.prompt("sbyicong"))
.set("prompt2", "你可以消耗任意点蓄力值并选择一项:⒈你于本轮内至其他角色的距离-X令系统选择牌堆中的一张【杀】⒉其他角色于本轮内至你的距离+X令系统选择牌堆中的一张【闪】X为你消耗的蓄力值。然后若你的“扈”数小于4你将系统选择的牌置于武将牌上称为“扈”。")
.set("ai", () => {
return get.event("choice");
})
.set(
"choice",
(() => {
if (
!game.hasPlayer(current => {
return (
get.distance(player, current) >= 2 &&
player.countCards("hs", card => {
const list = ["shunshou", "bingliang", "zhujinqiyuan"];
if (!player.inRange(current)) list.add("sha");
return list.includes(get.name(card)) && get.effect(current, card, player, player) > 0;
}) > 0
);
})
)
return 0;
return Math.ceil(len / 2) - 1;
})()
)
.forResult();
if (result.control === "cancel2") return;
const num = result.index + 1;
result2 = await player
.chooseControl(["选项一", "选项二", "返回"])
.set("prompt", "义从:请选择一项")
.set("choiceList", [
`你于本轮内至其他角色的距离-${num}${
player.countCards("s", card => {
return card.hasGaintag("sbyicong");
}) >= 4
? ""
: ",将牌堆中的一张【杀】置于你的武将牌上,称为“扈”"
}`,
`其他角色于本轮内至你的距离+${num}${
player.countCards("s", card => {
return card.hasGaintag("sbyicong");
}) >= 4
? ""
: ",将牌堆中的一张【闪】置于你的武将牌上,称为“扈”"
}`,
])
.set("ai", () => {
const player = get.player();
if (player.getHp() > 2 || player.countCards("hsx", ["shan", "caochuan"]) >= 3) return 0;
return 1;
})
.forResult();
if (result2.control !== "返回") break;
}
if (_status.connectMode) {
game.broadcastAll(() => {
delete _status.noclearcountdown;
game.stopCountChoose();
});
}
event.result = {
bool: true,
cost_data: {
num: result.index + 1,
choice: result2.index,
},
};
},
async content(event, trigger, player) {
const { num, choice } = event.cost_data;
const skill = choice === 0 ? "sbyicong_to" : "sbyicong_from";
player.removeMark("charge", num);
player.addTempSkill(skill, "roundStart");
player.addMark(skill, num, false);
if (player.countCards("s", card => card.hasGaintag("sbyicong")) < 4) {
const name = choice === 0 ? "sha" : "shan";
const card = get.cardPile2(name);
if (card) {
game.log(player, "将", card, "置于了武将牌上");
await player.loseToSpecial([card], "sbyicong");
player.markSkill("sbyicong");
}
}
},
marktext: "扈",
intro: {
name: "扈(义从)",
mark(dialog, storage, player) {
const cards = player.getCards("s", card => {
return card.hasGaintag("sbyicong");
});
if (cards.length) dialog.addAuto(cards);
else dialog.addText("暂无卡牌");
},
markcount(storage, player) {
return player.countCards("s", card => {
return card.hasGaintag("sbyicong");
});
},
onunmark(storage, player) {
const cards = player.getCards("s", card => {
return card.hasGaintag("sbyicong");
});
if (cards.length) {
player.loseToDiscardpile(cards);
}
},
},
subSkill: {
init: {
audio: "sbyicong",
trigger: {
player: "enterGame",
global: "phaseBefore",
},
filter(event, player) {
return event.name != "phase" || game.phaseNumber == 0;
},
forced: true,
locked: false,
async content(event, trigger, player) {
player.addMark("charge", 2);
},
},
to: {
charlotte: true,
mod: {
globalFrom(from, to, distance) {
return distance - from.countMark("sbyicong_to");
},
},
marktext: "从",
intro: {
content: "本轮你至其他角色的距离-#",
},
},
from: {
charlotte: true,
mod: {
globalTo(from, to, distance) {
return distance - to.countMark("sbyicong_to");
},
},
marktext: "从",
intro: {
content: "本轮其他角色至你的距离-#",
},
},
},
},
sbqiaomeng: {
audio: 2,
trigger: {
source: "damageSource",
},
filter(event, player) {
if (!event.card || event.card.name !== "sha") return false;
return player.hasSkill("sbyicong", null, false, false);
},
async cost(event, trigger, player) {
const list = ["蓄力", "cancel2"];
const choiceList = [`弃置${get.translation(trigger.player)}区域里的一张牌,你摸一张牌`, `获得2点蓄力值`];
if (trigger.player.isIn() && trigger.player.countDiscardableCards(player, "hej")) {
list.unshift("弃牌");
} else {
choiceList[0] = `<span style="opacity:0.5">${choiceList[0]}</span>`;
}
const result = await player
.chooseControl(list)
.set("prompt", get.prompt("sbqiaomeng"))
.set("choiceList", choiceList)
.set("ai", () => {
return get.event("choice");
})
.set(
"choice",
(() => {
if (!list.includes("弃牌")) return "蓄力";
const eff = get.effect(trigger.player, { name: "guohe" }, player, player);
if (player.countMark("charge") >= 2 && eff >= 0) return "弃牌";
return "蓄力";
})()
)
.forResult();
if (result.control !== "cancel2") {
event.result = {
bool: true,
cost_data: {
control: result.control,
},
};
}
},
async content(event, trigger, player) {
const { control } = event.cost_data;
if (control === "弃牌") {
player.line(trigger.player);
await player.discardPlayerCard(trigger.player, "hej", true);
await player.draw();
} else {
const num = Math.min(2, 4 - player.countMark("charge"));
if (num > 0) player.addMark("charge", num);
}
},
},
//高顺
sbxianzhen: {
audio: 2,
@ -6105,7 +6537,7 @@ const skills = {
return [1, 1];
}
},
}
},
},
},
},

View File

@ -1,9 +1,9 @@
const characterSort = {
sb_zhi: ["sb_sunquan", "sb_zhouyu", "sb_zhangjiao", "sb_caocao", "sb_zhenji", "sb_liubei", "sb_daqiao", "sb_liubiao", "sb_sp_zhugeliang", "sb_xunyu"],
sb_shi: ["sb_xuhuang", "sb_machao", "sb_fazheng", "sb_chengong", "sb_diaochan", "sb_pangtong", "sb_zhanghe", "sb_caopi", "sb_ganning"],
sb_shi: ["sb_xuhuang", "sb_machao", "sb_fazheng", "sb_chengong", "sb_diaochan", "sb_pangtong", "sb_zhanghe", "sb_caopi", "sb_ganning", "sb_handang"],
sb_tong: ["liucheng", "sp_yangwan", "sb_xiahoushi", "sb_zhangfei", "sb_zhaoyun", "sb_sunce", "sb_zhurong", "sb_xiaoqiao", "sb_xiahoudun"],
sb_yu: ["sb_yujin", "sb_lvmeng", "sb_huangzhong", "sb_huanggai", "sb_zhouyu", "sb_caoren", "sb_yl_luzhi", "sb_huangyueying"],
sb_neng: ["sb_huaxiong", "sb_sunshangxiang", "sb_jiangwei", "sb_yuanshao", "sb_menghuo", "sb_guanyu", "sb_gaoshun"],
sb_neng: ["sb_huaxiong", "sb_sunshangxiang", "sb_jiangwei", "sb_yuanshao", "sb_menghuo", "sb_guanyu", "sb_gaoshun", "sb_gongsunzan"],
// sb_waitforsort:[],
};

View File

@ -270,6 +270,18 @@ const translates = {
sbxianzhen_info: "出牌阶段限一次。你可以选择一名其他角色你于本阶段获得如下效果⒈你对其使用牌无距离限制⒉当你使用【杀】指定其为目标后你可以与其拼点若你赢此【杀】无视防具且不计入次数且若你本回合以此法对其造成的伤害小于2你对其造成1点伤害若其拼点牌为【杀】则你获得之若其拼点牌为其最后的手牌则此【杀】对其造成伤害时此伤害+1。",
sbjinjiu: "禁酒",
sbjinjiu_info: "锁定技。①你的【酒】均视为【杀】。②当你受到酒【杀】的伤害时你令此伤害减至1。③其他角色不能于你的回合内使用【酒】。④当一名其他角色的拼点牌亮出后若你为发起者或参与者且此牌为【酒】则此牌的点数视为A。",
sb_handang: "谋韩当",
sb_handang_prefix: "谋",
sbgongqi: "弓骑",
sbgongqi_info: "①出牌阶段开始时,你可以弃置一张牌,然后本阶段你获得如下效果:当你使用牌时,你令所有其他角色不能使用或打出与你弃置牌颜色不同的手牌响应此牌。②你的攻击范围+4。",
sbjiefan: "解烦",
sbjiefan_info: "出牌阶段限一次。你可以令一名角色选择一项:⒈令所有攻击范围内含有其的角色依次弃置一张牌;⒉其摸等同于攻击范围内含有其的角色数的牌;⒊背水:此技能失效直到你杀死一名角色,然后依次执行上述所有选项。",
sb_gongsunzan: "谋公孙瓒",
sb_gongsunzan_prefix: "谋",
sbyicong: "义从",
sbyicong_info: "蓄力技2/4。①一轮游戏开始时你可以消耗任意点蓄力值并选择一项⒈你于本轮内至其他角色的距离-X令系统选择牌堆中的一张【杀】⒉其他角色于本轮内至你的距离+X令系统选择牌堆中的一张【闪】X为你消耗的蓄力值。然后若你的“扈”数小于4你将系统选择的牌置于武将牌上称为“扈”。②你可以将“扈”如手牌般使用或打出。",
sbqiaomeng: "趫猛",
sbqiaomeng_info: "当你使用【杀】造成伤害后若你有〖义从〗你可以选择一项⒈弃置受伤角色区域里的一张牌并摸一张牌⒉获得2点蓄力值。",
};
export default translates;

View File

@ -31,7 +31,7 @@ const characterReplaces = {
huatuo: ["huatuo", "re_huatuo", "old_huatuo"],
huaxiong: ["huaxiong", "re_huaxiong", "old_huaxiong", "sb_huaxiong", "ol_huaxiong"],
yuanshu: ["yuanshu", "re_yuanshu", "yl_yuanshu", "old_yuanshu", "ol_yuanshu", "star_yuanshu"],
gongsunzan: ["gongsunzan", "re_gongsunzan", "dc_gongsunzan", "xin_gongsunzan"],
gongsunzan: ["gongsunzan", "re_gongsunzan", "dc_gongsunzan", "xin_gongsunzan", "sb_gongsunzan"],
re_lidian: ["re_lidian", "old_re_lidian", "junk_lidian"],
sunhao: ["sunhao", "std_sunhao"],
lvlingqi: ["lvlingqi", "std_lvlingqi"],

View File

@ -17,7 +17,7 @@ const characterReplaces = {
madai: ["old_madai", "re_madai", "tw_madai", "madai"],
liaohua: ["liaohua", "re_liaohua", "xin_liaohua"],
bulianshi: ["bulianshi", "dc_bulianshi", "re_bulianshi", "old_bulianshi"],
handang: ["handang", "xin_handang", "re_handang", "tw_handang", "old_handang"],
handang: ["handang", "xin_handang", "re_handang", "tw_handang", "sb_handang", "old_handang"],
chengpu: ["chengpu", "ol_chengpu", "re_chengpu", "xin_chengpu", "tw_chengpu", "ns_chengpu", "std_chengpu"],
liubiao: ["liubiao", "xin_liubiao", "re_liubiao", "sb_liubiao", "oldre_liubiao", "old_liubiao"],
manchong: ["manchong", "re_manchong"],
@ -68,7 +68,7 @@ const characterReplaces = {
zhongyao: ["zhongyao", "re_zhongyao"],
liwan: ["ol_liwan", "liwan"],
wuxian: ["wuxian", "clan_wuxian"],
simafu: ["simafu", "yj_simafu"],
simafu: ["mb_simafu", "simafu", "yj_simafu"],
xuangongzhu: ["yj_xuangongzhu", "xuangongzhu"],
};