赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 3 |
经验 | 0 |
最后登录 | 2024-8-20 |
在线时间 | 34 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 293
- 在线时间
- 34 小时
- 注册时间
- 2022-1-26
- 帖子
- 21
|
3楼
楼主 |
发表于 2023-11-3 18:37:55
|
只看该作者
因为那个是比较老的武将了……大佬能看懂下面的新武将吗这还是js吗
skill={
audio:"ext:丿少冰:2",
trigger:{
player:"enterGame",
global:"phaseBefore",
},
filter:function(event,player){
return event.name!='phase'||game.phaseNumber==0;
},
derivation:["mbdanggu_faq","mbdanggu_faq2"],
forced:true,
unique:true,
onremove:function(player){
delete player.storage.mbdanggu;
delete player.storage.mbdanggu_current;
if(lib.skill.mbdanggu.isSingleShichangshi(player)){
game.broadcastAll(function(player){
player.name1=player.name;
player.smoothAvatar(false);
player.node.avatar.setBackground(player.name,'character');
player.node.name.innerHTML=get.slimName(player.name);
delete player.name2;
player.classList.remove('fullskin2');
player.node.avatar2.classList.add('hidden');
player.node.name2.innerHTML='';
if(player==game.me&&ui.fakeme){
ui.fakeme.style.backgroundImage=player.node.avatar.style.backgroundImage;
}
},player);
}
},
changshi:[["scs1_zhangrang1","scstaoluan"],["scs_zhaozhong1","scschiyan"],["scs_sunzhang1","scszimou"],["scs_bilan1","scspicai"],["scs_xiayun1","scsyaozhuo"],["scs_hankui1","scsxiaolu"],["scs_lisong1","scskuiji"],["scs_duangui1","scschihe"],["scs_guosheng1","scsniqu"],["scs_gaowang1","scsmiaoyu"]],
conflictMap:function(){
if(!_status.changshiMap){
_status.changshiMap={
scs_zhangrang1:[],
scs_zhaozhong1:[],
scs_sunzhang2:[],
scs_bilan1:['scs_hankui1'],
scs_xiayun1:[],
scs_hankui1:['scs_bilan1'],
scs_lisong1:[],
scs_duangui1:['scs_guosheng1'],
scs_guosheng1:['scs_duangui1'],
scs_gaowang1:[],
};
var list=lib.skill.mbdanggu.changshi.map(i=>i[0]);
for(var i of list){
var select=list.filter(scs=>scs!=i&&!_status.changshiMap.contains(i));
_status.changshiMap.addArray(select.randomGets(get.rand(0,select.length)));
}
}
return _status.changshiMap;
},
group:"mbdanggu_back",
content:function(){
'step 0'
var list=lib.skill.mbdanggu.changshi.map(i=>i[0]);
player.markAuto('mbdanggu',list);
game.broadcastAll(function(player,list){
var cards=[];
for(var i=0;i<list.length;i++){
var cardname='huashen_card_'+list;
lib.card[cardname]={
fullimage:true,
image:'character/'+list
}
lib.translate[cardname]=get.rawName2(list);
cards.push(game.createCard(cardname,'',''));
}
player.$draw(cards,'nobroadcast');
},player,list);
'step 1'
var next=game.createEvent('mbdanggu_clique');
next.player=player;
next.setContent(lib.skill.mbdanggu.contentx);
},
contentx:function(){
'step 0'
var list=player.getStorage('mbdanggu').slice();
var first=list.randomRemove();
event.first=first;
var others=list.randomGets(9);
if(others.length==1) event._result={bool:true,links:others};
else{
var conflictList=others.filter(changshi=>{
var map=lib.skill.mbdanggu.conflictMap();
var names=map[first];
return names.contains(changshi);
}),list=others.slice();
if(conflictList.length){
var conflict=conflictList.randomGet();
list.remove(conflict);
game.broadcastAll(function(changshi,player){
if(lib.config.background_speak){
if(player.isUnderControl(true)) game.playAudio('skill',changshi+'_enter');
}
},conflict,player);
}
player.chooseButton([
'党锢:请选择结党对象',
[[first],'character'],
'<div class="text center">可选常侍</div>',
[others,'character']
],true).set('filterButton',button=>{
return _status.event.canChoose.contains(button.link);
}).set('canChoose',list).set('ai',button=>Math.random()*10);
}
'step 1'
if(result.bool){
var first=event.first;
var chosen=result.links[0];
var skills=[];
var list=lib.skill.mbdanggu.changshi;
var changshis=[first,chosen];
player.unmarkAuto('mbdanggu',changshis);
player.storage.mbdanggu_current=changshis;
for(var changshi of changshis){
for(var cs of list){
if(changshi==cs[0]) skills.push(cs[1]);
}
}
if(lib.skill.mbdanggu.isSingleShichangshi(player)){
game.broadcastAll(function(player,first,chosen){
player.name1=first;
player.node.avatar.setBackground(first,'character');
player.node.name.innerHTML=get.slimName(first);
player.name2=chosen;
player.classList.add('fullskin2');
player.node.avatar2.classList.remove('hidden');
player.node.avatar2.setBackground(chosen,'character');
player.node.name2.innerHTML=get.slimName(chosen);
if(player==game.me&&ui.fakeme){
ui.fakeme.style.backgroundImage=player.node.avatar.style.backgroundImage;
}
},player,first,chosen);
}
game.log(player,'选择了常侍','#y'+get.translation(changshis));
if(skills.length){
player.addAdditionalSkill('mbdanggu',skills);
var str='';
for(var i of skills){
str+='【'+get.translation(i)+'】、';
player.popup(i);
}
str=str.slice(0,-1);
game.log(player,'获得了技能','#g'+str);
}
}
},
isSingleShichangshi:function(player){
var map=lib.skill.mbdanggu.conflictMap();
return player.name=='shichangshi'&&(map[player.name1]&&map[player.name2]||map[player.name1]&&!player.name2||!player.name1&&!player.name2||player.name==player.name1&&!player.name2);
},
mod:{
aiValue:function(player,card,num){
if(['shan','tao','wuxie','caochuan'].contains(card.name)) return num/10;
},
aiUseful:function(){
return lib.skill.mbdanggu.mod.aiValue.apply(this,arguments);
},
},
ai:{
combo:"mbmowang",
nokeep:true,
},
intro:{
mark:function(dialog,storage,player){
dialog.addText('剩余常侍');
dialog.addSmall([storage,'character']);
if(player.storage.mbdanggu_current&&player.isIn()){
dialog.addText('当前常侍');
dialog.addSmall([player.storage.mbdanggu_current,'character']);
}
},
},
subSkill:{
back:{
audio:"mbdanggu",
trigger:{
global:"restEnd",
},
filter:function(event,player){
return event.getTrigger().player==player;
},
forced:true,
content:function(){
'step 0'
delete player.storage.mbdanggu_current;
if(lib.skill.mbdanggu.isSingleShichangshi(player)){
game.broadcastAll(function(player){
player.name1=player.name;
player.smoothAvatar(false);
player.node.avatar.setBackground(player.name,'character');
player.node.name.innerHTML=get.slimName(player.name);
delete player.name2;
player.classList.remove('fullskin2');
player.node.avatar2.classList.add('hidden');
player.node.name2.innerHTML='';
if(player==game.me&&ui.fakeme){
ui.fakeme.style.backgroundImage=player.node.avatar.style.backgroundImage;
}
},player);
}
'step 1'
var next=game.createEvent('mbdanggu_clique');
next.player=player;
next.setContent(lib.skill.mbdanggu.contentx);
player.draw();
},
sub:true,
"_priority":0,
},
},
"_priority":0,
} |
|