张春华、钟会、王元姬、左慈、严颜bugfix

This commit is contained in:
mengxinzxz 2024-04-05 16:25:33 +08:00
parent bae09a45c5
commit 494910a8d4
1 changed files with 49 additions and 59 deletions

View File

@ -1195,9 +1195,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
],[1,2]).set('ai',button=>{ ],[1,2]).set('ai',button=>{
const getNum=(character)=>{ const getNum=(character)=>{
return game.countPlayer(target=>{ return game.countPlayer(target=>{
var group=get.character(target,1); const group=get.character(character,1);
if(group=='ye'||target.identity==group) return true; if(group=='ye'||target.identity==group) return true;
var double=get.is.double(i,true); const double=get.is.double(character,true);
if(double&&double.includes(target.identity)) return true; if(double&&double.includes(target.identity)) return true;
})+1; })+1;
}; };
@ -1302,19 +1302,17 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
enable:'phaseUse', enable:'phaseUse',
filterTarget:true, filterTarget:true,
usable:1, usable:1,
content(){ async content(event,trigger,player){
'step 0' const target=event.target;
player.chooseJunlingFor(target); const {result:{junling,targets}}=await player.chooseJunlingFor(target);
'step 1' if(junling){
event.junling=result.junling;
event.targets=result.targets;
const str=get.translation(player),num=get.cnNumber(player.getExpansions('fakequanji').length); const str=get.translation(player),num=get.cnNumber(player.getExpansions('fakequanji').length);
target.chooseJunlingControl(player,result.junling,result.targets).set('prompt','排异').set('choiceList',[ const {result:{index}}=await target.chooseJunlingControl(player,junling,targets).set('prompt','排异').set('choiceList',[
'执行此军令,然后'+str+'摸'+num+'张牌并将一张“权”置入弃牌堆', '执行此军令,然后'+str+'摸'+num+'张牌并将一张“权”置入弃牌堆',
'不执行此军令,然后'+str+'可以对至多'+num+'名与你势力相同的角色各造成1点伤害并移去等量的“权”', '不执行此军令,然后'+str+'可以对至多'+num+'名与你势力相同的角色各造成1点伤害并移去等量的“权”',
]).set('ai',()=>{ ]).set('ai',()=>{
const all=player.getExpansions('fakequanji').length; const all=player.getExpansions('fakequanji').length;
const effect=get.junlingEffect(player,result.junling,target,result.targets,target); const effect=get.junlingEffect(player,junling,target,targets,target);
const eff1=(effect-get.effect(player,{name:'draw'},player,target)*all); const eff1=(effect-get.effect(player,{name:'draw'},player,target)*all);
const eff2=((source,player,num)=>{ const eff2=((source,player,num)=>{
let targets=game.filterPlayer(current=>{ let targets=game.filterPlayer(current=>{
@ -1328,39 +1326,29 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
})(player,target,all); })(player,target,all);
return Math.max(0,get.sgn(eff1-eff2)); return Math.max(0,get.sgn(eff1-eff2));
}); });
'step 2'
const cards=player.getExpansions('fakequanji'); const cards=player.getExpansions('fakequanji');
if(result.index==0){ if(index==0){
target.carryOutJunling(player,event.junling,targets); await target.carryOutJunling(player,junling,targets);
player.draw(cards.length); if(cards.length){
player.chooseButton(['排异:请移去一张“权”',cards],true); await player.draw(cards.length);
const {result:{bool,links}}=await player.chooseButton(['排异:请移去一张“权”',cards],true);
if(bool) await player.loseToDiscardpile(links);
} }
else{ }
player.chooseTarget('排异:是否对至多'+get.cnNumber(cards.length)+'名与'+get.translation(target)+'势力相同的角色各造成1点伤害并移去等量的“权”',(card,player,target)=>{ else if(cards.length){
const {result}=await player.chooseTarget('排异:是否对至多'+get.cnNumber(cards.length)+'名与'+get.translation(target)+'势力相同的角色各造成1点伤害并移去等量的“权”',(card,player,target)=>{
return target.isFriendOf(get.event('target')); return target.isFriendOf(get.event('target'));
},[1,cards.length]).set('target',target).set('ai',target=>{ },[1,cards.length]).set('target',target).set('ai',target=>{
return get.damageEffect(target,get.event('player'),get.event('player')); return get.damageEffect(target,get.event('player'),get.event('player'));
}); });
}
'step 3'
if(result.bool){ if(result.bool){
if(result.links){ const targetx=result.targets.sortBySeat();
player.loseToDiscardpile(result.links); player.line(targetx);
event.finish(); for(const i of targetx) await i.damage();
} const {result:{bool,links}}=await player.chooseButton(['排异:请移去'+get.cnNumber(targetx.length)+'张“权”',cards],targetx.length,true);
else{ if(bool) await player.loseToDiscardpile(links);
const cards=player.getExpansions('fakequanji');
const targets=result.targets.sortBySeat();
player.line(targets);
for(const i of targets) i.damage();
if(cards.length<=targets.length) event._result={bool:true,links:cards};
else player.chooseButton(['排异:请移去'+get.cnNumber(targets.length)+'张“权”',cards],targets.length,true);
} }
} }
else event.finish();
'step 4'
if(result.bool){
player.loseToDiscardpile(result.links);
} }
}, },
ai:{ ai:{
@ -2372,6 +2360,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
target:'useCardToTargeted', target:'useCardToTargeted',
}, },
filter(event,player){ filter(event,player){
if(event.card.name!='sha') return false;
const storage=player.storage.fakejuzhan; const storage=player.storage.fakejuzhan;
if((event.player==player)!=Boolean(storage)) return false; if((event.player==player)!=Boolean(storage)) return false;
if(storage&&!event.target.countCards('he')) return false; if(storage&&!event.target.countCards('he')) return false;
@ -3052,7 +3041,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
.set('filterTarget',function(card,player,target){ .set('filterTarget',function(card,player,target){
if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false; if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false;
return lib.filter.targetEnabled.apply(this,arguments); return lib.filter.targetEnabled.apply(this,arguments);
}).set('sourcex',target).set('addCount',false) }).set('sourcex',target).set('addCount',false).set('hiddenSkill','fakeqingleng')
.backup('fakeqingleng_backup').set('logSkill',['fakeqingleng',target]); .backup('fakeqingleng_backup').set('logSkill',['fakeqingleng',target]);
if(bool&&!player.getHistory('sourceDamage',evt=>{ if(bool&&!player.getHistory('sourceDamage',evt=>{
return evt.getParent(4)==event; return evt.getParent(4)==event;
@ -3431,6 +3420,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
filterTarget(card,player,target){ filterTarget(card,player,target){
return target!=player&&target.countCards('h'); return target!=player&&target.countCards('h');
}, },
usable:1,
async content(event,trigger,player){ async content(event,trigger,player){
const target=event.target,str=get.translation(target); const target=event.target,str=get.translation(target);
const {result:{bool,links}}=await player.choosePlayerCard(target,'宴戏:展示'+str+'的一张手牌','h',true); const {result:{bool,links}}=await player.choosePlayerCard(target,'宴戏:展示'+str+'的一张手牌','h',true);