diff --git a/character/onlyOL.js b/character/onlyOL.js index 3b851c9fb..37f2826a2 100644 --- a/character/onlyOL.js +++ b/character/onlyOL.js @@ -14,7 +14,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ol_sb_yuanshao:['male','qun',4,['olsbhetao','olsbshenli','olsbyufeng','olsbshishou'],['zhu']], ol_yufan:['male','wu',3,['olzongxuan','olzhiyan'],['tempname:re_yufan','die_audio:re_yufan']], ol_chengpu:['male','wu',4,['dclihuo','olchunlao'],['tempname:xin_chengpu','die_audio:xin_chengpu']], - ol_wangyi:['female','wei',3,['olzhenlie','miji']], + ol_wangyi:['female','wei',3,['olzhenlie','olmiji']], }, characterSort:{ onlyOL:{ @@ -80,7 +80,68 @@ game.import('character',function(lib,game,ui,get,ai,_status){ await player.gainPlayerCard(target,'he',true); } else{ - await player.useSkill('miji'); + await player.useSkill('olmiji'); + } + } + }, + }, + olmiji:{ + audio:2, + trigger:{player:'phaseJieshuBegin'}, + filter(event,player){ + return player.isDamaged(); + }, + async content(event,trigger,player){ + let num=player.getDamagedHp(); + await player.draw(num); + if(player.countCards('he')&&game.hasPlayer(target=>target!=player)){ + if(_status.connectMode) game.broadcastAll(()=>_status.noclearcountdown=true); + let given_map=[]; + while(num>0&&player.hasCard(card=>!card.hasGaintag('olsujian_given'),'he')){ + const {result:{bool,cards,targets}}=await player.chooseCardTarget({ + filterCard(card,player){ + return !card.hasGaintag('olsujian_given'); + }, + selectCard:[1,num], + position:'he', + filterTarget:lib.filter.notMe, + prompt:'秘计:请选择要分配的卡牌和目标', + prompt2:'(还可分配'+num+'张)', + ai1(card){ + return (!ui.selected.cards.length&&card.name=='du')?1:0; + }, + ai2(target){ + const player=get.event('player'); + const card=ui.selected.cards[0]; + if(card) return get.value(card,target)*get.attitude(player,target); + return 0; + }, + }); + if(bool){ + num-=cards.length; + const target=targets[0]; + if(given_map.some(i=>i[0]==target)){ + given_map[given_map.indexOf(given_map.find(i=>i[0]==target))][1].addArray(cards); + } + else given_map.push([target,cards]); + player.addGaintag(cards,'olsujian_given'); + } + else break; + } + if(_status.connectMode){ + game.broadcastAll(()=>{ + delete _status.noclearcountdown; + game.stopCountChoose(); + }); + } + if(given_map.length){ + await game.loseAsync({ + gain_list:given_map, + player:player, + cards:given_map.slice().map(list=>list[1]), + giver:player, + animate:'giveAuto', + }).setContent('gaincardMultiple'); } } }, @@ -1343,6 +1404,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ol_wangyi_prefix:'OL界', olzhenlie:'贞烈', olzhenlie_info:'当你成为其他角色使用【杀】或普通锦囊牌的目标后,你可以失去1点体力并令此牌对你无效,然后你选择一项:①获得使用者的一张牌;②发动一次〖秘计〗。', + olmiji:'秘计', + olmiji_info:'结束阶段,若你已受伤,则你可以摸X张牌,然后你可以将至多X张牌任意分配给其他角色(X为你已损失的体力值)。', onlyOL_yijiang1:'OL专属·将1', onlyOL_yijiang2:'OL专属·将2', diff --git a/character/yijiang.js b/character/yijiang.js index 3b330413e..aa9ef5e8e 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -11813,7 +11813,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, miji:{ audio:2, - audioname:['re_wangyi','ol_wangyi'], + audioname:['re_wangyi'], locked:false, mod:{ aiOrder:function(player,card,num){