From 187ee966d64976b346981eae18091984340d4284 Mon Sep 17 00:00:00 2001 From: libccy Date: Tue, 28 Nov 2017 10:52:46 +0800 Subject: [PATCH] 3 --- character/swd.js | 189 ++++++++++++++++++++++++++++++++++++++++++++--- game/update.js | 5 +- 2 files changed, 180 insertions(+), 14 deletions(-) diff --git a/character/swd.js b/character/swd.js index 393e03e53..50bf5e10e 100644 --- a/character/swd.js +++ b/character/swd.js @@ -16,7 +16,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ swd_chenjingchou:['male','wu',3,['youyin','yihua']], swd_duguningke:['female','qun',3,['nlianji','touxi']], - swd_guyue:['male','wei',3,['gtiandao','qinyin','wangchen']], + swd_guyue:['male','wei',3,['gtiandao','gxianyin','wangchen']], swd_tuobayuer:['female','shu',4,['liuhong','poyue','niepan']], swd_yuwentuo:['male','shu',4,['wushuang','xielei','kunlunjing']], swd_yuxiaoxue:['female','wei',3,['huanhun','daixing','yinyue']], @@ -223,6 +223,140 @@ game.import('character',function(lib,game,ui,get,ai,_status){ swd_luchengxuan:['swd_xiarou'], }, skill:{ + gxianyin:{ + enable:'phaseUse', + usable:1, + delay:0, + content:function(){ + 'step 0' + var max=0; + var choice='club'; + var map={ + club:0, + heart:0, + diamond:0, + spade:0 + }; + for(var i in map){ + var hs=player.getCards('h',{suit:i}); + for(var j=0;j7){ + map[i]=0;break; + } + else if(val<=5){ + map[i]++; + if(val<=4){ + map[i]+=0.5; + } + if(val<0){ + map[i]+=2; + } + } + } + if(map[i]>max){ + choice=i; + max=map[i]; + } + } + var controls=['heart2','spade2','diamond2','club2']; + for(var i=0;i=3){ + return controls[2]; + } + else{ + return controls[0]; + } + }).set('prompt','选择一个花色从牌堆中获得'+hs.length+'张该花色的牌'); + event.num=hs.length; + 'step 2' + if(result.control){ + var suit=result.control.slice(0,result.control.length-1); + var cards=[]; + for(var i=0;i7){ + bool=false;break; + } + else if(val<=4){ + bool=true; + } + } + if(bool){ + return 1; + } + } + return 0; + } + } + } + }, yeying:{ enable:'phaseUse', usable:1, @@ -4466,6 +4600,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ direct:true, filter:function(event,player){ if(event.cards){ + // if(!get.is.altered('wangchen')) return true; for(var i=0;i