更改描述:将“基本牌”改为“基本牌或普通锦囊牌”';
}
player.chooseControl(list,function(){
if(!_status.event.player.hasSkill('jiaozhao')) return 'draw_card';
return '更改描述';
}).set('prompt',prompt);
}
'step 1'
if(result.control=='draw_card'){
player.draw();
}
else{
game.log(player,'更改了','【矫诏】','的描述');
player.popup('更改描述');
player.markSkill('jiaozhao');
if(player.storage.jiaozhao1){
player.storage.jiaozhao2=true;
}
else{
player.storage.jiaozhao1=true;
}
}
}
},
zongzuo:{
trigger:{global:'phaseBefore'},
forced:true,
priority:10,
audio:2,
filter:function(event,player){
return !player.storage.zongzuo;
},
content:function(){
'step 0'
player.storage.zongzuo=true;
var num=game.countGroup();
player.gainMaxHp(num);
event.num=num;
'step 1'
player.hp+=event.num;
player.update();
},
group:'zongzuo_lose',
subSkill:{
lose:{
trigger:{global:'dieAfter'},
forced:true,
audio:'zongzuo',
filter:function(event,player){
if(!lib.group.contains(event.player.group)) return false;
if(game.hasPlayer(function(current){
return current.group==event.player.group;
})){
return false;
}
return true;
},
content:function(){
player.loseMaxHp();
}
}
}
},
zhige:{
enable:'phaseUse',
usable:1,
audio:2,
filter:function(event,player){
return player.countCards('h')>player.hp;
},
filterTarget:function(card,player,target){
return get.distance(target,player,'attack')<=1&&target.countCards('e')>0;
},
content:function(){
'step 0'
target.chooseToUse({name:'sha'},'止戈:使用一张杀,或将其装备区里的一张牌交给'+get.translation(player));
'step 1'
if(!result.bool&&target.countCards('e')){
target.chooseCard('e',true,'将其装备区里的一张牌交给'+get.translation(player));
}
else{
event.finish();
}
'step 2'
if(result.bool&&result.cards&&result.cards.length){
player.gain(result.cards,target);
target.$give(result.cards,player);
}
},
ai:{
expose:0.2,
order:5,
result:{
target:-1,
player:function(player,target){
if(target.countCards('h')==0) return 0;
if(target.countCards('h')==1) return -0.1;
if(player.hp<=2) return -2;
if(player.countCards('h','shan')==0) return -1;
return -0.5;
}
}
}
},
kuangbi:{
enable:'phaseUse',
usable:1,
audio:2,
filterTarget:function(card,player,target){
return target!=player&&target.countCards('he')>0;
},
content:function(){
'step 0'
target.chooseCard('he',[1,3],'匡弼:将1~3张牌置于'+get.translation(player)+'的武将牌上',true).set('ai',function(card){
if(get.attitude(_status.event.player,_status.event.getParent().player)>0){
return 7-get.value(card);
}
return -get.value(card);
});
'step 1'
if(result.bool){
target.$give(result.cards,player);
target.lose(result.cards,ui.special,'toStorage');
player.storage.kuangbi_draw=result.cards;
player.storage.kuangbi_draw_source=target;
player.syncStorage('kuangbi_draw');
player.addSkill('kuangbi_draw');
}
},
ai:{
order:1,
result:{
target:function(player,target){
if(get.attitude(player,target)>0){
return Math.sqrt(target.countCards('he'));
}
return 0;
},
player:1
}
},
subSkill:{
draw:{
trigger:{player:'phaseBegin'},
forced:true,
mark:true,
intro:{
content:'cards'
},
content:function(){
var cards=player.storage.kuangbi_draw;
if(cards){
player.gain(cards,'gain2','fromStorage');
var target=player.storage.kuangbi_draw_source;
if(target&&target.isAlive()){
target.draw(cards.length);
}
}
delete player.storage.kuangbi_draw;
delete player.storage.kuangbi_draw_source;
player.removeSkill('kuangbi_draw');
}
}
}
},
fulin:{
trigger:{player:'phaseDiscardBegin'},
silent:true,
content:function(){
player.addTempSkill('fulin2','phaseDiscardAfter');
},
group:['fulin_count','fulin_reset'],
subSkill:{
reset:{
trigger:{player:['phaseBegin','phaseEnd']},
silent:true,
priority:10,
content:function(){
player.storage.fulin=[];
}
},
count:{
trigger:{player:'gainEnd'},
silent:true,
filter:function(event,player){
return _status.currentPhase==player;
},
content:function(){
if(!player.storage.fulin){
player.storage.fulin=[];
}
for(var i=0;i
0;
},
audio:2,
content:function(){
'step 0'
var card=target.getCards('h').randomGet();
player.gain(card,target);
target.$giveAuto(card,player);
'step 1'
var name=get.translation(target.name);
player.chooseControl(function(){
return Math.random()<0.5?'选项一':'选项二';
}).set('prompt','督粮').set('choiceList',['令'+name+'观看牌堆顶的两张牌,然后获得其中的基本牌','令'+name+'于下个摸牌阶段额外摸一张牌']);
'step 2'
if(result.control=='选项一'){
var cards=get.cards(2);
target.viewCards('督粮',cards);
event.cards2=[];
for(var i=0;i=_status.event.getParent().num) return -1;
if(_status.event.player.hasSkillTag('nofire')) return -1;
if(_status.event.res>=0) return 6-get.value(card);
if(get.type(card)!='basic'){
return 10-get.value(card);
}
return 8-get.value(card);
}).set('res',res);
}
else{
event.finish();
}
"step 2"
if(!result.bool){
event.target.damage(2,'fire');
event.num=1;
}
else{
event.num=result.cards.length+1;
}
event.goto(1);
},
ai:{
order:1,
result:{
player:function(player){
var num=0,players=game.filterPlayer();
for(var i=0;i0){
num--;
}
else if(att<0){
num++;
}
}
}
if(game.players.length<5){
return num-1;
}
else{
return num-2;
}
}
}
},
init:function(player){
player.storage.xinfencheng=false;
},
intro:{
content:'limited'
}
},
xinjuece:{
audio:2,
trigger:{player:'phaseEnd'},
direct:true,
filter:function(event,player){
return game.hasPlayer(function(player){
return player.countCards('h')==0;
});
},
content:function(){
'step 0'
player.chooseTarget(get.prompt('xinjuece'),function(card,player,target){
return target.countCards('h')==0;
}).set('ai',function(target){
var player=_status.event.player;
return get.damageEffect(target,player,player);
});
'step 1'
if(result.bool){
player.logSkill('juece',result.targets);
result.targets[0].damage();
}
}
},
xinmieji:{
audio:2,
enable:'phaseUse',
usable:1,
filter:function(event,player){
return player.countCards('h',{type:['trick','delay'],color:'black'});
},
filterCard:function(card){
return get.color(card)=='black'&&get.type(card,'trick')=='trick';
},
filterTarget:function(card,player,target){
return target!=player&&target.countCards('h')>0;
},
discard:false,
delay:false,
check:function(card){
return 8-get.value(card);
},
content:function(){
'step 0'
player.showCards(cards);
'step 1'
ui.cardPile.insertBefore(cards[0],ui.cardPile.firstChild);
var n1=target.getCards('he',function(card){
if(!lib.filter.cardDiscardable(card,player)) return false;
return get.type(card,'trick')=='trick';
});
var n2=target.getCards('he',function(card){
if(!lib.filter.cardDiscardable(card,player)) return false;
return get.type(card,'trick')!='trick';
});
if(n1.length>1||n2.length>2||(n1.length==1&&n2.length==2)){
target.chooseToDiscard('弃置一张锦囊牌,或两张非锦囊牌',true,'he',function(card,player){
if(!lib.filter.cardDiscardable(card,player)) return false;
if(!_status.event.nontrick){
return get.type(card,'trick')=='trick';
}
if(ui.selected.cards.length){
return get.type(card,'trick')!='trick';
}
return true;
}).set('ai',function(card){
if(get.type(card,'trick')=='trick'){
return 8-get.value(card);
}
return -get.value(card);
}).set('selectCard',function(){
if(ui.selected.cards.length==1&&get.type(ui.selected.cards[0],'trick')=='trick'){
return 1;
}
return 2;
}).set('nontrick',n2.length>=2).set('complexCard',true);
}
else{
if(n1.length){
target.discard(n1);
}
else if(n2.length){
target.discard(n2);
}
}
},
ai:{
order:9,
result:{
target:-1
}
}
},
qianju:{
mod:{
globalFrom:function(from,to,distance){
return distance-(from.maxHp-from.hp);
}
}
},
qingxi:{
trigger:{source:'damageBegin'},
check:function(event,player){
return get.attitude(player,event.player)<0;
},
filter:function(event,player){
return event.card&&event.card.name=='sha'&&player.getEquip(1);
},
content:function(){
'step 0'
var num=1;
var info=get.info(player.getEquip(1));
if(info&&info.distance&&info.distance.attackFrom){
num-=info.distance.attackFrom;
}
if(trigger.player.countCards('h')2){
return 0;
}
return 8-get.value(card);
}
});
}
'step 1'
if(!event.directfalse&&result.bool){
var e1=player.getEquip(1);
if(e1){
player.discard(e1);
}
}
else{
trigger.num++;
}
}
},
jieyue:{
group:'jieyue1'
},
jieyue1:{
audio:2,
trigger:{player:'phaseEnd'},
direct:true,
content:function(){
'step 0'
player.chooseCardTarget({
filterTarget:function(card,player,target){
return target!=player&&target.countCards('he')>0;
},
filterCard:lib.filter.cardDiscardable,
ai1:function(card){
return 7-get.useful(card);
},
ai2:function(target){
return 1-get.attitude(_status.event.player,target);
},
prompt:get.prompt('jieyue')
});
'step 1'
if(result.bool){
player.logSkill('jieyue1',result.targets);
player.discard(result.cards);
var target=result.targets[0];
event.target=target;
target.chooseCard('将一张牌置于'+get.translation(player)+'的武将牌上,或令其弃置你的一张牌','he').set('ai',function(card){
if(card.name=='du') return 20;
var player=_status.event.player;
if(get.attitude(player,_status.event.getParent().player)>0){
return 8-get.value(card);
}
var nh=player.countCards('h');
if(nh<=2){
return 6-get.value(card);
}
if(nh<=3){
return 2-get.value(card);
}
return 0;
});
}
else{
event.finish();
}
'step 2'
if(result.bool&&result.cards&&result.cards.length){
event.target.$give(result.cards,player);
player.storage.jieyue2=result.cards[0];
event.target.lose(result.cards[0],ui.special,'toStorage');
player.syncStorage('jieyue2');
player.addSkill('jieyue2');
}
else if(event.target.countCards('he')){
player.discardPlayerCard(event.target,true);
}
},
ai:{
expose:0.1
}
},
jieyue2:{
mark:'card',
intro:{
content:'card'
},
audio:true,
enable:'chooseToUse',
filterCard:function(card){
return get.color(card)=='black';
},
viewAsFilter:function(player){
return player.countCards('h',{color:'black'})>0;
},
viewAs:{name:'wuxie'},
prompt:'将一张黑色手牌当无懈可击使用',
check:function(card){return 8-get.value(card)},
threaten:1.2,
group:['jieyue3','jieyue4']
},
jieyue3:{
enable:['chooseToRespond'],
filterCard:function(card){
return get.color(card)=='red';
},
viewAs:{name:'shan'},
viewAsFilter:function(player){
if(!player.countCards('h',{color:'red'})) return false;
},
audio:true,
prompt:'将一张红色手牌当闪打出',
check:function(){return 1},
ai:{
respondShan:true,
skillTagFilter:function(player){
if(!player.countCards('h',{color:'red'})) return false;
},
effect:{
target:function(card,player,target,current){
if(get.tag(card,'respondShan')&¤t<0) return 0.8
}
}
}
},
jieyue4:{
trigger:{player:'phaseBegin'},
forced:true,
content:function(){
player.gain(player.storage.jieyue2,'gain2','fromStorage');
player.storage.jieyue2=null;
player.removeSkill('jieyue2');
}
},
jinjiu:{
mod:{
cardEnabled:function(card,player){
if(card.name=='jiu'&&_status.event.skill!='jinjiu') return false;
},
cardUsable:function(card,player){
if(card.name=='jiu'&&_status.event.skill!='jinjiu') return false;
},
cardRespondable:function(card,player){
if(card.name=='jiu'&&_status.event.skill!='jinjiu') return false;
},
cardSavable:function(card,player){
if(card.name=='jiu'&&_status.event.skill!='jinjiu') return false;
},
},
enable:['chooseToUse','chooseToRespond'],
filter:function(event,player){
return player.countCards('h','jiu')>0;
},
filterCard:{name:'jiu'},
viewAs:{name:'sha'},
viewAsFilter:function(player){
if(!player.countCards('h','jiu')) return false;
},
check:function(){return 1},
ai:{
skillTagFilter:function(player){
if(!player.countCards('h','jiu')) return false;
},
respondSha:true,
order:4,
useful:-1,
value:-1
}
},
xianzhen:{
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);
"step 1"
if(result.bool){
player.storage.xianzhen=target;
player.addTempSkill('xianzhen2');
}
else{
player.addTempSkill('xianzhen3');
}
},
ai:{
order:function(name,player){
var cards=player.getCards('h');
if(player.countCards('h','sha')==0){
return 1;
}
for(var i=0;i11&&get.value(cards[i])<7){
return 9;
}
}
return get.order({name:'sha'})-1;
},
result:{
player:function(player){
if(player.countCards('h','sha')>0) return 0;
var num=player.countCards('h');
if(num>player.hp) return 0;
if(num==1) return -2;
if(num==2) return -1;
return -0.7;
},
target:function(player,target){
var num=target.countCards('h');
if(num==1) return -1;
if(num==2) return -0.7;
return -0.5
},
},
threaten:1.3
}
},
xianzhen2:{
mod:{
targetInRange:function(card,player,target,now){
if(player.storage.xianzhen==target) return true;
},
cardUsable:function(card,player,num){
if(card.name=='sha') return Infinity;
}
},
ai:{
unequip:true
}
},
xianzhen3:{
mod:{
cardEnabled:function(card){if(card.name=='sha') return false}
}
},
lihuo:{
enable:'phaseUse',
usable:1,
filterCard:function(card){
return card.name=='sha'&&!card.nature;
},
filter:function(event,player){
return player.countCards('h','sha')>0
},
viewAs:{name:'sha',nature:'fire'},
mod:{
selectTarget:function(card,player,range){
if(card.name=='sha'&&card.nature=='fire'&&range[1]!=-1){
range[1]++;
}
},
},
group:'lihuo2'
},
lihuo2:{
trigger:{source:'damageEnd'},
forced:true,
popup:false,
filter:function(event,player){
return event.parent.skill=='lihuo';
},
content:function(){
player.addSkill('lihuo3');
}
},
lihuo3:{
trigger:{player:'useCardAfter'},
vanish:true,
filter:function(event,player){
return event.card.name=='sha';
},
forced:true,
audio:false,
content:function(){
player.loseHp();
player.removeSkill('lihuo3');
}
},
chunlao:{
trigger:{player:'phaseEnd'},
direct:true,
audio:2,
filter:function(event,player){
return player.countCards('h','sha')>0&&!player.storage.chunlao.length;
},
init:function(player){
player.storage.chunlao=[];
},
intro:{
content:'cards',
},
content:function(){
'step 0'
player.chooseCard([1,player.countCards('h','sha')],get.prompt('chunlao'),{name:'sha'}).set('ai',function(){
return 1;
});
'step 1'
if(result.bool){
player.logSkill('chunlao');
player.storage.chunlao=player.storage.chunlao.concat(result.cards);
player.syncStorage('chunlao');
player.markSkill('chunlao');
player.lose(result.cards,ui.special,'toStorage');
player.$give(result.cards,player);
}
},
ai:{
effect:{
player:function(card,player,target){
if(_status.currentPhase!=player) return;
if(card.name=='sha'&&!player.needsToDiscard()&&
!player.storage.chunlao.length&&target.hp>1){
return 'zeroplayertarget';
}
}
},
threaten:1.4
},
group:'chunlao2'
},
chunlao2:{
enable:'chooseToUse',
filter:function(event,player){
return event.type=='dying'&&event.dying&&event.dying.hp<=0&&player.storage.chunlao.length>0;
},
filterTarget:function(card,player,target){
return target==_status.event.dying;
},
direct:true,
delay:0,
selectTarget:-1,
content:function(){
"step 0"
player.chooseCardButton(get.translation('chunlao'),player.storage.chunlao,true);
"step 1"
if(result.bool){
player.logSkill('chunlao');
player.$throw(result.links);
player.storage.chunlao.remove(result.links[0]);
result.links[0].discard();
player.syncStorage('chunlao');
target.useCard({name:'jiu'},target);
if(!player.storage.chunlao.length){
player.unmarkSkill('chunlao');
}
else{
player.markSkill('chunlao');
}
}
},
ai:{
order:6,
skillTagFilter:function(player){
return player.storage.chunlao.length>0;
},
save:true,
result:{
target:3
},
threaten:1.6
},
},
chunlao2_old:{
trigger:{global:'dying'},
priority:6,
filter:function(event,player){
return event.player.hp<=0&&player.storage.chunlao.length>0;
},
direct:true,
content:function(){
"step 0"
var att=get.attitude(player,trigger.player);
player.chooseCardButton(get.prompt('chunlao',trigger.player),player.storage.chunlao).set('ai',function(button){
if(_status.event.att>0) return 1;
return 0;
}).set('att',att);
"step 1"
if(result.bool){
player.logSkill('chunlao',trigger.player);
player.$throw(result.links);
player.storage.chunlao.remove(result.links[0]);
result.links[0].discard();
player.syncStorage('chunlao');
trigger.player.useCard({name:'jiu'},trigger.player);
if(!player.storage.chunlao.length){
player.unmarkSkill('chunlao');
}
else{
player.markSkill('chunlao');
}
}
},
ai:{
expose:0.2
}
},
shenduan:{
trigger:{player:'discardAfter'},
filter:function(event,player){
for(var i=0;i0&&get.distance(player,event.player,'attack')<=1;
},
content:function(){
'step 0'
var att=get.attitude(player,trigger.player);
var nh=trigger.player.countCards('h');
var eff=get.effect(trigger.player,{name:'sha'},player,player);
player.chooseCardButton(get.prompt('yonglve',trigger.player),trigger.player.getCards('j')).set('ai',function(button){
var name=button.link.viewAs||button.link.name;
var att=_status.event.att;
var nh=_status.event.nh;
var eff=_status.event.eff;
var trigger=_status.event.getTrigger();
if(att>0&&eff>=0) return 1;
if(att>=0&&eff>0) return 1;
if(att>0&&(trigger.player.hp>=3||trigger.player.getEquip('bagua')||trigger.player.countCards('h','shan'))){
if(name=='lebu'&&nh>trigger.player.hp) return 1;
if(name=='bingliang'&&nh1;
})){
range[1]++;
}
}
}
}
},
ai:{
unequip:true,
skillTagFilter:function(player){
if(game.hasPlayer(function(current){
return get.distance(player,current)>1;
})){
return false;
}
}
}
},
sidi:{
trigger:{global:'respondEnd'},
filter:function(event,player){
if(event.parent.parent.name!='sha') return false;
if(event.player==player) return true;
return _status.currentPhase==player;
},
frequent:true,
init:function(player){
player.storage.sidi=[];
},
intro:{
content:'cards'
},
content:function(){
var card=get.cards()[0];
game.log(player,'将',card,'置于武将牌上');
player.$gain2(card);
player.storage.sidi.add(card);
player.markSkill('sidi');
player.syncStorage('sidi');
},
group:'sidi2'
},
sidi2:{
trigger:{global:'phaseUseBegin'},
filter:function(event,player){
if(event.player==player) return false;
if(!player.storage.sidi.length) return false;
return true;
},
check:function(event,player){
if(get.attitude(player,event.player)>=0) return false;
if(event.player.getEquip('zhuge')) return false;
if(event.player.hasSkill('paoxiao')) return false;
var players=game.filterPlayer();
for(var i=0;i0) break;
}
if(i==players.length) return false;
var nh=event.player.countCards('h');
var nsha=event.player.countCards('h','sha');
if(nh<2) return false;
switch(nh){
case 2:
if(nsha) return Math.random()<0.4;
return Math.random()<0.2;
case 3:
if(nsha) return Math.random()<0.8;
return Math.random()<0.3;
case 4:
if(nsha>1) return true;
if(nsha) return Math.random()<0.9;
return Math.random()<0.5;
default:return true;
}
},
content:function(){
'step 0'
if(player.storage.sidi.length==1){
event.directbutton=player.storage.sidi[0];
}
else{
player.chooseCardButton('弃置武将牌上的一张牌',player.storage.sidi,true);
}
'step 1'
var button;
if(event.directbutton){
button=event.directbutton;
}
else if(result.bool&&result.links&&result.links.length){
button=result.links[0];
}
if(button){
player.$throw([button]);
player.line(trigger.player,'green');
game.log(player,'将',button,'置于弃牌堆');
button.discard();
trigger.player.addTempSkill('sidi3');
player.storage.sidi.remove(button);
player.syncStorage('sidi');
if(player.storage.sidi.length==0){
player.unmarkSkill('sidi');
}
else{
player.markSkill('sidi');
}
game.delayx();
}
}
},
sidi3:{
mod:{
cardUsable:function(card,player,num){
if(card.name=='sha') return num-1;
}
}
},
zhongyong:{
trigger:{player:'shaMiss'},
direct:true,
filter:function(event,player){
return event.responded&&get.itemtype(event.responded.cards)=='cards';
},
content:function(){
"step 0"
var cards=trigger.responded.cards;
event.cards=cards;
player.chooseTarget('忠勇:将'+get.translation(trigger.responded.cards)+'交给一名角色',function(card,player,target){
return target!=_status.event.getTrigger().target;
}).set('ai',function(target){
var att=get.attitude(_status.event.player,target);
if(target.countCards('h','shan')&&target.countCards('h')>=2){
att/=1.5;
}
return att;
});
"step 1"
if(result.bool){
player.logSkill('zhongyong',result.targets);
result.targets[0].gain(event.cards,'gain2');
if(result.targets[0]==player){
event.finish();
}
}
else{
event.finish();
}
"step 2"
if(player.hasSkill('jiu')){
game.broadcastAll(function(player){
player.removeSkill('jiu');
},player);
event.jiu=true;
}
player.chooseToUse('是否对'+get.translation(trigger.target)+'再使用一张杀?',
{name:'sha'},trigger.target,-1).logSkill='qinglong_skill';
"step 3"
if(result.bool);
else if(event.jiu){
player.addSkill('jiu');
}
}
},
xinzhongyong:{
trigger:{player:'shaAfter'},
direct:true,
filter:function(event,player){
return get.itemtype(event.cards)=='cards'||(event.responded&&get.itemtype(event.responded.cards)=='cards');
},
content:function(){
"step 0"
event.cards1=trigger.cards.slice(0);
if(trigger.responded&&trigger.responded.cards&&trigger.responded.cards.length){
event.cards2=trigger.responded.cards.slice(0);
}
player.chooseTarget(get.prompt('zhongyong'),function(card,player,target){
return target!=_status.event.getTrigger().target&&target!=player;
}).set('ai',function(target){
return get.attitude(_status.event.player,target);
});
"step 1"
if(result.bool){
event.target=result.targets[0];
if(!event.cards2){
player.logSkill('zhongyong',event.target);
event.sha=false;
event.target.gain(event.cards1,'gain2');
if(get.color(event.cards1)=='red'){
event.sha=true;
}
event.goto(3);
}
else{
var sha=false;
if(event.cards1.length==1&&get.color(event.cards1[0])=='red'){
sha=true;
}
player.chooseControl('杀','闪',function(event,player){
if(_status.event.choosesha) return '杀';
return '闪';
}).set('prompt','选择交给'+get.translation(result.targets)+'的牌').set('choosesha',sha);
}
}
else{
event.finish();
}
"step 2"
player.logSkill('zhongyong',event.target);
event.sha=false;
if(result.control=='杀'){
event.target.gain(event.cards1,'gain2');
if(get.color(event.cards1)=='red'){
event.sha=true;
}
}
else{
event.target.gain(event.cards2,'gain2');
if(get.color(event.cards2)=='red'){
event.sha=true;
}
}
"step 3"
if(event.sha){
event.target.chooseToUse('是否使用一张杀?',{name:'sha'}).set('filterTarget',function(card,player,target){
return target!=_status.event.source&&get.distance(_status.event.source,target,'attack')<=1&&player.canUse('sha',target,false);
}).set('source',player);
}
}
},
dangxian:{
trigger:{player:'phaseBegin'},
forced:true,
content:function(){
'step 0'
player.phaseUse();
'step 1'
player.getStat().card={};
}
},
longyin:{
trigger:{global:'shaBegin'},
direct:true,
filter:function(event,player){
return event.target==event.targets[0]&&player.countCards('he')>0&&event.card.name=='sha'&&
_status.currentPhase==event.player&&event.parent.parent.parent.name=='phaseUse';
},
content:function(){
'step 0'
var go=false;
if(get.attitude(player,trigger.player)>0){
if(get.color(trigger.card)=='red'){
go=true;
}
else if(!trigger.player.hasSkill('paoxiao')&&
!trigger.player.hasSkill('tanlin3')&&
!trigger.player.hasSkill('zhaxiang2')&&
!trigger.player.hasSkill('fengnu')&&
!trigger.player.getEquip('zhuge')){
var nh=trigger.player.countCards('h');
if(player==trigger.player){
go=(player.countCards('h','sha')>0);
}
else if(nh>=4){
go=true;
}
else if(player.countCards('h','sha')){
if(nh==3){
go=Math.random()<0.8;
}
else if(nh==2){
go=Math.random()<0.5;
}
}
else if(nh>=3){
if(nh==3){
go=Math.random()<0.5;
}
else if(nh==2){
go=Math.random()<0.2;
}
}
}
}
var next=player.chooseToDiscard(get.prompt('longyin'),'he');
next.logSkill=['longyin',trigger.player];
next.set('ai',function(card){
if(_status.event.go){
return 6-get.value(card);
}
return 0;
});
next.set('go',go);
'step 1'
if(result.bool){
trigger.player.getStat().card.sha--;
if(get.color(trigger.card)=='red'){
player.draw();
}
// player.logSkill('longyin',trigger.player);
}
},
ai:{
expose:0.2
}
},
jigong:{
audio:2,
trigger:{player:'phaseUseBegin'},
check:function(event,player){
var nh=player.countCards('h')-player.countCards('h',{type:'equip'});
if(nh<=1) return true;
if(player.countCards('h','tao')) return false;
if(nh<=2) return Math.random()<0.7;
if(nh<=3) return Math.random()<0.4;
return false;
},
content:function(){
player.draw(2);
player.addTempSkill('jigong2');
}
},
jigong2:{
mod:{
maxHandcard:function(player,num){
var damage=player.getStat().damage;
if(typeof damage=='number') return num-player.hp+damage;
return 0;
}
}
},
shifei:{
audio:2,
trigger:{player:'chooseToRespondBegin'},
filter:function(event,player){
if(event.responded) return false;
if(!event.filterCard({name:'shan'})) return false;
return true;
},
check:function(event,player){
if(get.attitude(player,_status.currentPhase)>0) return true;
var nh=_status.currentPhase.countCards('h')+1;
var players=game.filterPlayer();
for(var i=0;inh){
if(!player.hasShan()||get.attitude(player,players[i])<=0) return true;
}
}
return false;
},
content:function(){
'step 0'
player.line(_status.currentPhase,'green');
_status.currentPhase.draw();
'step 1'
var nh=_status.currentPhase.countCards('h');
var nmax=nh+1;
var targets=[];
var players=game.filterPlayer();
for(var i=0;inmax){
nmax=nh2;
targets.length=0;
targets.push(players[i]);
}
else if(nh2==nmax){
targets.push(players[i]);
}
}
if(targets.length==1){
event.onlytarget=targets[0];
}
else if(targets.length){
player.chooseTarget('选择一名角色弃置其一张牌',true,function(card,player,target){
return _status.event.targets.contains(target);
}).set('ai',function(target){
return -get.attitude(_status.event.player,target);
}).set('targets',targets);
}
else{
event.finish();
}
'step 2'
var target;
if(event.onlytarget){
target=event.onlytarget;
}
else if(result.targets&&result.targets.length){
target=result.targets[0];
}
if(target){
player.line(target,'green');
player.discardPlayerCard(target,'he',true);
trigger.untrigger();
trigger.responded=true;
trigger.result={bool:true,card:{name:'shan'}}
}
},
ai:{
effect:{
target:function(card,player,target,current){
if(get.tag(card,'respondShan')&¤t<0){
var nh=player.countCards('h');
var players=game.filterPlayer();
for(var i=0;inh) return 0.4;
}
}
}
}
}
},
huaiyi:{
audio:2,
enable:'phaseUse',
usable:1,
delay:0,
filter:function(event,player){
return player.countCards('h',{color:'red'})&&player.countCards('h',{color:'black'});
},
content:function(){
'step 0'
player.chooseControl('红色','黑色').set('ai',function(){
var player=_status.event.player;
if(player.countCards('h',{color:'red'})==1&&
player.countCards('h',{color:'black'})>1) return '红色';
return '黑色';
});
'step 1'
event.control=result.control;
player.showHandcards();
'step 2'
var cards;
if(event.control=='红色'){
cards=player.getCards('h',{color:'red'});
}
else{
cards=player.getCards('h',{color:'black'});
}
player.discard(cards);
event.num=cards.length;
'step 3'
player.chooseTarget([1,event.num],function(card,player,target){
return target!=player&&target.countCards('he')>0;
}).set('ai',function(target){
return -get.attitude(_status.event.player,target)+0.5;
});
'step 4'
if(result.bool&&result.targets){
player.line(result.targets,'green');
event.targets=result.targets;
event.targets.sort(lib.sort.seat);
event.gained=event.targets.length;
}
else{
event.finish();
}
'step 5'
if(event.targets.length){
player.gainPlayerCard(event.targets.shift(),'he',true);
event.redo();
}
'step 6'
if(event.gained>=2){
player.loseHp();
}
},
ai:{
order:function(item,player){
if(player.countCards('h',{color:'red'})==1) return 10;
if(player.countCards('h',{color:'black'})==1) return 10;
return 1;
},
result:{
player:1
}
}
},
yaoming:{
audio:2,
trigger:{player:'damageEnd',source:'damageEnd'},
direct:true,
filter:function(event,player){
if(player.hasSkill('yaoming2')) return false;
var nh=player.countCards('h');
return game.hasPlayer(function(current){
return current.countCards('h')!=nh;
});
},
content:function(){
'step 0'
var nh=player.countCards('h');
player.chooseTarget(get.prompt('yaoming'),function(card,player,target){
return _status.event.nh!=target.countCards('h');
}).set('ai',function(target){
var att=get.attitude(_status.event.player,target);
if(target.countCards('h')>_status.event.nh) return -att;
return att;
}).set('nh',nh);
'step 1'
if(result.bool){
player.logSkill('yaoming',result.targets);
player.addTempSkill('yaoming2');
var target=result.targets[0];
if(target.countCards('h')0;
},
content:function(){
'step 0'
player.choosePlayerCard(target,'e',true);
'step 1'
if(result.links){
var num=0,players=game.filterPlayer();
for(var i=0;inum2){
player.draw();
}
},
ai:{
order:7,
result:{
target:function(player,target){
if(target.hasSkillTag('noe')) return 1;
if(target.getEquip(1)||target.getEquip(4)) return -1;
if(target.getEquip(2)) return -0.7;
return -0.5;
}
}
}
},
zhaofu:{
unique:true,
global:'zhaofu2',
zhuSkill:true
},
zhaofu2:{
mod:{
attackTo:function(from,to,distance){
if(from.group!='wu') return;
var players=game.filterPlayer();
for(var i=0;i0&&target!=player;
},
content:function(){
'step 0'
if(target.countCards('e')){
target.chooseBool('是否将装备区内的所有牌交给'+get.translation(player)+'?').set('ai',function(){
if(_status.event.player.countCards('e')>=3) return false;
return true;
});
}
else{
target.chooseToDiscard(true,'he');
event.finish();
}
'step 1'
if(result.bool){
var es=target.getCards('e');
player.gain(es,target);
target.$give(es,player);
player.removeSkill('yanzhu');
}
else{
target.chooseToDiscard(true,'he');
}
},
ai:{
order:6,
result:{
target:function(player,target){
var ne=target.countCards('e');
if(!ne) return -2;
if(ne>=2) return -ne;
return 0;
}
}
}
},
shizhi:{
mod:{
cardRespondable:function(card,player){
if(card.name=='shan'&&player.hp==1&&_status.event.skill!='shizhi') return false;
},
},
enable:['chooseToUse','chooseToRespond'],
filter:function(event,player){
return player.hp==1;
},
filterCard:{name:'shan'},
viewAs:{name:'sha'},
viewAsFilter:function(player){
if(!player.countCards('h','shan')) return false;
if(player.hp!=1) return false;
},
check:function(){return 1},
ai:{
skillTagFilter:function(player){
if(!player.countCards('h','shan')) return false;
if(player.hp!=1) return false;
},
respondSha:true,
order:4,
useful:-1,
value:-1
}
},
wurong:{
enable:'phaseUse',
usable:1,
filter:function(event,player){
return player.countCards('h')>0;
},
filterTarget:function(card,player,target){
return target.countCards('h')>0&&target!=player;
},
content:function(){
"step 0"
if(target.countCards('h')==0||player.countCards('h')==0){
event.finish();
return;
}
"step 1"
var sendback=function(){
if(_status.event!=event){
return function(){
event.resultOL=_status.event.resultOL;
};
}
};
if(player.isOnline()){
player.wait(sendback);
event.ol=true;
player.send(function(){
game.me.chooseCard(true).set('glow_result',true).ai=function(){
return Math.random();
};
game.resume();
});
}
else{
event.localPlayer=true;
player.chooseCard(true).set('glow_result',true).ai=function(){
return Math.random();
};
}
if(target.isOnline()){
target.wait(sendback);
event.ol=true;
target.send(function(){
var rand=Math.random()<0.4;
game.me.chooseCard(true).set('glow_result',true).ai=function(card){
if(rand) return card.name=='shan'?1:0;
return card.name=='shan'?0:1;
};
game.resume();
});
}
else{
event.localTarget=true;
}
"step 2"
if(event.localPlayer){
event.card1=result.cards[0];
}
if(event.localTarget){
var rand=Math.random()<0.4;
target.chooseCard(true).set('glow_result',true).ai=function(card){
if(rand) return card.name=='shan'?1:0;
return card.name=='shan'?0:1;
};
}
"step 3"
if(event.localTarget){
event.card2=result.cards[0];
}
if(!event.resultOL&&event.ol){
game.pause();
}
"step 4"
try{
if(!event.card1) event.card1=event.resultOL[player.playerid].cards[0];
if(!event.card2) event.card2=event.resultOL[target.playerid].cards[0];
if(!event.card1||!event.card2){
throw('err');
}
}
catch(e){
console.log(e);
event.finish();
return;
}
if(event.card2.number>=10||event.card2.number<=4){
if(target.countCards('h')>2){
event.addToAI=true;
}
}
game.broadcastAll(function(card1,card2){
card1.classList.remove('glow');
card2.classList.remove('glow');
},event.card1,event.card2);
"step 5"
game.broadcastAll(function(){
ui.arena.classList.add('thrownhighlight');
});
game.addVideo('thrownhighlight1');
player.$compare(event.card1,target,event.card2);
game.delay(4);
"step 6"
game.log(player,'展示了',event.card1);
game.log(target,'展示了',event.card2);
var name1=event.card1.name;
if(player.hp==1&&name1=='shan'){
name1='sha';
}
if(name1=='sha'&&event.card2.name!='shan'){
player.discard(event.card1).set('animate',false);
target.$gain2(event.card2);
var clone=event.card1.clone;
if(clone){
clone.style.transition='all 0.5s';
clone.style.transform='scale(1.2)';
clone.delete();
game.addVideo('deletenode',player,get.cardsInfo([clone]));
}
game.broadcast(function(card){
var clone=card.clone;
if(clone){
clone.style.transition='all 0.5s';
clone.style.transform='scale(1.2)';
clone.delete();
}
},event.card1);
target.damage();
}
else if(name1!='sha'&&event.card2.name=='shan'){
player.discard(event.card1).set('animate',false);
target.$gain2(event.card2);
var clone=event.card1.clone;
if(clone){
clone.style.transition='all 0.5s';
clone.style.transform='scale(1.2)';
clone.delete();
game.addVideo('deletenode',player,get.cardsInfo([clone]));
}
game.broadcast(function(card){
var clone=card.clone;
if(clone){
clone.style.transition='all 0.5s';
clone.style.transform='scale(1.2)';
clone.delete();
}
},event.card1);
player.gainPlayerCard(target,true,'he');
}
else{
player.$gain2(event.card1);
target.$gain2(event.card2);
}
game.broadcastAll(function(){
ui.arena.classList.remove('thrownhighlight');
});
game.addVideo('thrownhighlight2');
},
ai:{
order:6,
result:{
target:-1,
}
}
},
zhanjue:{
audio:2,
enable:'phaseUse',
filterCard:true,
selectCard:-1,
filter:function(event,player){
if(!player.countCards('h')) return false;
if(player.storage.zhanjue>=2) return false;
return true;
},
viewAs:{name:'juedou'},
group:['zhanjue2','zhanjue3','zhanjue4'],
ai:{
damage:true,
order:1,
effect:{
player:function(card,player,target){
if(_status.event.skill=='zhanjue'){
if(player.countCards('h')>=3||target.countCards('h')>=3) return 'zeroplayertarget';
if(player.countCards('h','tao')) return 'zeroplayertarget';
if(target.countCards('h','sha')>1) return 'zeroplayertarget';
}
}
}
}
},
zhanjue2:{
audio:false,
trigger:{player:'phaseBefore'},
silent:true,
content:function(){
player.storage.zhanjue=0;
}
},
zhanjue3:{
audio:false,
trigger:{player:'damageAfter',source:'damageAfter'},
forced:true,
popup:false,
filter:function(event,player){
return event.parent.skill=='zhanjue';
},
content:function(){
player.storage.zhanjue2=trigger.player;
}
},
zhanjue4:{
audio:false,
trigger:{player:'juedouAfter'},
forced:true,
popup:false,
filter:function(event,player){
return event.skill=='zhanjue';
},
content:function(){
if(typeof player.storage.zhanjue!='number'){
player.storage.zhanjue=0;
}
if(player.storage.zhanjue2==player){
player.draw(2);
player.storage.zhanjue+=2;
}
else if(player.storage.zhanjue2){
if(player.storage.zhanjue2.isAlive()){
game.asyncDraw([player,player.storage.zhanjue2]);
}
else{
player.draw();
}
player.storage.zhanjue++;
}
else{
player.draw();
player.storage.zhanjue++;
}
delete player.storage.zhanjue2;
}
},
qinwang:{
unique:true,
group:['qinwang1','qinwang2'],
zhuSkill:true,
subSkill:{
ai:{}
}
},
qinwang1:{
audio:2,
trigger:{player:'chooseToRespondBegin'},
filter:function(event,player){
if(event.responded) return false;
if(!player.hasZhuSkill('qinwang')) return false;
if(!player.countCards('he')) return false;
if(event.filterCard({name:'sha'},player,event)==false) return false;
return game.hasPlayer(function(current){
return current!=player&¤t.group=='shu';
});
},
direct:true,
content:function(){
"step 0"
var yep=false;
if(!player.storage.jijianging&&!trigger.jijiang){
var players=game.filterPlayer();
for(var i=0;i1&&(nh>=4||(nh>=3&&players[i].countCards('h','sha')))){
yep=true;break;
}
}
}
var next=player.chooseToDiscard(get.prompt('qinwang'),'he');
next.set('ai',function(card){
if(_status.event.yep) return 5-get.value(card);
return 0;
});
next.set('yep',yep);
next.logSkill='qinwang'
"step 1"
if(!result.bool){
event.finish();
}
"step 2"
if(event.current==undefined) event.current=player.next;
if(event.current==player){
event.finish();
}
else if(event.current.group=='shu'){
player.storage.jijianging=true;
var next=event.current.chooseToRespond('是否替'+get.translation(player)+'打出一张杀?',{name:'sha'});
next.set('ai',function(){
var event=_status.event;
return (get.attitude(event.player,event.source)-2);
});
next.set('source',player);
next.set('jijiang',true);
next.autochoose=lib.filter.autoRespondSha;
}
else{
event.current=event.current.next;
event.redo();
}
"step 3"
player.storage.jijianging=false;
if(result.bool){
event.finish();
trigger.result=result;
trigger.responded=true;
trigger.animate=false;
event.current.draw();
if(typeof event.current.ai.shown=='number'&&event.current.ai.shown<0.95){
event.current.ai.shown+=0.3;
if(event.current.ai.shown>0.95) event.current.ai.shown=0.95;
}
}
else{
event.current=event.current.next;
event.goto(2);
}
}
},
qinwang2:{
audio:2,
enable:'chooseToUse',
filter:function(event,player){
if(event.filterCard&&!event.filterCard({name:'sha'},player,event)) return false;
if(!player.hasZhuSkill('qinwang')) return false;
if(!lib.filter.cardUsable({name:'sha'},player)) return false;
return game.hasPlayer(function(current){
return current!=player&¤t.group=='shu';
});
},
filterCard:true,
position:'he',
check:function(card){
var player=_status.event.player,players=game.filterPlayer();
for(var i=0;i1&&(nh>=4||(nh>=3&&players[i].countCards('h','sha')))){
return 5-get.value(card);
}
}
return 0;
},
filterTarget:function(card,player,target){
if(_status.event._backup&&
typeof _status.event._backup.filterTarget=='function'&&
!_status.event._backup.filterTarget({name:'sha'},player,target)){
return false;
}
return player.canUse({name:'sha'},target);
},
content:function(){
"step 0"
if(event.current==undefined) event.current=player.next;
if(event.current==player){
player.addSkill('jijiang3');
player.addTempSkill('qinwang_ai');
event.getParent(2).step=0;
event.finish();
}
else if(event.current.group=='shu'){
var next=event.current.chooseToRespond('是否替'+get.translation(player)+'对'+get.translation(target)+'使用一张杀',
function(card){
var evt=_status.event.getParent();
return evt.player.canUse(card,evt.target)&&card.name=='sha';
});
next.set('ai',function(card){
var event=_status.event;
return get.effect(event.target,card,event.source,event.player);
});
next.set('source',player);
next.set('target',target);
next.set('jijiang',true);
next.autochoose=lib.filter.autoRespondSha;
}
else{
event.current=event.current.next;
event.redo();
}
"step 1"
if(result.bool){
event.finish();
event.current.draw();
if(result.cards&&result.cards.length==1&&result.cards[0].name=='sha'){
player.useCard(result.cards[0],target).animate=false;
}
else{
player.useCard({name:'sha'},target).animate=false;
}
if(typeof event.current.ai.shown=='number'&&event.current.ai.shown<0.95){
event.current.ai.shown+=0.3;
if(event.current.ai.shown>0.95) event.current.ai.shown=0.95;
}
}
else{
event.current=event.current.next;
event.goto(0);
}
},
ai:{
result:{
target:function(player,target){
if(player.hasSkill('jijiang3')) return 0;
if(player.hasSkill('qinwang_ai')) return 0;
return get.effect(target,{name:'sha'},player,target);
}
},
order:function(){
return get.order({name:'sha'})-0.1;
},
}
},
zuoding:{
trigger:{global:'useCard'},
filter:function(event,player){
return !player.hasSkill('zuoding2')&&get.suit(event.card)=='spade'&&
_status.currentPhase==event.player&&event.targets&&event.targets.length&&
event.player!=player;
},
direct:true,
content:function(){
'step 0'
player.chooseTarget(get.prompt('zuoding'),function(card,player,target){
return _status.event.getTrigger().targets.contains(target);
}).set('ai',function(target){
return get.attitude(_status.event.player,target);
});
'step 1'
if(result.bool){
player.logSkill('zuoding',result.targets);
result.targets[0].draw();
}
},
ai:{
expose:0.2
},
group:'zuoding3'
},
zuoding2:{},
zuoding3:{
trigger:{global:'damageEnd'},
silent:true,
content:function(){
player.addTempSkill('zuoding2');
}
},
huomo:{
audio:2,
trigger:{player:'chooseToRespondBegin'},
filter:function(event,player){
if(event.responded) return false;
if(!event.filterCard({name:'shan'})) return false;
if(player.hasSkill('huomo2')) return false;
if(event.parent.name!='sha') return false;
var hs=player.getCards('he',{color:'black'});
for(var i=0;i0;
})){
switch(button.link[2]){
case 'tao':return 5;
case 'jiu':return 3.01;
case 'sha':
if(button.link[3]=='fire') return 2.95;
else if(button.link[3]=='fire') return 2.92;
else return 2.9;
}
}
return 0;
},
backup:function(links,player){
return {
filterCard:function(card){
return get.type(card)!='basic'&&get.color(card)=='black';
},
viewAs:{name:links[0][2],nature:links[0][3]},
position:'he',
popname:true,
precontent:function(){
'step 0'
var card=event.result.cards[0];
event.card=card;
player.$throw(card,1000);
game.log(player,'将',card,'置于牌堆顶');
event.result.cards.length=0;
player.lose(card);
'step 1'
game.delay();
'step 2'
ui.cardPile.insertBefore(event.card,ui.cardPile.firstChild);
},
}
},
prompt:function(links,player){
return '将一张黑色非基本牌置于牌堆顶并视为使用一张'+get.translation(links[0][3]||'')+get.translation(links[0][2]);
}
},
ai:{
order:function(){
var player=_status.event.player;
var event=_status.event;
if(!player.storage.huomo.jiu&&event.filterCard({name:'jiu'},player,event)&&get.effect(player,{name:'jiu'})>0){
return 3.1;
}
return 2.9;
},
save:true,
respondSha:true,
skillTagFilter:function(player,tag,arg){
if(player.hasCard(function(card){
return get.color(card)=='black'&&get.type(card)!='basic';
},'he')){
if(!player.storage.huomo) player.storage.huomo={};
if(tag=='respondSha'){
if(arg!='use') return false;
if(player.storage.huomo.sha) return false;
}
else{
if(player.storage.huomo.tao&&player.storage.huomo.jiu) return false;
}
}
else{
return false;
}
},
result:{
player:1
}
}
},
taoxi:{
audio:2,
trigger:{player:'useCardToBegin'},
filter:function(event,player){
return _status.currentPhase==player&&event.targets.length==1&&
event.target.countCards('h')>0&&!player.hasSkill('taoxi4')&&player!=event.target;
},
check:function(event,player){
return get.attitude(player,event.target)<0;
},
intro:{
content:'card'
},
content:function(){
var card=trigger.target.getCards('h').randomGet();
player.showCards([card]);
player.storage.taoxi=card;
player.storage.taoxi2=trigger.target;
player.syncStorage('taoxi');
player.markSkill('taoxi');
player.addTempSkill('taoxi4');
},
group:['taoxi2','taoxi3']
},
taoxi2:{
audio:false,
enable:'phaseUse',
filter:function(event,player){
if(player.storage.taoxi&&player.storage.taoxi2&&
get.owner(player.storage.taoxi)==player.storage.taoxi2&&
lib.filter.filterCard(player.storage.taoxi,player,event)){
return true;
}
return false;
},
filterTarget:function(card,player,target){
return player.canUse(player.storage.taoxi,target);
},
selectTarget:function(){
var info=get.info(_status.event.player.storage.taoxi);
if(info.notarget) return -1;
return get.select(info.selectTarget);
},
multitarget:true,
multiline:true,
content:function(){
'step 0'
var card=player.storage.taoxi;
if(!card){
event.finish();
return;
}
var owner=get.owner(card);
if(owner){
owner.lose(card,ui.special);
}
event.card=card;
player.$throw(card);
'step 1'
player.useCard(event.card,targets).animate=false;
delete player.storage.taoxi;
delete player.storage.taoxi2;
player.unmarkSkill('taoxi');
},
ai:{
order:8,
result:{
target:function(player,target){
return get.effect(target,player.storage.taoxi,player,target);
},
player:1
}
}
},
taoxi3:{
trigger:{player:'phaseEnd'},
forced:true,
popup:false,
filter:function(event,player){
return player.storage.taoxi?true:false;
},
content:function(){
if(get.owner(player.storage.taoxi)==player.storage.taoxi2){
player.loseHp();
}
delete player.storage.taoxi;
delete player.storage.taoxi2;
player.unmarkSkill('taoxi');
}
},
taoxi4:{},
xingshuai:{
skillAnimation:true,
audio:2,
trigger:{player:'dying'},
priority:6,
zhuSkill:true,
filter:function(event,player){
if(player.storage.xingshuai) return false;
if(player.hp>0) return false;
if(!player.hasZhuSkill('xingshuai')) return false;
return game.hasPlayer(function(current){
return current!=player&¤t.group=='wei';
});
},
init:function(player){
if(player.hasZhuSkill('xingshuai')){
player.markSkill('xingshuai');
player.storage.xingshuai=false;
}
},
intro:{
content:'limited'
},
unique:true,
content:function(){
'step 0'
player.storage.xingshuai=true;
player.awakenSkill('xingshuai');
var targets=game.filterPlayer();
targets.remove(player);
event.targets=targets;
event.damages=[];
'step 1'
if(event.targets.length){
var current=event.targets.shift();
if(current.group=='wei'){
current.chooseBool('是否令'+get.translation(player)+'回复一点体力?').set('ai',function(){
return get.attitude(_status.event.player,_status.event.target)>2;
}).set('target',player);
event.current=current;
}
else{
event.redo();
}
}
else{
event.goto(3);
}
'step 2'
if(result.bool){
event.damages.push(event.current);
event.current.line(player,'green');
game.log(event.current,'令',player,'回复一点体力');
}
if(event.targets.length){
event.goto(1);
}
'step 3'
if(event.damages.length){
player.recover(event.damages.length);
}
'step 4'
if(event.damages.length){
event.damages.shift().damage('nosource');
event.redo();
}
}
},
mingjian:{
enable:'phaseUse',
usable:1,
filterTarget:function(card,player,target){
return player!=target;
},
filter:function(event,player){
return player.countCards('h')>0;
},
filterCard:true,
selectCard:-1,
discard:false,
lose:true,
content:function(){
player.$give(cards.length,target);
target.gain(cards,player);
target.addTempSkill('mingjian2',{player:'phaseAfter'});
},
ai:{
order:1,
result:{
target:function(player,target){
if(target.hasSkillTag('nogain')) return 0;
if(player.countCards('h')==1&&player.countCards('h','du')) return -1;
if(player.hp<=2&&player.countCards('h','shan')) return 0;
if(target.countCards('h')+player.countCards('h')>target.hp+2) return 0;
if(get.attitude(player,target)>3) return 1;
return 0;
}
}
}
},
mingjian2:{
mark:true,
intro:{
content:'手牌上限+1,出杀次数+1'
},
mod:{
maxHandcard:function(player,num){
return num+1;
},
cardUsable:function(card,player,num){
if(card.name=='sha') return num+1;
}
},
},
mingjian_old:{
audio:2,
trigger:{player:'phaseUseBefore'},
direct:true,
filter:function(event,player){
return player.countCards('h')>0;
},
content:function(){
'step 0'
var go=Math.random()<0.5;
player.chooseTarget(get.prompt('mingjian'),function(card,player,target){
return player!=target
}).ai=function(target){
var att=get.attitude(player,target);
if(att>3){
if(player.countCards('h')>player.hp) return att;
if(go) return att;
}
return 0;
}
'step 1'
if(result.bool){
player.logSkill('mingjian',result.targets);
trigger.cancel();
var target=result.targets[0];
target.addSkill('mingjian2');
var hs=player.getCards('h');
target.gain(hs,player);
player.$give(hs.length,target);
}
}
},
mingjian2_old:{
audio:false,
trigger:{global:'phaseAfter'},
forced:true,
popup:false,
content:function(){
if(lib.config.glow_phase){
if(_status.currentPhase){
_status.currentPhase.classList.remove('glow_phase');
}
player.classList.add('glow_phase');
}
game.addVideo('phaseChange',player);
_status.currentPhase=player;
player.ai.tempIgnore=[];
player.stat.push({card:{},skill:{}});
player.phaseUse();
player.removeSkill('mingjian2');
}
},
huituo:{
audio:2,
trigger:{player:'damageEnd'},
direct:true,
content:function(){
'step 0'
player.chooseTarget(get.prompt('huituo')).set('ai',function(target){
var player=_status.event.player;
if(get.attitude(player,target)>0){
return get.recoverEffect(target,player,player)+1;
}
return 0;
});
'step 1'
if(result.bool){
player.logSkill('huituo',result.targets);
var target=result.targets[0];
event.target=target;
target.judge(function(card){
if(target.hp==target.maxHp){
if(get.color(card)=='red') return -1;
}
if(get.color(card)=='red') return 1;
return 0;
});
}
else{
event.finish();
}
'step 2'
if(result.color){
if(result.color=='red'){
if(event.target.hp0&&event.source&&event.source.getEquip(1)!=undefined&&
event.card&&event.card.name=='sha';
},
direct:true,
priority:5,
audio:2,
content:function(){
'step 0'
var next=player.chooseToDiscard('he',get.prompt('duodao'));
next.logSkill=['duodao',trigger.source];
next.set('ai',function(card){
if(get.attitude(_status.event.player,_status.event.getTrigger().source)<=0){
return 6-get.value(card);
}
return 0;
});
'step 1'
if(result.bool){
trigger.source.$give(trigger.source.getEquip(1),player);
player.gain(trigger.source.getEquip(1),trigger.source);
}
},
ai:{
maixie_defend:true,
}
},
anjian:{
audio:2,
trigger:{source:'damageBegin'},
check:function(event,player){
return get.attitude(player,event.player)<=0;
},
forced:true,
filter:function(event,player){
return event.card&&event.card.name=='sha'&&get.distance(event.player,player,'attack')>1&&
event.parent.name!='_lianhuan'&&event.parent.name!='_lianhuan2';
},
content:function(){
trigger.num++;
}
},
xinpojun:{
trigger:{player:'shaBegin'},
direct:true,
filter:function(event,player){
return event.target.hp>0&&event.target.countCards('he')>0;
},
audio:2,
logTarget:'target',
content:function(){
'step 0'
player.choosePlayerCard(trigger.target,'he',
[1,Math.min(trigger.target.countCards('he'),trigger.target.hp)],get.prompt('pojun',trigger.target));
'step 1'
if(result.bool&&result.links.length){
player.logSkill('xinpojun');
if(trigger.target.storage.xinpojun2){
trigger.target.storage.xinpojun2=trigger.target.storage.xinpojun2.concat(result.links);
}
else{
trigger.target.storage.xinpojun2=result.links;
}
game.addVideo('storage',trigger.target,['xinpojun2',get.cardsInfo(trigger.target.storage.xinpojun2),'cards']);
trigger.target.addSkill('xinpojun2');
trigger.target.lose(result.links,ui.special,'toStorage');
}
},
ai:{
expose:0.2
}
},
xinpojun2:{
trigger:{global:'phaseEnd'},
forced:true,
audio:false,
mark:true,
intro:{
content:'cardCount'
},
content:function(){
if(player.storage.xinpojun2){
player.gain(player.storage.xinpojun2,'fromStorage');
delete player.storage.xinpojun2;
}
player.removeSkill('xinpojun2');
},
group:'xinpojun3'
},
xinpojun3:{
trigger:{player:'dieBegin'},
forced:true,
popup:false,
content:function(){
player.$throw(player.storage.xinpojun2,1000);
for(var i=0;i=0;
},
priority:-5,
logTarget:'player',
content:function(){
game.asyncDraw([trigger.player,player]);
},
ai:{
expose:0.1
}
},
yanyu:{
audio:2,
enable:'phaseUse',
filter:function(event,player){
return player.countCards('h','sha')>0;
},
filterCard:{name:'sha'},
prepare:function(cards,player){
player.$throw(cards,1000);
},
discard:false,
delay:0.5,
content:function(){
"step 0"
player.draw();
"step 1"
for(var i=0;i=2;
},
content:function(){
'step 0'
player.chooseTarget(get.prompt('yanyu'),function(card,player,target){
return target.sex=='male'&&target!=player;
}).set('ai',function(target){
return get.attitude(_status.event.player,target);
});
'step 1'
if(result.bool){
player.logSkill('yanyu',result.targets);
result.targets[0].draw(2);
}
}
},
youdi:{
audio:true,
trigger:{player:'phaseEnd'},
direct:true,
filter:function(event,player){
return player.countCards('he')>0;
},
content:function(){
"step 0"
player.chooseTarget(get.prompt('youdi'),function(card,player,target){
return player!=target;
}).set('ai',function(target){
if(!_status.event.goon) return 0;
if(target.countCards('he')==0) return 0;
return -get.attitude(_status.event.player,target);
}).set('goon',player.countCards('h','sha')<=player.countCards('h')/3);
"step 1"
if(result.bool){
game.delay();
player.logSkill('youdi',result.targets);
event.target=result.targets[0];
event.target.discardPlayerCard(player,'he',true);
}
else{
event.finish();
}
"step 2"
if(result.links[0].name!='sha'&&event.target.countCards('he')){
player.gainPlayerCard('he',event.target,true);
}
},
ai:{
expose:0.2,
threaten:1.4
}
},
fuhun:{
enable:['chooseToUse','chooseToRespond'],
filterCard:true,
selectCard:2,
position:'h',
audio:2,
derivation:['new_rewusheng','new_repaoxiao'],
viewAs:{name:'sha'},
prompt:'将两张手牌当杀使用或打出',
check:function(card){
if(_status.event.player.hasSkill('new_rewusheng')&&get.color(card)=='red') return 0;
if(_status.event.name=='chooseToRespond'){
if(card.name=='sha') return 0;
return 6-get.useful(card);
}
if(_status.event.player.countCards('h')<4) return 6-get.useful(card);
return 7-get.useful(card);
},
ai:{
respondSha:true,
order:function(item,player){
if(player.hasSkill('new_rewusheng')&&player.hasSkill('new_repaoxiao')){
return 1;
}
if(player.countCards('h')<4){
return 1;
}
return 4;
},
},
group:'fuhun2'
},
fuhun2:{
trigger:{source:'damageAfter'},
forced:true,
filter:function(event,player){
if(player.hasSkill('fuhun3')) return false;
return event.getParent().skill=='fuhun';
},
content:function(){
player.addTempSkill('new_rewusheng');
player.addTempSkill('new_repaoxiao');
player.addTempSkill('fuhun3');
}
},
fuhun3:{},
fencheng:{
skillAnimation:'epic',
animationColor:'fire',
audio:2,
enable:'phaseUse',
filter:function(event,player){
return !player.storage.fencheng;
},
filterTarget:function(card,player,target){
return player!=target;
},
unique:true,
selectTarget:-1,
mark:true,
line:'fire',
content:function(){
"step 0"
player.storage.fencheng=true;
player.awakenSkill('fencheng');
var res=get.damageEffect(target,player,target,'fire');
var num=Math.max(1,target.countCards('e'));
target.chooseToDiscard(num,'he','弃置'+get.cnNumber(num)+'张牌或受到1点火焰伤害').set('ai',function(card){
var res=_status.event.res;
var num=_status.event.num;
var player=_status.event.player;
if(res>=0) return -1;
if(num>2&&player.hp>1) return -1;
if(num>1&&player.hp>2) return -1;
if(get.position(card)=='e'){
return 10-get.value(card);
}
return 6-get.value(card);
}).set('res',res).set('num',num);
"step 1"
if(!result.bool){
target.damage('fire');
}
},
ai:{
order:1,
result:{
player:function(player){
var num=0,players=game.filterPlayer();
for(var i=0;i0){
num-=Math.max(1,players[i].countCards('e'));
}
else if(att<0){
num+=Math.max(1,players[i].countCards('e'));
}
}
}
if(players.length<5){
return num-1;
}
else{
return num-2;
}
}
}
},
init:function(player){
player.storage.fencheng=false;
},
intro:{
content:'limited'
}
},
mieji:{
trigger:{player:'useCard'},
direct:true,
audio:2,
filter:function(event,player){
return event.targets.length==1&&get.type(event.card)=='trick'&&get.color(event.card)=='black';
},
position:'he',
content:function(){
"step 0"
player.chooseTarget(get.prompt('mieji'),function(card,player,target){
var trigger=_status.event.getTrigger();
return lib.filter.filterTarget(trigger.card,player,target)&&target!=trigger.targets[0];
}).set('autodelay',true).set('ai',function(target){
var trigger=_status.event.getTrigger();
var player=_status.event.player;
return get.effect(target,trigger.card,player,player);
});
"step 1"
if(result.bool){
trigger.targets.push(result.targets[0]);
player.logSkill('mieji',result.targets);
}
}
},
junxing:{
enable:'phaseUse',
audio:2,
usable:1,
filterCard:true,
selectCard:[1,Infinity],
filter:function(event,player){
return player.countCards('h')>0;
},
check:function(card){
if(ui.selected.cards.length) return -1;
var val=get.value(card);
if(get.type(card)=='basic') return 8-get.value(card);
return 5-get.value(card);
},
filterTarget:function(card,player,target){
return player!=target;
},
content:function(){
"step 0"
var types=[];
for(var i=0;i0;
},
filter:function(event,player){
if(event.player.countCards('h')) return false;
if(_status.currentPhase!=player) return false;
if(event.player==player) return false;
for(var i=0;i2){
if(game.phaseNumber0&&event.player.countCards('j')) return true;
if(event.num>1){
if(att<0) return false;
if(att>0) return true;
}
var cards=event.player.getGainableCards(player,'e');
for(var i=0;i=6) return true;
}
return false;
},
logTarget:'player',
content:function(){
if(trigger.player.countGainableCards(player,'ej')){
player.gainPlayerCard(trigger.player,'ej',true);
}
trigger.cancel();
}
},
sanyao:{
audio:2,
enable:'phaseUse',
usable:1,
filterTarget:function(card,player,target){
return target.isMaxHp();
},
check:function(card){return 7-get.value(card);},
position:'he',
filterCard:true,
content:function(){
target.damage();
},
ai:{
result:{
target:function(player,target){
if(target.countCards('j')&&get.attitude(player,target)>0){
return 1;
}
if(target.countCards('e')){
return -1;
}
return get.damageEffect(target,player);
},
},
order:7
}
},
qiaoshui:{
audio:2,
trigger:{player:'phaseUseBegin'},
direct:true,
filter:function(event,player){
return player.countCards('h')>0;
},
content:function(){
"step 0"
player.chooseTarget(get.prompt('qiaoshui'),function(card,player,target){
return player.canCompare(target);
}).set('ai',function(target){
return -get.attitude(_status.event.player,target)/target.countCards('h');
});
"step 1"
if(result.bool){
player.logSkill('qiaoshui',result.targets[0]);
player.chooseToCompare(result.targets[0]);
}
else{
event.finish();
}
"step 2"
if(result.bool){
player.addTempSkill('qiaoshui3');
}
else{
player.addTempSkill('qiaoshui2');
}
},
ai:{
expose:0.1
}
},
qiaoshui2:{
mod:{
cardEnabled:function(card){
if(get.type(card,'trick')=='trick') return false;
}
}
},
qiaoshui3:{
trigger:{player:'useCard'},
direct:true,
filter:function(event,player){
var type=get.type(event.card);
return type=='basic'||type=='trick';
},
content:function(){
'step 0'
player.removeSkill('qiaoshui3');
var goon=false;
var info=get.info(trigger.card);
if(trigger.targets&&!info.multitarget){
var players=game.filterPlayer();
for(var i=0;i1){
event.goto(3);
}
}
'step 1'
if(result.bool){
if(!event.isMine()) game.delayx();
event.target=result.targets[0];
}
else{
event.finish();
}
'step 2'
if(event.target){
player.logSkill('qiaoshui',event.target);
trigger.targets.add(event.target);
}
event.finish();
'step 3'
player.chooseTarget('巧说:是否减少一名'+get.translation(trigger.card)+'的目标?',function(card,player,target){
return _status.event.getTrigger().targets.contains(target);
}).set('ai',function(target){
var trigger=_status.event.getTrigger();
return -get.effect(target,trigger.card,trigger.player,_status.event.player);
});
'step 4'
if(result.bool){
event.targets=result.targets;
if(event.isMine()){
player.logSkill('qiaoshui',event.targets);
event.finish();
}
for(var i=0;i1) return false;
return event.card&&get.type(event.card)=='trick'&&event.player!=player;
},
frequent:true,
content:function(){
player.draw();
},
ai:{
effect:function(card,player,target){
if(get.type(card)=='trick') return [1,1];
},
}
},
shenxing:{
audio:2,
enable:'phaseUse',
position:'he',
filterCard:true,
selectCard:2,
prompt:'弃置两张牌并摸一张牌',
check:function(card){return 4-get.useful(card)},
content:function(){
player.draw();
},
ai:{
order:1,
result:{
player:1
},
},
},
bingyi:{
audio:2,
trigger:{player:'phaseDiscardEnd'},
filter:function(event,player){
var cards=player.getCards('h');
if(cards.length<1) return false;
var color=get.color(cards[0]);
for(var i=1;i=2) return false;
if(player.hp==1) return false;
if(player.hp==2&&player.countCards('h')<2) return false;
if(event.player.countCards('h')>=event.player.hp) return false;
return true;
},
content:function(){
"step 0"
player.draw(2);
"step 1"
player.chooseCard(2,'he',true,'交给'+get.translation(trigger.player)+'两张牌').set('ai',function(card){
if(ui.selected.cards.length&&card.name==ui.selected.cards[0].name) return -1;
if(get.tag(card,'damage')) return 1;
if(get.type(card)=='equip') return 1;
return 0;
});
"step 2"
trigger.player.gain(result.cards,player);
if(player==game.me||trigger.player==game.me)
player.$give(result.cards,trigger.player);
else
player.$give(2,trigger.player);
game.delay();
trigger.player.addSkill('xiantu2');
trigger.player.storage.xiantu=player;
},
ai:{
threaten:1.1,
expose:0.3
}
},
xiantu2:{
trigger:{player:'phaseUseEnd'},
forced:true,
audio:false,
content:function(){
if(player.storage.xiantu){
player.storage.xiantu.loseHp();
delete player.storage.xiantu;
}
player.removeSkill('xiantu2');
},
group:'xiantu3'
},
xiantu3:{
trigger:{source:'dieAfter'},
forced:true,
audio:false,
content:function(){
delete player.storage.xiantu;
player.removeSkill('xiantu2');
}
},
qiangzhi:{
audio:2,
trigger:{player:'phaseUseBegin'},
direct:true,
filterTarget:function(card,player,target){
return target!=player&&target.countCards('h')>0;
},
content:function(){
'step 0'
player.chooseTarget(get.prompt('qiangzhi'),function(card,player,target){
return target!=player&&target.countCards('h')>0;
}).set('ai',function(){
return Math.random();
});
'step 1'
if(result.bool){
var target=result.targets[0];
player.logSkill('qiangzhi',target);
var card=target.getCards('h').randomGet();
player.showCards(card);
player.storage.qiangzhi=get.type(card,'trick');
game.addVideo('storage',player,['qiangzhi',player.storage.qiangzhi]);
player.markSkill('qiangzhi');
}
},
intro:{
content:function(type){
return get.translation(type)+'牌';
}
},
group:['qiangzhi2','qiangzhi3'],
ai:{
order:11,
result:{
player:1
}
}
},
qiangzhi2:{
trigger:{player:'useCard'},
frequent:true,
filter:function(event,player){
// return (get.type(event.card,'trick')==player.storage.qiangzhi&&event.cards[0]&&event.cards[0]==event.card);
return get.type(event.card,'trick')==player.storage.qiangzhi;
},
content:function(){
player.draw();
},
ai:{
threaten:1.4
}
},
qiangzhi3:{
trigger:{player:'phaseUseEnd'},
silent:true,
content:function(){
delete player.storage.qiangzhi;
player.unmarkSkill('qiangzhi');
}
},
dingpin:{
enable:'phaseUse',
usable:3,
audio:2,
filter:function(event,player){
return player.countCards('h')>0;
},
filterTarget:function(card,player,target){
return target.hp0;
},
logTarget:'player',
content:function(){
trigger.player.draw();
},
ai:{
expose:0.2
}
},
jiaojin:{
audio:2,
trigger:{player:'damageBegin'},
filter:function(event,player){
return player.countCards('he',{type:'equip'})&&event.source&&event.source.sex=='male';
},
direct:true,
content:function(){
"step 0"
var next=player.chooseToDiscard('he','骄矜:是否弃置一张装备牌令伤害-1?',function(card,player){
return get.type(card)=='equip';
});
next.set('ai',function(card){
var player=_status.event.player;
if(player.hp==1||_status.event.getTrigger().num>1){
return 9-get.value(card);
}
if(player.hp==2){
return 8-get.value(card);
}
return 7-get.value(card);
});
next.logSkill='jiaojin';
"step 1"
if(result.bool){
game.delay(0.5);
trigger.num--;
}
}
},
chanhui:{
audio:2,
trigger:{player:'useCard'},
filter:function(event,player){
if(_status.currentPhase!=player) return false;
if(player.hasSkill('chanhui2')) return false;
if(event.targets.length>1) return false;
var card=event.card;
if(card.name=='sha') return true;
if(get.color(card)=='black'&&get.type(card)=='trick') return true;
return false;
},
direct:true,
content:function(){
"step 0"
player.chooseTarget(get.prompt('chanhui'),function(card,player,target){
if(player==target) return false;
var trigger=_status.event.getTrigger();
return player.canUse(trigger.card,target)&&trigger.targets.contains(target)==false;
}).set('ai',function(target){
var trigger=_status.event.getTrigger();
var player=_status.event.player;
return get.effect(target,trigger.card,player,player)+0.01;
});
"step 1"
if(result.bool){
game.delay(0,200);
event.target=result.targets[0];
}
else{
event.finish();
}
"step 2"
game.delay();
player.addSkill('chanhui2');
player.logSkill('chanhui',event.target);
event.target.chooseCard('交给'+get.translation(player)+'一张手牌,或成为'+
get.translation(trigger.card)+'的额外目标').set('ai',function(card){
return 5-get.value(card);
});
"step 3"
if(result.bool){
player.gain(result.cards,event.target);
event.target.$give(1,player);
game.delay();
trigger.untrigger();
trigger.player=event.target;
trigger.trigger('useCard');
game.log(event.target,'成为了',trigger.card,'的使用者');
}
else{
game.log(event.target,'成为了',trigger.card,'的额外目标');
trigger.targets.push(event.target);
}
}
},
chanhui2:{
trigger:{player:'phaseEnd'},
forced:true,
popup:false,
audio:false,
content:function(){
player.removeSkill('chanhui2');
}
},
quanji:{
audio:2,
trigger:{player:'damageEnd'},
frequent:true,
locked:false,
notemp:true,
init:function(player){
player.storage.quanji=[];
},
filter:function(event){
return event.num>0;
},
content:function(){
"step 0"
player.draw(trigger.num);
"step 1"
if(player.countCards('he')){
player.chooseCard('将'+get.cnNumber(trigger.num)+'张手牌置于武将牌上作为“权”',trigger.num,true);
}
else{
event.finish();
}
"step 2"
if(result.cards&&result.cards.length){
player.lose(result.cards,ui.special,'toStorage');
player.storage.quanji=player.storage.quanji.concat(result.cards);
player.syncStorage('quanji');
player.markSkill('quanji');
game.log(player,'将',result.cards,'置于武将牌上作为“权”');
}
},
intro:{
content:'cards'
},
mod:{
maxHandcard:function(player,num){
return num+player.storage.quanji.length;
}
},
ai:{
maixie:true,
maixie_hp:true,
threaten:0.8,
effect:{
target:function(card,player,target){
if(get.tag(card,'damage')){
if(player.hasSkillTag('jueqing',false,target)) return [1,-2];
if(!target.hasFriend()) return;
if(target.hp>=4) return [0.5,get.tag(card,'damage')*2];
if(!target.hasSkill('paiyi')&&target.hp>1) return [0.5,get.tag(card,'damage')*1.5];
if(target.hp==3) return [0.5,get.tag(card,'damage')*1.5];
if(target.hp==2) return [1,get.tag(card,'damage')*0.5];
}
}
}
}
},
zili:{
skillAnimation:true,
audio:3,
unique:true,
trigger:{player:'phaseBegin'},
forced:true,
filter:function(event,player){
return !player.hasSkill('paiyi')&&player.storage.quanji&&player.storage.quanji.length>=3;
},
content:function(){
"step 0"
player.chooseDrawRecover(2,true,function(event,player){
if(player.hp==1&&player.isDamaged()) return 'recover_hp';
return 'draw_card';
});
"step 1"
player.loseMaxHp();
player.addSkill('paiyi');
player.awakenSkill('zili');
}
},
paiyi:{
enable:'phaseUse',
usable:1,
audio:2,
filterTarget:true,
filter:function(event,player){
return player.storage.quanji.length>0;
},
content:function(){
"step 0"
player.chooseCardButton(player.storage.quanji,true);
"step 1"
var card=result.links[0];
card.discard();
player.$throw(card);
player.storage.quanji.remove(card);
if(!player.storage.quanji.length){
player.unmarkSkill('quanji');
}
else{
player.markSkill('quanji');
}
player.syncStorage('quanji');
"step 2"
target.draw(2);
"step 3"
if(target.countCards('h')>player.countCards('h')){
target.damage();
}
},
ai:{
order:1,
result:{
target:function(player,target){
if(player!=target) return 0;
if(player.countCards('h')+2<=player.hp+player.storage.quanji.length) return 1;
return 0;
}
}
}
},
xianzhou:{
skillAnimation:true,
audio:2,
unique:true,
enable:'phaseUse',
filter:function(event,player){
return !player.storage.xianzhou&&player.countCards('e')>0;
},
init:function(player){
player.storage.xianzhou=false;
},
filterTarget:function(card,player,target){
return player!=target;
},
mark:true,
content:function(){
"step 0"
player.awakenSkill('xianzhou');
var cards=player.getCards('e');
target.gain(cards,player);
event.num=cards.length;
player.$give(cards,target);
player.storage.xianzhou=true;
game.delay();
"step 1"
target.chooseTarget([1,event.num],'令'+get.translation(player)+'回复'+
event.num+'点体力,或对攻击范围内的'+event.num+'名角色造成一点伤害',function(card,player,target2){
return get.distance(_status.event.player,target2,'attack')<=1;
}).set('ai',function(target2){
var target=_status.event.player;
var player=_status.event.getParent().player;
if(get.attitude(target,player)>0){
if(player.hp+event.num<=player.maxHp||player.hp==1) return -1;
}
return get.damageEffect(target2,target,target);
});
"step 2"
if(result.bool){
target.line(result.targets,'green');
event.targets=result.targets;
event.num2=0;
}
else{
player.recover(event.num);
event.finish();
}
"step 3"
if(event.num22&&get.attitude(players[i],player)>2){
bool=false;break;
}
}
if(bool) return -10;
if(player.hp==1) return 1;
if(game.phaseNumber0){
return '移动装备';
}
}
else{
if(att<=0){
return '移动装备';
}
}
return 'draw_card';
}).set('source',trigger.player);
}
else{
next=player.chooseControl('draw_card','cancel2',function(){
return 'draw_card';
});
}
next.set('prompt',get.prompt('qieting',trigger.player));
"step 1"
if(result.control=='移动装备'){
player.logSkill('qieting',trigger.player);
player.choosePlayerCard(trigger.player,'e','将一张装备牌移至你的装备区').set('filterButton',function(button){
return _status.event.player.isEmpty(get.subtype(button.link));
});
}
else{
if(result.control=='draw_card'){
player.logSkill('qieting');
player.draw();
}
event.finish();
}
"step 2"
if(result&&result.links&&result.links.length){
game.delay(2);
trigger.player.$give(result.links[0],player);
player.equip(result.links[0]);
player.addExpose(0.2);
}
},
},
qieting2:{
trigger:{player:'useCard'},
filter:function(event,player){
return _status.currentPhase==player&&event.targets&&(event.targets.length>1||event.targets[0]!=player);
},
forced:true,
popup:false,
content:function(){
player.addTempSkill('qieting3');
}
},
qieting3:{},
zhuikong:{
audio:2,
trigger:{global:'phaseBegin'},
check:function(event,player){
if(get.attitude(player,event.player)<-2){
var cards=player.getCards('h');
if(cards.length>player.hp) return true;
for(var i=0;i9&&useful<7) return true;
}
}
return false;
},
logTarget:'player',
filter:function(event,player){
return player.hp=0?1:-1;
}).set('source',player);
game.delay();
}
else{
event.finish();
}
"step 2"
if(result.bool){
player.gain(result.cards,event.target);
event.target.$give(result.cards,player);
game.delay();
}
else{
trigger.targets.push(event.target);
game.log(event.target,'成为了额外目标');
}
},
ai:{
expose:0.2,
effect:{
target:function(card,player,target){
if(card.name!='sha') return;
var players=game.filterPlayer();
for(var i=0;i1){
return 11-get.equipValue(card);
}
return 6-get.equipValue(card);
},
content:function(){
"step 0"
player.addTempSkill('gongji2');
"step 1"
if(get.type(cards[0])=='equip'){
player.chooseTarget('是否弃置一名角色的一张牌?',function(card,player,target){
return player!=target&&target.countCards('he')>0;
}).set('ai',function(target){
var player=_status.event.player;
if(get.attitude(player,target)<0){
return Math.max(0.5,get.effect(target,{name:'sha'},player,player));
}
return 0;
});
}
else{
event.finish();
}
"step 2"
if(result.bool){
player.line(result.targets,'green');
event.target=result.targets[0];
player.discardPlayerCard(event.target,'he',true).ai=get.buttonValue;
}
},
ai:{
order:9,
result:{
player:1
}
}
},
gongji2:{
mod:{
attackFrom:function(){
return -Infinity;
},
},
},
zhuiyi:{
audio:2,
trigger:{player:'dieBegin'},
direct:true,
skillAnimation:true,
content:function(){
"step 0"
player.chooseTarget(get.prompt('zhuiyi'),function(card,player,target){
return player!=target&&_status.event.source!=target;
}).set('ai',function(target){
var num=get.attitude(_status.event.player,target);
if(num>0){
if(target.hp==1){
num+=2;
}
if(target.hpplayers[i].countCards('h')) return true;
}
return false;
},
selectTarget:2,
content:function(){
'step 0'
var gainner,giver;
if(targets[0].countCards('h')0) return -1;
var players=game.filterPlayer();
for(var i=0;i=0&&num2players[i].countCards('h')) return true;
}
return false;
},
selectTarget:2,
content:function(){
'step 0'
var gainner,giver;
if(targets[0].countCards('h')0) return -1;
var players=game.filterPlayer();
for(var i=0;i=0&&num20||player.countCards('he',{type:'equip'})>0;
},
check:function(card){return 8-get.value(card)},
selectTarget:2,
multitarget:true,
discard:false,
targetprompt:['得到牌','出杀目标'],
prepare:'give',
filterTarget:function(card,player,target){
if(ui.selected.targets.length==0){
return player!=target;
}
else{
return lib.filter.filterTarget({name:'sha'},ui.selected.targets[0],target);
}
},
content:function(){
"step 0"
targets[0].gain(cards,player);
"step 1"
targets[0].chooseControl('draw_card','出杀',function(){
var player=_status.event.player;
var target=_status.event.target;
if(get.effect(_status.event.target,{name:'sha'},player,player)>0){
return 1;
}
return 0;
}).set('target',targets[1]).set('prompt','对'+get.translation(targets[1])+'使用一张杀,或摸一张牌');
"step 2"
if(result.control=='draw_card'){
targets[0].draw();
}
else{
targets[0].useCard({name:'sha'},targets[1]);
}
},
ai:{
result:{
player:function(player){
var players=game.filterPlayer();
for(var i=0;i1&&get.attitude(players[i],player)>1){
return 1;
}
}
return 0;
},
target:function(player,target){
if(ui.selected.targets.length){
return -0.1;
}
return 1;
}
},
order:8.5,
expose:0.2
}
},
xinxuanhuo:{
audio:2,
trigger:{player:'phaseDrawBegin'},
direct:true,
content:function(){
"step 0"
player.chooseTarget(get.prompt('xinxuanhuo'),function(card,player,target){
return player!=target;
}).set('ai',function(target){
var att=get.attitude(_status.event.player,target);
if(att>0){
if(target.countCards('h')1&&check<2) return 0;
return get.unuseful(card)+9;
},
ai2:function(target){
var att=get.attitude(_status.event.player,target);
if(ui.selected.cards.length==1&&ui.selected.cards[0].name=='du') return 1-att;
return att-2;
},
prompt:'将'+get.cnNumber(event.num)+'张手牌交给一名其他角色',
}).set('check',check);
"step 2"
if(result.bool){
result.targets[0].gain(result.cards,event.player);
event.player.$give(result.cards.length,result.targets[0]);
player.line(result.targets,'green');
}
},
ai:{
threaten:function(player,target){
if(target.hp==1) return 3;
if(target.hp==2) return 1.5;
return 0.5;
},
effect:{
target:function(card,player,target){
if(get.tag(card,'recover')&&player.hp>=player.maxHp-1) return [0,0];
}
}
}
},
zhenlie:{
audio:2,
filter:function(event,player){
return event.player!=player&&event.targets&&event.targets.contains(player)&&event.card&&(event.card.name=='sha'||get.type(event.card)=='trick');
},
logTarget:'player',
check:function(event,player){
if(get.attitude(player,event.player)>0){
return false;
}
if(get.tag(event.card,'respondSha')){
if(player.countCards('h',{name:'sha'})==0){
return true;
}
}
else if(get.tag(event.card,'respondShan')){
if(player.countCards('h',{name:'shan'})==0){
return true;
}
}
else if(get.tag(event.card,'damage')){
if(player.countCards('h')<2) return true;
}
else if(event.card.name=='shunshou'&&player.hp>2){
return true;
}
return false;
},
priority:10,
trigger:{global:'useCard'},
content:function(){
"step 0"
player.loseHp();
"step 1"
trigger.targets.remove(player);
"step 2"
if(trigger.player.countCards('he')){
player.discardPlayerCard(trigger.player,'he',true);
}
},
ai:{
expose:0.3
}
},
wuyan:{
audio:2,
trigger:{target:'useCardToBefore',player:'useCardToBefore'},
forced:true,
priority:15,
check:function(event,player){
return get.effect(event.target,event.card,event.player,player)<0;
},
filter:function(event,player){
if(!event.target) return false;
if(event.player==player&&event.target==player) return false;
return (get.type(event.card)=='trick');
},
content:function(){
trigger.cancel();
},
ai:{
effect:{
target:function(card,player,target,current){
if(get.type(card)=='trick'&&player!=target) return 'zeroplayertarget';
},
player:function(card,player,target,current){
if(get.type(card)=='trick'&&player!=target) return 'zeroplayertarget';
}
}
}
},
xinwuyan:{
audio:2,
trigger:{source:'damageBefore',player:'damageBefore'},
forced:true,
priority:15,
check:function(event,player){
if(player==event.player) return true;
return false;
},
filter:function(event,player){
return get.type(event.card,'trick')=='trick';
},
content:function(){
trigger.cancel();
},
ai:{
notrick:true,
notricksource:true,
effect:{
target:function(card,player,target,current){
if(get.type(card)=='trick'&&get.tag(card,'damage')){
return 'zeroplayertarget';
}
},
player:function(card,player,target,current){
if(get.type(card)=='trick'&&get.tag(card,'damage')){
return 'zeroplayertarget';
}
}
}
}
},
xinjujian:{
trigger:{player:'phaseEnd'},
direct:true,
audio:2,
filter:function(event,player){
return player.countCards('he')>player.countCards('he',{type:'basic'});
},
content:function(){
"step 0"
player.chooseCardTarget({
filterTarget:function(card,player,target){
return player!=target;
},
filterCard:function(card,player){
return get.type(card)!='basic'&&lib.filter.cardDiscardable(card,player);
},
ai1:function(card){
if(get.tag(card,'damage')&&get.type(card)=='trick'){
return 20;
}
return 9-get.value(card);
},
ai2:function(target){
var att=get.attitude(_status.event.player,target);
if(att>0){
if(target.isTurnedOver()) att+=3;
if(target.hp==1) att+=3;
}
return att;
},
position:'he',
prompt:get.prompt('xinjujian')
});
"step 1"
if(result.bool){
var target=result.targets[0];
event.target=target;
player.logSkill('xinjujian',target);
player.discard(result.cards);
if(target.hp==target.maxHp&&
!target.isTurnedOver()&&
!target.isLinked()){
target.draw(2);
event.finish();
}
else{
var controls=['draw_card'];
if(target.hp2){
return 'recover_hp';
}
else if(target.hp==2&&target.maxHp>2&&target.countCards('h')>1){
return 'recover_hp';
}
else{
return 'draw_card';
}
}
}
}
else{
event.finish();
}
"step 2"
event.control=result.control;
switch(event.control){
case 'recover_hp':event.target.recover();event.finish();break;
case 'draw_card':event.target.draw(2);event.finish();break;
case 'reset_character':if(event.target.isTurnedOver()) event.target.turnOver();break;
}
"step 3"
if(event.control=='reset_character'&&event.target.isLinked()){
event.target.link();
}
},
ai:{
expose:0.2,
threaten:1.4
}
},
jujian:{
enable:'phaseUse',
usable:1,
audio:2,
filterCard:true,
position:'he',
selectCard:[1,3],
check:function(card){
var player=get.owner(card);
if(get.type(card)=='trick') return 10;
if(player.countCards('h')-player.hp-ui.selected.cards.length>0){
return 8-get.value(card);
}
return 4-get.value(card);
},
filterTarget:function(card,player,target){
return player!=target;
},
content:function(){
target.draw(cards.length);
if(cards.length==3){
if(get.type(cards[0],'trick')==get.type(cards[1],'trick')&&
get.type(cards[0],'trick')==get.type(cards[2],'trick')){
player.recover();
}
}
},
ai:{
expose:0.2,
order:1,
result:{
target:1
}
}
},
yizhong:{
trigger:{target:'shaBefore'},
forced:true,
audio:2,
filter:function(event,player){
if(player.getEquip(2)) return false;
return (event.card.name=='sha'&&get.color(event.card)=='black')
},
content:function(){
trigger.cancel();
},
ai:{
effect:{
target:function(card,player,target){
if(player==target&&get.subtype(card)=='equip2'){
if(get.equipValue(card)<=8) return 0;
}
if(target.getEquip(2)) return;
if(card.name=='sha'&&get.color(card)=='black') return 'zerotarget';
}
}
}
},
jueqing:{
trigger:{source:'damageBefore'},
forced:true,
audio:2,
priority:16,
check:function(){return false;},
content:function(){
trigger.cancel();
var ex=0;
if(trigger.card&&trigger.card.name=='sha'){
if(player.hasSkill('jiu')) ex++;
if(player.hasSkill('luoyi2')) ex++;
if(player.hasSkill('reluoyi2')) ex++;
}
trigger.player.loseHp(trigger.num+ex);
},
ai:{
jueqing:true
}
},
shangshi:{
audio:2,
trigger:{player:['loseEnd','changeHp']},
frequent:true,
filter:function(event,player){
return (player.countCards('h')<(player.maxHp-player.hp));
},
content:function(){
player.draw(player.maxHp-player.hp-player.countCards('h'));
},
ai:{
noh:true,
skillTagFilter:function(player,tag){
if(tag=='noh'&&player.maxHp-player.hp0) return 0;
if(player.getEquip('zhuge')&&player.countCards('h','sha')>1) return 0;
if(!player.countCards('h','sha')) return 0;
var targets=[];
var target;
var players=game.filterPlayer();
for(var i=0;inum){
target=targets[i];
num=num2;
}
}
if(num<=0) return 0;
var e2=target.getEquip(2);
if(e2){
if(e2.name=='tengjia'){
if(!player.countCards('h',{name:'sha',nature:'fire'})&&!player.getEquip('zhuque')) return 0;
}
if(e2.name=='renwang'){
if(!player.countCards('h',{name:'sha',color:'red'})) return 0;
}
if(e2.name=='baiyin') return 0;
}
if(player.getEquip('guanshi')&&player.countCards('he')>2) return 1;
return target.countCards('h')>3?0:1;
}
if(player==_status.event.dying||player.isTurnedOver()) return 3;
}
},
effect:{
target:function(card,player,target){
if(card.name=='guiyoujie') return [0,0.5];
if(target.isTurnedOver()){
if(get.tag(card,'damage')){
if(player.hasSkillTag('jueqing',false,target)) return [1,-2];
if(target.hp==1) return;
return [1,target.countCards('h')/2];
}
}
}
}
},
},
jiushi2:{
trigger:{player:'damageBegin'},
silent:true,
filter:function(event,player){
return player.classList.contains('turnedover');
},
content:function(){
player.storage.jiushi=true;
}
},
jiushi3:{
audio:2,
trigger:{player:'damageAfter'},
check:function(event,player){
return player.isTurnedOver();
},
filter:function(event,player){
if(player.storage.jiushi){
return true;
}
return false;
},
content:function(){
player.storage.jiushi=false;
player.turnOver();
}
},
zongshi:{
mod:{
maxHandcard:function(player,num){
return num+game.countGroup();
}
}
},
zishou:{
audio:2,
trigger:{player:'phaseDrawBegin'},
check:function(event,player){
return player.countCards('h')<=player.maxHp||player.skipList.contains('phaseUse');
},
content:function(){
trigger.num+=game.countGroup();
player.addTempSkill('zishou2');
},
ai:{
threaten:1.5
}
},
zishou2:{
mod:{
playerEnabled:function(card,player,target){
if(player!=target) return false;
}
}
},
olddanshou:{
trigger:{source:'damageEnd'},
priority:9,
check:function(event,player){
return get.attitude(player,event.player)<=0;
},
content:function(){
"step 0"
player.draw();
"step 1"
var evt=_status.event.getParent('phase');
if(evt){
game.resetSkills();
_status.event=evt;
_status.event.finish();
_status.event.untrigger(true);
}
},
ai:{
jueqing:true
}
},
danshou:{
enable:'phaseUse',
filterCard:true,
position:'he',
audio:2,
filter:function(event,player){
var num=player.getStat().skill.danshou;
if(num){
num++;
}
else{
num=1;
}
return player.countCards('he')>=num;
},
check:function(card){
if(ui.selected.cards.length>=2){
return 4-get.value(card);
}
return 6-get.value(card);
},
selectCard:function(card){
var num=_status.event.player.getStat().skill.danshou;
if(num) return num+1;
return 1;
},
filterTarget:function(card,player,target){
if(player==target) return false;
var num=player.getStat().skill.danshou;
if(num){
num++;
}
else{
num=1;
}
if(num<=2&&!target.countCards('he')) return false;
return get.distance(player,target,'attack')<=1;
},
content:function(){
'step 0'
var num=player.getStat().skill.danshou;
switch(num){
case 1:player.discardPlayerCard(target,true);break;
case 2:target.chooseCard('选择一张牌交给'+get.translation(player),'he',true);break;
case 3:target.damage();break;
default:game.asyncDraw([player,target],2);
}
if(num!=2) event.finish();
'step 1'
if(result.cards){
player.gain(result.cards,target);
target.$give(result.cards.length,player);
}
},
ai:{
order:8.6,
result:{
target:function(player,target){
var num=player.getStat().skill.danshou;
if(num){
num++;
}
else{
num=1;
}
if(num>3) return 0;
if(num==3) return get.damageEffect(target,player,target);
return -1;
}
}
}
},
qice:{
enable:'phaseUse',
usable:1,
audio:2,
filter:function(event,player){
return player.countCards('h')>0
},
chooseButton:{
dialog:function(){
var list=['taoyuan','wugu','juedou','huogong','jiedao','tiesuo','guohe','shunshou','wuzhong','wanjian','nanman'];
for(var i=0;i0&&!players[i].hasSha()){
return (button.link[2]=='juedou')?2:-1;
}
if(!players[i].isOut()){
if(players[i].hp0){
if(players[i].hp<2){
lose--;
recover+=0.5;
}
lose--;
recover++;
}
else if(get.attitude(player,players[i])<0){
if(players[i].hp<2){
lose++;
recover-=0.5;
}
lose++;
recover--;
}
}
else{
if(get.attitude(player,players[i])>0){
lose--;
}
else if(get.attitude(player,players[i])<0){
lose++;
}
}
}
}
if(lose>recover&&lose>0) return (button.link[2]=='nanman')?1:-1;
if(lose0) return (button.link[2]=='taoyuan')?1:-1;
return (button.link[2]=='wuzhong')?1:-1;
},
backup:function(links,player){
return {
filterCard:true,
selectCard:-1,
audio:2,
popname:true,
viewAs:{name:links[0][2]},
}
},
prompt:function(links,player){
return '将全部手牌当作'+get.translation(links[0][2])+'使用';
}
},
ai:{
order:1,
result:{
player:function(player){
var num=0;
var cards=player.getCards('h');
if(cards.length>=3&&player.hp>=3) return 0;
for(var i=0;i1
}
else{
for(var i=0;i3&&player.countCards('h','sha')>1){
return 'jiangchi_less';
}
if(player.countCards('h','sha')>2){
return 'jiangchi_less';
}
if(player.hp-player.countCards('h')>1){
return 'jiangchi_more';
}
return 'cancel2';
});
"step 1"
if(result.control=='jiangchi_less'){
trigger.num--;
player.addTempSkill('jiangchi2','phaseUseEnd');
player.logSkill('jiangchi');
}
else if(result.control=='jiangchi_more'){
trigger.num++;
player.addTempSkill('jiangchi3','phaseUseEnd');
player.logSkill('jiangchi');
}
}
},
jiangchi2:{
mod:{
targetInRange:function(card,player,target,now){
if(card.name=='sha') return true;
},
cardUsable:function(card,player,num){
if(card.name=='sha') return num+1;
}
}
},
jiangchi3:{
mod:{
cardEnabled:function(card){if(card.name=='sha') return false}
}
},
xinzhan:{
audio:2,
enable:'phaseUse',
filter:function(event,player){
return true;//player.countCards('h')>player.maxHp;
},
usable:1,
content:function(){
"step 0"
var cards=get.cards(3);
event.cards=cards;
var next=player.chooseCardButton(cards,'选择获得的红桃牌',[1,Infinity]).set('filterButton',function(button){
return get.suit(button.link)=='heart';
});
"step 1"
if(result.bool){
player.gain(result.links);
player.$draw(result.links);
game.delay(2);
}
for(var i=event.cards.length-1;i>=0;i--){
if(!result.bool||!result.links.contains(event.cards[i])){
ui.cardPile.insertBefore(event.cards[i],ui.cardPile.firstChild);
}
}
},
ai:{
order:11,
result:{
player:1
}
}
},
huilei:{
audio:2,
trigger:{player:'dieBegin'},
forced:true,
filter:function(event){
return event.source!=undefined;
},
content:function(){
trigger.source.discard(trigger.source.getCards('he'));
},
ai:{
threaten:0.7
}
},
xinenyuan:{
audio:true,
trigger:{player:'damageEnd'},
check:function(event,player){
var att=get.attitude(player,event.source);
var num=event.source.countCards('h');
if(att<=0) return true;
if(num>2) return true;
if(num) return att<4;
return false;
},
filter:function(event,player){
return event.source&&event.source!=player&&event.num>0&&event.source.isAlive();
},
content:function(){
"step 0"
event.num=trigger.num;
"step 1"
trigger.source.chooseCard('交给'+get.translation(player)+'一张手牌或流失一点体力').set('ai',function(card){
if(get.attitude(_status.event.player,_status.event.getParent().player)>0){
return 11-get.value(card);
}
else{
return 7-get.value(card);
}
});
"step 2"
if(result.bool){
player.gain(result.cards[0],trigger.source);
trigger.source.$give(1,player);
}
else{
trigger.source.loseHp();
}
if(event.num>1){
event.num--;
event.goto(1);
}
},
ai:{
maixie_defend:true,
effect:{
target:function(card,player,target){
if(player.hasSkillTag('jueqing',false,target)) return [1,-1.5];
if(!target.hasFriend()) return;
if(get.tag(card,'damage')) return [1,0,0,-0.7];
}
}
},
group:'xinenyuan2'
},
xinenyuan2:{
trigger:{player:'gainEnd'},
filter:function(event,player){
return event.source&&event.source.isAlive()&&event.source!=player&&event.cards.length>=2;
},
logTarget:'source',
check:function(event,player){
return get.attitude(player,event.source)>0;
},
content:function(){
trigger.source.draw();
}
},
enyuan:{
locked:true,
group:['enyuan1','enyuan2'],
ai:{
maixie_defend:true,
effect:{
target:function(card,player,target){
if(player.hasSkillTag('jueqing',false,target)) return [1,-2];
if(!target.hasFriend()) return;
if(get.tag(card,'damage')) return [1,0,0,-1];
}
}
}
},
enyuan1:{
trigger:{player:'recoverEnd'},
forced:true,
audio:2,
filter:function(event,player){
return event.source&&event.source!=player;
},
content:function(){
trigger.source.draw();
}
},
enyuan2:{
trigger:{player:'damageEnd'},
forced:true,
audio:true,
filter:function(event,player){
return event.source&&event.source!=player;
},
content:function(){
"step 0"
trigger.source.chooseCard('交出一张红桃牌或流失一点体力',function(card){
return get.suit(card)=='heart';
}).set('ai',function(card){
if(get.attitude(_status.event.player,_status.event.getParent().player)>0){
return 11-get.value(card);
}
else{
return 7-get.value(card);
}
});
"step 1"
if(result.bool){
player.gain(result.cards[0],trigger.source);
trigger.source.$give(1,player);
}
else{
trigger.source.loseHp();
}
}
},
xuanhuo:{
audio:2,
enable:'phaseUse',
usable:1,
discard:false,
prepare:'give2',
filter:function(event,player){
return player.countCards('he',{suit:'heart'});
},
filterCard:function(card){
return get.suit(card)=='heart';
},
filterTarget:function(card,player,target){
if(game.countPlayer()==2) return false;
return player!=target;
},
check:function(card){
var player=get.owner(card);
var players=game.filterPlayer();
for(var i=0;i3) break;
}
if(i==players.length) return -1;
return 5-get.value(card);
},
content:function(){
"step 0"
target.gain(cards,player);
// game.delay();
"step 1"
player.gainPlayerCard(target,'he',true);
"step 2"
var source=target;
event.card=result.links[0];
player.chooseTarget('选择一个目标送出'+get.translation(event.card),function(card,player,target){
return target!=_status.event.source&&target!=player;
}).set('ai',function(target){
return get.attitude(_status.event.player,target);
}).set('source',target);
"step 3"
if(result.bool){
result.targets[0].gain(card,player);
player.$give(1,result.targets[0]);
game.delay();
}
},
ai:{
result:{
target:-0.5,
},
basic:{
order:9,
}
}
},
ganlu:{
enable:'phaseUse',
usable:1,
audio:2,
selectTarget:2,
filterTarget:function(card,player,target){
if(target.isMin()) return false;
if(ui.selected.targets.length==0) return true;
if(ui.selected.targets[0].countCards('e')==0&&target.countCards('e')==0) return false;
return Math.abs(ui.selected.targets[0].countCards('e')-target.countCards('e'))<=player.maxHp-player.hp;
},
multitarget:true,
content:function(){
targets[0].swapEquip(targets[1]);
},
ai:{
order:10,
threaten:function(player,target){
return 0.8*Math.max(1+target.maxHp-target.hp);
},
result:{
target:function(player,target){
var list1=[];
var list2=[];
var num=player.maxHp-player.hp;
var players=game.filterPlayer();
for(var i=0;i0) list1.push(players[i]);
else if(get.attitude(player,players[i])<0) list2.push(players[i]);
}
list1.sort(function(a,b){
return a.countCards('e')-b.countCards('e');
});
list2.sort(function(a,b){
return b.countCards('e')-a.countCards('e');
});
var delta;
for(var i=0;i0;
},
direct:true,
content:function(){
"step 0"
var check;
if(trigger.player.isUnderControl(true,player)){
check=player.hasCard(function(card){
return get.type(card)!='basic';
});
}
else{
check=(get.attitude(player,trigger.player)>0);
}
player.choosePlayerCard(trigger.player,get.prompt('buyi',trigger.player),'h').set('ai',function(button){
if(!_status.event.check) return 0;
if(_status.event.target.isUnderControl(true,_status.event.player)){
if(get.type(button.link)!='basic'){
return 10-get.value(button.link);
}
return 0;
}
else{
return Math.random();
}
}).set('check',check).set('filterButton',function(button){
if(_status.event.player==_status.event.target){
return lib.filter.cardDiscardable(button.link,_status.event.player);
}
return true;
});
"step 1"
if(result.bool){
player.logSkill('buyi',trigger.player);
event.card=result.links[0];
player.showCards([event.card],get.translation(player)+'展示的手牌');
}
else{
event.finish();
}
"step 2"
if(get.type(event.card)!='basic'){
trigger.player.recover();
trigger.player.discard(event.card);
}
},
ai:{
threaten:1.4
}
},
pojun:{
audio:2,
trigger:{source:'damageEnd'},
check:function(event,player){
if(event.player.isTurnedOver()) return get.attitude(player,event.player)>0;
if(event.player.hp<3){
return get.attitude(player,event.player)<0;
}
return get.attitude(player,event.player)>0;
},
filter:function(event){
if(event._notrigger.contains(event.player)) return false;
return event.card&&event.card.name=='sha'&&event.player.isAlive();
},
logTarget:'player',
content:function(){
"step 0"
trigger.player.draw(Math.min(5,trigger.player.hp));
"step 1"
trigger.player.turnOver();
}
},
jingce:{
trigger:{player:'phaseUseEnd'},
frequent:true,
filter:function(event,player){
return player.countUsed()>=player.hp;
},
content:function(){
player.draw(2);
},
audio:2,
init:function(player){player.storage.jingce=true},
intro:{
content:function(storage,player){
if(_status.currentPhase==player) return '已使用'+player.countUsed()+'张牌';
}
}
},
chengxiang:{
trigger:{player:'damageEnd'},
direct:true,
audio:2,
content:function(){
"step 0"
event.cards=get.cards(4);
event.videoId=lib.status.videoId++;
game.broadcastAll(function(player,id,cards){
var str;
if(player==game.me&&!_status.auto){
str='称象:选择任意张点数不大于13的牌';
}
else{
str='称象';
}
var dialog=ui.create.dialog(str,cards);
dialog.videoId=id;
},player,event.videoId,event.cards);
event.time=get.utc();
game.addVideo('showCards',player,['称象',get.cardsInfo(event.cards)]);
game.addVideo('delay',null,2);
"step 1"
var next=player.chooseButton([0,4]);
next.set('dialog',event.videoId);
next.set('filterButton',function(button){
var num=0
for(var i=0;i0){
game.delay(0,time);
}
"step 3"
game.broadcastAll('closeDialog',event.videoId);
var cards2=event.cards2;
player.gain(cards2,'log');
player.$draw(cards2);
game.delay();
},
ai:{
maixie:true,
maixie_hp:true,
effect:{
target:function(card,player,target){
if(get.tag(card,'damage')){
if(player.hasSkillTag('jueqing',false,target)) return [1,-2];
if(!target.hasFriend()) return;
if(target.hp>=4) return [1,2];
if(target.hp==3) return [1,1.5];
if(target.hp==2) return [1,0.5];
}
}
}
}
},
renxin:{
trigger:{global:'damageBefore'},
audio:3,
priority:6,
filter:function(event,player){
return event.player!=player&&event.player.hp==1&&player.countCards('he',{type:'equip'})>0;
},
direct:true,
content:function(){
"step 0"
var next=player.chooseToDiscard(get.prompt('renxin',trigger.player),{type:'equip'},'he');
next.logSkill=['renxin',trigger.player];
next.set('ai',function(card){
var player=_status.event.player;
if(get.attitude(player,_status.event.getTrigger().player)>3){
return 11-get.value(card);
}
return -1;
});
"step 1"
if(result.bool){
player.turnOver();
}
else{
event.finish();
}
"step 2"
trigger.cancel();
},
ai:{
expose:0.5
}
},
yuce:{
audio:2,
trigger:{player:'damageAfter'},
direct:true,
filter:function(event,player){
return player.countCards('h')>0&&player.isDamaged();
},
content:function(){
"step 0"
var next=player.chooseCard(get.prompt('yuce'));
next.set('ai',function(card){
if(get.type(card)=='basic') return 1;
return get.value(card);
});
"step 1"
if(result.bool){
player.showCards(result.cards);
var type=get.type(result.cards[0],'trick');
if(trigger.source){
trigger.source.chooseToDiscard('弃置一张'+get.translation(type)+'牌或令'+get.translation(player)+'回复一点体力',function(card){
return get.type(card,'trick')==_status.event.type;
}).set('ai',function(card){
if(get.recoverEffect(_status.event.getParent().player,_status.event.player,_status.event.player)<0){
return 7-get.value(card);
}
return 0;
}).set('type',type);
}
else{
event.recover=true;
}
}
else{
event.finish();
}
"step 2"
if(event.recover){
player.recover();
}
else if(result.bool){
//player.draw();
}
else{
player.recover();
}
},
ai:{
effect:{
target:function(card,player,target){
if(get.tag(card,'damage'&&target.countCards('h'))){
return 0.8
}
}
}
}
},
xiansi:{
audio:2,
trigger:{player:'phaseBegin'},
direct:true,
init:function(player){
player.storage.xiansi=[];
},
content:function(){
"step 0"
player.chooseTarget(get.prompt('xiansi'),[1,2],function(card,player,target){
return target.countCards('he')>0;
},function(target){
return -get.attitude(_status.event.player,target);
});
"step 1"
if(result.bool){
player.logSkill('xiansi',result.targets);
event.targets=result.targets;
}
else{
event.finish();
}
"step 2"
if(event.targets.length){
var target=event.targets.shift();
event.current=target;
player.choosePlayerCard(target,true);
}
else{
event.finish();
}
"step 3"
if(result.bool){
player.storage.xiansi=player.storage.xiansi.concat(result.links);
player.markSkill('xiansi');
player.syncStorage('xiansi');
event.current.lose(result.links,ui.special,'toStorage');
event.current.$give(result.links,player);
event.goto(2);
}
},
intro:{
content:'cards',
onunmark:function(storage,player){
if(storage&&storage.length){
for(var i=0;i1&&player.canUse('sha',players[i],true,true);
}
}
return false;
},
direct:true,
delay:0,
content:function(){
"step 0"
var targets=game.filterPlayer(function(current){
if(current.storage.xiansi){
return current.storage.xiansi.length>1&&player.canUse('sha',current,true,true);
}
return false;
});
if(targets.length==1){
event.target=targets[0];
event.goto(2);
}
else if(targets.length>0){
player.chooseTarget(true,'选择【陷嗣】的目标',function(card,player,target){
return _status.event.list.contains(target);
}).set('list',targets).set('ai',function(target){
var player=_status.event.player;
return get.effect(target,{name:'sha'},player,player);
});
}
else{
event.finish();
}
"step 1"
if(result.bool&&result.targets.length){
event.target=result.targets[0];
}
else{
event.finish();
}
"step 2"
if(event.target){
if(event.target.storage.xiansi.length==2){
event.directresult=event.target.storage.xiansi.slice(0);
}
else{
player.chooseCardButton('移去两张“逆”',2,event.target.storage.xiansi,true);
}
}
else{
event.finish();
}
"step 3"
if(event.directresult||result.bool){
player.logSkill('xiansi2');
var links=event.directresult||result.links;
for(var i=0;i0&&target.hp>1){
return 0;
}
if(get.attitude(player,target)<0&&!player.hasSkillTag('damageBonus')){
if(card.name=='sha') return;
var sha=false;
player._shibei_tmp=true;
var num=player.countCards('h',function(card){
if(card.name=='sha'){
if(sha){
return false;
}
else{
sha=true;
}
}
return get.tag(card,'damage')&&player.canUse(card,target)&&get.effect(target,card,player,player)>0;
});
delete player._shibei_tmp;
if(player.hasSkillTag('damage')){
num++;
}
if(num<2){
var enemies=player.getEnemies();
if(enemies.length==1&&enemies[0]==target&&player.needsToDiscard()){
return;
}
return 0;
}
}
}
}
}
}
}
},
shibei_old:{
audio:2,
trigger:{player:'damageAfter'},
forced:true,
content:function(){
"step 0"
player.judge(function(card){
if(player.hasSkill('shibei2')){
if(get.color(card)=='black') return -1;
}
else{
if(get.color(card)=='red') return 1;
}
return 0;
})
"step 1"
if(result.judge>0){
player.recover();
}
else if(result.judge<0){
player.loseHp();
}
if(!player.hasSkill('shibei2')){
player.addTempSkill('shibei2');
}
}
},
shibei2:{},
jianying:{
audio:2,
trigger:{player:'useCard'},
frequent:true,
filter:function(event,player){
if(!event.cards||event.cards.length!=1) return false;
if(_status.currentPhase!=player) return false;
if(!player.storage.jianying) return false;
return get.suit(player.storage.jianying)==get.suit(event.cards[0])||
player.storage.jianying.number==event.cards[0].number;
},
content:function(){
player.draw();
},
intro:{
content:'card'
},
group:['jianying2','jianying3']
},
jianying3:{
trigger:{player:'useCard'},
priority:-1,
silent:true,
filter:function(event,player){
if(!event.cards||event.cards.length!=1) return false;
if(_status.currentPhase!=player) return false;
return true;
},
content:function(){
player.storage.jianying=trigger.cards[0];
}
},
jianying2:{
trigger:{player:'phaseAfter'},
silent:true,
content:function(){
player.storage.jianying=null;
}
},
zzhenggong:{
trigger:{player:'damageEnd'},
direct:true,
filter:function(event,player){
return event.source&&event.source.countCards('e')>0;
},
content:function(){
"step 0"
var att=get.attitude(player,trigger.source);
player.choosePlayerCard('e',get.prompt('zzhenggong'),trigger.source).ai=function(button){
if(att<=0){
return get.equipValue(button.link);
}
return 0;
}
"step 1"
if(result.bool){
player.logSkill('zzhenggong',trigger.source);
player.equip(result.links[0]);
trigger.source.$give(result.links[0],player);
}
},
ai:{
maixie_defend:true,
}
},
zquanji:{
trigger:{global:'phaseBegin'},
priority:15,
check:function(event,player){
var att=get.attitude(player,event.player);
if(att<0){
var nh1=event.player.countCards('h');
var nh2=player.countCards('h');
return nh1<=2&&nh2>nh1+1;
}
if(att>0&&event.player.hasJudge('lebu')&&event.player.countCards('h')>event.player.hp+1) return true;
return false;
},
logTarget:'player',
filter:function(event,player){
return player.canCompare(event.player);
},
content:function(){
"step 0"
player.chooseToCompare(trigger.player);
"step 1"
if(result.bool){
trigger.player.skip('phaseJudge');
trigger.untrigger();
}
},
ai:{
expose:0.2
}
},
zbaijiang:{
skillAnimation:true,
trigger:{player:'phaseBegin'},
forced:true,
unique:true,
derivation:['zyexin','zzili'],
init:function(player){
player.storage.zbaijiang=false;
},
// intro:{
// content:'limited'
// },
filter:function(event,player){
return !player.storage.zbaijiang&&player.countCards('e')>=2;
},
content:function(){
player.storage.zbaijiang=true;
player.removeSkill('zzhenggong');
player.removeSkill('zquanji');
player.removeSkill('zbaijiang');
player.addSkill('zyexin');
player.addSkill('zzili');
player.gainMaxHp();
}
},
zyexin:{
trigger:{player:'damageEnd',source:'damageEnd'},
frequent:true,
init:function(player){
player.storage.zyexin=[];
},
intro:{
content:'cards'
},
content:function(){
var card=get.cards()[0];
player.storage.zyexin.push(card);
player.$draw(card);
player.markSkill('zyexin');
event.trigger("addCardToStorage");
game.addVideo('storage',player,['zyexin',get.cardsInfo(player.storage.zyexin),'cards']);
},
group:'zyexin2'
},
zyexin2:{
enable:'phaseUse',
usable:1,
lose:false,
delay:false,
selectCard:[1,Infinity],
filterCard:true,
filter:function(event,player){
return player.storage.zyexin.length>0;
},
prompt:'用任意数量的手牌与等量的“权”交换',
content:function(){
"step 0"
player.lose(cards,ui.special,'toStorage');
player.storage.zyexin=player.storage.zyexin.concat(cards);
player.chooseCardButton(player.storage.zyexin,'选择'+cards.length+'张牌作为手牌',cards.length,true).ai=function(button){
return get.value(button.link);
}
if(player==game.me&&_status.auto){
game.delay();
}
"step 1"
player.gain(result.links,'toStorage');
for(var i=0;i=4&&!player.storage.zzili;
},
forced:true,
content:function(){
player.storage.zzili=true;
player.loseMaxHp();
player.addSkill('zpaiyi');
player.removeSkill('zzili');
},
// intro:{
// content:'limited'
// }
},
zpaiyi:{
trigger:{player:'phaseEnd'},
filter:function(event,player){
for(var i=0;i