diff --git a/.eslintrc.json b/.eslintrc.json index 88229aedd..19f5d666d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,5 +1,5 @@ { - "extends": "chrome 46", + "extends": "eslint:recommended", "env": { "browser": true, "node": true, @@ -10,6 +10,12 @@ "no-console": 0, "no-unused-vars": 0, "no-undef": 0, - "no-redeclare": 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"], + "complexity": ["error",100] */ } } \ No newline at end of file diff --git a/audio/die/bianfuren.mp3 b/audio/die/bianfuren.mp3 index 997fb0e30..5eee2acc1 100644 Binary files a/audio/die/bianfuren.mp3 and b/audio/die/bianfuren.mp3 differ diff --git a/audio/die/caojie.mp3 b/audio/die/caojie.mp3 index 99627c2e9..7a4286c92 100644 Binary files a/audio/die/caojie.mp3 and b/audio/die/caojie.mp3 differ diff --git a/audio/die/chengjichengcui.mp3 b/audio/die/chengjichengcui.mp3 new file mode 100644 index 000000000..727435bd0 Binary files /dev/null and b/audio/die/chengjichengcui.mp3 differ diff --git a/audio/die/shen_guanyu.mp3 b/audio/die/shen_guanyu.mp3 index 76bbde019..425c3389a 100644 Binary files a/audio/die/shen_guanyu.mp3 and b/audio/die/shen_guanyu.mp3 differ diff --git a/audio/die/wuxian.mp3 b/audio/die/wuxian.mp3 index eea4d68d8..05e80d223 100644 Binary files a/audio/die/wuxian.mp3 and b/audio/die/wuxian.mp3 differ diff --git a/audio/die/xinxianying.mp3 b/audio/die/xinxianying.mp3 index 8d0ec0e6c..ee71b1445 100644 Binary files a/audio/die/xinxianying.mp3 and b/audio/die/xinxianying.mp3 differ diff --git a/audio/die/xushi.mp3 b/audio/die/xushi.mp3 index b12bac49a..0ef56b3ba 100644 Binary files a/audio/die/xushi.mp3 and b/audio/die/xushi.mp3 differ diff --git a/audio/skill/caishi1.mp3 b/audio/skill/caishi1.mp3 index 6de9cada9..7c6f86882 100644 Binary files a/audio/skill/caishi1.mp3 and b/audio/skill/caishi1.mp3 differ diff --git a/audio/skill/caishi2.mp3 b/audio/skill/caishi2.mp3 index 88ede5b2e..e554860b1 100644 Binary files a/audio/skill/caishi2.mp3 and b/audio/skill/caishi2.mp3 differ diff --git a/audio/skill/chanyuan1.mp3 b/audio/skill/chanyuan1.mp3 new file mode 100644 index 000000000..25d8f04a4 Binary files /dev/null and b/audio/skill/chanyuan1.mp3 differ diff --git a/audio/skill/chanyuan2.mp3 b/audio/skill/chanyuan2.mp3 new file mode 100644 index 000000000..8d7eca8e8 Binary files /dev/null and b/audio/skill/chanyuan2.mp3 differ diff --git a/audio/skill/daiyan1.mp3 b/audio/skill/daiyan1.mp3 index aed39345a..75467e969 100644 Binary files a/audio/skill/daiyan1.mp3 and b/audio/skill/daiyan1.mp3 differ diff --git a/audio/skill/daiyan2.mp3 b/audio/skill/daiyan2.mp3 index 28c37d7c7..ae7787495 100644 Binary files a/audio/skill/daiyan2.mp3 and b/audio/skill/daiyan2.mp3 differ diff --git a/audio/skill/fumian1.mp3 b/audio/skill/fumian1.mp3 index 721457e26..d7d67799a 100644 Binary files a/audio/skill/fumian1.mp3 and b/audio/skill/fumian1.mp3 differ diff --git a/audio/skill/fumian2.mp3 b/audio/skill/fumian2.mp3 index 0da38c5e6..35a8066ff 100644 Binary files a/audio/skill/fumian2.mp3 and b/audio/skill/fumian2.mp3 differ diff --git a/audio/skill/fuzhu1.mp3 b/audio/skill/fuzhu1.mp3 index fb7f38f39..367850692 100644 Binary files a/audio/skill/fuzhu1.mp3 and b/audio/skill/fuzhu1.mp3 differ diff --git a/audio/skill/fuzhu2.mp3 b/audio/skill/fuzhu2.mp3 index 819ff0b4d..4d644a724 100644 Binary files a/audio/skill/fuzhu2.mp3 and b/audio/skill/fuzhu2.mp3 differ diff --git a/audio/skill/huimin1.mp3 b/audio/skill/huimin1.mp3 index 23084252b..070377381 100644 Binary files a/audio/skill/huimin1.mp3 and b/audio/skill/huimin1.mp3 differ diff --git a/audio/skill/huimin2.mp3 b/audio/skill/huimin2.mp3 index 62aa30fd0..1a2fb9cfa 100644 Binary files a/audio/skill/huimin2.mp3 and b/audio/skill/huimin2.mp3 differ diff --git a/audio/skill/olchuming1.mp3 b/audio/skill/olchuming1.mp3 new file mode 100644 index 000000000..c0262cf68 Binary files /dev/null and b/audio/skill/olchuming1.mp3 differ diff --git a/audio/skill/olchuming2.mp3 b/audio/skill/olchuming2.mp3 new file mode 100644 index 000000000..f38fba6c8 Binary files /dev/null and b/audio/skill/olchuming2.mp3 differ diff --git a/audio/skill/oltousui1.mp3 b/audio/skill/oltousui1.mp3 new file mode 100644 index 000000000..46af6d9df Binary files /dev/null and b/audio/skill/oltousui1.mp3 differ diff --git a/audio/skill/oltousui2.mp3 b/audio/skill/oltousui2.mp3 new file mode 100644 index 000000000..59b028d21 Binary files /dev/null and b/audio/skill/oltousui2.mp3 differ diff --git a/audio/skill/rechanyuan1.mp3 b/audio/skill/rechanyuan1.mp3 new file mode 100644 index 000000000..e2dffc256 Binary files /dev/null and b/audio/skill/rechanyuan1.mp3 differ diff --git a/audio/skill/rechanyuan2.mp3 b/audio/skill/rechanyuan2.mp3 new file mode 100644 index 000000000..583d8dab2 Binary files /dev/null and b/audio/skill/rechanyuan2.mp3 differ diff --git a/audio/skill/shouxi1.mp3 b/audio/skill/shouxi1.mp3 index 4cd2de960..d45aa9c7d 100644 Binary files a/audio/skill/shouxi1.mp3 and b/audio/skill/shouxi1.mp3 differ diff --git a/audio/skill/shouxi2.mp3 b/audio/skill/shouxi2.mp3 index a50ece551..250e654dc 100644 Binary files a/audio/skill/shouxi2.mp3 and b/audio/skill/shouxi2.mp3 differ diff --git a/audio/skill/wanwei1.mp3 b/audio/skill/wanwei1.mp3 index 7ea052a3b..f7df76dc7 100644 Binary files a/audio/skill/wanwei1.mp3 and b/audio/skill/wanwei1.mp3 differ diff --git a/audio/skill/wanwei2.mp3 b/audio/skill/wanwei2.mp3 index f46acc58b..c9b880837 100644 Binary files a/audio/skill/wanwei2.mp3 and b/audio/skill/wanwei2.mp3 differ diff --git a/audio/skill/wengua1.mp3 b/audio/skill/wengua1.mp3 index 608f8903e..cb5e6b19e 100644 Binary files a/audio/skill/wengua1.mp3 and b/audio/skill/wengua1.mp3 differ diff --git a/audio/skill/wengua2.mp3 b/audio/skill/wengua2.mp3 index b5ed96b73..4cba2ceea 100644 Binary files a/audio/skill/wengua2.mp3 and b/audio/skill/wengua2.mp3 differ diff --git a/audio/skill/wuhun21.mp3 b/audio/skill/wuhun21.mp3 index 0f08a5966..59f308757 100644 Binary files a/audio/skill/wuhun21.mp3 and b/audio/skill/wuhun21.mp3 differ diff --git a/audio/skill/wuhun22.mp3 b/audio/skill/wuhun22.mp3 index fb410dea7..abb84f50a 100644 Binary files a/audio/skill/wuhun22.mp3 and b/audio/skill/wuhun22.mp3 differ diff --git a/audio/skill/yuejian1.mp3 b/audio/skill/yuejian1.mp3 index 715a569a3..a61f37afb 100644 Binary files a/audio/skill/yuejian1.mp3 and b/audio/skill/yuejian1.mp3 differ diff --git a/audio/skill/yuejian2.mp3 b/audio/skill/yuejian2.mp3 index 91a255801..6e437b469 100644 Binary files a/audio/skill/yuejian2.mp3 and b/audio/skill/yuejian2.mp3 differ diff --git a/audio/skill/zhongjian1.mp3 b/audio/skill/zhongjian1.mp3 index 548180225..f2644666d 100644 Binary files a/audio/skill/zhongjian1.mp3 and b/audio/skill/zhongjian1.mp3 differ diff --git a/audio/skill/zhongjian2.mp3 b/audio/skill/zhongjian2.mp3 index c20c93e82..ba1abd585 100644 Binary files a/audio/skill/zhongjian2.mp3 and b/audio/skill/zhongjian2.mp3 differ diff --git a/card/standard.js b/card/standard.js index f83ddd6ca..ad4eb42bd 100644 --- a/card/standard.js +++ b/card/standard.js @@ -1685,10 +1685,22 @@ game.import('card',function(lib,game,ui,get,ai,_status){ useful:1, }, result:{ - target:-1.5, + target:function(player,target){ + if(ui.selected.targets.length){ + const preTarget=ui.selected.targets.lastItem; + const eff=get.effect(target,{name:'sha'},preTarget,player); + return Math.sign(eff)*get.sgnAttitude(player,target); + } + const filter=get.info({name:'jiedao'}).filterAddedTarget; + if(game.hasPlayer(current=>{ + return filter(null,null,current,target)&&get.effect(current,{name:'sha'},target,player)>=0; + })) return -1; + if(target.mayHaveSha(player,'use')) return 0.25; + return -1; + }, player:function(player){ if(player.getCards('he',{subtype:'equip1'}).length) return 0; - return 1.5; + return 1.25; }, }, tag:{ 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/yongjian.js b/card/yongjian.js index f37ec87f7..c01819e63 100644 --- a/card/yongjian.js +++ b/card/yongjian.js @@ -561,13 +561,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){ prompt:'是否发动【赠毒】?', prompt2:'将本次获得的【毒】交给其他角色', ai1:function(card){ - var player = _status.event.player; - if(player.hasSkillTag("usedu")||get.effect(player,{name: "losehp"}, player, player)>0) return 0; + var player=get.player(); + if(['usedu','keepdu'].some(tag=>player.hasSkillTag(tag))||get.effect(player,{name:"losehp"},player,player)>0) return 0; if(!ui.selected.cards.length) return 1; return 0; }, ai2:function(target){ - if (target.hasSkillTag("usedu")) return get.attitude(_status.event.player,target)-0.01; + if(['usedu','keepdu'].some(tag=>target.hasSkillTag(tag))) return get.attitude(_status.event.player,target)-0.01; return -get.attitude(_status.event.player,target)+0.01; }, }); 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..d302fd496 100644 --- a/character/collab.js +++ b/character/collab.js @@ -20,7 +20,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_fuhuanghou:['female','qun',3,['spcangni','spmixin']], sp_fuwan:['male','qun',3,['spfengyin','spchizhong']], old_lingju:['female','qun',3,['jieyuan','fenxin_old']], - sp_mushun:['male','qun',4,['dcmoukui']], + sp_mushun:['male','qun',4,['moukui']], }, characterFilter:{ old_lingju:function(mode){ @@ -359,8 +359,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return card!=card2&&get.number(card2,player){ + return get.is.yayun(get.translation(card.name),get.translation(history[history.length-1].card.name)); + }),'dcshixian_yayun'); } }, + onremove:function(player){ + player.removeSkill('dcshixian_yayun'); + player.removeGaintag('dcshixian_yayun'); + }, + subSkill:{ + yayun:{ + charlotte:true, + trigger:{player:'useCard1'}, + filter:function(event,player){ + return player.countCards('h'); + }, + direct:true, + priority:11+45+14+19+19+810, + content:function(){ + 'step 0' + player.removeGaintag('dcshixian_yayun'); + 'step 1' + player.addGaintag(player.getCards('h',card=>{ + return get.is.yayun(get.translation(card.name),get.translation(trigger.card.name)); + }),'dcshixian_yayun'); + }, + }, + }, }, //龙王 dclonggong:{ @@ -819,11 +825,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(target.isIn()){ var num=target.countCards('e'); if(num>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 +866,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(); } } }, @@ -1281,9 +1287,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ direct:true, content:function(){ 'step 0' - player.chooseDrawRecover('###'+get.prompt('spcangni')+'###摸两张牌或回复1点体力,然后将武将牌翻面',2).set('ai',function(){ - return 'cancel2'; - }).logSkill='spcangni'; + player.chooseDrawRecover('###'+get.prompt('spcangni')+'###摸两张牌或回复1点体力,然后将武将牌翻面',2).logSkill='spcangni'; 'step 1' if(result.control!='cancel2') player.turnOver(); }, @@ -1566,6 +1570,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dclbjiuxian:'酒仙', dclbjiuxian_info:'①你可以将额定目标数大于1的锦囊牌当做【酒】使用。②你使用【酒】无次数限制。', dcshixian:'诗仙', + dcshixian_yayun:'押韵', dcshixian_info:'当你使用一张牌时,若此牌的牌名与你于本局游戏使用的上一张牌的牌名押韵,则你可以摸一张牌,并令此牌额外结算一次。', taoshen:'涛神', dcnutao:'怒涛', 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;iget.subtype(card)=='equip4').length>0; + return current.getCards('e',card=>get.is.attackingMount(card)).length>0; })&&event.filterCard({ name:'sha', storage:{shouli:true}, },player,event)) return true; if(game.hasPlayer(function(current){ - return current.getCards('e',card=>get.subtype(card)=='equip3').length>0; + return current.getCards('e',card=>get.is.defendingMount(card)).length>0; })&&event.filterCard({ name:'shan', storage:{shouli:true}, @@ -1740,8 +1742,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filterTarget:function(card,player,target){ var event=_status.event,evt=event; if(event._backup) evt=event._backup; - var equip3=target.getCards('e',card=>get.subtype(card,false)=='equip3'); - var equip4=target.getCards('e',card=>get.subtype(card,false)=='equip4'); + var equip3=target.getCards('e',card=>get.is.defendingMount(card,false)); + var equip4=target.getCards('e',card=>get.is.attackingMount(card,false)); if(equip3.length&&equip3.some(card=>evt.filterCard(get.autoViewAs({ name:'shan', storage:{shouli:true}, @@ -1756,7 +1758,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return game.hasPlayer(function(current){ return evt.filterTarget(sha,player,current); }) - }; + } }) }, prompt:'将场上的一张坐骑牌当做【杀】或【闪】使用或打出', @@ -1765,8 +1767,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var evt=event.getParent(2); evt.set('shouli',true); var list=[]; - var equip3=target.getCards('e',card=>get.subtype(card,false)=='equip3'); - var equip4=target.getCards('e',card=>get.subtype(card,false)=='equip4'); + var equip3=target.getCards('e',card=>get.is.defendingMount(card,false)); + var equip4=target.getCards('e',card=>get.is.attackingMount(card,false)); var backupx=_status.event; _status.event=evt; try{ @@ -1791,8 +1793,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]; @@ -1806,13 +1808,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }).set('cards',cards) } else player.choosePlayerCard(true,target,'e').set('filterButton',function(button){ - var type=get.subtype(button.link); - return type=='equip3'||type=='equip4'; + var card=button.link; + return get.is.attackingMount(card)||get.is.defendingMount(card); }); 'step 1' var evt=event.getParent(2); if(result.bool&&result.links&&result.links.length){ - var name=(event.cardName||(get.subtype(result.links[0])=='equip4'?'sha':'shan')); + var name=(event.cardName||(get.is.attackingMount(result.links[0])?'sha':'shan')); if(evt.name=='chooseToUse'){ game.broadcastAll(function(result,name){ lib.skill.shouli_backup.viewAs={ @@ -1854,9 +1856,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ respondSha:true, respondShan:true, skillTagFilter:function(player,tag){ - var subtype=(tag=='respondSha'?'equip4':'equip3'); + var func=get.is[tag=='respondSha'?'attackingMount':'defendingMount']; return game.hasPlayer(function(current){ - return current.hasCard(card=>get.subtype(card,false)==subtype,'e'); + return current.hasCard(card=>func(card,false),'e'); }); }, order:2, @@ -4400,14 +4402,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var list=[]; for(var i in player.disabledSkills){ if(player.disabledSkills[i].contains(skill)) list.push(i); - }; + } if(list.length){ var str='失效技能:'; for(var i=0;iget.name(card)!=='tao','h'); }, - threaten:1.5 }, }, jilue_jizhi:{ @@ -5260,9 +5261,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ return (get.type(event.card,'trick')=='trick'&&event.card.isCard&&player.hasMark('renjie')); }, - init:function(player){ - player.storage.jilue_jizhi=0; - }, content:function(){ 'step 0' player.removeMark('renjie',1); @@ -5277,33 +5275,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 2' if(result.bool){ player.discard(event.card); - player.storage.jilue_jizhi++; - if(_status.currentPhase==player){ - player.markSkill('jilue_jizhi'); - } + player.addTempSkill('jilue_jizhi_clear'); + player.addMark('jilue_jizhi_clear',1,false); } }, - ai:{ - threaten:1.4 - }, - mod:{ - maxHandcard:function(player,num){ - return num+player.storage.jilue_jizhi; - } - }, - intro:{ - content:'本回合手牌上限+#', - }, subSkill:{ clear:{ - trigger:{global:'phaseAfter'}, - silent:true, - content:function(){ - player.storage.jilue_jizhi=0; - player.unmarkSkill('jilue_jizhi'); - } - } - } + charlotte:true, + onremove:true, + mod:{ + maxHandcard:function(player,num){ + return num+player.countMark('jilue_jizhi_clear'); + }, + }, + intro:{content:'手牌上限+#'}, + }, + }, }, wushen:{ mod:{ @@ -5380,7 +5367,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, wuhun2:{ trigger:{ - player:'dieBegin', + player:'dieBegin', }, forced:true, popup:false, @@ -5405,8 +5392,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return -ai.get.attitude(_status.event.player,target); }); "step 1" - player.line(result.targets[0],'fire'); - result.targets[0].addSkill('wuhun3') + player.line(result.targets[0],'fire'); + result.targets[0].addSkill('wuhun3') }, ai:{ threaten:0.5, @@ -5965,7 +5952,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(player.countCards('he',{suit:'heart'})7){ player.chooseBool().set('ai',function(){ @@ -6671,7 +6658,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 +6666,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/mobile.js b/character/mobile.js index 175af643b..eca5db6c5 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -31,8 +31,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ xin_wuban:['male','shu',4,['xinjintao'],['clan:陈留吴氏','character:wuban']], baoxin:['male','qun',4,['mutao','yimou'],['character:tw_baoxin','die_audio:tw_baoxin']], jiangji:['male','wei',3,['twjichou','jilun'],['character:tw_jiangji','die_audio:tw_jiangji']], - liwei:['male','shu',4,['jiaohua'],['character:tw_liwei','die:tw_liwei']], - laimin:['male','shu',3,['laishou','luanqun'],['unseen']], + liwei:['male','shu',4,['jiaohua'],['die_audio:tw_liwei']], + laimin:['male','shu',3,['laishou','luanqun']], yj_zhoubuyi:['male','wei',3,['mbhuiyao','mbquesong']], xin_guozhao:['female','wei',3,['yichong','wufei']], xin_zhangyi:['male','shu',4,['xinwurong','shizhi']], @@ -4739,7 +4739,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ xingtu:{ trigger:{player:'useCard'}, filter:function(event,player){ - var num1=get.number(event.card),num2=player.storage.xingtu; + var evt=lib.skill.dcjianying.getLastUsed(player,event); + if(!evt||!evt.card) return false; + var num1=get.number(event.card),num2=get.number(evt.card); return typeof num1=='number'&&typeof num2=='number'&&num2%num1==0; }, forced:true, @@ -4748,29 +4750,73 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, mod:{ cardUsable:function(card,player){ - var num1=get.number(card),num2=player.storage.xingtu; - if(typeof num1=='number'&&typeof num2=='number'&&num1%num2==0) return Infinity; + if(typeof card=='object'){ + var evt=lib.skill.dcjianying.getLastUsed(player); + if(!evt||!evt.card) return; + var num1=get.number(card),num2=get.number(evt.card); + if(typeof num1=='number'&&typeof num2=='number'&&num1%num2==0) return Infinity; + } }, aiOrder:function(player,card,num){ - var num1=get.number(card),num2=player.storage.xingtu; - if(typeof num1=='number'&&typeof num2=='number'&&num2%num1==0) return num+5; + if(typeof card=='object'){ + var evt=lib.skill.dcjianying.getLastUsed(player); + if(!evt||!evt.card) return; + var num1=get.number(card),num2=num2=get.number(evt.card); + if(typeof num1=='number'&&typeof num2=='number'&&num2%num1==0) return num+5; + } }, }, - group:'xingtu_record', - intro:{ - content:'当前记录:X=#', + init:function(player){ + player.addSkill('xingtu_mark'); + var history=player.getAllHistory('useCard'); + if(history.length){ + var trigger=history[history.length-1],num=get.number(trigger.card); + player.storage.xingtu_mark=num; + player[typeof num!='number'?'unmarkSkill':'markSkill']('xingtu_mark'); + } + }, + onremove:function(player){ + player.removeSkill('xingtu_mark'); + player.removeGaintag('xingtu1'); + player.removeGaintag('xingtu2'); + delete player.storage.xingtu_mark; }, subSkill:{ - record:{ - trigger:{player:'useCardAfter'}, - forced:true, - filter:function(event,player){ - return typeof get.number(event.card)=='number'; + mark:{ + charlotte:true, + trigger:{ + player:['useCard1','gainAfter'], + global:'loseAsyncAfter', }, + filter:function(event,player,name){ + if(!player.countCards('h')) return false; + return name=='useCard1'||event.getg(player).length; + }, + direct:true, + firstDo:true, content:function(){ - player.storage.xingtu=get.number(trigger.card); - player.markSkill('xingtu'); + 'step 0' + player.removeGaintag('xingtu1'); + player.removeGaintag('xingtu2'); + if(event.triggername=='useCard1'){ + var num=get.number(trigger.card,player); + player.storage.xingtu_mark=num; + player[typeof num!='number'?'unmarkSkill':'markSkill']('xingtu_mark'); + if(typeof num!='number') event.finish(); + } + 'step 1' + var cards1=[],cards2=[],num=player.storage.xingtu_mark; + player.getCards('h').forEach(card=>{ + var numx=get.number(card,player); + if(typeof numx=='number'){ + if(numx%num==0) cards1.push(card); + if(num%numx==0) cards2.push(card); + } + }); + player.addGaintag(cards1,'xingtu1'); + player.addGaintag(cards2,'xingtu2'); }, + intro:{content:'上一张牌的点数:#'}, }, }, }, @@ -4784,7 +4830,33 @@ game.import('character',function(lib,game,ui,get,ai,_status){ selectCard:[2,Infinity], check:function(card){ if(ui.selected.cards.length>1) return 0; - return 4-get.value(card); + var player=_status.event.player; + if(player.hasSkill('xingtu')&&player.storage.xingtu){ + var cards=player.getCards('he'); + var num=player.storage.xingtu,stop=false; + for(var i=0;i<=cards.length;i++){ + if(i!=cards.length){ + var num1=get.number(cards[i],player); + if(typeof num1!='number') continue; + for(var j=0;jget.subtype(card,false)=='equip3'); - var equip4=target.getCards('e',card=>get.subtype(card,false)=='equip4'); + var equip3=target.getCards('e',card=>get.is.defendingMount(card,false)); + var equip4=target.getCards('e',card=>get.is.attackingMount(card,false)); if(equip3.length&&equip3.some(card=>evt.filterCard(get.autoViewAs({ name:'shan', storage:{psshouli:true}, @@ -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:'将场上的一张坐骑牌当做【杀】或【闪】使用或打出', @@ -639,8 +639,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var evt=event.getParent(2); evt.set('psshouli',true); var list=[]; - var equip3=target.getCards('e',card=>get.subtype(card,false)=='equip3'); - var equip4=target.getCards('e',card=>get.subtype(card,false)=='equip4'); + var equip3=target.getCards('e',card=>get.is.defendingMount(card,false)); + var equip4=target.getCards('e',card=>get.is.attackingMount(card,false)); var backupx=_status.event; _status.event=evt; try{ @@ -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]; @@ -680,13 +680,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }).set('cards',cards) } else player.choosePlayerCard(true,target,'e').set('filterButton',function(button){ - var type=get.subtype(button.link); - return type=='equip3'||type=='equip4'; + var card=button.link; + return get.is.attackingMount(card)||get.is.defendingMount(card); }); 'step 1' var evt=event.getParent(2); if(result.bool&&result.links&&result.links.length){ - var name=(event.cardName||(get.subtype(result.links[0])=='equip4'?'sha':'shan')); + var name=(event.cardName||(get.is.attackingMount(result.links[0])?'sha':'shan')); if(evt.name=='chooseToUse'){ game.broadcastAll(function(result,name){ lib.skill.psshouli_backup.viewAs={ @@ -728,9 +728,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ respondSha:true, respondShan:true, skillTagFilter:function(player,tag){ - var subtype=(tag=='respondSha'?'equip4':'equip3'); + var func=get.is[tag=='respondSha'?'attackingMount':'defendingMount']; return game.hasPlayer(function(current){ - return current.getEquip(subtype); + return current.hasCard(card=>func(card,false),'e'); }); }, order:2, @@ -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:{ @@ -4836,7 +4836,26 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(){ 'step 0' - player.chooseButton([get.prompt('sphantong'),player.storage.sphantong],function(button){return -1}); + player.chooseButton([get.prompt('sphantong'),player.storage.sphantong],function(button){ + var player=_status.event.player; + if(_status.currentPhase==player){ + //血裔 + if((player.hasJudge('lebu')||player.skipList.includes('phaseUse'))&&game.hasPlayer(function(current){ + return current!=player&¤t.group=='qun'; + })) return 1; + //激将 + if(!player.hasJudge('lebu')&&!player.skipList.includes('phaseUse')&&game.hasPlayer(function(current){ + return current!=player&¤t.group=='shu'&¤t.hasSha()&&get.attitude(player,current)>0&&get.attitude(current,player)>0; + })&&game.hasPlayer(function(target){ + return player.canUse({name:'sha'},target)&&get.effect(target,{name:'sha'},player,player)>0; + })) return 1; + } + //护驾 + else if(!player.hasShan()&&game.hasPlayer(function(current){ + return current!=player&¤t.group=='wei'&¤t.mayHaveShan()&&get.attitude(player,current)>0&&get.attitude(current,player)>0; + })) return 1; + return -1; + }); 'step 1' if(result.bool){ player.logSkill('sphantong'); @@ -4848,31 +4867,41 @@ game.import('character',function(lib,game,ui,get,ai,_status){ game.cardsDiscard(card); var list=['hujia','jijiang','jiuyuan','xueyi']; for(var i=0;i0&&get.attitude(current,player)>0; + })&&game.hasPlayer(function(target){ + return player.canUse({name:'sha'},target)&&get.effect(target,{name:'sha'},player,player)>0; + })) return 'jijiang'; + } + //护驾 + else if(!player.hasShan()&&game.hasPlayer(function(current){ + return current!=player&¤t.group=='wei'&¤t.mayHaveShan()&&get.attitude(player,current)>0&&get.attitude(current,player)>0; + })) return 'hujia'; + }); } - if(list.length>0) player.chooseControl(list).set('prompt','选择获得以下技能中的一个'); else event.finish(); } else event.finish(); 'step 2' var skill=result.control; player.addTempSkill(skill); - if(!player.storage.zhuSkill_sphantong) player.storage.zhuSkill_sphantong=[]; - player.storage.zhuSkill_sphantong.add(skill); player.popup(skill,'wood'); game.log(player,'获得了技能','#g【'+get.translation(skill)+'】'); - var next=game.createEvent('sphantong_clear',false); - event.next.remove(next); - trigger.after.push(next); - next.player=player; - next.skill=skill; - next.setContent(function(){ - if(player.storage.zhuSkill_sphantong) player.storage.zhuSkill_sphantong.remove(event.skill); - }) }, }, sphuangen:{ - trigger:{global:'useCardToPlayered'}, + trigger:{global:'useCardToPlayered'}, filter:function(event,player){ if(!event.isFirstTarget) return false; if(get.type(event.card)!='trick') return false; @@ -5436,7 +5465,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, enable:'phaseUse', filterCard:{suit:'diamond'}, - filterTarget:true, + filterTarget:function(card,player,target){ + return target.canAddJudge({name:'yanxiao_card'}); + }, check:function(card){ return 7-get.value(card); }, diff --git a/character/old.js b/character/old.js index c03f2c07a..0e86e2529 100755 --- a/character/old.js +++ b/character/old.js @@ -520,7 +520,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, old_guhuo:{ audio:2, - group:['old_guhuo_guess'], enable:['chooseToUse','chooseToRespond'], hiddenCard:function(player,name){ return (lib.inpile.contains(name)&&player.countCards('hs')>0); @@ -636,6 +635,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, precontent:function(){ player.logSkill('old_guhuo'); + player.addTempSkill('old_guhuo_guess'); var card=event.result.cards[0]; event.result.card.suit=get.suit(card); event.result.card.number=get.number(card); diff --git a/character/rank.js b/character/rank.js index 565661e96..9f2ac180d 100644 --- a/character/rank.js +++ b/character/rank.js @@ -342,6 +342,8 @@ window.noname_character_rank={ 'key_kyou', 'key_tomoyo', 'star_yuanshu', + 'jiangji', + 'tianshangyi', ], am:[ 'diy_caiwenji', @@ -621,6 +623,11 @@ window.noname_character_rank={ 'jsrg_xiahourong', 'jsrg_sunshangxiang', 'jsrg_machao', + 'sunyu', + 're_caorui', + 're_zhugedan', + 'tw_yanxiang', + 'yanxiang', ], bp:[ 'chess_diaochan', @@ -981,6 +988,11 @@ window.noname_character_rank={ 'jsrg_zhangchu', 'ol_dingshangwan', 'ol_liwan', + 'chengjichengcui', + 'xin_zhangliang', + 'liwei', + 'xin_wuban', + 'ol_liuyan', ], b:[ 'diy_feishi', @@ -1288,6 +1300,10 @@ window.noname_character_rank={ 'feiyao', 'jsrg_xiahouen', 'old_shen_zhaoyun', + 'sb_qiaoxiao', + 're_simalang', + 'laimin', + 'baoxin', ], bm:[ 'diy_xizhenxihong', @@ -1480,6 +1496,7 @@ window.noname_character_rank={ 'huanfan', 'jsrg_xugong', 'old_xiaoqiao', + 'old_guanyu', ], c:[ 'xiahoudun', @@ -1543,6 +1560,7 @@ window.noname_character_rank={ 'ol_huban', 'sb_menghuo', 'old_caocao', + 'sb_yl_luzhi', ], d:[ 'lvmeng', diff --git a/character/refresh.js b/character/refresh.js index 2998b3e37..e557e099f 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -23,10 +23,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ re_xushu:['male','shu',4,['zhuhai','qianxin']], re_lidian:['male','wei',3,['xunxun','xinwangxi']], re_zhongyao:['male','wei',3,['rehuomo','zuoding'],['clan:颍川钟氏']], - xin_zhangliang:['male','qun',4,['rejijun','refangtong'],['unseen']], - re_simalang:['male','wei',3,['requji','rejunbing'],['unseen']], - re_zhugedan:['male','wei',4,['regongao','rejuyi'],['unseen']], - re_caorui:['male','wei',3,['huituo','mingjian','rexingshuai'],['unseen','zhu']], + xin_zhangliang:['male','qun',4,['rejijun','refangtong']], + re_simalang:['male','wei',3,['requji','rejunbing']], + re_zhugedan:['male','wei',4,['regongao','rejuyi']], + re_caorui:['male','wei',3,['huituo','mingjian','rexingshuai'],['zhu']], re_caochong:['male','wei',3,['rechengxiang','renxin']], ol_zhangzhang:['male','wu',3,['olzhijian','olguzheng']], re_jsp_huangyueying:['female','qun',3,['rejiqiao','relinglong']], @@ -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); @@ -3851,6 +3850,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.loseMaxHp(); player.addSkill('rejianyan'); }, + derivation:'rejianyan', }, rejianyan:{ audio:2, @@ -4416,6 +4416,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(player.countMark('redanxin')<2) player.addMark('redanxin',1,false); }, intro:{content:'当前升级等级。:Lv#'}, + ai:{ + maixie:true, + effect:{ + target:(card,player,target)=>{ + if(!get.tag(card,'damage')) return; + if(target.hp<2&&target.countCards('hs')<3||player.hasSkillTag('jueqing',false,target)) return -2; + if(target.countMark('redanxin')>1) return [1,1]; + return [1,Math.min(3.2,0.8*target.hp)]; + } + } + } }, //马岱 reqianxi:{ @@ -4501,7 +4512,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 +6429,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, enable:'phaseUse', usable:1, - position:'hs', viewAs:{ name:'sha', changbiao:true, @@ -7373,7 +7383,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 +7665,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; @@ -9468,7 +9478,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player:function(player){ if(player.hp<3) return false; var mindist=player.hp; - if(player.countCards('hs',card=>player.canSave(card,player))) mindist++; + if(player.countCards('hs',card=>player.canSaveCard(card,player))) mindist++; if(game.hasPlayer(function(current){ return (get.distance(player,current)<=mindist&& player.canUse('sha',current,false)&& @@ -10743,6 +10753,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, precontent:function(){ player.logSkill('reguhuo'); + player.addTempSkill('reguhuo_guess'); var card=event.result.cards[0]; event.result.card.suit=get.suit(card); event.result.card.number=get.number(card); @@ -10766,7 +10777,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, threaten:1.3, }, - group:['reguhuo_shan','reguhuo_wuxie','reguhuo_guess'], + group:['reguhuo_shan','reguhuo_wuxie'], }, reguhuo_shan:{ enable:['chooseToUse','chooseToRespond'], @@ -10803,6 +10814,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, precontent:function(){ player.logSkill('reguhuo'); + player.addTempSkill('reguhuo_guess'); var card=event.result.cards[0]; event.result.card.suit=get.suit(card); event.result.card.number=get.number(card); @@ -10843,6 +10855,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, precontent:function(){ player.logSkill('reguhuo'); + player.addTempSkill('reguhuo_guess'); var card=event.result.cards[0]; event.result.card.suit=get.suit(card); event.result.card.number=get.number(card); @@ -10970,7 +10983,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 1' if(!result.bool) target.loseHp(); 'step 2' - target.addSkill('rechanyuan'); + target.addSkillLog('rechanyuan'); if(targets.length) event.goto(0); }, }, @@ -10978,13 +10991,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ reguhuo_phase:{}, rechanyuan:{ init:function(player,skill){ + if(player.hp<=1){ + player.logSkill(skill); + player.addSkill('rechanyuan_log'); + } player.addSkillBlocker(skill); }, onremove:function(player,skill){ + player.removeSkill('rechanyuan_log'); player.removeSkillBlocker(skill); }, - charlotte:true, - locked:true, skillBlocker:function(skill,player){ return skill!='chanyuan'&&skill!='rechanyuan'&&!lib.skill[skill].charlotte&&player.hp<=1; }, @@ -10997,8 +11013,25 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); if(list.length) str+=('
  • 失效技能:'+get.translation(list)) return str; + }, + }, + audio:2, + trigger:{player:'changeHp'}, + filter:function(event,player){ + return (player.hp<=1)!=(player.hasSkill('rechanyuan_log')); + }, + direct:true, + locked:true, + content:function(){ + if(player.hp<=1){ + player.logSkill('rechanyuan'); + player.addSkill('rechanyuan_log'); } - } + else player.removeSkill('rechanyuan_log'); + }, + subSkill:{ + log:{charlotte:true}, + }, }, botu:{ audio:2, @@ -11158,7 +11191,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 +11554,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 +12066,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..58cecb125 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 +2123,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 +2235,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 +2253,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 +3699,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 +3732,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } } }, - locked:false, ai:{ effect:{ target:function(card,player,target,current){ @@ -6233,7 +6233,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 +7080,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}; @@ -7458,7 +7458,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ xinfu_guhuo:{ audio:'guhuo_guess', derivation:['chanyuan'], - group:['guhuo_guess'], enable:['chooseToUse','chooseToRespond'], hiddenCard:function(player,name){ return (lib.inpile.contains(name)&&player.countCards('hs')>0&&!player.hasSkill('guhuo_phase')); @@ -7554,6 +7553,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, precontent:function(){ player.logSkill('xinfu_guhuo'); + player.addTempSkill('guhuo_guess'); var card=event.result.cards[0]; event.result.card.suit=get.suit(card); event.result.card.number=get.number(card); @@ -7709,22 +7709,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, chanyuan:{ init:function(player,skill){ + if(player.hp==1) player.logSkill(skill); player.addSkillBlocker(skill); }, onremove:function(player,skill){ player.removeSkillBlocker(skill); }, - charlotte:true, - locked:true, skillBlocker:function(skill,player){ return skill!='chanyuan'&&skill!='rechanyuan'&&!lib.skill[skill].charlotte&&player.hp==1; }, - audio:2, - trigger:{player:'changeHp'}, - filter:function(event,player){ - return event.num<0&&player.hp==1; - }, - content:function(){}, mark:true, intro:{ content:function(storage,player,skill){ @@ -7734,8 +7727,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); if(list.length) str+=('
  • 失效技能:'+get.translation(list)) return str; - } - } + }, + }, + audio:2, + trigger:{player:'changeHp'}, + filter:function(event,player){ + return player.hp==1; + }, + forced:true, + content:function(){}, }, guhuo_phase:{}, }, @@ -7765,7 +7765,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ huangzhong:['re_huangzhong','ol_huangzhong','sb_huangzhong','huangzhong','jsrg_huangzhong'], weiyan:['re_weiyan','ol_weiyan','weiyan'], zhoutai:['zhoutai','xin_zhoutai','old_zhoutai'], - xiaoqiao:['xiaoqiao','ol_xiaoqiao','re_xiaoqiao','old_xiaoqiao'], + xiaoqiao:['xiaoqiao','ol_xiaoqiao','re_xiaoqiao','sb_xiaoqiao','old_xiaoqiao'], yuji:['xin_yuji','re_yuji','yuji'], zhangjiao:['sp_zhangjiao','re_zhangjiao','sb_zhangjiao','zhangjiao'], dianwei:['dianwei','ol_dianwei','re_dianwei'], @@ -7798,7 +7798,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ zhugezhan:['zhugezhan','old_zhugezhan'], ol_lusu:['re_lusu','ol_lusu'], zhanghe:['zhanghe','re_zhanghe','sb_zhanghe'], - yl_luzhi:['yl_luzhi','tw_yl_luzhi'], + yl_luzhi:['yl_luzhi','sb_yl_luzhi','tw_yl_luzhi'], sunliang:['sunliang','xin_sunliang'], }, translate:{ @@ -7874,6 +7874,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ drlt_wanglie:"往烈", drlt_wanglie_info:"①出牌阶段,你使用的第一张牌无距离限制。②当你于出牌阶段内使用牌时,你可以令此牌不能被响应,然后你于本阶段内不能再使用牌。", "drlt_xiongluan":"雄乱", + drlt_xiongluan1:'雄乱', "drlt_xiongluan_info":"限定技,出牌阶段,你可以废除你的判定区和装备区,然后指定一名其他角色。直到回合结束,你对其使用牌无距离和次数限制,其不能使用和打出手牌。", "drlt_congjian":"从谏", "drlt_congjian_info":"当你成为锦囊牌的目标时,若此牌的目标数大于1,则你可以交给其中一名其他目标角色一张牌,然后摸一张牌,若你给出的是装备牌,改为摸两张牌。", diff --git a/character/shiji.js b/character/shiji.js index 5c17188f5..f00dad3d3 100644 --- a/character/shiji.js +++ b/character/shiji.js @@ -435,6 +435,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ else{ evt.finish(); evt._triggered=null; + if(evt.name.startsWith('pre_')){ + var evtx=evt.getParent(); + evtx.finish(); + evtx._triggered=null; + } var nexts=trigger.next.slice(); for(var next of nexts){ if(next.name=='judgeCallback') trigger.next.remove(next); @@ -2053,7 +2058,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 +4865,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 +4965,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 +6291,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..897ef3c91 100755 --- a/character/sp.js +++ b/character/sp.js @@ -49,7 +49,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ haopu:['male','shu',4,['olzhenying']], ol_mengda:['male','shu',4,['olgoude']], ol_wanglang:['male','wei',3,['gushe','oljici']], - ol_liuyan:['male','qun','4/6',['olpianan','olyinji','olkuisi'],['unseen']], + ol_liuyan:['male','qun','4/6',['olpianan','olyinji','olkuisi']], lushi:['female','qun',3,['olzhuyan','olleijie']], zhangshiping:['male','shu',3,['olhongji','olxinggu']], sunhong:['male','wu',3,['olxianbi','olzenrun']], @@ -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' @@ -5690,7 +5687,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var cards1=list[0][1].slice(),cards2=list[1][1].slice(); var card1=cards1.sort((a,b)=>get.value(b)-get.value(a))[0]; var card2=cards2.sort((a,b)=>get.value(a)-get.value(b))[0]; - if(get.value(card1)>get.value(card2)){ + if(card1&&card2&&get.value(card1)>get.value(card2)){ cards1.remove(card1); cards2.remove(card2); cards1.push(card2); @@ -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; @@ -19632,6 +19625,41 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addSkill('mashu'); player.addSkill('nuzhan'); player.awakenSkill('danji'); + }, + ai:{ + maixie:true, + skillTagFilter:(player,tag,arg)=>{ + if(tag==='maixie'){ + if(player.hp<2||player.storage.danji||player.hasSkill('nuzhan')||player.countCards('h')!==player.hp) return false; + let zhu=get.zhu(player); + if(zhu&&zhu.isZhu){ + let name=zhu.name; + while(name.indexOf('_')!==-1){ + name=name.slice(name.indexOf('_')+1); + } + if(name.indexOf('liubei')==0) return false; + } + return true; + } + }, + effect:{ + target:(card,player,target)=>{ + let hs=target.countCards('h'); + if(target.hp<3||target.storage.danji||target.hasSkill('nuzhan')||hs>target.hp+1) return; + let zhu=get.zhu(target); + if(zhu&&zhu.isZhu){ + let name=zhu.name; + while(name.indexOf('_')!==-1){ + name=name.slice(name.indexOf('_')+1); + } + if(name.indexOf('liubei')==0) return; + } + if(get.tag(card,'draw')) return 1.6; + if(get.tag(card,'lose')||get.tag(card,'discard')) return [1,-0.8]; + if(hs===target.hp&&get.tag(card,'damage')) return [1,target.hp/3]; + if(hs>target.hp&&target.hp>3&&(card.name==='shan'||card.name==='wuxie')) return 'zeroplayertarget'; + } + } } }, nuzhan:{ @@ -20721,7 +20749,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()); @@ -21856,12 +21884,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, moukui:{ + audio:2, + audioname:['sp_mushun'], trigger:{player:'useCardToPlayered'}, direct:true, filter:function(event,player){ return event.card.name=='sha'; }, - audio:2, content:function(){ "step 0" var controls=['draw_card']; @@ -22600,9 +22629,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 +22650,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "step 4" target.give(result.cards,player); }, - audio:2, }, xiongyi:{ skillAnimation:true, @@ -24255,7 +24283,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, xionghuo:{ marktext:"戾", - mark:true, intro:{ name:'暴戾', content:"mark", @@ -25226,7 +25253,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ jin_simazhao:['jin_simazhao','simazhao','sp_simazhao'], jin_wangyuanji:['jin_wangyuanji','wangyuanji','sp_wangyuanji'], wangyun:['wangyun','dc_wangyun','re_wangyun','jsrg_wangyun','old_wangyun','pe_wangyun'], - zhangliang:['re_zhangliang','zhangliang'], + zhangliang:['xin_zhangliang','re_zhangliang','zhangliang'], lingju:['lingju','old_lingju'], guansuo:['guansuo','dc_guansuo'], zhangxingcai:['zhangxingcai','old_zhangxingcai'], @@ -25268,6 +25295,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ol_pengyang:['ol_pengyang','sp_pengyang'], ol_luyusheng:['ol_luyusheng','luyusheng'], fanjiangzhangda:['fanjiangzhangda','jsrg_fanjiangzhangda'], + simalang:['re_simalang','simalang'], + zhugedan:['re_zhugedan','zhugedan'], }, translate:{ "xinfu_lingren":"凌人", diff --git a/character/sp2.js b/character/sp2.js index facb1f613..59fa9b602 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -6,12 +6,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ character:{ star_yuanshu:['male','qun',4,['starcanxi','starpizhi','starzhonggu'],['zhu']], star_caoren:['male','wei',4,['starsujun','starlifeng']], + mp_liuling:['male','jin',3,['mpjiusong','mpmaotao','mpbishi'],['doublegroup:wei:qun:jin']], dc_jikang:['male','wei',3,['new_qingxian','dcjuexiang']], dc_jsp_guanyu:['male','wei',4,['new_rewusheng','dcdanji']], dc_mengda:['male','wei',4,['dclibang','dcwujie']], //dc_fuwan:['male','qun',4,['dcmoukui']], guānning:['male','shu',3,['dcxiuwen','dclongsong']], - sunhuan:['male','wu',4,['dcniji'],['unseen']], + sunhuan:['male','wu',4,['dcniji']], sunlang:['male','shu',4,['dctingxian','dcbenshi']], shiyi:['male','wu',3,['dccuichuan','dczhengxu']], dc_hujinding:['female','shu','3/6',['dcdeshi','dcwuyuan','huaizi']], @@ -56,7 +57,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dongxie:['female','qun',4,['dcjiaoxia','dchumei']], wangrong:['female','qun',3,['minsi','jijing','zhuide']], ol_dingyuan:['male','qun',4,['cixiao','xianshuai']], - xin_baosanniang:['female','shu',3,['decadewuniang','decadexushen']], re_hejin:['male','qun',4,['spmouzhu','spyanhuo']], re_hansui:['male','qun',4,['spniluan','spweiwu']], liuhong:['male','qun',4,['yujue','tuxing']], @@ -110,7 +110,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_zhongyuan:['re_hucheer','re_zoushi','caoanmin','re_dongcheng'], sp_xiaohu:['haomeng','yanfuren','yanrou','dc_zhuling'], sp_star:['star_caoren','star_yuanshu'], - sp_decade:['caobuxing','re_maliang','xin_baosanniang','dc_jikang'], + mini_qixian:['mp_liuling'], + sp_decade:['caobuxing','re_maliang','dc_jikang'], } }, skill:{ @@ -420,6 +421,94 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, }, + //小程序刘伶 + mpjiusong:{ + audio:2, + trigger:{global:'useCard'}, + filter:function(event,player){ + return event.card.name=='jiu'&&player.countMark('mpjiusong')<3; + }, + forced:true, + locked:false, + content:function(){ + player.addMark('mpjiusong'); + }, + marktext:'醉', + intro:{ + name:'醉(酒颂/酕醄)', + name2:'醉', + content:'mark', + } + }, + mpmaotao:{ + audio:2, + trigger:{global:'useCardToPlayer'}, + filter:function(event,player){ + if(event.targets.length!=1||!event.isFirstTarget) return false; + return event.player!=player&&player.countMark('mpjiusong'); + }, + prompt2:function(event,player){ + let list; + if(get.type(event.card)!='delay') list=game.filterPlayer(current=>{ + return lib.filter.targetEnabled2(event.card,event.player,current); + }); + else list=game.filterPlayer(current=>current.canAddJudge(event.card)); + return `移去1枚“醉”,${list.length>1?`令${get.translation(event.card)}目标改为${get.translation(list)}中的一名随机角色。若新目标与原目标相同,你`:''}获得牌堆中的一张【酒】。` + }, + check:function(event,player){ + const eff=get.effect(event.target,event.card,player,player); + let list; + if(get.type(event.card)!='delay') list=game.filterPlayer(current=>{ + return lib.filter.targetEnabled2(event.card,event.player,current); + }); + else list=game.filterPlayer(current=>current.canAddJudge(event.card)); + let list2=list.filter(current=>get.effect(current,event.card,player,player)>eff); + let list3=list.filter(current=>get.effect(current,event.card,player,player)>0); + return list2.length>=list.length/2||player.countMark('mpjiusong')>=2&&list3.length>=list.length/2; + }, + content:function(){ + player.removeMark('mpjiusong',1); + var list,oriTarget=trigger.target; + trigger.targets.remove(oriTarget); + trigger.getParent().triggeredTargets1.remove(oriTarget); + trigger.untrigger(); + game.delayx(); + if(get.type(trigger.card)!='delay') list=game.filterPlayer(current=>{ + return lib.filter.targetEnabled2(trigger.card,trigger.player,current); + }); + else list=game.filterPlayer(current=>current.canAddJudge(trigger.card)); + if(list.length) target=list.randomGet(); + trigger.targets.push(target); + trigger.player.line(target,'thunder'); + game.log(trigger.card,'的目标被改为',target); + if(target==oriTarget){ + var card=get.cardPile2('jiu'); + if(card) player.gain(card,'gain2'); + else{ + player.chat('没酒了!'); + game.log('但是牌堆中已经没有','#y酒','了!'); + } + } + }, + }, + mpbishi:{ + audio:2, + forced:true, + trigger:{global:'useCard1'}, + filter:function(event,player){ + if(get.type2(event.card)!='trick'||!get.tag(event.card,'damage')) return false; + if(!lib.skill.xunshi.isXunshi(event.card)) return false; + const targets=event.targets.slice(); + targets.remove(event.player); + return targets.length==game.countPlayer()-2; + }, + content:function*(){}, + mod:{ + targetEnabled:function(card){ + if(get.type2(card)=='trick'&&get.tag(card,'damage')>0) return false; + } + } + }, //十周年嵇康 dcjuexiang: { derivation: 'dccanyun', @@ -704,6 +793,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addSkill('mashu'); player.addSkill('dcnuchen'); player.awakenSkill('dcdanji'); + }, + ai:{ + maixie:true, + skillTagFilter:(player,tag,arg)=>{ + if(tag==='maixie') return player.hp>=2&&!player.storage.dcdanji&&!player.hasSkill('dcnuchen')&&player.countCards('h')===player.hp; + }, + effect:{ + target:(card,player,target)=>{ + let hs=target.countCards('h'); + if(target.hp<3||target.storage.dcdanji||target.hasSkill('dcnuchen')||hs>target.hp+1) return; + if(get.tag(card,'draw')) return 1.6; + if(get.tag(card,'lose')||get.tag(card,'discard')) return [1,-0.8]; + if(hs===target.hp&&get.tag(card,'damage')) return [1,target.hp/3]; + if(hs>target.hp&&target.hp>3&&(card.name==='shan'||card.name==='wuxie')) return 'zeroplayertarget'; + } + } } }, dcnuchen:{ @@ -867,7 +972,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, dcwujie:{ audio:2, - forced:true, trigger:{ global:['discardBegin','drawBegin'], }, @@ -946,7 +1050,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 +2337,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, subSkill:{ blocker:{ - charlotte:true, init:function(player,skill){ player.addSkillBlocker(skill); }, @@ -2626,7 +2731,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 +4413,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; @@ -4731,7 +4835,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ 'step 0' player.chooseTarget('请选择【抗歌】的目标','其于回合外摸牌后,你摸等量的牌;其进入濒死状态时,你可令其回复体力至1点;其死亡后,你弃置所有牌并失去1点体力',lib.filter.notMe,true).set('ai',function(target){ - return get.attitude(_status.event.player,target)>0; + return get.attitude(_status.event.player,target); }); 'step 1' if(result.bool){ @@ -6273,8 +6377,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;i刘伶自幼便失去了父爱,因其父亲身材矮小,及至长大成人后,刘伶身高也不过六尺。魏齐王曹芳正始之末(249年),刘伶已成为当世名重一时的名士,并且常与嵇康、阮籍、阮咸集会于山阳竹林之下,饮酒赋诗,弹琴作歌。晋武帝司马炎泰始初年(265年)前后,曾做过一段时间的建威参军,不久朝廷下诏,入宫中策问。他大谈老庄,强调无为而治,非但没有得到重用,反而连参军之职也被罢免了,从此再无仕进。晋惠帝司马衷永康元年(300年)前后,以寿而终。
    刘伶有“品酒第一人”的美称,也被酒行业传颂至今,后人以古瀑河边上的井水酿酒,还取刘伶墓地的黄土垒成窖池酿酒,为了纪念刘伶,当地百姓也将“润泉涌”更名为“刘伶醉”。其传世作品仅有《酒德颂》《北芒客舍》两篇,其中《酒德颂》所表现出的藐视一切存在的气概,敌视礼教之士的反抗精神,既高扬了人格的力量,批判了当时的黑暗政治,同时也抒发了压抑的愤世之情,充满了浪漫色彩,气魄豪迈,用辞又骈偶间行,有无意追求而自至的特点,对后代影响极大。', }, characterTitle:{ chunyuqiong:'#b对决限定武将', sp_xuyou:'#g4v4限定武将', }, - perfectPair:{}, characterFilter:{ chunyuqiong:function(mode){ return mode!='identity'&&mode!='guozhan'; @@ -10798,6 +10897,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dcjuexiang_info:'当你死亡时,杀死你的角色弃置其装备区内的所有牌并失去1点体力,然后你可以令一名其他角色获得〖残韵〗。', dccanyun:'残韵', dccanyun_info:'每名角色限一次。出牌阶段,你可以弃置一张牌并选择一名其他角色,然后若其装备区里的牌数:小于你,其回复1点体力;大于你,其失去1点体力;等于你,其摸一张牌。若你的体力值为1,你摸一张牌。', + mp_liuling:'刘伶', + mpjiusong:'酒颂', + mpjiusong_info:'当一名角色使用【酒】时,你获得1枚“醉”标记(“醉”数至多为3)。', + mpmaotao:'酕醄', + mpmaotao_info:'当其他角色使用牌指定唯一目标时,你可以移去1枚“醉”,令此牌的目标改为随机一名合法角色(无距离限制)。若目标角色与原目标相同,你从牌堆中获得一张【酒】。', + mpbishi:'避世', + mpbishi_info:'锁定技。你不能成为伤害类锦囊牌的目标。', star_caoren:'星曹仁', star_caoren_prefix:'星', starsujun:'肃军', @@ -10834,6 +10940,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_danqi:'千里单骑', sp_star:'将星系列', sp_decade:'其他新服武将', + mini_qixian:'小程序·竹林七贤', }, pinyins:{ 卑弥呼:['Himiko'] diff --git a/character/standard.js b/character/standard.js index 27a426093..90ba68b7a 100755 --- a/character/standard.js +++ b/character/standard.js @@ -1114,9 +1114,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ paoxiao:{ audio:2, firstDo:true, - audioname2:{old_guanzhang:'old_fuhun'}, audioname:['re_zhangfei','guanzhang','xiahouba'], - audioname2:{ + audioname2: { + old_guanzhang:'old_fuhun', dc_xiahouba:'paoxiao_xiahouba', }, trigger:{player:'useCard1'}, @@ -2539,7 +2539,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp_zhangliao:['sp_zhangliao','yj_zhangliao','jsrg_zhangliao'], xiahoudun:['xiahoudun','re_xiahoudun','xin_xiahoudun'], liubei:['liubei','re_liubei','sb_liubei','dc_liubei','junk_liubei'], - guanyu:['guanyu','re_guanyu','ps_guanyu'], + guanyu:['guanyu','re_guanyu','ps_guanyu','old_guanyu'], zhangfei:['zhangfei','re_zhangfei','old_zhangfei','xin_zhangfei','sb_zhangfei','tw_zhangfei','jsrg_zhangfei','yj_zhangfei'], zhaoyun:['zhaoyun','re_zhaoyun','old_zhaoyun','sb_zhaoyun','ps2063_zhaoyun','ps2067_zhaoyun'], sp_zhaoyun:['sp_zhaoyun','jsp_zhaoyun'], diff --git a/character/swd.js b/character/swd.js index eaa2d656a..f4447266a 100644 --- a/character/swd.js +++ b/character/swd.js @@ -5351,7 +5351,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } for(j=0;j13) trigger.num1=13; + if(player==trigger.player){ + trigger.num1+=num; + if(trigger.num1>13) trigger.num1=13; + } + else{ + trigger.num2+=num; + if(trigger.num2>13) trigger.num2=13; + } game.log(player,'的拼点牌点数+',num); }, }, @@ -397,8 +405,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.when('useCardAfter').filter(evt=>evt==trigger.getParent()).then(()=>{ if(player.getHistory('sourceDamage',evt=>evt.card==trigger.card).length){ player.draw(); - player.addTempSkill('shenzhu_more','phaseUseAfter'); - player.addMark('shenzhu_more',1,false); + player.addTempSkill('twhuzhong_sha','phaseUseAfter'); + player.addMark('twhuzhong_sha',1,false); } else{ target.line(player); @@ -427,6 +435,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ game.log(result.targets,'成为了',trigger.card,'的额外目标'); } }, + subSkill:{ + sha:{ + charlotte:true, + onremove:true, + mod:{ + cardUsable:function(card,player,num){ + if(card.name=='sha') return num+player.countMark('twhuzhong_sha'); + }, + }, + } + } }, twfenwang:{ audio:2, @@ -500,7 +519,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ subSkill:{ effect:{ charlotte:true, - trigger:{player:'useCard'}, + trigger:{player:'useCard1'}, filter:function(event,player){ return get.type(event.card)=='basic'||get.type(event.card)=='trick'; }, @@ -514,7 +533,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ name:trigger.card.name, isCard:true, }; - var targets=trigger.targets.filter(i=>i.isIn()); + var targets=trigger.targets.filter(i=>i.isIn()&&player.canUse(card,i,false)); if(targets.length) player.useCard(card,targets,false); } }); @@ -531,50 +550,65 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{global:'damageEnd'}, filter:function(event,player){ if(!event.player.isIn()) return false; + if(event.player.getHistory('damage').indexOf(event)!=0) return false; return event.player==player||player.inRange(event.player); }, usable:1, direct:true, content:function(){ 'step 0' - var list=lib.inpile.filter(name=>{ - var type=get.type2(name); - if(type!='basic'&&type!='trick') return false; - return !player.getStorage('twshenyi').includes(name); + var list=get.inpileVCardList(info=>{ + return ['basic','trick','delay'].includes(info[0])&&!player.getStorage('twshenyi').includes(info[2]); }); - var dialog=['###'+get.prompt('twshenyi',trigger.player)+'###选择一个牌名,从牌堆中将此一张此牌名的牌称为“侠义”置于武将牌上',[list,'vcard']]; + var dialog=[`###${get.prompt('twshenyi',trigger.player)}###
    从牌堆中将一张牌作为“侠义”置于武将牌上${player!=trigger.player&&player.countCards('h')?',然后将所有手牌交给其':''}
    `,[list,'vcard']]; player.chooseButton(dialog).set('ai',function(button){ var trigger=_status.event.getTrigger(); var player=_status.event.player,name=button.link[2]; if(get.attitude(player,trigger.player)<=0) return 0; if(!get.cardPile2(card=>card.name==name)) return 0; - return get.value({name:name}); + var value=get.value({name:name}); + if(['tao','jiu','caochuan','wuxie'].includes(name)&&get.event().getRand()>0.4) return value*2; + return value; }); 'step 1' if(result.bool){ - var name=result.links[0][2]; + var name=result.links[0][2],nature=result.links[0][3]; + var cardx={name:name,nature:nature}; player.logSkill('twshenyi',trigger.player); - player.popup(name); + player.popup(cardx); player.markAuto('twshenyi',[name]); - game.log(player,'声明了','#y'+get.translation(name)); - var card=get.cardPile2(card=>card.name==name); + game.log(player,'声明了',`#y${get.translation(cardx)}`); + var card=get.cardPile2(card=>get.name(card,false)==name&&get.nature(card,false)==nature); if(card) player.addToExpansion([card],'gain2').gaintag.add('twshenyi'); else{ player.chat('无牌可得?!'); game.log('但是牌堆中已经没有','#y'+get.translation(name),'了!'); } if(trigger.player!=player&&player.countCards('h')){ + game.delayex(); var skill='twshenyi_'+player.playerid; - if(!lib.skill[skill]){ - lib.skill[skill]={charlotte:true}; - lib.translate[skill]='义·'+get.translation(player.name); - } + game.broadcastAll(lib.skill.twshenyi.createGainTag,skill,player.name); + game.addVideo('skill',player,['twshenyi',[skill,player.name]]); player.give(player.getCards('h'),trigger.player).gaintag.add(skill); player.addSkill('twshenyi_draw'); } } else player.storage.counttrigger.twshenyi--; }, + video:(player,info)=>lib.skill.twshenyi.createGainTag(info[0],info[1]), + createGainTag:function(skill,name){ + if(!lib.skill[skill]){ + lib.skill[skill]={charlotte:true}; + lib.translate[skill]='义·'+get.translation(name); + } + if(!_status.postReconnect.twshenyi){ + _status.postReconnect.twshenyi=[ + lib.skill.twshenyi.createGainTag,[],[] + ]; + } + _status.postReconnect.twshenyi[1].add(skill); + _status.postReconnect.twshenyi[2].add(name); + }, marktext:'义', intro:{ name:'侠义', @@ -598,56 +632,31 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return game.hasPlayer(target=>{ var evt=event.getl(target); if(!evt||!evt.hs||!evt.hs.length) return false; - if(event.name=='lose'){ - for(var i in event.gaintag_map){ - if(event.gaintag_map[i].contains(skill)) return true; - } - return false; + for(let i in evt.gaintag_map){ + if(evt.gaintag_map[i].includes(skill)) return true; } - return target.hasHistory('lose',function(evt){ - if(event!=evt.getParent()) return false; - for(var i in evt.gaintag_map){ - if(evt.gaintag_map[i].contains(skill)) return true; - } - return false; - }); + return false; }); }, forced:true, + direct:true, content:function(){ var skill='twshenyi_'+player.playerid; + var num=0; var targets=game.filterPlayer(target=>{ var evt=trigger.getl(target); + var numx=0; if(!evt||!evt.hs||!evt.hs.length) return false; - if(trigger.name=='lose'){ - for(var i in trigger.gaintag_map){ - if(trigger.gaintag_map[i].contains(skill)) return true; - } - return false; + for(var i in evt.gaintag_map){ + if(evt.gaintag_map[i].includes(skill)) numx++; } - return target.hasHistory('lose',function(evt){ - if(trigger!=evt.getParent()) return false; - for(var i in evt.gaintag_map){ - if(evt.gaintag_map[i].contains(skill)) return true; - } - return false; - }); - }),num=0; - targets.forEach(target=>{ - var cards=trigger.getl(target).hs; - if(trigger.name=='lose'){ - for(var i in trigger.gaintag_map){ - if(trigger.gaintag_map[i].contains(skill)) num++; - } - } - else target.getHistory('lose',function(evt){ - if(trigger!=evt.getParent()) return false; - for(var i in evt.gaintag_map){ - if(evt.gaintag_map[i].contains(skill)) num++; - } - }); + if(numx>0) return num+=numx; + return false; }); - if(num>0) player.draw(num); + if(num>0){ + player.logSkill('twshenyi_draw',targets); + player.draw(num); + } }, }, }, @@ -659,23 +668,29 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return player.getExpansions('twshenyi').length>game.countPlayer(); }, check:function(event,player){ + if(player.hp>=3||(player.countCards('h')>=4&&player.getExpansions('twshenyi').every(card=>!player.hasValueTarget(card)||!get.tag(card,'damage')||!lib.skill.xunshi.isXunshi(card)))) return false; return player.getExpansions('twshenyi').some(card=>player.hasValueTarget(card)); }, - prompt2:function(event,player){ - return '依次使用武将牌上的“侠义”牌,回合结束时弃置所有手牌并将失去X点体力(X为你的体力值-1且X至少为1)'; - }, + direct:true, content:function*(event,map){ var player=map.player; - while(player.getExpansions('twshenyi').some(card=>player.hasValueTarget(card))){ - var result=yield player.chooseButton(['兴汉:请选择其中的一张牌使用',player.getExpansions('twshenyi').filter(card=>player.hasValueTarget(card))]).set('ai',function(button){ - return _status.event.player.getUseValue(button.link); - }); - if(result.bool){ - player.chooseToUse(true,result.links[0],false); - } + var result=yield player.chooseBool().set('createDialog',[ + get.prompt('twxinghan'), + `
    按顺序使用以下“侠义”牌。但是回合结束时你须弃置所有手牌并失去X点体力(X为你的体力值-1且X至少为1)
    `, + player.getExpansions('twshenyi').filter(card=>player.hasUseTarget(card)).reverse(), + 'hidden', + ]).set('choice',lib.skill.twxinghan.check(null,player)); + if(!result.bool){ + event.finish(); + return; + } + while(true){ + var cards=player.getExpansions('twshenyi').filter(card=>player.hasUseTarget(card)).reverse(); + if(!cards.length) break; + yield player.chooseUseTarget(true,cards[0],false); } player.when('phaseEnd').then(()=>{ - if(player.countCards('h')) player.discard(player.getCards('h')); + if(player.countCards('h')) player.chooseToDiscard(player.countCards('h'),true); var num=Math.max(1,player.getHp()-1); player.loseHp(num); }); @@ -685,17 +700,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){ init:{ audio:'twxinghan', trigger:{ - player:['loseEnd','dying','dyingAfter'], + player:['loseEnd','dying','die','dyingAfter'], global:['equipEnd','addJudgeEnd','gainEnd','loseAsyncEnd','addToExpansionEnd'], }, filter:function(event,player){ - return (player.getExpansions('twshenyi').length&&(!player.countCards('h')||player.isDying()))^player.hasSkill('twxinghan_in'); + return (player.getExpansions('twshenyi').length&&event.name!='die'&&(!player.countCards('h')||player.isDying()))^player.hasSkill('twxinghan_in'); }, forced:true, firstDo:true, silent:true, + forceDie:true, content:function(){ - if(player.getExpansions('twshenyi').length&&(!player.countCards('h')||player.isDying())){ + if(player.getExpansions('twshenyi').length&&trigger.name!='die'&&(!player.countCards('h')||player.isDying())){ var cards=player.getExpansions('twshenyi'); var cardsx=cards.map(card=>{ var cardx=ui.create.card(); @@ -972,10 +988,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ switch(get.sgn(att)){ case 1: return [cards,[]]; - break; case 0: return [cardx,cardy]; - break; case -1: var num=Math.ceil(cards.length/2)+(cards.length%2==0?1:0); if(num>1&&player.hasSkill('twchungang')) num--; @@ -985,7 +999,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 +5749,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 +6030,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 +6459,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 +8851,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 +9773,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 +10771,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 +11224,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 +11398,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 +11474,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 +11554,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 +11776,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 +13132,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; } }, }, @@ -14567,6 +14579,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ jiangji:['tw_jiangji','jiangji'], baoxin:['tw_baoxin','baoxin'], yanxiang:['yanxiang','tw_yanxiang'], + liwei:['liwei','tw_liwei'], }, dynamicTranslate:{ twfeifu:function(player){ @@ -15211,7 +15224,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ xia_xiahoudun:'侠夏侯惇', xia_xiahoudun_prefix:'侠', twdanlie:'胆烈', - twdanlie_info:'出牌阶段限一次,你可以与至多三名其他角色同时拼点,且你此次的拼点牌点数+X(X为你已损失的体力值)。若你赢,你对这些角色各造成1点伤害;若你没赢,你失去1点体力。', + twdanlie_info:'①出牌阶段限一次。你可以与至多三名其他角色共同拼点。若你赢,你对没赢的角色依次造成1点伤害;若你没赢,你失去1点体力。②你的拼点牌点数+X(X为你已损失的体力值)。', xia_zhangwei:'张葳', twhuzhong:'护众', twhuzhong_info:'当你于出牌阶段使用无属性【杀】指定唯一目标角色时,你可以选择一项:①弃置一张手牌,然后你可以为此牌额外选择一个目标;②令其弃置一张手牌,此牌结算完毕后,若此牌造成过伤害,则你摸一张牌且本阶段可以额外使用一张【杀】,否则其对你造成1点伤害。', @@ -15223,9 +15236,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ xia_liubei:'侠刘备', xia_liubei_prefix:'侠', twshenyi:'伸义', - twshenyi_info:'每回合限一次,当你或你攻击范围内的一名角色受到伤害后,你可以声明一个基本牌或锦囊牌的牌名(每种牌名限一次),然后从牌堆中将一张同名牌称为“侠义”置于武将牌上,然后若受伤角色不为你,则你将所有手牌交给其,且当其失去一张你以此法交给其的牌后,你摸一张牌。', + twshenyi_info:'每回合限一次。当你或你攻击范围内的一名角色于一回合内首次受到伤害后,你可以声明一种基本牌或锦囊牌(每种牌名限一次),然后从牌堆中将一张同名牌称为“侠义”置于武将牌上。若受伤角色不为你,则你将所有手牌交给其,且当其失去一张你以此法交给其的牌后,你摸一张牌。', twxinghan:'兴汉', - twxinghan_info:'①当你没有手牌时或你处于濒死状态时,你可以如手牌般使用或打出你武将牌上的“侠义”牌。②准备阶段,若你武将牌上的“侠义”牌数大于场上的存活角色数,则你可以依次使用其中所有可以使用的牌,然后于回合结束时弃置所有手牌并失去X点体力(X为你的体力值-1且X至少为1)。', + twxinghan_info:'①当你没有手牌时或你处于濒死状态时,你可以如手牌般使用或打出“侠义”牌。②准备阶段,若“侠义”牌数大于存活角色数,则你可以依次使用其中所有可以使用的牌。然后你获得如下效果:回合结束时,你弃置所有手牌并失去X点体力(X为你的体力值-1且X至少为1)。', tw_mobile:'海外服·稀有专属', tw_yunchouzhi:'运筹帷幄·智', diff --git a/character/xianding.js b/character/xianding.js index ff7c6b997..d49cd4745 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -8,12 +8,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dc_xujing:['male','shu',3,['dcshangyu','dccaixia']], dc_zhaoxiang:['female','shu',4,['refanghun','refuhan']], dc_guansuo:['male','shu',4,['xinzhengnan','xiefang']], + xin_baosanniang:['female','shu',3,['decadewuniang','decadexushen']], dc_shixie:['male','qun',3,['rebiluan','ollixia']], dc_sp_machao:['male','qun',4,['zhuiji','dc_olshichou']], old_huangfusong:['male','qun',4,['xinfenyue']], dc_xiahouba:['male','shu',4,['rebaobian']], dc_daxiaoqiao:['female','wu',3,['dcxingwu','dcluoyan']], - tianshangyi:['female','wei',3,['dcposuo','dcxiaoren'],['unseen']], + tianshangyi:['female','wei',3,['dcposuo','dcxiaoren']], sunlingluan:['female','wu',3,['dclingyue','dcpandi']], dc_wangjun:['male','qun',4,['dctongye','dcchangqu']], zhoubuyi:['male','wei',3,['dcshiji','dcsilun']], @@ -28,7 +29,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ zhangjinyun:['female','shu',3,['dchuizhi','dcjijiao']], huanfan:['male','wei',3,['dcjianzheng','dcfumou']], chentai:['male','wei',4,['dcctjiuxian','dcchenyong']], - sunyu:['male','wu',3,['dcquanshou','dcshexue'],['unseen']], + sunyu:['male','wu',3,['dcquanshou','dcshexue']], xizheng:['male','shu',3,['dcdanyi','dcwencan']], dc_ruiji:['female','wu',4,['dcwangyuan','dclingyin','dcliying']], zerong:['male','qun',4,['dccansi','dcfozong']], @@ -95,7 +96,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ sp2_doukou:['re_xinxianying','huaman','xuelingyun','dc_ruiji','duanqiaoxiao','tianshangyi'], sp2_jichu:['zhaoang','dc_liuye','dc_wangyun','yanghong','huanfan','xizheng'], sp2_yuxiu:['dongguiren','dc_tengfanglan','zhangjinyun','zhoubuyi','dc_xujing'], - sp2_qifu:['dc_guansuo','dc_zhaoxiang'], + sp2_qifu:['dc_guansuo','xin_baosanniang','dc_zhaoxiang'], sp2_gaoshan:['wanglang','liuhui'], sp2_wumiao:['wu_zhugeliang','wu_luxun'], } @@ -155,7 +156,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(shown.length0){ player.$gain2(shown,false); @@ -1506,7 +1507,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(type=='equip'&&game.hasPlayer(current=>{ return current.canEquip(card); })||type=='delay'&&game.hasPlayer(current=>{ - return !current.storage._disableJudge&&!current.hasJudge(card.name); + return current.canAddJudge(card); })) choices.unshift('场上'); player.chooseControl(choices).set('prompt','请选择要将'+get.translation(card)+'置于的位置').set('ai',()=>{ return _status.event.choice; @@ -1526,7 +1527,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return _status.event.targets.contains(target); }).set('targets',game.filterPlayer(current=>{ if(type=='equip') return current.canEquip(card); - if(type=='delay') return !current.storage._disableJudge&&!current.hasJudge(card.name); + if(type=='delay') return current.canAddJudge(card); return false; })).set('ai',target=>{ var player=_status.event.player; @@ -1539,7 +1540,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } else{ player.$throw(card,1000); - var next=player.lose(card,ui.cardPile); + var next=player.lose(card,ui.cardPile,'visible'); if(result.control=='牌堆顶') next.insert_card=true; game.log(player,'将',card,'置于了','#y'+result.control); } @@ -1555,7 +1556,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ target.addJudge(card); } } - if(event.count<4) event.goto(1); 'step 5' game.countPlayer(current=>{ var count=current.countCards('e'); @@ -1564,7 +1564,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ current.link(false); current.turnOver(false); } + event.equipCount[current.playerid]=count; }); + if(event.count<4) event.goto(1); } }, //杜预 @@ -2806,7 +2808,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; } } @@ -3145,11 +3147,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, trigger:{global:'phaseBegin'}, filter:function(event,player){ - return event.player.countCards('h')0||event.player.maxHp-event.player.countCards('h')<=2; + if(get.attitude(player,event.player)>0) return true; + const draw=event.player.maxHp-event.player.countCards('h'); + return draw<=2&&event.player.getHp(true)-draw>=1; }, content:function(){ 'step 0' @@ -3161,7 +3165,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var draw=Math.min(5,Math.max(0,trigger.player.maxHp-trigger.player.countCards('h'))); if(get.attitude(trigger.player,player)>0){ if(draw>=3||trigger.player.getCardUsable('sha')>1) return '选项一'; - if(draw<=1&&trigger.player.countCards('hs',card=>{ + if(!draw||draw<=1&&trigger.player.countCards('hs',card=>{ return get.name(card)=='sha'&&trigger.player.hasValueTarget(card); })) return '选项二'; return '选项一'; @@ -3212,7 +3216,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ popup:false, charlotte:true, onremove:true, - marktext:'守', + marktext:'', intro:{content:'本回合使用的牌被抵消后,$摸一张牌'}, content:function(){ var targets=player.getStorage('dcquanshou_respond'); @@ -3232,7 +3236,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'phaseUseBegin'}, filter:function(event,player){ var card=lib.skill.dcshexue.getLast(); - return card&&player.hasUseTarget(card); + return card&&player.hasUseTarget(card,false); }, getLast:function(){ for(var current of game.filterPlayer()){ @@ -3258,10 +3262,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var card=lib.skill.dcshexue.getLast(); game.broadcastAll(function(card){ lib.skill.dcshexue_backup.viewAs=card; - lib.skill.dcshexue_backup.prompt='设学:是否将一张牌当做'+get.translation(card)+'使用?'; },card); var next=player.chooseToUse(); - next.set('openskilldialog','设学:是否将一张牌当做'+get.translation(card)+'使用?'); + next.set('openskilldialog',`###${get.prompt('dcshexue')}###将一张牌当做${get.translation(card.nature)||''}【${get.translation(card.name)}】使用`); next.set('norestore',true); next.set('addCount',false); next.set('_backupevent','dcshexue_backup'); @@ -3277,6 +3280,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filterCard:function(card){ return get.itemtype(card)=='card'; }, + filterTarget:lib.filter.targetEnabled, position:'hes', selectCard:1, check:(card)=>6-get.value(card), @@ -3297,6 +3301,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var card=history[history.length-1].card; return '令下一回合的角色于其出牌阶段开始时选择是否将一张牌当做'+(get.translation(card.nature)||'')+'【'+get.translation(card.name)+'】使用'; }, + check:function(event,player){ + let evt=event.getParent('phase').getParent(); + let nextPlayer=player.getNext(); + if(evt&&evt.next&&evt.next.length){ + nextPlayer=evt.next[0].player; + } + return get.attitude(player,nextPlayer)>0; + }, content:function(){ var history=player.getHistory('useCard',evt=>{ return evt.getParent('phaseUse')==trigger&&(get.type(evt.card)=='basic'||get.type(evt.card)=='trick'); @@ -3311,7 +3323,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ study:{ trigger:{player:'phaseUseBegin'}, filter:function(event,player){ - return player.getStorage('dcshexue_study').some(i=>event.player.hasUseTarget(i)); + return player.getStorage('dcshexue_study').some(i=>event.player.hasUseTarget(i,false)); }, onremove:true, charlotte:true, @@ -3321,13 +3333,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.cards=player.getStorage('dcshexue_study'); 'step 1' var card=cards.pop(); - if(trigger.player.hasUseTarget(card)){ + if(trigger.player.hasUseTarget(card,false)){ game.broadcastAll(function(card){ lib.skill.dcshexue_backup.viewAs=card; lib.skill.dcshexue_backup.prompt='设学:是否将一张牌当做'+get.translation(card)+'使用?'; },card); var next=trigger.player.chooseToUse(); - next.set('openskilldialog','设学:是否将一张牌当做'+get.translation(card)+'使用?'); + next.set('openskilldialog',`###${get.prompt('dcshexue_study')}###将一张牌当做${get.translation(card.nature)||''}【${get.translation(card.name)}】使用`); next.set('norestore',true); next.set('addCount',false); next.set('_backupevent','dcshexue_backup'); @@ -4141,7 +4153,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 +4257,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 +6075,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 +8065,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 +8639,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 +8921,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 +9268,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 +9276,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 +9285,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 +9294,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()]); @@ -10230,7 +10238,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ enable:'phaseUse', usable:1, filter:function(event,player){ - return !player.storage.zunwei||player.storage.zunwei.length<3; + let storage=player.getStorage('zunwei'); + return storage.length<3&&game.hasPlayer(current=>{ + return player.isDamaged()&¤t.getHp()>player.getHp()&&!storage.includes(0)|| + current.countCards('h')>player.countCards('h')&&!storage.includes(1)|| + current.countCards('e')>player.countCards('e')&&!storage.includes(2); + }); }, chooseButton:{ dialog:function(event,player){ @@ -10241,12 +10254,30 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ]; var choiceList=ui.create.dialog('尊位:请选择一项','forcebutton','hidden'); choiceList.add([list.map((item,i)=>{ + if(player.getStorage('zunwei').includes(i)) item=`${item}`; return [i,item]; }),'textbutton']) return choiceList; }, filter:function(button){ - return button._filterButton; + const player=get.player(); + if(player.getStorage('zunwei').includes(button.link)) return false; + if(button.link==0){ + if(!player.isDamaged()) return false; + return game.hasPlayer(current=>{ + return current.getHp()>player.getHp(); + }); + } + if(button.link==1){ + return game.hasPlayer(current=>{ + return current.countCards('h')>player.countCards('h'); + }); + } + if(button.link==2){ + return game.hasPlayer(current=>{ + return current.countCards('e')>player.countCards('e'); + }); + } }, backup:function(links){ var next=get.copy(lib.skill.zunwei.backups[links[0]]); @@ -10256,27 +10287,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 +11072,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 +11102,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 +11883,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 +12338,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'], @@ -12686,9 +12715,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ dcchenyong_info:'结束阶段,你可以摸X张牌(X为本回合你使用过的牌的类型数)。', sunyu:'孙瑜', dcquanshou:'劝守', - dcquanshou_info:'一名角色的回合开始时,若其手牌数小于其体力上限,你可以令其选择一项:1.将手牌摸至体力上限,然后本回合使用【杀】的次数上限-1(至多摸五张);2.其本回合使用牌被抵消后,你摸一张牌。', + dcquanshou_info:'一名角色的回合开始时,若其手牌数不大于其体力上限,你可以令其选择一项:1.将手牌摸至体力上限,然后本回合使用【杀】的次数上限-1(至多摸五张);2.其本回合使用牌被抵消后,你摸一张牌。', dcshexue:'设学', - dcshexue_info:'①出牌阶段开始时,你可以将一张牌当做于上回合的角色于其出牌阶段内使用的最后一张基本牌或普通锦囊牌使用。②出牌阶段结束时,你可以令下回合的角色于其出牌阶段开始时可以将一张牌当做你于此阶段内使用的最后一张基本牌或普通锦囊牌使用。', + dcshexue_info:'①出牌阶段开始时,你可以将一张牌当做上回合的角色于其出牌阶段内使用的最后一张基本牌或普通锦囊牌使用。②出牌阶段结束时,你可以令下回合的角色于其出牌阶段开始时可以将一张牌当做你于此阶段内使用的最后一张基本牌或普通锦囊牌使用(一名角色因〖设学〗使用的牌均无距离和次数限制)。', xizheng:'郤正', dcdanyi:'耽意', dcdanyi_info:'当你使用牌指定第一个目标后,若此牌的目标与你使用的上一张牌目标相同,你可以摸X张牌(X为此牌目标数)。', 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..360a92148 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; }, }, @@ -2043,6 +2043,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addTempSkill('paoxiao'); } }, + derivation:['wusheng','paoxiao'], }, shiyong:{ audio:2, @@ -2210,7 +2211,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 +3152,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ for(var i=0;i
  • 已对'+str+'发动过〖残韵〗'); } @@ -3304,7 +3305,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ direct:true, content:function (){ 'step 0' - player.chooseTarget(get.prompt2('rezhenjun')).ai=function(target){ + player.chooseTarget(get.prompt2('rezhenjun'),(card,player,target)=>{ + return target.countCards('he'); + }).ai=function(target){ return -get.attitude(_status.event.player,target)*(target.countCards('e')+1); }; 'step 1' @@ -4167,7 +4170,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 +5410,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, @@ -6121,6 +6124,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.popup('更改描述'); player.addMark('xindanxin',1,false); } + }, + ai:{ + maixie:true, + effect:{ + target:(card,player,target)=>{ + if(!get.tag(card,'damage')) return; + if(target.hp<2||player.hasSkillTag('jueqing',false,target)) return -1.5; + return [1,1]; + } + } } }, zongzuo:{ @@ -6461,7 +6474,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 +8767,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 +10057,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 +11072,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 +13537,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){ @@ -13780,7 +13792,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'phaseZhunbeiBegin'}, forced:true, unique:true, - derivation:['zyexin','zzili'], + derivation:['zyexin','zzili','zpaiyi'], filter:function(event,player){ return player.countCards('e')>=2; }, diff --git a/character/yingbian.js b/character/yingbian.js index 30de75455..4435f60b7 100644 --- a/character/yingbian.js +++ b/character/yingbian.js @@ -4,6 +4,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ name:'yingbian', connect:true, character:{ + chengjichengcui:['male','jin',6,['oltousui','olchuming']], wangxiang:['male','jin',3,['bingxin']], jin_jiachong:['male','jin',3,['xiongshu','jianhui']], xuangongzhu:['female','jin',3,['gaoling','qimei','ybzhuiji'],['hiddenSkill']], @@ -37,6 +38,151 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, }, skill:{ + //二成 + oltousui:{ + audio:2, + enable:'chooseToUse', + viewAsFilter:function(player){ + return player.countCards('he'); + }, + viewAs:{ + name:'sha', + suit:'none', + number:null, + isCard:true, + }, + filterCard:true, + selectCard:[1,Infinity], + position:'he', + check:function(card){ + const player=get.player(); + return 4.5+(player.hasSkill('olchuming')?1:0)-1.5*ui.selected.cards.length-get.value(card); + }, + popname:true, + ignoreMod:true, + precontent:function*(event,map){ + var player=map.player; + var evt=event.getParent(); + if(evt.dialog&&typeof evt.dialog=='object') evt.dialog.close(); + player.logSkill('oltousui'); + delete event.result.skill; + var cards=event.result.cards; + player.loseToDiscardpile(cards,ui.cardPile,false,'blank').log=false; + var shownCards=cards.filter(i=>get.position(i)=='e'),handcardsLength=cards.length-shownCards.length; + if(shownCards.length){ + player.$throw(shownCards,null); + game.log(player,'将',shownCards,'置于了牌堆底'); + } + if(handcardsLength>0){ + player.$throw(handcardsLength,null); + game.log(player,'将',get.cnNumber(handcardsLength),'张牌置于了牌堆底'); + } + game.delayex(); + var viewAs=new lib.element.VCard({name:event.result.card.name,isCard:true}); + event.result.card=viewAs; + event.result.cards=[]; + event.result._apply_args={ + shanReq:cards.length, + oncard:()=>{ + var evt=get.event(); + for(var target of evt.targets){ + var id=target.playerid; + var map=evt.customArgs; + if(!map[id]) map[id]={}; + map[id].shanRequired=evt.shanReq; + } + } + }; + }, + ai:{ + order:function(item,player){ + return get.order({name:'sha'})+0.1; + }, + result:{player:1}, + keepdu:true, + respondSha:true, + skillTagFilter:(player,tag,arg)=>{ + if(tag=='respondSha'&&arg!='use') return false; + }, + }, + }, + olchuming:{ + audio:2, + trigger:{ + source:'damageBegin1', + player:'damageBegin3', + }, + filter:function(event,player){ + return event.source!=event.player; + }, + forced:true, + content:function*(event,map){ + var player=map.player,trigger=map.trigger; + if(!trigger.card||!trigger.cards.length){ + trigger.num++; + event.finish(); + return; + } + else{ + var target=trigger[trigger.source==player?'player':'source']; + trigger._olchuming=true; + target.addTempSkill('olchuming_effect'); + } + }, + ai:{ + effect:{ + player:function(card,player,target){ + if(!get.tag(card,'damage')) return; + if(!lib.card[card.name]||!card.cards||!card.cards.length) return [1,0,1,-1]; + return [1,-1]; + }, + }, + }, + subSkill:{ + effect:{ + charlotte:true, + trigger:{global:'phaseEnd'}, + forced:true, + popup:false, + content:function*(event,map){ + var player=map.player; + var mapx={}; + var history=player.getHistory('damage').concat(player.getHistory('sourceDamage')); + history.forEach(evt=>{ + if(!evt._olchuming) return; + var target=evt[evt.source==player?'player':'source']; + if(!target.isIn()) return; + if(!mapx[target.playerid]) mapx[target.playerid]=[]; + mapx[target.playerid].addArray(evt.cards.filterInD('d')); + }); + var entries=Object.entries(mapx).map(entry=>{ + return [(_status.connectMode?lib.playerOL:game.playerMap)[entry[0]],entry[1]]; + }); + if(!entries.length){ + event.finish(); + return; + } + player.logSkill('olchuming_effect',entries.map(i=>i[0])); + entries.sort((a,b)=>lib.sort.seat(a[0],b[0])); + for(var entry of entries){ + var current=entry[0],cards=entry[1]; + var list=['jiedao','guohe'].filter(i=>player.canUse(new lib.element.VCard({name:i,cards:cards}),current,false)); + if(!list.length) return; + var result=({}); + if(list.length==1) result={bool:true,links:[['','',list[0]]]}; + else result=yield player.chooseButton([`畜鸣:请选择要对${get.translation(current)}使用的牌`,[list,'vcard']],true).set('ai',button=>{ + var player=get.player(); + return get.effect(get.event('currentTarget'),{name:button.link[2]},player,player); + }).set('currentTarget',current); + if(result.bool){ + var card=get.autoViewAs({name:result.links[0][2]},cards); + if(player.canUse(card,current,false)) player.useCard(card,cards,current,false); + } + } + } + } + } + }, bingxin:{ audio:2, enable:'chooseToUse', @@ -295,7 +441,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } }, }, - logTarget:'target', marktext:'嫕', intro:{ markcount:'expansion', @@ -531,7 +676,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 +733,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 +2816,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'); @@ -3588,9 +3732,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ xuangongzhu:'高陵宣公主(?—?)司马氏,晋宣帝司马懿第二女。司马氏下嫁杜预。其侄司马炎登基时,司马氏已经去世。泰始年间(265年—274年)追赠高陵公主。', jin_guohuai:'郭槐(237年-296年),字媛韶,太原阳曲(今山西太原)人,魏晋权臣贾充的妻子。父亲是曹魏城阳郡太守郭配,伯父是曹魏名将郭淮。出身太原郭氏。二十一岁时,嫁贾充作继室,生二女二子,长女贾南风,次女贾午,一子贾黎民。贾南风是西晋惠帝司马衷皇后,干预国政,专权误国,直接导致“八王之乱”和西晋亡国。', wangxiang:'王祥(184年,一作180年-268年4月30日),字休徵。琅邪临沂(今山东省临沂市西孝友村)人。三国曹魏及西晋时大臣。王祥于东汉末隐居二十年,在曹魏,先后任县令、大司农、司空、太尉等职,封爵睢陵侯。西晋建立,拜太保,进封睢陵公。泰始四年四月戊戌日(268年4月30日)去世,年八十五(一作八十九),谥号“元”。有《训子孙遗令》一文传世。王祥侍奉后母朱氏极孝,为传统文化中二十四孝之一“卧冰求鲤”的主人翁。', + chengjichengcui:'成倅、成济(?~260年6月21日),扬州丹阳(今安徽省宣城市)人。三国时期曹魏将领。依附于司马氏家族,得到司马昭的心腹贾充指使,刺死魏帝曹髦。司马昭为平息众怒,将成倅、成济兄弟二人杀死。据《魏氏春秋》记载,成济兄弟不服罪,光着身子跑到屋顶,大骂司马昭,被军士从下乱箭射杀。', }, characterTitle:{}, - perfectPair:{}, characterFilter:{}, dynamicTranslate:{}, perfectPair:{ @@ -3805,6 +3949,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ qiaoyan_info:'锁定技,当你于回合外受到其他角色造成的伤害时,若你:有“珠”,则你令伤害来源获得“珠”;没有“珠”,则你防止此伤害,然后摸一张牌,并将一张牌正面朝上置于武将牌上,称为“珠”。', xianzhu:'献珠', xianzhu_info:'锁定技,出牌阶段开始时,你令一名角色A获得“珠”。若A不为你自己,则你选择A攻击范围内的一名角色B,视为A对B使用一张【杀】。', + chengjichengcui:'成济成倅', + oltousui:'透髓', + oltousui_info:'你可以将任意张牌置于牌堆底,视为使用一张需使用等量张【闪】抵消的【杀】。', + olchuming:'畜鸣', + olchuming_info:'锁定技。当你对其他角色造成伤害时,或当你受到其他角色造成的伤害时,若此伤害的渠道不为牌或没有对应的实体牌,此伤害+1,否则其于本回合结束时将所有以此法造成伤害的牌当【借刀杀人】或【过河拆桥】对你使用。', yingbian_pack1:'文德武备·理', yingbian_pack2:'文德武备·备', 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 76aec3c87..c5e91884a 100644 --- a/game/game.js +++ b/game/game.js @@ -400,6 +400,52 @@ return method; } }, + handler:{ + _handlers:{}, + getHandler:function(name,type){ + if(!type)type = this.getDefaultHandlerType(name); + if(!this._handlers[name])return null; + if(!this._handlers[name][type])return null; + return this._handlers[name][type]; + }, + ensureHandlerList:function(name,type){ + if(!type)type = this.getDefaultHandlerType(name); + if(!this._handlers[name])this._handlers[name] = {}; + if(!this._handlers[name][type])this._handlers[name][type] = []; + return this._handlers[name][type]; + }, + removeHandler:function(name,type,func){ + var list = this.ensureHandlerList(name,type); + list.remove(func); + if(list.length == 0){ + delete this._handlers[name][type]; + if(Object.keys(this._handlers[name]) == 0){ + delete this._handlers[name]; + } + } + }, + pushHandler:function(name,type){ + let functions = (typeof type == 'string' ? arguments.slice(2):arguments.slice(1)); + type = (typeof type == 'string'?type:this.getDefaultHandlerType(name)); + this.ensureHandlerList(name,type).addArray(functions); + }, + getDefaultHandlerType:(name)=>{ + return `on${name[0].toUpperCase()}${name.slice(1)}`; + }, + addHandlerToEvent:function(event){ + if(typeof event.name == 'string'){ + let handlerMap = this._handlers[event.name]; + if(handlerMap){ + Object.keys(handlerMap).forEach((key)=>{ + let list = handlerMap[key]; + if(list){ + list.forEach(handler=>event.pushHandler(key,handler)); + } + }); + } + } + } + }, objectURL:new Map(), hookmap:{}, imported:{}, @@ -6511,7 +6557,7 @@ else{ lib.codeMirrorReady(node,editor); } - }; + } }, }, reset_character_three:{ @@ -6603,7 +6649,7 @@ else{ lib.codeMirrorReady(node,editor); } - }; + } }, }, reset_character_four:{ @@ -7063,7 +7109,7 @@ else{ lib.codeMirrorReady(node,editor); } - }; + } }, }, reset_character:{ @@ -7700,9 +7746,9 @@ }else if(newMessage.includes("Invalid regular expression flags")){ newMessage="无效的正则表达式的标记"; }else if(newMessage.includes("missing ) after argument list")){ - newMessage="参数列表后面缺少 \')\' (丢失运算符或者转义字符等)"; + newMessage="参数列表后面缺少 ')' (丢失运算符或者转义字符等)"; }else if(newMessage.includes("Invalid shorthand property initializer")){ - newMessage="在定义一个{}对象时,应该使用\':\'而不是\'=\'"; + newMessage="在定义一个{}对象时,应该使用':'而不是'='"; }else if(newMessage.includes("Missing initializer in const declaration")){ newMessage="在使用const定义一个对象时,必须指定初始值"; }else if(newMessage.includes("Unexpected number")||newMessage.includes("Unexpected string")){ @@ -7729,11 +7775,11 @@ }else if(newMessage.includes("Cannot read property")){ messageName=newMessage.replace('TypeError: Cannot read property ', '').replace(' of null', '').replace(' of undefined', ''); let ofName=newMessage.slice(newMessage.indexOf(" of ")+4); - newMessage="无法读取\'"+ofName+"\'的属性值"+messageName; + newMessage="无法读取'"+ofName+"'的属性值"+messageName; }else if(newMessage.includes("Cannot read properties")){ messageName=newMessage.slice(newMessage.indexOf("reading '")+9,-2); let ofName=newMessage.slice(newMessage.indexOf(" of ")+4,newMessage.indexOf("(")-1); - newMessage="无法读取\'"+ofName+"\'的属性值"+messageName; + newMessage="无法读取'"+ofName+"'的属性值"+messageName; }else if(newMessage.includes("Property description must be an object")){ messageName=newMessage.replace('TypeError: Property description must be an object: ', ''); newMessage=messageName+"是非对象类型的值"; @@ -7746,7 +7792,7 @@ messageName=newMessage.slice(newMessage.indexOf('\'')+1); messageName=messageName.slice(0,messageName.indexOf('\'')); let obj=newMessage.slice(newMessage.indexOf(messageName)+16); - newMessage=obj+"不能添加或修改\'"+messageName+"\'属性,任何 Primitive 值都不允许有property"; + newMessage=obj+"不能添加或修改'"+messageName+"'属性,任何 Primitive 值都不允许有property"; }else if(newMessage.includes("Can't add property")&&newMessage.includes("is not extensible")){ newMessage="对象不可添加属性(不可扩展)"; }else if(newMessage.includes("Cannot redefine property")){ @@ -7816,10 +7862,10 @@ code=node.editor.getValue(); }else if(node.textarea){ code=node.textarea.value; - }; + } //动态绑定文本 if(code.length&&change.origin=="+input" && - /{|}|\s|=|;|:|,|,|。|?|!|\!|\?|&|#|%|@|‘|’|;/.test(change.text[0])==false&& + /{|}|\s|=|;|:|,|,|。|?|!|!|\?|&|#|%|@|‘|’|;/.test(change.text[0])==false&& change.text.length==1) { //输入了代码,并且不包括空格,{},=, ; , : , 逗号等,才可以自动提示 node.editor.showHint(); @@ -7948,7 +7994,7 @@ } function javascriptHint(editor,options){ return scriptHint(editor,javascriptKeywords,function(e,cur){return e.getTokenAt(cur);},options); - }; + } //覆盖原本的javascript提示 CodeMirror.registerHelper("hint","javascript",javascriptHint); const stringProps=Object.getOwnPropertyNames(String.prototype); @@ -8142,7 +8188,7 @@ run:function(time){ lib.status.time=time; for(var i=0;i{ + const image=new Image(); + image.src=`${lib.assetURL}${src}`; + image.onload=resolve; + if(type=='character') image.onerror=reject; + }).then(()=>{ + this.setBackgroundImage(src); + this.style.backgroundPositionX='center'; + this.style.backgroundSize='cover'; + }).catch(()=>new Promise((resolve,reject)=>{ + const nameinfo=get.character(name); + const sex=nameinfo[0]; + src=`image/character/default_silhouette_${sex}${ext}`; + const image=new Image(); + image.src=`${lib.assetURL}${src}`; + image.onload=()=>resolve(src); + image.onerror=reject; + }).catch(()=>new Promise((resolve,reject)=>{ + const nameinfo=get.character(name); + const sex=nameinfo[0]; + src=`image/character/default_silhouette_${sex=='female'?'female':'male'}${ext}`; + const image=new Image(); + image.src=`${lib.assetURL}${src}`; + image.onload=()=>resolve(src); + image.onerror=reject; + })).then((src)=>{ + this.setBackgroundImage(src); + this.style.backgroundPositionX='center'; + this.style.backgroundSize='cover'; + })); return this; } }); @@ -9012,7 +9087,7 @@ str+=`\n行号: ${line}`; str+=`\n列号: ${column}`; const version=lib.version||''; - const reg=/[^\d\.]/; + const reg=/[^\d.]/; const match=version.match(reg)!=null; str+='\n'+`${match?'游戏':'无名杀'}版本: ${version||'未知版本'}`; if(match) str+='\n⚠️您使用的游戏代码不是源于libccy/noname无名杀官方仓库,请自行寻找您所使用的游戏版本开发者反馈!'; @@ -9051,7 +9126,7 @@ } str+='\n-------------'; if(typeof line=='number'&&(typeof game.readFile=='function'||location.origin!='file://')){ - function createShowCode(lines){ + const createShowCode=function(lines){ let showCode=''; if(lines.length>=10){ if(line>4){ @@ -11374,7 +11449,7 @@ function Legacy(func){ //Remove all comments //移除所有注释 - let str=func.toString().replace(/((?:(?:^[ \t]*)?(?:\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\/(?:[ \t]*\r?\n(?=[ \t]*(?:\r?\n|\/\*|\/\/)))?|\/\/(?:[^\\]|\\(?:\r?\n)?)*?(?:\r?\n(?=[ \t]*(?:\r?\n|\/\*|\/\/))|(?=\r?\n))))+)|("(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|(?:\r?\n|[\s\S])[^\/"'\\\s]*)/mg,'$2').trim(); + let str=func.toString().replace(/((?:(?:^[ \t]*)?(?:\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\/(?:[ \t]*\r?\n(?=[ \t]*(?:\r?\n|\/\*|\/\/)))?|\/\/(?:[^\\]|\\(?:\r?\n)?)*?(?:\r?\n(?=[ \t]*(?:\r?\n|\/\*|\/\/))|(?=\r?\n))))+)|("(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|(?:\r?\n|[\s\S])[^/"'\\\s]*)/mg,'$2').trim(); //获取第一个 { 后的所有字符 str=str.slice(str.indexOf('{')+1); //判断代码中是否有debugger @@ -11498,6 +11573,7 @@ } } } + // falls through default: return Legacy(item); } @@ -11508,7 +11584,7 @@ } else if(typeof func=='object'){ for(var i in func){ - if(func.hasOwnProperty(i)){ + if(Object.prototype.hasOwnProperty.call(func, i)){ func[i]=lib.init.eval(func[i]); } } @@ -14475,7 +14551,7 @@ event.finish(); return; } - }; + } event.doing=event.map.shift(); 'step 3' event.num=0; @@ -14594,11 +14670,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; } @@ -15027,7 +15103,7 @@ current.getHistory().isRound=true; current.getStat().isRound=true; } - }; + } if(isRound){ game.getGlobalHistory().isRound=true; } @@ -16191,7 +16267,7 @@ result[0].cards=lib.skill[result[0].skill].onCompare(player) } else lose_list.push([player,result[0].cards]); - }; + } for(var j=0; j{ + game.log(targets[index],'的拼点牌为',card); + }); player.animate('target'); game.delay(0,1000); 'step 5' @@ -16250,7 +16329,6 @@ event.target.animate('target'); event.card2=event.cardlist[event.iwhile]; event.num2=event.getNum(event.card2); - game.log(event.target,'的拼点牌为',event.card2); //event.tempplayer.line(event.target); delete event.player; event.trigger('compare'); @@ -16356,7 +16434,7 @@ result[0].cards=lib.skill[result[0].skill].onCompare(player) } else lose_list.push([player,result[0].cards]); - }; + } for(var j=0;j1){ - if(Boolean(event.small)) return getn(card)-get.value(card)/2+addi; + if(event.small) return getn(card)-get.value(card)/2+addi; return -getn(card)-get.value(card)/2+addi; } - if(Boolean(event.small)) return -getn(card)-get.value(card)/2+addi; + if(event.small) return -getn(card)-get.value(card)/2+addi; return getn(card)-get.value(card)/2+addi; } else{ - if(Boolean(event.small)) return -getn(card)-get.value(card)/2+addi; + if(event.small) return -getn(card)-get.value(card)/2+addi; return getn(card)-get.value(card)/2+addi; } } @@ -24124,7 +24202,7 @@ var addi=(get.value(card)>=8&&get.type(card)!='equip')?-6:0; if(card.name=='du') addi-=5; 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; @@ -25352,7 +25430,7 @@ } } if(next.animate=='gain2'||next.animate=='draw2'){ - if(!next.hasOwnProperty('log')){ + if(!Object.prototype.hasOwnProperty.call(next, 'log')){ next.log=true; } } @@ -25439,7 +25517,7 @@ } } if(next.animate=='gain2'||next.animate=='draw2'||next.animate=='give'){ - if(!next.hasOwnProperty('log')){ + if(!Object.prototype.hasOwnProperty.call(next, 'log')){ next.log=true; } } @@ -25757,7 +25835,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(); @@ -26062,7 +26140,7 @@ const position=get.position(card,true); return position!='j'&&position!='o'; })){ - game.log(card,'已被移出处理区,无法置入判定区'); + game.log(card,'已被移出处理区,无法置入判定区'); return; } for(let iwhile=0;iwhile<20;iwhile++){ @@ -26243,7 +26321,7 @@ } clearTimeout(lib.node.torespondtimeout[this.playerid]); delete lib.node.torespondtimeout[this.playerid]; - if(!lib.node.torespond.hasOwnProperty(this.playerid)){ + if(!Object.prototype.hasOwnProperty.call(lib.node.torespond, this.playerid)){ return; } var noresume=false; @@ -26270,7 +26348,7 @@ else if(_status.paused&&!noresume) game.resume(); } tempUnwait(result){ - if(!lib.node.torespond.hasOwnProperty(this.playerid)){ + if(!Object.prototype.hasOwnProperty.call(lib.node.torespond, this.playerid)){ return; } var proceed; @@ -30972,6 +31050,7 @@ const type=`onNext${name[0].toUpperCase()}${name.slice(1)}`; if(gameEvent.hasHandler(type)) this.pushHandler(...gameEvent.getHandler(type)); } + lib.handler.addHandlerToEvent(this); } this.step=0; this.finished=false; @@ -31295,7 +31374,6 @@ parent=parent.parent; if(historys.contains(parent)) return toreturn; } - if(!parent) return toreturn; } if(toreturn===null){ return null; @@ -31527,7 +31605,7 @@ for(var i=0;i{ - return i[0]==skillx&&i[1]==player; - }); - if(toremove.length>0) map.list.removeArray(toremove); - } - for(var j=0;j|\|/g,'-')}.zip`; + }),fileNameToSaveAs=`${exportExtension.replace(/\\|\/|:|\?|"|\*|<|>|\|/g,'-')}.zip`; if(lib.device){ const directory=lib.device=='android'?cordova.file.externalDataDirectory:cordova.file.documentsDirectory; @@ -37669,7 +37710,7 @@ const config=game.importedPack.config; Object.keys(config).forEach(value=>{ const configObject=config[value]; - if(configObject&&configObject.hasOwnProperty('init')) game.saveConfig(`extension_${extensionName}_${value}`,configObject.init); + if(configObject&&Object.prototype.hasOwnProperty.call(configObject, 'init')) game.saveConfig(`extension_${extensionName}_${value}`,configObject.init); }); if(game.download){ const files=zip.files,hiddenFileFlags=['.','_'],fileList=Object.keys(files).filter(key=>!files[key].dir&&!hiddenFileFlags.includes(key[0])).reverse(); @@ -37747,7 +37788,7 @@ export:function(textToWrite,name){ var textFileAsBlob = new Blob([textToWrite], {type:'text/plain'}); var fileNameToSaveAs = name||'noname'; - fileNameToSaveAs=fileNameToSaveAs.replace(/\\|\/|\:|\?|\"|\*|<|>|\|/g,'.'); + fileNameToSaveAs=fileNameToSaveAs.replace(/\\|\/|:|\?|"|\*|<|>|\|/g,'.'); if(lib.device){ var directory; @@ -42109,7 +42150,7 @@ config.num=config.num||num||3; config.ratio=config.ratio||ratio||1.2; config.update=config.update||update; - if(!config.hasOwnProperty('first')){ + if(!Object.prototype.hasOwnProperty.call(config, 'first')){ if(typeof first=='boolean'){ config.first=first; } @@ -42723,10 +42764,10 @@ } if(info.marktext) lib.translate[`${i}_bg`]=info.marktext; if(info.silent){ - if(!info.hasOwnProperty('forced')) info.forced=true; - if(!info.hasOwnProperty('popup')) info.popup=false; + if(!Object.prototype.hasOwnProperty.call(info, 'forced')) info.forced=true; + if(!Object.prototype.hasOwnProperty.call(info, 'popup')) info.popup=false; } - if(!info.hasOwnProperty('_priority')){ + if(!Object.prototype.hasOwnProperty.call(info, '_priority')){ let priority=0; if(info.priority){ priority=info.priority*100; @@ -43145,7 +43186,7 @@ game.reload2(); reject(event); } - };; + }; record.onsuccess=event=>{ if(typeof onSuccess=='function'){ _status.dburgent=true; @@ -43185,7 +43226,7 @@ game.reload2(); reject(event); } - };; + }; idbRequest.onsuccess=event=>{ const result=event.target.result; if(typeof onSuccess=='function'){ @@ -43209,7 +43250,7 @@ game.reload2(); reject(event); } - };; + }; idbRequest.onsuccess=event=>{ const result=event.target.result; if(result){ @@ -43270,7 +43311,7 @@ request.onerror=event=>{ game.reload2(); reject(event); - };; + }; request.onsuccess=event=>{ game.reload2(); resolve(event); @@ -45023,7 +45064,7 @@ var cfg=copyObj(infoconfig[j]); cfg._name=j; cfg.mode=mode; - if(!config.hasOwnProperty(j)){ + if(!Object.prototype.hasOwnProperty.call(config, j)){ game.saveConfig(j,cfg.init,mode); } else{ @@ -45491,7 +45532,7 @@ } var cfg=copyObj(info.config[j]); cfg._name=j; - if(!config.hasOwnProperty(j)){ + if(!Object.prototype.hasOwnProperty.call(config, j)){ if(cfg.type!='autoskill'&&cfg.type!='banskill'){ game.saveConfig(j,cfg.init); } @@ -45609,7 +45650,7 @@ } var link=(game.writeFile?'cdv_':'custom_')+name; if(lib.config.customBackgroundMusic[link]){ - if(!confirm('已经存在文件名称相同的背景音乐,是否仍然要继续导入?')){_status.music_importing=false;return}; + if(!confirm('已经存在文件名称相同的背景音乐,是否仍然要继续导入?')){_status.music_importing=false;return} for(var i=1;i<1000;i++){ if(!lib.config.customBackgroundMusic[link+'_'+i]){ link=link+'_'+i;break; @@ -47365,7 +47406,7 @@ j=mode+'_'+i+'_playpackconfig'; } cfg._name=j; - if(!lib.config.hasOwnProperty(j)){ + if(!Object.prototype.hasOwnProperty.call(lib.config, j)){ game.saveConfig(j,cfg.init); } else{ @@ -48618,7 +48659,7 @@ editnode.classList.add('disabled'); delnode.innerHTML='取消'; delete delnode.button; - container.code='card={\n \n}\n\n\/*\n示例:\ncard={\n type:"basic",\n enable:true,\n filterTarget:true,\n content:function(){\n target.draw()\n },\n ai:{\n order:1,\n result:{\n target:1\n }\n }\n}\n此例的效果为目标摸一张牌\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'; + container.code='card={\n \n}\n\n/*\n示例:\ncard={\n type:"basic",\n enable:true,\n filterTarget:true,\n content:function(){\n target.draw()\n },\n ai:{\n order:1,\n result:{\n target:1\n }\n }\n}\n此例的效果为目标摸一张牌\n导出时本段代码中的换行、缩进以及注释将被清除\n*/'; } newCard=ui.create.div('.new_character',page); @@ -48817,7 +48858,7 @@ delete window.saveNonameInput; }; var editor=ui.create.editor(container,saveInput); - container.code='card={\n \n}\n\n\/*\n示例:\ncard={\n type:"basic",\n enable:true,\n filterTarget:true,\n content:function(){\n target.draw()\n },\n ai:{\n order:1,\n result:{\n target:1\n }\n }\n}\n此例的效果为目标摸一张牌\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'; + container.code='card={\n \n}\n\n/*\n示例:\ncard={\n type:"basic",\n enable:true,\n filterTarget:true,\n content:function(){\n target.draw()\n },\n ai:{\n order:1,\n result:{\n target:1\n }\n }\n}\n此例的效果为目标摸一张牌\n导出时本段代码中的换行、缩进以及注释将被清除\n*/'; var editnode=ui.create.div('.menubutton.large.new_card.disabled','创建卡牌',newCard,function(){ var name=page.querySelector('input.new_name').value; @@ -49168,7 +49209,7 @@ editnode.classList.add('disabled'); delnode.innerHTML='取消'; delete delnode.button; - container.code='skill={\n \n}\n\n\/*\n示例:\nskill={\n trigger:{player:"phaseJieshuBegin"},\n frequent:true,\n content:function(){\n player.draw()\n }\n}\n此例为闭月代码\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'; + container.code='skill={\n \n}\n\n/*\n示例:\nskill={\n trigger:{player:"phaseJieshuBegin"},\n frequent:true,\n content:function(){\n player.draw()\n }\n}\n此例为闭月代码\n导出时本段代码中的换行、缩进以及注释将被清除\n*/'; if(page.fromchar=='add'){ page.fromchar=true; } @@ -49254,7 +49295,7 @@ delete window.saveNonameInput; }; var editor=ui.create.editor(container,saveInput); - container.code='skill={\n \n}\n\n\/*\n示例:\nskill={\n trigger:{player:"phaseJieshuBegin"},\n frequent:true,\n content:function(){\n player.draw()\n }\n}\n此例为闭月代码\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'; + container.code='skill={\n \n}\n\n/*\n示例:\nskill={\n trigger:{player:"phaseJieshuBegin"},\n frequent:true,\n content:function(){\n player.draw()\n }\n}\n此例为闭月代码\n导出时本段代码中的换行、缩进以及注释将被清除\n*/'; var citebutton=document.createElement('button'); citebutton.innerHTML='引用代码'; @@ -49482,10 +49523,10 @@ } } else{ - dashes.content.node.code='function(config,pack){\n \n}\n\n\/*\n函数执行时机为游戏数据加载之后、界面加载之前\n参数1扩展选项(见选项代码);参数2为扩展定义的武将、卡牌和技能等(可在此函数中修改)\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'; - dashes.precontent.node.code='function(){\n \n}\n\n\/*\n函数执行时机为游戏数据加载之前,且不受禁用扩展的限制\n除添加模式外请慎用\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'; - dashes.config.node.code='config={\n \n}\n\n\/*\n示例:\nconfig={\n switcher_example:{\n name:"示例列表选项",\n init:"3",\n item:{"1":"一","2":"二","3":"三"}\n },\n toggle_example:{\n name:"示例开关选项",\n init:true\n }\n}\n此例中传入的主代码函数的默认参数为{switcher_example:"3",toggle_example:true}\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'; - dashes.help.node.code='help={\n \n}\n\n\/*\n示例:\nhelp={\n "帮助条目":"
    • 列表1-条目1
    • 列表1-条目2
    1. 列表2-条目1
    2. 列表2-条目2"\n}\n帮助内容将显示在菜单-选项-帮助中\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'; + dashes.content.node.code='function(config,pack){\n \n}\n\n/*\n函数执行时机为游戏数据加载之后、界面加载之前\n参数1扩展选项(见选项代码);参数2为扩展定义的武将、卡牌和技能等(可在此函数中修改)\n导出时本段代码中的换行、缩进以及注释将被清除\n*/'; + dashes.precontent.node.code='function(){\n \n}\n\n/*\n函数执行时机为游戏数据加载之前,且不受禁用扩展的限制\n除添加模式外请慎用\n导出时本段代码中的换行、缩进以及注释将被清除\n*/'; + dashes.config.node.code='config={\n \n}\n\n/*\n示例:\nconfig={\n switcher_example:{\n name:"示例列表选项",\n init:"3",\n item:{"1":"一","2":"二","3":"三"}\n },\n toggle_example:{\n name:"示例开关选项",\n init:true\n }\n}\n此例中传入的主代码函数的默认参数为{switcher_example:"3",toggle_example:true}\n导出时本段代码中的换行、缩进以及注释将被清除\n*/'; + dashes.help.node.code='help={\n \n}\n\ns/*\n示例:\nhelp={\n "帮助条目":"
      • 列表1-条目1
      • 列表1-条目2
      1. 列表2-条目1
      2. 列表2-条目2"\n}\n帮助内容将显示在菜单-选项-帮助中\n导出时本段代码中的换行、缩进以及注释将被清除\n*/'; } }; var dashes={}; @@ -49591,10 +49632,10 @@ } }; page.content={} - createCode('主','主代码',page,clickCode,'content','function(config,pack){\n \n}\n\n\/*\n函数执行时机为游戏数据加载之后、界面加载之前\n参数1扩展选项(见选项代码);参数2为扩展定义的武将、卡牌和技能等(可在此函数中修改)\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'); - createCode('启','启动代码',page,clickCode,'precontent','function(){\n \n}\n\n\/*\n函数执行时机为游戏数据加载之前,且不受禁用扩展的限制\n除添加模式外请慎用\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'); - createCode('选','选项代码',page,clickCode,'config','config={\n \n}\n\n\/*\n示例:\nconfig={\n switcher_example:{\n name:"示例列表选项",\n init:"3",\n item:{"1":"一","2":"二","3":"三"}\n },\n toggle_example:{\n name:"示例开关选项",\n init:true\n }\n}\n此例中传入的主代码函数的默认参数为{switcher_example:"3",toggle_example:true}\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'); - createCode('帮','帮助代码',page,clickCode,'help','help={\n \n}\n\n\/*\n示例:\nhelp={\n "帮助条目":"
        • 列表1-条目1
        • 列表1-条目2
        1. 列表2-条目1
        2. 列表2-条目2"\n}\n帮助内容将显示在菜单-选项-帮助中\n导出时本段代码中的换行、缩进以及注释将被清除\n*\/'); + createCode('主','主代码',page,clickCode,'content','function(config,pack){\n \n}\n\n/*\n函数执行时机为游戏数据加载之后、界面加载之前\n参数1扩展选项(见选项代码);参数2为扩展定义的武将、卡牌和技能等(可在此函数中修改)\n导出时本段代码中的换行、缩进以及注释将被清除\n*/'); + createCode('启','启动代码',page,clickCode,'precontent','function(){\n \n}\n\n/*\n函数执行时机为游戏数据加载之前,且不受禁用扩展的限制\n除添加模式外请慎用\n导出时本段代码中的换行、缩进以及注释将被清除\n*/'); + createCode('选','选项代码',page,clickCode,'config','config={\n \n}\n\n/*\n示例:\nconfig={\n switcher_example:{\n name:"示例列表选项",\n init:"3",\n item:{"1":"一","2":"二","3":"三"}\n },\n toggle_example:{\n name:"示例开关选项",\n init:true\n }\n}\n此例中传入的主代码函数的默认参数为{switcher_example:"3",toggle_example:true}\n导出时本段代码中的换行、缩进以及注释将被清除\n*/'); + createCode('帮','帮助代码',page,clickCode,'help','help={\n \n}\n\n/*\n示例:\nhelp={\n "帮助条目":"
          • 列表1-条目1
          • 列表1-条目2
          1. 列表2-条目1
          2. 列表2-条目2"\n}\n帮助内容将显示在菜单-选项-帮助中\n导出时本段代码中的换行、缩进以及注释将被清除\n*/'); return page; }()); @@ -49758,7 +49799,7 @@ game.saveConfig('extension_'+extname+'_enable',true); game.saveConfig('extension_'+extname+'_version',that.info.version); for(var i in game.importedPack.config){ - if(game.importedPack.config[i]&&game.importedPack.config[i].hasOwnProperty('init')){ + if(game.importedPack.config[i]&&Object.prototype.hasOwnProperty.call(game.importedPack.config[i], 'init')){ game.saveConfig('extension_'+extname+'_'+i,game.importedPack.config[i].init); } } @@ -57023,7 +57064,7 @@ if(!information) { resolve(`${lib.assetURL}image/card/${imageName}.png`) return; - }; + } const image=information.image; if(!image) resolve(`${lib.assetURL}image/card/${imageName}.png`); else if(image.startsWith('db:')) game.getDB('image',image.slice(3)).then(resolve,reject); @@ -58328,6 +58369,26 @@ }, }; const get={ + /** + * 返回 VCard[] 形式的所有牌,用于印卡将遍历 + * @param {Function} filter + * @returns {string[][]} + */ + inpileVCardList:filter=>{ + let list=[]; + for(const name of lib.inpile){ + const type=get.type(name); + const info=[type,'',name]; + if(!filter||filter(info)) list.push(info); + if(name=='sha'){ + for(const nature of lib.inpile_nature){ + const info=[type,'',name,nature]; + if(!filter||filter(info)) list.push(info); + } + } + } + return list; + }, /** * 根据座次数n(从0开始)获取对应的“n+1号位”翻译 * @param {number} seat @@ -58402,7 +58463,7 @@ priority:skill=>{ const info=get.info(skill); if(!info) return 0; - if(info.hasOwnProperty('_priority')) return info._priority; + if(Object.prototype.hasOwnProperty.call(info, '_priority')) return info._priority; let priority=0; if(info.priority){ priority=info.priority*100; @@ -58583,6 +58644,38 @@ return 0; }, is:{ + /** + * 判断是否为进攻坐骑 + * @param {Card | VCard} card + * @param {false | Player} [player] + * @returns {boolean} + */ + attackingMount:(card,player)=>{ + const subtype=get.subtype(card,player); + if(subtype=='equip4') return true; + else if(subtype=='equip6'){ + const info=get.info(card,player),distance=info.distance; + if(!distance) return false; + if(distance.globalFrom&&!info.notMount) return true; + } + return false; + }, + /** + * 判断是否为防御坐骑 + * @param {Card | VCard} card + * @param {false | Player} [player] + * @returns {boolean} + */ + defendingMount:(card,player)=>{ + const subtype=get.subtype(card,player); + if(subtype=='equip3') return true; + else if(subtype=='equip6'){ + const info=get.info(card,player),distance=info.distance; + if(!distance) return false; + if(distance.globalTo&&!info.notMount) return true; + } + return false; + }, /** * 判断坐骑栏是否被合并 */ @@ -59050,7 +59143,7 @@ character:(name,num)=>{ let info=lib.character[name]; if(!info){ - const pack=Object.keys(lib.characterPack).find(pack=>lib.characterPack[pack].hasOwnProperty(name)); + const pack=Object.keys(lib.characterPack).find(pack=>Object.prototype.hasOwnProperty.call(lib.characterPack[pack], name)); if(pack) info=lib.characterPack[pack][name]; } if(info){ @@ -59249,7 +59342,7 @@ } num=Math.floor(num/4); for(i=0;i
            '; if(node.forbiddenSkills[skills[i]].length){ @@ -61225,9 +61322,6 @@ intronode.listen(ui.click.skillbutton); } } - else if(lib.skill[skills[i]].nobracket){ - uiintro.add('
            '+get.translation(skills[i])+'
            '+get.skillInfoTranslation(skills[i],node)+'
            '); - } else{ uiintro.add('
            【'+translation+'】
            '+get.skillInfoTranslation(skills[i],node)+'
            '); } @@ -61923,13 +62017,14 @@ var skills=infoitem[3]; for(i=0;i
            '+get.translation(skills[i])+'
            '+get.skillInfoTranslation(skills[i])+'
            '); - } + if(lib.translate[skills[i]+'_ab']) translation=lib.translate[skills[i]+'_ab']; else{ - uiintro.add('
            【'+translation+'】
            '+get.skillInfoTranslation(skills[i])+'
            '); + translation=get.translation(skills[i]); + if(!lib.skill[skills[i]].nobracket) translation=translation.slice(0,2); } + + uiintro.add('
            【'+translation+'】
            '+get.skillInfoTranslation(skills[i])+'
            '); + if(lib.translate[skills[i]+'_append']){ uiintro._place_text=uiintro.add('
            '+lib.translate[skills[i]+'_append']+'
            ') } diff --git a/game/pinyinjs.js b/game/pinyinjs.js index 73fec645f..54a2e76e4 100644 --- a/game/pinyinjs.js +++ b/game/pinyinjs.js @@ -64,6 +64,7 @@ var pinyin_dict_polyphone = { "库特莉亚芙卡": " kǎ", "露娜": "lù ", // 技能名 + "畜鸣": "chù ", "聆乐": " yuè", "没矢": "mò ", "没欲": "mò ", diff --git a/image/character/chengjichengcui.jpg b/image/character/chengjichengcui.jpg new file mode 100644 index 000000000..9075a1c28 Binary files /dev/null and b/image/character/chengjichengcui.jpg differ diff --git a/image/character/default_silhouette_female.jpg b/image/character/default_silhouette_female.jpg new file mode 100644 index 000000000..e06f56d1b Binary files /dev/null and b/image/character/default_silhouette_female.jpg differ diff --git a/image/character/default_silhouette_male.jpg b/image/character/default_silhouette_male.jpg new file mode 100644 index 000000000..dd0620d2a Binary files /dev/null and b/image/character/default_silhouette_male.jpg differ diff --git a/image/character/mp_liuling.jpg b/image/character/mp_liuling.jpg new file mode 100644 index 000000000..1822fd50e Binary files /dev/null and b/image/character/mp_liuling.jpg differ diff --git a/image/character/sunyu.jpg b/image/character/sunyu.jpg new file mode 100644 index 000000000..a85f67d9a Binary files /dev/null and b/image/character/sunyu.jpg differ 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=3&&from.identity=='fan')?3:-3)) + if(to.ai.shown) return to.ai.shown*(real+(from.identity==to.identity||from.identity=='zhu'&&to.identity=='zhong'||from.identity=='zhong'&&to.identity=='zhu'||from.identity=='nei'&&to.identity=='zhu'&&get.situation()<=1||(to.identity=='nei'&&get.situation()<=0&&['zhu','zhong'].contains(from.identity)||get.situation()>=3&&from.identity=='fan')?2.9:-2.9)) if(from==to||to.identityShown||((stratagem_expose&&stratagem_expose.contains(to))||(zhibi&&zhibi.contains(to)))&&!to.ai.stratagemCamouflage) return real*1.1; if(from.identity=='nei'&&to.ai.stratagemCamouflage) return real*1.1; if(to.identity=='nei'){ @@ -3692,6 +3686,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ case 'commoner': return 2*get.population('fan')-2; } + break; case 'commoner': switch(identity2){ case 'zhu': @@ -3716,6 +3711,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ case 'commoner': return from==to?10:(to.hp<=2?-2:0); } + break; } }, situation:function(absolute){ diff --git a/mode/versus.js b/mode/versus.js index 7f76d96d6..c15a45523 100644 --- a/mode/versus.js +++ b/mode/versus.js @@ -612,16 +612,16 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ var str2; if(game.versusVideoName) str2=game.versusVideoName; else{ - switch(_status.mode){ - case 'two':str2='欢乐成双';break; - case 'endless':str2='无尽模式';break; - case 'three':str2='统率三军';break; - case 'siguo':str2='同舟共济';break; - case 'jiange':str2='守卫剑阁';break; - case 'four':str2='对决 - 4v4';break; - case 'guandu':str2='官渡之战';break; - default:str2='对决 - '+lib.storage.number+'v'+lib.storage.number - } + switch(_status.mode){ + case 'two':str2='欢乐成双';break; + case 'endless':str2='无尽模式';break; + case 'three':str2='统率三军';break; + case 'siguo':str2='同舟共济';break; + case 'jiange':str2='守卫剑阁';break; + case 'four':str2='对决 - 4v4';break; + case 'guandu':str2='官渡之战';break; + default:str2='对决 - '+lib.storage.number+'v'+lib.storage.number + } } return [str,str2]; }, @@ -2551,33 +2551,33 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ next.setContent(function(){ "step 0" var list=[ - ['zhu','ezhu','ezhong','zhong','ezhong','zhong','zhong','ezhong'], - ['zhu','ezhong','zhong','ezhu','ezhong','zhong','ezhong','zhong'], - ['zhu','ezhong','zhong','ezhong','zhong','ezhong','zhong','ezhu'], - ['zhu','ezhu','zhong','ezhong','zhong','ezhong','zhong','ezhong'], - ['zhu','ezhong','zhong','ezhong','zhong','ezhu','zhong','ezhong'], - ].randomGet(); + ['zhu','ezhu','ezhong','zhong','ezhong','zhong','zhong','ezhong'], + ['zhu','ezhong','zhong','ezhu','ezhong','zhong','ezhong','zhong'], + ['zhu','ezhong','zhong','ezhong','zhong','ezhong','zhong','ezhu'], + ['zhu','ezhu','zhong','ezhong','zhong','ezhong','zhong','ezhong'], + ['zhu','ezhong','zhong','ezhong','zhong','ezhu','zhong','ezhong'], + ].randomGet(); - var side=true; - var num=Math.floor(Math.random()*8); - list=list.splice(8-num).concat(list); - for(var i=0;i<8;i++){ - if(list[i][0]=='e'){ - game.players[i].side=side; - game.players[i].identity=list[i].slice(1); - } - else{ - game.players[i].side=!side; - game.players[i].identity=list[i]; - } - if(game.players[i].identity=='zhu'){ - game[game.players[i].side+'Zhu']=game.players[i]; - game.players[i].isZhu=true; - } - game.players[i].setIdentity(game.players[i].identity); - game.players[i].node.identity.dataset.color=get.translation(game.players[i].side+'Color'); - game.players[i].getId(); - } + var side=true; + var num=Math.floor(Math.random()*8); + list=list.splice(8-num).concat(list); + for(var i=0;i<8;i++){ + if(list[i][0]=='e'){ + game.players[i].side=side; + game.players[i].identity=list[i].slice(1); + } + else{ + game.players[i].side=!side; + game.players[i].identity=list[i]; + } + if(game.players[i].identity=='zhu'){ + game[game.players[i].side+'Zhu']=game.players[i]; + game.players[i].isZhu=true; + } + game.players[i].setIdentity(game.players[i].identity); + game.players[i].node.identity.dataset.color=get.translation(game.players[i].side+'Color'); + game.players[i].getId(); + } var side=true; var map={}; @@ -2611,27 +2611,27 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } } } - game.falseZhu.init('re_caocao'); - game.trueZhu.init('ol_yuanshao'); - game.trueZhu.hp++; - game.trueZhu.maxHp++; - game.falseZhu.hp++; - game.falseZhu.maxHp++; - game.trueZhu.update(); - game.falseZhu.update(); + game.falseZhu.init('re_caocao'); + game.trueZhu.init('ol_yuanshao'); + game.trueZhu.hp++; + game.trueZhu.maxHp++; + game.falseZhu.hp++; + game.falseZhu.maxHp++; + game.trueZhu.update(); + game.falseZhu.update(); ui.arena.classList.add('choose-character'); if(get.is.phoneLayout()){ - ui.guanduInfo=ui.create.div('.touchinfo.left',ui.window); - } - else{ - ui.guanduInfo=ui.create.div(ui.gameinfo); - } - ui.guanduInfo.innerHTML='当前事件:'+get.translation(evt); - var dialog=ui.create.dialog('本局特殊事件:'+get.translation(evt)); - dialog.addText(get.translation(evt+'_info'),false); - setTimeout(function(){ - dialog.close(); - },5000) + ui.guanduInfo=ui.create.div('.touchinfo.left',ui.window); + } + else{ + ui.guanduInfo=ui.create.div(ui.gameinfo); + } + ui.guanduInfo.innerHTML='当前事件:'+get.translation(evt); + var dialog=ui.create.dialog('本局特殊事件:'+get.translation(evt)); + dialog.addText(get.translation(evt+'_info'),false); + setTimeout(function(){ + dialog.close(); + },5000) }; game.broadcastAll(func,map,evt); _status.firstAct=game.falseZhu; @@ -2704,12 +2704,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ game.addGlobalSkill(evt); game.broadcastAll(function(evt){ if(get.is.phoneLayout()){ - ui.guanduInfo=ui.create.div('.touchinfo.left',ui.window); - } - else{ - ui.guanduInfo=ui.create.div(ui.gameinfo); - } - ui.guanduInfo.innerHTML='当前事件:'+get.translation(evt); + ui.guanduInfo=ui.create.div('.touchinfo.left',ui.window); + } + else{ + ui.guanduInfo=ui.create.div(ui.gameinfo); + } + ui.guanduInfo.innerHTML='当前事件:'+get.translation(evt); },evt); game.me.chooseControl('ok').set('prompt','###本局特殊事件:'+get.translation(evt)+'###'+get.translation(evt+'_info')); 'step 1' @@ -5164,7 +5164,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ content:function(){ "step 0" event.players=game.filterPlayer(function(current){ - return current.isEnemyOf(player); + return current.isEnemyOf(player); }); "step 1" if(event.players.length){