diff --git a/card/extra.js b/card/extra.js index 1f64fc0a1..9fd60ca9d 100644 --- a/card/extra.js +++ b/card/extra.js @@ -509,21 +509,21 @@ game.import('card',function(lib,game,ui,get,ai,_status){ } }, tengjia3:{ - audio:'tengjia1', - trigger:{target:'shaBegin'}, - forced:true, - filter:function(event,player){ - if(event.player.hasSkillTag('unequip',false,{ + audio:'tengjia1', + trigger:{target:'shaBegin'}, + forced:true, + filter:function(event,player){ + if(event.player.hasSkillTag('unequip',false,{ name:event.card?event.card.name:null, target:player, card:event.card })) return false; if(event.card.name=='sha'&&!event.card.nature) return true; return false; - }, - content:function(){ - trigger.cancel(); - }, + }, + content:function(){ + trigger.cancel(); + }, }, baiyin_skill:{ trigger:{player:'damageBegin'}, diff --git a/card/guozhan.js b/card/guozhan.js index 0dfe7d1b1..c66efd3f5 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -738,11 +738,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){ }, skill:{ liulongcanjia:{ - mod:{ - targetEnabled:function(card,player,target){ - if(['equip3','equip4'].contains(get.subtype(card))) return false; - }, - }, + mod:{ + targetEnabled:function(card,player,target){ + if(['equip3','equip4'].contains(get.subtype(card))) return false; + }, + }, }, minguangkai_cancel:{ trigger:{target:'useCardToBefore'}, diff --git a/card/standard.js b/card/standard.js index fa3c4ad3c..429d681cf 100644 --- a/card/standard.js +++ b/card/standard.js @@ -943,18 +943,18 @@ game.import('card',function(lib,game,ui,get,ai,_status){ else{ if(result.bool){ if(event.turn==target){ - if(result.cards) event.targetCards.addArray(result.cards); - event.turn=player; + if(result.cards) event.targetCards.addArray(result.cards); + event.turn=player; } else{ - if(result.cards) event.playerCards.addArray(result.cards); - event.turn=target; + if(result.cards) event.playerCards.addArray(result.cards); + event.turn=target; } event.goto(1); } else{ if(event.turn==target){ - target.damage(event.baseDamage+event.extraDamage); + target.damage(event.baseDamage+event.extraDamage); } else{ player.damage(target,event.baseDamage+event.extraDamage); @@ -1418,7 +1418,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return event.card&&event.card.name=='sha'&&event.notLink()&&event.player.getCards('he').length>0; }, check:function(event,player){ - var target=event.player; + var target=event.player; var eff=get.damageEffect(target,player,player); if(get.attitude(player,target)>0){ if(eff>=0) return false; @@ -1443,7 +1443,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ trigger.cancel(); "step 1" if(trigger.player.countDiscardableCards(player,'he')){ - player.line(trigger.player); + player.line(trigger.player); player.discardPlayerCard('he',trigger.player,true); } "step 2" diff --git a/character/diy.js b/character/diy.js index ba3d455b0..a06c4596f 100755 --- a/character/diy.js +++ b/character/diy.js @@ -123,191 +123,189 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, skill:{ ns_chuanshu:{ - audio:["xingshuai",2], - trigger:{ - global:"dying", - }, - priority:8, - unique:true, - skillAnimation:true, - animationColor:"water", - filter:function (event,player){ - return event.player.hp<=0&&event.player!=player; - }, - check:function (event,player){ - return get.attitude(player,event.player)>0; - }, - logTarget:"player", - content:function (){ - 'step 0' - // player.logSkill('ns_chuanshu',trigger.player); - trigger.player.chooseControl('releiji','guidao').set('prompt',''+get.translation(trigger.player)+'获得一项技能'); - goon=true; - - if(!goon){ - event.finish(); - } - 'step 1' - trigger.player.addSkillLog(result.control); - trigger.player.recover(1-trigger.player.hp); - trigger.player.draw(2); - trigger.player.storage.ns_chuanshu2=player; - trigger.player.addSkill('ns_chuanshu2'); - //game.broadcastAll()+trigger.player.node.avatar.setBackgroundImage('extension/群英会/ns_zhangjiao.jpg'); - //player.removeSkill('ns_chuanshu'); - player.awakenSkill('ns_chuanshu'); - }, - }, - ns_xiandao1:{ - audio:["huashen",2], - forced:true, - // noLose:true, - // locked:true, - // noRemove:true, - // noDisable:true, - priority:10, - trigger:{ - global:"gameStart", - player:["phaseEnd","enterGame"], - }, - filter:function (event,player){ - return player.isAlive(); - }, - content:function (){ - var n=[1,2].randomGet(); - if(n==1){ - player.addTempSkill("releiji",{player:"phaseUseBegin"}); - player.markSkill("releiji",{player:"phaseUseBegin"}); - }; - if(n==2){ - player.addTempSkill("guidao",{player:"phaseUseBegin"}); - player.markSkill("guidao",{player:"phaseUseBegin"}); - }; - }, - }, - ns_xiandao2:{ - audio:["huashen",2], - forced:true, - // noLose:true, - // locked:true, - // noRemove:true, - // noDisable:true, - trigger:{ - player:"damageBefore", - }, - filter:function (event,player){ - if(!event.nature) return false; - return true; - }, - content:function (){ - trigger.cancel(); - event.finish(); - }, - }, - ns_xiandao:{ - forced:true, - // noLose:true, - // locked:true, - noRemove:true, - // noDisable:true, - group:["ns_xiandao1","ns_xiandao2"], - }, - ns_chuanshu2:{ - audio:["songwei",2], - mark:"character", - intro:{ - content:"当你造成或受到一次伤害后,$摸一张牌", - }, - nopop:true, - trigger:{ - source:"damageEnd", - player:"damageEnd", - }, - forced:true, - popup:false, - filter:function (event,player){ - return player.storage.ns_chuanshu2&&player.storage.ns_chuanshu2.isIn()&&event.num>0; - }, - content:function (){ - 'step 0' - game.delayx(); - 'step 1' - var target=player.storage.ns_chuanshu2; - player.line(target,'green'); - target.draw(); - game.delay(); - }, - onremove:true, - group:"ns_chuanshu3", - }, - ns_chuanshu3:{ - audio:"ext:群英会:1", - trigger:{ - player:"dieBegin", - }, - silent:true, - onremove:true, - filter:function (event,player){ - return player.storage.ns_chuanshu2&&player.storage.ns_chuanshu2.isIn(); - }, - content:function (){ - 'step 0' - game.delayx(); - 'step 1' - var target=player.storage.ns_chuanshu2; - player.line(target,'green'); - //target.addSkill('ns_chuanshu'); - target.restoreSkill('ns_chuanshu'); - target.update(); - }, - forced:true, - popup:false, - }, - ns_xiuzheng:{ - audio:["xinsheng",2], - enable:"phaseUse", - usable:1, - priority:10, - filter:function (event,player){ - return (ui.cardPile.childElementCount+ui.discardPile.childElementCount)>=2; - }, - filterTarget:function (card,player,target){ - return player!=target; - }, - content:function (){ - "step 0" - event.cards=get.cards(2); - player.showCards(event.cards); - "step 1" - if(get.color(event.cards[0])=='red'&&get.color(event.cards[1])=='red'){ - target.damage('fire'); - } - if(get.color(event.cards[0])!=get.color(event.cards[1])){ - player.discardPlayerCard(target,"he",true); - } - if(get.color(event.cards[0])=='black'&&get.color(event.cards[1])=='black'){ - target.damage('thunder'); - } - "step 2" - if(event.cards.length){ - player.gain(event.cards,'gain2'); - game.delay(); - } - "step 3" - player.chooseToDiscard(2,'he','请弃置两张牌',true).ai=function(card){ - return 7-get.value(card); - }; - }, - ai:{ - threaten:0.5, - order:13, - result:{ - target:function (player,target){ - return get.damageEffect(target,player); - }, - }, - }, - }, + audio:["xingshuai",2], + trigger:{ + global:"dying", + }, + priority:8, + unique:true, + skillAnimation:true, + animationColor:"water", + filter:function (event,player){ + return event.player.hp<=0&&event.player!=player; + }, + check:function (event,player){ + return get.attitude(player,event.player)>0; + }, + logTarget:"player", + content:function (){ + 'step 0' + // player.logSkill('ns_chuanshu',trigger.player); + trigger.player.chooseControl('releiji','guidao').set('prompt',''+get.translation(trigger.player)+'获得一项技能'); + goon=true; + + if(!goon){ + event.finish(); + } + 'step 1' + trigger.player.addSkillLog(result.control); + trigger.player.recover(1-trigger.player.hp); + trigger.player.draw(2); + trigger.player.storage.ns_chuanshu2=player; + trigger.player.addSkill('ns_chuanshu2'); + //game.broadcastAll()+trigger.player.node.avatar.setBackgroundImage('extension/群英会/ns_zhangjiao.jpg'); + //player.removeSkill('ns_chuanshu'); + player.awakenSkill('ns_chuanshu'); + }, + }, + ns_xiandao1:{ + audio:["huashen",2], + forced:true, + //noLose:true, + //locked:true, + //noRemove:true, + //noDisable:true, + priority:10, + trigger:{ + global:"gameStart", + player:["phaseEnd","enterGame"], + }, + //filter:function (event,player){ + // return player.isAlive(); + //}, + content:function (){ + var n=[1,2].randomGet(); + if(n==1){ + player.addTempSkill("releiji",{player:"phaseUseBegin"}); + player.markSkill("releiji",{player:"phaseUseBegin"}); + }; + if(n==2){ + player.addTempSkill("guidao",{player:"phaseUseBegin"}); + player.markSkill("guidao",{player:"phaseUseBegin"}); + }; + }, + }, + ns_xiandao2:{ + audio:["huashen",2], + forced:true, + //noLose:true, + //locked:true, + //noRemove:true, + //noDisable:true, + trigger:{ + player:"damageBefore", + }, + filter:function (event,player){ + if(!event.nature) return false; + return true; + }, + content:function (){ + trigger.cancel(); + //event.finish(); + }, + }, + ns_xiandao:{ + forced:true, + //noLose:true, + //locked:true, + noRemove:true, + //noDisable:true, + group:["ns_xiandao1","ns_xiandao2"], + }, + ns_chuanshu2:{ + audio:["songwei",2], + mark:"character", + intro:{ + content:"当你造成或受到一次伤害后,$摸一张牌", + }, + nopop:true, + trigger:{ + source:"damageEnd", + player:"damageEnd", + }, + forced:true, + popup:false, + filter:function (event,player){ + return player.storage.ns_chuanshu2&&player.storage.ns_chuanshu2.isIn()&&event.num>0; + }, + content:function (){ + 'step 0' + game.delayx(); + 'step 1' + var target=player.storage.ns_chuanshu2; + player.line(target,'green'); + target.draw(); + game.delay(); + }, + onremove:true, + group:"ns_chuanshu3", + }, + ns_chuanshu3:{ + audio:1, + trigger:{ + player:"dieBegin", + }, + silent:true, + onremove:true, + filter:function (event,player){ + return player.storage.ns_chuanshu2&&player.storage.ns_chuanshu2.isIn(); + }, + content:function (){ + 'step 0' + game.delayx(); + 'step 1' + var target=player.storage.ns_chuanshu2; + player.line(target,'green'); + //target.addSkill('ns_chuanshu'); + target.restoreSkill('ns_chuanshu'); + target.update(); + }, + forced:true, + popup:false, + }, + ns_xiuzheng:{ + audio:["xinsheng",2], + enable:"phaseUse", + usable:1, + priority:10, + filter:function (event,player){ + return (ui.cardPile.childElementCount+ui.discardPile.childElementCount)>=2; + }, + filterTarget:function (card,player,target){ + return player!=target; + }, + content:function (){ + "step 0" + event.cards=get.cards(2); + player.showCards(event.cards); + "step 1" + if(get.color(event.cards[0])=='red'&&get.color(event.cards[1])=='red'){ + target.damage('fire'); + } + if(get.color(event.cards[0])!=get.color(event.cards[1])){ + player.discardPlayerCard(target,"he",true); + } + if(get.color(event.cards[0])=='black'&&get.color(event.cards[1])=='black'){ + target.damage('thunder'); + } + "step 2" + if(event.cards.length){ + player.gain(event.cards,'gain2'); + game.delay(); + } + "step 3" + player.chooseToDiscard(2,'he','请弃置两张牌',true); + }, + ai:{ + threaten:0.5, + order:13, + result:{ + target:function (player,target){ + return get.damageEffect(target,player); + }, + }, + }, + }, nsanruo:{ unique:true, init:function(player){ @@ -3322,13 +3320,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, liangji:{ - audio:["liangji",2], - enable:"phaseUse", - usable:1, - filterTarget:function (card,player,target){ + audio:["liangji",2], + enable:"phaseUse", + usable:1, + filterTarget:function (card,player,target){ return target!=player; }, - content:function (){ + content:function (){ 'step 0' player.chooseCard('h','环计:将1张牌置于'+get.translation(target)+'的武将牌上',true).set('ai',function(card){ if(get.attitude(_status.event.player,_status.event.getParent().player)>0){ @@ -3346,63 +3344,62 @@ game.import('character',function(lib,game,ui,get,ai,_status){ target.addSkill('liangji_1'); } }, - ai:{ - order:1, - result:{ - target:function (player,target){ + ai:{ + order:1, + result:{ + target:function (player,target){ if(get.attitude(player,target)>0){ return Math.sqrt(target.countCards('he')); } return 0; }, - player:1, - }, - }, - subSkill:{ - "1":{ - trigger:{ - player:"phaseDrawBegin", - }, - forced:true, - mark:true, - intro:{ - content:"cards", - }, - content:function (){ - 'step 0' - var cards=player.storage.liangji_1; - if(cards){ - player.gain(cards,'gain2'); - } - player.storage.liangji_1=0; - - 'step 1' - if(player.sex=='male')player.addTempSkill('wushuang'); - if(player.sex=='female')player.addTempSkill('lijian'); - player.removeSkill('liangji_1'); + player:1, }, + }, + subSkill:{ + "1":{ + trigger:{ + player:"phaseDrawBegin", + }, + forced:true, + mark:true, + intro:{ + content:"cards", + }, + content:function (){ + 'step 0' + var cards=player.storage.liangji_1; + if(cards){ + player.gain(cards,'gain2'); + } + player.storage.liangji_1=0; + 'step 1' + if(player.sex=='male')player.addTempSkill('wushuang'); + if(player.sex=='female')player.addTempSkill('lijian'); + player.removeSkill('liangji_1'); + }, sub:true, }, }, }, jugong:{ - audio:["jingong",2], - trigger:{ - global:"damageEnd", - }, - usable:1, - frequent:true, - locked:false, - notemp:true, - marktext:"功", - init:function (player){ + audio:["jingong",2], + trigger:{ + global:"damageEnd", + }, + usable:1, + frequent:true, + locked:false, + notemp:true, + marktext:"功", + init:function (player){ player.storage.jugong=[]; }, - filter:function (event,player){ - return event.card&&(event.card.name=='sha'||event.card.name=='juedou')&&event.notLink() + filter:function (event,player){ + return event.card&&(event.card.name=='sha'||event.card.name=='juedou')&&event.notLink() &&_status.currentPhase!=player; }, - content:function (){ + content:function (){ "step 0" player.draw(); "step 1" @@ -3421,17 +3418,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ game.log(player,'将',result.cards,'置于武将牌上作为“功”'); } }, - intro:{ - content:"cards", - }, - group:"jugong_1", - subSkill:{ - "1":{ - trigger:{ - player:"damageBegin", - }, - filter:function (event,player){ - return player.storage.jugong.length>1; + intro:{ + content:"cards", + }, + group:"jugong_1", + subSkill:{ + "1":{ + trigger:{ + player:"damageBegin", + }, + filter:function (event,player){ + return player.storage.jugong.length>1; }, content:function (){ "step 0" @@ -3446,24 +3443,25 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.syncStorage('jugong'); if(!player.storage.jugong.length){ player.unmarkSkill('jugong'); - } - else{ - player.markSkill('jugong'); - } - player.$throw(links); - game.log(player,'被移去了',links); - for(var i=0;i0; - }, - content:function (){ + audio:["moucheng",2], + trigger:{ + player:"phaseDrawBegin", + }, + frequent:true, + filter:function (event,player){ + return player.storage.jugong.length>0; + }, + content:function (){ 'step 0' if(player.storage.jugong.length>2) player.loseHp(); 'step 1' - var cards=player.storage.jugong; - if(cards){ - player.gain(cards,'gain2'); - } - player.storage.jugong=[]; + var cards=player.storage.jugong; + if(cards){ + player.gain(cards,'gain2'); + } + player.storage.jugong=[]; 'step 2' - trigger.cancel(); - }, + trigger.cancel(); + }, }, nsxinsheng:{ trigger:{source:'damageEnd'}, @@ -4813,20 +4811,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ns_liuzhang:'刘璋', ns_xinnanhua:'南华老仙', - ns_chuanshu:'传术', - ns_chuanshu_info:'限定技 当一名其他角色进入濒死状态时,你可以令其选择获得技能【雷击】或【鬼道】,其回复体力至1并摸两张牌。当该被【传术】的角色造成或受到一次伤害后,你摸一张牌。其阵亡后,你重置技能【传术】', - ns_xiandao1:'仙道', - ns_xiandao1_info:'锁定技 游戏开始和回合结束阶段,你随机获得技能【雷击】或【鬼道】,直到下个出牌阶段开始', - ns_xiandao2:'仙道', - ns_xiandao2_info:'锁定技 你防止受到任何属性伤害', - ns_xiandao:'仙道', - ns_xiandao_info:'锁定技 游戏开始、你进入游戏时和回合结束阶段,你随机获得技能【雷击】或【鬼道】,直到下个出牌阶段阶段开始。你防止受到任何属性伤害', - ns_chuanshu2:'术', - ns_chuanshu2_info:'锁定技 当你造成或受到一次伤害后,南华老仙摸一张牌', - ns_chuanshu3:'术', - ns_chuanshu3_info:'锁定技 当你【传术】的角色阵亡后,你重置技能【传术】', - ns_xiuzheng:'修真', - ns_xiuzheng_info:'出牌阶段限一次,你可选择一名其他角色,然后展示牌堆顶的两张牌,若同为红色,则其受到一点火焰伤害;若同为黑色,其受到一点雷电伤害;若颜色不相同,你弃置其一张牌。然后你获得这两张展示的牌后再弃置两张牌', + ns_chuanshu:'传术', + ns_chuanshu_info:'限定技 当一名其他角色进入濒死状态时,你可以令其选择获得技能【雷击】或【鬼道】,其回复体力至1并摸两张牌。当该被【传术】的角色造成或受到一次伤害后,你摸一张牌。其阵亡后,你重置技能【传术】', + ns_xiandao1:'仙道', + ns_xiandao1_info:'锁定技 游戏开始和回合结束阶段,你随机获得技能【雷击】或【鬼道】,直到下个出牌阶段开始', + ns_xiandao2:'仙道', + ns_xiandao2_info:'锁定技 你防止受到任何属性伤害', + ns_xiandao:'仙道', + ns_xiandao_info:'锁定技 游戏开始、你进入游戏时和回合结束阶段,你随机获得技能【雷击】或【鬼道】,直到下个出牌阶段阶段开始。你防止受到任何属性伤害', + ns_chuanshu2:'术', + ns_chuanshu2_info:'锁定技 当你造成或受到一次伤害后,南华老仙摸一张牌', + ns_chuanshu3:'术', + ns_chuanshu3_info:'锁定技 当你【传术】的角色阵亡后,你重置技能【传术】', + ns_xiuzheng:'修真', + ns_xiuzheng_info:'出牌阶段限一次,你可选择一名其他角色,然后展示牌堆顶的两张牌,若同为红色,则其受到一点火焰伤害;若同为黑色,其受到一点雷电伤害;若颜色不相同,你弃置其一张牌。然后你获得这两张展示的牌后再弃置两张牌', nsanruo:'暗弱', nsanruo_info:'锁定技,你手牌中的[杀]和普通锦囊牌(借刀杀人等带有指向目标的锦囊除外)均对你不可见。但你可以正常使用之', nsxunshan:'循善', @@ -4946,11 +4944,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ yiesheng:'回雪', yiesheng_info:'出牌阶段,你可以弃置任意数量的黑色手牌,然后摸等量的牌。', liangji:'环计', - liangji_info:'出牌阶段限一次,你可以选择一名其他角色并将一张手牌置于其武将牌上。目标角色于摸牌阶段开始时,获得此牌。若其为男性角色,则获得技能【无双】,若其为女性角色,则获得技能【离间】,直到回合结束。', - chengmou:'逞谋', - chengmou_info:'摸牌阶段开始时,若你有“功”牌,你获得之并跳过摸牌阶段,若你所获得的“功”牌多于两张,你须失去一点体力。', - jugong:'居功', - jugong_info:'回合外每名角色的回合限一次,每当场上有角色因受到【杀】或【决斗】造成的伤害,你可以摸一张牌并且将一张手牌置于你的武将牌上,称之为“功”。在你即将受到伤害时,你可以弃置两张“功”,防止此伤害。', + liangji_info:'出牌阶段限一次,你可以选择一名其他角色并将一张手牌置于其武将牌上。目标角色于摸牌阶段开始时,获得此牌。若其为男性角色,则获得技能【无双】,若其为女性角色,则获得技能【离间】,直到回合结束。', + chengmou:'逞谋', + chengmou_info:'摸牌阶段开始时,若你有“功”牌,你获得之并跳过摸牌阶段,若你所获得的“功”牌多于两张,你须失去一点体力。', + jugong:'居功', + jugong_info:'回合外每名角色的回合限一次,每当场上有角色因受到【杀】或【决斗】造成的伤害,你可以摸一张牌并且将一张手牌置于你的武将牌上,称之为“功”。在你即将受到伤害时,你可以弃置两张“功”,防止此伤害。', nsxinsheng:'新生', nsxinsheng_info:'每当你对其他角色造成伤害后,若你未受伤,则你可以增加X点体力上限并摸X张牌,X为伤害点数', nsdunxing:'遁形', diff --git a/character/extra.js b/character/extra.js index c927d2624..dde31b09c 100755 --- a/character/extra.js +++ b/character/extra.js @@ -47,26 +47,26 @@ game.import('character',function(lib,game,ui,get,ai,_status){ source.markSkill('new_wuhun_mark'); }, contentx:function (){ - "step 0" - var num=0; - for(var i=0;inum){ - num=current.storage.new_wuhun_mark; - } - } - player.chooseTarget(true,'请选择【武魂】的目标',function(card,player,target){ - return target!=player&&target.storage.new_wuhun_mark==num; - }).set('ai',function(target){ - return -get.attitude(_status.event.player,target); - }).set('forceDie',true); - "step 1" - if(result.bool&&result.targets&&result.targets.length){ - var target=result.targets[0]; - event.target=target; - player.logSkill('new_wuhun_die',target); - player.line(target,{color:[255, 255, 0]}); - game.delay(2); + "step 0" + var num=0; + for(var i=0;inum){ + num=current.storage.new_wuhun_mark; + } + } + player.chooseTarget(true,'请选择【武魂】的目标',function(card,player,target){ + return target!=player&&target.storage.new_wuhun_mark==num; + }).set('ai',function(target){ + return -get.attitude(_status.event.player,target); + }).set('forceDie',true); + "step 1" + if(result.bool&&result.targets&&result.targets.length){ + var target=result.targets[0]; + event.target=target; + player.logSkill('new_wuhun_die',target); + player.line(target,{color:[255, 255, 0]}); + game.delay(2); } "step 2" target.judge(function(card){ @@ -94,10 +94,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function (){ "step 0" - var next=game.createEvent('new_wuhun',null,trigger.parent); - next.forceDie=true; - next.player=player; - next.setContent(lib.skill.new_wuhun.contentx); + var next=game.createEvent('new_wuhun',null,trigger.parent); + next.forceDie=true; + next.player=player; + next.setContent(lib.skill.new_wuhun.contentx); }, sub:true, }, @@ -248,7 +248,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ game.delay(0.5); if(event.targets.length) event.goto(2); "step 5" - player.turnOver(); + player.turnOver(); }, ai:{ combo:'baonu', @@ -870,33 +870,33 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, wuhun:{ trigger:{ - player:"damageEnd", - }, - // alter:true, - filter:function (event,player){ - if(event.source==undefined) return false - if(!get.is.altered('wuhun')) return false - return true; - }, - forced:true, - content:function (){ - if(!trigger.source.storage.wuhun_mark){ - trigger.source.storage.wuhun_mark=0; - } - trigger.source.storage.wuhun_mark+=trigger.num; - trigger.source.syncStorage('wuhun_mark'); - trigger.source.markSkill('wuhun_mark'); - }, - global:["wuhun_mark"], - subSkill:{ - mark:{ + player:"damageEnd", + }, + //alter:true, + filter:function (event,player){ + if(event.source==undefined) return false + if(!get.is.altered('wuhun')) return false + return true; + }, + forced:true, + content:function (){ + if(!trigger.source.storage.wuhun_mark){ + trigger.source.storage.wuhun_mark=0; + } + trigger.source.storage.wuhun_mark+=trigger.num; + trigger.source.syncStorage('wuhun_mark'); + trigger.source.markSkill('wuhun_mark'); + }, + global:["wuhun_mark"], + subSkill:{ + mark:{ marktext:"魇", - intro:{ + intro:{ content:"mark", - }, - sub:true, - }, - }, + }, + sub:true, + }, + }, group:["wuhun2","wuhun4","wuhun5"], }, wuhun2:{ @@ -907,7 +907,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ popup:false, filter:function (event,player){ for(var i=0;itarget.storage.wuhun_mark){ - return false; + if(game.players[i].storage.wuhun_mark>target.storage.wuhun_mark){ + return false; } } return true; @@ -1851,683 +1851,677 @@ game.import('character',function(lib,game,ui,get,ai,_status){ expose:0.4, } }, - "nzry_longnu":{ - mark:true, - locked:true, - marktext:'龙', - intro:{ - content:function(storage,player,skill){ - if(player.storage.nzry_longnu==true) return '锁定技,出牌阶段开始时,你减1点体力上限并摸一张牌,然后本回合你的锦囊牌均视为雷杀且无使用次数限制'; - return '锁定技,出牌阶段开始时,你流失一点体力并摸一张牌,然后本回合你的红色手牌均视为火杀且无距离限制'; - }, - }, - audio:2, - trigger:{ - player:'phaseUseBegin' - }, - forced:true, - content:function(){ - if(player.storage.nzry_longnu==true){ - player.storage.nzry_longnu=false; - player.loseMaxHp(); - player.draw(); - player.addTempSkill('nzry_longnu_2',{player:'phaseAfter'}); - }else{ - player.storage.nzry_longnu=true; - player.loseHp(); - player.draw(); - player.addTempSkill('nzry_longnu_1',{player:'phaseAfter'}); - }; - }, - subSkill:{ - '1':{ - mod:{ - cardEnabled:function(card,player){ - if(_status.event.skill!='nzry_longnu_1'&&(card.name!='sha'||card.nature!='fire')&&get.color(card)=='red') return false; - }, - cardUsable:function(card,player){ - if(_status.event.skill!='nzry_longnu_1'&&(card.name!='sha'||card.nature!='fire')&&get.color(card)=='red') return false; - }, - cardRespondable:function(card,player){ - if(_status.event.skill!='nzry_longnu_1'&&(card.name!='sha'||card.nature!='fire')&&get.color(card)=='red') return false; - }, - cardSavable:function(card,player){ - if(_status.event.skill!='nzry_longnu_1'&&(card.name!='sha'||card.nature!='fire')&&get.color(card)=='red') return false; - }, - targetInRange:function(card){ - if((card.name=='sha'&&card.nature=='fire')||_status.event.skill=='nzry_longnu_1') return true; - }, - }, - prompt:'本回合你的红色手牌均视为火杀且无距离限制', - enable:['chooseToUse','chooseToRespond'], - filterCard:{color:'red'}, - viewAs:{name:'sha',nature:'fire'}, - check:function(){return 1}, - ai:{ - effect:{ - target:function(card,player,target,current){ - if(get.tag(card,'respondSha')&¤t<0) return 0.6 - } - }, - respondSha:true, - order:4, - useful:-1, - value:-1 - }, - }, - '2':{ - prompt:'本回合你的锦囊牌均视为雷杀且无使用次数限制', - mod:{ - cardEnabled:function(card,player){ - if(_status.event.skill!='nzry_longnu_2'&&get.type(card,'trick')=='trick') return false; - }, - cardUsable:function(card,player){ - if(_status.event.skill!='nzry_longnu_2'&&get.type(card,'trick')=='trick') return false; - }, - cardRespondable:function(card,player){ - if(_status.event.skill!='nzry_longnu_2'&&get.type(card,'trick')=='trick') return false; - }, - cardSavable:function(card,player){ - if(_status.event.skill!='nzry_longnu_2'&&get.type(card,'trick')=='trick') return false; - }, - cardUsable:function(card,player){ - if(card.name=='sha'&&card.nature=='thunder') return Infinity; - }, - }, - enable:['chooseToUse','chooseToRespond'], - filterCard:function(card){ - return get.type(card,'trick')=='trick'; - }, - viewAs:{name:'sha',nature:'thunder'}, - check:function(){return 1}, - ai:{ - effect:{ - target:function(card,player,target,current){ - if(get.tag(card,'respondSha')&¤t<0) return 0.6 - } - }, - respondSha:true, - order:4, - useful:-1, - value:-1 - }, - }, - }, + mark:true, + locked:true, + marktext:'龙', + intro:{ + content:function(storage,player,skill){ + if(player.storage.nzry_longnu==true) return '锁定技,出牌阶段开始时,你减1点体力上限并摸一张牌,然后本回合你的锦囊牌均视为雷杀且无使用次数限制'; + return '锁定技,出牌阶段开始时,你流失一点体力并摸一张牌,然后本回合你的红色手牌均视为火杀且无距离限制'; }, - "nzry_jieying":{ - audio:2, - locked:true, - global:"g_nzry_jieying", + }, + audio:2, + trigger:{ + player:'phaseUseBegin' + }, + forced:true, + content:function(){ + if(player.storage.nzry_longnu==true){ + player.storage.nzry_longnu=false; + player.loseMaxHp(); + player.draw(); + player.addTempSkill('nzry_longnu_2',{player:'phaseAfter'}); + }else{ + player.storage.nzry_longnu=true; + player.loseHp(); + player.draw(); + player.addTempSkill('nzry_longnu_1',{player:'phaseAfter'}); + }; + }, + subSkill:{ + '1':{ + mod:{ + cardEnabled:function(card,player){ + if(_status.event.skill!='nzry_longnu_1'&&(card.name!='sha'||card.nature!='fire')&&get.color(card)=='red') return false; + }, + cardUsable:function(card,player){ + if(_status.event.skill!='nzry_longnu_1'&&(card.name!='sha'||card.nature!='fire')&&get.color(card)=='red') return false; + }, + cardRespondable:function(card,player){ + if(_status.event.skill!='nzry_longnu_1'&&(card.name!='sha'||card.nature!='fire')&&get.color(card)=='red') return false; + }, + cardSavable:function(card,player){ + if(_status.event.skill!='nzry_longnu_1'&&(card.name!='sha'||card.nature!='fire')&&get.color(card)=='red') return false; + }, + targetInRange:function(card){ + if((card.name=='sha'&&card.nature=='fire')||_status.event.skill=='nzry_longnu_1') return true; + }, + }, + prompt:'本回合你的红色手牌均视为火杀且无距离限制', + enable:['chooseToUse','chooseToRespond'], + filterCard:{color:'red'}, + viewAs:{name:'sha',nature:'fire'}, + check:function(){return 1}, ai:{ effect:{ - target:function(card){ - if(card.name=='tiesuo') return 'zeroplayertarget'; - }, - }, - }, - group:["nzry_jieying_1","nzry_jieying_2"], - subSkill:{ - '1':{ - audio:2, - trigger:{ - player:'linkAfter', - global:'gameDrawAfter', - }, - forced:true, - filter:function (event,player){ - return !player.isLinked(); - }, - content:function(){ - player.link(true); - }, - }, - '2':{ - audio:2, - trigger:{ - player:'phaseEnd', - }, - direct:true, - filter:function(event,player){ - return game.hasPlayer(function(current){ - return current!=player&&!current.isLinked(); - }); - }, - content:function(){ - "step 0" - player.chooseTarget(true,'请选择【结营】的目标',function(card,player,target){ - return target!=player&&!target.isLinked(); - }).ai=function(target){ - return 1+Math.random(); - }; - "step 1" - if(result.bool){ - player.line(result.targets); - player.logSkill('nzry_jieying'); - result.targets[0].link(true); - }else{ - event.finish(); - }; - }, + target:function(card,player,target,current){ + if(get.tag(card,'respondSha')&¤t<0) return 0.6 + } }, + respondSha:true, + order:4, + useful:-1, + value:-1 }, }, - "g_nzry_jieying":{ + '2':{ + prompt:'本回合你的锦囊牌均视为雷杀且无使用次数限制', mod:{ - maxHandcard:function (player,num){ - if(game.countPlayer(function(current){return current.hasSkill('nzry_jieying')})>0&&player.isLinked()) return num+2; + cardEnabled:function(card,player){ + if(_status.event.skill!='nzry_longnu_2'&&get.type(card,'trick')=='trick') return false; + }, + cardUsable:function(card,player){ + if(_status.event.skill!='nzry_longnu_2'&&get.type(card,'trick')=='trick') return false; + }, + cardRespondable:function(card,player){ + if(_status.event.skill!='nzry_longnu_2'&&get.type(card,'trick')=='trick') return false; + }, + cardSavable:function(card,player){ + if(_status.event.skill!='nzry_longnu_2'&&get.type(card,'trick')=='trick') return false; + }, + cardUsable:function(card,player){ + if(card.name=='sha'&&card.nature=='thunder') return Infinity; }, }, + enable:['chooseToUse','chooseToRespond'], + filterCard:function(card){ + return get.type(card,'trick')=='trick'; + }, + viewAs:{name:'sha',nature:'thunder'}, + check:function(){return 1}, + ai:{ + effect:{ + target:function(card,player,target,current){ + if(get.tag(card,'respondSha')&¤t<0) return 0.6 + } + }, + respondSha:true, + order:4, + useful:-1, + value:-1 + }, }, - "nzry_junlve":{ + }, + }, + "nzry_jieying":{ + audio:2, + locked:true, + global:"g_nzry_jieying", + ai:{ + effect:{ + target:function(card){ + if(card.name=='tiesuo') return 'zeroplayertarget'; + }, + }, + }, + group:["nzry_jieying_1","nzry_jieying_2"], + subSkill:{ + '1':{ audio:2, - init:function(player){ - if(!player.storage.nzry_junlve) player.storage.nzry_junlve=0; - }, - marktext:"军", - intro:{ - content:'当前有#个“军略”标记', - }, - mark:true, trigger:{ - player:"damageAfter", - source:"damageAfter", + player:'linkAfter', + global:'gameDrawAfter', }, forced:true, - content:function(){ - if(player==trigger.source){ - player.storage.nzry_junlve+=trigger.num; - game.log(player,'获得了',trigger.num,'个“军略”标记'); - } - if(player==trigger.player){ - player.storage.nzry_junlve+=trigger.num; - game.log(player,'获得了',trigger.num,'个“军略”标记'); - } - player.syncStorage('nzry_junlve'); + filter:function (event,player){ + return !player.isLinked(); }, + content:function(){ + player.link(true); + }, }, - "nzry_cuike":{ + '2':{ audio:2, trigger:{ - player:"phaseUseBegin", + player:'phaseEnd', }, direct:true, - content:function(){ - 'step 0' - if(player.storage.nzry_junlve%2==1){ - player.chooseTarget('是否发动【摧克】来对一名角色造成一点伤害?').ai=function(target){ - return -get.attitude(player,target); - }; - }else if(player.storage.nzry_junlve%2==0){ - player.chooseTarget('是否发动【摧克】来横置一名角色并弃置其区域内的一张牌?').ai=function(target){ - return -get.attitude(player,target); - }; - }else{ - event.finish(); - }; - 'step 1' - if(result.bool){ - player.line(result.targets); - player.logSkill('nzry_cuike'); - if(player.storage.nzry_junlve%2==1){ - result.targets[0].damage(); - }else{ - result.targets[0].link(true); - player.discardPlayerCard(result.targets[0],1,'hej'); - }; - }; - 'step 2' - if(player.storage.nzry_junlve>7){ - player.chooseBool().set('ai',function(){ - return true; - }).set('prompt','是否弃置所有“军略”标记并对所有其他角色造成一点伤害?'); - }else{ - event.finish(); - }; - 'step 3' - if(result.bool){ - player.line(game.players); - player.logSkill('nzry_cuike'); - player.storage.nzry_junlve=0; - player.syncStorage('nzry_junlve'); - game.log(player,'移去了所有“军略”标记'); - for(var i=0;i0; - }, - check:function (event,player){ - var num=game.countPlayer(function(current){return get.attitude(player,current)<0&¤t.isLinked()}); - return player.storage.nzry_junlve>=num&&num==game.countPlayer(function(current){return get.attitude(player,current)<0}); - }, - filterTarget:function(card,player,target){ - return target.isLinked(); - }, - selectTarget:function(){ - return [1,_status.event.player.storage.nzry_junlve]; - }, - multiline:true, - multitarget:true, - content:function (){ - 'step 0' - player.awakenSkill('nzry_dinghuo'); - player.storage.nzry_dinghuo=true; - /*player.chooseTarget([0,player.storage.nzry_junlve],'请选择【绽火】的目标',function(card,player,target){ - return target.isLinked(); - }).ai=function(target){ - return -get.attitude(player,target); - };*/ - 'step 1' - player.storage.nzry_junlve=0; - player.syncStorage('nzry_junlve'); - game.log(player,'移去了所有“军略”标记'); - for(var i=0;i0){ - player.chooseControl(event.skills).set('prompt','请选择要获得的技能').set('ai',function(){return event.skills.randomGet()}); - } - else event.finish(); - 'step 2' - player.addTempSkill(result.control,{player:'dieAfter'}); - player.popup(result.control,'thunder'); - player.storage.drlt_duorui=[result.control]; - player.storage.drlt_duorui_player=trigger.player; - trigger.player.storage.drlt_duorui=[result.control]; - trigger.player.addTempSkill('drlt_duorui1',{player:'phaseAfter'}); - game.log(player,'获得了技能','#g【'+get.translation(result.control)+'】') - }, - group:['duorui_clear'], - }, - "duorui_clear":{ - trigger:{global:['phaseAfter','dieAfter'],}, - filter:function(event,player){ - if(!player.storage.drlt_duorui_player||!player.storage.drlt_duorui) return false; - return player.storage.drlt_duorui_player==event.player&&player.storage.drlt_duorui.length; - }, - silent:true, - forced:true, - popup:false, - content:function(){ - player.removeSkill(player.storage.drlt_duorui[0]); - delete player.storage.drlt_duorui_player; - player.storage.drlt_duorui=[]; - }, - }, - "drlt_duorui1":{ - init:function(player,skill){ - player.disableSkill(skill,player.storage.drlt_duorui); - }, - onremove:function(player,skill){ - "step 0" - player.enableSkill(skill); - "step 1" - delete player.storage.drlt_duorui; - }, - locked:true, - mark:true, - intro:{ - content:function(storage,player,skill){ - var list=[]; - for(var i in player.disabledSkills){ - if(player.disabledSkills[i].contains(skill)) list.push(i); - }; - if(list.length){ - var str='失效技能:'; - for(var i=0;i0; - }, - content:function(){ - player.chooseToEnable(); - }, - }, - '2':{ - audio:"drlt_zhiti", - trigger:{ - player:'juedouAfter', - }, - forced:true, - filter:function(event,player){ - return event.turn!=player&&player.storage.disableEquip!=undefined&&player.storage.disableEquip.length>0; - }, - content:function(){ - player.chooseToEnable(); - }, - }, - '3':{ - audio:"drlt_zhiti", - trigger:{ - player:'chooseToCompareAfter' - }, - forced:true, - filter:function(event,player){ - return event.result.bool==true&&player.storage.disableEquip!=undefined&&player.storage.disableEquip.length>0; - }, - content:function(){ - 'step 0' - player.chooseToEnable(); - }, - }, - '4':{ - audio:"drlt_zhiti", - trigger:{ - global:'chooseToCompareAfter' - }, - forced:true, - filter:function(event,player){ - return (event.targets!=undefined&&event.targets.contains(player)||event.target==player)&&event.result.bool==false&&player.storage.disableEquip!=undefined&&player.storage.disableEquip.length>0; - }, - content:function(){ - player.chooseToEnable(); - }, - }, - '5':{ - audio:"drlt_zhiti", - trigger:{ - player:['damageEnd'] - }, - forced:true, - filter:function(event,player){ - return player.storage.disableEquip!=undefined&&player.storage.disableEquip.length>0; - }, - content:function(){ - player.chooseToEnable(); - }, - }, - }, - }, - "_drlt_zhiti":{ - mod:{ - maxHandcard:function (player,num){ - if(player.maxHp>player.hp&&game.countPlayer(function(current){return current!=player&¤t.hasSkill('drlt_zhiti')&&get.distance(current,player,'attack')<=1})) return num-1; - }, - }, - }, - 'drlt_poxi':{ - audio:2, - enable:'phaseUse', - usable:1, - filterTarget:function(card,player,target){ - //return target!=player&&target.countCards('h')>0; - return target!=player; - }, - content:function(){ - 'step 0' - event.list1=[]; - event.list2=[]; - if(target.countCards('h')>0){ - var chooseButton=player.chooseButton(4,'hidden',['你的手牌',player.getCards('h'),get.translation(target.name)+'的手牌',target.getCards('h'),'hidden']); - }else{ - var chooseButton=player.chooseButton(4,'hidden',['你的手牌',player.getCards('h'),'hidden']); - } - chooseButton.set('ai',function(button){ - //if(button.link.name=='du') return 1; - return 0; - }); - chooseButton.filterButton=function(button){ - for(var i=0;i0) - return 0.1; - if(get.attitude(player,target)<1&&(target.isTurnedOver()||target.countCards('h')<1)) - return 0.2; - if(get.attitude(player,target)<1&&target.countCards('h')>0&&target.countCards('j',{name:'lebu'})>0) - return target.countCards('h')*0.8+target.getHandcardLimit()*0.7+2; - if(get.attitude(player,target)<1&&target.countCards('h')>0) - return target.countCards('h')*0.8+target.getHandcardLimit()*0.7; - return 1; - }; - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.line(target); - player.logSkill('drlt_jieying',target); - target.addSkill('drlt_jieying_mark'); - }; - }, - }, - '3':{ - audio:'drlt_jieying', - trigger:{ - global:'phaseAfter', - }, - forced:true, - filter:function(event,player){ - return player!=event.player&&event.player.hasSkill('drlt_jieying_mark')&&event.player.isAlive(); - }, - logTarget:'player', - content:function(){ - if(trigger.player.countCards('h')>0){ - trigger.player.give(trigger.player.getCards('h'),player); - } - trigger.player.removeSkill('drlt_jieying_mark'); - }, - }, + }, + }, + "g_nzry_jieying":{ + mod:{ + maxHandcard:function (player,num){ + if(game.countPlayer(function(current){return current.hasSkill('nzry_jieying')})>0&&player.isLinked()) return num+2; + }, + }, + }, + "nzry_junlve":{ + audio:2, + init:function(player){ + if(!player.storage.nzry_junlve) player.storage.nzry_junlve=0; + }, + marktext:"军", + intro:{ + content:'当前有#个“军略”标记', + }, + mark:true, + trigger:{ + player:"damageAfter", + source:"damageAfter", + }, + forced:true, + content:function(){ + if(player==trigger.source){ + player.storage.nzry_junlve+=trigger.num; + game.log(player,'获得了',trigger.num,'个“军略”标记'); + } + if(player==trigger.player){ + player.storage.nzry_junlve+=trigger.num; + game.log(player,'获得了',trigger.num,'个“军略”标记'); + } + player.syncStorage('nzry_junlve'); + }, + }, + "nzry_cuike":{ + audio:2, + trigger:{ + player:"phaseUseBegin", + }, + direct:true, + content:function(){ + 'step 0' + if(player.storage.nzry_junlve%2==1){ + player.chooseTarget('是否发动【摧克】来对一名角色造成一点伤害?').ai=function(target){ + return -get.attitude(player,target); + }; + }else if(player.storage.nzry_junlve%2==0){ + player.chooseTarget('是否发动【摧克】来横置一名角色并弃置其区域内的一张牌?').ai=function(target){ + return -get.attitude(player,target); + }; + }else{ + event.finish(); + }; + 'step 1' + if(result.bool){ + player.line(result.targets); + player.logSkill('nzry_cuike'); + if(player.storage.nzry_junlve%2==1){ + result.targets[0].damage(); + }else{ + result.targets[0].link(true); + player.discardPlayerCard(result.targets[0],1,'hej'); + }; + }; + 'step 2' + if(player.storage.nzry_junlve>7){ + player.chooseBool().set('ai',function(){ + return true; + }).set('prompt','是否弃置所有“军略”标记并对所有其他角色造成一点伤害?'); + }else{ + event.finish(); + }; + 'step 3' + if(result.bool){ + player.line(game.players); + player.logSkill('nzry_cuike'); + player.storage.nzry_junlve=0; + player.syncStorage('nzry_junlve'); + game.log(player,'移去了所有“军略”标记'); + for(var i=0;i0; + }, + check:function (event,player){ + var num=game.countPlayer(function(current){return get.attitude(player,current)<0&¤t.isLinked()}); + return player.storage.nzry_junlve>=num&&num==game.countPlayer(function(current){return get.attitude(player,current)<0}); + }, + filterTarget:function(card,player,target){ + return target.isLinked(); + }, + selectTarget:function(){ + return [1,_status.event.player.storage.nzry_junlve]; + }, + multiline:true, + multitarget:true, + content:function (){ + 'step 0' + player.awakenSkill('nzry_dinghuo'); + player.storage.nzry_dinghuo=true; + 'step 1' + player.storage.nzry_junlve=0; + player.syncStorage('nzry_junlve'); + game.log(player,'移去了所有“军略”标记'); + for(var i=0;i0){ + player.chooseControl(event.skills).set('prompt','请选择要获得的技能').set('ai',function(){return event.skills.randomGet()}); + } + else event.finish(); + 'step 2' + player.addTempSkill(result.control,{player:'dieAfter'}); + player.popup(result.control,'thunder'); + player.storage.drlt_duorui=[result.control]; + player.storage.drlt_duorui_player=trigger.player; + trigger.player.storage.drlt_duorui=[result.control]; + trigger.player.addTempSkill('drlt_duorui1',{player:'phaseAfter'}); + game.log(player,'获得了技能','#g【'+get.translation(result.control)+'】') + }, + group:['duorui_clear'], + }, + "duorui_clear":{ + trigger:{global:['phaseAfter','dieAfter'],}, + filter:function(event,player){ + if(!player.storage.drlt_duorui_player||!player.storage.drlt_duorui) return false; + return player.storage.drlt_duorui_player==event.player&&player.storage.drlt_duorui.length; + }, + silent:true, + forced:true, + popup:false, + content:function(){ + player.removeSkill(player.storage.drlt_duorui[0]); + delete player.storage.drlt_duorui_player; + player.storage.drlt_duorui=[]; + }, + }, + "drlt_duorui1":{ + init:function(player,skill){ + player.disableSkill(skill,player.storage.drlt_duorui); + }, + onremove:function(player,skill){ + "step 0" + player.enableSkill(skill); + "step 1" + delete player.storage.drlt_duorui; + }, + locked:true, + mark:true, + intro:{ + content:function(storage,player,skill){ + var list=[]; + for(var i in player.disabledSkills){ + if(player.disabledSkills[i].contains(skill)) list.push(i); + }; + if(list.length){ + var str='失效技能:'; + for(var i=0;i0; + }, + content:function(){ + player.chooseToEnable(); }, }, + '2':{ + audio:"drlt_zhiti", + trigger:{ + player:'juedouAfter', + }, + forced:true, + filter:function(event,player){ + return event.turn!=player&&player.storage.disableEquip!=undefined&&player.storage.disableEquip.length>0; + }, + content:function(){ + player.chooseToEnable(); + }, + }, + '3':{ + audio:"drlt_zhiti", + trigger:{ + player:'chooseToCompareAfter' + }, + forced:true, + filter:function(event,player){ + return event.result.bool==true&&player.storage.disableEquip!=undefined&&player.storage.disableEquip.length>0; + }, + content:function(){ + 'step 0' + player.chooseToEnable(); + }, + }, + '4':{ + audio:"drlt_zhiti", + trigger:{ + global:'chooseToCompareAfter' + }, + forced:true, + filter:function(event,player){ + return (event.targets!=undefined&&event.targets.contains(player)||event.target==player)&&event.result.bool==false&&player.storage.disableEquip!=undefined&&player.storage.disableEquip.length>0; + }, + content:function(){ + player.chooseToEnable(); + }, + }, + '5':{ + audio:"drlt_zhiti", + trigger:{ + player:['damageEnd'] + }, + forced:true, + filter:function(event,player){ + return player.storage.disableEquip!=undefined&&player.storage.disableEquip.length>0; + }, + content:function(){ + player.chooseToEnable(); + }, + }, + }, + }, + "_drlt_zhiti":{ + mod:{ + maxHandcard:function (player,num){ + if(player.maxHp>player.hp&&game.countPlayer(function(current){return current!=player&¤t.hasSkill('drlt_zhiti')&&get.distance(current,player,'attack')<=1})) return num-1; + }, + }, + }, + 'drlt_poxi':{ + audio:2, + enable:'phaseUse', + usable:1, + filterTarget:function(card,player,target){ + //return target!=player&&target.countCards('h')>0; + return target!=player; + }, + content:function(){ + 'step 0' + event.list1=[]; + event.list2=[]; + if(target.countCards('h')>0){ + var chooseButton=player.chooseButton(4,'hidden',['你的手牌',player.getCards('h'),get.translation(target.name)+'的手牌',target.getCards('h'),'hidden']); + }else{ + var chooseButton=player.chooseButton(4,'hidden',['你的手牌',player.getCards('h'),'hidden']); + } + chooseButton.set('ai',function(button){ + //if(button.link.name=='du') return 1; + return 0; + }); + chooseButton.filterButton=function(button){ + for(var i=0;i0) + return 0.1; + if(get.attitude(player,target)<1&&(target.isTurnedOver()||target.countCards('h')<1)) + return 0.2; + if(get.attitude(player,target)<1&&target.countCards('h')>0&&target.countCards('j',{name:'lebu'})>0) + return target.countCards('h')*0.8+target.getHandcardLimit()*0.7+2; + if(get.attitude(player,target)<1&&target.countCards('h')>0) + return target.countCards('h')*0.8+target.getHandcardLimit()*0.7; + return 1; + }; + 'step 1' + if(result.bool){ + var target=result.targets[0]; + player.line(target); + player.logSkill('drlt_jieying',target); + target.addSkill('drlt_jieying_mark'); + }; + }, + }, + '3':{ + audio:'drlt_jieying', + trigger:{ + global:'phaseAfter', + }, + forced:true, + filter:function(event,player){ + return player!=event.player&&event.player.hasSkill('drlt_jieying_mark')&&event.player.isAlive(); + }, + logTarget:'player', + content:function(){ + if(trigger.player.countCards('h')>0){ + trigger.player.give(trigger.player.getCards('h'),player); + } + trigger.player.removeSkill('drlt_jieying_mark'); + }, + }, + }, + }, }, translate:{ "shen_luxun":"神陆逊", diff --git a/character/mobile.js b/character/mobile.js index 6f7a16c2a..ffdc1b15e 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -26,19 +26,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ simazhao:["male","wei",3,["xinfu_daigong","xinfu_zhaoxin"],[]], wangyuanji:["female","wei",3,["xinfu_qianchong","xinfu_shangjian"],[]], pangdegong:["male","qun",3,["xinfu_pingcai","xinfu_pdgyingshi"],[]], - re_sp_zhugeliang:["male","shu",3,["rehuoji","rekanpo","bazhen"],[]], - re_xunyu:["male","wei",3,["quhu","rejieming"],[]], - re_dianwei:["male","wei",4,["reqiangxi"],[]], - re_yanwen:["male","qun",4,["reshuangxiong"],[]], - re_pangtong:['male','shu',3,['xinlianhuan','niepan'],[]], - xin_yuanshao:['male','qun',4,['reluanji','xueyi'],['zhu']], - old_caochun:['male','wei',4,['shanjia']], - old_yuanshu:['male','qun',4,['xinyongsi','yjixi']], - }, - characterFilter:{ - }, - skill:{ + re_sp_zhugeliang:["male","shu",3,["rehuoji","rekanpo","bazhen"],[]], + re_xunyu:["male","wei",3,["quhu","rejieming"],[]], + re_dianwei:["male","wei",4,["reqiangxi"],[]], + re_yanwen:["male","qun",4,["reshuangxiong"],[]], + re_pangtong:['male','shu',3,['xinlianhuan','niepan'],[]], + xin_yuanshao:['male','qun',4,['reluanji','xueyi'],['zhu']], + old_caochun:['male','wei',4,['shanjia']], + old_yuanshu:['male','qun',4,['xinyongsi','yjixi']], }, + characterFilter:{}, + skill:{}, translate:{ re_jikang:"新嵇康", old_bulianshi:'新步练师', diff --git a/character/refresh.js b/character/refresh.js index 71535e097..ada8505da 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -39,7 +39,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ re_lidian:'字曼成,曹操麾下将领。李典深明大义,不与人争功,崇尚学习与高贵儒雅,尊重博学之士,在军中被称为长者。李典有长者之风,官至破虏将军,三十六岁去世。魏文帝曹丕继位后追谥号为愍侯。', }, skill:{ - reqiangxi:{ subSkill:{ off:{ @@ -49,39 +48,39 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:"qiangxi", enable:"phaseUse", filterCard:function (card){ - return get.subtype(card)=='equip1'; - }, + return get.subtype(card)=='equip1'; + }, selectCard:function (){ - return [0,1]; - }, + return [0,1]; + }, filterTarget:function (card,player,target){ - if(player==target) return false; - if(target.hasSkill('reqiangxi_off')) return false; - return get.distance(player,target,'attack')<=1; - }, + if(player==target) return false; + if(target.hasSkill('reqiangxi_off')) return false; + return get.distance(player,target,'attack')<=1; + }, content:function (){ - "step 0" - if(cards.length==0){ - player.loseHp(); - } - "step 1" - target.addTempSkill('reqiangxi_off'); - target.damage('nocard'); - }, + "step 0" + if(cards.length==0){ + player.loseHp(); + } + "step 1" + target.addTempSkill('reqiangxi_off'); + target.damage('nocard'); + }, check:function (card){ - return 10-get.value(card); - }, + return 10-get.value(card); + }, position:"he", ai:{ order:8.5, result:{ target:function (player,target){ - if(!player.countCards('he',{type:'equip'})){ - if(player.hp<2) return 0; - if(target.hp>=player.hp) return 0; - } - return get.damageEffect(target,player); - }, + if(!player.countCards('he',{type:'equip'})){ + if(player.hp<2) return 0; + if(target.hp>=player.hp) return 0; + } + return get.damageEffect(target,player); + }, }, }, threaten:1.5, @@ -91,23 +90,23 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:"huoji", enable:"chooseToUse", filterCard:function (card){ - return get.color(card)=='red'; - }, + return get.color(card)=='red'; + }, viewAs:{ name:"huogong", nature:"fire", }, viewAsFilter:function (player){ - if(!player.countCards('h',{color:'red'})) return false; - }, + if(!player.countCards('h',{color:'red'})) return false; + }, prompt:"将一张红色牌当火攻使用", check:function (card){ - var player=_status.currentPhase; - if(player.countCards('h')>player.hp){ - return 6-get.value(card); - } - return 4-get.value(card) - }, + var player=_status.currentPhase; + if(player.countCards('h')>player.hp){ + return 6-get.value(card); + } + return 4-get.value(card) + }, ai:{ basic:{ order:4, @@ -115,41 +114,41 @@ game.import('character',function(lib,game,ui,get,ai,_status){ useful:1, }, wuxie:function (target,card,player,current,state){ - if(get.attitude(current,player)>=0&&state>0) return false; - }, + if(get.attitude(current,player)>=0&&state>0) return false; + }, result:{ player:function (player){ - var nh=player.countCards('h'); - if(nh<=player.hp&&nh<=4&&_status.event.name=='chooseToUse'){ - if(typeof _status.event.filterCard=='function'&& - _status.event.filterCard({name:'huogong'})){ - return -10; - } - if(_status.event.skill){ - var viewAs=get.info(_status.event.skill).viewAs; - if(viewAs=='huogong') return -10; - if(viewAs&&viewAs.name=='huogong') return -10; - } - } - return 0; - }, + var nh=player.countCards('h'); + if(nh<=player.hp&&nh<=4&&_status.event.name=='chooseToUse'){ + if(typeof _status.event.filterCard=='function'&& + _status.event.filterCard({name:'huogong'})){ + return -10; + } + if(_status.event.skill){ + var viewAs=get.info(_status.event.skill).viewAs; + if(viewAs=='huogong') return -10; + if(viewAs&&viewAs.name=='huogong') return -10; + } + } + return 0; + }, target:function (player,target){ - if(target.hasSkill('huogong2')||target.countCards('h')==0) return 0; - if(player.countCards('h')<=1) return 0; - if(target==player){ - if(typeof _status.event.filterCard=='function'&& - _status.event.filterCard({name:'huogong'})){ - return -1.5; - } - if(_status.event.skill){ - var viewAs=get.info(_status.event.skill).viewAs; - if(viewAs=='huogong') return -1.5; - if(viewAs&&viewAs.name=='huogong') return -1.5; - } - return 0; - } - return -1.5; - }, + if(target.hasSkill('huogong2')||target.countCards('h')==0) return 0; + if(player.countCards('h')<=1) return 0; + if(target==player){ + if(typeof _status.event.filterCard=='function'&& + _status.event.filterCard({name:'huogong'})){ + return -1.5; + } + if(_status.event.skill){ + var viewAs=get.info(_status.event.skill).viewAs; + if(viewAs=='huogong') return -1.5; + if(viewAs&&viewAs.name=='huogong') return -1.5; + } + return 0; + } + return -1.5; + }, }, tag:{ damage:1, @@ -164,11 +163,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ position:"he", enable:"chooseToUse", filterCard:function (card){ - return get.color(card)=='black'; - }, + return get.color(card)=='black'; + }, viewAsFilter:function (player){ - return player.countCards('he',{color:'black'})>0; - }, + return player.countCards('he',{color:'black'})>0; + }, viewAs:{ name:"wuxie", }, @@ -193,56 +192,56 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, direct:true, content:function (){ - "step 0" - event.count=trigger.num; - "step 1" - player.chooseTarget(get.prompt('rejieming')).set('ai',function(target){ - var att=get.attitude(_status.event.player,target); - if(att>2){ - if((target.maxHp-target.countCards('h'))>2) return 2*att; - return att; - } - return att/3; - }); - "step 2" - if(result.bool){ - event.current=result.targets[0]; - player.logSkill('rejieming',event.current); - player.line(event.current,'thunder'); - event.current.draw(2); - event.count--; - } - else event.finish(); - "step 3" - if(event.current.countCards('h')0) event.goto(1); - }, + "step 0" + event.count=trigger.num; + "step 1" + player.chooseTarget(get.prompt('rejieming')).set('ai',function(target){ + var att=get.attitude(_status.event.player,target); + if(att>2){ + if((target.maxHp-target.countCards('h'))>2) return 2*att; + return att; + } + return att/3; + }); + "step 2" + if(result.bool){ + event.current=result.targets[0]; + player.logSkill('rejieming',event.current); + player.line(event.current,'thunder'); + event.current.draw(2); + event.count--; + } + else event.finish(); + "step 3" + if(event.current.countCards('h')0) event.goto(1); + }, ai:{ maixie:true, "maixie_hp":true, effect:{ target:function (card,player,target,current){ - if(get.tag(card,'damage')&&target.hp>1){ - if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; - var max=0; - var players=game.filterPlayer(); - for(var i=0;i0){ - max=Math.max(Math.min(5,players[i].hp)-players[i].countCards('h'),max); - } - } - switch(max){ - case 0:return 2; - case 1:return 1.5; - case 2:return [1,2]; - default:return [0,max]; - } - } - if((card.name=='tao'||card.name=='caoyao')&& - target.hp>1&&target.countCards('h')<=target.hp) return [0,0]; - }, + if(get.tag(card,'damage')&&target.hp>1){ + if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; + var max=0; + var players=game.filterPlayer(); + for(var i=0;i0){ + max=Math.max(Math.min(5,players[i].hp)-players[i].countCards('h'),max); + } + } + switch(max){ + case 0:return 2; + case 1:return 1.5; + case 2:return [1,2]; + default:return [0,max]; + } + } + if((card.name=='tao'||card.name=='caoyao')&& + target.hp>1&&target.countCards('h')<=target.hp) return [0,0]; + }, }, }, }, @@ -253,61 +252,61 @@ game.import('character',function(lib,game,ui,get,ai,_status){ group:"reshuangxiong2", audio:"shuangxiong", check:function (event,player){ - if(player.countCards('h')>player.hp) return true; - if(player.countCards('h')>3) return true; - return false; - }, + if(player.countCards('h')>player.hp) return true; + if(player.countCards('h')>3) return true; + return false; + }, content:function (){ - "step 0" - trigger.cancel(); - event.cards=get.cards(2); - event.videoId=lib.status.videoId++; - game.broadcastAll(function(player,id,cards){ - var str; - if(player==game.me&&!_status.auto){ - str='【双雄】选择获得其中一张牌'; - } - else{ - str='双雄'; - } - var dialog=ui.create.dialog(str,cards); - dialog.videoId=id; - },player,event.videoId,event.cards); - event.time=get.utc(); - game.addVideo('showCards',player,['双雄',get.cardsInfo(event.cards)]); - game.addVideo('delay',null,2); - "step 1" - var next=player.chooseButton([1,1],true); - next.set('dialog',event.videoId); - next.set('ai',function(button){ - var player=_status.event.player; - var color=get.color(button.link); - var value=get.value(button.link,player); - if(player.countCards('h',{color:color})>player.countCards('h',['red','black'].remove(color)[0])) value+=5; - return value; - }); - "step 2" - if(result.bool&&result.links){ - var cards2=[]; - for(var i=0;i0){ - game.delay(0,time); - } - "step 3" - game.broadcastAll('closeDialog',event.videoId); - var card2=event.card2; - player.gain(card2,'gain2'); - player.addTempSkill('shuangxiong2'); - player.storage.shuangxiong=get.color(card2); - game.delay(); - }, + "step 0" + trigger.cancel(); + event.cards=get.cards(2); + event.videoId=lib.status.videoId++; + game.broadcastAll(function(player,id,cards){ + var str; + if(player==game.me&&!_status.auto){ + str='【双雄】选择获得其中一张牌'; + } + else{ + str='双雄'; + } + var dialog=ui.create.dialog(str,cards); + dialog.videoId=id; + },player,event.videoId,event.cards); + event.time=get.utc(); + game.addVideo('showCards',player,['双雄',get.cardsInfo(event.cards)]); + game.addVideo('delay',null,2); + "step 1" + var next=player.chooseButton([1,1],true); + next.set('dialog',event.videoId); + next.set('ai',function(button){ + var player=_status.event.player; + var color=get.color(button.link); + var value=get.value(button.link,player); + if(player.countCards('h',{color:color})>player.countCards('h',['red','black'].remove(color)[0])) value+=5; + return value; + }); + "step 2" + if(result.bool&&result.links){ + var cards2=[]; + for(var i=0;i0){ + game.delay(0,time); + } + "step 3" + game.broadcastAll('closeDialog',event.videoId); + var card2=event.card2; + player.gain(card2,'gain2'); + player.addTempSkill('shuangxiong2'); + player.storage.shuangxiong=get.color(card2); + game.delay(); + }, }, "reshuangxiong2":{ trigger:{ @@ -317,24 +316,24 @@ game.import('character',function(lib,game,ui,get,ai,_status){ silent:true, popup:false, filter:function (event,player){ - return event.parent.skill=='shuangxiong2'&&event.parent.targetCards.length>0; - }, + return event.parent.skill=='shuangxiong2'&&event.parent.targetCards.length>0; + }, content:function (){ - "step 0" - var cards=trigger.parent.targetCards.slice(0); - for(var i=0;i0){ - return att+Math.max(0,5-target.countCards('h')); - } - return att; - }).set('du',event.card.name=='du').set('same',event.same); + player.chooseTarget('选择获得此牌的角色',true).set('ai',function(target){ + var att=get.attitude(_status.event.player,target); + if(_status.event.du){ + if(target.hasSkillTag('nodu')) return 0; + return -att; + } + if(!_status.event.same) att+=target==_status.event.player?1:0; + if(att>0){ + return att+Math.max(0,5-target.countCards('h')); + } + return att; + }).set('du',event.card.name=='du').set('same',event.same); "step 1" if(result.targets){ player.line(result.targets,'green'); diff --git a/character/shenhua.js b/character/shenhua.js index 2ba4bfc94..b082c555e 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -140,1768 +140,1768 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "chendao":"陈到,字叔至,生卒年不详,豫州汝南(今河南驻马店平舆县)人。三国时期蜀汉将领,刘备帐下白毦兵统领,名位常亚于赵云,以忠勇著称。蜀汉建兴年间,任征西将军、永安都督,封亭侯。在任期间去世。", }, skill:{ - //阴雷 "drlt_zhenrong":{ - init:function (player){ - player.storage.drlt_zhenrong=[]; - }, - marktext:"荣", - intro:{ - content:'cards', - }, - mark:true, - audio:2, - trigger:{ - source:'damageAfter', - }, - filter:function(event,player){ - return event.player!=player&&event.player.countCards('h')>player.countCards('h'); - }, - direct:true, - content:function (){ - 'step 0' - player.choosePlayerCard('hej',get.prompt('drlt_zhenrong'),trigger.player).set('ai',function(button){ - return -get.attitude(player,trigger.player)+1; - }); - 'step 1' - if(result&&result.links&&result.links.length){ - player.line(player,trigger.player); - player.logSkill('drlt_zhenrong'); - player.storage.drlt_zhenrong.push(result.links[0]); - player.syncStorage('drlt_zhenrong'); - trigger.player.lose(result.links[0],ui.special,'toStorage'); - trigger.player.$give(result.links,player); - game.log(player,'将',result.links[0],'置于其武将牌上'); - }; + init:function (player){ + player.storage.drlt_zhenrong=[]; + }, + marktext:"荣", + intro:{ + content:'cards', + }, + mark:true, + audio:2, + trigger:{ + source:'damageAfter', + }, + filter:function(event,player){ + return event.player!=player&&event.player.countCards('h')>player.countCards('h'); + }, + direct:true, + content:function (){ + 'step 0' + player.choosePlayerCard('hej',get.prompt('drlt_zhenrong'),trigger.player).set('ai',function(button){ + return -get.attitude(player,trigger.player)+1; + }); + 'step 1' + if(result&&result.links&&result.links.length){ + player.line(player,trigger.player); + player.logSkill('drlt_zhenrong'); + player.storage.drlt_zhenrong.push(result.links[0]); + player.syncStorage('drlt_zhenrong'); + trigger.player.lose(result.links[0],ui.special,'toStorage'); + trigger.player.$give(result.links,player); + game.log(player,'将',result.links[0],'置于其武将牌上'); + }; + }, + }, + "drlt_hongju":{ + skillAnimation:true, + audio:2, + trigger:{ + player:'phaseBegin', + }, + forced:true, + unique:true, + juexingji:true, + derivation:['drlt_qingce'], + init:function(player){ + player.storage.drlt_hongju=false; + }, + filter:function(event,player){ + return !player.storage.drlt_hongju&&player.storage.drlt_zhenrong&&player.storage.drlt_zhenrong.length>=3&&game.dead.length>0; + }, + content:function(){ + 'step 0' + player.awakenSkill('drlt_hongju'), + player.storage.drlt_hongju=true; + var num=player.storage.drlt_zhenrong.length; + if(num>player.countCards('h')) num=player.countCards('h'); + player.chooseCard('h',[1,num],'请选择需要替换“荣”的手牌').set('ai',function(card){ + return 5-get.value(card); + }); + 'step 1' + if(result.bool){ + event.cards=result.cards; + player.chooseCardButton(player.storage.drlt_zhenrong,result.cards.length,'请选择需要替换的“荣”',true).ai=function(button){ + return 6-get.value(button.link); + }; + }else{ + player.addSkill('drlt_qingce'); + player.loseMaxHp(); + event.finish(); + }; + 'step 2' + if(result.bool){ + var cards=result.links; + for(var i=0;i0; + }, + filterTarget:function(card,player,target){ + return target.countCards('hej')>0; + }, + content:function(){ + 'step 0' + player.chooseCardButton(player.storage.drlt_zhenrong,1,'请选择需要弃置的“荣”',true).ai=function(button){ + return 6-get.value(button.link); + }; + 'step 1' + if(result.bool){ + var cards=result.links; + for(var i=0;i0&&target.countCards('j')>0) return 1; + return -1; }, }, - "drlt_hongju":{ - skillAnimation:true, - audio:2, - trigger:{ - player:'phaseBegin', - }, - forced:true, - unique:true, - juexingji:true, - derivation:['drlt_qingce'], - init:function(player){ - player.storage.drlt_hongju=false; - }, - filter:function(event,player){ - return !player.storage.drlt_hongju&&player.storage.drlt_zhenrong&&player.storage.drlt_zhenrong.length>=3&&game.dead.length>0; - }, - content:function(){ - 'step 0' - player.awakenSkill('drlt_hongju'), - player.storage.drlt_hongju=true; - var num=player.storage.drlt_zhenrong.length; - if(num>player.countCards('h')) num=player.countCards('h'); - player.chooseCard('h',[1,num],'请选择需要替换“荣”的手牌').set('ai',function(card){ - return 5-get.value(card); - }); - 'step 1' - if(result.bool){ - event.cards=result.cards; - player.chooseCardButton(player.storage.drlt_zhenrong,result.cards.length,'请选择需要替换的“荣”',true).ai=function(button){ - return 6-get.value(button.link); - }; - }else{ - player.addSkill('drlt_qingce'); - player.loseMaxHp(); - event.finish(); - }; - 'step 2' - if(result.bool){ - var cards=result.links; - for(var i=0;i0; - }, - filterTarget:function(card,player,target){ - return target.countCards('hej')>0; - }, - content:function(){ - 'step 0' - player.chooseCardButton(player.storage.drlt_zhenrong,1,'请选择需要弃置的“荣”',true).ai=function(button){ - return 6-get.value(button.link); - }; - 'step 1' - if(result.bool){ - var cards=result.links; - for(var i=0;i0&&target.countCards('j')>0) return 1; - return -1; - }, - }, - }, - }, - "drlt_zhenggu":{ - audio:2, - trigger:{ - player:"phaseEnd", - }, - group:["drlt_zhenggu2"], - direct:true, - content:function(){ - "step 0" - player.chooseTarget(get.prompt('drlt_zhenggu'),function(card,player,target){ - return target!=player; - }).ai=function(target){ - var player=_status.event.player; - var num=(Math.min(5,player.countCards('h'))-target.countCards('h')); - var att=get.attitude(player,target); - return num*att; - }; - "step 1" - if(result.bool){ - var target=result.targets[0]; - player.line(target,'thunder'); - player.logSkill('drlt_zhenggu',target); - target.addSkill('drlt_zhenggu2'); - player.storage.drlt_zhenggu1=target; - target.storage.drlt_zhenggu=player; - }else{ - event.finish(); - }; - }, - }, - "drlt_zhenggu2":{ - audio:2, - trigger:{ - player:"phaseAfter", - }, - forced:true, + }, + }, + "drlt_zhenggu":{ + audio:2, + trigger:{ + player:"phaseEnd", + }, + group:["drlt_zhenggu2"], + direct:true, + content:function(){ + "step 0" + player.chooseTarget(get.prompt('drlt_zhenggu'),function(card,player,target){ + return target!=player; + }).ai=function(target){ + var player=_status.event.player; + var num=(Math.min(5,player.countCards('h'))-target.countCards('h')); + var att=get.attitude(player,target); + return num*att; + }; + "step 1" + if(result.bool){ + var target=result.targets[0]; + player.line(target,'thunder'); + player.logSkill('drlt_zhenggu',target); + target.addSkill('drlt_zhenggu2'); + player.storage.drlt_zhenggu1=target; + target.storage.drlt_zhenggu=player; + }else{ + event.finish(); + }; + }, + }, + "drlt_zhenggu2":{ + audio:2, + trigger:{ + player:"phaseAfter", + }, + forced:true, + popup:false, + filter:function(event,player){ + return player.storage.drlt_zhenggu!=undefined||player.storage.drlt_zhenggu1!=undefined; + }, + content:function(){ + if(player.storage.drlt_zhenggu!=undefined){ + player.removeSkill("drlt_zhenggu2"); + var pl=player.storage.drlt_zhenggu; + if(pl.isAlive()){ + var num=Math.min(5,pl.countCards('h')); + var num1=0; + if(num-player.countCards('h')>0) num1=num-player.countCards('h'); + if(num-player.countCards('h')<0) num1=num-player.countCards('h'); + if(num1!=0){ + pl.line(player,'thunder'); + pl.logSkill('drlt_zhenggu',player); + } + if(num1<0) player.chooseToDiscard('h',-num1,true); + if(num1>0) player.draw(num1); + } + delete player.storage.drlt_zhenggu; + }; + if(player.storage.drlt_zhenggu1!=undefined){ + var pl=player.storage.drlt_zhenggu1; + if(pl.isAlive()){ + var num=pl.countCards('h'); + var num1=0; + var num2=Math.min(5,player.countCards('h')); + if(num2-num>0) num1=num2-num; + if(num2-num<0) num1=num2-num; + if(num1<0) pl.chooseToDiscard('h',-num1,true); + if(num1>0) pl.draw(num1); + } + delete player.storage.drlt_zhenggu1; + }; + }, + }, + "xinfu_zuilun":{ + group:["xinfu_zuilun_count"], + subSkill:{ + count:{ + sub:true, + silent:true, popup:false, - filter:function(event,player){ - return player.storage.drlt_zhenggu!=undefined||player.storage.drlt_zhenggu1!=undefined; - }, - content:function(){ - if(player.storage.drlt_zhenggu!=undefined){ - player.removeSkill("drlt_zhenggu2"); - var pl=player.storage.drlt_zhenggu; - if(pl.isAlive()){ - var num=Math.min(5,pl.countCards('h')); - var num1=0; - if(num-player.countCards('h')>0) num1=num-player.countCards('h'); - if(num-player.countCards('h')<0) num1=num-player.countCards('h'); - if(num1!=0){ - pl.line(player,'thunder'); - pl.logSkill('drlt_zhenggu',player); - } - if(num1<0) player.chooseToDiscard('h',-num1,true); - if(num1>0) player.draw(num1); - } - delete player.storage.drlt_zhenggu; - }; - if(player.storage.drlt_zhenggu1!=undefined){ - var pl=player.storage.drlt_zhenggu1; - if(pl.isAlive()){ - var num=pl.countCards('h'); - var num1=0; - var num2=Math.min(5,player.countCards('h')); - if(num2-num>0) num1=num2-num; - if(num2-num<0) num1=num2-num; - if(num1<0) pl.chooseToDiscard('h',-num1,true); - if(num1>0) pl.draw(num1); - } - delete player.storage.drlt_zhenggu1; - }; - }, - }, - "xinfu_zuilun":{ - group:["xinfu_zuilun_count"], - subSkill:{ - count:{ - sub:true, - silent:true, - popup:false, - trigger:{ - player:"discardAfter", - }, - filter:function (event,player){ - return _status.currentPhase==player; - }, - content:function (){ - player.addTempSkill('xinfu_zuilun_discarded'); - }, - forced:true, - }, - discarded:{ - sub:true, - }, - }, - audio:2, trigger:{ - player:"phaseEnd", + player:"discardAfter", }, - check:function (event,player){ - var num=0; - if(player.hasSkill('xinfu_zuilun_discarded')) num++; - if(!player.isMinHandcard()) num++; - if(!player.getStat('damage')) num++; - if(num==3) return player.hp>=2; + filter:function (event,player){ + return _status.currentPhase==player; }, content:function (){ - 'step 0' - event.num=0; - event.cards=get.cards(3); - if(player.hasSkill('xinfu_zuilun_discarded')) event.num++; - if(!player.isMinHandcard()) event.num++; - if(!player.getStat('damage')) event.num++; - 'step 1' - if(event.num==0){ - player.gain(event.cards,'draw'); - event.finish(); - }else{ - var prompt; - if(event.num==3) prompt="罪论:请按顺将卡牌置于牌堆顶(先选择的在上)"; - else prompt="罪论:请按顺将"+get.cnNumber(event.num)+"张卡牌置于牌堆顶(先选择的在上),然后获得其余的牌。"; - player.chooseCardButton(event.num,true,event.cards,prompt).set('ai',function(button){ - return 100-get.value(button.link); - }); - } - 'step 2' - if(result.bool){ - var list=result.links.slice(0); - var num=list.length-1; - for(var i=0;i=2; + }, + content:function (){ + 'step 0' + event.num=0; + event.cards=get.cards(3); + if(player.hasSkill('xinfu_zuilun_discarded')) event.num++; + if(!player.isMinHandcard()) event.num++; + if(!player.getStat('damage')) event.num++; + 'step 1' + if(event.num==0){ + player.gain(event.cards,'draw'); + event.finish(); + }else{ + var prompt; + if(event.num==3) prompt="罪论:请按顺将卡牌置于牌堆顶(先选择的在上)"; + else prompt="罪论:请按顺将"+get.cnNumber(event.num)+"张卡牌置于牌堆顶(先选择的在上),然后获得其余的牌。"; + player.chooseCardButton(event.num,true,event.cards,prompt).set('ai',function(button){ + return 100-get.value(button.link); + }); + } + 'step 2' + if(result.bool){ + var list=result.links.slice(0); + var num=list.length-1; + for(var i=0;i2) return 'equip1'; - if(list.contains('equip5')&&player.countCards('h',{type:'trick'})>=1) return 'equip5'; - }); - 'step 1' - if(result.control=='equip1'){ - player.addTempSkill('drlt_jueyan1',{player:'phaseAfter'}); - }; - if(result.control=='equip2'){ - player.draw(3); - player.addTempSkill('drlt_jueyan3',{player:'phaseAfter'}); - }; - if(result.control=='equip6'){ - player.addTempSkill('drlt_jueyan2',{player:'phaseAfter'}); - }; - if(result.control=='equip5'){ - player.addTempSkill('rejizhi',{player:'phaseAfter'}); - }; - }, - ai:{ - order:13, - result:{ - player:function(player){ - if(!player.isDisabled('equip2')) return 1; - if(!player.isDisabled('equip1')&&player.countCards('h',{name:'sha'})>2) return 1; - if(!player.isDisabled('equip5')&&player.countCards('h',{type:'trick'})>=1) return 1; - return -1; - }, - }, - }, - }, - 'drlt_jueyan1':{ + '2':{ mod:{ - cardUsable:function (card,player,num){ - if(card.name=='sha') return num+3; + targetEnabled:function(card,player,target){ + if(get.type(card)=='delay') return false; }, }, - mark:true, - marktext:'决', - intro:{name:'决堰 - 武器',content:'本回合内可以多使用三张【杀】'}, }, - 'drlt_jueyan2':{ - mod:{ - targetInRange:function (card,player,target,now){ - return true; - }, + '3':{ + ai:{noCompareTarget:true,}, + }, + }, + }, + 'drlt_jueyan':{ + audio:2, + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.storage.disableEquip!=undefined&&player.storage.disableEquip.length<5; + }, + content:function(){ + 'step 0' + player.chooseToDisable(true).set('ai',function(event,player,list){ + if(list.contains('equip2')) return 'equip2'; + if(list.contains('equip1')&&player.countCards('h',{name:'sha'})>2) return 'equip1'; + if(list.contains('equip5')&&player.countCards('h',{type:'trick'})>=1) return 'equip5'; + }); + 'step 1' + if(result.control=='equip1'){ + player.addTempSkill('drlt_jueyan1',{player:'phaseAfter'}); + }; + if(result.control=='equip2'){ + player.draw(3); + player.addTempSkill('drlt_jueyan3',{player:'phaseAfter'}); + }; + if(result.control=='equip6'){ + player.addTempSkill('drlt_jueyan2',{player:'phaseAfter'}); + }; + if(result.control=='equip5'){ + player.addTempSkill('rejizhi',{player:'phaseAfter'}); + }; + }, + ai:{ + order:13, + result:{ + player:function(player){ + if(!player.isDisabled('equip2')) return 1; + if(!player.isDisabled('equip1')&&player.countCards('h',{name:'sha'})>2) return 1; + if(!player.isDisabled('equip5')&&player.countCards('h',{type:'trick'})>=1) return 1; + return -1; }, - mark:true, - marktext:'决', - intro:{name:'决堰 - 坐骑',content:'本回合内使用牌没有距离限制'}, }, - 'drlt_jueyan3':{ - mod:{ - maxHandcard:function (player,num){ - return num+3; - }, - }, - mark:true, - marktext:'决', - intro:{name:'决堰 - 防具',content:'本回合内手牌上限+3'}, + }, + }, + 'drlt_jueyan1':{ + mod:{ + cardUsable:function (card,player,num){ + if(card.name=='sha') return num+3; }, - "drlt_poshi":{ - audio:2, - skillAnimation:true, + }, + mark:true, + marktext:'决', + intro:{name:'决堰 - 武器',content:'本回合内可以多使用三张【杀】'}, + }, + 'drlt_jueyan2':{ + mod:{ + targetInRange:function (card,player,target,now){ + return true; + }, + }, + mark:true, + marktext:'决', + intro:{name:'决堰 - 坐骑',content:'本回合内使用牌没有距离限制'}, + }, + 'drlt_jueyan3':{ + mod:{ + maxHandcard:function (player,num){ + return num+3; + }, + }, + mark:true, + marktext:'决', + intro:{name:'决堰 - 防具',content:'本回合内手牌上限+3'}, + }, + "drlt_poshi":{ + audio:2, + skillAnimation:true, + trigger:{ + player:'phaseBegin', + }, + forced:true, + unique:true, + juexingji:true, + derivation:['drlt_huairou'], + init:function(player){ + player.storage.drlt_poshi=false; + }, + filter:function(event,player){ + return !player.storage.drlt_poshi&&((player.storage.disableEquip!=undefined&&player.storage.disableEquip.length==5)||player.hp==1); + }, + content:function(){ + "step 0" + player.storage.drlt_poshi=true; + player.loseMaxHp(); + "step 1" + var num=player.maxHp-player.countCards('h'); + if(num>0) player.draw(num); + player.removeSkill('drlt_jueyan'); + player.addSkill('drlt_huairou'); + }, + }, + "drlt_huairou":{ + audio:2, + enable:"phaseUse", + filter:function (event,player){ + return player.countCards('h',{type:'equip'})>0; + }, + filterCard:function (card){ + return get.type(card)=='equip'; + }, + check:function (card){ + return 1; + }, + content:function (){ + player.draw(); + }, + discard:false, + prompt:"将一张装备牌置入弃牌堆并摸一张牌", + delay:0.5, + prepare:function (cards,player){ + player.$throw(cards,1000); + }, + }, + "drlt_yongsi":{ + group:["drlt_yongsi_1","drlt_yongsi_2"], + subSkill:{ + '1':{ + audio:["yongsi1",2], trigger:{ - player:'phaseBegin', + player:'phaseDrawBegin' }, forced:true, - unique:true, - juexingji:true, - derivation:['drlt_huairou'], - init:function(player){ - player.storage.drlt_poshi=false; - }, - filter:function(event,player){ - return !player.storage.drlt_poshi&&((player.storage.disableEquip!=undefined&&player.storage.disableEquip.length==5)||player.hp==1); - }, content:function(){ - "step 0" - player.storage.drlt_poshi=true; - player.loseMaxHp(); - "step 1" - var num=player.maxHp-player.countCards('h'); - if(num>0) player.draw(num); - player.removeSkill('drlt_jueyan'); - player.addSkill('drlt_huairou'); + trigger.num=game.countGroup(); }, }, - "drlt_huairou":{ - audio:2, - enable:"phaseUse", - filter:function (event,player){ - return player.countCards('h',{type:'equip'})>0; - }, - filterCard:function (card){ - return get.type(card)=='equip'; - }, - check:function (card){ - return 1; - }, - content:function (){ - player.draw(); - }, - discard:false, - prompt:"将一张装备牌置入弃牌堆并摸一张牌", - delay:0.5, - prepare:function (cards,player){ - player.$throw(cards,1000); - }, - }, - "drlt_yongsi":{ - group:["drlt_yongsi_1","drlt_yongsi_2"], - subSkill:{ - '1':{ - audio:["yongsi1",2], - trigger:{ - player:'phaseDrawBegin' - }, - forced:true, - content:function(){ - trigger.num=game.countGroup(); - }, - }, - '2':{ - audio:["yongsi2",2], - trigger:{ - player:'phaseDiscardBegin' - }, - forced:true, - filter:function(event,player){ - var num=player.getStat('damage'); - return !num||num>1; - }, - content:function(){ - var numx=player.getStat('damage'); - if(!numx){ - var num=player.hp-player.countCards('h'); - if(num>0) player.draw(num); - } - else{ - player.addTempSkill('drlt_yongsi1',{player:'phaseDiscardAfter'}); - }; - }, - }, - }, - }, - 'drlt_yongsi1':{ - mod:{ - maxHandcard:function (player,num){ - return num+player.maxHp-2*player.hp; - }, - }, - }, - "drlt_weidi":{ - audio:2, - unique:true, - zhuSkill:true, + '2':{ + audio:["yongsi2",2], trigger:{ - player:"phaseDiscardAfter", + player:'phaseDiscardBegin' }, - direct:true, - filter:function (event,player){ - if(!player.hasZhuSkill('drlt_weidi')) return false; - return event.cards&&event.cards.length>0&&game.countPlayer(function(current){return current!=player&¤t.group=='qun'})>0; + forced:true, + filter:function(event,player){ + var num=player.getStat('damage'); + return !num||num>1; }, content:function(){ - 'step 0' - event.cards=trigger.cards; - event.logged=false; - event.gived=[]; - 'step 1' - if(!game.hasPlayer(function(target){ - return target!=player&&target.group=='qun'&&!event.gived.contains(target); - })) event.finish(); - else player.chooseTarget('是否将 '+get.translation(event.cards[0])+' 给予其他群雄角色?',function(card,player,target){ - return target!=player&&target.group=='qun'&&!event.gived.contains(target); - }).ai=function(target){ - if(event.cards[0].name=='du') return -get.attitude(player,target); - return get.attitude(player,target); + var numx=player.getStat('damage'); + if(!numx){ + var num=player.hp-player.countCards('h'); + if(num>0) player.draw(num); + } + else{ + player.addTempSkill('drlt_yongsi1',{player:'phaseDiscardAfter'}); }; - 'step 2' - if(result.bool){ - if(!event.logged){ - player.logSkill('drlt_weidi'); - event.logged=true; - } - player.line(result.targets); - player.$give(event.cards[0],result.targets[0]); - result.targets[0].gain(event.cards[0],player); - event.gived.add(result.targets[0]); - }; - event.cards.remove(event.cards[0]); - if(event.cards.length>0) event.goto(1); }, }, - "drlt_xiongluan":{ - audio:2, - unique:true, - enable:'phaseUse', - mark:true, - skillAnimation:true, - limited:true, - init:function(player){ - player.storage.drlt_xiongluan=false; + }, + }, + 'drlt_yongsi1':{ + mod:{ + maxHandcard:function (player,num){ + return num+player.maxHp-2*player.hp; + }, + }, + }, + "drlt_weidi":{ + audio:2, + unique:true, + zhuSkill:true, + trigger:{ + player:"phaseDiscardAfter", + }, + direct:true, + filter:function (event,player){ + if(!player.hasZhuSkill('drlt_weidi')) return false; + return event.cards&&event.cards.length>0&&game.countPlayer(function(current){return current!=player&¤t.group=='qun'})>0; + }, + content:function(){ + 'step 0' + event.cards=trigger.cards; + event.logged=false; + event.gived=[]; + 'step 1' + if(!game.hasPlayer(function(target){ + return target!=player&&target.group=='qun'&&!event.gived.contains(target); + })) event.finish(); + else player.chooseTarget('是否将 '+get.translation(event.cards[0])+' 给予其他群雄角色?',function(card,player,target){ + return target!=player&&target.group=='qun'&&!event.gived.contains(target); + }).ai=function(target){ + if(event.cards[0].name=='du') return -get.attitude(player,target); + return get.attitude(player,target); + }; + 'step 2' + if(result.bool){ + if(!event.logged){ + player.logSkill('drlt_weidi'); + event.logged=true; + } + player.line(result.targets); + player.$give(event.cards[0],result.targets[0]); + result.targets[0].gain(event.cards[0],player); + event.gived.add(result.targets[0]); + }; + event.cards.remove(event.cards[0]); + if(event.cards.length>0) event.goto(1); + }, + }, + "drlt_xiongluan":{ + audio:2, + unique:true, + enable:'phaseUse', + mark:true, + skillAnimation:true, + limited:true, + init:function(player){ + player.storage.drlt_xiongluan=false; + }, + filter:function(event,player){ + if(player.storage.drlt_xiongluan) return false; + return true; + }, + filterTarget:function(card,player,target){ + return target!=player; + }, + content:function(){ + player.awakenSkill('drlt_xiongluan'); + player.storage.drlt_xiongluan=true; + player.disableEquip('equip1'); + player.disableEquip('equip2'); + player.disableEquip('equip3'); + player.disableEquip('equip4'); + player.disableEquip('equip5'); + player.disableJudge(); + player.addTempSkill('drlt_xiongluan1'); + player.storage.drlt_xiongluan1=target; + target.addSkill('drlt_xiongluan2'); + target.markSkillCharacter('drlt_xiongluan1',player,'雄乱','无法使用或打出任何手牌'); + }, + ai:{ + order:13, + result:{ + target:function(player,target){ + var hs=player.countCards('h',{name:['sha','juedou']}); + var ts=target.hp; + if(hs>=ts&&ts>1) return -1; + return 0; }, - filter:function(event,player){ - if(player.storage.drlt_xiongluan) return false; + }, + }, + intro:{ + content:'limited' + }, + }, + 'drlt_xiongluan1':{ + onremove:function(player){ + player.storage.drlt_xiongluan1.removeSkill('drlt_xiongluan2'); + player.storage.drlt_xiongluan1.unmarkSkill('drlt_xiongluan1'); + delete player.storage.drlt_xiongluan1; + }, + mod:{ + targetInRange:function (card,player,target){ + if(target.hasSkill('drlt_xiongluan2')){ + return true; + } + }, + cardUsable:function (card,player,num){ + if(typeof num=='number'&&game.hasPlayer(function(current){ + return current.hasSkill('drlt_xiongluan2'); + })) return num+100; + }, + playerEnabled:function (card,player,target){ + if(game.hasPlayer(function(current){ + return current.hasSkill('drlt_xiongluan2'); + })&&!target.hasSkill('drlt_xiongluan2')){ + var num=player.getCardUsable(card)-100; + if(num<=0) return false; + } + }, + }, + }, + 'drlt_xiongluan2':{ + mod:{ + cardEnabled:function(card,player){ + if(get.position(card)=='h') return false; + }, + cardUsable:function(card,player){ + if(get.position(card)=='h') return false; + }, + cardRespondable:function(card,player){ + if(get.position(card)=='h') return false; + }, + cardSavable:function(card,player){ + if(get.position(card)=='h') return false; + }, + }, + ai:{ + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')) return [0,-999999]; + }, + }, + }, + }, + + + "drlt_congjian":{ + audio:2, + trigger:{ + global:"useCard", + }, + direct:true, + filter:function (event,player){ + return event.targets&&get.type(event.card)=='trick'&&event.targets.contains(player)&&event.targets.length>1&&player.countCards('he')>0; + }, + content:function(){ + 'step 0' + player.chooseCardTarget({ + filterCard:true, + selectCard:1, + position:'he', + filterTarget:function(card,player,target){ + return player!=target&&trigger.targets.contains(target); + }, + ai1:function(card){ + if(card.name=='du') return 20; + if(_status.event.player.storage.drlt_xiongluan&&get.type(card)=="equip") return 15; + return 6-get.value(card); + }, + ai2:function(target){ + var att=get.attitude(_status.event.player,target); + if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ + if(target.hasSkillTag('nodu')) return 0.1; + return 1-att; + } + return att-3; + }, + prompt:get.prompt('drlt_congjian'), + }); + 'step 1' + if(result.bool){ + event.target=result.targets[0]; + player.line(event.target); + player.logSkill('drlt_congjian') + player.$give(result.cards[0],event.target); + event.target.gain(result.cards[0],player); + var num=1; + if(get.type(result.cards[0])=='equip') num=2; + player.draw(num); + }; + }, + }, + "drlt_wanglie":{ + group:["drlt_wangliex"], + audio:2, + trigger:{ + player:"phaseUseBefore", + }, + forced:true, + popup:false, + content:function(){ + player.storage.drlt_wanglie=true; + player.markSkillCharacter('drlt_wanglie',player,'往烈','回合内使用的第一张牌无距离限制'); + }, + }, + 'drlt_wangliex':{ + mod:{ + targetInRange:function (card,player,target,now){ + if(player.storage.drlt_wanglie==true) return true; + }, + }, + audio:2, + trigger:{ + player:"useCardBegin", + }, + filter:function (event,player){ + return player.hasSkill('drlt_wanglie')&&_status.currentPhase==player; + }, + forced:true, + popup:false, + content:function(){ + 'step 0' + if(player.storage.drlt_wanglie==true){ + delete player.storage.drlt_wanglie; + player.unmarkSkill('drlt_wanglie'); + }; + player.chooseBool().set('ai',function(){ + if(player.countCards('h')<=player.hp+1&&((get.type(trigger.card)=='trick'&&game.countPlayer(function(current){return get.attitude(current,player)<=0&¤t.countCards('h',{name:'wuxie'})})>0)||trigger.card.name=='sha')) return true; + return false; + }).set('prompt','是否令此牌不能被响应'); + 'step 1' + if(result.bool){ + player.logSkill('drlt_wanglie'); + player.storage.drlt_wanglie1=trigger.card.name; + player.addTempSkill('drlt_wanglie1',{player:'useCardAfter'}); + player.addTempSkill('drlt_wanglie2',{player:'phaseAfter'}); + }; + }, + }, + "drlt_wanglie1":{ + mod:{ + wuxieRespondable:function(card,player,target,current){ + if(player!=current&&player.storage.drlt_wanglie1==card.name) return false; + }, + }, + ai:{ + norespond:true, + skillTagFilter:function(player,tag,arg){ + if(tag=='norespond'&&Array.isArray(arg)){ + var evt=arg[2].getParent(); + if(evt.type=='card'&&evt.name==player.storage.drlt_wanglie1) return true; + }; + return false; + }, + }, + }, + "drlt_wanglie2":{ + mod:{ + cardEnabled:function(card,player){ + return false; + }, + }, + }, + + liangyin:{ + audio:2, + group:["liangyin_1","liangyin_2"], + subSkill:{ + "1":{ + trigger:{ + global:["loseAfter","addCardToStorage"], + }, + filter:function (event,player){ + if(event.name=='lose') return event.toStorage==true; return true; }, - filterTarget:function(card,player,target){ - return target!=player; - }, - content:function(){ - player.awakenSkill('drlt_xiongluan'); - player.storage.drlt_xiongluan=true; - player.disableEquip('equip1'); - player.disableEquip('equip2'); - player.disableEquip('equip3'); - player.disableEquip('equip4'); - player.disableEquip('equip5'); - player.disableJudge(); - player.addTempSkill('drlt_xiongluan1'); - player.storage.drlt_xiongluan1=target; - target.addSkill('drlt_xiongluan2'); - target.markSkillCharacter('drlt_xiongluan1',player,'雄乱','无法使用或打出任何手牌'); - }, - ai:{ - order:13, - result:{ - target:function(player,target){ - var hs=player.countCards('h',{name:['sha','juedou']}); - var ts=target.hp; - if(hs>=ts&&ts>1) return -1; - return 0; - }, - }, - }, - intro:{ - content:'limited' + direct:true, + content:function (){ + "step 0" + player.chooseTarget('是否发动【良姻】令手牌数大于你的一名角色摸一张牌?',function(card,player,target){ + return target!=player&&target.countCards('h')>player.countCards('h'); + }).ai=function(target){ + return get.attitude(player,target); + }; + "step 1" + if(result.bool){ + player.line(result.targets); + player.logSkill('liangyin'); + result.targets[0].draw(); + }else{ + event.finish(); + }; }, + sub:true, }, - 'drlt_xiongluan1':{ - onremove:function(player){ - player.storage.drlt_xiongluan1.removeSkill('drlt_xiongluan2'); - player.storage.drlt_xiongluan1.unmarkSkill('drlt_xiongluan1'); - delete player.storage.drlt_xiongluan1; - }, - mod:{ - targetInRange:function (card,player,target){ - if(target.hasSkill('drlt_xiongluan2')){ - return true; - } - }, - cardUsable:function (card,player,num){ - if(typeof num=='number'&&game.hasPlayer(function(current){ - return current.hasSkill('drlt_xiongluan2'); - })) return num+100; - }, - playerEnabled:function (card,player,target){ - if(game.hasPlayer(function(current){ - return current.hasSkill('drlt_xiongluan2'); - })&&!target.hasSkill('drlt_xiongluan2')){ - var num=player.getCardUsable(card)-100; - if(num<=0) return false; - } - }, - }, - }, - 'drlt_xiongluan2':{ - mod:{ - cardEnabled:function(card,player){ - if(get.position(card)=='h') return false; - }, - cardUsable:function(card,player){ - if(get.position(card)=='h') return false; - }, - cardRespondable:function(card,player){ - if(get.position(card)=='h') return false; - }, - cardSavable:function(card,player){ - if(get.position(card)=='h') return false; - }, - }, - ai:{ - effect:{ - target:function(card,player,target){ - if(get.tag(card,'damage')) return [0,-999999]; - }, - }, - }, - }, - - - "drlt_congjian":{ - audio:2, + "2":{ trigger:{ - global:"useCard", + global:"gainAfter", + }, + filter:function (event,player){ + return event.fromStorage==true; }, direct:true, + content:function (){ + "step 0" + player.chooseTarget('是否发动【良姻】令手牌数小于你的一名角色弃置一张牌?',function(card,player,target){ + return target!=player&&target.countCards('h')0; + }).ai=function(target){ + return -get.attitude(player,target); + }; + "step 1" + if(result.bool){ + player.line(result.targets); + player.logSkill('liangyin'); + result.targets[0].chooseToDiscard('he',1,true); + }else{ + event.finish(); + }; + }, + sub:true, + }, + }, + }, + kongsheng:{ + audio:2, + trigger:{ + player:"phaseBegin", + }, + direct:true, + filter:function (event,player){ + return player.countCards('he')>0; + }, + content:function (){ + 'step 0' + player.chooseCard(get.prompt('kongsheng'),'he',[1,player.countCards('he')]).set('ai',function(card){ + if(card.name=='shan'||card.name=='du') return 1; + return 5-get.value(card); + }); + 'step 1' + if(result.bool){ + player.logSkill('kongsheng'); + if(player.storage.kongsheng2==undefined) player.storage.kongsheng2=[]; + player.storage.kongsheng2.addArray(result.cards); + player.lose(result.cards,ui.special,'toStorage'); + game.log(player,'将',result.cards,'置于其武将牌上'); + player.addSkill('kongsheng2'); + }else{ + event.finish(); + } + }, + }, + "kongsheng2":{ + marktext:"箜", + intro:{ + content:"cards", + }, + mark:true, + trigger:{ + player:"phaseEnd", + }, + filter:function (event,player){ + return player.storage.kongsheng2!=undefined&&player.storage.kongsheng2.length>0; + }, + forced:true, + popup:false, + content:function (){ + 'step 0' + player.logSkill('kongsheng'); + event.list=[]; + for(var i=0;i1&&player.countCards('he')>0; + return event.targets&&event.targets.contains(player)&&(player.storage.nzry_juzhan1==false||player.storage.nzry_juzhan1==undefined); }, content:function(){ - 'step 0' - player.chooseCardTarget({ - filterCard:true, - selectCard:1, - position:'he', - filterTarget:function(card,player,target){ - return player!=target&&trigger.targets.contains(target); - }, - ai1:function(card){ - if(card.name=='du') return 20; - if(_status.event.player.storage.drlt_xiongluan&&get.type(card)=="equip") return 15; - return 6-get.value(card); - }, - ai2:function(target){ - var att=get.attitude(_status.event.player,target); - if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ - if(target.hasSkillTag('nodu')) return 0.1; - return 1-att; - } - return att-3; - }, - prompt:get.prompt('drlt_congjian'), + game.asyncDraw([player,trigger.player]); + trigger.player.storage.nzry_juzhan=true; + player.storage.nzry_juzhan1=true; + }, + }, + '2':{ + audio:2, + trigger:{ + player:'shaBegin' + }, + filter:function (event,player){ + return player.storage.nzry_juzhan1==true; + }, + check:function (event,player){ + return event.player.countCards('he')>0&&event.targets&&event.targets.length==1; + }, + content:function(){ + player.gainPlayerCard(trigger.targets[0],'he',true); + player.storage.nzry_juzhan1=false; + trigger.target.storage.nzry_juzhan2=true; + }, + }, + }, + }, + "_nzry_juzhan":{ + mod:{ + targetEnabled:function(card,player,target){ + if(target.storage.nzry_juzhan2==true) return false; + }, + }, + trigger:{ + global:'phaseAfter' + }, + filter:function (event,player){ + return player.storage.nzry_juzhan==true||player.storage.nzry_juzhan2==true; + }, + forced:true, + popup:false, + content:function(){ + if(player.storage.nzry_juzhan==true) delete player.storage.nzry_juzhan; + if(player.storage.nzry_juzhan2==true) delete player.storage.nzry_juzhan2; + }, + }, + "nzry_feijun":{ + init:function (player){ + player.storage.nzry_feijun=[]; + }, + marktext:"飞", + intro:{ + content:function (storage){ + if(!storage.length) return '尚未发动'; + var str=get.translation(storage); + return '已对'+str+'发动过〖飞军〗'; + }, + }, + mark:true, + enable:"phaseUse", + usable:1, + position:"he", + audio:2, + filter:function (event,player){ + return game.countPlayer(function(current){return current.countCards('h')>=player.countCards('h')})>0||game.countPlayer(function(current){return current.countCards('e')>player.countCards('e')})>0; + }, + filterCard:true, + check:function (card){ + return 5-get.value(card); + }, + content:function (){ + 'step 0' + var list=[]; + if(game.countPlayer(function(current){return current.countCards('h')>player.countCards('h')})>0) list.push('令一名手牌数大于你的角色交给你一张牌'); + if(game.countPlayer(function(current){return current.countCards('e')>player.countCards('e')})>0) list.push('令一名装备区里牌数大于你的角色弃置一张装备牌'); + if(list.length==0) event.finish(); + else if(list.length<2){ + if(game.countPlayer(function(current){return current.countCards('h')>player.countCards('h')})>0) event._result={index:0}; + else event._result={index:1}; + } + else{ + player.chooseControl().set('ai',function(){ + if(game.hasPlayer(function(current){ + return current.countCards('h')>player.countCards('h')&&get.attitude(player,current)<0 + })) return 0; + return 1; + }).set('choiceList',list); + } + 'step 1' + if(result.index==0){ + event.control='令一名手牌数大于你的角色交给你一张牌'; + player.chooseTarget(function(card,player,target){ + return target.countCards('h')>player.countCards('h')&&target!=player; + },'请选择【飞军】的目标').ai=function(target){ + return -get.attitude(player,target) + }; + }else{ + event.control='令一名装备区里牌数大于你的角色弃置一张装备牌'; + player.chooseTarget(function(card,player,target){ + return target.countCards('e')>player.countCards('e')&&target!=player; + },'请选择【飞军】的目标').ai=function(target){ + return -get.attitude(player,target) + }; + }; + 'step 2' + if(result.bool){ + event.target=result.targets[0]; + if(!player.storage.nzry_feijun.contains(event.target)){ + if(player.hasSkill('nzry_binglve')){ + player.draw(2); + player.logSkill('nzry_binglve'); + } + player.storage.nzry_feijun.push(event.target); + player.syncStorage('nzry_feijun'); + }; + player.line(event.target); + if(event.control=='令一名手牌数大于你的角色交给你一张牌'){ + event.target.chooseCard(1,'h',true).set('ai',function(card){ + return 6-get.value(card); }); - 'step 1' - if(result.bool){ - event.target=result.targets[0]; - player.line(event.target); - player.logSkill('drlt_congjian') - player.$give(result.cards[0],event.target); - event.target.gain(result.cards[0],player); - var num=1; - if(get.type(result.cards[0])=='equip') num=2; - player.draw(num); - }; + }else{ + event.target.chooseToDiscard(1,'e',true); + event.finish(); + }; + }else{ + event.finish(); + }; + 'step 3' + if(result.bool){ + event.target.$giveAuto(result.cards,player); + player.gain(result.cards,event.target); + }; + }, + ai:{ + order:11, + result:{ + player:function (player){ + if(game.countPlayer(function(current){return (current.countCards('h')>player.countCards('h')||current.countCards('e')>player.countCards('e'))&&get.attitude(player,current)<0&&!player.storage.nzry_feijun.contains(current)})>0||game.countPlayer(function(current){return current.countCards('h')>player.countCards('h')&&get.attitude(player,current)<0})>0||(player.countCards('h')>=2&&game.countPlayer(function(current){return current.countCards('e')>player.countCards('e')&&get.attitude(player,current)<0})>0)) return 1; }, }, - "drlt_wanglie":{ - group:["drlt_wangliex"], - audio:2, - trigger:{ - player:"phaseUseBefore", - }, - forced:true, - popup:false, - content:function(){ - player.storage.drlt_wanglie=true; - player.markSkillCharacter('drlt_wanglie',player,'往烈','回合内使用的第一张牌无距离限制'); - }, - }, - 'drlt_wangliex':{ - mod:{ - targetInRange:function (card,player,target,now){ - if(player.storage.drlt_wanglie==true) return true; - }, - }, - audio:2, - trigger:{ - player:"useCardBegin", - }, - filter:function (event,player){ - return player.hasSkill('drlt_wanglie')&&_status.currentPhase==player; - }, - forced:true, - popup:false, - content:function(){ - 'step 0' - if(player.storage.drlt_wanglie==true){ - delete player.storage.drlt_wanglie; - player.unmarkSkill('drlt_wanglie'); + }, + }, + "nzry_binglve":{audio:2}, + "nzry_huaiju":{ + marktext:"橘", + init:function(player,skill){ + if(!player.storage[skill]) player.storage[skill]=0; + }, + intro:{ + content:'当前有#个“橘”', + }, + mark:true, + audio:2, + trigger:{ + global:'gameDrawAfter' + }, + forced:true, + content:function(){ + player.storage.nzry_huaiju+=3; + player.syncStorage('nzry_huaiju'); + game.log(player,'获得了3个“橘”'); + }, + group:['tachibana_effect'], + }, + //没错 这是个橘 + "tachibana_effect":{ + audio:'nzry_huaiju', + trigger:{ + global:['damageBefore','phaseDrawBegin'], + }, + forced:true, + filter:function(event,player){ + return !event.tachibanaed&&event.player.storage.nzry_huaiju&&event.player.storage.nzry_huaiju>0; + }, + content:function(){ + trigger.tachibanaed=true; + player.line(trigger.player,'green'); + if(trigger.name=='damage'){ + trigger.cancel(); + trigger.player.storage.nzry_huaiju--; + if(!trigger.player.storage.nzry_huaiju) trigger.player.unmarkSkill('nzry_huaiju'); + else{ + trigger.player.syncStorage('nzry_huaiju'); + trigger.player.updateMarks('nzry_huaiju'); + } + game.log(trigger.player,'移去了1个“橘”'); + } + else trigger.num++; + }, + }, + "nzry_yili":{ + audio:2, + trigger:{ + player:"phaseUseBegin", + }, + direct:true, + content:function (){ + 'step 0' + player.chooseTarget(get.prompt('nzry_yili'),function(card,player,target){ + return target!=player + }).ai=function(target){ + var player=_status.event.player; + if(player.storage.nzry_huaiju>2||player.hp>2) return get.attitude(player,target); + return -1; + }; + 'step 1' + if(result.bool){ + event.target=result.targets[0]; + if(player.storage.nzry_huaiju>0){ + player.chooseControl().set('choiceList',['流失一点体力','移去一个“橘”']).set('ai',function(){ + if(player.hp>2) return 0; + return 1; + }); + } + else event._result={index:0}; + }else{ + event.finish(); + }; + 'step 2' + player.line(event.target,'green'); + player.logSkill('nzry_huaiju'); + if(result.index==1){ + player.storage.nzry_huaiju--; + player.syncStorage('nzry_huaiju'); + if(player.storage.nzry_huaiju<=0) player.unmarkSkill('nzry_huaiju'); + game.log(player,'移去了1个“橘”'); + }else{ + player.loseHp(); + }; + if(event.target.storage.nzry_huaiju==undefined) event.target.storage.nzry_huaiju=0; + event.target.markSkill('nzry_huaiju'); + event.target.storage.nzry_huaiju++; + event.target.syncStorage('nzry_huaiju'); + game.log(event.target,'获得了1个“橘”'); + }, + }, + "nzry_zhenglun":{ + audio:2, + trigger:{ + player:'phaseDrawBefore' + }, + filter:function (event,player){ + return player.storage.nzry_huaiju==undefined||player.storage.nzry_huaiju==0; + }, + check:function (event,player){ + return player.countCards('h')>=2||player.skipList.contains('phaseUse'); + }, + content:function(){ + trigger.cancel(); + if(player.storage.nzry_huaiju==undefined) player.storage.nzry_huaiju=0; + player.storage.nzry_huaiju++; + player.syncStorage('nzry_huaiju'); + player.markSkill('nzry_huaiju'); + game.log(player,'获得了1个“橘”'); + }, + }, + "nzry_kuizhu":{ + audio:2, + trigger:{ + player:"phaseDiscardAfter", + }, + direct:true, + filter:function (event,player){ + return event.num>0; + }, + content:function (){ + 'step 0' + event.str1='令至多'+trigger.num+'名角色摸一张牌'; + event.str2='对任意名体力值之和为'+trigger.num+'的角色造成一点伤害'; + player.chooseControl().set('ai',function(){ + if(game.countPlayer(function(current){return get.attitude(player,current)<0&¤t.hp==trigger.num})>0&&trigger.num<=3) return 1; + return 0; + }).set('choiceList',[event.str1,event.str2]).set('prompt','是否发动【溃诛】?'); + 'step 1' + event.control=[event.str1,event.str2][result.index]; + 'step 2' + var str='请选择【溃诛】的目标'; + if(event.bool==false) str='所选目标体力之和不足'+trigger.num+',请重选'; + if(event.control==event.str2){ + player.chooseTarget(str,[1,Infinity],function(card,player,target){ + var targets=ui.selected.targets; + var num=0; + for(var i=0;i0)||trigger.card.name=='sha')) return true; - return false; - }).set('prompt','是否令此牌不能被响应'); - 'step 1' - if(result.bool){ - player.logSkill('drlt_wanglie'); - player.storage.drlt_wanglie1=trigger.card.name; - player.addTempSkill('drlt_wanglie1',{player:'useCardAfter'}); - player.addTempSkill('drlt_wanglie2',{player:'phaseAfter'}); + return num+target.hp<=trigger.num; + }).set('ai',function(target){ + if(ui.selected.targets[0]!=undefined) return -1; + return get.attitude(player,target)<0; + }).promptbar='none'; + }else{ + player.chooseTarget('请选择【溃诛】的目标',[1,trigger.num]).ai=function(target){ + return get.attitude(player,target); + }; + }; + 'step 3' + if(result.bool){ + var targets=result.targets; + if(event.control==event.str1){ + player.line(targets); + player.logSkill('nzry_kuizhu',targets); + game.asyncDraw(targets); + }else{ + var num=0; + for(var i=0;i=2) player.damage(); + }; + }; + }; + }, + }, + "nzry_zhizheng":{ + audio:2, + group:["nzry_zhizheng_1","nzry_zhizheng_2"], + trigger:{ + player:'useCardAfter' + }, + filter:function (event,player){ + return player.isPhaseUsing(); + }, + forced:true, + popup:false, + content:function(){ + player.storage.nzry_zhizheng++; + }, + subSkill:{ + others:{ + sub:true, mod:{ - cardEnabled:function(card,player){ - return false; + targetEnabled:function(card,player,target){ + if(player.hasSkill('nzry_zhizheng')&&player.isPhaseUsing()&&get.distance(target,player,'attack')>1) return false; }, }, }, - - liangyin:{ - audio:2, - group:["liangyin_1","liangyin_2"], - subSkill:{ - "1":{ - trigger:{ - global:["loseAfter","addCardToStorage"], - }, - filter:function (event,player){ - if(event.name=='lose') return event.toStorage==true; - return true; - }, - direct:true, - content:function (){ - "step 0" - player.chooseTarget('是否发动【良姻】令手牌数大于你的一名角色摸一张牌?',function(card,player,target){ - return target!=player&&target.countCards('h')>player.countCards('h'); - }).ai=function(target){ - return get.attitude(player,target); - }; - "step 1" - if(result.bool){ - player.line(result.targets); - player.logSkill('liangyin'); - result.targets[0].draw(); - }else{ - event.finish(); - }; - }, - sub:true, - }, - "2":{ - trigger:{ - global:"gainAfter", - }, - filter:function (event,player){ - return event.fromStorage==true; - }, - direct:true, - content:function (){ - "step 0" - player.chooseTarget('是否发动【良姻】令手牌数小于你的一名角色弃置一张牌?',function(card,player,target){ - return target!=player&&target.countCards('h')0; - }).ai=function(target){ - return -get.attitude(player,target); - }; - "step 1" - if(result.bool){ - player.line(result.targets); - player.logSkill('liangyin'); - result.targets[0].chooseToDiscard('he',1,true); - }else{ - event.finish(); - }; - }, - sub:true, - }, - }, - }, - kongsheng:{ - audio:2, + "1":{ trigger:{ - player:"phaseBegin", + player:['phaseUseBefore','phaseUseAfter'] + }, + forced:true, + popup:false, + content:function(){ + if(event.triggername=='phaseUseBefore') game.countPlayer(function(current){ + if(current!=player){ + current.addTempSkill('nzry_zhizheng_others','phaseUseAfter'); + } + }); + player.storage.nzry_zhizheng=0; + }, + }, + "2":{ + trigger:{ + player:'phaseUseEnd' }, direct:true, filter:function (event,player){ - return player.countCards('he')>0; + return player.storage.nzry_zhizheng1}); }, + content:function(){ + 'step 0' + player.chooseTarget(get.prompt2('nzry_zhizheng'),function(card,player,target){ + return get.distance(target,player,'attack')>1&&target.countDiscardableCards(player,'he'); + }).ai=function(target){ + return -get.attitude(player,target); + }; + 'step 1' + if(result.bool){ + player.line(result.targets); + player.logSkill('nzry_zhizheng'); + player.discardPlayerCard(result.targets[0],'he',1,true); + }; + }, + }, + }, + }, + "nzry_lijun":{ + unique:true, + global:'nzry_lijun1', + audio:'nzry_lijun1', + zhuSkill:true, + }, + nzry_lijun2:{}, + "nzry_lijun1":{ + audio:2, + trigger:{ + player:'useCardAfter' + }, + filter:function(event,player){ + if(event.card.name!='sha') return false; + if(player.hasSkill('nzry_lijun2')) return false; + if(player.group!='wu') return false; + if(_status.currentPhase!=player) return false; + if(!game.hasPlayer(function(target){ + return player!=target&&target.hasZhuSkill('nzry_lijun',player); + })) return false; + for(var i=0;i0) return true; + return false; + }).set('prompt','是否令'+get.translation(player)+'摸一张牌?'); + } + 'step 2' + if(result.bool) player.draw(); + }, + }, + "nzry_chenglve":{ + mark:true, + locked:false, + zhuanhuanji:true, + marktext:'成', + intro:{ + content:function(storage,player,skill){ + if(player.storage.nzry_chenglve==true) return '出牌阶段限一次,你可以摸两张牌,然后弃置一张手牌。若如此做,直到本回合结束,你使用与弃置牌花色相同的牌无距离和次数限制'; + return '出牌阶段限一次,你可以摸一张牌,然后弃置两张手牌。若如此做,直到本回合结束,你使用与弃置牌花色相同的牌无距离和次数限制'; + }, + }, + enable:"phaseUse", + usable:1, + audio:2, + filter:function(event,player){ + var num=1; + if(player.storage.nzry_chenglve==true) num=0; + return player.countCards('h')>=num; + }, + content:function(){ + 'step 0' + if(player.storage.nzry_chenglve==true){ + player.storage.nzry_chenglve=false; + player.draw(2); + player.chooseToDiscard('h',true); + }else{ + player.storage.nzry_chenglve=true; + player.draw(); + player.chooseToDiscard('h',2,true); + }; + 'step 1' + if(result.bool){ + player.storage.nzry_chenglve1=result.cards; + player.addTempSkill('nzry_chenglve1',{player:'phaseAfter'}); + }; + }, + ai:{ + order:2.7, + result:{ + player:function(player){ + if((player.storage.nzry_chenglve==undefined||player.storage.nzry_chenglve==false)&&player.countCards('h')<3) return 0; + return 1; + }, + }, + }, + }, + "nzry_chenglve1":{ + mod:{ + cardUsable:function(card,player){ + var cards=player.storage.nzry_chenglve1; + for(var i=0;i0&&player.storage.nzry_shicai!=undefined&&!player.storage.nzry_shicai.contains(get.type(event.card,'trick')); + }, + check:function (event,player){ + if(get.type(event.card)=='equip'){ + return get.equipResult(player,player,event.card.name)<=0; + } + return event.card.name!='lebu'&&event.card.name!='bingliang'; + }, + content:function(){ + player.storage.nzry_shicai.push(get.type(trigger.card,'trick')); + if(trigger.name=='useCard'&&['equip','delay'].contains(get.type(trigger.card))) trigger.cancel(); + for(var i=0;i0; - }, - forced:true, - popup:false, - content:function (){ - 'step 0' - player.logSkill('kongsheng'); - event.list=[]; - for(var i=0;i0&&event.targets&&event.targets.length==1; - }, - content:function(){ - player.gainPlayerCard(trigger.targets[0],'he',true); - player.storage.nzry_juzhan1=false; - trigger.target.storage.nzry_juzhan2=true; - }, - }, - }, + }, + }, + "nzry_zhenliang":{ + audio:"nzry_zhenliang_1", + mark:true, + locked:false, + zhuanhuanji:true, + marktext:'贞', + intro:{ + content:function(storage,player,skill){ + if(player.storage.nzry_zhenliang==true) return '你的回合外,当你使用或打出牌进入弃牌堆时,若此牌与“任”类型相同,则你可以令一名角色摸一张牌'; + return '出牌阶段限一次,你可以选择一名攻击范围内的其他角色,然后弃置X张与“任”颜色相同的牌并对其造成一点伤害(X为你与其的体力差且至少为1)'; }, - "_nzry_juzhan":{ - mod:{ - targetEnabled:function(card,player,target){ - if(target.storage.nzry_juzhan2==true) return false; - }, - }, - trigger:{ - global:'phaseAfter' - }, - filter:function (event,player){ - return player.storage.nzry_juzhan==true||player.storage.nzry_juzhan2==true; - }, - forced:true, - popup:false, - content:function(){ - if(player.storage.nzry_juzhan==true) delete player.storage.nzry_juzhan; - if(player.storage.nzry_juzhan2==true) delete player.storage.nzry_juzhan2; - }, - }, - "nzry_feijun":{ - init:function (player){ - player.storage.nzry_feijun=[]; - }, - marktext:"飞", - intro:{ - content:function (storage){ - if(!storage.length) return '尚未发动'; - var str=get.translation(storage); - return '已对'+str+'发动过〖飞军〗'; - }, - }, - mark:true, - enable:"phaseUse", + }, + group:["nzry_zhenliang_1","nzry_zhenliang_2"], + subSkill:{ + '1':{ + prompt:"出牌阶段限一次,你可以选择一名攻击范围内的其他角色,然后弃置X张与“任”颜色相同的牌并对其造成一点伤害(X为你与其的体力差且至少为1)", + audio:2, + enable:'phaseUse', usable:1, - position:"he", - audio:2, - filter:function (event,player){ - return game.countPlayer(function(current){return current.countCards('h')>=player.countCards('h')})>0||game.countPlayer(function(current){return current.countCards('e')>player.countCards('e')})>0; + filter:function(event,player){ + return game.hasPlayer(function(current){ + return current!=player&& + get.distance(player,current,'attack')<=1&& + player.storage.nzry_mingren!=undefined&& + player.countCards('he',{color:get.color(player.storage.nzry_mingren[0])})>=Math.max(Math.abs(current.hp-player.hp),1); + })&&player.storage.nzry_zhenliang!=true; }, - filterCard:true, - check:function (card){ - return 5-get.value(card); + filterTarget:function(card,player,target){ + return player.storage.nzry_mingren!=undefined&& + target!=player&& + get.distance(player,target,'attack')<=1&& + player.countCards('he',{color:get.color(player.storage.nzry_mingren[0])})>=Math.max(Math.abs(target.hp-player.hp),1); }, - content:function (){ + content:function(){ 'step 0' - var list=[]; - if(game.countPlayer(function(current){return current.countCards('h')>player.countCards('h')})>0) list.push('令一名手牌数大于你的角色交给你一张牌'); - if(game.countPlayer(function(current){return current.countCards('e')>player.countCards('e')})>0) list.push('令一名装备区里牌数大于你的角色弃置一张装备牌'); - if(list.length==0) event.finish(); - else if(list.length<2){ - if(game.countPlayer(function(current){return current.countCards('h')>player.countCards('h')})>0) event._result={index:0}; - else event._result={index:1}; - } - else{ - player.chooseControl().set('ai',function(){ - if(game.hasPlayer(function(current){ - return current.countCards('h')>player.countCards('h')&&get.attitude(player,current)<0 - })) return 0; - return 1; - }).set('choiceList',list); - } + player.chooseCard('请选择发动【贞良】的牌',Math.max(Math.abs(target.hp-player.hp),1),'he',{color:get.color(player.storage.nzry_mingren[0])},true).set('ai',function(card){ + return 6-get.value(card); + }); 'step 1' - if(result.index==0){ - event.control='令一名手牌数大于你的角色交给你一张牌'; - player.chooseTarget(function(card,player,target){ - return target.countCards('h')>player.countCards('h')&&target!=player; - },'请选择【飞军】的目标').ai=function(target){ - return -get.attitude(player,target) - }; - }else{ - event.control='令一名装备区里牌数大于你的角色弃置一张装备牌'; - player.chooseTarget(function(card,player,target){ - return target.countCards('e')>player.countCards('e')&&target!=player; - },'请选择【飞军】的目标').ai=function(target){ - return -get.attitude(player,target) - }; - }; - 'step 2' if(result.bool){ - event.target=result.targets[0]; - if(!player.storage.nzry_feijun.contains(event.target)){ - if(player.hasSkill('nzry_binglve')){ - player.draw(2); - player.logSkill('nzry_binglve'); - } - player.storage.nzry_feijun.push(event.target); - player.syncStorage('nzry_feijun'); - }; - player.line(event.target); - if(event.control=='令一名手牌数大于你的角色交给你一张牌'){ - event.target.chooseCard(1,'h',true).set('ai',function(card){ - return 6-get.value(card); - }); - }else{ - event.target.chooseToDiscard(1,'e',true); - event.finish(); - }; - }else{ - event.finish(); - }; - 'step 3' - if(result.bool){ - event.target.$giveAuto(result.cards,player); - player.gain(result.cards,event.target); + player.storage.nzry_zhenliang=true; + player.discard(result.cards); + target.damage('nocard'); }; }, ai:{ - order:11, + order:5, result:{ - player:function (player){ - if(game.countPlayer(function(current){return (current.countCards('h')>player.countCards('h')||current.countCards('e')>player.countCards('e'))&&get.attitude(player,current)<0&&!player.storage.nzry_feijun.contains(current)})>0||game.countPlayer(function(current){return current.countCards('h')>player.countCards('h')&&get.attitude(player,current)<0})>0||(player.countCards('h')>=2&&game.countPlayer(function(current){return current.countCards('e')>player.countCards('e')&&get.attitude(player,current)<0})>0)) return 1; + target:function(player,target){ + if(Math.abs(target.hp-player.hp)<=1) return -1; }, }, }, }, - "nzry_binglve":{audio:2}, - "nzry_huaiju":{ - marktext:"橘", - init:function(player,skill){ - if(!player.storage[skill]) player.storage[skill]=0; - }, - intro:{ - content:'当前有#个“橘”', - }, - mark:true, + '2':{ audio:2, trigger:{ - global:'gameDrawAfter' - }, - forced:true, - content:function(){ - player.storage.nzry_huaiju+=3; - player.syncStorage('nzry_huaiju'); - game.log(player,'获得了3个“橘”'); - }, - group:['tachibana_effect'], - }, - //没错 这是个橘 - "tachibana_effect":{ - audio:'nzry_huaiju', - trigger:{ - global:['damageBefore','phaseDrawBegin'], - }, - forced:true, - filter:function(event,player){ - return !event.tachibanaed&&event.player.storage.nzry_huaiju&&event.player.storage.nzry_huaiju>0; - }, - content:function(){ - trigger.tachibanaed=true; - player.line(trigger.player,'green'); - if(trigger.name=='damage'){ - trigger.cancel(); - trigger.player.storage.nzry_huaiju--; - if(!trigger.player.storage.nzry_huaiju) trigger.player.unmarkSkill('nzry_huaiju'); - else{ - trigger.player.syncStorage('nzry_huaiju'); - trigger.player.updateMarks('nzry_huaiju'); - } - game.log(trigger.player,'移去了1个“橘”'); - } - else trigger.num++; - }, - }, - "nzry_yili":{ - audio:2, - trigger:{ - player:"phaseUseBegin", - }, - direct:true, - content:function (){ - 'step 0' - player.chooseTarget(get.prompt('nzry_yili'),function(card,player,target){ - return target!=player - }).ai=function(target){ - var player=_status.event.player; - if(player.storage.nzry_huaiju>2||player.hp>2) return get.attitude(player,target); - return -1; - }; - 'step 1' - if(result.bool){ - event.target=result.targets[0]; - if(player.storage.nzry_huaiju>0){ - player.chooseControl().set('choiceList',['流失一点体力','移去一个“橘”']).set('ai',function(){ - if(player.hp>2) return 0; - return 1; - }); - } - else event._result={index:0}; - }else{ - event.finish(); - }; - 'step 2' - player.line(event.target,'green'); - player.logSkill('nzry_huaiju'); - if(result.index==1){ - player.storage.nzry_huaiju--; - player.syncStorage('nzry_huaiju'); - if(player.storage.nzry_huaiju<=0) player.unmarkSkill('nzry_huaiju'); - game.log(player,'移去了1个“橘”'); - }else{ - player.loseHp(); - }; - if(event.target.storage.nzry_huaiju==undefined) event.target.storage.nzry_huaiju=0; - event.target.markSkill('nzry_huaiju'); - event.target.storage.nzry_huaiju++; - event.target.syncStorage('nzry_huaiju'); - game.log(event.target,'获得了1个“橘”'); - }, - }, - "nzry_zhenglun":{ - audio:2, - trigger:{ - player:'phaseDrawBefore' + player:['useCardAfter','respondAfter'], }, filter:function (event,player){ - return player.storage.nzry_huaiju==undefined||player.storage.nzry_huaiju==0; - }, - check:function (event,player){ - return player.countCards('h')>=2||player.skipList.contains('phaseUse'); - }, - content:function(){ - trigger.cancel(); - if(player.storage.nzry_huaiju==undefined) player.storage.nzry_huaiju=0; - player.storage.nzry_huaiju++; - player.syncStorage('nzry_huaiju'); - player.markSkill('nzry_huaiju'); - game.log(player,'获得了1个“橘”'); - }, - }, - "nzry_kuizhu":{ - audio:2, - trigger:{ - player:"phaseDiscardAfter", - }, - direct:true, - filter:function (event,player){ - return event.num>0; - }, - content:function (){ - 'step 0' - event.str1='令至多'+trigger.num+'名角色摸一张牌'; - event.str2='对任意名体力值之和为'+trigger.num+'的角色造成一点伤害'; - player.chooseControl().set('ai',function(){ - if(game.countPlayer(function(current){return get.attitude(player,current)<0&¤t.hp==trigger.num})>0&&trigger.num<=3) return 1; - return 0; - }).set('choiceList',[event.str1,event.str2]).set('prompt','是否发动【溃诛】?'); - 'step 1' - event.control=[event.str1,event.str2][result.index]; - 'step 2' - var str='请选择【溃诛】的目标'; - if(event.bool==false) str='所选目标体力之和不足'+trigger.num+',请重选'; - if(event.control==event.str2){ - player.chooseTarget(str,[1,Infinity],function(card,player,target){ - var targets=ui.selected.targets; - var num=0; - for(var i=0;i=2) player.damage(); - }; - }; - }; - }, - }, - "nzry_zhizheng":{ - audio:2, - group:["nzry_zhizheng_1","nzry_zhizheng_2"], - trigger:{ - player:'useCardAfter' - }, - filter:function (event,player){ - return player.isPhaseUsing(); - }, - forced:true, - popup:false, - content:function(){ - player.storage.nzry_zhizheng++; - }, - subSkill:{ - others:{ - sub:true, - mod:{ - targetEnabled:function(card,player,target){ - if(player.hasSkill('nzry_zhizheng')&&player.isPhaseUsing()&&get.distance(target,player,'attack')>1) return false; - }, - }, - }, - "1":{ - trigger:{ - player:['phaseUseBefore','phaseUseAfter'] - }, - forced:true, - popup:false, - content:function(){ - if(event.triggername=='phaseUseBefore') game.countPlayer(function(current){ - if(current!=player){ - current.addTempSkill('nzry_zhizheng_others','phaseUseAfter'); - } - }); - player.storage.nzry_zhizheng=0; - }, - }, - "2":{ - trigger:{ - player:'phaseUseEnd' - }, - direct:true, - filter:function (event,player){ - return player.storage.nzry_zhizheng1}); - }, - content:function(){ - 'step 0' - player.chooseTarget(get.prompt2('nzry_zhizheng'),function(card,player,target){ - return get.distance(target,player,'attack')>1&&target.countDiscardableCards(player,'he'); - }).ai=function(target){ - return -get.attitude(player,target); - }; - 'step 1' - if(result.bool){ - player.line(result.targets); - player.logSkill('nzry_zhizheng'); - player.discardPlayerCard(result.targets[0],'he',1,true); - }; - }, - }, - }, - }, - "nzry_lijun":{ - unique:true, - global:'nzry_lijun1', - audio:'nzry_lijun1', - zhuSkill:true, - }, - nzry_lijun2:{}, - "nzry_lijun1":{ - audio:2, - trigger:{ - player:'useCardAfter' - }, - filter:function(event,player){ - if(event.card.name!='sha') return false; - if(player.hasSkill('nzry_lijun2')) return false; - if(player.group!='wu') return false; - if(_status.currentPhase!=player) return false; - if(!game.hasPlayer(function(target){ - return player!=target&&target.hasZhuSkill('nzry_lijun',player); - })) return false; - for(var i=0;i0) return true; - return false; - }).set('prompt','是否令'+get.translation(player)+'摸一张牌?'); - } - 'step 2' - if(result.bool) player.draw(); - }, - }, - "nzry_chenglve":{ - mark:true, - locked:false, - zhuanhuanji:true, - marktext:'成', - intro:{ - content:function(storage,player,skill){ - if(player.storage.nzry_chenglve==true) return '出牌阶段限一次,你可以摸两张牌,然后弃置一张手牌。若如此做,直到本回合结束,你使用与弃置牌花色相同的牌无距离和次数限制'; - return '出牌阶段限一次,你可以摸一张牌,然后弃置两张手牌。若如此做,直到本回合结束,你使用与弃置牌花色相同的牌无距离和次数限制'; - }, - }, - enable:"phaseUse", - usable:1, - audio:2, - filter:function(event,player){ - var num=1; - if(player.storage.nzry_chenglve==true) num=0; - return player.countCards('h')>=num; - }, - content:function(){ - 'step 0' - if(player.storage.nzry_chenglve==true){ - player.storage.nzry_chenglve=false; - player.draw(2); - player.chooseToDiscard('h',true); - }else{ - player.storage.nzry_chenglve=true; - player.draw(); - player.chooseToDiscard('h',2,true); - }; - 'step 1' - if(result.bool){ - player.storage.nzry_chenglve1=result.cards; - player.addTempSkill('nzry_chenglve1',{player:'phaseAfter'}); - }; - }, - ai:{ - order:2.7, - result:{ - player:function(player){ - if((player.storage.nzry_chenglve==undefined||player.storage.nzry_chenglve==false)&&player.countCards('h')<3) return 0; - return 1; - }, - }, - }, - }, - "nzry_chenglve1":{ - mod:{ - cardUsable:function(card,player){ - var cards=player.storage.nzry_chenglve1; - for(var i=0;i0&&player.storage.nzry_shicai!=undefined&&!player.storage.nzry_shicai.contains(get.type(event.card,'trick')); - }, - check:function (event,player){ - if(get.type(event.card)=='equip'){ - return get.equipResult(player,player,event.card.name)<=0; - } - return event.card.name!='lebu'&&event.card.name!='bingliang'; - }, - content:function(){ - player.storage.nzry_shicai.push(get.type(trigger.card,'trick')); - if(trigger.name=='useCard'&&['equip','delay'].contains(get.type(trigger.card))) trigger.cancel(); - for(var i=0;i=Math.max(Math.abs(current.hp-player.hp),1); - })&&player.storage.nzry_zhenliang!=true; - }, - filterTarget:function(card,player,target){ - return player.storage.nzry_mingren!=undefined&& - target!=player&& - get.distance(player,target,'attack')<=1&& - player.countCards('he',{color:get.color(player.storage.nzry_mingren[0])})>=Math.max(Math.abs(target.hp-player.hp),1); - }, - content:function(){ - 'step 0' - player.chooseCard('请选择发动【贞良】的牌',Math.max(Math.abs(target.hp-player.hp),1),'he',{color:get.color(player.storage.nzry_mingren[0])},true).set('ai',function(card){ - return 6-get.value(card); - }); - 'step 1' - if(result.bool){ - player.storage.nzry_zhenliang=true; - player.discard(result.cards); - target.damage('nocard'); - }; - }, - ai:{ - order:5, - result:{ - target:function(player,target){ - if(Math.abs(target.hp-player.hp)<=1) return -1; - }, - }, - }, - }, - '2':{ - audio:2, - trigger:{ - player:['useCardAfter','respondAfter'], - }, - filter:function (event,player){ - return _status.currentPhase!=player&& - player.storage.nzry_mingren!=undefined&& - player.storage.nzry_mingren[0]!=undefined&& - get.type(player.storage.nzry_mingren[0])==get.type(event.card)&& - player.storage.nzry_zhenliang==true; - }, - direct:true, - content:function(){ - "step 0" - player.chooseTarget(get.prompt('nzry_zhenliang')).ai=function(target){ - return get.attitude(player,target) - }; - "step 1" - if(result.bool){ - player.storage.nzry_zhenliang=false; - player.line(result.targets); - player.logSkill('nzry_zhenliang'); - result.targets[0].draw(); - }else{ - event.finish(); - }; - }, - }, - }, - }, - 'nzry_jianxiang':{ - audio:2, - trigger:{ - global:'useCard', - }, - filter:function (event,player){ - return event.player!=player&&event.targets&&event.targets.contains(player); + return _status.currentPhase!=player&& + player.storage.nzry_mingren!=undefined&& + player.storage.nzry_mingren[0]!=undefined&& + get.type(player.storage.nzry_mingren[0])==get.type(event.card)&& + player.storage.nzry_zhenliang==true; }, direct:true, content:function(){ "step 0" - player.chooseTarget(get.prompt('nzry_jianxiang'),function(card,player,target){ - return target.isMinHandcard(); - }).ai=function(target){ + player.chooseTarget(get.prompt('nzry_zhenliang')).ai=function(target){ return get.attitude(player,target) }; "step 1" if(result.bool){ + player.storage.nzry_zhenliang=false; player.line(result.targets); - player.logSkill('nzry_jianxiang'); + player.logSkill('nzry_zhenliang'); result.targets[0].draw(); }else{ event.finish(); }; }, }, - "nzry_shenshi":{ - mark:true, - audio:'nzry_shenshi_1', - locked:false, - zhuanhuanji:true, - marktext:'审', - intro:{ - content:function(storage,player,skill){ - if(player.storage.nzry_shenshi==true) return '其他角色对你造成伤害后,你可以观看该角色的手牌,然后交给其一张牌,当前角色回合结束时,若该角色未失去此牌,你将手牌摸至四张'; - return '出牌阶段限一次,你可以将一张牌交给一名手牌数最多的角色,然后对其造成一点伤害,若该角色因此死亡,则你可以令一名角色将手牌摸至四张'; - }, - }, - group:["nzry_shenshi_1","nzry_shenshi_2"], - subSkill:{ - '1':{ - audio:2, - prompt:'出牌阶段限一次,你可以将一张牌交给一名手牌数最多的角色,然后对其造成一点伤害,若该角色因此死亡,则你可以令一名角色将手牌摸至四张', - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return player.countCards('h')>0&&player.storage.nzry_shenshi!=true; - }, - discard:false, - line:true, - prepare:'give', - position:'he', - filterCard:true, - filterTarget:function(card,player,target){ - return target!=player&&!game.hasPlayer(function(current){ - return current!=player&¤t.countCards('h')>target.countCards('h'); - }); - }, - check:function(card){ - return 5-get.value(card); - }, - content:function(){ - 'step 0' - player.storage.nzry_shenshi=true; - target.gain(cards,player); - target.damage('nocard'); - 'step 1' - if(!target.isAlive()){ - player.chooseTarget('请选择一名角色并令其将手牌摸至四张',function(card,player,target){ - return target.countCards('h')<4; - }).ai=function(target){ - return get.attitude(player,target) - }; - }else{ - event.finish(); - }; - 'step 2' - if(result.bool){ - player.line(result.targets); - result.targets[0].draw(4-result.targets[0].countCards('h')) - }; - }, - ai:{ - order:1, - result:{ - target:function(player,target){ - return -1; - }, - }, - }, - }, - '2':{ - audio:2, - trigger:{ - player:'damageAfter', - }, - filter:function (event,player){ - return player.countCards('he')>0&&event.source&&event.source!=player&&player.storage.nzry_shenshi==true; - }, - check:function (event,player){ - return event.source&&event.source.countCards('h')<=2&&player.countCards('h')<4; - }, - content:function(){ - "step 0" - player.storage.nzry_shenshi=false; - player.viewHandcards(trigger.source); - player.chooseCard('he',true).set('ai',function(card){ - return 5-get.value(card); - }); - "step 1" - if(result.bool){ - player.$give(result.cards.length,trigger.source); - trigger.source.gain(result.cards); - trigger.source.storage.nzry_shenshi1=result.cards[0]; - trigger.source.storage.nzry_shenshi2=player; - trigger.source.addSkill('nzry_shenshi1'); - }; - }, - }, - }, + }, + }, + 'nzry_jianxiang':{ + audio:2, + trigger:{ + global:'useCard', + }, + filter:function (event,player){ + return event.player!=player&&event.targets&&event.targets.contains(player); + }, + direct:true, + content:function(){ + "step 0" + player.chooseTarget(get.prompt('nzry_jianxiang'),function(card,player,target){ + return target.isMinHandcard(); + }).ai=function(target){ + return get.attitude(player,target) + }; + "step 1" + if(result.bool){ + player.line(result.targets); + player.logSkill('nzry_jianxiang'); + result.targets[0].draw(); + }else{ + event.finish(); + }; + }, + }, + "nzry_shenshi":{ + mark:true, + audio:'nzry_shenshi_1', + locked:false, + zhuanhuanji:true, + marktext:'审', + intro:{ + content:function(storage,player,skill){ + if(player.storage.nzry_shenshi==true) return '其他角色对你造成伤害后,你可以观看该角色的手牌,然后交给其一张牌,当前角色回合结束时,若该角色未失去此牌,你将手牌摸至四张'; + return '出牌阶段限一次,你可以将一张牌交给一名手牌数最多的角色,然后对其造成一点伤害,若该角色因此死亡,则你可以令一名角色将手牌摸至四张'; }, - "nzry_shenshi1":{ + }, + group:["nzry_shenshi_1","nzry_shenshi_2"], + subSkill:{ + '1':{ audio:2, - trigger:{ - global:'phaseEnd', + prompt:'出牌阶段限一次,你可以将一张牌交给一名手牌数最多的角色,然后对其造成一点伤害,若该角色因此死亡,则你可以令一名角色将手牌摸至四张', + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.countCards('h')>0&&player.storage.nzry_shenshi!=true; }, - forced:true, - popup:false, - filter:function (event,player){ - return player.storage.nzry_shenshi1!=undefined&&player.storage.nzry_shenshi2!=undefined; + discard:false, + line:true, + prepare:'give', + position:'he', + filterCard:true, + filterTarget:function(card,player,target){ + return target!=player&&!game.hasPlayer(function(current){ + return current!=player&¤t.countCards('h')>target.countCards('h'); + }); + }, + check:function(card){ + return 5-get.value(card); }, content:function(){ - var pl=player.storage.nzry_shenshi2; - var card=player.storage.nzry_shenshi1; - if(player.getCards('hej').contains(card)&&4-pl.countCards('h')>0){ - pl.draw(4-pl.countCards('h')); - pl.logSkill('nzry_shenshi'); + 'step 0' + player.storage.nzry_shenshi=true; + target.gain(cards,player); + target.damage('nocard'); + 'step 1' + if(!target.isAlive()){ + player.chooseTarget('请选择一名角色并令其将手牌摸至四张',function(card,player,target){ + return target.countCards('h')<4; + }).ai=function(target){ + return get.attitude(player,target) + }; + } + else{ + event.finish(); }; - player.removeSkill('nzry_shenshi1'); - delete player.storage.nzry_shenshi1; - delete player.storage.nzry_shenshi2; + 'step 2' + if(result.bool){ + player.line(result.targets); + result.targets[0].draw(4-result.targets[0].countCards('h')) + }; + }, + ai:{ + order:1, + result:{ + target:function(player,target){ + return -1; + }, + }, }, }, + '2':{ + audio:2, + trigger:{ + player:'damageAfter', + }, + filter:function (event,player){ + return player.countCards('he')>0&&event.source&&event.source!=player&&player.storage.nzry_shenshi==true; + }, + check:function (event,player){ + return event.source&&event.source.countCards('h')<=2&&player.countCards('h')<4; + }, + content:function(){ + "step 0" + player.storage.nzry_shenshi=false; + player.viewHandcards(trigger.source); + player.chooseCard('he',true).set('ai',function(card){ + return 5-get.value(card); + }); + "step 1" + if(result.bool){ + player.$give(result.cards.length,trigger.source); + trigger.source.gain(result.cards); + trigger.source.storage.nzry_shenshi1=result.cards[0]; + trigger.source.storage.nzry_shenshi2=player; + trigger.source.addSkill('nzry_shenshi1'); + }; + }, + }, + }, + }, + "nzry_shenshi1":{ + audio:2, + trigger:{ + global:'phaseEnd', + }, + forced:true, + popup:false, + filter:function (event,player){ + return player.storage.nzry_shenshi1!=undefined&&player.storage.nzry_shenshi2!=undefined; + }, + content:function(){ + var pl=player.storage.nzry_shenshi2; + var card=player.storage.nzry_shenshi1; + if(player.getCards('hej').contains(card)&&4-pl.countCards('h')>0){ + pl.draw(4-pl.countCards('h')); + pl.logSkill('nzry_shenshi'); + }; + player.removeSkill('nzry_shenshi1'); + delete player.storage.nzry_shenshi1; + delete player.storage.nzry_shenshi2; + }, + }, xinjushou:{ audio:'jushou', @@ -2312,10 +2312,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ silent:true, popup:false, filter:function(event,player){ - return player.storage.reluanji2&&event.card==player.storage.reluanji2; + return player.storage.reluanji2&&event.card==player.storage.reluanji2; }, content:function(){ - delete player.storage.reluanji2; + delete player.storage.reluanji2; }, }, draw:{ @@ -2324,10 +2324,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ silent:true, popup:false, filter:function(event,player){ - return player.storage.reluanji2&&event.card==player.storage.reluanji2; + return player.storage.reluanji2&&event.card==player.storage.reluanji2; }, content:function(){ - player.draw(trigger.targets.length); + player.draw(trigger.targets.length); }, }, } diff --git a/character/sp.js b/character/sp.js index 1f5150eb7..d4cc56548 100755 --- a/character/sp.js +++ b/character/sp.js @@ -408,9 +408,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ derivation:"pangdegong", }, "fengchu_card":{ - type:"takaramono", - fullskin:true, - derivation:"pangdegong", + type:"takaramono", + fullskin:true, + derivation:"pangdegong", }, "xuanjian_card":{ fullskin:true, @@ -431,49 +431,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ basic:{ equipValue:7.5, - order:function (card,player){ - if(player&&player.hasSkillTag('reverseEquip')){ - return 8.5-get.equipValue(card,player)/20; - } - else{ - return 8+get.equipValue(card,player)/20; - } - }, - useful:2, - value:function (card,player){ - var value=0; - var info=get.info(card); - var current=player.getEquip(info.subtype); - if(current&&card!=current){ - value=get.value(current,player); - } - var equipValue=info.ai.equipValue; - if(equipValue==undefined){ - equipValue=info.ai.basic.equipValue; - } - if(typeof equipValue=='function') return equipValue(card,player)-value; - if(typeof equipValue!='number') equipValue=0; - return equipValue-value; - }, - }, - result:{ - target:function (player,target){ - return get.equipResult(player,target,name); - }, }, }, skills:["rw_bagua_skill"], - enable:true, - selectTarget:-1, - filterTarget:function (card,player,target){ - return target==player; - }, - modTarget:true, - allowMultiple:false, - content:function (){ - target.equip(card); - }, - toself:true, }, "rewrite_baiyin":{ derivation:"majun", @@ -498,48 +458,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, basic:{ equipValue:5, - order:function (card,player){ - if(player&&player.hasSkillTag('reverseEquip')){ - return 8.5-get.equipValue(card,player)/20; - } - else{ - return 8+get.equipValue(card,player)/20; - } - }, - useful:2, - value:function (card,player){ - var value=0; - var info=get.info(card); - var current=player.getEquip(info.subtype); - if(current&&card!=current){ - value=get.value(current,player); - } - var equipValue=info.ai.equipValue; - if(equipValue==undefined){ - equipValue=info.ai.basic.equipValue; - } - if(typeof equipValue=='function') return equipValue(card,player)-value; - if(typeof equipValue!='number') equipValue=0; - return equipValue-value; - }, - }, - result:{ - target:function (player,target){ - return get.equipResult(player,target,name); - }, }, }, - enable:true, - selectTarget:-1, - filterTarget:function (card,player,target){ - return target==player; - }, - modTarget:true, - allowMultiple:false, - content:function (){ - target.equip(card); - }, - toself:true, }, "rewrite_lanyinjia":{ derivation:"majun", @@ -551,49 +471,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ equipValue:6, basic:{ - order:function (card,player){ - if(player&&player.hasSkillTag('reverseEquip')){ - return 8.5-get.equipValue(card,player)/20; - } - else{ - return 8+get.equipValue(card,player)/20; - } - }, - useful:2, equipValue:1, - value:function (card,player){ - var value=0; - var info=get.info(card); - var current=player.getEquip(info.subtype); - if(current&&card!=current){ - value=get.value(current,player); - } - var equipValue=info.ai.equipValue; - if(equipValue==undefined){ - equipValue=info.ai.basic.equipValue; - } - if(typeof equipValue=='function') return equipValue(card,player)-value; - if(typeof equipValue!='number') equipValue=0; - return equipValue-value; - }, - }, - result:{ - target:function (player,target){ - return get.equipResult(player,target,name); - }, }, }, - enable:true, - selectTarget:-1, - filterTarget:function (card,player,target){ - return target==player; - }, - modTarget:true, - allowMultiple:false, - content:function (){ - target.equip(card); - }, - toself:true, }, "rewrite_renwang":{ derivation:"majun", @@ -605,48 +485,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ basic:{ equipValue:7.5, - order:function (card,player){ - if(player&&player.hasSkillTag('reverseEquip')){ - return 8.5-get.equipValue(card,player)/20; - } - else{ - return 8+get.equipValue(card,player)/20; - } - }, - useful:2, - value:function (card,player){ - var value=0; - var info=get.info(card); - var current=player.getEquip(info.subtype); - if(current&&card!=current){ - value=get.value(current,player); - } - var equipValue=info.ai.equipValue; - if(equipValue==undefined){ - equipValue=info.ai.basic.equipValue; - } - if(typeof equipValue=='function') return equipValue(card,player)-value; - if(typeof equipValue!='number') equipValue=0; - return equipValue-value; - }, - }, - result:{ - target:function (player,target){ - return get.equipResult(player,target,name); - }, }, }, - enable:true, - selectTarget:-1, - filterTarget:function (card,player,target){ - return target==player; - }, - modTarget:true, - allowMultiple:false, - content:function (){ - target.equip(card); - }, - toself:true, }, "rewrite_tengjia":{ derivation:"majun", @@ -671,49 +511,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, basic:{ equipValue:3, - order:function (card,player){ - if(player&&player.hasSkillTag('reverseEquip')){ - return 8.5-get.equipValue(card,player)/20; - } - else{ - return 8+get.equipValue(card,player)/20; - } - }, - useful:2, - value:function (card,player){ - var value=0; - var info=get.info(card); - var current=player.getEquip(info.subtype); - if(current&&card!=current){ - value=get.value(current,player); - } - var equipValue=info.ai.equipValue; - if(equipValue==undefined){ - equipValue=info.ai.basic.equipValue; - } - if(typeof equipValue=='function') return equipValue(card,player)-value; - if(typeof equipValue!='number') equipValue=0; - return equipValue-value; - }, - }, - result:{ - target:function (player,target){ - return get.equipResult(player,target,name); - }, }, }, skills:["rw_tengjia1","rw_tengjia2","rw_tengjia3","rw_tengjia4"], - enable:true, - selectTarget:-1, - filterTarget:function (card,player,target){ - return target==player; - }, - modTarget:true, - allowMultiple:false, - content:function (){ - target.equip(card); - }, - toself:true, }, "rewrite_zhuge":{ derivation:"majun", @@ -742,57 +542,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, basic:{ equipValue:5, - order:function (card,player){ - if(player&&player.hasSkillTag('reverseEquip')){ - return 8.5-get.equipValue(card,player)/20; - } - else{ - return 8+get.equipValue(card,player)/20; - } - }, - useful:2, - value:function (card,player){ - var value=0; - var info=get.info(card); - var current=player.getEquip(info.subtype); - if(current&&card!=current){ - value=get.value(current,player); - } - var equipValue=info.ai.equipValue; - if(equipValue==undefined){ - equipValue=info.ai.basic.equipValue; - } - if(typeof equipValue=='function') return equipValue(card,player)-value; - if(typeof equipValue!='number') equipValue=0; - return equipValue-value; - }, }, tag:{ valueswap:1, }, - result:{ - target:function (player,target){ - return get.equipResult(player,target,name); - }, - }, }, skills:["zhuge_skill"], - enable:true, - selectTarget:-1, - filterTarget:function (card,player,target){ - return target==player; - }, - modTarget:true, - allowMultiple:false, - content:function (){ - target.equip(card); - }, - toself:true, }, }, skill:{ - //和沙摩柯一起上线的新服三将 - spjiedao:{ + //和沙摩柯一起上线的新服三将 + spjiedao:{ audio:2, trigger:{ source:"damageBegin", @@ -801,25 +561,25 @@ game.import('character',function(lib,game,ui,get,ai,_status){ direct:true, popup:false, content:function (){ - 'step 0' - event.num=player.maxHp-player.hp; - if(event.num>0) player.chooseBool(get.prompt2('spjiedao',trigger.player)).ai=function(){ - if(get.attitude(player,trigger.player)>=-1) return false; - return !trigger.player.getEquip('baiyin')&&!trigger.player.getEquip('rewrite_baiyin'); - }; - 'step 1' - if(result.bool){ - player.logSkill('spjiedao',trigger.player); - trigger.num+=num; - var next=game.createEvent('spjiedao_after',null,trigger.getParent()); - next.player=player; - next.target=trigger.player; - next.num=num; - next.setContent(function(){ - if(target.isAlive()) player.chooseToDiscard(num,true); - }); - } - }, + 'step 0' + event.num=player.maxHp-player.hp; + if(event.num>0) player.chooseBool(get.prompt2('spjiedao',trigger.player)).ai=function(){ + if(get.attitude(player,trigger.player)>=-1) return false; + return !trigger.player.getEquip('baiyin')&&!trigger.player.getEquip('rewrite_baiyin'); + }; + 'step 1' + if(result.bool){ + player.logSkill('spjiedao',trigger.player); + trigger.num+=num; + var next=game.createEvent('spjiedao_after',null,trigger.getParent()); + next.player=player; + next.target=trigger.player; + next.num=num; + next.setContent(function(){ + if(target.isAlive()) player.chooseToDiscard(num,true); + }); + } + }, }, biaozhao:{ audio:2, @@ -832,21 +592,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, direct:true, filter:function (event,player){ - return player.countCards('he')>0&&!player.storage.biaozhao; - }, + return player.countCards('he')>0&&!player.storage.biaozhao; + }, content:function (){ - 'step 0' - player.chooseCard('he',get.prompt2('biaozhao')).ai=function(card){ - return 6-get.value(card); - } - 'step 1' - if(result.bool){ - player.logSkill('biaozhao'); - player.lose(result.cards,ui.special,'toStorage'); - player.storage.biaozhao=result.cards; - player.markSkill('biaozhao'); - } - }, + 'step 0' + player.chooseCard('he',get.prompt2('biaozhao')).ai=function(card){ + return 6-get.value(card); + } + 'step 1' + if(result.bool){ + player.logSkill('biaozhao'); + player.lose(result.cards,ui.special,'toStorage'); + player.storage.biaozhao=result.cards; + player.markSkill('biaozhao'); + } + }, }, "biaozhao2":{ trigger:{ @@ -855,33 +615,33 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, audio:"biaozhao", filter:function (event,player){ - if(!player.storage.biaozhao) return false; - if(event.getParent().name=='biaozhao2') return false; - var suit=get.suit(player.storage.biaozhao[0]); - var num=get.number(player.storage.biaozhao[0]); - for(var i=0;ievent.num) event.num=current.countCards('h'); - }); - player.chooseTarget('是否令一名角色将手牌摸至'+event.num+'张并回复1点体力?').ai=function(target){ - var num=Math.min(event.num-target.countCards('h'),5); - if(target.isDamaged()) num++; - return num*get.attitude(_status.event.player,target); - }; - "step 1" - if(result.bool){ - var target=result.targets[0]; - player.line(target,'green'); - var draw=Math.min(num-target.countCards('h'),5); - if(draw) target.draw(draw); - target.recover(); - } - }, + "step 0" + var card=player.storage.biaozhao[0]; + delete player.storage.biaozhao; + player.unmarkSkill('biaozhao'); + game.cardsDiscard(card); + event.num=0; + game.countPlayer(function(current){ + if(current.countCards('h')>event.num) event.num=current.countCards('h'); + }); + player.chooseTarget('是否令一名角色将手牌摸至'+event.num+'张并回复1点体力?').ai=function(target){ + var num=Math.min(event.num-target.countCards('h'),5); + if(target.isDamaged()) num++; + return num*get.attitude(_status.event.player,target); + }; + "step 1" + if(result.bool){ + var target=result.targets[0]; + player.line(target,'green'); + var draw=Math.min(num-target.countCards('h'),5); + if(draw) target.draw(draw); + target.recover(); + } + }, }, yechou:{ audio:2, @@ -925,27 +685,27 @@ game.import('character',function(lib,game,ui,get,ai,_status){ direct:true, skillAnimation:true, content:function (){ - var next=game.createEvent('yechou',null,trigger.parent); - next.forceDie=true; - next.player=player; - next.setContent(lib.skill.yechou.contentx); - }, + var next=game.createEvent('yechou',null,trigger.parent); + next.forceDie=true; + next.player=player; + next.setContent(lib.skill.yechou.contentx); + }, contentx:function (){ - "step 0" - player.chooseTarget(get.prompt2('yechou'),function(card,player,target){ - return player!=target&&target.maxHp-target.hp>1 - }).set('forceDie',true).set('ai',function(target){ - var num=get.attitude(_status.event.player,target); - return -num; - }); - "step 1" - if(result.bool){ - var target=result.targets[0]; - player.logSkill('yechou',target); - player.line(target,'green'); - target.addTempSkill('yechou2',{player:'phaseBeginStart'}); - } - }, + "step 0" + player.chooseTarget(get.prompt2('yechou'),function(card,player,target){ + return player!=target&&target.maxHp-target.hp>1 + }).set('forceDie',true).set('ai',function(target){ + var num=get.attitude(_status.event.player,target); + return -num; + }); + "step 1" + if(result.bool){ + var target=result.targets[0]; + player.logSkill('yechou',target); + player.line(target,'green'); + target.addTempSkill('yechou2',{player:'phaseBeginStart'}); + } + }, ai:{ expose:0.5, }, @@ -974,116 +734,116 @@ game.import('character',function(lib,game,ui,get,ai,_status){ enable:"phaseUse", usable:1, filterTarget:function (card,player,target){ - return target!=player; - }, + return target!=player; + }, content:function (){ - "step 0" - var num=4; - if(player.storage.xingshen){ - num+=player.storage.xingshen; - player.storage.xingshen=0; - player.unmarkSkill('xingshen'); - } - event.cards=get.cards(num); - player.showCards(event.cards); - "step 1" - event.preResult=lib.skill.yanjiao.getResult(cards); - if(!event.preResult.length){ - game.cardsDiscard(cards); - player.addTempSkill('yanjiao2'); - event.finish(); - } - else{ - var choiceList=ui.create.dialog('请选择一种方案','hidden','forcebutton'); - for(var i=0;i1) player.addTempSkill('yanjiao2'); - } - }, + "step 0" + var num=4; + if(player.storage.xingshen){ + num+=player.storage.xingshen; + player.storage.xingshen=0; + player.unmarkSkill('xingshen'); + } + event.cards=get.cards(num); + player.showCards(event.cards); + "step 1" + event.preResult=lib.skill.yanjiao.getResult(cards); + if(!event.preResult.length){ + game.cardsDiscard(cards); + player.addTempSkill('yanjiao2'); + event.finish(); + } + else{ + var choiceList=ui.create.dialog('请选择一种方案','hidden','forcebutton'); + for(var i=0;i1) player.addTempSkill('yanjiao2'); + } + }, getResult:function (cards){ - var cl=cards.length; - var maxmium=Math.pow(3,cl); - var filter=function(list){ - if(!list[1].length||!list[0].length) return false; - var num1=0; - for(var i=0;i4) player.storage.xingshen=4; - player.markSkill('xingshen'); - }, + player.draw(player.isMinHandcard()?2:1); + if(!player.storage.xingshen) player.storage.xingshen=0; + player.storage.xingshen+=player.isMinHp()?2:1; + if(player.storage.xingshen>4) player.storage.xingshen=4; + player.markSkill('xingshen'); + }, }, - //统率三军诸葛瑾和文聘 - "zhenwei_three":{ + //统率三军诸葛瑾和文聘 + "zhenwei_three":{ global:"zhenwei_three_others", subSkill:{ others:{ mod:{ globalTo:function (from,to,distance){ - if(from.side!=to.side&&game.hasPlayer(function(current){ - return current!=to&¤t.side==to.side&¤t.hasSkill('zhenwei_three'); - }))return distance+1; - }, + if(from.side!=to.side&&game.hasPlayer(function(current){ + return current!=to&¤t.side==to.side&¤t.hasSkill('zhenwei_three'); + }))return distance+1; + }, }, sub:true, }, @@ -1226,8 +986,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ game.delay(); }, }, - //变权移植 - wanwei:{ + //变权移植 + wanwei:{ trigger:{target:['rewriteGainResult','rewriteDiscardResult']}, direct:true, filter:function(event,player){ @@ -1492,129 +1252,129 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, }, - zhengbi:{ - trigger:{player:'phaseUseBegin'}, - filter:function(event,player){ - //if(event.player!=player) return false; - return game.hasPlayer(function(current){return current!=player&¤t.isHealthy()})||player.countCards('h',{type:'basic'}); - }, - content:function(){ - 'step 0' - var choices=[]; - if(game.hasPlayer(function(current){return current.isHealthy()})) choices.push('选择一名未受伤的角色'); - if(player.countCards('h',{type:'basic'})) choices.push('交给一名角色一张基本牌'); - player.chooseControl(choices,ui.create.dialog('征辟

选择一项
','hidden')).set('ai',function(){ - if(choices.length>1){ - return 1; - } - return 0; - }); - 'step 1' - if(result.control=='选择一名未受伤的角色') player.chooseTarget('征辟

选择一名未受伤的角色,你对其使用牌没有次数和距离限制直到回合结束
',function(card,player,target){ - return target!=player&&target.isHealthy(); - },true); - else player.chooseCardTarget({ - prompt:'征辟

交给一名其他角色一张基本牌,然后该角色交给你一张非基本牌或两张基本牌
', - position:'h', - filterCard:function(card){return get.type(card)=='basic'}, - filterTarget:function(card,player,target){ - return target!=player; - }, - ai1:function(card){return 7-get.value(card)}, - //ai2:function(card,player,target){} - }).set('forced',true); - 'step 2' - event.target=result.targets[0]; - player.line(result.targets,'green'); - if(result.cards.length){ - event.cards=result.cards; - result.targets[0].gain(result.cards,player); - player.$give(result.cards,result.targets[0]); - } - else{ - player.storage.zhengbi_eff1=result.targets[0]; - player.addTempSkill('zhengbi_eff1'); - event.finish(); - } - 'step 3' - var choices=[]; - if(target.countCards('he',{type:['trick','delay','equip']})) choices.push('一张非基本牌'); - if(target.countCards('h',{type:'basic'})>1) choices.push('两张基本牌'); - if(choices.length) target.chooseControl(choices,ui.create.dialog('征辟

交给'+get.translation(player)+'
')).set('ai',function(event,player){ - if(choices.length>1){ - if(player.countCards('he',{type:['trick','delay','equip']},function(card){return get.value(card)<7})) return 0; - return 1; - } - return 0; - }); - else{ - if(target.countCards('h')){ - var cards=target.getCards('h'); - player.gain(cards,target); - target.$giveAuto(cards,player); - event.finish(); - } - else event.finish(); - } - 'step 4' - var check=(result.control=='一张非基本牌'); - target.chooseCard('he',(check?1:2),{type:(check?['trick','delay','equip']:'basic')},true); - 'step 5' - if(result.cards){ - player.gain(result.cards,target); - target.$giveAuto(result.cards,player); - } - }, - subSkill:{ - eff1:{ - sub:true, - mod:{ - targetInRange:function (card,player,target){ - if(target==player.storage.zhengbi_eff1) return true; - }, - cardUsable:function (card,player,num){ - if(typeof num=='number'&&player.storage.zhengbi_eff1&&player.storage.zhengbi_eff1.isAlive()) return num+100; - }, - playerEnabled:function (card,player,target){ - if(player.storage.zhengbi_eff1.isAlive()&&player.storage.zhengbi_eff1&&target!=player.storage.zhengbi_eff1){ - var num=player.getCardUsable(card)-100; - if(num<=0) return false; - } - }, - }, - onremove:true, - }, - eff2:{sub:true}, - } - }, - fengying:{ - limited:true, - enable:'phaseUse', - position:'h', - filterCard:true, - selectCard:-1, - filter:function(event,player){ - return !player.storage.fengying&&player.countCards('h')>0; - }, - filterTarget:function(card,player,target){ - return target==player; - }, - selectTarget:-1, - discard:false, - lose:false, - content:function(){ - 'step 0' - player.awakenSkill('fengying'); - player.storage.fengying=true; - player.insertPhase(); - var evt=_status.event.getParent('phaseUse'); - if(evt&&evt.name=='phaseUse'){ - evt.skipped=true; + zhengbi:{ + trigger:{player:'phaseUseBegin'}, + filter:function(event,player){ + //if(event.player!=player) return false; + return game.hasPlayer(function(current){return current!=player&¤t.isHealthy()})||player.countCards('h',{type:'basic'}); + }, + content:function(){ + 'step 0' + var choices=[]; + if(game.hasPlayer(function(current){return current.isHealthy()})) choices.push('选择一名未受伤的角色'); + if(player.countCards('h',{type:'basic'})) choices.push('交给一名角色一张基本牌'); + player.chooseControl(choices,ui.create.dialog('征辟

选择一项
','hidden')).set('ai',function(){ + if(choices.length>1){ + return 1; } - 'step 1' - var cards=player.getCards('h'); - player.discard(cards); - player.chooseTarget('请选择至多'+cards.length+'名角色,令这些角色将手牌摸至手牌上限。',[1,cards.length],function(card,player,target){ + return 0; + }); + 'step 1' + if(result.control=='选择一名未受伤的角色') player.chooseTarget('征辟

选择一名未受伤的角色,你对其使用牌没有次数和距离限制直到回合结束
',function(card,player,target){ + return target!=player&&target.isHealthy(); + },true); + else player.chooseCardTarget({ + prompt:'征辟

交给一名其他角色一张基本牌,然后该角色交给你一张非基本牌或两张基本牌
', + position:'h', + filterCard:function(card){return get.type(card)=='basic'}, + filterTarget:function(card,player,target){ + return target!=player; + }, + ai1:function(card){return 7-get.value(card)}, + //ai2:function(card,player,target){} + }).set('forced',true); + 'step 2' + event.target=result.targets[0]; + player.line(result.targets,'green'); + if(result.cards.length){ + event.cards=result.cards; + result.targets[0].gain(result.cards,player); + player.$give(result.cards,result.targets[0]); + } + else{ + player.storage.zhengbi_eff1=result.targets[0]; + player.addTempSkill('zhengbi_eff1'); + event.finish(); + } + 'step 3' + var choices=[]; + if(target.countCards('he',{type:['trick','delay','equip']})) choices.push('一张非基本牌'); + if(target.countCards('h',{type:'basic'})>1) choices.push('两张基本牌'); + if(choices.length) target.chooseControl(choices,ui.create.dialog('征辟

交给'+get.translation(player)+'
')).set('ai',function(event,player){ + if(choices.length>1){ + if(player.countCards('he',{type:['trick','delay','equip']},function(card){return get.value(card)<7})) return 0; + return 1; + } + return 0; + }); + else{ + if(target.countCards('h')){ + var cards=target.getCards('h'); + player.gain(cards,target); + target.$giveAuto(cards,player); + event.finish(); + } + else event.finish(); + } + 'step 4' + var check=(result.control=='一张非基本牌'); + target.chooseCard('he',(check?1:2),{type:(check?['trick','delay','equip']:'basic')},true); + 'step 5' + if(result.cards){ + player.gain(result.cards,target); + target.$giveAuto(result.cards,player); + } + }, + subSkill:{ + eff1:{ + sub:true, + mod:{ + targetInRange:function (card,player,target){ + if(target==player.storage.zhengbi_eff1) return true; + }, + cardUsable:function (card,player,num){ + if(typeof num=='number'&&player.storage.zhengbi_eff1&&player.storage.zhengbi_eff1.isAlive()) return num+100; + }, + playerEnabled:function (card,player,target){ + if(player.storage.zhengbi_eff1.isAlive()&&player.storage.zhengbi_eff1&&target!=player.storage.zhengbi_eff1){ + var num=player.getCardUsable(card)-100; + if(num<=0) return false; + } + }, + }, + onremove:true, + }, + eff2:{sub:true}, + } + }, + fengying:{ + limited:true, + enable:'phaseUse', + position:'h', + filterCard:true, + selectCard:-1, + filter:function(event,player){ + return !player.storage.fengying&&player.countCards('h')>0; + }, + filterTarget:function(card,player,target){ + return target==player; + }, + selectTarget:-1, + discard:false, + lose:false, + content:function(){ + 'step 0' + player.awakenSkill('fengying'); + player.storage.fengying=true; + player.insertPhase(); + var evt=_status.event.getParent('phaseUse'); + if(evt&&evt.name=='phaseUse'){ + evt.skipped=true; + } + 'step 1' + var cards=player.getCards('h'); + player.discard(cards); + player.chooseTarget('请选择至多'+cards.length+'名角色,令这些角色将手牌摸至手牌上限。',[1,cards.length],function(card,player,target){ return target.countCards('h')event.player.hp; }, - content:function (){ + content:function (){ "step 0" var check=lib.skill.new_meibu.checkx(trigger,player); player.chooseToDiscard(get.prompt('new_meibu',trigger.player),'he').set('ai',function(card){ @@ -2036,576 +1796,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ cardEnabled:function (card){if(card.name=='sha') return false}, }, }, - //双牌打出闪: - yizan1:{ - trigger:{player:'chooseToRespondBegin'}, - filter:function(event,player){ - //if(event.responded) return false; - //if(event.filterCard({name:'wuxie'})) return false; - if(!event.filterCard({name:'shan'})) return false; - //if(player.hasSkill('yizan4')) return false; - //if(event.parent.name!='sha') return false; - var hs=player.getCards('h',{type:'basic'}); - for(var i=0;i0&&player.countCards('he')>1; - }, - init:function (player){ - player.unmarkSkill('yizan'); - player.storage.yizan=[]; - player.syncStorage('yizan'); - }, - intro:{ - content:"已发动了#次翊赞", - }, - group:["yizan1","yizan5"], - chooseButton:{ - dialog:function (event,player){ - var list=[]; - if(event.filterCard({name:'sha'},player,event)){ - list.push(['基本','','sha']); - list.push(['基本','','sha','fire']); - list.push(['基本','','sha','thunder']); - } - if(event.filterCard({name:'tao'},player,event)){ - list.push(['基本','','tao']); - } - if(event.filterCard({name:'jiu'},player,event)){ - list.push(['基本','','jiu']); - } - return ui.create.dialog('翊赞',[list,'vcard'],'hidden'); - }, - check:function (button){ - var player=_status.event.player; - var card={name:button.link[2],nature:button.link[3]}; - if(game.hasPlayer(function(current){ - return player.canUse(card,current)&&get.effect(current,card,player,player)>0; - })){ - switch(button.link[2]){ - case 'tao':return 5; - case 'jiu':return 3.01; - case 'sha': - if(button.link[3]=='fire') return 2.95; - else if(button.link[3]=='fire') return 2.92; - else return 2.9; - } - } - return 0; - }, - backup:function (links,player){ - return { - selectCard:function (){ - // if(_status.event.player.storage.longyuan) return 1; - return 2; - }, - filterCard:function (card){ - if(ui.selected.cards.length){ - if(get.type(ui.selected.cards[0],'trick')=='basic') return true; - return get.type(card)=='basic'; - } - return true; - }, - viewAs:{name:links[0][2],nature:links[0][3]}, - position:'he', - complexCard:true, - popname:true, - precontent:function(){ - player.storage.yizan++; - player.markSkill('yizan'); - player.update(); - }, - } - }, - prompt:function (links,player){ - return '你可以将两张牌(其中至少一张是基本牌)当'+get.translation(links[0][3]||'')+get.translation(links[0][2])+'使用或打出'; - }, - }, - ai:{ - order:function (){ - var player=_status.event.player; - var event=_status.event; - if(!player.storage.yizan.jiu&&event.filterCard({name:'jiu'},player,event)&&get.effect(player,{name:'jiu'})>0){ - return 3.1; - } - return 2.9; - }, - save:true, - respondSha:true, - respondShan:true, - skillTagFilter:function (player,tag,arg){ - if(player.hasCard(function(card){ - return get.color(card)=='black'&&get.type(card)!='basic'; - },'he')){ - if(!player.storage.yizan) player.storage.yizan={}; - if(tag=='respondSha'){ - if(arg!='use') return false; - if(player.storage.yizan.sha) return false; - } - else{ - if(player.storage.yizan.tao&&player.storage.yizan.jiu) return false; - } - } - else{ - return false; - } - }, - result:{ - player:1, - }, - }, - }, - longyuan:{ - audio:2, - unique:true, - trigger:{ - player:["respond","useCard"], - }, - forced:true, - filter:function (event,player){ - return player.storage.yizan>=3; - }, - content:function (){ - 'step 0' - player.$fullscreenpop('龙跃于渊','fire'); - 'step 1' - player.addSkill('yizan2'); - - player.removeSkill('yizan'); - - player.awakenSkill('longyuan'); - - //player.removeSkill('longyuan'); - - player.update(); - - }, - }, - //单牌使用: - "yizan2":{ - enable:["chooseToRespond","chooseToUse"], - filter:function (event,player){ - return player.countCards('h',{type:'basic'})>0; - }, - group:["yizan3","yizan6"], - chooseButton:{ - dialog:function (event,player){ - var list=[]; - if(event.filterCard({name:'sha'},player,event)){ - list.push(['基本','','sha']); - list.push(['基本','','sha','fire']); - list.push(['基本','','sha','thunder']); - } - if(event.filterCard({name:'tao'},player,event)){ - list.push(['基本','','tao']); - } - if(event.filterCard({name:'jiu'},player,event)){ - list.push(['基本','','jiu']); - } - return ui.create.dialog('翊赞',[list,'vcard'],'hidden'); - }, - check:function (button){ - var player=_status.event.player; - var card={name:button.link[2],nature:button.link[3]}; - if(game.hasPlayer(function(current){ - return player.canUse(card,current)&&get.effect(current,card,player,player)>0; - })){ - switch(button.link[2]){ - case 'tao':return 5; - case 'jiu':return 3.01; - case 'sha': - if(button.link[3]=='fire') return 2.95; - else if(button.link[3]=='fire') return 2.92; - else return 2.9; - } - } - return 0; - }, - backup:function (links,player){ - return { - /*selectCard:function (){ - return 1; - },*/ - filterCard:function (card){ - return get.type(card)=='basic'; - }, - viewAs:{name:links[0][2],nature:links[0][3]}, - position:'h', - //complexCard:true, - popname:true, - } - }, - prompt:function (links,player){ - return '你可以将一张基本牌当'+get.translation(links[0][3]||'')+get.translation(links[0][2])+'使用或打出'; - }, - }, - ai:{ - order:function (){ - var player=_status.event.player; - var event=_status.event; - if(!player.storage.yizan2.jiu&&event.filterCard({name:'jiu'},player,event)&&get.effect(player,{name:'jiu'})>0){ - return 3.1; - } - return 2.9; - }, - save:true, - //respondSha:true, - // respondShan:true, - skillTagFilter:function (player,tag,arg){ - if(player.hasCard(function(card){ - return get.color(card)=='black'&&get.type(card)!='basic'; - },'he')){ - if(!player.storage.yizan2) player.storage.yizan2={}; - if(tag=='respondSha'){ - if(arg!='use') return false; - if(player.storage.yizan2.sha) return false; - } - else{ - if(player.storage.yizan2.tao&&player.storage.yizan2.jiu) return false; - } - } - else{ - return false; - } - }, - result:{ - player:1, - }, - }, - }, - wuniang:{ - audio:2, - trigger:{ - player:["useCard","respond"], - }, - direct:true, - priority:2018, - filter:function (event,player){ - return event.card&&event.card.name=='sha'&&event.notLink(); - }, - content:function (){ - "step 0" - var check; - var i,num=game.countPlayer(function(current){ - return current!=player&¤t.countCards('he')>0; - }); - check=(num>=2); - player.chooseTarget(get.prompt('wuniang'),1,function(card,player,target){ - return target.countCards('he')>0&&player!=target; - },function(target){ - if(!_status.event.aicheck) return 0; - var att=get.attitude(_status.event.player,target); - if(target.hasSkill('tuntian')) return att/10; - return 1-att; - }).set('aicheck',check); - "step 1" - if(result.bool){ - var target=result.targets[0]; - player.logSkill('wuniang',target); - player.gainPlayerCard(target,'he',true); - target.draw(); - } - else{ - event.finish(); - } - "step 2" - for(var i=0;i0; - }); - } - } - "step 3" - if(result.bool){ - for(var i=0;i刘繇最初被推举为孝廉,授郎中。任下邑县长时,因拒郡守请托而弃官。后被征辟为司空掾属,除授侍御史,因战乱而不到任,避居淮浦。兴平元年(194年),被任命为扬州刺史。他先后与袁术、孙策交战,一度被朝廷加授为扬州牧、振武将军,但最终还是败归丹徒。此后,刘繇又击破反叛的笮融,旋即病逝,年四十二。", liuyan:"刘焉(?-194年),字君郎(《华阳国志》又作君朗)。江夏郡竟陵县(今湖北省天门市)人。东汉末年宗室、军阀,汉末群雄之一,西汉鲁恭王刘余之后。
刘焉初以汉朝宗室身份,拜为中郎,历任雒阳令、冀州刺史、南阳太守、宗正、太常等官。因益州刺史郄俭在益州大肆聚敛,贪婪成风,加上当时天下大乱。刘焉欲取得一安身立命之所,割据一方,于是向朝廷求为益州牧,封阳城侯,前往益州整饬吏治。郄俭为黄巾军所杀,刘焉进入益州,派张鲁盘踞汉中,张鲁截断交通,斩杀汉使,从此益州与中央道路不通。刘焉进一步对内打击地方豪强,巩固自身势力,益州因而处于半独立的状态。兴平元年(194年),刘焉因背疮迸发而逝世,其子刘璋继领益州牧。", }, - characterTitle:{ - //lijue:"体力上限:6", - }, + characterTitle:{}, perfectPair:{ lijue:['guosi','jiaxu'], zhangji:['zhangxiu','drlt_zhangxiu','zoushi'], @@ -682,7 +680,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } else{ ui.cardPile.appendChild(cards[i]); - } + } } game.updateRoundNumber(); game.log(player,'把',get.cnNumber(cards.length),'张牌放在了牌堆里'); @@ -1076,7 +1074,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.card=result[0]; if(event.card&&get.owner(event.card)==player&&(event.ablers.length>1||event.ablers[0]!=player)){ player.chooseTarget('是否将'+get.translation(event.card)+'交给其他角色?',function(card,player,target){ - return event.ablers.contains(target)&&target!=player; + return event.ablers.contains(target)&&target!=player; }).ai=function(){ return false; }; @@ -1356,7 +1354,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:"mark", }, filter:function(event,player){ - return player.storage.xinfu_xionghuo>0; + return player.storage.xinfu_xionghuo>0; }, filterTarget:function (card,player,target){ if(target.storage.xionghuo!=undefined&&target.storage.xionghuo>0) return false; @@ -2200,20 +2198,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var attitude=get.attitude(player,trigger.player); if(attitude==0||(resulth==0&&results==0)) return '取消'; if(attitude>0){ - if(results>0){ - if(resulth>results) return '红桃5'; - return '黑桃5'; - } - else if(resulth>0) return '红桃5'; - return '取消'; + if(results>0){ + if(resulth>results) return '红桃5'; + return '黑桃5'; + } + else if(resulth>0) return '红桃5'; + return '取消'; } else{ if(results<0){ - if(resulth0; @@ -4631,7 +4629,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function (event,player){ if(!player.storage.yizan&&player.countCards('he')<2) return false; if(event.filterCard({name:'sha'},player,event)|| - event.filterCard({name:'jiu'},player,event)|| + event.filterCard({name:'jiu'},player,event)|| event.filterCard({name:'tao'},player,event)){ return player.hasCard(function(card){ return get.type(card)=='basic'; @@ -4911,10 +4909,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ '将'+get.cnNumber(event.num)+'张牌交给一名其他角色', '弃置'+get.cnNumber(event.num)+'张牌', ]).set('ai',function(){ - if(game.hasPlayer(function(current){ - return current!=player&&get.attitude(player,current)>2; - })) return 0; - return 1; + if(game.hasPlayer(function(current){ + return current!=player&&get.attitude(player,current)>2; + })) return 0; + return 1; }); 'step 3' if(result.index==0){ @@ -5123,7 +5121,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(result.bool){ player.storage.xinfu_zhaoxin.remove(event.card); player.$give(event.card,trigger.player); - trigger.player.gain(event.card,'fromStorage'); + trigger.player.gain(event.card,'fromStorage'); if(player.storage.xinfu_zhaoxin.length) player.markSkill('xinfu_zhaoxin'); else player.unmarkSkill('xinfu_zhaoxin'); player.chooseBool('是否对'+get.translation(trigger.player)+'造成一点伤害?').ai=function(){ diff --git a/character/yijiang.js b/character/yijiang.js index 3b5a2e08a..371a2d985 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -200,64 +200,64 @@ game.import('character',function(lib,game,ui,get,ai,_status){ usable:1, position:'he', filterTarget:function (card,player,target){ - return target!=player; - }, + return target!=player; + }, complexCard:true, complexSelect:true, selectTarget:function (){ - return ui.selected.cards.length; - }, + return ui.selected.cards.length; + }, filterCard:true, selectCard:function (){ - var player=_status.event.player; - return [1,player.hp]; - }, + var player=_status.event.player; + return [1,player.hp]; + }, check:function (cardx){ - var player=_status.event.player; - var number=game.countPlayer(function(target){ - if(player==target) return false; - var pe=player.countCards('e',function(card){ - return card!=cardx&&ui.selected.cards.contains(card)==false; - }); - var te=target.countCards('e'); - if(pe>te&&target.isDamaged()&&get.attitude(player,target)>2) return true; - else if(pe==te&&get.attitude(player,target)>2) return true; - else if(pete&&target.isDamaged()&&get.attitude(player,target)>2) return true; + else if(pe==te&&get.attitude(player,target)>2) return true; + else if(pete) return "回复体力"; - else if(pe==te) return "摸一张牌"; - else if(pete) target.recover(); - else if(pe==te) target.draw(); - else if(pete) return "回复体力"; + else if(pe==te) return "摸一张牌"; + else if(pete) target.recover(); + else if(pe==te) target.draw(); + else if(pete&&target.isDamaged()) return 2; - else if(pe==te) return 1; - else if(pete&&target.isDamaged()) return 2; + else if(pe==te) return 1; + else if(pe0){ - for(var i=0;i
  • 已对'+str+'发动过〖残韵〗'); - } - return str2; - }, + var str=''; + var str2='
  • 出牌阶段限一次,你可以弃置至多X张牌并选择等量的其他角色(不能选择已经成为过〖残韵〗目标的角色)。这些角色中,装备区内牌数少于你的回复1点体力,等于你的摸一张牌,多于你的失去1点体力。若你以此法指定的角色数等于X,则你摸一张牌。(X为你的体力值)'; + if(storage.length>0){ + for(var i=0;i
  • 已对'+str+'发动过〖残韵〗'); + } + return str2; + }, }, mark:true, enable:"phaseUse", usable:1, check:function (cardx){ - var player=_status.event.player; - var number=game.countPlayer(function(target){ - if(player==target) return false; - var pe=player.countCards('e',function(card){ - return card!=cardx&&ui.selected.cards.contains(card)==false; - }); - var te=target.countCards('e'); - if(pe>te&&target.isDamaged()&&get.attitude(player,target)>2) return true; - else if(pete&&target.isDamaged()&&get.attitude(player,target)>2) return true; + else if(pete) return "回复体力"; - else if(pe==te) return "摸一张牌"; - else if(pete) return "回复体力"; + else if(pe==te) return "摸一张牌"; + else if(pete) target.recover(); - else if(pe==te) target.draw(); - else if(pete) target.recover(); + else if(pe==te) target.draw(); + else if(pete&&target.isDamaged()) return 2; - else if(pe==te) return 1; - else if(pete&&target.isDamaged()) return 2; + else if(pe==te) return 1; + else if(petarget.hp; + return target.countCards('h')>target.hp; }).ai=function(target){ return -get.attitude(_status.event.player,target)*(target.countCards('e')+1); }; @@ -2427,7 +2427,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, chooseButton:{ dialog:function(event,player){ - var list=[]; + var list=[]; for(var i=0;i当游戏中仅剩四名或更少角色时(七人以下游戏时改为三名或更少),若此时全场没有超过一名势力相同的角色,则从一个新的回合开始,游戏进入鏖战模式直至游戏结束。
    ◇在鏖战模式下,【桃】只能当做【杀】或【闪】使用或打出,不能用来回复体力。
    注:进入鏖战模式后,即使之后有两名或者更多势力相同的角色出现,仍然不会取消鏖战模式。', + name:'鏖战模式', + init:true, + intro:'若开启此选项,则将在游戏中引入“鏖战模式”的规则:
    当游戏中仅剩四名或更少角色时(七人以下游戏时改为三名或更少),若此时全场没有超过一名势力相同的角色,则从一个新的回合开始,游戏进入鏖战模式直至游戏结束。
    ◇在鏖战模式下,【桃】只能当做【杀】或【闪】使用或打出,不能用来回复体力。
    注:进入鏖战模式后,即使之后有两名或者更多势力相同的角色出现,仍然不会取消鏖战模式。', }, connect_viewnext:{ - name:'观看下家副将', - init:false, - intro:'若开启此选项,所有的玩家将在挑选武将后,分发起始手牌之前,分别观看自己下家的副将。', + name:'观看下家副将', + init:false, + intro:'若开启此选项,所有的玩家将在挑选武将后,分发起始手牌之前,分别观看自己下家的副将。', }, connect_zhulian:{ name:'珠联璧合', @@ -4595,27 +4595,27 @@ intro:'第一个明置身份牌的角色可获得摸牌奖励' }, aozhan:{ - name:'鏖战模式', - init:true, - intro:'若开启此选项,则将在游戏中引入“鏖战模式”的规则:
    当游戏中仅剩四名或更少角色时(七人以下游戏时改为三名或更少),若此时全场没有超过一名势力相同的角色,则从一个新的回合开始,游戏进入鏖战模式直至游戏结束。
    ◇在鏖战模式下,【桃】只能当做【杀】或【闪】使用或打出,不能用来回复体力。
    注:进入鏖战模式后,即使之后有两名或者更多势力相同的角色出现,仍然不会取消鏖战模式。', + name:'鏖战模式', + init:true, + intro:'若开启此选项,则将在游戏中引入“鏖战模式”的规则:
    当游戏中仅剩四名或更少角色时(七人以下游戏时改为三名或更少),若此时全场没有超过一名势力相同的角色,则从一个新的回合开始,游戏进入鏖战模式直至游戏结束。
    ◇在鏖战模式下,【桃】只能当做【杀】或【闪】使用或打出,不能用来回复体力。
    注:进入鏖战模式后,即使之后有两名或者更多势力相同的角色出现,仍然不会取消鏖战模式。', }, viewnext:{ - name:'观看下家副将', - init:false, - intro:'若开启此选项,所有的玩家将在挑选武将后,分发起始手牌之前,分别观看自己下家的副将。', + name:'观看下家副将', + init:false, + intro:'若开启此选项,所有的玩家将在挑选武将后,分发起始手牌之前,分别观看自己下家的副将。', }, aozhan_bgm:{ - name:'鏖战背景音乐', - item:{ - disabled:'不启用', - online:'Online', - chaoming:'潮鸣', - }, - init:'chaoming', - onclick:function(item){ - game.saveConfig('aozhan_bgm',item,this._link.config.mode); - if(_status._aozhan==true) game.playBackgroundMusic(); - }, + name:'鏖战背景音乐', + item:{ + disabled:'不启用', + online:'Online', + chaoming:'潮鸣', + }, + init:'chaoming', + onclick:function(item){ + game.saveConfig('aozhan_bgm',item,this._link.config.mode); + if(_status._aozhan==true) game.playBackgroundMusic(); + }, }, zhulian:{ name:'珠联璧合', @@ -9481,59 +9481,59 @@ } }, chooseToEnable:function(){ - 'step 0' - var list=[]; - for(var i=1;i<6;i++){ - if(!player.isDisabled(i)) continue; - list.push('equip'+i); - } - if(!list.length) event.finish(); - else{ - event.list=list; - var next=player.chooseControl(list); - next.prompt='请选择恢复一个装备栏'; - if(!event.ai) event.ai=function(event,player,list){ - return list.randomGet(); - } - event.ai=event.ai(event.getParent(),player,list); - next.ai=function(){ - return event.ai; - }; - } - 'step 1' - event.result={control:result.control}; - player.enableEquip(result.control); - }, - chooseToDisable:function(){ - 'step 0' - var list=[]; - for(var i=1;i<7;i++){ - if((i==3||i==4)&&event.horse) continue; - if(i==6&&!event.horse) continue; - if(player.isDisabled(i)) continue; - list.push('equip'+i); - } - if(!list.length) event.finish(); - else{ - event.list=list; - var next=player.chooseControl(list); - next.prompt='请选择废除一个装备栏'; - if(!event.ai) event.ai=function(event,player,list){ - return list.randomGet(); - } - event.ai=event.ai(event.getParent(),player,list); - next.ai=function(){ - return event.ai; - }; - } - 'step 1' - event.result={control:result.control}; - if(result.control=='equip6'){ - player.disableEquip(3); - player.disableEquip(4); - } - else player.disableEquip(result.control); - }, + 'step 0' + var list=[]; + for(var i=1;i<6;i++){ + if(!player.isDisabled(i)) continue; + list.push('equip'+i); + } + if(!list.length) event.finish(); + else{ + event.list=list; + var next=player.chooseControl(list); + next.prompt='请选择恢复一个装备栏'; + if(!event.ai) event.ai=function(event,player,list){ + return list.randomGet(); + } + event.ai=event.ai(event.getParent(),player,list); + next.ai=function(){ + return event.ai; + }; + } + 'step 1' + event.result={control:result.control}; + player.enableEquip(result.control); + }, + chooseToDisable:function(){ + 'step 0' + var list=[]; + for(var i=1;i<7;i++){ + if((i==3||i==4)&&event.horse) continue; + if(i==6&&!event.horse) continue; + if(player.isDisabled(i)) continue; + list.push('equip'+i); + } + if(!list.length) event.finish(); + else{ + event.list=list; + var next=player.chooseControl(list); + next.prompt='请选择废除一个装备栏'; + if(!event.ai) event.ai=function(event,player,list){ + return list.randomGet(); + } + event.ai=event.ai(event.getParent(),player,list); + next.ai=function(){ + return event.ai; + }; + } + 'step 1' + event.result={control:result.control}; + if(result.control=='equip6'){ + player.disableEquip(3); + player.disableEquip(4); + } + else player.disableEquip(result.control); + }, swapEquip:function(){ "step 0" game.log(player,'和',target,'交换了装备区中的牌') @@ -9557,7 +9557,7 @@ if(event.cards[1].length) target.$give(event.cards[1],player); "step 2" for(var i=0;i200){ goswipe(lib.config.swipe_down); - } - } - else if(Math.abs(dy)<100){ - if(dx<-200){ + } + } + else if(Math.abs(dy)<100){ + if(dx<-200){ goswipe(lib.config.swipe_left); } else if(dx>200){ goswipe(lib.config.swipe_right); - } - } - } + } + } + } } var tmpflag=false; _status.mousedown=false; @@ -43900,14 +43900,14 @@ else{ delete lib.config.skin[nameskin]; if(gzbool&&lib.character[nameskin2][4].contains('gzskin')&&lib.config.mode_config.guozhan.guozhanSkin){ - bg.setBackground(nameskin2,'character'); - if(sourcenode) sourcenode.setBackground(nameskin2,'character'); - if(avatar) avatar.setBackground(nameskin2,'character'); + bg.setBackground(nameskin2,'character'); + if(sourcenode) sourcenode.setBackground(nameskin2,'character'); + if(avatar) avatar.setBackground(nameskin2,'character'); } else{ - bg.setBackground(nameskin,'character'); - if(sourcenode) sourcenode.setBackground(nameskin,'character'); - if(avatar) avatar.setBackground(nameskin,'character'); + bg.setBackground(nameskin,'character'); + if(sourcenode) sourcenode.setBackground(nameskin,'character'); + if(avatar) avatar.setBackground(nameskin,'character'); } game.saveConfig('skin',lib.config.skin); } @@ -45049,18 +45049,18 @@ }; var get={ infoHp:function(hp){ - if(typeof hp=='number') return hp; - else if(typeof hp=='string'&&hp.indexOf('/')!=-1){ - return parseInt(hp.slice(0,hp.indexOf('/'))); - } - return 0; + if(typeof hp=='number') return hp; + else if(typeof hp=='string'&&hp.indexOf('/')!=-1){ + return parseInt(hp.slice(0,hp.indexOf('/'))); + } + return 0; }, infoMaxHp:function(hp){ - if(typeof hp=='number') return hp; - else if(typeof hp=='string'&&hp.indexOf('/')!=-1){ - return parseInt(hp.slice(hp.indexOf('/')+1)); - } - return 0; + if(typeof hp=='number') return hp; + else if(typeof hp=='string'&&hp.indexOf('/')!=-1){ + return parseInt(hp.slice(hp.indexOf('/')+1)); + } + return 0; }, is:{ converted:function(event){ diff --git a/game/update.js b/game/update.js index 0a39bf306..2b0385899 100644 --- a/game/update.js +++ b/game/update.js @@ -1,24 +1,25 @@ window.noname_update={ - version:'1.9.92.1', - update:'1.9.92', + version:'1.9.92.1.1', + update:'1.9.92.1', changeLog:[ - '新增武将张菖蒲,许贡,忙牙长', - '添加武将小包分包和批量AI禁选', + '代码缩进对齐', 'BUG修复', - 'players://["zhangchangpu","xugong","mangyachang"]', ], files:[ + 'card/extra.js', + 'card/guozhan.js', 'card/standard.js', + 'character/diy.js', 'character/extra.js', 'character/mobile.js', - 'character/old.js', + //'character/old.js', 'character/refresh.js', 'character/shenhua.js', 'character/sp.js', - 'character/standard.js', + 'character/xinghuoliaoyuan.js', 'character/yijiang.js', + 'mode/boss.js', 'mode/doudizhu.js', - 'mode/identity.js', 'mode/guozhan.js', 'game/game.js', ] diff --git a/mode/boss.js b/mode/boss.js index 71ff4cd17..6808e9cae 100644 --- a/mode/boss.js +++ b/mode/boss.js @@ -1956,8 +1956,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ wuqi:{ mod:{ cardUsable:function(card,player,num){ - if(player.getEquip(1)&&card.name=='sha') return num+1; - }, + if(player.getEquip(1)&&card.name=='sha') return num+1; + }, }, sub:true, }, @@ -1966,12 +1966,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ player:"damageBegin", }, forced:true, - filter:function (event,player){ - return player.getEquip(2)&&event.num>1; - }, - content:function (){ - trigger.num=1; - }, + filter:function (event,player){ + return player.getEquip(2)&&event.num>1; + }, + content:function (){ + trigger.num=1; + }, sub:true, }, zuoji:{ @@ -1979,12 +1979,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ player:"phaseDrawBegin", }, forced:true, - filter:function (event,player){ - return (player.getEquip(3)||player.getEquip(4)); - }, + filter:function (event,player){ + return (player.getEquip(3)||player.getEquip(4)); + }, content:function(){ - trigger.num++; - }, + trigger.num++; + }, sub:true, }, baowu:{ @@ -1993,12 +1993,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, forced:true, filter:function (event,player){ - return player.getEquip(5); - }, + return player.getEquip(5); + }, content:function (){ - trigger.cancel(); - game.log(player,'跳过了判定阶段'); - }, + trigger.cancel(); + game.log(player,'跳过了判定阶段'); + }, sub:true, }, }, @@ -2009,55 +2009,55 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, direct:true, content:function(){ - "step 0" - player.chooseTarget(get.prompt('shufazijinguan'),function(card,player,target){ - return player!=target; - }).ai=function(target){ - return get.damageEffect(target,player,player); - } - "step 1" - if(result.bool){ - player.line(result.targets,'white'); - result.targets[0].damage(); - } - }, + "step 0" + player.chooseTarget(get.prompt('shufazijinguan'),function(card,player,target){ + return player!=target; + }).ai=function(target){ + return get.damageEffect(target,player,player); + } + "step 1" + if(result.bool){ + player.line(result.targets,'white'); + result.targets[0].damage(); + } + }, }, "linglongshimandai_skill":{ trigger:{ global:["useCard"], }, filter:function(event,player){ - if(event.targets&&event.targets.length>1) return false; - var evt=event.getParent(); - if(evt.player&&evt.player.hasSkillTag('unequip',false,{ - name:evt.card?evt.card.name:null, - target:player, - card:evt.card - })) return false; - return event.targets.contains(player)&&event.player!=player; - }, - audio:"ext:新虎牢关:true", + if(event.targets&&event.targets.length>1) return false; + var evt=event.getParent(); + if(evt.player&&evt.player.hasSkillTag('unequip',false,{ + name:evt.card?evt.card.name:null, + target:player, + card:evt.card + })) return false; + return event.targets.contains(player)&&event.player!=player; + }, + audio:true, check:function(event,player){ - if(get.attitude(player,event.player)>2) return false; - return true; - }, + if(get.attitude(player,event.player)>2) return false; + return true; + }, content:function(){ - "step 0" - player.judge('linglongshimandai',function(card){return (get.suit(card)=='heart')?1.5:-0.5}); - "step 1" - if(result.judge>0){ - trigger.cancel(); - } - }, + "step 0" + player.judge('linglongshimandai',function(card){return (get.suit(card)=='heart')?1.5:-0.5}); + "step 1" + if(result.judge>0){ + trigger.cancel(); + } + }, ai:{ effect:{ target:function(card,player,target,effect){ - if(player.hasSkillTag('unequip',false,{ - name:card?card.name:null, - target:player, - card:card - })) return; - }, + if(player.hasSkillTag('unequip',false,{ + name:card?card.name:null, + target:player, + card:card + })) return; + }, }, }, }, @@ -2066,29 +2066,29 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ player:"damageBefore", }, filter:function(event,player){ - if(event.source&&event.source.hasSkillTag('unequip',false,{ - name:event.card?event.card.name:null, - target:player, - card:event.card - })) return; - if(event.nature) return true; - }, + if(event.source&&event.source.hasSkillTag('unequip',false,{ + name:event.card?event.card.name:null, + target:player, + card:event.card + })) return; + if(event.nature) return true; + }, forced:true, content:function(){ - trigger.cancel(); - }, + trigger.cancel(); + }, ai:{ nofire:true, nothunder:true, effect:{ target:function(card,player,target,current){ - if(player.hasSkillTag('unequip',false,{ - name:card?card.name:null, - target:player, - card:card - })) return; - if(get.tag(card,'natureDamage')) return 'zerotarget'; - }, + if(player.hasSkillTag('unequip',false,{ + name:card?card.name:null, + target:player, + card:card + })) return; + if(get.tag(card,'natureDamage')) return 'zerotarget'; + }, }, }, }, @@ -2097,41 +2097,41 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ source:"damageAfter", }, filter:function(event,player){ - return event.card&&event.card.name=='sha'; - }, + return event.card&&event.card.name=='sha'; + }, check:function(event,player){ - return true; - }, + return true; + }, content:function(){ - 'step 0' - player.line(trigger.player,'white'); - if(!trigger.player.countCards('he')){ - event.goto(1); - }else{ - event.goto(2); - } - 'step 1' - player.draw(); - event.finish(); - 'step 2' - player.chooseControl('摸一张牌','弃置其一张牌',function(event,player){ - if(get.attitude(player,trigger.player)>2) return '摸一张牌'; - return '弃置其一张牌'; - }); - 'step 3' - if(result.control=='摸一张牌'){ - player.draw(); - event.finish(); - } - else{ - player.discardPlayerCard(trigger.player,'he',true); - event.finish(); - } - }, + 'step 0' + player.line(trigger.player,'white'); + if(!trigger.player.countCards('he')){ + event.goto(1); + }else{ + event.goto(2); + } + 'step 1' + player.draw(); + event.finish(); + 'step 2' + player.chooseControl('摸一张牌','弃置其一张牌',function(event,player){ + if(get.attitude(player,trigger.player)>2) return '摸一张牌'; + return '弃置其一张牌'; + }); + 'step 3' + if(result.control=='摸一张牌'){ + player.draw(); + event.finish(); + } + else{ + player.discardPlayerCard(trigger.player,'he',true); + event.finish(); + } + }, }, boss_yaoshou:{ - mod:{ + mod:{ globalFrom:function(from,to,distance){ return distance-2; }, @@ -2152,17 +2152,17 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ global:'boss_shedu', mod:{ cardEnabled:function (card,player){ - if(_status.event.skill!='boss_duqu_sha'&&get.owner(card)!=undefined&&card.name=='tao') return false; - }, + if(_status.event.skill!='boss_duqu_sha'&&get.owner(card)!=undefined&&card.name=='tao') return false; + }, cardUsable:function (card,player){ - if(_status.event.skill!='boss_duqu_sha'&&get.owner(card)!=undefined&&card.name=='tao') return false; - }, + if(_status.event.skill!='boss_duqu_sha'&&get.owner(card)!=undefined&&card.name=='tao') return false; + }, cardRespondable:function (card,player){ - if(_status.event.skill!='boss_duqu_sha'&&get.owner(card)!=undefined&&card.name=='tao') return false; - }, + if(_status.event.skill!='boss_duqu_sha'&&get.owner(card)!=undefined&&card.name=='tao') return false; + }, cardSavable:function (card,player){ - if(_status.event.skill!='boss_duqu_sha'&&get.owner(card)!=undefined&&card.name=='tao') return false; - }, + if(_status.event.skill!='boss_duqu_sha'&&get.owner(card)!=undefined&&card.name=='tao') return false; + }, }, group:["boss_duqu_sha"], subSkill:{ @@ -2175,61 +2175,17 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ name:"sha", }, viewAsFilter:function (player){ - if(!player.countCards('h','tao')) return false; - }, + if(!player.countCards('h','tao')) return false; + }, prompt:"将一张桃当杀使用或打出", check:function (){return 1}, ai:{ - effect:{ - target:function (card,player,target,current){ - if(get.tag(card,'respondSha')&¤t<0) return 0.6 - }, - }, respondSha:true, skillTagFilter:function (player){ - if(!player.countCards('h','tao')) return false; - }, + if(!player.countCards('h','tao')) return false; + }, order:function (){ - return get.order({name:'sha'})-0.1; - }, - useful:-1, - value:-1, - basic:{ - useful:[5,1], - value:[5,1], - }, - result:{ - target:function (player,target){ - if(player.hasSkill('jiu')&&!target.getEquip('baiyin')){ - if(get.attitude(player,target)>0){ - return -6; - } - else{ - return -3; - } - } - return -1.5; - }, - }, - 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; - }, + return get.order({name:'sha'})-0.1; }, }, sub:true, @@ -2260,20 +2216,20 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, boss_jiushou:{ - mod:{ - maxHandcard:function(player,num){ + mod:{ + maxHandcard:function(player,num){ return num-player.hp+9; - }, - }, - trigger:{player:['phaseUseBegin','phaseAfter','phaseDrawBegin']}, - forced:true, - filter:function(event,player){ - return event.name=='phaseDraw'||player.countCards('h')<9; - }, - content:function(){ - if(trigger.name=='phaseDraw') trigger.cancel(); - else player.draw(9-player.countCards('h')); }, + }, + trigger:{player:['phaseUseBegin','phaseAfter','phaseDrawBegin']}, + forced:true, + filter:function(event,player){ + return event.name=='phaseDraw'||player.countCards('h')<9; + }, + content:function(){ + if(trigger.name=='phaseDraw') trigger.cancel(); + else player.draw(9-player.countCards('h')); + }, }, boss_echou_switch:{ unique:true, @@ -2336,13 +2292,13 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ player.storage.boss_juyuan=player.hp; }, mod:{ - selectTarget:function (card,player,range){ - if(card.name!='sha') return; - if(range[1]==-1) return; - if(player.hp>=player.storage.boss_juyuan) return; - range[1]+=2; - }, - }, + selectTarget:function (card,player,range){ + if(card.name!='sha') return; + if(range[1]==-1) return; + if(player.hp>=player.storage.boss_juyuan) return; + range[1]+=2; + }, + }, }, boss_xushi_switch:{ unique:true, @@ -2379,8 +2335,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ content:function(){ 'step 0' if(trigger.name=='phaseUse'){ - player.turnOver(); - event.finish(); + player.turnOver(); + event.finish(); } else{ event.list=game.filterPlayer(function(current){ @@ -2418,43 +2374,43 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, boss_honglianx:{ mod:{ - ignoredHandcard:function (card,player){ - if(get.color(card)=='red'){ - return true; - } - }, - cardDiscardable:function (card,player,name){ - if(name=='phaseDiscard'&&get.color(card)=='red') return false; - }, - }, - forced:true, - trigger:{player:'phaseBefore'}, - content:function(){ - 'step 0' - event.num1=3; - event.num2=[0,1,2,3].randomGet(); - event.togain=[]; - while(event.togain.length0; + }, + content:function(){ + 'step 0' + var check=(player.countCards('h',{color:'red'})>1||player.countCards('h',{color:'black'})>1); + player.chooseCard(get.prompt2('keshou'),'he',2,function(card){ + if(ui.selected.cards.length) return get.color(card)==get.color(ui.selected.cards[0]); + return true; + }).set('complexCard',true).set('ai',function(card){ + if(!_status.event.check) return 0; + var player=_status.event.player; + if(player.hp==1){ + if(!player.countCards('h',function(card){return get.tag(card,'save')})&&!player.hasSkillTag('save',true)) return 10-get.value(card); + return 7-get.value(card); + } + return 6-get.value(card); + }).set('check',check); + 'step 1' + if(result.cards){ + player.logSkill('keshou'); + player.discard(result.cards); + trigger.num--; + if(trigger.num<=0) trigger.cancel(); + if(!game.hasPlayer(function(current){ + return current!=player&¤t.isFriendOf(player); + })) player.judge(function(card){ + if(get.color(card)=='red') return 1; + return 0; + }); + } + else event.finish(); + 'step 2' + if(result.judge>0) player.draw(); + } + }, + zhuwei:{ + trigger:{player:'judgeEnd'}, + filter:function(event){ + if(get.owner(event.result.card)) return false; + if(event.nogain&&event.nogain(event.result.card)) return false; + return event.result.card.name=='sha'||event.result.card.name=='juedou'; + }, + content:function(){ + 'step 0' + player.gain(trigger.result.card,'gain2'); + player.chooseBool('是否令当前回合角色获得【筑围】的加成效果?').ai=function(){ + return get.attitude(player,_status.currentPhase)>0; + }; + 'step 1' + if(result.bool){ + var target=_status.currentPhase; + if(!target.hasSkill('zhuwei_eff')){ + target.addTempSkill('zhuwei_eff'); + target.storage.zhuwei_eff=1; + } + else target.storage.zhuwei_eff++; + target.updateMarks(); + } + }, + subSkill:{ + eff:{ + sub:true, + mod:{ + cardUsable:function(card,player,num){ + if(card.name=='sha') return num+player.storage.zhuwei_eff; + }, + maxHandcard:function(player,num){return num+player.storage.zhuwei_eff} + }, + mark:true, + intro:{ + content:function(storage){if(storage) return '使用【杀】的次数上限+'+storage+',手牌上限+'+storage} + } + } + } + }, + gzweidi:{ + init:function(player){player.storage.gzweidi=[]}, + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return player.storage.gzweidi.length>0 + }, + filterTarget:function(card,player,target){return target!=player&&player.storage.gzweidi.contains(target)}, + content:function(){ + 'step 0' + player.chooseJunlingFor(target); + 'step 1' + event.junling=result.junling; + event.targets=result.targets; + var choiceList=['执行该军令']; + if(target!=player) choiceList.push('令'+get.translation(player)+'获得你所有手牌,然后交给你等量的牌'); + else choiceList.push('不执行该军令'); + target.chooseJunlingControl(player,result.junling,result.targets).set('prompt','伪帝').set('choiceList',choiceList).set('ai',function(){ + if(get.attitude(target,player)>=0) return get.junlingEffect(player,result.junling,target,result.targets,target)>=0?0:1; + return get.junlingEffect(player,result.junling,target,result.targets,target)>=-1?0:1; + }); + 'step 2' + if(result.index==0) target.carryOutJunling(player,event.junling,targets); + else if(target!=player&&target.countCards('h')) { + event.num=target.countCards('h'); + player.gain(target.getCards('h'),target); + target.$give(event.num,player); + player.chooseCard('交给'+get.translation(target)+get.cnNumber(event.num)+'张牌','he',event.num,true).set('ai',function(card){ + return -get.value(card); + }); + } + else event.finish(); + 'step 3' + if(result.cards){ + target.gain(result.cards,player); + player.$give(num,target); + } + }, + group:['gzweidi_ft','gzweidi_ftc'], + ai:{ + order:3, + result:{ + player:1, + } + }, + subSkill:{ + ft:{ + sub:true, + trigger:{global:'gainBefore'}, + silent:true, filter:function(event,player){ - return event.num>0; - }, - content:function(){ - 'step 0' - var check=(player.countCards('h',{color:'red'})>1||player.countCards('h',{color:'black'})>1); - player.chooseCard(get.prompt2('keshou'),'he',2,function(card){ - if(ui.selected.cards.length) return get.color(card)==get.color(ui.selected.cards[0]); - return true; - }).set('complexCard',true).set('ai',function(card){ - if(!_status.event.check) return 0; - var player=_status.event.player; - if(player.hp==1){ - if(!player.countCards('h',function(card){return get.tag(card,'save')})&&!player.hasSkillTag('save',true)) return 10-get.value(card); - return 7-get.value(card); - } - return 6-get.value(card); - }).set('check',check); - 'step 1' - if(result.cards){ - player.logSkill('keshou'); - player.discard(result.cards); - trigger.num--; - if(trigger.num<=0) trigger.cancel(); - if(!game.hasPlayer(function(current){ - return current!=player&¤t.isFriendOf(player); - })) player.judge(function(card){ - if(get.color(card)=='red') return 1; - return 0; - }); + if(player==event.player||player.storage.gzweidi.contains(event.player)||_status.currentPhase!=player) return false; + if(event.cards.length){ + if(event.getParent().name=='draw') return true; + for(var i=0;i0) player.draw(); - } + return false; + }, + content:function(){player.storage.gzweidi.push(trigger.player)} }, - zhuwei:{ - trigger:{player:'judgeEnd'}, - filter:function(event){ - if(get.owner(event.result.card)) return false; - if(event.nogain&&event.nogain(event.result.card)) return false; - return event.result.card.name=='sha'||event.result.card.name=='juedou'; - }, - content:function(){ - 'step 0' - player.gain(trigger.result.card,'gain2'); - player.chooseBool('是否令当前回合角色获得【筑围】的加成效果?').ai=function(){ - return get.attitude(player,_status.currentPhase)>0; - }; - 'step 1' - if(result.bool){ - var target=_status.currentPhase; - if(!target.hasSkill('zhuwei_eff')){ - target.addTempSkill('zhuwei_eff'); - target.storage.zhuwei_eff=1; - } - else target.storage.zhuwei_eff++; - target.updateMarks(); - } - }, - subSkill:{ - eff:{ - sub:true, - mod:{ - cardUsable:function(card,player,num){ - if(card.name=='sha') return num+player.storage.zhuwei_eff; - }, - maxHandcard:function(player,num){return num+player.storage.zhuwei_eff} - }, - mark:true, - intro:{ - content:function(storage){if(storage) return '使用【杀】的次数上限+'+storage+',手牌上限+'+storage} - } - } - } - }, - gzweidi:{ - init:function(player){player.storage.gzweidi=[]}, - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return player.storage.gzweidi.length>0 - }, - filterTarget:function(card,player,target){return target!=player&&player.storage.gzweidi.contains(target)}, - content:function(){ - 'step 0' - player.chooseJunlingFor(target); - 'step 1' - event.junling=result.junling; - event.targets=result.targets; - var choiceList=['执行该军令']; - if(target!=player) choiceList.push('令'+get.translation(player)+'获得你所有手牌,然后交给你等量的牌'); - else choiceList.push('不执行该军令'); - target.chooseJunlingControl(player,result.junling,result.targets).set('prompt','伪帝').set('choiceList',choiceList).set('ai',function(){ - if(get.attitude(target,player)>=0) return get.junlingEffect(player,result.junling,target,result.targets,target)>=0?0:1; - return get.junlingEffect(player,result.junling,target,result.targets,target)>=-1?0:1; - }); - 'step 2' - if(result.index==0) target.carryOutJunling(player,event.junling,targets); - else if(target!=player&&target.countCards('h')) { - event.num=target.countCards('h'); - player.gain(target.getCards('h'),target); - target.$give(event.num,player); - player.chooseCard('交给'+get.translation(target)+get.cnNumber(event.num)+'张牌','he',event.num,true).set('ai',function(card){ - return -get.value(card); - }); - } - else event.finish(); - 'step 3' - if(result.cards){ - target.gain(result.cards,player); - player.$give(num,target); - } - }, - group:['gzweidi_ft','gzweidi_ftc'], - ai:{ - order:3, - result:{ - player:1, - } - }, - subSkill:{ - ft:{ - sub:true, - trigger:{global:'gainBefore'}, - silent:true, - filter:function(event,player){ - if(player==event.player||player.storage.gzweidi.contains(event.player)||_status.currentPhase!=player) return false; - if(event.cards.length){ - if(event.getParent().name=='draw') return true; - for(var i=0;i
    选择【知己知彼】的目标
    ',function(card,player,target){ - return player.canUse({name:'zhibi'},target); - },true).set('ai',function(target){ - var player=_status.event.player; - return get.effect(target,{name:'zhibi'},player,player); - }); - 'step 1' - if(result.bool){ - player.useCard({name:'zhibi'},result.targets); - } - }, - audio:['yongsi',2] - }, - eff3:{ - sub:true, - trigger:{global:'useCardToBegin'}, - priority:16, - forced:true, - filter:function(event,player){ - return event.target&&event.target==player&&event.card&&event.card.name=='zhibi' - }, - check:function(){return false}, - content:function(){ - player.showHandcards(); - } - } - } - }, - gzfudi:{ - trigger:{global:'damageEnd'}, - direct:true, - filter:function(event,player){return event.source&&event.source.isAlive()&&event.source!=player&&event.player==player&&player.countCards('h')&&event.num>0}, - content:function(){ - 'step 0' - event.players=game.filterPlayer(function(current){ - return current.isFriendOf(trigger.source)&¤t.hp>=player.hp&&!game.hasPlayer(function(current2){ - return current2.hp>current.hp&¤t2.isFriendOf(current); - }) - }); - var str=event.players.length?',然后对'+get.translation(event.players)+(event.players.length==1?'':'中的一名角色')+'造成一点伤害':''; - var check=true; - if(!event.players.length) check=false; - else{ - if(get.attitude(player,trigger.source)>=0) check=false; - else if(!player.countCards('h',function(card){return get.value(card)<9})) check=false; - } - player.chooseCard('附敌

    交给'+get.translation(trigger.source)+'一张手牌'+str+'
    ').set('aicheck',check).set('ai',function(card){ - if(!_status.event.aicheck) return 0; - return 9-get.value(card); - }); - 'step 1' - if(result.cards){ - player.logSkill('gzfudi',trigger.source); - trigger.source.gain(result.cards,player); - player.$give(1,trigger.source); - if(event.players.length==1) event.target=event.players[0]; - else if(event.players.length) player.chooseTarget('附敌

    对'+get.translation(event.players)+'中的一名角色造成一点伤害
    ',function(card,player,target){ - return target.isFriendOf(trigger.source)&&target.hp>=player.hp - },true).set('ai',function(target){return get.damageEffect(target,player,player)}); - else event.finish(); - } - else event.finish(); - 'step 2' - var target=event.target||result.targets[0]; - if(target){ - player.line(target,'green'); - target.damage(player); - } - }, - ai:{ - maixie:true, - maixie_defend:true, - effect:{ - target:function(card,player,target){ - if(get.tag(card,'damage')){ - if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; - if(!target.countCards('h')) return [1,-1]; - if(game.countPlayer(function(current){return current.isFriendOf(player)&¤t.hp>=target.hp-1})) return [1,0,0,-2]; - } - } - } - } - }, - congjian:{ - trigger:{global:'damageBefore'}, + ftc:{ + sub:true, + trigger:{global:'phaseAfter'}, + silent:true, + filter:function(event,player){return event.player==player}, + content:function(){player.storage.gzweidi=[]}, + } + }, + audio:['weidi',2] + }, + gzyongsi:{ + group:['gzyongsi_eff1','gzyongsi_eff2','gzyongsi_eff3'], + ai:{ + threaten:function(player,target){ + if(game.hasPlayer(function(current){ + return current!=target&¤t.getEquip('yuxi'); + })) return 0.5; + return 2; + } + }, + subSkill:{ + eff1:{ + sub:true, + trigger:{global:'phaseDrawBegin'}, + priority:8, forced:true, filter:function(event,player){ - if(event.num<=0) return false; - if(event.source&&event.source==player&&_status.currentPhase!=player&&event.notLink()) return true; - if(event.player&&event.player==player&&_status.currentPhase==player) return true; + if(event.player!=player||event.num<=0) return false; + return !game.hasPlayer(function(current){ + return current.getEquip('yuxi'); + }) }, - check:function(event,player){ - return _status.currentPhase!=player; - }, content:function(){trigger.num++}, - ai:{ - //damageBones:true, - } + audio:['yongsi',2] }, - jianan:{ - unique:true, - forceunique:true, - group:'wuziliangjiangdao', - derivation:'wuziliangjiangdao', - global:'g_jianan', - }, - g_jianan:{ - trigger:{player:'phaseBegin'}, - filter:function(event,player){ - if(!get.zhu(player,'jianan')) return false; - if(!player.countCards('he')) return false; - if(get.is.jun(player)&&player.isUnseen(1)) return false; - return !player.isUnseen(); - }, - direct:true, - content:function(){ - 'step 0' - var skills=['tuxi','qiaobian','gzxiaoguo','gzjieyue','new_duanliang']; - game.countPlayer(function(current){ - if(current==player) return; - if(current.hasSkill('tuxi')) skills.remove('tuxi'); - if(current.hasSkill('qiaobian')) skills.remove('qiaobian'); - if(current.hasSkill('gzxiaoguo')) skills.remove('gzxiaoguo'); - if(current.hasSkill('gzjieyue')) skills.remove('gzjieyue'); - if(current.hasSkill('new_duanliang')) skills.remove('new_duanliang'); - }); - if(!skills.length) event.finish(); - else{ - event.skills=skills; - var next=player.chooseToDiscard(); - next.prompt='是否弃置一张牌并发动【五子良将纛】?' - next.prompt2=get.translation('wuziliangjiangdao_info'); - next.logSkill='g_jianan'; - next.skills=skills; - next.ai=function(card){ - return -1; - }; - } - 'step 1' - if(!result.bool) event.finish(); - else{ - var list=["主将","副将"]; - if(player.isUnseen(0)||get.is.jun(player)) list.remove("主将"); - if(player.isUnseen(1)) list.remove("副将"); - if(!list.length) event.finish(); - else if(list.length<2) event._result={control:list[0]}; - else{ - player.chooseControl(list).prompt="请选择暗置一张武将牌"; - } - } - 'step 2' - if(!result.control) event.finish(); - else{ - var num=result.control=='主将'?0:1; - player.hideCharacter(num); - player.chooseControl(event.skills).prompt="选择获得其中的一个技能直到下回合开始"; - } - 'step 3' - var link=result.control; - player.addTempSkill(link,{player:"phaseBefore"}); - player.addTempSkill("jianan_eff",{player:"phaseBefore"}); - game.log(player,"获得了技能","#g【"+get.translation(result.control)+"】"); - }, - }, - jianan_eff:{ - ai:{nomingzhi:true} - }, - huibian:{ - enable:'phaseUse', - usable:1, + eff2:{ + sub:true, + trigger:{global:'phaseUseBegin'}, + priority:8, + forced:true, filter:function(event,player){ - return game.countPlayer(function(current){ - return current.identity=='wei'; - })>1&&game.hasPlayer(function(current){ - return current.isDamaged()&¤t.identity=='wei'; + if(event.player!=player) return false; + return game.hasPlayer(function(current){ + return player.canUse('zhibi',current); + })&&!game.hasPlayer(function(current){ + return current.getEquip('yuxi'); }); }, - filterTarget:function(card,player,target){ - if(ui.selected.targets.length) return target.isDamaged()&&target.identity=='wei'; - return target.identity=='wei'; - }, - selectTarget:2, - multitarget:true, - targetprompt:['受到伤害
    然后摸牌','回复体力'], - content:function(){ - 'step 0' - targets[0].damage(player); - 'step 1' - if(targets[0].isAlive()) targets[0].draw(2); - targets[1].recover(); - }, - ai:{ - threaten:1.2, - order:9, - result:{ - target:function(player,target){ - if(ui.selected.targets.length) return 1; - if(get.damageEffect(target,player,player)>0) return 2; - if(target.hp>2) return 1; - if(target.hp==1) return -1; - return 0.1; - } - }, - } - }, - gzzongyu:{ - unique:true, - forceunique:true, - group:['gzzongyu_others','gzzongyu_player'], - ai:{ - threaten:1.2, - }, - subSkill:{ - others:{ - trigger:{global:'equipAfter'}, - direct:true, - filter:function(event,player){ - if(event.player==player||!player.countCards('e',{subtype:['equip3','equip4']})) return false; - return event.card.name=='liulongcanjia'; - }, - check:function(event,player){ - if(get.attitude(player,target)<=0) return player.countCards('e',{subtype:['equip4','equip4']})<2; - return true; - }, - content:function(){ - 'step 0' - player.chooseBool('是否发动【总御】,与'+get.translation(trigger.player)+'交换装备区内坐骑牌?'); - 'step 1' - if(result.bool){ - player.logSkill('gzzongyu_others',trigger.player); - event.cards=[player.getCards('e',{subtype:['equip3','equip4']}),trigger.player.getCards('e',{name:'liulongcanjia'})]; - player.lose(event.cards[0],ui.special); - trigger.player.lose(event.cards[1],ui.special); - if(event.cards[0].length) player.$give(event.cards[0],trigger.player); - if(event.cards[1].length) trigger.player.$give(event.cards[1],player); - } - else event.finish(); - 'step 2' - for(var i=0;i0.7; - return true; - } - }, content:function(){ 'step 0' - var choices=[]; - if(game.hasPlayer(function(current){return current.isUnseen()})) choices.push('选择一名未确定势力的角色'); - if(game.hasPlayer(function(current){return current!=player&&!current.isUnseen()})&&player.countCards('h',{type:'basic'})) choices.push('交给一名已确定势力角色一张基本牌'); - player.chooseControl(choices,ui.create.dialog('征辟

    选择一项
    ','hidden')).set('ai',function(){ - if(choices.length>1){ - var player=_status.event.player; - if(!game.hasPlayer(function(current){ - return !current.isUnseen()&¤t.getEquip('yuxi')||current.hasSkill('gzyongsi')&&!game.hasPlayer(function(current){ - return current.getEquip('yuxi'); - }); - })&&game.hasPlayer(function(current){return current!=player&¤t.isUnseen()})){ - var identity; - for(var i=0;i=get.population(identity)) return 0; - return 1; - } - return 0; - }); - 'step 1' - if(result.control=='选择一名未确定势力的角色') player.chooseTarget('征辟

    选择一名未确定势力角色,你对其使用牌没有次数和距离限制直到回合结束
    ',function(card,player,target){ - return target!=player&&target.identity=='unknown' - },true); - else player.chooseCardTarget({ - prompt:'征辟

    交给一名已确定势力角色一张基本牌,然后该角色交给你一张非基本牌或两张基本牌
    ', - position:'h', - filterCard:function(card){return get.type(card)=='basic'}, - filterTarget:function(card,player,target){ - return target!=player&&target.identity!='unknown'; - }, - ai1:function(card){return 7-get.value(card)}, - //ai2:function(card,player,target){} - }).set('forced',true); - 'step 2' - event.target=result.targets[0]; - player.line(result.targets,'green'); - if(result.cards.length){ - event.cards=result.cards; - result.targets[0].gain(result.cards,player); - player.$give(result.cards,result.targets[0]); - } - else{ - player.storage.gzzhengbi_eff1=result.targets[0]; - player.addTempSkill('gzzhengbi_eff1'); - event.finish(); - } - 'step 3' - var choices=[]; - if(target.countCards('he',{type:['trick','delay','equip']})) choices.push('一张非基本牌'); - if(target.countCards('h',{type:'basic'})>1) choices.push('两张基本牌'); - if(choices.length) target.chooseControl(choices,ui.create.dialog('征辟

    交给'+get.translation(player)+'
    ')).set('ai',function(event,player){ - if(choices.length>1){ - if(player.countCards('he',{type:['trick','delay','equip']},function(card){return get.value(card)<7})) return 0; - return 1; - } - return 0; - }); - else{ - if(target.countCards('h')){ - var cards=target.getCards('h'); - player.gain(cards,target); - target.$giveAuto(cards,player); - event.finish(); - } - else event.finish(); - } - 'step 4' - var check=(result.control=='一张非基本牌'); - target.chooseCard('he',(check?1:2),{type:(check?['trick','delay','equip']:'basic')},true); - 'step 5' - if(result.cards){ - player.gain(result.cards,target); - target.$giveAuto(result.cards,player); - } - }, - subSkill:{ - eff1:{ - sub:true, - mod:{ - targetInRange:function (card,player,target){ - if(target==player.storage.gzzhengbi_eff1) return true; - }, - cardUsable:function (card,player,num){ - if(typeof num=='number'&&player.storage.gzzhengbi_eff1.isAlive()&&player.storage.gzzhengbi_eff1.isUnseen()) return num+100; - }, - playerEnabled:function (card,player,target){ - if(player.storage.gzzhengbi_eff1.isAlive()&&player.storage.gzzhengbi_eff1.isUnseen()&&target!=player.storage.gzzhengbi_eff1){ - var num=player.getCardUsable(card)-100; - if(num<=0) return false; - } - }, - }, - onremove:true, - }, - eff2:{sub:true}, - } - }, - gzfengying:{ - limited:true, - enable:'phaseUse', - position:'h', - filterCard:true, - selectCard:-1, - filter:function(event,player){ - return !player.storage.gzfengying&&player.countCards('h')>0; - }, - filterTarget:function(card,player,target){ - return target==player; - }, - selectTarget:-1, - discard:false, - lose:false, - content:function(){ - 'step 0' - player.awakenSkill('gzfengying'); - player.storage.gzfengying=true; - player.useCard({name:'xietianzi'},cards,target); - 'step 1' - var list=game.filterPlayer(function(current){ - return current.isFriendOf(player)&¤t.countCards('h')=4) return 0; - for(var i=0;i0) return 11-get.value(card); - return 7-get.value(card); - }, - ai2:function(card,player,target){ - var att=get.attitude(player,target); - if(att<0) return -att; - return 1; - } + player.chooseTarget('玉玺(庸肆)

    选择【知己知彼】的目标
    ',function(card,player,target){ + return player.canUse({name:'zhibi'},target); + },true).set('ai',function(target){ + var player=_status.event.player; + return get.effect(target,{name:'zhibi'},player,player); }); 'step 1' if(result.bool){ - event.target=result.targets[0]; - player.logSkill('gzjieyue',result.targets); - result.targets[0].gain(result.cards[0],player); - player.$give(1,result.targets[0]); - player.chooseJunlingFor(result.targets[0]); - } - else event.finish(); - 'step 2' - event.junling=result.junling; - event.targets=result.targets; - var choiceList=[]; - choiceList.push('执行该军令,然后'+get.translation(player)+'摸一张牌'); - choiceList.push('令'+get.translation(player)+'摸牌阶段额外摸三张牌'); - target.chooseJunlingControl(player,result.junling,result.targets).set('prompt','节钺').set('choiceList',choiceList).set('ai',function(){ - if(get.attitude(target,player)>0) return get.junlingEffect(player,result.junling,target,result.targets,target)>1?0:1; - return get.junlingEffect(player,result.junling,target,result.targets,target)>=-1?0:1; - }); - 'step 3' - if(result.index==0){ - target.carryOutJunling(player,event.junling,targets); - player.draw(); - } - else player.addTempSkill('gzjieyue_eff'); - }, - ai:{threaten:2}, - subSkill:{ - eff:{ - sub:true, - trigger:{global:'phaseDrawBegin'}, - filter:function(event,player){ - if(event.player!=player) return false; - return event.num>0; - }, - silent:true, - content:function(){ - trigger.num+=3; - } + player.useCard({name:'zhibi'},result.targets); } }, - audio:['jieyue',2], - }, - - jianglue:{ - limited:true, - enable:'phaseUse', - prepare:function(cards,player){ - var targets=game.filterPlayer(function(current){ - return current.isFriendOf(player)||current.isUnseen(); - }); - player.line(targets,'fire'); + audio:['yongsi',2] + }, + eff3:{ + sub:true, + trigger:{global:'useCardToBegin'}, + priority:16, + forced:true, + filter:function(event,player){ + return event.target&&event.target==player&&event.card&&event.card.name=='zhibi' + }, + check:function(){return false}, + content:function(){ + player.showHandcards(); + } + } + } + }, + gzfudi:{ + trigger:{global:'damageEnd'}, + direct:true, + filter:function(event,player){return event.source&&event.source.isAlive()&&event.source!=player&&event.player==player&&player.countCards('h')&&event.num>0}, + content:function(){ + 'step 0' + event.players=game.filterPlayer(function(current){ + return current.isFriendOf(trigger.source)&¤t.hp>=player.hp&&!game.hasPlayer(function(current2){ + return current2.hp>current.hp&¤t2.isFriendOf(current); + }) + }); + var str=event.players.length?',然后对'+get.translation(event.players)+(event.players.length==1?'':'中的一名角色')+'造成一点伤害':''; + var check=true; + if(!event.players.length) check=false; + else{ + if(get.attitude(player,trigger.source)>=0) check=false; + else if(!player.countCards('h',function(card){return get.value(card)<9})) check=false; + } + player.chooseCard('附敌

    交给'+get.translation(trigger.source)+'一张手牌'+str+'
    ').set('aicheck',check).set('ai',function(card){ + if(!_status.event.aicheck) return 0; + return 9-get.value(card); + }); + 'step 1' + if(result.cards){ + player.logSkill('gzfudi',trigger.source); + trigger.source.gain(result.cards,player); + player.$give(1,trigger.source); + if(event.players.length==1) event.target=event.players[0]; + else if(event.players.length) player.chooseTarget('附敌

    对'+get.translation(event.players)+'中的一名角色造成一点伤害
    ',function(card,player,target){ + return target.isFriendOf(trigger.source)&&target.hp>=player.hp + },true).set('ai',function(target){return get.damageEffect(target,player,player)}); + else event.finish(); + } + else event.finish(); + 'step 2' + var target=event.target||result.targets[0]; + if(target){ + player.line(target,'green'); + target.damage(player); + } + }, + ai:{ + maixie:true, + maixie_defend:true, + effect:{ + target:function(card,player,target){ + if(get.tag(card,'damage')){ + if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; + if(!target.countCards('h')) return [1,-1]; + if(game.countPlayer(function(current){return current.isFriendOf(player)&¤t.hp>=target.hp-1})) return [1,0,0,-2]; + } + } + } + } + }, + congjian:{ + trigger:{global:'damageBefore'}, + forced:true, + filter:function(event,player){ + if(event.num<=0) return false; + if(event.source&&event.source==player&&_status.currentPhase!=player&&event.notLink()) return true; + if(event.player&&event.player==player&&_status.currentPhase==player) return true; + }, + check:function(event,player){ + return _status.currentPhase!=player; + }, + content:function(){trigger.num++}, + ai:{ + //damageBones:true, + } + }, + jianan:{ + unique:true, + forceunique:true, + group:'wuziliangjiangdao', + derivation:'wuziliangjiangdao', + global:'g_jianan', + }, + g_jianan:{ + trigger:{player:'phaseBegin'}, + filter:function(event,player){ + if(!get.zhu(player,'jianan')) return false; + if(!player.countCards('he')) return false; + if(get.is.jun(player)&&player.isUnseen(1)) return false; + return !player.isUnseen(); + }, + direct:true, + content:function(){ + 'step 0' + var skills=['tuxi','qiaobian','gzxiaoguo','gzjieyue','new_duanliang']; + game.countPlayer(function(current){ + if(current==player) return; + if(current.hasSkill('tuxi')) skills.remove('tuxi'); + if(current.hasSkill('qiaobian')) skills.remove('qiaobian'); + if(current.hasSkill('gzxiaoguo')) skills.remove('gzxiaoguo'); + if(current.hasSkill('gzjieyue')) skills.remove('gzjieyue'); + if(current.hasSkill('new_duanliang')) skills.remove('new_duanliang'); + }); + if(!skills.length) event.finish(); + else{ + event.skills=skills; + var next=player.chooseToDiscard(); + next.prompt='是否弃置一张牌并发动【五子良将纛】?' + next.prompt2=get.translation('wuziliangjiangdao_info'); + next.logSkill='g_jianan'; + next.skills=skills; + next.ai=function(card){ + return -1; + }; + } + 'step 1' + if(!result.bool) event.finish(); + else{ + var list=["主将","副将"]; + if(player.isUnseen(0)||get.is.jun(player)) list.remove("主将"); + if(player.isUnseen(1)) list.remove("副将"); + if(!list.length) event.finish(); + else if(list.length<2) event._result={control:list[0]}; + else{ + player.chooseControl(list).prompt="请选择暗置一张武将牌"; + } + } + 'step 2' + if(!result.control) event.finish(); + else{ + var num=result.control=='主将'?0:1; + player.hideCharacter(num); + player.chooseControl(event.skills).prompt="选择获得其中的一个技能直到下回合开始"; + } + 'step 3' + var link=result.control; + player.addTempSkill(link,{player:"phaseBefore"}); + player.addTempSkill("jianan_eff",{player:"phaseBefore"}); + game.log(player,"获得了技能","#g【"+get.translation(result.control)+"】"); + }, + }, + jianan_eff:{ + ai:{nomingzhi:true} + }, + huibian:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return game.countPlayer(function(current){ + return current.identity=='wei'; + })>1&&game.hasPlayer(function(current){ + return current.isDamaged()&¤t.identity=='wei'; + }); + }, + filterTarget:function(card,player,target){ + if(ui.selected.targets.length) return target.isDamaged()&&target.identity=='wei'; + return target.identity=='wei'; + }, + selectTarget:2, + multitarget:true, + targetprompt:['受到伤害
    然后摸牌','回复体力'], + content:function(){ + 'step 0' + targets[0].damage(player); + 'step 1' + if(targets[0].isAlive()) targets[0].draw(2); + targets[1].recover(); + }, + ai:{ + threaten:1.2, + order:9, + result:{ + target:function(player,target){ + if(ui.selected.targets.length) return 1; + if(get.damageEffect(target,player,player)>0) return 2; + if(target.hp>2) return 1; + if(target.hp==1) return -1; + return 0.1; + } + }, + } + }, + gzzongyu:{ + unique:true, + forceunique:true, + group:['gzzongyu_others','gzzongyu_player'], + ai:{ + threaten:1.2, + }, + subSkill:{ + others:{ + trigger:{global:'equipAfter'}, + direct:true, + filter:function(event,player){ + if(event.player==player||!player.countCards('e',{subtype:['equip3','equip4']})) return false; + return event.card.name=='liulongcanjia'; + }, + check:function(event,player){ + if(get.attitude(player,target)<=0) return player.countCards('e',{subtype:['equip4','equip4']})<2; + return true; }, content:function(){ 'step 0' - player.awakenSkill('jianglue'); - player.addTempSkill('jianglue_count'); - player.chooseJunlingFor(player).set('prompt','选择一张军令牌,令与你势力相同的其他角色选择是否执行'); + player.chooseBool('是否发动【总御】,与'+get.translation(trigger.player)+'交换装备区内坐骑牌?'); 'step 1' - event.junling=result.junling; - event.targets=result.targets; - event.players=game.filterPlayer(function(current){ - if(current==player) return false; - return current.isFriendOf(player)||current.isUnseen(); - }).sort(lib.sort.seat); - event.num=0; + if(result.bool){ + player.logSkill('gzzongyu_others',trigger.player); + event.cards=[player.getCards('e',{subtype:['equip3','equip4']}),trigger.player.getCards('e',{name:'liulongcanjia'})]; + player.lose(event.cards[0],ui.special); + trigger.player.lose(event.cards[1],ui.special); + if(event.cards[0].length) player.$give(event.cards[0],trigger.player); + if(event.cards[1].length) trigger.player.$give(event.cards[1],player); + } + else event.finish(); 'step 2' - if(num0.5?0:1;}).prompt='选择并展示一张武将牌,然后执行军令'; - } - 'step 4' - if(!event.list) event.list=[player]; - if(event.carry){ - if(event.showCharacter) event.current.showCharacter(result.index); - event.current.carryOutJunling(player,event.junling,targets); - event.list.push(event.current); - } - event.num++; - if(event.num0) player.draw(player.storage.jianglue_count); + for(var i=0;i=game.players.length/4) return 1; - return Math.random()>0.7?1:0; + }, + player:{ + trigger:{player:'equipAfter'}, + forced:true, + filter:function(event,player){ + if(!['equip3','equip4'].contains(get.subtype(event.card))) return false; + for(var i=0;i0.7; + return true; + } + }, + content:function(){ + 'step 0' + var choices=[]; + if(game.hasPlayer(function(current){return current.isUnseen()})) choices.push('选择一名未确定势力的角色'); + if(game.hasPlayer(function(current){return current!=player&&!current.isUnseen()})&&player.countCards('h',{type:'basic'})) choices.push('交给一名已确定势力角色一张基本牌'); + player.chooseControl(choices,ui.create.dialog('征辟

    选择一项
    ','hidden')).set('ai',function(){ + if(choices.length>1){ + var player=_status.event.player; + if(!game.hasPlayer(function(current){ + return !current.isUnseen()&¤t.getEquip('yuxi')||current.hasSkill('gzyongsi')&&!game.hasPlayer(function(current){ + return current.getEquip('yuxi'); + }); + })&&game.hasPlayer(function(current){return current!=player&¤t.isUnseen()})){ + var identity; + for(var i=0;i=get.population(identity)) return 0; + return 1; + } + return 0; + }); + 'step 1' + if(result.control=='选择一名未确定势力的角色') player.chooseTarget('征辟

    选择一名未确定势力角色,你对其使用牌没有次数和距离限制直到回合结束
    ',function(card,player,target){ + return target!=player&&target.identity=='unknown' + },true); + else player.chooseCardTarget({ + prompt:'征辟

    交给一名已确定势力角色一张基本牌,然后该角色交给你一张非基本牌或两张基本牌
    ', + position:'h', + filterCard:function(card){return get.type(card)=='basic'}, + filterTarget:function(card,player,target){ + return target!=player&&target.identity!='unknown'; + }, + ai1:function(card){return 7-get.value(card)}, + //ai2:function(card,player,target){} + }).set('forced',true); + 'step 2' + event.target=result.targets[0]; + player.line(result.targets,'green'); + if(result.cards.length){ + event.cards=result.cards; + result.targets[0].gain(result.cards,player); + player.$give(result.cards,result.targets[0]); + } + else{ + player.storage.gzzhengbi_eff1=result.targets[0]; + player.addTempSkill('gzzhengbi_eff1'); + event.finish(); + } + 'step 3' + var choices=[]; + if(target.countCards('he',{type:['trick','delay','equip']})) choices.push('一张非基本牌'); + if(target.countCards('h',{type:'basic'})>1) choices.push('两张基本牌'); + if(choices.length) target.chooseControl(choices,ui.create.dialog('征辟

    交给'+get.translation(player)+'
    ')).set('ai',function(event,player){ + if(choices.length>1){ + if(player.countCards('he',{type:['trick','delay','equip']},function(card){return get.value(card)<7})) return 0; + return 1; + } + return 0; + }); + else{ + if(target.countCards('h')){ + var cards=target.getCards('h'); + player.gain(cards,target); + target.$giveAuto(cards,player); + event.finish(); + } + else event.finish(); + } + 'step 4' + var check=(result.control=='一张非基本牌'); + target.chooseCard('he',(check?1:2),{type:(check?['trick','delay','equip']:'basic')},true); + 'step 5' + if(result.cards){ + player.gain(result.cards,target); + target.$giveAuto(result.cards,player); + } + }, + subSkill:{ + eff1:{ + sub:true, + mod:{ + targetInRange:function (card,player,target){ + if(target==player.storage.gzzhengbi_eff1) return true; + }, + cardUsable:function (card,player,num){ + if(typeof num=='number'&&player.storage.gzzhengbi_eff1.isAlive()&&player.storage.gzzhengbi_eff1.isUnseen()) return num+100; + }, + playerEnabled:function (card,player,target){ + if(player.storage.gzzhengbi_eff1.isAlive()&&player.storage.gzzhengbi_eff1.isUnseen()&&target!=player.storage.gzzhengbi_eff1){ + var num=player.getCardUsable(card)-100; + if(num<=0) return false; + } }, }, - subSkill:{ - others:{ - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return (!player.isUnseen())&&player.countCards('he')>2&&game.hasPlayer(function(current){ - return current!=player&¤t.hasSkill('gzxuanhuo')&&player.isFriendOf(current); - }); - }, - prompt:function(){ - var player=_status.event.player; - var list=game.filterPlayer(function(current){ - return current!=player&¤t.hasSkill('gzxuanhuo')&&player.isFriendOf(current); - }); - var str='选择两张牌。将第一张牌交给'+get.translation(list); - if(list.length>1) str+='中的一人'; - str+=',并弃置第二张牌'; - return str; + onremove:true, + }, + eff2:{sub:true}, + } + }, + gzfengying:{ + limited:true, + enable:'phaseUse', + position:'h', + filterCard:true, + selectCard:-1, + filter:function(event,player){ + return !player.storage.gzfengying&&player.countCards('h')>0; }, - position:'he', - filterCard:true, - selectCard:2, - complexSelect:true, - complexCard:true, - check:function(card,player,target){ - if(get.position(card)=='h') return 8-get.value(card); - return 6-get.value(card); - }, - filterTarget:function(card,player,target){return target!=player&&target.hasSkill('gzxuanhuo')&&target.isFriendOf(player)}, - discard:false, - lose:false, - content:function(){ - 'step 0' - target.gain(cards[0],player); - player.$giveAuto(cards[0],target); - player.discard(cards[1]); - 'step 1' - var list=['wusheng','new_paoxiao','new_longdan','new_tieji','liegong','xinkuanggu']; - for(var i=0;i=4) return 0; + for(var i=0;i0; - }, - content:function(){ - 'step 0' - event.num=trigger.num; - 'step 1' - event.num--; - player.logSkill('enyuan_damage',trigger.source); - trigger.source.chooseCard('交给'+get.translation(player)+'一张手牌,或失去一点体力','h').set('ai',function(card){ - if(get.attitude(_status.event.player,_status.event.getParent().player)>0) return 11-get.value(card); - return 7-get.value(card); - }); - 'step 2' - if(result.bool){ - player.gain(result.cards[0],trigger.source); - trigger.source.$give(1,player); - } - else trigger.source.loseHp(); - if(event.num>0) event.goto(1); - }, - audio:'enyuan2', - }, - } }, + } + }, + + gzjieyue:{ + trigger:{player:'phaseBegin'}, + filter:function(event,player){ + return player.countCards('h')&&game.hasPlayer(function(current){ + return current!=player&¤t.identity!='wei'; + }); + }, + direct:true, + content:function(){ + 'step 0' + player.chooseCardTarget({ + prompt:get.prompt2('gzjieyue'), + position:'h', + filterCard:true, + filterTarget:function(card,player,target){ + return target.identity!='wei'&&target!=player; + }, + ai1:function(card,player,target){ + if(get.attitude(player,target)>0) return 11-get.value(card); + return 7-get.value(card); + }, + ai2:function(card,player,target){ + var att=get.attitude(player,target); + if(att<0) return -att; + return 1; + } + }); + 'step 1' + if(result.bool){ + event.target=result.targets[0]; + player.logSkill('gzjieyue',result.targets); + result.targets[0].gain(result.cards[0],player); + player.$give(1,result.targets[0]); + player.chooseJunlingFor(result.targets[0]); + } + else event.finish(); + 'step 2' + event.junling=result.junling; + event.targets=result.targets; + var choiceList=[]; + choiceList.push('执行该军令,然后'+get.translation(player)+'摸一张牌'); + choiceList.push('令'+get.translation(player)+'摸牌阶段额外摸三张牌'); + target.chooseJunlingControl(player,result.junling,result.targets).set('prompt','节钺').set('choiceList',choiceList).set('ai',function(){ + if(get.attitude(target,player)>0) return get.junlingEffect(player,result.junling,target,result.targets,target)>1?0:1; + return get.junlingEffect(player,result.junling,target,result.targets,target)>=-1?0:1; + }); + 'step 3' + if(result.index==0){ + target.carryOutJunling(player,event.junling,targets); + player.draw(); + } + else player.addTempSkill('gzjieyue_eff'); + }, + ai:{threaten:2}, + subSkill:{ + eff:{ + sub:true, + trigger:{global:'phaseDrawBegin'}, + filter:function(event,player){ + if(event.player!=player) return false; + return event.num>0; + }, + silent:true, + content:function(){ + trigger.num+=3; + } + } + }, + audio:['jieyue',2], + }, + + jianglue:{ + limited:true, + enable:'phaseUse', + prepare:function(cards,player){ + var targets=game.filterPlayer(function(current){ + return current.isFriendOf(player)||current.isUnseen(); + }); + player.line(targets,'fire'); + }, + content:function(){ + 'step 0' + player.awakenSkill('jianglue'); + player.addTempSkill('jianglue_count'); + player.chooseJunlingFor(player).set('prompt','选择一张军令牌,令与你势力相同的其他角色选择是否执行'); + 'step 1' + event.junling=result.junling; + event.targets=result.targets; + event.players=game.filterPlayer(function(current){ + if(current==player) return false; + return current.isFriendOf(player)||current.isUnseen(); + }).sort(lib.sort.seat); + event.num=0; + 'step 2' + if(num0.5?0:1;}).prompt='选择并展示一张武将牌,然后执行军令'; + } + 'step 4' + if(!event.list) event.list=[player]; + if(event.carry){ + if(event.showCharacter) event.current.showCharacter(result.index); + event.current.carryOutJunling(player,event.junling,targets); + event.list.push(event.current); + } + event.num++; + if(event.num0) player.draw(player.storage.jianglue_count); + }, + marktext:'略', + skillAnimation:'epic', + animationColor:'soil', + ai:{ + order:4, + result:{ + player:function(player){ + if(player.isUnseen()&&player.wontYe()){ + if(get.population(player._group)>=game.players.length/4) return 1; + return Math.random()>0.7?1:0; + } + else return 1; + } + } + }, + subSkill:{ + count:{ + sub:true, + trigger:{global:'recoverAfter'}, + silent:true, + filter:function(event){return event.getParent('jianglue')}, + content:function(){player.storage.jianglue_count++} + } + } + }, + gzxuanhuo:{ + global:'gzxuanhuo_others', + derivation:['wusheng','new_paoxiao','new_longdan','new_tieji','liegong','xinkuanggu'], + ai:{ + threaten:function(player,target){ + if(game.hasPlayer(function(current){ + return current!=target&¤t.isFriendOf(target); + })) return 1.5; + return 0.5; + }, + }, + subSkill:{ + others:{ + enable:'phaseUse', + usable:1, + filter:function(event,player){ + return (!player.isUnseen())&&player.countCards('he')>2&&game.hasPlayer(function(current){ + return current!=player&¤t.hasSkill('gzxuanhuo')&&player.isFriendOf(current); + }); + }, + prompt:function(){ + var player=_status.event.player; + var list=game.filterPlayer(function(current){ + return current!=player&¤t.hasSkill('gzxuanhuo')&&player.isFriendOf(current); + }); + var str='选择两张牌。将第一张牌交给'+get.translation(list); + if(list.length>1) str+='中的一人'; + str+=',并弃置第二张牌'; + return str; + }, + position:'he', + filterCard:true, + selectCard:2, + complexSelect:true, + complexCard:true, + check:function(card,player,target){ + if(get.position(card)=='h') return 8-get.value(card); + return 6-get.value(card); + }, + filterTarget:function(card,player,target){return target!=player&&target.hasSkill('gzxuanhuo')&&target.isFriendOf(player)}, + discard:false, + lose:false, + content:function(){ + 'step 0' + target.gain(cards[0],player); + player.$giveAuto(cards[0],target); + player.discard(cards[1]); + 'step 1' + var list=['wusheng','new_paoxiao','new_longdan','new_tieji','liegong','xinkuanggu']; + for(var i=0;i0; + }, + content:function(){ + 'step 0' + event.num=trigger.num; + 'step 1' + event.num--; + player.logSkill('enyuan_damage',trigger.source); + trigger.source.chooseCard('交给'+get.translation(player)+'一张手牌,或失去一点体力','h').set('ai',function(card){ + if(get.attitude(_status.event.player,_status.event.getParent().player)>0) return 11-get.value(card); + return 7-get.value(card); + }); + 'step 2' + if(result.bool){ + player.gain(result.cards[0],trigger.source); + trigger.source.$give(1,player); + } + else trigger.source.loseHp(); + if(event.num>0) event.goto(1); + }, + audio:'enyuan2', + }, + } + }, "new_jushou":{ audio:"jushou", @@ -1836,83 +1836,51 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ global:"phaseAfter", }, filter:function (event,player){ - if(event.player.countCards('h')==0&&event.player.isAlive()) return true; - return false; - }, + if(event.player.countCards('h')==0&&event.player.isAlive()) return true; + return false; + }, check:function (event,player){ - return get.attitude(player,event.player)>2; - }, + return get.attitude(player,event.player)>2; + }, content:function (){ - player.line(trigger.player,'green'); - trigger.player.draw(2); - player.loseHp(); - }, + player.line(trigger.player,'green'); + trigger.player.draw(2); + player.loseHp(); + }, }, "new_luanji":{ audio:"luanji", enable:"phaseUse", viewAs:{ name:"wanjian", - cards:[{"node":{"image":{},"info":{},"name":{},"name2":{},"background":{},"intro":{},"range":{}},"storage":{},"vanishtag":[],"_uncheck":[],"suit":"spade","number":12,"name":"tiesuo","cardid":"8628233400","clone":{"name":"tiesuo","suit":"spade","number":12,"node":{"name":{},"info":{},"intro":{},"background":{},"image":{}},"_transitionEnded":true,"timeout":4467},"timeout":4363,"original":"h"},{"node":{"image":{},"info":{},"name":{},"name2":{},"background":{},"intro":{},"range":{}},"storage":{},"vanishtag":[],"_uncheck":[],"suit":"spade","number":13,"name":"nanman","cardid":"6870636402","clone":{"name":"nanman","suit":"spade","number":13,"node":{"name":{},"info":{},"intro":{},"background":{},"image":{}},"_transitionEnded":true,"timeout":4468},"timeout":4364,"original":"h"}], }, filterCard:function (card,player){ - if(!player.storage.new_luanji) return true; - return !player.storage.new_luanji.contains(get.suit(card)); - }, + if(!player.storage.new_luanji) return true; + return !player.storage.new_luanji.contains(get.suit(card)); + }, selectCard:2, check:function (card){ - var player=_status.event.player; - var targets=game.filterPlayer(function(current){ - return player.canUse('wanjian',current); - }); - var num=0; - for(var i=0;i=7){ - if(num<2) return 0; - } - else if(targets.length>=5){ - if(num<1.5) return 0; - } - } - return 6-get.value(card); - }, - ai:{ - basic:{ - order:10, - useful:1, - value:5, - }, - wuxie:function (target,card,player,viewer){ - if(get.attitude(viewer,target)>0&&target.countCards('h','shan')){ - if(!target.countCards('h')||target.hp==1||Math.random()<0.7) return 0; - } - }, - result:{ - target:function (player,target){ - if(player.hasUnknown(2)&&get.mode()!='guozhan') return 0; - var nh=target.countCards('h'); - if(get.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; - }, - }, - tag:{ - respond:1, - respondShan:1, - damage:1, - multitarget:1, - multineg:1, - }, + var player=_status.event.player; + var targets=game.filterPlayer(function(current){ + return player.canUse('wanjian',current); + }); + var num=0; + for(var i=0;i=7){ + if(num<2) return 0; + } + else if(targets.length>=5){ + if(num<1.5) return 0; + } + } + return 6-get.value(card); }, group:["new_luanji_count","new_luanji_reset","new_luanji_respond"], subSkill:{ @@ -1922,11 +1890,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, silent:true, filter:function (event,player){ - return player.storage.new_luanji?true:false; - }, + return player.storage.new_luanji?true:false; + }, content:function (){ - delete player.storage.new_luanji; - }, + delete player.storage.new_luanji; + }, sub:true, forced:true, popup:false, @@ -1937,16 +1905,16 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, silent:true, filter:function (event){ - return event.skill=='new_luanji'; - }, + return event.skill=='new_luanji'; + }, content:function (){ - if(!player.storage.new_luanji){ - player.storage.new_luanji=[]; - } - for(var i=0;i=0) return 0; - if(player.hasCard(function(card){ - return get.tag(card,'damage')&&player.canUse(card,target,true,true); - })){ - if(target.maxHp>3) return -0.5; - return -1; - } - return 0; - }, + if(target.hp<=0) return -5; + if(player.getStat().skill.qingcheng) return 0; + if(!target.hasSkillTag('maixie')) return 0; + if(get.attitude(player,target)>=0) return 0; + if(player.hasCard(function(card){ + return get.tag(card,'damage')&&player.canUse(card,target,true,true); + })){ + if(target.maxHp>3) return -0.5; + return -1; + } + return 0; + }, }, }, }, "new_kongcheng":{ init:function (player){ - if(player.storage.new_kongcheng==undefined) player.storage.new_kongcheng=[]; - }, + if(player.storage.new_kongcheng==undefined) player.storage.new_kongcheng=[]; + }, group:["new_kongcheng_gain","new_kongcheng_got"], subSkill:{ gain:{ @@ -2068,14 +2036,14 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ player:"gainEnd", }, filter:function (event,player){ - return event.source&&event.source!=player&&event.cards.length==player.countCards('h')&&player!=_status.currentPhase; - }, + return event.source&&event.source!=player&&event.cards.length==player.countCards('h')&&player!=_status.currentPhase; + }, content:function (){ - player.storage.new_kongcheng=player.storage.new_kongcheng.concat(player.getCards('h')); - player.markSkill('new_kongcheng'); - game.addVideo('storage',player,['new_kongcheng',get.cardsInfo(player.storage.new_kongcheng),'cards']); - player.lose(player.getCards('h'),ui.special,'toStorage'); - }, + player.storage.new_kongcheng=player.storage.new_kongcheng.concat(player.getCards('h')); + player.markSkill('new_kongcheng'); + game.addVideo('storage',player,['new_kongcheng',get.cardsInfo(player.storage.new_kongcheng),'cards']); + player.lose(player.getCards('h'),ui.special,'toStorage'); + }, sub:true, forced:true, }, @@ -2084,14 +2052,14 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ player:"phaseDrawBegin", }, filter:function (event,player){ - return player.storage.new_kongcheng.length>0; - }, + return player.storage.new_kongcheng.length>0; + }, content:function (){ - player.gain(player.storage.new_kongcheng,'draw','fromStorage'); - player.storage.new_kongcheng=[]; - game.addVideo('storage',player,['new_kongcheng',get.cardsInfo(player.storage.new_kongcheng),'cards']); - player.unmarkSkill('new_kongcheng'); - }, + player.gain(player.storage.new_kongcheng,'draw','fromStorage'); + player.storage.new_kongcheng=[]; + game.addVideo('storage',player,['new_kongcheng',get.cardsInfo(player.storage.new_kongcheng),'cards']); + player.unmarkSkill('new_kongcheng'); + }, sub:true, forced:true, }, @@ -2103,40 +2071,40 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ forced:true, priority:15, check:function (event,player){ - return get.effect(event.target,event.card,event.player,player)<0; - }, + return get.effect(event.target,event.card,event.player,player)<0; + }, filter:function (event,player){ - return player.countCards('h')==0&&(event.card.name=='sha'||event.card.name=='juedou'); - }, + return player.countCards('h')==0&&(event.card.name=='sha'||event.card.name=='juedou'); + }, content:function (){ - trigger.cancel(); - }, + trigger.cancel(); + }, ai:{ effect:{ target:function (card,player,target,current){ - if(target.countCards('h')==0&&(card.name=='sha'||card.name=='juedou')) return 'zeroplayertarget'; - }, + if(target.countCards('h')==0&&(card.name=='sha'||card.name=='juedou')) return 'zeroplayertarget'; + }, }, }, intro:{ mark:function (dialog,content,player){ - if(content&&content.length){ - if(player==game.me||player.isUnderControl()){ - dialog.addAuto(content); - } - else{ - return '共有'+get.cnNumber(content.length)+'张牌'; - } - } - }, + if(content&&content.length){ + if(player==game.me||player.isUnderControl()){ + dialog.addAuto(content); + } + else{ + return '共有'+get.cnNumber(content.length)+'张牌'; + } + } + }, content:function (content,player){ - if(content&&content.length){ - if(player==game.me||player.isUnderControl()){ - return get.translation(content); - } - return '共有'+get.cnNumber(content.length)+'张牌'; - } - }, + if(content&&content.length){ + if(player==game.me||player.isUnderControl()){ + return get.translation(content); + } + return '共有'+get.cnNumber(content.length)+'张牌'; + } + }, }, }, "new_keji":{ @@ -2150,10 +2118,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ priority:1, silent:true, content:function (){ - player.storage.keji_type=[]; - player.storage.keji_color=[]; - player.storage.keji_suit=[]; - }, + player.storage.keji_type=[]; + player.storage.keji_color=[]; + player.storage.keji_suit=[]; + }, sub:true, forced:true, popup:false, @@ -2164,21 +2132,19 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, silent:true, content:function (){ - if(!player.storage.keji_type){ - player.storage.keji_type=[]; - } - if(!player.storage.keji_color){ - player.storage.keji_color=[]; - } - if(!player.storage.keji_suit){ - player.storage.keji_suit=[]; - } - for(var i=0;i3) return true; - if(player.storage.keji_type&&player.storage.keji_type.length>2) return true; - return false; - }, + if(player.storage.keji_suit&&player.storage.keji_suit.length>3) return true; + if(player.storage.keji_type&&player.storage.keji_type.length>2) return true; + return false; + }, + check:function(event,player){ + return player.canMoveCard(true); + }, content:function (){ - player.moveCard(); - }, + player.moveCard(); + }, }, "new_longdan":{ group:["new_longdan_sha","new_longdan_shan","new_longdan_draw","new_longdan_shamiss","new_longdan_shanafter"], @@ -2233,22 +2201,22 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, priority:1, filter:function (event,player){ - return event.skill=='new_longdan_shan'&&event.getParent(2).name=='sha'; - }, + return event.skill=='new_longdan_shan'&&event.getParent(2).name=='sha'; + }, direct:true, content:function (){ - "step 0" - player.chooseTarget("是否发动【龙胆】令一名其他角色回复1点体力?",function(card,player,target){ - return target!=trigger.source&&target!=player&&target.isDamaged(); - }).set('ai',function(target){ - return get.attitude(_status.event.player,target); - }); - "step 1" - if(result.bool&&result.targets&&result.targets.length){ - player.line(result.targets[0],'green'); - result.targets[0].recover(); - } - }, + "step 0" + player.chooseTarget("是否发动【龙胆】令一名其他角色回复1点体力?",function(card,player,target){ + return target!=trigger.source&&target!=player&&target.isDamaged(); + }).set('ai',function(target){ + return get.attitude(_status.event.player,target); + }); + "step 1" + if(result.bool&&result.targets&&result.targets.length){ + player.line(result.targets[0],'green'); + result.targets[0].recover(); + } + }, }, shamiss:{ sub:true, @@ -2258,21 +2226,21 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, direct:true, filter:function (event,player){ - return event.skill=='new_longdan_sha'; - }, + return event.skill=='new_longdan_sha'; + }, content:function (){ - "step 0" - player.chooseTarget("是否发动【龙胆】对一名其他角色造成1点伤害?",function(card,player,target){ - return target!=trigger.target&&target!=player; - }).set('ai',function(target){ - return -get.attitude(_status.event.player,target); - }); - "step 1" - if(result.bool&&result.targets&&result.targets.length){ - player.line(result.targets[0],'green'); - result.targets[0].damage(); - } - }, + "step 0" + player.chooseTarget("是否发动【龙胆】对一名其他角色造成1点伤害?",function(card,player,target){ + return target!=trigger.target&&target!=player; + }).set('ai',function(target){ + return -get.attitude(_status.event.player,target); + }); + "step 1" + if(result.bool&&result.targets&&result.targets.length){ + player.line(result.targets[0],'green'); + result.targets[0].damage(); + } + }, }, draw:{ trigger:{ @@ -2282,13 +2250,13 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ forced:true, popup:false, filter:function (event,player){ - if(!get.zhu(player,'shouyue')) return false; - return event.skill=='new_longdan_sha'||event.skill=='new_longdan_shan'; - }, + if(!get.zhu(player,'shouyue')) return false; + return event.skill=='new_longdan_sha'||event.skill=='new_longdan_shan'; + }, content:function (){ - player.draw(); - player.storage.fanghun2++; - }, + player.draw(); + //player.storage.fanghun2++; + }, sub:true, }, sha:{ @@ -2301,61 +2269,22 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ name:"sha", }, viewAsFilter:function (player){ - if(!player.countCards('h','shan')) return false; - }, + if(!player.countCards('h','shan')) return false; + }, prompt:"将一张闪当杀使用或打出", check:function (){return 1}, ai:{ effect:{ target:function (card,player,target,current){ - if(get.tag(card,'respondSha')&¤t<0) return 0.6 - }, + if(get.tag(card,'respondSha')&¤t<0) return 0.6 + }, }, respondSha:true, skillTagFilter:function (player){ - if(!player.countCards('h','shan')) return false; - }, + if(!player.countCards('h','shan')) return false; + }, order:function (){ - return get.order({name:'sha'})+0.1; - }, - useful:-1, - value:-1, - basic:{ - useful:[5,1], - value:[5,1], - }, - result:{ - target:function (player,target){ - if(player.hasSkill('jiu')&&!target.getEquip('baiyin')){ - if(get.attitude(player,target)>0){ - return -6; - } - else{ - return -3; - } - } - return -1.5; - }, - }, - 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; - }, + return get.order({name:'sha'})+0.1; }, }, sub:true, @@ -2368,30 +2297,21 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, viewAs:{ name:"shan", - suit:"spade", - number:5, }, prompt:"将一张杀当闪打出", check:function (){return 1}, viewAsFilter:function (player){ - if(!player.countCards('h','sha')) return false; - }, + if(!player.countCards('h','sha')) return false; + }, ai:{ respondShan:true, skillTagFilter:function (player){ - if(!player.countCards('h','sha')) return false; - }, + if(!player.countCards('h','sha')) return false; + }, effect:{ target:function (card,player,target,current){ - if(get.tag(card,'respondShan')&¤t<0) return 0.6 - }, - }, - order:4, - useful:-1, - value:-1, - basic:{ - useful:[7,2], - value:[7,2], + if(get.tag(card,'respondShan')&¤t<0) return 0.6 + }, }, }, sub:true, @@ -2404,25 +2324,25 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ player:"useCard", }, filter:function (event,player){ - if(_status.currentPhase!=player) return false; - return event.card.name=='sha'&&(get.cardCount({name:'sha'},player)==2); - }, + if(_status.currentPhase!=player) return false; + return event.card.name=='sha'&&(get.cardCount({name:'sha'},player)==2); + }, forced:true, content:function (){ - player.draw(); - }, + player.draw(); + }, mod:{ cardUsable:function (card,player,num){ - if(card.name=='sha') return Infinity; - }, + if(card.name=='sha') return Infinity; + }, }, ai:{ unequip:true, skillTagFilter:function (player,tag,arg){ - if(!get.zhu(player,'shouyue')) return false; - if(arg&&arg.name=='sha') return true; - return false; - }, + if(!get.zhu(player,'shouyue')) return false; + if(arg&&arg.name=='sha') return true; + return false; + }, }, }, "new_kurou":{ @@ -2431,40 +2351,30 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ usable:1, filterCard:true, check:function (card){ - return 8-get.value(card); - }, + return 8-get.value(card); + }, position:"he", content:function (){ - player.loseHp(); - player.draw(3); - player.addTempSkill('kurou_effect','phaseAfter'); - }, + player.loseHp(); + player.draw(3); + player.addTempSkill('kurou_effect','phaseAfter'); + }, ai:{ order:8, result:{ player:function (player){ - if(player.hp<=2) return player.countCards('h')==0?1:0; - if(player.countCards('h',{name:'sha',color:'red'})) return 1; - return player.countCards('h')<=player.hp?1:0; - }, + if(player.hp<=2) return player.countCards('h')==0?1:0; + if(player.countCards('h',{name:'sha',color:'red'})) return 1; + return player.countCards('h')<=player.hp?1:0; + }, }, - effect:function (card,player,target){ - if(get.tag(card,'damage')){ - if(player.hasSkillTag('jueqing',false,target)) return [1,1]; - return 1.2; - } - if(get.tag(card,'loseHp')){ - if(player.hp<=1) return; - return [0,0]; - } - }, }, }, "kurou_effect":{ mod:{ cardUsable:function (card,player,num){ - if(card.name=='sha') return num+1; - }, + if(card.name=='sha') return num+1; + }, }, }, "new_chuli":{ @@ -2472,32 +2382,32 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ enable:"phaseUse", usable:1, filterTarget:function (card,player,target){ - if(player==target) return false; - for(var i=0;i0; - }, + if(player==target) return false; + for(var i=0;i0; + }, filter:function (event,player){ - return player.countCards('he')>0; - }, + return player.countCards('he')>0; + }, filterCard:true, position:"he", selectTarget:[1,3], check:function (card){ - if(get.suit(card)=='spade') return 8-get.value(card); - return 5-get.value(card); - }, + if(get.suit(card)=='spade') return 8-get.value(card); + return 5-get.value(card); + }, content:function (){ - "step 0" - if(num==0&&get.suit(cards[0])=='spade') player.draw(); - player.choosePlayerCard(targets[num],'he',true); - "step 1" - if(result.bool){ - if(result.links.length) targets[num].discard(result.links[0]); - if(get.suit(result.links[0])=='spade') targets[num].draw(); - } - }, + "step 0" + if(num==0&&get.suit(cards[0])=='spade') player.draw(); + player.choosePlayerCard(targets[num],'he',true); + "step 1" + if(result.bool){ + if(result.links.length) targets[num].discard(result.links[0]); + if(get.suit(result.links[0])=='spade') targets[num].draw(); + } + }, ai:{ result:{ target:-1, @@ -2512,42 +2422,42 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ derivation:["reyingzi","gzyinghun"], viceSkill:true, init:function (player){ - if(player.checkViceSkill('baka_hunshang')&&!player.viceChanged){ - player.removeMaxHp(); - } - }, + if(player.checkViceSkill('baka_hunshang')&&!player.viceChanged){ + player.removeMaxHp(); + } + }, trigger:{ player:"phaseBegin", }, filter:function (event,player){ - return player.hp<=1; - }, + return player.hp<=1; + }, forced:true, //priority:3, content:function (){ - player.addTempSkill('baka_yingzi','phaseAfter'); - player.addTempSkill('baka_yinghun','phaseAfter'); - }, + player.addTempSkill('baka_yingzi','phaseAfter'); + player.addTempSkill('baka_yinghun','phaseAfter'); + }, ai:{ threaten:function (player,target){ - if(target.hp==1) return 2; - return 0.5; - }, + if(target.hp==1) return 2; + return 0.5; + }, maixie:true, effect:{ target:function (card,player,target){ - if(!target.hasFriend()) return; - if(get.tag(card,'damage')==1&&target.hp==2&&!target.isTurnedOver()&& - _status.currentPhase!=target&&get.distance(_status.currentPhase,target,'absolute')<=3) return [0.5,1]; - }, + if(!target.hasFriend()) return; + if(get.tag(card,'damage')==1&&target.hp==2&&!target.isTurnedOver()&& + _status.currentPhase!=target&&get.distance(_status.currentPhase,target,'absolute')<=3) return [0.5,1]; + }, }, }, }, "baka_yinghun":{ inherit:"gzyinghun", filter:function (event,player){ - return player.isDamaged(); - }, + return player.isDamaged(); + }, //priority:2, audio:"yinghun", audioname:["sunce"], @@ -2556,76 +2466,76 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, direct:true, content:function (){ - "step 0" - player.chooseTarget(get.prompt('yinghun'),function(card,player,target){ - return player!=target; - }).set('ai',function(target){ - var player=_status.event.player; - if(player.maxHp-player.hp==1&&target.countCards('he')==0){ - return 0; - } - if(get.attitude(_status.event.player,target)>0){ - return 10+get.attitude(_status.event.player,target); - } - if(player.maxHp-player.hp==1){ - return -1; - } - return 1; - }); - "step 1" - if(result.bool){ - event.num=player.maxHp-player.hp; - player.logSkill(event.name,result.targets); - event.target=result.targets[0]; - if(event.num==1){ - event.directcontrol=true; - } - else{ - var str1='摸'+get.cnNumber(event.num,true)+'弃一'; - var str2='摸一弃'+get.cnNumber(event.num,true); - player.chooseControl(str1,str2,function(event,player){ - return _status.event.choice; - }).set('choice',get.attitude(player,event.target)>0?str1:str2); - event.str=str1; - } - } - else{ - event.finish(); - } - "step 2" - if(event.directcontrol||result.control==event.str){ - event.target.draw(event.num); - event.target.chooseToDiscard(true,'he'); - } - else{ - event.target.draw(); - event.target.chooseToDiscard(event.num,true,'he'); - } - }, + "step 0" + player.chooseTarget(get.prompt('yinghun'),function(card,player,target){ + return player!=target; + }).set('ai',function(target){ + var player=_status.event.player; + if(player.maxHp-player.hp==1&&target.countCards('he')==0){ + return 0; + } + if(get.attitude(_status.event.player,target)>0){ + return 10+get.attitude(_status.event.player,target); + } + if(player.maxHp-player.hp==1){ + return -1; + } + return 1; + }); + "step 1" + if(result.bool){ + event.num=player.maxHp-player.hp; + player.logSkill(event.name,result.targets); + event.target=result.targets[0]; + if(event.num==1){ + event.directcontrol=true; + } + else{ + var str1='摸'+get.cnNumber(event.num,true)+'弃一'; + var str2='摸一弃'+get.cnNumber(event.num,true); + player.chooseControl(str1,str2,function(event,player){ + return _status.event.choice; + }).set('choice',get.attitude(player,event.target)>0?str1:str2); + event.str=str1; + } + } + else{ + event.finish(); + } + "step 2" + if(event.directcontrol||result.control==event.str){ + event.target.draw(event.num); + event.target.chooseToDiscard(true,'he'); + } + else{ + event.target.draw(); + event.target.chooseToDiscard(event.num,true,'he'); + } + }, ai:{ threaten:function (player,target){ - if(target.hp==target.maxHp) return 0.5; - if(target.hp==1) return 2; - if(target.hp==2) return 1.5; - return 0.5; - }, + if(target.hp==target.maxHp) return 0.5; + if(target.hp==1) return 2; + if(target.hp==2) return 1.5; + return 0.5; + }, maixie:true, effect:{ target:function (card,player,target){ - if(target.maxHp<=3) return; - if(get.tag(card,'damage')){ - if(target.hp==target.maxHp) return [0,1]; - } - if(get.tag(card,'recover')&&player.hp>=player.maxHp-1) return [0,0]; - }, + if(target.maxHp<=3) return; + if(get.tag(card,'damage')){ + if(target.hp==target.maxHp) return [0,1]; + } + if(get.tag(card,'recover')&&player.hp>=player.maxHp-1) return [0,0]; + }, }, }, }, "baka_yingzi":{ mod:{ maxHandcard:function (player,num){ - if(!player.hasSkill('reyingzi')&&player.hp0) - }, + return (event.num>0) + }, content:function (){ - "step 0" - event.cards=get.cards(2); - "step 1" - if(event.cards.length>1){ - player.chooseCardButton('将“遗计”牌分配给任意角色',true,event.cards,[1,event.cards.length]).set('ai',function(button){ - if(ui.selected.buttons.length==0) return 1; - return 0; - }); - } - else if(event.cards.length==1){ - event._result={links:event.cards.slice(0),bool:true}; - } - else{ - event.finish(); - } - "step 2" - if(result.bool){ - for(var i=0;i0){ - return att/(1+target.countCards('h')); - } - else{ - return att/100; - } - }).set('enemy',get.value(event.togive[0])<0); - } - "step 3" - if(result.targets.length){ - result.targets[0].gain(event.togive,'draw'); - player.line(result.targets[0],'green'); - game.log(result.targets[0],'获得了'+get.cnNumber(event.togive.length)+'张牌'); - event.goto(1); - } - }, + "step 0" + event.cards=get.cards(2); + "step 1" + if(event.cards.length>1){ + player.chooseCardButton('将“遗计”牌分配给任意角色',true,event.cards,[1,event.cards.length]).set('ai',function(button){ + if(ui.selected.buttons.length==0) return 1; + return 0; + }); + } + else if(event.cards.length==1){ + event._result={links:event.cards.slice(0),bool:true}; + } + else{ + event.finish(); + } + "step 2" + if(result.bool){ + for(var i=0;i0){ + return att/(1+target.countCards('h')); + } + else{ + return att/100; + } + }).set('enemy',get.value(event.togive[0])<0); + } + "step 3" + if(result.targets.length){ + result.targets[0].gain(event.togive,'draw'); + player.line(result.targets[0],'green'); + game.log(result.targets[0],'获得了'+get.cnNumber(event.togive.length)+'张牌'); + event.goto(1); + } + }, ai:{ maixie:true, "maixie_hp":true, effect:{ target:function (card,player,target){ - if(get.tag(card,'damage')){ - if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; - if(!target.hasFriend()) return; - var num=1; - if(get.attitude(player,target)>0){ - if(player.needsToDiscard()){ - num=0.7; - } - else{ - num=0.5; - } - } - if(target.hp>=4) return [1,num*2]; - if(target.hp==3) return [1,num*1.5]; - if(target.hp==2) return [1,num*0.5]; - } - }, + if(get.tag(card,'damage')){ + if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; + if(!target.hasFriend()) return; + var num=1; + if(get.attitude(player,target)>0){ + if(player.needsToDiscard()){ + num=0.7; + } + else{ + num=0.5; + } + } + if(target.hp>=4) return [1,num*2]; + if(target.hp==3) return [1,num*1.5]; + if(target.hp==2) return [1,num*0.5]; + } + }, }, }, }, @@ -2724,48 +2634,48 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, direct:true, content:function (){ - "step 0" - player.chooseTarget(get.prompt('new_jieming'),function(card,player,target){ - return target.countCards('h')2){ - return Math.min(5,target.maxHp)-target.countCards('h'); - } - return att/3; - }); - "step 1" - if(result.bool){ - player.logSkill('new_jieming',result.targets); - for(var i=0;i2){ + return Math.min(5,target.maxHp)-target.countCards('h'); + } + return att/3; + }); + "step 1" + if(result.bool){ + player.logSkill('new_jieming',result.targets); + for(var i=0;i1){ - if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; - var max=0; - var players=game.filterPlayer(); - for(var i=0;i0){ - max=Math.max(Math.min(5,players[i].hp)-players[i].countCards('h'),max); - } - } - switch(max){ - case 0:return 2; - case 1:return 1.5; - case 2:return [1,2]; - default:return [0,max]; - } - } - if((card.name=='tao'||card.name=='caoyao')&& - target.hp>1&&target.countCards('h')<=target.hp) return [0,0]; - }, + if(get.tag(card,'damage')&&target.hp>1){ + if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; + var max=0; + var players=game.filterPlayer(); + for(var i=0;i0){ + max=Math.max(Math.min(5,players[i].hp)-players[i].countCards('h'),max); + } + } + switch(max){ + case 0:return 2; + case 1:return 1.5; + case 2:return [1,2]; + default:return [0,max]; + } + } + if((card.name=='tao'||card.name=='caoyao')&& + target.hp>1&&target.countCards('h')<=target.hp) return [0,0]; + }, }, }, }, @@ -2776,87 +2686,86 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, direct:true, content:function (){ - "step 0" - player.chooseTarget(get.prompt('new_fangzhu'),function(card,player,target){ - return player!=target - }).ai=function(target){ - if(target.hasSkillTag('noturn')) return 0; - var player=_status.event.player; - if(get.attitude(_status.event.player,target)==0) return 0; - if(get.attitude(_status.event.player,target)>0){ - if(target.classList.contains('turnedover')) return 1000-target.countCards('h'); - if(player.maxHp-player.hp<3) return -1; - return 100-target.countCards('h'); - } - else{ - if(target.classList.contains('turnedover')) return -1; - if(player.maxHp-player.hp>=3) return -1; - return 1+target.countCards('h'); - } - } - "step 1" - if(result.bool){ - player.logSkill('new_fangzhu',result.targets); - event.target=result.targets[0] - event.target.chooseToDiscard('he').set('ai',function(card){ - var player=_status.event.player; - if(player.isTurnedOver()) return -1; - return (player.hp*player.hp)-get.value(card); - }).set('dialog',['弃置一张手牌并失去一点体力;或选择不弃置,将武将牌翻面并摸牌。']); - } - else event.finish(); - "step 2" - if(result.bool){ - event.target.loseHp(); - } - else{ - event.target.draw(player.maxHp-player.hp); - event.target.turnOver(); - - } - }, + "step 0" + player.chooseTarget(get.prompt('new_fangzhu'),function(card,player,target){ + return player!=target + }).ai=function(target){ + if(target.hasSkillTag('noturn')) return 0; + var player=_status.event.player; + if(get.attitude(_status.event.player,target)==0) return 0; + if(get.attitude(_status.event.player,target)>0){ + if(target.classList.contains('turnedover')) return 1000-target.countCards('h'); + if(player.maxHp-player.hp<3) return -1; + return 100-target.countCards('h'); + } + else{ + if(target.classList.contains('turnedover')) return -1; + if(player.maxHp-player.hp>=3) return -1; + return 1+target.countCards('h'); + } + } + "step 1" + if(result.bool){ + player.logSkill('new_fangzhu',result.targets); + event.target=result.targets[0] + event.target.chooseToDiscard('he').set('ai',function(card){ + var player=_status.event.player; + if(player.isTurnedOver()) return -1; + return (player.hp*player.hp)-get.value(card); + }).set('dialog',['弃置一张手牌并失去一点体力;或选择不弃置,将武将牌翻面并摸牌。']); + } + else event.finish(); + "step 2" + if(result.bool){ + event.target.loseHp(); + } + else{ + event.target.draw(player.maxHp-player.hp); + event.target.turnOver(); + } + }, ai:{ maixie:true, "maixie_hp":true, effect:{ target:function (card,player,target){ - if(get.tag(card,'damage')){ - if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; - if(target.hp<=1) return; - if(!target.hasFriend()) return; - var hastarget=false; - var turnfriend=false; - var players=game.filterPlayer(); - for(var i=0;i0&&players[i].isTurnedOver()){ - hastarget=true; - turnfriend=true; - } - } - if(get.attitude(player,target)>0&&!hastarget) return; - if(turnfriend||target.hp==target.maxHp) return [0.5,1]; - if(target.hp>1) return [1,0.5]; - } - }, + if(get.tag(card,'damage')){ + if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; + if(target.hp<=1) return; + if(!target.hasFriend()) return; + var hastarget=false; + var turnfriend=false; + var players=game.filterPlayer(); + for(var i=0;i0&&players[i].isTurnedOver()){ + hastarget=true; + turnfriend=true; + } + } + if(get.attitude(player,target)>0&&!hastarget) return; + if(turnfriend||target.hp==target.maxHp) return [0.5,1]; + if(target.hp>1) return [1,0.5]; + } + }, }, }, }, "fengyin_main":{ init:function (player,skill){ - var skills=lib.character[player.name1][3]; - for(var i=0;i0){ - if(controls.length==1) event._result={control:controls[0]}; - else{ - player.chooseControl(controls).set('ai',function(){ - var choice='主将'; - var skills=lib.character[target.name2][3]; - for(var i=0;i1?2:0; - return 8-get.value(card); - }).set('num',num).set('suit',suit); - "step 4" - if(!result.bool){ - trigger.directHit=true; - } - }, + if(!target.isUnseen(0)&&!target.hasSkill('fengyin_main')) controls.push("主将"); + if(!target.isUnseen(1)&&!target.hasSkill('fengyin_vice')) controls.push("副将"); + if(controls.length>0){ + if(controls.length==1) event._result={control:controls[0]}; + else{ + player.chooseControl(controls).set('ai',function(){ + var choice='主将'; + var skills=lib.character[target.name2][3]; + for(var i=0;i1?2:0; + return 8-get.value(card); + }).set('num',num).set('suit',suit); + "step 4" + if(!result.bool){ + trigger.directHit=true; + } + }, }, hmkyuanyu:{ trigger:{ @@ -2954,24 +2863,24 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, forced:true, filter:function (event,player){ - if(event.num<=0||!event.source) return false; - var n1=player.getNext(); - var p1=player.getPrevious(); - if(event.source!=n1&&event.source!=p1) return true; - }, + if(event.num<=0||!event.source) return false; + var n1=player.getNext(); + var p1=player.getPrevious(); + if(event.source!=n1&&event.source!=p1) return true; + }, content:function (){ - trigger.cancel(); - }, + trigger.cancel(); + }, ai:{ effect:{ target:function (card,player,target){ - if(player.hasSkillTag('jueqing',false,target)) return; - if(player==target.getNext()||player==target.getPrevious()) return; - var num=get.tag(card,'damage'); - if(num){ - return 0; - } - }, + if(player.hasSkillTag('jueqing',false,target)) return; + if(player==target.getNext()||player==target.getPrevious()) return; + var num=get.tag(card,'damage'); + if(num){ + return 0; + } + }, }, }, }, @@ -2987,70 +2896,70 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ player:"phaseBefore", }, content:function (){ - player.storage.hmkguishu=0; - }, + player.storage.hmkguishu=0; + }, }, }, enable:"phaseUse", filter:function (event,player){ - return player.countCards('h',{suit:'spade'})>0; - }, + return player.countCards('h',{suit:'spade'})>0; + }, init:function (player){ - player.storage.hmkguishu=0; - }, + player.storage.hmkguishu=0; + }, chooseButton:{ dialog:function (event,player){ - var list=['yuanjiao','zhibi']; - for(var i=0;i2) return 1; - return 0; - } - }, + var player=_status.event.player; + if(button.link=='yuanjiao'){ + return 3; + } + if(button.link=='zhibi'){ + if(player.countCards('h',{suit:'spade'})>2) return 1; + return 0; + } + }, backup:function (links,player){ - return { - filterCard:function (card,player){ - return get.suit(card)=='spade'; - }, - position:"h", - selectCard:1, - popname:true, - ai:function(card){ - return 6-ai.get.value(card); - }, - viewAs:{name:links[0][2]}, - onuse:function(result,player){ - player.logSkill('hmkguishu'); - if(result.card.name=='yuanjiao') player.storage.hmkguishu=1; - else player.storage.hmkguishu=2; - }, - } - }, + return { + filterCard:function (card,player){ + return get.suit(card)=='spade'; + }, + position:"h", + selectCard:1, + popname:true, + ai:function(card){ + return 6-ai.get.value(card); + }, + viewAs:{name:links[0][2]}, + onuse:function(result,player){ + player.logSkill('hmkguishu'); + if(result.card.name=='yuanjiao') player.storage.hmkguishu=1; + else player.storage.hmkguishu=2; + }, + } + }, prompt:function (links,player){ - return '将一张手牌当作'+get.translation(links[0][2])+'使用'; - }, + return '将一张手牌当作'+get.translation(links[0][2])+'使用'; + }, }, ai:{ order:4, result:{ player:function (player){ - return 2; - }, + return 2; + }, }, threaten:1.6, }, @@ -3063,89 +2972,89 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ forced:true, filter:function (event,player){return player.maxHp>0&&player.hp<=0}, content:function (){ - "step 0" - event.card=get.cards()[0]; - if(player.storage.new_buqu==undefined) player.storage.new_buqu=[]; - player.storage.new_buqu.push(event.card); - player.syncStorage('new_buqu'); - player.showCards(player.storage.new_buqu,'不屈') - player.markSkill('new_buqu'); - "step 1" - for(var i=0;i0){ - return -6; - } - else{ - return -3; - } - } - return -1.5; - }, - }, - 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; - }, + return get.order({name:'sha'})-0.1; }, }, sub:true, @@ -3267,24 +3137,17 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ prompt:"将一张桃当闪打出", check:function (){return 1}, viewAsFilter:function (player){ - if(!player.countCards('h','tao')) return false; - }, + if(!player.countCards('h','tao')) return false; + }, ai:{ respondShan:true, skillTagFilter:function (player){ - if(!player.countCards('h','tao')) return false; - }, + if(!player.countCards('h','tao')) return false; + }, effect:{ target:function (card,player,target,current){ - if(get.tag(card,'respondShan')&¤t<0) return 0.6 - }, - }, - order:4, - useful:-1, - value:-1, - basic:{ - useful:[7,2], - value:[7,2], + if(get.tag(card,'respondShan')&¤t<0) return 0.6 + }, }, }, sub:true, @@ -3327,59 +3190,59 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ "xianqu_skill":{ enable:"phaseUse", filter:function (event,player){ - return player.countCards('h')<4; - }, + return player.countCards('h')<4; + }, usable:1, mark:true, intro:{ content:"◇出牌阶段,你可以弃置此标记,然后将手牌摸至四张并观看一名其他角色的一张武将牌。", }, content:function (){ - "step 0" - player.draw(4-player.countCards('h')); - player.chooseTarget('是否观看一名其他角色的一张暗置武将牌?',function(card,player,target){ - return target!=player&&target.isUnseen(2); - }).set('ai',function(target){ - if(target.isUnseen()){ - var next=_status.event.player.getNext(); - if (target!=next) return 10; - return 9; - } - return -get.attitude(_status.event.player,target); - }); - "step 1" - if(result.bool){ - event.target=result.targets[0]; - player.line(event.target,'green'); - var controls=[]; - if(event.target.isUnseen(0)) controls.push('主将'); - if(event.target.isUnseen(1)) controls.push('副将'); - if(controls.length>1){ - player.chooseControl(controls); - } - if(controls.length==0) event.finish(); - } - else{ - player.removeSkill('xianqu_skill'); - event.finish(); - } - "step 2" - if(result.control){ - if(result.control=='主将'){ - player.viewCharacter(event.target,0); - } - else{ - player.viewCharacter(event.target,1); - } - } - else if(target.isUnseen(0)){ - player.viewCharacter(event.target,0); - } - else{ - player.viewCharacter(event.target,1); - } - player.removeSkill('xianqu_skill'); - }, + "step 0" + player.draw(4-player.countCards('h')); + player.chooseTarget('是否观看一名其他角色的一张暗置武将牌?',function(card,player,target){ + return target!=player&&target.isUnseen(2); + }).set('ai',function(target){ + if(target.isUnseen()){ + var next=_status.event.player.getNext(); + if (target!=next) return 10; + return 9; + } + return -get.attitude(_status.event.player,target); + }); + "step 1" + if(result.bool){ + event.target=result.targets[0]; + player.line(event.target,'green'); + var controls=[]; + if(event.target.isUnseen(0)) controls.push('主将'); + if(event.target.isUnseen(1)) controls.push('副将'); + if(controls.length>1){ + player.chooseControl(controls); + } + if(controls.length==0) event.finish(); + } + else{ + player.removeSkill('xianqu_skill'); + event.finish(); + } + "step 2" + if(result.control){ + if(result.control=='主将'){ + player.viewCharacter(event.target,0); + } + else{ + player.viewCharacter(event.target,1); + } + } + else if(target.isUnseen(0)){ + player.viewCharacter(event.target,0); + } + else{ + player.viewCharacter(event.target,1); + } + player.removeSkill('xianqu_skill'); + }, ai:{ order:1, result:{ @@ -3405,31 +3268,31 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ enable:"phaseUse", usable:1, content:function (){ - player.draw(2); - player.removeSkill('zhulianbihe_skill'); - }, + player.draw(2); + player.removeSkill('zhulianbihe_skill'); + }, ai:{ order:function (item,player){ - var cards=player.getCards('h'); - if(player.hp>=3){ - if(cards.length>=3){ - for(var i=0;i=1) return 7.2; - } - return 1; - } - else return 7.2; - } - if(player.hp=2){ - if(cards.length<2){ - for(var i=0;i=1) return 7.2; - } - return 1; - } - } - return 1; - }, + var cards=player.getCards('h'); + if(player.hp>=3){ + if(cards.length>=3){ + for(var i=0;i=1) return 7.2; + } + return 1; + } + else return 7.2; + } + if(player.hp=2){ + if(cards.length<2){ + for(var i=0;i=1) return 7.2; + } + return 1; + } + } + return 1; + }, result:{ player:2, }, @@ -3443,97 +3306,32 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ filterCard:function (){return false}, selectCard:-1, precontent:function (){ - player.removeSkill('zhulianbihe_skill'); - }, + player.removeSkill('zhulianbihe_skill'); + }, ai:{ save:true, respondTao:true, - basic:{ - order:function (card,player){ - if(player.hasSkillTag('pretao')) return 4.9; - return 1.9; - }, - useful:[8,6.5,5,4], - value:[8,6.5,5,4], - }, - result:{ - target:function (player,target){ - // if(player==target&&player.hp<=0) return 2; - var nd=player.needsToDiscard(); - var keep=false; - if(nd<=0){ - keep=true; - } - else if(nd==1&&target.hp>=2&&target.countCards('h','tao')<=1){ - keep=true; - } - var mode=get.mode(); - if(target.hp>=2&&keep&&target.hasFriend()){ - if(target.hp>2||nd==0) return 0; - if(target.hp==2){ - if(game.hasPlayer(function(current){ - if(target!=current&&get.attitude(target,current)>=3){ - if(current.hp<=1) return true; - if((mode=='identity'||mode=='versus'||mode=='chess')&¤t.identity=='zhu'&¤t.hp<=2) return true; - } - })){ - return 0; - } - } - } - if(target.hp<0&&target!=player&&target.identity!='zhu') return 0; - var att=get.attitude(player,target); - if(att<3&&att>=0&&player!=target) return 0; - var tri=_status.event.getTrigger(); - if(mode=='identity'&&player.identity=='fan'&&target.identity=='fan'){ - if(tri&&tri.name=='dying'&&tri.source&&tri.source.identity=='fan'&&tri.source!=target){ - var num=game.countPlayer(function(current){ - if(current.identity=='fan'){ - return current.countCards('h','tao'); - } - }); - if(num>1&&player==target) return 2; - return 0; - } - } - if(mode=='identity'&&player.identity=='zhu'&&target.identity=='nei'){ - if(tri&&tri.name=='dying'&&tri.source&&tri.source.identity=='zhong'){ - return 0; - } - } - if(mode=='stone'&&target.isMin()&& - player!=target&&tri&&tri.name=='dying'&&player.side==target.side&& - tri.source!=target.getEnemy()){ - return 0; - } - return 2; - }, - }, - tag:{ - recover:1, - save:1, - }, }, }, "yinyang_skill_draw":{ enable:"phaseUse", usable:1, content:function (){ - player.draw(); - player.removeSkill('yinyang_skill'); - }, + player.draw(); + player.removeSkill('yinyang_skill'); + }, ai:{ order:function (item,player){ - if(player.countCards('h')player.getHandcardLimit()) return 0; - return 1; - }, + if(player.countCards('h')>player.getHandcardLimit()) return 0; + return 1; + }, }, }, }, @@ -3542,19 +3340,19 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ player:"phaseDiscardBefore", }, filter:function (event,player){ - return player.needsToDiscard(); - }, + return player.needsToDiscard(); + }, prompt:"是否弃置【阴阳鱼】标记,使本回合的手牌上限+2?", content:function (){ - player.addTempSkill('yinyang_add','phaseAfter'); - player.removeSkill('yinyang_skill'); - }, + player.addTempSkill('yinyang_add','phaseAfter'); + player.removeSkill('yinyang_skill'); + }, }, "yinyang_add":{ mod:{ maxHandcard:function (player,num){ - return num+2; - }, + return num+2; + }, }, }, /*----分界线----*/ @@ -6427,28 +6225,28 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(_status.connectMode){ if(!lib.configOL.junzhu) return false; } - else if(!get.config('junzhu')) return false;; + else if(!get.config('junzhu')) return false;; return true; }, content:function(){ 'step 0' player.storage._mingzhi3=true; var name=player.name1; - if(!player.isUnseen(0)||name.indexOf('gz_')!=0||!lib.junList.contains(name.slice(3))) event.finish(); + if(!player.isUnseen(0)||name.indexOf('gz_')!=0||!lib.junList.contains(name.slice(3))||!lib.character['gz_jun'+name.slice(3)]) event.finish(); else{ player.chooseBool("是否将主武将牌替换为君主武将?").ai=function(){return true}; } 'step 1' if(result.bool){ - var from=player.name1; - var to='gz_jun_'+player.name1.slice(3); - event.maxHp=player.maxHp; - player.reinit(from,to,4); - player.showCharacter(0); - } - else event.finish(); - 'step 2' - if(player.maxHp>event.maxHp) player.recover(player.maxHp-event.maxHp); + var from=player.name1; + var to='gz_jun_'+player.name1.slice(3); + event.maxHp=player.maxHp; + player.reinit(from,to,4); + player.showCharacter(0); + } + else event.finish(); + 'step 2' + if(player.maxHp>event.maxHp) player.recover(player.maxHp-event.maxHp); } }, _zhenfazhaohuan:{