diff --git a/character/huicui.js b/character/huicui.js index e6603cead..54dd25dce 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -5,6 +5,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ connect:true, character:{ dc_simashi:['male','wei',3,['dcsanshi','dczhenrao','dcchenlve']], + dc_wangling:['male','wei',4,['dcjichou','dcmouli'],['clan:太原王氏']], dc_jiangji:['male','wei',3,['dcshiju','dcyingshi']], gongsunxiu:['male','qun',4,['dcgangu','dckuizhen']], dc_liuli:['male','shu',3,['dcfuli','dcdehua']], @@ -117,7 +118,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_raoting:['dc_huanghao','dc_sunziliufang','dc_sunchen','dc_jiachong'], sp_yijun:['gongsundu','mengyou','dc_sp_menghuo','gongsunxiu'], sp_zhengyin:['yue_caiwenji','yue_zhoufei','yue_caiyong','yue_xiaoqiao','yue_daqiao'], - sp_zhonghu:['dc_jiangji','dc_simashi'], + sp_zhonghu:['dc_jiangji','dc_wangling','dc_simashi'], } }, /** @type { importCharacterConfig['skill'] } */ @@ -349,6 +350,139 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, }, + //王凌 + dcjichou:{ + audio:2, + trigger:{player:'phaseUseEnd'}, + filter(event,player){ + const evts=player.getHistory('useCard',evt=>evt.getParent('phaseUse')===event); + const names=evts.map(evt=>evt.card.name).unique(); + return evts.length>0&&evts.length===names.length&&evts.some(evt=>evt.cards.some(card=>get.position(card)==='d')); + }, + async content(event,trigger,player){ + const cards=[]; + player.checkHistory('useCard',evt=>{ + if(evt.getParent('phaseUse')!==trigger) return; + cards.addArray(evt.cards.filterInD('d')); + }); + const num=Math.min(cards.length,game.countPlayer()); + if(_status.connectMode) game.broadcastAll(()=>{_status.noclearcountdown=true}); + const [bool,links]=await player.chooseButton([ + `集筹:将${numget.attitude(player,current)>0), + game.countPlayer(current=>get.attitude(player,current)<0) + ]) + .set('ai',button=>{ + const card=button.link,population=get.event('population'); + if(ui.selected.buttons.length>population[0]+population[1]) return 0; + if(ui.selected.buttons.length>get.event('population')[0]) return 2-get.value(card); + return 2+get.value(card); + }) + .forResult('bool','links'); + if(bool){ + const [bool,targets]=await player.chooseTarget( + `集筹:请选择${get.cnNumber(links.length)}名角色`, + `操作提示:请按照顺序选择要交给牌的目标,令这些角色按顺序获得这些牌:${get.translation(links)}`, + true, + links.length, + ) + .set('values',links.map(i=>get.value(i))) + .set('ai',target=>{ + const att=get.attitude(get.player(),target); + const chosenNum=ui.selected.targets.length,values=get.event('values'); + if(values[chosenNum]>0) return att; + return 0.01-att; + }) + .forResult('bool','targets'); + if(_status.connectMode){game.broadcastAll(()=>{delete _status.noclearcountdown;game.stopCountChoose()})} + if(bool){ + const gain_list=[],givenCards=[]; + targets.forEach((target,i)=>{ + player.line(target,'green'); + gain_list.push([target,links[i]]); + givenCards.push(links[i]); + game.log(player,'将',links[i],'交给了',target); + }); + event.getParent().set('givenCards',givenCards); + await game.loseAsync({ + gain_list, + player:player, + cards:givenCards, + giver:player, + animate:'gain2', + }).setContent('gaincardMultiple'); + const toDraw=player.getAllHistory('useSkill',evt=>{ + const evtx=evt.event; + return evt.skill==='dcjichou'&&evtx.givenCards&&evtx.givenCards.length; + })[0].event.givenCards.length; + await game.asyncDelayx(); + await player.draw(toDraw); + } + } + if(_status.connectMode){game.broadcastAll(()=>{delete _status.noclearcountdown;game.stopCountChoose()})} + }, + }, + dcmouli:{ + audio:2, + trigger:{player:'phaseEnd'}, + filter(event,player){ + const names=[]; + player.checkAllHistory('useSkill',evt=>{ + if(evt.skill!=='dcjichou') return; + const evtx=evt.event; + if(evtx.givenCards) names.addArray(evtx.givenCards.map(card=>get.name(card,false))); + }); + return names.length>=5; + }, + forced:true, + juexingji:true, + skillAnimation:true, + animationColor:'water', + derivation:['dczifu'], + async content(event,trigger,player){ + player.awakenSkill('dcmouli'); + await player.gainMaxHp(); + await player.recover(); + await player.addSkills('dczifu'); + }, + }, + dczifu:{ + audio:2, + trigger:{player:'phaseUseBegin'}, + forced:true, + async content(event,trigger,player){ + const maxLimit=Math.min(5,player.maxHp); + let count=player.countCards('h'); + if(countevt.getParent(2)===event)) return; + count=player.countCards('h'); + const toKeepCount=player.getCards('h').map(card=>get.name(card)).unique(); + if(count>toKeepCount){ + const [bool,cards]=await player.chooseCard('自缚:选择要保留的手牌','选择不同牌名的手牌各一张,然后弃置其余手牌',toKeepCount) + .set('filterCard',card=>{ + if(!ui.selected.cards.length) return true; + const name=get.name(card,player); + if(ui.selected.cards.some(card=>get.name(card,player)===name)) return false; + return true; + }) + .set('complexCard',true) + .set('ai',get.value) + .forResult('bool','cards'); + if(!bool) return; + const toDiscard=player.getCards('h').removeArray(cards); + if(toDiscard.length) player.discard(toDiscard); + } + }, + ai:{ + halfneg:true, + }, + }, //蒋济 dcshiju:{ audio:2, @@ -12625,6 +12759,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dcshiju_info:'其他角色的出牌阶段限一次。其可以交给你一张牌,若此牌为装备牌,你可以使用之,然后其本回合攻击范围+X(X为你装备区里的牌数)。若你以此法替换了装备,你与其各摸两张牌。', dcyingshi:'应时', dcyingshi_info:'每回合每项各限一次。当你使用普通锦囊牌指定第一个目标后,若有目标不为本回合第一次成为牌的目标,则你可以令其选择一项:⒈令你于此牌结算结束后视为对其使用一张与此牌牌名相同的牌;⒉弃置X张牌,此牌对其无效(X为你装备区里的牌数)。', + dc_wangling:'王凌', + dcjichou:'集筹', + dcjichou_info:'出牌阶段结束时,若你于此阶段使用过牌且这些牌的牌名均不同,你可以观看位于弃牌堆中的这些牌,选择任意张牌并选择等量角色,将这些牌交给这些角色各一张,然后你摸X张牌(X为你本局游戏首次发动〖集筹〗给出的牌数)。', + dcmouli:'谋立', + dcmouli_info:'觉醒技。回合结束时,若你因〖集筹〗给出的牌的牌名总数不小于5,你加1点体力上限并回复1点体力,然后获得〖自缚〗。', + dczifu:'自缚', + dczifu_info:'锁定技。出牌阶段开始时,你将手牌摸至体力上限(至多摸至五张)。若你以此法得到牌,你须选择手牌中不同牌名的牌各一张,然后弃置其余的手牌。', dc_simashi:'司马师', dcsanshi:'散士', dcsanshi_tag:'死士', diff --git a/character/sp2.js b/character/sp2.js index 7dd8049d5..4600aef42 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -5,7 +5,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ connect:true, character:{ star_zhangchunhua:['female','wei',3,['starliangyan','starminghui']], - dc_wangling:['male','wei',4,['dcjichou','dcmouli']], star_yuanshao:['male','qun',4,['starxiaoyan','starzongshi','starjiaowang','staraoshi'],['zhu']], star_dongzhuo:['male','qun',5,['starweilin','starzhangrong','starhaoshou'],['zhu']], star_yuanshu:['male','qun',4,['starcanxi','starpizhi','starzhonggu'],['zhu']], @@ -115,7 +114,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_xiaohu:['haomeng','yanfuren','yanrou','dc_zhuling'], sp_star:['star_caoren','star_yuanshu','star_dongzhuo','star_yuanshao','star_zhangchunhua'], mini_qixian:['mp_liuling'], - sp_decade:['caobuxing','re_maliang','dc_jikang','dc_wangling'], + sp_decade:['caobuxing','re_maliang','dc_jikang'], } }, skill:{ @@ -266,139 +265,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, - //王凌 - dcjichou:{ - audio:2, - trigger:{player:'phaseUseEnd'}, - filter(event,player){ - const evts=player.getHistory('useCard',evt=>evt.getParent('phaseUse')===event); - const names=evts.map(evt=>evt.card.name).unique(); - return evts.length>0&&evts.length===names.length&&evts.some(evt=>evt.cards.some(card=>get.position(card)==='d')); - }, - async content(event,trigger,player){ - const cards=[]; - player.checkHistory('useCard',evt=>{ - if(evt.getParent('phaseUse')!==trigger) return; - cards.addArray(evt.cards.filterInD('d')); - }); - const num=Math.min(cards.length,game.countPlayer()); - if(_status.connectMode) game.broadcastAll(()=>{_status.noclearcountdown=true}); - const [bool,links]=await player.chooseButton([ - `集筹:将${numget.attitude(player,current)>0), - game.countPlayer(current=>get.attitude(player,current)<0) - ]) - .set('ai',button=>{ - const card=button.link,population=get.event('population'); - if(ui.selected.buttons.length>population[0]+population[1]) return 0; - if(ui.selected.buttons.length>get.event('population')[0]) return 2-get.value(card); - return 2+get.value(card); - }) - .forResult('bool','links'); - if(bool){ - const [bool,targets]=await player.chooseTarget( - `集筹:请选择${get.cnNumber(links.length)}名角色`, - `操作提示:请按照顺序选择要交给牌的目标,令这些角色按顺序获得这些牌:${get.translation(links)}`, - true, - links.length, - ) - .set('values',links.map(i=>get.value(i))) - .set('ai',target=>{ - const att=get.attitude(get.player(),target); - const chosenNum=ui.selected.targets.length,values=get.event('values'); - if(values[chosenNum]>0) return att; - return 0.01-att; - }) - .forResult('bool','targets'); - if(_status.connectMode){game.broadcastAll(()=>{delete _status.noclearcountdown;game.stopCountChoose()})} - if(bool){ - const gain_list=[],givenCards=[]; - targets.forEach((target,i)=>{ - player.line(target,'green'); - gain_list.push([target,links[i]]); - givenCards.push(links[i]); - game.log(player,'将',links[i],'交给了',target); - }); - event.getParent().set('givenCards',givenCards); - await game.loseAsync({ - gain_list, - player:player, - cards:givenCards, - giver:player, - animate:'gain2', - }).setContent('gaincardMultiple'); - const toDraw=player.getAllHistory('useSkill',evt=>{ - const evtx=evt.event; - return evt.skill==='dcjichou'&&evtx.givenCards&&evtx.givenCards.length; - })[0].event.givenCards.length; - await game.asyncDelayx(); - await player.draw(toDraw); - } - } - if(_status.connectMode){game.broadcastAll(()=>{delete _status.noclearcountdown;game.stopCountChoose()})} - }, - }, - dcmouli:{ - audio:2, - trigger:{player:'phaseEnd'}, - filter(event,player){ - const names=[]; - player.checkAllHistory('useSkill',evt=>{ - if(evt.skill!=='dcjichou') return; - const evtx=evt.event; - if(evtx.givenCards) names.addArray(evtx.givenCards.map(card=>get.name(card,false))); - }); - return names.length>=5; - }, - forced:true, - juexingji:true, - skillAnimation:true, - animationColor:'water', - derivation:['dczifu'], - async content(event,trigger,player){ - player.awakenSkill('dcmouli'); - await player.gainMaxHp(); - await player.recover(); - await player.addSkills('dczifu'); - }, - }, - dczifu:{ - audio:2, - trigger:{player:'phaseUseBegin'}, - forced:true, - async content(event,trigger,player){ - const maxLimit=Math.min(5,player.maxHp); - let count=player.countCards('h'); - if(countevt.getParent(2)===event)) return; - count=player.countCards('h'); - const toKeepCount=player.getCards('h').map(card=>get.name(card)).unique(); - if(count>toKeepCount){ - const [bool,cards]=await player.chooseCard('自缚:选择要保留的手牌','选择不同牌名的手牌各一张,然后弃置其余手牌',toKeepCount) - .set('filterCard',card=>{ - if(!ui.selected.cards.length) return true; - const name=get.name(card,player); - if(ui.selected.cards.some(card=>get.name(card,player)===name)) return false; - return true; - }) - .set('complexCard',true) - .set('ai',get.value) - .forResult('bool','cards'); - if(!bool) return; - const toDiscard=player.getCards('h').removeArray(cards); - if(toDiscard.length) player.discard(toDiscard); - } - }, - ai:{ - halfneg:true, - }, - }, //星袁绍 starxiaoyan:{ audio:2, @@ -11665,13 +11531,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ starjiaowang_info:'锁定技,非首轮游戏开始时,若上一轮没有角色死亡(因〖硝焰〗死亡的角色除外),则你失去1点体力并发动〖硝焰〗。', staraoshi:'傲势', staraoshi_info:'主公技,其他群势力角色的出牌阶段限一次,其可以交给你一张手牌,然后你可以发动一次〖纵势〗。', - dc_wangling:'王凌', - dcjichou:'集筹', - dcjichou_info:'出牌阶段结束时,若你于此阶段使用过牌且这些牌的牌名均不同,你可以观看位于弃牌堆中的这些牌,选择任意张牌并选择等量角色,将这些牌交给这些角色各一张,然后你摸X张牌(X为你本局游戏首次发动〖集筹〗给出的牌数)。', - dcmouli:'谋立', - dcmouli_info:'觉醒技。回合结束时,若你因〖集筹〗给出的牌的牌名总数不小于5,你加1点体力上限并回复1点体力,然后获得〖自缚〗。', - dczifu:'自缚', - dczifu_info:'锁定技。出牌阶段开始时,你将手牌摸至体力上限(至多摸至五张)。若你以此法得到牌,你须选择手牌中不同牌名的牌各一张,然后弃置其余的手牌。', star_zhangchunhua:'星张春华', star_zhangchunhua_prefix:'星', starliangyan:'梁燕',