bug修复

This commit is contained in:
copcap 2024-02-28 11:47:47 +08:00
parent eeac0ae2c6
commit 435d827958
No known key found for this signature in database
GPG Key ID: 30E7AB6699451AEE
2 changed files with 12 additions and 5 deletions

View File

@ -2031,7 +2031,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter(event,player){ filter(event,player){
if(!player.hasZhuSkill('twniju')) return false; if(!player.hasZhuSkill('twniju')) return false;
if(event.iwhile||(event.target&&event.compareMeanwhile)) return false; if(event.iwhile||(event.target&&event.compareMeanwhile)) return false;
return true; const participant=[event.player];
if(event.targets) participant.addArray(event.targets);
else participant.add(event.target);
return participant.includes(player);
}, },
direct:true, direct:true,
async content(event,trigger,player){ async content(event,trigger,player){

View File

@ -119,7 +119,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2, audio:2,
trigger:{global:'damageEnd'}, trigger:{global:'damageEnd'},
filter(event,player){ filter(event,player){
return event.source&&event.source!=player&&event.player.isIn(); if(!event.player.isIn()||(event.player!==player&&!player.inRange(event.player))) return false;
return event.source&&event.source!=player;
}, },
check(event,player){ check(event,player){
if(!event.source.isIn()||!event.card||typeof get.number(event.card)!=='number') return 0; if(!event.source.isIn()||!event.card||typeof get.number(event.card)!=='number') return 0;
@ -128,12 +129,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
logTarget:'player', logTarget:'player',
async content(event,trigger,player){ async content(event,trigger,player){
player.judge(card=>{ player.judge(card=>{
const evt=get.event().getParent().getTrigger(); const evt=get.event().getParent(get.event('eventName')).getTrigger();
if(!evt.source.isIn()||!evt.card||typeof get.number(evt.card)!=='number') return 0; if(!evt.source.isIn()||!evt.card||typeof get.number(evt.card)!=='number') return 0;
if(get.number(card)>get.number(evt.card)) return 1.5; if(get.number(card)>get.number(evt.card)) return 1.5;
return 0; return 0;
}).set('judge2',r=>r.bool).set('callback',()=>{ }).set('judge2',r=>r.bool).set('callback',()=>{
const evt=event.getParent(2).getTrigger(); const evtx=event.getParent();
const evt=event.getParent(evtx.eventName).getTrigger();
if(!evt.source.isIn()||!evt.card||typeof get.number(evt.card)!=='number') return; if(!evt.source.isIn()||!evt.card||typeof get.number(evt.card)!=='number') return;
if(event.judgeResult.number>get.number(evt.card)){ if(event.judgeResult.number>get.number(evt.card)){
const sha=new lib.element.VCard({name:'sha'}),target=evt.source; const sha=new lib.element.VCard({name:'sha'}),target=evt.source;
@ -142,6 +144,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
} }
}) })
.set('eventName',event.name)
} }
}, },
dcanjing:{ dcanjing:{
@ -151,6 +154,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return game.hasPlayer(current=>current.isDamaged()); return game.hasPlayer(current=>current.isDamaged());
}, },
usable:1, usable:1,
direct:true,
async content(event,trigger,player){ async content(event,trigger,player){
const maxCount=player.getAllHistory('useSkill',evt=>evt.skill==='dcanjing').length+1; const maxCount=player.getAllHistory('useSkill',evt=>evt.skill==='dcanjing').length+1;
const result=await player.chooseTarget(get.prompt2('dcanjing'),(card,player,target)=>target.isDamaged(),[1,maxCount]) const result=await player.chooseTarget(get.prompt2('dcanjing'),(card,player,target)=>target.isDamaged(),[1,maxCount])
@ -158,7 +162,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return get.attitude(get.player(),target)>0; return get.attitude(get.player(),target)>0;
}) })
.forResult(); .forResult();
if(!result.bool) return; if(!result.bool) return player.storage.counttrigger.dcanjing--;
const targets=result.targets.slice(); const targets=result.targets.slice();
targets.sortBySeat(_status.currentPhase); targets.sortBySeat(_status.currentPhase);
player.logSkill('dcanjing',targets); player.logSkill('dcanjing',targets);