From cb48e902f48ef45bbbbee094949584df82aa729e Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Mon, 29 Jan 2024 14:35:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=A4=E4=B8=AA=E3=80=90?= =?UTF-8?q?=E5=82=AC=E8=BF=9B=E3=80=91ai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/huicui.js | 21 +-------------------- character/tw.js | 46 +++++++++++++++++++++++++-------------------- 2 files changed, 27 insertions(+), 40 deletions(-) diff --git a/character/huicui.js b/character/huicui.js index c70fb88f0..2e9bb500f 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -4843,26 +4843,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.chooseToDiscard('he',get.prompt('dccuijin',target),'弃置一张牌并令'+get.translation(trigger.player)+'使用的【杀】伤害+1,但若其未造成伤害,则你摸一张牌并对其造成1点伤害。').set('ai',function(card){ if(_status.event.goon) return 7-get.value(card); return 0; - }).set('goon',function(){ - var d1=true; - if(trigger.player.hasSkill('jueqing')||trigger.player.hasSkill('gangzhi')) d1=false - for(var target of trigger.targets){ - if(!target.mayHaveShan(player,'use',target.getCards(i=>{ - return i.hasGaintag('sha_notshan'); - }))||trigger.player.hasSkillTag('directHit_ai',true,{ - target:target, - card:trigger.card, - },true)){ - if(!target.hasSkill('gangzhi')) d1=false; - if(!target.hasSkillTag('filterDamage',null,{ - player:trigger.player, - card:trigger.card, - })&&get.attitude(player,target)<0) return true; - } - } - if(d1) return get.damageEffect(trigger.player,player,player)>0; - return false; - }()).logSkill=['dccuijin',target]; + }).set('goon',lib.skill.cuijin.checkx(trigger,player)).logSkill=['dccuijin',target]; 'step 1' if(result.bool){ if(typeof trigger.baseDamage!='number') trigger.baseDamage=1; diff --git a/character/tw.js b/character/tw.js index 7937f6deb..8ae68a048 100644 --- a/character/tw.js +++ b/character/tw.js @@ -13986,6 +13986,31 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ return event.card.name=='sha'&&(event.player==player||player.inRange(event.player))&&player.countCards('he')>0; }, + checkx(event,player){ + let d1=true,e=false; + if(event.player.hasSkill('jueqing')||event.player.hasSkill('gangzhi')) d1=false; + for(let tar of event.targets){ + if(!tar.mayHaveShan(player,'use',tar.getCards('h',i=>{ + return i.hasGaintag('sha_notshan'); + }))||event.player.hasSkillTag('directHit_ai',true,{ + target:tar, + card:event.card, + },true)){ + if(!tar.hasSkill('gangzhi')) d1=false; + if(!tar.hasSkillTag('filterDamage',null,{ + player:event.player, + card:event.card, + })){ + let att=get.attitude(_status.event.player,tar); + if(att>0) return false; + if(att<0) e=true; + } + } + } + if(e) return true; + if(d1) return get.damageEffect(event.player,player,_status.event.player)>0; + return false; + }, content:function(){ 'step 0' if(player!=game.me&&!player.isOnline()) game.delayx(); @@ -13994,26 +14019,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.chooseToDiscard('he',get.prompt('cuijin',target),'弃置一张牌并令'+get.translation(trigger.player)+'使用的【杀】伤害+1,但若其未造成伤害,则你对其造成1点伤害。').set('ai',function(card){ if(_status.event.goon) return 7-get.value(card); return 0; - }).set('goon',function(){ - var d1=true; - if(trigger.player.hasSkill('jueqing')||trigger.player.hasSkill('gangzhi')) d1=false - for(var target of trigger.targets){ - if(!target.mayHaveShan(player,'use',target.getCards(i=>{ - return i.hasGaintag('sha_notshan'); - }))||trigger.player.hasSkillTag('directHit_ai',true,{ - target:target, - card:trigger.card, - },true)){ - if(!target.hasSkill('gangzhi')) d1=false; - if(!target.hasSkillTag('filterDamage',null,{ - player:trigger.player, - card:trigger.card, - })&&get.attitude(player,target)<0) return true; - } - } - if(d1) return get.damageEffect(trigger.player,player,player)>0; - return false; - }()).logSkill=['cuijin',target]; + }).set('goon',lib.skill.cuijin.checkx(trigger,player)).logSkill=['cuijin',target]; 'step 1' if(result.bool){ if(typeof trigger.baseDamage!='number') trigger.baseDamage=1;