Revert "修改createTrigger,拆分触发技的选择部分和主体content部分"

This reverts commit 421d2a4294.
This commit is contained in:
copcap 2024-02-27 14:23:03 +08:00
parent 5b3f61db72
commit 703727751f
No known key found for this signature in database
GPG Key ID: 30E7AB6699451AEE
1 changed files with 11 additions and 31 deletions

View File

@ -2227,34 +2227,18 @@ 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);
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 (trigger.skillwarn) {
if (next.prompt2) next.set('prompt2', '<span class="thundertext">' + trigger.skillwarn + '。</span>' + next.prompt2);
@ -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);