From 6c29435e2da55bb7644ad0fdfbe4115d4fbf0c6e Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Sat, 17 Feb 2024 13:46:17 +0800 Subject: [PATCH] =?UTF-8?q?yigui=5Fgzwuxie=E5=86=99=E6=B3=95=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mode/guozhan.js | 76 ++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/mode/guozhan.js b/mode/guozhan.js index d94814f30..11f1ee0f5 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -7661,7 +7661,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, check:function(button){ return 1/(1+game.countPlayer(function(current){ - return current.identity==button.link; + return current.identity==lib.character[button.link][1]; })); }, backup:function(links,player){ @@ -7692,57 +7692,62 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, ai:{ respondShan:true, - skillTagFilter:function(player){ + skillTagFilter:function(player,tag,arg){ + if(arg=='respond'||!lib.inpile.includes('shan')) return false; var storage=player.storage.yigui; - if(!storage||!storage.character.length||storage.used.includes('shan')||!lib.inpile.includes('shan')) return false; + if(!storage||!storage.character.length||storage.used.includes('shan')) return false; }, order:0.1, result:{player:1}, }, }, yigui_gzwuxie:{ - hiddenCard:function(player,name){ - var storage=player.storage.yigui; - if(name!='wuxie'||!storage||!storage.character.length||storage.used.includes(name)||!lib.inpile.includes(name)) return false; - return true; - }, - enable:'chooseToUse', - filter:function(event,player){ - if(event.type!='wuxie'||!event.filterCard({name:'wuxie'},player,event)||!lib.inpile.includes('wuxie')) return false; - var storage=player.storage.yigui,target=event.getParent(2).player; - if(!storage||!target||!storage.character.length||storage.used.includes('wuxie')) return false; - var identity=target.identity; + hiddenWuxie(player,info){ + if(!lib.inpile.includes('wuxie')) return false; + const storage=player.storage.yigui; + if(!storage||!storage.character||!storage.character.length||(storage.used&&storage.used.includes('wuxie'))) return false; + if(_status.connectMode) return true; + const target=info.target; + if(!target) return false; + const identity=target.identity; return ['unknown','ye'].includes(identity)||storage.character.some(function(i){ if(lib.character[i][1]=='ye') return true; - var double=get.is.double(i,true); - var groups=(double?double:[lib.character[i][1]]); - return groups.includes(identity); + const double=get.is.double(i,true); + return (double?double:[lib.character[i][1]]).includes(identity); + }); + }, + enable:'chooseToUse', + filter(event,player){ + if(event.type!='wuxie'||!lib.inpile.includes('wuxie')) return false; + const storage=player.storage.yigui; + if(!storage||!storage.character||!storage.character.length||(storage.used&&storage.used.includes('wuxie'))) return false; + const info=event.info_map,target=info.target,identity=target.identity; + return ['unknown','ye'].includes(identity)||storage.character.some(function(i){ + if(lib.character[i][1]=='ye') return true; + const double=get.is.double(i,true); + return (double?double:[lib.character[i][1]]).includes(identity); }); }, chooseButton:{ - dialog:function(event,player){ - var dialog=ui.create.dialog('役鬼','hidden'); + dialog(event,player){ + let dialog=ui.create.dialog('役鬼','hidden'); dialog.add([player.storage.yigui.character,'character']); return dialog; }, - filter:function(button,player){ - var evt=_status.event.getParent('chooseToUse'); - var target=evt.getParent(2).player,identity=target.identity; + filter(button,player){ + const evt=get.event().getParent('chooseToUse'); + const info=evt.info_map,target=info.target,identity=target.identity; if(['unknown','ye'].includes(identity)) return true; if(lib.character[button.link][1]=='ye') return true; - var double=get.is.double(button.link,true); - var groups=(double?double:[lib.character[button.link][1]]); - return groups.includes(identity); + const double=get.is.double(button.link,true); + return (double?double:[lib.character[button.link][1]]).includes(identity); }, - check:function(button){ - return 1/(1+game.countPlayer(function(current){ - return current.identity==button.link; - })); + check(button){ + return 1+Math.random(); }, - backup:function(links,player){ - var character=links[0]; - var next={ - character:character, + backup(links,player){ + return { + character:links[0], filterCard:()=>false, selectCard:-1, complexCard:true, @@ -7750,9 +7755,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ popname:true, audio:'yigui', viewAs:{name:'wuxie',isCard:true}, - onuse:function(result,player){ + onuse(result,player){ player.logSkill('yigui'); - var character=lib.skill.yigui_gzwuxie_backup.character; + const character=lib.skill.yigui_gzwuxie_backup.character; player.flashAvatar('yigui',character); player.storage.yigui.character.remove(character); _status.characterlist.add(character); @@ -7762,7 +7767,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ player.storage.yigui.used.add(result.card.name); }, }; - return next; }, }, ai:{