简化结党冲突人士写法,减少map定义次数

This commit is contained in:
mengxinzxz 2023-11-14 18:25:35 +08:00
parent ca20d31c81
commit b2f7613de6
1 changed files with 6 additions and 8 deletions

View File

@ -1607,18 +1607,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var others=list.randomGets(4);
if(others.length==1) event._result={bool:true,links:others};
else{
var conflictList,map={
var map={
'scs_bilan':'scs_hankui',
'scs_hankui':'scs_bilan',
'scs_duangui':'scs_guosheng',
'scs_guosheng':'scs_duangui',
},list=others.slice();
if(map[first]&&others.some(changshi=>map[first]==changshi)) conflictList=[others.find(changshi=>map[first]==changshi)];
else conflictList=others.filter(changshi=>{
var map=lib.skill.mbdanggu.conflictMap(player);
var names=map[first];
return names.contains(changshi);
});
},map2=lib.skill.mbdanggu.conflictMap(player);
var conflictList=others.filter(changshi=>{
if(map[first]&&others.some(changshi2=>map[first]==changshi2)) return map[first]==changshi;
else return map2[first].includes(changshi);
}),list=others.slice();
if(conflictList.length){
var conflict=conflictList.randomGet();
list.remove(conflict);