From 09479829fd765f4315282ce908db377534a12fdf Mon Sep 17 00:00:00 2001 From: Rintim Date: Mon, 18 Sep 2023 11:07:55 +0800 Subject: [PATCH] =?UTF-8?q?[2023/09/18:=20=E2=91=A0]=20Handle=20the=20arra?= =?UTF-8?q?y=20content.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/game.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/game/game.js b/game/game.js index 78cc7facf..8d1252d4a 100644 --- a/game/game.js +++ b/game/game.js @@ -28514,8 +28514,26 @@ switch(typeof item){ case "object": if(Array.isArray(item)){ - // TODO: Parse Array - throw new Error("NYI: Parse Common Object"); + let lastEvent=null; + this.content=(event,step,source,player,target,targets,card,cards,skill,forced,num,trigger,result,_status,lib,game,ui,get,ai)=>{ + if(step>=item.length) return event.finish(); + var current=item[step]; + lastEvent=current(event,{ + event:event, + step:step, + source:source, + player:player, + target:target, + targets:targets, + card:card, + cards:cards, + skill:skill, + forced:forced, + num:num, + trigger:trigger, + result:result + },(lastEvent&&("result" in lastEvent))?lastEvent.result:null); + } } else{ // TODO: Parse Common Object