autophase

This commit is contained in:
libccy 2017-03-29 12:07:01 +08:00
parent dfbd65b274
commit 73d6637c05
8 changed files with 42 additions and 23 deletions

View File

@ -763,9 +763,6 @@ character.gujian={
},
fumo:{
trigger:{player:'damageAfter'},
check:function(event,player){
return event.source&&ai.get.attitude(player,event.source)<0;
},
filter:function(event,player){
return event.source&&event.source.isAlive()&&player.countCards('h',{color:'red'})>1||player.countCards('h',{color:'black'})>1;
},
@ -773,6 +770,7 @@ character.gujian={
content:function(){
"step 0"
var next=player.chooseToDiscard(get.prompt('fumo',trigger.source),2,function(card){
if(ai.get.damageEffect(trigger.source,player,player,'thunder')<=0) return 0;
if(ui.selected.cards.length){
return get.color(card)==get.color(ui.selected.cards[0]);
}

View File

@ -855,14 +855,14 @@ character.refresh={
content:function(){
"step 0"
if(get.itemtype(trigger.cards)=='cards'&&get.position(trigger.cards[0])=='d'){
player.chooseControl('rejianxiong_mopai','rejianxiong_napai','cancel2').ai=function(){
player.chooseControl('rejianxiong_mopai','rejianxiong_napai','cancel2').set('prompt',get.prompt('rejianxiong')).ai=function(){
var trigger=_status.event.getTrigger();
if(trigger.cards.length==1&&trigger.cards[0].name=='sha') return 0;
return 1;
};
}
else{
player.chooseControl('rejianxiong_mopai','cancel2');
player.chooseControl('rejianxiong_mopai','cancel2').set('prompt',get.prompt('rejianxiong'));
}
"step 1"
if(result.control=='rejianxiong_napai'){

View File

@ -85,9 +85,6 @@ character.shenhua={
filter:function(event){
return event.target.countCards('he')>0;
},
check:function(event,player){
return ai.get.attitude(player,event.target)<=0;
},
direct:true,
content:function(){
'step 0'
@ -97,7 +94,7 @@ character.shenhua={
return 1;
}).set('logSkill',['jianchu',trigger.target]).set('att',ai.get.attitude(player,trigger.target)<=0);
'step 1'
if(result.links.length){
if(result.bool&&result.links&&result.links.length){
if(get.type(result.links[0])=='equip'){
trigger.directHit=true;
}

View File

@ -709,10 +709,6 @@ character.xianjian={
return player.countCards('h','shan')>0;
},
direct:true,
check:function(event,player){
if(ai.get.damageEffect(player,event.player,player)>=0) return false;
return true;
},
usable:1,
content:function(){
"step 0"
@ -1905,9 +1901,6 @@ character.xianjian={
},
poyun:{
trigger:{source:'damageEnd'},
check:function(event,player){
return ai.get.attitude(player,event.player)<0&&event.player.countCards('he')>1;
},
alter:true,
filter:function(event,player){
return player.storage.xuanning>0&&event.player.countCards('he')>0;

View File

@ -1553,9 +1553,6 @@ character.yxs={
filter:function(event,player){
return event.player.hp<=0&&(player.countCards('h','jiu')>0||player.countCards('h',{color:'black'})>=2)&&player!=event.player;
},
check:function(event,player){
return ai.get.attitude(player,event.player)<0;
},
direct:true,
content:function(){
'step 0'

View File

@ -4362,6 +4362,12 @@
// frequent:true,
restart:true,
},
four_phaseswap:{
name:'代替队友回合内行动',
init:false,
// frequent:true,
restart:true,
},
free_choose:{
name:'自由选将',
init:true,
@ -8394,7 +8400,7 @@
else if(checkFrequent(info)&&!lib.config.autoskilllist.contains(event.skill)){
event._result={bool:true};
}
else if(info.direct&&player==game.me&&!_status.auto){
else if(info.direct){
event._result={bool:true};
}
else if(info.direct&&player.isOnline()){
@ -18451,6 +18457,26 @@
game.modeSwapPlayer(player);
},
},
autophase:{
trigger:{player:['phaseBegin','chooseToUseBegin','chooseToRespondBegin','chooseToDiscardBegin','chooseToCompareBegin',
'chooseButtonBegin','chooseCardBegin','chooseTargetBegin','chooseCardTargetBegin','chooseControlBegin',
'chooseBoolBegin','choosePlayerCardBegin','discardPlayerCardBegin','gainPlayerCardBegin']},
forced:true,
priority:100,
popup:false,
filter:function(event,player){
if(_status.currentPhase!=player) return false;
if(player==game.me) return false;
if(event.autochoose&&event.autochoose()) return false;
if(lib.filter.wuxieSwap(event)) return false;
if(_status.auto) return false;
if(!player.isFriendOf(game.me)) return false;
return true;
},
content:function(){
game.swapPlayer(player);
},
},
fengyin:{
init:function(player,skill){
var skills=player.getSkills(true,false);

View File

@ -12,8 +12,8 @@ window.noname_update={
// 'game/asset.js',
// 'card/*',
// 'card/sp.js',
// 'character/*',
// 'character/shenhua.js',
'character/*',
// 'character/refresh.js',
// 'mode/boss.js',
'mode/versus.js',
'mode/guozhan.js',

View File

@ -1001,8 +1001,16 @@ mode.versus={
}
event.list.randomSort();
event.list2=list2;
event.current=_status.firstAct.next;
event.four_assign=get.config('four_assign');
if(get.config('four_phaseswap')){
game.addGlobalSkill('autophase');
}
if(!event.four_assign){
event.current=_status.firstAct;
}
else{
event.current=_status.firstAct.next;
}
event.flipassign=true;
if(_status.firstAct.side){
for(var i=0;i<game.players.length;i++){