屏蔽强将:'+(lib.configOL.ban_strong?'开启':'关闭')).style.paddingBottom='8px';
},
getIdentityList:function(player){
if(player.identityShown) return;
if(player==game.me) return;
if(_status.mode=='zhong'){
if(game.zhu&&game.zhu.isZhu){
return {
fan:'反',
zhong:'忠',
nei:'内',
cai:'猜',
}
}
else{
return {
fan:'反',
zhong:'忠',
nei:'内',
zhu:'主',
cai:'猜',
}
}
}
else{
return {
fan:'反',
zhong:'忠',
nei:'内',
cai:'猜',
}
}
},
getVideoName:function(){
var str=get.translation(game.me.name);
if(game.me.name2){
str+='/'+get.translation(game.me.name2);
}
var name=[
str,
get.cnNumber(parseInt(get.config('player_number')))+'人'+
get.translation(lib.config.mode)+' - '+lib.translate[game.me.identity+'2']
];
return name;
},
addRecord:function(bool){
if(typeof bool=='boolean'){
var data=lib.config.gameRecord.identity.data;
var identity=game.me.identity;
if(identity=='mingzhong'){
identity='zhong';
}
if(!data[identity]){
data[identity]=[0,0];
}
if(bool){
data[identity][0]++;
}
else{
data[identity][1]++;
}
var list=['zhu','zhong','nei','fan'];
var str='';
for(var i=0;i
';
}
}
lib.config.gameRecord.identity.str=str;
game.saveConfig('gameRecord',lib.config.gameRecord);
}
},
showIdentity:function(me){
for(var i=0;i0) return;
if(game.zhong){
game.zhong.identity='zhong';
}
if(lib.storage.test){
if(game.zhu.isAlive()){
console.log('主忠胜利');
}
else if(game.players[0].identity=='nei'&&game.players.length==1){
console.log('内奸胜利');
}
else{
console.log('反贼胜利');
}
}
game.showIdentity();
if(game.me.identity=='zhu'||game.me.identity=='zhong'){
if(game.zhu.classList.contains('dead')){
game.over(false);
}
else{
game.over(true);
}
}
else if(game.me.identity=='nei'){
if(game.players.length==1&&game.me.isAlive()){
game.over(true);
}
else{
game.over(false);
}
}
else{
if((get.population('fan')+get.population('zhong')>0||get.population('nei')>1)&&
game.zhu.classList.contains('dead')){
game.over(true);
}
else{
game.over(false);
}
}
},
checkOnlineResult:function(player){
if(game.zhu.isAlive()){
return (player.identity=='zhu'||player.identity=='zhong');
}
else if(game.players.length==1&&game.players[0].identity=='nei'){
return player.isAlive();
}
else{
return player.identity=='fan';
}
},
chooseCharacter:function(){
var next=game.createEvent('chooseCharacter',false);
next.showConfig=true;
next.addPlayer=function(player){
var list=lib.config.mode_config.identity.identity[game.players.length-3].slice(0);
var list2=lib.config.mode_config.identity.identity[game.players.length-2].slice(0);
for(var i=0;i4){
player.hp++;
player.maxHp++;
player.update();
}
}
else if(player.identity=='zhong'&&Math.random()<0.5){
var choice=0;
for(var i=0;i4){
game.me.hp++;
game.me.maxHp++;
game.me.update();
}
for(var i=0;i4){
game.zhu.maxHp++;
game.zhu.hp++;
game.zhu.update();
}
game.broadcast(function(zhu,name,name2,addMaxHp){
if(game.zhu!=game.me){
zhu.init(name,name2);
}
if(addMaxHp){
zhu.maxHp++;
zhu.hp++;
zhu.update();
}
},game.zhu,game.zhu.name,game.zhu.name2,game.players.length>4);
var list=[];
var selectButton=(lib.configOL.double_character?2:1);
var num,num2=0;
if(event.zhongmode){
num=3;
}
else{
num=Math.floor(event.list.length/(game.players.length-1));
num2=event.list.length-num*(game.players.length-1);
if(lib.configOL.double_nei){
num2=Math.floor(num2/2);
}
if(num>5){
num=5;
}
if(num2>2){
num2=2;
}
}
for(var i=0;i0){
for(var i=0;i0){
if(effect<1) c=0.5;
else c=1;
if(targets.length==1&&targets[0]==this);
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&&game.me.identity!='nei'){
if(targets.length==1&&targets[0]==this);
else if(targets.length==1) this.ai.shown-=0.2;
else this.ai.shown-=0.1;
}
}
if(this!=game.me) this.ai.shown*=2;
if(this.ai.shown>0.95) this.ai.shown=0.95;
if(this.ai.shown<-0.5) this.ai.shown=-0.5;
var marknow=(!_status.connectMode&&this!=game.me&&get.config('auto_mark_identity')&&this.ai.identity_mark!='finished');
if(true){
if(marknow&&_status.clickingidentity&&_status.clickingidentity[0]==this){
for(var i=0;i<_status.clickingidentity[1].length;i++){
_status.clickingidentity[1][i].delete();
_status.clickingidentity[1][i].style.transform='';
}
delete _status.clickingidentity;
}
if(!Array.isArray(targets)){
targets=[];
}
var effect=0,c,shown;
var zhu=game.zhu;
if(_status.mode=='zhong'&&!game.zhu.isZhu){
zhu=game.zhong;
}
if(targets.length==1&&targets[0]==this){
effect=0;
}
else if(this.identity!='nei'){
if(this.ai.shown>0){
if(this.identity=='fan'){
effect=-1;
}
else{
effect=1;
}
}
}
else if(targets.length>0){
for(var i=0;i0){
if(this.ai.identity_mark=='fan'){
if(marknow) this.setIdentity();
this.ai.identity_mark='finished';
}
else{
if(marknow) this.setIdentity('zhong');
this.ai.identity_mark='zhong';
}
}
else if(effect<0&&get.population('fan')>0){
if(this.ai.identity_mark=='zhong'){
if(marknow) this.setIdentity();
this.ai.identity_mark='finished';
}
else{
if(marknow) this.setIdentity('fan');
this.ai.identity_mark='fan';
}
}
}
else if(marknow){
if(effect>0&&this.identity!='fan'){
this.setIdentity('zhong');
this.ai.identity_mark='finished';
}
else if(effect<0&&this.identity=='fan'){
this.setIdentity('fan');
this.ai.identity_mark='finished';
}
}
}
},
}
},
ai:{
get:{
attitude:function(from){
var att=ai.get.rawAttitude.apply(this,arguments);
if(from&&from.isMad()) return -att;
return att;
},
rawAttitude:function(from,to){
if(!from||!to) return 0;
var x=0,num=0,temp,i;
if(_status.ai.customAttitude){
for(i=0;i<_status.ai.customAttitude.length;i++){
temp=_status.ai.customAttitude[i](from,to);
if(temp!=undefined){
x+=temp;
num++;
}
}
}
if(num){
return x/num;
}
var difficulty=0;
if(to==game.me) difficulty=2-get.difficulty();
if(from==to||to.identityShown){
return ai.get.realAttitude(from,to)+difficulty*1.5;
}
else{
if(from.identity=='zhong'&&to.ai.shown==0&&from.ai.tempIgnore&&
!from.ai.tempIgnore.contains(to)){
for(var i=0;i1&&to.hp>fan.hp&&to.num('he')>fan.num('he')){
return -3;
}
}
return 0;
}
if(situation>1) return 0;
return Math.min(3,get.population('fan'));
case 'fan':
if(get.population('fan')==1&&get.population('nei')==1&&game.players.length==3){
var nei;
for(var i=0;i1&&nei.hp>to.hp&&nei.num('he')>to.num('he')){
return 0;
}
}
return -3;
}
return -4;
}
break;
case 'zhong':case 'mingzhong':
switch(identity2){
case 'zhu': return 10;
case 'zhong':case 'mingzhong': return 4;
case 'nei':
if(get.population('fan')==0) return -2;
if(zhongmode&&to.ai.sizhong&&to.ai.shown<1) return 6;
return Math.min(3,-situation);
case 'fan': return -8;
}
break;
case 'nei':
if(identity2=='zhu'&&game.players.length==2) return -10;
var strategy=get.aiStrategy();
if(strategy==4){
if(from==to) return 10;
return 0;
}
var num;
switch(identity2){
case 'zhu':
if(strategy==6) return -1;
if(strategy==5) return 10;
if(to.hp<=0) return 10;
if(get.population('fan')==1){
var fan;
for(var i=0;i1&&to.hp>fan.hp&&to.num('he')>fan.num('he')){
return -3;
}
}
return 0;
}
else{
if(situation>1||get.population('fan')==0) num=0;
else num=get.population('fan')+Math.max(0,3-game.zhu.hp);
}
if(strategy==2) num--;
if(strategy==3) num++;
return num;
case 'zhong':
if(strategy==5) return Math.min(0,-situation);
if(strategy==6) return Math.max(-1,-situation);
if(get.population('fan')==0) num=-5;
else if(situation<=0) num=0;
else if(game.zhu&&game.zhu.hp<2) num=0;
else if(game.zhu&&game.zhu.hp==2) num=-1;
else if(game.zhu&&game.zhu.hp<=2&&situation>1) num=-1;
else num=-2;
if(zhongmode&&situation<2){
num=4;
}
if(strategy==2) num--;
if(strategy==3) num++;
return num;
case 'mingzhong':
if(zhongmode){
if(from.ai.sizhong==undefined){
from.ai.sizhong=(Math.random()<0.5);
}
if(from.ai.sizhong) return 6;
}
if(strategy==5) return Math.min(0,-situation);
if(strategy==6) return Math.max(-1,-situation);
if(get.population('fan')==0) num=-5;
else if(situation<=0) num=0;
else num=-3;
if(strategy==2) num--;
if(strategy==3) num++;
return num;
case 'nei':
if(from==to) return 10;
if(from.ai.friend.contains(to)) return 5;
if(get.population('fan')+get.population('zhong')>0) return 0;
return -5;
case 'fan':
if(strategy==5) return Math.max(-1,situation);
if(strategy==6) return Math.min(0,situation);
if((game.zhu&&game.zhu.hp<=2&&situation<0)||situation<-1) num=-3;
else if(situation<0||get.population('zhong')+get.population('mingzhong')==0) num=-2;
else if((game.zhu&&game.zhu.hp>=4&&situation>0)||situation>1) num=1;
else num=0;
if(strategy==2) num++;
if(strategy==3) num--;
return num;
}
break;
case 'fan':
switch(identity2){
case 'zhu':
if(get.population('nei')>0){
if(situation==1) return -6;
if(situation>1) return -5;
}
return -8;
case 'zhong':
if(!zhongmode&&game.zhu.hp>=3&&to.hp==1){
return -10;
}
return -7;
case 'mingzhong':return -5;
case 'nei':
if(zhongmode&&to.ai.sizhong) return -7;
if(get.population('fan')==1) return 0;
if(get.population('zhong')+get.population('mingzhong')==0) return -7;
if(game.zhu&&game.zhu.hp<=2) return -1;
return Math.min(3,situation);
case 'fan': return 5;
}
}
},
situation:function(absolute){
var i,j,player;
var zhuzhong=0,total=0,zhu,fan=0;
for(i=0;i4){
php=4;
}
else if(php>6){
php=6;
}
j=player.get('h').length+player.get('e').length*1.5+php*2;
if(player.identity=='zhu'){
zhuzhong+=j*1.2+5;
total+=j*1.2+5;
zhu=j;
}
else if(player.identity=='zhong'||player.identity=='mingzhong'){
zhuzhong+=j*0.8+3;
total+=j*0.8+3;
}
else if(player.identity=='fan'){
zhuzhong-=j+4;
total+=j+4;
fan+=j+4;
}
}
if(absolute) return zhuzhong;
var result=parseInt(10*Math.abs(zhuzhong/total));
if(zhuzhong<0) result=-result;
if(!game.zhong){
if(zhu<12&&fan>30) result--;
if(zhu<6&&fan>15) result--;
if(zhu<4) result--;
}
return result;
},
population:function(identity){
return get.population(identity);
}
}
},
help:{
'身份模式':'选项
- 加强主公
反贼人数多于2时主公会额外增加一个技能(每个主公的额外技能固定,非常备主公增加天命)
'+
'明忠
- 本模式需要8名玩家进行游戏,使用的身份牌为:1主公、2忠臣、4反贼和1内奸。游戏开始时,每名玩家随机获得一个身份,由系统随机选择一名忠臣身份的玩家亮出身份(将忠臣牌正面朝上放在面前),其他身份(包括主公)的玩家不亮出身份。
- '+
'首先由亮出身份的忠臣玩家随机获得六张武将牌,挑选一名角色,并将选好的武将牌展示给其他玩家。之后其余每名玩家随机获得三张武将牌,各自从其中挑选一张同时亮出
- '+
'亮出身份牌的忠臣增加1点体力上限。角色濒死和死亡的结算及胜利条件与普通身份局相同。',
}
}