diff --git a/card/mingzhong.js b/card/mingzhong.js deleted file mode 100644 index 723a39b35..000000000 --- a/card/mingzhong.js +++ /dev/null @@ -1,210 +0,0 @@ -'use strict'; -card.mingzhong={ - connect:true, - card:{ - shengdong:{ - fullskin:true, - enable:function(card,player){ - var hs=player.get('h'); - if(hs.length>1) return true; - if(hs.length==1&&hs[0]!=card) return true; - return false; - }, - type:'trick', - selectTarget:2, - multitarget:true, - targetprompt:['交给其一张牌','得两张牌'], - filterTarget:function(card,player,target){ - return target!=player; - }, - content:function(){ - 'step 0' - if(!player.num('h')){ - event.finish(); - } - else{ - event.target1=targets[0]; - event.target2=targets[1]; - player.chooseCard('h','将一张手牌交给'+get.translation(event.target1),true); - } - 'step 1' - player.$give(1,event.target1); - event.target1.gain(result.cards); - 'step 2' - if(!event.target1.num('h')){ - event.finish(); - } - else{ - var he=event.target1.get('he'); - if(he.length<=2){ - event.directresult=he; - } - else{ - event.target1.chooseCard('he','将两张牌交给'+get.translation(event.target2),2,true); - } - } - 'step 3' - if(!event.directresult){ - event.directresult=result.cards; - } - event.target1.$give(event.directresult.length,event.target2); - event.target2.gain(event.directresult); - }, - ai:{ - order:2.5, - value:[4,1], - useful:1, - wuxie:function(){ - return 0; - }, - result:{ - target:function(player,target){ - var ok=false; - var hs=player.get('h'); - for(var i=0;i3){ - num+=1.1; - } - else if(att>0){ - num++; - } - else if(att<-3){ - num-=1.1; - } - else if(att<0){ - num--; - } - } - } - return num; - }, - target:-1 - }, - } - } - }, - skill:{ - caomu_skill:{ - unique:true, - trigger:{player:'phaseDrawBegin'}, - forced:true, - popup:false, - silent:true, - content:function(){ - trigger.num--; - }, - group:'caomu_skill2' - }, - caomu_skill2:{ - trigger:{player:'phaseDrawAfter'}, - forced:true, - popup:false, - silent:true, - content:function(){ - var targets=game.filterPlayer(function(current){ - return get.distance(player,current)<=1&&player!=current; - }); - if(targets.length){ - game.asyncDraw(targets); - } - } - } - }, - translate:{ - shengdong:'声东击西', - shengdong_info:'出牌阶段,对一名其他角色使用。你交给目标角色一张手牌,若如此做,其将两张牌交给另一名由你选择的其他角色', - zengbin:'增兵减灶', - zengbin_info:'出牌阶段,对一名角色使用。目标角色摸三张牌,然后选择一项:1.弃置一张非基本牌;2.弃置两张牌', - caomu:'草木皆兵', - caomu_info:'出牌阶段,对一名其他角色使用。将【草木皆兵】放置于该角色的判定区里,若判定结果不为梅花:摸牌阶段,目标角色少摸一张牌;摸牌阶段结束时,与其距离为1的角色各摸一张牌', - }, - list:[ - ["spade",1,'caomu'], - ["club",3,'caomu'], - ["heart",12,'shengdong',], - ["club",9,'shengdong'], - ["spade",9,'shengdong'], - ["diamond",4,'zengbin'], - ["heart",6,'zengbin'], - ["spade",7,'zengbin'], - ], -} diff --git a/card/refresh.js b/card/sp.js old mode 100755 new mode 100644 similarity index 55% rename from card/refresh.js rename to card/sp.js index 72c4c6fc6..c61c493a8 --- a/card/refresh.js +++ b/card/sp.js @@ -1,7 +1,19 @@ 'use strict'; -card.refresh={ +card.sp={ connect:true, card:{ + yinyueqiang:{ + fullskin:true, + type:'equip', + subtype:'equip1', + distance:{attackFrom:-2}, + ai:{ + basic:{ + equipValue:4 + } + }, + skills:['yinyueqiang'] + }, muniu:{ fullskin:true, type:'equip', @@ -15,14 +27,196 @@ card.refresh={ } } } - } + }, + du:{ + type:'basic', + fullskin:true, + ai:{ + value:-5, + useful:6, + } + }, + shengdong:{ + fullskin:true, + enable:function(card,player){ + var hs=player.get('h'); + if(hs.length>1) return true; + if(hs.length==1&&hs[0]!=card) return true; + return false; + }, + type:'trick', + selectTarget:2, + multitarget:true, + targetprompt:['交给其一张牌','得两张牌'], + filterTarget:function(card,player,target){ + return target!=player; + }, + content:function(){ + 'step 0' + if(!player.num('h')){ + event.finish(); + } + else{ + event.target1=targets[0]; + event.target2=targets[1]; + player.chooseCard('h','将一张手牌交给'+get.translation(event.target1),true); + } + 'step 1' + player.$give(1,event.target1); + event.target1.gain(result.cards); + 'step 2' + if(!event.target1.num('h')){ + event.finish(); + } + else{ + var he=event.target1.get('he'); + if(he.length<=2){ + event.directresult=he; + } + else{ + event.target1.chooseCard('he','将两张牌交给'+get.translation(event.target2),2,true); + } + } + 'step 3' + if(!event.directresult){ + event.directresult=result.cards; + } + event.target1.$give(event.directresult.length,event.target2); + event.target2.gain(event.directresult); + }, + ai:{ + order:2.5, + value:[4,1], + useful:1, + wuxie:function(){ + return 0; + }, + result:{ + target:function(player,target){ + var ok=false; + var hs=player.get('h'); + for(var i=0;i3){ + num+=1.1; + } + else if(att>0){ + num++; + } + else if(att<-3){ + num-=1.1; + } + else if(att<0){ + num--; + } + } + } + return num; + }, + target:-1 + }, + } + } }, skill:{ + yinyueqiang:{ + trigger:{player:['useCard','respondAfter']}, + direct:true, + filter:function(event,player){ + if(_status.currentPhase==player) return false; + if(!event.cards) return false; + if(event.cards.length!=1) return false; + if(lib.filter.autoRespondSha.call({player:player})) return false; + return get.color(event.cards[0])=='black'; + }, + content:function(){ + player.chooseToUse('是否发动【银月枪】?',{name:'sha'}).logSkill='yinyueqiang'; + } + }, muniu_skill:{ enable:'phaseUse', usable:1, filterCard:true, check:function(card){ + if(card.name=='du') return 20; var player=_status.event.player; var nh=player.num('h'); if(nh<=player.hp){ @@ -290,8 +484,52 @@ card.refresh={ } } }, + _du:{ + trigger:{player:['useCardAfter','respondAfter','discardAfter']}, + popup:false, + forced:true, + filter:function(event,player){ + if(event.cards){ + for(var i=0;i=2; + return player.num('h',{type:'hslingjian'})>=1; }, filterCard:{type:'hslingjian'}, - selectCard:2, - content:function(){ - player.gain(game.createCard('jiguanshu')); - }, - ai:{ - order:7, - result:{ - player:function(player){ - for(var i=0;i0)){ - return 1; - } - return 0; - } - } - } - } + viewAs:{name:'jiguanshu'} }, _lingjianduanzao:{ enable:'phaseUse', position:'he', prompt:function(event){ var lingjians=[],types=[]; - var hs=event.player.get('h'); + var hs=event.player.get('he'); for(var i=0;i=Math.max(2,player.num('h')-player.hp)) return 0; if(player.hp==player.maxHp||player.storage.rerende<0||player.num('h')<=1){ @@ -85,10 +87,10 @@ character.refresh={ } if(player.canUse('tao',player,true,true)){ list.push('tao'); - }; + } if(player.canUse('jiu',player,true,true)){ list.push('jiu'); - }; + } if(list.length){ list.push('cancel'); player.chooseControl(list,function(){ @@ -151,6 +153,9 @@ character.refresh={ }, result:{ target:function(player,target){ + if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ + return -10; + } if(target.num('j','lebu')) return 0; var nh=target.num('h'); var np=player.num('h'); @@ -469,9 +474,9 @@ character.refresh={ unique:true, trigger:{player:'gainAfter'}, direct:true, + usable:4, filter:function(event,player){ if(event.parent.parent.name=='phaseDraw') return false; - if(player.storage.qingjian>=4) return false; return event.cards&&event.cards.length>0 }, content:function(){ @@ -488,11 +493,16 @@ character.refresh={ }, ai1:function(card){ if(ui.selected.cards.length>0) return -1; + if(card.name=='du') return 20; return (_status.event.player.num('h')-_status.event.player.hp); }, ai2:function(target){ + var att=ai.get.attitude(_status.event.player,target); + if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ + return 1-att; + } if(target.num('h')>_status.event.player.num('h')) return 0; - return ai.get.attitude(_status.event.player,target)-4; + return att-4; }, prompt:'请选择要送人的卡牌' }); @@ -511,16 +521,6 @@ character.refresh={ ai:{ expose:0.3 }, - group:'qingjian2' - }, - qingjian2:{ - trigger:{global:'phaseBegin'}, - forced:true, - popup:false, - silent:true, - content:function(){ - player.storage.qingjian=0; - } }, reyingzi:{ audio:2, @@ -594,7 +594,7 @@ character.refresh={ order:9, result:{ target:function(player,target){ - return -target.num('he'); + return -target.num('he')-(player.num('h','du')?1:0); } }, threaten:2, @@ -760,13 +760,16 @@ character.refresh={ game.addVideo('thrownhighlight1'); game.addVideo('centernode',null,get.cardInfo(event.card)); if(get.type(event.card,'trick')==get.type(trigger.card,'trick')){ - player.chooseTarget('选择获得此牌的角色').ai=function(target){ + player.chooseTarget('选择获得此牌的角色').set('ai',function(target){ var att=ai.get.attitude(_status.event.player,target); + if(_status.event.du){ + return -att; + } if(att>0){ return att+Math.max(0,5-target.num('h')); } return att; - } + }).set('du',event.card.name=='du'); } else{ player.chooseBool('是否弃置'+get.translation(event.card)+'?'); @@ -888,10 +891,15 @@ character.refresh={ }, ai1:function(card){ if(ui.selected.cards.length>0) return -1; + if(card.name=='du') return 20; return (_status.event.player.num('h')-_status.event.player.hp); }, ai2:function(target){ - return ai.get.attitude(_status.event.player,target)-4; + var att=ai.get.attitude(_status.event.player,target); + if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ + return 1-att; + } + return att-4; }, prompt:'请选择要送人的卡牌' }); @@ -1233,6 +1241,7 @@ character.refresh={ trigger:{global:'phaseEnd'}, direct:true, filter:function(event,player){ + if(lib.filter.autoRespondSha.call({player:player})) return false; return event.player.isAlive()&&event.player.getStat('damage')&& lib.filter.targetEnabled({name:'sha'},player,event.player)&& !lib.filter.autoRespondSha.call({player:player}); diff --git a/character/shenhua.js b/character/shenhua.js index f6191368b..53c5671ef 100644 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -729,6 +729,7 @@ character.shenhua={ content:function(){ "step 0" player.chooseToCompare(target,function(card){ + if(card.name=='du') return 20; var player=get.owner(card); var target=_status.event.getParent().target; if(player!=target&&ai.get.attitude(player,target)>0){ @@ -749,7 +750,8 @@ character.shenhua={ expose:0.2, result:{ target:function(player,target){ - if(player.num('h')<=player.hp) return false; + if(player.num('h','du')&&ai.get.attitude(player,target)<0) return -1; + if(player.num('h')<=player.hp) return 0; var maxnum=0; var cards2=target.get('h'); for(var i=0;i0) return -1; + if(card.name=='du') return 20; return (_status.event.player.num('h')-_status.event.player.hp); }, ai2:function(target){ - return ai.get.attitude(_status.event.player,target)-4; + var att=ai.get.attitude(_status.event.player,target); + if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ + return 1-att; + } + return att-4; }, prompt:'请选择要送人的卡牌' }); @@ -465,6 +470,8 @@ character.standard={ }, check:function(card){ if(ui.selected.cards.length>1) return 0; + if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0; + if(!ui.selected.cards.length&&card.name=='du') return 20; var player=get.owner(card); if(player.hp==player.maxHp||player.storage.rende<0||player.num('h')<=1){ if(ui.selected.cards.length){ @@ -508,6 +515,9 @@ character.standard={ }, result:{ target:function(player,target){ + if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ + return -10; + } if(target.num('j','lebu')) return 0; var nh=target.num('h'); var np=player.num('h'); diff --git a/character/swd.js b/character/swd.js index 52f18170a..a5feca164 100755 --- a/character/swd.js +++ b/character/swd.js @@ -1478,9 +1478,13 @@ character.swd={ filterCard:true, selectCard:[1,Infinity], ai1:function(card){ - if(ui.selected.cards.length==0&&player.hp==1) return 11-ai.get.value(card); + var useful=ai.get.useful(card); + if(card.name=='du'){ + useful=-5; + } + if(ui.selected.cards.length==0&&player.hp==1) return 11-useful; if(ui.selected.cards.length>1) return 0; - return 7-ai.get.useful(card); + return 7-useful; }, ai2:function(target){ if(target.hp>ui.selected.cards.length){ @@ -2503,6 +2507,7 @@ character.swd={ return lib.filter.targetEnabled({name:'guiyoujie'},player,target); }, check:function(card){ + if(card.name=='du') return 20; return Math.max(7-ai.get.value(card),7-ai.get.useful(card)); }, content:function(){ @@ -5666,6 +5671,7 @@ character.swd={ }, filterCard:true, check:function(card){ + if(card.name=='du') return 20; if(get.owner(card).num('h')0){ return 8-ai.get.value(card); @@ -3385,6 +3386,7 @@ character.yijiang={ order:1, result:{ target:function(player,target){ + if(player.num('h')==1&&player.num('h','du')) return -1; if(player.hp<=2&&player.num('h','shan')) return 0; if(target.num('h')+player.num('h')>target.hp+2) return 0; if(ai.get.attitude(player,target)>3) return 1; @@ -5302,13 +5304,17 @@ character.yijiang={ return player!=target; }, ai1:function(card){ + var player=_status.event.player; + if(player.maxHp-player.hp==1&&card.name=='du') return 30; var check=_status.event.check; if(check<1) return 0; - if(_status.event.player.hp>1&&check<2) return 0; + if(player.hp>1&&check<2) return 0; return ai.get.unuseful(card)+9; }, ai2:function(target){ - return ai.get.attitude(_status.event.player,target)-2; + var att=ai.get.attitude(_status.event.player,target); + if(ui.selected.cards.length==1&&ui.selected.cards[0].name=='du') return 1-att; + return att-2; }, prompt:'将'+get.cnNumber(event.num)+'张手牌交给一名其他角色', }).set('check',check); diff --git a/character/yxs.js b/character/yxs.js index b6633ce5b..0afe9a1a5 100755 --- a/character/yxs.js +++ b/character/yxs.js @@ -683,8 +683,10 @@ character.yxs={ "step 1" player.chooseTarget('是否发动【仗义】?',function(card,player,target){ return player!=target - }).ai=function(target){ - return ai.get.attitude(player,target); + }).set('du',(trigger.cards.length==1&&trigger.cards[0].name=='du')).ai=function(target){ + var att=ai.get.attitude(_status.event.player,target); + if(_status.event.du) return -att; + return att; }; "step 2" if(result.bool){ diff --git a/game/asset.js b/game/asset.js index d5b9ca087..8e00578bd 100644 --- a/game/asset.js +++ b/game/asset.js @@ -270,6 +270,7 @@ window.noname_asset_list=[ 'image/card/xixueguizhihuan.png', 'image/card/xuanyuanjian.png', 'image/card/yihuajiemu.png', + 'image/card/yinyueqiang.png', 'image/card/yiyi.png', 'image/card/yuanjiao.png', 'image/card/yuxi.png', diff --git a/game/config.js b/game/config.js index 41bcb2722..1d1ef6640 100755 --- a/game/config.js +++ b/game/config.js @@ -271,7 +271,7 @@ window.config={ right_click:'pause', sort:'type_sort', - cards:['standard','ex','extra','refresh'], + cards:['standard','ex','extra','sp'], characters:['standard','shenhua','refresh','sp','yijiang'], connect_characters:[], connect_cards:[], diff --git a/game/game.js b/game/game.js index a116fdd90..da16897c5 100755 --- a/game/game.js +++ b/game/game.js @@ -4961,6 +4961,14 @@ event.skillDialog.close(); } if(event.result&&event.result.bool&&!game.online&&!event.nouse){ + if(event.logSkill){ + if(typeof event.logSkill=='string'){ + player.logSkill(event.logSkill); + } + else if(Array.isArray(event.logSkill)){ + player.logSkill.apply(player,event.logSkill); + } + } player.useResult(event.result,event); } else if(event._sendskill){ @@ -8278,6 +8286,7 @@ var event=_status.event.getParent(); var to=(player==event.player?event.target:event.player); var addi=(ai.get.value(card)>=8&&get.type(card)!='equip')?-10:0; + if(card.name=='du') addi+=5; if(player==event.player){ if(ai.get.attitude(player,to)>0&&event.small){ return -get.number(card)-ai.get.value(card)/2+addi; @@ -8378,7 +8387,7 @@ } if(next.filterCard==undefined) next.filterCard=lib.filter.all; if(next.selectCard==undefined) next.selectCard=[1,1]; - if(next.ai==undefined) next.ai=ai.get.unuseful2; + if(next.ai==undefined) next.ai=ai.get.unuseful3; next.content=lib.element.playerproto.chooseCard; next._args=Array.from(arguments); return next; @@ -20511,7 +20520,7 @@ selectname.style.maxWidth='85px'; var skillopt=ui.create.selectlist(list2,list2[0],addSkill); var editSkillButton=document.createElement('button'); - editSkillButton.innerHTML='编辑'; + editSkillButton.innerHTML='引用'; editSkillButton.style.marginRight='3px'; addSkill.appendChild(editSkillButton); var addSkillButton=document.createElement('button'); @@ -28651,6 +28660,10 @@ unuseful2:function(card){ return 10-ai.get.useful(card); }, + unuseful3:function(card){ + if(card.name=='du') return 20; + return 10-ai.get.useful(card); + }, value:function(card,player,method){ var aii=get.info(card).ai; var value; diff --git a/game/package.js b/game/package.js index 00e50c9af..d254f9fa2 100755 --- a/game/package.js +++ b/game/package.js @@ -19,9 +19,8 @@ character.pack={ card.pack={ standard:'标准', extra:'军争', - refresh:'界限突破', + sp:'SP', guozhan:'国战', - mingzhong:'SP', zhenfa:'阵法', yunchou:'运筹帷幄', swd:'轩辕剑', diff --git a/game/source.js b/game/source.js index ddddd7ad5..868d7d102 100644 --- a/game/source.js +++ b/game/source.js @@ -3,8 +3,7 @@ window.noname_source_list=[ 'card/extra.js', 'card/guozhan.js', 'card/hearth.js', - 'card/mingzhong.js', - 'card/refresh.js', + 'card/sp.js', 'card/shenqi.js', 'card/standard.js', 'card/swd.js', diff --git a/game/update.js b/game/update.js index 2cf874ec5..686f32e91 100644 --- a/game/update.js +++ b/game/update.js @@ -7,16 +7,27 @@ window.noname_update={ files:{ global:[ 'game/game.js', + 'game/config.js', 'game/asset.js', 'game/package.js', 'game/source.js', 'character/hearth.js', 'character/swd.js', 'character/sp.js', + 'character/ow.js', + 'character/yijiang.js', + 'character/shenhua.js', + 'character/gujian.js', + 'character/standard.js', + 'character/refresh.js', + 'character/extra.js', + 'character/yxs.js', 'card/swd.js', 'card/hearth.js', 'card/yunchou.js', 'card/standard.js', + 'card/compensate.js', + 'card/sp.js', 'layout/default/layout.css', 'theme/woodden/style.css', ], diff --git a/image/card/chenhuodajie.png b/image/card/chenhuodajie.png old mode 100755 new mode 100644 index 576e85e37..686bfcca8 Binary files a/image/card/chenhuodajie.png and b/image/card/chenhuodajie.png differ diff --git a/image/card/du.png b/image/card/du.png new file mode 100644 index 000000000..0b5878bec Binary files /dev/null and b/image/card/du.png differ diff --git a/image/card/yinyueqiang.png b/image/card/yinyueqiang.png new file mode 100644 index 000000000..817c0a03e Binary files /dev/null and b/image/card/yinyueqiang.png differ