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

View File

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

View File

@ -84,7 +84,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{
order:5,
result:{
target:function(player,target){
player:function(player,target){
var eff=Math.sign(get.effect(target,{name:'juedou'},player,player));
if(player.hasSkillTag('directHit_ai',true,{
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)=>{
return p+c.countCards('h');
},0)<player.countCards('h','sha')){
return -eff;
return 0;
}
return eff;
}
return -114514;
},
target:-1.5,
}
},
subSkill:{
@ -1253,7 +1254,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.asked=true;
player.chooseButton([
'###'+get.prompt('jsrgjixiang',trigger.player)+'###<div class="text center">'+str+'</div>',
[listx,'vcard']
[listx,'vcard'],
]).set('ai',()=>Math.random()+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 card={name:name,nature:nature,isCard:true};
event.card=card;
var evt=trigger.getParent();
var reason=(trigger.name=='chooseToUse'?'使用':'打出');
var prompt=event.asked?
'济乡:是否弃置一张牌'+(trigger.filterTarget?'并选择目标角色':'')+'':
@ -2827,7 +2829,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true,
locked:false,
getNum:function(target,player){
return target.countCards(card=>{
return target.countCards('e',card=>{
var subtype=get.subtypes(card);
for(var i of subtype){
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'
if(result.bool){event.finish();return;}
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];
var list=[];
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]};
else player.chooseControl(list).set('prompt','选择废除一个坐骑栏');
}

View File

@ -4013,7 +4013,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger._triggered=5;
var evt=player.insertPhase();
delete evt.skill;
}
}
}
},
subSkill:{

View File

@ -22194,7 +22194,7 @@
}
if(result.card||!result.skill){
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.respondTo=event.respondTo;
if(event.addCount===false){
@ -30240,7 +30240,10 @@
var isRound=false;
if(!trigger.skill){
isRound=_status.roundSkipped;
if(_status.seatNumSettled){
if(_status.isRoundFilter){
isRound=_status.isRoundFilter(trigger,player);
}
else if(_status.seatNumSettled){
var seatNum=player.getSeatNum();
if(seatNum!=0){
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_lingtong:['male','wu',4,['xuanlve','yongjin'],['gzskin']],
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_lingcao:['male','wu',4,['dujin']],
@ -9421,11 +9421,15 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
});
return list.length<=1;
},
check:function(event,player){
return player.needsToDiscard();
},
content:function(){
player.addTempSkill('keji_add','phaseAfter');
},
},
"keji_add":{
charlotte:true,
mod:{
maxHandcard:function(player,num){
return num+4;

View File

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