From 67d3559612b2df1235e3fe20da902cd1bd1d75d1 Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Thu, 28 Dec 2023 11:19:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=8A=E6=97=B6=E7=A7=BB=E9=99=A4=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=A4=B1=E6=95=88=E7=9A=84=E5=85=A8=E5=B1=80ai?= =?UTF-8?q?=E4=BB=A5=E6=8F=90=E9=AB=98=E6=B8=B8=E6=88=8F=E6=B5=81=E7=95=85?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/diy.js | 20 +++++++++++++++++--- character/gujian.js | 17 +++-------------- character/huicui.js | 16 +++++++++++++++- character/jsrg.js | 16 +++++++++++++++- character/offline.js | 16 +++++++++++++++- character/shenhua.js | 10 ++++------ character/sp2.js | 16 +++++++++++++++- character/xianding.js | 16 +++++++++++++++- character/xinghuoliaoyuan.js | 16 +++++++++++++++- character/yingbian.js | 18 ++++++++++++++++-- 10 files changed, 130 insertions(+), 31 deletions(-) diff --git a/character/diy.js b/character/diy.js index 03b87777a..2704a047f 100755 --- a/character/diy.js +++ b/character/diy.js @@ -7778,7 +7778,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ mod:{ globalFrom:function(from,to,num){ return num-game.countPlayer(function(current){ - return current!=from&¤t.isFriendOf(from)&¤t.hasSkill('yuzuru_bujin'); + return current!=from&¤t.hasSkill('yuzuru_bujin')&¤t.isFriendOf(from); }); }, }, @@ -11916,6 +11916,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, nslongyue:{ + init:()=>{ + game.addGlobalSkill('nslongyue_ai'); + }, + onremove:()=>{ + if(!game.hasPlayer(i=>i.hasSkill('nslongyue'),true)) game.removeGlobalSkill('nslongyue_ai'); + }, trigger:{global:'useCard'}, filter:function(event,player){ return get.type(event.card,'trick')=='trick'&&event.player.getHistory('useCard').indexOf(event)==0; @@ -11929,8 +11935,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, ai:{ expose:0.2, - }, - global:'nslongyue_ai', + } }, nslongyue_ai:{ mod:{ @@ -11940,6 +11945,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ })) return num+6; }, }, + trigger:{player:'dieAfter'}, + filter:()=>{ + return !game.hasPlayer(i=>i.hasSkill('nslongyue'),true); + }, + silent:true, + forceDie:true, + content:()=>{ + game.removeGlobalSkill('nslongyue_ai'); + } }, nszhenyin:{ trigger:{global:'judge'}, diff --git a/character/gujian.js b/character/gujian.js index 20eddc160..fdd4eb722 100644 --- a/character/gujian.js +++ b/character/gujian.js @@ -1638,11 +1638,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, meiying:{ - global:'meiying2', globalSilent:true, trigger:{global:'phaseEnd'}, filter:function(event,player){ - return event.player!=player&&!event.player.tempSkills.meiying3&&event.player.isAlive()&&player.countCards('he',{color:'red'})>0; + return event.player!=player&&event.player.isAlive()&&player.countCards('he',{color:'red'})&&event.player.getHistory('useCard',evt=>{ + return evt.targets&&evt.targets.some(i=>i!==event.player); + }).length===0; }, direct:true, content:function(){ @@ -1665,18 +1666,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ expose:0.1 } }, - meiying2:{ - trigger:{player:'useCard'}, - filter:function(event,player){ - return _status.currentPhase==player&&event.targets&&(event.targets.length>1||event.targets[0]!=player); - }, - forced:true, - popup:false, - content:function(){ - player.addTempSkill('meiying3'); - } - }, - meiying3:{}, jianwu:{ trigger:{player:'shaBegin'}, forced:true, diff --git a/character/huicui.js b/character/huicui.js index 89f1fdbd2..952b79b20 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -1850,6 +1850,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ //裴元绍 dcmoyu:{ audio:2, + init:()=>{ + game.addGlobalSkill('dcmoyu_ai'); + }, + onremove:()=>{ + if(!game.hasPlayer(i=>i.hasSkill('dcmoyu'),true)) game.removeGlobalSkill('dcmoyu_ai'); + }, enable:'phaseUse', filter:function(event,player){ return !player.hasSkill('dcmoyu_ban')&&game.hasPlayer(current=>lib.skill.dcmoyu.filterTarget(null,player,current)); @@ -1857,7 +1863,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filterTarget:function(card,player,target){ return player!=target&&!player.getStorage('dcmoyu_clear').contains(target)&&target.countGainableCards(player,'hej'); }, - global:'dcmoyu_ai', content:function(){ 'step 0' player.addTempSkill('dcmoyu_clear'); @@ -1893,6 +1898,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ intro:{content:'偷马贼被反打了!'}, }, ai:{ + trigger:{player:'dieAfter'}, + filter:()=>{ + return !game.hasPlayer(i=>i.hasSkill('dcmoyu'),true); + }, + silent:true, + forceDie:true, + content:()=>{ + game.removeGlobalSkill('dcmoyu_ai'); + }, ai:{ effect:{ target:function(card,player,target,current){ diff --git a/character/jsrg.js b/character/jsrg.js index 94f5a61fb..38761f34d 100644 --- a/character/jsrg.js +++ b/character/jsrg.js @@ -1678,7 +1678,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, zhuSkill:true, forced:true, - global:'jsrgjiemeng_effect', + init:()=>{ + game.addGlobalSkill('jsrgjiemeng_effect'); + }, + onremove:()=>{ + if(!game.hasPlayer(i=>i.hasSkill('jsrgjiemeng'),true)) game.removeGlobalSkill('jsrgjiemeng_effect'); + }, subSkill:{ effect:{ mod:{ @@ -1688,6 +1693,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return distance-game.countPlayer(current=>current.group=='qun'); }, }, + trigger:{player:'dieAfter'}, + filter:()=>{ + return !game.hasPlayer(i=>i.hasSkill('jsrgjiemeng'),true); + }, + silent:true, + forceDie:true, + content:()=>{ + game.removeGlobalSkill('jsrgjiemeng_effect'); + } }, }, }, diff --git a/character/offline.js b/character/offline.js index 25b67e0b2..6c4a11617 100644 --- a/character/offline.js +++ b/character/offline.js @@ -3729,7 +3729,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ yjdumou:{ audio:2, forced:true, - global:'yjdumou_du', mod:{ cardname:function(card,player,name){ if(player==_status.currentPhase&&card.name=='du') return 'guohe'; @@ -3738,6 +3737,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(card.name=='du') return get.value({name:'guohe'}); }, }, + init:()=>{ + game.addGlobalSkill('yjdumou_du'); + }, + onremove:()=>{ + if(!game.hasPlayer(i=>i.hasSkill('yjdumou'),true)) game.removeGlobalSkill('yjdumou_du'); + }, subSkill:{ du:{ mod:{ @@ -3747,6 +3752,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ aiValue:function(player,card,num){ if(get.name(card)=='du'&&card.name!='du') return get.value({name:card.name}); }, + }, + trigger:{player:'dieAfter'}, + filter:()=>{ + return !game.hasPlayer(i=>i.hasSkill('yjdumou'),true); + }, + silent:true, + forceDie:true, + content:()=>{ + game.removeGlobalSkill('yjdumou_du'); } } }, diff --git a/character/shenhua.js b/character/shenhua.js index ce70f6d04..67081054b 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -5352,15 +5352,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ wansha2:{ mod:{ cardSavable:function(card,player){ - if(!_status.currentPhase) return; - if(_status.currentPhase.isIn()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){ - if(card.name=='tao'&&!player.isDying()) return false; + if(card.name=='tao'&&_status.currentPhase&&_status.currentPhase.isIn()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){ + if(!player.isDying()) return false; } }, cardEnabled:function(card,player){ - if(!_status.currentPhase) return; - if(_status.currentPhase.isIn()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){ - if(card.name=='tao'&&!player.isDying()) return false; + if(card.name=='tao'&&_status.currentPhase&&_status.currentPhase.isIn()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){ + if(!player.isDying()) return false; } } } diff --git a/character/sp2.js b/character/sp2.js index 6b1600a71..901a261a4 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -2362,6 +2362,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ //胡班 dcchongyi:{ audio:2, + init:()=>{ + game.addGlobalSkill('dcchongyi_ai'); + }, + onremove:()=>{ + if(!game.hasPlayer(i=>i.hasSkill('dcchongyi'),true)) game.removeGlobalSkill('dcchongyi_ai'); + }, trigger:{global:'useCard'}, logTarget:'player', filter:function(event,player){ @@ -2387,7 +2393,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ target.addTempSkill('dcchongyi_sha'); }, group:'dcchongyi_end', - global:'dcchongyi_ai', subSkill:{ ai:{ mod:{ @@ -2403,6 +2408,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ })) return num+10; }, }, + trigger:{player:'dieAfter'}, + filter:()=>{ + return !game.hasPlayer(i=>i.hasSkill('dcchongyi'),true); + }, + silent:true, + forceDie:true, + content:()=>{ + game.removeGlobalSkill('dcchongyi_ai'); + } }, end:{ audio:'dcchongyi', diff --git a/character/xianding.js b/character/xianding.js index 69e3f3554..507e1f6a5 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -4479,6 +4479,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ //谢灵毓 dcyuandi:{ audio:2, + init:()=>{ + game.addGlobalSkill('dcyuandi_ai'); + }, + onremove:()=>{ + if(!game.hasPlayer(i=>i.hasSkill('dcyuandi'),true)) game.removeGlobalSkill('dcyuandi_ai'); + }, trigger:{global:'useCard'}, filter:function(event,player){ var evt=event.getParent('phaseUse'); @@ -4489,7 +4495,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }).indexOf(event)==0; }, direct:true, - global:'dcyuandi_ai', content:function(){ 'step 0' var target=trigger.player; @@ -4533,6 +4538,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return num/3; }, }, + trigger:{player:'dieAfter'}, + filter:()=>{ + return !game.hasPlayer(i=>i.hasSkill('dcyuandi'),true); + }, + silent:true, + forceDie:true, + content:()=>{ + game.removeGlobalSkill('dcyuandi_ai'); + } }, } }, diff --git a/character/xinghuoliaoyuan.js b/character/xinghuoliaoyuan.js index 2f881f09f..09ef29831 100755 --- a/character/xinghuoliaoyuan.js +++ b/character/xinghuoliaoyuan.js @@ -881,6 +881,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ xinfu_guanwei:{ audio:2, usable:1, + init:()=>{ + game.addGlobalSkill('xinfu_guanwei_ai'); + }, + onremove:()=>{ + if(!game.hasPlayer(i=>i.hasSkill('xinfu_guanwei'),true)) game.removeGlobalSkill('xinfu_guanwei_ai'); + }, trigger:{ global:"phaseUseEnd", }, @@ -898,7 +904,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return num>1; }, direct:true, - global:'xinfu_guanwei_ai', content:function (){ 'step 0' var target=trigger.player; @@ -925,6 +930,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, subSkill:{ ai:{ + trigger:{player:'dieAfter'}, + filter:()=>{ + return !game.hasPlayer(i=>i.hasSkill('xinfu_guanwei'),true); + }, + silent:true, + forceDie:true, + content:()=>{ + game.removeGlobalSkill('xinfu_guanwei_ai'); + }, ai:{ effect:{ player_use:function(card,player,target){ diff --git a/character/yingbian.js b/character/yingbian.js index 0d9bfa30c..7c5d6795d 100644 --- a/character/yingbian.js +++ b/character/yingbian.js @@ -2401,6 +2401,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, ciwei:{ + init:()=>{ + game.addGlobalSkill('ciwei_ai'); + }, + onremove:()=>{ + if(!game.hasPlayer(i=>i.hasSkill('ciwei'),true)) game.removeGlobalSkill('ciwei_ai'); + }, trigger:{global:'useCard'}, direct:true, preHidden:true, @@ -2426,8 +2432,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger.targets.length=0; trigger.all_excluded=true; } - }, - global:'ciwei_ai', + } }, ciwei_ai:{ mod:{ @@ -2448,6 +2453,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return num; }, }, + trigger:{player:'dieAfter'}, + filter:()=>{ + return !game.hasPlayer(i=>i.hasSkill('ciwei'),true); + }, + silent:true, + forceDie:true, + content:()=>{ + game.removeGlobalSkill('ciwei_ai'); + } }, caiyuan:{ trigger:{player:'phaseEnd'},