get.order添加第二个角色参数

This commit is contained in:
mengxinzxz 2024-02-06 12:42:42 +08:00
parent 487a4f2b1d
commit 83177bdd66
1 changed files with 4 additions and 4 deletions

View File

@ -4205,7 +4205,8 @@ export class Get extends Uninstantable {
let cache = CacheContext.requireCacheContext(); let cache = CacheContext.requireCacheContext();
return cache.get.order(item); return cache.get.order(item);
} }
static order(item) { static order(item, player) {
player = (player || _status.event.player);
let cache = CacheContext.requireCacheContext(); let cache = CacheContext.requireCacheContext();
var info = get.info(item); var info = get.info(item);
if (!info) return -1; if (!info) return -1;
@ -4216,10 +4217,9 @@ export class Get extends Uninstantable {
if (order == undefined) return -1; if (order == undefined) return -1;
var num = order; var num = order;
if (typeof (order) == 'function') { if (typeof (order) == 'function') {
num = order(item, _status.event.player); num = order(item, player);
} }
if (typeof item == 'object' && _status.event.player) { if (typeof item == 'object' && player) {
var player = _status.event.player;
num = game.checkMod(player, item, num, 'aiOrder', player); num = game.checkMod(player, item, num, 'aiOrder', player);
} }
return num; return num;