Merge pull request #1166 from PZ157/PR-Branch

部分技能优化
This commit is contained in:
Spmario233 2024-04-07 22:40:39 +08:00 committed by GitHub
commit 68b6a39f67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 34 additions and 35 deletions

View File

@ -4052,7 +4052,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'phaseUseEnd'}, trigger:{player:'phaseUseEnd'},
zhuSkill:true, zhuSkill:true,
unique:true, unique:true,
direct:true, popup:false,
filter:function(event,player){ filter:function(event,player){
if(!player.hasZhuSkill('sbjijiang')) return false; if(!player.hasZhuSkill('sbjijiang')) return false;
return game.hasPlayer(current=>{ return game.hasPlayer(current=>{
@ -4060,17 +4060,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return game.hasPlayer(currentx=>current.inRange(currentx)); return game.hasPlayer(currentx=>current.inRange(currentx));
}); });
}, },
content:function(){ async cost(event,trigger,player){
'step 0' event.result=await player.chooseTarget(get.prompt2('sbjijiang'),2).set('filterTarget',(card,player,target)=>{
var next=player.chooseTarget(get.prompt2('sbjijiang'),2);
next.set('filterTarget',(card,player,target)=>{
if(!ui.selected.targets.length) return target.group=='shu'&&target.hp>=player.hp&&target!=player; if(!ui.selected.targets.length) return target.group=='shu'&&target.hp>=player.hp&&target!=player;
var current=ui.selected.targets[0]; var current=ui.selected.targets[0];
return current.inRange(target); return current.inRange(target);
}); }).set('targetprompt',['进行选择','出杀对象']).set('multitarget',true).set('ai',target=>{
next.set('targetprompt',['进行选择','出杀对象']);
next.set('multitarget',true);
next.set('ai',target=>{
var player=_status.event.player; var player=_status.event.player;
if(ui.selected.targets.length){ if(ui.selected.targets.length){
var current=ui.selected.targets[0]; var current=ui.selected.targets[0];
@ -4085,25 +4080,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return -att*get.threaten(target,player); return -att*get.threaten(target,player);
} }
return curs.reduce((max,i)=>Math.max(max,get.effect(i,new lib.element.VCard({name:'sha'}),target,player)),-1); return curs.reduce((max,i)=>Math.max(max,get.effect(i,new lib.element.VCard({name:'sha'}),target,player)),-1);
}); }).forResult();
'step 1' },
if(result.bool){ async content(event,trigger,player){
var targets=result.targets; let targets=event.targets;
event.targets=targets; player.logSkill('sbjijiang',targets,false);
if(targets[0].group!='shu'||targets[0].hp<player.hp||targets[0]==player) targets.reverse(); player.line2(targets);
player.logSkill('sbjijiang',targets,false); var choiceList=[
player.line2(targets); '视为对'+get.translation(targets[1])+'使用一张【杀】',
var choiceList=[ '你的下一个出牌阶段开始前,跳过此阶段'
'视为对'+get.translation(targets[1])+'使用一张【杀】', ],result;
'你的下一个出牌阶段开始前,跳过此阶段' if(!targets[0].canUse({name:'sha',isCard:true},targets[1],false)) result={index:1};
]; else result=await targets[0].chooseControl().set('choiceList',choiceList).set('ai',()=>{
if(!targets[0].canUse({name:'sha',isCard:true},targets[1],false)) event._result={index:1}; return _status.event.choice;
else targets[0].chooseControl().set('choiceList',choiceList).set('ai',()=>{ }).set('choice',get.effect(targets[1],{name:'sha'},targets[0],targets[0])>get.effect(targets[0],{name:'lebu'},targets[0],targets[0])?0:1).forResult();
return _status.event.choice;
}).set('choice',get.effect(targets[1],{name:'sha'},targets[0],targets[0])>get.effect(targets[0],{name:'lebu'},targets[0],targets[0])?0:1);
}
else event.finish();
'step 2'
if(result.index==0){ if(result.index==0){
targets[0].useCard({name:'sha',isCard:true},targets[1],false); targets[0].useCard({name:'sha',isCard:true},targets[1],false);
} }

View File

@ -718,8 +718,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}, },
create:function(group,player){ create:function(group,player){
if(!lib.skill['starcanxi_'+group]){ const skill='starcanxi_'+group;
lib.skill['starcanxi_'+group]={ get.info('starcanxi').createSkill(skill);
if(!_status.postReconnect.starcanxi){
_status.postReconnect.starcanxi=[get.info('starcanxi').createSkill,[]];
}
_status.postReconnect.starcanxi[1].add(skill);
player.addSkill(skill);
},
createSkill(skill){
if(!lib.skill[skill]) game.broadcastAll(skill=>{
const group=skill.slice('starcanxi_'.length);
lib.skill[skill]={
mark:true, mark:true,
charlotte:true, charlotte:true,
onremove:function(player){ onremove:function(player){
@ -727,11 +737,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
intro:{content:'玉玺的一角'}, intro:{content:'玉玺的一角'},
}; };
lib.translate['starcanxi_'+group]='残玺·'+get.translation(group+'2'); lib.translate[skill]='残玺·'+get.translation(group+'2');
lib.skill['starcanxi_'+group].marktext=get.translation(group); lib.skill[skill].marktext=get.translation(group);
lib.translate['starcanxi_'+group+'_bg']=get.translation(group); lib.translate[skill+'_bg']=get.translation(group);
} },skill);
player.addSkill('starcanxi_'+group);
}, },
subSkill:{ subSkill:{
wangsheng:{ wangsheng:{