From c88e83999e5365fb8c43183cba76cd08f9bb7762 Mon Sep 17 00:00:00 2001 From: libccy Date: Sun, 5 Feb 2017 18:40:30 +0800 Subject: [PATCH] d --- card/yunchou.js | 1 + character/diy.js | 105 +++++++++++++++++++++++++++++++++++- character/refresh.js | 2 +- game/game.js | 39 +++++++------- layout/default/layout.css | 2 +- layout/long2/layout.css | 3 ++ layout/mode/chess.css | 4 ++ layout/newlayout/global.css | 2 +- 8 files changed, 132 insertions(+), 26 deletions(-) diff --git a/card/yunchou.js b/card/yunchou.js index 3ed239591..f3a565f74 100644 --- a/card/yunchou.js +++ b/card/yunchou.js @@ -53,6 +53,7 @@ card.yunchou={ } } else{ + target.popup('不换'); event.finish(); } "step 2" diff --git a/character/diy.js b/character/diy.js index 0d4e5e0c7..f1a529a32 100644 --- a/character/diy.js +++ b/character/diy.js @@ -21,14 +21,109 @@ character.diy={ diy_liufu:['male','wei',3,['zhucheng','duoqi']], diy_xizhenxihong:['male','shu',3,['fuchou','jinyan']], diy_liuzan:['male','wu',4,['kangyin']], - diy_zaozhirenjun:['male','shu',3,[]], + diy_zaozhirenjun:['male','shu',3,['liangce','jianbi','juntun']], diy_yangyi:['male','shu',3,['choudu','liduan']], - diy_tianyu:['male','wei',4,['chezhen','youzhan']], + diy_tianyu:['male','wei',3,['chezhen','youzhan']], }, perfectPair:{ yuji:['zuoci'] }, skill:{ + liangce:{ + enable:'phaseUse', + viewAs:{name:'wugu'}, + filterCard:{type:'basic'}, + filter:function(event,player){ + return player.num('h',{type:'basic'})>0; + }, + check:function(card){ + return 6-ai.get.value(card); + } + }, + jianbi:{ + trigger:{global:'useCard'}, + priority:5, + filter:function(event,player){ + if(get.type(event.card)!='trick') return false; + if(get.info(event.card).multitarget) return false; + if(event.targets.length<2) return false; + if(!event.targets.contains(player)) return false; + return true; + }, + direct:true, + content:function(){ + "step 0" + player.chooseTarget(get.prompt('jianbi'), + [1,1+player.maxHp-player.hp],function(card,player,target){ + return _status.event.getTrigger().targets.contains(target); + }).set('ai',function(target){ + var trigger=_status.event.getTrigger(); + return -ai.get.effect(target,trigger.card,trigger.player,_status.event.player); + }); + "step 1" + if(result.bool){ + event.targets=result.targets; + if(event.isMine()){ + player.logSkill('jianbi',event.targets); + event.finish(); + } + for(var i=0;i0; + }, + filterCard:{type:'equip'}, + check:function(card){ + var player=_status.event.player; + var he=player.get('he'); + var subtype=get.subtype(card); + var value=ai.get.equipValue(card); + for(var i=0;i=value){ + return 10; + } + } + if(!player.needsToDiscard()){ + return 4-ai.get.equipValue(card); + } + return 0; + }, + content:function(){ + player.draw(); + }, + discard:false, + prompt:'将一张装备牌置于弃牌堆并摸一张牌', + delay:0.5, + prepare:function(cards,player){ + player.$throw(cards,1000); + }, + ai:{ + basic:{ + order:8.5 + }, + result:{ + player:1, + }, + } + }, choudu:{ enable:'phaseUse', usable:1, @@ -1123,6 +1218,12 @@ character.diy={ diy_caiwenji:'蔡昭姬', diy_zhenji:'甄宓', + liangce:'粮策', + liangce_info:'①出牌阶段限一次,你可以将一张基本牌当【五谷丰登】使用。②当因执行【五谷丰登】的效果而亮出的牌因效果执行完毕而置入弃牌堆后,你可以选择一名角色,令该角色获取之', + jianbi:'坚壁', + jianbi_info:'当你成为锦囊牌的目标时,若此牌的目标包括其他角色,你可以令此牌对一至X+1个目标无效(X为你已损失的体力值)', + juntun:'军屯', + juntun_info:'出牌阶段,你可以重铸装备牌', choudu:'筹度', choudu_info:'出牌阶段限一次,你可以弃置一张牌,并指定一名角色视为其使用一张调兵遣将', liduan:'立断', diff --git a/character/refresh.js b/character/refresh.js index 78943265b..2a3dbf561 100644 --- a/character/refresh.js +++ b/character/refresh.js @@ -1331,7 +1331,7 @@ character.refresh={ direct:true, content:function(){ "step 0" - player.chooseTarget('选择令'+get.translation(trigger.card)+'无效的目标', + player.chooseTarget(get.prompt('fenwei'), [1,trigger.targets.length],function(card,player,target){ return _status.event.getTrigger().targets.contains(target); }).set('ai',function(target){ diff --git a/game/game.js b/game/game.js index a12011386..4258b35c0 100644 --- a/game/game.js +++ b/game/game.js @@ -27355,7 +27355,8 @@ var dialog=ui.create.dialog('hidden'); dialog.classList.add('noupdate'); dialog.classList.add('scroll1'); - dialog.classList.add('scroll2'); + dialog.classList.add('scroll2'); + dialog.classList.add('scroll3'); list.sort(lib.sort.character); dialog.classList.add('character'); var getPack=function(name){ @@ -27848,7 +27849,8 @@ dialog=ui.create.dialog('hidden'); dialog.classList.add('noupdate'); dialog.classList.add('scroll1'); - dialog.classList.add('scroll2'); + dialog.classList.add('scroll2'); + dialog.classList.add('scroll3'); dialog.addEventListener(lib.config.touchscreen?'touchend':'mouseup',function(){ _status.clicked2=true; }); @@ -31771,28 +31773,15 @@ ui.dialog.classList.remove('nobutton'); } } - if(false&&game.layout=='mobile'){ - ui.dialog.style.height=''; - if(ui.dialog.contentContainer.offsetHeight>=ui.dialog.content.offsetHeight){ - ui.dialog.style.height=ui.dialog.content.offsetHeight+'px'; - } - else{ - ui.dialog.style.height=''; - } - if(ui.dialog.content.offsetHeight<240){ - ui.dialog.classList.add('slim'); - ui.dialog.classList.remove('scroll1'); - ui.dialog.classList.remove('scroll2'); - } - else{ - ui.dialog.classList.remove('slim'); - ui.dialog.classList.add('scroll1'); - ui.dialog.classList.add('scroll2'); + var height1=ui.dialog.content.offsetHeight; + var height2=ui.dialog.contentContainer.offsetHeight; + if(game.chess){ + if(height1<240){ + ui.dialog.style.height=height1+'px'; } } else{ - if(ui.dialog.content.offsetHeight<=240|| - ui.dialog.contentContainer.offsetHeight>=ui.dialog.content.offsetHeight){ + if(height1<=190||(height2>=height1&&height2>=210)){ ui.dialog.classList.remove('scroll1'); ui.dialog.classList.remove('scroll2'); } @@ -31800,6 +31789,14 @@ ui.dialog.classList.add('scroll1'); ui.dialog.classList.add('scroll2'); } + if(lib.config.layout=='long2'){ + if(height1+240>=ui.arena.offsetHeight){ + ui.dialog.classList.add('scroll3'); + } + else{ + ui.dialog.classList.remove('scroll3'); + } + } } } }, diff --git a/layout/default/layout.css b/layout/default/layout.css index 25a57fa72..a18ed5a12 100644 --- a/layout/default/layout.css +++ b/layout/default/layout.css @@ -2222,7 +2222,7 @@ div:hover>.wunature{ background: rgba(0,0,0,0.2); box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px; border-radius:8px; - min-height:240px; + min-height:200px; } #window[data-radius_size='reduce'] .dialog.scroll1, #window[data-radius_size='reduce'] .dialog.scroll2, diff --git a/layout/long2/layout.css b/layout/long2/layout.css index 9c399fdd7..55103bfcf 100644 --- a/layout/long2/layout.css +++ b/layout/long2/layout.css @@ -96,6 +96,9 @@ height:calc(100% - 280px); bottom:80px; } +#arena.choose-character>.dialog.scroll3{ + height:calc(100% - 240px); +} #arena.phone.choose-character>.dialog{ bottom:93px; } diff --git a/layout/mode/chess.css b/layout/mode/chess.css index d840f8a38..ff07bde15 100644 --- a/layout/mode/chess.css +++ b/layout/mode/chess.css @@ -73,6 +73,10 @@ box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px; border-radius:8px; } +#arena.chess>.dialog{ + height: calc(50% - 20px); + max-height: 240px; +} #window[data-radius_size='reduce']>.dialog{ border-radius:4px; } diff --git a/layout/newlayout/global.css b/layout/newlayout/global.css index 31ed6d40a..ef3ec1311 100644 --- a/layout/newlayout/global.css +++ b/layout/newlayout/global.css @@ -497,7 +497,7 @@ .dialog.withbg{ background: rgba(0,0,0,0.2); box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px; - min-height:240px; + min-height:200px; } .dialog>.bar{ display:none !important;