From b9b038a589533ca05a169c089fd839822d9681d2 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Thu, 5 Oct 2023 13:47:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E6=A0=B9=E8=8A=82=E7=82=B9=E7=9A=84ev?= =?UTF-8?q?ent=E6=B7=BB=E5=8A=A0=E4=BA=8B=E4=BB=B6=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/clan.js | 14 ++++++++++---- character/gwent.js | 2 +- character/refresh.js | 19 ++++++++++--------- game/game.js | 3 +++ 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/character/clan.js b/character/clan.js index 7fe0b4bf3..295e5c038 100644 --- a/character/clan.js +++ b/character/clan.js @@ -1569,10 +1569,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var list=[],names=[]; for(var card of cards){ var name=get.name(card),nature=get.nature(card); - var namex=name+nature; - if(names.contains(namex)) continue; - if(nature.length) list.push([get.type(card),'',name,nature]); - else list.push([get.type(card),'',name]); + var namex=name; + if(nature&&nature.length){ + namex+=nature; + if(names.contains(namex)) continue; + list.push([get.type(card),'',name,nature]); + } + else{ + if(names.contains(namex)) continue; + list.push([get.type(card),'',name]); + } names.push(namex); } list.sort((a,b)=>{ diff --git a/character/gwent.js b/character/gwent.js index 2c449aae8..5c0dd04ef 100644 --- a/character/gwent.js +++ b/character/gwent.js @@ -1188,7 +1188,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 0' player.chooseTarget('覆天:弃置一名角色的一张手牌',function(card,player,target){ return target!=player&&target.countCards('h'); - }).set('ai',function(target){ + },true).set('ai',function(target){ if(target.hasSkillTag('noh')) return 0; return -get.attitude(player,target)/Math.sqrt(target.countCards('h')); }); diff --git a/character/refresh.js b/character/refresh.js index 32c860a31..2b6570733 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -349,7 +349,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var player=_status.event.player; if(!game.hasPlayer(target=>target!=player&&get.damageEffect(target,player,player,'thunder')>0)) return 0; if(player.getExpansions('rejijun').reduce(function(num,card){ - return num=card.number; + return num+get.number(card,false); },0)>36) return 1/(get.value(card)||0.5); else{ if(lib.skill.refangtong.thunderEffect(card,player)) return 10-get.value(card); @@ -367,17 +367,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var player=_status.event.player; var cards=player.getExpansions('rejijun'); if(cards.reduce(function(num,card){ - return num=card.number; + return num+get.number(card,false); },0)<=36){ - if(!ui.selected.buttons.length) return 1/button.link.number; + if(!ui.selected.buttons.length) return 1/get.number(button.link,false); return 0; } else{ var num=0,list=[]; - cards.sort((a,b)=>b.number-a.number); + cards.sort((a,b)=>get.number(b,false)-get.number(a,false)); for(var i=0;i36) break; } return list.contains(button.link)?1:0; @@ -386,7 +386,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 3' if(result.bool){ var bool=(result.links.reduce(function(num,card){ - return num=card.number; + return num+get.number(card,false); },0)>36); event.bool=bool; player.loseToDiscardpile(result.links); @@ -404,13 +404,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var cards=player.getExpansions('rejijun'),num=0; cards.push(card); if(cards.reduce(function(num,card){ - return num=card.number; + return num+get.number(card,false); },0)<=36) return false; - cards.sort((a,b)=>b.number-a.number); + cards.sort((a,b)=>get.number(b,false)-get.number(a,false)); var bool=false; for(var i=0;i36) break; } return bool; @@ -440,6 +440,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 0' var target=trigger.player; event.player=player; + event.target=target; target.chooseBool(target==player?get.prompt('rejunbing'):'是否响应'+get.translation(player)+'的【郡兵】?','摸一张牌'+(target==player?'':',将所有手牌交给'+get.translation(player)+',然后其可以交给你等量张牌')).set('choice',get.attitude(target,player)>0); 'step 1' if(result.bool){ diff --git a/game/game.js b/game/game.js index 8ec119e4e..e4939da4d 100644 --- a/game/game.js +++ b/game/game.js @@ -8079,6 +8079,9 @@ lib.ui=ui; lib.ai=ai; lib.game=game; + for(let i in lib.element.event){ + _status.event[i]=lib.element.event[i]; + } HTMLDivElement.prototype.animate=function(name,time){ var that;