給粉絲設(shè)計(jì)的技能1,將代碼中的技能名三個字改成你自己起的技能名即可
skill={
? ? enable:"phaseUse",
? ? filterCard:function(card,player){
? ? ? ??
? ? ? ? if(ui.selected.cards.length){
? ? ? ? ? ? return get.suit(card)==get.suit(ui.selected.cards[0]);
? ? ? ? }
? ? ? ? var cards=player.getCards('hs');
? ? ? ? for(var i=0;i<cards.length;i++){
? ? ? ? ? ? if(card!=cards[i]){
? ? ? ? ? ? ? ? if(get.suit(card)==get.suit(cards[i])) return true;
? ? ? ? ? ? }
? ? ? ? }? ? ? ?
? ? ? ? return false;
? ? },
? ? selectCard:2,
? ? position:"hs",
? ? viewAs:{
? ? ? ? name:"sha",
? ? },
? ? selectTarget:[1,Infinity],
? ? filterTarget:function(card,player,target){
? ? ? ? return lib.filter.targetEnabled({name:'sha'},player,target);
? ? },
? ? complexCard:true,
? ? audio:"ext:江湖往事:true",
? ? prompt:"將兩張手牌當(dāng)殺使用或打出",
? ? check:function(card){
? ? ? ? if(card.name=='sha') return 0;
? ? ? ? return 5-get.value(card)
? ? },
? ? ai:{
? ? ? ? respondSha:true,
? ? ? ? skillTagFilter:function(player){
? ? ? ? ? ? return player.countCards('hs')>=2;
? ? ? ? },
? ? ? ? yingbian:function(card,player,targets,viewer){
? ? ? ? ? ? if(get.attitude(viewer,player)<=0) return 0;
? ? ? ? ? ? var base=0,hit=false;
? ? ? ? ? ? if(get.cardtag(card,'yingbian_hit')){
? ? ? ? ? ? ? ? hit=true;
? ? ? ? ? ? ? ? if(targets.filter(function(target){
? ? ? ? ? ? ? ? ? ? return target.hasShan()&&get.attitude(viewer,target)<0&&get.damageEffect(target,player,viewer,get.nature(card))>0;
? ? ? ? ? ? ? ? })) base+=5;
? ? ? ? ? ? }
? ? ? ? ? ? if(get.cardtag(card,'yingbian_all')){
? ? ? ? ? ? ? ? if(game.hasPlayer(function(current){
? ? ? ? ? ? ? ? ? ? return !targets.contains(current)&&lib.filter.targetEnabled2(card,player,current)&&get.effect(current,card,player,player)>0;
? ? ? ? ? ? ? ? })) base+=5;
? ? ? ? ? ? }
? ? ? ? ? ? if(get.cardtag(card,'yingbian_damage')){
? ? ? ? ? ? ? ? if(targets.filter(function(target){
? ? ? ? ? ? ? ? ? ? return get.attitude(player,target)<0&&(hit||!target.mayHaveShan()||player.hasSkillTag('directHit_ai',true,{
? ? ? ? ? ? ? ? ? ? target:target,
? ? ? ? ? ? ? ? ? ? card:card,
? ? ? ? ? ? ? ? ? ? },true))&&!target.hasSkillTag('filterDamage',null,{
? ? ? ? ? ? ? ? ? ? ? ? player:player,
? ? ? ? ? ? ? ? ? ? ? ? card:card,
? ? ? ? ? ? ? ? ? ? ? ? jiu:true,
? ? ? ? ? ? ? ? ? ? })
? ? ? ? ? ? ? ? })) base+=5;
? ? ? ? ? ? }
? ? ? ? ? ? return base;
? ? ? ? },
? ? ? ? canLink:function(player,target,card){
? ? ? ? ? ? if(!target.isLinked()&&!player.hasSkill('wutiesuolian_skill')) return false;
? ? ? ? ? ? if(target.mayHaveShan()&&!player.hasSkillTag('directHit_ai',true,{
? ? ? ? ? ? ? ? target:target,
? ? ? ? ? ? ? ? card:card,
? ? ? ? ? ? },true)) return false;
? ? ? ? ? ? if(player.hasSkill('jueqing')||player.hasSkill('gangzhi')||target.hasSkill('gangzhi')) return false;
? ? ? ? ? ? return true;
? ? ? ? },
? ? ? ? basic:{
? ? ? ? ? ? useful:[5,3,1],
? ? ? ? ? ? value:[5,3,1],
? ? ? ? },
? ? ? ? order:function(item,player){
? ? ? ? ? ? if(player.hasSkillTag('presha',true,null,true)) return 10;
? ? ? ? ? ? if(lib.linked.contains(get.nature(item))){
? ? ? ? ? ? ? ? if(game.hasPlayer(function(current){
? ? ? ? ? ? ? ? ? ? return current!=player&¤t.isLinked()&&player.canUse(item,current,null,true)&&get.effect(current,item,player,player)>0&&lib.card.sha.ai.canLink(player,current,item);
? ? ? ? ? ? ? ? })&&game.countPlayer(function(current){
? ? ? ? ? ? ? ? ? ? return current.isLinked()&&get.damageEffect(current,player,player,get.nature(item))>0;
? ? ? ? ? ? ? ? })>1) return 3.1;
? ? ? ? ? ? ? ? return 3;
? ? ? ? ? ? }
? ? ? ? ? ? return 3.05;
? ? ? ? },
? ? ? ? result:{
? ? ? ? ? ? target:function(player,target,card,isLink){
? ? ? ? ? ? ? ? var eff=function(){
? ? ? ? ? ? ? ? ? ? if(!isLink&&player.hasSkill('jiu')){
? ? ? ? ? ? ? ? ? ? ? ? if(!target.hasSkillTag('filterDamage',null,{
? ? ? ? ? ? ? ? ? ? ? ? ? ? player:player,
? ? ? ? ? ? ? ? ? ? ? ? ? ? card:card,
? ? ? ? ? ? ? ? ? ? ? ? ? ? jiu:true,
? ? ? ? ? ? ? ? ? ? ? ? })){
? ? ? ? ? ? ? ? ? ? ? ? ? ? if(get.attitude(player,target)>0){
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return -7;
? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? ? ? else{
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return -4;
? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ? return -0.5;
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? return -1.5;
? ? ? ? ? ? ? ? }();
? ? ? ? ? ? ? ? if(!isLink&&target.mayHaveShan()&&!player.hasSkillTag('directHit_ai',true,{
? ? ? ? ? ? ? ? ? ? target:target,
? ? ? ? ? ? ? ? ? ? card:card,
? ? ? ? ? ? ? ? },true)) return eff/1.2;
? ? ? ? ? ? ? ? return eff;
? ? ? ? ? ? },
? ? ? ? },
? ? ? ? tag:{
? ? ? ? ? ? respond:1,
? ? ? ? ? ? respondShan:1,
? ? ? ? ? ? damage:function(card){
? ? ? ? ? ? ? ? if(card.nature=='poison') return;
? ? ? ? ? ? ? ? return 1;
? ? ? ? ? ? },
? ? ? ? ? ? natureDamage:function(card){
? ? ? ? ? ? ? ? if(card.nature) return 1;
? ? ? ? ? ? },
? ? ? ? ? ? fireDamage:function(card,nature){
? ? ? ? ? ? ? ? if(card.nature=='fire') return 1;
? ? ? ? ? ? },
? ? ? ? ? ? thunderDamage:function(card,nature){
? ? ? ? ? ? ? ? if(card.nature=='thunder') return 1;
? ? ? ? ? ? },
? ? ? ? ? ? poisonDamage:function(card,nature){
? ? ? ? ? ? ? ? if(card.nature=='poison') return 1;
? ? ? ? ? ? },
? ? ? ? },
? ? },
? ? group:["技能名_1"],
? ? subSkill:{
? ? ? ? "1":{
? ? ? ? ? ? popup:false,
? ? ? ? ? ? silent:true,
? ? ? ? ? ? firstDo:true,
? ? ? ? ? ? trigger:{
? ? ? ? ? ? ? ? player:"useCard1",
? ? ? ? ? ? },
? ? ? ? ? ? filter:function(event,player){
? ? ? ? return event.card&&event.card.name=='sha'&&event.addCount!==false&&event.cards&&
? ? ? ? ? ? event.cards.length==2;
? ? },
? ? ? ? ? ? forced:true,
? ? ? ? ? ? content:function(){
? ? ? ? trigger.addCount=false;
? ? ? ? if(player.stat[player.stat.length-1].card.sha>0){
? ? ? ? ? ? player.stat[player.stat.length-1].card.sha--;
? ? ? ? }
? ? },
? ? ? ? ? ? sub:true,
? ? ? ? },
? ? },
}