From 38bd706f39dd3506c9a93aab62e90fffda2ae240 Mon Sep 17 00:00:00 2001 From: libccy Date: Mon, 22 May 2017 11:18:10 +0800 Subject: [PATCH] e --- card/extra.js | 38 +++++++++++++----------- card/gujian.js | 16 ++++++++-- card/guozhan.js | 19 ++++++++---- card/sp.js | 12 +++++--- card/standard.js | 56 +++++++++++++++++++---------------- card/swd.js | 29 ++++++++++-------- card/yunchou.js | 9 +++--- game/game.js | 17 +++++++++-- mode/versus.js | 77 +++++++++++++++++++++++++++++++++++++++++++++--- 9 files changed, 193 insertions(+), 80 deletions(-) diff --git a/card/extra.js b/card/extra.js index 3f77c9b01..5c1d7baf3 100644 --- a/card/extra.js +++ b/card/extra.js @@ -322,20 +322,21 @@ game.import('card',function(lib,game,ui,get,ai,_status){ subtype:'equip2', cardnature:'fire', ai:{ + equipValue:function(card,player){ + if(player.hasSkillTag('maixie')&&player.hp>1) return 0; + if(player.hasSkillTag('noDirectDamage')) return 10; + if(get.damageEffect(player,player,player,'fire')>=0) return 10; + var num=3-game.countPlayer(function(current){ + return get.attitude(current,player)<0; + }); + if(player.hp==1) num+=4; + if(player.hp==2) num+=1; + if(player.hp==3) num--; + if(player.hp>3) num-=4; + return num; + }, basic:{ - equipValue:function(card,player){ - if(player.hasSkillTag('maixie')&&player.hp>1) return 0; - if(player.hasSkillTag('noDirectDamage')) return 10; - if(get.damageEffect(player,player,player,'fire')>=0) return 10; - var num=3-game.countPlayer(function(current){ - return get.attitude(current,player)<0; - }); - if(player.hp==1) num+=4; - if(player.hp==2) num+=1; - if(player.hp==3) num--; - if(player.hp>3) num-=4; - return num; - } + equipValue:3 }, }, skills:['tengjia1','tengjia2'] @@ -356,12 +357,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){ }, ai:{ order:9.5, + equipValue:function(card,player){ + if(player.hp==player.maxHp) return 5; + if(player.countCards('h','baiyin')) return 6; + return 0; + }, basic:{ - equipValue:function(card,player){ - if(player.hp==player.maxHp) return 5; - if(player.countCards('h','baiyin')) return 6; - return 0; - } + equipValue:5 } } }, diff --git a/card/gujian.js b/card/gujian.js index 0789502ca..dc3fc6670 100644 --- a/card/gujian.js +++ b/card/gujian.js @@ -402,7 +402,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){ if(player.hp>=3) return 4; if(player.hp>=2) return 2; return 1; - } + }, + basic:{ + equipValue:4 + } } }, yuheng_plus:{ @@ -421,7 +424,10 @@ game.import('card',function(lib,game,ui,get,ai,_status){ if(player.hp>=3) return 6; if(player.hp>=2) return 2.5; return 1; - } + }, + basic:{ + equipValue:5 + } } }, yuheng_pro:{ @@ -440,7 +446,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){ if(player.hp>=3) return 6; if(player.hp>=2) return 2.5; return 1; - } + }, + + basic:{ + equipValue:7 + } } }, shujinsan:{ diff --git a/card/guozhan.js b/card/guozhan.js index 20e14b03e..b0f9de8de 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -24,6 +24,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return 1; } return 8; + }, + basic:{ + equipValue:7 } } }, @@ -46,6 +49,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return 1; } return 6; + }, + basic:{ + equipValue:6 } }, onLose:function(){ @@ -568,13 +574,14 @@ game.import('card',function(lib,game,ui,get,ai,_status){ global:'g_wuliu_skill', distance:{attackFrom:-1}, ai:{ + equipValue:function(card,player){ + if(player.identity=='unknown'||player.identity=='ye') return 2.5; + return 2+game.countPlayer(function(current){ + return current.identity==player.identity; + })/2; + }, basic:{ - equipValue:function(card,player){ - if(player.identity=='unknown'||player.identity=='ye') return 2.5; - return 2+game.countPlayer(function(current){ - return current.identity==player.identity; - })/2; - } + equipValue:3 } }, skills:['wuliu_skill'], diff --git a/card/sp.js b/card/sp.js index 3ef36ae8d..310395a46 100644 --- a/card/sp.js +++ b/card/sp.js @@ -194,6 +194,9 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return 5; } return 3; + }, + basic:{ + equipValue:5 } }, }, @@ -254,11 +257,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){ loseDelay:false, skills:['muniu_skill','muniu_skill2','muniu_skill6','muniu_skill7'], ai:{ + equipValue:function(card){ + if(card.card) return 7+card.card.length; + return 7; + }, basic:{ - equipValue:function(card){ - if(card.card) return 8+card.card.length; - return 8; - } + equipValue:7 } } }, diff --git a/card/standard.js b/card/standard.js index a250a05a1..2da9ccaaa 100644 --- a/card/standard.js +++ b/card/standard.js @@ -336,22 +336,23 @@ game.import('card',function(lib,game,ui,get,ai,_status){ type:'equip', subtype:'equip1', ai:{ - basic:{ - equipValue:function(card,player){ - if(!game.hasPlayer(function(current){ - return player.canUse('sha',current)&&get.effect(current,{name:'sha'},player,player)<0; - })){ - return 1; - } - if(player.hasSha()&&_status.currentPhase==player){ - if(player.getEquip('zhuge')||player.getCardUsable('sha')==0){ - return 10; - } - } - var num=player.countCards('h','sha'); - if(num>1) return 4+num; - return 2+num; + equipValue:function(card,player){ + if(!game.hasPlayer(function(current){ + return player.canUse('sha',current)&&get.effect(current,{name:'sha'},player,player)<0; + })){ + return 1; } + if(player.hasSha()&&_status.currentPhase==player){ + if(player.getEquip('zhuge')||player.getCardUsable('sha')==0){ + return 10; + } + } + var num=player.countCards('h','sha'); + if(num>1) return 4+num; + return 2+num; + }, + basic:{ + equipValue:5 }, tag:{ valueswap:1 @@ -389,10 +390,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){ subtype:'equip1', distance:{attackFrom:-2}, ai:{ + equipValue:function(card,player){ + return Math.min(2.5+player.countCards('h','sha'),4); + }, basic:{ - equipValue:function(card,player){ - return Math.min(2.5+player.countCards('h','sha'),4); - } + equipValue:3.5 } }, skills:['qinglong_skill'] @@ -403,11 +405,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){ subtype:'equip1', distance:{attackFrom:-2}, ai:{ + equipValue:function(card,player){ + var num=2.5+player.countCards('h')/3; + return Math.min(num,4); + }, basic:{ - equipValue:function(card,player){ - var num=2.5+player.countCards('h')/3; - return Math.min(num,4); - } + equipValue:3.5 } }, skills:['zhangba_skill'] @@ -418,11 +421,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){ subtype:'equip1', distance:{attackFrom:-2}, ai:{ + equipValue:function(card,player){ + var num=2.5+(player.countCards('h')+player.countCards('e'))/2.5; + return Math.min(num,5); + }, basic:{ - equipValue:function(card,player){ - var num=2.5+(player.countCards('h')+player.countCards('e'))/2.5; - return Math.min(num,5); - } + equipValue:4.5, } }, skills:['guanshi_skill'] diff --git a/card/swd.js b/card/swd.js index dd61ae75b..22a7c9142 100644 --- a/card/swd.js +++ b/card/swd.js @@ -702,12 +702,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){ nopower:true, unique:true, ai:{ + equipValue:function(card,player){ + if(player.hp==2) return 7; + if(player.hp==1) return 10; + return 5; + }, basic:{ - equipValue:function(card,player){ - if(player.hp==2) return 7; - if(player.hp==1) return 10; - return 5; - } + equipValue:7 } } }, @@ -1380,11 +1381,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){ subtype:"equip2", skills:['baihupifeng'], ai:{ + equipValue:function(card,player){ + if(player.hp<=2) return 8; + return 6; + }, basic:{ - equipValue:function(card,player){ - if(player.hp<=2) return 8; - return 6; - } + equipValue:7 }, }, }, @@ -1951,11 +1953,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){ subtype:'equip5', skills:['nigong'], ai:{ + equipValue:function(card,player){ + if(!player.storage.nigong) return 5; + return 5+player.storage.nigong; + }, basic:{ - equipValue:function(card,player){ - if(!player.storage.nigong) return 5; - return 5+player.storage.nigong; - } + equipValue:5 } }, equipDelay:false, diff --git a/card/yunchou.js b/card/yunchou.js index 95fbad727..4c5fb83fd 100644 --- a/card/yunchou.js +++ b/card/yunchou.js @@ -949,11 +949,12 @@ game.import('card',function(lib,game,ui,get,ai,_status){ skills:['qiankundai'], ai:{ order:9.5, + equipValue:function(card,player){ + if(player.countCards('h','qiankundai')) return 6; + return 1; + }, basic:{ - equipValue:function(card,player){ - if(player.countCards('h','qiankundai')) return 6; - return 1; - } + equipValue:5, } } }, diff --git a/game/game.js b/game/game.js index c26903c71..b29386653 100644 --- a/game/game.js +++ b/game/game.js @@ -4511,7 +4511,6 @@ if(config.versus_mode=='two'){ map.replace_handcard_two.show(); map.replace_character_two.show(); - map.change_identity.show(); map.two_assign.show(); map.two_phaseswap.show(); } @@ -4522,6 +4521,12 @@ map.two_assign.hide(); map.two_phaseswap.hide(); } + if(config.versus_mode=='two'||config.versus_mode=='siguo'){ + map.change_identity.show(); + } + else{ + map.change_identity.hide(); + } }, versus_mode:{ name:'游戏模式', @@ -42628,7 +42633,7 @@ num+=player.countCards('h')/2; var es=player.getCards('e'); for(var i=0;i=7) num+=0.8; if(val>=5) num+=0.5; if(val>=3) num+=0.2; @@ -42743,6 +42748,14 @@ if(typeof value=='function') return value(card,player); return 0; }, + equipValueNumber:function(card){ + var info=get.info(card); + if(info.ai){ + if(typeof info.ai.equipValue=='number') return info.ai.equipValue; + if(info.ai.basic&&typeof info.ai.basic.equipValue=='number') return info.ai.basic.equipValue; + } + return 0; + }, disvalue:function(card,player){ return -get.value(card,player); }, diff --git a/mode/versus.js b/mode/versus.js index cffcfa393..c2c417d12 100644 --- a/mode/versus.js +++ b/mode/versus.js @@ -722,6 +722,9 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ next.setContent(function(){ 'step 0' _status.firstAct=game.players.randomGet(); + for(var i=0;i'; + td.link=i-1; + if(get.distance(_status.firstAct,game.me,'absolute')===i-1){ + td.classList.add('thundertext'); + } + td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){ + if(_status.dragged) return; + if(_status.justdragged) return; + if(get.distance(_status.firstAct,game.me,'absolute')==this.link) return; + var current=this.parentNode.querySelector('.thundertext'); + if(current){ + current.classList.remove('thundertext'); + } + this.classList.add('thundertext'); + _status.firstAct=game.me; + for(var i=0;i0; }, content:function(){ - trigger.player.storage.longchuanzhibao--; - trigger.player.updateMark('longchuanzhibao'); - player.storage.longchuanzhibao++; - player.updateMark('longchuanzhibao'); + if(trigger.player.storage.longchuanzhibao>0){ + trigger.player.storage.longchuanzhibao--; + trigger.player.updateMark('longchuanzhibao'); + player.storage.longchuanzhibao++; + player.updateMark('longchuanzhibao'); + } }, group:'longchuanzhibao_over', subSkill:{