更改描述:将“基本牌”改为“基本牌或普通锦囊牌”';
}
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.addMark('xindanxin',1,false);
}
}
},
zongzuo:{
trigger:{
global:'phaseBefore',
player:'enterGame',
},
forced:true,
audio:2,
filter:function(event,player){
return (event.name!='phase'||game.phaseNumber==0);
},
content:function(){
'step 0'
var num=game.countGroup();
player.gainMaxHp(num);
event.num=num;
'step 1'
player.recover(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){
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],'匡弼:将至多三张牌置于'+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){
player.addToExpansion(result.cards,target,'give').gaintag.add('kuangbi');
if(!player.storage.kuangbi_draw) player.storage.kuangbi_draw=[[],[]];
player.storage.kuangbi_draw[0].push(target);
player.storage.kuangbi_draw[1].push(result.cards.length);
player.addSkill('kuangbi_draw');
player.syncStorage('kuangbi_draw');
player.updateMarks('kuangbi_draw');
}
},
intro:{
content:'expansion',
markcount:'expansion',
},
onremove:function(player,skill){
var cards=player.getExpansions(skill);
if(cards.length) player.loseToDiscardpile(cards);
delete player.storage[skill];
},
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:'phaseZhunbeiBegin'},
forced:true,
mark:true,
charlotte:true,
audio:'kuangbi',
onremove:true,
filter:function(event,player){
return player.getExpansions('kuangbi').length;
},
content:function(){
player.gain(player.getExpansions('kuangbi'),'gain2');
var storage=player.storage.kuangbi_draw;
if(storage.length){
for(var i=0;i
0;
},
audio:2,
content:function(){
'step 0'
player.gainPlayerCard(target,'h',true);
'step 1'
var name=get.translation(target);
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=[];
event.tothrow=[];
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,eff=0,players=game.filterPlayer(function(current){
return current!=player;
}).sortBySeat(player);
for(var target of players){
if(get.damageEffect(target,player,target,'fire')>=0){num=0;continue};
var shao=false;
num++;
if(target.countCards('he',function(card){
if(get.type(card)!='basic'){
return get.value(card)<10;
}
return get.value(card)<8;
})0;
},
discard:false,
delay:false,
check:function(card){
return 8-get.value(card);
},
loseTo:'cardPile',
insert:true,
visible:true,
content:function(){
'step 0'
player.showCards(cards);
'step 1'
target.chooseToDiscard('he',true).set('prompt','请弃置一张锦囊牌,或依次弃置两张非锦囊牌。');
'step 2'
if((!result.cards||get.type(result.cards[0],'trick',result.cards[0].original=='h'?target:false)!='trick')&&target.countCards('he',function(card){
return get.type(card,'trick')!='trick';
})){
target.chooseToDiscard('he',true,function(card){
return get.type(card,'trick')!='trick';
}).set('prompt','请弃置第二张非锦囊牌');
}
},
ai:{
order:9,
result:{
target:-1
}
}
},
qianju:{
mod:{
globalFrom:function(from,to,distance){
return distance-(from.getDamagedHp());
}
}
},
reqianju:{
mod:{
globalFrom:function(from,to,distance){
return distance-(Math.max(1,from.getDamagedHp()));
}
}
},
reqingxi:{
audio:2,
trigger:{player:'useCardToPlayered'},
filter:function(event,player){
return event.card.name=='sha'||event.card.name=='juedou';
},
check:function(event,player){
return get.attitude(player,event.target)<0;
},
logTarget:'target',
content:function(){
'step 0'
var num=Math.min(game.countPlayer(function(current){
return player.inRange(current);
}),player.getEquip(1)?4:2);
if(trigger.target.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,'notBySelf');
}
event.finish();
}
else{
var id=trigger.target.playerid;
var map=trigger.customArgs;
if(!map[id]) map[id]={};
if(!map[id].extraDamage) map[id].extraDamage=0;
map[id].extraDamage++;
player.judge(function(card){
if(get.color(card)=='red') return 1;
return 0;
}).judge2=function(result){
return result.bool;
};
}
'step 2'
if(result.color=='red') trigger.directHit.add(trigger.target);
}
},
reqingxi2:{
mod:{
cardEnabled:function(card,player){
if(player.storage.reqingxi2&&player.storage.reqingxi2.filter(function(cd){
return get.color(cd)==get.color(card);
}).length) return false;
},
cardRespondable:function(card,player){
if(player.storage.reqingxi2&&player.storage.reqingxi2.filter(function(cd){
return get.color(cd)==get.color(card);
}).length) return false;
},
},
firstDo:true,
onremove:true,
trigger:{
player:['damage','damageCancelled','damageZero'],
target:['shaMiss','useCardToExcluded'],
},
charlotte:true,
filter:function(event,player){
return player.storage.reqingxi2&&event.card&&player.storage.reqingxi2.contains(event.card);
},
silent:true,
forced:true,
popup:false,
priority:12,
content:function(){
player.storage.reqingxi2.remove(trigger.card);
if(!player.storage.reqingxi2.length) player.removeSkill('reqingxi2');
},
},
qingxi:{
audio:2,
trigger:{source:'damageBegin1'},
check:function(event,player){
return get.attitude(player,event.player)<0;
},
filter:function(event,player){
return event.getParent().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,'notBySelf');
}
}
else{
trigger.num++;
}
}
},
jieyue:{
group:'jieyue1'
},
jieyue1:{
audio:2,
trigger:{player:'phaseJieshuBegin'},
direct:true,
filter:function(event,player){
return !player.getExpansions('jieyue2').length;
},
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.prompt2('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){
player.addToExpansion(result.cards,'give',target).gaintag.add('jieyue2');
player.addSkill('jieyue2');
}
else if(event.target.countCards('he')){
player.discardPlayerCard(event.target,true);
}
},
ai:{
expose:0.1
},
},
jieyue2:{
intro:{
content:'expansion',
markcount:'expansion',
},
onremove:function(player,skill){
var cards=player.getExpansions(skill);
if(cards.length) player.loseToDiscardpile(cards);
},
marktext:'钺',
audio:true,
enable:'chooseToUse',
filterCard:function(card){
return get.color(card)=='black';
},
viewAsFilter:function(player){
return player.countCards('hs',{color:'black'})>0;
},
position:'hs',
viewAs:{name:'wuxie'},
prompt:'将一张黑色手牌当无懈可击使用',
check:function(card){return 8-get.value(card)},
threaten:1.2,
charlotte:true,
group:['jieyue3','jieyue4']
},
jieyue3:{
enable:['chooseToRespond','chooseToUse'],
filterCard:function(card){
return get.color(card)=='red';
},
viewAs:{name:'shan'},
position:'hs',
viewAsFilter:function(player){
if(!player.countCards('hs',{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:'phaseZhunbeiBegin'},
forced:true,
content:function(){
'step 0'
var cards=player.getExpansions('jieyue2');
if(cards.length) player.gain(cards,'gain2');
'step 1'
player.removeSkill('jieyue2');
}
},
jinjiu:{
mod:{
cardname:function(card,player){
if(card.name=='jiu') return 'sha';
},
},
ai:{
skillTagFilter:function(player){
if(!player.countCards('h','jiu')) return false;
},
respondSha:true,
},
audio:2,
trigger:{player:['useCard1','respond']},
firstDo:true,
forced:true,
filter:function(event,player){
return event.card.name=='sha'&&!event.skill&&
event.cards.length==1&&event.cards[0].name=='jiu';
},
content:function(){},
},
xinxianzhen:{
audio:'xianzhen',
inherit:'xianzhen',
},
xinxianzhen2:{
audio:'xianzhen',
mod:{
targetInRange:function(card,player,target){
if(target==player.storage.xinxianzhen) return true;
},
cardUsableTarget:function(card,player,target){
if(target==player.storage.xinxianzhen) return true;
},
},
ai:{
unequip:true,
skillTagFilter:function(player,tag,arg){
if(arg.target!=player.storage.xinxianzhen) return false;
},
effect:{
player:function(card,player,target,current,isLink){
if(isLink||!player.storage.xinxianzhen) return;
if(target!=player.storage.xinxianzhen&&['sha','guohe','shunshou','huogong','juedou'].contains(card.name)){
if(get.effect(player.storage.xinxianzhen,card,player,player)>0){
return [1,2];
}
}
}
}
},
trigger:{player:'useCard2'},
filter:function(event,player){
return player.storage.xinxianzhen&&player.storage.xinxianzhen.isAlive()&&
(event.card.name=='sha'||get.type(event.card)=='trick')&&
event.targets&&event.targets.length==1&&!event.targets.contains(player.storage.xinxianzhen);
},
check:function(event,player){
return get.effect(player.storage.xinxianzhen,event.card,player,player)>0;
},
logTarget:function(event,player){
return player.storage.xinxianzhen;
},
prompt2:(event,player)=>('令'+get.translation(player.storage.decadexianzhen2)+'也成为'+get.translation(event.card)+'的目标'),
content:function(){
var target=player.storage.xinxianzhen;
trigger.targets.push(target);
game.log(target,'成为了',trigger.card,'的额外目标');
},
},
xinxianzhen3:{
charlotte:true,
mod:{
cardEnabled:function(card){
if(card.name=='sha') return false;
},
ignoredHandcard:function(card,player){
if(get.name(card)=='sha'){
return true;
}
},
cardDiscardable:function(card,player,name){
if(name=='phaseDiscard'&&get.name(card)=='sha'){
return false;
}
},
},
},
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[event.name]=target;
player.addTempSkill(event.name+2);
}
else{
player.addTempSkill(event.name+3);
}
},
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:{
charlotte:true,
mod:{
targetInRange:function(card,player,target){
if(target==player.storage.xianzhen) return true;
},
cardUsableTarget:function(card,player,target){
if(target==player.storage.xianzhen) return true;
},
},
ai:{
unequip:true,
skillTagFilter:function(player,tag,arg){
if(arg.target!=player.storage.xianzhen) return false;
},
}
},
xianzhen3:{
charlotte:true,
mod:{
cardEnabled:function(card){if(card.name=='sha') return false}
}
},
lihuo:{
trigger:{player:'useCard1'},
filter:function(event,player){
if(event.card.name=='sha'&&!event.card.nature) return true;
return false;
},
audio:2,
audioname:['re_chengpu'],
check:function(event,player){
return false;
},
content:function(){
trigger.card.nature='fire';
var next=game.createEvent('lihuo_clear');
next.player=player;
next.card=trigger.card;
event.next.remove(next);
next.forceDie=true;
trigger.after.push(next);
next.setContent(function(){
if(player.isAlive()&&player.getHistory('sourceDamage',function(evt){
return evt.getParent(2)==event.parent;
}).length>0) player.loseHp();
delete card.nature;
});
},
group:'lihuo2'
},
lihuo2:{
trigger:{player:'useCard2'},
filter:function(event,player){
if(event.card.name!='sha'||get.nature(event.card)!='fire') return false;
return game.hasPlayer(function(current){
return !event.targets.contains(current)&&player.canUse(event.card,current);
});
},
direct:true,
content:function(){
'step 0'
player.chooseTarget(get.prompt('lihuo'),'为'+get.translation(trigger.card)+'增加一个目标',function(card,player,target){
return !_status.event.sourcex.contains(target)&&player.canUse(_status.event.card,target);
}).set('sourcex',trigger.targets).set('card',trigger.card).set('ai',function(target){
var player=_status.event.player;
return get.effect(target,_status.event.card,player,player);
});
'step 1'
if(result.bool){
if(!event.isMine()&&!_status.connectMode) game.delayx();
event.target=result.targets[0];
}
else{
event.finish();
}
'step 2'
player.logSkill('lihuo',event.target);
trigger.targets.push(event.target);
},
},
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:'phaseJieshuBegin'},
direct:true,
audio:2,
audioname:['xin_chengpu'],
filter:function(event,player){
return player.countCards('h')>0&&(_status.connectMode||player.countCards('h','sha')>0)&&!player.getExpansions('chunlao').length;
},
intro:{
content:'expansion',
markcount:'expansion',
},
content:function(){
'step 0'
player.chooseCard([1,Math.max(1,player.countCards('h','sha'))],get.prompt('chunlao'),{name:'sha'}).set('ai',function(){
return 1;
});
'step 1'
if(result.bool){
player.logSkill('chunlao');
player.addToExpansion(result.cards,player,'giveAuto').gaintag.add('chunlao');
}
},
ai:{
effect:{
player:function(card,player,target){
if(_status.currentPhase!=player) return;
if(card.name=='sha'&&!player.needsToDiscard()&&
!player.getExpansions('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.getExpansions('chunlao').length>0;
},
filterTarget:function(card,player,target){
return target==_status.event.dying;
},
direct:true,
clearTime:true,
delay:false,
selectTarget:-1,
content:function(){
"step 0"
player.chooseCardButton(get.translation('chunlao'),player.getExpansions('chunlao'),true);
"step 1"
if(result.bool){
player.logSkill('chunlao',target);
player.loseToDiscardpile(result.links);
event.type='dying';
target.useCard({name:'jiu',isCard:true},target);
}
},
ai:{
order:6,
skillTagFilter:function(player){
return player.getExpansions('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',isCard:true},trigger.player);
if(!player.storage.chunlao.length){
player.unmarkSkill('chunlao');
}
else{
player.markSkill('chunlao');
}
}
},
ai:{
expose:0.2
}
},
shenduan:{
trigger:{
player:'loseAfter',
global:'loseAsyncAfter',
},
filter:function(event,player){
if(event.type!='discard'||event.getlx===false) return;
var evt=event.getl(player);
for(var i=0;i1?'中的一张牌':'')+'当做【兵粮寸断】对一名其他角色使用',function(card,player,target){
var cs=_status.event.cards;
for(var i=0;i1?'中的一张牌':'')+'当做【兵粮寸断】对一名其他角色使用',function(card,player,target){
var cs=_status.event.cards;
for(var i=0;i0;
},
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',isCard:true},player,player);
if(player.inRange(trigger.player)||!player.canUse({name:'sha',isCard:true},trigger.player,false)) eff=0;
player.discardPlayerCard(get.prompt('yonglve',trigger.player),trigger.player,'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'&&nh0&&player.inRange(event.player);
},
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',isCard:true},player,player);
if(!player.canUse({name:'sha',isCard:true},trigger.player)) eff=0;
player.discardPlayerCard(get.prompt('yonglve',trigger.player),trigger.player,'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'&&nh0;
})){
player.draw();
}
},
//group:'yonglve2'
},
yonglve2:{
trigger:{source:'damage'},
forced:true,
popup:false,
filter:function(event){
return event.parent.skill=='yonglve';
},
content:function(){
player.storage.yonglve=true;
}
},
benxi:{
audio:2,
trigger:{player:'useCard2'},
forced:true,
filter:function(event,player){
return player.isPhaseUsing();
},
content:function(){},
mod:{
globalFrom:function(from,to,distance){
if(_status.currentPhase==from){
return distance-from.countUsed();
}
},
selectTarget:function(card,player,range){
if(_status.currentPhase==player){
if(card.name=='sha'&&range[1]!=-1){
if(!game.hasPlayer(function(current){
return get.distance(player,current)>1;
})){
range[1]++;
}
}
}
}
},
ai:{
unequip:true,
skillTagFilter:function(player){
if(game.hasPlayer(function(current){
return get.distance(player,current)>1;
})){
return false;
}
}
}
},
sidi:{
audio:2,
trigger:{global:'useCard'},
filter:function(event,player){
if(event.card.name!='shan') return false;
if(event.player==player) return true;
return _status.currentPhase==player;
},
frequent:true,
intro:{
content:'expansion',
markcount:'expansion',
},
onremove:function(player,skill){
var cards=player.getExpansions(skill);
if(cards.length) player.loseToDiscardpile(cards);
},
content:function(){
player.addToExpansion(get.cards(),'gain2').gaintag.add('sidi');
},
group:'sidi2'
},
sidi2:{
trigger:{global:'phaseUseBegin'},
filter:function(event,player){
if(event.player==player||event.player.isDead()) return false;
if(!player.getExpansions('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;
}
},
logTarget:'player',
content:function(){
'step 0'
var cards=player.getExpansions('sidi');
if(cards.length==1){
event.directbutton=cards[0];
}
else{
player.chooseCardButton('弃置一张“司敌”牌',cards,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.loseToDiscardpile(button);
trigger.player.addTempSkill('sidi3','phaseUseAfter');
trigger.player.addMark('sidi3',1,false);
}
}
},
sidi3:{
mod:{
cardUsable:function(card,player,num){
if(card.name=='sha') return num-player.countMark('sidi3');
}
},
onremove:true,
},
zhongyong:{
audio:2,
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.source;
}).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;
}).set('source',trigger.target);
"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"
player.chooseToUse('是否对'+get.translation(trigger.target)+'再使用一张杀?',
{name:'sha'},trigger.target,-1).set('addCount',false);
}
},
xinzhongyong:{
trigger:{player:'useCardAfter'},
audio:'zhongyong',
direct:true,
filter:function(event,player){
return event.card.name=='sha';
},
content:function(){
"step 0"
event.sha=trigger.cards.slice(0).filterInD();
event.shan=[];
game.countPlayer2(function(current){
current.getHistory('useCard',function(evt){
if(evt.card.name=='shan'&&evt.getParent(3)==trigger) event.shan.addArray(evt.cards);
});
});
event.shan.filterInD('d');
if(!event.sha.length&&!event.shan.length) event.finish();
player.chooseTarget(get.prompt2('xinzhongyong'),function(card,player,target){
return !_status.event.source.contains(target)&&target!=player;
}).set('ai',function(target){
return get.attitude(_status.event.player,target);
}).set('source',trigger.targets);
"step 1"
if(result.bool){
var target=result.targets[0];
event.target=target;
player.logSkill('xinzhongyong',target);
if(event.sha.length&&event.shan.length){
player.chooseControl().set('choiceList',[
'将'+get.translation(event.sha)+'交给'+get.translation(target),
'将'+get.translation(event.shan)+'交给'+get.translation(target),
]).set('ai',function(){
return _status.event.choice;
}).set('choice',function(){
if(get.color(event.sha)!='black') return 0;
return 1;
}());
}
else event._result={index:event.sha.length?0:1};
}
else{
event.finish();
}
"step 2"
var cards=result.index==0?event.sha:event.shan;
event.useSha=false;
target.gain(cards,'gain2');
for(var i=0;i0&&event.player.isPhaseUsing();
},
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.addCount===false||!trigger.player.isPhaseUsing()) go=false;
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;
}
}
}
}
//AI停顿
if(go&&!event.isMine()&&!event.isOnline()&&player.hasCard(function(card){
return get.value(card)<6&&lib.filter.cardDiscardable(card,player,event.name);
},'he')){
game.delayx();
}
var next=player.chooseToDiscard(get.prompt('longyin'),'弃置一张牌'+(get.color(trigger.card)=='red'?'并摸一张牌':'')+',令'+get.translation(trigger.player)+'本次使用的【杀】不计入使用次数','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){
if(trigger.addCount!==false){
trigger.addCount=false;
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:{
maxHandcardBase:function(player,num){
var damage=player.getStat().damage;
if(typeof damage=='number') return damage;
return 0;
}
}
},
shifei:{
audio:2,
audioname:['re_guotufengji'],
enable:['chooseToRespond','chooseToUse'],
filter:function(event,player){
if(!_status.currentPhase||event.shifei) return false;
if(!event.filterCard({name:'shan',isCard:true},player,event)) return false;
if(event.name!='chooseToUse'&&!lib.filter.cardRespondable({name:'shan',isCard:true},player,event)) return false;
return true;
},
delay:false,
checkx:function(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.countCards('h','shan')||get.attitude(player,players[i])<=0) return true;
}
}
return false;
},
content:function(){
'step 0'
player.line(_status.currentPhase,'green');
_status.currentPhase.draw();
'step 1'
if(_status.currentPhase.isMaxHandcard(true)){
event.finish();
var evt=event.getParent(2);
evt.set('shifei',true);
evt.goto(0);
return;
}
var targets=game.filterPlayer(function(current){
return current.isMaxHandcard();
})
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 evt=event.getParent(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);
evt.result={bool:true,card:{name:'shan',isCard:true},cards:[]};
evt.redo();
}
else{
evt.set('shifei',true);
evt.goto(0);
}
},
ai:{
respondShan:true,
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;
}
}
}
},
order:8,
result:{
player:function(player){
return lib.skill.shifei.checkx(player)?1:0;
},
},
}
},
huaiyi:{
audio:2,
enable:'phaseUse',
usable:1,
delay:false,
filter:function(event,player){
return player.countCards('h',{color:'red'})&&player.countCards('h',{color:'black'});
},
content:function(){
'step 0'
player.showHandcards();
'step 1'
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 2'
event.control=result.control;
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('请选择至多'+get.cnNumber(event.num)+'名有牌的其他角色,获得这些角色的各一张牌。',[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=0;
}
else{
event.finish();
}
'step 5'
if(player.isAlive()&&event.targets.length){
player.gainPlayerCard(event.targets.shift(),'he',true);
}
else event.finish();
'step 6'
if(result.bool){
event.gained+=result.cards.length;
}
if(event.targets.length) event.goto(5);
'step 7'
if(event.gained>1) 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:'damageSource'},
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.prompt2('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;
}
}
}
},
reyanzhu:{
enable:'phaseUse',
audio:2,
usable:1,
filterTarget:lib.filter.notMe,
derivation:['reyanzhu_rewrite','rexingxue_rewrite'],
prompt:function(){
return lib.translate[(_status.event.player.storage.reyanzhu?'reyanzhu_rewrite':'reyanzhu')+'_info'];
},
content:function(){
'step 0'
if(player.storage.reyanzhu||!target.countCards('e')) event._result={index:1};
else target.chooseControl().set('prompt',get.translation(player)+'发动了【宴诛】,请选择一项').set('choiceList',[
'将装备区内的所有牌交给'+get.translation(player)+'并令其修改技能',
'弃置一张牌,并令下次受到的伤害+1直到下回合开始',
]).set('ai',function(){
if(_status.event.player.countCards('e')>=3) return 1;
return 0;
});
'step 1'
if(result.index==0){
target.give(target.getCards('e'),player);
player.storage.reyanzhu=true;
}
else{
target.addTempSkill('reyanzhu2',{player:'phaseBegin'});
target.addMark('reyanzhu2',1,false);
if(!player.storage.reyanzhu&&target.countCards('he')>0) target.chooseToDiscard('he',true);
}
},
ai:{
order:6,
result:{
target:function(player,target){
if(player.storage.reyanzhu) return -1;
var ne=target.countCards('e');
if(!ne) return -2;
if(ne>=2) return -ne;
return 0;
}
}
},
},
reyanzhu2:{
trigger:{player:'damageBegin3'},
forced:true,
onremove:true,
content:function(){
trigger.num+=player.countMark('reyanzhu2');
game.log(player,'受到的伤害+'+player.countMark('reyanzhu2'));
player.removeSkill('reyanzhu2');
},
intro:{
content:'下次受到的伤害+#直到下回合开始',
},
},
rexingxue:{
trigger:{player:'phaseJieshuBegin'},
direct:true,
audio:2,
filter:function(event,player){
return (player.storage.reyanzhu?player.maxHp:player.hp)>0;
},
content:function(){
'step 0'
player.chooseTarget([1,player.storage.reyanzhu?player.maxHp:player.hp],get.prompt('rexingxue'),'令所有目标角色依次摸一张牌,然后所有手牌数大于体力值的目标角色依次将一张牌置于牌堆顶').set('ai',function(target){
var att=get.attitude(player,target);
if(target.countCards('h')==target.hp-1) att*=2;
return att;
});
'step 1'
if(result.bool){
event.targets=result.targets.sortBySeat();
player.logSkill('rexingxue',event.targets);
game.asyncDraw(result.targets);
}
else event.finish();
'step 2'
game.delay();
'step 3'
if(event.targets.length){
event.target=event.targets.shift();
if(event.target.isDead()) event.redo();
}
else event.finish();
'step 4'
if(target.isAlive()&&target.countCards('h')&&target.countCards('h')>target.hp) target.chooseCard('he',true,'将一张牌置于牌堆顶');
else event.goto(3);
'step 5'
if(result&&result.cards){
event.card=result.cards[0];
target.lose(result.cards,ui.cardPile,'insert');
game.log(target,'将',(get.position(event.card)=='h'?'一张牌':event.card),'置于牌堆顶');
game.broadcastAll(function(player){
var cardx=ui.create.card();
cardx.classList.add('infohidden');
cardx.classList.add('infoflip');
player.$throw(cardx,1000,'nobroadcast');
},target);
}
event.goto(3);
},
},
rezhaofu:{
unique:true,
global:'rezhaofu2',
zhuSkill:true
},
rezhaofu2:{
mod:{
inRangeOf:function(from,to){
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');
target.give(es,player,'give');
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:{
cardname:function(card,player,name){
if(card.name=='shan'&&player.hp==1) return 'sha';
},
},
ai:{
skillTagFilter:function(player){
if(!player.countCards('h','shan')) return false;
if(player.hp!=1) return false;
},
respondSha:true,
},
audio:2,
trigger:{player:['useCard1','respond']},
firstDo:true,
forced:true,
filter:function(event,player){
return event.card.name=='sha'&&!event.skill&&
event.cards.length==1&&event.cards[0].name=='shan';
},
content:function(){},
},
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;
}
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=get.name(event.card1);
var name2=get.name(event.card2);
if(name1=='sha'&&name2!='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('nocard');
}
else if(name1!='sha'&&name2=='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,
position:'h',
filter:function(event,player){
if(player.getStat().skill.zhanjue_draw&&player.getStat().skill.zhanjue_draw>=2) return false;
var hs=player.getCards('h');
if(!hs.length) return false;
for(var i=0;i=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(){
trigger.player.addTempSkill('zhanjue5');
}
},
zhanjue4:{
audio:false,
trigger:{player:'useCardAfter'},
forced:true,
popup:false,
filter:function(event,player){
return event.skill=='zhanjue';
},
content:function(){
"step 0"
var stat=player.getStat().skill;
if(!stat.zhanjue_draw) stat.zhanjue_draw=0;
stat.zhanjue_draw++;
player.draw('nodelay');
var list=game.filterPlayer(function(current){
if(current.getHistory('damage',function(evt){
return evt.card==trigger.card;
}).length>0){
if(current==player){
stat.zhanjue_draw++;
}
return true;
}
return false;
});
if(list.length){
list.sortBySeat();
game.asyncDraw(list);
}
"step 1"
game.delay();
}
},
zhanjue5:{},
qinwang:{
audio:'qinwang1',
unique:true,
group:['qinwang1'],
zhuSkill:true,
filter:function(event,player){
if(!player.hasZhuSkill('qinwang')||!game.hasPlayer(function(current){
return current!=player&¤t.group=='shu';
})||!player.countCards('he')) return false;
return !event.jijiang&&(event.type!='phase'||!player.hasSkill('jijiang3'));
},
enable:['chooseToUse','chooseToRespond'],
viewAs:{
name:'sha',
cards:[],
suit:'none',
number:null,
isCard:true,
},
filterCard:lib.filter.cardDiscardable,
position:'he',
check:function(card){
var player=_status.event.player,players=game.filterPlayer();
if(player.hasSkill('qinwang_ai')) return false;
for(var i=0;i2&&(nh>=3&&players[i].countCards('h','sha'))){
return 5-get.value(card);
}
}
return 0;
},
ai:{
order:function(){
return get.order({name:'sha'})-0.3;
},
respondSha:true,
skillTagFilter:function(player){
if(!player.hasZhuSkill('qinwang')||!game.hasPlayer(function(current){
return current!=player&¤t.group=='shu';
})||!player.countCards('he')) return false;
},
},
},
qinwang1:{
audio:2,
trigger:{player:['useCardBegin','respondBegin']},
logTarget:'targets',
filter:function(event,player){
return event.skill=='qinwang';
},
forced:true,
content:function(){
"step 0"
delete trigger.skill;
delete trigger.card.cards;
player.discard(trigger.cards);
delete trigger.cards;
trigger.getParent().set('jijiang',true);
"step 1"
if(event.current==undefined) event.current=player.next;
if(event.current==player){
player.addTempSkill('jijiang3');
player.addTempSkill('qinwang_ai');
event.finish();
trigger.cancel();
trigger.getParent().goto(0);
}
else if(event.current.group=='shu'){
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.set('skillwarn','替'+get.translation(player)+'打出一张杀');
next.noOrdering=true;
next.autochoose=lib.filter.autoRespondSha;
}
else{
event.current=event.current.next;
event.redo();
}
"step 2"
if(result.bool){
event.current.draw();
event.finish();
trigger.card=result.card;
trigger.cards=result.cards;
trigger.throw=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(1);
}
}
},
qinwang_ai:{},
zuoding:{
trigger:{global:'useCardToPlayered'},
filter:function(event,player){
if(event.getParent().triggeredTargets3.length>1) return false;
return get.suit(event.card)=='spade'&&
_status.currentPhase==event.player&&event.targets&&event.targets.length&&
event.player!=player&&game.countPlayer2(function(current){
return current.getHistory('damage').length>0;
})==0;
},
direct:true,
content:function(){
'step 0'
player.chooseTarget(get.prompt('zuoding'),'令一名目标角色摸一张牌',function(card,player,target){
return _status.event.targets.contains(target);
}).set('ai',function(target){
return get.attitude(_status.event.player,target);
}).set('targets',trigger.targets);
'step 1'
if(result.bool){
player.logSkill('zuoding',result.targets);
result.targets[0].draw();
}
},
ai:{
expose:0.2
},
//group:'zuoding3'
},
zuoding2:{},
zuoding3:{
trigger:{global:'damage'},
silent:true,
content:function(){
player.addTempSkill('zuoding2');
}
},
huomo:{
audio:2,
audioname:['huzhao'],
enable:'chooseToUse',
onChooseToUse:function(event){
if(game.online||event.huomo_list) return;
var list=lib.skill.huomo.getUsed(event.player);
event.set('huomo_list',list);
},
getUsed:function(player){
var list=[];
player.getHistory('useCard',function(evt){
if(get.type(evt.card,null,false)=='basic') list.add(evt.card.name);
});
return list;
},
hiddenCard:function(player,name){
if(get.type(name)!='basic') return false;
var list=lib.skill.huomo.getUsed(player);
if(list.contains(name)) return false;
return player.hasCard(function(card){
return get.color(card)=='black'&&get.type(card)!='basic';
},'eh');
},
filter:function(event,player){
if(event.type=='wuxie'||!player.hasCard(function(card){
return get.color(card)=='black'&&get.type(card)!='basic';
},'eh')) return false;
var list=event.huomo_list||lib.skill.huomo.getUsed(player);
for(var name of lib.inpile){
if(get.type(name)!='basic'||list.contains(name)) continue;
var card={name:name,isCard:true};
if(event.filterCard(card,player,event)) return true;
if(name=='sha'){
for(var nature of lib.inpile_nature){
card.nature=nature;
if(event.filterCard(card,player,event)) return true;
}
}
}
return false;
},
chooseButton:{
dialog:function(event,player){
var vcards=[];
var list=event.huomo_list||lib.skill.huomo.getUsed(player);
for(var name of lib.inpile){
if(get.type(name)!='basic'||list.contains(name)) continue;
var card={name:name,isCard:true};
if(event.filterCard(card,player,event)) vcards.push(['基本','',name]);
if(name=='sha'){
for(var nature of lib.inpile_nature){
card.nature=nature;
if(event.filterCard(card,player,event)) vcards.push(['基本','',name,nature]);
}
}
}
return ui.create.dialog('活墨',[vcards,'vcard'],'hidden');
},
check:function(button){
var player=_status.event.player;
var card={name:button.link[2],nature:button.link[3]};
if(game.hasPlayer(function(current){
return player.canUse(card,current)&&get.effect(current,card,player,player)>0;
})){
switch(button.link[2]){
case 'tao':return 5;
case 'jiu':return 3.01;
case 'shan':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 {
check:function(card){
return 1/Math.max(0.1,get.value(card));
},
filterCard:function(card){
return get.type(card)!='basic'&&get.color(card)=='black';
},
viewAs:{
name:links[0][2],
nature:links[0][3],
suit:'none',
number:null,
isCard:true,
},
position:'he',
popname:true,
ignoreMod:true,
precontent:function(){
'step 0'
player.logSkill('huomo');
var card=event.result.cards[0];
event.card=card;
player.$throw(card,1000);
game.log(player,'将',card,'置于牌堆顶');
event.result.card={name:event.result.card.name,nature:event.result.card.nature};
event.result.cards=[];
player.lose(card,ui.cardPile,'visible','insert');
'step 1'
game.delay();
},
}
},
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;
var list=lib.skill.huomo.getUsed(player);
if(!list.contains('jiu')&&event.filterCard({name:'jiu'},player,event)&&get.effect(player,{name:'jiu'})>0){
return 3.1;
}
return 2.9;
},
respondSha:true,
fireAttack:true,
respondShan:true,
skillTagFilter:function(player,tag,arg){
if(tag=='fireAttack') return true;
if(player.hasCard(function(card){
return get.color(card)=='black'&&get.type(card)!='basic';
},'he')){
var list=lib.skill.huomo.getUsed(player);
if(tag=='respondSha'){
if(arg!='use') return false;
if(list.contains('sha')) return false;
}
else if(tag=='respondShan'){
if(list.contains('shan')) return false;
}
}
else{
return false;
}
},
result:{
player:1
}
}
},
// taoxi:{
// audio:2,
// trigger:{player:'useCardToPlayered'},
// 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:'phaseJieshuBegin'},
// 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:{},
taoxi:{
audio:2,
trigger:{player:'useCardToPlayered'},
check:function(event,player){
if(get.attitude(player,event.target)>=0) return false;
var cards=event.target.getCards('h');
if(cards.filter(card=>player.hasUseTarget(card)).length>=cards.length/2) return true;
return false;
},
filter:function(event,player){
return player.isPhaseUsing()&&event.targets.length==1&&event.target.countCards('h')>0&&player!=event.target&&!player.hasSkill('taoxi_used');
},
logTarget:'target',
content:function(){
'step 0'
player.choosePlayerCard(trigger.target,'h',true);
'step 1'
if(result.bool){
var card=result.links[0];
player.showCards(card,get.translation(player)+'对'+get.translation(trigger.target)+'发动了【讨袭】');
if(!player.storage.taoxi_list) player.storage.taoxi_list=[[],[]];
if(!player.storage.taoxi_list[1].some(i=>i._cardid==card.cardid)){
var cardx=ui.create.card();
cardx.init(get.cardInfo(card));
cardx._cardid=card.cardid;
player.directgains([cardx],null,'taoxi');
player.storage.taoxi_list[0].push(trigger.target);
player.storage.taoxi_list[1].push(cardx);
player.markSkill('taoxi_list');
player.addTempSkill('taoxi_list');
player.addTempSkill('taoxi_use');
player.addTempSkill('taoxi_used','phaseUseAfter');
}
}
},
subSkill:{
used:{},
use:{
trigger:{player:'useCardBefore'},
charlotte:true,
forced:true,
popup:false,
firstDo:true,
group:'taoxi_lose',
filter:function(event,player){
if(!player.storage.taoxi_list||!player.storage.taoxi_list.length) return false;
var list=player.storage.taoxi_list[1];
return event.cards&&event.cards.some(card=>{
return list.contains(card);
})
},
content:function(){
var cards=[],list=player.storage.taoxi_list;
for(var card of trigger.cards){
var bool=false;
for(var i=0;icardxx.cardid==cardid)[0];
if(cardx&&get.position(cardx)=='h'){
cards.push(cardx);
list[0][i].$throw(cardx);
bool=true;
break;
}
}
}
if(!bool) cards.push(card);
}
trigger.cards=cards;
trigger.card.cards=cards;
trigger.throw=false;
},
mod:{
aiOrder:function(player,card,num){
var list=player.storage.taoxi_list;
if(!list||!list[1]) return;
if(list[1].contains(card)) return num+0.5;
},
cardEnabled2:function(card){
if(get.itemtype(card)=='card'&&card.hasGaintag('taoxi')&&_status.event.name=='chooseToRespond') return false;
},
},
ai:{
effect:{
player_use:function(card,player,target){
var list=player.storage.taoxi_list;
if(!list||!list[1]) return;
if(list[1].contains(card)) return [1,1];
}
}
}
},
lose:{
trigger:{
global:['loseEnd','equipEnd','addJudgeEnd','gainEnd','loseAsyncEnd','addToExpansionEnd'],
},
charlotte:true,
forced:true,
popup:false,
firstDo:true,
filter:function(event,player){
var list=player.storage.taoxi_list;
if(!list||!list[0].length) return false;
return game.hasPlayer(function(current){
if(!list[0].contains(current)) return;
var evt=event.getl(current);
if(evt&&evt.hs&&evt.hs.some(card=>{
return list[1].some(i=>i._cardid==card.cardid);
})) return true;
return false;
});
},
content:function(){
var list=player.storage.taoxi_list;
var targets=game.filterPlayer(function(current){
if(!list[0].contains(current)) return;
var evt=trigger.getl(current);
if(evt&&evt.hs&&evt.hs.some(card=>{
return list[1].some(i=>i._cardid==card.cardid);
})) return true;
return false;
});
for(var target of targets){
var hs=trigger.getl(target).hs;
for(var i=0;ij.cardid==list[1][i]._cardid)){
if(player.isOnline2()){
player.send(function(list,i){
game.me.storage.taoxi_list=list;
list[1][i].delete();
list[0].splice(i,1);list[1].splice(i,1);
},player.storage.taoxi_list,i);
}
list[1][i].delete();
list[0].splice(i,1);list[1].splice(i,1);
i--;
}
}
}
}
},
list:{
trigger:{player:'phaseEnd'},
charlotte:true,
forced:true,
onremove:function(player){
game.broadcastAll(function(player){
player.storage.taoxi_list[1].forEach(i=>i.delete());
delete player.storage.taoxi_list;
},player);
},
filter:function(event,player){
return player.storage.taoxi_list&&player.storage.taoxi_list[0].length>0;
},
content:function(){
player.loseHp();
}
}
}
},
xingshuai:{
skillAnimation:true,
animationColor:'thunder',
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,
limited:true,
mark:false,
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,'回复一点体力');
player.recover();
}
if(event.targets.length){
event.goto(1);
}
'step 3'
if(event.damages.length){
var next=game.createEvent('xingshuaI_next');
event.next.remove(next);
trigger.after.push(next);
next.targets=event.damages;
next.setContent(function(){
targets.shift().damage();
if(targets.length) 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:false,
delay:false,
content:function(){
player.give(cards,target);
target.addTempSkill('mingjian2',{player:'phaseAfter'});
target.storage.mingjian2++;
target.updateMarks('mingjian2');
},
ai:{
order:1,
result:{
target:function(player,target){
if(target.hasSkillTag('nogain')) return 0;
if(player.countCards('h')==player.countCards('h','du')) return -1;
if(target.hasJudge('lebu')) return 0;
if(get.attitude(player,target)>3){
var basis=get.threaten(target);
if(player==get.zhu(player)&&player.hp<=2&&player.countCards('h','shan')&&!game.hasPlayer(function(current){
return get.attitude(current,player)>3&¤t.countCards('h','tao')>0;
})) return 0;
if(target.countCards('h')+player.countCards('h')>target.hp+2) return basis*0.8;
return basis;
}
return 0;
}
}
}
},
mingjian2:{
charlotte:true,
mark:true,
intro:{
content:'手牌上限+#,出杀次数+#'
},
init:function(player,skill){
if(!player.storage[skill]) player.storage[skill]=0;
},
onremove:true,
mod:{
maxHandcard:function(player,num){
return num+player.storage.mingjian2;
},
cardUsable:function(card,player,num){
if(card.name=='sha') return num+player.storage.mingjian2;
}
},
},
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_old'),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_old',result.targets);
trigger.cancel();
var target=result.targets[0];
target.addSkill('mingjian2_old');
var hs=player.getCards('h');
player.give(hs,target);
}
}
},
mingjian2_old:{
audio:false,
trigger:{global:'phaseAfter'},
forced:true,
popup:false,
charlotte:true,
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_old');
}
},
huituo:{
audio:2,
trigger:{player:'damageEnd'},
direct:true,
content:function(){
'step 0'
player.chooseTarget(get.prompt2('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.card&&event.card.name=='sha';
},
direct:true,
//priority:5,
audio:2,
content:function(){
'step 0'
var prompt='弃置一张牌'
if(trigger.source.getEquip(1)) prompt+=(',然后获得'+get.translation(trigger.source)+'装备区中的'+get.translation(trigger.source.getEquip(1)));
var next=player.chooseToDiscard('he',get.prompt('duodao',trigger.source),prompt);
next.logSkill=['duodao',trigger.source];
next.set('ai',function(card){
if(!_status.event.getTrigger().source.getEquip(1)) return 0;
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.getEquip(1)){
player.gain(trigger.source.getEquip(1),trigger.source,'give','bySelf');
}
},
ai:{
maixie_defend:true,
}
},
reanjian:{
trigger:{player:'useCardToPlayered'},
forced:true,
audio:2,
filter:function(event,player){
return event.card.name=='sha'&&!event.target.inRange(player);
},
logTarget:'target',
content:function(){
trigger.getParent().reanjian_buffed=true;
var map=trigger.customArgs;
var id=trigger.target.playerid;
if(!map[id]) map[id]={};
if(!map[id].extraDamage) map[id].extraDamage=0;
map[id].extraDamage++;
trigger.target.addTempSkill('reanjian2');
trigger.target.addTempSkill('reanjian4');
trigger.target.storage.reanjian2.add(trigger.card);
},
ai:{
unequip_ai:true,
skillTagFilter:function(player,tag,arg){
if(arg&&arg.name=='sha'&&arg.target&&!arg.target.inRange(player)) return true;
return false;
}
},
},
reanjian2:{
firstDo:true,
ai:{unequip2:true},
init:function(player,skill){
if(!player.storage[skill]) player.storage[skill]=[];
},
onremove:true,
trigger:{
player:['damage','damageCancelled','damageZero'],
target:['shaMiss','useCardToExcluded'],
},
charlotte:true,
filter:function(event,player){
return player.storage.reanjian2&&event.card&&player.storage.reanjian2.contains(event.card);
},
silent:true,
forced:true,
popup:false,
priority:12,
content:function(){
player.storage.reanjian2.remove(trigger.card);
if(!player.storage.reanjian2.length) player.removeSkill('reanjian2');
},
},
reanjian3:{
mod:{
cardSavable:function(card){
if(card.name=='tao') return false;
},
},
},
reanjian4:{
trigger:{player:'dyingBegin'},
forced:true,
silent:true,
firstDo:true,
filter:function(event,player){
return event.getParent(2).reanjian_buffed=true;
},
content:function(){
player.addTempSkill('reanjian3',{global:['dyingEnd','phaseEnd']});
},
},
reduodao:{
trigger:{target:'useCardToTargeted'},
filter:function(event,player){
return event.card.name=='sha'&&(get.color(event.card)=='red'?event.player.getEquip(1):player.countCards('he')>0);
},
direct:true,
audio:2,
content:function(){
'step 0'
var prompt='弃置一张牌'
if(trigger.player.getEquip(1)) prompt+=(',然后获得'+get.translation(trigger.player)+'装备区中的'+get.translation(trigger.player.getEquip(1)));
var next=player.chooseToDiscard('he',get.prompt('reduodao',trigger.player),prompt);
next.logSkill=['reduodao',trigger.player];
next.set('ai',function(card){
if(!_status.event.getTrigger().player.getEquip(1)) return 0;
if(get.attitude(_status.event.player,_status.event.getTrigger().player)*get.value(_status.event.getTrigger().player.getEquip(1))<=0){
return 6-get.value(card);
}
return 0;
});
'step 1'
if(result.bool&&trigger.player.getEquip(1)){
if(!result.cards||!result.cards.length) player.logSkill('reduodao',trigger.player);
player.gain(trigger.player.getEquip(1),trigger.player,'give','bySelf');
}
},
},
anjian:{
audio:2,
trigger:{source:'damageBegin1'},
check:function(event,player){
return get.attitude(player,event.player)<=0;
},
forced:true,
filter:function(event,player){
return event.getParent().name=='sha'&&!event.player.inRange(player);
},
content:function(){
trigger.num++;
}
},
xinpojun:{
shaRelated:true,
trigger:{player:'useCardToPlayered'},
direct:true,
filter:function(event,player){
return event.card.name=='sha'&&player.isPhaseUsing()&&event.target.hp>0&&event.target.countCards('he')>0;
},
audio:2,
content:function(){
'step 0'
player.choosePlayerCard(trigger.target,'he',
[1,Math.min(trigger.target.countCards('he'),trigger.target.hp)],get.prompt('xinpojun',trigger.target)).set('forceAuto',true);
'step 1'
if(result.bool&&result.links.length){
var target=trigger.target;
player.logSkill('xinpojun',target);
target.addToExpansion(result.cards,'giveAuto',target).gaintag.add('xinpojun2');
target.addSkill('xinpojun2');
}
},
ai:{
unequip_ai:true,
directHit_ai:true,
skillTagFilter:function(player,tag,arg){
if(get.attitude(player,arg.target)>0||!player.isPhaseUsing()) return false;
if(tag=='directHit_ai') return arg.target.hp>=Math.max(1,arg.target.countCards('h')-1);
if(arg&&arg.name=='sha'&&arg.target.getEquip(2)) return true;
return false;
}
},
},
xinpojun2:{
trigger:{global:'phaseEnd'},
forced:true,
popup:false,
charlotte:true,
filter:function(event,player){
return player.getExpansions('xinpojun2').length>0;
},
content:function(){
'step 0'
var cards=player.getExpansions('xinpojun2');
player.gain(cards,'draw');
game.log(player,'收回了'+get.cnNumber(cards.length)+'张“破军”牌');
'step 1'
player.removeSkill('xinpojun2');
},
intro:{
markcount:'expansion',
mark:function(dialog,storage,player){
var cards=player.getExpansions('xinpojun2');
if(player.isUnderControl(true)) dialog.addAuto(cards);
else return '共有'+get.cnNumber(cards.length)+'张牌';
},
},
},
qiaoshi:{
audio:2,
trigger:{global:'phaseJieshuBegin'},
filter:function(event,player){
return event.player!=player&&event.player.countCards('h')==player.countCards('h')&&event.player.isAlive();
},
check:function(event,player){
return get.attitude(player,event.player)>=0;
},
logTarget:'player',
content:function(){
game.asyncDraw([trigger.player,player]);
},
},
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);
game.log(player,'将',cards,'置入了弃牌堆');
},
discard:false,
loseTo:'discardPile',
visible:true,
delay:0.5,
content:function(){
player.draw();
},
ai:{
basic:{
order:1
},
result:{
player:1,
},
},
group:'yanyu2'
},
yanyu2:{
trigger:{player:'phaseUseEnd'},
direct:true,
filter:function(event,player){
return player.getHistory('lose',function(evt){
var evt2=evt.getParent();
return evt2.name=='useSkill'&&evt2.skill=='yanyu'&&evt.getParent(3)==event;
}).length>=2;
},
content:function(){
'step 0'
player.chooseTarget(get.prompt('yanyu'),'令一名男性角色摸两张牌',function(card,player,target){
return target.hasSex('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:2,
trigger:{player:'phaseJieshuBegin'},
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.countGainableCards(player,'he')){
player.gainPlayerCard('he',event.target,true);
}
},
ai:{
expose:0.2,
}
},
fuhun:{
enable:['chooseToUse','chooseToRespond'],
filterCard:true,
selectCard:2,
position:'hs',
audio:2,
audioname:['re_guanzhang'],
derivation:['new_rewusheng','olpaoxiao'],
viewAs:{name:'sha'},
prompt:'将两张手牌当杀使用或打出',
viewAsFilter:function(player){
return player.countCards('hs')>1;
},
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('hs')<4) return 6-get.useful(card);
return 7-get.useful(card);
},
ai:{
respondSha:true,
skillTagFilter:function(player){
if(player.countCards('hs')<2) return false;
},
order:function(item,player){
if(player.hasSkill('new_rewusheng')&&player.hasSkill('olpaoxiao')){
return 1;
}
if(player.countCards('hs')<4){
return 1;
}
return 4;
},
},
group:'fuhun2'
},
fuhun2:{
trigger:{source:'damageSource'},
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('olpaoxiao');
player.addTempSkill('fuhun3');
}
},
fuhun3:{},
fencheng:{
skillAnimation:'epic',
animationColor:'gray',
audio:2,
enable:'phaseUse',
filter:function(event,player){
return !player.storage.fencheng;
},
filterTarget:function(card,player,target){
return player!=target;
},
unique:true,
limited: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:'useCard2'},
direct:true,
audio:2,
filter:function(event,player){
if(get.type(event.card)!='trick'||get.color(event.card)!='black') return false;
if(!event.targets||event.targets.length!=1) return false;
var info=get.info(event.card);
if(info.allowMultiple==false) return false;
if(event.targets&&!info.multitarget){
if(game.hasPlayer(function(current){
return !event.targets.contains(current)&&lib.filter.targetEnabled2(event.card,player,current)&&lib.filter.targetInRange(event.card,player,current);
})){
return true;
}
}
return false;
},
position:'he',
content:function(){
"step 0"
player.chooseTarget(get.prompt('mieji'),'为'+get.translation(trigger.card)+'增加一个额外目标',function(card,player,target){
var player=_status.event.player;
if(_status.event.targets.contains(target)) return false;
return lib.filter.targetEnabled2(_status.event.card,player,target)&&lib.filter.targetInRange(_status.event.card,player,target);
}).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);
}).set('targets',trigger.targets).set('card',trigger.card);
"step 1"
if(result.bool){
player.logSkill('mieji',result.targets);
trigger.targets.push(result.targets[0]);
}
}
},
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;i{
if(current==player||current.countCards('h')) return false;
var evt=event.getl(current);
return evt&&evt.hs&&evt.hs.length;
});
},
check:function(event,player){
return get.damageEffect(event.player,player,player)>0;
},
content:function(){
'step 0'
var targets=game.filterPlayer(current=>{
if(current==player||current.countCards('h')) return false;
var evt=trigger.getl(current);
return evt&&evt.hs&&evt.hs.length;
});
event.targets=targets;
'step 1'
var target=event.targets.shift();
event.target=target;
player.chooseBool(get.prompt2('juece',target)).set('ai',()=>{
return get.damageEffect(_status.event.getParent().target,_status.event.player,_status.event.player)>=0;
});
'step 2'
if(result.bool){
player.logSkill('juece',target);
target.damage();
}
'step 3'
if(targets.length) event.goto(1);
},
ai:{
threaten:1.1
}
},
jiefan:{
skillAnimation:true,
animationColor:'wood',
audio:2,
audioname:['re_handang'],
unique:true,
limited:true,
mark:true,
init:function(player){
player.storage.jiefan=false;
},
enable:'phaseUse',
filter:function(event,player){
return !player.storage.jiefan;
},
intro:{
content:'limited'
},
filterTarget:true,
content:function(){
"step 0"
player.awakenSkill('jiefan');
player.storage.jiefan=true;
event.players=game.filterPlayer(function(current){
return current!=target&¤t.inRange(target);
});
event.players.sortBySeat(target);
"step 1"
if(event.players.length){
event.current=event.players.shift();
event.current.animate('target');
player.line(event.current,'green');
if(event.current.countCards('he')&&target.isAlive()){
event.current.chooseToDiscard({subtype:'equip1'},'he','弃置一张武器牌或让'+
get.translation(target)+'摸一张牌').set('ai',function(card){
if(get.attitude(_status.event.player,_status.event.target)<0) return 7-get.value(card);
return -1;
}).set('target',target);
event.tempbool=false;
}
else{
event.tempbool=true;
}
}
else{
event.finish();
}
"step 2"
if(event.tempbool||result.bool==false){
target.draw();
}
event.goto(1);
},
ai:{
order:5,
result:{
target:function(player,target){
if(player.hp>2){
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;
},
filter:function(event,player){
return player!=event.player;
},
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();
},
filter:function(event,player){
return player.countCards('he')>0;
},
check:function(card){return 7-get.value(card);},
position:'he',
filterCard:true,
content:function(){
target.damage('nocard');
},
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
}
},
olsanyao:{
enable:'phaseUse',
audio:'sanyao',
filter:function(event,player){
return player.countCards('he')>0&&(!player.hasSkill('olsanyao0')||!player.hasSkill('olsanyao1'));
},
chooseButton:{
dialog:function(event,player){
var list=[
'选择手牌数最多的一名角色',
'选择体力值最大的一名角色',
];
var choiceList=ui.create.dialog('散谣:请选择一项','forcebutton','hidden');
for(var i=0;i';
str+=list[i];
if(!bool) str+='