简化结党冲突人士写法,减少map定义次数
This commit is contained in:
parent
ca20d31c81
commit
b2f7613de6
|
@ -1607,18 +1607,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
var others=list.randomGets(4);
|
var others=list.randomGets(4);
|
||||||
if(others.length==1) event._result={bool:true,links:others};
|
if(others.length==1) event._result={bool:true,links:others};
|
||||||
else{
|
else{
|
||||||
var conflictList,map={
|
var map={
|
||||||
'scs_bilan':'scs_hankui',
|
'scs_bilan':'scs_hankui',
|
||||||
'scs_hankui':'scs_bilan',
|
'scs_hankui':'scs_bilan',
|
||||||
'scs_duangui':'scs_guosheng',
|
'scs_duangui':'scs_guosheng',
|
||||||
'scs_guosheng':'scs_duangui',
|
'scs_guosheng':'scs_duangui',
|
||||||
},list=others.slice();
|
},map2=lib.skill.mbdanggu.conflictMap(player);
|
||||||
if(map[first]&&others.some(changshi=>map[first]==changshi)) conflictList=[others.find(changshi=>map[first]==changshi)];
|
var conflictList=others.filter(changshi=>{
|
||||||
else conflictList=others.filter(changshi=>{
|
if(map[first]&&others.some(changshi2=>map[first]==changshi2)) return map[first]==changshi;
|
||||||
var map=lib.skill.mbdanggu.conflictMap(player);
|
else return map2[first].includes(changshi);
|
||||||
var names=map[first];
|
}),list=others.slice();
|
||||||
return names.contains(changshi);
|
|
||||||
});
|
|
||||||
if(conflictList.length){
|
if(conflictList.length){
|
||||||
var conflict=conflictList.randomGet();
|
var conflict=conflictList.randomGet();
|
||||||
list.remove(conflict);
|
list.remove(conflict);
|
||||||
|
|
Loading…
Reference in New Issue