diff --git a/.eslintrc.json b/.eslintrc.json index 201a75a19..d6bafd29f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,6 +12,7 @@ "no-undef": 0, "no-redeclare": 0, "no-prototype-builtins": 0, + "require-yield": 0, "no-irregular-whitespace": ["error", { "skipStrings": true, "skipTemplates": true }], "no-constant-condition": ["error", { "checkLoops": false }]/* , "comma-dangle": ["error", "only-multiline"], diff --git a/card/yingbian.js b/card/yingbian.js index 288f64211..c142d7caa 100644 --- a/card/yingbian.js +++ b/card/yingbian.js @@ -238,7 +238,6 @@ game.import('card',function(lib,game,ui,get,ai,_status){ fullskin:true, type:'equip', subtype:'equip5', - loseDelay:false, skills:['tianjitu_skill'], onLose:function(){ player.addTempSkill('tianjitu_skill_lose') diff --git a/card/zhulu.js b/card/zhulu.js index 886d7ee99..5755ab352 100644 --- a/card/zhulu.js +++ b/card/zhulu.js @@ -48,7 +48,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ return get.type(card)=='equip'&&!cards.contains(card); }); if(cardx) cards.push(cardx); - }; + } if(!cards.length){ event.finish(); event.getParent().excluded.addArray(game.players); @@ -115,11 +115,11 @@ game.import('card',function(lib,game,ui,get,ai,_status){ if(dialog.buttons[i].link==card){ button=dialog.buttons[i]; button.querySelector('.info').innerHTML=function(target){ - if(target._tempTranslate) return target._tempTranslate; - var name=target.name; - if(lib.translate[name+'_ab']) return lib.translate[name+'_ab']; - return get.translation(name); - }(target); + if(target._tempTranslate) return target._tempTranslate; + var name=target.name; + if(lib.translate[name+'_ab']) return lib.translate[name+'_ab']; + return get.translation(name); + }(target); dialog.buttons.remove(button); break; } @@ -701,7 +701,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ player.$throw(card); game.log(card,'进入了弃牌堆'); delete _status.jinhe[es[i].cardid]; - }; + } } game.broadcastAll(function(jinhe){ _status.jinhe=jinhe; diff --git a/character/clan.js b/character/clan.js index 61c3cbe2f..742d87f9c 100644 --- a/character/clan.js +++ b/character/clan.js @@ -210,7 +210,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ list.push([get.translation(get.type(name)),'',name]); if(name=='sha'){ for(var nature of lib.inpile_nature){ - if(!player.canUse(get.autoViewAs({name:name,nature,nature},[]),target)) continue; + if(!player.canUse(get.autoViewAs({name:name,nature:nature},[]),target)) continue; list.push([get.translation(get.type(name)),'',name,nature]); } } diff --git a/character/collab.js b/character/collab.js index 88d027277..a72f19027 100644 --- a/character/collab.js +++ b/character/collab.js @@ -359,8 +359,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return card!=card2&&get.number(card2,player)0){ - player.discardPlayerCard(target,true,'e',num) + player.discardPlayerCard(target,true,'e',num) } else{ - target.loseHp(); - game.delayex(); + target.loseHp(); + game.delayex(); } } if(targets.length>0) event.redo(); @@ -860,11 +860,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.line(target,'green'); var num=target.countCards('h'); if(num>0){ - player.discardPlayerCard(target,true,'h',num) + player.discardPlayerCard(target,true,'h',num) } else{ - target.loseHp(); - game.delayex(); + target.loseHp(); + game.delayex(); } } }, diff --git a/character/ddd.js b/character/ddd.js index cb630b754..7c6ad4f2f 100644 --- a/character/ddd.js +++ b/character/ddd.js @@ -526,7 +526,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var skill={ viewAs:{ name:links[0][2], - isCard:true, suit:'none', number:null, isCard:true, @@ -1697,7 +1696,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, dddxunxun:{ inherit:"xunxun", - audio:"ext:3D8测试包:2", + audio:2, }, dddfusi:{ mod:{ @@ -3381,7 +3380,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ //轲比能 dddxiaoxing:{ audio:2, - forced:true, trigger:{global:'gameDrawBegin'}, forced:true, group:'dddxiaoxing_remove', diff --git a/character/diy.js b/character/diy.js index 21af540ec..7e294e9d4 100755 --- a/character/diy.js +++ b/character/diy.js @@ -294,7 +294,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ key_inari:'#bSummer Pockets', key_saya:'#bLittle Busters!', key_harukakanata:'#bLittle Busters!', - key_tsumugi:'#bSummer Pockets', key_yui:'#rAngel Beats!', key_yoshino:'#bRewrite', key_kengo:'#bLittle Busters!', @@ -753,8 +752,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(map[1]){ if(map[1].length==len&&len>4){ for(var i=0;i5){ for(var i=0;i5){ for(var i=0;i0) player.chooseToDiscard('he',true); }, @@ -3008,7 +3007,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return false; }, content:function(){ - player.draw(); + player.draw(); }, mod:{ maxHandcard:function(player,num){ @@ -3793,7 +3792,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.chooseButton(['选择获得一张“兴”',player.getExpansions('tenzen_yixing')],true); 'step 1' if(result.bool){ - player.gain(result.links,'gain2');; + player.gain(result.links,'gain2'); } var next=game.createEvent('tenzen_yixing_insert'); event.next.remove(next); @@ -3968,9 +3967,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filterTarget:function(card,kyouko,hina){ if(kyouko==hina||kyouko.getStorage('kyouko_gongmian').contains(hina)) return false; - var hs=hina.countCards('he'); - if(hs==0) return kyouko.countCards('h')==0; - return true; + var hs=hina.countCards('he'); + if(hs==0) return kyouko.countCards('h')==0; + return true; }, content:function(){ 'step 0' @@ -4958,10 +4957,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } } switch(button.link){ - case 3:return 4.5;break; - case 4:return 4.4;break; - case 5:return 4.3;break; - case 2:return (3-player.hp)*1.5;break; + case 3:return 4.5; + case 4:return 4.4; + case 5:return 4.3; + case 2:return (3-player.hp)*1.5; case 1:{ if(game.hasPlayer(function(current){ return (get.realAttitude||get.attitude)(player,current)<0&&get.distance(player,current)>1; @@ -6122,7 +6121,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.popup('花绽',get.groupnature(name.slice(12))); game.log(player,'发动了技能',lib.translate[name].replace(/魔物/g,'【花绽】')); player.removeMark(name,1,false); - ;game.log(player,'移去了一个',lib.translate[name].replace(/魔物/g,'【魔物】')); + game.log(player,'移去了一个',lib.translate[name].replace(/魔物/g,'【魔物】')); }, } } @@ -6388,7 +6387,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{source:'damageBefore'}, forced:true, charlotte:true, - audio:'abyusa_jueqing', filter:function(event,player){ return player.storage.abyusa_jueqing_rewrite==true; }, @@ -9106,7 +9104,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); }, filterCard:true, - log:false, filterTarget:function(card,player,target){ return target!=player&&target.hasZhuSkill('akane_yifu',player)&&!target.hasSkill('akane_yifu3'); }, @@ -9349,7 +9346,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ for(var i=0;i7){ player.chooseBool().set('ai',function(){ @@ -6671,7 +6673,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }).set('prompt','是否弃置所有“军略”标记并对所有其他角色造成1点伤害?'); }else{ event.finish(); - }; + } 'step 3' if(result.bool){ var players=game.players.slice(0).sortBySeat(); @@ -6679,8 +6681,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.removeMark('nzry_junlve',player.countMark('nzry_junlve')); for(var i=0;i{ var info=get.info(skill); if(!info||info.charlotte) return; @@ -1992,7 +1992,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ subSkill:{ undist:{ group:'undist', - charlotte:true, trigger:{ player:['useCardAfter','damageEnd'], }, @@ -2954,7 +2953,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(count==1) return true; for(var i=0;i{ var player=_status.event.player; @@ -4390,7 +4389,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var ind=skillx.lastIndexOf('_'); if(ind==-1) break; skillx=skillx.slice(0,ind); - }; + } } if(popup!=false&&!infox.silent) infox.forced=false; if(!infox.charlotte&&infox.mod) delete infox.mod; diff --git a/character/offline.js b/character/offline.js index ffc9fc00c..5d176e754 100644 --- a/character/offline.js +++ b/character/offline.js @@ -630,7 +630,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return game.hasPlayer(function(current){ return evt.filterTarget(sha,player,current); }) - }; + } }) }, prompt:'将场上的一张坐骑牌当做【杀】或【闪】使用或打出', @@ -665,8 +665,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return false; })){ list.push('sha'); - }; - }catch(e){game.print(e)}; + } + }catch(e){game.print(e)} _status.event=backupx; if(list.length==1){ event.cardName=list[0]; @@ -1533,7 +1533,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addToExpansion(result.cards[0],'give',player).gaintag.add('psshiyin'); var card=player.getExpansions('psshiyin')[0]; if(card) player.gain(card,'gain2'); - }; + } }, } } @@ -1654,7 +1654,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(card.name=='du') addi-=5; if(get.color(card)=='black') addi-=6; if(player==event.player){ - if(Boolean(event.small)){ + if(event.small){ return -getn(card)-get.value(card)/2+addi; } return getn(card)-get.value(card)/2+addi; @@ -2670,9 +2670,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return '没有“戮”'; } }, - content:function(storage,player){ - return '共有'+get.cnNumber(storage.length)+'张“戮”'; - }, + // content:function(storage,player){ + // return '共有'+get.cnNumber(storage.length)+'张“戮”'; + // }, }, group:'zyshilu_zhiheng', subSkill:{ @@ -4096,7 +4096,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ list.push(['基本','','sha']); } for(var i of lib.inpile_nature){ - if(lib.filter.cardUsable({name:'sha',nature:i},player,event.getParent('chooseToUse'))&&game.hasPlayer(function(current){ + if(lib.filter.cardUsable({name:'sha',nature:i},player,event.getParent('chooseToUse'))&&game.hasPlayer(function(current){ return player.canUse({name:'sha',nature:i},current); })){ list.push(['基本','','sha',i]); @@ -4594,14 +4594,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(cards.length) player.gain(cards,'gain2','log'); 'step 5' if(event.count>0&&player.hasSkill('spyinzhi')){ - player.chooseBool(get.prompt2('spyinzhi')).set('frequentSkill','spyinzhi'); + player.chooseBool(get.prompt2('spyinzhi')).set('frequentSkill','spyinzhi'); } else event.finish(); 'step 6' if(result.bool){ player.logSkill('spyinzhi'); event.goto(1); - }; + } }, }, spmingjian:{ diff --git a/character/refresh.js b/character/refresh.js index 2998b3e37..546e3e01f 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -331,10 +331,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ switch(button.link[2]){ case 'tao':return 5; case 'jiu':return 3.01; - case 'shan':return 3.01; case 'sha': if(button.link[3]=='fire') return 2.95; - else if(button.link[3]=='fire') return 2.92; + else if(button.link[3]=='thunder') return 2.92; else return 2.9; case 'shan':return 1; } @@ -1195,7 +1194,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var color=get.color(card),colors=player.getStorage('olshuangxiong_effect'); for(var i of colors){ if(color!=i) return true; - }; + } return false; }, prompt:function(){ @@ -2305,7 +2304,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return current!=player; }).sortBySeat(target); for(var target of players){ - if(get.damageEffect(target,player,target,'fire')>=0){num=0;continue}; + if(get.damageEffect(target,player,target,'fire')>=0){num=0;continue} var shao=false; num++; if(target.countCards('he',function(card){ @@ -3171,7 +3170,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, audio:2, check:function(event,player){ - return player.getHistory('damage').indexOf(event)==0; + return player.getHistory('damage').indexOf(event)==0; }, filter:function(event,player){ var index=player.getHistory('damage').indexOf(event); @@ -4501,7 +4500,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ locked:false, enable:'chooseToUse', filterCard:function(card){ - return (get.type2(card)!='trick'&&get.color(card)=='black'); + return (get.type2(card)!='trick'&&get.color(card)=='black'); }, filter:function(event,player){ return player.hasCard((card)=>(get.type2(card)!='trick'&&get.color(card)=='black'),'hes'); @@ -6418,7 +6417,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, enable:'phaseUse', usable:1, - position:'hs', viewAs:{ name:'sha', changbiao:true, @@ -7373,7 +7371,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!lib.skill.yongjin.filter(null,player,cards)){ event.finish(); return; - }; + } var next=player.chooseTarget(2,function(card,player,target){ if(ui.selected.targets.length){ var from=ui.selected.targets[0]; @@ -7655,7 +7653,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return evt&&evt.cards2&&evt.cards2.filter(function(i){ return get.name(i,evt.hs.contains(i)?player:false)=='sha'; }).length>0; - }; + } if(event.name=='gain'&&event.player==player) return false; var evt=event.getl(player); return evt&&evt.cards2&&evt.cards2.length>0; @@ -11158,7 +11156,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(checkx>0) return checkx; } return 0; - }; + } if(attitude>0){ return result; } @@ -11521,7 +11519,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return 1; } else return 4; - }; + } return 3; }).set('logSkill',['new_liyu',trigger.player]); 'step 1' @@ -12033,7 +12031,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(get.attitude(_status.event.player,_status.currentPhase)<0&&_status.currentPhase.needsToDiscard()&&card.name!='du') return -1; for(var i=0;iplayer.hasCard(card=>lib.skill.sblianhuan.filterCard(card,player),lib.skill.sblianhuan.position), filterTarget:function(card,player,target){ if(player.hasSkill('sblianhuan_blocker')) return false; diff --git a/character/shenhua.js b/character/shenhua.js index 0f7d6b7f1..ad9f07b10 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -750,7 +750,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.line(player,trigger.player); player.logSkill('drlt_zhenrong'); player.addToExpansion(result.links,trigger.player,'give','log').gaintag.add('drlt_zhenrong'); - }; + } }, }, "drlt_hongju":{ @@ -822,11 +822,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var cards=result.links; for(var i=0;i=2) player.loseHp(); - }; - }; - }; + } + } + } }, }, rechezheng:{ @@ -2122,7 +2122,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(result.bool){ player.line(result.targets); player.discardPlayerCard(result.targets[0],'he',1,true); - }; + } }, group:'rechezheng', }, @@ -2234,7 +2234,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } player.markSkill('nzry_chenglve'); player.addTempSkill('nzry_chenglve1'); - }; + } }, ai:{ order:2.7, @@ -2252,13 +2252,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var cards=player.storage.nzry_chenglve1; for(var i=0;i0){ pl.draw(4-pl.countCards('h')); pl.logSkill('nzry_shenshi'); - }; + } player.removeSkill('nzry_shenshi1'); delete player.storage.nzry_shenshi1; delete player.storage.nzry_shenshi2; @@ -3698,7 +3698,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 2' if(!result.bool&&!event.directbool){ return; - }; + } player.addToExpansion(event.card,'gain2').gaintag.add('tuntian'); }, callback:function(){ @@ -3731,7 +3731,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } } }, - locked:false, ai:{ effect:{ target:function(card,player,target,current){ @@ -6233,7 +6232,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ "step 0"; player.chooseTarget(get.prompt2('releiji'),function(card,player,target){ - return target!=player; + return target!=player; }).ai=function(target){ if(target.hasSkill('hongyan')) return 0; return get.damageEffect(target,_status.event.player,_status.event.player,'thunder'); @@ -7080,7 +7079,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(cards[i]!=card&&get.number(cards[i])==num){ player.loseToDiscardpile(card); return; - }; + } } trigger.cancel(); trigger.result={bool:true}; diff --git a/character/shiji.js b/character/shiji.js index 5c17188f5..0f14ca1cf 100644 --- a/character/shiji.js +++ b/character/shiji.js @@ -2053,7 +2053,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!list.contains(type)){ list.push(type); cards.push(ui.cardPile.childNodes[i]) - }; + } } player.gain(cards,'gain2').gaintag.add('zhangming'); player.addTempSkill('zhangming_keep'); @@ -4860,7 +4860,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!list.contains(type)){ list.push(type); cards.push(ui.cardPile.childNodes[i]) - }; + } } player.gain(cards,'gain2'); } @@ -4960,8 +4960,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ onunmark:'throw', }, ai:{ - order:1, - result:{target:-1}, + order:1, + result:{target:-1}, }, subSkill:{ equip:{ @@ -6286,10 +6286,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }; if(!targets.length){ if(get.attitude(player,target)<0){ - if(target.countCards('e',function(card){ + if(target.countCards('e',function(card){ return get.value(card,target)<=0; })) return 1; - if(game.hasPlayer(function(current){ + if(game.hasPlayer(function(current){ return current.countCards('h',fh)==target.countCards('h',fh)-2; })) return -2; if(game.hasPlayer(function(current){ diff --git a/character/sp.js b/character/sp.js index ce0f96284..19c4985a9 100755 --- a/character/sp.js +++ b/character/sp.js @@ -1937,17 +1937,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ switch(get.sgn(get.attitude(player,target))){ case 0: return 2; - break; case 1: if(num1-1>=num2) return 0; if(num1+1<=num2) return 1; return 2; - break; case -1: if(num1-2<=num2) return 0; if(num1+3>=num2) return 1; return 2; - break; } }).set('prompt',get.prompt('olrunwei',trigger.player)); 'step 1' @@ -6253,7 +6250,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ else used.push(name); } else used.push(name); - }; + } if(info.isRound) break; } var vcards=[]; @@ -7261,7 +7258,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(evt.card.nature) natures.remove(evt.card.nature); } else tricks.remove(name); - }; + } if(info.isRound) break; } var vcards=[]; @@ -11567,11 +11564,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return target.countCards('h')!=ui.selected.targets[0].countCards('h'); }).set('complexTarget',true).set('ai',function(target){ if(!ui.selected.targets.length){ - var player=_status.event.player,hs=target.countCards('h'); - if(game.hasPlayer(function(current){ - return current!=player&¤t!=target&¤t.countCards('h')>hs&&!current.hasMark('quxi_gain')&&!current.hasMark('quxi_lose'); - })) return get.attitude(player,target)/(Math.sqrt(1+target.countCards('h'))); - return 0; + var player=_status.event.player,hs=target.countCards('h'); + if(game.hasPlayer(function(current){ + return current!=player&¤t!=target&¤t.countCards('h')>hs&&!current.hasMark('quxi_gain')&&!current.hasMark('quxi_lose'); + })) return get.attitude(player,target)/(Math.sqrt(1+target.countCards('h'))); + return 0; } if(target.countCards('h')>ui.selected.targets[0].countCards('h')) return -get.attitude(_status.event.player,target); return 0; @@ -11837,7 +11834,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ silent:true, popup:false, filter:function(event,player){ - return player.storage.juguan_draw&&player.storage.juguan_draw.contains(event.source); + return player.storage.juguan_draw&&player.storage.juguan_draw.contains(event.source); }, content:function(){ player.unmarkAuto('juguan_draw',[trigger.source]); @@ -12689,10 +12686,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return 5-val; } switch(button.link){ - case 3:return 4.5;break; - case 4:return 4.4;break; - case 5:return 4.3;break; - case 2:return (3-player.hp)*1.5;break; + case 3:return 4.5; + case 4:return 4.4; + case 5:return 4.3; + case 2:return (3-player.hp)*1.5; case 1:{ if(game.hasPlayer(function(current){ return (get.realAttitude||get.attitude)(player,current)<0&&get.distance(player,current)>1; @@ -12913,7 +12910,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filterCard:{color:'black'}, position:'hes', - audio:'niluan', viewAsFilter:function(player){ return player.countCards('hes',lib.skill.spniluan.filterCard)>0; }, @@ -13422,7 +13418,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ backup:function(links,player){ return { audio:'jingong', - filterCard:true, popname:true, position:'hes', viewAs:{name:links[0][2]}, @@ -14707,7 +14702,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, forced:true, popup:false, - onremove:true, firstDo:true, init:function(player,skill){ player.storage[skill]=0; @@ -15627,7 +15621,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ backup:function(links,player){ return { audio:'jingong', - filterCard:true, popname:true, position:'hes', viewAs:{name:links[0][2]}, @@ -17089,16 +17082,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var map={sha:'shan',tao:'jiu',jiu:'tao'} for(var i=0;i(name=='jiu'?1:0)&&player.getUseValue({name:name})>0){ - var temp=get.order({name:name}); - if(temp>max){ - max=temp; - name2=map[name]; - } - } - } - if(name2==get.name(card,player)) return 1; - return 0; + if(player.countCards('hs',map[name])>(name=='jiu'?1:0)&&player.getUseValue({name:name})>0){ + var temp=get.order({name:name}); + if(temp>max){ + max=temp; + name2=map[name]; + } + } + } + if(name2==get.name(card,player)) return 1; + return 0; } return 1; }, @@ -17123,7 +17116,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, onrespond:function(){return this.onuse.apply(this,arguments)}, onuse:function(result,player){ - player.removeMark('fanghun',1); + player.removeMark('fanghun',1); }, ai:{ respondSha:true, @@ -17144,13 +17137,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var map={sha:'shan',tao:'jiu',jiu:'tao'} for(var i=0;i(name=='jiu'?1:0)&&player.getUseValue({name:name})>0){ - var temp=get.order({name:name}); - if(temp>max) max=temp; - } - } - if(max>0) max+=((player.storage.refuhan||player.storage.twfuhan)?0.3:-0.3); - return max; + if(player.countCards('hs',map[name])>(name=='jiu'?1:0)&&player.getUseValue({name:name})>0){ + var temp=get.order({name:name}); + if(temp>max) max=temp; + } + } + if(max>0) max+=((player.storage.refuhan||player.storage.twfuhan)?0.3:-0.3); + return max; } if(!player) player=_status.event.player; return (player.storage.refuhan||player.storage.twfuhan)?4:1; @@ -20721,7 +20714,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ next.set('filterButton',function(button){ if(button.link==2){ return _status.event.bool1; - }; + } return true; }); next.set('bool1',trigger.player.isDamaged()); @@ -22600,9 +22593,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "step 0" event.target=player; event.player=trigger.player; - var prompt; - if(player==event.player) prompt='是否发动【郡兵】摸一张牌?'; - else prompt=('###是否对'+get.translation(event.target)+'发动【郡兵】?###'+(event.player==event.target?'摸一张牌':'摸一张牌,将所有手牌交给该角色,然后该角色交给你等量的手牌')); + var prompt; + if(player==event.player) prompt='是否发动【郡兵】摸一张牌?'; + else prompt=('###是否对'+get.translation(event.target)+'发动【郡兵】?###'+(event.player==event.target?'摸一张牌':'摸一张牌,将所有手牌交给该角色,然后该角色交给你等量的手牌')); event.player.chooseBool(prompt).set('choice',lib.skill.junbing.checkx(event.target,event.player)); "step 1" if(!result.bool){event.finish();return} @@ -22621,7 +22614,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "step 4" target.give(result.cards,player); }, - audio:2, }, xiongyi:{ skillAnimation:true, diff --git a/character/sp2.js b/character/sp2.js index facb1f613..cddb3982f 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -867,7 +867,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, dcwujie:{ audio:2, - forced:true, trigger:{ global:['discardBegin','drawBegin'], }, @@ -946,7 +945,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!num) delete player.getStat().skill[skillx]; else player.getStat().skill[skillx]=num; var bool3=!(bool1&&!bool2); - }catch(e){} + } catch (e) { + console.trace(e); + } if(!bool1&&!bool2&&get.skillInfoTranslation(skill,player).indexOf('出牌阶段限一次')==-1) return false; if((bool1||bool2)&&bool3) return false; } @@ -2231,7 +2232,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, subSkill:{ blocker:{ - charlotte:true, init:function(player,skill){ player.addSkillBlocker(skill); }, @@ -2626,7 +2626,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(eff2>0) return eff1>0; return player.hp>2&&eff2=0) return 0; if(!target.hasCard(function(card){ - return get.value(card,target)<=0; + return get.value(card,target)<=0; },'he')) return -att/Math.sqrt(target.countCards('he')); return 0; }); @@ -4309,10 +4308,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return 5-val; } switch(num){ - case 'equip3':return 4.5;break; - case 'equip4':return 4.4;break; - case 'equip5':return 4.3;break; - case 'equip2':return (3-player.hp)*1.5;break; + case 'equip3':return 4.5; + case 'equip4':return 4.4; + case 'equip5':return 4.3; + case 'equip2':return (3-player.hp)*1.5; case 'equip1':{ if(game.hasPlayer(function(current){ return (get.realAttitude||get.attitude)(player,current)<0&&get.distance(player,current)>1; @@ -6273,8 +6272,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.num++; if(event.numnum2) num3=0; - else if(!player.storage.xinfu_qianxin){} - else{ + else if(player.storage.xinfu_qianxin){ for(var i=0;i1&&player.hasSkill('twchungang')) num--; @@ -985,7 +983,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ cardy.sort((a,b)=>get.value(b)-get.value(a)); cardx.addArray(cardy.slice(num,cardy.length)); return [cardx,cardy.slice(0,num)]; - break; } }).set('cards',cards); 'step 1' @@ -5736,7 +5733,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return false; }); }, - direct:true, content:function(){ 'step 0' var target=lib.skill.twenyuan1.logTarget(trigger,player)[0]; @@ -6018,7 +6014,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ })){ event.finish(); return; - }; + } player.chooseTarget(get.prompt('twzhengrong'),'将一名其他角色的一张牌置于武将牌上,称为“荣”',function(card,player,target){ return target!=player&&target.countCards('he'); }).set('ai',function(target){ @@ -6447,7 +6443,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addToExpansion(result.cards[0],'log','give',player).gaintag.add('twmingren'); var card=player.getExpansions('twmingren')[0]; if(card) player.gain(card,'gain2'); - }; + } }, }, }, @@ -8839,7 +8835,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return 6+get.effect(player,card,target,target); } return get.effect(target,{name:'guohe_copy2'},player,player)/2+get.effect(target,card,player,player); - });; + }); 'step 1' if(result.bool){ event.targets=result.targets; @@ -9761,42 +9757,42 @@ game.import('character',function(lib,game,ui,get,ai,_status){ mod:{ cardEnabled:function(card,player){ if(game.hasPlayer(function(current){ - var list=current.storage.twgongsun_shadow; - if(!list) return false; - for(var i=0;i1) game.asyncDraw(targets); else{ - targets[0].draw(); - event.finish(); + targets[0].draw(); + event.finish(); } } else{ @@ -10759,20 +10755,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); }, content:function(){ - 'step 0' - player.chooseTarget(lib.skill.twfuzuan.filterTarget,get.prompt('twfuzuan'),'变更一名角色的一个转换技的状态').set('ai',function(target){ - var player=_status.event.player; - return get.effect(target,'twfuzuan',player,player); - }); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.logSkill('twfuzuan',target); - var next=game.createEvent('twfuzuan'); - next.player=player; - next.target=target; - next.setContent(lib.skill.twfuzuan.content); - } + 'step 0' + player.chooseTarget(lib.skill.twfuzuan.filterTarget,get.prompt('twfuzuan'),'变更一名角色的一个转换技的状态').set('ai',function(target){ + var player=_status.event.player; + return get.effect(target,'twfuzuan',player,player); + }); + 'step 1' + if(result.bool){ + var target=result.targets[0]; + player.logSkill('twfuzuan',target); + var next=game.createEvent('twfuzuan'); + next.player=player; + next.target=target; + next.setContent(lib.skill.twfuzuan.content); + } }, }, }, @@ -11212,7 +11208,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(storage){ if(storage){ - return '经过'+storage[1]+'个“回合结束时”后,若有“示”,则从牌堆中获得'+storage[0]+'张和“示”名称相同的牌'; + return '经过'+storage[1]+'个“回合结束时”后,若有“示”,则从牌堆中获得'+storage[0]+'张和“示”名称相同的牌'; } return '未指定施法效果'; }, @@ -11386,7 +11382,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(storage){ if(storage){ - return '经过'+storage[1]+'个“回合结束时”后,回复'+storage[0]+'点体力'; + return '经过'+storage[1]+'个“回合结束时”后,回复'+storage[0]+'点体力'; } return '未指定施法效果'; }, @@ -11462,7 +11458,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(storage){ if(storage){ - return '经过'+storage[1]+'个“回合结束时”后,摸'+storage[0]*2+'张牌'; + return '经过'+storage[1]+'个“回合结束时”后,摸'+storage[0]*2+'张牌'; } return '未指定施法效果'; }, @@ -11542,7 +11538,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(storage){ if(storage){ - return '经过'+storage[1]+'个“回合结束时”后,获得'+storage[0]+'层“防止一次伤害”的效果'; + return '经过'+storage[1]+'个“回合结束时”后,获得'+storage[0]+'层“防止一次伤害”的效果'; } return '未指定施法效果'; }, @@ -11764,7 +11760,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var checkx=get.color(card,player)==get.color(judging); if(checkx>0) return checkx; return 0; - }; + } return result*(attitude>0?1:-1); }).set('judging',trigger.player.judging[0]); 'step 1' @@ -13120,7 +13116,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); }).sortBySeat(); for(var i of list){ - i.discardPlayerCard(player,true,'he').boolline=true; + i.discardPlayerCard(player,true,'he').boolline=true; } }, }, diff --git a/character/xianding.js b/character/xianding.js index ff7c6b997..5ba612336 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -2806,7 +2806,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ result:{ target:function(player,target){ if(ui.cardPile.childNodes.length>game.players.length*5&&!player.hasSkill('dcjijiao_risutoa')&& - !game.hasPlayer(current=>current.hp<=1)&&game.countPlayer(current=>current.hp===2&¤t.countCards('hes')<3)<=1) return 0; + !game.hasPlayer(current=>current.hp<=1)&&game.countPlayer(current=>current.hp===2&¤t.countCards('hes')<3)<=1) return 0; return 5; } } @@ -4141,7 +4141,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var selected=ui.selected.targets; if(!selected.length) return true; for(var i of selected){ - if(i.getNext()==target||i.getPrevious()==target) return true; + if(i.getNext()==target||i.getPrevious()==target) return true; } return false; }, @@ -4245,7 +4245,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ try{ targetsx=game.filterPlayer(current=>player.inRange(current)); } - catch(e){player.storage.dcyuanmo_range=_tmp}; + catch(e){ + player.storage.dcyuanmo_range=_tmp + } player.storage.dcyuanmo_range=_tmp; targetsx.removeArray(targets); return targetsx.reduce((p,c)=>{ @@ -6061,7 +6063,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dcshoutan:{ audio:2, enable:'phaseUse', - selectCard:-1, position:'h', filter:function(event,player){ if(player.hasSkill('dcyaoyi')) return !player.hasSkill('dcshoutan_blocker',null,null,false); @@ -8052,7 +8053,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var selected=ui.selected.targets; if(!selected.contains(next)&&!selected.contains(prev)) return (target==next||target==prev); for(var i of selected){ - if(i.getNext()==target||i.getPrevious()==target) return true; + if(i.getNext()==target||i.getPrevious()==target) return true; } return false; }, @@ -8626,20 +8627,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, group:'baoshu_draw', subSkill:{ - draw:{ - trigger:{global:'phaseDrawBegin2'}, - forced:true, - popup:false, - filter:function(event,player){ - return !event.numFixed&&event.player.hasMark('baoshu'); - }, - content:function(){ - var target=trigger.player,num=target.countMark('baoshu'); - trigger.player.logSkill('baoshu_draw'); - trigger.num+=num; - trigger.player.removeMark('baoshu',num); - }, - }, + draw:{ + trigger:{global:'phaseDrawBegin2'}, + forced:true, + popup:false, + filter:function(event,player){ + return !event.numFixed&&event.player.hasMark('baoshu'); + }, + content:function(){ + var target=trigger.player,num=target.countMark('baoshu'); + trigger.player.logSkill('baoshu_draw'); + trigger.num+=num; + trigger.player.removeMark('baoshu',num); + }, + }, }, }, //吴范 @@ -8908,7 +8909,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(blacks.length>0){ dialog.push('
黑色牌
'); dialog.push(blacks); - }; + } player.chooseButton(dialog,true).set('ai',function(button){ var player=_status.event.player; var color=get.color(button.link),cards=player.getExpansions('syjiqiao'); @@ -9255,7 +9256,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ switch(button.link){ case 0: return 2; - break; case 1: return Math.max(0.5,player.countCards('hs',function(card){ return get.name(card)=='sha'&&player.hasValueTarget(card); @@ -9264,10 +9264,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }).map(function(target){ return get.damageEffect(target,player,player); })); - break; case 2: return player.needsToDiscard()/4; - break; case 3: var num=0; return 0.8*Math.max.apply(Math,game.filterPlayer(function(current){ @@ -9275,7 +9273,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }).map(function(target){ return get.effect(target,{name:'shunshou_copy'},player,player); })); - break; case 4: var num=0; game.countPlayer(function(current){ @@ -9285,7 +9282,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }); return num*0.8; - break; } }); if(player.getDamagedHp()>0) next.set('selectButton',[1,1+player.getDamagedHp()]); @@ -10256,27 +10252,27 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return next; }, check:function(button){ - var player=_status.event.player; - switch(button.link){ - case 0:{ - var target=game.findPlayer(function(current){ - return current.isMaxHp(); - }); - return (Math.min(target.hp,player.maxHp)-player.hp)*2; - } - case 1:{ - var target=game.findPlayer(function(current){ - return current.isMaxHandcard(); - }); - return Math.min(5,target.countCards('h')-player.countCards('h'))*0.8; - } - case 2:{ - var target=game.findPlayer(function(current){ - return current.isMaxEquip(); - }); - return (target.countCards('e')-player.countCards('e'))*1.4; - } - } + var player=_status.event.player; + switch(button.link){ + case 0:{ + var target=game.findPlayer(function(current){ + return current.isMaxHp(); + }); + return (Math.min(target.hp,player.maxHp)-player.hp)*2; + } + case 1:{ + var target=game.findPlayer(function(current){ + return current.isMaxHandcard(); + }); + return Math.min(5,target.countCards('h')-player.countCards('h'))*0.8; + } + case 2:{ + var target=game.findPlayer(function(current){ + return current.isMaxEquip(); + }); + return (target.countCards('e')-player.countCards('e'))*1.4; + } + } }, prompt:function(links){ return [ @@ -11041,7 +11037,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, mod:{ cardUsable:function(card,player,num){ - if(card.name=='sha') return num+player.countMark('spzhuilie2'); + if(card.name=='sha') return num+player.countMark('spzhuilie2'); }, }, }, @@ -11071,8 +11067,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, frequent:true, content:function(){ - player.draw(); - player.addMark('mansi',1,false); + player.draw(); + player.addMark('mansi',1,false); }, intro:{content:'已因此技能得到了#张牌'}, }, @@ -11852,7 +11848,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ //filter:function(event,player){ // return player.storage.gxlianhua&&player.storage.gxlianhua.red+player.storage.gxlianhua.black>0; //}, - forced:true, content:function(){ var cards=[]; var cards2=[]; @@ -12308,7 +12303,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return '当你使用或打出'+(player.hasSkill('dczhangcai_all')?'':'点数为8的')+'牌时,你可以摸X张牌(X为你手牌区里'+(player.hasSkill('dczhangcai_all')?'与此牌点数相同':'点数为8')+'的牌数且至少为1)。'; }, }, - perfectPair:{}, characterReplace:{ wenyang:['wenyang','db_wenyang','diy_wenyang'], gexuan:['gexuan','tw_gexuan'], diff --git a/character/xinghuoliaoyuan.js b/character/xinghuoliaoyuan.js index fb60a2d82..2f881f09f 100755 --- a/character/xinghuoliaoyuan.js +++ b/character/xinghuoliaoyuan.js @@ -811,7 +811,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, limited:true, enable:"phaseUse", - filter:function(event,player){; + filter:function(event,player){ return player.countCards('e')>0; }, filterTarget:lib.filter.notMe, diff --git a/character/yijiang.js b/character/yijiang.js index 6e99a454a..5ade1e333 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -1514,7 +1514,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ unlimit:{ mod:{ cardUsable:function(card,player){ - var list=lib.skill.lkbushi.getBushi(player); + var list=lib.skill.lkbushi.getBushi(player); if(list[0]==get.suit(card)) return Infinity; }, }, @@ -2210,7 +2210,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ next.set('filterButton',function(button){ if(button.link==0){ return _status.event.bool1; - }; + } return true; }); next.set('bool1',lib.skill.xinbenxi.filterx(trigger,player)); @@ -3151,7 +3151,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ for(var i=0;i
  • 已对'+str+'发动过〖残韵〗'); } @@ -4167,7 +4167,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!player.storage.juexiang_lie){ event.finish(); return; - }; + } player.storage.juexiang_lie--; } player.chooseTarget(get.prompt2('juexiang_lie'),function(card,player,target){ @@ -5407,8 +5407,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ skillTagFilter:function(player){ if(!player.countCards('hes')||player.hasSkill('taoluan3')) return false; - if(!player.storage.taoluan.contains('tao')){} - else if(player.isDying()&&!player.storage.taoluan.contains('jiu')){} + if(!player.storage.taoluan.contains('tao')){ /* empty */ } + else if(player.isDying()&&!player.storage.taoluan.contains('jiu')){ /* empty */ } else return false; }, order:4, @@ -6461,7 +6461,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return current!=player; }).sortBySeat(player); for(var target of players){ - if(get.damageEffect(target,player,target,'fire')>=0){num=0;continue}; + if(get.damageEffect(target,player,target,'fire')>=0){num=0;continue} var shao=false; num++; if(target.countCards('he',function(card){ @@ -8754,10 +8754,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ switch(button.link[2]){ case 'tao':return 5; case 'jiu':return 3.01; - case 'shan':return 3.01; case 'sha': if(button.link[3]=='fire') return 2.95; - else if(button.link[3]=='fire') return 2.92; + else if(button.link[3]=='thunder') return 2.92; else return 2.9; case 'shan':return 1; } @@ -10045,7 +10044,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return false; }, filter:function(event,player){ - return player!=event.player; + return player!=event.player; }, logTarget:'player', content:function(){ @@ -11060,11 +11059,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ order:10, result:{ target:function(player,target){ - if(player!=target) return 0; - if(player.hasSkill('requanji')||(player.countCards('h')+2<=player.hp+player.getExpansions('quanji').length)) return 1; - return 0; - } - }, + if(player!=target) return 0; + if(player.hasSkill('requanji')||(player.countCards('h')+2<=player.hp+player.getExpansions('quanji').length)) return 1; + return 0; + } + }, }, } }, @@ -13525,7 +13524,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, audioname:['xin_jushou'], check:function(event,player){ - return player.getHistory('damage').indexOf(event)==0; + return player.getHistory('damage').indexOf(event)==0; }, content:function(){ if(player.getHistory('damage').indexOf(trigger)>0){ diff --git a/character/yingbian.js b/character/yingbian.js index 30de75455..e1fcf2e68 100644 --- a/character/yingbian.js +++ b/character/yingbian.js @@ -295,7 +295,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, }, - logTarget:'target', marktext:'嫕', intro:{ markcount:'expansion', @@ -531,7 +530,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(trigger.name=='lose'){ for(var i in trigger.gaintag_map){ if(trigger.gaintag_map[i].contains('huaiyuanx')) num++; - }; + } } else player.getHistory('lose',function(evt){ if(trigger!=evt.getParent()) return false; @@ -588,7 +587,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, locked:false, filter:function(event,player){ - return (event.name!='phase'||game.phaseNumber==0)&&player.countCards('h')>0; + return (event.name!='phase'||game.phaseNumber==0)&&player.countCards('h')>0; }, content:function(){ var hs=player.getCards('h'); @@ -2671,7 +2670,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var type=get.type(card); return (type=='basic'||type=='trick'); }, - log:false, visible:true, filterTarget:function(card,player,target){ return target!=player&&target.hasZhuSkill('ruilve',player)&&!target.hasSkill('ruilve3'); @@ -3590,7 +3588,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ wangxiang:'王祥(184年,一作180年-268年4月30日),字休徵。琅邪临沂(今山东省临沂市西孝友村)人。三国曹魏及西晋时大臣。王祥于东汉末隐居二十年,在曹魏,先后任县令、大司农、司空、太尉等职,封爵睢陵侯。西晋建立,拜太保,进封睢陵公。泰始四年四月戊戌日(268年4月30日)去世,年八十五(一作八十九),谥号“元”。有《训子孙遗令》一文传世。王祥侍奉后母朱氏极孝,为传统文化中二十四孝之一“卧冰求鲤”的主人翁。', }, characterTitle:{}, - perfectPair:{}, characterFilter:{}, dynamicTranslate:{}, perfectPair:{ diff --git a/character/yxs.js b/character/yxs.js index eb2c86eed..cc159e5b5 100644 --- a/character/yxs.js +++ b/character/yxs.js @@ -136,7 +136,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); }, content:function(){ - for(var i=0;i1; }, content:function(){ - "step 0" - player.chooseTarget('选择【门神】的目标',lib.translate.yxs_menshen_info,true,function(card,player,target){ + "step 0" + player.chooseTarget('选择【门神】的目标',lib.translate.yxs_menshen_info,true,function(card,player,target){ return target!=player; }).set('ai',function(target){ return get.attitude(player,target); @@ -177,7 +177,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ expose:0.5, }, }, - yxs_menshen2:{ + yxs_menshen2:{ audio:2, mark:'character', intro:{ @@ -188,7 +188,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{ target:["shaBegin","juedouBegin"], }, - forced:true, + forced:true, popup:false, filter:function(event,player){ return player.isAlive(); @@ -197,10 +197,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var target=player.storage.yxs_menshen2; trigger.player.line(target,'green'); trigger.targets.remove(player); - trigger.targets.push(target); + trigger.targets.push(target); trigger.target = target; }, - }, + }, guimian:{ trigger:{source:'damageEnd'}, forced:true, diff --git a/game/game.js b/game/game.js index 18d6157f4..2f98df6db 100644 --- a/game/game.js +++ b/game/game.js @@ -11492,6 +11492,7 @@ } } } + // falls through default: return Legacy(item); } @@ -14588,11 +14589,11 @@ event._result={bool:true}; event._direct=true; } - else if(info.direct){ + else if(info.direct&&player.isOnline()){ event._result={bool:true}; event._direct=true; } - else if(info.direct&&player.isOnline()){ + else if(info.direct){ event._result={bool:true}; event._direct=true; } @@ -21244,9 +21245,9 @@ if(type=='horse'||type=='equip3_4'){ return player.hasEnabledSlot(3)&&(get.is.mountCombined()||player.hasEnabledSlot(4)); } - else if(type=='equip3_4'){ - type='equip3'; - } + // else if(type=='equip3_4'){ + // type='equip3'; + // } else if(get.is.mountCombined()&&type=='equip4'){ return false; } @@ -21980,7 +21981,7 @@ txy=to.getXY(); n=Math.abs(fxy[0]-txy[0])+Math.abs(fxy[1]-txy[1]); } - else if(to.isMin(true)||from.isMin(true)){} + else if(to.isMin(true)||from.isMin(true)){/* empty */} else{ var length=game.players.length; var totalPopulation=game.players.length+game.dead.length+1; @@ -25751,7 +25752,7 @@ case 1:this.draw(nodelay?'nodelay':1);break; case 2:this.recover();break; case 3:this.changeHujia();break; - case 4:this.tempHide(); + case 4:this.tempHide();break; case 5:this.discard(this.getCards('j')).delay=(!nodelay);break; case 6:{ if(this.isLinked()) this.link(); diff --git a/mode/boss.js b/mode/boss.js index 7ea96ab0a..4869732fd 100644 --- a/mode/boss.js +++ b/mode/boss.js @@ -2172,21 +2172,21 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ player.chooseToDiscard('he',get.prompt('noda_axe',trigger.target),2,'弃置两张牌,令'+get.translation(trigger.target)+'本回合内不能使用或打出牌且防具技能无效。',function(card,player){ return card!=player.getEquip(1); }).set('logSkill',['noda_axe',trigger.target]).set('goon',function(event,player){ - if(player.hasSkill('noda_axe2')) return false; - if(event.getParent().excluded.contains(player)) return false; - if(get.attitude(event.player,player)>0){ - return false; - } - if(get.type(event.card)=='trick'&&event.player.hasWuxie()) return true; - if(get.tag(event.card,'respondSha')){ - if(!player.hasSha()) return false; - return true; - } - else if(get.tag(event.card,'respondShan')){ - if(!player.hasShan()) return false; - return true; - } - return false; + if(player.hasSkill('noda_axe2')) return false; + if(event.getParent().excluded.contains(player)) return false; + if(get.attitude(event.player,player)>0){ + return false; + } + if(get.type(event.card)=='trick'&&event.player.hasWuxie()) return true; + if(get.tag(event.card,'respondSha')){ + if(!player.hasSha()) return false; + return true; + } + else if(get.tag(event.card,'respondShan')){ + if(!player.hasShan()) return false; + return true; + } + return false; }(trigger,trigger.target)).set('ai',function(card){ if(_status.event.goon) return 7.5-get.value(card); return 0; @@ -2268,7 +2268,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(current!=player&¤t.countCards('e')){ player.line(current); current.discard(current.getCards('e')); - }; + } }); }, }, @@ -8266,7 +8266,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(target.classList.contains('turnedover')) return -1; return 5-target.getDamagedHp(); } - return 1; } "step 1" if(result.bool){ diff --git a/mode/brawl.js b/mode/brawl.js index 8c80048b5..a3b63f6db 100644 --- a/mode/brawl.js +++ b/mode/brawl.js @@ -541,57 +541,57 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, _lingli:{ - mark:true, - marktext:'灵', - popup:'聚灵', - intro:{ - name:'灵力', - content:'当前灵力点数:# / 5', - }, - trigger:{ - player:'phaseBeginStart', - }, - prompt:'是否消耗2点灵力获得一个技能?', - filter:function(event,player){ - return player.storage._lingli>1; - }, - check:function(event,player){ - return player.skillH.length<3; - }, - content:function(){ - 'step 0' - player.changeLingli(-2); - 'step 1' - event.skills=lib.huanhuazhizhan.skills; - var skills=event.skills; - skills.randomSort(); - var list=[]; - for(var i=0;i0) list.push('刷新'); - event.list=list; - var dialog=game.getSkillDialog(event.list,'选择获得一个技能'); - player.chooseControl(event.list).set('ai',function(){ - return 0; - }).dialog=dialog; - 'step 2' - if(result.control=='刷新'){ - player.changeLingli(-1); - event.goto(1); - return; - } - event.skill=result.control; - if(player.skillH.length==3){ - event.lose=true; - player.chooseControl(player.skillH).prompt='选择失去1个已有技能'; - } - 'step 3' - if(event.lose) player.removeSkillH(result.control); - player.addSkillH(event.skill); - }, + mark:true, + marktext:'灵', + popup:'聚灵', + intro:{ + name:'灵力', + content:'当前灵力点数:# / 5', + }, + trigger:{ + player:'phaseBeginStart', + }, + prompt:'是否消耗2点灵力获得一个技能?', + filter:function(event,player){ + return player.storage._lingli>1; + }, + check:function(event,player){ + return player.skillH.length<3; + }, + content:function(){ + 'step 0' + player.changeLingli(-2); + 'step 1' + event.skills=lib.huanhuazhizhan.skills; + var skills=event.skills; + skills.randomSort(); + var list=[]; + for(var i=0;i0) list.push('刷新'); + event.list=list; + var dialog=game.getSkillDialog(event.list,'选择获得一个技能'); + player.chooseControl(event.list).set('ai',function(){ + return 0; + }).dialog=dialog; + 'step 2' + if(result.control=='刷新'){ + player.changeLingli(-1); + event.goto(1); + return; + } + event.skill=result.control; + if(player.skillH.length==3){ + event.lose=true; + player.chooseControl(player.skillH).prompt='选择失去1个已有技能'; + } + 'step 3' + if(event.lose) player.removeSkillH(result.control); + player.addSkillH(event.skill); + }, }, _lingli_round:{ trigger:{global:'roundStart'}, @@ -1060,31 +1060,31 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ },500); _status.videoInited=true; game.addVideo('arrangeLib',null,{ - skill:{ - _lingli_damage:{}, - _lingli:{ - mark:true, - marktext:'灵', - popup:'聚灵', - intro:{ - name:'灵力', - content:'当前灵力点数:# / 5', - }, - }, - _lingli_round:{}, - _lingli_draw:{}, - _lingli_save:{}, - hhzz_noCard:{}, - hhzz_huilei:{ - skillAnimation:true, - }, - hhzz_youlian:{ - skillAnimation:true, - }, - hhzz_zhencang:{}, - hhzz_huizhen:{}, - hhzz_jubao:{}, - }, + skill:{ + _lingli_damage:{}, + _lingli:{ + mark:true, + marktext:'灵', + popup:'聚灵', + intro:{ + name:'灵力', + content:'当前灵力点数:# / 5', + }, + }, + _lingli_round:{}, + _lingli_draw:{}, + _lingli_save:{}, + hhzz_noCard:{}, + hhzz_huilei:{ + skillAnimation:true, + }, + hhzz_youlian:{ + skillAnimation:true, + }, + hhzz_zhencang:{}, + hhzz_huizhen:{}, + hhzz_jubao:{}, + }, card:{ hhzz_toulianghuanzhu:{ cardimage:"toulianghuanzhu", @@ -1130,14 +1130,14 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }; var func=function(pack){ - for(var i in pack.pack){ - for(var j in pack.pack[i]) lib[i][j]=pack.pack[i][j]; - } - for(var i in pack.eltc) lib.element.content[i]=pack.eltc[i]; - for(var i in pack.eltp) lib.element.player[i]=pack.eltp[i]; - for(var i in pack.game) game[i]=pack.game[i]; - for(var i in pack.get) get[i]=pack.get[i]; - lib.huanhuazhizhan=pack; + for(var i in pack.pack){ + for(var j in pack.pack[i]) lib[i][j]=pack.pack[i][j]; + } + for(var i in pack.eltc) lib.element.content[i]=pack.eltc[i]; + for(var i in pack.eltp) lib.element.player[i]=pack.eltp[i]; + for(var i in pack.game) game[i]=pack.game[i]; + for(var i in pack.get) get[i]=pack.get[i]; + lib.huanhuazhizhan=pack; } func(pack); }, @@ -1932,373 +1932,373 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ content:{ submode:'two', chooseCharacterFixed:true, - chooseCharacterBefore:function(){ + chooseCharacterBefore:function(){ _status.noReplaceCharacter=true; - game.versusVideoName='家族之争'; - var map={ - wei:[], - shu:[], - wu:[], - qun:[], - jin:[], - key:[], - }; - var map3=[]; - var banned=['zuoci','re_zuoci','tw_xiahouba']; - for(var i in lib.character){ - if(lib.filter.characterDisabled2(i)||lib.filter.characterDisabled(i)||banned.contains(i)) continue; - var group=lib.character[i][1]; - if(group&&map[group]) map[group].push(i); - } - for(var i in map){ - if(map[i].length<8||(i=='key'&&!_status.keyVerified)){ - delete map[i]; - } - else{ - map3.push(i); - } - } - _status.brawl.map=map; - _status.brawl.map3=map3; - var skill={ - _jiazu_wei:{ - trigger:{player:'phaseBegin'}, - direct:true, - popup:'魏业', - prompt2:'回合开始时,你可以弃置一张牌并指定一名敌方角色,该角色须弃置一张牌,否则你摸一张牌。', - filter:function(event,player){ - return player.group=='wei'&&player.countCards('he')>0; - }, - content:function(){ - 'step 0' - player.chooseCardTarget({ - prompt:get.prompt2(event.name), - filterCard:lib.filter.cardDiscardable, - filterTarget:function(card,player,target){ - return player.side!=target.side; - }, - position:'he', - ai1:function(card){ - return 6-get.value(card); - }, - ai2:function(target){ - return 1/(1+target.countCards('he')); - }, - }); - 'step 1' - if(result.bool){ - player.logSkill(event.name,result.targets); - player.discard(result.cards); - result.targets[0].chooseToDiscard('弃置一张牌,或令'+get.translation(player)+'摸一张牌','he').ai=lib.skill.zhiheng.check; - } - else event.finish(); - 'step 2' - if(!result.bool) player.draw(); - }, - }, - _jiazu_shu:{ - popup:'蜀义', - prompt2:'你使用【杀】上限+1;出牌阶段结束时,若你于此阶段使用【杀】次数不少于2,摸一张牌。', - mod:{ - cardUsable:function(card,player,num){ - if(card.name=='sha'&&player.group=='shu') return num+1; - }, - }, - trigger:{player:'phaseUseEnd'}, - forced:true, - filter:function(event,player){ - return player.group=='shu'&&player.getHistory('useCard',function(evt){ - return evt.card&&evt.card.name=='sha'&&evt.getParent('phaseUse')==event; - }).length>1; - }, - content:function(){player.draw()}, - }, - _jiazu_wu:{ - trigger:{player:'phaseEnd'}, - forced:true, - popup:'吴耀', - prompt2:'回合结束时,若你的手牌数不等于你的体力值,则你摸一张牌。', - filter:function(event,player){ - return player.group=='wu'&&player.countCards('h')!=player.hp; - }, - content:function(){player.draw()}, - }, - _jiazu_qun:{ - popup:'群心', - prompt2:'锁定技,弃牌阶段开始时,若你的手牌数比体力值多2或更多,你本回合手牌上限+1;若你已损失体力值大于1,你手牌上限+1', - trigger:{player:'phaseDiscardBegin'}, - forced:true, - filter:function(event,player){ - return player.group=='qun'&&(player.isDamaged()||player.countCards('h')-player.hp>1); - }, - content:function(){ - var num=0; - if(player.isDamaged()) num++; - if(player.countCards('h')-player.hp>1) num++; - player.addMark('qunxin_temp',num,false); - player.addTempSkill('qunxin_temp','phaseDiscardEnd'); - }, - }, - _jiazu_jin:{ - trigger:{player:'phaseDrawEnd'}, - popup:'晋势', - prompt2:'摸牌阶段结束时,你可以展示你于此阶段内因摸牌而得到的牌。若这些牌的花色均不同,则你摸一张牌。', - filter:function(event,player){ - var hs=player.getCards('h'); - return player.group=='jin'&&hs.length>0&&player.getHistory('gain',function(evt){ - if(evt.getParent().name!='draw'||evt.getParent('phaseDraw')!=event) return false; - for(var i of evt.cards){ - if(hs.contains(i)) return true; - } - return false; - }).length>0; - }, - check:function(event,player){ - var hs=player.getCards('h'),cards=[],suits=[]; - player.getHistory('gain',function(evt){ - if(evt.getParent().name!='draw'||evt.getParent('phaseDraw')!=event) return false; - for(var i of evt.cards){ - if(hs.contains(i)){ - cards.add(i); - suits.add(get.suit(i,player)); - } - } - }); - return cards.length==suits.length; - }, - content:function(){ - var hs=player.getCards('h'),cards=[],suits=[]; - player.getHistory('gain',function(evt){ - if(evt.getParent().name!='draw'||evt.getParent('phaseDraw')!=trigger) return false; - for(var i of evt.cards){ - if(hs.contains(i)){ - cards.add(i); - suits.add(get.suit(i,player)); - } - } - }); - player.showCards(cards,get.translation(player)+'发动了【晋势】'); - if(cards.length==suits.length) player.draw(); - }, - }, - _jiazu_key:{ - enable:'phaseUse', - usable:1, - popup:'键魂', - filter:function(event,player){ - return player.group=='key'; - }, - prompt2:'出牌阶段限一次,你可以摸一张牌并获得1点护甲。若如此做,你于当前回合结束时失去1点体力。', - content:function(){ - "step 0" - player.draw(); - "step 1" - player.changeHujia(1); - "step 2" - var evt=event.getParent('phase'); - if(evt&&evt.after){ - var next=player.loseHp(); - event.next.remove(next); - evt.after.push(next); - } - }, - ai:{ - order:10, - result:{ - player:function(player){ - return player.hp-1; - }, - }, - }, - }, - qunxin_temp:{ - noGlobal:true, - onremove:true, - mod:{ - maxHandcard:function(player,num){ - return num+player.countMark('qunxin_temp'); - }, - }, - }, - _jiazu_awaken_wei:{ - popup:'许昌', - intro:{ - content:'锁定技,当你受到伤害后,你摸一张牌。', - }, - trigger:{player:'damageEnd'}, - forced:true, - filter:function(event,player){ - return player._jiazuAwaken&&player.group=='wei'; - }, - content:function(){player.draw()}, - }, - _jiazu_awaken_shu:{ - popup:'成都', - intro:{ - content:'锁定技,当你使用【杀】造成伤害后,你摸一张牌。', - }, - trigger:{source:'damageEnd'}, - forced:true, - filter:function(event,player){ - return player._jiazuAwaken&&player.group=='shu'&&event.card&&event.card.name=='sha'; - }, - content:function(){player.draw()}, - }, - _jiazu_awaken_wu:{ - popup:'武昌', - intro:{ - content:'锁定技,当你使用装备牌时,你摸一张牌。', - }, - trigger:{player:'useCard'}, - forced:true, - filter:function(event,player){ - return player._jiazuAwaken&&player.group=='wu'&&get.type(event.card)=='equip'; - }, - content:function(){player.draw()}, - }, - _jiazu_awaken_qun:{ - popup:'邺城', - intro:{ - content:'锁定技,当你使用锦囊牌指定其他角色为目标后,你摸一张牌。', - }, - trigger:{player:'useCardToPlayered'}, - forced:true, - filter:function(event,player){ - if(!player._jiazuAwaken||player.group!='qun'||!event.isFirstTarget||get.type(event.card,'trick')!='trick') return false; - for(var i=0;i2) return false; - } - return true; - }, - content:function(){ - player.draw(); - }, - }, - _jiazu_awaken:{ - trigger:{global:'die'}, - forced:true, - filter:function(event,player){ - return !player._jiazuAwaken&&event.player.side==player.side; - }, - content:function(){ - player._jiazuAwaken=true; - var name='_jiazu_awaken_'+player.group; - if(lib.skill[name]) player.markSkill(name); - }, - }, - }; - var translate={}; - for(var i in skill){ - lib.skill[i]=skill[i]; - if(skill[i].popup){ - lib.translate[i]=skill[i].popup; - translate[i]=skill[i].popup; - } - if(skill[i].prompt2){ - lib.translate[i+'_info']=skill[i].prompt2; - translate[i+'_info']=skill[i].prompt2; - } - if(!skill[i].noGlobal) game.addGlobalSkill(i); - }; - game.addVideo('arrangeLib',null,{ - skill:{ - _jiazu_wei:{ - popup:'魏业', - prompt2:'回合开始时,你可以弃置一张牌并指定一名敌方角色,该角色须弃置一张牌,否则你摸一张牌。', - }, - _jiazu_shu:{ - popup:'蜀义', - prompt2:'你使用【杀】上限+1;出牌阶段结束时,若你于此阶段使用【杀】次数不少于2,摸一张牌。', - }, - _jiazu_wu:{ - popup:'吴耀', - prompt2:'回合结束时,若你的手牌数不等于你的体力值,则你摸一张牌。', - }, - _jiazu_qun:{ - popup:'群心', - prompt2:'锁定技,弃牌阶段开始时,若你的手牌数比体力值多2或更多,你本回合手牌上限+1;若你已损失体力值大于1,你手牌上限+1', - }, - _jiazu_jin:{ - popup:'晋势', - prompt2:'摸牌阶段结束时,你可以展示你于此阶段内因摸牌而得到的牌。若这些牌的花色均不同,则你摸一张牌。', - }, - _jiazu_key:{ - popup:'键魂', - prompt2:'出牌阶段限一次,你可以摸一张牌并获得1点护甲。若如此做,你于当前回合结束时失去1点体力。', - }, - _jiazu_awaken_wei:{ - popup:'许昌', - intro:{ - content:'锁定技,当你受到伤害后,你摸一张牌。', - }, - }, - _jiazu_awaken_shu:{ - popup:'成都', - intro:{ - content:'锁定技,当你使用【杀】造成伤害后,你摸一张牌。', - }, - }, - _jiazu_awaken_wu:{ - popup:'武昌', - intro:{ - content:'锁定技,当你使用装备牌时,你摸一张牌。', - }, - }, - _jiazu_awaken_qun:{ - popup:'邺城', - intro:{ - content:'锁定技,当你使用锦囊牌指定其他角色为目标后,你摸一张牌。', - }, - }, - _jiazu_awaken_jin:{ - popup:'洛阳', - intro:{ - content:'锁定技,结束阶段,若你手牌中的花色数小于3,则你摸一张牌。', - }, - }, - _jiazu_awaken_key:{ - popup:'光坂', - intro:{ - content:'锁定技,当你回复/失去体力后,你摸一张牌。', - }, - }, - _jiazu_awaken:{}, - }, - translate:translate, - }); + game.versusVideoName='家族之争'; + var map={ + wei:[], + shu:[], + wu:[], + qun:[], + jin:[], + key:[], + }; + var map3=[]; + var banned=['zuoci','re_zuoci','tw_xiahouba']; + for(var i in lib.character){ + if(lib.filter.characterDisabled2(i)||lib.filter.characterDisabled(i)||banned.contains(i)) continue; + var group=lib.character[i][1]; + if(group&&map[group]) map[group].push(i); + } + for(var i in map){ + if(map[i].length<8||(i=='key'&&!_status.keyVerified)){ + delete map[i]; + } + else{ + map3.push(i); + } + } + _status.brawl.map=map; + _status.brawl.map3=map3; + var skill={ + _jiazu_wei:{ + trigger:{player:'phaseBegin'}, + direct:true, + popup:'魏业', + prompt2:'回合开始时,你可以弃置一张牌并指定一名敌方角色,该角色须弃置一张牌,否则你摸一张牌。', + filter:function(event,player){ + return player.group=='wei'&&player.countCards('he')>0; + }, + content:function(){ + 'step 0' + player.chooseCardTarget({ + prompt:get.prompt2(event.name), + filterCard:lib.filter.cardDiscardable, + filterTarget:function(card,player,target){ + return player.side!=target.side; + }, + position:'he', + ai1:function(card){ + return 6-get.value(card); + }, + ai2:function(target){ + return 1/(1+target.countCards('he')); + }, + }); + 'step 1' + if(result.bool){ + player.logSkill(event.name,result.targets); + player.discard(result.cards); + result.targets[0].chooseToDiscard('弃置一张牌,或令'+get.translation(player)+'摸一张牌','he').ai=lib.skill.zhiheng.check; + } + else event.finish(); + 'step 2' + if(!result.bool) player.draw(); + }, + }, + _jiazu_shu:{ + popup:'蜀义', + prompt2:'你使用【杀】上限+1;出牌阶段结束时,若你于此阶段使用【杀】次数不少于2,摸一张牌。', + mod:{ + cardUsable:function(card,player,num){ + if(card.name=='sha'&&player.group=='shu') return num+1; + }, + }, + trigger:{player:'phaseUseEnd'}, + forced:true, + filter:function(event,player){ + return player.group=='shu'&&player.getHistory('useCard',function(evt){ + return evt.card&&evt.card.name=='sha'&&evt.getParent('phaseUse')==event; + }).length>1; + }, + content:function(){player.draw()}, + }, + _jiazu_wu:{ + trigger:{player:'phaseEnd'}, + forced:true, + popup:'吴耀', + prompt2:'回合结束时,若你的手牌数不等于你的体力值,则你摸一张牌。', + filter:function(event,player){ + return player.group=='wu'&&player.countCards('h')!=player.hp; + }, + content:function(){player.draw()}, + }, + _jiazu_qun:{ + popup:'群心', + prompt2:'锁定技,弃牌阶段开始时,若你的手牌数比体力值多2或更多,你本回合手牌上限+1;若你已损失体力值大于1,你手牌上限+1', + trigger:{player:'phaseDiscardBegin'}, + forced:true, + filter:function(event,player){ + return player.group=='qun'&&(player.isDamaged()||player.countCards('h')-player.hp>1); + }, + content:function(){ + var num=0; + if(player.isDamaged()) num++; + if(player.countCards('h')-player.hp>1) num++; + player.addMark('qunxin_temp',num,false); + player.addTempSkill('qunxin_temp','phaseDiscardEnd'); + }, + }, + _jiazu_jin:{ + trigger:{player:'phaseDrawEnd'}, + popup:'晋势', + prompt2:'摸牌阶段结束时,你可以展示你于此阶段内因摸牌而得到的牌。若这些牌的花色均不同,则你摸一张牌。', + filter:function(event,player){ + var hs=player.getCards('h'); + return player.group=='jin'&&hs.length>0&&player.getHistory('gain',function(evt){ + if(evt.getParent().name!='draw'||evt.getParent('phaseDraw')!=event) return false; + for(var i of evt.cards){ + if(hs.contains(i)) return true; + } + return false; + }).length>0; + }, + check:function(event,player){ + var hs=player.getCards('h'),cards=[],suits=[]; + player.getHistory('gain',function(evt){ + if(evt.getParent().name!='draw'||evt.getParent('phaseDraw')!=event) return false; + for(var i of evt.cards){ + if(hs.contains(i)){ + cards.add(i); + suits.add(get.suit(i,player)); + } + } + }); + return cards.length==suits.length; + }, + content:function(){ + var hs=player.getCards('h'),cards=[],suits=[]; + player.getHistory('gain',function(evt){ + if(evt.getParent().name!='draw'||evt.getParent('phaseDraw')!=trigger) return false; + for(var i of evt.cards){ + if(hs.contains(i)){ + cards.add(i); + suits.add(get.suit(i,player)); + } + } + }); + player.showCards(cards,get.translation(player)+'发动了【晋势】'); + if(cards.length==suits.length) player.draw(); + }, + }, + _jiazu_key:{ + enable:'phaseUse', + usable:1, + popup:'键魂', + filter:function(event,player){ + return player.group=='key'; + }, + prompt2:'出牌阶段限一次,你可以摸一张牌并获得1点护甲。若如此做,你于当前回合结束时失去1点体力。', + content:function(){ + "step 0" + player.draw(); + "step 1" + player.changeHujia(1); + "step 2" + var evt=event.getParent('phase'); + if(evt&&evt.after){ + var next=player.loseHp(); + event.next.remove(next); + evt.after.push(next); + } + }, + ai:{ + order:10, + result:{ + player:function(player){ + return player.hp-1; + }, + }, + }, + }, + qunxin_temp:{ + noGlobal:true, + onremove:true, + mod:{ + maxHandcard:function(player,num){ + return num+player.countMark('qunxin_temp'); + }, + }, + }, + _jiazu_awaken_wei:{ + popup:'许昌', + intro:{ + content:'锁定技,当你受到伤害后,你摸一张牌。', + }, + trigger:{player:'damageEnd'}, + forced:true, + filter:function(event,player){ + return player._jiazuAwaken&&player.group=='wei'; + }, + content:function(){player.draw()}, + }, + _jiazu_awaken_shu:{ + popup:'成都', + intro:{ + content:'锁定技,当你使用【杀】造成伤害后,你摸一张牌。', + }, + trigger:{source:'damageEnd'}, + forced:true, + filter:function(event,player){ + return player._jiazuAwaken&&player.group=='shu'&&event.card&&event.card.name=='sha'; + }, + content:function(){player.draw()}, + }, + _jiazu_awaken_wu:{ + popup:'武昌', + intro:{ + content:'锁定技,当你使用装备牌时,你摸一张牌。', + }, + trigger:{player:'useCard'}, + forced:true, + filter:function(event,player){ + return player._jiazuAwaken&&player.group=='wu'&&get.type(event.card)=='equip'; + }, + content:function(){player.draw()}, + }, + _jiazu_awaken_qun:{ + popup:'邺城', + intro:{ + content:'锁定技,当你使用锦囊牌指定其他角色为目标后,你摸一张牌。', + }, + trigger:{player:'useCardToPlayered'}, + forced:true, + filter:function(event,player){ + if(!player._jiazuAwaken||player.group!='qun'||!event.isFirstTarget||get.type(event.card,'trick')!='trick') return false; + for(var i=0;i2) return false; + } + return true; + }, + content:function(){ + player.draw(); + }, + }, + _jiazu_awaken:{ + trigger:{global:'die'}, + forced:true, + filter:function(event,player){ + return !player._jiazuAwaken&&event.player.side==player.side; + }, + content:function(){ + player._jiazuAwaken=true; + var name='_jiazu_awaken_'+player.group; + if(lib.skill[name]) player.markSkill(name); + }, + }, + }; + var translate={}; + for(var i in skill){ + lib.skill[i]=skill[i]; + if(skill[i].popup){ + lib.translate[i]=skill[i].popup; + translate[i]=skill[i].popup; + } + if(skill[i].prompt2){ + lib.translate[i+'_info']=skill[i].prompt2; + translate[i+'_info']=skill[i].prompt2; + } + if(!skill[i].noGlobal) game.addGlobalSkill(i); + } + game.addVideo('arrangeLib',null,{ + skill:{ + _jiazu_wei:{ + popup:'魏业', + prompt2:'回合开始时,你可以弃置一张牌并指定一名敌方角色,该角色须弃置一张牌,否则你摸一张牌。', + }, + _jiazu_shu:{ + popup:'蜀义', + prompt2:'你使用【杀】上限+1;出牌阶段结束时,若你于此阶段使用【杀】次数不少于2,摸一张牌。', + }, + _jiazu_wu:{ + popup:'吴耀', + prompt2:'回合结束时,若你的手牌数不等于你的体力值,则你摸一张牌。', + }, + _jiazu_qun:{ + popup:'群心', + prompt2:'锁定技,弃牌阶段开始时,若你的手牌数比体力值多2或更多,你本回合手牌上限+1;若你已损失体力值大于1,你手牌上限+1', + }, + _jiazu_jin:{ + popup:'晋势', + prompt2:'摸牌阶段结束时,你可以展示你于此阶段内因摸牌而得到的牌。若这些牌的花色均不同,则你摸一张牌。', + }, + _jiazu_key:{ + popup:'键魂', + prompt2:'出牌阶段限一次,你可以摸一张牌并获得1点护甲。若如此做,你于当前回合结束时失去1点体力。', + }, + _jiazu_awaken_wei:{ + popup:'许昌', + intro:{ + content:'锁定技,当你受到伤害后,你摸一张牌。', + }, + }, + _jiazu_awaken_shu:{ + popup:'成都', + intro:{ + content:'锁定技,当你使用【杀】造成伤害后,你摸一张牌。', + }, + }, + _jiazu_awaken_wu:{ + popup:'武昌', + intro:{ + content:'锁定技,当你使用装备牌时,你摸一张牌。', + }, + }, + _jiazu_awaken_qun:{ + popup:'邺城', + intro:{ + content:'锁定技,当你使用锦囊牌指定其他角色为目标后,你摸一张牌。', + }, + }, + _jiazu_awaken_jin:{ + popup:'洛阳', + intro:{ + content:'锁定技,结束阶段,若你手牌中的花色数小于3,则你摸一张牌。', + }, + }, + _jiazu_awaken_key:{ + popup:'光坂', + intro:{ + content:'锁定技,当你回复/失去体力后,你摸一张牌。', + }, + }, + _jiazu_awaken:{}, + }, + translate:translate, + }); }, chooseCharacter:function(list,player){ if(player.side==game.me.side){ @@ -2398,135 +2398,135 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ content:{ submode:'two', chooseCharacterBefore:function(){ - game.versusVideoName='白衣渡江'; - lib.skill._changeCharacter={ - trigger:{player:['phaseBefore','phaseAfter']}, - forced:true, - silent:true, - popup:false, - filter:function(event,player){ - return player._backupCharacter!=undefined; - }, - content:function(){ - "step 0" - player.chooseControl('确定','取消').set('dialog',['是否替换自己的武将牌?',[[player._backupCharacter],'character']]).set('ai',function(){ - return Math.random()<0.15?'确定':'取消'; - }); - "step 1" - if(result.control=='确定'){ - game.log(player,'将',player.name,'替换为了',player._backupCharacter); - player.reinit(player.name,player._backupCharacter); - player.changeGroup(lib.character[player._backupCharacter][1],false); - delete player._backupCharacter; - } - }, - }, - game.addGlobalSkill('_changeCharacter'); - game.chooseCharacterTwo=function(){ - var next=game.createEvent('chooseCharacter'); - next.setContent(function(){ - 'step 0' - ui.arena.classList.add('choose-character'); - for(var i in lib.skill){ - if(lib.skill[i].changeSeat){ - lib.skill[i]={}; - if(lib.translate[i+'_info']){ - lib.translate[i+'_info']='此模式下不可用'; - } - } - } - var bool=Math.random()<0.5; - var bool2=Math.random()<0.5; - var ref=game.players[0]; - - ref.side=bool; - ref.next.side=bool2; - ref.next.next.side=!bool; - ref.previous.side=!bool2; - - var firstChoose=game.players.randomGet(); - if(firstChoose.next.side==firstChoose.side){ - firstChoose=firstChoose.next; - } - _status.firstAct=firstChoose; - for(var i=0;i<4;i++){ - firstChoose.node.name.innerHTML=get.verticalStr(get.cnNumber(i+1,true)+'号位'); - firstChoose=firstChoose.next; - } - - for(var i=0;i1; - }; - var list2=list.randomGets(8); - var next=game.me.chooseButton(2,true,['请选择您的武将牌',[list2,'character']]); - next.set('onfree',true); - next.set('filterButton',function(button){ - if(!ui.selected.buttons.length){ - for(var i=0;i1; + }; + var list2=list.randomGets(8); + var next=game.me.chooseButton(2,true,['请选择您的武将牌',[list2,'character']]); + next.set('onfree',true); + next.set('filterButton',function(button){ + if(!ui.selected.buttons.length){ + for(var i=0;i1){ - game.fellow.node.marks.lastChild.remove(); - } - for(var i in game.fellow.tempSkills){ - game.fellow.removeSkill(i); - } - var skills=game.fellow.getSkills(); - for(var i=0;i1){ + game.fellow.node.marks.lastChild.remove(); + } + for(var i in game.fellow.tempSkills){ + game.fellow.removeSkill(i); + } + var skills=game.fellow.getSkills(); + for(var i=0;i=6){ - list.push('我不想再打了,直接在这里结束吧!'); - list2.push(function(){ - game.over(true); - }); - } - event.list=list2; - game.zhu.chooseControl().set('choiceList',list).set('prompt','请选择一项奖励(当前已通过'+_status.qianlidanji.completeNumber+'关)'); + var list=_status.qianlidanji.completeReward.randomGets(3); + var list2=[]; + for(var i=0;i=6){ + list.push('我不想再打了,直接在这里结束吧!'); + list2.push(function(){ + game.over(true); + }); + } + event.list=list2; + game.zhu.chooseControl().set('choiceList',list).set('prompt','请选择一项奖励(当前已通过'+_status.qianlidanji.completeNumber+'关)'); } 'step 2' if(_status.qianlidanji.completeNumber!=5){ @@ -2843,37 +2843,37 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ _status.event.getParent('phaseLoop').player=game.zhu; var source=game.fan; var name=result.links[0]; - source.revive(null,false); - _status.characterlist.remove(name); - _status.qianlidanji.used.push(name); - source.uninit(); - source.init(name); - game.addVideo('reinit',source,[name]); - source.lose(source.getCards('hej'))._triggered=null; - var gain=4; - var add=0; - switch(_status.qianlidanji.completeNumber){ - case 5:break; - case 1:gain=5;break; - case 2:gain=5;add=1;break; - case 3:gain=6;add=1;break; - default:gain=6;add=2;break; - }; - source.hp+=add; - source.maxHp+=add; - source.update(); - source.gain(get.cards(gain))._triggered=null; - game.triggerEnter(source); - if(event.reward) event.reward(); - 'step 4' - var cards=Array.from(ui.ordering.childNodes); + source.revive(null,false); + _status.characterlist.remove(name); + _status.qianlidanji.used.push(name); + source.uninit(); + source.init(name); + game.addVideo('reinit',source,[name]); + source.lose(source.getCards('hej'))._triggered=null; + var gain=4; + var add=0; + switch(_status.qianlidanji.completeNumber){ + case 5:break; + case 1:gain=5;break; + case 2:gain=5;add=1;break; + case 3:gain=6;add=1;break; + default:gain=6;add=2;break; + } + source.hp+=add; + source.maxHp+=add; + source.update(); + source.gain(get.cards(gain))._triggered=null; + game.triggerEnter(source); + if(event.reward) event.reward(); + 'step 4' + var cards=Array.from(ui.ordering.childNodes); while(cards.length){ cards.shift().discard(); } var evt=_status.event.getParent('phase'); if(evt){ game.resetSkills(); - _status.event=evt; + _status.event=evt; _status.event.finish(); _status.event.untrigger(true); } @@ -2885,216 +2885,216 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ content:{ submode:'normal', chooseCharacterBefore:function(){ - game.identityVideoName='千里单骑'; - game.saveConfig('player_number',_status.qianlidanji.player_number,'identity'); - game.chooseCharacter=function(){ - var next=game.createEvent('chooseCharacter'); - next.showConfig=true; - next.setContent(function(){ - "step 0" - ui.arena.classList.add('choose-character'); - game.me.identity='zhu'; - game.zhu=game.me; - game.fan=game.me.next; - game.fan.identity='fan'; - game.zhu.setIdentity(); - game.zhu.identityShown=true; - game.zhu.node.identity.classList.remove('guessing'); - game.fan.setIdentity(); - game.fan.identityShown=true; - game.fan.node.identity.classList.remove('guessing'); - - event.list=[]; - for(var i in lib.character){ - if(lib.filter.characterDisabled(i)) continue; - event.list.push(i); - } - event.list.randomSort(); - _status.characterlist=event.list.slice(0); - var list=event.list.slice(0,5); - delete event.swapnochoose; - var dialog; - if(event.swapnodialog){ - dialog=ui.dialog; - event.swapnodialog(dialog,list); - delete event.swapnodialog; - } - else{ - var str='选择角色'; - dialog=ui.create.dialog(str,'hidden',[list,'character']); - } - dialog.setCaption('选择角色'); - game.me.chooseButton(dialog,true).set('onfree',true); - - ui.create.cheat=function(){ - _status.createControl=ui.cheat2; - ui.cheat=ui.create.control('更换',function(){ - if(ui.cheat2&&ui.cheat2.dialog==_status.event.dialog){ - return; - } - if(game.changeCoin){ - game.changeCoin(-3); - } - - event.list.randomSort(); - list=event.list.slice(0,5); - - var buttons=ui.create.div('.buttons'); - var node=_status.event.dialog.buttons[0].parentNode; - _status.event.dialog.buttons=ui.create.buttons(list,'character',buttons); - _status.event.dialog.content.insertBefore(buttons,node); - buttons.animate('start'); - node.remove(); - game.uncheck(); - game.check(); - }); - delete _status.createControl; - }; - if(lib.onfree){ - lib.onfree.push(function(){ - event.dialogxx=ui.create.characterDialog('heightset'); - if(ui.cheat2){ - ui.cheat2.animate('controlpressdownx',500); - ui.cheat2.classList.remove('disabled'); - } - }); - } - else{ - event.dialogxx=ui.create.characterDialog('heightset'); - } - - ui.create.cheat2=function(){ - ui.cheat2=ui.create.control('自由选将',function(){ - if(this.dialog==_status.event.dialog){ - if(game.changeCoin){ - game.changeCoin(50); - } - this.dialog.close(); - _status.event.dialog=this.backup; - this.backup.open(); - delete this.backup; - game.uncheck(); - game.check(); - if(ui.cheat){ - ui.cheat.animate('controlpressdownx',500); - ui.cheat.classList.remove('disabled'); - } - } - else{ - if(game.changeCoin){ - game.changeCoin(-10); - } - this.backup=_status.event.dialog; - _status.event.dialog.close(); - _status.event.dialog=_status.event.parent.dialogxx; - this.dialog=_status.event.dialog; - this.dialog.open(); - game.uncheck(); - game.check(); - if(ui.cheat){ - ui.cheat.classList.add('disabled'); - } - } - }); - if(lib.onfree){ - ui.cheat2.classList.add('disabled'); - } - } - if(!_status.brawl||!_status.brawl.chooseCharacterFixed){ - if(!ui.cheat&&get.config('change_choice')) - ui.create.cheat(); - if(!ui.cheat2&&get.config('free_choose')) - ui.create.cheat2(); - } - "step 1" - if(ui.cheat){ - ui.cheat.close(); - delete ui.cheat; - } - if(ui.cheat2){ - ui.cheat2.close(); - delete ui.cheat2; - } - game.addRecentCharacter(result.buttons[0].link); - game.zhu.init(result.buttons[0].link); - _status.characterlist.remove(result.buttons[0].link); - _status.qianlidanji.used.add(result.buttons[0].link); - game.zhu.chooseControl('地狱','困难','普通','简单','无双').set('prompt','请选择游戏难度'); - "step 2" - var hp=Math.floor(result.index/2); - event.draw=Math.floor((result.index+1)/2); - if(hp){ - game.zhu.hp+=hp; - game.zhu.maxHp+=hp; - game.zhu.update(); - } - game.zhu.chooseButton(['请选择对手的登场武将',[_status.characterlist.randomGets(3),'character']],true); - "step 3" - game.fan.init(result.links[0]); - _status.characterlist.remove(result.links[0]); - _status.qianlidanji.used.add(result.links[0]); - if(event.draw){ - game.zhu.directgain(get.cards(event.draw)); - } - setTimeout(function(){ - ui.arena.classList.remove('choose-character'); - },500); - - var pack={ - character:{ - pujing:['male','qun',1,[],[]], - huban:['male','qun',2,[],[]], - caiyang:['male','qun',1,['zhuixi'],[]], - }, - translate:{ - pujing:'普净', - huban:'胡班', - }, - skill:{ - qianlidanji_phase:{ - trigger:{global:'phaseBefore'}, - forced:true, - silent:true, - firstDo:true, - content:function(){ - player.removeSkill('qianlidanji_phase'); - player.insertPhase(); - }, - }, - }, - }; - for(var i in pack){ - for(var j in pack[i]){ - lib[i][j]=pack[i][j]; - } - } - delete pack.skill; - game.addVideo('arrangeLib',null,pack); - game.addOverDialog=function(dialog){ - dialog.addText('共计通过'+_status.qianlidanji.completeNumber+'关'); - }; - lib.element.player.dieAfter=function(){ - if(this==game.fellow) return; - _status.characterlist.removeArray(_status.qianlidanji.used); - if(game.zhu==this||!_status.characterlist.length){ - var bool=false; - if(_status.qianlidanji.completeNumber>5) bool=true; - game.over(bool); - } - else{ - var next=game.createEvent('qianlidanji_replace',false); - next.setContent(_status.qianlidanji.replace_character); - } - }; - lib.element.player.dieAfter2=function(){ - _status.characterlist.removeArray(_status.qianlidanji.used); - }; - game.zhu.dieAfter=lib.element.player.dieAfter; - game.fan.dieAfter=lib.element.player.dieAfter; - game.zhu.dieAfter2=lib.element.player.dieAfter2; - game.fan.dieAfter2=lib.element.player.dieAfter2; - }); - }; + game.identityVideoName='千里单骑'; + game.saveConfig('player_number',_status.qianlidanji.player_number,'identity'); + game.chooseCharacter=function(){ + var next=game.createEvent('chooseCharacter'); + next.showConfig=true; + next.setContent(function(){ + "step 0" + ui.arena.classList.add('choose-character'); + game.me.identity='zhu'; + game.zhu=game.me; + game.fan=game.me.next; + game.fan.identity='fan'; + game.zhu.setIdentity(); + game.zhu.identityShown=true; + game.zhu.node.identity.classList.remove('guessing'); + game.fan.setIdentity(); + game.fan.identityShown=true; + game.fan.node.identity.classList.remove('guessing'); + + event.list=[]; + for(var i in lib.character){ + if(lib.filter.characterDisabled(i)) continue; + event.list.push(i); + } + event.list.randomSort(); + _status.characterlist=event.list.slice(0); + var list=event.list.slice(0,5); + delete event.swapnochoose; + var dialog; + if(event.swapnodialog){ + dialog=ui.dialog; + event.swapnodialog(dialog,list); + delete event.swapnodialog; + } + else{ + var str='选择角色'; + dialog=ui.create.dialog(str,'hidden',[list,'character']); + } + dialog.setCaption('选择角色'); + game.me.chooseButton(dialog,true).set('onfree',true); + + ui.create.cheat=function(){ + _status.createControl=ui.cheat2; + ui.cheat=ui.create.control('更换',function(){ + if(ui.cheat2&&ui.cheat2.dialog==_status.event.dialog){ + return; + } + if(game.changeCoin){ + game.changeCoin(-3); + } + + event.list.randomSort(); + list=event.list.slice(0,5); + + var buttons=ui.create.div('.buttons'); + var node=_status.event.dialog.buttons[0].parentNode; + _status.event.dialog.buttons=ui.create.buttons(list,'character',buttons); + _status.event.dialog.content.insertBefore(buttons,node); + buttons.animate('start'); + node.remove(); + game.uncheck(); + game.check(); + }); + delete _status.createControl; + }; + if(lib.onfree){ + lib.onfree.push(function(){ + event.dialogxx=ui.create.characterDialog('heightset'); + if(ui.cheat2){ + ui.cheat2.animate('controlpressdownx',500); + ui.cheat2.classList.remove('disabled'); + } + }); + } + else{ + event.dialogxx=ui.create.characterDialog('heightset'); + } + + ui.create.cheat2=function(){ + ui.cheat2=ui.create.control('自由选将',function(){ + if(this.dialog==_status.event.dialog){ + if(game.changeCoin){ + game.changeCoin(50); + } + this.dialog.close(); + _status.event.dialog=this.backup; + this.backup.open(); + delete this.backup; + game.uncheck(); + game.check(); + if(ui.cheat){ + ui.cheat.animate('controlpressdownx',500); + ui.cheat.classList.remove('disabled'); + } + } + else{ + if(game.changeCoin){ + game.changeCoin(-10); + } + this.backup=_status.event.dialog; + _status.event.dialog.close(); + _status.event.dialog=_status.event.parent.dialogxx; + this.dialog=_status.event.dialog; + this.dialog.open(); + game.uncheck(); + game.check(); + if(ui.cheat){ + ui.cheat.classList.add('disabled'); + } + } + }); + if(lib.onfree){ + ui.cheat2.classList.add('disabled'); + } + } + if(!_status.brawl||!_status.brawl.chooseCharacterFixed){ + if(!ui.cheat&&get.config('change_choice')) + ui.create.cheat(); + if(!ui.cheat2&&get.config('free_choose')) + ui.create.cheat2(); + } + "step 1" + if(ui.cheat){ + ui.cheat.close(); + delete ui.cheat; + } + if(ui.cheat2){ + ui.cheat2.close(); + delete ui.cheat2; + } + game.addRecentCharacter(result.buttons[0].link); + game.zhu.init(result.buttons[0].link); + _status.characterlist.remove(result.buttons[0].link); + _status.qianlidanji.used.add(result.buttons[0].link); + game.zhu.chooseControl('地狱','困难','普通','简单','无双').set('prompt','请选择游戏难度'); + "step 2" + var hp=Math.floor(result.index/2); + event.draw=Math.floor((result.index+1)/2); + if(hp){ + game.zhu.hp+=hp; + game.zhu.maxHp+=hp; + game.zhu.update(); + } + game.zhu.chooseButton(['请选择对手的登场武将',[_status.characterlist.randomGets(3),'character']],true); + "step 3" + game.fan.init(result.links[0]); + _status.characterlist.remove(result.links[0]); + _status.qianlidanji.used.add(result.links[0]); + if(event.draw){ + game.zhu.directgain(get.cards(event.draw)); + } + setTimeout(function(){ + ui.arena.classList.remove('choose-character'); + },500); + + var pack={ + character:{ + pujing:['male','qun',1,[],[]], + huban:['male','qun',2,[],[]], + caiyang:['male','qun',1,['zhuixi'],[]], + }, + translate:{ + pujing:'普净', + huban:'胡班', + }, + skill:{ + qianlidanji_phase:{ + trigger:{global:'phaseBefore'}, + forced:true, + silent:true, + firstDo:true, + content:function(){ + player.removeSkill('qianlidanji_phase'); + player.insertPhase(); + }, + }, + }, + }; + for(var i in pack){ + for(var j in pack[i]){ + lib[i][j]=pack[i][j]; + } + } + delete pack.skill; + game.addVideo('arrangeLib',null,pack); + game.addOverDialog=function(dialog){ + dialog.addText('共计通过'+_status.qianlidanji.completeNumber+'关'); + }; + lib.element.player.dieAfter=function(){ + if(this==game.fellow) return; + _status.characterlist.removeArray(_status.qianlidanji.used); + if(game.zhu==this||!_status.characterlist.length){ + var bool=false; + if(_status.qianlidanji.completeNumber>5) bool=true; + game.over(bool); + } + else{ + var next=game.createEvent('qianlidanji_replace',false); + next.setContent(_status.qianlidanji.replace_character); + } + }; + lib.element.player.dieAfter2=function(){ + _status.characterlist.removeArray(_status.qianlidanji.used); + }; + game.zhu.dieAfter=lib.element.player.dieAfter; + game.fan.dieAfter=lib.element.player.dieAfter; + game.zhu.dieAfter2=lib.element.player.dieAfter2; + game.fan.dieAfter2=lib.element.player.dieAfter2; + }); + }; } } }, @@ -3180,292 +3180,292 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ content:{ submode:'two', chooseCharacterBefore:function(){ - var list=[ - { - name:'草船借箭', - place:[true,false,false,true], - character:['re_sp_zhugeliang','yujin_yujin','re_zhangliao','re_lusu'], - lib:{ - character:{ - re_sp_zhugeliang:['male','shu',3,['tiaoxin','bazhen','feiying'],[]], - yujin_yujin:['male','wei',4,['jiangchi','danshou'],[]], - re_zhangliao:['male','wei',4,['benxi','tuifeng','qingxi'],[]], - re_lusu:['male','wu',3,['kaikang','shenxian'],[]], - }, - translate:{ - re_sp_zhugeliang:'诸葛卧龙', - yujin_yujin:'于文则', - re_zhangliao:'张文远', - re_lusu:'鲁子敬', - }, - }, - }, - { - name:'定军山之战', - place:[true,false,false,true], - character:['re_huangzhong','re_xiahouyuan','zhanghe','xin_fazheng'], - lib:{ - character:{ - re_huangzhong:['male','shu',4,['yingjian','weikui','gzyinghun'],[]], - re_xiahouyuan:['male','wei',4,['benxi','yaowu','dujin','juesi'],[]], - zhanghe:['male','wei',4,['kaikang','xingshang','zhiheng'],[]], - xin_fazheng:['male','shu',4,['xinfu_zhanji','nzry_chenglve','yiji'],[]], - }, - translate:{ - re_huangzhong:'定军黄忠', - re_xiahouyuan:'定军妙才', - zhanghe:'定军张郃', - xin_fazheng:'定军法正', - }, - }, - }, - { - name:'官渡追击战', - place:[false,true,true,false], - character:['re_caocao','xin_yuanshao','guotufengji','re_guojia'], - lib:{ - character:{ - re_caocao:['male','wei',4,['fankui','zhuiji','duanbing'],[]], - xin_yuanshao:['male','qun','3/6',['reluanji','kuanggu','benghuai','weizhong'],[]], - guotufengji:['male','qun',2,['sijian','jigong','shifei','jianying'],[]], - re_guojia:['male','wei',3,['yiji','sanyao','gongxin'],[]], - }, - translate:{ - re_caocao:'官渡曹操', - xin_yuanshao:'官渡袁绍', - guotufengji:'袁军智囊', - re_guojia:'官渡郭嘉', - }, - }, - }, - { - name:'奇袭乌巢', - place:[true,false,false,true], - character:['chunyuqiong','sp_xuyou','re_xuhuang','gaolan'], - lib:{ - character:{ - chunyuqiong:['male','qun',8,['ranshang','duliang','jiuchi'],[]], - sp_xuyou:['male','qun',3,['qice','lianying','nzry_jianxiang'],[]], - re_xuhuang:['male','wei',4,['shenduan','xiaoguo','nzry_juzhan'],[]], - gaolan:['male','qun',4,['yuanhu','shensu','benyu','suishi'],[]], - }, - translate:{ - chunyuqiong:'乌巢淳于琼', - sp_xuyou:'乌巢许攸', - re_xuhuang:'乌巢徐晃', - gaolan:'乌巢高览', - }, - }, - }, - { - name:'舌战群儒', - place:[false,true,false,true], - character:['re_zhangzhang','re_sp_zhugeliang','guyong','re_lusu'], - lib:{ - character:{ - re_sp_zhugeliang:['male','shu',3,['tianbian','jyzongshi','xinfu_guolun'],[]], - re_zhangzhang:['male','wu',3,['zhuandui','tiaoxin','guzheng'],[]], - guyong:['male','wu',3,['qiaoshui','qicai','bingyi'],[]], - re_lusu:['male','wu',3,['qingzhongx','shuimeng'],[]], - }, - translate:{ - re_sp_zhugeliang:'诸葛卧龙', - re_zhangzhang:'张子布', - guyong:'顾元叹', - re_lusu:'鲁子敬', - }, - }, - }, - { - name:'武圣战双雄', - place:[true,false,false,true], - character:['yj_jushou','re_caocao','jsp_guanyu','re_yanwen'], - lib:{ - character:{ - yj_jushou:['male','qun',3,['mingce','jianyan','shibei'],[]], - re_caocao:['male','wei',4,['miji','beige','feiying'],[]], - jsp_guanyu:['male','wei',4,['nuzhan','jianchu','new_rewusheng'],[]], - re_yanwen:['male','qun',4,['shuangxiong','zhanyi','zhichi'],[]], - }, - translate:{ - yj_jushou:'白马沮授', - re_caocao:'白马曹操', - jsp_guanyu:'武圣关羽', - re_yanwen:'颜文双雄', - }, - }, - }, - { - name:'合肥之战', - place:[true,false,false,true], - character:['re_lingtong','re_lidian','re_zhangliao','re_ganning'], - lib:{ - character:{ - re_lingtong:['male','wu',4,['xuanfeng','zishou','tiaoxin'],[]], - re_lidian:['male','wei',3,['weijing','wangxi','zhuandui'],[]], - re_zhangliao:['male','wei',3,['retuxi','mashu','reyingzi','xinpojun'],[]], - re_ganning:['male','wu',5,['lizhan','jiang','zhenwei'],[]], - }, - translate:{ - re_lingtong:'合肥凌统', - re_lidian:'合肥李典', - re_zhangliao:'合肥张辽', - re_ganning:'合肥甘宁', - }, - }, - }, - { - name:'荆州之战', - place:[true,false,false,true], - character:['re_guanyu','caoren','re_lvmeng','guanping'], - lib:{ - character:{ - re_guanyu:['male','shu',5,['wusheng','zishou','zhongyong'],[]], - caoren:['male','wei',1,['xinjiewei','qiuyuan','gzbuqu','xinjushou'],[]], - re_lvmeng:['male','wu',4,['gongxin','duodao','dujin','huituo'],[]], - guanping:['male','shu',5,['longyin','suishi'],[]], - }, - translate:{ - re_guanyu:'荆州关羽', - caoren:'樊城曹仁', - re_lvmeng:'江东吕蒙', - guanping:'荆州关平', - }, - }, - }, - { - name:'雒城之战', - place:[true,false,false,true], - character:['liubei','re_wuyi','zhangren','pangtong'], - lib:{ - character:{ - liubei:['male','shu',4,['rezhijian','jijiu','reyingzi'],[]], - re_wuyi:['male','qun',4,['weijing','rerende'],[]], - zhangren:['male','qun',4,['shefu','gnsheque'],[]], - pangtong:['male','shu',3,['dujin'],[]], - }, - translate:{ - liubei:'雒城刘备', - re_wuyi:'雒城吴懿', - zhangren:'雒城张任', - pangtong:'雒城庞统', - rezhijian:'厚恩', - zhijian:'厚恩', - jijiu:'驰援', - reyingzi:'征令', - rerende:'遣军', - }, - }, - }, - ]; - if(_status.keyVerified) list=[ - { - name:'My Song', - place:[false,true,true,false], - character:['caozhen','key_hisako','key_iwasawa','sp_key_kanade'], - lib:{ - character:{ - caozhen:['male','wei',4,['xinsidi','tuxi']], - key_hisako:['female','key','2/3',['hisako_yinbao','shenzhi','shiorimiyuki_banyin','hisako_zhuanyun'],[]], - key_iwasawa:['female','key','-999/3',['iwasawa_yinhang','iwasawa_mysong','hisako_zhuanyun']], - sp_key_kanade:['female','key',3,['xinwuyan','xinbenxi']], - }, - translate:{ - caozhen:'突袭教师', - key_hisako:'绝望恶魔', - key_iwasawa:'引吭孤鸦', - sp_key_kanade:'学生会长', - }, - }, - }, - { - name:'Day Game', - place:[false,true,true,false], - character:['key_yuzuru','sp_key_kanade','key_ayato','key_hinata'], - lib:{ - character:{ - key_yuzuru:['male','key',4,['hinata_qiulve','kurou']], - sp_key_kanade:['female','key',3,['hinata_qiulve','benxi'],[]], - key_ayato:['male','key',3,['hinata_qiulve','retieji']], - key_hinata:['female','key',4,['hinata_qiulve','hinata_ehou']], - }, - translate:{ - key_yuzuru:'新秀球王', - sp_key_kanade:'学生会长', - key_ayato:'副会长', - key_hinata:'球队领袖', - }, - }, - }, - ] - game.liangjunduilei=list; - game.chooseCharacterTwo=function(){ - var next=game.createEvent('chooseCharacter'); - next.setContent(function(){ - 'step 0' - for(var i in lib.skill){ - if(lib.skill[i].audio&&!lib.skill[i].equipSkill) lib.skill[i].audio=false; - if(lib.skill[i].changeSeat){ - lib.skill[i]={}; - if(lib.translate[i+'_info']){ - lib.translate[i+'_info']='此模式下不可用'; - } - } - } - ui.arena.classList.add('choose-character'); - var list=game.liangjunduilei; - var id=lib.status.videoId++; - var choiceList=ui.create.dialog('请选择要游玩的剧情','forcebutton'); - choiceList.videoId=id; - choiceList.add([list.map((item,i)=>{ - return [i,``]; - }),'textbutton']) - game.me.chooseButton(true).set('dialog',id).set('onfree',true); - 'step 1' - var pack=game.liangjunduilei[result.links[0]]; - game.versusVideoName=pack.name; - if(get.is.phoneLayout()){ - ui.duileiInfo=ui.create.div('.touchinfo.left',ui.window); - } - else{ - ui.duileiInfo=ui.create.div(ui.gameinfo); - } - ui.duileiInfo.innerHTML='当前剧情:'+pack.name; - for(var i in pack.lib){ - for(var j in pack.lib[i]){ - lib[i][j]=pack.lib[i][j]; - } - } - var player=game.players.randomGet(); - _status.firstAct=player; - for(var i=0;i<4;i++){ - player.init(pack.character[i]); - player.side=pack.place[i]; - player=player.next; - } - - for(var i=0;i{ + return [i,``]; + }),'textbutton']) + game.me.chooseButton(true).set('dialog',id).set('onfree',true); + 'step 1' + var pack=game.liangjunduilei[result.links[0]]; + game.versusVideoName=pack.name; + if(get.is.phoneLayout()){ + ui.duileiInfo=ui.create.div('.touchinfo.left',ui.window); + } + else{ + ui.duileiInfo=ui.create.div(ui.gameinfo); + } + ui.duileiInfo.innerHTML='当前剧情:'+pack.name; + for(var i in pack.lib){ + for(var j in pack.lib[i]){ + lib[i][j]=pack.lib[i][j]; + } + } + var player=game.players.randomGet(); + _status.firstAct=player; + for(var i=0;i<4;i++){ + player.init(pack.character[i]); + player.side=pack.place[i]; + player=player.next; + } + + for(var i=0;i0; + return lib.skill.toushiche_skill.logTarget(null,player).length>0; }, logTarget:function(event,player){ var hs=player.countCards('h'); diff --git a/mode/guozhan.js b/mode/guozhan.js index 0ac45de59..10e11aa30 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -365,7 +365,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ mode_guozhan:{ guozhan_default:["gz_caocao","gz_simayi","gz_xiahoudun","gz_zhangliao","gz_xuzhu","gz_guojia","gz_zhenji","gz_xiahouyuan","gz_zhanghe","gz_xuhuang","gz_caoren","gz_dianwei","gz_xunyu","gz_caopi","gz_yuejin","gz_liubei","gz_guanyu","gz_zhangfei","gz_zhugeliang","gz_zhaoyun","gz_machao","gz_huangyueying","gz_huangzhong","gz_weiyan","gz_pangtong","gz_sp_zhugeliang","gz_liushan","gz_menghuo","gz_zhurong","gz_ganfuren","gz_sunquan","gz_ganning","gz_lvmeng","gz_huanggai","gz_zhouyu","gz_daqiao","gz_luxun","gz_sunshangxiang","gz_sunjian","gz_xiaoqiao","gz_taishici","gz_zhoutai","gz_re_lusu","gz_zhangzhang","gz_dingfeng","gz_huatuo","gz_lvbu","gz_diaochan","gz_re_yuanshao","gz_yanwen","gz_jiaxu","gz_pangde","gz_zhangjiao","gz_caiwenji","gz_mateng","gz_kongrong","gz_jiling","gz_tianfeng","gz_panfeng","gz_zoushi",], guozhan_zhen:["gz_dengai","gz_caohong","gz_jiangfei","gz_jiangwei","gz_xusheng","gz_jiangqing","gz_hetaihou","gz_yuji"], - guozhan_shi:[,"gz_re_lidian","gz_zangba","gz_madai","gz_mifuren","gz_sunce","gz_chendong","gz_sp_dongzhuo","gz_zhangren"], + guozhan_shi:["gz_re_lidian","gz_zangba","gz_madai","gz_mifuren","gz_sunce","gz_chendong","gz_sp_dongzhuo","gz_zhangren"], guozhan_bian:["gz_liqueguosi","gz_zuoci","gz_bianfuren","gz_xunyou","gz_lingtong","gz_lvfan","gz_masu","gz_shamoke",], guozhan_quan:["gz_cuimao","gz_yujin","gz_wangping","gz_fazheng","gz_wuguotai","gz_lukang","gz_yuanshu","gz_zhangxiu"], guozhan_jun:["gz_jun_caocao","gz_jun_sunquan","gz_jun_liubei","gz_jun_zhangjiao"], @@ -1485,7 +1485,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ group:'gzgongjian_gain', subSkill:{ gain:{ - audio:'gongjian', + audio:'gongjian', trigger:{ global:['loseAfter','loseAsyncAfter'], }, @@ -1911,7 +1911,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ return get.suit(card)=='diamond'&&get.type2(card)!='trick'&&player.canUse(get.autoViewAs({name:'lebu'},[card]),event.target); },'he')||player.hasCard(function(card){ return get.suit(card)=='club'&&get.type2(card)!='trick'&&player.canUse(get.autoViewAs({name:'bingliang'},[card]),event.target,false); - }),'he') return true; + },'he')) return true; return false; }, check:function(event,player){ @@ -2427,8 +2427,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ mark:{ marktext:'祸', intro:{ - content:'mark', - onunmark:true, + content:'mark', + onunmark:true, }, }, }, @@ -2809,25 +2809,25 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(double) groups=double.slice(0); else groups=[lib.character[character][1]]; event.groups=groups; - event.videoId=lib.status.videoId++; - game.broadcastAll(function(player,id,character){ - ui.create.dialog(get.translation(player)+'发动了【博览】',[[character],'character']).videoId=id; - },player,event.videoId,character); - game.delay(3); - 'step 1' - game.broadcastAll('closeDialog',event.videoId); - var list1=['wei','shu','wu','qun','jin'],list2=['gzqice','tiaoxin','gzzhiheng','new_chuli','gzsanchen']; - var skills=[]; - for(var i=0;i0) return 1; return (get.attitude(trigger.source,trigger.player)<0&&get.junlingEffect(player,result.junling,trigger.source,result.targets,trigger.source)>=-2)?1:0; - return 0; }); 'step 2' if(result.index==0) trigger.source.carryOutJunling(player,event.junling,targets); @@ -8800,8 +8799,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ game.log(player,'获得了技能','#g【'+get.translation(result.control)+'】'); game.delay(); }, - forceaudio:true, - audio:['xuanhuo',2], + // forceaudio:true, + // audio:['xuanhuo',2], ai:{ order:8, result:{player:1}, @@ -8809,7 +8808,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, //used:{}, }, - audio:['xuanhuo',2], + // audio:['xuanhuo',2], }, fz_gzpaoxiao:{ audio:true, @@ -10383,8 +10382,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ case '珠联(桃)': return get.copy(lib.skill._zhulianbihe_mark_tao); case '珠联(摸牌)': return { content:function(){ - player.draw(2); - player.removeMark(player.hasMark('zhulianbihe_mark')?'zhulianbihe_mark':'yexinjia_mark',1); + player.draw(2); + player.removeMark(player.hasMark('zhulianbihe_mark')?'zhulianbihe_mark':'yexinjia_mark',1); }, }; case '阴阳鱼': return { @@ -11132,7 +11131,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ backup:function(links,player){ return { filterCard:true, - audio:"qice", + audio:'qice_backup', selectCard:-1, position:'h', selectTarget:function(){ @@ -11154,7 +11153,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } return lib.filter.filterTarget(card,player,target); }, - audio:'qice_backup', popname:true, viewAs:{name:links[0][2]}, ai1:function(){ @@ -11887,7 +11885,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } return false; }) - }; + } if(trigger.name=='lose'){ for(var i of trigger.cards){ if(i.name=='feilongduofeng'&&get.position(i,true)=='d') cards.push(i); @@ -12342,7 +12340,6 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ return player.siege(event.target)&&event.player.siege(event.target); }, forced:true, - audio:'zniaoxiang', forceaudio:true, logTarget:'target', content:function(){ @@ -12661,7 +12658,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ for(var i=0;i