This commit is contained in:
libccy 2016-04-25 15:59:31 +08:00
parent f758ecb333
commit 8c47460ceb
5 changed files with 276 additions and 162 deletions

View File

@ -192,9 +192,9 @@ card.mingzhong={
}, },
translate:{ translate:{
shengdong:'声东击西', shengdong:'声东击西',
shengdong_info:'出牌阶段,对距离为1的一名角色使用。你交给目标角色一张手牌,若如此做,其将两张牌交给另一名由你选择的其他角色', shengdong_info:'出牌阶段,对一名角色使用。你交给目标角色一张手牌,若如此做,其将两张牌交给另一名由你选择的其他角色',
zengbin:'增兵减灶', zengbin:'增兵减灶',
zengbin_info:'出牌阶段,对一名角色使用。目标角色摸三张牌然后选择一项1.弃置一张非基本牌2.弃置两张牌', zengbin_info:'出牌阶段,对距离为1的一名角色使用。目标角色摸三张牌然后选择一项1.弃置一张非基本牌2.弃置两张牌',
caomu:'草木皆兵', caomu:'草木皆兵',
caomu_info:'出牌阶段对一名其他角色使用。将【草木皆兵】放置于该角色的判定区里若判定结果不为梅花摸牌阶段目标角色少摸一张牌摸牌阶段结束时与其距离为1的角色各摸一张牌', caomu_info:'出牌阶段对一名其他角色使用。将【草木皆兵】放置于该角色的判定区里若判定结果不为梅花摸牌阶段目标角色少摸一张牌摸牌阶段结束时与其距离为1的角色各摸一张牌',
}, },

View File

@ -1559,7 +1559,10 @@ character.shenhua={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
position:'he', position:'he',
filterCard:true, filterCard:function(){
if(ui.selected.targets.length==2) return false;
return true;
},
selectCard:[0,Infinity], selectCard:[0,Infinity],
selectTarget:2, selectTarget:2,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
@ -1734,7 +1737,7 @@ character.shenhua={
}, },
ai:{ ai:{
skillTagFilter:function(player){ skillTagFilter:function(player){
return player.num('h',{suit:'spade'})>0; return player.num('h',{suit:'spade'})>0&&player.hp<=0;
}, },
threaten:1.5, threaten:1.5,
save:true, save:true,

View File

@ -32,6 +32,7 @@ character.sp={
shixie:['male','qun',3,['biluan','lixia']], shixie:['male','qun',3,['biluan','lixia']],
mayunlu:['female','shu',4,['fengpo','mashu']], mayunlu:['female','shu',4,['fengpo','mashu']],
zhanglu:['male','qun',3,['yishe','bushi','midao']], zhanglu:['male','qun',3,['yishe','bushi','midao']],
//from here
wutugu:['male','qun',15,['ranshang','hanyong']], wutugu:['male','qun',15,['ranshang','hanyong']],
sp_caiwenji:['female','wei',3,['chenqing','mozhi']], sp_caiwenji:['female','wei',3,['chenqing','mozhi']],
zhugeguo:['female','shu',3,['yuhua','qirang']], zhugeguo:['female','shu',3,['yuhua','qirang']],
@ -2319,10 +2320,10 @@ character.sp={
player.draw(2); player.draw(2);
player.chooseCard(2,'he',true,'选择两张牌作为“米”'); player.chooseCard(2,'he',true,'选择两张牌作为“米”');
'step 1' 'step 1'
player.markSkill('yishe');
player.storage.yishe=result.cards; player.storage.yishe=result.cards;
player.lose(result.cards,ui.special); player.lose(result.cards,ui.special);
game.addVideo('storage',player,['yishe',get.cardsInfo(player.storage.yishe),'cards']); player.syncStorage('yishe');
player.markSkill('yishe');
} }
}, },
bushi:{ bushi:{
@ -2337,13 +2338,17 @@ character.sp={
'step 1' 'step 1'
if(result.bool){ if(result.bool){
player.logSkill('bushi'); player.logSkill('bushi');
trigger.player.gain(result.buttons[0].link,'gain2'); game.log(player,'获得了',result.links);
player.storage.yishe.remove(result.buttons[0].link); trigger.player.gain(result.links[0],'draw2');
game.addVideo('storage',player,['yishe',get.cardsInfo(player.storage.yishe),'cards']); player.storage.yishe.remove(result.links[0]);
player.syncStorage('yishe');
if(player.storage.yishe.length==0){ if(player.storage.yishe.length==0){
player.recover(); player.recover();
player.unmarkSkill('yishe'); player.unmarkSkill('yishe');
} }
else{
player.markSkill('yishe');
}
} }
} }
}, },
@ -2357,39 +2362,48 @@ character.sp={
content:function(){ content:function(){
"step 0" "step 0"
var list=player.storage.yishe; var list=player.storage.yishe;
var dialog=ui.create.dialog(get.translation(trigger.player)+'的'+(trigger.judgestr||'')+'判定为'+get.translation(trigger.player.judging[0])+ player.chooseButton([get.translation(trigger.player)+'的'+(trigger.judgestr||'')+'判定为'+get.translation(trigger.player.judging[0])+
',是否发动【米道】?',list,'hidden'); ',是否发动【米道】?',list,'hidden'],function(button){
player.chooseButton(dialog,function(button){
var card=button.link; var card=button.link;
var trigger=_status.event.parent._trigger; var trigger=_status.event.getParent()._trigger;
var player=_status.event.player; var player=_status.event.player;
var result=trigger.judge(card)-trigger.judge(trigger.player.judging[0]); var judging=_status.event.judging;
var result=trigger.judge(card)-trigger.judge(judging);
var attitude=ai.get.attitude(player,trigger.player); var attitude=ai.get.attitude(player,trigger.player);
return result*attitude; return result*attitude;
}); }).set('judging',trigger.player.judging);
"step 1" "step 1"
if(result.bool){ if(result.bool){
event.card=result.buttons[0].link; player.logSkill('midao',trigger.player);
player.$throw(event.card,1000); var card=result.links[0];
player.storage.yishe.remove(result.buttons[0].link); player.storage.yishe.remove(card);
game.addVideo('storage',player,['yishe',get.cardsInfo(player.storage.yishe),'cards']); player.syncStorage('yishe');
if(player.storage.yishe.length==0){ if(player.storage.yishe.length==0){
player.recover(); player.recover();
player.unmarkSkill('yishe'); player.unmarkSkill('yishe');
} }
if(event.card.clone){ else{
event.card.clone.classList.add('thrownhighlight'); player.markSkill('yishe');
game.addVideo('highlightnode',player,get.cardInfo(event.card));
} }
}
"step 2" player.$throw(card);
if(event.card){ game.broadcastAll(function(card){
player.logSkill('midao',trigger.player); if(card.clone){
ui.discardPile.appendChild(trigger.player.judging[0]); card.clone.classList.add('thrownhighlight');
trigger.player.judging[0]=event.card; }
trigger.position.appendChild(event.card); },card);
game.log(trigger.player,'的判定牌改为',event.card); if(trigger.player.judging[0].clone){
event.card.expired=true; trigger.player.judging[0].clone.classList.remove('thrownhighlight');
game.broadcast(function(card){
if(card.clone){
card.clone.classList.remove('thrownhighlight');
}
},trigger.player.judging[0]);
game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone]));
}
trigger.player.judging[0]=card;
trigger.position.appendChild(card);
game.log(player,'的判定牌改为',card);
game.delay(2); game.delay(2);
} }
}, },
@ -2410,8 +2424,7 @@ character.sp={
content:function(){ content:function(){
'step 0' 'step 0'
player.addTempSkill('fengpo3','phaseAfter'); player.addTempSkill('fengpo3','phaseAfter');
player.chooseControl('draw_card','加伤害','cancel', player.chooseControl('draw_card','加伤害','cancel').set('prompt','是否发动【凤魄】?');
ui.create.dialog('是否发动【凤魄】?','hidden'));
'step 1' 'step 1'
if(result.control&&result.control!='cancel'){ if(result.control&&result.control!='cancel'){
player.logSkill('fengpo'); player.logSkill('fengpo');
@ -2429,8 +2442,7 @@ character.sp={
fengpo2:{ fengpo2:{
trigger:{source:'damageBegin'}, trigger:{source:'damageBegin'},
filter:function(event){ filter:function(event){
return event.card&&(event.card.name=='sha'||event.card.name=='juedou')&& return event.card&&(event.card.name=='sha'||event.card.name=='juedou')&&event.notLink();
event.parent.name!='_lianhuan'&&event.parent.name!='_lianhuan2';
}, },
forced:true, forced:true,
audio:false, audio:false,
@ -2501,6 +2513,7 @@ character.sp={
} }
player.$damagepop(ng.length,'unknownx'); player.$damagepop(ng.length,'unknownx');
player.storage.biluan+=ng.length; player.storage.biluan+=ng.length;
player.markSkill('biluan');
game.addVideo('storage',player,['biluan',player.storage.biluan]); game.addVideo('storage',player,['biluan',player.storage.biluan]);
trigger.untrigger(); trigger.untrigger();
trigger.finish(); trigger.finish();
@ -2522,16 +2535,17 @@ character.sp={
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget(function(card,player,target){ player.chooseTarget(function(card,player,target){
return target==player||target==trigger.player; return target==player||target==_status.event.getParent()._trigger.player;
},true,'礼下:选择一个目标摸一张牌').ai=function(target){ },true,'礼下:选择一个目标摸一张牌').set('ai',function(target){
return player==target?1:0; return player==target?1:0;
}; });
'step 1' 'step 1'
if(result.targets.length){ if(result.targets.length){
result.targets[0].draw(); result.targets[0].draw();
player.line(result.targets[0],'green'); player.line(result.targets[0],'green');
} }
player.storage.biluan--; player.storage.biluan--;
player.markSkill('biluan');
game.addVideo('storage',player,['biluan',player.storage.biluan]); game.addVideo('storage',player,['biluan',player.storage.biluan]);
} }
}, },
@ -2656,12 +2670,16 @@ character.sp={
"step 0" "step 0"
if(player.storage.kunfen|| if(player.storage.kunfen||
(lib.config.mode=='guozhan'&&player.hiddenSkills.contains('kunfen'))){ (lib.config.mode=='guozhan'&&player.hiddenSkills.contains('kunfen'))){
player.chooseBool('是否发动【困奋】?').ai=function(){ if(!player.storage.kunfen){
event.skillHidden=true;
}
player.chooseBool('是否发动【困奋】?').set('ai',function(){
var player=_status.event.player;
if(player.hp>3) return true; if(player.hp>3) return true;
if(player.hp==3&&player.num('h')<3) return true; if(player.hp==3&&player.num('h')<3) return true;
if(player.hp==2&&player.num('h')==0) return true; if(player.hp==2&&player.num('h')==0) return true;
return false; return false;
} });
} }
else{ else{
event.forced=true; event.forced=true;
@ -2720,9 +2738,10 @@ character.sp={
"step 0" "step 0"
player.chooseTarget('是否发动【刺槐】?',function(card,player,target){ player.chooseTarget('是否发动【刺槐】?',function(card,player,target){
return player.canUse({name:'sha'},target); return player.canUse({name:'sha'},target);
}).ai=function(target){ }).set('ai',function(target){
var player=_status.event.player;
return ai.get.effect(target,{name:'sha'},player,player); return ai.get.effect(target,{name:'sha'},player,player);
} });
"step 1" "step 1"
if(result.bool){ if(result.bool){
player.logSkill('cihuai'); player.logSkill('cihuai');
@ -2852,14 +2871,6 @@ character.sp={
} }
} }
if(cards.length){ if(cards.length){
var dialog;
if(event.isMine()){
dialog=ui.create.dialog('是否发动【'+get.translation(event.name)+'】?','hidden');
dialog.add(cards);
for(var i=0;i<dialog.buttons.length;i++){
dialog.buttons[i].style.opacity=1;
}
}
var maxval=0; var maxval=0;
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
var tempval=ai.get.value(cards[i]); var tempval=ai.get.value(cards[i]);
@ -2868,10 +2879,12 @@ character.sp={
} }
} }
maxval+=cards.length-1; maxval+=cards.length-1;
var next=player.chooseToDiscard('he',{suit:suits},dialog); var next=player.chooseToDiscard('he',{suit:suits});
next.ai=function(card){ next.set('ai',function(card){
return maxval-ai.get.value(card); return _status.event.maxval-ai.get.value(card);
}; });
next.set('maxval',maxval);
next.set('dialog',['是否发动【'+get.translation(event.name)+'】?','hidden',cards])
next.logSkill=event.name; next.logSkill=event.name;
event.cards=cards; event.cards=cards;
} }
@ -2902,8 +2915,9 @@ character.sp={
content:function(){ content:function(){
"step 0" "step 0"
player.storage.zuixiang=get.cards(3); player.storage.zuixiang=get.cards(3);
game.addVideo('storage',player,['zuixiang',get.cardsInfo(player.storage.zuixiang),'cards']);
player.showCards(player.storage.zuixiang); player.showCards(player.storage.zuixiang);
player.markSkill('zuixiang');
player.syncStorage('zuixiang');
"step 1" "step 1"
var cards=player.storage.zuixiang; var cards=player.storage.zuixiang;
if(cards[0].number==cards[1].number|| if(cards[0].number==cards[1].number||
@ -2975,8 +2989,9 @@ character.sp={
ui.discardPile.appendChild(player.storage.zuixiang[i]); ui.discardPile.appendChild(player.storage.zuixiang[i]);
} }
player.storage.zuixiang=get.cards(3); player.storage.zuixiang=get.cards(3);
game.addVideo('storage',player,['zuixiang',get.cardsInfo(player.storage.zuixiang),'cards']);
player.showCards(player.storage.zuixiang); player.showCards(player.storage.zuixiang);
player.markSkill('zuixiang');
player.syncStorage('zuixiang');
} }
"step 1" "step 1"
var cards=player.storage.zuixiang; var cards=player.storage.zuixiang;
@ -3034,9 +3049,9 @@ character.sp={
content:function(){ content:function(){
"step 0" "step 0"
var next=player.chooseToDiscard('协穆:是否弃置一张杀并摸两张牌?',{name:'sha'}); var next=player.chooseToDiscard('协穆:是否弃置一张杀并摸两张牌?',{name:'sha'});
next.ai=function(card){ next.set('ai',function(card){
return 9-ai.get.value(card); return 9-ai.get.value(card);
}; });
next.logSkill='xiemu'; next.logSkill='xiemu';
"step 1" "step 1"
if(result.bool){ if(result.bool){
@ -3130,7 +3145,7 @@ character.sp={
target.addSkill('zhoufu2'); target.addSkill('zhoufu2');
target.storage.zhoufu3=player; target.storage.zhoufu3=player;
ui.special.appendChild(cards[0]); ui.special.appendChild(cards[0]);
game.addVideo('storage',target,['zhoufu2',get.cardInfo(cards[0]),'card']); target.syncStorage('zhoufu2');
}, },
check:function(card){ check:function(card){
return 3-ai.get.value(card) return 3-ai.get.value(card)
@ -3150,20 +3165,30 @@ character.sp={
mark:'card', mark:'card',
content:function(){ content:function(){
"step 0" "step 0"
ui.discardPile.appendChild(player.storage.zhoufu2);
player.$throw(player.storage.zhoufu2); player.$throw(player.storage.zhoufu2);
if(player.storage.zhoufu3.isAlive()&&player.storage.zhoufu3.skills.contains('yingbin')){ game.broadcastAll(function(card){
player.logSkill('yingbin'); if(card.clone){
player.storage.zhoufu3.draw(2); card.clone.classList.add('thrownhighlight');
}
},player.storage.zhoufu2);
if(player.judging[0].clone){
player.judging[0].clone.classList.remove('thrownhighlight');
game.broadcast(function(card){
if(card.clone){
card.clone.classList.remove('thrownhighlight');
}
},player.judging[0]);
game.addVideo('deletenode',player,get.cardsInfo([player.judging[0].clone]));
} }
else{
game.delay(1.5);
}
"step 1"
player.judging[0]=player.storage.zhoufu2; player.judging[0]=player.storage.zhoufu2;
trigger.position.appendChild(player.storage.zhoufu2); trigger.position.appendChild(player.storage.zhoufu2);
// trigger.untrigger();
game.log(player,'的判定牌改为',player.storage.zhoufu2); game.log(player,'的判定牌改为',player.storage.zhoufu2);
game.delay(2);
"step 1"
if(player.storage.zhoufu3.isAlive()&&player.storage.zhoufu3.get('s').contains('yingbin')){
player.storage.zhoufu3.logSkill('yingbin');
player.storage.zhoufu3.draw(2);
}
player.removeSkill('zhoufu2'); player.removeSkill('zhoufu2');
delete player.storage.zhoufu2; delete player.storage.zhoufu2;
delete player.storage.zhoufu3; delete player.storage.zhoufu3;
@ -3345,9 +3370,12 @@ character.sp={
"step 0" "step 0"
player.draw(); player.draw();
if(trigger.target!=player){ if(trigger.target!=player){
player.chooseCard(true,'he','交给'+get.translation(trigger.target)+'一张牌').ai=function(card){ player.chooseCard(true,'he','交给'+get.translation(trigger.target)+'一张牌').set('ai',function(card){
if(get.position(card)=='e') return -1;
if(card.name=='shan') return 1; if(card.name=='shan') return 1;
}; if(get.type(card)=='equip') return 0.5;
return 0;
});
} }
else{ else{
event.finish(); event.finish();
@ -3360,13 +3388,13 @@ character.sp={
if(get.type(event.card)!='equip') event.finish(); if(get.type(event.card)!='equip') event.finish();
"step 2" "step 2"
if(!trigger.target.isMin()){ if(!trigger.target.isMin()){
trigger.target.chooseBool('是否装备'+get.translation(event.card)+'').ai=function(){ trigger.target.chooseBool('是否装备'+get.translation(event.card)+'').set('ai',function(){
var current=trigger.target.get('e',{subtype:get.subtype(event.card)}); var current=_status.event.player.get('e',{subtype:get.subtype(_status.event.card)});
if(current&&current.length){ if(current&&current.length){
return ai.get.equipValue(event.card)>ai.get.equipValue(current[0]); return ai.get.equipValue(event.card)>ai.get.equipValue(current[0]);
} }
return true; return true;
}; }).set('card',event.card);
} }
else{ else{
event.finish(); event.finish();
@ -3479,24 +3507,25 @@ character.sp={
controls.push('discard_card'); controls.push('discard_card');
} }
controls.push('cancel'); controls.push('cancel');
player.chooseControl(controls).ai=function(){ player.chooseControl(controls).set('ai',function(){
if(trigger.target.num('he')&&ai.get.attitude(player,trigger.target)<0){ var trigger=_status.event.getParent()._trigger;
if(trigger.target.num('he')&&ai.get.attitude(_status.event.player,trigger.target)<0){
return 'discard_card'; return 'discard_card';
} }
else{ else{
return 'draw_card'; return 'draw_card';
} }
} });
"step 1" "step 1"
if(result.control=='draw_card'){ if(result.control=='draw_card'){
player.draw(); player.draw();
player.logSkill('moukui');
} }
else if(result.control=='discard_card'&&trigger.target.num('he')){ else if(result.control=='discard_card'&&trigger.target.num('he')){
player.discardPlayerCard(trigger.target,'he',true); player.discardPlayerCard(trigger.target,'he',true).logSkill=['moukui',trigger.target];
} }
else event.finish(); else event.finish();
"step 2" "step 2"
player.logSkill('moukui',trigger.target);
player.addTempSkill('moukui2','shaEnd'); player.addTempSkill('moukui2','shaEnd');
}, },
ai:{ ai:{
@ -4172,7 +4201,7 @@ character.sp={
game.delay(); game.delay();
"step 2" "step 2"
target.chooseCard('选择还给'+get.translation(player)+'的牌',true,event.num); target.chooseCard('选择还给'+get.translation(player)+'的牌',true,event.num);
if(target==game.me&&_status.auto) game.delay(0.2); game.delay(0.2);
"step 3" "step 3"
player.gain(result.cards); player.gain(result.cards);
target.$give(result.cards.length,player); target.$give(result.cards.length,player);
@ -4425,16 +4454,16 @@ character.sp={
for(var i=0;i<2;i++){ for(var i=0;i<2;i++){
cards.push(ui.cardPile.childNodes[i]); cards.push(ui.cardPile.childNodes[i]);
} }
player.chooseCardButton('傲才:选择一张卡牌打出',cards).filterButton=function(button){ player.chooseCardButton('傲才:选择一张卡牌打出',cards).set('filterButton',function(button){
return get.type(button.link)=='basic'&&trigger.filterCard(button.link); return get.type(button.link)=='basic'&&_status.event.getParent()._trigger.filterCard(button.link);
} });
"step 1" "step 1"
if(result.bool){ if(result.bool){
game.log(player,'傲才发动成功'); game.log(player,'傲才发动成功');
trigger.untrigger(); trigger.untrigger();
trigger.responded=true; trigger.responded=true;
result.buttons[0].link.remove(); result.links[0].remove();
trigger.result={bool:true,card:result.buttons[0].link} trigger.result={bool:true,card:result.links[0]}
} }
}, },
ai:{ ai:{
@ -4449,42 +4478,47 @@ character.sp={
}, },
aocai2:{ aocai2:{
enable:'chooseToUse', enable:'chooseToUse',
direct:true,
filter:function(event,player){ filter:function(event,player){
return _status.currentPhase!==player&&event.type!='wuxie'&&event.getParent().name!='_chenhuodajie'; return _status.currentPhase!==player&&event.type!='wuxie'&&event.getParent().name!='_chenhuodajie';
}, },
delay:0, onChooseToUse:function(event){
content:function(){ if(!game.online){
"step 0" var cards=[];
var cards=[]; if(ui.cardPile.childNodes.length<2){
if(ui.cardPile.childNodes.length<2){ var discardcards=get.cards(2);
var discardcards=get.cards(2); for(var i=0;i<discardcards.length;i++){
for(var i=0;i<discardcards.length;i++){ ui.discardPile.appendChild(discardcards[i]);
ui.discardPile.appendChild(discardcards[i]); }
} }
} for(var i=0;i<2;i++){
for(var i=0;i<2;i++){ cards.push(ui.cardPile.childNodes[i]);
cards.push(ui.cardPile.childNodes[i]);
}
var dialog=ui.create.dialog('傲才:选择一张卡牌使用',cards);
var trigger=event.parent.parent;
player.chooseButton(dialog,function(){return 1}).filterButton=function(button){
return get.type(button.link)=='basic'&&trigger.filterCard(button.link,player,trigger);
};
player.addTempSkill('aocai4',['useCardAfter','phaseAfter']);
player.popup('aocai');
"step 1"
if(result.bool){
game.log(player,'发动了傲才')
lib.skill.aocai3.viewAs=result.buttons[0].link;
event.parent.parent.backup('aocai3');
event.parent.parent.step=0;
if(event.isMine()){
event.parent.parent.openskilldialog='选择'+get.translation(result.buttons[0].link)+'的目标';
} }
event.set('aocaicards',cards);
} }
else{ },
event.parent.parent.step=0; chooseButton:{
dialog:function(event,player){
return ui.create.dialog('傲才:选择一张卡牌使用',event.aocaicards);
},
filter:function(button,player){
var evt=_status.event.getParent();
if(evt&&evt.filterCard){
return get.type(button.link)=='basic'&&evt.filterCard(button.link,player,evt);
}
return false;
},
check:function(button){
return 1;
},
backup:function(links,player){
return {
filterCard:function(){return false},
selectCard:-1,
viewAs:links[0],
}
},
prompt:function(links,player){
return '选择'+get.translation(links)+'的目标';
} }
}, },
ai:{ ai:{
@ -4499,11 +4533,6 @@ character.sp={
} }
} }
}, },
aocai3:{
filterCard:function(){return false},
selectCard:-1
},
aocai4:{},
hongyuan:{ hongyuan:{
trigger:{player:'phaseDrawBegin'}, trigger:{player:'phaseDrawBegin'},
direct:true, direct:true,
@ -4529,9 +4558,9 @@ character.sp={
return player!=target; return player!=target;
}, },
function(target){ function(target){
if(!check) return 0; if(!_status.event.check) return 0;
return ai.get.attitude(_status.event.player,target); return ai.get.attitude(_status.event.player,target);
}); }).set('check',check);
"step 1" "step 1"
if(result.bool){ if(result.bool){
player.logSkill('hongyuan',result.targets); player.logSkill('hongyuan',result.targets);
@ -4554,7 +4583,6 @@ character.sp={
var cards=player.get('he'); var cards=player.get('he');
var judge=event.judge(event.player.judging[0]); var judge=event.judge(event.player.judging[0]);
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
// console.log(event.judge(cards[i]),judge,ai.get.useful(cards[i]));
var judge2=event.judge(cards[i]); var judge2=event.judge(cards[i]);
if(_status.currentPhase!=player&&judge2==judge&&get.color(cards[i])=='red'&&ai.get.useful(cards[i])<5) return true; if(_status.currentPhase!=player&&judge2==judge&&get.color(cards[i])=='red'&&ai.get.useful(cards[i])<5) return true;
if(judge2>judge) return true; if(judge2>judge) return true;
@ -4566,9 +4594,12 @@ character.sp={
var target=trigger.player; var target=trigger.player;
var judge=trigger.judge(target.judging[0]); var judge=trigger.judge(target.judging[0]);
var attitude=ai.get.attitude(target,player); var attitude=ai.get.attitude(target,player);
target.choosePlayerCard('请选择代替判定的牌','he','visible',true,player).ai=function(button){ target.choosePlayerCard('请选择代替判定的牌','he','visible',true,player).set('ai',function(button){
var card=button.link; var card=button.link;
var judge=_status.event.judge;
var attitude=_status.event.attitude;
var result=trigger.judge(card)-judge; var result=trigger.judge(card)-judge;
var player=_status.event.player;
if(result>0){ if(result>0){
return 20+result; return 20+result;
} }
@ -4587,7 +4618,7 @@ character.sp={
else{ else{
return get.color(card)=='black'?0:-10+result; return get.color(card)=='black'?0:-10+result;
} }
}; }).set('judge',judge).set('attitude',attitude);
"step 1" "step 1"
if(result.bool){ if(result.bool){
event.card=result.buttons[0].link; event.card=result.buttons[0].link;
@ -4599,11 +4630,20 @@ character.sp={
"step 2" "step 2"
if(result.bool){ if(result.bool){
if(trigger.player.judging[0].clone){ if(trigger.player.judging[0].clone){
trigger.player.judging[0].clone.delete(); trigger.player.judging[0].clone.classList.remove('thrownhighlight');
game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[[0]].clone])); game.broadcast(function(card){
if(card.clone){
card.clone.classList.remove('thrownhighlight');
}
},trigger.player.judging[0]);
game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone]));
} }
ui.discardPile.appendChild(trigger.player.judging[0]); ui.discardPile.appendChild(trigger.player.judging[0]);
trigger.player.judging[0]=event.card; trigger.player.judging[0]=event.card;
if(!get.owner(result.cards[0],'judge')){
trigger.position.appendChild(event.card);
}
game.log(trigger.player,'的判定牌改为',event.card);
game.delay(2); game.delay(2);
} }
}, },
@ -4640,9 +4680,13 @@ character.sp={
filter:function(event,player){ filter:function(event,player){
return player.skills.contains('duwu2')==false; return player.skills.contains('duwu2')==false;
}, },
filterCard:true, filterCard:function(){
if(ui.selected.targets.length) return false;
return true;
},
position:'he', position:'he',
selectCard:[1,Infinity], selectCard:[1,Infinity],
complexSelect:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return get.distance(player,target,'attack')<=1&&ui.selected.cards.length==target.hp; return get.distance(player,target,'attack')<=1&&ui.selected.cards.length==target.hp;
}, },
@ -5177,15 +5221,16 @@ character.sp={
} }
"step 1" "step 1"
player.chooseTarget(true,'选择拼点目标',function(card,player,target){ player.chooseTarget(true,'选择拼点目标',function(card,player,target){
return target.num('h')&&target!=event.target1&&target!=player; return target.num('h')&&target!=_status.event.target1&&target!=player;
}).ai=function(target){ }).set('ai',function(target){
var eff=ai.get.effect(target,{name:'sha'},event.target1,player); var player=_status.event.player;
var eff=ai.get.effect(target,{name:'sha'},_status.event.target1,player);
var att=ai.get.attitude(player,target); var att=ai.get.attitude(player,target);
if(att>0){ if(att>0){
return eff-10; return eff-10;
} }
return eff; return eff;
}; }).set('target1',event.target1);
"step 2" "step 2"
if(result.targets.length){ if(result.targets.length){
event.target2=result.targets[0]; event.target2=result.targets[0];
@ -5334,10 +5379,10 @@ character.sp={
content:function(){ content:function(){
"step 0" "step 0"
var check=(player.hp==1||(player.hp==2&&player.num('h')<=1)); var check=(player.hp==1||(player.hp==2&&player.num('h')<=1));
player.chooseTarget('是否发动【随仁】?').ai=function(target){ player.chooseTarget('是否发动【随仁】?').set('ai',function(target){
if(!check) return 0; if(!_status.event.check) return 0;
return ai.get.attitude(player,target); return ai.get.attitude(_status.event.player,target);
} }).set('check',check);
"step 1" "step 1"
if(result.bool){ if(result.bool){
player.storage.suiren=true; player.storage.suiren=true;
@ -5579,6 +5624,7 @@ character.sp={
hongyuan:'弘援', hongyuan:'弘援',
aocai:'傲才', aocai:'傲才',
aocai2:'傲才', aocai2:'傲才',
aocai2_backup:'傲才',
aocai3:'傲才', aocai3:'傲才',
huxiao:'虎啸', huxiao:'虎啸',
xueji:'血祭', xueji:'血祭',

View File

@ -3239,10 +3239,10 @@
if(!lib.config.gameRecord){ if(!lib.config.gameRecord){
lib.config.gameRecord={}; lib.config.gameRecord={};
} }
if(lib.config.debug){ // if(lib.config.debug){
mode.pack.story='剧情'; // mode.pack.story='剧情';
mode.pack.realtime='即时'; // mode.pack.realtime='即时';
} // }
for(i in mode.pack){ for(i in mode.pack){
if(lib.config.hiddenModePack.indexOf(i)==-1){ if(lib.config.hiddenModePack.indexOf(i)==-1){
lib.config.all.mode.push(i); lib.config.all.mode.push(i);
@ -4711,6 +4711,14 @@
}, },
chooseToUse:function(){ chooseToUse:function(){
"step 0" "step 0"
var skills=player.get('s');
game.expandSkills(skills);
for(var i=0;i<skills.length;i++){
var info=lib.skill[skills[i]];
if(info&&info.onChooseToUse){
info.onChooseToUse(event);
}
}
_status.noclearcountdown=true; _status.noclearcountdown=true;
if(event.isMine()){ if(event.isMine()){
if(event.type=='wuxie'){ if(event.type=='wuxie'){
@ -4951,7 +4959,12 @@
} }
}); });
} }
if(event.prompt!=false){ if(Array.isArray(event.dialog)){
event.dialog=ui.create.dialog.apply(this,event.dialog);
event.dialog.open();
event.dialog.classList.add('noselect');
}
else if(event.prompt!=false){
var str; var str;
if(typeof(event.prompt)=='string') str=event.prompt; if(typeof(event.prompt)=='string') str=event.prompt;
else{ else{
@ -5013,7 +5026,7 @@
} }
} }
if(!game.online) player.discard(event.result.cards); if(!game.online) player.discard(event.result.cards);
if(event.dialog) event.dialog.close(); if(event.dialog&&event.dialog.close) event.dialog.close();
}, },
chooseToCompare:function(){ chooseToCompare:function(){
"step 0" "step 0"
@ -6300,7 +6313,18 @@
game.log(player,'弃置了',cards); game.log(player,'弃置了',cards);
player.lose(cards); player.lose(cards);
if(event.animate!=false){ if(event.animate!=false){
player.$throw(cards,1000); event.discardid=lib.status.videoId++;
game.broadcastAll(function(player,cards,id){
player.$throw(cards,null,'nobroadcast');
var cardnodes=[];
cardnodes._discardtime=get.time();
for(var i=0;i<cards.length;i++){
if(cards[i].clone){
cardnodes.push(cards[i].clone);
}
}
ui.todiscard[id]=cardnodes;
},player,cards,event.discardid);
if(lib.config.sync_speed&&cards[0]&&cards[0].clone){ if(lib.config.sync_speed&&cards[0]&&cards[0].clone){
if(event.delay!=false){ if(event.delay!=false){
var waitingForTransition=get.time(); var waitingForTransition=get.time();
@ -7984,7 +8008,7 @@
if(next.filterCard) next.ai=arguments[i]; if(next.filterCard) next.ai=arguments[i];
else next.filterCard=arguments[i]; else next.filterCard=arguments[i];
} }
else if(typeof arguments[i]=='object'){ else if(typeof arguments[i]=='object'&&arguments[i]){
next.filterCard=get.filter(arguments[i]); next.filterCard=get.filter(arguments[i]);
filter=arguments[i]; filter=arguments[i];
} }
@ -8047,12 +8071,17 @@
if(next.filterCard) next.ai=arguments[i]; if(next.filterCard) next.ai=arguments[i];
else next.filterCard=arguments[i]; else next.filterCard=arguments[i];
} }
else if(typeof arguments[i]=='object'){ else if(typeof arguments[i]=='object'&&arguments[i]){
next.filterCard=get.filter(arguments[i]); next.filterCard=get.filter(arguments[i]);
} }
else if(typeof arguments[i]=='string'){ else if(typeof arguments[i]=='string'){
next.prompt=arguments[i]; next.prompt=arguments[i];
} }
if(arguments[i]===null){
for(var i=0;i<arguments.length;i++){
console.log(arguments[i]);
}
}
} }
if(next.isMine()==false&&next.dialog) next.dialog.style.display='none'; if(next.isMine()==false&&next.dialog) next.dialog.style.display='none';
if(next.filterCard==undefined) next.filterCard=lib.filter.all; if(next.filterCard==undefined) next.filterCard=lib.filter.all;
@ -8167,7 +8196,7 @@
if(next.filterCard) next.ai=arguments[i]; if(next.filterCard) next.ai=arguments[i];
else next.filterCard=arguments[i]; else next.filterCard=arguments[i];
} }
else if(typeof arguments[i]=='object'){ else if(typeof arguments[i]=='object'&&arguments[i]){
next.filterCard=get.filter(arguments[i]); next.filterCard=get.filter(arguments[i]);
} }
else if(typeof arguments[i]=='string'){ else if(typeof arguments[i]=='string'){
@ -8319,7 +8348,7 @@
if(next.ai) next.filterButton=arguments[i]; if(next.ai) next.filterButton=arguments[i];
else next.ai=arguments[i]; else next.ai=arguments[i];
} }
else if(typeof arguments[i]=='object'){ else if(typeof arguments[i]=='object'&&arguments[i]){
next.filterButton=get.filter(arguments[i]); next.filterButton=get.filter(arguments[i]);
} }
else if(typeof arguments[i]=='string'){ else if(typeof arguments[i]=='string'){
@ -8364,7 +8393,7 @@
if(next.ai) next.filterButton=arguments[i]; if(next.ai) next.filterButton=arguments[i];
else next.ai=arguments[i]; else next.ai=arguments[i];
} }
else if(typeof arguments[i]=='object'){ else if(typeof arguments[i]=='object'&&arguments[i]){
next.filterButton=get.filter(arguments[i]); next.filterButton=get.filter(arguments[i]);
} }
else if(typeof arguments[i]=='string'){ else if(typeof arguments[i]=='string'){
@ -8409,7 +8438,7 @@
if(next.ai) next.filterButton=arguments[i]; if(next.ai) next.filterButton=arguments[i];
else next.ai=arguments[i]; else next.ai=arguments[i];
} }
else if(typeof arguments[i]=='object'){ else if(typeof arguments[i]=='object'&&arguments[i]){
next.filterButton=get.filter(arguments[i]); next.filterButton=get.filter(arguments[i]);
} }
else if(typeof arguments[i]=='string'){ else if(typeof arguments[i]=='string'){
@ -9732,10 +9761,10 @@
} }
if(cards){ if(cards){
cards=cards.slice(0); cards=cards.slice(0);
node=cards.shift().copy('thrown'); node=cards.shift().copy('thrown','drawingcard');
} }
else{ else{
node=ui.create.div('.card.thrown'); node=ui.create.div('.card.thrown.drawingcard');
} }
node.fixed=true; node.fixed=true;
node.hide(); node.hide();
@ -9945,9 +9974,11 @@
}, },
$throw:function(card,time,init){ $throw:function(card,time,init){
if(init!==false){ if(init!==false){
game.broadcast(function(player,card,time,init){ if(init!=='nobroadcast'){
player.$throw(card,time,init); game.broadcast(function(player,card,time,init){
},this,card,time,init); player.$throw(card,time,init);
},this,card,time,init);
}
if(get.itemtype(card)!='cards'){ if(get.itemtype(card)!='cards'){
if(get.itemtype(card)=='card'){ if(get.itemtype(card)=='card'){
card=[card]; card=[card];
@ -11152,7 +11183,8 @@
selectCard:this.selectCard, selectCard:this.selectCard,
position:this.position, position:this.position,
forced:this.forced, forced:this.forced,
aiexclude:this.aiexclude aiexclude:this.aiexclude,
complexSelect:this.complexSelect
} }
if(skill){ if(skill){
var info=get.info(skill); var info=get.info(skill);
@ -11166,7 +11198,8 @@
if(info.filterCard!=undefined) this.filterCard=get.filter(info.filterCard); if(info.filterCard!=undefined) this.filterCard=get.filter(info.filterCard);
if(info.selectCard!=undefined) this.selectCard=info.selectCard; if(info.selectCard!=undefined) this.selectCard=info.selectCard;
if(info.position!=undefined) this.position=info.position; if(info.position!=undefined) this.position=info.position;
if(info.forced!=undefined) this.forced=info.forced; if(info.forced!=undefined) this.forced=info.forced;
if(info.complexSelect!=undefined) this.complexSelect=info.complexSelect;
} }
else{ else{
this.filterButton=info.filterButton?get.filter(info.filterButton):undefined; this.filterButton=info.filterButton?get.filter(info.filterButton):undefined;
@ -11176,7 +11209,8 @@
this.filterCard=info.filterCard?get.filter(info.filterCard):undefined; this.filterCard=info.filterCard?get.filter(info.filterCard):undefined;
this.selectCard=info.selectCard; this.selectCard=info.selectCard;
this.position=info.position; this.position=info.position;
this.forced=info.forced; this.forced=info.forced;
this.complexSelect=info.complexSelect;
} }
} }
}, },
@ -11190,7 +11224,8 @@
this.selectCard=this._backup.selectCard; this.selectCard=this._backup.selectCard;
this.position=this._backup.position; this.position=this._backup.position;
this.forced=this._backup.forced; this.forced=this._backup.forced;
this.aiexclude=this._backup.aiexclude; this.aiexclude=this._backup.aiexclude;
this.complexSelect=this._backup.complexSelect;
} }
delete this.skill; delete this.skill;
}, },
@ -11957,6 +11992,35 @@
player.stat.push({card:{},skill:{}}); player.stat.push({card:{},skill:{}});
}, },
}, },
_discard:{
trigger:{global:'discardAfter'},
forced:true,
popup:false,
priority:-100,
filter:function(event){
return ui.todiscard[event.discardid]?true:false;
},
content:function(){
game.broadcastAll(function(id){
var todiscard=ui.todiscard[id];
delete ui.todiscard[id];
if(todiscard){
var time=1000;
if(typeof todiscard._discardtime=='number'){
time+=todiscard._discardtime-get.time();
}
if(time<0){
time=0;
}
setTimeout(function(){
for(var i=0;i<todiscard.length;i++){
todiscard[i].delete();
}
},time);
}
},trigger.discardid);
}
},
_save:{ _save:{
trigger:{source:'dying',player:'dying'}, trigger:{source:'dying',player:'dying'},
priority:5, priority:5,
@ -17692,6 +17756,7 @@
updates:[], updates:[],
thrown:[], thrown:[],
touchlines:[], touchlines:[],
todiscard:{},
refresh:function(node){ refresh:function(node){
void window.getComputedStyle(node, null).getPropertyValue("opacity"); void window.getComputedStyle(node, null).getPropertyValue("opacity");
}, },
@ -22284,7 +22349,7 @@
case 'card': case 'card':
if(typeof item.copy=='function'){ if(typeof item.copy=='function'){
node=item.copy(); node=item.copy(false);
} }
else{ else{
node=item.cloneNode(true); node=item.cloneNode(true);
@ -24112,7 +24177,7 @@
if(this.classList.contains('selectable')==false) return; if(this.classList.contains('selectable')==false) return;
if(this.classList.contains('selected')){ if(this.classList.contains('selected')){
ui.selected.buttons.remove(this); ui.selected.buttons.remove(this);
if(_status.multitarget){ if(_status.multitarget||_status.event.complexSelect){
game.uncheck(); game.uncheck();
game.check(); game.check();
} }
@ -24141,7 +24206,7 @@
var notoggle=false; var notoggle=false;
if(this.classList.contains('selected')){ if(this.classList.contains('selected')){
ui.selected.cards.remove(this); ui.selected.cards.remove(this);
if(_status.multitarget){ if(_status.multitarget||_status.event.complexSelect){
game.uncheck(); game.uncheck();
game.check(); game.check();
notoggle=true; notoggle=true;
@ -24336,7 +24401,7 @@
this.unprompt(); this.unprompt();
if(this.classList.contains('selected')){ if(this.classList.contains('selected')){
ui.selected.targets.remove(this); ui.selected.targets.remove(this);
if(_status.multitarget){ if(_status.multitarget||_status.event.complexSelect){
game.uncheck(); game.uncheck();
game.check(); game.check();
} }

View File

@ -1072,7 +1072,7 @@ margin-bottom: 5px;
} }
.card.thrown{position: absolute;opacity: 1;margin:0;z-index: 3;} .card.thrown{position: absolute;opacity: 1;margin:0;z-index: 3;}
#arena>.card.thrown{pointer-events: none} #arena>.card.thrown{pointer-events: none}
#arena.thrownhighlight>.card.thrown:not(.thrownhighlight){ #arena.thrownhighlight>.card.thrown:not(.thrownhighlight):not(.drawingcard){
opacity: 0.5; opacity: 0.5;
transform:scale(0.95); transform:scale(0.95);
/*-webkit-filter:blur(3px);*/ /*-webkit-filter:blur(3px);*/