diff --git a/character/sp2.js b/character/sp2.js index 6083b4d0e..7dd8049d5 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -4,6 +4,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ name:'sp2', 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']], @@ -112,12 +113,159 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_xuzhou:['re_taoqian','caosong','zhangmiao','qiuliju'], sp_zhongyuan:['re_hucheer','re_zoushi','caoanmin','re_dongcheng'], sp_xiaohu:['haomeng','yanfuren','yanrou','dc_zhuling'], - sp_star:['star_caoren','star_yuanshu','star_dongzhuo','star_yuanshao'], + 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'], } }, skill:{ + //张春华 + starliangyan:{ + audio:2, + enable:'phaseUse', + usable:1, + filterTarget:lib.filter.notMe, + chooseButton:{ + dialog(event,player){ + const name=get.translation(event.result.targets[0]); + const list=[ + '你摸一张牌,其弃置一张牌','你弃置一张牌,其摸一张牌', + '你摸两张牌,其弃置两张牌','你弃置两张牌,其摸两张牌' + ].map((item,i)=>[i,item]); + const dialog=ui.create.dialog( + `梁燕:请选择你与${name}要执行的选项`, + [list.slice(0,2),'tdnodes'], + [list.slice(2,4),'tdnodes'], + 'hidden' + ); + return dialog; + }, + filter(button,player){ + const link=button.link; + if(link%2===0) return true; + return player.countDiscardableCards(player,'he')>=(link+1)/2; + }, + check(button){ + const player=get.player(),target=get.event().getParent().result.targets[0]; + const link=button.link; + if(get.attitude(player,target)<=0&&link===2) return 100; + const ph=player.countCards('h'),th=target.countCards('h'); + if(link%2===0){ + const num=(link/2)+1; + if(ph+num===th-num) return 10; + } + else{ + const num=(link+1)/2; + if(ph-num===th+num) return 10; + } + return 5; + }, + backup(links){ + return { + audio:'starliangyan', + target:get.event().result.targets[0], + link:links[0], + filterTarget(card,player,target){ + return target===lib.skill.starliangyan_backup.target; + }, + selectTarget:-1, + async content(content,trigger,player){ + const target=lib.skill.starliangyan_backup.target; + const link=lib.skill.starliangyan_backup.link; + const num=link<=1?1:2; + const fn=['draw','chooseToDiscard']; + if(link%2===1) fn.reverse(); + await player[fn[0]](num,true,'he'); + await target[fn[1]](num,true,'he'); + if(player.countCards('h')===target.countCards('h')){ + const skipper=[player,target][link%2]; + skipper.skip('phaseDiscard'); + game.log(skipper,'跳过了下一个','#y弃牌阶段'); + } + } + }; + }, + prompt(links){ + return '点击“确定”以执行效果'; + }, + }, + subSkill:{ + backup:{}, + }, + ai:{ + order(item,player){ + if(!game.hasPlayer(current=>current!==player&&get.attitude(player,current)>0)&&game.hasPlayer(current=>get.attitude(player,current)<=0)) return 10; + if(game.hasPlayer(current=>{ + const del=player.countCards('h')-current.countCards('h'),toFind=[2,4].find(num=>Math.abs(del)===num); + if(toFind===4&&del<0&&get.attitude(player,current)<=0){ + return true; + } + return false; + })) return 10; + return 1; + }, + result:{ + target(player,target){ + const del=player.countCards('h')-target.countCards('h'),toFind=[2,4].find(num=>Math.abs(del)===num); + if(toFind){ + return -del*(get.attitude(player,target)*Math.min(3,target.countCards('h')))*toFind/10; + } + return -1; + }, + }, + }, + }, + starminghui:{ + audio:2, + trigger:{global:'phaseEnd'}, + filter(event,player){ + return player.isMinHandcard()||player.isMaxHandcard(); + }, + direct:true, + async content(event,trigger,player){ + let logged=false; + if(player.isMinHandcard()){ + const card=new lib.element.VCard({ + name:'sha', + }); + const result=await player.chooseUseTarget(`###${get.prompt('starminghui')}###视为使用一张无距离限制的【杀】`,card,false,'nodistance').set('logSkill','starminghui').forResult(); + if(result.bool) logged=true; + } + const num=player.countCards('h'); + if(player.isMaxHandcard()&&num>0){ + const maxNum=game.findPlayer(current=>{ + return !game.hasPlayer(current2=>{ + if(current2===player) return false; + return current2.countCards('h')>current.countCards('h'); + }); + }).countCards('h'); + const leastDiscardNum=num-maxNum+1; + const prompt=logged?`是否将手牌弃置至不为最多?`:get.prompt('starminghui'); + const next=player.chooseToDiscard(prompt,`弃置至少${get.cnNumber(leastDiscardNum)}张手牌,然后你令一名角色回复1点体力`) + .set('selectCard',[leastDiscardNum,Infinity]) + .set('goon',game.hasPlayer(current=>get.recoverEffect(current,get.player(),get.player()))) + .set('ai',card=>{ + if(!get.event('goon')) return 0; + if(get.tag(card,'recover')) return 0; + if(ui.selected.cards.length===get.event('selectCard')[0]-1) return 6.5-get.value(card); + return 4-get.value(card); + }); + if(!logged) next.set('logSkill','starminghui'); + const result=await next.forResult(); + if(!result.bool) return; + if(!player.isUnderControl(true)&&!player.isOnline()) await game.asyncDelayx(); + const [bool,targets]=await player.chooseTarget('令一名角色回复1点体力') + .set('ai',target=>get.recoverEffect(target,get.player(),get.player())) + .forResult('bool','targets'); + if(bool){ + const target=targets[0]; + player.line(target,'green'); + await target.recover(); + } + } + }, + + }, //王凌 dcjichou:{ audio:2, @@ -11524,6 +11672,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dcmouli_info:'觉醒技。回合结束时,若你因〖集筹〗给出的牌的牌名总数不小于5,你加1点体力上限并回复1点体力,然后获得〖自缚〗。', dczifu:'自缚', dczifu_info:'锁定技。出牌阶段开始时,你将手牌摸至体力上限(至多摸至五张)。若你以此法得到牌,你须选择手牌中不同牌名的牌各一张,然后弃置其余的手牌。', + star_zhangchunhua:'星张春华', + star_zhangchunhua_prefix:'星', + starliangyan:'梁燕', + starliangyan_info:'出牌阶段限一次。你可以选择一名其他角色,你摸/弃置至多两张牌,令其弃置/摸等量的牌。然后若你与其手牌数相同,以此法摸牌的角色跳过其下一个弃牌阶段。', + starminghui:'明慧', + starminghui_info:'一名角色的回合结束时,若你的手牌数:最少,你可以视为使用一张无距离限制的【杀】;最多,你可以将手牌弃置至你手牌数不为最多,然后令一名角色回复1点体力。', sp_whlw:"文和乱武", sp_zlzy:"逐鹿中原", diff --git a/image/character/star_zhangchunhua.jpg b/image/character/star_zhangchunhua.jpg new file mode 100644 index 000000000..5a583eb98 Binary files /dev/null and b/image/character/star_zhangchunhua.jpg differ