From 6a29c0b30f40505c3d5d0b0b3f4b1dc54c17b4a6 Mon Sep 17 00:00:00 2001 From: Tipx-L <138244655+Tipx-L@users.noreply.github.com> Date: Fri, 19 Jan 2024 08:20:46 -0800 Subject: [PATCH 1/2] Finally fix the gift mechanic. --- card/yongjian.js | 2 +- character/standard.js | 2 +- noname/library/index.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/card/yongjian.js b/card/yongjian.js index 5e0a3e7e1..e8bbf0af6 100644 --- a/card/yongjian.js +++ b/card/yongjian.js @@ -414,7 +414,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ filter:(event,player)=>event.player!=player, logTarget:'player', content:()=>{ - trigger.deniedGift.add(trigger.card); + trigger.deniedGifts.add(trigger.card); }, ai:{ refuseGifts:true diff --git a/character/standard.js b/character/standard.js index 913afa23f..752085525 100755 --- a/character/standard.js +++ b/character/standard.js @@ -710,7 +710,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.storage.xinluoshen=event.cards.slice(0); return; } - }; + } } }, mod:{ diff --git a/noname/library/index.js b/noname/library/index.js index 2c63d5759..0889a95ab 100644 --- a/noname/library/index.js +++ b/noname/library/index.js @@ -13088,7 +13088,7 @@ export class Library extends Uninstantable { static other = { ignore: () => void 0 }; -}; +} Library.config = undefined; Library.configOL = undefined; From 6e3f14d9e05529012db0603041214f3c09c6a87d Mon Sep 17 00:00:00 2001 From: Tipx-L <138244655+Tipx-L@users.noreply.github.com> Date: Fri, 19 Jan 2024 08:58:52 -0800 Subject: [PATCH 2/2] Fix types. --- noname/game/index.js | 2 +- noname/library/element/gameEventPromise.js | 4 +--- noname/library/index.js | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/noname/game/index.js b/noname/game/index.js index 39e03eaf5..359af5f25 100644 --- a/noname/game/index.js +++ b/noname/game/index.js @@ -8434,6 +8434,6 @@ export class Game extends Uninstantable { return true; }); } -}; +} export const game = Game; diff --git a/noname/library/element/gameEventPromise.js b/noname/library/element/gameEventPromise.js index 3b650cf5c..9db3808f0 100644 --- a/noname/library/element/gameEventPromise.js +++ b/noname/library/element/gameEventPromise.js @@ -1,9 +1,7 @@ -import { AI as ai } from '../../ai/index.js'; import { Get as get } from '../../get/index.js'; import { Game as game } from '../../game/index.js'; import { Library as lib } from "../index.js"; import { status as _status } from '../../status/index.js'; -import { UI as ui } from '../../ui/index.js'; import { AsyncFunction } from '../../util/index.js'; /** @@ -16,7 +14,7 @@ import { AsyncFunction } from '../../util/index.js'; * 且Promise的原有属性无法被修改,一切对这个类实例的属性修改,删除, * 再配置等操作都会转发到事件对应的属性中。 * - * @template { GameEvent } T + * @extends {Promise} * * @example * 使用await xx()等待异步事件执行: diff --git a/noname/library/index.js b/noname/library/index.js index 0889a95ab..ed6c04ff9 100644 --- a/noname/library/index.js +++ b/noname/library/index.js @@ -5,7 +5,7 @@ * @typedef { InstanceType } Button * @typedef { InstanceType } Dialog * @typedef { InstanceType } GameEvent - * @typedef { InstanceType & InstanceType> } GameEventPromise + * @typedef { InstanceType & InstanceType } GameEventPromise * @typedef { InstanceType } NodeWS * @typedef { InstanceType } Control */