From e18250c81e3c565f39b1c04d44977599105a0d23 Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Wed, 31 Jan 2024 14:16:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=80=E4=BA=9Bai=EF=BC=8C?= =?UTF-8?q?=E4=B8=B4=E6=97=B6=E4=BF=9D=E8=AF=81value=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=9C=89=E6=95=88=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/ddd.js | 5 ++++- character/offline.js | 1 + character/sp.js | 3 +++ noname/get/index.js | 30 ++++++++++++++---------------- noname/library/element/player.js | 2 +- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/character/ddd.js b/character/ddd.js index cd6c20e47..a09538823 100644 --- a/character/ddd.js +++ b/character/ddd.js @@ -4372,7 +4372,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ prompt:(event)=>('是否将【兵粮寸断】转移给'+get.translation(event.player)+'?'), check(event,player){ return player.hasCard(card=>{ - return (card.viewAs||card.name)=='bingliang'&&event.player.canAddJudge(card)&&get.effect(event.player,card,player,player)>=0; + return (card.viewAs||card.name)=='bingliang'&&event.player.canAddJudge(card)&&get.effect(event.player,new lib.element.VCard({ + name:'bingliang', + cards:[card] + }),player,_status.event.player)>=0; },'j'); }, content(){ diff --git a/character/offline.js b/character/offline.js index bb204584c..1ea02e19e 100644 --- a/character/offline.js +++ b/character/offline.js @@ -4437,6 +4437,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var target=result.targets[0]; event.target=target; player.logSkill('nsfeixiong',target); + if(get.mode()!=='identity'||player.identity!=='nei') player.addExpose(0.2); player.chooseToCompare(target); } else event.finish(); diff --git a/character/sp.js b/character/sp.js index e6838f237..65d36b887 100755 --- a/character/sp.js +++ b/character/sp.js @@ -10770,6 +10770,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 2' if(result.bool){ target.line(player); + if(player!==target&&(get.mode()!=='identity'||target.identity!=='nei')) target.addExpose(0.15); player.draw(); } if(num} 迭代器 */ static *iterableChildNodes(node){ @@ -4093,8 +4093,6 @@ export class Get extends Uninstantable { if (aii && aii.value) value = aii.value; else if (aii && aii.basic) value = aii.basic.value; if (player == undefined || get.itemtype(player) != 'player') player = _status.event.player; - let cache = CacheContext.requireCacheContext(); - player = cache.delegate(player); var geti = function () { return player.getCardIndex('hs',card.name,card,5); }; @@ -4105,7 +4103,7 @@ export class Get extends Uninstantable { if (Array.isArray(value)) { if (method == 'raw') result = value[0]; var num = geti(); - if (num < value.length) result = value[num]; + if (num < value.length) result = value[Math.max(0,num)]; else result = value[value.length - 1]; } result = game.checkMod(player, card, result, 'aiValue', player); @@ -4186,10 +4184,10 @@ export class Get extends Uninstantable { if (order == undefined) return -1; var num = order; if (typeof (order) == 'function') { - num = order(item, cache.delegate(_status.event.player)); + num = order(item, _status.event.player); } if (typeof item == 'object' && _status.event.player) { - var player = cache.delegate(_status.event.player); + var player = _status.event.player; num = game.checkMod(player, item, num, 'aiOrder', player); } return num; diff --git a/noname/library/element/player.js b/noname/library/element/player.js index 289aa2f29..e3997f085 100644 --- a/noname/library/element/player.js +++ b/noname/library/element/player.js @@ -6945,7 +6945,7 @@ export class Player extends HTMLDivElement { cache = new CacheContext(); } for (var i = 0; i < targets.length; i++) { - if (cache.delegate(player).canUse(card, targets[i], distance, includecard)) { + if (player.canUse(card, targets[i], distance, includecard)) { var eff = cache.get.effect(targets[i], card, player, player); value.push(eff); }