From 00cfb844ef465deef6454eddc0a72cb93f8a7d4d Mon Sep 17 00:00:00 2001 From: copcap Date: Sun, 16 Jul 2023 18:03:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/collab.js | 8 +++++++ character/offline.js | 6 ++++- character/refresh.js | 3 ++- character/sb.js | 17 +++++++++---- character/sp2.js | 57 ++++++++++++++++++++++++++++++++++---------- character/tw.js | 26 ++++++++++++++++---- 6 files changed, 93 insertions(+), 24 deletions(-) diff --git a/character/collab.js b/character/collab.js index 1d8fc8c02..6e8431610 100644 --- a/character/collab.js +++ b/character/collab.js @@ -932,6 +932,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.line(target,'thunder'); target.damage('thunder'); }, + ai:{ + effect:{ + player:function(card,player,target){ + if(ui.selected.targets.length) return; + if(player!=target&&get.type2(card)=='trick') return [1,0,1,-2]; + }, + }, + }, subSkill:{ add:{ audio:'dcnutao', diff --git a/character/offline.js b/character/offline.js index 36c5b10f9..26cb0a5e8 100644 --- a/character/offline.js +++ b/character/offline.js @@ -1854,7 +1854,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ target:function(card,player,target){ if(get.tag(card,'damage')){ if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; - if(!target.canMoveCard(true)||!target.hasFriend()) return; + if(target._jsrgrangjie_aiChecking) return; + target._jsrgrangjie_aiChecking=true; + var moveCard=target.canMoveCard(true); + delete target._jsrgrangjie_aiChecking; + if(!moveCard||!target.hasFriend()) return; var num=1; if(get.attitude(player,target)>0){ if(player.needsToDiscard()){ diff --git a/character/refresh.js b/character/refresh.js index 57fba1f8e..a6a2bb003 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -166,7 +166,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, enable:'phaseUse', filter:function(event,player){ - return player.countCards('h',{type:'equip'})>0; + return player.countCards('he',{type:'equip'})>0; }, filterCard:function(card){ return get.type(card)=='equip'; @@ -277,6 +277,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(typeof result.links[0]!='string') result.links.reverse(); var card=result.links[1]; target.gain(card,'gain2'); + event.cards.remove(card); if(result.links[0]!='获得剩余的牌') event.finish(); } else event.finish(); diff --git a/character/sb.js b/character/sb.js index 20056fcc9..d411b2769 100644 --- a/character/sb.js +++ b/character/sb.js @@ -725,6 +725,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(targets[i].hp==1){ eff*=1.5; } + if(get.attitude(player,targets[i])==0||targets[i].group=='qun'){ + eff+=0.5; + } num+=eff; } if(!player.needsToDiscard(-1)){ @@ -766,6 +769,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return num+2*game.countPlayer(current=>player!=current&¤t.group=='qun'); } } + }, + ai:{ + effect:{ + player:function(card,player,target){ + if(player!=target&&target&&target.group=='qun') return [1,0.2]; + }, + }, } }, //庞统 @@ -1614,13 +1624,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var player=_status.event.player; if(ui.selected.targets.length){ var current=ui.selected.targets[0]; - if(current.group=='shu'&¤t.hp>=player.hp){ + if(current.group=='shu'&¤t.hp>=player.hp&¤t!=player){ return -get.attitude(player,target); } return Math.abs(get.attitude(player,current)); } else{ - if(target.group=='shu'&&target.hp>=player.hp&&game.hasPlayer(current=>{ + if(target.group=='shu'&&target.hp>=player.hp&&target!=player&&game.hasPlayer(current=>{ return get.attitude(player,current)<0; })) return 10; return 1; @@ -1630,7 +1640,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(result.bool){ var targets=result.targets; event.targets=targets; - if(targets[0].group!='shu'||targets[0].hp'; - player.chooseControl(choice).set('choiceList',choiceList).set('prompt','淑慎:请选择一项').set('ai',()=>{ + player.chooseControl(choices).set('choiceList',choiceList).set('prompt','淑慎:请选择一项').set('ai',()=>{ return _status.event.choice; }).set('choice',function(){ if(target.hp<=2||get.recoverEffect(target,player,player)>20) return 0; @@ -7743,9 +7769,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, filter:function(event,player){ if(player==_status.currentPhase) return false; - return !player.hasHistory('damage',evt=>{ + return !event.nature&&!player.hasHistory('damage',evt=>{ return !evt.nature&&evt!=event; - },event)||!player.hasHistory('damage',evt=>{ + },event)||event.nature&&!player.hasHistory('damage',evt=>{ return evt.nature&&evt!=event; },event)&&event.source&&event.source.isIn()&&event.source.countGainableCards(player,'h'); }, @@ -13643,7 +13669,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(evtx.getParent('phaseUse')!=evt) return false; return !evtx.card.storage||!evtx.card.storage.tongli; }).length; - var str='视为额外使用'+get.cnNumber(num)+'张' + //var str='视为额外使用'+get.cnNumber(num)+'张' + var str='额外结算'+get.cnNumber(num)+'次' if(event.card.name=='sha'&&event.card.nature) str+=get.translation(event.card.nature); return (str+'【'+get.translation(event.card.name)+'】'); }, @@ -28419,13 +28446,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, "xinfu_bijing":{ audio:2, - group:["xinfu_bijing_lose","xinfu_bijing_discard"], subSkill:{ lose:{ trigger:{ global:"phaseDiscardBegin", }, audio:'xinfu_bijing', + charlotte:true, filter:function(event,player){ if(event.player==player) return false; return player.getHistory('lose',function(evt){ @@ -28446,6 +28473,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player:"phaseZhunbeiBegin", }, forced:true, + charlotte:true, filter:function(event,player){ return player.getCards('h',function(card){ return card.hasGaintag('xinfu_bijing'); @@ -28478,6 +28506,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(result.bool){ player.logSkill('xinfu_bijing'); player.addGaintag(result.cards,'xinfu_bijing'); + player.addSkill('xinfu_bijing_lose'); + player.addSkill('xinfu_bijing_discard'); } }, }, @@ -29626,7 +29656,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "xinfu_tunan":"图南", "xinfu_tunan_info":"出牌阶段限一次,你可以展示牌堆顶的一张牌并选择一名其他角色,然后该角色选择一项:使用此牌(无距离限制);或将此牌当普通【杀】使用。", "xinfu_bijing":"闭境", - "xinfu_bijing_info":"①结束阶段,你可以选择至多两张手牌并标记为“闭境”。②其他角色的弃牌阶段开始时,若你于本回合内失去过“闭境”,其弃置两张牌。③准备阶段,你重铸所有“闭境”牌。", + "xinfu_bijing_info":"结束阶段,你可以选择至多两张手牌并标记为“闭境”,然后你获得如下效果:1.其他角色的弃牌阶段开始时,若你于本回合内失去过“闭境”,其弃置两张牌;2.准备阶段,你重铸所有“闭境”牌。", "xinfu_zhenxing":"镇行", "xinfu_zhenxing_info":"结束阶段开始时或当你受到伤害后,你可以观看牌堆顶的至多三张牌,然后你获得其中与其余牌花色均不相同的一张牌。", "xinfu_qianxin":"遣信", @@ -30366,7 +30396,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dcmingfa_info:'①出牌阶段限一次。当你使用【杀】或普通锦囊牌结算结束后,若你的武将牌上没有“明伐”牌,则你可以将此牌作为“明伐”牌置于武将牌上并选择一名其他角色,记录该角色和此牌的名称。②一名角色的回合结束时,若其是你〖明伐①〗记录的角色,则你视为对其依次使用X张〖明伐①〗记录的牌,然后移去“明伐”牌(X为其手牌数且至少为1,至多为5)。③一名角色死亡时,若其是你〖明伐①〗记录的角色,则你移去“明伐”牌。', zhangxuan:'张嫙', tongli:'同礼', - tongli_info:'当你于出牌阶段内不因〖同礼〗而使用基本牌或普通锦囊牌指定第一个目标后,若你手牌中的花色数和你于本阶段内不因〖同礼〗而使用过的牌数相等,则你可以于此牌结算结束后依次视为对此牌的所有目标使用X张名称和属性相同的牌(X为你手牌中的花色数)。', + //tongli_info:'当你于出牌阶段内不因〖同礼〗而使用基本牌或普通锦囊牌指定第一个目标后,若你手牌中的花色数和你于本阶段内不因〖同礼〗而使用过的牌数相等,则你可以于此牌结算结束后依次视为对此牌的所有目标使用X张名称和属性相同的牌(X为你手牌中的花色数)。', + tongli_info:'当你于出牌阶段内使用基本牌或普通锦囊牌指定第一个目标后,若你手牌中的花色数和你于本阶段内使用过的牌数相等,则你可以令此牌额外结算X次(X为你手牌中的花色数)。', shezang:'奢葬', shezang_info:'每轮限一次。当你或你回合内的其他角色进入濒死状态时,你可以从牌堆中获得每种花色的牌各一张。', qinyilu:'秦宜禄', diff --git a/character/tw.js b/character/tw.js index e5e04609b..01847359d 100644 --- a/character/tw.js +++ b/character/tw.js @@ -405,9 +405,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ direct:true, content:function(){ 'step 0' - var count=game.countPlayer(current=>{ + var count=get.cnNumber(game.countPlayer(current=>{ return get.distance(player,current)<=1; - }); + })); player.chooseTarget(get.prompt('twzhiqu'),'选择一名其他角色并视为使用牌堆顶'+count+'张牌中的【杀】。若你与其均在对方的攻击范围内,你改为依次对其使用牌堆顶'+count+'张牌中的【杀】或锦囊牌。',lib.filter.notMe).set('ai',target=>{ var player=_status.event.player; return get.effect(target,{name:'sha'},player,player)*(get.distance(player,target)==1?2:1); @@ -427,8 +427,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 2' if(player.isIn()&&target.isIn()&&cards.length){ do var card=cards.shift(); - while(get.name(card)=='sha'||event.fight&&get.type2(card)=='trick'); - if(!card) return; + while(get.name(card)!='sha'&&(!event.fight||get.type2(card)!='trick')&&cards.length); + if(get.name(card)!='sha'&&(!event.fight||get.type2(card)!='trick')) return; player.chooseUseTarget(card,true,false,'nodistance').set('filterTarget',function(card,player,target){ var evt=_status.event; if(_status.event.name=='chooseTarget') evt=evt.getParent(); @@ -448,6 +448,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return event.card.name=='sha'||get.type(event.card)=='trick'&&get.tag(event.card,'damage'); }, logTarget:'player', + check:function(event,player){ + var att=get.attitude(event.player,player); + if(player.hasSkill('twzhiqu')){ + var cnt=game.countPlayer(current=>get.distance(player,current)==2&&!player.inRange(current)); + if(cnt>=2){ + if(att<0) return true; + return false; + } + if(att<0&&cnt>=2||att>0&&!cnt) return true; + return false; + } + else{ + if(att<0) return false; + return true; + } + }, content:function(){ 'step 0' var target=trigger.player; @@ -461,7 +477,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var att=get.attitude(target,player); if(att==0) return 0; if(player.hasSkill('twzhiqu')){ - var cnt=game.countPlayer(current=>get.distance(player,current)==2); + var cnt=game.countPlayer(current=>get.distance(player,current)==2&&!player.inRange(current)); if(cnt>=2){ if(att<0) return 1; return 0;