From 0f2e856f249571c15342ff60f14d14716981d369 Mon Sep 17 00:00:00 2001 From: libccy Date: Sat, 25 Feb 2017 18:07:40 +0800 Subject: [PATCH] yj --- card/extra.js | 2 +- card/gujian.js | 4 +- card/standard.js | 5 +- card/swd.js | 10 ++- character/shenhua.js | 2 +- character/sp.js | 6 +- character/standard.js | 6 +- character/swd.js | 16 ++-- character/xianjian.js | 6 +- character/yijiang.js | 8 +- game/game.js | 54 +++++++++--- mode/chess.js | 2 +- mode/guozhan.js | 188 +++++++++++++++++++++++++++++++++++++++--- mode/stone.js | 2 +- 14 files changed, 266 insertions(+), 45 deletions(-) diff --git a/card/extra.js b/card/extra.js index ca376126f..680d84a13 100644 --- a/card/extra.js +++ b/card/extra.js @@ -67,7 +67,7 @@ card.extra={ }, }, order:function(){ - return lib.card.sha.ai.order+0.2; + return ai.get.order({name:'sha'})+0.2; }, result:{ target:function(player,target){ diff --git a/card/gujian.js b/card/gujian.js index 2db26ef93..bf6d89ee6 100644 --- a/card/gujian.js +++ b/card/gujian.js @@ -1368,7 +1368,9 @@ card.gujian={ prompt:'将一张手牌当杀使用', check:function(card){return 5-ai.get.value(card)}, ai:{ - order:3.1, + order:function(){ + return ai.get.order({name:'sha'})+0.1; + }, skillTagFilter:function(player,tag,arg){ if(arg!='use') return false; if(!player.num('h')) return false; diff --git a/card/standard.js b/card/standard.js index 9723ee97a..5b74b090e 100644 --- a/card/standard.js +++ b/card/standard.js @@ -116,7 +116,10 @@ card.standard={ useful:[5,1], value:[5,1], }, - order:3, + order:function(){ + if(_status.event.player.hasGlobalTag('presha')) return 10; + return 3; + }, result:{ target:function(player,target){ if(player.hasSkill('jiu')&&!target.num('e','baiyin')){ diff --git a/card/swd.js b/card/swd.js index 421fcbc11..beaea0726 100644 --- a/card/swd.js +++ b/card/swd.js @@ -402,7 +402,9 @@ card.swd={ result:{ target:1 }, - order:3.1 + order:function(){ + return ai.get.order({name:'sha'})+0.1; + }, } }, xuejibingbao:{ @@ -1568,7 +1570,7 @@ card.swd={ }, }, order:function(){ - return lib.card.sha.ai.order+0.2; + return ai.get.order({name:'sha'})+0.2; }, result:{ target:function(player,target){ @@ -2253,7 +2255,9 @@ card.swd={ } }, ai:{ - order:3.11, + order:function(){ + return ai.get.order({name:'sha'})+0.11; + }, result:{ target:function(player,target){ return ai.get.effect(target,{name:'sha'},player,target); diff --git a/character/shenhua.js b/character/shenhua.js index 8cf8089a6..80613726c 100644 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -3098,7 +3098,7 @@ character.shenhua={ return 9; } } - return lib.card.sha.ai.order-1; + return ai.get.order({name:'sha'})-1; }, result:{ player:function(player){ diff --git a/character/sp.js b/character/sp.js index e091b30e1..02f74d561 100644 --- a/character/sp.js +++ b/character/sp.js @@ -846,7 +846,9 @@ character.sp={ if(!player.storage.fanghun) return false; if(!player.num('h','shan')) return false; }, - order:3.1, + order:function(){ + return ai.get.order({name:'sha'})+0.1; + }, useful:-1, value:-1 } @@ -4876,7 +4878,7 @@ character.sp={ viewAs:{name:'sha',nature:'thunder'}, ai:{ order:function(){ - return lib.card.sha.ai.order+0.1; + return ai.get.order({name:'sha'})+0.1; } } }, diff --git a/character/standard.js b/character/standard.js index 1dc45ac05..f6dc8d1f0 100644 --- a/character/standard.js +++ b/character/standard.js @@ -708,7 +708,7 @@ character.standard={ } }, order:function(){ - return lib.card.sha.ai.order-0.1; + return ai.get.order({name:'sha'})-0.1; }, } }, @@ -993,7 +993,9 @@ character.standard={ skillTagFilter:function(player){ if(!player.num('h','shan')) return false; }, - order:3.1, + order:function(){ + return ai.get.order({name:'sha'})+0.1; + }, useful:-1, value:-1 } diff --git a/character/swd.js b/character/swd.js index c9ab4e6d9..87649b5ad 100644 --- a/character/swd.js +++ b/character/swd.js @@ -1037,7 +1037,9 @@ character.swd={ prompt:'将一张红色牌当杀使用', check:function(card){return 5-ai.get.value(card)}, ai:{ - order:3.1, + order:function(){ + return ai.get.order({name:'sha'})+0.1; + }, skillTagFilter:function(player,tag,arg){ if(arg!='use') return false; if(!player.num('he',{color:'red'})) return false; @@ -1277,7 +1279,9 @@ character.swd={ if(player.num('h',{type:['trick','delay']})<2) return false; }, respondSha:true, - order:3.1, + order:function(){ + return ai.get.order({name:'sha'})+0.1; + }, useful:-1, value:-1 }, @@ -2294,7 +2298,7 @@ character.swd={ }, ai:{ order:function(){ - return lib.card.sha.ai.order+0.1; + return ai.get.order({name:'sha'})+0.1; } }, group:['linyun2'] @@ -3171,7 +3175,7 @@ character.swd={ }, ai:{ order:function(){ - return lib.card.sha.ai.order+0.1; + return ai.get.order({name:'sha'})+0.1; }, result:{ target:function(player,target){ @@ -7474,7 +7478,7 @@ character.swd={ ai:{ order:function(){ if(_status.event.player.num('h')==1) return 10; - return lib.card.sha.ai.order+0.1; + return ai.get.order({name:'sha'})+0.1; }, result:{ target:function(player,target){ @@ -8703,7 +8707,7 @@ character.swd={ }, ai:{ order:function(){ - return lib.card.sha.ai.order+0.1; + return ai.get.order({name:'sha'})+0.1; }, effect:{ target:function(card,player){ diff --git a/character/xianjian.js b/character/xianjian.js index 320572aea..223145891 100644 --- a/character/xianjian.js +++ b/character/xianjian.js @@ -141,7 +141,9 @@ character.xianjian={ }, group:'yanzhan2', ai:{ - order:3.15 + order:function(){ + return ai.get.order({name:'sha'})+0.15; + }, }, }, yanzhan2:{ @@ -1238,7 +1240,7 @@ character.xianjian={ }, ai:{ order:function(){ - return lib.card.sha.ai.order+0.1; + return ai.get.order({name:'sha'})+0.1; }, effect:{ player:function(card,player){ diff --git a/character/yijiang.js b/character/yijiang.js index cceb55f3b..18d968f55 100644 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -1753,7 +1753,7 @@ character.yijiang={ return 9; } } - return lib.card.sha.ai.order-1; + return ai.get.order({name:'sha'})-1; }, result:{ player:function(player){ @@ -3201,7 +3201,7 @@ character.yijiang={ } }, order:function(){ - return lib.card.sha.ai.order-0.1; + return ai.get.order({name:'sha'})-0.1; }, } }, @@ -7140,7 +7140,9 @@ character.yijiang={ } }, ai:{ - order:3.1, + order:function(){ + return ai.get.order({name:'sha'})+0.05; + }, result:{ player:function(player){ var target=game.findPlayer(function(current){ diff --git a/game/game.js b/game/game.js index 6bd446f70..0a0d7faad 100644 --- a/game/game.js +++ b/game/game.js @@ -6634,7 +6634,7 @@ var hidden=player.hiddenSkills.slice(0); game.expandSkills(hidden); if(hidden.contains(event.skill)){ - if(!info.silent&&player.hasSkillTag('nomingzhi',false,null,true)){ + if(!info.silent&&player.hasGlobalTag('nomingzhi')){ event.finish(); } else if(!info.direct){ @@ -8880,9 +8880,6 @@ event.finish(); } "step 6" - if(event.card.name!='wuxie'){ - game.broadcastAll(ui.clear); - } event._oncancel(); }, useSkill:function(){ @@ -13353,7 +13350,7 @@ return (range); }, getHandcardLimit:function(){ - return game.checkMod(this,this.hp,'maxHandcard',this.get('s')) + return Math.max(0,game.checkMod(this,this.hp,'maxHandcard',this.get('s'))); }, getEnemies:function(func){ var player=this; @@ -13407,14 +13404,14 @@ return !this.isFriendOf.apply(this,arguments); }, isFriendOf:function(player){ - if(typeof this.side=='boolean'&&typeof player.side=='boolean'){ - return this.side==player.side; - } - if(lib.config.mode=='guozhan'){ + if(get.mode()=='guozhan'){ if(this.identity=='unknown'||this.identity=='ye') return false; if(player.identity=='unknown'||player.identity=='ye') return false; return this.identity==player.identity; } + if(typeof this.side=='boolean'&&typeof player.side=='boolean'){ + return this.side==player.side; + } return this==player; }, isAlive:function(){ @@ -13579,6 +13576,24 @@ } return false; }, + hasGlobalTag:function(tag,arg){ + var skills=lib.skill.global.slice(0); + game.expandSkills(skills); + for(var i=0;i0; + }, + logTarget:'source', + content:function(){ + var source=trigger.source; + if(source.hasSkill('hengjiang2')){ + source.storage.hengjiang3+=trigger.num; + source.updateMarks(); + } + else{ + source.storage.hengjiang2=player; + source.storage.hengjiang3=trigger.num; + source.addTempSkill('hengjiang2','phaseAfter'); + } + } + }, + hengjiang2:{ + mark:'character', + intro:{ + content:function(storage,player){ + return '手牌上限-'+player.storage.hengjiang3; + }, + markcount:function(storage,player){ + return player.storage.hengjiang3; + } + }, + mod:{ + maxHandcard:function(player,num){ + return num-player.storage.hengjiang3; + } + }, + onremove:function(player){ + delete player.storage.hengjiang2; + delete player.storage.hengjiang3; + }, + trigger:{player:'phaseDiscardEnd'}, + filter:function(event,player){ + return player.storage.hengjiang2.isIn()&&(!event.cards||event.cards.length==0); + }, + forced:true, + popup:false, + content:function(){ + player.storage.hengjiang2.draw(); + } + }, baoling:{ trigger:{player:'phaseUseEnd'}, init:function(player){ @@ -1647,9 +1807,11 @@ mode.guozhan={ hunshang:'魂殇', hunshang_info:'副将技,此武将牌减少半个阴阳鱼;准备阶段,若你的体力值为1,则你本回合获得“英姿”和“英魂”', gzguixiu:'闺秀', - gzguixiu_info:'当你明置此武将牌时,你可以摸两张牌;当你移除此武将牌时,你可以回复1点体力', + gzguixiu_info:'当你明置此武将牌时,你摸两张牌;当你失去此技能时,你回复1点体力', gzcunsi:'存嗣', - gzcunsi_info:'出牌阶段,你可以移除此武将牌并选择一名角色,然后其获得技能“勇决”(若与你势力相同的一名角色于其回合内使用的第一张牌为【杀】,则该角色可以在此【杀】结算完成后获得之),若你没有获得“勇决”,则获得“勇决”的角色摸两张牌', + gzcunsi_info:'出牌阶段,你可以移除此武将牌并选择一名角色,然后其获得技能“勇决”,若你没有获得“勇决”,则获得“勇决”的角色摸两张牌', + gzyongjue:'勇决', + gzyongjue_info:'若与你势力相同的一名角色于其回合内使用的第一张牌为【杀】,则该角色可以在此【杀】结算完成后获得之', hengjiang:'横江', hengjiang_info:'当你受到1点伤害后,你可以令当前回合角色本回合的手牌上限-1。然后若其弃牌阶段内没有弃牌,则你摸一张牌', gzqianxi:'潜袭', @@ -1931,23 +2093,27 @@ mode.guozhan={ } return false; }, - checkViceSkill:function(skill){ + checkViceSkill:function(skill,disable){ if(game.expandSkills(lib.character[this.name2][3].slice(0)).contains(skill)){ return true; } else{ - this.disableSkill(skill,skill); - this.awakenedSkills.add(skill); + if(disable!==false){ + this.disableSkill(skill,skill); + this.awakenedSkills.add(skill); + } return false; } }, - checkMainSkill:function(skill){ + checkMainSkill:function(skill,disable){ if(game.expandSkills(lib.character[this.name1][3].slice(0)).contains(skill)){ return true; } else{ - this.disableSkill(skill,skill); - this.awakenedSkills.add(skill); + if(disable!==false){ + this.disableSkill(skill,skill); + this.awakenedSkills.add(skill); + } return false; } }, @@ -2075,7 +2241,7 @@ mode.guozhan={ this.classList.remove('unseen2'); break; case 2: - if(log!==false) game.log(this,'展示了主将','#b'+get.translation(this.name1)+'、副将','#b'+get.translation(this.name2)); + if(log!==false) game.log(this,'展示了主将','#b'+get.translation(this.name1),'、副将','#b'+get.translation(this.name2)); this.name=this.name1; skills=lib.character[this.name][3].concat(lib.character[this.name2][3]); this.sex=lib.character[this.name][0]; diff --git a/mode/stone.js b/mode/stone.js index 927950acb..7672472ec 100644 --- a/mode/stone.js +++ b/mode/stone.js @@ -8426,7 +8426,7 @@ mode.stone={ }, ai:{ order:function(){ - return lib.card.sha.ai.order-0.1; + return ai.get.order({name:'sha'})-0.1; }, result:{ target:function(player,target){