diff --git a/character/refresh.js b/character/refresh.js index b01896d11..07f78d329 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -1763,14 +1763,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }).set('judging',trigger.player.judging[0]); "step 1" if(result.bool){ - player.respond(result.cards,'highlight'); + player.respond(result.cards,'reguicai','highlight'); } else{ event.finish(); } "step 2" if(result.bool){ - player.logSkill('reguicai'); if(trigger.player.judging[0].clone){ trigger.player.judging[0].clone.classList.remove('thrownhighlight'); game.broadcast(function(card){ diff --git a/character/shenhua.js b/character/shenhua.js index bcd8a5a47..5b9daa07c 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -6198,14 +6198,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }).set('judging',trigger.player.judging[0]); "step 1" if(result.bool){ - player.respond(result.cards,'highlight'); + player.respond(result.cards,'highlight','guidao'); } else{ event.finish(); } "step 2" if(result.bool){ - player.logSkill('guidao'); player.$gain2(trigger.player.judging[0]); player.gain(trigger.player.judging[0]); trigger.player.judging[0]=result.cards[0]; diff --git a/character/sp.js b/character/sp.js index 53174ddfc..dfe16350c 100755 --- a/character/sp.js +++ b/character/sp.js @@ -12,15 +12,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_zizouqi:["mangyachang","xugong","zhangchangpu"], sp_zhongdan:["cuiyan","huangfusong"], sp_star:["sp_xiahoushi","jsp_zhaoyun","huangjinleishi","sp_pangtong","sp_daqiao","sp_ganning","sp_xiahoudun","sp_lvmeng","sp_zhangfei","sp_liubei"], - sp_guozhan:["shamoke","ganfuren","yuejin","hetaihou","dingfeng","panfeng"], + sp_guozhan:["shamoke","ganfuren","yuejin","hetaihou","dingfeng","panfeng","jianggan"], sp_guozhan2:["mifuren","mateng","tianfeng","chendong","sp_dongzhuo","jiangfei","jiangqing","kongrong","bianfuren","liqueguosi","lvfan","cuimao","jiling","zangba","zhangren","zoushi"], - sp_others:["kaisa","hanba"], + sp_others:["hanba"], }, }, character:{ mangyachang:["male","qun",4,["spjiedao"],[]], xugong:["male","wu",3,["biaozhao","yechou"],[]], zhangchangpu:["female","wei",3,["yanjiao","xingshen"],[]], + jianggan:["male","wei",3,["weicheng","daoshu"]], lijue:["male","qun","4/6",["xinfu_langxi","xinfu_yisuan"],[]], zhangji:["male","qun",4,["xinfu_lveming","xinfu_tunjun"],[]], fanchou:["male","qun",4,["xinfu_xingluan"],[]], @@ -150,9 +151,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_liuqi:['male','qun',3,['spwenji','sptunjiang']], luzhi:['male','wei',3,['qingzhong','weijing']], - kaisa:["male","western",4,["zhengfu"]], + //kaisa:["male","western",4,["zhengfu"]], }, characterIntro:{ + jianggan:"蒋干,字子翼,汉末三国时期的人物,九江(治今安徽寿县)人。历史上的蒋干是当时的名士、辩论家。而罗贯中在历史小说《三国演义》中则将蒋干刻画成了被周瑜所愚弄的小丑形象。", zhangchangpu:"钟会的母亲。《母夫人张氏传》:夫人张氏,字昌蒲,太原兹氏人,太傅定陵成侯之命妇也。", xugong:"许贡是东汉末官吏。先后任吴郡都尉、太守,欲送密信给曹操,要曹操注意孙策,却被孙策发现而被杀。许贡生前招揽了一些门客,当中有三人不忘故主,千方百计想要手刃仇人。建安五年(公元200年),广陵太守陈登派人秘密联系孙策治下的山贼余党,企图颠覆孙策在江东的统治。孙策决定讨伐陈登,行军到丹徒时,许贡门客终于找到了机会。因为孙策有单骑出猎,在野外思考的习惯,三门客趁孙策轻装外出打猎时,放冷箭射中孙策面颊。这些门客后来在与孙策的搏斗中,被赶到的侍卫杀死。孙策此后因为伤口感染,并且俊美的容貌被毁,终于不治身亡,去世时年仅26岁。", mangyachang:"南蛮王孟获的部将,使一口截头大刀,骑一匹黄骠马。率军与蜀军交战,战败王平。后被平北将军马岱斩杀。只出现在《三国演义》里,正史中无此人。", @@ -552,6 +554,73 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, skill:{ + //蒋干 + weicheng:{ + audio:2, + trigger:{global:'gainEnd'}, + forced:true, + frequent:true, + filter:function(event,player){ + if(event.source==player&&event.player!=player&&player.hp>player.countCards('h')){ + for(var i=0;i0; + }, + filter:function(e,p){ + return !p.hasSkill('daoshu_used') + }, + content:function(){ + 'step 0' + player.chooseControl(lib.suit).set('prompt','请选择一个花色').ai=function(){return lib.suit.randomGet()}; + 'step 1' + event.suit=result.control; + player.popup(event.suit+2); + game.log(player,'选择了',event.suit+2); + player.gainPlayerCard(target,true,'h','visibleMove'); + 'step 2' + if(result.bool){ + var suit2=get.suit(result.cards[0]); + if(suit2==event.suit){ + target.damage(); + event.finish(); + } + else{ + player.addTempSkill('daoshu_used','phaseUseAfter'); + if(player.countCards('h',function(card){return get.suit(card)!=event.suit})==0){ + player.showHandcards(); + event.finish(); + } + else player.chooseCard('h',true,function(card){ + return get.suit(card)!=event.suit + },'交给'+get.translation(target)+'一张不为'+get.translation(event.suit)+'花色的牌'); + } + } + else event.finish(); + 'step 3' + player.give(result.cards,target,true); + }, + ai:{ + order:1, + result:{ + target:-1, + }, + }, + subSkill:{ + used:{sub:true}, + }, + }, //和沙摩柯一起上线的新服三将 spjiedao:{ audio:2, @@ -1038,14 +1107,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }).set('judging',trigger.player.judging[0]); "step 1" if(result.bool){ - player.respond(result.cards,'highlight'); + player.respond(result.cards,'highlight','huanshi_three'); } else{ event.finish(); } "step 2" if(result.bool){ - player.logSkill('huanshi_three'); if(trigger.player.judging[0].clone){ trigger.player.judging[0].clone.classList.remove('thrownhighlight'); game.broadcast(function(card){ @@ -2145,6 +2213,49 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } } }, + bingzhao:{ + audio:2, + unique:true, + zhuSkill:true, + forced:true, + intro:{ + content:function(group){ + return '已选择了'+get.translation(group)+'势力' + }, + }, + trigger:{global:['gameDrawAfter','zhuUpdate']}, + filter:function(event,player){ + return !player.storage.bingzhao&&player.hasZhuSkill('bingzhao'); + }, + content:function(){ + 'step 0' + var list=[]; + for(var i=0;i1; + }; + } + else event.finish(); + 'step 2' + if(result.bool){ + trigger.player.logSkill('bingzhao',player); + player.draw(); + player.storage.guju++; + player.markSkill('guju'); + } }, ai:{ combo:'zongkui' @@ -2450,7 +2576,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 0' var str='令一名其他角色交给你一张牌'; if(player.storage.choulve){ - str+='若其如此做,视为你使用'+get.translation(player.storage.choulve); + str+='若其如此做,视为你使用【'+get.translation(player.storage.choulve)+'】'; } var goon=true; if(player.storage.choulve){ @@ -2474,7 +2600,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.logSkill('choulve',target); target.chooseCard('he','是否交给'+get.translation(player)+'一张牌?', player.storage.choulve?('若如此做,视为'+get.translation(player)+ - '使用'+get.translation(player.storage.choulve)):null).set('ai',function(card){ + '使用【'+get.translation(player.storage.choulve)+'】'):null).set('ai',function(card){ if(_status.event.goon) return 7-get.value(card); return 0; }).set('goon',get.attitude(target,player)>1); @@ -2487,9 +2613,40 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(result.bool){ event.target.give(result.cards,player); if(player.storage.choulve){ - player.chooseUseTarget(player.storage.choulve); + var card=player.storage.choulve; + var select=get.select(get.info(card).selectTarget); + var targets=game.filterPlayer(); + if(select[1]==-1){ + for(var i=0;i0; + }, + filterTarget:lib.filter.notMe, + delay:0, + content:function(){ + 'step 0' + event.cards=player.getCards('h'); + player.give(event.cards,target,true); + 'step 1' + target.chooseToUse({ + prompt:'请使用得到的一张牌,或者受到来自'+get.translation(player)+'的一点伤害', + filterCard:function(card,player,event){ + if(!cards.contains(card)) return false; + return lib.filter.filterCard(card,player,event); + }, + }); + 'step 2' + if(result.bool){ + var hs=target.getCards('h'); + for(var i=0;i0; + }, + filterTarget:function(card,player,target){ + return target!=player&&target.countCards('h')>0 + }, + content:function(){ + 'step 0' + target.chooseCard('交给'+get.translation(player)+'一张手牌','h',true); + 'step 1' + target.give(result.cards,player); + 'step 2' + if(player.countGainableCards(player,'e')) target.gainPlayerCard(player,'e',true); + 'step 3' + if(target.isDamaged()&&target.hp<=player.hp){ + player.chooseBool('是否令'+get.translation(target)+'回复1点体力?').ai=function(){ + return get.recoverEffect(target,player,player); + }; + } + 'step 4' + if(result.bool) target.recover(); + }, + ai:{ + order:8, + result:{ + target:function(player,target){ + var eff=(target.isDamaged()&&target.hp<=player.hp)?get.recoverEffect(target,player,player):0; + if(eff<=0&&!player.countGainableCards(target,'e')) return -1; + return eff; + }, + }, + }, + }, + twliancai:{ + audio:2, + trigger:{player:['turnOverEnd','phaseEnd']}, + filter:function(card,player,target){ + return target=='phaseEnd'||player.countCards('h')0; + }, + check:function(card,player){ + if(card.name=='turnOve') return true; + if(player.isTurnedOver()) return true; + if(player.hp-player.countCards('h')>1) return true; + return game.hasPlayer(function(current){ + return lib.skill.twliancai.filterTarget(null,player,current)&&lib.skill.twliancai.filterAI(current); + }); + }, + filterAI:function(target){ + var player=_status.event.player; + var att=get.attitude(player,target); + if(target.isDamaged()&&target.countCards('e','baiyin')&&att>0) return 2*att; + return -att; + }, + prompt2:function(card,player,target){ + return card.name=='phase'?'将武将牌翻面,然后获得一名其他角色装备区内的一张牌':'将手牌摸至与体力值相同'; + }, + content:function(){ + 'step 0' + if(event.triggername=='phaseEnd') player.turnOver(); + else{ + player.draw(player.hp-player.countCards('h')); + event.finish(); + } + 'step 1' + player.chooseTarget('获得一名角色装备区内的一张牌',lib.skill.twliancai.filterTarget).ai=lib.skill.twliancai.filterAI; + 'step 2' + if(result.bool){ + player.line(result.targets,'thunder'); + player.gainPlayerCard('e',true,result.targets[0]); + } + }, + }, + twqijia:{ + group:'twqijia_alka', + audio:2, + enable:'phaseUse', + filter:function(event,player){ + return player.countCards('e',function(card){ + return !player.storage.twqijia.contains(get.subtype(card)); + }); + }, + filterTarget:function(card,player,target){ + return target!=player&&player.canUse({name:'sha'},target); + }, + position:'e', + filterCard:function(card,player){ + return !player.storage.twqijia.contains(get.subtype(card)); + }, + content:function(){ + 'step 0' + player.storage.twqijia.push(get.subtype(cards[0])); + player.useCard({name:'sha'},target); + 'step 1' + player.getStat().card.sha--; + }, + subSkill:{ + alka:{ + sub:true, + trigger:{player:['phaseUseBegin','phaseUseEnd']}, + silent:true, + content:function(){ + player.storage.twqijia=[]; + player.storage.twzhulin=[]; + }, + }, + }, + check:function(card){ + return 7-get.value(card); + }, + ai:{ + order:function(){ + return get.order({name:'sha'})-0.2; + }, + result:{ + target:function(player,target){ + return get.effect(target,{name:'sha'},player,player); + }, + }, + }, + }, + twzhulin:{ + group:'twqijia_alka', + locked:false, + mod:{ + globalFrom:function(from,to,distance){ + if(from.storage.twzhulin&&from.storage.twzhulin.contains(to)) return -Infinity; + } + }, + enable:'phaseUse', + filter:function(event,player){ + return player.countCards('h',lib.skill.twzhulin.filterCard)>0; + }, + filterCard:function(card){ + return card.name=='tao'||card.name=='jiu'; + }, + filterTarget:lib.filter.notMe, + content:function(){ + player.storage.twzhulin.add(target); + player.markSkill('twzhulin'); + }, + intro:{ + content:function(content,player){ + return '至'+get.translation(content)+'的距离视为1'; + }, + }, + }, + twxiaolian:{ + inherit:'twtijin', + filter:function(event,player){ + return event.card&&event.card.name=='sha'&&event.player!=player&& + event.targets.length==1&&event.targets[0]!=player; + }, + content:function(){ + trigger.twxiaolian=trigger.targets[0]; + trigger.targets=[player]; + }, + group:'twxiaolian_damage', + subSkill:{ + distance:{ + sub:true, + charlotte:true, + init:function(player,skill){ + if(!player.storage[skill]) player.storage[skill]=[]; + }, + mark:true, + marktext:'马', + intro:{ + content:'cards', + }, + mod:{ + globalTo:function(from,to,distance){ + if(from!=to) return distance+to.storage.twxiaolian_distance.length; + }, + }, + }, + damage:{ + sub:true, + trigger:{player:'damageEnd'}, + direct:true, + filter:function(event,player){ + return event.getParent(2).twxiaolian!=undefined; + }, + content:function(){ + 'step 0' + var target=trigger.getParent(2).twxiaolian; + event.target=target; + player.chooseCard('是否将一张牌当做【马】置于'+get.translation(target)+'的武将牌旁?','he').ai=function(target){ + if(get.attitude(_status.event.player,_status.event.getParent('twxiaolian_damage').target)>2) return 7-get.value(card); + return 0; + }; + 'step 1' + if(result.bool){ + player.logSkill('twxiaolian',target); + player.lose(result.cards,ui.special,'toStorage'); + target.addSkill('twxiaolian_distance'); + target.storage.twxiaolian_distance.addArray(result.cards); + target.markSkill('twxiaolian_distance'); + } + }, + }, + }, + }, + twtijin:{ + audio:2, + trigger:{global:'useCard'}, + filter:function(event,player){ + return event.card&&event.card.name=='sha'&&event.player!=player&& + event.targets.length==1&&event.targets[0]!=player&&get.distance(event.player,player,'attack')<=1; + }, + logTarget:'player', + check:function(event,player){ + return get.effect(event.targets[0],{name:'sha'},event.player,player)<=get.effect(player,{name:'sha'},event.player,player); + }, + content:function(){ + 'step 0' + trigger.targets=[player]; + var next=game.createEvent('twtijin_discard',null,trigger.getParent()); + next.player=player; + next.target=trigger.player; + next.setContent(function(){ + player.line(target,'green'); + player.discardPlayerCard(target,true,'he'); + }); + }, + }, + twyanqin:{ + forbid:['guozhan'], + audio:2, + trigger:{player:'phaseBegin'}, + direct:true, + content:function(){ + 'step 0' + var list=[]; + if(player.group!='wei') list.push('wei2'); + if(player.group!='shu') list.push('shu2'); + list.push('cancel2'); + player.chooseControl(list).set('ai',function(){ + return list.randomGet(); + }).set('prompt',get.prompt2('twyanqin')); + 'step 1' + if(result.control!='cancel2'){ + player.logSkill('twyanqin'); + var group=result.control.slice(0,3); + player.group=group; + player.node.name.dataset.nature=get.groupnature(group); + game.log(player,'将势力变为了','#y'+get.translation(group+2)); + } + }, + }, + twbaobian:{ + audio:2, + trigger:{source:'damageBefore'}, + filter:function(event,player){ + var card=event.card; + if(!card||(card.name!='sha'&&card.name!='juedou')) return false; + return event.player.group==player.group||event.player.countCards('h')>event.player.hp + }, + check:function(event,player){ + var att=get.attitude(player,event.player); + if(event.player.group==player.group) return att>0; + return att<0; + }, + logTarget:'player', + content:function(){ + var target=trigger.player; + if(target.group==player.group){ + trigger.cancel(); + var num=target.maxHp-target.countCards('h'); + if(num) target.draw(num); + } + else{ + player.discardPlayerCard(target,'h',true,target.countCards('h')-target.hp) + } + }, + }, + renshe:{ + trigger:{player:'damageEnd'}, + direct:true, + content:function(){ + 'step 0' + var choiceList=['令一名其他角色与你各摸一张牌','令自己下个出牌阶段可以多发动一次【外使】']; + if(lib.skill.chijie.filter({},player)) choiceList.push('将自己的势力变更为场上存在的一个其他势力'); + player.chooseControl('cancel2').set('prompt',get.prompt('renshe')).set('choiceList',choiceList).set('ai',function(){ + if(game.hasPlayer(function(current){ + return get.attitude(player,current)>0||current.hasSkillTag('nogain'); + })) return 0; + return 1; + }); + 'step 1' + if(result.control=='cancel2') event.finish(); + else{ + event.index=result.index; + player.logSkill('renshe'); + if(event.index==0){ + player.chooseTarget('请选择一名角色,与其各摸一张牌',lib.filter.notMe,true).ai=function(target){ + if(target.hasSkillTag('nogain')) return 0.1; + return get.attitude(_status.event.player,target); + }; + } + else if(result.index==1){ + player.storage.waishi++; + event.finish(); + } + else{ + var next=game.createEvent('renshe_changeGroup'); + next.player=player; + next.renshe=true; + next.setContent(lib.skill.chijie.content); + event.finish(); + } + } + 'step 2' + if(result.bool){ + player.line(result.targets[0],'green'); + game.asyncDraw([player,result.targets[0]]); + game.delay(); + } + }, + }, + waishi:{ + group:'waishi_afterstory', + subSkill:{ + afterstory:{ + trigger:{player:'phaseUseEnd'}, + forced:true, + silent:true, + popup:false, + content:function(){player.storage.waishi=1}, + }, + }, + init:function(player,skill){ + player.storage[skill]=1; + }, + enable:'phaseUse', + filter:function(event,player){ + return player.storage.waishi>0; + }, + filterTarget:function(card,player,target){ + return target!=player&&target.countCards('h')>=ui.selected.cards.length; + }, + filterCard:true, + check:function(card){ + if(!game.hasPlayer(function(current){ + return current!=_status.event.player&¤t.countCards('h')>ui.selected.cards.length; + })) return 0; + return 6-get.value(card); + }, + selectCard:function(){ + if(!ui.selected.targets.length) return [1,game.countGroup()]; + return [1,Math.min(ui.selected.targets[0].countCards('h'),game.countGroup())]; + }, + discard:false, + lose:false, + delay:0, + content:function(){ + 'step 0' + player.storage.waishi--; + player.lose(cards,ui.special); + player.gainPlayerCard(target,true,'h',cards.length).chooseonly=true; + 'step 1' + event.cards2=result.cards; + target.lose(event.cards2,ui.special); + 'step 2' + player.gain(event.cards2); + target.gain(cards); + player.$give(cards.length,target); + target.$give(event.cards2.length,player); + 'step 3' + game.delay(1.2); + 'step 4' + if(target.countCards('h')>player.countCards('h')||player.group==target.group) player.draw(); + }, + ai:{ + result:{ + player:function(player,target){ + if(player.countCards('h')0){ trigger.player.$giveAuto(list,player); - player.gain(list); + player.gain(list,trigger.player); } game.delay(); }, @@ -1882,8 +1882,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(player==target&&get.subtype(card)=='equip2'){ if(get.equipValue(card)<=8) return 0; } - if(target.getEquip(2)) return; - if(target.storage.lose_pos_equip&&target.storage.lose_pos_equip.contains('equip2')) return; + if(!target.isEmpty(2)) return; if(get.tag(card,'natureDamage')) return 'zerotarget'; if(get.type(card)=='trick'&&get.tag(card,'damage')){ return 'zeroplayertarget'; @@ -2782,7 +2781,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "step 2" if(result.bool&&result.cards&&result.cards.length){ event.current.$giveAuto(result.cards,player); - player.gain(result.cards); + player.gain(result.cards,event.current); } event.current=event.current.next; if(event.current!=player) event.goto(1);