扩大filterStop的使用范围

This commit is contained in:
Spmario233 2024-03-26 17:24:45 +08:00
parent 7044ba0a37
commit c072280a05
1 changed files with 5 additions and 0 deletions

View File

@ -170,6 +170,10 @@ export class GameEvent {
* @type { string }
*/
name;
/**
* @type { Function | void | null }
*/
filterStop;
/**
* @param {keyof this} key
* @param {number} [value]
@ -760,6 +764,7 @@ export class GameEvent {
if (!lib.hookmap[name] && !lib.config.compatiblemode) return;
if (!game.players || !game.players.length) return;
const event = this;
if (event.filterStop && event.filterStop()) return;
let start = [_status.currentPhase, event.source, event.player, game.me, game.players[0]].find(i => get.itemtype(i) == 'player');
if (!start) return;
if (!game.players.includes(start) && !game.dead.includes(start)) start = game.findNext(start);