From 703727751fce75ffdf497cd36a3e59a4f12a02dd Mon Sep 17 00:00:00 2001 From: copcap Date: Tue, 27 Feb 2024 14:23:03 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E4=BF=AE=E6=94=B9createTrigger?= =?UTF-8?q?=EF=BC=8C=E6=8B=86=E5=88=86=E8=A7=A6=E5=8F=91=E6=8A=80=E7=9A=84?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=83=A8=E5=88=86=E5=92=8C=E4=B8=BB=E4=BD=93?= =?UTF-8?q?content=E9=83=A8=E5=88=86"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 421d2a42948fca015a3b44c4052a34eaaed53626. --- noname/library/element/content.js | 42 ++++++++----------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/noname/library/element/content.js b/noname/library/element/content.js index 35b346b08..1ee63eaa4 100644 --- a/noname/library/element/content.js +++ b/noname/library/element/content.js @@ -2227,33 +2227,17 @@ export const Content = { else str = get.prompt(event.skill, null, player); if (typeof str == 'function') str = str(trigger, player); - const { costContent } = info; - let next; - if (costContent) { - event.modifiedCostContent = true; - next = costContent(trigger, player); - if (!next.prompt) get.evtprompt(next, str); - } - else{ - next = player.chooseBool(str); - if (event.frequentSkill) next.set('frequentSkill', event.skill); - } + var next = player.chooseBool(str); + if (event.frequentSkill) next.set('frequentSkill', event.skill); next.set('forceDie', true); next.set('includeOut', true); - if (!next.ai){ - if(!event.modifiedCostContent) next.set('ai', () => !check || check(trigger, player)); - else{ - next.set('ai', check); - } - } + next.ai = () => !check || check(trigger, player); - if (!next.prompt2) { - if (typeof info.prompt2 == 'function') next.set('prompt2', info.prompt2(trigger, player)); - else if (typeof info.prompt2 == 'string') next.set('prompt2', info.prompt2); - else if (info.prompt2 != false) { - if (lib.dynamicTranslate[event.skill]) next.set('prompt2', lib.dynamicTranslate[event.skill](player, event.skill)); - else if (lib.translate[event.skill + '_info']) next.set('prompt2', lib.translate[event.skill + '_info']); - } + if (typeof info.prompt2 == 'function') next.set('prompt2', info.prompt2(trigger, player)); + else if (typeof info.prompt2 == 'string') next.set('prompt2', info.prompt2); + else if (info.prompt2 != false) { + if (lib.dynamicTranslate[event.skill]) next.set('prompt2', lib.dynamicTranslate[event.skill](player, event.skill)); + else if (lib.translate[event.skill + '_info']) next.set('prompt2', lib.translate[event.skill + '_info']); } if (trigger.skillwarn) { @@ -2278,16 +2262,13 @@ export const Content = { return event.finish(); } if (info.popup != false && !info.direct) { - let logTarget = info.logTarget; - if (result.targets && result.targets.length) logTarget = result.targets; - else if (typeof info.logTarget == 'string') logTarget = trigger[info.logTarget]; - else if (typeof info.logTarget == 'function') logTarget = info.logTarget(trigger, player); if (info.popup) { player.popup(info.popup); game.log(player, '发动了', '【' + get.skillTranslation(event.skill, player) + '】'); } - else if (!logTarget || info.logLine === false) player.logSkill(event.skill, false, info.line); - else player.logSkill(event.skill, logTarget, info.line); + else if (!info.logTarget || info.logLine === false) player.logSkill(event.skill, false, info.line); + else if (typeof info.logTarget == 'string') player.logSkill(event.skill, trigger[info.logTarget], info.line); + else if (typeof info.logTarget == 'function') player.logSkill(event.skill, info.logTarget(trigger, player), info.line); } var next = game.createEvent(event.skill); if (typeof info.usable == 'number') { @@ -2299,7 +2280,6 @@ export const Content = { next.player = player; next._trigger = trigger; next.triggername = event.triggername; - next.costResult = result; // if ("contents" in info && Array.isArray(info.contents)) { // next.setContents(info.contents);