From b2269521a3c18c1ae2d03d32146c37d09af7f808 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Fri, 20 Sep 2019 23:19:26 +0800 Subject: [PATCH] v1.9.93(Part 3) --- character/diy.js | 2 + character/extra.js | 5 +- character/old.js | 40 +++- character/refresh.js | 2 +- character/shenhua.js | 28 ++- character/sp.js | 380 ++++++++++++++++++++++++++++++++--- character/xinghuoliaoyuan.js | 34 +++- 7 files changed, 450 insertions(+), 41 deletions(-) diff --git a/character/diy.js b/character/diy.js index a06c4596f..dd79e2440 100755 --- a/character/diy.js +++ b/character/diy.js @@ -5,6 +5,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ connect:true, connectBanned:['diy_tianyu','diy_yangyi','diy_lukang','ns_huamulan','ns_yuji','ns_duangui','ns_liuzhang'], character:{ + diy_wenyang:['male','wei','4/6',['lvli','choujue']], // diy_caocao:['male','wei',4,['xicai','diyjianxiong','hujia']], // diy_hanlong:['male','wei',4,['siji','ciqiu']], diy_feishi:['male','shu',3,['shuaiyan','moshou']], @@ -88,6 +89,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ diy_tianyu:'字国让,渔阳雍奴(今天津市武清区东北)人。三国时期曹魏将领。初从刘备,因母亲年老回乡,后跟随公孙瓒,公孙瓒败亡,劝说鲜于辅加入曹操。曹操攻略河北时,田豫正式得到曹操任用,历任颖阴、郎陵令、弋阳太守等。', }, characterTitle:{ + diy_wenyang:'最粗的梦想XD', ns_zuoci:'#bskystarwuwei', ns_lvzhi:'#bskystarwuwei', ns_wangyun:'#rSukincen', diff --git a/character/extra.js b/character/extra.js index c255f201f..ada3ae2b0 100755 --- a/character/extra.js +++ b/character/extra.js @@ -1355,6 +1355,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, yeyan:{ unique:true, + forceDie:true, enable:'phaseUse', audio:3, animationColor:'metal', @@ -1405,7 +1406,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return targets.contains(target) }).set('ai',function(target){ return 1; - }); + }).set('forceDie',true); } "step 3" if(event.num0; })){ return 1; } @@ -554,8 +556,336 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, skill:{ - //蒋干 - weicheng:{ + //文鸯 + xinlvli:{ + audio:'lvli', + trigger:{player:'damageEnd',source:'damageEnd'}, + filter:function(event,player){ + if(player.hp==player.countCards('h')) return false; + if(player.hp1) return false; + if(player.storage.lvli>0&&(player!=_status.currentPhase||!player.storage.choujue)) return false; + return true; + }, + content:function(){ + 'step 0' + player.storage.lvli++; + var num=player.hp-player.countCards('h'); + if(num>0) player.draw(num); + else player.recover(-num); + 'step 1' + if(player==trigger.source&&player==trigger.player&&lib.skill.xinlvli.filter(trigger,player)){ + player.chooseBool(get.prompt2('xinlvli')); + } + else event.finish(); + 'step 2' + if(result.bool) event.goto(0); + }, + group:'lvli3', + }, + lvli:{ + audio:2, + enable:'chooseToUse', + filter:function(event,player){ + if(player.storage.lvli>1) return false; + if(player.storage.lvli>0&&(player!=_status.currentPhase||!player.storage.choujue)) return false; + return event.type!='wuxie'; + }, + chooseButton:{ + dialog:function(event,player){ + var list=[]; + for(var i=0;i0){ + return 1+Math.random(); + } + return 0; + } + if(button.link[2]=='nanman'||button.link[2]=='wanjian'||button.link[2]=='taoyuan'||button.link[2]=='wugu'){ + var eff=0; + for(var i=0;i0){ + return eff+Math.random(); + } + return 0; + } + return Math.random(); + }, + backup:function(links,player){ + return { + filterCard:function(){return false;}, + audio:'lvli', + selectCard:-1, + check:function(card){ + return 1; + }, + viewAs:{name:links[0][2],nature:links[0][3]}, + } + }, + prompt:function(links,player){ + return '请选择'+(get.translation(links[0][3])||'')+get.translation(links[0][2])+'的目标'; + } + }, + ai:{ + order:4, + result:{ + player:1, + }, + threaten:2.9, + }, + group:['lvli2','lvli3','lvli4','lvli5','lvli6'] + }, + lvli2:{ + trigger:{player:['useCardBefore','respondBefore']}, + forced:true, + popup:false, + priority:35, + filter:function(event,player){ + return event.skill=='lvli_backup'||event.skill=='lvli5'||event.skill=='lvli4'; + }, + content:function(){ + 'step 0' + player.logSkill('lvli'); + player.storage.lvli++; + player.popup(trigger.card.name,trigger.name=='useCard'?'metal':'wood'); + 'step 1' + var random=0.5+player.countCards('e')*0.1; + if(random>=Math.random()){ + player.popup('洗具'); + } + else{ + player.popup('杯具'); + trigger.cancel(); + if(trigger.name=='respond'){ + var evt=trigger.getParent(); + if(evt&&evt.result) evt.result.bool=false; + } + game.broadcastAll(function(str){ + var dialog=ui.create.dialog(str); + dialog.classList.add('center'); + setTimeout(function(){ + dialog.close(); + },1000); + },get.translation(player)+'声明的'+get.translation(trigger.card.name)+'并没有生效'); + game.log('然而什么都没有发生'); + game.delay(2); + } + }, + }, + lvli3:{ + trigger:{global:'phaseBefore'}, + forced:true, + silent:true, + popup:false, + content:function(){ + player.storage.lvli=0; + }, + }, + lvli4:{ + log:false, + enable:'chooseToRespond', + filter:function(event,player){ + if(player.storage.lvli>1) return false; + if(player.storage.lvli>0&&(player!=_status.currentPhase||!player.storage.choujue)) return false; + return (event.parent.name=='sha'); + }, + filterCard:function(){return false}, + selectCard:-1, + viewAs:{name:'shan'}, + ai:{ + skillTagFilter:function(player){ + if(player.storage.lvli>1) return false; + if(player.storage.lvli>0&&(player!=_status.currentPhase||!player.storage.choujue)) return false; + return true; + }, + threaten:1.5, + respondShan:true, + } + }, + lvli5:{ + log:false, + enable:'chooseToUse', + filter:function(event,player){ + if(player.storage.lvli>1) return false; + if(player.storage.lvli>0&&(player!=_status.currentPhase||!player.storage.choujue)) return false; + return true; + }, + filterCard:function(){return false}, + selectCard:-1, + viewAs:{name:'wuxie'}, + }, + lvli6:{ + trigger:{player:'damageEnd'}, + direct:true, + filter:function(event,player){ + if(!player.storage.beishui) return false; + if(player.storage.lvli>1) return false; + if(player.storage.lvli>0&&(player!=_status.currentPhase||!player.storage.choujue)) return false; + return true; + }, + content:function(){ + var next=player.chooseToUse(); + next.set('norestore',true); + next.set('_backupevent','lvli'); + next.backup('lvli'); + next.lvli6=true; + }, + }, + choujue:{ + derivation:['beishui','qingjiao'], + trigger:{global:'phaseAfter'}, + audio:2, + skillAnimation:true, + animationColor:'water', + unique:true, + juexingji:true, + forced:true, + init:function(player,skill){ + if(!player.storage[skill]) player.storage[skill]=false; + }, + filter:function(event,player){ + if(player.storage.choujue) return false; + return Math.abs(player.hp-player.countCards('h'))>=3; + }, + content:function(){ + player.awakenSkill('choujue'); + player.storage.choujue=true; + player.loseMaxHp(); + player.addSkill('beishui'); + }, + }, + beishui:{ + trigger:{player:'phaseBegin'}, + audio:2, + skillAnimation:'epic', + animationColor:'thunder', + unique:true, + juexingji:true, + forced:true, + init:function(player,skill){ + if(!player.storage[skill]) player.storage[skill]=false; + }, + filter:function(event,player){ + if(player.storage.beishui) return false; + return Math.min(player.hp,player.countCards('h'))<2; + }, + content:function(){ + player.awakenSkill('beishui'); + player.storage.beishui=true; + player.loseMaxHp(); + player.addSkill('qingjiao'); + }, + }, + qingjiao:{ + trigger:{player:'phaseUseBegin'}, + filter:function(event,player){ + return player.countCards('h')&&(ui.cardPile.hasChildNodes()||ui.discardPile.hasChildNodes()); + }, + check:function(event,player){ + return player.countCards('h')<=player.hp; + }, + content:function(){ + 'step 0' + player.discard(player.getCards('h')); + 'step 1' + var evt=trigger.getParent(); + if(evt&&evt.getParent&&!evt.qingjiao){ + evt.qingjiao=true; + var next=game.createEvent('qingjiao_discard',false,evt.getParent()); + next.player=player; + next.setContent(function(){ + var hs=player.getCards('he'); + if(hs.length) player.discard(hs); + }); + } + 'step 2' + var list=[]; + var typelist=[]; + var getType=function(card){ + var sub=get.subtype(card); + if(sub) return sub; + return card.name; + }; + for(var i=0;i=8) break; + } + } + if(list.length<8){ + for(var i=0;i=8) break; + } + } + } + player.gain(list,'gain2'); + 'step 3' + game.updateRoundNumber(); + }, + }, + //蒋干 + weicheng:{ audio:2, trigger:{global:'gainEnd'}, forced:true, @@ -598,13 +928,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } else{ player.addTempSkill('daoshu_used','phaseUseAfter'); - if(player.countCards('h',function(card){return get.suit(card)!=event.suit})==0){ + if(player.countCards('h',function(card){return get.suit(card)!=suit2})==0){ player.showHandcards(); event.finish(); } else player.chooseCard('h',true,function(card){ - return get.suit(card)!=event.suit - },'交给'+get.translation(target)+'一张不为'+get.translation(event.suit)+'花色的牌'); + return get.suit(card)!=suit2 + },'交给'+get.translation(target)+'一张不为'+get.translation(suit2)+'花色的牌'); } } else event.finish(); @@ -9458,31 +9788,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, zhoufu2:{ - trigger:{player:'judge'}, + trigger:{player:'judgeBegin'}, forced:true, priority:10, mark:'card', content:function(){ "step 0" - player.$throw(player.storage.zhoufu2); - game.broadcastAll(function(card){ - if(card.clone){ - card.clone.classList.add('thrownhighlight'); - } - },player.storage.zhoufu2); - if(player.judging[0].clone){ - player.judging[0].clone.classList.remove('thrownhighlight'); - game.broadcast(function(card){ - if(card.clone){ - card.clone.classList.remove('thrownhighlight'); - } - },player.judging[0]); - game.addVideo('deletenode',player,get.cardsInfo([player.judging[0].clone])); - } - player.judging[0]=player.storage.zhoufu2; - trigger.position.appendChild(player.storage.zhoufu2); - game.log(player,'的判定牌改为',player.storage.zhoufu2); - game.delay(2); + trigger.directresult=player.storage.zhoufu2; player.removeSkill('zhoufu2'); delete player.storage.zhoufu2; delete player.storage.zhoufu2_markcount; @@ -12153,7 +12465,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){ xugong:"许贡", zhangchangpu:"张昌蒲", jianggan:"蒋干", + wenyang:'文鸯', + diy_wenyang:'文鸯', + xinlvli:'膂力', + xinlvli_info:'每回合限一次,当你造成伤害后,你可选择:1,若你的体力值大于你的手牌数,你摸X张牌;2,若你的手牌数大于你的体力值且你已受伤,你回复X点体力(X为你的手牌数与体力值之差)。', + lvli:'膂力', + lvli4:'膂力', + lvli5:'膂力', + lvli_info:'每名角色的回合限一次, 你可以声明一个基本牌或普通锦囊牌的牌名,有随机概率视为使用之(装备区里的牌数越多成功概率越大) ', + choujue:'仇决', + choujue_info:'觉醒技,每个回合结束时,若你的手牌数和体力值相差3或更多,你减1点体力上限并获得技能“背水”,然后“膂力”改为“在自己的回合时每回合限两次”。', + beishui:'背水', + beishui_info:'觉醒技,准备阶段,若你的手牌数或体力值小于2,你减1点体力 上限并获得技能“清剿”,然后“膂力”改为受到伤害后也可发动。', + qingjiao:'清剿', + qingjiao_info:'出牌阶段开始时,你可以弃置所有手牌,然后从牌堆或弃牌堆中随机获得八张牌名各不相同且副类别不同的牌。若如此做,结束阶段,你弃置所有牌。', spjiedao:"截刀", "spjiedao_info":"当你每回合第一次造成伤害时,你可令此伤害至多+X(X为你损失的体力值)。然后若受到此伤害的角色没有死亡,你弃置等同于此伤害加值的牌。", biaozhao:"表召", diff --git a/character/xinghuoliaoyuan.js b/character/xinghuoliaoyuan.js index 1a33b94c1..9fb277ae2 100755 --- a/character/xinghuoliaoyuan.js +++ b/character/xinghuoliaoyuan.js @@ -612,10 +612,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{ player:["damageEnd","phaseEnd"], }, - frequent:true, + direct:true, content:function (){ 'step 0' - event.cards=get.cards(3); + player.chooseControl('一张','两张','三张','cancel2').set('prompt',get.prompt2('xinfu_zhenxing')).set('',function(){return 0}); + 'step 1' + if(result.control=='cancel2') event.finish(); + else{ + player.logSkill('xinfu_zhenxing'); + event.num={一张:1,两张:2,三张:3}[result.control]; + }; + 'step 2' + event.cards=get.cards(num); player.chooseButton(['【镇行】:请选择要获得的牌',event.cards]).set('filterButton',function(button){ for(var i=0;i=0;i--){ if(result.bool&&result.links.contains(event.cards[i])){ @@ -2230,7 +2238,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.line(trigger.player); player.popup(result.control); game.log(player,'将判定结果改为了','#y'+result.control); - trigger.player.addTempSkill(result.control=='黑桃5'?'zhenyi_spade_black':'zhenyi_spade_red','judgeAfter') + trigger.fixedResult={ + suit:result.control=='黑桃5'?'spade':'heart', + color:result.control=='黑桃5'?'black':'red', + number:5, + }; } else{ event.finish(); @@ -4535,6 +4547,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, }, + trigger:{ + player:['phaseBegin','phaseEnd'], + }, + forced:true, + audio:2, + group:'xinfu_pdgyingshi2', + priority:Infinity, + content:function(){ + event.getParent('arrangeTrigger').list=[]; + game.log(player,'跳过了',event.triggername=='phaseBegin'?'准备阶段':'结束阶段'); + }, + }, + xinfu_pdgyingshi2:{ + popup:false, trigger:{ player:"phaseJudgeBefore", },