From ef51702769acd0bdc7189f5198e0c4a427776338 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Tue, 11 Aug 2020 21:05:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=83=20=E9=87=8C=20=E5=8D=95=20=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- card/gujian.js | 26 +- card/guozhan.js | 33 +- card/gwent.js | 4681 +++++++++++++++++------------------ card/sp.js | 4 +- card/standard.js | 2 +- character/extra.js | 21 +- character/mobile.js | 9 +- character/sp.js | 37 +- character/yijiang.js | 4 + game/asset.js | 5 +- game/game.js | 152 +- game/update.js | 26 +- image/character/caiyang.jpg | Bin 0 -> 173563 bytes image/character/huban.jpg | Bin 0 -> 117951 bytes image/character/pujing.jpg | Bin 0 -> 146255 bytes mode/brawl.js | 539 ++++ 16 files changed, 3062 insertions(+), 2477 deletions(-) create mode 100644 image/character/caiyang.jpg create mode 100644 image/character/huban.jpg create mode 100644 image/character/pujing.jpg diff --git a/card/gujian.js b/card/gujian.js index 7997e6ca8..ef76a1b79 100644 --- a/card/gujian.js +++ b/card/gujian.js @@ -870,13 +870,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return 0; }, result:{ - player:function(player,target){ - return game.countPlayer(function(current){ - if(current==target||(get.distance(target,current,'pure')==1&¤t.countCards('he'))){ - return -get.sgn(get.attitude(player,current)); - } - }); - } + target:-1, } } }, @@ -933,13 +927,17 @@ game.import('card',function(lib,game,ui,get,ai,_status){ multineg:1, }, result:{ - player:function(player,target){ - return game.countPlayer(function(current){ - if(current==target||(get.distance(target,current,'pure')==1)){ - return get.sgn(get.effect(current,{name:'chiyuxi'},player,player)); - } - }); - } + target:function(player,target){ + if(target.hasSkillTag('nofire')) return 0; + if(player.hasUnknown(2)) return 0; + var nh=target.countCards('h'); + if(lib.config.mode=='identity'){ + if(target.isZhu&&nh<=2&&target.hp<=1) return -100; + } + if(nh==0) return -2; + if(nh==1) return -1.7 + return -1.5; + }, } } }, diff --git a/card/guozhan.js b/card/guozhan.js index 067057825..6b6c39b65 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -280,27 +280,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return 0; }, result:{ - player:function(player,target){ - if(get.mode()=='versus') return game.countPlayer(function(current){ - if(target.isFriendOf(current)){ - if(current.isFriendOf(player)&¤t.isLinked()){ - return get.attitude(player,target); - } - else if(current.isEnemyOf(player)&&!current.isLinked()){ - return -get.attitude(player,target)*0.6; - } - } - }); - return game.countPlayer(function(current){ - if(target.isMajor()==current.isMajor()){ - if(current.isLinked()){ - return get.attitude(player,target); - } - else{ - return -get.attitude(player,target)*0.8; - } - } - }); + target:function(player,target){ + if(get.mode()=='versus'){ + if(target.isFriendOf(player)) return target.isLinked()?1:0; + return target.isLinked()?0:-1; + } + return target.isLinked()?1:-1; } } } @@ -390,8 +375,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){ value:4, useful:2, result:{ - player:1.5, - target:1, + target:function(player,target){ + if(player==target) return 2; + return 1; + }, }, }, }, diff --git a/card/gwent.js b/card/gwent.js index b98b126d3..2099e2318 100644 --- a/card/gwent.js +++ b/card/gwent.js @@ -1,2347 +1,2334 @@ -'use strict'; -game.import('card',function(lib,game,ui,get,ai,_status){ - return { - name:'gwent', - card:{ - gw_dieyi:{ - fullskin:true - }, - gw_dieyi_equip1:{ - fullskin:true, - vanish:true, - hidden:true, - cardimage:'gw_dieyi', - type:'equip', - subtype:'equip1', - onLose:function(){ - lib.skill.gw_dieyi.process(player); - }, - loseDelay:false, - skills:[], - ai:{ - equipValue:0 - } - }, - gw_dieyi_equip2:{ - fullskin:true, - vanish:true, - hidden:true, - cardimage:'gw_dieyi', - type:'equip', - subtype:'equip2', - onLose:function(){ - lib.skill.gw_dieyi.process(player); - }, - loseDelay:false, - skills:[], - ai:{ - equipValue:0 - } - }, - gw_dieyi_equip3:{ - fullskin:true, - vanish:true, - hidden:true, - cardimage:'gw_dieyi', - type:'equip', - subtype:'equip3', - onLose:function(){ - lib.skill.gw_dieyi.process(player); - }, - loseDelay:false, - skills:[], - ai:{ - equipValue:0 - } - }, - gw_dieyi_equip4:{ - fullskin:true, - vanish:true, - hidden:true, - cardimage:'gw_dieyi', - type:'equip', - subtype:'equip4', - onLose:function(){ - lib.skill.gw_dieyi.process(player); - }, - loseDelay:false, - skills:[], - ai:{ - equipValue:0 - } - }, - gw_dieyi_equip5:{ - fullskin:true, - vanish:true, - hidden:true, - cardimage:'gw_dieyi', - type:'equip', - subtype:'equip5', - onLose:function(){ - lib.skill.gw_dieyi.process(player); - }, - loseDelay:false, - skills:[], - ai:{ - equipValue:0 - } - }, - gw_dieyi_judge:{ - fullskin:true, - vanish:true, - hidden:true, - cardimage:'gw_dieyi', - enable:true, - type:'delay', - filterTarget:true, - effect:function(){ - lib.skill.gw_dieyi.process(player); - }, - }, - gw_hudiewu:{ - fullborder:'gold', - type:'spell', - subtype:'spell_gold', - vanish:true, - enable:function(card,player){ - return game.hasPlayer(function(current){ - return current!=player&¤t.countCards('ej'); - }); - }, - notarget:true, - contentBefore:function(){ - player.$skill('蝴蝶舞','legend','metal'); - game.delay(2); - }, - content:function(){ - 'step 0' - event.targets=game.filterPlayer(function(current){ - return current.countCards('ej'); - }).sortBySeat(); - event.targets.remove(player); - 'step 1' - if(event.targets.length){ - var target=event.targets.shift(); - var ej=target.getCards('ej'); - player.line(target); - target.removeEquipTrigger(); - for(var i=0;imax2){ - return get.damageEffect(get.max(enemies,func,'item'),player,player,'fire'); - } - else{ - var num; - if(max1>max2){ - num=get.sgn(get.damageEffect(get.max(enemies,func,'item'),player,player,'fire')); - } - else if(max1==max2){ - num=0; - } - else{ - num=1; - } - return num+game.countPlayer(function(current){ - if(current.hp>=max2){ - return get.sgn(get.damageEffect(current,player,player,'fire')); - } - }); - } - } - }, - order:0.7, - } - }, - gw_leizhoushu:{ - fullborder:'gold', - type:'spell', - subtype:'spell_gold', - vanish:true, - enable:true, - notarget:true, - contentBefore:function(){ - player.$skill('雷咒术','legend','metal'); - game.delay(2); - }, - content:function(){ - if(player.hasSkill('gw_leizhoushu')){ - if(typeof player.storage.gw_leizhoushu!='number'){ - player.storage.gw_leizhoushu=2; - } - else{ - player.storage.gw_leizhoushu++; - } - player.syncStorage('gw_leizhoushu'); - player.updateMarks(); - } - else{ - player.addSkill('gw_leizhoushu'); - } - }, - contentAfter:function(){ - var evt=_status.event.getParent('phaseUse'); - if(evt&&evt.name=='phaseUse'){ - evt.skipped=true; - } - }, - ai:{ - value:8, - useful:[6,1], - result:{ - player:function(player){ - return 1+game.countPlayer(function(current){ - if(current!=player&¤t.isMaxHandcard()){ - return -get.sgn(get.attitude(player,current)); - } - }); - } - }, - order:0.5, - } - }, - gw_aerdeyin:{ - fullborder:'gold', - type:'spell', - subtype:'spell_gold', - vanish:true, - enable:function(card,player){ - var enemies=player.getEnemies(); - return enemies.length>0; - }, - notarget:true, - contentBefore:function(){ - player.$skill('阿尔德印','legend','metal'); - game.delay(2); - }, - content:function(){ - 'step 0' - var enemies=player.getEnemies(); - event.list=[enemies.randomGet()]; - 'step 1' - if(event.list.length){ - var target=event.list.shift(); - event.target=target; - player.line(target,'green'); - target.damage(); - } - else{ - delete event.target; - } - 'step 2' - if(event.target){ - if(!event.target.isTurnedOver()){ - event.target.turnOver(); - event.target.addSkill('gw_aerdeyin'); - } - event.goto(1); - } - 'step 3' - game.delay(); - }, - contentAfter:function(){ - var evt=_status.event.getParent('phaseUse'); - if(evt&&evt.name=='phaseUse'){ - evt.skipped=true; - } - }, - ai:{ - value:8, - useful:[6,1], - result:{ - player:function(player){ - return game.countPlayer(function(current){ - if(get.distance(player,current,'pure')==1){ - var att=get.sgn(get.attitude(player,current)); - if(current==player.next){ - return -att*1.5; - } - return -att; - } - }); - } - }, - order:0.5, - } - }, - gw_ansha:{ - fullborder:'gold', - type:'spell', - subtype:'spell_gold', - vanish:true, - enable:function(card,player){ - var enemies=player.getEnemies(); - return game.hasPlayer(function(current){ - return current.hp==1&&enemies.contains(current); - }); - }, - notarget:true, - contentBefore:function(){ - player.$skill('暗杀','legend','metal'); - game.delay(2); - }, - content:function(){ - var enemies=player.getEnemies(); - var list=game.filterPlayer(function(current){ - return current.hp==1&&enemies.contains(current); - }); - if(list.length){ - var target=list.randomGet(); - player.line(target); - target.die(); - } - }, - contentAfter:function(){ - var evt=_status.event.getParent('phaseUse'); - if(evt&&evt.name=='phaseUse'){ - evt.skipped=true; - } - }, - ai:{ - value:8, - useful:[6,1], - result:{ - player:1 - }, - order:0.6, - } - }, - gw_xinsheng:{ - fullborder:'gold', - type:'spell', - subtype:'spell_gold', - vanish:true, - enable:function(card,player){ - return game.hasPlayer(function(current){ - return !current.isUnseen(); - }); - }, - notarget:true, - contentBefore:function(){ - player.$skill('新生','legend','metal'); - game.delay(2); - }, - content:function(){ - 'step 0' - var target=get.max(game.filterPlayer(function(current){ - return !current.isUnseen(); - },'list').randomSort(),function(current){ - var att=get.attitude(player,current); - if(att<0&¤t.isDamaged()&¤t.hp<=3){ - return -10; - } - var rank=get.rank(current,true); - if(current.maxHp>=3){ - if(current.hp<=1){ - if(att>0) return att*3+2; - return att*3; - } - else if(current.hp==2){ - if(att>0){ - att*=1.5; - } - else{ - att/=1.5; - } - } - } - if(rank>=7){ - if(att>0){ - return att/10; - } - return -att/5; - } - else if(rank<=4){ - if(att<0){ - return -att/10; - } - return att; - } - return Math.abs(att/2); - },'item'); - event.aitarget=target; - var list=[]; - for(var i in lib.character){ - if(!lib.filter.characterDisabled(i)&&!lib.filter.characterDisabled2(i)){ - list.push(i); - } - } - var players=game.players.concat(game.dead); - for(var i=0;i0){ - return get.rank(button.link,true); - } - else{ - return -get.rank(button.link,true); - } - }; - 'step 1' - event.nametarget=result.links[0]; - player.chooseTarget(true,'使用'+get.translation(event.nametarget)+'替换一名角色的武将牌',function(card,player,target){ - return !target.isUnseen()&&!target.isMin(); - }).ai=function(target){ - if(target==event.aitarget){ - return 1; - } - else{ - return 0; - } - } - 'step 2' - var target=result.targets[0]; - var hp=target.hp; - target.reinit(target.name,event.nametarget); - target.hp=Math.min(hp+1,target.maxHp); - target.update(); - player.line(target,'green'); - 'step 3' - game.triggerEnter(target); - }, - contentAfter:function(){ - var evt=_status.event.getParent('phaseUse'); - if(evt&&evt.name=='phaseUse'){ - evt.skipped=true; - } - }, - ai:{ - value:8, - useful:[6,1], - result:{ - player:1 - }, - order:0.5, - } - }, - gw_niuquzhijing:{ - fullborder:'gold', - type:'spell', - subtype:'spell_gold', - vanish:true, - enable:function(card,player){ - return game.hasPlayer(function(current){ - return current.hp!=player.hp; - }); - }, - notarget:true, - contentBefore:function(){ - var list1=game.filterPlayer(function(current){ - return current.isMaxHp(); - }); - var list2=game.filterPlayer(function(current){ - return current.isMinHp(); - }); - player.line(list1); - for(var i=0;ilist11.length){ - list11.push(list1.randomGet()); - } - while(list22.length0; - }, - content:function(){ - 'step 0' - var cards=target.getCards('h'); - target.lose(cards,ui.special); - target.storage.gw_youer=cards; - target.addSkill('gw_youer'); - 'step 1' - player.draw(); - }, - ai:{ - basic:{ - order:10, - value:7, - useful:[3,1], - }, - result:{ - target:function(player,target){ - if(target.hasSkillTag('noh')) return 3; - var num=-Math.sqrt(target.countCards('h')); - if(player.hasSha()&&player.canUse('sha',target)){ - num-=2; - } - return num; - }, - }, - } - }, - gw_tongdi:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - vanish:true, - enable:true, - filterTarget:function(card,player,target){ - return target!=player&&target.countCards('h'); - }, - content:function(){ - 'step 0' - player.gainPlayerCard(target,'h',true,'visible').set('ai',function(button){ - return get.value(button.link); - }); - 'step 1' - target.gain(game.createCard('sha'),'gain2'); - }, - ai:{ - basic:{ - order:8, - value:9.5, - useful:[5,1], - }, - result:{ - target:function(player,target){ - if(target.getEquip(4)) return -2; - return -1; - } - }, - } - }, - gw_fuyuan:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - vanish:true, - savable:true, - selectTarget:-1, - content:function(){ - target.recover(); - target.draw(); - }, - ai:{ - basic:{ - order:6, - useful:10, - value:[8,6.5,5,4], - }, - result:{ - target:2 - }, - tag:{ - recover:1, - save:1, - } - } - }, - gw_zhuoshao:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - vanish:true, - enable:true, - filterTarget:function(card,player,target){ - return target.isMaxHp(); - }, - cardnature:'fire', - selectTarget:[1,Infinity], - content:function(){ - target.damage('fire'); - }, - ai:{ - basic:{ - order:8.5, - value:7.5, - useful:[4,1], - }, - result:{ - target:-1 - }, - tag:{ - damage:1, - fireDamage:1, - natureDamage:1, - } - } - }, - gw_butianshu:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - vanish:true, - enable:true, - filterTarget:true, - // contentBefore:function(){ - // player.$skill('卜天术','legend','water'); - // game.delay(2); - // }, - content:function(){ - 'step 0' - var list=[]; - for(var i in lib.card){ - if(lib.card[i].mode&&lib.card[i].mode.contains(lib.config.mode)==false) continue; - if(lib.card[i].vanish) continue; - if(lib.card[i].type=='delay') list.push([cards[0].suit,cards[0].number,i]); - } - var dialog=ui.create.dialog('卜天术',[list,'vcard']); - var bing=target.countCards('h')<=1; - player.chooseButton(dialog,true,function(button){ - if(get.effect(target,{name:button.link[2]},player,player)>0){ - if(button.link[2]=='bingliang'){ - if(bing) return 2; - return 0.7; - } - if(button.link[2]=='lebu'){ - return 1; - } - if(button.link[2]=='guiyoujie'){ - return 0.5; - } - if(button.link[2]=='caomu'){ - return 0.3; - } - return 0.2; - } - return 0; - }).filterButton=function(button){ - return !target.hasJudge(button.link[2]); - }; - 'step 1' - var card=game.createCard(result.links[0][2]); - event.judgecard=card; - target.$draw(card); - game.delay(0.7); - 'step 2' - target.addJudge(event.judgecard); - }, - ai:{ - value:8, - useful:[5,1], - result:{ - player:function(player,target){ - var eff=0; - for(var i in lib.card){ - if(lib.card[i].type=='delay'){ - var current=get.effect(target,{name:i},player,player); - if(current>eff){ - eff=current; - } - } - } - return eff; - } - }, - order:6, - } - }, - gw_shizizhaohuan:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - vanish:true, - enable:true, - filterTarget:function(card,player,target){ - return target==player; - }, - selectTarget:-1, - // contentBefore:function(){ - // player.$skill('十字召唤','legend','water'); - // game.delay(2); - // }, - content:function(){ - var list=[]; - list.push(get.cardPile2('juedou')); - list.push(get.cardPile2('huogong')); - list.push(get.cardPile2('nanman')); - list.push(get.cardPile2('huoshaolianying')); - for(var i=0;i0; - }); - var aozu2=game.hasPlayer(function(current){ - return player.canUse('gw_aozuzhilei',current)&¤t.hp<=2&&get.effect(current,{name:'gw_aozuzhilei'},player,player)>0; - }); - var aozu3=game.hasPlayer(function(current){ - return player.canUse('gw_aozuzhilei',current)&&get.effect(current,{name:'gw_aozuzhilei'},player,player)>0; - }); - var baoxue=game.hasPlayer(function(current){ - return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&[2,3].contains(current.countCards('h'))&&!current.hasSkillTag('noh'); - }); - var baoxue2=game.hasPlayer(function(current){ - return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&&[2].contains(current.countCards('h'))&&!current.hasSkillTag('noh'); - }); - var baoxue3=game.hasPlayer(function(current){ - return player.canUse('gw_baoxueyaoshui',current)&&get.attitude(player,current)<0&¤t.countCards('h')>=2&&!current.hasSkillTag('noh'); - }); - var nongwu=game.hasPlayer(function(current){ - return get.attitude(player,current)<0&&(get.attitude(player,current.getNext())<0||get.attitude(player,current.getPrevious())<0); - }); - var nongwu2=game.hasPlayer(function(current){ - return get.attitude(player,current)<0&&get.attitude(player,current.getNext())<0&&get.attitude(player,current.getPrevious())<0; - }); - var yanzi=game.hasPlayer(function(current){ - return get.attitude(player,current)>0&¤t.isMinHandcard(); - }); - player.chooseButton(dialog,true,function(button){ - var name=button.link[2]; - switch(name){ - case 'gw_ciguhanshuang': - if(nongwu2) return 3; - if(nongwu) return 1; - return 0; - case 'gw_baoxueyaoshui': - if(baoxue2) return 2; - if(baoxue) return 1.5; - if(baoxue3) return 0.5; - return 0; - case 'gw_aozuzhilei': - if(aozu2) return 2.5; - if(aozu) return 1.2; - if(aozu3) return 0.2; - return 0; - case 'gw_yanziyaoshui': - if(yanzi) return 2; - return 0.6; - } - if(game.hasPlayer(function(current){ - return player.canUse(name,current)&&get.effect(current,{name:name},player,player)>0; - })){ - return Math.random(); - } - return 0; - }).filterButton=function(button){ - var name=button.link[2]; - if(!lib.card[name].notarget){ - return game.hasPlayer(function(current){ - return player.canUse(name,current); - }) - } - return true; - }; - 'step 1' - player.chooseUseTarget(true,game.createCard(result.links[0][2],get.suit(card),get.number(card))); - }, - ai:{ - value:7, - useful:[4,1], - result:{ - player:function(player){ - return 1; - } - }, - order:7, - } - }, - - gw_nuhaifengbao:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('gw_nuhaifengbao'); - }, - content:function(){ - target.addSkill('gw_nuhaifengbao'); - }, - ai:{ - value:[7,1], - useful:[4,1], - result:{ - target:function(player,target){ - return -2/Math.sqrt(1+target.hp); - } - }, - order:1.2, - } - }, - gw_baishuang:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('gw_ciguhanshuang'); - }, - selectTarget:[1,3], - content:function(){ - target.addSkill('gw_ciguhanshuang'); - }, - ai:{ - value:[7.5,1], - useful:[5,1], - result:{ - target:-1 - }, - order:1.2, - } - }, - gw_baobaoshu:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('gw_baobaoshu'); - }, - selectTarget:[1,2], - content:function(){ - target.addTempSkill('gw_baobaoshu',{player:'phaseAfter'}); - }, - ai:{ - value:[7.5,1], - useful:[5,1], - result:{ - target:function(player,target){ - return -Math.sqrt(target.countCards('h'))-0.5; - } - }, - order:1.2, - } - }, - gw_guaiwuchaoxue:{ - fullborder:'silver', - type:'spell', - subtype:'spell_silver', - enable:true, - usable:1, - forceUsable:true, - filterTarget:function(card,player,target){ - return target==player; - }, - selectTarget:-1, - content:function(){ - var list=get.gainableSkills(function(info,skill){ - return !info.notemp&&info.ai&&info.ai.maixie_hp&&!player.hasSkill(skill); - }); - list.remove('guixin'); - if(list.length){ - var skill=list.randomGet(); - player.popup(skill); - player.addTempSkill(skill,{player:'phaseBegin'}); - var enemies=player.getEnemies(); - if(enemies.length){ - var source=enemies.randomGet(); - source.line(player); - source.addExpose(0.1); - player.damage(source); - player.recover(); - } - } - }, - ai:{ - value:[8,1], - useful:[3,1], - result:{ - target:function(player,target){ - if(target.hp<=1||target.hujia) return 0; - return 1; - } - }, - order:1, - } - }, - - gw_qinpendayu:{ - fullborder:'bronze', - type:'spell', - subtype:'spell_bronze', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('gw_qinpendayu'); - }, - changeTarget:function(player,targets){ - game.filterPlayer(function(current){ - return get.distance(targets[0],current,'pure')==1; - },targets); - }, - content:function(){ - target.addSkill('gw_qinpendayu'); - }, - ai:{ - value:[5,1], - useful:[3,1], - result:{ - player:function(player,target){ - return game.countPlayer(function(current){ - if(current.hasSkill('gw_qinpendayu')) return 0; - if(current==target||(get.distance(target,current,'pure')==1)){ - var num=-get.sgn(get.attitude(player,current)); - if(current.needsToDiscard()) return num; - if(current.needsToDiscard(1)) return 0.7*num; - if(current.needsToDiscard(2)) return 0.4*num; - return 0.1*num; - } - }); - } - }, - order:1.2, - } - }, - gw_birinongwu:{ - fullborder:'bronze', - type:'spell', - subtype:'spell_bronze', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('gw_birinongwu'); - }, - changeTarget:function(player,targets){ - game.filterPlayer(function(current){ - return get.distance(targets[0],current,'pure')==1; - },targets); - }, - content:function(){ - target.addSkill('gw_birinongwu'); - }, - ai:{ - value:[5,1], - useful:[3,1], - result:{ - player:function(player,target){ - return game.countPlayer(function(current){ - if(current.hasSkill('gw_birinongwu')) return 0; - if(current==target||(get.distance(target,current,'pure')==1)){ - return -get.sgn(get.attitude(player,current)); - } - }); - } - }, - order:1.2, - } - }, - gw_ciguhanshuang:{ - fullborder:'bronze', - type:'spell', - subtype:'spell_bronze', - enable:true, - filterTarget:function(card,player,target){ - return !target.hasSkill('gw_ciguhanshuang'); - }, - changeTarget:function(player,targets){ - game.filterPlayer(function(current){ - return get.distance(targets[0],current,'pure')==1; - },targets); - }, - content:function(){ - target.addSkill('gw_ciguhanshuang'); - }, - ai:{ - value:[5,1], - useful:[3,1], - result:{ - player:function(player,target){ - return game.countPlayer(function(current){ - if(current.hasSkill('gw_ciguhanshuang')) return 0; - if(current==target||(get.distance(target,current,'pure')==1)){ - return -get.sgn(get.attitude(player,current)); - } - }); - } - }, - order:1.2, - } - }, - gw_baoxueyaoshui:{ - fullborder:'bronze', - type:'spell', - subtype:'spell_bronze', - enable:true, - filterTarget:true, - content:function(){ - 'step 0' - target.chooseToDiscard('h',2,true).delay=false; - 'step 1' - target.draw(); - }, - ai:{ - value:6, - useful:[3,1], - result:{ - target:function(player,target){ - if(target.hasSkillTag('noh')) return 0.1; - switch(target.countCards('h')){ - case 0:return 0.5; - case 1:return 0; - case 2:return -1.5; - default:return -1; - } - } - }, - order:8, - tag:{ - loseCard:1, - discard:1, - } - } - }, - gw_zhihuanjun:{ - fullborder:'bronze', - type:'spell', - subtype:'spell_bronze', - enable:true, - filterTarget:function(card,player,target){ - return target.isDamaged(); - }, - content:function(){ - 'step 0' - target.loseMaxHp(true); - 'step 1' - if(target.isDamaged()&&target.countCards('h')=player.hp; - }, - content:function(){ - 'step 0' - target.damage('thunder'); - 'step 1' - if(target.isIn()){ - target.draw(); - } - }, - ai:{ - basic:{ - order:1.8, - value:[5,1], - useful:[4,1], - }, - result:{ - target:-1 - }, - tag:{ - damage:1, - thunderDamage:1, - natureDamage:1, - } - } - }, - gw_poxiao:{ - fullborder:'bronze', - type:'spell', - subtype:'spell_bronze', - enable:true, - notarget:true, - content:function(){ - 'step 0' - var choice=1; - if(game.countPlayer(function(current){ - if(current.countCards('j')||current.hasSkillTag('weather')){ - if(get.attitude(player,current)>0){ - choice=0; - } - return true; - } - })){ - player.chooseControl(function(){ - return choice; - }).set('choiceList',[ - '解除任意名角色的天气效果并移除其判定区内的牌', - '随机获得一张铜卡法术(破晓除外)并展示之' - ]); - } - else{ - event.directfalse=true; - } - 'step 1' - if(!event.directfalse&&result.index==0){ - player.chooseTarget(true,[1,Infinity],'解除任意名角色的天气效果并移除其判定区内的牌',function(card,player,target){ - return target.countCards('j')||target.hasSkillTag('weather'); - }).ai=function(target){ - return get.attitude(player,target); - }; - } - else{ - var list=get.libCard(function(info,name){ - return name!='gw_poxiao'&&info.subtype=='spell_bronze'; - }); - if(list.length){ - player.gain(game.createCard(list.randomGet()),'gain2'); - } - else{ - player.draw(); - } - event.finish(); - } - 'step 2' - event.list=result.targets.slice(0).sortBySeat(); - 'step 3' - if(event.list.length){ - var target=event.list.shift(); - player.line(target,'green'); - var cards=target.getCards('j'); - if(cards.length){ - target.discard(cards); - } - if(target.hasSkillTag('weather')){ - var skills=target.getSkills(); - for(var i=0;i0){ - player.updateMarks(); - } - else{ - player.removeSkill('gw_kunenfayin'); - } - }, - } - }, - group:'gw_kunenfayin_count', - onremove:true - }, - gw_baobaoshu:{ - mark:true, - nopop:true, - intro:{ - content:'每使用一张基本牌或锦囊牌,需弃置一张牌' - }, - trigger:{player:'useCard'}, - forced:true, - filter:function(event,player){ - if(player.countCards('he')==0) return false; - var type=get.type(event.card,'trick'); - return type=='basic'||type=='trick'; - }, - content:function(){ - if(!event.isMine()) game.delay(0.5); - player.chooseToDiscard(true,'he'); - }, - ai:{ - weather:true, - effect:{ - player:function(card,player){ - if(!player.needsToDiscard()) return 'zeroplayertarget'; - } - } - } - }, - gw_nuhaifengbao:{ - mark:true, - intro:{ - content:'结束阶段随机弃置一张牌(剩余#回合)' - }, - init:function(player){ - player.storage.gw_nuhaifengbao=2; - }, - trigger:{player:'phaseEnd'}, - forced:true, - nopop:true, - content:function(){ - player.randomDiscard(); - player.storage.gw_nuhaifengbao--; - if(player.storage.gw_nuhaifengbao>0){ - player.updateMarks(); - } - else{ - player.removeSkill('gw_nuhaifengbao'); - } - }, - onremove:true, - ai:{ - neg:true, - weather:true - } - }, - gw_youer:{ - trigger:{global:'phaseEnd',player:'dieBegin'}, - forced:true, - audio:false, - mark:true, - intro:{ - content:'cards' - }, - content:function(){ - if(player.storage.gw_youer){ - if(trigger.name=='phase'){ - player.gain(player.storage.gw_youer); - } - else{ - player.$throw(player.storage.gw_youer,1000); - for(var i=0;i0; - }, - content:function(){ - trigger.num--; - player.removeSkill('gw_ciguhanshuang'); - }, - ai:{ - weather:true - } - }, - gw_dieyi:{ - init:function(player){ - player.storage.gw_dieyi=1; - }, - onremove:true, - trigger:{global:'phaseEnd'}, - forced:true, - mark:true, - nopop:true, - process:function(player){ - if(player.hasSkill('gw_dieyi')){ - player.storage.gw_dieyi++; - } - else{ - player.addSkill('gw_dieyi'); - } - player.syncStorage('gw_dieyi'); - player.updateMarks(); - }, - intro:{ - content:'在当前回合的结束阶段,你随机弃置#张牌' - }, - content:function(){ - player.randomDiscard(player.storage.gw_dieyi); - player.removeSkill('gw_dieyi'); - } - }, - gw_leizhoushu:{ - mark:true, - intro:{ - content:function(storage,player){ - if(storage>=2){ - return '锁定技,准备阶段,你令手牌数为全场最多的所有其他角色各随机弃置一张手牌,若目标不包含敌方角色,将一名随机敌方角色追加为额外目标(重复'+storage+'次)'; - } - else{ - return '锁定技,准备阶段,你令手牌数为全场最多的所有其他角色各随机弃置一张手牌,若目标不包含敌方角色,将一名随机敌方角色追加为额外目标'; - } - } - }, - nopop:true, - trigger:{player:'phaseBegin'}, - forced:true, - filter:function(event,player){ - var list=game.filterPlayer(); - for(var i=0;i0&&event.parent.name=='phaseDraw'; - }, - content:function(){ - if(!player.storage.spell_gain||Math.max.apply(null,player.storage.spell_gain)<0){ - var tmp=player.storage.spell_gain2; - player.storage.spell_gain=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15].randomGets(3); - player.storage.spell_gain2=Math.floor((15-Math.max.apply(null,player.storage.spell_gain))/2); - if(tmp){ - for(var i=0;i<3;i++){ - player.storage.spell_gain[i]+=tmp; - } - } - } - for(var i=0;i<3;i++){ - if(player.storage.spell_gain[i]==0){ - var list; - if(i==0){ - list=get.libCard(function(info){ - return info.subtype=='spell_gold'; - }); - if(get.mode()=='stone'){ - list.remove('gw_aerdeyin'); - list.remove('gw_niuquzhijing'); - } - } - else{ - list=get.libCard(function(info){ - return info.subtype=='spell_silver'; - }); - if(get.mode()=='stone'){ - list.remove('gw_butianshu'); - } - } - if(list&&list.length){ - ui.cardPile.insertBefore(game.createCard(list.randomGet()),ui.cardPile.firstChild); - } - } - player.storage.spell_gain[i]--; - } - } - } - }, - help:{ - '昆特牌':'