diff --git a/card/extra.js b/card/extra.js index aec3ca9f2..751f77aef 100644 --- a/card/extra.js +++ b/card/extra.js @@ -55,7 +55,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ basic:{ useful:function(card,i){ if(_status.event.player.hp>1){ - if(i==0) return 5; + if(i==0) return 4; return 1; } if(i==0) return 7.3; diff --git a/card/standard.js b/card/standard.js index 449be6320..c538fc92a 100644 --- a/card/standard.js +++ b/card/standard.js @@ -815,7 +815,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ ai:{ basic:{ order:7.2, - useful:4, + useful:4.5, value:9.2 }, result:{ diff --git a/character/shenhua.js b/character/shenhua.js index 4e26bbe4e..6423ad620 100644 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -146,114 +146,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){ direct:true, audio:'jiewei', filter:function(event,player){ - return !player.isTurnedOver(); + return !player.isTurnedOver()&&player.canMoveCard(); }, content:function(){ "step 0" - player.chooseCardTarget({ - ai1:function(card){ - return 7-get.useful(card); - }, - ai2:function(target){ - var player=_status.event.player; - if(ui.selected.targets.length==0){ - if(target.countCards('j')&&get.attitude(player,target)>0) return 10; - if(get.attitude(player,target)<0){ - var players=game.filterPlayer(); - for(var i=0;i0){ - if((target.getEquip(1)&&!players[i].getEquip(1))|| - (target.getEquip(2)&&!players[i].getEquip(2))|| - (target.getEquip(3)&&!players[i].getEquip(3))|| - (target.getEquip(4)&&!players[i].getEquip(4))|| - (target.getEquip(5)&&!players[i].getEquip(5))) return -get.attitude(player,target); - } - } - } - return 0; - } - return -get.attitude(player,target)*get.attitude(player,ui.selected.targets[0]); - }, - multitarget:true, - filterTarget:function(card,player,target){ - if(ui.selected.targets.length){ - var from=ui.selected.targets[0]; - var judges=from.getCards('j'); - for(var i=0;i0; - } - }, - selectTarget:2, - filterCard:lib.filter.cardDiscardable, - prompt:get.prompt('jiewei'), - prompt2:'弃置一张牌,然后移动场上的一张牌', - position:'he', - targetprompt:['被移走','移动目标'], - target:target - }); - "step 1" - if(!result.bool){ - event.finish(); - return; - } - player.discard(result.cards); - player.logSkill('jiewei',result.targets,false); - player.line2(result.targets); - event.targets=result.targets; - "step 2" - game.delay(); - "step 3" - if(targets.length==2){ - player.choosePlayerCard('ej',true,function(button){ - var player=_status.event.player; - var targets0=_status.event.targets0; - var targets1=_status.event.targets1; - if(get.attitude(player,targets0)>get.attitude(player,targets1)){ - return get.position(button.link)=='j'?10:0; - } - else{ - if(get.position(button.link)=='j') return -10; - return get.equipValue(button.link); - } - },targets[0]).set('targets0',targets[0]).set('targets1',targets[1]).set('filterButton',function(button){ - var targets1=_status.event.targets1; - if(get.position(button.link)=='j'){ - return !targets1.hasJudge(button.link.viewAs||button.link.name); - } - else{ - return !targets1.countCards('e',{subtype:get.subtype(button.link)}); - } - }); - } - else{ - event.finish(); - } - "step 4" - if(result.bool&&result.links.length){ - var link=result.links[0]; - if(get.position(link)=='e'){ - event.targets[1].equip(link); - } - else if(link.viewAs){ - event.targets[1].addJudge({name:link.viewAs},[link]); - } - else{ - event.targets[1].addJudge(link); - } - event.targets[0].$give(link,event.targets[1]) - game.delay(); - } + player.chooseToDiscard('he',get.prompt('xinjiewei'),'弃置一张牌并移动场上的一张牌',lib.filter.cardDiscardable).set('ai',function(card){ + if(!_status.event.check) return 0; + return 7-get.value(card); + }).set('check',player.canMoveCard(true)).set('logSkill','xinjiewei'); + "step 1" + if(result.bool){ + player.moveCard(true); + } + else{ + event.finish(); + } } } } @@ -951,7 +858,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.finish(); } else{ - var next=player.chooseToDiscard('是否发动巧变跳过判定阶段?'); + var next=player.chooseToDiscard(get.prompt('qiaobian'),'弃置一张手牌并跳过判定阶段'); next.set('ai',get.unuseful2); next.set('logSkill','qiaobian'); } @@ -985,41 +892,35 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } check=(num>=2&&num2>0); - player.chooseCardTarget({ - ai1:function(card){ - var evt=_status.event; - if(!evt.check) return 0; - return 6-get.useful(card); - }, - ai2:function(target){ - var evt=_status.event; - if(!evt.check) return 0; - return 1-get.attitude(evt.player,target); - }, - filterTarget:function(card,player,target){ - return target.countCards('h')>0; - }, - selectTarget:[0,2], - filterCard:lib.filter.cardDiscardable, - prompt:'是否发动巧变跳过摸牌阶段?', - check:check, - target:target - }); - "step 1" + player.chooseToDiscard(get.prompt('qiaobian'),'弃置一张手牌并跳过摸牌阶段,然后可以获得至多两名角色各一张手牌',lib.filter.cardDiscardable).set('ai',function(card){ + if(!_status.event.check) return 0; + return 7-get.value(card); + }).set('check',check).set('logSkill','qiaobian'); + "step 1" + if(result.bool){ + trigger.finish(); + trigger.untrigger(); + player.chooseTarget([1,2],'获得至多两名角色各一张手牌',function(card,player,target){ + return target!=player&&target.countCards('h'); + }).set('ai',function(target){ + return 1-get.attitude(_status.event.player,target); + }) + } + else{ + event.finish(); + } + "step 2" if(result.bool){ - player.logSkill('qiaobian',result.targets); - player.discard(result.cards); + player.line(result.targets,'green'); event.targets=result.targets; if(!event.targets.length) event.finish(); } else{ event.finish(); } - "step 2" - player.gainMultiple(event.targets); - trigger.finish(); - trigger.untrigger(); "step 3" + player.gainMultiple(event.targets); + "step 4" game.delay(); }, ai:{ @@ -1035,128 +936,39 @@ game.import('character',function(lib,game,ui,get,ai,_status){ direct:true, content:function(){ "step 0" - var check=game.hasPlayer(function(current){ - return get.attitude(player,current)>0&¤t.countCards('j'); - }); - if(!check){ - if(player.countCards('h')>player.hp+1){ - check=false; - } - else if(player.countCards('h',{name:['wuzhong']})){ - check=false; - } - else{ - check=true; - } - } - player.chooseCardTarget({ - ai1:function(card){ - if(!_status.event.check) return 0; - return 7-get.useful(card); - }, - ai2:function(target){ - if(!_status.event.check) return 0; - var player=_status.event.player; - if(ui.selected.targets.length==0){ - if(target.countCards('j')&&get.attitude(player,target)>0) return 10; - if(get.attitude(player,target)<0){ - var players=game.filterPlayer(); - for(var i=0;i0){ - if((target.getEquip(1)&&!players[i].getEquip(1))|| - (target.getEquip(2)&&!players[i].getEquip(2))|| - (target.getEquip(3)&&!players[i].getEquip(3))|| - (target.getEquip(4)&&!players[i].getEquip(4))|| - (target.getEquip(5)&&!players[i].getEquip(5))) return -get.attitude(player,target); - } - } - } - return 0; - } - return -get.attitude(player,target)*get.attitude(player,ui.selected.targets[0]); - }, - multitarget:true, - filterTarget:function(card,player,target){ - if(ui.selected.targets.length){ - var from=ui.selected.targets[0]; - var judges=from.getCards('j'); - for(var i=0;i0; - } - }, - selectTarget:2, - filterCard:lib.filter.cardDiscardable, - prompt:'是否发动巧变跳过出牌阶段?', - targetprompt:['被移走','移动目标'], - check:check, - target:target - }); - "step 1" - if(!result.bool){ - event.finish(); - return; - } - trigger.untrigger(); - trigger.finish(); - player.discard(result.cards); - player.logSkill('qiaobian',result.targets,false); - player.line2(result.targets); - event.targets=result.targets; - if(!event.targets.length) event.finish(); - "step 2" - game.delay(); - "step 3" - if(targets.length==2){ - player.choosePlayerCard('ej',function(button){ - var player=_status.event.player; - var targets0=_status.event.targets0; - var targets1=_status.event.targets1; - if(get.attitude(player,targets0)>get.attitude(player,targets1)){ - return get.position(button.link)=='j'?10:0; - } - else{ - if(get.position(button.link)=='j') return -10; - return get.equipValue(button.link); - } - },targets[0]).set('targets0',targets[0]).set('targets1',targets[1]).set('filterButton',function(button){ - var targets1=_status.event.targets1; - if(get.position(button.link)=='j'){ - return !targets1.hasJudge(button.link.viewAs||button.link.name); - } - else{ - return !targets1.countCards('e',{subtype:get.subtype(button.link)}); - } - }); - } - else{ - event.finish(); - } - "step 4" - if(result.bool&&result.links.length){ - var link=result.links[0]; - if(get.position(link)=='e'){ - event.targets[1].equip(link); - } - else if(link.viewAs){ - event.targets[1].addJudge({name:link.viewAs},[link]); - } - else{ - event.targets[1].addJudge(link); - } - event.targets[0].$give(link,event.targets[1]) - game.delay(); - } + var check; + if(!player.canMoveCard(true)){ + check=false; + } + else{ + check=game.hasPlayer(function(current){ + return get.attitude(player,current)>0&¤t.countCards('j'); + }); + if(!check){ + if(player.countCards('h')>player.hp+1){ + check=false; + } + else if(player.countCards('h',{name:['wuzhong']})){ + check=false; + } + else{ + check=true; + } + } + } + player.chooseToDiscard(get.prompt('qiaobian'),'弃置一张手牌并跳过出牌阶段,然后可以移动场上的一张牌',lib.filter.cardDiscardable).set('ai',function(card){ + if(!_status.event.check) return 0; + return 7-get.value(card); + }).set('check',check).set('logSkill','qiaobian'); + "step 1" + if(result.bool){ + trigger.untrigger(); + trigger.finish(); + player.moveCard(); + } + else{ + event.finish(); + } }, ai:{ expose:0.2 @@ -1172,7 +984,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ "step 0" var discard=player.countCards('h')>player.hp; - var next=player.chooseToDiscard('是否发动巧变跳过弃牌阶段?'); + var next=player.chooseToDiscard(get.prompt('qiaobian'),'弃置一张手牌并跳过弃牌阶段'); next.logSkill='qiaobian'; next.ai=function(card){ if(discard){ diff --git a/character/xianjian.js b/character/xianjian.js index 55e222317..7f488c778 100644 --- a/character/xianjian.js +++ b/character/xianjian.js @@ -927,6 +927,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ liguang:{ trigger:{player:'phaseEnd'}, filter:function(event,player){ + if(!player.canMoveCard()) return false; if(!game.hasPlayer(function(current){ return current.countCards('ej'); })){ @@ -936,110 +937,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, direct:true, content:function(){ - "step 0" - player.chooseCardTarget({ - ai1:function(card){ - return 7-get.useful(card); - }, - ai2:function(target){ - var player=_status.event.player; - if(ui.selected.targets.length==0){ - if(target.countCards('j')&&get.attitude(player,target)>0) return 10; - if(get.attitude(player,target)<0){ - var players=game.filterPlayer(); - for(var i=0;i0){ - if((target.getEquip(1)&&!players[i].getEquip(1))|| - (target.getEquip(2)&&!players[i].getEquip(2))|| - (target.getEquip(3)&&!players[i].getEquip(3))|| - (target.getEquip(4)&&!players[i].getEquip(4))|| - (target.getEquip(5)&&!players[i].getEquip(5))) return -get.attitude(player,target); - } - } - } - return 0; - } - return -get.attitude(player,target)*get.attitude(player,ui.selected.targets[0]); - }, - multitarget:true, - filterTarget:function(card,player,target){ - if(ui.selected.targets.length){ - var from=ui.selected.targets[0]; - var judges=from.getCards('j'); - for(var i=0;i0; - } - }, - selectTarget:2, - filterCard:lib.filter.cardDiscardable, - prompt:get.prompt('liguang'), - prompt2:'弃置一张手牌,然后移动场上的一张牌', - targetprompt:['被移走','移动目标'], - target:target - }); - "step 1" - if(!result.bool){ - event.finish(); - return; - } - player.discard(result.cards); - player.logSkill('liguang',result.targets,false); - player.line2(result.targets); - event.targets=result.targets; - "step 2" - game.delay(); - "step 3" - if(targets.length==2){ - player.choosePlayerCard('ej',true,function(button){ - var player=_status.event.player; - var targets0=_status.event.targets0; - var targets1=_status.event.targets1; - if(get.attitude(player,targets0)>get.attitude(player,targets1)){ - return get.position(button.link)=='j'?10:0; - } - else{ - if(get.position(button.link)=='j') return -10; - return get.equipValue(button.link); - } - },targets[0]).set('targets0',targets[0]).set('targets1',targets[1]).set('filterButton',function(button){ - var targets1=_status.event.targets1; - if(get.position(button.link)=='j'){ - return !targets1.hasJudge(button.link.viewAs||button.link.name); - } - else{ - return !targets1.countCards('e',{subtype:get.subtype(button.link)}); - } - }); - } - else{ - event.finish(); - } - "step 4" - if(result.bool&&result.links.length){ - var link=result.links[0]; - if(get.position(link)=='e'){ - event.targets[1].equip(link); - } - else if(link.viewAs){ - event.targets[1].addJudge({name:link.viewAs},[link]); - } - else{ - event.targets[1].addJudge(link); - } - event.targets[0].$give(link,event.targets[1]) - game.delay(); - } + "step 0" + player.chooseToDiscard(get.prompt('liguang'),'弃置一张手牌并移动场上的一张牌',lib.filter.cardDiscardable).set('ai',function(card){ + if(!_status.event.check) return 0; + return 7-get.useful(card); + }).set('check',player.canMoveCard(true)).set('logSkill','liguang'); + "step 1" + if(result.bool){ + player.moveCard(true); + } + else{ + event.finish(); + } }, ai:{ expose:0.2, diff --git a/game/game.js b/game/game.js index cd3a3aaea..f8091fb8b 100644 --- a/game/game.js +++ b/game/game.js @@ -11044,6 +11044,110 @@ event.choosing=false; if(event.dialog) event.dialog.close(); }, + moveCard:function(){ + 'step 0' + if(!player.canMoveCard()){ + event.finish(); + return; + } + var next=player.chooseTarget(2,function(card,player,target){ + if(ui.selected.targets.length){ + var from=ui.selected.targets[0]; + var js=from.getCards('j'); + for(var i=0;i0; + } + }); + next.set('ai',function(target){ + var player=_status.event.player; + var att=get.attitude(player,target); + if(ui.selected.targets.length==0){ + if(att>0){ + if(target.countCards('j')) return 10; + } + else if(att<0){ + if(game.hasPlayer(function(current){ + if(get.attitude(player,current)>0){ + var es=target.getCards('e'); + for(var i=0;iget.attitude(player,targets1)){ + return get.position(button.link)=='j'?10:0; + } + else{ + if(get.position(button.link)=='j') return -10; + return get.equipValue(button.link); + } + },targets[0]).set('targets0',targets[0]).set('targets1',targets[1]).set('filterButton',function(button){ + var targets1=_status.event.targets1; + if(get.position(button.link)=='j'){ + return !targets1.hasJudge(button.link); + } + else{ + return !targets1.countCards('e',{subtype:get.subtype(button.link)}); + } + }); + } + else{ + event.finish(); + } + 'step 4' + if(result.bool&&result.links.length){ + var link=result.links[0]; + if(get.position(link)=='e'){ + event.targets[1].equip(link); + } + else if(link.viewAs){ + event.targets[1].addJudge({name:link.viewAs},[link]); + } + else{ + event.targets[1].addJudge(link); + } + event.targets[0].$give(link,event.targets[1]) + game.delay(); + } + }, useCard:function(){ "step 0" if(!card){ @@ -14630,6 +14734,68 @@ viewHandcards:function(target){ return this.viewCards(get.translation(target)+'的手牌',target.getCards('h')); }, + canMoveCard:function(withatt){ + var player=this; + return game.hasPlayer(function(current){ + var att=get.attitude(player,current); + if(!withatt||att<=0){ + var es=current.getCards('e'); + for(var i=0;i0){ + var js=current.getCards('j'); + for(var i=0;i0) return false; + } + return current!=current2&&!current2.hasJudge(js[i]); + })){ + return true; + } + } + } + }); + }, + moveCard:function(){ + var next=game.createEvent('moveCard'); + next.player=this; + for(var i=0;i