Merge pull request #1418 from mengxinzxz/PR-Branch

新杀谋张绣、新杀谋曹昂、新杀谋关平
This commit is contained in:
Spmario233 2024-06-01 22:52:33 +08:00 committed by GitHub
commit 36016fbdc8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 391 additions and 1 deletions

View File

@ -139,6 +139,7 @@ window.noname_character_rank = {
"dc_simashi",
"dc_sb_simayi",
"dc_sb_jiaxu",
"dc_sb_zhangxiu",
"caofang",
"dc_shen_huatuo",
"sp_zhenji",
@ -396,6 +397,8 @@ window.noname_character_rank = {
"yj_xuangongzhu",
"ol_sb_pangtong",
"dc_sb_zhugejin",
"dc_sb_caoang",
"dc_sb_guanping",
],
am: [
"tw_yanliang",
@ -1983,6 +1986,7 @@ window.noname_character_rank = {
"jsrg_yuanshao",
],
epic: [
"dc_sb_zhangxiu",
"ol_jiangwan",
"xukun",
"clan_zhongyao",
@ -2280,6 +2284,8 @@ window.noname_character_rank = {
"yue_miheng",
],
rare: [
"dc_sb_caoang",
"dc_sb_guanping",
"yue_zhugeguo",
"yue_zoushi",
"chezhou",

View File

@ -1,4 +1,7 @@
const characters = {
dc_sb_zhangxiu: ["male", "qun", 4, ["dcsbfuxi", "dcsbhaoyi"]],
dc_sb_guanping: ["male", "shu", 4, ["dcsbwuwei"]],
dc_sb_caoang: ["male", "wei", 4, ["dcsbfengmin", "dcsbzhiwang", "dcsbjueying"]],
dc_caoshuang: ["male", "wei", 4, ["dcjianzhuan", "dcfanshi"]],
dc_simashi: ["male", "wei", 3, ["dcsanshi", "dczhenrao", "dcchenlve"]],
dc_wangling: ["male", "wei", 4, ["dcjichou", "dcmouli"], ["clan:太原王氏"]],

View File

@ -14,6 +14,8 @@ const characterReplaces = {
caomao: ["caomao", "mb_caomao"],
sp_zhenji: ["sp_zhenji", "jsrg_zhenji"],
zhugejin: ["zhugejin", "dc_sb_zhugejin"],
caoang: ["caoang", "dc_sb_caoang"],
zhangxiu: ["zhangxiu", "dc_sb_zhangxiu"],
};
export default characterReplaces;

View File

@ -3,6 +3,365 @@ import cards from "../sp2/card.js";
/** @type { importCharacterConfig['skill'] } */
const skills = {
//张绣
dcsbfuxi: {
audio: 2,
trigger: { global: "phaseUseBegin" },
filter(event, player) {
const target = event.player;
if (!player.countCards("he") && !target.countCards("he") && !player.canUse(new lib.element.VCard({ name: "sha" }), target, false)) return false;
return event.player != player && event.player.isMaxHandcard();
},
async cost(event, trigger, player) {
const target = trigger.player,
str = get.translation(target);
let result;
if (!player.countCards("he")) {
result = await player
.chooseBool(get.prompt("dcsbfuxi", target), "弃置" + str + "的一张牌,然后视为对其使用一张【杀】")
.set("choice", get.effect(target, { name: "guohe_copy2" }, player, player) + get.effect(target, new lib.element.VCard({ name: "sha" }), player, player) > 0)
.forResult();
result.index = 1;
} else if (!target.countCards("he") && !player.canUse(new lib.element.VCard({ name: "sha" }), target, false)) {
result = await player
.chooseBool(get.prompt("dcsbfuxi", target), "交给" + str + "一张牌,然后摸两张牌")
.set("choice", get.attitude(player, target) > 0 || player.hasCard(card => card.name == "du", "h"))
.forResult();
result.index = 0;
} else {
result = await player
.chooseControl("给牌", "出杀", "cancel2")
.set("choiceList", ["交给" + str + "一张牌,然后摸两张牌", "弃置" + str + "的一张牌,然后视为对其使用一张【杀】"])
.set("ai", () => {
const player = get.event("player"),
target = get.event("target");
const num = get.effect(target, { name: "guohe_copy2" }, player, player) + get.effect(target, new lib.element.VCard({ name: "sha" }), player, player);
if (num <= 0 && get.attitude(player, target) < 0) return "cancel2";
return get.attitude(player, target) >= 0 ? 0 : 1;
})
.set("target", target)
.forResult();
result.bool = result.control != "cancel2";
}
if (result.bool) {
result.targets = [target];
result.cost_data = result.index;
}
event.result = result;
},
async content(event, trigger, player) {
const target = trigger.player;
if (event.cost_data == 0) {
await player.chooseToGive(target, "he", true);
await player.draw(2);
} else {
await player.discardPlayerCard(target, "he", true);
const sha = new lib.element.VCard({ name: "sha" });
if (player.canUse(sha, target, false)) {
await player.useCard(sha, target, false);
}
}
},
},
dcsbhaoyi: {
audio: 2,
trigger: { player: "phaseJieshuBegin" },
filter(event, player) {
return lib.skill.dcsbhaoyi.getCards().length;
},
frequent: true,
prompt(event, player) {
return get.prompt("dcsbhaoyi") + "(可获得" + get.translation(lib.skill.dcsbhaoyi.getCards()) + "";
},
async content(event, trigger, player) {
let cardx = lib.skill.dcsbhaoyi.getCards();
await player.gain(cardx, "gain2");
cardx = cardx.filter(i => get.owner(i) == player && get.position(i) == "h");
if (!cardx.length) return;
if (_status.connectMode) game.broadcastAll(() => (_status.noclearcountdown = true));
let given_map = [];
while (player.hasCard(card => cardx.includes(card) && !card.hasGaintag("olsujian_given"), "h")) {
const {
result: { bool, cards, targets },
} = await player
.chooseCardTarget({
filterCard(card, player) {
return get.event("cards").includes(card) && !card.hasGaintag("olsujian_given");
},
selectCard: [1, Infinity],
position: "h",
filterTarget: lib.filter.notMe,
prompt: "豪意:请选择要分配的卡牌和目标",
ai1(card) {
return !ui.selected.cards.length && card.name == "du" ? 1 : 0;
},
ai2(target) {
const player = get.event("player");
const card = ui.selected.cards[0];
if (card) return get.value(card, target) * get.attitude(player, target);
return 0;
},
})
.set("cards", cardx);
if (bool) {
const target = targets[0];
if (given_map.some(i => i[0] == target)) {
given_map[given_map.indexOf(given_map.find(i => i[0] == target))][1].addArray(cards);
} else given_map.push([target, cards]);
player.addGaintag(cards, "olsujian_given");
} else break;
}
if (_status.connectMode) {
game.broadcastAll(() => {
delete _status.noclearcountdown;
game.stopCountChoose();
});
}
if (given_map.length) {
await game
.loseAsync({
gain_list: given_map,
player: player,
cards: given_map.slice().map(list => list[1]),
giver: player,
animate: "giveAuto",
})
.setContent("gaincardMultiple");
}
},
getCards() {
let cards = [],
targets = game.players.slice().concat(game.dead.slice());
for (const target of targets) {
const history = target.getHistory("lose", evt => evt.position == ui.discardPile);
if (history.length) {
for (const evt of history) cards.addArray(evt.cards2.filterInD("d"));
}
}
const historyx = game.getGlobalHistory("cardMove", evt => evt.name == "cardsDiscard");
if (historyx.length) {
for (const evtx of historyx) cards.addArray(evtx.cards.filterInD("d"));
}
for (const target of targets) {
const history = target.getHistory(
"useCard",
evt =>
(evt.cards || []).length &&
target.getHistory("sourceDamage", evtx => {
return evtx.card && evtx.card == evt.card;
}).length
);
if (history.length) {
for (const evt of history) cards.removeArray(evt.cards.filterInD("d"));
}
}
return cards.filter(card => get.tag(card, "damage"));
},
},
//关平
dcsbwuwei: {
audio: 2,
enable: "phaseUse",
filter(event, player) {
const count = player.getStat("skill").dcsbwuwei;
if (count && count > player.countMark("dcsbwuwei_count")) return false;
const colors = player.getCards("h").reduce((list, card) => list.add(get.color(card)), []);
return colors.some(color => event.filterCard(get.autoViewAs(lib.skill.dcsbwuwei.viewAs, player.getCards("h", { color: color })), player, event));
},
viewAs: { name: "sha", storage: { dcsbwuwei: true } },
locked: false,
mod: {
targetInRange(card) {
if (card.storage && card.storage.dcsbwuwei) return true;
},
cardUsable(card, player, num) {
if (card.storage && card.storage.dcsbwuwei) return Infinity;
},
},
filterCard: () => false,
selectCard: -1,
async precontent(event, _, player) {
let colors = player.getCards("h").reduce((list, card) => list.add(get.color(card)), []),
evt = event.getParent();
colors = colors.filter(color => evt.filterCard(get.autoViewAs(lib.skill.dcsbwuwei.viewAs, player.getCards("h", { color: color })), player, evt));
colors = colors.map(color => (color == "none" ? "none2" : color));
const result = await player.chooseControl(colors, "cancel2").set("prompt", "武威:将一种颜色的所有手牌当作【杀】使用").forResult();
const color = result.control == "none2" ? "none" : result.control;
if (color == "cancel2") {
evt.goto(0);
return;
}
player.addTempSkill("dcsbwuwei_effect");
event.result.cards = player.getCards("h", { color: color });
event.result.card.cards = player.getCards("h", { color: color });
},
ai: {
order(item, player) {
return get.order({ name: "sha" }, player) - 0.001;
},
},
subSkill: {
effect: {
charlotte: true,
trigger: { player: "useCard" },
filter(event, player) {
return (event.card.storage || {}).dcsbwuwei && (event.cards || []).length;
},
forced: true,
popup: false,
async content(event, trigger, player) {
let result,
types = trigger.cards.reduce((list, card) => list.add(get.type(card, player)), []);
if (types.length >= 3) {
result = { bool: true, links: [0, 1, 2] };
} else {
result = await player
.chooseButton(["武威:请选择" + get.cnNumber(types.length) + "项执行", [["摸一张牌", "令目标角色本回合非锁定技失效", "令本回合〖武威〗可发动次数+1"].map((item, i) => [i, item]), "textbutton"]])
.set("forced", true)
.set("selectButton", types.length)
.set("ai", button => {
return [1, 3, 2].slice(0, get.event("selectButton")).includes(button.link) ? 1 : 0;
})
.forResult();
}
if (result.bool) {
result.links.sort((a, b) => a - b);
for (const i of result.links) {
game.log(player, "选择了", "#g【武威】", "的", "#y第" + get.cnNumber(i + 1, true) + "项");
}
if (result.links.includes(0)) await player.draw();
if (result.links.includes(1)) {
for (const target of trigger.targets || []) {
target.addTempSkill("fengyin");
}
}
if (result.links.includes(2)) {
player.addTempSkill("dcsbwuwei_count");
player.addMark("dcsbwuwei_count", 1, false);
}
if (result.links.length == 3) {
trigger.baseDamage++;
game.log(trigger.card, "造成的伤害", "#y+1");
}
}
},
},
count: {
charlotte: true,
onremove: true,
intro: { content: "本回合〖武威〗可发动次数+#" },
},
},
},
//曹昂
dcsbfengmin: {
audio: 2,
trigger: { global: ["loseAfter", "equipAfter", "addJudgeAfter", "gainAfter", "loseAsyncAfter", "addToExpansionAfter"] },
filter(event, player) {
const target = _status.currentPhase;
if (
!target ||
!target.isIn() ||
!Array.from({ length: 5 })
.map((_, i) => i + 1)
.reduce((sum, i) => sum + target.countEmptySlot(i), 0)
)
return false;
const evt = event.getl(target);
return evt && evt.player == target && (evt.es || []).length;
},
forced: true,
logTarget: () => _status.currentPhase,
async content(event, trigger, player) {
player.addMark("dcsbfengmin", 1, false);
const target = _status.currentPhase;
await player.draw(
Array.from({ length: 5 })
.map((_, i) => i + 1)
.reduce((sum, i) => sum + target.countEmptySlot(i), 0)
);
if (player.countMark("dcsbfengmin") > player.getDamagedHp()) {
player.tempBanSkill("dcsbfengmin");
}
},
intro: { content: "本局游戏已发动过#次此技能" },
},
dcsbzhiwang: {
audio: 2,
trigger: { player: "dying" },
filter(event, player) {
const evt = event.getParent(),
evtx = event.getParent(3);
if (!evt || evt.name != "damage" || !evtx || evtx.name != "useCard") return false;
return game.hasPlayer(target => target != player);
},
usable: 1,
async cost(event, trigger, player) {
event.result = await player
.chooseTarget(get.prompt("dcsbzhiwang"), lib.filter.notMe)
.set("ai", target => {
return get.attitude(get.event("player"), target);
})
.forResult();
},
async content(event, trigger, player) {
if (trigger.source) delete trigger.source;
if (trigger.getParent().source) delete trigger.getParent().source;
event.targets[0].addTempSkill("dcsbzhiwang_effect");
event.targets[0].markAuto("dcsbzhiwang_effect", [player]);
},
subSkill: {
effect: {
charlotte: true,
onremove: true,
trigger: { global: "phaseEnd" },
forced: true,
popup: false,
async content(event, trigger, player) {
let cards = game
.getGlobalHistory("everything", evt => {
if (evt.name != "dying") return false;
if (!player.getStorage("dcsbzhiwang_effect").includes(evt.player)) return false;
const evtx = evt.getParent(3);
return (evtx.cards || []).someInD("d");
})
.reduce((cards, evt) => cards.addArray(evt.getParent(3).cards.filterInD("d")), []);
while (cards.length) {
const result = await player
.chooseButton(["质亡:是否使用其中的一张牌?", cards])
.set("filterButton", button => {
return get.event("player").hasUseTarget(button.link, false);
})
.set("ai", button => {
if (button.link.name == "jiu") return 10;
return get.event("player").getUseValue(button.link);
})
.forResult();
if (result.bool) {
const card = result.links[0];
cards.remove(card);
player.$gain2(card, false);
await game.asyncDelayx();
await player.chooseUseTarget(true, card, false);
}
}
},
intro: { content: "本回合结束时,可以使用令$进入濒死的牌" },
},
},
},
dcsbjueying: {
audio: 2,
trigger: { player: "damageBegin4" },
filter(event, player) {
const cards = player.getEquips("jueying");
return cards.length && cards.every(card => lib.filter.cardDiscardable(card, player));
},
content() {
player.discard(player.getEquips("jueying"));
trigger.cancel();
},
},
//诸葛瑾
dcsbtaozhou: {
audio: 2,

View File

@ -16,6 +16,7 @@ const characterSort = {
sp2_mouding: ["dc_sb_jiaxu", "dc_sb_lusu", "dc_sb_zhouyu", "dc_sb_simayi"],
sp2_zhonghu: ["dc_jiangji", "dc_wangling", "dc_simashi", "dc_caoshuang"],
sp2_zijing: ["dc_sb_zhugejin"],
sp2_waitingforsort: ["dc_sb_caoang", "dc_sb_guanping", "dc_sb_zhangxiu"],
};
const characterSortTranslate = {
@ -36,6 +37,7 @@ const characterSortTranslate = {
sp2_mouding: "谋定天下",
sp2_zhonghu: "冢虎狼顾",
sp2_zijing: "子敬邀刀",
sp2_waitingforsort: "等待分包",
};
export { characterSort, characterSortTranslate };

View File

@ -615,6 +615,24 @@ const translates = {
dc_caoshuang_prefix: "新杀谋",
dc_jiangji: "新杀谋蒋济",
dc_jiangji_prefix: "新杀谋",
dc_sb_caoang: "新杀谋曹昂",
dc_sb_caoang_prefix: "新杀谋",
dcsbfengmin: "丰愍",
dcsbfengmin_info: "锁定技,一名角色于其回合内失去装备区的牌后,你摸等同于其装备区空缺装备栏数的牌,然后若你发动〖丰愍〗的次数大于你的体力上限,〖丰愍〗于本回合失效。",
dcsbzhiwang: "质死",
dcsbzhiwang_info: "每回合限一次,当你因受到牌造成的伤害进入濒死状态时,你可以将此伤害改为无来源并选择一名其他角色,其于本回合结束时可以使用本回合令你进入濒死状态的牌。",
dcsbjueying: "绝影",
dcsbjueying_info: "当你受到伤害时,你可以弃置装备区里的【绝影】,然后防止此伤害。",
dc_sb_guanping: "新杀谋关平",
dc_sb_guanping_prefix: "新杀谋",
dcsbwuwei: "武威",
dcsbwuwei_info: "出牌阶段限一次你可以将一种颜色的所有手牌当作无距离和次数限制的【杀】使用然后你选择执行以下X项X为转化为此【杀】的牌的类别数①摸一张牌②令目标角色本回合非锁定技失效③令本回合〖武威〗可发动次数+1。然后若你执行了所有项则此【杀】造成的伤害+1。",
dc_sb_zhangxiu: "新杀谋张绣",
dc_sb_zhangxiu_prefix: "新杀谋",
dcsbfuxi: "附袭",
dcsbfuxi_info: "其他角色的出牌阶段开始时,若其手牌数为全场最多,则你可以选择一项:①交给其一张牌,然后摸两张牌;②弃置其一张牌,然后视为对其使用一张【杀】。",
dcsbhaoyi: "豪意",
dcsbhaoyi_info: "结束阶段,你可以获得本回合进入弃牌堆的所有未造成过伤害的伤害牌,然后你可以将这些牌任意分配给其他角色。",
};
export default translates;

View File

@ -48,7 +48,7 @@ const characterReplaces = {
gongsunyuan: ["gongsunyuan", "re_gongsunyuan"],
zhoucang: ["zhoucang", "re_zhoucang", "xin_zhoucang"],
guotufengji: ["guotufengji", "re_guotufengji"],
guanping: ["guanping", "re_guanping"],
guanping: ["guanping", "re_guanping", "dc_sb_guanping"],
caifuren: ["caifuren", "re_caifuren", "xin_caifuren"],
guyong: ["guyong", "re_guyong", "xin_guyong", "tw_guyong"],
yj_jushou: ["yj_jushou", "re_jushou", "xin_jushou"],