From 866b03db8051e66ed7a64ab1ea27f5784af6eee1 Mon Sep 17 00:00:00 2001 From: copcap Date: Sun, 17 Mar 2024 16:37:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=B7=E5=A4=96=E6=9C=8D=E6=96=B0=E5=B0=86?= =?UTF-8?q?=E6=8A=80=E8=83=BD=E8=B0=83=E6=95=B4=E4=B8=8E=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/tw.js | 244 ++++++++++++++++++++++++++++-------------------- 1 file changed, 144 insertions(+), 100 deletions(-) diff --git a/character/tw.js b/character/tw.js index 644a91db8..bfb94b8d4 100644 --- a/character/tw.js +++ b/character/tw.js @@ -134,6 +134,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ kaisa:["male","western",4,["zhengfu"]], }, characterIntro:{ + yanliang:'颜良(?~200年),字公骥,安平郡堂阳县(今河北省新河县)人。东汉末年河北将领。颜良性格促狭,虽骁勇不可独任,为一夫之勇。官渡之战,袁绍令颜良进攻白马(今河南滑县)。曹操采用军师荀攸“声东击西、轻兵掩袭”之计,大败袁军,颜良本人也被关羽亲自斩杀死,白马之围遂解。据说颜之推是其后人。', + wenchou:'文丑(?~200年),东汉末年河北将领。文丑为一夫之勇。建安五年(200年),带领左将军刘备进驻延津,误中曹操军师荀攸的“饵敌”之计,其麾下“五六千骑”惨败于“不满六百”的曹军骑兵。文丑本人也死于乱军之中,葬于河南省禹州市。', + yuantan:'袁谭(?-205年),字显思,汝南郡汝阳县,袁绍长子,曾任青州刺史。建安元年(196年),击败田楷、孔融,完全占据青州。袁绍去世后,审配等伪立遗令,拥立袁尚为继承人,袁谭不能继位,心怀愤恨。后袁谭、袁尚二人的矛盾彻底爆发,袁谭联合曹操共同攻打袁尚。建安十年,曹操兴兵进攻南皮,袁谭奋力抵抗,终于在曹操急攻之下战败,为曹纯麾下虎豹骑所杀。', yuzhenzi:'评书三国中的人物,其人有徒弟兼义子童渊、徒弟并州李彦,有徒孙常山赵子龙、北地枪王张绣、张任等人。', shie:'三国人物,善剑术。桓、灵间,有虎贲王越以剑术称于京师,阿得其法。魏帝曹丕曾从阿学剑术。曹丕在《典论·自叙》中说:“余又学击剑,阅师多矣,四方之法各异,唯京师为善。桓、灵之间,有虎贲王越善斯术,称於京师。河南史阿言昔与越游,具得其法,余从阿学精熟。尝与平虏将军刘勋、奋威将军邓展等共饮,宿闻展善有手臂,晓五兵,又称其能空手入白刃。余与论剑良久,谓将军非法也,余顾尝好之,又得善术,因求与余对。', shitao:'石韬,字广元,即石广元,颍川(今河南禹州)人,仕魏,官拜典农校尉、郡守。初平年间,石韬与徐庶一同来到荆州,在荆州时与诸葛亮和庞统等人相善。与崔州平(名钧)、孟公威(名建)、徐元直(名庶)为“诸葛四友”。', @@ -301,6 +304,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ derivation:['twxiayong','twylyanshix'], global:'twduwang_global', group:['twduwang_effect','twduwang_achieve','twduwang_fail'], + onremove:['twduwang','twduwang_fail'], subSkill:{ effect:{ audio:'twduwang1.mp3', @@ -334,8 +338,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, async content(event,trigger,player){ const targets=event.targets; - player.logSkill('twduwang_effect',targets); await player.draw(targets.length+1); + await game.asyncDelayx(); for(const target of targets){ if(!target.hasCard(card=>{ return target.canUse(get.autoViewAs({name:'juedou'},[card]),player,false); @@ -358,6 +362,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }) .set('sourcex',player) .set('addCount',false); + await game.asyncDelayx(); } }, }, @@ -369,15 +374,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(get.name(card)=='sha') return 5-get.value(card); return 8-get.value(card); }, + precontent(){ + delete event.result.skill; + } }, achieve:{ audio:'twduwang2.mp3', trigger:{player:'phaseZhunbeiBegin'}, filter(event,player){ + if(player.storage.twduwang_fail) return false; const history=player.actionHistory; if(history.length<2) return false; for(let i=history.length-2;i>=0;i--){ - if(history[i].isMe){ + if(history[i].isMe&&!history[i].isSkipped){ let num=history[i].useCard.filter(evt=>{ return evt.card.name=='juedou'; }).length,targets=game.players.slice().concat(game.dead.slice()); @@ -397,19 +406,27 @@ game.import('character',function(lib,game,ui,get,ai,_status){ async content(event,trigger,player){ player.awakenSkill('twduwang'); game.log(player,'完成使命'); + if(player.awakenedSkills.includes('twduwang')){ + player.restoreSkill('twduwang'); + game.log(player,'重置了技能','#g【独往】'); + } + if(!player.storage.twduwang_fail){ + player.storage.twduwang_fail=true; + game.log(player,'修改了技能','#g【独往】'); + } let result,bool1=(player.hasSkill('twxiayong',null,false,false)),bool2=(!player.awakenedSkills.includes('twylyanshi')&&player.storage.twduwang_ylyanshi); if(bool1&&bool2) result={index:2}; else if(bool1) result={index:1}; else if(bool2) result={index:0}; else result=await player.chooseControl().set('choiceList',[ - '获得技能【狭勇】', - '重置【延势】,获得【延势】的历战效果', + '获得〖狭勇〗', + '重置〖延势〗并为其添加历战效果', ]).set('prompt','独往:请选择一项').set('ai',()=>{ const player=get.event('player'),num=game.countPlayer(current=>{ return current!=player&¤t.hasCard(card=>{ if(get.position(card)=='h') return true; return current.canUse(get.autoViewAs({name:'juedou'},[card]),player,false); - },'he')&&get.effect(current,{name:'guohe_copy2'},current,player)+get.effect(player,{name:'juedou'},current,player); + },'he')&&(get.effect(current,{name:'guohe_copy2'},current,player)/2.5+get.effect(player,{name:'juedou'},current,player)>0); }); return num>=2?0:1; }).forResult(); @@ -425,16 +442,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ game.log(player,'修改了技能','#g【延势】'); } } - else{ - if(player.awakenedSkills.includes('twduwang')){ - player.restoreSkill('twduwang'); - game.log(player,'重置了技能','#g【独往】'); - } - if(!player.storage.twduwang_fail){ - player.storage.twduwang_fail=true; - game.log(player,'修改了技能','#g【独往】'); - } - } }, }, fail:{ @@ -480,6 +487,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ limited:true, skillAnimation:true, animationColor:'fire', + onremove:['twylyanshi','twduwang_ylyanshi'], chooseButton:{ dialog(event,player){ const list=['juedou','binglinchengxiax'].concat(get.zhinangs()).filter(name=>{ @@ -564,36 +572,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return target!=player&&player.canUse(card,target); }, usable:1, + onremove:'twjuexing_lizhan', async content(event,trigger,player){ + player.when({global:'phaseEnd'}).then(()=>{ + player.popup('历战'); + player.addSkill('twjuexing_lizhan'); + player.addMark('twjuexing_lizhan',1,false); + game.log(player,'触发了','#g【绝行】','的','#y历战','效果'); + }); const target=event.target; const card=new lib.element.VCard({name:'juedou'}); - player.when({global:'juedouBegin'}).filter(evt=>evt.getParent(2)==event) - .vars({target:target}).then(()=>{ - player.addSkill('twjuexing_buff'); - target.addSkill('twjuexing_buff'); - }).then(()=>{ - let list=[]; - for(const i of [player,target]){ - if(i.isIn()&&i.countCards('h')){ - list.push([i,i.getCards('h')]); - } - } - if(list.length){ - game.loseAsync({ - lose_list:list, - log:true, - animate:'giveAuto', - gaintag:['twjuexing_buff'], - }).setContent(get.info('sbquhu').addToExpansionMultiple); - } - }).then(()=>{ - if(player.getHp()) player.draw(player.getHp(),(target.getHp()?'nodelay':'')).gaintag=['twjuexing']; - if(target.getHp()) target.draw(target.getHp()).gaintag=['twjuexing']; - }); + player.addTempSkill('twjuexing_effect'); player.when({global:'useCardAfter'}).filter(evtx=>evtx.getParent()==event) - .vars({target:target}).then(()=>{ + .then(()=>{ let list=[]; - for(const i of [player,target]){ + var targets=[player].concat(trigger.targets); + for(const i of targets){ if(i.isIn()&&i.hasCard(card=>card.hasGaintag('twjuexing'),'h')){ list.push([i,i.getCards('h',card=>card.hasGaintag('twjuexing'))]); } @@ -603,7 +597,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }).then(()=>{ let listx=[]; - for(const i of [player,target]){ + var targets=[player].concat(trigger.targets); + for(const i of targets){ if(i.isIn()&&i.getExpansions('twjuexing_buff').length){ listx.push([i,i.getExpansions('twjuexing_buff')]); } @@ -612,16 +607,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ game.loseAsync({gain_list:listx,animate:'draw'}).setContent('gaincardMultiple'); } }).then(()=>{ - player.removeSkill('twjuexing_buff'); - target.removeSkill('twjuexing_buff'); + var targets=[player].concat(trigger.targets); + targets.forEach(current=>{ + current.removeSkill('twjuexing_buff'); + }); + game.delay(); }); await player.useCard(card,target,false); - player.when({global:'phaseEnd'}).then(()=>{ - player.popup('历战'); - player.addSkill('twjuexing_tuzhan'); - player.addMark('twjuexing_tuzhan',1,false); - game.log(player,'触发了','#g【绝行】','的','#y历战','效果'); - }); }, ai:{ order:1, @@ -632,14 +624,45 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, subSkill:{ - tuzhan:{ + effect:{ + trigger:{global:'useCardToBegin'}, + forced:true, + popup:false, + charlotte:true, + filter(event,player){ + return event.getParent(2).name==='twjuexing'; + }, + async content(event,trigger,player){ + const target=trigger.target; + player.addSkill('twjuexing_buff'); + target.addSkill('twjuexing_buff'); + let list=[]; + for(const i of [player,target]){ + if(i.isIn()&&i.countCards('h')){ + list.push([i,i.getCards('h')]); + } + } + if(list.length){ + await game.loseAsync({ + lose_list:list, + log:true, + animate:'giveAuto', + gaintag:['twjuexing_buff'], + }).setContent(get.info('sbquhu').addToExpansionMultiple); + } + if(player.getHp()>0) await player.draw(player.getHp(),(target.getHp()>0?'nodelay':'')).set('gaintag',['twjuexing']); + if(target.getHp()>0) await target.draw(target.getHp()).set('gaintag',['twjuexing']); + await game.asyncDelay(); + } + }, + lizhan:{ charlotte:true, onremove:true, marktext:'战', intro:{content:'因【绝行】摸牌时,摸牌数+#'}, trigger:{player:'drawBegin'}, filter(event,player){ - if(!player.hasMark('twjuexing_tuzhan')) return false; + if(!player.hasMark('twjuexing_lizhan')) return false; return (event.gaintag||[]).includes('twjuexing'); }, forced:true, @@ -647,7 +670,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content(){ player.popup('历战'); game.log(player,'触发了','#g【绝行】','的','#y历战','效果'); - trigger.num+=player.countMark('twjuexing_tuzhan'); + trigger.num+=player.countMark('twjuexing_lizhan'); }, }, buff:{ @@ -670,7 +693,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ twxiayong:{ audio:2, audioname:['tw_yanliang'], - trigger:{global:'damageBegin2'}, + trigger:{global:'damageBegin1'}, filter(event,player){ if(event.getParent().type!='card'||event.card.name!='juedou'||!event.player.isIn()) return false; const evt=game.getGlobalHistory('useCard',evt=>evt.card==event.card)[0]; @@ -684,8 +707,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, forced:true, logTarget:'player', - content(){ - trigger.player==player?player.chooseToDiscard('h',true):trigger.num++; + async content(event,trigger,player){ + if(trigger.player===player){ + const cards=player.getCards('h',card=>{ + return lib.filter.cardDiscardable(card,player,'twxiayong'); + }); + if(cards.length>0) player.discard(cards.randomGet()); + } + else{ + trigger.increase('num'); + } }, }, //袁谭 @@ -726,8 +757,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ const evtx=evt.getParent(); if(evtx.name!='orderingDiscard') return false; const evt2=(evtx.relatedEvent||evtx.getParent()); - if(evt2.name=='phaseJudge'||evt2.player==player) return false; - return evt.cards.filterInD('d').length; + const current=evt2.player; + if(evt2.name=='phaseJudge'||current==player) return false; + return current.hasHistory('lose',evtx3=>{ + const evtx4=evtx3.relatedEvent||evtx3.getParent(); + if(evt2!=evtx4) return false; + return evtx3.getl(current).cards2.length>0; + }); }); if(historyx.length){ for(const evtx of historyx) cards.addArray(evtx.cards.filterInD('d')); @@ -741,50 +777,54 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter(event,player){ return player.isDamaged()&&player.countCards('h')&&game.hasPlayer(target=>{ return target!=player&&target.countCards('h'); - })&&(player.getHp()+player.countMark('twbaizu_tuzhan')); + })&&(player.getHp()+player.countMark('twbaizu_lizhan')); }, - forced:true, - async content(event,trigger,player){ - const sum=player.getHp()+player.countMark('twbaizu_tuzhan'); - let result,filterTarget=(_,player,target)=>{ + locked:true, + async cost(event,trigger,player){ + const sum=player.getHp()+player.countMark('twbaizu_lizhan'),filterTarget=(_,player,target)=>{ return target!=player&&target.countCards('h'); - },targets=game.filterPlayer(target=>filterTarget(null,player,target)); - if(targets.length<=sum) result={bool:true,targets:targets}; - else result=await player.chooseTarget('请选择【败族】的目标','令你和这些角色同时弃置一张手牌,然后你对与你弃置牌类别相同的角色各造成1点伤害',filterTarget,sum,true).set('ai',target=>{ - const player=get.event('player'); - return get.effect(target,{name:'guohe_copy2'},target,player)+get.damageEffect(target,player,player); - }).forResult(); - if(result.bool){ - targets=result.targets.sortBySeat(); - player.line(targets); - let list=[player].concat(targets).filter(target=>target.countDiscardableCards(target,'h')); - if(list.length){ - let discards=[]; - const {result}=await player.chooseCardOL(list,'败族:弃置一张手牌',(card,player)=>{ - return lib.filter.cardDiscardable(card,player); - },true).set('ai',get.unuseful); - if(result){ - for(let i=0;iget.type2(result[0].cards[0])==get.type2(result[list.indexOf(i)].cards[0])); - if(list.length){ - player.line(list); - for(const i of list) await i.damage(); + }; + let targets=game.filterPlayer(target=>filterTarget(null,player,target)); + if(targets.length>sum){ + targets=await player.chooseTarget('请选择【败族】的目标','令你和这些角色同时弃置一张手牌,然后你对与你弃置牌类别相同的其他角色各造成1点伤害',filterTarget,sum,true).set('ai',target=>{ + const player=get.event('player'); + return get.effect(target,{name:'guohe_copy2'},target,player)+get.damageEffect(target,player,player); + }).forResultTargets(); + } + event.result={bool:true,targets}; + }, + async content(event,trigger,player){ + const targets=event.targets.slice().sortBySeat(); + player.line(targets); + let list=[player].concat(targets).filter(target=>target.countDiscardableCards(target,'h')); + if(list.length){ + let discards=[]; + const {result}=await player.chooseCardOL(list,'败族:请弃置一张手牌',(card,player)=>{ + return lib.filter.cardDiscardable(card,player); + },true).set('ai',get.unuseful); + if(result){ + for(let i=0;iget.type2(result[0].cards[0])==get.type2(result[list.indexOf(i)].cards[0])); + if(list.length){ + for(const i of list){ + if(i===player) continue; + player.line(i); + await i.damage(); } } } } player.when({global:'phaseEnd'}).then(()=>{ player.popup('历战'); - player.addSkill('twbaizu_tuzhan'); - player.addMark('twbaizu_tuzhan',1,false); + player.addMark('twbaizu_lizhan',1,false); game.log(player,'触发了','#g【败族】','的','#y历战','效果'); }); }, subSkill:{ - tuzhan:{ + lizhan:{ charlotte:true, onremove:true, marktext:'战', @@ -15955,10 +15995,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return str; }, twduwang(player){ - let str='使命技。使命:出牌阶段开始时,你可以选择至多三名其他角色并摸X张牌(X为选择角色数+1),然后这些角色依次将一张牌当作【决斗】对你使用。成功:准备阶段,若你上回合使用和成为【决斗】的次数和不小于4(若游戏总人数小于4则改为3),你选择一项:①获得技能〖狭勇〗;②重置〖独往〗和〖延势〗并删除〖独往〗的使命失败分支。'; - if(player.storage.twduwang_fail) str+=''; - str+='失败:当你进入濒死状态时,其他角色不能对你使用【桃】,当你死亡时,使命失败。'; - if(player.storage.twduwang_fail) str+=''; + let str='使命技。'; + if(!player.storage.twduwang_fail) str+='①'; + str+='出牌阶段开始时,你可以选择至多三名有牌的其他角色,摸X张牌(X为选择角色数+1),然后这些角色依次将一张牌当【决斗】对你使用。'; + if(!player.storage.twduwang_fail) str+=`\ + ②当你处于濒死状态时,其他角色不能对你使用【桃】。\ + ③使命:使用【决斗】或成为【决斗】目标的次数之和不小于4(若游戏总人数小于4则改为3)。\ + ④成功:准备阶段,若你于你的上回合完成了〖独往③〗的使命,则你重置〖独往〗并将〖独往〗修改至只保留〖独往①〗的效果,选择一项:⒈获得〖狭勇〗;⒉重置〖延势〗并令其获得历战效果。\ + ⑤失败:当你死亡时,使命失败。`; return str; }, twylyanshi(player){ @@ -16638,19 +16682,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){ tw_wenchou:'文丑', tw_yuantan:'袁谭', twduwang:'独往', - twduwang_info:'使命技。使命:出牌阶段开始时,你可以选择至多三名其他角色并摸X张牌(X为选择角色数+1),然后这些角色依次将一张牌当作【决斗】对你使用。成功:准备阶段,若你上回合使用和成为【决斗】的次数和不小于4(若游戏总人数小于4则改为3),你选择一项,然后重置〖独往〗并删除〖独往〗的使命失败分支:①获得技能〖狭勇〗;②重置〖延势〗并修改〖延势〗(令〖延势〗获得历战效果)。失败:当你进入濒死状态时,其他角色不能对你使用【桃】,当你死亡时,使命失败。', + twduwang_info:'使命技。①出牌阶段开始时,你可以选择至多三名有牌的其他角色,摸X张牌(X为选择角色数+1),然后这些角色依次将一张牌当【决斗】对你使用。②当你处于濒死状态时,其他角色不能对你使用【桃】。③使命:使用【决斗】或成为【决斗】目标的次数之和不小于4(若游戏总人数小于4则改为3)。④成功:准备阶段,若你于你的上回合完成了〖独往③〗的使命,则你重置〖独往〗并将〖独往〗修改至只保留〖独往①〗的效果,选择一项:⒈获得〖狭勇〗;⒉重置〖延势〗并令其获得历战效果。⑤失败:当你死亡时,使命失败。', twylyanshi:'延势', - twylyanshi_info:'限定技,你可以将一张【杀】当作【决斗】、【兵临城下】或任意智囊牌使用或打出。', + twylyanshi_info:'限定技。你可以将一张【杀】当作【决斗】、【兵临城下】或任意智囊牌使用或打出。', twylyanshix:'延势·改', - twylyanshix_info:'限定技,你可以将一张【杀】当作【决斗】、【兵临城下】或任意智囊牌使用或打出。历战:重置〖延势〗。', + twylyanshix_info:'限定技。你可以将一张【杀】当作【决斗】、【兵临城下】或任意智囊牌使用或打出。历战:重置〖延势〗。', twjuexing:'绝行', - twjuexing_info:'出牌阶段限一次,你可以视为对一名其他角色使用【决斗】。此【决斗】生效时,你与其将所有手牌扣置于武将牌上,然后各摸等同于当前体力值的牌,此牌结算完毕后,你与其弃置本次以此法摸的牌,然后获得扣置于武将牌上的牌。历战:当你因〖绝行〗摸牌时,摸牌数+1。', + twjuexing_info:'出牌阶段限一次。你可以视为对一名其他角色使用一张【决斗】。此牌对一名角色生效时,你与其将所有手牌扣置于武将牌上,然后各摸等同于当前体力值的牌。此牌结算结束后,你与所有目标角色弃置本次以此法摸的牌,然后获得扣置于武将牌上的牌。历战:当你因〖绝行〗摸牌时,摸牌数+1。', twxiayong:'狭勇', - twxiayong_info:'锁定技,当你使用的【决斗】对其他角色造成伤害时,或其他角色使用【决斗】对你造成伤害时,若受伤角色为/不为你,则你弃置一张牌/此伤害+1。', + twxiayong_info:'锁定技。当你使用的【决斗】或目标角色包括你的【决斗】造成伤害时,若受伤角色为你,则你随机弃置一张手牌;否则你令此伤害+1。', twqiaosi:'峭嗣', - twqiaosi_info:'结束阶段,你可以获得其他角色本回合从其手牌区和装备区进入弃牌堆的牌,然后若你以此法获得的牌数小于你的体力值,则你失去1点体力。', + twqiaosi_info:'结束阶段,你可以获得由其他角色区域直接置入或经由处理区置入弃牌堆的所有牌,然后若你以此法获得的牌数小于你的体力值,则你失去1点体力。', twbaizu:'败族', - twbaizu_info:'锁定技,结束阶段,若你已受伤且你有手牌,则你须选择X名有手牌的其他角色(X为你的体力值),你与这些角色同时弃置一张手牌,然后你对与你弃置牌类别相同的所有角色各造成1点伤害。历战:〖败族〗目标选择数+1。', + twbaizu_info:'锁定技。结束阶段,若你已受伤且你有手牌,则你须选择X名有手牌的其他角色(X为你的体力值),你与这些角色同时弃置一张手牌,然后你对与你弃置牌类别相同的所有其他角色各造成1点伤害。历战:〖败族〗目标选择数+1。', tw_mobile:'海外服·稀有专属', tw_yunchouzhi:'运筹帷幄·智',