Merge pull request #1064 from mengxinzxz/PR-Branch

单机模式官渡之战选将顺序修改;bugfix
This commit is contained in:
Spmario233 2024-03-11 20:34:29 +08:00 committed by GitHub
commit 2c5f201062
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 90 additions and 60 deletions

View File

@ -26361,7 +26361,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
characterReplace:{ characterReplace:{
guanyinping:['guanyinping','old_guanyinping'], guanyinping:['guanyinping','old_guanyinping'],
shixie:['shixie','dc_shixie','old_shixie'], shixie:['shixie','dc_shixie','old_shixie'],
caoshuang:['caoshuang','ns_caoshuang'], caoshuang:['caoshuang','dc_caoshuang','ns_caoshuang'],
caoang:['caoang','yj_caoang','tw_caoang'], caoang:['caoang','yj_caoang','tw_caoang'],
caohong:['caohong','tw_re_caohong','tw_caohong','yj_caohong'], caohong:['caohong','tw_re_caohong','tw_caohong','yj_caohong'],
xiahouba:['xiahouba','dc_xiahouba','tw_xiahouba'], xiahouba:['xiahouba','dc_xiahouba','tw_xiahouba'],

View File

@ -2793,47 +2793,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
'step 0' 'step 0'
lib.init.onfree(); lib.init.onfree();
ui.arena.classList.add('choose-character'); ui.arena.classList.add('choose-character');
var evt_list=[['huoshaowuchao','chunyuqiong'],['liangcaokuifa','sp_xuyou'],['zhanyanliangzhuwenchou','jsp_guanyu'],['shishengshibai','re_guojia'],['xutuhuanjin','yj_jushou'],['liangjunxiangchi','yj_jushou'],['jianshoudaiyuan','tianfeng'],['yiruoshengqiang','re_caocao'],['shichongerjiao','sp_xuyou']].randomGet(); const side=game.me.side.toString();
var evt=evt_list[0],character=evt_list[1]; event.friendSide=side;event.enemySide=(side=='true'?'false':'true');
game.addGlobalSkill(evt); event.zhuList=[['caocao'],['re_yuanshao']];
const showGuanduEvent=function(evt){
if(ui['GuanduEvent_'+evt]) return;
ui['GuanduEvent_'+evt]=ui.create.system(get.translation(evt),null,true);
lib.setPopped(ui['GuanduEvent_'+evt],function(){
var uiintro=ui.create.dialog('hidden');
uiintro.add(get.translation(evt));
uiintro.add('<div class="text center">'+get.translation(evt+'_info')+'</div>');
var ul=uiintro.querySelector('ul');
if(ul) ul.style.width='180px';
uiintro.add(ui.create.div('.placeholder'));
return uiintro;
},250);
};
showGuanduEvent(evt);
game.broadcastAll(function(evt){
if(lib.config.background_speak) game.playAudio('skill',evt);
if(evt=='shishengshibai'){
ui.guanduInfo=get.is.phoneLayout()?ui.create.div('.touchinfo.left',ui.window):ui.create.div(ui.gameinfo);
ui.guanduInfo.innerHTML='十胜十败0';
}
},evt);
game.me.chooseControl('ok').set('dialog',['###本局特殊事件:'+get.translation(evt)+'###'+get.translation(evt+'_info'),[[character],'character']]);
'step 1'
game.falseZhu.chooseButton(['请选择你的武将牌',[['caocao'],'characterx']],true);
'step 2'
event.falseZhu_choice = result.links[0];
game.trueZhu.chooseButton(['请选择你的武将牌',[['re_yuanshao'],'characterx']],true);
'step 3'
event.trueZhu_choice = result.links[0];
game.falseZhu.init(event.falseZhu_choice);
game.trueZhu.init(event.trueZhu_choice);
game.trueZhu.hp++;
game.trueZhu.maxHp++;
game.falseZhu.hp++;
game.falseZhu.maxHp++;
game.trueZhu.update();
game.falseZhu.update();
'step 4'
event.falseList=['xiahouyuan','litong','zangba','manchong','xunyu','guojia','zhangliao','xuhuang','caohong','jsp_guanyu','hanhaoshihuan','caoren','yujin','liuye','chengyu','xunyou','zhangxiu','sp_jiaxu'].filter(function(name){ event.falseList=['xiahouyuan','litong','zangba','manchong','xunyu','guojia','zhangliao','xuhuang','caohong','jsp_guanyu','hanhaoshihuan','caoren','yujin','liuye','chengyu','xunyou','zhangxiu','sp_jiaxu'].filter(function(name){
if(lib.characterReplace[name]){ if(lib.characterReplace[name]){
let goon = false; let goon = false;
@ -2868,20 +2830,80 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
return false; return false;
}); });
'step 5' 'step 1'
if(game.me.identity!='zhu'){ game[event.enemySide+'Zhu'].chooseButton(['请选择你的武将牌',[event.zhuList[event.enemySide=='true'?1:0],'characterx']],true);
event.choose_me=true; 'step 2'
game.me.chooseButton(['请选择你的武将牌',[event[game.me.side+'List'].randomRemove(2),'characterx']],true); game[event.enemySide+'Zhu'].init(result.links[0]);
} game[event.enemySide+'Zhu'].maxHp++;
'step 6' game[event.enemySide+'Zhu'].hp++;
if(event.choose_me) game.me.init(result.links[0]); game[event.enemySide+'Zhu'].update();
game.countPlayer(function(current){ 'step 3'
if(current!=game.me&&current.identity=='zhong'){ game.countPlayer(current=>{
let choice = event[current.side+'List'].randomRemove(2)[0]; if(current.side.toString()==event.enemySide&&current.identity=='zhong'){
let choice=event[event.enemySide+'List'].randomRemove(2)[0];
if(lib.characterReplace[choice]) choice=lib.characterReplace[choice].randomGet(); if(lib.characterReplace[choice]) choice=lib.characterReplace[choice].randomGet();
current.init(choice); current.init(choice);
} }
}); });
'step 4'
var evt_list=[['huoshaowuchao','chunyuqiong'],['liangcaokuifa','sp_xuyou'],['zhanyanliangzhuwenchou','jsp_guanyu'],['shishengshibai','re_guojia'],['xutuhuanjin','yj_jushou'],['liangjunxiangchi','yj_jushou'],['jianshoudaiyuan','tianfeng'],['yiruoshengqiang','re_caocao'],['shichongerjiao','sp_xuyou']].randomGet();
var evt=evt_list[0],character=evt_list[1];
game.addGlobalSkill(evt);
const showGuanduEvent=function(evt){
if(ui['GuanduEvent_'+evt]) return;
ui['GuanduEvent_'+evt]=ui.create.system(get.translation(evt),null,true);
lib.setPopped(ui['GuanduEvent_'+evt],function(){
var uiintro=ui.create.dialog('hidden');
uiintro.add(get.translation(evt));
uiintro.add('<div class="text center">'+get.translation(evt+'_info')+'</div>');
var ul=uiintro.querySelector('ul');
if(ul) ul.style.width='180px';
uiintro.add(ui.create.div('.placeholder'));
return uiintro;
},250);
};
showGuanduEvent(evt);
game.broadcastAll(function(evt){
if(lib.config.background_speak) game.playAudio('skill',evt);
if(evt=='shishengshibai'){
ui.guanduInfo=get.is.phoneLayout()?ui.create.div('.touchinfo.left',ui.window):ui.create.div(ui.gameinfo);
ui.guanduInfo.innerHTML='十胜十败0';
}
},evt);
game.me.chooseControl('ok').set('dialog',['###本局特殊事件:'+get.translation(evt)+'###'+get.translation(evt+'_info'),[[character],'character']]);
'step 5'
game[event.friendSide+'Zhu'].chooseButton(['请选择你的武将牌',[event.zhuList[event.friendSide=='true'?1:0],'characterx']],true);
'step 6'
if(game[event.friendSide+'Zhu']==game.me){
game[event.friendSide+'Zhu'].init(result.links[0]);
game[event.friendSide+'Zhu'].maxHp++;
game[event.friendSide+'Zhu'].hp++;
game[event.friendSide+'Zhu'].update();
}
else event.zhuChoice=result.links[0];
'step 7'
if(game.me.identity!='zhu'){
event.choose_me=true;
game.me.chooseButton(['请选择你的武将牌',[event[event.friendSide+'List'].randomRemove(2),'characterx']],true);
}
'step 8'
if(event.choose_me) game.me.init(result.links[0]);
game.countPlayer(function(current){
if(current!=game.me&&current.side.toString()==event.friendSide){
if(current.identity=='zhong'){
let choice=event[event.friendSide+'List'].randomRemove(2)[0];
if(lib.characterReplace[choice]) choice = lib.characterReplace[choice].randomGet();
current.init(choice);
}
else{
current.init(event.zhuChoice);
current.maxHp++;
current.hp++;
current.update();
}
}
});
'step 9'
setTimeout(function(){ setTimeout(function(){
ui.arena.classList.remove('choose-character'); ui.arena.classList.remove('choose-character');
},500); },500);
@ -4907,8 +4929,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
position: 'hs', position: 'hs',
prompt: '将【杀】当作【闪】,或将【闪】当作的【杀】使用或打出,然后你的下个弃牌阶段的手牌上限-1', prompt: '将【杀】当作【闪】,或将【闪】当作的【杀】使用或打出,然后你的下个弃牌阶段的手牌上限-1',
viewAs:function(cards,player){ viewAs:function(cards,player){
var name = false;
if(cards.length){ if(cards.length){
var name=false;
switch(get.name(cards[0],player)){ switch(get.name(cards[0],player)){
case 'sha':name='shan';break; case 'sha':name='shan';break;
case 'shan':name='sha';break; case 'shan':name='sha';break;
@ -4974,7 +4996,15 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
if (!player.countCards('hs', name)) return false; if (!player.countCards('hs', name)) return false;
}, },
order: 0.01, order:function(item,player){
if(player&&_status.event.type=='phase'){
if(player.countCards('hs','shan')&&player.getUseValue({name:'sha'})>0){
return get.order({name:'sha'},player)*0.99;
}
return 0;
}
return 0.001;
},
}, },
subSkill: { subSkill: {
less: { less: {