Merge pull request #611 from copcap/dev-commoner

平民身份与年机制
This commit is contained in:
Spmario233 2023-11-03 23:26:26 +08:00 committed by GitHub
commit b243e548fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 246 additions and 94 deletions

View File

@ -1479,6 +1479,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(stat==0) return Math.random()<0.7; if(stat==0) return Math.random()<0.7;
return false; return false;
} }
return false;
}, },
prompt:function(event,player){ prompt:function(event,player){
return '焚心:是否与'+get.translation(event.player)+'交换身份?'; return '焚心:是否与'+get.translation(event.player)+'交换身份?';

View File

@ -114,8 +114,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
num+=current.countMark('jxlianpo_mark_fan'); num+=current.countMark('jxlianpo_mark_fan');
return num; return num;
}), }),
nei:(game.hasPlayer(current=>current.identity=='nei')?0:1)+game.countPlayer(current=>{ nei:game.countPlayer(current=>{
return current.countMark('jxlianpo_mark_nei'); 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=[]; let population=0,identities=[];
@ -139,9 +148,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
intro:{ intro:{
content:()=>`场上最大阵营为${lib.skill.jxlianpo.getMax().map(i=>{ content:()=>`场上最大阵营为${lib.skill.jxlianpo.getMax().map(i=>{
if(i=='zhu') return '主忠'; if(i=='zhu') return '主忠';
if(i=='fan') return '反贼'; return get.translation(i+'2');
if(i=='nei') return '内奸';
return '';
}).join('、')}`, }).join('、')}`,
}, },
$createButton:function(item,type,position,noclick,node){ $createButton:function(item,type,position,noclick,node){

View File

@ -4982,6 +4982,8 @@
map.connect_limit_zhu.hide(); map.connect_limit_zhu.hide();
map.connect_enhance_zhu.hide(); map.connect_enhance_zhu.hide();
map.connect_double_nei.hide(); map.connect_double_nei.hide();
map.connect_enable_commoner.hide();
map.connect_enable_year_limit.show();
map.connect_zhong_card.show(); map.connect_zhong_card.show();
map.connect_special_identity.hide(); map.connect_special_identity.hide();
map.connect_double_character.show(); map.connect_double_character.show();
@ -4992,6 +4994,8 @@
map.connect_limit_zhu.hide(); map.connect_limit_zhu.hide();
map.connect_enhance_zhu.hide(); map.connect_enhance_zhu.hide();
map.connect_double_nei.hide(); map.connect_double_nei.hide();
map.connect_enable_commoner.hide();
map.connect_enable_year_limit.show();
map.connect_zhong_card.hide(); map.connect_zhong_card.hide();
map.connect_special_identity.hide(); map.connect_special_identity.hide();
} }
@ -5000,6 +5004,8 @@
map.connect_limit_zhu.hide(); map.connect_limit_zhu.hide();
map.connect_enhance_zhu.hide(); map.connect_enhance_zhu.hide();
map.connect_double_nei.hide(); map.connect_double_nei.hide();
map.connect_enable_commoner.hide();
map.connect_enable_year_limit.hide();
map.connect_zhong_card.hide(); map.connect_zhong_card.hide();
map.connect_special_identity.hide(); map.connect_special_identity.hide();
map.connect_double_character.hide(); map.connect_double_character.hide();
@ -5009,12 +5015,9 @@
map.connect_player_number.show(); map.connect_player_number.show();
map.connect_limit_zhu.show(); map.connect_limit_zhu.show();
map.connect_enhance_zhu.show(); map.connect_enhance_zhu.show();
if(config.connect_player_number!='2'){ map.connect_double_nei[config.connect_player_number!='2'&&!config.connect_enable_commoner?'show':'hide']();
map.connect_double_nei.show(); map.connect_enable_commoner[config.connect_player_number!='2'&&!config.connect_double_nei?'show':'hide']();
} map.connect_enable_year_limit.show();
else{
map.connect_double_nei.hide();
}
map.connect_zhong_card.hide(); map.connect_zhong_card.hide();
if(config.connect_player_number=='8'){ if(config.connect_player_number=='8'){
@ -5074,6 +5077,15 @@
return lib.mode.identity.config.double_nei.intro; 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:{ connect_double_character:{
name:'双将模式', name:'双将模式',
init:false, init:false,
@ -5093,6 +5105,15 @@
frequent:true, frequent:true,
intro:'开启后游戏中将增加军师、大将、贼首三个身份' 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:{ connect_round_one_use_fury:{
name:'开启首轮强化卡牌', name:'开启首轮强化卡牌',
init:false, init:false,
@ -5137,6 +5158,9 @@
map.choice_zhong.hide(); map.choice_zhong.hide();
map.choice_nei.hide(); map.choice_nei.hide();
map.choice_fan.hide(); map.choice_fan.hide();
map.enable_commoner.hide();
map.choice_commoner.hide();
map.enable_year_limit.show();
map.ban_identity.hide(); map.ban_identity.hide();
map.ban_identity2.hide(); map.ban_identity2.hide();
map.ban_identity3.hide(); map.ban_identity3.hide();
@ -5172,6 +5196,9 @@
map.choice_zhong.show(); map.choice_zhong.show();
map.choice_nei.show(); map.choice_nei.show();
map.choice_fan.show(); map.choice_fan.show();
map.enable_commoner.hide();
map.choice_commoner.hide();
map.enable_year_limit.show();
map.ban_identity.show(); map.ban_identity.show();
if(config.ban_identity=='off'){ if(config.ban_identity=='off'){
map.ban_identity2.hide(); map.ban_identity2.hide();
@ -5210,6 +5237,9 @@
map.choice_zhong.hide(); map.choice_zhong.hide();
map.choice_nei.hide(); map.choice_nei.hide();
map.choice_fan.hide(); map.choice_fan.hide();
map.enable_commoner.hide();
map.choice_commoner.hide();
map.enable_year_limit.hide();
map.ban_identity.hide(); map.ban_identity.hide();
map.ban_identity2.hide(); map.ban_identity2.hide();
map.ban_identity3.hide(); map.ban_identity3.hide();
@ -5229,17 +5259,15 @@
map.player_number.show(); map.player_number.show();
map.enhance_zhu.show(); map.enhance_zhu.show();
map.auto_identity.show(); map.auto_identity.show();
if(config.player_number!='2'){ map.double_nei[config.player_number!='2'&&!config.enable_commoner?'show':'hide']();
map.double_nei.show();
}
else{
map.double_nei.hide();
}
map.choice_zhu.show(); map.choice_zhu.show();
map.limit_zhu.show(); map.limit_zhu.show();
map.choice_zhong.show(); map.choice_zhong.show();
map.choice_nei.show(); map.choice_nei.show();
map.choice_fan.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(); map.ban_identity.show();
if(config.ban_identity=='off'){ if(config.ban_identity=='off'){
map.ban_identity2.hide(); map.ban_identity2.hide();
@ -5305,7 +5333,7 @@
init:false, init:false,
restart:true, restart:true,
frequent:true, frequent:true,
intro:'若游戏人数不大于8则开启后游戏中将有两个内奸内奸胜利条件仍为主内1v1时击杀主公' intro:'若游戏人数不大于9则开启后游戏中将有两个内奸内奸胜利条件仍为主内1v1时击杀主公'
}, },
choose_group:{ choose_group:{
name:'神武将选择势力', name:'神武将选择势力',
@ -5632,6 +5660,33 @@
'10':'十', '10':'十',
}, },
}, },
enable_commoner:{
name:'启用平民',
init:false,
restart:true,
frequent:false,
intro:'开启后游戏中将有一个平民(身份)加入游戏。<br>具体规则请查看帮助。',
},
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:'开启后将会加入年机制。<br>年机制的具体规则请查看帮助。',
},
} }
}, },
guozhan:{ guozhan:{
@ -27914,6 +27969,11 @@
if(func&&!func(target)) return false; if(func&&!func(target)) return false;
return target.identity!='fan'; return target.identity!='fan';
});break; });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; if(func&&!func(target)) return false;
return target.identity=='fan'; return target.identity=='fan';
});break; });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 'purple':return '三对三对二';
case 'zhong':return (config.double_character?'双将':'')+'忠胆英杰'; case 'zhong':return (config.double_character?'双将':'')+'忠胆英杰';
case 'stratagem':return get.cnNumber(parseInt(config.number))+'人'+(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'){ else if(config.mode=='guozhan'){

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

View File

@ -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, 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; 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="cai"],
.player .identity[data-color="bZhu"], .player .identity[data-color="bZhu"],

View File

@ -186,6 +186,23 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}); });
} }
"step 4" "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+1<game.countPlayer2()) event.finish();
else game.delay(2);
'step 1'
game.me.$fullscreenpop('年份已到','metal');
game.log('年份已到,主忠方判定为胜利');
game.delay(2);
'step 2'
game.over(game.me.identity=='zhu'||game.me.identity=='zhong'||game.me.identity=='mingzhong'||(game.me.identity=='commoner'&&game.me.isIn()));
});
};
if(_status.connectMode){ if(_status.connectMode){
_status.mode=lib.configOL.identity_mode; _status.mode=lib.configOL.identity_mode;
if(_status.mode=='zhong'){ if(_status.mode=='zhong'){
@ -197,12 +214,45 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
else if(_status.mode=='purple'){ else if(_status.mode=='purple'){
lib.configOL.number=8; lib.configOL.number=8;
} }
else if(_status.mode=='normal'){
if(lib.configOL.enable_commoner||lib.configOL.double_nei){
var identity=lib.configOL.enable_commoner?'commoner':'nei';
for(var i=1;i<lib.config.mode_config.identity.identity.length;i++){
var list=lib.config.mode_config.identity.identity[i];
var toReplace;
if(list.filter(i=>i=='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){ if(lib.configOL.number<2){
lib.configOL.number=2; lib.configOL.number=2;
} }
if(_status.mode!='purple'&&lib.configOL.enable_year_limit){
lib.onwash.push(yearLimitCheck);
}
game.randomMapOL(); game.randomMapOL();
} }
else{ 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;i<lib.config.mode_config.identity.identity.length;i++){
var list=lib.config.mode_config.identity.identity[i];
var toReplace;
if(list.filter(i=>i=='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<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
game.players[i].getId(); game.players[i].getId();
} }
@ -420,9 +470,13 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
if(lib.configOL.identity_mode=='stratagem'){ if(lib.configOL.identity_mode=='stratagem'){
uiintro.add('<div class="text chat">首轮强化:'+(lib.configOL.round_one_use_fury?'开启':'关闭')); uiintro.add('<div class="text chat">首轮强化:'+(lib.configOL.round_one_use_fury?'开启':'关闭'));
} }
else{ else if(lib.configOL.identity_mode!='purple'){
uiintro.add('<div class="text chat">双内奸:'+(lib.configOL.double_nei?'开启':'关闭')); uiintro.add('<div class="text chat">双内奸:'+(lib.configOL.double_nei?'开启':'关闭'));
uiintro.add('<div class="text chat">加强主公:'+(lib.configOL.enhance_zhu?'开启':'关闭')); if(lib.configOL.identity_mode!='stratagem'){
uiintro.add('<div class="text chat">加强主公:'+(lib.configOL.enhance_zhu?'开启':'关闭'));
uiintro.add('<div class="text chat">平民身份:'+(lib.configOL.enable_commoner?'开启':'关闭'));
}
uiintro.add('<div class="text chat">年机制:'+(lib.configOL.enable_year_limit?'开启':'关闭'));
} }
} }
else{ else{
@ -505,6 +559,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
fan:'反', fan:'反',
zhong:'忠', zhong:'忠',
nei:'内', nei:'内',
commoner:'民',
cai:'猜', cai:'猜',
} }
} }
@ -515,6 +570,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
case 'fan':list[i]='反贼';break; case 'fan':list[i]='反贼';break;
case 'zhong':list[i]='忠臣';break; case 'zhong':list[i]='忠臣';break;
case 'nei':list[i]='内奸';break; case 'nei':list[i]='内奸';break;
case 'commoner':list[i]='平民'; break;
case 'zhu':list[i]='主公';break; case 'zhu':list[i]='主公';break;
case 'enemy':list[i]='敌方';break; case 'enemy':list[i]='敌方';break;
case 'friend':list[i]='友方';break; case 'friend':list[i]='友方';break;
@ -563,7 +619,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
else{ else{
data[identity][1]++; data[identity][1]++;
} }
var list=['zhu','zhong','nei','fan']; var list=['zhu','zhong','nei','fan','commoner'];
var str=''; var str='';
for(var i=0;i<list.length;i++){ for(var i=0;i<list.length;i++){
if(data[list[i]]){ if(data[list[i]]){
@ -672,6 +728,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
switch(me.identity){ switch(me.identity){
case 'fan':game.over(false);break; case 'fan':game.over(false);break;
case 'zhong':game.over(true);break; case 'zhong':game.over(true);break;
case 'commoner':game.over(true); break;
default:game.over();break; default:game.over();break;
} }
} }
@ -679,6 +736,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
switch(me.identity){ switch(me.identity){
case 'fan':game.over(true);break; case 'fan':game.over(true);break;
case 'zhong':game.over(false);break; case 'zhong':game.over(false);break;
case 'commoner':game.over(true); break;
default:game.over();break; default:game.over();break;
} }
} }
@ -698,14 +756,14 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
} }
else if(me.identity=='nei'){ else if(me.identity=='nei'){
if(game.players.length==1&&me.isAlive()){ if(game.players.length==(1+game.players.filter(i=>i.identity=='commoner').length)&&me.isAlive()){
game.over(true); game.over(true);
} }
else{ else{
game.over(false); game.over(false);
} }
} }
else{ else if(me.identity=='fan'){
if((get.population('fan')+get.population('zhong')>0||get.population('nei')>1)&& if((get.population('fan')+get.population('zhong')>0||get.population('nei')>1)&&
game.zhu.classList.contains('dead')){ game.zhu.classList.contains('dead')){
game.over(true); game.over(true);
@ -714,6 +772,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
game.over(false); game.over(false);
} }
} }
else if(me.identity=='commoner'){
game.over(true);
}
}, },
checkOnlineResult:function(player){ checkOnlineResult:function(player){
if(_status.winner&&_status.loser){ 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(_status.winner.contains(player)) return true;
} }
if(game.zhu.isAlive()){ 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(); return player.isAlive();
} }
else{ else{
return player.identity=='fan'; return player.identity=='fan'||player.identity=='commoner'&&player.isAlive();
} }
}, },
chooseCharacterPurpleOL:function(){ chooseCharacterPurpleOL:function(){
@ -1436,34 +1497,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
else{ else{
if(_status.mode=='stratagem') event.stratagemMode=true; if(_status.mode=='stratagem') event.stratagemMode=true;
identityList=get.identityList(game.players.length); 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; var stratagemMode=event.stratagemMode;
@ -1480,6 +1513,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
else{ else{
listi=['random','zhu','zhong','fan','nei']; listi=['random','zhu','zhong','fan','nei'];
if(get.config('enable_commoner')) listi.push('commoner');
} }
for(var i=0;i<listi.length;i++){ for(var i=0;i<listi.length;i++){
@ -1519,7 +1553,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
link=['zhu','zhong','nei','fan','mingzhong'].randomGet(); link=['zhu','zhong','nei','fan','mingzhong'].randomGet();
} }
else{ else{
link=['zhu','zhong','nei','fan'].randomGet(); var listi=['zhu','zhong','nei','fan'];
if(get.config('enable_commoner')) listi.push('commoner');
link=listi.randomGet();
} }
for(var i=0;i<this.parentNode.childElementCount;i++){ for(var i=0;i<this.parentNode.childElementCount;i++){
if(this.parentNode.childNodes[i].link==link){ if(this.parentNode.childNodes[i].link==link){
@ -2123,34 +2159,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
else{ else{
identityList=get.identityList(game.players.length); identityList=get.identityList(game.players.length);
if(lib.configOL.double_nei){
switch(lib.configOL.number){
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;
}
}
} }
identityList.randomSort(); identityList.randomSort();
for(i=0;i<game.players.length;i++){ for(i=0;i<game.players.length;i++){
@ -2544,6 +2552,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
mingzhong:"忠", mingzhong:"忠",
nei:"内", nei:"内",
fan:"反", fan:"反",
commoner:'民',
cai:"猜", cai:"猜",
cai2:"猜", cai2:"猜",
rZhu:"主", rZhu:"主",
@ -2567,6 +2576,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
mingzhong2:"明忠", mingzhong2:"明忠",
nei2:"内奸", nei2:"内奸",
fan2:"反贼", fan2:"反贼",
commoner2:'平民',
random2:"随机", random2:"随机",
enemy:'敌', enemy:'敌',
friend:'友', friend:'友',
@ -2682,6 +2692,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
} }
if(this.identity=='fan'&&source) source.draw(3); if(this.identity=='fan'&&source) source.draw(3);
else if(this.identity=='commoner'&&source) source.draw(2);
else if(this.identity=='mingzhong'&&source){ else if(this.identity=='mingzhong'&&source){
if(source.identity=='zhu'){ if(source.identity=='zhu'){
source.discard(source.getCards('he')); source.discard(source.getCards('he'));
@ -2729,8 +2740,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
return; return;
}; };
if(game.zhu&&game.zhu.isZhu){ if(game.zhu&&game.zhu.isZhu){
if(get.population('zhong')+get.population('nei')==0|| if((get.population('zhong')+get.population('nei')==0||
get.population('zhong')+get.population('fan')==0){ get.population('zhong')+get.population('fan')==0)&&get.population('commoner')==0){
game.broadcastAll(function(){ game.broadcastAll(function(){
if(game.showIdentity) game.showIdentity(); if(game.showIdentity) game.showIdentity();
if(game.zhu&&game.zhu.isAlive()&&get.population('nei')==1&&get.config('nei_fullscreenpop')) game.me.$fullscreenpop('<span style="font-family:xinwei"><span data-nature="fire">主公</span><span data-nature="soil"> vs </span><span data-nature="thunder">内奸</span></span>',null,null,false); if(game.zhu&&game.zhu.isAlive()&&get.population('nei')==1&&get.config('nei_fullscreenpop')) game.me.$fullscreenpop('<span style="font-family:xinwei"><span data-nature="fire">主公</span><span data-nature="soil"> vs </span><span data-nature="thunder">内奸</span></span>',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 if(targets.length==1) this.ai.shown+=0.2*c;
else this.ai.shown+=0.1*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); if(targets.length==1&&targets[0]==this);
else if(targets.length==1) this.ai.shown-=0.2; else if(targets.length==1) this.ai.shown-=0.2;
else this.ai.shown-=0.1; 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){ if(targets.length==1&&targets[0]==this){
effect=0; effect=0;
} }
else if(this.identity!='nei'){ else if(this.identity!='nei'&&this.identity!='commoner'){
if(this.ai.shown>0){ if(this.ai.shown>0){
if(this.identity=='fan'){ if(this.identity=='fan'){
effect=-1; 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; effect+=get.effect(targets[i],card,this,zhu)*c;
} }
} }
if(this.identity=='nei'){ if(this.identity=='nei'||this.identity=='commoner'){
if(effect>0){ if(effect>0){
if(this.ai.identity_mark=='fan'){ if(this.ai.identity_mark=='fan'){
if(marknow) this.setIdentity(); if(marknow) this.setIdentity();
@ -3248,7 +3259,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
} }
var aishown=to.ai.shown; 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; aishown=0.5;
} }
else if(aishown==0&&to.identity!='fan'&&to.identity!='zhu'){ 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(!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; if(from.identity==to.identity) return 6;
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')){ 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; 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;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].identity=='nei'&& if(game.players[i].identity=='nei'&&
game.players[i].ai.identity_mark=='zhong'&& game.players[i].ai.identity_mark=='zhong'&&
game.players[i].ai.shown<1){ game.players[i].ai.shown<1){
identity2='nei';break; identity2='nei';break;
} }
else if(game.players[i].identity=='commoner'&&
game.players[i].ai.identity_mark=='zhong'&&
game.players[i].ai.shown<1){
identity2='commoner'; break;
}
} }
} }
var zhongmode=false; var zhongmode=false;
@ -3529,6 +3545,29 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
return -3; return -3;
} }
return -4; return -4;
case 'commoner':
if(to.identity=='zhong') return 0;
if(get.population('fan')==0){
if(to.ai.identity_mark=='zhong'&&to.ai.shown<1) return 0;
return -0.5;
}
if(zhongmode&&to.ai.sizhong&&to.ai.shown<1) return 6;
if(game.players.length==3){
var fan;
for(var i=0; i<game.players.length; i++){
if(game.players[i].identity=='fan'){
fan=game.players[i]; break;
}
}
if(fan){
if(to.hp>1&&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; break;
case 'zhong':case 'mingzhong': 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; if(zhongmode&&to.ai.sizhong&&to.ai.shown<1) return 6;
return Math.min(3,-situation); return Math.min(3,-situation);
case 'fan': return -8; case 'fan': return -8;
case 'commoner':
return Math.min(3,Math.max(-3,situation));
} }
break; break;
case 'nei': case 'nei':
if(identity2=='zhu'&&game.players.length==2) return -10; 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(); var strategy=get.aiStrategy();
if(strategy==4){ if(strategy==4){
if(from==to) return 10; 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==2) num++;
if(strategy==3) num--; if(strategy==3) num--;
return num; return num;
case 'commoner':
if(game.players.length<=4) return 5;
return Math.min(Math.max(-situation,-2),2);
} }
break; break;
case 'fan': 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; if(game.zhu&&game.zhu.hp<=2) return -1;
return Math.min(3,situation); return Math.min(3,situation);
case 'fan': return 5; 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:{ help:{
'身份模式':'<div style="margin:10px">选项</div><ul style="margin-top:0"><li>加强主公<br>反贼人数多于2时主公会额外增加一个技能每个主公的额外技能固定非常备主公增加天命<li>特殊身份<br><ul style="padding-left:20px;padding-top:5px"><li>军师:忠臣身份。只要军师存活,主公在准备阶段开始时,可以观看牌堆顶的三张牌,然后将这些牌以任意顺序置于牌堆顶或牌堆底<li>大将:忠臣身份。只要大将存活,主公手牌上限+1<li>贼首:反贼身份,只要贼首存活,主公手牌上限-1</ul></ul>', '身份模式':'<div style="margin:10px">选项</div><ul style="margin-top:0"><li>加强主公<br>反贼人数多于2时主公会额外增加一个技能每个主公的额外技能固定非常备主公增加天命'+
'<li>特殊身份<br><ul style="padding-left:20px;padding-top:5px"><li>军师:忠臣身份。只要军师存活,主公在准备阶段开始时,可以观看牌堆顶的三张牌,然后将这些牌以任意顺序置于牌堆顶或牌堆底<li>大将:忠臣身份。只要大将存活,主公手牌上限+1<li>贼首:反贼身份,只要贼首存活,主公手牌上限-1</ul></ul>'+
'<li>平民身份<br>英盗版三国杀于2017标准版中提出的新概念。平民的获胜条件为当其他身份的角色达成了其获胜条件且你存活你也获胜同时内奸的获胜条件改为主公死亡时场上所有忠臣和反贼均已死亡。即内奸可以和与平民共同胜利。杀死平民的角色的奖惩为摸两张牌。'+
'<li>年机制<br>英盗版三国杀于2019标准版中提出的新概念。“年”是一个全局概念游戏开始时为第一年当牌堆洗牌时年数+1。一局游戏的限定年数为本局游戏开始时玩家总数。当年数增加后若当前年数已超过限定年数则主忠方直接获胜若平民存活则平民也获胜。',
'明忠模式':'<div style="margin:10px">明忠模式(忠胆英杰)</div><ul style="margin-top:0"><li>本模式需要8名玩家进行游戏使用的身份牌为1主公、2忠臣、4反贼和1内奸。游戏开始时每名玩家随机获得一个身份由系统随机选择一名忠臣身份的玩家亮出身份将忠臣牌正面朝上放在面前其他身份包括主公的玩家不亮出身份。<li>'+ '明忠模式':'<div style="margin:10px">明忠模式(忠胆英杰)</div><ul style="margin-top:0"><li>本模式需要8名玩家进行游戏使用的身份牌为1主公、2忠臣、4反贼和1内奸。游戏开始时每名玩家随机获得一个身份由系统随机选择一名忠臣身份的玩家亮出身份将忠臣牌正面朝上放在面前其他身份包括主公的玩家不亮出身份。<li>'+
'首先由亮出身份的忠臣玩家随机获得六张武将牌,挑选一名角色,并将选好的武将牌展示给其他玩家。之后其余每名玩家随机获得三张武将牌,各自从其中挑选一张同时亮出<li>'+ '首先由亮出身份的忠臣玩家随机获得六张武将牌,挑选一名角色,并将选好的武将牌展示给其他玩家。之后其余每名玩家随机获得三张武将牌,各自从其中挑选一张同时亮出<li>'+
'亮出身份牌的忠臣增加1点体力上限。角色濒死和死亡的结算及胜利条件与普通身份局相同。', '亮出身份牌的忠臣增加1点体力上限。角色濒死和死亡的结算及胜利条件与普通身份局相同。',