Merge pull request #1110 from copcap/dev-inf-power
为无名杀「单挑」模式中增加来自海外服的「无限火力」的副模式
This commit is contained in:
commit
d07f437098
596
mode/single.js
596
mode/single.js
|
@ -207,6 +207,23 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
card[2]=='wuxie'&&card[0]=='diamond'&&card[1]==12) lib.card.list.splice(i--,1);
|
card[2]=='wuxie'&&card[0]=='diamond'&&card[1]==12) lib.card.list.splice(i--,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(_status.mode=='wuxianhuoli'){
|
||||||
|
var list=[];
|
||||||
|
if(_status.connectMode) list=get.charactersOL();
|
||||||
|
else{
|
||||||
|
var list=[];
|
||||||
|
for(var i in lib.character){
|
||||||
|
if(!lib.filter.characterDisabled2(i)&&!lib.filter.characterDisabled(i)) list.push(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
game.countPlayer2(function(current){
|
||||||
|
list.remove(current.name);
|
||||||
|
list.remove(current.name1);
|
||||||
|
list.remove(current.name2);
|
||||||
|
});
|
||||||
|
_status.characterlist=list;
|
||||||
|
game.broadcast(list=>_status.characterlist=list,list);
|
||||||
|
}
|
||||||
if(_status.connectMode){
|
if(_status.connectMode){
|
||||||
lib.configOL.number=2;
|
lib.configOL.number=2;
|
||||||
game.randomMapOL();
|
game.randomMapOL();
|
||||||
|
@ -242,6 +259,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
|
|
||||||
game.gameDraw(game.zhu,function(player){
|
game.gameDraw(game.zhu,function(player){
|
||||||
if(_status.mode=='dianjiang') return 4;
|
if(_status.mode=='dianjiang') return 4;
|
||||||
|
if(_status.mode=='wuxianhuoli') return 4;
|
||||||
if(_status.mode=='normal') return player==game.zhu?3:4;
|
if(_status.mode=='normal') return player==game.zhu?3:4;
|
||||||
if(_status.mode=='changban') return player==game.fan?5:4;
|
if(_status.mode=='changban') return player==game.fan?5:4;
|
||||||
if(player.hasSkill('cuorui')){
|
if(player.hasSkill('cuorui')){
|
||||||
|
@ -250,6 +268,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
}
|
}
|
||||||
return player.maxHp;
|
return player.maxHp;
|
||||||
});
|
});
|
||||||
|
if(_status.connectMode&&lib.configOL.change_card) game.replaceHandcards(game.players.slice(0));
|
||||||
|
'step 4'
|
||||||
game.phaseLoop(game.zhu);
|
game.phaseLoop(game.zhu);
|
||||||
},
|
},
|
||||||
game:{
|
game:{
|
||||||
|
@ -375,11 +395,125 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
},500);
|
},500);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
chooseCharacterWuxianhuoli(){
|
||||||
|
const next=game.createEvent('chooseCharacter');
|
||||||
|
next.showConfig=true;
|
||||||
|
next.setContent(function(){
|
||||||
|
'step 0'
|
||||||
|
ui.arena.classList.add('choose-character');
|
||||||
|
lib.init.onfree();
|
||||||
|
var num=[0,1].randomGet();
|
||||||
|
game.players[num].identity='zhu';
|
||||||
|
game.players[1-num].identity='fan';
|
||||||
|
game.broadcastAll(function(p,t){
|
||||||
|
p.enemy=t;t.enemy=p;
|
||||||
|
},game.players[0],game.players[1]);
|
||||||
|
for(var i=0;i<game.players.length;i++){
|
||||||
|
game.players[i].showIdentity();
|
||||||
|
}
|
||||||
|
game.globalBuff=['wuxianhuoli_weisuoyuwei'];
|
||||||
|
const randomBuff=[
|
||||||
|
'liuanhuaming',
|
||||||
|
'duoduoyishan',
|
||||||
|
'xushidaifa',
|
||||||
|
'mianmianjudao'
|
||||||
|
].randomGet();
|
||||||
|
game.globalBuff.add(`wuxianhuoli_${randomBuff}`);
|
||||||
|
'step 1'
|
||||||
|
_status.characterChoice={
|
||||||
|
zhu:_status.characterlist.randomRemove(6),
|
||||||
|
fan:_status.characterlist.randomRemove(6),
|
||||||
|
};
|
||||||
|
const dialog=[
|
||||||
|
'请选择出场武将',
|
||||||
|
'<div class="text center">本局游戏Buff</div>',
|
||||||
|
];
|
||||||
|
game.globalBuff.forEach((buff,ind)=>{
|
||||||
|
dialog.add(`<div class="text">「${ind===0?'固定':'随机'}」 ${get.translation(buff)}:${get.skillInfoTranslation(buff)}</div>`);
|
||||||
|
});
|
||||||
|
dialog.add([_status.characterChoice[game.me.identity],'character']);
|
||||||
|
game.me.chooseButton(true,dialog);
|
||||||
|
'step 2'
|
||||||
|
game.me.init(result.links[0]);
|
||||||
|
_status.characterChoice[game.me.identity].removeArray(result.links);
|
||||||
|
var list=_status.characterChoice[game.me.enemy.identity].randomRemove(1);
|
||||||
|
game.me.enemy.init(list[0]);
|
||||||
|
[game.me,game.me.enemy].forEach(current=>{
|
||||||
|
if(current.storage.nohp||lib.character[current.name1][4].includes('hiddenSkill')&&!current.noclick){
|
||||||
|
current.storage.rawHp=1;
|
||||||
|
current.storage.rawMaxHp=1;
|
||||||
|
}
|
||||||
|
current.hp=10;
|
||||||
|
current.maxHp=10;
|
||||||
|
current.hujia=0;
|
||||||
|
current.update();
|
||||||
|
});
|
||||||
|
game.globalBuff.forEach(buff=>{
|
||||||
|
game.addGlobalSkill(buff);
|
||||||
|
});
|
||||||
|
game.addGlobalSkill('wuxianhuoli_task');
|
||||||
|
_status.wuxianhuoliProgress=0;
|
||||||
|
_status.wuxianhuoliLevel=0;
|
||||||
|
const func=()=>{
|
||||||
|
ui.wuxianhuoliProgress=get.is.phoneLayout()?ui.create.div('.touchinfo.left',ui.window):ui.create.div(ui.gameinfo);
|
||||||
|
ui.wuxianhuoliProgress.innerHTML='任务进度(0/3)';
|
||||||
|
const showTasks=()=>{
|
||||||
|
if(ui.wuxianhuoliInfo) return;
|
||||||
|
ui.wuxianhuoliInfo=ui.create.system('无限火力·信息',null,true);
|
||||||
|
ui.wuxianhuoliInfo.currentProgress=0;
|
||||||
|
ui.wuxianhuoliInfo.currentLevel=0;
|
||||||
|
lib.setPopped(ui.wuxianhuoliInfo,()=>{
|
||||||
|
var uiintro=ui.create.dialog('hidden');
|
||||||
|
uiintro.add(`<div class="text center" style="font-size:18px"><b>任务列表</b></div>`);
|
||||||
|
if(typeof _status.wuxianhuoliLevel!=='number'){
|
||||||
|
uiintro.add(`<div class="text center" style="font-size:12px">未获取当前进度,请于一名角色受伤后再查看</div>`);
|
||||||
|
}
|
||||||
|
else if(_status.wuxianhuoliLevel<2){
|
||||||
|
uiintro.add(`<div class="text center">全场角色造成${_status.wuxianhuoliLevel===0?3:5}点伤害(当前${_status.wuxianhuoliProgress}点)</div>\
|
||||||
|
<div class="text center">奖励:获得一个技能,摸两张牌</div>`);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
uiintro.add(`<div class="text center">所有任务已完成,无后续任务</div>`);
|
||||||
|
}
|
||||||
|
uiintro.add(`<div class="text center" style="font-size:18px"><b>全局Buff</b></div>`);
|
||||||
|
uiintro.add(`<div class="text">${game.globalBuff.map((buff,ind)=>{
|
||||||
|
return get.translation(buff)+':'+get.skillInfoTranslation(buff);
|
||||||
|
}).join('<br>')}</div>`);
|
||||||
|
var ul=uiintro.querySelector('ul');
|
||||||
|
if(ul) ul.style.width='180px';
|
||||||
|
uiintro.add(ui.create.div('.placeholder'));
|
||||||
|
return uiintro;
|
||||||
|
},250);
|
||||||
|
};
|
||||||
|
showTasks();
|
||||||
|
var dialog=ui.create.dialog('hidden','forcebutton');
|
||||||
|
dialog.add(`任务一`);
|
||||||
|
dialog.addText(`任务:全场角色共计造成3点伤害<br>奖励:获得一个技能,摸两张牌`);
|
||||||
|
dialog.add(`任务二<div class="text center" style="font-size:10px">(完成任务一后解锁)</div>\
|
||||||
|
<div class="text center">任务:全场角色共计造成5点伤害<br>奖励:获得一个技能,摸两张牌</div>`);
|
||||||
|
dialog.open();
|
||||||
|
setTimeout(()=>{
|
||||||
|
dialog.close();
|
||||||
|
},3000);
|
||||||
|
};
|
||||||
|
game.broadcastAll(func);
|
||||||
|
game.delay(0,3000);
|
||||||
|
'step 3'
|
||||||
|
_status.characterlist.addArray(Object.values(_status.characterChoice).flat());
|
||||||
|
setTimeout(function(){
|
||||||
|
ui.arena.classList.remove('choose-character');
|
||||||
|
},500);
|
||||||
|
});
|
||||||
|
},
|
||||||
chooseCharacter:function(){
|
chooseCharacter:function(){
|
||||||
if(_status.mode=='dianjiang'){
|
if(_status.mode=='dianjiang'){
|
||||||
game.chooseCharacterDianjiang();
|
game.chooseCharacterDianjiang();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(_status.mode=='wuxianhuoli'){
|
||||||
|
game.chooseCharacterWuxianhuoli();
|
||||||
|
return;
|
||||||
|
}
|
||||||
var next=game.createEvent('chooseCharacter');
|
var next=game.createEvent('chooseCharacter');
|
||||||
next.showConfig=true;
|
next.showConfig=true;
|
||||||
next.setContent(function(){
|
next.setContent(function(){
|
||||||
|
@ -612,11 +746,168 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
},game.fan,result.links[0],event.videoId);
|
},game.fan,result.links[0],event.videoId);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
chooseCharacterWuxianhuoliOL(){
|
||||||
|
var next=game.createEvent('chooseCharacter');
|
||||||
|
next.showConfig=true;
|
||||||
|
next.setContent(function(){
|
||||||
|
'step 0'
|
||||||
|
ui.arena.classList.add('choose-character');
|
||||||
|
var num=[0,1].randomGet();
|
||||||
|
game.players[num].identity='zhu';
|
||||||
|
game.players[1-num].identity='fan';
|
||||||
|
game.broadcastAll(function(p,t){
|
||||||
|
p.enemy=t;t.enemy=p;
|
||||||
|
},game.players[0],game.players[1]);
|
||||||
|
for(var i=0;i<game.players.length;i++){
|
||||||
|
game.players[i].showIdentity();
|
||||||
|
}
|
||||||
|
game.globalBuff=['wuxianhuoli_weisuoyuwei'];
|
||||||
|
const randomBuff=[
|
||||||
|
'liuanhuaming',
|
||||||
|
'duoduoyishan',
|
||||||
|
'xushidaifa',
|
||||||
|
'mianmianjudao'
|
||||||
|
].randomGet();
|
||||||
|
game.globalBuff.add(`wuxianhuoli_${randomBuff}`);
|
||||||
|
const setBuff=buff=>{game.globalBuff=buff};
|
||||||
|
game.broadcast(setBuff,game.globalBuff);
|
||||||
|
if(!_status.postReconnect.wuxianhuoliBuff) _status.postReconnect.wuxianhuoliBuff=[setBuff,[]];
|
||||||
|
_status.postReconnect.wuxianhuoliBuff[1].addArray(game.globalBuff);
|
||||||
|
'step 1'
|
||||||
|
_status.characterChoice={
|
||||||
|
zhu:_status.characterlist.randomRemove(6),
|
||||||
|
fan:_status.characterlist.randomRemove(6),
|
||||||
|
};
|
||||||
|
const list=['zhu','fan'].map(identity=>{
|
||||||
|
const dialog=[
|
||||||
|
'请选择出场武将',
|
||||||
|
'<div class="text center">本局游戏Buff</div>',
|
||||||
|
];
|
||||||
|
game.globalBuff.forEach((buff,ind)=>{
|
||||||
|
dialog.add(`<div class="text">「${ind===0?'固定':'随机'}」 ${get.translation(buff)}:${get.skillInfoTranslation(buff)}</div>`);
|
||||||
|
});
|
||||||
|
dialog.add([_status.characterChoice[identity],'character']);
|
||||||
|
return [game[identity],true,dialog];
|
||||||
|
});
|
||||||
|
game.me.chooseButtonOL(list,function(player,result){
|
||||||
|
if(game.online||player==game.me){
|
||||||
|
player.init(result.links[0]);
|
||||||
|
player.hp=10;
|
||||||
|
player.maxHp=10;
|
||||||
|
player.hujia=0;
|
||||||
|
player.update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
'step 2'
|
||||||
|
for(var i in result){
|
||||||
|
var current=lib.playerOL[i];
|
||||||
|
if(result[i]=='ai'){
|
||||||
|
result[i]=_status.characterChoice[current.identity].randomGets(1);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
result[i]=result[i].links;
|
||||||
|
}
|
||||||
|
_status.characterChoice[current.identity].removeArray(result[i]);
|
||||||
|
if(!current.name){
|
||||||
|
current.init(result[i][0]);
|
||||||
|
if(current.storage.nohp||lib.character[current.name1][4].includes('hiddenSkill')&&!current.noclick){
|
||||||
|
current.storage.rawHp=1;
|
||||||
|
current.storage.rawMaxHp=1;
|
||||||
|
}
|
||||||
|
current.hp=10;
|
||||||
|
current.maxHp=10;
|
||||||
|
current.hujia=0;
|
||||||
|
current.update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
game.broadcast(function(result){
|
||||||
|
for(var i in result){
|
||||||
|
const current=lib.playerOL[i];
|
||||||
|
if(!current.name){
|
||||||
|
current.init(result[i][0]);
|
||||||
|
if(current.storage.nohp||lib.character[current.name1][4].includes('hiddenSkill')&&!current.noclick){
|
||||||
|
current.storage.rawHp=1;
|
||||||
|
current.storage.rawMaxHp=1;
|
||||||
|
}
|
||||||
|
current.hp=10;
|
||||||
|
current.maxHp=10;
|
||||||
|
current.hujia=0;
|
||||||
|
current.update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setTimeout(function(){
|
||||||
|
ui.arena.classList.remove('choose-character');
|
||||||
|
},500);
|
||||||
|
},result);
|
||||||
|
game.globalBuff.forEach(buff=>{
|
||||||
|
game.addGlobalSkill(buff);
|
||||||
|
});
|
||||||
|
game.addGlobalSkill('wuxianhuoli_task');
|
||||||
|
game.broadcastAll(()=>{
|
||||||
|
_status.wuxianhuoliProgress=0;
|
||||||
|
_status.wuxianhuoliLevel=0;
|
||||||
|
});
|
||||||
|
const func=()=>{
|
||||||
|
ui.wuxianhuoliProgress=get.is.phoneLayout()?ui.create.div('.touchinfo.left',ui.window):ui.create.div(ui.gameinfo);
|
||||||
|
ui.wuxianhuoliProgress.innerHTML='任务进度(0/3)';
|
||||||
|
const showTasks=()=>{
|
||||||
|
if(ui.wuxianhuoliInfo) return;
|
||||||
|
ui.wuxianhuoliInfo=ui.create.system('无限火力·信息',null,true);
|
||||||
|
ui.wuxianhuoliInfo.currentProgress=0;
|
||||||
|
ui.wuxianhuoliInfo.currentLevel=0;
|
||||||
|
lib.setPopped(ui.wuxianhuoliInfo,()=>{
|
||||||
|
var uiintro=ui.create.dialog('hidden');
|
||||||
|
uiintro.add(`<div class="text center" style="font-size:18px"><b>任务列表</b></div>`);
|
||||||
|
if(typeof _status.wuxianhuoliLevel!=='number'){
|
||||||
|
uiintro.add(`<div class="text center" style="font-size:12px">未获取当前进度,请于一名角色受伤后再查看</div>`);
|
||||||
|
}
|
||||||
|
else if(_status.wuxianhuoliLevel<2){
|
||||||
|
uiintro.add(`<div class="text center">全场角色造成${_status.wuxianhuoliLevel===0?3:5}点伤害(当前${_status.wuxianhuoliProgress}点)</div>\
|
||||||
|
<div class="text center">奖励:获得一个技能,摸两张牌</div>`);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
uiintro.add(`<div class="text center">所有任务已完成,无后续任务</div>`);
|
||||||
|
}
|
||||||
|
uiintro.add(`<div class="text center" style="font-size:18px"><b>全局Buff</b></div>`);
|
||||||
|
uiintro.add(`<div class="text">${game.globalBuff.map((buff,ind)=>{
|
||||||
|
return get.translation(buff)+':'+get.skillInfoTranslation(buff);
|
||||||
|
}).join('<br>')}</div>`);
|
||||||
|
var ul=uiintro.querySelector('ul');
|
||||||
|
if(ul) ul.style.width='180px';
|
||||||
|
uiintro.add(ui.create.div('.placeholder'));
|
||||||
|
return uiintro;
|
||||||
|
},250);
|
||||||
|
};
|
||||||
|
showTasks();
|
||||||
|
if(!_status.postReconnect.wuxianhuoliShowTasks) _status.postReconnect.wuxianhuoliShowTasks=[showTasks,[]];
|
||||||
|
const dialog=ui.create.dialog('hidden','forcebutton');
|
||||||
|
dialog.add(`任务一`);
|
||||||
|
dialog.addText(`任务:全场角色共计造成3点伤害<br>奖励:获得一个技能,摸两张牌`);
|
||||||
|
dialog.add(`任务二<div class="text center" style="font-size:10px">(完成任务一后解锁)</div>\
|
||||||
|
<div class="text center">任务:全场角色共计造成5点伤害<br>奖励:获得一个技能,摸两张牌</div>`);
|
||||||
|
dialog.open();
|
||||||
|
setTimeout(()=>{
|
||||||
|
dialog.close();
|
||||||
|
},3000);
|
||||||
|
};
|
||||||
|
game.broadcastAll(func);
|
||||||
|
game.delay(0,3000);
|
||||||
|
'step 3'
|
||||||
|
_status.characterlist.addArray(Object.values(_status.characterChoice).flat());
|
||||||
|
setTimeout(function(){
|
||||||
|
ui.arena.classList.remove('choose-character');
|
||||||
|
},500);
|
||||||
|
});
|
||||||
|
},
|
||||||
chooseCharacterOL:function(){
|
chooseCharacterOL:function(){
|
||||||
if(_status.mode=='dianjiang'){
|
if(_status.mode=='dianjiang'){
|
||||||
game.chooseCharacterDianjiangOL();
|
game.chooseCharacterDianjiangOL();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(_status.mode=='wuxianhuoli'){
|
||||||
|
game.chooseCharacterWuxianhuoliOL();
|
||||||
|
return;
|
||||||
|
}
|
||||||
var next=game.createEvent('chooseCharacter');
|
var next=game.createEvent('chooseCharacter');
|
||||||
next.setContent(function(){
|
next.setContent(function(){
|
||||||
"step 0"
|
"step 0"
|
||||||
|
@ -1138,6 +1429,297 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
wuxianhuoli_weisuoyuwei:{
|
||||||
|
trigger:{player:'phaseZhunbeiBegin'},
|
||||||
|
forced:true,
|
||||||
|
silent:true,
|
||||||
|
popup:true,
|
||||||
|
charlotte:true,
|
||||||
|
async content(_,__,player){
|
||||||
|
player.draw();
|
||||||
|
},
|
||||||
|
mod:{
|
||||||
|
cardUsable(card,player,num){
|
||||||
|
if(card.name=='sha') return num+1;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
wuxianhuoli_duoduoyishan:{
|
||||||
|
trigger:{global:'phaseEnd'},
|
||||||
|
forced:true,
|
||||||
|
silent:true,
|
||||||
|
popup:true,
|
||||||
|
charlotte:true,
|
||||||
|
async content(_,__,player){
|
||||||
|
player.draw();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
wuxianhuoli_xushidaifa:{
|
||||||
|
trigger:{source:'damageBegin1'},
|
||||||
|
filter(event,player){
|
||||||
|
if(!event.card||event.card.name!=='sha') return false;
|
||||||
|
return game.getGlobalHistory('everything',evt=>{
|
||||||
|
if(evt.name!=='damage') return false;
|
||||||
|
return evt.card&&evt.card.name==='sha';
|
||||||
|
}).indexOf(event)===0;
|
||||||
|
},
|
||||||
|
forced:true,
|
||||||
|
silent:true,
|
||||||
|
popup:true,
|
||||||
|
charlotte:true,
|
||||||
|
async content(_,trigger){
|
||||||
|
trigger.increase('num');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
wuxianhuoli_liuanhuaming:{
|
||||||
|
trigger:{
|
||||||
|
player:'loseAfter',
|
||||||
|
global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'],
|
||||||
|
},
|
||||||
|
filter(event,player){
|
||||||
|
if(player===_status.currentPhase) return false;
|
||||||
|
const evt=event.getl(player);
|
||||||
|
return evt.cards2&&evt.cards2.length>0;
|
||||||
|
},
|
||||||
|
forced:true,
|
||||||
|
silent:true,
|
||||||
|
popup:true,
|
||||||
|
charlotte:true,
|
||||||
|
usable:2,
|
||||||
|
async content(_,__,player){
|
||||||
|
player.draw();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
wuxianhuoli_mianmianjudao:{
|
||||||
|
trigger:{player:'phaseZhunbeiBegin'},
|
||||||
|
forced:true,
|
||||||
|
silent:true,
|
||||||
|
popup:true,
|
||||||
|
charlotte:true,
|
||||||
|
async content(_,__,player){
|
||||||
|
const cards=[];
|
||||||
|
for(const type of ['basic','trick']){
|
||||||
|
const card=get.cardPile(card=>{
|
||||||
|
const typex=get.type2(card,false);
|
||||||
|
return type===typex;
|
||||||
|
});
|
||||||
|
if(card) cards.add(card);
|
||||||
|
}
|
||||||
|
if(cards.length) player.gain(cards,'gain2');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
wuxianhuoli_task:{
|
||||||
|
trigger:{source:'damageAfter'},
|
||||||
|
forced:true,
|
||||||
|
popup:false,
|
||||||
|
silent:true,
|
||||||
|
charlotte:true,
|
||||||
|
async content(event,trigger,player){
|
||||||
|
if(!_status.wuxianhuoliProgress) _status.wuxianhuoliProgress=0;
|
||||||
|
if(!_status.wuxianhuoliLevel) _status.wuxianhuoliLevel=0;
|
||||||
|
if(_status.wuxianhuoliLevel>1) return;
|
||||||
|
_status.wuxianhuoliProgress+=trigger.num;
|
||||||
|
game.broadcastAll((num,level)=>{
|
||||||
|
_status.wuxianhuoliProgress=num;
|
||||||
|
_status.wuxianhuoliLevel=level;
|
||||||
|
if(!ui.wuxianhuoliProgress){
|
||||||
|
ui.wuxianhuoliProgress=get.is.phoneLayout()?ui.create.div('.touchinfo.left',ui.window):ui.create.div(ui.gameinfo);
|
||||||
|
}
|
||||||
|
ui.wuxianhuoliProgress.innerHTML='任务进度('+num+'/'+(level===0?3:5)+')';
|
||||||
|
},_status.wuxianhuoliProgress,_status.wuxianhuoliLevel);
|
||||||
|
if(_status.wuxianhuoliProgress<(_status.wuxianhuoliLevel===0?3:5)) return;
|
||||||
|
game.broadcastAll(()=>{
|
||||||
|
_status.wuxianhuoliProgress=0;
|
||||||
|
_status.wuxianhuoliLevel++;
|
||||||
|
});
|
||||||
|
let next;
|
||||||
|
const send=(skills,refreshable,stop=false)=>{
|
||||||
|
let next=game.createEvent('wuxianhuoli_reward',false);
|
||||||
|
next.setContent(lib.skill.wuxianhuoli_task.contentx);
|
||||||
|
next.set('skills',skills);
|
||||||
|
next.set('refreshable',refreshable);
|
||||||
|
next.set('includeOut',true);
|
||||||
|
if(!stop) game.resume();
|
||||||
|
return next;
|
||||||
|
};
|
||||||
|
const sendback=(result,player)=>{
|
||||||
|
if(!result) result={};
|
||||||
|
if(!result.control&&(typeof result.index!=='number'||result.index<0)){
|
||||||
|
result.index=0;
|
||||||
|
}
|
||||||
|
results.push([player,result]);
|
||||||
|
};
|
||||||
|
const ai_targets=[],results=[],players=game.players.slice(),skillsMap={};
|
||||||
|
let withme=false,withol=false,withai=false;
|
||||||
|
for(const current of players){
|
||||||
|
if(_status.connectMode) current.showTimer();
|
||||||
|
const skills=get.info('wuxianhuoli_task').getSkills();
|
||||||
|
const refreshable=!current.storage.wuxianhuoli_refreshed;
|
||||||
|
skillsMap[current.playerid]=skills;
|
||||||
|
if(current.isOnline()){
|
||||||
|
withol=true;
|
||||||
|
current.send(send,skills,refreshable);
|
||||||
|
current.wait(sendback);
|
||||||
|
}
|
||||||
|
else if(current==game.me){
|
||||||
|
withme=true;
|
||||||
|
next=send(skills,refreshable,true);
|
||||||
|
if(_status.connectMode) game.me.wait(sendback);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
ai_targets.push(current);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(ai_targets.length){
|
||||||
|
for(let i=0;i<ai_targets.length;i++){
|
||||||
|
const current=ai_targets[i];
|
||||||
|
if(players.includes(current)){
|
||||||
|
sendback({index:0},current);
|
||||||
|
ai_targets.splice(i--,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(ai_targets.length){
|
||||||
|
ai_targets.randomSort();
|
||||||
|
setTimeout(function(){
|
||||||
|
event.interval=setInterval(function(){
|
||||||
|
const current=ai_targets.shift();
|
||||||
|
if(players.includes(current)){
|
||||||
|
sendback({index:0},current);
|
||||||
|
}
|
||||||
|
if(!ai_targets.length){
|
||||||
|
clearInterval(event.interval);
|
||||||
|
if(withai) game.resume();
|
||||||
|
}
|
||||||
|
},_status.connectMode?750:75);
|
||||||
|
},500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(withme){
|
||||||
|
let result=await next.forResult();
|
||||||
|
if(_status.connectMode){
|
||||||
|
game.me.unwait(result,game.me);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(!result) result={};
|
||||||
|
if(!result.control&&(typeof result.index!=='number'||result.index<0)){
|
||||||
|
result.index=0;
|
||||||
|
}
|
||||||
|
results.push([game.me,result]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(withol&&!event.resultOL){
|
||||||
|
await new Promise((resolve)=>{
|
||||||
|
const interval=setInterval(()=>{
|
||||||
|
if(results.length===players.length){
|
||||||
|
resolve();
|
||||||
|
clearInterval(interval);
|
||||||
|
}
|
||||||
|
},4);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if(ai_targets.length>0){
|
||||||
|
withai=true;
|
||||||
|
await new Promise((resolve)=>{
|
||||||
|
const interval=setInterval(()=>{
|
||||||
|
if(results.length===players.length){
|
||||||
|
resolve();
|
||||||
|
clearInterval(interval);
|
||||||
|
}
|
||||||
|
},4);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if(_status.connectMode){
|
||||||
|
for(var i of players) i.hideTimer();
|
||||||
|
}
|
||||||
|
const entries=[];
|
||||||
|
for(const res of results){
|
||||||
|
const target=res[0],result=res[1];
|
||||||
|
if(!target||!result) continue;
|
||||||
|
let skill=result.control;
|
||||||
|
if(!skill) skill=skillsMap[target.playerid][result.index];
|
||||||
|
if(result.refreshed) target.storage.wuxianhuoli_refreshed=true;
|
||||||
|
entries.push([target,skill]);
|
||||||
|
}
|
||||||
|
entries.sort((a,b)=>lib.sort.seat(a[0],b[0]));
|
||||||
|
for(const entry of entries){
|
||||||
|
entry[0].popup(entry[1]);
|
||||||
|
await entry[0].addSkills(entry[1]);
|
||||||
|
}
|
||||||
|
for(const entry of entries){
|
||||||
|
await entry[0].draw(2,'nodelay');
|
||||||
|
}
|
||||||
|
game.broadcastAll((num,level)=>{
|
||||||
|
if(level===2&&ui.wuxianhuoliProgress){
|
||||||
|
ui.wuxianhuoliProgress.innerHTML='';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!ui.wuxianhuoliProgress){
|
||||||
|
ui.wuxianhuoliProgress=get.is.phoneLayout()?ui.create.div('.touchinfo.left',ui.window):ui.create.div(ui.gameinfo);
|
||||||
|
}
|
||||||
|
ui.wuxianhuoliProgress.innerHTML='任务进度('+num+'/'+(level===0?3:5)+')';
|
||||||
|
},_status.wuxianhuoliProgress,_status.wuxianhuoliLevel);
|
||||||
|
await game.asyncDelay();
|
||||||
|
},
|
||||||
|
getSkills(num=6){
|
||||||
|
let allList=_status.characterlist.slice(0);
|
||||||
|
let list=[];
|
||||||
|
let skills=[];
|
||||||
|
let map=[];
|
||||||
|
let entries=[];
|
||||||
|
allList.randomSort();
|
||||||
|
for(let i=0;i<allList.length;i++){
|
||||||
|
let name=allList[i];
|
||||||
|
let skills2=lib.character[name][3].slice();
|
||||||
|
skills2.randomSort();
|
||||||
|
outer:for(let j=0;j<skills2.length;j++){
|
||||||
|
let list2=[skills2[j]];
|
||||||
|
game.expandSkills(list2);
|
||||||
|
for(let k=0;k<list2.length;k++){
|
||||||
|
let info=lib.skill[list2[k]];
|
||||||
|
if(!info||info.silent||info.juexingji||info.hiddenSkill||info.dutySkill||info.zhuSkill||info.unique||info.groupSkill) continue;
|
||||||
|
if(info.ai&&(info.ai.combo||info.ai.notemp||info.ai.neg)) continue;
|
||||||
|
list.add(name);
|
||||||
|
if(!map[name]) map[name]=[];
|
||||||
|
map[name].push(skills2[j]);
|
||||||
|
skills.add(skills2[j]);
|
||||||
|
entries.push([name,skills2[j]]);
|
||||||
|
break outer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(list.length>=num) break;
|
||||||
|
}
|
||||||
|
return skills;
|
||||||
|
},
|
||||||
|
async contentx(event){
|
||||||
|
_status.noclearcountdown=true;
|
||||||
|
const controls=[link=>{
|
||||||
|
const evt=get.event();
|
||||||
|
evt.result={refresh:true};
|
||||||
|
event.control.classList.add('disabled');
|
||||||
|
event.control.firstChild.innerText='刷新(1/1)';
|
||||||
|
game.resume();
|
||||||
|
}];
|
||||||
|
event.control=ui.create.control(controls.concat(['刷新(0/1)','stayleft']));
|
||||||
|
if(!event.refreshable){
|
||||||
|
event.control.classList.add('disabled');
|
||||||
|
event.control.firstChild.innerText='刷新(1/1)';
|
||||||
|
}
|
||||||
|
let refreshed=false,result;
|
||||||
|
while(true){
|
||||||
|
const skills=event.skills.slice(3*refreshed,3*(refreshed+1));
|
||||||
|
const next=game.me.chooseControl(skills).set('choiceList',skills.map(skill=>{
|
||||||
|
return '<div class="skill">【'+get.translation(lib.translate[skill+'_ab']||get.translation(skill).slice(0,2))+'】</div>'+
|
||||||
|
'<div>'+get.skillInfoTranslation(skill,game.me)+'</div>';
|
||||||
|
})).set('displayIndex',false).set('prompt','选择获得一个技能');
|
||||||
|
result=await next.forResult();
|
||||||
|
if(!result.refresh) break;
|
||||||
|
refreshed=true;
|
||||||
|
}
|
||||||
|
if(event.control) event.control.close();
|
||||||
|
delete _status.noclearcountdown;game.stopCountChoose();
|
||||||
|
event.result={control:result.control,refreshed};
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
singleTranslate:{
|
singleTranslate:{
|
||||||
xiahouyuan:'夏侯渊',
|
xiahouyuan:'夏侯渊',
|
||||||
|
@ -1161,6 +1743,18 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
normal2:'新1v1',
|
normal2:'新1v1',
|
||||||
changban2:'血战长坂坡',
|
changban2:'血战长坂坡',
|
||||||
dianjiang2:'点将单挑',
|
dianjiang2:'点将单挑',
|
||||||
|
wuxianhuoli2:'无限火力',
|
||||||
|
|
||||||
|
wuxianhuoli_weisuoyuwei:'为所欲为',
|
||||||
|
wuxianhuoli_weisuoyuwei_info:'①准备阶段,你摸一张牌。②你使用【杀】的次数上限+1。',
|
||||||
|
wuxianhuoli_duoduoyishan:'多多益善',
|
||||||
|
wuxianhuoli_duoduoyishan_info:'一名角色的回合结束时,你摸一张牌。',
|
||||||
|
wuxianhuoli_xushidaifa:'蓄势待发',
|
||||||
|
wuxianhuoli_xushidaifa_info:'当你于一回合首次造成渠道为【杀】的伤害时,此伤害+1。',
|
||||||
|
wuxianhuoli_liuanhuaming:'柳暗花明',
|
||||||
|
wuxianhuoli_liuanhuaming_info:'每回合限两次。当你于回合外失去牌后,你摸一张牌。',
|
||||||
|
wuxianhuoli_mianmianjudao:'面面俱到',
|
||||||
|
wuxianhuoli_mianmianjudao_info:'准备阶段,你从牌堆或弃牌堆中获得基本牌和锦囊牌各一张。',
|
||||||
|
|
||||||
wanrong:'婉容',
|
wanrong:'婉容',
|
||||||
wanrong_info:'当你成为【杀】的目标后,你可以摸一张牌。',
|
wanrong_info:'当你成为【杀】的目标后,你可以摸一张牌。',
|
||||||
|
@ -1191,6 +1785,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
||||||
help:{
|
help:{
|
||||||
'血战长坂':'<div style="margin:10px">游戏规则</div><ul style="margin-top:0"><li>选将阶段<br>双方在游戏开始时由系统随机分配身份。分配到先手身份的玩家优先出牌,分配到后手身份的玩家优先选将。<br>双方各自随机获得3名暗置武将,同时从将池中随机选出6名明置武将,由后手玩家开始,按照一次1张-2张-2张-1张的顺序,轮流选择获得明置武将。之后双方各从自己的6名武将中选择2名分别作为主将和副将进行游戏。<li>胜利条件<br>对方死亡。'+
|
'血战长坂':'<div style="margin:10px">游戏规则</div><ul style="margin-top:0"><li>选将阶段<br>双方在游戏开始时由系统随机分配身份。分配到先手身份的玩家优先出牌,分配到后手身份的玩家优先选将。<br>双方各自随机获得3名暗置武将,同时从将池中随机选出6名明置武将,由后手玩家开始,按照一次1张-2张-2张-1张的顺序,轮流选择获得明置武将。之后双方各从自己的6名武将中选择2名分别作为主将和副将进行游戏。<li>胜利条件<br>对方死亡。'+
|
||||||
'<li>双将规则<br>双将主将决定角色的性别和势力,体力上限为主副将体力上限的平均值,向下取整。体力上限为3的角色可在游戏开始后更换一次起始手牌。<li>牌堆<br>牌堆中移除【木牛流马】【闪电】,♣花色的【藤甲】和【无懈可击 ♦️Q】️</ul>',
|
'<li>双将规则<br>双将主将决定角色的性别和势力,体力上限为主副将体力上限的平均值,向下取整。体力上限为3的角色可在游戏开始后更换一次起始手牌。<li>牌堆<br>牌堆中移除【木牛流马】【闪电】,♣花色的【藤甲】和【无懈可击 ♦️Q】️</ul>',
|
||||||
|
'无限火力':'<div style="margin:10px">1v1火力全开模式</div><ul style="margin-top:0">(来自三国杀国际服)<li>所有角色的初始体力值和体力上限均为10,护甲均为0<li>每局游戏会有一个固定的Buff和一个随机的Buff,对所有角色生效'+
|
||||||
|
'<li>游戏全程会有两个任务,分别为“所有角色造成3点伤害”和“所有角色造成5点伤害”,在任务一完成后才会解锁任务二。<br>每当任务完成时,系统会发放奖励:所有角色观看三个随机的技能并获得其中一个(每名角色每局有一次刷新的机会),然后摸两张牌。',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -1021,6 +1021,7 @@ export class Get extends Uninstantable {
|
||||||
case 'normal': return '新1v1';
|
case 'normal': return '新1v1';
|
||||||
case 'changban': return '血战长坂坡';
|
case 'changban': return '血战长坂坡';
|
||||||
case 'dianjiang': return '点将单挑';
|
case 'dianjiang': return '点将单挑';
|
||||||
|
case 'wuxianhuoli': return '无限火力';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (config.mode == 'identity') {
|
if (config.mode == 'identity') {
|
||||||
|
|
|
@ -1922,7 +1922,10 @@ export const Content = {
|
||||||
}
|
}
|
||||||
while (player != end);
|
while (player != end);
|
||||||
event.changeCard = get.config('change_card');
|
event.changeCard = get.config('change_card');
|
||||||
if (_status.connectMode || (lib.config.mode == 'doudizhu' && _status.mode == 'online') || lib.config.mode != 'identity' && lib.config.mode != 'guozhan' && lib.config.mode != 'doudizhu') {
|
if (_status.connectMode ||
|
||||||
|
(lib.config.mode == 'single' && _status.mode != 'wuxianhuoli') ||
|
||||||
|
(lib.config.mode == 'doudizhu' && _status.mode == 'online') ||
|
||||||
|
lib.config.mode != 'identity' && lib.config.mode != 'guozhan' && lib.config.mode != 'doudizhu' && lib.config.mode != 'single') {
|
||||||
event.changeCard = 'disabled';
|
event.changeCard = 'disabled';
|
||||||
}
|
}
|
||||||
"step 1";
|
"step 1";
|
||||||
|
|
|
@ -6933,9 +6933,11 @@ export class Library extends Uninstantable {
|
||||||
normal: '新1v1',
|
normal: '新1v1',
|
||||||
dianjiang: '点将单挑',
|
dianjiang: '点将单挑',
|
||||||
changban: '血战长坂坡',
|
changban: '血战长坂坡',
|
||||||
|
wuxianhuoli: '无限火力',
|
||||||
},
|
},
|
||||||
restart: true,
|
restart: true,
|
||||||
frequent: true,
|
frequent: true,
|
||||||
|
intro: '血战长坂坡和无限火力模式详见帮助',
|
||||||
},
|
},
|
||||||
connect_enable_jin: {
|
connect_enable_jin: {
|
||||||
name: '启用晋势力武将',
|
name: '启用晋势力武将',
|
||||||
|
@ -6943,6 +6945,12 @@ export class Library extends Uninstantable {
|
||||||
restart: true,
|
restart: true,
|
||||||
frequent: true,
|
frequent: true,
|
||||||
},
|
},
|
||||||
|
connect_change_card: {
|
||||||
|
name: '启用手气卡',
|
||||||
|
init: false,
|
||||||
|
frequent: true,
|
||||||
|
restart: true,
|
||||||
|
},
|
||||||
update: function (config, map) {
|
update: function (config, map) {
|
||||||
if (config.connect_single_mode != 'normal') {
|
if (config.connect_single_mode != 'normal') {
|
||||||
map.connect_enable_jin.hide();
|
map.connect_enable_jin.hide();
|
||||||
|
@ -6950,6 +6958,12 @@ export class Library extends Uninstantable {
|
||||||
else {
|
else {
|
||||||
map.connect_enable_jin.show();
|
map.connect_enable_jin.show();
|
||||||
}
|
}
|
||||||
|
if (config.connect_single_mode != 'wuxianhuoli') {
|
||||||
|
map.connect_change_card.hide();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
map.connect_change_card.show();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config: {
|
config: {
|
||||||
|
@ -6960,9 +6974,11 @@ export class Library extends Uninstantable {
|
||||||
normal: '新1v1',
|
normal: '新1v1',
|
||||||
dianjiang: '点将单挑',
|
dianjiang: '点将单挑',
|
||||||
changban: '血战长坂坡',
|
changban: '血战长坂坡',
|
||||||
|
wuxianhuoli: '无限火力',
|
||||||
},
|
},
|
||||||
restart: true,
|
restart: true,
|
||||||
frequent: true,
|
frequent: true,
|
||||||
|
intro: '血战长坂坡和无限火力模式详见帮助',
|
||||||
},
|
},
|
||||||
enable_jin: {
|
enable_jin: {
|
||||||
name: '启用晋势力武将',
|
name: '启用晋势力武将',
|
||||||
|
@ -6970,6 +6986,16 @@ export class Library extends Uninstantable {
|
||||||
restart: true,
|
restart: true,
|
||||||
frequent: true,
|
frequent: true,
|
||||||
},
|
},
|
||||||
|
change_card: {
|
||||||
|
name: '开启手气卡',
|
||||||
|
init: 'disabled',
|
||||||
|
item: {
|
||||||
|
disabled: '禁用',
|
||||||
|
once: '一次',
|
||||||
|
twice: '两次',
|
||||||
|
unlimited: '无限',
|
||||||
|
}
|
||||||
|
},
|
||||||
update: function (config, map) {
|
update: function (config, map) {
|
||||||
if (config.single_mode != 'normal') {
|
if (config.single_mode != 'normal') {
|
||||||
map.enable_jin.hide();
|
map.enable_jin.hide();
|
||||||
|
@ -6977,6 +7003,12 @@ export class Library extends Uninstantable {
|
||||||
else {
|
else {
|
||||||
map.enable_jin.show();
|
map.enable_jin.show();
|
||||||
}
|
}
|
||||||
|
if (config.single_mode != 'wuxianhuoli') {
|
||||||
|
map.change_card.hide();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
map.change_card.show();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue