diff --git a/card/guozhan.js b/card/guozhan.js index b8d6a8c70..599b51e6d 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -839,6 +839,7 @@ card.guozhan={ "step 0" var damaged=trigger.player; player.chooseCardTarget({ + filterCard:lib.filter.cardDiscardable, filterTarget:function(card,player,target){ var damaged=_status.event.damaged; return get.distance(damaged,target)<=1&&target!=damaged; diff --git a/card/standard.js b/card/standard.js index a00802a61..8bf76efa7 100644 --- a/card/standard.js +++ b/card/standard.js @@ -1254,7 +1254,7 @@ card.standard={ }, content:function(){ "step 0" - player.choosePlayerCard(get.prompt('hanbing'),'he',trigger.target,Math.min(2,trigger.target.num('he')),function(button){ + player.discardPlayerCard(get.prompt('hanbing'),'he',trigger.target,Math.min(2,trigger.target.num('he')),function(button){ var trigger=_status.event.getTrigger(); var player=_status.event.player; var eff=ai.get.damageEffect(trigger.target,player,player); @@ -1272,15 +1272,11 @@ card.standard={ if(ai.get.buttonValue(_status.event.dialog.buttons[i])>1.5) num++; } if(num>=2) return ai.get.buttonValue(button)-1.5; - }); + }).set('logSkill','hanbing_skill'); "step 1" if(result.bool){ trigger.untrigger(); - var cards=[]; - for(var i=0;i=player.hp; }, filterCard:function(card){ - return get.color(card)=='red'; + return get.color(card)=='red'&&lib.filter.cardDiscardable(card,player); }, ai1:function(card){ return 9-ai.get.value(card); @@ -2412,7 +2412,7 @@ card.swd={ 'step 0' player.chooseCardTarget({ filterTarget:true, - filterCard:true, + filterCard:lib.filter.cardDiscardable, ai1:function(card){ return 7-ai.get.useful(card); }, diff --git a/character/rank.js b/character/rank.js index f2119581d..0ad3a0804 100644 --- a/character/rank.js +++ b/character/rank.js @@ -220,6 +220,7 @@ window.characterRank={ 'yxs_nandinggeer', ], bp:[ + 'dongbai', 'yxs_zhaoyong', 'yxs_yangguang', 'litong', @@ -347,6 +348,9 @@ window.characterRank={ 'sp_jiaxu', ], b:[ + 'caochun', + 'sp_liubei', + 'zhuling', 'xin_liru', 'weiyan', 'sp_xiahoudun', diff --git a/character/sp.js b/character/sp.js index 2d6ada1c9..9de82e153 100644 --- a/character/sp.js +++ b/character/sp.js @@ -68,6 +68,12 @@ character.sp={ litong:['male','wei',4,['tuifeng']], mizhu:['male','shu',3,['ziyuan','jugu']], buzhi:['male','wu',3,['hongde','dingpan']], + + sp_liubei:['male','shu',4,['zhaolie','shichou']], + caochun:['male','wei',4,['shanjia']], + zhuling:['male','wei',4,['zhanyi']], + dongbai:['female','qun',3,['lianzhu','xiehui']], + }, perfectPair:{ zhugejin:['zhugeke'], @@ -93,6 +99,429 @@ character.sp={ hanba:['swd_muyun'], }, skill:{ + xiehui:{ + mod:{ + cardDiscardable:function(card,player){ + return get.color(card)=='red'; + } + } + }, + shanjia:{ + init:function(player){ + player.storage.shanjia=0; + }, + mark:true, + intro:{ + content:function(storage){ + if(storage==0) return '未使用过装备牌'; + return '已使用过'+storage+'张装备牌'; + } + }, + group:'shanjia2', + trigger:{player:'phaseUseBegin'}, + frequent:true, + filter:function(event,player){ + return player.storage.shanjia>0; + }, + content:function(){ + 'step 0' + player.draw(player.storage.shanjia); + 'step 1' + player.chooseToDiscard('he',player.storage.shanjia,true); + 'step 2' + var useCard=false; + if(result.bool&&result.cards){ + for(var i=0;i0){ + return 6-ai.get.value(card); + } + } + } + } + return 0; + }, + content:function(){ + player.loseHp(); + switch(get.type(cards[0],'trick')){ + case 'basic':player.addTempSkill('zhanyi_basic','phaseAfter');break; + case 'equip':player.addTempSkill('zhanyi_equip','phaseAfter');break; + case 'trick':player.addTempSkill('zhanyi_trick','phaseAfter');player.draw(2);break; + } + }, + ai:{ + order:9.1, + result:{ + player:1 + } + } + }, + zhanyi_basic:{ + group:['zhanyi_basic_sha','zhanyi_basic_jiu','zhanyi_basic_tao'] + }, + zhanyi_basic_tao:{ + enable:'chooseToUse', + filterCard:{type:'basic'}, + viewAs:{name:'tao'}, + viewAsFilter:function(player){ + if(!player.num('h',{type:'basic'})) return false; + }, + prompt:'将一张基本牌当桃使用', + check:function(card){ + return 8-ai.get.value(card); + }, + ai:{ + skillTagFilter:function(player){ + if(!player.num('h',{type:'basic'})) return false; + }, + save:true, + } + }, + zhanyi_basic_sha:{ + enable:'chooseToUse', + filterCard:{type:'basic'}, + viewAs:{name:'sha'}, + viewAsFilter:function(player){ + if(!player.num('h',{type:'basic'})) return false; + }, + prompt:'将一张基本牌当杀使用', + check:function(card){return 4-ai.get.value(card)}, + ai:{ + skillTagFilter:function(player){ + if(!player.num('h',{type:'basic'})) return false; + }, + respondSha:true, + } + }, + zhanyi_basic_jiu:{ + enable:'chooseToUse', + filterCard:{type:'basic'}, + viewAs:{name:'jiu'}, + viewAsFilter:function(player){ + if(!player.num('h',{type:'basic'})) return false; + }, + prompt:'将一张基本牌当酒使用', + check:function(card){ + if(_status.event.type=='dying') return 1; + return 4-ai.get.value(card); + }, + ai:{ + skillTagFilter:function(player){ + return player.num('h',{type:'basic'})>0&&player.hp<=0; + }, + save:true, + } + }, + zhanyi_equip:{ + trigger:{player:'shaBegin'}, + forced:true, + filter:function(event,player){ + return event.target.num('he')>0; + }, + content:function(){ + trigger.target.chooseToDiscard('he',true,2); + } + }, + zhanyi_trick:{ + mod:{ + targetInRange:function(){ + return true; + } + } + }, + shichou:{ + skillAnimation:true, + unique:true, + enable:'phaseUse', + mark:true, + zhuSkill:true, + filter:function(event,player){ + if(!player.hasZhuSkill('shichou'))return false; + if(player.num('he')<2) return false; + return !player.storage.shichou; + }, + selectCard:2, + init:function(player){ + player.storage.shichou=false; + }, + filterTarget:function(card,player,target){ + return target.group=='shu'&&target!=player; + }, + filterCard:true, + position:'he', + check:function(card){ + return 7-ai.get.value(card); + }, + discard:false, + prepare:'give', + content:function(){ + player.storage.shichou=true; + player.unmarkSkill('shichou'); + target.gain(cards); + player.storage.shichou_target=target; + player.addSkill('shichou2'); + target.markSkillCharacter('shichou',player,'誓仇','代替'+get.translation(player)+'承受伤害直到首次进入濒死状态'); + }, + intro:{ + content:'limited' + }, + ai:{ + order:7, + result:{ + player:function(player,target){ + if(player.hasUnknown()) return 0; + var att=ai.get.attitude(player,target); + if(att<=0){ + if(target.hp==1) return (10-att)/2; + return 10-att; + } + else{ + if(target.hp==1) return 0; + return (10-att)/4; + } + }, + } + } + }, + shichou2:{ + group:'shichou3', + trigger:{player:'damageBefore'}, + forced:true, + popup:false, + content:function(){ + trigger.untrigger(); + trigger.player=player.storage.shichou_target; + trigger.player.addSkill('shichou4'); + trigger.trigger('damageBefore'); + player.logSkill('shichou2',player.storage.shichou_target); + game.delay(0.5); + }, + ai:{ + effect:{ + target:function(card,player,target,current){ + if(get.tag(card,'damage')){ + if(player.hasSkill('jueqing')) return [1,-2]; + if(ai.get.attitude(player,target)>0) return [0,0]; + var eff=ai.get.damageEffect(target.storage.shichou_target,player,target); + if(eff>0){ + return [0,1]; + } + else if(eff<0){ + return [0,-2]; + } + else{ + return [0,0]; + } + } + } + } + } + }, + shichou3:{ + trigger:{global:['dying','dieBegin']}, + forced:true, + popup:false, + priority:10, + filter:function(event,player){ + return event.player==player.storage.shichou_target; + }, + content:function(){ + trigger.player.unmarkSkill('shichou'); + delete player.storage.shichou_target; + player.removeSkill('shichou2'); + } + }, + shichou4:{ + trigger:{player:['damageAfter','damageCancelled']}, + forced:true, + popup:false, + audio:false, + content:function(){ + if(event.triggername=='damageAfter'&&trigger.num){ + player.draw(trigger.num); + } + player.removeSkill('shichou4'); + } + }, + zhaolie:{ + trigger:{player:'phaseDrawBegin'}, + check:function(event,player){ + for(var i=0;i0){ + return true; + } + } + return false; + }, + direct:true, + content:function(){ + 'step 0' + player.chooseTarget(get.prompt('zhaolie'),function(card,player,target){ + return target!=player&&get.distance(player,target,'attack')<=1; + }).set('ai',function(target){ + var player=_status.event.player; + if(ai.get.attitude(player,target)>0) return 0; + return ai.get.damageEffect(target,player,player); + }); + 'step 1' + if(result.bool){ + trigger.num--; + player.storage.zhaolie=result.targets[0]; + player.logSkill('zhaolie',result.targets); + player.addTempSkill('zhaolie2','phaseDrawAfter'); + } + } + }, + zhaolie2:{ + trigger:{player:'phaseDrawEnd'}, + forced:true, + popup:false, + content:function(){ + 'step 0' + event.cards=get.cards(3); + player.showCards(event.cards); + 'step 1' + event.basic=[]; + event.nonbasic=[]; + for(var i=0;i1?0:7-ai.get.value(card); + case 2:return 8-ai.get.value(card); + case 3:return 10-ai.get.value(card); + default:return 0; + } + }).set('num',num); + } + 'step 2' + var num=event.nonbasic.length; + var undone=false; + if(num==0){ + if(event.basic.length){ + result.targets[0].gain(event.basic,'gain2'); + game.log(result.targets[0],'获得了',event.basic); + } + } + else{ + if(result.bool){ + if(event.basic.length){ + player.gain(event.basic,'gain2'); + game.log(player,'获得了',event.basic); + } + } + else{ + player.storage.zhaolie.damage(num); + if(event.basic.length){ + undone=true; + } + } + } + if(!undone){ + delete player.storage.zhaolie; + event.finish(); + } + 'step 3' + if(player.storage.zhaolie.isAlive()){ + game.log(player.storage.zhaolie,'获得了',event.basic); + player.storage.zhaolie.gain(event.basic,'gain2'); + } + else{ + for(var i=0;i0; }, discard:false, - prepare:function(cards,player,targets){ - player.$give(cards,targets[0]); - }, + prepare:'give', content:function(){ if(target.hasSkill('yanxiao2')&&target.storage.yanxiao2){ target.storage.yanxiao2.push(cards[0]); @@ -3062,39 +3485,23 @@ character.sp={ forced:true, audio:2, filter:function(event,player){ - return player.num('h',{type:'basic'})=this.player.num(this.position||'h'); + var cards=this.player.num(this.position||'h'); + var num=cards.length; + for(var i=0;i=num; } next.setContent('chooseToDiscard'); next._args=Array.from(arguments); @@ -13459,7 +13492,16 @@ if(clone) this.clone=node; if(position) position.appendChild(node); return node; - } + }, + uncheck:function(skill){ + if(skill) this.storage.uncheck.add(skill); + this.classList.add('uncheck'); + }, + recheck:function(skill){ + if(skill) this.storage.uncheck.remove(skill); + else this.storage.uncheck.length=0; + if(this.storage.uncheck.length==0) this.classList.remove('uncheck'); + } }, button:{ exclude:function(){ @@ -14245,6 +14287,12 @@ if(typeof num!='number') return true; else return(get.cardCount(card,player)