From 943c0a3b7c53a0315f25d09f401d31601ab16da6 Mon Sep 17 00:00:00 2001 From: kuangshen04 <2832899707@qq.com> Date: Tue, 14 Nov 2023 16:50:26 +0800 Subject: [PATCH] =?UTF-8?q?tempSkills=E5=8F=82=E6=95=B0=E5=BD=92=E4=B8=80?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- game/game.js | 67 ++++++++++++++++++---------------------------------- 2 files changed, 25 insertions(+), 45 deletions(-) diff --git a/.gitignore b/.gitignore index ccd888ae8..1545eea38 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ .Trashes ehthumbs.db Thumbs.db -localStorage.json \ No newline at end of file +localStorage.json +.vscode \ No newline at end of file diff --git a/game/game.js b/game/game.js index 79e204ed4..02f6837b3 100644 --- a/game/game.js +++ b/game/game.js @@ -27725,39 +27725,16 @@ if(this.hasSkill(skill)&&this.tempSkills[skill]==undefined) return; this.addSkill(skill,checkConflict,true,true); - if(!expire){ - expire=['phaseAfter','phaseBeforeStart']; - } + if(!expire) expire={global:['phaseAfter','phaseBeforeStart']}; + else if(typeof expire=='string'||Array.isArray(expire)) expire={global:expire}; this.tempSkills[skill]=expire; - if(typeof expire=='string'){ - lib.hookmap[expire]=true; - } - else if(Array.isArray(expire)){ - for(var i=0;ilib.hookmap[trigger]=true); } } } @@ -31841,21 +31818,23 @@ for(var j in player.additionalSkills){ if(!j.startsWith('hidden:')) notemp.addArray(player.additionalSkills[j]); } - for(var j in player.tempSkills){ - if(notemp.contains(j)) continue; - var expire=player.tempSkills[j]; - if(expire===name|| - (Array.isArray(expire)&&expire.contains(name))|| - (typeof expire==='function'&&expire(event,player,name))){ - delete player.tempSkills[j]; - player.removeSkill(j); + for(const skill in player.tempSkills){ + if(notemp.contains(skill)) continue; + const expire=player.tempSkills[skill]; + if(typeof expire==='function'&&expire(event,player,name)){ + delete player.tempSkills[skill]; + player.removeSkill(skill); } else if(get.objtype(expire)==='object'){ - for(var i=0;i