Merge pull request #1332 from mengxinzxz/PR-Branch

新杀谋贾诩
This commit is contained in:
Spmario233 2024-05-09 23:44:47 +08:00 committed by GitHub
commit c8cf837904
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 224 additions and 1 deletions

View File

@ -77,7 +77,7 @@ const skills = {
if (card.cards && (card.cards || []).some(i => get.position(i) == "h")) return false; if (card.cards && (card.cards || []).some(i => get.position(i) == "h")) return false;
}, },
cardSavable() { cardSavable() {
return lib.skill.dctunchu_subSkill.debuff.mod.cardEnabled2.apply(this, arguments); return lib.skill.dctunchu.subSkill.debuff.mod.cardEnabled2.apply(this, arguments);
}, },
}, },
}, },

View File

@ -1,4 +1,5 @@
const characters = { const characters = {
dc_sb_jiaxu: ["male", "qun", 3, ["dcsbsushen", "dcsbrushi", "dcsbfumou"]],
guanyue: ["male", "shu", 4, ["dcshouzhi", "dcfenhui"]], guanyue: ["male", "shu", 4, ["dcshouzhi", "dcfenhui"]],
sp_zhenji: ["female", "qun", 3, ["dcjijie", "dchuiji"]], sp_zhenji: ["female", "qun", 3, ["dcjijie", "dchuiji"]],
wu_guanyu: ["male", "shu", 5, ["dcjuewu", "dcwuyou", "dcyixian"]], wu_guanyu: ["male", "shu", 5, ["dcjuewu", "dcwuyou", "dcyixian"]],

View File

@ -96,5 +96,16 @@ const dynamicTranslates = {
if (player.storage.dcshouzhi_modified) skillName += "_modified"; if (player.storage.dcshouzhi_modified) skillName += "_modified";
return lib.translate[`${skillName}_info`]; return lib.translate[`${skillName}_info`];
}, },
dcsbfumou(player) {
const storage = player.storage.dcsbfumou;
var str = "转换技出牌阶段限一次你可以观看一名其他角色A的手牌并展示其一半手牌";
if (!storage) str += '<span class="bluetext">';
str += "阴并将这些牌交给另一名其他角色B然后你与A各摸X张牌X为A以此法失去的手牌数";
if (!storage) str += "</span>";
if (storage) str += '<span class="bluetext">';
str += "阳令A依次使用这些牌中所有其可以使用的牌。";
if (storage) str += "</span>";
return str;
},
}; };
export default dynamicTranslates; export default dynamicTranslates;

View File

@ -2,6 +2,209 @@ import { lib, game, ui, get, ai, _status } from "../../noname.js";
/** @type { importCharacterConfig['skill'] } */ /** @type { importCharacterConfig['skill'] } */
const skills = { const skills = {
//谋贾诩
dcsbsushen: {
unique: true,
limited: true,
audio: 2,
audioname: ["dc_sb_jiaxu_shadow"],
enable: "phaseUse",
skillAnimation: true,
animationColor: "soil",
content() {
player.awakenSkill("dcsbsushen");
player.storage.dcsbsushen_reload = [Boolean(player.storage.dcsbfumou), player.countCards("h"), player.getHp()];
player.addSkill("dcsbsushen_reload");
player.addSkillLog("dcsbrushi");
},
derivation: "dcsbrushi",
subSkill: {
reload: {
charlotte: true,
onremove: true,
mark: true,
intro: {
content(storage) {
return ["【覆谋】状态:" + ["阳", "阴"][storage[0] ? 1 : 0], "手牌数:" + storage[1], "体力值:" + storage[2]].join("<br>");
},
},
},
},
ai: {
//waiting for PZ157
},
},
dcsbrushi: {
unique: true,
limited: true,
audio: 2,
audioname: ["dc_sb_jiaxu_shadow"],
enable: "phaseUse",
filter(event, player) {
return Array.isArray(player.storage.dcsbsushen_reload);
},
skillAnimation: true,
animationColor: "thunder",
*content(event, map) {
const player = map.player,
storage = player.storage.dcsbsushen_reload;
player.awakenSkill("dcsbrushi");
player.removeSkill("dcsbsushen_reload");
if (Boolean(player.storage.dcsbfumou) !== storage[0]) {
if (player.hasSkill("dcsbfumou", null, null, false)) {
player.changeZhuanhuanji("dcsbfumou");
}
}
if (player.countCards("h") != storage[1]) {
if (player.countCards("h") < storage[1]) {
yield player.drawTo(storage[1]);
} else {
yield player.chooseToDiscard("h", true, storage[1] - player.countCards("h"));
}
}
if (player.getHp() != storage[2]) {
yield player[player.getHp() > storage[2] ? "loseHp" : "recover"](Math.abs(player.getHp() - storage[2]));
}
},
ai: {
//waiting for PZ157
},
},
dcsbfumou: {
audio: 2,
audioname: ["dc_sb_jiaxu_shadow"],
enable: "phaseUse",
filter(event, player) {
return (
game.hasPlayer(target => {
return target != player && target.countCards("h");
}) && game.countPlayer(target => target != player) >= (player.storage.dcsbfumou ? 1 : 2)
);
},
filterTarget(card, player, target) {
if (target == player) return false;
if (!ui.selected.targets.length) return target.countCards("h");
return !player.storage.dcsbfumou;
},
selectTarget() {
const player = get.event("player");
return player.storage.dcsbfumou ? [1, 2] : 2;
},
targetprompt() {
const player = get.event("player");
return player.storage.dcsbfumou ? "" : ["看牌角色", "得牌角色"][ui.selected.targets.length-1];
},
prompt() {
const player = get.event("player");
return lib.skill.dcsbfumou.intro.content(player.storage.dcsbfumou);
},
usable: 1,
complexTarget: true,
complexSelect: true,
multitarget: true,
async content(event, trigger, player) {
const storage = player.storage.dcsbfumou,
target = event.targets[0],
num = Math.ceil(target.countCards("h")/2);
player.changeZhuanhuanji("dcsbfumou");
let cards = await player
.choosePlayerCard("覆谋:展示" + get.translation(target) + "的至多" + get.cnNumber(num) + "张牌", target, "h", num, true)
.set("ai", card => {
const player = get.event("player"),
storage = get.event("storage"),
target = get.event().getParent().targets[0];
if (!storage) return get.value(card) * -get.attitude(player, target);
return target.getUseValue(card) * get.attitude(player, target);
})
.set("visible", true)
.set("storage", storage)
.forResult("cards");
if (!cards.length) return;
await player.showCards(cards, get.translation(player) + "发动了【覆谋】");
if (!storage) {
const aim = event.targets[1];
cards = cards.filter(card => lib.filter.canBeGained(card, aim, target));
if (cards.length) {
await aim.gain(cards, target, "give");
await game.asyncDraw([player, target], cards.length);
} else {
aim.popup("杯具");
aim.chat("555一张都拿不到~");
}
} else {
cards = cards.filter(card => {
return target.hasUseTarget(card) && get.owner(card) == target && get.position(card) == "h";
});
while (
cards.some(card => {
return target.hasUseTarget(card) && get.owner(card) == target && get.position(card) == "h";
})
) {
const result = await target
.chooseToUse(
true,
function (card) {
const event = get.event();
if (!lib.filter.cardEnabled(card, event.player, event)) return false;
return get.event("cards").includes(card);
},
"覆谋:请依次使用展示的牌"
)
.set("cards", cards)
.forResult();
if (result.bool) {
cards = cards.filter(card => {
return target.hasUseTarget(card) && get.owner(card) == target && get.position(card) == "h";
});
} else break;
}
}
},
zhuanhuanji: true,
marktext: "☯",
mark: true,
intro: {
content(storage) {
if (storage) return "转换技,出牌阶段限一次,你可以观看一名其他角色的手牌并展示其一半手牌,令其依次使用这些牌中所有其可以使用的牌。";
return "转换技出牌阶段限一次你可以观看一名其他角色A的手牌并展示其一半手牌并将这些牌交给另一名其他角色B然后你与A各摸X张牌X为A以此法失去的手牌数。";
},
},
ai: {
order: 7,
result: {
target(player, target) {
const storage = player.storage.dcsbfumou;
const sgn = get.sgn(get.attitude(player, target));
if (!storage && !ui.selected.targets.length) {
return (sgn * (2 + sgn)) / (target.countCards("h") + 1);
}
return (sgn * (2 + sgn)) / (target.countCards("h") + 1);
},
},
},
group: "dcsbfumou_change",
subSkill: {
change: {
audio: "dcsbfumou",
audioname: ["dc_sb_jiaxu_shadow"],
trigger: {
global: "phaseBefore",
player: "enterGame",
},
filter(event, player) {
return event.name != "phase" || game.phaseNumber == 0;
},
prompt2(event, player) {
return "切换【腹谋】为状态" + (player.storage.dcsbfumou ? "阳" : "阴");
},
check: () => Math.random() > 0.5,
content() {
player.changeZhuanhuanji("dcsbfumou");
//player.changeSkin("dcsbfumou", "dc_sb_jiaxu" + (player.storage.dcsbfumou ? "_shadow" : ""));
},
},
},
},
//关樾 //关樾
dcshouzhi: { dcshouzhi: {
audio: 2, audio: 2,

View File

@ -591,6 +591,14 @@ const translates = {
dcfenhui_info: "限定技。出牌阶段你可以令一名角色获得X枚“恨”标记你摸等量的牌X为本局游戏你使用黑色牌指定其为目标的次数至多为5。你获得如下效果⒈当你对其造成伤害时你移去其1枚“恨”令此伤害+1⒉当其死亡时若其有“恨”你减1点体力上限修改〖守执〗并获得〖兴门〗。", dcfenhui_info: "限定技。出牌阶段你可以令一名角色获得X枚“恨”标记你摸等量的牌X为本局游戏你使用黑色牌指定其为目标的次数至多为5。你获得如下效果⒈当你对其造成伤害时你移去其1枚“恨”令此伤害+1⒉当其死亡时若其有“恨”你减1点体力上限修改〖守执〗并获得〖兴门〗。",
dcxingmen: "兴门", dcxingmen: "兴门",
dcxingmen_info: "①当你因〖守执〗弃置而失去牌后你可以回复1点体力。②当你因摸牌而得到牌后若这些牌均为红色且牌数不小于2则你使用这些牌时不能被响应。", dcxingmen_info: "①当你因〖守执〗弃置而失去牌后你可以回复1点体力。②当你因摸牌而得到牌后若这些牌均为红色且牌数不小于2则你使用这些牌时不能被响应。",
dc_sb_jiaxu: "新杀谋贾诩",
dc_sb_jiaxu_prefix: "新杀谋",
dcsbsushen: "肃身",
dcsbsushen_info: "限定技,出牌阶段,你可以记录你当前〖覆谋〗的状态、你的手牌数和你的体力值,然后获得技能〖入世〗。",
dcsbrushi: "入世",
dcsbrushi_info: "限定技,出牌阶段,你可以将你当前〖覆谋〗的状态、你的手牌数和你的体力值调整为你发动〖肃身〗时的记录。",
dcsbfumou: "覆谋",
dcsbfumou_info: "转换技出牌阶段限一次你可以观看一名其他角色A的手牌并展示其一半手牌并将这些牌交给另一名其他角色B然后你与A各摸X张牌X为A以此法失去的手牌数令A依次使用这些牌中所有其可以使用的牌。",
}; };
export default translates; export default translates;