diff --git a/character/collab.js b/character/collab.js index d159b30ea..88d027277 100644 --- a/character/collab.js +++ b/character/collab.js @@ -1479,6 +1479,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(stat==0) return Math.random()<0.7; return false; } + return false; }, prompt:function(event,player){ return '焚心:是否与'+get.translation(event.player)+'交换身份?'; diff --git a/character/extra.js b/character/extra.js index 0755537de..b1dffbbcf 100755 --- a/character/extra.js +++ b/character/extra.js @@ -114,8 +114,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 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'); + nei:game.countPlayer(current=>{ + let num=0; + if(current.identity=='nei') num++; + num+=current.countMark('jxlianpo_mark_nei'); + return num; + }), + commoner:game.countPlayer(current=>{ + let num=0; + if(current.identity=='commoner') num++; + num+=current.countMark('jxlianpo_mark_commoner'); + return num; }), }; let population=0,identities=[]; @@ -139,9 +148,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ intro:{ content:()=>`场上最大阵营为${lib.skill.jxlianpo.getMax().map(i=>{ if(i=='zhu') return '主忠'; - if(i=='fan') return '反贼'; - if(i=='nei') return '内奸'; - return ''; + return get.translation(i+'2'); }).join('、')}`, }, $createButton:function(item,type,position,noclick,node){ diff --git a/game/game.js b/game/game.js index ac6ff1ff2..6bddd9375 100644 --- a/game/game.js +++ b/game/game.js @@ -4982,6 +4982,8 @@ map.connect_limit_zhu.hide(); map.connect_enhance_zhu.hide(); map.connect_double_nei.hide(); + map.connect_enable_commoner.hide(); + map.connect_enable_year_limit.show(); map.connect_zhong_card.show(); map.connect_special_identity.hide(); map.connect_double_character.show(); @@ -4992,6 +4994,8 @@ map.connect_limit_zhu.hide(); map.connect_enhance_zhu.hide(); map.connect_double_nei.hide(); + map.connect_enable_commoner.hide(); + map.connect_enable_year_limit.show(); map.connect_zhong_card.hide(); map.connect_special_identity.hide(); } @@ -5000,6 +5004,8 @@ map.connect_limit_zhu.hide(); map.connect_enhance_zhu.hide(); map.connect_double_nei.hide(); + map.connect_enable_commoner.hide(); + map.connect_enable_year_limit.hide(); map.connect_zhong_card.hide(); map.connect_special_identity.hide(); map.connect_double_character.hide(); @@ -5009,12 +5015,9 @@ map.connect_player_number.show(); map.connect_limit_zhu.show(); map.connect_enhance_zhu.show(); - if(config.connect_player_number!='2'){ - map.connect_double_nei.show(); - } - else{ - map.connect_double_nei.hide(); - } + map.connect_double_nei[config.connect_player_number!='2'&&!config.connect_enable_commoner?'show':'hide'](); + map.connect_enable_commoner[config.connect_player_number!='2'&&!config.connect_double_nei?'show':'hide'](); + map.connect_enable_year_limit.show(); map.connect_zhong_card.hide(); if(config.connect_player_number=='8'){ @@ -5074,6 +5077,15 @@ return lib.mode.identity.config.double_nei.intro; } }, + connect_enable_commoner:{ + name:'启用平民', + init:false, + restart:true, + frequent:false, + get intro(){ + return lib.mode.identity.config.enable_commoner.intro; + } + }, connect_double_character:{ name:'双将模式', init:false, @@ -5093,6 +5105,15 @@ frequent:true, intro:'开启后游戏中将增加军师、大将、贼首三个身份' }, + connect_enable_year_limit:{ + name:'启用年机制', + init:false, + restart:true, + frequent:false, + get intro(){ + return lib.mode.identity.config.enable_year_limit.intro; + } + }, connect_round_one_use_fury:{ name:'开启首轮强化卡牌', init:false, @@ -5137,6 +5158,9 @@ map.choice_zhong.hide(); map.choice_nei.hide(); map.choice_fan.hide(); + map.enable_commoner.hide(); + map.choice_commoner.hide(); + map.enable_year_limit.show(); map.ban_identity.hide(); map.ban_identity2.hide(); map.ban_identity3.hide(); @@ -5172,6 +5196,9 @@ map.choice_zhong.show(); map.choice_nei.show(); map.choice_fan.show(); + map.enable_commoner.hide(); + map.choice_commoner.hide(); + map.enable_year_limit.show(); map.ban_identity.show(); if(config.ban_identity=='off'){ map.ban_identity2.hide(); @@ -5210,6 +5237,9 @@ map.choice_zhong.hide(); map.choice_nei.hide(); map.choice_fan.hide(); + map.enable_commoner.hide(); + map.choice_commoner.hide(); + map.enable_year_limit.hide(); map.ban_identity.hide(); map.ban_identity2.hide(); map.ban_identity3.hide(); @@ -5229,17 +5259,15 @@ map.player_number.show(); map.enhance_zhu.show(); map.auto_identity.show(); - if(config.player_number!='2'){ - map.double_nei.show(); - } - else{ - map.double_nei.hide(); - } + map.double_nei[config.player_number!='2'&&!config.enable_commoner?'show':'hide'](); map.choice_zhu.show(); map.limit_zhu.show(); map.choice_zhong.show(); map.choice_nei.show(); map.choice_fan.show(); + map.enable_commoner[config.player_number!='2'&&!config.double_nei?'show':'hide'](); + map.choice_commoner[config.enable_commoner?'show':'hide'](); + map.enable_year_limit.show(); map.ban_identity.show(); if(config.ban_identity=='off'){ map.ban_identity2.hide(); @@ -5305,7 +5333,7 @@ init:false, restart:true, frequent:true, - intro:'若游戏人数不大于8,则开启后游戏中将有两个内奸(内奸胜利条件仍为主内1v1时击杀主公)' + intro:'若游戏人数不大于9,则开启后游戏中将有两个内奸(内奸胜利条件仍为主内1v1时击杀主公)' }, choose_group:{ name:'神武将选择势力', @@ -5632,6 +5660,33 @@ '10':'十', }, }, + enable_commoner:{ + name:'启用平民', + init:false, + restart:true, + frequent:false, + intro:'开启后游戏中将有一个平民(身份)加入游戏。
具体规则请查看帮助。', + }, + choice_commoner:{ + name:'平民候选武将数', + init:'4', + restart:true, + item:{ + '3':'三', + '4':'四', + '5':'五', + '6':'六', + '8':'八', + '10':'十', + }, + }, + enable_year_limit:{ + name:'启用年机制', + init:false, + restart:true, + frequent:false, + intro:'开启后将会加入年机制。
年机制的具体规则请查看帮助。', + }, } }, guozhan:{ @@ -27914,6 +27969,11 @@ if(func&&!func(target)) return false; return target.identity!='fan'; });break; + case 'commoner':targets=game.filterPlayer(function(target){ + if(func&&!func(target)) return false; + if(num>=3) return target.identity!='fan'; + return target.identity=='fan'; + }); break; } } } @@ -27984,6 +28044,10 @@ if(func&&!func(target)) return false; return target.identity=='fan'; });break; + case 'commoner':targets=game.filterPlayer(function(target){ + if(func&&!func(target)) return false; + return true; + }); break; } } } @@ -59291,7 +59355,8 @@ case 'purple':return '三对三对二'; case 'zhong':return (config.double_character?'双将':'')+'忠胆英杰'; case 'stratagem':return get.cnNumber(parseInt(config.number))+'人'+(config.double_character?'双将':'')+'谋攻'; - default:return get.cnNumber(parseInt(config.number))+'人'+(config.double_character?'双将':'')+'身份'; + debugger + default:return `${get.cnNumber(parseInt(config.number))}人${config.double_nei?'双内':''}${config.enable_commoner?'带民':''}${config.double_character?'双将':''}身份`; } } else if(config.mode=='guozhan'){ diff --git a/image/card/identity_commoner.jpg b/image/card/identity_commoner.jpg new file mode 100644 index 000000000..649a2b01d Binary files /dev/null and b/image/card/identity_commoner.jpg differ diff --git a/layout/default/layout.css b/layout/default/layout.css index 65b5ea108..e6419ae6b 100644 --- a/layout/default/layout.css +++ b/layout/default/layout.css @@ -4071,6 +4071,12 @@ span[data-nature='woodmm'] { text-shadow: rgba(57, 123, 4,1) 0 0 2px,rgba(57, 123, 4,1) 0 0 2px,rgba(57, 123, 4,1) 0 0 2px, rgba(57, 123, 4,1) 0 0 2px,black 0 0 1px; } +.player .identity[data-color="commoner"], +div[data-nature='commoner'], +span[data-nature='commoner'] { + text-shadow: rgb(135, 135, 135, 1) 0 0 2px,rgba(135, 135, 135, 1) 0 0 5px,rgba(135, 135, 135, 1) 0 0 10px, + rgba(135, 135, 135, 1) 0 0 10px,rgba(135, 135, 135, 1) 0 0 20px,rgba(135, 135, 135, 1) 0 0 20px,black 0 0 1px; +} .player .identity[data-color="cai"], .player .identity[data-color="bZhu"], diff --git a/mode/identity.js b/mode/identity.js index 4368169fb..57f201e54 100644 --- a/mode/identity.js +++ b/mode/identity.js @@ -186,6 +186,23 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }); } "step 4" + var yearLimitCheck=()=>{ + var next=game.createEvent('year_limit_pop',false); + next.setContent(function(){ + 'step 0' + var str=get.cnNumber(game.shuffleNumber+1,true); + game.me.$fullscreenpop(`第${str}年`,'thunder'); + game.log('游戏进入了',`#y第${str}年`); + if(game.shuffleNumber+1i=='nei').length>=2) toReplace='nei'; + else if(list.filter(i=>i=='zhong').length>list.filter(i=>i=='fan').length/2) toReplace='zhong'; + else toReplace='fan'; + list.remove(toReplace); + list.push(identity); + } + game.broadcast(identityList=>lib.config.mode_config.identity.identity=identityList,lib.config.mode_config.identity.identity); + } + } if(lib.configOL.number<2){ lib.configOL.number=2; } + if(_status.mode!='purple'&&lib.configOL.enable_year_limit){ + lib.onwash.push(yearLimitCheck); + } game.randomMapOL(); } else{ + if(_status.mode=='normal'&&(get.config('enable_commoner')||get.config('double_nei'))){ + var identity=get.config('enable_commoner')?'commoner':'nei'; + for(var i=1;ii=='nei').length>=2) toReplace='nei'; + else if(list.filter(i=>i=='zhong').length>list.filter(i=>i=='fan').length/2) toReplace='zhong'; + else toReplace='fan'; + list.remove(toReplace); + list.push(identity); + } + } + if(_status.mode!='purple'&&get.config('enable_year_limit')){ + lib.onwash.push(yearLimitCheck); + } for(var i=0;i首轮强化:'+(lib.configOL.round_one_use_fury?'开启':'关闭')); } - else{ + else if(lib.configOL.identity_mode!='purple'){ uiintro.add('
双内奸:'+(lib.configOL.double_nei?'开启':'关闭')); - uiintro.add('
加强主公:'+(lib.configOL.enhance_zhu?'开启':'关闭')); + if(lib.configOL.identity_mode!='stratagem'){ + uiintro.add('
加强主公:'+(lib.configOL.enhance_zhu?'开启':'关闭')); + uiintro.add('
平民身份:'+(lib.configOL.enable_commoner?'开启':'关闭')); + } + uiintro.add('
年机制:'+(lib.configOL.enable_year_limit?'开启':'关闭')); } } else{ @@ -505,6 +559,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ fan:'反', zhong:'忠', nei:'内', + commoner:'民', cai:'猜', } } @@ -515,6 +570,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ case 'fan':list[i]='反贼';break; case 'zhong':list[i]='忠臣';break; case 'nei':list[i]='内奸';break; + case 'commoner':list[i]='平民'; break; case 'zhu':list[i]='主公';break; case 'enemy':list[i]='敌方';break; case 'friend':list[i]='友方';break; @@ -563,7 +619,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ else{ data[identity][1]++; } - var list=['zhu','zhong','nei','fan']; + var list=['zhu','zhong','nei','fan','commoner']; var str=''; for(var i=0;ii.identity=='commoner').length)&&me.isAlive()){ game.over(true); } else{ game.over(false); } } - else{ + else if(me.identity=='fan'){ if((get.population('fan')+get.population('zhong')>0||get.population('nei')>1)&& game.zhu.classList.contains('dead')){ game.over(true); @@ -714,6 +772,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ game.over(false); } } + else if(me.identity=='commoner'){ + game.over(true); + } }, checkOnlineResult:function(player){ if(_status.winner&&_status.loser){ @@ -722,13 +783,13 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(_status.winner.contains(player)) return true; } if(game.zhu.isAlive()){ - return (player.identity=='zhu'||player.identity=='zhong'||player.identity=='mingzhong'); + return (player.identity=='zhu'||player.identity=='zhong'||player.identity=='mingzhong'||player.identity=='commoner'&&player.isAlive()); } - else if(game.players.length==1&&game.players[0].identity=='nei'){ + else if(game.players.length==(1+game.players.filter(i=>i.identity=='commoner').length)&&game.players[0].identity=='nei'||game.players[0].identity=='commoner'){ return player.isAlive(); } else{ - return player.identity=='fan'; + return player.identity=='fan'||player.identity=='commoner'&&player.isAlive(); } }, chooseCharacterPurpleOL:function(){ @@ -1436,34 +1497,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ else{ if(_status.mode=='stratagem') event.stratagemMode=true; identityList=get.identityList(game.players.length); - if(get.config('double_nei')){ - switch(get.playerNumber()){ - case 8: - identityList.remove('fan'); - identityList.push('nei'); - break; - case 7: - identityList.remove('zhong'); - identityList.push('nei'); - break; - case 6: - identityList.remove('fan'); - identityList.push('nei'); - break; - case 5: - identityList.remove('fan'); - identityList.push('nei'); - break; - case 4: - identityList.remove('zhong'); - identityList.push('nei'); - break; - case 3: - identityList.remove('fan'); - identityList.push('nei'); - break; - } - } } var stratagemMode=event.stratagemMode; @@ -1480,6 +1513,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } else{ listi=['random','zhu','zhong','fan','nei']; + if(get.config('enable_commoner')) listi.push('commoner'); } for(var i=0;i主公 vs 内奸',null,null,false); @@ -2834,7 +2845,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ else if(targets.length==1) this.ai.shown+=0.2*c; else this.ai.shown+=0.1*c; } - else if(effect<0&&this==game.me&&['nei','rYe','bYe'].contains(game.me.identity)){ + else if(effect<0&&this==game.me&&['nei','commoner','rYe','bYe'].contains(game.me.identity)){ if(targets.length==1&&targets[0]==this); else if(targets.length==1) this.ai.shown-=0.2; else this.ai.shown-=0.1; @@ -2866,7 +2877,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(targets.length==1&&targets[0]==this){ effect=0; } - else if(this.identity!='nei'){ + else if(this.identity!='nei'&&this.identity!='commoner'){ if(this.ai.shown>0){ if(this.identity=='fan'){ effect=-1; @@ -2886,7 +2897,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ effect+=get.effect(targets[i],card,this,zhu)*c; } } - if(this.identity=='nei'){ + if(this.identity=='nei'||this.identity=='commoner'){ if(effect>0){ if(this.ai.identity_mark=='fan'){ if(marknow) this.setIdentity(); @@ -3248,7 +3259,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } } var aishown=to.ai.shown; - if(to.identity=='nei'&&to.ai.shown<1&&(to.ai.identity_mark=='fan'||to.ai.identity_mark=='zhong')){ + if((to.identity=='nei'||to.identity=='commoner')&&to.ai.shown<1&&(to.ai.identity_mark=='fan'||to.ai.identity_mark=='zhong')){ aishown=0.5; } else if(aishown==0&&to.identity!='fan'&&to.identity!='zhu'){ @@ -3457,7 +3468,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } //正常身份模式态度 if(!game.zhu){ - if(from.identity=='nei'||to.identity=='nei') return -1; + if(from.identity=='nei'||to.identity=='nei'||from.identity=='commoner'||to.identity=='commoner') return -1; if(from.identity==to.identity) return 6; return -6; } @@ -3471,13 +3482,18 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(from!=to&&to.identity=='nei'&&to.ai.shown<1&&(to.ai.identity_mark=='fan'||to.ai.identity_mark=='zhong')){ identity2=to.ai.identity_mark; } - if(from.identity!='nei'&&from!=to&&get.population('fan')==0&&identity2=='zhong'){ + if(from.identity!='nei'&&from.identity!='commoner'&&from!=to&&get.population('fan')==0&&identity2=='zhong'){ for(var i=0;i1&&to.hp>fan.hp&&to.countCards('he')>fan.countCards('he')){ + return -3; + } + } + return 3; + } + if(situation<0&&game.zhu&&game.zhu.hp<=2) return -3.8; + return 2-get.population('fan'); } break; case 'zhong':case 'mingzhong': @@ -3540,11 +3579,13 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(zhongmode&&to.ai.sizhong&&to.ai.shown<1) return 6; return Math.min(3,-situation); case 'fan': return -8; + case 'commoner': + return Math.min(3,Math.max(-3,situation)); } break; case 'nei': if(identity2=='zhu'&&game.players.length==2) return -10; - if(from!=to&&identity2!='zhu'&&game.players.length==3) return -8; + if(from!=to&&identity2!='zhu'&&identity2!='commoner'&&game.players.length==3) return -8; var strategy=get.aiStrategy(); if(strategy==4){ if(from==to) return 10; @@ -3622,6 +3663,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(strategy==2) num++; if(strategy==3) num--; return num; + case 'commoner': + if(game.players.length<=4) return 5; + return Math.min(Math.max(-situation,-2),2); } break; case 'fan': @@ -3645,6 +3689,32 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(game.zhu&&game.zhu.hp<=2) return -1; return Math.min(3,situation); case 'fan': return 5; + case 'commoner': + return 2*get.population('fan')-2; + } + case 'commoner': + switch(identity2){ + case 'zhu': + if(situation>0) return 2*Math.min(4,(to.hp+to.countCards('h')/4-2)); + if(situation>=-3&&game.zhu) return (to.hp-2)+to.countCards('h')/4; //return Math.min(-0.1,5-game.zhu.hp); + return to.hp+to.countCards('h')/3-4; + case 'zhong': + if(situation>0){ + if(to.hp>=2) return Math.min(3,Math.max(1,to.hp+to.countCards('h')/4-4)); + else return 0; + } + return -2; + case 'nei': + if(game.players.length==3&&get.population('nei')==1) return Math.min(3.5,(to.hp-1.5)+to.countCards('h')/3)-(to.hp<(game.zhu?game.zhu.hp:0)?4:0); + if(game.players.length<=4&&get.population('nei')==1) return Math.min(5,(to.hp-1.5)+to.countCards('h')/3); + if(situation>0) return -3; + return 0; + case 'fan': + if(situation<0) return to.hp+to.countCards('h')/4-1.7*get.population('fan')+2; + else if(situation==0) return 0; + return 0.55*get.population('fan')-2.1; + case 'commoner': + return from==to?10:(to.hp<=2?-2:0); } } }, @@ -4090,7 +4160,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } }, help:{ - '身份模式':'
选项
  • 加强主公
    反贼人数多于2时主公会额外增加一个技能(每个主公的额外技能固定,非常备主公增加天命)
  • 特殊身份
    • 军师:忠臣身份。只要军师存活,主公在准备阶段开始时,可以观看牌堆顶的三张牌,然后将这些牌以任意顺序置于牌堆顶或牌堆底
    • 大将:忠臣身份。只要大将存活,主公手牌上限+1
    • 贼首:反贼身份,只要贼首存活,主公手牌上限-1
', + '身份模式':'
选项
  • 加强主公
    反贼人数多于2时主公会额外增加一个技能(每个主公的额外技能固定,非常备主公增加天命)'+ + '
  • 特殊身份
    • 军师:忠臣身份。只要军师存活,主公在准备阶段开始时,可以观看牌堆顶的三张牌,然后将这些牌以任意顺序置于牌堆顶或牌堆底
    • 大将:忠臣身份。只要大将存活,主公手牌上限+1
    • 贼首:反贼身份,只要贼首存活,主公手牌上限-1
'+ + '
  • 平民身份
    英盗版三国杀于2017标准版中提出的新概念。平民的获胜条件为:当其他身份的角色达成了其获胜条件,且你存活,你也获胜;同时内奸的获胜条件改为:主公死亡时,场上所有忠臣和反贼均已死亡。即内奸可以和与平民共同胜利。杀死平民的角色的奖惩为:摸两张牌。'+ + '
  • 年机制
    英盗版三国杀于2019标准版中提出的新概念。“年”是一个全局概念,游戏开始时为第一年,当牌堆洗牌时,年数+1。一局游戏的限定年数为本局游戏开始时玩家总数。当年数增加后,若当前年数已超过限定年数,则主忠方直接获胜,若平民存活则平民也获胜。', '明忠模式':'
    明忠模式(忠胆英杰)
    • 本模式需要8名玩家进行游戏,使用的身份牌为:1主公、2忠臣、4反贼和1内奸。游戏开始时,每名玩家随机获得一个身份,由系统随机选择一名忠臣身份的玩家亮出身份(将忠臣牌正面朝上放在面前),其他身份(包括主公)的玩家不亮出身份。
    • '+ '首先由亮出身份的忠臣玩家随机获得六张武将牌,挑选一名角色,并将选好的武将牌展示给其他玩家。之后其余每名玩家随机获得三张武将牌,各自从其中挑选一张同时亮出
    • '+ '亮出身份牌的忠臣增加1点体力上限。角色濒死和死亡的结算及胜利条件与普通身份局相同。',