From 5871d07dc1a985111c7a4ac845cb425324ecc13b Mon Sep 17 00:00:00 2001 From: libccy Date: Wed, 10 Jan 2018 23:30:39 +0800 Subject: [PATCH] d --- card/yunchou.js | 9 +- character/gwent.js | 891 ++++++++++++++++++++++++++++++++++++++++++++- game/game.js | 10 +- game/update.js | 2 +- 4 files changed, 890 insertions(+), 22 deletions(-) diff --git a/card/yunchou.js b/card/yunchou.js index 3092b1af5..fbf8b349b 100644 --- a/card/yunchou.js +++ b/card/yunchou.js @@ -263,13 +263,20 @@ game.import('card',function(lib,game,ui,get,ai,_status){ geanguanhuo:{ fullskin:true, type:'trick', - enable:true, filterTarget:function(card,player,target){ return target!=player&&target.countCards('h')>0; }, + enable:function(){ + return game.countPlayer()>2; + }, chongzhu:function(){ return game.countPlayer()<=2; }, + multicheck:function(card,player){ + return game.countPlayer(function(current){ + return current!=player&¤t.countCards('h'); + })>1; + }, multitarget:true, multiline:true, singleCard:true, diff --git a/character/gwent.js b/character/gwent.js index a8bc0ad7f..5e0e72c1a 100644 --- a/character/gwent.js +++ b/character/gwent.js @@ -62,7 +62,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ gw_yioufeisisp:['male','wu',3,['gwminxiang']], gw_lanbote:['male','qun',4,['gwlangshi']], gw_fenghuang:['male','wu',3,['gwminxiang']], - gw_diandian:['male','wu',6,['gwmaoxian']], + gw_diandian:['male','wu',3,['gwhuanbi']], gw_yisilinni:['male','wu',3,['gwminxiang']], gw_feilafanruide:['male','wu',3,['gwminxiang']], }, @@ -80,24 +80,53 @@ game.import('character',function(lib,game,ui,get,ai,_status){ gw_yioufeisi:'国王还是乞丐,两者有何区别,人类少一个算一个', }, skill:{ - gwmaoxian:{ - subSkill:{ - card:{ - mark:'card', - intro:{ - content:'card' - } - } - }, + gwhuanbi:{ enable:'phaseUse', usable:1, - direct:true, - delay:0, + filterCard:true, + position:'he', + check:function(card){ + return 8-get.value(card); + }, content:function(){ - + 'step 0' + player.chooseVCardButton(get.typeCard('gwmaoxian').randomGets(3),true,'选择一张冒险牌'); + 'step 1' + if(result.bool){ + event.card=game.createCard(result.links[0][2]); + player.gain(event.card,'gain2'); + } + else{ + event.finish(); + } + 'step 2' + var list=game.filterPlayer(function(current){ + return current!=player&¤t.countCards('h'); + }); + if(list.length){ + event.target=list.randomGet(); + event.target.chooseCard('h','是否交给'+get.translation(event.player)+'一张手牌并获得冒险牌?').set('ai',function(card){ + if(get.attitude(event.target,player)>0){ + return 11-get.value(card); + } + return 7-get.value(card); + }).set('promptx',[event.card]); + } + else{ + event.finish(); + } + 'step 3' + if(result.bool){ + event.target.line(player,'green'); + event.target.give(result.cards,player); + event.target.gain(game.createCard(event.card),'gain2'); + } }, ai:{ - order:1 + order:8, + result:{ + player:1 + } } }, gwmaoxian_old:{ @@ -2911,6 +2940,790 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, card:{ + gwmaoxian_yioufeisi:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_yioufeisisp', + enable:true, + filterTarget:function(card,player,target){ + return target!=player; + }, + selectTarget:2, + multitarget:true, + multiline:true, + content:function(){ + 'step 0' + targets[0].useCard({name:'sha'},targets[1],'noai'); + 'step 1' + if(targets[0].isIn()&&targets[1].isIn()){ + targets[1].useCard({name:'sha'},targets[0],'noai'); + } + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + target:function(player,target){ + return -get.effect(target,{name:'sha'},target,target); + } + } + } + }, + gwmaoxian_luoqi:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_luoqi', + enable:true, + filterTarget:function(card,player,target){ + return player.canUse('sha',target,false); + }, + content:function(){ + 'step 0' + player.useCard({name:'sha'},target,false).animate=false; + 'step 1' + event.targets=game.filterPlayer(function(current){ + return current.canUse('sha',target,false)&¤t!=player; + }); + event.targets.sortBySeat(); + 'step 2' + if(event.targets.length){ + event.current=event.targets.shift(); + if(event.current.hasSha()){ + event.current.chooseToUse({name:'sha'},'是否对'+get.translation(target)+'使用一张杀?',target,-1); + } + event.redo(); + } + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + target:function(player,target){ + return -get.effect(target,{name:'sha'},player,target); + } + } + } + }, + gwmaoxian_jieluote:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_jieluote', + enable:true, + filterTarget:true, + content:function(){ + if(target.isMaxHp()&&target.hp>2){ + target.damage(2); + } + else{ + target.damage(); + } + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + tag:{ + damage:1 + }, + result:{ + player:function(player,target){ + var eff=get.damageEffect(target,player,player); + if(eff>0){ + eff=Math.sqrt(eff); + if(target.isMaxHp()&&target.hp>2){ + switch(target.hp){ + case 3:return eff*2; + case 4:return eff*1.5; + default:return eff*1.1; + } + } + else{ + switch(target.hp){ + case 1:return eff*1.6; + case 2:return eff*1.1; + default:return eff; + } + } + } + return 0; + } + } + } + }, + gwmaoxian_yenaifa:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_yenaifa', + enable:true, + notarget:true, + content:function(){ + 'step 0' + event.targets=player.getEnemies().randomGets(3).sortBySeat(); + 'step 1' + if(event.targets.length){ + player.line(event.targets.shift().getDebuff(false).addExpose(0.1)); + event.redo(); + } + 'step 2' + game.delay(); + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + player:1 + } + } + }, + gwmaoxian_telisi:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_telisi', + enable:true, + notarget:true, + content:function(){ + 'step 0' + event.targets=player.getFriends().randomGets(3); + event.targets.add(player); + event.targets.sortBySeat(); + 'step 1' + if(event.targets.length){ + player.line(event.targets.shift().getBuff(false).addExpose(0.1)); + event.redo(); + } + 'step 2' + game.delay(); + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + player:1 + } + } + }, + gwmaoxian_hengsaite:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_hengsaite', + enable:true, + filterTarget:function(card,player,target){ + return target!=player; + }, + content:function(){ + var list=[]; + for(var i=0;i<3;i++){ + list.push(game.createCard('sha')); + } + target.gain(list,'gain2'); + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + target:function(player,target){ + return 1/Math.sqrt(target.countCards('h')+1); + } + } + } + }, + gwmaoxian_fuertaisite:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_fuertaisite', + enable:true, + filterTarget:true, + selectTarget:[1,2], + content:function(){ + target.changeHujia(); + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + target:function(player,target){ + var num=1/Math.sqrt(target.hp+1); + if(target.hasSkillTag('maixie_hp')){ + num*=0.7; + } + if(target.hp==1){ + num*=1.5; + } + return num; + } + } + } + }, + gwmaoxian_laduoweide:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_laduoweide', + enable:true, + filterTarget:true, + content:function(){ + target.addTempSkill('fengyin',{player:'phaseAfter'}); + target.damage(); + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + target:function(player,target){ + var num=1/Math.sqrt(target.hp+1); + if(target.hasSkillTag('maixie_hp')){ + num*=1.5; + } + return -num; + } + } + } + }, + gwmaoxian_enxier:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_enxier', + enable:true, + filterTarget:function(card,player,target){ + return Math.abs(target.countCards('h')-player.countCards('h'))<=1; + }, + content:function(){ + player.swapHandcards(target); + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + target:function(player,target){ + var dh=target.countCards('h')-player.countCards('h'); + if(dh>0) return -1; + if(dh==0&&player.needsToDiscard()) return -0.5; + return 0; + } + } + } + }, + gwmaoxian_fulisi:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_fulisi', + enable:true, + filterTarget:function(card,player,target){ + return target!=player&&target.countCards('h'); + }, + selectTarget:[1,3], + content:function(){ + 'step 0' + if(player.countCards('h')){ + player.chooseCardButton(get.translation(target)+'的手牌(可用一张手牌替换)',target.getCards('h')).ai=function(button){ + return get.value(button.link)-5; + } + } + else{ + player.viewHandcards(target); + event.finish(); + } + 'step 1' + if(result.bool){ + event.card=result.links[[0]]; + player.chooseCard('h',true,'用一张手牌替换'+get.translation(event.card)).ai=function(card){ + return -get.value(card); + }; + } + else{ + event.finish(); + } + 'step 2' + if(result.bool){ + player.gain(event.card,target); + target.gain(result.cards,player); + player.$giveAuto(result.cards,target); + target.$giveAuto(event.card,player); + game.log(player,'与',target,'交换了一张手牌'); + } + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + target:-1 + } + } + }, + gwmaoxian_kaerweite:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_kaerweite', + enable:true, + filterTarget:function(card,player,target){ + return target!=player&&target.countCards('h'); + }, + selectTarget:[1,2], + multitarget:true, + multiline:true, + content:function(){ + player.gainMultiple(targets); + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + target:function(player,target){ + if(target.hasSkillTag('nolose')||target.hasSkillTag('noh')){ + return 0; + } + return -1/Math.sqrt(1+target.countCards('h')); + } + } + } + }, + gwmaoxian_bulanwang:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_bulanwang', + enable:true, + notarget:true, + content:function(){ + 'step 0' + player.chooseToDiscard('he',[1,3],'弃置至多3张牌并摸弃牌数2倍的牌').set('ai',function(card){ + return 9-get.value(card); + }); + 'step 1' + if(result.bool){ + player.draw(2*result.cards.length); + } + player.skip('phaseDiscard'); + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + player:function(player,target){ + if(player.hasCard('he',function(card){ + return get.value(card)<9; + })){ + return 1; + } + return 0; + } + } + } + }, + gwmaoxian_kuite:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_kuite', + enable:true, + filterTarget:function(card,player,target){ + return target.countCards('h')>=player.countCards('h')&&player.canUse('juedou',target); + }, + content:function(){ + 'step 0' + player.useCard({name:'juedou'},target).animate=false; + 'step 1' + if(player.isIn()&&target.isIn()){ + player.useCard({name:'juedou'},target); + } + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + target:function(player,target){ + return get.effect(target,{name:'juedou'},player,target); + } + } + } + }, + gwmaoxian_haluo:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_haluo', + enable:true, + filterTarget:function(card,player,target){ + return target.isMinHp(); + }, + selectTarget:-1, + content:function(){ + target.damage(); + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + target:-1.5 + }, + tag:{ + damage:1 + } + } + }, + gwmaoxian_dagong:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_dagong', + enable:true, + content:function(){ + target.addSkill('gw_ciguhanshuang'); + target.addSkill('gw_birinongwu'); + target.addSkill('gw_qinpendayu'); + }, + filterTarget:function(card,player,target){ + return !target.hasSkill('gw_ciguhanshuang')|| + !target.hasSkill('gw_qinpendayu')|| + !target.hasSkill('gw_birinongwu'); + }, + changeTarget:function(player,targets){ + game.filterPlayer(function(current){ + return get.distance(targets[0],current,'pure')==1; + },targets); + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + target:function(player,target){ + return get.effect(target,{name:'gw_ciguhanshuang'},player,target); + } + } + } + }, + gwmaoxian_gaier:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_gaier', + enable:true, + filterTarget:true, + content:function(){ + 'step 0' + var str1='令'+get.translation(target); + var str2='一点体力和体力上限' + player.chooseControlList([str1+'增加'+str2,str1+'减少'+str2],function(){ + if(get.attitude(player,target)>0) return 0; + return 1; + }); + 'step 1' + if(result.index==0){ + target.gainMaxHp(true); + target.recover(); + } + else{ + target.loseHp(); + target.loseMaxHp(true); + } + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + player:function(player,target){ + var num=1; + if(target.hasSkillTag('maixie_hp')){ + num=1.5; + } + return num/Math.sqrt(target.hp+1); + } + } + } + }, + gwmaoxian_airuiting:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_airuiting', + enable:true, + filterTarget:function(card,player,target){ + return target!=player; + }, + selectTarget:-1, + content:function(){ + 'step 0' + target.chooseToUse({name:'sha'},'使用一张杀,或失去一点体力'); + 'step 1' + if(!result.bool){ + target.loseHp(); + } + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + target:function(player,target){ + if(target.hasSha()){ + if(Math.random()<0.5) return 1; + return 0; + } + if(target.countCards('h')>=2){ + return 0; + } + else{ + return -1; + } + } + } + } + }, + gwmaoxian_aisinie:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_aisinie', + enable:true, + notarget:true, + content:function(){ + 'step 0' + player.recover(); + 'step 1' + var list=get.typeCard('spell_silver'); + if(list.length){ + player.chooseVCardButton('获得一张银卡法术',list,true); + } + else{ + event.finish(); + } + 'step 2' + if(result.bool){ + player.gain(game.createCard(result.links[0][2]),'gain2'); + } + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + player:1 + } + } + }, + gwmaoxian_falanxisika:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_falanxisika', + enable:true, + notarget:true, + content:function(){ + 'step 0' + var list=get.typeCard('spell_gold'); + list.remove('gw_huangjiashenpan'); + if(list.length){ + player.chooseVCardButton('使用一张金卡法术',list.randomGets(3),true).ai=function(button){ + var info=get.info(button.link[2]); + if(info&&info.ai&&info.ai.result&&info.ai.result.player){ + return info.ai.result.player(player,player); + } + return 0; + }; + } + else{ + event.finish(); + } + 'step 1' + if(result.bool){ + player.useCard(game.createCard(result.links[0][2])); + } + }, + contentAfter:function(){ + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + }, + ai:{ + value:10, + order:1, + result:{ + player:1 + } + } + }, + gwmaoxian_huoge:{ + type:'gwmaoxian', + fullborder:'gold', + vanish:true, + derivation:'gw_diandian', + image:'character/gw_huoge', + enable:true, + notarget:true, + content:function(){ + 'step 0' + event.cards=get.cards(6); + player.chooseCardButton(event.cards,[1,2],'选择至多两牌依次使用之').set('filterButton',function(button){ + return game.hasPlayer(function(current){ + return player.canUse(button.link,current); + }); + }).set('ai',function(button){ + return get.value(button.link); + }); + 'step 1' + if(result.bool){ + event.list=result.links.slice(0); + for(var i=0;i