diff --git a/card/sp.js b/card/sp.js index 822c839ec..a5f57f052 100644 --- a/card/sp.js +++ b/card/sp.js @@ -654,10 +654,16 @@ game.import('card',function(lib,game,ui,get,ai,_status){ content:function(){ "step 0" for(var i=0;i0; }, content:function(){ + 'step 0' var card=target.getCards('h').randomGet(); var hu=player.getEquip('lianyaohu'); if(card&&hu){ @@ -2965,7 +2966,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){ } target.$give(card,player); target.lose(card,ui.special); - hu.storage.shouna.push(card); + event.card=card; + event.hu=hu; + } + 'step 1' + if(!event.card.destroyed){ + event.hu.storage.shouna.push(event.card); player.updateMarks(); } }, diff --git a/character/mtg.js b/character/mtg.js index 48cf38d47..6b1283f3e 100644 --- a/character/mtg.js +++ b/character/mtg.js @@ -19,19 +19,217 @@ game.import('character',function(lib,game,ui,get,ai,_status){ mtg_ayeni:'金鬃阿耶尼是使用白色法术的鹏洛客。他长于净化身体与心灵的法术:用咒语来治疗、强化盟友,以及唤醒他人内在的心灵精华。', }, skill:{ + mhuanyi:{ + round:2, + trigger:{player:'phaseEnd'}, + direct:true, + addintro:function(storage,player){ + if(player.hasSkill('mhuanyi_target')){ + return '直到下一回合开始,当成为某类型的卡牌的惟一目标时,将目标转移给某名其他角色;' + } + return ''; + }, + content:function(){ + 'step 0' + var rand=Math.random(); + player.chooseTarget(get.prompt2('mhuanyi'),function(card,player,target){ + return target!=player; + }).set('ai',function(target){ + if(get.attitude(player,target)<0){ + return rand; + } + return 0; + }); + 'step 1' + if(result.bool){ + event.target=result.targets[0]; + if(player.isUnderControl(true)){ + player.line(event.target,'green'); + } + player.chooseControl('基本牌','非基本牌','cancel2',function(){ + return Math.floor(Math.random()*2); + }).set('prompt','选择一种卡牌类型'); + } + else{ + event.finish(); + } + 'step 2' + if(result.control&&result.control!='cancel2'){ + player.logSkill('mhuanyi'); + player.storage.mhuanyi_target=[event.target,result.index]; + player.addTempSkill('mhuanyi_target',{player:'phaseBegin'}); + } + }, + subSkill:{ + target:{ + trigger:{target:'useCardToBefore'}, + priority:6, + forced:true, + // mark:true, + // intro:{ + // nocount:true, + // content:'直到下一回合开始,当成为某类型的卡牌的惟一目标时,将目标转移给某名其他角色' + // }, + onremove:true, + filter:function(event,player){ + if(!player.storage.mhuanyi_target) return false; + if(event.player==player.storage.mhuanyi_target[0]) return false; + if(get.type(event.card)=='basic'){ + if(player.storage.mhuanyi_target[1]!=0) return false; + } + else{ + if(player.storage.mhuanyi_target[1]!=1) return false; + } + if(!lib.filter.targetEnabled2(event.card,event.player,player.storage.mhuanyi_target[0])){ + return false; + } + return true; + }, + logTarget:function(event,player){ + return player.storage.mhuanyi_target[0]; + }, + content:function(){ + trigger.target=player.storage.mhuanyi_target[0]; + trigger.untrigger(); + trigger.trigger('useCardToBefore'); + trigger.trigger(trigger.card.name+'Before'); + player.removeSkill('mhuanyi_target'); + } + } + } + }, msuoling:{ - enable:'chooseToUse', - // round:1, - filterCard:function(card){ - return get.type(card,'trick')=='trick'; - }, - viewAsFilter:function(player){ - return player.countCards('h',{type:['trick','delay']})>0; - }, - viewAs:{name:'wuxie',{storage:{nowuxie:true}}}, - prompt:'将一张锦囊牌当无懈可击使用', - check:function(card){return 8-get.value(card)}, - threaten:1.2 + trigger:{global:'useCard'}, + direct:true, + priority:5.5, + round:1, + filter:function(event,player){ + if(get.type(event.card)=='trick'&&event.cards.length==1&&event.cards[0]==event.card){ + if(event.player==player) return false; + if(!player.countCards('he',{suit:get.suit(event.card)})) return false; + return true; + } + return false; + }, + content:function(){ + 'step 0' + var att=get.attitude(player,trigger.player); + var suit=get.suit(trigger.card); + player.chooseToDiscard('he',get.prompt2('msuoling',trigger.player),function(card){ + return get.suit(card)==suit; + }).set('autodelay',true).set('logSkill',['msuoling',trigger.player]).ai=function(card){ + if(att<0){ + return 8-get.value(card); + } + return 0; + }; + 'step 1' + if(result.bool){ + trigger.cancel(); + player.chooseUseTarget(trigger.card); + } + } + }, + msuoling_old:{ + enable:'phaseUse', + usable:1, + subSkill:{ + ai:{ + onremove:true + } + }, + filter:function(event,player){ + var nh=player.countCards('h'); + if(nh<=1||nh>=5) return false; + return lib.skill.msuoling.getc(player).number>0; + }, + getc:function(player){ + var hs=player.getCards('h'); + for(var i=0;i1){ + for(var i=0;i0){ - return get.cnNumber(num)+'轮后技能重置'; + str+=get.cnNumber(num)+'轮后技能重置'; } - return '技能可发动'; + else{ + str+='技能可发动'; + } + return str; }, markcount:function(storage,player){ var num=round-(game.roundNumber-storage); @@ -41323,6 +41335,13 @@ }; var get={ is:{ + freePosition:function(cards){ + for(var i=0;i