国战模式bug修复

将建国结盟的ai拒绝加入概率调整为0.02
修复建国完成后不满足胜利条件时游戏仍然终止的bug
This commit is contained in:
mengxinzxz 2023-09-01 15:56:21 +08:00 committed by GitHub
parent 0911c94b76
commit debe69eb82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 4 deletions

View File

@ -13299,6 +13299,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var source=event.targets2.shift();
event.source=source;
event.targets3=[];
event.targets4=[source];
if(!_status.yexinjia_list) _status.yexinjia_list=['夏','商','周','秦','汉','隋','唐','宋','辽','金','元','明'];
source.chooseControl(_status.yexinjia_list).set('prompt','请选择自己所属的野心家势力的标识').set('ai',()=>(_status.yexinjia_list?_status.yexinjia_list.randomGet():0));
'step 4'
@ -13323,14 +13324,14 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
var target=targets.shift();
event.target=target;
source.line(target,'green');
target.chooseBool('是否响应'+get.translation(source)+'发起的【拉拢人心】?','将势力改为'+event.text+(['辽','金'].contains(event.text)?'':'朝')).set('choice',Math.random()<=0.95);//偶尔反骨[doge]
target.chooseBool('是否响应'+get.translation(source)+'发起的【拉拢人心】?','将势力改为'+event.text+(['辽','金'].contains(event.text)?'':'朝')).set('choice',Math.random()<=0.98);//反骨[doge]
'step 6'
if(result.bool){
target.chat('加入');
event.targets4.push(target);
game.broadcastAll(function(player,target,text){
player.identity='ye';
player.setIdentity(text,'ye');
player.markAuto('yexinjia_friend',[target]);
},target,event.source,event.text);
}
else{
@ -13339,6 +13340,11 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
event.targets3.push(target);
}
if(targets.length) event.goto(5);
else if(event.targets4.length){
for(var i of event.targets4){
i.markAuto('yexinjia_friend',event.targets4.filter(j=>j!=i));
}
}
'step 7'
if(event.targets3.length){
for(var i of event.targets3){
@ -13346,10 +13352,16 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
i.recover();
}
}
game.checkResult();
'step 8'
if(event.targets2.length) event.goto(3);
else delete _status.showYexings;
else{
delete _status.showYexings;
if(!game.hasPlayer(current=>{
return game.hasPlayer(target=>{
return !target.isFriendOf(current);
});
})) game.checkResult();
}
});
},
getCharacterChoice:function(list,num){