From a535dbf946c7f96f73f4f8e409770cce0953bbab Mon Sep 17 00:00:00 2001 From: libccy Date: Tue, 20 Sep 2016 15:21:28 +0800 Subject: [PATCH] sp --- card/swd.js | 4 +- character/sp.js | 224 ++++++++++++++++++++++++++++++++++++++++++- character/swd.js | 1 + character/yijiang.js | 2 +- game/game.js | 12 ++- game/update.js | 2 +- 6 files changed, 233 insertions(+), 12 deletions(-) diff --git a/card/swd.js b/card/swd.js index 1511f58f4..1a9eed820 100644 --- a/card/swd.js +++ b/card/swd.js @@ -278,7 +278,7 @@ card.swd={ type:'equip', subtype:'equip5', ai:{ - equipValue:8 + equipValue:7 }, skills:['lianhua','shouna'] }, @@ -288,7 +288,7 @@ card.swd={ subtype:'equip5', skills:['haotianta'], ai:{ - equipValue:5 + equipValue:7 } }, fuxiqin:{ diff --git a/character/sp.js b/character/sp.js index 4c2be996e..602a9dad3 100644 --- a/character/sp.js +++ b/character/sp.js @@ -65,9 +65,9 @@ character.sp={ sp_pangde:['male','wei',4,['mashu','juesi']], sp_jiaxu:['male','wei',3,['zhenlue','jianshu','yongdi']], - // litong:['male','wei',4,['tuifeng']], - // mizhu:['male','shu',4,['ziyuan','jugu']], - // buzhi:['male','wu',4,['hongde','dingpan']], + litong:['male','wei',4,['tuifeng']], + mizhu:['male','shu',3,['ziyuan','jugu']], + buzhi:['male','wu',3,['hongde','dingpan']], }, perfectPair:{ zhugejin:['zhugeke'], @@ -93,15 +93,228 @@ character.sp={ hanba:['swd_muyun'], }, skill:{ + dingpan:{ + enable:'phaseUse', + filter:function(event,player){ + var num; + if(get.mode()=='identity'){ + num=get.population('fan'); + } + else{ + num=1; + } + if(player.getStat().skill.dingpan>=num) return false; + return true; + }, + filterTarget:function(card,player,target){ + return target.num('e')>0; + }, + content:function(){ + 'step 0' + target.draw(); + 'step 1' + var goon=ai.get.damageEffect(target,player,target)>0&&ai.get.attitude(target,player)>=0; + target.chooseControl('选项一','选项二',function(){ + if(_status.event.goon) return '选项二'; + return '选项一'; + }).set('goon',goon).set('prompt','定叛

选项一:令'+get.translation(player)+'弃置你装备区里的一张牌

选项二:令'+get.translation(player)+'获得你装备区内的所有牌并对你造成一点伤害
'); + 'step 2' + if(result.control=='选项一'){ + player.discardPlayerCard(target,true,'e'); + event.finish(); + } + else{ + var es=target.get('e'); + player.gain(es); + target.$give(es,player); + } + 'step 3' + game.delay(0.5); + target.damage(); + }, + ai:{ + order:7, + result:{ + target:function(player,target){ + if(ai.get.damageEffect(target,player,target)>0) return 2; + var att=ai.get.attitude(player,target); + if(att==0) return 0; + var es=target.get('e'); + var goon=false; + if(att>0&&target.num('h')=7&&att<0) return -1; + if(val<=4&&att>0&&goon) return 1; + } + return 0; + } + } + } + }, + hongde:{ + trigger:{player:['gainEnd','loseEnd']}, + direct:true, + filter:function(event,player){ + return event.cards&&event.cards.length>1; + }, + content:function(){ + 'step 0' + player.chooseTarget(get.prompt('hongde'),function(card,player,target){ + return target!=player; + }).set('ai',function(target){ + return ai.get.attitude(player,target); + }); + 'step 1' + if(result.bool){ + player.logSkill('hongde',result.targets); + result.targets[0].draw(); + } + } + }, + ziyuan:{ + enable:'phaseUse', + usable:1, + filterCard:function(card){ + var num=0; + for(var i=0;i0){ + return 10; + } + } + return 1; + }, + result:{ + player:function(player,target){ + var eff=ai.get.recoverEffect(target,player,player); + if(eff<0) return 0; + if(eff>0){ + if(target.hp==1) return 3; + return 2; + } + if(player.needsToDiscard()) return 1; + return 0; + } + }, + threaten:1.3 + } + }, + jugu:{ + mod:{ + maxHandcard:function(player,num){ + return num+player.maxHp; + } + }, + trigger:{global:'gameStart'}, + forced:true, + content:function(){ + player.draw(player.maxHp); + } + }, tuifeng:{ trigger:{player:'damageEnd'}, direct:true, filter:function(event,player){ return player.num('h')>0; }, + init:function(player){ + player.storage.tuifeng=[]; + }, content:function(){ 'step 0' - player.chooseCard(get.prompt('tuifeng')) + player.chooseCard(get.prompt('tuifeng')).set('ai',function(card){ + if(card.name=='du') return 20; + return 7-ai.get.useful(card); + }); + 'step 1' + if(result.bool){ + player.logSkill('tuifeng'); + player.lose(result.cards,ui.special); + player.$give(result.cards,player); + player.storage.tuifeng.push(result.cards[0]); + player.markSkill('tuifeng'); + } + }, + marktext:'锋', + intro:{ + content:'cards' + }, + group:'tuifeng2' + }, + tuifeng2:{ + trigger:{player:'phaseBegin'}, + forced:true, + filter:function(event,player){ + return player.storage.tuifeng.length>0; + }, + content:function(){ + player.draw(2*player.storage.tuifeng.length); + player.addTempSkill('tuifeng3','phaseAfter'); + player.$throw(player.storage.tuifeng.slice(0),1000); + player.storage.tuifeng3=player.storage.tuifeng.length; + while(player.storage.tuifeng.length){ + ui.discardPile.appendChild(player.storage.tuifeng.shift()); + } + player.unmarkSkill('tuifeng') + } + }, + tuifeng3:{ + mod:{ + cardUsable:function(card,player,num){ + if(card.name=='sha'&&player.storage.tuifeng3) return num+player.storage.tuifeng3; + } + }, + onremove:function(player){ + delete player.storage.tuifeng3; } }, weidi:{ @@ -6302,6 +6515,7 @@ character.sp={ wanglang:'王朗', tuifeng:'推锋', + tuifeng2:'推锋', tuifeng_info:'1.当你受到1点伤害后,你可以将一张牌置于武将牌上,称为“锋”。2.准备阶段开始时,若你的武将牌上有“锋”,你将所有“锋”置入弃牌堆,摸2X张牌,然后你于此回合的出牌阶段内使用【杀】的次数上限+X(X为你此次置入弃牌堆的“锋”数)', ziyuan:'资援', ziyuan_info:'出牌阶段限一次,你可以将任意张点数之和为13的手牌交给一名其他角色,然后该角色回复1点体力', @@ -6310,7 +6524,7 @@ character.sp={ hongde:'弘德', hongde_info:'当你一次获得或失去至少两张牌后,你可以令一名其他角色摸一张牌', dingpan:'定叛', - dingpan_info:'出牌阶段限X次,你可以令一名装备区里有牌的角色摸一张牌,然后其选择一项:1.令你弃置其装备区里的一张牌;2.获得其装备区里的所有牌,若如此做,你对其造成1点伤害(X为场上存活的反贼数)', + dingpan_info:'出牌阶段限X次,你可以令一名装备区里有牌的角色摸一张牌,然后其选择一项:1.令你弃置其装备区里的一张牌;2.获得其装备区里的所有牌,若如此做,你对其造成1点伤害(X为场上存活的反贼数,非身体份模式改为1)', weidi:'伪帝', weidi_info:'锁定技,你视为拥有当前主公的主公技', juesi:'决死', diff --git a/character/swd.js b/character/swd.js index 0dba9408f..3d339d903 100644 --- a/character/swd.js +++ b/character/swd.js @@ -4328,6 +4328,7 @@ character.swd={ filter:function(event,player){ return event.source&&event.source!=player&&event.source.num('he'); }, + logTarget:'source', content:function(){ trigger.source.chooseToDiscard('he',true); }, diff --git a/character/yijiang.js b/character/yijiang.js index ac6112dcf..537d525e3 100644 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -312,7 +312,7 @@ character.yijiang={ jishe:{ enable:'phaseUse', filter:function(event,player){ - return game.checkMod(player,player.hp,'maxHandcard',player.get('s'))>0; + return player.getHandcardLimit()>0; }, init:function(player){ player.storage.jishe=0; diff --git a/game/game.js b/game/game.js index 912ed2e35..d5fd345bf 100644 --- a/game/game.js +++ b/game/game.js @@ -5757,7 +5757,7 @@ }, phaseDiscard:function(){ "step 0" - event.num=player.num('h')-game.checkMod(player,player.hp,'maxHandcard',player.get('s')); + event.num=player.num('h')-player.getHandcardLimit(); if(event.num<=0) event.finish(); else{ if(lib.config.show_phase_prompt){ @@ -11376,6 +11376,9 @@ } },time) }, + getHandcardLimit:function(){ + return game.checkMod(this,this.hp,'maxHandcard',this.get('s')) + }, getEnemies:function(func){ var player=this; var targets; @@ -11514,6 +11517,9 @@ } return false; }, + needsToDiscard:function(){ + return Math.max(0,this.num('h')-this.getHandcardLimit()); + }, distanceTo:function(target,method){ return get.distance(this,target,method); }, @@ -18970,7 +18976,7 @@ else if(info.enable=='phaseUse') enable=(event.getParent().name=='phaseUse'); else if(typeof info.enable=='string') enable=(info.enable==event.name); if(enable){ - if(info.filter&&info.filter(event,player)==false) enable=false; + if(info.filter&&!info.filter(event,player)) enable=false; if(info.viewAs&&event.filterCard&&!event.filterCard(info.viewAs,player)) enable=false; if(info.viewAs&&info.viewAsFilter&&info.viewAsFilter(player)==false) enable=false; if(!event.isMine()&&event.aiexclude.contains(skills2[i])) enable=false; @@ -19556,7 +19562,7 @@ if(card.ai.basic.equipValue==undefined) card.ai.basic.equipValue=7; } else if(card.subtype=='equip4'){ - if(card.ai.basic.equipValue==undefined) card.ai.basic.equipValue=5; + if(card.ai.basic.equipValue==undefined) card.ai.basic.equipValue=4; } else{ if(card.ai.basic.equipValue==undefined) card.ai.basic.equipValue=1; diff --git a/game/update.js b/game/update.js index 5d7eb371e..c0605df51 100644 --- a/game/update.js +++ b/game/update.js @@ -19,5 +19,5 @@ window.noname_update={ } //增加牌堆补充扩展 -//改进塔防模式 +//塔防模式调整 //新武将