优化useCard,chooseUseTarget

This commit is contained in:
MDYY1 2023-10-01 09:28:39 +08:00
parent 1020ece0f1
commit 56eb2e02dd
1 changed files with 11 additions and 9 deletions

View File

@ -13141,12 +13141,8 @@
var range; var range;
if(!info.notarget){ if(!info.notarget){
var select=get.copy(info.selectTarget); var select=get.copy(info.selectTarget);
if(select==undefined){ range=get.select(select);
range=[1,1]; if(event.selectTarget) range=get.select(event.selectTarget);
}
else if(typeof select=='number') range=[select,select];
else if(get.itemtype(select)=='select') range=select;
else if(typeof select=='function') range=select(card,player);
game.checkMod(card,player,range,'selectTarget',player); game.checkMod(card,player,range,'selectTarget',player);
} }
if(info.notarget||range[1]<=-1){ if(info.notarget||range[1]<=-1){
@ -17830,9 +17826,9 @@
} }
} }
event.id=get.id(); event.id=get.id();
event.excluded=[]; if(!Array.isArray(event.excluded)) event.excluded=[];
event.directHit=[]; if(!Array.isArray(event.excluded)) event.directHit=[];
event.customArgs={default:{}}; if(typeof event.customArgs!='object'||typeof event.customArgs.default!='object') event.customArgs={default:{}};
if(typeof event.baseDamage!='number') event.baseDamage=get.info(card,false).baseDamage||1; if(typeof event.baseDamage!='number') event.baseDamage=get.info(card,false).baseDamage||1;
if(typeof event.effectCount!='number') event.effectCount=get.info(card,false).effectCount||1; if(typeof event.effectCount!='number') event.effectCount=get.info(card,false).effectCount||1;
event.effectedCount=0; event.effectedCount=0;
@ -23407,6 +23403,12 @@
else if(get.itemtype(arguments[i])=='player'){ else if(get.itemtype(arguments[i])=='player'){
next.targets=[arguments[i]]; next.targets=[arguments[i]];
} }
else if(get.itemtype(arguments[i])=='select'){
next.selectTarget=arguments[i];
}
else if(typeof arguments[i]=='number'){
next.selectTarget=[arguments[i],arguments[i]];
}
else if(get.is.object(arguments[i])&&arguments[i].name){ else if(get.is.object(arguments[i])&&arguments[i].name){
next.card=arguments[i]; next.card=arguments[i];
} }