From 5e2a02e40fc007ee45bdc4346d4775eb636b07e1 Mon Sep 17 00:00:00 2001 From: libccy Date: Tue, 10 Nov 2015 18:13:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A9=E6=B0=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.MD | 1 + character/woods.js | 6 +- character/yijiang.js | 2 +- game/game.js | 63 ++++++------ layout/default/layout.css | 10 ++ mode/identity.js | 2 +- play/weather.js | 197 +++++++++++++++++++++++++++++++++----- 7 files changed, 227 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 0eae31552..1aaf7ebed 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,4 +1,5 @@ 1.5.4 +天气(选项-玩法中开启) 战棋模式调整 优化触屏模式 明将国战模式 diff --git a/character/woods.js b/character/woods.js index fd5debffc..d00a60e68 100755 --- a/character/woods.js +++ b/character/woods.js @@ -350,8 +350,10 @@ character.woods={ } }); "step 1" - result.targets[0].gain(result.cards); - player.$give(result.cards.length,result.targets[0]); + if(result.targets&&result.targets[0]){ + result.targets[0].gain(result.cards); + player.$give(result.cards.length,result.targets[0]); + } } }, dimeng:{ diff --git a/character/yijiang.js b/character/yijiang.js index 13e9e19d2..cc5bbf877 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -2242,6 +2242,7 @@ character.yijiang={ if(player.skills.contains('qice5')) return 0; var num=0; var cards=player.get('h'); + if(cards.length>=3&&player.hp>=3) return 0; for(var i=0;i0&&player.hujia&&!player.hasSkillTag('nohujia')){ if(num>=player.hujia){ num-=player.hujia; @@ -8980,6 +8983,12 @@ if(typeof suit!='string'){ suit=['heart','diamond','club','spade'].randomGet(); } + else if(suit=='black'){ + suit=Math.random()<0.5?'club':'spade'; + } + else if(suit=='red'){ + suit=Math.random()<0.5?'diamond':'heart'; + } if(typeof number!='number'){ number=Math.ceil(Math.random()*13); } diff --git a/layout/default/layout.css b/layout/default/layout.css index e62eb90b2..6e218271e 100755 --- a/layout/default/layout.css +++ b/layout/default/layout.css @@ -866,6 +866,13 @@ div[data-color="unknownm"]{ color:white !important; pointer-events: none; } +.player .wunature{ + display: none; +} +#arena>.player .wunature, +#chess>.player .wunature{ + display: block; +} div:hover>.wunature{ /*opacity: 0.5;*/ } @@ -913,6 +920,9 @@ div:hover>.wunature{ .selected{ box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(255, 0, 0, 0.8) 0 0 15px !important; } +#me .card.selected{ + box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px,rgb(255, 0, 0) 0 0 5px, rgba(255, 0, 0, 1) 0 0 10px !important; +} .glow{ box-shadow: rgba(0, 0, 0, 0.3) 0 0 0 1px, rgba(0, 133, 255, 0.8) 0 0 15px !important; } diff --git a/mode/identity.js b/mode/identity.js index 5a895d166..ebcef266f 100755 --- a/mode/identity.js +++ b/mode/identity.js @@ -426,7 +426,7 @@ mode.identity={ list=list3.slice(0,6); } else{ - list=list3.slice(0,num).concat(list2); + list=list2.concat(list3.slice(0,num)); } } var dialog=ui.create.dialog('选择角色',[list,'character']); diff --git a/play/weather.js b/play/weather.js index 01ce282b2..0d976db0b 100644 --- a/play/weather.js +++ b/play/weather.js @@ -2,20 +2,14 @@ play.weather={ arenaReady:function(){ if(_status.video) return; - _status.weather='qing'; - _status.weatherlife=Math.ceil(Math.random()*3); _status.weatherchance=parseFloat(lib.config.weather_chance_playpackconfig)||0; - var chancestr=parseInt(_status.weatherchance*100)+'%'; - for(var i in lib.translate){ - if(i.indexOf('_weather_')==0){ - lib.translate['_'+i]=lib.translate[i]; - lib.translate[i]=lib.translate[i].replace(/&weather&/,chancestr); - } - } - ui.weather=ui.create.system('晴',null,true); + + ui.weather=ui.create.system('',null,true); lib.setPopped(ui.weather,function(){ var uiintro=ui.create.dialog('hidden'); var weatherinfo=get.translation('_weather_'+_status.weather+'_info'); + var chancestr=parseInt(_status.weatherchance*100)+'%'; + weatherinfo=weatherinfo.replace(/&weather&/,chancestr); uiintro.add(get.translation('_weather_'+_status.weather)); if(weatherinfo.length<=0){ uiintro.add('
'+weatherinfo+'
'); @@ -26,6 +20,8 @@ play.weather={ uiintro.add(ui.create.div('.placeholder.slim')); return uiintro; },220); + + game.changeWeather(); }, skill:{ _weatherchange:{ @@ -33,38 +29,193 @@ play.weather={ filter:function(){ return ui.weather?true:false; }, + priority:-1, forced:true, content:function(){ - if(_status.weather!='qing'&&Math.random()<0.5){ - _status.weather='qing'; + _status.weatherlife--; + if(_status.weatherlife<=0){ + game.changeWeather(); + } + } + }, + _weather_yu:{ + trigger:{player:'phaseAfter'}, + forced:true, + filter:function(event,player){ + if(_status.weather!='yu') return false; + if(Math.random()>_status.weatherchance) return false; + for(var i=0;i_status.weatherchance) return false; + for(var i=0;i_status.weatherchance) return false; + if(event.nature!='fire') return false; + return true; + }, + content:function(){ + trigger.num--; + player.popup('霜'); + game.log('由于温度过低火焰伤害减弱'); + } + }, + _weather_wu:{ + trigger:{target:'useCardToBefore'}, + forced:true, + filter:function(event,player){ + if(_status.weather!='wu') return false; + if(Math.random()>_status.weatherchance) return false; + if(event.card.name!='sha') return false; + return true; + }, + content:function(){ + trigger.untrigger(); + trigger.finish(); + player.popup('雾'); + game.log('大雾使'+get.translation(player)+'躲避了杀'); + } + }, + _weather_bao:{ + trigger:{player:'phaseEnd'}, + forced:true, + popup:false, + filter:function(){ + if(_status.weather!='bao') return false; + if(Math.random()>_status.weatherchance) return false; + return true; + }, + content:function(){ + player.damage('nosource'); + player.popup('雹'); + game.log(get.translation(player)+'被冰雹砸中'); + } + }, + _weather_feng:{ + trigger:{player:'damageEnd'}, + forced:true, + filter:function(event,player){ + if(_status.weather!='feng') return false; + if(event.nature!='fire') return false; + if(Math.random()>_status.weatherchance) return false; + return true; + }, + popup:false, + content:function(){ + 'step 0' + var list=[]; + for(var i=0;i_status.weatherchance) return false; + if(lib.config.mode!='chess') return false; + return true; + }, + content:function(){ + var list=[]; + if(player.movable(-1,0)) list.push('moveLeft'); + if(player.movable(1,0)) list.push('moveRight'); + if(player.movable(0,-1)) list.push('moveUp'); + if(player.movable(0,1)) list.push('moveDown'); + if(list.length){ + player.popup('雪'); + game.log('由于地滑,'+get.translation(player)+'发生移动'); + player[list.randomGet()](); } - ui.weather.innerHTML=lib.translate['_weather_'+_status.weather]; } } + }, + game:{ + changeWeather:function(){ + var life; + if(_status.weather=='qing'||Math.random()