From 5a20089ca5684f33db3c7148efe07c4ace6964c8 Mon Sep 17 00:00:00 2001 From: Tipx-L <138244655+Tipx-L@users.noreply.github.com> Date: Tue, 5 Sep 2023 22:11:56 -0700 Subject: [PATCH 01/10] Various fix. --- character/clan.js | 4 +++- character/jsrg.js | 12 ++++-------- game/game.js | 32 +++++++++++++++++++------------- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/character/clan.js b/character/clan.js index d665d3244..1919aa53d 100644 --- a/character/clan.js +++ b/character/clan.js @@ -293,7 +293,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var info=get.info(skill); if(info.charlotte) return false; var translation=get.skillInfoTranslation(skill,event.player); - if(!translation||translation.match(/“?出牌阶段限一次/g).every(value=>value!='出牌阶段限一次')) return false; + if(!translation) return false; + var match=translation.match(/“?出牌阶段限一次/g); + if(!match||match.every(value=>value!='出牌阶段限一次')) return false; return event.player.countCards('h')>0; }, check:function(event,player){ diff --git a/character/jsrg.js b/character/jsrg.js index 5ccdfb7f6..dfc12d53d 100644 --- a/character/jsrg.js +++ b/character/jsrg.js @@ -4019,13 +4019,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, jsrglinghua:{ audio:2, - locked:false, - mod:{ - judge:(player,result)=>{ - const parent=_status.event.getParent(2); - if(parent.name=='jsrglinghua'&&parent.triggername=='phaseJieshuBegin') result.bool=!result.bool; - } - }, trigger:{ player:['phaseZhunbeiBegin','phaseJieshuBegin'], }, @@ -4048,7 +4041,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(){ 'step 0' - event.executeDelayCardEffect=player.executeDelayCardEffect('shandian'); + var next=event.executeDelayCardEffect=player.executeDelayCardEffect('shandian'); + if(event.triggername!='phaseJieshuBegin') return; + next.judge=card=>-lib.card.shandian.judge(card)-4; + next.judge2=result=>!lib.card.shandian.judge2(result); 'step 1' var executeDelayCardEffect=event.executeDelayCardEffect; if(!player.hasHistory('damage',evt=>evt.getParent(2)==executeDelayCardEffect)){ diff --git a/game/game.js b/game/game.js index f740aca62..bc19bb20c 100644 --- a/game/game.js +++ b/game/game.js @@ -11021,23 +11021,27 @@ event.nojudge=true; } 'step 1' - if(!event.cancelled&&!event.nojudge) player.judge(card); + if(event.cancelled||event.nojudge) return; + var next=player.judge(card),judge=event.judge; + if(typeof judge=='function') next.judge=judge; + var judge2=event.judge2; + if(typeof judge2=='function') next.judge2=judge2; 'step 2' if(event.excluded) delete event.excluded; else{ - const cardName=event.cardName; + var cardName=event.cardName; if(event.cancelled&&!event.direct){ - const cardCancel=lib.card[cardName].cancel; + var cardCancel=lib.card[cardName].cancel; if(cardCancel){ - const next=game.createEvent(`${cardName}Cancel`); + var next=game.createEvent(`${cardName}Cancel`); next.setContent(cardCancel); next.cards=[card]; if(!card.viewAs){ - const autoViewAs=next.card=get.autoViewAs(card); + var autoViewAs=next.card=get.autoViewAs(card); autoViewAs.expired=card.expired; } else{ - const autoViewAs=next.card=get.autoViewAs({ + var autoViewAs=next.card=get.autoViewAs({ name:cardName },next.cards); autoViewAs.expired=card.expired; @@ -11046,16 +11050,16 @@ } } else{ - const next=game.createEvent(cardName); + var next=game.createEvent(cardName); next.setContent(lib.card[cardName].effect); next._result=result; next.cards=[card]; if(!card.viewAs){ - const autoViewAs=next.card=get.autoViewAs(card); + var autoViewAs=next.card=get.autoViewAs(card); autoViewAs.expired=card.expired; } else{ - const autoViewAs=next.card=get.autoViewAs({ + var autoViewAs=next.card=get.autoViewAs({ name:cardName },next.cards); autoViewAs.expired=card.expired; @@ -18943,7 +18947,7 @@ }, //Execute the delay card effect //执行延时锦囊牌效果 - executeDelayCardEffect:function(card,target){ + executeDelayCardEffect:function(card,target,judge,judge2){ const executeDelayCardEffect=game.createEvent('executeDelayCardEffect'); executeDelayCardEffect.player=this; executeDelayCardEffect.target=target||this; @@ -18956,6 +18960,8 @@ } else if(get.itemtype(card)=='card') executeDelayCardEffect.card=card; else _status.event.next.remove(executeDelayCardEffect); + executeDelayCardEffect.judge=judge; + executeDelayCardEffect.judge2=judge2; executeDelayCardEffect.setContent('executeDelayCardEffect'); executeDelayCardEffect._args=Array.from(arguments); return executeDelayCardEffect; @@ -28142,14 +28148,14 @@ if(this.player&&lib.phaseName.contains(this.name)) this.player.getHistory('skipped').add(this.name)} }, neutralize:function(event){ - this.untrigger(true); + this.untrigger(); this.finish(); this._neutralized=true; this.trigger('eventNeutralized'); this._neutralize_event=event||_status.event; }, unneutralize:function(){ - this.untrigger(true); + this.untrigger(); delete this._neutralized; delete this.finished; if(this.type=='card'&&this.card&&this.name=='sha') this.directHit=true; @@ -35463,7 +35469,7 @@ linexy:function(path){ const from=[path[0],path[1]],to=[path[2],path[3]]; let total=typeof arguments[1]==='number'?arguments[1]:lib.config.duration*2,opacity=1,color=[255,255,255],dashed=false,drag=false; - if(arguments[1]!=null&&typeof arguments[1]=='object') Object.keys(arguments[1]).forEach(value=>{ + if(arguments[1]&&typeof arguments[1]=='object') Object.keys(arguments[1]).forEach(value=>{ switch(value){ case 'opacity': opacity=arguments[1][value]; From 4d09055b9745b25955154d5f5801ff39c29d0fd4 Mon Sep 17 00:00:00 2001 From: Tipx-L <138244655+Tipx-L@users.noreply.github.com> Date: Wed, 6 Sep 2023 01:47:53 -0700 Subject: [PATCH 02/10] More. --- game/game.js | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/game/game.js b/game/game.js index bc19bb20c..4f8299a29 100644 --- a/game/game.js +++ b/game/game.js @@ -9147,7 +9147,9 @@ var connectCardPack=[]; for(i in character){ if(character[i].character){ - lib.characterPack[i]=character[i].character + const characterPack=lib.characterPack[i]; + if(characterPack) Object.assign(characterPack,character[i].character); + else lib.characterPack[i]=character[i].character; } for(j in character[i]){ if(j=='mode'||j=='forbid') continue; @@ -9250,11 +9252,11 @@ lib.cardPackList={}; } for(i in card){ - lib.cardPack[i]=[]; + const cardPack=lib.cardPack[i]?lib.cardPack[i]:lib.cardPack[i]=[]; if(card[i].card){ for(var j in card[i].card){ if(!card[i].card[j].hidden&&card[i].translate[j+'_info']){ - lib.cardPack[i].push(j); + cardPack.push(j); } } } @@ -9266,7 +9268,9 @@ } if(j=='list'){ if(lib.config.mode=='connect'){ - lib.cardPackList[i]=card[i][j]; + const cardPackList=lib.cardPackList[i]; + if(cardPackList) cardPackList.addArray(card[i][j]); + else lib.cardPackList[i]=card[i][j]; } else{ if(lib.config.cards.contains(i)){ @@ -9277,7 +9281,9 @@ else{ pile=card[i][j]; } - lib.cardPile[i]=pile.slice(0); + const cardPile=lib.cardPile[i]; + if(cardPile) cardPile.addArray(pile); + else lib.cardPile[i]=pile.slice(0); if(lib.config.bannedpile[i]){ for(var k=0;k Date: Wed, 6 Sep 2023 18:59:01 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=89=80=E6=9C=89?= =?UTF-8?q?=E3=80=90=E8=B0=8B=E8=AF=9B=E3=80=91=E7=9A=84=E7=BB=93=E7=AE=97?= =?UTF-8?q?+bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将1v1何进和OL何进的【谋诛】均改为交手牌 修复OL牛金【挫锐】摸牌不限制于游戏开始的bug 大幅优化OL何进【谋诛】ai --- character/sp.js | 56 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/character/sp.js b/character/sp.js index a0e1041f3..c47d98590 100755 --- a/character/sp.js +++ b/character/sp.js @@ -701,7 +701,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filter:function(event,player){ if(event.name=='useCardToTargeted') return get.type(event.card)=='delay'&&!player.hasSkill('olcuorui_skip'); - return player.countCards('h')0&&get.attitude(target,player)>0&&game.hasPlayer(function(current){ + target:function(player,target){ + if(get.attitude(target,player)>0&&game.hasPlayer(function(current){ if(current==target) return false; for(var card of [{name:'sha'},{name:'juedou'}]){ if(target.canUse(card,current)&&get.effect(current,card,target,player)>0&&get.effect(current,card,target,target)>0) return true; } return false; - })&&target.countCards('he')<=player.countCards('he')) return 3; + })&&target.countCards('h')player.countCards('he')+1) return -1; - return -0.5; + if(target.countCards('h')+1>player.countCards('h')) return -2; + var canSave=function(player,target){ + return target.hp+player.countCards('hs',function(card){ + var mod2=game.checkMod(card,player,'unchanged','cardEnabled2',player); + if(mod2!='unchanged') return mod2; + var mod=game.checkMod(card,player,target,'unchanged','cardSavable',player); + if(mod!='unchanged') return mod; + var savable=get.info(card).savable; + if(typeof savable=='function') savable=savable(card,player,target); + return savable; + })>1+((get.mode()=='identity'&&target.identity=='zhu')||(get.mode()=='guozhan'&&get.is.jun(target))); + }; + if(target.hasValueTarget({name:'sha'})){ + var aimx=game.filterPlayer(current=>{ + return target.canUse({name:'sha'},current)&&get.effect(current,{name:'sha'},target,target)>0; + }).sort((a,b)=>get.effect(b,{name:'sha'},target,target)-get.effect(a,{name:'sha'},target,target))[0]; + if(get.effect(aimx,{name:'sha'},target,player)<0&&get.effect(aimx,{name:'sha'},target,aimx)<0&&!canSave(player,aimx)) return 0; + } + if(target.hasValueTarget({name:'juedou'})){ + var aimy=game.filterPlayer(current=>{ + return target.canUse({name:'juedou'},current)&&get.effect(current,{name:'juedou'},target,target)>0; + }).sort((a,b)=>get.effect(b,{name:'juedou'},target,target)-get.effect(a,{name:'juedou'},target,target))[0]; + if(get.effect(aimy,{name:'juedou'},target,player)<0&&get.effect(aimy,{name:'sha'},target,aimy)<0&&!canSave(player,aimy)) return 0; + } + return -1; }, }, }, @@ -10870,15 +10892,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return game.hasPlayer((current)=>lib.skill.spmouzhu.filterTarget(null,player,current)); }, filterTarget:function(card,player,target){ + if(!target.countCards('h')) return false; return player!=target&&(target.hp==player.hp||get.distance(player,target)==1); }, selectTarget:[1,Infinity], content:function(){ 'step 0' - if(!target.countCards('h')) event.finish(); - else target.chooseCard('h','交给'+get.translation(player)+'一张牌',true); + target.chooseCard('h','交给'+get.translation(player)+'一张牌',true); 'step 1' - target.give(result.cards,player); + if(result.bool) target.give(result.cards,player); 'step 2' if(player.countCards('h')<=target.countCards('h')){ event.finish(); @@ -11924,13 +11946,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ enable:'phaseUse', usable:1, filterTarget:function(card,player,target){ - return target!=player&&target.countCards('he')>0; + return target!=player&&target.countCards('h')>0; }, content:function(){ 'step 0' - target.chooseCard('he','交给'+get.translation(player)+'一张牌',true); + target.chooseCard('h','交给'+get.translation(player)+'一张手牌',true); 'step 1' - target.give(result.cards,player); + if(result.bool) target.give(result.cards,player); 'step 2' if(player.countCards('h')<=target.countCards('h')){ event.finish(); @@ -23482,7 +23504,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ xjshijian:'实荐', xjshijian_info:'一名其他角色于其回合内使用的第二张牌结算完成后,你可弃置一张牌并令其获得技能〖誉虚〗直到回合结束。', mouzhu:'谋诛', - mouzhu_info:'出牌阶段限一次,你可以令一名有牌的其他角色交给你一张牌。然后若你的手牌数大于其,其选择视为对你使用一张【杀】或【决斗】。', + mouzhu_info:'出牌阶段限一次,你可以令一名有手牌的其他角色交给你一张牌。然后若你的手牌数大于其,其选择视为对你使用一张【杀】或【决斗】。', yanhuo:'延祸', yanhuo_info:'当你死亡时,你可以依次弃置一名其他角色的X张牌。(X为你的牌数)', niluan:'逆乱', @@ -24410,7 +24432,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ olcuorui:'挫锐', olcuorui_info:'锁定技。①游戏开始时,你将手牌摸至场上存活人数张(至多摸至8张)。②当你成为延时锦囊牌的目标后,你跳过下个判定阶段。', olmouzhu:'谋诛', - olmouzhu_info:'出牌阶段限一次,你可以令一名有牌的其他角色交给你一张牌。然后若你的手牌数大于其,其视为使用一张【杀】或【决斗】。', + olmouzhu_info:'出牌阶段限一次,你可以令一名有手牌的其他角色交给你一张牌。然后若其手牌数小于你,其视为使用一张【杀】或【决斗】。', olyanhuo:'延祸', olyanhuo_info:'当你死亡时,你可以弃置杀死你的角色至多X张牌(X为你的牌数)。', olniluan:'逆乱', From 07f72631e06e6e6584043f855fe9e80b032d6e56 Mon Sep 17 00:00:00 2001 From: mengxinzxz <139629761+mengxinzxz@users.noreply.github.com> Date: Wed, 6 Sep 2023 19:00:12 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E3=80=90=E5=8A=BF=E5=90=93=E3=80=91mark?= =?UTF-8?q?=E5=B0=8F=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复牵招【势吓】mark标记一小段content内容判定显示逻辑写反的bug --- character/mobile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/mobile.js b/character/mobile.js index a9287496e..83397c84c 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -2102,7 +2102,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ intro:{ content:function(storage,player){ var targets=storage.filter(i=>i.isIn()); - return '被'+get.translation(targets)+'吓到了,对他'+(targets.length>1?'们':'')+(get.mode()=='identity'?'的友方角色':'')+'打不出伤害'; + return '被'+get.translation(targets)+'吓到了,对他'+(targets.length>1?'们':'')+(get.mode()!='identity'?'和他的友方角色':'')+'打不出伤害'; }, }, ai:{ From 6ece9e91f736e2e330c900a8f8b2f9a90aed224f Mon Sep 17 00:00:00 2001 From: Rintim Date: Wed, 6 Sep 2023 19:18:13 +0800 Subject: [PATCH 05/10] fix genCoroutine --- game/game.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/game/game.js b/game/game.js index e9a4ce64a..486a0b0ec 100644 --- a/game/game.js +++ b/game/game.js @@ -7159,8 +7159,8 @@ genAsync:fn=>gnc.async(fn), genAwait:gen=>gnc.await(gen), gnc:{ - async:gnc.async(fn), - await:gnc.await(gen), + async:fn=>gnc.async(fn), + await:gen=>gnc.await(gen), is:{ coroutine:item=>gnc.is.coroutine(item), generatorFunc:item=>gnc.is.generatorFunc(item), @@ -9564,7 +9564,7 @@ } game.loop(); }) - var proceed=function(){ + var proceed=gnc.async(function*(){ if(!lib.db){ try{ lib.storage=JSON.parse(localStorage.getItem(lib.configprefix+lib.config.mode)); @@ -9575,7 +9575,7 @@ lib.storage={}; localStorage.setItem(lib.configprefix+lib.config.mode,"{}"); } - proceed2(); + yield proceed2(); } else{ game.getDB('data',lib.config.mode,function(obj){ @@ -9583,7 +9583,7 @@ proceed2(); }); } - }; + }); if(!lib.imported.mode||!lib.imported.mode[lib.config.mode]){ window.inSplash=true; clearTimeout(window.resetGameTimeout); @@ -9670,7 +9670,7 @@ } } else{ - proceed(); + yield proceed(); } localStorage.removeItem(lib.configprefix+'directstart'); delete lib.init.init; From c04b1e911834a78235ec47a19454277d71f1ed7a Mon Sep 17 00:00:00 2001 From: mengxinzxz <139629761+mengxinzxz@users.noreply.github.com> Date: Wed, 6 Sep 2023 19:20:02 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E8=B0=8B=E6=94=BB=E7=AF=87=E4=BC=97?= =?UTF-8?q?=E6=8A=80=E8=83=BD=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复谋张郃判定阶段没判定牌和出牌阶段手牌数小于等于6时不能发动技能的bug 调整杨婉,刘赪的翻译 手杀调整后众数值更新(真不愧是...) --- character/sb.js | 110 ++++++++++++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 50 deletions(-) diff --git a/character/sb.js b/character/sb.js index be2af55c5..2405ce5b1 100644 --- a/character/sb.js +++ b/character/sb.js @@ -53,10 +53,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sbqiaobian:{ audio:2, trigger:{player:['phaseJudgeBefore','phaseDrawBefore','phaseUseBefore']}, - filter:function(event,player){ - if(event.name=='phaseJudge') return player.countCards('j'); - return event.name!='phaseUse'||player.countCards('h')>6; - }, usable:1, direct:true, content:function(){ @@ -90,7 +86,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ break; case 'phaseUse': var num=(player.countCards('h')-6); - player.chooseToDiscard(get.prompt('sbqiaobian'),num,'弃置'+get.cnNumber(num)+'张手牌并跳过出牌阶段和弃牌阶段,然后移动场上的一张牌').set('ai',function(card){ + if(num<=0) player.chooseBool(get.prompt('sbqiaobian'),'跳过出牌阶段和弃牌阶段,然后移动场上的一张牌').set('choice',player.canMoveCard(true)).setHiddenSkill('sbqiaobian'); + else player.chooseToDiscard(get.prompt('sbqiaobian'),num,'弃置'+get.cnNumber(num)+'张手牌并跳过出牌阶段和弃牌阶段,然后移动场上的一张牌').set('ai',function(card){ var player=_status.event.player; if(!player.canMoveCard(true)||player.countCards('hs',card=>player.hasValueTarget(card))>=9) return 0; return 7-get.value(card); @@ -121,6 +118,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addSkill('sbqiaobian_draw'); break; case 'phaseUse': + if(!result.cards||!result.cards.length) player.logSkill('sbqiaobian',target); player.skip('phaseDiscard'); game.log(player,'跳过了出牌阶段'); game.log(player,'跳过了弃牌阶段'); @@ -299,7 +297,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, trigger:{player:'useCardToPlayered'}, filter:function(event,player){ - return event.targets.length==1&&event.card.name=='sha'&&!player.hasSkillTag('noCompareSource')&&event.target!=player&&event.target.countCards('h')>0&&!event.target.hasSkillTag('noCompareTarget'); + return event.targets.length==1&&event.card.name=='sha'&&player.canCompare(event.target); }, check:function(event,player){ return get.attitude(player,event.target)<0||game.hasPlayer(current=>{ @@ -310,10 +308,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ logTarget:'target', content:function(){ 'step 0' - player.draw(); - 'step 1' if(player.canCompare(trigger.target)) player.chooseToCompare(trigger.target); - 'step 2' + 'step 1' if(result.bool){ player.addTempSkill('sblieren_damage'); if(!trigger.card.storage) trigger.card.storage={}; @@ -322,6 +318,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, subSkill:{ damage:{ + audio:'sblieren', trigger:{global:'useCardAfter'}, filter:function(event,player){ return event.card.name=='sha'&&event.card.storage&&event.card.storage.sblieren&&event.card.storage.sblieren[0]==player&&game.hasPlayer(current=>{ @@ -360,17 +357,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ 'step 0' if(!_status.sbjuxiang_nanman){ - _status.sbjuxiang_nanman=[]; - var numbers=[7,9,11,13],suits=['spade','club']; - for(var num of numbers){ - for(var suit of suits){ - _status.sbjuxiang_nanman.push({name:'nanman',number:num,suit:suit}); - } - } + _status.sbjuxiang_nanman=[ + {name:'nanman',number:7,suit:'spade'}, + {name:'nanman',number:13,suit:'spade'}, + {name:'nanman',number:7,suit:'club'}, + ]; game.broadcastAll(function(){ - if(!lib.inpile.contains('nanman')){ - lib.inpile.add('nanman'); - } + if(!lib.inpile.contains('nanman')) lib.inpile.add('nanman'); }); } player.chooseTarget(get.prompt('sbjuxiang'),'将游戏外的随机一张【南蛮入侵】交给一名角色(剩余'+get.cnNumber(_status.sbjuxiang_nanman.length)+'张)').set('ai',target=>{ @@ -544,7 +537,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 1' player.changeHujia(1,null,true); 'step 2' - player.draw(2); + player.draw(3); 'step 3' player.addSkillLog('sbyingzi'); player.addSkillLog('gzyinghun'); @@ -558,8 +551,23 @@ game.import('character',function(lib,game,ui,get,ai,_status){ effect:{ target:function(card,player,target){ if(!target.hasFriend()||target.hp>1) return; - if(get.tag(card,'damage')==1&&(target.hasZhuSkill('sbzhiba')||player.countCards('hs','tao')+target.countCards('hs',['tao','jiu'])>0)&& - !target.isTurnedOver()&&_status.currentPhase!=target&&get.distance(_status.currentPhase,target,'absolute')<=3) return [0.5,1]; + if(get.tag(card,'damage')==1&&((target.hasZhuSkill('sbzhiba')&&game.countPlayer(current=>current!=target&¤t.group=='wu'))||player.countCards('hs',function(card){ + var mod2=game.checkMod(card,player,'unchanged','cardEnabled2',player); + if(mod2!='unchanged') return mod2; + var mod=game.checkMod(card,player,target,'unchanged','cardSavable',player); + if(mod!='unchanged') return mod; + var savable=get.info(card).savable; + if(typeof savable=='function') savable=savable(card,player,target); + return savable; + })+target.countCards('hs',function(card){ + var mod2=game.checkMod(card,target,'unchanged','cardEnabled2',target); + if(mod2!='unchanged') return mod2; + var mod=game.checkMod(card,target,target,'unchanged','cardSavable',target); + if(mod!='unchanged') return mod; + var savable=get.info(card).savable; + if(typeof savable=='function') savable=savable(card,target,target); + return savable; + })>0)&&!target.isTurnedOver()&&_status.currentPhase!=target&&get.distance(_status.currentPhase,target,'absolute')<=3) return [0.5,1]; } } } @@ -585,7 +593,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.targets=game.filterPlayer(current=>{ return current.group=='wu'&¤t!=player; }).sortBySeat(_status.currentPhase); - var num=event.targets.length+1; + var num=event.targets.length; if(num>0) player.recover(num); player.addMark('sbjiang',1,false); player.addTempSkill('sbzhiba_draw'); @@ -645,8 +653,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.useCard({name:'lebu'},target,cards).audio=false; } 'step 1' - player.draw(2); - player.chooseToDiscard(true,'he','国色:请弃置一张牌'); + player.draw(); }, ai:{ result:{ @@ -809,7 +816,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'phaseJieshuBegin'}, forced:true, content:function(){ - player.draw(Math.min(5,game.countPlayer2(current=>{ + player.draw(Math.min(4,game.countPlayer2(current=>{ return current.getHistory('damage').length>0; })+1)); } @@ -959,7 +966,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ if(event.name=='chooseToUse') return player.countCards('hs')>1&&!player.hasSkill('sbluanji_used'); var evt=event.getParent(2); - return evt.name=='wanjian'&&evt.getParent().player==player&&event.player!=player; + return evt.name=='wanjian'&&evt.getParent().player==player&&event.player!=player&&player.getHistory('gain',function(evt){ + return evt.getParent(2).name=='sbluanji'; + }).length<3; }, filterCard:true, selectCard:2, @@ -1010,6 +1019,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, zhuSkill:true, forced:true, + usable:2, logTarget:'target', content:function(){ player.draw(); @@ -1205,9 +1215,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.awakenSkill('sbniepan'); player.discard(player.getCards('hej')); 'step 1' - player.draw(3); + player.draw(2); 'step 2' - if(player.hp<3) player.recover(3-player.hp); + if(player.hp<2) player.recover(2-player.hp); 'step 3' player.turnOver(false); 'step 4' @@ -1394,8 +1404,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(num>=3){ var cards=player.getCards('he'); if(!cards.length) event._result={bool:false}; - else if(cards.length<=2) event._result={bool:true,cards:cards}; - else player.chooseCard('恩怨:交给'+get.translation(target)+'两张牌',true,2,'he'); + else if(cards.length<=3) event._result={bool:true,cards:cards}; + else player.chooseCard('恩怨:交给'+get.translation(target)+'三张牌',true,3,'he'); } else{ target.loseHp(); @@ -2045,7 +2055,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ mark:{charlotte:true}, draw:{ charlotte:true, - trigger:{player:['useCardAfter','respondAfter']}, + trigger:{player:['useCardAfter']}, forced:true, popup:false, filter:function(event,player){ @@ -2519,9 +2529,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.goto(1); } 'step 5' - if(target.countDiscardableCards(player,'hej')){ + if(event.num>0&&target.countDiscardableCards(player,'hej')){ player.line(target); - player.discardPlayerCard(target,event.num+1,true,'hej'); + player.discardPlayerCard(target,event.num,true,'hej'); } }, ai:{ @@ -4570,8 +4580,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return '①出牌阶段' + (player.storage.sbkeji ? '' :'各') + '限一次。你可以选择一项:1.弃置一张手牌,然后获得1点护甲;2.失去1点体力,然后获得2点护甲。②你的手牌上限+X(X为你的护甲数)。③若你不为正在结算濒死流程的角色,你不能使用【桃】。'; }, sblongdan:function(player){ - if(player.hasSkill('sblongdan_mark',null,null,false)) return '蓄力技(1/3)。①你可以消耗1点蓄力值,将一张基本牌当做任意基本牌使用或打出,然后摸一张牌。②一名角色的回合结束时,你获得1点蓄力值。'; - return '蓄力技(1/3)。①你可以消耗1点蓄力值,将【杀】当做【闪】或将【闪】当做【杀】使用或打出,然后摸一张牌。②一名角色的回合结束时,你获得1点蓄力值。'; + if(player.hasSkill('sblongdan_mark',null,null,false)) return '蓄力技(1/3)。①你可以消耗1点蓄力值,将一张基本牌当做任意基本牌使用或打出,然后若你以此法使用牌,你摸一张牌。②一名角色的回合结束时,你获得1点蓄力值。'; + return '蓄力技(1/3)。①你可以消耗1点蓄力值,将【杀】当做【闪】或将【闪】当做【杀】使用或打出,然后若你以此法使用牌,你摸一张牌。②一名角色的回合结束时,你获得1点蓄力值。'; }, sblianhuan:function(player){ var str='①出牌阶段,你可以重铸一张♣手牌。②出牌阶段限一次。你可以将一张♣手牌当【铁索连环】使用。'; @@ -4587,12 +4597,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, translate:{ - sp_yangwan:'手杀杨婉', + sp_yangwan:'谋杨婉', spmingxuan:'瞑昡', spmingxuan_info:'锁定技。出牌阶段开始时,你须选择至多X张花色各不相同的手牌(X为未选择过选项一的角色),将这些牌随机交给这些角色中的等量角色。然后这些角色依次选择一项:⒈对你使用一张【杀】。⒉交给你一张牌,然后你摸一张牌。', spxianchou:'陷仇', spxianchou_info:'当你受到有来源的伤害后,你可选择一名不为伤害来源的其他角色。该角色可以弃置一张牌,然后视为对伤害来源使用一张【杀】(无距离限制)。若其因此【杀】造成了伤害,则其摸一张牌,你回复1点体力。', - liucheng:'刘赪', + liucheng:'谋刘赪', splveying:'掠影', splveying_info:'锁定技。①每回合限两次,当你使用【杀】指定目标后,你获得一个“椎”。②当你使用的【杀】结算结束后,若你的“椎”数大于1,则你弃置两个“椎”并摸一张牌,然后可以视为使用一张【过河拆桥】。', spyingwu:'莺舞', @@ -4668,7 +4678,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sbluoshen_info:'准备阶段,你可以选择一名角色。从其开始按逆时针方向的X名其他角色依次执行(X为角色数的一半,向上取整):展示一张手牌,若此牌为黑色,你获得之且此牌不计入本回合手牌上限;若此牌为红色,其弃置之。', sb_ganning:'谋甘宁', sbqixi:'奇袭', - sbqixi_info:'出牌阶段限一次。若你有手牌,你可以令一名其他角色猜测你手牌中最多的花色。若其猜对,你展示所有手牌;若其猜错,你可令其从其未选择过的花色中再次猜测,重复此流程。然后你弃置其区域内的X张牌(X为其于本次〖奇袭〗中猜错的次数+1)。', + sbqixi_info:'出牌阶段限一次。若你有手牌,你可以令一名其他角色猜测你手牌中最多的花色。若其猜对,你展示所有手牌;若其猜错,你可令其从其未选择过的花色中再次猜测,重复此流程。然后你弃置其区域内的X张牌(X为其于本次〖奇袭〗中猜错的次数)。', sbfenwei:'奋威', sbfenwei_info:'限定技。①出牌阶段,你可以将至多三张牌分别置于等量名角色的武将牌上,称为“威”,然后你摸等量牌。②当一名角色成为锦囊牌的目标时,若其有“威”,你须选择:1.令其获得其“威”;2.令其移去“威”,并取消此目标。', sb_machao:'谋马超', @@ -4686,7 +4696,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sbxieji_info:'准备阶段开始时,你可以和一名其他角色进行协力。其的下个结束阶段开始时,若你与其协力成功,则你可以选择至多三名其他角色。你对这些角色视为使用一张【杀】,且当此【杀】因执行牌面效果造成伤害后,你摸X张牌(X为伤害值)。', sb_zhaoyun:'谋赵云', sblongdan:'龙胆', - sblongdan_info:'蓄力技(1/3)。①你可以消耗1点蓄力值,将【杀】当做【闪】或将【闪】当做【杀】使用或打出,然后摸一张牌。②一名角色的回合结束时,你获得1点蓄力值。', + sblongdan_info:'蓄力技(1/3)。①你可以消耗1点蓄力值,将【杀】当做【闪】或将【闪】当做【杀】使用或打出,然后若你以此法使用牌,你摸一张牌。②一名角色的回合结束时,你获得1点蓄力值。', sbjizhu:'积著', sbjizhu_info:'准备阶段开始时,你可以和一名其他角色进行协力。其的下个结束阶段开始时,若你与其协力成功,则你修改〖龙胆〗直到你的下个结束阶段开始。', sblongdan_shabi:'龙胆', @@ -4707,7 +4717,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sbxuanhuo:'眩惑', sbxuanhuo_info:'①出牌阶段限一次。你可以将一张牌交给一名没有“眩”标记的其他角色,然后令其获得“眩”标记。②当有“眩”的其他角色于摸牌阶段外获得牌后,若你以此法于其本次获得“眩”的期间内获得其的牌数小于5,你随机获得其一张手牌。', sbenyuan:'恩怨', - sbenyuan_info:'锁定技。准备阶段,若场上存在有“眩”的角色,你移去该角色的“眩”,且你于其本次获得“眩”的期间内获得其的牌数:不小于3,你交给其两张牌;小于3,其失去1点体力,你回复1点体力。', + sbenyuan_info:'锁定技。准备阶段,若场上存在有“眩”的角色,你移去该角色的“眩”,且你于其本次获得“眩”的期间内获得其的牌数:不小于3,你交给其三张牌;小于3,其失去1点体力,你回复1点体力。', sb_chengong:'谋陈宫', sbmingce:'明策', sbmingce_info:'①出牌阶段限一次。你可以将一张牌交给一名其他角色,其选择一项:1.失去1点体力,令你摸两张牌并获得1枚“策”;2.摸一张牌。②出牌阶段开始时,你可以移去所有“策”并对一名其他角色造成等量伤害。', @@ -4715,28 +4725,28 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sbzhichi_info:'锁定技。当你受到伤害后,防止你本回合受到的伤害。', sb_yuanshao:'谋袁绍', sbluanji:'乱击', - sbluanji_info:'①出牌阶段限一次。你可以将两张手牌当【万箭齐发】使用。②当其他角色因响应你使用的【万箭齐发】而打出【闪】时,你摸一张牌。', + sbluanji_info:'①出牌阶段限一次。你可以将两张手牌当【万箭齐发】使用。②每回合限三次,当其他角色因响应你使用的【万箭齐发】而打出【闪】时,你摸一张牌。', sbxueyi:'血裔', - sbxueyi_info:'主公技,锁定技。①你的手牌上限+2X(X为场上其他群势力角色数)。②当你使用牌指定其他群势力角色为目标后,你摸一张牌。', + sbxueyi_info:'主公技,锁定技。①你的手牌上限+2X(X为场上其他群势力角色数)。②每回合限两次,当你使用牌指定其他群势力角色为目标后,你摸一张牌。', sb_diaochan:'谋貂蝉', sblijian:'离间', sblijian_info:'出牌阶段限一次。你可以选择至少两名其他角色并弃置X张牌(X为你选择的角色数-1)。然后每名你选择的角色依次视为对这些角色中与其逆时针座次最近的另一名角色使用一张【决斗】。', sbbiyue:'闭月', - sbbiyue_info:'锁定技。结束阶段,你摸Y张牌(Y为本回合包括已死亡角色在内受到过伤害的角色数+1且至多为5)。', + sbbiyue_info:'锁定技。结束阶段,你摸Y张牌(Y为本回合包括已死亡角色在内受到过伤害的角色数+1且至多为4)。', sb_pangtong:'谋庞统', sblianhuan:'连环', sblianhuan_info:'①出牌阶段,你可以重铸一张♣手牌。②出牌阶段限一次。你可以将一张♣手牌当【铁索连环】使用。③当你使用【铁索连环】时,你可以失去1点体力,然后当此牌指定第一个目标后,你随机弃置每名不处于连环状态的目标角色一张手牌。', sblianhuan_lv2:'连环·改', sblianhuan_lv2_info:'①出牌阶段,你可以重铸一张♣手牌。②出牌阶段限一次。你可以将一张♣手牌当【铁索连环】使用。③当你使用【铁索连环】时,你可以额外指定任意名角色为目标。④当你使用【铁索连环】指定第一个目标后,你随机弃置每名不处于连环状态的目标角色一张手牌。', sbniepan:'涅槃', - sbniepan_info:'限定技。当你处于濒死状态时,你可以弃置区域里的所有牌,摸三张牌,将体力回复至3点,复原武将牌,然后修改〖连环〗。', + sbniepan_info:'限定技。当你处于濒死状态时,你可以弃置区域里的所有牌,摸两张牌,将体力回复至2点,复原武将牌,然后修改〖连环〗。', sb_sunce:'谋孙策', sbjiang:'激昂', sbjiang_info:'①当你使用【决斗】或红色【杀】指定目标后,或当你成为【决斗】或红色【杀】的目标后,你摸一张牌。②当你使用【决斗】时,你可以额外指定一名目标,然后你失去1点体力。③出牌阶段限一次。你可以将所有手牌当【决斗】使用。', sbhunzi:'魂姿', - sbhunzi_info:'觉醒技。当你脱离濒死状态后,你减1点体力上限,获得1点护甲,摸两张牌。然后你获得〖英姿〗和〖英魂〗。', + sbhunzi_info:'觉醒技。当你脱离濒死状态后,你减1点体力上限,获得1点护甲,摸三张牌。然后你获得〖英姿〗和〖英魂〗。', sbzhiba:'制霸', - sbzhiba_info:'主公技,限定技。当你进入濒死状态时,你可以回复X点体力并修改〖激昂③〗为“出牌阶段限X次”(X为场上其他吴势力角色数+1)。然后其他吴势力角色依次受到1点无来源伤害,且当有角色因此死亡后,你摸三张牌。', + sbzhiba_info:'主公技,限定技。当你进入濒死状态时,你可以回复X点体力并修改〖激昂③〗为“出牌阶段限X次”(X为场上其他吴势力角色数)。然后其他吴势力角色依次受到1点无来源伤害,且当有角色因此死亡后,你摸三张牌。', sb_daqiao:'谋大乔', sbguose:'国色', sbguose_info:'出牌阶段限四次。你可以选择一项:1.将一张♦牌当【乐不思蜀】使用;2.弃置场上一张【乐不思蜀】。然后你摸两张牌并弃置一张牌。', @@ -4749,9 +4759,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sbzongshi_info:'锁定技。每名角色限一次。当你受到伤害后,你令伤害来源弃置所有手牌。', sb_zhurong:'谋祝融', sblieren:'烈刃', - sblieren_info:'当你使用【杀】指定唯一目标后,你可以摸一张牌并与其拼点。若你赢,此【杀】结算结束后,你可以对另一名其他角色造成1点伤害。', + sblieren_info:'当你使用【杀】指定唯一目标后,你可以与其拼点。若你赢,此【杀】结算结束后,你可以对另一名其他角色造成1点伤害。', sbjuxiang:'巨象', - sbjuxiang_info:'锁定技。①【南蛮入侵】对你无效。②当其他角色使用【南蛮入侵】结算结束后,你获得此牌对应的所有实体牌。③结束阶段,若你未于本回合使用过【南蛮入侵】,你可以将一张游戏外的随机【南蛮入侵】(共八张)交给一名角色。', + sbjuxiang_info:'锁定技。①【南蛮入侵】对你无效。②当其他角色使用【南蛮入侵】结算结束后,你获得此牌对应的所有实体牌。③结束阶段,若你未于本回合使用过【南蛮入侵】,你可以将一张游戏外的随机【南蛮入侵】(共三张)交给一名角色。', sb_menghuo:'谋孟获', sbhuoshou:'祸首', sbhuoshou_info:'锁定技。①【南蛮入侵】对你无效。②当其他角色使用【南蛮入侵】指定第一个目标后,你代替其成为此牌的伤害来源。③出牌阶段开始时,你随机获得弃牌堆中的一张【南蛮入侵】。④出牌阶段,若你于此阶段使用过【南蛮入侵】,你不能使用【南蛮入侵】。', @@ -4759,7 +4769,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sbzaiqi_info:'蓄力技(1/7)。①弃牌阶段结束时,你可以消耗任意点蓄力值并选择等量名角色,然后令这些角色选择一项:1.令你摸一张牌;2.弃置一张牌,然后你回复1点体力。②每回合限一次。当你造成伤害后,你获得1点蓄力值。', sb_zhanghe:'谋张郃', sbqiaobian:'巧变', - sbqiaobian_info:'每回合限一次。①你可以失去1点体力并跳过判定阶段,将判定区的所有牌移动给一名其他角色(无法置入其判定区的牌改为弃置之)。②你可以跳过摸牌阶段,于下个准备阶段摸两张牌并回复1点体力。③你可以将手牌数弃置至六张并跳过出牌阶段和弃牌阶段,然后移动场上的一张牌。', + sbqiaobian_info:'每回合限一次。①你可以失去1点体力并跳过判定阶段,将判定区的所有牌移动给一名其他角色(无法置入其判定区的牌改为弃置之)。②你可以跳过摸牌阶段,于下个准备阶段摸两张牌并回复1点体力。③你可以将手牌数弃置至六张(若手牌数少于六张则跳过之)并跳过出牌阶段和弃牌阶段,然后移动场上的一张牌。', sb_zhi:'谋攻篇·知', sb_shi:'谋攻篇·识', From f6d55f913ba8f08b3e611d36c4cf96471326c710 Mon Sep 17 00:00:00 2001 From: mengxinzxz <139629761+mengxinzxz@users.noreply.github.com> Date: Wed, 6 Sep 2023 19:22:55 +0800 Subject: [PATCH 07/10] Update sp.js --- character/sp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/character/sp.js b/character/sp.js index c47d98590..f8e629154 100755 --- a/character/sp.js +++ b/character/sp.js @@ -23504,7 +23504,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ xjshijian:'实荐', xjshijian_info:'一名其他角色于其回合内使用的第二张牌结算完成后,你可弃置一张牌并令其获得技能〖誉虚〗直到回合结束。', mouzhu:'谋诛', - mouzhu_info:'出牌阶段限一次,你可以令一名有手牌的其他角色交给你一张牌。然后若你的手牌数大于其,其选择视为对你使用一张【杀】或【决斗】。', + mouzhu_info:'出牌阶段限一次,你可以令一名有手牌的其他角色交给你一张手牌。然后若你的手牌数大于其,其选择视为对你使用一张【杀】或【决斗】。', yanhuo:'延祸', yanhuo_info:'当你死亡时,你可以依次弃置一名其他角色的X张牌。(X为你的牌数)', niluan:'逆乱', @@ -24432,7 +24432,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ olcuorui:'挫锐', olcuorui_info:'锁定技。①游戏开始时,你将手牌摸至场上存活人数张(至多摸至8张)。②当你成为延时锦囊牌的目标后,你跳过下个判定阶段。', olmouzhu:'谋诛', - olmouzhu_info:'出牌阶段限一次,你可以令一名有手牌的其他角色交给你一张牌。然后若其手牌数小于你,其视为使用一张【杀】或【决斗】。', + olmouzhu_info:'出牌阶段限一次,你可以令一名有手牌的其他角色交给你一张手牌。然后若其手牌数小于你,其视为使用一张【杀】或【决斗】。', olyanhuo:'延祸', olyanhuo_info:'当你死亡时,你可以弃置杀死你的角色至多X张牌(X为你的牌数)。', olniluan:'逆乱', From 21133e1cb2bd14c52fe6e080feae9fa76e4fb30e Mon Sep 17 00:00:00 2001 From: Rintim Date: Wed, 6 Sep 2023 22:16:31 +0800 Subject: [PATCH 08/10] add path.min.js --- game/game.js | 9 +++++++++ game/path.min.js | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 game/path.min.js diff --git a/game/game.js b/game/game.js index e9a4ce64a..8285ac3ea 100644 --- a/game/game.js +++ b/game/game.js @@ -6992,6 +6992,7 @@ '
  • 游击:若一名角色拥有带有“游击”的技能,则当该游击技能执行至“游击”处时,若本次技能的目标角色在你的攻击范围内,且你不在其攻击范围内,则你可以执行“游击”后的额外效果。'+ '' }, + path:{}, setIntro:function(node,func,left){ if(lib.config.touchscreen){ if(left){ @@ -8237,6 +8238,14 @@ delete _status.htmlbg; window.game=game; + // node:path library + if (typeof window.require=="function") lib.path=require("path"); + else lib.init.js(`${lib.assetURL}game`,"path.min",()=>{ + lib.path=window._noname_path; + delete window._noname_path; + },(e)=>{ + throw e; + }); var styleToLoad=6; var styleLoaded=function(){ styleToLoad--; diff --git a/game/path.min.js b/game/path.min.js new file mode 100644 index 000000000..a5010844c --- /dev/null +++ b/game/path.min.js @@ -0,0 +1,24 @@ +// 'path' module extracted from Node.js v8.11.1 (only the posix part) +// transplited with Babel + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. +(()=>{"use strict";function assertPath(path){if(typeof path!=="string"){throw new TypeError("Path must be a string. Received "+JSON.stringify(path))}}function normalizeStringPosix(path,allowAboveRoot){var res="";var lastSegmentLength=0;var lastSlash=-1;var dots=0;var code;for(var i=0;i<=path.length;++i){if(i2){var lastSlashIndex=res.lastIndexOf("/");if(lastSlashIndex!==res.length-1){if(lastSlashIndex===-1){res="";lastSegmentLength=0}else{res=res.slice(0,lastSlashIndex);lastSegmentLength=res.length-1-res.lastIndexOf("/")}lastSlash=i;dots=0;continue}}else if(res.length===2||res.length===1){res="";lastSegmentLength=0;lastSlash=i;dots=0;continue}}if(allowAboveRoot){if(res.length>0)res+="/..";else res="..";lastSegmentLength=2}}else{if(res.length>0)res+="/"+path.slice(lastSlash+1,i);else res=path.slice(lastSlash+1,i);lastSegmentLength=i-lastSlash-1}lastSlash=i;dots=0}else if(code===46&&dots!==-1){++dots}else{dots=-1}}return res}function _format(sep,pathObject){var dir=pathObject.dir||pathObject.root;var base=pathObject.base||(pathObject.name||"")+(pathObject.ext||"");if(!dir){return base}if(dir===pathObject.root){return dir+base}return dir+sep+base}var posix={resolve:function resolve(){var resolvedPath="";var resolvedAbsolute=false;var cwd;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path;if(i>=0)path=arguments[i];else{if(cwd===undefined)cwd=process.cwd();path=cwd}assertPath(path);if(path.length===0){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charCodeAt(0)===47}resolvedPath=normalizeStringPosix(resolvedPath,!resolvedAbsolute);if(resolvedAbsolute){if(resolvedPath.length>0)return"/"+resolvedPath;else return"/"}else if(resolvedPath.length>0){return resolvedPath}else{return"."}},normalize:function normalize(path){assertPath(path);if(path.length===0)return".";var isAbsolute=path.charCodeAt(0)===47;var trailingSeparator=path.charCodeAt(path.length-1)===47;path=normalizeStringPosix(path,!isAbsolute);if(path.length===0&&!isAbsolute)path=".";if(path.length>0&&trailingSeparator)path+="/";if(isAbsolute)return"/"+path;return path},isAbsolute:function isAbsolute(path){assertPath(path);return path.length>0&&path.charCodeAt(0)===47},join:function join(){if(arguments.length===0)return".";var joined;for(var i=0;i0){if(joined===undefined)joined=arg;else joined+="/"+arg}}if(joined===undefined)return".";return posix.normalize(joined)},relative:function relative(from,to){assertPath(from);assertPath(to);if(from===to)return"";from=posix.resolve(from);to=posix.resolve(to);if(from===to)return"";var fromStart=1;for(;fromStartlength){if(to.charCodeAt(toStart+i)===47){return to.slice(toStart+i+1)}else if(i===0){return to.slice(toStart+i)}}else if(fromLen>length){if(from.charCodeAt(fromStart+i)===47){lastCommonSep=i}else if(i===0){lastCommonSep=0}}break}var fromCode=from.charCodeAt(fromStart+i);var toCode=to.charCodeAt(toStart+i);if(fromCode!==toCode)break;else if(fromCode===47)lastCommonSep=i}var out="";for(i=fromStart+lastCommonSep+1;i<=fromEnd;++i){if(i===fromEnd||from.charCodeAt(i)===47){if(out.length===0)out+="..";else out+="/.."}}if(out.length>0)return out+to.slice(toStart+lastCommonSep);else{toStart+=lastCommonSep;if(to.charCodeAt(toStart)===47)++toStart;return to.slice(toStart)}},_makeLong:function _makeLong(path){return path},dirname:function dirname(path){assertPath(path);if(path.length===0)return".";var code=path.charCodeAt(0);var hasRoot=code===47;var end=-1;var matchedSlash=true;for(var i=path.length-1;i>=1;--i){code=path.charCodeAt(i);if(code===47){if(!matchedSlash){end=i;break}}else{matchedSlash=false}}if(end===-1)return hasRoot?"/":".";if(hasRoot&&end===1)return"//";return path.slice(0,end)},basename:function basename(path,ext){if(ext!==undefined&&typeof ext!=="string")throw new TypeError('"ext" argument must be a string');assertPath(path);var start=0;var end=-1;var matchedSlash=true;var i;if(ext!==undefined&&ext.length>0&&ext.length<=path.length){if(ext.length===path.length&&ext===path)return"";var extIdx=ext.length-1;var firstNonSlashEnd=-1;for(i=path.length-1;i>=0;--i){var code=path.charCodeAt(i);if(code===47){if(!matchedSlash){start=i+1;break}}else{if(firstNonSlashEnd===-1){matchedSlash=false;firstNonSlashEnd=i+1}if(extIdx>=0){if(code===ext.charCodeAt(extIdx)){if(--extIdx===-1){end=i}}else{extIdx=-1;end=firstNonSlashEnd}}}}if(start===end)end=firstNonSlashEnd;else if(end===-1)end=path.length;return path.slice(start,end)}else{for(i=path.length-1;i>=0;--i){if(path.charCodeAt(i)===47){if(!matchedSlash){start=i+1;break}}else if(end===-1){matchedSlash=false;end=i+1}}if(end===-1)return"";return path.slice(start,end)}},extname:function extname(path){assertPath(path);var startDot=-1;var startPart=0;var end=-1;var matchedSlash=true;var preDotState=0;for(var i=path.length-1;i>=0;--i){var code=path.charCodeAt(i);if(code===47){if(!matchedSlash){startPart=i+1;break}continue}if(end===-1){matchedSlash=false;end=i+1}if(code===46){if(startDot===-1)startDot=i;else if(preDotState!==1)preDotState=1}else if(startDot!==-1){preDotState=-1}}if(startDot===-1||end===-1||preDotState===0||preDotState===1&&startDot===end-1&&startDot===startPart+1){return""}return path.slice(startDot,end)},format:function format(pathObject){if(pathObject===null||typeof pathObject!=="object"){throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof pathObject)}return _format("/",pathObject)},parse:function parse(path){assertPath(path);var ret={root:"",dir:"",base:"",ext:"",name:""};if(path.length===0)return ret;var code=path.charCodeAt(0);var isAbsolute=code===47;var start;if(isAbsolute){ret.root="/";start=1}else{start=0}var startDot=-1;var startPart=0;var end=-1;var matchedSlash=true;var i=path.length-1;var preDotState=0;for(;i>=start;--i){code=path.charCodeAt(i);if(code===47){if(!matchedSlash){startPart=i+1;break}continue}if(end===-1){matchedSlash=false;end=i+1}if(code===46){if(startDot===-1)startDot=i;else if(preDotState!==1)preDotState=1}else if(startDot!==-1){preDotState=-1}}if(startDot===-1||end===-1||preDotState===0||preDotState===1&&startDot===end-1&&startDot===startPart+1){if(end!==-1){if(startPart===0&&isAbsolute)ret.base=ret.name=path.slice(1,end);else ret.base=ret.name=path.slice(startPart,end)}}else{if(startPart===0&&isAbsolute){ret.name=path.slice(1,startDot);ret.base=path.slice(1,end)}else{ret.name=path.slice(startPart,startDot);ret.base=path.slice(startPart,end)}ret.ext=path.slice(startDot,end)}if(startPart>0)ret.dir=path.slice(0,startPart-1);else if(isAbsolute)ret.dir="/";return ret},sep:"/",delimiter:":",win32:null,posix:null};posix.posix=posix;window._noname_path=posix})(); \ No newline at end of file From a288afc29cb287c6e28d0026cfa344391c36caeb Mon Sep 17 00:00:00 2001 From: Rintim Date: Wed, 6 Sep 2023 22:21:37 +0800 Subject: [PATCH 09/10] format. --- game/game.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/game/game.js b/game/game.js index 8285ac3ea..34abde0f5 100644 --- a/game/game.js +++ b/game/game.js @@ -8238,9 +8238,8 @@ delete _status.htmlbg; window.game=game; - // node:path library - if (typeof window.require=="function") lib.path=require("path"); - else lib.init.js(`${lib.assetURL}game`,"path.min",()=>{ + // node:path library alternative + if (typeof module!="object"||typeof module.exports!="object") lib.init.js(`${lib.assetURL}game`,"path.min",()=>{ lib.path=window._noname_path; delete window._noname_path; },(e)=>{ @@ -8597,10 +8596,12 @@ else if(typeof window.require=='function'){ lib.node={ fs:require('fs'), + path:require("path"), debug:function(){ require('electron').remote.getCurrentWindow().toggleDevTools(); } }; + lib.path=lib.node.path; game.download=function(url,folder,onsuccess,onerror,dev,onprogress){ if(url.indexOf('http')!=0){ url=get.url(dev)+url; From e3104160f769b68fe97989b930663beb203baf96 Mon Sep 17 00:00:00 2001 From: mengxinzxz <139629761+mengxinzxz@users.noreply.github.com> Date: Wed, 6 Sep 2023 22:32:04 +0800 Subject: [PATCH 10/10] Update sb.js --- character/sb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/sb.js b/character/sb.js index 2405ce5b1..f16a9929a 100644 --- a/character/sb.js +++ b/character/sb.js @@ -4749,7 +4749,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sbzhiba_info:'主公技,限定技。当你进入濒死状态时,你可以回复X点体力并修改〖激昂③〗为“出牌阶段限X次”(X为场上其他吴势力角色数)。然后其他吴势力角色依次受到1点无来源伤害,且当有角色因此死亡后,你摸三张牌。', sb_daqiao:'谋大乔', sbguose:'国色', - sbguose_info:'出牌阶段限四次。你可以选择一项:1.将一张♦牌当【乐不思蜀】使用;2.弃置场上一张【乐不思蜀】。然后你摸两张牌并弃置一张牌。', + sbguose_info:'出牌阶段限四次。你可以选择一项:1.将一张♦牌当【乐不思蜀】使用;2.弃置场上一张【乐不思蜀】。然后你摸一张牌。', sbliuli:'流离', sbliuli_info:'当你成为【杀】的目标时,你可以弃置一张牌并选择你攻击范围内的一名不为此【杀】使用者的角色,将此【杀】转移给该角色。若你以此法弃置了♥牌,则你可以令一名不为此【杀】使用者的其他角色获得“流离”标记,且移去场上所有其他的“流离”(每回合限一次)。有“流离”的角色回合开始时,其移去其“流离”并执行一个额外的出牌阶段。', sb_liubiao:'谋刘表',