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