Merge pull request #385 from mengxinzxz/PR-Branch

bugfix
This commit is contained in:
Spmario233 2023-09-25 17:28:33 +08:00 committed by GitHub
commit d8e77a8aa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 72 additions and 101 deletions

View File

@ -339,7 +339,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var storage=player.storage.clanjiexuan; var storage=player.storage.clanjiexuan;
var name=(storage||0)%2?'guohe':'shunshou'; var name=(storage||0)%2?'guohe':'shunshou';
var fix=player.hasSkill('clanzhongliu')&&get.position(card)!='h'?2:1; var fix=player.hasSkill('clanzhongliu')&&get.position(card)!='h'?2:1;
return get.value({name:name},player)-get.value(card)+fix; return (get.value({name:name},player)-get.value(card))*fix;
}, },
position:'hes', position:'hes',
filterCard:function(card,player){ filterCard:function(card,player){
@ -347,7 +347,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return get.color(card)==((storage||0)%2?'black':'red'); return get.color(card)==((storage||0)%2?'black':'red');
}, },
prompt:function(){ prompt:function(){
if(_status.event.player.storage.clanjiexuan) return '将一张黑色牌当【过河拆桥】使用'; var storage=_status.event.player.storage.clanjiexuan;
if((storage||0)%2) return '将一张黑色牌当【过河拆桥】使用';
return '将一张红色牌当【顺手牵羊】使用'; return '将一张红色牌当【顺手牵羊】使用';
}, },
skillAnimation:true, skillAnimation:true,
@ -370,10 +371,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
}, },
clanmingjie:{ clanmingjie:{
init:function(player){
player.addSkill('clanmingjie_record');
},
onremove:function(player){
player.removeSkill('clanmingjie_record');
},
audio:2, audio:2,
enable:'phaseUse', enable:'phaseUse',
limited:true, limited:true,
filterTarget:true, filterTarget:function(card,player,target){
return !player.getStorage('clanmingjie_effect').contains(target);
},
skillAnimation:true, skillAnimation:true,
animationColor:'thunder', animationColor:'thunder',
content:function(){ content:function(){
@ -381,8 +390,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.awakenSkill('clanmingjie'); player.awakenSkill('clanmingjie');
player.addSkill('clanmingjie_effect'); player.addSkill('clanmingjie_effect');
player.markAuto('clanmingjie_effect',[target]); player.markAuto('clanmingjie_effect',[target]);
target.addTempSkill('clanmingjie_targeted',{player:'phaseAfter'}); target.addSkill('clanmingjie_mark');
target.markAuto('clanmingjie_targeted',[player]); target.markAuto('clanmingjie_mark',[player]);
}, },
ai:{ ai:{
order:10, order:10,
@ -415,138 +424,98 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
subSkill:{ subSkill:{
effect:{ effect:{
trigger:{player:'useCard2'},
charlotte:true, charlotte:true,
audio:'clanmingjie',
trigger:{player:'useCard2'},
filter:function(event,player){ filter:function(event,player){
var card=event.card; var card=event.card;
var info=get.info(card); var info=get.info(card);
if(info.allowMultiple==false) return false; if(info.allowMultiple==false) return false;
if(event.targets&&!info.multitarget){ if(event.targets&&!info.multitarget){
if(player.getStorage('clanmingjie_effect').some(current=>{ return player.getStorage('clanmingjie_effect').some(current=>{
return current.isIn()&&!event.targets.contains(current)&&lib.filter.targetEnabled2(card,player,current); return current.isIn()&&!event.targets.contains(current)&&lib.filter.targetEnabled2(card,player,current)&&lib.filter.targetInRange(card,player,current);
})){ });
return true;
}
} }
return false; return false;
}, },
prompt:'是否发动【铭戒】?', direct:true,
prompt2:function(event,player){
var list=player.getStorage('clanmingjie_effect').filter(target=>{
if(event.targets.contains(target)||!target.isIn()) return false;
return lib.filter.targetEnabled2(event.card,player,target);
});
return '令'+get.translation(list)+'也成为'+get.translation(event.card)+'的目标';
},
logTarget:function(event,player){
return player.getStorage('clanmingjie_effect').filter(target=>{
if(event.targets.contains(target)||!target.isIn()) return false;
return lib.filter.targetEnabled2(event.card,player,target);
});
},
check:function(event,player){
var eff=0;
var list=player.getStorage('clanmingjie_effect').filter(target=>{
if(event.targets.contains(target)||!target.isIn()) return false;
return lib.filter.targetEnabled2(event.card,player,target);
});
for(var i of list) eff+=get.effect(i,event.card,player,player);
return eff>0;
},
content:function(){ content:function(){
var list=player.getStorage('clanmingjie_effect').filter(target=>{ 'step 0'
if(trigger.targets.contains(target)||!target.isIn()) return false; player.chooseTarget(get.prompt('clanmingjie_effect'),'令任意【铭戒】目标角色成为'+get.translation(trigger.card)+'的目标',function(card,player,target){
return lib.filter.targetEnabled2(trigger.card,player,target); var trigger=_status.event.getTrigger();
if(trigger.targets.contains(target)||!target.isIn()||!player.getStorage('clanmingjie_effect').contains(target)) return false;
return lib.filter.targetEnabled2(trigger.card,player,target)&&lib.filter.targetInRange(trigger.card,player,target);
},[1,Infinity]).set('ai',function(target){
var player=_status.event.player;
var trigger=_status.event.getTrigger();
return get.effect(target,trigger.card,player,player);
}); });
if(list.length>0){ 'step 1'
trigger.targets.addArray(list); if(result.bool){
game.log(list,'也成为了',trigger.card,'的目标'); var targets=result.targets.sortBySeat();
player.logSkill('clanmingjie_effect',targets);
trigger.targets.addArray(targets);
game.log(targets,'成为了',trigger.card,'的额外目标');
} }
}, },
intro:{ group:'clanmingjie_targeted',
content:'使用牌时可以额外指定$为目标', intro:{content:'使用牌时可以额外指定$为目标'},
},
ai:{
effect:{
player:function(card,player,target){
if(_status.event.getParent('useCard',true)||_status.event.getParent('_wuxie',true)) return;
if(player.getStorage('clanmingjie_effect').contains(target)) return [1,-0.5];
},
},
},
}, },
targeted:{ targeted:{
trigger:{ charlotte:true,
player:'phaseEnd', trigger:{global:'phaseEnd'},
},
filter:function(event,player){ filter:function(event,player){
return player.getStorage('clanmingjie_targeted').length; if(!player.getStorage('clanmingjie_effect').contains(event.player)) return false;
return event.player!=player||!player.getHistory('useSkill',evt=>evt.skill=='clanmingjie'&&evt.targets[0]==player).length;
}, },
forced:true, forced:true,
popup:false, popup:false,
onremove:['clanmingjie_targeted','clanmingjie_record'],
charlotte:true,
group:'clanmingjie_record',
content:function(){ content:function(){
'step 0' 'step 0'
var targets=player.getStorage('clanmingjie_targeted').slice(); var cards=player.getStorage('clanmingjie_record').slice();
targets.sortBySeat();
event.targets=targets;
event.targetsx=targets.slice();
var cards=[];
var list=player.getStorage('clanmingjie_record');
if(list.length){
cards.addArray(list);
}
cards=cards.filterInD('d'); cards=cards.filterInD('d');
if(cards.length){ if(cards.length){
event.cards=cards; event.cards=cards;
} }
else event.goto(6); else event.goto(4);
'step 1' 'step 1'
event.target=targets.shift(); player.chooseButton(['铭戒:是否使用这些牌?',cards]).set('filterButton',button=>{
event.cards2=cards.filterInD('d');
'step 2'
target.chooseButton(['铭戒:是否使用这些牌?',event.cards2]).set('filterButton',button=>{
return _status.event.player.hasUseTarget(button.link); return _status.event.player.hasUseTarget(button.link);
}).set('ai',button=>{ }).set('ai',button=>{
return _status.event.player.getUseValue(button.link); return _status.event.player.getUseValue(button.link);
}); });
'step 3' 'step 2'
if(result.bool){ if(result.bool){
var card=result.links[0]; var card=result.links[0];
event.cards2.remove(card); event.cards.remove(card);
target.$gain2(card,false); player.$gain2(card,false);
game.delayx(); game.delayx();
target.chooseUseTarget(card,true); player.chooseUseTarget(card,true);
} }
else event.goto(5); else event.goto(4);
'step 3'
if(event.cards.filter(card=>{
return get.position(card,true)=='d'&&player.hasUseTarget(card);
}).length) event.goto(1);
'step 4' 'step 4'
if(event.cards2.filter(card=>{ player.unmarkAuto('clanmingjie_effect',[trigger.player]);
return get.position(card,true)=='d'&&target.hasUseTarget(card); trigger.player.unmarkAuto('clanmingjie_mark',[player]);
}).length) event.goto(2);
'step 5' 'step 5'
if(targets.length) event.goto(1); if(!player.getStorage('clanmingjie_effect').length) player.removeSkill('clanmingjie_effect');
'step 6' if(!trigger.player.getStorage('clanmingjie_mark').length) player.removeSkill('clanmingjie_mark');
event.targetsx.forEach(target=>{
target.unmarkAuto('clanmingjie_effect',[player]);
});
player.removeSkill('clanmingjie_targeted');
}, },
},
mark:{
charlotte:true,
marktext:'戒', marktext:'戒',
intro:{ intro:{content:'已被$指定为【铭戒】目标'},
content:'已被$指定为〖铭戒〗目标',
},
}, },
record:{ record:{
charlotte:true,
trigger:{ trigger:{
global:['shaMiss','eventNeutralized','useCard1','phaseAfter'], global:['shaMiss','eventNeutralized','useCard1','phaseAfter'],
}, },
silent:true,
forced:true,
charlotte:true,
filter:function(event,player){ filter:function(event,player){
if(_status.currentPhase!=player) return false;
if(event.name=='useCard'){ if(event.name=='useCard'){
return get.suit(event.card)=='spade'; return get.suit(event.card)=='spade';
} }
@ -554,6 +523,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(event.type!='card') return false; if(event.type!='card') return false;
return true; return true;
}, },
silent:true,
forced:true,
content:function(){ content:function(){
'step 0' 'step 0'
if(trigger.name=='phase'){ if(trigger.name=='phase'){
@ -562,10 +533,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
player.markAuto('clanmingjie_record',trigger.cards); player.markAuto('clanmingjie_record',trigger.cards);
} }
} },
} }
}, },
//钟琰族钟琰 //族钟琰
clanguangu:{ clanguangu:{
audio:2, audio:2,
enable:'phaseUse', enable:'phaseUse',

View File

@ -469,12 +469,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
case -1: case -1:
var num=Math.ceil(cards.length/2)+(cards.length%2==0?1:0); var num=Math.ceil(cards.length/2)+(cards.length%2==0?1:0);
if(num>1&&player.hasSkill('twchungang')) num--; if(num>1&&player.hasSkill('twchungang')) num--;
if(get.damageEffect(target,player,player)<=0||num>2||cardy.length>cardx.length) return [cardx,cardy]; if(get.damageEffect(target,player,player)<=0||num>2||cardx.length>cardy.length) return [cardx,cardy];
var num2=cardx.length-cardy.length; var num2=cardy.length-cardx.length;
num2=Math.ceil(num2/2)+(num2%2==0?1:0); num2=Math.ceil(num2/2)+(num2%2==0?1:0);
cardx.sort((a,b)=>get.value(b)-get.value(a)); cardy.sort((a,b)=>get.value(b)-get.value(a));
cardy.addArray(cardx.sort(num,cardx.length)); cardx.addArray(cardy.slice(num,cardy.length));
return [cardx.sort(0,num),cardy]; return [cardx,cardy.slice(0,num)];
break; break;
} }
}).set('cards',cards); }).set('cards',cards);