From 257bc05b4d2a51c1a5af69a756357b52c596c911 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Tue, 6 Feb 2024 11:39:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=98=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/huicui.js | 160 +++++++++++++++++++++++++++++++++++++++++++- character/rank.js | 2 + 2 files changed, 160 insertions(+), 2 deletions(-) diff --git a/character/huicui.js b/character/huicui.js index 1a7bc1787..217b22c57 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -4,6 +4,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ name:'huicui', connect:true, character:{ + dc_liuli:['male','shu',4,['dcfuli','dcdehua']], yue_daqiao:['female','wu',3,['dcqiqin','dczixi']], kongrong:['male','qun',3,['dckrmingshi','lirang']], dc_sp_menghuo:['male','qun',4,['dcmanwang']], @@ -102,7 +103,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ huicui:{ sp_baigei:['re_panfeng','xingdaorong','caoxing','re_chunyuqiong','xiahoujie','dc_caiyang','zhoushan'], sp_caizijiaren:['kongrong','re_dongbai','re_sunluyu','heyan','zhaoyan','wangtao','wangyue','zhangxuan','tengyin','zhangyao','xiahoulingnv','dc_sunru','pangshanmin','kuaiqi'], - sp_zhilan:['liuyong','wanniangongzhu','zhanghu','lvlingqi','tenggongzhu','panghui','dc_zhaotongzhaoguang','yuantanyuanxiyuanshang','yuechen','dc_lingcao'], + sp_zhilan:['dc_liuli','liuyong','wanniangongzhu','zhanghu','lvlingqi','tenggongzhu','panghui','dc_zhaotongzhaoguang','yuantanyuanxiyuanshang','yuechen','dc_lingcao'], sp_guixin:['re_kanze','re_chendeng','caimaozhangyun','dc_lvkuanglvxiang','dc_gaolan','yinfuren','chengui','chenjiao','dc_sp_jiaxu','qinlang','dc_dongzhao'], sp_daihan:['mamidi','dc_jiling','zhangxun','dc_yuejiu','wanglie','leibo','qiaorui','dongwan','yuanyin'], sp_jianghu:['guanning','huzhao','dc_huangchengyan','mengjie'], @@ -116,6 +117,156 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, skill:{ + //刘理 + dcfuli:{ + audio:2, + enable:'phaseUse', + filter(event,player){ + return player.getDiscardableCards(player,'h').some(card=>!player.getStorage('dcfuli').includes(get.type2(card))); + }, + async content(event,trigger,player){ + await player.showHandcards(get.translation(player)+'发动了【抚黎】'); + const types=player.getDiscardableCards(player,'h').filter(card=>{ + return !player.getStorage('dcfuli').includes(get.type2(card)); + }).reduce((list,card)=>list.add(get.type2(card)),[]).sort((a,b)=>{ + const getNum=(type)=>{ + let num=['basic','trick','equip'].indexOf(type); + if(num==-1) num=3; + return num; + }; + return getNum(a)-getNum(b); + }); + if(types.length){ + const {result:{control}}=await player.chooseControl(types).set('ai',()=>{ + const player=get.event('player'),types=get.event('types').slice(); + return types.sort((a,b)=>{ + const getNum=(type)=>{ + const cards=player.getDiscardableCards(player,'h').filter(card=>get.type2(card)==type); + const countCards=(target,player,cards)=>{ + return target.countCards('h')-(target==player?cards.length:0); + }; + const max=game.findPlayer(target=>{ + return !game.hasPlayer(target2=>{ + return countCards(target2,player,cards)>countCards(target,player,cards); + }); + }).countCards('h'); + return Math.min(max,cards.reduce((sum,card)=>sum+get.cardNameLength(card),0))/cards.length; + }; + return getNum(b)-getNum(a); + })[0]; + }).set('prompt','弃置一种类别的所有手牌,然后摸这些牌的名字字数之和的牌'); + if(control){ + if(!player.storage.dcfuli){ + player.when({global:'phaseAfter'}).then(()=>delete player.storage.dcfuli); + } + player.markAuto('dcfuli',[control]); + const cards=player.getDiscardableCards(player,'h').filter(card=>get.type2(card)==control); + await player.discard(cards); + const max=game.findPlayer(target=>target.isMaxHandcard()).countCards('h'); + const num=Math.min(max,cards.reduce((sum,card)=>sum+get.cardNameLength(card),0)); + if(num) await player.draw(num); + if(cards.some(card=>card.name!='shandian'&&get.tag(card,'damage'))){ + const {result:{bool,targets}}=await player.chooseTarget('抚黎:是否令一名角色的攻击范围-1直到你的下个回合开始?') + .set('ai',target=>{ + const player=get.event('player'),num=target.getAttackRange(); + return -get.sgn(get.attitude(player,target))*(target.getAttackRange()+(num<=0?(-num+0.5):num)); + }); + if(bool){ + const target=targets[0]; + player.line(target); + target.addSkill('dcfuli_range'); + target.addMark('dcfuli_range',1,false); + player.when('phaseBegin').then(()=>{ + target.removeMark('dcfuli_range',1,false); + if(!target.hasMark('dcfuli_range')) target.removeSkill('dcfuli_range'); + }).vars({target:target}); + } + } + } + } + }, + ai:{ + order:1, + result:{ + player(player){ + const types=player.getDiscardableCards(player,'h').filter(card=>!player.getStorage('dcfuli').includes(get.type2(card))); + if(!types.some(type=>{ + const cards=player.getDiscardableCards(player,'h').filter(card=>get.type2(card)==type); + const countCards=(target,player,cards)=>{ + return target.countCards('h')-(target==player?cards.length:0); + }; + return !game.filterPlayer(target=>{ + return !game.hasPlayer(target2=>{ + return countCards(target2,player,cards)>countCards(target,player,cards); + }); + }).includes(player); + })) return 0; + return 1; + }, + }, + }, + subSkill:{ + range:{ + charlotte:true, + onremove:true, + mod:{ + attackRange(player,num){ + return num-player.countMark('dcfuli_range'); + }, + }, + marktext:' - ', + intro:{content:'攻击范围-#'}, + }, + }, + }, + dcdehua:{ + audio:2, + trigger:{global:'roundStart'}, + forced:true, + async content(event,trigger,player){ + const list=lib.inpile.filter(name=>{ + if(name=='shandian') return false; + const card=new lib.element.VCard({name:name}); + return get.tag(card,'damage')&&player.hasUseTarget(card); + }); + if(list.length){ + const {result:{bool,links}}=await player.chooseButton(['###德化###