a bunch of bugfix

This commit is contained in:
Spmario233 2023-09-01 23:55:52 +08:00
parent e22fd8424a
commit dc9952fd0b
9 changed files with 45 additions and 22 deletions

View File

@ -285,6 +285,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var storage=player.storage.clanjiexuan; var storage=player.storage.clanjiexuan;
return get.color(card)==((storage||0)%2?'black':'red'); return get.color(card)==((storage||0)%2?'black':'red');
}, },
prompt:function(){
if(_status.event.player.storage.clanjiexuan) return '将一张黑色牌当【过河拆桥】使用';
return '将一张红色牌当【顺手牵羊】使用';
},
skillAnimation:true, skillAnimation:true,
animationColor:'thunder', animationColor:'thunder',
precontent:function(){ precontent:function(){
@ -829,15 +833,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
clanSkill:true, clanSkill:true,
filter:function(event,player){ filter:function(event,player){
if(!event.cards.length) return true; if(!event.cards.length) return true;
var cards=[]; return !game.hasPlayer2(current=>{
game.countPlayer(current=>{
if(!current.hasClan('太原王氏')&&current!=player) return false; if(!current.hasClan('太原王氏')&&current!=player) return false;
current.getHistory('lose',evt=>{ return current.hasHistory('lose',evt=>{
if(event!=evt.getParent()) return false; return evt.getParent()==event&&evt.hs.length>0;
cards.addArray(evt.getl(current).hs);
}); });
}); });
return !event.cards.some(card=>cards.contains(card));
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -2273,6 +2274,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.storage.clanguangu) return '转换技,出牌阶段限一次。阴:你可以观看牌堆顶的至多四张牌;<span class="bluetext">阳:你可以观看一名角色的至多四张手牌。</span>然后你可以使用其中的一张牌。'; if(player.storage.clanguangu) return '转换技,出牌阶段限一次。阴:你可以观看牌堆顶的至多四张牌;<span class="bluetext">阳:你可以观看一名角色的至多四张手牌。</span>然后你可以使用其中的一张牌。';
return '转换技,出牌阶段限一次。<span class="bluetext">阴:你可以观看牌堆顶的至多四张牌;</span>阳:你可以观看一名角色的至多四张手牌。然后你可以使用其中的一张牌。'; return '转换技,出牌阶段限一次。<span class="bluetext">阴:你可以观看牌堆顶的至多四张牌;</span>阳:你可以观看一名角色的至多四张手牌。然后你可以使用其中的一张牌。';
}, },
clanjiexuan:function(player){
if(player.storage.clanjiexuan) return '限定技,转换技。阴:你可以将一张红色牌当【顺手牵羊】使用;<span class="bluetext">阳:你可以将一张黑色牌当【过河拆桥】使用。</span>';
return '限定技,转换技。<span class="bluetext">阴:你可以将一张红色牌当【顺手牵羊】使用;</span>阳:你可以将一张黑色牌当【过河拆桥】使用。';
},
}, },
translate:{ translate:{
clan_wuxian:'族吴苋', clan_wuxian:'族吴苋',

View File

@ -5808,6 +5808,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
evt.cards&&evt.cards.length==2&&_status.currentPhase&&_status.currentPhase!=player&&_status.currentPhase.countDiscardableCards(player,'he'); evt.cards&&evt.cards.length==2&&_status.currentPhase&&_status.currentPhase!=player&&_status.currentPhase.countDiscardableCards(player,'he');
}, },
content:function(){ content:function(){
//game.log(trigger.card)
//game.log(trigger.cards)
player.line(_status.currentPhase,'green'); player.line(_status.currentPhase,'green');
player.discardPlayerCard(_status.currentPhase,'he',true); player.discardPlayerCard(_status.currentPhase,'he',true);
} }

View File

@ -6475,10 +6475,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
mod:{ mod:{
targetInRange:function(card,player,target){ targetInRange:function(card,player,target){
for(var i=1;i<=5;i++){ if(!player.hasEnabledSlot()) return true;
if(!player.hasDisabledSlot(i)) return false;
}
return true;
}, },
}, },
marktext:'萍', marktext:'萍',

View File

@ -84,7 +84,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
order:5, order:5,
result:{ result:{
target:function(player,target){ player:function(player,target){
var eff=Math.sign(get.effect(target,{name:'juedou'},player,player)); var eff=Math.sign(get.effect(target,{name:'juedou'},player,player));
if(player.hasSkillTag('directHit_ai',true,{ if(player.hasSkillTag('directHit_ai',true,{
target:target, target:target,
@ -92,10 +92,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},true)||ui.selected.targets.concat(target).reduce((p,c)=>{ },true)||ui.selected.targets.concat(target).reduce((p,c)=>{
return p+c.countCards('h'); return p+c.countCards('h');
},0)<player.countCards('h','sha')){ },0)<player.countCards('h','sha')){
return -eff; return 0;
}
return eff;
} }
return -114514;
},
target:-1.5,
} }
}, },
subSkill:{ subSkill:{
@ -1253,7 +1254,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.asked=true; event.asked=true;
player.chooseButton([ player.chooseButton([
'###'+get.prompt('jsrgjixiang',trigger.player)+'###<div class="text center">'+str+'</div>', '###'+get.prompt('jsrgjixiang',trigger.player)+'###<div class="text center">'+str+'</div>',
[listx,'vcard'] [listx,'vcard'],
]).set('ai',()=>Math.random()+1); ]).set('ai',()=>Math.random()+1);
} }
'step 1' 'step 1'
@ -1261,6 +1262,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var name=result.links[0][2],nature=result.links[0][3]; var name=result.links[0][2],nature=result.links[0][3];
var card={name:name,nature:nature,isCard:true}; var card={name:name,nature:nature,isCard:true};
event.card=card; event.card=card;
var evt=trigger.getParent();
var reason=(trigger.name=='chooseToUse'?'使用':'打出'); var reason=(trigger.name=='chooseToUse'?'使用':'打出');
var prompt=event.asked? var prompt=event.asked?
'济乡:是否弃置一张牌'+(trigger.filterTarget?'并选择目标角色':'')+'': '济乡:是否弃置一张牌'+(trigger.filterTarget?'并选择目标角色':'')+'':
@ -2827,7 +2829,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
locked:false, locked:false,
getNum:function(target,player){ getNum:function(target,player){
return target.countCards(card=>{ return target.countCards('e',card=>{
var subtype=get.subtypes(card); var subtype=get.subtypes(card);
for(var i of subtype){ for(var i of subtype){
if(player.hasDisabledSlot(i)) return true; if(player.hasDisabledSlot(i)) return true;
@ -2903,6 +2905,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}); });
} }
else{
event.finish();
return;
}
'step 2' 'step 2'
if(result.bool){event.finish();return;} if(result.bool){event.finish();return;}
var targets=game.filterPlayer(current=>{ var targets=game.filterPlayer(current=>{

View File

@ -11514,7 +11514,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.target=result.targets[0]; event.target=result.targets[0];
var list=[]; var list=[];
if(player.hasEnabledSlot(3)) list.push('equip3'); if(player.hasEnabledSlot(3)) list.push('equip3');
if(!player.hasEnabledSlot(4)) list.push('equip4'); if(player.hasEnabledSlot(4)) list.push('equip4');
if(list.length==1) event._result={control:list[0]}; if(list.length==1) event._result={control:list[0]};
else player.chooseControl(list).set('prompt','选择废除一个坐骑栏'); else player.chooseControl(list).set('prompt','选择废除一个坐骑栏');
} }

View File

@ -22194,7 +22194,7 @@
} }
if(result.card||!result.skill){ if(result.card||!result.skill){
result.used=result.card||result.cards[0]; result.used=result.card||result.cards[0];
var next=this.useCard(result.card,result.cards,result.targets,result.skill); var next=this.useCard(result.used,result.cards,result.targets,result.skill);
next.oncard=event.oncard; next.oncard=event.oncard;
next.respondTo=event.respondTo; next.respondTo=event.respondTo;
if(event.addCount===false){ if(event.addCount===false){
@ -30240,7 +30240,10 @@
var isRound=false; var isRound=false;
if(!trigger.skill){ if(!trigger.skill){
isRound=_status.roundSkipped; isRound=_status.roundSkipped;
if(_status.seatNumSettled){ if(_status.isRoundFilter){
isRound=_status.isRoundFilter(trigger,player);
}
else if(_status.seatNumSettled){
var seatNum=player.getSeatNum(); var seatNum=player.getSeatNum();
if(seatNum!=0){ if(seatNum!=0){
if(typeof _status.lastSeatNum!='number'||seatNum<_status.lastSeatNum) isRound=true; if(typeof _status.lastSeatNum!='number'||seatNum<_status.lastSeatNum) isRound=true;

View File

@ -511,7 +511,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
gz_xunyou:['male','wei',3,['gzqice','zhiyu'],['gzskin']], gz_xunyou:['male','wei',3,['gzqice','zhiyu'],['gzskin']],
gz_lingtong:['male','wu',4,['xuanlve','yongjin'],['gzskin']], gz_lingtong:['male','wu',4,['xuanlve','yongjin'],['gzskin']],
gz_lvfan:['male','wu',3,['xindiaodu','gzdiancai']], gz_lvfan:['male','wu',3,['xindiaodu','gzdiancai']],
gz_masu:['male','shu',3,['sanyao','gzzhiman'],['gzskin']], gz_masu:['male','shu',3,['gzsanyao','gzzhiman'],['gzskin']],
gz_shamoke:['male','shu',4,['gzjili'],['gzskin']], gz_shamoke:['male','shu',4,['gzjili'],['gzskin']],
gz_lingcao:['male','wu',4,['dujin']], gz_lingcao:['male','wu',4,['dujin']],
@ -9421,11 +9421,15 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}); });
return list.length<=1; return list.length<=1;
}, },
check:function(event,player){
return player.needsToDiscard();
},
content:function(){ content:function(){
player.addTempSkill('keji_add','phaseAfter'); player.addTempSkill('keji_add','phaseAfter');
}, },
}, },
"keji_add":{ "keji_add":{
charlotte:true,
mod:{ mod:{
maxHandcard:function(player,num){ maxHandcard:function(player,num){
return num+4; return num+4;

View File

@ -3589,6 +3589,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}); });
}, },
phaseLoopThree:function(player){ phaseLoopThree:function(player){
_status.isRoundFilter=function(event){
return event._isThreeRound===true;
};
var next=game.createEvent('phaseLoop'); var next=game.createEvent('phaseLoop');
next.player=player; next.player=player;
next.swap=function(player){ next.swap=function(player){
@ -3601,8 +3604,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}; };
next.setContent(function(){ next.setContent(function(){
'step 0' 'step 0'
var next=player.phase();
if(!game.players.some(current=>current.classList.contains('acted'))){
next._isThreeRound=true;
}
player.classList.add('acted'); player.classList.add('acted');
player.phase();
'step 1' 'step 1'
if(player.identity!='zhu'){ if(player.identity!='zhu'){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){