1,
+ backup:function (links,player){
+ return {
+ viewAs:{name:(get.color(links[0])==get.color(links[1]))?'shan':'wuxie'},
+ cards:links,
+ selectCard:-1,
+ position:'x',
+ filterCard:(card)=>lib.skill['dddzhijie_backup'].cards.contains(card),
+ popname:true,
+ precontent:function(){
+ player.addTempSkill('dddzhijie_draw');
+ },
+ }
+ },
+ },
+ ai:{
+ combo:"ddddongcha",
+ respondShan:true,
+ skillTagFilter:function (player){
+ return lib.skill['dddzhijie'].hiddenCard(player,'shan');
+ },
+ order:10,
+ result:{player:1},
+ },
+ subSkill:{
+ draw:{
+ trigger:{
+ player:"useCardAfter",
+ },
+ forced:true,
+ charlotte:true,
+ popup:false,
+ filter:function (event,player){
+ return event.skill=='dddzhijie_backup';
+ },
+ content:function (){
+ player.draw(2);
+ },
+ sub:true,
+ },
+ },
+ },
+ dddqiahua:{
+ trigger:{
+ global:"phaseBegin",
+ },
+ direct:true,
+ filter:function (event,player){
+ return player!=event.player&&event.player.hp>0&&player.countCards('h',function(card){
+ return !card.hasGaintag('dddxujing_tag');
+ })>=event.player.hp;
+ },
+ content:function (){
+ 'step 0'
+ var target=trigger.player;
+ player.chooseCard('h',target.hp,get.prompt('dddqiahua',target),'选择'+get.cnNumber(target.hp)+'张手牌作为“明”,然后'+get.translation(target)+'获得技能〖恂恂〗直到本回合结束。',function(card){
+ return !card.hasGaintag('dddxujing_tag');
+ }).set('goon',get.attitude(player,target)>0).set('ai',function(card){
+ if(_status.event.goon) return 1+Math.random();
+ return 0;
+ });
+ 'step 1'
+ if(result.bool){
+ var target=trigger.player,cards=result.cards;
+ player.logSkill('dddqiahua',target);
+ target.addTempSkill('dddxunxun');
+ player.addSkill('dddxujing_tag');
+ player.addGaintag(result.cards,'dddxujing_tag');
+ game.log(player,'选择了',cards,'作为“明”');
+ player.showCards(cards,get.translation(player)+'对'+get.translation(target)+'发动了【恰化】');
+ player.markSkill('dddxujing_tag');
+ }
+ },
+ ai:{
+ expose:0.15,
+ },
+ derivation:"dddxunxun",
+ },
+ dddxunxun:{
+ inherit:"xunxun",
+ audio:"ext:3D8测试包:2",
+ },
+ dddfusi:{
+ mod:{
+ ignoredHandcard:function (card,player){
+ if(card.hasGaintag('dddxujing_tag')) return true;
+ },
+ cardDiscardable:function (card,player,name){
+ if(name=='phaseDiscard'&&card.hasGaintag('dddxujing_tag')) return false;
+ },
+ },
+ global:"dddfusi_global",
+ subSkill:{
+ refused:{
+ charlotte:true,
+ sub:true,
+ },
+ allowed:{
+ charlotte:true,
+ sub:true,
+ },
+ },
+ },
+ dddfusi_global:{
+ mod:{
+ "cardEnabled2":function (card,player){
+ var source=_status.currentPhase;
+ if(!source||source==player||!source.hasSkill('dddfusi')||source.countCards('h')==0||source.hasCard('h',function(card){
+ return !card.hasGaintag('dddxujing_tag');
+ })) return;
+ if(player.getCards('h').contains(card)) return false;
+ },
+ },
+ enable:"chooseToUse",
+ filter:function (event,player){
+ if(event._dddfusi_refused||player.hasSkill('dddfusi_refused')) return false;
+ var players=game.filterPlayer(function(current){
+ return current!=player&¤t.hasSkill('dddfusi');
+ });
+ for(var source of players){
+ var cards=source.getCards('h',function(card){
+ return card.hasGaintag('dddxujing_tag');
+ });
+ for(var i of cards){
+ var card=get.autoViewAs(i);
+ if(event.filterCard(card,player,event)) return true;
+ }
+ }
+ return false;
+ },
+ hiddenCard:function (player,name){
+ if(player.hasSkill('dddfusi_refused')) return false;
+ var players=game.filterPlayer(function(current){
+ return current!=player&¤t.hasSkill('dddfusi');
+ });
+ for(var source of players){
+ var cards=source.getCards('h',function(card){
+ return card.hasGaintag('dddxujing_tag');
+ });
+ for(var i of cards){
+ var card=get.autoViewAs(i);
+ if(name==card.name) return true;
+ }
+ }
+ return false;
+ },
+ chooseButton:{
+ dialog:function (event,player){
+ var dialog=ui.create.dialog('腹笥','hidden');
+ var players=game.filterPlayer(function(current){
+ return current!=player&¤t.hasSkill('dddfusi');
+ }).sortBySeat();
+ for(var source of players){
+ var cards=source.getCards('h',function(card){
+ return card.hasGaintag('dddxujing_tag');
+ });
+ if(cards.length){
+ var str='';
+ str+=get.translation(source);
+ var num=source.getSeatNum();
+ if(num>0) str+=('('+get.cnNumber(num,true)+'号位)');
+ str+='
';
+ dialog.add(str);
+ dialog.add(cards);
+ }
+ }
+ return dialog;
+ },
+ filter:function (button,player){
+ var card=get.autoViewAs(button.link),evt=_status.event.getParent();
+ return evt.filterCard(card,player,evt);
+ },
+ check:function (button){
+ if(_status.event.getParent().type!='phase') return 1;
+ return _status.event.player.getUseValue(get.autoViewAs(button.link),null,true);
+ },
+ backup:function (links,player){
+ return {
+ card:links[0],
+ viewAs:get.autoViewAs(links[0]),
+ filterCard:()=>false,
+ selectCard:-1,
+ precontent:function(){
+ 'step 0'
+ var card=lib.skill['dddfusi_global_backup'].card;
+ event.card=card;
+ event.result.cards=[card];
+ event.source=get.owner(card);
+ if(!event.result.card.storage) event.result.card.storage={};
+ event.result.card.storage._dddfusi_owner=event.source;
+ delete event.result.skill;
+ player.logSkill('dddfusi_global',event.source);
+ if(player.hasSkill('dddfusi_allowed')) event.finish();
+ 'step 1'
+ if(event.result.targets&&event.result.targets.length) player.line(event.result.targets,event.result.card.nature);
+ player.showCards([card],get.translation(player)+'向'+get.translation(source)+'发动【腹笥】');
+ source.chooseButton([
+ '是否同意'+get.translation(player)+'使用'+get.translation(card)+'?',
+ ''+function(){
+ if(event.result.targets&&event.result.targets.length) return '(目标角色:'+get.translation(event.result.targets)+')';
+ return '(无目标角色)';
+ }()+'
',
+ [[' 同意 ',' 不同意 '],'tdnodes'],
+ [[' 同意且本回合内不再提示 '],'tdnodes'],
+ [[' 不同意且本回合内不再提示 '],'tdnodes'],
+ 'forcebutton',
+ ],true).set('forceAuto',true);
+ 'step 2'
+ if(result.links[0].indexOf('不同意')==-1){
+ source.chat('同意');
+ if(result.links[0].indexOf('本回合内不再提示')>0) player.addTempSkill('dddfusi_allowed');
+ }
+ else if(result.links[0].indexOf('不同意')!=-1){
+ source.chat('不同意');
+ if(result.links[0].indexOf('本回合内不再提示')>0) player.addTempSkill('dddfusi_refused');
+ else if(event.result.card.name=='wuxie') player.addTempSkill('dddfusi_refused','_wuxieAfter');
+ var evt=event.getParent();
+ evt.set('_dddfusi_refused',true);
+ evt.goto(0);
+ }
+ },
+ }
+ },
+ prompt:function (links,player){
+ return '请选择'+get.translation(links[0])+'的目标';
+ },
+ },
+ ai:{
+ order:10,
+ result:{
+ player:function (player,target){
+ if(!game.hasPlayer(function(current){
+ return current!=player&¤t.hasSkill('dddfusi')&&get.attitude(player,current)>=0;
+ })) return 0;
+ if(_status.event.dying) return get.attitude(player,_status.event.dying);
+ return 1;
+ },
+ },
+ respondSha:true,
+ respondShan:true,
+ skillTagFilter:function (player,tag,arg){
+ var name;
+ switch(tag){
+ case 'respondSha':name='sha';break;
+ case 'respondShan':name='shan';break;
+ }
+ return lib.skill['dddfusi_global'].hiddenCard(player,name);
+ },
+ },
+ },
+ dddtuoji:{
+ trigger:{global:'useCardAfter'},
+ frequent:true,
+ filter:function(event,player){
+ return event.card.storage&&event.card.storage._3dfusi_owner==player&&!player.hasCard(function(card){
+ return !card.hasGaintag('dddxujing_tag');
+ },'h');
+ },
+ content:function(){
+ player.draw(3);
+ },
+ },
+ dddchashi:{
+ trigger:{global:'phaseUseBegin'},
+ direct:true,
+ filter:function(event,player){
+ return player!=event.player&&player.countCards('he')>0;
+ },
+ content:function(){
+ 'step 0'
+ var target=trigger.player,history=target.getHistory('useCard',function(evt){
+ return evt.getParent('phaseUse')==trigger;
+ });
+ event.target=target;
+ if(history.length>0){
+ var suit=get.suit(history[0].card);
+ event.suit=suit;
+ player.chooseCard('he',get.prompt('dddchashi',target),'你可以展示一张牌。若此牌花色为'+get.translation(suit)+',则'+get.translation(target)+'获得你展示的牌,然后你摸一张牌。').set('goon',get.sgn(get.attitude(player,target))).set('ai',function(card){
+ if(_status.event.goon<=0) return _status.event.goon*(get.value(card)+0.01);
+ return 2/Math.max(0.1,get.value(card))
+ });
+ }
+ else event.goto(2);
+ 'step 1'
+ if(result.bool){
+ player.logSkill('dddchashi',target);
+ var card=result.cards[0];
+ player.showCards(card,get.translation(player)+'对'+get.translation(target)+'发动了【察势】');
+ if(get.color(card)==event.suit){
+ target.gain(card,player,'give');
+ player.draw();
+ }
+ }
+ event.finish();
+ 'step 2'
+ player.chooseCard('he',get.prompt('dddchashi',target),'你可以展示一张牌。若其本阶段内使用的第一张牌与此牌花色相同,则'+get.translation(target)+'获得你展示的牌,然后你摸一张牌。').set('goon',get.sgn(get.attitude(player,target))).set('ai',function(card){
+ if(_status.event.goon<=0) return _status.event.goon*(get.value(card)+0.01);
+ return 2/Math.max(0.1,get.value(card))
+ });
+ 'step 3'
+ if(result.bool){
+ player.logSkill('dddchashi',target);
+ var card=result.cards[0];
+ player.showCards(card,get.translation(player)+'对'+get.translation(target)+'发动了【察势】');
+ player.addTempSkill('dddchashi_effect','phaseUseAfter');
+ player.addGaintag([card],'dddchashi');
+ player.storage['dddchashi']=[card,target];
+ target.addTempSkill('dddchashi_ai',{player:['phaseUseAfter','useCard1']});
+ }
+ },
+ subSkill:{
+ effect:{
+ trigger:{global:'useCard'},
+ forced:true,
+ charlotte:true,
+ filter:function(event,player){
+ var storage=player.getStorage('dddchashi');
+ if(!storage||!storage.length) return false;
+ if(event.player!=storage[1]||!event.player.isIn()) return false;
+ if(!player.getCards('h').contains(storage[0])||!storage[0].hasGaintag('dddchashi')) return false;
+ if(get.suit(event.card)!=get.suit(storage[0])) return false;
+ var evt=event.getParent('phaseUse');
+ if(evt.player)
+ if(event.player.getHistory('useCard',function(evtx){
+ return evtx.getParent('phaseUse')==evt;
+ }).indexOf(event)!=0) return false;
+ return true;
+ },
+ content:function(){
+ var storage=player.getStorage('dddchashi');
+ storage[1].gain(storage[0],player,'give');
+ player.draw();
+ },
+ onremove:function(player,storage){
+ delete player.storage['dddchashi'];
+ player.removeGaintag('dddchashi');
+ },
+ },
+ ai:{
+ charlotte:true,
+ },
+ },
+ },
+ dddqice:{
+ trigger:{player:'phaseZhunbeiBegin'},
+ content:function(){
+ player.draw(2);
+ player.addTempSkill('dddqice_effect');
+ },
+ subSkill:{
+ effect:{
+ trigger:{player:'phaseJieshuBegin'},
+ forced:true,
+ charlotte:true,
+ content:function(){
+ 'step 0'
+ var list=[];
+ player.getHistory('useCard',function(evt){
+ if(get.type(evt.card)=='trick') list.add(evt.card.name);
+ });
+ list.sort();
+ if(list.length>0){
+ player.chooseButton(['齐策:是否视为使用一张牌?',[list,'vcard']],function(button){
+ return _status.event.player.hasUseTarget({name:button.link[2],isCard:true});
+ }).set('ai',function(button){
+ var card={
+ name:button.link[2],
+ nature:button.link[3],
+ isCard:true,
+ },player=_status.event.player;
+ return player.getUseValue(card);
+ });
+ }
+ else{
+ game.log(player,'失去了技能','#g【齐策】');
+ player.removeSkill('dddqice');
+ event.finish();
+ }
+ 'step 1'
+ if(result.bool){
+ player.chooseUseTarget(true,{
+ name:result.links[0][2],
+ isCard:true,
+ });
+ }
+ },
+ },
+ },
+ },
+ //甄姬
+ dddmiaoxing:{
+ audio:2,
+ trigger:{global:'gameDrawBegin'},
+ forced:true,
+ content:function(){
+ var me=player;
+ var numx=trigger.num;
+ trigger.num=typeof numx=='function'?function(player){
+ if(player==me){
+ return 3*numx(player);
+ }
+ return numx(player);
+ }:function(player){
+ if(player==me){
+ return 3*numx;
+ }
+ return numx;
+ }
+ player._dddmiaoxing=true;
+ },
+ group:['dddmiaoxing_out','dddmiaoxing_balance'],
+ marktext:'水',
+ intro:{
+ name:'水相',
+ markcount:function(storage,player){
+ return ''+player.getExpansions('dddmiaoxing_1').length+'/'+player.getExpansions('dddmiaoxing_2').length;
+ },
+ mark:function(dialog,content,player){
+ var content1=player.getExpansions('dddmiaoxing_1');
+ var content2=player.getExpansions('dddmiaoxing_2');
+ if(content1&&content1.length||content2&&content2.length){
+ if(player==game.me||player.isUnderControl()){
+ dialog.addText('第一组');
+ dialog.addAuto(content1);
+ dialog.addText('第二组');
+ dialog.addAuto(content2);
+ }
+ else{
+ return '第一组“水相”有'+get.cnNumber(content1.length)+'张;'+'第二组“水相”有'+get.cnNumber(content2.length)+'张';
+ }
+ }
+ }
+ },
+ subSkill:{
+ out:{
+ trigger:{
+ global:'phaseBefore',
+ },
+ forced:true,
+ filter:function(event,player){
+ return game.phaseNumber==0&&player._dddmiaoxing;
+ },
+ content:function(){
+ 'step 0'
+ delete player._dddmiaoxing;
+ var cardsx=player.getCards('h'),num=Math.ceil(cardsx.length/3);
+ var cards=[cardsx.slice(0,num),cardsx.slice(num,2*num),cardsx.slice(2*num)];
+ event.cards=cards;
+ player.chooseControl('第一组','第二组','第三组').set('dialog',[
+ '淼形:选择一组作为你的手牌',
+ '第一组',
+ cards[0],
+ '第二组',
+ cards[1],
+ '第三组',
+ cards[2]
+ ]);
+ 'step 1'
+ event.cards.splice(result.index,1);
+ var cards=event.cards;
+ player.addToExpansion(cards[0],player,'giveAuto',false).gaintag.add('dddmiaoxing_1');
+ player.addToExpansion(cards[1],player,'giveAuto').gaintag.add('dddmiaoxing_2');
+ player.markSkill('dddmiaoxing');
+ }
+ },
+ balance:{
+ trigger:{player:'phaseDrawAfter'},
+ forced:true,
+ content:function(){
+ 'step 0'
+ var forced=player.getExpansions('dddmiaoxing_1').length!=player.countCards('h')&&
+ player.getExpansions('dddmiaoxing_2').length!=player.countCards('h');
+ var next=player.chooseButton([1,2],[
+ '淼形:将至少一组“水相”调整至与手牌数相等',
+ [['第一组','第二组'],'tdnodes'],
+ '第一组',
+ player.getExpansions('dddmiaoxing_1'),
+ '第二组',
+ player.getExpansions('dddmiaoxing_2'),
+ ],forced);
+ next.set('filterButton',button=>{
+ var type=typeof button.link;
+ return type!='object';
+ })
+ next.set('ai',button=>{
+ var player=_status.event.player;
+ var ind=['第一组','第二组'].indexOf(button.link)+1;
+ if(ind==-1) return -100;
+ return player.countCards('h')-player.getExpansions('dddmiaoxing_'+ind).length;
+ })
+ 'step 1'
+ if(result.bool){
+ var choices=result.links;
+ event.choices=choices;
+ // var hs=result.moved[0],sx1=result.moved[1],sx2=result.moved[2];
+ // hs.removeArray(player.getCards('h'));
+ // sx1.removeArray(player.getExpansions('dddmiaoxing_1'));
+ // sx2.removeArray(player.getExpansions('dddmiaoxing_2'));
+ // if(!hs.length&&!sx1.length&&!sx2.length) return;
+ // player.gain(hs,'gain2');
+ // player.addToExpansion(sx1,player,'giveAuto').gaintag.add('dddmiaoxing_1');
+ // player.addToExpansion(sx2,player,'giveAuto').gaintag.add('dddmiaoxing_2');
+ }
+ else event.finish();
+ 'step 2'
+ if(event.choices.contains('第一组')){
+ var del=player.countCards('h')-player.getExpansions('dddmiaoxing_1').length;
+ if(del>=0){
+ if(del!=0) player.addToExpansion(get.cards(del),player,'draw').gaintag.add('dddmiaoxing_1');
+ event.goto(4);
+ }
+ else{
+ player.chooseButton(['淼形:移除'+get.cnNumber(-del)+'张第一组的“水相”',player.getExpansions('dddmiaoxing_1')],-del,true).set('ai',button=>{
+ return -get.buttonValue(button);
+ });
+ }
+ }
+ 'step 3'
+ if(result.bool){
+ player.loseToDiscardpile(result.links);
+ }
+ 'step 4'
+ player.markSkill('dddmiaoxing');
+ if(event.choices.contains('第二组')){
+ var del=player.countCards('h')-player.getExpansions('dddmiaoxing_2').length;
+ if(del>=0){
+ if(del!=0) player.addToExpansion(get.cards(del),player,'draw').gaintag.add('dddmiaoxing_2');
+ event.goto(6);
+ }
+ else{
+ player.chooseButton(['淼形:移除'+get.cnNumber(-del)+'张第二组的“水相”',player.getExpansions('dddmiaoxing_2')],-del,true).set('ai',button=>{
+ return -get.buttonValue(button);
+ });
+ }
+ }
+ 'step 5'
+ if(result.bool){
+ player.loseToDiscardpile(result.links);
+ }
+ 'step 6'
+ player.markSkill('dddmiaoxing');
+ }
+ }
+ }
+ },
+ dddfushi:{
+ audio:2,
+ trigger:{player:['useCardAfter','respondAfter']},
+ filter:function(event,player){
+ return get.type(event.card)=='basic'&&!player.hasSkill('dddfushi_used');
+ },
+ direct:true,
+ content:function(){
+ 'step 0'
+ player.chooseControl('第一组','第二组','cancel2').set('dialog',[
+ get.prompt('dddfushi'),
+ '用所有手牌交换一组“水相”',
+ '第一组',
+ player.getExpansions('dddmiaoxing_1'),
+ '第二组',
+ player.getExpansions('dddmiaoxing_2'),
+ ]).set('ai',()=>{
+ return _status.event.choice;
+ }).set('choice',function(){
+ var fn=player==_status.currentPhase?'useful':'value';
+ var list=[
+ [1,player.getExpansions('dddmiaoxing_1').reduce((p,c)=>p+get[fn](c),0)],
+ [2,player.getExpansions('dddmiaoxing_2').reduce((p,c)=>p+get[fn](c),0)],
+ [3,player.getCards('h').reduce((p,c)=>p+get[fn](c),0)],
+ ].sort((a,b)=>b[1]-a[1]);
+ return list[0][0]-1;
+ }());
+ 'step 1'
+ if(result.control=='cancel2') event.finish();
+ else{
+ player.logSkill('dddfushi');
+ player.addTempSkill('dddfushi_used');
+ var index=result.index+1;
+ player.addToExpansion(player.getCards('h'),player,'giveAuto').gaintag.add('dddmiaoxing_'+index);
+ player.gain(player.getExpansions('dddmiaoxing_'+index),'draw');
+ game.log(player,'获得了'+get.cnNumber(player.getExpansions('dddmiaoxing_'+index).length)+'张“水相”');
+ }
+ 'step 2'
+ player.markSkill('dddmiaoxing');
+ player.chooseTarget('是否令一名男性角色选择是否交换“水相”?',(card,player,target)=>{
+ return target.hasSex('male');
+ }).set('ai',target=>get.attitude(_status.event.player,target));
+ 'step 3'
+ if(result.bool){
+ var target=result.targets[0];
+ event.target=target;
+ player.line(target);
+ target.chooseControl('第一组','第二组','cancel2').set('dialog',[
+ '浮世:是否用所有手牌交换一组“水相”?',
+ '第一组',
+ player.getExpansions('dddmiaoxing_1'),
+ '第二组',
+ player.getExpansions('dddmiaoxing_2'),
+ ]).set('ai',()=>{
+ return _status.event.choice;
+ }).set('choice',function(){
+ var fn=target==_status.currentPhase?'useful':'value';
+ var list=[
+ [1,player.getExpansions('dddmiaoxing_1').reduce((p,c)=>p+get[fn](c),0)],
+ [2,player.getExpansions('dddmiaoxing_2').reduce((p,c)=>p+get[fn](c),0)],
+ [3,target.getCards('h').reduce((p,c)=>p+get[fn](c),0)],
+ ].sort((a,b)=>b[1]-a[1]);
+ return list[0]-1;
+ }());
+ }
+ else event.finish();
+ 'step 4'
+ if(result.control=='cancel2') event.finish();
+ else{
+ var index=result.index+1;
+ player.addToExpansion(target.getCards('h'),target,'giveAuto').gaintag.add('dddmiaoxing_'+index);
+ target.gain(player.getExpansions('dddmiaoxing_'+index),player,'giveAuto');
+ }
+ 'step 5'
+ player.markSkill('dddmiaoxing');
+ },
+ subSkill:{
+ used:{charlotte:true}
+ }
+ },
+ //赵昂
+ dddfenji:{
+ audio:2,
+ trigger:{player:['phaseDrawBegin1','phaseDiscardBegin']},
+ direct:true,
+ filter:function(event,player){
+ if(event.name=='phaseDraw'&&event.numFixed) return false;
+ return lib.inpile.filter(i=>get.type(i)=='trick').removeArray(player.getStorage('dddfenji')).length;
+ },
+ content:function(){
+ 'step 0'
+ var cards=lib.inpile.filter(i=>{
+ return get.type(i)=='trick'&&!player.getStorage('dddfenji').contains(i);
+ }).map(i=>['锦囊','',i]);
+ player.chooseButton([get.prompt('dddfenji'),[cards,'vcard']]).set('ai',button=>{
+ var evt=_status.event.getTrigger();
+ if(evt.name=='phaseDraw'){
+ if(!get.tag({name:button.link[2]},'damage')) return 0;
+ }
+ else{
+ if(lib.skill.xunshi.isXunshi({name:button.link[2]})) return 0;
+ }
+ return _status.event.player.getUseValue({name:button.link[2]});
+ }).set('filterButton',button=>{
+ return player.hasUseTarget(button.link[2]);
+ });
+ 'step 1'
+ if(result.bool){
+ player.logSkill('dddfenji');
+ player.markAuto('dddfenji',[result.links[0][2]]);
+ player.chooseUseTarget(result.links[0][2],true);
+ }
+ else event.finish();
+ 'step 2'
+ if(trigger.name=='phaseDraw'){
+ trigger.changeToZero();
+ var num=0;
+ game.filterPlayer(current=>{
+ current.getHistory('sourceDamage',evt=>{
+ if(evt.getParent(4)==event) num+=evt.num;
+ });
+ })
+ if(num>0) player.draw(num);
+ }
+ else{
+ trigger.cancel();
+ var num=0;
+ player.getHistory('useCard',evt=>{
+ if(evt.getParent(2)==event) num=evt.targets.length;
+ });
+ if(num>0&&player.countCards('he')) player.chooseToDiscard(num,true);
+ }
+ }
+ },
+ //周处
+ dddxiaheng:{
+ audio:2,
+ trigger:{player:'phaseUseBegin'},
+ forced:true,
+ onremove:['dddxiaheng','dddxiaheng_del'],
+ intro:{content:'已因此技能对$造成过伤害'},
+ content:function(){
+ 'step 0'
+ event.targets=[];
+ player.chooseTarget('侠横:令一名角色弃置两张牌',true).set('ai',target=>{
+ var player=_status.event.player,eff=get.effect(target,{name:'guohe_copy2'},player,player),eff2=get.damageEffect(target,player,player);
+ if(player.storage['dddxiaheng_del']) return eff;
+ var toself=false;
+ if(eff2>eff*2){
+ toself=!player.isDamaged()&&player.countCards('he',card=>get.value(card,player)<5)>=2;
+ }
+ if(toself) return target==player?100:0;
+ return eff*(eff2>eff*2?0.5:1.5);
+ });
+ 'step 1'
+ if(result.bool){
+ var target=result.targets[0];
+ event.targets.add(target);
+ player.line(target);
+ target.chooseToDiscard(2,true,'he');
+ }
+ 'step 2'
+ player.chooseTarget('侠横:对一名角色造成1点伤害',true).set('ai',target=>{
+ var player=_status.event.player,eff=get.damageEffect(target,player,player),targetx=_status.event.targetx;
+ if(player.storage['dddxiaheng_del']) return eff;
+ var fix=player.getStorage('dddxiaheng').contains(target)?0.75:1;
+ if(target==player&&targetx!=player&&player.isHealthy()&&!player.getStorage('dddxiaheng').contains(player)&&player.hp>2) return 100;
+ return eff*(player.hp==1&&target==targetx?0.5:1)*fix;
+ }).set('targetx',targets[0]);
+ 'step 3'
+ if(result.bool){
+ var target=result.targets[0];
+ event.targets.add(target);
+ player.line(target);
+ target.damage();
+ player.markAuto('dddxiaheng',[target]);
+ }
+ 'step 4'
+ if(player.storage['dddxiaheng_del']) event.finish();
+ else{
+ if(!targets.contains(player)) player.loseMaxHp();
+ if(targets.length==1) player.loseHp();
+ }
+ 'step 5'
+ if(player.getStorage('dddxiaheng').length>=3){
+ player.storage['dddxiaheng_del']=true;
+ }
+ }
+ },
+ //刘巴
+ dddfengzheng:{
+ audio:2,
+ global:'dddfengzheng_global',
+ trigger:{
+ global:'roundStart',
+ },
+ filter:function(event,player){
+ return game.hasPlayer(current=>{
+ var history=current.actionHistory;
+ for(var i=history.length-2;i>=0;i--){
+ var evts=history[i].useSkill;
+ for(evt of evts){
+ if(evt.skill=='dddfengzheng_global') return true;
+ }
+ if(history[i].isRound) break;
+ }
+ return false;
+ });
+ },
+ prompt2:function(event,player){
+ var num=game.countPlayer(current=>{
+ var history=current.actionHistory;
+ for(var i=history.length-2;i>=0;i--){
+ var evts=history[i].useSkill;
+ for(evt of evts){
+ if(evt.skill=='dddfengzheng_global') return true;
+ }
+ if(history[i].isRound) break;
+ }
+ return false;
+ });
+ return '观看并分配牌堆顶的'+get.cnNumber(num)+'张牌';
+ },
+ content:function(){
+ 'step 0'
+ var num=game.countPlayer(current=>{
+ var history=current.actionHistory;
+ for(var i=history.length-2;i>=0;i--){
+ var evts=history[i].useSkill;
+ for(evt of evts){
+ if(evt.skill=='dddfengzheng_global') return true;
+ }
+ if(history[i].isRound) break;
+ }
+ return false;
+ });
+ var cards=game.cardsGotoOrdering(get.cards(num)).cards;
+ event.cards=cards;
+ if(_status.connectMode) game.broadcastAll(function(){_status.noclearcountdown=true});
+ event.given_map={};
+ '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){
+ event.cards.removeArray(result.links);
+ event.togive=result.links.slice(0);
+ player.chooseTarget('选择一名角色获得'+get.translation(result.links),true).set('ai',function(target){
+ var fix=(_status.event.getParent().given_map[target.playerid]||0)+1;
+ var att=get.attitude(_status.event.player,target)/Math.sqrt(fix);
+ if(_status.event.enemy) return -att;
+ else if(att>0) return att/(1+target.countCards('h'));
+ else return att/100;
+ }).set('enemy',get.value(event.togive[0],player,'raw')<0);
+ }
+ 'step 3'
+ if(result.targets.length){
+ var id=result.targets[0].playerid,map=event.given_map;
+ if(!map[id]) map[id]=[];
+ map[id].addArray(event.togive);
+ }
+ if(cards.length>0) event.goto(1);
+ 'step 4'
+ if(_status.connectMode){
+ game.broadcastAll(function(){delete _status.noclearcountdown;game.stopCountChoose()});
+ }
+ var list=[],lose=false;
+ for(var i in event.given_map){
+ var source=(_status.connectMode?lib.playerOL:game.playerMap)[i];
+ player.line(source,'green');
+ list.push([source,event.given_map[i]]);
+ if(event.given_map[i].length>2) lose=true;
+ }
+ game.loseAsync({
+ gain_list:list,
+ giver:player,
+ animate:'draw',
+ }).setContent('gaincardMultiple');
+ if(!lose) event.finish();
+ 'step 5'
+ player.removeSkill('dddfengzheng');
+ game.log(player,'失去了技能','#g【丰政】');
+ },
+ subSkill:{
+ global:{
+ audio:'dddfengzheng',
+ enable:'phaseUse',
+ usable:1,
+ filterCard:function(card,player){
+ var num=0;
+ for(var i=0;iget.strNumber(i+1))).set('prompt','玉律:声明一个点数').set('ai',()=>_status.event.controls.randomGet());
+ 'step 1'
+ player.popup(result.control);
+ var number=result.index+1;
+ player.storage['dddyulv']=number;
+ player.markSkill('dddyulv');
+ },
+ intro:{
+ content:'声明的点数为#',
+ },
+ subSkill:{
+ enter:{
+ trigger:{global:['loseAfter','cardsDiscardAfter','loseAsyncAfter','equipAfter']},
+ forced:true,
+ direct:true,
+ filter:function(event,player){
+ var cards=event.getd();
+ if(!cards.length||!player.storage['dddyulv']) return false;
+ if(!_status.currentPhase||!_status.currentPhase.isIn()) return false;
+ return cards.some(i=>get.number(i,false)==player.storage['dddyulv']);
+ },
+ content:function(){
+ 'step 0'
+ player.chooseControl('摸牌','弃牌').set('prompt','玉律:令'+get.translation(_status.currentPhase)+'摸一张牌或弃置一张牌').set('ai',()=>{
+ return get.attitude(_status.event.player,_status.currentPhase)>0?'摸牌':'弃牌';
+ });
+ 'step 1'
+ player.logSkill('dddyulv_enter',_status.currentPhase);
+ var reset=false;
+ if(result.index==0) _status.currentPhase.draw();
+ else _status.currentPhase.chooseToDiscard(true,'he');
+ if(_status.currentPhase.hasSkill('dddyulv_'+result.index)) reset=true;
+ _status.currentPhase.removeSkill('dddyulv_0');
+ _status.currentPhase.removeSkill('dddyulv_1');
+ _status.currentPhase.addSkill('dddyulv_'+result.index);
+ if(!reset) event.finish();
+ 'step 2'
+ player.chooseControl(Array.from({length:13},(_,i)=>get.strNumber(i+1))).set('prompt','玉律:重新声明一个点数').set('ai',()=>_status.event.controls.randomGet());
+ 'step 3'
+ player.popup(result.control);
+ var number=result.index+1;
+ player.storage['dddyulv']=number;
+ player.markSkill('dddyulv');
+ 'step 4'
+ var evt=trigger.getParent('phaseUse');
+ if(evt&&evt.name=='phaseUse'){
+ evt.skipped=true;
+ }
+ var evt=trigger.getParent('phase');
+ if(evt&&evt.name=='phase'){
+ game.log(evt.player,'结束了回合');
+ evt.finish();
+ evt.untrigger(true);
+ }
+ }
+ },
+ 0:{charlotte:true},
+ 1:{charlotte:true},
+ }
+ },
+ //蹇硕
+ dddfenye:{
+ audio:2,
+ enable:'phaseUse',
+ usable:1,
+ filterTarget:function(card,player,target){
+ return player.canCompare(target);
+ },
+ filter:function(event,player){
+ return player.countCards('h')>0;
+ },
+ content:function(){
+ 'step 0'
+ player.chooseToCompare([target]).setContent(lib.skill['dddfenye'].chooseToCompareFenye);
+ 'step 1'
+ result.winner.forEach(i=>i.addExpose(0.05));
+ result.loser.forEach(i=>i.addExpose(0.05));
+ if(result.winner.length&&result.loser.length){
+ var players=result.winner;
+ event.players=players.sortBySeat();
+ event.targets=result.loser;
+ }
+ else event.finish();
+ 'step 2'
+ var current=event.players.shift();
+ event.current=current;
+ current.chooseTarget('是否视为对一名没赢的角色使用一张【杀】?',(card,player,target)=>{
+ return player.canUse('sha',target,false)&&_status.event.targets.contains(target);
+ }).set('ai',target=>{
+ return get.effect(target,{name:'sha'},_status.event.player);
+ }).set('targets',event.targets);
+ 'step 3'
+ if(result.bool){
+ if(!event.isMine()&&!event.isOnline()) game.delayx();
+ var target=result.targets[0];
+ event.current.useCard({name:'sha',isCard:true},target,false);
+ event.targets.remove(target);
+ }
+ if(event.targets.length&&event.players.length) event.goto(2);
+ },
+ chooseToCompareFenye:function(){
+ "step 0"
+ var target=event.targets[0];
+ event.targets.unshift(player);
+ event.targetx=target;
+ if(player.countCards('h')==0||target.countCards('h')==0){
+ event.result={cancelled:true,bool:false}
+ event.finish();
+ return;
+ }
+ game.log(player,'对',target,'发起拼点');
+ "step 1"
+ var send=function(targets){
+ var next=game.createEvent('dddfenye_choose',false);
+ // next.player=game.me;
+ next.targets=targets;
+ next.ai=event.ai;
+ next.fixedResult=event.fixedResult;
+ next.setContent(lib.skill['dddfenye'].contentx);
+ game.resume();
+ };
+ var sendback=function(result,player){
+ if(!Array.isArray(result)){
+ result=[null,null];
+ }
+ event.results.push([player,result]);
+ };
+ event.ai_targets=[];
+ event.results=[];
+ var players=game.filterPlayer().sortBySeat();
+ var time=10000;
+ if(lib.configOL&&lib.configOL.choose_timeout) time=parseInt(lib.configOL.choose_timeout)*1000;
+ for(var i=0;i{
+ return event.ai(b)-event.ai(a);
+ });
+ sendback([target,cards[0]],target);
+ event.ai_targets.splice(i--,1);
+ }
+ }
+ if(event.ai_targets.length){
+ event.ai_targets.randomSort();
+ setTimeout(function(){
+ event.interval=setInterval(function(){
+ var target=event.ai_targets.shift();
+ var cards=target.getCards('h',card=>get.value(card)<4).sort((a,b)=>{
+ return event.ai(b)-event.ai(a);
+ });
+ if(!cards.length){
+ sendback([null,null],target);
+ }
+ else{
+ if(Math.abs(get.number(cards[0])-7)<=2){
+ sendback([null,null],target);
+ }
+ else{
+ var sgn=get.number(cards[0])>=7?1:-1;
+ var targetsx=targets.slice().sort((a,b)=>{
+ var attA=get.attitude(target,a),attB=get.attitude(target,b);
+ return sgn*(attB-attA);
+ });
+ sendback([targetsx[0],cards[0]],target);
+ }
+ }
+ if(!event.ai_targets.length){
+ clearInterval(event.interval);
+ if(event.withai) game.resume();
+ }
+ },_status.connectMode?750:75);
+ },500);
+ }
+ }
+ "step 2"
+ if(event.withme){
+ if(_status.connectMode) game.me.unwait(result,game.me);
+ else{
+ if(!Array.isArray(result)){
+ result=[null,null];
+ }
+ event.results.push([game.me,result]);
+ }
+ }
+ "step 3"
+ if(event.withol&&!event.resultOL){
+ game.pause();
+ }
+ "step 4"
+ if(event.ai_targets.length>0){
+ event.withai=true;
+ game.pause();
+ }
+ "step 5"
+ delete event._global_waiting;
+ for(var i of game.players) i.hideTimer();
+ var cards=[];
+ var targets=[];
+ var lose_list=[];
+ event.results.sort((a,b)=>lib.sort.seat(a[0],b[0]));
+ for(var res of event.results){
+ var target=res[0],card=res[1][1],skill=res[1][2];
+ if(!target||!card) continue;
+ if(skill&&lib.skill[skill]&&lib.skill[skill].onCompare){
+ target.logSkill(skill);
+ res[1][1]=lib.skill[skill].onCompare(target);
+ if(target!=player) cards.push(res[1][1]);
+ }
+ else{
+ if(target!=player) cards.push(card);
+ lose_list.push([target,[card]]);
+ }
+ if(target!=player) targets.push(target);
+ }
+ if(lose_list.length){
+ game.loseAsync({
+ lose_list:lose_list,
+ }).setContent('chooseToCompareLose');
+ }
+ event.lose_list=lose_list;
+ event.getNum=function(card){
+ for(var i of event.lose_list){
+ if(i[1].contains&&i[1].contains(card)) return get.number(card,i[0]);
+ }
+ return get.number(card,false);
+ }
+ event.cardlist=cards;
+ event.cards=cards;
+ event.card1=event.results[0][1][1];
+ event.num1=event.getNum(event.card1);
+ event.iwhile=0;
+ event.targets=targets;
+ event.tempplayer=event.player;
+ event.players=event.results.filter(i=>i[1][0]==player&&i[1][1]).map(i=>i[0]);
+ event.targetsx=event.results.filter(i=>i[1][0]==event.targetx&&i[1][1]).map(i=>i[0]);
+ event.result={
+ player:event.card1,
+ targets:event.cardlist.slice(0),
+ num1:[event.num1],
+ num2:[],
+ winner:[],
+ loser:[],
+ };
+ game.log(player,'的拼点牌为',event.card1);
+ "step 6"
+ event.target=null;
+ event.trigger('compare');
+ lib.skill['dddfenye'].$compareFenye(event.players,event.results.filter(i=>i[1][0]==player).map(i=>i[1][1]),event.targetsx,event.results.filter(i=>i[1][0]==event.targetx).map(i=>i[1][1]));
+ "step 7"
+ if(event.iwhilep+c,0)/event.result.num1.length,num2=event.result.num2.reduce((p,c)=>p+c,0)/event.result.num2.length;
+ game.log(event.player,'方的点数均值为','#y'+Math.floor(num1*100)/100);
+ game.log(event.targetx,'方的点数均值为','#y'+Math.floor(num2*100)/100);
+ if(num1>num2){
+ str=get.translation(event.players)+'拼点成功';
+ event.players.forEach(i=>i.popup('胜'));
+ event.targetsx.forEach(i=>i.popup('负'));
+ event.result.winner=event.players;
+ event.result.loser=event.targetsx;
+ }
+ else{
+ str=get.translation(event.players)+'拼点失败';
+ if(num1==num2){
+ event.players.forEach(i=>i.popup('平'));
+ event.targetsx.forEach(i=>i.popup('平'));
+ event.result.loser=event.players.addArray(event.targetsx);
+ }
+ else{
+ event.players.forEach(i=>i.popup('负'));
+ event.targetsx.forEach(i=>i.popup('胜'));
+ event.result.winner=event.targetsx;
+ event.result.loser=event.players;
+ }
+ }
+ game.broadcastAll(function(str){
+ var dialog=ui.create.dialog(str);
+ dialog.classList.add('center');
+ setTimeout(function(){
+ dialog.close();
+ },1000);
+ },str);
+ game.delay(3);
+ "step 10"
+ game.broadcastAll(ui.clear);
+ "step 11"
+ event.cards.add(event.card1);
+ },
+ contentx:function(){
+ 'step 0'
+ var player=game.me;
+ event.player=player;
+ event._global_waiting=true;
+ event.result=[];
+ if(targets.contains(player)){
+ if(event.fixedResult&&event.fixedResult[player.playerid]){
+ event.result[0]=player;
+ event.result[1]=event.fixedResult[player.playerid];
+ event.finish();
+ }
+ else player.chooseCard('请选择拼点牌',true).set('type','compare').set('glow_result',true).set('_global_waiting',true).ai=event.ai;
+ }
+ else{
+ player.chooseCardTarget({
+ targets:targets,
+ filterTarget:function(card,player,target){
+ return _status.event.targets.contains(target);
+ },
+ selectCard:1,
+ prompt:'是否于此次拼点加入其中一方?',
+ position:'h',
+ _global_waiting:true,
+ ai1:event.ai,
+ ai2:function(target){
+ var player=_status.event.player,sgn=-1;
+ if(player.hasCard(card=>get.number(card)>10&&get.value(card)<5)) sgn=1;
+ return sgn*get.attitude(player,target);
+ },
+ });
+ }
+ 'step 1'
+ if(targets.contains(player)){
+ event.result[0]=player;
+ event.result[1]=result.cards[0];
+ event.result[2]=result.skill;
+ }
+ else{
+ if(result.bool){
+ event.result[0]=result.targets[0];
+ event.result[1]=result.cards[0];
+ }
+ else{
+ event.result=[null,null];
+ }
+ }
+ },
+ $compareFenye:function(players,cards1,targets,cards2){
+ game.broadcast(function(players,cards1,targets,cards2){
+ lib.skill['dddfenye'].$compareFenye(players,cards1,targets,cards2);
+ },players,cards1,targets,cards2);
+
+ var left0=-players.length*52-(players.length-1)*8;
+ for(var i=0;i{
+ return _status.event.targets.contains(target);
+ }).set('ai',target=>{
+ var zhu=get.zhu(player)||game.filterPlayer(i=>i.getSeatNum()==1)[0];
+ return Math.min(target.countCards('h')-player.countCards('h'),zhu.maxHp-player.countCards('h'));
+ }).set('targets',function(){
+ var list=game.filterPlayer().map(i=>[i,i.countCards('h')]).sort((a,b)=>b[1]-a[1]);
+ var targets=[];
+ var ind=0,tmp=Infinity;
+ for(var i of list){
+ if(i[1]N) break;
+ }
+ if(!targets.length) targets=game.filterPlayer(i=>i.countCards('h')==list[list.length-1][1]);
+ return targets;
+ }());
+ 'step 1'
+ if(result.bool){
+ var target=result.targets[0];
+ player.logSkill('dddshichao',target);
+ var zhu=get.zhu(player)||game.filterPlayer(i=>i.getSeatNum()==1)[0];
+ var del=Math.min(target.countCards('h')-player.countCards('h'),zhu.maxHp-player.countCards('h'));
+ if(del>0) player.draw(del);
+ if(del<0) player.chooseToDiscard(-del,true);
+ target.addSkill('dddshichao_up');
+ target.markAuto('dddshichao_up',[player]);
+ player.addTempSkill('dddshichao_clear',{player:'phaseBegin'});
+ player.markAuto('dddshichao_clear',[target]);
+ }
+ },
+ subSkill:{
+ up:{
+ trigger:{source:'damageBegin2'},
+ filter:function(event,player){
+ return player.getStorage('dddshichao_up').contains(event.player);
+ },
+ charlotte:true,
+ check:function(event,player){
+ var eff=get.damageEffect(event.player,player,player);
+ return event.player.hasSkill('dddshichao')&&eff<0||event.num==1&&eff<13;
+ },
+ logTarget:'player',
+ content:function(){
+ 'step 0'
+ trigger.cancel();
+ if(trigger.player.hasSkill('dddshichao')){
+ trigger.player.addMark('dddshichao',1,false);
+ }
+ }
+ },
+ clear:{
+ charlotte:true,
+ onremove:function(player){
+ game.filterPlayer(current=>{
+ current.unmarkAuto('dddshichao_up',[player]);
+ });
+ }
+ }
+ }
+ },
+ //管宁
+ dddyouxue:{
+ audio:2,
+ trigger:{global:'roundStart'},
+ forced:true,
+ content:function(){
+ 'step 0'
+ var vpos=player.hasMark('dddyouxue')?game.filterPlayer2(i=>i.getSeatNum()==player.countMark('dddyouxue'))[0]:player;
+ event.vpos=vpos;
+ player.chooseTarget('游学:选择你的行动次序',true).set('ai',target=>{
+ return get.distance(_status.event.vpos,target);
+ }).set('vpos',vpos);
+ 'step 1'
+ if(result.bool){
+ var target=result.targets[0];
+ if(event.vpos==player) player.line(target,'green');
+ else player.line2([event.vpos,target],'green');
+ event.num=get.distance(event.vpos,target);
+ player.storage['dddyouxue']=target.getSeatNum();
+ player.addSkill('dddyouxue_act');
+ player.markSkill('dddyouxue');
+ }
+ else event.finish();
+ 'step 2'
+ var next=player.phaseDraw();
+ next.set('num',num);
+ delete next.skill;
+ 'step 3'
+ player.skip('phaseDraw');
+ },
+ marktext:'虚',
+ intro:{
+ name:'虚位',
+ content:'当前虚位为#号',
+ },
+ subSkill:{
+ act:{
+ trigger:{
+ global:'phaseBefore',
+ },
+ forced:true,
+ firstDo:true,
+ charlotte:true,
+ filter:function(event,player){
+ var seat=event.player.getSeatNum(),seatP=event.player.getPrevious().getSeatNum();
+ return !player.hasSkill('dddyouxue_acted')&&seat>=player.countMark('dddyouxue')&&(seatP>seat||seatP=player.countMark('dddyouxue'))){
+ trigger.finish();
+ trigger.untrigger(true);
+ trigger._triggered=5;
+ event.finish();
+ return;
+ }
+ trigger.player.getPrevious().getHistory('custom').push({'dddyouxue':true});
+ player.insertPhase();
+ player.addTempSkill('dddyouxue_acted','roundStart');
+ if(!trigger._finished){
+ trigger.finish();
+ trigger.untrigger(true);
+ trigger._triggered=5;
+ var evt=trigger.player.insertPhase();
+ delete evt.skill;
+ }
+ }
+ },
+ acted:{charlotte:true}
+ }
+ },
+ dddchengjing:{
+ audio:2,
+ usable:1,
+ enable:'phaseUse',
+ filter:function(event,player){
+ return player.countCards('hes')&&player.countMark('dddyouxue')&&lib.skill['dddchengjing'].getList(player).length;
+ },
+ getList:function(player){
+ var vpos=player.hasMark('dddyouxue')?game.filterPlayer2(i=>i.getSeatNum()==player.countMark('dddyouxue'))[0]:player;
+ if(!vpos||!vpos.isIn()) return [];
+ var vcard=[];
+ var history=vpos.getPrevious().actionHistory.filter(evt=>!evt.custom.some(i=>i['dddyouxue']));
+ debugger
+ history=history[history.length-2];
+ var evts=history.useCard;
+ for(var evt of evts){
+ var card=evt.card;
+ var type=get.type(card);
+ if(type!='basic'&&type!='trick') continue;
+ if(card.name=='sha'){
+ vcard.push(['基本','',card.name,card.nature]);
+ }
+ else vcard.push([type,'',card.name]);
+ }
+ return vcard;
+ },
+ chooseButton:{
+ dialog:function(event,player){
+ var list=lib.skill['dddchengjing'].getList(player);
+ list.sort((a,b)=>{
+ return 100*(lib.inpile.indexOf(a[2])-lib.inpile.indexOf(b[2]))+lib.inpile_nature.indexOf(a[3])-lib.inpile_nature.indexOf(b[3]);
+ });
+ list.filter(vcard=>{
+ return event.filterCard({name:vcard[2],nature:vcard[3]},player,event);
+ })
+ return ui.create.dialog('承经',[list,'vcard']);
+ },
+ filter:function(button,player){
+ return _status.event.getParent().filterCard({name:button.link[2]},player,_status.event.getParent());
+ },
+ check:function(button){
+ if(_status.event.getParent().type!='phase') return 1;
+ var player=_status.event.player;
+ return player.getUseValue({
+ name:button.link[2],
+ nature:button.link[3],
+ });
+ },
+ backup:function(links,player){
+ return {
+ filterCard:true,
+ audio:'dddchengjing',
+ popname:true,
+ check:function(card){
+ return 8-get.value(card);
+ },
+ position:'hes',
+ viewAs:{
+ name:links[0][2],
+ nature:links[0][3],
+ storage:{'dddchengjing':true}
+ },
+ precontent:function(){
+ player.addTempSkill('dddchengjing_effect');
+ },
+ }
+ },
+ prompt:function(links,player){
+ return '将一张牌当做'+(get.translation(links[0][3])||'')+get.translation(links[0][2])+'使用';
+ }
+ },
+ ai:{
+ combo:'dddyouxue',
+ order:1,
+ result:{
+ player:1,
+ },
+ },
+ subSkill:{
+ effect:{
+ audio:'dddchengjing',
+ trigger:{global:'useCardAfter'},
+ charlotte:true,
+ direct:true,
+ filter:function(event,player){
+ return event.card&&event.card.storage&&event.card.storage['dddchengjing'];
+ },
+ content:function(){
+ 'step 0'
+ var damaged=game.hasPlayer2(current=>current.hasHistory('damage',evt=>evt.card==trigger.card));
+ event.damaged=damaged;
+ var vpos=player.hasMark('dddyouxue')?game.filterPlayer2(i=>i.getSeatNum()==player.countMark('dddyouxue'))[0]:player;
+ var target=vpos.getNext();
+ event.target=target;
+ player.chooseControl(' +1 ',' -1 ','cancel2').set('prompt','是否令“虚位”下家('+get.translation(target)+')下回合的'+(damaged?'摸牌数':'手牌上限')+'+1或-1?').set('ai',function(){
+ var sgn=get.sgn(get.attitude(_status.event.player,_status.event.target));
+ if(sgn==0) return 2;
+ if(sgn==1) return 0;
+ return 1;
+ }).set('target',target);
+ 'step 1'
+ if(result.index!=2){
+ player.logSkill('dddchengjing_effect',target);
+ var name=(event.damaged?'draw':'limit')+result.index;
+ target.addTempSkill('dddchengjing_check',{player:'phaseAfter'});
+ target.addMark('dddchengjing_'+name,1,false);
+ game.log(target,'下回合的'+(event.damaged?'摸牌数':'手牌上限'),'#y'+(['+1','-1'][result.index]));
+ }
+ }
+ },
+ check:{
+ trigger:{player:'phaseDrawBegin2'},
+ charlotte:true,
+ forced:true,
+ filter:function(event,player){
+ return player.countMark('dddchengjing_draw0')||player.countMark('dddchengjing_draw1');
+ },
+ content:function(){
+ trigger.num+=player.countMark('dddchengjing_draw0')-player.countMark('dddchengjing_draw1');
+ },
+ mod:{
+ maxHandcard:function(player,num){
+ return num+player.countMark('dddchengjing_limit0')-player.countMark('dddchengjing_limit1');
+ }
+ },
+ onremove:function(player){
+ delete player.storage['dddchengjing_draw0'];
+ delete player.storage['dddchengjing_draw1'];
+ delete player.storage['dddchengjing_limit0'];
+ delete player.storage['dddchengjing_limit1'];
+ },
+ mark:true,
+ marktext:'承',
+ intro:{
+ name:'承经',
+ content:function(storage,player){
+ var str='';
+ if(player.countMark('dddchengjing_draw0')||player.countMark('dddchengjing_draw1')){
+ var num=player.countMark('dddchengjing_draw0')-player.countMark('dddchengjing_draw1');
+ str+='摸牌阶段摸牌数'+(num>=0?'+':'')+num;
+ }
+ if(player.countMark('dddchengjing_limit0')||player.countMark('dddchengjing_limit1')){
+ var num=player.countMark('dddchengjing_limit0')-player.countMark('dddchengjing_limit1');
+ str+='手牌上限'+(num>=0?'+':'')+num;
+ }
+ return str;
+ }
+ }
+ },
+ draw0:{charlotte:true},
+ draw1:{charlotte:true},
+ limit0:{charlotte:true},
+ limit1:{charlotte:true},
+ }
+ },
+ dddduanbing:{
+ enable:'phaseUse',
+ filter:function(event,player){
+ return player.canAddJudge('bingliang')&&player.hasCard((card)=>lib.skill['dddduanbing'].filterCard(card,player),'h');
+ },
+ filterCard:function(card,player){
+ if(get.color(card)!='black'||get.type2(card)=='trick') return false;
+ return player.canAddJudge(get.autoViewAs({name:'bingliang'},[card]));
+ },
+ check:function(card){
+ return 6-get.value(card);
+ },
+ discard:false,
+ lose:false,
+ delay:false,
+ prepare:'throw',
+ content:function(){
+ 'step 0'
+ player.addJudge({name:'bingliang'},cards);
+ 'step 1'
+ game.delayx();
+ player.draw(2);
+ 'step 2'
+ player.addTempSkill('dddduanbing_effect');
+ player.chooseUseTarget({
+ name:'sha',
+ isCard:true,
+ storage:{_dddduanbing:true},
+ },false,'nodistance');
+ },
+ ai:{
+ order:function(item,player){
+ return get.order({name:'sha'})-0.1;
+ },
+ result:{
+ player:function(player){
+ return player.getUseValue({name:'sha'},false)
+ },
+ },
+ },
+ subSkill:{
+ effect:{
+ trigger:{source:'damageSource'},
+ charlotte:true,
+ filter:function(event,player){
+ if(!event.card||!event.card.storage||!event.card.storage._dddduanbing) return false;
+ if(event.getParent().type!='card'||!event.player.isIn()) return false;
+ var cards=event.getParent(4).cards;
+ if(cards&&cards.length==1){
+ var card=cards[0];
+ return player.getCards('j').contains(card)&&(card.viewAs||card.name)=='bingliang'&&event.player.canAddJudge(card);
+ }
+ return false;
+ },
+ prompt:(event)=>('是否将【兵粮寸断】转移给'+get.translation(event.player)+'?'),
+ check:function(event,player){
+ var cards=event.getParent(4).cards;
+ if(cards&&cards.length==1){
+ var card=get.autoViewAs({name:'bingliang'},cards);
+ return get.effect(event.player,card,player,player)>=0;
+ }
+ return false;
+ },
+ content:function(){
+ var card=trigger.getParent(4).cards[0],target=trigger.player;
+ player.line(target);
+ player.$give(card,target);
+ target.addJudge({name:'bingliang'},card);
+ },
+ },
+ },
+ },
+ //轲比能
+ dddxiaoxing:{
+ audio:2,
+ forced:true,
+ trigger:{global:'gameDrawBegin'},
+ forced:true,
+ group:'dddxiaoxing_remove',
+ content:function(){
+ var me=player;
+ var numx=trigger.num;
+ trigger.num=typeof numx=='function'?function(player){
+ if(player==me){
+ return 3+numx(player);
+ }
+ return numx(player);
+ }:function(player){
+ if(player==me){
+ return 3+numx;
+ }
+ return numx;
+ }
+ },
+ mod:{
+ attackRange:(player,num)=>num+3,
+ maxHandcard:(player,num)=>num+3,
+ },
+ subSkill:{
+ remove:{
+ trigger:{player:'dying'},
+ forced:true,
+ direct:true,
+ filter:function(event,player){
+ return event.source&&event.source.isIn()&&event.source.getEquip(1);
+ },
+ content:function(){
+ 'step 0'
+ trigger.source.chooseBool(get.prompt('dddxiaoxing',player),'废除武器栏,令其失去〖枭行〗').set('ai',()=>{
+ if(_status.event.maybe) return Math.random()<0.5;
+ return false;
+ }).set('maybe',player.countCards('hs',{name:['tao','jiu']})&&player.countCards('h')>=3);
+ 'step 1'
+ if(result.bool){
+ trigger.source.logSkill('dddxiaoxing',player);
+ trigger.source.disableEquip(1);
+ player.removeSkill('dddxiaoxing');
+ game.log(player,'失去了技能','#g【枭行】');
+ }
+ }
+ }
+ }
+ },
+ dddlangzhi:{
+ audio:2,
+ trigger:{player:'phaseJieshuBegin'},
+ logTarget:function(event,player){
+ return game.filterPlayer(current=>player.inRange(current)&¤t.countCards('he'));
+ },
+ content:function(){
+ 'step 0'
+ event.targets=game.filterPlayer(current=>player.inRange(current)&¤t.countCards('he'));
+ event.cards=[];
+ event.num=0;
+ 'step 1'
+ var target=targets[num];
+ event.num++;
+ event.target=target;
+ player.choosePlayerCard('狼志:展示'+get.translation(target)+'一张牌','he',target,true);
+ 'step 2'
+ if(result.bool){
+ var card=result.links[0];
+ player.showCards(card,get.translation(target)+'被展示');
+ event.cards.push(card);
+ }
+ 'step 3'
+ if(num{
+ if(ui.selected.cards.length>=_status.event.num) return 0;
+ return 100-get.value(card);
+ }).set('num',function(){
+ if(cards.lengthp+get.value(c),0);
+ if(valget.value(card,player)),list2=cards.map((card,i)=>get.value(card,targets[i])*get.sgnAttitude(player,targets[i]));
+ list1.sort((a,b)=>a[1]-b[1]);
+ list2.sort((a,b)=>b[1]-a[1]);
+ list2=list2.filter(i=>i>0);
+ var count=0;
+ for(var i of list2){
+ for(var j=0;jlist1[j]){
+ count++;
+ list1.splice(j,1);
+ break;
+ }
+ }
+ }
+ return count;
+ }()).set('prompt',false);
+ }
+ 'step 4'
+ if(result.bool){
+ var cards2=result.cards;
+ event.cards2=cards2;
+ var func=function(id){
+ var dialog=get.idDialog(id);
+ if(dialog) dialog.content.childNodes[1].innerHTML='选择要交换的牌(按选择的顺序一一交换)
';
+ };
+ if(event.isMine()) func(event.videoId);
+ else if(player.isOnline2()) player.send(func,event.videoId);
+ player.chooseButton(cards2.length,true).set('dialog',event.videoId).set('ai',button=>{
+ return get.value(button.link);
+ });
+ event.goto(6);
+ }
+ else{
+ for(var i=0;i{
+ if(get.attitude(_status.event.player,_status.event.getParent().player)<=2) return 'cancel2';
+ if(_status.event.choices.contains('dddfuyi_both')) return 'dddfuyi_both';
+ if(_status.event.choices.contains('dddlangzhi')) return 'dddlangzhi';
+ return Math.random()<0.5?'dddxiaoxing':'cancel2';
+ });
+ 'step 1'
+ if(result.control!='cancel2'){
+ trigger.player.logSkill('dddfuyi',player);
+ trigger.cancel();
+ var skills=[result.control];
+ if(result.control=='dddfuyi_both'){
+ skills=['dddxiaoxing','dddlangzhi'];
+ player.draw(3);
+ }
+ else event.finish();
+ for(var i of skills){
+ player.addSkillLog(i);
+ }
+ }
+ else event.finish();
+ 'step 2'
+ player.removeSkill('dddfuyi');
+ game.log(player,'失去了技能','#g【附义】');
+ }
+ },
+ //曹爽
+ dddzhuanshe:{
+ audio:2,
+ trigger:{global:'phaseUseBegin'},
+ filter:function(event,player){
+ return player.countCards('h')&&event.player!=player;
+ },
+ direct:true,
+ content:function(){
+ 'step 0'
+ player.chooseCard(get.prompt2('dddzhuanshe',trigger.player)).set('ai',card=>{
+ var target=_status.event.getTrigger().player;
+ if(!_status.event.goon){
+ if(get.value(card)<4) return -target.getUseValue(card)+0.001;
+ return 0;
+ }
+ return target.getUseValue(card);
+ }).set('goon',get.attitude(player,trigger.player));
+ 'step 1'
+ if(result.bool){
+ var card=result.cards[0];
+ player.logSkill('dddzhuanshe',trigger.player);
+ player.give(card,trigger.player,true);
+ player.addTempSkill('dddzhuanshe_effect');
+ player.markAuto('dddzhuanshe_effect',[card.name]);
+ }
+ },
+ subSkill:{
+ effect:{
+ audio:'dddzhuanshe',
+ trigger:{global:'useCard2'},
+ filter:function(event,player){
+ if(!player.getStorage('dddzhuanshe_effect').contains(event.card.name)) return false;
+ if(event.player!=_status.currentPhase) return false;
+ var type=get.type(event.card,null,false);
+ if(type!='basic'&&type!='trick') return false;
+ var info=get.info(event.card);
+ if(info.allowMultiple==false) return false;
+ if(event.targets&&!info.multitarget){
+ if(game.hasPlayer(function(current){
+ return !event.targets.contains(current)&&lib.filter.targetEnabled2(event.card,event.player,current);
+ })){
+ return true;
+ }
+ }
+ return false;
+ },
+ direct:true,
+ group:'dddzhuanshe_damage',
+ charlotte:true,
+ onremove:true,
+ content:function(){
+ 'step 0'
+ var prompt2='为'+get.translation(trigger.card)+'增加一个目标'
+ player.chooseTarget(get.prompt('dddzhuanshe_effect'),function(card,player,target){
+ var player=_status.event.source;
+ return !_status.event.targets.contains(target)&&lib.filter.targetEnabled2(_status.event.card,player,target);
+ }).set('prompt2',prompt2).set('ai',function(target){
+ var trigger=_status.event.getTrigger();
+ var player=_status.event.source;
+ return get.effect(target,trigger.card,player,_status.event.player);
+ }).set('targets',trigger.targets).set('card',trigger.card).set('source',trigger.player);
+ 'step 1'
+ if(result.bool){
+ if(!event.isMine()&&!event.isOnline()) game.delayx();
+ event.targets=result.targets;
+ }
+ else{
+ event.finish();
+ }
+ 'step 2'
+ if(event.targets){
+ player.logSkill(event.name,event.targets);
+ trigger.targets.addArray(event.targets);
+ game.log(event.targets,'也成为了',trigger.card,'的目标');
+ }
+ }
+ },
+ damage:{
+ audio:'dddzhuanshe',
+ trigger:{global:'phaseEnd'},
+ filter:function(event,player){
+ var list=player.getStorage('dddzhuanshe_effect').slice();
+ event.player.getHistory('useCard',evt=>{
+ list.remove(evt.card.name);
+ })
+ return list.length;
+ },
+ charlotte:true,
+ logTarget:'player',
+ prompt2:'对其造成1点伤害',
+ check:function(event,player){
+ return get.damageEffect(event.player,player,player)>=0;
+ },
+ content:function(){
+ trigger.player.damage(player);
+ }
+ }
+ }
+ },
+ dddweiqiu:{
+ audio:2,
+ trigger:{global:'recoverBefore'},
+ filter:function(event,player){
+ return !player.countCards('h');
+ },
+ forced:true,
+ direct:true,
+ content:function(){
+ trigger.player.logSkill('dddweiqiu',player);
+ trigger.cancel();
+ player.draw();
+ }
+ },
+ //薛灵芸
+ dddlianer:{
+ audio:2,
+ trigger:{player:'useCardAfter'},
+ filter:function(event,player){
+ return event.cards.filterInD('od').length&&get.color(event.card)=='red';
+ },
+ content:function(){
+ 'step 0'
+ var cards=trigger.cards.filterInD('od');
+ event.cards=cards;
+ player.gain(cards,'gain2');
+ 'step 1'
+ var number=get.number(cards[0]);
+ if(cards.length==1&&typeof number=='number'){
+ player.addTempSkill('dddlianer_ceiling');
+ player.storage['dddlianer_ceiling']=number;
+ }
+ },
+ mod:{
+ aiOrder:function(player,card,num){
+ if(get.itemtype(card)=='card'&&get.color(card)=='red'){
+ if(!player.storage['dddlianer_ceiling']) return;
+ var numx=get.number(card);
+ if(typeof numx=='number'){
+ return num+10/Math.max(1,player.storage['dddlianer_ceiling']-numx);
+ }
+ }
+ }
+ },
+ subSkill:{
+ ceiling:{
+ onremove:true,
+ charlotte:true,
+ mod:{
+ cardEnabled:function(card,player){
+ if(!player.storage['dddlianer_ceiling']) return;
+ var num=get.number(card);
+ if(typeof num!='number'||player.storage['dddlianer_ceiling']<=num) return false;
+ },
+ cardRespondable:function(card,player){
+ if(!player.storage['dddlianer_ceiling']) return;
+ var num=get.number(card);
+ if(typeof num!='number'||player.storage['dddlianer_ceiling']<=num) return false;
+ },
+ cardSavable:function(card,player){
+ if(!player.storage['dddlianer_ceiling']) return;
+ var num=get.number(card);
+ if(typeof num!='number'||player.storage['dddlianer_ceiling']<=num) return false;
+ },
+ }
+ }
+ }
+ },
+ dddanzhi:{
+ audio:2,
+ trigger:{global:'phaseBegin'},
+ filter:function(event,player){
+ var evts=game.getAllGlobalHistory('cardMove');
+ if(!evts.length) return false;
+ var cards=evts[evts.length-1].cards;
+ return cards.some(i=>{
+ return get.color(i,false)=='black'&&get.position(i,true)=='d';
+ });
+ },
+ direct:true,
+ content:function(){
+ 'step 0'
+ player.chooseTarget(get.prompt('dddanzhi'),'选择一名角色,此回合其第一次成为黑色牌的目标时,此牌对其无效').set('ai',target=>{
+ return get.attitude(_status.event.player,target);
+ });
+ 'step 1'
+ if(result.bool){
+ var target=result.targets[0];
+ player.logSkill('dddanzhi',target);
+ target.addTempSkill('dddanzhi_effect');
+ }
+ },
+ subSkill:{
+ effect:{
+ trigger:{target:'useCardToTarget'},
+ filter:function(event,player){
+ return get.color(event.card)=='black';
+ },
+ forced:true,
+ charlotte:true,
+ content:function(){
+ trigger.targets.remove(player);
+ trigger.getParent().triggeredTargets2.remove(player);
+ trigger.untrigger();
+ game.log(trigger.card,'对',player,'无效了');
+ game.delayx();
+ player.removeSkill('dddanzhi_effect');
+ }
+ }
+ }
+ },
+ //刘宏
+ dddshixing:{
+ audio:2,
+ trigger:{
+ global:['changeHp','useCard1','phaseBefore'],
+ },
+ forced:true,
+ onremove:true,
+ filter:function(event,player){
+ var num=player.countMark('dddshixing');
+ if(event.name=='changeHp'){
+ if(event.player.hasSex('female')){
+ var bool=!event.player.isDamaged();
+ if(bool&&((num&1)==0)||!bool&&((num&1)==1)){
+ return true;
+ }
+ }
+ return false;
+ }
+ if(event.name=='useCard'){
+ var bool=game.getGlobalHistory('useCard',evt=>get.type2(evt.card)=='trick').length==0;
+ if((bool&&(num&2)==0)||!bool&&((num&2)==2)){
+ return true;
+ }
+ return false;
+ }
+ return true;
+ },
+ content:function(){
+ lib.skill['dddshixing'].applyChange(player);
+ },
+ applyChange:function(player){
+ player.removeAdditionalSkill('dddshixing');
+ var bool1=game.hasPlayer(current=>!current.isDamaged()&¤t.hasSex('female')),
+ bool2=game.getGlobalHistory('useCard',evt=>get.type2(evt.card)=='trick').length==0;
+ player.storage['dddshixing']=bool1+2*bool2;
+ var list=[];
+ if(bool1) list.push('xiangle');
+ if(bool2) list.push('jiushi');
+ if(!bool1&&!bool2) list.push('rezhiheng');
+ player.addAdditionalSkill('dddshixing',list);
+ },
+ derivation:['xiangle','jiushi','rezhiheng'],
+ },
+ ddddanggu:{
+ audio:2,
+ trigger:{player:'phaseJieshuBegin'},
+ filter:function(event,player){
+ return game.countPlayer(current=>current.isLinked())current.group=='qun');
+ },
+ forced:true,
+ group:'ddddanggu_negative',
+ content:function(){
+ 'step 0'
+ if(!event.loop) event.loop=0;
+ var num=game.countPlayer(current=>current.group=='qun')-game.countPlayer(current=>current.isLinked());
+ player.chooseTarget('党锢:横置至少'+get.cnNumber(num)+'名角色',[num,Infinity],true,(card,player,target)=>{
+ return !target.isLinked();
+ }).set('ai',target=>{
+ return get.effect(target,{name:'tiesuo'},_status.event.player);
+ });
+ 'step 1'
+ if(result.bool){
+ var targets=result.targets.sortBySeat();
+ player.logSkill('ddddanggu',targets);
+ targets.forEach(i=>i.link());
+ }
+ },
+ discard:function(){
+ "step 0"
+ game.log(player,'进入了弃牌阶段');
+ event.num=(function(){
+ var num=0;
+ var hs=player.getCards('he');
+ num+=hs.length;
+ for(var i=0;i_status.event.bool).set('bool',function(){
+ var list=[],cards=player.getCards('h');
+ for(var i of cards){
+ var suit=get.suit(i,player);
+ if(!lib.suit.contains(suit)) continue;
+ list.add(suit);
+ }
+ if(player.storage['dddlanghuai']){
+ list=list.removeArray(lib.suit);
+ }
+ return list.length==2&&!player.storage['dddlanghuai']||list.length>2;
+ }());
+ 'step 1'
+ if(result.bool){
+ player.logSkill('dddlanghuai');
+ delete player.storage['dddxuanlun_del'];
+ if(player.countCards('h')) player.showHandcards();
+ }
+ else event.finish();
+ 'step 2'
+ var list=[],cards=player.getCards('h');
+ for(var i of cards){
+ var suit=get.suit(i,player);
+ if(!lib.suit.contains(suit)) continue;
+ list.add(suit);
+ }
+ if(player.storage['dddlanghuai']){
+ list=lib.suit.slice().removeArray(list);
+ }
+ player.changeZhuanhuanji('dddlanghuai');
+ trigger.changeToZero();
+ if(list.length) player.draw(list.length);
+ },
+ mark:true,
+ intro:{
+ content:function(storage,player){
+ return '摸牌阶段,你可展示手牌(无牌则不展示),并改为摸其中'+(!storage?'包含':'缺少')+'花色数的牌。';
+ },
+ },
+ marktext:'☯',
+ },
+ dddxuanlun:{
+ audio:2,
+ trigger:{player:'damageEnd'},
+ content:function(){
+ player.draw(4);
+ player.addTempSkill('dddxuanlun_choose');
+ },
+ ai:{
+ maixie:true,
+ maixie_hp:true,
+ result:{
+ effect: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.5];
+ if(target.hp==3) return [1,num*1.5];
+ if(target.hp==2) return [1,num*0.5];
+ }
+ },
+ },
+ threaten:0.6,
+ },
+ subSkill:{
+ choose:{
+ trigger:{global:'phaseEnd'},
+ forced:true,
+ charlotte:true,
+ filter:function(event,player){
+ if(player.hasMark('dddxuanlun_del')&&!player.countCards('h')) return false;
+ return true;
+ },
+ content:function(){
+ 'step 0'
+ var choices=[];
+ var choiceList=['将四张牌以任意顺序置于牌堆顶或底','删去此项和〖朗怀〗中的“可”,直到你发动〖朗怀〗'];
+ if(player.countCards('he')>=4||player.hasMark('dddxuanlun_del')) choices.push('选项一');
+ else choiceList[0]=''+choiceList[0]+'';
+ if(!player.hasMark('dddxuanlun_del')) choices.push('选项二');
+ else choiceList[1]=''+choiceList[1]+'';
+ if(choices.length==1&&choices[0]=='选项一') event._result={control:'选项一'};
+ else player.chooseControl(choices).set('choiceList',choiceList).set('ai',()=>{
+ if(!_status.event.controls.contains('选项一')) return 1;
+ if(!_status.event.controls.contains('选项二')) return 0;
+ var player=_status.event.player;
+ var num=0;
+ for(var card of player.getCards('he')){
+ if(get.value(card,player)<=5) num++;
+ if(num>=4) break;
+ }
+ return num>=4?0:1;
+ });
+ 'step 1'
+ game.log(player,'选择了','#y'+result.control);
+ if(result.control=='选项一'){
+ var cards=player.getCards('he');
+ if(cards.length<=4) event._result={bool:true,cards:cards};
+ else player.chooseCard('玄论:将四张牌置于牌堆顶或牌堆底','he',true,4);
+ }
+ else{
+ player.addMark('dddxuanlun_del',1,false);
+ event.finish();
+ }
+ 'step 2'
+ if(result.bool){
+ var cards=result.cards;
+ event.cards=cards;
+ player.chooseToMove().set('list',[
+ ['牌堆顶',cards],
+ ['牌堆底'],
+ ]).set('prompt','玄论:将这些牌置于牌堆顶或牌堆底').set('processAI',function(list){
+ var cards=list[0][1],player=_status.event.player;
+ var target=_status.currentPhase.next;
+ var att=get.sgn(get.attitude(player,target));
+ var top=[];
+ var judges=target.getCards('j');
+ var stopped=false;
+ if(player!=target||!target.hasWuxie()){
+ for(var i=0;i0)) break;
+ top.unshift(cards.shift());
+ }
+ }
+ bottom=cards;
+ return [top,bottom];
+ });
+ }
+ else event.finish();
+ 'step 3'
+ if(result.bool){
+ var top=result.moved[0];
+ var bottom=result.moved[1];
+ top.reverse();
+ player.popup(get.cnNumber(top.length)+'上'+get.cnNumber(bottom.length)+'下');
+ var cards=top.addArray(bottom);
+ player.$throw(cards.length,1000);
+ player.lose(cards,ui.cardPile).set('top',top).insert_index=function(event,card){
+ if(event.top.contains(card)) return ui.cardPile.firstChild;
+ return null;
+ };
+ }
+ }
+ }
+ }
+ },
+ //张闿
+ dddjiexing:{
+ audio:2,
+ trigger:{
+ global:['recoverBegin','useCard'],
+ },
+ filter:function(event,player){
+ if(event.player==player) return false;
+ if(event.name=='recover') return player.isDamaged();
+ return get.type(event.card,false)=='equip'&&event.cards.some(i=>get.position(i,true)=='o'&&player.canEquip(i,true));
+ },
+ limited:true,
+ skillAnimation:true,
+ animationColor:'legend',
+ logTarget:'player',
+ check:function(event,player){
+ if(get.attitude(player,event.player)>=0) return false;
+ if(event.name=='recover') return get.recoverEffect(event.player,player,player)current.isMaxEquip(true)&¤t.countGainableCards(player,'he'))||game.countPlayer(current=>current.hp==1)==1;
+ },
+ direct:true,
+ content:function(){
+ 'step 0'
+ player.chooseTarget(get.prompt2('dddbailei'),(card,player,target)=>{
+ return target.isMaxEquip(true)&&target.countGainableCards(player,'he')||target.hp==1&&game.countPlayer(current=>current.hp==1)==1;
+ }).set('ai',target=>{
+ var att=get.attitude(_status.event.player,target);
+ if(att>=3) return false;
+ if(target.hp==1&&game.countPlayer(current=>current.hp==1)==1) return 100;
+ return 1;
+ });
+ 'step 1'
+ if(result.bool){
+ var target=result.targets[0];
+ event.target=target;
+ player.logSkill('dddbailei',target);
+ if(target.isMaxEquip(true)&&target.hp==1&&game.countPlayer(current=>current.hp==1)==1){
+ if(target.countGainableCards(player,'he')){
+ player.gainPlayerCard('拜泪:获得'+get.translation(target)+'一张牌,或点击“取消”杀死其','he',target);
+ }
+ else event._result={bool:false};
+ }
+ else if(target.isMaxEquip(true)) player.gainPlayerCard('拜泪:获得'+get.translation(target)+'一张牌','he',target,true);
+ else{
+ event._result={bool:false};
+ }
+ }
+ else event.finish();
+ 'step 2'
+ if(!result.bool){
+ player.line(target);
+ player.trySkillAnimate('dddbailei_animate','dddbailei_animate',player.checkShow('dddbailei'));
+ game.delayx();
+ }
+ else event.finish();
+ 'step 3'
+ target.die({source:player});
+ player.removeSkill('dddbailei');
+ game.log(player,'失去了技能','#g【拜泪】');
+ },
+ subSkill:{
+ animate:{
+ skillAnimation:true,
+ animationColor:'fire',
+ }
+ }
+ },
+ },
+ dynamicTranslate:{
+ dddxiaheng:function(player){
+ return '锁定技,出牌阶段开始时,你令一名角色弃置两张牌(不足则全弃),再对一名角色造成1点伤害'+(player.storage['dddxiaheng_del']?'':'。“若两名角色:均不为你,你失去一点体力上限;为同一名角色,你失去一点体力;然后若以此法对包括你在内三名不同的角色造成伤害,删除双引号里的描述内容”')+'。';
+ },
+ dddshichao:function(player){
+ return '锁定技,准备阶段,你选择一名手牌数为全场第('+(1+player.countMark('dddshichao'))+')大的角色,将手牌数调整至与其相等且至多等于主公的体力上限;其于你的下回合开始前对你造成伤害时,其可防止之,然后令()内的数字+1。';
+ },
+ dddlanghuai:function(player){
+ return '转换技,摸牌阶段,你'+(player.hasMark('dddxuanlun_del')?'':'可')+'展示手牌(无牌则不展示),并改为摸其中'+(!player.storage['dddlanghuai']?'包含':'缺少')+'花色数的牌。';
+ },
+ dddxuanlun:function(player){
+ var deleted=player.hasMark('dddxuanlun_del');
+ return '你受到伤害后,你可摸四张牌;你发动此技能的回合结束时,'+(deleted?'你':'须选择一项:')+'将四张牌以任意顺序置于牌堆顶或底'+(deleted?'。':';或删去此项和“朗怀”中的“可”,直到你发动“朗怀”。');
+ },
+ ddddiedang:function(player){
+ if(player.storage.ddddiedang) return '出牌阶段限一次,你可以弃置三张牌,然后摸一张牌;然后若你的手牌数为全场最多或最少,则你交换上述描述中的“弃置”和“摸”。'
+ return '出牌阶段限一次,你可以摸三张牌,然后弃置一张牌;然后若你的手牌数为全场最多或最少,则你交换上述描述中的“摸”和“弃置”。';
+ },
+ dddyeshen:function(player){
+ return '一名角色的结束阶段,你可以亮出牌堆底'+get.cnNumber(3-player.countMark('dddyeshen'))+'张牌,令其将其中一张黑色牌当做最大目标数为牌名字数的【铁索连环】使用或重铸,其余牌置于牌堆顶,然后此技能亮出牌数-1;若减至零张,你复原此技能并对自己造成一点火焰伤害。';
+ },
+ },
+ translate:{
+ ddd_handang:"韩当",
+ dddxianxi:"险袭",
+ dddxianxi_info:"出牌阶段,你使用【杀】时可无视距离额外指定任意名角色为目标;此【杀】结算后,若额外指定的目标中有未受到此【杀】伤害的,你须选择一项:弃置X张牌对其各造成1点伤害;或摸X张牌并失去1点体力(X为未受到此【杀】伤害的目标数)。",
+ ddd_wuzhi:"吴质",
+ dddlingyong:"灵涌",
+ dddlingyong_info:"一名角色跳过其的阶段时,你可进行判定。若结果不为【杀】,则你可以使用判定牌,然后重复此流程。",
+ dddxuxiao:"虚孝",
+ dddxuxiao_info:"当有黑色基本牌因弃置而进入弃牌堆后,你可将其当做【兵粮寸断】置于一名角色的判定区,然后其摸两张牌。",
+ ddd_xujing:"许靖",
+ dddxuyu:"虚誉",
+ dddxuyu_info:"当你于出牌阶段使用的第一张牌结算结束后,你可以摸两张牌。若如此做,当你于本阶段使用的第三张牌结算结束后,你弃置一张牌。",
+ dddshijian:"实荐",
+ dddshijian_info:"其他角色于出牌阶段使用的第三张牌结算结束后,你可以令其摸一张牌。若如此做,当其于本阶段使用的第四张牌结算结束后,你摸两张牌。",
+ ddd_caomao:"曹髦",
+ dddtaisi:"太思",
+ dddtaisi_info:"一名角色的回合结束时,若你的体力值于本回合内发生过变化,则你可以令一名角色获得一张于本回合内进入弃牌堆的牌。然后若该角色于本回合内对你造成过伤害,则你摸两张牌。",
+ dddquche:"驱车",
+ dddquche_info:"限定技。出牌阶段,你可依次执行大括号内的流程至多X次(X为你的体力上限):{[⒈将一张牌交给一名其他角色]+[将一张黑色牌当做【杀】使用(不计入次数限制)]}。你每执行一个中括号内的选项,本回合内至其他角色的距离便-1。",
+ dddqianlong:"潜龙",
+ dddqianlong_info:"主公技,锁定技。当你因执行奖惩而摸牌或弃置牌时,取消之;当你杀死一名角色后,你摸三张牌。",
+ ddd_xinxianying:"辛宪英",
+ ddddongcha:"洞察",
+ ddddongcha_info:"其他角色的回合开始时,你可以令你和其依次将一张手牌置于你的武将牌上,称为“鉴”。若如此做,本回合结束时,你与其依次选择获得一张“鉴”。",
+ dddzhijie:"智解",
+ dddzhijie_info:"你可以将两张颜色相同的“鉴”当做【闪】使用,或将两张颜色不同的“鉴”当做【无懈可击】使用;然后你摸两张牌。",
+ ddd_xianglang:'向朗',
+ dddqiahua:"恰化",
+ dddqiahua_info:"其他角色的回合开始时,你可选择X张不为“明”的手牌作为“明”(X为其体力值,这些牌对所有角色可见),然后其于本回合内获得〖恂恂〗。",
+ dddfusi:"腹笥",
+ dddfusi_info:"锁定技。①你的“明”不计入手牌上限。②其他角色需要使用牌时,可以改为使用你的“明”(需经过你的确认)。③你的回合内,若你的手牌均为“明”,则其他角色不能使用各自的手牌。",
+ dddfusi_global:"腹笥",
+ dddtuoji:"拓籍",
+ dddtuoji_info:"其他角色因〖腹笥〗而使用你的牌后,若你的手牌均为“明”,则你可以摸三张牌。",
+ dddxujing_tag:"明",
+ ddd_yujin:'于禁',
+ dddzhengjun:'整军',
+ dddzhengjun_info:'出牌阶段内每项各限一次。当有其他角色的手牌数/体力值/装备区内牌数变化后,若其的对应数值与你相同,则你可以执行对应的选项。体力值:你令一名角色回复1点体力;手牌数:你令一名角色摸一张牌;装备区内牌数:你移动场上的一张装备牌。',
+ ddd_liuye:'刘晔',
+ dddchashi:'察势',
+ dddchashi_info:'其他角色的出牌阶段开始时,你可展示一张牌A。若其本阶段内:已经使用过牌,{则你判断A和第一张使用的牌的花色,若花色相同,则其获得A,你摸一张牌};未使用过牌,{则当其于本阶段内使用第一张牌时,若此牌与A花色相同,其获得A,然后你摸一张牌}。',
+ dddqice:'齐策',
+ dddqice_info:'准备阶段开始时,你可以摸两张牌。若如此做,本回合的结束阶段开始时,若你本回合内:使用过普通锦囊牌,则你可以视为使用这些牌中的一张;未使用过普通锦囊牌,则你失去此技能。',
+ ddd_baosanniang:'鲍三娘',
+ dddzhilian:'枝连',
+ dddzhilian_info:'一名角色的回合结束时,若本回合使用过牌的角色数为2,则你可以令这些角色各摸一张牌或各弃置一张牌。然后若这两名角色中包含你,则你获得本回合内进入弃牌堆的所有【杀】。',
+ dddjijian:'赍剑',
+ dddjijian_info:'出牌阶段限一次。你可以指定一名其他男性角色,令其展示至多两张手牌。然后你可以交给其一张【杀】,且其可以依次视为使用X张与其手牌中未展示牌牌名相同的不重复基本牌或普通锦囊牌(X为此【杀】与其展示牌中颜色相同的牌的数量)。',
+ ddd_zhenji:'甄姬',
+ dddmiaoxing:'淼形',
+ dddmiaoxing_info:'锁定技,分发起始手牌时,共发你三份起始手牌,你将其中两份移出游戏,称为“水相”;摸牌阶段结束后,你须将至少一份“水相”调整至与你的手牌数相等。',
+ dddfushi:'浮世',
+ dddfushi_info:'每回合限一次,你使用或打出的基本牌结算后,你可用所有手牌交换一份“水相”,然后你可令一名男性角色选择是否用其所有手牌交换一份“水相”。',
+ ddd_zhaoang:'赵昂',
+ dddfenji:'奋计',
+ dddfenji_info:'摸牌/弃牌阶段开始时,你可视为使用一张未以此法使用过的普通锦囊牌,然后将此阶段摸牌/弃牌数改为此牌造成的伤害值/目标数。',
+ ddd_zhouchu:'周处',
+ dddxiaheng:'侠横',
+ dddxiaheng_info:'锁定技,出牌阶段开始时,你令一名角色弃置两张牌(不足则全弃),再对一名角色造成1点伤害。“若两名角色:均不为你,你失去一点体力上限;为同一名角色,你失去一点体力;然后若以此法对包括你在内三名不同的角色造成伤害,删除双引号里的描述内容”。',
+ ddd_liuba:'刘巴',
+ dddfengzheng:'丰政',
+ dddfengzheng_info:'每名角色的出牌阶段限一次,其可将点数之和为K的任意张手牌当一张【无中生有】使用;轮次结束时,你可观看并分配牌堆顶的X张牌(X为此轮发动过“丰政”的角色数),若有角色以此法获得的牌数多于两张,你失去“丰政”。',
+ dddyulv:'玉律',
+ dddyulv_info:'锁定技,游戏开始时,你声明一个点数;此点数的牌进入弃牌堆后,你令当前回合角色摸或弃置一张牌;一名角色连续以此法摸牌或弃牌后,你为“玉律”重新声明一个点数,然后于结算后结束当前回合。',
+ ddd_jianshuo:'蹇硕',
+ dddfenye:'分野',
+ dddfenye_info:'出牌阶段限一次,你可与一名其他角色拼点,然后其余角色可加入其中一方并扣置一张手牌作为其拼点牌,比较双方点数均值,拼点胜方角色依次可视为对一名不同的拼点败方角色使用【杀】。',
+ dddshichao:'逝潮',
+ dddshichao_info:'锁定技,准备阶段,你选择一名手牌数为全场第(1)大的角色,将手牌数调整至与其相等且至多等于主公的体力上限;其于你的下回合开始前对你造成伤害时,其可防止之,然后令()内的数字+1。',
+ ddd_guanning:'管宁',
+ dddyouxue:'游学',
+ dddyouxue_info:'锁定技,每轮开始时,你选定你的行动次序,其对应的座次位置称为“虚位”,然后执行额定的摸牌阶段,且摸牌数改为“虚位”移动的距离。',
+ dddchengjing:'承经',
+ dddchengjing_info:'出牌阶段限一次,你可将一张牌当虚位上家角色上回合使用的一张基本牌或普通锦囊牌使用,若之造成/未造成伤害,你可令虚位下家角色下回合的摸牌数/手牌上限+1或-1。',
+ ddd_dingfeng:'丁奉',
+ dddduanbing:'短兵',
+ dddduanbing_info:'出牌阶段,你可将一张黑色非锦囊牌当一张【兵粮寸断】置入自己的判定区,摸两张牌,然后视为使用一张无视距离限制的【杀】;当此【杀】对目标角色造成伤害后,你可将此【兵粮寸断】移至目标角色的判定区。',
+ ddd_kebineng:'轲比能',
+ dddxiaoxing:'枭行',
+ dddxiaoxing_info:'锁定技,你的初始手牌,攻击范围和手牌上限+3;你进入濒死状态时,伤害来源可以废除其有装备牌的武器栏,再令你失去“枭行”。',
+ dddlangzhi:'狼志',
+ dddlangzhi_info:'结束阶段,你可展示你攻击范围内的所有角色各一张牌,然后选择一项:1.用任意张牌替换其中等量张牌;2.获得所有展示牌,再失去“狼志”。',
+ dddfuyi:'附义',
+ dddfuyi_both:'〖枭行〗和〖狼志〗',
+ dddfuyi_info:'主公技,其他群势力角色执行奖惩时,若你已失去“枭行”或“狼志”,其可改为令你获得其中一或两个;若为两个,你摸三张牌,再失去“附义”。',
+ ddd_caoshuang:'曹爽',
+ ddd_xuelingyun:'薛灵芸',
+ ddd_liuhong:'刘宏',
+ ddd_xiahouxuan:'夏侯玄',
+ ddd_zhangkai:'张闿',
+ dddzhuanshe:'专摄',
+ dddzhuanshe_info:'其他角色的出牌阶段开始时,你可将一张手牌正面朝上交给该角色,则当其在此回合内:使用与之名称相同的基本牌或普通锦囊牌时,你可无视距离限制为之额外选择一个目标;未使用与之名称相同的牌,你可在回合结束时对其造成1点伤害。',
+ dddweiqiu:'危秋',
+ dddweiqiu_info:'锁定技,一名角色回复体力前,若你没有手牌,改为令你摸一张牌。',
+ dddlianer:'涟洏',
+ dddlianer_info:'当你使用红色牌结算后,你可以获得之,然后你只能使用点数小于此牌的牌直到回合结束。',
+ dddanzhi:'暗织',
+ dddanzhi_info:'一名角色的回合开始时,若最近进入并在弃牌堆的牌包含黑色,你可以指定一名角色,此回合其第一次成为黑色牌的目标时,此牌对其无效。',
+ dddshixing:'失兴',
+ dddshixing_info:'锁定技,若有未受伤的女性角色,你视为拥有“享乐”;若当前回合没有锦囊牌被使用,你视为拥有“酒诗”;若你没有上述技能,你视为拥有“制衡”。',
+ ddddanggu:'党锢',
+ ddddanggu_info:'锁定技,结束阶段,你横置任意名角色的武将牌,直到场上已横置的角色数不少于X(X为群势力角色数);其他角色的弃牌阶段,若其处于“连环状态”,其装备区里的牌视为手牌。',
+ dddlanghuai:'朗怀',
+ dddlanghuai_info:'转换技,摸牌阶段,你可展示手牌(无牌则不展示),并改为摸其中①包含②缺少花色数的牌。',
+ dddxuanlun:'玄论',
+ dddxuanlun_info:'你受到伤害后,你可摸四张牌;你发动此技能的回合结束时,须选择一项:将四张牌以任意顺序置于牌堆顶或底;或删去此项和“朗怀”中的“可”,直到你发动“朗怀”。',
+ dddjiexing:'劫行',
+ dddjiexing_info:'限定技,其他角色回复体力时,你可改为你回复等量体力;其他角色使用装备牌时,你可改为将此牌置入你的装备区。当你不以此法回复体力后或使用装备牌后,重置此技能。',
+ dddbailei:'拜泪',
+ dddbailei_info:'准备阶段,你可获得装备区牌数唯一最多的角色的一张牌,或杀死体力值唯一为一的角色并失去此技能。',
+ ddd_liangxi:'梁习',
+ dddtongyu:'仝御',
+ dddtongyu_info:'出牌阶段限一次,你可以将任意张花色不同的牌当做【五谷丰登】使用,且此牌的展示牌数+X(X为此牌对应的实体牌数量)。此牌的所有目标角色在被指定目标后选择一项:⒈本回合不能再使用或打出手牌。⒉令此【五谷丰登】对其无效。此【五谷丰登】的多余展示牌置入弃牌堆前,你可以令一名选择了选项二的角色获得这些牌。',
+ ddd_wangkanglvkai:'王伉吕凯',
+ dddbingjian:'并肩',
+ dddbingjian_info:'你可以将手牌数调整至2或4,然后视为使用或打出一张【杀】或【闪】。若你:因此摸牌,则你令一名角色本轮内不能使用或打出同名牌,且你本轮内不能再发动〖并肩〗。因此弃牌,则你令一名角色将手牌数调整至与你相同。',
+ ddd_sunliang:'孙亮',
+ ddddiedang:'迭宕',
+ ddddiedang_info:'出牌阶段限一次,你可以摸三张牌,然后弃置一张牌;然后若你的手牌数为全场最多或最少,则你交换上述描述中的“摸”和“弃”。',
+ dddanliu:'暗流',
+ dddanliu_info:'结束阶段,你可以与一名其他角色依次观看并选择对方的一张手牌,然后交换这两张牌。若这两张牌颜色相同,则你可以逾期交换这两张牌,且:若此牌为红色,则你回复1点体力;若此牌为黑色,则其摸两张牌。',
+ dddguiying:'归萤',
+ dddguiying_info:'主公技。准备阶段,其他吴势力角色可依次展示其一张手牌,然后将其点数最大的一张牌交给你,然后其可以获得场上点数最小的一张牌。',
+ ddd_lie:'李娥',
+ dddyeshen:'冶身',
+ dddyeshen_info:'一名角色的结束阶段,你可以亮出牌堆底三张牌,令其将其中一张黑色牌当做最大目标数为牌名字数的【铁索连环】使用或重铸,其余牌置于牌堆顶,然后此技能亮出牌数-1;若减至零张,你复原此技能并对自己造成一点火焰伤害。',
+ dddqiaoduan:'巧锻',
+ dddqiaoduan_info:'每回合限一次。当有角色:重置后,你可以令至多X名角色各摸一张牌;横置后,你可以将X张牌置于牌堆底,并令一名角色回复一点体力(X为横置角色数)。',
+ },
+ };
+});
diff --git a/character/diy.js b/character/diy.js
index a7c121f05d..d75785510a 100755
--- a/character/diy.js
+++ b/character/diy.js
@@ -484,7 +484,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
effect:function(){
var source=cards[0].storage.nsfuzhou_source;
- if(!source||!source.isAlive()) return;
+ if(!source||!source.isIn()) return;
source.line(player,'thunder');
if(result.color=='black'){
player.damage(source,source.storage.nsfuzhou_damage?2:1,'thunder');
@@ -2998,7 +2998,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var index=event.player.getHistory('useCard',function(evt){
return evt.targets.contains(player);
}).indexOf(event.getParent());
- if(index==2) return event.player.isAlive()&&player.countCards('he')>0;
+ if(index==2) return event.player.isIn()&&player.countCards('he')>0;
return index<2&&index>-1;
},
logTarget:'player',
@@ -3602,9 +3602,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){
if(!event.card||(event.card.name!='sha'&&event.card.name!='juedou')) return false;
var hairi=event.source;
- if(hairi&&(hairi==player||player.inRangeOf(hairi))&&hairi.isAlive()&&(hairi.name1!='key_shizuku'&&hairi.name2!='key_shizuku')) return true;
+ if(hairi&&(hairi==player||player.inRangeOf(hairi))&&hairi.isIn()&&(hairi.name1!='key_shizuku'&&hairi.name2!='key_shizuku')) return true;
hairi=event.player;
- return (hairi&&(hairi==player||player.inRange(hairi))&&hairi.isAlive()&&(hairi.name1!='key_shizuku'&&hairi.name2!='key_shizuku'));
+ return (hairi&&(hairi==player||player.inRange(hairi))&&hairi.isIn()&&(hairi.name1!='key_shizuku'&&hairi.name2!='key_shizuku'));
},
frequent:true,
content:function(){
@@ -5329,7 +5329,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.removeSkill('hiroto_zonglve');
player.removeGaintag('hiroto_huyu2');
var target=player.storage.hiroto_huyu2;
- if(target&&target.isAlive()){
+ if(target&&target.isIn()){
var cards=[];
player.getHistory('gain',function(evt){
cards.addArray(evt.cards);
@@ -5720,7 +5720,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{global:'judge'},
direct:true,
filter:function(event,player){
- return player.getExpansions('shiroha_yuzhao').length&&event.player.isAlive();
+ return player.getExpansions('shiroha_yuzhao').length&&event.player.isIn();
},
content:function(){
"step 0"
@@ -8817,7 +8817,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return result.bool;
};
'step 1'
- if(result.bool){
+ if(result.bool&&game.hasPlayer(current=>current!=player)){
player.chooseTarget(lib.filter.notMe,true,'选择一名其他角色,对其造成1点雷属性伤害').set('ai',function(target){
var player=_status.event.player;
return get.damageEffect(target,player,player,'thunder');
@@ -10555,7 +10555,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
nsxuezhu:{
trigger:{player:'damageEnd',source:'damageSource'},
filter:function(event,player){
- return event.player.isAlive();
+ return event.player.isIn();
},
logTarget:'player',
content:function(){
@@ -11019,7 +11019,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){
if(get.mode()!='identity') return false;
if(!player.hasZhuSkill('yuri_wangxi')) return false;
- if(event.player.isAlive()) return false;
+ if(event.player.isIn()) return false;
if(event.player.identity=='mingzhong') return false;
var evt=event.getParent('yuri_xingdong');
return evt&&evt.name=='yuri_xingdong'&&evt.player==player;
@@ -11661,7 +11661,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'useCardToTargeted'},
direct:true,
filter:function(event,player){
- return player!=event.target&&event.targets&&event.targets.length==1&&event.target.isAlive()
+ return player!=event.target&&event.targets&&event.targets.length==1&&event.target.isIn()
&&player.isPhaseUsing()&&!player.hasSkill('nsweiyuan2')&&game.hasPlayer(function(current){
return current!=player&¤t!=event.target;
});
@@ -12104,7 +12104,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
nsxianhai:{
trigger:{global:'damageSource'},
filter:function(event,player){
- return event.source&&event.source!=player&&event.source.isAlive()&&event.source==_status.currentPhase&&
+ return event.source&&event.source!=player&&event.source.isIn()&&event.source==_status.currentPhase&&
(event.source.getStat('damage')||0)>(player.getLastStat('damage')||0)&&
!player.hasSkill('nsxianhai_round');
},
@@ -12184,7 +12184,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'judgeEnd'},
forced:true,
filter:function(event,player){
- return _status.currentPhase&&_status.currentPhase.isAlive()&&(!player.storage.nsshengyan2||!player.storage.nsshengyan2.contains(event.result.suit));
+ return _status.currentPhase&&_status.currentPhase.isIn()&&(!player.storage.nsshengyan2||!player.storage.nsshengyan2.contains(event.result.suit));
},
logTarget:function(){
return _status.currentPhase;
@@ -12495,7 +12495,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event){
if(event._notrigger.contains(event.player)) return false;
return event.num&&event.source&&event.player&&
- event.player.isAlive()&&event.source.isAlive()&&event.source!=event.player;
+ event.player.isIn()&&event.source.isIn()&&event.source!=event.player;
},
check:function(event,player){
if(player.isPhaseUsing()) return true;
@@ -12516,7 +12516,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.count--;
'step 2'
var cards=player.getCards('he',(card)=>card.hasGaintag('junkwangxi_tag'));
- if(cards.length>0&&target.isAlive()){
+ if(cards.length>0&&target.isIn()){
if(cards.length==1) event._result={bool:true,cards:cards};
else player.chooseCard('he','忘隙:交给'+get.translation(target)+'一张牌',true,function(card){
return card.hasGaintag('junkwangxi_tag');
@@ -12529,7 +12529,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
'step 4'
player.removeGaintag('junkwangxi_tag');
- if(event.count&&target.isAlive()){
+ if(event.count&&target.isIn()&&player.hasSkill('junkwangxi')){
player.chooseBool(get.prompt2('junkwangxi',target));
}
else event.finish();
@@ -12731,6 +12731,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
popup:false,
charlotte:true,
filter:function(event,player){
+ if(!game.hasPlayer(current=>current!=player)) return false;
return event.skill=='junktaoluan_backup'||event.skill=='junktaoluan5'||event.skill=='junktaoluan4';
},
content:function(){
@@ -16476,7 +16477,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{global:'wuguRemained'},
direct:true,
filter:function(event){
- return event.remained.length>0;
+ return event.remained.filterInD().length>0;
},
content:function(){
'step 0'
diff --git a/character/extra.js b/character/extra.js
index 5f8b2308e5..8e3c0a33fe 100755
--- a/character/extra.js
+++ b/character/extra.js
@@ -35,7 +35,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
db_key_hina:['female','key',3,['hina_shenshi','hina_xingzhi'],['doublegroup:key:shen']],
shen_sunce:['male','shen','1/6',['yingba','scfuhai','pinghe'],['wu']],
- shen_xunyu:['male','shen',3,['tianzuo','lingce','dinghan'],['wei']],
+ shen_xunyu:['male','shen',3,['tianzuo','lingce','dinghan'],['wei','clan:颍川荀氏']],
shen_taishici:['male','shen',4,['dulie','tspowei'],['wu']],
shen_guojia:['male','shen',3,['reshuishi','stianyi','resghuishi'],['wei']],
shen_diaochan:['female','shen',3,['meihun','huoxin'],['qun']],
@@ -624,6 +624,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
player.gain(cards,'gain2');
}
+ },
+ ai:{
+ combo:'yizhao',
}
},
sanshou:{
@@ -1110,6 +1113,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
group:'twwuhun_gain',
subSkill:{
gain:{
+ audio:'twwuhun',
trigger:{
player:'damageEnd',
source:'damageSource',
@@ -1118,7 +1122,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player,name){
if(event.player==event.source) return false;
var target=lib.skill.twwuhun_gain.logTarget(event,player);
- if(!target||!target.isAlive()) return false;
+ if(!target||!target.isIn()) return false;
return name=='damageEnd'||target.hasMark('twwuhun');
},
logTarget:function(event,player){
@@ -2274,7 +2278,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(event.zhuzhanresult){
var target=event.zhuzhanresult;
target.line(player,'green');
- target.discard(event.zhuzhanresult2.cards);
+ target.discard(event.zhuzhanresult2.cards).discarder=target;
target.draw(2);
target.popup('助战','wood');
game.log(target,'响应了',player,'发起的助战');
@@ -3065,7 +3069,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
usable:1,
filter:function(event,player){
var target=player.storage.zuoxing;
- if(!target||!target.isAlive()||target.maxHp<2) return false;
+ if(!target||!target.isIn()||target.maxHp<2) return false;
for(var i of lib.inpile){
if(get.type(i)=='trick'&&event.filterCard({name:i,isCard:true},player,event)) return true;
}
@@ -3748,7 +3752,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2,
trigger:{global:'damageEnd'},
filter:function(event,player){
- return event.player.isAlive()&&player.getExpansions('chuyuan').length0&&player.getUseValue({name:name,nature:name=='sha'?'fire':null})>0){
var temp=get.order({name:name,nature:name=='sha'?'fire':null});
@@ -5766,7 +5770,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
return 1;
},
- position:'hs',
+ position:'hes',
filterCard:function(card,player,event){
event=event||_status.event;
var filter=event._backup.filterCard;
@@ -5779,10 +5783,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
filter:function(event,player){
var filter=event.filterCard;
- if(filter({name:'sha',nature:'fire'},player,event)&&player.countCards('hs',{suit:'diamond'})) return true;
- if(filter({name:'shan'},player,event)&&player.countCards('hs',{suit:'club'})) return true;
- if(filter({name:'tao'},player,event)&&player.countCards('hs',{suit:'heart'})) return true;
- if(filter({name:'wuxie'},player,event)&&player.countCards('hs',{suit:'spade'})) return true;
+ if(filter({name:'sha',nature:'fire'},player,event)&&player.countCards('hes',{suit:'diamond'})) return true;
+ if(filter({name:'shan'},player,event)&&player.countCards('hes',{suit:'club'})) return true;
+ if(filter({name:'tao'},player,event)&&player.countCards('hes',{suit:'heart'})) return true;
+ if(filter({name:'wuxie'},player,event)&&player.countCards('hes',{suit:'spade'})) return true;
return false;
},
ai:{
@@ -5795,7 +5799,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
case 'respondShan':name='club';break;
case 'save':name='heart';break;
}
- if(!player.countCards('hs',{suit:name})) return false;
+ if(!player.countCards('hes',{suit:name})) return false;
},
order:function(item,player){
if(player&&_status.event.type=='phase'){
@@ -5804,7 +5808,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var map={sha:'diamond',tao:'heart'}
for(var i=0;i0&&player.getUseValue({name:name,nature:name=='sha'?'fire':null})>0){
var temp=get.order({name:name,nature:name=='sha'?'fire':null});
@@ -5818,9 +5822,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
hiddenCard:function(player,name){
- if(name=='wuxie'&&_status.connectMode&&player.countCards('hs')>0) return true;
- if(name=='wuxie') return player.countCards('hs',{suit:'spade'})>0;
- if(name=='tao') return player.countCards('hs',{suit:'heart'})>0;
+ if(name=='wuxie'&&_status.connectMode&&player.countCards('hes')>0) return true;
+ if(name=='wuxie') return player.countCards('hes',{suit:'spade'})>0;
+ if(name=='tao') return player.countCards('hes',{suit:'heart'})>0;
},
},
xinjuejing:{
@@ -6222,7 +6226,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
filter:function(event,player){
if(player.storage.drlt_duorui.length) return false;
- return player!=event.player&&event.player.isAlive()&&_status.currentPhase==player;
+ return player!=event.player&&event.player.isIn()&&_status.currentPhase==player;
},
check:function(event,player){
if(player.countDisabled()<5&&player.isDisabled(5)) return false;
@@ -6601,7 +6605,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
forced:true,
filter:function(event,player){
- return player!=event.player&&event.player.hasMark('drlt_jieying_mark')&&event.player.isAlive();
+ return player!=event.player&&event.player.hasMark('drlt_jieying_mark')&&event.player.isIn();
},
logTarget:'player',
content:function(){
@@ -6814,7 +6818,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
content:function(){
'step 0'
if(!event.qizheng_name){
- if(player.isAlive()) player.chooseControl('奇兵','正兵').set('prompt','请选择'+get.translation(target)+'的标记').set('choice',function(){
+ if(player.isIn()) player.chooseControl('奇兵','正兵').set('prompt','请选择'+get.translation(target)+'的标记').set('choice',function(){
var e1=1.5*get.sgn(get.damageEffect(target,player,target));
var e2=0;
if(target.countGainableCards(player,'h')>0&&!target.hasSkillTag('noh')) e2=-1;
@@ -6954,7 +6958,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
relonghun:'龙魂',
relonghun_info:'你可以将同花色的一至两张牌按下列规则使用或打出:红桃当【桃】,方块当火【杀】,梅花当【闪】,黑桃当普【无懈可击】。若你以此法使用了两张红色牌,则此牌回复值或伤害值+1。若你以此法使用了两张黑色牌,则你弃置当前回合角色一张牌。',
xinlonghun:'龙魂',
- xinlonghun_info:'你可以将你的手牌按下列规则使用或打出:红桃当【桃】,方块当火【杀】,梅花当【闪】,黑桃当普【无懈可击】。',
+ xinlonghun_info:'你可以将你的牌按下列规则使用或打出:红桃当【桃】,方块当火【杀】,梅花当【闪】,黑桃当普【无懈可击】。',
longhun:'龙魂',
longhun1:'龙魂♥︎',
longhun2:'龙魂♦︎',
diff --git a/character/huicui.js b/character/huicui.js
new file mode 100644
index 0000000000..784f861c73
--- /dev/null
+++ b/character/huicui.js
@@ -0,0 +1,10263 @@
+'use strict';
+game.import('character',function(lib,game,ui,get,ai,_status){
+ return {
+ name:'huicui',
+ connect:true,
+ character:{
+ dc_wuban:['male','shu',4,['dcyouzhan'],['clan:陈留吴氏','unseen']],
+ yue_caiwenji:['female','qun',3,['dcshuangjia','dcbeifen']],
+ liuchongluojun:['male','qun',3,['dcminze','dcjini']],
+ yuechen:['male','wei',4,['dcporui','dcgonghu'],['unseen']],
+ zhangkai:['male','qun',4,['dcxiangshu']],
+ gaoxiang:['male','shu',4,['dcchiying'],['unseen']],
+ yuanyin:['male','qun',3,['dcmoshou','dcyunjiu'],['unseen']],
+ dongwan:['female','qun',3,['dcshengdu','dcxianjiao'],['unseen']],
+ zhangchu:['female','qun',3,['dcjizhong','dcrihui','dcguangshi']],
+ peiyuanshao:['male','qun',4,['dcmoyu'],['unseen']],
+ mengjie:['male','qun',3,['dcyinlu','dcyouqi']],
+ dc_huojun:['male','shu',4,['dcgue','dcsigong']],
+ dc_sunhanhua:['female','wu',3,['dchuiling','dcchongxu']],
+ dc_sunziliufang:['male','wei',3,['dcqinshen','dcweidang']],
+ yuantanyuanxiyuanshang:['male','qun',4,['dcneifa']],
+ qiaorui:['male','qun',4,['dcaishou','dcsaowei']],
+ xianglang:['male','shu',3,['dckanji','dcqianzheng']],
+ qinlang:['male','wei',4,['dchaochong','dcjinjin']],
+ furongfuqian:['male','shu','4/6',['dcxuewei','dcyuguan']],
+ zhenghun:['male','wei',3,['dcqiangzhi','dcpitian']],
+ dc_zhaotongzhaoguang:['male','shu',4,['yizan_use','dcqingren','dclongyuan']],
+ dc_huanghao:['male','shu',3,['dcqinqing','huisheng','dccunwei']],
+ liupi:['male','qun',4,['dcjuying']],
+ dc_sp_jiaxu:['male','wei',3,['zhenlue','dcjianshu','dcyongdi']],
+ leibo:['male','qun',4,['dcsilve','dcshuaijie']],
+ gongsundu:['male','qun',4,['dczhenze','dcanliao']],
+ panghui:['male','wei',5,['dcyiyong']],
+ dc_yuejiu:['male','qun',4,['dccuijin']],
+ chenjiao:['male','wei',3,['dcxieshou','dcqingyan','dcqizi']],
+ wanglie:['male','qun',3,['dcchongwang','dchuagui']],
+ chengui:['male','qun',3,['dcyingtu','dccongshi']],
+ dc_huangquan:['male','shu',3,['dcquanjian','dctujue']],
+ yinfuren:['female','wei',3,['dcyingyu','dcyongbi']],
+ dc_lvkuanglvxiang:['male','wei',4,['dcshuhe','dcliehou']],
+ guanhai:['male','qun',4,['suoliang','qinbao']],
+ huzhao:['male','qun',3,['midu','xianwang']],
+ dc_liuba:['male','shu',3,['dczhubi','dcliuzhuan']],
+ zhangxun:['male','qun',4,['suizheng']],
+ zongyu:['male','shu',3,['zyqiao','chengshang']],
+ dc_jiling:['male','qun',4,['dcshuangren']],
+ dc_yanghu:['male','wei',3,['dcdeshao','dcmingfa']],
+ caimaozhangyun:['male','wei',4,['lianzhou','jinglan']],
+ tenggongzhu:['female','wu',3,['xingchong','liunian']],
+ dc_huangchengyan:['male','qun',3,['dcjiezhen','dczecai','dcyinshi']],
+ dc_gaolan:['male','qun',4,['xizhen']],
+ guanning:['male','qun','3/7',['dunshi']],
+ dc_jiben:['male','qun',3,['xunli','zhishi','lieyi']],
+ mamidi:['male','qun','4/6',['bingjie','zhengding']],
+ re_dengzhi:['male','shu',3,['jianliang','weimeng']],
+ fengxi:['male','wu',3,['yusui','boyan']],
+ re_miheng:['male','qun',3,['rekuangcai','reshejian']],
+ re_chendeng:['male','qun',3,['refuyuan','reyingshui','rewangzu']],
+ wanniangongzhu:['female','qun',3,['zhenge','xinghan']],
+ re_xunchen:['male','qun',3,['refenglve','anyong'],['clan:颍川荀氏']],
+ re_kanze:['male','wu',3,['xiashu','rekuanshi']],
+ lvlingqi:['female','qun',4,['guowu','zhuangrong']],
+ zhanghu:['male','wei',4,['cuijian','zhtongyuan']],
+ luyusheng:['female','wu',3,['zhente','zhiwei']],
+ huaxin:['male','wei',3,['spwanggui','xibing']],
+ mengyou:['male','qun',5,['hmmanyi','dcmanzhi'],['unseen']],
+ liuyong:['male','shu',3,['zhuning','fengxiang']],
+ dc_sunru:['female','wu',3,['xiecui','youxu']],
+ xiahoulingnv:['female','wei',4,['fuping','weilie']],
+ zhangyao:['female','wu',3,['yuanyu','xiyan']],
+ tengyin:['male','wu',3,['chenjian','xixiu']],
+ zhangxuan:['female','wu',4,['tongli','shezang']],
+ wangtao:['female','shu',3,['huguan','yaopei']],
+ wangyue:['female','shu',3,['huguan','mingluan']],
+ zhaoyan:['female','wu',3,['jinhui','qingman']],
+ heyan:['male','wei',3,['yachai','qingtan']],
+ re_sunluyu:['female','wu',3,['remeibu','remumu']],
+ re_dongbai:['female','qun',3,['relianzhu','rexiahui']],
+ zhoushan:['male','wu',4,['dcmiyun','dcdanying']],
+ dc_caiyang:['male','wei',4,['dcxunji','dcjiaofeng']],
+ xiahoujie:['male','wei',5,['liedan','zhuangdan']],
+ caoxing:['male','qun',4,['cxliushi','zhanwan']],
+ re_chunyuqiong:['male','qun',4,['recangchu','reliangying','reshishou']],
+ xingdaorong:['male','qun','4/6',['xuxie']],
+ re_panfeng:['male','qun',4,['xinkuangfu']],
+ },
+ characterSort:{
+ huicui:{
+ sp_baigei:['re_panfeng','xingdaorong','caoxing','re_chunyuqiong','xiahoujie','dc_caiyang','zhoushan'],
+ sp_caizijiaren:['re_dongbai','re_sunluyu','heyan','zhaoyan','wangtao','wangyue','zhangxuan','tengyin','zhangyao','xiahoulingnv','dc_sunru'],
+ sp_zhilan:['liuyong','wanniangongzhu','zhanghu','lvlingqi','tenggongzhu','panghui','dc_zhaotongzhaoguang','yuantanyuanxiyuanshang','yuechen'],
+ sp_guixin:['re_kanze','re_chendeng','caimaozhangyun','dc_lvkuanglvxiang','dc_gaolan','yinfuren','chengui','chenjiao','dc_sp_jiaxu','qinlang'],
+ sp_daihan:['mamidi','dc_jiling','zhangxun','dc_yuejiu','wanglie','leibo','qiaorui','dongwan','yuanyin'],
+ sp_jianghu:['guanning','huzhao','dc_huangchengyan','mengjie'],
+ sp_zongheng:['huaxin','luyusheng','re_xunchen','re_miheng','fengxi','re_dengzhi','dc_yanghu','zongyu'],
+ sp_taiping:['guanhai','liupi','peiyuanshao','zhangchu','zhangkai'],
+ sp_yanhan:['dc_liuba','dc_huangquan','furongfuqian','xianglang','dc_huojun','gaoxiang','dc_wuban'],
+ sp_jishi:['dc_jiben','zhenghun','dc_sunhanhua','liuchongluojun'],
+ sp_raoting:['dc_huanghao','dc_sunziliufang','dc_sunchen'],
+ sp_yijun:['gongsundu','mengyou'],
+ sp_zhengyin:['yue_caiwenji'],
+ }
+ },
+ skill:{
+ //吴班
+ dcyouzhan:{
+ audio:2,
+ trigger:{
+ global:['loseAfter','equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'],
+ },
+ forced:true,
+ filter:function(event,player){
+ if(player!=_status.currentPhase) return false;
+ return game.hasPlayer(current=>{
+ if(current==player) return false;
+ var evt=event.getl(current);
+ return evt&&evt.cards2.length;
+ });
+ },
+ content:function(){
+ 'step 0'
+ var targets=game.filterPlayer(current=>{
+ if(current==player) return false;
+ var evt=trigger.getl(current);
+ return evt&&evt.cards2.length;
+ });
+ event.targets=targets;
+ player.logSkill('dcyouzhan',targets);
+ 'step 1'
+ var target=targets.shift();
+ player.draw();
+ target.addTempSkill('dcyouzhan_effect');
+ target.addMark('dcyouzhan_effect',1,false);
+ target.addTempSkill('dcyouzhan_draw');
+ if(targets.length){
+ event.redo();
+ }
+ },
+ subSkill:{
+ effect:{
+ trigger:{
+ player:'damageBegin3',
+ },
+ filter:function(event,player){
+ return player.hasMark('dcyouzhan_effect');
+ },
+ forced:true,
+ charlotte:true,
+ onremove:true,
+ content:function(){
+ 'step 0'
+ trigger.num+=player.countMark('dcyouzhan_effect');
+ player.removeSkill('dcyouzhan_effect');
+ },
+ mark:true,
+ intro:{
+ content:'本回合下一次受到的伤害+#',
+ },
+ ai:{
+ damageBonus:true,
+ effect:{
+ target:function(card,player,target){
+ if(get.tag(card,'damage')) return 1+0.5*target.countMark('dcyouzhan_effect');
+ }
+ }
+ }
+ },
+ draw:{
+ trigger:{
+ global:'phaseJieshuBegin',
+ },
+ forced:true,
+ charlotte:true,
+ filter:function(event,player){
+ return !player.getHistory('damage').length;
+ },
+ content:function(){
+ player.draw(player.getHistory('lose').length);
+ },
+ },
+ }
+ },
+ //乐蔡文姬
+ dcshuangjia:{
+ audio:2,
+ trigger:{
+ global:'phaseBefore',
+ player:'enterGame'
+ },
+ forced:true,
+ filter:function(event,player){
+ return (event.name!='phase'||game.phaseNumber==0);
+ },
+ content:function(){
+ 'step 0'
+ var cards=player.getCards('h');
+ player.addGaintag(cards,'dcshuangjia_tag');
+ },
+ mod:{
+ ignoredHandcard:function(card,player){
+ if(card.hasGaintag('dcshuangjia_tag')){
+ return true;
+ }
+ },
+ cardDiscardable:function(card,player,name){
+ if(name=='phaseDiscard'&&card.hasGaintag('dcshuangjia_tag')){
+ return false;
+ }
+ },
+ globalTo:function(from,to,distance){
+ return distance+Math.min(5,to.countCards('h',card=>card.hasGaintag('dcshuangjia_tag')));
+ }
+ },
+ },
+ dcbeifen:{
+ audio:2,
+ trigger:{
+ player:['loseAfter'],
+ global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'],
+ },
+ filter:function(event,player){
+ var evt=event.getl(player);
+ if(!evt||!evt.hs||!evt.hs.length) return false;
+ if(event.name=='lose'){
+ for(var i in event.gaintag_map){
+ if(event.gaintag_map[i].contains('dcshuangjia_tag')) return true;
+ }
+ return false;
+ }
+ return player.hasHistory('lose',evt=>{
+ if(event!=evt.getParent()) return false;
+ for(var i in evt.gaintag_map){
+ if(evt.gaintag_map[i].contains('dcshuangjia_tag')) return true;
+ }
+ return false;
+ });
+ },
+ forced:true,
+ content:function(){
+ var suits=lib.suit.slice();
+ player.countCards('h',card=>{
+ if(!card.hasGaintag('dcshuangjia_tag')) return false;
+ suits.remove(get.suit(card));
+ });
+ var cards=[];
+ while(suits.length){
+ var suit=suits.shift();
+ var card=get.cardPile(cardx=>{
+ return get.suit(cardx,false)==suit;
+ });
+ if(card) cards.push(card);
+ }
+ if(cards.length){
+ player.gain(cards,'gain2');
+ }
+ },
+ mod:{
+ cardUsable:function(card,player){
+ var len=player.countCards('h');
+ var cnt=player.countCards('h',card=>card.hasGaintag('dcshuangjia_tag'));
+ if(2*cntcard.hasGaintag('dcshuangjia_tag'));
+ if(2*cnt{
+ if(!cardx.hasGaintag('dcshuangjia_tag')) return false;
+ if(card==cardx) return false;
+ suits.remove(get.suit(cardx));
+ });
+ if(suits.length) return num+suits.length*2.5;
+ }
+ },
+ },
+ },
+ //孟优
+ dcmanzhi:{
+ audio:2,
+ trigger:{player:['phaseZhunbeiBegin','phaseJieshuBegin']},
+ filter:function(event,player){
+ if(event.name=='phaseJieshu'){
+ var del=0;
+ game.getGlobalHistory('changeHp',evt=>{
+ if(evt.player!=player) return;
+ for(var phase of lib.phaseName){
+ var evtx=evt.getParent(phase);
+ if(evtx&&evtx.name==phase) del+=evt.num;
+ }
+ });
+ if(del!=0) return false;
+ }
+ return game.hasPlayer(current=>{
+ if(current==player) return false;
+ return !player.hasSkill('dcmanzhi_1')&¤t.countCards('he')||!player.hasSkill('dcmanzhi_2')&¤t.countCards('hej');
+ })
+ },
+ direct:true,
+ content:function(){
+ 'step 0'
+ if(_status.connectMode) game.broadcastAll(function(){_status.noclearcountdown=true});
+ player.chooseTarget(get.prompt2('dcmanzhi'),(card,player,target)=>{
+ if(player==target) return false;
+ return !player.hasSkill('dcmanzhi_1')&&target.countCards('he')||!player.hasSkill('dcmanzhi_2')&&target.countCards('hej');
+ });
+ 'step 1'
+ if(result.bool){
+ var target=result.targets[0];
+ event.target=target;
+ var choices=[];
+ var choiceList=[
+ '令其交给你两张牌,然后其视为使用一张无距离限制的【杀】',
+ '你获得其区域内的至多两张牌,然后交给其等量的牌并摸一张牌'
+ ];
+ var chosen=[player.hasSkill('dcmanzhi_1'),player.hasSkill('dcmanzhi_2')];
+ if(target.countCards('he')&&(!chosen[0]||trigger.name=='phaseZhunbei')) choices.push('选项一');
+ else choiceList[0]=''+choiceList[0]+(chosen[0]?'(已被选择过)':'')+'';
+ if(target.countCards('hej')&&(!chosen[1]||trigger.name=='phaseZhunbei')) choices.push('选项二');
+ else choiceList[1]=''+choiceList[1]+(chosen[1]?'(已被选择过)':'')+'';
+ if(trigger.name=='phaseJieshu') choices.push('cancel2');
+ player.chooseControl(choices).set('choiceList',choiceList).set('ai',()=>{
+ return _status.event.choice;
+ }).set('choice',function(){
+ if(target.getUseValue({name:'sha'},false)>5&&!player.hasShan()&&trigger.name=='phaseZhunbei') return 1;
+ return 0;
+ }()).set('prompt','蛮智:请选择一项');
+ }
+ else{
+ if(_status.connectMode){game.broadcastAll(function(){delete _status.noclearcountdown;game.stopCountChoose()});}
+ event.finish();
+ }
+ 'step 2'
+ if(_status.connectMode){game.broadcastAll(function(){delete _status.noclearcountdown;game.stopCountChoose()});}
+ if(result.control=='cancel2'){event.finish();return;}
+ player.logSkill('dcmanzhi',target);
+ if(result.control=='选项一'){
+ player.addTempSkill('dcmanzhi_1');
+ target.chooseCard(2,'he','蛮智:请交给'+get.translation(player)+'两张牌');
+ }
+ else{
+ player.addTempSkill('dcmanzhi_2');
+ player.gainPlayerCard(target,'hej',[1,2],true);
+ event.goto(5);
+ }
+ 'step 3'
+ if(result.bool){
+ target.give(result.cards,player);
+ }
+ else event.finish();
+ 'step 4'
+ target.chooseUseTarget('sha',true,'nodistance');
+ event.finish();
+ 'step 5'
+ if(result.bool&&target.isIn()){
+ var num=result.cards.length,hs=player.getCards('he');
+ if(!hs.length) event.finish();
+ else if(hs.lengthplayer.hasValueTarget(card),'h')){
+ if(get.position(card)=='e') return 0;
+ return 8-get.value(card);
+ }
+ return 6-get.value(card);
+ },
+ content:function(){
+ 'step 0'
+ var targets=game.filterPlayer(current=>{
+ return current.countGainableCards(player,'e');
+ });
+ if(targets.length==0) event._result={bool:false};
+ else if(targets.length==1) event._result={bool:true,targets:targets};
+ else player.chooseTarget('自固:获得一名角色装备区里的一张牌',true,(card,player,target)=>{
+ return target.countGainableCards(player,'e');
+ }).set('ai',target=>{
+ if(target==_status.event.player) return 10;
+ if(get.attitude(_status.event.player,target)<0){
+ if(target.hasCard(card=>{
+ return get.value(card,player)>=6;
+ })) return 12;
+ return 8;
+ }
+ return 0;
+ });
+ 'step 1'
+ if(result.bool){
+ var target=result.targets[0];
+ event.target=target;
+ player.gainPlayerCard('e',target,true);
+ }
+ 'step 2'
+ if(!result.bool||target==player||!result.cards||!result.cards.some(i=>get.owner(i)==player)) player.draw();
+ },
+ ai:{
+ order:function(item,player){
+ if(!player.hasSkill('dczuowei')) return 9;
+ if(player.countCards('h')==player.countCards('e')+1&&!player.hasCard(card=>player.hasValueTarget(card),'h')) return 9;
+ return 1;
+ },
+ result:{
+ player:1
+ }
+ }
+ },
+ dczuowei:{
+ audio:2,
+ trigger:{player:'useCard'},
+ filter:function(event,player){
+ return !player.hasSkill('dczuowei_ban')&&_status.currentPhase==player;
+ },
+ direct:true,
+ locked:false,
+ content:function(){
+ 'step 0'
+ var hs=player.countCards('h');
+ var es=Math.max(1,player.countCards('e'));
+ var sign=Math.sign(hs-es);
+ event.sign=sign;
+ if(sign>0) player.chooseBool(get.prompt('dczuowei'),'令'+get.translation(trigger.card)+'不可被响应').set('ai',()=>1);
+ else if(sign==0) player.chooseTarget(get.prompt('dczuowei'),'对一名其他角色造成1点伤害',lib.filter.notMe).set('ai',target=>{
+ return get.damageEffect(target,_status.event.player,_status.event.player);
+ });
+ else player.chooseBool(get.prompt('dczuowei'),'摸两张牌,然后此技能于本回合失效').set('ai',()=>1);
+ 'step 1'
+ if(!result.bool) event.finish()
+ else if(event.sign<=0&&!event.isMine()&&!event.isOnline()) game.delayx();
+ 'step 2'
+ var sign=event.sign;
+ if(sign>0){
+ player.logSkill('dczuowei');
+ trigger.directHit.addArray(game.players);
+ event.finish();
+ }
+ else if(sign==0){
+ var target=result.targets[0];
+ player.logSkill('dczuowei',target);
+ target.damage();
+ }
+ else{
+ player.logSkill('dczuowei');
+ player.draw(2);
+ player.addTempSkill('dczuowei_ban');
+ }
+ },
+ subSkill:{
+ ban:{charlotte:true}
+ },
+ mod:{
+ aiOrder:function(player,card,num){
+ if(player.hasSkill('dczuowei_ban')||_status.currentPhase!=player) return;
+ var cardsh=[],cardse=[];
+ if(Array.isArray(card.cards)){
+ cardsh.addArray(card.cards.filter(i=>get.position(i)=='h'));
+ cardse.addArray(card.cards.filter(i=>get.position(i)=='e'));
+ }
+ if(_status.currentPhase==player){
+ if(get.tag(card,'draw')||get.tag(card,'gain')){
+ if(player.countCards('h')-cardsh.length<=Math.max(1,player.countCards('e'))-cardse.length+(get.type(card)=='equip')) return num+10;
+ return num/5;
+ }
+ }
+ },
+ },
+ ai:{
+ threaten:3,
+ reverseEquip:true,
+ effect:{
+ player_use:function(card,player,target,current){
+ if(player.hasSkill('dczuowei_ban')||_status.currentPhase!=player) return;
+ if(get.type(card)=='equip'&&get.cardtag(card,'gifts')) return;
+ if(player.countCards('h')>Math.max(1,player.countCards('e'))) return [1,3];
+ }
+ }
+ }
+ },
+ //刘宠骆俊
+ dcminze:{
+ audio:2,
+ enable:'phaseUse',
+ filter:function(event,player){
+ return !player.hasSkill('dcminze_ban');
+ },
+ filterTarget:function(card,player,target){
+ if(player.getStorage('dcminze_targeted').contains(target)) return false;
+ return target.countCards('h')get.name(i,player)));
+ 'step 1'
+ if(target.countCards('h')>player.countCards('h')){
+ player.addTempSkill('dcminze_ban','phaseUseAfter');
+ }
+ },
+ ai:{
+ order:6.5,
+ expose:0.2,
+ },
+ subSkill:{
+ targeted:{onremove:true,charlotte:true},
+ ban:{charlotte:true},
+ given:{
+ charlotte:true,
+ onremove:true,
+ intro:{
+ content:'本回合以此法交出的牌名:$',
+ },
+ },
+ draw:{
+ trigger:{player:'phaseJieshuBegin'},
+ filter:function(event,player){
+ return player.getStorage('dcminze_given').length;
+ },
+ forced:true,
+ locked:false,
+ content:function(){
+ var num=Math.min(5,player.getStorage('dcminze_given').length)-player.countCards('h');
+ if(num>0) player.draw(num);
+ }
+ }
+ }
+ },
+ dcjini:{
+ audio:2,
+ trigger:{player:'damageEnd'},
+ direct:true,
+ filter:function(event,player){
+ return player.maxHp-player.countMark('dcjini_counted')>0;
+ },
+ content:function(){
+ 'step 0'
+ player.chooseCard(get.prompt2('dcjini'),[1,player.maxHp-player.countMark('dcjini_counted')],(card,player,target)=>{
+ var mod=game.checkMod(card,player,'unchanged','cardChongzhuable',player);
+ return mod=='unchanged';
+ }).set('ai',card=>{
+ return 6-get.value(card);
+ });
+ 'step 1'
+ if(result.bool){
+ var cards=result.cards;
+ player.logSkill('dcjini');
+ player.addTempSkill('dcjini_counted');
+ player.addMark('dcjini_counted',cards.length,false);
+ player.loseToDiscardpile(cards);
+ player.draw(cards.length);
+ }
+ else event.finish();
+ 'step 2'
+ if(trigger.source&&trigger.source.isIn()&&Array.isArray(result)){
+ for(var i of result){
+ if(get.name(i,player)=='sha'&&get.owner(i)==player&&get.position(i)=='h'){
+ player.chooseToUse(function(card,player,event){
+ if(get.name(card)!='sha') return false;
+ return lib.filter.filterCard.apply(this,arguments);
+ },'击逆:是否对'+get.translation(trigger.source)+'使用一张不可被响应的杀?').set('complexSelect',true).set('filterTarget',function(card,player,target){
+ if(target!=_status.event.sourcex&&!ui.selected.targets.contains(_status.event.sourcex)) return false;
+ return lib.filter.targetEnabled.apply(this,arguments);
+ }).set('sourcex',trigger.source).set('oncard',()=>{
+ _status.event.directHit.addArray(game.players);
+ });
+ break;
+ }
+ }
+ }
+ },
+ subSkill:{
+ counted:{
+ onremove:true,
+ charlotte:true
+ }
+ }
+ },
+ //乐綝
+ dcporui:{
+ audio:2,
+ trigger:{global:'phaseJieshuBegin'},
+ filter:function(event,player){
+ if(player==event.player) return false;
+ if(player.hasSkill('dcporui_round')) return false;
+ return game.hasPlayer(current=>{
+ if(current==player||current==event.player) return false;
+ return current.getHistory('lose').length>0;
+ })&&(_status.connectMode||player.hasCard({type:'basic'},'h'));
+ },
+ direct:true,
+ content:function(){
+ 'step 0'
+ player.chooseCardTarget({
+ prompt:get.prompt('dcporui'),
+ //prompt2:'弃置一张基本牌并选择一名本回合失去过牌的非当前回合的其他角色,你视为对其依次使用'+get.cnNumber(Math.max(0,player.hp)+1)+'张【杀】',
+ prompt2:get.skillInfoTranslation('dcporui',player),
+ filterCard:function(card,player){
+ if(get.type(card)!='basic') return false;
+ return lib.filter.cardDiscardable.apply(this,arguments);
+ },
+ selectCard:1,
+ targets:game.filterPlayer(current=>{
+ if(current==player||current==trigger.player) return false;
+ return current.getHistory('lose').length>0;
+ }),
+ filterTarget:function(card,player,target){
+ return _status.event.targets.contains(target);
+ },
+ ai1:function(card){
+ return 7-get.value(card);
+ },
+ ai2:function(target){
+ return get.effect(target,{name:'sha'},_status.event.player,_status.event.player);
+ }
+ });
+ 'step 1'
+ if(result.bool){
+ var target=result.targets[0],cards=result.cards;
+ event.target=target;
+ player.logSkill('dcporui',target);
+ player.discard(cards);
+ event.num2=Math.max(0,player.hp);
+ event.num=event.num2+1;
+ player.addTempSkill('dcporui_round','roundStart');
+ }
+ else event.finish();
+ 'step 2'
+ var card={name:'sha',isCard:true,storage:{dcporui:true}};
+ if(player.canUse(card,target,false)&&target.isIn()){
+ player.useCard(card,target);
+ event.num--;
+ }
+ else event.goto(4);
+ 'step 3'
+ if(event.num>0) event.goto(2);
+ 'step 4'
+ if(!player.hasMark('dcgonghu_damage')){
+ var cards=player.getCards('h');
+ if(cards.length==0) event._result={bool:false};
+ else if(cards.length<=event.num2) event._result={bool:true,cards:cards};
+ else player.chooseCard('破锐:交给'+get.translation(target)+get.cnNumber(event.num2)+'张手牌',true,event.num2);
+ }
+ else event.goto(6)
+ 'step 5'
+ if(result.bool){
+ player.give(result.cards,target);
+ }
+ 'step 6'
+ if(player.hasMark('dcgonghu_basic')){
+ if(!target.hasHistory('damage',evt=>{
+ return evt.card&&evt.card.storage&&evt.card.storage.dcporui&&evt.getParent('dcporui')==event;
+ })){
+ player.recover();
+ }
+ }
+ },
+ subSkill:{
+ round:{charlotte:true}
+ },
+ ai:{
+ expose:0.4,
+ threaten:4.8
+ }
+ },
+ dcgonghu:{
+ audio:2,
+ trigger:{
+ player:['loseAfter','damageEnd'],
+ source:'damageSource',
+ global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'],
+ },
+ forced:true,
+ filter:function(event,player){
+ if(event.name=='damage'){
+ if(player.hasMark('dcgonghu_damage')) return false;
+ return _status.currentPhase&&_status.currentPhase!=player;
+ }
+ if(player.hasMark('dcgonghu_basic')) return false;
+ var evt=event.getl(player);
+ return evt&&evt.cards2&&evt.cards2.some(i=>get.type2(i,player)=='basic');
+ },
+ group:['dcgonghu_basic','dcgonghu_trick'],
+ content:function(){
+ player.addMark('dcgonghu_'+(trigger.name=='damage'?'damage':'basic'),1,false);
+ game.log(player,'修改了技能','#g【破锐】');
+ },
+ subSkill:{
+ trick:{
+ audio:'dcgonghu',
+ trigger:{player:'useCard2'},
+ direct:true,
+ locked:true,
+ filter:function(event,player){
+ if(!player.hasMark('dcgonghu_basic')||!player.hasMark('dcgonghu_damage')) return false;
+ var card=event.card;
+ if(get.color(card,false)!='red'||get.type(card,null,true)!='trick') return false;
+ var info=get.info(card);
+ if(info.allowMultiple==false) return false;
+ if(event.targets&&!info.multitarget){
+ if(game.hasPlayer(function(current){
+ return !event.targets.contains(current)&&lib.filter.targetEnabled2(card,player,current);
+ })){
+ return true;
+ }
+ }
+ return false;
+ },
+ content:function(){
+ 'step 0'
+ var prompt2='为'+get.translation(trigger.card)+'增加一个目标'
+ player.chooseTarget(get.prompt('dcgonghu_trick'),function(card,player,target){
+ var player=_status.event.player;
+ return !_status.event.targets.contains(target)&&lib.filter.targetEnabled2(_status.event.card,player,target);
+ }).set('prompt2',prompt2).set('ai',function(target){
+ var trigger=_status.event.getTrigger();
+ var player=_status.event.player;
+ return get.effect(target,trigger.card,player,player);
+ }).set('card',trigger.card).set('targets',trigger.targets);
+ 'step 1'
+ if(result.bool){
+ if(!event.isMine()&&!event.isOnline()) game.delayx();
+ event.targets=result.targets;
+ }
+ else{
+ event.finish();
+ }
+ 'step 2'
+ if(event.targets){
+ player.logSkill('dcgonghu_trick',event.targets);
+ trigger.targets.addArray(event.targets);
+ }
+ },
+ },
+ basic:{
+ audio:'dcgonghu',
+ trigger:{player:'useCard'},
+ forced:true,
+ filter:function(event,player){
+ if(!player.hasMark('dcgonghu_basic')||!player.hasMark('dcgonghu_damage')) return false;
+ var card=event.card;
+ return (get.color(card,false)=='red'&&get.type(card,null,false)=='basic');
+ },
+ content:function(){
+ trigger.directHit.addArray(game.filterPlayer());
+ game.log(trigger.card,'不可被响应');
+ },
+ },
+ }
+ },
+ //张闿
+ dcxiangshu:{
+ audio:2,
+ trigger:{global:'phaseUseBegin'},
+ direct:true,
+ filter:function(event,player){
+ return event.player!=player&&event.player.countCards('h')>=event.player.hp;
+ },
+ content:function(){
+ 'step 0'
+ var list=[0,1,2,3,4,5,'cancel2'];
+ player.chooseControl(list).set('prompt',get.prompt2('dcxiangshu')).set('ai',()=>{
+ return _status.event.choice;
+ }).set('choice',function(){
+ if(get.attitude(player,trigger.player)>0) return 'cancel2';
+ var cards=trigger.player.getCards('h');
+ var num=0;
+ for(var card of cards){
+ if(!trigger.player.hasValueTarget(card)){
+ num++;
+ if(num>=5) break;
+ }
+ }
+ if(cards.length>=3&&Math.random()<0.5) num=Math.max(0,num-1);
+ return num;
+ }());
+ 'step 1'
+ if(result.control!='cancel2'){
+ player.logSkill('dcxiangshu',trigger.player);
+ var num=result.index;
+ player.storage.dcxiangshu_lottery=num;
+ player.addTempSkill('dcxiangshu_lottery','phaseUseAfter');
+ }
+ else event.finish();
+ 'step 2'
+ player.chooseToDiscard('相鼠:是否弃置一张牌不公布此数字?').set('ai',card=>2-get.value(card));
+ 'step 3'
+ if(!result.bool){
+ var num=player.storage.dcxiangshu_lottery;
+ player.markSkill('dcxiangshu_lottery');
+ player.popup(num);
+ game.log(player,'选择了数字','#g'+num);
+ }
+ },
+ subSkill:{
+ lottery:{
+ audio:'dcxiangshu',
+ trigger:{global:'phaseUseEnd'},
+ charlotte:true,
+ forced:true,
+ onremove:true,
+ logTarget:'player',
+ filter:function(event,player){
+ return typeof player.storage.dcxiangshu_lottery=='number'&&Math.abs(event.player.countCards('h')-player.storage.dcxiangshu_lottery)<=1;
+ },
+ content:function(){
+ var delt=Math.abs(trigger.player.countCards('h')-player.storage.dcxiangshu_lottery);
+ if(delt<=1&&trigger.player.countGainableCards('he',player)>0){
+ player.gainPlayerCard(trigger.player,'he',true);
+ }
+ if(delt==0){
+ trigger.player.damage(player);
+ }
+ },
+ intro:{content:'猜测的数字为#'}
+ }
+ }
+ },
+ //裴元绍
+ dcmoyu:{
+ audio:2,
+ enable:'phaseUse',
+ filter:function(event,player){
+ return !player.hasSkill('dcmoyu_ban');
+ },
+ filterTarget:function(card,player,target){
+ return player!=target&&!player.getStorage('dcmoyu_clear').contains(target)&&target.countGainableCards(player,'hej');
+ },
+ global:'dcmoyu_ai',
+ content:function(){
+ 'step 0'
+ player.addTempSkill('dcmoyu_clear');
+ player.markAuto('dcmoyu_clear',[target]);
+ player.gainPlayerCard(target,'hej',true);
+ 'step 1'
+ var num=player.getStorage('dcmoyu_clear').length;
+ target.chooseToUse(function(card,player,event){
+ if(get.name(card)!='sha') return false;
+ return lib.filter.filterCard.apply(this,arguments);
+ },'是否对'+get.translation(player)+'使用一张【杀】(伤害基数为'+num+')?').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){
+ if(target!=_status.event.sourcex&&!ui.selected.targets.contains(_status.event.sourcex)) return false;
+ return lib.filter.filterTarget.apply(this,arguments);
+ }).set('sourcex',player).set('num',num).set('oncard',card=>{
+ var evt=_status.event;
+ evt.baseDamage=evt.num;
+ });
+ 'step 2'
+ if(result.bool){
+ if(player.hasHistory('damage',evt=>{
+ return evt.card&&evt.card.name=='sha'&&evt.getParent(4)==event;
+ })) player.addTempSkill('dcmoyu_ban');
+ }
+ },
+ subSkill:{
+ clear:{
+ charlotte:true,
+ onremove:true,
+ },
+ ban:{charlotte:true},
+ ai:{
+ ai:{
+ effect:{
+ target:function(card,player,target,current){
+ if(get.type(card)=='delay'&¤t<0){
+ var currentx=_status.currentPhase;
+ if(!currentx||!currentx.isIn()) return;
+ var list=game.filterPlayer(current=>{
+ if(current==target) return true;
+ if(!current.hasSkill('dcmoyu')) return false;
+ if(current.hasJudge('lebu')) return false;
+ return get.attitude(current,target)>0;
+ });
+ list.sortBySeat(currentx);
+ if(list.indexOf(target)!=0) return 'zerotarget';
+ }
+ },
+ },
+ }
+ }
+ },
+ ai:{
+ order:9,
+ threaten:2.4,
+ result:{
+ target:function(player,target){
+ var eff=get.effect(target,{name:'shunshou'},player,player);
+ if(eff>0) return eff/10;
+ if(player.hasShan()&&!target.hasSkillTag('directHit_ai',true,{
+ target:player,
+ card:{name:'sha'},
+ },true)) return eff;
+ if(player.getStorage('dcmoyu_clear').length||player.hp+player.countCards('hs','tao')<=1) return 0;
+ return eff;
+ }
+ }
+ }
+ },
+ //张楚
+ dcjizhong:{
+ audio:2,
+ enable:'phaseUse',
+ usable:1,
+ filterTarget:lib.filter.notMe,
+ selectTarget:1,
+ content:function(){
+ 'step 0'
+ target.draw(2);
+ 'step 1'
+ var marked=target.hasMark('dcjizhong');
+ if(marked){
+ if(target.countCards('h')) target.chooseToDiscard('集众:弃置三张手牌',3,true);
+ event.finish();
+ }
+ else{
+ target.chooseToDiscard('集众:弃置三张手牌,或点击“取消”获得“信众”标记',3);
+ }
+ 'step 2'
+ if(!result.bool){
+ target.addMark('dcjizhong',1);
+ }
+ },
+ marktext:'信',
+ intro:{
+ name:'信众',
+ name2:'信众',
+ markcount:()=>0,
+ content:'已成为信徒',
+ },
+ ai:{
+ order:9.5,
+ result:{
+ target:function(player,target){
+ if(get.attitude(player,target)>0) return 1;
+ var num=target.countCards('h');
+ if(num<=1) return -num;
+ return -1/(num/2+1);
+ }
+ }
+ }
+ },
+ dcrihui:{
+ audio:2,
+ trigger:{player:'useCardAfter'},
+ usable:1,
+ filter:function(event,player){
+ if(!event.targets||event.targets.length!=1||event.targets[0]==player) return false;
+ var card=event.card;
+ var target=event.targets[0];
+ var marked=target.hasMark('dcjizhong');
+ return (get.type(card)=='trick'||get.color(card)=='black'&&get.type(card)=='basic')&&
+ (marked||!marked&&game.hasPlayer(current=>current.hasMark('dcjizhong')));
+ },
+ direct:true,
+ content:function(){
+ 'step 0'
+ var target=trigger.targets[0];
+ var card={name:trigger.card.name,nature:trigger.card.nature,isCard:true};
+ event.target=target;
+ event.card=card;
+ if(target.hasMark('dcjizhong')) player.gainPlayerCard(get.prompt('dcrihui',target),target,'hej').set('logSkill',['dcrihui',target]);
+ else{
+ player.chooseBool(get.prompt('dcrihui',target),'令所有有“信众”的角色依次视为对其使用一张'+get.translation(card)).set('ai',()=>{
+ return _status.event.bool;
+ }).set('bool',function(){
+ var eff=0;
+ game.countPlayer(current=>{
+ if(!current.hasMark('dcjizhong')) return;
+ eff+=get.effect(target,card,current,player);
+ });
+ return eff>0;
+ }());
+ }
+ 'step 1'
+ if(!result.bool){
+ player.storage.counttrigger.dcrihui--;
+ event.finish();
+ return;
+ }
+ if(target.hasMark('dcjizhong')) event.finish();
+ else{
+ player.logSkill('dcrihui',target);
+ event.targets=game.filterPlayer(current=>current.hasMark('dcjizhong'));
+ event.targets.sortBySeat(_status.currentPhase);
+ }
+ 'step 2'
+ var current=event.targets.shift();
+ if(current.canUse(card,target,false)){
+ current.useCard(card,target,false);
+ }
+ if(event.targets.length) event.redo();
+ }
+ },
+ dcguangshi:{
+ audio:2,
+ trigger:{player:'phaseZhunbeiBegin'},
+ filter:function(event,player){
+ return !game.hasPlayer(current=>current!=player&&!current.hasMark('dcjizhong'));
+ },
+ forced:true,
+ content:function(){
+ player.loseHp();
+ player.draw(2);
+ }
+ },
+ //董绾
+ dcshengdu:{
+ audio:2,
+ trigger:{player:'phaseBegin'},
+ direct:true,
+ content:function(){
+ 'step 0'
+ if(target) event._result={bool:true,targets:[target]};
+ else player.chooseTarget(get.prompt2('dcshengdu'),lib.filter.notMe).set('ai',target=>{
+ var player=_status.event.player;
+ var att=get.attitude(player,target);
+ var eff=get.effect(target,{
+ name:'sha',
+ storage:{dcxianjiao:true},
+ },player,player);
+ var value=att/5;
+ if(value<0) value=-value/1.3;
+ value=Math.max(value-eff/20,0.01);
+ var skills=target.getSkills(null,false,false);
+ for(var skill of skills){
+ var str=get.skillInfoTranslation(skill,target);
+ if(/摸牌阶段[^少放弃]{0,8}摸/.test(str)) value+=Math.random()/2+1.5;
+ }
+ return value;
+ });
+ 'step 1'
+ if(result.bool){
+ var target=result.targets[0];
+ player.logSkill('dcshengdu',target);
+ target.addSkill('dcshengdu_effect');
+ target.markAuto('dcshengdu_effect',[player]);
+ }
+ },
+ subSkill:{
+ effect:{
+ trigger:{player:'gainAfter'},
+ charlotte:true,
+ forced:true,
+ popup:false,
+ filter:function(event,player){
+ return event.getParent(2).name=='phaseDraw';
+ },
+ content:function(){
+ 'step 0'
+ var targets=player.getStorage('dcshengdu_effect');
+ event.targets=targets.sortBySeat(player);
+ 'step 1'
+ var target=targets.shift();
+ if(target.isIn()){
+ target.logSkill('dcshengdu_effect',player);
+ target.draw(trigger.cards.length);
+ }
+ if(targets.length) event.redo();
+ 'step 2'
+ player.removeSkill('dcshengdu_effect');
+ game.delayx();
+ },
+ marktext:'绞',
+ intro:{
+ content:'下个摸牌阶段获得牌后,$摸等量的牌'
+ }
+ }
+ }
+ },
+ dcxianjiao:{
+ audio:2,
+ enable:'phaseUse',
+ usable:1,
+ position:'hs',
+ viewAs:{
+ name:'sha',
+ storage:{dcxianjiao:true}
+ },
+ filterCard:function(card,player){
+ if(ui.selected.cards.length){
+ return get.color(card)!=get.color(ui.selected.cards[0]);
+ }
+ return true;
+ },
+ selectCard:2,
+ complexCard:true,
+ check:function(card){
+ return 6-get.value(card);
+ },
+ precontent:function(){
+ player.addTempSkill('dcxianjiao_after');
+ event.getParent().addCount=false;
+ },
+ ai:{
+ order:function(item,player){
+ return get.order({name:'sha'})+0.1;
+ },
+ },
+ locked:false,
+ mod:{
+ targetInRange:function(card){
+ if(card.storage&&card.storage.dcxianjiao) return true;
+ },
+ },
+ subSkill:{
+ after:{
+ trigger:{global:'useCardAfter'},
+ forced:true,
+ direct:true,
+ charlotte:true,
+ filter:function(event,player){
+ return event.card.name=='sha'&&event.card.storage&&event.card.storage.dcxianjiao;
+ },
+ content:function(){
+ 'step 0'
+ var damaged=game.hasPlayer2(current=>{
+ return current.hasHistory('damage',evt=>evt.card==trigger.card);
+ });
+ var targets=trigger.targets.filter(i=>i.isIn());
+ player.logSkill('dcxianjiao_after',targets);
+ if(damaged){
+ for(var target of targets){
+ target.loseHp();
+ }
+ }
+ else{
+ for(var target of targets){
+ var next=game.createEvent('dcshengdu',false);
+ next.player=player;
+ next.target=target;
+ next.setContent(lib.skill.dcshengdu.content);
+ }
+ }
+ }
+ }
+ }
+ },
+ //袁胤
+ dcmoshou:{
+ audio:2,
+ trigger:{target:'useCardToTargeted'},
+ init:function(player,skill){
+ if(typeof player.storage[skill]!='number') player.storage[skill]=0;
+ },
+ filter:function(event,player){
+ return get.color(event.card)=='black'&&event.player!=player;
+ },
+ frequent:true,
+ prompt2:function(event,player){
+ var num=player.getAllHistory('useSkill',evt=>evt.skill=='dcmoshou').length%3+1;
+ return '摸'+get.cnNumber(num)+'张牌';
+ },
+ content:function(){
+ var num=player.getAllHistory('useSkill',evt=>evt.skill=='dcmoshou').length;
+ player.storage.dcmoshou=num;
+ player.syncStorage('dcmoshou');
+ player.markSkill('dcmoshou');
+ num=(num-1)%3+1;
+ player.draw(num);
+ },
+ mark:true,
+ marktext:'守',
+ intro:{
+ markcount:function(storage,player){
+ if(typeof storage!='number') return 1;
+ return storage%3+1;
+ },
+ content:'本局游戏已发动过$次技能',
+ }
+ },
+ dcyunjiu:{
+ audio:2,
+ trigger:{global:'dieAfter'},
+ direct:true,
+ content:function(){
+ 'step 0'
+ var evt=trigger.player.getHistory('lose',evtx=>{
+ return evtx.getParent(2)==trigger;
+ })[0];
+ if(!evt) event.finish();
+ else{
+ var cards=[];
+ //冷知识,角色死亡后只有手牌区和装备区的牌是被系统弃置的,其余牌的处理方式均为置入弃牌堆
+ cards.addArray(evt.hs).addArray(evt.es);
+ event.cards=cards.filterInD('d');
+ var num=cards.length;
+ if(num){
+ event.videoId=lib.status.videoId++;
+ var func=function(cards,id){
+ var num=cards.length;
+ var dialog=ui.create.dialog(get.prompt('dcyunjiu'),'弃置'+get.cnNumber(num)+'张牌,令一名其他角色获得以下这些牌
',cards);
+ dialog.videoId=id;
+ return dialog;
+ };
+ if(player.isOnline2()){
+ player.send(func,cards,event.videoId);
+ }
+ event.dialog=func(cards,event.videoId);
+ if(player!=game.me||_status.auto){
+ event.dialog.style.display='none';
+ }
+ player.chooseCardTarget({
+ prompt:false,
+ filterTarget:lib.filter.notMe,
+ filterCard:lib.filter.cardDiscardable,
+ selectCard:num,
+ position:'he',
+ goon:function(){
+ if(!game.hasPlayer(current=>get.attitude(player,current))>0) return false;
+ var value=0;
+ for(var card of cards){
+ value+=get.value(card,player,'raw')-1.2;
+ }
+ return value>0;
+ }(),
+ ai1:function(card){
+ if(_status.event.goon){
+ if(ui.selected.cards.length==_status.event.selectCard[1]-1&&ui.selected.cards.length>0) return 7-get.value(card);
+ return 5.5-get.value(card);
+ }
+ return 0;
+ },
+ ai2:function(target){
+ return get.attitude(_status.event.player,target)/Math.sqrt(target.countCards('h')+1);
+ }
+ });
+ }
+ else event.finish();
+ }
+ 'step 1'
+ if(player.isOnline2()){player.send('closeDialog',event.videoId)}
+ event.dialog.close();
+ if(result.bool){
+ var cardsx=result.cards,target=result.targets[0];
+ player.logSkill('dcyunjiu',target);
+ player.discard(cardsx);
+ target.gain(cards.filterInD('d'),'gain2').giver=player;
+ }
+ else event.finish();
+ 'step 2'
+ player.gainMaxHp();
+ player.recover();
+ }
+ },
+ //高翔
+ dcchiying:{
+ audio:2,
+ enable:'phaseUse',
+ usable:1,
+ filterTarget:function(card,player,target){
+ return target.hp<=player.hp;
+ },
+ content:function(){
+ 'step 0'
+ var targets=game.filterPlayer(current=>target.inRange(current)&¤t!=player).sortBySeat(player);
+ event.targets=targets;
+ 'step 1'
+ var current=targets.shift();
+ if(current.countCards('he')) current.chooseToDiscard('驰应:请弃置一张牌','he',true);
+ if(targets.length) event.redo();
+ 'step 2'
+ if(target!=player){
+ var cards=[];
+ game.getGlobalHistory('cardMove',evt=>{
+ if(evt.getParent(3)==event){
+ cards.addArray(evt.cards.filter(card=>get.type(card)=='basic'));
+ }
+ });
+ cards=cards.filterInD('d');
+ if(cards.length) target.gain(cards,'gain2');
+ }
+ },
+ ai:{
+ order:6,
+ result:{
+ target:function(player,target){
+ var targets=game.filterPlayer(current=>target.inRange(current)&¤t!=player);
+ var eff=0;
+ for(var targetx of targets){
+ var effx=get.effect(targetx,{name:'guohe_copy2'},player,target);
+ if(get.attitude(player,targetx)<0) effx/=2;
+ eff+=effx;
+ }
+ return (target==player?0.5:1)*eff*(get.attitude(player,target)<=0?0.75:1);
+ }
+ }
+ }
+ },
+ //霍峻
+ dcgue:{
+ audio:2,
+ enable:['chooseToUse','chooseToRespond'],
+ hiddenCard:function(player,name){
+ if(player.getStorage('dcgue').contains(_status.currentPhase)) return false;
+ return name=='sha'||name=='shan';
+ },
+ filter:function(event,player){
+ //if(event.dcgue||event.type=='wuxie'||player==_status.currentPhase||player.getStorage('dcgue').contains(_status.currentPhase)) return false;
+ if(event.dcgue||event.type=='wuxie'||player==_status.currentPhase) return false;
+ if(!player.countCards('h')||player.hasSkill('dcgue_blocker',null,null,false)) return false;
+ for(var name of ['sha','shan']){
+ if(event.filterCard({name:name,isCard:true},player,event)) return true;
+ }
+ return false;
+ },
+ chooseButton:{
+ dialog:function(event,player){
+ var vcards=[];
+ for(var name of ['sha','shan']){
+ var card={name:name,isCard:true};
+ if(event.filterCard(card,player,event)) vcards.push(['基本','',name]);
+ }
+ return ui.create.dialog('孤扼',[vcards,'vcard'],'hidden');
+ },
+ check:function(button){
+ if(_status.event.player.countCards('h',{name:['sha','shan']})>1) return 0;
+ return 1;
+ },
+ backup:function(links,player){
+ return {
+ filterCard:()=>false,
+ selectCard:-1,
+ viewAs:{
+ name:links[0][2],
+ isCard:true,
+ },
+ popname:true,
+ precontent:function(){
+ 'step 0'
+ player.logSkill('dcgue');
+ player.addTempSkill('dcgue_blocker');
+ player.showHandcards();
+ delete event.result.skill;
+ 'step 1'
+ if(player.countCards('h',{name:['sha','shan']})>1){
+ var evt=event.getParent();
+ evt.set('dcgue',true);
+ evt.goto(0);
+ delete evt.openskilldialog;
+ return;
+ }
+ //else player.markAuto('dcgue',[_status.currentPhase]);
+ game.delayx();
+ },
+ }
+ },
+ prompt:function(links,player){
+ return '展示所有手牌'+(player.countCards('h',{name:['sha','shan']})<=1?',然后视为使用【'+get.translation(links[0][2])+'】':'');
+ }
+ },
+ subSkill:{blocker:{charlotte:true}},
+ //intro:{content:'已于$的回合发动过技能'},
+ ai:{
+ order:1,
+ respondSha:true,
+ respondShan:true,
+ skillTagFilter:function(player,tag,arg){
+ //if(player.getStorage('dcgue').contains(_status.currentPhase)) return false;
+ if(player.countCards('h',{name:['sha','shan']})>1) return false;
+ },
+ result:{
+ player:function(player){
+ if(player.countCards('h',{name:['sha','shan']})>1) return 0;
+ return 1;
+ }
+ }
+ }
+ },
+ dcsigong:{
+ audio:2,
+ trigger:{global:'phaseEnd'},
+ filter:function(event,player){
+ if(player.hasSkill('dcsigong_round')) return false;
+ if(event.player==player||!event.player.isIn()) return false;
+ if(!player.canUse('sha',event.player,false)) return false;
+ var respondEvts=[];
+ game.countPlayer2(current=>respondEvts.addArray(current.getHistory('useCard')).addArray(current.getHistory('respond')));
+ respondEvts=respondEvts.filter(i=>i.respondTo).map(evt=>evt.respondTo);
+ return event.player.hasHistory('useCard',evt=>{
+ return respondEvts.some(list=>list[1]==evt.card);
+ });
+ },
+ direct:true,
+ content:function(){
+ 'step 0'
+ var num=1-player.countCards('h');
+ event.num=num;
+ var prompt2='';
+ if(num>=0){
+ var next=player.chooseBool().set('ai',()=>_status.event.goon);
+ prompt2+=(num>0?'摸一张牌,':'')+'视为对'+get.translation(trigger.player)+'使用一张【杀】(伤害基数+1)';
+ }
+ else{
+ var next=player.chooseToDiscard(-num).set('ai',card=>{
+ if(_status.event.goon) return 5.2-get.value(card);
+ return 0;
+ }).set('logSkill',['dcsigong',trigger.player]);
+ prompt2+='将手牌数弃置至1,视为对'+get.translation(trigger.player)+'使用一张【杀】(伤害基数+1)';
+ }
+ next.set('prompt',get.prompt('dcsigong',trigger.player));
+ next.set('prompt2',prompt2);
+ next.set('goon',get.effect(trigger.player,{name:'sha'},player,player)>0);
+ 'step 1'
+ if(result.bool){
+ if(num>=0) player.logSkill('dcsigong',trigger.player);
+ if(num>0) player.draw(num,'nodelay');
+ event.num=Math.max(1,Math.abs(num));
+ }
+ else event.finish();
+ 'step 2'
+ if(player.canUse('sha',trigger.player,false)){
+ player.addTempSkill('dcsigong_check');
+ player.useCard({name:'sha',isCard:true},trigger.player,false).set('shanReq',num).set('oncard',card=>{
+ var evt=_status.event;
+ evt.baseDamage++;
+ for(var target of evt.targets){
+ var id=target.playerid;
+ var map=evt.customArgs;
+ if(!map[id]) map[id]={};
+ map[id].shanRequired=evt.shanReq;
+ }
+ });
+ }
+ },
+ subSkill:{
+ round:{charlotte:true},
+ check:{
+ charlotte:true,
+ forced:true,
+ popup:false,
+ trigger:{source:'damageSource'},
+ filter:function(event,player){
+ return event.card&&event.card.name=='sha'&&event.getParent(3).name=='dcsigong';
+ },
+ content:function(){
+ player.addTempSkill('dcsigong_round','roundStart');
+ }
+ }
+ }
+ },
+ //孙寒华
+ dchuiling:{
+ audio:2,
+ trigger:{player:'useCard'},
+ forced:true,
+ direct:true,
+ filter:function(){
+ return ui.discardPile.childNodes.length>0;
+ },
+ onremove:true,
+ mark:true,
+ marktext:'灵',
+ intro:{
+ name2:'灵',
+ mark:function(dialog,storage,player){
+ dialog.addText('共有'+(storage||0)+'个标记');
+ dialog.addText('注:图标的颜色代表弃牌堆中较多的颜色');
+ },
+ },
+ global:'dchuiling_hint',
+ content:function(){
+ 'step 0'
+ var mark=false;
+ var red=0,black=0;
+ for(var i=0;iblack){
+ player.logSkill('dchuiling');
+ player.recover();
+ event.finish();
+ if(get.color(trigger.card)=='black') mark=true;
+ event.logged=true;
+ }
+ else{
+ if(!event.isMine()&&!event.isOnline()) game.delayx();
+ player.chooseTarget(get.prompt('dchuiling'),'弃置一名角色的一张牌',(card,player,target)=>{
+ return target.countDiscardableCards(player,'he')>0;
+ }).set('ai',target=>{
+ return get.effect(target,{name:'guohe_copy2'},_status.event.player);
+ });
+ if(get.color(trigger.card)=='red') mark=true;
+ }
+ if(mark){
+ if(!event.logged) player.logSkill('dchuiling');
+ player.addMark('dchuiling',1);
+ event.logged=true;
+ }
+ 'step 1'
+ if(result.bool){
+ var target=result.targets[0];
+ if(!event.logged) player.logSkill('dchuiling',target);
+ else player.line(target);
+ player.discardPlayerCard(target,'he',true);
+ }
+ },
+ subSkill:{
+ hint:{
+ trigger:{
+ global:['loseAfter','loseAsyncAfter','cardsDiscardAfter','equipAfter'],
+ },
+ forced:true,
+ popup:false,
+ lastDo:true,
+ forceDie:true,
+ forceOut:true,
+ filter:function(event,player){
+ if(event._dchuiling_checked) return false;
+ event._dchuiling_checked=true;
+ var cards=event.getd();
+ if(!cards.filterInD('d').length) return false;
+ return true;
+ },
+ markColor:[
+ ['rgba(241, 42, 42, 0.75)', 'black'],
+ ['',''],
+ ['rgba(18, 4, 4, 0.75)', 'rgb(200, 200, 200)']
+ ],
+ content:function(){
+ 'step 0'
+ var red=0,black=0;
+ for(var i=0;i灵';
+ for(var player of game.players){
+ if(player.marks.dchuiling){
+ player.marks.dchuiling.firstChild.style.backgroundColor=bgColor;
+ player.marks.dchuiling.firstChild.innerHTML=text;
+ }
+ }
+ },Math.sign(black-red)+1);
+ },
+ }
+ },
+ mod:{
+ aiOrder:function(player,card,num){
+ if(get.itemtype(card)!='card') return;
+ var len=ui.discardPile.childNodes.length;
+ if(!len){
+ var type=get.type(card);
+ if(type=='basic'||type=='trick'){
+ if(player.getDamagedHp()>0){
+ return num+(get.color(card)=='red'?15:10);
+ }
+ return num+10;
+ }
+ return;
+ }
+ if(len>40) return;
+ var red=0,black=0;
+ for(var i=0;i0){
+ return num+(get.color(card)=='red'?15:10);
+ }
+ return num+10;
+ }
+ return;
+ }
+ else{
+ var color=get.color(card);
+ if(color=='red'&&redblack) return num+10;
+ }
+ },
+ }
+ },
+ dcchongxu:{
+ audio:2,
+ enable:'phaseUse',
+ limited:true,
+ skillAnimation:true,
+ animationColor:'wood',
+ derivation:['dctaji','dcqinghuang'],
+ filterCard:()=>false,
+ selectCard:[0,1],
+ prompt:function(){
+ return '限定技。你可以失去〖汇灵〗,增加'+Math.min(game.countPlayer(),_status.event.player.countMark('dchuiling'))+'点体力上限,然后获得〖踏寂〗和〖清荒〗。'
+ },
+ filter:function(event,player){
+ return player.countMark('dchuiling')>=4;
+ },
+ content:function(){
+ 'step 0'
+ player.awakenSkill('dcchongxu');
+ player.gainMaxHp(Math.min(game.countPlayer(),player.countMark('dchuiling')));
+ player.removeSkill('dchuiling');
+ 'step 1'
+ player.addSkillLog('dctaji');
+ player.addSkillLog('dcqinghuang');
+ },
+ ai:{
+ order:function(itemp,player){
+ if(player.hasCard(card=>{
+ return get.type(card)!='equip'&&player.getUseValue(card)>1;
+ },'h')) return 12;
+ return 0.1;
+ },
+ result:{
+ player:function(player){
+ var count=player.countMark('dchuiling');
+ if(count>=game.countPlayer()-1) return 1;
+ return (count>=6||player.hp<=2)?1:0;
+ }
+ }
+ }
+ },
+ dctaji:{
+ audio:2,
+ trigger:{
+ player:'loseAfter',
+ global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'],
+ },
+ forced:true,
+ locked:false,
+ filter:function(event,player){
+ var evt=event.getl(player);
+ return evt&&evt.hs&&evt.hs.length;
+ },
+ content:function(){
+ 'step 0'
+ var evt=trigger.getParent();
+ var effects=[
+ ['useCard',function(){
+ 'step 0'
+ var targets=game.filterPlayer(current=>{
+ return current.countDiscardableCards(player,'he')&¤t!=player;
+ });
+ if(!targets.length) event.finish();
+ else player.chooseTarget('踏寂:弃置其他角色一张牌',true,(card,player,target)=>{
+ return _status.event.targets.contains(target);
+ }).set('targets',targets).set('ai',target=>{
+ return get.effect(target,{name:'guohe_copy2'},_status.event.player);
+ });
+ 'step 1'
+ if(result.bool){
+ var target=result.targets[0];
+ player.line(target);
+ player.discardPlayerCard(target,'he',true);
+ }
+ }],
+ ['respond',function(){
+ player.draw();
+ }],
+ ['discard',function(){
+ player.recover();
+ }],
+ ['other',function(){
+ player.addSkill('dctaji_damage');
+ player.addMark('dctaji_damage',1,false);
+ game.log(player,'下一次对其他角色造成的伤害','#g+1');
+
+ }]
+ ];
+ var name=evt.name;
+ if(trigger.name=='loseAsync') name=evt.type;
+ var list=['useCard','respond','discard','other'];
+ if(!list.contains(name)) name='other';
+ for(var i=0;i<1+player.countMark('dcqinghuang_add');i++){
+ if(!list.length) break;
+ if(!list.contains(name)) name=list.randomRemove(1)[0];
+ if(name=='useCard') list.remove('useCard');
+ for(var effect of effects){
+ if(effect[0]==name){
+ list.remove(name);
+ var next=game.createEvent('dctaji_'+name);
+ next.player=player;
+ next.setContent(effect[1]);
+ break;
+ }
+ }
+ }
+ },
+ subSkill:{
+ damage:{
+ trigger:{source:'damageBegin3'},
+ forced:true,
+ charlotte:true,
+ onremove:true,
+ filter:function(event,player){
+ return event.player!=player;
+ },
+ content:function(){
+ trigger.num+=player.countMark('dctaji_damage');
+ player.removeSkill('dctaji_damage');
+ },
+ intro:{
+ content:'下次对其他角色造成伤害时,此伤害+#',
+ }
+ }
+ }
+ },
+ dcqinghuang:{
+ audio:2,
+ trigger:{player:'phaseUseBegin'},
+ filter:function(event,player){
+ return player.maxHp>1;
+ },
+ check:function(event,player){
+ var num1=player.countCards('h');
+ var num2=player.countCards('h',card=>player.hasValueTarget(card));
+ var num3=player.getHandcardLimit();
+ if(player.isDamaged()){
+ return num2>1||num1-num2-num3>0;
+ }
+ else{
+ return num2>2+Math.max(0,3-player.hp)||player.hp>2&&num1-num2-num3>2;
+ }
+ },
+ content:function(){
+ player.loseMaxHp();
+ player.addTempSkill('dcqinghuang_add');
+ player.addMark('dcqinghuang_add',1,false);
+ },
+ subSkill:{
+ add:{
+ charlotte:true,
+ onremove:true,
+ }
+ }
+ },
+ //孟节
+ dcyinlu:{
+ audio:2,
+ trigger:{
+ global:'phaseBefore',
+ player:'enterGame',
+ },
+ forced:true,
+ locked:false,
+ derivation:['dcyinlu_lequan','dcyinlu_huoxi','dcyinlu_zhangqi','dcyinlu_yunxiang'],
+ global:['dcyinlu_lequan','dcyinlu_huoxi','dcyinlu_zhangqi','dcyinlu_yunxiang'],
+ group:'dcyinlu_move',
+ filter:function(event,player){
+ return (event.name!='phase'||game.phaseNumber==0);
+ },
+ hasMark:function(target){
+ return lib.skill.dcyinlu.derivation.some(i=>target.hasMark(i));
+ },
+ content:function(){
+ 'step 0'
+ event.marks=lib.skill.dcyinlu.derivation.slice(0,3);
+ if(game.countPlayer()<=2) event.goto(3);
+ 'step 1'
+ player.chooseTarget('引路:令三名角色分别获得〖引路〗标记',true,3).set('targetprompt',()=>{
+ return get.translation(lib.skill.dcyinlu.derivation[ui.selected.targets.length-1]);
+ }).set('complexSelect',true).set('ai',target=>{
+ var player=_status.event.player;
+ if(ui.selected.targets.length==2) return get.effect(target,{name:'losehp'},player,player);
+ return get.attitude(player,target);
+ });
+ 'step 2'
+ if(result.bool){
+ var targets=result.targets;
+ player.line(targets);
+ for(var i=0;i