diff --git a/audio/die/dc_sb_zhugejin.mp3 b/audio/die/dc_sb_zhugejin.mp3 new file mode 100644 index 000000000..3ebfa8e10 Binary files /dev/null and b/audio/die/dc_sb_zhugejin.mp3 differ diff --git a/audio/skill/dcsbhoude1.mp3 b/audio/skill/dcsbhoude1.mp3 new file mode 100644 index 000000000..a4d26bf61 Binary files /dev/null and b/audio/skill/dcsbhoude1.mp3 differ diff --git a/audio/skill/dcsbhoude2.mp3 b/audio/skill/dcsbhoude2.mp3 new file mode 100644 index 000000000..f9277c3e8 Binary files /dev/null and b/audio/skill/dcsbhoude2.mp3 differ diff --git a/audio/skill/dcsbtaozhou1.mp3 b/audio/skill/dcsbtaozhou1.mp3 new file mode 100644 index 000000000..a55027d76 Binary files /dev/null and b/audio/skill/dcsbtaozhou1.mp3 differ diff --git a/audio/skill/dcsbtaozhou2.mp3 b/audio/skill/dcsbtaozhou2.mp3 new file mode 100644 index 000000000..85d25a4a1 Binary files /dev/null and b/audio/skill/dcsbtaozhou2.mp3 differ diff --git a/character/xianding/character.js b/character/xianding/character.js index 3df6be7a7..fa813f3ca 100644 --- a/character/xianding/character.js +++ b/character/xianding/character.js @@ -1,4 +1,5 @@ const characters = { + dc_sb_zhugejin: ["male", "wu", 3, ["dcsbtaozhou", "dcsbhoude"]], dc_sb_jiaxu: ["male", "qun", 3, ["dcsbsushen", "dcsbfumou"]], guanyue: ["male", "shu", 4, ["dcshouzhi", "dcfenhui"]], sp_zhenji: ["female", "qun", 3, ["dcjijie", "dchuiji"]], diff --git a/character/xianding/characterReplace.js b/character/xianding/characterReplace.js index 1253ae7f4..6b585cbe4 100644 --- a/character/xianding/characterReplace.js +++ b/character/xianding/characterReplace.js @@ -13,6 +13,7 @@ const characterReplaces = { caofang: ["caofang", "jsrg_caofang"], caomao: ["caomao", "mb_caomao"], sp_zhenji: ["sp_zhenji", "jsrg_zhenji"], + zhugejin: ["zhugejin", "dc_sb_zhugejin"], }; export default characterReplaces; diff --git a/character/xianding/skill.js b/character/xianding/skill.js index d3f5e4939..f5b9d6a71 100644 --- a/character/xianding/skill.js +++ b/character/xianding/skill.js @@ -1,7 +1,250 @@ import { lib, game, ui, get, ai, _status } from "../../noname.js"; +import cards from "../sp2/card.js"; /** @type { importCharacterConfig['skill'] } */ const skills = { + //诸葛瑾 + dcsbtaozhou: { + audio: 2, + enable: "phaseUse", + filter(event, player) { + return game.hasPlayer(current => { + if (current.hasSkill("dcsbzijin")) return false; + return current.countCards("h") > 0 && current !== player; + }); + }, + derivation: "dcsbzijin", + chooseButton: { + dialog() { + return ui.create.dialog("###讨州###请选择一个数字(对其他角色不可见)"); + }, + chooseControl(event, player) { + const list = [1, 2, 3]; + list.push("cancel2"); + return list; + }, + check() { + const event = get.event(), player = get.player(); + if ( + game.hasPlayer(current => { + return current !== player && get.attitude(player, current) > 0; + }) + ) + return [0, 1, 2].randomGet(); + if (player.hasShan()) return 2; + const rand = event.getRand(); + if (rand < 0.2) return 0; + if (rand < 0.5) return 1; + return 2; + }, + backup(result, player) { + return { + audio: "dcsbtaozhou", + chosenNumber: result.index + 1, + filterCard: () => false, + selectCard: -1, + filterTarget(card, player, target) { + if (target.hasSkill("dcsbzijin")) return false; + return target.countCards("h") > 0 && target !== player; + }, + async content(event, trigger, player) { + const [target] = event.targets; + const chosenNumber = get.info("dcsbtaozhou_backup").chosenNumber; + const cards = await target + .chooseToGive(`${get.translation(player)}对你发动了【讨州】`, "你可以交给其至多三张手牌", [1, 3]) + .set("ai", card => { + if (get.event("att") > 0) { + if (get.event("chosenNumber") < ui.selected.cards.length + (get.event("getRand")() < 0.5)) { + return 5 - get.value(card); + } + return 0; + } + return -get.value(card); + }) + .set("att", get.attitude(target, player)) + .set("chosenNumber", chosenNumber) + .forResultCards(); + const givenCount = (cards && cards.length) || 0; + const delta = Math.abs(givenCount - chosenNumber); + if (givenCount >= chosenNumber) { + await game.asyncDraw([player, target]); + } else { + target.addSkill("dcsbtaozhou_debuff"); + target.addMark("dcsbtaozhou_debuff", delta, false); + } + if (delta >= 2) { + const sha = get.autoViewAs({ name: "sha" }); + if (target.canUse(sha, player, false)) { + await target.addSkills("dcsbzijin"); + await target.useCard(sha, player, "noai"); + } + } + const roundNumberToRestore = game.roundNumber + chosenNumber; + player.tempBanSkill("dcsbtaozhou", "forever"); + player + .when({ global: "roundStart" }) + .filter(() => { + return game.roundNumber >= roundNumberToRestore; + }) + .assign({ + firstDo: true, + }) + .then(() => { + delete player.storage[`temp_ban_dcsbtaozhou`]; + }); + }, + ai: { + result: { + player: 0.5, + target() { + const chosenNumber = get.info("dcsbtaozhou_backup").chosenNumber; + if (chosenNumber > 1) return -1; + return 0; + }, + }, + }, + }; + }, + prompt: () => "请选择【讨州】的目标", + }, + subSkill: { + backup: {}, + debuff: { + trigger: { player: "damageBegin3" }, + forced: true, + charlotte: true, + async content(event, trigger, player) { + trigger.num++; + player.removeMark("dcsbtaozhou_debuff", 1, false); + if (!player.countMark("dcsbtaozhou_debuff")){ + player.removeSkill("dcsbtaozhou_debuff"); + } + }, + intro: { + content: "下&次受到伤害时,伤害+1", + }, + }, + }, + ai: { + order: 9.6, + result: { + player: 1, + }, + }, + }, + dcsbzijin: { + audio: 2, + trigger: { + player: "useCardAfter", + }, + filter(event, player) { + return !game.hasPlayer2(current => { + return current.hasHistory("damage", evt => evt.card === event.card); + }, true); + }, + forced: true, + async content(event, trigger, player) { + const bool = await player + .chooseToDiscard("自矜:弃置一张牌或失去1点体力", "he") + .set("ai", card => { + const player = get.player(); + if (get.effect(player, { name: "losehp" }, player, player) > 0) return 0; + return 5 - get.value(card); + }) + .forResultBool(); + if (!bool) await player.loseHp(); + }, + ai: { + effect: { + player_use(card, player) { + if (get.effect(player, { name: "losehp" }, player) > 0) return; + if (!get.tag(card, "damage") && get.value(card) < 5) + return [ + 0.2, + player.hasCard(card => { + return get.value(card) < 3; + }, "he") + ? -0.1 + : -2, + ]; + }, + }, + neg: true, + }, + }, + dcsbhoude: { + audio: 2, + trigger: { + target: "useCardToTargeted", + }, + filter(event, player) { + const phaseUse = event.getParent("phaseUse"); + if (!phaseUse || phaseUse.name !== "phaseUse" || phaseUse.player === player) return false; + const filter = card => { + const color = get.color(card); + return (get.name(card) === "sha" && color === "red") || (get.type(card) === "trick" && color === "black"); + }; + const evt = event.getParent(); + if ( + game + .getGlobalHistory( + "useCard", + evt => { + return filter(evt.card); + }, + evt + ) + .indexOf(evt) !== 0 + ) + return false; + return filter(event.card); + }, + async cost(event, trigger, player) { + const target = trigger.player; + let result; + if (get.name(trigger.card) === "sha") { + result = await player + .chooseToDiscard(get.prompt("dcsbhoude", target), `弃置一张牌,令${get.translation(trigger.card)}对你无效。`, "chooseonly", "he") + .set("ai", card => { + if (!get.event("goon")) return 0; + return 5.5 - get.value(card); + }) + .set("goon", get.effect(player, trigger.card, target, player) < 0) + .forResult(); + } else { + result = await player + .choosePlayerCard(`###${get.prompt("dcsbhoude", target)}###