From 55f1dbf273c8594101be0838755d84ca5211b64c Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Tue, 17 Oct 2023 23:09:16 +0800 Subject: [PATCH] bugfix++ --- card/standard.js | 2 +- character/extra.js | 44 +++++++++++++++++++++++++++++++++----------- game/game.js | 2 +- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/card/standard.js b/card/standard.js index 4038fdd2d..cf6f1e2a2 100644 --- a/card/standard.js +++ b/card/standard.js @@ -479,7 +479,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ if (get.attitude(current, target) > 0) return current.countCards('hs', 'tao'); }), dis = 1, - t = _status.currentPhase; + t = _status.currentPhase||game.me; while (t !== target) { let att = get.attitude(player, t); if (Math.abs(att) < 2) dis += 0.45; diff --git a/character/extra.js b/character/extra.js index 64a783ba6..b04bc6aa9 100755 --- a/character/extra.js +++ b/character/extra.js @@ -100,19 +100,33 @@ game.import('character',function(lib,game,ui,get,ai,_status){ logTarget:'source', global:'jxlianpo_global', getMax:()=>{ - var identities=[],population=0; - game.countPlayer(current=>{ - var curPopulation=1+current.getFriends().length+game.countPlayer(currentx=>{ - return currentx.countMark(`jxlianpo_mark_${current.identity}`); - }); + const map={ + zhu:game.countPlayer(current=>{ + const identity=current.identity; + let num=0; + if(identity=='zhu'||identity=='zhong'||identity=='mingzhong') num++; + num+=current.countMark('jxlianpo_mark_zhong'); + return num; + }), + fan:game.countPlayer(current=>{ + let num=0; + if(current.identity=='fan') num++; + num+=current.countMark('jxlianpo_mark_fan'); + return num; + }), + nei:(game.hasPlayer(current=>current.identity=='nei')?0:1)+game.countPlayer(current=>{ + return current.countMark('jxlianpo_mark_nei'); + }), + }; + let population=0,identities=[]; + for(let i in map){ + let curPopulation=map[i] if(curPopulation>=population){ if(curPopulation>population) identities=[]; - var identity=current.identity; - if(identity=='zhong') identity='zhu'; - identities.add(identity); + identities.add(i); population=curPopulation; } - }); + }; return identities; }, group:'jxlianpo_show', @@ -141,14 +155,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{global:'roundStart'}, filter:function(event,player){ var list=lib.config.mode_config.identity.identity.lastItem.slice(); - list.removeArray(game.filterPlayer().map(i=>i.identity)); + list.removeArray(game.filterPlayer().map(i=>{ + let identity=i.identity; + if(identity=='mingzhong') identity='zhong'; + return identity; + })); return list.length; }, forced:true, content:function(){ 'step 0' var list=lib.config.mode_config.identity.identity.lastItem.slice(); - list.removeArray(game.filterPlayer().map(i=>i.identity)).unique(); + list.removeArray(game.filterPlayer().map(i=>{ + let identity=i.identity; + if(identity=='mingzhong') identity='zhong'; + return identity; + })).unique(); player.chooseButton([ '###炼魄:请选择一个身份###
你选择的身份对应的阵营角色数于本轮内视为+1
', [list,function(item,type,position,noclick,node){ diff --git a/game/game.js b/game/game.js index da7848a16..359d589e5 100644 --- a/game/game.js +++ b/game/game.js @@ -42565,7 +42565,7 @@ identityCard:function(identity,position,info,noclick){ const card=ui.create.card(position,info,noclick); card._customintro=function(uiintro){ - uiintro.add(`${get.translation(item+2)}的身份牌`); + uiintro.add(`${get.translation(identity+2)}的身份牌`); } const fileName=`image/card/identity_${identity}.jpg`; new Promise((resolve,reject)=>{