7;
},
forced:true,
direct:true,
intro:{
markcount:'expansion',
content:'expansion',
},
content:function(){
'step 0'
var num=player.countCards('h')-7;
player.chooseCard('佛宗:将'+get.cnNumber(num)+'张手牌置于武将上',true,num);
'step 1'
if(result.bool){
var cards=result.cards;
player.logSkill('dcfozong');
player.addToExpansion(cards,player,'give').gaintag.add('dcfozong');
}
'step 2'
var cards=player.getExpansions('dcfozong');
if(cards.length<7) event.finish();
else{
event.targets=game.filterPlayer(i=>i!=player).sortBySeat(player);
game.delayx();
}
'step 3'
var target=targets.shift();
event.target=target;
player.line(target);
var cards=player.getExpansions('dcfozong');
if(!cards.length) event._result={bool:false};
else target.chooseButton(['###佛宗###获得一张牌并令'+get.translation(player)+'回复1点体力,或点击“取消”令其失去1点体力
',cards]).set('ai',button=>{
if(_status.event.refuse) return get.value(button.link)-7.5;
return get.value(button.link);
}).set('refuse',get.attitude(target,player)<1&&get.effect(player,{name:'losehp'},player,target)>0);
'step 4'
if(result.bool){
var card=result.links[0];
target.gain(card,'give',player);
player.recover(target);
}
else player.loseHp();
'step 5'
if(targets.length) event.goto(3);
},
ai:{halfneg:true}
},
//周善
dcmiyun:{
audio:2,
trigger:{global:'roundStart'},
forced:true,
direct:true,
group:'dcmiyun_lose',
content:function(){
'step 0'
if(player.hasCard(card=>card.hasGaintag('dcmiyun_tag'),'h')){
player.chooseCardTarget({
prompt:'密运:将包括“安”在内的任意张手牌交给一名其他角色',
forced:true,
filterTarget:lib.filter.notMe,
selectCard:[1,Infinity],
filterOk:function(){
for(var card of ui.selected.cards){
if(card.hasGaintag('dcmiyun_tag')) return true;
}
return false;
},
goon:game.hasPlayer(current=>player!=current&&get.attitude(player,current)>0),
ai1:function(card){
if(get.itemtype(card)!='card') return 0;
if(card.hasGaintag('dcmiyun_tag')) return 100;
if(_status.event.goon) return 8-get.value(card);
return -get.value(card);
},
ai2:function(target){
return get.attitude(_status.event.player,target);
}
});
}
else event.goto(3);
'step 1'
if(result.bool){
var target=result.targets[0],cards=result.cards;
player.logSkill('dcmiyun',target);
player.give(cards,target);
}
else event.goto(3);
'step 2'
player.drawTo(player.maxHp);
'step 3'
if(game.hasPlayer(current=>current!=player&¤t.countGainableCards(player,'he'))){
player.chooseTarget('密运:获得一名其他角色的一张牌,称为“安”',true,(card,player,target)=>{
return target!=player&&target.countGainableCards(player,'he');
}).set('ai',target=>{
return get.effect(target,{name:'shunshou'},_status.event.player,_status.event.player);
})
}
else event.finish();
'step 4'
if(result.bool){
var target=result.targets[0];
player.logSkill('dcmiyun',target);
player.gainPlayerCard(target,true,'visibleMove').chooseonly=true;
}
else event.finish();
'step 5'
if(result.bool){
player.gain(result.cards).gaintag.add('dcmiyun_tag');
}
},
mod:{
aiValue:function(player,card,num){
if(get.itemtype(card)=='card'&&card.hasGaintag('dcmiyun_tag')) return Math.abs(num)*10;
},
aiUseful:function(){
return lib.skill.dcmiyun.mod.aiValue.apply(this,arguments);
},
aiOrder:function(player,card,num){
if(get.itemtype(card)=='card'&&card.hasGaintag('dcmiyun_tag')) return 0;
}
},
subSkill:{
lose:{
audio:'dcmiyun',
trigger:{
player:'loseAfter',
global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'],
},
forced:true,
filter:function(event,player){
if(event.getParent().name=='dcmiyun') return false;
var evt=event.getl(player);
if(!evt||!evt.cards2||!evt.cards2.length) return false;
if(event.name=='lose'){
for(var i in event.gaintag_map){
if(event.gaintag_map[i].contains('dcmiyun_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('dcmiyun_tag')) return true;
}
return false;
});
},
content:function(){
player.loseHp();
}
}
}
},
dcdanying:{
audio:2,
enable:['chooseToUse','chooseToRespond'],
usable:1,
hiddenCard:function(player,name){
if(!_status.connectMode&&!player.hasCard(card=>card.hasGaintag('dcmiyun_tag'),'h')) return false;
return name=='sha'||name=='shan';
},
filter:function(event,player){
if(event.type=='wuxie'||!player.hasCard(card=>card.hasGaintag('dcmiyun_tag'),'h')) 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');
},
backup:function(links,player){
return {
filterCard:()=>false,
selectCard:-1,
viewAs:{
name:links[0][2],
isCard:true,
},
popname:true,
precontent:function(){
player.logSkill('dcdanying');
player.showCards(player.getCards('h',card=>card.hasGaintag('dcmiyun_tag')),get.translation(player)+'的“安”');
player.addTempSkill('dcdanying_discard');
},
}
},
prompt:function(links,player){
return '展示“安”,然后视为使用【'+get.translation(links[0][2])+'】';
}
},
ai:{
order:function(item,player){
var o1=get.order({name:'sha'}),o2=get.order({name:'shan'});
if(player.countCards('h')>3||player==_status.currentPhase) return Math.max(o1,o2)+0.1;
return Math.min(o1,o2)-0.1;
},
respondSha:true,
respondShan:true,
skillTagFilter:function(player,tag,arg){
if(!player.hasCard(card=>card.hasGaintag('dcmiyun_tag'),'h')) return false;
},
result:{
player:1
}
},
subSkill:{
discard:{
trigger:{target:'useCardToTargeted'},
charlotte:true,
forced:true,
filter:function(event,player){
return player.countDiscardableCards(event.player,'he');
},
content:function(){
trigger.player.discardPlayerCard(player,'he',true);
player.removeSkill('dcdanying_discard');
},
ai:{
effect:{
target:function(card,player,target){
if(_status._dcdanying_aiChecking) return;
_status._dcdanying_aiChecking=true;
var eff=get.effect(target,{name:'guohe_copy2'},player,player);
delete _status._dcdanying_aiChecking;
if(eff>0) eff=-1;
else eff=1;
return [1,eff];
}
}
}
}
},
},
//霍峻
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');
}
}
}
},
//关宁
dcxiuwen:{
audio:2,
trigger:{player:'useCard'},
filter:function(event,player){
return !player.getStorage('dcxiuwen').contains(event.card.name);
},
frequent:true,
content:function(){
player.draw();
player.markAuto('dcxiuwen',[trigger.card.name]);
},
intro:{content:'已使用:$'}
},
oldlongsong:{
audio:'dclongsong',
trigger:{player:'phaseUseBegin'},
direct:true,
filter:function(event,player){
return player.countCards('h')>0;
},
getSkills:function(target,player,trigger){
return target.getSkills(null,false).filter(skill=>{
var skills=game.expandSkills([skill]);
if(skills.filter(skillx=>{
var info=get.info(skillx);
if(!info||!info.enable||(info.usable&&!(info.usable>=1))) return false;
if(info.enable!='phaseUse'&&(!Array.isArray(info.enable)||!info.enable.contains('phaseUse'))) return false;
if(info.viewAs&&info.usable&&info.usable!=1) return false;
if(info.juexingji||info.hiddenSkill||info.charlotte||info.limited||info.dutySkill) return false;
if((!info.usable||info.usable>1)&&info.filter){
try{
var bool1=info.filter(trigger,player);
var num=player.getStat().skill[skillx];
player.getStat().skill[skillx]=1;
var bool2=info.filter(trigger,player);
if(!num) delete player.getStat().skill[skillx];
else player.getStat().skill[skillx]=num;
var bool3=!(bool1&&!bool2);
}catch(e){}
if(!bool1&&!bool2&&get.skillInfoTranslation(skill,player).indexOf('出牌阶段限一次')==-1) return false;
if((bool1||bool2)&&bool3) return false;
}
return true;
}).length) return true;
return false;
});
},
content:function(){
'step 0'
player.chooseCardTarget({
filterCard:true,
selectCard:1,
filterTarget:function(card,player,target){
return player!=target;
},
ai1:function(card){
return 6-get.value(card);
},
ai2:function(target){
var att=get.attitude(_status.event.player,target),trigger=_status.event.getTrigger(),player=_status.event.player;
return lib.skill.oldlongsong.getSkills(target,player,trigger).length*3+att/3;
},
prompt:get.prompt2('oldlongsong')
});
'step 1'
if(result.bool){
var target=result.targets[0];
player.logSkill('oldlongsong',target);
event.target=target;
player.line(target,'green');
player.give(result.cards,target);
var skills=lib.skill.oldlongsong.getSkills(target,player,trigger);
if(skills.length){
if(!event.isMine()&&!event.isOnline()) game.delayx();
target.disableSkill('oldlongsong_back',skills);
target.markAuto('oldlongsong_back',skills);
target.addTempSkill('oldlongsong_back',['phaseUseAfter','phaseAfter']);
var str='';
for(var i=0; i0;
},
getSkills:function(target){
return target.getSkills(null,false).filter(skill=>{
var str=get.skillInfoTranslation(skill,target);
if(str.indexOf('当你于出牌阶段')!=-1) return true;
var skills=game.expandSkills([skill]);
if(skills.some(skillx=>{
var info=get.info(skillx);
if(!info||!info.enable) return false;
if(info.enable!='phaseUse'&&info.enable!='chooseToUse'&&(!Array.isArray(info.enable)||!info.enable.contains('phaseUse')&&!info.enable.contains('chooseToUse'))) return false;
if(info.juexingji||info.hiddenSkill||info.charlotte||info.limited||info.dutySkill) return false;
if(info.ai&&info.ai.notemp) return false;
return true;
})) return true;
return false;
});
},
content:function(){
'step 0'
player.chooseCardTarget({
filterCard:{color:'red'},
selectCard:1,
position:'he',
filterTarget:function(card,player,target){
return player!=target;
},
ai1:function(card){
return 6-get.value(card);
},
ai2:function(target){
var att=get.attitude(_status.event.player,target);
return lib.skill.dclongsong.getSkills(target).length*2+att/2.5;
},
prompt:get.prompt2('dclongsong')
});
'step 1'
if(result.bool){
var target=result.targets[0];
player.logSkill('dclongsong',target);
event.target=target;
player.line(target,'green');
player.give(result.cards,target);
var skills=lib.skill.dclongsong.getSkills(target);
if(skills.length){
if(!event.isMine()&&!event.isOnline()) game.delayx();
target.disableSkill('dclongsong_back',skills);
target.markAuto('dclongsong_back',skills);
player.addTempSkill('dclongsong_remove',['phaseUseAfter','phaseAfter']);
player.markAuto('dclongsong_remove',skills);
target.addTempSkill('dclongsong_back',['phaseUseAfter','phaseAfter']);
var str='';
for(var i=0; i0;
},
onremove:true,
marktext:'灵',
intro:{
name2:'灵',
content:'mark',
},
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);
}
},
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 '限定技。你可以失去〖汇灵〗,增加'+_status.event.player.countMark('dchuiling')+'点体力上限,然后获得〖踏寂〗和〖清荒〗。'
},
filter:function(event,player){
return player.countMark('dchuiling')>=4;
},
content:function(){
'step 0'
player.awakenSkill('dcchongxu');
player.gainMaxHp(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){
return (player.countMark('dchuiling')>=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;
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:'下次对其他角色造成伤害时,此伤害+#',
}
}
}
},
//孟节
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