远野美凪~中津静流 cost分离修改

This commit is contained in:
Spmario233 2024-03-13 22:44:16 +08:00
parent 29da9c7ec6
commit c34bd7fb33
4 changed files with 486 additions and 523 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2306,12 +2306,10 @@ export const Content = {
targets = [targets];
}
if (info.popup != false && !info.direct) {
if (info.popup) {
player.popup(info.popup);
game.log(player, '发动了', '【' + get.skillTranslation(event.skill, player) + '】');
}
if (info.logLine === false) player.logSkill(event.skill, false, info.line);
else player.logSkill(event.skill, targets, info.line);
let popup_info = event.skill;
if(typeof info.popup === 'string') popup_info = [event.skill, info.popup];
if (info.logLine === false) player.logSkill(popup_info, false, info.line);
else player.logSkill(popup_info, targets, info.line);
}
var next = game.createEvent(event.skill);
if (typeof info.usable == 'number') {

View File

@ -333,10 +333,10 @@ export class GameEvent {
this.untrigger(arg1, arg2);
this.finish();
if (notrigger != 'notrigger') {
this.trigger(this.name + 'Cancelled');
if (this.player && lib.phaseName.includes(this.name)) this.player.getHistory('skipped').add(this.name);
return this.trigger(this.name + 'Cancelled');
}
return this;
return null;
}
neutralize(event) {
this.untrigger();

View File

@ -371,6 +371,7 @@ export class Player extends HTMLDivElement {
* ```
*/
when() {
const player = this;
if (!_status.postReconnect.player_when) _status.postReconnect.player_when = [
function (map) {
"use strict";
@ -386,7 +387,13 @@ export class Player extends HTMLDivElement {
];
let triggerNames = Array.from(arguments);
let trigger;
let instantlyAdd = true;
if (triggerNames.length == 0) throw 'player.when的参数数量应大于0';
//从triggerNames中取出instantlyAdd的部分
if (triggerNames.includes(false)) {
instantlyAdd = false;
triggerNames.remove(false);
}
// add other triggerNames
// arguments.length = 1
if (triggerNames.length == 1) {
@ -506,7 +513,7 @@ export class Player extends HTMLDivElement {
}
});
}, skillName);
this.addSkill(skillName);
if (instantlyAdd !== false) this.addSkill(skillName);
_status.postReconnect.player_when[1][skillName] = true;
return {
/**
@ -603,6 +610,14 @@ export class Player extends HTMLDivElement {
if (skill.contentFuns.length > 0) createContent();
return this;
},
/**
* 获得技能
* 如果instantlyAdd为false则需要以此法获得技能
**/
finish() {
player.addSkill(skillName);
return this;
}
};
}
/**
@ -7877,14 +7892,14 @@ export class Player extends HTMLDivElement {
skillName = 'player_tempSkills_' + Math.random().toString(36).slice(-8);
} while (player.additionalSkills[skillName] != null);
player.addAdditionalSkill(skillName, skillsToAdd);
player.when(expire).assign({
player.when(expire,false).assign({
firstDo: true,
priority: Infinity,
}).vars({
skillName
}).then(() => {
player.removeAdditionalSkills(skillName);
});
}).finish();
}
});
}
@ -7927,13 +7942,13 @@ export class Player extends HTMLDivElement {
if (!expire) expire = { global: ['phaseAfter', 'phaseBeforeStart'] };
else if (typeof expire == 'string' || Array.isArray(expire)) expire = { global: expire };
this.when(expire).assign({
this.when(expire,false).assign({
firstDo: true,
}).vars({
bannedSkill: skill,
}).then(() => {
delete player.storage[`temp_ban_${bannedSkill}`];
});
}).finish();
}
return skill;
}