From fa9ca51be285cc3ed14c19768cfd517c80026c5e Mon Sep 17 00:00:00 2001 From: copcap Date: Sun, 14 Apr 2024 20:02:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=A5=9E=E5=8D=8E=E4=BD=97=E6=BB=A4?= =?UTF-8?q?=E5=BF=83=E6=B7=BB=E5=8A=A0AI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/extra.js | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/character/extra.js b/character/extra.js index 4b5fbdf87..aa04fe012 100755 --- a/character/extra.js +++ b/character/extra.js @@ -142,6 +142,17 @@ game.import('character', function () { usable:1, filterCard:true, filterTarget:lib.filter.notMe, + check(card){ + const round=game.roundNumber,player=get.player(); + let valueFix = 0; + if(['sha','shan'].includes(get.name(card,false))) valueFix += 3; + if(round<=2&&player.hasCard(card=>{ + return ['sha','shan'].includes(get.name(card))&&get.value(card)<=3; + })||game.hasPlayer(current=>{ + return current!==player&&get.attitude(player,current)>0; + })) return 6-get.value(card)+valueFix; + return 4.5-get.value(card)+valueFix; + }, delay:false, discard:false, lose:false, @@ -152,7 +163,9 @@ game.import('character', function () { const result = await player.chooseControl(['摸牌', '弃牌']).set('choiceList', [ `令${name}摸${get.cnNumber(round)}张牌`, `令${name}随机弃置${get.cnNumber(round)}张手牌` - ]).set('prompt', '滤心:请选择一项').forResult(); + ]).set('prompt', '滤心:请选择一项').set('ai', () => { + return get.event('choice'); + }).set('choice', get.attitude(player, target) > 0 ? '摸牌' : '弃牌').forResult(); let cards2 = []; const makeDraw = result.index === 0; if (makeDraw) { @@ -219,6 +232,21 @@ game.import('character', function () { content:'下次发动技能时失去#点体力', }, } + }, + ai:{ + order:5, + result:{ + target(player,target){ + const round=game.roundNumber; + if(round<=2&&target.countCards('h')>round*2&&player.getCards('h').some(card=>{ + return ['sha','shan'].includes(get.name(card))&&get.value(card)<=3; + })) return 1; + if(get.attitude(player,target)>0){ + return round+Math.sqrt(1+target.getDamagedHp()); + } + return -(round+Math.sqrt(Math.max(0,2-target.getHp()))); + }, + } } }, huandao:{ From d0c3b5dc665a81a978504ad9903c384ba4c8be4b Mon Sep 17 00:00:00 2001 From: copcap Date: Sun, 14 Apr 2024 20:02:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E6=9D=80=E8=83=A1=E7=8F=AD?= =?UTF-8?q?=E6=8A=80=E8=83=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/sp2.js | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/character/sp2.js b/character/sp2.js index 3dfc5136b..458c492a9 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -2817,15 +2817,30 @@ game.import('character', function () { }); return history.length&&history[history.length-1].card.name=='sha'; }, - prompt2:(event)=>'令'+get.translation(event.player)+'本回合的手牌上限+1', + prompt2(event,player){ + const target = event.player; + const history = target.getHistory('useCard', evt => { + return evt.getParent('phaseUse') === event; + }); + const evt = history.lastItem, cards = evt.cards.filterInD('d'); + let str = '令' + get.translation(target) + '本回合的手牌上限+1'; + if (cards.length) str += `,然后你获得${get.translation(cards)}`; + str += '。'; + return str; + }, check:function(event,player){ return get.attitude(player,event.player)>0; }, - content:function(){ - var target=trigger.player; + async content(event,trigger,player){ + const target = trigger.player; target.addMark('dcchongyi_keep',1,false); target.addTempSkill('dcchongyi_keep'); - game.delayx(); + const history = target.getHistory('useCard', evt => { + return evt.getParent('phaseUse') === trigger; + }); + const evt = history.lastItem, cards = evt.cards.filterInD('d'); + if (cards.length) await player.gain(cards, 'gain2'); + else await game.asyncDelayx(); }, }, sha:{ @@ -11574,7 +11589,7 @@ game.import('character', function () { xiongrao_info:'限定技。准备阶段开始时,你可以选择所有其他角色。这些角色本回合内所有不为锁定技、限定技、觉醒技的普通技能失效。然后你将体力上限增加至7点并摸X张牌(X为你以此法增加的体力上限数)。', dc_huban:'胡班', dcchongyi:'崇义', - dcchongyi_info:'①一名角色使用【杀】时,若此牌是其于当前出牌阶段内使用的第一张牌,则你可以令其摸两张牌,且其本回合使用【杀】的次数上限+1。②一名角色的出牌阶段结束时,若其于此阶段内使用的最后一张牌为【杀】,则你可以令其本回合的手牌上限+1。', + dcchongyi_info:'①一名角色使用【杀】时,若此牌是其于当前出牌阶段内使用的第一张牌,则你可以令其摸两张牌,且其本回合使用【杀】的次数上限+1。②一名角色的出牌阶段结束时,若其于此阶段内使用的最后一张牌为【杀】,则你可以令其本回合的手牌上限+1,然后你获得此【杀】。', wangwei:'王威', dcruizhan:'锐战', dcruizhan_info:'其他角色的准备阶段开始时,若其的手牌数不小于其体力值,则你可以和其拼点。若你赢或拼点牌中有【杀】,则你视为对其使用一张【杀】。然后若此【杀】造成了伤害且以上两个条件均被满足,则你获得其一张牌。',