From 16861b3f8484efb9c0b79a8e2f86bd1c078314bd Mon Sep 17 00:00:00 2001 From: libccy Date: Sat, 14 Jan 2017 12:56:52 +0800 Subject: [PATCH] t5 --- card/guozhan.js | 4 +-- card/swd.js | 18 +++++----- character/diy.js | 4 +-- character/hearth.js | 6 ++-- character/ow.js | 10 ++---- character/rank.js | 1 + character/refresh.js | 12 ++----- character/shenhua.js | 8 ++--- character/sp.js | 83 +++++++++++++++++++++++++++++++++++++++++-- character/standard.js | 4 +-- character/swd.js | 48 ++++++------------------- character/xiake.js | 2 +- character/xianjian.js | 17 +++------ character/yijiang.js | 21 +++-------- character/yxs.js | 7 +--- game/game.js | 10 +++--- mode/boss.js | 10 ++---- mode/chess.js | 5 +-- 18 files changed, 135 insertions(+), 135 deletions(-) diff --git a/card/guozhan.js b/card/guozhan.js index 39d2adfe6..e9b6c24da 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -778,9 +778,7 @@ card.guozhan={ if(player.identity=='ye') return true; return target.identity!=player.identity; }, - prepare:function(cards,player,targets){ - player.$give(cards,targets[0]); - }, + prepare:'give', discard:false, // delay:0.5, content:function(){ diff --git a/card/swd.js b/card/swd.js index 951e83bf7..e75399ff5 100644 --- a/card/swd.js +++ b/card/swd.js @@ -786,7 +786,11 @@ card.swd={ type:'jiguan', wuxieable:true, enable:function(card,player){ - return player.num('e')>0; + var es=player.get('e'); + for(var i=0;i0; }, discard:false, - prepare:function(cards,player,targets){ - player.$give(cards,targets[0]); - }, + prepare:'give', filterTarget:function(card,player,target){ if(player==target) return false; return true; diff --git a/character/diy.js b/character/diy.js index 29b5faec8..792956428 100644 --- a/character/diy.js +++ b/character/diy.js @@ -171,9 +171,7 @@ character.diy={ } return false; }, - prepare:function(cards,player,targets){ - player.$throw(cards); - }, + prepare:'throw', position:'he', filterCard:function(card){ if(get.color(card)!='black') return false; diff --git a/character/hearth.js b/character/hearth.js index d9b50cf30..50d99bbb9 100644 --- a/character/hearth.js +++ b/character/hearth.js @@ -3329,7 +3329,7 @@ character.hearth={ }, discard:false, prepare:function(cards,player){ - player.$give(1,player); + player.$give(1,player,false); }, content:function(){ player.storage.bingjia=cards[0]; @@ -3458,9 +3458,7 @@ character.hearth={ filterTarget:function(card,player,target){ return player!=target&&!target.hasSkill('mdzhoufu2'); }, - prepare:function(cards,player){ - player.$throw(cards); - }, + prepare:'throw', discard:false, content:function(){ target.$gain2(cards); diff --git a/character/ow.js b/character/ow.js index f1fc12c38..2b1886609 100644 --- a/character/ow.js +++ b/character/ow.js @@ -270,9 +270,7 @@ character.ow={ filterCard:true, selectCard:-1, discard:false, - prepare:function(cards,player,targets){ - player.$give(cards,targets[0]); - }, + prepare:'give', content:function(){ target.gain(cards); target.changeHujia(); @@ -325,9 +323,7 @@ character.ow={ return 6-ai.get.value(card); }, discard:false, - prepare:function(cards,player,targets){ - player.$give(1,targets[0]); - }, + prepare:'give2', filterTarget:function(card,player,target){ return target!=player&&!target.hasSkill('shoujia2'); }, @@ -838,7 +834,7 @@ character.ow={ }, discard:false, prepare:function(cards,player){ - player.$give(1,player); + player.$give(1,player,false); }, content:function(){ player.storage.dulei=cards[0]; diff --git a/character/rank.js b/character/rank.js index 0ad3a0804..89c8e3274 100644 --- a/character/rank.js +++ b/character/rank.js @@ -58,6 +58,7 @@ window.characterRank={ 'ow_luxiao', ], a:[ + 'dongbai', 'pal_longkui', 'pal_nangonghuang', 'pal_xingxuan', diff --git a/character/refresh.js b/character/refresh.js index 0b35cad11..5a0a7f20e 100644 --- a/character/refresh.js +++ b/character/refresh.js @@ -33,9 +33,7 @@ character.refresh={ filterCard:true, selectCard:[1,Infinity], discard:false, - prepare:function(cards,player,targets){ - player.$give(cards.length,targets[0]); - }, + prepare:'give2', filterTarget:function(card,player,target){ if(player.storage.rerende2&&player.storage.rerende2.contains(target)) return false; return player!=target; @@ -555,9 +553,7 @@ character.refresh={ return 8-ai.get.value(card); }, discard:false, - prepare:function(cards,player,targets){ - player.$give(cards,targets[0]); - }, + prepare:'give', content:function(){ "step 0" target.storage.refanjian=cards[0]; @@ -1330,9 +1326,7 @@ character.refresh={ filter:function(event,player){ return player.num('he',{suit:'diamond'})>0; }, - prepare:function(cards,player){ - player.$throw(cards); - }, + prepare:'throw', position:'he', filterCard:{suit:'diamond'}, filterTarget:function(card,player,target){ diff --git a/character/shenhua.js b/character/shenhua.js index 53b3d5c8b..cc96f3d9c 100644 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -2286,8 +2286,10 @@ character.shenhua={ player.draw(); }, discard:false, + prompt:'将要重铸的牌置于弃牌堆并摸一张牌', + delay:0.5, prepare:function(cards,player){ - player.$throw(cards); + player.$throw(cards,1000); }, ai:{ basic:{ @@ -3289,9 +3291,7 @@ character.shenhua={ enable:'phaseUse', discard:false, line:true, - prepare:function(cards,player,targets){ - player.$give(cards,targets[0]); - }, + prepare:'give', filter:function(event,player){ if(player.group!='qun') return false; if(player.num('h','shan')+player.num('h','shandian')==0) return 0; diff --git a/character/sp.js b/character/sp.js index 66cb50941..5822b28ae 100644 --- a/character/sp.js +++ b/character/sp.js @@ -100,6 +100,60 @@ character.sp={ dongbai:['dongzhuo'] }, skill:{ + lianzhu:{ + enable:'phaseUse', + usable:1, + filterCard:true, + position:'he', + filterTarget:function(card,player,target){ + return target!=player; + }, + check:function(card){ + var num=ai.get.value(card); + if(get.color(card)=='black'){ + if(num>=6) return 0; + return 20-num; + } + else{ + if(_status.event.player.needsToDiscard()){ + return 7-num; + } + } + return 0; + }, + discard:false, + prepare:'give', + content:function(){ + 'step 0' + target.gain(cards,player); + if(get.color(cards[0])=='black'){ + target.chooseToDiscard(2,'he','弃置两张牌,或令'+get.translation(player)+'摸两张牌').set('ai',function(card){ + if(_status.event.goon) return 7-ai.get.value(card); + return 0; + }).set('goon',ai.get.attitude(target,player)<0); + } + else{ + event.finish(); + } + 'step 1' + if(!result.bool){ + player.draw(2); + } + }, + ai:{ + order:8, + expose:0.2, + result:{ + target:function(player,target){ + if(ui.selected.cards.length&&get.color(ui.selected.cards[0])=='red'){ + if(target.num('h')0; }, - prepare:function(cards,player,targets){ - player.$throw(cards); - player.line(targets); - }, + prepare:'throw', discard:false, filterCard:true, check:function(card){ @@ -3947,9 +3935,7 @@ character.swd={ } return false; }, - prepare:function(cards,player,targets){ - player.$throw(cards); - }, + prepare:'throw', // selectTarget:[1,2], selectCard:[2,2], check:function(card){return 6-ai.get.useful(card)}, @@ -5677,9 +5663,7 @@ character.swd={ return get.type(card,'trick')=='trick'; }, discard:false, - prepare:function(cards,player,targets){ - player.$give(cards,targets[0]); - }, + prepare:'give', filter:function(event,player){ return player.num('h',{type:['trick','delay']})>0; }, @@ -5986,9 +5970,7 @@ character.swd={ funiao:{ enable:'phaseUse', discard:false, - prepare:function(cards,player,targets){ - player.$give(1,targets[0]); - }, + prepare:'give2', filterTarget:function(card,player,target){ if(player==target) return false; if(player.num('h')==0) return false; @@ -6465,9 +6447,7 @@ character.swd={ filter:function(event,player){ return player.num('he',{type:'trick'})>0; }, - prepare:function(cards,player,targets){ - player.$throw(cards); - }, + prepare:'throw', position:'he', filterCard:{type:'trick'}, filterTarget:function(card,player,target){ @@ -6782,10 +6762,7 @@ character.swd={ selectCard:-1, // viewAs:{name:'sha'}, discard:false, - prepare:function(cards,player,targets){ - player.$throw(cards); - player.line(targets); - }, + prepare:'throw', filterTarget:function(card,player,target){ return lib.filter.targetEnabled({name:'sha'},player,target); }, @@ -7876,10 +7853,7 @@ character.swd={ return 8-ai.get.value(card); }, discard:false, - prepare:function(cards,player,targets){ - player.$give(cards,targets[0]); - player.line(targets[0],'green'); - }, + prepare:'give', content:function(){ "step 0" game.delay(); diff --git a/character/xiake.js b/character/xiake.js index 37ccda59f..5ddccdf04 100644 --- a/character/xiake.js +++ b/character/xiake.js @@ -39,7 +39,7 @@ character.xiake={ return player.num('e')>0; }, filterCard:true, - prompt:'弃置要重铸的牌并摸一张牌', + prompt:'将要重铸的牌置于弃牌堆并摸一张牌', discard:false, delay:0.5, check:function(card,player){ diff --git a/character/xianjian.js b/character/xianjian.js index c4c11a6e2..5c5d362f8 100644 --- a/character/xianjian.js +++ b/character/xianjian.js @@ -450,9 +450,7 @@ character.xianjian={ filterTarget:function(card,player,target){ return target!=player; }, - prepare:function(cards,player,targets){ - player.$give(cards,targets[0]); - }, + prepare:'give', discard:false, content:function(){ target.gain(cards,player); @@ -675,10 +673,7 @@ character.xianjian={ discard:false, line:false, multiline:true, - prepare:function(cards,player,targets){ - player.$throw(cards); - player.line(targets); - }, + prepare:'throw', filterTarget:function(card,player,target){ return lib.filter.targetEnabled({name:'sha'},player,target); }, @@ -740,10 +735,7 @@ character.xianjian={ usable:1, filterCard:{name:'shan'}, discard:false, - prepare:function(cards,player,targets){ - player.$give(cards,targets[0]); - game.delay(); - }, + prepare:'give', filterTarget:function(card,player,target){ return target!=player&&!target.hasSkill('tianfu2'); }, @@ -758,11 +750,12 @@ character.xianjian={ target.addSkill('tianfu2'); }, ai:{ + order:2, result:{ target:function(player,target){ var att=ai.get.attitude(player,target); if(att>=0) return 0; - return ai.get.damageEffect(target,player,target); + return ai.get.damageEffect(target,player,target,'thunder'); } }, expose:0.2 diff --git a/character/yijiang.js b/character/yijiang.js index 1d93b1b68..251e5703e 100644 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -3194,9 +3194,7 @@ character.yijiang={ huomo_sha:{ enable:'phaseUse', discard:false, - prepare:function(cards,player){ - player.$throw(cards); - }, + prepare:'throw', filter:function(event,player){ if(!player.storage.huomo) player.storage.huomo={}; if(player.storage.huomo.sha) return false; @@ -3242,9 +3240,7 @@ character.yijiang={ huomo_tao:{ enable:'chooseToUse', discard:false, - prepare:function(cards,player){ - player.$throw(cards); - }, + prepare:'throw', filter:function(event,player){ if(!player.storage.huomo) player.storage.huomo={}; if(player.storage.huomo.tao) return false; @@ -3308,9 +3304,7 @@ character.yijiang={ huomo_jiu:{ enable:'chooseToUse', discard:false, - prepare:function(cards,player){ - player.$throw(cards); - }, + prepare:'throw', filter:function(event,player){ if(!lib.filter.filterCard({name:'jiu'},player,event)){ return false; @@ -5248,10 +5242,7 @@ character.yijiang={ multitarget:true, discard:false, targetprompt:['得到牌','出杀目标'], - prepare:function(cards,player,targets){ - player.$give(cards,targets[0]); - player.line2(targets); - }, + prepare:'give', filterTarget:function(card,player,target){ if(ui.selected.targets.length==0){ return player!=target; @@ -6535,9 +6526,7 @@ character.yijiang={ enable:'phaseUse', usable:1, discard:false, - prepare:function(cards,player,targets){ - player.$give(1,targets[0]); - }, + prepare:'give2', filterCard:function(card){ return get.suit(card)=='heart'; }, diff --git a/character/yxs.js b/character/yxs.js index 04a76f982..22a274147 100644 --- a/character/yxs.js +++ b/character/yxs.js @@ -58,9 +58,7 @@ character.yxs={ } return false; }, - prepare:function(cards,player,targets){ - player.$throw(cards); - }, + prepare:'throw', content:function(){ player.useCard({name:'tao'},cards,targets[0]).animate=false; }, @@ -2552,9 +2550,6 @@ character.yxs={ }, discard:false, lose:false, - prepare:function(cards,player,targets){ - player.line(targets,'green'); - }, content:function(){ 'step 0' player.choosePlayerCard(target,'e',true).ai=ai.get.buttonValue; diff --git a/game/game.js b/game/game.js index 9a40b3327..50584c81a 100644 --- a/game/game.js +++ b/game/game.js @@ -6349,11 +6349,6 @@ } } "step 1" - if(event.rangecards){ - for(var i=0;i0; }, - prepare:function(cards,player,targets){ - player.$throw(cards); - player.line(targets); - }, + prepare:'throw', discard:false, filterCard:true, check:function(card){ @@ -937,10 +934,7 @@ mode.boss={ return 6-ai.get.value(card); }, discard:false, - prepare:function(cards,player,targets){ - player.$give(cards,targets[0]); - player.line(targets[0],'green'); - }, + prepare:'give', content:function(){ "step 0" game.delay(); diff --git a/mode/chess.js b/mode/chess.js index 01eed4912..b0b3bf10f 100644 --- a/mode/chess.js +++ b/mode/chess.js @@ -4601,10 +4601,7 @@ mode.chess={ }, selectTarget:[1,Infinity], discard:false, - prepare:function(cards,player,targets){ - player.$throw(cards); - player.line(targets); - }, + prepare:'throw', filterTarget:function(card,player,target){ return lib.filter.targetEnabled({name:'sha'},player,target)&& get.distance(player,target,'pure')<=5;