左慈/界左慈【化身】化身牌同神典韦显示可化身技能,并合并各子技能为一个技能

This commit is contained in:
mengxinzxz 2023-11-28 00:40:04 +08:00
parent 9d0adeb858
commit 5d7d67b929
2 changed files with 105 additions and 76 deletions

View File

@ -10374,11 +10374,26 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
olzhiba3:{},
rehuashen:{
audio:2,
unique:true,
audio:2,
trigger:{
global:'phaseBefore',
player:['enterGame','phaseBegin','phaseEnd','rehuashen'],
},
filter:function(event,player,name){
if(event.name!='phase') return true;
if(name=='phaseBefore') return game.phaseNumber==0;
return player.storage.rehuashen&&player.storage.rehuashen.character.length>0;
},
direct:true,
content:function(){
"step 0"
var name=event.triggername;
if(trigger.name!='phase'||(name=='phaseBefore'&&game.phaseNumber==0)){
player.logSkill('rehuashen');
lib.skill.rehuashen.addHuashens(player,3);
event.logged=true;
}
_status.noclearcountdown=true;
event.videoId=lib.status.videoId++;
var cards=player.storage.rehuashen.character.slice(0);
@ -10400,16 +10415,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(event.aiChoice==player.storage.rehuashen.current2||get.skillRank(event.aiChoice,cond)<1) choice='弃置化身';
if(player.isOnline2()){
player.send(function(cards,id){
var dialog=ui.create.dialog('是否发动【化身】?',[cards,'character']);
var dialog=ui.create.dialog('是否发动【化身】?',[cards,(item,type,position,noclick,node)=>lib.skill.rehuashen.$createButton(item,type,position,noclick,node)]);
dialog.videoId=id;
},cards,event.videoId);
}
event.dialog=ui.create.dialog(get.prompt('rehuashen'),[cards,'character']);
event.dialog=ui.create.dialog(get.prompt('rehuashen'),[cards,(item,type,position,noclick,node)=>lib.skill.rehuashen.$createButton(item,type,position,noclick,node)]);
event.dialog.videoId=event.videoId;
if(!event.isMine()){
event.dialog.style.display='none';
}
if(event.triggername=='rehuashen') event._result={control:'更换技能'};
if(event.logged) event._result={control:'更换技能'};
else player.chooseControl('弃置化身','更换技能','cancel2').set('ai',function(){
return _status.event.choice;
}).set('choice',choice);
@ -10541,13 +10556,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
map:{},
}
},
group:'rehuashen_init',
trigger:{
player:['phaseBegin','phaseEnd','rehuashen'],
},
filter:function(event,player,name){
return player.storage.rehuashen&&player.storage.rehuashen.character.length>0;
},
banned:['lisu','sp_xiahoudun','xushao','zhoutai','old_zhoutai','shixie'],
bannedType:['Charlotte','主公技','觉醒技','限定技','隐匿技','使命技'],
addHuashen:function(player){
@ -10578,7 +10586,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(name) list.push(name);
}
if(list.length){
game.log(player,'获得了',get.cnNumber(list.length)+'张','#g化身')
player.syncStorage('rehuashen');
player.updateMarks('rehuashen');
game.log(player,'获得了',get.cnNumber(list.length)+'张','#g化身');
lib.skill.rehuashen.drawCharacter(player,list);
}
},
@ -10604,6 +10614,55 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
},player,list);
},
$createButton:function(item,type,position,noclick,node){
node=ui.create.buttonPresets.character(item,'character',position,noclick);
const info=lib.character[item];
const skills=info[3].filter(function(skill){
const categories=get.skillCategoriesOf(skill);
return !categories.some(type=>lib.skill.rehuashen.bannedType.includes(type));
});
if(skills.length){
const skillstr=skills.map(i=>`[${get.translation(i)}]`).join('<br>');
const skillnode=ui.create.caption(
`<div class="text" data-nature=${get.groupnature(info[1],'raw')
}m style="font-family: ${(lib.config.name_font||'xinwei')
},xinwei">${skillstr}</div>`,node);
skillnode.style.left='2px';
skillnode.style.bottom='2px';
}
node._customintro=function(uiintro,evt){
const character=node.link,characterInfo=get.character(node.link);
let capt=get.translation(character);
if(characterInfo){
capt+=`&nbsp;&nbsp;${get.translation(characterInfo[0])}`;
let charactergroup;
const charactergroups=get.is.double(character,true);
if(charactergroups) charactergroup=charactergroups.map(i=>get.translation(i)).join('/');
else charactergroup=get.translation(characterInfo[1]);
capt+=`&nbsp;&nbsp;${charactergroup}`;
}
uiintro.add(capt);
if(lib.characterTitle[node.link]){
uiintro.addText(get.colorspan(lib.characterTitle[node.link]));
}
for(let i=0;i<skills.length;i++){
if(lib.translate[skills[i]+'_info']){
let translation=lib.translate[skills[i]+'_ab']||get.translation(skills[i]).slice(0,2);
if(lib.skill[skills[i]]&&lib.skill[skills[i]].nobracket){
uiintro.add('<div><div class="skilln">'+get.translation(skills[i])+'</div><div>'+get.skillInfoTranslation(skills[i])+'</div></div>');
}
else{
uiintro.add('<div><div class="skill">【'+translation+'】</div><div>'+get.skillInfoTranslation(skills[i])+'</div></div>');
}
if(lib.translate[skills[i]+'_append']){
uiintro._place_text=uiintro.add('<div class="text">'+lib.translate[skills[i]+'_append']+'</div>')
}
}
}
}
return node;
},
mark:true,
intro:{
onunmark:function(storage,player){
@ -10611,11 +10670,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
storage.character=[];
},
mark:function(dialog,storage,player){
if(storage&&storage.current) dialog.addSmall([[storage.current],'character']);
if(storage&&storage.current) dialog.addSmall([[storage.current],(item,type,position,noclick,node)=>lib.skill.rehuashen.$createButton(item,type,position,noclick,node)]);
if(storage&&storage.current2) dialog.add('<div><div class="skill">【'+get.translation(lib.translate[storage.current2+'_ab']||get.translation(storage.current2).slice(0,2))+'】</div><div>'+get.skillInfoTranslation(storage.current2,player)+'</div></div>');
if(storage&&storage.character.length){
if(player.isUnderControl(true)){
dialog.addSmall([storage.character,'character']);
dialog.addSmall([storage.character,(item,type,position,noclick,node)=>lib.skill.rehuashen.$createButton(item,type,position,noclick,node)]);
}
else{
dialog.addText('共有'+get.cnNumber(storage.character.length)+'张“化身”');
@ -10634,36 +10693,26 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
},
},
rehuashen_init:{
trigger:{
global:'phaseBefore',
player:'enterGame',
},
forced:true,
popup:false,
filter:function(event,player){
return (event.name!='phase'||game.phaseNumber==0);
},
content:function(){
lib.skill.rehuashen.addHuashens(player,3);
player.syncStorage('rehuashen');
player.markSkill('rehuashen');
var next=game.createEvent('rehuashen');
next.player=player;
next._trigger=trigger;
next.triggername='rehuashen';
next.setContent(lib.skill.rehuashen.content);
},
},
rexinsheng:{
unique:true,
audio:2,
trigger:{player:'damageEnd'},
frequent:true,
content:function(){
lib.skill.rehuashen.addHuashens(player,trigger.num);
player.syncStorage('rehuashen');
player.updateMarks('rehuashen');
'step 0'
event.num=trigger.num;
'step 1'
lib.skill.rehuashen.addHuashens(player,1);
'step 2'
if(--event.num>0&&player.hasSkill(event.name)&&!get.is.blocked(event.name,player)){
player.chooseBool(get.prompt2('rexinsheng')).set('frequentSkill',event.name);
}
else event.finish();
'step 3'
if(result.bool&&player.hasSkill('rexinsheng')){
player.logSkill('rexinsheng');
event.goto(1);
}
},
},
reguhuo:{

View File

@ -4163,12 +4163,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:'huashen2',
unique:true,
init:function(player){
player.storage.huashen={
shown:[],
owned:{}
if(!player.storage.huashen){
player.storage.huashen={
shown:[],
owned:{}
};
}
},
group:['huashen1','huashen2'],
intro:{
content:function(storage,player){
var str='';
@ -4196,7 +4197,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
list.push(i);
}
if(list.length){
dialog.addSmall([list,'character']);
dialog.addSmall([list,(item,type,position,noclick,node)=>lib.skill.rehuashen.$createButton(item,type,position,noclick,node)]);
}
for(var i=0;i<dialog.buttons.length;i++){
if(!player.isUnderControl(true)){
@ -4249,46 +4250,28 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(name) list.push(name);
}
if(list.length){
game.log(player,'获得了',get.cnNumber(list.length)+'张','#g化身')
player.syncStorage('huashen');
player.markSkill('huashen');
game.log(player,'获得了',get.cnNumber(list.length)+'张','#g化身');
lib.skill.rehuashen.drawCharacter(player,list);
}
},
},
huashen1:{
trigger:{
global:'phaseBefore',
player:'enterGame',
},
forced:true,
popup:false,
filter:function(event,player){
return (event.name!='phase'||game.phaseNumber==0);
},
content:function(){
var next=game.createEvent('huashen');
next.player=player;
next._trigger=trigger;
next.triggername='huashen';
next.setContent(lib.skill.huashen2.content);
},
},
huashen2:{
audio:2,
trigger:{
player:['phaseBegin','phaseEnd','huashen'],
player:['enterGame','phaseBegin','phaseEnd'],
},
filter:function(event,player,name){
if(event.name!='phase') return true;
if(name=='phaseBefore') return game.phaseNumber==0;
return !get.is.empty(player.storage.huashen.owned);
},
forced:true,
direct:true,
content:function(){
'step 0'
if(event.triggername=='huashen'){
var name=event.triggername;
if(trigger.name!='phase'||(name=='phaseBefore'&&game.phaseNumber==0)){
player.logSkill('huashen');
lib.skill.huashen.addHuashens(player,2);
player.syncStorage('huashen');
player.markSkill('huashen');
event.logged=true;
}
var cards=[];
@ -4326,7 +4309,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player=player||event.player;
if(!event._result) event._result={};
var prompt=forced?'化身:选择获得一项技能':get.prompt('huashen');
var dialog=ui.create.dialog(prompt,[list,'character']);
var dialog=ui.create.dialog(prompt,[list,(item,type,position,noclick,node)=>lib.skill.rehuashen.$createButton(item,type,position,noclick,node)]);
event.dialog=dialog;
event.forceMine=true;
event.button=null;
@ -4425,10 +4408,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.countChoose();
};
if(event.isMine()){
chooseButton(player,cards,event.triggername=='huashen');
chooseButton(player,cards,event.logged);
}
else if(event.isOnline()){
event.player.send(chooseButton,event.player,cards,event.triggername=='huashen');
event.player.send(chooseButton,event.player,cards,event.logged);
event.player.wait();
game.pause();
}
@ -4480,6 +4463,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
}
},
huashen2:{audio:2},
xinsheng:{
audio:2,
unique:true,
@ -4490,8 +4474,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.num=trigger.num;
'step 1'
lib.skill.huashen.addHuashens(player,1);
player.syncStorage('huashen');
player.updateMarks('huashen');
'step 2'
if(--event.num>0&&player.hasSkill(event.name)&&!get.is.blocked(event.name,player)){
player.chooseBool(get.prompt2('xinsheng')).set('frequentSkill',event.name);
@ -7901,8 +7883,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
duanchang:'断肠',
// fushen:'附身',
huashen:'化身',
huashen1:'化身',
huashen2:'化身',
xinsheng:'新生',
qimou:'奇谋',
xinqiangxi:'强袭',