diff --git a/mode/boss.js b/mode/boss.js index d40696c6e..dc1b569a1 100644 --- a/mode/boss.js +++ b/mode/boss.js @@ -1,59 +1,58 @@ -'use strict'; -game.import('mode',function(lib,game,ui,get,ai,_status){ +"use strict"; +game.import("mode", function (lib, game, ui, get, ai, _status) { return { - name:'boss', - start:function(){ - "step 0" - var playback=localStorage.getItem(lib.configprefix+'playback'); - if(playback){ + name: "boss", + start: function () { + "step 0"; + var playback = localStorage.getItem(lib.configprefix + "playback"); + if (playback) { ui.create.me(); - ui.arena.style.display='none'; - ui.system.style.display='none'; - _status.playback=playback; - localStorage.removeItem(lib.configprefix+'playback'); - var store=lib.db.transaction(['video'],'readwrite').objectStore('video'); - store.get(parseInt(playback)).onsuccess=function(e){ - if(e.target.result){ + ui.arena.style.display = "none"; + ui.system.style.display = "none"; + _status.playback = playback; + localStorage.removeItem(lib.configprefix + "playback"); + var store = lib.db.transaction(["video"], "readwrite").objectStore("video"); + store.get(parseInt(playback)).onsuccess = function (e) { + if (e.target.result) { game.playVideoContent(e.target.result.video); - } - else{ - alert('播放失败:找不到录像'); + } else { + alert("播放失败:找不到录像"); game.reload(); } - } + }; event.finish(); return; } - for(var i in lib.characterPack.mode_boss){ - lib.character[i]=lib.characterPack.mode_boss[i]; - if(!lib.character[i][4]){ - lib.character[i][4]=[]; + for (var i in lib.characterPack.mode_boss) { + lib.character[i] = lib.characterPack.mode_boss[i]; + if (!lib.character[i][4]) { + lib.character[i][4] = []; } } // for(var i in lib.cardPack.mode_boss){ // lib.card[i]=lib.cardPack.mode_boss[i]; // } - for(var i in lib.skill){ - if(lib.skill[i].changeSeat){ - lib.skill[i]={}; - if(lib.translate[i+'_info']){ - lib.translate[i+'_info']='此模式下不可用'; + for (var i in lib.skill) { + if (lib.skill[i].changeSeat) { + lib.skill[i] = {}; + if (lib.translate[i + "_info"]) { + lib.translate[i + "_info"] = "此模式下不可用"; } } } - lib.translate.restart='返回'; - lib.init.css(lib.assetURL+'layout/mode','boss'); + lib.translate.restart = "返回"; + lib.init.css(lib.assetURL + "layout/mode", "boss"); game.delay(0.1); - "step 1" - var bosslist=ui.create.div('#bosslist.hidden'); - event.bosslist=bosslist; + "step 1"; + var bosslist = ui.create.div("#bosslist.hidden"); + event.bosslist = bosslist; lib.setScroll(bosslist); // bosslist.ontouchmove = ui.click.touchScroll; // bosslist.style.WebkitOverflowScrolling='touch'; - if(!lib.config.touchscreen&&lib.config.mousewheel){ - bosslist._scrollspeed=30; - bosslist._scrollnum=10; - bosslist.onmousewheel=ui.click.mousewheel; + if (!lib.config.touchscreen && lib.config.mousewheel) { + bosslist._scrollspeed = 30; + bosslist._scrollnum = 10; + bosslist.onmousewheel = ui.click.mousewheel; } // var bosslistlinks={}; // var toggleBoss=function(bool){ @@ -66,24 +65,24 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ // node.style.display='none'; // } // }; - var onpause=function(){ - ui.window.classList.add('bosspaused'); - } - var onresume=function(){ - ui.window.classList.remove('bosspaused'); - } - game.onpause=onpause; - game.onpause2=onpause; - game.onresume=onresume; - game.onresume2=onresume; + var onpause = function () { + ui.window.classList.add("bosspaused"); + }; + var onresume = function () { + ui.window.classList.remove("bosspaused"); + }; + game.onpause = onpause; + game.onpause2 = onpause; + game.onresume = onresume; + game.onresume2 = onresume; ui.create.div(bosslist); - event.current=null; - var list=[]; - if(lib.storage.current==undefined) lib.storage.current='boss_hundun'; - for(var i in lib.character){ - var info=lib.character[i]; - if(info[4].includes('boss')){ + event.current = null; + var list = []; + if (lib.storage.current == undefined) lib.storage.current = "boss_hundun"; + for (var i in lib.character) { + var info = lib.character[i]; + if (info[4].includes("boss")) { // var cfg=i+'_bossconfig'; // if(get.config(cfg)==undefined){ // game.saveConfig(cfg,true,true); @@ -94,32 +93,32 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ // onclick:toggleBoss, // init:true, // } - var player=ui.create.player(bosslist).init(i); - if(lib.characterPack.mode_boss[i]&&get.config(i+'_boss_config')==false){ - player.style.display='none'; + var player = ui.create.player(bosslist).init(i); + if (lib.characterPack.mode_boss[i] && get.config(i + "_boss_config") == false) { + player.style.display = "none"; } - if(player.hp==0){ - player.node.hp.style.display='none'; + if (player.hp == 0) { + player.node.hp.style.display = "none"; } list.push(player); - player.node.hp.classList.add('text'); - player.node.hp.dataset.condition=''; - player.node.hp.innerHTML=info[2]; - if(info[2]==Infinity){ - player.node.hp.innerHTML='∞'; + player.node.hp.classList.add("text"); + player.node.hp.dataset.condition = ""; + player.node.hp.innerHTML = info[2]; + if (info[2] == Infinity) { + player.node.hp.innerHTML = "∞"; } player.setIdentity(player.name); - player.node.identity.dataset.color=info[5]; + player.node.identity.dataset.color = info[5]; // bosslistlinks[cfg]=player; - player.classList.add('bossplayer'); + player.classList.add("bossplayer"); - if(lib.storage.current==i){ - event.current=player; - player.classList.add('highlight'); - if(!lib.config.continue_name_boss&&lib.boss[i]&&lib.boss[i].control){ - _status.bosschoice=lib.boss[i].control(); - _status.bosschoice.name=i; - _status.bosschoice.link=lib.boss[i].controlid||i; + if (lib.storage.current == i) { + event.current = player; + player.classList.add("highlight"); + if (!lib.config.continue_name_boss && lib.boss[i] && lib.boss[i].control) { + _status.bosschoice = lib.boss[i].control(); + _status.bosschoice.name = i; + _status.bosschoice.link = lib.boss[i].controlid || i; } } @@ -128,2312 +127,2965 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ // } } } - if(!list.length){ - alert('没有可挑战的BOSS'); + if (!list.length) { + alert("没有可挑战的BOSS"); event.finish(); lib.init.onfree(); - _status.over=true; + _status.over = true; return; } - if(!event.current){ - event.current=bosslist.childNodes[1]; - event.current.classList.add('highlight'); + if (!event.current) { + event.current = bosslist.childNodes[1]; + event.current.classList.add("highlight"); } ui.create.div(bosslist); ui.create.cardsAsync(); game.finishCards(); - game.addGlobalSkill('autoswap'); + game.addGlobalSkill("autoswap"); ui.arena.setNumber(8); - ui.control.style.transitionProperty='opacity'; - ui.control.classList.add('bosslist'); - setTimeout(function(){ - ui.control.style.transitionProperty=''; - },1000); + ui.control.style.transitionProperty = "opacity"; + ui.control.classList.add("bosslist"); + setTimeout(function () { + ui.control.style.transitionProperty = ""; + }, 1000); ui.window.appendChild(bosslist); - setTimeout(function(){ - if(event.current){ - var left=event.current.offsetLeft-(ui.window.offsetWidth-180)/2; - if(bosslist.scrollLeft 0) { + td.innerHTML = + "剩余" + + (game.bossinfo.chongzheng - game.dead[i].storage.boss_chongzheng) + + "回合"; + } else { + td.innerHTML = "无法重整"; + } + } + if (!added) { + uiintro.add('
(无重整角色)
'); + uiintro.add(ui.create.div(".placeholder.slim")); + } else { + uiintro.add(table); } return uiintro; - },220); - } + }, + 180 + ); } - else{ - ui.fakeme.style.display='none'; - } - if(game.bossinfo.chongzheng){ - lib.setPopped(ui.create.system('重整',null,true),function(){ - var uiintro=ui.create.dialog('hidden'); - - uiintro.add('重整'); - var table=ui.create.div('.bosschongzheng'); - - var tr,td,added=false; - for(var i=0;i0){ - td.innerHTML='剩余'+(game.bossinfo.chongzheng-game.dead[i].storage.boss_chongzheng)+'回合'; + ui.single_swap = ui.create.system( + "换人", + function () { + var players = get.players(game.me); + players.remove(game.boss); + if (players.length > 1) { + if (ui.auto.classList.contains("hidden")) { + game.me.popup("请稍后换人"); + return; } - else{ - td.innerHTML='无法重整' - } - } - if(!added){ - uiintro.add('
(无重整角色)
'); - uiintro.add(ui.create.div('.placeholder.slim')) - } - else{ - uiintro.add(table); - } - return uiintro; - },180); - } - ui.single_swap=ui.create.system('换人',function(){ - var players=get.players(game.me); - players.remove(game.boss); - if(players.length>1){ - if(ui.auto.classList.contains('hidden')){ - game.me.popup('请稍后换人'); - return; - } - if(_status.event.isMine()){ - ui.click.auto(); - setTimeout(function(){ + if (_status.event.isMine()) { ui.click.auto(); - },500); + setTimeout(function () { + ui.click.auto(); + }, 500); + } + game.modeSwapPlayer(players[1]); } - game.modeSwapPlayer(players[1]); - } - },true); - if(get.config('single_control')||game.me==game.boss){ - ui.single_swap.style.display='none'; + }, + true + ); + if (get.config("single_control") || game.me == game.boss) { + ui.single_swap.style.display = "none"; } ui.arena.appendChild(boss); - if(boss.bossinginfo){ - var rect=boss.getBoundingClientRect(); - boss.style.transform='translate('+(boss.bossinginfo[0]-rect.left-rect.width/2)+'px,'+(boss.bossinginfo[1]-rect.top-rect.height/2)+'px) scale(1.1)'; + if (boss.bossinginfo) { + var rect = boss.getBoundingClientRect(); + boss.style.transform = + "translate(" + + (boss.bossinginfo[0] - rect.left - rect.width / 2) + + "px," + + (boss.bossinginfo[1] - rect.top - rect.height / 2) + + "px) scale(1.1)"; ui.refresh(boss); - boss.style.transition=''; - boss.style.transform=''; + boss.style.transition = ""; + boss.style.transform = ""; delete boss.bossinginfo; - setTimeout(function(){ - boss.node.equips.style.opacity=''; - },500); + setTimeout(function () { + boss.node.equips.style.opacity = ""; + }, 500); } event.bosslist.delete(); game.arrangePlayers(); - for(var i=0;i0&&game.bossinfo.chongzheng){ - if(player.hp 0 && game.bossinfo.chongzheng) { + if (player.hp < player.maxHp) { player.hp++; - } - else if(player.countCards('h')<4){ - var card=get.cards()[0]; - var sort=lib.config.sort_card(card); - var position=sort>0?player.node.handcards1:player.node.handcards2; + } else if (player.countCards("h") < 4) { + var card = get.cards()[0]; + var sort = lib.config.sort_card(card); + var position = sort > 0 ? player.node.handcards1 : player.node.handcards2; card.fix(); - card.addTempClass('start'); - position.insertBefore(card,position.firstChild); + card.addTempClass("start"); + position.insertBefore(card, position.firstChild); } player.update(); - if(player.storage.boss_chongzheng>=game.bossinfo.chongzheng){ + if (player.storage.boss_chongzheng >= game.bossinfo.chongzheng) { player.revive(player.hp); } } - if(game.bossinfo.loopType==2){ - game.boss.chongzheng=true; + if (game.bossinfo.loopType == 2) { + game.boss.chongzheng = true; } - } - else{ - if(player.identity=='zhu'&&game.boss!=player){ - player=game.boss; + } else { + if (player.identity == "zhu" && game.boss != player) { + player = game.boss; } player.phase(); } - "step 1" - if(game.bossinfo.loopType==2){ - _status.roundStart=true; - if(event.player==game.boss){ - if(!_status.last||_status.last.nextSeat==game.boss){ - event.player=game.boss.nextSeat; + "step 1"; + if (game.bossinfo.loopType == 2) { + _status.roundStart = true; + if (event.player == game.boss) { + if (!_status.last || _status.last.nextSeat == game.boss) { + event.player = game.boss.nextSeat; + } else { + event.player = _status.last.nextSeat; } - else{ - event.player=_status.last.nextSeat; - } - } - else{ - _status.last=player; - event.player=game.boss; - if(player.nextSeat==game.boss){ + } else { + _status.last = player; + event.player = game.boss; + if (player.nextSeat == game.boss) { delete _status.roundStart; } } - } - else{ - event.player=event.player.nextSeat; + } else { + event.player = event.player.nextSeat; } event.goto(0); }); }, - onSwapControl:function(){ - if(game.me==game.boss) return; - game.addVideo('onSwapControl'); - var name=game.me.name; - if(ui.fakeme&&ui.fakeme.current!=name){ - ui.fakeme.current=name; - if(ui.versushighlight&&ui.versushighlight!=game.me){ - ui.versushighlight.classList.remove('current_action'); + onSwapControl: function () { + if (game.me == game.boss) return; + game.addVideo("onSwapControl"); + var name = game.me.name; + if (ui.fakeme && ui.fakeme.current != name) { + ui.fakeme.current = name; + if (ui.versushighlight && ui.versushighlight != game.me) { + ui.versushighlight.classList.remove("current_action"); } - ui.versushighlight=game.me; - game.me.classList.add('current_action'); + ui.versushighlight = game.me; + game.me.classList.add("current_action"); // game.me.line(ui.fakeme,{opacity:0.5,dashed:true}); - ui.fakeme.style.backgroundImage=game.me.node.avatar.style.backgroundImage; + ui.fakeme.style.backgroundImage = game.me.node.avatar.style.backgroundImage; // ui.fakeme.style.backgroundSize='cover'; } ui.updatehl(); }, - modeSwapPlayer:function(player){ - var bool=(game.me==game.boss||player==game.boss); + modeSwapPlayer: function (player) { + var bool = game.me == game.boss || player == game.boss; game.swapControl(player); game.onSwapControl(); - if(!bool) return; - if(game.me==game.boss){ - game.singleHandcard=false; - ui.arena.classList.remove('single-handcard'); - ui.window.classList.remove('single-handcard'); - ui.fakeme.style.display='none'; - game.me.dataset.position=0; - game.me.nextSeat.dataset.position=2; - game.me.nextSeat.nextSeat.dataset.position=4; - game.me.nextSeat.nextSeat.nextSeat.dataset.position=6; - } - else{ - game.singleHandcard=true; - ui.arena.classList.add('single-handcard'); - ui.window.classList.add('single-handcard'); - ui.fakeme.style.display=''; - game.boss.dataset.position=7; - game.boss.nextSeat.dataset.position=1; - game.boss.nextSeat.nextSeat.dataset.position=2; - game.boss.nextSeat.nextSeat.nextSeat.dataset.position=3; - if(game.me&&game.me.node.handcards2.childNodes.length){ - while(game.me.node.handcards2.childNodes.length){ + if (!bool) return; + if (game.me == game.boss) { + game.singleHandcard = false; + ui.arena.classList.remove("single-handcard"); + ui.window.classList.remove("single-handcard"); + ui.fakeme.style.display = "none"; + game.me.dataset.position = 0; + game.me.nextSeat.dataset.position = 2; + game.me.nextSeat.nextSeat.dataset.position = 4; + game.me.nextSeat.nextSeat.nextSeat.dataset.position = 6; + } else { + game.singleHandcard = true; + ui.arena.classList.add("single-handcard"); + ui.window.classList.add("single-handcard"); + ui.fakeme.style.display = ""; + game.boss.dataset.position = 7; + game.boss.nextSeat.dataset.position = 1; + game.boss.nextSeat.nextSeat.dataset.position = 2; + game.boss.nextSeat.nextSeat.nextSeat.dataset.position = 3; + if (game.me && game.me.node.handcards2.childNodes.length) { + while (game.me.node.handcards2.childNodes.length) { game.me.node.handcards1.appendChild(game.me.node.handcards2.firstChild); } } } }, - chooseCharacter:function(func){ - var next=game.createEvent('chooseCharacter'); - next.showConfig=true; - next.customreplacetarget=func; - next.ai=function(player,list){ - if(get.config('double_character')){ - player.init(list[0],list[1]); - } - else{ + chooseCharacter: function (func) { + var next = game.createEvent("chooseCharacter"); + next.showConfig = true; + next.customreplacetarget = func; + next.ai = function (player, list) { + if (get.config("double_character")) { + player.init(list[0], list[1]); + } else { player.init(list[0]); } - } - next.setContent(function(){ - "step 0" + }; + next.setContent(function () { + "step 0"; var i; - var list=[]; - event.list=list; - for(i in lib.character){ - if(lib.character[i][4].includes('minskin')) continue; - if(lib.character[i][4].includes('boss')) continue; - if(lib.character[i][4].includes('hiddenboss')) continue; - if(lib.character[i][4]&&lib.character[i][4].includes('forbidai')) continue; - if(lib.config.forbidboss.includes(i)) continue; - if(lib.filter.characterDisabled(i)) continue; + var list = []; + event.list = list; + for (i in lib.character) { + if (lib.character[i][4].includes("minskin")) continue; + if (lib.character[i][4].includes("boss")) continue; + if (lib.character[i][4].includes("hiddenboss")) continue; + if (lib.character[i][4] && lib.character[i][4].includes("forbidai")) continue; + if (lib.config.forbidboss.includes(i)) continue; + if (lib.filter.characterDisabled(i)) continue; list.push(i); } list.randomSort(); - var dialog=ui.create.dialog('选择参战角色','hidden'); - dialog.classList.add('fixed'); + var dialog = ui.create.dialog("选择参战角色", "hidden"); + dialog.classList.add("fixed"); ui.window.appendChild(dialog); - dialog.classList.add('bosscharacter'); - dialog.classList.add('modeshortcutpause'); - dialog.classList.add('withbg'); + dialog.classList.add("bosscharacter"); + dialog.classList.add("modeshortcutpause"); + dialog.classList.add("withbg"); // dialog.add('0/3'); - dialog.add([list.slice(0,20),'character']); - dialog.noopen=true; - var next=game.me.chooseButton(dialog,true).set('onfree',true); - next._triggered=null; - next.custom.replace.target=event.customreplacetarget; - next.selectButton=[3,3]; + dialog.add([list.slice(0, 20), "character"]); + dialog.noopen = true; + var next = game.me.chooseButton(dialog, true).set("onfree", true); + next._triggered = null; + next.custom.replace.target = event.customreplacetarget; + next.selectButton = [3, 3]; // next.custom.add.button=function(){ // if(ui.cheat2&&ui.cheat2.backup) return; // _status.event.dialog.content.childNodes[1].innerHTML= // ui.selected.buttons.length+'/3'; // }; - event.changeDialog=function(){ - if(ui.cheat2&&ui.cheat2.dialog==_status.event.dialog){ + event.changeDialog = function () { + if (ui.cheat2 && ui.cheat2.dialog == _status.event.dialog) { return; } - if(game.changeCoin){ + if (game.changeCoin) { game.changeCoin(-3); } list.randomSort(); - var buttons=ui.create.div('.buttons'); - var node=_status.event.dialog.buttons[0].parentNode; - _status.event.dialog.buttons=ui.create.buttons(list.slice(0,20),'character',buttons); - _status.event.dialog.content.insertBefore(buttons,node); - buttons.addTempClass('start'); + var buttons = ui.create.div(".buttons"); + var node = _status.event.dialog.buttons[0].parentNode; + _status.event.dialog.buttons = ui.create.buttons( + list.slice(0, 20), + "character", + buttons + ); + _status.event.dialog.content.insertBefore(buttons, node); + buttons.addTempClass("start"); node.remove(); game.uncheck(); game.check(); }; - ui.create.cheat=function(){ - _status.createControl=ui.cheat2||event.asboss; - ui.cheat=ui.create.control('更换',event.changeDialog); + ui.create.cheat = function () { + _status.createControl = ui.cheat2 || event.asboss; + ui.cheat = ui.create.control("更换", event.changeDialog); delete _status.createControl; }; - var createCharacterDialog=function(){ - event.dialogxx=ui.create.characterDialog(); - event.dialogxx.classList.add('bosscharacter'); - event.dialogxx.classList.add('withbg'); - event.dialogxx.classList.add('fixed'); - if(ui.cheat2){ - ui.cheat2.addTempClass('controlpressdownx',500); - ui.cheat2.classList.remove('disabled'); + var createCharacterDialog = function () { + event.dialogxx = ui.create.characterDialog(); + event.dialogxx.classList.add("bosscharacter"); + event.dialogxx.classList.add("withbg"); + event.dialogxx.classList.add("fixed"); + if (ui.cheat2) { + ui.cheat2.addTempClass("controlpressdownx", 500); + ui.cheat2.classList.remove("disabled"); } }; - if(lib.onfree){ + if (lib.onfree) { lib.onfree.push(createCharacterDialog); - } - else{ + } else { createCharacterDialog(); } - ui.create.cheat2=function(){ - _status.createControl=event.asboss; - ui.cheat2=ui.create.control('自由选将',function(){ - if(this.dialog==_status.event.dialog){ - if(game.changeCoin){ + ui.create.cheat2 = function () { + _status.createControl = event.asboss; + 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; + _status.event.dialog = this.backup; ui.window.appendChild(this.backup); delete this.backup; game.uncheck(); game.check(); - if(ui.cheat){ - ui.cheat.addTempClass('controlpressdownx',500); - ui.cheat.classList.remove('disabled'); + if (ui.cheat) { + ui.cheat.addTempClass("controlpressdownx", 500); + ui.cheat.classList.remove("disabled"); } - if(_status.bosschoice){ - _status.bosschoice.addTempClass('controlpressdownx',500); - _status.bosschoice.classList.remove('disabled'); + if (_status.bosschoice) { + _status.bosschoice.addTempClass("controlpressdownx", 500); + _status.bosschoice.classList.remove("disabled"); } - } - else{ - if(game.changeCoin){ + } else { + if (game.changeCoin) { game.changeCoin(-10); } - this.backup=_status.event.dialog; + this.backup = _status.event.dialog; _status.event.dialog.close(); - _status.event.dialog=_status.event.parent.dialogxx; - this.dialog=_status.event.dialog; + _status.event.dialog = _status.event.parent.dialogxx; + this.dialog = _status.event.dialog; ui.window.appendChild(this.dialog); game.uncheck(); game.check(); - if(ui.cheat){ - ui.cheat.classList.add('disabled'); + if (ui.cheat) { + ui.cheat.classList.add("disabled"); } - if(_status.bosschoice){ - _status.bosschoice.classList.add('disabled'); + if (_status.bosschoice) { + _status.bosschoice.classList.add("disabled"); } } }); - if(lib.onfree){ - ui.cheat2.classList.add('disabled'); + if (lib.onfree) { + ui.cheat2.classList.add("disabled"); } delete _status.createControl; - } - if(!ui.cheat&&get.config('change_choice')) - ui.create.cheat(); - if(!ui.cheat2&&get.config('free_choose')) - ui.create.cheat2(); + }; + if (!ui.cheat && get.config("change_choice")) ui.create.cheat(); + if (!ui.cheat2 && get.config("free_choose")) ui.create.cheat2(); - event.asboss=ui.create.control('应战',function(){ - event.boss=true; - event.enemy=[]; - for(var i=0;i1/3){ + randchoice: function (name, list) { + if (Math.random() > 1 / 3) { return name; - } - else{ - var arr=['shen_caocao','shen_simayi','shen_guanyu','shen_zhugeliang','shen_zhaoyun','shen_zhouyu','shen_lvmeng','shen_lvbu','shen_liubei','shen_luxun','shen_ganning','ol_zhangliao','shen_zhenji','shen_caopi','key_kagari','key_shiki','db_key_hina']; + } else { + var arr = [ + "shen_caocao", + "shen_simayi", + "shen_guanyu", + "shen_zhugeliang", + "shen_zhaoyun", + "shen_zhouyu", + "shen_lvmeng", + "shen_lvbu", + "shen_liubei", + "shen_luxun", + "shen_ganning", + "ol_zhangliao", + "shen_zhenji", + "shen_caopi", + "key_kagari", + "key_shiki", + "db_key_hina", + ]; arr.removeArray(list); return arr.randomGet(); } }, - controlid:'shenwuzaishi', - control:function(type,control){ - if(type=='cancel'){ - if(!control.classList.contains('glow')) return; - var dialog=control.dialog; + controlid: "shenwuzaishi", + control: function (type, control) { + if (type == "cancel") { + if (!control.classList.contains("glow")) return; + var dialog = control.dialog; dialog.content.removeChild(control.backup1); dialog.buttons.removeArray(control.backup2); game.uncheck(); game.check(); - } - else{ - var control=ui.create.control('神将',function(){ - if(ui.cheat2&&ui.cheat2.dialog==_status.event.dialog){ + } else { + var control = ui.create.control("神将", function () { + if (ui.cheat2 && ui.cheat2.dialog == _status.event.dialog) { return; } - var dialog=_status.event.dialog; - this.dialog=dialog; - if(this.classList.contains('glow')){ + var dialog = _status.event.dialog; + this.dialog = dialog; + if (this.classList.contains("glow")) { this.backup1.remove(); dialog.buttons.removeArray(this.backup2); - } - else{ - var links=[]; - for(var i=0;i0){ - ui.cardPile.insertBefore(cards.shift(),ui.cardPile.childNodes[get.rand(0,ui.cardPile.childElementCount-1)]); + while (cards.length > 0) { + ui.cardPile.insertBefore( + cards.shift(), + ui.cardPile.childNodes[get.rand(0, ui.cardPile.childElementCount - 1)] + ); } lib.inpile.sort(lib.sort.card); - } + }, }, - boss_chiyanshilian:{ - chongzheng:0, - loopType:2, - checkResult:function(player){ - if(player==game.boss&&game.boss.name!='boss_yandi'){ + boss_chiyanshilian: { + chongzheng: 0, + loopType: 2, + checkResult: function (player) { + if (player == game.boss && game.boss.name != "boss_yandi") { return false; } }, - init:function(){ - _status.additionalReward=function(){ + init: function () { + _status.additionalReward = function () { return 500; - } - lib.inpile.remove('shandian'); - lib.inpile.remove('huoshan'); - lib.inpile.remove('hongshui'); - lib.inpile.remove('fulei'); - lib.inpile.add('honghuangzhili'); + }; + lib.inpile.remove("shandian"); + lib.inpile.remove("huoshan"); + lib.inpile.remove("hongshui"); + lib.inpile.remove("fulei"); + lib.inpile.add("honghuangzhili"); lib.inpile.sort(lib.sort.card); - for(var i=0;imin; - return game.hasPlayer(current=>{ - if(current==player||current==_status.currentPhase) return false; - if(!bool&¤t.countCards('h')==0) return false; - const history=current.getHistory('gain')[0]; - if(!history) return false; - if(event.name=='gain'){ - return history==event&&event.getlx!==false; - } - return history.getParent()==event; - }) - }, - content:function(){ - 'step 0' - event.targets=game.filterPlayer(function(current){ - if(current==player||current==_status.currentPhase) return false; - const history=current.getHistory('gain')[0]; - if(!history) return false; - if(trigger.name=='gain'){ - return history==trigger&&trigger.getlx!==false; - } - return history.getParent()==trigger; - }).sortBySeat(_status.currentPhase); - 'step 1' - var target=event.targets.shift(); - event.target=target; - if(target.isIn()){ - var list=[]; - var min=0; - if(!player.hasSkill('shanrangzhaoshu',null,false)) min+=get.sgn(player.getEquips('shanrangzhaoshu').length); - if(player.countCards('he')>min) list.push(`交给${get.translation(target)}一张牌`); - if(target.countCards('he')>0) list.push(`令${get.translation(target)}交给你一张牌`); - event.list=list; - if(list.length==0) event.goto(4); - else if(list.length==1) event._result={index:0}; - else player.chooseControl('cancel2').set('choiceList',list).set('prompt',get.prompt('shanrangzhaoshu',target)).set('ai',function(){ - if(get.attitude(_status.event.player,_status.event.getParent().target)<0) return 1; - return 'cancel2'; - }); - } - else event.goto(4); - 'step 2' - if(result.control=='cancel2'){ - event.goto(4); - return; - } - player.logSkill('shanrangzhaoshu',target); - if(event.list[result.index][0]=='令'){ - event.gainner=player; - event.giver=target; - target.chooseCard('he',true,`交给${get.translation(player)}一张牌`); - } - else{ - event.giver=player; - event.gainner=target; - player.chooseCard('he',true,`交给${get.translation(target)}一张牌`).set('filterCard',function(card,player){ - if(_status.event.ignoreCard) return true; - var cards=player.getEquips('shanrangzhaoshu'); - if(!cards.includes(card)) return true; - return cards.some(cardx=>(cardx!=card&&!ui.selected.cards.includes(cardx))); - }).set('ignoreCard',player.hasSkill('shanrangzhaoshu',null,false)); - } - 'step 3' - if(result.cards&&result.cards.length) event.giver.give(result.cards,event.gainner); - 'step 4' - if(targets.length>0) event.goto(1); - }, - }, - lingsheji:{ - trigger:{player:'phaseUseEnd'}, - equipSkill:true, - direct:true, - content:function(){ - 'step 0' - var list=['摸一张牌']; - if(player.countCards('he')>1) list.push('将一张牌置于武将牌上,于回合结束后获得之'); - player.chooseControl('cancel2').set('prompt',get.prompt('lingsheji')).set('choiceList',list).set('ai',function(){ - var player=_status.event.player; - if(player.countCards('e',function(card){ - return card.name!='tengjia'&&get.value(card)<=0; - })) return 1; - if(!player.needsToDiscard()) return 0; - return 1; - }); - 'step 1' - if(result.control=='cancel2'){ - event.finish();return; - } - player.logSkill('lingsheji'); - if(result.index==0){ - player.draw(); - event.finish(); - } - else{ - player.chooseCard('he',true,function(card,player){ - return card!=player.getEquip(5); - }).set('ai',function(card){ - if(get.position(card)=='e'&&get.value(card)<=0) return 10; - return (get.position(card)=='h'?2:1)*-get.value(card); - }); - } - 'step 2' - player.addSkill('lingsheji2'); - player.lose(result.cards,ui.special,'toStorage'); - player.markAuto('lingsheji2',result.cards); - }, - }, - lingsheji2:{ - trigger:{player:'phaseEnd'}, - equipSkill:true, - forced:true, - popup:false, - content:function(){ - player.gain(player.getStorage('lingsheji2'),'gain2','log'); - player.storage.lingsheji2.length=0; - player.removeSkill('lingsheji2'); - }, - intro:{content:'cards'}, - }, - noda_axe:{ - trigger:{player:'useCardToPlayered'}, - equipSkill:true, - direct:true, - filter:function(event,player){ - return player.isPhaseUsing()&&player!=event.target&&event.targets.length==1&&player.countCards('he')>2; - }, - content:function(){ - 'step 0' - 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.includes(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; - }); - 'step 1' - if(result.bool) trigger.target.addTempSkill('noda_axe2'); - }, - }, - noda_axe2:{ - equipSkill:true, - mod:{ - cardEnabled:function(){return false}, - cardSavable:function(){return false}, - cardRespondable:function(){return false}, - }, - mark:true, - intro:{ - content:'不能使用或打出牌且防具技能无效直到回合结束', - }, - ai:{unequip2:true}, - }, - iwasawa_crowbow:{ - equipSkill:true, - trigger:{ - player:'loseAfter', - global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'], - }, - direct:true, - filter:function(event,player){ - var evt=event.getl(player); - return evt&&evt.hs&&evt.hs.length>1&&player.isPhaseUsing(); - }, - content:function(){ - 'step 0' - var evt=trigger.getl(player); - event.num=evt.hs.length; - player.chooseTarget(get.prompt('iwasawa_crowbow'),'弃置一名其他角色的'+get.cnNumber(event.num)+'张牌',function(card,player,target){ - return player!=target&&target.countDiscardableCards(player,'he')>0; - }).set('ai',function(target){ - var att=get.attitude(_status.event.player,target); - if(target.countDiscardableCards(_status.event.player,'he')>=_status.event.getParent().num) att=att*2; - return -att; - }); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.logSkill('iwasawa_crowbow',target); - player.discardPlayerCard(target,'he',true,num); - } - }, - }, - boss_panguan:{ - mod:{ - targetEnabled:function(card){ - if(get.type(card)=='delay') return false; }, }, }, - boss_juhun:{ - trigger:{player:'phaseJieshuBegin'}, - forced:true, - content:function(){ - var list=game.filterPlayer(function(current){ - return current!=player; + thedayibecomeagod: { + trigger: { player: "die" }, + direct: true, + filter: function (event, player) { + return player.group == "shen"; + }, + forceDie: true, + skillAnimation: true, + animationColor: "kami", + content: function () { + "step 0"; + player + .chooseTarget(get.prompt2("thedayibecomeagod"), function (card, player, target) { + return target.isFriendOf(player); + }) + .set("forceDie", true).ai = function (target) { + return get.attitude(_status.event.player, target); + }; + "step 1"; + if (result.bool) { + var target = result.targets[0]; + event.target = target; + player.logSkill("thedayibecomeagod", target); + if (target.group != "shen") { + target.changeGroup("shen"); + game.log("此刻,便是", target, "成为神明之日!"); + event.finish(); + } else target.turnOver(false); + } else event.finish(); + "step 2"; + if (target.isDamaged()) target.recover(target.maxHp - target.hp); + "step 3"; + target.drawTo(5); + }, + }, + TheDayIBecomeAGod: { + trigger: { player: "useCard1" }, + ruleSkill: true, + popup: false, + forced: true, + prompt: "是否将此【杀】改为神属性?", + filter: function (event, player) { + return player.group == "shen" && event.card.name == "sha"; + }, + content: function () { + game.log(trigger.card, "被改为神属性"); + game.setNature(trigger.card, "kami"); + }, + }, + shanrangzhaoshu: { + trigger: { + global: ["gainEnd", "loseAsyncAfter"], + }, + direct: true, + filter: function (event, player) { + let min = 0; + if (!player.hasSkill("shanrangzhaoshu", null, false)) + min += get.sgn(player.getEquips("shanrangzhaoshu").length); + const bool = player.countCards("he") > min; + return game.hasPlayer((current) => { + if (current == player || current == _status.currentPhase) return false; + if (!bool && current.countCards("h") == 0) return false; + const history = current.getHistory("gain")[0]; + if (!history) return false; + if (event.name == "gain") { + return history == event && event.getlx !== false; + } + return history.getParent() == event; }); - if(list.length){ - var target=list.randomGet(); - player.line(target); - target[['turnOver','link'].randomGet()](); + }, + content: function () { + "step 0"; + event.targets = game + .filterPlayer(function (current) { + if (current == player || current == _status.currentPhase) return false; + const history = current.getHistory("gain")[0]; + if (!history) return false; + if (trigger.name == "gain") { + return history == trigger && trigger.getlx !== false; + } + return history.getParent() == trigger; + }) + .sortBySeat(_status.currentPhase); + "step 1"; + var target = event.targets.shift(); + event.target = target; + if (target.isIn()) { + var list = []; + var min = 0; + if (!player.hasSkill("shanrangzhaoshu", null, false)) + min += get.sgn(player.getEquips("shanrangzhaoshu").length); + if (player.countCards("he") > min) list.push(`交给${get.translation(target)}一张牌`); + if (target.countCards("he") > 0) + list.push(`令${get.translation(target)}交给你一张牌`); + event.list = list; + if (list.length == 0) event.goto(4); + else if (list.length == 1) event._result = { index: 0 }; + else + player + .chooseControl("cancel2") + .set("choiceList", list) + .set("prompt", get.prompt("shanrangzhaoshu", target)) + .set("ai", function () { + if ( + get.attitude(_status.event.player, _status.event.getParent().target) < + 0 + ) + return 1; + return "cancel2"; + }); + } else event.goto(4); + "step 2"; + if (result.control == "cancel2") { + event.goto(4); + return; + } + player.logSkill("shanrangzhaoshu", target); + if (event.list[result.index][0] == "令") { + event.gainner = player; + event.giver = target; + target.chooseCard("he", true, `交给${get.translation(player)}一张牌`); + } else { + event.giver = player; + event.gainner = target; + player + .chooseCard("he", true, `交给${get.translation(target)}一张牌`) + .set("filterCard", function (card, player) { + if (_status.event.ignoreCard) return true; + var cards = player.getEquips("shanrangzhaoshu"); + if (!cards.includes(card)) return true; + return cards.some( + (cardx) => cardx != card && !ui.selected.cards.includes(cardx) + ); + }) + .set("ignoreCard", player.hasSkill("shanrangzhaoshu", null, false)); + } + "step 3"; + if (result.cards && result.cards.length) event.giver.give(result.cards, event.gainner); + "step 4"; + if (targets.length > 0) event.goto(1); + }, + }, + lingsheji: { + trigger: { player: "phaseUseEnd" }, + equipSkill: true, + direct: true, + content: function () { + "step 0"; + var list = ["摸一张牌"]; + if (player.countCards("he") > 1) list.push("将一张牌置于武将牌上,于回合结束后获得之"); + player + .chooseControl("cancel2") + .set("prompt", get.prompt("lingsheji")) + .set("choiceList", list) + .set("ai", function () { + var player = _status.event.player; + if ( + player.countCards("e", function (card) { + return card.name != "tengjia" && get.value(card) <= 0; + }) + ) + return 1; + if (!player.needsToDiscard()) return 0; + return 1; + }); + "step 1"; + if (result.control == "cancel2") { + event.finish(); + return; + } + player.logSkill("lingsheji"); + if (result.index == 0) { + player.draw(); + event.finish(); + } else { + player + .chooseCard("he", true, function (card, player) { + return card != player.getEquip(5); + }) + .set("ai", function (card) { + if (get.position(card) == "e" && get.value(card) <= 0) return 10; + return (get.position(card) == "h" ? 2 : 1) * -get.value(card); + }); + } + "step 2"; + player.addSkill("lingsheji2"); + player.lose(result.cards, ui.special, "toStorage"); + player.markAuto("lingsheji2", result.cards); + }, + }, + lingsheji2: { + trigger: { player: "phaseEnd" }, + equipSkill: true, + forced: true, + popup: false, + content: function () { + player.gain(player.getStorage("lingsheji2"), "gain2", "log"); + player.storage.lingsheji2.length = 0; + player.removeSkill("lingsheji2"); + }, + intro: { content: "cards" }, + }, + noda_axe: { + trigger: { player: "useCardToPlayered" }, + equipSkill: true, + direct: true, + filter: function (event, player) { + return ( + player.isPhaseUsing() && + player != event.target && + event.targets.length == 1 && + player.countCards("he") > 2 + ); + }, + content: function () { + "step 0"; + 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.includes(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; + }); + "step 1"; + if (result.bool) trigger.target.addTempSkill("noda_axe2"); + }, + }, + noda_axe2: { + equipSkill: true, + mod: { + cardEnabled: function () { + return false; + }, + cardSavable: function () { + return false; + }, + cardRespondable: function () { + return false; + }, + }, + mark: true, + intro: { + content: "不能使用或打出牌且防具技能无效直到回合结束", + }, + ai: { unequip2: true }, + }, + iwasawa_crowbow: { + equipSkill: true, + trigger: { + player: "loseAfter", + global: [ + "equipAfter", + "addJudgeAfter", + "gainAfter", + "loseAsyncAfter", + "addToExpansionAfter", + ], + }, + direct: true, + filter: function (event, player) { + var evt = event.getl(player); + return evt && evt.hs && evt.hs.length > 1 && player.isPhaseUsing(); + }, + content: function () { + "step 0"; + var evt = trigger.getl(player); + event.num = evt.hs.length; + player + .chooseTarget( + get.prompt("iwasawa_crowbow"), + "弃置一名其他角色的" + get.cnNumber(event.num) + "张牌", + function (card, player, target) { + return player != target && target.countDiscardableCards(player, "he") > 0; + } + ) + .set("ai", function (target) { + var att = get.attitude(_status.event.player, target); + if ( + target.countDiscardableCards(_status.event.player, "he") >= + _status.event.getParent().num + ) + att = att * 2; + return -att; + }); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.logSkill("iwasawa_crowbow", target); + player.discardPlayerCard(target, "he", true, num); } }, }, - boss_wangxiang:{ - trigger:{player:'die'}, - forced:true, - forceDie:true, - content:function(){ - game.countPlayer(function(current){ - if(current!=player&¤t.countCards('e')){ + boss_panguan: { + mod: { + targetEnabled: function (card) { + if (get.type(card) == "delay") return false; + }, + }, + }, + boss_juhun: { + trigger: { player: "phaseJieshuBegin" }, + forced: true, + content: function () { + var list = game.filterPlayer(function (current) { + return current != player; + }); + if (list.length) { + var target = list.randomGet(); + player.line(target); + target[["turnOver", "link"].randomGet()](); + } + }, + }, + boss_wangxiang: { + trigger: { player: "die" }, + forced: true, + forceDie: true, + content: function () { + game.countPlayer(function (current) { + if (current != player && current.countCards("e")) { player.line(current); - current.discard(current.getCards('e')); + current.discard(current.getCards("e")); } }); }, }, - boss_xhuanren:{ - nobracket:true, - global:'boss_xhuanren2' + boss_xhuanren: { + nobracket: true, + global: "boss_xhuanren2", }, - boss_xhuanren2:{ - trigger:{player:'dieBegin'}, - forced:true, - priority:-10, - fixed:true, - globalFixed:true, - charlotte:true, - silent:true, - popup:false, - filter:function(event,player){ - if(lib.config.mode!='boss') return false; - if(_status.shidianyanluo_level==undefined) return false; - return player==game.boss; + boss_xhuanren2: { + trigger: { player: "dieBegin" }, + forced: true, + priority: -10, + fixed: true, + globalFixed: true, + charlotte: true, + silent: true, + popup: false, + filter: function (event, player) { + if (lib.config.mode != "boss") return false; + if (_status.shidianyanluo_level == undefined) return false; + return player == game.boss; }, - content:function(){ - var next=game.createEvent('shidianyanluo_huanren',false,trigger.getParent()); - next.player=player; - next.forceDie=true; + content: function () { + var next = game.createEvent("shidianyanluo_huanren", false, trigger.getParent()); + next.player = player; + next.forceDie = true; next.setContent(lib.skill.boss_xhuanren2.contentx); }, - contentx:function(){ - 'step 0' + contentx: function () { + "step 0"; game.delay(); - 'step 1' - var list=[ - ['boss_chujiangwang','boss_songdiwang','boss_wuguanwang','boss_yanluowang'], - ['boss_bianchengwang','boss_taishanwang','boss_dushiwang','boss_pingdengwang'], - ['boss_zhuanlunwang'], + "step 1"; + var list = [ + ["boss_chujiangwang", "boss_songdiwang", "boss_wuguanwang", "boss_yanluowang"], + ["boss_bianchengwang", "boss_taishanwang", "boss_dushiwang", "boss_pingdengwang"], + ["boss_zhuanlunwang"], ][_status.shidianyanluo_level]; - if(list.length==1) event._result={control:list[0]}; - else player.chooseControl(list).set('prompt','请选择下一个出战的角色').set('forceDie',true).ai=function(){ - return list.randomGet(); - }; - 'step 2' + if (list.length == 1) event._result = { control: list[0] }; + else + player + .chooseControl(list) + .set("prompt", "请选择下一个出战的角色") + .set("forceDie", true).ai = function () { + return list.randomGet(); + }; + "step 2"; _status.shidianyanluo_level++; game.changeBoss(result.control); - } + }, }, - boss_newhuanren:{ - nobracket:true, - global:'boss_newhuanren2', - trigger:{global:'gameStart'}, - popup:false, - forced:true, - superCharlotte:true, - charlotte:true, - fixed:true, - content:function(){ - if(get.mode()!='boss') return; + boss_newhuanren: { + nobracket: true, + global: "boss_newhuanren2", + trigger: { global: "gameStart" }, + popup: false, + forced: true, + superCharlotte: true, + charlotte: true, + fixed: true, + content: function () { + if (get.mode() != "boss") return; //孟婆 - if(!_status.shidianyanluo_mengpo&&Math.random()<=0.4){ - if(game.me!=game.boss){ + if (!_status.shidianyanluo_mengpo && Math.random() <= 0.4) { + if (game.me != game.boss) { game.boss.changeSeat(6); - } - else{ + } else { game.boss.nextSeat.changeSeat(3); game.boss.previousSeat.changeSeat(5); } // game.addBossFellow(game.me==game.boss?1:7,'boss_mengpo'); - var fellow=game.addFellow(game.me==game.boss?1:7,'boss_mengpo','zoominanim'); - if(_status.shidianyanluo_level!=0){ + var fellow = game.addFellow( + game.me == game.boss ? 1 : 7, + "boss_mengpo", + "zoominanim" + ); + if (_status.shidianyanluo_level != 0) { fellow.directgain(get.cards(4)); } - fellow.side=true; - fellow.identity='zhong'; - fellow.setIdentity('zhong'); - game.addVideo('setIdentity',fellow,'zhong'); - _status.shidianyanluo_mengpo=true; + fellow.side = true; + fellow.identity = "zhong"; + fellow.setIdentity("zhong"); + game.addVideo("setIdentity", fellow, "zhong"); + _status.shidianyanluo_mengpo = true; } - var list=['luxun','re_luxun','zhangchunhua','zuoci','re_zuoci','re_yuji','xin_yuji','jiangfei','kongrong'];//禁将 - game.countPlayer(function(current){ - if(current!=game.boss){ - for(var i=0;i0; + boss_gongzheng: { + trigger: { player: "phaseZhunbeiBegin" }, + forced: true, + filter: function (event, player) { + return player.countCards("j") > 0; }, - content:function(){ - player.discard(player.getCards('j').randomGet()) + content: function () { + player.discard(player.getCards("j").randomGet()); }, }, - boss_xuechi:{ - trigger:{player:'phaseJieshuBegin'}, - forced:true, - content:function(){ - var list=game.players.slice(0); + boss_xuechi: { + trigger: { player: "phaseJieshuBegin" }, + forced: true, + content: function () { + var list = game.players.slice(0); list.remove(player); - var target=list.randomGet(); + var target = list.randomGet(); player.line(target); target.loseHp(2); }, }, - boss_tiemian:{ - inherit:'renwang_skill', - priority:-0.3, - equipSkill:false, - filter:function(event,player){ - if(!player.hasEmptySlot(2)) return false; - return lib.skill.renwang_skill.filter.apply(this,arguments); + boss_tiemian: { + inherit: "renwang_skill", + priority: -0.3, + equipSkill: false, + filter: function (event, player) { + if (!player.hasEmptySlot(2)) return false; + return lib.skill.renwang_skill.filter.apply(this, arguments); }, }, - boss_zhadao:{ - inherit:'qinggang_skill', - equipSkill:false, + boss_zhadao: { + inherit: "qinggang_skill", + equipSkill: false, }, - boss_zhuxin:{ - trigger:{player:'die'}, - forceDie:true, - forced:true, - content:function(){ - 'step 0' - player.chooseTarget('【诛心】:请选择一名角色,令其受到2点伤害。',function(card,player,target){ - return target!=player&&!game.hasPlayer(function(current){ - return current!=player&¤t!=target&¤t.hp2; }, - content:function(){ - var list=game.players.slice(0); + }, + boss_fudu: { + trigger: { global: "useCard" }, + forced: true, + filter: function (event, player) { + return event.card.name == "tao" && event.player != player && game.players.length > 2; + }, + content: function () { + var list = game.players.slice(0); list.remove(player); list.remove(trigger.player); - var target=list.randomGet(); + var target = list.randomGet(); player.line(target); target.loseHp(); }, }, - boss_kujiu:{ - trigger:{global:'phaseZhunbeiBegin'}, - forced:true, - filter:function(event,player){ - return event.player!=player; + boss_kujiu: { + trigger: { global: "phaseZhunbeiBegin" }, + forced: true, + filter: function (event, player) { + return event.player != player; }, - logTarget:'player', - content:function(){ - 'step 0' + logTarget: "player", + content: function () { + "step 0"; trigger.player.loseHp(); - 'step 1' - trigger.player.useCard({name:'jiu'},trigger.player); + "step 1"; + trigger.player.useCard({ name: "jiu" }, trigger.player); }, }, - boss_renao:{ - trigger:{player:'die'}, - forceDie:true, - forced:true, - content:function(){ - var list=game.players.slice(0); + boss_renao: { + trigger: { player: "die" }, + forceDie: true, + forced: true, + content: function () { + var list = game.players.slice(0); list.remove(player); - if(list.length){ - var target=list.randomGet(); + if (list.length) { + var target = list.randomGet(); player.line(target); - target.damage(3,'fire'); + target.damage(3, "fire"); } - } - }, - boss_remen:{ - equipSkill:true, - trigger:{target:['useCardToBefore']}, - forced:true, - priority:6, - audio:true, - filter:function(event,player){ - if(!player.hasEmptySlot('equip2')) return false; - if(event.card.name=='nanman') return true; - if(event.card.name=='wanjian') return true; - return event.card.name=='sha'&&!game.hasNature(event.card); }, - content:function(){ + }, + boss_remen: { + equipSkill: true, + trigger: { target: ["useCardToBefore"] }, + forced: true, + priority: 6, + audio: true, + filter: function (event, player) { + if (!player.hasEmptySlot("equip2")) return false; + if (event.card.name == "nanman") return true; + if (event.card.name == "wanjian") return true; + return event.card.name == "sha" && !game.hasNature(event.card); + }, + content: function () { trigger.cancel(); }, - ai:{ - effect:{ - target:function(card,player,target,current){ - if(!target.hasEmptySlot('equip2')) return; - if(card.name=='nanman'||card.name=='wanjian') return 'zerotarget'; - if(card.name=='sha'){ - var equip1=player.getEquip(1); - if(equip1&&equip1.name=='zhuque') return 1.9; - if(!game.hasNature(card)) return 'zerotarget'; + ai: { + effect: { + target: function (card, player, target, current) { + if (!target.hasEmptySlot("equip2")) return; + if (card.name == "nanman" || card.name == "wanjian") return "zerotarget"; + if (card.name == "sha") { + var equip1 = player.getEquip(1); + if (equip1 && equip1.name == "zhuque") return 1.9; + if (!game.hasNature(card)) return "zerotarget"; } - } - } - } - }, - boss_zhifen:{ - trigger:{player:'phaseZhunbeiBegin'}, - forced:true, - content:function(){ - 'step 0' - var list=game.filterPlayer(); - list.remove(player); - if(list.length){ - var target=list.randomGet(); - player.line(target); - event.target=target; - if(target.countGainableCards(player,'h')) player.gainPlayerCard(target,'h',true); - } - else event.finish(); - 'step 1' - target.damage('fire'); - } - }, - - boss_huoxing:{ - trigger:{player:'die'}, - forceDie:true, - forced:true, - content:function(){ - var list=game.players.slice(0); - list.remove(player); - if(list.length){ - list.sort(lib.sort.seat); - player.line(list); - for(var i=0;icurrent.hp; - }); - }); - if(list.length){ - var target=list.randomGet() - player.line(target); - target.damage(2).nature=lib.linked.randomGet(); - } - else event.finish(); - 'step 1' - var list=game.filterPlayer(function(current){ - return current!=player&&!game.hasPlayer(function(current2){ - return current2.hp>current.hp; - }); - }); - if(list.length){ - var target=list.randomGet(); - player.line(target); - target.damage().nature=lib.linked.randomGet(); - } - }, - }, - boss_lunhui:{ - trigger:{player:'phaseZhunbeiBegin'}, - forced:true, - filter:function(event,player){ - return player.hp<=2&&game.hasPlayer(function(current){ - return current!=player&¤t.hp>2; - }); - }, - content:function(){ - var list=game.filterPlayer(function(current){ - return current!=player&¤t.hp>2; - }); - if(list.length){ - var target=list.randomGet(); - player.line(target); - var hp1=player.hp; - var hp2=target.hp; - player.hp=Math.min(player.maxHp,hp2); - target.hp=Math.min(target.maxHp,hp1); - player.update(); - target.update(); - game.log(player,'和',target,'交换了体力值') - } - }, - }, - boss_wangsheng:{ - trigger:{player:'phaseUseBegin'}, - forced:true, - content:function(){ - var name=['nanman','wanjian'].randomGet(); - player.useCard({name:name},game.filterPlayer(function(current){ - return player.canUse({name:name},current) - }),'noai'); - }, - }, - boss_zlfanshi:{ - trigger:{player:'damageEnd'}, - forced:true, - content:function(){ - if(player.hasSkill('boss_zlfanshi_terra')){ - var list=game.players.slice(0); - list.remove(player); - if(list.length){ - var target=list.randomGet(); - player.line(target); - target.damage(); - } - } - else player.addTempSkill('boss_zlfanshi_terra'); - }, - }, - boss_zlfanshi_terra:{charlotte:true}, - //孟婆: - "boss_shiyou":{ - audio:true, - trigger:{global:'loseAfter'}, - filter:function(event,player){ - var evt=event.getParent(3); - return event.type=='discard'&&evt.name=='phaseDiscard'&&evt.player==event.player&&evt.player!=player&&event.cards2&&event.cards2.filterInD('d').length>0; - }, - content:function(){ - "step 0" - event.cards=trigger.cards2.filterInD('d'); - "step 1" - var next=player.chooseCardButton(get.prompt('boss_shiyou'),event.cards,[1,event.cards.length]).set('ai',function(button){ - return get.value(button.link,player); - }).set('filterButton',function(button){ - for(var i=0;i current.hp; + }) + ); + }); + if (list.length) { + var target = list.randomGet(); + player.line(target); + target.damage(2).nature = lib.linked.randomGet(); + } else event.finish(); + "step 1"; + var list = game.filterPlayer(function (current) { + return ( + current != player && + !game.hasPlayer(function (current2) { + return current2.hp > current.hp; + }) + ); + }); + if (list.length) { + var target = list.randomGet(); + player.line(target); + target.damage().nature = lib.linked.randomGet(); + } + }, + }, + boss_lunhui: { + trigger: { player: "phaseZhunbeiBegin" }, + forced: true, + filter: function (event, player) { + return ( + player.hp <= 2 && + game.hasPlayer(function (current) { + return current != player && current.hp > 2; + }) + ); + }, + content: function () { + var list = game.filterPlayer(function (current) { + return current != player && current.hp > 2; + }); + if (list.length) { + var target = list.randomGet(); + player.line(target); + var hp1 = player.hp; + var hp2 = target.hp; + player.hp = Math.min(player.maxHp, hp2); + target.hp = Math.min(target.maxHp, hp1); + player.update(); + target.update(); + game.log(player, "和", target, "交换了体力值"); + } + }, + }, + boss_wangsheng: { + trigger: { player: "phaseUseBegin" }, + forced: true, + content: function () { + var name = ["nanman", "wanjian"].randomGet(); + player.useCard( + { name: name }, + game.filterPlayer(function (current) { + return player.canUse({ name: name }, current); + }), + "noai" + ); + }, + }, + boss_zlfanshi: { + trigger: { player: "damageEnd" }, + forced: true, + content: function () { + if (player.hasSkill("boss_zlfanshi_terra")) { + var list = game.players.slice(0); + list.remove(player); + if (list.length) { + var target = list.randomGet(); + player.line(target); + target.damage(); + } + } else player.addTempSkill("boss_zlfanshi_terra"); + }, + }, + boss_zlfanshi_terra: { charlotte: true }, + //孟婆: + boss_shiyou: { + audio: true, + trigger: { global: "loseAfter" }, + filter: function (event, player) { + var evt = event.getParent(3); + return ( + event.type == "discard" && + evt.name == "phaseDiscard" && + evt.player == event.player && + evt.player != player && + event.cards2 && + event.cards2.filterInD("d").length > 0 + ); + }, + content: function () { + "step 0"; + event.cards = trigger.cards2.filterInD("d"); + "step 1"; + var next = player + .chooseCardButton(get.prompt("boss_shiyou"), event.cards, [1, event.cards.length]) + .set("ai", function (button) { + return get.value(button.link, player); + }) + .set("filterButton", function (button) { + for (var i = 0; i < ui.selected.buttons.length; i++) { + if (get.suit(ui.selected.buttons[i].link) == get.suit(button.link)) + return false; + } + return true; + }); + "step 2"; + if (result.bool) { + player.gain(result.links, "gain2", "log"); + } + }, + }, + boss_wangshi: { + trigger: { global: "phaseZhunbeiBegin" }, + forced: true, + audio: true, + filter: function (event, player) { + if (player.getEnemies().includes(event.player)) { + return true; + } + return false; + }, + logTarget: "player", + content: function () { + var list = ["basic", "trick", "equip"].randomGet(); + trigger.player.addTempSkill("boss_wangshi2"); + trigger.player.storage.boss_wangshi2 = [list]; + game.log(trigger.player, "本回合不能使用或打出", list, "牌"); + trigger.player.markSkill("boss_wangshi2"); + }, + }, + boss_wangshi2: { + unique: true, + charlotte: true, + intro: { + content: function (storage) { + return "不能使用或打出" + get.translation(storage) + "牌"; + }, + }, + init: function (player, skill) { + if (!player.storage[skill]) player.storage[skill] = []; + }, + //mark:true, + onremove: true, + mod: { + cardEnabled2: function (card, player) { + if (player.storage.boss_wangshi2.includes(get.type(card, "trick"))) return false; + }, + }, + }, + boss_mengpohuihun1: { + mode: ["boss"], + trigger: { + player: "loseEnd", + global: "cardsDiscardEnd", + }, + filter: function (event, player) { + for (var i = 0; i < event.cards.length; i++) { + if ( + event.cards[i].name == "boss_mengpohuihun" && + get.position(event.cards[i], true) == "d" + ) { return true; } } return false; }, - forced:true, - popup:false, - content:function(){ - var cards=[]; - for(var i=0;i0){ - for(var x=0;x 0) { + for (var x = 0; x < list.length; x++) { + list[x].removeSkill("boss_wangshi2"); } - var ran1=list.randomGet();//第一个角色 - list.remove(ran1);//移除 - var skills1=ran1.getSkills(true,false); - if(skills1.length){ - for(var i=0;i0){ - skills1=skills1.randomGet(); - ran1.disableSkill('boss_wanghun',skills1); - game.log(ran1,'失去了',skills1); - } - else{ - game.log(ran1,'没有技能可失去'); + if (skills1.length > 0) { + skills1 = skills1.randomGet(); + ran1.disableSkill("boss_wanghun", skills1); + game.log(ran1, "失去了", skills1); + } else { + game.log(ran1, "没有技能可失去"); } } - if(list.length>0){ - var ran2=list.randomGet();//第二个角色 - list.remove(ran2);//移除 - var skills2=ran2.getSkills(true,false); - if(skills2.length){ - for(var i=0;i 0) { + var ran2 = list.randomGet(); //第二个角色 + list.remove(ran2); //移除 + var skills2 = ran2.getSkills(true, false); + if (skills2.length) { + for (var i = 0; i < skills2.length; i++) { + //排除技能,然后随机失去一个可以失去的技能 + if ( + get.skills[i] || + lib.skill[skills2[i]].charlotte || + !lib.translate[skills2[i] + "_info"] || + lib.skill[skills2[i]].zhuSkill == true + ) { + skills2.splice(i--, 1); } } - if(skills2.length>0){ - skills2=skills2.randomGet(); - ran2.disableSkill('boss_wanghun',skills2); - game.log(ran2,'失去了',skills2); - } - else{ - game.log(ran2,'没有技能可失去'); + if (skills2.length > 0) { + skills2 = skills2.randomGet(); + ran2.disableSkill("boss_wanghun", skills2); + game.log(ran2, "失去了", skills2); + } else { + game.log(ran2, "没有技能可失去"); } } } //添加两张回魂 - if(get.mode()=='boss'){ - var card1=game.createCard('boss_mengpohuihun','heart',3,null); - var card2=game.createCard('boss_mengpohuihun','club',4,null); - var a=[]; - if(ui.cardPile.childElementCount<3){ + if (get.mode() == "boss") { + var card1 = game.createCard("boss_mengpohuihun", "heart", 3, null); + var card2 = game.createCard("boss_mengpohuihun", "club", 4, null); + var a = []; + if (ui.cardPile.childElementCount < 3) { game.boss.getCards(4); } - for(var i=0;i1;} - return game.hasPlayer(function(target){ - return player!=target&&get.distance(player,target)<=1; + filter: function (event, player, name) { + if (name == "damageBegin4") { + return event.num && event.num > 1; + } + return game.hasPlayer(function (target) { + return player != target && get.distance(player, target) <= 1; }); }, - content:function(){ - var name=event.triggername; - if(name=='damageBegin4'){ + content: function () { + var name = event.triggername; + if (name == "damageBegin4") { trigger.num--; - } - else{ - game.countPlayer(function(target){ - if(player!=target&&get.distance(player,target)<=1){ - target.damage(1,player,'fire'); + } else { + game.countPlayer(function (target) { + if (player != target && get.distance(player, target) <= 1) { + target.damage(1, player, "fire"); } }); } }, }, - "boss_wuliang":{ - forced:true, - audio:true, - trigger:{ - global:"gameDrawAfter", - player:['phaseZhunbeiBegin','phaseJieshuBegin','enterGame'], + boss_wuliang: { + forced: true, + audio: true, + trigger: { + global: "gameDrawAfter", + player: ["phaseZhunbeiBegin", "phaseJieshuBegin", "enterGame"], }, - filter:function(event,player,name){ - if(name=='gameDrawAfter'||name=='enterGame'){ + filter: function (event, player, name) { + if (name == "gameDrawAfter" || name == "enterGame") { return true; - } - else if(name=='phaseZhunbeiBegin'){ - return player.hp<3; + } else if (name == "phaseZhunbeiBegin") { + return player.hp < 3; } return true; }, - content:function(){ - var name=event.triggername; - if(name=='phaseZhunbeiBegin'){ - player.recover(3-player.hp); - } - else{ - player.draw((name=='gameDrawAfter'||name=='enterGame')?3:2); + content: function () { + var name = event.triggername; + if (name == "phaseZhunbeiBegin") { + player.recover(3 - player.hp); + } else { + player.draw(name == "gameDrawAfter" || name == "enterGame" ? 3 : 2); } }, }, - "boss_dayuan":{ - trigger:{ - global:"judge", + boss_dayuan: { + trigger: { + global: "judge", }, - audio:true, - direct:true, - lastDo:true, - content:function (){ - 'step 0' - var card=trigger.player.judging[0]; - var judge0=trigger.judge(card); - var judge1=0; - var choice='cancel2'; - event.suitchoice='cancel2'; - var attitude=get.attitude(player,trigger.player); - var list=[]; - event.suitx=['heart','diamond','club','spade']; - for(var x=0;x<4;x++){ - for(var i=1;i<14;i++){ - list.add(i); - var judge2=(trigger.judge({ - name:get.name(card), - suit:event.suitx[x], - number:i, - nature:get.nature(card), - })-judge0)*attitude; - if(judge2>judge1){ - choice=i; - event.suitchoice=event.suitx[x]; - judge1=judge2; + audio: true, + direct: true, + lastDo: true, + content: function () { + "step 0"; + var card = trigger.player.judging[0]; + var judge0 = trigger.judge(card); + var judge1 = 0; + var choice = "cancel2"; + event.suitchoice = "cancel2"; + var attitude = get.attitude(player, trigger.player); + var list = []; + event.suitx = ["heart", "diamond", "club", "spade"]; + for (var x = 0; x < 4; x++) { + for (var i = 1; i < 14; i++) { + list.add(i); + var judge2 = + (trigger.judge({ + name: get.name(card), + suit: event.suitx[x], + number: i, + nature: get.nature(card), + }) - + judge0) * + attitude; + if (judge2 > judge1) { + choice = i; + event.suitchoice = event.suitx[x]; + judge1 = judge2; + } } } - } - list.push('cancel2'); - event.suitx.push('cancel2'); - player.chooseControl(list).set('ai',function(){ - return _status.event.choice; - }).set('choice',choice).prompt=get.prompt2(event.name); - 'step 1' - if(result.control!='cancel2'){ - if(!event.logged){ - event.logged=true; - player.logSkill(event.name,trigger.player); + list.push("cancel2"); + event.suitx.push("cancel2"); + player + .chooseControl(list) + .set("ai", function () { + return _status.event.choice; + }) + .set("choice", choice).prompt = get.prompt2(event.name); + "step 1"; + if (result.control != "cancel2") { + if (!event.logged) { + event.logged = true; + player.logSkill(event.name, trigger.player); + } + game.log(trigger.player, "判定结果点数为", "#g" + result.control); + player.popup(result.control, "fire"); + if (!trigger.fixedResult) trigger.fixedResult = {}; + trigger.fixedResult.number = result.control; } - game.log(trigger.player,'判定结果点数为','#g'+result.control); - player.popup(result.control,'fire'); - if(!trigger.fixedResult) trigger.fixedResult={}; - trigger.fixedResult.number=result.control; - } - player.chooseControl(event.suitx).set('ai',function(){ - return _status.event.choice; - }).set('choice',event.suitchoice).prompt=get.prompt2(event.name); - 'step 2' - if(result.control!='cancel2'){ - if(!event.logged){ - event.logged=true; - player.logSkill(event.name,trigger.player); + player + .chooseControl(event.suitx) + .set("ai", function () { + return _status.event.choice; + }) + .set("choice", event.suitchoice).prompt = get.prompt2(event.name); + "step 2"; + if (result.control != "cancel2") { + if (!event.logged) { + event.logged = true; + player.logSkill(event.name, trigger.player); + } + game.log(trigger.player, "判定结果花色为", "#g" + result.control); + player.popup(result.control, "fire"); + if (!trigger.fixedResult) trigger.fixedResult = {}; + trigger.fixedResult.suit = result.control; + if (result.control == "club" || result.control == "spade") { + trigger.fixedResult.color = "black"; + } else if (result.control == "heart" || result.control == "diamond") { + trigger.fixedResult.color = "red"; + } } - game.log(trigger.player,'判定结果花色为','#g'+result.control); - player.popup(result.control,'fire'); - if(!trigger.fixedResult) trigger.fixedResult={}; - trigger.fixedResult.suit=result.control; - if(result.control=='club'||result.control=='spade'){ - trigger.fixedResult.color='black'; - } - else if(result.control=='heart'||result.control=='diamond'){ - trigger.fixedResult.color='red'; - } - } }, }, - "boss_diting":{ - audio:true, - mod:{ - globalFrom:function (from,to,distance){ - return distance-1; + boss_diting: { + audio: true, + mod: { + globalFrom: function (from, to, distance) { + return distance - 1; }, - globalTo:function (from,to,distance){ - return distance+1; + globalTo: function (from, to, distance) { + return distance + 1; }, }, - enable:"phaseUse", - position:'h', - filter:function (event,player){ - return player.countCards('he',{subtype:['equip3','equip4','equip6']})>0; + enable: "phaseUse", + position: "h", + filter: function (event, player) { + return player.countCards("he", { subtype: ["equip3", "equip4", "equip6"] }) > 0; }, - filterCard:function (card){ - return get.subtype(card)=='equip3'||get.subtype(card)=='equip4'||get.subtype(card)=='equip6'; + filterCard: function (card) { + return ( + get.subtype(card) == "equip3" || + get.subtype(card) == "equip4" || + get.subtype(card) == "equip6" + ); }, - check:function (card){ - if(_status.event.player.isDisabled(get.subtype(card))) return 5; - return 3-get.value(card); + check: function (card) { + if (_status.event.player.isDisabled(get.subtype(card))) return 5; + return 3 - get.value(card); }, - content:function(){ + content: function () { player.draw(); }, - discard:false, - visible:true, - loseTo:'discardPile', - prompt:"将一张坐骑牌置入弃牌堆并摸一张牌", - delay:0.5, - prepare:function (cards,player){ - player.$throw(cards,1000); - game.log(player,'将',cards,'置入了弃牌堆'); + discard: false, + visible: true, + loseTo: "discardPile", + prompt: "将一张坐骑牌置入弃牌堆并摸一张牌", + delay: 0.5, + prepare: function (cards, player) { + player.$throw(cards, 1000); + game.log(player, "将", cards, "置入了弃牌堆"); }, - ai:{ - order:10, - result:{ - player:1, + ai: { + order: 10, + result: { + player: 1, }, }, - group:'boss_diting_init', - subSkill:{ - init:{ - trigger:{ - global:'gameStart', - player:'enterGame', + group: "boss_diting_init", + subSkill: { + init: { + trigger: { + global: "gameStart", + player: "enterGame", }, - forced:true, - filter:function(event,player){ - return player.hasEnabledSlot(3)||player.hasEnabledSlot(4); + forced: true, + filter: function (event, player) { + return player.hasEnabledSlot(3) || player.hasEnabledSlot(4); }, - content:function(){ - var disables=[]; - for(var i=3;i<=4;i++){ - for(var j=0;j0) player.disableEquip(disables); + if (disables.length > 0) player.disableEquip(disables); }, - } + }, }, }, /* @@ -3442,2351 +4158,2491 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, */ - "boss_jingjia":{}, - "boss_aozhan":{ - forced:true, - locked:true, - charlotte:true, - group:["boss_aozhan_wuqi","boss_aozhan_fangju","boss_aozhan_zuoji","boss_aozhan_baowu"], - subSkill:{ - wuqi:{ - mod:{ - cardUsable:function(card,player,num){ - if(player.getEquip(1)&&card.name=='sha') return num+1; + boss_jingjia: {}, + boss_aozhan: { + forced: true, + locked: true, + charlotte: true, + group: ["boss_aozhan_wuqi", "boss_aozhan_fangju", "boss_aozhan_zuoji", "boss_aozhan_baowu"], + subSkill: { + wuqi: { + mod: { + cardUsable: function (card, player, num) { + if (player.getEquip(1) && card.name == "sha") return num + 1; }, }, - sub:true, + sub: true, }, - fangju:{ - trigger:{ - player:"damageBegin4", + fangju: { + trigger: { + player: "damageBegin4", }, - forced:true, - filter:function (event,player){ - return player.getEquip(2)&&event.num>1; + forced: true, + filter: function (event, player) { + return player.getEquip(2) && event.num > 1; }, - content:function (){ - trigger.num=1; + content: function () { + trigger.num = 1; }, - sub:true, + sub: true, }, - zuoji:{ - trigger:{ - player:"phaseDrawBegin", + zuoji: { + trigger: { + player: "phaseDrawBegin", }, - forced:true, - filter:function (event,player){ - return (player.getEquip(3)||player.getEquip(4)); + forced: true, + filter: function (event, player) { + return player.getEquip(3) || player.getEquip(4); }, - content:function(){ + content: function () { trigger.num++; }, - sub:true, + sub: true, }, - baowu:{ - trigger:{ - player:"phaseJudgeBefore", + baowu: { + trigger: { + player: "phaseJudgeBefore", }, - forced:true, - filter:function (event,player){ + forced: true, + filter: function (event, player) { return player.getEquip(5); }, - content:function (){ + content: function () { trigger.cancel(); - game.log(player,'跳过了判定阶段'); + game.log(player, "跳过了判定阶段"); }, - sub:true, + sub: true, }, }, }, - boss_yaoshou:{ - mod:{ - globalFrom:function(from,to,distance){ - return distance-2; + boss_yaoshou: { + mod: { + globalFrom: function (from, to, distance) { + return distance - 2; }, }, }, - boss_duqu:{ - trigger:{player:'damageEnd'}, - filter:function(event,player){ - return event.source&&!event.source.hasSkill('boss_duqu'); + boss_duqu: { + trigger: { player: "damageEnd" }, + filter: function (event, player) { + return event.source && !event.source.hasSkill("boss_duqu"); }, - content:function(){ - var target=trigger.source; - if(!target.storage.boss_shedu) target.storage.boss_shedu=0; + content: function () { + var target = trigger.source; + if (!target.storage.boss_shedu) target.storage.boss_shedu = 0; target.storage.boss_shedu++; - target.markSkill('boss_shedu'); + target.markSkill("boss_shedu"); }, - forced:true, - global:'boss_shedu', - mod:{ - cardname:function (card,player){ - if(card.name=='tao') return 'sha'; + forced: true, + global: "boss_shedu", + mod: { + cardname: function (card, player) { + if (card.name == "tao") return "sha"; }, }, }, - boss_shedu:{ - trigger:{player:"phaseBegin"}, - mark:true, - intro:{content:'mark'}, - forced:true, - filter:function(event,player){ - return player.storage.boss_shedu&&player.storage.boss_shedu>0; + boss_shedu: { + trigger: { player: "phaseBegin" }, + mark: true, + intro: { content: "mark" }, + forced: true, + filter: function (event, player) { + return player.storage.boss_shedu && player.storage.boss_shedu > 0; }, - content:function(){ - 'step 0' - var num=player.storage.boss_shedu; - event.num=num; - var chs=get.cnNumber(num); - player.chooseToDiscard('he',num,'弃置'+chs+'张牌,或失去'+chs+'点体力').ai=function(card){ - return 12-get.value(card); - }; - 'step 1' - if(!result.bool) player.loseHp(num); + content: function () { + "step 0"; + var num = player.storage.boss_shedu; + event.num = num; + var chs = get.cnNumber(num); + player.chooseToDiscard("he", num, "弃置" + chs + "张牌,或失去" + chs + "点体力").ai = + function (card) { + return 12 - get.value(card); + }; + "step 1"; + if (!result.bool) player.loseHp(num); player.storage.boss_shedu--; - if(num>1) player.markSkill('boss_shedu'); - else player.unmarkSkill('boss_shedu'); + if (num > 1) player.markSkill("boss_shedu"); + else player.unmarkSkill("boss_shedu"); }, }, - boss_jiushou:{ - mod:{ - maxHandcard:function(player,num){ - return num-player.hp+9; + boss_jiushou: { + mod: { + maxHandcard: function (player, num) { + return num - player.hp + 9; }, }, - trigger:{player:['phaseUseBegin','phaseJieshuBegin','phaseDrawBegin']}, - forced:true, - filter:function(event,player){ - return event.name=='phaseDraw'||player.countCards('h')<9; + trigger: { player: ["phaseUseBegin", "phaseJieshuBegin", "phaseDrawBegin"] }, + forced: true, + filter: function (event, player) { + return event.name == "phaseDraw" || player.countCards("h") < 9; }, - content:function(){ - if(trigger.name=='phaseDraw') trigger.cancel(); - else player.draw(9-player.countCards('h')); + content: function () { + if (trigger.name == "phaseDraw") trigger.cancel(); + else player.draw(9 - player.countCards("h")); }, }, - boss_echou_switch:{ - unique:true, - charlotte:true, - group:['boss_echou_switch_on','boss_echou_switch_off'], - subSkill:{ - off:{ - trigger:{global:'gameStart'}, - content:function(){ - player.disableSkill('boss_echou_awake','boss_echou'); + boss_echou_switch: { + unique: true, + charlotte: true, + group: ["boss_echou_switch_on", "boss_echou_switch_off"], + subSkill: { + off: { + trigger: { global: "gameStart" }, + content: function () { + player.disableSkill("boss_echou_awake", "boss_echou"); }, - silent:true + silent: true, }, - on:{ - trigger:{player:'changeHp'}, - filter:function(event,player){ - return player.hp<=player.maxHp/2; + on: { + trigger: { player: "changeHp" }, + filter: function (event, player) { + return player.hp <= player.maxHp / 2; }, - forced:true, - skillAnimation:true, - animationColor:'thunder', - content:function(){ - player.enableSkill('boss_echou_awake'); - player.removeSkill('boss_echou_switch'); - } - } - } - }, - boss_echou:{ - trigger:{global:'useCard'}, - filter:function(event,player){ - return !event.player.hasSkill('boss_duqu')&&['tao','jiu'].includes(event.card.name); + forced: true, + skillAnimation: true, + animationColor: "thunder", + content: function () { + player.enableSkill("boss_echou_awake"); + player.removeSkill("boss_echou_switch"); + }, + }, }, - content:function(){ - var target=trigger.player; + }, + boss_echou: { + trigger: { global: "useCard" }, + filter: function (event, player) { + return !event.player.hasSkill("boss_duqu") && ["tao", "jiu"].includes(event.card.name); + }, + content: function () { + var target = trigger.player; player.line(target); - if(!target.storage.boss_shedu) target.storage.boss_shedu=0; + if (!target.storage.boss_shedu) target.storage.boss_shedu = 0; target.storage.boss_shedu++; - target.markSkill('boss_shedu'); + target.markSkill("boss_shedu"); }, }, - boss_bingxian:{ - trigger:{global:'phaseJieshuBegin'}, - filter:function(event,player){ - return event.player!=player&&event.player.countUsed('sha',true)==0; + boss_bingxian: { + trigger: { global: "phaseJieshuBegin" }, + filter: function (event, player) { + return event.player != player && event.player.countUsed("sha", true) == 0; }, - forced:true, - content:function(){ - player.useCard({name:'sha'},trigger.player); + forced: true, + content: function () { + player.useCard({ name: "sha" }, trigger.player); }, }, - boss_juyuan:{ - init:function(player,skill){ - player.storage[skill]=0; + boss_juyuan: { + init: function (player, skill) { + player.storage[skill] = 0; }, - trigger:{player:'phaseAfter'}, - forced:true, - silent:true, - popup:false, - content:function(){ - player.storage.boss_juyuan=player.hp; + trigger: { player: "phaseAfter" }, + forced: true, + silent: true, + popup: false, + content: function () { + player.storage.boss_juyuan = player.hp; }, - mod:{ - selectTarget:function (card,player,range){ - if(card.name!='sha') return; - if(range[1]==-1) return; - if(player.hp>=player.storage.boss_juyuan) return; - range[1]+=2; + mod: { + selectTarget: function (card, player, range) { + if (card.name != "sha") return; + if (range[1] == -1) return; + if (player.hp >= player.storage.boss_juyuan) return; + range[1] += 2; }, }, }, - boss_xushi_switch:{ - unique:true, - charlotte:true, - group:['boss_xushi_switch_on','boss_xushi_switch_off'], - subSkill:{ - off:{ - trigger:{global:'gameStart'}, - content:function(){ - player.disableSkill('boss_xushi_awake','boss_xushi'); + boss_xushi_switch: { + unique: true, + charlotte: true, + group: ["boss_xushi_switch_on", "boss_xushi_switch_off"], + subSkill: { + off: { + trigger: { global: "gameStart" }, + content: function () { + player.disableSkill("boss_xushi_awake", "boss_xushi"); }, - silent:true + silent: true, }, - on:{ - trigger:{player:'changeHp'}, - filter:function(event,player){ - return player.hp<=player.maxHp/2; + on: { + trigger: { player: "changeHp" }, + filter: function (event, player) { + return player.hp <= player.maxHp / 2; }, - forced:true, - skillAnimation:true, - animationColor:'thunder', - content:function(){ - player.enableSkill('boss_xushi_awake'); - player.removeSkill('boss_xushi_switch'); - } - } - } - }, - boss_xushi:{ - trigger:{player:['phaseUseEnd','turnOverEnd']}, - filter:function(event,player){ - return event.name=='phaseUse'||!player.isTurnedOver(); + forced: true, + skillAnimation: true, + animationColor: "thunder", + content: function () { + player.enableSkill("boss_xushi_awake"); + player.removeSkill("boss_xushi_switch"); + }, + }, }, - forced:true, - content:function(){ - 'step 0' - if(trigger.name=='phaseUse'){ + }, + boss_xushi: { + trigger: { player: ["phaseUseEnd", "turnOverEnd"] }, + filter: function (event, player) { + return event.name == "phaseUse" || !player.isTurnedOver(); + }, + forced: true, + content: function () { + "step 0"; + if (trigger.name == "phaseUse") { player.turnOver(); event.finish(); - } - else{ - event.list=game.filterPlayer(function(current){ - return current!=player; + } else { + event.list = game.filterPlayer(function (current) { + return current != player; }); event.list.sort(lib.sort.seat); - player.line(event.list,'green'); + player.line(event.list, "green"); } - 'step 1' - var target=event.list.shift(); - target.damage([1,2].randomGet()); - if(event.list.length) event.redo(); + "step 1"; + var target = event.list.shift(); + target.damage([1, 2].randomGet()); + if (event.list.length) event.redo(); }, }, - boss_zhaohuo:{ - trigger:{ - player:'damageBegin4', - source:'damageBegin1', + boss_zhaohuo: { + trigger: { + player: "damageBegin4", + source: "damageBegin1", }, - forced:true, - filter:function(event,player){ - if(player==event.player) return event.hasNature('fire')||player==event.source; + forced: true, + filter: function (event, player) { + if (player == event.player) return event.hasNature("fire") || player == event.source; return true; }, - content:function(){ - if(player==trigger.player) trigger.cancel(); - else game.setNature(trigger,'fire'); + content: function () { + if (player == trigger.player) trigger.cancel(); + else game.setNature(trigger, "fire"); }, - ai:{ - unequip:true, - skillTagFilter:function(player){ - if(player!=_status.currentPhase) return false; + ai: { + unequip: true, + skillTagFilter: function (player) { + if (player != _status.currentPhase) return false; }, }, }, - boss_honglianx:{ - mod:{ - ignoredHandcard:function (card,player){ - if(get.color(card)=='red'){ + boss_honglianx: { + mod: { + ignoredHandcard: function (card, player) { + if (get.color(card) == "red") { return true; } }, - cardDiscardable:function (card,player,name){ - if(name=='phaseDiscard'&&get.color(card)=='red') return false; + cardDiscardable: function (card, player, name) { + if (name == "phaseDiscard" && get.color(card) == "red") return false; }, }, - forced:true, - trigger:{player:'phaseZhunbeiBegin'}, - content:function(){ - 'step 0' - event.num1=3; - event.num2=[0,1,2,3].randomGet(); - event.togain=[]; - while(event.togain.lengthmin){ - list.splice(i--,1); + for (var i = 0; i < list.length; i++) { + if (list[i].hp > min) { + list.splice(i--, 1); } } - player.line(list,'green'); + player.line(list, "green"); list.sortBySeat(); - for(var i=0;i1; + group: "boss_lingqu_cancel", + subSkill: { + cancel: { + trigger: { player: "damageBegin4" }, + priority: -11, + forced: true, + filter: function (event) { + return event.num > 1; }, - content:function(){ - trigger.num=0; - } - } - } + content: function () { + trigger.num = 0; + }, + }, + }, }, - boss_baiyi:{ - group:['boss_baiyi_draw','boss_baiyi_thunder','boss_baiyi_discard'], - subSkill:{ - discard:{ - trigger:{global:'roundStart'}, - forced:true, - filter:function(){ - return game.roundNumber==5; + boss_baiyi: { + group: ["boss_baiyi_draw", "boss_baiyi_thunder", "boss_baiyi_discard"], + subSkill: { + discard: { + trigger: { global: "roundStart" }, + forced: true, + filter: function () { + return game.roundNumber == 5; }, - logTarget:function(event,player){ + logTarget: function (event, player) { return player.getEnemies(); }, - content:function(){ - 'step 0' - event.list=player.getEnemies(); - 'step 1' - if(event.list.length){ - event.list.shift().chooseToDiscard('he',true,2); + content: function () { + "step 0"; + event.list = player.getEnemies(); + "step 1"; + if (event.list.length) { + event.list.shift().chooseToDiscard("he", true, 2); event.redo(); } - } - }, - draw:{ - trigger:{global:'phaseDrawBegin'}, - forced:true, - filter:function(event,player){ - return game.roundNumber<3&&event.player.isEnemyOf(player); }, - content:function(){ - trigger.num-- - } }, - thunder:{ - trigger:{player:'damageBegin4'}, - filter:function(event){ - return event.hasNature('thunder')&&game.roundNumber<7; + draw: { + trigger: { global: "phaseDrawBegin" }, + forced: true, + filter: function (event, player) { + return game.roundNumber < 3 && event.player.isEnemyOf(player); }, - forced:true, - content:function(){ + content: function () { + trigger.num--; + }, + }, + thunder: { + trigger: { player: "damageBegin4" }, + filter: function (event) { + return event.hasNature("thunder") && game.roundNumber < 7; + }, + forced: true, + content: function () { trigger.cancel(); }, - ai:{ - nothunder:true, - skillTagFilter:function(){ - return game.roundNumber<7; + ai: { + nothunder: true, + skillTagFilter: function () { + return game.roundNumber < 7; }, - effect:{ - target:function(card,player,target,current){ - if(get.tag(card,'thunderDamage')&&game.roundNumber<7) return 0; - } - } - } - } - } + effect: { + target: function (card, player, target, current) { + if (get.tag(card, "thunderDamage") && game.roundNumber < 7) return 0; + }, + }, + }, + }, + }, }, - boss_qingzhu:{ - trigger:{player:'phaseDiscardBefore'}, - forced:true, - content:function(){ + boss_qingzhu: { + trigger: { player: "phaseDiscardBefore" }, + forced: true, + content: function () { trigger.cancel(); }, - mod:{ - cardEnabled:function(card,player){ - if(card.name=='sha'&&_status.currentPhase==player&& - _status.event.getParent('phaseUse')&&!player.hasSkill('boss_jiding')){ + mod: { + cardEnabled: function (card, player) { + if ( + card.name == "sha" && + _status.currentPhase == player && + _status.event.getParent("phaseUse") && + !player.hasSkill("boss_jiding") + ) { return false; } - } - } + }, + }, }, - boss_jiazu:{ - trigger:{player:'phaseZhunbeiBegin'}, - forced:true, - getTargets:function(player){ - var targets=[]; + boss_jiazu: { + trigger: { player: "phaseZhunbeiBegin" }, + forced: true, + getTargets: function (player) { + var targets = []; targets.add(player.getNext()); targets.add(player.getPrevious()); - var enemies=player.getEnemies(); - for(var i=0;i0; + filter: function (event, player) { + return lib.skill.boss_jiazu.getTargets(player).length > 0; }, - logTarget:function(event,player){ + logTarget: function (event, player) { return lib.skill.boss_jiazu.getTargets(player); }, - content:function(){ - 'step 0' - event.list=lib.skill.boss_jiazu.getTargets(player).sortBySeat(); - 'step 1' - if(event.list.length){ - var target=event.list.shift(); - var cards=target.getCards('e',function(card){ - var subtype=get.subtype(card); - return subtype=='equip3'||subtype=='equip4'; + content: function () { + "step 0"; + event.list = lib.skill.boss_jiazu.getTargets(player).sortBySeat(); + "step 1"; + if (event.list.length) { + var target = event.list.shift(); + var cards = target.getCards("e", function (card) { + var subtype = get.subtype(card); + return subtype == "equip3" || subtype == "equip4"; }); - if(cards.length){ + if (cards.length) { target.discard(cards); } event.redo(); } - } + }, }, - boss_jiding:{ - trigger:{global:'damageEnd'}, - forced:true, - mark:true, - intro:{ - content:'info' + boss_jiding: { + trigger: { global: "damageEnd" }, + forced: true, + mark: true, + intro: { + content: "info", }, - filter:function(event,player){ - return event.player!=player&&event.player.isFriendOf(player)&& - event.source&&event.source.isIn()&&event.source.isEnemyOf(player); + filter: function (event, player) { + return ( + event.player != player && + event.player.isFriendOf(player) && + event.source && + event.source.isIn() && + event.source.isEnemyOf(player) + ); }, - logTarget:'source', - content:function(){ - 'step 0' - player.useCard({name:'sha',nature:'thunder'},trigger.source); - 'step 1' - player.removeSkill('boss_jiding'); + logTarget: "source", + content: function () { + "step 0"; + player.useCard({ name: "sha", nature: "thunder" }, trigger.source); + "step 1"; + player.removeSkill("boss_jiding"); }, - group:'boss_jiding_recover', - subSkill:{ - recover:{ - trigger:{source:'damageEnd'}, - silent:true, - filter:function(event,player){ - return event.getParent(3).name=='boss_jiding'; + group: "boss_jiding_recover", + subSkill: { + recover: { + trigger: { source: "damageEnd" }, + silent: true, + filter: function (event, player) { + return event.getParent(3).name == "boss_jiding"; }, - content:function(){ - for(var i=0;i0&&dead[i].parentNode==player.parentNode){ + "step 2"; + game.addBossFellow(game.me == game.boss ? 1 : 5, "boss_yanling"); + game.addBossFellow(7, "boss_yanling"); + "step 3"; + var dnum = 0; + var dead = game.dead.slice(0); + for (var i = 0; i < dead.length; i++) { + if (!dead[i].side && dead[i].maxHp > 0 && dead[i].parentNode == player.parentNode) { dead[i].revive(dead[i].maxHp); dnum++; } } - for(var i=0;i0&&dead[i].parentNode==player.parentNode){ + "step 2"; + game.changeBoss("boss_huoshenzhurong", game.boss.previousSeat); + game.changeBoss("boss_yanling", game.boss.nextSeat); + "step 3"; + var dnum = 0; + var dead = game.dead.slice(0); + for (var i = 0; i < dead.length; i++) { + if (!dead[i].side && dead[i].maxHp > 0 && dead[i].parentNode == player.parentNode) { dead[i].revive(dead[i].maxHp); dnum++; } } - for(var i=0;i0&&dead[i].parentNode==player.parentNode){ + "step 2"; + game.addBossFellow(game.me == game.boss ? 1 : 5, "boss_shujing"); + game.addBossFellow(7, "boss_shujing"); + "step 3"; + var dnum = 0; + var dead = game.dead.slice(0); + for (var i = 0; i < dead.length; i++) { + if (!dead[i].side && dead[i].maxHp > 0 && dead[i].parentNode == player.parentNode) { dead[i].revive(dead[i].maxHp); dnum++; } } - for(var i=0;i0&&dead[i].parentNode==player.parentNode){ + "step 2"; + game.changeBoss("boss_mushengoumang", game.boss.previousSeat); + game.changeBoss("boss_shujing", game.boss.nextSeat); + "step 3"; + var dnum = 0; + var dead = game.dead.slice(0); + for (var i = 0; i < dead.length; i++) { + if (!dead[i].side && dead[i].maxHp > 0 && dead[i].parentNode == player.parentNode) { dead[i].revive(dead[i].maxHp); dnum++; } } - for(var i=0;i0&&dead[i].parentNode==player.parentNode){ + "step 2"; + game.addBossFellow(game.me == game.boss ? 1 : 7, "boss_shuishenxuanming"); + "step 3"; + var dnum = 0; + var dead = game.dead.slice(0); + for (var i = 0; i < dead.length; i++) { + if (!dead[i].side && dead[i].maxHp > 0 && dead[i].parentNode == player.parentNode) { dead[i].revive(dead[i].maxHp); dnum++; } } - for(var i=0;i0&&dead[i].parentNode==player.parentNode){ + "step 3"; + var dnum = 0; + var dead = game.dead.slice(0); + for (var i = 0; i < dead.length; i++) { + if (!dead[i].side && dead[i].maxHp > 0 && dead[i].parentNode == player.parentNode) { dead[i].revive(dead[i].maxHp); dnum++; } } - for(var i=0;i0&&dead[i].parentNode==player.parentNode){ + "step 2"; + game.addBossFellow(game.me == game.boss ? 1 : 5, "boss_mingxingzhu"); + game.addBossFellow(7, "boss_mingxingzhu"); + "step 3"; + var dnum = 0; + var dead = game.dead.slice(0); + for (var i = 0; i < dead.length; i++) { + if (!dead[i].side && dead[i].maxHp > 0 && dead[i].parentNode == player.parentNode) { dead[i].revive(dead[i].maxHp); dnum++; } } - for(var i=0;i0&&dead[i].parentNode==player.parentNode){ + "step 3"; + var dnum = 0; + var dead = game.dead.slice(0); + for (var i = 0; i < dead.length; i++) { + if (!dead[i].side && dead[i].maxHp > 0 && dead[i].parentNode == player.parentNode) { dead[i].revive(dead[i].maxHp); dnum++; } } - for(var i=0;i=2; + return ( + !player.storage.boss_xingxia || game.roundNumber - player.storage.boss_xingxia >= 2 + ); }, - unique:true, - filterTarget:function(card,player,target){ - return target.name=='boss_yanling'; + unique: true, + filterTarget: function (card, player, target) { + return target.name == "boss_yanling"; }, - selectTarget:-1, - line:'fire', - content:function(){ - target.damage(2,'fire'); + selectTarget: -1, + line: "fire", + content: function () { + target.damage(2, "fire"); }, - contentAfter:function(){ - 'step 0' - player.storage.boss_xingxia=game.roundNumber; - player.chooseTarget(function(card,player,target){ - return target.side!=player.side; - }).ai=function(target){ - return get.damageEffect(target,player,player,'fire'); - } - 'step 1' - if(result.bool){ - event.target=result.targets[0]; - player.line(event.target,'fire'); - event.target.chooseToDiscard('he',{color:'red'},'弃置一张红色牌或受到1点火焰伤害').ai=function(card){ - var player=_status.event.player; - var source=_status.event.parent.player; - if(get.damageEffect(player,source,player,'fire')>=0) return 0; - return 8-get.value(card); - } - } - else{ + contentAfter: function () { + "step 0"; + player.storage.boss_xingxia = game.roundNumber; + player.chooseTarget(function (card, player, target) { + return target.side != player.side; + }).ai = function (target) { + return get.damageEffect(target, player, player, "fire"); + }; + "step 1"; + if (result.bool) { + event.target = result.targets[0]; + player.line(event.target, "fire"); + event.target.chooseToDiscard( + "he", + { color: "red" }, + "弃置一张红色牌或受到1点火焰伤害" + ).ai = function (card) { + var player = _status.event.player; + var source = _status.event.parent.player; + if (get.damageEffect(player, source, player, "fire") >= 0) return 0; + return 8 - get.value(card); + }; + } else { event.finish(); } - 'step 2' - if(!result.bool){ - event.target.damage('fire'); + "step 2"; + if (!result.bool) { + event.target.damage("fire"); } }, - ai:{ - order:6, - result:{ - target:function(player,target){ - if(target.isLinked()&&player.isLinked()&&get.damageEffect(player,player,player,'fire')<0) return -1; + ai: { + order: 6, + result: { + target: function (player, target) { + if ( + target.isLinked() && + player.isLinked() && + get.damageEffect(player, player, player, "fire") < 0 + ) + return -1; return 1; - } - } - } - }, - boss_huihuo:{ - global:'boss_huihuo2', - unique:true, - mod:{ - cardUsable:function(card,player,num){ - if(card.name=='sha') return num+1; - } + }, + }, }, - ai:{ - revertsave:true, - effect:{ - target:function(card,player,target){ - if(!game.boss) return; - if(card.name=='tiesuo'){ - if(_status.event.player==game.boss) return 'zeroplayertarget'; + }, + boss_huihuo: { + global: "boss_huihuo2", + unique: true, + mod: { + cardUsable: function (card, player, num) { + if (card.name == "sha") return num + 1; + }, + }, + ai: { + revertsave: true, + effect: { + target: function (card, player, target) { + if (!game.boss) return; + if (card.name == "tiesuo") { + if (_status.event.player == game.boss) return "zeroplayertarget"; return 0.5; } - if(get.tag(card,'damage')||get.tag(card,'recover')){ - if(game.boss.isLinked()&&get.damageEffect(game.boss,player,game.boss,'fire')<0){ - if(game.hasPlayer(function(current){ - return current.isEnemyOf(game.boss)&¤t.isLinked(); - })){ + if (get.tag(card, "damage") || get.tag(card, "recover")) { + if ( + game.boss.isLinked() && + get.damageEffect(game.boss, player, game.boss, "fire") < 0 + ) { + if ( + game.hasPlayer(function (current) { + return current.isEnemyOf(game.boss) && current.isLinked(); + }) + ) { return; } - if(get.tag(card,'natureDamage')&&target.isLinked()){ + if (get.tag(card, "natureDamage") && target.isLinked()) { return; } } - if(target.isDying()){ - if(player.isEnemyOf(target)&&player.hp>=-1) return [0,0,0,1]; - return 'zeroplayertarget'; + if (target.isDying()) { + if (player.isEnemyOf(target) && player.hp >= -1) return [0, 0, 0, 1]; + return "zeroplayertarget"; } return -0.5; } - } - } - } - }, - boss_huihuo2:{ - trigger:{global:'dieAfter'}, - forced:true, - globalFixed:true, - unique:true, - filter:function(event,player){ - return event.player.hasSkill('boss_huihuo')&&event.player.isDead()&&player.isEnemyOf(event.player); + }, + }, }, - content:function(){ - trigger.player.line(player,'fire'); - player.damage('nosource','fire',3).animate=false; + }, + boss_huihuo2: { + trigger: { global: "dieAfter" }, + forced: true, + globalFixed: true, + unique: true, + filter: function (event, player) { + return ( + event.player.hasSkill("boss_huihuo") && + event.player.isDead() && + player.isEnemyOf(event.player) + ); + }, + content: function () { + trigger.player.line(player, "fire"); + player.damage("nosource", "fire", 3).animate = false; player.$damage(trigger.player); - player.$damagepop(-3,'fire'); - if(lib.config.animation&&!lib.config.low_performance){ + player.$damagepop(-3, "fire"); + if (lib.config.animation && !lib.config.low_performance) { player.$fire(); } - if(!event.parent.parent.boss_huihuo_logv){ - event.parent.parent.boss_huihuo_logv=true; - game.logv(trigger.player,'boss_huihuo',game.filterPlayer(),event.parent.parent); + if (!event.parent.parent.boss_huihuo_logv) { + event.parent.parent.boss_huihuo_logv = true; + game.logv(trigger.player, "boss_huihuo", game.filterPlayer(), event.parent.parent); } - } - }, - boss_furan:{ - unique:true, - global:'boss_furan2' - }, - boss_furan2:{ - enable:'chooseToUse', - filter:function(event,player){ - return event.type=='dying'&&event.dying.hasSkill('boss_furan')&&player.isEnemyOf(event.dying); }, - filterCard:function(card){ - return get.color(card)=='red'; + }, + boss_furan: { + unique: true, + global: "boss_furan2", + }, + boss_furan2: { + enable: "chooseToUse", + filter: function (event, player) { + return ( + event.type == "dying" && + event.dying.hasSkill("boss_furan") && + player.isEnemyOf(event.dying) + ); }, - position:'he', - viewAs:{name:'tao'}, - prompt:'将一张红色牌当桃使用', - check:function(card){return 8-get.value(card)}, - ai:{ - order:5, - skillTagFilter:function(player){ - var event=_status.event; - if(event.dying&&event.dying.hasSkill('boss_furan')&&player.isEnemyOf(event.dying)){ - return player.countCards('he',{color:'red'})>0&&_status.currentPhase!=player; - } - else{ + filterCard: function (card) { + return get.color(card) == "red"; + }, + position: "he", + viewAs: { name: "tao" }, + prompt: "将一张红色牌当桃使用", + check: function (card) { + return 8 - get.value(card); + }, + ai: { + order: 5, + skillTagFilter: function (player) { + var event = _status.event; + if ( + event.dying && + event.dying.hasSkill("boss_furan") && + player.isEnemyOf(event.dying) + ) { + return ( + player.countCards("he", { color: "red" }) > 0 && + _status.currentPhase != player + ); + } else { return false; } }, - save:true, - } - }, - boss_chiyi:{ - trigger:{player:'phaseZhunbeiBegin'}, - forced:true, - unique:true, - filter:function(event,player){ - return [3,5,7].includes(game.roundNumber); + save: true, }, - content:function(){ - 'step 0' - if(game.roundNumber==3){ - var enemies=game.filterPlayer(function(current){ + }, + boss_chiyi: { + trigger: { player: "phaseZhunbeiBegin" }, + forced: true, + unique: true, + filter: function (event, player) { + return [3, 5, 7].includes(game.roundNumber); + }, + content: function () { + "step 0"; + if (game.roundNumber == 3) { + var enemies = game.filterPlayer(function (current) { return current.isEnemyOf(player); }); - player.line(enemies,'green'); - for(var i=0;i=2){ - for(var i=0;i= 2 + ) { + for (var i = 0; i < game.dead.length; i++) { + if ( + game.dead[i].parentNode == player.parentNode && + game.dead[i].name == "boss_shujing" + ) { return true; } } } return false; }, - content:function(){ - 'step 0' + content: function () { + "step 0"; player.loseHp(); - player.storage.boss_buchun=game.roundNumber; - 'step 1' - event.targets=[]; - var dead=game.dead.slice(0); - for(var i=0;i=3) return 1; - if(player.hp>=2&&player!=game.boss) return 1; - if(game.hasPlayer(function(current){ - return current.name=='boss_shujing'; - })){ + if (player.hp >= 3) return 1; + if (player.hp >= 2 && player != game.boss) return 1; + if ( + game.hasPlayer(function (current) { + return current.name == "boss_shujing"; + }) + ) { return 0; } return 1; - } - } - } + }, + }, + }, }, - recover:{ - enable:'phaseUse', - filter:function(event,player){ - if(!player.storage.boss_buchun||game.roundNumber-player.storage.boss_buchun>=2){ - for(var i=0;i= 2 + ) { + for (var i = 0; i < game.dead.length; i++) { + if ( + game.dead[i].parentNode == player.parentNode && + game.dead[i].name == "boss_shujing" + ) { return false; } } @@ -5794,337 +6650,364 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } return false; }, - prompt:'令一名己方角色回复2点体力', - filterTarget:function(card,player,target){ - return target.isFriendOf(player)&&target.isDamaged(); + prompt: "令一名己方角色回复2点体力", + filterTarget: function (card, player, target) { + return target.isFriendOf(player) && target.isDamaged(); }, - content:function(){ + content: function () { target.recover(2); - player.storage.boss_buchun=game.roundNumber; + player.storage.boss_buchun = game.roundNumber; }, - ai:{ - order:6, - result:{ - target:function(player,target){ - var num=1; - if(target.maxHp-target.hp>=2){ - num=1.5; + ai: { + order: 6, + result: { + target: function (player, target) { + var num = 1; + if (target.maxHp - target.hp >= 2) { + num = 1.5; } - return 1.5*get.recoverEffect(target,player,target); - } - } - } - } - } - }, - boss_cuidu:{ - trigger:{source:'damageEnd'}, - forced:true, - unique:true, - filter:function(event,player){ - if(event._notrigger.includes(event.player)) return false; - return event.player.isIn()&&event.player.isEnemyOf(player)&&!event.player.hasSkill('boss_zhongdu'); + return 1.5 * get.recoverEffect(target, player, target); + }, + }, + }, + }, }, - logTarget:'player', - content:function(){ - trigger.player.addSkill('boss_zhongdu'); - var boss=game.findPlayer(function(current){ - return current.name=='boss_mushengoumang'; + }, + boss_cuidu: { + trigger: { source: "damageEnd" }, + forced: true, + unique: true, + filter: function (event, player) { + if (event._notrigger.includes(event.player)) return false; + return ( + event.player.isIn() && + event.player.isEnemyOf(player) && + !event.player.hasSkill("boss_zhongdu") + ); + }, + logTarget: "player", + content: function () { + trigger.player.addSkill("boss_zhongdu"); + var boss = game.findPlayer(function (current) { + return current.name == "boss_mushengoumang"; }); - if(boss){ + if (boss) { boss.draw(); } - } - }, - boss_zhongdu:{ - trigger:{player:'phaseZhunbeiBegin'}, - forced:true, - mark:true, - nopop:true, - temp:true, - intro:{ - content:'锁定技,回合开始时,你进行判定,若结果不为红桃,你受到1点无来源的伤害,若结果不为黑桃,你失去此技能' }, - content:function(){ - 'step 0' - player.judge(function(card){ - var suit=get.suit(card); - if(suit=='spade') return -1; - if(suit=='heart') return 1; + }, + boss_zhongdu: { + trigger: { player: "phaseZhunbeiBegin" }, + forced: true, + mark: true, + nopop: true, + temp: true, + intro: { + content: + "锁定技,回合开始时,你进行判定,若结果不为红桃,你受到1点无来源的伤害,若结果不为黑桃,你失去此技能", + }, + content: function () { + "step 0"; + player.judge(function (card) { + var suit = get.suit(card); + if (suit == "spade") return -1; + if (suit == "heart") return 1; return 0; }); - 'step 1' - if(result.suit!='heart'){ - player.damage('nosource'); + "step 1"; + if (result.suit != "heart") { + player.damage("nosource"); } - if(result.suit!='spade'){ - player.removeSkill('boss_zhongdu'); + if (result.suit != "spade") { + player.removeSkill("boss_zhongdu"); } - } - }, - boss_qingyi:{ - trigger:{player:'phaseZhunbeiBegin'}, - forced:true, - unique:true, - filter:function(event,player){ - return [3,5,7].includes(game.roundNumber); }, - content:function(){ - 'step 0' - if(game.roundNumber==7){ - var goumang,shujing; - for(var i=0;i=0){ - if(att1+att2>0){ - return '选项二'; + var rand = Math.random() < 0.5 ? "选项一" : "选项二"; + var sourcename = get.translation(trigger.source); + var playername = get.translation(trigger.player); + player + .chooseControl("选项一", "选项二", "cancel2", function () { + if (att1 == 0 && att2 == 0) return rand; + if (att1 * att2 >= 0) { + if (att1 + att2 > 0) { + return "选项二"; + } else { + return "选项一"; + } + } else { + if (trigger.player.isHealthy() && trigger.source.isHealthy()) return rand; + if (trigger.player.isHealthy()) { + if (att1 < 0) return "选项二"; + if (att1 > 0 && !stop) return "选项一"; + } + if (trigger.source.isHealthy()) { + if (att2 < 0) return "选项二"; + if (att2 > 0 && !stop) return "选项一"; + } + if (stop) return "cancel2"; + return rand; } - else{ - return '选项一'; - } - } - else{ - if(trigger.player.isHealthy()&&trigger.source.isHealthy()) return rand; - if(trigger.player.isHealthy()){ - if(att1<0) return '选项二'; - if(att1>0&&!stop) return '选项一'; - } - if(trigger.source.isHealthy()){ - if(att2<0) return '选项二'; - if(att2>0&&!stop) return '选项一'; - } - if(stop) return 'cancel2'; - return rand; - } - }).set('prompt',get.prompt('boss_yuance')).set('choiceList',[ - '若判定结果为黑色,'+playername+'失去1点体力,否则'+sourcename+'失去1点体力', - '若判定结果为红色,'+playername+'回复1点体力,否则'+sourcename+'回复1点体力' - ]); - 'step 1' - var att1=get.attitude(player,trigger.player); - var att2=get.attitude(player,trigger.source); - if(result.control=='选项一'){ - event.type=1; - player.judge(function(card){ - if(get.color(card)=='black'){ - if(att1>0) return -1; - if(att1<0) return 1; - } - else{ - if(att2>0) return -1; - if(att2<0) return 1; + }) + .set("prompt", get.prompt("boss_yuance")) + .set("choiceList", [ + "若判定结果为黑色," + + playername + + "失去1点体力,否则" + + sourcename + + "失去1点体力", + "若判定结果为红色," + + playername + + "回复1点体力,否则" + + sourcename + + "回复1点体力", + ]); + "step 1"; + var att1 = get.attitude(player, trigger.player); + var att2 = get.attitude(player, trigger.source); + if (result.control == "选项一") { + event.type = 1; + player.judge(function (card) { + if (get.color(card) == "black") { + if (att1 > 0) return -1; + if (att1 < 0) return 1; + } else { + if (att2 > 0) return -1; + if (att2 < 0) return 1; } return 0; }); - } - else if(result.control=='选项二'){ - event.type=2; - player.judge(function(card){ - if(get.color(card)=='red'){ - if(trigger.player.isDamaged()){ - if(att1>0) return 1; - if(att1<0) return -1; + } else if (result.control == "选项二") { + event.type = 2; + player.judge(function (card) { + if (get.color(card) == "red") { + if (trigger.player.isDamaged()) { + if (att1 > 0) return 1; + if (att1 < 0) return -1; } - } - else{ - if(trigger.source.isDamaged()){ - if(att2>0) return 1; - if(att2<0) return -1; + } else { + if (trigger.source.isDamaged()) { + if (att2 > 0) return 1; + if (att2 < 0) return -1; } } return 0; }); - } - else{ + } else { event.finish(); } - 'step 2' - if(event.type==1){ - if(result.color=='black'){ + "step 2"; + if (event.type == 1) { + if (result.color == "black") { trigger.player.loseHp(); - } - else{ + } else { trigger.source.loseHp(); } - } - else{ - if(result.color=='red'){ + } else { + if (result.color == "red") { trigger.player.recover(); - } - else{ + } else { trigger.source.recover(); } } - } - }, - boss_guixin:{ - trigger:{global:'drawAfter'}, - forced:true, - logTarget:'player', - filter:function(event,player){ - return event.result&&event.result.length>=2&&event.player!=player; }, - content:function(){ - 'step 0' - trigger.player.chooseCard(function(card){ - return trigger.result.includes(card); - },'归心:交给'+get.translation(player)+'一张牌',true); - 'step 1' - if(result.bool){ - player.gain(result.cards,trigger.player); - trigger.player.$give(1,player); - } - } }, - xiongcai:{ - unique:true, - trigger:{player:'phaseAfter'}, - direct:true, - init:function(player){ - player.storage.xiongcai=[]; + boss_guixin: { + trigger: { global: "drawAfter" }, + forced: true, + logTarget: "player", + filter: function (event, player) { + return event.result && event.result.length >= 2 && event.player != player; + }, + content: function () { + "step 0"; + trigger.player.chooseCard( + function (card) { + return trigger.result.includes(card); + }, + "归心:交给" + get.translation(player) + "一张牌", + true + ); + "step 1"; + if (result.bool) { + player.gain(result.cards, trigger.player); + trigger.player.$give(1, player); + } + }, + }, + xiongcai: { + unique: true, + trigger: { player: "phaseAfter" }, + direct: true, + init: function (player) { + player.storage.xiongcai = []; // player.storage.xiongcai2=0; }, - intro:{ - content:'characters' + intro: { + content: "characters", }, - content:function(){ - 'step 0' + content: function () { + "step 0"; // if(player.storage.xiongcai2<1){ // player.storage.xiongcai2++; // event.finish(); @@ -6132,1580 +7015,1637 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ // else{ // player.storage.xiongcai2=0; // } - 'step 1' - player.logSkill('xiongcai'); - var list=[]; - var list2=[]; - var players=game.players.concat(game.dead); - for(var i=0;i'+get.translation(player)+'发动了【雄才】',[[name],'character']); + event.dialog = ui.create.dialog( + '
' + get.translation(player) + "发动了【雄才】", + [[name], "character"] + ); game.delay(2); - 'step 2' + "step 2"; event.dialog.close(); - } + }, }, - xiaoxiong:{ - trigger:{global:'useCardAfter'}, - forced:true, - unique:true, - forceunique:true, - filter:function(event,player){ - var type=get.type(event.card,'trick'); - return event.player!=player&&(type=='basic'||type=='trick'); + xiaoxiong: { + trigger: { global: "useCardAfter" }, + forced: true, + unique: true, + forceunique: true, + filter: function (event, player) { + var type = get.type(event.card, "trick"); + return event.player != player && (type == "basic" || type == "trick"); }, - content:function(){ - player.gain(game.createCard(trigger.card),'gain2'); + content: function () { + player.gain(game.createCard(trigger.card), "gain2"); }, - group:'xiaoxiong_damage', - subSkill:{ - damage:{ - trigger:{global:'phaseJieshuBegin'}, - forced:true, - filter:function(event,player){ - return event.player!=player&&event.player.countUsed()==0; + group: "xiaoxiong_damage", + subSkill: { + damage: { + trigger: { global: "phaseJieshuBegin" }, + forced: true, + filter: function (event, player) { + return event.player != player && event.player.countUsed() == 0; }, - logTarget:'player', - content:function(){ + logTarget: "player", + content: function () { trigger.player.damage(); - } - } - } + }, + }, + }, }, - boss_zhangwu:{ - global:'boss_zhangwu_ai', - trigger:{player:'damageEnd'}, - check:function(event,player){ - return event.source&&event.source.isIn()&&get.damageEffect(event.source,player,player)>0; + boss_zhangwu: { + global: "boss_zhangwu_ai", + trigger: { player: "damageEnd" }, + check: function (event, player) { + return ( + event.source && + event.source.isIn() && + get.damageEffect(event.source, player, player) > 0 + ); }, - filter:function(event){ - return event.source&&event.source.isAlive(); + filter: function (event) { + return event.source && event.source.isAlive(); }, - direct:true, - logTarget:'source', - content:function(){ - 'step 0' - player.chooseToDiscard(get.prompt('boss_zhangwu',trigger.source),'he',[1,Infinity]).set('ai',function(card){ - if(get.attitude(player,target)<0) return 8-get.value(card); - return 0; - }).set('logSkill',['boss_zhangwu',trigger.source]); - 'step 1' - if(result.bool){ - var num=result.cards.length; - var cnum=get.cnNumber(num); - event.num=num; - trigger.source.chooseToDiscard('he','章武:弃置'+cnum+'张牌,或取消并受到'+cnum+'点伤害',num).set('ai',function(card){ - if(!trigger.source.hasSkillTag('nodamage')) return 10-get.value(card); + direct: true, + logTarget: "source", + content: function () { + "step 0"; + player + .chooseToDiscard(get.prompt("boss_zhangwu", trigger.source), "he", [1, Infinity]) + .set("ai", function (card) { + if (get.attitude(player, target) < 0) return 8 - get.value(card); return 0; - }); - } - else{ + }) + .set("logSkill", ["boss_zhangwu", trigger.source]); + "step 1"; + if (result.bool) { + var num = result.cards.length; + var cnum = get.cnNumber(num); + event.num = num; + trigger.source + .chooseToDiscard( + "he", + "章武:弃置" + cnum + "张牌,或取消并受到" + cnum + "点伤害", + num + ) + .set("ai", function (card) { + if (!trigger.source.hasSkillTag("nodamage")) return 10 - get.value(card); + return 0; + }); + } else { event.finish(); } - 'step 2' - if(!result.bool){ + "step 2"; + if (!result.bool) { trigger.source.damage(event.num); } }, - ai:{ - maixie:true, - maixie_hp:true, - effect:{ - target:function(card,player,target){ - if(get.tag(card,'damage')&&get.attitude(target,player)<0&&player.countCards('he')=4; + x3: function (player, event) { + return game.hasPlayer(function (current) { + return current != player && current.countCards("e") >= 4; }); }, - x2:function(player){ - return player.countCards('j')>=2; + x2: function (player) { + return player.countCards("j") >= 2; + }, + x1: function () { + return game.players.length == 2; }, - x1:function(){ - return game.players.length==2; - } }, }, - xiangxing:{ - unique:true, - init:function(player){ - player.storage.xiangxing=7; - player.storage.xiangxing_count=0; - player.addSkill('xiangxing7'); + xiangxing: { + unique: true, + init: function (player) { + player.storage.xiangxing = 7; + player.storage.xiangxing_count = 0; + player.addSkill("xiangxing7"); }, - mark:true, - intro:{ - content:'当前有#枚星' + mark: true, + intro: { + content: "当前有#枚星", }, - trigger:{player:['damageEnd','loseHpEnd']}, - forced:true, - popup:false, - content:function(){ - 'step 0' - var num=trigger.num; - if(num){ - player.storage.xiangxing_count+=num; + trigger: { player: ["damageEnd", "loseHpEnd"] }, + forced: true, + popup: false, + content: function () { + "step 0"; + var num = trigger.num; + if (num) { + player.storage.xiangxing_count += num; } - if(player.storage.xiangxing_count>=7){ - if(player.hasSkill('yueyin')&&lib.skill.yueyin.skipDamage['x'+player.storage.xiangxing](player,trigger)){ + if (player.storage.xiangxing_count >= 7) { + if ( + player.hasSkill("yueyin") && + lib.skill.yueyin.skipDamage["x" + player.storage.xiangxing](player, trigger) + ) { event.goto(3); } - player.removeSkill('xiangxing'+player.storage.xiangxing); + player.removeSkill("xiangxing" + player.storage.xiangxing); player.storage.xiangxing--; - player.storage.xiangxing_count=0; + player.storage.xiangxing_count = 0; player.updateMarks(); - if(player.storage.xiangxing){ - player.addSkill('xiangxing'+player.storage.xiangxing); + if (player.storage.xiangxing) { + player.addSkill("xiangxing" + player.storage.xiangxing); + } else { + player.awakenSkill("xiangxing"); } - else{ - player.awakenSkill('xiangxing'); - } - player.popup('xiangxing'); - game.log(player,'失去了一枚星'); - } - else{ + player.popup("xiangxing"); + game.log(player, "失去了一枚星"); + } else { player.updateMarks(); event.finish(); } - 'step 1' - var list=game.filterPlayer(); + "step 1"; + var list = game.filterPlayer(); list.remove(player); list.sort(lib.sort.seat); - var list2=[]; - for(var i=0;i0){ - return 1+trigger.judge(button.link); + gaiming: { + trigger: { player: "judgeBefore" }, + direct: true, + priority: 1, + unique: true, + content: function () { + "step 0"; + event.cards = get.cards(7); + player.chooseCardButton( + true, + event.cards, + "改命:选择一张牌作为你的" + trigger.judgestr + "判定结果" + ).ai = function (button) { + if (get.attitude(player, trigger.player) > 0) { + return 1 + trigger.judge(button.link); } - if(get.attitude(player,trigger.player)<0){ - return 1-trigger.judge(button.link); + if (get.attitude(player, trigger.player) < 0) { + return 1 - trigger.judge(button.link); } return 0; }; - "step 1" - if(!result.bool){ + "step 1"; + if (!result.bool) { event.finish(); return; } - player.logSkill('gaiming',trigger.player); - var card=result.links[0]; + player.logSkill("gaiming", trigger.player); + var card = result.links[0]; event.cards.remove(card); - var judgestr=get.translation(trigger.player)+'的'+trigger.judgestr+'判定'; - event.videoId=lib.status.videoId++; - event.dialog=ui.create.dialog(judgestr); - event.dialog.classList.add('center'); - event.dialog.videoId=event.videoId; + var judgestr = get.translation(trigger.player) + "的" + trigger.judgestr + "判定"; + event.videoId = lib.status.videoId++; + event.dialog = ui.create.dialog(judgestr); + event.dialog.classList.add("center"); + event.dialog.videoId = event.videoId; - game.addVideo('judge1',player,[get.cardInfo(card),judgestr,event.videoId]); - for(var i=0;i0){ - trigger.result.bool=true; - trigger.player.popup('改命成功'); + if (trigger.result.judge > 0) { + trigger.result.bool = true; + trigger.player.popup("改命成功"); } - if(trigger.result.judge<0){ - trigger.result.bool=false; - trigger.player.popup('改命失败'); + if (trigger.result.judge < 0) { + trigger.result.bool = false; + trigger.player.popup("改命失败"); } - game.log(trigger.player,'的判定结果为',card); - trigger.direct=true; + game.log(trigger.player, "的判定结果为", card); + trigger.direct = true; trigger.position.appendChild(card); game.delay(2); - } - else{ + } else { event.finish(); } - "step 2" - ui.arena.classList.remove('thrownhighlight'); + "step 2"; + ui.arena.classList.remove("thrownhighlight"); event.dialog.close(); - game.addVideo('judge2',null,event.videoId); + game.addVideo("judge2", null, event.videoId); ui.clear(); - var card=trigger.result.card; + var card = trigger.result.card; trigger.position.appendChild(card); trigger.result.node.delete(); game.delay(); }, }, - tiandao:{ - audio:true, - trigger:{global:'judge'}, - direct:true, - filter:function(event,player){ - return player.countCards('he')>0; + tiandao: { + audio: true, + trigger: { global: "judge" }, + direct: true, + filter: function (event, player) { + return player.countCards("he") > 0; }, - content:function(){ - "step 0" - player.chooseCard(get.translation(trigger.player)+'的'+(trigger.judgestr||'')+'判定为'+ - get.translation(trigger.player.judging[0])+','+get.prompt('tiandao'),'he').ai=function(card){ - var trigger=_status.event.parent._trigger; - var player=_status.event.player; - var result=trigger.judge(card)-trigger.judge(trigger.player.judging[0]); - var attitude=get.attitude(player,trigger.player); - if(attitude==0||result==0) return 0; - if(attitude>0){ + content: function () { + "step 0"; + player.chooseCard( + get.translation(trigger.player) + + "的" + + (trigger.judgestr || "") + + "判定为" + + get.translation(trigger.player.judging[0]) + + "," + + get.prompt("tiandao"), + "he" + ).ai = function (card) { + var trigger = _status.event.parent._trigger; + var player = _status.event.player; + var result = trigger.judge(card) - trigger.judge(trigger.player.judging[0]); + var attitude = get.attitude(player, trigger.player); + if (attitude == 0 || result == 0) return 0; + if (attitude > 0) { return result; - } - else{ + } else { return -result; } }; - "step 1" - if(result.bool){ - player.respond(result.cards,'highlight'); - } - else{ + "step 1"; + if (result.bool) { + player.respond(result.cards, "highlight"); + } else { event.finish(); } - "step 2" - if(result.bool){ - player.logSkill('tiandao'); + "step 2"; + if (result.bool) { + player.logSkill("tiandao"); player.$gain2(trigger.player.judging[0]); player.gain(trigger.player.judging[0]); - trigger.player.judging[0]=result.cards[0]; + trigger.player.judging[0] = result.cards[0]; trigger.position.appendChild(result.cards[0]); - game.log(trigger.player,'的判定牌改为',result.cards[0]); + game.log(trigger.player, "的判定牌改为", result.cards[0]); } - "step 3" + "step 3"; game.delay(2); }, - ai:{ - tag:{ - rejudge:1 + ai: { + tag: { + rejudge: 1, }, - threaten:1.5 - } + threaten: 1.5, + }, }, - lianji:{ - audio:true, - enable:'phaseUse', - usable:1, - filterTarget:function(card,player,target){ - if(player==target) return false; - return target.countCards('h')>0; + lianji: { + audio: true, + enable: "phaseUse", + usable: 1, + filterTarget: function (card, player, target) { + if (player == target) return false; + return target.countCards("h") > 0; }, - selectTarget:2, - multitarget:true, - multiline:true, - filter:function(event,player){ - return player.countCards('h')>0; + selectTarget: 2, + multitarget: true, + multiline: true, + filter: function (event, player) { + return player.countCards("h") > 0; }, - prepare:'throw', - discard:false, - filterCard:true, - check:function(card){ - return 6-get.value(card); + prepare: "throw", + discard: false, + filterCard: true, + check: function (card) { + return 6 - get.value(card); }, - content:function(){ - "step 0" - if(targets[0].countCards('h')&&targets[1].countCards('h')){ + content: function () { + "step 0"; + if (targets[0].countCards("h") && targets[1].countCards("h")) { targets[0].chooseToCompare(targets[1]); - } - else{ + } else { event.finish(); } - "step 1" - if(result.bool){ + "step 1"; + if (result.bool) { targets[0].gain(cards); targets[0].$gain2(cards); targets[1].damage(targets[0]); - } - else{ + } else { targets[1].gain(cards); targets[1].$gain2(cards); targets[0].damage(targets[1]); } }, - ai:{ - expose:0.3, - threaten:2, - order:9, - result:{ - target:-1 - } + ai: { + expose: 0.3, + threaten: 2, + order: 9, + result: { + target: -1, + }, }, }, - mazui:{ - audio:true, - enable:'phaseUse', - usable:1, - filterCard:{color:'black'}, - filterTarget:function(card,player,target){ - return !target.hasSkill('mazui2'); + mazui: { + audio: true, + enable: "phaseUse", + usable: 1, + filterCard: { color: "black" }, + filterTarget: function (card, player, target) { + return !target.hasSkill("mazui2"); }, - check:function(card){ - return 6-get.value(card); + check: function (card) { + return 6 - get.value(card); }, - discard:false, - prepare:'give', - content:function(){ - target.storage.mazui2=cards[0]; - target.addSkill('mazui2'); - game.addVideo('storage',target,['mazui2',get.cardInfo(target.storage.mazui2),'card']); + discard: false, + prepare: "give", + content: function () { + target.storage.mazui2 = cards[0]; + target.addSkill("mazui2"); + game.addVideo("storage", target, ["mazui2", get.cardInfo(target.storage.mazui2), "card"]); }, - ai:{ - expose:0.2, - result:{ - target:function(player,target){ + ai: { + expose: 0.2, + result: { + target: function (player, target) { return -target.hp; - } + }, }, - order:4, - threaten:1.2 - } - }, - mazui2:{ - trigger:{source:'damageBegin1'}, - forced:true, - mark:'card', - filter:function(event){ - return event.num>0; + order: 4, + threaten: 1.2, }, - content:function(){ + }, + mazui2: { + trigger: { source: "damageBegin1" }, + forced: true, + mark: "card", + filter: function (event) { + return event.num > 0; + }, + content: function () { trigger.num--; - player.addSkill('mazui3'); - player.removeSkill('mazui2'); + player.addSkill("mazui3"); + player.removeSkill("mazui2"); + }, + intro: { + content: "card", }, - intro:{ - content:'card' - } }, - mazui3:{ - trigger:{source:['damageEnd','damageZero']}, - forced:true, - popup:false, - content:function(){ - player.gain(player.storage.mazui2,'gain2'); - game.log(player,'获得了',player.storage.mazui2); - player.removeSkill('mazui3'); + mazui3: { + trigger: { source: ["damageEnd", "damageZero"] }, + forced: true, + popup: false, + content: function () { + player.gain(player.storage.mazui2, "gain2"); + game.log(player, "获得了", player.storage.mazui2); + player.removeSkill("mazui3"); delete player.storage.mazui2; - } + }, }, - yunshen:{ - trigger:{player:['respond','useCard']}, - filter:function(event,player){ - return event.card.name=='shan'; + yunshen: { + trigger: { player: ["respond", "useCard"] }, + filter: function (event, player) { + return event.card.name == "shan"; }, - frequent:true, - init:function(player){ - player.storage.yunshen=0; + frequent: true, + init: function (player) { + player.storage.yunshen = 0; }, - content:function(){ + content: function () { player.storage.yunshen++; - player.markSkill('yunshen'); + player.markSkill("yunshen"); }, - ai:{ - effect:{ - target:function(card,player,target){ - if(get.tag(card,'respondShan')){ - var shans=target.countCards('h','shan'); - var hs=target.countCards('h'); - if(shans>1) return [1,1]; - if(shans&&hs>2) return [1,1]; - if(shans) return [1,0.5]; - if(hs>2) return [1,0.3]; - if(hs>1) return [1,0.2]; - return [1.2,0]; + ai: { + effect: { + target: function (card, player, target) { + if (get.tag(card, "respondShan")) { + var shans = target.countCards("h", "shan"); + var hs = target.countCards("h"); + if (shans > 1) return [1, 1]; + if (shans && hs > 2) return [1, 1]; + if (shans) return [1, 0.5]; + if (hs > 2) return [1, 0.3]; + if (hs > 1) return [1, 0.2]; + return [1.2, 0]; } - } + }, }, - threaten:0.8 + threaten: 0.8, }, - intro:{ - content:'mark' + intro: { + content: "mark", }, - group:'yunshen2' + group: "yunshen2", }, - yunshen2:{ - trigger:{player:'phaseZhunbeiBegin'}, - forced:true, - filter:function(event,player){ - return player.storage.yunshen>0; + yunshen2: { + trigger: { player: "phaseZhunbeiBegin" }, + forced: true, + filter: function (event, player) { + return player.storage.yunshen > 0; }, - content:function(){ + content: function () { player.draw(player.storage.yunshen); - player.storage.yunshen=0; - player.unmarkSkill('yunshen'); + player.storage.yunshen = 0; + player.unmarkSkill("yunshen"); + }, + mod: { + globalTo: function (from, to, distance) { + if (typeof to.storage.yunshen == "number") return distance + to.storage.yunshen; + }, }, - mod:{ - globalTo:function(from,to,distance){ - if(typeof to.storage.yunshen=='number') return distance+to.storage.yunshen; - } - } }, - lingbo:{ - audio:2, - trigger:{player:['respond','useCard']}, - filter:function(event,player){ - return event.card.name=='shan'; + lingbo: { + audio: 2, + trigger: { player: ["respond", "useCard"] }, + filter: function (event, player) { + return event.card.name == "shan"; }, - frequent:true, - content:function(){ + frequent: true, + content: function () { player.draw(2); }, - ai:{ - mingzhi:false, - effect:{ - target:function(card,player,target){ - if(get.tag(card,'respondShan')){ - var shans=target.countCards('h','shan'); - var hs=target.countCards('h'); - if(shans>1) return [0,1]; - if(shans&&hs>2) return [0,1]; - if(shans) return [0,0]; - if(hs>2) return [0,0]; - if(hs>1) return [1,0.5]; - return [1.5,0]; + ai: { + mingzhi: false, + effect: { + target: function (card, player, target) { + if (get.tag(card, "respondShan")) { + var shans = target.countCards("h", "shan"); + var hs = target.countCards("h"); + if (shans > 1) return [0, 1]; + if (shans && hs > 2) return [0, 1]; + if (shans) return [0, 0]; + if (hs > 2) return [0, 0]; + if (hs > 1) return [1, 0.5]; + return [1.5, 0]; } - } + }, }, - threaten:0.8 - } - }, - jiaoxia:{ - audio:2, - trigger:{target:'useCardToTargeted'}, - filter:function(event,player){ - return event.card&&get.color(event.card)=='red'; + threaten: 0.8, }, - frequent:true, - content:function(){ + }, + jiaoxia: { + audio: 2, + trigger: { target: "useCardToTargeted" }, + filter: function (event, player) { + return event.card && get.color(event.card) == "red"; + }, + frequent: true, + content: function () { player.draw(); }, - ai:{ - effect:function(card,player,target){ - if(get.color(card)=='red') return [1,1]; + ai: { + effect: function (card, player, target) { + if (get.color(card) == "red") return [1, 1]; }, - } - }, - boss_nbianshenx:{}, - boss_jingjue:{ - inherit:'boss_danshu' - }, - boss_renxing:{ - trigger:{global:['damageEnd','recoverEnd']}, - forced:true, - filter:function(event,player){ - return _status.currentPhase!=player; }, - content:function(){ + }, + boss_nbianshenx: {}, + boss_jingjue: { + inherit: "boss_danshu", + }, + boss_renxing: { + trigger: { global: ["damageEnd", "recoverEnd"] }, + forced: true, + filter: function (event, player) { + return _status.currentPhase != player; + }, + content: function () { player.draw(); - } - }, - boss_ruizhi:{ - trigger:{global:'phaseZhunbeiBegin'}, - forced:true, - filter:function(event,player){ - return event.player!=player&&(event.player.countCards('h')>1||event.player.countCards('e')>1); }, - content:function(){ - 'step 0' - player.line(trigger.player,'green'); - var next=trigger.player.chooseCard(true,'选择保留一张手牌和一张装备区内的牌,然后弃置其它牌','he',function(card){ - switch(get.position(card)){ - case 'h':{ - if(ui.selected.cards.length){ - return get.position(ui.selected.cards[0])=='e'; + }, + boss_ruizhi: { + trigger: { global: "phaseZhunbeiBegin" }, + forced: true, + filter: function (event, player) { + return ( + event.player != player && + (event.player.countCards("h") > 1 || event.player.countCards("e") > 1) + ); + }, + content: function () { + "step 0"; + player.line(trigger.player, "green"); + var next = trigger.player.chooseCard( + true, + "选择保留一张手牌和一张装备区内的牌,然后弃置其它牌", + "he", + function (card) { + switch (get.position(card)) { + case "h": { + if (ui.selected.cards.length) { + return get.position(ui.selected.cards[0]) == "e"; + } else { + return trigger.player.countCards("h") > 1; + } } - else{ - return trigger.player.countCards('h')>1; - } - } - case 'e':{ - if(ui.selected.cards.length){ - return get.position(ui.selected.cards[0])=='h'; - } - else{ - return trigger.player.countCards('e')>1; + case "e": { + if (ui.selected.cards.length) { + return get.position(ui.selected.cards[0]) == "h"; + } else { + return trigger.player.countCards("e") > 1; + } } } } - }); - var num=0; - if(trigger.player.countCards('h')>1){ + ); + var num = 0; + if (trigger.player.countCards("h") > 1) { num++; } - if(trigger.player.countCards('e')>1){ + if (trigger.player.countCards("e") > 1) { num++; } - next.selectCard=[num,num]; - next.ai=function(card){ + next.selectCard = [num, num]; + next.ai = function (card) { return get.value(card); }; - 'step 1' - if(result.bool){ - var he=[]; - var hs=trigger.player.getCards('h'); - var es=trigger.player.getCards('e'); - if(hs.length>1){ - he=he.concat(hs); + "step 1"; + if (result.bool) { + var he = []; + var hs = trigger.player.getCards("h"); + var es = trigger.player.getCards("e"); + if (hs.length > 1) { + he = he.concat(hs); } - if(es.length>1){ - he=he.concat(es); + if (es.length > 1) { + he = he.concat(es); } - for(var i=0;i4){ - trigger.num=4+Math.floor(Math.random()*(player.hp-3)); - } - else{ - trigger.num=4; + boss_nbaonu: { + group: ["boss_nbaonu_sha"], + trigger: { player: "phaseDrawBegin" }, + forced: true, + priority: -1, + content: function () { + if (player.hp > 4) { + trigger.num = 4 + Math.floor(Math.random() * (player.hp - 3)); + } else { + trigger.num = 4; } }, - subSkill:{ - sha:{ - mod:{ - cardUsable:function(card,player,num){ - if(card.name=='sha'&&player.hp<5) return Infinity; - } + subSkill: { + sha: { + mod: { + cardUsable: function (card, player, num) { + if (card.name == "sha" && player.hp < 5) return Infinity; + }, }, - trigger:{source:'damageBegin1'}, - filter:function(event,player){ - return event.card&&event.card.name=='sha'&&event.notLink()&&player.hp<5; + trigger: { source: "damageBegin1" }, + filter: function (event, player) { + return event.card && event.card.name == "sha" && event.notLink() && player.hp < 5; }, - forced:true, - content:function(){ + forced: true, + content: function () { trigger.num++; - } - } - } - }, - boss_shouyi:{ - mod:{ - targetInRange:function(){ - return true; - } + }, + }, }, }, - boss_mengtai:{ - group:['boss_mengtai_begin','boss_mengtai_draw','boss_mengtai_use', - 'boss_mengtai_discard','boss_mengtai_end'], - subSkill:{ - begin:{ - trigger:{player:'phaseZhunbeiBegin'}, - forced:true, - popup:false, - content:function(){ - player.storage.boss_mengtai_draw=true; - player.storage.boss_mengtai_use=true; - } + boss_shouyi: { + mod: { + targetInRange: function () { + return true; }, - draw:{ - trigger:{player:'phaseDrawBegin'}, - forced:true, - popup:false, - content:function(){ - player.storage.boss_mengtai_draw=false; - } - }, - use:{ - trigger:{player:'phaseUseBegin'}, - forced:true, - popup:false, - content:function(){ - player.storage.boss_mengtai_use=false; - } - }, - discard:{ - trigger:{player:'phaseDiscardBefore'}, - forced:true, - filter:function(event,player){ - if(player.storage.boss_mengtai_use) return true; - return false; - }, - content:function(){ - trigger.cancel(); - } - }, - end:{ - trigger:{player:'phaseJieshuBegin'}, - forced:true, - filter:function(event,player){ - if(player.storage.boss_mengtai_draw) return true; - return false; - }, - content:function(){ - player.draw(3); - } - } - } + }, }, - boss_nbianshen:{ - trigger:{player:'phaseBefore'}, - forced:true, - popup:false, - priority:25, - fixed:true, - filter:function(event,player){ - if(player.name=='boss_nianshou_heti'||player.storage.boss_nbianshen) return true; + boss_mengtai: { + group: [ + "boss_mengtai_begin", + "boss_mengtai_draw", + "boss_mengtai_use", + "boss_mengtai_discard", + "boss_mengtai_end", + ], + subSkill: { + begin: { + trigger: { player: "phaseZhunbeiBegin" }, + forced: true, + popup: false, + content: function () { + player.storage.boss_mengtai_draw = true; + player.storage.boss_mengtai_use = true; + }, + }, + draw: { + trigger: { player: "phaseDrawBegin" }, + forced: true, + popup: false, + content: function () { + player.storage.boss_mengtai_draw = false; + }, + }, + use: { + trigger: { player: "phaseUseBegin" }, + forced: true, + popup: false, + content: function () { + player.storage.boss_mengtai_use = false; + }, + }, + discard: { + trigger: { player: "phaseDiscardBefore" }, + forced: true, + filter: function (event, player) { + if (player.storage.boss_mengtai_use) return true; + return false; + }, + content: function () { + trigger.cancel(); + }, + }, + end: { + trigger: { player: "phaseJieshuBegin" }, + forced: true, + filter: function (event, player) { + if (player.storage.boss_mengtai_draw) return true; + return false; + }, + content: function () { + player.draw(3); + }, + }, + }, + }, + boss_nbianshen: { + trigger: { player: "phaseBefore" }, + forced: true, + popup: false, + priority: 25, + fixed: true, + filter: function (event, player) { + if (player.name == "boss_nianshou_heti" || player.storage.boss_nbianshen) return true; return false; }, - content:function(){ - if(player.storage.boss_nbianshen){ - var hp=player.hp, - maxHp=player.maxHp, - hujia=player.hujia; - player.init('boss_nianshou_'+player.storage.boss_nbianshen_next); + content: function () { + if (player.storage.boss_nbianshen) { + var hp = player.hp, + maxHp = player.maxHp, + hujia = player.hujia; + player.init("boss_nianshou_" + player.storage.boss_nbianshen_next); player.storage.boss_nbianshen.remove(player.storage.boss_nbianshen_next); - if(!player.storage.boss_nbianshen.length){ - player.storage.boss_nbianshen=['jingjue','renxing','ruizhi','baonu']; + if (!player.storage.boss_nbianshen.length) { + player.storage.boss_nbianshen = ["jingjue", "renxing", "ruizhi", "baonu"]; } - player.storage.boss_nbianshen_next=player.storage.boss_nbianshen.randomGet(player.storage.boss_nbianshen_next); - player.hp=hp; - player.maxHp=maxHp; - player.hujia=hujia; + player.storage.boss_nbianshen_next = player.storage.boss_nbianshen.randomGet( + player.storage.boss_nbianshen_next + ); + player.hp = hp; + player.maxHp = maxHp; + player.hujia = hujia; player.update(); - } - else{ - player.storage.boss_nbianshen=['jingjue','renxing','ruizhi','baonu']; - player.storage.boss_nbianshen_next=player.storage.boss_nbianshen.randomGet(); - player.markSkill('boss_nbianshen'); + } else { + player.storage.boss_nbianshen = ["jingjue", "renxing", "ruizhi", "baonu"]; + player.storage.boss_nbianshen_next = player.storage.boss_nbianshen.randomGet(); + player.markSkill("boss_nbianshen"); } }, - intro:{ - content:function(storage,player){ - var map={ - jingjue:'警觉', - renxing:'任性', - ruizhi:'睿智', - baonu:'暴怒' + intro: { + content: function (storage, player) { + var map = { + jingjue: "警觉", + renxing: "任性", + ruizhi: "睿智", + baonu: "暴怒", }; - return '下一个状态:'+map[player.storage.boss_nbianshen_next]; - } - } - }, - boss_damagecount:{ - mode:['boss'], - global:'boss_damagecount2' - }, - boss_damagecount2:{ - trigger:{source:'damageEnd'}, - silent:true, - filter:function(event,player){ - if(!ui.damageCount) return false; - return event.num>0&&player.isFriendOf(game.me)&&event.player.isEnemyOf(game.me); + return "下一个状态:" + map[player.storage.boss_nbianshen_next]; + }, }, - content:function(){ - _status.damageCount+=trigger.num; - ui.damageCount.innerHTML='伤害: '+_status.damageCount; - } }, - boss_nianrui:{ - trigger:{player:'phaseDrawBegin'}, - forced:true, - content:function(){ - trigger.num+=2; + boss_damagecount: { + mode: ["boss"], + global: "boss_damagecount2", + }, + boss_damagecount2: { + trigger: { source: "damageEnd" }, + silent: true, + filter: function (event, player) { + if (!ui.damageCount) return false; + return event.num > 0 && player.isFriendOf(game.me) && event.player.isEnemyOf(game.me); + }, + content: function () { + _status.damageCount += trigger.num; + ui.damageCount.innerHTML = "伤害: " + _status.damageCount; }, - ai:{ - threaten:1.6 - } }, - boss_qixiang:{ - group:['boss_qixiang1','boss_qixiang2'], - ai:{ - effect:{ - target:function(card,player,target,current){ - if(card.name=='lebu'&&card.name=='bingliang') return 0.8; - } - } - } + boss_nianrui: { + trigger: { player: "phaseDrawBegin" }, + forced: true, + content: function () { + trigger.num += 2; + }, + ai: { + threaten: 1.6, + }, }, - boss_qixiang1:{ - trigger:{player:'judge'}, - forced:true, - filter:function(event,player){ - if(event.card){ - if(event.card.viewAs){ - return event.card.viewAs=='lebu'; - } - else{ - return event.card.name=='lebu'; + boss_qixiang: { + group: ["boss_qixiang1", "boss_qixiang2"], + ai: { + effect: { + target: function (card, player, target, current) { + if (card.name == "lebu" && card.name == "bingliang") return 0.8; + }, + }, + }, + }, + boss_qixiang1: { + trigger: { player: "judge" }, + forced: true, + filter: function (event, player) { + if (event.card) { + if (event.card.viewAs) { + return event.card.viewAs == "lebu"; + } else { + return event.card.name == "lebu"; } } }, - content:function(){ - player.addTempSkill('boss_qixiang3','judgeAfter'); - } + content: function () { + player.addTempSkill("boss_qixiang3", "judgeAfter"); + }, }, - boss_qixiang2:{ - trigger:{player:'judge'}, - forced:true, - filter:function(event,player){ - if(event.card){ - if(event.card.viewAs){ - return event.card.viewAs=='bingliang'; - } - else{ - return event.card.name=='bingliang'; + boss_qixiang2: { + trigger: { player: "judge" }, + forced: true, + filter: function (event, player) { + if (event.card) { + if (event.card.viewAs) { + return event.card.viewAs == "bingliang"; + } else { + return event.card.name == "bingliang"; } } }, - content:function(){ - player.addTempSkill('boss_qixiang4','judgeAfter'); - } + content: function () { + player.addTempSkill("boss_qixiang4", "judgeAfter"); + }, }, - boss_qixiang3:{ - mod:{ - suit:function(card,suit){ - if(suit=='diamond') return 'heart'; - } - } + boss_qixiang3: { + mod: { + suit: function (card, suit) { + if (suit == "diamond") return "heart"; + }, + }, }, - boss_qixiang4:{ - mod:{ - suit:function(card,suit){ - if(suit=='spade') return 'club'; - } - } + boss_qixiang4: { + mod: { + suit: function (card, suit) { + if (suit == "spade") return "club"; + }, + }, }, - boss_bianshen2:{ - mode:['boss'], - fixed:true, - global:'boss_bianshen2x', - trigger:{player:'dieBegin'}, - silent:true, - content:function(){ + boss_bianshen2: { + mode: ["boss"], + fixed: true, + global: "boss_bianshen2x", + trigger: { player: "dieBegin" }, + silent: true, + content: function () { player.hide(); - game.addVideo('hidePlayer',player); - } - }, - boss_bianshen2x:{ - trigger:{global:'dieAfter'}, - forced:true, - priority:-10, - fixed:true, - globalFixed:true, - filter:function(event){ - if(lib.config.mode!='boss') return false; - return event.player==game.boss&&event.player.hasSkill('boss_bianshen2'); + game.addVideo("hidePlayer", player); }, - content:function(){ - 'step 0' - game.delay(); - 'step 1' - game.changeBoss(['boss_niutou','boss_mamian'].randomGet()); - } }, - boss_bianshen3:{ - mode:['boss'], - global:'boss_bianshen3x', - trigger:{player:'dieBegin'}, - silent:true, - fixed:true, - content:function(){ + boss_bianshen2x: { + trigger: { global: "dieAfter" }, + forced: true, + priority: -10, + fixed: true, + globalFixed: true, + filter: function (event) { + if (lib.config.mode != "boss") return false; + return event.player == game.boss && event.player.hasSkill("boss_bianshen2"); + }, + content: function () { + "step 0"; + game.delay(); + "step 1"; + game.changeBoss(["boss_niutou", "boss_mamian"].randomGet()); + }, + }, + boss_bianshen3: { + mode: ["boss"], + global: "boss_bianshen3x", + trigger: { player: "dieBegin" }, + silent: true, + fixed: true, + content: function () { player.hide(); - game.addVideo('hidePlayer',player); - } - }, - boss_bianshen3x:{ - trigger:{global:'dieAfter'}, - forced:true, - priority:-10, - fixed:true, - globalFixed:true, - filter:function(event){ - if(lib.config.mode!='boss') return false; - return event.player==game.boss&&event.player.hasSkill('boss_bianshen3'); + game.addVideo("hidePlayer", player); }, - content:function(){ - 'step 0' - game.delay(); - 'step 1' - game.changeBoss(['boss_baiwuchang','boss_heiwuchang'].randomGet()); - } }, - boss_bianshen4:{ - mode:['boss'], - global:'boss_bianshen4x', - trigger:{player:'dieBegin'}, - silent:true, - fixed:true, - content:function(){ + boss_bianshen3x: { + trigger: { global: "dieAfter" }, + forced: true, + priority: -10, + fixed: true, + globalFixed: true, + filter: function (event) { + if (lib.config.mode != "boss") return false; + return event.player == game.boss && event.player.hasSkill("boss_bianshen3"); + }, + content: function () { + "step 0"; + game.delay(); + "step 1"; + game.changeBoss(["boss_baiwuchang", "boss_heiwuchang"].randomGet()); + }, + }, + boss_bianshen4: { + mode: ["boss"], + global: "boss_bianshen4x", + trigger: { player: "dieBegin" }, + silent: true, + fixed: true, + content: function () { player.hide(); - game.addVideo('hidePlayer',player); - } - }, - boss_bianshen4x:{ - trigger:{global:'dieAfter'}, - forced:true, - priority:-10, - fixed:true, - globalFixed:true, - filter:function(event){ - if(lib.config.mode!='boss') return false; - return event.player==game.boss&&event.player.hasSkill('boss_bianshen4'); + game.addVideo("hidePlayer", player); }, - content:function(){ - 'step 0' + }, + boss_bianshen4x: { + trigger: { global: "dieAfter" }, + forced: true, + priority: -10, + fixed: true, + globalFixed: true, + filter: function (event) { + if (lib.config.mode != "boss") return false; + return event.player == game.boss && event.player.hasSkill("boss_bianshen4"); + }, + content: function () { + "step 0"; game.delay(); - 'step 1' - game.changeBoss(['boss_yecha','boss_luocha'].randomGet()); - } - }, - boss_moyany:{ - trigger:{player:'loseEnd'}, - frequent:true, - unique:true, - filter:function(event,player){ - return _status.currentPhase!=player; + "step 1"; + game.changeBoss(["boss_yecha", "boss_luocha"].randomGet()); }, - content:function(){ - "step 0" - player.judge(function(card){ - return get.color(card)=='red'?1:0; + }, + boss_moyany: { + trigger: { player: "loseEnd" }, + frequent: true, + unique: true, + filter: function (event, player) { + return _status.currentPhase != player; + }, + content: function () { + "step 0"; + player.judge(function (card) { + return get.color(card) == "red" ? 1 : 0; }); - "step 1" - if(result.bool){ - player.chooseTarget(true,'选择一个目标对其造成两点火焰伤害',function(card,player,target){ - return player!=target; - }).ai=function(target){ - return get.damageEffect(target,player,player,'fire'); - } - } - else{ + "step 1"; + if (result.bool) { + player.chooseTarget( + true, + "选择一个目标对其造成两点火焰伤害", + function (card, player, target) { + return player != target; + } + ).ai = function (target) { + return get.damageEffect(target, player, player, "fire"); + }; + } else { event.finish(); } - "step 2" - if(result.targets.length){ - player.line(result.targets,'fire'); - result.targets[0].damage(2,'fire'); + "step 2"; + if (result.targets.length) { + player.line(result.targets, "fire"); + result.targets[0].damage(2, "fire"); } }, - ai:{ - effect:{ - target:function(card){ - if(get.tag(card,'loseCard')){ - return [0.5,1]; + ai: { + effect: { + target: function (card) { + if (get.tag(card, "loseCard")) { + return [0.5, 1]; } - } - } - } - }, - boss_danshu:{ - trigger:{player:'loseEnd'}, - frequent:true, - unique:true, - filter:function(event,player){ - return _status.currentPhase!=player&&player.hp=player.hp; - }).ai=function(target){ - return get.damageEffect(target,player,player); - } - "step 1" - if(result.bool){ - player.logSkill('boss_xiaoshou',result.targets); + boss_xiaoshou: { + trigger: { player: "phaseJieshuBegin" }, + direct: true, + content: function () { + "step 0"; + player.chooseTarget(get.prompt("boss_xiaoshou"), function (card, player, target) { + return player != target && target.hp >= player.hp; + }).ai = function (target) { + return get.damageEffect(target, player, player); + }; + "step 1"; + if (result.bool) { + player.logSkill("boss_xiaoshou", result.targets); result.targets[0].damage(3); } }, }, - boss_manjia:{ - group:['boss_manjia1','boss_manjia2'] + boss_manjia: { + group: ["boss_manjia1", "boss_manjia2"], }, - boss_manjia1:{ - trigger:{target:['useCardToBefore','shaBegin']}, - forced:true, - priority:6, - filter:function(event,player,name){ - if(player.getEquip(2)) return false; - if(name=='shaBegin') return lib.skill.tengjia3.filter(event,player); - return lib.skill.tengjia1.filter(event,player); + boss_manjia1: { + trigger: { target: ["useCardToBefore", "shaBegin"] }, + forced: true, + priority: 6, + filter: function (event, player, name) { + if (player.getEquip(2)) return false; + if (name == "shaBegin") return lib.skill.tengjia3.filter(event, player); + return lib.skill.tengjia1.filter(event, player); }, - content:function(){ + content: function () { trigger.cancel(); }, - ai:{ - effect:{ - target:function(card,player,target,current){ - if(target.getEquip(2)) return; - return lib.skill.tengjia1.ai.effect.target.apply(this,arguments); - } - } - } - }, - boss_manjia2:{ - trigger:{player:'damageBegin3'}, - filter:function(event,player){ - if(player.getEquip(2)) return false; - if(event.hasNature('fire')) return true; + ai: { + effect: { + target: function (card, player, target, current) { + if (target.getEquip(2)) return; + return lib.skill.tengjia1.ai.effect.target.apply(this, arguments); + }, + }, }, - forced:true, - check:function(){ + }, + boss_manjia2: { + trigger: { player: "damageBegin3" }, + filter: function (event, player) { + if (player.getEquip(2)) return false; + if (event.hasNature("fire")) return true; + }, + forced: true, + check: function () { return false; }, - content:function(){ + content: function () { trigger.num++; }, - ai:{ - effect:{ - target:function(card,player,target,current){ - if(target.getEquip(2)) return; - return lib.skill.tengjia2.ai.effect.target.apply(this,arguments); - } - } - } + ai: { + effect: { + target: function (card, player, target, current) { + if (target.getEquip(2)) return; + return lib.skill.tengjia2.ai.effect.target.apply(this, arguments); + }, + }, + }, }, - boss_lianyu:{ - trigger:{player:'phaseJieshuBegin'}, - unique:true, - content:function(){ - "step 0" - event.players=get.players(player); - "step 1" - if(event.players.length){ - var current=event.players.shift(); - if(current.isEnemyOf(player)){ - player.line(current,'fire'); - current.damage('fire'); + boss_lianyu: { + trigger: { player: "phaseJieshuBegin" }, + unique: true, + content: function () { + "step 0"; + event.players = get.players(player); + "step 1"; + if (event.players.length) { + var current = event.players.shift(); + if (current.isEnemyOf(player)) { + player.line(current, "fire"); + current.damage("fire"); } event.redo(); } }, - ai:{ - threaten:2 - } - }, - boss_guiji:{ - trigger:{player:'phaseJudgeBegin'}, - forced:true, - content:function(){ - player.discard(player.getCards('j').randomGet()); + ai: { + threaten: 2, }, - filter:function(event ,player){ - return player.countCards('j')>0; - }, - ai:{ - effect:{ - target:function(card,player,target,current){ - if(get.type(card)=='delay'&&target.countCards('j')==0) return 0.1; - } - } - } }, - boss_minbao:{ - global:'boss_minbao2' - }, - boss_minbao2:{ - trigger:{global:'dieAfter'}, - forced:true, - globalFixed:true, - filter:function(event,player){ - return event.player.hasSkill('boss_minbao')&&event.player.isDead(); + boss_guiji: { + trigger: { player: "phaseJudgeBegin" }, + forced: true, + content: function () { + player.discard(player.getCards("j").randomGet()); }, - content:function(){ - trigger.player.line(player,'fire'); - player.damage('nosource','fire').animate=false; + filter: function (event, player) { + return player.countCards("j") > 0; + }, + ai: { + effect: { + target: function (card, player, target, current) { + if (get.type(card) == "delay" && target.countCards("j") == 0) return 0.1; + }, + }, + }, + }, + boss_minbao: { + global: "boss_minbao2", + }, + boss_minbao2: { + trigger: { global: "dieAfter" }, + forced: true, + globalFixed: true, + filter: function (event, player) { + return event.player.hasSkill("boss_minbao") && event.player.isDead(); + }, + content: function () { + trigger.player.line(player, "fire"); + player.damage("nosource", "fire").animate = false; player.$damage(trigger.player); - player.$damagepop(-1,'fire'); - if(lib.config.animation&&!lib.config.low_performance){ + player.$damagepop(-1, "fire"); + if (lib.config.animation && !lib.config.low_performance) { player.$fire(); } - if(!event.parent.parent.boss_minbao_logv){ - event.parent.parent.boss_minbao_logv=true; - game.logv(trigger.player,'boss_minbao',game.filterPlayer(),event.parent.parent); - } - } - }, - boss_guihuo:{ - trigger:{player:'phaseJieshuBegin'}, - direct:true, - content:function(){ - "step 0" - player.chooseTarget(get.prompt('boss_guihuo'),function(card,player,target){ - return player!=target; - }).ai=function(target){ - return get.damageEffect(target,player,player,'fire'); - } - "step 1" - if(result.bool){ - player.logSkill('boss_guihuo',result.targets); - result.targets[0].damage('fire'); + if (!event.parent.parent.boss_minbao_logv) { + event.parent.parent.boss_minbao_logv = true; + game.logv(trigger.player, "boss_minbao", game.filterPlayer(), event.parent.parent); } }, }, - boss_luolei:{ - trigger:{player:'phaseZhunbeiBegin'}, - direct:true, - content:function(){ - "step 0" - player.chooseTarget(get.prompt('boss_luolei'),function(card,player,target){ - return player!=target; - }).ai=function(target){ - return get.damageEffect(target,player,player,'thunder'); - } - "step 1" - if(result.bool){ - player.logSkill('boss_luolei',result.targets); - result.targets[0].damage('thunder'); + boss_guihuo: { + trigger: { player: "phaseJieshuBegin" }, + direct: true, + content: function () { + "step 0"; + player.chooseTarget(get.prompt("boss_guihuo"), function (card, player, target) { + return player != target; + }).ai = function (target) { + return get.damageEffect(target, player, player, "fire"); + }; + "step 1"; + if (result.bool) { + player.logSkill("boss_guihuo", result.targets); + result.targets[0].damage("fire"); } }, }, - boss_beiming:{ - trigger:{player:'dieBegin'}, - forced:true, - filter:function(event){ - return event.source!=undefined; + boss_luolei: { + trigger: { player: "phaseZhunbeiBegin" }, + direct: true, + content: function () { + "step 0"; + player.chooseTarget(get.prompt("boss_luolei"), function (card, player, target) { + return player != target; + }).ai = function (target) { + return get.damageEffect(target, player, player, "thunder"); + }; + "step 1"; + if (result.bool) { + player.logSkill("boss_luolei", result.targets); + result.targets[0].damage("thunder"); + } }, - content:function(){ - trigger.source.discard(trigger.source.getCards('h')); - }, - ai:{ - threaten:0.7 - } }, - boss_shanbeng:{ - global:'boss_shanbeng2', - trigger:{player:'dieBegin'}, - forced:true, - logv:false, - content:function(){ - var targets=game.filterPlayer(function(current){ - return current.countCards('e'); + boss_beiming: { + trigger: { player: "dieBegin" }, + forced: true, + filter: function (event) { + return event.source != undefined; + }, + content: function () { + trigger.source.discard(trigger.source.getCards("h")); + }, + ai: { + threaten: 0.7, + }, + }, + boss_shanbeng: { + global: "boss_shanbeng2", + trigger: { player: "dieBegin" }, + forced: true, + logv: false, + content: function () { + var targets = game.filterPlayer(function (current) { + return current.countCards("e"); }); - player.line(targets,'green'); + player.line(targets, "green"); game.delay(); - game.logv(player,'boss_shanbeng',targets,null,true); - } - }, - boss_shanbeng2:{ - trigger:{global:'dieAfter'}, - forced:true, - globalFixed:true, - filter:function(event,player){ - return player.countCards('e')>0&&event.player.hasSkill('boss_shanbeng')&&event.player.isDead(); + game.logv(player, "boss_shanbeng", targets, null, true); }, - content:function(){ - player.discard(player.getCards('e')); - } }, - boss_didong:{ - trigger:{player:'phaseJieshuBegin'}, - direct:true, - content:function(){ - "step 0" - player.chooseTarget(get.prompt('boss_didong'),function(card,player,target){ + boss_shanbeng2: { + trigger: { global: "dieAfter" }, + forced: true, + globalFixed: true, + filter: function (event, player) { + return ( + player.countCards("e") > 0 && + event.player.hasSkill("boss_shanbeng") && + event.player.isDead() + ); + }, + content: function () { + player.discard(player.getCards("e")); + }, + }, + boss_didong: { + trigger: { player: "phaseJieshuBegin" }, + direct: true, + content: function () { + "step 0"; + player.chooseTarget(get.prompt("boss_didong"), function (card, player, target) { return target.isEnemyOf(player); - }).ai=function(target){ - var att=get.attitude(player,target); - if(target.isTurnedOver()){ - if(att>0){ - return att+5; + }).ai = function (target) { + var att = get.attitude(player, target); + if (target.isTurnedOver()) { + if (att > 0) { + return att + 5; } return -1; } - if(player.isTurnedOver()){ - return 5-att; + if (player.isTurnedOver()) { + return 5 - att; } return -att; }; - "step 1" - if(result.bool){ - player.logSkill('boss_didong',result.targets); + "step 1"; + if (result.bool) { + player.logSkill("boss_didong", result.targets); result.targets[0].turnOver(); } }, - ai:{ - threaten:1.7 - } + ai: { + threaten: 1.7, + }, }, - boss_guimei:{ - mod:{ - targetEnabled:function(card,player,target){ - if(get.type(card)=='delay'){ + boss_guimei: { + mod: { + targetEnabled: function (card, player, target) { + if (get.type(card) == "delay") { return false; } - } - } - }, - boss_bianshen:{ - trigger:{global:'gameStart'}, - forced:true, - popup:false, - content:function(){ - player.smoothAvatar(); - player.init(['boss_chi','boss_mo','boss_wang','boss_liang'].randomGet()); - game.addVideo('reinit2',player,player.name); - } - }, - boss_bianshen_intro1:{nobracket:true}, - boss_bianshen_intro2:{nobracket:true}, - boss_bianshen_intro3:{nobracket:true}, - boss_bianshen_intro4:{nobracket:true}, - boss_chiyan_intro1:{nobracket:true}, - boss_chiyan_intro2:{nobracket:true}, - boss_chiyan_intro3:{nobracket:true}, - boss_chiyan_intro4:{nobracket:true}, - boss_qingmu_intro1:{nobracket:true}, - boss_qingmu_intro2:{nobracket:true}, - boss_qingmu_intro3:{nobracket:true}, - boss_qingmu_intro4:{nobracket:true}, - boss_baimang_intro1:{nobracket:true}, - boss_baimang_intro2:{nobracket:true}, - boss_baimang_intro3:{nobracket:true}, - boss_baimang_intro4:{nobracket:true}, - boss_xuanlin_intro1:{nobracket:true}, - boss_xuanlin_intro2:{nobracket:true}, - boss_xuanlin_intro3:{nobracket:true}, - boss_xuanlin_intro4:{nobracket:true}, - boss_leiji:{ - audio:2, - trigger:{player:['respond','useCard']}, - filter:function(event,player){ - return event.card.name=='shan'; + }, }, - direct:true, - content:function(){ + }, + boss_bianshen: { + trigger: { global: "gameStart" }, + forced: true, + popup: false, + content: function () { + player.smoothAvatar(); + player.init(["boss_chi", "boss_mo", "boss_wang", "boss_liang"].randomGet()); + game.addVideo("reinit2", player, player.name); + }, + }, + boss_bianshen_intro1: { nobracket: true }, + boss_bianshen_intro2: { nobracket: true }, + boss_bianshen_intro3: { nobracket: true }, + boss_bianshen_intro4: { nobracket: true }, + boss_chiyan_intro1: { nobracket: true }, + boss_chiyan_intro2: { nobracket: true }, + boss_chiyan_intro3: { nobracket: true }, + boss_chiyan_intro4: { nobracket: true }, + boss_qingmu_intro1: { nobracket: true }, + boss_qingmu_intro2: { nobracket: true }, + boss_qingmu_intro3: { nobracket: true }, + boss_qingmu_intro4: { nobracket: true }, + boss_baimang_intro1: { nobracket: true }, + boss_baimang_intro2: { nobracket: true }, + boss_baimang_intro3: { nobracket: true }, + boss_baimang_intro4: { nobracket: true }, + boss_xuanlin_intro1: { nobracket: true }, + boss_xuanlin_intro2: { nobracket: true }, + boss_xuanlin_intro3: { nobracket: true }, + boss_xuanlin_intro4: { nobracket: true }, + boss_leiji: { + audio: 2, + trigger: { player: ["respond", "useCard"] }, + filter: function (event, player) { + return event.card.name == "shan"; + }, + direct: true, + content: function () { "step 0"; - player.chooseTarget(get.prompt('boss_leiji')).ai=function(target){ - return get.damageEffect(target,player,player,'thunder'); + player.chooseTarget(get.prompt("boss_leiji")).ai = function (target) { + return get.damageEffect(target, player, player, "thunder"); }; - "step 1" - if(result.bool){ - player.logSkill('boss_leiji',result.targets,'thunder'); - event.target=result.targets[0]; - event.target.judge(function(card){ + "step 1"; + if (result.bool) { + player.logSkill("boss_leiji", result.targets, "thunder"); + event.target = result.targets[0]; + event.target.judge(function (card) { // var suit=get.suit(card); // if(suit=='spade') return -4; // if(suit=='club') return -2; - if(get.color(card)=='black') return -2; + if (get.color(card) == "black") return -2; return 0; }); - } - else{ + } else { event.finish(); } - "step 2" - if(result.bool==false){ - event.target.damage('thunder'); + "step 2"; + if (result.bool == false) { + event.target.damage("thunder"); player.draw(); } }, - ai:{ - effect:{ - target:function(card,player,target,current){ - if(get.tag(card,'respondShan')){ - var hastarget=false,players=game.filterPlayer(); - for(var i=0;i2){ - if(!target.hasSkill('guidao')) return 0; - return [0,hastarget?target.countCards('h')/4:0]; + if (target.countCards("h", "shan") && target.countCards("h") > 2) { + if (!target.hasSkill("guidao")) return 0; + return [0, hastarget ? target.countCards("h") / 4 : 0]; } - if(target.countCards('h')>3||(be&&target.countCards('h')>=2)){ - return [0,0]; + if (target.countCards("h") > 3 || (be && target.countCards("h") >= 2)) { + return [0, 0]; } - if(target.countCards('h')==0){ - return [1.5,0]; + if (target.countCards("h") == 0) { + return [1.5, 0]; } - if(target.countCards('h')==1&&!be){ - return [1.2,0]; + if (target.countCards("h") == 1 && !be) { + return [1.2, 0]; } - if(!target.hasSkill('guidao')) return [1,0.05]; - return [1,Math.min(0.5,(target.countCards('h')+be)/4)]; + if (!target.hasSkill("guidao")) return [1, 0.05]; + return [1, Math.min(0.5, (target.countCards("h") + be) / 4)]; } - } - } - } - }, - wuqin:{ - audio:2, - trigger:{player:'phaseJieshuBegin'}, - filter:function(event,player){ - return player.countCards('h')==0; + }, + }, }, - content:function(){ - player.draw(3) - } }, - boss_baolin:{ - audio:true, - inherit:'juece', + wuqin: { + audio: 2, + trigger: { player: "phaseJieshuBegin" }, + filter: function (event, player) { + return player.countCards("h") == 0; + }, + content: function () { + player.draw(3); + }, }, - boss_qiangzheng:{ - audio:2, - trigger:{player:'phaseJieshuBegin'}, - forced:true, - unique:true, - filter:function(event,player){ - return game.hasPlayer(function(current){ - return current!=player&¤t.countCards('h'); + boss_baolin: { + audio: true, + inherit: "juece", + }, + boss_qiangzheng: { + audio: 2, + trigger: { player: "phaseJieshuBegin" }, + forced: true, + unique: true, + filter: function (event, player) { + return game.hasPlayer(function (current) { + return current != player && current.countCards("h"); }); }, - content:function(){ - "step 0" - var players=get.players(player); + content: function () { + "step 0"; + var players = get.players(player); players.remove(player); - event.players=players; - player.line(players,'green'); - "step 1" - if(event.players.length){ - var current=event.players.shift(); - var hs=current.getCards('h') - if(hs.length){ - var card=hs.randomGet(); - player.gain(card,current); - current.$giveAuto(card,player); + event.players = players; + player.line(players, "green"); + "step 1"; + if (event.players.length) { + var current = event.players.shift(); + var hs = current.getCards("h"); + if (hs.length) { + var card = hs.randomGet(); + player.gain(card, current); + current.$giveAuto(card, player); } event.redo(); } - } + }, }, - guizhen:{ - audio:2, - trigger:{player:'loseEnd'}, - frequent:true, - filter:function(event,player){ - if(player.countCards('h')) return false; - for(var i=0;i=3; + boss_konghun: { + trigger: { player: "phaseJieshuBegin" }, + direct: true, + filter: function () { + return game.players.length >= 3; }, - content:function(){ - "step 0" - player.chooseTarget(function(card,player,target){ - return target!=player; - }).ai=function(){ + content: function () { + "step 0"; + player.chooseTarget(function (card, player, target) { + return target != player; + }).ai = function () { return 1; - } - "step 1" - if(result.bool){ - player.logSkill('boss_konghun',result.targets); + }; + "step 1"; + if (result.bool) { + player.logSkill("boss_konghun", result.targets); result.targets[0].goMad(); } }, - group:'boss_konghun2' + group: "boss_konghun2", }, - boss_konghun2:{ - trigger:{player:'phaseZhunbeiBegin'}, - forced:true, - popup:false, - content:function(){ - var players=game.players.concat(game.dead); - for(var i=0;i1){ + ai: { + order: 1, + result: { + player: function (player) { + if (player.countCards("h", "shan")) return 1; + var num = 0, + players = game.filterPlayer(); + for (var i = 0; i < players.length; i++) { + if (players[i].canUse("sha", player) && players[i].countCards("h") > 1) { num--; - } - else{ + } else { num++; } } return num; - } - } - } + }, + }, + }, }, - huanhua:{ - audio:2, - trigger:{global:'gameDrawAfter'}, - forced:true, - unique:true, - content:function(){ - for(var i=0;i0){ - if(target.classList.contains('turnedover')) return 3; - if(target.hasSkillTag('noturn')) return 1; + var player = _status.event.player; + if (get.attitude(_status.event.player, target) == 0) return 0; + if (get.attitude(_status.event.player, target) > 0) { + if (target.classList.contains("turnedover")) return 3; + if (target.hasSkillTag("noturn")) return 1; return -1; + } else { + if (target.hasSkillTag("noturn")) return 0; + if (target.classList.contains("turnedover")) return -1; + return 5 - target.getDamagedHp(); } - else{ - if(target.hasSkillTag('noturn')) return 0; - if(target.classList.contains('turnedover')) return -1; - return 5-target.getDamagedHp(); - } - } - "step 1" - if(result.bool){ - player.logSkill('tashui',result.targets,'thunder'); + }; + "step 1"; + if (result.bool) { + player.logSkill("tashui", result.targets, "thunder"); result.targets[0].turnOver(); } }, - ai:{ - effect:{ - player:function(card){ - if(get.color(card)=='black'){ - return [1,2]; + ai: { + effect: { + player: function (card) { + if (get.color(card) == "black") { + return [1, 2]; } - } - } - } - }, - shangshix:{ - trigger:{player:['loseEnd','changeHp']}, - forced:true, - unique:true, - audio:2, - filter:function(event,player){ - return player.countCards('h')<4; - }, - content:function(){ - player.draw(4-player.countCards('h')); - }, - group:'shangshix2', - ai:{ - effect:{ - target:function(card,player,target){ - if(card.name=='shunshou') return; - if(card.name=='guohe'){ - if(!target.countCards('e')) return [0,1]; - } - else if(get.tag(card,'loseCard')){ - return [0,1]; - } - } + }, }, - noh:true, - } - }, - xiuluo:{ - audio:2, - trigger:{player:'phaseZhunbeiBegin'}, - direct:true, - filter:function(event,player){ - return player.countCards('j')>0; }, - content:function(){ - "step 0" - var next=player.discardPlayerCard(player,2,'hj','是否一张手牌来弃置一张花色相同的判定牌?'); - next.filterButton=function(button){ - var card=button.link; - if(!lib.filter.cardDiscardable(card,player)) return false; - if(ui.selected.buttons.length==0) return true; - if(get.position(ui.selected.buttons[0].link)=='h'){ - if(get.position(card)!='j') return false; + }, + shangshix: { + trigger: { player: ["loseEnd", "changeHp"] }, + forced: true, + unique: true, + audio: 2, + filter: function (event, player) { + return player.countCards("h") < 4; + }, + content: function () { + player.draw(4 - player.countCards("h")); + }, + group: "shangshix2", + ai: { + effect: { + target: function (card, player, target) { + if (card.name == "shunshou") return; + if (card.name == "guohe") { + if (!target.countCards("e")) return [0, 1]; + } else if (get.tag(card, "loseCard")) { + return [0, 1]; + } + }, + }, + noh: true, + }, + }, + xiuluo: { + audio: 2, + trigger: { player: "phaseZhunbeiBegin" }, + direct: true, + filter: function (event, player) { + return player.countCards("j") > 0; + }, + content: function () { + "step 0"; + var next = player.discardPlayerCard( + player, + 2, + "hj", + "是否一张手牌来弃置一张花色相同的判定牌?" + ); + next.filterButton = function (button) { + var card = button.link; + if (!lib.filter.cardDiscardable(card, player)) return false; + if (ui.selected.buttons.length == 0) return true; + if (get.position(ui.selected.buttons[0].link) == "h") { + if (get.position(card) != "j") return false; } - if(get.position(ui.selected.buttons[0].link)=='j'){ - if(get.position(card)!='h') return false; + if (get.position(ui.selected.buttons[0].link) == "j") { + if (get.position(card) != "h") return false; } - return get.suit(card)==get.suit(ui.selected.buttons[0].link) + return get.suit(card) == get.suit(ui.selected.buttons[0].link); }; - next.ai=function(button){ - var card=button.link; - if(get.position(card)=='h'){ - return 11-get.value(card); + next.ai = function (button) { + var card = button.link; + if (get.position(card) == "h") { + return 11 - get.value(card); } - if(card.name=='lebu') return 5; - if(card.name=='bingliang') return 4; - if(card.name=='guiyoujie') return 3; + if (card.name == "lebu") return 5; + if (card.name == "bingliang") return 4; + if (card.name == "guiyoujie") return 3; return 2; }; - next.logSkill='xiuluo'; - "step 1" - if(result.bool&&player.countCards('j')) event.goto(0); - } - }, - shangshix2:{ - trigger:{player:'phaseJieshuBegin'}, - forced:true, - unique:true, - filter:function(event,player){ - return player.hp>1; + next.logSkill = "xiuluo"; + "step 1"; + if (result.bool && player.countCards("j")) event.goto(0); }, - content:function(){ - "step 0" - event.players=get.players(player); - event.num=0; - "step 1" - if(event.players.length){ + }, + shangshix2: { + trigger: { player: "phaseJieshuBegin" }, + forced: true, + unique: true, + filter: function (event, player) { + return player.hp > 1; + }, + content: function () { + "step 0"; + event.players = get.players(player); + event.num = 0; + "step 1"; + if (event.players.length) { event.players.shift().loseHp(); event.redo(); } - } - }, - boss_wuxin:{ - audio:2, - mod:{ - targetEnabled:function(card,player,target){ - if(get.type(card)=='delay'&&player!=target) return false; - } }, - trigger:{player:'damageBefore'}, - forced:true, - priority:10, - content:function(){ + }, + boss_wuxin: { + audio: 2, + mod: { + targetEnabled: function (card, player, target) { + if (get.type(card) == "delay" && player != target) return false; + }, + }, + trigger: { player: "damageBefore" }, + forced: true, + priority: 10, + content: function () { trigger.cancel(); player.loseHp(); }, }, - shenwei:{ - audio:2, - unique:true, - trigger:{player:'phaseDrawBegin'}, - forced:true, - content:function(){ - trigger.num+=Math.min(3,game.players.length-1); + shenwei: { + audio: 2, + unique: true, + trigger: { player: "phaseDrawBegin" }, + forced: true, + content: function () { + trigger.num += Math.min(3, game.players.length - 1); }, - mod:{ - maxHandcard:function(player,current){ - return current+Math.min(3,game.players.length-1); - } - } - }, - boss_baonuwash:{ - trigger:{player:'phaseAfter'}, - forced:true, - content:function(){ - game.over(game.me==game.boss); + mod: { + maxHandcard: function (player, current) { + return current + Math.min(3, game.players.length - 1); + }, }, - temp:true, }, - boss_baonu:{ - unique:true, - trigger:{player:'changeHp',global:'boss_baonuwash'}, - forced:true, - priority:100, - fixed:true, - audio:2, - mode:['identity','guozhan','boss','stone'], - init:function(player){ - if(get.mode()=='boss'&&player==game.boss){ - lib.onwash.push(function(){ - if(!_status.boss_baonuwash){ - _status.boss_baonuwash=true; - _status.event.parent.trigger('boss_baonuwash'); - } - else{ - _status.event.player.addSkill('boss_baonuwash'); + boss_baonuwash: { + trigger: { player: "phaseAfter" }, + forced: true, + content: function () { + game.over(game.me == game.boss); + }, + temp: true, + }, + boss_baonu: { + unique: true, + trigger: { player: "changeHp", global: "boss_baonuwash" }, + forced: true, + priority: 100, + fixed: true, + audio: 2, + mode: ["identity", "guozhan", "boss", "stone"], + init: function (player) { + if (get.mode() == "boss" && player == game.boss) { + lib.onwash.push(function () { + if (!_status.boss_baonuwash) { + _status.boss_baonuwash = true; + _status.event.parent.trigger("boss_baonuwash"); + } else { + _status.event.player.addSkill("boss_baonuwash"); } }); - for(var i in lib.card){ - if(lib.card[i].subtype=='equip1') lib.card[i].recastable=true; + for (var i in lib.card) { + if (lib.card[i].subtype == "equip1") lib.card[i].recastable = true; } } }, - filter:function(event,player){ - return player.hp<=4||_status.boss_baonuwash; + filter: function (event, player) { + return player.hp <= 4 || _status.boss_baonuwash; }, - content:function(){ - 'step 0' - if(player.hp>6){ + content: function () { + "step 0"; + if (player.hp > 6) { game.delay(); } - 'step 1' - player.chooseControl('暴怒战神','神鬼无前',function(){ - if(Math.random()<0.5) return '神鬼无前'; - return '暴怒战神'; - }).set('prompt','选择一个形态'); - 'step 2' - var hp=player.hp; - player.removeSkill('boss_baonu',true); - if(result.control=='暴怒战神'){ - player.init('boss_lvbu2'); + "step 1"; + player + .chooseControl("暴怒战神", "神鬼无前", function () { + if (Math.random() < 0.5) return "神鬼无前"; + return "暴怒战神"; + }) + .set("prompt", "选择一个形态"); + "step 2"; + var hp = player.hp; + player.removeSkill("boss_baonu", true); + if (result.control == "暴怒战神") { + player.init("boss_lvbu2"); + } else { + player.init("boss_lvbu3"); } - else{ - player.init('boss_lvbu3'); - } - if(hp>6){ - player.maxHp=hp; - player.hp=hp; + if (hp > 6) { + player.maxHp = hp; + player.hp = hp; } player.update(); ui.clear(); - if(player.isLinked()) player.link(); - if(player.isTurnedOver()) player.turnOver(); - player.discard(player.getCards('j')); - 'step 3' - while(_status.event.name!='phaseLoop'){ - _status.event=_status.event.parent; + if (player.isLinked()) player.link(); + if (player.isTurnedOver()) player.turnOver(); + player.discard(player.getCards("j")); + "step 3"; + while (_status.event.name != "phaseLoop") { + _status.event = _status.event.parent; } game.resetSkills(); - _status.paused=false; - _status.event.player=player; - _status.event.step=0; - if(game.bossinfo){ - game.bossinfo.loopType=1; - _status.roundStart=game.boss; + _status.paused = false; + _status.event.player = player; + _status.event.step = 0; + if (game.bossinfo) { + game.bossinfo.loopType = 1; + _status.roundStart = game.boss; } }, - ai:{ - effect:{ - target:function(card,player,target){ - if(get.tag(card,'damage')||get.tag(card,'loseHp')){ - if(player.hp==5){ - if(game.players.length<4) return [0,5]; - var num=0 - for(var i=0;i1) return [0,2]; - if(num&&Math.random()<0.7) return [0,1]; + if (num > 1) return [0, 2]; + if (num && Math.random() < 0.7) return [0, 1]; } } - } - } - } - }, - qiwu:{ - audio:true, - trigger:{player:'useCard'}, - forced:true, - filter:function(event,player){ - return get.suit(event.card)=='club'&&player.hp0; }, - content:function(){ - player.chooseToUse({name:'tao'},'神躯:是否使用一张桃?').logSkill='shenqu'; - } }, - jiwu:{ - derivation:['qiangxix','retieji','olxuanfeng','rewansha'], - audio:2, - enable:'phaseUse', - filter:function(event,player){ - if(player.countCards('he')==0) return false; - if(!player.hasSkill('qiangxix')) return true; - if(!player.hasSkill('retieji')) return true; - if(!player.hasSkill('olxuanfeng')) return true; - if(!player.hasSkill('rewansha')) return true; + shenqu2: { + trigger: { player: "damageAfter" }, + direct: true, + filter: function (event, player) { + return player.hasSkillTag("respondTao") || player.countCards("h", "tao") > 0; + }, + content: function () { + player.chooseToUse({ name: "tao" }, "神躯:是否使用一张桃?").logSkill = "shenqu"; + }, + }, + jiwu: { + derivation: ["qiangxix", "retieji", "olxuanfeng", "rewansha"], + audio: 2, + enable: "phaseUse", + filter: function (event, player) { + if (player.countCards("he") == 0) return false; + if (!player.hasSkill("qiangxix")) return true; + if (!player.hasSkill("retieji")) return true; + if (!player.hasSkill("olxuanfeng")) return true; + if (!player.hasSkill("rewansha")) return true; return false; }, - filterCard:true, - position:'he', - check:function(card){ - if(get.position(card)=='e'&&_status.event.player.hasSkill('olxuanfeng')) return 16-get.value(card); - return 7-get.value(card); + filterCard: true, + position: "he", + check: function (card) { + if (get.position(card) == "e" && _status.event.player.hasSkill("olxuanfeng")) + return 16 - get.value(card); + return 7 - get.value(card); }, - content:function(){ - 'step 0' - var list=[]; - if(!player.hasSkill('qiangxix')) list.push('qiangxix'); - if(!player.hasSkill('retieji')) list.push('retieji'); - if(!player.hasSkill('olxuanfeng')) list.push('olxuanfeng'); - if(!player.hasSkill('rewansha')) list.push('rewansha'); - if(list.length==1){ + content: function () { + "step 0"; + var list = []; + if (!player.hasSkill("qiangxix")) list.push("qiangxix"); + if (!player.hasSkill("retieji")) list.push("retieji"); + if (!player.hasSkill("olxuanfeng")) list.push("olxuanfeng"); + if (!player.hasSkill("rewansha")) list.push("rewansha"); + if (list.length == 1) { player.addTempSkills(list[0]); event.finish(); - } - else{ - player.chooseControl(list,function(){ - if(list.includes('olxuanfeng')&&player.countCards('he',{type:'equip'})) return 'olxuanfeng'; - if(!player.getStat().skill.qiangxix){ - if(player.hasSkill('qiangxix')&&player.getEquip(1)&&list.includes('olxuanfeng')) return 'olxuanfeng'; - if(list.includes('rewansha')||list.includes('qiangxix')){ - var players=game.filterPlayer(); - for(var i=0;i0) return true; + silent: true, + filter: function (event, player) { + if (player.hp != player.storage.hp && player.storage.hp > 0) return true; return false; }, - content:function (){ + content: function () { trigger.cancel(); - player.maxHp=player.storage.maxHp; - player.hp=player.storage.hp; + player.maxHp = player.storage.maxHp; + player.hp = player.storage.hp; player.update(); }, - sub:true, - forced:true, - popup:false, + sub: true, + forced: true, + popup: false, }, - dieBegin:{ - trigger:{ - player:"dieBegin", + dieBegin: { + trigger: { + player: "dieBegin", }, - silent:true, - filter:function (event,player){ - if(player.maxHp!=player.storage.maxHp&&player.storage.maxHp>0) return true; + silent: true, + filter: function (event, player) { + if (player.maxHp != player.storage.maxHp && player.storage.maxHp > 0) return true; return false; }, - content:function (){ + content: function () { trigger.cancel(); - player.maxHp=player.storage.maxHp; - player.hp=player.storage.hp; + player.maxHp = player.storage.maxHp; + player.hp = player.storage.hp; player.update(); }, - sub:true, - forced:true, - popup:false, + sub: true, + forced: true, + popup: false, }, }, }, - "boss_taoni":{ - forced:true, - trigger:{ - global:["gameStart","phaseBefore"], - player:"dieBegin", + boss_taoni: { + forced: true, + trigger: { + global: ["gameStart", "phaseBefore"], + player: "dieBegin", }, - priority:50, - init:function (player){ - player.boss_taoni=function(){ - if(typeof _status.taoni_over!='function'){ - _status.taoni_over=function(str){ + priority: 50, + init: function (player) { + player.boss_taoni = function () { + if (typeof _status.taoni_over != "function") { + _status.taoni_over = function (str) { _status.over = true; game.alert(str); }; } function isDefined(opd) { - if(opd!=undefined){ - if (opd.get||opd.set||opd.writable!=true||opd.configurable!=true){ + if (opd != undefined) { + if (opd.get || opd.set || opd.writable != true || opd.configurable != true) { return true; } } return false; } - var keysArray=["length","players","Player","element"]; - for(var i=0;i四季映姬到阴曹地府
——阴(映)到家了!', + boss_qinguangwang_ab: "秦广王", + boss_qinguangwang: "秦广王·蒋子文", + boss_panguan: "判官", + boss_panguan_info: " 锁定技,你不能成为延时类锦囊的目标。", + boss_juhun: "拘魂", + boss_juhun_info: "锁定技,结束阶段,你令随机一名其他角色的武将牌翻面或横置。", + boss_wangxiang: "望乡", + boss_wangxiang_info: "锁定技,当你死亡时,你令所有其他角色弃置其装备区内的所有牌。", + boss_chujiangwang_ab: "楚江王", + boss_chujiangwang: "楚江王·厉温", + boss_bingfeng: "冰封", + boss_bingfeng_info: "锁定技,你死亡时,若杀死你的角色武将牌是正面朝上, 你令其翻面。", + boss_songdiwang: "宋帝王·余懃", + boss_heisheng: "黑绳", + boss_heisheng_info: "锁定技,你死亡时,横置所有场上角色。", + boss_shengfu: "绳缚", + boss_shengfu_info: "锁定技,你的回合结束时,随机弃置一张场上其他角色的坐骑牌。", + boss_wuguanwang_ab: "五官王", + boss_wuguanwang: "五官王·吕岱", + boss_zhiwang: "治妄", + boss_zhiwang_info: "锁定技,当其他角色于摸牌阶段外得到牌时,你随机弃置其一张手牌。", + boss_zhiwang_planetarian: "注意事项", + boss_zhiwang_planetarian_info: + "若触发〖治妄〗的角色因〖治妄〗触发的其他的技能(如〖伤逝〗〖连营〗等)继续得到了牌,则该角色将其武将牌变更为孙策。", + boss_gongzheng: "公正", + boss_gongzheng_info: "锁定技,准备阶段,若你判定区有牌,你随机弃置一张你判定区的牌。", + boss_xuechi: "血池", + boss_xuechi_info: "锁定技,你的回合结束时,令随机一名其他角色失去2点体力。", + boss_yanluowang_ab: "阎罗王", + boss_yanluowang: "阎罗王·包拯", + boss_tiemian: "铁面", + boss_tiemian_info: "锁定技,你的防具区没有牌时,视为你装备【仁王盾】。", + boss_zhadao: "铡刀", + boss_zhadao_info: "锁定技,你使用【杀】指定目标后,你令目标角色防具无效。", + boss_zhuxin: "诛心", + boss_zhuxin_info: "锁定技,你死亡时,你令场上血量最少的一名其他角色受到2点伤害。", + boss_bianchengwang_ab: "卞城王", + boss_bianchengwang: "卞城王·毕元宾", + boss_leizhou: "雷咒", + boss_leizhou_info: "锁定技,准备阶段,你对随机一名其他角色造成1点雷属性伤害。", + boss_leifu: "雷缚", + boss_leifu_info: "锁定技,你的回合结束时,随机横置一名其他角色。", + boss_leizhu: "雷诛", + boss_leizhu_info: "锁定技,你死亡时,对所有其他角色造成依次造成1点雷属性伤害。", + boss_taishanwang_ab: "泰山王", + boss_taishanwang: "泰山王·董和", + boss_fudu: "服毒", + boss_fudu_info: "锁定技,其他角色使用【桃】时,你令随机另一名其他角色失去1点体力。", + boss_kujiu: "苦酒", + boss_kujiu_info: "锁定技,其他角色准备阶段,你令其失去1点体力,然后该角色视为使用一张【酒】。", + boss_renao: "热恼", + boss_renao_info: "锁定技,你死亡时,你令随机一名其他角色受到3点火属性伤害。", + boss_dushiwang_ab: "都市王", + boss_dushiwang: "都市王·黄中庸", + boss_remen: "热闷", + boss_remen_info: + "锁定技,若你的装备区内没有防具牌,则【南蛮入侵】、【万箭齐发】和普通【杀】对你无效。", + boss_zhifen: "炙焚", + boss_zhifen_info: + "锁定技,准备阶段,你随机选择一名其他角色,获得其1张手牌(没有则不获得),并对其造成1点火属性伤害。", + boss_huoxing: "火刑", + boss_huoxing_info: "锁定技,你死亡时,你对所有其他角色造成1点火属性伤害。", + boss_pingdengwang_ab: "平等王", + boss_pingdengwang: "平等王·陆游", + boss_suozu: "锁足", + boss_suozu_info: "锁定技,准备阶段,你令所有其他角色横置。", + boss_abi: "阿鼻", + boss_abi_info: + "锁定技,锁定技,你受到伤害时,你对伤害来源造成伤害的角色造成1点随机属性伤害(雷或火随机)。", + boss_pingdeng: "平等", + boss_pingdeng_info: + "锁定技,你死亡时,你对体力最多的一名其他角色造成2点随机属性伤害(属性随机),然后再对一名体力最多的其他角色造成1点随机属性伤害(属性随机)。", + boss_zhuanlunwang_ab: "转轮王", + boss_zhuanlunwang: "转轮王·薛礼", + boss_lunhui: "轮回", + boss_lunhui_info: + "锁定技,准备阶段,若你的体力小于等于2,则你与场上除你以外体力最高且大于2的角色交换体力值。", + boss_wangsheng: "往生", + boss_wangsheng_info: "锁定技,你的出牌阶段开始时,视为你随机使用一张【南蛮入侵】或【万箭齐发】。", + boss_zlfanshi: "反噬", + boss_zlfanshi_info: + "锁定技,每个回合你受到第一次伤害后,若再次受到伤害,则对随机一名其他角色造成1点伤害。", + boss_shikieiki_ab: "四季映姫", + boss_shikieiki: "四季映姬·夜魔仙那度", + boss_yingzhong: "映冢", + boss_yingzhong_info: "锁定技。你登场后的第一个回合开始时,你随机获得两个“阴间武将”的全部技能。", + boss_yingzhong_append: + '四季映姬到阴曹地府
——阴(映)到家了!
', //孟婆: - "boss_mengpo":"孟婆", - "boss_shiyou":"拾忧", - "boss_shiyou_info":"其他角色于弃牌阶段弃置的牌进入弃牌堆前,你可以选择其中任意张花色各不相同的牌获得之。", - "boss_wanghun":"忘魂", - "boss_wanghun_info":"锁定技,你死亡时,令随机两名敌方角色各随机失去一个技能(主公技除外),并在牌堆中加入2张回魂。(回魂只能在挑战模式出现)", - "boss_wangshi":"往事", - "boss_wangshi_info":"锁定技,你存活时,敌方角色的回合开始时,令其于本回合不能使用或打出随机一种类型的牌(基本、锦囊、装备)。", - "boss_wangshi2":"往事", - "boss_wangshi2_info":"", + boss_mengpo: "孟婆", + boss_shiyou: "拾忧", + boss_shiyou_info: + "其他角色于弃牌阶段弃置的牌进入弃牌堆前,你可以选择其中任意张花色各不相同的牌获得之。", + boss_wanghun: "忘魂", + boss_wanghun_info: + "锁定技,你死亡时,令随机两名敌方角色各随机失去一个技能(主公技除外),并在牌堆中加入2张回魂。(回魂只能在挑战模式出现)", + boss_wangshi: "往事", + boss_wangshi_info: + "锁定技,你存活时,敌方角色的回合开始时,令其于本回合不能使用或打出随机一种类型的牌(基本、锦囊、装备)。", + boss_wangshi2: "往事", + boss_wangshi2_info: "", //地藏王: - "boss_dizangwang":"地藏王", - "boss_bufo":"不佛", - "boss_bufo_info":"锁定技,你的回合开始时,你对所有距离为1的其他角色造成1点火焰伤害;你受到大于等于2的伤害时,令此伤害-1。", - "boss_wuliang":"无量", - "boss_wuliang_info":"锁定技,你登场时额外摸三张牌;结束阶段开始时,你摸两张牌;你的回合开始时,若你当前体力小于3,则回复至3。", - "boss_dayuan":"大愿", - "boss_dayuan_info":" 当一名角色判定牌最终生效前,你可以指定该判定牌的点数和花色。", - "boss_diting":"谛听", - "boss_diting_info":"锁定技,你的坐骑区被废除,你与别人计算距离时-1,别人与你计算距离时+1;你的坐骑牌均用于重铸。", + boss_dizangwang: "地藏王", + boss_bufo: "不佛", + boss_bufo_info: + "锁定技,你的回合开始时,你对所有距离为1的其他角色造成1点火焰伤害;你受到大于等于2的伤害时,令此伤害-1。", + boss_wuliang: "无量", + boss_wuliang_info: + "锁定技,你登场时额外摸三张牌;结束阶段开始时,你摸两张牌;你的回合开始时,若你当前体力小于3,则回复至3。", + boss_dayuan: "大愿", + boss_dayuan_info: " 当一名角色判定牌最终生效前,你可以指定该判定牌的点数和花色。", + boss_diting: "谛听", + boss_diting_info: + "锁定技,你的坐骑区被废除,你与别人计算距离时-1,别人与你计算距离时+1;你的坐骑牌均用于重铸。", /* //等阶 "boss_sdyl_playerlevel1":"一阶", @@ -9431,59 +10504,71 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ "boss_sdyl_bosslevel5":"五阶", "boss_sdyl_bosslevel5_info":"登场时视为使用一张【南蛮入侵】且此【南蛮入侵】伤害+1。体力上限+1,起始手牌+1。", */ - "boss_sunce":"那个男人", - "boss_hunzi":"魂姿", - "boss_hunzi_info":"觉醒技,准备阶段,若你的体力值为1,你减1点体力上限,失去技能〖魂佑〗并获得技能〖英姿〗和〖英魂〗。", - "boss_jiang":"激昂", - "boss_jiang_info":"①锁定技,〖激昂〗不会无效。
②每当你使用或打出红色牌时,你可以摸一张牌。若你是因响应其他角色使用或打出的牌,则你获得对方使用或打出的牌。
③当有其他角色使用或打出红色牌指定你为目标或响应你后,你可以摸一张牌并获得这些牌。", - "boss_hunyou":"魂佑", - "boss_hunyou_info":"锁定技,你的体力值变化和体力上限变化无效。", - "boss_taoni":"讨逆", - "boss_taoni_info":"锁定技,游戏开始时,每名角色回合开始时或你死亡时,你检查存活角色的合法性。若有角色存在非法行为,则你终止本局游戏。", + boss_sunce: "那个男人", + boss_hunzi: "魂姿", + boss_hunzi_info: + "觉醒技,准备阶段,若你的体力值为1,你减1点体力上限,失去技能〖魂佑〗并获得技能〖英姿〗和〖英魂〗。", + boss_jiang: "激昂", + boss_jiang_info: + "①锁定技,〖激昂〗不会无效。
②每当你使用或打出红色牌时,你可以摸一张牌。若你是因响应其他角色使用或打出的牌,则你获得对方使用或打出的牌。
③当有其他角色使用或打出红色牌指定你为目标或响应你后,你可以摸一张牌并获得这些牌。", + boss_hunyou: "魂佑", + boss_hunyou_info: "锁定技,你的体力值变化和体力上限变化无效。", + boss_taoni: "讨逆", + boss_taoni_info: + "锁定技,游戏开始时,每名角色回合开始时或你死亡时,你检查存活角色的合法性。若有角色存在非法行为,则你终止本局游戏。", - boss_xhuanren:'关卡说明', - boss_xhuanren_info:'', - boss_xhuanren_info_boss:'第一关:挑战秦广王
第二关:挑战楚江王,宋帝王,五官王,阎罗王中的一个
第三关:挑战卞城王,泰山王,都市王,平等王中的一个
第四关:挑战转轮王', + boss_xhuanren: "关卡说明", + boss_xhuanren_info: "", + boss_xhuanren_info_boss: + "第一关:挑战秦广王
第二关:挑战楚江王,宋帝王,五官王,阎罗王中的一个
第三关:挑战卞城王,泰山王,都市王,平等王中的一个
第四关:挑战转轮王", - boss_newhuanren:'关卡说明', - boss_newhuanren_info:'', - boss_newhuanren_info_boss:'第一关:挑战秦广王
第二关:挑战楚江王,宋帝王,五官王,阎罗王中的一个
第三关:挑战卞城王,泰山王,都市王,平等王中的一个
第四关:挑战转轮王
注:孟婆将在每局前三个阶段随机一个阶段登场
地藏王登场规则为,50回合内通过第三关,并且在前三关中成功击杀孟婆。
  • 选陆逊左慈张春华于吉蒋费孔融自动变孙笨', - lingsheji:'灵蛇髻', - lingsheji2:'灵蛇髻', - shanrangzhaoshu:'禅让诏书', - xingtianpojunfu:'刑天破军斧', - noda_axe:'刑天破军斧', - noda_axe2:'刑天破军斧', - jinwuluorigong:'金乌落日弓', - iwasawa_crowbow:'金乌落日弓', - lingsheji_info:'出牌阶段结束时,你可选择:1.摸一张牌。2.将一张武将牌置于武将牌上,并于回合结束后获得此牌。', - shanrangzhaoshu_info:'其他角色于回合外得到牌后,若是其本回合内第一次得到牌,则你可以选择一项:交给其一张牌,或令其交给你一张牌。', - xingtianpojunfu_info:'当你于出牌阶段内使用牌指定唯一目标后,你可弃置两张牌。若如此做,其本回合内不能使用或打出牌且其防具技能无效。', - jinwuluorigong_info:'当你于出牌阶段内一次性失去了两张以上的手牌后,你可以弃置一名其他角色等量的牌。', - TheDayIBecomeAGod:'神杀', - thedayibecomeagod:'传承', - thedayibecomeagod_info:'选择一名其他己方角色。若其势力非神,则改为神势力;若其势力为神,则将武将牌翻至正面,回复体力至体力上限,并将手牌摸至5。', - gubuzifeng:'故步自封', - gubuzifeng_disable:'故步自封', - gubuzifeng_info:'出牌阶段,对一名其他角色使用。其的一个随机技能失效直到其下个回合结束。', - goujiangdesidai:'篝酱的丝带', - goujiangdesidai_info:'锁定技,若你未拥有技能〖纵丝〗,则你视为拥有技能〖纵丝〗;若你拥有技能〖纵丝〗,则你将此技能改为「出牌阶段限两次」。', - goujiangdesidai_skill:'纵丝', - niaobaidaowenha:'鸟白岛文蛤', - niaobaidaowenha_skill:'鸟白岛文蛤', - niaobaidaowenha_info:'当你减少1点体力上限后,你可令一名其他角色增加1点体力上限并回复1点体力。', - niaobaidaowenha_skill_info:'当你减少1点体力上限后,你可令一名其他角色增加1点体力上限并回复1点体力。', - shenzhixiunvfu:'神之修女服', - shenzhixiunvfu_info:'没什么实际作用的衣服,仅仅是显得像个神而已。', + boss_newhuanren: "关卡说明", + boss_newhuanren_info: "", + boss_newhuanren_info_boss: + "第一关:挑战秦广王
    第二关:挑战楚江王,宋帝王,五官王,阎罗王中的一个
    第三关:挑战卞城王,泰山王,都市王,平等王中的一个
    第四关:挑战转轮王
    注:孟婆将在每局前三个阶段随机一个阶段登场
    地藏王登场规则为,50回合内通过第三关,并且在前三关中成功击杀孟婆。
  • 选陆逊左慈张春华于吉蒋费孔融自动变孙笨", + lingsheji: "灵蛇髻", + lingsheji2: "灵蛇髻", + shanrangzhaoshu: "禅让诏书", + xingtianpojunfu: "刑天破军斧", + noda_axe: "刑天破军斧", + noda_axe2: "刑天破军斧", + jinwuluorigong: "金乌落日弓", + iwasawa_crowbow: "金乌落日弓", + lingsheji_info: + "出牌阶段结束时,你可选择:1.摸一张牌。2.将一张武将牌置于武将牌上,并于回合结束后获得此牌。", + shanrangzhaoshu_info: + "其他角色于回合外得到牌后,若是其本回合内第一次得到牌,则你可以选择一项:交给其一张牌,或令其交给你一张牌。", + xingtianpojunfu_info: + "当你于出牌阶段内使用牌指定唯一目标后,你可弃置两张牌。若如此做,其本回合内不能使用或打出牌且其防具技能无效。", + jinwuluorigong_info: + "当你于出牌阶段内一次性失去了两张以上的手牌后,你可以弃置一名其他角色等量的牌。", + TheDayIBecomeAGod: "神杀", + thedayibecomeagod: "传承", + thedayibecomeagod_info: + "选择一名其他己方角色。若其势力非神,则改为神势力;若其势力为神,则将武将牌翻至正面,回复体力至体力上限,并将手牌摸至5。", + gubuzifeng: "故步自封", + gubuzifeng_disable: "故步自封", + gubuzifeng_info: "出牌阶段,对一名其他角色使用。其的一个随机技能失效直到其下个回合结束。", + goujiangdesidai: "篝酱的丝带", + goujiangdesidai_info: + "锁定技,若你未拥有技能〖纵丝〗,则你视为拥有技能〖纵丝〗;若你拥有技能〖纵丝〗,则你将此技能改为「出牌阶段限两次」。", + goujiangdesidai_skill: "纵丝", + niaobaidaowenha: "鸟白岛文蛤", + niaobaidaowenha_skill: "鸟白岛文蛤", + niaobaidaowenha_info: "当你减少1点体力上限后,你可令一名其他角色增加1点体力上限并回复1点体力。", + niaobaidaowenha_skill_info: + "当你减少1点体力上限后,你可令一名其他角色增加1点体力上限并回复1点体力。", + shenzhixiunvfu: "神之修女服", + shenzhixiunvfu_info: "没什么实际作用的衣服,仅仅是显得像个神而已。", - mode_boss_card_config:'挑战卡牌', - mode_boss_character_config:'挑战武将', + mode_boss_card_config: "挑战卡牌", + mode_boss_character_config: "挑战武将", + }, + get: { + rawAttitude: function (from, to) { + var num = to.identity == "zhong" ? 5 : 6; + return from.side === to.side ? num : -num; + }, }, - get:{ - rawAttitude:function(from,to){ - var num=(to.identity=='zhong')?5:6; - return (from.side===to.side?num:-num); - } - } }; }); diff --git a/mode/brawl.js b/mode/brawl.js index 949dd730a..1ddbb59d8 100644 --- a/mode/brawl.js +++ b/mode/brawl.js @@ -1,307 +1,307 @@ -'use strict'; -game.import('mode',function(lib,game,ui,get,ai,_status){ +"use strict"; +game.import("mode", function (lib, game, ui, get, ai, _status) { return { - name:'brawl', - game:{ - syncMenu:true, + name: "brawl", + game: { + syncMenu: true, }, - start:function(){ + start: function () { ui.auto.hide(); - if(!lib.storage.scene){ - lib.storage.scene={}; + if (!lib.storage.scene) { + lib.storage.scene = {}; } - if(!lib.storage.stage){ - lib.storage.stage={}; + if (!lib.storage.stage) { + lib.storage.stage = {}; } - if(!_status.extensionmade){ - _status.extensionmade=[]; + if (!_status.extensionmade) { + _status.extensionmade = []; } - if(_status.extensionscene){ - game.save('scene',lib.storage.scene); + if (_status.extensionscene) { + game.save("scene", lib.storage.scene); } - if(_status.extensionstage){ - game.save('stage',lib.storage.stage); + if (_status.extensionstage) { + game.save("stage", lib.storage.stage); } - var dialog=ui.create.dialog('hidden'); - dialog.classList.add('fixed'); - dialog.classList.add('scroll1'); - dialog.classList.add('scroll2'); - dialog.classList.add('fullwidth'); - dialog.classList.add('fullheight'); - dialog.classList.add('noupdate'); - dialog.classList.add('character'); - dialog.contentContainer.style.overflow='visible'; - dialog.style.overflow='hidden'; - dialog.content.style.height='100%'; - dialog.contentContainer.style.transition='all 0s'; - if(!lib.storage.directStage) dialog.open(); - var packnode=ui.create.div('.packnode',dialog); + var dialog = ui.create.dialog("hidden"); + dialog.classList.add("fixed"); + dialog.classList.add("scroll1"); + dialog.classList.add("scroll2"); + dialog.classList.add("fullwidth"); + dialog.classList.add("fullheight"); + dialog.classList.add("noupdate"); + dialog.classList.add("character"); + dialog.contentContainer.style.overflow = "visible"; + dialog.style.overflow = "hidden"; + dialog.content.style.height = "100%"; + dialog.contentContainer.style.transition = "all 0s"; + if (!lib.storage.directStage) dialog.open(); + var packnode = ui.create.div(".packnode", dialog); lib.setScroll(packnode); - var clickCapt=function(){ - var active=this.parentNode.querySelector('.active'); - if(this.link=='stage'){ - if(get.is.empty(lib.storage.scene)){ - alert('请创建至少1个场景'); + var clickCapt = function () { + var active = this.parentNode.querySelector(".active"); + if (this.link == "stage") { + if (get.is.empty(lib.storage.scene)) { + alert("请创建至少1个场景"); return; } } - if(active){ - if(active==this) return; - for(var i=0;istage.level){ - stage.level=level.index+1; - game.save('stage',stagesave,'brawl'); + if (level.index + 1 > stage.level) { + stage.level = level.index + 1; + game.save("stage", stagesave, "brawl"); } - if(stage.mode!='sequal'){ - game.save('lastStage',level.index+1,'brawl'); + if (stage.mode != "sequal") { + game.save("lastStage", level.index + 1, "brawl"); } - } - else{ - ui.create.control('重新开始',function(){ - if(stage.mode=='sequal'&&bool&&level.index==stage.scenes.length-1){ - game.save('directStage',[stage.name,0],'brawl'); + } else { + ui.create.control("重新开始", function () { + if ( + stage.mode == "sequal" && + bool && + level.index == stage.scenes.length - 1 + ) { + game.save("directStage", [stage.name, 0], "brawl"); + } else { + game.save("directStage", [stage.name, level.index], "brawl"); } - else{ - game.save('directStage',[stage.name,level.index],'brawl'); - } - localStorage.setItem(lib.configprefix+'directstart',true); + localStorage.setItem(lib.configprefix + "directstart", true); game.reload(); }); - if(stage.mode=='sequal'&&level.index==stage.scenes.length-1){ - stage.level=0; - game.save('stage',stagesave,'brawl'); + if (stage.mode == "sequal" && level.index == stage.scenes.length - 1) { + stage.level = 0; + game.save("stage", stagesave, "brawl"); } - if(stage.mode!='sequal'){ - game.save('lastStage',level.index,'brawl'); + if (stage.mode != "sequal") { + game.save("lastStage", level.index, "brawl"); } } delete _status.createControl; }); - var scene=stage.scenes[level.index]; - info={ - name:scene.name, - intro:scene.intro, + var scene = stage.scenes[level.index]; + info = { + name: scene.name, + intro: scene.intro, }; - for(var i in lib.brawl.scene.template){ - info[i]=get.copy(lib.brawl.scene.template[i]); + for (var i in lib.brawl.scene.template) { + info[i] = get.copy(lib.brawl.scene.template[i]); } - if(!scene.gameDraw){ - info.content.noGameDraw=true; + if (!scene.gameDraw) { + info.content.noGameDraw = true; } - info.content.scene=scene; - } - else{ + info.content.scene = scene; + } else { return; } + } else { + info = lib.brawl[active.link]; } - else{ - info=lib.brawl[active.link]; - } - lib.translate.restart='返回'; + lib.translate.restart = "返回"; dialog.delete(); - ui.brawlinfo=ui.create.system('乱斗',null,true); - lib.setPopped(ui.brawlinfo,function(){ - var uiintro=ui.create.dialog('hidden'); - uiintro.add(info.name); - var intro; - if(Array.isArray(info.intro)){ - intro='
      '; - for(var i=0;i'+intro+'
  • '); - var ul=uiintro.querySelector('ul'); - if(ul){ - ul.style.width='180px'; - } - uiintro.add(ui.create.div('.placeholder')); - return uiintro; - },250); + uiintro.add('
    ' + intro + "
    "); + var ul = uiintro.querySelector("ul"); + if (ul) { + ul.style.width = "180px"; + } + uiintro.add(ui.create.div(".placeholder")); + return uiintro; + }, + 250 + ); ui.auto.show(); - _status.brawl=info.content; + _status.brawl = info.content; game.switchMode(info.mode); - if(info.init){ + if (info.init) { info.init(); } } }; - var start=ui.create.div('.menubutton.round.highlight','斗',dialog.content,clickStart); - start.style.position='absolute'; - start.style.left='auto'; - start.style.right='10px'; - start.style.top='auto'; - start.style.bottom='10px'; - start.style.width='80px'; - start.style.height='80px'; - start.style.lineHeight='80px'; - start.style.margin='0'; - start.style.padding='5px'; - start.style.fontSize='72px'; - start.style.zIndex=3; - start.style.transition='all 0s'; - game.addScene=function(name,clear){ - var scene=lib.storage.scene[name]; - var brawl={ - name:name, - intro:scene.intro, + var start = ui.create.div(".menubutton.round.highlight", "斗", dialog.content, clickStart); + start.style.position = "absolute"; + start.style.left = "auto"; + start.style.right = "10px"; + start.style.top = "auto"; + start.style.bottom = "10px"; + start.style.width = "80px"; + start.style.height = "80px"; + start.style.lineHeight = "80px"; + start.style.margin = "0"; + start.style.padding = "5px"; + start.style.fontSize = "72px"; + start.style.zIndex = 3; + start.style.transition = "all 0s"; + game.addScene = function (name, clear) { + var scene = lib.storage.scene[name]; + var brawl = { + name: name, + intro: scene.intro, }; - for(var i in lib.brawl.scene.template){ - brawl[i]=get.copy(lib.brawl.scene.template[i]); + for (var i in lib.brawl.scene.template) { + brawl[i] = get.copy(lib.brawl.scene.template[i]); } - if(!scene.gameDraw){ - brawl.content.noGameDraw=true; + if (!scene.gameDraw) { + brawl.content.noGameDraw = true; } - brawl.content.scene=scene; - lib.brawl['scene_'+name]=brawl; - var node=createNode('scene_'+name); - if(clear){ + brawl.content.scene = scene; + lib.brawl["scene_" + name] = brawl; + var node = createNode("scene_" + name); + if (clear) { game.addSceneClear(); clickCapt.call(node); - _status.sceneChanged=true; + _status.sceneChanged = true; } }; - game.addStage=function(name,clear){ - var stage=lib.storage.stage[name]; - var brawl={ - name:name, - intro:stage.intro, - content:{} + game.addStage = function (name, clear) { + var stage = lib.storage.stage[name]; + var brawl = { + name: name, + intro: stage.intro, + content: {}, }; - for(var i in lib.brawl.stage.template){ - brawl[i]=get.copy(lib.brawl.stage.template[i]); + for (var i in lib.brawl.stage.template) { + brawl[i] = get.copy(lib.brawl.stage.template[i]); } - brawl.content.stage=stage; - lib.brawl['stage_'+name]=brawl; - var node=createNode('stage_'+name); - if(clear){ + brawl.content.stage = stage; + lib.brawl["stage_" + name] = brawl; + var node = createNode("stage_" + name); + if (clear) { game.addStageClear(); clickCapt.call(node); } - } - game.removeScene=function(name){ + }; + game.removeScene = function (name) { delete lib.storage.scene[name]; - game.save('scene',lib.storage.scene); - _status.sceneChanged=true; - for(var i=0;i7){ - nodes[i].index=0; + if (nodes[i].index > 7) { + nodes[i].index = 0; } setPos(nodes[i]); } - },1000); + }, 1000); }, - init:function(){}, - content:{ - submode:'normal', - chooseCharacterBefore:function(){ - game.identityVideoName='幻化之战'; - var skills=[]; - var banned=[ - 'xinfu_guhuo','reguhuo','jixi','duanchang','huashen','xinsheng','rehuashen','rexinsheng', - 'jinqu','nzry_binglve','nzry_huaiju','nzry_yili','nzry_zhenglun','nzry_mingren','nzry_zhenliang','drlt_qingce', - 'new_wuhun','qixing','kuangfeng','dawu','baonu','wumou','ol_wuqian','ol_shenfen','renjie','jilue','nzry_junlve','nzry_dinghuo','drlt_duorui', - 'chuanxin','cunsi', - 'jueqing','huilei','paiyi','fuhun','zhuiyi','olddanshou','yanzhu','juexiang','jiexun','bizhuan','tongbo', - 'xinfu_zhanji','xinfu_jijun','xinfu_fangtong', - 'xinfu_qianchong','pdgyinshi','shuliang', - 'zongkui','guju','bmcanshi','dingpan','xinfu_lingren','new_luoyan','junwei','gxlianhua', - 'qizhou','fenyue','dianhu','linglong','fenxin','mouduan', - 'cuorui','xinmanjuan','xinfu_jianjie','jianjie_faq','new_meibu','xinfu_xingzhao','jici', - 'xianfu','fenyong','xuehen','yingbin','midao','yishe','yinbing','juedi', - 'bushi','xinfu_dianhua','xinfu_falu','xinfu_zhenyi','lskuizhu','pingjian','xjshijian','fentian','zhiri','xindan', - 'xinzhengnan','xinfu_xiaode', - 'komari_xueshang','qiaosi_map', - ]; - var characters=[]; - for(var name in lib.character){ - if(!lib.character[name]) continue; - if(lib.filter.characterDisabled(name)) continue; - if(name.indexOf('old_')==0) continue; - var skillsx=lib.character[name][3].slice(0); - lib.character[name][2]=4; - lib.character[name][3]=[]; - if(lib.character[name][4]) lib.character[name][4].remove('hiddenSkill'); - characters.push(name); - var list=skillsx.slice(0); - for(var j=0;j0; - }, - content:function(){ - target.removeSkillH(target.skillH.randomGet()); - var skills=lib.huanhuazhizhan.skills; - skills.randomSort(); - for(var i=0;i 0; + }, + content: function () { + target.removeSkillH(target.skillH.randomGet()); + var skills = lib.huanhuazhizhan.skills; + skills.randomSort(); + for (var i = 0; i < skills.length; i++) { + if (!target.skillH.includes(skills[i])) { + target.addSkillH(skills[i]); + break; + } } - } - }, - ai:{ - order:10, - result:{ - target:function(){ - return 0.5-Math.random(); + }, + ai: { + order: 10, + result: { + target: function () { + return 0.5 - Math.random(); + }, }, }, }, - }, - hhzz_fudichouxin:{ - enable:true, - cardimage:"fudichouxin", - type:'trick', - filterTarget:function(card,player,target){ - return target.skillH.length>0; - }, - content:function(){ - target.removeSkillH(target.skillH.randomGet()); - }, - ai:{ - order:10, - result:{target:-1}, - }, - }, - }, - character:{ - hhzz_shiona:['female','key',1,['hhzz_huilei']], - hhzz_kanade:['female','key',2,['hhzz_youlian']], - hhzz_takaramono1:['male','qun',5,['hhzz_jubao','hhzz_huizhen']], - hhzz_takaramono2:['male','qun',3,['hhzz_jubao','hhzz_zhencang']], - }, - skill:{ - _lingli_damage:{ - trigger:{source:'damage'}, - forced:true, - popup:false, - filter:function(event,player){ - return event.player==player._toKill; - }, - content:function(){ - game.log(player,'对击杀目标造成了伤害'); - player.changeLingli(trigger.num); - }, - }, - _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); - }, - }, - _lingli_round:{ - trigger:{global:'roundStart'}, - forced:true, - popup:false, - filter:function(event,player){ - return _status._aozhan!=true&&game.roundNumber>1; - }, - content:function(){ - player.changeLingli(1); - }, - }, - _lingli_draw:{ - enable:'phaseUse', - filter:function(event,player){ - return player.storage._lingli>0; - }, - content:function(){ - player.changeLingli(-1); - player.draw(); - }, - delay:0, - ai:{ - order:10, - result:{ - player:function(player){ - return (player.storage._lingli-2*(3-player.skillH.length))>0?1:0; - }, + hhzz_fudichouxin: { + enable: true, + cardimage: "fudichouxin", + type: "trick", + filterTarget: function (card, player, target) { + return target.skillH.length > 0; + }, + content: function () { + target.removeSkillH(target.skillH.randomGet()); + }, + ai: { + order: 10, + result: { target: -1 }, }, }, }, - _lingli_save:{ - trigger:{target:'useCardToTargeted'}, - forced:true, - popup:false, - filter:function(event,player){ - return event.card.name=='tao'&&player==event.player._toSave; - }, - content:function(){ - game.log(trigger.player,'帮助了保护目标'); - trigger.player.changeLingli(1); - }, + character: { + hhzz_shiona: ["female", "key", 1, ["hhzz_huilei"]], + hhzz_kanade: ["female", "key", 2, ["hhzz_youlian"]], + hhzz_takaramono1: ["male", "qun", 5, ["hhzz_jubao", "hhzz_huizhen"]], + hhzz_takaramono2: ["male", "qun", 3, ["hhzz_jubao", "hhzz_zhencang"]], }, - _hhzz_qiankunbagua:{ - trigger:{player:'phaseAfter'}, - forced:true, - forceDie:true, - popup:false, - filter:function(event,player){ - return _status._aozhan&&!player.getStat('damage')&&player.isAlive()||event._lastDead!=undefined; + skill: { + _lingli_damage: { + trigger: { source: "damage" }, + forced: true, + popup: false, + filter: function (event, player) { + return event.player == player._toKill; + }, + content: function () { + game.log(player, "对击杀目标造成了伤害"); + player.changeLingli(trigger.num); + }, }, - content:function(){ - 'step 0' - if(_status._aozhan&&!player.getStat('damage')){ - player.loseHp(); + _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; i < skills[i].length; i++) { + if (!player.skillH.includes(skills[i])) list.push(skills[i]); + if (list.length == 3) break; + } + if (!list.length) { + event.finish(); + return; + } + if (player.storage._lingli > 0) 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" }, + forced: true, + popup: false, + filter: function (event, player) { + return _status._aozhan != true && game.roundNumber > 1; + }, + content: function () { player.changeLingli(1); - game.log(player,'本回合内未造成伤害,触发死战模式惩罚'); - } - if(trigger._lastDead==undefined) event.goto(2); - 'step 1' - var type=get.rand(1,8); - event.type=type; - trigger._lastDead.playerfocus(1200); - player.$fullscreenpop('乾坤八卦·'+['离','坎','乾','震','兑','艮','巽','坤'][type-1],get.groupnature(trigger._lastDead.group,'raw')); - game.delay(1.5); - 'step 2' - var type=event.type; - switch(type){ - case 1:{ - game.countPlayer(function(current){ - current.loseHp(); - }); - break; + }, + }, + _lingli_draw: { + enable: "phaseUse", + filter: function (event, player) { + return player.storage._lingli > 0; + }, + content: function () { + player.changeLingli(-1); + player.draw(); + }, + delay: 0, + ai: { + order: 10, + result: { + player: function (player) { + return player.storage._lingli - + 2 * (3 - player.skillH.length) > + 0 + ? 1 + : 0; + }, + }, + }, + }, + _lingli_save: { + trigger: { target: "useCardToTargeted" }, + forced: true, + popup: false, + filter: function (event, player) { + return event.card.name == "tao" && player == event.player._toSave; + }, + content: function () { + game.log(trigger.player, "帮助了保护目标"); + trigger.player.changeLingli(1); + }, + }, + _hhzz_qiankunbagua: { + trigger: { player: "phaseAfter" }, + forced: true, + forceDie: true, + popup: false, + filter: function (event, player) { + return ( + (_status._aozhan && + !player.getStat("damage") && + player.isAlive()) || + event._lastDead != undefined + ); + }, + content: function () { + "step 0"; + if (_status._aozhan && !player.getStat("damage")) { + player.loseHp(); + player.changeLingli(1); + game.log(player, "本回合内未造成伤害,触发死战模式惩罚"); } - case 2:{ - game.countPlayer(function(current){ - current.draw(2,'nodelay'); - }); - break; - } - case 3:{ - trigger._lastDead.revive(3); - trigger._lastDead.draw(3); - break; - } - case 4:{ - game.countPlayer(function(current){ - var he=current.getCards('he'); - if(he.length) current.discard(he.randomGet()).delay=false; - }); - break; - } - case 5:{ - game.countPlayer(function(current){ - current.changeLingli(1); - }); - break; - } - case 6:{ - var cards=[]; - game.countPlayer(function(current){ - var card=get.cardPile(function(card){ - return !cards.includes(card)&&get.type(card)=='equip'; + if (trigger._lastDead == undefined) event.goto(2); + "step 1"; + var type = get.rand(1, 8); + event.type = type; + trigger._lastDead.playerfocus(1200); + player.$fullscreenpop( + "乾坤八卦·" + + ["离", "坎", "乾", "震", "兑", "艮", "巽", "坤"][ + type - 1 + ], + get.groupnature(trigger._lastDead.group, "raw") + ); + game.delay(1.5); + "step 2"; + var type = event.type; + switch (type) { + case 1: { + game.countPlayer(function (current) { + current.loseHp(); }); - if(card){ - cards.push(card); - current.$gain(card,'gain2') - current.gain(card); - } - }); - break; - } - case 7:{ - game.countPlayer(function(current){ - if(current.skillH.length<3){ - var skills=lib.huanhuazhizhan.skills; - skills.randomSort(); - for(var i=0;i 0; + }, + content: function () { + var cards = player.getCards("he"); + cards.randomSort(); + cards = cards.slice(0, trigger.num); + trigger.source.gain("give", cards, player); + }, + ai: { + effect: { + target: function (card, player, target) { + if (get.tag(card, "damage")) return [15, 0]; + }, + }, + }, }, }, - hhzz_noCard:{ - mod:{ - cardEnabled:function(){return false}, - cardSavable:function(){return false}, - cardRespondable:function(){return false}, - }, - }, - hhzz_huilei:{ - trigger:{player:'die'}, - forced:true, - forceDie:true, - skillAnimation:true, - logTarget:'source', - filter:function(event,player){ - return event.source!=undefined; - }, - content:function(){ - var source=trigger.source; - var cards=source.getCards('he'); - if(cards.length) source.discard(cards); - }, - ai:{ - effect:{ - target:function(card,player,target){ - if(get.tag(card,'damage')) return [-5,0]; - } - } - } - }, - hhzz_youlian:{ - trigger:{player:'die'}, - forced:true, - forceDie:true, - skillAnimation:true, - logTarget:'source', - filter:function(event,player){ - return event.source!=undefined; - }, - content:function(){ - var source=trigger.source; - var cards=source.getCards('he'); - if(cards.length) source.discard(cards); - var skills=source.skillH; - if(skills.length) source.removeSkillH(skills.randomGet()); - }, - ai:{ - effect:{ - target:function(card,player,target){ - if(get.tag(card,'damage')) return [-5,0]; - } - } - } - }, - hhzz_zhencang:{ - trigger:{player:'die'}, - forced:true, - filter:function(event,player){ - return event.source!=undefined; - }, - forceDie:true, - logTarget:'source', - content:function(){ - var source=trigger.source; - source.draw(); - if(source.skillH.length==3) source.removeSkillH(source.skillH.randomGet()); - var skills=lib.huanhuazhizhan.skills; - skills.randomSort(); - for(var i=0;i0; - }, - content:function(){ - var cards=player.getCards('he'); - cards.randomSort(); - cards=cards.slice(0,trigger.num); - trigger.source.gain('give',cards,player); - }, - ai:{ - effect:{ - target:function(card,player,target){ - if(get.tag(card,'damage')) return [15,0]; - } - } - } + translate: { + _lingli: "聚灵", + _lingli_bg: "灵", + _lingli_draw: "聚灵", + hhzz_huilei: "挥泪", + hhzz_youlian: "犹怜", + hhzz_zhencang: "珍藏", + hhzz_huizhen: "汇珍", + hhzz_jubao: "聚宝", + hhzz_huilei_info: "锁定技,杀死你的角色弃置所有的牌。", + hhzz_youlian_info: "锁定技,杀死你的角色弃置所有牌并随机失去一个技能。", + hhzz_zhencang_info: + "锁定技,杀死你的角色摸一张牌并随机获得一个技能(已满则先随机移除一个)。", + hhzz_huizhen_info: + "锁定技,杀死你的角色摸三张牌并随机获得一个技能(已满则先随机移除一个)。", + hhzz_jubao_info: + "锁定技,当你受到伤害的点数确定时,伤害来源随机获得你区域内的X张牌(X为伤害点数)。", + hhzz_shiona: "汐奈", + hhzz_kanade: "立华奏", + hhzz_takaramono1: "坚实宝箱", + hhzz_takaramono2: "普通宝箱", + hhzz_toulianghuanzhu: "偷梁换柱", + hhzz_fudichouxin: "釜底抽薪", + hhzz_toulianghuanzhu_info: + "出牌阶段,对一名角色使用,随机更换其一个技能。可重铸。", + hhzz_fudichouxin_info: "出牌阶段,对一名角色使用,随机弃置其一个技能。", + nei: " ", + nei2: " ", + 刷新_info: "消耗1点灵力值,刷新上述技能。", }, }, - translate:{ - _lingli:'聚灵', - _lingli_bg:'灵', - _lingli_draw:'聚灵', - hhzz_huilei:'挥泪', - hhzz_youlian:'犹怜', - hhzz_zhencang:'珍藏', - hhzz_huizhen:'汇珍', - hhzz_jubao:'聚宝', - hhzz_huilei_info:'锁定技,杀死你的角色弃置所有的牌。', - hhzz_youlian_info:'锁定技,杀死你的角色弃置所有牌并随机失去一个技能。', - hhzz_zhencang_info:'锁定技,杀死你的角色摸一张牌并随机获得一个技能(已满则先随机移除一个)。', - hhzz_huizhen_info:'锁定技,杀死你的角色摸三张牌并随机获得一个技能(已满则先随机移除一个)。', - hhzz_jubao_info:'锁定技,当你受到伤害的点数确定时,伤害来源随机获得你区域内的X张牌(X为伤害点数)。', - hhzz_shiona:'汐奈', - hhzz_kanade:'立华奏', - hhzz_takaramono1:'坚实宝箱', - hhzz_takaramono2:'普通宝箱', - hhzz_toulianghuanzhu:'偷梁换柱', - hhzz_fudichouxin:'釜底抽薪', - hhzz_toulianghuanzhu_info:'出牌阶段,对一名角色使用,随机更换其一个技能。可重铸。', - hhzz_fudichouxin_info:'出牌阶段,对一名角色使用,随机弃置其一个技能。', - nei:' ', - nei2:' ', - 刷新_info:'消耗1点灵力值,刷新上述技能。', + get: { + rawAttitude: function (from, to) { + if (from == to || to == from._toSave) return 10; + if (to == from._toKill) return -30; + return -10; + }, }, - }, - get:{ - rawAttitude:function(from,to){ - if(from==to||to==from._toSave) return 10; - if(to==from._toKill) return -30; - return -10; + eltc: { + gameDraw: function () { + var end = player; + var numx; + var num = function (player) { + return player._hSeat > 5 ? 5 : 4; + }; + do { + if (typeof num == "function") { + numx = num(player); + } + if (player._hSeat > 6) player.changeLingli(1); + player.directgain(get.cards(numx)); + player = player.next; + } while (player != end); + }, + }, + eltp: { + addSkillH: function (skill) { + this.skillH.add(skill); + this.addSkillLog.apply(this, arguments); + }, + removeSkillH: function (skill) { + this.skillH.remove(skill); + game.log(this, "失去了技能", "#g【" + get.translation(skill) + "】"); + this.removeSkill(skill); + }, + dieAfter: function () { + var evt = _status.event.getParent("phase"); + if (evt) evt._lastDead = this; + if (game.playerx().length == 1) game.over(game.me.isAlive()); + }, + $dieAfter: function () {}, + hasUnknown: function () { + return false; + }, + isUnknown: function () { + return false; + }, + getEnemies: function () { + var list = game.playerx(); + list.remove(this); + return list; + }, + dieAfter2: function (source) { + if (source && this.name.indexOf("hhzz_") != 0) { + if (source._toKill == this) game.log(source, "击杀目标成功"); + source.draw(this == source._toKill ? 2 : 1); + source.changeLingli(this == source._toKill ? 3 : 2); + } + if (!_status._aozhan) { + var that = this; + game.countPlayer(function (current) { + if (current._toSave == that) { + game.log(current, "保护失败"); + var cards = current.getCards("he"); + if (cards.length) current.discard(cards.randomGets(4)); + } + }); + } + }, + logAi: function () {}, + changeLingli: function (num) { + if (typeof num != "number") num = 1; + if (typeof this.storage._lingli != "number") this.storage._lingli = 0; + if (num > 0) { + num = Math.min(num, 5 - this.storage._lingli); + if (num < 1) return; + game.log(this, "获得了", "#y" + get.cnNumber(num) + "点", "灵力"); + } else { + if (-num > this.storage._lingli) num = -this.storage._lingli; + if (num == 0) return; + game.log(this, "失去了", "#y" + get.cnNumber(-num) + "点", "灵力"); + } + this.storage._lingli += num; + this.markSkill("_lingli"); + }, + }, + game: { + playerx: function () { + return game.filterPlayer(function (current) { + if (current.name.indexOf("hhzz_") == 0) return; + return true; + }); + }, + randomMission: function () { + if (_status._aozhan) return; + if (!ui.huanhuazhizhan) { + ui.huanhuazhizhan = ui.create.div(".touchinfo.left", ui.window); + if (ui.time3) ui.time3.style.display = "none"; + } + var players = game.playerx(); + for (var i = 0; i < players.length; i++) { + var player = players[i]; + var list = players.slice(0).randomSort(); + list.remove(player); + player._toKill = list[0]; + player._toSave = list[1]; + } + ui.huanhuazhizhan.innerHTML = + "击杀" + + get.translation(game.me._toKill) + + ",保护" + + get.translation(game.me._toSave); + }, + getSkillDialog: function (skills, prompt) { + var dialog = ui.create.dialog("hidden", "forcebutton"); + if (prompt) dialog.addText(prompt); + for (var i = 0; i < skills.length; i++) { + dialog.add( + '" + ); + } + dialog.addText("
    "); + return dialog; + }, + chooseCharacter: function () { + var next = game.createEvent("chooseCharacter"); + next.showConfig = true; + next.setContent(function () { + "step 0"; + game.zhu = game.players.randomGet(); + var i = 1; + var current = game.zhu; + while (true) { + current.skillH = []; + current._hSeat = i; + current.identity = "nei"; + current.setNickname(get.cnNumber(i, true) + "号位"); + for (var ii in lib.huanhuazhizhan.eltp) + current[ii] = lib.huanhuazhizhan.eltp[ii]; + current = current.next; + i++; + if (current == game.zhu) break; + } + ui.arena.classList.add("choose-character"); + game.me.chooseButton( + [ + "请选择角色形象", + [_status.characterlist.randomRemove(5), "character"], + ], + true + ).onfree = true; + "step 1"; + game.me.init(result.links[0]); + var list = ["xiandeng", "shulv", "xisheng"]; + game.me.chooseControl(list).dialog = game.getSkillDialog( + list, + "选择要获得的初始技能" + ); + "step 2"; + var list = [ + "_lingli", + "_lingli_round", + "_lingli_draw", + "_lingli_save", + "_hhzz_qiankunbagua", + "_lingli_damage", + ]; + for (var i = 0; i < list.length; i++) { + game.addGlobalSkill(list[i]); + } + game.me.addSkillH(result.control); + game.countPlayer(function (current) { + if (!current.name) { + current.init(_status.characterlist.randomRemove(1)[0]); + current.addSkillH( + ["xiandeng", "shulv", "xisheng"].randomGet() + ); + } + current.storage._lingli = 0; + current.markSkill("_lingli"); + }); + game.showIdentity(true); + "step 3"; + game.randomMission(); + var list = [ + game.createCard("hhzz_fudichouxin"), + game.createCard("hhzz_toulianghuanzhu"), + game.createCard("hhzz_toulianghuanzhu"), + game.createCard("hhzz_toulianghuanzhu"), + ]; + for (var i = 0; i < list.length; i++) { + ui.cardPile.insertBefore( + list[i], + ui.cardPile.childNodes[ + get.rand(ui.cardPile.childElementCount) + ] + ); + } + game.updateRoundNumber(); + "step 4"; + setTimeout(function () { + ui.arena.classList.remove("choose-character"); + }, 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: {}, + }, + card: { + hhzz_toulianghuanzhu: { + cardimage: "toulianghuanzhu", + }, + hhzz_fudichouxin: { + cardimage: "fudichouxin", + }, + }, + character: { + hhzz_shiona: ["female", "key", 1, ["hhzz_huilei"]], + hhzz_kanade: ["female", "key", 2, ["hhzz_youlian"]], + hhzz_takaramono1: [ + "male", + "qun", + 5, + ["hhzz_jubao", "hhzz_huizhen"], + ], + hhzz_takaramono2: [ + "male", + "qun", + 3, + ["hhzz_jubao", "hhzz_zhencang"], + ], + }, + translate: { + _lingli: "聚灵", + _lingli_bg: "灵", + _lingli_draw: "聚灵", + hhzz_huilei: "挥泪", + hhzz_youlian: "犹怜", + hhzz_zhencang: "珍藏", + hhzz_huizhen: "汇珍", + hhzz_jubao: "聚宝", + hhzz_huilei_info: "锁定技,杀死你的角色弃置所有的牌。", + hhzz_youlian_info: + "锁定技,杀死你的角色弃置所有牌并随机失去一个技能。", + hhzz_zhencang_info: + "锁定技,杀死你的角色摸一张牌并随机获得一个技能(已满则先随机移除一个)。", + hhzz_huizhen_info: + "锁定技,杀死你的角色摸三张牌并随机获得一个技能(已满则先随机移除一个)。", + hhzz_jubao_info: + "锁定技,当你受到伤害的点数确定时,伤害来源随机获得你区域内的X张牌(X为伤害点数)。", + nei: " ", + nei2: " ", + hhzz_shiona: "汐奈", + hhzz_kanade: "立华奏", + hhzz_takaramono1: "坚实宝箱", + hhzz_takaramono2: "普通宝箱", + hhzz_toulianghuanzhu: "偷梁换柱", + hhzz_fudichouxin: "釜底抽薪", + hhzz_toulianghuanzhu_info: + "出牌阶段,对一名角色使用,随机更换其一个技能。可重铸。", + hhzz_fudichouxin_info: + "出牌阶段,对一名角色使用,随机弃置其一个技能。", + }, + }); + }); + }, + }, + }; + var func = function (pack) { + for (var i in pack.pack) { + for (var j in pack.pack[i]) lib[i][j] = pack.pack[i][j]; } - }, - eltc:{ - gameDraw:function(){ - var end=player; - var numx; - var num=function(player){ - return player._hSeat>5?5:4; - }; - do{ - if(typeof num=='function'){ - numx=num(player); - } - if(player._hSeat>6) player.changeLingli(1); - player.directgain(get.cards(numx)); - player=player.next; - } - while(player!=end); - }, - }, - eltp:{ - addSkillH:function(skill){ - this.skillH.add(skill); - this.addSkillLog.apply(this,arguments); - }, - removeSkillH:function(skill){ - this.skillH.remove(skill); - game.log(this,'失去了技能','#g【'+get.translation(skill)+'】'); - this.removeSkill(skill); - }, - dieAfter:function(){ - var evt=_status.event.getParent('phase'); - if(evt) evt._lastDead=this; - if(game.playerx().length==1) game.over(game.me.isAlive()); - }, - $dieAfter:function(){}, - hasUnknown:function(){return false}, - isUnknown:function(){return false}, - getEnemies:function(){ - var list=game.playerx(); - list.remove(this); - return list; - }, - dieAfter2:function(source){ - if(source&&this.name.indexOf('hhzz_')!=0){ - if(source._toKill==this) game.log(source,'击杀目标成功'); - source.draw(this==source._toKill?2:1); - source.changeLingli(this==source._toKill?3:2); - } - if(!_status._aozhan){ - var that=this; - game.countPlayer(function(current){ - if(current._toSave==that){ - game.log(current,'保护失败'); - var cards=current.getCards('he'); - if(cards.length) current.discard(cards.randomGets(4)); - } - }); - } - }, - logAi:function(){}, - changeLingli:function(num){ - if(typeof num!='number') num=1; - if(typeof this.storage._lingli!='number') this.storage._lingli=0; - if(num>0){ - num=Math.min(num,5-this.storage._lingli); - if(num<1) return; - game.log(this,'获得了','#y'+get.cnNumber(num)+'点','灵力'); - } - else{ - if(-num>this.storage._lingli) num=-this.storage._lingli; - if(num==0) return; - game.log(this,'失去了','#y'+get.cnNumber(-num)+'点','灵力'); - } - this.storage._lingli+=num; - this.markSkill('_lingli'); - }, - }, - game:{ - playerx:function(){ - return game.filterPlayer(function(current){ - if(current.name.indexOf('hhzz_')==0) return; - return true; - }); - }, - randomMission:function(){ - if(_status._aozhan) return; - if(!ui.huanhuazhizhan){ - ui.huanhuazhizhan=ui.create.div('.touchinfo.left',ui.window); - if(ui.time3) ui.time3.style.display='none'; - } - var players=game.playerx(); - for(var i=0;i
    【'+get.translation(skills[i])+'】
    '+lib.translate[skills[i]+'_info']+'
    '); - } - dialog.addText('
    '); - return dialog; - }, - chooseCharacter:function(){ - var next=game.createEvent('chooseCharacter'); - next.showConfig=true; - next.setContent(function(){ - 'step 0' - game.zhu=game.players.randomGet(); - var i=1; - var current=game.zhu; - while(true){ - current.skillH=[]; - current._hSeat=i; - current.identity='nei'; - current.setNickname(get.cnNumber(i,true)+'号位'); - for(var ii in lib.huanhuazhizhan.eltp) current[ii]=lib.huanhuazhizhan.eltp[ii]; - current=current.next; - i++; - if(current==game.zhu) break; - } - ui.arena.classList.add('choose-character'); - game.me.chooseButton(['请选择角色形象',[_status.characterlist.randomRemove(5),'character']],true).onfree=true; - 'step 1' - game.me.init(result.links[0]); - var list=['xiandeng','shulv','xisheng']; - game.me.chooseControl(list).dialog=game.getSkillDialog(list,'选择要获得的初始技能'); - 'step 2' - var list=['_lingli','_lingli_round','_lingli_draw','_lingli_save','_hhzz_qiankunbagua','_lingli_damage']; - for(var i=0;i7){ - setTimeout(function(){ - while(node.nodes.length>5){ + card.style.opacity = 1; + card.style.transform = "scale(1) rotate(" + rand3 + "deg)"; + if (node.nodes.length > 7) { + setTimeout(function () { + while (node.nodes.length > 5) { node.nodes.shift().delete(); } - },500); + }, 500); } }; - if(init){ - node.nodes=[]; - for(var i=0;i<5;i++){ + if (init) { + node.nodes = []; + for (var i = 0; i < 5; i++) { func(); } } - node.showcaseinterval=setInterval(func,1000); + node.showcaseinterval = setInterval(func, 1000); }, - content:{ - cardPile:function(list){ - game.identityVideoName='毒战三国杀'; - lib.config.bannedcards.remove('du'); - if(game.bannedcards) game.bannedcards.remove('du'); - var num=Math.ceil(list.length/10); - while(num--){ - list.push([['heart','diamond','club','spade'].randomGet(),Math.ceil(Math.random()*13),'du']); + content: { + cardPile: function (list) { + game.identityVideoName = "毒战三国杀"; + lib.config.bannedcards.remove("du"); + if (game.bannedcards) game.bannedcards.remove("du"); + var num = Math.ceil(list.length / 10); + while (num--) { + list.push([ + ["heart", "diamond", "club", "spade"].randomGet(), + Math.ceil(Math.random() * 13), + "du", + ]); } return list; - } + }, }, }, - daozhiyueying:{ - name:'导师月英', - mode:'identity', - intro:'牌堆中所有普通锦囊牌数量翻倍;移除拥有集智技能的角色', - showcase:function(init){ - var node=this; - var player1,player2; - if(init){ - player1=ui.create.player(null,true).init('huangyueying'); - player2=ui.create.player(null,true); - if(lib.character.jsp_huangyueying){ - player2.init('jsp_huangyueying'); + daozhiyueying: { + name: "导师月英", + mode: "identity", + intro: "牌堆中所有普通锦囊牌数量翻倍;移除拥有集智技能的角色", + showcase: function (init) { + var node = this; + var player1, player2; + if (init) { + player1 = ui.create.player(null, true).init("huangyueying"); + player2 = ui.create.player(null, true); + if (lib.character.jsp_huangyueying) { + player2.init("jsp_huangyueying"); + } else if (lib.character.re_huangyueying) { + player2.init("re_huangyueying"); + } else { + player2.init("huangyueying"); } - else if(lib.character.re_huangyueying){ - player2.init('re_huangyueying'); - } - else{ - player2.init('huangyueying'); - } - player1.style.left='20px'; - player1.style.top='20px'; - player1.style.transform='scale(0.9)'; - player1.node.count.innerHTML='2'; - player1.node.count.dataset.condition='mid'; - player2.style.left='auto'; - player2.style.right='20px'; - player2.style.top='20px'; - player2.style.transform='scale(0.9)'; - player2.node.count.innerHTML='2'; - player2.node.count.dataset.condition='mid'; + player1.style.left = "20px"; + player1.style.top = "20px"; + player1.style.transform = "scale(0.9)"; + player1.node.count.innerHTML = "2"; + player1.node.count.dataset.condition = "mid"; + player2.style.left = "auto"; + player2.style.right = "20px"; + player2.style.top = "20px"; + player2.style.transform = "scale(0.9)"; + player2.node.count.innerHTML = "2"; + player2.node.count.dataset.condition = "mid"; this.appendChild(player1); this.appendChild(player2); - this.player1=player1; - this.player2=player2; - } - else{ - player1=this.player1; - player2=this.player2; + this.player1 = player1; + this.player2 = player2; + } else { + player1 = this.player1; + player2 = this.player2; } - var createCard=function(wuxie){ + var createCard = function (wuxie) { var card; - if(wuxie){ - card=game.createCard('wuxie','noclick'); - card.style.transform='scale(0.9)'; + if (wuxie) { + card = game.createCard("wuxie", "noclick"); + card.style.transform = "scale(0.9)"; + } else { + card = ui.create.card(null, "noclick", true); } - else{ - card=ui.create.card(null,'noclick',true); - } - card.style.opacity=0; - card.style.position='absolute'; - card.style.zIndex=2; - card.style.margin=0; + card.style.opacity = 0; + card.style.position = "absolute"; + card.style.zIndex = 2; + card.style.margin = 0; return card; - } + }; - var func=function(){ - game.linexy([ - player1.getLeft()+player1.offsetWidth/2, - player1.getTop()+player1.offsetHeight/2, - player2.getLeft()+player2.offsetWidth/2, - player2.getTop()+player2.offsetHeight/2, - ],node); - var card=createCard(true); - card.style.left='43px'; - card.style.top='58px'; + var func = function () { + game.linexy( + [ + player1.getLeft() + player1.offsetWidth / 2, + player1.getTop() + player1.offsetHeight / 2, + player2.getLeft() + player2.offsetWidth / 2, + player2.getTop() + player2.offsetHeight / 2, + ], + node + ); + var card = createCard(true); + card.style.left = "43px"; + card.style.top = "58px"; node.appendChild(card); ui.refresh(card); - card.style.opacity=1; - card.style.transform='scale(0.9) translate(137px,152px)'; - setTimeout(function(){ + card.style.opacity = 1; + card.style.transform = "scale(0.9) translate(137px,152px)"; + setTimeout(function () { card.delete(); - },1000); - player1.node.count.innerHTML='1'; + }, 1000); + player1.node.count.innerHTML = "1"; - setTimeout(function(){ - if(!node.showcaseinterval) return; - player1.node.count.innerHTML='2'; - var card=createCard(); - card.style.left='43px'; - card.style.top='58px'; - card.style.transform='scale(0.9) translate(137px,152px)'; + setTimeout(function () { + if (!node.showcaseinterval) return; + player1.node.count.innerHTML = "2"; + var card = createCard(); + card.style.left = "43px"; + card.style.top = "58px"; + card.style.transform = "scale(0.9) translate(137px,152px)"; node.appendChild(card); ui.refresh(card); - card.style.opacity=1; - card.style.transform='scale(0.9)'; - setTimeout(function(){ + card.style.opacity = 1; + card.style.transform = "scale(0.9)"; + setTimeout(function () { card.delete(); - },1000); - },300); + }, 1000); + }, 300); - setTimeout(function(){ - if(!node.showcaseinterval) return; - player2.node.count.innerHTML='1'; - game.linexy([ - player2.getLeft()+player2.offsetWidth/2, - player2.getTop()+player2.offsetHeight/2, - player1.getLeft()+player1.offsetWidth/2, - player1.getTop()+player1.offsetHeight/2, - ],node); - var card=createCard(true); - card.style.left='auto'; - card.style.right='43px'; - card.style.top='58px'; + setTimeout(function () { + if (!node.showcaseinterval) return; + player2.node.count.innerHTML = "1"; + game.linexy( + [ + player2.getLeft() + player2.offsetWidth / 2, + player2.getTop() + player2.offsetHeight / 2, + player1.getLeft() + player1.offsetWidth / 2, + player1.getTop() + player1.offsetHeight / 2, + ], + node + ); + var card = createCard(true); + card.style.left = "auto"; + card.style.right = "43px"; + card.style.top = "58px"; node.appendChild(card); ui.refresh(card); - card.style.opacity=1; - card.style.transform='scale(0.9) translate(-137px,152px)'; - setTimeout(function(){ + card.style.opacity = 1; + card.style.transform = "scale(0.9) translate(-137px,152px)"; + setTimeout(function () { card.delete(); - },700); + }, 700); - setTimeout(function(){ - if(!node.showcaseinterval) return; - player2.node.count.innerHTML='2'; - var card=createCard(); - card.style.left='auto'; - card.style.right='43px'; - card.style.top='58px'; - card.style.transform='scale(0.9) translate(-137px,152px)'; + setTimeout(function () { + if (!node.showcaseinterval) return; + player2.node.count.innerHTML = "2"; + var card = createCard(); + card.style.left = "auto"; + card.style.right = "43px"; + card.style.top = "58px"; + card.style.transform = "scale(0.9) translate(-137px,152px)"; node.appendChild(card); ui.refresh(card); - card.style.opacity=1; - card.style.transform='scale(0.9)'; - setTimeout(function(){ + card.style.opacity = 1; + card.style.transform = "scale(0.9)"; + setTimeout(function () { card.delete(); - },700); - },300); - },1000); + }, 700); + }, 300); + }, 1000); }; - node.showcaseinterval=setInterval(func,2200); + node.showcaseinterval = setInterval(func, 2200); func(); }, - init:function(){ - for(var i in lib.character){ - var skills=lib.character[i][3] - if(skills.includes('jizhi')||skills.includes('rejizhi')||skills.includes('lingzhou')||skills.includes('sbaiyin')){ + init: function () { + for (var i in lib.character) { + var skills = lib.character[i][3]; + if ( + skills.includes("jizhi") || + skills.includes("rejizhi") || + skills.includes("lingzhou") || + skills.includes("sbaiyin") + ) { delete lib.character[i]; } } }, - content:{ - cardPile:function(list){ - game.identityVideoName='导师月英'; - var list2=[]; - for(var i=0;i=5){ - num=0; + if (num >= 5) { + num = 0; } - },700); + }, 700); }, - init:function(){ - game.identityVideoName='唯我独尊'; - lib.skill.weiwoduzun={ - mark:true, - intro:{ - content:'杀造成的伤害+1' + init: function () { + game.identityVideoName = "唯我独尊"; + lib.skill.weiwoduzun = { + mark: true, + intro: { + content: "杀造成的伤害+1", }, - group:['weiwoduzun_damage','weiwoduzun_lose'], - subSkill:{ - damage:{ - trigger:{source:'damageBegin'}, - forced:true, - filter:function(event){ - return event.card&&event.card.name=='sha'&&event.notLink(); + group: ["weiwoduzun_damage", "weiwoduzun_lose"], + subSkill: { + damage: { + trigger: { source: "damageBegin" }, + forced: true, + filter: function (event) { + return event.card && event.card.name == "sha" && event.notLink(); }, - content:function(){ + content: function () { trigger.num++; - } - }, - lose:{ - trigger:{player:'damageEnd'}, - forced:true, - filter:function(event){ - return event.source&&event.source.isAlive(); }, - content:function(){ - player.removeSkill('weiwoduzun'); - trigger.source.addSkill('weiwoduzun'); - } - } - } + }, + lose: { + trigger: { player: "damageEnd" }, + forced: true, + filter: function (event) { + return event.source && event.source.isAlive(); + }, + content: function () { + player.removeSkill("weiwoduzun"); + trigger.source.addSkill("weiwoduzun"); + }, + }, + }, }; - lib.translate.weiwoduzun='战神'; - lib.translate.weiwoduzun_bg='尊'; + lib.translate.weiwoduzun = "战神"; + lib.translate.weiwoduzun_bg = "尊"; }, - content:{ - cardPile:function(list){ - var num=0; - for(var i=0;i4){ - setTimeout(function(){ - while(node.nodes.length>3){ + card.style.transform = "scale(0.9) rotate(" + rand3 + "deg)"; + card.style.opacity = 1; + if (node.nodes.length > 4) { + setTimeout(function () { + while (node.nodes.length > 3) { node.nodes.shift().delete(); } - },500); + }, 500); } }; - node.list=[]; - if(init){ - node.nodes=[]; - for(var i=0;i<3;i++){ + node.list = []; + if (init) { + node.nodes = []; + for (var i = 0; i < 3; i++) { func(); } } - node.showcaseinterval=setInterval(func,1000); + node.showcaseinterval = setInterval(func, 1000); }, - init:function(){ - var map={}; - var map3=[]; - var list1=['司','夏','诸','皇']; - var list2=['马','侯','葛','甫']; - for(var i in lib.character){ - if(lib.filter.characterDisabled(i)) continue; - if(lib.character[i][1]=='key') continue; - var surname=get.rawName2(i); - for(var j=0;j7){ - nodes[i].index=0; + if (nodes[i].index > 7) { + nodes[i].index = 0; } setPos(nodes[i]); } - },1000); + }, 1000); }, - content:{ - gameStart:function(){ - game.identityVideoName='同将模式'; - var target=(_status.mode=='zhong')?game.zhong:game.zhu; - if(get.config('double_character')){ - target.init(game.me.name1,game.me.name2); - } - else{ + content: { + gameStart: function () { + game.identityVideoName = "同将模式"; + var target = _status.mode == "zhong" ? game.zhong : game.zhu; + if (get.config("double_character")) { + target.init(game.me.name1, game.me.name2); + } else { target.init(game.me.name1); } target.hp++; target.maxHp++; target.update(); - if(get.config('choose_group')){ - var list=lib.group.slice(0); - list.remove('shen'); - game.players.forEach(i=>{ - if(i.group=='shen'&&i!=game.me){ - var group=list.randomGet(); - i.group=group; - i.node.name.dataset.nature=get.groupnature(group); + if (get.config("choose_group")) { + var list = lib.group.slice(0); + list.remove("shen"); + game.players.forEach((i) => { + if (i.group == "shen" && i != game.me) { + var group = list.randomGet(); + i.group = group; + i.node.name.dataset.nature = get.groupnature(group); i.update(); } }); } }, - chooseCharacterAi:function(player,list,list2,back){ - if(player==game.zhu){ + chooseCharacterAi: function (player, list, list2, back) { + if (player == game.zhu) { return; - } - else{ - if(get.config('double_character')){ - player.init(game.me.name1,game.me.name2); - } - else{ + } else { + if (get.config("double_character")) { + player.init(game.me.name1, game.me.name2); + } else { player.init(game.me.name1); } } }, - chooseCharacter:function(list,list2,num){ - if(game.me!=game.zhu){ - return list.slice(0,list2); - } - else{ - if(_status.event.zhongmode){ - return list.slice(0,6); - } - else{ - return list.concat(list2.slice(0,num)); + chooseCharacter: function (list, list2, num) { + if (game.me != game.zhu) { + return list.slice(0, list2); + } else { + if (_status.event.zhongmode) { + return list.slice(0, 6); + } else { + return list.concat(list2.slice(0, num)); } } }, - chooseCharacterBefore:function(){ - if(_status.mode=='purple') _status.mode='normal'; + chooseCharacterBefore: function () { + if (_status.mode == "purple") _status.mode = "normal"; }, - } + }, }, - jiazuzhizheng:{ - name:'家族之争', - mode:'versus', - submode:'2v2', - intro:'势力相同的武将组合一队,获得专属势力技能', - showcase:function(init){ - var node=this; - var getList=function(){ - var list=[ - ['liubei','guanyu','zhangfei'], - ['caocao','guojia','xunyu'], - ['sunquan','zhangzhang','zhouyu'], - ['re_yuanshao','guotufengji','yj_jushou'], - ['jin_simayi','jin_simazhao','jin_wangyuanji'], + jiazuzhizheng: { + name: "家族之争", + mode: "versus", + submode: "2v2", + intro: "势力相同的武将组合一队,获得专属势力技能", + showcase: function (init) { + var node = this; + var getList = function () { + var list = [ + ["liubei", "guanyu", "zhangfei"], + ["caocao", "guojia", "xunyu"], + ["sunquan", "zhangzhang", "zhouyu"], + ["re_yuanshao", "guotufengji", "yj_jushou"], + ["jin_simayi", "jin_simazhao", "jin_wangyuanji"], ]; - if(_status.keyVerified) list.push(['key_yuri','key_yuzuru','sp_key_kanade']) + if (_status.keyVerified) list.push(["key_yuri", "key_yuzuru", "sp_key_kanade"]); list.randomSort(); - var list2=[]; - for(var i=0;i4){ - setTimeout(function(){ - while(node.nodes.length>3){ + card.style.transform = "scale(0.9) rotate(" + rand3 + "deg)"; + card.style.opacity = 1; + if (node.nodes.length > 4) { + setTimeout(function () { + while (node.nodes.length > 3) { node.nodes.shift().delete(); } - },500); + }, 500); } }; - node.list=[]; - if(init){ - node.nodes=[]; - for(var i=0;i<3;i++){ + node.list = []; + if (init) { + node.nodes = []; + for (var i = 0; i < 3; i++) { func(); } } - node.showcaseinterval=setInterval(func,1000); + node.showcaseinterval = setInterval(func, 1000); }, - init:function(){}, - content:{ - submode:'two', - chooseCharacterFixed:true, - chooseCharacterBefore:function(){ - _status.noReplaceCharacter=true; - game.versusVideoName='家族之争'; - var map={ - wei:[], - shu:[], - wu:[], - qun:[], - jin:[], - key:[], + init: function () {}, + content: { + submode: "two", + chooseCharacterFixed: true, + 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.includes(i)) continue; - var group=lib.character[i][1]; - if(group&&map[group]) map[group].push(i); + 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.includes(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)){ + for (var i in map) { + if (map[i].length < 8 || (i == "key" && !_status.keyVerified)) { delete map[i]; - } - else{ + } 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; + _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' + 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; + 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); + position: "he", + ai1: function (card) { + return 6 - get.value(card); }, - ai2:function(target){ - return 1/(1+target.countCards('he')); + ai2: function (target) { + return 1 / (1 + target.countCards("he")); }, }); - 'step 1' - if(result.bool){ - player.logSkill(event.name,result.targets); + "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(); + 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; + _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; + 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.includes(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.includes(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.includes(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" + content: function () { player.draw(); - "step 1" + }, + }, + _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.includes(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.includes(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.includes(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(); + "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; + 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'); + qunxin_temp: { + noGlobal: true, + onremove: true, + mod: { + maxHandcard: function (player, num) { + return num + player.countMark("qunxin_temp"); }, }, }, - _jiazu_awaken_wei:{ - popup:'许昌', - intro:{ - content:'锁定技,当你受到伤害后,你摸一张牌。', + _jiazu_awaken_wei: { + popup: "许昌", + intro: { + content: "锁定技,当你受到伤害后,你摸一张牌。", }, - trigger:{player:'damageEnd'}, - forced:true, - filter:function(event,player){ - return player._jiazuAwaken&&player.group=='wei'; + trigger: { player: "damageEnd" }, + forced: true, + filter: function (event, player) { + return player._jiazuAwaken && player.group == "wei"; + }, + content: function () { + player.draw(); }, - content:function(){player.draw()}, }, - _jiazu_awaken_shu:{ - popup:'成都', - intro:{ - content:'锁定技,当你使用【杀】造成伤害后,你摸一张牌。', + _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'; + 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(); }, - content:function(){player.draw()}, }, - _jiazu_awaken_wu:{ - popup:'武昌', - intro:{ - content:'锁定技,当你使用装备牌时,你摸一张牌。', + _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'; + trigger: { player: "useCard" }, + forced: true, + filter: function (event, player) { + return ( + player._jiazuAwaken && + player.group == "wu" && + get.type(event.card) == "equip" + ); + }, + content: function () { + player.draw(); }, - content:function(){player.draw()}, }, - _jiazu_awaken_qun:{ - popup:'邺城', - intro:{ - content:'锁定技,当你使用锦囊牌指定其他角色为目标后,你摸一张牌。', + _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; + trigger: { player: ["loseHpEnd", "recoverEnd"] }, + forced: true, + filter: function (event, player) { + return player._jiazuAwaken && player.group == "key"; + }, + content: function () { + player.draw(); + }, + }, + _jiazu_awaken_jin: { + popup: "洛阳", + intro: { + content: "锁定技,结束阶段,若你手牌中的花色数小于3,则你摸一张牌。", + }, + trigger: { player: "phaseJieshuBegin" }, + forced: true, + filter: function (event, player) { + if (!player._jiazuAwaken || player.group != "jin") return false; + var hs = player.getCards("h"), + suits = []; + if (hs.length < 3) return true; + for (var i of hs) { + suits.add(get.suit(i, player)); + if (suits.length > 2) return false; } return true; }, - content:function(){ + content: function () { player.draw(); }, }, - _jiazu_awaken:{ - trigger:{global:'die'}, - forced:true, - filter:function(event,player){ - return !player._jiazuAwaken&&event.player.side==player.side; + _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); + 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; + 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].prompt2) { + lib.translate[i + "_info"] = skill[i].prompt2; + translate[i + "_info"] = skill[i].prompt2; } - if(!skill[i].noGlobal) game.addGlobalSkill(i); + 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:'摸牌阶段结束时,你可以展示你于此阶段内因摸牌而得到的牌。若这些牌的花色均不同,则你摸一张牌。', + game.addVideo("arrangeLib", null, { + skill: { + _jiazu_wei: { + popup: "魏业", + prompt2: + "回合开始时,你可以弃置一张牌并指定一名敌方角色,该角色须弃置一张牌,否则你摸一张牌。", }, - _jiazu_key:{ - popup:'键魂', - prompt2:'出牌阶段限一次,你可以摸一张牌并获得1点护甲。若如此做,你于当前回合结束时失去1点体力。', - }, - _jiazu_awaken_wei:{ - popup:'许昌', - intro:{ - content:'锁定技,当你受到伤害后,你摸一张牌。', + _jiazu_shu: { + popup: "蜀义", + prompt2: + "你使用【杀】上限+1;出牌阶段结束时,若你于此阶段使用【杀】次数不少于2,摸一张牌。", }, - }, - _jiazu_awaken_shu:{ - popup:'成都', - intro:{ - content:'锁定技,当你使用【杀】造成伤害后,你摸一张牌。', + _jiazu_wu: { + popup: "吴耀", + prompt2: "回合结束时,若你的手牌数不等于你的体力值,则你摸一张牌。", }, - }, - _jiazu_awaken_wu:{ - popup:'武昌', - intro:{ - content:'锁定技,当你使用装备牌时,你摸一张牌。', + _jiazu_qun: { + popup: "群心", + prompt2: + "锁定技,弃牌阶段开始时,若你的手牌数比体力值多2或更多,你本回合手牌上限+1;若你已损失体力值大于1,你手牌上限+1", }, - }, - _jiazu_awaken_qun:{ - popup:'邺城', - intro:{ - content:'锁定技,当你使用锦囊牌指定其他角色为目标后,你摸一张牌。', + _jiazu_jin: { + popup: "晋势", + prompt2: + "摸牌阶段结束时,你可以展示你于此阶段内因摸牌而得到的牌。若这些牌的花色均不同,则你摸一张牌。", }, - }, - _jiazu_awaken_jin:{ - popup:'洛阳', - intro:{ - content:'锁定技,结束阶段,若你手牌中的花色数小于3,则你摸一张牌。', + _jiazu_key: { + popup: "键魂", + prompt2: + "出牌阶段限一次,你可以摸一张牌并获得1点护甲。若如此做,你于当前回合结束时失去1点体力。", + }, + _jiazu_awaken_wei: { + popup: "许昌", + intro: { + content: "锁定技,当你受到伤害后,你摸一张牌。", }, }, - _jiazu_awaken_key:{ - 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: {}, }, - _jiazu_awaken:{}, - }, - translate:translate, + translate: translate, }); }, - chooseCharacter:function(list,player){ - if(player.side==game.me.side){ - if(_status.brawl.mylist){ - return _status.brawl.mylist.randomGets(player==game.me?5:3); + chooseCharacter: function (list, player) { + if (player.side == game.me.side) { + if (_status.brawl.mylist) { + return _status.brawl.mylist.randomGets(player == game.me ? 5 : 3); + } + } else { + if (_status.brawl.enemylist) { + return _status.brawl.enemylist.randomGets(player == game.me ? 5 : 3); } } - else{ - if(_status.brawl.enemylist){ - return _status.brawl.enemylist.randomGets(player==game.me?5:3); - } + var surname = _status.brawl.map3.randomRemove(); + var list = _status.brawl.map[surname]; + if (player == game.me) { + _status.brawl.mylist = list; + } else { + _status.brawl.enemylist = list; } - var surname=_status.brawl.map3.randomRemove(); - var list=_status.brawl.map[surname]; - if(player==game.me){ - _status.brawl.mylist=list; - } - else{ - _status.brawl.enemylist=list; - } - return list.randomRemove(player==game.me?5:3); - } - } + return list.randomRemove(player == game.me ? 5 : 3); + }, + }, }, - baiyidujiang:{ - name:'白衣渡江', - mode:'versus', - submode:'2v2', - showcase:function(init){ - var node=this; - var player1,player2; - if(init){ - player1=ui.create.player(null,true); - player1.classList.add('fullskin'); + baiyidujiang: { + name: "白衣渡江", + mode: "versus", + submode: "2v2", + showcase: function (init) { + var node = this; + var player1, player2; + if (init) { + player1 = ui.create.player(null, true); + player1.classList.add("fullskin"); player1.node.avatar.show(); - player1.node.avatar.setBackground('lvmeng','character'); - player2=ui.create.player(null,true) - player2.classList.add('fullskin'); + player1.node.avatar.setBackground("lvmeng", "character"); + player2 = ui.create.player(null, true); + player2.classList.add("fullskin"); player2.node.avatar.show(); - player2.node.avatar.setBackground('guanyu','character'); + player2.node.avatar.setBackground("guanyu", "character"); player1.node.marks.remove(); player1.node.hp.remove(); player2.node.marks.remove(); player2.node.hp.remove(); - player1.style.left='20px'; - player1.style.top='20px'; - player1.style.transform='scale(0.9)'; + player1.style.left = "20px"; + player1.style.top = "20px"; + player1.style.transform = "scale(0.9)"; player1.node.count.remove(); - player2.style.left='auto'; - player2.style.right='20px'; - player2.style.top='20px'; - player2.style.transform='scale(0.9)'; + player2.style.left = "auto"; + player2.style.right = "20px"; + player2.style.top = "20px"; + player2.style.transform = "scale(0.9)"; player2.node.count.remove(); this.appendChild(player1); this.appendChild(player2); - this.player1=player1; - this.player2=player2; + this.player1 = player1; + this.player2 = player2; + } else { + player1 = this.player1; + player2 = this.player2; } - else{ - player1=this.player1; - player2=this.player2; - } - var func=function(){ - setTimeout(function(){ + var func = function () { + setTimeout(function () { player1.smoothAvatar(); player2.smoothAvatar(); - player1.node.avatar.setBackground('re_lvmeng','character'); - player2.node.avatar.setBackground('re_guanyu','character'); - },1500); - setTimeout(function(){ + player1.node.avatar.setBackground("re_lvmeng", "character"); + player2.node.avatar.setBackground("re_guanyu", "character"); + }, 1500); + setTimeout(function () { player1.smoothAvatar(); player2.smoothAvatar(); - player1.node.avatar.setBackground('sp_lvmeng','character'); - player2.node.avatar.setBackground('jsp_guanyu','character'); - },3000); - setTimeout(function(){ + player1.node.avatar.setBackground("sp_lvmeng", "character"); + player2.node.avatar.setBackground("jsp_guanyu", "character"); + }, 3000); + setTimeout(function () { player1.smoothAvatar(); player2.smoothAvatar(); - player1.node.avatar.setBackground('shen_lvmeng','character'); - player2.node.avatar.setBackground('shen_guanyu','character'); - },4500); - setTimeout(function(){ + player1.node.avatar.setBackground("shen_lvmeng", "character"); + player2.node.avatar.setBackground("shen_guanyu", "character"); + }, 4500); + setTimeout(function () { player1.smoothAvatar(); player2.smoothAvatar(); - player1.node.avatar.setBackground('lvmeng','character'); - player2.node.avatar.setBackground('guanyu','character'); - },6000); + player1.node.avatar.setBackground("lvmeng", "character"); + player2.node.avatar.setBackground("guanyu", "character"); + }, 6000); }; - node.showcaseinterval=setInterval(func,6000); + node.showcaseinterval = setInterval(func, 6000); func(); }, - intro:[ - '玩家在选将时可从8张武将牌里选择两张武将牌,一张面向大家可见(加入游戏),另一张是隐藏面孔(暗置)', - '选择的两张武将牌需满足以下至少两个条件:1.性别相同;2.体力上限相同;3.技能数量相同', - '每名玩家在其回合开始或回合结束时,可以选择将自己的武将牌弃置,然后使用暗置的武将牌进行剩余的游戏' + intro: [ + "玩家在选将时可从8张武将牌里选择两张武将牌,一张面向大家可见(加入游戏),另一张是隐藏面孔(暗置)", + "选择的两张武将牌需满足以下至少两个条件:1.性别相同;2.体力上限相同;3.技能数量相同", + "每名玩家在其回合开始或回合结束时,可以选择将自己的武将牌弃置,然后使用暗置的武将牌进行剩余的游戏", ], - 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: { + 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); + 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']='此模式下不可用'; + }), + 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]; + 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; + 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; + 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; + _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 choose = []; + _status.characterlist = list; + event.filterChoice = function (name1, name2) { + var info1 = lib.character[name1]; + var info2 = lib.character[name2]; + if (!info1 || !info2) return; + var num = 0; + if (info1[0] == info2[0]) num++; + if (get.infoMaxHp(info1[2]) == get.infoMaxHp(info2[2])) num++; + if (info1[3].length == info2[3].length) num++; + return num > 1; }; - 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;i 1) { + 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 < skills.length; i++) { + if (lib.skill[skills[i]].temp) { + game.fellow.removeSkill(skills[i]); + } + } + var cards = game.fellow.getCards("hej"); + while (cards.length) { + ui.discardPile.appendChild(cards.shift()); } } - var cards=game.fellow.getCards('hej'); - while(cards.length){ - ui.discardPile.appendChild(cards.shift()); + "step 1"; + if (game.fellow) { + game.dead.remove(game.fellow); + game.fellow.remove(); + game.fan.dataset.position = 1; + ui.arena.setNumber(2); + game.zhu.next = game.fan; + game.fan.next = game.zhu; + game.zhu.nextSeat = game.fan; + game.fan.nextSeat = game.zhu; } - } - 'step 1' - if(game.fellow){ - game.dead.remove(game.fellow); - game.fellow.remove(); - game.fan.dataset.position=1; - ui.arena.setNumber(2); - game.zhu.next=game.fan; - game.fan.next=game.zhu; - game.zhu.nextSeat=game.fan; - game.fan.nextSeat=game.zhu; - } - if(_status.qianlidanji.completeNumber!=5){ - 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 + + "关)" + ); } - if(_status.qianlidanji.completeNumber>=6){ - list.push('我不想再打了,直接在这里结束吧!'); - list2.push(function(){ + "step 2"; + if (_status.qianlidanji.completeNumber != 5) { + if (result.index == 3) { game.over(true); - }); + return; + } + event.reward = event.list[result.index]; } - event.list=list2; - game.zhu.chooseControl().set('choiceList',list).set('prompt','请选择一项奖励(当前已通过'+_status.qianlidanji.completeNumber+'关)'); - } - 'step 2' - if(_status.qianlidanji.completeNumber!=5){ - if(result.index==3){ - game.over(true); - return; + _status.characterlist.removeArray(_status.qianlidanji.used); + if (_status.qianlidanji.completeNumber == 5) + event._result = { links: ["caiyang"] }; + else + game.zhu.chooseButton( + [ + "选择下一关出战的对手", + [_status.characterlist.randomGets(3), "character"], + ], + true + ); + "step 3"; + _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; } - event.reward=event.list[result.index]; - } - _status.characterlist.removeArray(_status.qianlidanji.used); - if(_status.qianlidanji.completeNumber==5) event._result={links:['caiyang']}; - else game.zhu.chooseButton(['选择下一关出战的对手',[_status.characterlist.randomGets(3),'character']],true); - 'step 3' - _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); - while(cards.length){ - cards.shift().discard(); - } - var evt=_status.event.getParent('phase'); - if(evt){ - game.resetSkills(); - _status.event=evt; - _status.event.finish(); - _status.event.untrigger(true); - } - }, - }; - _status.qianlidanji.player_number=get.config('player_number'); - game.saveConfig('player_number','2','identity'); + 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.finish(); + _status.event.untrigger(true); + } + }, + }; + _status.qianlidanji.player_number = get.config("player_number"); + game.saveConfig("player_number", "2", "identity"); }, - 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'; + 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.zhu.identityShown = true; + game.zhu.node.identity.classList.remove("guessing"); game.fan.setIdentity(); - game.fan.identityShown=true; - game.fan.node.identity.classList.remove('guessing'); + 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 = []; + 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); + _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); + if (event.swapnodialog) { + dialog = ui.dialog; + event.swapnodialog(dialog, list); delete event.swapnodialog; + } else { + var str = "选择角色"; + dialog = ui.create.dialog(str, "hidden", [list, "character"]); } - else{ - var str='选择角色'; - dialog=ui.create.dialog(str,'hidden',[list,'character']); - } - dialog.setCaption('选择角色'); - game.me.chooseButton(dialog,true).set('onfree',true); + 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){ + 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){ + if (game.changeCoin) { game.changeCoin(-3); } event.list.randomSort(); - list=event.list.slice(0,5); + 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.addTempClass('start'); + 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.addTempClass("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.addTempClass('controlpressdownx',500); - ui.cheat2.classList.remove('disabled'); + if (lib.onfree) { + lib.onfree.push(function () { + event.dialogxx = ui.create.characterDialog("heightset"); + if (ui.cheat2) { + ui.cheat2.addTempClass("controlpressdownx", 500); + ui.cheat2.classList.remove("disabled"); } }); - } - else{ - event.dialogxx=ui.create.characterDialog('heightset'); + } 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){ + 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; + _status.event.dialog = this.backup; this.backup.open(); delete this.backup; game.uncheck(); game.check(); - if(ui.cheat){ - ui.cheat.addTempClass('controlpressdownx',500); - ui.cheat.classList.remove('disabled'); + if (ui.cheat) { + ui.cheat.addTempClass("controlpressdownx", 500); + ui.cheat.classList.remove("disabled"); } - } - else{ - if(game.changeCoin){ + } else { + if (game.changeCoin) { game.changeCoin(-10); } - this.backup=_status.event.dialog; + this.backup = _status.event.dialog; _status.event.dialog.close(); - _status.event.dialog=_status.event.parent.dialogxx; - this.dialog=_status.event.dialog; + _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 (ui.cheat) { + ui.cheat.classList.add("disabled"); } } }); - if(lib.onfree){ - ui.cheat2.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(); } - 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){ + "step 1"; + if (ui.cheat) { ui.cheat.close(); delete ui.cheat; } - if(ui.cheat2){ + if (ui.cheat2) { ui.cheat2.close(); delete ui.cheat2; } @@ -3031,1611 +3469,1962 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ 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 + .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.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){ + if (event.draw) { game.zhu.directgain(get.cards(event.draw)); } - setTimeout(function(){ - ui.arena.classList.remove('choose-character'); - },500); + 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'],[]], + var pack = { + character: { + pujing: ["male", "qun", 1, [], []], + huban: ["male", "qun", 2, [], []], + caiyang: ["male", "qun", 1, ["zhuixi"], []], }, - translate:{ - pujing:'普净', - huban:'胡班', + translate: { + pujing: "普净", + huban: "胡班", }, - skill:{ - qianlidanji_phase:{ - trigger:{global:'phaseBefore'}, - forced:true, - silent:true, - firstDo:true, - content:function(){ - player.removeSkill('qianlidanji_phase'); + 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]; + 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.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; }); }; - } - } + }, + }, }, - liangjunduilei:{ - name:'两军对垒', - mode:'versus', - submode:'2v2', - showcase:function(init){ - var node=this; - var player1,player2; - var list=[ - ['re_sp_zhugeliang','yujin_yujin','re_zhangliao','re_lusu'], - ['re_huangzhong','re_xiahouyuan','zhanghe','xin_fazheng'], - ['re_caocao','xin_yuanshao','guotufengji','re_guojia'], - ['chunyuqiong','sp_xuyou','re_xuhuang','gaolan'], - ['re_sp_zhugeliang','re_zhangzhang','guyong','re_lusu'], - ['yj_jushou','re_caocao','jsp_guanyu','re_yanwen'], - ['re_lingtong','re_lidian','re_zhangliao','re_ganning'], - ['re_guanyu','caoren','re_lvmeng','guanping'], + liangjunduilei: { + name: "两军对垒", + mode: "versus", + submode: "2v2", + showcase: function (init) { + var node = this; + var player1, player2; + var list = [ + ["re_sp_zhugeliang", "yujin_yujin", "re_zhangliao", "re_lusu"], + ["re_huangzhong", "re_xiahouyuan", "zhanghe", "xin_fazheng"], + ["re_caocao", "xin_yuanshao", "guotufengji", "re_guojia"], + ["chunyuqiong", "sp_xuyou", "re_xuhuang", "gaolan"], + ["re_sp_zhugeliang", "re_zhangzhang", "guyong", "re_lusu"], + ["yj_jushou", "re_caocao", "jsp_guanyu", "re_yanwen"], + ["re_lingtong", "re_lidian", "re_zhangliao", "re_ganning"], + ["re_guanyu", "caoren", "re_lvmeng", "guanping"], ].randomGet(); - if(_status.keyVerified){ - list=[ - ['caozhen','key_hisako','key_iwasawa','sp_key_kanade'], - ].randomGet(); + if (_status.keyVerified) { + list = [["caozhen", "key_hisako", "key_iwasawa", "sp_key_kanade"]].randomGet(); } - if(init){ - player1=ui.create.player(null,true); - player2=ui.create.player(null,true); + if (init) { + player1 = ui.create.player(null, true); + player2 = ui.create.player(null, true); player1.node.marks.remove(); player1.node.hp.remove(); player2.node.marks.remove(); player2.node.hp.remove(); - player1.style.left='20px'; - player1.style.top='20px'; - player1.style.transform='scale(0.9)'; + player1.style.left = "20px"; + player1.style.top = "20px"; + player1.style.transform = "scale(0.9)"; player1.node.count.remove(); - player2.style.left='auto'; - player2.style.right='20px'; - player2.style.top='20px'; - player2.style.transform='scale(0.9)'; + player2.style.left = "auto"; + player2.style.right = "20px"; + player2.style.top = "20px"; + player2.style.transform = "scale(0.9)"; player2.node.count.remove(); this.appendChild(player1); this.appendChild(player2); - this.player1=player1; - this.player2=player2; + this.player1 = player1; + this.player2 = player2; + } else { + player1 = this.player1; + player2 = this.player2; } - else{ - player1=this.player1; - player2=this.player2; - } - var player3,player4; - if(init){ - player3=ui.create.player(null,true); - player4=ui.create.player(null,true); + var player3, player4; + if (init) { + player3 = ui.create.player(null, true); + player4 = ui.create.player(null, true); player3.node.marks.remove(); player3.node.hp.remove(); player4.node.marks.remove(); player4.node.hp.remove(); - player3.style.left='60px'; - player3.style.top='120px'; - player3.style.transform='scale(0.9)'; + player3.style.left = "60px"; + player3.style.top = "120px"; + player3.style.transform = "scale(0.9)"; player3.node.count.remove(); - player4.style.left='auto'; - player4.style.right='60px'; - player4.style.top='120px'; - player4.style.transform='scale(0.9)'; + player4.style.left = "auto"; + player4.style.right = "60px"; + player4.style.top = "120px"; + player4.style.transform = "scale(0.9)"; player4.node.count.remove(); this.appendChild(player3); this.appendChild(player4); - this.player3=player3; - this.player4=player4; - } - else{ - player3=this.player3; - player4=this.player4; + this.player3 = player3; + this.player4 = player4; + } else { + player3 = this.player3; + player4 = this.player4; } player1.init(list[0]); player2.init(list[1]); player3.init(list[3]); player4.init(list[2]); }, - intro:['双方使用特定的武将,搭配特定的技能,还原特定的经典场景'], - content:{ - submode:'two', - chooseCharacterBefore:function(){ - var list=[ + intro: ["双方使用特定的武将,搭配特定的技能,还原特定的经典场景"], + 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'],[]], + 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:'鲁子敬', + 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'],[]], + 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:'定军法正', + 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'],[]], + 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:'官渡郭嘉', + 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'],[]], + 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:'乌巢高览', + 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'],[]], + 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:'鲁子敬', + 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'],[]], + 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:'颜文双雄', + 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'],[]], + 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:'合肥甘宁', + 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'],[]], + 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:'荆州关平', + 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'],[]], + 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:'遣军', + translate: { + liubei: "雒城刘备", + re_wuyi: "雒城吴懿", + zhangren: "雒城张任", + pangtong: "雒城庞统", + rezhijian: "厚恩", + zhijian: "厚恩", + jijiu: "驰援", + reyingzi: "征令", + rerende: "遣军", }, }, }, ]; - if(_status.keyVerified) list=[ + 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: "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:'球队领袖', + { + 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']='此模式下不可用'; + ]; + 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); + 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); } - 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]; + 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++){ + 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; + player.side = pack.place[i]; + player = player.next; } - for(var i=0;i=0;i--){ + for (var i = scene.cardPileTop.length - 1; i >= 0; i--) { list.unshift(parseInfo(scene.cardPileTop[i])); } - for(var i=0;igame.players[i].maxHp){ - game.players[i].hp=game.players[i].maxHp; + var info = game.players[i].brawlinfo; + if (info.maxHp) { + game.players[i].maxHp = info.maxHp; + if (game.players[i].hp > game.players[i].maxHp) { + game.players[i].hp = game.players[i].maxHp; } } - if(info.hp){ - game.players[i].hp=info.hp; - if(game.players[i].hp>game.players[i].maxHp){ - game.players[i].maxHp=game.players[i].hp; + if (info.hp) { + game.players[i].hp = info.hp; + if (game.players[i].hp > game.players[i].maxHp) { + game.players[i].maxHp = game.players[i].hp; } } game.players[i].update(); } - var scene=_status.brawl.scene; - var over=function(str){ - switch(str){ - case 'win':game.over(true);break; - case 'lose':game.over(false);break; - case 'tie':game.over('平局');break; + var scene = _status.brawl.scene; + var over = function (str) { + switch (str) { + case "win": + game.over(true); + break; + case "lose": + game.over(false); + break; + case "tie": + game.over("平局"); + break; } - } - if(scene.turns){ - var turns=scene.turns[0]; - lib.onphase.push(function(){ + }; + if (scene.turns) { + var turns = scene.turns[0]; + lib.onphase.push(function () { turns--; - if(turns<0){ + if (turns < 0) { over(scene.turns[1]); } }); } - if(scene.washes){ - var washes=scene.washes[0]; - lib.onwash.push(function(){ + if (scene.washes) { + var washes = scene.washes[0]; + lib.onwash.push(function () { washes--; - if(washes<=0){ + if (washes <= 0) { over(scene.washes[1]); } }); } }, - chooseCharacterBefore:function(){ - var scene=_status.brawl.scene; - var playercontrol=[]; - var maxpos=0; - for(var i=0;ibb?1:-1; + if (aa != bb) { + return aa > bb ? 1 : -1; } - return a>b?1:-1; + return a > b ? 1 : -1; }); - list.unshift(['random','自选主将']); - var name1=ui.create.selectlist(list,list[0],line2); - name1.style.marginLeft='3px'; - name1.style.marginRight='3px'; - name1.style.maxWidth='80px'; - list[0][1]='自选副将'; - list.unshift(['none','无副将']); - var name2=ui.create.selectlist(list,list[0],line2); - name2.style.marginLeft='3px'; - name2.style.marginRight='3px'; - name2.style.maxWidth='80px'; + list.unshift(["random", "自选主将"]); + var name1 = ui.create.selectlist(list, list[0], line2); + name1.style.marginLeft = "3px"; + name1.style.marginRight = "3px"; + name1.style.maxWidth = "80px"; + list[0][1] = "自选副将"; + list.unshift(["none", "无副将"]); + var name2 = ui.create.selectlist(list, list[0], line2); + name2.style.marginLeft = "3px"; + name2.style.marginRight = "3px"; + name2.style.maxWidth = "80px"; - var capt9=ui.create.div(style2,'','编辑牌堆',this); - capt9.style.display='none'; + var capt9 = ui.create.div(style2, "", "编辑牌堆", this); + capt9.style.display = "none"; - var capt2=ui.create.div(style2,'','添加卡牌',this); - var line3=ui.create.div(style2,this); - line3.style.display='none'; - capt1.style.display='none'; - capt2.style.display='none'; + var capt2 = ui.create.div(style2, "", "添加卡牌", this); + var line3 = ui.create.div(style2, this); + line3.style.display = "none"; + capt1.style.display = "none"; + capt2.style.display = "none"; - var line5=ui.create.div(style2,this); - line5.style.display='none'; - var pileaddlist=[]; - for(var i=0;i替换牌堆'); - line11.style.display='none'; - var replacepile=ui.create.node('input',line11); - replacepile.type='checkbox'; + var line11 = ui.create.div(style2, this, "", "替换牌堆"); + line11.style.display = "none"; + var replacepile = ui.create.node("input", line11); + replacepile.type = "checkbox"; - ui.create.node('span',line11,'开局摸牌',{marginLeft:'10px'}); - var gameDraw=ui.create.node('input',line11); - gameDraw.type='checkbox'; - gameDraw.checked=true; + ui.create.node("span", line11, "开局摸牌", { marginLeft: "10px" }); + var gameDraw = ui.create.node("input", line11); + gameDraw.type = "checkbox"; + gameDraw.checked = true; - var capt_t=ui.create.div(style2,'','牌堆顶',this); - var line6_t=ui.create.div(style2,this); - var capt_b=ui.create.div(style2,'','牌堆底',this); - var line6_b=ui.create.div(style2,this); - var capt_d=ui.create.div(style2,'','弃牌堆',this); - var line6_d=ui.create.div(style2,this); - line6_d.style.marginBottom='10px'; - capt_t.style.display='none'; - capt_b.style.display='none'; - capt_d.style.display='none'; + var capt_t = ui.create.div(style2, "", "牌堆顶", this); + var line6_t = ui.create.div(style2, this); + var capt_b = ui.create.div(style2, "", "牌堆底", this); + var line6_b = ui.create.div(style2, this); + var capt_d = ui.create.div(style2, "", "弃牌堆", this); + var line6_d = ui.create.div(style2, this); + line6_d.style.marginBottom = "10px"; + capt_t.style.display = "none"; + capt_b.style.display = "none"; + capt_d.style.display = "none"; - var line4=ui.create.div(style2,this); - line4.style.display='none'; - line4.style.marginTop='20px'; - var resetCharacter=function(){ + var line4 = ui.create.div(style2, this); + line4.style.display = "none"; + line4.style.marginTop = "20px"; + var resetCharacter = function () { // line1.style.display='block'; - editPile.disabled=false; + editPile.disabled = false; // editCode.disabled=false; - saveButton.disabled=false; + saveButton.disabled = false; // exportButton.disabled=false; - line7.style.display='block'; - line2.style.display='none'; - line2_t.style.display='none'; - line3.style.display='none'; - line4.style.display='none'; - line5.style.display='none'; - line6_h.style.display='none'; - line6_e.style.display='none'; - line6_j.style.display='none'; - capt1.style.display='none'; - capt2.style.display='none'; - capt_h.style.display='none'; - capt_e.style.display='none'; - capt_j.style.display='none'; + line7.style.display = "block"; + line2.style.display = "none"; + line2_t.style.display = "none"; + line3.style.display = "none"; + line4.style.display = "none"; + line5.style.display = "none"; + line6_h.style.display = "none"; + line6_e.style.display = "none"; + line6_j.style.display = "none"; + capt1.style.display = "none"; + capt2.style.display = "none"; + capt_h.style.display = "none"; + capt_e.style.display = "none"; + capt_j.style.display = "none"; - name1.value='random'; - name2.value='none'; - identity.value='fan'; - position.value='0'; - hp.value=''; - maxHp.value=''; - line6_h.innerHTML=''; - line6_e.innerHTML=''; - line6_j.innerHTML=''; - cardpileaddname.value='random'; - cardpileaddsuit.value='random'; - cardpileaddnumber.value='random'; - linked.checked=false; - turnedover.checked=false; - playercontrol.checked=false; + name1.value = "random"; + name2.value = "none"; + identity.value = "fan"; + position.value = "0"; + hp.value = ""; + maxHp.value = ""; + line6_h.innerHTML = ""; + line6_e.innerHTML = ""; + line6_j.innerHTML = ""; + cardpileaddname.value = "random"; + cardpileaddsuit.value = "random"; + cardpileaddnumber.value = "random"; + linked.checked = false; + turnedover.checked = false; + playercontrol.checked = false; }; - var createCharacter=function(info){ - var player=ui.create.player(null,true); - player._customintro=function(uiintro){ - if(info.handcards.length){ - uiintro.addText('手牌',true); - var hs=ui.create.div('.buttons'); - for(var i=0;i stage.level) { + node.classList.add("unselectable"); } } - else if(stage.mode=='normal'){ - if(i>stage.level){ - node.classList.add('unselectable'); - } - } - if(lib.storage.lastStage==i&&!node.classList.contains('unselectable')){ - node.classList.add('active'); - noactive=false; - } - else if(lib.storage.lastStage==undefined&&noactive&&!node.classList.contains('unselectable')){ - node.classList.add('active'); - noactive=false; + if (lib.storage.lastStage == i && !node.classList.contains("unselectable")) { + node.classList.add("active"); + noactive = false; + } else if ( + lib.storage.lastStage == undefined && + noactive && + !node.classList.contains("unselectable") + ) { + node.classList.add("active"); + noactive = false; } } } }, }, - showcase:function(init){ - if(_status.sceneChanged){ - init=true; - this.innerHTML=''; + showcase: function (init) { + if (_status.sceneChanged) { + init = true; + this.innerHTML = ""; delete _status.sceneChanged; } - if(init){ - this.style.transition='all 0s'; - this.style.height=(this.offsetHeight-10)+'px'; + if (init) { + this.style.transition = "all 0s"; + this.style.height = this.offsetHeight - 10 + "px"; // this.style.overflow='scroll'; // lib.setScroll(this); - var style2={position:'relative',display:'block',left:0,top:0,marginBottom:'6px',padding:0,width:'100%'}; - var style3={marginLeft:'4px',marginRight:'4px',position:'relative'} + var style2 = { + position: "relative", + display: "block", + left: 0, + top: 0, + marginBottom: "6px", + padding: 0, + width: "100%", + }; + var style3 = { marginLeft: "4px", marginRight: "4px", position: "relative" }; - var scenename=ui.create.node('input',ui.create.div(style2,'','关卡名称:',this),{width:'120px'}); - scenename.type='text'; - scenename.style.marginTop='20px'; - var sceneintro=ui.create.node('input',ui.create.div(style2,'','关卡描述:',this),{width:'120px'}); - sceneintro.type='text'; - sceneintro.style.marginBottom='10px'; + var scenename = ui.create.node( + "input", + ui.create.div(style2, "", "关卡名称:", this), + { width: "120px" } + ); + scenename.type = "text"; + scenename.style.marginTop = "20px"; + var sceneintro = ui.create.node( + "input", + ui.create.div(style2, "", "关卡描述:", this), + { width: "120px" } + ); + sceneintro.type = "text"; + sceneintro.style.marginBottom = "10px"; - var line1=ui.create.div(style2,this); - var line2=ui.create.div(style2,this); - line1.style.marginBottom='10px'; - line2.style.lineHeight='50px'; - line2.style.overflow='scroll'; + var line1 = ui.create.div(style2, this); + var line2 = ui.create.div(style2, this); + line1.style.marginBottom = "10px"; + line2.style.lineHeight = "50px"; + line2.style.overflow = "scroll"; lib.setScroll(line2); - var container=this.parentNode.parentNode; - setTimeout(function(){ - var rect1=container.getBoundingClientRect(); - var rect2=line2.getBoundingClientRect(); - line2.style.height=(rect1.height-(rect2.top-rect1.top))+'px'; - },1000); - var scenes=[]; - for(var i in lib.storage.scene){ - scenes.push([i,i]); + var container = this.parentNode.parentNode; + setTimeout(function () { + var rect1 = container.getBoundingClientRect(); + var rect2 = line2.getBoundingClientRect(); + line2.style.height = rect1.height - (rect2.top - rect1.top) + "px"; + }, 1000); + var scenes = []; + for (var i in lib.storage.scene) { + scenes.push([i, i]); } - if(!scenes.length){ - alert('请创建至少1个场景'); + if (!scenes.length) { + alert("请创建至少1个场景"); return; } - var scenelist=ui.create.selectlist(scenes,null,line1); - var e1=function(){ - if(this.nextSibling){ - this.parentNode.insertBefore(this,this.nextSibling.nextSibling); + var scenelist = ui.create.selectlist(scenes, null, line1); + var e1 = function () { + if (this.nextSibling) { + this.parentNode.insertBefore(this, this.nextSibling.nextSibling); } - } - var e2=function(){ - var that=this; - this.movetimeout=setTimeout(function(){ + }; + var e2 = function () { + var that = this; + this.movetimeout = setTimeout(function () { e1.call(that); - },500); - } - var e3=function(){ + }, 500); + }; + var e3 = function () { clearTimeout(this.movetimeout); delete this.movetimeout; - } - var e4=function(value){ - var node=ui.create.div('.menubutton.large',value,line2,style3,function(){ - if(confirm('是否移除'+this.innerHTML+'?')){ + }; + var e4 = function (value) { + var node = ui.create.div(".menubutton.large", value, line2, style3, function () { + if (confirm("是否移除" + this.innerHTML + "?")) { this.remove(); } }); - if(lib.config.touchscreen){ - node.ontouchstart=e2; - node.ontouchend=e3; - node.ontouchmove=e3; + if (lib.config.touchscreen) { + node.ontouchstart = e2; + node.ontouchend = e3; + node.ontouchmove = e3; + } else { + node.oncontextmenu = e1; + node.onmousedown = e2; + node.onmouseup = e3; + node.onmouseleave = e3; } - else{ - node.oncontextmenu=e1; - node.onmousedown=e2; - node.onmouseup=e3; - node.onmouseleave=e3; - } - } - var addButton=ui.create.node('button','添加场景',line1,function(){ - e4(scenelist.value); - },{marginLeft:'6px',marginRight:'12px'}); - var sceneconfig=ui.create.selectlist([ - ['normal','默认模式'], - ['sequal','连续闯关'], - ['free','自由选关'] - ],null,line1); - var saveButton=ui.create.node('button','保存关卡',line1,function(){ - if(!scenename.value){ - alert('请填写关卡名称'); - return; - } - if(line2.childElementCount<2){ - alert('请添加至少2个场景'); - return; - } - var stage={ - name:scenename.value, - intro:sceneintro.value, - scenes:[], - mode:sceneconfig.value, - level:0 - }; - for(var i=0;i0){ - var ng=Math.floor(gridnum*nco); - for(var i=0;i 0) { + var ng = Math.floor(gridnum * nco); + for (var i = 0; i < ng; i++) { + var cg = grids.randomRemove(); + game.addObstacle(cg.toString(), false); event.obs.push(cg.toString()); } } } - _status.enemyCount=_status.enemylist.length; - _status.friendCount=_status.mylist.length; - while(_status.mylist.length){ - friend=ui.create.player().addTempClass('start'); + _status.enemyCount = _status.enemylist.length; + _status.friendCount = _status.mylist.length; + while (_status.mylist.length) { + friend = ui.create.player().addTempClass("start"); friend.getId(); - if(!event.friendZhu){ - event.friendZhu=friend; - } - else if(!event.friendViceZhu){ - event.friendViceZhu=friend; + if (!event.friendZhu) { + event.friendZhu = friend; + } else if (!event.friendViceZhu) { + event.friendViceZhu = friend; } friend.init(_status.mylist.shift()); - friend.side=side; - friend.setIdentity('friend'); - friend.identity='friend'; - friend.node.identity.dataset.color=get.translation(side+'Color'); + friend.side = side; + friend.setIdentity("friend"); + friend.identity = "friend"; + friend.node.identity.dataset.color = get.translation(side + "Color"); game.players.push(friend); ui.chess.appendChild(friend); - if(event.video){ - ui.placeChess(friend,mylistmap.shift()); - } - else{ - ui.placeChess(friend,grids.randomRemove()); - if(_status.enterArena&&game.data.arena.acted.includes(friend.name)){ + if (event.video) { + ui.placeChess(friend, mylistmap.shift()); + } else { + ui.placeChess(friend, grids.randomRemove()); + if (_status.enterArena && game.data.arena.acted.includes(friend.name)) { friend.hp--; friend.update(); } - if(_status.enterArena){ - friend.addSkill('arenaAdd'); + if (_status.enterArena) { + friend.addSkill("arenaAdd"); } } - lib.posmap[friend.dataset.position]=friend; + lib.posmap[friend.dataset.position] = friend; } - while(_status.enemylist.length){ - enemy=ui.create.player().addTempClass('start'); + while (_status.enemylist.length) { + enemy = ui.create.player().addTempClass("start"); enemy.getId(); enemy.init(_status.enemylist.shift()); - enemy.side=!side; - enemy.setIdentity('enemy'); - enemy.identity='enemy'; - enemy.node.identity.dataset.color=get.translation(!side+'Color'); + enemy.side = !side; + enemy.setIdentity("enemy"); + enemy.identity = "enemy"; + enemy.node.identity.dataset.color = get.translation(!side + "Color"); game.players.push(enemy); ui.chess.appendChild(enemy); - if(event.video){ - ui.placeChess(enemy,enemylistmap.shift()); + if (event.video) { + ui.placeChess(enemy, enemylistmap.shift()); + } else { + ui.placeChess(enemy, grids.randomRemove()); } - else{ - ui.placeChess(enemy,grids.randomRemove()); - } - lib.posmap[enemy.dataset.position]=enemy; + lib.posmap[enemy.dataset.position] = enemy; } - if(lib.config.show_handcardbutton){ - lib.setPopped(ui.create.system('手牌',null,true),function(){ - var uiintro=ui.create.dialog('hidden'); - var added=false; - for(var i=0;i_status.enemyDied){ + } else if (_status.friendDied > _status.enemyDied) { game.forceOver(false); - } - else{ + } else { game.forceOver(); } }); - ui.finishGame.classList.add('finish_game'); - ui.finishGame.parentNode.insertBefore(finishGameBr,ui.finishGame); + ui.finishGame.classList.add("finish_game"); + ui.finishGame.parentNode.insertBefore(finishGameBr, ui.finishGame); } ui.create.me(); ui.create.fakeme(); - if(!event.video&&((_status.mode=='combat'&&get.config('zhu')&&!_status.vsboss&&game.players.length>2)||_status.mode=='three')){ - game.friendZhu=event.friendZhu; + if ( + !event.video && + ((_status.mode == "combat" && + get.config("zhu") && + !_status.vsboss && + game.players.length > 2) || + _status.mode == "three") + ) { + game.friendZhu = event.friendZhu; game.friendZhu.hp++; game.friendZhu.maxHp++; game.friendZhu.update(); - game.friendZhu.node.identity.firstChild.innerHTML='将'; + game.friendZhu.node.identity.firstChild.innerHTML = "将"; - for(var i=0;i=ui.chesswidth){ - x=ui.chesswidth-1; + moveTo: function (x, y) { + game.addVideo("moveTo", this, [x, y]); + if (x >= ui.chesswidth) { + x = ui.chesswidth - 1; } - if(y>=ui.chessheight){ - y=ui.chessheight-1; + if (y >= ui.chessheight) { + y = ui.chessheight - 1; } - var pos=y*ui.chesswidth+x; - if(!lib.posmap[pos]){ + var pos = y * ui.chesswidth + x; + if (!lib.posmap[pos]) { delete lib.posmap[this.dataset.position]; // this.changeSeat(pos,false); - ui.placeChess(this,pos); - lib.posmap[pos]=this; + ui.placeChess(this, pos); + lib.posmap[pos] = this; this.chessFocus(); } - if(get.mode()=='tafang'&&!_status.video){ - if(_status.tafangend.includes(this.dataset.position)){ - if(_status.enemies.includes(this)){ + if (get.mode() == "tafang" && !_status.video) { + if (_status.tafangend.includes(this.dataset.position)) { + if (_status.enemies.includes(this)) { game.over(false); - } - else{ + } else { this.delete(); delete lib.posmap[this]; game.players.remove(this); _status.friends.remove(this); - this.classList.add('dead'); - if(_status.roundStart==this){ - _status.roundStart=player.next||player.getNext()||game.players[0]; + this.classList.add("dead"); + if (_status.roundStart == this) { + _status.roundStart = player.next || player.getNext() || game.players[0]; } - if(this==game.me){ - if(ui.confirm){ + if (this == game.me) { + if (ui.confirm) { ui.confirm.close(); } - if(_status.friends.length==0){ + if (_status.friends.length == 0) { ui.fakeme.hide(); this.node.handcards1.delete(); this.node.handcards2.delete(); - game.me=ui.create.player(); - game.me.side=false; - game.addVideo('removeTafangPlayer'); - } - else{ + game.me = ui.create.player(); + game.me.side = false; + game.addVideo("removeTafangPlayer"); + } else { game.modeSwapPlayer(_status.friends[0]); } } - for(var i=0;i0&&this.movable(1,0)) return true; - if(dy<0&&this.movable(0,-1)) return true; - if(dy>0&&this.movable(0,1)) return true; + canMoveTowards: function (target) { + var fxy = this.getXY(); + var txy = target.getXY(); + var dx = txy[0] - fxy[0]; + var dy = txy[1] - fxy[1]; + if (dx < 0 && this.movable(-1, 0)) return true; + if (dx > 0 && this.movable(1, 0)) return true; + if (dy < 0 && this.movable(0, -1)) return true; + if (dy > 0 && this.movable(0, 1)) return true; return false; }, - moveTowards:function(target,forbid){ - var fxy=this.getXY(); + moveTowards: function (target, forbid) { + var fxy = this.getXY(); var txy; - if(Array.isArray(target)){ - txy=target; + if (Array.isArray(target)) { + txy = target; + } else if (typeof target == "string") { + var pos = parseInt(target); + txy = [pos % ui.chesswidth, Math.floor(pos / ui.chesswidth)]; + } else { + txy = target.getXY(); } - else if(typeof target=='string'){ - var pos=parseInt(target); - txy=[pos%ui.chesswidth,Math.floor(pos/ui.chesswidth)]; - } - else{ - txy=target.getXY(); - } - var dx=txy[0]-fxy[0]; - var dy=txy[1]-fxy[1]; - forbid=forbid||[]; - if(Math.abs(dx)>Math.abs(dy)){ - if(dx<0){ - if(!forbid.includes('moveLeft')&&this.movable(-1,0)){ + var dx = txy[0] - fxy[0]; + var dy = txy[1] - fxy[1]; + forbid = forbid || []; + if (Math.abs(dx) > Math.abs(dy)) { + if (dx < 0) { + if (!forbid.includes("moveLeft") && this.movable(-1, 0)) { this.moveLeft(); - return 'moveLeft'; + return "moveLeft"; } - } - else if(dx>0){ - if(!forbid.includes('moveRight')&&this.movable(1,0)){ + } else if (dx > 0) { + if (!forbid.includes("moveRight") && this.movable(1, 0)) { this.moveRight(); - return 'moveRight'; + return "moveRight"; } } - if(dy<0){ - if(!forbid.includes('moveUp')&&this.movable(0,-1)){ + if (dy < 0) { + if (!forbid.includes("moveUp") && this.movable(0, -1)) { this.moveUp(); - return 'moveUp'; + return "moveUp"; } - } - else if(dy>0){ - if(!forbid.includes('moveDown')&&this.movable(0,1)){ + } else if (dy > 0) { + if (!forbid.includes("moveDown") && this.movable(0, 1)) { this.moveDown(); - return 'moveDown'; + return "moveDown"; } } - } - else{ - if(dy<0){ - if(!forbid.includes('moveUp')&&this.movable(0,-1)){ + } else { + if (dy < 0) { + if (!forbid.includes("moveUp") && this.movable(0, -1)) { this.moveUp(); - return 'moveUp'; + return "moveUp"; } - } - else if(dy>0){ - if(!forbid.includes('moveDown')&&this.movable(0,1)){ + } else if (dy > 0) { + if (!forbid.includes("moveDown") && this.movable(0, 1)) { this.moveDown(); - return 'moveDown'; + return "moveDown"; } } - if(dx<0){ - if(!forbid.includes('moveLeft')&&this.movable(-1,0)){ + if (dx < 0) { + if (!forbid.includes("moveLeft") && this.movable(-1, 0)) { this.moveLeft(); - return 'moveLeft'; + return "moveLeft"; } - } - else if(dx>0){ - if(!forbid.includes('moveRight')&&this.movable(1,0)){ + } else if (dx > 0) { + if (!forbid.includes("moveRight") && this.movable(1, 0)) { this.moveRight(); - return 'moveRight'; + return "moveRight"; } } } return false; }, - chessFocus:function(){ - game.addVideo('chessFocus',this); - if(ui.chess._chessdrag) return; - if(_status.chessscrolling) return; - var player=this; - var dx=0,dy=0; + chessFocus: function () { + game.addVideo("chessFocus", this); + if (ui.chess._chessdrag) return; + if (_status.chessscrolling) return; + var player = this; + var dx = 0, + dy = 0; - if(player.getLeft()-ui.chessContainer.chessLeft<14){ - dx=player.getLeft()-ui.chessContainer.chessLeft-14; + if (player.getLeft() - ui.chessContainer.chessLeft < 14) { + dx = player.getLeft() - ui.chessContainer.chessLeft - 14; + } else if ( + player.getLeft() - ui.chessContainer.chessLeft > + ui.chessContainer.offsetWidth - 134 + ) { + dx = + player.getLeft() - + ui.chessContainer.chessLeft - + ui.chessContainer.offsetWidth + + 134; } - else if(player.getLeft()-ui.chessContainer.chessLeft>ui.chessContainer.offsetWidth-134){ - dx=player.getLeft()-ui.chessContainer.chessLeft-ui.chessContainer.offsetWidth+134; - } - if(player.getTop()-ui.chessContainer.chessTop<14){ - dy=player.getTop()-ui.chessContainer.chessTop-14; - } - else if(player.getTop()+ui.chess.offsetTop-ui.chessContainer.chessTop>ui.chessContainer.offsetHeight-134){ - dy=player.getTop()+ui.chess.offsetTop-ui.chessContainer.chessTop-ui.chessContainer.offsetHeight+134; + if (player.getTop() - ui.chessContainer.chessTop < 14) { + dy = player.getTop() - ui.chessContainer.chessTop - 14; + } else if ( + player.getTop() + ui.chess.offsetTop - ui.chessContainer.chessTop > + ui.chessContainer.offsetHeight - 134 + ) { + dy = + player.getTop() + + ui.chess.offsetTop - + ui.chessContainer.chessTop - + ui.chessContainer.offsetHeight + + 134; } // if(_status.currentChessFocus){ // cancelAnimationFrame(_status.currentChessFocus); // } - var count=lib.config.low_performance?6:12; - var ddx=Math.floor(dx/count); - var ddy=Math.floor(dy/count); - if(dx||dy){ - ui.chessContainer.move(dx,dy,true); + var count = lib.config.low_performance ? 6 : 12; + var ddx = Math.floor(dx / count); + var ddy = Math.floor(dy / count); + if (dx || dy) { + ui.chessContainer.move(dx, dy, true); // var chessFocus=function(){ // if(count--){ // ui.chessContainer.chessLeft+=ddx; @@ -714,733 +752,746 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ // _status.currentChessFocus=requestAnimationFrame(chessFocus); } }, - getXY:function(){ - var pos=parseInt(this.dataset.position); - var x=pos%ui.chesswidth; - var y=Math.floor(pos/ui.chesswidth); - return [x,y]; + getXY: function () { + var pos = parseInt(this.dataset.position); + var x = pos % ui.chesswidth; + var y = Math.floor(pos / ui.chesswidth); + return [x, y]; }, - getDataPos:function(x,y){ - var xy=this.getXY(); - if(typeof x!='number') x=0; - if(typeof y!='number') y=0; - x+=xy[0]; - y+=xy[1]; - return x+y*ui.chesswidth; + getDataPos: function (x, y) { + var xy = this.getXY(); + if (typeof x != "number") x = 0; + if (typeof y != "number") y = 0; + x += xy[0]; + y += xy[1]; + return x + y * ui.chesswidth; }, - getNeighbour:function(x,y){ - var xy=this.getXY(); - if(xy[0]+x<0) return null; - if(xy[1]+y<0) return null; - if(xy[0]+x>=ui.chesswidth) return null; - if(xy[1]+y>=ui.chessheight) return null; - return lib.posmap[this.getDataPos(x,y)]||null; + getNeighbour: function (x, y) { + var xy = this.getXY(); + if (xy[0] + x < 0) return null; + if (xy[1] + y < 0) return null; + if (xy[0] + x >= ui.chesswidth) return null; + if (xy[1] + y >= ui.chessheight) return null; + return lib.posmap[this.getDataPos(x, y)] || null; }, - getNeighbours:function(){ - var players=[]; - for(var i=0;i=ui.chesswidth) return false; - if(xy[1]+y>=ui.chessheight) return false; - return !this.getNeighbour(x,y); + movable: function (x, y) { + var xy = this.getXY(); + if (xy[0] + x < 0) return false; + if (xy[1] + y < 0) return false; + if (xy[0] + x >= ui.chesswidth) return false; + if (xy[1] + y >= ui.chessheight) return false; + return !this.getNeighbour(x, y); }, - moveRight:function(){ - if(this.movable(1,0)){ - this.move(1,0); + moveRight: function () { + if (this.movable(1, 0)) { + this.move(1, 0); return true; } return false; }, - moveLeft:function(){ - if(this.movable(-1,0)){ - this.move(-1,0); + moveLeft: function () { + if (this.movable(-1, 0)) { + this.move(-1, 0); return true; } return false; }, - moveUp:function(){ - if(this.movable(0,-1)){ - this.move(0,-1); + moveUp: function () { + if (this.movable(0, -1)) { + this.move(0, -1); return true; } return false; }, - moveDown:function(){ - if(this.movable(0,1)){ - this.move(0,1); + moveDown: function () { + if (this.movable(0, 1)) { + this.move(0, 1); return true; } return false; }, - dieAfter2:function(){ - var player=this; + dieAfter2: function () { + var player = this; delete lib.posmap[player.dataset.position]; - setTimeout(function(){ + setTimeout(function () { player.delete(); - },500); - for(var i=0;i1){ - if(cards){ - that.$gain(cards,null,false) - } - else{ - that.$gain(num-1,null,false) + }, 500); + var that = this; + if (num && num > 1) { + if (cards) { + that.$gain(cards, null, false); + } else { + that.$gain(num - 1, null, false); } } }, - $throw:function(card,time,init){ - if(init!==false){ - if(get.itemtype(card)!='cards'){ - if(get.itemtype(card)=='card'){ - card=[card]; - } - else{ + $throw: function (card, time, init) { + if (init !== false) { + if (get.itemtype(card) != "cards") { + if (get.itemtype(card) == "card") { + card = [card]; + } else { return; } } - game.addVideo('throw',this,[get.cardsInfo(card),time]); + game.addVideo("throw", this, [get.cardsInfo(card), time]); } this.chessFocus(); - if(get.itemtype(card)=='cards'){ - for(var i=0;i=0){ - for(var i=0;i= 0) { + for (var i = 0; i < card; i++) { + from.$givemod("", player); } - } - else{ + } else { var node; - if(get.itemtype(card)=='card'){ - node=card.copy('card','thrown',false); - } - else{ - node=ui.create.div('.card.thrown'); + if (get.itemtype(card) == "card") { + node = card.copy("card", "thrown", false); + } else { + node = ui.create.div(".card.thrown"); } - node.dataset.position=this.dataset.position; - node.fixed=true; + node.dataset.position = this.dataset.position; + node.fixed = true; node.hide(); this.parentNode.appendChild(node); ui.refresh(node); node.show(); - this.$randomMove(node,130,0); + this.$randomMove(node, 130, 0); - setTimeout(function(){ - lib.element.card.moveTo.call(node,player); - setTimeout(function(){ + setTimeout(function () { + lib.element.card.moveTo.call(node, player); + setTimeout(function () { node.delete(); - },200); + }, 200); // node.removeAttribute('style'); // node.dataset.position=player.dataset.position; // node.delete(); - },700); + }, 700); } }, - $throwxy:function(card,left,top,transform){ - var node=card.copy('thrown','thrownhighlight'); - var rect=this.getBoundingClientRect(); - node.style.left=(rect.left+8)+'px'; - node.style.top=(rect.top+8)+'px'; + $throwxy: function (card, left, top, transform) { + var node = card.copy("thrown", "thrownhighlight"); + var rect = this.getBoundingClientRect(); + node.style.left = rect.left + 8 + "px"; + node.style.top = rect.top + 8 + "px"; node.hide(); - node.style.transitionProperty='left,top,opacity'; - if(transform){ - node.style.transform='rotate('+(Math.random()*16-8)+'deg)'; + node.style.transitionProperty = "left,top,opacity"; + if (transform) { + node.style.transform = "rotate(" + (Math.random() * 16 - 8) + "deg)"; } ui.arena.appendChild(node); ui.refresh(node); node.show(); - node.style.left=left; - node.style.top=top; + node.style.left = left; + node.style.top = top; return node; }, - $phaseJudge:function(card){ - game.addVideo('phaseJudge',this,get.cardInfo(card)); - var clone=card.copy('thrown',this.parentNode).addTempClass('judgestart'); - var player=this; - clone.style.opacity=0.6; - clone.style.left=(Math.random()*100-50+ui.chessContainer.chessLeft+ui.chessContainer.offsetWidth/2-52)+'px'; - clone.style.top=(Math.random()*80-40+ui.chessContainer.chessTop+ui.chessContainer.offsetHeight/2-52-ui.chessContainer.offsetTop)+'px'; + $phaseJudge: function (card) { + game.addVideo("phaseJudge", this, get.cardInfo(card)); + var clone = card.copy("thrown", this.parentNode).addTempClass("judgestart"); + var player = this; + clone.style.opacity = 0.6; + clone.style.left = + Math.random() * 100 - + 50 + + ui.chessContainer.chessLeft + + ui.chessContainer.offsetWidth / 2 - + 52 + + "px"; + clone.style.top = + Math.random() * 80 - + 40 + + ui.chessContainer.chessTop + + ui.chessContainer.offsetHeight / 2 - + 52 - + ui.chessContainer.offsetTop + + "px"; game.delay(); - game.linexy([ - clone.offsetLeft+clone.offsetWidth/2, - clone.offsetTop+clone.offsetHeight/2, - player.getLeft()+player.offsetWidth/2, - player.getTop()+player.offsetHeight/2 - ],{opacity:0.5,dashed:true},true); + game.linexy( + [ + clone.offsetLeft + clone.offsetWidth / 2, + clone.offsetTop + clone.offsetHeight / 2, + player.getLeft() + player.offsetWidth / 2, + player.getTop() + player.offsetHeight / 2, + ], + { opacity: 0.5, dashed: true }, + true + ); }, - $randomMove:function(node,length,rand){ - if(!this.node.chessthrown){ - this.node.chessthrown=[]; + $randomMove: function (node, length, rand) { + if (!this.node.chessthrown) { + this.node.chessthrown = []; } - var thrown=this.node.chessthrown; - for(var i=0;i= ui.chessContainer.offsetHeight) { + amin = 0; + amax = 90; + } else { + amin = -90; + amax = 90; } - else if(rect.top+rect.height+80>=ui.chessContainer.offsetHeight){ - amin=0; - amax=90; + } else if (rect.left + rect.width + 80 >= ui.chessContainer.offsetWidth) { + if (rect.top <= 80) { + amin = 180; + amax = 270; + } else if (rect.top + rect.height + 80 >= ui.chessContainer.offsetHeight) { + amin = 90; + amax = 180; + } else { + amin = 90; + amax = 270; } - else{ - amin=-90; - amax=90; - } - } - else if(rect.left+rect.width+80>=ui.chessContainer.offsetWidth){ - if(rect.top<=80){ - amin=180; - amax=270; - } - else if(rect.top+rect.height+80>=ui.chessContainer.offsetHeight){ - amin=90; - amax=180; - } - else{ - amin=90; - amax=270; - } - } - else if(rect.top<=80){ - amin=180; - amax=360; - } - else if(rect.top+rect.height+80>=ui.chessContainer.offsetHeight){ - amin=0; - amax=180; - } - else{ - var dx=ui.chessContainer.offsetWidth/2-(rect.left+rect.width/2); - var dy=-ui.chessContainer.offsetHeight/2+(rect.top+rect.height/2); - var ang=Math.abs(Math.atan(dy/dx))*180/Math.PI; - if(dx<0){ - if(dy>0){ - ang=180-ang; - } - else{ - ang+=180; + } else if (rect.top <= 80) { + amin = 180; + amax = 360; + } else if (rect.top + rect.height + 80 >= ui.chessContainer.offsetHeight) { + amin = 0; + amax = 180; + } else { + var dx = ui.chessContainer.offsetWidth / 2 - (rect.left + rect.width / 2); + var dy = -ui.chessContainer.offsetHeight / 2 + (rect.top + rect.height / 2); + var ang = (Math.abs(Math.atan(dy / dx)) * 180) / Math.PI; + if (dx < 0) { + if (dy > 0) { + ang = 180 - ang; + } else { + ang += 180; } + } else if (dy < 0) { + ang = 360 - ang; } - else if(dy<0){ - ang=360-ang; - } - amin=ang-180; - amax=ang+180; + amin = ang - 180; + amax = ang + 180; } - var da=(amax-amin)/(thrown.length*2); - if(da>30&&thrown.length>1){ - amin+=(da-30)*thrown.length; - da=30; + var da = (amax - amin) / (thrown.length * 2); + if (da > 30 && thrown.length > 1) { + amin += (da - 30) * thrown.length; + da = 30; } - for(var i=0;i.player'+pos+ // '{left:'+(14+i*148)+'px;top:'+(14+j*148)+'px}',0); - ui.chesssheet.sheet.insertRule('#arena.chess #chess>.card'+pos+ - '{left:'+(22+i*148)+'px;top:'+(22+j*148)+'px}',0); - ui.chesssheet.sheet.insertRule('#arena.chess #chess>.popup'+pos+ - '{left:'+(19+i*148)+'px;top:'+(142+j*148)+'px}',0); + ui.chesssheet.sheet.insertRule( + "#arena.chess #chess>.card" + + pos + + "{left:" + + (22 + i * 148) + + "px;top:" + + (22 + j * 148) + + "px}", + 0 + ); + ui.chesssheet.sheet.insertRule( + "#arena.chess #chess>.popup" + + pos + + "{left:" + + (19 + i * 148) + + "px;top:" + + (142 + j * 148) + + "px}", + 0 + ); } } }, - getVideoName:function(){ - var str='战棋'+get.translation(_status.mode)+' - '+_status.friendCount+'v'+_status.enemyCount; - var name=[get.translation(game.me.name),str]; + getVideoName: function () { + var str = + "战棋" + + get.translation(_status.mode) + + " - " + + _status.friendCount + + "v" + + _status.enemyCount; + var name = [get.translation(game.me.name), str]; return name; }, - addChessPlayer:function(name,enemy,num,pos){ - if(typeof num!='number'){ - num=4; + addChessPlayer: function (name, enemy, num, pos) { + if (typeof num != "number") { + num = 4; } - var player=ui.create.player(); + var player = ui.create.player(); player.getId(); - if(enemy=='treasure'){ - player.addTempClass('judgestart'); - player.side=null; - player.identity='neutral'; + if (enemy == "treasure") { + player.addTempClass("judgestart"); + player.side = null; + player.identity = "neutral"; player.setIdentity(); - player.node.identity.dataset.color='zhong'; - player.classList.add('treasure'); - player.node.hp.classList.add('treasure'); - player.life=6+Math.floor(Math.random()*6); + player.node.identity.dataset.color = "zhong"; + player.classList.add("treasure"); + player.node.hp.classList.add("treasure"); + player.life = 6 + Math.floor(Math.random() * 6); game.treasures.add(player); - } - else{ - player.addTempClass('start'); - if(enemy){ - if(get.mode()=='tafang'){ - player.side=true; + } else { + player.addTempClass("start"); + if (enemy) { + if (get.mode() == "tafang") { + player.side = true; + } else { + player.side = !game.me.side; } - else{ - player.side=!game.me.side; + player.setIdentity("enemy"); + player.identity = "enemy"; + } else { + if (get.mode() == "tafang") { + player.side = false; + } else { + player.side = game.me.side; } - player.setIdentity('enemy'); - player.identity='enemy'; + player.setIdentity("friend"); + player.identity = "friend"; } - else{ - if(get.mode()=='tafang'){ - player.side=false; - } - else{ - player.side=game.me.side; - } - player.setIdentity('friend'); - player.identity='friend'; - } - player.node.identity.dataset.color=get.translation(player.side+'Color'); + player.node.identity.dataset.color = get.translation(player.side + "Color"); game.players.push(player); // if(lib.config.animation){ // setTimeout(function(){ @@ -1564,38 +1638,36 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ // } } ui.chess.appendChild(player); - if(_status.video||(pos&&!lib.posmap[pos])){ - ui.placeChess(player,pos); - } - else{ - var grids=[]; - var gridnum=ui.chessheight*ui.chesswidth; - for(var i=0;i=ui.chesswidth){ - x=ui.chesswidth-1; + if (typeof x == "string") { + pos = x; + } else { + if (x >= ui.chesswidth) { + x = ui.chesswidth - 1; } - if(y>=ui.chessheight){ - y=ui.chessheight-1; + if (y >= ui.chessheight) { + y = ui.chessheight - 1; } - pos=y*ui.chesswidth+x; + pos = y * ui.chesswidth + x; } - if(!lib.posmap[pos]){ - var grid=ui.create.div('.player.minskin.obstacle',ui.chess).addTempClass('start'); - ui.placeChess(grid,pos); + if (!lib.posmap[pos]) { + var grid = ui.create.div(".player.minskin.obstacle", ui.chess).addTempClass("start"); + ui.placeChess(grid, pos); grid.listen(ui.click.obstacle); - lib.posmap[pos]=grid; + lib.posmap[pos] = grid; game.obstacles.push(grid); return grid; } return null; }, - addTempObstacle:function(x,y,num){ - var node=game.addObstacle(x,y); - if(node){ - game.colorObstacle(node,'blue'); - node.tempObstacle=num; + addTempObstacle: function (x, y, num) { + var node = game.addObstacle(x, y); + if (node) { + game.colorObstacle(node, "blue"); + node.tempObstacle = num; } }, - removeObstacle:function(pos){ - if(get.is.div(pos)){ - pos=pos.dataset.position; + removeObstacle: function (pos) { + if (get.is.div(pos)) { + pos = pos.dataset.position; } - var node=lib.posmap[pos]; - if(node&&game.obstacles.includes(node)){ - game.addVideo('removeObstacle',null,pos); + var node = lib.posmap[pos]; + if (node && game.obstacles.includes(node)) { + game.addVideo("removeObstacle", null, pos); game.obstacles.remove(node); delete lib.posmap[pos]; node.delete(); } }, - moveObstacle:function(pos,x,y){ - if(get.is.div(pos)){ - pos=pos.dataset.position; + moveObstacle: function (pos, x, y) { + if (get.is.div(pos)) { + pos = pos.dataset.position; } - var node=lib.posmap[pos]; - if(node&&game.obstacles.includes(node)){ - pos=parseInt(pos); - var x2=pos%ui.chesswidth+x; - var y2=Math.floor(pos/ui.chesswidth)+y; - if(x2>=ui.chesswidth){ - x2=ui.chesswidth-1; + var node = lib.posmap[pos]; + if (node && game.obstacles.includes(node)) { + pos = parseInt(pos); + var x2 = (pos % ui.chesswidth) + x; + var y2 = Math.floor(pos / ui.chesswidth) + y; + if (x2 >= ui.chesswidth) { + x2 = ui.chesswidth - 1; } - if(y2>=ui.chessheight){ - y2=ui.chessheight-1; + if (y2 >= ui.chessheight) { + y2 = ui.chessheight - 1; } - if(x2<0){ - x2=0; + if (x2 < 0) { + x2 = 0; } - if(y2<0){ - y2=0; + if (y2 < 0) { + y2 = 0; } - var pos2=y2*ui.chesswidth+x2; - if(!lib.posmap[pos2]){ - game.addVideo('moveObstacle',null,[pos,x,y]); - ui.placeChess(node,pos2); + var pos2 = y2 * ui.chesswidth + x2; + if (!lib.posmap[pos2]) { + game.addVideo("moveObstacle", null, [pos, x, y]); + ui.placeChess(node, pos2); delete lib.posmap[pos]; - lib.posmap[pos2]=node; + lib.posmap[pos2] = node; return true; } } return false; }, - colorObstacle:function(pos,color){ - if(get.is.div(pos)){ - pos=pos.dataset.position; + colorObstacle: function (pos, color) { + if (get.is.div(pos)) { + pos = pos.dataset.position; } - var node=lib.posmap[pos]; - if(node&&game.obstacles.includes(node)){ - game.addVideo('colorObstacle',null,[pos,color]); - node.dataset.obscolor=color; + var node = lib.posmap[pos]; + if (node && game.obstacles.includes(node)) { + game.addVideo("colorObstacle", null, [pos, color]); + node.dataset.obscolor = color; } }, - addOverDialog:function(dialog,result){ - if(ui.finishGame){ + addOverDialog: function (dialog, result) { + if (ui.finishGame) { ui.finishGame.remove(); } - dialog.classList.add('center'); - if(_status.mode!='leader') return; - if(result=='战斗胜利'){ - _status.victory=true; - if(!_status.enterArena){ - var div=ui.create.div(); - div.innerHTML='获得'+game.reward+'金'; + dialog.classList.add("center"); + if (_status.mode != "leader") return; + if (result == "战斗胜利") { + _status.victory = true; + if (!_status.enterArena) { + var div = ui.create.div(); + div.innerHTML = "获得" + game.reward + "金"; dialog.add(div); - if(_status.challenge&&_status.challengeMoney<=game.data.dust){ - var div2=ui.create.div(); - div2.style.display='block'; - div2.innerHTML='招降所需招募令:'+_status.challengeMoney+'/'+game.data.dust; + if (_status.challenge && _status.challengeMoney <= game.data.dust) { + var div2 = ui.create.div(); + div2.style.display = "block"; + div2.innerHTML = + "招降所需招募令:" + _status.challengeMoney + "/" + game.data.dust; dialog.add(div2); } game.changeMoney(game.reward); game.saveData(); } - } - else if(_status.zhaoxiang){ - var div=ui.create.div(); - div.innerHTML='招降'+get.translation(_status.zhaoxiang)+'成功'; + } else if (_status.zhaoxiang) { + var div = ui.create.div(); + div.innerHTML = "招降" + get.translation(_status.zhaoxiang) + "成功"; dialog.add(div); } }, - controlOver:function(){ - if(_status.mode=='three'){ - ui.create.control('再战',function(){ - game.saveConfig('continue_name_chess',{ - friend:_status.friendBackup, - enemy:_status.enemyBackup, - color:_status.color + controlOver: function () { + if (_status.mode == "three") { + ui.create.control("再战", function () { + game.saveConfig("continue_name_chess", { + friend: _status.friendBackup, + enemy: _status.enemyBackup, + color: _status.color, }); - game.saveConfig('mode',lib.config.mode); - localStorage.setItem(lib.configprefix+'directstart',true); + game.saveConfig("mode", lib.config.mode); + localStorage.setItem(lib.configprefix + "directstart", true); game.reload(); }); } - ui.create.control('返回',game.reload); - if(_status.mode!='leader') return; - if(_status.enterArena){ - game.data.arena.acted.length=0; - if(_status.victory){ + ui.create.control("返回", game.reload); + if (_status.mode != "leader") return; + if (_status.enterArena) { + game.data.arena.acted.length = 0; + if (_status.victory) { game.data.arena.win++; - for(var i=0;i=money){ - ui.create.control('招降'+get.translation(_status.challenge),function(){ + if (_status.challenge && !_status.zhaoxiang && _status.victory) { + var money = _status.challengeMoney; + if (game.data.dust >= money) { + ui.create.control("招降" + get.translation(_status.challenge), function () { game.data.character.add(_status.challenge); - game.data.challenge=game.getLeaderList(); + game.data.challenge = game.getLeaderList(); game.changeDust(-money); game.reload(); }); @@ -1781,402 +1851,425 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } } }, - phaseLoopThree:function(player){ - var next=game.createEvent('phaseLoop'); - next.player=player; - next.swap=function(player){ - if(player.side==game.me.side){ + phaseLoopThree: function (player) { + var next = game.createEvent("phaseLoop"); + next.player = player; + (next.swap = function (player) { + if (player.side == game.me.side) { return game.enemyZhu; - } - else{ + } else { return game.me; } - }, - next.setContent(function(){ - 'step 0' - player.classList.add('acted'); - player.phase(); - 'step 1' - if(player!=game.friendZhu&&player!=game.enemyZhu){ - for(var i=0;inum1){ - if(next.side==game.me.side){ - next=game.me; + var num2 = game.players.length - num1; + if (num2 > num1) { + if (next.side == game.me.side) { + next = game.me; } var str; - if(num2-num1>1){ - str='选择至多'+get.cnNumber(num2-num1)+'个已方角色各摸一张牌' + if (num2 - num1 > 1) { + str = "选择至多" + get.cnNumber(num2 - num1) + "个已方角色各摸一张牌"; + } else { + str = "选择一个已方角色摸一张牌"; } - else{ - str='选择一个已方角色摸一张牌' - } - var nevt=player.chooseTarget(str,function(card,player,target){ - return target.side==player.side; - },[1,num2-num1]); - nevt.ai=function(target){ - return Math.max(1,10-target.countCards('h')); + var nevt = player.chooseTarget( + str, + function (card, player, target) { + return target.side == player.side; + }, + [1, num2 - num1] + ); + nevt.ai = function (target) { + return Math.max(1, 10 - target.countCards("h")); }; - nevt.includeOut=true; - nevt.chessForceAll=true; - } - else{ + nevt.includeOut = true; + nevt.chessForceAll = true; + } else { game.delay(); event.goto(2); } - } - else{ + } else { event.goto(2); } - "step 1" - if(result.bool){ + "step 1"; + if (result.bool) { game.asyncDraw(result.targets); } - "step 2" - if(player.side==game.me.side){ - player=game.me; + "step 2"; + if (player.side == game.me.side) { + player = game.me; } - if(player.isDead()){ - for(var i=0;i1){ - var nevt=player.chooseTarget('选择下一个行动的角色',function(card,player,target){ - return target.side==player.side&&!target.classList.contains('acted'); - },true); - nevt.chessForceAll=true; - nevt.includeOut=true; - nevt.ai=function(target){ - var nj=target.countCards('j'); - if(nj){ + if (players.length > 1) { + var nevt = player.chooseTarget( + "选择下一个行动的角色", + function (card, player, target) { + return target.side == player.side && !target.classList.contains("acted"); + }, + true + ); + nevt.chessForceAll = true; + nevt.includeOut = true; + nevt.ai = function (target) { + var nj = target.countCards("j"); + if (nj) { return -nj; } - return Math.max(0,10-target.hp); - } - } - else if(players.length){ - event.decided=players[0]; - } - else{ - event.player=game.findPlayer(function(current){ - return current.side!=player.side; + return Math.max(0, 10 - target.hp); + }; + } else if (players.length) { + event.decided = players[0]; + } else { + event.player = game.findPlayer(function (current) { + return current.side != player.side; }); event.goto(0); } - "step 3" - if(event.decided){ + "step 3"; + if (event.decided) { event.decided.phase(); - event.justacted=event.decided; + event.justacted = event.decided; delete event.decided; - } - else{ - var current=result.targets[0]; + } else { + var current = result.targets[0]; current.phase(); - event.justacted=current; + event.justacted = current; } - "step 4" - event.justacted.classList.add('acted'); + "step 4"; + event.justacted.classList.add("acted"); event.goto(0); - for(var i=0;i'+game.data.money+'金币'); - uiintro.addText('通过战斗或竞技场可获得金币。花费100金币可招募3名随机武将;花费150金币可参加一次竞技场'); - uiintro.add(''+game.data.dust+'招募令'); - uiintro.addText('通过遣返武将或竞技场可获得招募令。挑战武将成功后可通过招募令招募该武将,普通/稀有/史诗/传说武将分别花费40/100/400/1600招募令'); + ui.money = ui.create.div(ui.window); + lib.setIntro(ui.money, function (uiintro) { + uiintro.add('' + game.data.money + "金币"); + uiintro.addText( + "通过战斗或竞技场可获得金币。花费100金币可招募3名随机武将;花费150金币可参加一次竞技场" + ); + uiintro.add('' + game.data.dust + "招募令"); + uiintro.addText( + "通过遣返武将或竞技场可获得招募令。挑战武将成功后可通过招募令招募该武将,普通/稀有/史诗/传说武将分别花费40/100/400/1600招募令" + ); }); - ui.money.innerHTML=''+game.data.dust+''+ - ''+game.data.money+''; - ui.money.style.top='auto'; - ui.money.style.left='auto'; - ui.money.style.right='20px'; - ui.money.style.bottom='15px'; - ui.money.childNodes[0].style.color='rgb(111, 198, 255)'; - ui.money.childNodes[1].style.fontFamily='huangcao'; - ui.money.childNodes[1].style.marginRight='10px'; - ui.money.childNodes[2].style.color='#FFE600'; - ui.money.childNodes[3].style.fontFamily='huangcao'; - ui.money.style.letterSpacing='4px'; - if(get.config('chess_leader_allcharacter')){ - for(var i in lib.rank){ - if(Array.isArray(lib.rank[i])){ - for(var j=0;j" + + game.data.dust + + "" + + "" + + game.data.money + + ""; + ui.money.style.top = "auto"; + ui.money.style.left = "auto"; + ui.money.style.right = "20px"; + ui.money.style.bottom = "15px"; + ui.money.childNodes[0].style.color = "rgb(111, 198, 255)"; + ui.money.childNodes[1].style.fontFamily = "huangcao"; + ui.money.childNodes[1].style.marginRight = "10px"; + ui.money.childNodes[2].style.color = "#FFE600"; + ui.money.childNodes[3].style.fontFamily = "huangcao"; + ui.money.style.letterSpacing = "4px"; + if (get.config("chess_leader_allcharacter")) { + for (var i in lib.rank) { + if (Array.isArray(lib.rank[i])) { + for (var j = 0; j < lib.rank[i].length; j++) { + if (!lib.character[lib.rank[i][j]]) { + lib.rank[i].splice(j--, 1); } } } } - for(var i in lib.rank.rarity){ - if(Array.isArray(lib.rank.rarity[i])){ - for(var j=0;jb?1:-1; - } - return aa>bb?1:-1; }); - if(game.data.character.length==0||!game.data.challenge){ - game.data.character=lib.rank.rarity.common.randomGets(3); - game.data.challenge=game.getLeaderList(); + game.data.character.sort(function (a, b) { + var del = groupSort(a) - groupSort(b); + if (del != 0) return del; + var aa = a, + bb = b; + if (a.indexOf("_") != -1) { + a = a.slice(a.indexOf("_") + 1); + } + if (b.indexOf("_") != -1) { + b = b.slice(b.indexOf("_") + 1); + } + if (a != b) { + return a > b ? 1 : -1; + } + return aa > bb ? 1 : -1; + }); + if (game.data.character.length == 0 || !game.data.challenge) { + game.data.character = lib.rank.rarity.common.randomGets(3); + game.data.challenge = game.getLeaderList(); game.saveData(); } - var fixButton=function(button){ - var rarity=game.getRarity(button.link); - if(rarity!='common'){ - var intro=button.node.intro; - intro.classList.add('showintro'); - intro.style.fontFamily='yuanli'; - intro.style.fontSize='20px'; - intro.style.top='82px'; - intro.style.left='2px'; - switch(rarity){ - case 'rare':intro.dataset.nature='thunderm';break; - case 'epic':intro.dataset.nature='metalm';break; - case 'legend':intro.dataset.nature='orangem';break; + var fixButton = function (button) { + var rarity = game.getRarity(button.link); + if (rarity != "common") { + var intro = button.node.intro; + intro.classList.add("showintro"); + intro.style.fontFamily = "yuanli"; + intro.style.fontSize = "20px"; + intro.style.top = "82px"; + intro.style.left = "2px"; + switch (rarity) { + case "rare": + intro.dataset.nature = "thunderm"; + break; + case "epic": + intro.dataset.nature = "metalm"; + break; + case "legend": + intro.dataset.nature = "orangem"; + break; } - intro.innerHTML=get.translation(rarity); + intro.innerHTML = get.translation(rarity); } - } - game.leaderLord=['leader_caocao','leader_liubei','leader_sunquan','leader_yuri']; - var dialog1=ui.create.dialog('选择君主','hidden'); - event.dialog1=dialog1; - dialog1.classList.add('fullheight'); - dialog1.classList.add('halfleft'); - dialog1.classList.add('fixed'); - dialog1.classList.add('pointerbutton'); - dialog1.add([game.leaderLord,'character']); + }; + game.leaderLord = ["leader_caocao", "leader_liubei", "leader_sunquan", "leader_yuri"]; + var dialog1 = ui.create.dialog("选择君主", "hidden"); + event.dialog1 = dialog1; + dialog1.classList.add("fullheight"); + dialog1.classList.add("halfleft"); + dialog1.classList.add("fixed"); + dialog1.classList.add("pointerbutton"); + dialog1.add([game.leaderLord, "character"]); var i; - for(i=0;ib?1:-1; + namecapt.sort(function (a, b) { + return a > b ? 1 : -1; }); - captnode.innerHTML=''; - for(i=0;i3&&selected.character.length){ - event.removeCharacter.addTempClass('controlpressdownx',500); - event.removeCharacter.classList.remove('disabled'); + if (game.data.character.length > 3 && selected.character.length) { + event.removeCharacter.addTempClass("controlpressdownx", 500); + event.removeCharacter.classList.remove("disabled"); } - if(game.data.money<150&&!game.data._arena){ - event.enterArena.classList.add('disabled'); + if (game.data.money < 150 && !game.data._arena) { + event.enterArena.classList.add("disabled"); + } else { + event.enterArena.addTempClass("controlpressdownx", 500); + event.enterArena.classList.remove("disabled"); } - else{ - event.enterArena.addTempClass('controlpressdownx',500); - event.enterArena.classList.remove('disabled'); - } - if(game.data.money<100){ - event.addCharacter.classList.add('disabled'); - } - else{ - event.addCharacter.addTempClass('controlpressdownx',500); - event.addCharacter.classList.remove('disabled'); + if (game.data.money < 100) { + event.addCharacter.classList.add("disabled"); + } else { + event.addCharacter.addTempClass("controlpressdownx", 500); + event.addCharacter.classList.remove("disabled"); } initcapt(); - },200); - },200); - },500); + }, 200); + }, 200); + }, 500); }; - event.addCharacter=ui.create.control('招募','nozoom',zhaomu2); - if(game.data.money<150&&!game.data._arena){ - event.enterArena.classList.add('disabled'); + event.addCharacter = ui.create.control("招募", "nozoom", zhaomu2); + if (game.data.money < 150 && !game.data._arena) { + event.enterArena.classList.add("disabled"); } - if(game.data.money<100){ - event.addCharacter.classList.add('disabled'); + if (game.data.money < 100) { + event.addCharacter.classList.add("disabled"); } - var qianfan=function(){ - if(_status.kaibao) return; - if(game.data.character.length<=3) return; - if(!selected.character.length) return; + var qianfan = function () { + if (_status.kaibao) return; + if (game.data.character.length <= 3) return; + if (!selected.character.length) return; // _status.chessclicked=true; // _status.qianfan=true; // event.enterArena.style.opacity=0.5; // event.addCharacter.style.opacity=0.5; // event.fight.style.opacity=0.5; - var current=selected.character.slice(0); + var current = selected.character.slice(0); clearSelected(); - var maxq=game.data.character.length-3; - if(current.length<=maxq){ - for(var i=0;i=100){ - event.addCharacter.addTempClass('controlpressdownx',500); - event.addCharacter.classList.remove('disabled'); + if (game.data.money >= 100) { + event.addCharacter.addTempClass("controlpressdownx", 500); + event.addCharacter.classList.remove("disabled"); } - if(game.data.money>=150){ - event.enterArena.addTempClass('controlpressdownx',500); - event.enterArena.classList.remove('disabled'); + if (game.data.money >= 150) { + event.enterArena.addTempClass("controlpressdownx", 500); + event.enterArena.classList.remove("disabled"); } node.delete(); dialog1.buttons.remove(node); @@ -2726,291 +2862,398 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ initcapt(); } }; - event.removeCharacter=ui.create.control('遣返','nozoom',qianfan); - event.removeCharacter.classList.add('disabled'); - event.fight=ui.create.control('开始战斗','nozoom',function(){ - if(_status.kaibao||_status.qianfan) return; - if(selected.challenge.length){ - var cname=selected.challenge[0].link; - var rarity=game.getRarity(cname); - switch(rarity){ - case 'common':rarity=40;break; - case 'rare':rarity=100;break; - case 'epic':rarity=400;break; - case 'legend':rarity=1600;break; + event.removeCharacter = ui.create.control("遣返", "nozoom", qianfan); + event.removeCharacter.classList.add("disabled"); + event.fight = ui.create.control("开始战斗", "nozoom", function () { + if (_status.kaibao || _status.qianfan) return; + if (selected.challenge.length) { + var cname = selected.challenge[0].link; + var rarity = game.getRarity(cname); + switch (rarity) { + case "common": + rarity = 40; + break; + case "rare": + rarity = 100; + break; + case "epic": + rarity = 400; + break; + case "legend": + rarity = 1600; + break; } - if(!confirm('即将挑战'+get.translation(cname)+',战斗胜利后可消耗'+rarity+'招募令招募该武将,无论是否招募,挑战列表将被刷新。是否继续?')){ + if ( + !confirm( + "即将挑战" + + get.translation(cname) + + ",战斗胜利后可消耗" + + rarity + + "招募令招募该武将,无论是否招募,挑战列表将被刷新。是否继续?" + ) + ) { return; } } - _status.enemylist=[]; - _status.mylist=[]; - if(selected.lord.length){ + _status.enemylist = []; + _status.mylist = []; + if (selected.lord.length) { _status.mylist.push(selected.lord[0].link); - _status.lord=selected.lord[0].link; + _status.lord = selected.lord[0].link; } - if(selected.character.length){ - for(var i=0;i0){ - switch(difficulty){ - case 'leader_easy':reward+=10*numdel;break; - case 'leader_medium':reward+=20*numdel;break; - case 'leader_hard':reward+=40*numdel;break; + if (numdel > 0) { + switch (difficulty) { + case "leader_easy": + reward += 10 * numdel; + break; + case "leader_medium": + reward += 20 * numdel; + break; + case "leader_hard": + reward += 40 * numdel; + break; } } - var punish=0; - for(var i=0;i<_status.mylist.length;i++){ - switch(get.rank(_status.mylist[i])){ - case 's':punish+=25;break; - case 'ap':punish+=20;break; - case 'a':punish+=16;break; - case 'am':punish+=12;break; - case 'bp':punish+=9;break; - case 'b':punish+=7;break; - case 'bm':punish+=5;break; - case 'c':punish+=3;break; - case 'd':punish+=2;break; + var punish = 0; + for (var i = 0; i < _status.mylist.length; i++) { + switch (get.rank(_status.mylist[i])) { + case "s": + punish += 25; + break; + case "ap": + punish += 20; + break; + case "a": + punish += 16; + break; + case "am": + punish += 12; + break; + case "bp": + punish += 9; + break; + case "b": + punish += 7; + break; + case "bm": + punish += 5; + break; + case "c": + punish += 3; + break; + case "d": + punish += 2; + break; } } - if(numdel<0){ - switch(difficulty){ - case 'leader_easy':punish-=5*numdel;break; - case 'leader_medium':punish-=10*numdel;break; - case 'leader_hard':punish-=20*numdel;break; + if (numdel < 0) { + switch (difficulty) { + case "leader_easy": + punish -= 5 * numdel; + break; + case "leader_medium": + punish -= 10 * numdel; + break; + case "leader_hard": + punish -= 20 * numdel; + break; } } - game.reward=Math.max(3*_status.enemylist.length,reward-punish); - if(!_status.lord){ - switch(difficulty){ - case 'leader_easy':game.reward+=10;break; - case 'leader_medium':game.reward+=20;break; - case 'leader_hard':game.reward+=40;break; + game.reward = Math.max(3 * _status.enemylist.length, reward - punish); + if (!_status.lord) { + switch (difficulty) { + case "leader_easy": + game.reward += 10; + break; + case "leader_medium": + game.reward += 20; + break; + case "leader_hard": + game.reward += 40; + break; } } game.resume(); }); - event.custom.replace.button=function(button){ - if(_status.kaibao) return; - if(button.classList.contains('unselectable')&& - !button.classList.contains('selected')) return; - _status.chessclicked=true; - button.classList.toggle('selected'); - if(button.classList.contains('selected')){ + event.custom.replace.button = function (button) { + if (_status.kaibao) return; + if ( + button.classList.contains("unselectable") && + !button.classList.contains("selected") + ) + return; + _status.chessclicked = true; + button.classList.toggle("selected"); + if (button.classList.contains("selected")) { selected[button.area].add(button); - } - else{ + } else { selected[button.area].remove(button); } - switch(button.area){ - case 'lord':{ - for(var i=0;i5)|| - (_status.qianfan&&selected.character.length>=maxq)){ - dialog1.buttons[i].classList.add('unselectable'); - } - else{ - dialog1.buttons[i].classList.remove('unselectable'); + case "character": { + for (var i = 0; i < dialog1.buttons.length; i++) { + if (dialog1.buttons[i].area == "character") { + var maxq = game.data.character.length - 3; + if ( + (!_status.qianfan && selected.character.length > 5) || + (_status.qianfan && selected.character.length >= maxq) + ) { + dialog1.buttons[i].classList.add("unselectable"); + } else { + dialog1.buttons[i].classList.remove("unselectable"); } } } break; } - case 'difficulty':case 'number':{ - for(var i=0;i3){ - event.removeCharacter.addTempClass('controlpressdownx',500); - event.removeCharacter.classList.remove('disabled'); - } - else{ - event.removeCharacter.classList.add('disabled'); + if (selected.character.length && game.data.character.length > 3) { + event.removeCharacter.addTempClass("controlpressdownx", 500); + event.removeCharacter.classList.remove("disabled"); + } else { + event.removeCharacter.classList.add("disabled"); } }; - event.custom.add.window=function(){ - if(!_status.kaibao){ - var glows=document.querySelectorAll('.button.glow2'); - for(var i=0;i=100){ - event.addCharacter.addTempClass('controlpressdownx',500); - event.addCharacter.classList.remove('disabled'); + if (_status.qianfan) { + _status.qianfan = false; + event.removeCharacter.replace("遣返", qianfan); + if (game.data.money >= 100) { + event.addCharacter.addTempClass("controlpressdownx", 500); + event.addCharacter.classList.remove("disabled"); + } else { + event.addCharacter.classList.add("disabled"); } - else{ - event.addCharacter.classList.add('disabled'); + if (game.data.money >= 150 || game.data._arena) { + event.enterArena.addTempClass("controlpressdownx", 500); + event.enterArena.classList.remove("disabled"); + } else { + event.enterArena.classList.add("disabled"); } - if(game.data.money>=150||game.data._arena){ - event.enterArena.addTempClass('controlpressdownx',500); - event.enterArena.classList.remove('disabled'); - } - else{ - event.enterArena.classList.add('disabled'); - } - event.fight.style.opacity=1; + event.fight.style.opacity = 1; } clearSelected(); }; lib.init.onfree(); game.pause(); - 'step 2' - if(!game.data.arena){ + "step 2"; + if (!game.data.arena) { event.dialog1.close(); event.dialog2.close(); event.fight.close(); @@ -3018,501 +3261,565 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ event.addCharacter.close(); event.removeCharacter.close(); } - ui.arena.classList.add('leaderhide'); + ui.arena.classList.add("leaderhide"); ui.money.hide(); game.delay(); - 'step 3' - ui.arena.classList.remove('leaderhide'); - if(!_status.enterArena){ + "step 3"; + ui.arena.classList.remove("leaderhide"); + if (!_status.enterArena) { ui.wuxie.show(); ui.auto.show(); - ui.control.style.top=''; - if(!get.is.safari()){ - ui.control.style.transition=''; - ui.control.style.display='none'; + ui.control.style.top = ""; + if (!get.is.safari()) { + ui.control.style.transition = ""; + ui.control.style.display = "none"; } event.finish(); - } - else{ - game.minskin=false; - event.arenanodes=[]; - event.arenachoice=[]; - event.arenachoicenodes=[]; - event.arrangeNodes=function(){ - var num=event.arenachoicenodes.length; - var width=num*75+(num-1)*8; - for(var i=0;i=3){ - for(var i=0;i= 3) { + for (var i = 0; i < event.arenachoicenodes.length; i++) { + if (!event.arenachoicenodes[i].classList.contains("dead")) { + event.arenachoicenodes[i].classList.add("unselectable"); } } - } - else{ - for(var i=0;i胜'; - victory.style.top='auto'; - victory.style.left='auto'; - victory.style.right='20px'; - victory.style.bottom='15px'; - victory.style.fontSize='30px' - victory.style.fontFamily='huangcao'; - victory.firstChild.style.marginRight='5px'; + var victory = ui.create.div().hide(); + victory.innerHTML = "" + game.data.arena.win + "胜"; + victory.style.top = "auto"; + victory.style.left = "auto"; + victory.style.right = "20px"; + victory.style.bottom = "15px"; + victory.style.fontSize = "30px"; + victory.style.fontFamily = "huangcao"; + victory.firstChild.style.marginRight = "5px"; ui.window.appendChild(victory); ui.refresh(victory); victory.show(); - event.checkPrize=function(){ + event.checkPrize = function () { // event.kaibao=true; - event.prize=[]; - event.turnCard2=function(){ - if(this.turned) return; - _status.chessclicked=true; - this.turned=true; - var node=this; - setTimeout(function(){ - node.turned2=true; - },1000); - if(node.name=='chess_coin'||node.name=='chess_dust'){ - node.style.transition='all 0s'; - node.style.transform='none'; - node.style.overflow='visible'; - node.style.background='none'; - node.style.boxShadow='none'; - var div=ui.create.div(node); - div.style.transition='all 0s'; - if(node.name=='chess_coin'){ - div.innerHTML=''+node.num+''; - div.firstChild.style.color='rgb(255, 230, 0)'; + event.prize = []; + event.turnCard2 = function () { + if (this.turned) return; + _status.chessclicked = true; + this.turned = true; + var node = this; + setTimeout(function () { + node.turned2 = true; + }, 1000); + if (node.name == "chess_coin" || node.name == "chess_dust") { + node.style.transition = "all 0s"; + node.style.transform = "none"; + node.style.overflow = "visible"; + node.style.background = "none"; + node.style.boxShadow = "none"; + var div = ui.create.div(node); + div.style.transition = "all 0s"; + if (node.name == "chess_coin") { + div.innerHTML = "" + node.num + ""; + div.firstChild.style.color = "rgb(255, 230, 0)"; node.$coin(); - } - else{ - div.innerHTML=''+node.num+''; - div.firstChild.style.color='rgb(111, 198, 255)'; - div.firstChild.style.marginRight='3px'; + } else { + div.innerHTML = "" + node.num + ""; + div.firstChild.style.color = "rgb(111, 198, 255)"; + div.firstChild.style.marginRight = "3px"; node.$dust(); } - div.style.fontFamily='huangcao'; - div.style.fontSize='50px'; - div.style.top='40px'; - div.style.letterSpacing='8px'; - div.style.whiteSpace='nowrap'; + div.style.fontFamily = "huangcao"; + div.style.fontSize = "50px"; + div.style.top = "40px"; + div.style.letterSpacing = "8px"; + div.style.whiteSpace = "nowrap"; // div.dataset.nature='metal'; return; } - node.style.transition='all ease-in 0.3s'; - node.style.transform='perspective(1200px) rotateY(270deg) translateX(150px)'; - var onEnd=function(){ + node.style.transition = "all ease-in 0.3s"; + node.style.transform = "perspective(1200px) rotateY(270deg) translateX(150px)"; + var onEnd = function () { node.init(node.name); - node.node.avatar.style.display=''; - if(node.rarity){ - node.node.intro.innerHTML=get.translation(node.rarity); - node.node.intro.classList.add('showintro'); + node.node.avatar.style.display = ""; + if (node.rarity) { + node.node.intro.innerHTML = get.translation(node.rarity); + node.node.intro.classList.add("showintro"); } - node.classList.add('playerflip'); - node.style.transform='none'; - node.style.transition=''; - if(lib.config.animation&&!lib.config.low_performance){ - setTimeout(function(){ - switch(game.getRarity(node.name)){ - case 'rare':node.$rare();break; - case 'epic':node.$epic();break; - case 'legend':node.$legend();break; + node.classList.add("playerflip"); + node.style.transform = "none"; + node.style.transition = ""; + if (lib.config.animation && !lib.config.low_performance) { + setTimeout(function () { + switch (game.getRarity(node.name)) { + case "rare": + node.$rare(); + break; + case "epic": + node.$epic(); + break; + case "legend": + node.$legend(); + break; } - },150); + }, 150); } }; node.listenTransition(onEnd); }; - setTimeout(function(){ + setTimeout(function () { nodes[0].delete(); - },400+Math.random()*300); - setTimeout(function(){ + }, 400 + Math.random() * 300); + setTimeout(function () { nodes[1].delete(); - },400+Math.random()*300); - setTimeout(function(){ + }, 400 + Math.random() * 300); + setTimeout(function () { nodes[2].delete(); - },400+Math.random()*300); - setTimeout(function(){ + }, 400 + Math.random() * 300); + setTimeout(function () { nodes[3].delete(); - },400+Math.random()*300); - setTimeout(function(){ + }, 400 + Math.random() * 300); + setTimeout(function () { nodes[4].delete(); - },400+Math.random()*300); - setTimeout(function(){ + }, 400 + Math.random() * 300); + setTimeout(function () { nodes[5].delete(); - },400+Math.random()*300); - setTimeout(function(){ + }, 400 + Math.random() * 300); + setTimeout(function () { nodes[6].delete(); - },400+Math.random()*300); - setTimeout(function(){ + }, 400 + Math.random() * 300); + setTimeout(function () { nodes[7].delete(); - },400+Math.random()*300); - setTimeout(function(){ + }, 400 + Math.random() * 300); + setTimeout(function () { nodes[8].delete(); - },400+Math.random()*300); - setTimeout(function(){ - var prize=new Array(6); - var map=[1,2,3,4,5]; - var ccount=3; - var win=game.data.arena.win; + }, 400 + Math.random() * 300); + setTimeout(function () { + var prize = new Array(6); + var map = [1, 2, 3, 4, 5]; + var ccount = 3; + var win = game.data.arena.win; var prizeValue; - switch(win){ - case 0:prizeValue=100;break; - case 1:prizeValue=120;break; - case 2:prizeValue=150;break; - case 3:prizeValue=190;break; - case 4:prizeValue=240;break; - case 5:prizeValue=300;break; - case 6:prizeValue=370;break; - case 7:prizeValue=450;break; - case 8:prizeValue=540;break; - case 9:prizeValue=640;break; - case 10:prizeValue=750;break; - case 11:prizeValue=870;break; - case 12:prizeValue=1000;break; + switch (win) { + case 0: + prizeValue = 100; + break; + case 1: + prizeValue = 120; + break; + case 2: + prizeValue = 150; + break; + case 3: + prizeValue = 190; + break; + case 4: + prizeValue = 240; + break; + case 5: + prizeValue = 300; + break; + case 6: + prizeValue = 370; + break; + case 7: + prizeValue = 450; + break; + case 8: + prizeValue = 540; + break; + case 9: + prizeValue = 640; + break; + case 10: + prizeValue = 750; + break; + case 11: + prizeValue = 870; + break; + case 12: + prizeValue = 1000; + break; } - if(Math.random()<0.4){ - if(win>=3&&Math.random()<0.5){ - ccount=4; - prizeValue-=33; - } - else{ - ccount=2; - prizeValue+=33; + if (Math.random() < 0.4) { + if (win >= 3 && Math.random() < 0.5) { + ccount = 4; + prizeValue -= 33; + } else { + ccount = 2; + prizeValue += 33; } } - prizeValue-=100; - while(ccount--){ - prize[map.randomRemove()]=game.getLeaderCharacter(); + prizeValue -= 100; + while (ccount--) { + prize[map.randomRemove()] = game.getLeaderCharacter(); } - if(map.length){ - prizeValue/=map.length; + if (map.length) { + prizeValue /= map.length; } - while(map.length){ - var val=Math.round((Math.random()*0.4+0.8)*prizeValue); - if(Math.random()<0.7){ - prize[map.shift()]=['chess_coin',Math.max(Math.ceil(Math.random()*5),val)]; - } - else{ - val=Math.round(val/3); - prize[map.shift()]=['chess_dust',Math.max(Math.ceil(Math.random()*3),val)]; + while (map.length) { + var val = Math.round((Math.random() * 0.4 + 0.8) * prizeValue); + if (Math.random() < 0.7) { + prize[map.shift()] = [ + "chess_coin", + Math.max(Math.ceil(Math.random() * 5), val), + ]; + } else { + val = Math.round(val / 3); + prize[map.shift()] = [ + "chess_dust", + Math.max(Math.ceil(Math.random() * 3), val), + ]; } } - for(var i=1;i=4&&!bosses.childNodes[i].classList.contains('glow')){ - bosses.childNodes[i].classList.add('forbidden'); - } - else{ - bosses.childNodes[i].classList.remove('forbidden'); + for (var i = 0; i < bosses.childElementCount; i++) { + if (num >= 4 && !bosses.childNodes[i].classList.contains("glow")) { + bosses.childNodes[i].classList.add("forbidden"); + } else { + bosses.childNodes[i].classList.remove("forbidden"); } } - if(num){ - if(!event.asboss){ - event.asboss=ui.create.control('应战',function(){ - _status.boss=true; + if (num) { + if (!event.asboss) { + event.asboss = ui.create.control("应战", function () { + _status.boss = true; ui.click.ok(); }); } - } - else{ - if(event.asboss){ + } else { + if (event.asboss) { event.asboss.close(); delete event.asboss; } @@ -3718,193 +4019,246 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ addToButton(); }; - var clickedJiange=false; - var clickJiange=function(){ - clickedJiange=true; - if(this.classList.contains('glow2')){ - this.classList.remove('glow2'); - } - else{ - this.classList.add('glow2'); + var clickedJiange = false; + var clickJiange = function () { + clickedJiange = true; + if (this.classList.contains("glow2")) { + this.classList.remove("glow2"); + } else { + this.classList.add("glow2"); } addToButton(); }; - for(var i=0;inum){ - for(var i=num;i num) { + for (var i = num; i < dialog.buttons.length; i++) { dialog.buttons[i].remove(); } dialog.buttons.splice(num); - } - else if(dialog.buttons.length2) return false; - var xy1=event.source.getXY(); - var xy2=player.getXY(); - var dx=xy2[0]-xy1[0]; - var dy=xy2[1]-xy1[1]; + _attackmove: { + trigger: { player: "damage" }, + silent: true, + priority: 50, + filter: function (event, player) { + if (!event.source) return false; + if (get.distance(event.source, player, "pure") > 2) return false; + var xy1 = event.source.getXY(); + var xy2 = player.getXY(); + var dx = xy2[0] - xy1[0]; + var dy = xy2[1] - xy1[1]; // if(dx*dy!=0) return false; - if(dx==0&&Math.abs(dy)==2){ - dy/=2; + if (dx == 0 && Math.abs(dy) == 2) { + dy /= 2; } - if(dy==0&&Math.abs(dx)==2){ - dx/=2; + if (dy == 0 && Math.abs(dx) == 2) { + dx /= 2; } - return player.movable(dx,dy); + return player.movable(dx, dy); }, - content:function(){ - var xy1=trigger.source.getXY(); - var xy2=player.getXY(); - var dx=xy2[0]-xy1[0]; - var dy=xy2[1]-xy1[1]; - if(dx==0&&Math.abs(dy)==2){ - dy/=2; + content: function () { + var xy1 = trigger.source.getXY(); + var xy2 = player.getXY(); + var dx = xy2[0] - xy1[0]; + var dy = xy2[1] - xy1[1]; + if (dx == 0 && Math.abs(dy) == 2) { + dy /= 2; } - if(dy==0&&Math.abs(dx)==2){ - dx/=2; + if (dy == 0 && Math.abs(dx) == 2) { + dx /= 2; } - if(player.movable(dx,dy)){ - player.move(dx,dy); + if (player.movable(dx, dy)) { + player.move(dx, dy); } - } + }, }, - dubiaoxianjing:{ - global:'dubiaoxianjing2' + dubiaoxianjing: { + global: "dubiaoxianjing2", }, - dubiaoxianjing2:{ - trigger:{player:'phaseAfter'}, - forced:true, - popup:false, - filter:function(event,player){ - if(player.hp<=1) return false; - for(var i=0;i1) return false; - for(var i=0;i 1) return false; + for (var i = 0; i < game.treasures.length; i++) { + if (game.treasures[i].name == "treasure_wuyashenxiang") { + return get.chessDistance(game.treasures[i], player) <= 3; } } return false; }, - content:function(){ - 'step 0' - var source=null; - for(var i=0;inh) return false; + shenpanxianjing2: { + trigger: { player: "phaseAfter" }, + forced: true, + popup: false, + filter: function (event, player) { + var nh = player.countCards("h"); + if (!nh) return false; + for (var i = 0; i < game.treasures.length; i++) { + if (game.treasures[i].name == "treasure_shenpanxianjing") { + for (var j = 0; j < game.players.length; j++) { + if (game.players[j].countCards("h") > nh) return false; } return true; } } return false; }, - content:function(){ - 'step 0' - var source=null; - for(var i=0;i3; + shenmidiaoxiang2: { + trigger: { player: "phaseAfter" }, + forced: true, + popup: false, + filter: function (event, player) { + for (var i = 0; i < game.treasures.length; i++) { + if (game.treasures[i].name == "treasure_shenmidiaoxiang") { + return ( + player.canMoveTowards(game.treasures[i]) && + get.chessDistance(game.treasures[i], player) > 3 + ); } } return false; }, - content:function(){ - 'step 0' - var source=null; - for(var i=0;igame.data.arena.dead.length; }, - direct:true, - delay:0, - preservecancel:true, - content:function(){ - "step 0" - var list=game.data.arena.arenachoice.slice(0); - for(var i=0;i game.data.arena.dead.length + ); + }, + direct: true, + delay: 0, + preservecancel: true, + content: function () { + "step 0"; + var list = game.data.arena.arenachoice.slice(0); + for (var i = 0; i < game.data.arena.dead.length; i++) { list.remove(game.data.arena.dead[i]); } - event.dialog=ui.create.dialog('选择一个出场武将',[list,'character']); + event.dialog = ui.create.dialog("选择一个出场武将", [list, "character"]); game.pause(); - _status.imchoosing=true; - event.custom.replace.button=function(button){ - event.choice=button.link; + _status.imchoosing = true; + event.custom.replace.button = function (button) { + event.choice = button.link; game.resume(); + }; + event.custom.replace.confirm = game.resume; + event.switchToAuto = game.resume; + "step 1"; + if (ui.confirm) { + ui.confirm.classList.add("removing"); } - event.custom.replace.confirm=game.resume; - event.switchToAuto=game.resume; - "step 1" - if(ui.confirm){ - ui.confirm.classList.add('removing'); - } - _status.imchoosing=false; + _status.imchoosing = false; event.dialog.close(); - if(event.choice){ - var name=event.choice; + if (event.choice) { + var name = event.choice; game.addChessPlayer(name); game.data.arena.dead.push(name); game.saveData(); - if(!_status.arenaAdd){ - _status.arenaAdd=[]; + if (!_status.arenaAdd) { + _status.arenaAdd = []; } _status.arenaAdd.push(name); game.delay(); - } - else{ - player.getStat('skill').arenaAdd--; + } else { + player.getStat("skill").arenaAdd--; } }, }, - leader_zhaoxiang:{ - unique:true, - enable:'phaseUse', - usable:1, - promptfunc:function(event,player){ - var targets=[]; - var skill=lib.skill.leader_zhaoxiang; - for(var i=0;i

    ' - for(var i=0;i'+ - (skill.chance(targets[i],player)*100).toFixed(2)+'%
    '; + var str = lib.translate.leader_zhaoxiang_info; + if (targets.length) { + str = + '

    ⚑ ' + + game.data.dust + + '

    '; + for (var i = 0; i < targets.length; i++) { + str += + '' + + get.translation(targets[i]) + + ':' + + (skill.chance(targets[i], player) * 100).toFixed(2) + + "%
    "; } - str+='

    ' + str += "

    "; } return str; }, - chance:function(target,player){ + chance: function (target, player) { var chance; - var renyi=player.hasSkill('leader_renyi'); - switch(target.hp){ - case 1:chance=0.7;break; - case 2:chance=0.4;break; - default:chance=0.2;break; + var renyi = player.hasSkill("leader_renyi"); + switch (target.hp) { + case 1: + chance = 0.7; + break; + case 2: + chance = 0.4; + break; + default: + chance = 0.2; + break; } - switch(target.countCards('he')){ - case 0:break; - case 1:chance/=1.2;break; - case 2:chance/=1.4;break; - case 3:chance/=1.7;break; - default:chance/=2;break; + switch (target.countCards("he")) { + case 0: + break; + case 1: + chance /= 1.2; + break; + case 2: + chance /= 1.4; + break; + case 3: + chance /= 1.7; + break; + default: + chance /= 2; + break; } - switch(game.getRarity(target.name)){ - case 'common':{ - if(renyi) chance*=2; + switch (game.getRarity(target.name)) { + case "common": { + if (renyi) chance *= 2; break; } - case 'rare':{ - chance/=2; - if(renyi) chance*=2; + case "rare": { + chance /= 2; + if (renyi) chance *= 2; break; } - case 'epic':{ - chance/=5; - if(renyi) chance*=1.5; + case "epic": { + chance /= 5; + if (renyi) chance *= 1.5; break; } - case 'legend':{ - chance/=15; - if(renyi) chance*=1.2; + case "legend": { + chance /= 15; + if (renyi) chance *= 1.2; break; } } - return Math.min(1,chance); + return Math.min(1, chance); }, - filter:function(){ - return game.data.dust>=10; + filter: function () { + return game.data.dust >= 10; }, - filterTarget:function(card,player,target){ - return game.isChessNeighbour(player,target)&&!game.data.character.includes(target.name); + filterTarget: function (card, player, target) { + return ( + game.isChessNeighbour(player, target) && !game.data.character.includes(target.name) + ); }, - content:function(){ - var chance=lib.skill.leader_zhaoxiang.chance(target,player); + content: function () { + var chance = lib.skill.leader_zhaoxiang.chance(target, player); game.changeDust(-10); - if(Math.random()0; }, - content:function(){ - switch(_status.difficulty){ - case 'leader_easy':game.reward+=2*trigger.num;break; - case 'leader_medium':game.reward+=4*trigger.num;break; - case 'leader_hard':game.reward+=6*trigger.num;break; + }, + leader_xiaoxiong: { + unique: true, + forced: true, + trigger: { source: "damageSource" }, + filter: function (event, player) { + return event.num > 0; + }, + content: function () { + switch (_status.difficulty) { + case "leader_easy": + game.reward += 2 * trigger.num; + break; + case "leader_medium": + game.reward += 4 * trigger.num; + break; + case "leader_hard": + game.reward += 6 * trigger.num; + break; } - } - }, - leader_renyi:{ - unique:true, - }, - leader_mouduan:{ - unique:true, - global:'leader_mouduan2' - }, - leader_mouduan2:{ - mod:{ - chessMove:function(player,current){ - if(player.side&&player.name!=_status.lord) return current+1; - } - } - }, - leader_zhenlve:{ - trigger:{global:'useCard1'}, - unique:true, - charlotte:true, - firstDo:true, - forced:true, - popup:false, - filter:function(event,player){ - return get.type(event.card)=='trick'&&event.player.isFriendOf(player); - }, - content:function(){ - trigger.nowuxie=true; }, }, - tongshuai:{ - unique:true, - forbid:['guozhan'], - init:function(player){ - player.storage.tongshuai={ - list:[], - owned:{}, - player:player, - get:function(num){ - if(typeof num!='number') num=1; - var player=this.player; - while(num--){ - var name=player.storage.tongshuai.unowned.shift(); - if(!name) return; - var skills=lib.character[name][3].slice(0); - for(var i=0;i
    【'+get.translation(skill)+ - '】
    '+lib.translate[skill+'_info']+'
    '); + var skill = player.additionalSkills.tongshuai[0]; + if (skill) { + dialog.add( + '
    【' + + get.translation(skill) + + "】
    " + + lib.translate[skill + "_info"] + + "
    " + ); } - } + }, }, // mark:true }, - tongshuai1:{ - trigger:{global:'gameStart'}, - forced:true, - popup:false, - priority:10, - content:function(){ - for(var i=0;i1){ + if (player.storage.tongshuai.unowned.length > 1) { player.storage.tongshuai.get(2); - } - else if(player.storage.tongshuai.unowned.length==1){ + } else if (player.storage.tongshuai.unowned.length == 1) { player.storage.tongshuai.get(); + } else { + player.removeSkill("tongshuai"); } - else{ - player.removeSkill('tongshuai'); - } - } + }, }, - tongshuai2:{ - audio:2, - trigger:{player:['phaseBegin','phaseEnd'],global:'gameStart'}, - filter:function(event,player,name){ - if(!player.hasSkill('tongshuai')) return false; - if(name=='phaseBegin'&&game.phaseNumber==1) return false; + tongshuai2: { + audio: 2, + trigger: { player: ["phaseBegin", "phaseEnd"], global: "gameStart" }, + filter: function (event, player, name) { + if (!player.hasSkill("tongshuai")) return false; + if (name == "phaseBegin" && game.phaseNumber == 1) return false; return true; }, - priority:-9, - forced:true, - popup:false, - content:function(){ - var slist=player.storage.tongshuai.owned; - var list=[]; - for(var i in slist){ + priority: -9, + forced: true, + popup: false, + content: function () { + var slist = player.storage.tongshuai.owned; + var list = []; + for (var i in slist) { list.push(i); } - if(event.isMine()){ - event.dialog=ui.create.dialog('选择获得一项技能',[list,'character']); - if(trigger.name=='game'){ - event.control=ui.create.control(); + if (event.isMine()) { + event.dialog = ui.create.dialog("选择获得一项技能", [list, "character"]); + if (trigger.name == "game") { + event.control = ui.create.control(); + } else { + event.control = ui.create.control(["cancel"]); } - else{ - event.control=ui.create.control(['cancel']); - } - event.clickControl=function(link){ - if(link!='cancel'){ - var currentname=event.dialog.querySelector('.selected.button').link; - var mark=player.marks.tongshuai; - if(!mark){ - player.markSkill('tongshuai'); - mark=player.marks.tongshuai; - if(mark.firstChild){ + event.clickControl = function (link) { + if (link != "cancel") { + var currentname = event.dialog.querySelector(".selected.button").link; + var mark = player.marks.tongshuai; + if (!mark) { + player.markSkill("tongshuai"); + mark = player.marks.tongshuai; + if (mark.firstChild) { mark.firstChild.remove(); } } - mark.setBackground(currentname,'character'); + mark.setBackground(currentname, "character"); - player.addAdditionalSkill('tongshuai',link); - game.addVideo('chess_tongshuai_skill',player,[currentname,link]); - player.logSkill('tongshuai2'); - game.log(player,'获得技能','【'+get.translation(link)+'】'); + player.addAdditionalSkill("tongshuai", link); + game.addVideo("chess_tongshuai_skill", player, [currentname, link]); + player.logSkill("tongshuai2"); + game.log(player, "获得技能", "【" + get.translation(link) + "】"); player.popup(link); - for(var i=0;i0; }, - content:function(){ - player.storage.tongshuai.get(); - } }, - cangming:{ - enable:'phaseUse', - usable:1, - unique:true, - filter:function(event,player){ - if(player.isTurnedOver()) return false; - var suits=[]; - var hs=player.getCards('h'); - for(var i=0;i 0 + ); + }, + content: function () { + player.storage.tongshuai.get(); + }, + }, + cangming: { + enable: "phaseUse", + usable: 1, + unique: true, + filter: function (event, player) { + if (player.isTurnedOver()) return false; + var suits = []; + var hs = player.getCards("h"); + for (var i = 0; i < hs.length; i++) { suits.add(get.suit(hs[i])); - if(suits.length>=4) return true; + if (suits.length >= 4) return true; } return false; }, - filterCard:function(card){ - var suit=get.suit(card); - for(var i=0;i1) break; + if (num > 1) break; } } - if(num<=1) return; - if(_status.currentPhase==player&&player.countCards('h')=6){ - if(typeof card=='string') return; - if(card.name=='wuzhong') return; - if(card.name=='shunshou') return; - if(card.name=='yuanjiao') return; - if(card.name=='yiyi') return; - if(!player.hasSkill('cangming2')) return 'zeroplayertarget'; + if (num <= 1) return; + if ( + _status.currentPhase == player && + player.countCards("h") < player.hp && + player.hp >= 6 + ) { + if (typeof card == "string") return; + if (card.name == "wuzhong") return; + if (card.name == "shunshou") return; + if (card.name == "yuanjiao") return; + if (card.name == "yiyi") return; + if (!player.hasSkill("cangming2")) return "zeroplayertarget"; } - } + }, }, - result:{ - target:function(player){ - var num=0; - for(var i=0;i1) break; + if (num > 1) break; } } - if(num<=1) return 0; + if (num <= 1) return 0; return -10; - } - } + }, + }, }, }, - cangming2:{ - trigger:{player:'phaseZhunbeiBegin'}, - forced:true, - popup:false, - content:function(){ - for(var i=0;i0; + filter: function (event, player) { + if (event.targets.length != 1 || event.card.name != "sha") return false; + return lib.skill.guanchuan.getTargets(player, event.targets[0]).length > 0; }, - check:function(event,player){ - var targets=lib.skill.guanchuan.getTargets(player,event.targets[0]); - var eff=0; - for(var i=0;i0; + return eff > 0; }, - content:function(){ - var targets=lib.skill.guanchuan.getTargets(player,trigger.targets[0]); - for(var i=0;i1&&lib.filter.filterCard({name:'sha'},player); + player.logSkill("guanchuan", targets); }, - filterCard:{name:'sha'}, - selectCard:2, - check:function(card){ - var num=0; - var player=_status.event.player; - for(var i=0;i0){ + }, + sanjiansheji: { + enable: "phaseUse", + filter: function (event, player) { + return ( + player.countCards("h", "sha") > 1 && lib.filter.filterCard({ name: "sha" }, player) + ); + }, + filterCard: { name: "sha" }, + selectCard: 2, + check: function (card) { + var num = 0; + var player = _status.event.player; + for (var i = 0; i < game.players.length; i++) { + if ( + lib.filter.targetEnabled({ name: "sha" }, player, game.players[i]) && + get.effect(game.players[i], { name: "sha" }, player) > 0 + ) { num++; - if(num>1) return 8-get.value(card); + if (num > 1) return 8 - get.value(card); } } return 0; }, - selectTarget:[1,Infinity], - discard:false, - prepare:'throw', - filterTarget:function(card,player,target){ - return lib.filter.targetEnabled({name:'sha'},player,target)&& - get.distance(player,target,'pure')<=5; + selectTarget: [1, Infinity], + discard: false, + prepare: "throw", + filterTarget: function (card, player, target) { + return ( + lib.filter.targetEnabled({ name: "sha" }, player, target) && + get.distance(player, target, "pure") <= 5 + ); }, - content:function(){ + content: function () { targets.sort(lib.sort.seat); - player.useCard({name:'sha'},cards,targets,'luanjian').animate=false; + player.useCard({ name: "sha" }, cards, targets, "luanjian").animate = false; }, - multitarget:true, - ai:{ - order:function(){ - return get.order({name:'sha'})+0.1; + multitarget: true, + ai: { + order: function () { + return get.order({ name: "sha" }) + 0.1; }, - result:{ - target:function(player,target){ - return get.effect(target,{name:'sha'},player,target); - } + result: { + target: function (player, target) { + return get.effect(target, { name: "sha" }, player, target); + }, }, - effect:{ - player:function(card,player){ - if(_status.currentPhase!=player) return; - if(card.name=='sha'&&player.countCards('h','sha')<2&&player.countCards('h')<=player.hp){ - var num=0; - var player=_status.event.player; - for(var i=0;i1) return 'zeroplayertarget'; + if (num > 1) return "zeroplayertarget"; } } } - } + }, }, - } - }, - zhiming:{ - trigger:{source:'damageBegin1'}, - filter:function(event,player){ - return get.distance(event.player,player,'attack')>1&&event.card&&event.card.name=='sha'; }, - forced:true, - content:function(){ + }, + zhiming: { + trigger: { source: "damageBegin1" }, + filter: function (event, player) { + return ( + get.distance(event.player, player, "attack") > 1 && + event.card && + event.card.name == "sha" + ); + }, + forced: true, + content: function () { trigger.num++; - } + }, }, - lianshe:{ - mod:{ - cardUsable:function(card,player,num){ - if(card.name=='sha'){ - return num+player.getHistory('useCard',function(evt){ - return evt.card.name!='sha'; - }).length; + lianshe: { + mod: { + cardUsable: function (card, player, num) { + if (card.name == "sha") { + return ( + num + + player.getHistory("useCard", function (evt) { + return evt.card.name != "sha"; + }).length + ); } }, }, - trigger:{player:'useCard'}, - frequent:true, - filter:function(event,player){ - return event.card&&event.card.name=='sha'&&player.getHistory('useCard',function(evt){ - return evt.card.name=='sha'; - })[0]==event; + trigger: { player: "useCard" }, + frequent: true, + filter: function (event, player) { + return ( + event.card && + event.card.name == "sha" && + player.getHistory("useCard", function (evt) { + return evt.card.name == "sha"; + })[0] == event + ); }, - content:function(){ + content: function () { player.draw(); }, - ai:{ - threaten:1.5, - } - }, - pianyi:{ - direct:true, - filter:function(event,player){ - return !player.getStat('damage'); + ai: { + threaten: 1.5, }, - content:function(){ - "step 0" - player.chooseToMoveChess(2,get.prompt('pianyi')); - "step 1" - if(result.bool){ - player.logSkill('pianyi'); + }, + pianyi: { + direct: true, + filter: function (event, player) { + return !player.getStat("damage"); + }, + content: function () { + "step 0"; + player.chooseToMoveChess(2, get.prompt("pianyi")); + "step 1"; + if (result.bool) { + player.logSkill("pianyi"); } - } - }, - lingdong:{ - trigger:{player:'phaseJieshuBegin'}, - direct:true, - filter:function(event,player){ - return player.getHistory('useCard',function(evt){ - return evt.card.name=='sha'; - }).length>0; }, - content:function(){ - "step 0" - player.chooseToMoveChess(player.getHistory('useCard',function(evt){ - return evt.card.name=='sha'; - }).length,get.prompt('lingdong')); - "step 1" - if(result.bool){ - player.logSkill('lingdong'); + }, + lingdong: { + trigger: { player: "phaseJieshuBegin" }, + direct: true, + filter: function (event, player) { + return ( + player.getHistory("useCard", function (evt) { + return evt.card.name == "sha"; + }).length > 0 + ); + }, + content: function () { + "step 0"; + player.chooseToMoveChess( + player.getHistory("useCard", function (evt) { + return evt.card.name == "sha"; + }).length, + get.prompt("lingdong") + ); + "step 1"; + if (result.bool) { + player.logSkill("lingdong"); } - } - }, - _noactpunish:{ - trigger:{player:'useCard'}, - filter:function(event,player){ - return _status.currentPhase==player&&event.targets&&(event.targets.length>1||event.targets[0]!=player); }, - forced:true, - popup:false, - content:function(){ - player.addTempSkill('noactpunish'); - } }, - noactpunish:{}, - _chess_chuzhang:{ - enable:'phaseUse', - usable:1, - direct:true, - delay:false, - preservecancel:true, - filter:function(event,player){ - var num=0; - var xy=player.getXY(); + _noactpunish: { + trigger: { player: "useCard" }, + filter: function (event, player) { + return ( + _status.currentPhase == player && + event.targets && + (event.targets.length > 1 || event.targets[0] != player) + ); + }, + forced: true, + popup: false, + content: function () { + player.addTempSkill("noactpunish"); + }, + }, + noactpunish: {}, + _chess_chuzhang: { + enable: "phaseUse", + usable: 1, + direct: true, + delay: false, + preservecancel: true, + filter: function (event, player) { + var num = 0; + var xy = player.getXY(); var neighbour; - neighbour=player.getNeighbour(-1,0); - if(neighbour&&typeof neighbour.tempObstacle!='number'&&game.obstacles.includes(neighbour)){ + neighbour = player.getNeighbour(-1, 0); + if ( + neighbour && + typeof neighbour.tempObstacle != "number" && + game.obstacles.includes(neighbour) + ) { + num++; + } else if (xy[0] == 0) { num++; } - else if(xy[0]==0){ + neighbour = player.getNeighbour(1, 0); + if ( + neighbour && + typeof neighbour.tempObstacle != "number" && + game.obstacles.includes(neighbour) + ) { + num++; + } else if (xy[0] + 1 >= ui.chesswidth) { num++; } - neighbour=player.getNeighbour(1,0); - if(neighbour&&typeof neighbour.tempObstacle!='number'&&game.obstacles.includes(neighbour)){ + neighbour = player.getNeighbour(0, -1); + if ( + neighbour && + typeof neighbour.tempObstacle != "number" && + game.obstacles.includes(neighbour) + ) { + num++; + } else if (xy[1] == 0) { num++; } - else if(xy[0]+1>=ui.chesswidth){ + neighbour = player.getNeighbour(0, 1); + if ( + neighbour && + typeof neighbour.tempObstacle != "number" && + game.obstacles.includes(neighbour) + ) { + num++; + } else if (xy[1] + 1 >= ui.chessheight) { num++; } - neighbour=player.getNeighbour(0,-1); - if(neighbour&&typeof neighbour.tempObstacle!='number'&&game.obstacles.includes(neighbour)){ - num++; - } - else if(xy[1]==0){ - num++; - } - neighbour=player.getNeighbour(0,1); - if(neighbour&&typeof neighbour.tempObstacle!='number'&&game.obstacles.includes(neighbour)){ - num++; - } - else if(xy[1]+1>=ui.chessheight){ - num++; - } - return num>=3; + return num >= 3; }, - content:function(){ - 'step 0' - event.obstacles=[]; - event.movemap={}; + content: function () { + "step 0"; + event.obstacles = []; + event.movemap = {}; var neighbour; - neighbour=player.getNeighbour(-1,0); - if(neighbour&&typeof neighbour.tempObstacle!='number'&&game.obstacles.includes(neighbour)){ + neighbour = player.getNeighbour(-1, 0); + if ( + neighbour && + typeof neighbour.tempObstacle != "number" && + game.obstacles.includes(neighbour) + ) { event.obstacles.push(neighbour); - if(player.movable(-2,0)){ - event.movemap['[-1,0]']=neighbour; + if (player.movable(-2, 0)) { + event.movemap["[-1,0]"] = neighbour; } } - neighbour=player.getNeighbour(1,0); - if(neighbour&&typeof neighbour.tempObstacle!='number'&&game.obstacles.includes(neighbour)){ + neighbour = player.getNeighbour(1, 0); + if ( + neighbour && + typeof neighbour.tempObstacle != "number" && + game.obstacles.includes(neighbour) + ) { event.obstacles.push(neighbour); - if(player.movable(2,0)){ - event.movemap['[1,0]']=neighbour; + if (player.movable(2, 0)) { + event.movemap["[1,0]"] = neighbour; } } - neighbour=player.getNeighbour(0,-1); - if(neighbour&&typeof neighbour.tempObstacle!='number'&&game.obstacles.includes(neighbour)){ + neighbour = player.getNeighbour(0, -1); + if ( + neighbour && + typeof neighbour.tempObstacle != "number" && + game.obstacles.includes(neighbour) + ) { event.obstacles.push(neighbour); - if(player.movable(0,-2)){ - event.movemap['[0,-1]']=neighbour; + if (player.movable(0, -2)) { + event.movemap["[0,-1]"] = neighbour; } } - neighbour=player.getNeighbour(0,1); - if(neighbour&&typeof neighbour.tempObstacle!='number'&&game.obstacles.includes(neighbour)){ + neighbour = player.getNeighbour(0, 1); + if ( + neighbour && + typeof neighbour.tempObstacle != "number" && + game.obstacles.includes(neighbour) + ) { event.obstacles.push(neighbour); - if(player.movable(0,2)){ - event.movemap['[0,1]']=neighbour; + if (player.movable(0, 2)) { + event.movemap["[0,1]"] = neighbour; } } - if(!event.obstacles.length){ + if (!event.obstacles.length) { event.finish(); return; - } - else if(event.obstacles.length==1){ - event.obstacle=event.obstacles[0]; - } - else if(event.isMine()){ - for(var i=0;i'+lib.translate._chess_chuzhang_info+''); - event.custom.replace.confirm=function(){ + _status.imchoosing = true; + event.dialog = ui.create.dialog("移动一个与你相邻的路障"); + event.dialog.add( + '
    ' + lib.translate._chess_chuzhang_info + "
    " + ); + event.custom.replace.confirm = function () { player.getStat().skill._chess_chuzhang--; - event.cancelled=true; + event.cancelled = true; game.resume(); }; } - 'step 1' - if(ui.confirm){ - ui.confirm.classList.add('removing'); + "step 1"; + if (ui.confirm) { + ui.confirm.classList.add("removing"); } - _status.imchoosing=false; - if(!event.cancelled){ - if(!event.obstacle){ - event.obstacle=event.obstacles.randomGet(); + _status.imchoosing = false; + if (!event.cancelled) { + if (!event.obstacle) { + event.obstacle = event.obstacles.randomGet(); } - var moved=false; - for(var i in event.movemap){ - if(event.movemap[i]==event.obstacle){ - var xy=JSON.parse(i); - if(game.moveObstacle(event.obstacle,xy[0],xy[1])){ - moved=true; + var moved = false; + for (var i in event.movemap) { + if (event.movemap[i] == event.obstacle) { + var xy = JSON.parse(i); + if (game.moveObstacle(event.obstacle, xy[0], xy[1])) { + moved = true; break; } } } - if(!moved){ + if (!moved) { game.removeObstacle(event.obstacle); } - player.popup('除障'); + player.popup("除障"); game.delay(); } - for(var i=0;i0; + var move = 2; + move = game.checkMod(player, move, "chessMove", player); + return move > 0; }, - content:function(){ - "step 0" - var move=2; - move=game.checkMod(player,move,'chessMove',player); - player.chooseToMoveChess(move).phasing=true; - "step 1" - if(ui.confirm){ - ui.confirm.classList.add('removing'); + content: function () { + "step 0"; + var move = 2; + move = game.checkMod(player, move, "chessMove", player); + player.chooseToMoveChess(move).phasing = true; + "step 1"; + if (ui.confirm) { + ui.confirm.classList.add("removing"); } - if(!result.bool){ - var skill=player.getStat().skill; + if (!result.bool) { + var skill = player.getStat().skill; skill._chessmove--; - if(typeof skill._chessmovetried=='number'){ + if (typeof skill._chessmovetried == "number") { skill._chessmovetried++; - } - else{ - skill._chessmovetried=1; + } else { + skill._chessmovetried = 1; } } }, - ai:{ - order:5, - result:{ - playerx:function(player){ - if(get.mode()=='tafang'&&_status.enemies.includes(player)){ + ai: { + order: 5, + result: { + playerx: function (player) { + if (get.mode() == "tafang" && _status.enemies.includes(player)) { return 1; } - var nh=player.countCards('h'); - if(!player.countCards('h','sha')&& - !player.countCards('h','shunshou')&& - !player.countCards('h','bingliang')){ - if(nh<=Math.min(3,player.hp)) return Math.random()-0.3; - else if(nh<=Math.min(2,player.hp)) return Math.random()-0.4; - return Math.random()-0.5; + var nh = player.countCards("h"); + if ( + !player.countCards("h", "sha") && + !player.countCards("h", "shunshou") && + !player.countCards("h", "bingliang") + ) { + if (nh <= Math.min(3, player.hp)) return Math.random() - 0.3; + else if (nh <= Math.min(2, player.hp)) return Math.random() - 0.4; + return Math.random() - 0.5; } var neighbour; - neighbour=player.getNeighbour(0,1); - if(neighbour&&game.players.includes(neighbour)&&neighbour.side!=player.side){ - if(get.distance(player,neighbour,'attack')<1) return 1; + neighbour = player.getNeighbour(0, 1); + if ( + neighbour && + game.players.includes(neighbour) && + neighbour.side != player.side + ) { + if (get.distance(player, neighbour, "attack") < 1) return 1; return 0; } - neighbour=player.getNeighbour(0,-1); - if(neighbour&&game.players.includes(neighbour)&&neighbour.side!=player.side){ - if(get.distance(player,neighbour,'attack')<1) return 1; + neighbour = player.getNeighbour(0, -1); + if ( + neighbour && + game.players.includes(neighbour) && + neighbour.side != player.side + ) { + if (get.distance(player, neighbour, "attack") < 1) return 1; return 0; } - neighbour=player.getNeighbour(1,0); - if(neighbour&&game.players.includes(neighbour)&&neighbour.side!=player.side){ - if(get.distance(player,neighbour,'attack')<1) return 1; + neighbour = player.getNeighbour(1, 0); + if ( + neighbour && + game.players.includes(neighbour) && + neighbour.side != player.side + ) { + if (get.distance(player, neighbour, "attack") < 1) return 1; return 0; } - neighbour=player.getNeighbour(-1,0); - if(neighbour&&game.players.includes(neighbour)&&neighbour.side!=player.side){ - if(get.distance(player,neighbour,'attack')<1) return 1; + neighbour = player.getNeighbour(-1, 0); + if ( + neighbour && + game.players.includes(neighbour) && + neighbour.side != player.side + ) { + if (get.distance(player, neighbour, "attack") < 1) return 1; return 0; } return 1; }, - player:function(player){ - if(player.getStat().skill._chessmovetried>=10){ + player: function (player) { + if (player.getStat().skill._chessmovetried >= 10) { return 0; } - var x=lib.skill._chessmove.ai.result.playerx(player); - if(player.isMad()) return -x; + var x = lib.skill._chessmove.ai.result.playerx(player); + if (player.isMad()) return -x; return x; - } - } - } + }, + }, + }, }, - _chesscenter:{ - trigger:{player:['phaseBegin','useCardBegin','useSkillBegin','respondBegin','damageBegin','loseHpBegin'], - target:'useCardToBegin'}, - forced:true, - priority:100, - popup:false, - content:function(){ + _chesscenter: { + trigger: { + player: [ + "phaseBegin", + "useCardBegin", + "useSkillBegin", + "respondBegin", + "damageBegin", + "loseHpBegin", + ], + target: "useCardToBegin", + }, + forced: true, + priority: 100, + popup: false, + content: function () { player.chessFocus(); }, }, - boss_bfengxing:{ - mod:{ - chessMove:function(player,current){ - return current+2; + boss_bfengxing: { + mod: { + chessMove: function (player, current) { + return current + 2; }, - attackFrom:function(from,to,current){ - return current-2; + attackFrom: function (from, to, current) { + return current - 2; }, }, - trigger:{player:'phaseDrawBegin2'}, - forced:true, - filter:function(event){ + trigger: { player: "phaseDrawBegin2" }, + forced: true, + filter: function (event) { return !event.numFixed; }, - content:function(){ - trigger.num+=2; - } + content: function () { + trigger.num += 2; + }, }, - boss_chiyu:{ - enable:'phaseUse', - usable:1, - filterCard:{color:'red'}, - nodelay:true, - check:function(card){return 8-get.value(card);}, - filterTarget:function(card,player,target){ - return get.distance(player,target)<=5&&player!=target; + boss_chiyu: { + enable: "phaseUse", + usable: 1, + filterCard: { color: "red" }, + nodelay: true, + check: function (card) { + return 8 - get.value(card); }, - filter:function(event,player){ - return player.countCards('h',{color:'red'})>0; + filterTarget: function (card, player, target) { + return get.distance(player, target) <= 5 && player != target; }, - selectTarget:-1, - content:function(){ - target.damage('fire'); + filter: function (event, player) { + return player.countCards("h", { color: "red" }) > 0; }, - line:'fire', - ai:{ - order:1, - result:{ - target:function(player,target){ - return get.damageEffect(target,player,target,'fire'); - } - } - } - }, - boss_tenglong:{ - enable:'phaseUse', - usable:1, - position:'he', - filterCard:{type:'equip'}, - init:function(player){ - for(var i=1;i<6;i++){ - player.$disableEquip('equip'+i); - } + selectTarget: -1, + content: function () { + target.damage("fire"); }, - check:function(card){ - var player=_status.currentPhase; - if(player.countCards('he',{subtype:get.subtype(card)})>1){ - return 12-get.equipValue(card); - } - return 8-get.equipValue(card); - }, - filter:function(event,player){ - return player.countCards('he',{type:'equip'}); - }, - filterTarget:function(card,player,target){ - return player!=target&&get.distance(player,target)<=2; - }, - content:function(){ - target.damage(3,'fire'); - }, - ai:{ - order:9, - result:{ - target:function(player,target){ - return get.damageEffect(target,player,target,'fire'); - } - } - } - }, - boss_wuying:{ - mod:{ - globalTo:function(from,to,distance){ - return distance+2; + line: "fire", + ai: { + order: 1, + result: { + target: function (player, target) { + return get.damageEffect(target, player, target, "fire"); + }, }, - chessMove:function(player,current){ - return current-1; - } - } + }, }, - boss_wushang:{ - trigger:{player:'phaseZhunbeiBegin'}, - forced:true, - filter:function(event,player){ - for(var i=0;i 1) { + return 12 - get.equipValue(card); + } + return 8 - get.equipValue(card); + }, + filter: function (event, player) { + return player.countCards("he", { type: "equip" }); + }, + filterTarget: function (card, player, target) { + return player != target && get.distance(player, target) <= 2; + }, + content: function () { + target.damage(3, "fire"); + }, + ai: { + order: 9, + result: { + target: function (player, target) { + return get.damageEffect(target, player, target, "fire"); + }, + }, + }, + }, + boss_wuying: { + mod: { + globalTo: function (from, to, distance) { + return distance + 2; + }, + chessMove: function (player, current) { + return current - 1; + }, + }, + }, + boss_wushang: { + trigger: { player: "phaseZhunbeiBegin" }, + forced: true, + filter: function (event, player) { + for (var i = 0; i < game.players.length; i++) { + if ( + game.players[i] != player && + game.players[i].countCards("h") && + get.distance(player, game.players[i]) <= 5 + ) { return true; } } return false; }, - content:function(){ - "step 0" - var players=[]; - for(var i=0;i=ui.chessheight-1) return false; + }, + translate: { + zhu_config: "启用主将", + main_zhu_config: "启用副将", + noreplace_end_config: "无替补时结束", + reward_config: "杀敌摸牌", + punish_config: "杀死队友", + seat_order_config: "行动顺序", + battle_number_config: "对战人数", + replace_number_config: "替补人数", + first_less_config: "先手少摸牌", + single_control_config: "单人控制", + additional_player_config: "无尽模式", + choice_number_config: "无尽模式候选", + + friend: "友", + enemy: "敌", + neutral: "中", + trueColor: "zhu", + falseColor: "wei", + _chessmove: "移动", + leader: "君主", + combat: "对阵", + chessscroll_speed_config: "边缘滚动速度", + chess_character_config: "战棋武将", + only_chess_character_config: "只用战棋武将", + chess_ordered_config: "指定行动顺序", + chess_mode_config: "游戏模式", + chess_leader_save_config: "选择历程", + chess_leader_clear_config: "清除进度", + save1: "一", + save2: "二", + save3: "三", + save4: "四", + save5: "五", + + leader_2: " ", + leader_2_bg: "二", + leader_3: " ", + leader_3_bg: "三", + leader_5: " ", + leader_5_bg: "五", + leader_8: " ", + leader_8_bg: "八", + + leader_easy: " ", + leader_easy_bg: "简单", + leader_medium: " ", + leader_medium_bg: "普通", + leader_hard: " ", + leader_hard_bg: "困难", + + chess_caocao: "曹操", + chess_xunyu: "荀彧", + chess_simayi: "司马懿", + chess_xiahoudun: "夏侯惇", + chess_dianwei: "典韦", + chess_xuzhu: "许褚", + chess_zhangliao: "张辽", + chess_jiaxu: "贾诩", + + chess_liubei: "刘备", + chess_guanyu: "关羽", + chess_zhangfei: "张飞", + chess_zhaoyun: "赵云", + chess_machao: "马超", + chess_huangzhong: "黄忠", + chess_maliang: "马良", + chess_zhugeliang: "诸葛亮", + + chess_sunquan: "孙权", + chess_zhouyu: "周瑜", + chess_lvmeng: "吕蒙", + chess_huanggai: "黄盖", + chess_lusu: "鲁肃", + chess_luxun: "陆逊", + chess_ganning: "甘宁", + chess_taishici: "太史慈", + + chess_lvbu: "吕布", + chess_sunshangxiang: "孙尚香", + chess_diaochan: "貂蝉", + chess_huatuo: "华佗", + chess_zhangjiao: "张辽", + chess_menghuo: "孟获", + + chess_dongzhuo: "董卓", + chess_xingtian: "刑天", + chess_jinchidiao: "金翅雕", + chess_beimingjukun: "北溟巨鲲", + chess_wuzhaojinlong: "五爪金龙", + + treasure_dubiaoxianjing: "毒镖陷阱", + treasure_jiqishi: "集气石", + treasure_shenmidiaoxiang: "神秘雕像", + treasure_shenpanxianjing: "审判之刃", + treasure_shiyuansu: "石元素", + treasure_wuyashenxiang: "乌鸦神像", + + dubiaoxianjing: "飞刃", + dubiaoxianjing_info: "距离两格体力值大于1的角色在回合结束后受到1点伤害,然后摸两张牌。", + jiqishi: "集气", + jiqishi_info: "距离两格以内的已受伤角色在回合结束后回复1点体力,然后弃置两张牌。", + shenmidiaoxiang: "秘咒", + shenmidiaoxiang_info: "距离三格以外的所有角色在回合结束后强制向此处移动一格。", + shenpanxianjing: "审判", + shenpanxianjing_info: + "在任意一名角色回合结束后,若没有其他角色手牌数比其多,随机弃置其一张手牌。", + shiyuansu: "护体", + shiyuansu_info: "任意一名角色一次性受到不少于2点伤害后,使其获得1点护甲。", + wuyashenxiang: "厄音", + wuyashenxiang_info: + "距离3格以内的角色在其回合结束后,若体力值不大于1,令其回复1点体力,然后将牌堆中的一张延时锦囊牌置于其判定区。", + + leader_caocao: "曹操", + leader_liubei: "刘备", + leader_sunquan: "孙权", + leader_yuri: "由理", + leader_xiaoxiong: "枭雄", + leader_xiaoxiong_info: "当你造成伤害后,获胜后会得到一定数量的额外金币奖励。", + leader_renyi: "仁义", + leader_renyi_info: "你招降敌将的成功率大幅增加。", + leader_mouduan: "谋断", + leader_mouduan_info: "其他友方角色回合内的行动范围+1。", + leader_zhenlve: "缜略", + leader_zhenlve_info: "友方角色使用的普通锦囊牌不可被【无懈可击】响应。", + + tongshuai: "统率", + tongshuai_info: "准备阶段和结束阶段,你可以选择一名未上场的已方武将的一个技能作为你的技能。", + leader_zhaoxiang: "招降", + leader_zhaoxiang_info: + "出牌阶段限一次,你可以尝试对相邻敌方武将进行招降,若成功,你获得该武将并立即结束本局游戏,若失败,你受到1点伤害。每发动一次消耗10招募令。", + + common: "普通", + rare: "精品", + epic: "史诗", + legend: "传说", + + chess_shezhang: "设置路障", + chess_shezhang_info: "选择一名角色,在其四周设置临时路障,持续X回合(X为存活角色数)。", + chess_chuzhang: "清除路障", + chess_chuzhang_info: "将与你相邻的路障向后推移一格,每影响一个路障你摸一张牌。", + + _chess_chuzhang: "除障", + _chess_chuzhang_info: + "出牌阶段限一次,若你周围四格至少有三个为障碍或在边缘外,你可以选择将其中一个障碍向后推移一格(若无法推移则改为清除之)。", + + arenaAdd: "援军", + arenaAdd_info: + "出牌阶段限一次,你可以令一名未出场的已方角色加入战场。战斗结束后,该角色无论是否存活均不能再次出场。", + + pianyi: "翩仪", + pianyi_info: "结束阶段,若你于本回合内未造成过伤害,你获得一次移动机会。", + lingdong: "灵动", + lingdong_info: "结束阶段,你可以移动至多X格(X为你本回合内使用【杀】的次数)。", + lianshe: "箭舞", + lianshe_info: + "当你于一回合内首次使用【杀】时,你可以摸一张牌;你的回合内,当你使用一张不为【杀】的牌时,你令本回合内使用【杀】的次数上限+1。", + zhiming: "穿杨", + zhiming_info: "锁定技,当你使用【杀】造成伤害时,若你不在目标角色的攻击范围内,此伤害+1。", + sanjiansheji: "散箭", + sanjiansheji_info: + "你可以将两张【杀】当做【杀】使用,你以此法使用的【杀】可以指定距离5格内的角色为目标。", + guanchuan: "强弩", + guanchuan_info: "当你使用【杀】指定唯一目标后,你可令攻击射线内的其他角色也成为此【杀】的目标。", + + boss_stoneqiangzheng: "强征", + boss_stoneqiangzheng_info: "锁定技,结束阶段,你获得所有其他角色的各一张手牌。", + boss_stonebaolin: "暴凌", + boss_moyan: "魔焰", + boss_moyan_info: "锁定技,结束阶段,你对场上所有角色造成1点火焰伤害。", + + cangming: "颠动沧溟", + cangming_info: + "出牌阶段限一次,你可弃置四张花色不同的手牌并将武将牌翻至背面,然后令所有其他角色进入混乱状态直到你的下一回合开始。", + boss_bfengxing: "风行", + boss_bfengxing_info: "锁定技,摸牌阶段,你多摸两张牌;你的攻击范围+2;你回合内的移动距离+2。", + boss_chiyu: "炽羽", + boss_chiyu_info: + "出牌阶段限一次,你可以弃置一张红色牌,对距离5以内的所有其他角色各造成1点火焰伤害。", + boss_tenglong: "腾龙八齐", + boss_tenglong_info: + "锁定技,你废除你的装备区;出牌阶段限一次,你可以弃置一张装备牌并对一名距离你2以内的其他角色造成3点火焰伤害。", + boss_wushang: "神天并地", + boss_wushang_info: "锁定技,准备阶段,距离你5以内的所有其他角色需交给你一张手牌。", + boss_wuying: "无影", + boss_wuying_info: "锁定技,你回合内的移动距离-1;其他角色至你的距离+2。", + + chess_default: "常规", + chess_boss: "魔王", + chess_leader: "君主", + + mode_chess_character_config: "战棋模式", + mode_chess_card_config: "战棋模式", + }, + ui: { + placeChess: function (player, pos) { + player.dataset.position = pos; + pos = parseInt(pos); + var j = Math.floor(pos / ui.chesswidth); + var i = pos - j * ui.chesswidth; + var dx = i * 148; + var dy = j * 148; + player._chesstransform = [dx, dy]; + player.style.transform = "translate(" + dx + "px," + dy + "px)"; + }, + create: { + playergrid: function (player, x, y) { + var pos = player.getDataPos(x, y); + if (get.mode() == "tafang") { + if (pos < ui.chesswidth) return false; + if (pos / ui.chesswidth >= ui.chessheight - 1) return false; } - var node=ui.create.div('.player.minskin.playergrid',player.parentNode); - node.link=player; - ui.placeChess(node,pos); + var node = ui.create.div(".player.minskin.playergrid", player.parentNode); + node.link = player; + ui.placeChess(node, pos); return node; }, - fakeme:function(){ - if(ui.fakeme){ + fakeme: function () { + if (ui.fakeme) { ui.fakeme.delete(); } - ui.fakeme=ui.create.div('.fakeme.avatar',ui.me); - ui.fakeme.style.backgroundImage=game.me.node.avatar.style.backgroundImage; - } + ui.fakeme = ui.create.div(".fakeme.avatar", ui.me); + ui.fakeme.style.backgroundImage = game.me.node.avatar.style.backgroundImage; + }, }, - click:{ - moveContainer:function(x,y,scroll){ - if(scroll){ + click: { + moveContainer: function (x, y, scroll) { + if (scroll) { clearTimeout(ui.chessContainer._scrolling); - ui.chessContainer._scrolling=true; - ui.chess.style.transition='transform 0.5s'; + ui.chessContainer._scrolling = true; + ui.chess.style.transition = "transform 0.5s"; ui.refresh(ui.chess); - } - else if(ui.chessContainer._scrolling){ + } else if (ui.chessContainer._scrolling) { return; } - if(typeof x==='number') ui.chessContainer.chessLeft+=x; - if(typeof y==='number') ui.chessContainer.chessTop+=y; - var xmin=0; - if(lib.config.show_history=='left'){ - xmin=-50; + if (typeof x === "number") ui.chessContainer.chessLeft += x; + if (typeof y === "number") ui.chessContainer.chessTop += y; + var xmin = 0; + if (lib.config.show_history == "left") { + xmin = -50; } - if(ui.chessContainer.chessLeftxmax) ui.chessContainer.chessLeft=xmax; - if(ui.chessContainer.chessTop>ymax) ui.chessContainer.chessTop=ymax; - ui.chess.style.transform='translate('+(-ui.chessContainer.chessLeft)+'px,'+(-ui.chessContainer.chessTop)+'px)'; - if(scroll){ - var ending=ui.chess.listenTransition(function(){ - if(ui.chess._ending==ending){ + if (ui.chessContainer.chessLeft < xmin) ui.chessContainer.chessLeft = xmin; + if (ui.chessContainer.chessTop < 0) ui.chessContainer.chessTop = 0; + var xmax = ui.chessContainer.xmax; + var ymax = ui.chessContainer.ymax; + if (ui.chessContainer.chessLeft > xmax) ui.chessContainer.chessLeft = xmax; + if (ui.chessContainer.chessTop > ymax) ui.chessContainer.chessTop = ymax; + ui.chess.style.transform = + "translate(" + + -ui.chessContainer.chessLeft + + "px," + + -ui.chessContainer.chessTop + + "px)"; + if (scroll) { + var ending = ui.chess.listenTransition(function () { + if (ui.chess._ending == ending) { clearTimeout(ui.chessContainer._scrolling); delete ui.chess._ending; - ui.chess._scrolling=setTimeout(function(){ - ui.chessContainer._scrolling=null; - ui.chess.style.transition=''; - },500); + ui.chess._scrolling = setTimeout(function () { + ui.chessContainer._scrolling = null; + ui.chess.style.transition = ""; + }, 500); } }); - ui.chess._ending=ending; + ui.chess._ending = ending; } }, - chessInfo:function(e){ - if(this.link.isAlive()){ + chessInfo: function (e) { + if (this.link.isAlive()) { this.link.chessFocus(); - if(this.link.classList.contains('selectable')|| - this.link.classList.contains('selected')){ - ui.click.target.call(this.link,e); - ui.click.window.call(ui.window,e); + if ( + this.link.classList.contains("selectable") || + this.link.classList.contains("selected") + ) { + ui.click.target.call(this.link, e); + ui.click.window.call(ui.window, e); } e.stopPropagation(); } }, - playergrid:function(){ - if(!_status.paused) return; - var pos=parseInt(this.dataset.position); - this.link.moveTo(pos%ui.chesswidth,Math.floor(pos/ui.chesswidth)); - if(ui.movegrids){ - while(ui.movegrids.length){ + playergrid: function () { + if (!_status.paused) return; + var pos = parseInt(this.dataset.position); + this.link.moveTo(pos % ui.chesswidth, Math.floor(pos / ui.chesswidth)); + if (ui.movegrids) { + while (ui.movegrids.length) { ui.movegrids.shift().delete(); } } - _status.event.result={ - bool:true, - move:this.link.dataset.position + _status.event.result = { + bool: true, + move: this.link.dataset.position, }; game.resume(); }, - obstacle:function(){ - if(_status.event.chooseObstacle&&_status.paused&& - _status.event.obstacles&&_status.event.obstacles.includes(this)){ - _status.event.obstacle=this; + obstacle: function () { + if ( + _status.event.chooseObstacle && + _status.paused && + _status.event.obstacles && + _status.event.obstacles.includes(this) + ) { + _status.event.obstacle = this; game.resume(); } - } - } - }, - get:{ - chessDistance:function(from,to){ - var fxy=from.getXY(); - var txy=to.getXY(); - return Math.abs(fxy[0]-txy[0])+Math.abs(fxy[1]-txy[1]); + }, }, - rawAttitude:function(from,to){ - return (from.side===to.side?6:-6); - } }, - card:{ - chess_shezhang:{ - type:'basic', - fullskin:true, - modeimage:'chess', - enable:true, - filterTarget:function(card,player,target){ - if(target.movable(-1,0)) return true; - if(target.movable(1,0)) return true; - if(target.movable(0,-1)) return true; - if(target.movable(0,1)) return true; + get: { + chessDistance: function (from, to) { + var fxy = from.getXY(); + var txy = to.getXY(); + return Math.abs(fxy[0] - txy[0]) + Math.abs(fxy[1] - txy[1]); + }, + rawAttitude: function (from, to) { + return from.side === to.side ? 6 : -6; + }, + }, + card: { + chess_shezhang: { + type: "basic", + fullskin: true, + modeimage: "chess", + enable: true, + filterTarget: function (card, player, target) { + if (target.movable(-1, 0)) return true; + if (target.movable(1, 0)) return true; + if (target.movable(0, -1)) return true; + if (target.movable(0, 1)) return true; return false; }, - content:function(){ - var xy=target.getXY(); - var x=xy[0]; - var y=xy[1]; - if(target.movable(-1,0)){ - game.addTempObstacle(x-1,y,game.countPlayer()); + content: function () { + var xy = target.getXY(); + var x = xy[0]; + var y = xy[1]; + if (target.movable(-1, 0)) { + game.addTempObstacle(x - 1, y, game.countPlayer()); } - if(target.movable(1,0)){ - game.addTempObstacle(x+1,y,game.countPlayer()); + if (target.movable(1, 0)) { + game.addTempObstacle(x + 1, y, game.countPlayer()); } - if(target.movable(0,1)){ - game.addTempObstacle(x,y+1,game.countPlayer()); + if (target.movable(0, 1)) { + game.addTempObstacle(x, y + 1, game.countPlayer()); } - if(target.movable(0,-1)){ - game.addTempObstacle(x,y-1,game.countPlayer()); + if (target.movable(0, -1)) { + game.addTempObstacle(x, y - 1, game.countPlayer()); } }, - content_old:function(){ - 'step 0' - var pos=parseInt(player.dataset.position); - var poses=[]; - if(player.movable(-1,0)){ - poses.push(pos-1); + content_old: function () { + "step 0"; + var pos = parseInt(player.dataset.position); + var poses = []; + if (player.movable(-1, 0)) { + poses.push(pos - 1); } - if(player.movable(1,0)){ - poses.push(pos+1); + if (player.movable(1, 0)) { + poses.push(pos + 1); } - if(player.movable(0,-1)){ - poses.push(pos-ui.chesswidth); + if (player.movable(0, -1)) { + poses.push(pos - ui.chesswidth); } - if(player.movable(0,1)){ - poses.push(pos+ui.chesswidth); + if (player.movable(0, 1)) { + poses.push(pos + ui.chesswidth); } - event.poses=poses; - if(poses.length==1){ - event.obstacle=poses[0]; - event.grids=[]; - } - else if(event.isMine()){ - event.grids=player.createRangeShadow(1,function(){ - event.obstacle=this.dataset.position; + event.poses = poses; + if (poses.length == 1) { + event.obstacle = poses[0]; + event.grids = []; + } else if (event.isMine()) { + event.grids = player.createRangeShadow(1, function () { + event.obstacle = this.dataset.position; game.resume(); - }) + }); game.pause(); - _status.imchoosing=true; - for(var i=0;i对阵模式
    • n人对战n人的模式,由单人控制,开始游戏后随机分配位置与出牌顺序
    • '+ - '每人在出牌阶段有一次移动的机会,可移动的最大距离为2
    • '+ - '任何卡牌或技能无法指定位置相隔8个格以上的角色为目标
    • '+ - '杀死对方阵营的角色可摸一张牌,杀死本方阵营无惩罚
    • '+ - '若开启主将,双方各选择一名角色成为主将。主将体力上限加一,主将死亡后,若有副将,副将代替之成为主将,否则游戏结束
    • '+ - '开启无尽模式后,任何一方有角色死亡都将选择一名新角色重新加入战场,直到点击左上角的结束游戏按钮手动结束游戏。结束游戏时,杀敌更多的一方获胜
    • '+ - '行动顺序为指定时,双方无论存活角色角色多少都将轮流进行行动。在一方所有角色行动完毕进行下一轮行动时,若其人数比另一方少,另一方可指定至多X名角色名摸一张牌,X为人数之差
    • '+ - '开启战场机关后,每个回合结束时有一定机率出现一个机关,该机关不参与战斗,并有一个影响周围或全体角色的效果。机关在出现后的5~10个回合内消失
    • '+ - '开启击退效果后,当一名角色对距离两格以内的目标造成伤害后,受伤害角色将沿反方向移动一格
    • '+ - '战场上可设置出现随机路障,角色无法移动到路障处。当一名角色的周围四格有至少三格为路障或在战场外时,其可以在回合内清除一个相邻路障
    '+ - '
    君主模式
    • 收集武将进行战斗,根据战斗难度及我方出场武将的强度,战斗胜利后将获得数量不等的金钱。没有君主出场时,获得的金钱较多
    • '+ - '金钱可以用来招募随机武将,招到已有武将,或遣返不需要的武将时可得到招募令
    • '+ - '战斗中有君主出场时可招降敌将,成功率取决于敌将的稀有度、剩余体力值以及手牌数。成功后战斗立即结束且没有金钱奖励。每发动一次招降,无论成功还是失败,都会扣除10招募令
    • '+ - '挑战武将会与该武将以及与其强度相近的武将进行战斗,敌方人数与我方出场人数相同,但不少于3。胜利后可通过招募令招募该武将,普通/稀有/史诗/传说武将分别需要40/100/400/1600招募令
    • '+ - '竞技场:
      随机选择9名武将,每次派出1~3名武将参战。战斗中阵亡的武将不能再次上场。

      战斗后武将进入疲劳状态,若立即再次出场则初始体力值-1。

      战斗中本方武将行动时可召唤后援,令一名未出场的已方武将加入战斗。后援武将在战斗结束后无论存活与否均不能再次出场

      当取得12场胜利或所有武将全部阵亡后结束,并根据胜场数获得随机奖励
    • '+ - '修改金钱:
      game.changeMoney
      修改招募令:
      game.changeDust
    ' + rank: {}, + posmap: {}, + help: { + 战棋模式: + '
    对阵模式
    • n人对战n人的模式,由单人控制,开始游戏后随机分配位置与出牌顺序
    • ' + + "每人在出牌阶段有一次移动的机会,可移动的最大距离为2
    • " + + "任何卡牌或技能无法指定位置相隔8个格以上的角色为目标
    • " + + "杀死对方阵营的角色可摸一张牌,杀死本方阵营无惩罚
    • " + + "若开启主将,双方各选择一名角色成为主将。主将体力上限加一,主将死亡后,若有副将,副将代替之成为主将,否则游戏结束
    • " + + "开启无尽模式后,任何一方有角色死亡都将选择一名新角色重新加入战场,直到点击左上角的结束游戏按钮手动结束游戏。结束游戏时,杀敌更多的一方获胜
    • " + + "行动顺序为指定时,双方无论存活角色角色多少都将轮流进行行动。在一方所有角色行动完毕进行下一轮行动时,若其人数比另一方少,另一方可指定至多X名角色名摸一张牌,X为人数之差
    • " + + "开启战场机关后,每个回合结束时有一定机率出现一个机关,该机关不参与战斗,并有一个影响周围或全体角色的效果。机关在出现后的5~10个回合内消失
    • " + + "开启击退效果后,当一名角色对距离两格以内的目标造成伤害后,受伤害角色将沿反方向移动一格
    • " + + "战场上可设置出现随机路障,角色无法移动到路障处。当一名角色的周围四格有至少三格为路障或在战场外时,其可以在回合内清除一个相邻路障
    " + + '
    君主模式
    • 收集武将进行战斗,根据战斗难度及我方出场武将的强度,战斗胜利后将获得数量不等的金钱。没有君主出场时,获得的金钱较多
    • ' + + "金钱可以用来招募随机武将,招到已有武将,或遣返不需要的武将时可得到招募令
    • " + + "战斗中有君主出场时可招降敌将,成功率取决于敌将的稀有度、剩余体力值以及手牌数。成功后战斗立即结束且没有金钱奖励。每发动一次招降,无论成功还是失败,都会扣除10招募令
    • " + + "挑战武将会与该武将以及与其强度相近的武将进行战斗,敌方人数与我方出场人数相同,但不少于3。胜利后可通过招募令招募该武将,普通/稀有/史诗/传说武将分别需要40/100/400/1600招募令
    • " + + "竞技场:
      随机选择9名武将,每次派出1~3名武将参战。战斗中阵亡的武将不能再次上场。

      战斗后武将进入疲劳状态,若立即再次出场则初始体力值-1。

      战斗中本方武将行动时可召唤后援,令一名未出场的已方武将加入战斗。后援武将在战斗结束后无论存活与否均不能再次出场

      当取得12场胜利或所有武将全部阵亡后结束,并根据胜场数获得随机奖励
    • " + + "修改金钱:
      game.changeMoney
      修改招募令:
      game.changeDust
    ", }, }; }); diff --git a/mode/connect.js b/mode/connect.js index 6772b11dc..8977d7b24 100644 --- a/mode/connect.js +++ b/mode/connect.js @@ -1,182 +1,208 @@ -'use strict'; -game.import('mode',function(lib,game,ui,get,ai,_status){ - return { - name:'connect', - start:function(){ - var directstartmode=lib.config.directstartmode; - ui.create.menu(true); - event.textnode=ui.create.div('','输入联机地址'); - var createNode=function(){ - if(event.created) return; - if(directstartmode&&lib.node){ - ui.exitroom=ui.create.system('退出房间',function(){ - game.saveConfig('directstartmode'); - game.reload(); - },true); - game.switchMode(directstartmode); - return; - } - if(lib.node&&window.require){ - ui.startServer=ui.create.system('启动服务器',function(e){ - ui.click.shortcut(false); - e.stopPropagation(); - ui.click.connectMenu(); - },true); - } - - event.created=true; - var node=ui.create.div('.shadowed'); - node.style.width='400px'; - node.style.height='30px'; - node.style.lineHeight='30px'; - node.style.fontFamily='xinwei'; - node.style.fontSize='30px'; - node.style.padding='10px'; - node.style.left='calc(50% - 210px)'; - node.style.top='calc(50% - 20px)'; - node.style.whiteSpace='nowrap'; - node.textContent=lib.config.last_ip||lib.hallURL; - node.contentEditable=true; - node.style.webkitUserSelect='text'; - node.style.textAlign='center'; - node.style.overflow='hidden'; - - var connect=function(e){ - event.textnode.textContent='正在连接...'; - clearTimeout(event.timeout); - if(e) e.preventDefault(); - game.saveConfig('last_ip',node.textContent); - game.connect(node.textContent,function(success){ - if(success){ - var info=lib.config.reconnect_info; - if(info&&info[0]==_status.ip){ - game.onlineID=info[1]; - if(typeof (game.roomId=info[2])=='string') game.roomIdServer=true; - } - return; - } - if(event.textnode){ - alert('连接失败'); - event.textnode.textContent='输入联机地址'; - } - }); - }; - node.addEventListener('keydown',function(e){ - if(e.keyCode==13){ - connect(e); - } - }); - ui.window.appendChild(node); - ui.ipnode=node; - - var text=event.textnode; - text.style.width='400px'; - text.style.height='30px'; - text.style.lineHeight='30px'; - text.style.fontFamily='xinwei'; - text.style.fontSize='30px'; - text.style.padding='10px'; - text.style.left='calc(50% - 200px)'; - text.style.top='calc(50% - 80px)'; - text.style.textAlign='center'; - ui.window.appendChild(text); - ui.iptext=text; - - var button=ui.create.div('.menubutton.highlight.large.pointerdiv','连接',connect); - button.style.width='70px'; - button.style.left='calc(50% - 35px)'; - button.style.top='calc(50% + 60px)'; - ui.window.appendChild(button); - ui.ipbutton=button; - - ui.hall_button=ui.create.system('联机大厅',function(){ - node.textContent=get.config('hall_ip')||lib.hallURL; - connect(); - },true); - if(!get.config('hall_button')){ - ui.hall_button.style.display='none'; - } - ui.recentIP=ui.create.system('最近连接',null,true); - var clickLink=function(){ - node.textContent=this.textContent; - connect(); - }; - lib.setPopped(ui.recentIP,function(){ - if(!lib.config.recentIP.length) return; - var uiintro=ui.create.dialog('hidden'); - uiintro.listen(function(e){ - e.stopPropagation(); - }); - var list=ui.create.div('.caption'); - for(var i=0;i清除'); - clear.style.paddingTop=0; - clear.style.paddingBottom='3px'; - clear.listen(function(){ - lib.config.recentIP.length=0; - game.saveConfig('recentIP',[]); - uiintro.delete(); - }); - return uiintro; - },220); - if (get.config('read_clipboard','connect')){ - var ced=false; - var read=text=>{ - try{ - var text2=text.split('\n')[2]; - var ip=text2.slice(5); - if(ip.length>0&&text2.startsWith("联机地址:")&&(ced||confirm('是否根据剪贴板的邀请链接以进入联机地址和房间?'))){ - node.innerHTML=ip; - event.textnode.innerHTML='正在连接...'; - clearTimeout(event.timeout); - game.saveConfig('last_ip',node.innerHTML); - game.connect(node.innerHTML,function(success){ - if(!success&&event.textnode){ - alert('邀请链接解析失败'); - event.textnode.innerHTML='输入联机地址'; - } - if (success) _status.read_clipboard_text=text; - }); - } - }catch(e){console.log(e);} - } - window.focus(); - if (navigator.clipboard&&lib.node){ - navigator.clipboard.readText().then(read).catch(_=>{}); - }else{ - var input=ui.create.node('textarea',ui.window,{opacity:'0'}); - input.select(); - var result=document.execCommand('paste'); - input.blur(); - ui.window.removeChild(input); - if(result||input.value.length>0) read(input.value); - else if(confirm('是否输入邀请链接以进入联机地址和房间?')){ - ced=true; - var text=prompt('请输入邀请链接'); - if(typeof text=='string'&&text.length>0) read(text); - } - } - } - lib.init.onfree(); - } - if(window.isNonameServer){ - game.connect(window.isNonameServerIp||'localhost'); - } - else{ - createNode(); - } - if(!game.onlineKey){ - game.onlineKey=localStorage.getItem(lib.configprefix+'key'); - if(!game.onlineKey){ - game.onlineKey=get.id(); - localStorage.setItem(lib.configprefix+'key',game.onlineKey); - } - } - _status.connectDenied=createNode; - setTimeout(lib.init.onfree,1000); - } - }; -}); +"use strict"; +game.import("mode", function (lib, game, ui, get, ai, _status) { + return { + name: "connect", + start: function () { + var directstartmode = lib.config.directstartmode; + ui.create.menu(true); + event.textnode = ui.create.div("", "输入联机地址"); + var createNode = function () { + if (event.created) return; + if (directstartmode && lib.node) { + ui.exitroom = ui.create.system( + "退出房间", + function () { + game.saveConfig("directstartmode"); + game.reload(); + }, + true + ); + game.switchMode(directstartmode); + return; + } + if (lib.node && window.require) { + ui.startServer = ui.create.system( + "启动服务器", + function (e) { + ui.click.shortcut(false); + e.stopPropagation(); + ui.click.connectMenu(); + }, + true + ); + } + + event.created = true; + var node = ui.create.div(".shadowed"); + node.style.width = "400px"; + node.style.height = "30px"; + node.style.lineHeight = "30px"; + node.style.fontFamily = "xinwei"; + node.style.fontSize = "30px"; + node.style.padding = "10px"; + node.style.left = "calc(50% - 210px)"; + node.style.top = "calc(50% - 20px)"; + node.style.whiteSpace = "nowrap"; + node.textContent = lib.config.last_ip || lib.hallURL; + node.contentEditable = true; + node.style.webkitUserSelect = "text"; + node.style.textAlign = "center"; + node.style.overflow = "hidden"; + + var connect = function (e) { + event.textnode.textContent = "正在连接..."; + clearTimeout(event.timeout); + if (e) e.preventDefault(); + game.saveConfig("last_ip", node.textContent); + game.connect(node.textContent, function (success) { + if (success) { + var info = lib.config.reconnect_info; + if (info && info[0] == _status.ip) { + game.onlineID = info[1]; + if (typeof (game.roomId = info[2]) == "string") game.roomIdServer = true; + } + return; + } + if (event.textnode) { + alert("连接失败"); + event.textnode.textContent = "输入联机地址"; + } + }); + }; + node.addEventListener("keydown", function (e) { + if (e.keyCode == 13) { + connect(e); + } + }); + ui.window.appendChild(node); + ui.ipnode = node; + + var text = event.textnode; + text.style.width = "400px"; + text.style.height = "30px"; + text.style.lineHeight = "30px"; + text.style.fontFamily = "xinwei"; + text.style.fontSize = "30px"; + text.style.padding = "10px"; + text.style.left = "calc(50% - 200px)"; + text.style.top = "calc(50% - 80px)"; + text.style.textAlign = "center"; + ui.window.appendChild(text); + ui.iptext = text; + + var button = ui.create.div(".menubutton.highlight.large.pointerdiv", "连接", connect); + button.style.width = "70px"; + button.style.left = "calc(50% - 35px)"; + button.style.top = "calc(50% + 60px)"; + ui.window.appendChild(button); + ui.ipbutton = button; + + ui.hall_button = ui.create.system( + "联机大厅", + function () { + node.textContent = get.config("hall_ip") || lib.hallURL; + connect(); + }, + true + ); + if (!get.config("hall_button")) { + ui.hall_button.style.display = "none"; + } + ui.recentIP = ui.create.system("最近连接", null, true); + var clickLink = function () { + node.textContent = this.textContent; + connect(); + }; + lib.setPopped( + ui.recentIP, + function () { + if (!lib.config.recentIP.length) return; + var uiintro = ui.create.dialog("hidden"); + uiintro.listen(function (e) { + e.stopPropagation(); + }); + var list = ui.create.div(".caption"); + for (var i = 0; i < lib.config.recentIP.length; i++) { + ui.create.div(".text.textlink", list, clickLink).textContent = get.trimip( + lib.config.recentIP[i] + ); + } + uiintro.add(list); + var clear = uiintro.add('
    清除
    '); + clear.style.paddingTop = 0; + clear.style.paddingBottom = "3px"; + clear.listen(function () { + lib.config.recentIP.length = 0; + game.saveConfig("recentIP", []); + uiintro.delete(); + }); + return uiintro; + }, + 220 + ); + if (get.config("read_clipboard", "connect")) { + var ced = false; + var read = (text) => { + try { + var text2 = text.split("\n")[2]; + var ip = text2.slice(5); + if ( + ip.length > 0 && + text2.startsWith("联机地址:") && + (ced || confirm("是否根据剪贴板的邀请链接以进入联机地址和房间?")) + ) { + node.innerHTML = ip; + event.textnode.innerHTML = "正在连接..."; + clearTimeout(event.timeout); + game.saveConfig("last_ip", node.innerHTML); + game.connect(node.innerHTML, function (success) { + if (!success && event.textnode) { + alert("邀请链接解析失败"); + event.textnode.innerHTML = "输入联机地址"; + } + if (success) _status.read_clipboard_text = text; + }); + } + } catch (e) { + console.log(e); + } + }; + window.focus(); + if (navigator.clipboard && lib.node) { + navigator.clipboard + .readText() + .then(read) + .catch((_) => {}); + } else { + var input = ui.create.node("textarea", ui.window, { opacity: "0" }); + input.select(); + var result = document.execCommand("paste"); + input.blur(); + ui.window.removeChild(input); + if (result || input.value.length > 0) read(input.value); + else if (confirm("是否输入邀请链接以进入联机地址和房间?")) { + ced = true; + var text = prompt("请输入邀请链接"); + if (typeof text == "string" && text.length > 0) read(text); + } + } + } + lib.init.onfree(); + }; + if (window.isNonameServer) { + game.connect(window.isNonameServerIp || "localhost"); + } else { + createNode(); + } + if (!game.onlineKey) { + game.onlineKey = localStorage.getItem(lib.configprefix + "key"); + if (!game.onlineKey) { + game.onlineKey = get.id(); + localStorage.setItem(lib.configprefix + "key", game.onlineKey); + } + } + _status.connectDenied = createNode; + setTimeout(lib.init.onfree, 1000); + }, + }; +}); diff --git a/mode/doudizhu.js b/mode/doudizhu.js index b24ea7ad8..9acb775e0 100644 --- a/mode/doudizhu.js +++ b/mode/doudizhu.js @@ -1,3154 +1,3797 @@ -'use strict'; -game.import('mode',function(lib,game,ui,get,ai,_status){ +"use strict"; +game.import("mode", function (lib, game, ui, get, ai, _status) { return { - name:'doudizhu', - start:function(){ - "step 0" - var playback=localStorage.getItem(lib.configprefix+'playback'); - if(playback){ + name: "doudizhu", + start: function () { + "step 0"; + var playback = localStorage.getItem(lib.configprefix + "playback"); + if (playback) { ui.create.me(); - ui.arena.style.display='none'; - ui.system.style.display='none'; - _status.playback=playback; - localStorage.removeItem(lib.configprefix+'playback'); - var store=lib.db.transaction(['video'],'readwrite').objectStore('video'); - store.get(parseInt(playback)).onsuccess=function(e){ - if(e.target.result){ + ui.arena.style.display = "none"; + ui.system.style.display = "none"; + _status.playback = playback; + localStorage.removeItem(lib.configprefix + "playback"); + var store = lib.db.transaction(["video"], "readwrite").objectStore("video"); + store.get(parseInt(playback)).onsuccess = function (e) { + if (e.target.result) { game.playVideoContent(e.target.result.video); - } - else{ - alert('播放失败:找不到录像'); + } else { + alert("播放失败:找不到录像"); game.reload(); } - } + }; event.finish(); - } - else if(!_status.connectMode){ + } else if (!_status.connectMode) { game.prepareArena(3); } - "step 1" - event.replacePile=function(){ - var map={ - shuiyanqijunx:'shuiyanqijuny', - bingliang:'binglinchengxia', - fangtian:'toushiche', - wutiesuolian:'toushiche', + "step 1"; + event.replacePile = function () { + var map = { + shuiyanqijunx: "shuiyanqijuny", + bingliang: "binglinchengxia", + fangtian: "toushiche", + wutiesuolian: "toushiche", }; - for(var i=0;i3) num++; - if(lib.character[player.name2]&&get.infoHp(lib.character[player.name2][2])>3) num++; + var next = game.gameDraw(game.zhu || _status.firstAct || game.me); + if (_status.mode == "online") { + game.zhu.$equip(game.createCard("diqi", "club", 13)); + next.num = function (player) { + var num = 4; + if (player == game.zhu) { + if (lib.character[player.name1] && get.infoHp(lib.character[player.name1][2]) > 3) + num++; + if (lib.character[player.name2] && get.infoHp(lib.character[player.name2][2]) > 3) + num++; } return num; }; - } - else if(_status.mode=='binglin'){ - next.num=function(player){ - return (player==game.zhu?5:4); + } else if (_status.mode == "binglin") { + next.num = function (player) { + return player == game.zhu ? 5 : 4; }; } - if(_status.mode!='online'&&_status.connectMode&&lib.configOL.change_card) game.replaceHandcards(game.players.slice(0)); - game.phaseLoop(game.zhu||_status.firstAct||game.me); + if (_status.mode != "online" && _status.connectMode && lib.configOL.change_card) + game.replaceHandcards(game.players.slice(0)); + game.phaseLoop(game.zhu || _status.firstAct || game.me); game.zhu.showGiveup(); }, - game:{ - canReplaceViewpoint:()=>true, - recommendDizhu:[ - 're_guojia','re_huanggai','re_lvbu','re_guanyu','re_sunquan','re_xusheng','re_wuyi','re_sunben', - 'xuyou','zhangchunhua','caochong','zhangsong','zhongyao','wangyi', - 'caochun','maliang','sp_diaochan','quyi','sp_zhaoyun','shamoke', - 'lijue','liuzan','wenyang','shen_lvmeng','shen_ganning', - 'jiakui','wangyuanji','lingcao','miheng', - 'sp_key_yuri','key_hinata','key_rin','key_kyousuke', - 'ns_chendao','jiakui','haozhao', + game: { + canReplaceViewpoint: () => true, + recommendDizhu: [ + "re_guojia", + "re_huanggai", + "re_lvbu", + "re_guanyu", + "re_sunquan", + "re_xusheng", + "re_wuyi", + "re_sunben", + "xuyou", + "zhangchunhua", + "caochong", + "zhangsong", + "zhongyao", + "wangyi", + "caochun", + "maliang", + "sp_diaochan", + "quyi", + "sp_zhaoyun", + "shamoke", + "lijue", + "liuzan", + "wenyang", + "shen_lvmeng", + "shen_ganning", + "jiakui", + "wangyuanji", + "lingcao", + "miheng", + "sp_key_yuri", + "key_hinata", + "key_rin", + "key_kyousuke", + "ns_chendao", + "jiakui", + "haozhao", ], - addRecord:function(bool){ - if(typeof bool=='boolean'){ - var data=lib.config.gameRecord.doudizhu.data; - var identity=game.me.identity; - if(!data[identity]){ - data[identity]=[0,0]; + addRecord: function (bool) { + if (typeof bool == "boolean") { + var data = lib.config.gameRecord.doudizhu.data; + var identity = game.me.identity; + if (!data[identity]) { + data[identity] = [0, 0]; } - if(bool){ + if (bool) { data[identity][0]++; - } - else{ + } else { data[identity][1]++; } - var list=['zhu','fan']; - var str=''; - for(var i=0;i'; + var list = ["zhu", "fan"]; + var str = ""; + for (var i = 0; i < list.length; i++) { + if (data[list[i]]) { + str += + lib.translate[list[i] + "2"] + + ":" + + data[list[i]][0] + + "胜" + + " " + + data[list[i]][1] + + "负
    "; } } - lib.config.gameRecord.doudizhu.str=str; - game.saveConfig('gameRecord',lib.config.gameRecord); + lib.config.gameRecord.doudizhu.str = str; + game.saveConfig("gameRecord", lib.config.gameRecord); } }, - getState:function(){ - var state={}; - for(var i in lib.playerOL){ - var player=lib.playerOL[i]; - state[i]={identity:player.identity}; + getState: function () { + var state = {}; + for (var i in lib.playerOL) { + var player = lib.playerOL[i]; + state[i] = { identity: player.identity }; } return state; }, - updateState:function(state){ - for(var i in state){ - var player=lib.playerOL[i]; - if(player){ - player.identity=state[i].identity; + updateState: function (state) { + for (var i in state) { + var player = lib.playerOL[i]; + if (player) { + player.identity = state[i].identity; } } }, - updateRoundNumber:function(){ - if(_status.mode=='online'){ - game.broadcastAll(function(num1,num2,top,bonusNum){ - if(ui.cardPileNumber){ - var str=num1+'轮 公共牌堆: '+num2; - if(game.me&&game.me.storage.doudizhu_cardPile&&game.me.storage.doudizhu_cardPile.length) str+=(' 个人牌堆: '+game.me.storage.doudizhu_cardPile.length); - if(bonusNum) str+=('
    本场叫价: '+bonusNum*100); - ui.cardPileNumber.innerHTML=str; - } - _status.pileTop=top; - },game.roundNumber,ui.cardPile.childNodes.length,ui.cardPile.firstChild,game.bonusNum); + updateRoundNumber: function () { + if (_status.mode == "online") { + game.broadcastAll( + function (num1, num2, top, bonusNum) { + if (ui.cardPileNumber) { + var str = num1 + "轮 公共牌堆: " + num2; + if ( + game.me && + game.me.storage.doudizhu_cardPile && + game.me.storage.doudizhu_cardPile.length + ) + str += " 个人牌堆: " + game.me.storage.doudizhu_cardPile.length; + if (bonusNum) str += "
    本场叫价: " + bonusNum * 100; + ui.cardPileNumber.innerHTML = str; + } + _status.pileTop = top; + }, + game.roundNumber, + ui.cardPile.childNodes.length, + ui.cardPile.firstChild, + game.bonusNum + ); return; } - game.broadcastAll(function(num1,num2,top){ - if(ui.cardPileNumber) ui.cardPileNumber.innerHTML=num1+'轮 剩余牌: '+num2; - _status.pileTop=top; - },game.roundNumber,ui.cardPile.childNodes.length,ui.cardPile.firstChild); + game.broadcastAll( + function (num1, num2, top) { + if (ui.cardPileNumber) ui.cardPileNumber.innerHTML = num1 + "轮 剩余牌: " + num2; + _status.pileTop = top; + }, + game.roundNumber, + ui.cardPile.childNodes.length, + ui.cardPile.firstChild + ); }, - getRoomInfo:function(uiintro){ - uiintro.add('
    双将模式:'+(lib.configOL.double_character?'开启':'关闭')); + getRoomInfo: function (uiintro) { + uiintro.add( + '
    双将模式:' + (lib.configOL.double_character ? "开启" : "关闭") + ); // uiintro.add('
    屏蔽弱将:'+(lib.configOL.ban_weak?'开启':'关闭')); // var last=uiintro.add('
    屏蔽强将:'+(lib.configOL.ban_strong?'开启':'关闭')); - if(lib.configOL.banned.length){ - uiintro.add('
    禁用武将:'+get.translation(lib.configOL.banned)); + if (lib.configOL.banned.length) { + uiintro.add('
    禁用武将:' + get.translation(lib.configOL.banned)); } - if(lib.configOL.bannedcards.length){ - uiintro.add('
    禁用卡牌:'+get.translation(lib.configOL.bannedcards)); + if (lib.configOL.bannedcards.length) { + uiintro.add( + '
    禁用卡牌:' + get.translation(lib.configOL.bannedcards) + ); } - uiintro.style.paddingBottom='8px'; + uiintro.style.paddingBottom = "8px"; }, - getVideoName:function(){ - var str=get.translation(game.me.name); - if(game.me.name2){ - str+='/'+get.translation(game.me.name2); + getVideoName: function () { + var str = get.translation(game.me.name); + if (game.me.name2) { + str += "/" + get.translation(game.me.name2); } var namex; - switch(_status.mode){ - case 'normal':namex='休闲斗地主';break; - case 'kaihei':namex='开黑斗地主';break; - case 'huanle':namex='欢乐斗地主';break; - case 'binglin':namex='兵临城下';break; - case 'online':namex='智斗三国';break; + switch (_status.mode) { + case "normal": + namex = "休闲斗地主"; + break; + case "kaihei": + namex = "开黑斗地主"; + break; + case "huanle": + namex = "欢乐斗地主"; + break; + case "binglin": + namex = "兵临城下"; + break; + case "online": + namex = "智斗三国"; + break; } - var name=[ - str, - namex+' - '+lib.translate[game.me.identity+'2'] - ]; + var name = [str, namex + " - " + lib.translate[game.me.identity + "2"]]; return name; }, - showIdentity:function(me){ - for(var i=0;i1) return; - if(me==game.zhu){ + checkResult: function () { + var me = game.me._trueMe || game.me; + if (game.zhu.isAlive()) { + if ( + _status.mode != "online" && + (_status.mode != "binglin" || game.roundNumber < 3) && + game.players.length > 1 + ) + return; + if (me == game.zhu) { game.over(true); - } - else{ + } else { game.over(false); } - } - else { - if(me==game.zhu){ + } else { + if (me == game.zhu) { game.over(false); - } - else{ + } else { game.over(true); } } }, - checkOnlineResult:function(player){ - if(game.zhu.isAlive()){ - return player.identity=='zhu'; - } - else return player.identity=='fan'; + checkOnlineResult: function (player) { + if (game.zhu.isAlive()) { + return player.identity == "zhu"; + } else return player.identity == "fan"; }, - chooseCharacterZhidou:function(){ - var next=game.createEvent('chooseCharacter'); - next.setContent(function(){ - "step 0" - game.no_continue_game=true; + chooseCharacterZhidou: function () { + var next = game.createEvent("chooseCharacter"); + next.setContent(function () { + "step 0"; + game.no_continue_game = true; lib.init.onfree(); - "step 1" - ui.arena.classList.add('choose-character'); + "step 1"; + ui.arena.classList.add("choose-character"); var i; - var groups=[]; - event.list=[]; - event.map={}; - var chara=(get.config('character_online')||lib.characterOnline); - for(i in chara){ - var list=chara[i]; - for(var j=0;j=3){ + if (list.length >= 3) { groups.push(i); event.list.addArray(list); } } event.list.randomSort(); - _status.characterlist=event.list.slice(0); - event.controls=['不叫地主','一倍','两倍','三倍']; - for(var player of game.players){ - var id=player.playerid; - player._group=groups.randomRemove(1)[0]; - event.map[id]=chara[player._group].randomGets(4); - player.storage.doudizhu_cardPile=get.cards(20).sort(function(a,b){ - if(a.name!=b.name) return lib.sort.card(a.name,b.name); - else if(a.suit!=b.suit) return lib.suit.indexOf(a)-lib.suit.indexOf(b); - else return a.number-b.number; + _status.characterlist = event.list.slice(0); + event.controls = ["不叫地主", "一倍", "两倍", "三倍"]; + for (var player of game.players) { + var id = player.playerid; + player._group = groups.randomRemove(1)[0]; + event.map[id] = chara[player._group].randomGets(4); + player.storage.doudizhu_cardPile = get.cards(20).sort(function (a, b) { + if (a.name != b.name) return lib.sort.card(a.name, b.name); + else if (a.suit != b.suit) return lib.suit.indexOf(a) - lib.suit.indexOf(b); + else return a.number - b.number; }); } - event.dialog=ui.create.dialog('你的选将框与底牌',[event.map[game.me.playerid],'character'],game.me.storage.doudizhu_cardPile); - event.start=game.players.randomGet(); - event.current=event.start; + event.dialog = ui.create.dialog( + "你的选将框与底牌", + [event.map[game.me.playerid], "character"], + game.me.storage.doudizhu_cardPile + ); + event.start = game.players.randomGet(); + event.current = event.start; game.delay(7); - "step 2" - event.current.classList.add('glow_phase'); - if(event.current==game.me) event.dialog.content.firstChild.innerHTML='是否叫地主?'; - else{ - event.dialog.content.firstChild.innerHTML='请等待其他玩家叫地主'; + "step 2"; + event.current.classList.add("glow_phase"); + if (event.current == game.me) event.dialog.content.firstChild.innerHTML = "是否叫地主?"; + else { + event.dialog.content.firstChild.innerHTML = "请等待其他玩家叫地主"; game.delay(2); } - event.current.chooseControl(event.controls).set('ai',function(){ + event.current.chooseControl(event.controls).set("ai", function () { return _status.event.getParent().controls.randomGet(); }); - "step 3" - event.current.classList.remove('glow_phase'); - event.current._control=result.control; + "step 3"; + event.current.classList.remove("glow_phase"); + event.current._control = result.control; event.current.chat(result.control); - if(result.control=='三倍'){ - game.bonusNum=3; - game.zhu=event.current; + if (result.control == "三倍") { + game.bonusNum = 3; + game.zhu = event.current; return; + } else if (result.control != "不叫地主") { + event.controls.splice(1, event.controls.indexOf(result.control)); + event.tempDizhu = event.current; + if (result.control == "二倍") game.bonusNum = 2; } - else if(result.control!='不叫地主'){ - event.controls.splice(1,event.controls.indexOf(result.control)); - event.tempDizhu=event.current; - if(result.control=='二倍') game.bonusNum=2; - } - event.current=event.current.next; - if(event.current==event.start&&(event.start==event.tempDizhu||event.start._control=='不叫地主')){ - game.zhu=event.tempDizhu||event.start.previous; - } - else if(event.current==event.start.next&&event.current._control){ - game.zhu=event.tempDizhu; - } - else event.goto(2); - if(event.current==event.start.previous&&!event.tempDizhu) event.controls.remove('不叫地主'); - "step 4" + event.current = event.current.next; + if ( + event.current == event.start && + (event.start == event.tempDizhu || event.start._control == "不叫地主") + ) { + game.zhu = event.tempDizhu || event.start.previous; + } else if (event.current == event.start.next && event.current._control) { + game.zhu = event.tempDizhu; + } else event.goto(2); + if (event.current == event.start.previous && !event.tempDizhu) + event.controls.remove("不叫地主"); + "step 4"; game.updateRoundNumber(); - for(var player of game.players){ - player.identity=player==game.zhu?'zhu':'fan'; + for (var player of game.players) { + player.identity = player == game.zhu ? "zhu" : "fan"; player.showIdentity(); } - event.dialog.content.firstChild.innerHTML='请选择'+get.cnNumber(game.me==game.zhu?2:1)+'张武将牌'; - game.me.chooseButton(event.dialog,true,game.me==game.zhu?2:1).set('filterButton',function(button){ - return typeof button.link=='string'; - }); - "step 5" - game.me.init(result.links[0],result.links[1]); - for(var player of game.players){ - if(player!=game.me){ - if(player==game.zhu){ - var list=event.map[player.playerid].randomGets(2); - player.init(list[0],list[1]); - } - else player.init(event.map[player.playerid].randomGet()); + event.dialog.content.firstChild.innerHTML = + "请选择" + get.cnNumber(game.me == game.zhu ? 2 : 1) + "张武将牌"; + game.me + .chooseButton(event.dialog, true, game.me == game.zhu ? 2 : 1) + .set("filterButton", function (button) { + return typeof button.link == "string"; + }); + "step 5"; + game.me.init(result.links[0], result.links[1]); + for (var player of game.players) { + if (player != game.me) { + if (player == game.zhu) { + var list = event.map[player.playerid].randomGets(2); + player.init(list[0], list[1]); + } else player.init(event.map[player.playerid].randomGet()); } - player.markSkill('doudizhu_cardPile'); + player.markSkill("doudizhu_cardPile"); } - game.zhu.hp=4; - game.zhu.maxHp=4; + game.zhu.hp = 4; + game.zhu.maxHp = 4; game.zhu.update(); - for(var i=0;i队友的选将框
    '); - list.push([event.map[friend.playerid],'character']); + list.push([event.map[friend.playerid], "character"]); } - game.me.chooseButton(list,true).set('list',event.map[game.me.playerid]).set('filterButton',function(button){ - return _status.event.list.includes(button.link); - }); - "step 6" + game.me + .chooseButton(list, true) + .set("list", event.map[game.me.playerid]) + .set("filterButton", function (button) { + return _status.event.list.includes(button.link); + }); + "step 6"; game.me.init(result.links[0]); - for(var player of game.players){ - if(player!=game.me) player.init(event.map[player.playerid].randomGet()); - if(player==game.zhu){ + for (var player of game.players) { + if (player != game.me) player.init(event.map[player.playerid].randomGet()); + if (player == game.zhu) { player.addSkill(game.zhuSkill); - } - else player.addSkill('binglin_neihong'); + } else player.addSkill("binglin_neihong"); } - if(!game.zhu.isInitFilter('noZhuHp')){ + if (!game.zhu.isInitFilter("noZhuHp")) { game.zhu.maxHp++; game.zhu.hp++; game.zhu.update(); } - for(var i=0;i0.5?'不叫':'叫地主'; + "step 1"; + event.current.chooseControl(event.controls).set("ai", function () { + return Math.random() > 0.5 ? "不叫" : "叫地主"; }); - if(event.current==game.me){ - event.dialog.content.childNodes[0].innerHTML='是否抢地主?'; + if (event.current == game.me) { + event.dialog.content.childNodes[0].innerHTML = "是否抢地主?"; } - "step 2" + "step 2"; event.current.chat(result.control); - if(result.control=='叫地主'||event.current==event.start.next){ - game.zhu=result.control=='叫地主'?event.current:event.current.next; - for(var player of game.players){ - player.identity=player==game.zhu?'zhu':'fan'; + if (result.control == "叫地主" || event.current == event.start.next) { + game.zhu = result.control == "叫地主" ? event.current : event.current.next; + for (var player of game.players) { + player.identity = player == game.zhu ? "zhu" : "fan"; player.showIdentity(); } event.dialog.close(); event.map[game.zhu.playerid].addArray(event.list.randomRemove(3)); - } - else{ - event.current=event.current.next; + } else { + event.current = event.current.next; event.goto(1); game.delay(1.5); } - "step 3" - game.me.chooseButton(['请选择你的武将',[event.map[game.me.playerid],'character']],true); - "step 4" + "step 3"; + game.me.chooseButton( + ["请选择你的武将", [event.map[game.me.playerid], "character"]], + true + ); + "step 4"; game.me.init(result.links[0]); - for(var player of game.players){ - if(player!=game.me) player.init(event.map[player.playerid].randomGet()); + for (var player of game.players) { + if (player != game.me) player.init(event.map[player.playerid].randomGet()); } - if(!game.zhu.isInitFilter('noZhuHp')){ + if (!game.zhu.isInitFilter("noZhuHp")) { game.zhu.maxHp++; game.zhu.hp++; game.zhu.update(); } - for(var i=0;i'; - td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){ - if(_status.dragged) return; - if(_status.justdragged) return; - _status.tempNoButton=true; - setTimeout(function(){ - _status.tempNoButton=false; - },500); - var link=this.link; - if(game.zhu.name){ - if(link!='random'){ - _status.event.parent.fixedseat=get.distance(game.me,game.zhu,'absolute'); + td.innerHTML = "" + get.translation(listi[i] + "2") + ""; + td.addEventListener(lib.config.touchscreen ? "touchend" : "click", function () { + if (_status.dragged) return; + if (_status.justdragged) return; + _status.tempNoButton = true; + setTimeout(function () { + _status.tempNoButton = false; + }, 500); + var link = this.link; + if (game.zhu.name) { + if (link != "random") { + _status.event.parent.fixedseat = get.distance( + game.me, + game.zhu, + "absolute" + ); } game.zhu.uninit(); delete game.zhu.isZhu; delete game.zhu.identityShown; } - var current=this.parentNode.querySelector('.bluebg'); - if(current){ - current.classList.remove('bluebg'); + var current = this.parentNode.querySelector(".bluebg"); + if (current) { + current.classList.remove("bluebg"); } - current=seats.querySelector('.bluebg'); - if(current){ - current.classList.remove('bluebg'); + current = seats.querySelector(".bluebg"); + if (current) { + current.classList.remove("bluebg"); } - if(link=='random'){ - link=['zhu','fan'].randomGet(); - for(var i=0;i0.5?'不叫':'叫地主'; + _status.characterlist = event.list.slice(0); + event.videoId = lib.status.videoId++; + game.broadcastAll( + function (map, id) { + ui.create.dialog("你的选将框", [map[game.me.playerid], "character"]).videoId = id; + }, + event.map, + event.videoId + ); + event.start = game.players.randomGet(); + event.current = event.start; + if (event.current != game.me || !event.current.isOnline()) game.delay(3); + "step 1"; + event.current.chooseControl(event.controls).set("ai", function () { + return Math.random() > 0.5 ? "不叫" : "叫地主"; }); - "step 2" + "step 2"; event.current.chat(result.control); - if(result.control=='叫地主'||event.current==event.start.next){ - game.zhu=result.control=='叫地主'?event.current:event.current.next; - for(var player of game.players){ - player.identity=player==game.zhu?'zhu':'fan'; + if (result.control == "叫地主" || event.current == event.start.next) { + game.zhu = result.control == "叫地主" ? event.current : event.current.next; + for (var player of game.players) { + player.identity = player == game.zhu ? "zhu" : "fan"; player.showIdentity(); - player.identityShown=true; + player.identityShown = true; } - game.broadcastAll('closeDialog',event.videoId) + game.broadcastAll("closeDialog", event.videoId); event.map[game.zhu.playerid].addArray(event.list.randomRemove(3)); - } - else{ - event.current=event.current.next; + } else { + event.current = event.current.next; event.goto(1); } - "step 3" - var list=[]; - var str='选择角色'; - for(var i=0;i队友的选将框
    '); - dialog.push([event.map[friend.playerid],'character']); + dialog.push([event.map[friend.playerid], "character"]); } - list.push([game.players[i],dialog,true,function(){return Math.random()},function(button){ - return _status.event.player._characterChoice.includes(button.link); - }]); + list.push([ + game.players[i], + dialog, + true, + function () { + return Math.random(); + }, + function (button) { + return _status.event.player._characterChoice.includes(button.link); + }, + ]); } - game.me.chooseButtonOL(list,function(player,result){ - if(game.online||player==game.me) player.init(result.links[0]); + game.me.chooseButtonOL(list, function (player, result) { + if (game.online || player == game.me) player.init(result.links[0]); }); - "step 4" - for(var i in lib.playerOL){ - if(!result[i]||result[i]=='ai'||!result[i].links||!result[i].links.length){ - result[i]=event.map[i].randomGet(); + "step 4"; + for (var i in lib.playerOL) { + if (!result[i] || result[i] == "ai" || !result[i].links || !result[i].links.length) { + result[i] = event.map[i].randomGet(); + } else { + result[i] = result[i].links[0]; } - else{ - result[i]=result[i].links[0]; - } - if(!lib.playerOL[i].name){ + if (!lib.playerOL[i].name) { lib.playerOL[i].init(result[i]); } } - if(!game.zhu.isInitFilter('noZhuHp')){ + if (!game.zhu.isInitFilter("noZhuHp")) { game.zhu.maxHp++; game.zhu.hp++; game.zhu.update(); } - game.broadcast(function(result,zhu){ - for(var i in result){ - if(!lib.playerOL[i].name){ - lib.playerOL[i].init(result[i]); + game.broadcast( + function (result, zhu) { + for (var i in result) { + if (!lib.playerOL[i].name) { + lib.playerOL[i].init(result[i]); + } + } + game.zhu = zhu; + if (!game.zhu.isInitFilter("noZhuHp")) { + game.zhu.maxHp++; + game.zhu.hp++; + game.zhu.update(); } - } - game.zhu=zhu; - if(!game.zhu.isInitFilter('noZhuHp')){ - game.zhu.maxHp++; - game.zhu.hp++; - game.zhu.update(); - } - setTimeout(function(){ - ui.arena.classList.remove('choose-character'); - },500); - },result,game.zhu); - for(var player of game.players){ - if(player==game.zhu){ + setTimeout(function () { + ui.arena.classList.remove("choose-character"); + }, 500); + }, + result, + game.zhu + ); + for (var player of game.players) { + if (player == game.zhu) { player.addSkill(game.zhuSkill); - } - else player.addSkill(['binglin_shaxue','binglin_neihong']); + } else player.addSkill(["binglin_shaxue", "binglin_neihong"]); } - for(var i=0;i=3){ + if (list.length >= 3) { groups.push(i); event.list.addArray(list); } } event.list.randomSort(); - _status.characterlist=event.list.slice(0); - event.controls=['不叫地主','一倍','两倍','三倍']; - for(var player of game.players){ - var id=player.playerid; - player._group=groups.randomRemove(1)[0]; - event.map[id]=chara[player._group].randomGets(3); - player.storage.doudizhu_cardPile=get.cards(20).sort(function(a,b){ - if(a.name!=b.name) return lib.sort.card(a.name,b.name); - else if(a.suit!=b.suit) return lib.suit.indexOf(a)-lib.suit.indexOf(b); - else return a.number-b.number; + _status.characterlist = event.list.slice(0); + event.controls = ["不叫地主", "一倍", "两倍", "三倍"]; + for (var player of game.players) { + var id = player.playerid; + player._group = groups.randomRemove(1)[0]; + event.map[id] = chara[player._group].randomGets(3); + player.storage.doudizhu_cardPile = get.cards(20).sort(function (a, b) { + if (a.name != b.name) return lib.sort.card(a.name, b.name); + else if (a.suit != b.suit) return lib.suit.indexOf(a) - lib.suit.indexOf(b); + else return a.number - b.number; }); - player.markSkill('doudizhu_cardPile'); + player.markSkill("doudizhu_cardPile"); } - event.start=game.players.randomGet(); - event.current=event.start; + event.start = game.players.randomGet(); + event.current = event.start; - event.videoId=lib.status.videoId++; - game.broadcastAll(function(map,id){ - ui.create.dialog('你的选将框和底牌',[map[game.me.playerid],'character'],game.me.storage.doudizhu_cardPile).videoId=id; - },event.map,event.videoId); + event.videoId = lib.status.videoId++; + game.broadcastAll( + function (map, id) { + ui.create.dialog( + "你的选将框和底牌", + [map[game.me.playerid], "character"], + game.me.storage.doudizhu_cardPile + ).videoId = id; + }, + event.map, + event.videoId + ); game.delay(4); - "step 1" - game.broadcastAll(function(id,current){ - var dialog=get.idDialog(id); - if(dialog){ - if(game.me==current) dialog.content.firstChild.innerHTML='是否叫地主?'; - else dialog.content.firstChild.innerHTML='请等待其他玩家叫地主'; - } - },event.videoId,event.current); - if(event.current!=game.me&&!event.current.isOnline()) game.delay(2); - event.current.chooseControl(event.controls).set('ai',function(){ + "step 1"; + game.broadcastAll( + function (id, current) { + var dialog = get.idDialog(id); + if (dialog) { + if (game.me == current) dialog.content.firstChild.innerHTML = "是否叫地主?"; + else dialog.content.firstChild.innerHTML = "请等待其他玩家叫地主"; + } + }, + event.videoId, + event.current + ); + if (event.current != game.me && !event.current.isOnline()) game.delay(2); + event.current.chooseControl(event.controls).set("ai", function () { return _status.event.getParent().controls.randomGet(); }); - "step 2" - event.current._control=result.control; + "step 2"; + event.current._control = result.control; event.current.chat(result.control); - if(result.control=='三倍'){ - game.bonusNum=3; - game.zhu=event.current; + if (result.control == "三倍") { + game.bonusNum = 3; + game.zhu = event.current; return; + } else if (result.control != "不叫地主") { + event.controls.splice(1, event.controls.indexOf(result.control)); + event.tempDizhu = event.current; + if (result.control == "二倍") game.bonusNum = 2; } - else if(result.control!='不叫地主'){ - event.controls.splice(1,event.controls.indexOf(result.control)); - event.tempDizhu=event.current; - if(result.control=='二倍') game.bonusNum=2; - } - event.current=event.current.next; - if(event.current==event.start&&(event.start==event.tempDizhu||event.start._control=='不叫地主')){ - game.zhu=event.tempDizhu||event.start.previous; - } - else if(event.current==event.start.next&&event.current._control){ - game.zhu=event.tempDizhu; - } - else event.goto(1); - if(event.current==event.start.previous&&!event.tempDizhu) event.controls.remove('不叫地主'); - "step 3" - for(var player of game.players){ - player.identity=player==game.zhu?'zhu':'fan'; + event.current = event.current.next; + if ( + event.current == event.start && + (event.start == event.tempDizhu || event.start._control == "不叫地主") + ) { + game.zhu = event.tempDizhu || event.start.previous; + } else if (event.current == event.start.next && event.current._control) { + game.zhu = event.tempDizhu; + } else event.goto(1); + if (event.current == event.start.previous && !event.tempDizhu) + event.controls.remove("不叫地主"); + "step 3"; + for (var player of game.players) { + player.identity = player == game.zhu ? "zhu" : "fan"; player.showIdentity(); - player.identityShown=true; + player.identityShown = true; } - game.broadcastAll('closeDialog',event.videoId); - var list=[]; - for(var i=0;i5){ - num=5; + var num, + num2 = 0; + num = Math.floor(event.list.length / game.players.length); + num2 = event.list.length - num * game.players.length; + if (num > 5) { + num = 5; } - if(num2>2){ - num2=2; + if (num2 > 2) { + num2 = 2; } - for(var i=0;i14; + skill: { + binglin_bingjin: { + trigger: { player: "phaseEnd" }, + forced: true, + ruleSkill: true, + filter: function (event, player) { + return _status.mode == "binglin" && game.roundNumber > 14; }, - content:function(){ + content: function () { player.loseHp(); }, }, - zhuSkill_xiangyang:{ - trigger:{player:'phaseEnd'}, - charlotte:true, - direct:true, - content:function(){ - 'step 0' - player.chooseControl('摸牌阶段','出牌阶段','cancel2').set('prompt','襄阳:是否执行一个额外的阶段?'); - 'step 1' - if(result.control!='cancel2'){ + zhuSkill_xiangyang: { + trigger: { player: "phaseEnd" }, + charlotte: true, + direct: true, + content: function () { + "step 0"; + player + .chooseControl("摸牌阶段", "出牌阶段", "cancel2") + .set("prompt", "襄阳:是否执行一个额外的阶段?"); + "step 1"; + if (result.control != "cancel2") { player.logSkill(event.name); - var next=player[result.index?'phaseUse':'phaseDraw'](); + var next = player[result.index ? "phaseUse" : "phaseDraw"](); event.next.remove(next); trigger.next.push(next); } }, }, - zhuSkill_jiangling:{ - trigger:{player:'phaseUseBegin'}, - direct:true, - charlotte:true, - content:function(){ - 'step 0' - player.chooseControl('加目标','多刀','取消').set('prompt',get.prompt2('zhuSkill_jiangling')).set('ai',()=>(3-game.countPlayer())); - 'step 1' - if(result.index<2){ - player.logSkill('zhuSkill_jiangling'); - player.addTempSkill('zhuSkill_jiangling'+result.index,'phaseUseAfter'); - game.log(player,'选择了','#y'+result.control,'的效果'); + zhuSkill_jiangling: { + trigger: { player: "phaseUseBegin" }, + direct: true, + charlotte: true, + content: function () { + "step 0"; + player + .chooseControl("加目标", "多刀", "取消") + .set("prompt", get.prompt2("zhuSkill_jiangling")) + .set("ai", () => 3 - game.countPlayer()); + "step 1"; + if (result.index < 2) { + player.logSkill("zhuSkill_jiangling"); + player.addTempSkill("zhuSkill_jiangling" + result.index, "phaseUseAfter"); + game.log(player, "选择了", "#y" + result.control, "的效果"); } }, }, - zhuSkill_jiangling0:{ - trigger:{player:'useCard2'}, - direct:true, - charlotte:true, - filter:function(event,player){ - if(event.card.name!='sha'&&get.type(event.card)!='trick') return false; - if(!event.targets||event.targets.length!=1) return false; - var info=get.info(event.card); - if(info.allowMultiple==false) return false; - if(event.targets&&!info.multitarget){ - if(game.hasPlayer(function(current){ - return !event.targets.includes(current)&&lib.filter.targetEnabled2(event.card,player,current)&&lib.filter.targetInRange(event.card,player,current); - })){ + zhuSkill_jiangling0: { + trigger: { player: "useCard2" }, + direct: true, + charlotte: true, + filter: function (event, player) { + if (event.card.name != "sha" && get.type(event.card) != "trick") return false; + if (!event.targets || event.targets.length != 1) return false; + var info = get.info(event.card); + if (info.allowMultiple == false) return false; + if (event.targets && !info.multitarget) { + if ( + game.hasPlayer(function (current) { + return ( + !event.targets.includes(current) && + lib.filter.targetEnabled2(event.card, player, current) && + lib.filter.targetInRange(event.card, player, current) + ); + }) + ) { return true; } } return false; }, - content:function(){ - 'step 0' - var prompt2='为'+get.translation(trigger.card)+'增加一个目标' - player.chooseTarget(get.prompt('zhuSkill_jiangling'),function(card,player,target){ - var player=_status.event.player; - if(_status.event.targets.includes(target)) return false; - return lib.filter.targetEnabled2(_status.event.card,player,target)&&lib.filter.targetInRange(_status.event.card,player,target); - }).set('prompt2',prompt2).set('ai',function(target){ - var trigger=_status.event.getTrigger(); - var player=_status.event.player; - return get.effect(target,trigger.card,player,player)*(_status.event.targets.includes(target)?-1:1); - }).set('targets',trigger.targets).set('card',trigger.card); - 'step 1' - if(result.bool){ - if(!event.isMine()&&!event.isOnline()) game.delayx(); - event.targets=result.targets; - } - else{ + content: function () { + "step 0"; + var prompt2 = "为" + get.translation(trigger.card) + "增加一个目标"; + player + .chooseTarget(get.prompt("zhuSkill_jiangling"), function (card, player, target) { + var player = _status.event.player; + if (_status.event.targets.includes(target)) return false; + return ( + lib.filter.targetEnabled2(_status.event.card, player, target) && + lib.filter.targetInRange(_status.event.card, player, target) + ); + }) + .set("prompt2", prompt2) + .set("ai", function (target) { + var trigger = _status.event.getTrigger(); + var player = _status.event.player; + return ( + get.effect(target, trigger.card, player, player) * + (_status.event.targets.includes(target) ? -1 : 1) + ); + }) + .set("targets", trigger.targets) + .set("card", trigger.card); + "step 1"; + if (result.bool) { + if (!event.isMine() && !event.isOnline()) game.delayx(); + event.targets = result.targets; + } else { event.finish(); } - 'step 2' - if(event.targets){ - player.logSkill('zhuSkill_jiangling',event.targets); - if(trigger.targets.includes(event.targets[0])) trigger.targets.removeArray(event.targets); - else{ + "step 2"; + if (event.targets) { + player.logSkill("zhuSkill_jiangling", event.targets); + if (trigger.targets.includes(event.targets[0])) + trigger.targets.removeArray(event.targets); + else { //trigger.directHit.addArray(event.targets); trigger.targets.addArray(event.targets); } } }, }, - zhuSkill_jiangling1:{ - charlotte:true, - mod:{ - cardUsable:function(card,player){ - if(card.name=='sha'||get.type(card)=='trick') return Infinity; + zhuSkill_jiangling1: { + charlotte: true, + mod: { + cardUsable: function (card, player) { + if (card.name == "sha" || get.type(card) == "trick") return Infinity; }, }, }, - zhuSkill_fancheng:{ - enable:'phaseUse', - limited:true, - charlotte:true, - skillAnimation:true, - animationColor:'gray', - content:function(){ - 'step 0' - player.awakenSkill('zhuSkill_fancheng'); - player.chooseControl('杀','其他').set('prompt','选择要强化的伤害').set('ai',()=>get.rand(0,1)); - 'step 1' - player.addSkill('zhuSkill_fancheng'+result.index); - game.log(player,'本局游戏内',result.index?'#g杀以外':'#y杀','的伤害+1'); + zhuSkill_fancheng: { + enable: "phaseUse", + limited: true, + charlotte: true, + skillAnimation: true, + animationColor: "gray", + content: function () { + "step 0"; + player.awakenSkill("zhuSkill_fancheng"); + player + .chooseControl("杀", "其他") + .set("prompt", "选择要强化的伤害") + .set("ai", () => get.rand(0, 1)); + "step 1"; + player.addSkill("zhuSkill_fancheng" + result.index); + game.log(player, "本局游戏内", result.index ? "#g杀以外" : "#y杀", "的伤害+1"); }, - ai:{ - order:100, - result:{player:100}, + ai: { + order: 100, + result: { player: 100 }, }, }, - zhuSkill_fancheng0:{ - trigger:{source:'damageBegin2'}, - forced:true, - charlotte:true, - filter:function(event,player){ - return event.player!=player&&event.card&&event.card.name=='sha'&&event.getParent().name=='sha'; + zhuSkill_fancheng0: { + trigger: { source: "damageBegin2" }, + forced: true, + charlotte: true, + filter: function (event, player) { + return ( + event.player != player && + event.card && + event.card.name == "sha" && + event.getParent().name == "sha" + ); }, - logTarget:'player', - content:function(){ + logTarget: "player", + content: function () { trigger.num++; }, - mark:true, - marktext:'殺', - intro:{content:'因执行【杀】的效果对其他角色造成的伤害+1'}, + mark: true, + marktext: "殺", + intro: { content: "因执行【杀】的效果对其他角色造成的伤害+1" }, }, - zhuSkill_fancheng1:{ - trigger:{source:'damageBegin2'}, - forced:true, - charlotte:true, - filter:function(event,player){ - return event.player!=player&&(!event.card||event.card.name!='sha'); + zhuSkill_fancheng1: { + trigger: { source: "damageBegin2" }, + forced: true, + charlotte: true, + filter: function (event, player) { + return event.player != player && (!event.card || event.card.name != "sha"); }, - logTarget:'player', - content:function(){ + logTarget: "player", + content: function () { trigger.num++; }, - mark:true, - marktext:'谋', - intro:{content:'不因【杀】对其他角色造成的伤害+1'}, + mark: true, + marktext: "谋", + intro: { content: "不因【杀】对其他角色造成的伤害+1" }, }, - binglin_shaxue:{ - init:function(player,skill){ - player.addMark(skill,3,false); + binglin_shaxue: { + init: function (player, skill) { + player.addMark(skill, 3, false); }, - trigger:{player:'damageBegin3'}, - forced:true, - charlotte:true, - filter:function(event,player){ - return event.source&&player!=event.source&&player.identity==event.source.identity&&player.countMark('binglin_shaxue')>0; + trigger: { player: "damageBegin3" }, + forced: true, + charlotte: true, + filter: function (event, player) { + return ( + event.source && + player != event.source && + player.identity == event.source.identity && + player.countMark("binglin_shaxue") > 0 + ); }, - content:function(){ + content: function () { trigger.cancel(); - player.removeMark('binglin_shaxue',1,false); - trigger.source.removeMark('binglin_shaxue',1,false); + player.removeMark("binglin_shaxue", 1, false); + trigger.source.removeMark("binglin_shaxue", 1, false); }, - intro:{content:'剩余次数:#'}, - ai:{ - viewHandcard:true, - skillTagFilter:function(player,tag,arg){ - return player!=arg&&arg.hasSkill('binglin_shaxue'); + intro: { content: "剩余次数:#" }, + ai: { + viewHandcard: true, + skillTagFilter: function (player, tag, arg) { + return player != arg && arg.hasSkill("binglin_shaxue"); }, }, }, - binglin_neihong:{charlotte:true}, - toushiche_skill:{ - trigger:{player:'phaseJieshuBegin'}, - forced:true, - equipSkill:true, - filter:function(event,player){ - return lib.skill.toushiche_skill.logTarget(null,player).length>0; + binglin_neihong: { charlotte: true }, + toushiche_skill: { + trigger: { player: "phaseJieshuBegin" }, + forced: true, + equipSkill: true, + filter: function (event, player) { + return lib.skill.toushiche_skill.logTarget(null, player).length > 0; }, - logTarget:function(event,player){ - var hs=player.countCards('h'); - return game.filterPlayer(function(current){ - return current!=player&¤t.countCards('h')>hs; + logTarget: function (event, player) { + var hs = player.countCards("h"); + return game.filterPlayer(function (current) { + return current != player && current.countCards("h") > hs; }); }, - content:function(){ - 'step 0' - event.targets=lib.skill.toushiche_skill.logTarget(null,player).sortBySeat(); - 'step 1' - var target=targets.shift(); - if(target.countCards('h')>0) target.chooseToDiscard('h',true); - if(targets.length) event.redo(); + content: function () { + "step 0"; + event.targets = lib.skill.toushiche_skill.logTarget(null, player).sortBySeat(); + "step 1"; + var target = targets.shift(); + if (target.countCards("h") > 0) target.chooseToDiscard("h", true); + if (targets.length) event.redo(); }, }, - online_gongshoujintui:{ - enable:'chooseToUse', - filter:function(event,player){ - var cards=player.getCards('hs'); - for(var i of cards){ - var name=get.name(i,player); - if(name=='gongshoujianbei'){ - if(event.filterCard({ - name:'wanjian', - isCard:true, - cards:[i], - },player,event)||event.filterCard({ - name:'taoyuan', - isCard:true, - cards:[i], - },player,event)) return true; + online_gongshoujintui: { + enable: "chooseToUse", + filter: function (event, player) { + var cards = player.getCards("hs"); + for (var i of cards) { + var name = get.name(i, player); + if (name == "gongshoujianbei") { + if ( + event.filterCard( + { + name: "wanjian", + isCard: true, + cards: [i], + }, + player, + event + ) || + event.filterCard( + { + name: "taoyuan", + isCard: true, + cards: [i], + }, + player, + event + ) + ) + return true; } - if(name=='jintuiziru'){ - if(event.filterCard({ - name:'nanman', - isCard:true, - cards:[i], - },player,event)||event.filterCard({ - name:'wugu', - isCard:true, - cards:[i], - },player,event)) return true; + if (name == "jintuiziru") { + if ( + event.filterCard( + { + name: "nanman", + isCard: true, + cards: [i], + }, + player, + event + ) || + event.filterCard( + { + name: "wugu", + isCard: true, + cards: [i], + }, + player, + event + ) + ) + return true; } } return false; }, - chooseButton:{ - dialog:function(event,player){ - var list=[]; - if(player.countCards('hs','gongshoujianbei')){ - list.push(['锦囊','','wanjian']); - list.push(['锦囊','','taoyuan']); + chooseButton: { + dialog: function (event, player) { + var list = []; + if (player.countCards("hs", "gongshoujianbei")) { + list.push(["锦囊", "", "wanjian"]); + list.push(["锦囊", "", "taoyuan"]); } - if(player.countCards('hs','jintuiziru')){ - list.push(['锦囊','','nanman']); - list.push(['锦囊','','wugu']); + if (player.countCards("hs", "jintuiziru")) { + list.push(["锦囊", "", "nanman"]); + list.push(["锦囊", "", "wugu"]); } - return ui.create.dialog('攻守兼备/进退自如',[list,'vcard'],'hidden'); + return ui.create.dialog("攻守兼备/进退自如", [list, "vcard"], "hidden"); }, - filter:function(button,player){ - var name=button.link[2]; - var rawname=((name=='wanjian'||name=='taoyuan')?'gongshoujianbei':'jintuiziru'); - var cards=player.getCards('hs'); - var evt=_status.event.getParent(); - for(var i of cards){ - if(get.name(i,player)==rawname&&evt.filterCard({ - name:name, - isCard:true, - cards:[i], - },player,evt)) return true; + filter: function (button, player) { + var name = button.link[2]; + var rawname = + name == "wanjian" || name == "taoyuan" ? "gongshoujianbei" : "jintuiziru"; + var cards = player.getCards("hs"); + var evt = _status.event.getParent(); + for (var i of cards) { + if ( + get.name(i, player) == rawname && + evt.filterCard( + { + name: name, + isCard: true, + cards: [i], + }, + player, + evt + ) + ) + return true; } return false; }, - check:function(button){ - return _status.event.player.getUseValue({name:button.link[2],isCard:true}); + check: function (button) { + return _status.event.player.getUseValue({ name: button.link[2], isCard: true }); }, - backup:function(links){ - var name=links[0][2]; - var rawname=((name=='wanjian'||name=='taoyuan')?'gongshoujianbei':'jintuiziru'); + backup: function (links) { + var name = links[0][2]; + var rawname = + name == "wanjian" || name == "taoyuan" ? "gongshoujianbei" : "jintuiziru"; return { - popname:true, - viewAs:{name:name,isCard:true}, - filterCard:{name:rawname}, - ai1:()=>1, - } + popname: true, + viewAs: { name: name, isCard: true }, + filterCard: { name: rawname }, + ai1: () => 1, + }; + }, + prompt: function (links) { + var name = links[0][2]; + var rawname = + name == "wanjian" || name == "taoyuan" ? "gongshoujianbei" : "jintuiziru"; + return "将一张" + get.translation(rawname) + "当做" + get.translation(name) + "使用"; }, - prompt:function(links){ - var name=links[0][2]; - var rawname=((name=='wanjian'||name=='taoyuan')?'gongshoujianbei':'jintuiziru'); - return '将一张'+get.translation(rawname)+'当做'+get.translation(name)+'使用'; - } }, - ai:{ - order:10, - result:{ - player:1, + ai: { + order: 10, + result: { + player: 1, }, }, }, - doudizhu_cardPile:{ - intro:{ - content:'cardCount', + doudizhu_cardPile: { + intro: { + content: "cardCount", }, }, - kaihei:{ - enable:'phaseUse', - filter:function(event,player){ - return player==game.zhu&&game.hasPlayer(function(current){ - return lib.skill.kaihei.filterTarget(null,player,current); - }); + kaihei: { + enable: "phaseUse", + filter: function (event, player) { + return ( + player == game.zhu && + game.hasPlayer(function (current) { + return lib.skill.kaihei.filterTarget(null, player, current); + }) + ); }, - filterTarget:function(card,player,target){ - return player!=target&&!target.storage.kaihei&&target.countGainableCards(player,'he')>0; + filterTarget: function (card, player, target) { + return ( + player != target && + !target.storage.kaihei && + target.countGainableCards(player, "he") > 0 + ); }, - content:function(){ - 'step 0' - player.gainPlayerCard(target,[1,2],'he',true); - target.storage.kaihei=true; - 'step 1' - if(!result.bool||!result.cards.length){ - event.finish();return; + content: function () { + "step 0"; + player.gainPlayerCard(target, [1, 2], "he", true); + target.storage.kaihei = true; + "step 1"; + if (!result.bool || !result.cards.length) { + event.finish(); + return; } - var num=result.cards.length; - var hs=player.getCards('he'); - if(hs.length){ - if(hs.length<=num) event._result={bool:true,cards:hs}; - else player.chooseCard('he',true,num,'选择交给'+get.translation(target)+get.cnNumber(num)+'张牌'); - } - else event.finish(); - 'step 2' - if(result.bool&&result.cards&&result.cards.length) player.give(result.cards,target); + var num = result.cards.length; + var hs = player.getCards("he"); + if (hs.length) { + if (hs.length <= num) event._result = { bool: true, cards: hs }; + else + player.chooseCard( + "he", + true, + num, + "选择交给" + get.translation(target) + get.cnNumber(num) + "张牌" + ); + } else event.finish(); + "step 2"; + if (result.bool && result.cards && result.cards.length) player.give(result.cards, target); }, - ai:{ - viewHandcard:true, - skillTagFilter:function(player,tag,target){ - if(player==target||player.identity!='fan'||target.identity!='fan') return false; + ai: { + viewHandcard: true, + skillTagFilter: function (player, tag, target) { + if (player == target || player.identity != "fan" || target.identity != "fan") + return false; }, }, }, - feiyang:{ - trigger:{player:'phaseJudgeBegin'}, - charlotte:true, - direct:true, - filter:function(event,player){ - return _status.mode!='online'&&_status.mode!='binglin'&&player==game.zhu&&player.countCards('j')&&player.countCards('h')>1; + feiyang: { + trigger: { player: "phaseJudgeBegin" }, + charlotte: true, + direct: true, + filter: function (event, player) { + return ( + _status.mode != "online" && + _status.mode != "binglin" && + player == game.zhu && + player.countCards("j") && + player.countCards("h") > 1 + ); }, - content:function(){ - "step 0" - player.chooseToDiscard('h',2,get.prompt('feiyang'),'弃置两张手牌,然后弃置判定区里的一张牌').set('logSkill','feiyang').set('ai',function(card){ - if(_status.event.goon) return 6-get.value(card); - return 0; - }).set('goon',(()=>{ - if(player.hasSkillTag('rejudge')&&player.countCards('j')<2) return false; - return player.hasCard(function(card){ - if(get.tag(card,'damage')&&get.damageEffect(player,player,_status.event.player,get.natureList(card))>=0) return false; - return get.effect(player,{ - name:card.viewAs||card.name, - cards:[card], - },player,player)<0; - },'j'); - })()); - "step 1" - if(result.bool){ - player.discardPlayerCard(player,'j',true); + content: function () { + "step 0"; + player + .chooseToDiscard( + "h", + 2, + get.prompt("feiyang"), + "弃置两张手牌,然后弃置判定区里的一张牌" + ) + .set("logSkill", "feiyang") + .set("ai", function (card) { + if (_status.event.goon) return 6 - get.value(card); + return 0; + }) + .set( + "goon", + (() => { + if (player.hasSkillTag("rejudge") && player.countCards("j") < 2) return false; + return player.hasCard(function (card) { + if ( + get.tag(card, "damage") && + get.damageEffect( + player, + player, + _status.event.player, + get.natureList(card) + ) >= 0 + ) + return false; + return ( + get.effect( + player, + { + name: card.viewAs || card.name, + cards: [card], + }, + player, + player + ) < 0 + ); + }, "j"); + })() + ); + "step 1"; + if (result.bool) { + player.discardPlayerCard(player, "j", true); } }, }, - bahu:{ - trigger:{player:'phaseZhunbeiBegin'}, - charlotte:true, - forced:true, - filter:function(event,player){ - return _status.mode!='online'&&_status.mode!='binglin'&&player==game.zhu; + bahu: { + trigger: { player: "phaseZhunbeiBegin" }, + charlotte: true, + forced: true, + filter: function (event, player) { + return _status.mode != "online" && _status.mode != "binglin" && player == game.zhu; }, - content:function(){ + content: function () { player.draw(); }, - mod:{ - cardUsable:function(card,player,num){ - if(_status.mode!='online'&&_status.mode!='binglin'&&player==game.zhu&&card.name=='sha') return num+1; + mod: { + cardUsable: function (card, player, num) { + if ( + _status.mode != "online" && + _status.mode != "binglin" && + player == game.zhu && + card.name == "sha" + ) + return num + 1; }, }, }, - diqi_skill:{ - trigger:{player:'damageBegin2'}, - filter:function(event,player){ - var card=player.getEquip('diqi'); - return get.itemtype(card)=='card'&&lib.filter.cardDiscardable(card,player,'diqi_skill'); + diqi_skill: { + trigger: { player: "damageBegin2" }, + filter: function (event, player) { + var card = player.getEquip("diqi"); + return ( + get.itemtype(card) == "card" && lib.filter.cardDiscardable(card, player, "diqi_skill") + ); }, - check:function(event,player){ - return event.num>=Math.min(player.hp,2); + check: function (event, player) { + return event.num >= Math.min(player.hp, 2); }, - prompt2:function(event,player){ - return '弃置'+get.translation(player.getEquip('diqi'))+'并防止即将受到的'+get.cnNumber(event.num)+'点伤害'; + prompt2: function (event, player) { + return ( + "弃置" + + get.translation(player.getEquip("diqi")) + + "并防止即将受到的" + + get.cnNumber(event.num) + + "点伤害" + ); }, - content:function(){ - player.discard(player.getEquip('diqi')); + content: function () { + player.discard(player.getEquip("diqi")); trigger.cancel(); }, - ai:{ - filterDamage:true, - skillTagFilter:function(player,tag,arg){ - if(arg&&arg.player){ - if(arg.player.hasSkillTag('jueqing',false,player)) return false; + ai: { + filterDamage: true, + skillTagFilter: function (player, tag, arg) { + if (arg && arg.player) { + if (arg.player.hasSkillTag("jueqing", false, player)) return false; } }, }, }, - online_aozhan:{ - trigger:{player:'phaseBefore'}, - forced:true, - popup:false, - firstDo:true, - filter:function(event,player){ - return !_status._aozhan&&game.roundNumber>10; + online_aozhan: { + trigger: { player: "phaseBefore" }, + forced: true, + popup: false, + firstDo: true, + filter: function (event, player) { + return !_status._aozhan && game.roundNumber > 10; }, - content:function(){ - var color=get.groupnature(player.group,"raw"); - if(player.isUnseen()) color='fire'; - player.$fullscreenpop('鏖战模式',color); - game.broadcastAll(function(){ - _status._aozhan=true; - ui.aozhan=ui.create.div('.touchinfo.left',ui.window); - ui.aozhan.innerHTML='鏖战模式'; - if(ui.time3) ui.time3.style.display='none'; - ui.aozhanInfo=ui.create.system('鏖战模式',null,true); - lib.setPopped(ui.aozhanInfo,function(){ - var uiintro=ui.create.dialog('hidden'); - uiintro.add('鏖战模式'); - var list=[ - '从第11轮开始,游戏将进入〔鏖战模式〕。', - '在鏖战模式下,任何角色均不是非转化的【桃】的合法目标。【桃】可以被当做【杀】或【闪】使用或打出。', - ]; - var intro='
      '; - for(var i=0;i'+intro+'
    '); - var ul=uiintro.querySelector('ul'); - if(ul){ - ul.style.width='180px'; - } - uiintro.add(ui.create.div('.placeholder')); - return uiintro; - },250); + content: function () { + var color = get.groupnature(player.group, "raw"); + if (player.isUnseen()) color = "fire"; + player.$fullscreenpop("鏖战模式", color); + game.broadcastAll(function () { + _status._aozhan = true; + ui.aozhan = ui.create.div(".touchinfo.left", ui.window); + ui.aozhan.innerHTML = "鏖战模式"; + if (ui.time3) ui.time3.style.display = "none"; + ui.aozhanInfo = ui.create.system("鏖战模式", null, true); + lib.setPopped( + ui.aozhanInfo, + function () { + var uiintro = ui.create.dialog("hidden"); + uiintro.add("鏖战模式"); + var list = [ + "从第11轮开始,游戏将进入〔鏖战模式〕。", + "在鏖战模式下,任何角色均不是非转化的【桃】的合法目标。【桃】可以被当做【杀】或【闪】使用或打出。", + ]; + var intro = '
      '; + for (var i = 0; i < list.length; i++) { + intro += "
    • " + list[i]; + } + intro += "
    "; + uiintro.add('
    ' + intro + "
    "); + var ul = uiintro.querySelector("ul"); + if (ul) { + ul.style.width = "180px"; + } + uiintro.add(ui.create.div(".placeholder")); + return uiintro; + }, + 250 + ); game.playBackgroundMusic(); }); - game.removeGlobalSkill('online_aozhan'); - game.countPlayer(function(current){current.addSkill('aozhan')}); + game.removeGlobalSkill("online_aozhan"); + game.countPlayer(function (current) { + current.addSkill("aozhan"); + }); }, }, - online_juzhong:{ - trigger:{global:'useCard'}, - direct:true, - ruleSkill:true, - filter:function(event,player){ - return _status.mode=='online'&&!event.all_excluded&&event.player.isFriendOf(player)&&event.player!=player&&lib.skill.online_juzhong.infos[event.card.name]&&player.hasCard(function(card){ - if(_status.connectMode) return true; - return get.name(card,player)==event.card.name; - },'h'); + online_juzhong: { + trigger: { global: "useCard" }, + direct: true, + ruleSkill: true, + filter: function (event, player) { + return ( + _status.mode == "online" && + !event.all_excluded && + event.player.isFriendOf(player) && + event.player != player && + lib.skill.online_juzhong.infos[event.card.name] && + player.hasCard(function (card) { + if (_status.connectMode) return true; + return get.name(card, player) == event.card.name; + }, "h") + ); }, - content:function(){ - 'step 0' - player.chooseToDiscard('是否响应【聚众】?',get.translation(trigger.player)+'使用了'+get.translation(trigger.card)+'。你可弃置一张名称相同的牌,令'+lib.skill.online_juzhong.infos[trigger.card.name][0],function(card,player){ - return get.name(card,player)==_status.event.getTrigger().card.name; - }).set('ai',lib.skill.online_juzhong.infos[trigger.card.name][2]).logSkill=['_juzhong',trigger.player]; - 'step 1' - if(result.bool){ + content: function () { + "step 0"; + player + .chooseToDiscard( + "是否响应【聚众】?", + get.translation(trigger.player) + + "使用了" + + get.translation(trigger.card) + + "。你可弃置一张名称相同的牌,令" + + lib.skill.online_juzhong.infos[trigger.card.name][0], + function (card, player) { + return get.name(card, player) == _status.event.getTrigger().card.name; + } + ) + .set("ai", lib.skill.online_juzhong.infos[trigger.card.name][2]).logSkill = [ + "_juzhong", + trigger.player, + ]; + "step 1"; + if (result.bool) { lib.skill.online_juzhong.infos[trigger.card.name][1](); - if(!event.goon) event.finish(); - } - else event.finish(); - 'step 2' - trigger.player.chooseTarget('你可选择一名角色,弃置其的一张牌',function(card,player,target){ - return target.countDiscardableCards(player,'he')>0; - }).set('ai',function(target){ - var player=_status.event.player; - return get.effect(target,{name:'guohe_copy2'},player,player); - }); - 'step 3' - if(result.bool){ - var target=result.targets[0]; - trigger.player.line(target,'green'); - trigger.player.discardPlayerCard(target,true,'he'); + if (!event.goon) event.finish(); + } else event.finish(); + "step 2"; + trigger.player + .chooseTarget("你可选择一名角色,弃置其的一张牌", function (card, player, target) { + return target.countDiscardableCards(player, "he") > 0; + }) + .set("ai", function (target) { + var player = _status.event.player; + return get.effect(target, { name: "guohe_copy2" }, player, player); + }); + "step 3"; + if (result.bool) { + var target = result.targets[0]; + trigger.player.line(target, "green"); + trigger.player.discardPlayerCard(target, true, "he"); } }, - infos:{ - sha:['此【杀】的伤害值基数+1。',function(){ - var evt=_status.event._trigger; - if(!evt.baseDamage) evt.baseDamage=1; - evt.baseDamage++; - },function(card){ - var evt=_status.event.getTrigger(); - if(!evt.targets.length) return 0; - if(evt.targets[0].hasShan()||evt.targets[0].hasSkillTag('filterDamage',null,{ - player:evt.targets[0], - card:evt.card, - })) return 0; - return 1; - }], - shan:['其可弃置一名角色的一张牌。',function(){ - _status.event.goon=true; - },function(card){ - if(game.zhu.countCards('he',function(card){ - return get.value(card,game.zhu)>=6; - })) return 7-get.value(card); - if(game.zhu.countCards('he',function(card){ - return get.value(card,game.zhu)>0 - })) return 5-get.value(card); - return 0; - }], - tao:['其摸两张牌。',function(){ - _status.event._trigger.player.draw(2); - },function(card){ - return 6-get.value(card); - }], - jiu:['其本回合的伤害值或回复值+1。',function(){ - var player=_status.event._trigger.player; - player.addTempSkill('juzhong_jiu'); - player.addMark('juzhong_jiu',1,false); - },function(card){ - return 6-get.value(card); - }], + infos: { + sha: [ + "此【杀】的伤害值基数+1。", + function () { + var evt = _status.event._trigger; + if (!evt.baseDamage) evt.baseDamage = 1; + evt.baseDamage++; + }, + function (card) { + var evt = _status.event.getTrigger(); + if (!evt.targets.length) return 0; + if ( + evt.targets[0].hasShan() || + evt.targets[0].hasSkillTag("filterDamage", null, { + player: evt.targets[0], + card: evt.card, + }) + ) + return 0; + return 1; + }, + ], + shan: [ + "其可弃置一名角色的一张牌。", + function () { + _status.event.goon = true; + }, + function (card) { + if ( + game.zhu.countCards("he", function (card) { + return get.value(card, game.zhu) >= 6; + }) + ) + return 7 - get.value(card); + if ( + game.zhu.countCards("he", function (card) { + return get.value(card, game.zhu) > 0; + }) + ) + return 5 - get.value(card); + return 0; + }, + ], + tao: [ + "其摸两张牌。", + function () { + _status.event._trigger.player.draw(2); + }, + function (card) { + return 6 - get.value(card); + }, + ], + jiu: [ + "其本回合的伤害值或回复值+1。", + function () { + var player = _status.event._trigger.player; + player.addTempSkill("juzhong_jiu"); + player.addMark("juzhong_jiu", 1, false); + }, + function (card) { + return 6 - get.value(card); + }, + ], }, - ai:{ - viewHandcard:true, - skillTagFilter:function(player,tag,target){ - if(_status.mode!='online'||player==target||player.identity!=target.identity) return false; + ai: { + viewHandcard: true, + skillTagFilter: function (player, tag, target) { + if ( + _status.mode != "online" || + player == target || + player.identity != target.identity + ) + return false; }, }, }, - juzhong_jiu:{ - trigger:{ - player:'recoverBegin', - source:'damageBegin1', + juzhong_jiu: { + trigger: { + player: "recoverBegin", + source: "damageBegin1", }, - forced:true, - popup:false, - content:function(){ - trigger.num+=player.countMark('juzhong_jiu'); + forced: true, + popup: false, + content: function () { + trigger.num += player.countMark("juzhong_jiu"); }, - onremove:true, - intro:{content:'本回合的伤害值和回复值+#'}, + onremove: true, + intro: { content: "本回合的伤害值和回复值+#" }, }, - online_zhadan_button:{ - trigger:{ - global:'gameDrawAfter', - player:['gainEnd','loseEnd'], + online_zhadan_button: { + trigger: { + global: "gameDrawAfter", + player: ["gainEnd", "loseEnd"], }, - firstDo:true, - forced:true, - charlotte:true, - popup:false, - silent:true, - filter:function(event,player){ - if(_status.mode!='online'||(player!=game.me&&!player.isOnline())) return; - if(event.name!='lose') return !player.hasZhadan&&player.countCards('hs','zhadan')>0; - return player.hasZhadan&&!player.countCards('hs','zhadan'); + firstDo: true, + forced: true, + charlotte: true, + popup: false, + silent: true, + filter: function (event, player) { + if (_status.mode != "online" || (player != game.me && !player.isOnline())) return; + if (event.name != "lose") + return !player.hasZhadan && player.countCards("hs", "zhadan") > 0; + return player.hasZhadan && !player.countCards("hs", "zhadan"); }, - content:function(){ - if(!player.hasZhadan){ - player.hasZhadan=true; - if(player==game.me) lib.skill.online_zhadan_button.initZhadan(); - else player.send(function(){lib.skill.online_zhadan_button.initZhadan()}); - } - else{ + content: function () { + if (!player.hasZhadan) { + player.hasZhadan = true; + if (player == game.me) lib.skill.online_zhadan_button.initZhadan(); + else + player.send(function () { + lib.skill.online_zhadan_button.initZhadan(); + }); + } else { delete player.hasZhadan; - if(player==game.me) lib.skill.online_zhadan_button.removeZhadan(); - else player.send(function(){lib.skill.online_zhadan_button.removeZhadan()}); + if (player == game.me) lib.skill.online_zhadan_button.removeZhadan(); + else + player.send(function () { + lib.skill.online_zhadan_button.removeZhadan(); + }); } }, - initZhadan:function(){ - ui.zhadan_button=ui.create.control('激活炸弹','stayleft',function(){ - if(this.classList.contains('hidden')) return; - this.classList.toggle('glow'); - if(this.classList.contains('glow')&&_status.event.type=='zhadan'&& - _status.event.isMine()&&ui.confirm&&_status.imchoosing){ + initZhadan: function () { + ui.zhadan_button = ui.create.control("激活炸弹", "stayleft", function () { + if (this.classList.contains("hidden")) return; + this.classList.toggle("glow"); + if ( + this.classList.contains("glow") && + _status.event.type == "zhadan" && + _status.event.isMine() && + ui.confirm && + _status.imchoosing + ) { ui.click.cancel(ui.confirm.lastChild); } }); }, - removeZhadan:function(){ - if(ui.zhadan_button){ + removeZhadan: function () { + if (ui.zhadan_button) { ui.zhadan_button.remove(); delete ui.zhadan_button; } }, }, - online_zhadan:{ - trigger:{player:'useCard'}, - priority:5, - popup:false, - forced:true, - filter:function(event,player){ - return game.hasPlayer(function(current){ - return current.hasCard(function(card){ - if(get.name(card)!='zhadan') return false; - return lib.filter.cardEnabled(card,player,'forceEnable'); - },'hs'); + online_zhadan: { + trigger: { player: "useCard" }, + priority: 5, + popup: false, + forced: true, + filter: function (event, player) { + return game.hasPlayer(function (current) { + return current.hasCard(function (card) { + if (get.name(card) != "zhadan") return false; + return lib.filter.cardEnabled(card, player, "forceEnable"); + }, "hs"); }); }, - forceLoad:true, - content:function(){ - 'step 0' - event.source=trigger.player; - event.card=trigger.card; - event.targets=trigger.targets; - event._global_waiting=true; - event.filterCard=function(card,player){ - if(get.name(card)!='zhadan'||get.itemtype(card)!='card') return false; - return lib.filter.cardEnabled(card,player,'forceEnable'); + forceLoad: true, + content: function () { + "step 0"; + event.source = trigger.player; + event.card = trigger.card; + event.targets = trigger.targets; + event._global_waiting = true; + event.filterCard = function (card, player) { + if (get.name(card) != "zhadan" || get.itemtype(card) != "card") return false; + return lib.filter.cardEnabled(card, player, "forceEnable"); }; - event.send=function(player,card,source,targets,id,id2,skillState){ - if(skillState){ + event.send = function (player, card, source, targets, id, id2, skillState) { + if (skillState) { player.applySkills(skillState); } - if(player==game.me&&ui.zhadan_button&&!ui.zhadan_button.classList.contains('glow')){ - _status.event._result={bool:false}; - if(game.online){ - _status.event._resultid=id; + if ( + player == game.me && + ui.zhadan_button && + !ui.zhadan_button.classList.contains("glow") + ) { + _status.event._result = { bool: false }; + if (game.online) { + _status.event._resultid = id; game.resume(); } return; } - var str=get.translation(source); - if(targets&&targets.length){ - str+='对'+get.translation(targets); + var str = get.translation(source); + if (targets && targets.length) { + str += "对" + get.translation(targets); } - str+='使用了'; - str+=get.translation(card); - str+=',是否对其使用【炸弹】?'; + str += "使用了"; + str += get.translation(card); + str += ",是否对其使用【炸弹】?"; - var next=player.chooseToUse({ - filterCard:function(card,player){ - if(get.name(card)!='zhadan'||get.itemtype(card)!='card') return false; - return lib.filter.cardEnabled(card,player,'forceEnable'); + var next = player.chooseToUse({ + filterCard: function (card, player) { + if (get.name(card) != "zhadan" || get.itemtype(card) != "card") return false; + return lib.filter.cardEnabled(card, player, "forceEnable"); }, - prompt:str, - _global_waiting:true, - ai1:function(card){ - var evt=_status.event.getParent('_zhadan')._trigger,player=_status.event.player; - if(!evt) return 0; - if(get.attitude(player,evt.player)>0) return 0; - var eff=0; - if(!targets.length) return Math.random()-0.5; - for(var i of targets) eff-=get.effect(i,evt.card,evt.player,player); - return eff-8; + prompt: str, + _global_waiting: true, + ai1: function (card) { + var evt = _status.event.getParent("_zhadan")._trigger, + player = _status.event.player; + if (!evt) return 0; + if (get.attitude(player, evt.player) > 0) return 0; + var eff = 0; + if (!targets.length) return Math.random() - 0.5; + for (var i of targets) eff -= get.effect(i, evt.card, evt.player, player); + return eff - 8; }, - source:source, - source2:targets, - id:id, - id2:id2, - type:'zhadan', + source: source, + source2: targets, + id: id, + id2: id2, + type: "zhadan", }); - next.set('respondTo',[source,card]); + next.set("respondTo", [source, card]); - if(game.online){ - _status.event._resultid=id; + if (game.online) { + _status.event._resultid = id; game.resume(); - } - else{ - next.nouse=true; + } else { + next.nouse = true; } }; - 'step 1' - var list=game.filterPlayer(function(current){ - return current.hasCard(function(card){ - if(get.name(card)!='zhadan') return false; - return lib.filter.cardEnabled(card,player,'forceEnable'); - },'hs'); + "step 1"; + var list = game.filterPlayer(function (current) { + return current.hasCard(function (card) { + if (get.name(card) != "zhadan") return false; + return lib.filter.cardEnabled(card, player, "forceEnable"); + }, "hs"); }); - event.list=list; - event.id=get.id(); - list.sort(function(a,b){ - return get.distance(event.source,a,'absolute')-get.distance(event.source,b,'absolute'); + event.list = list; + event.id = get.id(); + list.sort(function (a, b) { + return ( + get.distance(event.source, a, "absolute") - + get.distance(event.source, b, "absolute") + ); }); - 'step 2' - if(event.list.length==0){ + "step 2"; + if (event.list.length == 0) { event.finish(); - } - else if(_status.connectMode&&(event.list[0].isOnline()||event.list[0]==game.me)){ + } else if ( + _status.connectMode && + (event.list[0].isOnline() || event.list[0] == game.me) + ) { event.goto(4); + } else { + event.current = event.list.shift(); + event.send( + event.current, + event.card, + event.source, + event.targets, + event.id, + trigger.parent.id + ); } - else{ - event.current=event.list.shift(); - event.send(event.current,event.card,event.source,event.targets,event.id,trigger.parent.id); - } - 'step 3' - if(result.bool){ - event.zhadanresult=event.current; - event.zhadanresult2=result; - if(event.current!=game.me&&!event.current.isOnline()) game.delayx(); + "step 3"; + if (result.bool) { + event.zhadanresult = event.current; + event.zhadanresult2 = result; + if (event.current != game.me && !event.current.isOnline()) game.delayx(); event.goto(8); - } - else{ + } else { event.goto(2); } - 'step 4' - var id=event.id; - var sendback=function(result,player){ - if(result&&result.id==id&&!event.zhadanresult&&result.bool){ - event.zhadanresult=player; - event.zhadanresult2=result; - game.broadcast('cancel',id); - if(_status.event.id==id&&_status.event.name=='chooseToUse'&&_status.paused){ - return (function(){ - event.resultOL=_status.event.resultOL; + "step 4"; + var id = event.id; + var sendback = function (result, player) { + if (result && result.id == id && !event.zhadanresult && result.bool) { + event.zhadanresult = player; + event.zhadanresult2 = result; + game.broadcast("cancel", id); + if ( + _status.event.id == id && + _status.event.name == "chooseToUse" && + _status.paused + ) { + return function () { + event.resultOL = _status.event.resultOL; ui.click.cancel(); - if(ui.confirm) ui.confirm.close(); - }); + if (ui.confirm) ui.confirm.close(); + }; } - } - else{ - if(_status.event.id==id&&_status.event.name=='chooseToUse'&&_status.paused){ - return (function(){ - event.resultOL=_status.event.resultOL; - }); + } else { + if ( + _status.event.id == id && + _status.event.name == "chooseToUse" && + _status.paused + ) { + return function () { + event.resultOL = _status.event.resultOL; + }; } } }; - var withme=false; - var withol=false; - var list=event.list; - for(var i=0;inum1) num1=num; - if(num num1) num1 = num; + if (num < num2) num2 = num; }); - var num=target.countCards('h'),choices=[]; - event.addIndex=0; - if(num num2) { + choices.push("令" + str + "将手牌弃置至" + get.cnNumber(num2) + "张"); + event.num2 = num2; } - else event.addIndex++; - if(num>num2){ - choices.push('令'+str+'将手牌弃置至'+get.cnNumber(num2)+'张'); - event.num2=num2; - } - if(!choices.length) event.finish(); - else if(choices.length==1) event._result={index:0}; - else player.chooseControl().set('choiceList',choices).set('ai',function(){ - var evt=_status.event.getParent(); - return get.attitude(evt.player,evt.target)>0?0:1; - }); - 'step 1' - if(result.index+event.addIndex==0){ - target.drawTo(event.num1); - } - else target.chooseToDiscard(true,'h',target.countCards('h')-event.num2); - }, - ai:{ - order:6, - value:4, - useful:2, - tag:{ - draw:1, - loseCard:1, - }, - result:{ - target:function(player,target,card,isLink){ - var num1=0,num2=Infinity,str=get.translation(target); - game.countPlayer(function(current){ - var num=current.countCards('h',function(cardx){ - if(ui.selected.cards.includes(cardx)) return false; - if(card.cards&&card.cards.includes(cardx)) return false; - return true; - }); - if(num>num1) num1=num; - if(num 0 ? 0 : 1; }); - var num=target.countCards('h',function(cardx){ - if(ui.selected.cards.includes(cardx)) return false; - if(card.cards&&card.cards.includes(cardx)) return false; + "step 1"; + if (result.index + event.addIndex == 0) { + target.drawTo(event.num1); + } else target.chooseToDiscard(true, "h", target.countCards("h") - event.num2); + }, + ai: { + order: 6, + value: 4, + useful: 2, + tag: { + draw: 1, + loseCard: 1, + }, + result: { + target: function (player, target, card, isLink) { + var num1 = 0, + num2 = Infinity, + str = get.translation(target); + game.countPlayer(function (current) { + var num = current.countCards("h", function (cardx) { + if (ui.selected.cards.includes(cardx)) return false; + if (card.cards && card.cards.includes(cardx)) return false; + return true; + }); + if (num > num1) num1 = num; + if (num < num2) num2 = num; + }); + var num = target.countCards("h", function (cardx) { + if (ui.selected.cards.includes(cardx)) return false; + if (card.cards && card.cards.includes(cardx)) return false; return true; }); - if(num1>num){ - if(get.attitude(player,target)>0) return (num1-num)/1.2; + if (num1 > num) { + if (get.attitude(player, target) > 0) return (num1 - num) / 1.2; } - if(num20) return (num2-num)/1.2; + if (num2 < num) { + if (get.attitude(player, target) > 0) return (num2 - num) / 1.2; } return 0; - } - } - } - }, - luojingxiashi:{ - fullskin:true, - enable:true, - type:'trick', - selectTarget:-1, - filterTarget:function(card,player,target){ - return target!=player&&target.isDamaged(); - }, - content:function(){ - target.damage(); - }, - ai:{ - order:3, - value:4, - useful:2, - tag:{ - loseCard:1, - }, - result:{ - target:-1.5, - } - } - }, - binglinchengxia:{ - fullskin:true, - type:'delay', - filterTarget:function(card,player,target){ - return (lib.filter.judge(card,player,target)&&player!=target); - }, - judge:function(card){ - if(get.suit(card)=='diamond') return 0; - return -3; - }, - effect:function(){ - 'step 0' - if(result.bool==false){ - if(!player.countCards('e',function(card){ - return lib.filter.cardDiscardable(card,player,'shuiyanqijuny'); - })){ - player.damage('nosource'); - event.finish(); - return; - } - else player.chooseControl('discard_card','take_damage',function(event,player){ - if(get.damageEffect(player,event.player,player)>=0){ - return 'take_damage'; - } - if(player.hp>=3&&player.countCards('e')>=2){ - return 'take_damage'; - } - return 'discard_card'; - }); - } - else event.finish(); - 'step 1' - if(result.control=='discard_card'){ - player.discard(player.getCards('e',function(card){ - return lib.filter.cardDiscardable(card,player,'shuiyanqijuny'); - })); - } - else player.damage('nosource'); - }, - ai:{ - order:1, - value:3, - useful:2, - tag:{ - damage:1, - loseCard:1, - }, - result:{ - target:function(player,target,card,isLink){ - var es=target.getCards('e'); - if(!es.length) return -1.5; - var val=0; - for(var i of es) val+=get.value(i,target); - return -Math.min(1.5,val/5); - } - } - } - }, - toushiche:{ - fullskin:true, - type:'equip', - subtype:'equip1', - distance:{attackFrom:-3}, - ai:{ - basic:{ - equipValue:2.5 - } - }, - skills:['toushiche_skill'] - }, - gongshoujianbei:{ - fullskin:true, - type:'trick', - }, - jintuiziru:{ - fullskin:true, - type:'trick', - }, - diqi:{ - fullskin:true, - type:"equip", - subtype:"equip2", - skills:['diqi_skill'], - destroy:'diqi_skill', - ai:{ - basic:{ - equipValue:6 - }, - }, - }, - zhadan:{ - audio:true, - fullskin:true, - type:'trick', - ai:{ - basic:{ - useful:[6,4], - value:[6,4], - }, - result:{player:1}, - }, - notarget:true, - content:function(){ - var evt=event.getParent(2)._trigger; - evt.targets.length=0; - evt.all_excluded=true; - game.log(evt.card,'的效果被炸弹抵消了'); - }, - }, - jiwangkailai:{ - audio:true, - fullskin:true, - type:'trick', - enable:function(card,player){ - var hs=player.getCards('h',function(cardx){ - return cardx!=card&&(!card.cards||!card.cards.includes(cardx)); - }); - if(!hs.length) return false; - var use=true,discard=true; - for(var i of hs){ - if(use&&!game.checkMod(i,player,'unchanged','cardEnabled2',player)) use=false; - if(discard&&!lib.filter.cardDiscardable(i,player,'jiwangkailai')) discard=false; - if(!use&&!discard) return false; - } - return true; - }, - selectTarget:-1, - toself:true, - filterTarget:function(card,player,target){ - return target==player; - }, - modTarget:true, - content:function(){ - 'step 0' - var hs=player.getCards('h'); - if(hs.length){ - var use=true,discard=true; - for(var i of hs){ - if(use&&!game.checkMod(i,player,'unchanged','cardEnabled2',player)) use=false; - if(discard&&!lib.filter.cardDiscardable(i,player,'jiwangkailai')) discard=false; - if(!use&&!discard) break; - } - if(use&&discard) player.chooseControl().set('prompt','继往开来:请选择一项').set('choiceList',[ - '弃置所有手牌,然后摸等量的牌', - '将所有手牌当做一张普通锦囊牌使用', - ]).set('ai',function(){ - if(_status.event.player.countCards('h')>2) return 0; - return 1; - }); - else if(use) event._result={index:1}; - else if(discard) event._result={index:0}; - else event.finish(); - } - else event.finish(); - 'step 1' - var cards=player.getCards('h'); - if(result.index==0){ - player.discard(cards); - player.draw(cards.length); - event.finish(); - } - else{ - var list=[]; - for(var i of lib.inpile){ - if(i!='jiwangkailai'&&get.type(i)=='trick'&&lib.filter.filterCard({name:i,cards:cards},player)) list.push(['锦囊','',i]); - } - if(list.length){ - player.chooseButton(['继往开来:选择要使用的牌',[list,'vcard']],true).set('ai',function(button){ - var player=_status.event.player; - return player.getUseValue({name:button.link[2],cards:player.getCards('h')}); - }); - } - else event.finish(); - } - 'step 2' - if(result.bool) player.chooseUseTarget({name:result.links[0][2]},player.getCards('h'),true); - }, - ai:{ - basic:{ - order:0.5, - useful:3, - value:5 - }, - result:{ - target:function(player,target){ - if(target.needsToDiscard(1)||!target.countCards('h',function(card){ - return get.value(card,player)>=5.5; - })) return 1; - return 0; }, }, - tag:{ - draw:2 + }, + }, + luojingxiashi: { + fullskin: true, + enable: true, + type: "trick", + selectTarget: -1, + filterTarget: function (card, player, target) { + return target != player && target.isDamaged(); + }, + content: function () { + target.damage(); + }, + ai: { + order: 3, + value: 4, + useful: 2, + tag: { + loseCard: 1, + }, + result: { + target: -1.5, + }, + }, + }, + binglinchengxia: { + fullskin: true, + type: "delay", + filterTarget: function (card, player, target) { + return lib.filter.judge(card, player, target) && player != target; + }, + judge: function (card) { + if (get.suit(card) == "diamond") return 0; + return -3; + }, + effect: function () { + "step 0"; + if (result.bool == false) { + if ( + !player.countCards("e", function (card) { + return lib.filter.cardDiscardable(card, player, "shuiyanqijuny"); + }) + ) { + player.damage("nosource"); + event.finish(); + return; + } else + player.chooseControl("discard_card", "take_damage", function (event, player) { + if (get.damageEffect(player, event.player, player) >= 0) { + return "take_damage"; + } + if (player.hp >= 3 && player.countCards("e") >= 2) { + return "take_damage"; + } + return "discard_card"; + }); + } else event.finish(); + "step 1"; + if (result.control == "discard_card") { + player.discard( + player.getCards("e", function (card) { + return lib.filter.cardDiscardable(card, player, "shuiyanqijuny"); + }) + ); + } else player.damage("nosource"); + }, + ai: { + order: 1, + value: 3, + useful: 2, + tag: { + damage: 1, + loseCard: 1, + }, + result: { + target: function (player, target, card, isLink) { + var es = target.getCards("e"); + if (!es.length) return -1.5; + var val = 0; + for (var i of es) val += get.value(i, target); + return -Math.min(1.5, val / 5); + }, + }, + }, + }, + toushiche: { + fullskin: true, + type: "equip", + subtype: "equip1", + distance: { attackFrom: -3 }, + ai: { + basic: { + equipValue: 2.5, + }, + }, + skills: ["toushiche_skill"], + }, + gongshoujianbei: { + fullskin: true, + type: "trick", + }, + jintuiziru: { + fullskin: true, + type: "trick", + }, + diqi: { + fullskin: true, + type: "equip", + subtype: "equip2", + skills: ["diqi_skill"], + destroy: "diqi_skill", + ai: { + basic: { + equipValue: 6, + }, + }, + }, + zhadan: { + audio: true, + fullskin: true, + type: "trick", + ai: { + basic: { + useful: [6, 4], + value: [6, 4], + }, + result: { player: 1 }, + }, + notarget: true, + content: function () { + var evt = event.getParent(2)._trigger; + evt.targets.length = 0; + evt.all_excluded = true; + game.log(evt.card, "的效果被炸弹抵消了"); + }, + }, + jiwangkailai: { + audio: true, + fullskin: true, + type: "trick", + enable: function (card, player) { + var hs = player.getCards("h", function (cardx) { + return cardx != card && (!card.cards || !card.cards.includes(cardx)); + }); + if (!hs.length) return false; + var use = true, + discard = true; + for (var i of hs) { + if (use && !game.checkMod(i, player, "unchanged", "cardEnabled2", player)) + use = false; + if (discard && !lib.filter.cardDiscardable(i, player, "jiwangkailai")) + discard = false; + if (!use && !discard) return false; } - } + return true; + }, + selectTarget: -1, + toself: true, + filterTarget: function (card, player, target) { + return target == player; + }, + modTarget: true, + content: function () { + "step 0"; + var hs = player.getCards("h"); + if (hs.length) { + var use = true, + discard = true; + for (var i of hs) { + if (use && !game.checkMod(i, player, "unchanged", "cardEnabled2", player)) + use = false; + if (discard && !lib.filter.cardDiscardable(i, player, "jiwangkailai")) + discard = false; + if (!use && !discard) break; + } + if (use && discard) + player + .chooseControl() + .set("prompt", "继往开来:请选择一项") + .set("choiceList", [ + "弃置所有手牌,然后摸等量的牌", + "将所有手牌当做一张普通锦囊牌使用", + ]) + .set("ai", function () { + if (_status.event.player.countCards("h") > 2) return 0; + return 1; + }); + else if (use) event._result = { index: 1 }; + else if (discard) event._result = { index: 0 }; + else event.finish(); + } else event.finish(); + "step 1"; + var cards = player.getCards("h"); + if (result.index == 0) { + player.discard(cards); + player.draw(cards.length); + event.finish(); + } else { + var list = []; + for (var i of lib.inpile) { + if ( + i != "jiwangkailai" && + get.type(i) == "trick" && + lib.filter.filterCard({ name: i, cards: cards }, player) + ) + list.push(["锦囊", "", i]); + } + if (list.length) { + player + .chooseButton(["继往开来:选择要使用的牌", [list, "vcard"]], true) + .set("ai", function (button) { + var player = _status.event.player; + return player.getUseValue({ + name: button.link[2], + cards: player.getCards("h"), + }); + }); + } else event.finish(); + } + "step 2"; + if (result.bool) + player.chooseUseTarget({ name: result.links[0][2] }, player.getCards("h"), true); + }, + ai: { + basic: { + order: 0.5, + useful: 3, + value: 5, + }, + result: { + target: function (player, target) { + if ( + target.needsToDiscard(1) || + !target.countCards("h", function (card) { + return get.value(card, player) >= 5.5; + }) + ) + return 1; + return 0; + }, + }, + tag: { + draw: 2, + }, + }, }, }, - characterOnline:{ - wei:[ - 're_caocao','re_guojia','re_simayi','re_xiahoudun','xuzhu','re_zhangliao','re_zhenji','ol_xiahouyuan','dianwei','re_xunyu','zhanghe', - 'yujin_yujin','re_caozhang','wangyi','guohuai','hanhaoshihuan','chenqun','re_caoxiu','guohuanghou','sunziliufang','xunyou','xinxianying', - 'sp_caiwenji','caoang','caochun','caohong','sp_caoren','chenlin','sp_jiaxu','litong','sp_pangde','simalang','wanglang', - 'kuailiangkuaiyue','wangji','sp_simazhao','sp_wangyuanji','yuejin','zangba','xinpi','liuye','simashi','zhuling','duji','caoanmin', + characterOnline: { + wei: [ + "re_caocao", + "re_guojia", + "re_simayi", + "re_xiahoudun", + "xuzhu", + "re_zhangliao", + "re_zhenji", + "ol_xiahouyuan", + "dianwei", + "re_xunyu", + "zhanghe", + "yujin_yujin", + "re_caozhang", + "wangyi", + "guohuai", + "hanhaoshihuan", + "chenqun", + "re_caoxiu", + "guohuanghou", + "sunziliufang", + "xunyou", + "xinxianying", + "sp_caiwenji", + "caoang", + "caochun", + "caohong", + "sp_caoren", + "chenlin", + "sp_jiaxu", + "litong", + "sp_pangde", + "simalang", + "wanglang", + "kuailiangkuaiyue", + "wangji", + "sp_simazhao", + "sp_wangyuanji", + "yuejin", + "zangba", + "xinpi", + "liuye", + "simashi", + "zhuling", + "duji", + "caoanmin", ], - shu:[ - 're_guanyu','re_huangyueying','re_liubei','re_machao','re_zhangfei','zhaoyun','re_huangzhong','re_weiyan','re_pangtong','ol_sp_zhugeliang', - 're_menghuo','re_zhurong','re_fazheng','re_masu','guanxingzhangbao','xin_liaohua','old_madai','re_jianyong','wuyi','zhangsong','zhoucang', - 'liuchen','xiahoushi','re_zhangyi','liyan','guanyinping','guansuo','mayunlu','mazhong','mizhu','sunqian','xiahouba','zhangxingcai', - 'wangping','yanyan','chendao','ganfuren','re_maliang','dengzhi','lifeng','zhangyì', + shu: [ + "re_guanyu", + "re_huangyueying", + "re_liubei", + "re_machao", + "re_zhangfei", + "zhaoyun", + "re_huangzhong", + "re_weiyan", + "re_pangtong", + "ol_sp_zhugeliang", + "re_menghuo", + "re_zhurong", + "re_fazheng", + "re_masu", + "guanxingzhangbao", + "xin_liaohua", + "old_madai", + "re_jianyong", + "wuyi", + "zhangsong", + "zhoucang", + "liuchen", + "xiahoushi", + "re_zhangyi", + "liyan", + "guanyinping", + "guansuo", + "mayunlu", + "mazhong", + "mizhu", + "sunqian", + "xiahouba", + "zhangxingcai", + "wangping", + "yanyan", + "chendao", + "ganfuren", + "re_maliang", + "dengzhi", + "lifeng", + "zhangyì", ], - wu:[ - 're_ganning','re_huanggai','re_sunquan','re_sunshangxiang','re_zhouyu','old_zhoutai','re_xiaoqiao','re_taishici','sunjian','re_zhangzhang', - 're_lingtong','re_wuguotai','xin_xusheng','re_bulianshi','re_chengpu','handang','xin_panzhangmazhong','xin_zhuran','guyong','zhuhuan','cenhun','sundeng','xuezong', - 'daxiaoqiao','heqi','kanze','sunhao','re_sunluyu','sunshao','zhugejin','zumao','dingfeng','sunliang','zhoufei', - 'weiwenzhugezhi','xf_sufei','xugong','lingcao','sunru','lvdai','panjun','yanjun','zhoufang', + wu: [ + "re_ganning", + "re_huanggai", + "re_sunquan", + "re_sunshangxiang", + "re_zhouyu", + "old_zhoutai", + "re_xiaoqiao", + "re_taishici", + "sunjian", + "re_zhangzhang", + "re_lingtong", + "re_wuguotai", + "xin_xusheng", + "re_bulianshi", + "re_chengpu", + "handang", + "xin_panzhangmazhong", + "xin_zhuran", + "guyong", + "zhuhuan", + "cenhun", + "sundeng", + "xuezong", + "daxiaoqiao", + "heqi", + "kanze", + "sunhao", + "re_sunluyu", + "sunshao", + "zhugejin", + "zumao", + "dingfeng", + "sunliang", + "zhoufei", + "weiwenzhugezhi", + "xf_sufei", + "xugong", + "lingcao", + "sunru", + "lvdai", + "panjun", + "yanjun", + "zhoufang", ], - qun:[ - 're_diaochan','re_gongsunzan','re_huatuo','re_huaxiong','re_lvbu','ol_pangde','re_yanwen','jiaxu','gaoshun','xin_liubiao','chengong', - 're_gongsunyuan','guotufengji','dongbai','fuwan','liuxie','sp_machao','tadun','yanbaihu','yuanshu','zhangbao','yl_luzhi','huangfusong','sp_ganning','huangjinleishi', - 're_panfeng','guosi','sp_liuqi','mangyachang','gaolan','lvkuanglvxiang','xunchen','sp_zhanghe','re_hansui','re_hejin','zhujun','ol_dingyuan','hanfu','wangrong', - 'dongcheng','gongsunkang','hucheer','sp_sufei','yj_xuhuang','yj_zhanghe','yj_zhangliao','liuyao','wangcan','sp_taishici','caimao','jiling', + qun: [ + "re_diaochan", + "re_gongsunzan", + "re_huatuo", + "re_huaxiong", + "re_lvbu", + "ol_pangde", + "re_yanwen", + "jiaxu", + "gaoshun", + "xin_liubiao", + "chengong", + "re_gongsunyuan", + "guotufengji", + "dongbai", + "fuwan", + "liuxie", + "sp_machao", + "tadun", + "yanbaihu", + "yuanshu", + "zhangbao", + "yl_luzhi", + "huangfusong", + "sp_ganning", + "huangjinleishi", + "re_panfeng", + "guosi", + "sp_liuqi", + "mangyachang", + "gaolan", + "lvkuanglvxiang", + "xunchen", + "sp_zhanghe", + "re_hansui", + "re_hejin", + "zhujun", + "ol_dingyuan", + "hanfu", + "wangrong", + "dongcheng", + "gongsunkang", + "hucheer", + "sp_sufei", + "yj_xuhuang", + "yj_zhanghe", + "yj_zhangliao", + "liuyao", + "wangcan", + "sp_taishici", + "caimao", + "jiling", ], - key:[ - 'sp_key_yuri','key_akane','key_akiko','key_ao','key_harukakanata','key_haruko','key_hinata','key_kengo','key_komari','key_kotori','key_kyoko','key_nagisa','key_noda','key_rei','key_rin','key_rumi','key_ryoichi','key_sasami','key_shiorimiyuki','key_shiroha','key_shizuku','key_tomoya','key_tsumugi','key_umi','key_yoshino','key_youta','key_yukine','key_nao','key_misuzu', + key: [ + "sp_key_yuri", + "key_akane", + "key_akiko", + "key_ao", + "key_harukakanata", + "key_haruko", + "key_hinata", + "key_kengo", + "key_komari", + "key_kotori", + "key_kyoko", + "key_nagisa", + "key_noda", + "key_rei", + "key_rin", + "key_rumi", + "key_ryoichi", + "key_sasami", + "key_shiorimiyuki", + "key_shiroha", + "key_shizuku", + "key_tomoya", + "key_tsumugi", + "key_umi", + "key_yoshino", + "key_youta", + "key_yukine", + "key_nao", + "key_misuzu", ], }, - online_cardPile:[ - ['spade',1,'guding'], - ['spade',1,'zhadan'], - ['spade',2,'tengjia'], - ['spade',2,'cixiong'], - ['spade',3,'jiu'], - ['spade',3,'guohe'], - ['spade',4,'sha','thunder'], - ['spade',4,'guohe'], - ['spade',5,'sha','thunder'], - ['spade',5,'qinglong'], - ['spade',6,'sha','thunder'], - ['spade',6,'jiwangkailai'], - ['spade',7,'sha','thunder'], - ['spade',7,'jintuiziru'], - ['spade',8,'sha','thunder'], - ['spade',8,'sha'], - ['spade',9,'jiu'], - ['spade',9,'sha'], - ['spade',10,'gongshoujianbei'], - ['spade',10,'sha'], - ['spade',11,'tiesuo'], - ['spade',11,'shunshou'], - ['spade',12,'tiesuo'], - ['spade',12,'zhangba'], - ['spade',13,'wuxie'], - ['spade',13,'dawanma'], + online_cardPile: [ + ["spade", 1, "guding"], + ["spade", 1, "zhadan"], + ["spade", 2, "tengjia"], + ["spade", 2, "cixiong"], + ["spade", 3, "jiu"], + ["spade", 3, "guohe"], + ["spade", 4, "sha", "thunder"], + ["spade", 4, "guohe"], + ["spade", 5, "sha", "thunder"], + ["spade", 5, "qinglong"], + ["spade", 6, "sha", "thunder"], + ["spade", 6, "jiwangkailai"], + ["spade", 7, "sha", "thunder"], + ["spade", 7, "jintuiziru"], + ["spade", 8, "sha", "thunder"], + ["spade", 8, "sha"], + ["spade", 9, "jiu"], + ["spade", 9, "sha"], + ["spade", 10, "gongshoujianbei"], + ["spade", 10, "sha"], + ["spade", 11, "tiesuo"], + ["spade", 11, "shunshou"], + ["spade", 12, "tiesuo"], + ["spade", 12, "zhangba"], + ["spade", 13, "wuxie"], + ["spade", 13, "dawanma"], - ['club',1,'baiyin'], - ['club',1,'zhuge'], - ['club',2,'tengjia'], - ['club',2,'bagua'], - ['club',3,'jiu'], - ['club',3,'sha'], - ['club',4,'jintuiziru'], - ['club',4,'sha'], - ['club',5,'sha','thunder'], - ['club',5,'dilu'], - ['club',6,'sha','thunder'], - ['club',6,'sha'], - ['club',7,'sha','thunder'], - ['club',7,'sha'], - ['club',8,'sha','thunder'], - ['club',8,'sha'], - ['club',9,'jiu'], - ['club',9,'sha'], - ['club',10,'tiesuo'], - ['club',10,'sha'], - ['club',11,'tiesuo'], - ['club',11,'sha'], - ['club',12,'tiesuo'], - ['club',12,'wuxie'], - ['club',13,'tiesuo'], - ['club',13,'jiedao'], - ['club',13,'wuxie'], + ["club", 1, "baiyin"], + ["club", 1, "zhuge"], + ["club", 2, "tengjia"], + ["club", 2, "bagua"], + ["club", 3, "jiu"], + ["club", 3, "sha"], + ["club", 4, "jintuiziru"], + ["club", 4, "sha"], + ["club", 5, "sha", "thunder"], + ["club", 5, "dilu"], + ["club", 6, "sha", "thunder"], + ["club", 6, "sha"], + ["club", 7, "sha", "thunder"], + ["club", 7, "sha"], + ["club", 8, "sha", "thunder"], + ["club", 8, "sha"], + ["club", 9, "jiu"], + ["club", 9, "sha"], + ["club", 10, "tiesuo"], + ["club", 10, "sha"], + ["club", 11, "tiesuo"], + ["club", 11, "sha"], + ["club", 12, "tiesuo"], + ["club", 12, "wuxie"], + ["club", 13, "tiesuo"], + ["club", 13, "jiedao"], + ["club", 13, "wuxie"], - ['heart',1,'wuxie'], - ['heart',1,'gongshoujianbei'], - ['heart',1,'zhadan'], - ['heart',2,'huogong'], - ['heart',2,'shan'], - ['heart',3,'huogong'], - ['heart',3,'wuzhong'], - ['heart',4,'sha','fire'], - ['heart',4,'tao'], - ['heart',5,'tao'], - ['heart',5,'chitu'], - ['heart',6,'tao'], - ['heart',6,'jiwangkailai'], - ['heart',7,'sha','fire'], - ['heart',7,'tao'], - ['heart',8,'shan'], - ['heart',8,'wuzhong'], - ['heart',9,'shan'], - ['heart',9,'tao'], - ['heart',10,'sha','fire'], - ['heart',10,'sha'], - ['heart',11,'shan'], - ['heart',11,'wuzhong'], - ['heart',12,'shan'], - ['heart',12,'guohe'], - ['heart',13,'wuxie'], - ['heart',13,'zhuahuang'], + ["heart", 1, "wuxie"], + ["heart", 1, "gongshoujianbei"], + ["heart", 1, "zhadan"], + ["heart", 2, "huogong"], + ["heart", 2, "shan"], + ["heart", 3, "huogong"], + ["heart", 3, "wuzhong"], + ["heart", 4, "sha", "fire"], + ["heart", 4, "tao"], + ["heart", 5, "tao"], + ["heart", 5, "chitu"], + ["heart", 6, "tao"], + ["heart", 6, "jiwangkailai"], + ["heart", 7, "sha", "fire"], + ["heart", 7, "tao"], + ["heart", 8, "shan"], + ["heart", 8, "wuzhong"], + ["heart", 9, "shan"], + ["heart", 9, "tao"], + ["heart", 10, "sha", "fire"], + ["heart", 10, "sha"], + ["heart", 11, "shan"], + ["heart", 11, "wuzhong"], + ["heart", 12, "shan"], + ["heart", 12, "guohe"], + ["heart", 13, "wuxie"], + ["heart", 13, "zhuahuang"], - ['diamond',1,'zhuque'], - ['diamond',1,'juedou'], - ['diamond',2,'tao'], - ['diamond',2,'shan'], - ['diamond',3,'tao'], - ['diamond',3,'shan'], - ['diamond',4,'sha','fire'], - ['diamond',4,'shunshou'], - ['diamond',5,'sha','fire'], - ['diamond',5,'guanshi'], - ['diamond',6,'shan'], - ['diamond',6,'sha'], - ['diamond',7,'shan'], - ['diamond',7,'shan'], - ['diamond',8,'shan'], - ['diamond',8,'shan'], - ['diamond',9,'jiu'], - ['diamond',9,'shan'], - ['diamond',10,'shan'], - ['diamond',10,'sha'], - ['diamond',11,'shan'], - ['diamond',11,'shan'], - ['diamond',12,'huogong'], - ['diamond',12,'tao'], - ['diamond',13,'xiliu'], - ['diamond',13,'sha'], - ['diamond',13,'wuxie'] + ["diamond", 1, "zhuque"], + ["diamond", 1, "juedou"], + ["diamond", 2, "tao"], + ["diamond", 2, "shan"], + ["diamond", 3, "tao"], + ["diamond", 3, "shan"], + ["diamond", 4, "sha", "fire"], + ["diamond", 4, "shunshou"], + ["diamond", 5, "sha", "fire"], + ["diamond", 5, "guanshi"], + ["diamond", 6, "shan"], + ["diamond", 6, "sha"], + ["diamond", 7, "shan"], + ["diamond", 7, "shan"], + ["diamond", 8, "shan"], + ["diamond", 8, "shan"], + ["diamond", 9, "jiu"], + ["diamond", 9, "shan"], + ["diamond", 10, "shan"], + ["diamond", 10, "sha"], + ["diamond", 11, "shan"], + ["diamond", 11, "shan"], + ["diamond", 12, "huogong"], + ["diamond", 12, "tao"], + ["diamond", 13, "xiliu"], + ["diamond", 13, "sha"], + ["diamond", 13, "wuxie"], ], - help:{ - '斗地主':'
    游戏规则
    • 游戏人数
      游戏人数为3人(地主x1 + 农民x2)。
    • 胜利条件
      农民:地主死亡。
      地主:所有农民死亡且自己存活。'+ - '
    • 死亡奖惩
      当有农民死亡时,若另一名农民存活,则其可以选择摸两张牌或回复1点体力。
    • 地主专属技能
      地主可以使用专属技能〖飞扬〗和〖跋扈〗。
      〖飞扬〗判定阶段开始时,若你的判定区有牌,则你可以弃置两张手牌,然后弃置你判定区的一张牌。每回合限一次。
      〖跋扈〗锁定技,准备阶段开始时,你摸一张牌。出牌阶段,你可以多使用一张【杀】。
    ', - } + help: { + 斗地主: + '
    游戏规则
    • 游戏人数
      游戏人数为3人(地主x1 + 农民x2)。
    • 胜利条件
      农民:地主死亡。
      地主:所有农民死亡且自己存活。' + + "
    • 死亡奖惩
      当有农民死亡时,若另一名农民存活,则其可以选择摸两张牌或回复1点体力。
    • 地主专属技能
      地主可以使用专属技能〖飞扬〗和〖跋扈〗。
      〖飞扬〗判定阶段开始时,若你的判定区有牌,则你可以弃置两张手牌,然后弃置你判定区的一张牌。每回合限一次。
      〖跋扈〗锁定技,准备阶段开始时,你摸一张牌。出牌阶段,你可以多使用一张【杀】。
    ", + }, }; }); diff --git a/mode/guozhan.js b/mode/guozhan.js index ddc811867..b979e592c 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -1,1555 +1,2247 @@ -'use strict'; -game.import('mode',function(lib,game,ui,get,ai,_status){ +"use strict"; +game.import("mode", function (lib, game, ui, get, ai, _status) { return { - name:'guozhan', - startBefore:function(){ - var playback=localStorage.getItem(lib.configprefix+'playback'); - for(var i in lib.characterPack.mode_guozhan){ - if(!get.config('onlyguozhan')&&!playback){ - if(lib.character[i.slice(3)]) continue; + name: "guozhan", + startBefore: function () { + var playback = localStorage.getItem(lib.configprefix + "playback"); + for (var i in lib.characterPack.mode_guozhan) { + if (!get.config("onlyguozhan") && !playback) { + if (lib.character[i.slice(3)]) continue; } - lib.character[i]=lib.characterPack.mode_guozhan[i]; - if(!lib.character[i][4]){ - lib.character[i][4]=[]; + lib.character[i] = lib.characterPack.mode_guozhan[i]; + if (!lib.character[i][4]) { + lib.character[i][4] = []; } - if(!lib.translate[i]){ - lib.translate[i]=lib.translate[i.slice(3)]; + if (!lib.translate[i]) { + lib.translate[i] = lib.translate[i.slice(3)]; } } - for(var i in lib.character){ - if(lib.character[i][1]=='shen'){ - if(lib.character[i][4]){ - var group=lib.character[i][4].find(group=>lib.group.includes(group)||group=='key'||group.startsWith('gzgroup:')); - if(group){ - if(group.startsWith('gzgroup:')) lib.character[i][1]=group.slice(8); - else lib.character[i][1]=group; - } - else lib.character[i][1]='qun'; - } - else lib.character[i][1]='qun'; + for (var i in lib.character) { + if (lib.character[i][1] == "shen") { + if (lib.character[i][4]) { + var group = lib.character[i][4].find( + (group) => + lib.group.includes(group) || group == "key" || group.startsWith("gzgroup:") + ); + if (group) { + if (group.startsWith("gzgroup:")) lib.character[i][1] = group.slice(8); + else lib.character[i][1] = group; + } else lib.character[i][1] = "qun"; + } else lib.character[i][1] = "qun"; } } }, - onreinit:function(){ - var pack=lib.characterPack.mode_guozhan; - for(var i in pack){ - lib.character[i]=pack[i]; - if(!lib.character[i][4]){ - lib.character[i][4]=[]; + onreinit: function () { + var pack = lib.characterPack.mode_guozhan; + for (var i in pack) { + lib.character[i] = pack[i]; + if (!lib.character[i][4]) { + lib.character[i][4] = []; } - if(!lib.translate[i]){ - lib.translate[i]=lib.translate[i.slice(3)]; + if (!lib.translate[i]) { + lib.translate[i] = lib.translate[i.slice(3)]; } } - for(var i in lib.character){ - if(lib.character[i][1]=='shen'){ - if(lib.character[i][4]){ - var group=lib.character[i][4].find(group=>lib.group.includes(group)||group=='key'||group.startsWith('gzgroup:')); - if(group){ - if(group.startsWith('gzgroup:')) lib.character[i][1]=group.slice(8); - else lib.character[i][1]=group; - } - else lib.character[i][1]='qun'; - } - else lib.character[i][1]='qun'; + for (var i in lib.character) { + if (lib.character[i][1] == "shen") { + if (lib.character[i][4]) { + var group = lib.character[i][4].find( + (group) => + lib.group.includes(group) || group == "key" || group.startsWith("gzgroup:") + ); + if (group) { + if (group.startsWith("gzgroup:")) lib.character[i][1] = group.slice(8); + else lib.character[i][1] = group; + } else lib.character[i][1] = "qun"; + } else lib.character[i][1] = "qun"; } } }, - start:function(){ - "step 0" - var playback=localStorage.getItem(lib.configprefix+'playback'); - if(playback){ + start: function () { + "step 0"; + var playback = localStorage.getItem(lib.configprefix + "playback"); + if (playback) { ui.create.me(); - ui.arena.style.display='none'; - ui.system.style.display='none'; - _status.playback=playback; - localStorage.removeItem(lib.configprefix+'playback'); - var store=lib.db.transaction(['video'],'readwrite').objectStore('video'); - store.get(parseInt(playback)).onsuccess=function(e){ - if(e.target.result){ + ui.arena.style.display = "none"; + ui.system.style.display = "none"; + _status.playback = playback; + localStorage.removeItem(lib.configprefix + "playback"); + var store = lib.db.transaction(["video"], "readwrite").objectStore("video"); + store.get(parseInt(playback)).onsuccess = function (e) { + if (e.target.result) { game.playVideoContent(e.target.result.video); - } - else{ - alert('播放失败:找不到录像'); + } else { + alert("播放失败:找不到录像"); game.reload(); } - } + }; event.finish(); - } - else if(_status.connectMode){ + } else if (_status.connectMode) { game.waitForPlayer(); - } - else{ - _status.mode=get.config('guozhan_mode'); - if(!['normal','yingbian','old','free'].includes(_status.mode)) _status.mode='normal'; + } else { + _status.mode = get.config("guozhan_mode"); + if (!["normal", "yingbian", "old", "free"].includes(_status.mode)) _status.mode = "normal"; //决定牌堆 - switch(_status.mode){ - case 'old':lib.card.list=lib.guozhanPile_old.slice(0);break; - case 'yingbian': - lib.card.list=lib.guozhanPile_yingbian.slice(0); + switch (_status.mode) { + case "old": + lib.card.list = lib.guozhanPile_old.slice(0); + break; + case "yingbian": + lib.card.list = lib.guozhanPile_yingbian.slice(0); delete lib.translate.shuiyanqijunx_info_guozhan; - const pack=lib.yingbian_guozhan; - for(const i in pack){ - if(!pack[i][4]) pack[i][4]=[]; - lib.character[i]=pack[i]; - lib.characterPack.mode_guozhan[i]=pack[i]; - if(!lib.translate[i]) lib.translate[i]=lib.translate[i.slice(3)]; + const pack = lib.yingbian_guozhan; + for (const i in pack) { + if (!pack[i][4]) pack[i][4] = []; + lib.character[i] = pack[i]; + lib.characterPack.mode_guozhan[i] = pack[i]; + if (!lib.translate[i]) lib.translate[i] = lib.translate[i.slice(3)]; } break; - case 'normal':lib.card.list=lib.guozhanPile.slice(0);break; + case "normal": + lib.card.list = lib.guozhanPile.slice(0); + break; } - if(_status.mode!='free') game.fixedPile=true; - else{ + if (_status.mode != "free") game.fixedPile = true; + else { delete lib.translate.shuiyanqijunx_info_guozhan; } game.prepareArena(); // game.delay(); game.showChangeLog(); } - if(!_status.connectMode){ - _status.mode=get.config('guozhan_mode'); - if(_status.brawl&&_status.brawl.submode){ - _status.mode=_status.brawl.submode; + if (!_status.connectMode) { + _status.mode = get.config("guozhan_mode"); + if (_status.brawl && _status.brawl.submode) { + _status.mode = _status.brawl.submode; } - if(get.config('separatism')) _status.separatism=true; + if (get.config("separatism")) _status.separatism = true; } - "step 1" - if(_status.connectMode){ - _status.mode=lib.configOL.guozhan_mode; - if(!['normal','yingbian','old'].includes(_status.mode)) _status.mode='normal'; - if(lib.configOL.separatism) _status.separatism=true; + "step 1"; + if (_status.connectMode) { + _status.mode = lib.configOL.guozhan_mode; + if (!["normal", "yingbian", "old"].includes(_status.mode)) _status.mode = "normal"; + if (lib.configOL.separatism) _status.separatism = true; //决定牌堆 - switch(_status.mode){ - case 'old':lib.card.list=lib.guozhanPile_old.slice(0);break; - case 'yingbian': - lib.card.list=lib.guozhanPile_yingbian.slice(0); + switch (_status.mode) { + case "old": + lib.card.list = lib.guozhanPile_old.slice(0); + break; + case "yingbian": + lib.card.list = lib.guozhanPile_yingbian.slice(0); delete lib.translate.shuiyanqijunx_info_guozhan; break; - default:lib.card.list=lib.guozhanPile.slice(0);break; + default: + lib.card.list = lib.guozhanPile.slice(0); + break; } - game.fixedPile=true; - game.broadcastAll((mode,separatism)=>{ - _status.mode=mode; - if(separatism) _status.separatism=true; - var pack=lib.characterPack.mode_guozhan; - if(mode=='yingbian'){ - delete lib.translate.shuiyanqijunx_info_guozhan; - const pack2=lib.yingbian_guozhan; - for(const i in pack2){ - if(!pack2[i][4]) pack2[i][4]=[]; - pack[i]=pack2[i]; - } - } - for(var i=0;ilib.group.includes(group)||group=='key'||group.startsWith('gzgroup:')); - if(group){ - if(group.startsWith('gzgroup:')) lib.character[i][1]=group.slice(8); - else lib.character[i][1]=group; - } - else lib.character[i][1]='qun'; + game.fixedPile = true; + game.broadcastAll( + (mode, separatism) => { + _status.mode = mode; + if (separatism) _status.separatism = true; + var pack = lib.characterPack.mode_guozhan; + if (mode == "yingbian") { + delete lib.translate.shuiyanqijunx_info_guozhan; + const pack2 = lib.yingbian_guozhan; + for (const i in pack2) { + if (!pack2[i][4]) pack2[i][4] = []; + pack[i] = pack2[i]; } - else lib.character[i][1]='qun'; } - } - //lib.characterReplace={}; - },_status.mode,_status.separatism); + for (var i = 0; i < game.players.length; i++) { + game.players[i].node.name.hide(); + game.players[i].node.name2.hide(); + } + for (var i in pack) { + lib.character[i] = pack[i]; + if (!lib.character[i][4]) { + lib.character[i][4] = []; + } + if (!lib.translate[i]) { + lib.translate[i] = lib.translate[i.slice(3)]; + } + } + for (var i in lib.character) { + if (lib.character[i][1] == "shen") { + if (lib.character[i][4]) { + var group = lib.character[i][4].find( + (group) => + lib.group.includes(group) || + group == "key" || + group.startsWith("gzgroup:") + ); + if (group) { + if (group.startsWith("gzgroup:")) + lib.character[i][1] = group.slice(8); + else lib.character[i][1] = group; + } else lib.character[i][1] = "qun"; + } else lib.character[i][1] = "qun"; + } + } + //lib.characterReplace={}; + }, + _status.mode, + _status.separatism + ); game.randomMapOL(); - } - else{ + } else { //lib.characterReplace={}; - for(var i=0;i{ - if(_status.connectMode) return true; - return get.type(card)=='basic'&&lib.filter.cardDiscardable(card,player); - }); + fakexiaoguo: { + audio: "xiaoguo", + trigger: { global: "phaseZhunbeiBegin" }, + filter(event, player) { + return ( + event.player != player && + player.countCards("h", (card) => { + if (_status.connectMode) return true; + return get.type(card) == "basic" && lib.filter.cardDiscardable(card, player); + }) + ); }, - async cost(event,trigger,player){ - event.result=await player.chooseToDiscard(get.prompt2('fakexiaoguo',trigger.player),(card,player)=>{ - return get.type(card)=='basic'; - },[1,Infinity]).set('complexSelect',true).set('ai',card=>{ - const player=get.event('player'),target=get.event().getTrigger().player; - const effect=get.damageEffect(target,player,player); - const cards=target.getCards('e',card=>get.attitude(player,target)*get.value(card,target)<0); - if(effect<=0&&!cards.length) return 0; - if(ui.selected.cards.length>cards.length-(effect<=0?1:0)) return 0; - return 1/(get.value(card)||0.5); - }).set('logSkill',['fakexiaoguo',trigger.player]).setHiddenSkill('fakexiaoguo').forResult(); + async cost(event, trigger, player) { + event.result = await player + .chooseToDiscard( + get.prompt2("fakexiaoguo", trigger.player), + (card, player) => { + return get.type(card) == "basic"; + }, + [1, Infinity] + ) + .set("complexSelect", true) + .set("ai", (card) => { + const player = get.event("player"), + target = get.event().getTrigger().player; + const effect = get.damageEffect(target, player, player); + const cards = target.getCards( + "e", + (card) => get.attitude(player, target) * get.value(card, target) < 0 + ); + if (effect <= 0 && !cards.length) return 0; + if (ui.selected.cards.length > cards.length - (effect <= 0 ? 1 : 0)) return 0; + return 1 / (get.value(card) || 0.5); + }) + .set("logSkill", ["fakexiaoguo", trigger.player]) + .setHiddenSkill("fakexiaoguo") + .forResult(); }, - popup:false, - preHidden:true, - async content(event,trigger,player){ - const num=trigger.player.countCards('e'),num2=event.cards.length; - await player.discardPlayerCard(trigger.player,'e',num2,true); - if(num2>num) await trigger.player.damage(); + popup: false, + preHidden: true, + async content(event, trigger, player) { + const num = trigger.player.countCards("e"), + num2 = event.cards.length; + await player.discardPlayerCard(trigger.player, "e", num2, true); + if (num2 > num) await trigger.player.damage(); }, }, - fakeduanbing:{ - audio:'duanbing', - inherit:'reduanbing', - preHidden:['fakeduanbing_sha'], - group:['fakeduanbing_sha'], - get content(){ - let content=get.info('reduanbing').content; - content=content.toString().replaceAll('reduanbing','fakeduanbing'); - content=new Function('return '+content)(); + fakeduanbing: { + audio: "duanbing", + inherit: "reduanbing", + preHidden: ["fakeduanbing_sha"], + group: ["fakeduanbing_sha"], + get content() { + let content = get.info("reduanbing").content; + content = content.toString().replaceAll("reduanbing", "fakeduanbing"); + content = new Function("return " + content)(); delete this.content; - this.content=content; + this.content = content; return content; }, - subSkill:{ - sha:{ - audio:'duanbing', - trigger:{player:'useCardToPlayered'}, - filter(event,player){ - return event.card.name=='sha'&&!event.getParent().directHit.includes(event.target)&&event.targets.length==1; + subSkill: { + sha: { + audio: "duanbing", + trigger: { player: "useCardToPlayered" }, + filter(event, player) { + return ( + event.card.name == "sha" && + !event.getParent().directHit.includes(event.target) && + event.targets.length == 1 + ); }, - forced:true, - logTarget:'target', - content(){ - var id=trigger.target.playerid; - var map=trigger.getParent().customArgs; - if(!map[id]) map[id]={}; - if(typeof map[id].shanRequired=='number') map[id].shanRequired++; - else map[id].shanRequired=2; + forced: true, + logTarget: "target", + content() { + var id = trigger.target.playerid; + var map = trigger.getParent().customArgs; + if (!map[id]) map[id] = {}; + if (typeof map[id].shanRequired == "number") map[id].shanRequired++; + else map[id].shanRequired = 2; }, - ai:{ - directHit_ai:true, - skillTagFilter(player,tag,arg){ - if(!arg||!arg.card||!arg.target||arg.card.name!='sha'||arg.target.countCards('h','shan')>1||get.distance(player,arg.target)>1) return false; + ai: { + directHit_ai: true, + skillTagFilter(player, tag, arg) { + if ( + !arg || + !arg.card || + !arg.target || + arg.card.name != "sha" || + arg.target.countCards("h", "shan") > 1 || + get.distance(player, arg.target) > 1 + ) + return false; }, }, }, }, }, - fakeduoshi:{ - audio:'duoshi', - global:'fakeduoshi_global', - subSkill:{ - global:{ - audio:'duoshi', - forceaudio:true, - enable:'chooseToUse', - filter(event,player){ - const info=get.info('fakeduoshi').subSkill.global; - return game.hasPlayer(target=>{ - return info.filterTarget(null,player,target); - })&&player.countCards('hs',card=>{ - return info.filterCard(card,player); - }); + fakeduoshi: { + audio: "duoshi", + global: "fakeduoshi_global", + subSkill: { + global: { + audio: "duoshi", + forceaudio: true, + enable: "chooseToUse", + filter(event, player) { + const info = get.info("fakeduoshi").subSkill.global; + return ( + game.hasPlayer((target) => { + return info.filterTarget(null, player, target); + }) && + player.countCards("hs", (card) => { + return info.filterCard(card, player); + }) + ); }, - filterTarget(card,player,target){ - return target.hasSkill('fakeduoshi')&&!target.isTempBanned('fakeduoshi')&&target.isFriendOf(player); + filterTarget(card, player, target) { + return ( + target.hasSkill("fakeduoshi") && + !target.isTempBanned("fakeduoshi") && + target.isFriendOf(player) + ); }, - filterCard(card,player){ - if(!game.checkMod(card,player,'unchanged','cardEnabled2',player)) return false; - return get.color(card)=='red'&&player.hasUseTarget(get.autoViewAs({name:'yiyi'},[card])); + filterCard(card, player) { + if (!game.checkMod(card, player, "unchanged", "cardEnabled2", player)) + return false; + return ( + get.color(card) == "red" && + player.hasUseTarget(get.autoViewAs({ name: "yiyi" }, [card])) + ); }, - discard:false, - lose:false, - delay:false, - line:false, - prompt:'选择一张红色手牌当作【以逸待劳】使用,并选择一名拥有【度势】的角色', - async content(event,trigger,player){ - const target=event.target; - target.tempBanSkill('fakeduoshi','roundStart',false); - let {result}=await player.chooseUseTarget(true,{name:'yiyi'},event.cards); - if(result.bool&&result.targets.length&&target.isNotMajor()){ - const num=result.targets.length,str='将'+get.cnNumber(num)+'张手牌当作不可被响应的【火烧连营】使用?'; - const {result:{bool,targets}}=await player.chooseTarget('是否令一名友方角色'+str,(card,player,target)=>{ - return target.isFriendOf(player)&&target.countCards('h',card=>{ - if(!target.hasUseTarget(get.autoViewAs({name:'huoshaolianying'},[card]))) return false; - return target!=player||game.checkMod(card,player,'unchanged','cardEnabled2',player); - })>=get.event('num'); - }).set('num',num).set('ai',target=>{ - return target.getUseValue(new lib.element.VCard({name:'huoshaolianying'})); - }); - if(bool){ - player.line(targets[0]); - game.broadcastAll(num=>{ - lib.skill.fakeduoshi_backup.selectCard=num; - lib.skill.fakeduoshi.subSkill.backup.selectCard=num; - },num); - await targets[0].chooseToUse() - .set('openskilldialog','度势:是否'+str) - .set('norestore',true) - .set('_backupevent','fakeduoshi_backup') - .set('custom',{ - add:{}, - replace:{window:function(){}} + discard: false, + lose: false, + delay: false, + line: false, + prompt: "选择一张红色手牌当作【以逸待劳】使用,并选择一名拥有【度势】的角色", + async content(event, trigger, player) { + const target = event.target; + target.tempBanSkill("fakeduoshi", "roundStart", false); + let { result } = await player.chooseUseTarget( + true, + { name: "yiyi" }, + event.cards + ); + if (result.bool && result.targets.length && target.isNotMajor()) { + const num = result.targets.length, + str = + "将" + get.cnNumber(num) + "张手牌当作不可被响应的【火烧连营】使用?"; + const { + result: { bool, targets }, + } = await player + .chooseTarget("是否令一名友方角色" + str, (card, player, target) => { + return ( + target.isFriendOf(player) && + target.countCards("h", (card) => { + if ( + !target.hasUseTarget( + get.autoViewAs({ name: "huoshaolianying" }, [card]) + ) + ) + return false; + return ( + target != player || + game.checkMod( + card, + player, + "unchanged", + "cardEnabled2", + player + ) + ); + }) >= get.event("num") + ); }) - .set('addCount',false) - .set('oncard',()=>_status.event.directHit.addArray(game.players)) - .backup('fakeduoshi_backup'); + .set("num", num) + .set("ai", (target) => { + return target.getUseValue( + new lib.element.VCard({ name: "huoshaolianying" }) + ); + }); + if (bool) { + player.line(targets[0]); + game.broadcastAll((num) => { + lib.skill.fakeduoshi_backup.selectCard = num; + lib.skill.fakeduoshi.subSkill.backup.selectCard = num; + }, num); + await targets[0] + .chooseToUse() + .set("openskilldialog", "度势:是否" + str) + .set("norestore", true) + .set("_backupevent", "fakeduoshi_backup") + .set("custom", { + add: {}, + replace: { window: function () {} }, + }) + .set("addCount", false) + .set("oncard", () => _status.event.directHit.addArray(game.players)) + .backup("fakeduoshi_backup"); } } }, - ai:{ - order(item,player){ - const card=new lib.element.VCard({name:'huoshaolianying'}); - return get.order(card,player)+0.1; + ai: { + order(item, player) { + const card = new lib.element.VCard({ name: "huoshaolianying" }); + return get.order(card, player) + 0.1; }, - result:{target:1}, + result: { target: 1 }, }, }, - backup:{ - filterCard:true, - position:'hs', - check(card){ - return 7-get.value(card); + backup: { + filterCard: true, + position: "hs", + check(card) { + return 7 - get.value(card); }, - log:false, - viewAs:{name:'huoshaolianying'}, - precontent(){ + log: false, + viewAs: { name: "huoshaolianying" }, + precontent() { delete event.result.skill; }, }, }, }, - fakehanzhan:{ - audio:'hanzhan', - trigger:{ - player:['chooseToCompareAfter','compareMultipleAfter'], - target:['chooseToCompareAfter','compareMultipleAfter'], + fakehanzhan: { + audio: "hanzhan", + trigger: { + player: ["chooseToCompareAfter", "compareMultipleAfter"], + target: ["chooseToCompareAfter", "compareMultipleAfter"], }, - filter(event,player){ - if(event.preserve) return false; - const list=[event.player,event.target]; - const targets=list.slice().filter(i=>(event.num1-event.num2)*get.sgn(0.5-list.indexOf(i))<=0); - return targets.some(i=>i.countGainableCards(list[1-list.indexOf(i)],'e')); + filter(event, player) { + if (event.preserve) return false; + const list = [event.player, event.target]; + const targets = list + .slice() + .filter((i) => (event.num1 - event.num2) * get.sgn(0.5 - list.indexOf(i)) <= 0); + return targets.some((i) => i.countGainableCards(list[1 - list.indexOf(i)], "e")); }, - async cost(event,trigger,player){ - let users=[]; - const list=[event.player,event.target]; - let targets=list.slice().filter(i=>(event.num1-event.num2)*get.sgn(0.5-list.indexOf(i))<=0); - targets=targets.filter(i=>i.countGainableCards(list[1-list.indexOf(i)],'e')).sortBySeat(player); - for(const i of targets){ - const aim=list[1-list.indexOf(i)]; - const {result:{bool}}=await i.chooseBool(get.prompt('fakehanzhan'),'获得'+get.translation(aim)+'装备区的一张牌').set('choice',target.hasCard(card=>{ - return get.value(card,aim)*get.attitude(i,aim)<0; - },'e')); - if(bool) users.push(i); + async cost(event, trigger, player) { + let users = []; + const list = [event.player, event.target]; + let targets = list + .slice() + .filter((i) => (event.num1 - event.num2) * get.sgn(0.5 - list.indexOf(i)) <= 0); + targets = targets + .filter((i) => i.countGainableCards(list[1 - list.indexOf(i)], "e")) + .sortBySeat(player); + for (const i of targets) { + const aim = list[1 - list.indexOf(i)]; + const { + result: { bool }, + } = await i + .chooseBool( + get.prompt("fakehanzhan"), + "获得" + get.translation(aim) + "装备区的一张牌" + ) + .set( + "choice", + target.hasCard((card) => { + return get.value(card, aim) * get.attitude(i, aim) < 0; + }, "e") + ); + if (bool) users.push(i); } - event.result={bool:Boolean(users.length),targets:users}; + event.result = { bool: Boolean(users.length), targets: users }; }, - async content(event,trigger,player){ - const list=[trigger.player,trigger.target]; - let targets=list.slice().filter(i=>(trigger.num1-trigger.num2)*get.sgn(0.5-list.indexOf(i))<=0); - targets=targets.filter(i=>i.countGainableCards(list[1-list.indexOf(i)],'e')&&event.targets.includes(i)).sortBySeat(player); - for(const i of targets){ - const aim=list[1-list.indexOf(i)]; - await i.gainPlayerCard(aim,'e',true); + async content(event, trigger, player) { + const list = [trigger.player, trigger.target]; + let targets = list + .slice() + .filter((i) => (trigger.num1 - trigger.num2) * get.sgn(0.5 - list.indexOf(i)) <= 0); + targets = targets + .filter( + (i) => + i.countGainableCards(list[1 - list.indexOf(i)], "e") && + event.targets.includes(i) + ) + .sortBySeat(player); + for (const i of targets) { + const aim = list[1 - list.indexOf(i)]; + await i.gainPlayerCard(aim, "e", true); } }, }, - fakeshuangxiong:{ - audio:'shuangxiong', - subfrequent:['tiandu'], - group:['fakeshuangxiong_effect','fakeshuangxiong_tiandu'], - subSkill:{ - effect:{ - audio:'shuangxiong1', - inherit:'shuangxiong1', - content(){ - player.judge().set('callback',get.info('fakeshuangxiong').subSkill.effect.callback); + fakeshuangxiong: { + audio: "shuangxiong", + subfrequent: ["tiandu"], + group: ["fakeshuangxiong_effect", "fakeshuangxiong_tiandu"], + subSkill: { + effect: { + audio: "shuangxiong1", + inherit: "shuangxiong1", + content() { + player + .judge() + .set("callback", get.info("fakeshuangxiong").subSkill.effect.callback); trigger.changeToZero(); }, - callback(){ - player.addTempSkill('shuangxiong2'); - player.markAuto('shuangxiong2',[event.judgeResult.color]); + callback() { + player.addTempSkill("shuangxiong2"); + player.markAuto("shuangxiong2", [event.judgeResult.color]); }, }, - tiandu:{ - audio:'shuangxiong', - inherit:'tiandu', - filter(event,player){ - return _status.currentPhase==player&&get.info('tiandu').filter(event,player); + tiandu: { + audio: "shuangxiong", + inherit: "tiandu", + filter(event, player) { + return _status.currentPhase == player && get.info("tiandu").filter(event, player); }, }, }, }, - fakeyicheng:{ - audio:'yicheng', - inherit:'yicheng', - async content(event,trigger,player){ - const target=trigger.target; + fakeyicheng: { + audio: "yicheng", + inherit: "yicheng", + async content(event, trigger, player) { + const target = trigger.target; await target.draw(); - await target.chooseToUse(function(card){ - if(get.type(card)!='equip') return false; - return lib.filter.cardEnabled(card,_status.event.player,_status.event); - },'疑城:是否使用装备牌?'); - if(!target.storage.fakeyicheng){ - target.when({global:'phaseEnd'}).then(()=>{ - player.chooseToDiscard('he',player.countMark('fakeyicheng'),true); + await target.chooseToUse(function (card) { + if (get.type(card) != "equip") return false; + return lib.filter.cardEnabled(card, _status.event.player, _status.event); + }, "疑城:是否使用装备牌?"); + if (!target.storage.fakeyicheng) { + target.when({ global: "phaseEnd" }).then(() => { + player.chooseToDiscard("he", player.countMark("fakeyicheng"), true); delete player.storage.fakeyicheng; }); } - target.addMark('fakeyicheng',1,false); + target.addMark("fakeyicheng", 1, false); }, }, - fakefenming:{ - audio:'fenming', - enable:'phaseUse', - filter(event,player){ + fakefenming: { + audio: "fenming", + enable: "phaseUse", + filter(event, player) { return player.isLinked(); }, - filterTarget(card,player,target){ + filterTarget(card, player, target) { return target.isLinked(); }, - selectTarget:-1, - usable:1, - multiline:true, - multitarget:true, - async content(event,trigger,player){ - for(const target of event.targets){ - if(player==target) await player.chooseToDiscard(true,'he'); - else await player.discardPlayerCard(true,'he',target); + selectTarget: -1, + usable: 1, + multiline: true, + multitarget: true, + async content(event, trigger, player) { + for (const target of event.targets) { + if (player == target) await player.chooseToDiscard(true, "he"); + else await player.discardPlayerCard(true, "he", target); } }, - ai:{ - order(item,player){ - return get.order({name:'sha'},player)+0.1; + ai: { + order(item, player) { + return get.order({ name: "sha" }, player) + 0.1; }, - result:{ - target(player,target){ - return get.sgn(get.attitude(player,target))*get.effect(target,{name:'guohe_copy2'},player,player); + result: { + target(player, target) { + return ( + get.sgn(get.attitude(player, target)) * + get.effect(target, { name: "guohe_copy2" }, player, player) + ); }, }, }, }, - fakebaoling:{ - audio:'baoling', - inherit:'baoling', - init(player){ - player.checkMainSkill('fakebaoling'); + fakebaoling: { + audio: "baoling", + inherit: "baoling", + init(player) { + player.checkMainSkill("fakebaoling"); }, - content(){ - 'step 0' + content() { + "step 0"; player.removeCharacter(1); - 'step 1' + "step 1"; player.gainMaxHp(3); player.recover(3); - 'step 2' - player.addSkills('fakebenghuai'); + "step 2"; + player.addSkills("fakebenghuai"); }, - derivation:'fakebenghuai', + derivation: "fakebenghuai", }, - fakebenghuai:{ - audio:'benghuai', - inherit:'benghuai', - async content(event,trigger,player){ - const {result:{control}}=await player.chooseControl('体力','上限','背水!').set('prompt','崩坏:请选择一项').set('choiceList',[ - '失去1点体力','减1点体力上限','背水!依次执行前两项,然后执行一个额外的摸牌阶段', - ]).set('ai',()=>{ - const player=get.event('player'); - if(player.maxHp>1&&(player.getHp()==2||!player.countCards('h'))) return '背水!'; - return player.isDamaged()?'上限':'体力'; - }); + fakebenghuai: { + audio: "benghuai", + inherit: "benghuai", + async content(event, trigger, player) { + const { + result: { control }, + } = await player + .chooseControl("体力", "上限", "背水!") + .set("prompt", "崩坏:请选择一项") + .set("choiceList", [ + "失去1点体力", + "减1点体力上限", + "背水!依次执行前两项,然后执行一个额外的摸牌阶段", + ]) + .set("ai", () => { + const player = get.event("player"); + if (player.maxHp > 1 && (player.getHp() == 2 || !player.countCards("h"))) + return "背水!"; + return player.isDamaged() ? "上限" : "体力"; + }); player.popup(control); - game.log(player,'选择了','#g'+control); - if(control!='上限') await player.loseHp(); - if(control!='体力') await player.loseMaxHp(); - if(control=='背水!'){ - const next=player.phaseDraw(); + game.log(player, "选择了", "#g" + control); + if (control != "上限") await player.loseHp(); + if (control != "体力") await player.loseMaxHp(); + if (control == "背水!") { + const next = player.phaseDraw(); event.next.remove(next); trigger.getParent().next.push(next); } }, }, - fakediaodu:{ - audio:'diaodu', - inherit:'xindiaodu', - group:'fakediaodu_use', - get content(){ - let content=get.info('xindiaodu').content; - content=content.toString().replaceAll('xindiaodu','fakediaodu'); - content=new Function('return '+content)(); + fakediaodu: { + audio: "diaodu", + inherit: "xindiaodu", + group: "fakediaodu_use", + get content() { + let content = get.info("xindiaodu").content; + content = content.toString().replaceAll("xindiaodu", "fakediaodu"); + content = new Function("return " + content)(); delete this.content; - this.content=content; + this.content = content; return content; }, - subSkill:{ - use:{ - trigger:{global:'useCard'}, - filter(event,player){ - if(!lib.skill.xindiaodu.isFriendOf(player,event.player)||!(event.targets||[]).includes(player)) return false; - return (player==event.player||player.hasSkill('fakediaodu'))&&!event.player.getStorage('fakediaodu_temp').includes(get.type2(event.card)); + subSkill: { + use: { + trigger: { global: "useCard" }, + filter(event, player) { + if ( + !lib.skill.xindiaodu.isFriendOf(player, event.player) || + !(event.targets || []).includes(player) + ) + return false; + return ( + (player == event.player || player.hasSkill("fakediaodu")) && + !event.player.getStorage("fakediaodu_temp").includes(get.type2(event.card)) + ); }, - direct:true, - async content(event,trigger,player){ - const target=trigger.target,next=await target.chooseBool(get.prompt('fakediaodu'),'摸一张牌?'); - if(player.hasSkill('fakediaodu')) next.set('frequentSkill','fakediaodu'); - if(player==trigger.player) next.setHiddenSkill('fakediaodu'); - const {result:{bool}}=next; - if(bool){ - player.logSkill('fakediaodu',target); - target.draw('nodelay'); - target.addTempSkill('fakediaodu_temp'); - target.markAuto('fakediaodu_temp',[get.type2(trigger.card)]); + direct: true, + async content(event, trigger, player) { + const target = trigger.target, + next = await target.chooseBool(get.prompt("fakediaodu"), "摸一张牌?"); + if (player.hasSkill("fakediaodu")) next.set("frequentSkill", "fakediaodu"); + if (player == trigger.player) next.setHiddenSkill("fakediaodu"); + const { + result: { bool }, + } = next; + if (bool) { + player.logSkill("fakediaodu", target); + target.draw("nodelay"); + target.addTempSkill("fakediaodu_temp"); + target.markAuto("fakediaodu_temp", [get.type2(trigger.card)]); } }, }, - temp:{ - charlotte:true, - onremove:true, + temp: { + charlotte: true, + onremove: true, }, }, }, - fakeyigui:{ - audio:'yigui', - hiddenCard(player,name){ - if(['shan','wuxie'].includes(name)||!['basic','trick'].includes(get.type(name))) return false; - return lib.inpile.includes(name)&&player.getStorage('fakeyigui').length&&!player.getStorage('fakeyigui2').includes(get.type2(name)); + fakeyigui: { + audio: "yigui", + hiddenCard(player, name) { + if (["shan", "wuxie"].includes(name) || !["basic", "trick"].includes(get.type(name))) + return false; + return ( + lib.inpile.includes(name) && + player.getStorage("fakeyigui").length && + !player.getStorage("fakeyigui2").includes(get.type2(name)) + ); }, - enable:'chooseToUse', - filter(event,player){ - if(event.type=='wuxie'||event.type=='respondShan') return false; - const storage=player.getStorage('fakeyigui'),storage2=player.getStorage('fakeyigui2'); - if(!storage.length||storage2.length>1) return false; - if(event.type=='dying'){ - if(storage2.includes('basic')) return false; - if(!event.filterCard({name:'tao'},player,event)&&!event.filterCard({name:'jiu'},player,event)) return false; - const target=event.dying; - return target.identity=='unknown'||target.identity=='ye'||storage.some(i=>{ - var group=get.character(i,1); - if(group=='ye'||target.identity==group) return true; - var double=get.is.double(i,true); - if(double&&double.includes(target.identity)) return true; - }); + enable: "chooseToUse", + filter(event, player) { + if (event.type == "wuxie" || event.type == "respondShan") return false; + const storage = player.getStorage("fakeyigui"), + storage2 = player.getStorage("fakeyigui2"); + if (!storage.length || storage2.length > 1) return false; + if (event.type == "dying") { + if (storage2.includes("basic")) return false; + if ( + !event.filterCard({ name: "tao" }, player, event) && + !event.filterCard({ name: "jiu" }, player, event) + ) + return false; + const target = event.dying; + return ( + target.identity == "unknown" || + target.identity == "ye" || + storage.some((i) => { + var group = get.character(i, 1); + if (group == "ye" || target.identity == group) return true; + var double = get.is.double(i, true); + if (double && double.includes(target.identity)) return true; + }) + ); } - return get.inpileVCardList(info=>{ - const name=info[2]; - if(storage2.includes(get.type(name))) return false; - return get.type(name)=='basic'||get.type(name)=='trick'; - }).some(cardx=>{ - const card={name:cardx[2],nature:cardx[3]},info=get.info(card); - return storage.some(character=>{ - if(!lib.filter.filterCard(card,player,event)) return false; - if(event.filterCard&&!event.filterCard(card,player,event)) return false; - const group=get.character(character,1),double=get.is.double(character,true); - if(info.changeTarget){ - const list=game.filterPlayer(current=>player.canUse(card,current)); - for(let i=0;i { + const name = info[2]; + if (storage2.includes(get.type(name))) return false; + return get.type(name) == "basic" || get.type(name) == "trick"; + }) + .some((cardx) => { + const card = { name: cardx[2], nature: cardx[3] }, + info = get.info(card); + return storage.some((character) => { + if (!lib.filter.filterCard(card, player, event)) return false; + if (event.filterCard && !event.filterCard(card, player, event)) return false; + const group = get.character(character, 1), + double = get.is.double(character, true); + if (info.changeTarget) { + const list = game.filterPlayer((current) => player.canUse(card, current)); + for (let i = 0; i < list.length; i++) { + let giveup = false, + targets = [list[i]]; + info.changeTarget(player, targets); + for (let j = 0; j < targets.length; j++) { + if ( + group != "ye" && + targets[j].identity != "unknown" && + targets[j].identity != "ye" && + targets[j].identity != group && + (!double || !double.includes(targets[j].identity)) + ) { + giveup = true; + break; + } } + if (giveup) continue; + if (!giveup) return true; } - if(giveup) continue; - if(!giveup) return true; + return false; } - return false; - } - return game.hasPlayer(current=>{ - return event.filterTarget(card,player,current)&&(group=='ye'||current.identity=='unknown'||current.identity=='ye'||current.identity==group||(double&&double.includes(current.identity))); + return game.hasPlayer((current) => { + return ( + event.filterTarget(card, player, current) && + (group == "ye" || + current.identity == "unknown" || + current.identity == "ye" || + current.identity == group || + (double && double.includes(current.identity))) + ); + }); }); }); - }); }, - chooseButton:{ - select:2, - dialog(event,player){ - var dialog=ui.create.dialog('役鬼','hidden'); - dialog.add([player.getStorage('fakeyigui'),'character']); - const list=get.inpileVCardList(info=>{ - const name=info[2]; - if(player.getStorage('fakeyigui2').includes(get.type(name))) return false; - return get.type(name)=='basic'||get.type(name)=='trick'; + chooseButton: { + select: 2, + dialog(event, player) { + var dialog = ui.create.dialog("役鬼", "hidden"); + dialog.add([player.getStorage("fakeyigui"), "character"]); + const list = get.inpileVCardList((info) => { + const name = info[2]; + if (player.getStorage("fakeyigui2").includes(get.type(name))) return false; + return get.type(name) == "basic" || get.type(name) == "trick"; }); - dialog.add([list,'vcard']); + dialog.add([list, "vcard"]); return dialog; }, - filter(button,player){ - var evt=_status.event.getParent('chooseToUse'); - if(!ui.selected.buttons.length){ - if(typeof button.link!='string') return false; - if(evt.type=='dying'){ - if(evt.dying.identity=='unknown'||evt.dying.identity=='ye') return true; - var double=get.is.double(button.link,true); - return evt.dying.identity==lib.character[button.link][1]||lib.character[button.link][1]=='ye'||(double&&double.includes(evt.dying.identity)); + filter(button, player) { + var evt = _status.event.getParent("chooseToUse"); + if (!ui.selected.buttons.length) { + if (typeof button.link != "string") return false; + if (evt.type == "dying") { + if (evt.dying.identity == "unknown" || evt.dying.identity == "ye") + return true; + var double = get.is.double(button.link, true); + return ( + evt.dying.identity == lib.character[button.link][1] || + lib.character[button.link][1] == "ye" || + (double && double.includes(evt.dying.identity)) + ); } return true; - } - else{ - if(typeof ui.selected.buttons[0].link!='string') return false; - if(typeof button.link!='object') return false; - var name=button.link[2]; - if(player.getStorage('fakeyigui2').includes(get.type(name))) return false; - var card={name:name}; - if(button.link[3]) card.nature=button.link[3]; - var info=get.info(card); - var group=lib.character[ui.selected.buttons[0].link][1]; - var double=get.is.double(ui.selected.buttons[0].link,true); - if(evt.type=='dying') return evt.filterCard(card,player,evt); - if(!lib.filter.filterCard(card,player,evt)) return false; - else if(evt.filterCard&&!evt.filterCard(card,player,evt)) return false; - if(info.changeTarget){ - var list=game.filterPlayer(function(current){ - return player.canUse(card,current); + } else { + if (typeof ui.selected.buttons[0].link != "string") return false; + if (typeof button.link != "object") return false; + var name = button.link[2]; + if (player.getStorage("fakeyigui2").includes(get.type(name))) return false; + var card = { name: name }; + if (button.link[3]) card.nature = button.link[3]; + var info = get.info(card); + var group = lib.character[ui.selected.buttons[0].link][1]; + var double = get.is.double(ui.selected.buttons[0].link, true); + if (evt.type == "dying") return evt.filterCard(card, player, evt); + if (!lib.filter.filterCard(card, player, evt)) return false; + else if (evt.filterCard && !evt.filterCard(card, player, evt)) return false; + if (info.changeTarget) { + var list = game.filterPlayer(function (current) { + return player.canUse(card, current); }); - for(var i=0;i1) return (1.7+Math.random())*Math.max(num,1); + if (num <= 0) return 0; + if (list.length > 1) return (1.7 + Math.random()) * Math.max(num, 1); } } - return 1+Math.random(); + return 1 + Math.random(); }, - backup(links,player){ - var name=links[1][2],nature=links[1][3]||null; - var character=links[0],group=lib.character[character][1]; - var next={ - character:character, - group:group, - filterCard:()=>false, - selectCard:-1, - popname:true, - audio:'yigui', - viewAs:{ - name:name, - nature:nature, - isCard:true, + backup(links, player) { + var name = links[1][2], + nature = links[1][3] || null; + var character = links[0], + group = lib.character[character][1]; + var next = { + character: character, + group: group, + filterCard: () => false, + selectCard: -1, + popname: true, + audio: "yigui", + viewAs: { + name: name, + nature: nature, + isCard: true, }, - filterTarget(card,player,target){ - var xx=lib.skill.fakeyigui_backup; - var evt=_status.event; - var group=xx.group; - var double=get.is.double(xx.character,true); - var info=get.info(card); - if((!(info.singleCard&&ui.selected.targets.length))&&group!='ye'&&target.identity!='unknown'&&target.identity!='ye'&&target.identity!=group&&(!double||!double.includes(target.identity))) return false; - if(info.changeTarget){ - var targets=[target]; - info.changeTarget(player,targets); - for(var i=0;idelete player.storage.fakeyigui2); + game.log(player, "移除了", "#g“魂”", "#y" + get.translation(character)); + if (!player.storage.fakeyigui2) { + player + .when({ global: "phaseBefore" }) + .then(() => delete player.storage.fakeyigui2); } - player.markAuto('fakeyigui2',[get.type(result.card.name)]); + player.markAuto("fakeyigui2", [get.type(result.card.name)]); }, }; return next; }, - prompt(links,player){ - var name=links[1][2],character=links[0],nature=links[1][3]; - return '移除「'+get.translation(character)+'」并视为使用'+(get.translation(nature)||'')+get.translation(name); + prompt(links, player) { + var name = links[1][2], + character = links[0], + nature = links[1][3]; + return ( + "移除「" + + get.translation(character) + + "」并视为使用" + + (get.translation(nature) || "") + + get.translation(name) + ); }, }, - ai:{ - order:()=>1+10*Math.random(), - result:{player:1}, + ai: { + order: () => 1 + 10 * Math.random(), + result: { player: 1 }, }, - group:'fakeyigui_init', - marktext:'魂', - intro:{ - onunmark(storage){ + group: "fakeyigui_init", + marktext: "魂", + intro: { + onunmark(storage) { _status.characterlist.addArray(storage); - storage=[]; + storage = []; }, - mark(dialog,storage,player){ - if(storage&&storage.length){ - if(player.isUnderControl(true)) dialog.addSmall([storage,'character']); - else return '共有'+get.cnNumber(storage.length)+'张“魂”'; - } - else return '没有“魂”'; + mark(dialog, storage, player) { + if (storage && storage.length) { + if (player.isUnderControl(true)) dialog.addSmall([storage, "character"]); + else return "共有" + get.cnNumber(storage.length) + "张“魂”"; + } else return "没有“魂”"; }, - content(storage){ - return '共有'+get.cnNumber(storage.length)+'张“魂”'; + content(storage) { + return "共有" + get.cnNumber(storage.length) + "张“魂”"; }, }, - gainHun(player,num){ - const list=_status.characterlist.randomGets(num); - if(list.length){ + gainHun(player, num) { + const list = _status.characterlist.randomGets(num); + if (list.length) { _status.characterlist.removeArray(list); - player.markAuto('fakeyigui',list); - get.info('rehuashen').drawCharacter(player,list); - game.log(player,'获得了'+get.cnNumber(list.length)+'张','#g“魂”'); + player.markAuto("fakeyigui", list); + get.info("rehuashen").drawCharacter(player, list); + game.log(player, "获得了" + get.cnNumber(list.length) + "张", "#g“魂”"); } }, - subSkill:{ - backup:{}, - init:{ - audio:'fakeyigui', - trigger:{player:'showCharacterAfter'}, - filter(event,player){ - if(!event.toShow.some(i=>get.character(i,3).includes('fakeyigui'))) return false; - return game.getAllGlobalHistory('everything',evt=>{ - return evt.name=='showCharacter'&&evt.player==player&&evt.toShow.some(i=>get.character(i,3).includes('fakeyigui')); - },event).indexOf(event)==0; + subSkill: { + backup: {}, + init: { + audio: "fakeyigui", + trigger: { player: "showCharacterAfter" }, + filter(event, player) { + if (!event.toShow.some((i) => get.character(i, 3).includes("fakeyigui"))) + return false; + return ( + game + .getAllGlobalHistory( + "everything", + (evt) => { + return ( + evt.name == "showCharacter" && + evt.player == player && + evt.toShow.some((i) => + get.character(i, 3).includes("fakeyigui") + ) + ); + }, + event + ) + .indexOf(event) == 0 + ); }, - forced:true, - locked:false, - content(){ - get.info('fakeyigui').gainHun(player,2); + forced: true, + locked: false, + content() { + get.info("fakeyigui").gainHun(player, 2); }, }, }, }, - fakejihun:{ - audio:'jihun', - inherit:'jihun', - content(){ - get.info('fakeyigui').gainHun(player,1); + fakejihun: { + audio: "jihun", + inherit: "jihun", + content() { + get.info("fakeyigui").gainHun(player, 1); }, - ai:{combo:'fakeyigui'}, - group:'fakejihun_zhiheng', - subSkill:{ - zhiheng:{ - audio:'jihun', - trigger:{player:'phaseZhunbeiBegin'}, - filter(event,player){ - return player.getStorage('fakeyigui').length; + ai: { combo: "fakeyigui" }, + group: "fakejihun_zhiheng", + subSkill: { + zhiheng: { + audio: "jihun", + trigger: { player: "phaseZhunbeiBegin" }, + filter(event, player) { + return player.getStorage("fakeyigui").length; }, - async cost(event,trigger,player){ - const {result:{bool,links}}=await player.chooseButton([ - get.prompt('fakejihun'),'
    弃置至多两张“魂”,然后获得等量的“魂”
    ', - [player.getStorage('fakeyigui'),'character'], - ],[1,2]).set('ai',button=>{ - const getNum=(character)=>{ - return game.countPlayer(target=>{ - const group=get.character(character,1); - if(group=='ye'||target.identity==group) return true; - const double=get.is.double(character,true); - if(double&&double.includes(target.identity)) return true; - })+1; - }; - return game.countPlayer()-getNum(button.link); - }); - event.result={bool:bool,cost_data:links}; + async cost(event, trigger, player) { + const { + result: { bool, links }, + } = await player + .chooseButton( + [ + get.prompt("fakejihun"), + '
    弃置至多两张“魂”,然后获得等量的“魂”
    ', + [player.getStorage("fakeyigui"), "character"], + ], + [1, 2] + ) + .set("ai", (button) => { + const getNum = (character) => { + return ( + game.countPlayer((target) => { + const group = get.character(character, 1); + if (group == "ye" || target.identity == group) return true; + const double = get.is.double(character, true); + if (double && double.includes(target.identity)) return true; + }) + 1 + ); + }; + return game.countPlayer() - getNum(button.link); + }); + event.result = { bool: bool, cost_data: links }; }, - async content(event,trigger,player){ - player.unmarkAuto('fakeyigui',event.cost_data); + async content(event, trigger, player) { + player.unmarkAuto("fakeyigui", event.cost_data); _status.characterlist.addArray(event.cost_data); - game.log(player,'移除了'+get.cnNumber(event.cost_data.length)+'张','#g“魂”'); - get.info('fakeyigui').gainHun(player,event.cost_data.length); + game.log( + player, + "移除了" + get.cnNumber(event.cost_data.length) + "张", + "#g“魂”" + ); + get.info("fakeyigui").gainHun(player, event.cost_data.length); }, }, }, }, - fakejueyan:{ - mainSkill:true, - init(player){ - if(player.checkMainSkill('fakejueyan')) player.removeMaxHp(); + fakejueyan: { + mainSkill: true, + init(player) { + if (player.checkMainSkill("fakejueyan")) player.removeMaxHp(); }, - audio:'drlt_jueyan', - derivation:'fakejizhi', - trigger:{player:'phaseZhunbeiBegin'}, - async cost(event,trigger,player){ - const {result:{control}}=await player.chooseControl('判定区','装备区','手牌区','cancel2') - .set('prompt','###'+get.prompt('fakejueyan')+'###
    于本回合结束阶段弃置一个区域的所有牌,然后…
    ') - .set('choiceList',[ - '判定区:跳过判定阶段,获得〖集智〗直到回合结束', - '装备区:摸三张牌,本回合手牌上限+3', - '手牌区:本回合使用【杀】的额定次数+3', - ]).set('ai',()=>{ - const player=get.event('player'); - if(player.countCards('j',{type:'delay'})) return '判定区'; - if(player.countCards('h')<3) return '装备区'; - if(player.countCards('hs',card=>{ - return get.name(card)=='sha'&&player.hasUseTarget(card); - })>player.getCardUsable('sha')) return '手牌区'; - return '判定区'; - }); - event.result={bool:(control!='cancel2'),cost_data:control}; - }, - async content(event,trigger,player){ - const position={'判定区':'j','装备区':'e','手牌区':'h'}[event.cost_data]; - switch(position){ - case 'j': - player.skip('phaseJudge'); - player.addTempSkills('fakejizhi'); - break; - case 'e': - await player.draw(3); - player.addTempSkill('drlt_jueyan3'); - break; - case 'h': - player.addTempSkill('drlt_jueyan1'); - break; - } - player.when('phaseJieshuBegin').then(()=>{ - if(player.countCards(pos)) player.discard(player.getCards(pos)); - }).vars({pos:position}); - }, - }, - fakejizhi:{ - audio:'rejizhi', - audioname:['lukang'], - inherit:'jizhi', - }, - fakequanji:{ - audio:'gzquanji', - inherit:'gzquanji', - filter(event,player,name){ - return !player.hasHistory('useSkill',evt=>{ - return evt.skill=='fakequanji'&&evt.event.triggername==name; - }); - }, - content(){ - 'step 0' - const num=Math.max(1,Math.min(player.maxHp,player.getExpansions('fakequanji').length)); - event.num=num; - player.draw(num); - 'step 1' - var hs=player.getCards('he'); - if(hs.length>0){ - if(hs.length<=event.num) event._result={bool:true,cards:hs}; - else player.chooseCard('he',true,'选择'+get.cnNumber(event.num)+'张牌作为“权”',event.num); - } - else event.finish(); - 'step 2' - if(result.bool){ - var cs=result.cards; - player.addToExpansion(cs,player,'give').gaintag.add('fakequanji'); - } - }, - mod:{ - maxHandcard(player,num){ - return num+player.getExpansions('fakequanji').length; - }, - }, - }, - fakepaiyi:{ - audio:'gzpaiyi', - enable:'phaseUse', - filterTarget:true, - usable:1, - async content(event,trigger,player){ - const target=event.target; - const {result:{junling,targets}}=await player.chooseJunlingFor(target); - if(junling){ - const str=get.translation(player),num=get.cnNumber(player.getExpansions('fakequanji').length); - const {result:{index}}=await target.chooseJunlingControl(player,junling,targets).set('prompt','排异').set('choiceList',[ - '执行此军令,然后'+str+'摸'+num+'张牌并将一张“权”置入弃牌堆', - '不执行此军令,然后'+str+'可以对至多'+num+'名与你势力相同的角色各造成1点伤害并移去等量的“权”', - ]).set('ai',()=>{ - const all=player.getExpansions('fakequanji').length; - const effect=get.junlingEffect(player,junling,target,targets,target); - const eff1=(effect-get.effect(player,{name:'draw'},player,target)*all); - const eff2=((source,player,num)=>{ - let targets=game.filterPlayer(current=>{ - return current.isFriendOf(player)&&get.damageEffect(current,source,source)>0&&get.damageEffect(current,source,player)<0; - }).sort((a,b)=>{ - return (get.damageEffect(b,source,source)>0-get.damageEffect(b,source,player))-(get.damageEffect(a,source,source)>0-get.damageEffect(a,source,player)); - }).slice(0,num); - return targets.reduce((sum,target)=>{ - return sum+(get.damageEffect(target,source,source)-get.damageEffect(target,source,player))/2; - },0); - })(player,target,all); - return Math.max(0,get.sgn(eff1-eff2)); + audio: "drlt_jueyan", + derivation: "fakejizhi", + trigger: { player: "phaseZhunbeiBegin" }, + async cost(event, trigger, player) { + const { + result: { control }, + } = await player + .chooseControl("判定区", "装备区", "手牌区", "cancel2") + .set( + "prompt", + "###" + + get.prompt("fakejueyan") + + '###
    于本回合结束阶段弃置一个区域的所有牌,然后…
    ' + ) + .set("choiceList", [ + "判定区:跳过判定阶段,获得〖集智〗直到回合结束", + "装备区:摸三张牌,本回合手牌上限+3", + "手牌区:本回合使用【杀】的额定次数+3", + ]) + .set("ai", () => { + const player = get.event("player"); + if (player.countCards("j", { type: "delay" })) return "判定区"; + if (player.countCards("h") < 3) return "装备区"; + if ( + player.countCards("hs", (card) => { + return get.name(card) == "sha" && player.hasUseTarget(card); + }) > player.getCardUsable("sha") + ) + return "手牌区"; + return "判定区"; }); - const cards=player.getExpansions('fakequanji'); - if(index==0){ - await target.carryOutJunling(player,junling,targets); - if(cards.length){ - await player.draw(cards.length); - const {result:{bool,links}}=await player.chooseButton(['排异:请移去一张“权”',cards],true); - if(bool) await player.loseToDiscardpile(links); - } - } - else if(cards.length){ - const {result}=await player.chooseTarget('排异:是否对至多'+get.cnNumber(cards.length)+'名与'+get.translation(target)+'势力相同的角色各造成1点伤害并移去等量的“权”?',(card,player,target)=>{ - return target.isFriendOf(get.event('target')); - },[1,cards.length]).set('target',target).set('ai',target=>{ - return get.damageEffect(target,get.event('player'),get.event('player')); + event.result = { bool: control != "cancel2", cost_data: control }; + }, + async content(event, trigger, player) { + const position = { 判定区: "j", 装备区: "e", 手牌区: "h" }[event.cost_data]; + switch (position) { + case "j": + player.skip("phaseJudge"); + player.addTempSkills("fakejizhi"); + break; + case "e": + await player.draw(3); + player.addTempSkill("drlt_jueyan3"); + break; + case "h": + player.addTempSkill("drlt_jueyan1"); + break; + } + player + .when("phaseJieshuBegin") + .then(() => { + if (player.countCards(pos)) player.discard(player.getCards(pos)); + }) + .vars({ pos: position }); + }, + }, + fakejizhi: { + audio: "rejizhi", + audioname: ["lukang"], + inherit: "jizhi", + }, + fakequanji: { + audio: "gzquanji", + inherit: "gzquanji", + filter(event, player, name) { + return !player.hasHistory("useSkill", (evt) => { + return evt.skill == "fakequanji" && evt.event.triggername == name; + }); + }, + content() { + "step 0"; + const num = Math.max( + 1, + Math.min(player.maxHp, player.getExpansions("fakequanji").length) + ); + event.num = num; + player.draw(num); + "step 1"; + var hs = player.getCards("he"); + if (hs.length > 0) { + if (hs.length <= event.num) event._result = { bool: true, cards: hs }; + else + player.chooseCard( + "he", + true, + "选择" + get.cnNumber(event.num) + "张牌作为“权”", + event.num + ); + } else event.finish(); + "step 2"; + if (result.bool) { + var cs = result.cards; + player.addToExpansion(cs, player, "give").gaintag.add("fakequanji"); + } + }, + mod: { + maxHandcard(player, num) { + return num + player.getExpansions("fakequanji").length; + }, + }, + }, + fakepaiyi: { + audio: "gzpaiyi", + enable: "phaseUse", + filterTarget: true, + usable: 1, + async content(event, trigger, player) { + const target = event.target; + const { + result: { junling, targets }, + } = await player.chooseJunlingFor(target); + if (junling) { + const str = get.translation(player), + num = get.cnNumber(player.getExpansions("fakequanji").length); + const { + result: { index }, + } = await target + .chooseJunlingControl(player, junling, targets) + .set("prompt", "排异") + .set("choiceList", [ + "执行此军令,然后" + str + "摸" + num + "张牌并将一张“权”置入弃牌堆", + "不执行此军令,然后" + + str + + "可以对至多" + + num + + "名与你势力相同的角色各造成1点伤害并移去等量的“权”", + ]) + .set("ai", () => { + const all = player.getExpansions("fakequanji").length; + const effect = get.junlingEffect(player, junling, target, targets, target); + const eff1 = + effect - get.effect(player, { name: "draw" }, player, target) * all; + const eff2 = ((source, player, num) => { + let targets = game + .filterPlayer((current) => { + return ( + current.isFriendOf(player) && + get.damageEffect(current, source, source) > 0 && + get.damageEffect(current, source, player) < 0 + ); + }) + .sort((a, b) => { + return ( + (get.damageEffect(b, source, source) > + 0 - get.damageEffect(b, source, player)) - + (get.damageEffect(a, source, source) > + 0 - get.damageEffect(a, source, player)) + ); + }) + .slice(0, num); + return targets.reduce((sum, target) => { + return ( + sum + + (get.damageEffect(target, source, source) - + get.damageEffect(target, source, player)) / + 2 + ); + }, 0); + })(player, target, all); + return Math.max(0, get.sgn(eff1 - eff2)); }); - if(result.bool){ - const targetx=result.targets.sortBySeat(); + const cards = player.getExpansions("fakequanji"); + if (index == 0) { + await target.carryOutJunling(player, junling, targets); + if (cards.length) { + await player.draw(cards.length); + const { + result: { bool, links }, + } = await player.chooseButton(["排异:请移去一张“权”", cards], true); + if (bool) await player.loseToDiscardpile(links); + } + } else if (cards.length) { + const { result } = await player + .chooseTarget( + "排异:是否对至多" + + get.cnNumber(cards.length) + + "名与" + + get.translation(target) + + "势力相同的角色各造成1点伤害并移去等量的“权”?", + (card, player, target) => { + return target.isFriendOf(get.event("target")); + }, + [1, cards.length] + ) + .set("target", target) + .set("ai", (target) => { + return get.damageEffect(target, get.event("player"), get.event("player")); + }); + if (result.bool) { + const targetx = result.targets.sortBySeat(); player.line(targetx); - for(const i of targetx) await i.damage(); - const {result:{bool,links}}=await player.chooseButton(['排异:请移去'+get.cnNumber(targetx.length)+'张“权”',cards],targetx.length,true); - if(bool) await player.loseToDiscardpile(links); + for (const i of targetx) await i.damage(); + const { + result: { bool, links }, + } = await player.chooseButton( + ["排异:请移去" + get.cnNumber(targetx.length) + "张“权”", cards], + targetx.length, + true + ); + if (bool) await player.loseToDiscardpile(links); } } } }, - ai:{ - order:1, - result:{ - target(player,target){ - return -game.countPlayer(current=>{ - return current==target||current.isFriendOf(target); + ai: { + order: 1, + result: { + target(player, target) { + return -game.countPlayer((current) => { + return current == target || current.isFriendOf(target); }); }, }, }, }, - fakeshilu:{ - audio:'gzshilu', - trigger:{player:['phaseZhunbeiBegin','phaseUseEnd']}, - filter(event,player){ - if(event.name=='phaseZhunbei') return player.getStorage('fakeshilu').length; - if(!player.hasViceCharacter()) return false; - const skills=get.character(player.name2,3).filter(i=>!get.is.locked(i,player)); - return !player.hasHistory('useSkill',evt=>evt.event.getParent('phaseUse')==event&&skills.includes(evt.sourceSkill||evt.skill)); + fakeshilu: { + audio: "gzshilu", + trigger: { player: ["phaseZhunbeiBegin", "phaseUseEnd"] }, + filter(event, player) { + if (event.name == "phaseZhunbei") return player.getStorage("fakeshilu").length; + if (!player.hasViceCharacter()) return false; + const skills = get.character(player.name2, 3).filter((i) => !get.is.locked(i, player)); + return !player.hasHistory( + "useSkill", + (evt) => + evt.event.getParent("phaseUse") == event && + skills.includes(evt.sourceSkill || evt.skill) + ); }, - forced:true, - async content(event,trigger,player){ - if(trigger.name=='phaseZhunbei'){ - const num=player.getStorage('fakeshilu').length; - await player.chooseToDiscard(num,'h',true); + forced: true, + async content(event, trigger, player) { + if (trigger.name == "phaseZhunbei") { + const num = player.getStorage("fakeshilu").length; + await player.chooseToDiscard(num, "h", true); await player.draw(num); - } - else{ - await player.changeVice().setContent(get.info('fakeshilu').changeVice); + } else { + await player.changeVice().setContent(get.info("fakeshilu").changeVice); } }, - getGroups(player){ - return player.getStorage('fakeshilu').map(i=>{ - const double=get.is.double(i,true); - return double?double:[get.character(i,1)]; - }).reduce((all,groups)=>{ - all.addArray(groups); - return all; - },[]); + getGroups(player) { + return player + .getStorage("fakeshilu") + .map((i) => { + const double = get.is.double(i, true); + return double ? double : [get.character(i, 1)]; + }) + .reduce((all, groups) => { + all.addArray(groups); + return all; + }, []); }, - changeVice(){ - 'step 0' + changeVice() { + "step 0"; player.showCharacter(2); - if(!event.num) event.num=3; - var group=player.identity; - if(!lib.group.includes(group)) group=lib.character[player.name1][1]; + if (!event.num) event.num = 3; + var group = player.identity; + if (!lib.group.includes(group)) group = lib.character[player.name1][1]; _status.characterlist.randomSort(); - event.tochange=[]; - for(var i=0;i<_status.characterlist.length;i++){ - if(_status.characterlist[i].indexOf('gz_jun_')==0) continue; - var goon=false,group2=lib.character[_status.characterlist[i]][1]; - if(group=='ye'){ - if(group2!='ye') goon=true; - } - else{ - if(group==group2) goon=true; - else{ - var double=get.is.double(_status.characterlist[i],true); - if(double&&double.includes(group)) goon=true; + event.tochange = []; + for (var i = 0; i < _status.characterlist.length; i++) { + if (_status.characterlist[i].indexOf("gz_jun_") == 0) continue; + var goon = false, + group2 = lib.character[_status.characterlist[i]][1]; + if (group == "ye") { + if (group2 != "ye") goon = true; + } else { + if (group == group2) goon = true; + else { + var double = get.is.double(_status.characterlist[i], true); + if (double && double.includes(group)) goon = true; } } - if(goon){ + if (goon) { event.tochange.push(_status.characterlist[i]); } } - event.tochange=event.tochange.filter(character=>{ - const groups=get.info('fakeshilu').getGroups(player); - const doublex=get.is.double(character,true); - const group=(doublex?doublex:[get.character(character,1)]); - return !group.some(j=>groups.includes(j)); - }).randomGets(event.num); - if(!event.tochange.length) event.finish(); - else{ - if(event.tochange.length==1) event._result={ - bool:true, - links:event.tochange, - } - else player.chooseButton(true,['请选择要变更的武将牌,并将原副将武将牌置于武将牌上',[event.tochange,'character']]).ai=function(button){ - return get.guozhanRank(button.link); - }; + event.tochange = event.tochange + .filter((character) => { + const groups = get.info("fakeshilu").getGroups(player); + const doublex = get.is.double(character, true); + const group = doublex ? doublex : [get.character(character, 1)]; + return !group.some((j) => groups.includes(j)); + }) + .randomGets(event.num); + if (!event.tochange.length) event.finish(); + else { + if (event.tochange.length == 1) + event._result = { + bool: true, + links: event.tochange, + }; + else + player.chooseButton(true, [ + "请选择要变更的武将牌,并将原副将武将牌置于武将牌上", + [event.tochange, "character"], + ]).ai = function (button) { + return get.guozhanRank(button.link); + }; } - 'step 1' - var name=result.links[0]; + "step 1"; + var name = result.links[0]; _status.characterlist.remove(name); - if(player.hasViceCharacter()) event.change=true; - event.toRemove=player.name2; - event.toChange=name; - if(event.change) event.trigger('removeCharacterBefore'); - if(event.hidden){ - if(!player.isUnseen(1)) player.hideCharacter(1); + if (player.hasViceCharacter()) event.change = true; + event.toRemove = player.name2; + event.toChange = name; + if (event.change) event.trigger("removeCharacterBefore"); + if (event.hidden) { + if (!player.isUnseen(1)) player.hideCharacter(1); } - 'step 2' - var name=event.toChange; - if(event.hidden) game.log(player,'替换了副将','#g'+get.translation(player.name2)); - else game.log(player,'将副将从','#g'+get.translation(player.name2),'变更为','#g'+get.translation(name)); - player.viceChanged=true; - player.reinitCharacter(player.name2,name,false); - 'step 3' - if(event.change&&event.toRemove){ - const list=[event.toRemove]; - player.markAuto('fakeshilu',list); - game.log(player,'将','#g'+get.translation(list),'置于武将牌上作为','#y“戮”'); - game.broadcastAll((player,list)=>{ - var cards=[]; - for(var i=0;i { + var cards = []; + for (var i = 0; i < list.length; i++) { + var cardname = "huashen_card_" + list[i]; + lib.card[cardname] = { + fullimage: true, + image: "character:" + list[i], + }; + lib.translate[cardname] = get.rawName2(list[i]); + cards.push(game.createCard(cardname, "", "")); } - lib.translate[cardname]=get.rawName2(list[i]); - cards.push(game.createCard(cardname,'','')); - } - player.$draw(cards,'nobroadcast'); - },player,list); + player.$draw(cards, "nobroadcast"); + }, + player, + list + ); } }, - marktext:'戮', - intro:{ - content:'character', - onunmark(storage,player){ - if(storage&&storage.length){ - _status.characterlist.addArray(storage) - storage=[]; + marktext: "戮", + intro: { + content: "character", + onunmark(storage, player) { + if (storage && storage.length) { + _status.characterlist.addArray(storage); + storage = []; } }, - mark(dialog,storage,player){ - if(storage&&storage.length) dialog.addSmall([storage,'character']); - else return '没有“戮”'; + mark(dialog, storage, player) { + if (storage && storage.length) dialog.addSmall([storage, "character"]); + else return "没有“戮”"; }, }, }, - fakexiongnve:{ - audio:'gzxiongnve', - trigger:{ - source:'damageBegin1', - player:['damageBegin3','damageBegin4'], + fakexiongnve: { + audio: "gzxiongnve", + trigger: { + source: "damageBegin1", + player: ["damageBegin3", "damageBegin4"], }, - filter(event,player,name){ - if(!event.source) return false; - const num=parseInt(name.slice('damageBegin'.length)); - const groups=get.info('fakeshilu').getGroups(player); - const goon=(event.card&&event.card.name=='sha'); - if(num!=4) return goon&&[event.player,event.source].some(target=>groups.includes(target.identity)); - return !goon&&groups.includes(event.source.identity); + filter(event, player, name) { + if (!event.source) return false; + const num = parseInt(name.slice("damageBegin".length)); + const groups = get.info("fakeshilu").getGroups(player); + const goon = event.card && event.card.name == "sha"; + if (num != 4) + return ( + goon && + [event.player, event.source].some((target) => groups.includes(target.identity)) + ); + return !goon && groups.includes(event.source.identity); }, - forced:true, - logTarget(event,player){ - return event.source==player?event.player:event.source; + forced: true, + logTarget(event, player) { + return event.source == player ? event.player : event.source; }, - async content(event,trigger,player){ - trigger[parseInt(name.slice('damageBegin'.length))==4?'decrease':'increase']('num'); + async content(event, trigger, player) { + trigger[parseInt(name.slice("damageBegin".length)) == 4 ? "decrease" : "increase"]("num"); }, - ai:{ - combo:'fakeshilu', - effect:{ - target(card,player,target){ - if(card&&card.name=='sha') return; - if(player.hasSkillTag('jueqing',false,target)) return; - const groups=get.info('fakeshilu').getGroups(target); - if(groups.includes(player.identity)){ - var num=get.tag(card,'damage'); - if(num){ - if(num>1) return 0.5; + ai: { + combo: "fakeshilu", + effect: { + target(card, player, target) { + if (card && card.name == "sha") return; + if (player.hasSkillTag("jueqing", false, target)) return; + const groups = get.info("fakeshilu").getGroups(target); + if (groups.includes(player.identity)) { + var num = get.tag(card, "damage"); + if (num) { + if (num > 1) return 0.5; return 0; } } @@ -1557,1105 +2249,1615 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, }, - fakehuaiyi:{ - audio:'gzhuaiyi', - enable:'phaseUse', - filter(event,player){ - if(!game.hasPlayer(target=>target.isMajor())) return false; - return player.hasViceCharacter()||['h','e','j'].some(pos=>player.getCards(pos).every(card=>lib.filter.cardDiscardable(card,player))); + fakehuaiyi: { + audio: "gzhuaiyi", + enable: "phaseUse", + filter(event, player) { + if (!game.hasPlayer((target) => target.isMajor())) return false; + return ( + player.hasViceCharacter() || + ["h", "e", "j"].some((pos) => + player.getCards(pos).every((card) => lib.filter.cardDiscardable(card, player)) + ) + ); }, - usable:1, - chooseButton:{ - dialog(){ - return ui.create.dialog('###怀异###'+get.translation('fakehuaiyi_info')); + usable: 1, + chooseButton: { + dialog() { + return ui.create.dialog("###怀异###" + get.translation("fakehuaiyi_info")); }, - chooseControl(event,player){ - let list=[],map={'h':'手牌区','e':'装备区','j':'判定区'}; - list.addArray(['h','e','j'].filter(pos=>{ - return player.getCards(pos).every(card=>lib.filter.cardDiscardable(card,player)); - }).map(i=>map[i])); - if(player.hasViceCharacter()) list.push('移除副将'); - list.push('cancel2'); + chooseControl(event, player) { + let list = [], + map = { h: "手牌区", e: "装备区", j: "判定区" }; + list.addArray( + ["h", "e", "j"] + .filter((pos) => { + return player + .getCards(pos) + .every((card) => lib.filter.cardDiscardable(card, player)); + }) + .map((i) => map[i]) + ); + if (player.hasViceCharacter()) list.push("移除副将"); + list.push("cancel2"); return list; }, - check(){ - const player=get.event('player'); - if(player.getCards('j').every(card=>lib.filter.cardDiscardable(card,player))) return '判定区'; - if(player.hasViceCharacter()&&get.guozhanRank(player.name2,player)<=3) return '移除副将'; - if(player.getCards('e').every(card=>lib.filter.cardDiscardable(card,player))&&player.getCards('e')<=1) return '装备区'; - if(player.getCards('h').every(card=>lib.filter.cardDiscardable(card,player))&&player.getCards('h')<=1) return '手牌区'; - return 'cancel2'; + check() { + const player = get.event("player"); + if (player.getCards("j").every((card) => lib.filter.cardDiscardable(card, player))) + return "判定区"; + if (player.hasViceCharacter() && get.guozhanRank(player.name2, player) <= 3) + return "移除副将"; + if ( + player.getCards("e").every((card) => lib.filter.cardDiscardable(card, player)) && + player.getCards("e") <= 1 + ) + return "装备区"; + if ( + player.getCards("h").every((card) => lib.filter.cardDiscardable(card, player)) && + player.getCards("h") <= 1 + ) + return "手牌区"; + return "cancel2"; }, - backup(result,player){ + backup(result, player) { return { - audio:'gzhuaiyi', - filterCard:()=>false, - selectCard:-1, - info:result.control, - async content(event,trigger,player){ - const control=get.info('fakehuaiyi_backup').info; - if(info=='移除副将'){ + audio: "gzhuaiyi", + filterCard: () => false, + selectCard: -1, + info: result.control, + async content(event, trigger, player) { + const control = get.info("fakehuaiyi_backup").info; + if (info == "移除副将") { await player.removeCharacter(1); - } - else{ - const map={'手牌区':'h','装备区':'e','判定区':'j'}; + } else { + const map = { 手牌区: "h", 装备区: "e", 判定区: "j" }; await player.discard(player.getCards(map[control])); } - let num={}; - const targetx=game.filterPlayer(target=>target.isMajor()); - for(const target of targetx){ - if(typeof num[target.identity]!='number') num[target.identity]=0; + let num = {}; + const targetx = game.filterPlayer((target) => target.isMajor()); + for (const target of targetx) { + if (typeof num[target.identity] != "number") num[target.identity] = 0; } - let groups=Object.keys(num); - const competition=groups.length>1; - for(const target of targetx){ - if(target==player) continue; - const {result:{bool,cards}}=await target.chooseToGive(player,'he',true,[1,Infinity],'怀异:交给'+get.translation(player)+'至少一张牌').set('ai',card=>{ - const player=get.event('player'),targets=get.event('targetx'); - if(!get.event('competition')||!game.hasPlayer(target=>{ - return target.isFriendOf(player)&&target.hasViceCharacter()&&get.guozhanRank(target.name2,target)>4; - })) return -get.value(card); - if(ui.selected.cards.length>=get.rand(2,3)) return 0; - return 7.5-get.value(card); - }).set('targets',targetx).set('num',num).set('prompt2',competition?'交牌最少的势力的一名角色的副将会被移除':'').set('complexCard',true).set('competition',competition); - if(bool){ - num[target.identity]+=cards.length; + let groups = Object.keys(num); + const competition = groups.length > 1; + for (const target of targetx) { + if (target == player) continue; + const { + result: { bool, cards }, + } = await target + .chooseToGive( + player, + "he", + true, + [1, Infinity], + "怀异:交给" + get.translation(player) + "至少一张牌" + ) + .set("ai", (card) => { + const player = get.event("player"), + targets = get.event("targetx"); + if ( + !get.event("competition") || + !game.hasPlayer((target) => { + return ( + target.isFriendOf(player) && + target.hasViceCharacter() && + get.guozhanRank(target.name2, target) > 4 + ); + }) + ) + return -get.value(card); + if (ui.selected.cards.length >= get.rand(2, 3)) return 0; + return 7.5 - get.value(card); + }) + .set("targets", targetx) + .set("num", num) + .set( + "prompt2", + competition ? "交牌最少的势力的一名角色的副将会被移除" : "" + ) + .set("complexCard", true) + .set("competition", competition); + if (bool) { + num[target.identity] += cards.length; } } - groups.sort((a,b)=>num[a]-num[b]); - const group=groups[0]; - if(num[group]target.identity==group)); - if(targetx.some(target=>target.identity==group&&target.hasViceCharacter())){ - const {result:{bool,targets}}=await player.chooseTarget('怀异:移除'+get.translation(group)+'势力的其中一名角色的副将',(card,player,target)=>{ - return target.identity==get.event('group')&&target.hasViceCharacter(); - },true).set('group',group).set('ai',target=>-get.guozhanRank(target.name2,target)); - if(bool){ - const target=targets[0]; + groups.sort((a, b) => num[a] - num[b]); + const group = groups[0]; + if (num[group] < num[groups[groups.length - 1]]) { + player.line(targetx.filter((target) => target.identity == group)); + if ( + targetx.some( + (target) => target.identity == group && target.hasViceCharacter() + ) + ) { + const { + result: { bool, targets }, + } = await player + .chooseTarget( + "怀异:移除" + + get.translation(group) + + "势力的其中一名角色的副将", + (card, player, target) => { + return ( + target.identity == get.event("group") && + target.hasViceCharacter() + ); + }, + true + ) + .set("group", group) + .set("ai", (target) => -get.guozhanRank(target.name2, target)); + if (bool) { + const target = targets[0]; player.line(target); - game.log(player,'选择了',target); + game.log(player, "选择了", target); await target.removeCharacter(1); } } } }, - ai:{result:{player:1}}, - } + ai: { result: { player: 1 } }, + }; }, }, - ai:{ - order:10, - result:{ - player(player,target){ - if(!game.hasPlayer(i=>i.isMajor()&&get.attitude(player,i)<0)) return 0; - if(player.getCards('j').every(card=>lib.filter.cardDiscardable(card,player))) return 1; - if(player.hasViceCharacter()&&get.guozhanRank(player.name2,player)<=3) return 1; - if(player.getCards('e').every(card=>lib.filter.cardDiscardable(card,player))&&player.getCards('e')<=1) return 1; - if(player.getCards('h').every(card=>lib.filter.cardDiscardable(card,player))&&player.getCards('h')<=1) return 1; + ai: { + order: 10, + result: { + player(player, target) { + if (!game.hasPlayer((i) => i.isMajor() && get.attitude(player, i) < 0)) return 0; + if ( + player.getCards("j").every((card) => lib.filter.cardDiscardable(card, player)) + ) + return 1; + if (player.hasViceCharacter() && get.guozhanRank(player.name2, player) <= 3) + return 1; + if ( + player + .getCards("e") + .every((card) => lib.filter.cardDiscardable(card, player)) && + player.getCards("e") <= 1 + ) + return 1; + if ( + player + .getCards("h") + .every((card) => lib.filter.cardDiscardable(card, player)) && + player.getCards("h") <= 1 + ) + return 1; return 0; }, }, }, - subSkill:{backup:{}}, + subSkill: { backup: {} }, }, - fakezisui:{ - audio:'gzzisui', - trigger:{global:'removeCharacterEnd'}, - filter(event,player){ - return event.getParent().player==player; + fakezisui: { + audio: "gzzisui", + trigger: { global: "removeCharacterEnd" }, + filter(event, player) { + return event.getParent().player == player; }, - forced:true, - content(){ - const list=[trigger.toRemove]; - player.markAuto('fakezisui',list); - game.log(player,'将','#g'+get.translation(list),'置于武将牌上作为','#y“异”'); - game.broadcastAll((player,list)=>{ - var cards=[]; - for(var i=0;i { + var cards = []; + for (var i = 0; i < list.length; i++) { + var cardname = "huashen_card_" + list[i]; + lib.card[cardname] = { + fullimage: true, + image: "character:" + list[i], + }; + lib.translate[cardname] = get.rawName2(list[i]); + cards.push(game.createCard(cardname, "", "")); } - lib.translate[cardname]=get.rawName2(list[i]); - cards.push(game.createCard(cardname,'','')); - } - player.$draw(cards,'nobroadcast'); - },player,list); - }, - marktext:'异', - intro:{ - content:'character', - onunmark(storage,player){ - if(storage&&storage.length){ - _status.characterlist.addArray(storage) - storage=[]; - } - }, - mark(dialog,storage,player){ - if(storage&&storage.length) dialog.addSmall([storage,'character']); - else return '没有“异”'; - }, - }, - group:'fakezisui_effect', - subSkill:{ - effect:{ - audio:'gzzisui', - trigger:{player:['phaseDrawBegin2','phaseJieshuBegin']}, - filter(event,player){ - const num=player.getStorage('fakezisui').length; - if(!num) return false; - if(event.name=='phaseDraw') return !event.numFixed; - return num>player.maxHp; + player.$draw(cards, "nobroadcast"); }, - forced:true, - content(){ - const num=player.getStorage('fakezisui').length; - if(trigger.name=='phaseDraw') trigger.num+=num; + player, + list + ); + }, + marktext: "异", + intro: { + content: "character", + onunmark(storage, player) { + if (storage && storage.length) { + _status.characterlist.addArray(storage); + storage = []; + } + }, + mark(dialog, storage, player) { + if (storage && storage.length) dialog.addSmall([storage, "character"]); + else return "没有“异”"; + }, + }, + group: "fakezisui_effect", + subSkill: { + effect: { + audio: "gzzisui", + trigger: { player: ["phaseDrawBegin2", "phaseJieshuBegin"] }, + filter(event, player) { + const num = player.getStorage("fakezisui").length; + if (!num) return false; + if (event.name == "phaseDraw") return !event.numFixed; + return num > player.maxHp; + }, + forced: true, + content() { + const num = player.getStorage("fakezisui").length; + if (trigger.name == "phaseDraw") trigger.num += num; else player.die(); }, }, }, }, - fakejujian:{ - audio:'gzjujian', - init(player){ - if(player.checkViceSkill('fakejujian')&&!player.viceChanged) player.removeMaxHp(); + fakejujian: { + audio: "gzjujian", + init(player) { + if (player.checkViceSkill("fakejujian") && !player.viceChanged) player.removeMaxHp(); }, - viceSkill:true, - filter(event,player){ - return player.countCards('he',card=>{ - return _status.connectMode||(get.type(card)!='basic'&&lib.filter.cardDiscardable(card,player)); + viceSkill: true, + filter(event, player) { + return player.countCards("he", (card) => { + return ( + _status.connectMode || + (get.type(card) != "basic" && lib.filter.cardDiscardable(card, player)) + ); }); }, - async cost(event,trigger,player){ - event.result=await player.chooseCardTarget({ - prompt:get.prompt2('fakejujian'), - filterTarget(card,player,target){ + async cost(event, trigger, player) { + event.result = await player.chooseCardTarget({ + prompt: get.prompt2("fakejujian"), + filterTarget(card, player, target) { return target.isFriendOf(player); }, - filterCard(card,player){ - return get.type(card)!='basic'&&lib.filter.cardDiscardable(card,player); + filterCard(card, player) { + return get.type(card) != "basic" && lib.filter.cardDiscardable(card, player); }, - position:'he', - ai1(card){ - return 7.5-get.value(card); + position: "he", + ai1(card) { + return 7.5 - get.value(card); }, - ai2(target){ - const player=get.event('player'); - return Math.max(get.effect(target,{name:'wuzhong'},player,player),get.recoverEffect(target,player,player)); + ai2(target) { + const player = get.event("player"); + return Math.max( + get.effect(target, { name: "wuzhong" }, player, player), + get.recoverEffect(target, player, player) + ); }, }); }, - async content(event,trigger,player){ + async content(event, trigger, player) { await player.discard(event.cards); - const target=event.targets[0]; - await target.chooseDrawRecover(2,'举荐:摸两张牌或回复1点体力',true); + const target = event.targets[0]; + await target.chooseDrawRecover(2, "举荐:摸两张牌或回复1点体力", true); await target.mayChangeVice(); }, }, - fakexibing:{ - audio:'xibing', - inherit:'xibing', - content(){ - 'step 0' - var num=trigger.player.hp-trigger.player.countCards('h'); - if(num>0) trigger.player.draw(num); - 'step 1' - trigger.player.addTempSkill('xibing2'); - player._xibing=true; - if(get.mode()!='guozhan'||player.isUnseen(2)||trigger.player.isUnseen(2)) event.finish(); - 'step 2' - var target=trigger.player; - var players1=[player.name1,player.name2]; - var players2=[target.name1,target.name2]; - player.chooseButton(2,[ - '是否暗置自己和'+get.translation(target)+'的各一张武将牌?', - '
    你的武将牌
    ', - [players1,'character'], - '
    '+get.translation(target)+'的武将牌
    ', - [players2,'character'], - ]).set('players',players1).set('complexSelect',true).set('filterButton',function(button){ - return !get.is.jun(button.link)&&(ui.selected.buttons.length==0)==(_status.event.players.includes(button.link)); - }); - 'step 3' - if(result.bool){ - var target=trigger.player; - player.hideCharacter(player.name1==result.links[0]?0:1); - target.hideCharacter(target.name1==result.links[1]?0:1); - player.addTempSkill('xibing3'); - target.addTempSkill('xibing3'); + fakexibing: { + audio: "xibing", + inherit: "xibing", + content() { + "step 0"; + var num = trigger.player.hp - trigger.player.countCards("h"); + if (num > 0) trigger.player.draw(num); + "step 1"; + trigger.player.addTempSkill("xibing2"); + player._xibing = true; + if (get.mode() != "guozhan" || player.isUnseen(2) || trigger.player.isUnseen(2)) + event.finish(); + "step 2"; + var target = trigger.player; + var players1 = [player.name1, player.name2]; + var players2 = [target.name1, target.name2]; + player + .chooseButton(2, [ + "是否暗置自己和" + get.translation(target) + "的各一张武将牌?", + '
    你的武将牌
    ', + [players1, "character"], + '
    ' + get.translation(target) + "的武将牌
    ", + [players2, "character"], + ]) + .set("players", players1) + .set("complexSelect", true) + .set("filterButton", function (button) { + return ( + !get.is.jun(button.link) && + (ui.selected.buttons.length == 0) == + _status.event.players.includes(button.link) + ); + }); + "step 3"; + if (result.bool) { + var target = trigger.player; + player.hideCharacter(player.name1 == result.links[0] ? 0 : 1); + target.hideCharacter(target.name1 == result.links[1] ? 0 : 1); + player.addTempSkill("xibing3"); + target.addTempSkill("xibing3"); } }, }, - fakechengshang:{ - audio:'chengshang', - trigger:{player:'useCardAfter'}, - filter(event,player){ - if(!lib.suit.includes(get.suit(event.card,false))||typeof get.number(event.card)!='number') return false; - if(player.getHistory('sourceDamage',evt=>{ - return evt.card==event.card; - }).length) return false; - const phsu=event.getParent('phaseUse'); - if(!phsu||phsu.player!=player) return false; - return event.targets.some(i=>i.isEnemyOf(player)); + fakechengshang: { + audio: "chengshang", + trigger: { player: "useCardAfter" }, + filter(event, player) { + if ( + !lib.suit.includes(get.suit(event.card, false)) || + typeof get.number(event.card) != "number" + ) + return false; + if ( + player.getHistory("sourceDamage", (evt) => { + return evt.card == event.card; + }).length + ) + return false; + const phsu = event.getParent("phaseUse"); + if (!phsu || phsu.player != player) return false; + return event.targets.some((i) => i.isEnemyOf(player)); }, - usable:1, - preHidden:true, - async content(event,trigger,player){ + usable: 1, + preHidden: true, + async content(event, trigger, player) { await player.draw(); - player.tempBanSkill('fakechengshang','phaseUseAfter',false); - player.addTempSkill('fakechengshang_effect'); - player.markAuto('fakechengshang_effect',[[get.suit(trigger.card),get.number(trigger.card),trigger.card.name]]); + player.tempBanSkill("fakechengshang", "phaseUseAfter", false); + player.addTempSkill("fakechengshang_effect"); + player.markAuto("fakechengshang_effect", [ + [get.suit(trigger.card), get.number(trigger.card), trigger.card.name], + ]); }, - subSkill:{ - effect:{ - charlotte:true, - onremove:true, - hiddenCard(player,name){ - const type=get.type(name); - if(type!='basic'&&type!='trick') return false; - const storage=player.getStorage('fakechengshang_effect'); - return lib.card.list.some(list=>{ - return name==list[2]&&storage.some(card=>{ - return card[0]==list[0]&&card[1]==list[1]&&card[2]!=list[2]; - }); + subSkill: { + effect: { + charlotte: true, + onremove: true, + hiddenCard(player, name) { + const type = get.type(name); + if (type != "basic" && type != "trick") return false; + const storage = player.getStorage("fakechengshang_effect"); + return lib.card.list.some((list) => { + return ( + name == list[2] && + storage.some((card) => { + return card[0] == list[0] && card[1] == list[1] && card[2] != list[2]; + }) + ); }); }, - audio:'chengshang', - enable:'phaseUse', - chooseButton:{ - dialog(event,player){ - const storage=player.getStorage('fakechengshang_effect'); - const list=lib.card.list.filter(list=>{ - const type=get.type(card[2]); - if(type!='basic'&&type!='trick') return false; - return storage.some(card=>card[0]==list[0]&&card[1]==list[1]&&card[2]!=list[2]); - }).map(card=>[get.translation(type),'',card[2],card[3]]); - return ui.create.dialog('承赏',[list,'vcard']); + audio: "chengshang", + enable: "phaseUse", + chooseButton: { + dialog(event, player) { + const storage = player.getStorage("fakechengshang_effect"); + const list = lib.card.list + .filter((list) => { + const type = get.type(card[2]); + if (type != "basic" && type != "trick") return false; + return storage.some( + (card) => + card[0] == list[0] && card[1] == list[1] && card[2] != list[2] + ); + }) + .map((card) => [get.translation(type), "", card[2], card[3]]); + return ui.create.dialog("承赏", [list, "vcard"]); }, - filter(button,player){ - return get.event().getParent().filterCard({name:button.link[2],nature:button.link[3]},player,event); + filter(button, player) { + return get + .event() + .getParent() + .filterCard( + { name: button.link[2], nature: button.link[3] }, + player, + event + ); }, - check(button){ - const player=get.event('player'); - const card={name:button.link[2],nature:button.link[3]}; - if(player.countCards('hes',cardx=>cardx.name==card.name)) return 0; + check(button) { + const player = get.event("player"); + const card = { name: button.link[2], nature: button.link[3] }; + if (player.countCards("hes", (cardx) => cardx.name == card.name)) return 0; return player.getUseValue(card); }, - backup(links,player){ + backup(links, player) { return { - audio:'chengshang', - filterCard:true, - position:'hs', - popname:true, - precontent(){ - player.logSkill('fakechengshang_effect'); + audio: "chengshang", + filterCard: true, + position: "hs", + popname: true, + precontent() { + player.logSkill("fakechengshang_effect"); delete event.result.skill; - const cardx=event.result.card; - const removes=player.getStorage('fakechengshang_effect').filter(card=>{ - return lib.card.list.some(list=>{ - return cardx.name==list[2]&&card[0]==list[0]&&card[1]==list[1]&&card[2]!=list[2]; + const cardx = event.result.card; + const removes = player + .getStorage("fakechengshang_effect") + .filter((card) => { + return lib.card.list.some((list) => { + return ( + cardx.name == list[2] && + card[0] == list[0] && + card[1] == list[1] && + card[2] != list[2] + ); + }); }); - }); - player.unmarkAuto('fakechengshang_effect',removes); + player.unmarkAuto("fakechengshang_effect", removes); }, - viewAs:{ - name:links[0][2], - nature:links[0][3], + viewAs: { + name: links[0][2], + nature: links[0][3], }, - } + }; }, - prompt(links,player){ - return '将一张手牌当作'+(get.translation(links[0][3])||'')+get.translation(links[0][2])+'使用'; + prompt(links, player) { + return ( + "将一张手牌当作" + + (get.translation(links[0][3]) || "") + + get.translation(links[0][2]) + + "使用" + ); }, }, }, }, }, - fakezhente:{ - audio:'zhente', - inherit:'zhente', - filter(event,player){ - var color=get.color(event.card),type=get.type(event.card); - if(player==event.player||event.player.isDead()||color=='none') return false; - return type=='trick'||(type=='basic'&&color=='black'); + fakezhente: { + audio: "zhente", + inherit: "zhente", + filter(event, player) { + var color = get.color(event.card), + type = get.type(event.card); + if (player == event.player || event.player.isDead() || color == "none") return false; + return type == "trick" || (type == "basic" && color == "black"); }, }, - fakezhiwei:{ - audio:'zhiwei', - inherit:'zhiwei', - content(){ - 'step 0' - player.chooseTarget('请选择【至微】的目标',true,lib.filter.notMe).set('ai',target=>{ - var att=get.attitude(_status.event.player,target); - if(att>0) return 1+att; - return Math.random(); - }).set('prompt2',lib.translate.fakezhiwei_info); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.logSkill('fakezhiwei',target); - player.storage.fakezhiwei_effect=target; - player.addSkill('fakezhiwei_effect'); + fakezhiwei: { + audio: "zhiwei", + inherit: "zhiwei", + content() { + "step 0"; + player + .chooseTarget("请选择【至微】的目标", true, lib.filter.notMe) + .set("ai", (target) => { + var att = get.attitude(_status.event.player, target); + if (att > 0) return 1 + att; + return Math.random(); + }) + .set("prompt2", lib.translate.fakezhiwei_info); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.logSkill("fakezhiwei", target); + player.storage.fakezhiwei_effect = target; + player.addSkill("fakezhiwei_effect"); } }, - subSkill:{ - effect:{ - charlotte:true, - onremove:true, - audio:'zhiwei', - trigger:{player:'hideCharacterBefore'}, - filter(event,player){ - return get.character(event.toHide,3).includes('fakezhiwei'); + subSkill: { + effect: { + charlotte: true, + onremove: true, + audio: "zhiwei", + trigger: { player: "hideCharacterBefore" }, + filter(event, player) { + return get.character(event.toHide, 3).includes("fakezhiwei"); }, - forced:true, - content(){ + forced: true, + content() { trigger.cancel(); }, - mark:'character', - intro:{content:'已选择$'}, - group:['fakezhiwei_draw','fakezhiwei_discard','fakezhiwei_gain','fakezhiwei_clear'], + mark: "character", + intro: { content: "已选择$" }, + group: [ + "fakezhiwei_draw", + "fakezhiwei_discard", + "fakezhiwei_gain", + "fakezhiwei_clear", + ], }, - draw:{ - audio:'zhiwei', - trigger:{global:'damageSource'}, - forced:true, - filter(event,player){ - return event.source==player.storage.fakezhiwei_effect; + draw: { + audio: "zhiwei", + trigger: { global: "damageSource" }, + forced: true, + filter(event, player) { + return event.source == player.storage.fakezhiwei_effect; }, - logTarget:'source', - content(){ + logTarget: "source", + content() { player.draw(); }, }, - discard:{ - audio:'zhiwei', - trigger:{global:'damageEnd'}, - forced:true, - filter(event,player){ - return event.player==player.storage.fakezhiwei_effect&&player.hasCard(card=>{ - return _status.connectMode||lib.filter.cardDiscardable(card,player); - },'h'); + discard: { + audio: "zhiwei", + trigger: { global: "damageEnd" }, + forced: true, + filter(event, player) { + return ( + event.player == player.storage.fakezhiwei_effect && + player.hasCard((card) => { + return _status.connectMode || lib.filter.cardDiscardable(card, player); + }, "h") + ); }, - logTarget:'player', - content(){ - player.chooseToDiscard('h',true); + logTarget: "player", + content() { + player.chooseToDiscard("h", true); }, }, - gain:{ - audio:'zhiwei', - trigger:{ - player:'loseAfter', - global:'loseAsyncAfter', + gain: { + audio: "zhiwei", + trigger: { + player: "loseAfter", + global: "loseAsyncAfter", }, - forced:true, - filter(event,player){ - if(event.type!='discard'||event.getlx===false||event.getParent('phaseDiscard').player!=player||!player.storage.fakezhiwei_effect||!player.storage.fakezhiwei_effect.isIn()) return false; - var evt=event.getl(player); - return evt&&evt.cards2.filterInD('d').length>0; + forced: true, + filter(event, player) { + if ( + event.type != "discard" || + event.getlx === false || + event.getParent("phaseDiscard").player != player || + !player.storage.fakezhiwei_effect || + !player.storage.fakezhiwei_effect.isIn() + ) + return false; + var evt = event.getl(player); + return evt && evt.cards2.filterInD("d").length > 0; }, - logTarget(event,player){ + logTarget(event, player) { return player.storage.fakezhiwei_effect; }, - content(){ - if(trigger.delay===false) game.delay(); - player.storage.fakezhiwei_effect.gain(trigger.getl(player).cards2.filterInD('d'),'gain2'); + content() { + if (trigger.delay === false) game.delay(); + player.storage.fakezhiwei_effect.gain( + trigger.getl(player).cards2.filterInD("d"), + "gain2" + ); }, }, - clear:{ - audio:'zhiwei', - trigger:{ - global:'die', - player:['hideCharacterEnd','removeCharacterEnd'], + clear: { + audio: "zhiwei", + trigger: { + global: "die", + player: ["hideCharacterEnd", "removeCharacterEnd"], }, - forced:true, - filter(event,player){ - if(event.name=='die') return event.player==player.storage.fakezhiwei_effect; - if(event.name=='removeCharacter') return get.character(event.toRemove,3).includes('fakezhiwei'); - return get.character(event.toHide,3).includes('fakezhiwei'); + forced: true, + filter(event, player) { + if (event.name == "die") return event.player == player.storage.fakezhiwei_effect; + if (event.name == "removeCharacter") + return get.character(event.toRemove, 3).includes("fakezhiwei"); + return get.character(event.toHide, 3).includes("fakezhiwei"); }, - content(){ - 'step 0' - player.removeSkill('fakezhiwei_effect'); - if(trigger.name!='die') event.finish(); - 'step 1' - if(get.character(player.name1,3).includes('fakezhiwei')) player.hideCharacter(0); - if(get.character(player.name2,3).includes('fakezhiwei')) player.hideCharacter(1); + content() { + "step 0"; + player.removeSkill("fakezhiwei_effect"); + if (trigger.name != "die") event.finish(); + "step 1"; + if (get.character(player.name1, 3).includes("fakezhiwei")) + player.hideCharacter(0); + if (get.character(player.name2, 3).includes("fakezhiwei")) + player.hideCharacter(1); }, }, }, }, - fakekuangcai:{ - inherit:'gzrekuangcai', - content(){ - const goon=Boolean(player.getHistory('useCard').length); - get.info('rekuangcai').change(player,goon?-1:1); - player.when({global:'phaseAfter'}).then(()=>{ - get.info('rekuangcai').change(player,goon?1:-1); - }).vars({goon:goon}); + fakekuangcai: { + inherit: "gzrekuangcai", + content() { + const goon = Boolean(player.getHistory("useCard").length); + get.info("rekuangcai").change(player, goon ? -1 : 1); + player + .when({ global: "phaseAfter" }) + .then(() => { + get.info("rekuangcai").change(player, goon ? 1 : -1); + }) + .vars({ goon: goon }); }, }, - faketunchu:{ - audio:'tunchu', - trigger:{player:'phaseDrawBegin2'}, - filter(event,player){ + faketunchu: { + audio: "tunchu", + trigger: { player: "phaseDrawBegin2" }, + filter(event, player) { return !event.numFixed; }, - check(event,player){ - return player.countCards('h')<=2; + check(event, player) { + return player.countCards("h") <= 2; }, - locked:false, - preHidden:true, - content(){ - trigger.num+=2; - player.when(['phaseDrawEnd','phaseDrawSkipped','phaseDrawCancelled']) - .filter(evt=>evt==trigger) - .then(()=>{ - var nh=player.countCards('h'); - if(nh){ - player.chooseCard('h',[1,Math.min(nh,2)],'将至多两张手牌置于你的武将牌上',true).set('ai',card=>{ - return 7.5-get.value(card); - }); - } - else{ - player.addTempSkill('faketunchu_effect'); - event.finish(); - } - }) - .then(()=>{ - if(result.bool) player.addToExpansion(result.cards,player,'giveAuto').gaintag.add('faketunchu'); - }) - .then(()=>{ - player.addTempSkill('faketunchu_effect'); - }); + locked: false, + preHidden: true, + content() { + trigger.num += 2; + player + .when(["phaseDrawEnd", "phaseDrawSkipped", "phaseDrawCancelled"]) + .filter((evt) => evt == trigger) + .then(() => { + var nh = player.countCards("h"); + if (nh) { + player + .chooseCard( + "h", + [1, Math.min(nh, 2)], + "将至多两张手牌置于你的武将牌上", + true + ) + .set("ai", (card) => { + return 7.5 - get.value(card); + }); + } else { + player.addTempSkill("faketunchu_effect"); + event.finish(); + } + }) + .then(() => { + if (result.bool) + player + .addToExpansion(result.cards, player, "giveAuto") + .gaintag.add("faketunchu"); + }) + .then(() => { + player.addTempSkill("faketunchu_effect"); + }); }, - intro:{ - content:'expansion', - markcount:'expansion', + intro: { + content: "expansion", + markcount: "expansion", }, - marktext:'粮', - onremove(player,skill){ - var cards=player.getExpansions(skill); - if(cards.length) player.loseToDiscardpile(cards); + marktext: "粮", + onremove(player, skill) { + var cards = player.getExpansions(skill); + if (cards.length) player.loseToDiscardpile(cards); }, - subSkill:{ - effect:{ - charlotte:true, - mod:{ - cardEnabled(card,player){ - if(card.name=='sha') return false; + subSkill: { + effect: { + charlotte: true, + mod: { + cardEnabled(card, player) { + if (card.name == "sha") return false; }, }, - mark:true, - intro:{content:'本回合不能使用【杀】'}, + mark: true, + intro: { content: "本回合不能使用【杀】" }, }, }, }, - fakeshuliang:{ - audio:'shuliang', - trigger:{global:'phaseJieshuBegin'}, - filter(event,player){ - const num=player.getExpansions('faketunchu').length; - if(!num||!event.player.isFriendOf(player)) return false; - return event.player.isIn()&&get.distance(player,event.player)<=num; + fakeshuliang: { + audio: "shuliang", + trigger: { global: "phaseJieshuBegin" }, + filter(event, player) { + const num = player.getExpansions("faketunchu").length; + if (!num || !event.player.isFriendOf(player)) return false; + return event.player.isIn() && get.distance(player, event.player) <= num; }, - async cost(event,trigger,player){ - const {result:{bool,links}}=await player.chooseButton([get.prompt2('fakeshuliang',trigger.player),player.getExpansions('faketunchu')]).set('ai',button=>{ - if(get.attitude(get.event('player'),get.event().getTrigger().player)<=0) return 0; - return 1+Math.random(); - }).set('hiddenSkill','fakeshuliang'); - event.result={bool:bool,cost_data:links}; + async cost(event, trigger, player) { + const { + result: { bool, links }, + } = await player + .chooseButton([ + get.prompt2("fakeshuliang", trigger.player), + player.getExpansions("faketunchu"), + ]) + .set("ai", (button) => { + if (get.attitude(get.event("player"), get.event().getTrigger().player) <= 0) + return 0; + return 1 + Math.random(); + }) + .set("hiddenSkill", "fakeshuliang"); + event.result = { bool: bool, cost_data: links }; }, - preHidden:true, - logTarget:'player', - content(){ + preHidden: true, + logTarget: "player", + content() { player.loseToDiscardpile(event.cost_data); trigger.player.draw(2); }, - ai:{combo:'faketunchu'}, + ai: { combo: "faketunchu" }, }, - fakedujin:{ - audio:'dujin', - inherit:'dujin', - filter(event,player){ - return player.countCards('e')&&!event.numFixed; + fakedujin: { + audio: "dujin", + inherit: "dujin", + filter(event, player) { + return player.countCards("e") && !event.numFixed; }, - content(){ - trigger.num+=Math.ceil(player.countCards('e')/2); + content() { + trigger.num += Math.ceil(player.countCards("e") / 2); }, - group:'fakedujin_first', - subSkill:{ - first:{ - audio:'dujin', - trigger:{player:'showCharacterEnd'}, - filter(event,player){ - if(game.getAllGlobalHistory('everything',evt=>{ - return evt.name=='showCharacter'&&evt.player==player&&evt.toShow.some(i=>get.character(i,3).includes('fakedujin')); - },event).indexOf(event)!=0) return false; - return game.getAllGlobalHistory('everything',evt=>{ - return evt.name=='showCharacter'&&evt.player.isFriendOf(player); - })[0].player==player; + group: "fakedujin_first", + subSkill: { + first: { + audio: "dujin", + trigger: { player: "showCharacterEnd" }, + filter(event, player) { + if ( + game + .getAllGlobalHistory( + "everything", + (evt) => { + return ( + evt.name == "showCharacter" && + evt.player == player && + evt.toShow.some((i) => + get.character(i, 3).includes("fakedujin") + ) + ); + }, + event + ) + .indexOf(event) != 0 + ) + return false; + return ( + game.getAllGlobalHistory("everything", (evt) => { + return evt.name == "showCharacter" && evt.player.isFriendOf(player); + })[0].player == player + ); }, - forced:true, - locked:false, - content(){ - player.addMark('xianqu_mark',1); + forced: true, + locked: false, + content() { + player.addMark("xianqu_mark", 1); }, }, }, }, - fakezhufu:{ - audio:'spwuku', - enable:'phaseUse', - filter(event,player){ - return player.hasCard(card=>{ - return get.info('fakezhufu').filterCard(card,player); - },'he'); + fakezhufu: { + audio: "spwuku", + enable: "phaseUse", + filter(event, player) { + return player.hasCard((card) => { + return get.info("fakezhufu").filterCard(card, player); + }, "he"); }, - filterCard(card,player){ - if(!lib.suit.includes(get.suit(card))) return false; - return lib.filter.cardDiscardable(card,player)&&!player.getStorage('fakezhufu_effect').includes(get.suit(card)); + filterCard(card, player) { + if (!lib.suit.includes(get.suit(card))) return false; + return ( + lib.filter.cardDiscardable(card, player) && + !player.getStorage("fakezhufu_effect").includes(get.suit(card)) + ); }, - position:'he', - check(card){ - const player=get.event('player'); - let cards=player.getCards('hs',card=>player.hasValueTarget(card,true,true)); - let discards=player.getCards('he',card=>get.info('fakezhufu').filterCard(card,player)); - for(let i=1;iget.suit(card)==get.suit(discards[i]))) discards.splice(i--,1); + position: "he", + check(card) { + const player = get.event("player"); + let cards = player.getCards("hs", (card) => player.hasValueTarget(card, true, true)); + let discards = player.getCards("he", (card) => + get.info("fakezhufu").filterCard(card, player) + ); + for (let i = 1; i < discards.length; i++) { + if (discards.slice(0, i).some((card) => get.suit(card) == get.suit(discards[i]))) + discards.splice(i--, 1); } cards.removeArray(discards); - if(!cards.length||!discards.length) return 0; - cards.sort((a,b)=>{ - return (player.getUseValue(b,true,true)>0?get.order(b):0)-(player.getUseValue(a,true,true)>0?get.order(a):0); + if (!cards.length || !discards.length) return 0; + cards.sort((a, b) => { + return ( + (player.getUseValue(b, true, true) > 0 ? get.order(b) : 0) - + (player.getUseValue(a, true, true) > 0 ? get.order(a) : 0) + ); }); - const cardx=cards[0]; - if(get.order(cardx,player)>0&&discards.includes(card)){ - if((get.suit(card)=='heart'&&get.type(cardx)!='equip'&&(function(card,player){ - const num=get.info('fakezhufu').getMaxUseTarget(card,player); - return num!=-1&&game.countPlayer(target=>player.canUse(card,target,true,true)&&get.effect(target,card,player,player)>0)>num; - }(cardx,player))&&game.hasPlayer(target=>{ - return target.isFriendOf(player)&&target.hasCard(cardy=>{ - return lib.filter.cardDiscardable(cardy,target)&&get.type2(cardy)==get.type2(cardx); - },'h'); - }))||(get.suit(card)=='diamond'&&get.type(cardx)!='equip'&&!game.hasPlayer(target=>{ - return target.countCards('h')>player.countCards('h')-(get.position(card)=='h'?1:0)-(get.position(cardx)=='h'?1:0); - }))||(get.suit(card)=='spade'&&player.getHp()==1)||(get.suit(card)=='club'&&get.tag(cardx,'damage')&&player.countCards('h')-(get.position(card)=='h'?1:0)-(get.position(cardx)=='h'?1:0)==0)) return 1/(getvalue(card)||0.5); + const cardx = cards[0]; + if (get.order(cardx, player) > 0 && discards.includes(card)) { + if ( + (get.suit(card) == "heart" && + get.type(cardx) != "equip" && + (function (card, player) { + const num = get.info("fakezhufu").getMaxUseTarget(card, player); + return ( + num != -1 && + game.countPlayer( + (target) => + player.canUse(card, target, true, true) && + get.effect(target, card, player, player) > 0 + ) > num + ); + })(cardx, player) && + game.hasPlayer((target) => { + return ( + target.isFriendOf(player) && + target.hasCard((cardy) => { + return ( + lib.filter.cardDiscardable(cardy, target) && + get.type2(cardy) == get.type2(cardx) + ); + }, "h") + ); + })) || + (get.suit(card) == "diamond" && + get.type(cardx) != "equip" && + !game.hasPlayer((target) => { + return ( + target.countCards("h") > + player.countCards("h") - + (get.position(card) == "h" ? 1 : 0) - + (get.position(cardx) == "h" ? 1 : 0) + ); + })) || + (get.suit(card) == "spade" && player.getHp() == 1) || + (get.suit(card) == "club" && + get.tag(cardx, "damage") && + player.countCards("h") - + (get.position(card) == "h" ? 1 : 0) - + (get.position(cardx) == "h" ? 1 : 0) == + 0) + ) + return 1 / (getvalue(card) || 0.5); } return 0; }, - async content(event,trigger,player){ - const suit=get.suit(event.cards[0],player); - player.addTempSkill('fakezhufu_effect','phaseUseAfter'); - player.markAuto('fakezhufu_effect',[[suit,false]]); + async content(event, trigger, player) { + const suit = get.suit(event.cards[0], player); + player.addTempSkill("fakezhufu_effect", "phaseUseAfter"); + player.markAuto("fakezhufu_effect", [[suit, false]]); }, - ai:{ - order(item,player){ - let cards=player.getCards('hs',card=>player.hasValueTarget(card,true,true)); - let discards=player.getCards('he',card=>get.info('fakezhufu').filterCard(card,player)); - for(let i=1;iget.suit(card)==get.suit(discards[i]))) discards.splice(i--,1); + ai: { + order(item, player) { + let cards = player.getCards("hs", (card) => player.hasValueTarget(card, true, true)); + let discards = player.getCards("he", (card) => + get.info("fakezhufu").filterCard(card, player) + ); + for (let i = 1; i < discards.length; i++) { + if (discards.slice(0, i).some((card) => get.suit(card) == get.suit(discards[i]))) + discards.splice(i--, 1); } cards.removeArray(discards); - if(!cards.length||!discards.length) return 0; - cards.sort((a,b)=>{ - return (player.getUseValue(b,true,true)>0?get.order(b):0)-(player.getUseValue(a,true,true)>0?get.order(a):0); + if (!cards.length || !discards.length) return 0; + cards.sort((a, b) => { + return ( + (player.getUseValue(b, true, true) > 0 ? get.order(b) : 0) - + (player.getUseValue(a, true, true) > 0 ? get.order(a) : 0) + ); }); - const cardx=cards[0]; - return (get.order(cardx,player)>0&&((discards.some(card=>{ - return get.suit(card)=='heart'; - })&&get.type(cardx)!='equip'&&(function(card,player){ - const num=get.info('fakezhufu').getMaxUseTarget(card,player); - return num!=-1&&game.countPlayer(target=>player.canUse(card,target,true,true)&&get.effect(target,card,player,player)>0)>num; - }(cardx,player))&&game.hasPlayer(target=>{ - return target.isFriendOf(player)&&target.hasCard(cardy=>{ - return lib.filter.cardDiscardable(cardy,target)&&get.type2(cardy)==get.type2(cardx); - },'h'); - }))||(get.type(cardx)!='equip'&&discards.some(card=>{ - return get.suit(card)=='diamond'&&!game.hasPlayer(target=>{ - return target.countCards('h')>player.countCards('h')-(get.position(card)=='h'?1:0)-(get.position(cardx)=='h'?1:0); - }); - }))||(discards.some(card=>{ - return get.suit(card)=='spade'; - })&&player.getHp()==1)||(get.tag(cardx,'damage')&&discards.some(card=>{ - return get.suit(card)=='club'&&player.countCards('h')-(get.position(card)=='h'?1:0)-(get.position(cardx)=='h'?1:0)==0; - }))))?(get.order(cardx,player)+0.00001):0; + const cardx = cards[0]; + return get.order(cardx, player) > 0 && + ((discards.some((card) => { + return get.suit(card) == "heart"; + }) && + get.type(cardx) != "equip" && + (function (card, player) { + const num = get.info("fakezhufu").getMaxUseTarget(card, player); + return ( + num != -1 && + game.countPlayer( + (target) => + player.canUse(card, target, true, true) && + get.effect(target, card, player, player) > 0 + ) > num + ); + })(cardx, player) && + game.hasPlayer((target) => { + return ( + target.isFriendOf(player) && + target.hasCard((cardy) => { + return ( + lib.filter.cardDiscardable(cardy, target) && + get.type2(cardy) == get.type2(cardx) + ); + }, "h") + ); + })) || + (get.type(cardx) != "equip" && + discards.some((card) => { + return ( + get.suit(card) == "diamond" && + !game.hasPlayer((target) => { + return ( + target.countCards("h") > + player.countCards("h") - + (get.position(card) == "h" ? 1 : 0) - + (get.position(cardx) == "h" ? 1 : 0) + ); + }) + ); + })) || + (discards.some((card) => { + return get.suit(card) == "spade"; + }) && + player.getHp() == 1) || + (get.tag(cardx, "damage") && + discards.some((card) => { + return ( + get.suit(card) == "club" && + player.countCards("h") - + (get.position(card) == "h" ? 1 : 0) - + (get.position(cardx) == "h" ? 1 : 0) == + 0 + ); + }))) + ? get.order(cardx, player) + 0.00001 + : 0; }, - result:{ - player(player,target){ - let cards=player.getCards('hs',card=>player.hasValueTarget(card,true,true)); - let discards=player.getCards('he',card=>get.info('fakezhufu').filterCard(card,player)); - discards=discards.sort((a,b)=>get.value(a)-get.value(b)); - for(let i=1;iget.suit(card)==get.suit(discards[i]))) discards.splice(i--,1); + result: { + player(player, target) { + let cards = player.getCards("hs", (card) => + player.hasValueTarget(card, true, true) + ); + let discards = player.getCards("he", (card) => + get.info("fakezhufu").filterCard(card, player) + ); + discards = discards.sort((a, b) => get.value(a) - get.value(b)); + for (let i = 1; i < discards.length; i++) { + if ( + discards + .slice(0, i) + .some((card) => get.suit(card) == get.suit(discards[i])) + ) + discards.splice(i--, 1); } cards.removeArray(discards); - if(!cards.length||!discards.length) return 0; - if((discards.some(card=>{ - return get.suit(card)=='heart'; - })&&cards.some(card=>{ - return get.type(card)!='equip'&&(function(card,player){ - const num=get.info('fakezhufu').getMaxUseTarget(card,player); - return num!=-1&&game.countPlayer(target=>player.canUse(card,target,true,true)&&get.effect(target,card,player,player)>0)>num; - }(card,player))&&game.hasPlayer(target=>{ - return target.isFriendOf(player)&&target.hasCard(cardx=>{ - return lib.filter.cardDiscardable(cardx,target)&&get.type2(cardx)==get.type2(card); - },'h'); - }); - }))||discards.some(card=>{ - return get.suit(card)=='diamond'&&cards.some(cardx=>{ - return get.type(cardx)!='equip'&&!game.hasPlayer(target=>{ - return target.countCards('h')>player.countCards('h')-(get.position(card)=='h'?1:0)-(get.position(cardx)=='h'?1:0); - }); - }); - })||(discards.some(card=>{ - return get.suit(card)=='spade'; - })&&player.getHp()==1)||discards.some(card=>{ - return get.suit(card)=='club'&&cards.some(cardx=>{ - return get.tag(cardx,'damage')&&player.countCards('h')-(get.position(card)=='h'?1:0)-(get.position(cardx)=='h'?1:0)==0; - }); - })) return 1; + if (!cards.length || !discards.length) return 0; + if ( + (discards.some((card) => { + return get.suit(card) == "heart"; + }) && + cards.some((card) => { + return ( + get.type(card) != "equip" && + (function (card, player) { + const num = get + .info("fakezhufu") + .getMaxUseTarget(card, player); + return ( + num != -1 && + game.countPlayer( + (target) => + player.canUse(card, target, true, true) && + get.effect(target, card, player, player) > 0 + ) > num + ); + })(card, player) && + game.hasPlayer((target) => { + return ( + target.isFriendOf(player) && + target.hasCard((cardx) => { + return ( + lib.filter.cardDiscardable(cardx, target) && + get.type2(cardx) == get.type2(card) + ); + }, "h") + ); + }) + ); + })) || + discards.some((card) => { + return ( + get.suit(card) == "diamond" && + cards.some((cardx) => { + return ( + get.type(cardx) != "equip" && + !game.hasPlayer((target) => { + return ( + target.countCards("h") > + player.countCards("h") - + (get.position(card) == "h" ? 1 : 0) - + (get.position(cardx) == "h" ? 1 : 0) + ); + }) + ); + }) + ); + }) || + (discards.some((card) => { + return get.suit(card) == "spade"; + }) && + player.getHp() == 1) || + discards.some((card) => { + return ( + get.suit(card) == "club" && + cards.some((cardx) => { + return ( + get.tag(cardx, "damage") && + player.countCards("h") - + (get.position(card) == "h" ? 1 : 0) - + (get.position(cardx) == "h" ? 1 : 0) == + 0 + ); + }) + ); + }) + ) + return 1; return 0; }, }, }, - subSkill:{ - effect:{ - charlotte:true, - onremove:true, - intro:{ - content(storage){ - const suitStorage=storage.slice().sort((a,b)=>lib.suit.indexOf(a[0])-lib.suit.indexOf(b[0])); - const suits=suitStorage.reduce((str,list)=>str+get.translation(list[0]),''); - const usedSuits=suitStorage.filter(list=>list[1]).reduce((str,list)=>str+get.translation(list[0]),''); - let str=''; - str+='
  • 已弃置过的花色:'; - str+=suits; - if(usedSuits.length){ - str+='
  • 已触发过的花色:'; - str+=usedSuits; + subSkill: { + effect: { + charlotte: true, + onremove: true, + intro: { + content(storage) { + const suitStorage = storage + .slice() + .sort((a, b) => lib.suit.indexOf(a[0]) - lib.suit.indexOf(b[0])); + const suits = suitStorage.reduce( + (str, list) => str + get.translation(list[0]), + "" + ); + const usedSuits = suitStorage + .filter((list) => list[1]) + .reduce((str, list) => str + get.translation(list[0]), ""); + let str = ""; + str += "
  • 已弃置过的花色:"; + str += suits; + if (usedSuits.length) { + str += "
  • 已触发过的花色:"; + str += usedSuits; } return str; }, }, - audio:'spwuku', - trigger:{player:'yingbian'}, - filter(event,player){ - return player.getStorage('fakezhufu_effect').some(list=>!list[1]); + audio: "spwuku", + trigger: { player: "yingbian" }, + filter(event, player) { + return player.getStorage("fakezhufu_effect").some((list) => !list[1]); }, - forced:true, - firstDo:true, - async content(event,trigger,player){ - const list=player.getStorage('fakezhufu_effect').filter(i=>!i[1]); - const forced=(function(trigger,player){ - if(trigger.forceYingbian||player.hasSkillTag('forceYingbian')) return true; - const list=(trigger.temporaryYingbian||[]); - return list.includes('force')||get.cardtag(trigger.card,'yingbian_force'); - }(trigger,player)); - if(forced){ - player.popup('yingbian_force_tag',lib.yingbian.condition.color.get('force')); - game.log(player,'触发了','#g【注傅】','为',trigger.card,'添加的应变条件'); + forced: true, + firstDo: true, + async content(event, trigger, player) { + const list = player.getStorage("fakezhufu_effect").filter((i) => !i[1]); + const forced = (function (trigger, player) { + if (trigger.forceYingbian || player.hasSkillTag("forceYingbian")) return true; + const list = trigger.temporaryYingbian || []; + return list.includes("force") || get.cardtag(trigger.card, "yingbian_force"); + })(trigger, player); + if (forced) { + player.popup("yingbian_force_tag", lib.yingbian.condition.color.get("force")); + game.log( + player, + "触发了", + "#g【注傅】", + "为", + trigger.card, + "添加的应变条件" + ); } - const hasYingBian=(trigger.temporaryYingbian||[]),map=get.info('fakezhufu').YingBianMap; - for(const j of list){ - player.storage.fakezhufu_effect[player.getStorage('fakezhufu_effect').indexOf(j)][1]=true; - const tag=map[j[0]][0],eff=map[j[0]][1]; - if(get.cardtag(trigger.card,`yingbian_${tag}`)) continue; - if(j[0]=='heart'){ - if(!forced&&!hasYingBian.includes('add')){ - const {result}=await lib.yingbian.condition.complex.get('zhuzhan')(trigger); - if(result.bool){ - game.log(player,'触发了','#g【注傅】','为',trigger.card,'添加的应变条件(','#g'+get.translation(j[0]),')'); - trigger.yingbian_addTarget=true; - player.addTempSkill('yingbian_changeTarget'); + const hasYingBian = trigger.temporaryYingbian || [], + map = get.info("fakezhufu").YingBianMap; + for (const j of list) { + player.storage.fakezhufu_effect[ + player.getStorage("fakezhufu_effect").indexOf(j) + ][1] = true; + const tag = map[j[0]][0], + eff = map[j[0]][1]; + if (get.cardtag(trigger.card, `yingbian_${tag}`)) continue; + if (j[0] == "heart") { + if (!forced && !hasYingBian.includes("add")) { + const { result } = await lib.yingbian.condition.complex.get( + "zhuzhan" + )(trigger); + if (result.bool) { + game.log( + player, + "触发了", + "#g【注傅】", + "为", + trigger.card, + "添加的应变条件(", + "#g" + get.translation(j[0]), + ")" + ); + trigger.yingbian_addTarget = true; + player.addTempSkill("yingbian_changeTarget"); } - } - else{ - if(!forced){ - game.log(player,'触发了','#g【注傅】','为',trigger.card,'添加的应变条件(','#g'+get.translation(j[0]),')'); + } else { + if (!forced) { + game.log( + player, + "触发了", + "#g【注傅】", + "为", + trigger.card, + "添加的应变条件(", + "#g" + get.translation(j[0]), + ")" + ); } - trigger.yingbian_addTarget=true; - player.addTempSkill('yingbian_changeTarget'); + trigger.yingbian_addTarget = true; + player.addTempSkill("yingbian_changeTarget"); } - } - else{ - const goon=(hasYingBian.includes(eff)||lib.yingbian.condition.simple.get(tag)(trigger)); - if(!forced&&goon){ - player.popup('yingbian_force_tag',lib.yingbian.condition.color.get(eff)); - game.log(player,'触发了','#g【注傅】','为',trigger.card,'添加的应变条件(','#g'+get.translation(j[0]),')'); + } else { + const goon = + hasYingBian.includes(eff) || + lib.yingbian.condition.simple.get(tag)(trigger); + if (!forced && goon) { + player.popup( + "yingbian_force_tag", + lib.yingbian.condition.color.get(eff) + ); + game.log( + player, + "触发了", + "#g【注傅】", + "为", + trigger.card, + "添加的应变条件(", + "#g" + get.translation(j[0]), + ")" + ); } - if(forced||goon) await game.yingbianEffect(trigger,lib.yingbian.effect.get(eff)); + if (forced || goon) + await game.yingbianEffect(trigger, lib.yingbian.effect.get(eff)); } } }, }, }, - YingBianMap:{ - 'heart':['zhuzhan','add'], - 'diamond':['fujia','hit'], - 'spade':['canqu','draw'], - 'club':['kongchao','damage'], + YingBianMap: { + heart: ["zhuzhan", "add"], + diamond: ["fujia", "hit"], + spade: ["canqu", "draw"], + club: ["kongchao", "damage"], }, - getMaxUseTarget(card,player){ + getMaxUseTarget(card, player) { let range; - const select=get.copy(get.info(card).selectTarget); - if(select==undefined) range=[1,1]; - else if(typeof select=='number') range=[select,select]; - else if(get.itemtype(select)=='select') range=select; - else if(typeof select=='function') range=select(card,player); - game.checkMod(card,player,range,'selectTarget',player); + const select = get.copy(get.info(card).selectTarget); + if (select == undefined) range = [1, 1]; + else if (typeof select == "number") range = [select, select]; + else if (get.itemtype(select) == "select") range = select; + else if (typeof select == "function") range = select(card, player); + game.checkMod(card, player, range, "selectTarget", player); return range; }, }, - fakeguishu:{ - inherit:'hmkguishu', - usable:1, + fakeguishu: { + inherit: "hmkguishu", + usable: 1, }, - fakeyuanyu:{ - inherit:'hmkyuanyu', - filter(event,player){ - if(event.num<=0||!event.source) return false; + fakeyuanyu: { + inherit: "hmkyuanyu", + filter(event, player) { + if (event.num <= 0 || !event.source) return false; return !event.source.inRange(player); }, - content(){ + content() { trigger.num--; }, - ai:{ - effect:{ - target(card,player,target){ - if(player.hasSkillTag('jueqing',false,target)) return; - if(player.inRange(target)) return; - const num=get.tag(card,'damage'); - if(num){ - if(num>1) return 0.5; - return 'zeroplayertarget'; + ai: { + effect: { + target(card, player, target) { + if (player.hasSkillTag("jueqing", false, target)) return; + if (player.inRange(target)) return; + const num = get.tag(card, "damage"); + if (num) { + if (num > 1) return 0.5; + return "zeroplayertarget"; } }, }, }, }, - fakemibei:{ - audio:'mibei', - trigger:{player:'phaseZhunbeiBegin'}, - filter(event,player){ + fakemibei: { + audio: "mibei", + trigger: { player: "phaseZhunbeiBegin" }, + filter(event, player) { return !player.isMaxHandcard(); }, - async cost(event,trigger,player){ - const filterTarget=(card,player,target)=>{ - return target!=player&&target.isMaxHandcard(); - },targetx=game.filterPlayer(current=>filterTarget(null,player,current)); - if(targetx.length==1) event.result={bool:true,targets:targetx}; - else event.result=await player.chooseTarget(filterTarget,true) - .set('prompt2',lib.translate.fakemibei_info) - .set('prompt','请选择【秘备】的目标').set('ai',target=>{ - const player=get.event('player'); - return get.attitude(player,target); - }).forResult(); - }, - preHidden:true, - async content(event,trigger,player){ - const target=event.targets[0]; - const {result:{junling,targets}}=await target.chooseJunlingFor(player); - const {result:{index}}=await player.chooseJunlingControl(target,junling,targets).set('prompt','秘备:是否执行军令?'); - if(index==0) await player.carryOutJunling(target,junling,targets); - }, - group:'fakemibei_junling', - subSkill:{ - junling:{ - audio:'mibei', - trigger:{player:['carryOutJunlingEnd','chooseJunlingControlEnd']}, - filter(event,player){ - if(event.name=='carryOutJunling'){ - return event.source.countCards('h')>player.countCards('h'); - } - return event.result.index==1&&player.countCards('h'); + async cost(event, trigger, player) { + const filterTarget = (card, player, target) => { + return target != player && target.isMaxHandcard(); }, - forced:true, - locked:false, - async content(event,trigger,player){ - if(trigger.name=='carryOutJunling'){ - const num=Math.min(5,trigger.source.countCards('h')-player.countCards('h')); - await player.draw(num); + targetx = game.filterPlayer((current) => filterTarget(null, player, current)); + if (targetx.length == 1) event.result = { bool: true, targets: targetx }; + else + event.result = await player + .chooseTarget(filterTarget, true) + .set("prompt2", lib.translate.fakemibei_info) + .set("prompt", "请选择【秘备】的目标") + .set("ai", (target) => { + const player = get.event("player"); + return get.attitude(player, target); + }) + .forResult(); + }, + preHidden: true, + async content(event, trigger, player) { + const target = event.targets[0]; + const { + result: { junling, targets }, + } = await target.chooseJunlingFor(player); + const { + result: { index }, + } = await player + .chooseJunlingControl(target, junling, targets) + .set("prompt", "秘备:是否执行军令?"); + if (index == 0) await player.carryOutJunling(target, junling, targets); + }, + group: "fakemibei_junling", + subSkill: { + junling: { + audio: "mibei", + trigger: { player: ["carryOutJunlingEnd", "chooseJunlingControlEnd"] }, + filter(event, player) { + if (event.name == "carryOutJunling") { + return event.source.countCards("h") > player.countCards("h"); } - else{ - const {result:{bool,cards}}=await player.chooseCard('秘备:展示一至三张手牌,本回合你可以将其中一张牌当作另一张基本牌或普通锦囊牌使用一次',[1,3],true).set('ai',card=>{ - const player=get.event('player'),goon=_status.currentPhase==player; - if(goon) return player.getUseValue(card)/get.value(card); - return get.value(card); - }); - if(bool){ - await player.showCards(cards,get.translation(player)+'发动了【秘备】'); - player.addGaintag(cards,'fakemibei_effect'); - player.addTempSkill('fakemibei_effect'); + return event.result.index == 1 && player.countCards("h"); + }, + forced: true, + locked: false, + async content(event, trigger, player) { + if (trigger.name == "carryOutJunling") { + const num = Math.min( + 5, + trigger.source.countCards("h") - player.countCards("h") + ); + await player.draw(num); + } else { + const { + result: { bool, cards }, + } = await player + .chooseCard( + "秘备:展示一至三张手牌,本回合你可以将其中一张牌当作另一张基本牌或普通锦囊牌使用一次", + [1, 3], + true + ) + .set("ai", (card) => { + const player = get.event("player"), + goon = _status.currentPhase == player; + if (goon) return player.getUseValue(card) / get.value(card); + return get.value(card); + }); + if (bool) { + await player.showCards(cards, get.translation(player) + "发动了【秘备】"); + player.addGaintag(cards, "fakemibei_effect"); + player.addTempSkill("fakemibei_effect"); } } }, }, - effect:{ - charlotte:true, - onremove(player){ - player.removeGaintag('fakemibei_effect'); + effect: { + charlotte: true, + onremove(player) { + player.removeGaintag("fakemibei_effect"); }, - hiddenCard(player,name){ - const cards=player.getCards('h',card=>card.hasGaintag('fakemibei_effect')); - if(cards.length<2) return false; - const type=get.type(name); - if(type!='basic'&&type!='trick') return false; - return cards.slice().map(i=>i.name).includes(name); + hiddenCard(player, name) { + const cards = player.getCards("h", (card) => card.hasGaintag("fakemibei_effect")); + if (cards.length < 2) return false; + const type = get.type(name); + if (type != "basic" && type != "trick") return false; + return cards + .slice() + .map((i) => i.name) + .includes(name); }, - audio:'mibei', - enable:'phaseUse', - chooseButton:{ - dialog(event,player){ - const list=player.getCards('h',card=>{ - const type=get.type(card); - if(type!='basic'&&type!='trick') return false; - return card.hasGaintag('fakemibei_effect'); - }).sort((a,b)=>{ - return lib.inpile.indexOf(a.name)+get.natureList(a,false).reduce((sum,nature)=>{ - return sum+lib.inpile_nature.indexOf(nature); - },0)-lib.inpile.indexOf(b.name)-get.natureList(b,false).reduce((sum,nature)=>{ - return sum+lib.inpile_nature.indexOf(nature); - },0); - }).slice().map(card=>[get.translation(get.type(card)),'',card.name,card.nature]); - return ui.create.dialog('秘备',[list,'vcard']); + audio: "mibei", + enable: "phaseUse", + chooseButton: { + dialog(event, player) { + const list = player + .getCards("h", (card) => { + const type = get.type(card); + if (type != "basic" && type != "trick") return false; + return card.hasGaintag("fakemibei_effect"); + }) + .sort((a, b) => { + return ( + lib.inpile.indexOf(a.name) + + get.natureList(a, false).reduce((sum, nature) => { + return sum + lib.inpile_nature.indexOf(nature); + }, 0) - + lib.inpile.indexOf(b.name) - + get.natureList(b, false).reduce((sum, nature) => { + return sum + lib.inpile_nature.indexOf(nature); + }, 0) + ); + }) + .slice() + .map((card) => [ + get.translation(get.type(card)), + "", + card.name, + card.nature, + ]); + return ui.create.dialog("秘备", [list, "vcard"]); }, - filter(button,player){ - const event=get.event().getParent(); - return event.filterCard({name:button.link[2],nature:button.link[3]},player,event); + filter(button, player) { + const event = get.event().getParent(); + return event.filterCard( + { name: button.link[2], nature: button.link[3] }, + player, + event + ); }, - check(button){ - const player=get.event('player'); - const card={name:button.link[2],nature:button.link[3]}; - if(player.countCards('hes',cardx=>cardx.name==card.name)) return 0; + check(button) { + const player = get.event("player"); + const card = { name: button.link[2], nature: button.link[3] }; + if (player.countCards("hes", (cardx) => cardx.name == card.name)) return 0; return player.getUseValue(card); }, - backup(links,player){ + backup(links, player) { return { - audio:'chengshang', - filterCard(card,player){ - const cardx=get.info('fakemibei_effect_backup').viewAs; - if(cardx.name==card.name&&cardx.nature==card.nature) return false; - return card.hasGaintag('fakemibei_effect'); + audio: "chengshang", + filterCard(card, player) { + const cardx = get.info("fakemibei_effect_backup").viewAs; + if (cardx.name == card.name && cardx.nature == card.nature) + return false; + return card.hasGaintag("fakemibei_effect"); }, - position:'h', - popname:true, - precontent(){ - player.logSkill('fakemibei_effect'); + position: "h", + popname: true, + precontent() { + player.logSkill("fakemibei_effect"); delete event.result.skill; - player.tempBanSkill('fakemibei_effect',null,false); + player.tempBanSkill("fakemibei_effect", null, false); }, - viewAs:{ - name:links[0][2], - nature:links[0][3], + viewAs: { + name: links[0][2], + nature: links[0][3], }, - } + }; }, - prompt(links,player){ - return '将一张“秘备”牌当作'+(get.translation(links[0][3])||'')+get.translation(links[0][2])+'使用'; + prompt(links, player) { + return ( + "将一张“秘备”牌当作" + + (get.translation(links[0][3]) || "") + + get.translation(links[0][2]) + + "使用" + ); }, }, }, }, }, - fakeqizhi:{ - audio:'qizhi', - inherit:'qizhi', - trigger:{player:'useCard1'}, - filter(event,player){ - if(!event.targets||!event.targets.length) return false; - if(_status.currentPhase!=player) return false; - if(get.type(event.card)=='equip') return false; - return game.hasPlayer(target=>!event.targets.includes(target)&&target.countCards('he')>0); + fakeqizhi: { + audio: "qizhi", + inherit: "qizhi", + trigger: { player: "useCard1" }, + filter(event, player) { + if (!event.targets || !event.targets.length) return false; + if (_status.currentPhase != player) return false; + if (get.type(event.card) == "equip") return false; + return game.hasPlayer( + (target) => !event.targets.includes(target) && target.countCards("he") > 0 + ); }, - direct:false, - async cost(event,trigger,player){ - event.result=await player.chooseTarget(get.prompt2('fakeqizhi'),(card,player,target)=>{ - return !get.event().getTrigger().targets.includes(target)&&target.countCards('he')>0; - }).set('ai',target=>{ - const player=get.event('player'); - if(target==player) return 2; - if(get.attitude(player,target)<=0) return 1; - return 0.5; - }).forResult(); + direct: false, + async cost(event, trigger, player) { + event.result = await player + .chooseTarget(get.prompt2("fakeqizhi"), (card, player, target) => { + return ( + !get.event().getTrigger().targets.includes(target) && + target.countCards("he") > 0 + ); + }) + .set("ai", (target) => { + const player = get.event("player"); + if (target == player) return 2; + if (get.attitude(player, target) <= 0) return 1; + return 0.5; + }) + .forResult(); }, - async content(event,trigger,player){ - const target=event.targets[0]; - const {result:{bool,cards}}=await player.discardPlayerCard(target,'he',true); - if(bool){ + async content(event, trigger, player) { + const target = event.targets[0]; + const { + result: { bool, cards }, + } = await player.discardPlayerCard(target, "he", true); + if (bool) { await target.draw(); - if(cards.some(i=>get.suit(i,target)==get.suit(trigger.card))){ - trigger.forceYingbian=true; + if (cards.some((i) => get.suit(i, target) == get.suit(trigger.card))) { + trigger.forceYingbian = true; } } }, }, - fakejinqu:{ - audio:'jinqu', - trigger:{player:'phaseJieshuBegin'}, - check(event,player){ - return player.getHistory('useSkill',evt=>{ - return evt.skill=='fakeqizhi'; - }).length>=player.countCards('h'); + fakejinqu: { + audio: "jinqu", + trigger: { player: "phaseJieshuBegin" }, + check(event, player) { + return ( + player.getHistory("useSkill", (evt) => { + return evt.skill == "fakeqizhi"; + }).length >= player.countCards("h") + ); }, - prompt2(event,player){ - const num=player.getHistory('useSkill',evt=>evt.skill=='fakeqizhi').length; - return '摸两张牌,然后将手牌弃置至'+get.cnNumber(num)+'张'; + prompt2(event, player) { + const num = player.getHistory("useSkill", (evt) => evt.skill == "fakeqizhi").length; + return "摸两张牌,然后将手牌弃置至" + get.cnNumber(num) + "张"; }, - content(){ - 'step 0' + content() { + "step 0"; player.draw(2); - 'step 1' - var dh=player.countCards('h')-player.getHistory('useSkill',evt=>{ - return evt.skill=='fakeqizhi'; - }).length; - if(dh>0) player.chooseToDiscard(dh,true); + "step 1"; + var dh = + player.countCards("h") - + player.getHistory("useSkill", (evt) => { + return evt.skill == "fakeqizhi"; + }).length; + if (dh > 0) player.chooseToDiscard(dh, true); }, - ai:{combo:'fakeqizhi'}, + ai: { combo: "fakeqizhi" }, }, - fakejuzhan:{ - zhuanhuanji:true, - locked:false, - marktext:'☯', - intro:{ - content(storage){ - if(storage) return '当你使用【杀】指定目标后,你可以获得其X张牌,然后若你的武将牌均明置,则其可以暗置此武将牌,且你本回合不能明置此武将牌(X为你已损失的体力值且至少为1)'; - return '当你成为【杀】的目标后,你可以与其各摸X张牌,然后其武将牌均明置,则你可以暗置其一张武将牌,且其本回合不能明置此武将牌(X为其已损失的体力值且至少为1)'; + fakejuzhan: { + zhuanhuanji: true, + locked: false, + marktext: "☯", + intro: { + content(storage) { + if (storage) + return "当你使用【杀】指定目标后,你可以获得其X张牌,然后若你的武将牌均明置,则其可以暗置此武将牌,且你本回合不能明置此武将牌(X为你已损失的体力值且至少为1)"; + return "当你成为【杀】的目标后,你可以与其各摸X张牌,然后其武将牌均明置,则你可以暗置其一张武将牌,且其本回合不能明置此武将牌(X为其已损失的体力值且至少为1)"; }, }, - audio:'nzry_juzhan_1', - trigger:{ - player:'useCardToPlayered', - target:'useCardToTargeted', + audio: "nzry_juzhan_1", + trigger: { + player: "useCardToPlayered", + target: "useCardToTargeted", }, - filter(event,player){ - if(event.card.name!='sha') return false; - const storage=player.storage.fakejuzhan; - if((event.player==player)!=Boolean(storage)) return false; - if(storage&&!event.target.countCards('he')) return false; + filter(event, player) { + if (event.card.name != "sha") return false; + const storage = player.storage.fakejuzhan; + if ((event.player == player) != Boolean(storage)) return false; + if (storage && !event.target.countCards("he")) return false; return true; }, - logTarget(event,player){ - const storage=player.storage.fakejuzhan; - return event[Boolean(storage)?'target':'player']; + logTarget(event, player) { + const storage = player.storage.fakejuzhan; + return event[Boolean(storage) ? "target" : "player"]; }, - async content(event,trigger,player){ - const storage=player.storage.fakejuzhan; - player.changeZhuanhuanji('fakejuzhan'); - const target=trigger[Boolean(storage)?'target':'player']; - const num=Math.max(target.getDamagedHp(),1); - if(!storage){ - await player.draw(num,'nodelay'); + async content(event, trigger, player) { + const storage = player.storage.fakejuzhan; + player.changeZhuanhuanji("fakejuzhan"); + const target = trigger[Boolean(storage) ? "target" : "player"]; + const num = Math.max(target.getDamagedHp(), 1); + if (!storage) { + await player.draw(num, "nodelay"); await target.draw(num); - if(!target.isUnseen(2)){ - const {result:{bool,links}}=await player.chooseButton([ - '拒战:是否暗置'+get.translation(target)+'的一张武将牌?', - '
    '+get.translation(target)+'的武将牌
    ', - [[target.name1,target.name2],'character'], - ]).set('filterButton',button=>!get.is.jun(button.link)); - if(bool){ - await target.hideCharacter(target.name1==links[0]?0:1); - target.addTempSkill('donggui2'); + if (!target.isUnseen(2)) { + const { + result: { bool, links }, + } = await player + .chooseButton([ + "拒战:是否暗置" + get.translation(target) + "的一张武将牌?", + '
    ' + get.translation(target) + "的武将牌
    ", + [[target.name1, target.name2], "character"], + ]) + .set("filterButton", (button) => !get.is.jun(button.link)); + if (bool) { + await target.hideCharacter(target.name1 == links[0] ? 0 : 1); + target.addTempSkill("donggui2"); } } - } - else{ - await player.gainPlayerCard(target,num,'he',true); - const names=[player.name1,player.name2].filter(i=>{ - return get.character(i,3).includes('fakejuzhan'); + } else { + await player.gainPlayerCard(target, num, "he", true); + const names = [player.name1, player.name2].filter((i) => { + return get.character(i, 3).includes("fakejuzhan"); }); - if(!player.isUnseen(2)&&names.length){ - const {result:{bool,links}}=await target.chooseBool('拒战:是否暗置'+get.translation(player)+'的'+(names.includes(player.name1)?'主将':'')+(names.length>1?'和':'')+(names.includes(player.name2)?'副将':'')+'?'); - if(bool){ - if(names.includes(player.name1)) await player.hideCharacter(0); - if(names.includes(player.name2)) await player.hideCharacter(1); - player.addTempSkill('donggui2'); + if (!player.isUnseen(2) && names.length) { + const { + result: { bool, links }, + } = await target.chooseBool( + "拒战:是否暗置" + + get.translation(player) + + "的" + + (names.includes(player.name1) ? "主将" : "") + + (names.length > 1 ? "和" : "") + + (names.includes(player.name2) ? "副将" : "") + + "?" + ); + if (bool) { + if (names.includes(player.name1)) await player.hideCharacter(0); + if (names.includes(player.name2)) await player.hideCharacter(1); + player.addTempSkill("donggui2"); } } } }, - group:'fakejuzhan_mark', - subSkill:{ - mark:{ - charlotte:true, - trigger:{player:['hideCharacterEnd','showCharacterEnd']}, - filter(event,player){ - return get.character(event[event.name=='hideCharacter'?'toHide':'toShow'],3).includes('fakejuzhan'); + group: "fakejuzhan_mark", + subSkill: { + mark: { + charlotte: true, + trigger: { player: ["hideCharacterEnd", "showCharacterEnd"] }, + filter(event, player) { + return get + .character(event[event.name == "hideCharacter" ? "toHide" : "toShow"], 3) + .includes("fakejuzhan"); }, - forced:true, - popup:false, - firstDo:true, - content(){ - player[(trigger.name=='hideCharacter'?'un':'')+'markSkill']('fakejuzhan'); + forced: true, + popup: false, + firstDo: true, + content() { + player[(trigger.name == "hideCharacter" ? "un" : "") + "markSkill"]("fakejuzhan"); }, }, }, }, - fakedanshou:{ - audio:'mobiledanshou', - trigger:{global:'phaseZhunbeiBegin'}, - filter(event,player){ - return ['h','e','j'].some(pos=>player.getCards(pos).every(card=>lib.filter.cardDiscardable(card,player))); + fakedanshou: { + audio: "mobiledanshou", + trigger: { global: "phaseZhunbeiBegin" }, + filter(event, player) { + return ["h", "e", "j"].some((pos) => + player.getCards(pos).every((card) => lib.filter.cardDiscardable(card, player)) + ); }, - async cost(event,trigger,player){ - let list=[],map={'h':'手牌区','e':'装备区','j':'判定区'}; - list.addArray(['h','e','j'].filter(pos=>{ - return player.getCards(pos).every(card=>lib.filter.cardDiscardable(card,player)); - }).map(i=>map[i])); - list.push('cancel2'); - const {result:{control}}=await player.chooseControl(list).set('prompt',get.prompt2('fakedanshou',trigger.player)).set('ai',()=>{ - const player=get.event().player,controls=get.event().controls.slice(); - if(controls.includes('判定区')) return '判定区'; - if(controls.includes('装备区')&&player.countCards('e')<3) return '装备区'; - if(controls.includes('手牌区')&&player.countCards('e')<5) return '手牌区'; - return 'cancel2'; - }); - event.result={bool:(control!='cancel2'),cost_data:control}; + async cost(event, trigger, player) { + let list = [], + map = { h: "手牌区", e: "装备区", j: "判定区" }; + list.addArray( + ["h", "e", "j"] + .filter((pos) => { + return player + .getCards(pos) + .every((card) => lib.filter.cardDiscardable(card, player)); + }) + .map((i) => map[i]) + ); + list.push("cancel2"); + const { + result: { control }, + } = await player + .chooseControl(list) + .set("prompt", get.prompt2("fakedanshou", trigger.player)) + .set("ai", () => { + const player = get.event().player, + controls = get.event().controls.slice(); + if (controls.includes("判定区")) return "判定区"; + if (controls.includes("装备区") && player.countCards("e") < 3) return "装备区"; + if (controls.includes("手牌区") && player.countCards("e") < 5) return "手牌区"; + return "cancel2"; + }); + event.result = { bool: control != "cancel2", cost_data: control }; }, - round:1, - logTarget:'player', - async content(event,trigger,player){ + round: 1, + logTarget: "player", + async content(event, trigger, player) { player.popup(event.cost_data); - await player.discard(player.getCards({'手牌区':'h','装备区':'e','判定区':'j'}[event.cost_data])); - player.addTempSkill('fakedanshou_effect'); - player.addMark('fakedanshou_effect',1,false); + await player.discard( + player.getCards({ 手牌区: "h", 装备区: "e", 判定区: "j" }[event.cost_data]) + ); + player.addTempSkill("fakedanshou_effect"); + player.addMark("fakedanshou_effect", 1, false); }, - subSkill:{ - effect:{ - charlotte:true, - onremove(player){ + subSkill: { + effect: { + charlotte: true, + onremove(player) { delete player.storage.fakedanshou_effect; delete player._fakedanshou_effect; }, - audio:'mobiledanshou', - trigger:{global:['phaseJudgeBegin','phaseDrawBegin','phaseUseBegin','phaseDiscardBegin']}, - async cost(event,trigger,player){ - const {result:{control}}=await player.chooseControl('摸牌','增加摸牌数').set('prompt','胆守:请选择一项').set('ai',()=>{ - const player=get.event().player,trigger=get.event().getTrigger(); - if(trigger.name=='phaseJudge') return '增加摸牌数'; - if(trigger.name=='phaseDiscard') return '摸牌'; - if(trigger.name=='phaseDraw'){ - if(get.damageEffect(trigger.player,player,player)>0){ - player._fakedanshou_effect=true; - return '增加摸牌数'; - } - } - return player._fakedanshou_effect?'增加摸牌数':'摸牌'; - }); - event.result={bool:true,cost_data:control}; + audio: "mobiledanshou", + trigger: { + global: [ + "phaseJudgeBegin", + "phaseDrawBegin", + "phaseUseBegin", + "phaseDiscardBegin", + ], }, - logTarget:'player', - async content(event,trigger,player){ - if(event.cost_data=='增加摸牌数'){ - player.addMark('fakedanshou_effect',1,false); - } - else{ - const num=player.countMark('fakedanshou_effect'); + async cost(event, trigger, player) { + const { + result: { control }, + } = await player + .chooseControl("摸牌", "增加摸牌数") + .set("prompt", "胆守:请选择一项") + .set("ai", () => { + const player = get.event().player, + trigger = get.event().getTrigger(); + if (trigger.name == "phaseJudge") return "增加摸牌数"; + if (trigger.name == "phaseDiscard") return "摸牌"; + if (trigger.name == "phaseDraw") { + if (get.damageEffect(trigger.player, player, player) > 0) { + player._fakedanshou_effect = true; + return "增加摸牌数"; + } + } + return player._fakedanshou_effect ? "增加摸牌数" : "摸牌"; + }); + event.result = { bool: true, cost_data: control }; + }, + logTarget: "player", + async content(event, trigger, player) { + if (event.cost_data == "增加摸牌数") { + player.addMark("fakedanshou_effect", 1, false); + } else { + const num = player.countMark("fakedanshou_effect"); await player.draw(num); - if(num>=4){ - const {result:{bool}}=await player.chooseBool('胆守:是否对'+get.translation(trigger.player)+'造成1点伤害?').set('choice',get.damageEffect(trigger.player,player,player)>0); - if(bool){ + if (num >= 4) { + const { + result: { bool }, + } = await player + .chooseBool( + "胆守:是否对" + get.translation(trigger.player) + "造成1点伤害?" + ) + .set("choice", get.damageEffect(trigger.player, player, player) > 0); + if (bool) { player.line(trigger.player); await trigger.player.damage(); } @@ -2665,872 +3867,1252 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, }, - fakexunxi:{ - trigger:{global:'showCharacterEnd'}, - filter(event,player){ - const card=new lib.element.VCard({name:'sha'}); - return event.player!=player&&event.player!=_status.currentPhase&&player.canUse(card,event.player,false); + fakexunxi: { + trigger: { global: "showCharacterEnd" }, + filter(event, player) { + const card = new lib.element.VCard({ name: "sha" }); + return ( + event.player != player && + event.player != _status.currentPhase && + player.canUse(card, event.player, false) + ); }, - check(event,player){ - const card=new lib.element.VCard({name:'sha'}); - return get.effect(event.player,card,player,player)>0; + check(event, player) { + const card = new lib.element.VCard({ name: "sha" }); + return get.effect(event.player, card, player, player) > 0; }, - logTarget:'player', - async content(event,trigger,player){ - const card=new lib.element.VCard({name:'sha'}); - await player.useCard(card,trigger.player,false); + logTarget: "player", + async content(event, trigger, player) { + const card = new lib.element.VCard({ name: "sha" }); + await player.useCard(card, trigger.player, false); }, }, - fakehuanjia:{ - trigger:{ - player:'useCardToPlayered', - target:'useCardToTargeted', + fakehuanjia: { + trigger: { + player: "useCardToPlayered", + target: "useCardToTargeted", }, - filter(event,player){ - if(event.card.name!='sha') return false; - if(event.target==player){ - if(player.getStorage('fakehuanjia_used').includes(2)) return false; + filter(event, player) { + if (event.card.name != "sha") return false; + if (event.target == player) { + if (player.getStorage("fakehuanjia_used").includes(2)) return false; return event.player.getEquips(2).length; } - if(event.targets.length!=1) return false; - if(player.getStorage('fakehuanjia_used').includes(1)) return false; + if (event.targets.length != 1) return false; + if (player.getStorage("fakehuanjia_used").includes(1)) return false; return event.target.getEquips(1).length; }, - logTarget(event,player){ - return event.target==player?event.player:event.target; + logTarget(event, player) { + return event.target == player ? event.player : event.target; }, - forced:true, - async content(event,trigger,player){ - player.addTempSkill('fakehuanjia_used'); - if(trigger.target==player){ - player.markAuto('fakehuanjia_used',[2]); - if(!player.getEquips(2).length&&player.hasEmptySlot(2)){ - player.addSkill('fakehuanjia_equip2'); - player.markAuto('fakehuanjia_equip2',[trigger.player]); - player.when({global:'phaseAfter',player:['equipEnd','disableEquipEnd','die']}) - .filter((evt,player)=>{ - if(evt.name=='phase'||evt.name=='die') return true; - if(evt.name=='discardEquip') return !player.hasEmptySlot(2); - return get.type(evt.card)=='equip2'; - }) - .then(()=>player.removeSkill('fakehuanjia_equip2')); - const cards=trigger.player.getEquips(2); - if(cards.length){ - const skills=cards.reduce((list,card)=>{ - if(get.info(card)&&get.info(card).skills) list.addArray(get.info(card).skills); + forced: true, + async content(event, trigger, player) { + player.addTempSkill("fakehuanjia_used"); + if (trigger.target == player) { + player.markAuto("fakehuanjia_used", [2]); + if (!player.getEquips(2).length && player.hasEmptySlot(2)) { + player.addSkill("fakehuanjia_equip2"); + player.markAuto("fakehuanjia_equip2", [trigger.player]); + player + .when({ + global: "phaseAfter", + player: ["equipEnd", "disableEquipEnd", "die"], + }) + .filter((evt, player) => { + if (evt.name == "phase" || evt.name == "die") return true; + if (evt.name == "discardEquip") return !player.hasEmptySlot(2); + return get.type(evt.card) == "equip2"; + }) + .then(() => player.removeSkill("fakehuanjia_equip2")); + const cards = trigger.player.getEquips(2); + if (cards.length) { + const skills = cards.reduce((list, card) => { + if (get.info(card) && get.info(card).skills) + list.addArray(get.info(card).skills); return list; - },[]); - if(skills.length) player.addAdditionalSkill('fakehuanjia_equip2',skills); + }, []); + if (skills.length) player.addAdditionalSkill("fakehuanjia_equip2", skills); } } - } - else{ - player.markAuto('fakehuanjia_used',[1]); - if(!player.getEquips(1).length&&player.hasEmptySlot(1)){ - player.addSkill('fakehuanjia_equip1'); - player.markAuto('fakehuanjia_equip1',[trigger.target]); - player.when({global:'phaseAfter',player:['equipEnd','disableEquipEnd','die']}) - .filter((evt,player)=>{ - if(evt.name=='phase'||evt.name=='die') return true; - if(evt.name=='discardEquip') return !player.hasEmptySlot(1); - return get.type(evt.card)=='equip1'; - }) - .then(()=>player.removeSkill('fakehuanjia_equip1')); - const cards=trigger.target.getEquips(1); - if(cards.length){ - const skills=cards.reduce((list,card)=>{ - if(get.info(card)&&get.info(card).skills) list.addArray(get.info(card).skills); + } else { + player.markAuto("fakehuanjia_used", [1]); + if (!player.getEquips(1).length && player.hasEmptySlot(1)) { + player.addSkill("fakehuanjia_equip1"); + player.markAuto("fakehuanjia_equip1", [trigger.target]); + player + .when({ + global: "phaseAfter", + player: ["equipEnd", "disableEquipEnd", "die"], + }) + .filter((evt, player) => { + if (evt.name == "phase" || evt.name == "die") return true; + if (evt.name == "discardEquip") return !player.hasEmptySlot(1); + return get.type(evt.card) == "equip1"; + }) + .then(() => player.removeSkill("fakehuanjia_equip1")); + const cards = trigger.target.getEquips(1); + if (cards.length) { + const skills = cards.reduce((list, card) => { + if (get.info(card) && get.info(card).skills) + list.addArray(get.info(card).skills); return list; - },[]); - if(skills.length) player.addAdditionalSkill('fakehuanjia_equip1',skills); + }, []); + if (skills.length) player.addAdditionalSkill("fakehuanjia_equip1", skills); } } } }, - subSkill:{ - used:{ - charlotte:true, - onremove:true, + subSkill: { + used: { + charlotte: true, + onremove: true, }, - equip1:{ - charlotte:true, - onremove:true, - mark:true, - marktext:'攻', - mod:{ - attackRange(player,num){ - const targets=player.getStorage('fakehuanjia_equip1').filter(i=>i.isIn()); - return num+targets.reduce((sum,target)=>{ - return sum+target.getEquipRange(); - },0); + equip1: { + charlotte: true, + onremove: true, + mark: true, + marktext: "攻", + mod: { + attackRange(player, num) { + const targets = player + .getStorage("fakehuanjia_equip1") + .filter((i) => i.isIn()); + return ( + num + + targets.reduce((sum, target) => { + return sum + target.getEquipRange(); + }, 0) + ); }, }, - intro:{content:'视为装备$的武器'}, - trigger:{global:['loseAfter','equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter','die']}, - filter(event,player){ - return game.hasPlayer(target=>{ - if(!player.getStorage('fakehuanjia_equip1').includes(target)) return false; - if(event.name=='die'&&event.player==target) return true; - if(event.name=='equip'&&event.player==target) return get.subtype(event.card)=='equip1'; - if(event.getl){ - const evt=event.getl(target); - return evt&&evt.player==target&&evt.es&&evt.es.some(i=>get.subtype(i)=='equip1'); + intro: { content: "视为装备$的武器" }, + trigger: { + global: [ + "loseAfter", + "equipAfter", + "addJudgeAfter", + "gainAfter", + "loseAsyncAfter", + "addToExpansionAfter", + "die", + ], + }, + filter(event, player) { + return game.hasPlayer((target) => { + if (!player.getStorage("fakehuanjia_equip1").includes(target)) return false; + if (event.name == "die" && event.player == target) return true; + if (event.name == "equip" && event.player == target) + return get.subtype(event.card) == "equip1"; + if (event.getl) { + const evt = event.getl(target); + return ( + evt && + evt.player == target && + evt.es && + evt.es.some((i) => get.subtype(i) == "equip1") + ); } return false; }); }, - forced:true, - popup:false, - content(){ - const targets=player.getStorage('fakehuanjia_equip1').filter(i=>i.isIn()); - const skills=targets.reduce((list,target)=>{ - const cards=target.getEquips(1); - if(cards.length){ - const skills=cards.reduce((listx,card)=>{ - if(get.info(card)&&get.info(card).skills) listx.addArray(get.info(card).skills); + forced: true, + popup: false, + content() { + const targets = player.getStorage("fakehuanjia_equip1").filter((i) => i.isIn()); + const skills = targets.reduce((list, target) => { + const cards = target.getEquips(1); + if (cards.length) { + const skills = cards.reduce((listx, card) => { + if (get.info(card) && get.info(card).skills) + listx.addArray(get.info(card).skills); return listx; - },[]); - if(skills.length) list.addArray(skills); + }, []); + if (skills.length) list.addArray(skills); } return list; - },[]); - player.addAdditionalSkill('fakehuanjia_equip1',skills); + }, []); + player.addAdditionalSkill("fakehuanjia_equip1", skills); }, }, - equip2:{ - charlotte:true, - onremove:true, - mark:true, - marktext:'防', - intro:{content:'视为装备$的防具'}, - trigger:{global:['loseAfter','equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter','die']}, - filter(event,player){ - return game.hasPlayer(target=>{ - if(!player.getStorage('fakehuanjia_equip2').includes(target)) return false; - if(event.name=='die'&&event.player==target) return true; - if(event.name=='equip'&&event.player==target) return get.subtype(event.card)=='equip2'; - if(event.getl){ - const evt=event.getl(target); - return evt&&evt.player==target&&evt.es&&evt.es.some(i=>get.subtype(i)=='equip2'); + equip2: { + charlotte: true, + onremove: true, + mark: true, + marktext: "防", + intro: { content: "视为装备$的防具" }, + trigger: { + global: [ + "loseAfter", + "equipAfter", + "addJudgeAfter", + "gainAfter", + "loseAsyncAfter", + "addToExpansionAfter", + "die", + ], + }, + filter(event, player) { + return game.hasPlayer((target) => { + if (!player.getStorage("fakehuanjia_equip2").includes(target)) return false; + if (event.name == "die" && event.player == target) return true; + if (event.name == "equip" && event.player == target) + return get.subtype(event.card) == "equip2"; + if (event.getl) { + const evt = event.getl(target); + return ( + evt && + evt.player == target && + evt.es && + evt.es.some((i) => get.subtype(i) == "equip2") + ); } return false; }); }, - forced:true, - popup:false, - content(){ - const targets=player.getStorage('fakehuanjia_equip2').filter(i=>i.isIn()); - const skills=targets.reduce((list,target)=>{ - const cards=target.getEquips(2); - if(cards.length){ - const skills=cards.reduce((listx,card)=>{ - if(get.info(card)&&get.info(card).skills) listx.addArray(get.info(card).skills); + forced: true, + popup: false, + content() { + const targets = player.getStorage("fakehuanjia_equip2").filter((i) => i.isIn()); + const skills = targets.reduce((list, target) => { + const cards = target.getEquips(2); + if (cards.length) { + const skills = cards.reduce((listx, card) => { + if (get.info(card) && get.info(card).skills) + listx.addArray(get.info(card).skills); return listx; - },[]); - if(skills.length) list.addArray(skills); + }, []); + if (skills.length) list.addArray(skills); } return list; - },[]); - player.addAdditionalSkill('fakehuanjia_equip2',skills); + }, []); + player.addAdditionalSkill("fakehuanjia_equip2", skills); }, }, }, }, - fakexiongshu:{ - audio:'xiongshu', - trigger:{global:'useCardToPlayered'}, - filter(event,player){ - if(!event.isFirstTarget) return false; - if(event.player==player&&game.countPlayer()<2) return false; - if(event.player!=player&&!player.countDiscardableCards(player,'he')) return false; - return event.card.name=='sha'||(get.type(event.card)=='trick'&&get.tag(event.card,'damage')); + fakexiongshu: { + audio: "xiongshu", + trigger: { global: "useCardToPlayered" }, + filter(event, player) { + if (!event.isFirstTarget) return false; + if (event.player == player && game.countPlayer() < 2) return false; + if (event.player != player && !player.countDiscardableCards(player, "he")) return false; + return ( + event.card.name == "sha" || + (get.type(event.card) == "trick" && get.tag(event.card, "damage")) + ); }, - check(event,player){ - if(event.player==player){ - if(event.targets.some(i=>i.hasSkill('gzduanchang'))) return true; - return !event.targets.some(i=>i.getHp()==1&&!i.hasSkill('gzbuqu')&&i.isEnemyOf(player)); + check(event, player) { + if (event.player == player) { + if (event.targets.some((i) => i.hasSkill("gzduanchang"))) return true; + return !event.targets.some( + (i) => i.getHp() == 1 && !i.hasSkill("gzbuqu") && i.isEnemyOf(player) + ); } - if(event.targets.some(i=>i.hasSkill('gzduanchang'))) return false; - return event.targets.some(i=>i.getHp()==1&&!i.hasSkill('gzbuqu')&&i.isEnemyOf(player)); + if (event.targets.some((i) => i.hasSkill("gzduanchang"))) return false; + return event.targets.some( + (i) => i.getHp() == 1 && !i.hasSkill("gzbuqu") && i.isEnemyOf(player) + ); }, - usable:1, - async content(event,trigger,player){ - if(trigger.player==player){ + usable: 1, + async content(event, trigger, player) { + if (trigger.player == player) { await player.draw(); - const {result:{bool,targets}}=await player.chooseTarget('令一名其他角色成为'+get.translation(trigger.card)+'的伤害来源',true,lib.filter.notMe).set('ai',target=>{ - const player=get.event('player'),targets=get.event().getTrigger().targets; - const goon=(player.hasSkill('fakejianhui')&&targets.some(i=>i!=target&&i.isFriendOf(target))); - return targets.reduce((sum,i)=>sum+get.damageEffect(i,target,player),0)*(goon?3:1); - }); - if(bool){ - const target=targets[0]; + const { + result: { bool, targets }, + } = await player + .chooseTarget( + "令一名其他角色成为" + get.translation(trigger.card) + "的伤害来源", + true, + lib.filter.notMe + ) + .set("ai", (target) => { + const player = get.event("player"), + targets = get.event().getTrigger().targets; + const goon = + player.hasSkill("fakejianhui") && + targets.some((i) => i != target && i.isFriendOf(target)); + return ( + targets.reduce((sum, i) => sum + get.damageEffect(i, target, player), 0) * + (goon ? 3 : 1) + ); + }); + if (bool) { + const target = targets[0]; player.line(target); - game.log(target,'成为了',trigger.card,'的伤害来源'); - trigger.getParent().customArgs.default.customSource=target; + game.log(target, "成为了", trigger.card, "的伤害来源"); + trigger.getParent().customArgs.default.customSource = target; } - } - else{ - await player.chooseToDiscard('he',true); - game.log(player,'成为了',trigger.card,'的伤害来源'); - trigger.getParent().customArgs.default.customSource=player; + } else { + await player.chooseToDiscard("he", true); + game.log(player, "成为了", trigger.card, "的伤害来源"); + trigger.getParent().customArgs.default.customSource = player; } }, }, - fakejianhui:{ - audio:'jianhui', - trigger:{global:'damageSource'}, - filter(event,player){ - if(!event.source||!event.player||!event.source.isIn()||!event.player.isIn()||event.source==event.player) return false; - return event.source.isFriendOf(event.player)&&[event.source,event.player].some(target=>target.countCards('he')); + fakejianhui: { + audio: "jianhui", + trigger: { global: "damageSource" }, + filter(event, player) { + if ( + !event.source || + !event.player || + !event.source.isIn() || + !event.player.isIn() || + event.source == event.player + ) + return false; + return ( + event.source.isFriendOf(event.player) && + [event.source, event.player].some((target) => target.countCards("he")) + ); }, - async cost(event,trigger,player){ - event.result=await player.chooseTarget(get.prompt2('fakejianhui'),(card,player,target)=>{ - const trigger=get.event().getTrigger(); - if(!(trigger.source==target||trigger.player==target)) return false; - if(!ui.selected.targets.length) return true; - return target.countCards('he'); - },2).set('targetprompt',['摸牌','拆牌']).set('ai',target=>{ - const player=get.event('player'),trigger=get.event().getTrigger(); - const source=trigger.source,playerx=trigger.player; - const min=-Math.min(get.effect(source,{name:'draw'},player,player),get.effect(playerx,{name:'draw'},player,player)); - const max=Math.max(get.effect(source,{name:'guohe_copy'},player,player),get.effect(playerx,{name:'guohe_copy'},player,player)); - if(min>max) return 0; - if(!ui.selected.targets.length) return -1/Math.min(get.effect(target,{name:'draw'},player,player),-0.001); - return get.effect(target,{name:'guohe_copy'},player,player); - }).set('complexSelect',true).set('complexTarget',true).forResult(); + async cost(event, trigger, player) { + event.result = await player + .chooseTarget( + get.prompt2("fakejianhui"), + (card, player, target) => { + const trigger = get.event().getTrigger(); + if (!(trigger.source == target || trigger.player == target)) return false; + if (!ui.selected.targets.length) return true; + return target.countCards("he"); + }, + 2 + ) + .set("targetprompt", ["摸牌", "拆牌"]) + .set("ai", (target) => { + const player = get.event("player"), + trigger = get.event().getTrigger(); + const source = trigger.source, + playerx = trigger.player; + const min = -Math.min( + get.effect(source, { name: "draw" }, player, player), + get.effect(playerx, { name: "draw" }, player, player) + ); + const max = Math.max( + get.effect(source, { name: "guohe_copy" }, player, player), + get.effect(playerx, { name: "guohe_copy" }, player, player) + ); + if (min > max) return 0; + if (!ui.selected.targets.length) + return ( + -1 / + Math.min(get.effect(target, { name: "draw" }, player, player), -0.001) + ); + return get.effect(target, { name: "guohe_copy" }, player, player); + }) + .set("complexSelect", true) + .set("complexTarget", true) + .forResult(); }, - popup:false, - async content(event,trigger,player){ - player.logSkill('fakejianhui',event.targets,false); + popup: false, + async content(event, trigger, player) { + player.logSkill("fakejianhui", event.targets, false); player.line2(event.targets); await event.targets[0].draw(); - await player.discardPlayerCard(event.targets[1],'he',true); + await player.discardPlayerCard(event.targets[1], "he", true); }, }, - fakechongxin:{ - audio:'chongxin', - enable:'phaseUse', - filter(event,player){ - const card=new lib.element.VCard({name:'yiyi'}); - return lib.filter.targetEnabled2(card,player,player)&&game.hasPlayer(target=>{ - return lib.filter.targetEnabled2(card,player,target)&&target.isEnemyOf(player); - }); + fakechongxin: { + audio: "chongxin", + enable: "phaseUse", + filter(event, player) { + const card = new lib.element.VCard({ name: "yiyi" }); + return ( + lib.filter.targetEnabled2(card, player, player) && + game.hasPlayer((target) => { + return ( + lib.filter.targetEnabled2(card, player, target) && target.isEnemyOf(player) + ); + }) + ); }, - filterTarget(cardx,player,target){ - const card=new lib.element.VCard({name:'yiyi'}); - return lib.filter.targetEnabled2(card,player,target)&&target.isEnemyOf(player); + filterTarget(cardx, player, target) { + const card = new lib.element.VCard({ name: "yiyi" }); + return lib.filter.targetEnabled2(card, player, target) && target.isEnemyOf(player); }, - usable:1, - async content(event,trigger,player){ - const card=new lib.element.VCard({name:'yiyi'}); - await player.useCard(card,[player].concat(event.targets),false); + usable: 1, + async content(event, trigger, player) { + const card = new lib.element.VCard({ name: "yiyi" }); + await player.useCard(card, [player].concat(event.targets), false); }, - ai:{ - order(item,player){ - return get.order({name:'yiyi'},player)+0.1; + ai: { + order(item, player) { + return get.order({ name: "yiyi" }, player) + 0.1; }, - result:{ - target(player,target){ - const card=new lib.element.VCard({name:'yiyi'}); - const num=get.sgn(get.attitude(player,target)); - return num*(get.effect(player,card,player,player)-get.effect(target,card,player,player)); + result: { + target(player, target) { + const card = new lib.element.VCard({ name: "yiyi" }); + const num = get.sgn(get.attitude(player, target)); + return ( + num * + (get.effect(player, card, player, player) - + get.effect(target, card, player, player)) + ); }, }, }, }, - fakeweirong:{ - zhuanhuanji:true, - locked:false, - marktext:'☯', - intro:{ - content(storage){ - if(storage) return '出牌阶段,你可以摸X张牌,然后当你于本轮不因此法失去牌后,你弃置一张牌。(X为你上一轮以此法摸和弃置的牌数之和,且X至少为1,至多为你的体力上限)'; - return '出牌阶段,你可以弃置X张牌,然后当你于本轮不因此法得到牌后,你摸一张牌。(X为你上一轮以此法摸和弃置的牌数之和,且X至少为1,至多为你的体力上限)'; + fakeweirong: { + zhuanhuanji: true, + locked: false, + marktext: "☯", + intro: { + content(storage) { + if (storage) + return "出牌阶段,你可以摸X张牌,然后当你于本轮不因此法失去牌后,你弃置一张牌。(X为你上一轮以此法摸和弃置的牌数之和,且X至少为1,至多为你的体力上限)"; + return "出牌阶段,你可以弃置X张牌,然后当你于本轮不因此法得到牌后,你摸一张牌。(X为你上一轮以此法摸和弃置的牌数之和,且X至少为1,至多为你的体力上限)"; }, }, - audio:'weishu', - enable:'phaseUse', - filter(event,player){ - if(!get.info('fakeweirong').getNum(player)) return false; - const storage=player.storage.fakeweirong; - return storage||player.countCards('he',card=>lib.filter.cardDiscardable)>=get.info('fakeweirong').getNum(player); + audio: "weishu", + enable: "phaseUse", + filter(event, player) { + if (!get.info("fakeweirong").getNum(player)) return false; + const storage = player.storage.fakeweirong; + return ( + storage || + player.countCards("he", (card) => lib.filter.cardDiscardable) >= + get.info("fakeweirong").getNum(player) + ); }, - filterCard(card,player){ - return !Boolean(player.storage.fakeweirong)&&lib.filter.cardDiscardable(card,player); + filterCard(card, player) { + return !Boolean(player.storage.fakeweirong) && lib.filter.cardDiscardable(card, player); }, - selectCard(){ - const player=get.event('player'); - return player.storage.fakeweirong?-1:get.info('fakeweirong').getNum(player); + selectCard() { + const player = get.event("player"); + return player.storage.fakeweirong ? -1 : get.info("fakeweirong").getNum(player); }, - check(card){ - return 7.5-get.value(card); + check(card) { + return 7.5 - get.value(card); }, - prompt(){ - const player=get.event('player'); - const num=get.info('fakeweirong').getNum(player); - if(player.storage.fakeweirong) return '摸'+get.cnNumber(num)+'张牌,然后当你于本轮不因此法失去牌后,你弃置一张牌'; - return '弃置'+get.cnNumber(num)+'张牌,然后当你于本轮不因此法得到牌后,你摸一张牌'; + prompt() { + const player = get.event("player"); + const num = get.info("fakeweirong").getNum(player); + if (player.storage.fakeweirong) + return ( + "摸" + get.cnNumber(num) + "张牌,然后当你于本轮不因此法失去牌后,你弃置一张牌" + ); + return "弃置" + get.cnNumber(num) + "张牌,然后当你于本轮不因此法得到牌后,你摸一张牌"; }, - round:1, - async content(event,trigger,player){ - const storage=player.storage.fakeweirong; - player.changeZhuanhuanji('fakeweirong'); - if(storage) await player.draw(get.info('fakeweirong').getNum(player)); - player.addTempSkill('fakeweirong_'+(storage?'lose':'gain'),'roundStart'); + round: 1, + async content(event, trigger, player) { + const storage = player.storage.fakeweirong; + player.changeZhuanhuanji("fakeweirong"); + if (storage) await player.draw(get.info("fakeweirong").getNum(player)); + player.addTempSkill("fakeweirong_" + (storage ? "lose" : "gain"), "roundStart"); }, - ai:{ - order(item,player){ - const storage=player.storage.fakeweirong; - return storage?0.01:9; + ai: { + order(item, player) { + const storage = player.storage.fakeweirong; + return storage ? 0.01 : 9; }, - result:{player:1}, + result: { player: 1 }, }, - group:'fakeweirong_mark', - subSkill:{ - mark:{ - charlotte:true, - trigger:{player:['hideCharacterEnd','showCharacterEnd']}, - filter(event,player){ - return get.character(event[event.name=='hideCharacter'?'toHide':'toShow'],3).includes('fakeweirong'); + group: "fakeweirong_mark", + subSkill: { + mark: { + charlotte: true, + trigger: { player: ["hideCharacterEnd", "showCharacterEnd"] }, + filter(event, player) { + return get + .character(event[event.name == "hideCharacter" ? "toHide" : "toShow"], 3) + .includes("fakeweirong"); }, - forced:true, - popup:false, - firstDo:true, - content(){ - player[(trigger.name=='hideCharacter'?'un':'')+'markSkill']('fakeweirong'); + forced: true, + popup: false, + firstDo: true, + content() { + player[(trigger.name == "hideCharacter" ? "un" : "") + "markSkill"]( + "fakeweirong" + ); }, }, - gain:{ - charlotte:true, - mark:true, - marktext:'↑', - intro:{content:'不因此法得到牌后,你摸一张牌'}, - audio:'weishu', - trigger:{player:'gainAfter',global:'loseAsyncAfter'}, - filter(event,player){ - if(!event.getg||!event.getg(player).length) return false; - return event.getParent(2).name!='fakeweirong_gain'; + gain: { + charlotte: true, + mark: true, + marktext: "↑", + intro: { content: "不因此法得到牌后,你摸一张牌" }, + audio: "weishu", + trigger: { player: "gainAfter", global: "loseAsyncAfter" }, + filter(event, player) { + if (!event.getg || !event.getg(player).length) return false; + return event.getParent(2).name != "fakeweirong_gain"; }, - forced:true, - content(){ + forced: true, + content() { player.draw(); }, }, - lose:{ - charlotte:true, - mark:true, - marktext:'↓', - intro:{content:'不因此法失去牌后,你弃置一张牌'}, - audio:'weishu', - trigger:{player:'loseAfter',global:'loseAsyncAfter'}, - filter(event,player){ - if(!player.countCards('he')) return false; - const evt=event.getl(player); - if(!evt||!evt.cards2||!evt.cards2.length) return false; - return event.getParent(3).name!='fakeweirong_lose'; + lose: { + charlotte: true, + mark: true, + marktext: "↓", + intro: { content: "不因此法失去牌后,你弃置一张牌" }, + audio: "weishu", + trigger: { player: "loseAfter", global: "loseAsyncAfter" }, + filter(event, player) { + if (!player.countCards("he")) return false; + const evt = event.getl(player); + if (!evt || !evt.cards2 || !evt.cards2.length) return false; + return event.getParent(3).name != "fakeweirong_lose"; }, - forced:true, - content(){ - player.chooseToDiscard('he',true); + forced: true, + content() { + player.chooseToDiscard("he", true); }, }, }, - getNum(player){ - let num=0,count=false; - const history=player.actionHistory; - for(let i=history.length-1;i>=0;i--){ - if(history[i].isRound){ - if(!count){ - count=true; + getNum(player) { + let num = 0, + count = false; + const history = player.actionHistory; + for (let i = history.length - 1; i >= 0; i--) { + if (history[i].isRound) { + if (!count) { + count = true; continue; - } - else break; + } else break; } - if(!count) continue; - const allHistory=history[i].gain.filter(evt=>{ - return evt.getParent(2).name=='fakeweirong'||evt.getParent(2).name=='fakeweirong_gain'; - }).slice().concat(history[i].lose.filter(evt=>{ - return evt.getParent(2).skill=='fakeweirong'||evt.getParent(3).name=='fakeweirong_lose'; - })); - for(const evt of allHistory) num+=evt.cards.length; + if (!count) continue; + const allHistory = history[i].gain + .filter((evt) => { + return ( + evt.getParent(2).name == "fakeweirong" || + evt.getParent(2).name == "fakeweirong_gain" + ); + }) + .slice() + .concat( + history[i].lose.filter((evt) => { + return ( + evt.getParent(2).skill == "fakeweirong" || + evt.getParent(3).name == "fakeweirong_lose" + ); + }) + ); + for (const evt of allHistory) num += evt.cards.length; } - return Math.max(1,Math.min(player.maxHp,num)); + return Math.max(1, Math.min(player.maxHp, num)); }, }, - fakequanbian:{ - audio:'quanbian', - trigger:{player:['useCard','respond']}, - filter(event,player){ - if(!Array.from(ui.cardPile.childNodes).length) return false; - return player.countCards('h')&&_status.currentPhase==player; + fakequanbian: { + audio: "quanbian", + trigger: { player: ["useCard", "respond"] }, + filter(event, player) { + if (!Array.from(ui.cardPile.childNodes).length) return false; + return player.countCards("h") && _status.currentPhase == player; }, - async cost(event,trigger,player){ - const cards=Array.from(ui.cardPile.childNodes); - const {result:{bool,moved}}=await player.chooseToMove(get.prompt2('fakequanbian')) - .set('list',[ - ['牌堆顶',cards.slice(0,Math.min(player.maxHp,cards.length)),'fakequanbian_tag'], - ['手牌',player.getCards('h')], - ]).set('filterOk',moved=>moved[1].filter(i=>!get.owner(i)).length==1) - .set('filterMove',(from,to)=>typeof to!='number').set('processAI',list=>{ - const player=get.event('player'),goon=player.hasSkill('fakezhouting'); - let cards1=list[0][1].slice(),cards2=list[1][1].slice(); - let card1=cards1.slice().sort((a,b)=>get[goon?'useful':'value'](goon?a:b)-get[goon?'useful':'value'](goon?b:a))[0]; - let card2=cards2.slice().sort((a,b)=>get[goon?'useful':'value'](goon?b:a)-get[goon?'useful':'value'](goon?a:b))[0]; - if(get[goon?'useful':'value'](card1)*(goon?-1:1)get.owner(i))[0], - moved[1].filter(i=>!get.owner(i))[0], + async cost(event, trigger, player) { + const cards = Array.from(ui.cardPile.childNodes); + const { + result: { bool, moved }, + } = await player + .chooseToMove(get.prompt2("fakequanbian")) + .set("list", [ + [ + "牌堆顶", + cards.slice(0, Math.min(player.maxHp, cards.length)), + "fakequanbian_tag", + ], + ["手牌", player.getCards("h")], + ]) + .set("filterOk", (moved) => moved[1].filter((i) => !get.owner(i)).length == 1) + .set("filterMove", (from, to) => typeof to != "number") + .set("processAI", (list) => { + const player = get.event("player"), + goon = player.hasSkill("fakezhouting"); + let cards1 = list[0][1].slice(), + cards2 = list[1][1].slice(); + let card1 = cards1 + .slice() + .sort( + (a, b) => + get[goon ? "useful" : "value"](goon ? a : b) - + get[goon ? "useful" : "value"](goon ? b : a) + )[0]; + let card2 = cards2 + .slice() + .sort( + (a, b) => + get[goon ? "useful" : "value"](goon ? b : a) - + get[goon ? "useful" : "value"](goon ? a : b) + )[0]; + if ( + get[goon ? "useful" : "value"](card1) * (goon ? -1 : 1) < + get[goon ? "useful" : "value"](card2) * (goon ? -1 : 1) + ) { + cards1.remove(card1); + cards2.remove(card2); + return [cards1.concat(card2), cards2.concat(card1)]; + } + }); + if (bool) { + event.result = { + bool: true, + cost_data: [ + moved[0].filter((i) => get.owner(i))[0], + moved[1].filter((i) => !get.owner(i))[0], ], }; - } - else event.result={bool:false}; + } else event.result = { bool: false }; }, - async content(event,trigger,player){ - await player.lose(event.cost_data[0],ui.cardPile).set('insert_index',()=>{ - return ui.cardPile.childNodes[Array.from(ui.cardPile.childNodes).indexOf(get.event('card2'))]; - }).set('card2',event.cost_data[1]); - await player.gain(event.cost_data[1],'gain2'); + async content(event, trigger, player) { + await player + .lose(event.cost_data[0], ui.cardPile) + .set("insert_index", () => { + return ui.cardPile.childNodes[ + Array.from(ui.cardPile.childNodes).indexOf(get.event("card2")) + ]; + }) + .set("card2", event.cost_data[1]); + await player.gain(event.cost_data[1], "gain2"); }, }, - fakezhouting:{ - unique:true, - limited:true, - audio:'xiongzhi', - enable:'phaseUse', - skillAnimation:true, - animationColor:'thunder', - async content(event,trigger,player){ - player.awakenSkill('fakezhouting'); - let gains=[]; - const cards=Array.from(ui.cardPile.childNodes).slice(0,Math.min(player.maxHp,Array.from(ui.cardPile.childNodes).length)); + fakezhouting: { + unique: true, + limited: true, + audio: "xiongzhi", + enable: "phaseUse", + skillAnimation: true, + animationColor: "thunder", + async content(event, trigger, player) { + player.awakenSkill("fakezhouting"); + let gains = []; + const cards = Array.from(ui.cardPile.childNodes).slice( + 0, + Math.min(player.maxHp, Array.from(ui.cardPile.childNodes).length) + ); await game.cardsGotoOrdering(cards); - for(const card of cards){ - if(player.hasUseTarget(card,false,false)){ - await player.chooseUseTarget(card,true,false,'nodistance'); - } - else gains.push(card); + for (const card of cards) { + if (player.hasUseTarget(card, false, false)) { + await player.chooseUseTarget(card, true, false, "nodistance"); + } else gains.push(card); } - if(gains.length) await player.gain(gains,'gain2'); - if(game.getGlobalHistory('everything',evt=>{ - return evt.name=='die'&&evt.getParent(6).name=='fakezhouting'&&evt.getParent(6).player==player; - }).length) player.restoreSkill('fakezhouting'); + if (gains.length) await player.gain(gains, "gain2"); + if ( + game.getGlobalHistory("everything", (evt) => { + return ( + evt.name == "die" && + evt.getParent(6).name == "fakezhouting" && + evt.getParent(6).player == player + ); + }).length + ) + player.restoreSkill("fakezhouting"); }, - ai:{ - order:1, - result:{ - player(player){ - return player.hasUnknown()?0:1; + ai: { + order: 1, + result: { + player(player) { + return player.hasUnknown() ? 0 : 1; }, }, }, }, - fakexuanbei:{ - audio:'xuanbei', - trigger:{player:'showCharacterEnd'}, - filter(event,player){ - return game.getAllGlobalHistory('everything',evt=>{ - return evt.name=='showCharacter'&&evt.player==player&&evt.toShow.some(i=>get.character(i,3).includes('fakexuanbei')); - },event).indexOf(event)==0; + fakexuanbei: { + audio: "xuanbei", + trigger: { player: "showCharacterEnd" }, + filter(event, player) { + return ( + game + .getAllGlobalHistory( + "everything", + (evt) => { + return ( + evt.name == "showCharacter" && + evt.player == player && + evt.toShow.some((i) => get.character(i, 3).includes("fakexuanbei")) + ); + }, + event + ) + .indexOf(event) == 0 + ); }, - forced:true, - locked:false, - async content(event,trigger,player){ + forced: true, + locked: false, + async content(event, trigger, player) { await player.draw(2); - player.addTempSkill('fakexuanbei_effect'); + player.addTempSkill("fakexuanbei_effect"); }, - group:['fakexuanbei_change','fakexuanbei_give'], - subSkill:{ - effect:{ - charlotte:true, - mark:true, - intro:{content:'使用应变牌时直接获得强化'}, + group: ["fakexuanbei_change", "fakexuanbei_give"], + subSkill: { + effect: { + charlotte: true, + mark: true, + intro: { content: "使用应变牌时直接获得强化" }, }, - give:{ - audio:'xuanbei', - trigger:{player:'useCardAfter'}, - filter(event,player){ - return (event.card.yingbian||get.is.yingbian(event.card))&&event.cards.filterInD().length; + give: { + audio: "xuanbei", + trigger: { player: "useCardAfter" }, + filter(event, player) { + return ( + (event.card.yingbian || get.is.yingbian(event.card)) && + event.cards.filterInD().length + ); }, - usable:1, - async cost(event,trigger,player){ - const cards=trigger.cards.filterInD(); - const {result:{bool,targets}}=await player.chooseTarget(get.prompt('fakexuanbei'),'令一名其他角色获得'+get.translation(event.cards),lib.filter.notMe).set('ai',target=>{ - const att=get.attitude(get.event('player'),target); - if(att<0) return 0; - if(target.hasJudge('lebu')) att/=2; - if(target.hasSkillTag('nogain')) att/=10; - return att/(1+get.distance(player,target,'absolute')); - }); - event.result={bool:bool,targets:targets,cards:cards}; + usable: 1, + async cost(event, trigger, player) { + const cards = trigger.cards.filterInD(); + const { + result: { bool, targets }, + } = await player + .chooseTarget( + get.prompt("fakexuanbei"), + "令一名其他角色获得" + get.translation(event.cards), + lib.filter.notMe + ) + .set("ai", (target) => { + const att = get.attitude(get.event("player"), target); + if (att < 0) return 0; + if (target.hasJudge("lebu")) att /= 2; + if (target.hasSkillTag("nogain")) att /= 10; + return att / (1 + get.distance(player, target, "absolute")); + }); + event.result = { bool: bool, targets: targets, cards: cards }; }, - async content(event,trigger,player){ - await event.targets[0].gain(event.cards,'gain2').set('giver',player); + async content(event, trigger, player) { + await event.targets[0].gain(event.cards, "gain2").set("giver", player); }, }, - change:{ - audio:'xuanbei', - trigger:{player:'die'}, - direct:true, - forceDie:true, - skillAnimation:true, - animationColor:'thunder', - async cost(event,trigger,player){ - const {result:{bool,targets}}=await player.chooseTarget(get.prompt('fakexuanbei'),'令一名其他角色变更副将',lib.filter.notMe).set('ai',target=>{ - const player=get.event('player'); - const rank=get.guozhanRank(target.name2,target)<=3; - const att=get.attitude(player,target); - if(att>0) return (4-rank)*att; - return -(rank-6)*att; - }).set('forceDie',true); - event.result={bool:bool,targets:targets}; + change: { + audio: "xuanbei", + trigger: { player: "die" }, + direct: true, + forceDie: true, + skillAnimation: true, + animationColor: "thunder", + async cost(event, trigger, player) { + const { + result: { bool, targets }, + } = await player + .chooseTarget( + get.prompt("fakexuanbei"), + "令一名其他角色变更副将", + lib.filter.notMe + ) + .set("ai", (target) => { + const player = get.event("player"); + const rank = get.guozhanRank(target.name2, target) <= 3; + const att = get.attitude(player, target); + if (att > 0) return (4 - rank) * att; + return -(rank - 6) * att; + }) + .set("forceDie", true); + event.result = { bool: bool, targets: targets }; }, - async content(event,trigger,player){ + async content(event, trigger, player) { await event.targets[0].changeVice(); }, }, }, }, - fakeqingleng:{ - audio:'qingleng', - trigger:{global:'phaseEnd'}, - filter(event,player){ - var target=event.player; - return target!=player&&target.isIn()&&!target.isUnseen(2)&&player.countCards('he')&&player.canUse({name:'sha',nature:'ice'},target,false); + fakeqingleng: { + audio: "qingleng", + trigger: { global: "phaseEnd" }, + filter(event, player) { + var target = event.player; + return ( + target != player && + target.isIn() && + !target.isUnseen(2) && + player.countCards("he") && + player.canUse({ name: "sha", nature: "ice" }, target, false) + ); }, - direct:true, - preHidden:true, - async content(event,trigger,player){ - const target=trigger.player; - const {result:{bool}}=await player.chooseToUse() - .set('openskilldialog',get.prompt2('fakeqingleng',target)) - .set('norestore',true).set('_backupevent','fakeqingleng_backup') - .set('custom',{ - add:{}, - replace:{window:function(){}} - }).set('targetRequired',true).set('complexSelect',true) - .set('filterTarget',function(card,player,target){ - if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false; - return lib.filter.targetEnabled.apply(this,arguments); - }).set('sourcex',target).set('addCount',false).set('hiddenSkill','fakeqingleng') - .backup('fakeqingleng_backup').set('logSkill',['fakeqingleng',target]); - if(bool&&!player.getHistory('sourceDamage',evt=>{ - return evt.getParent(4)==event; - }).length){ - const {result:{bool,links}}=await player.chooseButton([ - '清冷:暗置'+get.translation(target)+'的一张武将牌', - '
    '+get.translation(target)+'的武将牌
    ', - [[target.name1,target.name2],'character'], - ],true).set('filterButton',button=>!get.is.jun(button.link)); - if(bool){ + direct: true, + preHidden: true, + async content(event, trigger, player) { + const target = trigger.player; + const { + result: { bool }, + } = await player + .chooseToUse() + .set("openskilldialog", get.prompt2("fakeqingleng", target)) + .set("norestore", true) + .set("_backupevent", "fakeqingleng_backup") + .set("custom", { + add: {}, + replace: { window: function () {} }, + }) + .set("targetRequired", true) + .set("complexSelect", true) + .set("filterTarget", function (card, player, target) { + if ( + target != _status.event.sourcex && + !ui.selected.targets.includes(_status.event.sourcex) + ) + return false; + return lib.filter.targetEnabled.apply(this, arguments); + }) + .set("sourcex", target) + .set("addCount", false) + .set("hiddenSkill", "fakeqingleng") + .backup("fakeqingleng_backup") + .set("logSkill", ["fakeqingleng", target]); + if ( + bool && + !player.getHistory("sourceDamage", (evt) => { + return evt.getParent(4) == event; + }).length + ) { + const { + result: { bool, links }, + } = await player + .chooseButton( + [ + "清冷:暗置" + get.translation(target) + "的一张武将牌", + '
    ' + get.translation(target) + "的武将牌
    ", + [[target.name1, target.name2], "character"], + ], + true + ) + .set("filterButton", (button) => !get.is.jun(button.link)); + if (bool) { player.line(target); - player.addSkill('fakeqingleng_effect'); - if(player.getStorage('fakeqingleng_effect').some(list=>list[0]==target)){ - player.storage.fakeqingleng_effect.indexOf(player.getStorage('fakeqingleng_effect').find(list=>list[0]==target))[1].addArray(links); - } - else player.markAuto('fakeqingleng_effect',[[target,links[0]]]); - target.when(['phaseBegin','die']) - .vars({target:player}).then(()=>{ - const removes=target.getStorage('fakeqingleng_effect').filter(list=>list[0]==player); - target.unmarkAuto('fakeqingleng_effect',removes); - if(!target.getStorage('fakeqingleng_effect').length){ - target.removeSkill('fakeqingleng_effect'); - } - }); - await target.hideCharacter(target.name1==links[0]?0:1); + player.addSkill("fakeqingleng_effect"); + if (player.getStorage("fakeqingleng_effect").some((list) => list[0] == target)) { + player.storage.fakeqingleng_effect + .indexOf( + player + .getStorage("fakeqingleng_effect") + .find((list) => list[0] == target) + )[1] + .addArray(links); + } else player.markAuto("fakeqingleng_effect", [[target, links[0]]]); + target + .when(["phaseBegin", "die"]) + .vars({ target: player }) + .then(() => { + const removes = target + .getStorage("fakeqingleng_effect") + .filter((list) => list[0] == player); + target.unmarkAuto("fakeqingleng_effect", removes); + if (!target.getStorage("fakeqingleng_effect").length) { + target.removeSkill("fakeqingleng_effect"); + } + }); + await target.hideCharacter(target.name1 == links[0] ? 0 : 1); } } }, - subSkill:{ - backup:{ - filterCard:true, - check(card){ - return 7.5-get.value(card); + subSkill: { + backup: { + filterCard: true, + check(card) { + return 7.5 - get.value(card); }, - position:'he', - popname:true, - viewAs:{name:'sha',nature:'ice'}, - precontent(){ + position: "he", + popname: true, + viewAs: { name: "sha", nature: "ice" }, + precontent() { delete event.result.skill; }, }, - effect:{ - charlotte:true, - onremove:true, - intro:{ - content(storage){ - return '•'+storage.map(list=>{ - return get.translation(list[0])+'明置'+get.translation(list[1])+'后,对其造成1点伤害'; - }).join('
    •'); + effect: { + charlotte: true, + onremove: true, + intro: { + content(storage) { + return ( + "•" + + storage + .map((list) => { + return ( + get.translation(list[0]) + + "明置" + + get.translation(list[1]) + + "后,对其造成1点伤害" + ); + }) + .join("
    •") + ); }, }, - audio:'qingleng', - trigger:{global:'showCharacterEnd'}, - filter(event,player){ - const list=player.getStorage('fakeqingleng_effect').find(list=>list[0]==event.player); - return list&&list[1].includes(event.toShow); + audio: "qingleng", + trigger: { global: "showCharacterEnd" }, + filter(event, player) { + const list = player + .getStorage("fakeqingleng_effect") + .find((list) => list[0] == event.player); + return list && list[1].includes(event.toShow); }, - forced:true, - logTarget:'player', - content(){ + forced: true, + logTarget: "player", + content() { trigger.player.damage(); }, }, }, }, - fakexijue:{ - audio:'xijue', - trigger:{player:'showCharacterEnd'}, - filter(event,player){ - return game.getAllGlobalHistory('everything',evt=>{ - return evt.name=='showCharacter'&&evt.player==player&&evt.toShow.some(i=>get.character(i,3).includes('fakexijue')); - },event).indexOf(event)==0; + fakexijue: { + audio: "xijue", + trigger: { player: "showCharacterEnd" }, + filter(event, player) { + return ( + game + .getAllGlobalHistory( + "everything", + (evt) => { + return ( + evt.name == "showCharacter" && + evt.player == player && + evt.toShow.some((i) => get.character(i, 3).includes("fakexijue")) + ); + }, + event + ) + .indexOf(event) == 0 + ); }, - forced:true, - popup:false, - preHidden:['xijue_tuxi','fakexijue_xiaoguo'], - content(){ - player.addMark('xijue',2); + forced: true, + popup: false, + preHidden: ["xijue_tuxi", "fakexijue_xiaoguo"], + content() { + player.addMark("xijue", 2); }, - derivation:['xijue_tuxi','fakexijue_xiaoguo'], - group:['fakexijue_effect','xijue_tuxi','fakexijue_xiaoguo'], - subSkill:{ - effect:{ - audio:'xijue', - trigger:{player:['phaseDrawBegin2','phaseEnd']}, - filter(event,player){ - if(event.name=='phaseDraw') return !event.numFixed; - return player.getHistory('sourceDamage').length; + derivation: ["xijue_tuxi", "fakexijue_xiaoguo"], + group: ["fakexijue_effect", "xijue_tuxi", "fakexijue_xiaoguo"], + subSkill: { + effect: { + audio: "xijue", + trigger: { player: ["phaseDrawBegin2", "phaseEnd"] }, + filter(event, player) { + if (event.name == "phaseDraw") return !event.numFixed; + return player.getHistory("sourceDamage").length; }, - forced:true, - popup:false, - content(){ - if(trigger.name=='phaseDraw') trigger.num=Math.min(player.countMark('xijue'),player.maxHp); - else player.addMark('xijue',1); + forced: true, + popup: false, + content() { + if (trigger.name == "phaseDraw") + trigger.num = Math.min(player.countMark("xijue"), player.maxHp); + else player.addMark("xijue", 1); }, }, - xiaoguo:{ - audio:'xijue_xiaoguo', - trigger:{global:'phaseZhunbeiBegin'}, - filter(event,player){ - if(!player.hasMark('xijue')) return false; - return event.player!=player&&player.countCards('h',card=>{ - if(_status.connectMode) return true; - return get.type(card)=='basic'&&lib.filter.cardDiscardable(card,player); - }); + xiaoguo: { + audio: "xijue_xiaoguo", + trigger: { global: "phaseZhunbeiBegin" }, + filter(event, player) { + if (!player.hasMark("xijue")) return false; + return ( + event.player != player && + player.countCards("h", (card) => { + if (_status.connectMode) return true; + return ( + get.type(card) == "basic" && lib.filter.cardDiscardable(card, player) + ); + }) + ); }, - async cost(event,trigger,player){ - event.result=await player.chooseToDiscard(get.prompt2('fakexijue_xiaoguo',trigger.player),(card,player)=>{ - return get.type(card)=='basic'; - },[1,Math.min(player.countMark('xijue'),player.maxHp)]).set('complexSelect',true).set('ai',card=>{ - const player=get.event('player'),target=get.event().getTrigger().player; - const effect=get.damageEffect(target,player,player); - const cards=target.getCards('e',card=>get.attitude(player,target)*get.value(card,target)<0); - if(effect<=0&&!cards.length) return 0; - if(ui.selected.cards.length>cards.length-(effect<=0?1:0)) return 0; - return 1/(get.value(card)||0.5); - }).set('logSkill',['fakexijue_xiaoguo',trigger.player]).setHiddenSkill('fakexijue_xiaoguo').forResult(); + async cost(event, trigger, player) { + event.result = await player + .chooseToDiscard( + get.prompt2("fakexijue_xiaoguo", trigger.player), + (card, player) => { + return get.type(card) == "basic"; + }, + [1, Math.min(player.countMark("xijue"), player.maxHp)] + ) + .set("complexSelect", true) + .set("ai", (card) => { + const player = get.event("player"), + target = get.event().getTrigger().player; + const effect = get.damageEffect(target, player, player); + const cards = target.getCards( + "e", + (card) => get.attitude(player, target) * get.value(card, target) < 0 + ); + if (effect <= 0 && !cards.length) return 0; + if (ui.selected.cards.length > cards.length - (effect <= 0 ? 1 : 0)) + return 0; + return 1 / (get.value(card) || 0.5); + }) + .set("logSkill", ["fakexijue_xiaoguo", trigger.player]) + .setHiddenSkill("fakexijue_xiaoguo") + .forResult(); }, - preHidden:true, - popup:false, - async content(event,trigger,player){ - const num=trigger.player.countCards('e'),num2=event.cards.length; - await player.discardPlayerCard(trigger.player,'e',num2,true); - if(num2>num) await trigger.player.damage(); - player.removeMark('xijue',1); + preHidden: true, + popup: false, + async content(event, trigger, player) { + const num = trigger.player.countCards("e"), + num2 = event.cards.length; + await player.discardPlayerCard(trigger.player, "e", num2, true); + if (num2 > num) await trigger.player.damage(); + player.removeMark("xijue", 1); }, }, }, }, - fakeqimei:{ - audio:'qimei', - trigger:{player:'phaseZhunbeiBegin'}, - direct:true, - preHidden:true, - content(){ - 'step 0' - player.chooseTarget(get.prompt('fakeqimei'),'选择一名其他角色并获得“齐眉”效果',lib.filter.notMe).set('ai',target=>{ - var player=_status.event.player; - return get.attitude(player,target)/(Math.abs(player.countCards('h')+2-target.countCards('h'))+1) - }).setHiddenSkill('fakeqimei'); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.logSkill('fakeqimei',target); - player.addTempSkill('fakeqimei_draw'); - player.storage.fakeqimei_draw=target; + fakeqimei: { + audio: "qimei", + trigger: { player: "phaseZhunbeiBegin" }, + direct: true, + preHidden: true, + content() { + "step 0"; + player + .chooseTarget( + get.prompt("fakeqimei"), + "选择一名其他角色并获得“齐眉”效果", + lib.filter.notMe + ) + .set("ai", (target) => { + var player = _status.event.player; + return ( + get.attitude(player, target) / + (Math.abs(player.countCards("h") + 2 - target.countCards("h")) + 1) + ); + }) + .setHiddenSkill("fakeqimei"); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.logSkill("fakeqimei", target); + player.addTempSkill("fakeqimei_draw"); + player.storage.fakeqimei_draw = target; game.delayx(); } }, - subSkill:{ - draw:{ - audio:'qimei', - charlotte:true, - forced:true, - popup:false, - trigger:{global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','loseAfter','addToExpansionAfter']}, - filter(event,player){ - var target=player.storage.fakeqimei_draw; - if(!target||!target.isIn()) return false; - if(player.countCards('h')!=target.countCards('h')) return false; - var hasChange=function(event,player){ - var gain=0,lose=0; - if(event.getg) gain=event.getg(player).length; - if(event.getl) lose=event.getl(player).hs.length; - return gain!=lose; - }; - return (hasChange(event,player)&&target.isDamaged())||(hasChange(event,target)&&player.isDamaged()); + subSkill: { + draw: { + audio: "qimei", + charlotte: true, + forced: true, + popup: false, + trigger: { + global: [ + "equipAfter", + "addJudgeAfter", + "gainAfter", + "loseAsyncAfter", + "loseAfter", + "addToExpansionAfter", + ], }, - content(){ - 'step 0' - if(trigger.delay===false) game.delayx(); - 'step 1' - var target=player.storage.fakeqimei_draw; - player.logSkill('fakeqimei_draw',target); - var drawer=[]; - var hasChange=function(event,player){ - var gain=0,lose=0; - if(event.getg) gain=event.getg(player).length; - if(event.getl) lose=event.getl(player).hs.length; - return gain!=lose; + filter(event, player) { + var target = player.storage.fakeqimei_draw; + if (!target || !target.isIn()) return false; + if (player.countCards("h") != target.countCards("h")) return false; + var hasChange = function (event, player) { + var gain = 0, + lose = 0; + if (event.getg) gain = event.getg(player).length; + if (event.getl) lose = event.getl(player).hs.length; + return gain != lose; }; - if(hasChange(trigger,player)) drawer.push(target); - if(hasChange(trigger,target)) drawer.push(player); - for(const i of drawer){ - if(i.isDamaged()) i.recover(); + return ( + (hasChange(event, player) && target.isDamaged()) || + (hasChange(event, target) && player.isDamaged()) + ); + }, + content() { + "step 0"; + if (trigger.delay === false) game.delayx(); + "step 1"; + var target = player.storage.fakeqimei_draw; + player.logSkill("fakeqimei_draw", target); + var drawer = []; + var hasChange = function (event, player) { + var gain = 0, + lose = 0; + if (event.getg) gain = event.getg(player).length; + if (event.getl) lose = event.getl(player).hs.length; + return gain != lose; + }; + if (hasChange(trigger, player)) drawer.push(target); + if (hasChange(trigger, target)) drawer.push(player); + for (const i of drawer) { + if (i.isDamaged()) i.recover(); } }, - group:'fakeqimei_hp', - onremove:true, - mark:true, - intro:{content:'已和$组成齐眉组合'}, + group: "fakeqimei_hp", + onremove: true, + mark: true, + intro: { content: "已和$组成齐眉组合" }, }, - hp:{ - audio:'qimei', - trigger:{global:'changeHp'}, - charlotte:true, - forced:true, - logTarget(event,player){ + hp: { + audio: "qimei", + trigger: { global: "changeHp" }, + charlotte: true, + forced: true, + logTarget(event, player) { return player.storage.fakeqimei_draw; }, - filter(event,player){ - var target=player.storage.fakeqimei_draw; - if(!target||!target.isIn()) return false; - if(player!=event.player&&target!=event.player) return false; - return player.hp==target.hp; + filter(event, player) { + var target = player.storage.fakeqimei_draw; + if (!target || !target.isIn()) return false; + if (player != event.player && target != event.player) return false; + return player.hp == target.hp; }, - content(){ + content() { game.delayx(); - (player==trigger.player?player.storage.fakeqimei_draw:player).draw(); + (player == trigger.player ? player.storage.fakeqimei_draw : player).draw(); }, }, }, }, - fakebaoqie:{ - audio:'baoqie', - trigger:{player:'showCharacterEnd'}, - filter(event,player){ - if(!game.hasPlayer(target=>{ - return target.getGainableCards(player,'e').some(card=>get.subtype(card)=='equip5'); - })) return false; - return game.getAllGlobalHistory('everything',evt=>{ - return evt.name=='showCharacter'&&evt.player==player&&evt.toShow.some(i=>get.character(i,3).includes('fakebaoqie')); - },event).indexOf(event)==0; + fakebaoqie: { + audio: "baoqie", + trigger: { player: "showCharacterEnd" }, + filter(event, player) { + if ( + !game.hasPlayer((target) => { + return target + .getGainableCards(player, "e") + .some((card) => get.subtype(card) == "equip5"); + }) + ) + return false; + return ( + game + .getAllGlobalHistory( + "everything", + (evt) => { + return ( + evt.name == "showCharacter" && + evt.player == player && + evt.toShow.some((i) => get.character(i, 3).includes("fakebaoqie")) + ); + }, + event + ) + .indexOf(event) == 0 + ); }, - async cost(event,trigger,player){ - event.result=await player.chooseTarget(get.prompt('fakebaoqie'),'获得一名角色装备区里所有的宝物牌,然后你可以使用其中的一张牌',(card,player,target)=>{ - return target.getGainableCards(player,'e').some(card=>get.subtype(card)=='equip5'); - }).set('ai',target=>{ - const player=get.event('player'); - return -get.sgn(get.attitude(player,target))*target.getGainableCards(player,'e').filter(card=>{ - return get.subtype(card)=='equip5'; - }).reduce((sum,card)=>sum+get.value(card,target),0); - }).forResult(); + async cost(event, trigger, player) { + event.result = await player + .chooseTarget( + get.prompt("fakebaoqie"), + "获得一名角色装备区里所有的宝物牌,然后你可以使用其中的一张牌", + (card, player, target) => { + return target + .getGainableCards(player, "e") + .some((card) => get.subtype(card) == "equip5"); + } + ) + .set("ai", (target) => { + const player = get.event("player"); + return ( + -get.sgn(get.attitude(player, target)) * + target + .getGainableCards(player, "e") + .filter((card) => { + return get.subtype(card) == "equip5"; + }) + .reduce((sum, card) => sum + get.value(card, target), 0) + ); + }) + .forResult(); }, - async content(event,trigger,player){ - const target=event.targets[0]; - let cards=target.getGainableCards(player,'e').filter(card=>get.subtype(card)=='equip5'); - await player.gain(cards,target,'giveAuto'); - cards=cards.filter(i=>get.owner(i)==player&&get.position(i)=='h'&&player.hasUseTarget(i)); - if(cards.length){ - const {result:{bool,links}}=await player.chooseButton(['宝箧:是否使用其中的一张宝物牌?',cards]).set('ai',button=>{ - return get.equipValue(button.link,get.event('player')); - }); - if(bool) await player.chooseUseTarget(links[0],true); + async content(event, trigger, player) { + const target = event.targets[0]; + let cards = target + .getGainableCards(player, "e") + .filter((card) => get.subtype(card) == "equip5"); + await player.gain(cards, target, "giveAuto"); + cards = cards.filter( + (i) => get.owner(i) == player && get.position(i) == "h" && player.hasUseTarget(i) + ); + if (cards.length) { + const { + result: { bool, links }, + } = await player + .chooseButton(["宝箧:是否使用其中的一张宝物牌?", cards]) + .set("ai", (button) => { + return get.equipValue(button.link, get.event("player")); + }); + if (bool) await player.chooseUseTarget(links[0], true); } }, - ai:{mingzhi_no:true}, - group:'fakebaoqie_damage', - subSkill:{ - damage:{ - audio:'baoqie', - trigger:{player:'damageBegin4'}, - filter(event,player){ - if(!player.getStockSkills(true,true,true).includes('fakebaoqie')) return false; - return !game.getAllGlobalHistory('everything',evt=>{ - return evt.name=='showCharacter'&&evt.player==player&&evt.toShow.some(i=>get.character(i,3).includes('fakebaoqie')); + ai: { mingzhi_no: true }, + group: "fakebaoqie_damage", + subSkill: { + damage: { + audio: "baoqie", + trigger: { player: "damageBegin4" }, + filter(event, player) { + if (!player.getStockSkills(true, true, true).includes("fakebaoqie")) return false; + return !game.getAllGlobalHistory("everything", (evt) => { + return ( + evt.name == "showCharacter" && + evt.player == player && + evt.toShow.some((i) => get.character(i, 3).includes("fakebaoqie")) + ); }).length; }, - check(event,player){ - return !event.source||get.damageEffect(player,event.source,player)<0; + check(event, player) { + return !event.source || get.damageEffect(player, event.source, player) < 0; }, - prompt:'宝箧:是否明置此武将牌并防止此伤害?', - content(){ + prompt: "宝箧:是否明置此武将牌并防止此伤害?", + content() { trigger.cancel(); }, }, }, }, - fakeciwei:{ - audio:'ciwei', - trigger:{global:'useCard'}, - filter(event,player){ - if(event.all_excluded||event.player==player||!player.countCards('he')) return false; - return event.player.getHistory('useCard').indexOf(event)%2==1; + fakeciwei: { + audio: "ciwei", + trigger: { global: "useCard" }, + filter(event, player) { + if (event.all_excluded || event.player == player || !player.countCards("he")) + return false; + return event.player.getHistory("useCard").indexOf(event) % 2 == 1; }, - async cost(event,trigger,player){ - let str='弃置一张牌,取消'+get.translation(trigger.card)+'的所有目标'; - if(get.type(trigger.card)=='equip') str+=',然后你获得此牌且你可以使用之'; - event.result=await player.chooseToDiscard(get.prompt('fakeciwei',trigger.player),str,'he').set('ai',card=>{ - return (_status.event.goon/1.4)-get.value(card); - }).set('goon',function(){ - if(!trigger.targets.length) return -get.attitude(player,trigger.player); - var num=0; - for(var i of trigger.targets){ - num-=get.effect(i,trigger.card,trigger.player,player); - } - return num; - }()).setHiddenSkill('fakeciwei').set('logSkill',['fakeciwei',trigger.player]).forResult(); + async cost(event, trigger, player) { + let str = "弃置一张牌,取消" + get.translation(trigger.card) + "的所有目标"; + if (get.type(trigger.card) == "equip") str += ",然后你获得此牌且你可以使用之"; + event.result = await player + .chooseToDiscard(get.prompt("fakeciwei", trigger.player), str, "he") + .set("ai", (card) => { + return _status.event.goon / 1.4 - get.value(card); + }) + .set( + "goon", + (function () { + if (!trigger.targets.length) return -get.attitude(player, trigger.player); + var num = 0; + for (var i of trigger.targets) { + num -= get.effect(i, trigger.card, trigger.player, player); + } + return num; + })() + ) + .setHiddenSkill("fakeciwei") + .set("logSkill", ["fakeciwei", trigger.player]) + .forResult(); }, - preHidden:true, - popup:false, - async content(event,trigger,player){ - trigger.targets.length=0; - trigger.all_excluded=true; - if(get.type(trigger.card)=='equip'&&!get.owner(trigger.card)){ - await player.gain(trigger.card,'gain2'); - if(get.owner(trigger.card)==player&&player.hasUseTarget(trigger.card)){ + preHidden: true, + popup: false, + async content(event, trigger, player) { + trigger.targets.length = 0; + trigger.all_excluded = true; + if (get.type(trigger.card) == "equip" && !get.owner(trigger.card)) { + await player.gain(trigger.card, "gain2"); + if (get.owner(trigger.card) == player && player.hasUseTarget(trigger.card)) { await player.chooseUseTarget(trigger.card); } } }, - global:'fakeciwei_ai', - subSkill:{ - ai:{ - mod:{ - aiOrder(player,card,num){ - if(!player.getHistory('useCard').length%2||!game.hasPlayer(current=>{ - return current!=player&&(get.realAttitude||get.attitude)(current,player)<0&¤t.hasSkill('fakeciwei')&¤t.countCards('he')>0; - })) return; - if(!player._fakeciwei_temp){ - player._fakeciwei_temp=true; - num/=Math.max(1,player.getUseValue(card)); + global: "fakeciwei_ai", + subSkill: { + ai: { + mod: { + aiOrder(player, card, num) { + if ( + !player.getHistory("useCard").length % 2 || + !game.hasPlayer((current) => { + return ( + current != player && + (get.realAttitude || get.attitude)(current, player) < 0 && + current.hasSkill("fakeciwei") && + current.countCards("he") > 0 + ); + }) + ) + return; + if (!player._fakeciwei_temp) { + player._fakeciwei_temp = true; + num /= Math.max(1, player.getUseValue(card)); } delete player._fakeciwei_temp; return num; @@ -3539,2790 +5121,3631 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, }, - fakehuirong:{ - audio:'huirong', - trigger:{player:'showCharacterEnd'}, - filter(event,player){ - if(!game.hasPlayer(target=>{ - return target.countCards('h')!=target.getHp(); - })) return false; - return game.getAllGlobalHistory('everything',evt=>{ - return evt.name=='showCharacter'&&evt.player==player&&evt.toShow.some(i=>get.character(i,3).includes('fakehuirong')); - },event).indexOf(event)==0; + fakehuirong: { + audio: "huirong", + trigger: { player: "showCharacterEnd" }, + filter(event, player) { + if ( + !game.hasPlayer((target) => { + return target.countCards("h") != target.getHp(); + }) + ) + return false; + return ( + game + .getAllGlobalHistory( + "everything", + (evt) => { + return ( + evt.name == "showCharacter" && + evt.player == player && + evt.toShow.some((i) => get.character(i, 3).includes("fakehuirong")) + ); + }, + event + ) + .indexOf(event) == 0 + ); }, - async cost(event,trigger,player){ - event.result=await player.chooseTarget(get.prompt('fakehuirong'),'令一名角色将手牌数摸至/弃置至与其体力值相同',(card,player,target)=>{ - return target.countCards('h')!=target.getHp(); - }).set('ai',target=>{ - const att=get.attitude(get.event('player'),target); - const num=target.countCards('h'); - if(num>target.hp) return -att*(num-target.getHp()); - return att*Math.max(0,target.getHp()-target.countCards('h')); - }).forResult(); + async cost(event, trigger, player) { + event.result = await player + .chooseTarget( + get.prompt("fakehuirong"), + "令一名角色将手牌数摸至/弃置至与其体力值相同", + (card, player, target) => { + return target.countCards("h") != target.getHp(); + } + ) + .set("ai", (target) => { + const att = get.attitude(get.event("player"), target); + const num = target.countCards("h"); + if (num > target.hp) return -att * (num - target.getHp()); + return att * Math.max(0, target.getHp() - target.countCards("h")); + }) + .forResult(); }, - preHidden:true, - content(){ - const target=event.targets[0]; - if(target.countCards('h'){ - return evt.name=='showCharacter'&&evt.player==player&&evt.toShow.some(i=>get.character(i,3).includes('fakehuirong')); + ai: { mingzhi_no: true }, + group: "fakehuirong_damage", + subSkill: { + damage: { + audio: "huirong", + trigger: { player: "damageBegin4" }, + filter(event, player) { + if (!player.getStockSkills(true, true, true).includes("fakehuirong")) + return false; + return !game.getAllGlobalHistory("everything", (evt) => { + return ( + evt.name == "showCharacter" && + evt.player == player && + evt.toShow.some((i) => get.character(i, 3).includes("fakehuirong")) + ); }).length; }, - check(event,player){ - return !event.source||get.damageEffect(player,event.source,player)<0; + check(event, player) { + return !event.source || get.damageEffect(player, event.source, player) < 0; }, - prompt:'慧容:是否明置此武将牌并防止此伤害?', - content(){ + prompt: "慧容:是否明置此武将牌并防止此伤害?", + content() { trigger.cancel(); }, }, }, }, - fakeyanxi:{ - audio:'yanxi', - enable:'phaseUse', - filter(event,player){ - return game.hasPlayer(target=>{ - return get.info('fakeyanxi').filterTarget(null,player,target); + fakeyanxi: { + audio: "yanxi", + enable: "phaseUse", + filter(event, player) { + return game.hasPlayer((target) => { + return get.info("fakeyanxi").filterTarget(null, player, target); }); }, - filterTarget(card,player,target){ - return target!=player&&target.countCards('h'); + filterTarget(card, player, target) { + return target != player && target.countCards("h"); }, - usable:1, - async content(event,trigger,player){ - const target=event.target,str=get.translation(target); - const {result:{bool,links}}=await player.choosePlayerCard(target,'宴戏:展示'+str+'的一张手牌','h',true); - if(bool){ - let cards=get.cards(2),gains=[]; + usable: 1, + async content(event, trigger, player) { + const target = event.target, + str = get.translation(target); + const { + result: { bool, links }, + } = await player.choosePlayerCard(target, "宴戏:展示" + str + "的一张手牌", "h", true); + if (bool) { + let cards = get.cards(2), + gains = []; await game.cardsGotoOrdering(cards); - cards=links.slice().concat(cards); - await player.showCards(cards,get.translation(player)+'发动了【宴戏】'); - for(const card of cards){ + cards = links.slice().concat(cards); + await player.showCards(cards, get.translation(player) + "发动了【宴戏】"); + for (const card of cards) { gains.unshift(get.color(card)); gains.add(get.type2(card)); } - gains=gains.unique().map(i=>i=='none'?'none2':i); - const {result:{control}}=await player.chooseControl(gains).set('cards',cards).set('ai',()=>{ - const player=get.event('player'),cards=get.event('cards'),getNum=function(cards,control,player){ - cards=cards.filter(i=>get.type2(i)==control||get.color(i)==control); - return cards.reduce((sum,card)=>sum+get.value(card,player),0); - }; - let controls=get.event('controls').slice().map(i=>i=='none2'?'none':i); - controls.sort((a,b)=>getNum(cards,b,player)-getNum(cards,a,player)); - return controls[0]=='none'?'none2':controls[0]; - }).set('dialog',['获得其中一种颜色或类别的所有牌,然后'+str+'获得剩余牌','hidden',cards]); - if(control){ - const choice=(control=='none2'?'none':control); - gains=cards.filter(i=>get.type2(i)==choice||get.color(i)==choice); - const num=gains.length; + gains = gains.unique().map((i) => (i == "none" ? "none2" : i)); + const { + result: { control }, + } = await player + .chooseControl(gains) + .set("cards", cards) + .set("ai", () => { + const player = get.event("player"), + cards = get.event("cards"), + getNum = function (cards, control, player) { + cards = cards.filter( + (i) => get.type2(i) == control || get.color(i) == control + ); + return cards.reduce((sum, card) => sum + get.value(card, player), 0); + }; + let controls = get + .event("controls") + .slice() + .map((i) => (i == "none2" ? "none" : i)); + controls.sort((a, b) => getNum(cards, b, player) - getNum(cards, a, player)); + return controls[0] == "none" ? "none2" : controls[0]; + }) + .set("dialog", [ + "获得其中一种颜色或类别的所有牌,然后" + str + "获得剩余牌", + "hidden", + cards, + ]); + if (control) { + const choice = control == "none2" ? "none" : control; + gains = cards.filter((i) => get.type2(i) == choice || get.color(i) == choice); + const num = gains.length; cards.removeArray(gains); - if(gains.includes(links[0])){ + if (gains.includes(links[0])) { gains.removeArray(links); - await player.gain(links,target,'give','bySelf'); + await player.gain(links, target, "give", "bySelf"); } - if(gains.length) await player.gain(gains,'gain2'); - player.addTempSkill('fakeyanxi_maxHand'); - player.addMark('fakeyanxi_maxHand',num,false); - cards=cards.filter(i=>!links.includes(i)); - if(cards.length) await target.gain(cards,'gain2'); + if (gains.length) await player.gain(gains, "gain2"); + player.addTempSkill("fakeyanxi_maxHand"); + player.addMark("fakeyanxi_maxHand", num, false); + cards = cards.filter((i) => !links.includes(i)); + if (cards.length) await target.gain(cards, "gain2"); } } }, - ai:{ - order:9, - result:{ - target(player,target){ - return [-1,1,2][get.sgn(get.attitude(player,target))+1]/target.countCards('h'); + ai: { + order: 9, + result: { + target(player, target) { + return ( + [-1, 1, 2][get.sgn(get.attitude(player, target)) + 1] / target.countCards("h") + ); }, }, }, - subSkill:{ - maxHand:{ - charlotte:true, - onremove:true, - intro:{content:'手牌上限+#'}, - mod:{ - maxHandcard(player,num){ - return num+player.countMark('fakeyanxi_maxHand'); + subSkill: { + maxHand: { + charlotte: true, + onremove: true, + intro: { content: "手牌上限+#" }, + mod: { + maxHandcard(player, num) { + return num + player.countMark("fakeyanxi_maxHand"); }, }, }, }, }, - fakeshiren:{ - audio:'shiren', - trigger:{player:'showCharacterEnd'}, - filter(event,player){ - if(!game.hasPlayer(target=>{ - return get.info('fakeyanxi').filterTarget(null,player,target); - })) return false; - return game.getAllGlobalHistory('everything',evt=>{ - return evt.name=='showCharacter'&&evt.player==player&&evt.toShow.some(i=>get.character(i,3).includes('fakeshiren')); - },event).indexOf(event)==0; + fakeshiren: { + audio: "shiren", + trigger: { player: "showCharacterEnd" }, + filter(event, player) { + if ( + !game.hasPlayer((target) => { + return get.info("fakeyanxi").filterTarget(null, player, target); + }) + ) + return false; + return ( + game + .getAllGlobalHistory( + "everything", + (evt) => { + return ( + evt.name == "showCharacter" && + evt.player == player && + evt.toShow.some((i) => get.character(i, 3).includes("fakeshiren")) + ); + }, + event + ) + .indexOf(event) == 0 + ); }, - async cost(event,trigger,player){ - event.result=await player.chooseTarget(get.prompt('fakeshiren'),'发动一次【宴戏】',(card,player,target)=>{ - return get.info('fakeyanxi').filterTarget(null,player,target); - }).set('ai',target=>{ - const player=get.event('player'); - return -get.sgn(get.attitude(player,target))*get.info('fakeyanxi').ai.result.target(player,target); - }).forResult(); + async cost(event, trigger, player) { + event.result = await player + .chooseTarget( + get.prompt("fakeshiren"), + "发动一次【宴戏】", + (card, player, target) => { + return get.info("fakeyanxi").filterTarget(null, player, target); + } + ) + .set("ai", (target) => { + const player = get.event("player"); + return ( + -get.sgn(get.attitude(player, target)) * + get.info("fakeyanxi").ai.result.target(player, target) + ); + }) + .forResult(); }, - async content(event,trigger,player){ - const target=event.targets[0]; - player.useResult({skill:'fakeyanxi',target:target,targets:[target]},event); + async content(event, trigger, player) { + const target = event.targets[0]; + player.useResult({ skill: "fakeyanxi", target: target, targets: [target] }, event); }, - ai:{mingzhi_no:true}, - group:'fakeshiren_damage', - subSkill:{ - damage:{ - audio:'shiren', - trigger:{player:'damageBegin4'}, - filter(event,player){ - if(!player.getStockSkills(true,true,true).includes('fakeshiren')) return false; - return !game.getAllGlobalHistory('everything',evt=>{ - return evt.name=='showCharacter'&&evt.player==player&&evt.toShow.some(i=>get.character(i,3).includes('fakeshiren')); + ai: { mingzhi_no: true }, + group: "fakeshiren_damage", + subSkill: { + damage: { + audio: "shiren", + trigger: { player: "damageBegin4" }, + filter(event, player) { + if (!player.getStockSkills(true, true, true).includes("fakeshiren")) return false; + return !game.getAllGlobalHistory("everything", (evt) => { + return ( + evt.name == "showCharacter" && + evt.player == player && + evt.toShow.some((i) => get.character(i, 3).includes("fakeshiren")) + ); }).length; }, - check(event,player){ - return !event.source||get.damageEffect(player,event.source,player)<0; + check(event, player) { + return !event.source || get.damageEffect(player, event.source, player) < 0; }, - prompt:'识人:是否明置此武将牌并防止此伤害?', - content(){ + prompt: "识人:是否明置此武将牌并防止此伤害?", + content() { trigger.cancel(); }, }, }, }, - fakecanmou:{ - audio:'canmou', - trigger:{global:'useCardToPlayer'}, - filter(event,player){ - if(!event.player.isMaxHandcard(true)||!event.isFirstTarget||get.type(event.card)!='trick') return false; - if(event.targets.length>1&&!player.getStorage('fakecanmou_used').includes('-')) return true; - return get.info('fakecanmou').filter_add(event,player); + fakecanmou: { + audio: "canmou", + trigger: { global: "useCardToPlayer" }, + filter(event, player) { + if ( + !event.player.isMaxHandcard(true) || + !event.isFirstTarget || + get.type(event.card) != "trick" + ) + return false; + if (event.targets.length > 1 && !player.getStorage("fakecanmou_used").includes("-")) + return true; + return get.info("fakecanmou").filter_add(event, player); }, - filter_add(event,player){ - const info=get.info(event.card); - if(info.allowMultiple==false) return false; - if(event.targets&&!info.multitarget&&!player.getStorage('fakecanmou_used').includes('+')){ - if(game.hasPlayer(current=>{ - return !event.targets.includes(current)&&lib.filter.targetEnabled2(event.card,event.player,current); - })) return true; + filter_add(event, player) { + const info = get.info(event.card); + if (info.allowMultiple == false) return false; + if ( + event.targets && + !info.multitarget && + !player.getStorage("fakecanmou_used").includes("+") + ) { + if ( + game.hasPlayer((current) => { + return ( + !event.targets.includes(current) && + lib.filter.targetEnabled2(event.card, event.player, current) + ); + }) + ) + return true; } return false; }, - async cost(event,trigger,player){ - let str='',goon=get.info('fakecanmou').filter_add(trigger,player),bool=(trigger.targets.length>1&&!player.getStorage('fakecanmou_used').includes('-')); - if(goon) str+='增加'; - if(goon&&bool) str='或'; - if(bool) str+='减少'; - event.result=await player.chooseTarget(get.prompt('fakecanmou'),(card,player,target)=>{ - const trigger=get.event().getTrigger(); - if(trigger.targets.length>1&&!player.getStorage('fakecanmou_used').includes('-')&&trigger.targets.includes(target)) return true; - return !player.getStorage('fakecanmou_used').includes('+')&&!trigger.targets.includes(target)&&lib.filter.targetEnabled2(trigger.card,trigger.player,target); - }).set('prompt2','为'+get.translation(trigger.card)+str+'一个目标').set('ai',target=>{ - const player=get.event('player'),trigger=get.event().getTrigger(); - return get.effect(target,trigger.card,trigger.player,player)*(trigger.targets.includes(target)?-1:1); - }).setHiddenSkill('fakecanmou').forResult(); + async cost(event, trigger, player) { + let str = "", + goon = get.info("fakecanmou").filter_add(trigger, player), + bool = + trigger.targets.length > 1 && !player.getStorage("fakecanmou_used").includes("-"); + if (goon) str += "增加"; + if (goon && bool) str = "或"; + if (bool) str += "减少"; + event.result = await player + .chooseTarget(get.prompt("fakecanmou"), (card, player, target) => { + const trigger = get.event().getTrigger(); + if ( + trigger.targets.length > 1 && + !player.getStorage("fakecanmou_used").includes("-") && + trigger.targets.includes(target) + ) + return true; + return ( + !player.getStorage("fakecanmou_used").includes("+") && + !trigger.targets.includes(target) && + lib.filter.targetEnabled2(trigger.card, trigger.player, target) + ); + }) + .set("prompt2", "为" + get.translation(trigger.card) + str + "一个目标") + .set("ai", (target) => { + const player = get.event("player"), + trigger = get.event().getTrigger(); + return ( + get.effect(target, trigger.card, trigger.player, player) * + (trigger.targets.includes(target) ? -1 : 1) + ); + }) + .setHiddenSkill("fakecanmou") + .forResult(); }, - preHidden:true, - async content(event,trigger,player){ - const target=event.targets[0],goon=trigger.targets.includes(target); - player.addTempSkill('fakecanmou_used'); - player.markAuto('fakecanmou_used',[goon?'-':'+']); - if(goon){ + preHidden: true, + async content(event, trigger, player) { + const target = event.targets[0], + goon = trigger.targets.includes(target); + player.addTempSkill("fakecanmou_used"); + player.markAuto("fakecanmou_used", [goon ? "-" : "+"]); + if (goon) { trigger.targets.remove(target); - game.log(target,'被',player,'移除了目标'); - } - else{ + game.log(target, "被", player, "移除了目标"); + } else { trigger.targets.add(target); - game.log(target,'成为了',trigger.card,'移除了目标'); + game.log(target, "成为了", trigger.card, "移除了目标"); } }, - subSkill:{used:{charlotte:true,onremove:true}}, + subSkill: { used: { charlotte: true, onremove: true } }, }, - fakezhuosheng:{ - hiddenCard(player,name){ - return player.countCards('hs')>1&&get.type(name)=='basic'&&lib.inpile.includes(name)&&!player.getStorage('fakezhuosheng_count').includes(name); + fakezhuosheng: { + hiddenCard(player, name) { + return ( + player.countCards("hs") > 1 && + get.type(name) == "basic" && + lib.inpile.includes(name) && + !player.getStorage("fakezhuosheng_count").includes(name) + ); }, - audio:'zhuosheng', - enable:'chooseToUse', - filter(event,player){ - if(event.type=='wuxie') return false; - if(player.countCards('hs')<2) return false; - return get.inpileVCardList(info=>{ - const name=info[2]; - return !player.getStorage('fakezhuosheng_count').includes(name)&&get.type(name)=='basic'; - }).some(card=>event.filterCard({name:card[2],nature:card[3]},player,event)); + audio: "zhuosheng", + enable: "chooseToUse", + filter(event, player) { + if (event.type == "wuxie") return false; + if (player.countCards("hs") < 2) return false; + return get + .inpileVCardList((info) => { + const name = info[2]; + return ( + !player.getStorage("fakezhuosheng_count").includes(name) && + get.type(name) == "basic" + ); + }) + .some((card) => event.filterCard({ name: card[2], nature: card[3] }, player, event)); }, - chooseButton:{ - dialog(event,player){ - var list=get.inpileVCardList(info=>{ - const name=info[2]; - return !player.getStorage('fakezhuosheng_count').includes(name)&&get.type(name)=='basic'; - }).filter(card=>event.filterCard({name:card[2],nature:card[3]},player,event)); - return ui.create.dialog('擢升',[list,'vcard'],'hidden'); + chooseButton: { + dialog(event, player) { + var list = get + .inpileVCardList((info) => { + const name = info[2]; + return ( + !player.getStorage("fakezhuosheng_count").includes(name) && + get.type(name) == "basic" + ); + }) + .filter((card) => + event.filterCard({ name: card[2], nature: card[3] }, player, event) + ); + return ui.create.dialog("擢升", [list, "vcard"], "hidden"); }, - check(button){ - var player=_status.event.player; - var evt=_status.event.getParent(); - var name=button.link[2],card={name:name,nature:button.link[3]}; - if(name=='shan') return 2; - if(evt.type=='dying'){ - if(get.attitude(player,evt.dying)<2) return 0; - if(name=='jiu') return 2.1; + check(button) { + var player = _status.event.player; + var evt = _status.event.getParent(); + var name = button.link[2], + card = { name: name, nature: button.link[3] }; + if (name == "shan") return 2; + if (evt.type == "dying") { + if (get.attitude(player, evt.dying) < 2) return 0; + if (name == "jiu") return 2.1; return 1.9; } - if(evt.type=='phase'){ - if(button.link[2]=='jiu'){ - if(player.getUseValue({name:'jiu'})<=0) return 0; - var cards=player.getCards('hs',cardx=>get.value(cardx)<8); - cards.sort((a,b)=>get.value(a)-get.value(b)); - if(cards.some(cardx=>get.name(cardx)=='sha'&&!cards.slice(0,2).includes(cardx))) return player.getUseValue({name:'jiu'}); + if (evt.type == "phase") { + if (button.link[2] == "jiu") { + if (player.getUseValue({ name: "jiu" }) <= 0) return 0; + var cards = player.getCards("hs", (cardx) => get.value(cardx) < 8); + cards.sort((a, b) => get.value(a) - get.value(b)); + if ( + cards.some( + (cardx) => + get.name(cardx) == "sha" && !cards.slice(0, 2).includes(cardx) + ) + ) + return player.getUseValue({ name: "jiu" }); return 0; } - return player.getUseValue(card)/4; + return player.getUseValue(card) / 4; } return 1; }, - backup(links,player){ + backup(links, player) { return { - audio:'zhuosheng', - filterCard:true, - selectCard:[2,Infinity], - position:'hs', - complexCard:true, - check(card){ - if(ui.selected.cards.length>=2) return 0; - return 8-get.value(card); + audio: "zhuosheng", + filterCard: true, + selectCard: [2, Infinity], + position: "hs", + complexCard: true, + check(card) { + if (ui.selected.cards.length >= 2) return 0; + return 8 - get.value(card); }, - popname:true, - viewAs:{ - name:links[0][2], - nature:links[0][3], + popname: true, + viewAs: { + name: links[0][2], + nature: links[0][3], }, - precontent(){ - var name=event.result.card.name; - player.addTempSkill('fakezhuosheng_count'); - player.markAuto('fakezhuosheng_count',[name]); - player.when('yingbian') - .filter(evt=>evt.skill=='fakezhuosheng_backup') - .then(()=>{ - if(trigger.cards&&trigger.cards.length){ - let cards=trigger.cards.slice(); - cards=cards.filter(i=>get.is.yingbian(i)); - if(cards.length){ - if(!Array.isArray(trigger.temporaryYingbian)) trigger.temporaryYingbian=[]; - trigger.temporaryYingbian.add('force'); - trigger.temporaryYingbian.addArray(Array.from(lib.yingbian.effect.keys()).filter(value=>{ - return cards.some(card=>get.cardtag(card,`yingbian_${value}`)); - })); + precontent() { + var name = event.result.card.name; + player.addTempSkill("fakezhuosheng_count"); + player.markAuto("fakezhuosheng_count", [name]); + player + .when("yingbian") + .filter((evt) => evt.skill == "fakezhuosheng_backup") + .then(() => { + if (trigger.cards && trigger.cards.length) { + let cards = trigger.cards.slice(); + cards = cards.filter((i) => get.is.yingbian(i)); + if (cards.length) { + if (!Array.isArray(trigger.temporaryYingbian)) + trigger.temporaryYingbian = []; + trigger.temporaryYingbian.add("force"); + trigger.temporaryYingbian.addArray( + Array.from(lib.yingbian.effect.keys()).filter((value) => { + return cards.some((card) => + get.cardtag(card, `yingbian_${value}`) + ); + }) + ); + } } - } - }); + }); }, - } + }; }, - prompt(links,player){ - var name=links[0][2]; - var nature=links[0][3]; - return '将至少两张手牌当作'+(get.translation(nature)||'')+get.translation(name)+'使用'; + prompt(links, player) { + var name = links[0][2]; + var nature = links[0][3]; + return ( + "将至少两张手牌当作" + + (get.translation(nature) || "") + + get.translation(name) + + "使用" + ); }, }, - ai:{ - order(item,player){ - if(player&&_status.event.type=='phase'){ - var add=false,max=0; - var names=lib.inpile.filter(name=>get.type(name)=='basic'&&!player.getStorage('fakezhuosheng_count').includes(name)); - if(names.includes('sha')) add=true; - names=names.map(namex=>{return {name:namex}}); - if(add) lib.inpile_nature.forEach(nature=>names.push({name:'sha',nature:nature})); - names.forEach(card=>{ - if(player.getUseValue(card)>0){ - var temp=get.order(card); - if(card.name=='jiu'){ - var cards=player.getCards('hs',cardx=>get.value(cardx)<8); - cards.sort((a,b)=>get.value(a)-get.value(b)); - if(!cards.some(cardx=>get.name(cardx)=='sha'&&!cards.slice(0,2).includes(cardx))) temp=0; + ai: { + order(item, player) { + if (player && _status.event.type == "phase") { + var add = false, + max = 0; + var names = lib.inpile.filter( + (name) => + get.type(name) == "basic" && + !player.getStorage("fakezhuosheng_count").includes(name) + ); + if (names.includes("sha")) add = true; + names = names.map((namex) => { + return { name: namex }; + }); + if (add) + lib.inpile_nature.forEach((nature) => + names.push({ name: "sha", nature: nature }) + ); + names.forEach((card) => { + if (player.getUseValue(card) > 0) { + var temp = get.order(card); + if (card.name == "jiu") { + var cards = player.getCards("hs", (cardx) => get.value(cardx) < 8); + cards.sort((a, b) => get.value(a) - get.value(b)); + if ( + !cards.some( + (cardx) => + get.name(cardx) == "sha" && + !cards.slice(0, 2).includes(cardx) + ) + ) + temp = 0; } - if(temp>max) max=temp; + if (temp > max) max = temp; } }); - if(max>0) max-=0.001; + if (max > 0) max -= 0.001; return max; } return 0.5; }, - respondShan:true, - respondSha:true, - fireAttack:true, - skillTagFilter(player,tag,arg){ - if(arg=='respond') return false; - const name=(tag=='respondShan'?'shan':'sha'); - return get.info('fakezhuosheng').hiddenCard(player,name); + respondShan: true, + respondSha: true, + fireAttack: true, + skillTagFilter(player, tag, arg) { + if (arg == "respond") return false; + const name = tag == "respondShan" ? "shan" : "sha"; + return get.info("fakezhuosheng").hiddenCard(player, name); }, - result:{ - player(player){ - if(_status.event.dying) return get.attitude(player,_status.event.dying); + result: { + player(player) { + if (_status.event.dying) return get.attitude(player, _status.event.dying); return 1; }, }, }, - subSkill:{ - count:{charlotte:true,onremove:true}, - backup:{}, + subSkill: { + count: { charlotte: true, onremove: true }, + backup: {}, }, }, - fakejuhou:{ - zhenfa:'inline', - trigger:{global:'useCardToTargeted'}, - filter(event,player){ - return (event.card.name=='sha'||get.type(event.card)=='trick')&&event.target.inline(player); + fakejuhou: { + zhenfa: "inline", + trigger: { global: "useCardToTargeted" }, + filter(event, player) { + return ( + (event.card.name == "sha" || get.type(event.card) == "trick") && + event.target.inline(player) + ); }, - logTarget:'target', - async content(event,trigger,player){ - const target=trigger.target; - const {result:{bool,cards}}=await target.chooseCard('he',[1,Infinity],'是否将任意张牌置于武将牌上?').set('ai',card=>{ - const trigger=get.event().getTrigger(),player=trigger.target; - if(card.name=='baiyin'&&get.position(card)=='e'&&player.isDamaged()&&get.recoverEffect(player,player,player)>0) return 1; - if(['guohe','shunshou','zhujinqiyuan','chuqibuyi','huogong'].includes(trigger.card.name)&&get.effect(player,trigger.card,trigger.player,player)<0) return 1; - return 0; - }); - if(bool){ - target.addToExpansion(cards,'giveAuto',target).gaintag.add('fakejuhou'); - target.addSkill('fakejuhou'); - target.when({global:'useCardAfter'}) - .filter(evt=>evt==trigger.getParent()) - .then(()=>{ - const cards=player.getExpansions('fakejuhou'); - if(cards.length) player.gain(cards,'gain2'); + logTarget: "target", + async content(event, trigger, player) { + const target = trigger.target; + const { + result: { bool, cards }, + } = await target + .chooseCard("he", [1, Infinity], "是否将任意张牌置于武将牌上?") + .set("ai", (card) => { + const trigger = get.event().getTrigger(), + player = trigger.target; + if ( + card.name == "baiyin" && + get.position(card) == "e" && + player.isDamaged() && + get.recoverEffect(player, player, player) > 0 + ) + return 1; + if ( + ["guohe", "shunshou", "zhujinqiyuan", "chuqibuyi", "huogong"].includes( + trigger.card.name + ) && + get.effect(player, trigger.card, trigger.player, player) < 0 + ) + return 1; + return 0; }); + if (bool) { + target.addToExpansion(cards, "giveAuto", target).gaintag.add("fakejuhou"); + target.addSkill("fakejuhou"); + target + .when({ global: "useCardAfter" }) + .filter((evt) => evt == trigger.getParent()) + .then(() => { + const cards = player.getExpansions("fakejuhou"); + if (cards.length) player.gain(cards, "gain2"); + }); } }, - intro:{ - content:'expansion', - markcount:'expansion', + intro: { + content: "expansion", + markcount: "expansion", }, }, - gznaxiang:{ - audio:'naxiang', - inherit:'naxiang', + gznaxiang: { + audio: "naxiang", + inherit: "naxiang", }, - fakecaiwang:{ - audio:'caiwang', - trigger:{player:'loseAfter'}, - filter(event,player){ - const evt=event.getParent(2); - if(evt.name!='yingbianZhuzhan') return false; - const color=(get.color(evt.card)==get.color(event.cards[0])).toString(); - if(color=='true'&&!game.hasPlayer(target=>{ - return target!=player&&target.countCards('he'); - })) return false; - return !player.getStorage('fakecaiwang_used').includes(color); + fakecaiwang: { + audio: "caiwang", + trigger: { player: "loseAfter" }, + filter(event, player) { + const evt = event.getParent(2); + if (evt.name != "yingbianZhuzhan") return false; + const color = (get.color(evt.card) == get.color(event.cards[0])).toString(); + if ( + color == "true" && + !game.hasPlayer((target) => { + return target != player && target.countCards("he"); + }) + ) + return false; + return !player.getStorage("fakecaiwang_used").includes(color); }, - async cost(event,trigger,player){ - const color=(get.color(trigger.getParent(2).card)==get.color(trigger.cards[0])).toString(); - if(color=='false'){ + async cost(event, trigger, player) { + const color = ( + get.color(trigger.getParent(2).card) == get.color(trigger.cards[0]) + ).toString(); + if (color == "false") { //event.result=await player.chooseBool(get.prompt('fakecaiwang'),'摸一张牌').forResult(); - event.result={bool:true}; - } - else{ - event.result=await player.chooseTarget(get.prompt('fakecaiwang'),'弃置一名其他角色的一张牌',(card,player,target)=>{ - return target!=player&&target.countCards('he'); - }).set('ai',target=>{ - const player=get.event('player'); - return get.effect(target,{name:'guohe_copy2'},player,player); - }).forResult(); + event.result = { bool: true }; + } else { + event.result = await player + .chooseTarget( + get.prompt("fakecaiwang"), + "弃置一名其他角色的一张牌", + (card, player, target) => { + return target != player && target.countCards("he"); + } + ) + .set("ai", (target) => { + const player = get.event("player"); + return get.effect(target, { name: "guohe_copy2" }, player, player); + }) + .forResult(); } }, - async content(event,trigger,player){ - const color=(get.color(trigger.getParent(2).card)==get.color(trigger.cards[0])).toString(); - player.addTempSkill('fakecaiwang_used'); - player.markAuto('fakecaiwang_used',[color]); - if(color=='false') await player.draw(); - else await player.discardPlayerCard(event.targets[0],'he',true); + async content(event, trigger, player) { + const color = ( + get.color(trigger.getParent(2).card) == get.color(trigger.cards[0]) + ).toString(); + player.addTempSkill("fakecaiwang_used"); + player.markAuto("fakecaiwang_used", [color]); + if (color == "false") await player.draw(); + else await player.discardPlayerCard(event.targets[0], "he", true); }, - group:'fakecaiwang_zhuzhan', - subSkill:{ - used:{ - charlotte:true, - onremove:true, + group: "fakecaiwang_zhuzhan", + subSkill: { + used: { + charlotte: true, + onremove: true, }, - zhuzhan:{ - trigger:{player:'yingbianZhuzhanBegin'}, - forced:true, - locked:false, - popup:false, - firstDo:true, - content(){ - trigger.setContent(get.info('fakecaiwang').yingbian); + zhuzhan: { + trigger: { player: "yingbianZhuzhanBegin" }, + forced: true, + locked: false, + popup: false, + firstDo: true, + content() { + trigger.setContent(get.info("fakecaiwang").yingbian); }, }, }, - yingbian(){ - 'step 0'; + yingbian() { + "step 0"; event._global_waiting = true; event.send = (player, card, source, targets, id, id2, yingbianZhuzhanAI, skillState) => { if (skillState) player.applySkills(skillState); - var type = get.type2(card), str = get.translation(source); + var type = get.type2(card), + str = get.translation(source); if (targets && targets.length) str += `对${get.translation(targets)}`; - str += `使用了${get.translation(card)},是否弃置一张${get.translation(type)}为其助战?`; + str += `使用了${get.translation(card)},是否弃置一张${get.translation( + type + )}为其助战?`; player.chooseCard({ - filterCard: (card, player) => get.type2(card) == type && lib.filter.cardDiscardable(card, player), + filterCard: (card, player) => + get.type2(card) == type && lib.filter.cardDiscardable(card, player), prompt: str, - position: 'h', + position: "h", _global_waiting: true, id: id, id2: id2, - ai: typeof yingbianZhuzhanAI == 'function' ? yingbianZhuzhanAI(player, card, source, targets) : cardx => { - var info = get.info(card); - if (info && info.ai && info.ai.yingbian) { - var ai = info.ai.yingbian(card, source, targets, player); - if (!ai) return 0; - return ai - get.value(cardx); - } - else if (get.attitude(player, source) <= 0) return 0; - return 5 - get.value(cardx); - } + ai: + typeof yingbianZhuzhanAI == "function" + ? yingbianZhuzhanAI(player, card, source, targets) + : (cardx) => { + var info = get.info(card); + if (info && info.ai && info.ai.yingbian) { + var ai = info.ai.yingbian(card, source, targets, player); + if (!ai) return 0; + return ai - get.value(cardx); + } else if (get.attitude(player, source) <= 0) return 0; + return 5 - get.value(cardx); + }, }); if (!game.online) return; _status.event._resultid = id; game.resume(); }; - 'step 1'; + "step 1"; var type = get.type2(card); - event.list = game.filterPlayer(current => current.countCards('h') && (_status.connectMode || current.hasCard(cardx => get.type2(cardx) == type, 'h'))).sortBySeat(_status.currentPhase || player); + event.list = game + .filterPlayer( + (current) => + current.countCards("h") && + (_status.connectMode || + current.hasCard((cardx) => get.type2(cardx) == type, "h")) + ) + .sortBySeat(_status.currentPhase || player); event.id = get.id(); - 'step 2'; + "step 2"; if (!event.list.length) event.finish(); - else if (_status.connectMode && (event.list[0].isOnline() || event.list[0] == game.me)) event.goto(4); - else event.send(event.current = event.list.shift(), event.card, player, trigger.targets, event.id, trigger.parent.id, trigger.yingbianZhuzhanAI); - 'step 3'; + else if (_status.connectMode && (event.list[0].isOnline() || event.list[0] == game.me)) + event.goto(4); + else + event.send( + (event.current = event.list.shift()), + event.card, + player, + trigger.targets, + event.id, + trigger.parent.id, + trigger.yingbianZhuzhanAI + ); + "step 3"; if (result.bool) { event.zhuzhanresult = event.current; event.zhuzhanresult2 = result; if (event.current != game.me) game.delayx(); event.goto(8); - } - else event.goto(2); - 'step 4'; - var id = event.id, sendback = (result, player) => { - if (result && result.id == id && !event.zhuzhanresult && result.bool) { - event.zhuzhanresult = player; - event.zhuzhanresult2 = result; - game.broadcast('cancel', id); - if (_status.event.id == id && _status.event.name == 'chooseCard' && _status.paused) return () => { - event.resultOL = _status.event.resultOL; - ui.click.cancel(); - if (ui.confirm) ui.confirm.close(); - }; - } - else if (_status.event.id == id && _status.event.name == 'chooseCard' && _status.paused) return () => event.resultOL = _status.event.resultOL; - }, withme = false, withol = false, list = event.list; + } else event.goto(2); + "step 4"; + var id = event.id, + sendback = (result, player) => { + if (result && result.id == id && !event.zhuzhanresult && result.bool) { + event.zhuzhanresult = player; + event.zhuzhanresult2 = result; + game.broadcast("cancel", id); + if ( + _status.event.id == id && + _status.event.name == "chooseCard" && + _status.paused + ) + return () => { + event.resultOL = _status.event.resultOL; + ui.click.cancel(); + if (ui.confirm) ui.confirm.close(); + }; + } else if ( + _status.event.id == id && + _status.event.name == "chooseCard" && + _status.paused + ) + return () => (event.resultOL = _status.event.resultOL); + }, + withme = false, + withol = false, + list = event.list; for (var i = 0; i < list.length; i++) { var current = list[i]; if (current.isOnline()) { withol = true; current.wait(sendback); - current.send(event.send, current, event.card, player, trigger.targets, event.id, trigger.parent.id, trigger.yingbianZhuzhanAI, get.skillState(current)); + current.send( + event.send, + current, + event.card, + player, + trigger.targets, + event.id, + trigger.parent.id, + trigger.yingbianZhuzhanAI, + get.skillState(current) + ); list.splice(i--, 1); - } - else if (current == game.me) { + } else if (current == game.me) { withme = true; - event.send(current, event.card, player, trigger.targets, event.id, trigger.parent.id, trigger.yingbianZhuzhanAI); + event.send( + current, + event.card, + player, + trigger.targets, + event.id, + trigger.parent.id, + trigger.yingbianZhuzhanAI + ); list.splice(i--, 1); } } if (!withme) event.goto(6); - if (_status.connectMode && (withme || withol)) game.players.forEach(value => { - if (value != player) value.showTimer(); - }); + if (_status.connectMode && (withme || withol)) + game.players.forEach((value) => { + if (value != player) value.showTimer(); + }); event.withol = withol; - 'step 5'; + "step 5"; if (!result || !result.bool || event.zhuzhanresult) return; - game.broadcast('cancel', event.id); + game.broadcast("cancel", event.id); event.zhuzhanresult = game.me; event.zhuzhanresult2 = result; - 'step 6'; + "step 6"; if (event.withol && !event.resultOL) game.pause(); - 'step 7'; - game.players.forEach(value => value.hideTimer()); - 'step 8'; + "step 7"; + game.players.forEach((value) => value.hideTimer()); + "step 8"; if (event.zhuzhanresult) { var target = event.zhuzhanresult; - if(target==player&&player.hasSkill('fakecaiwang')) player.logSkill('fakecaiwang'); - target.line(player, 'green'); + if (target == player && player.hasSkill("fakecaiwang")) + player.logSkill("fakecaiwang"); + target.line(player, "green"); target.discard(event.zhuzhanresult2.cards).discarder = target; - if (typeof event.afterYingbianZhuzhan == 'function') event.afterYingbianZhuzhan(event, trigger); - var yingbianCondition = event.name.slice(8).toLowerCase(), yingbianConditionTag = `yingbian_${yingbianCondition}_tag`; - target.popup(yingbianConditionTag, lib.yingbian.condition.color.get(yingbianCondition)); - game.log(target, '响应了', '' + (target==player?'自己':get.translation(player)) + '', '发起的', yingbianConditionTag); + if (typeof event.afterYingbianZhuzhan == "function") + event.afterYingbianZhuzhan(event, trigger); + var yingbianCondition = event.name.slice(8).toLowerCase(), + yingbianConditionTag = `yingbian_${yingbianCondition}_tag`; + target.popup( + yingbianConditionTag, + lib.yingbian.condition.color.get(yingbianCondition) + ); + game.log( + target, + "响应了", + '' + + (target == player ? "自己" : get.translation(player)) + + "", + "发起的", + yingbianConditionTag + ); target.addExpose(0.2); event.result = { - bool: true + bool: true, + }; + } else + event.result = { + bool: false, }; - } - else event.result = { - bool: false - }; }, }, - fakenaxiang:{ - audio:'naxiang', - trigger:{ - source:'damageSource', - player:'damageEnd', + fakenaxiang: { + audio: "naxiang", + trigger: { + source: "damageSource", + player: "damageEnd", }, - filter(event,player){ - if(!event.source||!event.player||!event.source.isIn()||!event.player.isIn()||!event.source.isEnemyOf(event.player)) return false; - return !player.getStorage('fakenaxiang').includes(get.info('fakenaxiang').logTarget(event,player)); + filter(event, player) { + if ( + !event.source || + !event.player || + !event.source.isIn() || + !event.player.isIn() || + !event.source.isEnemyOf(event.player) + ) + return false; + return !player + .getStorage("fakenaxiang") + .includes(get.info("fakenaxiang").logTarget(event, player)); }, - logTarget(event,player){ - return event.source==player?event.player:event.source; + logTarget(event, player) { + return event.source == player ? event.player : event.source; }, - forced:true, - async content(event,trigger,player){ - const target=get.info('fakenaxiang').logTarget(trigger,player); - const {result:{junling,targets}}=await player.chooseJunlingFor(target); - const {result:{index}}=await target.chooseJunlingControl(player,junling,targets).set('prompt','纳降:是否执行军令?'); - if(index==0) await target.carryOutJunling(player,junling,targets); - else{ - if(!player.storage.fakenaxiang){ - player.when(['phaseBegin','die']).then(()=>{ - player.unmarkSkill('fakenaxiang'); + forced: true, + async content(event, trigger, player) { + const target = get.info("fakenaxiang").logTarget(trigger, player); + const { + result: { junling, targets }, + } = await player.chooseJunlingFor(target); + const { + result: { index }, + } = await target + .chooseJunlingControl(player, junling, targets) + .set("prompt", "纳降:是否执行军令?"); + if (index == 0) await target.carryOutJunling(player, junling, targets); + else { + if (!player.storage.fakenaxiang) { + player.when(["phaseBegin", "die"]).then(() => { + player.unmarkSkill("fakenaxiang"); delete player.storage.fakenaxiang; }); } - player.markAuto('fakenaxiang',[target]); + player.markAuto("fakenaxiang", [target]); } }, - onremove:true, - marktext:'', - intro:{content:'无法对$发动【纳降】'}, - group:['fakenaxiang_discard','fakenaxiang_yingbian'], - subSkill:{ - discard:{ - trigger:{player:'chooseCardBegin'}, - filter(event,player){ - return event.getParent().name=='yingbianZhuzhan'; + onremove: true, + marktext: '', + intro: { content: "无法对$发动【纳降】" }, + group: ["fakenaxiang_discard", "fakenaxiang_yingbian"], + subSkill: { + discard: { + trigger: { player: "chooseCardBegin" }, + filter(event, player) { + return event.getParent().name == "yingbianZhuzhan"; }, - forced:true, - popup:false, - firstDo:true, - content(){ - trigger.filterCard=lib.filter.cardDiscardable; + forced: true, + popup: false, + firstDo: true, + content() { + trigger.filterCard = lib.filter.cardDiscardable; }, }, - yingbian:{ - trigger:{player:'yingbian'}, - filter(event,player){ - if(event.card.yingbian) return false; - const temporaryYingbian=event.temporaryYingbian||[],card=event.card; - if(temporaryYingbian.includes('force')||get.cardtag(card,'yingbian_force')) return true; + yingbian: { + trigger: { player: "yingbian" }, + filter(event, player) { + if (event.card.yingbian) return false; + const temporaryYingbian = event.temporaryYingbian || [], + card = event.card; + if (temporaryYingbian.includes("force") || get.cardtag(card, "yingbian_force")) + return true; return get.yingbianConditions(event.card).length; }, - forced:true, - popup:false, - firstDo:true, - content(){ - 'step 0' - trigger.card.yingbian=true; - event.card=trigger.card; - event.temporaryYingbian=(trigger.temporaryYingbian||[]); - if(event.temporaryYingbian.includes('force')||get.cardtag(event.card,'yingbian_force')||trigger.forceYingbian||player.hasSkillTag('forceYingbian')){ - player.popup('yingbian_force_tag',lib.yingbian.condition.color.get('force')); - game.log(player,'触发了',event.card,'的应变条件'); - event._result={bool:true}; - } - else{ - trigger.yingbianZhuzhanAI=(player,card,source,targets)=>cardx=>{ - if(get.attitude(player,source)<=0) return 0; - var info=get.info(card),num=0; - if(info&&info.ai&&info.ai.yingbian){ - var ai=info.ai.yingbian(card,source,targets,player); - if(ai) num=ai; + forced: true, + popup: false, + firstDo: true, + content() { + "step 0"; + trigger.card.yingbian = true; + event.card = trigger.card; + event.temporaryYingbian = trigger.temporaryYingbian || []; + if ( + event.temporaryYingbian.includes("force") || + get.cardtag(event.card, "yingbian_force") || + trigger.forceYingbian || + player.hasSkillTag("forceYingbian") + ) { + player.popup("yingbian_force_tag", lib.yingbian.condition.color.get("force")); + game.log(player, "触发了", event.card, "的应变条件"); + event._result = { bool: true }; + } else { + trigger.yingbianZhuzhanAI = (player, card, source, targets) => (cardx) => { + if (get.attitude(player, source) <= 0) return 0; + var info = get.info(card), + num = 0; + if (info && info.ai && info.ai.yingbian) { + var ai = info.ai.yingbian(card, source, targets, player); + if (ai) num = ai; } - return Math.max(num,6)-get.value(cardx); + return Math.max(num, 6) - get.value(cardx); }; - lib.yingbian.condition.complex.get('zhuzhan')(trigger); + lib.yingbian.condition.complex.get("zhuzhan")(trigger); } - 'step 1' - if(!result.bool) return; - var yingbianEffectExecuted=false; - lib.yingbian.effect.forEach((value,key)=>{ - if(!event.temporaryYingbian.includes(key)&&!get.cardtag(card,`yingbian_${key}`)) return; - game.yingbianEffect(trigger,value); - if(!yingbianEffectExecuted) yingbianEffectExecuted=true; + "step 1"; + if (!result.bool) return; + var yingbianEffectExecuted = false; + lib.yingbian.effect.forEach((value, key) => { + if ( + !event.temporaryYingbian.includes(key) && + !get.cardtag(card, `yingbian_${key}`) + ) + return; + game.yingbianEffect(trigger, value); + if (!yingbianEffectExecuted) yingbianEffectExecuted = true; }); - if(!yingbianEffectExecuted){ - var defaultYingbianEffect=get.defaultYingbianEffect(card); - if(lib.yingbian.effect.has(defaultYingbianEffect)){ - game.yingbianEffect(trigger,lib.yingbian.effect.get(defaultYingbianEffect)); - if(!yingbianEffectExecuted) yingbianEffectExecuted=true; + if (!yingbianEffectExecuted) { + var defaultYingbianEffect = get.defaultYingbianEffect(card); + if (lib.yingbian.effect.has(defaultYingbianEffect)) { + game.yingbianEffect( + trigger, + lib.yingbian.effect.get(defaultYingbianEffect) + ); + if (!yingbianEffectExecuted) yingbianEffectExecuted = true; } } - if(yingbianEffectExecuted) player.addTempSkill('yingbian_changeTarget'); + if (yingbianEffectExecuted) player.addTempSkill("yingbian_changeTarget"); }, }, }, }, - fakehuyuan:{ - audio:'yuanhu', - trigger:{player:'phaseJieshuBegin'}, - filter(event,player){ - return player.countCards('he',card=>{ - if(get.position(card)=='h'&&_status.connectMode) return true; - return get.type(card)=='equip'; - })>0; + fakehuyuan: { + audio: "yuanhu", + trigger: { player: "phaseJieshuBegin" }, + filter(event, player) { + return ( + player.countCards("he", (card) => { + if (get.position(card) == "h" && _status.connectMode) return true; + return get.type(card) == "equip"; + }) > 0 + ); }, - async cost(event,trigger,player){ - event.result=await player.chooseCardTarget({ - prompt:get.prompt2('yuanhu'), - filterCard(card){ - return get.type(card)=='equip'; - }, - position:'he', - filterTarget(card,player,target){ - return target.canEquip(card); - }, - ai1(card){ - return 6-get.value(card); - }, - ai2(target){ - return get.attitude(_status.event.player,target)-3; - }, - }).set('hiddenSkill','fakehuyuan').forResult(); + async cost(event, trigger, player) { + event.result = await player + .chooseCardTarget({ + prompt: get.prompt2("yuanhu"), + filterCard(card) { + return get.type(card) == "equip"; + }, + position: "he", + filterTarget(card, player, target) { + return target.canEquip(card); + }, + ai1(card) { + return 6 - get.value(card); + }, + ai2(target) { + return get.attitude(_status.event.player, target) - 3; + }, + }) + .set("hiddenSkill", "fakehuyuan") + .forResult(); }, - preHidden:true, - async content(event,trigger,player){ - const card=event.cards[0],target=event.targets[0]; - if(target!=player) player.$give(card,target,false); + preHidden: true, + async content(event, trigger, player) { + const card = event.cards[0], + target = event.targets[0]; + if (target != player) player.$give(card, target, false); await target.equip(card); }, - group:'fakehuyuan_discard', - subSkill:{ - discard:{ - trigger:{global:'equipEnd'}, - filter(event,player){ - return _status.currentPhase==player&&game.hasPlayer(target=>{ - return get.distance(event.player,target)<=1&&target!=event.player&&target.countCards('hej'); - }); + group: "fakehuyuan_discard", + subSkill: { + discard: { + trigger: { global: "equipEnd" }, + filter(event, player) { + return ( + _status.currentPhase == player && + game.hasPlayer((target) => { + return ( + get.distance(event.player, target) <= 1 && + target != event.player && + target.countCards("hej") + ); + }) + ); }, - async cost(event,trigger,player){ - event.result=await player.chooseTarget(get.prompt('fakehuyuan'),'弃置一名与'+get.translation(trigger.player)+'距离为1以内的另一名角色区域里的一张牌',(card,player,target)=>{ - const trigger=get.event().getTrigger(); - return get.distance(trigger.player,target)<=1&&target!=trigger.player&&target.countCards('hej'); - }).set('ai',target=>{ - const player=get.event('player'); - return get.effect(target,{name:'guohe'},player,player); - }).set('hiddenSkill','fakehuyuan').forResult(); + async cost(event, trigger, player) { + event.result = await player + .chooseTarget( + get.prompt("fakehuyuan"), + "弃置一名与" + + get.translation(trigger.player) + + "距离为1以内的另一名角色区域里的一张牌", + (card, player, target) => { + const trigger = get.event().getTrigger(); + return ( + get.distance(trigger.player, target) <= 1 && + target != trigger.player && + target.countCards("hej") + ); + } + ) + .set("ai", (target) => { + const player = get.event("player"); + return get.effect(target, { name: "guohe" }, player, player); + }) + .set("hiddenSkill", "fakehuyuan") + .forResult(); }, - popup:false, - async content(event,trigger,player){ - const target=event.targets[0]; - player.logSkill('fakehuyuan',target); - await player.discardPlayerCard(target,'hej',true); + popup: false, + async content(event, trigger, player) { + const target = event.targets[0]; + player.logSkill("fakehuyuan", target); + await player.discardPlayerCard(target, "hej", true); }, }, }, }, - fakekeshou:{ - audio:'keshou', - trigger:{player:'damageBegin3'}, - filter(event,player){ - return event.num>0; + fakekeshou: { + audio: "keshou", + trigger: { player: "damageBegin3" }, + filter(event, player) { + return event.num > 0; }, - preHidden:true, - async cost(event,trigger,player){ - event.result=await player.chooseToDiscard(get.prompt('fakekeshou'),'弃置两张颜色相同的牌,令即将受到的伤害-1','he',2,card=>{ - return !ui.selected.cards.length||get.color(card)==get.color(ui.selected.cards[0]); - }).set('logSkill','fakekeshou').set('complexCard',true).setHiddenSkill('fakekeshou').set('ai',card=>{ - if(!_status.event.check) return 0; - var player=_status.event.player; - if(player.hp==1){ - if(!player.countCards('h',function(card){return get.tag(card,'save')})&&!player.hasSkillTag('save',true)) return 10-get.value(card); - return 7-get.value(card); - } - return 6-get.value(card); - }).set('check',(player.countCards('h',{color:'red'})>1||player.countCards('h',{color:'black'})>1)).forResult(); + preHidden: true, + async cost(event, trigger, player) { + event.result = await player + .chooseToDiscard( + get.prompt("fakekeshou"), + "弃置两张颜色相同的牌,令即将受到的伤害-1", + "he", + 2, + (card) => { + return ( + !ui.selected.cards.length || + get.color(card) == get.color(ui.selected.cards[0]) + ); + } + ) + .set("logSkill", "fakekeshou") + .set("complexCard", true) + .setHiddenSkill("fakekeshou") + .set("ai", (card) => { + if (!_status.event.check) return 0; + var player = _status.event.player; + if (player.hp == 1) { + if ( + !player.countCards("h", function (card) { + return get.tag(card, "save"); + }) && + !player.hasSkillTag("save", true) + ) + return 10 - get.value(card); + return 7 - get.value(card); + } + return 6 - get.value(card); + }) + .set( + "check", + player.countCards("h", { color: "red" }) > 1 || + player.countCards("h", { color: "black" }) > 1 + ) + .forResult(); }, - popup:false, - async content(event,trigger,player){ + popup: false, + async content(event, trigger, player) { trigger.num--; }, - group:'fakekeshou_draw', - subSkill:{ - draw:{ - audio:'keshou', - trigger:{ - player:'loseAfter', - global:'loseAsyncAfter', + group: "fakekeshou_draw", + subSkill: { + draw: { + audio: "keshou", + trigger: { + player: "loseAfter", + global: "loseAsyncAfter", }, - filter(event,player){ - if(event.type!='discard'||event.getlx===false) return false; - if(!(!player.isUnseen()&&!game.hasPlayer(current=>{ - return current!=player&¤t.isFriendOf(player); - }))) return false; - const evt=event.getl(player); - return evt&&evt.cards2&&evt.cards2.length>1; + filter(event, player) { + if (event.type != "discard" || event.getlx === false) return false; + if ( + !( + !player.isUnseen() && + !game.hasPlayer((current) => { + return current != player && current.isFriendOf(player); + }) + ) + ) + return false; + const evt = event.getl(player); + return evt && evt.cards2 && evt.cards2.length > 1; }, - prompt2:'进行一次判定,若为红色,则你摸一张牌', - async content(event,trigger,player){ - const result=await player.judge(card=>{ - return get.color(card)=='red'?1:0; - }).forResult(); - if(result.judge>0) await player.draw(); + prompt2: "进行一次判定,若为红色,则你摸一张牌", + async content(event, trigger, player) { + const result = await player + .judge((card) => { + return get.color(card) == "red" ? 1 : 0; + }) + .forResult(); + if (result.judge > 0) await player.draw(); }, }, }, }, //国战典藏2023补充 //吕范 - gzdiaodu:{ - audio:'diaodu', - trigger:{player:'phaseUseBegin'}, - filter:function(event,player){ - return game.hasPlayer(function(current){ - return current.isFriendOf(player)&¤t.countGainableCards(player,'e')>0; + gzdiaodu: { + audio: "diaodu", + trigger: { player: "phaseUseBegin" }, + filter: function (event, player) { + return game.hasPlayer(function (current) { + return current.isFriendOf(player) && current.countGainableCards(player, "e") > 0; }); }, - direct:true, - frequent:true, - preHidden:true, - content:function(){ - 'step 0' - player.chooseTarget(get.prompt2('gzdiaodu'),function(card,player,current){ - return current.isFriendOf(player)&¤t.countGainableCards(player,'e')>0; - }).set('ai',function(target){ - var num=0; - if(target.hasSkill('gzxiaoji')) num+=2.5; - if(target.isDamaged()&&target.getEquip('baiyin')) num+=2.5; - if(target.hasSkill('xuanlve')) num+=2; - return num; - }).setHiddenSkill('gzdiaodu'); - 'step 1' - if(result.bool){ - var target=result.targets[0] - event.target=target; - player.logSkill('gzdiaodu',target); - player.gainPlayerCard(target,'e',true); - } - else event.finish(); - 'step 2' - if(result.bool&&player.getCards('h').includes(result.cards[0])){ - event.card=result.cards[0]; - player.chooseTarget('将'+get.translation(event.card)+'交给另一名角色',function(card,player,current){ - return current!=player&¤t!=_status.event.target; - },true).set('target',target); - } - else event.finish(); - 'step 3' - if(result.bool){ - var target=result.targets[0]; - player.line(target,'green'); - player.give(card,target); + direct: true, + frequent: true, + preHidden: true, + content: function () { + "step 0"; + player + .chooseTarget(get.prompt2("gzdiaodu"), function (card, player, current) { + return current.isFriendOf(player) && current.countGainableCards(player, "e") > 0; + }) + .set("ai", function (target) { + var num = 0; + if (target.hasSkill("gzxiaoji")) num += 2.5; + if (target.isDamaged() && target.getEquip("baiyin")) num += 2.5; + if (target.hasSkill("xuanlve")) num += 2; + return num; + }) + .setHiddenSkill("gzdiaodu"); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + event.target = target; + player.logSkill("gzdiaodu", target); + player.gainPlayerCard(target, "e", true); + } else event.finish(); + "step 2"; + if (result.bool && player.getCards("h").includes(result.cards[0])) { + event.card = result.cards[0]; + player + .chooseTarget( + "将" + get.translation(event.card) + "交给另一名角色", + function (card, player, current) { + return current != player && current != _status.event.target; + }, + true + ) + .set("target", target); + } else event.finish(); + "step 3"; + if (result.bool) { + var target = result.targets[0]; + player.line(target, "green"); + player.give(card, target); } }, - group:'gzdiaodu_use', - subSkill:{ - use:{ - trigger:{global:'useCard'}, - filter:function(event,player){ - return get.type(event.card)=='equip'&&event.player.isIn()&&event.player.isFriendOf(player)&&(player==event.player||player.hasSkill('gzdiaodu')); + group: "gzdiaodu_use", + subSkill: { + use: { + trigger: { global: "useCard" }, + filter: function (event, player) { + return ( + get.type(event.card) == "equip" && + event.player.isIn() && + event.player.isFriendOf(player) && + (player == event.player || player.hasSkill("gzdiaodu")) + ); }, - direct:true, - content:function(){ - 'step 0' - var next=trigger.player.chooseBool(get.prompt('gzdiaodu'),'摸一张牌'); - if(player.hasSkill('gzdiaodu')) next.set('frequentSkill','gzdiaodu'); - if(player==trigger.player) next.setHiddenSkill('gzdiaodu'); - 'step 1' - if(result.bool){ - player.logSkill('gzdiaodu',trigger.player); - trigger.player.draw('nodelay'); + direct: true, + content: function () { + "step 0"; + var next = trigger.player.chooseBool(get.prompt("gzdiaodu"), "摸一张牌"); + if (player.hasSkill("gzdiaodu")) next.set("frequentSkill", "gzdiaodu"); + if (player == trigger.player) next.setHiddenSkill("gzdiaodu"); + "step 1"; + if (result.bool) { + player.logSkill("gzdiaodu", trigger.player); + trigger.player.draw("nodelay"); } }, }, }, }, //徐庶 - gzqiance:{ - trigger:{global:'useCardToPlayered'}, - filter:function(event,player){ - if(!event.isFirstTarget||get.type/*2*/(event.card)!='trick') return false;//延时锦囊不能响应有个锤用 - return event.player.isFriendOf(player)&&event.targets.some(target=>target.isMajor()); + gzqiance: { + trigger: { global: "useCardToPlayered" }, + filter: function (event, player) { + if (!event.isFirstTarget || get.type(/*2*/ event.card) != "trick") return false; //延时锦囊不能响应有个锤用 + return ( + event.player.isFriendOf(player) && event.targets.some((target) => target.isMajor()) + ); }, - check:function(event,player){ - var num=0,targets=event.targets.filter(target=>target.isMajor()); - for(var target of targets) num+=get.sgn(get.attitude(player,target)*get.effect(target,event.card,event.player,player)); - return num>=0; + check: function (event, player) { + var num = 0, + targets = event.targets.filter((target) => target.isMajor()); + for (var target of targets) + num += get.sgn( + get.attitude(player, target) * + get.effect(target, event.card, event.player, player) + ); + return num >= 0; }, - logTarget:'player', - content:function(){ - trigger.getParent().directHit.addArray(trigger.targets.filter(target=>target.isMajor())); + logTarget: "player", + content: function () { + trigger + .getParent() + .directHit.addArray(trigger.targets.filter((target) => target.isMajor())); }, }, - gzjujian:{ - init:function(player){ - if(player.checkViceSkill('gzjujian')&&!player.viceChanged) player.removeMaxHp(); + gzjujian: { + init: function (player) { + if (player.checkViceSkill("gzjujian") && !player.viceChanged) player.removeMaxHp(); }, - viceSkill:true, - audio:'gzjiancai', - trigger:{global:'dying'}, - filter:function(event,player){ + viceSkill: true, + audio: "gzjiancai", + trigger: { global: "dying" }, + filter: function (event, player) { return event.player.isFriendOf(player); }, - forced:true, - logTarget:'player', - content:function(){ - trigger.player.recover(1-trigger.player.hp); + forced: true, + logTarget: "player", + content: function () { + trigger.player.recover(1 - trigger.player.hp); player.changeVice(); }, }, //彭羕 - gztongling:{ - audio:'daming', - trigger:{source:'damageSource'}, - filter:function(event,player){ - if(event.player.isFriendOf(player)) return false; - return player.isPhaseUsing()&&event.player.isIn()&&!player.hasSkill('gztongling_used'); + gztongling: { + audio: "daming", + trigger: { source: "damageSource" }, + filter: function (event, player) { + if (event.player.isFriendOf(player)) return false; + return ( + player.isPhaseUsing() && event.player.isIn() && !player.hasSkill("gztongling_used") + ); }, - direct:true, - content:function(){ - 'step 0' - var str=''; - if(get.itemtype(trigger.cards)=='cards'&&trigger.cards.filterInD().length) str+=';未造成伤害,其获得'+get.translation(trigger.cards.filterInD()); - player.chooseTarget(get.prompt('gztongling'),'令一名势力与你相同的角色选择是否对其使用一张牌。若使用且此牌:造成伤害,你与其各摸两张牌'+str,function(card,player,target){ - return target.isFriendOf(player); - }).set('ai',function(target){ - var aim=_status.event.aim; - var cards=target.getCards('hs',function(card){ - return target.canUse(card,aim,false)&&get.effect(aim,card,target,player)>0&&get.effect(aim,card,target,target)>0; - }) - if(cards.length) return cards.some(card=>get.tag(card,'damage'))?2:1; - return 0; - }).set('aim',trigger.player); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - event.target=target; - player.logSkill('gztongling',target); - player.addTempSkill('gztongling_used','phaseUseAfter'); - player.line2([target,trigger.player]); - target.chooseToUse(function(card,player,event){ - return lib.filter.filterCard.apply(this,arguments); - },'通令:是否对'+get.translation(trigger.player)+'使用一张牌?').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){ - if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false; - return lib.filter.targetEnabled.apply(this,arguments); - }).set('sourcex',trigger.player).set('addCount',false); - } - else event.finish(); - 'step 2' - if(result.bool){ - if(target.hasHistory('sourceDamage',evt=>evt.getParent(4).name=='gztongling')){ - player.draw(2,'nodelay'); - target.draw(2); - } - else{ - if(get.itemtype(trigger.cards)=='cards'&&trigger.cards.filterInD().length&&trigger.player.isIn()) trigger.player.gain(trigger.cards.filterInD(),'gain2'); - } - } - }, - subSkill:{used:{charlotte:true}}, - }, - gzjinyu:{ - audio:'xiaoni', - trigger:{player:'showCharacterAfter'}, - filter:function(event,player){ - if(!game.hasPlayer(function(current){ - return get.distance(player,current)<=1; - })) return false; - return event.toShow.some(name=>lib.character[name][3].includes('gzjinyu')); - }, - logTarget:function(event,player){ - return game.filterPlayer(function(current){ - return get.distance(player,current)<=1; - }).sortBySeat(player); - }, - forced:true, - locked:false, - content:function(){ - 'step 0' - event.targets=game.filterPlayer(function(current){ - return get.distance(player,current)<=1; - }).sortBySeat(player); - 'step 1' - var target=event.targets.shift(); - event.target=target; - if(!target.isUnseen(2)){ - if(get.is.jun(target)) event._result={control:'副将'}; - else{ - target.chooseControl('主将','副将').set('prompt','近谀:请暗置一张武将牌').set('ai',function(){ - var target=_status.event.player; - if(target.name=='gz_pengyang') return '主将'; - if(target.name2=='gz_pengyang') return '副将'; - if(lib.character[target.name][3].some(skill=>{ - var info=get.info(skill); - return info&&info.ai&&info.ai.maixie; - })) return '主将'; - if(target.name=='gz_zhoutai') return '副将'; - if(target.name2=='gz_zhoutai') return '主将'; - return '副将'; + direct: true, + content: function () { + "step 0"; + var str = ""; + if (get.itemtype(trigger.cards) == "cards" && trigger.cards.filterInD().length) + str += ";未造成伤害,其获得" + get.translation(trigger.cards.filterInD()); + player + .chooseTarget( + get.prompt("gztongling"), + "令一名势力与你相同的角色选择是否对其使用一张牌。若使用且此牌:造成伤害,你与其各摸两张牌" + + str, + function (card, player, target) { + return target.isFriendOf(player); + } + ) + .set("ai", function (target) { + var aim = _status.event.aim; + var cards = target.getCards("hs", function (card) { + return ( + target.canUse(card, aim, false) && + get.effect(aim, card, target, player) > 0 && + get.effect(aim, card, target, target) > 0 + ); }); + if (cards.length) return cards.some((card) => get.tag(card, "damage")) ? 2 : 1; + return 0; + }) + .set("aim", trigger.player); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + event.target = target; + player.logSkill("gztongling", target); + player.addTempSkill("gztongling_used", "phaseUseAfter"); + player.line2([target, trigger.player]); + target + .chooseToUse(function (card, player, event) { + return lib.filter.filterCard.apply(this, arguments); + }, "通令:是否对" + get.translation(trigger.player) + "使用一张牌?") + .set("targetRequired", true) + .set("complexSelect", true) + .set("filterTarget", function (card, player, target) { + if ( + target != _status.event.sourcex && + !ui.selected.targets.includes(_status.event.sourcex) + ) + return false; + return lib.filter.targetEnabled.apply(this, arguments); + }) + .set("sourcex", trigger.player) + .set("addCount", false); + } else event.finish(); + "step 2"; + if (result.bool) { + if ( + target.hasHistory("sourceDamage", (evt) => evt.getParent(4).name == "gztongling") + ) { + player.draw(2, "nodelay"); + target.draw(2); + } else { + if ( + get.itemtype(trigger.cards) == "cards" && + trigger.cards.filterInD().length && + trigger.player.isIn() + ) + trigger.player.gain(trigger.cards.filterInD(), "gain2"); } } - else{ - target.chooseToDiscard(2,'he',true); + }, + subSkill: { used: { charlotte: true } }, + }, + gzjinyu: { + audio: "xiaoni", + trigger: { player: "showCharacterAfter" }, + filter: function (event, player) { + if ( + !game.hasPlayer(function (current) { + return get.distance(player, current) <= 1; + }) + ) + return false; + return event.toShow.some((name) => lib.character[name][3].includes("gzjinyu")); + }, + logTarget: function (event, player) { + return game + .filterPlayer(function (current) { + return get.distance(player, current) <= 1; + }) + .sortBySeat(player); + }, + forced: true, + locked: false, + content: function () { + "step 0"; + event.targets = game + .filterPlayer(function (current) { + return get.distance(player, current) <= 1; + }) + .sortBySeat(player); + "step 1"; + var target = event.targets.shift(); + event.target = target; + if (!target.isUnseen(2)) { + if (get.is.jun(target)) event._result = { control: "副将" }; + else { + target + .chooseControl("主将", "副将") + .set("prompt", "近谀:请暗置一张武将牌") + .set("ai", function () { + var target = _status.event.player; + if (target.name == "gz_pengyang") return "主将"; + if (target.name2 == "gz_pengyang") return "副将"; + if ( + lib.character[target.name][3].some((skill) => { + var info = get.info(skill); + return info && info.ai && info.ai.maixie; + }) + ) + return "主将"; + if (target.name == "gz_zhoutai") return "副将"; + if (target.name2 == "gz_zhoutai") return "主将"; + return "副将"; + }); + } + } else { + target.chooseToDiscard(2, "he", true); event.goto(3); } - 'step 2' - if(result.control) target.hideCharacter(result.control=='主将'?0:1); - 'step 3' - if(event.targets.length) event.goto(1); + "step 2"; + if (result.control) target.hideCharacter(result.control == "主将" ? 0 : 1); + "step 3"; + if (event.targets.length) event.goto(1); }, }, //公孙渊 - gzrehuaiyi:{ - audio:'gzhuaiyi', - enable:'phaseUse', - filter:function(event,player){ - return player.countCards('h')>0; + gzrehuaiyi: { + audio: "gzhuaiyi", + enable: "phaseUse", + filter: function (event, player) { + return player.countCards("h") > 0; }, - usable:1, - delay:false, - content:function(){ - 'step 0' - var map={} + usable: 1, + delay: false, + content: function () { + "step 0"; + var map = {}; player.showHandcards(); - for(var i of ['red','black','none']){ - if(player.countCards('h',{color:i})) map[i]=true; + for (var i of ["red", "black", "none"]) { + if (player.countCards("h", { color: i })) map[i] = true; } - if(Object.keys(map).length<2) event.finish(); - else event.map=map; - 'step 1' - var mapx={'red':'红色','black':'黑色','none':'无色'}; - player.chooseControl(Object.keys(event.map).map(color=>mapx[color])).set('ai',function(){ - var list=_status.event.controls; - var map={'红色':'red','黑色':'black','无色':'none'}; - return list.sort((a,b)=>player.countCards('h',{color:map[a]})-player.countCards('h',{color:map[b]}))[0]; - }).set('prompt','怀异:弃置一种颜色的所有牌'); - 'step 2' - var map={'红色':'red','黑色':'black','无色':'none'}; - var cards=player.getCards('h',{color:map[result.control]}); + if (Object.keys(map).length < 2) event.finish(); + else event.map = map; + "step 1"; + var mapx = { red: "红色", black: "黑色", none: "无色" }; + player + .chooseControl(Object.keys(event.map).map((color) => mapx[color])) + .set("ai", function () { + var list = _status.event.controls; + var map = { 红色: "red", 黑色: "black", 无色: "none" }; + return list.sort( + (a, b) => + player.countCards("h", { color: map[a] }) - + player.countCards("h", { color: map[b] }) + )[0]; + }) + .set("prompt", "怀异:弃置一种颜色的所有牌"); + "step 2"; + var map = { 红色: "red", 黑色: "black", 无色: "none" }; + var cards = player.getCards("h", { color: map[result.control] }); player.discard(cards); - event.num=cards.length; - 'step 3' - player.chooseTarget('请选择至多'+get.cnNumber(event.num)+'名有牌的其他角色,获得这些角色的各一张牌。',[1,event.num],function(card,player,target){ - return target!=player&&target.countCards('he')>0; - }).set('ai',function(target){ - return -get.attitude(_status.event.player,target)+0.5; - }); - 'step 4' - if(result.bool&&result.targets){ - player.line(result.targets,'green'); - event.targets=result.targets; + event.num = cards.length; + "step 3"; + player + .chooseTarget( + "请选择至多" + + get.cnNumber(event.num) + + "名有牌的其他角色,获得这些角色的各一张牌。", + [1, event.num], + function (card, player, target) { + return target != player && target.countCards("he") > 0; + } + ) + .set("ai", function (target) { + return -get.attitude(_status.event.player, target) + 0.5; + }); + "step 4"; + if (result.bool && result.targets) { + player.line(result.targets, "green"); + event.targets = result.targets; event.targets.sort(lib.sort.seat); - event.cards=[]; - } - else event.finish(); - 'step 5' - if(player.isIn()&&event.targets.length){ - player.gainPlayerCard(event.targets.shift(),'he',true); - } - else event.finish(); - 'step 6' - if(result.bool&&result.cards&&result.cards.length) event.cards.addArray(result.cards); - if(event.targets.length) event.goto(5); - 'step 7' - var hs=player.getCards('h'); - cards=cards.filter(function(card){ - return get.type(card)=='equip'&&hs.includes(card); + event.cards = []; + } else event.finish(); + "step 5"; + if (player.isIn() && event.targets.length) { + player.gainPlayerCard(event.targets.shift(), "he", true); + } else event.finish(); + "step 6"; + if (result.bool && result.cards && result.cards.length) + event.cards.addArray(result.cards); + if (event.targets.length) event.goto(5); + "step 7"; + var hs = player.getCards("h"); + cards = cards.filter(function (card) { + return get.type(card) == "equip" && hs.includes(card); }); - if(cards.length){ - player.$give(cards,player,false); - game.log(player,'将',cards,'置于了武将牌上'); - player.loseToSpecial(cards,'gzrehuaiyi').visible=true; - } - else event.finish(); - 'step 8' - player.addSkill('gzrehuaiyi_unmark'); - player.markSkill('gzrehuaiyi'); + if (cards.length) { + player.$give(cards, player, false); + game.log(player, "将", cards, "置于了武将牌上"); + player.loseToSpecial(cards, "gzrehuaiyi").visible = true; + } else event.finish(); + "step 8"; + player.addSkill("gzrehuaiyi_unmark"); + player.markSkill("gzrehuaiyi"); game.delayx(); }, - ai:{ - order:10, - result:{ - player:function(player,target){ - var map={}; - for(var i of ['red','black','none']){ - if(player.countCards('h',{color:i})) map[i]=true; + ai: { + order: 10, + result: { + player: function (player, target) { + var map = {}; + for (var i of ["red", "black", "none"]) { + if (player.countCards("h", { color: i })) map[i] = true; } - if(Object.keys(map).length<2) return 0; - var num=player.maxHp-player.countCards('s',function(card){ - return card.hasGaintag('gzrehuaiyi'); - }); - if(player.countCards('h',{color:'red'})<=num) return 1; - if(player.countCards('h',{color:'black'})<=num) return 1; + if (Object.keys(map).length < 2) return 0; + var num = + player.maxHp - + player.countCards("s", function (card) { + return card.hasGaintag("gzrehuaiyi"); + }); + if (player.countCards("h", { color: "red" }) <= num) return 1; + if (player.countCards("h", { color: "black" }) <= num) return 1; return 0; }, - } + }, }, - marktext:'异', - intro:{ - mark:function(dialog,storage,player){ - var cards=player.getCards('s',function(card){ - return card.hasGaintag('gzrehuaiyi'); + marktext: "异", + intro: { + mark: function (dialog, storage, player) { + var cards = player.getCards("s", function (card) { + return card.hasGaintag("gzrehuaiyi"); }); - if(!cards||!cards.length) return; + if (!cards || !cards.length) return; dialog.addAuto(cards); }, - markcount:function(storage,player){ - return player.countCards('s',function(card){ - return card.hasGaintag('gzrehuaiyi'); + markcount: function (storage, player) { + return player.countCards("s", function (card) { + return card.hasGaintag("gzrehuaiyi"); }); }, - onunmark:function(storage,player){ - var cards=player.getCards('s',function(card){ - return card.hasGaintag('gzrehuaiyi'); + onunmark: function (storage, player) { + var cards = player.getCards("s", function (card) { + return card.hasGaintag("gzrehuaiyi"); }); - if(cards.length){ + if (cards.length) { player.loseToDiscardpile(cards); } }, }, - mod:{ - aiOrder:function(player,card,num){ - if(get.itemtype(card)=='card'&&card.hasGaintag('gzrehuaiyi')) return num+(player.countCards('s',function(card){ - return card.hasGaintag('gzrehuaiyi'); - })>player.maxHp?0.5:-0.5); + mod: { + aiOrder: function (player, card, num) { + if (get.itemtype(card) == "card" && card.hasGaintag("gzrehuaiyi")) + return ( + num + + (player.countCards("s", function (card) { + return card.hasGaintag("gzrehuaiyi"); + }) > player.maxHp + ? 0.5 + : -0.5) + ); }, }, - subSkill:{ - unmark:{ - trigger:{player:'loseAfter'}, - filter:function(event,player){ - if(!event.ss||!event.ss.length) return false; - return !player.countCards('s',function(card){ - return card.hasGaintag('gzrehuaiyi'); + subSkill: { + unmark: { + trigger: { player: "loseAfter" }, + filter: function (event, player) { + if (!event.ss || !event.ss.length) return false; + return !player.countCards("s", function (card) { + return card.hasGaintag("gzrehuaiyi"); }); }, - charlotte:true, - forced:true, - silent:true, - content:function(){ - player.unmarkSkill('gzrehuaiyi'); - player.removeSkill('gzrehuaiyi_unmark'); + charlotte: true, + forced: true, + silent: true, + content: function () { + player.unmarkSkill("gzrehuaiyi"); + player.removeSkill("gzrehuaiyi_unmark"); }, }, }, }, - gzrezisui:{ - audio:'gzzisui', - trigger:{player:'phaseDrawBegin2'}, - filter:function(event,player){ - return !event.numFixed&&player.countCards('s',function(card){ - return card.hasGaintag('gzrehuaiyi'); - })>0; + gzrezisui: { + audio: "gzzisui", + trigger: { player: "phaseDrawBegin2" }, + filter: function (event, player) { + return ( + !event.numFixed && + player.countCards("s", function (card) { + return card.hasGaintag("gzrehuaiyi"); + }) > 0 + ); }, - forced:true, - content:function(){ - trigger.num+=player.countCards('s',function(card){ - return card.hasGaintag('gzrehuaiyi'); + forced: true, + content: function () { + trigger.num += player.countCards("s", function (card) { + return card.hasGaintag("gzrehuaiyi"); }); }, - group:'gzrezisui_die', - subSkill:{ - die:{ - audio:'gzzisui', - trigger:{player:'phaseJieshuBegin'}, - filter:function(event,player){ - return player.countCards('s',function(card){ - return card.hasGaintag('gzrehuaiyi'); - })>player.maxHp; + group: "gzrezisui_die", + subSkill: { + die: { + audio: "gzzisui", + trigger: { player: "phaseJieshuBegin" }, + filter: function (event, player) { + return ( + player.countCards("s", function (card) { + return card.hasGaintag("gzrehuaiyi"); + }) > player.maxHp + ); }, - forced:true, - content:function(){ + forced: true, + content: function () { player.die(); }, }, }, }, //南华老仙 - gztaidan:{ - derivation:'taipingyaoshu', - audio:'tianshu', - locked:true, - group:'gztaidan_taipingyaoshu', + gztaidan: { + derivation: "taipingyaoshu", + audio: "tianshu", + locked: true, + group: "gztaidan_taipingyaoshu", }, - gztaidan_taipingyaoshu:{ - equipSkill:true, - mod:{ - maxHandcard:function(player,num){ - if(!player.hasEmptySlot(2)) return; - if(player.hasSkill('huangjintianbingfu')){ - num+=player.getExpansions('huangjintianbingfu').length; + gztaidan_taipingyaoshu: { + equipSkill: true, + mod: { + maxHandcard: function (player, num) { + if (!player.hasEmptySlot(2)) return; + if (player.hasSkill("huangjintianbingfu")) { + num += player.getExpansions("huangjintianbingfu").length; } - return num+game.countPlayer(function(current){ - return current.isFriendOf(player); - }); - } + return ( + num + + game.countPlayer(function (current) { + return current.isFriendOf(player); + }) + ); + }, }, - audio:'tianshu', - inherit:'taipingyaoshu', - filter:function(event,player){ - if(!player.hasEmptySlot(2)) return false; - return lib.skill.taipingyaoshu.filter(event,player); + audio: "tianshu", + inherit: "taipingyaoshu", + filter: function (event, player) { + if (!player.hasEmptySlot(2)) return false; + return lib.skill.taipingyaoshu.filter(event, player); }, - noHidden:true, - ai:{ - effect:{ - target:function(card,player,target){ - if(!target.hasEmptySlot(2)) return; - if(player==target&&get.subtype(card)=='equip2'){ - if(get.equipValue(card)<=7.5) return 0; + noHidden: true, + ai: { + effect: { + target: function (card, player, target) { + if (!target.hasEmptySlot(2)) return; + if (player == target && get.subtype(card) == "equip2") { + if (get.equipValue(card) <= 7.5) return 0; } - return lib.skill.taipingyaoshu.ai.effect.target.apply(this,arguments); + return lib.skill.taipingyaoshu.ai.effect.target.apply(this, arguments); }, }, }, }, - gzrejinghe:{ - audio:'jinghe', - enable:'phaseUse', - usable:1, + gzrejinghe: { + audio: "jinghe", + enable: "phaseUse", + usable: 1, //delay:0, - content:function(){ - 'step 0' - if(!player.storage.gzrejinghe_tianshu){ - var list=lib.skill.gzrejinghe.derivation.slice(0); - list.remove('gzrejinghe_faq'); - var list2=list.slice(0,get.rand(0,list.length)); + content: function () { + "step 0"; + if (!player.storage.gzrejinghe_tianshu) { + var list = lib.skill.gzrejinghe.derivation.slice(0); + list.remove("gzrejinghe_faq"); + var list2 = list.slice(0, get.rand(0, list.length)); list.removeArray(list2); list.addArray(list2); - player.storage.gzrejinghe_tianshu=list; - } - else{ - var first=player.storage.gzrejinghe_tianshu[0]; + player.storage.gzrejinghe_tianshu = list; + } else { + var first = player.storage.gzrejinghe_tianshu[0]; player.storage.gzrejinghe_tianshu.remove(first); player.storage.gzrejinghe_tianshu.push(first); } - game.log(player,'转动了','#g“天书”'); - player.markSkill('gzrejinghe'); - var skill=player.storage.gzrejinghe_tianshu[0]; - event.skill=skill; - var cardname='gzrejinghe_'+skill; - lib.card[cardname]={ - fullimage:true, - image:'character:re_nanhualaoxian' + game.log(player, "转动了", "#g“天书”"); + player.markSkill("gzrejinghe"); + var skill = player.storage.gzrejinghe_tianshu[0]; + event.skill = skill; + var cardname = "gzrejinghe_" + skill; + lib.card[cardname] = { + fullimage: true, + image: "character:re_nanhualaoxian", }; - lib.translate[cardname]=get.translation(skill); - event.videoId=lib.status.videoId++; - game.broadcastAll(function(player,id,card){ - ui.create.dialog(get.translation(player)+'转动了“天书”',[[card],'card']).videoId=id; - },player,event.videoId,game.createCard(cardname,' ',' ')); + lib.translate[cardname] = get.translation(skill); + event.videoId = lib.status.videoId++; + game.broadcastAll( + function (player, id, card) { + ui.create.dialog(get.translation(player) + "转动了“天书”", [ + [card], + "card", + ]).videoId = id; + }, + player, + event.videoId, + game.createCard(cardname, " ", " ") + ); game.delay(3); - 'step 1' - game.broadcastAll('closeDialog',event.videoId); - var targets=game.filterPlayer(current=>!current.hasSkill(event.skill)); - if(!targets.length){event.finish();return;} - player.chooseTarget('经合:令一名角色获得技能【'+get.translation(event.skill)+'】',function(card,player,target){ - return _status.event.targets.includes(target); - },true).set('ai',function(target){ - var player=_status.event.player; - return get.attitude(player,target); - }).set('targets',targets); - 'step 2' - if(result.bool){ - var target=result.targets[0],skill=event.skill; + "step 1"; + game.broadcastAll("closeDialog", event.videoId); + var targets = game.filterPlayer((current) => !current.hasSkill(event.skill)); + if (!targets.length) { + event.finish(); + return; + } + player + .chooseTarget( + "经合:令一名角色获得技能【" + get.translation(event.skill) + "】", + function (card, player, target) { + return _status.event.targets.includes(target); + }, + true + ) + .set("ai", function (target) { + var player = _status.event.player; + return get.attitude(player, target); + }) + .set("targets", targets); + "step 2"; + if (result.bool) { + var target = result.targets[0], + skill = event.skill; player.line(target); - player.addTempSkill('gzrejinghe_clear',{player:'phaseBegin'}); - target.addAdditionalSkills('gzrejinghe_'+player.playerid,skill); + player.addTempSkill("gzrejinghe_clear", { player: "phaseBegin" }); + target.addAdditionalSkills("gzrejinghe_" + player.playerid, skill); target.popup(skill); } }, - intro:{ - name:'写满技能的天书', - markcount:()=>8, - mark:function(dialog,storage,player){ - dialog.content.style['overflow-x']='visible'; - var list=player.storage.gzrejinghe_tianshu; - var core=document.createElement('div'); - var centerX=-10,centerY=80,radius=80; - var radian=Math.PI*2/list.length; - for(var i=0;i 8, + mark: function (dialog, storage, player) { + dialog.content.style["overflow-x"] = "visible"; + var list = player.storage.gzrejinghe_tianshu; + var core = document.createElement("div"); + var centerX = -10, + centerY = 80, + radius = 80; + var radian = (Math.PI * 2) / list.length; + for (var i = 0; i < list.length; i++) { + var td = document.createElement("div"); + td.innerHTML = get.translation(list[i]).slice(0, 1); + td.style.position = "absolute"; core.appendChild(td); - td.style.left=(centerX+radius*Math.sin(radian*i))+'px'; - td.style.top=(centerY-radius*Math.cos(radian*i))+'px'; + td.style.left = centerX + radius * Math.sin(radian * i) + "px"; + td.style.top = centerY - radius * Math.cos(radian * i) + "px"; } dialog.content.appendChild(core); }, }, - ai:{ - order:10, - result:{target:1}, + ai: { + order: 10, + result: { target: 1 }, }, - derivation:['gzrejinghe_faq','leiji','nhyinbing','nhhuoqi','nhguizhu','nhxianshou','nhlundao','nhguanyue','nhyanzheng'], - subSkill:{ - clear:{ - onremove:function(player){ - game.countPlayer(function(current){ - current.removeAdditionalSkills('gzrejinghe_'+player.playerid); + derivation: [ + "gzrejinghe_faq", + "leiji", + "nhyinbing", + "nhhuoqi", + "nhguizhu", + "nhxianshou", + "nhlundao", + "nhguanyue", + "nhyanzheng", + ], + subSkill: { + clear: { + onremove: function (player) { + game.countPlayer(function (current) { + current.removeAdditionalSkills("gzrejinghe_" + player.playerid); }); }, }, }, }, //张鲁·新 - gzrebushi:{ - onremove:true, - onunmark:true, - intro:{content:'mark'}, - group:'gzrebushi_give', - audio:'gzbushi', - trigger:{player:['phaseZhunbeiBegin','phaseAfter']}, - check:function(event,player){ - return event.name=='phase'; + gzrebushi: { + onremove: true, + onunmark: true, + intro: { content: "mark" }, + group: "gzrebushi_give", + audio: "gzbushi", + trigger: { player: ["phaseZhunbeiBegin", "phaseAfter"] }, + check: function (event, player) { + return event.name == "phase"; }, - forced:true, - locked:false, - content:function(){ - 'step 0' - if(trigger.name=='phaseZhunbei'){ - var num=game.countPlayer()-player.hp-2; - if(num>0) player.chooseToDiscard(num,'he',true); - } - else{ - player.addMark('gzrebushi',player.hp); + forced: true, + locked: false, + content: function () { + "step 0"; + if (trigger.name == "phaseZhunbei") { + var num = game.countPlayer() - player.hp - 2; + if (num > 0) player.chooseToDiscard(num, "he", true); + } else { + player.addMark("gzrebushi", player.hp); event.finish(); } - 'step 1' - player.removeMark('gzrebushi',player.countMark('gzrebushi')); - if(!player.hasMark('gzrebushi')) player.unmarkSkill('gzrebushi'); + "step 1"; + player.removeMark("gzrebushi", player.countMark("gzrebushi")); + if (!player.hasMark("gzrebushi")) player.unmarkSkill("gzrebushi"); }, - ai:{mingzhi_no:true}, - subSkill:{ - give:{ - trigger:{global:'phaseZhunbeiBegin'}, - filter:function(event,player){ - if(event.player==player) return false; - return player.hasMark('gzrebushi')&&player.countCards('he'); + ai: { mingzhi_no: true }, + subSkill: { + give: { + trigger: { global: "phaseZhunbeiBegin" }, + filter: function (event, player) { + if (event.player == player) return false; + return player.hasMark("gzrebushi") && player.countCards("he"); }, - direct:true, - content:function(){ - 'step 0' - player.chooseCard(get.prompt('gzrebushi'),'he','失去1个“义舍”标记,将一张牌交给'+get.translation(trigger.player)+'并摸两张牌').set('ai',function(card){ - var player=_status.event.player; - var trigger=_status.event.getTrigger(); - var target=trigger.player; - var num=0,current=target; - while(current!=player){ - if(current.isFriendOf(player)&&!current.isTurnedOver()) num++; - current=current.next; - } - if(num>=player.countMark('gzrebushi')&&!target.isFriendOf(player)) return -1; - return 6-get.value(card); - }); - 'step 1' - if(result.bool){ - player.logSkill('gzrebushi',trigger.player); - player.removeMark('gzrebushi',1); - if(!player.hasMark('gzrebushi')) player.unmarkSkill('gzrebushi'); - trigger.player.gain(result.cards,player,'giveAuto'); + direct: true, + content: function () { + "step 0"; + player + .chooseCard( + get.prompt("gzrebushi"), + "he", + "失去1个“义舍”标记,将一张牌交给" + + get.translation(trigger.player) + + "并摸两张牌" + ) + .set("ai", function (card) { + var player = _status.event.player; + var trigger = _status.event.getTrigger(); + var target = trigger.player; + var num = 0, + current = target; + while (current != player) { + if (current.isFriendOf(player) && !current.isTurnedOver()) num++; + current = current.next; + } + if (num >= player.countMark("gzrebushi") && !target.isFriendOf(player)) + return -1; + return 6 - get.value(card); + }); + "step 1"; + if (result.bool) { + player.logSkill("gzrebushi", trigger.player); + player.removeMark("gzrebushi", 1); + if (!player.hasMark("gzrebushi")) player.unmarkSkill("gzrebushi"); + trigger.player.gain(result.cards, player, "giveAuto"); player.draw(2); } }, }, }, }, - gzremidao:{ - group:'gzremidao_change', - audio:'gzmidao', - trigger:{player:'phaseJieshuBegin'}, - filter:function(event,player){ - return !player.getExpansions('gzremidao').length; + gzremidao: { + group: "gzremidao_change", + audio: "gzmidao", + trigger: { player: "phaseJieshuBegin" }, + filter: function (event, player) { + return !player.getExpansions("gzremidao").length; }, - content:function(){ - 'step 0' + content: function () { + "step 0"; player.draw(2); - 'step 1' - var cards=player.getCards('he'); - if(!cards.length) event.finish(); - else if(cards.length<=2) event._result={bool:true,cards:cards}; - else player.chooseCard(2,'he',true,'选择两张牌作为“米”'); - 'step 2' - if(result.bool) player.addToExpansion(result.cards,player,'give').gaintag.add('gzremidao'); + "step 1"; + var cards = player.getCards("he"); + if (!cards.length) event.finish(); + else if (cards.length <= 2) event._result = { bool: true, cards: cards }; + else player.chooseCard(2, "he", true, "选择两张牌作为“米”"); + "step 2"; + if (result.bool) + player.addToExpansion(result.cards, player, "give").gaintag.add("gzremidao"); }, - marktext:'米', - intro:{ - content:'expansion', - markcount:'expansion', + marktext: "米", + intro: { + content: "expansion", + markcount: "expansion", }, - onremove:function(player,skill){ - var cards=player.getExpansions(skill); - if(cards.length) player.loseToDiscardpile(cards); + onremove: function (player, skill) { + var cards = player.getExpansions(skill); + if (cards.length) player.loseToDiscardpile(cards); }, - subSkill:{ - change:{ - trigger:{global:'judge'}, - filter:function(event,player){ - return player.getExpansions('gzremidao').length&&event.player.isAlive(); + subSkill: { + change: { + trigger: { global: "judge" }, + filter: function (event, player) { + return player.getExpansions("gzremidao").length && event.player.isAlive(); }, - direct:true, - content:function(){ - 'step 0' - var list=player.getExpansions('gzremidao'); - player.chooseButton([get.translation(trigger.player)+'的'+(trigger.judgestr||'')+'判定为'+get.translation(trigger.player.judging[0])+ - ','+get.prompt('gzremidao'),list,'hidden'],function(button){ - var card=button.link; - var trigger=_status.event.getTrigger(); - var player=_status.event.player; - var judging=_status.event.judging; - var result=trigger.judge(card)-trigger.judge(judging); - var attitude=get.attitude(player,trigger.player); - if(result==0) return 0.5; - return result*attitude; - }).set('judging',trigger.player.judging[0]).set('filterButton',function(button){ - var player=_status.event.player; - var card=button.link; - var mod2=game.checkMod(card,player,'unchanged','cardEnabled2',player); - if(mod2!='unchanged') return mod2; - var mod=game.checkMod(card,player,'unchanged','cardRespondable',player); - if(mod!='unchanged') return mod; - return true; - }); - 'step 1' - if(result.bool){ - event.forceDie=true; - player.respond(result.links,'gzremidao','highlight','noOrdering'); - result.cards=result.links; - var card=result.cards[0]; - event.card=card; - } - else event.finish(); - 'step 2' - if(result.bool){ - if(trigger.player.judging[0].clone){ - trigger.player.judging[0].clone.classList.remove('thrownhighlight'); - game.broadcast(function(card){ - if(card.clone) card.clone.classList.remove('thrownhighlight'); - },trigger.player.judging[0]); - game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone])); + direct: true, + content: function () { + "step 0"; + var list = player.getExpansions("gzremidao"); + player + .chooseButton( + [ + get.translation(trigger.player) + + "的" + + (trigger.judgestr || "") + + "判定为" + + get.translation(trigger.player.judging[0]) + + "," + + get.prompt("gzremidao"), + list, + "hidden", + ], + function (button) { + var card = button.link; + var trigger = _status.event.getTrigger(); + var player = _status.event.player; + var judging = _status.event.judging; + var result = trigger.judge(card) - trigger.judge(judging); + var attitude = get.attitude(player, trigger.player); + if (result == 0) return 0.5; + return result * attitude; + } + ) + .set("judging", trigger.player.judging[0]) + .set("filterButton", function (button) { + var player = _status.event.player; + var card = button.link; + var mod2 = game.checkMod( + card, + player, + "unchanged", + "cardEnabled2", + player + ); + if (mod2 != "unchanged") return mod2; + var mod = game.checkMod( + card, + player, + "unchanged", + "cardRespondable", + player + ); + if (mod != "unchanged") return mod; + return true; + }); + "step 1"; + if (result.bool) { + event.forceDie = true; + player.respond(result.links, "gzremidao", "highlight", "noOrdering"); + result.cards = result.links; + var card = result.cards[0]; + event.card = card; + } else event.finish(); + "step 2"; + if (result.bool) { + if (trigger.player.judging[0].clone) { + trigger.player.judging[0].clone.classList.remove("thrownhighlight"); + game.broadcast(function (card) { + if (card.clone) card.clone.classList.remove("thrownhighlight"); + }, trigger.player.judging[0]); + game.addVideo( + "deletenode", + player, + get.cardsInfo([trigger.player.judging[0].clone]) + ); } player.$gain2(trigger.player.judging[0]); player.gain(trigger.player.judging[0]); - trigger.player.judging[0]=result.cards[0]; + trigger.player.judging[0] = result.cards[0]; trigger.orderingCards.addArray(result.cards); - game.log(trigger.player,'的判定牌改为',card); + game.log(trigger.player, "的判定牌改为", card); game.delay(2); } }, - ai:{ - rejudge:true, - tag:{rejudge:0.6}, + ai: { + rejudge: true, + tag: { rejudge: 0.6 }, }, }, }, }, //许贡 - gzbiaozhao:{ - audio:'biaozhao', - enable:'phaseUse', - usable:1, - filter:function(event,player){ - var players=game.filterPlayer(current=>current!=player); - if(players.length<2) return false; - for(var i=0;i current != player); + if (players.length < 2) return false; + for (var i = 0; i < players.length - 1; i++) { + for (var j = i + 1; j < players.length; j++) { + if (players[i].isEnemyOf(players[j])) return true; } } return false; }, - multitarget:true, - complexTarget:true, - complexSelect:true, - selectTarget:2, - filterTarget:function(card,player,target){ - if(target==player) return false; - var targets=ui.selected.targets; - if(targets.length==0) return player.canUse('zhibi',target); + multitarget: true, + complexTarget: true, + complexSelect: true, + selectTarget: 2, + filterTarget: function (card, player, target) { + if (target == player) return false; + var targets = ui.selected.targets; + if (targets.length == 0) return player.canUse("zhibi", target); return target.isEnemyOf(targets[0]); }, - targetprompt:['被知己知彼','获得牌'], - content:function(){ - 'step 0' - player.useCard({name:'zhibi',isCard:true},targets[0]); - 'step 1' - if(player.countCards('he')>0&&targets[1].isAlive()){ - player.chooseCard('he',true,'交给'+get.translation(targets[1])+'一张牌'); - } - else event.finish(); - 'step 2' - player.give(result.cards,targets[1]); + targetprompt: ["被知己知彼", "获得牌"], + content: function () { + "step 0"; + player.useCard({ name: "zhibi", isCard: true }, targets[0]); + "step 1"; + if (player.countCards("he") > 0 && targets[1].isAlive()) { + player.chooseCard("he", true, "交给" + get.translation(targets[1]) + "一张牌"); + } else event.finish(); + "step 2"; + player.give(result.cards, targets[1]); player.draw(); }, - ai:{ - order:6, - result:{ - player:function(player,target){ - if(ui.selected.targets.length) return 0.1; - return get.effect(target,{name:'zhibi'},player,player)+0.1; + ai: { + order: 6, + result: { + player: function (player, target) { + if (ui.selected.targets.length) return 0.1; + return get.effect(target, { name: "zhibi" }, player, player) + 0.1; }, - target:function(player,target){ - if(ui.selected.targets.length) return 2; + target: function (player, target) { + if (ui.selected.targets.length) return 2; return 0; }, }, }, }, - gzyechou:{ - audio:'yechou', - trigger:{player:'die'}, - forced:true, - forceDie:true, - skillAnimation:true, - animationColor:'gray', - logTarget:'source', - filter:function(event,player){ - return event.source&&event.source.isIn()&&player.canUse('sha',event.source,false); + gzyechou: { + audio: "yechou", + trigger: { player: "die" }, + forced: true, + forceDie: true, + skillAnimation: true, + animationColor: "gray", + logTarget: "source", + filter: function (event, player) { + return event.source && event.source.isIn() && player.canUse("sha", event.source, false); }, - content:function(){ - 'step 0' - var target=trigger.source; - event.target=target; - target.addTempSkill('gzyechou_unsavable'); - player.useCard({name:'sha',isCard:true},target).set('forceDie',true).set('oncard',function(){ - _status.event.directHit.addArray(game.filterPlayer()); - }); - 'step 1' - player.addTempSkill('gzyechou_unequip'); - if(!target.isIn()||!player.canUse('sha',target,false)){ - player.removeSkill('gzyechou_unequip'); + content: function () { + "step 0"; + var target = trigger.source; + event.target = target; + target.addTempSkill("gzyechou_unsavable"); + player + .useCard({ name: "sha", isCard: true }, target) + .set("forceDie", true) + .set("oncard", function () { + _status.event.directHit.addArray(game.filterPlayer()); + }); + "step 1"; + player.addTempSkill("gzyechou_unequip"); + if (!target.isIn() || !player.canUse("sha", target, false)) { + player.removeSkill("gzyechou_unequip"); event.goto(3); + } else { + player + .useCard( + { + name: "sha", + isCard: true, + storage: { gzyechou: true }, + }, + target + ) + .set("forceDie", true); } - else{ - player.useCard({ - name:'sha', - isCard:true, - storage:{gzyechou:true} - },target).set('forceDie',true); - } - 'step 2' - player.removeSkill('gzyechou_unequip'); - if(!target.isIn()||!player.canUse('sha',target,false)){ + "step 2"; + player.removeSkill("gzyechou_unequip"); + if (!target.isIn() || !player.canUse("sha", target, false)) { event.goto(3); - } - else player.useCard({name:'sha',isCard:true},target).set('forceDie',true).set('oncard',function(){ - _status.event.baseDamage++; - }); - 'step 3' - target.removeSkill('gzyechou_unsavable'); + } else + player + .useCard({ name: "sha", isCard: true }, target) + .set("forceDie", true) + .set("oncard", function () { + _status.event.baseDamage++; + }); + "step 3"; + target.removeSkill("gzyechou_unsavable"); }, - ai:{ - threaten:0.001, + ai: { + threaten: 0.001, }, - subSkill:{ - unsavable:{ - charlotte:true, - mod:{ - targetEnabled:function(card,player,target){ - if(card.name=='tao'&&target.isDying()&&player.isFriendOf(target)&&target!=player) return false; + subSkill: { + unsavable: { + charlotte: true, + mod: { + targetEnabled: function (card, player, target) { + if ( + card.name == "tao" && + target.isDying() && + player.isFriendOf(target) && + target != player + ) + return false; }, }, }, - unequip:{ - charlotte:true, - ai:{ - unequip:true, - skillTagFilter:function(player,tag,arg){ - if(!arg||!arg.card||!arg.card.storage||!arg.card.storage.gzyechou) return false; + unequip: { + charlotte: true, + ai: { + unequip: true, + skillTagFilter: function (player, tag, arg) { + if (!arg || !arg.card || !arg.card.storage || !arg.card.storage.gzyechou) + return false; }, }, }, }, }, //陈宫 - gzyinpan:{ - enable:'phaseUse', - usable:1, - filterTarget:lib.filter.notMe, - content:function(){ - 'step 0' - event.targets=game.filterPlayer(function(current){ - return current!=target&¤t.isEnemyOf(target) - }).sortBySeat(); - 'step 1' - if(!event.target.isIn()){ + gzyinpan: { + enable: "phaseUse", + usable: 1, + filterTarget: lib.filter.notMe, + content: function () { + "step 0"; + event.targets = game + .filterPlayer(function (current) { + return current != target && current.isEnemyOf(target); + }) + .sortBySeat(); + "step 1"; + if (!event.target.isIn()) { event.finish(); return; } - var target=targets.shift(); - if(target.isIn()&&(_status.connectMode||!lib.config.skip_shan||target.hasSha())){ - target.chooseToUse(function(card,player,event){ - if(get.name(card)!='sha') return false; - return lib.filter.filterCard.apply(this,arguments); - },'是否对'+get.translation(event.target)+'使用一张【杀】?').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){ - if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false; - return lib.filter.filterTarget.apply(this,arguments); - }).set('sourcex',event.target); + var target = targets.shift(); + if (target.isIn() && (_status.connectMode || !lib.config.skip_shan || target.hasSha())) { + target + .chooseToUse(function (card, player, event) { + if (get.name(card) != "sha") return false; + return lib.filter.filterCard.apply(this, arguments); + }, "是否对" + get.translation(event.target) + "使用一张【杀】?") + .set("targetRequired", true) + .set("complexSelect", true) + .set("filterTarget", function (card, player, target) { + if ( + target != _status.event.sourcex && + !ui.selected.targets.includes(_status.event.sourcex) + ) + return false; + return lib.filter.filterTarget.apply(this, arguments); + }) + .set("sourcex", event.target); } - if(targets.length>0) event.redo(); - 'step 2' - if(target.isIn()){ - var dying=false; - var num=target.getHistory('damage',function(evt){ - if(evt.card&&evt.card.name=='sha'){ - var evtx=evt.getParent('useCard'); - if(evt.card==evtx.card&&evtx.getParent(2)==event){ - if(evt._dyinged) dying=true; + if (targets.length > 0) event.redo(); + "step 2"; + if (target.isIn()) { + var dying = false; + var num = target.getHistory("damage", function (evt) { + if (evt.card && evt.card.name == "sha") { + var evtx = evt.getParent("useCard"); + if (evt.card == evtx.card && evtx.getParent(2) == event) { + if (evt._dyinged) dying = true; return true; } } }).length; - if(num>0){ - target.addTempSkill('gzyinpan_effect',{player:'phaseAfter'}); - target.addMark('gzyinpan_effect',num,false); - if(dying) target.recover(); + if (num > 0) { + target.addTempSkill("gzyinpan_effect", { player: "phaseAfter" }); + target.addMark("gzyinpan_effect", num, false); + if (dying) target.recover(); } } }, - ai:{ - order:1, - result:{target:-1}, + ai: { + order: 1, + result: { target: -1 }, }, - subSkill:{ - effect:{ - mod:{ - cardUsable:function(card,player,num){ - if(card.name=='sha') return num+player.countMark('gzyinpan_effect'); + subSkill: { + effect: { + mod: { + cardUsable: function (card, player, num) { + if (card.name == "sha") return num + player.countMark("gzyinpan_effect"); }, }, - onremove:true, - charlotte:true, - intro:{content:'使用【杀】的次数上限+#'} + onremove: true, + charlotte: true, + intro: { content: "使用【杀】的次数上限+#" }, }, }, }, - gzxingmou:{ - trigger:{global:'gainAfter'}, - forced:true, - preHidden:true, - filter:function(event,player){ - return event.getParent().name=='draw'&&event.getParent(2).name=='die'; + gzxingmou: { + trigger: { global: "gainAfter" }, + forced: true, + preHidden: true, + filter: function (event, player) { + return event.getParent().name == "draw" && event.getParent(2).name == "die"; }, - content:function(){ + content: function () { player.draw(); }, - ai:{ - noDieAfter:true, - noDieAfter2:true, + ai: { + noDieAfter: true, + noDieAfter2: true, }, }, //朱儁 - gzgongjian:{ - audio:'gongjian', - trigger:{global:'useCardToPlayered'}, - filter:function(event,player){ - if(!event.isFirstTarget||event.card.name!='sha') return false; - var history=game.getAllGlobalHistory('useCard',function(evt){ - return evt.card.name=='sha'; + gzgongjian: { + audio: "gongjian", + trigger: { global: "useCardToPlayered" }, + filter: function (event, player) { + if (!event.isFirstTarget || event.card.name != "sha") return false; + var history = game.getAllGlobalHistory("useCard", function (evt) { + return evt.card.name == "sha"; }); - var evt=event.getParent(),index=history.indexOf(evt); - if(index<1) return false; - var evt0=history[index-1]; - for(var i of evt.targets){ - if(evt0.targets.includes(i)&&i.countCards('he')>0) return true; + var evt = event.getParent(), + index = history.indexOf(evt); + if (index < 1) return false; + var evt0 = history[index - 1]; + for (var i of evt.targets) { + if (evt0.targets.includes(i) && i.countCards("he") > 0) return true; } return false; }, - prompt2:'弃置这些角色的各两张牌', - preHidden:['gzgongjian_gain'], - subfrequent:['gain'], - logTarget:function(event,player){ - var history=game.getAllGlobalHistory('useCard',function(evt){ - return evt.card.name=='sha'; + prompt2: "弃置这些角色的各两张牌", + preHidden: ["gzgongjian_gain"], + subfrequent: ["gain"], + logTarget: function (event, player) { + var history = game.getAllGlobalHistory("useCard", function (evt) { + return evt.card.name == "sha"; }); - var evt=event.getParent(),index=history.indexOf(evt); - var evt0=history[index-1]; - return evt.targets.filter(function(target){ - return (evt0.targets.includes(target)&&target.countCards('he')>0); + var evt = event.getParent(), + index = history.indexOf(evt); + var evt0 = history[index - 1]; + return evt.targets.filter(function (target) { + return evt0.targets.includes(target) && target.countCards("he") > 0; }); }, - check:function(event,player){ - var targets=lib.skill.gzgongjian.logTarget(event,player),att=0; - for(var i of targets){ - att+=get.attitude(player,i); + check: function (event, player) { + var targets = lib.skill.gzgongjian.logTarget(event, player), + att = 0; + for (var i of targets) { + att += get.attitude(player, i); } - return att<0; + return att < 0; }, - content:function(){ - var history=game.getAllGlobalHistory('useCard',function(evt){ - return evt.card.name=='sha'; + content: function () { + var history = game.getAllGlobalHistory("useCard", function (evt) { + return evt.card.name == "sha"; }); - var evt=trigger.getParent(),index=history.indexOf(evt); - var evt0=history[index-1]; - var targets=evt.targets.filter(function(target){ - return evt0.targets.includes(target); - }).sortBySeat(); - for(var i of targets) i.chooseToDiscard(true,'he',2); + var evt = trigger.getParent(), + index = history.indexOf(evt); + var evt0 = history[index - 1]; + var targets = evt.targets + .filter(function (target) { + return evt0.targets.includes(target); + }) + .sortBySeat(); + for (var i of targets) i.chooseToDiscard(true, "he", 2); }, - group:'gzgongjian_gain', - subSkill:{ - gain:{ - audio:'gongjian', - trigger:{ - global:['loseAfter','loseAsyncAfter'], + group: "gzgongjian_gain", + subSkill: { + gain: { + audio: "gongjian", + trigger: { + global: ["loseAfter", "loseAsyncAfter"], }, - filter:function(event,player){ - if(event.name=='lose'){ - if(event.type!='discard'||event.player==player) return false; - if((event.discarder||event.getParent(event.getParent(2).name=='chooseToDiscard'?3:2).player)!=player) return false; - for(var i of event.cards2){ - if(i.name=='sha') return true; + filter: function (event, player) { + if (event.name == "lose") { + if (event.type != "discard" || event.player == player) return false; + if ( + (event.discarder || + event.getParent(event.getParent(2).name == "chooseToDiscard" ? 3 : 2) + .player) != player + ) + return false; + for (var i of event.cards2) { + if (i.name == "sha") return true; } - } - else if(event.type=='discard'){ - if(!event.discarder||event.discarder!=player) return false; - var cards=event.getd(null,'cards2'); - cards.removeArray(event.getd(player,'cards2')); - for(var i of cards){ - if(i.name=='sha') return true; + } else if (event.type == "discard") { + if (!event.discarder || event.discarder != player) return false; + var cards = event.getd(null, "cards2"); + cards.removeArray(event.getd(player, "cards2")); + for (var i of cards) { + if (i.name == "sha") return true; } } return false; }, - frequent:true, - prompt2:function(event,player){ - var cards=event.getd(null,'cards2'); - cards.removeArray(event.getd(player,'cards2')); - cards=cards.filter(card=>card.name=='sha'); - return '获得'+get.translation(cards); + frequent: true, + prompt2: function (event, player) { + var cards = event.getd(null, "cards2"); + cards.removeArray(event.getd(player, "cards2")); + cards = cards.filter((card) => card.name == "sha"); + return "获得" + get.translation(cards); }, - content:function(){ - var cards=trigger.getd(null,'cards2'); - cards.removeArray(trigger.getd(player,'cards2')); - cards=cards.filter(card=>card.name=='sha'); - if(cards.length) player.gain(cards,'gain2'); + content: function () { + var cards = trigger.getd(null, "cards2"); + cards.removeArray(trigger.getd(player, "cards2")); + cards = cards.filter((card) => card.name == "sha"); + if (cards.length) player.gain(cards, "gain2"); }, }, }, }, - gzkuimang:{ - audio:'kuimang', - trigger:{source:'die'}, - forced:true, - preHidden:true, - filter:function(event,player){ - var target=event.player; - if(target.isFriendOf(player)) return false; - var prev=target.getPrevious(),next=target.getNext(); - return (prev&&prev.isFriendOf(target))||(next&&next.isFriendOf(target)); + gzkuimang: { + audio: "kuimang", + trigger: { source: "die" }, + forced: true, + preHidden: true, + filter: function (event, player) { + var target = event.player; + if (target.isFriendOf(player)) return false; + var prev = target.getPrevious(), + next = target.getNext(); + return (prev && prev.isFriendOf(target)) || (next && next.isFriendOf(target)); }, - content:function(){ + content: function () { player.draw(2); }, }, //毌丘俭 - gzzhengrong:{ - audio:'drlt_zhenrong', - trigger:{ - source:'damageBegin3', - player:['damageBegin1','chooseJunlingForBegin'], + gzzhengrong: { + audio: "drlt_zhenrong", + trigger: { + source: "damageBegin3", + player: ["damageBegin1", "chooseJunlingForBegin"], }, - forced:true, - preHidden:true, - filter:function(event,player){ - if(event.name!='damage') return true; - if(player.identity!='unknown') return !game.hasPlayer(function(current){ - return current!=player&¤t.isFriendOf(player); - }); - return !player.wontYe('wei')||!game.hasPlayer(current=>current.identity=='wei') + forced: true, + preHidden: true, + filter: function (event, player) { + if (event.name != "damage") return true; + if (player.identity != "unknown") + return !game.hasPlayer(function (current) { + return current != player && current.isFriendOf(player); + }); + return !player.wontYe("wei") || !game.hasPlayer((current) => current.identity == "wei"); }, - check:function(event,player){ - return !event.player.hasSkillTag('filterDamage',null,{ - player:event.source, - card:event.card, - })&&get.damageEffect(event.player,event.source,player,_status.event.player)>0; + check: function (event, player) { + return ( + !event.player.hasSkillTag("filterDamage", null, { + player: event.source, + card: event.card, + }) && get.damageEffect(event.player, event.source, player, _status.event.player) > 0 + ); }, - content:function(){ + content: function () { trigger.num++; }, - mod:{ - globalFrom:function(player,target,num){ - if(target.isMajor()) return num-1; + mod: { + globalFrom: function (player, target, num) { + if (target.isMajor()) return num - 1; }, }, - ai:{halfneg:true}, + ai: { halfneg: true }, }, - gzhongju:{ - audio:'drlt_hongju', - enable:'phaseUse', - limited:true, - skillAnimation:true, - animationColor:'thunder', - filterTarget:lib.filter.notMe, - content:function(){ - 'step 0' - player.awakenSkill('gzhongju'); - event.players=game.filterPlayer(function(current){ - return current!=player&¤t!=target; - }).sortBySeat(); + gzhongju: { + audio: "drlt_hongju", + enable: "phaseUse", + limited: true, + skillAnimation: true, + animationColor: "thunder", + filterTarget: lib.filter.notMe, + content: function () { + "step 0"; + player.awakenSkill("gzhongju"); + event.players = game + .filterPlayer(function (current) { + return current != player && current != target; + }) + .sortBySeat(); game.delayx(); - player.chooseJunlingFor(event.players[0]).set('prompt','请选择一项“军令”'); - 'step 1' - event.junling=result.junling; - event.targets=result.targets; - event.num=0; - player.carryOutJunling(player,event.junling,event.targets); - 'step 2' - if(num0?0:1; - }); + event.current + .chooseJunlingControl(player, event.junling, targets) + .set("prompt", "鸿举") + .set("choiceList", ["执行该军令", "不执行该军令,且被“调虎离山”化"]) + .set("ai", function () { + var evt = _status.event.getParent(2); + return get.junlingEffect( + evt.player, + evt.junling, + evt.current, + evt.targets, + evt.current + ) > 0 + ? 0 + : 1; + }); + } else event.goto(4); + "step 3"; + if (result.index == 0) { + event.current.carryOutJunling(player, event.junling, event.targets); + } else { + event.current.addTempSkill("diaohulishan"); } - else event.goto(4); - 'step 3' - if(result.index==0){ - event.current.carryOutJunling(player,event.junling,event.targets); - } - else{ - event.current.addTempSkill('diaohulishan'); - } - 'step 4' + "step 4"; game.delayx(); event.num++; - if(event.num=player.hp) return true; - return lib.skill.gzjingce.getDiscardNum()>=player.hp; + trigger: { player: "phaseEnd" }, + filter: function (event, player) { + if (player.getHistory("useCard").length >= player.hp) return true; + return lib.skill.gzjingce.getDiscardNum() >= player.hp; }, - prompt2:function(event,player){ - var num1=player.getHistory('useCard').length,num2=lib.skill.gzjingce.getDiscardNum(); - if(num1>=player.hp&&num2>=player.hp) return '执行一套额外的摸牌阶段和出牌阶段'; - return '执行一个额外的'+(num1>num2?'出牌阶段':'摸牌阶段'); + prompt2: function (event, player) { + var num1 = player.getHistory("useCard").length, + num2 = lib.skill.gzjingce.getDiscardNum(); + if (num1 >= player.hp && num2 >= player.hp) return "执行一套额外的摸牌阶段和出牌阶段"; + return "执行一个额外的" + (num1 > num2 ? "出牌阶段" : "摸牌阶段"); }, - preHidden:true, - frequent:true, - content:function(){ - var num1=player.getHistory('useCard').length,num2=lib.skill.gzjingce.getDiscardNum(); - var num3=player.hp; - if(num2>=num3){ - var next=player.phaseDraw(); + preHidden: true, + frequent: true, + content: function () { + var num1 = player.getHistory("useCard").length, + num2 = lib.skill.gzjingce.getDiscardNum(); + var num3 = player.hp; + if (num2 >= num3) { + var next = player.phaseDraw(); event.next.remove(next); trigger.after.push(next); } - if(num1>=num3){ - var next=player.phaseUse(); + if (num1 >= num3) { + var next = player.phaseUse(); event.next.remove(next); trigger.after.push(next); } }, - ai:{threaten:2.6}, + ai: { threaten: 2.6 }, }, //黄权 - gzdianhu:{ - audio:'xinfu_dianhu', - trigger:{player:'showCharacterAfter'}, - forced:true, - filter:function(event,player){ - return event.toShow.includes('gz_xf_huangquan')&&!player.storage.gzdianhu_effect; + gzdianhu: { + audio: "xinfu_dianhu", + trigger: { player: "showCharacterAfter" }, + forced: true, + filter: function (event, player) { + return event.toShow.includes("gz_xf_huangquan") && !player.storage.gzdianhu_effect; }, - content:function(){ - 'step 0' - player.chooseTarget('请选择【点虎】的目标',true,'给一名角色标上“虎”标记。当你或你的队友对该角色造成伤害后摸一张牌。',lib.filter.notMe).set('ai',function(target){ - var player=_status.event.player; - var distance=game.countPlayer(function(current){ - if(current.isFriendOf(player)) return Math.pow(get.distance(current,target),1.2); + content: function () { + "step 0"; + player + .chooseTarget( + "请选择【点虎】的目标", + true, + "给一名角色标上“虎”标记。当你或你的队友对该角色造成伤害后摸一张牌。", + lib.filter.notMe + ) + .set("ai", function (target) { + var player = _status.event.player; + var distance = game.countPlayer(function (current) { + if (current.isFriendOf(player)) + return Math.pow(get.distance(current, target), 1.2); + }); + return 10 / distance; }); - return 10/distance; - }); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.logSkill('gzdianhu',target); - target.markSkill('gzdianhu_mark'); - player.addSkill('gzdianhu_effect'); - player.markAuto('gzdianhu_effect',[target]); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.logSkill("gzdianhu", target); + target.markSkill("gzdianhu_mark"); + player.addSkill("gzdianhu_effect"); + player.markAuto("gzdianhu_effect", [target]); } }, - subSkill:{ - mark:{ - mark:true, - marktext:'虎', - intro:{content:'已成为“点虎”目标'}, + subSkill: { + mark: { + mark: true, + marktext: "虎", + intro: { content: "已成为“点虎”目标" }, }, - effect:{ - trigger:{global:'damageEnd'}, - forced:true, - charlotte:true, - filter:function(event,player){ - if(!player.getStorage('gzdianhu_effect').includes(event.player)) return false; - var source=event.source; - return source&&source.isAlive()&&source.isFriendOf(player); + effect: { + trigger: { global: "damageEnd" }, + forced: true, + charlotte: true, + filter: function (event, player) { + if (!player.getStorage("gzdianhu_effect").includes(event.player)) return false; + var source = event.source; + return source && source.isAlive() && source.isFriendOf(player); }, - logTarget:'source', - content:function(){ + logTarget: "source", + content: function () { trigger.source.draw(); }, }, }, }, - gzjianji:{ - audio:'xinfu_jianji', - inherit:'xinfu_jianji', - filterTarget:true, - content:function(){ - 'step 0' - target.draw('visible'); - 'step 1' - var card=result[0]; - if(card&&game.hasPlayer(function(current){ - return target.canUse(card,current); - })&&get.owner(card)==target){ + gzjianji: { + audio: "xinfu_jianji", + inherit: "xinfu_jianji", + filterTarget: true, + content: function () { + "step 0"; + target.draw("visible"); + "step 1"; + var card = result[0]; + if ( + card && + game.hasPlayer(function (current) { + return target.canUse(card, current); + }) && + get.owner(card) == target + ) { target.chooseToUse({ - prompt:'是否使用'+get.translation(card)+'?', - filterCard:function(cardx,player,target){ - return cardx==_status.event.cardx; + prompt: "是否使用" + get.translation(card) + "?", + filterCard: function (cardx, player, target) { + return cardx == _status.event.cardx; }, - cardx:card, + cardx: card, }); } }, - ai:{ - order:10, - result:{target:1}, + ai: { + order: 10, + result: { target: 1 }, }, }, //杨婉 - gzyouyan:{ - audio:'youyan', - trigger:{ - player:'loseAfter', - global:'loseAsyncAfter', + gzyouyan: { + audio: "youyan", + trigger: { + player: "loseAfter", + global: "loseAsyncAfter", }, - filter:function(event,player){ - if(event.type!='discard'||event.getlx===false||player!=_status.currentPhase) return false; - var evt=event.getl(player); - if(!evt||!evt.cards2||!evt.cards2.length) return false; - var list=[]; - for(var i of evt.cards2){ - list.add(get.suit(i,player)); - if(list.length>=lib.suit.length) return false; + filter: function (event, player) { + if (event.type != "discard" || event.getlx === false || player != _status.currentPhase) + return false; + var evt = event.getl(player); + if (!evt || !evt.cards2 || !evt.cards2.length) return false; + var list = []; + for (var i of evt.cards2) { + list.add(get.suit(i, player)); + if (list.length >= lib.suit.length) return false; } return true; }, - usable:1, - preHidden:true, - content:function(){ - var cards=get.cards(4); + usable: 1, + preHidden: true, + content: function () { + var cards = get.cards(4); game.cardsGotoOrdering(cards); - player.showCards(cards,get.translation(player)+'发动了【诱言】'); - var evt=trigger.getl(player); - var list=[]; - for(var i of evt.cards2){ - list.add(get.suit(i,player)); + player.showCards(cards, get.translation(player) + "发动了【诱言】"); + var evt = trigger.getl(player); + var list = []; + for (var i of evt.cards2) { + list.add(get.suit(i, player)); } - cards=cards.filter(card=>!list.includes(get.suit(card,false))); - if(cards.length) player.gain(cards,'gain2'); + cards = cards.filter((card) => !list.includes(get.suit(card, false))); + if (cards.length) player.gain(cards, "gain2"); }, - ai:{ - effect:{ - player_use:function(card,player,target){ - if(typeof card=='object'&&player==_status.currentPhase&& - (!player.storage.counttrigger||!player.storage.counttrigger.gzyouyan)&& - player.needsToDiscard()==1&&card.cards&&card.cards.filter(function(i){ - return get.position(i)=='h'; - }).length>0&&!get.tag(card,'draw')&&!get.tag(card,'gain')&&!get.tag(card,'discard')) return 'zeroplayertarget'; + ai: { + effect: { + player_use: function (card, player, target) { + if ( + typeof card == "object" && + player == _status.currentPhase && + (!player.storage.counttrigger || !player.storage.counttrigger.gzyouyan) && + player.needsToDiscard() == 1 && + card.cards && + card.cards.filter(function (i) { + return get.position(i) == "h"; + }).length > 0 && + !get.tag(card, "draw") && + !get.tag(card, "gain") && + !get.tag(card, "discard") + ) + return "zeroplayertarget"; }, }, }, }, - gzzhuihuan:{ - audio:'zhuihuan', - trigger:{player:'phaseJieshuBegin'}, - direct:true, - preHidden:true, - content:function(){ - 'step 0' - player.chooseTarget([1,2],'选择至多两名角色获得“追还”效果').setHiddenSkill('gzzhuihuan').set('ai',function(target){ - return get.attitude(_status.event.player,target); - }); - 'step 1' - if(result.bool){ - var targets=result.targets.sortBySeat(); - player.logSkill('gzzhuihuan',targets); - event.targets=targets; - } - else event.finish(); - 'step 2' - var next=player.chooseTarget('选择一名角色获得反伤效果','被选择的目标角色下次受到伤害后,其对伤害来源造成1点伤害;未被选择的目标角色下次受到伤害后,伤害来源弃置两张牌。',function(card,player,target){ - return _status.event.getParent().targets.includes(target); - }).set('ai',function(target){ - return get.attitude(_status.event.player,target); - }); - if(targets.length>1) next.set('forced',true); - 'step 3' - for(var target of targets){ - player.addTempSkill('gzzhuihuan_timeout',{player:'phaseZhunbeiBegin'}); - var id='gzzhuihuan_'+player.playerid; - if(result.targets.includes(target)){ - player.line(target,'fire'); - target.addAdditionalSkill(id,'gzzhuihuan_damage'); - } - else{ - player.line(target,'thunder'); - target.addAdditionalSkill(id,'gzzhuihuan_discard'); + gzzhuihuan: { + audio: "zhuihuan", + trigger: { player: "phaseJieshuBegin" }, + direct: true, + preHidden: true, + content: function () { + "step 0"; + player + .chooseTarget([1, 2], "选择至多两名角色获得“追还”效果") + .setHiddenSkill("gzzhuihuan") + .set("ai", function (target) { + return get.attitude(_status.event.player, target); + }); + "step 1"; + if (result.bool) { + var targets = result.targets.sortBySeat(); + player.logSkill("gzzhuihuan", targets); + event.targets = targets; + } else event.finish(); + "step 2"; + var next = player + .chooseTarget( + "选择一名角色获得反伤效果", + "被选择的目标角色下次受到伤害后,其对伤害来源造成1点伤害;未被选择的目标角色下次受到伤害后,伤害来源弃置两张牌。", + function (card, player, target) { + return _status.event.getParent().targets.includes(target); + } + ) + .set("ai", function (target) { + return get.attitude(_status.event.player, target); + }); + if (targets.length > 1) next.set("forced", true); + "step 3"; + for (var target of targets) { + player.addTempSkill("gzzhuihuan_timeout", { player: "phaseZhunbeiBegin" }); + var id = "gzzhuihuan_" + player.playerid; + if (result.targets.includes(target)) { + player.line(target, "fire"); + target.addAdditionalSkill(id, "gzzhuihuan_damage"); + } else { + player.line(target, "thunder"); + target.addAdditionalSkill(id, "gzzhuihuan_discard"); } } }, - subSkill:{ - timeout:{ - charlotte:true, - onremove:function(player){ - var id='gzzhuihuan_'+player.playerid; - game.countPlayer((current)=>current.removeAdditionalSkill(id)); + subSkill: { + timeout: { + charlotte: true, + onremove: function (player) { + var id = "gzzhuihuan_" + player.playerid; + game.countPlayer((current) => current.removeAdditionalSkill(id)); }, }, - damage:{ - charlotte:true, - trigger:{player:'damageEnd'}, - forced:true, - forceDie:true, - filter:function(event,player){ - return event.source&&event.source.isAlive(); + damage: { + charlotte: true, + trigger: { player: "damageEnd" }, + forced: true, + forceDie: true, + filter: function (event, player) { + return event.source && event.source.isAlive(); }, - logTarget:'source', - content:function(){ - player.removeSkill('gzzhuihuan_damage'); + logTarget: "source", + content: function () { + player.removeSkill("gzzhuihuan_damage"); trigger.source.damage(); }, - mark:true, - marktext:'追', - intro:{ - content:'当你下次受到伤害后,你对伤害来源造成1点伤害。', + mark: true, + marktext: "追", + intro: { + content: "当你下次受到伤害后,你对伤害来源造成1点伤害。", }, - ai:{ - threaten:0.5, + ai: { + threaten: 0.5, }, }, - discard:{ - charlotte:true, - trigger:{player:'damageEnd'}, - forced:true, - forceDie:true, - filter:function(event,player){ - return event.source&&event.source.isAlive(); + discard: { + charlotte: true, + trigger: { player: "damageEnd" }, + forced: true, + forceDie: true, + filter: function (event, player) { + return event.source && event.source.isAlive(); }, - logTarget:'source', - content:function(){ - player.removeSkill('gzzhuihuan_discard'); - trigger.source.chooseToDiscard(2,'he',true); + logTarget: "source", + content: function () { + player.removeSkill("gzzhuihuan_discard"); + trigger.source.chooseToDiscard(2, "he", true); }, - mark:true, - marktext:'还', - intro:{ - content:'当你下次受到伤害后,你令伤害来源弃置两张牌。', + mark: true, + marktext: "还", + intro: { + content: "当你下次受到伤害后,你令伤害来源弃置两张牌。", }, - ai:{ - threaten:0.8, + ai: { + threaten: 0.8, }, }, }, }, //海外田豫 - gzzhenxi:{ - audio:'twzhenxi', - trigger:{player:'useCardToPlayered'}, - filter:function(event,player){ - if(event.card.name!='sha') return false; - if(event.target.countCards('he')||player.hasCard(function(card){ - 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; + gzzhenxi: { + audio: "twzhenxi", + trigger: { player: "useCardToPlayered" }, + filter: function (event, player) { + if (event.card.name != "sha") return false; + if ( + event.target.countCards("he") || + player.hasCard(function (card) { + 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; return false; }, - check:function(event,player){ - return get.attitude(player,event.target)<0; + check: function (event, player) { + return get.attitude(player, event.target) < 0; }, - direct:true, - content:function(){ - 'step 0' - var target=trigger.target; - event.target=target; - var list=[],choiceList=[ - '弃置'+get.translation(target)+'一张牌', - '将一张♦非锦囊牌当做【乐不思蜀】或♣非锦囊牌当做【兵粮寸断】对'+get.translation(target)+'使用', - '背水!若其有暗置的武将牌且你的武将牌均明置,你依次执行上述两项' - ]; - if(target.countDiscardableCards(player,'he')) list.push('选项一'); - else choiceList[0]=''+choiceList[0]+''; - if(player.countCards('he',function(card){ - return get.suit(card)=='diamond'&&get.type2(card)!='trick'&&player.canUse(get.autoViewAs({name:'lebu'},[card]),target); - })||player.countCards('he',function(card){ - return get.suit(card)=='club'&&get.type2(card)!='trick'&&player.canUse(get.autoViewAs({name:'bingliang'},[card]),target); - })) list.push('选项二'); - else choiceList[1]=''+choiceList[1]+''; - if(target.isUnseen(2)&&!player.isUnseen(2)) list.push('背水!'); - else choiceList[2]=''+choiceList[2]+''; - player.chooseControl(list,'cancel2').set('prompt',get.prompt('gzzhenxi',target)).set('choiceList',choiceList).set('ai',function(){ - var player=_status.event.player,trigger=_status.event.getTrigger(),list=_status.event.list; - if(get.attitude(player,trigger.target)>0) return 'cancel2'; - if(list.includes('背水!')) return '背水!'; - if(list.includes('选项二')) return '选项二'; - return '选项一'; - }).set('list',list).set('hiddenSkill','gzzhenxi'); - 'step 1' - if(result.control=='cancel2'){ + direct: true, + content: function () { + "step 0"; + var target = trigger.target; + event.target = target; + var list = [], + choiceList = [ + "弃置" + get.translation(target) + "一张牌", + "将一张♦非锦囊牌当做【乐不思蜀】或♣非锦囊牌当做【兵粮寸断】对" + + get.translation(target) + + "使用", + "背水!若其有暗置的武将牌且你的武将牌均明置,你依次执行上述两项", + ]; + if (target.countDiscardableCards(player, "he")) list.push("选项一"); + else choiceList[0] = '' + choiceList[0] + ""; + if ( + player.countCards("he", function (card) { + return ( + get.suit(card) == "diamond" && + get.type2(card) != "trick" && + player.canUse(get.autoViewAs({ name: "lebu" }, [card]), target) + ); + }) || + player.countCards("he", function (card) { + return ( + get.suit(card) == "club" && + get.type2(card) != "trick" && + player.canUse(get.autoViewAs({ name: "bingliang" }, [card]), target) + ); + }) + ) + list.push("选项二"); + else choiceList[1] = '' + choiceList[1] + ""; + if (target.isUnseen(2) && !player.isUnseen(2)) list.push("背水!"); + else choiceList[2] = '' + choiceList[2] + ""; + player + .chooseControl(list, "cancel2") + .set("prompt", get.prompt("gzzhenxi", target)) + .set("choiceList", choiceList) + .set("ai", function () { + var player = _status.event.player, + trigger = _status.event.getTrigger(), + list = _status.event.list; + if (get.attitude(player, trigger.target) > 0) return "cancel2"; + if (list.includes("背水!")) return "背水!"; + if (list.includes("选项二")) return "选项二"; + return "选项一"; + }) + .set("list", list) + .set("hiddenSkill", "gzzhenxi"); + "step 1"; + if (result.control == "cancel2") { event.finish(); return; } - player.logSkill('gzzhenxi',target); - event.choice=result.control; - if(event.choice!='选项二'&&target.countDiscardableCards(player,'he')) player.discardPlayerCard(target,'he',true); - 'step 2' - if(event.choice!='选项一'&&(player.hasCard(function(card){ - return get.suit(card)=='diamond'&&get.type2(card)!='trick'&&player.canUse(get.autoViewAs({name:'lebu'},[card]),target); - },'he')||player.hasCard(function(card){ - return get.suit(card)=='club'&&get.type2(card)!='trick'&&player.canUse(get.autoViewAs({name:'bingliang'},[card]),target,false); - },'he'))){ - var next=game.createEvent('gzzhenxi_use'); - next.player=player; - next.target=target; + player.logSkill("gzzhenxi", target); + event.choice = result.control; + if (event.choice != "选项二" && target.countDiscardableCards(player, "he")) + player.discardPlayerCard(target, "he", true); + "step 2"; + if ( + event.choice != "选项一" && + (player.hasCard(function (card) { + return ( + get.suit(card) == "diamond" && + get.type2(card) != "trick" && + player.canUse(get.autoViewAs({ name: "lebu" }, [card]), target) + ); + }, "he") || + player.hasCard(function (card) { + return ( + get.suit(card) == "club" && + get.type2(card) != "trick" && + player.canUse( + get.autoViewAs({ name: "bingliang" }, [card]), + target, + false + ) + ); + }, "he")) + ) { + var next = game.createEvent("gzzhenxi_use"); + next.player = player; + next.target = target; next.setContent(lib.skill.gzzhenxi.contentx); } }, - ai:{unequip_ai:true}, - contentx:function(){ - 'step 0' + ai: { unequip_ai: true }, + contentx: function () { + "step 0"; player.chooseCard({ - position:'hes', - forced:true, - prompt:'震袭', - prompt2:'将一张♦非锦囊牌当做【乐不思蜀】或♣非锦囊牌当做【兵粮寸断】对'+get.translation(target)+'使用', - filterCard:function(card,player){ - if(get.itemtype(card)!='card'||get.type2(card)=='trick'||!['diamond','club'].includes(get.suit(card))) return false; - var cardx={name:get.suit(card)=='diamond'?'lebu':'bingliang'}; - return player.canUse(get.autoViewAs(cardx,[card]),_status.event.getParent().target,false); + position: "hes", + forced: true, + prompt: "震袭", + prompt2: + "将一张♦非锦囊牌当做【乐不思蜀】或♣非锦囊牌当做【兵粮寸断】对" + + get.translation(target) + + "使用", + filterCard: function (card, player) { + if ( + get.itemtype(card) != "card" || + get.type2(card) == "trick" || + !["diamond", "club"].includes(get.suit(card)) + ) + return false; + var cardx = { name: get.suit(card) == "diamond" ? "lebu" : "bingliang" }; + return player.canUse( + get.autoViewAs(cardx, [card]), + _status.event.getParent().target, + false + ); }, }); - 'step 1' - if(result.bool) player.useCard({name:get.suit(result.cards[0],player)=='diamond'?'lebu':'bingliang'},target,result.cards); + "step 1"; + if (result.bool) + player.useCard( + { name: get.suit(result.cards[0], player) == "diamond" ? "lebu" : "bingliang" }, + target, + result.cards + ); }, }, - gzjiansu:{ - init:function(player){ - if(player.checkViceSkill('gzjiansu')&&!player.viceChanged) player.removeMaxHp(); + gzjiansu: { + init: function (player) { + if (player.checkViceSkill("gzjiansu") && !player.viceChanged) player.removeMaxHp(); }, - viceSkill:true, - audio:2, - trigger:{ - player:'gainAfter', - global:'loseAsyncAfter', + viceSkill: true, + audio: 2, + trigger: { + player: "gainAfter", + global: "loseAsyncAfter", }, - filter:function(event,player){ - if(player==_status.currentPhase) return false; + filter: function (event, player) { + if (player == _status.currentPhase) return false; return event.getg(player).length; }, - frequent:true, - group:'gzjiansu_use', - preHidden:['gzjiansu_use'], - content:function(){ - player.showCards(trigger.getg(player),get.translation(player)+'发动了【俭素】'); - player.addGaintag(trigger.getg(player),'gzjiansu_tag'); - player.markSkill('gzjiansu'); + frequent: true, + group: "gzjiansu_use", + preHidden: ["gzjiansu_use"], + content: function () { + player.showCards(trigger.getg(player), get.translation(player) + "发动了【俭素】"); + player.addGaintag(trigger.getg(player), "gzjiansu_tag"); + player.markSkill("gzjiansu"); }, - intro:{ - mark:function(dialog,content,player){ - var hs=player.getCards('h',function(card){ - return card.hasGaintag('gzjiansu_tag'); + intro: { + mark: function (dialog, content, player) { + var hs = player.getCards("h", function (card) { + return card.hasGaintag("gzjiansu_tag"); }); - if(hs.length) dialog.addSmall(hs); - else dialog.addText('无已展示手牌'); + if (hs.length) dialog.addSmall(hs); + else dialog.addText("无已展示手牌"); }, - content:function(content,player){ - var hs=player.getCards('h',function(card){ - return card.hasGaintag('gzjiansu_tag'); + content: function (content, player) { + var hs = player.getCards("h", function (card) { + return card.hasGaintag("gzjiansu_tag"); }); - if(hs.length) return get.translation(hs); - else return '无已展示手牌'; + if (hs.length) return get.translation(hs); + else return "无已展示手牌"; }, }, - subSkill:{ - use:{ - audio:'gzjiansu', - trigger:{player:'phaseUseBegin'}, - filter:function(event,player){ - var num=player.countCards('h',function(card){ - return card.hasGaintag('gzjiansu_tag'); - }); - return num>0&&game.hasPlayer(function(current){ - return current.isDamaged()&¤t.getDamagedHp()<=num; + subSkill: { + use: { + audio: "gzjiansu", + trigger: { player: "phaseUseBegin" }, + filter: function (event, player) { + var num = player.countCards("h", function (card) { + return card.hasGaintag("gzjiansu_tag"); }); + return ( + num > 0 && + game.hasPlayer(function (current) { + return current.isDamaged() && current.getDamagedHp() <= num; + }) + ); }, - direct:true, - content:function(){ - 'step 0' - player.chooseCardTarget({ - prompt:get.prompt('gzjiansu'), - prompt2:'弃置任意张“俭”,令一名体力值不大于你以此法弃置的牌数的角色回复1点体力', - filterCard:function(card){ - return get.itemtype(card)=='card'&&card.hasGaintag('gzjiansu_tag'); - }, - selectCard:[1,Infinity], - filterTarget:function(card,player,target){ - return target.isDamaged(); - }, - filterOk:function(){ - return ui.selected.targets.length&&ui.selected.targets[0].hp<=ui.selected.cards.length; - }, - ai1:function(card){ - if(ui.selected.targets.length&&ui.selected.targets[0].hp<=ui.selected.cards.length) return 0; - return 6-get.value(card); - }, - ai2:function(target){ - var player=_status.event.player; - return get.recoverEffect(target,player,player); - }, - }).setHiddenSkill('gzjiansu_use'); - 'step 1' - if(result.bool){ - var target=result.targets[0],cards=result.cards; - player.logSkill('gzjiansu_use',target); + direct: true, + content: function () { + "step 0"; + player + .chooseCardTarget({ + prompt: get.prompt("gzjiansu"), + prompt2: + "弃置任意张“俭”,令一名体力值不大于你以此法弃置的牌数的角色回复1点体力", + filterCard: function (card) { + return ( + get.itemtype(card) == "card" && card.hasGaintag("gzjiansu_tag") + ); + }, + selectCard: [1, Infinity], + filterTarget: function (card, player, target) { + return target.isDamaged(); + }, + filterOk: function () { + return ( + ui.selected.targets.length && + ui.selected.targets[0].hp <= ui.selected.cards.length + ); + }, + ai1: function (card) { + if ( + ui.selected.targets.length && + ui.selected.targets[0].hp <= ui.selected.cards.length + ) + return 0; + return 6 - get.value(card); + }, + ai2: function (target) { + var player = _status.event.player; + return get.recoverEffect(target, player, player); + }, + }) + .setHiddenSkill("gzjiansu_use"); + "step 1"; + if (result.bool) { + var target = result.targets[0], + cards = result.cards; + player.logSkill("gzjiansu_use", target); player.discard(cards); target.recover(); } }, - } + }, }, }, //海外刘夫人 - gzzhuidu:{ - audio:'twzhuidu', - trigger:{source:'damageBegin3'}, - filter:function(event,player){ + gzzhuidu: { + audio: "twzhuidu", + trigger: { source: "damageBegin3" }, + filter: function (event, player) { return player.isPhaseUsing(); }, - check:function(event,player){ - return get.attitude(player,event.player)<0; + check: function (event, player) { + return get.attitude(player, event.player) < 0; }, - usable:1, - logTarget:'player', - content:function(){ - 'step 0' - var target=trigger.player; - event.target=target; - if(target.hasSex('female')&&target.countCards('e')>0) player.chooseToDiscard('he','追妒:是否弃置一张牌并令其执行两项?').set('ai',function(card){ - return 8-get.value(card); - }); + usable: 1, + logTarget: "player", + content: function () { + "step 0"; + var target = trigger.player; + event.target = target; + if (target.hasSex("female") && target.countCards("e") > 0) + player + .chooseToDiscard("he", "追妒:是否弃置一张牌并令其执行两项?") + .set("ai", function (card) { + return 8 - get.value(card); + }); else event.goto(2); - 'step 1' - if(result.bool){ - event._result={control:'我全都要!'}; + "step 1"; + if (result.bool) { + event._result = { control: "我全都要!" }; event.goto(3); } - 'step 2' - if(target.countCards('e')>0){ - target.chooseControl().set('prompt','追妒:请选择一项').set('choiceList',[ - '令'+get.translation(player)+'此次对你造成的伤害+1', - '弃置装备区里的所有牌', - ]).set('ai',function(){ - var player=_status.event.player,cards=player.getCards('e'); - if(player.hp<=2) return 1; - if(get.value(cards)<=7) return 1; - return 0; - }); - } - else event._result={control:'选项一'}; - 'step 3' + "step 2"; + if (target.countCards("e") > 0) { + target + .chooseControl() + .set("prompt", "追妒:请选择一项") + .set("choiceList", [ + "令" + get.translation(player) + "此次对你造成的伤害+1", + "弃置装备区里的所有牌", + ]) + .set("ai", function () { + var player = _status.event.player, + cards = player.getCards("e"); + if (player.hp <= 2) return 1; + if (get.value(cards) <= 7) return 1; + return 0; + }); + } else event._result = { control: "选项一" }; + "step 3"; player.line(target); - if(result.control!='选项二') trigger.num++; - if(result.control!='选项一') target.chooseToDiscard(target.countCards('e'),true,'e'); + if (result.control != "选项二") trigger.num++; + if (result.control != "选项一") target.chooseToDiscard(target.countCards("e"), true, "e"); }, }, - gzshigong:{ - audio:'twshigong', - trigger:{player:'dying'}, - filter:function(event,player){ - return _status.currentPhase&&_status.currentPhase!=player&&_status.currentPhase.isIn()&&player.hasViceCharacter()&&player.hp<=0; + gzshigong: { + audio: "twshigong", + trigger: { player: "dying" }, + filter: function (event, player) { + return ( + _status.currentPhase && + _status.currentPhase != player && + _status.currentPhase.isIn() && + player.hasViceCharacter() && + player.hp <= 0 + ); }, - skillAnimation:true, - animationColor:'gray', - limited:true, - logTarget:()=>_status.currentPhase, - check:function(event,player){ - if(player.countCards('h',function(card){ - var mod2=game.checkMod(card,player,'unchanged','cardEnabled2',player); - if(mod2!='unchanged') return mod2; - var mod=game.checkMod(card,player,event.player,'unchanged','cardSavable',player); - if(mod!='unchanged') return mod; - var savable=get.info(card).savable; - if(typeof savable=='function') savable=savable(card,player,event.player); - return savable; - })>=1-event.player.hp) return false; + skillAnimation: true, + animationColor: "gray", + limited: true, + logTarget: () => _status.currentPhase, + check: function (event, player) { + if ( + player.countCards("h", function (card) { + var mod2 = game.checkMod(card, player, "unchanged", "cardEnabled2", player); + if (mod2 != "unchanged") return mod2; + var mod = game.checkMod( + card, + player, + event.player, + "unchanged", + "cardSavable", + player + ); + if (mod != "unchanged") return mod; + var savable = get.info(card).savable; + if (typeof savable == "function") savable = savable(card, player, event.player); + return savable; + }) >= + 1 - event.player.hp + ) + return false; return true; }, - content:function(){ - 'step 0' - var target=_status.currentPhase; - event.target=target; - player.awakenSkill('gzshigong'); - var list=lib.character[player.name2][3].filter(function(skill){ - return get.skillCategoriesOf(skill).length==0; + content: function () { + "step 0"; + var target = _status.currentPhase; + event.target = target; + player.awakenSkill("gzshigong"); + var list = lib.character[player.name2][3].filter(function (skill) { + return get.skillCategoriesOf(skill).length == 0; }); - if(!list.length){ - event._result={control:'cancel2'}; + if (!list.length) { + event._result = { control: "cancel2" }; event.goto(2); - } - else event.list=list; + } else event.list = list; player.removeCharacter(1); - 'step 1' - target.chooseControl(event.list,'cancel2').set('choiceList',event.list.map(i=>{ - return '
    【'+get.translation(lib.translate[i+'_ab']||get.translation(i).slice(0,2))+'】
    '+get.skillInfoTranslation(i,_status.currentPhase)+'
    '; - })).set('displayIndex',false).set('ai',function(){ - if(get.attitude(_status.event.player,_status.event.getParent().player)>0) return 0; - return [0,1].randomGet(); - }).set('prompt',get.translation(player)+'对你发动了【示恭】').set('prompt2','获得一个技能并令其将体力回复至体力上限;或点击“取消”,令其将体力值回复至1点。'); - 'step 2' - if(result.control=='cancel2'){ - player.recover(1-player.hp); + "step 1"; + target + .chooseControl(event.list, "cancel2") + .set( + "choiceList", + event.list.map((i) => { + return ( + '
    【' + + get.translation( + lib.translate[i + "_ab"] || get.translation(i).slice(0, 2) + ) + + "】
    " + + get.skillInfoTranslation(i, _status.currentPhase) + + "
    " + ); + }) + ) + .set("displayIndex", false) + .set("ai", function () { + if (get.attitude(_status.event.player, _status.event.getParent().player) > 0) + return 0; + return [0, 1].randomGet(); + }) + .set("prompt", get.translation(player) + "对你发动了【示恭】") + .set( + "prompt2", + "获得一个技能并令其将体力回复至体力上限;或点击“取消”,令其将体力值回复至1点。" + ); + "step 2"; + if (result.control == "cancel2") { + player.recover(1 - player.hp); event.finish(); - } - else{ + } else { target.addSkills(result.control); target.line(player); - player.recover(player.maxHp-player.hp); + player.recover(player.maxHp - player.hp); } }, }, //海外服华雄 - gzyaowu:{ - audio:'new_reyaowu', - limited:true, - trigger:{source:'damageSource'}, - filter:function(event,player){ - if(player.isUnseen(0)&&lib.character[player.name1][3].includes('gzyaowu')) return true; - if(player.isUnseen(1)&&lib.character[player.name2][3].includes('gzyaowu')) return true; + gzyaowu: { + audio: "new_reyaowu", + limited: true, + trigger: { source: "damageSource" }, + filter: function (event, player) { + if (player.isUnseen(0) && lib.character[player.name1][3].includes("gzyaowu")) return true; + if (player.isUnseen(1) && lib.character[player.name2][3].includes("gzyaowu")) return true; return false; }, - skillAnimation:true, - animationColor:'fire', - check:function(event,player){ - return player.isDamaged()||player.hp<=2; + skillAnimation: true, + animationColor: "fire", + check: function (event, player) { + return player.isDamaged() || player.hp <= 2; }, - content:function(){ - player.awakenSkill('gzyaowu'); + content: function () { + player.awakenSkill("gzyaowu"); player.gainMaxHp(2); player.recover(2); - player.addSkill('gzyaowu_die'); + player.addSkill("gzyaowu_die"); }, - ai:{mingzhi_no:true}, - subSkill:{ - die:{ - audio:'new_reyaowu', - trigger:{player:'dieAfter'}, - filter:function(event,player){ - return game.hasPlayer(function(current){ - return current!=player&¤t.isFriendOf(player); + ai: { mingzhi_no: true }, + subSkill: { + die: { + audio: "new_reyaowu", + trigger: { player: "dieAfter" }, + filter: function (event, player) { + return game.hasPlayer(function (current) { + return current != player && current.isFriendOf(player); }); }, - forced:true, - forceDie:true, - charlotte:true, - skillAnimation:true, - animationColor:'fire', - logTarget:function(event,player){ - return game.filterPlayer(function(current){ - return current!=player&¤t.isFriendOf(player); + forced: true, + forceDie: true, + charlotte: true, + skillAnimation: true, + animationColor: "fire", + logTarget: function (event, player) { + return game.filterPlayer(function (current) { + return current != player && current.isFriendOf(player); }); }, - content:function(){ - for(var target of lib.skill.gzyaowu_die.logTarget(trigger,player)) target.loseHp(); + content: function () { + for (var target of lib.skill.gzyaowu_die.logTarget(trigger, player)) + target.loseHp(); }, }, }, }, - gzshiyong:{ - audio:'shiyong', - derivation:'gzshiyongx', - trigger:{player:'damageEnd'}, - filter:function(event,player){ - if(!event.card) return false; - if(player.awakenedSkills.includes('gzyaowu')) return event.source&&event.source.isIn()&&get.color(event.card)!='black'; - return get.color(event.card)!='red'; + gzshiyong: { + audio: "shiyong", + derivation: "gzshiyongx", + trigger: { player: "damageEnd" }, + filter: function (event, player) { + if (!event.card) return false; + if (player.awakenedSkills.includes("gzyaowu")) + return event.source && event.source.isIn() && get.color(event.card) != "black"; + return get.color(event.card) != "red"; }, - forced:true, - logTarget:function(event,player){ - if(player.awakenedSkills.includes('gzyaowu')) return event.source; + forced: true, + logTarget: function (event, player) { + if (player.awakenedSkills.includes("gzyaowu")) return event.source; return; }, - content:function(){ - (lib.skill.gzshiyong.logTarget(trigger,player)||player).draw(); + content: function () { + (lib.skill.gzshiyong.logTarget(trigger, player) || player).draw(); }, }, //海外服夏侯尚 - gztanfeng:{ - audio:'twtanfeng', - trigger:{player:'phaseZhunbeiBegin'}, - filter:function(event,player){ - return game.hasPlayer(function(current){ - return !current.isFriendOf(player)&¤t.countDiscardableCards('hej',player)>0; + gztanfeng: { + audio: "twtanfeng", + trigger: { player: "phaseZhunbeiBegin" }, + filter: function (event, player) { + return game.hasPlayer(function (current) { + return ( + !current.isFriendOf(player) && current.countDiscardableCards("hej", player) > 0 + ); }); }, - direct:true, - preHidden:true, - content:function(){ - 'step 0' - player.chooseTarget(get.prompt2('gztanfeng'),function(card,player,target){ - return !target.isFriendOf(player)&&target.countDiscardableCards(player,'hej')>0; - }).set('ai',function(target){ - var player=_status.event.player; - if(target.hp+target.countCards('hs',{name:['tao','jiu']})<=2) return 3*get.effect(target,{name:'guohe'},player,player); - return get.effect(target,{name:'guohe'},player,player); - }).setHiddenSkill(event.name); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - event.target=target; - player.logSkill('gztanfeng',target); - player.discardPlayerCard(target,'hej',true); - } - else event.finish(); - 'step 2' - target.chooseBool('是否受到'+get.translation(player)+'造成的1点火焰伤害,令其跳过一个阶段?').set('ai',()=>_status.event.choice).set('choice',get.damageEffect(target,player,target)>=-5); - 'step 3' - if(result.bool){ + direct: true, + preHidden: true, + content: function () { + "step 0"; + player + .chooseTarget(get.prompt2("gztanfeng"), function (card, player, target) { + return ( + !target.isFriendOf(player) && target.countDiscardableCards(player, "hej") > 0 + ); + }) + .set("ai", function (target) { + var player = _status.event.player; + if (target.hp + target.countCards("hs", { name: ["tao", "jiu"] }) <= 2) + return 3 * get.effect(target, { name: "guohe" }, player, player); + return get.effect(target, { name: "guohe" }, player, player); + }) + .setHiddenSkill(event.name); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + event.target = target; + player.logSkill("gztanfeng", target); + player.discardPlayerCard(target, "hej", true); + } else event.finish(); + "step 2"; + target + .chooseBool( + "是否受到" + get.translation(player) + "造成的1点火焰伤害,令其跳过一个阶段?" + ) + .set("ai", () => _status.event.choice) + .set("choice", get.damageEffect(target, player, target) >= -5); + "step 3"; + if (result.bool) { player.line(target); - target.damage(1,'fire'); - } - else event.finish(); - 'step 4' - var list=[]; - var list2=[]; - event.map={phaseJudge:'判定阶段',phaseDraw:'摸牌阶段',phaseUse:'出牌阶段',phaseDiscard:'弃牌阶段'}; - for(var i of ['phaseJudge','phaseDraw','phaseUse','phaseDiscard']){ - if(!player.skipList.includes(i)){ - i=event.map[i]; + target.damage(1, "fire"); + } else event.finish(); + "step 4"; + var list = []; + var list2 = []; + event.map = { + phaseJudge: "判定阶段", + phaseDraw: "摸牌阶段", + phaseUse: "出牌阶段", + phaseDiscard: "弃牌阶段", + }; + for (var i of ["phaseJudge", "phaseDraw", "phaseUse", "phaseDiscard"]) { + if (!player.skipList.includes(i)) { + i = event.map[i]; list.push(i); - if(i!='判定阶段'&&i!='弃牌阶段') list2.push(i); + if (i != "判定阶段" && i != "弃牌阶段") list2.push(i); } } - target.chooseControl(list).set('prompt','探锋:令'+get.translation(player)+'跳过一个阶段').set('ai',function(){ - return _status.event.choice; - }).set('choice',function(){ - var att=get.attitude(target,player); - var num=player.countCards('j'); - if(att>0){ - if(list.includes('判定阶段')&&num>0) return '判定阶段'; - return '弃牌阶段'; - } - if(list.includes('摸牌阶段')&&player.hasJudge('lebu')) return '摸牌阶段'; - if(list.includes('出牌阶段')&&player.hasJudge('bingliang')||player.needsToDiscard()>0) return '出牌阶段'; - return list2.randomGet(); - }()); - 'step 5' - for(var i in event.map){ - if(event.map[i]==result.control) player.skip(i); + target + .chooseControl(list) + .set("prompt", "探锋:令" + get.translation(player) + "跳过一个阶段") + .set("ai", function () { + return _status.event.choice; + }) + .set( + "choice", + (function () { + var att = get.attitude(target, player); + var num = player.countCards("j"); + if (att > 0) { + if (list.includes("判定阶段") && num > 0) return "判定阶段"; + return "弃牌阶段"; + } + if (list.includes("摸牌阶段") && player.hasJudge("lebu")) return "摸牌阶段"; + if ( + (list.includes("出牌阶段") && player.hasJudge("bingliang")) || + player.needsToDiscard() > 0 + ) + return "出牌阶段"; + return list2.randomGet(); + })() + ); + "step 5"; + for (var i in event.map) { + if (event.map[i] == result.control) player.skip(i); } target.popup(result.control); target.line(player); - game.log(player,'跳过了','#y'+result.control); + game.log(player, "跳过了", "#y" + result.control); }, }, //杨芷 - gzwanyi:{ - audio:'wanyi', - enable:'phaseUse', - filter:function(event,player){ - if(player.getStorage('gzwanyi2').length>=4) return false; - if(_status.mode=='yingbian') return player.hasCard(function(i){ - return get.is.yingbian(i); - },'hs'); - return player.hasCard(function(card){ - return card.hasTag('lianheng'); - },'hs'); + gzwanyi: { + audio: "wanyi", + enable: "phaseUse", + filter: function (event, player) { + if (player.getStorage("gzwanyi2").length >= 4) return false; + if (_status.mode == "yingbian") + return player.hasCard(function (i) { + return get.is.yingbian(i); + }, "hs"); + return player.hasCard(function (card) { + return card.hasTag("lianheng"); + }, "hs"); }, - chooseButton:{ - dialog:function(event,player){ - var list=['lianjunshengyan','huoshaolianying','xietianzi','lulitongxin']; - if(_status.mode=='yingbian') list=['zhujinqiyuan','chuqibuyi','shuiyanqijunx','dongzhuxianji']; - list.removeArray(player.getStorage('gzwanyi2')); - return ui.create.dialog('婉嫕',[list,'vcard'],'hidden'); + chooseButton: { + dialog: function (event, player) { + var list = ["lianjunshengyan", "huoshaolianying", "xietianzi", "lulitongxin"]; + if (_status.mode == "yingbian") + list = ["zhujinqiyuan", "chuqibuyi", "shuiyanqijunx", "dongzhuxianji"]; + list.removeArray(player.getStorage("gzwanyi2")); + return ui.create.dialog("婉嫕", [list, "vcard"], "hidden"); }, - filter:function(button,player){ - return lib.filter.filterCard({name:button.link[2]},player,_status.event.getParent()); + filter: function (button, player) { + return lib.filter.filterCard( + { name: button.link[2] }, + player, + _status.event.getParent() + ); }, - check:function(button){ - return _status.event.player.getUseValue({name:button.link[2]}); + check: function (button) { + return _status.event.player.getUseValue({ name: button.link[2] }); }, - backup:function(links){ + backup: function (links) { return { - audio:'wanyi', - popname:true, - viewAs:{ - name:links[0][2], + audio: "wanyi", + popname: true, + viewAs: { + name: links[0][2], }, - filterCard:function(card){ - if(_status.mode=='yingbian') return get.is.yingbian(card); - return card.hasTag('lianheng'); + filterCard: function (card) { + if (_status.mode == "yingbian") return get.is.yingbian(card); + return card.hasTag("lianheng"); }, - check:function(card){ - return 1/Math.max(1,get.value(card)); + check: function (card) { + return 1 / Math.max(1, get.value(card)); }, - position:'hs', - onuse:function(links,player){ - if(!player.storage.gzwanyi2) player.storage.gzwanyi2=[]; + position: "hs", + onuse: function (links, player) { + if (!player.storage.gzwanyi2) player.storage.gzwanyi2 = []; player.storage.gzwanyi2.add(links.card.name); - player.addTempSkill('gzwanyi2'); + player.addTempSkill("gzwanyi2"); }, - } + }; }, - prompt:function(links){ - if(_status.mode=='yingbian') return '将一张应变牌当做'+get.translation(links[0][2])+'使用'; - return '将一张合纵牌当做'+get.translation(links[0][2])+'使用'; + prompt: function (links) { + if (_status.mode == "yingbian") + return "将一张应变牌当做" + get.translation(links[0][2]) + "使用"; + return "将一张合纵牌当做" + get.translation(links[0][2]) + "使用"; }, }, - subSkill:{backup:{}}, - ai:{order:8,result:{player:1}}, + subSkill: { backup: {} }, + ai: { order: 8, result: { player: 1 } }, }, - gzwanyi2:{onremove:true}, - gzmaihuo:{ - audio:'maihuo', - limited:true, - trigger:{global:'useCardToTarget'}, - logTarget:'player', - filter:function(event,player){ - return event.card.name=='sha'&&event.target.isIn()&&event.target.isFriendOf(player); + gzwanyi2: { onremove: true }, + gzmaihuo: { + audio: "maihuo", + limited: true, + trigger: { global: "useCardToTarget" }, + logTarget: "player", + filter: function (event, player) { + return event.card.name == "sha" && event.target.isIn() && event.target.isFriendOf(player); }, - preHidden:true, - skillAnimation:true, - animationColor:'thunder', - check:function(event,player){ - var source=event.player,targets=event.targets,card=event.card; - for(var target of targets){ - if(target.hasShan()||get.effect(target,card,source,player)>=0) continue; - if(player.hp<=1||target.hp<=(event.getParent().baseDamage||1)) return true; + preHidden: true, + skillAnimation: true, + animationColor: "thunder", + check: function (event, player) { + var source = event.player, + targets = event.targets, + card = event.card; + for (var target of targets) { + if (target.hasShan() || get.effect(target, card, source, player) >= 0) continue; + if (player.hp <= 1 || target.hp <= (event.getParent().baseDamage || 1)) return true; } return false; }, - content:function(){ - player.awakenSkill('gzmaihuo'); - trigger.targets.length=0; - trigger.getParent().triggeredTargets2.length=0; - player.addSkill('gzmaihuo_effect'); - player.markAuto('gzmaihuo_effect',[trigger.player]); - trigger.player.addMark('gzmaihuo_mark',1,false); + content: function () { + player.awakenSkill("gzmaihuo"); + trigger.targets.length = 0; + trigger.getParent().triggeredTargets2.length = 0; + player.addSkill("gzmaihuo_effect"); + player.markAuto("gzmaihuo_effect", [trigger.player]); + trigger.player.addMark("gzmaihuo_mark", 1, false); }, - subSkill:{ - effect:{ - audio:'maihuo', - trigger:{global:'phaseBegin'}, - forced:true, - charlotte:true, - popup:false, - filter:function(event,player){ - return player.getStorage('gzmaihuo_effect').includes(event.player)&&event.player.canUse('sha',player,false); + subSkill: { + effect: { + audio: "maihuo", + trigger: { global: "phaseBegin" }, + forced: true, + charlotte: true, + popup: false, + filter: function (event, player) { + return ( + player.getStorage("gzmaihuo_effect").includes(event.player) && + event.player.canUse("sha", player, false) + ); }, - content:function(){ - 'step 0' - var target=trigger.player; - player.unmarkAuto('gzmaihuo_effect',[target]); - target.removeMark('gzmaihuo_mark',1,false); - target.useCard({name:'sha',isCard:true},player,'gzmaihuo_effect',false); - 'step 1' - if(!player.getStorage('gzmaihuo_effect').length) player.removeSkill('gzmaihuo_effect'); + content: function () { + "step 0"; + var target = trigger.player; + player.unmarkAuto("gzmaihuo_effect", [target]); + target.removeMark("gzmaihuo_mark", 1, false); + target.useCard({ name: "sha", isCard: true }, player, "gzmaihuo_effect", false); + "step 1"; + if (!player.getStorage("gzmaihuo_effect").length) + player.removeSkill("gzmaihuo_effect"); }, - group:'gzmaihuo_remove', + group: "gzmaihuo_remove", }, - remove:{ - trigger:{player:'damageBegin2'}, - forced:true, - filter:function(event,player){ - return event.card&&event.card.name=='sha'&&event.getParent().skill=='gzmaihuo_effect'; + remove: { + trigger: { player: "damageBegin2" }, + forced: true, + filter: function (event, player) { + return ( + event.card && + event.card.name == "sha" && + event.getParent().skill == "gzmaihuo_effect" + ); }, - content:function(){ + content: function () { trigger.cancel(); player.draw(2); - if(player.checkMainSkill('gzmaihuo',false)){ + if (player.checkMainSkill("gzmaihuo", false)) { player.removeCharacter(0); - } - else if(player.checkViceSkill('gzmaihuo',false)){ + } else if (player.checkViceSkill("gzmaihuo", false)) { player.changeVice(); } }, }, - mark:{ - marktext:'祸', - intro:{ - content:'mark', - onunmark:true, + mark: { + marktext: "祸", + intro: { + content: "mark", + onunmark: true, }, }, }, }, //羊徽瑜 - gzcaiyuan:{ - audio:2, - trigger:{player:'phaseJieshuBegin'}, - forced:true, - preHidden:true, - filter:function(event,player){ - var num1=player.countCards('h'),num2=num1; - player.getHistory('gain',function(evt){ - num2-=evt.cards.length; + gzcaiyuan: { + audio: 2, + trigger: { player: "phaseJieshuBegin" }, + forced: true, + preHidden: true, + filter: function (event, player) { + var num1 = player.countCards("h"), + num2 = num1; + player.getHistory("gain", function (evt) { + num2 -= evt.cards.length; }); - player.getHistory('lose',function(evt){ - if(evt.hs) num2+=evt.hs.length; + player.getHistory("lose", function (evt) { + if (evt.hs) num2 += evt.hs.length; }); - return num1>=num2; + return num1 >= num2; }, - content:function(){ - player.chooseDrawRecover(2,true); + content: function () { + player.chooseDrawRecover(2, true); }, }, //左棻 - gzzhaosong:{ - audio:'zhaosong', - enable:'phaseUse', - preHidden:['gzzhaosong_dying','gzzhaosong_sha'], - filter:function(event,player){ - return !player.getStorage('gzzhaosong').includes('效果②')&&game.hasPlayer((current)=>lib.skill.gzzhaosong.filterTarget(null,player,current)); + gzzhaosong: { + audio: "zhaosong", + enable: "phaseUse", + preHidden: ["gzzhaosong_dying", "gzzhaosong_sha"], + filter: function (event, player) { + return ( + !player.getStorage("gzzhaosong").includes("效果②") && + game.hasPlayer((current) => lib.skill.gzzhaosong.filterTarget(null, player, current)) + ); }, - filterTarget:function(card,player,target){ - return target!=player&&(target.isUnseen(2)||target.countCards('h')>0); + filterTarget: function (card, player, target) { + return target != player && (target.isUnseen(2) || target.countCards("h") > 0); }, - promptfunc:()=>'出牌阶段,你可观看一名其他角色的所有暗置武将牌和手牌,然后可以获得其区域内的一张牌。', - content:function(){ - player.markAuto('gzzhaosong',['效果②']); - if(target.isUnseen(2)) player.viewCharacter(target,2); - if(target.countCards('hej')>0) player.gainPlayerCard(target,'hej','visible'); + promptfunc: () => + "出牌阶段,你可观看一名其他角色的所有暗置武将牌和手牌,然后可以获得其区域内的一张牌。", + content: function () { + player.markAuto("gzzhaosong", ["效果②"]); + if (target.isUnseen(2)) player.viewCharacter(target, 2); + if (target.countCards("hej") > 0) player.gainPlayerCard(target, "hej", "visible"); }, - ai:{ - order:11, - result:{ - player:function(player,target){ - return get.effect(target,{name:'zhibi'},player,player)+get.effect(target,{name:'shunshou_copy'},player,player); + ai: { + order: 11, + result: { + player: function (player, target) { + return ( + get.effect(target, { name: "zhibi" }, player, player) + + get.effect(target, { name: "shunshou_copy" }, player, player) + ); }, }, }, - group:['gzzhaosong_dying','gzzhaosong_sha'], - subSkill:{ - dying:{ - audio:'zhaosong', - trigger:{global:'dying'}, - logTarget:'player', - filter:function(event,player){ - return !player.getStorage('gzzhaosong').includes('效果①')&&event.player.isDying()&&event.player.hp<=0; + group: ["gzzhaosong_dying", "gzzhaosong_sha"], + subSkill: { + dying: { + audio: "zhaosong", + trigger: { global: "dying" }, + logTarget: "player", + filter: function (event, player) { + return ( + !player.getStorage("gzzhaosong").includes("效果①") && + event.player.isDying() && + event.player.hp <= 0 + ); }, - prompt2:'令该角色回复至2点体力并摸一张牌', - check:function(event,player){ - return event.player.isFriendOf(player)&&get.attitude(player,event.player)>0; + prompt2: "令该角色回复至2点体力并摸一张牌", + check: function (event, player) { + return event.player.isFriendOf(player) && get.attitude(player, event.player) > 0; }, - content:function(){ - player.markAuto('gzzhaosong',['效果①']); - var target=trigger.player,num=2-target.hp; - if(num>0) target.recover(num); + content: function () { + player.markAuto("gzzhaosong", ["效果①"]); + var target = trigger.player, + num = 2 - target.hp; + if (num > 0) target.recover(num); target.draw(); }, }, - sha:{ - audio:'zhaosong', - trigger:{global:'useCard2'}, - direct:true, - filter:function(event,player){ - if(event.card.name!='sha'||player.getStorage('gzzhaosong').includes('效果③')) return false; - return game.hasPlayer(function(current){ - return !event.targets.includes(current)&&lib.filter.filterTarget(event.card,event.player,current); + sha: { + audio: "zhaosong", + trigger: { global: "useCard2" }, + direct: true, + filter: function (event, player) { + if (event.card.name != "sha" || player.getStorage("gzzhaosong").includes("效果③")) + return false; + return game.hasPlayer(function (current) { + return ( + !event.targets.includes(current) && + lib.filter.filterTarget(event.card, event.player, current) + ); }); }, - content:function(){ - 'step 0' - player.chooseTarget([1,2],get.prompt('gzzhaosong'),'为'+get.translation(trigger.card)+'增加至多两个目标',function(card,player,target){ - var event=_status.event.getTrigger(); - return !event.targets.includes(target)&&lib.filter.filterTarget(event.card,event.player,target); - }).set('ai',function(target){ - var event=_status.event.getTrigger(); - return get.effect(target,event.card,event.player,_status.event.player); - }).set('goon',game.countPlayer(function(current){ - return !trigger.targets.includes(current)&&lib.filter.filterTarget(trigger.card,trigger.player,current)&&get.effect(current,trigger.card,trigger.player,player)>0; - })>=Math.min(2,game.countPlayer(function(current){ - return !trigger.targets.includes(current)&&lib.filter.filterTarget(trigger.card,trigger.player,current); - }))).setHiddenSkill('gzzhaosong_sha'); - 'step 1' - if(result.bool){ - if(!event.isMine()&&!event.isOnline()) game.delayx(); - } - else event.finish(); - 'step 2' - var targets=result.targets; - player.markAuto('gzzhaosong',['效果③']); - player.logSkill('gzzhaosong_sha',targets); + content: function () { + "step 0"; + player + .chooseTarget( + [1, 2], + get.prompt("gzzhaosong"), + "为" + get.translation(trigger.card) + "增加至多两个目标", + function (card, player, target) { + var event = _status.event.getTrigger(); + return ( + !event.targets.includes(target) && + lib.filter.filterTarget(event.card, event.player, target) + ); + } + ) + .set("ai", function (target) { + var event = _status.event.getTrigger(); + return get.effect(target, event.card, event.player, _status.event.player); + }) + .set( + "goon", + game.countPlayer(function (current) { + return ( + !trigger.targets.includes(current) && + lib.filter.filterTarget(trigger.card, trigger.player, current) && + get.effect(current, trigger.card, trigger.player, player) > 0 + ); + }) >= + Math.min( + 2, + game.countPlayer(function (current) { + return ( + !trigger.targets.includes(current) && + lib.filter.filterTarget( + trigger.card, + trigger.player, + current + ) + ); + }) + ) + ) + .setHiddenSkill("gzzhaosong_sha"); + "step 1"; + if (result.bool) { + if (!event.isMine() && !event.isOnline()) game.delayx(); + } else event.finish(); + "step 2"; + var targets = result.targets; + player.markAuto("gzzhaosong", ["效果③"]); + player.logSkill("gzzhaosong_sha", targets); trigger.targets.addArray(targets); }, }, }, }, - gzlisi:{ - audio:'lisi', - trigger:{global:'dieAfter'}, - filter:function(event,player){ - return event.player.isFriendOf(player)&&player.getStorage('gzzhaosong').length>0; + gzlisi: { + audio: "lisi", + trigger: { global: "dieAfter" }, + filter: function (event, player) { + return event.player.isFriendOf(player) && player.getStorage("gzzhaosong").length > 0; }, - direct:true, - content:function(){ - 'step 0' - var list=player.getStorage('gzzhaosong').slice(0); - list.push('cancel2'); - player.chooseControl(list).set('prompt',get.prompt('gzlisi')).set('prompt2','恢复〖诏颂〗的一个已发动的选项'); - 'step 1' - if(result.control!='cancel2'){ - player.logSkill('gzlisi'); - player.unmarkAuto('gzzhaosong',[result.control]) + direct: true, + content: function () { + "step 0"; + var list = player.getStorage("gzzhaosong").slice(0); + list.push("cancel2"); + player + .chooseControl(list) + .set("prompt", get.prompt("gzlisi")) + .set("prompt2", "恢复〖诏颂〗的一个已发动的选项"); + "step 1"; + if (result.control != "cancel2") { + player.logSkill("gzlisi"); + player.unmarkAuto("gzzhaosong", [result.control]); } }, }, //杨艳 - gzxuanbei:{ - audio:'xuanbei', - trigger:{player:'showCharacterAfter'}, - filter:function(event,player){ - return !player.storage.gzxuanbei&&event.toShow.includes('gz_yangyan'); + gzxuanbei: { + audio: "xuanbei", + trigger: { player: "showCharacterAfter" }, + filter: function (event, player) { + return !player.storage.gzxuanbei && event.toShow.includes("gz_yangyan"); }, - forced:true, - locked:false, - content:function(){ - 'step 0' - player.storage.gzxuanbei=true; - var cards=[]; - while(cards.length<2){ - var card=get.cardPile2(function(card){ - if(cards.includes(card)) return false; - return card.hasTag('lianheng')||get.is.yingbian(card); + forced: true, + locked: false, + content: function () { + "step 0"; + player.storage.gzxuanbei = true; + var cards = []; + while (cards.length < 2) { + var card = get.cardPile2(function (card) { + if (cards.includes(card)) return false; + return card.hasTag("lianheng") || get.is.yingbian(card); }); - if(!card) break; + if (!card) break; else cards.push(card); } - if(cards.length) player.gain(cards,'gain2'); - if(cards.length<2) player.draw(2-cards.length); - 'step 1' - player.addTempSkill('gzxuanbei_effect'); + if (cards.length) player.gain(cards, "gain2"); + if (cards.length < 2) player.draw(2 - cards.length); + "step 1"; + player.addTempSkill("gzxuanbei_effect"); }, - group:'gzxuanbei_change', - subSkill:{ - effect:{ - trigger:{player:'useCard'}, - forced:true, - popup:false, - charlotte:true, - filter:function(event,player){ - return get.cardtag(event.card,'lianheng'); + group: "gzxuanbei_change", + subSkill: { + effect: { + trigger: { player: "useCard" }, + forced: true, + popup: false, + charlotte: true, + filter: function (event, player) { + return get.cardtag(event.card, "lianheng"); }, - content:function(){ + content: function () { player.draw(); }, - ai:{forceYingbian:true}, - mark:true, - intro:{content:'使用应变牌时直接获得强化,使用合纵牌时摸一张牌。'}, + ai: { forceYingbian: true }, + mark: true, + intro: { content: "使用应变牌时直接获得强化,使用合纵牌时摸一张牌。" }, }, - change:{ - audio:'xuanbei', - trigger:{player:'die'}, - direct:true, - forceDie:true, - skillAnimation:true, - animationColor:'thunder', - content:function(){ - 'step 0' - player.chooseTarget(get.prompt('gzxuanbei'),'令一名其他角色变更副将',lib.filter.notMe).set('forceDie',true).set('ai',function(target){ - var player=_status.event.player; - var rank=get.guozhanRank(target.name2,target)<=3; - var att=get.attitude(player,target); - if(att>0){ - return (4-rank)*att; - } - return -(rank-6)*att; - }); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.logSkill('gzxuanbei_change',target); + change: { + audio: "xuanbei", + trigger: { player: "die" }, + direct: true, + forceDie: true, + skillAnimation: true, + animationColor: "thunder", + content: function () { + "step 0"; + player + .chooseTarget( + get.prompt("gzxuanbei"), + "令一名其他角色变更副将", + lib.filter.notMe + ) + .set("forceDie", true) + .set("ai", function (target) { + var player = _status.event.player; + var rank = get.guozhanRank(target.name2, target) <= 3; + var att = get.attitude(player, target); + if (att > 0) { + return (4 - rank) * att; + } + return -(rank - 6) * att; + }); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.logSkill("gzxuanbei_change", target); game.delayx(); target.changeVice(); } @@ -6331,228 +8754,264 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, //司马师 - gzyimie:{ - audio:'yimie', - inherit:'yimie', - init:function(player){ - if(player.checkMainSkill('gzyimie')){ + gzyimie: { + audio: "yimie", + inherit: "yimie", + init: function (player) { + if (player.checkMainSkill("gzyimie")) { player.removeMaxHp(2); } }, }, - gztairan:{ - audio:'tairan', - trigger:{player:'phaseUseBegin'}, - check:function(event,player){ - return player.isDamaged()&&player.hasCard(function(card){ - return 5.5-get.value(card); - },'he'); + gztairan: { + audio: "tairan", + trigger: { player: "phaseUseBegin" }, + check: function (event, player) { + return ( + player.isDamaged() && + player.hasCard(function (card) { + return 5.5 - get.value(card); + }, "he") + ); }, - content:function(){ - 'step 0' - var list=[],num=0; - if(player.isHealthy()||!player.hasCard(function(card){ - return lib.filter.cardDiscardable(card,player,'gztairan'); - },'he')) num=1; - event.num=num; - for(var i=num;i<=player.hp;i++){ - list.push(i+'点'); + content: function () { + "step 0"; + var list = [], + num = 0; + if ( + player.isHealthy() || + !player.hasCard(function (card) { + return lib.filter.cardDiscardable(card, player, "gztairan"); + }, "he") + ) + num = 1; + event.num = num; + for (var i = num; i <= player.hp; i++) { + list.push(i + "点"); } - player.chooseControl(list).set('prompt','###请先失去任意点体力###此回合结束时,你将恢复等量的体力'); - 'step 1' - var num1=result.index+num; - event.num1=num1; - if(num1>0) player.loseHp(num1); - 'step 2' - if(player.isDamaged()&&player.hasCard(function(card){ - return lib.filter.cardDiscardable(card,player,'gztairan') - },'he')){ - var next=player.chooseToDiscard('he',[1,player.getDamagedHp()],'然后请弃置任意张牌','此回合结束时,你将摸等量的牌。').set('ai',function(card){ - return 5.5-get.value(card); - }); - if(event.num1==0) next.set('forced',true); + player + .chooseControl(list) + .set("prompt", "###请先失去任意点体力###此回合结束时,你将恢复等量的体力"); + "step 1"; + var num1 = result.index + num; + event.num1 = num1; + if (num1 > 0) player.loseHp(num1); + "step 2"; + if ( + player.isDamaged() && + player.hasCard(function (card) { + return lib.filter.cardDiscardable(card, player, "gztairan"); + }, "he") + ) { + var next = player + .chooseToDiscard( + "he", + [1, player.getDamagedHp()], + "然后请弃置任意张牌", + "此回合结束时,你将摸等量的牌。" + ) + .set("ai", function (card) { + return 5.5 - get.value(card); + }); + if (event.num1 == 0) next.set("forced", true); } - 'step 3' - var num2=0; - if(result.bool) num2=result.cards.length; - var storage=[event.num1,num2]; - player.addTempSkill('gztairan_effect'); - player.storage.gztairan_effect=storage; + "step 3"; + var num2 = 0; + if (result.bool) num2 = result.cards.length; + var storage = [event.num1, num2]; + player.addTempSkill("gztairan_effect"); + player.storage.gztairan_effect = storage; }, - subSkill:{ - effect:{ - audio:'tairan', - trigger:{player:'phaseEnd'}, - filter:function(event,player){ - var storage=player.storage.gztairan_effect; - return storage&&storage.length==2&&(storage[1]>0||player.isDamaged()); + subSkill: { + effect: { + audio: "tairan", + trigger: { player: "phaseEnd" }, + filter: function (event, player) { + var storage = player.storage.gztairan_effect; + return storage && storage.length == 2 && (storage[1] > 0 || player.isDamaged()); }, - forced:true, - charlotte:true, - onremove:true, - content:function(){ - var storage=player.storage.gztairan_effect; - if(storage[0]>0) player.recover(storage[0]); - if(storage[1]>0) player.draw(storage[1]); + forced: true, + charlotte: true, + onremove: true, + content: function () { + var storage = player.storage.gztairan_effect; + if (storage[0] > 0) player.recover(storage[0]); + if (storage[1] > 0) player.draw(storage[1]); }, }, }, }, //杜预 - gzsanchen:{ - audio:'sanchen', - enable:'phaseUse', - filter(event,player){ - var stat=player.getStat('sanchen'); - return game.hasPlayer(function(current){ - return (!stat||!stat.includes(current)); + gzsanchen: { + audio: "sanchen", + enable: "phaseUse", + filter(event, player) { + var stat = player.getStat("sanchen"); + return game.hasPlayer(function (current) { + return !stat || !stat.includes(current); }); }, - filterTarget(card,player,target){ - var stat=player.getStat('sanchen'); - return (!stat||!stat.includes(target)); + filterTarget(card, player, target) { + var stat = player.getStat("sanchen"); + return !stat || !stat.includes(target); }, - usable:1, - content(){ - 'step 0' - if(!player._fakesanchen){ - player._fakesanchen=true; - player.when({global:'phaseAfter'}) - .then(()=>{ + usable: 1, + content() { + "step 0"; + if (!player._fakesanchen) { + player._fakesanchen = true; + player.when({ global: "phaseAfter" }).then(() => { delete player._fakesanchen; - if(player.hasMark('gzsanchen')){ - player.removeMark('gzsanchen',player.countMark('gzsanchen'),false); + if (player.hasMark("gzsanchen")) { + player.removeMark("gzsanchen", player.countMark("gzsanchen"), false); } }); } - var stat=player.getStat(); - if(!stat.sanchen) stat.sanchen=[]; + var stat = player.getStat(); + if (!stat.sanchen) stat.sanchen = []; stat.sanchen.push(target); target.draw(3); - 'step 1' - if(!target.countCards('he')) event.finish(); - else target.chooseToDiscard('he',true,3).set('ai',function(card){ - var list=ui.selected.cards.map(function(i){ - return get.type2(i); + "step 1"; + if (!target.countCards("he")) event.finish(); + else + target.chooseToDiscard("he", true, 3).set("ai", function (card) { + var list = ui.selected.cards.map(function (i) { + return get.type2(i); + }); + if (!list.includes(get.type2(card))) return 7 - get.value(card); + return -get.value(card); }); - if(!list.includes(get.type2(card))) return 7-get.value(card); - return -get.value(card); - }); - 'step 2' - if(result.bool&&result.cards&&result.cards.length){ - var list=[]; - for(var i of result.cards) list.add(get.type2(i)); - if(list.length==result.cards.length){ + "step 2"; + if (result.bool && result.cards && result.cards.length) { + var list = []; + for (var i of result.cards) list.add(get.type2(i)); + if (list.length == result.cards.length) { target.draw(); - player.getStat('skill').gzsanchen--; - player.addMark('gzsanchen',1,false); + player.getStat("skill").gzsanchen--; + player.addMark("gzsanchen", 1, false); } - } - else{ + } else { target.draw(); - player.getStat('skill').gzsanchen--; - player.addMark('gzsanchen',1,false); + player.getStat("skill").gzsanchen--; + player.addMark("gzsanchen", 1, false); } }, - ai:{ - order:9, - threaten:1.7, - result:{ - target(player,target){ - if(target.hasSkillTag('nogain')) return 0.1; - return Math.sqrt(target.countCards('he')); + ai: { + order: 9, + threaten: 1.7, + result: { + target(player, target) { + if (target.hasSkillTag("nogain")) return 0.1; + return Math.sqrt(target.countCards("he")); }, }, }, - marktext:'陈', - intro:{ - name2:'陈', - content:'mark', + marktext: "陈", + intro: { + name2: "陈", + content: "mark", }, }, - gzpozhu:{ - audio:'pozhu', - enable:'phaseUse', - mainSkill:true, - init(player){ - if(player.checkMainSkill('gzpozhu')) player.removeMaxHp(); + gzpozhu: { + audio: "pozhu", + enable: "phaseUse", + mainSkill: true, + init(player) { + if (player.checkMainSkill("gzpozhu")) player.removeMaxHp(); }, - viewAsFilter(player){ - return !player.hasSkill('pozhu3',null,null,false)&&player.countMark('gzsanchen')>0&&player.countCards('hs')>0; + viewAsFilter(player) { + return ( + !player.hasSkill("pozhu3", null, null, false) && + player.countMark("gzsanchen") > 0 && + player.countCards("hs") > 0 + ); }, - viewAs:{name:'chuqibuyi'}, - filterCard:true, - position:'hs', - check(card){ - return 7-get.value(card); + viewAs: { name: "chuqibuyi" }, + filterCard: true, + position: "hs", + check(card) { + return 7 - get.value(card); }, - onuse(result,player){ - player.removeMark('gzsanchen',1,false); + onuse(result, player) { + player.removeMark("gzsanchen", 1, false); }, }, //钟琰 - gzbolan:{ - audio:'bolan', - global:'gzbolan_global', - enable:'phaseUse', - usable:1, - content:function(){ - 'step 0' - if((event.num&&event.num>0)||!_status.characterlist.length){ + gzbolan: { + audio: "bolan", + global: "gzbolan_global", + enable: "phaseUse", + usable: 1, + content: function () { + "step 0"; + if ((event.num && event.num > 0) || !_status.characterlist.length) { event.finish(); return; } - var character=_status.characterlist.randomGet(); - var groups,double=get.is.double(character,true); - 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); + var character = _status.characterlist.randomGet(); + var groups, + double = get.is.double(character, true); + 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 3; - if(player.isHealthy()) return 1; + ai: { + order: 10, + result: { + player: function (player, target) { + if (get.effect(player, { name: "losehp" }, player, player) > 0) return 3; + if (player.isHealthy()) return 1; return -1; }, }, @@ -6561,191 +9020,250 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, //司马昭 - gzchoufa:{ - audio:'choufa', - inherit:'choufa', - content:function(){ - 'step 0' - player.choosePlayerCard(target,'h',true); - 'step 1' - player.showCards(result.cards,get.translation(player)+'对'+get.translation(target)+'发动了【筹伐】'); - var type=get.type2(result.cards[0],target),hs=target.getCards('h',function(card){ - return card!=result.cards[0]&&get.type2(card,target)!=type; - }); - if(hs.length){ - target.addGaintag(hs,'xinchoufa'); - target.addTempSkill('xinchoufa2'); + gzchoufa: { + audio: "choufa", + inherit: "choufa", + content: function () { + "step 0"; + player.choosePlayerCard(target, "h", true); + "step 1"; + player.showCards( + result.cards, + get.translation(player) + "对" + get.translation(target) + "发动了【筹伐】" + ); + var type = get.type2(result.cards[0], target), + hs = target.getCards("h", function (card) { + return card != result.cards[0] && get.type2(card, target) != type; + }); + if (hs.length) { + target.addGaintag(hs, "xinchoufa"); + target.addTempSkill("xinchoufa2"); } }, }, //张春华 - gzhuishi:{ - audio:2, - trigger:{player:'phaseDrawBegin1'}, - filter:function(event,player){ - return ui.discardPile.childNodes.length>0; + gzhuishi: { + audio: 2, + trigger: { player: "phaseDrawBegin1" }, + filter: function (event, player) { + return ui.discardPile.childNodes.length > 0; }, - preHidden:true, - prompt:function(){ - return get.prompt('huishi')+'(可观看牌数:'+lib.skill.gzhuishi.getNum()+')'; + preHidden: true, + prompt: function () { + return get.prompt("huishi") + "(可观看牌数:" + lib.skill.gzhuishi.getNum() + ")"; }, - check:function(event,player){ - return lib.skill.gzhuishi.getNum()>3; + check: function (event, player) { + return lib.skill.gzhuishi.getNum() > 3; }, - getNum:function(){ - var list=[]; + getNum: function () { + var list = []; list.push(ui.discardPile.lastChild); - if(list[0].previousSibling) list.push(list[0].previousSibling); - var num=0; - for(var i of list){ - var name=get.translation(i.name); - if(name=='挟令') name='挟天子以令诸侯'; - num+=name.length; + if (list[0].previousSibling) list.push(list[0].previousSibling); + var num = 0; + for (var i of list) { + var name = get.translation(i.name); + if (name == "挟令") name = "挟天子以令诸侯"; + num += name.length; } return num; }, - content:function(){ - 'step 0' + content: function () { + "step 0"; trigger.changeToZero(); - var cards=game.cardsGotoOrdering(get.cards(lib.skill.gzhuishi.getNum())).cards; - var num=Math.ceil(cards.length/2); - var next=player.chooseToMove('慧识:将'+get.cnNumber(num)+'张牌置于牌堆底并获得其余的牌',true); - next.set('list',[ - ['牌堆顶的展示牌',cards], - ['牌堆底'], - ]); - next.set('filterMove',function(from,to,moved){ - if(moved[0].includes(from)&&to==1) return moved[1].length<_status.event.num; + var cards = game.cardsGotoOrdering(get.cards(lib.skill.gzhuishi.getNum())).cards; + var num = Math.ceil(cards.length / 2); + var next = player.chooseToMove( + "慧识:将" + get.cnNumber(num) + "张牌置于牌堆底并获得其余的牌", + true + ); + next.set("list", [["牌堆顶的展示牌", cards], ["牌堆底"]]); + next.set("filterMove", function (from, to, moved) { + if (moved[0].includes(from) && to == 1) return moved[1].length < _status.event.num; return true; }); - next.set('filterOk',function(moved){ - return moved[1].length==_status.event.num; + next.set("filterOk", function (moved) { + return moved[1].length == _status.event.num; }); - next.set('num',num); - next.set('processAI',function(list){ - var cards=list[0][1].slice(0).sort(function(a,b){ - return get.value(b)-get.useful(a); + next.set("num", num); + next.set("processAI", function (list) { + var cards = list[0][1].slice(0).sort(function (a, b) { + return get.value(b) - get.useful(a); }); - return [cards,cards.splice(cards.length-_status.event.num)]; + return [cards, cards.splice(cards.length - _status.event.num)]; }); - 'step 1' - if(result.bool){ - var list=result.moved; - if(list[0].length) player.gain(list[0],'gain2'); - while(list[1].length) ui.cardPile.appendChild(list[1].shift().fix()); + "step 1"; + if (result.bool) { + var list = result.moved; + if (list[0].length) player.gain(list[0], "gain2"); + while (list[1].length) ui.cardPile.appendChild(list[1].shift().fix()); } }, }, - gzqingleng:{ - audio:2, - trigger:{global:'phaseEnd'}, - direct:true, - preHidden:true, - filter:function(event,player){ - var target=event.player; - return target!=player&&target.isIn()&&target.isUnseen(2)&&player.countCards('he')>0&&player.canUse({name:'sha',nature:'ice'},target,false); + gzqingleng: { + audio: 2, + trigger: { global: "phaseEnd" }, + direct: true, + preHidden: true, + filter: function (event, player) { + var target = event.player; + return ( + target != player && + target.isIn() && + target.isUnseen(2) && + player.countCards("he") > 0 && + player.canUse({ name: "sha", nature: "ice" }, target, false) + ); }, - content:function(){ - 'step 0' - player.chooseCard('he',get.prompt('gzqingleng',trigger.player),'将一张牌当做冰【杀】对其使用',function(card,player){ - return player.canUse(get.autoViewAs({name:'sha',nature:'ice'},[card]),_status.event.target,false); - }).set('target',trigger.player).set('ai',function(card){ - if(get.effect(_status.event.target,get.autoViewAs({name:'sha',nature:'ice'},[card]),player)<=0) return false; - return 6-get.value(card); - }).setHiddenSkill(event.name); - 'step 1' - if(result.bool){ - player.useCard(get.autoViewAs({name:'sha',nature:'ice'},result.cards),result.cards,false,trigger.player,'gzqingleng'); - if(trigger.player.isUnseen()){ + content: function () { + "step 0"; + player + .chooseCard( + "he", + get.prompt("gzqingleng", trigger.player), + "将一张牌当做冰【杀】对其使用", + function (card, player) { + return player.canUse( + get.autoViewAs({ name: "sha", nature: "ice" }, [card]), + _status.event.target, + false + ); + } + ) + .set("target", trigger.player) + .set("ai", function (card) { + if ( + get.effect( + _status.event.target, + get.autoViewAs({ name: "sha", nature: "ice" }, [card]), + player + ) <= 0 + ) + return false; + return 6 - get.value(card); + }) + .setHiddenSkill(event.name); + "step 1"; + if (result.bool) { + player.useCard( + get.autoViewAs({ name: "sha", nature: "ice" }, result.cards), + result.cards, + false, + trigger.player, + "gzqingleng" + ); + if (trigger.player.isUnseen()) { player.draw(); } } }, }, //司马懿 - gzquanbian:{ - audio:'quanbian', - preHidden:true, - trigger:{player:['useCard','respond']}, - filter:function(event,player){ - if(player.hasSkill('gzquanbian_blocker')) return false; - var phase=event.getParent('phaseUse'); - if(!phase||phase.player!=player) return false; - var suit=get.suit(event.card); - if(!lib.suit.includes(suit)||!lib.skill.quanbian.hasHand(event)) return false; - return player.getHistory('useCard',function(evt){ - return evt!=event&&get.suit(evt.card)==suit&&lib.skill.quanbian.hasHand(evt)&&evt.getParent('phaseUse')==phase; - }).length+player.getHistory('respond',function(evt){ - return evt!=event&&get.suit(evt.card)==suit&&lib.skill.quanbian.hasHand(evt)&&evt.getParent('phaseUse')==phase; - }).length==0; + gzquanbian: { + audio: "quanbian", + preHidden: true, + trigger: { player: ["useCard", "respond"] }, + filter: function (event, player) { + if (player.hasSkill("gzquanbian_blocker")) return false; + var phase = event.getParent("phaseUse"); + if (!phase || phase.player != player) return false; + var suit = get.suit(event.card); + if (!lib.suit.includes(suit) || !lib.skill.quanbian.hasHand(event)) return false; + return ( + player.getHistory("useCard", function (evt) { + return ( + evt != event && + get.suit(evt.card) == suit && + lib.skill.quanbian.hasHand(evt) && + evt.getParent("phaseUse") == phase + ); + }).length + + player.getHistory("respond", function (evt) { + return ( + evt != event && + get.suit(evt.card) == suit && + lib.skill.quanbian.hasHand(evt) && + evt.getParent("phaseUse") == phase + ); + }).length == + 0 + ); }, - content:function(){ - 'step 0' - var cards=get.cards(player.maxHp); - for(var i=cards.length-1;i>=0;i--){ - ui.cardPile.insertBefore(cards[i],ui.cardPile.firstChild); + content: function () { + "step 0"; + var cards = get.cards(player.maxHp); + for (var i = cards.length - 1; i >= 0; i--) { + ui.cardPile.insertBefore(cards[i], ui.cardPile.firstChild); } game.updateRoundNumber(); - player.chooseButton(['权变:选择获得一张牌',cards],true).set('ai',function(button){ - var player=_status.event.player,card=button.link; - var suit=get.suit(card,false),val=get.value(card); - if(player.hasHistory('useCard',function(evt){ - return get.suit(evt.card,false)==suit; - })||player.hasHistory('respond',function(evt){ - return get.suit(evt.card,false)==suit; - })) return val; - return val+8; + player.chooseButton(["权变:选择获得一张牌", cards], true).set("ai", function (button) { + var player = _status.event.player, + card = button.link; + var suit = get.suit(card, false), + val = get.value(card); + if ( + player.hasHistory("useCard", function (evt) { + return get.suit(evt.card, false) == suit; + }) || + player.hasHistory("respond", function (evt) { + return get.suit(evt.card, false) == suit; + }) + ) + return val; + return val + 8; }); - 'step 1' - if(result.bool){ - var card=result.links[0]; - player.gain(card,'gain2'); - var suit=get.suit(card,false); - if(player.hasHistory('useCard',function(evt){ - return get.suit(evt.card,false)==suit; - })||player.hasHistory('respond',function(evt){ - return get.suit(evt.card,false)==suit; - })) player.addTempSkill('gzquanbian_blocker'); + "step 1"; + if (result.bool) { + var card = result.links[0]; + player.gain(card, "gain2"); + var suit = get.suit(card, false); + if ( + player.hasHistory("useCard", function (evt) { + return get.suit(evt.card, false) == suit; + }) || + player.hasHistory("respond", function (evt) { + return get.suit(evt.card, false) == suit; + }) + ) + player.addTempSkill("gzquanbian_blocker"); } }, - subSkill:{blocker:{charlotte:true}}, + subSkill: { blocker: { charlotte: true } }, }, - gzxiongzhi:{ - audio:'xiongzhi', - enable:'phaseUse', - limited:true, - skillAnimation:true, - animationColor:'thunder', - content:function(){ - 'step 0' - player.awakenSkill('gzxiongzhi'); - event.cards=game.cardsGotoOrdering(get.cards(player.maxHp)).cards.slice(0); - 'step 1' - var card=cards.shift(); - event.card=card; + gzxiongzhi: { + audio: "xiongzhi", + enable: "phaseUse", + limited: true, + skillAnimation: true, + animationColor: "thunder", + content: function () { + "step 0"; + player.awakenSkill("gzxiongzhi"); + event.cards = game.cardsGotoOrdering(get.cards(player.maxHp)).cards.slice(0); + "step 1"; + var card = cards.shift(); + event.card = card; player.showCards(card); - if(!player.hasUseTarget(card)){ - if(cards.length>0) event.redo(); + if (!player.hasUseTarget(card)) { + if (cards.length > 0) event.redo(); else event.finish(); } - 'step 2' - var next=player.chooseUseTarget(card,true); - if(get.info(card).updateUsable=='phaseUse') next.addCount=false; - 'step 3' - if(result.bool&&cards.length>0) event.goto(1); + "step 2"; + var next = player.chooseUseTarget(card, true); + if (get.info(card).updateUsable == "phaseUse") next.addCount = false; + "step 3"; + if (result.bool && cards.length > 0) event.goto(1); }, - ai:{ - order:1, - result:{ - player:function(player){ - if(!player.hasSkill('smyyingshi')) return 1; - var cards=[]; - for(var i=0;i0; + check: function (event, player) { + return get.effect(event.player, { name: "guohe_copy2" }, player, player) > 0; }, - logTarget:'player', - content:function(){ - player.discardPlayerCard(trigger.player,true,'he'); + logTarget: "player", + content: function () { + player.discardPlayerCard(trigger.player, true, "he"); }, }, - gzmingfa:{ - audio:'dcmingfa', - enable:'phaseUse', - usable:1, - filterTarget:function(card,player,target){ - return player!=target&&target.isEnemyOf(player); + gzmingfa: { + audio: "dcmingfa", + enable: "phaseUse", + usable: 1, + filterTarget: function (card, player, target) { + return player != target && target.isEnemyOf(player); }, - content:function(){ - player.markAuto('gzmingfa',targets); + content: function () { + player.markAuto("gzmingfa", targets); game.delayx(); }, - onremove:true, - ai:{ - order:1, - result:{target:-1}, + onremove: true, + ai: { + order: 1, + result: { target: -1 }, }, - group:'gzmingfa_effect', - subSkill:{ - effect:{ - audio:'dcmingfa', - trigger:{global:'phaseEnd'}, - forced:true, - filter:function(event,player){ - return player.getStorage('gzmingfa').includes(event.player); + group: "gzmingfa_effect", + subSkill: { + effect: { + audio: "dcmingfa", + trigger: { global: "phaseEnd" }, + forced: true, + filter: function (event, player) { + return player.getStorage("gzmingfa").includes(event.player); }, - logTarget:'player', - content:function(){ - var target=trigger.player; - player.unmarkAuto('gzmingfa',[target]); - if(target.isIn()){ - var num=player.countCards('h')-target.countCards('h'); - if(num>0){ + logTarget: "player", + content: function () { + var target = trigger.player; + player.unmarkAuto("gzmingfa", [target]); + if (target.isIn()) { + var num = player.countCards("h") - target.countCards("h"); + if (num > 0) { target.damage(); - player.gainPlayerCard(target,true,'h'); - } - else if(num<0){ - player.draw(Math.min(5,-num)); + player.gainPlayerCard(target, true, "h"); + } else if (num < 0) { + player.draw(Math.min(5, -num)); } } }, @@ -6823,158 +9352,191 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, //海外服国战 //杨修 - gzdanlao:{ - audio:'danlao', - inherit:'danlao', - preHidden:true, - filter:function(event,player){ - return get.type(event.card)=='trick'&&event.targets&&event.targets.length>1; + gzdanlao: { + audio: "danlao", + inherit: "danlao", + preHidden: true, + filter: function (event, player) { + return get.type(event.card) == "trick" && event.targets && event.targets.length > 1; }, }, - gzjilei:{ - inherit:'jilei', - preHidden:true, - content:function(){ - 'step 0' - player.chooseControl('basic','trick','equip','cancel2',function(){ - var source=_status.event.source; - if(get.attitude(_status.event.player,source)>0) return 'cancel2'; - var list=['basic','trick','equip'].filter(function(name){ - return (!source.storage.jilei2||!source.storage.jilei2.includes(name)); - }); - if(!list.length) return 'cancel2'; - if(list.includes('trick')&&source.countCards('h',function(card){ - return get.type(card,source)=='trick'&&source.hasValueTarget(card); - })>1) return 'trick'; - return list[0]; - }).set('prompt',get.prompt2('jilei',trigger.source)).set('source',trigger.source).setHiddenSkill('gzjilei'); - 'step 1' - if(result.control!='cancel2'){ - player.logSkill('gzjilei',trigger.source); - player.chat(get.translation(result.control)+'牌'); - game.log(player,'声明了','#y'+get.translation(result.control)+'牌'); - trigger.source.addTempSkill('jilei2'); + gzjilei: { + inherit: "jilei", + preHidden: true, + content: function () { + "step 0"; + player + .chooseControl("basic", "trick", "equip", "cancel2", function () { + var source = _status.event.source; + if (get.attitude(_status.event.player, source) > 0) return "cancel2"; + var list = ["basic", "trick", "equip"].filter(function (name) { + return !source.storage.jilei2 || !source.storage.jilei2.includes(name); + }); + if (!list.length) return "cancel2"; + if ( + list.includes("trick") && + source.countCards("h", function (card) { + return get.type(card, source) == "trick" && source.hasValueTarget(card); + }) > 1 + ) + return "trick"; + return list[0]; + }) + .set("prompt", get.prompt2("jilei", trigger.source)) + .set("source", trigger.source) + .setHiddenSkill("gzjilei"); + "step 1"; + if (result.control != "cancel2") { + player.logSkill("gzjilei", trigger.source); + player.chat(get.translation(result.control) + "牌"); + game.log(player, "声明了", "#y" + get.translation(result.control) + "牌"); + trigger.source.addTempSkill("jilei2"); trigger.source.storage.jilei2.add(result.control); - trigger.source.updateMarks('jilei2'); + trigger.source.updateMarks("jilei2"); game.delayx(); } }, }, //诸葛瑾 - gzhuanshi:{ - audio:'huanshi', - trigger:{global:'judge'}, - direct:true, - preHidden:true, - filter:function(event,player){ - return player.countCards('hes')>0&&event.player.isFriendOf(player); + gzhuanshi: { + audio: "huanshi", + trigger: { global: "judge" }, + direct: true, + preHidden: true, + filter: function (event, player) { + return player.countCards("hes") > 0 && event.player.isFriendOf(player); }, - content:function(){ - "step 0" - player.chooseCard(get.translation(trigger.player)+'的'+(trigger.judgestr||'')+'判定为'+ - get.translation(trigger.player.judging[0])+','+get.prompt('gzhuanshi'),'hes',function(card){ - var player=_status.event.player; - var mod2=game.checkMod(card,player,'unchanged','cardEnabled2',player); - if(mod2!='unchanged') return mod2; - var mod=game.checkMod(card,player,'unchanged','cardRespondable',player); - if(mod!='unchanged') return mod; - return true; - }).set('ai',function(card){ - var trigger=_status.event.getTrigger(); - var player=_status.event.player; - var judging=_status.event.judging; - var result=trigger.judge(card)-trigger.judge(judging); - var attitude=get.attitude(player,trigger.player); - if(attitude==0||result==0) return 0; - if(attitude>0){ - return result-get.value(card)/2; - } - else{ - return -result-get.value(card)/2; - } - }).set('judging',trigger.player.judging[0]).setHiddenSkill('gzhuanshi'); - "step 1" - if(result.bool){ - player.respond(result.cards,'gzhuanshi','highlight','noOrdering'); - } - else{ + content: function () { + "step 0"; + player + .chooseCard( + get.translation(trigger.player) + + "的" + + (trigger.judgestr || "") + + "判定为" + + get.translation(trigger.player.judging[0]) + + "," + + get.prompt("gzhuanshi"), + "hes", + function (card) { + var player = _status.event.player; + var mod2 = game.checkMod(card, player, "unchanged", "cardEnabled2", player); + if (mod2 != "unchanged") return mod2; + var mod = game.checkMod(card, player, "unchanged", "cardRespondable", player); + if (mod != "unchanged") return mod; + return true; + } + ) + .set("ai", function (card) { + var trigger = _status.event.getTrigger(); + var player = _status.event.player; + var judging = _status.event.judging; + var result = trigger.judge(card) - trigger.judge(judging); + var attitude = get.attitude(player, trigger.player); + if (attitude == 0 || result == 0) return 0; + if (attitude > 0) { + return result - get.value(card) / 2; + } else { + return -result - get.value(card) / 2; + } + }) + .set("judging", trigger.player.judging[0]) + .setHiddenSkill("gzhuanshi"); + "step 1"; + if (result.bool) { + player.respond(result.cards, "gzhuanshi", "highlight", "noOrdering"); + } else { event.finish(); } - "step 2" - if(result.bool){ - if(trigger.player.judging[0].clone){ - trigger.player.judging[0].clone.classList.remove('thrownhighlight'); - game.broadcast(function(card){ - if(card.clone){ - card.clone.classList.remove('thrownhighlight'); + "step 2"; + if (result.bool) { + if (trigger.player.judging[0].clone) { + trigger.player.judging[0].clone.classList.remove("thrownhighlight"); + game.broadcast(function (card) { + if (card.clone) { + card.clone.classList.remove("thrownhighlight"); } - },trigger.player.judging[0]); - game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone])); + }, trigger.player.judging[0]); + game.addVideo( + "deletenode", + player, + get.cardsInfo([trigger.player.judging[0].clone]) + ); } game.cardsDiscard(trigger.player.judging[0]); - trigger.player.judging[0]=result.cards[0]; + trigger.player.judging[0] = result.cards[0]; trigger.orderingCards.addArray(result.cards); - game.log(trigger.player,'的判定牌改为',result.cards[0]); + game.log(trigger.player, "的判定牌改为", result.cards[0]); game.delay(2); } }, - ai:{ - rejudge:true, - tag:{ - rejudge:1, - } - } + ai: { + rejudge: true, + tag: { + rejudge: 1, + }, + }, }, - gzhongyuan:{ - audio:'hongyuan', - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return player.hasCard(function(card){ + gzhongyuan: { + audio: "hongyuan", + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + return player.hasCard(function (card) { return lib.skill.gzhongyuan.filterCard(card); - },'h'); + }, "h"); }, - filterCard:function(card){ - return !card.hasTag('lianheng')&&!card.hasGaintag('_lianheng'); + filterCard: function (card) { + return !card.hasTag("lianheng") && !card.hasGaintag("_lianheng"); }, - position:'h', - discard:false, - lose:false, - content:function(){ - cards[0].addGaintag('_lianheng'); - player.addTempSkill('gzhongyuan_clear') + position: "h", + discard: false, + lose: false, + content: function () { + cards[0].addGaintag("_lianheng"); + player.addTempSkill("gzhongyuan_clear"); }, - check:function(card){ - return 4.5-get.value(card); + check: function (card) { + return 4.5 - get.value(card); }, - group:'gzhongyuan_draw', - preHidden:true, - ai:{order:2,result:{player:1}}, - subSkill:{ - clear:{ - charlotte:true, - onremove:function(player){ - player.removeGaintag('_lianheng'); + group: "gzhongyuan_draw", + preHidden: true, + ai: { order: 2, result: { player: 1 } }, + subSkill: { + clear: { + charlotte: true, + onremove: function (player) { + player.removeGaintag("_lianheng"); }, }, - draw:{ - audio:'hongyuan', - trigger:{player:'drawBefore'}, - direct:true, - filter:function(event,player){ - return event.getParent().name=='_lianheng'&&game.hasPlayer(function(current){ - return current!=player&¤t.isFriendOf(player); - }); + draw: { + audio: "hongyuan", + trigger: { player: "drawBefore" }, + direct: true, + filter: function (event, player) { + return ( + event.getParent().name == "_lianheng" && + game.hasPlayer(function (current) { + return current != player && current.isFriendOf(player); + }) + ); }, - content:function(){ - 'step 0' - player.chooseTarget(get.prompt('gzhongyuan'),'将摸牌('+get.cnNumber(trigger.num)+'张)转移给一名同势力角色',function(card,player,target){ - return target!=player&&target.isFriendOf(player); - }).setHiddenSkill('gzhongyuan').set('ai',()=>-1); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.logSkill('gzhongyuan',target); + content: function () { + "step 0"; + player + .chooseTarget( + get.prompt("gzhongyuan"), + "将摸牌(" + get.cnNumber(trigger.num) + "张)转移给一名同势力角色", + function (card, player, target) { + return target != player && target.isFriendOf(player); + } + ) + .setHiddenSkill("gzhongyuan") + .set("ai", () => -1); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.logSkill("gzhongyuan", target); trigger.cancel(); target.draw(trigger.num); } @@ -6982,1021 +9544,1267 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, }, - gzmingzhe:{ - audio:'mingzhe', - trigger:{ - player:['loseAfter','useCard','respond'], - global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'], + gzmingzhe: { + audio: "mingzhe", + trigger: { + player: ["loseAfter", "useCard", "respond"], + global: [ + "equipAfter", + "addJudgeAfter", + "gainAfter", + "loseAsyncAfter", + "addToExpansionAfter", + ], }, - filter:function(event,player){ - if(player==_status.currentPhase) return false; - if(event.name=='useCard'||event.name=='respond'){ - return get.color(event.card,false)=='red'&&player.hasHistory('lose',function(evt){ - return evt.getParent()==event&&evt.hs&&evt.hs.length>0; - }); + filter: function (event, player) { + if (player == _status.currentPhase) return false; + if (event.name == "useCard" || event.name == "respond") { + return ( + get.color(event.card, false) == "red" && + player.hasHistory("lose", function (evt) { + return evt.getParent() == event && evt.hs && evt.hs.length > 0; + }) + ); } - var evt=event.getl(player); - if(!evt||!evt.es||!evt.es.length) return false; - for(var i of evt.es){ - if(get.color(i,player)=='red') return true; + var evt = event.getl(player); + if (!evt || !evt.es || !evt.es.length) return false; + for (var i of evt.es) { + if (get.color(i, player) == "red") return true; } return false; }, - frequent:true, - preHidden:true, - content:function(){ + frequent: true, + preHidden: true, + content: function () { player.draw(); }, }, //廖化 - gzdangxian:{ - trigger:{player:'phaseBegin'}, - forced:true, - preHidden:true, - audio:'dangxian', - audioname:['guansuo'], - content:function(){ - var next=player.phaseUse(); + gzdangxian: { + trigger: { player: "phaseBegin" }, + forced: true, + preHidden: true, + audio: "dangxian", + audioname: ["guansuo"], + content: function () { + var next = player.phaseUse(); event.next.remove(next); trigger.next.push(next); }, - group:'gzdangxian_show', - subSkill:{ - show:{ - audio:'dangxian', - trigger:{player:'showCharacterAfter'}, - forced:true, - filter:function(event,player){ - return event.toShow.includes('gz_liaohua')&&!player.storage.gzdangxian_draw; + group: "gzdangxian_show", + subSkill: { + show: { + audio: "dangxian", + trigger: { player: "showCharacterAfter" }, + forced: true, + filter: function (event, player) { + return event.toShow.includes("gz_liaohua") && !player.storage.gzdangxian_draw; }, - content:function(){ - player.storage.gzdangxian_draw=true; - player.addMark('xianqu_mark',1) + content: function () { + player.storage.gzdangxian_draw = true; + player.addMark("xianqu_mark", 1); }, }, }, }, //新国标2022 //许褚 - gzluoyi:{ - audio:'luoyi', - trigger:{player:'phaseDrawEnd'}, - direct:true, - preHidden:true, - filter:function(event,player){ - return player.countCards('he')>0; + gzluoyi: { + audio: "luoyi", + trigger: { player: "phaseDrawEnd" }, + direct: true, + preHidden: true, + filter: function (event, player) { + return player.countCards("he") > 0; }, - content:function(){ - 'step 0' - player.chooseToDiscard('he',get.prompt2('gzluoyi')).setHiddenSkill('gzluoyi').set('ai',function(card){ - var player=_status.event.player; - if(player.hasCard(function(cardx){ - if(cardx==card) return false; - return (cardx.name=='sha'||cardx.name=='juedou')&&player.hasValueTarget(cardx,null,true); - },'hs')) return 5-get.value(card); - return -get.value(card); - }).logSkill='gzluoyi'; - 'step 1' - if(result.bool) player.addTempSkill('gzluoyi_buff') + content: function () { + "step 0"; + player + .chooseToDiscard("he", get.prompt2("gzluoyi")) + .setHiddenSkill("gzluoyi") + .set("ai", function (card) { + var player = _status.event.player; + if ( + player.hasCard(function (cardx) { + if (cardx == card) return false; + return ( + (cardx.name == "sha" || cardx.name == "juedou") && + player.hasValueTarget(cardx, null, true) + ); + }, "hs") + ) + return 5 - get.value(card); + return -get.value(card); + }).logSkill = "gzluoyi"; + "step 1"; + if (result.bool) player.addTempSkill("gzluoyi_buff"); }, - subSkill:{ - buff:{ - audio:'luoyi', - charlotte:true, - forced:true, - trigger:{source:'damageBegin1'}, - filter:function(event,player){ - return event.card&&(event.card.name=='sha'||event.card.name=='juedou')&&event.getParent().type=='card'; + subSkill: { + buff: { + audio: "luoyi", + charlotte: true, + forced: true, + trigger: { source: "damageBegin1" }, + filter: function (event, player) { + return ( + event.card && + (event.card.name == "sha" || event.card.name == "juedou") && + event.getParent().type == "card" + ); }, - content:function(){ + content: function () { trigger.num++; }, }, }, }, //典韦 - gzqiangxi:{ - audio:'qiangxi', - inherit:'qiangxi', - filterTarget:function(card,player,target){ - return target!=player; + gzqiangxi: { + audio: "qiangxi", + inherit: "qiangxi", + filterTarget: function (card, player, target) { + return target != player; }, }, //小乔 - gztianxiang:{ - audio:'tianxiang', - audioname:['daxiaoqiao','re_xiaoqiao','ol_xiaoqiao'], - trigger:{player:'damageBegin4'}, - direct:true, - preHidden:true, - usable:1, - filter:function(event,player){ - return player.countCards('h',function(card){ - return _status.connectMode||get.suit(card,player)=='heart'; - })>0&&event.num>0; + gztianxiang: { + audio: "tianxiang", + audioname: ["daxiaoqiao", "re_xiaoqiao", "ol_xiaoqiao"], + trigger: { player: "damageBegin4" }, + direct: true, + preHidden: true, + usable: 1, + filter: function (event, player) { + return ( + player.countCards("h", function (card) { + return _status.connectMode || get.suit(card, player) == "heart"; + }) > 0 && event.num > 0 + ); }, - content:function(){ - "step 0" - player.chooseCardTarget({ - filterCard:function(card,player){ - return get.suit(card)=='heart'&&lib.filter.cardDiscardable(card,player); - }, - filterTarget:function(card,player,target){ - return player!=target; - }, - ai1:function(card){ - return 10-get.value(card); - }, - ai2:function(target){ - var att=get.attitude(_status.event.player,target); - var trigger=_status.event.getTrigger(); - var da=0; - if(_status.event.player.hp==1){ - da=10; - } - var eff=get.damageEffect(target,trigger.source,target); - if(att==0) return 0.1+da; - if(eff>=0&&att>0){ - return att+da; - } - if(att>0&&target.hp>1){ - if(target.maxHp-target.hp>=3) return att*1.1+da; - if(target.maxHp-target.hp>=2) return att*0.9+da; - } - return -att+da; - }, - prompt:get.prompt('gztianxiang'), - prompt2:lib.translate.gztianxiang_info - }).setHiddenSkill(event.name); - "step 1" - if(result.bool){ + content: function () { + "step 0"; + player + .chooseCardTarget({ + filterCard: function (card, player) { + return get.suit(card) == "heart" && lib.filter.cardDiscardable(card, player); + }, + filterTarget: function (card, player, target) { + return player != target; + }, + ai1: function (card) { + return 10 - get.value(card); + }, + ai2: function (target) { + var att = get.attitude(_status.event.player, target); + var trigger = _status.event.getTrigger(); + var da = 0; + if (_status.event.player.hp == 1) { + da = 10; + } + var eff = get.damageEffect(target, trigger.source, target); + if (att == 0) return 0.1 + da; + if (eff >= 0 && att > 0) { + return att + da; + } + if (att > 0 && target.hp > 1) { + if (target.maxHp - target.hp >= 3) return att * 1.1 + da; + if (target.maxHp - target.hp >= 2) return att * 0.9 + da; + } + return -att + da; + }, + prompt: get.prompt("gztianxiang"), + prompt2: lib.translate.gztianxiang_info, + }) + .setHiddenSkill(event.name); + "step 1"; + if (result.bool) { player.discard(result.cards); - var target=result.targets[0]; - player.chooseControlList(true,function(event,player){ - var target=_status.event.target; - var att=get.attitude(player,target); - if(target.hasSkillTag('maihp')) att=-att; - if(att>0){ - return 0; - } - else{ - return 1; - } - }, - ['令'+get.translation(target)+'受到伤害来源对其造成的1点伤害,然后摸X张牌(X为其已损失体力值且至多为5)', - '令'+get.translation(target)+'失去1点体力,然后获得'+get.translation(result.cards)]).set('target',target); - player.logSkill(event.name,target); + var target = result.targets[0]; + player + .chooseControlList( + true, + function (event, player) { + var target = _status.event.target; + var att = get.attitude(player, target); + if (target.hasSkillTag("maihp")) att = -att; + if (att > 0) { + return 0; + } else { + return 1; + } + }, + [ + "令" + + get.translation(target) + + "受到伤害来源对其造成的1点伤害,然后摸X张牌(X为其已损失体力值且至多为5)", + "令" + + get.translation(target) + + "失去1点体力,然后获得" + + get.translation(result.cards), + ] + ) + .set("target", target); + player.logSkill(event.name, target); trigger.cancel(); - event.target=target; - event.card=result.cards[0]; - } - else{ + event.target = target; + event.card = result.cards[0]; + } else { player.storage.counttrigger.gztianxiang--; event.finish(); } - "step 2" - if(typeof result.index=='number'){ - event.index=result.index; - if(result.index){ - event.related=event.target.loseHp(); + "step 2"; + if (typeof result.index == "number") { + event.index = result.index; + if (result.index) { + event.related = event.target.loseHp(); + } else { + event.related = event.target.damage(trigger.source || "nosource", "nocard"); } - else{ - event.related=event.target.damage(trigger.source||'nosource','nocard'); - } - } - else event.finish(); - "step 3" + } else event.finish(); + "step 3"; //if(event.related.cancelled||target.isDead()) return; - if(event.index&&card.isInPile()) target.gain(card,'gain2'); - else if(target.getDamagedHp()) target.draw(Math.min(5,target.getDamagedHp())); + if (event.index && card.isInPile()) target.gain(card, "gain2"); + else if (target.getDamagedHp()) target.draw(Math.min(5, target.getDamagedHp())); }, - ai:{ - maixie_defend:true, - effect:{ - target:function(card,player,target){ - if(player.hasSkillTag('jueqing',false,target)) return; - if(get.tag(card,'damage')&&target.countCards('he')>1) return 0.7; - } + ai: { + maixie_defend: true, + effect: { + target: function (card, player, target) { + if (player.hasSkillTag("jueqing", false, target)) return; + if (get.tag(card, "damage") && target.countCards("he") > 1) return 0.7; + }, }, - } + }, }, - gzhongyan:{ - mod:{ - suit:function(card,suit){ - if(suit=='spade') return 'heart'; + gzhongyan: { + mod: { + suit: function (card, suit) { + if (suit == "spade") return "heart"; }, - maxHandcard:function(player,num){ - if(player.hasCard(function(card){ - return get.suit(card,player)=='heart'; - },'e')) return num+1; + maxHandcard: function (player, num) { + if ( + player.hasCard(function (card) { + return get.suit(card, player) == "heart"; + }, "e") + ) + return num + 1; }, - } + }, }, //黄忠 - gzliegong:{ - audio:'liegong', - locked:false, - mod:{ - targetInRange:function(card,player,target){ - if(card.name=='sha'&&target.countCards('h')0) return 2; - return target.mayHaveShan(player,'use',target.getCards('h',i=>{ - return i.hasGaintag('sha_notshan'); - }))?1:0; - }); - 'step 1' - if(result.control!='cancel2'){ - var target=trigger.target; - player.logSkill('gzliegong',target); - if(result.index==1){ - game.log(trigger.card,'不可被',target,'响应'); + direct: true, + preHidden: true, + content: function () { + "step 0"; + var str = get.translation(trigger.target), + card = get.translation(trigger.card); + player + .chooseControl("cancel2") + .set("choiceList", [ + "令" + card + "对" + str + "的伤害+1", + "令" + str + "不能响应" + card, + ]) + .set("prompt", get.prompt("gzliegong", trigger.target)) + .setHiddenSkill("gzliegong") + .set("ai", function () { + var player = _status.event.player, + target = _status.event.getTrigger().target; + if (get.attitude(player, target) > 0) return 2; + return target.mayHaveShan( + player, + "use", + target.getCards("h", (i) => { + return i.hasGaintag("sha_notshan"); + }) + ) + ? 1 + : 0; + }); + "step 1"; + if (result.control != "cancel2") { + var target = trigger.target; + player.logSkill("gzliegong", target); + if (result.index == 1) { + game.log(trigger.card, "不可被", target, "响应"); trigger.directHit.add(target); - } - else { - game.log(trigger.card,'对',target,'的伤害+1'); - var map=trigger.getParent().customArgs,id=target.playerid; - if(!map[id]) map[id]={}; - if(!map[id].extraDamage) map[id].extraDamage=0; + } else { + game.log(trigger.card, "对", target, "的伤害+1"); + var map = trigger.getParent().customArgs, + id = target.playerid; + if (!map[id]) map[id] = {}; + if (!map[id].extraDamage) map[id].extraDamage = 0; map[id].extraDamage++; } } }, }, //潘凤 - gzkuangfu:{ - audio:'kuangfu', - trigger:{player:'useCardToPlayered'}, - shaRelated:true, - preHidden:true, - logTarget:'target', - filter:function(event,player){ - return event.card.name=='sha'&&player.isPhaseUsing()&&!player.hasSkill('gzkuangfu_extra')&&event.target.countGainableCards(player,'e')>0; + gzkuangfu: { + audio: "kuangfu", + trigger: { player: "useCardToPlayered" }, + shaRelated: true, + preHidden: true, + logTarget: "target", + filter: function (event, player) { + return ( + event.card.name == "sha" && + player.isPhaseUsing() && + !player.hasSkill("gzkuangfu_extra") && + event.target.countGainableCards(player, "e") > 0 + ); }, - check:function(event,player){ - if(get.attitude(player,event.target)>0||!event.target.hasCard(function(card){ - return lib.filter.canBeGained(card,player,event.target)&&get.value(card,event.target)>0; - },'e')) return false; + check: function (event, player) { + if ( + get.attitude(player, event.target) > 0 || + !event.target.hasCard(function (card) { + return ( + lib.filter.canBeGained(card, player, event.target) && + get.value(card, event.target) > 0 + ); + }, "e") + ) + return false; return true; }, - content:function(){ - trigger.getParent()._gzkuangfued=true; - player.gainPlayerCard(trigger.target,'e',true); - player.addTempSkill('gzkuangfu_extra','phaseUseAfter'); + content: function () { + trigger.getParent()._gzkuangfued = true; + player.gainPlayerCard(trigger.target, "e", true); + player.addTempSkill("gzkuangfu_extra", "phaseUseAfter"); }, - subSkill:{ - extra:{ - trigger:{player:'useCardAfter'}, - charlotte:true, - forced:true, - filter:function(event,player){ - return event._gzkuangfued&&!player.hasHistory('sourceDamage',function(evt){ - return evt.card&&event.card; - })&&player.countCards('h')>0; + subSkill: { + extra: { + trigger: { player: "useCardAfter" }, + charlotte: true, + forced: true, + filter: function (event, player) { + return ( + event._gzkuangfued && + !player.hasHistory("sourceDamage", function (evt) { + return evt.card && event.card; + }) && + player.countCards("h") > 0 + ); }, - content:function(){ - player.chooseToDiscard('h',2,true); + content: function () { + player.chooseToDiscard("h", 2, true); }, }, }, }, //吕布 - gzwushuang:{ - shaRelated:true, - audio:'wushuang', - audioname:['re_lvbu','shen_lvbu','lvlingqi'], - forced:true, - locked:true, - group:['wushuang1','wushuang2'], - preHidden:['wushuang1','wushuang2','gzwushuang'], - trigger:{player:'useCard1'}, - direct:true, - filter:function(event,player){ - if(event.card.name!='juedou'||!event.card.isCard) return false; - if(event.targets){ - if(game.hasPlayer(function(current){ - return !event.targets.includes(current)&&lib.filter.targetEnabled2(event.card,player,current); - })){ + gzwushuang: { + shaRelated: true, + audio: "wushuang", + audioname: ["re_lvbu", "shen_lvbu", "lvlingqi"], + forced: true, + locked: true, + group: ["wushuang1", "wushuang2"], + preHidden: ["wushuang1", "wushuang2", "gzwushuang"], + trigger: { player: "useCard1" }, + direct: true, + filter: function (event, player) { + if (event.card.name != "juedou" || !event.card.isCard) return false; + if (event.targets) { + if ( + game.hasPlayer(function (current) { + return ( + !event.targets.includes(current) && + lib.filter.targetEnabled2(event.card, player, current) + ); + }) + ) { return true; } } return false; }, - content:function(){ - 'step 0' - var num=game.countPlayer(function(current){ - return !trigger.targets.includes(current)&&lib.filter.targetEnabled2(trigger.card,player,current); + content: function () { + "step 0"; + var num = game.countPlayer(function (current) { + return ( + !trigger.targets.includes(current) && + lib.filter.targetEnabled2(trigger.card, player, current) + ); }); - player.chooseTarget('无双:是否为'+get.translation(trigger.card)+'增加'+(num>1?'至多两个':'一个')+'目标?',[1,Math.min(2,num)],function(card,player,target){ - var trigger=_status.event.getTrigger(); - var card=trigger.card; - return !trigger.targets.includes(target)&&lib.filter.targetEnabled2(card,player,target); - }).set('ai',function(target){ - var player=_status.event.player; - var card=_status.event.getTrigger().card; - return get.effect(target,card,player,player); - }).setHiddenSkill('gzwushuang'); - 'step 1' - if(result.bool){ - if(player!=game.me&&!player.isOnline()) game.delayx(); - } - else event.finish(); - 'step 2' - var targets=result.targets.sortBySeat(); - player.logSkill('gzwushuang',targets); + player + .chooseTarget( + "无双:是否为" + + get.translation(trigger.card) + + "增加" + + (num > 1 ? "至多两个" : "一个") + + "目标?", + [1, Math.min(2, num)], + function (card, player, target) { + var trigger = _status.event.getTrigger(); + var card = trigger.card; + return ( + !trigger.targets.includes(target) && + lib.filter.targetEnabled2(card, player, target) + ); + } + ) + .set("ai", function (target) { + var player = _status.event.player; + var card = _status.event.getTrigger().card; + return get.effect(target, card, player, player); + }) + .setHiddenSkill("gzwushuang"); + "step 1"; + if (result.bool) { + if (player != game.me && !player.isOnline()) game.delayx(); + } else event.finish(); + "step 2"; + var targets = result.targets.sortBySeat(); + player.logSkill("gzwushuang", targets); trigger.targets.addArray(targets); }, }, //夏侯渊 - gzshensu:{ - audio:'shensu1', - audioname:['xiahouba','re_xiahouyuan','ol_xiahouyuan'], - group:['shensu1','shensu2'], - preHidden:['shensu1','shensu2','gzshensu'], - trigger:{player:'phaseDiscardBegin'}, - direct:true, - filter:function(event,player){ - return player.hp>0; + gzshensu: { + audio: "shensu1", + audioname: ["xiahouba", "re_xiahouyuan", "ol_xiahouyuan"], + group: ["shensu1", "shensu2"], + preHidden: ["shensu1", "shensu2", "gzshensu"], + trigger: { player: "phaseDiscardBegin" }, + direct: true, + filter: function (event, player) { + return player.hp > 0; }, - content:function(){ - 'step 0' - player.chooseTarget(get.prompt('gzshensu'),'失去1点体力并跳过弃牌阶段,视为对一名其他角色使用使用一张无距离限制的【杀】',function(card,player,target){ - return player.canUse('sha',target,false); - }).setHiddenSkill('gzshensu').set('goon',player.needsToDiscard()).set('ai',function(target){ - var player=_status.event.player; - if(!_status.event.goon||player.hp<=target.hp) return false; - return get.effect(target,{name:'sha',isCard:true},player,player); - }); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.logSkill('gzshensu',target); + content: function () { + "step 0"; + player + .chooseTarget( + get.prompt("gzshensu"), + "失去1点体力并跳过弃牌阶段,视为对一名其他角色使用使用一张无距离限制的【杀】", + function (card, player, target) { + return player.canUse("sha", target, false); + } + ) + .setHiddenSkill("gzshensu") + .set("goon", player.needsToDiscard()) + .set("ai", function (target) { + var player = _status.event.player; + if (!_status.event.goon || player.hp <= target.hp) return false; + return get.effect(target, { name: "sha", isCard: true }, player, player); + }); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.logSkill("gzshensu", target); player.loseHp(); trigger.cancel(); - player.useCard({name:'sha',isCard:true},target,false); + player.useCard({ name: "sha", isCard: true }, target, false); } }, }, //吕玲绮 - gzshenwei:{ - audio:'llqshenwei', - mainSkill:true, - init:function(player){ - if(player.checkMainSkill('gzshenwei')){ + gzshenwei: { + audio: "llqshenwei", + mainSkill: true, + init: function (player) { + if (player.checkMainSkill("gzshenwei")) { player.removeMaxHp(); } }, - trigger:{player:'phaseDrawBegin2'}, - forced:true, - filter:(event,player)=>!event.numFixed&&player.isMaxHandcard(), - preHidden:true, - content:function(){ - trigger.num+=2; + trigger: { player: "phaseDrawBegin2" }, + forced: true, + filter: (event, player) => !event.numFixed && player.isMaxHandcard(), + preHidden: true, + content: function () { + trigger.num += 2; }, - mod:{ - maxHandcard:(player,num)=>num+2, + mod: { + maxHandcard: (player, num) => num + 2, }, }, - gzzhuangrong:{ - audio:'zhuangrong', - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return !player.hasSkill('gzwushuang')&&player.hasCard(function(card){ - return get.type2(card,player)=='trick'; - },'h'); + gzzhuangrong: { + audio: "zhuangrong", + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + return ( + !player.hasSkill("gzwushuang") && + player.hasCard(function (card) { + return get.type2(card, player) == "trick"; + }, "h") + ); }, - filterCard:function(card,player){ - return get.type2(card,player)=='trick'; + filterCard: function (card, player) { + return get.type2(card, player) == "trick"; }, - content:function(){ - player.addTempSkill('gzwushuang','phaseUseEnd'); + content: function () { + player.addTempSkill("gzwushuang", "phaseUseEnd"); }, - derivation:'gzwushuang', + derivation: "gzwushuang", }, //荀谌 - gzfenglve:{ - audio:'refenglve', - derivation:'gzfenglve_zongheng', - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return player.countCards('h')>0&&!player.hasSkillTag('noCompareSource')&&game.hasPlayer(function(current){ - return current!=player&¤t.countCards('h')>0&&!current.hasSkillTag('noCompareTarget'); - }); + gzfenglve: { + audio: "refenglve", + derivation: "gzfenglve_zongheng", + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + return ( + player.countCards("h") > 0 && + !player.hasSkillTag("noCompareSource") && + game.hasPlayer(function (current) { + return ( + current != player && + current.countCards("h") > 0 && + !current.hasSkillTag("noCompareTarget") + ); + }) + ); }, - filterTarget:function(card,player,target){ - return target!=player&&target.countCards('h')>0&&!target.hasSkillTag('noCompareTarget'); + filterTarget: function (card, player, target) { + return ( + target != player && + target.countCards("h") > 0 && + !target.hasSkillTag("noCompareTarget") + ); }, - content:function(){ - 'step 0' + content: function () { + "step 0"; player.chooseToCompare(target); - 'step 1' - if(result.bool){ - if(!target.countCards('hej')) event.goto(3); - else{ - event.giver=target; - event.gainner=player; - target.choosePlayerCard(target,true,'hej',2,'交给'+get.translation(player)+'两张牌'); + "step 1"; + if (result.bool) { + if (!target.countCards("hej")) event.goto(3); + else { + event.giver = target; + event.gainner = player; + target.choosePlayerCard( + target, + true, + "hej", + 2, + "交给" + get.translation(player) + "两张牌" + ); } - } - else if(result.tie){ + } else if (result.tie) { event.goto(3); - } - else{ - if(!player.countCards('he')) event.goto(3); - else{ - event.giver=player; - event.gainner=target; - player.chooseCard(true,'he','交给'+get.translation(target)+'一张牌'); + } else { + if (!player.countCards("he")) event.goto(3); + else { + event.giver = player; + event.gainner = target; + player.chooseCard(true, "he", "交给" + get.translation(target) + "一张牌"); } } - 'step 2' - if(result.bool) event.giver.give(result.cards,event.gainner,'giveAuto'); - 'step 3' - if(target.isIn()) player.chooseBool('纵横:是否令'+get.translation(target)+'获得【锋略】?').set('ai',function(){ - var evt=_status.event.getParent(); - return get.attitude(evt.player,evt.target)>0; - }); + "step 2"; + if (result.bool) event.giver.give(result.cards, event.gainner, "giveAuto"); + "step 3"; + if (target.isIn()) + player + .chooseBool("纵横:是否令" + get.translation(target) + "获得【锋略】?") + .set("ai", function () { + var evt = _status.event.getParent(); + return get.attitude(evt.player, evt.target) > 0; + }); else event.finish(); - 'step 4' - if(result.bool){ - target.addTempSkill('gzfenglve_zongheng',{player:'phaseEnd'}); - game.log(player,'发起了','#y纵横',',令',target,'获得了技能','#g【锋略】'); + "step 4"; + if (result.bool) { + target.addTempSkill("gzfenglve_zongheng", { player: "phaseEnd" }); + game.log(player, "发起了", "#y纵横", ",令", target, "获得了技能", "#g【锋略】"); } }, - ai:{ - order:8, - result:{ - target:function(player,target){ - if(!player.hasCard(function(card){ - if(get.position(card)!="h") return false; - var val=get.value(card); - if(val<0) return true; - if(val<=5){ - return card.number>=10; - } - if(val<=6){ - return card.number>=13; - } - return false; - })) return 0; - return -Math.sqrt(1+target.countCards('he'))/(1+target.countCards('j')); + ai: { + order: 8, + result: { + target: function (player, target) { + if ( + !player.hasCard(function (card) { + if (get.position(card) != "h") return false; + var val = get.value(card); + if (val < 0) return true; + if (val <= 5) { + return card.number >= 10; + } + if (val <= 6) { + return card.number >= 13; + } + return false; + }) + ) + return 0; + return -Math.sqrt(1 + target.countCards("he")) / (1 + target.countCards("j")); }, }, }, }, - gzfenglve_zongheng:{ - inherit:'gzfenglve', - content:function(){ - 'step 0' + gzfenglve_zongheng: { + inherit: "gzfenglve", + content: function () { + "step 0"; player.chooseToCompare(target); - 'step 1' - if(result.bool){ - if(!target.countCards('hej')) event.finish(); - else{ - event.giver=target; - event.gainner=player; - target.choosePlayerCard(target,true,'hej','交给'+get.translation(player)+'一张牌'); + "step 1"; + if (result.bool) { + if (!target.countCards("hej")) event.finish(); + else { + event.giver = target; + event.gainner = player; + target.choosePlayerCard( + target, + true, + "hej", + "交给" + get.translation(player) + "一张牌" + ); } - } - else if(result.tie){ + } else if (result.tie) { event.finish(); - } - else{ - if(!player.countCards('he')) event.finish(); - else{ - event.giver=player; - event.gainner=target; - player.chooseCard(true,'he',2,'交给'+get.translation(target)+'两张牌'); + } else { + if (!player.countCards("he")) event.finish(); + else { + event.giver = player; + event.gainner = target; + player.chooseCard(true, "he", 2, "交给" + get.translation(target) + "两张牌"); } } - 'step 2' - if(result.bool) event.giver.give(result.cards,event.gainner,'giveAuto'); + "step 2"; + if (result.bool) event.giver.give(result.cards, event.gainner, "giveAuto"); }, - ai:{ - order:8, - result:{ - target:function(player,target){ - if(!player.hasCard(function(card){ - if(get.position(card)!="h") return false; - var val=get.value(card); - if(val<0) return true; - if(val<=5){ - return card.number>=12; - } - if(val<=6){ - return card.number>=13; - } - return false; - })) return 0; - return -Math.sqrt(1+target.countCards('he'))/(1+target.countCards('j')); + ai: { + order: 8, + result: { + target: function (player, target) { + if ( + !player.hasCard(function (card) { + if (get.position(card) != "h") return false; + var val = get.value(card); + if (val < 0) return true; + if (val <= 5) { + return card.number >= 12; + } + if (val <= 6) { + return card.number >= 13; + } + return false; + }) + ) + return 0; + return -Math.sqrt(1 + target.countCards("he")) / (1 + target.countCards("j")); }, }, }, }, - gzanyong:{ - audio:'anyong', - trigger:{global:'damageBegin1'}, - usable:1, - filter:function(event,player){ - return event.source&&event.player!=event.source&& - event.source.isFriendOf(player)&&event.player.isIn(); + gzanyong: { + audio: "anyong", + trigger: { global: "damageBegin1" }, + usable: 1, + filter: function (event, player) { + return ( + event.source && + event.player != event.source && + event.source.isFriendOf(player) && + event.player.isIn() + ); }, - check:function(event,player){ - if(get.attitude(player,event.player)>0) return false; - if(event.player.hasSkillTag('filterDamage',null,{ - player:event.source, - card:event.card, - })) return false; - if(event.player.isUnseen()) return true; - if(event.player.hp>event.num&&event.player.hp<=event.num*2) return player.hp>1||event.player.isUnseen(2); + check: function (event, player) { + if (get.attitude(player, event.player) > 0) return false; + if ( + event.player.hasSkillTag("filterDamage", null, { + player: event.source, + card: event.card, + }) + ) + return false; + if (event.player.isUnseen()) return true; + if (event.player.hp > event.num && event.player.hp <= event.num * 2) + return player.hp > 1 || event.player.isUnseen(2); return false; }, - logTarget:'player', - preHidden:true, - content:function(){ - trigger.num*=2; - if(!trigger.player.isUnseen(2)){ + logTarget: "player", + preHidden: true, + content: function () { + trigger.num *= 2; + if (!trigger.player.isUnseen(2)) { player.loseHp(); - player.removeSkill('gzanyong'); - } - else if(!trigger.player.isUnseen()){ - player.chooseToDiscard('h',2,true); + player.removeSkill("gzanyong"); + } else if (!trigger.player.isUnseen()) { + player.chooseToDiscard("h", 2, true); } }, }, //周夷 - gzzhukou:{ - audio:'zhukou', - trigger:{source:'damageSource'}, - preHidden:true, - filter:function(event,player){ - if(!player.getHistory('useCard').length) return false; - var evt=event.getParent('phaseUse'); - if(!evt||!evt.player) return false; - return player.getHistory('sourceDamage',function(evtx){ - return evtx.getParent('phaseUse')==evt; - }).indexOf(event)==0; + gzzhukou: { + audio: "zhukou", + trigger: { source: "damageSource" }, + preHidden: true, + filter: function (event, player) { + if (!player.getHistory("useCard").length) return false; + var evt = event.getParent("phaseUse"); + if (!evt || !evt.player) return false; + return ( + player + .getHistory("sourceDamage", function (evtx) { + return evtx.getParent("phaseUse") == evt; + }) + .indexOf(event) == 0 + ); }, - frequent:true, - content:function(){ - player.draw(Math.min(player.getHistory('useCard').length,5)); + frequent: true, + content: function () { + player.draw(Math.min(player.getHistory("useCard").length, 5)); }, }, - gzduannian:{ - audio:2, - trigger:{player:'phaseUseEnd'}, - preHidden:true, - filter:function(event,player){ - return player.countCards('h')>0&&!player.hasCard(function(card){ - return !lib.filter.cardDiscardable(card,player,'gzduannian'); - },'h'); + gzduannian: { + audio: 2, + trigger: { player: "phaseUseEnd" }, + preHidden: true, + filter: function (event, player) { + return ( + player.countCards("h") > 0 && + !player.hasCard(function (card) { + return !lib.filter.cardDiscardable(card, player, "gzduannian"); + }, "h") + ); }, - check:function(event,player){ - return player.countCards('h',function(card){ - return get.value(card)>=6; - })<=Math.max(1,player.countCards('h')/2); + check: function (event, player) { + return ( + player.countCards("h", function (card) { + return get.value(card) >= 6; + }) <= Math.max(1, player.countCards("h") / 2) + ); }, - content:function(){ - 'step 0' - var cards=player.getCards('h',function(card){ - return lib.filter.cardDiscardable(card,player,'gzduannian'); + content: function () { + "step 0"; + var cards = player.getCards("h", function (card) { + return lib.filter.cardDiscardable(card, player, "gzduannian"); }); - if(cards.length){ + if (cards.length) { player.discard(cards); - } - else event.finish(); - 'step 1' - player.drawTo(Math.min(5,player.maxHp)); + } else event.finish(); + "step 1"; + player.drawTo(Math.min(5, player.maxHp)); }, }, - gzlianyou:{ - trigger:{player:'die'}, - direct:true, - forceDie:true, - skillAnimation:true, - animationColor:'fire', - content:function(){ - 'step 0' - player.chooseTarget(lib.filter.notMe,get.prompt('gzlianyou'),'令一名其他角色获得〖兴火〗').set('forceDie',true).set('ai',function(target){ - return 10+(get.attitude(_status.event.player,target)*(target.hasSkillTag('fireAttack',null,null,true)?2:1)); - }); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.logSkill('gzlianyou',target); - target.addSkills('gzxinghuo'); + gzlianyou: { + trigger: { player: "die" }, + direct: true, + forceDie: true, + skillAnimation: true, + animationColor: "fire", + content: function () { + "step 0"; + player + .chooseTarget(lib.filter.notMe, get.prompt("gzlianyou"), "令一名其他角色获得〖兴火〗") + .set("forceDie", true) + .set("ai", function (target) { + return ( + 10 + + get.attitude(_status.event.player, target) * + (target.hasSkillTag("fireAttack", null, null, true) ? 2 : 1) + ); + }); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.logSkill("gzlianyou", target); + target.addSkills("gzxinghuo"); game.delayx(); } }, - derivation:'gzxinghuo', + derivation: "gzxinghuo", }, - gzxinghuo:{ - trigger:{source:'damageBegin1'}, - forced:true, - filter:function(event){ - return event.hasNature('fire'); + gzxinghuo: { + trigger: { source: "damageBegin1" }, + forced: true, + filter: function (event) { + return event.hasNature("fire"); }, - content:function(){ + content: function () { trigger.num++; }, }, //南华老仙 - gzgongxiu:{ - audio:'gongxiu', - trigger:{player:'phaseDrawBegin2'}, - preHidden:true, - filter:function(event,player){ - return !event.numFixed&&event.num>0&&player.maxHp>0; + gzgongxiu: { + audio: "gongxiu", + trigger: { player: "phaseDrawBegin2" }, + preHidden: true, + filter: function (event, player) { + return !event.numFixed && event.num > 0 && player.maxHp > 0; }, - content:function(){ + content: function () { trigger.num--; - player.addTempSkill('gzgongxiu2','phaseDrawAfter'); + player.addTempSkill("gzgongxiu2", "phaseDrawAfter"); }, }, - gzgongxiu2:{ - trigger:{player:'phaseDrawEnd'}, - forced:true, - charlotte:true, - popup:false, - content:function(){ - 'step 0' - var str='令至多'+get.cnNumber(player.maxHp)+'名角色'; - if(typeof player.storage.gzgongxiu!='number'){ - player.chooseControl().set('choiceList',[ - str+'各摸一张牌', - str+'各弃置一张牌', - ]); - } - else event._result={index:1-player.storage.gzgongxiu}; - 'step 1' - var num=result.index; - event.index=num; - player.storage.gzgongxiu=num; - player.chooseTarget(true,[1,player.maxHp],'选择至多'+get.cnNumber(player.maxHp)+'名角色各'+(num?'弃置':'摸')+'一张牌').set('goon',event.index?-1:1).set('ai',function(target){ - var evt=_status.event; - return evt.goon*get.attitude(evt.player,target); - }); - 'step 2' - if(result.bool){ - var targets=result.targets.sortBySeat(); - player.line(targets,'green'); - if(event.index==0) game.asyncDraw(targets); - else{ - for(var i of targets) i.chooseToDiscard('he',true); + gzgongxiu2: { + trigger: { player: "phaseDrawEnd" }, + forced: true, + charlotte: true, + popup: false, + content: function () { + "step 0"; + var str = "令至多" + get.cnNumber(player.maxHp) + "名角色"; + if (typeof player.storage.gzgongxiu != "number") { + player.chooseControl().set("choiceList", [str + "各摸一张牌", str + "各弃置一张牌"]); + } else event._result = { index: 1 - player.storage.gzgongxiu }; + "step 1"; + var num = result.index; + event.index = num; + player.storage.gzgongxiu = num; + player + .chooseTarget( + true, + [1, player.maxHp], + "选择至多" + + get.cnNumber(player.maxHp) + + "名角色各" + + (num ? "弃置" : "摸") + + "一张牌" + ) + .set("goon", event.index ? -1 : 1) + .set("ai", function (target) { + var evt = _status.event; + return evt.goon * get.attitude(evt.player, target); + }); + "step 2"; + if (result.bool) { + var targets = result.targets.sortBySeat(); + player.line(targets, "green"); + if (event.index == 0) game.asyncDraw(targets); + else { + for (var i of targets) i.chooseToDiscard("he", true); event.finish(); } } - 'step 3' + "step 3"; game.delayx(); }, }, - gzjinghe:{ - audio:'jinghe', - enable:'phaseUse', - filter:function(event,player){ - return player.maxHp>0&&player.countCards('h')>0&&!player.hasSkill('gzjinghe_clear'); + gzjinghe: { + audio: "jinghe", + enable: "phaseUse", + filter: function (event, player) { + return ( + player.maxHp > 0 && player.countCards("h") > 0 && !player.hasSkill("gzjinghe_clear") + ); }, - selectCard:function(){ - var max=_status.event.player.maxHp; - if(ui.selected.targets.length) return [ui.selected.targets.length,max]; - return [1,max]; + selectCard: function () { + var max = _status.event.player.maxHp; + if (ui.selected.targets.length) return [ui.selected.targets.length, max]; + return [1, max]; }, - selectTarget:function(){ + selectTarget: function () { return ui.selected.cards.length; }, - filterTarget:function(card,player,target){ + filterTarget: function (card, player, target) { return !target.isUnseen(); }, - filterCard:function(card){ - if(ui.selected.cards.length){ - var name=get.name(card); - for(var i of ui.selected.cards){ - if(get.name(i)==name) return false; + filterCard: function (card) { + if (ui.selected.cards.length) { + var name = get.name(card); + for (var i of ui.selected.cards) { + if (get.name(i) == name) return false; } } return true; }, - position:'h', - check:function(card){ - var player=_status.event.player; - if(game.countPlayer(function(current){ - return get.attitude(player,current)>0&&!current.isUnseen(); - })>ui.selected.cards.length) return get.position(card)=='e'?2:1; + position: "h", + check: function (card) { + var player = _status.event.player; + if ( + game.countPlayer(function (current) { + return get.attitude(player, current) > 0 && !current.isUnseen(); + }) > ui.selected.cards.length + ) + return get.position(card) == "e" ? 2 : 1; return 0; }, - complexCard:true, - discard:false, - lose:false, - delay:false, - multitarget:true, - multiline:true, - content:function(){ - 'step 0' - player.showCards(cards,get.translation(player)+'发动了【经合】'); - event.skills=lib.skill.gzjinghe.derivation.randomGets(targets.length); - player.addTempSkill('gzjinghe_clear',{player:'phaseBegin'}); + complexCard: true, + discard: false, + lose: false, + delay: false, + multitarget: true, + multiline: true, + content: function () { + "step 0"; + player.showCards(cards, get.translation(player) + "发动了【经合】"); + event.skills = lib.skill.gzjinghe.derivation.randomGets(targets.length); + player.addTempSkill("gzjinghe_clear", { player: "phaseBegin" }); event.targets.sortBySeat(); - event.num=0; - 'step 1' - event.target=targets[num]; + event.num = 0; + "step 1"; + event.target = targets[num]; event.num++; - event.target.chooseControl(event.skills,'cancel2').set('choiceList',event.skills.map(function(i){ - return '
    【'+get.translation(lib.translate[i+'_ab']||get.translation(i).slice(0,2))+'】
    '+get.skillInfoTranslation(i,player)+'
    '; - })).set('displayIndex',false).set('prompt','选择获得一个技能'); - 'step 2' - var skill=result.control; - if(skill!='cancel2'){ + event.target + .chooseControl(event.skills, "cancel2") + .set( + "choiceList", + event.skills.map(function (i) { + return ( + '
    【' + + get.translation( + lib.translate[i + "_ab"] || get.translation(i).slice(0, 2) + ) + + "】
    " + + get.skillInfoTranslation(i, player) + + "
    " + ); + }) + ) + .set("displayIndex", false) + .set("prompt", "选择获得一个技能"); + "step 2"; + var skill = result.control; + if (skill != "cancel2") { event.skills.remove(skill); - target.addAdditionalSkills('gzjinghe_'+player.playerid,skill); + target.addAdditionalSkills("gzjinghe_" + player.playerid, skill); target.popup(skill); } - if(event.num0&&player.countCards('he')>0; + group: "gzshilu_zhiheng", + subSkill: { + zhiheng: { + audio: "gzshilu", + trigger: { player: "phaseZhunbeiBegin" }, + filter: function (event, player) { + return player.getStorage("gzshilu").length > 0 && player.countCards("he") > 0; }, - direct:true, - content:function(){ - 'step 0' - var num=Math.min(player.getStorage('gzshilu').length,player.countCards('he')); - player.chooseToDiscard('he',get.prompt('gzshilu'),'弃置至多'+get.cnNumber(num)+'张牌并摸等量的牌',[1,num]).logSkill='gzshilu'; - 'step 1' - if(result.bool&&result.cards&&result.cards.length) player.draw(result.cards.length); + direct: true, + content: function () { + "step 0"; + var num = Math.min(player.getStorage("gzshilu").length, player.countCards("he")); + player.chooseToDiscard( + "he", + get.prompt("gzshilu"), + "弃置至多" + get.cnNumber(num) + "张牌并摸等量的牌", + [1, num] + ).logSkill = "gzshilu"; + "step 1"; + if (result.bool && result.cards && result.cards.length) + player.draw(result.cards.length); }, }, }, }, - gzxiongnve:{ - audio:2, - trigger:{player:'phaseUseBegin'}, - direct:true, - filter:function(event,player){ - return player.getStorage('gzshilu').length>0; + gzxiongnve: { + audio: 2, + trigger: { player: "phaseUseBegin" }, + direct: true, + filter: function (event, player) { + return player.getStorage("gzshilu").length > 0; }, - content:function(){ - 'step 0' - player.chooseButton([get.prompt('gzxiongnve'),[player.storage.gzshilu,'character']]).set('ai',function(button){ - if(!_status.event.goon) return 0; - var name=button.link,group=get.is.double(name,true); - if(!group) group=[lib.character[name][1]]; - for(var i of group){ - if(game.hasPlayer(function(current){ - return player.inRange(current)&¤t.identity==i; - })) return 1+Math.random(); - } - return 0; - }).set('goon',player.countCards('hs',function(card){ - return get.tag(card,'damage')&&player.hasValueTarget(card); - })>1); - 'step 1' - if(result.bool){ - player.logSkill('gzxiongnve'); - lib.skill.gzxiongnve.throwCharacter(player,result.links); - game.delayx(); - var group=get.is.double(result.links[0],true); - if(!group) group=[lib.character[result.links[0]][1]]; - event.group=group; - var str=get.translation(group); - player.chooseControl().set('prompt','选择获得一项效果').set('choiceList',[ - '本回合对'+str+'势力的角色造成的伤害+1', - '本回合对'+str+'势力的角色造成伤害后,获得对方的一张牌', - '本回合对'+str+'势力的角色使用牌没有次数限制', - ]).set('ai',function(){ - var player=_status.event.player; - if(player.countCards('hs',function(card){ - return get.name(card)=='sha'&&player.hasValueTarget(card); - })>player.getCardUsable('sha')) return 0; - return get.rand(1,2); - }); - } - else event.finish(); - 'step 2' - var skill='gzxiongnve_effect'+result.index; - player.markAuto(skill,event.group); - player.addTempSkill(skill); - game.log(player,'本回合对'+get.translation(event.group)+'势力的角色','#g'+lib.skill[skill].promptx) - }, - group:'gzxiongnve_end', - throwCharacter:function(player,list){ - player.unmarkAuto('gzshilu',list); - _status.characterlist.addArray(list); - game.log(player,'从','#y“戮”','中移去了','#g'+get.translation(list)); - game.broadcastAll(function(player,list){ - var cards=[]; - for(var i=0;i 1 + ); + "step 1"; + if (result.bool) { + player.logSkill("gzxiongnve"); + lib.skill.gzxiongnve.throwCharacter(player, result.links); + game.delayx(); + var group = get.is.double(result.links[0], true); + if (!group) group = [lib.character[result.links[0]][1]]; + event.group = group; + var str = get.translation(group); + player + .chooseControl() + .set("prompt", "选择获得一项效果") + .set("choiceList", [ + "本回合对" + str + "势力的角色造成的伤害+1", + "本回合对" + str + "势力的角色造成伤害后,获得对方的一张牌", + "本回合对" + str + "势力的角色使用牌没有次数限制", + ]) + .set("ai", function () { + var player = _status.event.player; + if ( + player.countCards("hs", function (card) { + return get.name(card) == "sha" && player.hasValueTarget(card); + }) > player.getCardUsable("sha") + ) + return 0; + return get.rand(1, 2); + }); + } else event.finish(); + "step 2"; + var skill = "gzxiongnve_effect" + result.index; + player.markAuto(skill, event.group); + player.addTempSkill(skill); + game.log( + player, + "本回合对" + get.translation(event.group) + "势力的角色", + "#g" + lib.skill[skill].promptx + ); }, - subSkill:{ - effect0:{ - promptx:'造成的伤害+1', - charlotte:true, - onremove:true, - audio:'gzxiongnve', - intro:{ - content:'对$势力的角色造成的伤害+1', + group: "gzxiongnve_end", + throwCharacter: function (player, list) { + player.unmarkAuto("gzshilu", list); + _status.characterlist.addArray(list); + game.log(player, "从", "#y“戮”", "中移去了", "#g" + get.translation(list)); + game.broadcastAll( + function (player, list) { + var cards = []; + for (var i = 0; i < list.length; i++) { + var cardname = "huashen_card_" + list[i]; + lib.card[cardname] = { + fullimage: true, + image: "character:" + list[i], + }; + lib.translate[cardname] = get.rawName2(list[i]); + cards.push(game.createCard(cardname, "", "")); + } + player.$throw(cards, 1000, "nobroadcast"); }, - trigger:{source:'damageBegin1'}, - forced:true, - filter:function(event,player){ - return player.getStorage('gzxiongnve_effect0').includes(event.player.identity); + player, + list + ); + }, + subSkill: { + effect0: { + promptx: "造成的伤害+1", + charlotte: true, + onremove: true, + audio: "gzxiongnve", + intro: { + content: "对$势力的角色造成的伤害+1", }, - logTarget:'player', - content:function(){ + trigger: { source: "damageBegin1" }, + forced: true, + filter: function (event, player) { + return player.getStorage("gzxiongnve_effect0").includes(event.player.identity); + }, + logTarget: "player", + content: function () { trigger.num++; }, }, - effect1:{ - promptx:'造成伤害后,获得对方的一张牌', - charlotte:true, - onremove:true, - audio:'gzxiongnve', - intro:{ - content:'对$势力的角色造成伤害后,获得对方的一张牌', + effect1: { + promptx: "造成伤害后,获得对方的一张牌", + charlotte: true, + onremove: true, + audio: "gzxiongnve", + intro: { + content: "对$势力的角色造成伤害后,获得对方的一张牌", }, - trigger:{source:'damageEnd'}, - forced:true, - filter:function(event,player){ - return player.getStorage('gzxiongnve_effect1').includes(event.player.identity)&&event.player.countGainableCards(player,'he')>0; + trigger: { source: "damageEnd" }, + forced: true, + filter: function (event, player) { + return ( + player.getStorage("gzxiongnve_effect1").includes(event.player.identity) && + event.player.countGainableCards(player, "he") > 0 + ); + }, + logTarget: "player", + content: function () { + player.gainPlayerCard(trigger.player, true, "he"); }, - logTarget:'player', - content:function(){ - player.gainPlayerCard(trigger.player,true,'he'); - } }, - effect2:{ - promptx:'使用牌没有次数限制', - charlotte:true, - onremove:true, - intro:{ - content:'对$势力的角色使用牌没有次数限制', + effect2: { + promptx: "使用牌没有次数限制", + charlotte: true, + onremove: true, + intro: { + content: "对$势力的角色使用牌没有次数限制", }, - mod:{ - cardUsableTarget:function(card,player,target){ - if(player.getStorage('gzxiongnve_effect2').includes(target.identity)) return true; + mod: { + cardUsableTarget: function (card, player, target) { + if (player.getStorage("gzxiongnve_effect2").includes(target.identity)) + return true; }, }, }, - effect3:{ - charlotte:true, - audio:'gzxiongnve', - mark:true, - intro:{ - content:'其他角色对你造成伤害时,此伤害-1', + effect3: { + charlotte: true, + audio: "gzxiongnve", + mark: true, + intro: { + content: "其他角色对你造成伤害时,此伤害-1", }, - trigger:{player:'damageBegin3'}, - filter:function(event,player){ - return event.source&&event.source!=player; + trigger: { player: "damageBegin3" }, + filter: function (event, player) { + return event.source && event.source != player; }, - forced:true, - logTarget:'source', - content:function(){ + forced: true, + logTarget: "source", + content: function () { trigger.num--; }, - ai:{ - effect:{ - target:function(card,player,target){ - if(target==player) return; - if(player.hasSkillTag('jueqing',false,target)) return; - var num=get.tag(card,'damage'); - if(num){ - if(num>1) return 0.5; + ai: { + effect: { + target: function (card, player, target) { + if (target == player) return; + if (player.hasSkillTag("jueqing", false, target)) return; + var num = get.tag(card, "damage"); + if (num) { + if (num > 1) return 0.5; return 0; } }, }, }, }, - end:{ - trigger:{player:'phaseUseEnd'}, - direct:true, - filter:function(event,player){ - return player.getStorage('gzshilu').length>1; + end: { + trigger: { player: "phaseUseEnd" }, + direct: true, + filter: function (event, player) { + return player.getStorage("gzshilu").length > 1; }, - content:function(){ - 'step 0' - player.chooseButton(['是否移去两张“戮”获得减伤?',[player.storage.gzshilu,'character']],2).set('ai',function(button){ - var name=button.link,group=get.is.double(name,true); - if(!group) group=[lib.character[name][1]]; - for(var i of group){ - if(game.hasPlayer(function(current){ - return current.identity==i; - })) return 0; - } - return 1; - }); - 'step 1' - if(result.bool){ - player.logSkill('gzxiongnve'); - lib.skill.gzxiongnve.throwCharacter(player,result.links); - player.addTempSkill('gzxiongnve_effect3',{player:'phaseBegin'}); + content: function () { + "step 0"; + player + .chooseButton( + ["是否移去两张“戮”获得减伤?", [player.storage.gzshilu, "character"]], + 2 + ) + .set("ai", function (button) { + var name = button.link, + group = get.is.double(name, true); + if (!group) group = [lib.character[name][1]]; + for (var i of group) { + if ( + game.hasPlayer(function (current) { + return current.identity == i; + }) + ) + return 0; + } + return 1; + }); + "step 1"; + if (result.bool) { + player.logSkill("gzxiongnve"); + lib.skill.gzxiongnve.throwCharacter(player, result.links); + player.addTempSkill("gzxiongnve_effect3", { player: "phaseBegin" }); game.delayx(); } }, @@ -8004,295 +10812,355 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, //邓芝 - gzjianliang:{ - audio:2, - trigger:{player:'phaseDrawBegin2'}, - frequent:true, - preHidden:true, - filter:function(event,player){ + gzjianliang: { + audio: 2, + trigger: { player: "phaseDrawBegin2" }, + frequent: true, + preHidden: true, + filter: function (event, player) { return player.isMinHandcard(); }, - logTarget:function(event,player){ + logTarget: function (event, player) { var isFriend; - if(player.identity=='unknown'){ - var group='shu'; - if(!player.wontYe('shu')) group=null; - isFriend=function(current){ - return current==player||current.identity==group; - } - } - else isFriend=function(target){ - return target.isFriendOf(player); - }; + if (player.identity == "unknown") { + var group = "shu"; + if (!player.wontYe("shu")) group = null; + isFriend = function (current) { + return current == player || current.identity == group; + }; + } else + isFriend = function (target) { + return target.isFriendOf(player); + }; return game.filterPlayer(isFriend); }, - content:function(){ - 'step 0' - var list=game.filterPlayer(function(current){ + content: function () { + "step 0"; + var list = game.filterPlayer(function (current) { return current.isFriendOf(player); }); - if(list.length==1){ + if (list.length == 1) { list[0].draw(); event.finish(); - } - else game.asyncDraw(list); - 'step 1' + } else game.asyncDraw(list); + "step 1"; game.delayx(); }, }, - gzweimeng:{ - audio:2, - enable:'phaseUse', - usable:1, - filterTarget:function(card,player,target){ - return target!=player&&target.countGainableCards(player,'h')>0; + gzweimeng: { + audio: 2, + enable: "phaseUse", + usable: 1, + filterTarget: function (card, player, target) { + return target != player && target.countGainableCards(player, "h") > 0; }, - content:function(){ - 'step 0' - player.gainPlayerCard(target,'h',true,event.name=='gzweimeng'?[1,player.hp]:1); - 'step 1' - if(result.bool&&target.isIn()){ - var num=result.cards.length,hs=player.getCards('he'); - if(!hs.length) event.goto(3); - else if(hs.length<=num) event._result={bool:true,cards:hs}; - else player.chooseCard('he',true,'选择交给'+get.translation(target)+get.cnNumber(num)+'张牌',num); - } - else event.goto(3); - 'step 2' - player.give(result.cards,target); - 'step 3' - if(target.isIn()&&event.name=='gzweimeng') player.chooseBool('纵横:是否令'+get.translation(target)+'获得【危盟】?').set('ai',function(){ - var evt=_status.event.getParent(); - return get.attitude(evt.player,evt.target)>0; - }); + content: function () { + "step 0"; + player.gainPlayerCard(target, "h", true, event.name == "gzweimeng" ? [1, player.hp] : 1); + "step 1"; + if (result.bool && target.isIn()) { + var num = result.cards.length, + hs = player.getCards("he"); + if (!hs.length) event.goto(3); + else if (hs.length <= num) event._result = { bool: true, cards: hs }; + else + player.chooseCard( + "he", + true, + "选择交给" + get.translation(target) + get.cnNumber(num) + "张牌", + num + ); + } else event.goto(3); + "step 2"; + player.give(result.cards, target); + "step 3"; + if (target.isIn() && event.name == "gzweimeng") + player + .chooseBool("纵横:是否令" + get.translation(target) + "获得【危盟】?") + .set("ai", function () { + var evt = _status.event.getParent(); + return get.attitude(evt.player, evt.target) > 0; + }); else event.finish(); - 'step 4' - if(result.bool){ - target.addTempSkill('gzweimeng_zongheng',{player:'phaseEnd'}); - game.log(player,'发起了','#y纵横',',令',target,'获得了技能','#g【危盟】'); + "step 4"; + if (result.bool) { + target.addTempSkill("gzweimeng_zongheng", { player: "phaseEnd" }); + game.log(player, "发起了", "#y纵横", ",令", target, "获得了技能", "#g【危盟】"); } }, - derivation:'gzweimeng_zongheng', - subSkill:{ - zongheng:{ - inherit:'gzweimeng', - ai:{ - order:6, - tag:{ - lose:1, - loseCard:1, - gain:1, + derivation: "gzweimeng_zongheng", + subSkill: { + zongheng: { + inherit: "gzweimeng", + ai: { + order: 6, + tag: { + lose: 1, + loseCard: 1, + gain: 1, }, - result:{ - target:-1, + result: { + target: -1, }, }, }, }, - ai:{ - order:6, - tag:{ - lose:1, - loseCard:1, - gain:1, + ai: { + order: 6, + tag: { + lose: 1, + loseCard: 1, + gain: 1, }, - result:{ - target:function(player,target){ - return -Math.pow(Math.min(player.hp,target.countCards('h')),2)/4; + result: { + target: function (player, target) { + return -Math.pow(Math.min(player.hp, target.countCards("h")), 2) / 4; }, }, }, }, //邹氏 - huoshui:{ - audio:2, - forced:true, - global:'huoshui_mingzhi', - trigger:{player:'useCardToTargeted'}, - preHidden:true, - filter:function(event,player){ - return (event.card.name=='sha'||event.card.name=='wanjian')&&event.target.isUnseen(2)&&event.target.isEnemyOf(player); + huoshui: { + audio: 2, + forced: true, + global: "huoshui_mingzhi", + trigger: { player: "useCardToTargeted" }, + preHidden: true, + filter: function (event, player) { + return ( + (event.card.name == "sha" || event.card.name == "wanjian") && + event.target.isUnseen(2) && + event.target.isEnemyOf(player) + ); }, - logTarget:'target', - content:function(){ - var target=trigger.target; - target.addTempSkill('huoshui_norespond'); - target.markAuto('huoshui_norespond',[trigger.card]); + logTarget: "target", + content: function () { + var target = trigger.target; + target.addTempSkill("huoshui_norespond"); + target.markAuto("huoshui_norespond", [trigger.card]); }, }, - huoshui_norespond:{ - charlotte:true, - trigger:{global:'useCardEnd'}, - onremove:true, - forced:true, - popup:false, - silent:true, - firstDo:true, - filter:function(event,player){ - return player.getStorage('huoshui_norespond').includes(event.card); + huoshui_norespond: { + charlotte: true, + trigger: { global: "useCardEnd" }, + onremove: true, + forced: true, + popup: false, + silent: true, + firstDo: true, + filter: function (event, player) { + return player.getStorage("huoshui_norespond").includes(event.card); }, - content:function(){ - player.unmarkAuto('huoshui_norespond',[trigger.card]); - if(!player.storage.huoshui_norespond.length) player.removeSkill('huoshui_norespond'); + content: function () { + player.unmarkAuto("huoshui_norespond", [trigger.card]); + if (!player.storage.huoshui_norespond.length) player.removeSkill("huoshui_norespond"); }, - mod:{ - cardEnabled:function(card){ - if(card.name=='shan') return false; + mod: { + cardEnabled: function (card) { + if (card.name == "shan") return false; }, - cardRespondable:function(card){ - if(card.name=='shan') return false; + cardRespondable: function (card) { + if (card.name == "shan") return false; }, }, }, - huoshui_mingzhi:{ - ai:{ - nomingzhi:true, - skillTagFilter:function(player){ - if(_status.currentPhase&&_status.currentPhase!=player&&_status.currentPhase.hasSkill('huoshui')){ + huoshui_mingzhi: { + ai: { + nomingzhi: true, + skillTagFilter: function (player) { + if ( + _status.currentPhase && + _status.currentPhase != player && + _status.currentPhase.hasSkill("huoshui") + ) { return true; } return false; - } - } - }, - qingcheng:{ - audio:2, - }, - qingcheng_ai:{ - ai:{ - effect:{ - target:function(card){ - if(get.tag(card,'damage')) return 2; - } - } - } - }, - //朱灵 - gzjuejue:{ - audio:2, - trigger:{player:'phaseDiscardBegin'}, - check:function(event,player){ - return player.hp>2&&player.needsToDiscard()>0&&game.countPlayer(function(current){ - return get.attitude(current,player)<=0; - })>game.countPlayer()/2; + }, }, - preHidden:true, - content:function(){ - player.addTempSkill('gzjuejue_effect'); - player.loseHp(); - }, - subSkill:{ - effect:{ - trigger:{player:'phaseDiscardAfter'}, - forced:true, - charlotte:true, - popup:false, - filter:function(event,player){ - return player.getHistory('lose',function(evt){ - return evt.type=='discard'&&evt.cards2&&evt.cards2.length>0&&evt.getParent('phaseDiscard')==event; - }).length>0; - }, - content:function(){ - 'step 0' - var num=0; - player.getHistory('lose',function(evt){ - if(evt.type=='discard'&&evt.getParent('phaseDiscard')==trigger) num+=evt.cards2.length; - }); - event.num=num; - event.targets=game.filterPlayer(function(current){ - return current!=player; - }).sortBySeat(); - player.line(event.targets,'green'); - 'step 1' - var target=targets.shift(); - event.target=target; - if(target.isIn()){ - target.addTempClass('target'); - target.chooseCard('h',num,'将'+get.cnNumber(num)+'张牌置入弃牌堆,或受到1点伤害').set('ai',function(card){ - var evt=_status.event.getParent(); - if(get.damageEffect(evt.target,evt.player,evt.target)>=0) return 0; - return (8/Math.sqrt(evt.num)+evt.target.getDamagedHp())-get.value(card); - }); - } - else if(targets.length) event.redo(); - else event.finish(); - 'step 2' - if(result.bool){ - target.lose(result.cards,ui.discardPile,'visible'); - target.$throw(result.cards,1000); - game.log(target,'将',result.cards,'置入了弃牌堆'); - } - else target.damage(); - 'step 3' - game.delayx(); - if(targets.length) event.goto(1); + }, + qingcheng: { + audio: 2, + }, + qingcheng_ai: { + ai: { + effect: { + target: function (card) { + if (get.tag(card, "damage")) return 2; }, }, }, - ai:{ - noDieAfter2:true, - skillTagFilter:function(player,tag,target){ + }, + //朱灵 + gzjuejue: { + audio: 2, + trigger: { player: "phaseDiscardBegin" }, + check: function (event, player) { + return ( + player.hp > 2 && + player.needsToDiscard() > 0 && + game.countPlayer(function (current) { + return get.attitude(current, player) <= 0; + }) > + game.countPlayer() / 2 + ); + }, + preHidden: true, + content: function () { + player.addTempSkill("gzjuejue_effect"); + player.loseHp(); + }, + subSkill: { + effect: { + trigger: { player: "phaseDiscardAfter" }, + forced: true, + charlotte: true, + popup: false, + filter: function (event, player) { + return ( + player.getHistory("lose", function (evt) { + return ( + evt.type == "discard" && + evt.cards2 && + evt.cards2.length > 0 && + evt.getParent("phaseDiscard") == event + ); + }).length > 0 + ); + }, + content: function () { + "step 0"; + var num = 0; + player.getHistory("lose", function (evt) { + if (evt.type == "discard" && evt.getParent("phaseDiscard") == trigger) + num += evt.cards2.length; + }); + event.num = num; + event.targets = game + .filterPlayer(function (current) { + return current != player; + }) + .sortBySeat(); + player.line(event.targets, "green"); + "step 1"; + var target = targets.shift(); + event.target = target; + if (target.isIn()) { + target.addTempClass("target"); + target + .chooseCard( + "h", + num, + "将" + get.cnNumber(num) + "张牌置入弃牌堆,或受到1点伤害" + ) + .set("ai", function (card) { + var evt = _status.event.getParent(); + if (get.damageEffect(evt.target, evt.player, evt.target) >= 0) + return 0; + return ( + 8 / Math.sqrt(evt.num) + + evt.target.getDamagedHp() - + get.value(card) + ); + }); + } else if (targets.length) event.redo(); + else event.finish(); + "step 2"; + if (result.bool) { + target.lose(result.cards, ui.discardPile, "visible"); + target.$throw(result.cards, 1000); + game.log(target, "将", result.cards, "置入了弃牌堆"); + } else target.damage(); + "step 3"; + game.delayx(); + if (targets.length) event.goto(1); + }, + }, + }, + ai: { + noDieAfter2: true, + skillTagFilter: function (player, tag, target) { return target.isFriendOf(player); }, }, }, - gzfangyuan:{ - audio:2, - trigger:{player:'phaseJieshuBegin'}, - zhenfa:'siege', - direct:true, - locked:true, - filter:function(event,player){ - return game.countPlayer()>4&&game.hasPlayer(function(current){ - return player.sieged(current)&&player.canUse('sha',current,false); - }); + gzfangyuan: { + audio: 2, + trigger: { player: "phaseJieshuBegin" }, + zhenfa: "siege", + direct: true, + locked: true, + filter: function (event, player) { + return ( + game.countPlayer() > 4 && + game.hasPlayer(function (current) { + return player.sieged(current) && player.canUse("sha", current, false); + }) + ); }, - preHidden:true, - content:function(){ - 'step 0' - var list=game.filterPlayer(function(current){ - return player.sieged(current)&&player.canUse('sha',current,false); + preHidden: true, + content: function () { + "step 0"; + var list = game.filterPlayer(function (current) { + return player.sieged(current) && player.canUse("sha", current, false); }); - if(player.hasSkill('gzfangyuan')){ - if(list.length==1) event._result={bool:true,targets:list}; - else player.chooseTarget('方圆:视为对一名围攻你的角色使用【杀】',function(card,player,target){ - return _status.event.list.includes(target); - },true).set('list',list).set('ai',function(target){ - var player=_status.event.player; - return get.effect(target,{name:'sha',isCard:true},player,player); - }).setHiddenSkill('gzfangyuan'); + if (player.hasSkill("gzfangyuan")) { + if (list.length == 1) event._result = { bool: true, targets: list }; + else + player + .chooseTarget( + "方圆:视为对一名围攻你的角色使用【杀】", + function (card, player, target) { + return _status.event.list.includes(target); + }, + true + ) + .set("list", list) + .set("ai", function (target) { + var player = _status.event.player; + return get.effect(target, { name: "sha", isCard: true }, player, player); + }) + .setHiddenSkill("gzfangyuan"); + } else { + player + .chooseTarget( + get.prompt("gzfangyuan"), + "视为对一名围攻你的角色使用【杀】", + function (card, player, target) { + return _status.event.list.includes(target); + } + ) + .set("list", list) + .set("ai", function (target) { + var player = _status.event.player; + return get.effect(target, { name: "sha", isCard: true }, player, player); + }); } - else{ - player.chooseTarget(get.prompt('gzfangyuan'),'视为对一名围攻你的角色使用【杀】',function(card,player,target){ - return _status.event.list.includes(target); - }).set('list',list).set('ai',function(target){ - var player=_status.event.player; - return get.effect(target,{name:'sha',isCard:true},player,player); - }); - } - 'step 1' - if(result.bool){ - player.useCard({name:'sha',isCard:true},result.targets[0],'gzfangyuan',false); + "step 1"; + if (result.bool) { + player.useCard({ name: "sha", isCard: true }, result.targets[0], "gzfangyuan", false); } }, - global:'gzfangyuan_siege', - subSkill:{ - siege:{ - mod:{ - maxHandcard:function(player,num){ - if(game.countPlayer()<4) return; - var next=player.getNext(),prev=player.getPrevious(),siege=[]; - if(player.siege(next)) siege.push(next.getNext()); - if(player.siege(prev)) siege.push(prev.getPrevious()); - if(siege.length){ + global: "gzfangyuan_siege", + subSkill: { + siege: { + mod: { + maxHandcard: function (player, num) { + if (game.countPlayer() < 4) return; + var next = player.getNext(), + prev = player.getPrevious(), + siege = []; + if (player.siege(next)) siege.push(next.getNext()); + if (player.siege(prev)) siege.push(prev.getPrevious()); + if (siege.length) { siege.push(player); - num+=siege.filter(function(source){ - return source.hasSkill('gzfangyuan'); + num += siege.filter(function (source) { + return source.hasSkill("gzfangyuan"); }).length; } - if(player.sieged()){ - if(next.hasSkill('gzfangyuan')) num--; - if(prev.hasSkill('gzfangyuan')) num--; + if (player.sieged()) { + if (next.hasSkill("gzfangyuan")) num--; + if (prev.hasSkill("gzfangyuan")) num--; } return num; }, @@ -8301,199 +11169,251 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, //彭羕 - daming:{ - audio:2, - trigger:{global:'phaseUseBegin'}, - direct:true, - preHidden:true, - filter:function(event,player){ - if(!player.isFriendOf(event.player)||!game.hasPlayer(function(current){ - return !current.isLinked(); - })) return false; - if(_status.connectMode&&player.hasSkill('daming')) return player.countCards('h')>0; - return player.countCards('h',function(card){ - return get.type2(card,player)=='trick'; + daming: { + audio: 2, + trigger: { global: "phaseUseBegin" }, + direct: true, + preHidden: true, + filter: function (event, player) { + if ( + !player.isFriendOf(event.player) || + !game.hasPlayer(function (current) { + return !current.isLinked(); + }) + ) + return false; + if (_status.connectMode && player.hasSkill("daming")) return player.countCards("h") > 0; + return player.countCards("h", function (card) { + return get.type2(card, player) == "trick"; }); }, - content:function(){ - 'step 0' - player.chooseCardTarget({ - prompt:get.prompt('daming'), - prompt2:'弃置一张锦囊牌并选择要横置的角色', - filterCard:function(card,player){ - return get.type2(card,player)=='trick'&&lib.filter.cardDiscardable(card,player,'daming'); - }, - filterTarget:function(card,player,target){ - return !target.isLinked(); - }, - goon:function(){ - var target=trigger.player; - if(get.recoverEffect(target,player,player)>0) return true; - var card={name:'sha',nature:'thunder',isCard:true}; - if(game.hasPlayer(function(current){ - return current!=player&¤t!=target&&target.canUse(card,current,false)&&get.effect(current,card,target,player)>0; - })) return true; - return false; - }(), - ai1:function(card){ - if(_status.event.goon) return 7-get.value(card); - return 0; - }, - ai2:function(target){ - var player=_status.event.player; - return ((target.identity!='unknown'&&!game.hasPlayer(function(current){ - return current!=target&¤t.isFriendOf(target)&¤t.isLinked(); - }))?3:1)*(-get.attitude(target,player,player)+1); - }, - }).setHiddenSkill('daming'); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - event.target=target; - player.logSkill('daming',target); + content: function () { + "step 0"; + player + .chooseCardTarget({ + prompt: get.prompt("daming"), + prompt2: "弃置一张锦囊牌并选择要横置的角色", + filterCard: function (card, player) { + return ( + get.type2(card, player) == "trick" && + lib.filter.cardDiscardable(card, player, "daming") + ); + }, + filterTarget: function (card, player, target) { + return !target.isLinked(); + }, + goon: (function () { + var target = trigger.player; + if (get.recoverEffect(target, player, player) > 0) return true; + var card = { name: "sha", nature: "thunder", isCard: true }; + if ( + game.hasPlayer(function (current) { + return ( + current != player && + current != target && + target.canUse(card, current, false) && + get.effect(current, card, target, player) > 0 + ); + }) + ) + return true; + return false; + })(), + ai1: function (card) { + if (_status.event.goon) return 7 - get.value(card); + return 0; + }, + ai2: function (target) { + var player = _status.event.player; + return ( + (target.identity != "unknown" && + !game.hasPlayer(function (current) { + return ( + current != target && + current.isFriendOf(target) && + current.isLinked() + ); + }) + ? 3 + : 1) * + (-get.attitude(target, player, player) + 1) + ); + }, + }) + .setHiddenSkill("daming"); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + event.target = target; + player.logSkill("daming", target); player.discard(result.cards); - } - else event.finish(); - 'step 2' - if(!target.isLinked()) target.link(); - 'step 3' - var map={},sides=[],pmap=_status.connectMode?lib.playerOL:game.playerMap,player; - for(var i of game.players){ - if(i.identity=='unknown') continue; - var added=false; - for(var j of sides){ - if(i.isFriendOf(pmap[j])){ - added=true; + } else event.finish(); + "step 2"; + if (!target.isLinked()) target.link(); + "step 3"; + var map = {}, + sides = [], + pmap = _status.connectMode ? lib.playerOL : game.playerMap, + player; + for (var i of game.players) { + if (i.identity == "unknown") continue; + var added = false; + for (var j of sides) { + if (i.isFriendOf(pmap[j])) { + added = true; map[j].push(i); - if(i==this) player=j; + if (i == this) player = j; break; } } - if(!added){ - map[i.playerid]=[i]; + if (!added) { + map[i.playerid] = [i]; sides.push(i.playerid); - if(i==this) player=i.playerid; + if (i == this) player = i.playerid; } } - var num=0; - for(var i in map){ - if(map[i].filter(function(i){ - return i.isLinked(); - }).length) num++; + var num = 0; + for (var i in map) { + if ( + map[i].filter(function (i) { + return i.isLinked(); + }).length + ) + num++; } - if(num>0) player.draw(num); - 'step 4' - if(trigger.player.isIn()){ - var target=trigger.player,sha=game.filterPlayer(function(current){ - return current!=target&¤t!=player&&target.canUse({name:'sha',nature:'thunder',isCard:true},current,false); - }); - if(sha.length){ - var next=player.chooseTarget('请选择'+get.translation(target)+'使用雷【杀】的目标',function(card,player,target){ - return _status.event.list.includes(target); + if (num > 0) player.draw(num); + "step 4"; + if (trigger.player.isIn()) { + var target = trigger.player, + sha = game.filterPlayer(function (current) { + return ( + current != target && + current != player && + target.canUse( + { name: "sha", nature: "thunder", isCard: true }, + current, + false + ) + ); }); - next.set('prompt2','或点「取消」令其回复1点体力'); - next.set('goon',get.recoverEffect(target,player,player)); - next.set('list',sha); - next.set('ai',function(target){ - var player=_status.event.player; - return get.effect(target,{name:'sha',nature:'thunder',isCard:true},_status.event.getTrigger().player,player)-_status.event.goon; + if (sha.length) { + var next = player.chooseTarget( + "请选择" + get.translation(target) + "使用雷【杀】的目标", + function (card, player, target) { + return _status.event.list.includes(target); + } + ); + next.set("prompt2", "或点「取消」令其回复1点体力"); + next.set("goon", get.recoverEffect(target, player, player)); + next.set("list", sha); + next.set("ai", function (target) { + var player = _status.event.player; + return ( + get.effect( + target, + { name: "sha", nature: "thunder", isCard: true }, + _status.event.getTrigger().player, + player + ) - _status.event.goon + ); }); - } - else if(target.isDamaged()) event._result={bool:false}; + } else if (target.isDamaged()) event._result = { bool: false }; else event.finish(); - } - else event.finish(); - 'step 5' - if(result.bool){ - var target=result.targets[0]; - if(player==trigger.player) player.line(target); - else{ - player.line2([trigger.player,target]); + } else event.finish(); + "step 5"; + if (result.bool) { + var target = result.targets[0]; + if (player == trigger.player) player.line(target); + else { + player.line2([trigger.player, target]); game.delay(0.5); } - trigger.player.useCard({name:'sha',nature:'thunder',isCard:true},target,false).animate=false; - } - else{ + trigger.player.useCard( + { name: "sha", nature: "thunder", isCard: true }, + target, + false + ).animate = false; + } else { player.line(trigger.player); trigger.player.recover(); } }, }, - xiaoni:{ - audio:2, - trigger:{ - player:'useCard', - target:'useCardToTargeted', + xiaoni: { + audio: 2, + trigger: { + player: "useCard", + target: "useCardToTargeted", }, - forced:true, - filter:function(event,player){ - var type=get.type2(event.card); - if(type!='basic'&&type!='trick') return false; - var list=game.filterPlayer(function(current){ - return current!=player&¤t.isFriendOf(player); + forced: true, + filter: function (event, player) { + var type = get.type2(event.card); + if (type != "basic" && type != "trick") return false; + var list = game.filterPlayer(function (current) { + return current != player && current.isFriendOf(player); }); - if(!list.length) return false; - var hs=player.countCards('h'); - for(var i of list){ - if(i.countCards('h')>hs) return false; + if (!list.length) return false; + var hs = player.countCards("h"); + for (var i of list) { + if (i.countCards("h") > hs) return false; } return true; }, - check:()=>false, - preHidden:true, - content:function(){ - if(trigger.name=='useCard') trigger.directHit.addArray(game.players); + check: () => false, + preHidden: true, + content: function () { + if (trigger.name == "useCard") trigger.directHit.addArray(game.players); else trigger.directHit.add(player); }, - global:'xiaoni_ai', - ai:{ - halfneg:true, - directHit_ai:true, - skillTagFilter:function(player,tag,arg){ - if(!arg.card) return false; - var type=get.type2(arg.card); - if(type!='basic'&&type!='trick') return false; - var list=game.filterPlayer(function(current){ - return current!=player&¤t.isFriendOf(player); + global: "xiaoni_ai", + ai: { + halfneg: true, + directHit_ai: true, + skillTagFilter: function (player, tag, arg) { + if (!arg.card) return false; + var type = get.type2(arg.card); + if (type != "basic" && type != "trick") return false; + var list = game.filterPlayer(function (current) { + return current != player && current.isFriendOf(player); }); - if(!list.length) return false; - var cards=[arg.card]; - if(arg.card.cards) cards.addArray(arg.card.cards); + if (!list.length) return false; + var cards = [arg.card]; + if (arg.card.cards) cards.addArray(arg.card.cards); cards.addArray(ui.selected.cards); - var hhs=function(card){ + var hhs = function (card) { return !cards.includes(card); }; - var hs=player.countCards('h',hhs); - for(var i of list){ - if(i.countCards('h',hhs)>hs) return false; + var hs = player.countCards("h", hhs); + for (var i of list) { + if (i.countCards("h", hhs) > hs) return false; } return true; }, }, - subSkill:{ - ai:{ - ai:{ - directHit_ai:true, - skillTagFilter:function(playerx,tag,arg){ - if(!arg.card) return false; - var type=get.type2(arg.card); - if(type!='basic'&&type!='trick') return false; + subSkill: { + ai: { + ai: { + directHit_ai: true, + skillTagFilter: function (playerx, tag, arg) { + if (!arg.card) return false; + var type = get.type2(arg.card); + if (type != "basic" && type != "trick") return false; var player; - if(arg.target&&arg.target.hasSkill('xiaoni')) player=arg.target; + if (arg.target && arg.target.hasSkill("xiaoni")) player = arg.target; else return false; - var list=game.filterPlayer(function(current){ - return current!=player&¤t.isFriendOf(player); + var list = game.filterPlayer(function (current) { + return current != player && current.isFriendOf(player); }); - if(!list.length) return false; - var cards=[arg.card]; - if(arg.card.cards) cards.addArray(arg.card.cards); + if (!list.length) return false; + var cards = [arg.card]; + if (arg.card.cards) cards.addArray(arg.card.cards); cards.addArray(ui.selected.cards); - var hhs=function(card){ + var hhs = function (card) { return !cards.includes(card); }; - var hs=player.countCards('h',hhs); - for(var i of list){ - if(i.countCards('h',hhs)>hs) return false; + var hs = player.countCards("h", hhs); + for (var i of list) { + if (i.countCards("h", hhs) > hs) return false; } return true; }, @@ -8502,2431 +11422,3008 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, //刘巴 - gztongduo:{ - audio:2, - trigger:{global:'phaseJieshuBegin'}, - direct:true, - preHidden:true, - filter:function(event,player){ - if(player!=event.player&&!player.hasSkill('gztongduo')||!event.player.isFriendOf(player)) return false; - return event.player.getHistory('lose',function(evt){ - return evt.type=='discard'&&evt.cards2.length>0&&evt.getParent('phaseDiscard').player==event.player; - }).length>0; + gztongduo: { + audio: 2, + trigger: { global: "phaseJieshuBegin" }, + direct: true, + preHidden: true, + filter: function (event, player) { + if ( + (player != event.player && !player.hasSkill("gztongduo")) || + !event.player.isFriendOf(player) + ) + return false; + return ( + event.player.getHistory("lose", function (evt) { + return ( + evt.type == "discard" && + evt.cards2.length > 0 && + evt.getParent("phaseDiscard").player == event.player + ); + }).length > 0 + ); }, - content:function(){ - 'step 0' - var num=0; - trigger.player.getHistory('lose',function(evt){ - if(evt.type=='discard'&&evt.getParent('phaseDiscard').player==trigger.player) num+=evt.cards2.length; + content: function () { + "step 0"; + var num = 0; + trigger.player.getHistory("lose", function (evt) { + if (evt.type == "discard" && evt.getParent("phaseDiscard").player == trigger.player) + num += evt.cards2.length; }); - num=Math.min(3,num); - event.num=num; - var next=trigger.player.chooseBool('是否发动【统度】摸'+get.cnNumber(num)+'张牌?'); - if(player==trigger.player) next.setHiddenSkill('gztongduo'); - 'step 1' - if(result.bool){ - player.logSkill('gztongduo',trigger.player); + num = Math.min(3, num); + event.num = num; + var next = trigger.player.chooseBool("是否发动【统度】摸" + get.cnNumber(num) + "张牌?"); + if (player == trigger.player) next.setHiddenSkill("gztongduo"); + "step 1"; + if (result.bool) { + player.logSkill("gztongduo", trigger.player); trigger.player.draw(num); } }, }, - qingyin:{ - audio:2, - enable:'phaseUse', - limited:true, - delay:false, - filter:function(event,player){ + qingyin: { + audio: 2, + enable: "phaseUse", + limited: true, + delay: false, + filter: function (event, player) { var isFriend; - if(player.identity=='unknown'){ - var group='shu'; - if(!player.wontYe('shu')) group=null; - isFriend=function(current){ - return current==player||current.identity==group; - } - } - else isFriend=function(target){ - return target.isFriendOf(player); - }; - return game.hasPlayer(function(current){ - return isFriend(current)&¤t.isDamaged(); + if (player.identity == "unknown") { + var group = "shu"; + if (!player.wontYe("shu")) group = null; + isFriend = function (current) { + return current == player || current.identity == group; + }; + } else + isFriend = function (target) { + return target.isFriendOf(player); + }; + return game.hasPlayer(function (current) { + return isFriend(current) && current.isDamaged(); }); }, - selectTarget:-1, - filterTarget:function(card,player,target){ - if(player==target) return true; - if(player.identity=='unknown'){ - var group='shu'; - if(!player.wontYe('shu')) return false; - return target.identity==group; + selectTarget: -1, + filterTarget: function (card, player, target) { + if (player == target) return true; + if (player.identity == "unknown") { + var group = "shu"; + if (!player.wontYe("shu")) return false; + return target.identity == group; } return target.isFriendOf(player); }, - selectCard:[0,1], - filterCard:()=>false, - multitarget:true, - multiline:true, - skillAnimation:true, - animationColor:'orange', - content:function(){ - 'step 0' - player.awakenSkill('qingyin'); - event.num=0; - 'step 1' - if(targets[num].isDamaged()){ - targets[num].recover(targets[num].maxHp-targets[num].hp); + selectCard: [0, 1], + filterCard: () => false, + multitarget: true, + multiline: true, + skillAnimation: true, + animationColor: "orange", + content: function () { + "step 0"; + player.awakenSkill("qingyin"); + event.num = 0; + "step 1"; + if (targets[num].isDamaged()) { + targets[num].recover(targets[num].maxHp - targets[num].hp); } event.num++; - if(event.num=(1/Math.max(1.6,game.roundNumber))?1:-1; + return num / max >= 1 / Math.max(1.6, game.roundNumber) ? 1 : -1; }, - result:{ - player:1, + result: { + player: 1, }, }, }, //苏飞 - gzlianpian:{ - audio:2, - trigger:{global:'phaseJieshuBegin'}, - direct:true, - preHidden:true, - filter:function(event,player){ - if(player!=event.player&&!player.hasSkill('gzlianpian')) return false; - var num=0; - game.getGlobalHistory('cardMove',function(evt){ - if(evt.name=='lose'&&evt.type=='discard'&&evt.getParent(2).player==event.player) num+=evt.cards2.length; + gzlianpian: { + audio: 2, + trigger: { global: "phaseJieshuBegin" }, + direct: true, + preHidden: true, + filter: function (event, player) { + if (player != event.player && !player.hasSkill("gzlianpian")) return false; + var num = 0; + game.getGlobalHistory("cardMove", function (evt) { + if ( + evt.name == "lose" && + evt.type == "discard" && + evt.getParent(2).player == event.player + ) + num += evt.cards2.length; }); - if(num<=player.hp) return false; - if(player==event.player) return game.hasPlayer(function(current){ - return current.isFriendOf(player)&¤t.countCards('h')0||player.isDamaged(); + if (num <= player.hp) return false; + if (player == event.player) + return game.hasPlayer(function (current) { + return current.isFriendOf(player) && current.countCards("h") < current.maxHp; + }); + return player.countDiscardableCards(event.player, "he") > 0 || player.isDamaged(); }, - content:function(){ - 'step 0' - if(player==trigger.player){ - player.chooseTarget(get.prompt('gzlianpian'),'令一名己方角色将手牌摸至手牌上限',function(card,player,target){ - return target.isFriendOf(player)&&target.maxHp>target.countCards('h'); - }).set('ai',function(target){ - var att=get.attitude(_status.event.player,target); - if(target.hasSkillTag('nogain')) att/=6; - if(att>2){ - return Math.min(5,target.maxHp)-target.countCards('h'); - } - return att/3; - }).setHiddenSkill(event.name); - } - else{ + content: function () { + "step 0"; + if (player == trigger.player) { + player + .chooseTarget( + get.prompt("gzlianpian"), + "令一名己方角色将手牌摸至手牌上限", + function (card, player, target) { + return target.isFriendOf(player) && target.maxHp > target.countCards("h"); + } + ) + .set("ai", function (target) { + var att = get.attitude(_status.event.player, target); + if (target.hasSkillTag("nogain")) att /= 6; + if (att > 2) { + return Math.min(5, target.maxHp) - target.countCards("h"); + } + return att / 3; + }) + .setHiddenSkill(event.name); + } else { event.goto(2); - event.addIndex=0; - var list=[],target=trigger.player,str=get.translation(player); - event.target=target; - if(player.countDiscardableCards(target,'he')>0) list.push('弃置'+str+'的一张牌'); + event.addIndex = 0; + var list = [], + target = trigger.player, + str = get.translation(player); + event.target = target; + if (player.countDiscardableCards(target, "he") > 0) + list.push("弃置" + str + "的一张牌"); else event.addIndex++; - if(player.isDamaged()) list.push('令'+str+'回复1点体力'); - target.chooseControl('cancel2').set('choiceList',list).set('ai',function(){ - var evt=_status.event.getParent(); - if(get.attitude(evt.target,evt.player)>0) return 1-evt.addIndex; - return evt.addIndex; - }).set('prompt','是否对'+str+'发动【连翩】?'); + if (player.isDamaged()) list.push("令" + str + "回复1点体力"); + target + .chooseControl("cancel2") + .set("choiceList", list) + .set("ai", function () { + var evt = _status.event.getParent(); + if (get.attitude(evt.target, evt.player) > 0) return 1 - evt.addIndex; + return evt.addIndex; + }) + .set("prompt", "是否对" + str + "发动【连翩】?"); } - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.logSkill('gzlianpian',target); - target.draw(Math.min(5,target.maxHp-target.countCards('h'))); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.logSkill("gzlianpian", target); + target.draw(Math.min(5, target.maxHp - target.countCards("h"))); } event.finish(); - 'step 2' - if(result.control=='cancel2'){ + "step 2"; + if (result.control == "cancel2") { event.finish(); return; } - player.logSkill('gzlianpian',target,false); - target.line(player,'green'); - if(result.index+event.addIndex==0){ - target.discardPlayerCard('he',player,true); + player.logSkill("gzlianpian", target, false); + target.line(player, "green"); + if (result.index + event.addIndex == 0) { + target.discardPlayerCard("he", player, true); event.finish(); - } - else player.recover(); - 'step 3' + } else player.recover(); + "step 3"; game.delayx(); }, }, //冯熙 - gzyusui:{ - audio:'yusui', - trigger:{target:'useCardToTargeted'}, - filter:function(event,player){ - return event.player!=player&&event.player.isIn()&&event.player.isEnemyOf(player)&&get.color(event.card)=='black'; + gzyusui: { + audio: "yusui", + trigger: { target: "useCardToTargeted" }, + filter: function (event, player) { + return ( + event.player != player && + event.player.isIn() && + event.player.isEnemyOf(player) && + get.color(event.card) == "black" + ); }, - logTarget:'player', - check:function(event,player){ - var target=event.player; - if(player.hp<3||get.attitude(player,target)>-3) return false; - if(player.hp3) return true; + logTarget: "player", + check: function (event, player) { + var target = event.player; + if (player.hp < 3 || get.attitude(player, target) > -3) return false; + if (player.hp < target.hp) return true; + if (Math.min(target.maxHp, target.countCards("h")) > 3) return true; return false; }, - preHidden:true, - content:function(){ - 'step 0' + preHidden: true, + content: function () { + "step 0"; player.loseHp(); - event.target=trigger.player; - 'step 1' - event.addIndex=0; - var list=[]; - if(target.maxHp>0&&target.countCards('h')>0) list.push('令其弃置'+get.cnNumber(target.maxHp)+'张手牌'); + event.target = trigger.player; + "step 1"; + event.addIndex = 0; + var list = []; + if (target.maxHp > 0 && target.countCards("h") > 0) + list.push("令其弃置" + get.cnNumber(target.maxHp) + "张手牌"); else event.addIndex++; - if(target.hp>player.hp) list.push('令其失去'+get.cnNumber(target.hp-player.hp)+'点体力'); - if(!list.length) event.finish(); - else if(list.length==1) event._result={index:0}; - else player.chooseControl().set('choiceList',list).set('prompt','令'+get.translation(target)+'执行一项').set('ai',function(){ - var player=_status.event.player,target=_status.event.getParent().target; - return (target.hp-player.hp)>(Math.min(target.maxHp,target.countCards('h'))/2)?1:0; - }); - 'step 2' - if(result.index+event.addIndex==0) target.chooseToDiscard(target.maxHp,true,'h'); - else target.loseHp(target.hp-player.hp); + if (target.hp > player.hp) + list.push("令其失去" + get.cnNumber(target.hp - player.hp) + "点体力"); + if (!list.length) event.finish(); + else if (list.length == 1) event._result = { index: 0 }; + else + player + .chooseControl() + .set("choiceList", list) + .set("prompt", "令" + get.translation(target) + "执行一项") + .set("ai", function () { + var player = _status.event.player, + target = _status.event.getParent().target; + return target.hp - player.hp > + Math.min(target.maxHp, target.countCards("h")) / 2 + ? 1 + : 0; + }); + "step 2"; + if (result.index + event.addIndex == 0) target.chooseToDiscard(target.maxHp, true, "h"); + else target.loseHp(target.hp - player.hp); }, }, - gzboyan:{ - audio:'boyan', - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return game.hasPlayer((target)=>lib.skill.gzboyan.filterTarget(null,player,target)); + gzboyan: { + audio: "boyan", + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + return game.hasPlayer((target) => lib.skill.gzboyan.filterTarget(null, player, target)); }, - filterTarget:function(card,player,target){ - return target!=player&&target.countCards('h')0; - }); + content: function () { + "step 0"; + target.draw(Math.min(5, target.maxHp - target.countCards("h"))); + "step 1"; + target.addTempSkill("gzboyan_block"); + "step 2"; + if (target.isIn()) + player + .chooseBool("纵横:是否令" + get.translation(target) + "获得【驳言】?") + .set("ai", function () { + var evt = _status.event.getParent(); + return get.attitude(evt.player, evt.target) > 0; + }); else event.finish(); - 'step 3' - if(result.bool){ - target.addTempSkill('gzboyan_zongheng',{player:'phaseEnd'}); - game.log(player,'发起了','#y纵横',',令',target,'获得了技能','#g【驳言】'); + "step 3"; + if (result.bool) { + target.addTempSkill("gzboyan_zongheng", { player: "phaseEnd" }); + game.log(player, "发起了", "#y纵横", ",令", target, "获得了技能", "#g【驳言】"); } }, - derivation:'gzboyan_zongheng', - subSkill:{ - zongheng:{ - enable:'phaseUse', - usable:1, - filterTarget:lib.filter.notMe, - content:function(){ - target.addTempSkill('gzboyan_block'); + derivation: "gzboyan_zongheng", + subSkill: { + zongheng: { + enable: "phaseUse", + usable: 1, + filterTarget: lib.filter.notMe, + content: function () { + target.addTempSkill("gzboyan_block"); }, - ai:{ - order:4, - result:{ - target:function(player,target){ - if(target.countCards('h','shan')&&!target.hasSkillTag('respondShan',true,null,true)&&player.countCards('h',function(card){ - return get.tag(card,'respondShan')&&get.effect(target,card,player,player)>0&&player.getUseValue(card)>0; - })) return -target.countCards('h'); + ai: { + order: 4, + result: { + target: function (player, target) { + if ( + target.countCards("h", "shan") && + !target.hasSkillTag("respondShan", true, null, true) && + player.countCards("h", function (card) { + return ( + get.tag(card, "respondShan") && + get.effect(target, card, player, player) > 0 && + player.getUseValue(card) > 0 + ); + }) + ) + return -target.countCards("h"); return -0.5; }, }, }, }, - block:{ - mark:true, - intro:{content:'不能使用或打出手牌'}, - charlotte:true, - mod:{ - cardEnabled2:function(card){ - if(get.position(card)=='h') return false; + block: { + mark: true, + intro: { content: "不能使用或打出手牌" }, + charlotte: true, + mod: { + cardEnabled2: function (card) { + if (get.position(card) == "h") return false; }, }, }, }, - ai:{ - order:4, - result:{ - target:function(player,target){ - if(get.attitude(player,target)>0) return Math.min(5,target.maxHp-target.countCards('h')); - if(target.maxHp-target.countCards('h')==1&&target.countCards('h','shan')&&!target.hasSkillTag('respondShan',true,null,true)&&player.countCards('h',function(card){ - return get.tag(card,'respondShan')&&get.effect(target,card,player,player)>0&&player.getUseValue(card,null,true)>0; - })) return -2; + ai: { + order: 4, + result: { + target: function (player, target) { + if (get.attitude(player, target) > 0) + return Math.min(5, target.maxHp - target.countCards("h")); + if ( + target.maxHp - target.countCards("h") == 1 && + target.countCards("h", "shan") && + !target.hasSkillTag("respondShan", true, null, true) && + player.countCards("h", function (card) { + return ( + get.tag(card, "respondShan") && + get.effect(target, card, player, player) > 0 && + player.getUseValue(card, null, true) > 0 + ); + }) + ) + return -2; }, }, }, }, //文钦 - gzjinfa:{ - audio:2, - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return player.countCards('he')>0&&game.hasPlayer(function(current){ - return current!=player&¤t.countCards('he')>0; - }) + gzjinfa: { + audio: 2, + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + return ( + player.countCards("he") > 0 && + game.hasPlayer(function (current) { + return current != player && current.countCards("he") > 0; + }) + ); }, - filterCard:true, - position:'he', - filterTarget:function(card,player,target){ - return target!=player&&target.countCards('he')>0; + filterCard: true, + position: "he", + filterTarget: function (card, player, target) { + return target != player && target.countCards("he") > 0; }, - check:function(card){ - return 6-get.value(card); + check: function (card) { + return 6 - get.value(card); }, - content:function(){ - 'step 0' - target.chooseCard('he','交给'+get.translation(player)+'一张装备牌,或令其获得你的一张牌',{type:'equip'}).set('ai',function(card){ - if(_status.event.goon&&get.suit(card)=='spade') return 8-get.value(card); - return 5-get.value(card); - }).set('goon',target.canUse('sha',player,false)&&get.effect(player,{name:'sha'},target,target)>0); - 'step 1' - if(!result.bool){ - player.gainPlayerCard(target,'he',true); + content: function () { + "step 0"; + target + .chooseCard( + "he", + "交给" + get.translation(player) + "一张装备牌,或令其获得你的一张牌", + { type: "equip" } + ) + .set("ai", function (card) { + if (_status.event.goon && get.suit(card) == "spade") return 8 - get.value(card); + return 5 - get.value(card); + }) + .set( + "goon", + target.canUse("sha", player, false) && + get.effect(player, { name: "sha" }, target, target) > 0 + ); + "step 1"; + if (!result.bool) { + player.gainPlayerCard(target, "he", true); event.finish(); - } - else target.give(result.cards,player); - 'step 2' - if(result.bool&&result.cards&&result.cards.length&& - target.isIn()&&player.isIn()&&get.suit(result.cards[0],target)=='spade'&&target.canUse('sha',player,false)) target.useCard({name:'sha',isCard:true},false,player); + } else target.give(result.cards, player); + "step 2"; + if ( + result.bool && + result.cards && + result.cards.length && + target.isIn() && + player.isIn() && + get.suit(result.cards[0], target) == "spade" && + target.canUse("sha", player, false) + ) + target.useCard({ name: "sha", isCard: true }, false, player); }, - ai:{ - order:6, - result:{ - player:function(player,target){ - if(target.countCards('e',function(card){ - return get.suit(card)=='spade'&&get.value(card)<8; - })&&target.canUse('sha',player,false)) return get.effect(player,{name:'sha'},target,player); + ai: { + order: 6, + result: { + player: function (player, target) { + if ( + target.countCards("e", function (card) { + return get.suit(card) == "spade" && get.value(card) < 8; + }) && + target.canUse("sha", player, false) + ) + return get.effect(player, { name: "sha" }, target, player); return 0; }, - target:function(player,target){ - var es=target.getCards('e').sort(function(a,b){ - return get.value(b,target)-get.value(a,target); + target: function (player, target) { + var es = target.getCards("e").sort(function (a, b) { + return get.value(b, target) - get.value(a, target); }); - if(es.length) return -Math.min(2,get.value(es[0])) + if (es.length) return -Math.min(2, get.value(es[0])); return -2; }, }, }, }, //诸葛恪 - gzduwu:{ - limited:true, - audio:2, - enable:'phaseUse', - delay:false, - filter:function(event,player){ + gzduwu: { + limited: true, + audio: 2, + enable: "phaseUse", + delay: false, + filter: function (event, player) { var isEnemy; - if(player.identity=='unknown'){ - if(!player.wontYe('wu')) isEnemy=function(current){ - return current!=player; + if (player.identity == "unknown") { + if (!player.wontYe("wu")) + isEnemy = function (current) { + return current != player; + }; + else + isEnemy = function (current) { + return current != player && current.identity != "wu"; + }; + } else + isEnemy = function (target) { + return target.isEnemyOf(player); }; - else isEnemy=function(current){ - return current!=player&¤t.identity!='wu'; - } - } - else isEnemy=function(target){ - return target.isEnemyOf(player); - }; - return game.hasPlayer(function(current){ - return isEnemy(current)&&player.inRange(current); + return game.hasPlayer(function (current) { + return isEnemy(current) && player.inRange(current); }); }, - filterTarget:function(card,player,target){ - if(player==target||!player.inRange(target)) return false; - if(player.identity=='unknown'){ - if(!player.wontYe('wu')) return true; - return target.identity!='wu'; + filterTarget: function (card, player, target) { + if (player == target || !player.inRange(target)) return false; + if (player.identity == "unknown") { + if (!player.wontYe("wu")) return true; + return target.identity != "wu"; } return target.isEnemyOf(player); }, - selectTarget:-1, - filterCard:()=>false, - selectCard:[0,1], - multitarget:true, - multiline:true, - content:function(){ - 'step 0' - player.awakenSkill('gzduwu'); - player.addSkill('gzduwu_count'); + selectTarget: -1, + filterCard: () => false, + selectCard: [0, 1], + multitarget: true, + multiline: true, + content: function () { + "step 0"; + player.awakenSkill("gzduwu"); + player.addSkill("gzduwu_count"); targets.sortBySeat(); - event.players=targets.slice(0); + event.players = targets.slice(0); game.delayx(); - player.chooseJunlingFor(event.players[0]).set('prompt','为所有目标角色选择军令牌'); - 'step 1' - event.junling=result.junling; - event.targets=result.targets; - event.num=0; - 'step 2' - if(num(get.damageEffect(evt.current,evt.player,evt.current)/get.attitude(evt.current,evt.current))?0:1; - }); - } - else event.goto(4); - 'step 3' - if(result.index==0){ - event.current.carryOutJunling(player,event.junling,targets); - } - else{ + player.chooseJunlingFor(event.players[0]).set("prompt", "为所有目标角色选择军令牌"); + "step 1"; + event.junling = result.junling; + event.targets = result.targets; + event.num = 0; + "step 2"; + if (num < event.players.length) event.current = event.players[num]; + if (event.current && event.current.isAlive()) { + event.current + .chooseJunlingControl(player, event.junling, targets) + .set("prompt", "黩武") + .set("choiceList", ["执行该军令", "不执行该军令并受到1点伤害"]) + .set("ai", function () { + var evt = _status.event.getParent(2); + return get.junlingEffect( + evt.player, + evt.junling, + evt.current, + evt.targets, + evt.current + ) > + get.damageEffect(evt.current, evt.player, evt.current) / + get.attitude(evt.current, evt.current) + ? 0 + : 1; + }); + } else event.goto(4); + "step 3"; + if (result.index == 0) { + event.current.carryOutJunling(player, event.junling, targets); + } else { player.draw(); event.current.damage(); } - 'step 4' + "step 4"; game.delayx(); event.num++; - if(event.num0&&player.canUse('sha',event.player,false); + gzxishe: { + audio: 2, + trigger: { global: "phaseZhunbeiBegin" }, + direct: true, + preHidden: true, + filter: function (event, player) { + return ( + event.player != player && + event.player.isIn() && + player.countCards("e") > 0 && + player.canUse("sha", event.player, false) + ); }, - content:function(){ - 'step 0' - player.chooseCard('e',get.prompt('gzxishe',trigger.player),'将装备区内的一张牌当做'+(player.hp>trigger.player.hp?'不可响应的':'')+'【杀】对其使用',function(card,player){ - return player.canUse({ - name:'sha', - cards:[card], - },_status.event.target,false); - }).set('target',trigger.player).set('ai',function(card){ - var evt=_status.event,eff=get.effect(evt.target,{ - name:'sha', - cards:[card], - },evt.player,evt.player); - if(eff<=0) return 0; - var val=get.value(card); - if(get.attitude(evt.player,evt.target)<-2&&evt.target.hp<=Math.min(2,evt.player.countCards('e'),evt.player.hp-1)) return 2/Math.max(1,val); - return eff-val; - }).setHiddenSkill(event.name); - 'step 1' - if(result.bool){ - var next=player.useCard({name:'sha'},result.cards,'gzxishe',trigger.player,false); - if(player.hp>trigger.player.hp) next.oncard=function(){ - _status.event.directHit.add(trigger.player); - } - } - else event.finish(); - 'step 2' - if(trigger.player.isDead()){ - player.mayChangeVice(null,'hidden'); - } - else if(lib.skill.gzxishe.filter(trigger,player)) event.goto(0); + content: function () { + "step 0"; + player + .chooseCard( + "e", + get.prompt("gzxishe", trigger.player), + "将装备区内的一张牌当做" + + (player.hp > trigger.player.hp ? "不可响应的" : "") + + "【杀】对其使用", + function (card, player) { + return player.canUse( + { + name: "sha", + cards: [card], + }, + _status.event.target, + false + ); + } + ) + .set("target", trigger.player) + .set("ai", function (card) { + var evt = _status.event, + eff = get.effect( + evt.target, + { + name: "sha", + cards: [card], + }, + evt.player, + evt.player + ); + if (eff <= 0) return 0; + var val = get.value(card); + if ( + get.attitude(evt.player, evt.target) < -2 && + evt.target.hp <= Math.min(2, evt.player.countCards("e"), evt.player.hp - 1) + ) + return 2 / Math.max(1, val); + return eff - val; + }) + .setHiddenSkill(event.name); + "step 1"; + if (result.bool) { + var next = player.useCard( + { name: "sha" }, + result.cards, + "gzxishe", + trigger.player, + false + ); + if (player.hp > trigger.player.hp) + next.oncard = function () { + _status.event.directHit.add(trigger.player); + }; + } else event.finish(); + "step 2"; + if (trigger.player.isDead()) { + player.mayChangeVice(null, "hidden"); + } else if (lib.skill.gzxishe.filter(trigger, player)) event.goto(0); }, - ai:{ - directHit_ai:true, - skillTagFilter:function(player,tag,arg){ - if(_status.event.getParent().name=='gzxishe'&&arg.card&&arg.card.name=='sha'&& - arg.target&&arg.target==_status.event.target&&player.hp>arg.target.hp) return true; + ai: { + directHit_ai: true, + skillTagFilter: function (player, tag, arg) { + if ( + _status.event.getParent().name == "gzxishe" && + arg.card && + arg.card.name == "sha" && + arg.target && + arg.target == _status.event.target && + player.hp > arg.target.hp + ) + return true; return false; }, }, }, //公孙渊 - gzhuaiyi:{ - audio:2, - enable:'phaseUse', - usable:1, - delay:false, - filter:function(event,player){ - return player.countCards('h')>0; + gzhuaiyi: { + audio: 2, + enable: "phaseUse", + usable: 1, + delay: false, + filter: function (event, player) { + return player.countCards("h") > 0; }, - content:function(){ - 'step 0' + content: function () { + "step 0"; player.showHandcards(); - 'step 1' - if(!player.countCards('h',{color:'red'})) event._result={control:'黑色'}; - else if(!player.countCards('h',{color:'black'})) event._result={control:'红色'}; - else player.chooseControl('红色','黑色').set('ai',function(){ - var player=_status.event.player,num=player.maxHp-player.getExpansions('gzhuaiyi').length; - if(player.countCards('h',{color:'red'})<=num&& - player.countCards('h',{color:'black'})>num) return '红色'; - return '黑色'; - }); - 'step 2' - event.control=result.control; + "step 1"; + if (!player.countCards("h", { color: "red" })) event._result = { control: "黑色" }; + else if (!player.countCards("h", { color: "black" })) event._result = { control: "红色" }; + else + player.chooseControl("红色", "黑色").set("ai", function () { + var player = _status.event.player, + num = player.maxHp - player.getExpansions("gzhuaiyi").length; + if ( + player.countCards("h", { color: "red" }) <= num && + player.countCards("h", { color: "black" }) > num + ) + return "红色"; + return "黑色"; + }); + "step 2"; + event.control = result.control; var cards; - if(event.control=='红色'){ - cards=player.getCards('h',{color:'red'}); - } - else{ - cards=player.getCards('h',{color:'black'}); + if (event.control == "红色") { + cards = player.getCards("h", { color: "red" }); + } else { + cards = player.getCards("h", { color: "black" }); } player.discard(cards); - event.num=cards.length; - 'step 3' - player.chooseTarget('请选择至多'+get.cnNumber(event.num)+'名有牌的其他角色,获得这些角色的各一张牌。',[1,event.num],function(card,player,target){ - return target!=player&&target.countCards('he')>0; - }).set('ai',function(target){ - return -get.attitude(_status.event.player,target)+0.5; - }); - 'step 4' - if(result.bool&&result.targets){ - player.line(result.targets,'green'); - event.targets=result.targets; + event.num = cards.length; + "step 3"; + player + .chooseTarget( + "请选择至多" + + get.cnNumber(event.num) + + "名有牌的其他角色,获得这些角色的各一张牌。", + [1, event.num], + function (card, player, target) { + return target != player && target.countCards("he") > 0; + } + ) + .set("ai", function (target) { + return -get.attitude(_status.event.player, target) + 0.5; + }); + "step 4"; + if (result.bool && result.targets) { + player.line(result.targets, "green"); + event.targets = result.targets; event.targets.sort(lib.sort.seat); - event.cards=[]; - } - else{ + event.cards = []; + } else { event.finish(); } - 'step 5' - if(player.isAlive()&&event.targets.length){ - player.gainPlayerCard(event.targets.shift(),'he',true); - } - else event.finish(); - 'step 6' - if(result.bool&&result.cards&&result.cards.length) event.cards.addArray(result.cards); - if(event.targets.length) event.goto(5); - 'step 7' - var hs=player.getCards('h'); - cards=cards.filter(function(card){ - return get.type(card)=='equip'&&hs.includes(card); + "step 5"; + if (player.isAlive() && event.targets.length) { + player.gainPlayerCard(event.targets.shift(), "he", true); + } else event.finish(); + "step 6"; + if (result.bool && result.cards && result.cards.length) + event.cards.addArray(result.cards); + if (event.targets.length) event.goto(5); + "step 7"; + var hs = player.getCards("h"); + cards = cards.filter(function (card) { + return get.type(card) == "equip" && hs.includes(card); }); - if(cards.length){ - player.addToExpansion(cards,player,'give').gaintag.add('gzhuaiyi'); + if (cards.length) { + player.addToExpansion(cards, player, "give").gaintag.add("gzhuaiyi"); } }, - ai:{ - order:10, - result:{ - player:function(player,target){ - var num=player.maxHp-player.getExpansions('gzhuaiyi').length; - if(player.countCards('h',{color:'red'})<=num) return 1; - if(player.countCards('h',{color:'black'})<=num) return 1; + ai: { + order: 10, + result: { + player: function (player, target) { + var num = player.maxHp - player.getExpansions("gzhuaiyi").length; + if (player.countCards("h", { color: "red" }) <= num) return 1; + if (player.countCards("h", { color: "black" }) <= num) return 1; return 0; }, - } + }, }, - marktext:'异', - intro:{content:'expansion',markcount:'expansion'}, - onremove:function(player,skill){ - var cards=player.getExpansions(skill); - if(cards.length) player.loseToDiscardpile(cards); + marktext: "异", + intro: { content: "expansion", markcount: "expansion" }, + onremove: function (player, skill) { + var cards = player.getExpansions(skill); + if (cards.length) player.loseToDiscardpile(cards); }, }, - gzzisui:{ - audio:2, - trigger:{player:'phaseDrawBegin2'}, - forced:true, - filter:function(event,player){ - return !event.numFixed&&player.getExpansions('gzhuaiyi').length>0; + gzzisui: { + audio: 2, + trigger: { player: "phaseDrawBegin2" }, + forced: true, + filter: function (event, player) { + return !event.numFixed && player.getExpansions("gzhuaiyi").length > 0; }, - content:function(){ - trigger.num+=player.getExpansions('gzhuaiyi').length; + content: function () { + trigger.num += player.getExpansions("gzhuaiyi").length; }, - group:'gzzisui_die', - subSkill:{ - die:{ - audio:'gzzisui', - trigger:{player:'phaseJieshuBegin'}, - forced:true, - filter:function(event,player){ - return player.getExpansions('gzhuaiyi').length>player.maxHp; + group: "gzzisui_die", + subSkill: { + die: { + audio: "gzzisui", + trigger: { player: "phaseJieshuBegin" }, + forced: true, + filter: function (event, player) { + return player.getExpansions("gzhuaiyi").length > player.maxHp; }, - content:function(){ + content: function () { player.die(); }, }, }, }, //潘濬 - gzcongcha:{ - audio:2, - trigger:{player:'phaseZhunbeiBegin'}, - direct:true, - filter:function(event,player){ - return game.hasPlayer(function(current){ - return current!=player&¤t.isUnseen(); - }) - }, - preHidden:'gzcongcha_draw', - prompt2:'选择一名武将牌均暗置的其他角色', - content:function(){ - 'step 0' - player.chooseTarget(get.prompt2('gzcongcha'),function(card,player,target){ - return target!=player&&target.isUnseen(); - }).set('ai',function(target){ - if(get.attitude(_status.event.player,target)>0) return Math.random()+Math.sqrt(target.hp); - return Math.random()+Math.sqrt(Math.max(1,4-target.hp)); + gzcongcha: { + audio: 2, + trigger: { player: "phaseZhunbeiBegin" }, + direct: true, + filter: function (event, player) { + return game.hasPlayer(function (current) { + return current != player && current.isUnseen(); }); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.logSkill('gzcongcha',target); - player.storage.gzcongcha2=target; - player.addTempSkill('gzcongcha2',{player:'phaseBegin'}); - target.addSkill('gzcongcha_ai'); + }, + preHidden: "gzcongcha_draw", + prompt2: "选择一名武将牌均暗置的其他角色", + content: function () { + "step 0"; + player + .chooseTarget(get.prompt2("gzcongcha"), function (card, player, target) { + return target != player && target.isUnseen(); + }) + .set("ai", function (target) { + if (get.attitude(_status.event.player, target) > 0) + return Math.random() + Math.sqrt(target.hp); + return Math.random() + Math.sqrt(Math.max(1, 4 - target.hp)); + }); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.logSkill("gzcongcha", target); + player.storage.gzcongcha2 = target; + player.addTempSkill("gzcongcha2", { player: "phaseBegin" }); + target.addSkill("gzcongcha_ai"); game.delayx(); } }, - subfrequent:['draw'], - group:'gzcongcha_draw', - subSkill:{ - draw:{ - audio:'gzcongcha', - trigger:{player:'phaseDrawBegin2'}, - frequent:true, - filter:function(event,player){ - return !event.numFixed&&!game.hasPlayer(function(current){ - return current.isUnseen(); - }); + subfrequent: ["draw"], + group: "gzcongcha_draw", + subSkill: { + draw: { + audio: "gzcongcha", + trigger: { player: "phaseDrawBegin2" }, + frequent: true, + filter: function (event, player) { + return ( + !event.numFixed && + !game.hasPlayer(function (current) { + return current.isUnseen(); + }) + ); }, - prompt:'是否发动【聪察】多摸两张牌?', - content:function(){ - trigger.num+=2; + prompt: "是否发动【聪察】多摸两张牌?", + content: function () { + trigger.num += 2; }, }, }, }, - gzcongcha_ai:{ - charlotte:true, - ai:{ - mingzhi_yes:true, - mingzhi_no:true, - skillTagFilter:function(player,tag){ - if(_status.brawl) return false; - var group=lib.character[player.name1][1]; - if(tag=='mingzhi_yes'){ - if(group!='ye'&&player.wontYe(group)&&game.hasPlayer(function(current){ - return current.storage.gzcongcha2==player&¤t.identity==group; - })) return true; + gzcongcha_ai: { + charlotte: true, + ai: { + mingzhi_yes: true, + mingzhi_no: true, + skillTagFilter: function (player, tag) { + if (_status.brawl) return false; + var group = lib.character[player.name1][1]; + if (tag == "mingzhi_yes") { + if ( + group != "ye" && + player.wontYe(group) && + game.hasPlayer(function (current) { + return current.storage.gzcongcha2 == player && current.identity == group; + }) + ) + return true; return false; } - if(group=='ye'&&!player.wontYe(group)) return true; - return game.hasPlayer(function(current){ - return current.storage.gzcongcha2==player&¤t.identity!=group; - }) + if (group == "ye" && !player.wontYe(group)) return true; + return game.hasPlayer(function (current) { + return current.storage.gzcongcha2 == player && current.identity != group; + }); }, }, }, - gzcongcha2:{ - trigger:{global:'showCharacterAfter'}, - forced:true, - charlotte:true, - onremove:true, - filter:function(event,player){ - return event.player==player.storage.gzcongcha2; + gzcongcha2: { + trigger: { global: "showCharacterAfter" }, + forced: true, + charlotte: true, + onremove: true, + filter: function (event, player) { + return event.player == player.storage.gzcongcha2; }, - logTarget:'player', - content:function(){ - 'step 0' - player.removeSkill('gzcongcha2'); - trigger.player.removeSkill('gzcongcha_ai'); - if(player.isFriendOf(trigger.player)) game.asyncDraw([player,trigger.player].sortBySeat(_status.currentPhase),2); + logTarget: "player", + content: function () { + "step 0"; + player.removeSkill("gzcongcha2"); + trigger.player.removeSkill("gzcongcha_ai"); + if (player.isFriendOf(trigger.player)) + game.asyncDraw([player, trigger.player].sortBySeat(_status.currentPhase), 2); else trigger.player.loseHp(); - 'step 1' + "step 1"; game.delayx(); }, - mark:'character', - intro:{content:'已指定$为目标'}, + mark: "character", + intro: { content: "已指定$为目标" }, }, //司马昭 - gzzhaoxin:{ - audio:2, - trigger:{player:'damageEnd'}, - filter:function(event,player){ - return player.countCards('h')>0; + gzzhaoxin: { + audio: 2, + trigger: { player: "damageEnd" }, + filter: function (event, player) { + return player.countCards("h") > 0; }, - check:()=>false, - preHidden:true, - content:function(){ - 'step 0' + check: () => false, + preHidden: true, + content: function () { + "step 0"; player.showHandcards(); - 'step 1' - var hs=player.countCards('h'); - if(game.hasPlayer(function(current){ - return current!=player&¤t.countCards('h')<=hs; - })){ - player.chooseTarget(true,'请选择要交换手牌的目标角色',function(card,player,target){ - return target!=player&&target.countCards('h')<=player.countCards('h'); + "step 1"; + var hs = player.countCards("h"); + if ( + game.hasPlayer(function (current) { + return current != player && current.countCards("h") <= hs; }) - } - else event.finish(); - 'step 2' - if(result.bool){ - var target=result.targets[0]; - player.line(target,'green'); + ) { + player.chooseTarget( + true, + "请选择要交换手牌的目标角色", + function (card, player, target) { + return target != player && target.countCards("h") <= player.countCards("h"); + } + ); + } else event.finish(); + "step 2"; + if (result.bool) { + var target = result.targets[0]; + player.line(target, "green"); player.swapHandcards(target); } }, }, - gzsuzhi:{ - audio:2, - derivation:'gzfankui', - mod:{ - targetInRange:function(card,player,target){ - if(player==_status.currentPhase&&player.countMark('gzsuzhi_count')<3&&get.type2(card)=='trick') return true; + gzsuzhi: { + audio: 2, + derivation: "gzfankui", + mod: { + targetInRange: function (card, player, target) { + if ( + player == _status.currentPhase && + player.countMark("gzsuzhi_count") < 3 && + get.type2(card) == "trick" + ) + return true; }, }, - trigger:{player:'phaseJieshuBegin'}, - forced:true, - filter:function(event,player){ - return player.countMark('gzsuzhi_count')<3; + trigger: { player: "phaseJieshuBegin" }, + forced: true, + filter: function (event, player) { + return player.countMark("gzsuzhi_count") < 3; }, - content:function(){ - player.addTempSkills('gzfankui',{player:'phaseBegin'}); + content: function () { + player.addTempSkills("gzfankui", { player: "phaseBegin" }); }, - group:['gzsuzhi_damage','gzsuzhi_draw','gzsuzhi_gain'], - preHidden:['gzsuzhi_damage','gzsuzhi_draw','gzsuzhi_gain'], - subSkill:{ - damage:{ - audio:'gzsuzhi', - trigger:{source:'damageBegin1'}, - forced:true, - filter:function(event,player){ - return player==_status.currentPhase&&player.countMark('gzsuzhi_count')<3&&event.card&& - (event.card.name=='sha'||event.card.name=='juedou')&&event.getParent().type=='card'; + group: ["gzsuzhi_damage", "gzsuzhi_draw", "gzsuzhi_gain"], + preHidden: ["gzsuzhi_damage", "gzsuzhi_draw", "gzsuzhi_gain"], + subSkill: { + damage: { + audio: "gzsuzhi", + trigger: { source: "damageBegin1" }, + forced: true, + filter: function (event, player) { + return ( + player == _status.currentPhase && + player.countMark("gzsuzhi_count") < 3 && + event.card && + (event.card.name == "sha" || event.card.name == "juedou") && + event.getParent().type == "card" + ); }, - content:function(){ + content: function () { trigger.num++; - player.addTempSkill('gzsuzhi_count'); - player.addMark('gzsuzhi_count',1,false); + player.addTempSkill("gzsuzhi_count"); + player.addMark("gzsuzhi_count", 1, false); }, }, - draw:{ - audio:'gzsuzhi', - trigger:{player:'useCard'}, - forced:true, - filter:function(event,player){ - return player==_status.currentPhase&&player.countMark('gzsuzhi_count')<3&&event.card.isCard&&get.type2(event.card)=='trick'; + draw: { + audio: "gzsuzhi", + trigger: { player: "useCard" }, + forced: true, + filter: function (event, player) { + return ( + player == _status.currentPhase && + player.countMark("gzsuzhi_count") < 3 && + event.card.isCard && + get.type2(event.card) == "trick" + ); }, - content:function(){ + content: function () { player.draw(); - player.addTempSkill('gzsuzhi_count'); - player.addMark('gzsuzhi_count',1,false); + player.addTempSkill("gzsuzhi_count"); + player.addMark("gzsuzhi_count", 1, false); }, }, - gain:{ - audio:'gzsuzhi', - trigger:{global:'loseAfter'}, - forced:true, - filter:function(event,player){ - if(player!=_status.currentPhase||event.type!='discard'||player==event.player||player.countMark('gzsuzhi_count')>=3) return false; - return event.player.countGainableCards(player,'he')>0; + gain: { + audio: "gzsuzhi", + trigger: { global: "loseAfter" }, + forced: true, + filter: function (event, player) { + if ( + player != _status.currentPhase || + event.type != "discard" || + player == event.player || + player.countMark("gzsuzhi_count") >= 3 + ) + return false; + return event.player.countGainableCards(player, "he") > 0; }, - logTarget:'player', - content:function(){ - 'step 0' - player.addTempSkill('gzsuzhi_count'); - player.addMark('gzsuzhi_count',1,false); - if(trigger.delay==false) game.delay(); - 'step 1' - player.gainPlayerCard(trigger.player,'he',true); + logTarget: "player", + content: function () { + "step 0"; + player.addTempSkill("gzsuzhi_count"); + player.addMark("gzsuzhi_count", 1, false); + if (trigger.delay == false) game.delay(); + "step 1"; + player.gainPlayerCard(trigger.player, "he", true); }, }, - count:{ - onremove:true, + count: { + onremove: true, }, }, }, - gzfankui:{ - audio:2, - inherit:'fankui', + gzfankui: { + audio: 2, + inherit: "fankui", }, //夏侯霸 - gzbaolie:{ - audio:2, - mod:{ - targetInRange:function(card,player,target){ - if(card.name=='sha'&&target.hp>=player.hp) return true; + gzbaolie: { + audio: 2, + mod: { + targetInRange: function (card, player, target) { + if (card.name == "sha" && target.hp >= player.hp) return true; }, - cardUsableTarget:function(card,player,target){ - if(card.name=='sha'&&target.hp>=player.hp) return true; + cardUsableTarget: function (card, player, target) { + if (card.name == "sha" && target.hp >= player.hp) return true; }, }, - trigger:{player:'phaseUseBegin'}, - forced:true, - preHidden:true, - filter:function(event,player){ - return game.hasPlayer(function(current){ - return current.isEnemyOf(player)&&player.inRangeOf(current); + trigger: { player: "phaseUseBegin" }, + forced: true, + preHidden: true, + filter: function (event, player) { + return game.hasPlayer(function (current) { + return current.isEnemyOf(player) && player.inRangeOf(current); }); }, - logTarget:function(event,player){ - return game.filterPlayer(function(current){ - return current.isEnemyOf(player)&&player.inRangeOf(current); + logTarget: function (event, player) { + return game.filterPlayer(function (current) { + return current.isEnemyOf(player) && player.inRangeOf(current); }); }, - check:()=>false, - content:function(){ - 'step 0' - event.targets=game.filterPlayer(function(current){ - return current.isEnemyOf(player)&&player.inRangeOf(current); - }).sortBySeat(); - 'step 1' - var target=event.targets.shift(); - if(target.isIn()){ - event.target=target; - target.chooseToUse(function(card,player,event){ - if(get.name(card)!='sha') return false; - return lib.filter.filterCard.apply(this,arguments); - },'豹烈:对'+get.translation(player)+'使用一张杀,或令其弃置你的一张牌').set('targetRequired',true).set('complexSelect',true).set('filterTarget',function(card,player,target){ - if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false; - return lib.filter.filterTarget.apply(this,arguments); - }).set('sourcex',player); - } - else if(targets.length) event.redo(); + check: () => false, + content: function () { + "step 0"; + event.targets = game + .filterPlayer(function (current) { + return current.isEnemyOf(player) && player.inRangeOf(current); + }) + .sortBySeat(); + "step 1"; + var target = event.targets.shift(); + if (target.isIn()) { + event.target = target; + target + .chooseToUse(function (card, player, event) { + if (get.name(card) != "sha") return false; + return lib.filter.filterCard.apply(this, arguments); + }, "豹烈:对" + get.translation(player) + "使用一张杀,或令其弃置你的一张牌") + .set("targetRequired", true) + .set("complexSelect", true) + .set("filterTarget", function (card, player, target) { + if ( + target != _status.event.sourcex && + !ui.selected.targets.includes(_status.event.sourcex) + ) + return false; + return lib.filter.filterTarget.apply(this, arguments); + }) + .set("sourcex", player); + } else if (targets.length) event.redo(); else event.finish(); - 'step 2' - if(result.bool==false&&target.countCards('he')>0){ - player.discardPlayerCard(target,'he',true); + "step 2"; + if (result.bool == false && target.countCards("he") > 0) { + player.discardPlayerCard(target, "he", true); } - if(targets.length) event.goto(1); + if (targets.length) event.goto(1); }, }, //许攸 - gzchenglve:{ - audio:2, - trigger:{global:'useCardAfter'}, - filter:function(event,player){ - return event.targets.length>1&&event.player.isIn()&&event.player.isFriendOf(player); + gzchenglve: { + audio: 2, + trigger: { global: "useCardAfter" }, + filter: function (event, player) { + return event.targets.length > 1 && event.player.isIn() && event.player.isFriendOf(player); }, - logTarget:'player', - check:function(event,player){ - return get.attitude(player,event.player)>0; + logTarget: "player", + check: function (event, player) { + return get.attitude(player, event.player) > 0; }, - preHidden:true, - content:function(){ - 'step 0' + preHidden: true, + content: function () { + "step 0"; trigger.player.draw(); - if(player.hasHistory('damage',function(evt){ - return evt.card==trigger.card; - })&&game.hasPlayer(function(current){ - return current.isFriendOf(player)&&(!current.hasMark('yexinjia_mark')&&!current.hasMark('xianqu_mark')&&!current.hasMark('yinyang_mark')&&!current.hasMark('zhulianbihe_mark')) - })){ - player.chooseTarget('是否令一名己方角色获得“阴阳鱼”标记?',function(card,player,current){ - return current.isFriendOf(player)&&(!current.hasMark('yexinjia_mark')&&!current.hasMark('xianqu_mark')&&!current.hasMark('yinyang_mark')&&!current.hasMark('zhulianbihe_mark')); - }).set('ai',function(target){ - return get.attitude(_status.event.player,target)*Math.sqrt(1+target.needsToDiscard()); - }); - } - else event.finish(); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.line(target,'green'); - target.addMark('yinyang_mark',1,false); + if ( + player.hasHistory("damage", function (evt) { + return evt.card == trigger.card; + }) && + game.hasPlayer(function (current) { + return ( + current.isFriendOf(player) && + !current.hasMark("yexinjia_mark") && + !current.hasMark("xianqu_mark") && + !current.hasMark("yinyang_mark") && + !current.hasMark("zhulianbihe_mark") + ); + }) + ) { + player + .chooseTarget( + "是否令一名己方角色获得“阴阳鱼”标记?", + function (card, player, current) { + return ( + current.isFriendOf(player) && + !current.hasMark("yexinjia_mark") && + !current.hasMark("xianqu_mark") && + !current.hasMark("yinyang_mark") && + !current.hasMark("zhulianbihe_mark") + ); + } + ) + .set("ai", function (target) { + return ( + get.attitude(_status.event.player, target) * + Math.sqrt(1 + target.needsToDiscard()) + ); + }); + } else event.finish(); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.line(target, "green"); + target.addMark("yinyang_mark", 1, false); game.delayx(); } }, }, - gzshicai:{ - audio:2, - trigger:{player:'damageEnd'}, - forced:true, - preHidden:true, - filter:function(event,player){ - return event.num==1||player.countCards('he')>0; + gzshicai: { + audio: 2, + trigger: { player: "damageEnd" }, + forced: true, + preHidden: true, + filter: function (event, player) { + return event.num == 1 || player.countCards("he") > 0; }, - check:function(event,player){ - return event.num==1; + check: function (event, player) { + return event.num == 1; }, - content:function(){ - if(trigger.num==1) player.draw(); - else player.chooseToDiscard(true,'he',2); + content: function () { + if (trigger.num == 1) player.draw(); + else player.chooseToDiscard(true, "he", 2); }, }, - gzzhuosheng:{ - audio:'zhuosheng', - trigger:{global:'damageEnd'}, - logTarget:'player', - filter:function(event,player){ + gzzhuosheng: { + audio: "zhuosheng", + trigger: { global: "damageEnd" }, + logTarget: "player", + filter: function (event, player) { return event.player.isFriendOf(player); }, - preHidden:true, - content:function(){ - var target=trigger.player; - target.addTempSkill('gzzhuosheng2',{player:'phaseJieshuBegin'}); - target.draw().gaintag=['gzzhuosheng2']; + preHidden: true, + content: function () { + var target = trigger.player; + target.addTempSkill("gzzhuosheng2", { player: "phaseJieshuBegin" }); + target.draw().gaintag = ["gzzhuosheng2"]; }, }, - gzzhuosheng2:{ - onremove:function(player,skill){ + gzzhuosheng2: { + onremove: function (player, skill) { player.removeGaintag(skill); }, - mod:{ - targetInRange:function(card,player,target){ - if(!card.cards||get.type(card)!='basic') return; - for(var i of card.cards){ - if(i.hasGaintag('gzzhuosheng2')) return (game.online?player==_status.currentPhase:player.isPhaseUsing()); + mod: { + targetInRange: function (card, player, target) { + if (!card.cards || get.type(card) != "basic") return; + for (var i of card.cards) { + if (i.hasGaintag("gzzhuosheng2")) + return game.online ? player == _status.currentPhase : player.isPhaseUsing(); } }, - cardUsable:function(card,player,target){ - if(!card.cards||get.type(card)!='basic'||!(game.online?player==_status.currentPhase:player.isPhaseUsing())) return; - for(var i of card.cards){ - if(i.hasGaintag('gzzhuosheng2')) return Infinity; + cardUsable: function (card, player, target) { + if ( + !card.cards || + get.type(card) != "basic" || + !(game.online ? player == _status.currentPhase : player.isPhaseUsing()) + ) + return; + for (var i of card.cards) { + if (i.hasGaintag("gzzhuosheng2")) return Infinity; } }, - aiOrder:function(player,card,num){ - if(get.itemtype(card)=='card'&&card.hasGaintag('gzzhuosheng2')&&get.type(card)=='basic') return num-0.1; + aiOrder: function (player, card, num) { + if ( + get.itemtype(card) == "card" && + card.hasGaintag("gzzhuosheng2") && + get.type(card) == "basic" + ) + return num - 0.1; }, }, - audio:'zhuosheng', - trigger:{player:'useCard2'}, - direct:true, - filterx:function(event,player){ - if(!player.isPhaseUsing()) return false; - return player.getHistory('lose',function(evt){ - if(evt.getParent()!=event) return false; - for(var i in evt.gaintag_map){ - if(evt.gaintag_map[i].includes('gzzhuosheng2')) return true; - } - return false; - }).length>0; + audio: "zhuosheng", + trigger: { player: "useCard2" }, + direct: true, + filterx: function (event, player) { + if (!player.isPhaseUsing()) return false; + return ( + player.getHistory("lose", function (evt) { + if (evt.getParent() != event) return false; + for (var i in evt.gaintag_map) { + if (evt.gaintag_map[i].includes("gzzhuosheng2")) return true; + } + return false; + }).length > 0 + ); }, - filter:function(event,player){ - if(!lib.skill.gzzhuosheng2.filterx(event,player)) return false; - if(get.type(event.card)!='trick') return false; - if(event.targets&&event.targets.length>0) return true; - var info=get.info(event.card); - if(info.allowMultiple==false) return false; - if(event.targets&&!info.multitarget){ - if(game.hasPlayer(function(current){ - return !event.targets.includes(current)&&lib.filter.targetEnabled2(event.card,player,current)&&lib.filter.targetInRange(event.card,player,current); - })){ + filter: function (event, player) { + if (!lib.skill.gzzhuosheng2.filterx(event, player)) return false; + if (get.type(event.card) != "trick") return false; + if (event.targets && event.targets.length > 0) return true; + var info = get.info(event.card); + if (info.allowMultiple == false) return false; + if (event.targets && !info.multitarget) { + if ( + game.hasPlayer(function (current) { + return ( + !event.targets.includes(current) && + lib.filter.targetEnabled2(event.card, player, current) && + lib.filter.targetInRange(event.card, player, current) + ); + }) + ) { return true; } } return false; }, - content:function(){ - 'step 0' - var prompt2='为'+get.translation(trigger.card)+'增加或减少一个目标' - player.chooseTarget(get.prompt('gzzhuosheng2'),function(card,player,target){ - var player=_status.event.player; - if(_status.event.targets.includes(target)) return true; - return lib.filter.targetEnabled2(_status.event.card,player,target)&&lib.filter.targetInRange(_status.event.card,player,target); - }).set('prompt2',prompt2).set('ai',function(target){ - var trigger=_status.event.getTrigger(); - var player=_status.event.player; - return get.effect(target,trigger.card,player,player)*(_status.event.targets.includes(target)?-1:1); - }).set('targets',trigger.targets).set('card',trigger.card); - 'step 1' - if(result.bool){ - if(!event.isMine()&&!event.isOnline()) game.delayx(); - event.targets=result.targets; - } - else{ + content: function () { + "step 0"; + var prompt2 = "为" + get.translation(trigger.card) + "增加或减少一个目标"; + player + .chooseTarget(get.prompt("gzzhuosheng2"), function (card, player, target) { + var player = _status.event.player; + if (_status.event.targets.includes(target)) return true; + return ( + lib.filter.targetEnabled2(_status.event.card, player, target) && + lib.filter.targetInRange(_status.event.card, player, target) + ); + }) + .set("prompt2", prompt2) + .set("ai", function (target) { + var trigger = _status.event.getTrigger(); + var player = _status.event.player; + return ( + get.effect(target, trigger.card, player, player) * + (_status.event.targets.includes(target) ? -1 : 1) + ); + }) + .set("targets", trigger.targets) + .set("card", trigger.card); + "step 1"; + if (result.bool) { + if (!event.isMine() && !event.isOnline()) game.delayx(); + event.targets = result.targets; + } else { event.finish(); } - 'step 2' - if(event.targets){ - player.logSkill('gzzhuosheng2',event.targets); - if(trigger.targets.includes(event.targets[0])) trigger.targets.removeArray(event.targets); + "step 2"; + if (event.targets) { + player.logSkill("gzzhuosheng2", event.targets); + if (trigger.targets.includes(event.targets[0])) + trigger.targets.removeArray(event.targets); else trigger.targets.addArray(event.targets); } }, - group:['gzzhuosheng2_equip','gzzhuosheng2_silent'], - subSkill:{ - equip:{ - audio:'zhuosheng', - trigger:{player:'useCard'}, - filter:function(event,player){ - return get.type(event.card)=='equip'&&lib.skill.gzzhuosheng2.filterx(event,player); + group: ["gzzhuosheng2_equip", "gzzhuosheng2_silent"], + subSkill: { + equip: { + audio: "zhuosheng", + trigger: { player: "useCard" }, + filter: function (event, player) { + return ( + get.type(event.card) == "equip" && + lib.skill.gzzhuosheng2.filterx(event, player) + ); }, - prompt:'是否发动【擢升】摸一张牌?', - content:function(){ + prompt: "是否发动【擢升】摸一张牌?", + content: function () { player.draw(); }, }, - silent:{ - trigger:{ - player:'useCard1', + silent: { + trigger: { + player: "useCard1", }, - silent:true, - firstDo:true, - filter:function(event,player){ - return get.type(event.card)=='basic'&&lib.skill.gzzhuosheng2.filterx(event,player)&&event.addCount!==false; + silent: true, + firstDo: true, + filter: function (event, player) { + return ( + get.type(event.card) == "basic" && + lib.skill.gzzhuosheng2.filterx(event, player) && + event.addCount !== false + ); }, - content:function(){ - trigger.addCount=false; - var stat=player.getStat(); - if(stat&&stat.card&&stat.card[trigger.card.name]) stat.card[trigger.card.name]--; + content: function () { + trigger.addCount = false; + var stat = player.getStat(); + if (stat && stat.card && stat.card[trigger.card.name]) + stat.card[trigger.card.name]--; }, }, }, }, - gzzhuhai:{ - audio:'zhuhai', - audioname:['gz_re_xushu'], - trigger:{global:'phaseJieshuBegin'}, - direct:true, - preHidden:true, - filter:function(event,player){ - return event.player.isAlive()&&event.player.getStat('damage')&& - lib.filter.targetEnabled({name:'sha'},player,event.player)&&(player.hasSha()||_status.connectMode&&player.countCards('h')>0); + gzzhuhai: { + audio: "zhuhai", + audioname: ["gz_re_xushu"], + trigger: { global: "phaseJieshuBegin" }, + direct: true, + preHidden: true, + filter: function (event, player) { + return ( + event.player.isAlive() && + event.player.getStat("damage") && + lib.filter.targetEnabled({ name: "sha" }, player, event.player) && + (player.hasSha() || (_status.connectMode && player.countCards("h") > 0)) + ); }, - content:function(){ - var next=player.chooseToUse(function(card,player,event){ - if(get.name(card)!='sha') return false; - return lib.filter.filterCard.apply(this,arguments); - },'诛害:是否对'+get.translation(trigger.player)+'使用一张杀?').set('logSkill','gzzhuhai').set('complexSelect',true).set('filterTarget',function(card,player,target){ - if(target!=_status.event.sourcex&&!ui.selected.targets.includes(_status.event.sourcex)) return false; - return lib.filter.targetEnabled.apply(this,arguments); - }).set('sourcex',trigger.player).setHiddenSkill(event.name); - player.addTempSkill('gzzhuhai2'); - next.oncard=function(card,player){ - try{ - if(trigger.player.getHistory('sourceDamage',function(evt){ - return evt.player.isFriendOf(player); - }).length){ - player.addTempSkill('gzzhuhai2'); - card.gzzhuhai_tag=true; + content: function () { + var next = player + .chooseToUse(function (card, player, event) { + if (get.name(card) != "sha") return false; + return lib.filter.filterCard.apply(this, arguments); + }, "诛害:是否对" + get.translation(trigger.player) + "使用一张杀?") + .set("logSkill", "gzzhuhai") + .set("complexSelect", true) + .set("filterTarget", function (card, player, target) { + if ( + target != _status.event.sourcex && + !ui.selected.targets.includes(_status.event.sourcex) + ) + return false; + return lib.filter.targetEnabled.apply(this, arguments); + }) + .set("sourcex", trigger.player) + .setHiddenSkill(event.name); + player.addTempSkill("gzzhuhai2"); + next.oncard = function (card, player) { + try { + if ( + trigger.player.getHistory("sourceDamage", function (evt) { + return evt.player.isFriendOf(player); + }).length + ) { + player.addTempSkill("gzzhuhai2"); + card.gzzhuhai_tag = true; } - }catch(e){ - alert('发生了一个导致【诛害】无法正常触发无视防具效果的错误。请关闭十周年UI/手杀UI等扩展以解决'); + } catch (e) { + alert( + "发生了一个导致【诛害】无法正常触发无视防具效果的错误。请关闭十周年UI/手杀UI等扩展以解决" + ); } - } + }; }, - ai:{ - unequip_ai:true, - skillTagFilter:function(player,tag,arg){ - var evt=_status.event.getParent(); - if(evt.name!='gzzhuhai'||!arg||!arg.target) return false; - if(!arg.target.getHistory('sourceDamage',function(evt){ - return evt.player.isFriendOf(player); - }).length) return false; + ai: { + unequip_ai: true, + skillTagFilter: function (player, tag, arg) { + var evt = _status.event.getParent(); + if (evt.name != "gzzhuhai" || !arg || !arg.target) return false; + if ( + !arg.target.getHistory("sourceDamage", function (evt) { + return evt.player.isFriendOf(player); + }).length + ) + return false; return true; }, }, }, - gzzhuhai2:{ - trigger:{player:'shaMiss'}, - forced:true, - popup:false, - filter:function(event,player){ - return event.card.gzzhuhai_tag==true&&event.target.countCards('he')>0; + gzzhuhai2: { + trigger: { player: "shaMiss" }, + forced: true, + popup: false, + filter: function (event, player) { + return event.card.gzzhuhai_tag == true && event.target.countCards("he") > 0; }, - content:function(){ + content: function () { player.line(trigger.target); - trigger.target.chooseToDiscard('he',true); + trigger.target.chooseToDiscard("he", true); }, - ai:{ - unequip:true, - skillTagFilter:function(player,tag,arg){ - if(!arg||!arg.card||!arg.card.gzzhuhai_tag) return false; + ai: { + unequip: true, + skillTagFilter: function (player, tag, arg) { + if (!arg || !arg.card || !arg.card.gzzhuhai_tag) return false; }, }, }, - quanjin:{ - audio:2, - enable:'phaseUse', - usable:1, - onChooseToUse:function(event){ - if(!game.online){ - event.set('quanjin_list',game.filterPlayer((i)=>(i!=event.player&&i.getHistory('damage').length))); + quanjin: { + audio: 2, + enable: "phaseUse", + usable: 1, + onChooseToUse: function (event) { + if (!game.online) { + event.set( + "quanjin_list", + game.filterPlayer((i) => i != event.player && i.getHistory("damage").length) + ); } }, - filter:function(event,player){ - return event.quanjin_list&&event.quanjin_list.length>0&&player.countCards('h')>0; + filter: function (event, player) { + return event.quanjin_list && event.quanjin_list.length > 0 && player.countCards("h") > 0; }, - filterCard:true, - filterTarget:function(card,player,target){ + filterCard: true, + filterTarget: function (card, player, target) { return _status.event.quanjin_list.includes(target); }, - discard:false, - lose:false, - delay:false, - check:function(card){ - var evt=_status.event; - if(evt.quanjin_list.filter(function(target){ - return get.attitude(evt.player,target)>0; - }).length) return 8-get.value(card); - return 6.5-get.value(card); + discard: false, + lose: false, + delay: false, + check: function (card) { + var evt = _status.event; + if ( + evt.quanjin_list.filter(function (target) { + return get.attitude(evt.player, target) > 0; + }).length + ) + return 8 - get.value(card); + return 6.5 - get.value(card); }, - content:function(){ - 'step 0' - player.give(cards,target); - 'step 1' + content: function () { + "step 0"; + player.give(cards, target); + "step 1"; player.chooseJunlingFor(target); - 'step 2' - event.junling=result.junling; - event.targets=result.targets; - var str=get.translation(player); - target.chooseJunlingControl(player,result.junling,result.targets).set('prompt','劝进').set('choiceList',[ - '执行该军令,然后'+str+'摸一张牌', - '不执行该军令,然后其将手牌摸至与全场最多相同', - ]).set('ai',function(){ - var evt=_status.event.getParent(2),player=evt.target,source=evt.player,junling=evt.junling,targets=evt.targets; - var num=0; - game.countPlayer(function(current){ - var num2=current.countCards('h'); - if(num2>num) num=num2; + "step 2"; + event.junling = result.junling; + event.targets = result.targets; + var str = get.translation(player); + target + .chooseJunlingControl(player, result.junling, result.targets) + .set("prompt", "劝进") + .set("choiceList", [ + "执行该军令,然后" + str + "摸一张牌", + "不执行该军令,然后其将手牌摸至与全场最多相同", + ]) + .set("ai", function () { + var evt = _status.event.getParent(2), + player = evt.target, + source = evt.player, + junling = evt.junling, + targets = evt.targets; + var num = 0; + game.countPlayer(function (current) { + var num2 = current.countCards("h"); + if (num2 > num) num = num2; + }); + num = Math.max(0, num - source.countCards("h")); + if (num > 1) { + if (get.attitude(player, target) > 0) + return get.junlingEffect(source, junling, player, targets, player) > num; + return get.junlingEffect(source, junling, player, targets, player) > -num; + } + if (get.attitude(player, target) > 0) + return get.junlingEffect(source, junling, player, targets, player) > 0; + return get.junlingEffect(source, junling, player, targets, player) > 1; }); - num=Math.max(0,num-source.countCards('h')); - if(num>1){ - if(get.attitude(player,target)>0) return get.junlingEffect(source,junling,player,targets,player)>num; - return get.junlingEffect(source,junling,player,targets,player)>-num; - } - if(get.attitude(player,target)>0) return get.junlingEffect(source,junling,player,targets,player)>0; - return get.junlingEffect(source,junling,player,targets,player)>1; - }); - 'step 3' - if(result.index==0){ - target.carryOutJunling(player,event.junling,targets); + "step 3"; + if (result.index == 0) { + target.carryOutJunling(player, event.junling, targets); player.draw(); - } - else{ - var num=0; - game.countPlayer(function(current){ - var num2=current.countCards('h'); - if(num2>num) num=num2; + } else { + var num = 0; + game.countPlayer(function (current) { + var num2 = current.countCards("h"); + if (num2 > num) num = num2; }); - num-=player.countCards('h'); - if(num>0) player.draw(Math.min(num,5)); + num -= player.countCards("h"); + if (num > 0) player.draw(Math.min(num, 5)); } }, - ai:{ - order:1, - result:{ - player:function(player,target){ - if(get.attitude(player,target)>0) return 3.3; - var num=0; - game.countPlayer(function(current){ - var num2=current.countCards('h'); - if(player==current) num2--; - if(target==current) num2++; - if(num2>num) num=num2; + ai: { + order: 1, + result: { + player: function (player, target) { + if (get.attitude(player, target) > 0) return 3.3; + var num = 0; + game.countPlayer(function (current) { + var num2 = current.countCards("h"); + if (player == current) num2--; + if (target == current) num2++; + if (num2 > num) num = num2; }); - num=Math.max(0,num-player.countCards('h')); - if(!num) return 0; - if(num>1) return 2; - if(ui.selected.cards.length&&get.value(ui.selected.cards[0])>5) return 0; + num = Math.max(0, num - player.countCards("h")); + if (!num) return 0; + if (num > 1) return 2; + if (ui.selected.cards.length && get.value(ui.selected.cards[0]) > 5) return 0; return 1; }, }, }, }, - zaoyun:{ - audio:2, - enable:'phaseUse', - usable:1, - filter:function(event,player){ - var num=player.countCards('h'); - return game.hasPlayer(function(current){ - if(current.isEnemyOf(player)){ - var dist=get.distance(player,current); - return dist>1&&dist<=num; + zaoyun: { + audio: 2, + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + var num = player.countCards("h"); + return game.hasPlayer(function (current) { + if (current.isEnemyOf(player)) { + var dist = get.distance(player, current); + return dist > 1 && dist <= num; } }); }, - selectCard:function(){ - var list=[],player=_status.event.player; - if(ui.selected.targets.length) return get.distance(player,ui.selected.targets[0])-1; - game.countPlayer(function(current){ - if(current.isEnemyOf(player)){ - var dist=get.distance(player,current); - if(dist>1) list.push(dist-1); + selectCard: function () { + var list = [], + player = _status.event.player; + if (ui.selected.targets.length) return get.distance(player, ui.selected.targets[0]) - 1; + game.countPlayer(function (current) { + if (current.isEnemyOf(player)) { + var dist = get.distance(player, current); + if (dist > 1) list.push(dist - 1); } }); list.sort(); - return [list[0],list[list.length-1]]; + return [list[0], list[list.length - 1]]; }, - filterCard:true, - filterTarget:function(card,player,target){ - return target.isEnemyOf(player)&&get.distance(player,target)==ui.selected.cards.length+1; + filterCard: true, + filterTarget: function (card, player, target) { + return ( + target.isEnemyOf(player) && + get.distance(player, target) == ui.selected.cards.length + 1 + ); }, - check:function(card){ - var player=_status.event.player; - if(ui.selected.cards.length&&game.hasPlayer(function(current){ - return current.isEnemyOf(player)&&get.distance(player,current)==(ui.selected.cards.length+1)&&get.damageEffect(current,player,player)>0; - })) return 0; - return (7-ui.selected.cards.length*2)-get.value(card); + check: function (card) { + var player = _status.event.player; + if ( + ui.selected.cards.length && + game.hasPlayer(function (current) { + return ( + current.isEnemyOf(player) && + get.distance(player, current) == ui.selected.cards.length + 1 && + get.damageEffect(current, player, player) > 0 + ); + }) + ) + return 0; + return 7 - ui.selected.cards.length * 2 - get.value(card); }, - content:function(){ - target.damage('nocard'); - if(!player.storage.zaoyun2) player.storage.zaoyun2=[]; + content: function () { + target.damage("nocard"); + if (!player.storage.zaoyun2) player.storage.zaoyun2 = []; player.storage.zaoyun2.push(target); - player.addTempSkill('zaoyun2'); + player.addTempSkill("zaoyun2"); }, - ai:{ - order:5, - result:{ - target:function(player,target){ - return get.damageEffect(target,player,target); + ai: { + order: 5, + result: { + target: function (player, target) { + return get.damageEffect(target, player, target); }, }, }, }, - zaoyun2:{ - onremove:true, - charlotte:true, - mod:{ - globalFrom:function(player,target){ - if(player.getStorage('zaoyun2').includes((target))) return -Infinity; + zaoyun2: { + onremove: true, + charlotte: true, + mod: { + globalFrom: function (player, target) { + if (player.getStorage("zaoyun2").includes(target)) return -Infinity; }, }, }, - gzzhidao:{ - audio:2, - trigger:{player:'phaseUseBegin'}, - forced:true, - preHidden:true, - content:function(){ - 'step 0' - player.chooseTarget('请选择【雉盗】的目标','本回合内只能对自己和该角色使用牌,且第一次对其造成伤害时摸一张牌',lib.filter.notMe,true).set('ai',function(target){ - var player=_status.event.player; - return (1-get.sgn(get.attitude(player,target)))*Math.max(1,get.distance(player,target)); - }); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - player.line(target,'green'); - game.log(player,'选择了',target); - player.storage.gzzhidao2=target; - player.addTempSkill('gzzhidao2'); + gzzhidao: { + audio: 2, + trigger: { player: "phaseUseBegin" }, + forced: true, + preHidden: true, + content: function () { + "step 0"; + player + .chooseTarget( + "请选择【雉盗】的目标", + "本回合内只能对自己和该角色使用牌,且第一次对其造成伤害时摸一张牌", + lib.filter.notMe, + true + ) + .set("ai", function (target) { + var player = _status.event.player; + return ( + (1 - get.sgn(get.attitude(player, target))) * + Math.max(1, get.distance(player, target)) + ); + }); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.line(target, "green"); + game.log(player, "选择了", target); + player.storage.gzzhidao2 = target; + player.addTempSkill("gzzhidao2"); } }, }, - gzzhidao2:{ - mod:{ - playerEnabled:function(card,player,target){ - if(target!=player&&target!=player.storage.gzzhidao2) return false; + gzzhidao2: { + mod: { + playerEnabled: function (card, player, target) { + if (target != player && target != player.storage.gzzhidao2) return false; }, - globalFrom:function(from,to){ - if(to==from.storage.gzzhidao2) return -Infinity; + globalFrom: function (from, to) { + if (to == from.storage.gzzhidao2) return -Infinity; }, }, - audio:'gzzhidao', - trigger:{source:'damageSource'}, - forced:true, - charlotte:true, - filter:function(event,player){ - return event.player==player.storage.gzzhidao2&&player.getHistory('sourceDamage',function(evt){ - return evt.player==event.player; - }).indexOf(event)==0&&event.player.countGainableCards(player,'hej')>0; + audio: "gzzhidao", + trigger: { source: "damageSource" }, + forced: true, + charlotte: true, + filter: function (event, player) { + return ( + event.player == player.storage.gzzhidao2 && + player + .getHistory("sourceDamage", function (evt) { + return evt.player == event.player; + }) + .indexOf(event) == 0 && + event.player.countGainableCards(player, "hej") > 0 + ); }, - logTarget:'player', - content:function(){ - player.gainPlayerCard(trigger.player,'hej',true); + logTarget: "player", + content: function () { + player.gainPlayerCard(trigger.player, "hej", true); }, }, - gzyjili:{ - audio:2, - forced:true, - preHidden:['gzyjili_remove'], - trigger:{target:'useCardToTargeted'}, - filter:function(event,player){ - if(get.color(event.card)!='red'||event.targets.length!=1) return false; - var type=get.type(event.card); - return type=='basic'||type=='trick'; + gzyjili: { + audio: 2, + forced: true, + preHidden: ["gzyjili_remove"], + trigger: { target: "useCardToTargeted" }, + filter: function (event, player) { + if (get.color(event.card) != "red" || event.targets.length != 1) return false; + var type = get.type(event.card); + return type == "basic" || type == "trick"; }, - check:function(){ + check: function () { return false; }, - content:function(){ - player.addTempSkill('gzyjili2'); - var evt=trigger.getParent(); - if(!evt.gzyjili) evt.gzyjili=[]; + content: function () { + player.addTempSkill("gzyjili2"); + var evt = trigger.getParent(); + if (!evt.gzyjili) evt.gzyjili = []; evt.gzyjili.add(player); }, - group:'gzyjili_remove', - subSkill:{ - remove:{ - audio:'gzyjili', - trigger:{player:'damageBegin2'}, - forced:true, - filter:function(event,player){ - var evt=false; - for(var i of lib.phaseName){ - evt=event.getParent(i); - if(evt&&evt.player) break; + group: "gzyjili_remove", + subSkill: { + remove: { + audio: "gzyjili", + trigger: { player: "damageBegin2" }, + forced: true, + filter: function (event, player) { + var evt = false; + for (var i of lib.phaseName) { + evt = event.getParent(i); + if (evt && evt.player) break; } - return evt&&evt.player&&player.getHistory('damage',function(evtx){ - return evtx.getParent(evt.name)==evt; - }).length==1; + return ( + evt && + evt.player && + player.getHistory("damage", function (evtx) { + return evtx.getParent(evt.name) == evt; + }).length == 1 + ); }, - content:function(){ + content: function () { trigger.cancel(); - player.removeCharacter(player.name1=='gz_yanbaihu'?0:1); + player.removeCharacter(player.name1 == "gz_yanbaihu" ? 0 : 1); }, }, }, }, - gzyjili2:{ - trigger:{global:'useCardAfter'}, - charlotte:true, - popup:false, - forced:true, - filter:function(event,player){ - return event.gzyjili&&event.gzyjili.includes(player)&&!event.addedTarget&&event.player - &&event.player.isAlive()&&event.player.canUse({ - name:event.card.name, - nature:event.card.nature, - isCard:true, - },player); + gzyjili2: { + trigger: { global: "useCardAfter" }, + charlotte: true, + popup: false, + forced: true, + filter: function (event, player) { + return ( + event.gzyjili && + event.gzyjili.includes(player) && + !event.addedTarget && + event.player && + event.player.isAlive() && + event.player.canUse( + { + name: event.card.name, + nature: event.card.nature, + isCard: true, + }, + player + ) + ); }, - content:function(){ - trigger.player.useCard({ - name:trigger.card.name, - nature:trigger.card.nature, - isCard:true, - },player,false); - }, - }, - donggui:{ - audio:2, - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return game.hasPlayer(function(current){ - return lib.skill.donggui.filterTarget(null,player,current); - }); - }, - filterTarget:function(card,player,target){ - return target!=player&&!target.isUnseen(2)&&player.canUse('diaohulishan',target); - }, - content:function(){ - 'step 0' - player.chooseButton(['暗置'+get.translation(target)+'的一张武将牌',[[target.name1,target.name2],'character']],true).set('filterButton',function(button){ - return !get.is.jun(button.link); - }); - 'step 1' - var target1=target.getNext(); - var target2=target.getPrevious(); - if(target1==target2||target.inline(target1)||target.inline(target2)||target1.inline(target2)) event.finish(); - else{ - event.target1=target1; - event.target2=target2; - } - target.hideCharacter(result.links[0]==target.name1?0:1); - target.addTempSkill('donggui2'); - player.useCard({name:'diaohulishan',isCard:true},target); - 'step 2' - if(event.target1.inline(event.target2)){ - player.draw(game.countPlayer(function(current){ - return current.inline(event.target1); - })); - } - }, - ai:{ - order:2, - result:{ - player:function(player,target){ - var target1=target.getNext(); - var target2=target.getPrevious(); - if(target1==target2||target.inline(target1)||target.inline(target2)||target1.inline(target2)||!target1.isFriendOf(target2)) return 0; - var num=game.countPlayer(function(current){ - return current!=target1&¤t!=target2&&(current.inline(target1)||current.inline(target2)); - }); - return 2+num; + content: function () { + trigger.player.useCard( + { + name: trigger.card.name, + nature: trigger.card.nature, + isCard: true, }, - }, + player, + false + ); }, }, - donggui2:{ai:{nomingzhi:true}}, - fengyang:{ - audio:2, - zhenfa:'inline', - trigger:{player:'phaseJieshuBegin'}, - filter:function(event,player){ - var bool=player.hasSkill('fengyang'); - return game.hasPlayer(function(current){ - return current!=player&¤t.inline(player); - })&&game.hasPlayer(function(current){ - return (current==player||bool)&¤t.inline(player)&¤t.countCards('e')>0; + donggui: { + audio: 2, + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + return game.hasPlayer(function (current) { + return lib.skill.donggui.filterTarget(null, player, current); }); }, - direct:true, - preHidden:true, - content:function(){ - 'step 0' - event.list=game.filterPlayer(function(current){ - return current.inline(player); - }).sortBySeat(); - 'step 1' - var target=event.list.shift(); - if((target==player||player.hasSkill('fengyang'))&&target.countCards('e')){ - event.target=target; - var next=target.chooseToDiscard('e',get.prompt('fengyang'),'弃置装备区内的一张牌并摸两张牌').set('ai',function(card){ - return 5.5-get.value(card); + filterTarget: function (card, player, target) { + return target != player && !target.isUnseen(2) && player.canUse("diaohulishan", target); + }, + content: function () { + "step 0"; + player + .chooseButton( + [ + "暗置" + get.translation(target) + "的一张武将牌", + [[target.name1, target.name2], "character"], + ], + true + ) + .set("filterButton", function (button) { + return !get.is.jun(button.link); }); - next.logSkill='fengyang'; - if(player==target) next.setHiddenSkill('fengyang'); + "step 1"; + var target1 = target.getNext(); + var target2 = target.getPrevious(); + if ( + target1 == target2 || + target.inline(target1) || + target.inline(target2) || + target1.inline(target2) + ) + event.finish(); + else { + event.target1 = target1; + event.target2 = target2; } - else event.goto(3); - 'step 2' - if(result.bool){ + target.hideCharacter(result.links[0] == target.name1 ? 0 : 1); + target.addTempSkill("donggui2"); + player.useCard({ name: "diaohulishan", isCard: true }, target); + "step 2"; + if (event.target1.inline(event.target2)) { + player.draw( + game.countPlayer(function (current) { + return current.inline(event.target1); + }) + ); + } + }, + ai: { + order: 2, + result: { + player: function (player, target) { + var target1 = target.getNext(); + var target2 = target.getPrevious(); + if ( + target1 == target2 || + target.inline(target1) || + target.inline(target2) || + target1.inline(target2) || + !target1.isFriendOf(target2) + ) + return 0; + var num = game.countPlayer(function (current) { + return ( + current != target1 && + current != target2 && + (current.inline(target1) || current.inline(target2)) + ); + }); + return 2 + num; + }, + }, + }, + }, + donggui2: { ai: { nomingzhi: true } }, + fengyang: { + audio: 2, + zhenfa: "inline", + trigger: { player: "phaseJieshuBegin" }, + filter: function (event, player) { + var bool = player.hasSkill("fengyang"); + return ( + game.hasPlayer(function (current) { + return current != player && current.inline(player); + }) && + game.hasPlayer(function (current) { + return ( + (current == player || bool) && + current.inline(player) && + current.countCards("e") > 0 + ); + }) + ); + }, + direct: true, + preHidden: true, + content: function () { + "step 0"; + event.list = game + .filterPlayer(function (current) { + return current.inline(player); + }) + .sortBySeat(); + "step 1"; + var target = event.list.shift(); + if ((target == player || player.hasSkill("fengyang")) && target.countCards("e")) { + event.target = target; + var next = target + .chooseToDiscard("e", get.prompt("fengyang"), "弃置装备区内的一张牌并摸两张牌") + .set("ai", function (card) { + return 5.5 - get.value(card); + }); + next.logSkill = "fengyang"; + if (player == target) next.setHiddenSkill("fengyang"); + } else event.goto(3); + "step 2"; + if (result.bool) { target.draw(2); } - 'step 3' - if(event.list.length) event.goto(1); + "step 3"; + if (event.list.length) event.goto(1); }, }, - fengyang_old:{ - audio:'fengyang', - zhenfa:'inline', - global:'fengyang_old_nogain', - subSkill:{ - nogain:{ - mod:{ - canBeDiscarded:function(card,player,target){ - if(get.position(card)=='e'&&player.identity!=target.identity&&game.hasPlayer(function(current){ - return current.hasSkill('fengyang_old')&&(current==target||target.inline(current)); - })) return false; + fengyang_old: { + audio: "fengyang", + zhenfa: "inline", + global: "fengyang_old_nogain", + subSkill: { + nogain: { + mod: { + canBeDiscarded: function (card, player, target) { + if ( + get.position(card) == "e" && + player.identity != target.identity && + game.hasPlayer(function (current) { + return ( + current.hasSkill("fengyang_old") && + (current == target || target.inline(current)) + ); + }) + ) + return false; }, - canBeGained:function(card,player,target){ - if(get.position(card)=='e'&&player.identity!=target.identity&&game.hasPlayer(function(current){ - return current.hasSkill('fengyang_old')&&(current==target||target.inline(current)); - })) return false; + canBeGained: function (card, player, target) { + if ( + get.position(card) == "e" && + player.identity != target.identity && + game.hasPlayer(function (current) { + return ( + current.hasSkill("fengyang_old") && + (current == target || target.inline(current)) + ); + }) + ) + return false; }, }, }, }, }, - gzrekuangcai:{ - audio:'gzkuangcai', - forced:true, - preHidden:true, - trigger:{player:'phaseDiscardBegin'}, - filter:function(event,player){ - return !player.getHistory('useCard').length||!player.getHistory('sourceDamage').length; + gzrekuangcai: { + audio: "gzkuangcai", + forced: true, + preHidden: true, + trigger: { player: "phaseDiscardBegin" }, + filter: function (event, player) { + return !player.getHistory("useCard").length || !player.getHistory("sourceDamage").length; }, - check:function(event,player){ - return !player.getHistory('useCard').length; + check: function (event, player) { + return !player.getHistory("useCard").length; }, - content:function(){ - lib.skill.rekuangcai.change(player,player.getHistory('useCard').length?-1:1); + content: function () { + lib.skill.rekuangcai.change(player, player.getHistory("useCard").length ? -1 : 1); }, - mod:{ - targetInRange:function(card,player){ - if(player==_status.currentPhase) return true; + mod: { + targetInRange: function (card, player) { + if (player == _status.currentPhase) return true; }, - cardUsable:function(card,player){ - if(player==_status.currentPhase) return Infinity; + cardUsable: function (card, player) { + if (player == _status.currentPhase) return Infinity; }, }, }, - gzkuangcai:{ - audio:2, - trigger:{player:'useCard1'}, - forced:true, - firstDo:true, - noHidden:true, - preHidden:['gzkuangcai_discard'], - filter:function(event,player){ - return player==_status.currentPhase&&get.type(event.card)=='trick'; + gzkuangcai: { + audio: 2, + trigger: { player: "useCard1" }, + forced: true, + firstDo: true, + noHidden: true, + preHidden: ["gzkuangcai_discard"], + filter: function (event, player) { + return player == _status.currentPhase && get.type(event.card) == "trick"; }, - content:function(){ - trigger.nowuxie=true; + content: function () { + trigger.nowuxie = true; }, - mod:{ - targetInRange:function(card,player){ - if(player==_status.currentPhase) return true; + mod: { + targetInRange: function (card, player) { + if (player == _status.currentPhase) return true; }, - cardUsable:function(card,player){ - if(player==_status.currentPhase) return Infinity; + cardUsable: function (card, player) { + if (player == _status.currentPhase) return Infinity; }, }, - ai:{ - unequip:true, - skillTagFilter:function(player){ - return player==_status.currentPhase; + ai: { + unequip: true, + skillTagFilter: function (player) { + return player == _status.currentPhase; }, }, - group:'gzkuangcai_discard', - subSkill:{ - discard:{ - audio:'gzkuangcai', - trigger:{player:'phaseDiscardBegin'}, - forced:true, - filter:function(event,player){ - var use=player.getHistory('useCard').length; - var damage=(player.getStat('damage')||0); - if(use&&!damage) return true; - if(damage>=use) return true; + group: "gzkuangcai_discard", + subSkill: { + discard: { + audio: "gzkuangcai", + trigger: { player: "phaseDiscardBegin" }, + forced: true, + filter: function (event, player) { + var use = player.getHistory("useCard").length; + var damage = player.getStat("damage") || 0; + if (use && !damage) return true; + if (damage >= use) return true; return false; }, - check:function(event,player){ - var use=player.getHistory('useCard').length; - var damage=(player.getStat('damage')||0); - if(use&&!damage) return false; + check: function (event, player) { + var use = player.getHistory("useCard").length; + var damage = player.getStat("damage") || 0; + if (use && !damage) return false; return true; }, - content:function(){ - var use=player.getHistory('useCard').length; - var damage=(player.getStat('damage')||0); - if(use&&!damage) player.addTempSkill('gzkuangcai_less') - else{ + content: function () { + var use = player.getHistory("useCard").length; + var damage = player.getStat("damage") || 0; + if (use && !damage) player.addTempSkill("gzkuangcai_less"); + else { player.drawTo(player.maxHp); - player.addTempSkill('gzkuangcai_more'); + player.addTempSkill("gzkuangcai_more"); } }, }, - more:{ - mod:{ - maxHandcard:function(player,num){ - return num+2; + more: { + mod: { + maxHandcard: function (player, num) { + return num + 2; }, }, - charlotte:true, + charlotte: true, }, - less:{ - mod:{ - maxHandcard:function(player,num){ - return num-2; + less: { + mod: { + maxHandcard: function (player, num) { + return num - 2; }, }, - charlotte:true, + charlotte: true, }, }, }, - gzshejian:{ - audio:2, - preHidden:true, - trigger:{target:'useCardToTargeted'}, - filter:function(event,player){ - if(player==event.player||event.targets.length!=1) return false; - var hs=player.getCards('h'); - if(hs.length==0) return false; - for(var i of hs){ - if(!lib.filter.cardDiscardable(i,player,'gzshejian')) return false; + gzshejian: { + audio: 2, + preHidden: true, + trigger: { target: "useCardToTargeted" }, + filter: function (event, player) { + if (player == event.player || event.targets.length != 1) return false; + var hs = player.getCards("h"); + if (hs.length == 0) return false; + for (var i of hs) { + if (!lib.filter.cardDiscardable(i, player, "gzshejian")) return false; } return true; }, - check:function(event,player){ - var target=event.player; - if(get.damageEffect(target,player,player)<=0) return false; - if(target.hp<=(player.hasSkill('gzcongjian')?2:1)&&!target.getEquip('huxinjing')&&!game.hasPlayer(function(current){ - return current!=target&&!current.isFriendOf(player); - })) return true; - if(player.hasSkill('lirang')&&player.hasFriend()) return true; - if((event.card.name=='guohe'||event.card.name=='shunshou'||event.card.name=='zhujinqiyuan')&&player.countCards('h')==1) return true; - if(player.countCards('h')<3&&!player.countCards('h',function(card){ - return get.value(card,player)>5; - })) return true; - if(player.hp<=event.getParent().baseDamage){ - if(get.tag(event.card,'respondSha')){ - if(player.countCards('h',{name:'sha'})==0){ + check: function (event, player) { + var target = event.player; + if (get.damageEffect(target, player, player) <= 0) return false; + if ( + target.hp <= (player.hasSkill("gzcongjian") ? 2 : 1) && + !target.getEquip("huxinjing") && + !game.hasPlayer(function (current) { + return current != target && !current.isFriendOf(player); + }) + ) + return true; + if (player.hasSkill("lirang") && player.hasFriend()) return true; + if ( + (event.card.name == "guohe" || + event.card.name == "shunshou" || + event.card.name == "zhujinqiyuan") && + player.countCards("h") == 1 + ) + return true; + if ( + player.countCards("h") < 3 && + !player.countCards("h", function (card) { + return get.value(card, player) > 5; + }) + ) + return true; + if (player.hp <= event.getParent().baseDamage) { + if (get.tag(event.card, "respondSha")) { + if (player.countCards("h", { name: "sha" }) == 0) { return true; } - } - else if(get.tag(event.card,'respondShan')){ - if(player.countCards('h',{name:'shan'})==0){ + } else if (get.tag(event.card, "respondShan")) { + if (player.countCards("h", { name: "shan" }) == 0) { return true; } - } - else if(get.tag(event.card,'damage')){ - if(event.card.name=='shuiyanqijunx') return player.countCards('e')==0; + } else if (get.tag(event.card, "damage")) { + if (event.card.name == "shuiyanqijunx") return player.countCards("e") == 0; return true; } } return false; }, - logTarget:'player', - content:function(){ - 'step 0' - var cards=player.getCards('h'); - event.num=cards.length; + logTarget: "player", + content: function () { + "step 0"; + var cards = player.getCards("h"); + event.num = cards.length; player.discard(cards); - 'step 1' - var target=trigger.player,str=get.translation(target); - event.target=target; - if(!target.isIn()) event.finish(); - else if(!target.hasCard(function(card){ - return lib.filter.canBeDiscarded(card,player,target); - },'he')) event._result={index:1}; - else player.chooseControl().set('choiceList',[ - '弃置'+str+'的'+get.cnNumber(num)+'张牌', - '对'+str+'造成1点伤害', - ]).set('ai',()=>1); - 'step 2' - if(result.index==0) player.discardPlayerCard(target,num,true,'he'); + "step 1"; + var target = trigger.player, + str = get.translation(target); + event.target = target; + if (!target.isIn()) event.finish(); + else if ( + !target.hasCard(function (card) { + return lib.filter.canBeDiscarded(card, player, target); + }, "he") + ) + event._result = { index: 1 }; + else + player + .chooseControl() + .set("choiceList", [ + "弃置" + str + "的" + get.cnNumber(num) + "张牌", + "对" + str + "造成1点伤害", + ]) + .set("ai", () => 1); + "step 2"; + if (result.index == 0) player.discardPlayerCard(target, num, true, "he"); else target.damage(); }, }, - gzpozhen:{ - audio:2, - trigger:{global:'phaseBegin'}, - limited:true, - preHidden:true, - filter:function(event,player){ - return player!=event.player; + gzpozhen: { + audio: 2, + trigger: { global: "phaseBegin" }, + limited: true, + preHidden: true, + filter: function (event, player) { + return player != event.player; }, - logTarget:'player', - skillAnimation:true, - animationColor:'orange', - check:function(event,player){ - var target=event.player; - if(get.attitude(player,target)>=-3) return false; - if(event.player.hasJudge('lebu')&&!game.hasPlayer(function(current){ - return get.attitude(current,target)>0&¤t.hasWuxie(); - })) return false; - var num=Math.min(target.getCardUsable('sha'),target.countCards('h',function(card){ - return get.name(card,target)=='sha'&&target.hasValueTarget(card); - }))+target.countCards('h',function(card){ - return get.name(card,target)!='sha'&&target.hasValueTarget(card); - }); - return num>=Math.max(2,target.hp); + logTarget: "player", + skillAnimation: true, + animationColor: "orange", + check: function (event, player) { + var target = event.player; + if (get.attitude(player, target) >= -3) return false; + if ( + event.player.hasJudge("lebu") && + !game.hasPlayer(function (current) { + return get.attitude(current, target) > 0 && current.hasWuxie(); + }) + ) + return false; + var num = + Math.min( + target.getCardUsable("sha"), + target.countCards("h", function (card) { + return get.name(card, target) == "sha" && target.hasValueTarget(card); + }) + ) + + target.countCards("h", function (card) { + return get.name(card, target) != "sha" && target.hasValueTarget(card); + }); + return num >= Math.max(2, target.hp); }, - content:function(){ - 'step 0' - player.awakenSkill('gzpozhen'); - var target=trigger.player; - target.addTempSkill('gzpozhen2'); - var list=game.filterPlayer(function(current){ - return current!=target&&(current.inline(target)|| - (current==target.getNext().getNext()&¤t.siege(target.getNext())||current==target.getPrevious().getPrevious()&¤t.siege(target.getPrevious()))); + content: function () { + "step 0"; + player.awakenSkill("gzpozhen"); + var target = trigger.player; + target.addTempSkill("gzpozhen2"); + var list = game.filterPlayer(function (current) { + return ( + current != target && + (current.inline(target) || + (current == target.getNext().getNext() && current.siege(target.getNext())) || + (current == target.getPrevious().getPrevious() && + current.siege(target.getPrevious()))) + ); }); - if(list.length){ + if (list.length) { list.add(target); list.sortBySeat(target); - event.targets=list; - } - else event.finish(); - 'step 1' - var target=targets.shift(); - if(target.countDiscardableCards(player,'he')>0) player.discardPlayerCard(target,'he',true).boolline=true; - if(targets.length) event.redo(); + event.targets = list; + } else event.finish(); + "step 1"; + var target = targets.shift(); + if (target.countDiscardableCards(player, "he") > 0) + player.discardPlayerCard(target, "he", true).boolline = true; + if (targets.length) event.redo(); }, }, - gzpozhen2:{ - mod:{ - cardEnabled2:function(card){ - if(get.position(card)=='h') return false; + gzpozhen2: { + mod: { + cardEnabled2: function (card) { + if (get.position(card) == "h") return false; }, - cardRecastable:function(card){ - if(get.position(card)=='h') return false; + cardRecastable: function (card) { + if (get.position(card) == "h") return false; }, }, }, - gzjiancai:{ - audio:2, - viceSkill:true, - trigger:{global:'damageBegin4'}, - preHidden:true, - init:function(player,skill){ - if(player.checkViceSkill(skill)&&!player.viceChanged) player.removeMaxHp(); + gzjiancai: { + audio: 2, + viceSkill: true, + trigger: { global: "damageBegin4" }, + preHidden: true, + init: function (player, skill) { + if (player.checkViceSkill(skill) && !player.viceChanged) player.removeMaxHp(); }, - filter:function(event,player){ - return event.player.isFriendOf(player)&&event.num>=event.player.hp; + filter: function (event, player) { + return event.player.isFriendOf(player) && event.num >= event.player.hp; }, - check:function(event,player){ - if(get.attitude(player,event.player)<3) return false; - if(event.num>=1||player.storage.gzpozhen) return true; - if(player.countCards('h',function(card){ - var mod2=game.checkMod(card,player,'unchanged','cardEnabled2',player); - if(mod2!='unchanged') return mod2; - var mod=game.checkMod(card,player,event.player,'unchanged','cardSavable',player); - if(mod!='unchanged') return mod; - var savable=get.info(card).savable; - if(typeof savable=='function') savable=savable(card,player,event.player); - return savable; - })>=1+event.num-event.player.hp) return false; + check: function (event, player) { + if (get.attitude(player, event.player) < 3) return false; + if (event.num >= 1 || player.storage.gzpozhen) return true; + if ( + player.countCards("h", function (card) { + var mod2 = game.checkMod(card, player, "unchanged", "cardEnabled2", player); + if (mod2 != "unchanged") return mod2; + var mod = game.checkMod( + card, + player, + event.player, + "unchanged", + "cardSavable", + player + ); + if (mod != "unchanged") return mod; + var savable = get.info(card).savable; + if (typeof savable == "function") savable = savable(card, player, event.player); + return savable; + }) >= + 1 + event.num - event.player.hp + ) + return false; return true; }, - logTarget:'player', - skillAnimation:true, - animationColor:'orange', - content:function(){ + logTarget: "player", + skillAnimation: true, + animationColor: "orange", + content: function () { trigger.cancel(); player.changeVice(); }, - group:'gzjiancai_add', - subSkill:{ - add:{ - trigger:{global:'changeViceBegin'}, - logTarget:'player', - forced:true, - locked:false, - prompt:function(event,player){ - return get.translation(event.player)+'即将变更副将,是否发动【荐才】,令其此次变更副将时增加两张可选武将牌?'; + group: "gzjiancai_add", + subSkill: { + add: { + trigger: { global: "changeViceBegin" }, + logTarget: "player", + forced: true, + locked: false, + prompt: function (event, player) { + return ( + get.translation(event.player) + + "即将变更副将,是否发动【荐才】,令其此次变更副将时增加两张可选武将牌?" + ); }, - filter:function(event,player){ + filter: function (event, player) { return event.player.isFriendOf(player); }, - content:function(){ - trigger.num+=2; + content: function () { + trigger.num += 2; }, }, }, }, - gzxingzhao:{ - audio:2, - getNum:function(){ - var list=[],players=game.filterPlayer(); - for(var target of players){ - if(target.isUnseen()||target.isHealthy()) continue; - var add=true; - for(var i of list){ - if(i.isFriendOf(target)){ - add=false; + gzxingzhao: { + audio: 2, + getNum: function () { + var list = [], + players = game.filterPlayer(); + for (var target of players) { + if (target.isUnseen() || target.isHealthy()) continue; + var add = true; + for (var i of list) { + if (i.isFriendOf(target)) { + add = false; break; } } - if(add) list.add(target); + if (add) list.add(target); } return list.length; }, - mod:{ - maxHandcard:function(player,num){ - return num+(lib.skill.gzxingzhao.getNum()>2?4:0); + mod: { + maxHandcard: function (player, num) { + return num + (lib.skill.gzxingzhao.getNum() > 2 ? 4 : 0); }, }, - group:['gzxingzhao_xunxun','gzxingzhao_use','gzxingzhao_lose'], - preHidden:['gzxingzhao_xunxun','gzxingzhao_use','gzxingzhao_lose'], - subfrequent:['use'], - subSkill:{ - xunxun:{ - audio:2, - name:'恂恂', - description:'摸牌阶段,你可以观看牌堆顶的四张牌,然后将其中的两张牌置于牌堆顶,并将其余的牌以任意顺序置于牌堆底。', - trigger:{player:'phaseDrawBegin1'}, - filter:function(event,player){ - return lib.skill.gzxingzhao.getNum()>0; + group: ["gzxingzhao_xunxun", "gzxingzhao_use", "gzxingzhao_lose"], + preHidden: ["gzxingzhao_xunxun", "gzxingzhao_use", "gzxingzhao_lose"], + subfrequent: ["use"], + subSkill: { + xunxun: { + audio: 2, + name: "恂恂", + description: + "摸牌阶段,你可以观看牌堆顶的四张牌,然后将其中的两张牌置于牌堆顶,并将其余的牌以任意顺序置于牌堆底。", + trigger: { player: "phaseDrawBegin1" }, + filter: function (event, player) { + return lib.skill.gzxingzhao.getNum() > 0; }, - content:function(){ - 'step 0' - var cards=get.cards(4); + content: function () { + "step 0"; + var cards = get.cards(4); game.cardsGotoOrdering(cards); - var next=player.chooseToMove('恂恂:将两张牌置于牌堆顶',true); - next.set('list',[ - ['牌堆顶',cards], - ['牌堆底'], - ]); - next.set('filterMove',function(from,to,moved){ - if(to==1&&moved[1].length>=2) return false; + var next = player.chooseToMove("恂恂:将两张牌置于牌堆顶", true); + next.set("list", [["牌堆顶", cards], ["牌堆底"]]); + next.set("filterMove", function (from, to, moved) { + if (to == 1 && moved[1].length >= 2) return false; return true; }); - next.set('filterOk',function(moved){ - return moved[1].length==2; + next.set("filterOk", function (moved) { + return moved[1].length == 2; }); - next.set('processAI',function(list){ - var cards=list[0][1].slice(0).sort(function(a,b){ - return get.value(b)-get.value(a); + next.set("processAI", function (list) { + var cards = list[0][1].slice(0).sort(function (a, b) { + return get.value(b) - get.value(a); }); - return [cards,cards.splice(2)]; - }) - 'step 1' - var top=result.moved[0]; - var bottom=result.moved[1]; + return [cards, cards.splice(2)]; + }); + "step 1"; + var top = result.moved[0]; + var bottom = result.moved[1]; top.reverse(); - for(var i=0;i1&&!player.isMaxHandcard(); + forced: true, + filter: function (event, player) { + return ( + (event.name == "damage" || get.type(event.card) == "equip") && + lib.skill.gzxingzhao.getNum() > 1 && + !player.isMaxHandcard() + ); }, - frequent:true, - content:function(){ + frequent: true, + content: function () { player.draw(); }, }, - draw:{ - audio:'gzxingzhao', - trigger:{player:'damageEnd'}, - forced:true, - filter:function(event,player){ - return lib.skill.gzxingzhao.getNum()>1&&event.source - &&event.source.isAlive()&&event.source.countCards('h')!=player.countCards('h'); + draw: { + audio: "gzxingzhao", + trigger: { player: "damageEnd" }, + forced: true, + filter: function (event, player) { + return ( + lib.skill.gzxingzhao.getNum() > 1 && + event.source && + event.source.isAlive() && + event.source.countCards("h") != player.countCards("h") + ); }, - logTarget:function(event,player){ - var target=event.source; - return target.countCards('h')>player.countCards('h')?player:target; + logTarget: function (event, player) { + var target = event.source; + return target.countCards("h") > player.countCards("h") ? player : target; }, - check:function(event,player){ - return get.attitude(player,lib.skill.gzxingzhao_draw.logTarget(event,player))>0; + check: function (event, player) { + return ( + get.attitude(player, lib.skill.gzxingzhao_draw.logTarget(event, player)) > 0 + ); }, - content:function(){ - lib.skill.gzxingzhao_draw.logTarget(trigger,player).draw(); + content: function () { + lib.skill.gzxingzhao_draw.logTarget(trigger, player).draw(); }, }, - skip:{ - audio:'gzxingzhao', - trigger:{player:'phaseDiscardBefore'}, - forced:true, - filter:function(){ - return lib.skill.gzxingzhao.getNum()>2; + skip: { + audio: "gzxingzhao", + trigger: { player: "phaseDiscardBefore" }, + forced: true, + filter: function () { + return lib.skill.gzxingzhao.getNum() > 2; }, - content:function(){ + content: function () { trigger.cancel(); - game.log(player,'跳过了','#y弃牌阶段'); + game.log(player, "跳过了", "#y弃牌阶段"); }, }, - lose:{ - audio:'gzxingzhao', - trigger:{ - player:'loseAfter', - global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'], + lose: { + audio: "gzxingzhao", + trigger: { + player: "loseAfter", + global: [ + "equipAfter", + "addJudgeAfter", + "gainAfter", + "loseAsyncAfter", + "addToExpansionAfter", + ], }, - filter:function(event,player){ - var evt=event.getl(player); - return evt&&evt.player==player&&evt.es&&evt.es.length>0&&lib.skill.gzxingzhao.getNum()>3; + filter: function (event, player) { + var evt = event.getl(player); + return ( + evt && + evt.player == player && + evt.es && + evt.es.length > 0 && + lib.skill.gzxingzhao.getNum() > 3 + ); + }, + forced: true, + content: function () { + player.draw(); }, - forced:true, - content:function(){player.draw()}, }, }, - ai:{ - threaten:3, - effect:{ - target:function(card,player,target,current){ - if(lib.skill.gzxingzhao.getNum()>3&&get.type(card)=='equip'&&!get.cardtag(card,'gifts')) return [1,3]; - } + ai: { + threaten: 3, + effect: { + target: function (card, player, target, current) { + if ( + lib.skill.gzxingzhao.getNum() > 3 && + get.type(card) == "equip" && + !get.cardtag(card, "gifts") + ) + return [1, 3]; + }, }, - reverseEquip:true, - skillTagFilter:function(){ - return lib.skill.gzxingzhao.getNum()>3; + reverseEquip: true, + skillTagFilter: function () { + return lib.skill.gzxingzhao.getNum() > 3; }, }, }, - qiuan:{ - audio:2, - trigger:{player:'damageBegin2'}, - filter:function(event,player){ - return event.cards&&event.cards.filterInD().length>0&&!player.getExpansions('qiuan').length; + qiuan: { + audio: 2, + trigger: { player: "damageBegin2" }, + filter: function (event, player) { + return ( + event.cards && + event.cards.filterInD().length > 0 && + !player.getExpansions("qiuan").length + ); }, - check:function(event,player){ - if(get.damageEffect(player,event.source||player,player,event.nature)>=0) return false; + check: function (event, player) { + if (get.damageEffect(player, event.source || player, player, event.nature) >= 0) + return false; return true; }, - preHidden:true, - content:function(){ - var cards=trigger.cards.filterInD(); - player.addToExpansion('gain2',cards).gaintag.add('qiuan'); + preHidden: true, + content: function () { + var cards = trigger.cards.filterInD(); + player.addToExpansion("gain2", cards).gaintag.add("qiuan"); trigger.cancel(); }, - intro:{ - content:'expansion', - markcount:'expansion', + intro: { + content: "expansion", + markcount: "expansion", }, - marktext:'函', + marktext: "函", }, - liangfan:{ - audio:2, - trigger:{player:'phaseZhunbeiBegin'}, - forced:true, - filter:function(event,player){ - return player.getExpansions('qiuan').length>0; + liangfan: { + audio: 2, + trigger: { player: "phaseZhunbeiBegin" }, + forced: true, + filter: function (event, player) { + return player.getExpansions("qiuan").length > 0; }, - content:function(){ - 'step 0' - var cards=player.getExpansions('qiuan'); - player.gain(cards,'gain2').gaintag.add('liangfan'); - player.addTempSkill('liangfan2'); - 'step 1' + content: function () { + "step 0"; + var cards = player.getExpansions("qiuan"); + player.gain(cards, "gain2").gaintag.add("liangfan"); + player.addTempSkill("liangfan2"); + "step 1"; player.loseHp(); }, }, - liangfan2:{ - audio:'liangfan', - mark:true, - mod:{ - aiOrder:function(player,card,num){ - if(get.itemtype(card)=='card'&&card.hasGaintag('liangfan')) return num+0.1; + liangfan2: { + audio: "liangfan", + mark: true, + mod: { + aiOrder: function (player, card, num) { + if (get.itemtype(card) == "card" && card.hasGaintag("liangfan")) return num + 0.1; }, }, - intro:{content:'使用“量反”牌造成伤害后,可获得目标角色的一张牌'}, - trigger:{source:'damageEnd'}, - logTarget:'player', - charlotte:true, - onremove:function(player){ - player.removeGaintag('liangfan'); + intro: { content: "使用“量反”牌造成伤害后,可获得目标角色的一张牌" }, + trigger: { source: "damageEnd" }, + logTarget: "player", + charlotte: true, + onremove: function (player) { + player.removeGaintag("liangfan"); }, - prompt:(event)=>('量反:是否获得'+get.translation(event.player)+'的一张牌?'), - filter:function(event,player){ - var evt=event.getParent(2); - if(evt.name!='useCard'||evt.card!=event.card) return false; - if(!event.player.countGainableCards(player,'he')) return false; - return player.getHistory('lose',function(evt2){ - if(evt2.getParent()!=evt) return false; - for(var i in evt2.gaintag_map){ - if(evt2.gaintag_map[i].includes('liangfan')) return true; - } - return false; - }).length>0; + prompt: (event) => "量反:是否获得" + get.translation(event.player) + "的一张牌?", + filter: function (event, player) { + var evt = event.getParent(2); + if (evt.name != "useCard" || evt.card != event.card) return false; + if (!event.player.countGainableCards(player, "he")) return false; + return ( + player.getHistory("lose", function (evt2) { + if (evt2.getParent() != evt) return false; + for (var i in evt2.gaintag_map) { + if (evt2.gaintag_map[i].includes("liangfan")) return true; + } + return false; + }).length > 0 + ); }, - marktext:'反', - content:function(){ - player.gainPlayerCard(trigger.player,true,'he'); + marktext: "反", + content: function () { + player.gainPlayerCard(trigger.player, true, "he"); }, }, - gzwenji:{ - audio:2, - trigger:{player:'phaseUseBegin'}, - direct:true, - filter:function(event,player){ - return game.hasPlayer(function(current){ - return current!=player&¤t.countCards('he'); + gzwenji: { + audio: 2, + trigger: { player: "phaseUseBegin" }, + direct: true, + filter: function (event, player) { + return game.hasPlayer(function (current) { + return current != player && current.countCards("he"); }); }, - preHidden:true, - content:function(){ - 'step 0' - player.chooseTarget(get.prompt2('gzwenji'),function(card,player,target){ - return target!=player&&target.countCards('he')>0; - }).set('ai',function(target){ - var att=get.attitude(_status.event.player,target); - if(target.identity=='unknown'&&att<=0) return 20; - if(att>0) return Math.sqrt(att)/10; - return 5-att; - }); - 'step 1' - if(result.bool){ - var target=result.targets[0]; - event.target=target; - player.logSkill('gzwenji',target); - target.chooseCard('he',true,'问计:将一张牌交给'+get.translation(player)); - } - else{ - event.finish(); - } - 'step 2' - if(result.bool){ - event.card=result.cards[0]; - target.give(result.cards,player).gaintag.add('gzwenji'); - } - 'step 3' - if(target.identity=='unknown'||target.isFriendOf(player)){ - player.addTempSkill('gzwenji_respond'); - event.finish(); - } - else if(target.isIn()&&player.countCards('he',function(card){ - return !card.hasGaintag('gzwenji'); - })){ - player.chooseCard('he','交给'+get.translation(target)+'一张其他牌,或令其摸一张牌',function(card){ - return !card.hasGaintag('gzwenji'); - }).set('ai',function(card){ - return 5-get.value(card); + preHidden: true, + content: function () { + "step 0"; + player + .chooseTarget(get.prompt2("gzwenji"), function (card, player, target) { + return target != player && target.countCards("he") > 0; + }) + .set("ai", function (target) { + var att = get.attitude(_status.event.player, target); + if (target.identity == "unknown" && att <= 0) return 20; + if (att > 0) return Math.sqrt(att) / 10; + return 5 - att; }); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + event.target = target; + player.logSkill("gzwenji", target); + target.chooseCard("he", true, "问计:将一张牌交给" + get.translation(player)); + } else { + event.finish(); } - else event.finish(); - 'step 4' - if(result.bool){ - player.give(result.cards,target); - player.removeGaintag('gzwenji'); + "step 2"; + if (result.bool) { + event.card = result.cards[0]; + target.give(result.cards, player).gaintag.add("gzwenji"); } - else{ + "step 3"; + if (target.identity == "unknown" || target.isFriendOf(player)) { + player.addTempSkill("gzwenji_respond"); + event.finish(); + } else if ( + target.isIn() && + player.countCards("he", function (card) { + return !card.hasGaintag("gzwenji"); + }) + ) { + player + .chooseCard( + "he", + "交给" + get.translation(target) + "一张其他牌,或令其摸一张牌", + function (card) { + return !card.hasGaintag("gzwenji"); + } + ) + .set("ai", function (card) { + return 5 - get.value(card); + }); + } else event.finish(); + "step 4"; + if (result.bool) { + player.give(result.cards, target); + player.removeGaintag("gzwenji"); + } else { target.draw(); } }, - subSkill:{ - respond:{ - onremove:function(player){ - player.removeGaintag('gzwenji'); + subSkill: { + respond: { + onremove: function (player) { + player.removeGaintag("gzwenji"); }, - mod:{ - targetInRange:function(card,player,target){ - if(!card.cards) return; - for(var i of card.cards){ - if(i.hasGaintag('gzwenji')) return true; + mod: { + targetInRange: function (card, player, target) { + if (!card.cards) return; + for (var i of card.cards) { + if (i.hasGaintag("gzwenji")) return true; } }, - cardUsable:function(card,player,target){ - if(!card.cards) return; - for(var i of card.cards){ - if(i.hasGaintag('gzwenji')) return Infinity; + cardUsable: function (card, player, target) { + if (!card.cards) return; + for (var i of card.cards) { + if (i.hasGaintag("gzwenji")) return Infinity; } }, }, - trigger:{player:'useCard'}, - forced:true, - charlotte:true, - audio:'gzwenji', - filter:function(event,player){ - return player.getHistory('lose',function(evt){ - if(evt.getParent()!=event) return false; - for(var i in evt.gaintag_map){ - if(evt.gaintag_map[i].includes('gzwenji')) return true; - } - return false; - }).length>0; + trigger: { player: "useCard" }, + forced: true, + charlotte: true, + audio: "gzwenji", + filter: function (event, player) { + return ( + player.getHistory("lose", function (evt) { + if (evt.getParent() != event) return false; + for (var i in evt.gaintag_map) { + if (evt.gaintag_map[i].includes("gzwenji")) return true; + } + return false; + }).length > 0 + ); }, - content:function(){ - trigger.directHit.addArray(game.filterPlayer(function(current){ - return current!=player; - })); - if(trigger.addCount!==false){ - trigger.addCount=false; - var stat=player.getStat(); - if(stat&&stat.card&&stat.card[trigger.card.name]) stat.card[trigger.card.name]--; + content: function () { + trigger.directHit.addArray( + game.filterPlayer(function (current) { + return current != player; + }) + ); + if (trigger.addCount !== false) { + trigger.addCount = false; + var stat = player.getStat(); + if (stat && stat.card && stat.card[trigger.card.name]) + stat.card[trigger.card.name]--; } }, - ai:{ - directHit_ai:true, - skillTagFilter:function(player,tag,arg){ - return arg.card&&arg.card.cards&&arg.card.cards.filter((card)=>card.hasGaintag('gzwenji')).length>0; + ai: { + directHit_ai: true, + skillTagFilter: function (player, tag, arg) { + return ( + arg.card && + arg.card.cards && + arg.card.cards.filter((card) => card.hasGaintag("gzwenji")).length > 0 + ); }, }, - } - } - }, - gztunjiang:{ - audio:2, - trigger:{player:'phaseJieshuBegin'}, - frequent:true, - preHidden:true, - filter:function(event,player){ - if(!player.getHistory('useCard',function(evt){ - return evt.isPhaseUsing(); - }).length) return false; - return player.getHistory('useCard',function(evt){ - if(evt.targets&&evt.targets.length&&evt.isPhaseUsing()){ - var targets=evt.targets.slice(0); - while(targets.includes(player)) targets.remove(player); - return targets.length>0; - } - return false; - }).length==0; + }, }, - content:function(){ + }, + gztunjiang: { + audio: 2, + trigger: { player: "phaseJieshuBegin" }, + frequent: true, + preHidden: true, + filter: function (event, player) { + if ( + !player.getHistory("useCard", function (evt) { + return evt.isPhaseUsing(); + }).length + ) + return false; + return ( + player.getHistory("useCard", function (evt) { + if (evt.targets && evt.targets.length && evt.isPhaseUsing()) { + var targets = evt.targets.slice(0); + while (targets.includes(player)) targets.remove(player); + return targets.length > 0; + } + return false; + }).length == 0 + ); + }, + content: function () { player.draw(game.countGroup()); }, }, - gzbushi:{ - audio:2, - trigger:{player:'damageEnd'}, - frequent:true, - preHidden:true, - content:function(){ - 'step 0' - event.count=trigger.num; - 'step 1' + gzbushi: { + audio: 2, + trigger: { player: "damageEnd" }, + frequent: true, + preHidden: true, + content: function () { + "step 0"; + event.count = trigger.num; + "step 1"; event.count--; player.draw(); - 'step 2' - if(event.count>0){ - player.chooseBool(get.prompt2('gzbushi')).set('frequentSkill','gzbushi'); - } - else event.finish(); - 'step 3' - if(result.bool) event.goto(1); + "step 2"; + if (event.count > 0) { + player.chooseBool(get.prompt2("gzbushi")).set("frequentSkill", "gzbushi"); + } else event.finish(); + "step 3"; + if (result.bool) event.goto(1); }, - group:'gzbushi_draw', - subSkill:{ - draw:{ - trigger:{source:'damageSource'}, - direct:true, - noHidden:true, - filter:function(event,player){ - return event.player.isEnemyOf(player)&&event.player.isIn(); + group: "gzbushi_draw", + subSkill: { + draw: { + trigger: { source: "damageSource" }, + direct: true, + noHidden: true, + filter: function (event, player) { + return event.player.isEnemyOf(player) && event.player.isIn(); }, - content:function(){ - 'step 0' - trigger.player.chooseBool('是否对'+get.translation(player)+'发动【布施】?','你摸一张牌,然后其摸一张牌'); - 'step 1' - if(result.bool){ - player.logSkill('gzbushi',trigger.player); - game.asyncDraw([trigger.player,player]); - } - else event.finish(); - 'step 2' + content: function () { + "step 0"; + trigger.player.chooseBool( + "是否对" + get.translation(player) + "发动【布施】?", + "你摸一张牌,然后其摸一张牌" + ); + "step 1"; + if (result.bool) { + player.logSkill("gzbushi", trigger.player); + game.asyncDraw([trigger.player, player]); + } else event.finish(); + "step 2"; game.delayx(); }, }, }, }, - gzbushi_old:{ - audio:2, - trigger:{ - player:'damageEnd', - source:'damageSource', + gzbushi_old: { + audio: 2, + trigger: { + player: "damageEnd", + source: "damageSource", }, - forced:true, - filter:function(event,player,name){ - if(name=='damageSource'&&player==event.player) return false; - return game.hasPlayer(function(current){ + forced: true, + filter: function (event, player, name) { + if (name == "damageSource" && player == event.player) return false; + return game.hasPlayer(function (current) { return current.isFriendOf(event.player); }); }, - check:function(event,player){ + check: function (event, player) { return player.isFriendOf(event.player); }, - content:function(){ - 'step 0' - event.count=trigger.num; - if(event.triggername=='damageSource') event.count=1; - 'step 1' + content: function () { + "step 0"; + event.count = trigger.num; + if (event.triggername == "damageSource") event.count = 1; + "step 1"; event.count--; - var target=trigger.player; - var list=game.filterPlayer(function(current){ + var target = trigger.player; + var list = game.filterPlayer(function (current) { return current.isFriendOf(target); }); - if(list.length){ - if(list.length==1) event._result={bool:true,targets:list}; - else player.chooseTarget('布施:令一名与'+(player==target?'你':get.translation(target))+'势力相同的角色摸一张牌',true,function(card,player,target){ - return target.isFriendOf(_status.event.target) - }).set('target',target); - } - else event.finish(); - 'step 2' - if(result.bool){ - var target=result.targets[0]; - player.line(target,'green'); + if (list.length) { + if (list.length == 1) event._result = { bool: true, targets: list }; + else + player + .chooseTarget( + "布施:令一名与" + + (player == target ? "你" : get.translation(target)) + + "势力相同的角色摸一张牌", + true, + function (card, player, target) { + return target.isFriendOf(_status.event.target); + } + ) + .set("target", target); + } else event.finish(); + "step 2"; + if (result.bool) { + var target = result.targets[0]; + player.line(target, "green"); target.draw(); - if(event.count) event.goto(1); + if (event.count) event.goto(1); } }, }, - gzmidao:{ - audio:2, - trigger:{global:'useCardToPlayered'}, - direct:true, + gzmidao: { + audio: 2, + trigger: { global: "useCardToPlayered" }, + direct: true, //noHidden:true, - filter:function(event,player){ - var target=event.player; - return event.isFirstTarget&&target.isFriendOf(player)&& - target.isPhaseUsing()&&(target==player||player.hasSkill('gzmidao'))&& - (['basic','trick'].includes(get.type(event.card))&&get.tag(event.card,'damage')>0)&& - event.cards&&event.cards.length&&!target.hasSkill('gzmidao2'); + filter: function (event, player) { + var target = event.player; + return ( + event.isFirstTarget && + target.isFriendOf(player) && + target.isPhaseUsing() && + (target == player || player.hasSkill("gzmidao")) && + ["basic", "trick"].includes(get.type(event.card)) && + get.tag(event.card, "damage") > 0 && + event.cards && + event.cards.length && + !target.hasSkill("gzmidao2") + ); }, - preHidden:true, - content:function(){ - 'step 0' - var next=trigger.player.chooseBool('是否对'+get.translation(player)+'发动【米道】?','令该角色修改'+get.translation(trigger.card)+'的花色和伤害属性'); - next.set('ai',()=>false); - if(player==next.player) next.setHiddenSkill(event.name); - 'step 1' - if(result.bool){ - player.logSkill('gzmidao'); - trigger.player.addTempSkill('gzmidao2'); - if(player!=trigger.player){ - trigger.player.line(player,'green'); + preHidden: true, + content: function () { + "step 0"; + var next = trigger.player.chooseBool( + "是否对" + get.translation(player) + "发动【米道】?", + "令该角色修改" + get.translation(trigger.card) + "的花色和伤害属性" + ); + next.set("ai", () => false); + if (player == next.player) next.setHiddenSkill(event.name); + "step 1"; + if (result.bool) { + player.logSkill("gzmidao"); + trigger.player.addTempSkill("gzmidao2"); + if (player != trigger.player) { + trigger.player.line(player, "green"); //player.gain(result.cards,trigger.player,'giveAuto'); } - } - else event.finish(); - 'step 2' - if(player.isUnderControl()){ + } else event.finish(); + "step 2"; + if (player.isUnderControl()) { game.swapPlayerAuto(player); } - var switchToAuto=function(){ - _status.imchoosing=false; - var listn=['普通'].concat(lib.inpile_nature); - event._result={ - bool:true, - suit:lib.suit.randomGet(), - nature:listn.randomGet(), + var switchToAuto = function () { + _status.imchoosing = false; + var listn = ["普通"].concat(lib.inpile_nature); + event._result = { + bool: true, + suit: lib.suit.randomGet(), + nature: listn.randomGet(), }; - if(event.dialog) event.dialog.close(); - if(event.control) event.control.close(); + if (event.dialog) event.dialog.close(); + if (event.control) event.control.close(); }; - var chooseButton=function(player,card){ - var event=_status.event; - player=player||event.player; - if(!event._result) event._result={}; - var dialog=ui.create.dialog('米道:请修改'+card+'的花色和属性','forcebutton','hidden'); - event.dialog=dialog; - dialog.addText('花色'); - var table=document.createElement('div'); - table.classList.add('add-setting'); - table.style.margin='0'; - table.style.width='100%'; - table.style.position='relative'; - var listi=['spade','heart','club','diamond']; - for(var i=0;i'; - td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){ - if(_status.dragged) return; - if(_status.justdragged) return; - _status.tempNoButton=true; - setTimeout(function(){ - _status.tempNoButton=false; - },500); - var link=this.link; - var current=this.parentNode.querySelector('.bluebg'); - if(current){ - current.classList.remove('bluebg'); + td.innerHTML = "" + get.translation(listi[i]) + ""; + td.addEventListener(lib.config.touchscreen ? "touchend" : "click", function () { + if (_status.dragged) return; + if (_status.justdragged) return; + _status.tempNoButton = true; + setTimeout(function () { + _status.tempNoButton = false; + }, 500); + var link = this.link; + var current = this.parentNode.querySelector(".bluebg"); + if (current) { + current.classList.remove("bluebg"); } - this.classList.add('bluebg'); - event._result.suit=link; + this.classList.add("bluebg"); + event._result.suit = link; }); } dialog.content.appendChild(table); - dialog.addText('属性'); - var table2=document.createElement('div'); - table2.classList.add('add-setting'); - table2.style.margin='0'; - table2.style.width='100%'; - table2.style.position='relative'; - var listn=['普通'].concat(lib.inpile_nature); - for(var i=0;i'; - td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){ - if(_status.dragged) return; - if(_status.justdragged) return; - _status.tempNoButton=true; - setTimeout(function(){ - _status.tempNoButton=false; - },500); - var link=this.link; - var current=this.parentNode.querySelector('.bluebg'); - if(current){ - current.classList.remove('bluebg'); + td.innerHTML = "" + get.translation(nature) + ""; + td.addEventListener(lib.config.touchscreen ? "touchend" : "click", function () { + if (_status.dragged) return; + if (_status.justdragged) return; + _status.tempNoButton = true; + setTimeout(function () { + _status.tempNoButton = false; + }, 500); + var link = this.link; + var current = this.parentNode.querySelector(".bluebg"); + if (current) { + current.classList.remove("bluebg"); } - this.classList.add('bluebg'); - event._result.nature=link; + this.classList.add("bluebg"); + event._result.nature = link; }); } dialog.content.appendChild(table2); - dialog.add('  '); + dialog.add("  "); event.dialog.open(); - event.switchToAuto=function(){ - event._result={ - bool:true, - nature:listn.randomGet(), - suit:listi.randomGet(), + event.switchToAuto = function () { + event._result = { + bool: true, + nature: listn.randomGet(), + suit: listi.randomGet(), }; event.dialog.close(); event.control.close(); game.resume(); - _status.imchoosing=false; + _status.imchoosing = false; }; - event.control=ui.create.control('ok','cancel2',function(link){ - var result=event._result; - if(link=='cancel2') result.bool=false; - else{ - if(!result.nature||!result.suit) return; - result.bool=true; + event.control = ui.create.control("ok", "cancel2", function (link) { + var result = event._result; + if (link == "cancel2") result.bool = false; + else { + if (!result.nature || !result.suit) return; + result.bool = true; } event.dialog.close(); event.control.close(); game.resume(); - _status.imchoosing=false; + _status.imchoosing = false; }); - for(var i=0;i=0) return 0; - if(target.countCards('e',function(card){ - return get.value(card,target)>=7-player.hp; - })>0) return 1; - var dist=get.distance(player,target,'attack'); - if(dist>1&&dist-target.countCards('e')<=1) return true; - return 0; - }); - 'step 1' - if(result.index==0) player.draw(); - else{ - target.discardPlayerCard(player,'e',true); + var str = get.translation(player); + target + .chooseControl() + .set("prompt", str + "发动了【礼下】,请选择一项") + .set("choiceList", [ + "令" + str + "摸一张牌", + "弃置" + str + "装备区内的一张牌并失去1点体力", + ]) + .set("ai", function () { + var player = _status.event.player, + target = _status.event.getParent().player; + if (player.hp <= 1 || get.attitude(player, target) >= 0) return 0; + if ( + target.countCards("e", function (card) { + return get.value(card, target) >= 7 - player.hp; + }) > 0 + ) + return 1; + var dist = get.distance(player, target, "attack"); + if (dist > 1 && dist - target.countCards("e") <= 1) return true; + return 0; + }); + "step 1"; + if (result.index == 0) player.draw(); + else { + target.discardPlayerCard(player, "e", true); target.loseHp(); } }, }, - gzlixia:{ - audio:2, - trigger:{global:'phaseZhunbeiBegin'}, - noHidden:true, - direct:true, - filter:function(event,player){ - return player!=event.player&&!event.player.isFriendOf(player)&&player.countDiscardableCards(event.player,'e')>0; + gzlixia: { + audio: 2, + trigger: { global: "phaseZhunbeiBegin" }, + noHidden: true, + direct: true, + filter: function (event, player) { + return ( + player != event.player && + !event.player.isFriendOf(player) && + player.countDiscardableCards(event.player, "e") > 0 + ); }, - content:function(){ - 'step 0' - trigger.player.chooseBool('是否对'+get.translation(player)+'发动【礼下】?','弃置其装备区内的一张牌,然后选择一项:①弃置两张牌。②失去1点体力。③令其摸两张牌。').set('ai',function(){ - var player=_status.event.player; - var target=_status.event.getParent().player; - if(get.attitude(player,target)>0) return target.countCards('e',function(card){ - return get.value(card,target)<3; - })>0; - if(target.countCards('e',function(card){ - return get.value(card,target)>=7; - })) return true; - var dist=get.distance(player,target,'attack'); - if(dist>1&&dist-target.countCards('e')<=1) return true; - return false; - }); - 'step 1' - if(result.bool){ - var target=trigger.player; - event.target=target; - player.logSkill('gzlixia'); - target.line(player,'green'); - target.discardPlayerCard(player,'e',true); - } - else event.finish(); - 'step 2' - var list=['失去1点体力','令'+get.translation(player)+'摸两张牌']; - event.addIndex=0; - if(target.countCards('h',function(card){ - return lib.filter.cardDiscardable(card,target,'gzlixia'); - })>1) list.unshift('弃置两张牌'); + content: function () { + "step 0"; + trigger.player + .chooseBool( + "是否对" + get.translation(player) + "发动【礼下】?", + "弃置其装备区内的一张牌,然后选择一项:①弃置两张牌。②失去1点体力。③令其摸两张牌。" + ) + .set("ai", function () { + var player = _status.event.player; + var target = _status.event.getParent().player; + if (get.attitude(player, target) > 0) + return ( + target.countCards("e", function (card) { + return get.value(card, target) < 3; + }) > 0 + ); + if ( + target.countCards("e", function (card) { + return get.value(card, target) >= 7; + }) + ) + return true; + var dist = get.distance(player, target, "attack"); + if (dist > 1 && dist - target.countCards("e") <= 1) return true; + return false; + }); + "step 1"; + if (result.bool) { + var target = trigger.player; + event.target = target; + player.logSkill("gzlixia"); + target.line(player, "green"); + target.discardPlayerCard(player, "e", true); + } else event.finish(); + "step 2"; + var list = ["失去1点体力", "令" + get.translation(player) + "摸两张牌"]; + event.addIndex = 0; + if ( + target.countCards("h", function (card) { + return lib.filter.cardDiscardable(card, target, "gzlixia"); + }) > 1 + ) + list.unshift("弃置两张牌"); else event.addIndex++; - target.chooseControl().set('choiceList',list).set('ai',function(){ - var num=2; - var player=_status.event.player; - var target=_status.event.getParent().player; - if(get.attitude(player,target)>=0) num=2; - else if(player.countCards('he',function(card){ - return lib.filter.cardDiscardable(card,player,'gzlixia')&&get.value(card,player)<5; - })>1) num=0; - else if(player.hp+player.countCards('h','tao')>3&&!player.hasJudge('lebu')) num=1; - return num-_status.event.getParent().addIndex; - }); - 'step 3' - switch(result.index+event.addIndex){ + target + .chooseControl() + .set("choiceList", list) + .set("ai", function () { + var num = 2; + var player = _status.event.player; + var target = _status.event.getParent().player; + if (get.attitude(player, target) >= 0) num = 2; + else if ( + player.countCards("he", function (card) { + return ( + lib.filter.cardDiscardable(card, player, "gzlixia") && + get.value(card, player) < 5 + ); + }) > 1 + ) + num = 0; + else if ( + player.hp + player.countCards("h", "tao") > 3 && + !player.hasJudge("lebu") + ) + num = 1; + return num - _status.event.getParent().addIndex; + }); + "step 3"; + switch (result.index + event.addIndex) { case 0: - target.chooseToDiscard(2,'h',true); + target.chooseToDiscard(2, "h", true); break; case 1: target.loseHp(); @@ -10938,2092 +14435,2664 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, - yigui:{ - audio:2, - hiddenCard:function(player,name){ - var storage=player.storage.yigui; - if(name=='shan'||name=='wuxie'||!storage||!storage.character.length||storage.used.includes(name)||!lib.inpile.includes(name)) return false; + yigui: { + audio: 2, + hiddenCard: function (player, name) { + var storage = player.storage.yigui; + if ( + name == "shan" || + name == "wuxie" || + !storage || + !storage.character.length || + storage.used.includes(name) || + !lib.inpile.includes(name) + ) + return false; return true; }, - init:function(player,skill){ - if(!player.storage.skill) player.storage[skill]={ - character:[], - used:[], - } + init: function (player, skill) { + if (!player.storage.skill) + player.storage[skill] = { + character: [], + used: [], + }; }, - enable:"chooseToUse", - filter:function(event,player){ - if(event.type=='wuxie'||event.type=='respondShan') return false; - var storage=player.storage.yigui; - if(!storage||!storage.character.length) return false; - if(event.type=='dying'){ - if((!event.filterCard({name:'tao'},player,event)||storage.used.includes('tao'))&& - (!event.filterCard({name:'jiu'},player,event)||storage.used.includes('jiu'))) return false; - var target=event.dying; - if(target.identity=='unknown'||target.identity=='ye') return true; - for(var i=0;i1) return (1.7+Math.random())*Math.max(num,1); + if (num <= 0) return 0; + if (list.length > 1) return (1.7 + Math.random()) * Math.max(num, 1); } } - return 1+Math.random(); + return 1 + Math.random(); }, - filter:function(button,player){ - var evt=_status.event.getParent('chooseToUse'); - if(!ui.selected.buttons.length){ - if(typeof button.link!='string') return false; - if(evt.type=='dying'){ - if(evt.dying.identity=='unknown'||evt.dying.identity=='ye') return true; - var double=get.is.double(button.link,true); - return evt.dying.identity==lib.character[button.link][1]||lib.character[button.link][1]=='ye'||(double&&double.includes(evt.dying.identity)); + filter: function (button, player) { + var evt = _status.event.getParent("chooseToUse"); + if (!ui.selected.buttons.length) { + if (typeof button.link != "string") return false; + if (evt.type == "dying") { + if (evt.dying.identity == "unknown" || evt.dying.identity == "ye") + return true; + var double = get.is.double(button.link, true); + return ( + evt.dying.identity == lib.character[button.link][1] || + lib.character[button.link][1] == "ye" || + (double && double.includes(evt.dying.identity)) + ); } return true; - } - else{ - if(typeof ui.selected.buttons[0].link!='string') return false; - if(typeof button.link!='object') return false; - var name=button.link[2]; - if(player.storage.yigui.used.includes(name)) return false; - var card={name:name}; - if(button.link[3]) card.nature=button.link[3]; - var info=get.info(card); - var group=lib.character[ui.selected.buttons[0].link][1]; - var double=get.is.double(ui.selected.buttons[0].link,true); - if(evt.type=='dying'){ - return evt.filterCard(card,player,evt); + } else { + if (typeof ui.selected.buttons[0].link != "string") return false; + if (typeof button.link != "object") return false; + var name = button.link[2]; + if (player.storage.yigui.used.includes(name)) return false; + var card = { name: name }; + if (button.link[3]) card.nature = button.link[3]; + var info = get.info(card); + var group = lib.character[ui.selected.buttons[0].link][1]; + var double = get.is.double(ui.selected.buttons[0].link, true); + if (evt.type == "dying") { + return evt.filterCard(card, player, evt); } - if(!lib.filter.filterCard(card,player,evt)) return false; - else if(evt.filterCard&&!evt.filterCard(card,player,evt)) return false; - if(info.changeTarget){ - var list=game.filterPlayer(function(current){ - return player.canUse(card,current); + if (!lib.filter.filterCard(card, player, evt)) return false; + else if (evt.filterCard && !evt.filterCard(card, player, evt)) return false; + if (info.changeTarget) { + var list = game.filterPlayer(function (current) { + return player.canUse(card, current); }); - for(var i=0;ifalse, - selectCard:-1, - complexCard:true, - check:()=>1, - popname:true, - audio:'yigui', - viewAs:{name:'shan',isCard:true}, - onuse:function(result,player){ - player.logSkill('yigui'); - var character=lib.skill.yigui_gzshan_backup.character; - player.flashAvatar('yigui',character); + backup: function (links, player) { + var character = links[0]; + var next = { + character: character, + filterCard: () => false, + selectCard: -1, + complexCard: true, + check: () => 1, + popname: true, + audio: "yigui", + viewAs: { name: "shan", isCard: true }, + onuse: function (result, player) { + player.logSkill("yigui"); + var character = lib.skill.yigui_gzshan_backup.character; + player.flashAvatar("yigui", character); player.storage.yigui.character.remove(character); _status.characterlist.add(character); - game.log(player,'从「魂」中移除了','#g'+get.translation(character)); - player.syncStorage('yigui'); - player.updateMarks('yigui'); + game.log(player, "从「魂」中移除了", "#g" + get.translation(character)); + player.syncStorage("yigui"); + player.updateMarks("yigui"); player.storage.yigui.used.add(result.card.name); }, }; return next; }, }, - ai:{ - respondShan:true, - skillTagFilter:function(player,tag,arg){ - if(arg=='respond'||!lib.inpile.includes('shan')) return false; - var storage=player.storage.yigui; - if(!storage||!storage.character.length||storage.used.includes('shan')) return false; + ai: { + respondShan: true, + skillTagFilter: function (player, tag, arg) { + if (arg == "respond" || !lib.inpile.includes("shan")) return false; + var storage = player.storage.yigui; + if (!storage || !storage.character.length || storage.used.includes("shan")) + return false; }, - order:0.1, - result:{player:1}, + order: 0.1, + result: { player: 1 }, }, }, - yigui_gzwuxie:{ - hiddenWuxie(player,info){ - if(!lib.inpile.includes('wuxie')) return false; - const storage=player.storage.yigui; - if(!storage||!storage.character||!storage.character.length||(storage.used&&storage.used.includes('wuxie'))) return false; - if(_status.connectMode) return true; - const target=info.target; - if(!target) return false; - const identity=target.identity; - return ['unknown','ye'].includes(identity)||storage.character.some(function(i){ - if(lib.character[i][1]=='ye') return true; - const double=get.is.double(i,true); - return (double?double:[lib.character[i][1]]).includes(identity); - }); + yigui_gzwuxie: { + hiddenWuxie(player, info) { + if (!lib.inpile.includes("wuxie")) return false; + const storage = player.storage.yigui; + if ( + !storage || + !storage.character || + !storage.character.length || + (storage.used && storage.used.includes("wuxie")) + ) + return false; + if (_status.connectMode) return true; + const target = info.target; + if (!target) return false; + const identity = target.identity; + return ( + ["unknown", "ye"].includes(identity) || + storage.character.some(function (i) { + if (lib.character[i][1] == "ye") return true; + const double = get.is.double(i, true); + return (double ? double : [lib.character[i][1]]).includes(identity); + }) + ); }, - enable:'chooseToUse', - filter(event,player){ - if(event.type!='wuxie'||!lib.inpile.includes('wuxie')) return false; - const storage=player.storage.yigui; - if(!storage||!storage.character||!storage.character.length||(storage.used&&storage.used.includes('wuxie'))) return false; - const info=event.info_map,target=info.target,identity=target.identity; - return ['unknown','ye'].includes(identity)||storage.character.some(function(i){ - if(lib.character[i][1]=='ye') return true; - const double=get.is.double(i,true); - return (double?double:[lib.character[i][1]]).includes(identity); - }); + enable: "chooseToUse", + filter(event, player) { + if (event.type != "wuxie" || !lib.inpile.includes("wuxie")) return false; + const storage = player.storage.yigui; + if ( + !storage || + !storage.character || + !storage.character.length || + (storage.used && storage.used.includes("wuxie")) + ) + return false; + const info = event.info_map, + target = info.target, + identity = target.identity; + return ( + ["unknown", "ye"].includes(identity) || + storage.character.some(function (i) { + if (lib.character[i][1] == "ye") return true; + const double = get.is.double(i, true); + return (double ? double : [lib.character[i][1]]).includes(identity); + }) + ); }, - chooseButton:{ - dialog(event,player){ - let dialog=ui.create.dialog('役鬼','hidden'); - dialog.add([player.storage.yigui.character,'character']); + chooseButton: { + dialog(event, player) { + let dialog = ui.create.dialog("役鬼", "hidden"); + dialog.add([player.storage.yigui.character, "character"]); return dialog; }, - filter(button,player){ - const evt=get.event().getParent('chooseToUse'); - const info=evt.info_map,target=info.target,identity=target.identity; - if(['unknown','ye'].includes(identity)) return true; - if(lib.character[button.link][1]=='ye') return true; - const double=get.is.double(button.link,true); - return (double?double:[lib.character[button.link][1]]).includes(identity); + filter(button, player) { + const evt = get.event().getParent("chooseToUse"); + const info = evt.info_map, + target = info.target, + identity = target.identity; + if (["unknown", "ye"].includes(identity)) return true; + if (lib.character[button.link][1] == "ye") return true; + const double = get.is.double(button.link, true); + return (double ? double : [lib.character[button.link][1]]).includes(identity); }, - check(button){ - return 1+Math.random(); + check(button) { + return 1 + Math.random(); }, - backup(links,player){ + backup(links, player) { return { - character:links[0], - filterCard:()=>false, - selectCard:-1, - complexCard:true, - check:()=>1, - popname:true, - audio:'yigui', - viewAs:{name:'wuxie',isCard:true}, - onuse(result,player){ - player.logSkill('yigui'); - const character=lib.skill.yigui_gzwuxie_backup.character; - player.flashAvatar('yigui',character); + character: links[0], + filterCard: () => false, + selectCard: -1, + complexCard: true, + check: () => 1, + popname: true, + audio: "yigui", + viewAs: { name: "wuxie", isCard: true }, + onuse(result, player) { + player.logSkill("yigui"); + const character = lib.skill.yigui_gzwuxie_backup.character; + player.flashAvatar("yigui", character); player.storage.yigui.character.remove(character); _status.characterlist.add(character); - game.log(player,'从「魂」中移除了','#g'+get.translation(character)); - player.syncStorage('yigui'); - player.updateMarks('yigui'); + game.log(player, "从「魂」中移除了", "#g" + get.translation(character)); + player.syncStorage("yigui"); + player.updateMarks("yigui"); player.storage.yigui.used.add(result.card.name); }, }; }, }, - ai:{ - order:0.1, - result:{player:1}, + ai: { + order: 0.1, + result: { player: 1 }, }, }, - jihun:{ - trigger:{ - player:'damageEnd', - global:'dyingAfter', + jihun: { + trigger: { + player: "damageEnd", + global: "dyingAfter", }, - audio:2, - frequent:true, - preHidden:true, - filter:function(event,player){ - return event.name=='damage'||(event.player.isAlive()&&!event.player.isFriendOf(player)) + audio: 2, + frequent: true, + preHidden: true, + filter: function (event, player) { + return ( + event.name == "damage" || (event.player.isAlive() && !event.player.isFriendOf(player)) + ); }, - content:function(){ - var list=_status.characterlist.randomGets(1); - if(list.length){ + content: function () { + var list = _status.characterlist.randomGets(1); + if (list.length) { _status.characterlist.removeArray(list); player.storage.yigui.character.addArray(list); - lib.skill.gzhuashen.drawCharacter(player,list); - player.syncStorage('yigui'); - player.updateMarks('yigui'); - game.log(player,'获得了'+get.cnNumber(list.length)+'张「魂」'); + lib.skill.gzhuashen.drawCharacter(player, list); + player.syncStorage("yigui"); + player.updateMarks("yigui"); + game.log(player, "获得了" + get.cnNumber(list.length) + "张「魂」"); } }, }, - gzbuyi:{ - trigger:{global:'dyingAfter'}, - usable:1, - filter:function(event,player){ - if(!(event.player&&event.player.isAlive()&&event.source&&event.source.isAlive())) return false; - return event.player.isFriendOf(player)&&event.reason&&event.reason.name=='damage'; + gzbuyi: { + trigger: { global: "dyingAfter" }, + usable: 1, + filter: function (event, player) { + if (!(event.player && event.player.isAlive() && event.source && event.source.isAlive())) + return false; + return event.player.isFriendOf(player) && event.reason && event.reason.name == "damage"; }, - check:function(event,player){return get.attitude(player,event.player)>0}, - logTarget:'source', - preHidden:true, - content:function(){ - 'step 0' + check: function (event, player) { + return get.attitude(player, event.player) > 0; + }, + logTarget: "source", + preHidden: true, + content: function () { + "step 0"; player.chooseJunlingFor(trigger.source); - 'step 1' - event.junling=result.junling; - event.targets=result.targets; - var choiceList=[]; - choiceList.push('执行该军令'); - choiceList.push('令'+get.translation(trigger.player)+(trigger.player==trigger.source?'(你)':'')+'回复1点体力'); - trigger.source.chooseJunlingControl(player,result.junling,result.targets).set('prompt','补益').set('choiceList',choiceList).set('ai',function(){ - if(get.recoverEffect(trigger.player,player,_status.event.player)>0) return 1; - return (get.attitude(trigger.source,trigger.player)<0&&get.junlingEffect(player,result.junling,trigger.source,result.targets,trigger.source)>=-2)?1:0; - }); - 'step 2' - if(result.index==0) trigger.source.carryOutJunling(player,event.junling,targets); + "step 1"; + event.junling = result.junling; + event.targets = result.targets; + var choiceList = []; + choiceList.push("执行该军令"); + choiceList.push( + "令" + + get.translation(trigger.player) + + (trigger.player == trigger.source ? "(你)" : "") + + "回复1点体力" + ); + trigger.source + .chooseJunlingControl(player, result.junling, result.targets) + .set("prompt", "补益") + .set("choiceList", choiceList) + .set("ai", function () { + if (get.recoverEffect(trigger.player, player, _status.event.player) > 0) return 1; + return get.attitude(trigger.source, trigger.player) < 0 && + get.junlingEffect( + player, + result.junling, + trigger.source, + result.targets, + trigger.source + ) >= -2 + ? 1 + : 0; + }); + "step 2"; + if (result.index == 0) trigger.source.carryOutJunling(player, event.junling, targets); else trigger.player.recover(player); }, - audio:['buyi',2], + audio: ["buyi", 2], }, - keshou:{ - audio:2, - trigger:{player:'damageBegin3'}, - filter:function(event,player){ - return event.num>0; + keshou: { + audio: 2, + trigger: { player: "damageBegin3" }, + filter: function (event, player) { + return event.num > 0; }, - direct:true, - preHidden:true, - content:function(){ - 'step 0' - var check=(player.countCards('h',{color:'red'})>1||player.countCards('h',{color:'black'})>1); - player.chooseCard(get.prompt('keshou'),'弃置两张颜色相同的牌,令即将受到的伤害-1','he',2,function(card){ - if(ui.selected.cards.length) return get.color(card)==get.color(ui.selected.cards[0]); - return true; - }).set('complexCard',true).set('ai',function(card){ - if(!_status.event.check) return 0; - var player=_status.event.player; - if(player.hp==1){ - if(!player.countCards('h',function(card){return get.tag(card,'save')})&&!player.hasSkillTag('save',true)) return 10-get.value(card); - return 7-get.value(card); - } - return 6-get.value(card); - }).set('check',check).setHiddenSkill(event.name); - 'step 1' - var logged=false; - if(result.cards){ - logged=true; - player.logSkill('keshou'); + direct: true, + preHidden: true, + content: function () { + "step 0"; + var check = + player.countCards("h", { color: "red" }) > 1 || + player.countCards("h", { color: "black" }) > 1; + player + .chooseCard( + get.prompt("keshou"), + "弃置两张颜色相同的牌,令即将受到的伤害-1", + "he", + 2, + function (card) { + if (ui.selected.cards.length) + return get.color(card) == get.color(ui.selected.cards[0]); + return true; + } + ) + .set("complexCard", true) + .set("ai", function (card) { + if (!_status.event.check) return 0; + var player = _status.event.player; + if (player.hp == 1) { + if ( + !player.countCards("h", function (card) { + return get.tag(card, "save"); + }) && + !player.hasSkillTag("save", true) + ) + return 10 - get.value(card); + return 7 - get.value(card); + } + return 6 - get.value(card); + }) + .set("check", check) + .setHiddenSkill(event.name); + "step 1"; + var logged = false; + if (result.cards) { + logged = true; + player.logSkill("keshou"); player.discard(result.cards); trigger.num--; } - if(!player.isUnseen()&&!game.hasPlayer(function(current){ - return current!=player&¤t.isFriendOf(player); - })){ - if(!logged) player.logSkill('keshou'); - player.judge(function(card){ - if(get.color(card)=='red') return 1; + if ( + !player.isUnseen() && + !game.hasPlayer(function (current) { + return current != player && current.isFriendOf(player); + }) + ) { + if (!logged) player.logSkill("keshou"); + player.judge(function (card) { + if (get.color(card) == "red") return 1; return 0; }); - } - else event.finish(); - 'step 2' - if(result.judge>0) player.draw(); - } + } else event.finish(); + "step 2"; + if (result.judge > 0) player.draw(); + }, }, - zhuwei:{ - audio:2, - trigger:{player:'judgeEnd'}, - filter:function(event){ - if(get.owner(event.result.card)) return false; - if(event.nogain&&event.nogain(event.result.card)) return false; + zhuwei: { + audio: 2, + trigger: { player: "judgeEnd" }, + filter: function (event) { + if (get.owner(event.result.card)) return false; + if (event.nogain && event.nogain(event.result.card)) return false; return true; //return event.result.card.name=='sha'||event.result.card.name=='juedou'; }, - frequent:true, - preHidden:true, - content:function(){ - 'step 0' - player.gain(trigger.result.card,'gain2'); - player.chooseBool('是否令'+get.translation(_status.currentPhase)+'本回合的手牌上限和使用【杀】的次数上限+1?').ai=function(){ - return get.attitude(player,_status.currentPhase)>0; + frequent: true, + preHidden: true, + content: function () { + "step 0"; + player.gain(trigger.result.card, "gain2"); + player.chooseBool( + "是否令" + + get.translation(_status.currentPhase) + + "本回合的手牌上限和使用【杀】的次数上限+1?" + ).ai = function () { + return get.attitude(player, _status.currentPhase) > 0; }; - 'step 1' - if(result.bool){ - var target=_status.currentPhase; - if(!target.hasSkill('zhuwei_eff')){ - target.addTempSkill('zhuwei_eff'); - target.storage.zhuwei_eff=1; - } - else target.storage.zhuwei_eff++; + "step 1"; + if (result.bool) { + var target = _status.currentPhase; + if (!target.hasSkill("zhuwei_eff")) { + target.addTempSkill("zhuwei_eff"); + target.storage.zhuwei_eff = 1; + } else target.storage.zhuwei_eff++; target.updateMarks(); } }, - subSkill:{ - eff:{ - sub:true, - mod:{ - cardUsable:function(card,player,num){ - if(card.name=='sha') return num+player.storage.zhuwei_eff; + subSkill: { + eff: { + sub: true, + mod: { + cardUsable: function (card, player, num) { + if (card.name == "sha") return num + player.storage.zhuwei_eff; + }, + maxHandcard: function (player, num) { + return num + player.storage.zhuwei_eff; }, - maxHandcard:function(player,num){return num+player.storage.zhuwei_eff} }, - mark:true, - charlotte:true, - intro:{ - content:function(storage){if(storage) return '使用【杀】的次数上限+'+storage+',手牌上限+'+storage} - } - } - } + mark: true, + charlotte: true, + intro: { + content: function (storage) { + if (storage) + return "使用【杀】的次数上限+" + storage + ",手牌上限+" + storage; + }, + }, + }, + }, }, - gzweidi:{ - init:function(player){player.storage.gzweidi=[]}, - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return player.storage.gzweidi.length>0 + gzweidi: { + init: function (player) { + player.storage.gzweidi = []; }, - filterTarget:function(card,player,target){return target!=player&&player.storage.gzweidi.includes(target)}, - content:function(){ - 'step 0' + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + return player.storage.gzweidi.length > 0; + }, + filterTarget: function (card, player, target) { + return target != player && player.storage.gzweidi.includes(target); + }, + content: function () { + "step 0"; player.chooseJunlingFor(target); - 'step 1' - event.junling=result.junling; - event.targets=result.targets; - var choiceList=['执行该军令']; - if(target!=player) choiceList.push('令'+get.translation(player)+'获得你所有手牌,然后交给你等量的牌'); - else choiceList.push('不执行该军令'); - target.chooseJunlingControl(player,result.junling,result.targets).set('prompt','伪帝').set('choiceList',choiceList).set('ai',function(){ - if(get.attitude(target,player)>=0) return get.junlingEffect(player,result.junling,target,result.targets,target)>=0?0:1; - return get.junlingEffect(player,result.junling,target,result.targets,target)>=-1?0:1; - }); - 'step 2' - if(result.index==0) target.carryOutJunling(player,event.junling,targets); - else if(target!=player&&target.countCards('h')) { - event.num=target.countCards('h'); - player.gain(target.getCards('h'),target,'giveAuto'); - player.chooseCard('交给'+get.translation(target)+get.cnNumber(event.num)+'张牌','he',event.num,true).set('ai',function(card){ - return -get.value(card); + "step 1"; + event.junling = result.junling; + event.targets = result.targets; + var choiceList = ["执行该军令"]; + if (target != player) + choiceList.push( + "令" + get.translation(player) + "获得你所有手牌,然后交给你等量的牌" + ); + else choiceList.push("不执行该军令"); + target + .chooseJunlingControl(player, result.junling, result.targets) + .set("prompt", "伪帝") + .set("choiceList", choiceList) + .set("ai", function () { + if (get.attitude(target, player) >= 0) + return get.junlingEffect( + player, + result.junling, + target, + result.targets, + target + ) >= 0 + ? 0 + : 1; + return get.junlingEffect( + player, + result.junling, + target, + result.targets, + target + ) >= -1 + ? 0 + : 1; }); - } - else event.finish(); - 'step 3' - if(result.cards){ - player.give(result.cards,target); + "step 2"; + if (result.index == 0) target.carryOutJunling(player, event.junling, targets); + else if (target != player && target.countCards("h")) { + event.num = target.countCards("h"); + player.gain(target.getCards("h"), target, "giveAuto"); + player + .chooseCard( + "交给" + get.translation(target) + get.cnNumber(event.num) + "张牌", + "he", + event.num, + true + ) + .set("ai", function (card) { + return -get.value(card); + }); + } else event.finish(); + "step 3"; + if (result.cards) { + player.give(result.cards, target); } }, - group:['gzweidi_ft','gzweidi_ftc'], - ai:{ - order:3, - result:{ - player:1, - } + group: ["gzweidi_ft", "gzweidi_ftc"], + ai: { + order: 3, + result: { + player: 1, + }, }, - subSkill:{ - ft:{ - sub:true, - trigger:{global:'gainBefore'}, - silent:true, - filter:function(event,player){ - if(player==event.player||player.storage.gzweidi.includes(event.player)||_status.currentPhase!=player) return false; - if(event.cards.length){ - if(event.getParent().name=='draw') return true; - for(var i=0;i0; - }) - }, - content:function(){trigger.num++}, - audio:['yongsi1',2], - }, - eff2:{ - sub:true, - trigger:{player:'phaseUseBegin'}, - //priority:8, - forced:true, - noHidden:true, - equipSkill:true, - filter:function(event,player){ - if(player.isDisabled(5)) return false; - return game.hasPlayer(function(current){ - return player.canUse('zhibi',current); - })&&!game.hasPlayer(function(current){ - return current.getEquips('yuxi').length>0; + forced: true, + filter: function (event, player) { + if (event.numFixed || player.isDisabled(5)) return false; + return !game.hasPlayer(function (current) { + return current.getEquips("yuxi").length > 0; }); }, - content:function(){ - player.chooseUseTarget('玉玺(庸肆):选择知己知彼的目标',{name:'zhibi'}); + content: function () { + trigger.num++; }, - audio:['yongsi1',2], + audio: ["yongsi1", 2], }, - eff3:{ - sub:true, - trigger:{global:'useCardToTargeted'}, - //priority:16, - forced:true, - filter:function(event,player){ - return event.target&&event.target==player&&event.card&&event.card.name=='zhibi' + eff2: { + sub: true, + trigger: { player: "phaseUseBegin" }, + //priority:8, + forced: true, + noHidden: true, + equipSkill: true, + filter: function (event, player) { + if (player.isDisabled(5)) return false; + return ( + game.hasPlayer(function (current) { + return player.canUse("zhibi", current); + }) && + !game.hasPlayer(function (current) { + return current.getEquips("yuxi").length > 0; + }) + ); }, - check:function(){return false}, - content:function(){ + content: function () { + player.chooseUseTarget("玉玺(庸肆):选择知己知彼的目标", { name: "zhibi" }); + }, + audio: ["yongsi1", 2], + }, + eff3: { + sub: true, + trigger: { global: "useCardToTargeted" }, + //priority:16, + forced: true, + filter: function (event, player) { + return ( + event.target && + event.target == player && + event.card && + event.card.name == "zhibi" + ); + }, + check: function () { + return false; + }, + content: function () { player.showHandcards(); - } - } - } + }, + }, + }, }, - gzfudi:{ - trigger:{global:'damageEnd'}, - direct:true, - preHidden:true, - audio:2, - filter:function(event,player){return event.source&&event.source.isAlive()&&event.source!=player&&event.player==player&&player.countCards('h')&&event.num>0}, - content:function(){ - 'step 0' - var players=game.filterPlayer(function(current){ - return current.isFriendOf(trigger.source)&¤t.hp>=player.hp&&!game.hasPlayer(function(current2){ - return current2.hp>current.hp&¤t2.isFriendOf(trigger.source); + gzfudi: { + trigger: { global: "damageEnd" }, + direct: true, + preHidden: true, + audio: 2, + filter: function (event, player) { + return ( + event.source && + event.source.isAlive() && + event.source != player && + event.player == player && + player.countCards("h") && + event.num > 0 + ); + }, + content: function () { + "step 0"; + var players = game.filterPlayer(function (current) { + return ( + current.isFriendOf(trigger.source) && + current.hp >= player.hp && + !game.hasPlayer(function (current2) { + return current2.hp > current.hp && current2.isFriendOf(trigger.source); + }) + ); + }); + var check = true; + if (!players.length) check = false; + else { + if (get.attitude(player, trigger.source) >= 0) check = false; + } + player + .chooseCard( + get.prompt("gzfudi", trigger.source), + "交给其一张手牌,然后对其势力中体力值最大且不小于你的一名角色造成1点伤害" + ) + .set("aicheck", check) + .set("ai", function (card) { + if (!_status.event.aicheck) return 0; + return 9 - get.value(card); }) + .setHiddenSkill(event.name); + "step 1"; + if (result.bool) { + player.logSkill("gzfudi", trigger.source); + player.give(result.cards, trigger.source); + } else event.finish(); + "step 2"; + var list = game.filterPlayer(function (current) { + return ( + current.hp >= player.hp && + current.isFriendOf(trigger.source) && + !game.hasPlayer(function (current2) { + return current2.hp > current.hp && current2.isFriendOf(trigger.source); + }) + ); }); - var check=true; - if(!players.length) check=false; - else{ - if(get.attitude(player,trigger.source)>=0) check=false; - } - player.chooseCard(get.prompt('gzfudi',trigger.source),'交给其一张手牌,然后对其势力中体力值最大且不小于你的一名角色造成1点伤害').set('aicheck',check).set('ai',function(card){ - if(!_status.event.aicheck) return 0; - return 9-get.value(card); - }).setHiddenSkill(event.name); - 'step 1' - if(result.bool){ - player.logSkill('gzfudi',trigger.source); - player.give(result.cards,trigger.source); - } - else event.finish(); - 'step 2' - var list=game.filterPlayer(function(current){ - return current.hp>=player.hp&¤t.isFriendOf(trigger.source)&&!game.hasPlayer(function(current2){ - return current2.hp>current.hp&¤t2.isFriendOf(trigger.source); - }); - }); - if(list.length){ - if(list.length==1) event._result={bool:true,targets:list}; - else player.chooseTarget(true,'对'+get.translation(trigger.source)+'势力中体力值最大的一名角色造成1点伤害',function(card,player,target){ - return _status.event.list.includes(target); - }).set('list',list).set('ai',function(target){return get.damageEffect(target,player,player)}); - } - else event.finish(); - 'step 3' - if(result.bool&&result.targets.length){ + if (list.length) { + if (list.length == 1) event._result = { bool: true, targets: list }; + else + player + .chooseTarget( + true, + "对" + + get.translation(trigger.source) + + "势力中体力值最大的一名角色造成1点伤害", + function (card, player, target) { + return _status.event.list.includes(target); + } + ) + .set("list", list) + .set("ai", function (target) { + return get.damageEffect(target, player, player); + }); + } else event.finish(); + "step 3"; + if (result.bool && result.targets.length) { player.line(result.targets[0]); result.targets[0].damage(); } }, - ai:{ - maixie:true, - maixie_defend:true, - effect:{ - target:function(card,player,target){ - if(get.tag(card,'damage')&&target.hp>1){ - if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; - if(!target.countCards('h')) return [1,-1]; - if(game.countPlayer(function(current){return current.isFriendOf(player)&¤t.hp>=target.hp-1})) return [1,0,0,-2]; + ai: { + maixie: true, + maixie_defend: true, + effect: { + target: function (card, player, target) { + if (get.tag(card, "damage") && target.hp > 1) { + if (player.hasSkillTag("jueqing", false, target)) return [1, -2]; + if (!target.countCards("h")) return [1, -1]; + if ( + game.countPlayer(function (current) { + return current.isFriendOf(player) && current.hp >= target.hp - 1; + }) + ) + return [1, 0, 0, -2]; } - } - } - } - }, - gzcongjian:{ - trigger:{ - player:'damageBegin3', - source:'damageBegin1', + }, + }, }, - forced:true, - preHidden:true, - audio:'drlt_congjian', - filter:function(event,player,name){ - if(event.num<=0) return false; - if(name=='damageBegin1'&&_status.currentPhase!=player) return true; - if(name=='damageBegin3'&&_status.currentPhase==player) return true; + }, + gzcongjian: { + trigger: { + player: "damageBegin3", + source: "damageBegin1", + }, + forced: true, + preHidden: true, + audio: "drlt_congjian", + filter: function (event, player, name) { + if (event.num <= 0) return false; + if (name == "damageBegin1" && _status.currentPhase != player) return true; + if (name == "damageBegin3" && _status.currentPhase == player) return true; return false; }, - check:function(event,player){ - return _status.currentPhase!=player; + check: function (event, player) { + return _status.currentPhase != player; + }, + content: function () { + trigger.num++; }, - content:function(){trigger.num++}, }, - jianan:{ - audio:2, - unique:true, - forceunique:true, - group:'wuziliangjiangdao', - derivation:'wuziliangjiangdao', - lordSkill:true, - global:'g_jianan', + jianan: { + audio: 2, + unique: true, + forceunique: true, + group: "wuziliangjiangdao", + derivation: "wuziliangjiangdao", + lordSkill: true, + global: "g_jianan", }, - g_jianan:{ - trigger:{ - player:['phaseZhunbeiBegin','phaseBefore','dieBegin'], + g_jianan: { + trigger: { + player: ["phaseZhunbeiBegin", "phaseBefore", "dieBegin"], }, - audio:'jianan', - forceaudio:true, - filter:function(event,player,name){ - if(name!='phaseZhunbeiBegin') return get.is.jun(player)&&player.identity=='wei'; - return this.filter2.apply(this,arguments); + audio: "jianan", + forceaudio: true, + filter: function (event, player, name) { + if (name != "phaseZhunbeiBegin") return get.is.jun(player) && player.identity == "wei"; + return this.filter2.apply(this, arguments); }, - filter2:function(event,player){ - if(!get.zhu(player,'jianan')) return false; - if(!player.countCards('he')) return false; + filter2: function (event, player) { + if (!get.zhu(player, "jianan")) return false; + if (!player.countCards("he")) return false; return !player.isUnseen(); }, - direct:true, - content:function(){ - 'step 0' - if(event.triggername!='phaseZhunbeiBegin'){ - event.trigger('jiananUpdate'); + direct: true, + content: function () { + "step 0"; + if (event.triggername != "phaseZhunbeiBegin") { + event.trigger("jiananUpdate"); event.finish(); return; } - var skills=['new_retuxi','qiaobian','fakexiaoguo','gzjieyue','new_duanliang']; - game.countPlayer(function(current){ - if(current==player) return; - if(current.hasSkill('new_retuxi')) skills.remove('new_retuxi'); - if(current.hasSkill('qiaobian')) skills.remove('qiaobian'); - if(current.hasSkill('fakexiaoguo')) skills.remove('fakexiaoguo'); - if(current.hasSkill('gzjieyue')) skills.remove('gzjieyue'); - if(current.hasSkill('new_duanliang')) skills.remove('new_duanliang'); + var skills = ["new_retuxi", "qiaobian", "fakexiaoguo", "gzjieyue", "new_duanliang"]; + game.countPlayer(function (current) { + if (current == player) return; + if (current.hasSkill("new_retuxi")) skills.remove("new_retuxi"); + if (current.hasSkill("qiaobian")) skills.remove("qiaobian"); + if (current.hasSkill("fakexiaoguo")) skills.remove("fakexiaoguo"); + if (current.hasSkill("gzjieyue")) skills.remove("gzjieyue"); + if (current.hasSkill("new_duanliang")) skills.remove("new_duanliang"); }); - if(!skills.length) event.finish(); - else{ - event.skills=skills; - var next=player.chooseToDiscard('he'); - var str=''; - for(var i=0;i1) rank=4; - if(skills.includes('gzjieyue')&&player.countCards('h',function(card){ - return get.value(card)<7; - })>1) rank=5; - if(skills.includes('qiaobian')&&player.countCards('h')>4) rank=6; - if((get.guozhanRank(player.name1,player) 1 + ) + rank = 4; + if ( + skills.includes("gzjieyue") && + player.countCards("h", function (card) { + return get.value(card) < 7; + }) > 1 + ) + rank = 5; + if (skills.includes("qiaobian") && player.countCards("h") > 4) rank = 6; + if ( + (get.guozhanRank(player.name1, player) < rank && !player.isUnseen(0)) || + (get.guozhanRank(player.name2, player) < rank && !player.isUnseen(1)) + ) + return rank + 1 - get.value(card); return -1; }; } - 'step 1' - if(!result.bool) event.finish(); - else{ - var list=["主将","副将"]; - if(player.isUnseen(0)||get.is.jun(player)) list.remove("主将"); - if(player.isUnseen(1)) list.remove("副将"); - if(!list.length) event.goto(3); - else if(list.length<2) event._result={control:list[0]}; - else{ - player.chooseControl(list).set('ai',function(){ - return get.guozhanRank(player.name1,player)3) return 'qiaobian'; - if(skills.includes('gzjieyue')&&player.countCards('h',function(card){ - return get.value(card)<7; - })) return 'gzjieyue'; - if(skills.includes('new_retuxi')) return 'new_retuxi'; - return skills.randomGet(); - }).set("prompt","选择获得其中的一个技能直到君主的回合开始"); - 'step 4' - var link=result.control; - player.addTempSkill(link,"jiananUpdate"); - player.addTempSkill("jianan_eff","jiananUpdate"); - game.log(player,"获得了技能","#g【"+get.translation(result.control)+"】"); + "step 3"; + player + .chooseControl(event.skills) + .set("ai", function () { + var skills = event.skills; + if (skills.includes("qiaobian") && player.countCards("h") > 3) return "qiaobian"; + if ( + skills.includes("gzjieyue") && + player.countCards("h", function (card) { + return get.value(card) < 7; + }) + ) + return "gzjieyue"; + if (skills.includes("new_retuxi")) return "new_retuxi"; + return skills.randomGet(); + }) + .set("prompt", "选择获得其中的一个技能直到君主的回合开始"); + "step 4"; + var link = result.control; + player.addTempSkill(link, "jiananUpdate"); + player.addTempSkill("jianan_eff", "jiananUpdate"); + game.log(player, "获得了技能", "#g【" + get.translation(result.control) + "】"); }, }, - jianan_eff:{ - ai:{nomingzhi:true} + jianan_eff: { + ai: { nomingzhi: true }, }, - huibian:{ - enable:'phaseUse', - audio:2, - usable:1, - filter:function(event,player){ - return game.countPlayer(function(current){ - return current.identity=='wei'; - })>1&&game.hasPlayer(function(current){ - return current.isDamaged()&¤t.identity=='wei'; - }); + huibian: { + enable: "phaseUse", + audio: 2, + usable: 1, + filter: function (event, player) { + return ( + game.countPlayer(function (current) { + return current.identity == "wei"; + }) > 1 && + game.hasPlayer(function (current) { + return current.isDamaged() && current.identity == "wei"; + }) + ); }, - filterTarget:function(card,player,target){ - if(ui.selected.targets.length) return target.isDamaged()&&target.identity=='wei'; - return target.identity=='wei'; + filterTarget: function (card, player, target) { + if (ui.selected.targets.length) return target.isDamaged() && target.identity == "wei"; + return target.identity == "wei"; }, - selectTarget:2, - multitarget:true, - targetprompt:['受到伤害
    然后摸牌','回复体力'], - content:function(){ - 'step 0' + selectTarget: 2, + multitarget: true, + targetprompt: ["受到伤害
    然后摸牌", "回复体力"], + content: function () { + "step 0"; targets[0].damage(player); - 'step 1' - if(targets[0].isAlive()) targets[0].draw(2); + "step 1"; + if (targets[0].isAlive()) targets[0].draw(2); targets[1].recover(); }, - ai:{ - threaten:1.2, - order:9, - result:{ - target:function(player,target){ - if(ui.selected.targets.length) return 1; - if(get.damageEffect(target,player,player)>0) return 2; - if(target.hp>2) return 1; - if(target.hp==1) return -1; + ai: { + threaten: 1.2, + order: 9, + result: { + target: function (player, target) { + if (ui.selected.targets.length) return 1; + if (get.damageEffect(target, player, player) > 0) return 2; + if (target.hp > 2) return 1; + if (target.hp == 1) return -1; return 0.1; - } - }, - } - }, - gzzongyu:{ - audio:2, - unique:true, - forceunique:true, - group:['gzzongyu_others','gzzongyu_player'], - ai:{ - threaten:1.2, - }, - subSkill:{ - others:{ - trigger:{global:'equipAfter'}, - direct:true, - filter:function(event,player){ - if(event.player==player||!player.countCards('e',{subtype:['equip3','equip4']})) return false; - return event.card.name=='liulongcanjia'; }, - check:function(event,player){ - if(get.attitude(player,target)<=0) return player.countCards('e',{subtype:['equip4','equip4']})<2; + }, + }, + }, + gzzongyu: { + audio: 2, + unique: true, + forceunique: true, + group: ["gzzongyu_others", "gzzongyu_player"], + ai: { + threaten: 1.2, + }, + subSkill: { + others: { + trigger: { global: "equipAfter" }, + direct: true, + filter: function (event, player) { + if ( + event.player == player || + !player.countCards("e", { subtype: ["equip3", "equip4"] }) + ) + return false; + return event.card.name == "liulongcanjia"; + }, + check: function (event, player) { + if (get.attitude(player, target) <= 0) + return player.countCards("e", { subtype: ["equip4", "equip4"] }) < 2; return true; }, - content:function(){ - 'step 0' - player.chooseBool('是否发动【总御】,与'+get.translation(trigger.player)+'交换装备区内坐骑牌?'); - 'step 1' - if(result.bool){ - player.logSkill('gzzongyu',trigger.player); - event.cards=[player.getCards('e',{subtype:['equip3','equip4']}),trigger.player.getCards('e',{name:'liulongcanjia'})]; - player.lose(event.cards[0],ui.special); - trigger.player.lose(event.cards[1],ui.special); - if(event.cards[0].length) player.$give(event.cards[0],trigger.player); - if(event.cards[1].length) trigger.player.$give(event.cards[1],player); - } - else event.finish(); - 'step 2' - for(var i=0;i0.7; + check: function (event, player) { + if ( + player.countCards("h", function (card) { + return get.value(card) < 7; + }) + ) { + if (player.isUnseen()) return Math.random() > 0.7; return true; } }, - preHidden:true, - content:function(){ - 'step 0' - var choices=[]; - if(game.hasPlayer(function(current){return current.isUnseen()})) choices.push('选择一名未确定势力的角色'); - if(game.hasPlayer(function(current){return current!=player&&!current.isUnseen()})&&player.countCards('h',{type:'basic'})) choices.push('将一张基本牌交给一名已确定势力的角色'); - if(choices.length==1){ - event._result={index:choices[0]=='选择一名未确定势力的角色'?0:1}; - } - else player.chooseControl().set('ai',function(){ - if(choices.length>1){ - var player=_status.event.player; - if(!game.hasPlayer(function(current){ - return !current.isUnseen()&¤t.getEquip('yuxi')||current.hasSkill('gzyongsi')&&!game.hasPlayer(function(current){ - return current.getEquips('yuxi').length>0; - }); - })&&game.hasPlayer(function(current){return current!=player&¤t.isUnseen()})){ - var identity; - for(var i=0;i 1) { + var player = _status.event.player; + if ( + !game.hasPlayer(function (current) { + return ( + (!current.isUnseen() && current.getEquip("yuxi")) || + (current.hasSkill("gzyongsi") && + !game.hasPlayer(function (current) { + return current.getEquips("yuxi").length > 0; + })) + ); + }) && + game.hasPlayer(function (current) { + return current != player && current.isUnseen(); + }) + ) { + var identity; + for (var i = 0; i < game.players; i++) { + if (game.players[i].isMajor()) { + identity = game.players[i].identity; + break; + } + } + } + if ( + !player.isUnseen() && + player.identity != identity && + get.population(player.identity) + 1 >= get.population(identity) + ) + return 0; + return 1; } - } - if(!player.isUnseen()&&player.identity!=identity&&get.population(player.identity)+1>=get.population(identity)) return 0; - return 1; - } - return 0; - }).set('prompt','征辟:请选择一项').set('choiceList',choices); - 'step 1' - if(result.index==0) player.chooseTarget('请选择一名未确定势力的角色',function(card,player,target){ - return target!=player&&target.identity=='unknown' - },true); - else player.chooseCardTarget({ - prompt:'请将一张基本牌交给一名已确定势力的其他角色', - position:'h', - filterCard:function(card){return get.type(card)=='basic'}, - filterTarget:function(card,player,target){ - return target!=player&&target.identity!='unknown'; - }, - ai1:function(card){return 5-get.value(card)}, - ai2:function(target){ - var player=_status.event.player; - var att=get.attitude(player,target); - if(att>0) return 0; - return -(att-1)/target.countCards('h'); - } - }).set('forced',true); - 'step 2' - event.target=result.targets[0]; - player.line(result.targets,'green'); - if(result.cards.length){ - event.cards=result.cards; - player.give(result.cards,result.targets[0]); - } - else{ - player.storage.gzzhengbi_eff1=result.targets[0]; - player.addTempSkill('gzzhengbi_eff1','phaseUseAfter'); + return 0; + }) + .set("prompt", "征辟:请选择一项") + .set("choiceList", choices); + "step 1"; + if (result.index == 0) + player.chooseTarget( + "请选择一名未确定势力的角色", + function (card, player, target) { + return target != player && target.identity == "unknown"; + }, + true + ); + else + player + .chooseCardTarget({ + prompt: "请将一张基本牌交给一名已确定势力的其他角色", + position: "h", + filterCard: function (card) { + return get.type(card) == "basic"; + }, + filterTarget: function (card, player, target) { + return target != player && target.identity != "unknown"; + }, + ai1: function (card) { + return 5 - get.value(card); + }, + ai2: function (target) { + var player = _status.event.player; + var att = get.attitude(player, target); + if (att > 0) return 0; + return -(att - 1) / target.countCards("h"); + }, + }) + .set("forced", true); + "step 2"; + event.target = result.targets[0]; + player.line(result.targets, "green"); + if (result.cards.length) { + event.cards = result.cards; + player.give(result.cards, result.targets[0]); + } else { + player.storage.gzzhengbi_eff1 = result.targets[0]; + player.addTempSkill("gzzhengbi_eff1", "phaseUseAfter"); event.finish(); } - 'step 3' - var choices=[]; - if(target.countCards('he',{type:['trick','delay','equip']})) choices.push('一张非基本牌'); - if(target.countCards('h',{type:'basic'})>1) choices.push('两张基本牌'); - if(choices.length) target.chooseControl(choices).set('ai',function(event,player){ - if(choices.length>1){ - if(player.countCards('he',{type:['trick','delay','equip']},function(card){return get.value(card)<7})) return 0; - return 1; - } - return 0; - }).set('prompt','征辟:交给'+get.translation(player)+'…
  • '); - else{ - if(target.countCards('h')){ - var cards=target.getCards('h'); - target.give(cards,player); + "step 3"; + var choices = []; + if (target.countCards("he", { type: ["trick", "delay", "equip"] })) + choices.push("一张非基本牌"); + if (target.countCards("h", { type: "basic" }) > 1) choices.push("两张基本牌"); + if (choices.length) + target + .chooseControl(choices) + .set("ai", function (event, player) { + if (choices.length > 1) { + if ( + player.countCards( + "he", + { type: ["trick", "delay", "equip"] }, + function (card) { + return get.value(card) < 7; + } + ) + ) + return 0; + return 1; + } + return 0; + }) + .set("prompt", "征辟:交给" + get.translation(player) + "…
    "); + else { + if (target.countCards("h")) { + var cards = target.getCards("h"); + target.give(cards, player); event.finish(); - } - else event.finish(); + } else event.finish(); } - 'step 4' - var check=(result.control=='一张非基本牌'); - target.chooseCard('he',(check?1:2),{type:(check?['trick','delay','equip']:'basic')},true); - 'step 5' - if(result.cards){ - target.give(result.cards,player); + "step 4"; + var check = result.control == "一张非基本牌"; + target.chooseCard( + "he", + check ? 1 : 2, + { type: check ? ["trick", "delay", "equip"] : "basic" }, + true + ); + "step 5"; + if (result.cards) { + target.give(result.cards, player); } }, - subSkill:{ - eff1:{ - audio:'zhengbi', - sub:true, - onremove:true, - trigger:{player:'phaseUseEnd'}, - forced:true, - charlotte:true, - filter:function(event,player){ - var target=player.storage.gzzhengbi_eff1; - return target&&!target.isUnseen()&&target.countGainableCards(player,'he')>0; + subSkill: { + eff1: { + audio: "zhengbi", + sub: true, + onremove: true, + trigger: { player: "phaseUseEnd" }, + forced: true, + charlotte: true, + filter: function (event, player) { + var target = player.storage.gzzhengbi_eff1; + return ( + target && !target.isUnseen() && target.countGainableCards(player, "he") > 0 + ); }, - logTarget:function(event,player){ + logTarget: function (event, player) { return player.storage.gzzhengbi_eff1; }, - content:function(){ - var num=0; - var target=player.storage.gzzhengbi_eff1; - if(target.countGainableCards(player,'h')) num++; - if(target.countGainableCards(player,'e')) num++; - if(num){ - player.gainPlayerCard(target,num,'he',true).set('filterButton',function(button){ - for(var i=0;i0; + gzfengying: { + audio: "fengying", + limited: true, + enable: "phaseUse", + position: "h", + filterCard: true, + selectCard: -1, + filter: function (event, player) { + return !player.storage.gzfengying && player.countCards("h") > 0; }, - filterTarget:function(card,player,target){ - return target==player; + filterTarget: function (card, player, target) { + return target == player; }, - selectTarget:-1, - discard:false, - lose:false, - content:function(){ - 'step 0' - player.awakenSkill('gzfengying'); - player.storage.gzfengying=true; - player.useCard({name:'xietianzi'},cards,target); - 'step 1' - var list=game.filterPlayer(function(current){ - return current.isFriendOf(player)&¤t.countCards('h')=4) return 0; - for(var i=0;i= 4) return 0; + for (var i = 0; i < cards.length; i++) { + value += Math.max(0, get.value(cards[i], player, "raw")); } - var targets=game.filterPlayer(function(current){return current.isFriendOf(player)&¤t!=player}); - var eff=0; - for(var i=0;i0) return 11-get.value(card); - return 7-get.value(card); - }, - ai2:function(card,player,target){ - var att=get.attitude(player,target); - if(att<0) return -att; - return 1; - } - }).setHiddenSkill('gzjieyue'); - 'step 1' - if(result.bool){ - event.target=result.targets[0]; - player.logSkill('gzjieyue',result.targets); - player.give(result.cards[0],result.targets[0]); + direct: true, + preHidden: true, + content: function () { + "step 0"; + player + .chooseCardTarget({ + prompt: get.prompt2("gzjieyue"), + position: "h", + filterCard: true, + filterTarget: function (card, player, target) { + return target.identity != "wei" && target != player; + }, + ai1: function (card, player, target) { + if (get.attitude(player, target) > 0) return 11 - get.value(card); + return 7 - get.value(card); + }, + ai2: function (card, player, target) { + var att = get.attitude(player, target); + if (att < 0) return -att; + return 1; + }, + }) + .setHiddenSkill("gzjieyue"); + "step 1"; + if (result.bool) { + event.target = result.targets[0]; + player.logSkill("gzjieyue", result.targets); + player.give(result.cards[0], result.targets[0]); player.chooseJunlingFor(result.targets[0]); - } - else event.finish(); - 'step 2' - event.junling=result.junling; - event.targets=result.targets; - var choiceList=[]; - choiceList.push('执行该军令,然后'+get.translation(player)+'摸一张牌'); - choiceList.push('令'+get.translation(player)+'摸牌阶段额外摸三张牌'); - target.chooseJunlingControl(player,result.junling,result.targets).set('prompt','节钺').set('choiceList',choiceList).set('ai',function(){ - if(get.attitude(target,player)>0) return get.junlingEffect(player,result.junling,target,result.targets,target)>1?0:1; - return get.junlingEffect(player,result.junling,target,result.targets,target)>=-1?0:1; - }); - 'step 3' - if(result.index==0){ - target.carryOutJunling(player,event.junling,targets); + } else event.finish(); + "step 2"; + event.junling = result.junling; + event.targets = result.targets; + var choiceList = []; + choiceList.push("执行该军令,然后" + get.translation(player) + "摸一张牌"); + choiceList.push("令" + get.translation(player) + "摸牌阶段额外摸三张牌"); + target + .chooseJunlingControl(player, result.junling, result.targets) + .set("prompt", "节钺") + .set("choiceList", choiceList) + .set("ai", function () { + if (get.attitude(target, player) > 0) + return get.junlingEffect( + player, + result.junling, + target, + result.targets, + target + ) > 1 + ? 0 + : 1; + return get.junlingEffect( + player, + result.junling, + target, + result.targets, + target + ) >= -1 + ? 0 + : 1; + }); + "step 3"; + if (result.index == 0) { + target.carryOutJunling(player, event.junling, targets); player.draw(); - } - else player.addTempSkill('gzjieyue_eff'); + } else player.addTempSkill("gzjieyue_eff"); }, - ai:{threaten:2}, - subSkill:{ - eff:{ - sub:true, - trigger:{player:'phaseDrawBegin2'}, - filter:function(event,player){ + ai: { threaten: 2 }, + subSkill: { + eff: { + sub: true, + trigger: { player: "phaseDrawBegin2" }, + filter: function (event, player) { return !event.numFixed; }, - forced:true, - popup:false, - content:function(){ - trigger.num+=3; - } - } + forced: true, + popup: false, + content: function () { + trigger.num += 3; + }, + }, }, - audio:['jieyue',2], + audio: ["jieyue", 2], }, - jianglue:{ - limited:true, - audio:2, - enable:'phaseUse', - prepare:function(cards,player){ - var targets=game.filterPlayer(function(current){ - return current.isFriendOf(player)||current.isUnseen(); + jianglue: { + limited: true, + audio: 2, + enable: "phaseUse", + prepare: function (cards, player) { + var targets = game.filterPlayer(function (current) { + return current.isFriendOf(player) || current.isUnseen(); }); - player.line(targets,'fire'); + player.line(targets, "fire"); }, - content:function(){ - 'step 0' - player.awakenSkill('jianglue'); - player.addTempSkill('jianglue_count'); - player.chooseJunlingFor(player).set('prompt','选择一张军令牌,令与你势力相同的其他角色选择是否执行'); - 'step 1' - event.junling=result.junling; - event.targets=result.targets; - event.players=game.filterPlayer(function(current){ - if(current==player) return false; - return current.isFriendOf(player)||(player.identity!='ye'&¤t.isUnseen()); - }).sort(lib.sort.seat); - event.num=0; - event.filterName=function(name){ - return lib.character[name][1]==player.identity&&!get.is.double(name); - } - 'step 2' - if(num3||event.current.countCards('e')>2)) return 1; -return event.junling=='junling5'?1:0;}); - else if((event.filterName(event.current.name1)||event.filterName(event.current.name2))&&event.current.wontYe(player.identity)){ - event.showCharacter=true; - choiceList[0]='明置一张武将牌以'+choiceList[0]; - choiceList[1]='不明置武将牌且'+choiceList[1]; - event.current.chooseJunlingControl(player,event.junling,targets).set('prompt','将略').set('choiceList',choiceList).set('ai',function(){if(event.junling=='junling6'&&(event.current.countCards('h')>3||event.current.countCards('e')>2)) return 1; -return event.junling=='junling5'?1:0;}); - } - else event.current.chooseJunlingControl(player,event.junling,targets).set('prompt','将略').set('controls',['ok']); - } - else event.goto(4); - 'step 3' - event.carry=false; - if(result.index==0&&result.control!='ok'){ - event.carry=true; - if(event.showCharacter){ - var list=[]; - if(event.filterName(event.current.name1)) list.push('主将'); - if(event.filterName(event.current.name2)) list.push('副将'); - if(list.length>1) event.current.chooseControl(['主将','副将']).set('ai',function(){ - if(player.name1=='gz_fazheng') return 0; - if(player.name2=='gz_fazheng') return 1; - return Math.random()>0.5?0:1; - }).prompt='选择并展示一张武将牌,然后执行军令'; - else event._result={index:list[0]=='主将'?0:1}; + content: function () { + "step 0"; + player.awakenSkill("jianglue"); + player.addTempSkill("jianglue_count"); + player + .chooseJunlingFor(player) + .set("prompt", "选择一张军令牌,令与你势力相同的其他角色选择是否执行"); + "step 1"; + event.junling = result.junling; + event.targets = result.targets; + event.players = game + .filterPlayer(function (current) { + if (current == player) return false; + return ( + current.isFriendOf(player) || (player.identity != "ye" && current.isUnseen()) + ); + }) + .sort(lib.sort.seat); + event.num = 0; + event.filterName = function (name) { + return lib.character[name][1] == player.identity && !get.is.double(name); + }; + "step 2"; + if (num < event.players.length) event.current = event.players[num]; + if (event.current && event.current.isAlive()) { + event.showCharacter = false; + var choiceList = ["执行该军令,增加1点体力上限,然后回复1点体力", "不执行该军令"]; + if (event.current.isFriendOf(player)) + event.current + .chooseJunlingControl(player, event.junling, targets) + .set("prompt", "将略") + .set("choiceList", choiceList) + .set("ai", function () { + if ( + event.junling == "junling6" && + (event.current.countCards("h") > 3 || + event.current.countCards("e") > 2) + ) + return 1; + return event.junling == "junling5" ? 1 : 0; + }); + else if ( + (event.filterName(event.current.name1) || + event.filterName(event.current.name2)) && + event.current.wontYe(player.identity) + ) { + event.showCharacter = true; + choiceList[0] = "明置一张武将牌以" + choiceList[0]; + choiceList[1] = "不明置武将牌且" + choiceList[1]; + event.current + .chooseJunlingControl(player, event.junling, targets) + .set("prompt", "将略") + .set("choiceList", choiceList) + .set("ai", function () { + if ( + event.junling == "junling6" && + (event.current.countCards("h") > 3 || + event.current.countCards("e") > 2) + ) + return 1; + return event.junling == "junling5" ? 1 : 0; + }); + } else + event.current + .chooseJunlingControl(player, event.junling, targets) + .set("prompt", "将略") + .set("controls", ["ok"]); + } else event.goto(4); + "step 3"; + event.carry = false; + if (result.index == 0 && result.control != "ok") { + event.carry = true; + if (event.showCharacter) { + var list = []; + if (event.filterName(event.current.name1)) list.push("主将"); + if (event.filterName(event.current.name2)) list.push("副将"); + if (list.length > 1) + event.current.chooseControl(["主将", "副将"]).set("ai", function () { + if (player.name1 == "gz_fazheng") return 0; + if (player.name2 == "gz_fazheng") return 1; + return Math.random() > 0.5 ? 0 : 1; + }).prompt = "选择并展示一张武将牌,然后执行军令"; + else event._result = { index: list[0] == "主将" ? 0 : 1 }; } } - 'step 4' - if(!event.list) event.list=[player]; - if(event.carry){ - if(event.showCharacter) event.current.showCharacter(result.index); - event.current.carryOutJunling(player,event.junling,targets); + "step 4"; + if (!event.list) event.list = [player]; + if (event.carry) { + if (event.showCharacter) event.current.showCharacter(result.index); + event.current.carryOutJunling(player, event.junling, targets); event.list.push(event.current); } event.num++; - if(event.num0) player.draw(player.storage.jianglue_count); + "step 7"; + if (event.num < event.list.length) event.goto(6); + else if (player.storage.jianglue_count > 0) player.draw(player.storage.jianglue_count); }, - marktext:'略', - skillAnimation:'epic', - animationColor:'soil', - ai:{ - order:10, - result:{ - player:function(player){ - if(player.isUnseen()&&player.wontYe()){ - if(get.population(player.group)>=game.players.length/4) return 1; - return Math.random()>0.7?1:0; - } - else return 1; - } - } + marktext: "略", + skillAnimation: "epic", + animationColor: "soil", + ai: { + order: 10, + result: { + player: function (player) { + if (player.isUnseen() && player.wontYe()) { + if (get.population(player.group) >= game.players.length / 4) return 1; + return Math.random() > 0.7 ? 1 : 0; + } else return 1; + }, + }, + }, + subSkill: { + count: { + sub: true, + trigger: { global: "recoverAfter" }, + silent: true, + filter: function (event) { + return event.getParent("jianglue"); + }, + content: function () { + player.storage.jianglue_count++; + }, + }, }, - subSkill:{ - count:{ - sub:true, - trigger:{global:'recoverAfter'}, - silent:true, - filter:function(event){return event.getParent('jianglue')}, - content:function(){player.storage.jianglue_count++} - } - } }, - gzxuanhuo:{ - audio:'rexuanhuo', - global:'gzxuanhuo_others', - derivation:['fz_new_rewusheng','fz_gzpaoxiao','fz_new_longdan','fz_new_tieji','fz_liegong','fz_xinkuanggu'], - ai:{ - threaten:function(player,target){ - if(game.hasPlayer(function(current){ - return current!=target&¤t.isFriendOf(target); - })) return 1.5; + gzxuanhuo: { + audio: "rexuanhuo", + global: "gzxuanhuo_others", + derivation: [ + "fz_new_rewusheng", + "fz_gzpaoxiao", + "fz_new_longdan", + "fz_new_tieji", + "fz_liegong", + "fz_xinkuanggu", + ], + ai: { + threaten: function (player, target) { + if ( + game.hasPlayer(function (current) { + return current != target && current.isFriendOf(target); + }) + ) + return 1.5; return 0.5; }, }, - subSkill:{ - others:{ - audio:'rexuanhuo', - forceaudio:true, - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return (!player.isUnseen())&&player.countCards('h')>0&&game.hasPlayer(function(current){ - return current!=player&¤t.hasSkill('gzxuanhuo')&&player.isFriendOf(current); - }); + subSkill: { + others: { + audio: "rexuanhuo", + forceaudio: true, + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + return ( + !player.isUnseen() && + player.countCards("h") > 0 && + game.hasPlayer(function (current) { + return ( + current != player && + current.hasSkill("gzxuanhuo") && + player.isFriendOf(current) + ); + }) + ); }, - prompt:'弃置一张手牌,然后获得以下技能中的一个:〖武圣〗〖咆哮〗〖龙胆〗〖铁骑〗〖烈弓〗〖狂骨〗', - position:'h', - filterCard:true, - check:function(card){ - var player=_status.event.player; - if(player.hasSkill('gzpaoxiao',true)||player.getEquip('zhuge')) return 0; - if(player.countCards('h',function(cardx){ - return cardx!=card&&cardx.name=='sha'&&player.hasUseTarget(cardx); - })<(player.getCardUsable('sha')+1)) return 0; - return 7-get.value(card); + prompt: "弃置一张手牌,然后获得以下技能中的一个:〖武圣〗〖咆哮〗〖龙胆〗〖铁骑〗〖烈弓〗〖狂骨〗", + position: "h", + filterCard: true, + check: function (card) { + var player = _status.event.player; + if (player.hasSkill("gzpaoxiao", true) || player.getEquip("zhuge")) return 0; + if ( + player.countCards("h", function (cardx) { + return cardx != card && cardx.name == "sha" && player.hasUseTarget(cardx); + }) < + player.getCardUsable("sha") + 1 + ) + return 0; + return 7 - get.value(card); }, - content:function(){ - 'step 0' - var list=['new_rewusheng','gzpaoxiao','new_longdan','new_tieji','liegong','xinkuanggu']; - player.chooseControl(list).set('ai',function(){ - if(list.includes('gzpaoxiao')) return 'gzpaoxiao'; - return list.randomGet(); - }).set('prompt','选择并获得一项技能直到回合结束'); - 'step 1' + content: function () { + "step 0"; + var list = [ + "new_rewusheng", + "gzpaoxiao", + "new_longdan", + "new_tieji", + "liegong", + "xinkuanggu", + ]; + player + .chooseControl(list) + .set("ai", function () { + if (list.includes("gzpaoxiao")) return "gzpaoxiao"; + return list.randomGet(); + }) + .set("prompt", "选择并获得一项技能直到回合结束"); + "step 1"; player.popup(result.control); - player.addTempSkill('fz_'+result.control); - game.log(player,'获得了技能','#g【'+get.translation(result.control)+'】'); + player.addTempSkill("fz_" + result.control); + game.log(player, "获得了技能", "#g【" + get.translation(result.control) + "】"); game.delay(); }, // forceaudio:true, // audio:['xuanhuo',2], - ai:{ - order:8, - result:{player:1}, + ai: { + order: 8, + result: { player: 1 }, }, }, //used:{}, }, // audio:['xuanhuo',2], }, - fz_gzpaoxiao:{ - audio:true, - inherit:'gzpaoxiao', + fz_gzpaoxiao: { + audio: true, + inherit: "gzpaoxiao", }, - fz_new_tieji:{ - audio:true, - inherit:'new_tieji', + fz_new_tieji: { + audio: true, + inherit: "new_tieji", }, - fz_new_rewusheng:{ - audio:true, - inherit:'new_rewusheng', + fz_new_rewusheng: { + audio: true, + inherit: "new_rewusheng", }, - fz_liegong:{ - audio:true, - inherit:'liegong', + fz_liegong: { + audio: true, + inherit: "liegong", }, - fz_xinkuanggu:{ - audio:true, - inherit:'xinkuanggu', + fz_xinkuanggu: { + audio: true, + inherit: "xinkuanggu", }, - fz_new_longdan:{ - audio:true, - group:["fz_new_longdan_sha","fz_new_longdan_shan","fz_new_longdan_draw","fz_new_longdan_shamiss","fz_new_longdan_shanafter"], - subSkill:{ - shanafter:{ - sub:true, - audio:"fz_new_longdan", - trigger:{ - player:"useCard", + fz_new_longdan: { + audio: true, + group: [ + "fz_new_longdan_sha", + "fz_new_longdan_shan", + "fz_new_longdan_draw", + "fz_new_longdan_shamiss", + "fz_new_longdan_shanafter", + ], + subSkill: { + shanafter: { + sub: true, + audio: "fz_new_longdan", + trigger: { + player: "useCard", }, //priority:1, - filter:function(event,player){ - return event.skill=='fz_new_longdan_shan'&&event.getParent(2).name=='sha'; + filter: function (event, player) { + return event.skill == "fz_new_longdan_shan" && event.getParent(2).name == "sha"; }, - direct:true, - content:function(){ - "step 0" - player.chooseTarget("是否发动【龙胆】令一名其他角色回复1点体力?",function(card,player,target){ - return target!=_status.event.source&&target!=player&&target.isDamaged(); - }).set('ai',function(target){ - return get.attitude(_status.event.player,target); - }).set('source',trigger.getParent(2).player); - "step 1" - if(result.bool&&result.targets&&result.targets.length){ - player.logSkill('fz_new_longdan',result.targets[0]); + direct: true, + content: function () { + "step 0"; + player + .chooseTarget( + "是否发动【龙胆】令一名其他角色回复1点体力?", + function (card, player, target) { + return ( + target != _status.event.source && + target != player && + target.isDamaged() + ); + } + ) + .set("ai", function (target) { + return get.attitude(_status.event.player, target); + }) + .set("source", trigger.getParent(2).player); + "step 1"; + if (result.bool && result.targets && result.targets.length) { + player.logSkill("fz_new_longdan", result.targets[0]); result.targets[0].recover(); } }, }, - shamiss:{ - sub:true, - audio:"fz_new_longdan", - trigger:{ - player:"shaMiss", + shamiss: { + sub: true, + audio: "fz_new_longdan", + trigger: { + player: "shaMiss", }, - direct:true, - filter:function(event,player){ - return event.skill=='fz_new_longdan_sha'; + direct: true, + filter: function (event, player) { + return event.skill == "fz_new_longdan_sha"; }, - content:function(){ - "step 0" - player.chooseTarget("是否发动【龙胆】对一名其他角色造成1点伤害?",function(card,player,target){ - return target!=_status.event.target&&target!=player; - }).set('ai',function(target){ - return -get.attitude(_status.event.player,target); - }).set('target',trigger.target); - "step 1" - if(result.bool&&result.targets&&result.targets.length){ - player.logSkill('fz_new_longdan',result.targets[0]); + content: function () { + "step 0"; + player + .chooseTarget( + "是否发动【龙胆】对一名其他角色造成1点伤害?", + function (card, player, target) { + return target != _status.event.target && target != player; + } + ) + .set("ai", function (target) { + return -get.attitude(_status.event.player, target); + }) + .set("target", trigger.target); + "step 1"; + if (result.bool && result.targets && result.targets.length) { + player.logSkill("fz_new_longdan", result.targets[0]); result.targets[0].damage(); } }, }, - draw:{ - trigger:{ - player:["useCard","respond"], + draw: { + trigger: { + player: ["useCard", "respond"], }, - audio:"fz_new_longdan", - forced:true, - locked:false, - filter:function(event,player){ - if(!get.zhu(player,'shouyue')) return false; - return event.skill=='fz_new_longdan_sha'||event.skill=='fz_new_longdan_shan'; + audio: "fz_new_longdan", + forced: true, + locked: false, + filter: function (event, player) { + if (!get.zhu(player, "shouyue")) return false; + return ( + event.skill == "fz_new_longdan_sha" || event.skill == "fz_new_longdan_shan" + ); }, - content:function(){ + content: function () { player.draw(); //player.storage.fanghun2++; }, - sub:true, + sub: true, }, - sha:{ - audio:"fz_new_longdan", - enable:["chooseToUse","chooseToRespond"], - filterCard:{ - name:"shan", + sha: { + audio: "fz_new_longdan", + enable: ["chooseToUse", "chooseToRespond"], + filterCard: { + name: "shan", }, - viewAs:{ - name:"sha", + viewAs: { + name: "sha", }, - viewAsFilter:function(player){ - if(!player.countCards('hs','shan')) return false; + viewAsFilter: function (player) { + if (!player.countCards("hs", "shan")) return false; }, - prompt:"将一张闪当杀使用或打出", - position:'hs', - check:function(){return 1}, - ai:{ - effect:{ - target:function(card,player,target,current){ - if(get.tag(card,'respondSha')&¤t<0) return 0.6 + prompt: "将一张闪当杀使用或打出", + position: "hs", + check: function () { + return 1; + }, + ai: { + effect: { + target: function (card, player, target, current) { + if (get.tag(card, "respondSha") && current < 0) return 0.6; }, }, - respondSha:true, - skillTagFilter:function(player){ - if(!player.countCards('hs','shan')) return false; + respondSha: true, + skillTagFilter: function (player) { + if (!player.countCards("hs", "shan")) return false; }, - order:function(){ - return get.order({name:'sha'})+0.1; + order: function () { + return get.order({ name: "sha" }) + 0.1; }, }, - sub:true, + sub: true, }, - shan:{ - audio:"fz_new_longdan", - enable:['chooseToRespond','chooseToUse'], - filterCard:{ - name:"sha", + shan: { + audio: "fz_new_longdan", + enable: ["chooseToRespond", "chooseToUse"], + filterCard: { + name: "sha", }, - viewAs:{ - name:"shan", + viewAs: { + name: "shan", }, - position:'hs', - prompt:"将一张杀当闪使用或打出", - check:function(){return 1}, - viewAsFilter:function(player){ - if(!player.countCards('hs','sha')) return false; + position: "hs", + prompt: "将一张杀当闪使用或打出", + check: function () { + return 1; }, - ai:{ - respondShan:true, - skillTagFilter:function(player){ - if(!player.countCards('hs','sha')) return false; + viewAsFilter: function (player) { + if (!player.countCards("hs", "sha")) return false; + }, + ai: { + respondShan: true, + skillTagFilter: function (player) { + if (!player.countCards("hs", "sha")) return false; }, - effect:{ - target:function(card,player,target,current){ - if(get.tag(card,'respondShan')&¤t<0) return 0.6 + effect: { + target: function (card, player, target, current) { + if (get.tag(card, "respondShan") && current < 0) return 0.6; }, }, }, - sub:true, + sub: true, }, }, }, - gzenyuan:{ - locked:true, - audio:'reenyuan', - group:['gzenyuan_gain','gzenyuan_damage'], - preHidden:true, - ai:{ - maixie_defend:true, - effect:{ - target:function(card,player,target){ - if(player.hasSkillTag('jueqing',false,target)) return [1,-1.5]; - if(!target.hasFriend()) return; - if(get.tag(card,'damage')) return [1,0,0,-0.7]; - } - } + gzenyuan: { + locked: true, + audio: "reenyuan", + group: ["gzenyuan_gain", "gzenyuan_damage"], + preHidden: true, + ai: { + maixie_defend: true, + effect: { + target: function (card, player, target) { + if (player.hasSkillTag("jueqing", false, target)) return [1, -1.5]; + if (!target.hasFriend()) return; + if (get.tag(card, "damage")) return [1, 0, 0, -0.7]; + }, + }, }, - subSkill:{ - gain:{ - audio:'reenyuan', - trigger:{target:'useCardToTargeted'}, - forced:true, - filter:function(event,player){ - return event.card.name=='tao'&&event.player!=player; + subSkill: { + gain: { + audio: "reenyuan", + trigger: { target: "useCardToTargeted" }, + forced: true, + filter: function (event, player) { + return event.card.name == "tao" && event.player != player; }, - logTarget:'player', - content:function(){trigger.player.draw()}, - }, - damage:{ - audio:'reenyuan', - trigger:{player:'damageEnd'}, - forced:true, - filter:function(event,player){ - return event.source&&event.source!=player&&event.num>0; - }, - content:function(){ - 'step 0' - player.logSkill('enyuan_damage',trigger.source); - trigger.source.chooseCard('交给'+get.translation(player)+'一张手牌,或失去1点体力','h').set('ai',function(card){ - if(get.attitude(_status.event.player,_status.event.getParent().player)>0) return 11-get.value(card); - return 7-get.value(card); - }); - 'step 1' - if(result.bool){ - trigger.source.give(result.cards[0],player,'giveAuto'); - } - else trigger.source.loseHp(); + logTarget: "player", + content: function () { + trigger.player.draw(); }, }, - } + damage: { + audio: "reenyuan", + trigger: { player: "damageEnd" }, + forced: true, + filter: function (event, player) { + return event.source && event.source != player && event.num > 0; + }, + content: function () { + "step 0"; + player.logSkill("enyuan_damage", trigger.source); + trigger.source + .chooseCard("交给" + get.translation(player) + "一张手牌,或失去1点体力", "h") + .set("ai", function (card) { + if ( + get.attitude(_status.event.player, _status.event.getParent().player) > + 0 + ) + return 11 - get.value(card); + return 7 - get.value(card); + }); + "step 1"; + if (result.bool) { + trigger.source.give(result.cards[0], player, "giveAuto"); + } else trigger.source.loseHp(); + }, + }, + }, }, - gzjushou:{ - audio:"xinjushou", - trigger:{ - player:"phaseJieshuBegin", + gzjushou: { + audio: "xinjushou", + trigger: { + player: "phaseJieshuBegin", }, - preHidden:true, - content:function(){ - 'step 0' - var list=[],players=game.filterPlayer(); - for(var target of players){ - if(target.isUnseen()) continue; - var add=true; - for(var i of list){ - if(i.isFriendOf(target)){ - add=false; + preHidden: true, + content: function () { + "step 0"; + var list = [], + players = game.filterPlayer(); + for (var target of players) { + if (target.isUnseen()) continue; + var add = true; + for (var i of list) { + if (i.isFriendOf(target)) { + add = false; break; } } - if(add) list.add(target); + if (add) list.add(target); } - event.num=list.length; + event.num = list.length; player.draw(event.num); - if(event.num>2) player.turnOver(); - 'step 1' - player.chooseCard('h',true,'弃置一张手牌,若以此法弃置的是装备牌,则你改为使用之').set('ai',function(card){ - if(get.type(card)=='equip'){ - return 5-get.value(card); - } - return -get.value(card); - }).set('filterCard',lib.filter.cardDiscardable); - 'step 2' - if(result.bool&&result.cards.length){ - if(get.type(result.cards[0])=='equip'&&player.hasUseTarget(result.cards[0])){ - player.chooseUseTarget(result.cards[0],true,'nopopup'); - } - else{ + if (event.num > 2) player.turnOver(); + "step 1"; + player + .chooseCard("h", true, "弃置一张手牌,若以此法弃置的是装备牌,则你改为使用之") + .set("ai", function (card) { + if (get.type(card) == "equip") { + return 5 - get.value(card); + } + return -get.value(card); + }) + .set("filterCard", lib.filter.cardDiscardable); + "step 2"; + if (result.bool && result.cards.length) { + if (get.type(result.cards[0]) == "equip" && player.hasUseTarget(result.cards[0])) { + player.chooseUseTarget(result.cards[0], true, "nopopup"); + } else { player.discard(result.cards[0]); } } }, - ai:{ - effect:{ - target:function(card,player,target){ - if(card.name=='guiyoujie') return [0,1]; + ai: { + effect: { + target: function (card, player, target) { + if (card.name == "guiyoujie") return [0, 1]; }, }, }, }, - "new_duanliang":{ - subSkill:{ - off:{ - sub:true, + new_duanliang: { + subSkill: { + off: { + sub: true, }, }, - mod:{ - targetInRange:function(card,player,target){ - if(card.name=='bingliang'){ + mod: { + targetInRange: function (card, player, target) { + if (card.name == "bingliang") { return true; } }, }, - locked:false, - audio:"duanliang1", - enable:"chooseToUse", - filterCard:function(card){ - if(get.type(card)!='basic'&&get.type(card)!='equip') return false; - return get.color(card)=='black'; + locked: false, + audio: "duanliang1", + enable: "chooseToUse", + filterCard: function (card) { + if (get.type(card) != "basic" && get.type(card) != "equip") return false; + return get.color(card) == "black"; }, - filter:function(event,player){ - if(player.hasSkill('new_duanliang_off')) return false; - return player.countCards('hes',{type:['basic','equip'],color:'black'}) + filter: function (event, player) { + if (player.hasSkill("new_duanliang_off")) return false; + return player.countCards("hes", { type: ["basic", "equip"], color: "black" }); }, - position:"hes", - viewAs:{ - name:"bingliang", + position: "hes", + viewAs: { + name: "bingliang", }, - onuse:function(result,player){ - if(get.distance(player,result.targets[0])>2) player.addTempSkill('new_duanliang_off'); + onuse: function (result, player) { + if (get.distance(player, result.targets[0]) > 2) player.addTempSkill("new_duanliang_off"); }, - prompt:"将一黑色的基本牌或装备牌当兵粮寸断使用", - check:function(card){return 6-get.value(card)}, - ai:{ - order:9, - basic:{ - order:1, - useful:1, - value:4, + prompt: "将一黑色的基本牌或装备牌当兵粮寸断使用", + check: function (card) { + return 6 - get.value(card); + }, + ai: { + order: 9, + basic: { + order: 1, + useful: 1, + value: 4, }, - result:{ - target:function(player,target){ - if(target.hasJudge('caomu')) return 0; - return -1.5/Math.sqrt(target.countCards('h')+1); + result: { + target: function (player, target) { + if (target.hasJudge("caomu")) return 0; + return -1.5 / Math.sqrt(target.countCards("h") + 1); }, }, - tag:{ - skip:"phaseDraw", + tag: { + skip: "phaseDraw", }, }, }, - new_shushen:{ - audio:"shushen", - trigger:{ - player:"recoverAfter", + new_shushen: { + audio: "shushen", + trigger: { + player: "recoverAfter", }, - direct:true, - preHidden:true, - content:function(){ - 'step 0' - event.num=trigger.num||1; - "step 1" - player.chooseTarget(get.prompt2('new_shushen'),function(card,player,target){ - return target!=player; - }).set('ai',function(target){ - return get.attitude(_status.event.player,target); - }).setHiddenSkill('new_shushen'); - "step 2" - if(result.bool){ - player.logSkill('new_shushen',result.targets); + direct: true, + preHidden: true, + content: function () { + "step 0"; + event.num = trigger.num || 1; + "step 1"; + player + .chooseTarget(get.prompt2("new_shushen"), function (card, player, target) { + return target != player; + }) + .set("ai", function (target) { + return get.attitude(_status.event.player, target); + }) + .setHiddenSkill("new_shushen"); + "step 2"; + if (result.bool) { + player.logSkill("new_shushen", result.targets); result.targets[0].draw(); - if(event.num>1){ + if (event.num > 1) { event.num--; event.goto(1); } } }, - ai:{ - threaten:0.8, - expose:0.1, + ai: { + threaten: 0.8, + expose: 0.1, }, }, - "new_luanji":{ - audio:"luanji", - enable:"phaseUse", - viewAs:{ - name:"wanjian", + new_luanji: { + audio: "luanji", + enable: "phaseUse", + viewAs: { + name: "wanjian", }, - filterCard:function(card,player){ - if(!player.storage.new_luanji) return true; + filterCard: function (card, player) { + if (!player.storage.new_luanji) return true; return !player.storage.new_luanji.includes(get.suit(card)); }, - selectCard:2, - position:'hs', - filter:function(event,player){ - return player.countCards('hs',function(card){ - return !player.storage.new_luanji||!player.storage.new_luanji.includes(get.suit(card)); - })>1; + selectCard: 2, + position: "hs", + filter: function (event, player) { + return ( + player.countCards("hs", function (card) { + return ( + !player.storage.new_luanji || + !player.storage.new_luanji.includes(get.suit(card)) + ); + }) > 1 + ); }, - check:function(card){ - var player=_status.event.player; - var targets=game.filterPlayer(function(current){ - return player.canUse('wanjian',current); + check: function (card) { + var player = _status.event.player; + var targets = game.filterPlayer(function (current) { + return player.canUse("wanjian", current); }); - var num=0; - for(var i=0;i=7){ - if(num<2) return 0; - } - else if(targets.length>=5){ - if(num<1.5) return 0; + if (!player.needsToDiscard(-1)) { + if (targets.length >= 7) { + if (num < 2) return 0; + } else if (targets.length >= 5) { + if (num < 1.5) return 0; } } - return 6-get.value(card); + return 6 - get.value(card); }, - group:["new_luanji_count","new_luanji_reset","new_luanji_respond"], - subSkill:{ - reset:{ - trigger:{ - player:"phaseAfter", + group: ["new_luanji_count", "new_luanji_reset", "new_luanji_respond"], + subSkill: { + reset: { + trigger: { + player: "phaseAfter", }, - silent:true, - filter:function(event,player){ - return player.storage.new_luanji?true:false; + silent: true, + filter: function (event, player) { + return player.storage.new_luanji ? true : false; }, - content:function(){ + content: function () { delete player.storage.new_luanji; }, - sub:true, - forced:true, - popup:false, + sub: true, + forced: true, + popup: false, }, - count:{ - trigger:{ - player:"useCard", + count: { + trigger: { + player: "useCard", }, - silent:true, - filter:function(event){ - return event.skill=='new_luanji'; + silent: true, + filter: function (event) { + return event.skill == "new_luanji"; }, - content:function(){ - if(!player.storage.new_luanji){ - player.storage.new_luanji=[]; + content: function () { + if (!player.storage.new_luanji) { + player.storage.new_luanji = []; } - for(var i=0;i=0) return 0; - if(player.hasCard(function(card){ - return get.tag(card,'damage')&&player.canUse(card,target,true,true); - })){ - if(target.maxHp>3) return -0.5; + ai: { + order: 8, + result: { + target: function (player, target) { + if (target.hp <= 0) return -5; + if (player.getStat().skill.new_qingcheng) return 0; + if (!target.hasSkillTag("maixie")) return 0; + if (get.attitude(player, target) >= 0) return 0; + if ( + player.hasCard(function (card) { + return get.tag(card, "damage") && player.canUse(card, target, true, true); + }) + ) { + if (target.maxHp > 3) return -0.5; return -1; } return 0; @@ -13031,4061 +17100,4724 @@ return event.junling=='junling5'?1:0;}); }, }, }, - new_kongcheng:{ - group:["new_kongcheng_gain","new_kongcheng_got"], - subSkill:{ - gain:{ - audio:"kongcheng", - trigger:{ - player:"gainBefore", + new_kongcheng: { + group: ["new_kongcheng_gain", "new_kongcheng_got"], + subSkill: { + gain: { + audio: "kongcheng", + trigger: { + player: "gainBefore", }, - filter:function(event,player){ - return event.source&&event.source!=player&&player!=_status.currentPhase&&!event.bySelf&&player.countCards('h')==0; + filter: function (event, player) { + return ( + event.source && + event.source != player && + player != _status.currentPhase && + !event.bySelf && + player.countCards("h") == 0 + ); }, - content:function(){ - trigger.name='addToExpansion'; - trigger.setContent('addToExpansion'); - trigger.gaintag=['new_kongcheng']; + content: function () { + trigger.name = "addToExpansion"; + trigger.setContent("addToExpansion"); + trigger.gaintag = ["new_kongcheng"]; trigger.untrigger(); - trigger.trigger('addToExpansionBefore'); + trigger.trigger("addToExpansionBefore"); }, - sub:true, - forced:true, + sub: true, + forced: true, }, - got:{ - trigger:{ - player:"phaseDrawBegin1", + got: { + trigger: { + player: "phaseDrawBegin1", }, - filter:function(event,player){ - return player.getExpansions('new_kongcheng').length>0; + filter: function (event, player) { + return player.getExpansions("new_kongcheng").length > 0; }, - content:function(){ - player.gain(player.getExpansions('new_kongcheng'),'draw'); + content: function () { + player.gain(player.getExpansions("new_kongcheng"), "draw"); }, - sub:true, - forced:true, + sub: true, + forced: true, }, }, - audio:"kongcheng", - trigger:{ - target:"useCardToTarget", + audio: "kongcheng", + trigger: { + target: "useCardToTarget", }, - forced:true, - check:function(event,player){ - return get.effect(event.target,event.card,event.player,player)<0; + forced: true, + check: function (event, player) { + return get.effect(event.target, event.card, event.player, player) < 0; }, - filter:function(event,player){ - return player.countCards('h')==0&&(event.card.name=='sha'||event.card.name=='juedou'); + filter: function (event, player) { + return ( + player.countCards("h") == 0 && + (event.card.name == "sha" || event.card.name == "juedou") + ); }, - content:function(){ + content: function () { trigger.getParent().targets.remove(player); }, - ai:{ - effect:{ - target:function(card,player,target,current){ - if(target.countCards('h')==0&&(card.name=='sha'||card.name=='juedou')) return 'zeroplayertarget'; + ai: { + effect: { + target: function (card, player, target, current) { + if (target.countCards("h") == 0 && (card.name == "sha" || card.name == "juedou")) + return "zeroplayertarget"; }, }, }, - intro:{ - markcount:'expansion', - mark:function(dialog,content,player){ - var content=player.getExpansions('new_kongcheng'); - if(content&&content.length){ - if(player==game.me||player.isUnderControl()){ + intro: { + markcount: "expansion", + mark: function (dialog, content, player) { + var content = player.getExpansions("new_kongcheng"); + if (content && content.length) { + if (player == game.me || player.isUnderControl()) { dialog.addAuto(content); - } - else{ - return '共有'+get.cnNumber(content.length)+'张牌'; + } else { + return "共有" + get.cnNumber(content.length) + "张牌"; } } }, - content:function(content,player){ - var content=player.getExpansions('new_kongcheng'); - if(content&&content.length){ - if(player==game.me||player.isUnderControl()){ + content: function (content, player) { + var content = player.getExpansions("new_kongcheng"); + if (content && content.length) { + if (player == game.me || player.isUnderControl()) { return get.translation(content); } - return '共有'+get.cnNumber(content.length)+'张牌'; + return "共有" + get.cnNumber(content.length) + "张牌"; } }, }, - onremove:function(player,skill){ - var cards=player.getExpansions(skill); - if(cards.length) player.loseToDiscardpile(cards); + onremove: function (player, skill) { + var cards = player.getExpansions(skill); + if (cards.length) player.loseToDiscardpile(cards); }, }, - "new_keji":{ - audio:"keji", - forced:true, - trigger:{ - player:"phaseDiscardBegin", + new_keji: { + audio: "keji", + forced: true, + trigger: { + player: "phaseDiscardBegin", }, - filter:function(event,player){ - var list=[]; - player.getHistory('useCard',function(evt){ - if(evt.isPhaseUsing(player)){ - var color=get.color(evt.card); - if(color!='nocolor') list.add(color); + filter: function (event, player) { + var list = []; + player.getHistory("useCard", function (evt) { + if (evt.isPhaseUsing(player)) { + var color = get.color(evt.card); + if (color != "nocolor") list.add(color); } }); - return list.length<=1; + return list.length <= 1; }, - check:function(event,player){ + check: function (event, player) { return player.needsToDiscard(); }, - content:function(){ - player.addTempSkill('keji_add','phaseAfter'); + content: function () { + player.addTempSkill("keji_add", "phaseAfter"); }, }, - "keji_add":{ - charlotte:true, - mod:{ - maxHandcard:function(player,num){ - return num+4; + keji_add: { + charlotte: true, + mod: { + maxHandcard: function (player, num) { + return num + 4; }, }, }, - "new_mouduan":{ - trigger:{ - player:"phaseJieshuBegin", + new_mouduan: { + trigger: { + player: "phaseJieshuBegin", }, //priority:2, - audio:"botu", - filter:function(event,player){ - var history=player.getHistory('useCard'); - var suits=[]; - var types=[]; - for(var i=0;i=4||types.length>=3; + return suits.length >= 4 || types.length >= 3; }, - check:function(event,player){ + check: function (event, player) { return player.canMoveCard(true); }, - content:function(){ + content: function () { player.moveCard(); }, }, - "new_longdan":{ - group:["new_longdan_sha","new_longdan_shan","new_longdan_draw","new_longdan_shamiss","new_longdan_shanafter"], - subSkill:{ - shanafter:{ - sub:true, - audio:"longdan_sha", - trigger:{ - player:"useCard", + new_longdan: { + group: [ + "new_longdan_sha", + "new_longdan_shan", + "new_longdan_draw", + "new_longdan_shamiss", + "new_longdan_shanafter", + ], + subSkill: { + shanafter: { + sub: true, + audio: "longdan_sha", + trigger: { + player: "useCard", }, //priority:1, - filter:function(event,player){ - return event.skill=='new_longdan_shan'&&event.getParent(2).name=='sha'; + filter: function (event, player) { + return event.skill == "new_longdan_shan" && event.getParent(2).name == "sha"; }, - direct:true, - content:function(){ - "step 0" - player.chooseTarget("是否发动【龙胆】令一名其他角色回复1点体力?",function(card,player,target){ - return target!=_status.event.source&&target!=player&&target.isDamaged(); - }).set('ai',function(target){ - return get.attitude(_status.event.player,target); - }).set('source',trigger.getParent(2).player); - "step 1" - if(result.bool&&result.targets&&result.targets.length){ - player.logSkill('new_longdan',result.targets[0]); + direct: true, + content: function () { + "step 0"; + player + .chooseTarget( + "是否发动【龙胆】令一名其他角色回复1点体力?", + function (card, player, target) { + return ( + target != _status.event.source && + target != player && + target.isDamaged() + ); + } + ) + .set("ai", function (target) { + return get.attitude(_status.event.player, target); + }) + .set("source", trigger.getParent(2).player); + "step 1"; + if (result.bool && result.targets && result.targets.length) { + player.logSkill("new_longdan", result.targets[0]); result.targets[0].recover(); } }, }, - shamiss:{ - sub:true, - audio:"longdan_sha", - trigger:{ - player:"shaMiss", + shamiss: { + sub: true, + audio: "longdan_sha", + trigger: { + player: "shaMiss", }, - direct:true, - filter:function(event,player){ - return event.skill=='new_longdan_sha'; + direct: true, + filter: function (event, player) { + return event.skill == "new_longdan_sha"; }, - content:function(){ - "step 0" - player.chooseTarget("是否发动【龙胆】对一名其他角色造成1点伤害?",function(card,player,target){ - return target!=_status.event.target&&target!=player; - }).set('ai',function(target){ - return -get.attitude(_status.event.player,target); - }).set('target',trigger.target); - "step 1" - if(result.bool&&result.targets&&result.targets.length){ - player.logSkill('new_longdan',result.targets[0]); + content: function () { + "step 0"; + player + .chooseTarget( + "是否发动【龙胆】对一名其他角色造成1点伤害?", + function (card, player, target) { + return target != _status.event.target && target != player; + } + ) + .set("ai", function (target) { + return -get.attitude(_status.event.player, target); + }) + .set("target", trigger.target); + "step 1"; + if (result.bool && result.targets && result.targets.length) { + player.logSkill("new_longdan", result.targets[0]); result.targets[0].damage(); } }, }, - draw:{ - trigger:{ - player:["useCard","respond"], + draw: { + trigger: { + player: ["useCard", "respond"], }, - audio:"longdan_sha", - forced:true, - locked:false, - filter:function(event,player){ - if(!get.zhu(player,'shouyue')) return false; - return event.skill=='new_longdan_sha'||event.skill=='new_longdan_shan'; + audio: "longdan_sha", + forced: true, + locked: false, + filter: function (event, player) { + if (!get.zhu(player, "shouyue")) return false; + return event.skill == "new_longdan_sha" || event.skill == "new_longdan_shan"; }, - content:function(){ + content: function () { player.draw(); //player.storage.fanghun2++; }, - sub:true, + sub: true, }, - sha:{ - audio:"longdan_sha", - enable:["chooseToUse","chooseToRespond"], - filterCard:{ - name:"shan", + sha: { + audio: "longdan_sha", + enable: ["chooseToUse", "chooseToRespond"], + filterCard: { + name: "shan", }, - viewAs:{ - name:"sha", + viewAs: { + name: "sha", }, - position:'hs', - viewAsFilter:function(player){ - if(!player.countCards('hs','shan')) return false; + position: "hs", + viewAsFilter: function (player) { + if (!player.countCards("hs", "shan")) return false; }, - prompt:"将一张闪当杀使用或打出", - check:function(){return 1}, - ai:{ - effect:{ - target:function(card,player,target,current){ - if(get.tag(card,'respondSha')&¤t<0) return 0.6 + prompt: "将一张闪当杀使用或打出", + check: function () { + return 1; + }, + ai: { + effect: { + target: function (card, player, target, current) { + if (get.tag(card, "respondSha") && current < 0) return 0.6; }, }, - respondSha:true, - skillTagFilter:function(player){ - if(!player.countCards('hs','shan')) return false; + respondSha: true, + skillTagFilter: function (player) { + if (!player.countCards("hs", "shan")) return false; }, - order:function(){ - return get.order({name:'sha'})+0.1; + order: function () { + return get.order({ name: "sha" }) + 0.1; }, }, - sub:true, + sub: true, }, - shan:{ - audio:"longdan_sha", - enable:['chooseToRespond','chooseToUse'], - filterCard:{ - name:"sha", + shan: { + audio: "longdan_sha", + enable: ["chooseToRespond", "chooseToUse"], + filterCard: { + name: "sha", }, - viewAs:{ - name:"shan", + viewAs: { + name: "shan", }, - position:'hs', - prompt:"将一张杀当闪使用或打出", - check:function(){return 1}, - viewAsFilter:function(player){ - if(!player.countCards('hs','sha')) return false; + position: "hs", + prompt: "将一张杀当闪使用或打出", + check: function () { + return 1; }, - ai:{ - respondShan:true, - skillTagFilter:function(player){ - if(!player.countCards('hs','sha')) return false; + viewAsFilter: function (player) { + if (!player.countCards("hs", "sha")) return false; + }, + ai: { + respondShan: true, + skillTagFilter: function (player) { + if (!player.countCards("hs", "sha")) return false; }, - effect:{ - target:function(card,player,target,current){ - if(get.tag(card,'respondShan')&¤t<0) return 0.6 + effect: { + target: function (card, player, target, current) { + if (get.tag(card, "respondShan") && current < 0) return 0.6; }, }, }, - sub:true, + sub: true, }, }, }, - gzpaoxiao:{ - audio:"paoxiao", - trigger:{ - player:"useCard", + gzpaoxiao: { + audio: "paoxiao", + trigger: { + player: "useCard", }, - filter:function(event,player){ - if(_status.currentPhase!=player) return false; - if(event.card.name!='sha') return false; - var history=player.getHistory('useCard',function(evt){ - return evt.card.name=='sha'; + filter: function (event, player) { + if (_status.currentPhase != player) return false; + if (event.card.name != "sha") return false; + var history = player.getHistory("useCard", function (evt) { + return evt.card.name == "sha"; }); - return history&&history.indexOf(event)==1; + return history && history.indexOf(event) == 1; }, - forced:true, - preHidden:true, - content:function(){ + forced: true, + preHidden: true, + content: function () { player.draw(); }, - mod:{ - cardUsable:function(card,player,num){ - if(card.name=='sha') return Infinity; + mod: { + cardUsable: function (card, player, num) { + if (card.name == "sha") return Infinity; }, }, - ai:{ - unequip:true, - skillTagFilter:function(player,tag,arg){ - if(!get.zhu(player,'shouyue')) return false; - if(arg&&arg.name=='sha') return true; + ai: { + unequip: true, + skillTagFilter: function (player, tag, arg) { + if (!get.zhu(player, "shouyue")) return false; + if (arg && arg.name == "sha") return true; return false; }, }, }, - "new_kurou":{ - audio:"rekurou", - enable:"phaseUse", - usable:1, - filterCard:true, - check:function(card){ - return 8-get.value(card); + new_kurou: { + audio: "rekurou", + enable: "phaseUse", + usable: 1, + filterCard: true, + check: function (card) { + return 8 - get.value(card); }, - position:"he", - content:function(){ + position: "he", + content: function () { player.loseHp(); player.draw(3); - player.addTempSkill('kurou_effect','phaseAfter'); + player.addTempSkill("kurou_effect", "phaseAfter"); }, - ai:{ - order:8, - result:{ - player:function(player){ - if(player.hp<=2) return player.countCards('h')==0?1:0; - if(player.countCards('h',{name:'sha',color:'red'})) return 1; - return player.countCards('h')<=player.hp?1:0; + ai: { + order: 8, + result: { + player: function (player) { + if (player.hp <= 2) return player.countCards("h") == 0 ? 1 : 0; + if (player.countCards("h", { name: "sha", color: "red" })) return 1; + return player.countCards("h") <= player.hp ? 1 : 0; }, }, }, }, - "kurou_effect":{ - mod:{ - cardUsable:function(card,player,num){ - if(card.name=='sha') return num+1; + kurou_effect: { + mod: { + cardUsable: function (card, player, num) { + if (card.name == "sha") return num + 1; }, }, }, - "new_chuli":{ - audio:"chulao", - enable:"phaseUse", - usable:1, - filterTarget:function(card,player,target){ - if(player==target) return false; - for(var i=0;i0; + return target.countCards("he") > 0; }, - filter:function(event,player){ - return player.countCards('he')>0; + filter: function (event, player) { + return player.countCards("he") > 0; }, - filterCard:true, - position:"he", - selectTarget:[1,3], - check:function(card){ - if(get.suit(card)=='spade') return 8-get.value(card); - return 5-get.value(card); + filterCard: true, + position: "he", + selectTarget: [1, 3], + check: function (card) { + if (get.suit(card) == "spade") return 8 - get.value(card); + return 5 - get.value(card); }, - contentBefore:function(){ - var evt=event.getParent(); - evt.draw=[]; - if(get.suit(cards[0])=='spade') evt.draw.push(player); + contentBefore: function () { + var evt = event.getParent(); + evt.draw = []; + if (get.suit(cards[0]) == "spade") evt.draw.push(player); }, - content:function(){ - "step 0" - player.discardPlayerCard(target,'he',true); - "step 1" - if(result.bool){ - if(get.suit(result.cards[0])=='spade') event.getParent().draw.push(target); + content: function () { + "step 0"; + player.discardPlayerCard(target, "he", true); + "step 1"; + if (result.bool) { + if (get.suit(result.cards[0]) == "spade") event.getParent().draw.push(target); } }, - contentAfter:function(){ - 'step 0' - var list=event.getParent().draw; - if(!list.length) event.finish(); + contentAfter: function () { + "step 0"; + var list = event.getParent().draw; + if (!list.length) event.finish(); else game.asyncDraw(list); - 'step 1' + "step 1"; game.delay(); }, - ai:{ - result:{ - target:-1, + ai: { + result: { + target: -1, }, - tag:{ - discard:1, - lose:1, - loseCard:1, + tag: { + discard: 1, + lose: 1, + loseCard: 1, }, - threaten:1.2, - order:3, + threaten: 1.2, + order: 3, }, }, - "baka_hunshang":{ - skillAnimation:true, - animationColor:'wood', - audio:"hunzi", - preHidden:true, - derivation:["baka_yingzi","baka_yinghun"], - viceSkill:true, - init:function(player){ - if(player.checkViceSkill('baka_hunshang')&&!player.viceChanged){ + baka_hunshang: { + skillAnimation: true, + animationColor: "wood", + audio: "hunzi", + preHidden: true, + derivation: ["baka_yingzi", "baka_yinghun"], + viceSkill: true, + init: function (player) { + if (player.checkViceSkill("baka_hunshang") && !player.viceChanged) { player.removeMaxHp(); } }, - trigger:{ - player:"phaseZhunbeiBegin", + trigger: { + player: "phaseZhunbeiBegin", }, - filter:function(event,player){ - return player.hp<=1; + filter: function (event, player) { + return player.hp <= 1; }, - forced:true, - locked:false, + forced: true, + locked: false, //priority:3, - content:function(){ - player.addTempSkills(['baka_yingzi','baka_yinghun']); + content: function () { + player.addTempSkills(["baka_yingzi", "baka_yinghun"]); }, - ai:{ - threaten:function(player,target){ - if(target.hp==1) return 2; + ai: { + threaten: function (player, target) { + if (target.hp == 1) return 2; return 0.5; }, - maixie:true, - effect:{ - target:function(card,player,target){ - if(!target.hasFriend()) return; - if(get.tag(card,'damage')==1&&target.hp==2&&!target.isTurnedOver()&& - _status.currentPhase!=target&&get.distance(_status.currentPhase,target,'absolute')<=3) return [0.5,1]; + maixie: true, + effect: { + target: function (card, player, target) { + if (!target.hasFriend()) return; + if ( + get.tag(card, "damage") == 1 && + target.hp == 2 && + !target.isTurnedOver() && + _status.currentPhase != target && + get.distance(_status.currentPhase, target, "absolute") <= 3 + ) + return [0.5, 1]; }, }, }, }, - baka_yinghun:{ - inherit:"yinghun", - audio:'yinghun_sunce', + baka_yinghun: { + inherit: "yinghun", + audio: "yinghun_sunce", }, - baka_yingzi:{ - mod:{ - maxHandcardBase:function(player,num){ + baka_yingzi: { + mod: { + maxHandcardBase: function (player, num) { return player.maxHp; }, }, - audio:'reyingzi_sunce', - trigger:{ - player:"phaseDrawBegin2", + audio: "reyingzi_sunce", + trigger: { + player: "phaseDrawBegin2", }, - frequent:true, - filter:function(event){return !event.numFixed}, - content:function(){ + frequent: true, + filter: function (event) { + return !event.numFixed; + }, + content: function () { trigger.num++; }, - ai:{ - threaten:1.3, + ai: { + threaten: 1.3, }, }, - gzyiji:{ - audio:"yiji", - trigger:{ - player:"damageEnd", + gzyiji: { + audio: "yiji", + trigger: { + player: "damageEnd", }, - frequent:true, - preHidden:true, - content:function(){ - 'step 0' - event.cards=game.cardsGotoOrdering(get.cards(2)).cards; - 'step 1' - if(_status.connectMode) game.broadcastAll(function(){_status.noclearcountdown=true}); - event.given_map={}; - 'step 2' - if(event.cards.length>1){ - player.chooseCardButton('遗计:请选择要分配的牌',true,event.cards,[1,event.cards.length]).set('ai',function(button){ - if(ui.selected.buttons.length==0) return 1; - return 0; + frequent: true, + preHidden: true, + content: function () { + "step 0"; + event.cards = game.cardsGotoOrdering(get.cards(2)).cards; + "step 1"; + if (_status.connectMode) + game.broadcastAll(function () { + _status.noclearcountdown = true; }); - } - else if(event.cards.length==1){ - event._result={links:event.cards.slice(0),bool:true}; - } - else{ + event.given_map = {}; + "step 2"; + if (event.cards.length > 1) { + player + .chooseCardButton("遗计:请选择要分配的牌", true, event.cards, [ + 1, + event.cards.length, + ]) + .set("ai", function (button) { + if (ui.selected.buttons.length == 0) return 1; + return 0; + }); + } else if (event.cards.length == 1) { + event._result = { links: event.cards.slice(0), bool: true }; + } else { event.finish(); } - 'step 3' - if(result.bool){ + "step 3"; + if (result.bool) { event.cards.removeArray(result.links); - event.togive=result.links.slice(0); - player.chooseTarget('选择一名角色获得'+get.translation(result.links),true).set('ai',function(target){ - var att=get.attitude(_status.event.player,target); - if(_status.event.enemy){ - return -att; - } - else if(att>0){ - return att/(1+target.countCards('h')); - } - else{ - return att/100; - } - }).set('enemy',get.value(event.togive[0],player,'raw')<0); + event.togive = result.links.slice(0); + player + .chooseTarget("选择一名角色获得" + get.translation(result.links), true) + .set("ai", function (target) { + var att = get.attitude(_status.event.player, target); + if (_status.event.enemy) { + return -att; + } else if (att > 0) { + return att / (1 + target.countCards("h")); + } else { + return att / 100; + } + }) + .set("enemy", get.value(event.togive[0], player, "raw") < 0); } - 'step 4' - if(result.targets.length){ - var id=result.targets[0].playerid,map=event.given_map; - if(!map[id]) map[id]=[]; + "step 4"; + if (result.targets.length) { + var id = result.targets[0].playerid, + map = event.given_map; + if (!map[id]) map[id] = []; map[id].addArray(event.togive); } - if(cards.length>0) event.goto(2); - 'step 5' - if(_status.connectMode){ - game.broadcastAll(function(){delete _status.noclearcountdown;game.stopCountChoose()}); + if (cards.length > 0) event.goto(2); + "step 5"; + if (_status.connectMode) { + game.broadcastAll(function () { + delete _status.noclearcountdown; + game.stopCountChoose(); + }); } - var list=[]; - for(var i in event.given_map){ - var source=(_status.connectMode?lib.playerOL:game.playerMap)[i]; - player.line(source,'green'); - list.push([source,event.given_map[i]]); + var list = []; + for (var i in event.given_map) { + var source = (_status.connectMode ? lib.playerOL : game.playerMap)[i]; + player.line(source, "green"); + list.push([source, event.given_map[i]]); } game.loseAsync({ - gain_list:list, - giver:player, - animate:'draw', - }).setContent('gaincardMultiple'); + gain_list: list, + giver: player, + animate: "draw", + }).setContent("gaincardMultiple"); }, - ai:{ - maixie:true, - "maixie_hp":true, - effect:{ - target:function(card,player,target){ - if(get.tag(card,'damage')){ - if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; - if(!target.hasFriend()) return; - var num=1; - if(get.attitude(player,target)>0){ - if(player.needsToDiscard()){ - num=0.7; - } - else{ - num=0.5; + ai: { + maixie: true, + maixie_hp: true, + effect: { + target: function (card, player, target) { + if (get.tag(card, "damage")) { + if (player.hasSkillTag("jueqing", false, target)) return [1, -2]; + if (!target.hasFriend()) return; + var num = 1; + if (get.attitude(player, target) > 0) { + if (player.needsToDiscard()) { + num = 0.7; + } else { + num = 0.5; } } - if(target.hp>=4) return [1,num*2]; - if(target.hp==3) return [1,num*1.5]; - if(target.hp==2) return [1,num*0.5]; + if (target.hp >= 4) return [1, num * 2]; + if (target.hp == 3) return [1, num * 1.5]; + if (target.hp == 2) return [1, num * 0.5]; } }, }, }, }, - gzjieming:{ - audio:"jieming", - trigger:{ - player:"damageEnd", + gzjieming: { + audio: "jieming", + trigger: { + player: "damageEnd", }, - direct:true, - preHidden:true, - content:function(){ - "step 0" - player.chooseTarget(get.prompt('gzjieming'),'令一名角色将手牌补至X张(X为其体力上限且至多为5)',function(card,player,target){ - return true;//target.countCards('h')2){ - return Math.max(0,Math.min(5,target.maxHp)-target.countCards('h')); - } - return att/3; - }).setHiddenSkill('gzjieming'); - "step 1" - if(result.bool){ - player.logSkill('gzjieming',result.targets); - for(var i=0;i0) result.targets[i].draw(num); + direct: true, + preHidden: true, + content: function () { + "step 0"; + player + .chooseTarget( + get.prompt("gzjieming"), + "令一名角色将手牌补至X张(X为其体力上限且至多为5)", + function (card, player, target) { + return true; //target.countCards('h') 2) { + return Math.max(0, Math.min(5, target.maxHp) - target.countCards("h")); + } + return att / 3; + }) + .setHiddenSkill("gzjieming"); + "step 1"; + if (result.bool) { + player.logSkill("gzjieming", result.targets); + for (var i = 0; i < result.targets.length; i++) { + var num = + Math.min(5, result.targets[i].maxHp) - result.targets[i].countCards("h"); + if (num > 0) result.targets[i].draw(num); } } }, - ai:{ - maixie:true, - "maixie_hp":true, - effect:{ - target:function(card,player,target,current){ - if(get.tag(card,'damage')&&target.hp>1){ - if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; - var max=0; - var players=game.filterPlayer(); - for(var i=0;i0){ - max=Math.max(Math.min(5,players[i].hp)-players[i].countCards('h'),max); + ai: { + maixie: true, + maixie_hp: true, + effect: { + target: function (card, player, target, current) { + if (get.tag(card, "damage") && target.hp > 1) { + if (player.hasSkillTag("jueqing", false, target)) return [1, -2]; + var max = 0; + var players = game.filterPlayer(); + for (var i = 0; i < players.length; i++) { + if (get.attitude(target, players[i]) > 0) { + max = Math.max( + Math.min(5, players[i].hp) - players[i].countCards("h"), + max + ); } } - switch(max){ - case 0:return 2; - case 1:return 1.5; - case 2:return [1,2]; - default:return [0,max]; + switch (max) { + case 0: + return 2; + case 1: + return 1.5; + case 2: + return [1, 2]; + default: + return [0, max]; } } - if((card.name=='tao'||card.name=='caoyao')&& - target.hp>1&&target.countCards('h')<=target.hp) return [0,0]; + if ( + (card.name == "tao" || card.name == "caoyao") && + target.hp > 1 && + target.countCards("h") <= target.hp + ) + return [0, 0]; }, }, }, }, - gzfangzhu:{ - audio:"fangzhu", - trigger:{ - player:"damageEnd", + gzfangzhu: { + audio: "fangzhu", + trigger: { + player: "damageEnd", }, - direct:true, - preHidden:true, - content:function(){ - "step 0" - player.chooseTarget(get.prompt2('gzfangzhu'),function(card,player,target){ - return player!=target; - }).setHiddenSkill('gzfangzhu').ai=function(target){ - if(target.hasSkillTag('noturn')) return 0; - var player=_status.event.player,att=get.attitude(player,target); - if(att==0) return 0; - if(att>0){ - if(target.isTurnedOver()) return 1000-target.countCards('h'); + direct: true, + preHidden: true, + content: function () { + "step 0"; + player + .chooseTarget(get.prompt2("gzfangzhu"), function (card, player, target) { + return player != target; + }) + .setHiddenSkill("gzfangzhu").ai = function (target) { + if (target.hasSkillTag("noturn")) return 0; + var player = _status.event.player, + att = get.attitude(player, target); + if (att == 0) return 0; + if (att > 0) { + if (target.isTurnedOver()) return 1000 - target.countCards("h"); return -1; + } else { + if (target.isTurnedOver()) return -1; + if (player.getDamagedHp() >= 3) return -1; + return target.countCards("h") + 1; } - else{ - if(target.isTurnedOver()) return -1; - if(player.getDamagedHp()>=3) return -1; - return target.countCards('h')+1; - } - } - "step 1" - if(result.bool){ - var target=result.targets[0]; - event.target=target; - player.logSkill('gzfangzhu',target); - var num=player.getDamagedHp(); - if(num>0) target.chooseToDiscard('he',num,'放逐:弃置'+get.cnNumber(num)+'张牌并失去1点体力','或者点击“取消”不弃牌,改为摸'+get.cnNumber(num)+'张牌并叠置').set('ai',function(card){ - var player=_status.event.player; - if(player.isTurnedOver()) return -1; - return (player.hp*player.hp)-Math.max(1,get.value(card)); - }); - else{ + }; + "step 1"; + if (result.bool) { + var target = result.targets[0]; + event.target = target; + player.logSkill("gzfangzhu", target); + var num = player.getDamagedHp(); + if (num > 0) + target + .chooseToDiscard( + "he", + num, + "放逐:弃置" + get.cnNumber(num) + "张牌并失去1点体力", + "或者点击“取消”不弃牌,改为摸" + get.cnNumber(num) + "张牌并叠置" + ) + .set("ai", function (card) { + var player = _status.event.player; + if (player.isTurnedOver()) return -1; + return player.hp * player.hp - Math.max(1, get.value(card)); + }); + else { target.turnOver(); event.finish(); } - } - else event.finish(); - "step 2" - if(result.bool){ + } else event.finish(); + "step 2"; + if (result.bool) { target.loseHp(); - } - else{ + } else { target.draw(player.getDamagedHp()); target.turnOver(); } }, - ai:{ - maixie:true, - "maixie_hp":true, - effect:{ - target:function(card,player,target){ - if(get.tag(card,'damage')){ - if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; - if(target.hp<=1) return; - if(!target.hasFriend()) return; - var hastarget=false; - var turnfriend=false; - var players=game.filterPlayer(); - for(var i=0;i0&&players[i].isTurnedOver()){ - hastarget=true; - turnfriend=true; + if (get.attitude(target, players[i]) > 0 && players[i].isTurnedOver()) { + hastarget = true; + turnfriend = true; } } - if(get.attitude(player,target)>0&&!hastarget) return; - if(turnfriend||target.hp==target.maxHp) return [0.5,1]; - if(target.hp>1) return [1,0.5]; + if (get.attitude(player, target) > 0 && !hastarget) return; + if (turnfriend || target.hp == target.maxHp) return [0.5, 1]; + if (target.hp > 1) return [1, 0.5]; } }, }, }, }, - fengyin_main:{ - init:function(player,skill){ + fengyin_main: { + init: function (player, skill) { player.addSkillBlocker(skill); }, - onremove:function(player,skill){ + onremove: function (player, skill) { player.removeSkillBlocker(skill); }, - charlotte:true, - skillBlocker:function(skill,player){ - return lib.character[player.name1][3].includes(skill)&&!lib.skill[skill].charlotte&&!get.is.locked(skill,player); + charlotte: true, + skillBlocker: function (skill, player) { + return ( + lib.character[player.name1][3].includes(skill) && + !lib.skill[skill].charlotte && + !get.is.locked(skill, player) + ); }, - mark:true, - marktext:'主', - intro:{ - content:function(storage,player,skill){ - var list=player.getSkills(null,null,false).filter(function(i){ - return lib.skill.fengyin_main.skillBlocker(i,player); + mark: true, + marktext: "主", + intro: { + content: function (storage, player, skill) { + var list = player.getSkills(null, null, false).filter(function (i) { + return lib.skill.fengyin_main.skillBlocker(i, player); }); - if(list.length) return '失效技能:'+get.translation(list); - return '无失效技能'; - } - } + if (list.length) return "失效技能:" + get.translation(list); + return "无失效技能"; + }, + }, }, - fengyin_vice:{ - init:function(player,skill){ + fengyin_vice: { + init: function (player, skill) { player.addSkillBlocker(skill); }, - onremove:function(player,skill){ + onremove: function (player, skill) { player.removeSkillBlocker(skill); }, - charlotte:true, - skillBlocker:function(skill,player){ - return lib.character[player.name2][3].includes(skill)&&!lib.skill[skill].charlotte&&!get.is.locked(skill,player); + charlotte: true, + skillBlocker: function (skill, player) { + return ( + lib.character[player.name2][3].includes(skill) && + !lib.skill[skill].charlotte && + !get.is.locked(skill, player) + ); }, - mark:true, - marktext:'副', - intro:{ - content:function(storage,player,skill){ - var list=player.getSkills(null,null,false).filter(function(i){ - return lib.skill.fengyin_vice.skillBlocker(i,player); + mark: true, + marktext: "副", + intro: { + content: function (storage, player, skill) { + var list = player.getSkills(null, null, false).filter(function (i) { + return lib.skill.fengyin_vice.skillBlocker(i, player); }); - if(list.length) return '失效技能:'+get.translation(list); - return '无失效技能'; - } - } + if (list.length) return "失效技能:" + get.translation(list); + return "无失效技能"; + }, + }, }, - "new_tieji":{ - audio:"retieji", - trigger:{ - player:"useCardToPlayered", + new_tieji: { + audio: "retieji", + trigger: { + player: "useCardToPlayered", }, - check:function(event,player){ - return get.attitude(player,event.target)<0; + check: function (event, player) { + return get.attitude(player, event.target) < 0; }, - filter:function(event){ - return event.card.name=='sha'; + filter: function (event) { + return event.card.name == "sha"; }, - logTarget:"target", - content:function(){ - "step 0" - var target=trigger.target; - var controls=[]; - if(get.zhu(player,'shouyue')){ - if(!target.isUnseen(0)) target.addTempSkill('fengyin_main'); - if(!target.isUnseen(1)) target.addTempSkill('fengyin_vice'); + logTarget: "target", + content: function () { + "step 0"; + var target = trigger.target; + var controls = []; + if (get.zhu(player, "shouyue")) { + if (!target.isUnseen(0)) target.addTempSkill("fengyin_main"); + if (!target.isUnseen(1)) target.addTempSkill("fengyin_vice"); event.goto(2); } - if(!target.isUnseen(0)&&!target.hasSkill('fengyin_main')) controls.push("主将"); - if(!target.isUnseen(1)&&!target.hasSkill('fengyin_vice')) controls.push("副将"); - if(controls.length>0){ - if(controls.length==1) event._result={control:controls[0]}; - else{ - player.chooseControl(controls).set('ai',function(){ - var choice='主将'; - var skills=lib.character[target.name2][3]; - for(var i=0;i 0) { + if (controls.length == 1) event._result = { control: controls[0] }; + else { + player + .chooseControl(controls) + .set("ai", function () { + var choice = "主将"; + var skills = lib.character[target.name2][3]; + for (var i = 0; i < skills.length; i++) { + var info = get.info(skills[i]); + if (info && info.ai && info.ai.maixie) { + choice = "副将"; + break; + } + } + return choice; + }) + .set( + "prompt", + "请选择一个武将牌,令" + + get.translation(target) + + "该武将牌上的非锁定技全部失效。" + ); + } + } else event.goto(2); + "step 1"; + if (result.control) { + player.popup(result.control, "fire"); + var target = trigger.target; + if (result.control == "主将") target.addTempSkill("fengyin_main"); else target.addTempSkill("fengyin_vice"); } - "step 2" - player.judge(function(){return 0}); - "step 3" - var suit=get.suit(result.card); - var target=trigger.target; - var num=target.countCards('h','shan'); - target.chooseToDiscard('请弃置一张'+get.translation(suit)+'牌,否则不能使用闪抵消此杀','he',function(card){ - return get.suit(card)==_status.event.suit; - }).set('ai',function(card){ - var num=_status.event.num; - if(num==0) return 0; - if(card.name=='shan') return num>1?2:0; - return 8-get.value(card); - }).set('num',num).set('suit',suit); - "step 4" - if(!result.bool){ + "step 2"; + player.judge(function () { + return 0; + }); + "step 3"; + var suit = get.suit(result.card); + var target = trigger.target; + var num = target.countCards("h", "shan"); + target + .chooseToDiscard( + "请弃置一张" + get.translation(suit) + "牌,否则不能使用闪抵消此杀", + "he", + function (card) { + return get.suit(card) == _status.event.suit; + } + ) + .set("ai", function (card) { + var num = _status.event.num; + if (num == 0) return 0; + if (card.name == "shan") return num > 1 ? 2 : 0; + return 8 - get.value(card); + }) + .set("num", num) + .set("suit", suit); + "step 4"; + if (!result.bool) { trigger.getParent().directHit.add(trigger.target); } }, }, - hmkyuanyu:{ - audio:'zongkui', - trigger:{ - player:"damageBegin4", + hmkyuanyu: { + audio: "zongkui", + trigger: { + player: "damageBegin4", }, - forced:true, - preHidden:true, - filter:function(event,player){ - if(event.num<=0||!event.source) return false; - var n1=player.getNext(); - var p1=player.getPrevious(); - if(event.source!=n1&&event.source!=p1) return true; + forced: true, + preHidden: true, + filter: function (event, player) { + if (event.num <= 0 || !event.source) return false; + var n1 = player.getNext(); + var p1 = player.getPrevious(); + if (event.source != n1 && event.source != p1) return true; }, - content:function(){ + content: function () { trigger.cancel(); }, - ai:{ - effect:{ - target:function(card,player,target){ - if(player.hasSkillTag('jueqing',false,target)) return; - if(player==target.getNext()||player==target.getPrevious()) return; - if(get.tag(card,'damage')) return 'zeroplayertarget'; + ai: { + effect: { + target: function (card, player, target) { + if (player.hasSkillTag("jueqing", false, target)) return; + if (player == target.getNext() || player == target.getPrevious()) return; + if (get.tag(card, "damage")) return "zeroplayertarget"; }, }, }, }, - hmkguishu:{ - audio:'bmcanshi', - enable:"phaseUse", - filter:function(event,player){ - return player.countCards('hs',{suit:'spade'})>0; + hmkguishu: { + audio: "bmcanshi", + enable: "phaseUse", + filter: function (event, player) { + return player.countCards("hs", { suit: "spade" }) > 0; }, - init:function(player){ - if(!player.storage.hmkguishu) player.storage.hmkguishu=0; + init: function (player) { + if (!player.storage.hmkguishu) player.storage.hmkguishu = 0; }, - chooseButton:{ - dialog:function(event,player){ - var list=['yuanjiao','zhibi']; - for(var i=0;i2) return 1; + if (button.link == "zhibi") { + if (player.countCards("hs", { suit: "spade" }) > 2) return 1; return 0; } }, - backup:function(links,player){ + backup: function (links, player) { return { - audio:'bmcanshi', - filterCard:function(card,player){ - return get.suit(card)=='spade'; + audio: "bmcanshi", + filterCard: function (card, player) { + return get.suit(card) == "spade"; }, - position:"hs", - selectCard:1, - popname:true, - ai:function(card){ - return 6-ai.get.value(card); + position: "hs", + selectCard: 1, + popname: true, + ai: function (card) { + return 6 - ai.get.value(card); }, - viewAs:{name:links[0][2]}, - onuse:function(result,player){ - player.logSkill('hmkguishu'); - if(result.card.name=='yuanjiao') player.storage.hmkguishu=1; - else player.storage.hmkguishu=2; + viewAs: { name: links[0][2] }, + onuse: function (result, player) { + player.logSkill("hmkguishu"); + if (result.card.name == "yuanjiao") player.storage.hmkguishu = 1; + else player.storage.hmkguishu = 2; }, - } + }; }, - prompt:function(links,player){ - return '将一张手牌当作'+get.translation(links[0][2])+'使用'; + prompt: function (links, player) { + return "将一张手牌当作" + get.translation(links[0][2]) + "使用"; }, }, - ai:{ - order:4, - result:{ - player:function(player){ + ai: { + order: 4, + result: { + player: function (player) { return 2; }, }, - threaten:1.6, + threaten: 1.6, }, }, - "_mingzhisuodingji":{ - mode:["guozhan"], - enable:"phaseUse", - filter:function(event,player){ - if(player.hasSkillTag('nomingzhi',false,null,true)) return false; - var bool=false; - var skillm=lib.character[player.name1][3]; - var skillv=lib.character[player.name2][3]; - if(player.isUnseen(0)){ - for(var i=0;i1; + silent: true, + popup: false, + forced: true, + filter: function () { + if (_status.connectMode && !lib.configOL.viewnext) return false; + else if (!_status.connectMode && !get.config("viewnext")) return false; + return game.players.length > 1; }, - content:function(){ - var target=player.getNext(); - player.viewCharacter(target,1); + content: function () { + var target = player.getNext(); + player.viewCharacter(target, 1); }, }, - _aozhan_judge:{ - trigger:{ - player:"phaseBefore", + _aozhan_judge: { + trigger: { + player: "phaseBefore", }, - forced:true, - priority:22, - filter:function(event,player){ - if(get.mode()!='guozhan') return false; - if(_status.connectMode&&!lib.configOL.aozhan) return false; - else if(!_status.connectMode&&!get.config('aozhan')) return false; - if(_status._aozhan) return false; - if(game.players.length>4) return false; - if(game.players.length>3&&game.players.length+game.dead.length<=7) return false; - for(var i=0;i 4) return false; + if (game.players.length > 3 && game.players.length + game.dead.length <= 7) return false; + for (var i = 0; i < game.players.length; i++) { + for (var j = i + 1; j < game.players.length; j++) { + if (game.players[i].isFriendOf(game.players[j])) return false; } } return true; }, - content:function(){ - var color=get.groupnature(player.group,"raw"); - if(player.isUnseen()) color='fire'; - player.$fullscreenpop('鏖战模式',color); - game.broadcastAll(function(){ - _status._aozhan=true; - ui.aozhan=ui.create.div('.touchinfo.left',ui.window); - ui.aozhan.innerHTML='鏖战模式'; - if(ui.time3) ui.time3.style.display='none'; - ui.aozhanInfo=ui.create.system('鏖战模式',null,true); - lib.setPopped(ui.aozhanInfo,function(){ - var uiintro=ui.create.dialog('hidden'); - uiintro.add('鏖战模式'); - var list=[ - '当游戏中仅剩四名或更少角色时(七人以下游戏时改为三名或更少),若此时全场没有超过一名势力相同的角色,则从一个新的回合开始,游戏进入鏖战模式直至游戏结束。', - '在鏖战模式下,任何角色均不是非转化的【桃】的合法目标。【桃】可以被当做【杀】或【闪】使用或打出。', - '进入鏖战模式后,即使之后有两名或者更多势力相同的角色出现,仍然不会取消鏖战模式。' - ]; - var intro='
      '; - for(var i=0;i'+intro+'
    '); - var ul=uiintro.querySelector('ul'); - if(ul){ - ul.style.width='180px'; - } - uiintro.add(ui.create.div('.placeholder')); - return uiintro; - },250); - game.playBackgroundMusic(); + content: function () { + var color = get.groupnature(player.group, "raw"); + if (player.isUnseen()) color = "fire"; + player.$fullscreenpop("鏖战模式", color); + game.broadcastAll(function () { + _status._aozhan = true; + ui.aozhan = ui.create.div(".touchinfo.left", ui.window); + ui.aozhan.innerHTML = "鏖战模式"; + if (ui.time3) ui.time3.style.display = "none"; + ui.aozhanInfo = ui.create.system("鏖战模式", null, true); + lib.setPopped( + ui.aozhanInfo, + function () { + var uiintro = ui.create.dialog("hidden"); + uiintro.add("鏖战模式"); + var list = [ + "当游戏中仅剩四名或更少角色时(七人以下游戏时改为三名或更少),若此时全场没有超过一名势力相同的角色,则从一个新的回合开始,游戏进入鏖战模式直至游戏结束。", + "在鏖战模式下,任何角色均不是非转化的【桃】的合法目标。【桃】可以被当做【杀】或【闪】使用或打出。", + "进入鏖战模式后,即使之后有两名或者更多势力相同的角色出现,仍然不会取消鏖战模式。", + ]; + var intro = '
      '; + for (var i = 0; i < list.length; i++) { + intro += "
    • " + list[i]; + } + intro += "
    "; + uiintro.add('
    ' + intro + "
    "); + var ul = uiintro.querySelector("ul"); + if (ul) { + ul.style.width = "180px"; + } + uiintro.add(ui.create.div(".placeholder")); + return uiintro; + }, + 250 + ); + game.playBackgroundMusic(); + }); + game.countPlayer(function (current) { + current.addSkill("aozhan"); }); - game.countPlayer(function(current){current.addSkill('aozhan')}); }, }, - _guozhan_marks:{ - ruleSkill:true, - enable:'phaseUse', - filter:function(event,player){ - return player.hasMark('yexinjia_mark')||player.hasMark('xianqu_mark')||player.hasMark('yinyang_mark')||player.hasMark('zhulianbihe_mark'); + _guozhan_marks: { + ruleSkill: true, + enable: "phaseUse", + filter: function (event, player) { + return ( + player.hasMark("yexinjia_mark") || + player.hasMark("xianqu_mark") || + player.hasMark("yinyang_mark") || + player.hasMark("zhulianbihe_mark") + ); }, - chooseButton:{ - dialog:function(event,player){ - return ui.create.dialog('###国战标记###弃置一枚对应的标记,发动其对应的效果'); + chooseButton: { + dialog: function (event, player) { + return ui.create.dialog("###国战标记###弃置一枚对应的标记,发动其对应的效果"); }, - chooseControl:function(event,player){ - var list=[],bool=player.hasMark('yexinjia_mark'); - if(bool||player.hasMark('xianqu_mark')) list.push('先驱'); - if(bool||player.hasMark('zhulianbihe_mark')){ - list.push('珠联(摸牌)'); - if(event.filterCard({name:'tao',isCard:true},player,event)) list.push('珠联(桃)'); + chooseControl: function (event, player) { + var list = [], + bool = player.hasMark("yexinjia_mark"); + if (bool || player.hasMark("xianqu_mark")) list.push("先驱"); + if (bool || player.hasMark("zhulianbihe_mark")) { + list.push("珠联(摸牌)"); + if (event.filterCard({ name: "tao", isCard: true }, player, event)) + list.push("珠联(桃)"); } - if(bool||player.hasMark('yinyang_mark')) list.push('阴阳鱼'); - list.push('cancel2'); + if (bool || player.hasMark("yinyang_mark")) list.push("阴阳鱼"); + list.push("cancel2"); return list; }, - check:function(){ - var player=_status.event.player,bool=player.hasMark('yexinjia_mark'); - if((bool||player.hasMark('xianqu_mark'))&&(4-player.countCards('h'))>1) return '先驱'; - if(bool||player.hasMark('zhulianbihe_mark')){ - if(_status.event.getParent().filterCard({name:'tao',isCard:true},player,event)&&get.effect_use(player,{name:'tao'},player)>0) return '珠联(桃)'; - if(player.getHandcardLimit()-player.countCards('h')>1&&!game.hasPlayer(function(current){ - return current!=player&¤t.isFriendOf(player)&¤t.hp+current.countCards('h','shan')<=2; - })) return '珠联(摸牌)'; + check: function () { + var player = _status.event.player, + bool = player.hasMark("yexinjia_mark"); + if ((bool || player.hasMark("xianqu_mark")) && 4 - player.countCards("h") > 1) + return "先驱"; + if (bool || player.hasMark("zhulianbihe_mark")) { + if ( + _status.event + .getParent() + .filterCard({ name: "tao", isCard: true }, player, event) && + get.effect_use(player, { name: "tao" }, player) > 0 + ) + return "珠联(桃)"; + if ( + player.getHandcardLimit() - player.countCards("h") > 1 && + !game.hasPlayer(function (current) { + return ( + current != player && + current.isFriendOf(player) && + current.hp + current.countCards("h", "shan") <= 2 + ); + }) + ) + return "珠联(摸牌)"; } - if(player.hasMark('yinyang_mark')&&player.getHandcardLimit()-player.countCards('h')>0) return '阴阳鱼'; - return 'cancel2'; + if ( + player.hasMark("yinyang_mark") && + player.getHandcardLimit() - player.countCards("h") > 0 + ) + return "阴阳鱼"; + return "cancel2"; }, - backup:function(result,player){ - switch(result.control){ - 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); - }, - }; - case '阴阳鱼': return { - content:function(){ - player.draw(); - player.removeMark(player.hasMark('yinyang_mark')?'yinyang_mark':'yexinjia_mark',1); - } - }; - case '先驱': return {content:lib.skill.xianqu_mark.content}; + backup: function (result, player) { + switch (result.control) { + 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 + ); + }, + }; + case "阴阳鱼": + return { + content: function () { + player.draw(); + player.removeMark( + player.hasMark("yinyang_mark") ? "yinyang_mark" : "yexinjia_mark", + 1 + ); + }, + }; + case "先驱": + return { content: lib.skill.xianqu_mark.content }; } }, }, - ai:{ - order:1, - result:{ - player:1, + ai: { + order: 1, + result: { + player: 1, }, }, }, - xianqu_mark:{ - intro:{ - content:"◇出牌阶段,你可以弃置此标记,然后将手牌摸至四张并观看一名其他角色的一张武将牌。", + xianqu_mark: { + intro: { + content: + "◇出牌阶段,你可以弃置此标记,然后将手牌摸至四张并观看一名其他角色的一张武将牌。", }, - content:function(){ - "step 0" - player.removeMark(player.hasMark('xianqu_mark')?'xianqu_mark':'yexinjia_mark',1); - var num=4-player.countCards('h'); - if(num) player.draw(num); - "step 1" - if(game.hasPlayer(function(current){ - return current!=player&¤t.isUnseen(2); - })) player.chooseTarget('是否观看一名其他角色的一张暗置武将牌?',function(card,player,target){ - return target!=player&&target.isUnseen(2); - }).set('ai',function(target){ - if(target.isUnseen()){ - var next=_status.event.player.getNext(); - if (target!=next) return 10; - return 9; - } - return -get.attitude(_status.event.player,target); - }); + content: function () { + "step 0"; + player.removeMark(player.hasMark("xianqu_mark") ? "xianqu_mark" : "yexinjia_mark", 1); + var num = 4 - player.countCards("h"); + if (num) player.draw(num); + "step 1"; + if ( + game.hasPlayer(function (current) { + return current != player && current.isUnseen(2); + }) + ) + player + .chooseTarget( + "是否观看一名其他角色的一张暗置武将牌?", + function (card, player, target) { + return target != player && target.isUnseen(2); + } + ) + .set("ai", function (target) { + if (target.isUnseen()) { + var next = _status.event.player.getNext(); + if (target != next) return 10; + return 9; + } + return -get.attitude(_status.event.player, target); + }); else event.finish(); - "step 2" - if(result.bool){ - event.target=result.targets[0]; - player.line(event.target,'green'); - var controls=[]; - if(event.target.isUnseen(0)) controls.push('主将'); - if(event.target.isUnseen(1)) controls.push('副将'); - if(controls.length>1){ + "step 2"; + if (result.bool) { + event.target = result.targets[0]; + player.line(event.target, "green"); + var controls = []; + if (event.target.isUnseen(0)) controls.push("主将"); + if (event.target.isUnseen(1)) controls.push("副将"); + if (controls.length > 1) { player.chooseControl(controls); } - if(controls.length==0) event.finish(); - } - else{ - player.removeSkill('xianqu_mark'); + if (controls.length == 0) event.finish(); + } else { + player.removeSkill("xianqu_mark"); event.finish(); } - "step 3" - if(result.control){ - if(result.control=='主将'){ - player.viewCharacter(event.target,0); + "step 3"; + if (result.control) { + if (result.control == "主将") { + player.viewCharacter(event.target, 0); + } else { + player.viewCharacter(event.target, 1); } - else{ - player.viewCharacter(event.target,1); - } - } - else if(target.isUnseen(0)){ - player.viewCharacter(event.target,0); - } - else{ - player.viewCharacter(event.target,1); + } else if (target.isUnseen(0)) { + player.viewCharacter(event.target, 0); + } else { + player.viewCharacter(event.target, 1); } }, }, - zhulianbihe_mark:{ - intro:{ - content:"◇出牌阶段,你可以弃置此标记 然后摸两张牌。
    ◇你可以将此标记当做【桃】使用。", + zhulianbihe_mark: { + intro: { + content: "◇出牌阶段,你可以弃置此标记 然后摸两张牌。
    ◇你可以将此标记当做【桃】使用。", }, }, - yinyang_mark:{ - intro:{ - content:"◇出牌阶段,你可以弃置此标记,然后摸一张牌。
    ◇弃牌阶段,你可以弃置此标记,然后本回合手牌上限+2。", + yinyang_mark: { + intro: { + content: + "◇出牌阶段,你可以弃置此标记,然后摸一张牌。
    ◇弃牌阶段,你可以弃置此标记,然后本回合手牌上限+2。", }, }, - _zhulianbihe_mark_tao:{ - ruleSkill:true, - enable:"chooseToUse", - filter:function(event,player){ - return event.type!='phase'&&(player.hasMark('zhulianbihe_mark')||player.hasMark('yexinjia_mark')); + _zhulianbihe_mark_tao: { + ruleSkill: true, + enable: "chooseToUse", + filter: function (event, player) { + return ( + event.type != "phase" && + (player.hasMark("zhulianbihe_mark") || player.hasMark("yexinjia_mark")) + ); }, - viewAsFilter:function(player){ - return player.hasMark('zhulianbihe_mark')||player.hasMark('yexinjia_mark'); + viewAsFilter: function (player) { + return player.hasMark("zhulianbihe_mark") || player.hasMark("yexinjia_mark"); }, - viewAs:{ - name:"tao", - isCard:true, + viewAs: { + name: "tao", + isCard: true, }, - filterCard:function(){return false}, - selectCard:-1, - precontent:function(){ - player.removeMark(player.hasMark('zhulianbihe_mark')?'zhulianbihe_mark':'yexinjia_mark',1); + filterCard: function () { + return false; + }, + selectCard: -1, + precontent: function () { + player.removeMark( + player.hasMark("zhulianbihe_mark") ? "zhulianbihe_mark" : "yexinjia_mark", + 1 + ); }, }, - _yinyang_mark_add:{ - ruleSkill:true, - trigger:{ - player:"phaseDiscardBegin", + _yinyang_mark_add: { + ruleSkill: true, + trigger: { + player: "phaseDiscardBegin", }, - filter:function(event,player){ - return (player.hasMark('yinyang_mark')||player.hasMark('yexinjia_mark'))&&player.needsToDiscard(); + filter: function (event, player) { + return ( + (player.hasMark("yinyang_mark") || player.hasMark("yexinjia_mark")) && + player.needsToDiscard() + ); }, - prompt:function(event,player){ - return '是否弃置一枚【'+(player.hasMark('yinyang_mark')?'阴阳鱼':'野心家')+'】标记,使本回合的手牌上限+2?'; + prompt: function (event, player) { + return ( + "是否弃置一枚【" + + (player.hasMark("yinyang_mark") ? "阴阳鱼" : "野心家") + + "】标记,使本回合的手牌上限+2?" + ); }, - content:function(){ - player.addTempSkill('yinyang_add','phaseAfter'); - player.removeMark(player.hasMark('yinyang_mark')?'yinyang_mark':'yexinjia_mark',1); + content: function () { + player.addTempSkill("yinyang_add", "phaseAfter"); + player.removeMark(player.hasMark("yinyang_mark") ? "yinyang_mark" : "yexinjia_mark", 1); }, }, - yinyang_add:{ - mod:{ - maxHandcard:function(player,num){ - return num+2; + yinyang_add: { + mod: { + maxHandcard: function (player, num) { + return num + 2; }, }, }, - yexinjia_mark:{ - intro:{ - content:'◇你可以弃置此标记,并发动【先驱】标记或【珠联璧合】标记或【阴阳鱼】标记的效果。', + yexinjia_mark: { + intro: { + content: + "◇你可以弃置此标记,并发动【先驱】标记或【珠联璧合】标记或【阴阳鱼】标记的效果。", }, }, - yexinjia_friend:{ - marktext:'盟', - intro:{ - name:'结盟', - content:'已经与$结成联盟', + yexinjia_friend: { + marktext: "盟", + intro: { + name: "结盟", + content: "已经与$结成联盟", }, }, /*----分界线----*/ - _lianheng:{ - mode:['guozhan'], - enable:'phaseUse', - usable:1, - prompt:'将至多三张可合纵的牌交给一名与你势力不同的角色,或未确定势力的角色,若你交给与你势力不同的角色,则你摸等量的牌', - filter:function(event,player){ - return player.hasCard(function(card){ - return card.hasTag('lianheng')||card.hasGaintag('_lianheng'); - },'h'); + _lianheng: { + mode: ["guozhan"], + enable: "phaseUse", + usable: 1, + prompt: "将至多三张可合纵的牌交给一名与你势力不同的角色,或未确定势力的角色,若你交给与你势力不同的角色,则你摸等量的牌", + filter: function (event, player) { + return player.hasCard(function (card) { + return card.hasTag("lianheng") || card.hasGaintag("_lianheng"); + }, "h"); }, - filterCard:function(card){ - return card.hasTag('lianheng')||card.hasGaintag('_lianheng'); + filterCard: function (card) { + return card.hasTag("lianheng") || card.hasGaintag("_lianheng"); }, - filterTarget:function(card,player,target){ - if(target==player) return false; - if(player.isUnseen()) return target.isUnseen(); + filterTarget: function (card, player, target) { + if (target == player) return false; + if (player.isUnseen()) return target.isUnseen(); return !target.isFriendOf(player); }, - check:function(card){ - if(card.name=='tao') return 0; - return 7-get.value(card); + check: function (card) { + if (card.name == "tao") return 0; + return 7 - get.value(card); }, - selectCard:[1,3], - discard:false, - lose:false, - delay:false, - content:function(){ - "step 0" - player.give(cards,target); - "step 1" - if(!target.isUnseen()){ + selectCard: [1, 3], + discard: false, + lose: false, + delay: false, + content: function () { + "step 0"; + player.give(cards, target); + "step 1"; + if (!target.isUnseen()) { player.draw(cards.length); } }, - ai:{ - basic:{ - order:8 + ai: { + basic: { + order: 8, }, - result:{ - player:function(player,target){ - var huoshao=false; - for(var i=0;i=lib.suit.length) return false; - return player.isFriendOf(event.player)&&player.hasCard(function(card){ - if(_status.connectMode&&get.position(card)=='h') return true; - return !suits.includes(get.suit(card)); - },'he'); + if (suits.length >= lib.suit.length) return false; + return ( + player.isFriendOf(event.player) && + player.hasCard(function (card) { + if (_status.connectMode && get.position(card) == "h") return true; + return !suits.includes(get.suit(card)); + }, "he") + ); }, - direct:true, - content:function(){ - 'step 0' - var suits=[],cards=player.getExpansions('qianhuan'); - for(var i=0;i{ - return i.hasGaintag('sha_notshan'); - }))||trigger.target.hp>=3){ - goon=false; + direct: true, + content: function () { + "step 0"; + var goon = get.effect(trigger.target, trigger.card, trigger.player, player) < 0; + if (goon) { + if ( + [ + "tiesuo", + "diaohulishan", + "lianjunshengyan", + "zhibi", + "chiling", + "lulitongxin", + ].includes(trigger.card.name) + ) { + goon = false; + } else if (trigger.card.name == "sha") { + if ( + trigger.target.mayHaveShan( + player, + "use", + trigger.target.getCards("h", (i) => { + return i.hasGaintag("sha_notshan"); + }) + ) || + trigger.target.hp >= 3 + ) { + goon = false; } - } - else if(trigger.card.name=='guohe'){ - if(trigger.target.countCards('he')>=3||!trigger.target.countCards('h')){ - goon=false; + } else if (trigger.card.name == "guohe") { + if ( + trigger.target.countCards("he") >= 3 || + !trigger.target.countCards("h") + ) { + goon = false; } - } - else if(trigger.card.name=='shuiyanqijunx'){ - if(trigger.target.countCards('e')<=1||trigger.target.hp>=3){ - goon=false; + } else if (trigger.card.name == "shuiyanqijunx") { + if (trigger.target.countCards("e") <= 1 || trigger.target.hp >= 3) { + goon = false; } - } - else if(get.tag(trigger.card,'damage')&&trigger.target.hp>=3){ - goon=false; + } else if (get.tag(trigger.card, "damage") && trigger.target.hp >= 3) { + goon = false; } } - player.chooseButton().set('goon',goon).set('ai',function(button){ - if(_status.event.goon) return 1; - return 0; - }).set('createDialog',[get.prompt('qianhuan'),'
    移去一张“千幻”牌令'+ - get.translation(trigger.player)+'对'+get.translation(trigger.target)+'的'+get.translation(trigger.card)+'失效
    ',player.getExpansions('qianhuan')]); - 'step 1' - if(result.bool){ - player.logSkill('qianhuan',trigger.player); + player + .chooseButton() + .set("goon", goon) + .set("ai", function (button) { + if (_status.event.goon) return 1; + return 0; + }) + .set("createDialog", [ + get.prompt("qianhuan"), + '
    移去一张“千幻”牌令' + + get.translation(trigger.player) + + "对" + + get.translation(trigger.target) + + "的" + + get.translation(trigger.card) + + "失效
    ", + player.getExpansions("qianhuan"), + ]); + "step 1"; + if (result.bool) { + player.logSkill("qianhuan", trigger.player); trigger.getParent().targets.remove(trigger.target); - var card=result.links[0]; + var card = result.links[0]; player.loseToDiscardpile(card); } - } - } - } - }, - gzsanyao:{ - audio:'sanyao', - inherit:'sanyao', - filterTarget:function(card,player,target){ - return target.hp>player.hp||target.countCards('h')>player.countCards('h'); + }, + }, }, }, - gzzhiman:{ - audio:'zhiman', - inherit:'zhiman', - preHidden:true, - content:function(){ - 'step 0' - if(trigger.player.countGainableCards(player,'ej')){ - player.gainPlayerCard(trigger.player,'ej',true); + gzsanyao: { + audio: "sanyao", + inherit: "sanyao", + filterTarget: function (card, player, target) { + return target.hp > player.hp || target.countCards("h") > player.countCards("h"); + }, + }, + gzzhiman: { + audio: "zhiman", + inherit: "zhiman", + preHidden: true, + content: function () { + "step 0"; + if (trigger.player.countGainableCards(player, "ej")) { + player.gainPlayerCard(trigger.player, "ej", true); } trigger.cancel(); - 'step 1' - if(player.isFriendOf(trigger.player)){ + "step 1"; + if (player.isFriendOf(trigger.player)) { trigger.player.mayChangeVice(); } - } - }, - gzdiancai:{ - audio:'diancai', - trigger:{global:'phaseUseEnd'}, - filter:function(event,player){ - if(_status.currentPhase==player) return false; - var num=0; - player.getHistory('lose',function(evt){ - if(evt.cards2&&evt.getParent('phaseUse')==event) num+=evt.cards2.length; - }); - return num>=player.hp; }, - preHidden:true, - content:function(){ - 'step 0' - var num=player.maxHp-player.countCards('h'); - if(num>0){ + }, + gzdiancai: { + audio: "diancai", + trigger: { global: "phaseUseEnd" }, + filter: function (event, player) { + if (_status.currentPhase == player) return false; + var num = 0; + player.getHistory("lose", function (evt) { + if (evt.cards2 && evt.getParent("phaseUse") == event) num += evt.cards2.length; + }); + return num >= player.hp; + }, + preHidden: true, + content: function () { + "step 0"; + var num = player.maxHp - player.countCards("h"); + if (num > 0) { player.draw(num); } - 'step 1' + "step 1"; player.mayChangeVice(); }, }, - xuanlve:{ - trigger:{ - player:'loseAfter', - global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'], + xuanlve: { + trigger: { + player: "loseAfter", + global: [ + "equipAfter", + "addJudgeAfter", + "gainAfter", + "loseAsyncAfter", + "addToExpansionAfter", + ], }, - direct:true, - preHidden:true, - filter:function(event,player){ - var evt=event.getl(player); - return evt&&evt.es&&evt.es.length>0; + direct: true, + preHidden: true, + filter: function (event, player) { + var evt = event.getl(player); + return evt && evt.es && evt.es.length > 0; }, - content:function(){ - 'step 0' - player.chooseTarget(get.prompt('xuanlve'),'弃置一名其他角色的一张牌',function(card,player,target){ - return target!=player&&target.countDiscardableCards(player,'he'); - }).set('ai',function(target){ - var player=_status.event.player; - return get.effect(target,{name:'guohe_copy2'},player,player); - }).setHiddenSkill(event.name); - 'step 1' - if(result.bool){ - player.logSkill('xuanlve',result.targets); - player.discardPlayerCard(result.targets[0],'he',true); + content: function () { + "step 0"; + player + .chooseTarget( + get.prompt("xuanlve"), + "弃置一名其他角色的一张牌", + function (card, player, target) { + return target != player && target.countDiscardableCards(player, "he"); + } + ) + .set("ai", function (target) { + var player = _status.event.player; + return get.effect(target, { name: "guohe_copy2" }, player, player); + }) + .setHiddenSkill(event.name); + "step 1"; + if (result.bool) { + player.logSkill("xuanlve", result.targets); + player.discardPlayerCard(result.targets[0], "he", true); } }, - ai:{ - noe:true, - reverseEquip:true, - effect:{ - target:function(card,player,target,current){ - if(get.type(card)=='equip') return [1,1]; - } - } - } + ai: { + noe: true, + reverseEquip: true, + effect: { + target: function (card, player, target, current) { + if (get.type(card) == "equip") return [1, 1]; + }, + }, + }, }, - lianzi:{ - enable:'phaseUse', - usable:1, - audio:2, - filterCard:true, - check:function(card){ - if(get.type(card)=='equip') return 0; - var player=_status.event.player; - var num=game.countPlayer(function(current){ - if(current.identity=='wu'){ - return current.countCards('e'); - } - })+player.getExpansions('yuanjiangfenghuotu').length; - if(num>=5){ - return 8-get.value(card); + lianzi: { + enable: "phaseUse", + usable: 1, + audio: 2, + filterCard: true, + check: function (card) { + if (get.type(card) == "equip") return 0; + var player = _status.event.player; + var num = + game.countPlayer(function (current) { + if (current.identity == "wu") { + return current.countCards("e"); + } + }) + player.getExpansions("yuanjiangfenghuotu").length; + if (num >= 5) { + return 8 - get.value(card); } - if(num>=3){ - return 7-get.value(card); + if (num >= 3) { + return 7 - get.value(card); } - if(num>=2){ - return 3-get.value(card); + if (num >= 2) { + return 3 - get.value(card); } return 0; }, - content:function(){ - 'step 0' - var num=game.countPlayer(function(current){ - if(current.identity=='wu'){ - return current.countCards('e'); - } - })+player.getExpansions('yuanjiangfenghuotu').length; - if(num){ - event.shown=get.cards(num); - player.showCards(event.shown,get.translation('lianzi')); - } - else{ + content: function () { + "step 0"; + var num = + game.countPlayer(function (current) { + if (current.identity == "wu") { + return current.countCards("e"); + } + }) + player.getExpansions("yuanjiangfenghuotu").length; + if (num) { + event.shown = get.cards(num); + player.showCards(event.shown, get.translation("lianzi")); + } else { event.finish(); return; } - 'step 1' - var list=[]; - var discards=[]; - var type=get.type(cards[0],'trick'); - for(var i=0;i=3&&player.hasStockSkill('lianzi')){ - player.changeSkills(['gzzhiheng'],['lianzi']); + if (list.length) { + player.gain(list, "gain2"); + if (list.length >= 3 && player.hasStockSkill("lianzi")) { + player.changeSkills(["gzzhiheng"], ["lianzi"]); } } }, - ai:{ - order:7, - result:{ - player:1 - } - } - }, - jubao:{ - mod:{ - canBeGained:function(card,source,player){ - if(source!=player&&get.position(card)=='e'&&get.subtype(card)=='equip5') return false; - } + ai: { + order: 7, + result: { + player: 1, + }, }, - trigger:{player:'phaseJieshuBegin'}, - audio:2, - forced:true, - unique:true, - filter:function(event,player){ - if(game.hasPlayer(function(current){ - return current.countCards('ej',function(card){ - return card.name=='dinglanyemingzhu'; - }); - })){ + }, + jubao: { + mod: { + canBeGained: function (card, source, player) { + if (source != player && get.position(card) == "e" && get.subtype(card) == "equip5") + return false; + }, + }, + trigger: { player: "phaseJieshuBegin" }, + audio: 2, + forced: true, + unique: true, + filter: function (event, player) { + if ( + game.hasPlayer(function (current) { + return current.countCards("ej", function (card) { + return card.name == "dinglanyemingzhu"; + }); + }) + ) { return true; } - for(var i=0;i0; + trigger: { player: "damageEnd" }, + forced: true, + filter: function (event, player) { + return ( + event.card && + (event.card.name == "sha" || get.type(event.card, "trick") == "trick") && + player.getExpansions("yuanjiangfenghuotu").length > 0 + ); }, - content:function(){ - 'step 0' - player.chooseCardButton('将一张“烽火”置入弃牌堆',player.getExpansions('yuanjiangfenghuotu'),true); - 'step 1' - if(result.bool){ - var card=result.links[0]; + content: function () { + "step 0"; + player.chooseCardButton( + "将一张“烽火”置入弃牌堆", + player.getExpansions("yuanjiangfenghuotu"), + true + ); + "step 1"; + if (result.bool) { + var card = result.links[0]; player.loseToDiscardpile(card); } - } + }, }, - jiahe_put:{ - enable:'phaseUse', - audio:2, - forceaudio:true, - filter:function(event,player){ - var zhu=get.zhu(player,'jiahe'); - if(zhu){ - return player.countCards('he',{type:'equip'})>0; + jiahe_put: { + enable: "phaseUse", + audio: 2, + forceaudio: true, + filter: function (event, player) { + var zhu = get.zhu(player, "jiahe"); + if (zhu) { + return player.countCards("he", { type: "equip" }) > 0; } return false; }, - filterCard:{type:'equip'}, - position:'he', - usable:1, - check:function(card){ - var zhu=get.zhu(_status.event.player,'jiahe'); - if(!zhu) return 0; - var num=7-get.value(card); - if(get.position(card)=='h'){ - if(zhu.getExpansions('huangjintianbingfu').length>=5){ - return num-3; + filterCard: { type: "equip" }, + position: "he", + usable: 1, + check: function (card) { + var zhu = get.zhu(_status.event.player, "jiahe"); + if (!zhu) return 0; + var num = 7 - get.value(card); + if (get.position(card) == "h") { + if (zhu.getExpansions("huangjintianbingfu").length >= 5) { + return num - 3; } - return num+3; - } - else{ - var player=_status.event.player; - var zhu=get.zhu(player,'jiahe'); - var sub=get.subtype(card) - if(player.countCards('h',function(card){ - return get.type(card)=='equip'&&get.subtype(card)=='sub'&&player.hasValueTarget(card); - })) return num+4; - if(zhu.getExpansions('yuanjiangfenghuotu').length>=5&&!player.hasSkillTag('noe')){ - return num-5; + return num + 3; + } else { + var player = _status.event.player; + var zhu = get.zhu(player, "jiahe"); + var sub = get.subtype(card); + if ( + player.countCards("h", function (card) { + return ( + get.type(card) == "equip" && + get.subtype(card) == "sub" && + player.hasValueTarget(card) + ); + }) + ) + return num + 4; + if ( + zhu.getExpansions("yuanjiangfenghuotu").length >= 5 && + !player.hasSkillTag("noe") + ) { + return num - 5; } } return num; }, - discard:false, - lose:false, - delay:false, - prepare:function(cards,player){ - var zhu=get.zhu(player,'jiahe'); + discard: false, + lose: false, + delay: false, + prepare: function (cards, player) { + var zhu = get.zhu(player, "jiahe"); player.line(zhu); }, - content:function(){ - var zhu=get.zhu(player,'jiahe'); - zhu.addToExpansion(cards,player,'give').gaintag.add('yuanjiangfenghuotu'); + content: function () { + var zhu = get.zhu(player, "jiahe"); + zhu.addToExpansion(cards, player, "give").gaintag.add("yuanjiangfenghuotu"); }, - ai:{ - order:function(item,player){ - if(player.hasSkillTag('noe')||!player.countCards('h',function(card){ - return get.type(card)=='equip'&&!player.canEquip(card)&&player.hasValueTarget(card); - })) return 1; + ai: { + order: function (item, player) { + if ( + player.hasSkillTag("noe") || + !player.countCards("h", function (card) { + return ( + get.type(card) == "equip" && + !player.canEquip(card) && + player.hasValueTarget(card) + ); + }) + ) + return 1; return 10; }, - result:{ - player:1 - } - } + result: { + player: 1, + }, + }, }, - jiahe_skill:{ - trigger:{player:'phaseZhunbeiBegin'}, - direct:true, - audio:"jiahe_put", - forceaudio:true, - filter:function(event,player){ - var zhu=get.zhu(player,'jiahe'); - if(zhu&&zhu.getExpansions('yuanjiangfenghuotu').length){ + jiahe_skill: { + trigger: { player: "phaseZhunbeiBegin" }, + direct: true, + audio: "jiahe_put", + forceaudio: true, + filter: function (event, player) { + var zhu = get.zhu(player, "jiahe"); + if (zhu && zhu.getExpansions("yuanjiangfenghuotu").length) { return true; } return false; }, - content:function(){ - 'step 0' - var zhu=get.zhu(player,'jiahe'); - event.num=zhu.getExpansions('yuanjiangfenghuotu').length; - 'step 1' - var list=[]; - if(event.num>=1&&!player.hasSkill('jiahe_reyingzi')) list.push('reyingzi'); - if(event.num>=2&&!player.hasSkill('jiahe_haoshi')) list.push('haoshi'); - if(event.num>=3&&!player.hasSkill('jiahe_shelie')) list.push('shelie'); - if(event.num>=4&&!player.hasSkill('jiahe_duoshi')) list.push('fakeduoshi'); - if(!list.length){ + content: function () { + "step 0"; + var zhu = get.zhu(player, "jiahe"); + event.num = zhu.getExpansions("yuanjiangfenghuotu").length; + "step 1"; + var list = []; + if (event.num >= 1 && !player.hasSkill("jiahe_reyingzi")) list.push("reyingzi"); + if (event.num >= 2 && !player.hasSkill("jiahe_haoshi")) list.push("haoshi"); + if (event.num >= 3 && !player.hasSkill("jiahe_shelie")) list.push("shelie"); + if (event.num >= 4 && !player.hasSkill("jiahe_duoshi")) list.push("fakeduoshi"); + if (!list.length) { event.finish(); return; } - var prompt2='你可以获得下列一项技能直到回合结束'; - if(list.length>=5){ - if(event.done){ - prompt2+=' (2/2)'; - } - else{ - prompt2+=' (1/2)'; + var prompt2 = "你可以获得下列一项技能直到回合结束"; + if (list.length >= 5) { + if (event.done) { + prompt2 += " (2/2)"; + } else { + prompt2 += " (1/2)"; } } - list.push('cancel2'); - player.chooseControl(list).set('prompt',get.translation('yuanjiangfenghuotu')). - set('prompt2',prompt2).set('centerprompt2',true).set('ai',function(evt,player){ - var controls=_status.event.controls; - if(controls.includes('haoshi')){ - var nh=player.countCards('h'); - if(player.hasSkill('reyingzi')){ - if(nh==0) return 'haoshi'; + list.push("cancel2"); + player + .chooseControl(list) + .set("prompt", get.translation("yuanjiangfenghuotu")) + .set("prompt2", prompt2) + .set("centerprompt2", true) + .set("ai", function (evt, player) { + var controls = _status.event.controls; + if (controls.includes("haoshi")) { + var nh = player.countCards("h"); + if (player.hasSkill("reyingzi")) { + if (nh == 0) return "haoshi"; + } else { + if (nh <= 1) return "haoshi"; + } } - else{ - if(nh<=1) return 'haoshi'; + if (controls.includes("shelie")) { + return "shelie"; } - } - if(controls.includes('shelie')){ - return 'shelie'; - } - if(controls.includes('reyingzi')){ - return 'reyingzi'; - } - if(controls.includes('fakeduoshi')){ - return 'fakeduoshi'; - } - return controls.randomGet(); - }); - 'step 2' - if(result.control!='cancel2'){ - var skill=(result.control!='fakeduoshi'?'jiahe_':'')+result.control; + if (controls.includes("reyingzi")) { + return "reyingzi"; + } + if (controls.includes("fakeduoshi")) { + return "fakeduoshi"; + } + return controls.randomGet(); + }); + "step 2"; + if (result.control != "cancel2") { + var skill = (result.control != "fakeduoshi" ? "jiahe_" : "") + result.control; player.addTempSkills(skill); - if(!event.done) player.logSkill('jiahe_put'); + if (!event.done) player.logSkill("jiahe_put"); // game.log(player,'获得了技能','【'+get.translation(skill)+'】'); - if(event.num>=5&&!event.done){ - event.done=true; + if (event.num >= 5 && !event.done) { + event.done = true; event.goto(1); } } - } - }, - jiahe_reyingzi:{ - inherit:'reyingzi', - }, - jiahe_haoshi:{ - inherit:'haoshi', - }, - jiahe_shelie:{ - inherit:'shelie', - }, - jiahe_duoshi:{ - inherit:'duoshi', - }, - yuanjiangfenghuotu:{ - unique:true, - forceunique:true, - nopop:true, - mark:true, - onremove:function(player,skill){ - var cards=player.getExpansions(skill); - if(cards.length) player.loseToDiscardpile(cards); }, - intro:{ - content:'expansion', - markcount:'expansion', - mark:function(dialog,content,player){ - var content=player.getExpansions('yuanjiangfenghuotu'); - if(content&&content.length){ + }, + jiahe_reyingzi: { + inherit: "reyingzi", + }, + jiahe_haoshi: { + inherit: "haoshi", + }, + jiahe_shelie: { + inherit: "shelie", + }, + jiahe_duoshi: { + inherit: "duoshi", + }, + yuanjiangfenghuotu: { + unique: true, + forceunique: true, + nopop: true, + mark: true, + onremove: function (player, skill) { + var cards = player.getExpansions(skill); + if (cards.length) player.loseToDiscardpile(cards); + }, + intro: { + content: "expansion", + markcount: "expansion", + mark: function (dialog, content, player) { + var content = player.getExpansions("yuanjiangfenghuotu"); + if (content && content.length) { dialog.addSmall(content); } - dialog.addText('
    • 每名吴势力角色的出牌阶段限一次,该角色可以将一张装备牌置于“缘江烽火图”上,称之为“烽火”。
    • 根据“烽火”的数量,所有吴势力角色可于其准备阶段选择并获得其中一个技能直到回合结束:一张以上~英姿;两张以上~好施;三张以上~涉猎;四张以上~度势;五张以上~可额外选择一项。
    • 锁定技,当你受到【杀】或锦囊牌造成的伤害后,你将一张“烽火”置入弃牌堆。',false) - } - } + dialog.addText( + '
      • 每名吴势力角色的出牌阶段限一次,该角色可以将一张装备牌置于“缘江烽火图”上,称之为“烽火”。
      • 根据“烽火”的数量,所有吴势力角色可于其准备阶段选择并获得其中一个技能直到回合结束:一张以上~英姿;两张以上~好施;三张以上~涉猎;四张以上~度势;五张以上~可额外选择一项。
      • 锁定技,当你受到【杀】或锦囊牌造成的伤害后,你将一张“烽火”置入弃牌堆。', + false + ); + }, + }, }, - gzqice:{ - enable:'phaseUse', - usable:1, - audio:"qice_backup", - filter:function(event,player){ - var hs=player.getCards('h'); - if(!hs.length) return false; - for(var i=0;inum){ + if (get.select(info.selectTarget)[1] == -1) { + if ( + game.countPlayer(function (current) { + return player.canUse(card, current); + }) > num + ) { return false; } - } - else if(info.changeTarget){ - var giveup=true; - var list=game.filterPlayer(function(current){ - return player.canUse(card,current); + } else if (info.changeTarget) { + var giveup = true; + var list = game.filterPlayer(function (current) { + return player.canUse(card, current); }); - for(var i=0;inh){ - select[1]=nh; + filterCard: true, + audio: "qice_backup", + selectCard: -1, + position: "h", + selectTarget: function () { + var select = get.select(get.info(get.card()).selectTarget); + var nh = _status.event.player.countCards("h"); + if (select[1] > nh) { + select[1] = nh; } return select; }, - filterTarget:function(card,player,target){ - var info=get.info(card); - if(info.changeTarget){ - var targets=[target]; - info.changeTarget(player,targets); - if(targets.length>player.countCards('h')){ + filterTarget: function (card, player, target) { + var info = get.info(card); + if (info.changeTarget) { + var targets = [target]; + info.changeTarget(player, targets); + if (targets.length > player.countCards("h")) { return false; } } - return lib.filter.filterTarget(card,player,target); + return lib.filter.filterTarget(card, player, target); }, - popname:true, - viewAs:{name:links[0][2]}, - ai1:function(){ + popname: true, + viewAs: { name: links[0][2] }, + ai1: function () { return 1; - } - } + }, + }; + }, + prompt: function (links, player) { + return "将全部手牌当作" + get.translation(links[0][2]) + "使用"; }, - prompt:function(links,player){ - return '将全部手牌当作'+get.translation(links[0][2])+'使用'; - } }, - ai:{ - order:1, - result:{ - player:function(player){ - var num=0; - var cards=player.getCards('h'); - if(cards.length>=3&&player.hp>=3) return 0; - for(var i=0;i= 3 && player.hp >= 3) return 0; + for (var i = 0; i < cards.length; i++) { + num += Math.max(0, get.value(cards[i], player, "raw")); } - return 16-num; - } + return 16 - num; + }, }, - threaten:1.6, - } + threaten: 1.6, + }, }, - gzyuejian:{ - trigger:{global:'phaseDiscardBegin'}, - audio:'yuejian', - preHidden:true, - filter:function(event,player){ - if(player.isFriendOf(event.player)){ - return event.player.getHistory('useCard',function(evt){ - if(evt.targets){ - var targets=evt.targets.slice(0); - while(targets.includes(event.player)) targets.remove(event.player); - return targets.length!=0; - } - return false; - })==0; + gzyuejian: { + trigger: { global: "phaseDiscardBegin" }, + audio: "yuejian", + preHidden: true, + filter: function (event, player) { + if (player.isFriendOf(event.player)) { + return ( + event.player.getHistory("useCard", function (evt) { + if (evt.targets) { + var targets = evt.targets.slice(0); + while (targets.includes(event.player)) targets.remove(event.player); + return targets.length != 0; + } + return false; + }) == 0 + ); } return false; }, - content:function(){ - trigger.player.addTempSkill('gzyuejian_num'); + content: function () { + trigger.player.addTempSkill("gzyuejian_num"); }, - logTarget:'player', - forced:true, - subSkill:{ - num:{ - mod:{ - maxHandcardBase:function(player,num){ + logTarget: "player", + forced: true, + subSkill: { + num: { + mod: { + maxHandcardBase: function (player, num) { return player.maxHp; - } - } + }, + }, }, - } - }, - gzxinsheng:{ - trigger:{player:'damageEnd'}, - // frequent:true, - content:function(){ - game.log(player,'获得了一张','#g化身'); - lib.skill.gzhuashen.addCharacter(player,_status.characterlist.randomGet(),true); - game.delayx(); - } - }, - gzhuashen:{ - unique:true, - group:['gzhuashen_add','gzhuashen_swap','gzhuashen_remove','gzhuashen_disallow','gzhuashen_flash'], - init:function(player){ - player.storage.gzhuashen=[]; - player.storage.gzhuashen_removing=[]; - player.storage.gzhuashen_trigger=[]; - player.storage.gzhuashen_map={}; }, - onremove:function(player){ + }, + gzxinsheng: { + trigger: { player: "damageEnd" }, + // frequent:true, + content: function () { + game.log(player, "获得了一张", "#g化身"); + lib.skill.gzhuashen.addCharacter(player, _status.characterlist.randomGet(), true); + game.delayx(); + }, + }, + gzhuashen: { + unique: true, + group: [ + "gzhuashen_add", + "gzhuashen_swap", + "gzhuashen_remove", + "gzhuashen_disallow", + "gzhuashen_flash", + ], + init: function (player) { + player.storage.gzhuashen = []; + player.storage.gzhuashen_removing = []; + player.storage.gzhuashen_trigger = []; + player.storage.gzhuashen_map = {}; + }, + onremove: function (player) { delete player.storage.gzhuashen; delete player.storage.gzhuashen_removing; delete player.storage.gzhuashen_trigger; delete player.storage.gzhuashen_map; }, - ondisable:true, - mark:true, - intro:{ - mark:function(dialog,storage,player){ - if(storage&&storage.length){ - if(player.isUnderControl(true)){ - dialog.addSmall([storage,'character']); - var skills=[]; - for(var i in player.storage.gzhuashen_map){ + ondisable: true, + mark: true, + intro: { + mark: function (dialog, storage, player) { + if (storage && storage.length) { + if (player.isUnderControl(true)) { + dialog.addSmall([storage, "character"]); + var skills = []; + for (var i in player.storage.gzhuashen_map) { skills.addArray(player.storage.gzhuashen_map[i]); } - dialog.addText('可用技能:'+(skills.length?get.translation(skills):'无')); + dialog.addText( + "可用技能:" + (skills.length ? get.translation(skills) : "无") + ); + } else { + return "共有" + get.cnNumber(storage.length) + "张“化身”"; } - else{ - return '共有'+get.cnNumber(storage.length)+'张“化身”' - } - } - else{ - return '没有化身'; + } else { + return "没有化身"; } }, - content:function(storage,player){ - if(player.isUnderControl(true)){ - var skills=[]; - for(var i in player.storage.gzhuashen_map){ + content: function (storage, player) { + if (player.isUnderControl(true)) { + var skills = []; + for (var i in player.storage.gzhuashen_map) { skills.addArray(player.storage.gzhuashen_map[i]); } - return get.translation(storage)+';可用技能:'+(skills.length?get.translation(skills):'无'); + return ( + get.translation(storage) + + ";可用技能:" + + (skills.length ? get.translation(skills) : "无") + ); + } else { + return "共有" + get.cnNumber(storage.length) + "张“化身”"; } - else{ - return '共有'+get.cnNumber(storage.length)+'张“化身”' - } - } + }, }, - filterSkill:function(name){ - var skills=lib.character[name][3].slice(0); - for(var i=0;i=2; }, - content:function(){ - 'step 0' - var list=player.storage.gzhuashen.slice(0); - if(!list.length){ + }, + swap: { + trigger: { player: "phaseBeginStart" }, + direct: true, + filter: function (event, player) { + if (player.hasSkill("gzhuashen_triggered")) return false; + return player.storage.gzhuashen.length >= 2; + }, + content: function () { + "step 0"; + var list = player.storage.gzhuashen.slice(0); + if (!list.length) { event.finish(); return; } - player.chooseButton().set('ai',function(){ - return Math.random()-0.3; - }).set('createDialog',['是否替换一张“化身”?',[list,'character']]); - 'step 1' - if(result.bool){ - player.logSkill('gzhuashen'); - game.log(player,'替换了一张','#g化身'); - lib.skill.gzhuashen.addCharacter(player,_status.characterlist.randomGet(),true); - lib.skill.gzhuashen.removeCharacter(player,result.links[0]); + player + .chooseButton() + .set("ai", function () { + return Math.random() - 0.3; + }) + .set("createDialog", ["是否替换一张“化身”?", [list, "character"]]); + "step 1"; + if (result.bool) { + player.logSkill("gzhuashen"); + game.log(player, "替换了一张", "#g化身"); + lib.skill.gzhuashen.addCharacter( + player, + _status.characterlist.randomGet(), + true + ); + lib.skill.gzhuashen.removeCharacter(player, result.links[0]); game.delayx(); } - } + }, }, - triggered:{}, - flash:{ - hookTrigger:{ - log:function(player,skill){ - var sources=lib.skill.gzhuashen.getSkillSources(player,skill); - if(sources.length){ - player.flashAvatar('gzhuashen',sources.randomGet()); + triggered: {}, + flash: { + hookTrigger: { + log: function (player, skill) { + var sources = lib.skill.gzhuashen.getSkillSources(player, skill); + if (sources.length) { + player.flashAvatar("gzhuashen", sources.randomGet()); player.storage.gzhuashen_removing.add(skill); } - } + }, }, - trigger:{player:['useSkillBegin','useCard','respond']}, - silent:true, - filter:function(event,player){ - return event.skill&&lib.skill.gzhuashen.getSkillSources(player,event.skill).length>0; + trigger: { player: ["useSkillBegin", "useCard", "respond"] }, + silent: true, + filter: function (event, player) { + return ( + event.skill && + lib.skill.gzhuashen.getSkillSources(player, event.skill).length > 0 + ); + }, + content: function () { + lib.skill.gzhuashen_flash.hookTrigger.log(player, trigger.skill); }, - content:function(){ - lib.skill.gzhuashen_flash.hookTrigger.log(player,trigger.skill); - } }, - clear:{ - trigger:{player:'phaseAfter'}, - silent:true, - content:function(){ - player.storage.gzhuashen_trigger.length=0; - } + clear: { + trigger: { player: "phaseAfter" }, + silent: true, + content: function () { + player.storage.gzhuashen_trigger.length = 0; + }, }, - disallow:{ - hookTrigger:{ - block:function(event,player,name,skill){ - for(var i=0;i0){ + disallow: { + hookTrigger: { + block: function (event, player, name, skill) { + for (var i = 0; i < player.storage.gzhuashen_trigger.length; i++) { + var info = player.storage.gzhuashen_trigger[i]; + if ( + info[0] == event && + info[1] == name && + lib.skill.gzhuashen.getSkillSources(player, skill).length > 0 + ) { return true; } } return false; - } - } + }, + }, }, - remove:{ - trigger:{player:['useSkillAfter','useCardAfter','respondAfter','triggerAfter','skillAfter']}, - hookTrigger:{ - after:function(event,player){ - if(event._direct&&!player.storage.gzhuashen_removing.includes(event.skill)) return false; - if(lib.skill[event.skill].silent) return false; - return lib.skill.gzhuashen.getSkillSources(player,event.skill).length>0; - } + remove: { + trigger: { + player: [ + "useSkillAfter", + "useCardAfter", + "respondAfter", + "triggerAfter", + "skillAfter", + ], }, - silent:true, - filter:function(event,player){ - return event.skill&&lib.skill.gzhuashen.getSkillSources(player,event.skill).length>0; + hookTrigger: { + after: function (event, player) { + if (event._direct && !player.storage.gzhuashen_removing.includes(event.skill)) + return false; + if (lib.skill[event.skill].silent) return false; + return lib.skill.gzhuashen.getSkillSources(player, event.skill).length > 0; + }, }, - content:function(){ - 'step 0' - if(trigger.name=='trigger'){ - player.storage.gzhuashen_trigger.push([trigger._trigger,trigger.triggername]); + silent: true, + filter: function (event, player) { + return ( + event.skill && + lib.skill.gzhuashen.getSkillSources(player, event.skill).length > 0 + ); + }, + content: function () { + "step 0"; + if (trigger.name == "trigger") { + player.storage.gzhuashen_trigger.push([ + trigger._trigger, + trigger.triggername, + ]); } - var sources=lib.skill.gzhuashen.getSkillSources(player,trigger.skill); - if(sources.length==1){ - event.directresult=sources[0]; + var sources = lib.skill.gzhuashen.getSkillSources(player, trigger.skill); + if (sources.length == 1) { + event.directresult = sources[0]; + } else { + player + .chooseButton(true) + .set("createDialog", ["移除一张“化身”牌", [sources, "character"]]); } - else{ - player.chooseButton(true).set('createDialog',['移除一张“化身”牌',[sources,'character']]); + "step 1"; + if (!event.directresult && result && result.links[0]) { + event.directresult = result.links[0]; } - 'step 1' - if(!event.directresult&&result&&result.links[0]){ - event.directresult=result.links[0]; - } - var name=event.directresult; - lib.skill.gzhuashen.removeCharacter(player,name); - game.log(player,'移除了化身牌','#g'+get.translation(name)); - } - } + var name = event.directresult; + lib.skill.gzhuashen.removeCharacter(player, name); + game.log(player, "移除了化身牌", "#g" + get.translation(name)); + }, + }, }, - ai:{ - nofrequent:true, - skillTagFilter:function(player,tag,arg){ - if(arg&&player.storage.gzhuashen){ - if(lib.skill.gzhuashen.getSkillSources(player,arg).length>0){ + ai: { + nofrequent: true, + skillTagFilter: function (player, tag, arg) { + if (arg && player.storage.gzhuashen) { + if (lib.skill.gzhuashen.getSkillSources(player, arg).length > 0) { return true; } } return false; - } - } - }, - gzxiongsuan:{ - limited:true, - audio:'xiongsuan', - enable:'phaseUse', - filterCard:true, - filter:function(event,player){ - return player.countCards('h'); + }, }, - filterTarget:function(card,player,target){ + }, + gzxiongsuan: { + limited: true, + audio: "xiongsuan", + enable: "phaseUse", + filterCard: true, + filter: function (event, player) { + return player.countCards("h"); + }, + filterTarget: function (card, player, target) { return target.isFriendOf(player); }, - check:function(card){ - return 7-get.value(card); + check: function (card) { + return 7 - get.value(card); }, - content:function(){ - 'step 0' - player.awakenSkill('gzxiongsuan'); - target.damage('nocard'); - 'step 1' + content: function () { + "step 0"; + player.awakenSkill("gzxiongsuan"); + target.damage("nocard"); + "step 1"; player.draw(3); - var list=[]; - var skills=target.getOriginalSkills(); - for(var i=0;i 1) { + player.chooseControl(list).set("prompt", "选择一个限定技在回合结束后重置之"); + } else { event.finish(); } - else if(list.length>1){ - player.chooseControl(list).set('prompt','选择一个限定技在回合结束后重置之'); - } - else{ - event.finish(); - } - 'step 2' - target.storage.gzxiongsuan_restore=result.control; - target.addTempSkill('gzxiongsuan_restore'); + "step 2"; + target.storage.gzxiongsuan_restore = result.control; + target.addTempSkill("gzxiongsuan_restore"); }, - subSkill:{ - restore:{ - trigger:{global:'phaseEnd'}, - forced:true, - popup:false, - charlotte:true, - onremove:true, - content:function(){ + subSkill: { + restore: { + trigger: { global: "phaseEnd" }, + forced: true, + popup: false, + charlotte: true, + onremove: true, + content: function () { player.restoreSkill(player.storage.gzxiongsuan_restore); - } - } + }, + }, }, - ai:{ - order:4, - damage:true, - result:{ - target:function(player,target){ - if(target.hp>1){ - var skills=target.getOriginalSkills(); - for(var i=0;i 1) { + var skills = target.getOriginalSkills(); + for (var i = 0; i < skills.length; i++) { + if ( + lib.skill[skills[i]].limited && + target.awakenedSkills.includes(skills[i]) + ) { return 8; } } } - if(target!=player) return 0; - if(get.damageEffect(target,player,player)>=0) return 10; - if(target.hp>=4) return 5; - if(target.hp==3){ - if(player.countCards('h')<=2&&game.hasPlayer(function(current){ - return current.hp<=1&&get.attitude(player,current)<0; - })){ + if (target != player) return 0; + if (get.damageEffect(target, player, player) >= 0) return 10; + if (target.hp >= 4) return 5; + if (target.hp == 3) { + if ( + player.countCards("h") <= 2 && + game.hasPlayer(function (current) { + return current.hp <= 1 && get.attitude(player, current) < 0; + }) + ) { return 3; } } return 0; - } - } - } + }, + }, + }, }, - gzsuishi:{ - audio:'suishi', - preHidden:['gzsuishi2'], - trigger:{global:'dying'}, - forced:true, + gzsuishi: { + audio: "suishi", + preHidden: ["gzsuishi2"], + trigger: { global: "dying" }, + forced: true, //priority:6.5, - check:function(){ + check: function () { return false; }, - filter:function(event,player){ - return event.player!=player&&event.parent.name=='damage'&&event.parent.source&&event.parent.source.isFriendOf(player); + filter: function (event, player) { + return ( + event.player != player && + event.parent.name == "damage" && + event.parent.source && + event.parent.source.isFriendOf(player) + ); }, - content:function(){ + content: function () { player.draw(); }, - group:'gzsuishi2' + group: "gzsuishi2", }, - gzsuishi2:{ - audio:'suishi', - trigger:{global:'dieAfter'}, - forced:true, - check:function(){return false}, - filter:function(event,player){ + gzsuishi2: { + audio: "suishi", + trigger: { global: "dieAfter" }, + forced: true, + check: function () { + return false; + }, + filter: function (event, player) { return event.player.isFriendOf(player); }, - content:function(){ + content: function () { player.loseHp(); - } + }, }, - hongfa_respond:{ - audio:'huangjintianbingfu', - forceaudio:true, - trigger:{player:'chooseToRespondBegin'}, - direct:true, - filter:function(event,player){ - if(event.responded) return false; - if(!event.filterCard({name:'sha'})) return false; - var zhu=get.zhu(player,'hongfa'); - if(zhu&&zhu.getExpansions('huangjintianbingfu').length>0){ + hongfa_respond: { + audio: "huangjintianbingfu", + forceaudio: true, + trigger: { player: "chooseToRespondBegin" }, + direct: true, + filter: function (event, player) { + if (event.responded) return false; + if (!event.filterCard({ name: "sha" })) return false; + var zhu = get.zhu(player, "hongfa"); + if (zhu && zhu.getExpansions("huangjintianbingfu").length > 0) { return true; } return false; }, - content:function(){ - "step 0" - var zhu=get.zhu(player,'hongfa'); - player.chooseCardButton(get.prompt('huangjintianbingfu'),zhu.getExpansions('huangjintianbingfu')).set('ai',function(){ - if(_status.event.goon) return 1; - return 0; - }).set('goon',player.countCards('h','sha')==0); - "step 1" - if(result.bool){ - var card=result.links[0]; + content: function () { + "step 0"; + var zhu = get.zhu(player, "hongfa"); + player + .chooseCardButton( + get.prompt("huangjintianbingfu"), + zhu.getExpansions("huangjintianbingfu") + ) + .set("ai", function () { + if (_status.event.goon) return 1; + return 0; + }) + .set("goon", player.countCards("h", "sha") == 0); + "step 1"; + if (result.bool) { + var card = result.links[0]; trigger.untrigger(); - trigger.responded=true; - trigger.result={bool:true,card:{name:'sha'},cards:[card]}; - var zhu=get.zhu(player,'hongfa'); - player.logSkill('hongfa_respond',zhu); + trigger.responded = true; + trigger.result = { bool: true, card: { name: "sha" }, cards: [card] }; + var zhu = get.zhu(player, "hongfa"); + player.logSkill("hongfa_respond", zhu); } - } + }, }, - hongfa_use:{ - audio:'huangjintianbingfu', - forceaudio:true, - enable:'chooseToUse', - filter:function(event,player){ - if(!event.filterCard({name:'sha'},player)) return false; - var zhu=get.zhu(player,'hongfa'); - if(zhu&&zhu.getExpansions('huangjintianbingfu').length>0){ + hongfa_use: { + audio: "huangjintianbingfu", + forceaudio: true, + enable: "chooseToUse", + filter: function (event, player) { + if (!event.filterCard({ name: "sha" }, player)) return false; + var zhu = get.zhu(player, "hongfa"); + if (zhu && zhu.getExpansions("huangjintianbingfu").length > 0) { return true; } return false; }, - chooseButton:{ - dialog:function(event,player){ - var zhu=get.zhu(player,'hongfa'); - return ui.create.dialog('黄巾天兵符',zhu.getExpansions('huangjintianbingfu'),'hidden'); + chooseButton: { + dialog: function (event, player) { + var zhu = get.zhu(player, "hongfa"); + return ui.create.dialog( + "黄巾天兵符", + zhu.getExpansions("huangjintianbingfu"), + "hidden" + ); }, - backup:function(links,player){ + backup: function (links, player) { return { - filterCard:function(){return false}, - selectCard:-1, - viewAs:{name:'sha',cards:links}, - cards:links, - precontent:function(){ - var cards=lib.skill.hongfa_use_backup.cards; - event.result.cards=cards; - player.logSkill('hongfa_use',result.targets); - } - } + filterCard: function () { + return false; + }, + selectCard: -1, + viewAs: { name: "sha", cards: links }, + cards: links, + precontent: function () { + var cards = lib.skill.hongfa_use_backup.cards; + event.result.cards = cards; + player.logSkill("hongfa_use", result.targets); + }, + }; + }, + prompt: function (links, player) { + return "选择杀的目标"; }, - prompt:function(links,player){ - return '选择杀的目标'; - } }, - ai:{ - respondSha:true, - skillTagFilter:function(player){ - var zhu=get.zhu(player,'hongfa'); - if(zhu&&zhu.getExpansions('huangjintianbingfu').length>0){ + ai: { + respondSha: true, + skillTagFilter: function (player) { + var zhu = get.zhu(player, "hongfa"); + if (zhu && zhu.getExpansions("huangjintianbingfu").length > 0) { return true; } return false; }, - order:function(){ - return get.order({name:'sha'})-0.1; + order: function () { + return get.order({ name: "sha" }) - 0.1; }, - result:{ - player:function(player){ - if(player.countCards('h','sha')) return 0; + result: { + player: function (player) { + if (player.countCards("h", "sha")) return 0; return 1; - } - } - } - }, - hongfa:{ - audio:2, - derivation:'huangjintianbingfu', - unique:true, - forceunique:true, - lordSkill:true, - trigger:{player:'phaseZhunbeiBegin'}, - forced:true, - filter:function(event,player){ - return player.getExpansions('huangjintianbingfu').length==0&&get.population('qun')>0; - }, - content:function(){ - var cards=get.cards(get.population('qun')); - player.addToExpansion(cards,'gain2').gaintag.add('huangjintianbingfu'); - }, - ai:{ - threaten:2, - }, - group:'hongfa_hp', - global:['hongfa_use','hongfa_respond'], - subSkill:{ - hp:{ - audio:true, - trigger:{player:'loseHpBefore'}, - filter:function(event,player){ - return player.getExpansions('huangjintianbingfu').length>0; }, - direct:true, - content:function(){ - 'step 0' - player.chooseCardButton(get.prompt('hongfa'),player.getExpansions('huangjintianbingfu')).set('ai',function(){ - return 1; - }); - 'step 1' - if(result.bool){ - player.logSkill('huangjintianbingfu'); + }, + }, + }, + hongfa: { + audio: 2, + derivation: "huangjintianbingfu", + unique: true, + forceunique: true, + lordSkill: true, + trigger: { player: "phaseZhunbeiBegin" }, + forced: true, + filter: function (event, player) { + return ( + player.getExpansions("huangjintianbingfu").length == 0 && get.population("qun") > 0 + ); + }, + content: function () { + var cards = get.cards(get.population("qun")); + player.addToExpansion(cards, "gain2").gaintag.add("huangjintianbingfu"); + }, + ai: { + threaten: 2, + }, + group: "hongfa_hp", + global: ["hongfa_use", "hongfa_respond"], + subSkill: { + hp: { + audio: true, + trigger: { player: "loseHpBefore" }, + filter: function (event, player) { + return player.getExpansions("huangjintianbingfu").length > 0; + }, + direct: true, + content: function () { + "step 0"; + player + .chooseCardButton( + get.prompt("hongfa"), + player.getExpansions("huangjintianbingfu") + ) + .set("ai", function () { + return 1; + }); + "step 1"; + if (result.bool) { + player.logSkill("huangjintianbingfu"); player.loseToDiscardpile(result.links); trigger.cancel(); } - } - } - } + }, + }, + }, }, - wendao:{ - audio:2, - unique:true, - forceunique:true, - enable:'phaseUse', - usable:1, - filterCard:function(card){ - return get.name(card)!='taipingyaoshu'&&get.color(card)=='red'; + wendao: { + audio: 2, + unique: true, + forceunique: true, + enable: "phaseUse", + usable: 1, + filterCard: function (card) { + return get.name(card) != "taipingyaoshu" && get.color(card) == "red"; }, - position:'he', - check:function(card){ - return 6-get.value(card); + position: "he", + check: function (card) { + return 6 - get.value(card); }, - onChooseToUse:function(event){ - if(game.online) return; - event.set('wendao',function(){ - for(var i=0;i
      • 当你计算群势力角色数时,每一张“天兵”均可视为一名群势力角色。
      • 每当你失去体力时,你可改为将一张“天兵”置入弃牌堆。
      • 与你势力相同的角色可将一张“天兵”当【杀】使用或打出。',false) - } - } - }, - wuxin:{ - trigger:{player:'phaseDrawBegin1'}, - audio:2, - filter:function(event,player){ - return get.population('qun')>0; + dialog.addText( + '
        • 当你计算群势力角色数时,每一张“天兵”均可视为一名群势力角色。
        • 每当你失去体力时,你可改为将一张“天兵”置入弃牌堆。
        • 与你势力相同的角色可将一张“天兵”当【杀】使用或打出。', + false + ); + }, }, - content:function(){ - 'step 0' - var num=get.population('qun'); - if(player.hasSkill('huangjintianbingfu')){ - num+=player.getExpansions('huangjintianbingfu').length; + }, + wuxin: { + trigger: { player: "phaseDrawBegin1" }, + audio: 2, + filter: function (event, player) { + return get.population("qun") > 0; + }, + content: function () { + "step 0"; + var num = get.population("qun"); + if (player.hasSkill("huangjintianbingfu")) { + num += player.getExpansions("huangjintianbingfu").length; } - var cards=get.cards(num); + var cards = get.cards(num); game.cardsGotoOrdering(cards); - var next=player.chooseToMove('悟心:将卡牌以任意顺序置于牌堆顶'); - next.set('list',[['牌堆顶',cards]]); - next.set('processAI',function(list){ - var cards=list[0][1].slice(0); - cards.sort(function(a,b){ - return get.value(b)-get.value(a); + var next = player.chooseToMove("悟心:将卡牌以任意顺序置于牌堆顶"); + next.set("list", [["牌堆顶", cards]]); + next.set("processAI", function (list) { + var cards = list[0][1].slice(0); + cards.sort(function (a, b) { + return get.value(b) - get.value(a); }); return [cards]; - }) - 'step 1' - if(result.bool){ - var list=result.moved[0].slice(0); - while(list.length){ - ui.cardPile.insertBefore(list.pop(),ui.cardPile.firstChild); + }); + "step 1"; + if (result.bool) { + var list = result.moved[0].slice(0); + while (list.length) { + ui.cardPile.insertBefore(list.pop(), ui.cardPile.firstChild); } game.updateRoundNumber(); } - } + }, }, - zhangwu:{ - audio:2, - unique:true, - forceunique:true, - ai:{ - threaten:2, + zhangwu: { + audio: 2, + unique: true, + forceunique: true, + ai: { + threaten: 2, }, - trigger:{ - global:['loseAfter','cardsDiscardAfter','equipAfter'], + trigger: { + global: ["loseAfter", "cardsDiscardAfter", "equipAfter"], }, - forced:true, - filter:function(event,player){ - if(event.name=='equip'){ - if(player==event.player) return false; - if(event.card.name=='feilongduofeng'&&event.player.getCards('e').includes(event.card)) return true; - return event.player.hasHistory('lose',function(evt){ - if(evt.position!=ui.discardPile||evt.getParent().name!='equip') return false; - for(var i of evt.cards){ - if(i.name=='feilongduofeng'&&get.position(i,true)=='d') return true; + forced: true, + filter: function (event, player) { + if (event.name == "equip") { + if (player == event.player) return false; + if ( + event.card.name == "feilongduofeng" && + event.player.getCards("e").includes(event.card) + ) + return true; + return event.player.hasHistory("lose", function (evt) { + if (evt.position != ui.discardPile || evt.getParent().name != "equip") + return false; + for (var i of evt.cards) { + if (i.name == "feilongduofeng" && get.position(i, true) == "d") return true; } return false; - }) + }); } - if(event.name=='lose'&&(event.position!=ui.discardPile||event.getParent().name=='equip')) return false; - for(var i of event.cards){ - if(i.name=='feilongduofeng'&&get.position(i,true)=='d') return true; + if ( + event.name == "lose" && + (event.position != ui.discardPile || event.getParent().name == "equip") + ) + return false; + for (var i of event.cards) { + if (i.name == "feilongduofeng" && get.position(i, true) == "d") return true; } return false; }, - logTarget:function(event,player){ - if(event.name=='equip'&&event.card.name=='feilongduofeng'&&event.player.getCards('e').includes(event.card)) return event.player; + logTarget: function (event, player) { + if ( + event.name == "equip" && + event.card.name == "feilongduofeng" && + event.player.getCards("e").includes(event.card) + ) + return event.player; return []; }, - content:function(){ + content: function () { game.delayx(); - var cards=[]; - if(trigger.name=='equip'){ - if(trigger.card.name=='feilongduofeng'&&trigger.player.getCards('e').includes(trigger.card)) cards.push(trigger.card); - trigger.player.getHistory('lose',function(evt){ - if(evt.position!=ui.discardPile||evt.getParent()!=trigger) return false; - for(var i of evt.cards){ - if(i.name=='feilongduofeng'&&get.position(i,true)=='d') cards.push(i); + var cards = []; + if (trigger.name == "equip") { + if ( + trigger.card.name == "feilongduofeng" && + trigger.player.getCards("e").includes(trigger.card) + ) + cards.push(trigger.card); + trigger.player.getHistory("lose", function (evt) { + if (evt.position != ui.discardPile || evt.getParent() != trigger) return false; + for (var i of evt.cards) { + if (i.name == "feilongduofeng" && get.position(i, true) == "d") cards.push(i); } return false; - }) + }); } - if(trigger.name=='lose'){ - for(var i of trigger.cards){ - if(i.name=='feilongduofeng'&&get.position(i,true)=='d') cards.push(i); + if (trigger.name == "lose") { + for (var i of trigger.cards) { + if (i.name == "feilongduofeng" && get.position(i, true) == "d") cards.push(i); } } - var owner=get.owner(cards[0]); - if(owner) player.gain(cards,'give',owner,'bySelf'); - else player.gain(cards,'gain2'); + var owner = get.owner(cards[0]); + if (owner) player.gain(cards, "give", owner, "bySelf"); + else player.gain(cards, "gain2"); }, - group:'zhangwu_draw', - subSkill:{ - draw:{ - audio:'zhangwu', - trigger:{ - player:'loseEnd', - global:['equipEnd','addJudgeEnd','gainEnd','loseAsyncEnd','addToExpansionEnd'], + group: "zhangwu_draw", + subSkill: { + draw: { + audio: "zhangwu", + trigger: { + player: "loseEnd", + global: [ + "equipEnd", + "addJudgeEnd", + "gainEnd", + "loseAsyncEnd", + "addToExpansionEnd", + ], }, - filter:function(event,player){ - if(event.name=='lose'&&event.getParent().name=='useCard') return false; - var evt=event.getl(player); - return evt&&evt.player==player&&evt.cards2.filter(function(i){ - return i.name=='feilongduofeng'&&get.owner(i)!=player; - }).length>0; + filter: function (event, player) { + if (event.name == "lose" && event.getParent().name == "useCard") return false; + var evt = event.getl(player); + return ( + evt && + evt.player == player && + evt.cards2.filter(function (i) { + return i.name == "feilongduofeng" && get.owner(i) != player; + }).length > 0 + ); }, - forced:true, - content:function(){ - 'step 0' - var cards=[],evt=trigger.getl(player); - cards.addArray(evt.cards2.filter(function(i){ - return i.name=='feilongduofeng'&&get.owner(i)!=player; - })); - player.showCards(cards,get.translation(player)+'发动了【章武】'); - for(var i of cards){ - var owner=get.owner(i); - if(owner) owner.lose(i,ui.cardPile)._triggered=null; - else{ + forced: true, + content: function () { + "step 0"; + var cards = [], + evt = trigger.getl(player); + cards.addArray( + evt.cards2.filter(function (i) { + return i.name == "feilongduofeng" && get.owner(i) != player; + }) + ); + player.showCards(cards, get.translation(player) + "发动了【章武】"); + for (var i of cards) { + var owner = get.owner(i); + if (owner) owner.lose(i, ui.cardPile)._triggered = null; + else { i.fix(); ui.cardPile.appendChild(i); } } - 'step 1' + "step 1"; player.draw(2); }, }, }, }, - shouyue:{ - unique:true, - forceunique:true, - group:'wuhujiangdaqi', - derivation:'wuhujiangdaqi', - mark:true, - lordSkill:true, + shouyue: { + unique: true, + forceunique: true, + group: "wuhujiangdaqi", + derivation: "wuhujiangdaqi", + mark: true, + lordSkill: true, }, - wuhujiangdaqi:{ - unique:true, - forceunique:true, - nopop:true, - mark:true, - intro:{ - content:"@
          【武圣】
          将“红色牌”改为“任意牌”
          【咆哮】
          增加描述“你使用的【杀】无视其他角色的防具”
          【龙胆】
          增加描述“你每发动一次‘龙胆’便摸一张牌”
          【烈弓】
          增加描述“你的攻击范围+1”
          【铁骑】
          将“一张明置的武将牌”改为“所有明置的武将牌”
          ", - } - }, - jizhao:{ - derivation:'rerende', - unique:true, - audio:2, - enable:'chooseToUse', - mark:true, - skillAnimation:true, - animationColor:'fire', - init:function(player){ - player.storage.jizhao=false; + wuhujiangdaqi: { + unique: true, + forceunique: true, + nopop: true, + mark: true, + intro: { + content: + '@
          【武圣】
          将“红色牌”改为“任意牌”
          【咆哮】
          增加描述“你使用的【杀】无视其他角色的防具”
          【龙胆】
          增加描述“你每发动一次‘龙胆’便摸一张牌”
          【烈弓】
          增加描述“你的攻击范围+1”
          【铁骑】
          将“一张明置的武将牌”改为“所有明置的武将牌”
          ', }, - filter:function(event,player){ - if(player.storage.jizhao) return false; - if(event.type=='dying'){ - if(player!=event.dying) return false; + }, + jizhao: { + derivation: "rerende", + unique: true, + audio: 2, + enable: "chooseToUse", + mark: true, + skillAnimation: true, + animationColor: "fire", + init: function (player) { + player.storage.jizhao = false; + }, + filter: function (event, player) { + if (player.storage.jizhao) return false; + if (event.type == "dying") { + if (player != event.dying) return false; return true; } return false; }, - content:function(){ - 'step 0' - player.awakenSkill('jizhao'); - player.storage.jizhao=true; - var num=player.maxHp-player.countCards('h'); - if(num>0){ + content: function () { + "step 0"; + player.awakenSkill("jizhao"); + player.storage.jizhao = true; + var num = player.maxHp - player.countCards("h"); + if (num > 0) { player.draw(num); } - 'step 1' - if(player.hp<2){ - player.recover(2-player.hp); + "step 1"; + if (player.hp < 2) { + player.recover(2 - player.hp); } - 'step 2' - player.removeSkill('wuhujiangdaqi'); - player.changeSkills(['rerende'],['shouyue']); + "step 2"; + player.removeSkill("wuhujiangdaqi"); + player.changeSkills(["rerende"], ["shouyue"]); }, - ai:{ - order:1, - skillTagFilter:function(player,arg,target){ - if(player!=target||player.storage.jizhao) return false; + ai: { + order: 1, + skillTagFilter: function (player, arg, target) { + if (player != target || player.storage.jizhao) return false; }, - save:true, - result:{ - player:10 + save: true, + result: { + player: 10, }, }, - intro:{ - content:'limited' - } + intro: { + content: "limited", + }, }, - gzshoucheng:{ - inherit:'shoucheng', - audio:'shoucheng', - preHidden:true, - filter:function(event,player){ - return game.hasPlayer(function(current){ - if(current==_status.currentPhase||!current.isFriendOf(player)) return false; - var evt=event.getl(current); - return evt&&evt.hs&&evt.hs.length&¤t.countCards('h')==0; + gzshoucheng: { + inherit: "shoucheng", + audio: "shoucheng", + preHidden: true, + filter: function (event, player) { + return game.hasPlayer(function (current) { + if (current == _status.currentPhase || !current.isFriendOf(player)) return false; + var evt = event.getl(current); + return evt && evt.hs && evt.hs.length && current.countCards("h") == 0; }); }, - content:function(){ - "step 0" - event.list=game.filterPlayer(function(current){ - if(current==_status.currentPhase||!current.isFriendOf(player)) return false; - var evt=trigger.getl(current); - return evt&&evt.hs&&evt.hs.length; - }).sortBySeat(_status.currentPhase); - "step 1" - var target=event.list.shift(); - event.target=target; - if(target.isAlive()&&target.countCards('h')==0){ - player.chooseBool(get.prompt2('gzshoucheng',target)).set('ai',function(){ - return get.attitude(_status.event.player,_status.event.getParent().target)>0; - }).setHiddenSkill(event.name); - } - else event.goto(3); - "step 2" - if(result.bool){ - player.logSkill(event.name,target); + content: function () { + "step 0"; + event.list = game + .filterPlayer(function (current) { + if (current == _status.currentPhase || !current.isFriendOf(player)) return false; + var evt = trigger.getl(current); + return evt && evt.hs && evt.hs.length; + }) + .sortBySeat(_status.currentPhase); + "step 1"; + var target = event.list.shift(); + event.target = target; + if (target.isAlive() && target.countCards("h") == 0) { + player + .chooseBool(get.prompt2("gzshoucheng", target)) + .set("ai", function () { + return ( + get.attitude(_status.event.player, _status.event.getParent().target) > 0 + ); + }) + .setHiddenSkill(event.name); + } else event.goto(3); + "step 2"; + if (result.bool) { + player.logSkill(event.name, target); target.draw(); } - "step 3" - if(event.list.length) event.goto(1); + "step 3"; + if (event.list.length) event.goto(1); }, }, - gzyicheng:{ - audio:'yicheng', - trigger:{ - global:['useCardToPlayered','useCardToTargeted'], + gzyicheng: { + audio: "yicheng", + trigger: { + global: ["useCardToPlayered", "useCardToTargeted"], }, - preHidden:true, + preHidden: true, //frequent:true, - direct:true, - filter:function(event,player){ - if(event.card.name!='sha') return false; - if(event.name=='useCardToPlayered'&&!event.isFirstTarget) return false; - var target=lib.skill.gzyicheng.logTarget(event,player); - if(target==player) return true; - return target.inline(player)&&target.isAlive()&&player.hasSkill('gzyicheng'); + direct: true, + filter: function (event, player) { + if (event.card.name != "sha") return false; + if (event.name == "useCardToPlayered" && !event.isFirstTarget) return false; + var target = lib.skill.gzyicheng.logTarget(event, player); + if (target == player) return true; + return target.inline(player) && target.isAlive() && player.hasSkill("gzyicheng"); }, - logTarget:function(event,player){ - return event.name=='useCardToPlayered'?event.player:event.target; + logTarget: function (event, player) { + return event.name == "useCardToPlayered" ? event.player : event.target; }, - content:function(){ - 'step 0' - var target=lib.skill.gzyicheng.logTarget(trigger,player); - event.target=target; - target.chooseBool(get.prompt('gzyicheng'),'摸一张牌,然后弃置一张牌').set('frequentSkill','gzyicheng'); - 'step 1' - if(result.bool){ - player.logSkill('gzyicheng',target); + content: function () { + "step 0"; + var target = lib.skill.gzyicheng.logTarget(trigger, player); + event.target = target; + target + .chooseBool(get.prompt("gzyicheng"), "摸一张牌,然后弃置一张牌") + .set("frequentSkill", "gzyicheng"); + "step 1"; + if (result.bool) { + player.logSkill("gzyicheng", target); target.draw(); - target.chooseToDiscard('he',true); + target.chooseToDiscard("he", true); } }, }, - yicheng:{ - audio:2, - trigger:{global:'useCardToTargeted'}, - filter:function(event,player){ - return event.card.name=='sha'&&event.target.isFriendOf(player); + yicheng: { + audio: 2, + trigger: { global: "useCardToTargeted" }, + filter: function (event, player) { + return event.card.name == "sha" && event.target.isFriendOf(player); }, - preHidden:true, - logTarget:'target', - content:function(){ - 'step 0' + preHidden: true, + logTarget: "target", + content: function () { + "step 0"; trigger.target.draw(); - 'step 1' - trigger.target.chooseToDiscard('he',true); - } + "step 1"; + trigger.target.chooseToDiscard("he", true); + }, }, - gzjixi:{ - inherit:'jixi', - audio:'jixi', - mainSkill:true, - init:function(player){ - if(player.checkMainSkill('gzjixi')){ + gzjixi: { + inherit: "jixi", + audio: "jixi", + mainSkill: true, + init: function (player) { + if (player.checkMainSkill("gzjixi")) { player.removeMaxHp(); } - } + }, }, - ziliang:{ - audio:2, - trigger:{global:'damageEnd'}, - filter:function(event,player){ - return event.player.isIn()&&event.player.isFriendOf(player)&&player.getExpansions('tuntian').length; + ziliang: { + audio: 2, + trigger: { global: "damageEnd" }, + filter: function (event, player) { + return ( + event.player.isIn() && + event.player.isFriendOf(player) && + player.getExpansions("tuntian").length + ); }, - init:function(player){ - player.checkViceSkill('ziliang'); + init: function (player) { + player.checkViceSkill("ziliang"); }, - viceSkill:true, - direct:true, - content:function(){ - 'step 0' - player.chooseCardButton(get.prompt('ziliang',trigger.player),player.getExpansions('tuntian')).set('ai',function(button){ - return get.value(button.link); - }); - 'step 1' - if(result.bool){ - var card=result.links[0]; - player.logSkill('ziliang',trigger.player); - player.give(card,trigger.player); + viceSkill: true, + direct: true, + content: function () { + "step 0"; + player + .chooseCardButton( + get.prompt("ziliang", trigger.player), + player.getExpansions("tuntian") + ) + .set("ai", function (button) { + return get.value(button.link); + }); + "step 1"; + if (result.bool) { + var card = result.links[0]; + player.logSkill("ziliang", trigger.player); + player.give(card, trigger.player); } - } - }, - gzhuyuan:{ - audio:'huyuan', - trigger:{player:'phaseJieshuBegin'}, - direct:true, - preHidden:true, - filter:function(event,player){ - return player.countCards('he')>0; }, - content:function(){ - 'step 0' - player.chooseCardTarget({ - filterCard:true, - position:'he', - filterTarget:function(card,player,target){ - if(player==target) return false; - var card=ui.selected.cards[0]; - if(get.type(card)!='equip') return true; - return target.canEquip(card); - }, - prompt:get.prompt2('gzhuyuan'), - complexSelect:true, - ai1:function(card){ - if(!_status.event.goon) return false; - var player=_status.event.player; - if(get.type(card)!='equip') return 0; - return 7.5-get.value(card); - }, - ai2:function(target){ - if(!_status.event.goon) return false; - var player=_status.event.player,card=ui.selected.cards[0]; - return get.effect(target,card,player,player); - }, - goon:game.hasPlayer(function(current){ - return get.effect(current,{name:'guohe_copy',position:'ej'},player,player)>0; + }, + gzhuyuan: { + audio: "huyuan", + trigger: { player: "phaseJieshuBegin" }, + direct: true, + preHidden: true, + filter: function (event, player) { + return player.countCards("he") > 0; + }, + content: function () { + "step 0"; + player + .chooseCardTarget({ + filterCard: true, + position: "he", + filterTarget: function (card, player, target) { + if (player == target) return false; + var card = ui.selected.cards[0]; + if (get.type(card) != "equip") return true; + return target.canEquip(card); + }, + prompt: get.prompt2("gzhuyuan"), + complexSelect: true, + ai1: function (card) { + if (!_status.event.goon) return false; + var player = _status.event.player; + if (get.type(card) != "equip") return 0; + return 7.5 - get.value(card); + }, + ai2: function (target) { + if (!_status.event.goon) return false; + var player = _status.event.player, + card = ui.selected.cards[0]; + return get.effect(target, card, player, player); + }, + goon: game.hasPlayer(function (current) { + return ( + get.effect( + current, + { name: "guohe_copy", position: "ej" }, + player, + player + ) > 0 + ); + }), }) - }).setHiddenSkill('gzhuyuan'); - 'step 1' - if(result.bool){ - var target=result.targets[0],card=result.cards[0]; - player.logSkill('gzhuyuan',target); - if(get.type(card)=='equip'){ - player.$give(card,target,false); + .setHiddenSkill("gzhuyuan"); + "step 1"; + if (result.bool) { + var target = result.targets[0], + card = result.cards[0]; + player.logSkill("gzhuyuan", target); + if (get.type(card) == "equip") { + player.$give(card, target, false); game.delayx(); target.equip(card); - } - else{ - player.give(card,target); + } else { + player.give(card, target); event.finish(); } - } - else event.finish(); - 'step 2' - if(game.hasPlayer(function(current){ - return current.hasCard(function(card){ - return lib.filter.canBeDiscarded(card,player,current); - },'ej'); - })){ - player.chooseTarget('是否弃置场上的一张牌?',function(card,player,target){ - return target.hasCard(function(card){ - return lib.filter.canBeDiscarded(card,player,target); - },'ej'); - }).set('ai',function(target){ - const player=_status.event.player; - return get.effect(target,{name:'guohe_copy',position:'ej'},player,player); + } else event.finish(); + "step 2"; + if ( + game.hasPlayer(function (current) { + return current.hasCard(function (card) { + return lib.filter.canBeDiscarded(card, player, current); + }, "ej"); }) - } - else event.finish(); - 'step 3' - if(result.bool){ - var target=result.targets[0]; - player.line(target,'thunder'); - player.discardPlayerCard(target,true,'ej'); + ) { + player + .chooseTarget("是否弃置场上的一张牌?", function (card, player, target) { + return target.hasCard(function (card) { + return lib.filter.canBeDiscarded(card, player, target); + }, "ej"); + }) + .set("ai", function (target) { + const player = _status.event.player; + return get.effect( + target, + { name: "guohe_copy", position: "ej" }, + player, + player + ); + }); + } else event.finish(); + "step 3"; + if (result.bool) { + var target = result.targets[0]; + player.line(target, "thunder"); + player.discardPlayerCard(target, true, "ej"); } }, }, - huyuan:{ - audio:2, - trigger:{player:'phaseJieshuBegin'}, - direct:true, - preHidden:true, - filter:function(event,player){ - return player.countCards('he',{type:'equip'})>0; + huyuan: { + audio: 2, + trigger: { player: "phaseJieshuBegin" }, + direct: true, + preHidden: true, + filter: function (event, player) { + return player.countCards("he", { type: "equip" }) > 0; }, - content:function(){ - "step 0" - player.chooseCardTarget({ - filterCard:function(card){ - return get.type(card)=='equip'; - }, - position:'he', - filterTarget:function(card,player,target){ - return target.canEquip(card); - }, - ai1:function(card){ - return 6-get.value(card); - }, - ai2:function(target){ - return get.attitude(_status.event.player,target)-3; - }, - prompt:get.prompt2('huyuan') - }).setHiddenSkill('huyuan'); - "step 1" - if(result.bool){ - var target=result.targets[0]; - player.logSkill('huyuan',target); - event.current=target; + content: function () { + "step 0"; + player + .chooseCardTarget({ + filterCard: function (card) { + return get.type(card) == "equip"; + }, + position: "he", + filterTarget: function (card, player, target) { + return target.canEquip(card); + }, + ai1: function (card) { + return 6 - get.value(card); + }, + ai2: function (target) { + return get.attitude(_status.event.player, target) - 3; + }, + prompt: get.prompt2("huyuan"), + }) + .setHiddenSkill("huyuan"); + "step 1"; + if (result.bool) { + var target = result.targets[0]; + player.logSkill("huyuan", target); + event.current = target; target.equip(result.cards[0]); - if(target!=player){ - player.$give(result.cards,target,false); + if (target != player) { + player.$give(result.cards, target, false); game.delay(2); } - player.chooseTarget('弃置一名角色的一张牌',function(card,player,target){ - var source=_status.event.source; - return get.distance(source,target)<=1&&source!=target&&target.countCards('he'); - }).set('ai',function(target){ - var player=_status.event.player; - return get.effect(target,{name:'guohe_copy2'},player,player); - }).set('source',target); - } - else{ + player + .chooseTarget("弃置一名角色的一张牌", function (card, player, target) { + var source = _status.event.source; + return ( + get.distance(source, target) <= 1 && + source != target && + target.countCards("he") + ); + }) + .set("ai", function (target) { + var player = _status.event.player; + return get.effect(target, { name: "guohe_copy2" }, player, player); + }) + .set("source", target); + } else { event.finish(); } - "step 2" - if(result.bool&&result.targets.length){ - event.current.line(result.targets,'green'); - player.discardPlayerCard(true,result.targets[0],'he'); + "step 2"; + if (result.bool && result.targets.length) { + event.current.line(result.targets, "green"); + player.discardPlayerCard(true, result.targets[0], "he"); } }, }, - heyi:{ - zhenfa:'inline', - global:'heyi_distance' + heyi: { + zhenfa: "inline", + global: "heyi_distance", }, - heyi_distance:{ - mod:{ - globalTo:function(from,to,distance){ - if(game.hasPlayer(function(current){ - return current.hasSkill('heyi')&¤t.inline(to); - })){ - return distance+1; + heyi_distance: { + mod: { + globalTo: function (from, to, distance) { + if ( + game.hasPlayer(function (current) { + return current.hasSkill("heyi") && current.inline(to); + }) + ) { + return distance + 1; } - } - } - }, - tianfu:{ - init:function(player){ - player.checkMainSkill('tianfu'); - }, - mainSkill:true, - inherit:'kanpo', - zhenfa:'inline', - viewAsFilter:function(player){ - return _status.currentPhase&&_status.currentPhase.inline(player)&&!player.hasSkill('kanpo')&&player.countCards('h',{color:'black'})>0; + }, }, }, - yizhi:{ - init:function(player){ - if(player.checkViceSkill('yizhi')&&!player.viceChanged){ + tianfu: { + init: function (player) { + player.checkMainSkill("tianfu"); + }, + mainSkill: true, + inherit: "kanpo", + zhenfa: "inline", + viewAsFilter: function (player) { + return ( + _status.currentPhase && + _status.currentPhase.inline(player) && + !player.hasSkill("kanpo") && + player.countCards("h", { color: "black" }) > 0 + ); + }, + }, + yizhi: { + init: function (player) { + if (player.checkViceSkill("yizhi") && !player.viceChanged) { player.removeMaxHp(); } }, - viceSkill:true, - inherit:'guanxing', - filter:function(event,player){ - return !player.hasSkill('guanxing'); - } + viceSkill: true, + inherit: "guanxing", + filter: function (event, player) { + return !player.hasSkill("guanxing"); + }, }, - gzshangyi:{ - audio:'shangyi', - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return player.countCards('h')>0; + gzshangyi: { + audio: "shangyi", + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + return player.countCards("h") > 0; }, - filterTarget:function(card,player,target){ - return player!=target&&(target.countCards('h')||target.isUnseen(2)); + filterTarget: function (card, player, target) { + return player != target && (target.countCards("h") || target.isUnseen(2)); }, - content:function(){ - "step 0" + content: function () { + "step 0"; target.viewHandcards(player); - "step 1" - if(!target.countCards('h')){ - event._result={index:1}; + "step 1"; + if (!target.countCards("h")) { + event._result = { index: 1 }; + } else if (!target.isUnseen(2)) { + event._result = { index: 0 }; + } else { + player + .chooseControl() + .set("choiceList", [ + "观看" + get.translation(target) + "的手牌并可以弃置其中的一张黑色牌", + "观看" + get.translation(target) + "的所有暗置的武将牌", + ]); } - else if(!target.isUnseen(2)){ - event._result={index:0}; - } - else{ - player.chooseControl().set('choiceList',[ - '观看'+get.translation(target)+'的手牌并可以弃置其中的一张黑色牌', - '观看'+get.translation(target)+'的所有暗置的武将牌', - ]); - } - "step 2" - if(result.index==0){ - player.discardPlayerCard(target,'h').set('filterButton',function(button){ - return get.color(button.link)=='black'; - }).set('visible',true); - } - else{ - player.viewCharacter(target,2); + "step 2"; + if (result.index == 0) { + player + .discardPlayerCard(target, "h") + .set("filterButton", function (button) { + return get.color(button.link) == "black"; + }) + .set("visible", true); + } else { + player.viewCharacter(target, 2); } }, - ai:{ - order:11, - result:{ - target:function(player,target){ - return -target.countCards('h'); - } + ai: { + order: 11, + result: { + target: function (player, target) { + return -target.countCards("h"); + }, }, - threaten:1.1 + threaten: 1.1, }, }, - niaoxiang:{ - zhenfa:'siege', - audio:'zniaoxiang', - global:'niaoxiang_sha', - preHidden:true, - trigger:{global:'useCardToPlayered'}, - filter:function(event,player){ - if(event.card.name!='sha') return false; - if(game.countPlayer()<4) return false; - return player.siege(event.target)&&event.player.siege(event.target); + niaoxiang: { + zhenfa: "siege", + audio: "zniaoxiang", + global: "niaoxiang_sha", + preHidden: true, + trigger: { global: "useCardToPlayered" }, + filter: function (event, player) { + if (event.card.name != "sha") return false; + if (game.countPlayer() < 4) return false; + return player.siege(event.target) && event.player.siege(event.target); }, - forced:true, - forceaudio:true, - logTarget:'target', - content:function(){ - var id=trigger.target.playerid; - var map=trigger.getParent().customArgs; - if(!map[id]) map[id]={}; - if(typeof map[id].shanRequired=='number'){ + forced: true, + forceaudio: true, + logTarget: "target", + content: function () { + var id = trigger.target.playerid; + var map = trigger.getParent().customArgs; + if (!map[id]) map[id] = {}; + if (typeof map[id].shanRequired == "number") { map[id].shanRequired++; + } else { + map[id].shanRequired = 2; } - else{ - map[id].shanRequired=2; - } - } - }, - fengshi:{ - audio:'zfengshi', - zhenfa:'siege', - trigger:{global:'useCardToPlayered'}, - filter:function(event,player){ - if(event.card.name!='sha'||game.countPlayer()<4) return false; - return player.siege(event.target)&&event.player.siege(event.target)&&event.target.countCards('e'); }, - logTarget:'target', - content:function(){ - trigger.target.chooseToDiscard('e',true); - } }, - gzguixiu:{ - audio:'guixiu', - trigger:{player:['showCharacterAfter','removeCharacterBefore']}, - filter:function(event,player){ - if(event.name=='removeCharacter'||event.name=='changeVice') return event.toRemove=='gz_mifuren'&&player.isDamaged(); - return event.toShow.includes('gz_mifuren'); + fengshi: { + audio: "zfengshi", + zhenfa: "siege", + trigger: { global: "useCardToPlayered" }, + filter: function (event, player) { + if (event.card.name != "sha" || game.countPlayer() < 4) return false; + return ( + player.siege(event.target) && + event.player.siege(event.target) && + event.target.countCards("e") + ); }, - content:function(){ - if(trigger.name=='showCharacter'){ + logTarget: "target", + content: function () { + trigger.target.chooseToDiscard("e", true); + }, + }, + gzguixiu: { + audio: "guixiu", + trigger: { player: ["showCharacterAfter", "removeCharacterBefore"] }, + filter: function (event, player) { + if (event.name == "removeCharacter" || event.name == "changeVice") + return event.toRemove == "gz_mifuren" && player.isDamaged(); + return event.toShow.includes("gz_mifuren"); + }, + content: function () { + if (trigger.name == "showCharacter") { player.draw(2); - } - else{ + } else { player.recover(); } }, }, - gzcunsi:{ - derivation:'gzyongjue', - enable:'phaseUse', - audio:'cunsi', - filter:function(event,player){ - return player.checkMainSkill('gzcunsi',false)||player.checkViceSkill('gzcunsi',false); + gzcunsi: { + derivation: "gzyongjue", + enable: "phaseUse", + audio: "cunsi", + filter: function (event, player) { + return player.checkMainSkill("gzcunsi", false) || player.checkViceSkill("gzcunsi", false); }, - unique:true, - forceunique:true, - filterTarget:true, - skillAnimation:true, - animationColor:'orange', - content:function(){ - 'step 0' - if(player.checkMainSkill('gzcunsi',false)){ + unique: true, + forceunique: true, + filterTarget: true, + skillAnimation: true, + animationColor: "orange", + content: function () { + "step 0"; + if (player.checkMainSkill("gzcunsi", false)) { player.removeCharacter(0); - } - else{ + } else { player.removeCharacter(1); } - 'step 1' - target.addSkills('gzyongjue'); - if(target!=player){ + "step 1"; + target.addSkills("gzyongjue"); + if (target != player) { target.draw(2); } }, - ai:{ - order:9, - result:{ - player:function(player,target){ - var num=0; - if(player.isDamaged()&&target.isFriendOf(player)){ + ai: { + order: 9, + result: { + player: function (player, target) { + var num = 0; + if (player.isDamaged() && target.isFriendOf(player)) { num++; - if(target.hasSkill('kanpo')) num+=0.5; - if(target.hasSkill('liegong')) num+=0.5; - if(target.hasSkill('tieji')) num+=0.5; - if(target.hasSkill('gzrende')) num+=1.2; - if(target.hasSkill('longdan')) num+=1.2; - if(target.hasSkill('paoxiao')) num+=1.2; - if(target.hasSkill('zhangwu')) num+=1.5; - if(target!=player) num+=0.5; + if (target.hasSkill("kanpo")) num += 0.5; + if (target.hasSkill("liegong")) num += 0.5; + if (target.hasSkill("tieji")) num += 0.5; + if (target.hasSkill("gzrende")) num += 1.2; + if (target.hasSkill("longdan")) num += 1.2; + if (target.hasSkill("paoxiao")) num += 1.2; + if (target.hasSkill("zhangwu")) num += 1.5; + if (target != player) num += 0.5; } return num; - } - } - } + }, + }, + }, }, - gzyongjue:{ - audio:'yongjue', - trigger:{global:'useCardAfter'}, - filter:function(event,player){ - if(event==event.player.getHistory('useCard')[0]&&event.card.name=='sha'&&_status.currentPhase==event.player&&event.player.isFriendOf(player)){ - for(var i=0;i0&&event.source&&event.source.isUnseen(2); + gzmingshi: { + audio: "mingshi", + trigger: { player: "damageBegin3" }, + forced: true, + preHidden: true, + filter: function (event, player) { + return event.num > 0 && event.source && event.source.isUnseen(2); }, - content:function(){ + content: function () { trigger.num--; }, - ai:{ - effect:{ - target:function(card,player,target){ - if(player.hasSkillTag('jueqing',false,target)) return; - if(!player.isUnseen(2)) return; - var num=get.tag(card,'damage'); - if(num){ - if(num>1) return 0.5; + ai: { + effect: { + target: function (card, player, target) { + if (player.hasSkillTag("jueqing", false, target)) return; + if (!player.isUnseen(2)) return; + var num = get.tag(card, "damage"); + if (num) { + if (num > 1) return 0.5; return 0; } - } - } + }, + }, }, }, - hunshang:{ - init:function(player){ - if(player.checkViceSkill('hunshang')&&!player.viceChanged){ + hunshang: { + init: function (player) { + if (player.checkViceSkill("hunshang") && !player.viceChanged) { player.removeMaxHp(); } }, - group:['hunshang_yingzi','hunshang_yinghun'], + group: ["hunshang_yingzi", "hunshang_yinghun"], }, - reyingzi_sunce:{audio:2}, - yinghun_sunce:{audio:2}, - hunshang_yingzi:{ - inherit:'yingzi', - audio:'reyingzi_sunce', - filter:function(event,player){ - return player.hp<=1&&!player.hasSkill('yingzi'); - } + reyingzi_sunce: { audio: 2 }, + yinghun_sunce: { audio: 2 }, + hunshang_yingzi: { + inherit: "yingzi", + audio: "reyingzi_sunce", + filter: function (event, player) { + return player.hp <= 1 && !player.hasSkill("yingzi"); + }, }, - hunshang_yinghun:{ - inherit:'yinghun', - audio:'yinghun_sunce', - filter:function(event,player){ - return player.hp<=1&&player.isDamaged()&&!player.hasSkill('yinghun'); - } + hunshang_yinghun: { + inherit: "yinghun", + audio: "yinghun_sunce", + filter: function (event, player) { + return player.hp <= 1 && player.isDamaged() && !player.hasSkill("yinghun"); + }, }, - yingyang:{ - audio:2, - trigger:{player:'compare',target:'compare'}, - filter:function(event){ + yingyang: { + audio: 2, + trigger: { player: "compare", target: "compare" }, + filter: function (event) { return !event.iwhile; }, - direct:true, - preHidden:true, - content:function(){ - 'step 0' - player.chooseControl('点数+3','点数-3','cancel2').set('prompt',get.prompt2('yingyang')).set('ai',function(){ - if(_status.event.small) return 1; - else return 0; - }).set('small',trigger.small); - 'step 1' - if(result.index!=2){ - player.logSkill('yingyang'); - if(result.index==0){ - game.log(player,'拼点牌点数+3'); - if(player==trigger.player){ - trigger.num1+=3; - if(trigger.num1>13) trigger.num1=13; + direct: true, + preHidden: true, + content: function () { + "step 0"; + player + .chooseControl("点数+3", "点数-3", "cancel2") + .set("prompt", get.prompt2("yingyang")) + .set("ai", function () { + if (_status.event.small) return 1; + else return 0; + }) + .set("small", trigger.small); + "step 1"; + if (result.index != 2) { + player.logSkill("yingyang"); + if (result.index == 0) { + game.log(player, "拼点牌点数+3"); + if (player == trigger.player) { + trigger.num1 += 3; + if (trigger.num1 > 13) trigger.num1 = 13; + } else { + trigger.num2 += 3; + if (trigger.num2 > 13) trigger.num2 = 13; } - else{ - trigger.num2+=3; - if(trigger.num2>13) trigger.num2=13; - } - } - else{ - game.log(player,'拼点牌点数-3'); - if(player==trigger.player){ - trigger.num1-=3; - if(trigger.num1<1) trigger.num1=1; - } - else{ - trigger.num2-=3; - if(trigger.num2<1) trigger.num2=1; + } else { + game.log(player, "拼点牌点数-3"); + if (player == trigger.player) { + trigger.num1 -= 3; + if (trigger.num1 < 1) trigger.num1 = 1; + } else { + trigger.num2 -= 3; + if (trigger.num2 < 1) trigger.num2 = 1; } } } - } + }, }, - gzqianxi:{ - audio:'qianxi', - trigger:{player:'phaseZhunbeiBegin'}, - content:function(){ - "step 0" + gzqianxi: { + audio: "qianxi", + trigger: { player: "phaseZhunbeiBegin" }, + content: function () { + "step 0"; player.judge(); - "step 1" - event.color=result.color; - player.chooseTarget(function(card,player,target){ - return player!=target&&get.distance(player,target)<=1; - },true).set('ai',function(target){ - return -get.attitude(_status.event.player,target); - }); - "step 2" - if(result.bool&&result.targets.length){ - result.targets[0].storage.qianxi2=event.color; - result.targets[0].addSkill('qianxi2'); - player.line(result.targets,'green'); - game.addVideo('storage',result.targets[0],['qianxi2',event.color]); + "step 1"; + event.color = result.color; + player + .chooseTarget(function (card, player, target) { + return player != target && get.distance(player, target) <= 1; + }, true) + .set("ai", function (target) { + return -get.attitude(_status.event.player, target); + }); + "step 2"; + if (result.bool && result.targets.length) { + result.targets[0].storage.qianxi2 = event.color; + result.targets[0].addSkill("qianxi2"); + player.line(result.targets, "green"); + game.addVideo("storage", result.targets[0], ["qianxi2", event.color]); } }, }, - gzduanchang:{ - audio:'duanchang', - trigger:{player:'die'}, - forced:true, - forceDie:true, - filter:function(event,player){ - return event.source&&event.source.isIn()&&event.source!=player&& - (event.source.hasMainCharacter()||event.source.hasViceCharacter()); + gzduanchang: { + audio: "duanchang", + trigger: { player: "die" }, + forced: true, + forceDie: true, + filter: function (event, player) { + return ( + event.source && + event.source.isIn() && + event.source != player && + (event.source.hasMainCharacter() || event.source.hasViceCharacter()) + ); }, - content:function(){ - 'step 0' - if(!trigger.source.hasViceCharacter()){ - event._result={control:'主将'} + content: function () { + "step 0"; + if (!trigger.source.hasViceCharacter()) { + event._result = { control: "主将" }; + } else if (!trigger.source.hasMainCharacter()) { + event._result = { control: "副将" }; + } else { + player + .chooseControl("主将", "副将", function () { + return _status.event.choice; + }) + .set( + "prompt", + "令" + get.translation(trigger.source) + "失去一张武将牌的所有技能" + ) + .set("forceDie", true) + .set( + "choice", + (function () { + var rank = + get.guozhanRank(trigger.source.name1, trigger.source) - + get.guozhanRank(trigger.source.name2, trigger.source); + if (rank == 0) rank = Math.random() > 0.5 ? 1 : -1; + return rank * get.attitude(player, trigger.source) > 0 ? "副将" : "主将"; + })() + ); } - else if(!trigger.source.hasMainCharacter()){ - event._result={control:'副将'} - } - else{ - player.chooseControl('主将','副将',function(){ - return _status.event.choice; - }).set('prompt','令'+get.translation(trigger.source)+'失去一张武将牌的所有技能').set('forceDie',true).set('choice',function(){ - var rank=get.guozhanRank(trigger.source.name1,trigger.source)-get.guozhanRank(trigger.source.name2,trigger.source); - if(rank==0) rank=Math.random()>0.5?1:-1; - return (rank*get.attitude(player,trigger.source))>0?'副将':'主将'; - }()); - } - 'step 1' + "step 1"; var skills; - if(result.control=='主将'){ + if (result.control == "主将") { trigger.source.showCharacter(0); - game.broadcastAll(function(player){ - player.node.avatar.classList.add('disabled'); - },trigger.source); - skills=lib.character[trigger.source.name][3]; - game.log(trigger.source,'失去了主将技能'); - } - else{ + game.broadcastAll(function (player) { + player.node.avatar.classList.add("disabled"); + }, trigger.source); + skills = lib.character[trigger.source.name][3]; + game.log(trigger.source, "失去了主将技能"); + } else { trigger.source.showCharacter(1); - game.broadcastAll(function(player){ - player.node.avatar2.classList.add('disabled'); - },trigger.source); - skills=lib.character[trigger.source.name2][3]; - game.log(trigger.source,'失去了副将技能'); + game.broadcastAll(function (player) { + player.node.avatar2.classList.add("disabled"); + }, trigger.source); + skills = lib.character[trigger.source.name2][3]; + game.log(trigger.source, "失去了副将技能"); } - var list=[]; - for(var i=0;i2) return 0; - if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0; - if(!ui.selected.cards.length&&card.name=='du') return 20; - var player=get.owner(card); - if(player.hp==player.maxHp||player.storage.gzrende<0||player.countCards('h')+player.storage.gzrende<=2){ - if(ui.selected.cards.length){ + }, + gzrende: { + audio: "rende", + group: ["gzrende1"], + enable: "phaseUse", + filterCard: true, + selectCard: [1, Infinity], + discard: false, + prepare: "give", + filterTarget: function (card, player, target) { + return player != target; + }, + check: function (card) { + if (ui.selected.cards.length > 2) return 0; + if (ui.selected.cards.length && ui.selected.cards[0].name == "du") return 0; + if (!ui.selected.cards.length && card.name == "du") return 20; + var player = get.owner(card); + if ( + player.hp == player.maxHp || + player.storage.gzrende < 0 || + player.countCards("h") + player.storage.gzrende <= 2 + ) { + if (ui.selected.cards.length) { return -1; } - var players=game.filterPlayer(); - for(var i=0;i=3&& - get.attitude(players[i],player)>=3){ - return 11-get.value(card); + var players = game.filterPlayer(); + for (var i = 0; i < players.length; i++) { + if ( + players[i].hasSkill("haoshi") && + !players[i].isTurnedOver() && + !players[i].hasJudge("lebu") && + get.attitude(player, players[i]) >= 3 && + get.attitude(players[i], player) >= 3 + ) { + return 11 - get.value(card); } } - if(player.countCards('h')>player.hp) return 10-get.value(card); - if(player.countCards('h')>2) return 6-get.value(card); + if (player.countCards("h") > player.hp) return 10 - get.value(card); + if (player.countCards("h") > 2) return 6 - get.value(card); return -1; } - return 10-get.value(card); + return 10 - get.value(card); }, - content:function(){ - target.gain(cards,player); - if(typeof player.storage.gzrende!='number'){ - player.storage.gzrende=0; + content: function () { + target.gain(cards, player); + if (typeof player.storage.gzrende != "number") { + player.storage.gzrende = 0; } - if(player.storage.gzrende>=0){ - player.storage.gzrende+=cards.length; - if(player.storage.gzrende>=3){ + if (player.storage.gzrende >= 0) { + player.storage.gzrende += cards.length; + if (player.storage.gzrende >= 3) { player.recover(); - player.storage.gzrende=-1; + player.storage.gzrende = -1; } } }, - ai:{ - order:function(skill,player){ - if(player.hp==player.maxHp||player.storage.gzrende<0||player.countCards('h')+player.storage.gzrende<=2){ + ai: { + order: function (skill, player) { + if ( + player.hp == player.maxHp || + player.storage.gzrende < 0 || + player.countCards("h") + player.storage.gzrende <= 2 + ) { return 1; } return 10; }, - result:{ - target:function(player,target){ - if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ + result: { + target: function (player, target) { + if (ui.selected.cards.length && ui.selected.cards[0].name == "du") { return -10; } - if(target.hasJudge('lebu')) return 0; - var nh=target.countCards('h'); - var np=player.countCards('h'); - if(player.hp==player.maxHp||player.storage.gzrende<0||player.countCards('h')+player.storage.gzrende<=2){ - if(nh>=np-1&&np<=player.hp&&!target.hasSkill('haoshi')) return 0; + if (target.hasJudge("lebu")) return 0; + var nh = target.countCards("h"); + var np = player.countCards("h"); + if ( + player.hp == player.maxHp || + player.storage.gzrende < 0 || + player.countCards("h") + player.storage.gzrende <= 2 + ) { + if (nh >= np - 1 && np <= player.hp && !target.hasSkill("haoshi")) return 0; } - return Math.max(1,5-nh); - } + return Math.max(1, 5 - nh); + }, }, - effect:{ - target:function(card,player,target){ - if(player==target&&get.type(card)=='equip'){ - if(player.countCards('e',{subtype:get.subtype(card)})){ - var players=game.filterPlayer(); - for(var i=0;i0){ + effect: { + target: function (card, player, target) { + if (player == target && get.type(card) == "equip") { + if (player.countCards("e", { subtype: get.subtype(card) })) { + var players = game.filterPlayer(); + for (var i = 0; i < players.length; i++) { + if (players[i] != player && get.attitude(player, players[i]) > 0) { return 0; } } } } - } + }, }, - threaten:0.8 - } + threaten: 0.8, + }, }, - gzrende1:{ - trigger:{player:'phaseUseBegin'}, - silent:true, - content:function(){ - player.storage.gzrende=0; - } + gzrende1: { + trigger: { player: "phaseUseBegin" }, + silent: true, + content: function () { + player.storage.gzrende = 0; + }, }, - gzzhiheng:{ - inherit:'zhiheng', - audio:'zhiheng', - selectCard:function(){ - var player=_status.event.player; - var range1=[1,player.maxHp]; - if(player.hasSkill('dinglanyemingzhu_skill')){ - for(var i=0;i0; + complexCard: true, + complexSelect: true, + prompt: function () { + var player = _status.event.player; + if (player.hasSkill("dinglanyemingzhu_skill")) + return "出牌阶段限一次,你可以弃置任意张牌,然后摸等量的牌"; + return "出牌阶段限一次,你可以弃置至多X张牌(X为你的体力上限),然后摸等量的牌"; }, - check:function(card){ - return 5-get.value(card); - } }, - gzxiaoguo:{ - inherit:'xiaoguo', - audio:'xiaoguo', - preHidden:true, - content:function(){ - "step 0" - var nono=(Math.abs(get.attitude(player,trigger.player))<3); - if(get.damageEffect(trigger.player,player,player)<=0){ - nono=true; + duoshi: { + enable: "chooseToUse", + viewAs: { name: "yiyi" }, + usable: 4, + filterCard: { color: "red" }, + position: "hs", + viewAsFilter: function (player) { + return player.countCards("hs", { color: "red" }) > 0; + }, + check: function (card) { + return 5 - get.value(card); + }, + }, + gzxiaoguo: { + inherit: "xiaoguo", + audio: "xiaoguo", + preHidden: true, + content: function () { + "step 0"; + var nono = Math.abs(get.attitude(player, trigger.player)) < 3; + if (get.damageEffect(trigger.player, player, player) <= 0) { + nono = true; } - var next=player.chooseToDiscard(get.prompt2('gzxiaoguo',trigger.player),{type:'basic'}); - next.set('ai',function(card){ - if(_status.event.nono) return 0; - return 8-get.useful(card); + var next = player.chooseToDiscard(get.prompt2("gzxiaoguo", trigger.player), { + type: "basic", }); - next.set('logSkill',['gzxiaoguo',trigger.player]); - next.set('nono',nono); - next.setHiddenSkill('gzxiaoguo'); - "step 1" - if(result.bool){ - var nono=(get.damageEffect(trigger.player,player,trigger.player)>=0); - trigger.player.chooseToDiscard('弃置一张装备牌,或受到1点伤害','he',{type:'equip'}).set('ai',function(card){ - if(_status.event.nono){ - return 0; - } - if(_status.event.player.hp==1) return 10-get.value(card); - return 9-get.value(card); - }).set('nono',nono); - } - else{ + next.set("ai", function (card) { + if (_status.event.nono) return 0; + return 8 - get.useful(card); + }); + next.set("logSkill", ["gzxiaoguo", trigger.player]); + next.set("nono", nono); + next.setHiddenSkill("gzxiaoguo"); + "step 1"; + if (result.bool) { + var nono = get.damageEffect(trigger.player, player, trigger.player) >= 0; + trigger.player + .chooseToDiscard("弃置一张装备牌,或受到1点伤害", "he", { type: "equip" }) + .set("ai", function (card) { + if (_status.event.nono) { + return 0; + } + if (_status.event.player.hp == 1) return 10 - get.value(card); + return 9 - get.value(card); + }) + .set("nono", nono); + } else { event.finish(); } - "step 2" - if(!result.bool){ + "step 2"; + if (!result.bool) { trigger.player.damage(); } }, }, - _mingzhi1:{ - trigger:{player:'phaseBeginStart'}, + _mingzhi1: { + trigger: { player: "phaseBeginStart" }, //priority:19, - ruleSkill:true, - forced:true, - popup:false, - filter:function(event,player){ - return player.isUnseen(2)&&!player.hasSkillTag('nomingzhi',false,null,true); + ruleSkill: true, + forced: true, + popup: false, + filter: function (event, player) { + return player.isUnseen(2) && !player.hasSkillTag("nomingzhi", false, null, true); }, - content:function(){ - 'step 0' - if(player.phaseNumber==1&&player.isUnseen(0)&&(_status.connectMode?lib.configOL.junzhu:get.config('junzhu'))){ - var name=player.name1; - if(name.indexOf('gz_')!=0||!lib.junList.includes(name.slice(3))){ + content: function () { + "step 0"; + if ( + player.phaseNumber == 1 && + player.isUnseen(0) && + (_status.connectMode ? lib.configOL.junzhu : get.config("junzhu")) + ) { + var name = player.name1; + if (name.indexOf("gz_") != 0 || !lib.junList.includes(name.slice(3))) { event.goto(3); + } else { + event.junzhu_name = "gz_jun_" + name.slice(3); + player.chooseBool( + "是否将主武将牌替换为“" + get.translation(event.junzhu_name) + "”?" + ); } - else{ - event.junzhu_name='gz_jun_'+name.slice(3); - player.chooseBool('是否将主武将牌替换为“'+get.translation(event.junzhu_name)+'”?'); - } - } - else event.goto(3); - 'step 1' - if(result.bool){ - var to=event.junzhu_name; - event.maxHp=player.maxHp; - player.reinit(player.name1,to,4); - if(lib.skill[to]) game.trySkillAudio(to,player); + } else event.goto(3); + "step 1"; + if (result.bool) { + var to = event.junzhu_name; + event.maxHp = player.maxHp; + player.reinit(player.name1, to, 4); + if (lib.skill[to]) game.trySkillAudio(to, player); player.showCharacter(0); - var group=lib.character[to][1]; - var yelist=game.filterPlayer(function(current){ - if(current.identity!='ye') return false; - if(current==player) return true; - return current.group==group; + var group = lib.character[to][1]; + var yelist = game.filterPlayer(function (current) { + if (current.identity != "ye") return false; + if (current == player) return true; + return current.group == group; }); - if(yelist.length>0){ - player.line(yelist,'green'); - game.log(yelist,'失去了野心家身份'); - game.broadcastAll(function(list,group){ - for(var i=0;i 0) { + player.line(yelist, "green"); + game.log(yelist, "失去了野心家身份"); + game.broadcastAll( + function (list, group) { + for (var i = 0; i < list.length; i++) { + list[i].identity = group; + list[i].group = group; + list[i].setIdentity(); + } + }, + yelist, + player.group + ); } game.tryResult(); - } - else event.goto(3); - 'step 2' - if(player.maxHp>event.maxHp) player.recover(player.maxHp-event.maxHp); - 'step 3' - var choice=1; - for(var i=0;i event.maxHp) player.recover(player.maxHp - event.maxHp); + "step 3"; + var choice = 1; + for (var i = 0; i < player.hiddenSkills.length; i++) { + if (lib.skill[player.hiddenSkills[i]].ai) { + var mingzhi = lib.skill[player.hiddenSkills[i]].ai.mingzhi; + if (mingzhi == false) { + choice = 0; + break; } - if(typeof mingzhi=='function'&&mingzhi(trigger,player)==false){ - choice=0;break; + if (typeof mingzhi == "function" && mingzhi(trigger, player) == false) { + choice = 0; + break; } } } - if(player.isUnseen()){ - var group=lib.character[player.name1][1]; - player.chooseControl('bumingzhi','明置'+get.translation(player.name1), - '明置'+get.translation(player.name2),'tongshimingzhi',true).ai=function(event,player){ - if(player.hasSkillTag('mingzhi_yes')) return get.rand(1,2); - if(player.hasSkillTag('mingzhi_no')) return 0; - var popu=get.population(lib.character[player.name1][1]) - if(popu>=2||(popu==1&&game.players.length<=4)){ - return Math.random()<0.5?3:(Math.random()<0.5?2:1); + if (player.isUnseen()) { + var group = lib.character[player.name1][1]; + player.chooseControl( + "bumingzhi", + "明置" + get.translation(player.name1), + "明置" + get.translation(player.name2), + "tongshimingzhi", + true + ).ai = function (event, player) { + if (player.hasSkillTag("mingzhi_yes")) return get.rand(1, 2); + if (player.hasSkillTag("mingzhi_no")) return 0; + var popu = get.population(lib.character[player.name1][1]); + if (popu >= 2 || (popu == 1 && game.players.length <= 4)) { + return Math.random() < 0.5 ? 3 : Math.random() < 0.5 ? 2 : 1; } - if(choice==0) return 0; - if(get.population(group)>0&&player.wontYe()){ - return Math.random()<0.2?(Math.random()<0.5?3:(Math.random()<0.5?2:1)):0; + if (choice == 0) return 0; + if (get.population(group) > 0 && player.wontYe()) { + return Math.random() < 0.2 + ? Math.random() < 0.5 + ? 3 + : Math.random() < 0.5 + ? 2 + : 1 + : 0; } - var nming=0; - for(var i=0;i=2||(popu==1&&game.players.length<=4)){ + } else { + event.skillHidden = true; + var bool1 = game.expandSkills(lib.character[player.name1][3]).includes(trigger.skill); + var bool2 = game.expandSkills(lib.character[player.name2][3]).includes(trigger.skill); + var nai = function () { + var player = _status.event.player; + if (!_status.event.yes) return false; + if (player.hasSkillTag("mingzhi_no")) return false; + if (player.hasSkillTag("mingzhi_yes")) return true; + if (player.identity != "unknown") return true; + if (Math.random() < 0.5) return true; + var info = get.info(_status.event.hsskill); + if (info && info.ai && info.ai.mingzhi == true) return true; + if (info && info.ai && info.ai.maixie) return true; + var group = lib.character[player.name1][1]; + var popu = get.population(lib.character[player.name1][1]); + if (popu >= 2 || (popu == 1 && game.players.length <= 4)) { return true; } - if(get.population(group)>0&&player.wontYe()){ - return Math.random()<0.2?true:false; + if (get.population(group) > 0 && player.wontYe()) { + return Math.random() < 0.2 ? true : false; } - var nming=0; - for(var i=0;i0){ - target.chooseControl(list,'cancel2').set('prompt','是否响应'+get.translation(player)+'发起的阵法召唤?').set('ai',function(){ - return Math.random()<0.5?0:1; - }); - } - else event.goto(3); - } - else event.goto(3); - 'step 2' - if(result.control!='cancel2'){ - if(result.control=='明置'+get.translation(target.name1)){ + content: function () { + "step 0"; + event.list = game + .filterPlayer(function (current) { + return current.isUnseen(); + }) + .sortBySeat(); + "step 1"; + var target = event.list.shift(); + event.target = target; + if ( + target.wontYe(player.identity) && + lib.skill._zhenfazhaohuan.getConfig(player, target) + ) { + player.line(target, "green"); + var list = []; + if (target.getGuozhanGroup(0) == player.identity) + list.push("明置" + get.translation(target.name1)); + if (target.getGuozhanGroup(1) == player.identity) + list.push("明置" + get.translation(target.name2)); + if (list.length > 0) { + target + .chooseControl(list, "cancel2") + .set("prompt", "是否响应" + get.translation(player) + "发起的阵法召唤?") + .set("ai", function () { + return Math.random() < 0.5 ? 0 : 1; + }); + } else event.goto(3); + } else event.goto(3); + "step 2"; + if (result.control != "cancel2") { + if (result.control == "明置" + get.translation(target.name1)) { target.showCharacter(0); - } - else{ + } else { target.showCharacter(1); } } - 'step 3' - if(event.list.length) event.goto(1); - 'step 4' + "step 3"; + if (event.list.length) event.goto(1); + "step 4"; game.delay(); }, - ai:{ - order:5, - result:{ - player:1 - } - } + ai: { + order: 5, + result: { + player: 1, + }, + }, }, - ushio_huanxin:{ - trigger:{ - player:['damageEnd','useCardAfter'], - source:'damageSource', + ushio_huanxin: { + trigger: { + player: ["damageEnd", "useCardAfter"], + source: "damageSource", }, - frequent:true, - preHidden:true, - filter:function(event,player,name){ - if(name=='useCardAfter') return get.type(event.card)=='equip'; - if(name=='damageEnd') return true; - return event.getParent().name=='sha'; + frequent: true, + preHidden: true, + filter: function (event, player, name) { + if (name == "useCardAfter") return get.type(event.card) == "equip"; + if (name == "damageEnd") return true; + return event.getParent().name == "sha"; }, - content:function(){ - player.judge().set('callback',function(){ - var card=event.judgeResult.card; - if(card&&get.position(card,true)=='o'){ - player.gain(card,'gain2'); - player.chooseToDiscard(true,'he'); + content: function () { + player.judge().set("callback", function () { + var card = event.judgeResult.card; + if (card && get.position(card, true) == "o") { + player.gain(card, "gain2"); + player.chooseToDiscard(true, "he"); } }); }, }, - ushio_xilv:{ - trigger:{player:'judgeEnd'}, - forced:true, - preHidden:true, - content:function(){ - player.addTempSkill('ushio_xilv2',{player:'phaseJieshu'}); - player.addMark('ushio_xilv2',1,false); + ushio_xilv: { + trigger: { player: "judgeEnd" }, + forced: true, + preHidden: true, + content: function () { + player.addTempSkill("ushio_xilv2", { player: "phaseJieshu" }); + player.addMark("ushio_xilv2", 1, false); }, }, - ushio_xilv2:{ - onremove:true, - charlotte:true, - mod:{ - maxHandcard:function(player,num){ - return num+player.countMark('ushio_xilv2'); - } + ushio_xilv2: { + onremove: true, + charlotte: true, + mod: { + maxHandcard: function (player, num) { + return num + player.countMark("ushio_xilv2"); + }, }, - intro:{ - content:'手牌上限+#', + intro: { + content: "手牌上限+#", }, }, }, - game:{ - canReplaceViewpoint:()=>true, - showYexings:function(){ - if(_status.showYexings) return; - _status.showYexings=true; - var next=game.createEvent('showYexings',false); - next.setContent(function(){ - 'step 0' - event.targets=game.filterPlayer(function(current){ - return lib.character[current.name1][1]=='ye'; - }).sortBySeat(_status.currentPhase); - event.targets2=[]; - 'step 1' - var target=targets.shift(); - event.target=target; - target.chooseBool('是否【暴露野心】,展示主将并继续战斗?','若选择“否”,则视为本局游戏失败'); - 'step 2' - if(result.bool){ + game: { + canReplaceViewpoint: () => true, + showYexings: function () { + if (_status.showYexings) return; + _status.showYexings = true; + var next = game.createEvent("showYexings", false); + next.setContent(function () { + "step 0"; + event.targets = game + .filterPlayer(function (current) { + return lib.character[current.name1][1] == "ye"; + }) + .sortBySeat(_status.currentPhase); + event.targets2 = []; + "step 1"; + var target = targets.shift(); + event.target = target; + target.chooseBool( + "是否【暴露野心】,展示主将并继续战斗?", + "若选择“否”,则视为本局游戏失败" + ); + "step 2"; + if (result.bool) { event.targets2.push(target); - target.$fullscreenpop('暴露野心','thunder'); - game.log(target,'暴露了野心'); + target.$fullscreenpop("暴露野心", "thunder"); + game.log(target, "暴露了野心"); target.showCharacter(0); game.delay(2); - if(targets.length) event.goto(1); - } - else{ - if(targets.length) event.goto(1); - else{ - var winner=game.findPlayer(function(current){ - return lib.character[current.name1][1]!='ye'; + if (targets.length) event.goto(1); + } else { + if (targets.length) event.goto(1); + else { + var winner = game.findPlayer(function (current) { + return lib.character[current.name1][1] != "ye"; }); - if(winner){ - game.broadcastAll(function(id){ - game.winner_id=id; - },winner.playerid); + if (winner) { + game.broadcastAll(function (id) { + game.winner_id = id; + }, winner.playerid); game.checkResult(); } delete _status.showYexings; event.finish(); } } - 'step 3' - var source=event.targets2.shift(); - event.source=source; - event.targets3=[]; + "step 3"; + var source = event.targets2.shift(); + event.source = source; + event.targets3 = []; //event.targets4=[source]; - if(!_status.yexinjia_list) _status.yexinjia_list=['夏','商','周','秦','汉','隋','唐','宋','辽','金','元','明']; - source.chooseControl(_status.yexinjia_list).set('prompt','请选择自己所属的野心家势力的标识').set('ai',()=>(_status.yexinjia_list?_status.yexinjia_list.randomGet():0)); - 'step 4' - var text,source=event.source; - if(result.control){ - text=result.control; + if (!_status.yexinjia_list) + _status.yexinjia_list = [ + "夏", + "商", + "周", + "秦", + "汉", + "隋", + "唐", + "宋", + "辽", + "金", + "元", + "明", + ]; + source + .chooseControl(_status.yexinjia_list) + .set("prompt", "请选择自己所属的野心家势力的标识") + .set("ai", () => (_status.yexinjia_list ? _status.yexinjia_list.randomGet() : 0)); + "step 4"; + var text, + source = event.source; + if (result.control) { + text = result.control; _status.yexinjia_list.remove(result.control); - } - else text=_status.yexinjia_list.randomRemove(); + } else text = _status.yexinjia_list.randomRemove(); lib.group.push(text); - lib.translate[text+'2']=text; - lib.groupnature[text]='kami'; - event.text=text; - game.broadcastAll(function(player,text){ - player.identity=text; - player.setIdentity(text,'kami'); - },source,text); + lib.translate[text + "2"] = text; + lib.groupnature[text] = "kami"; + event.text = text; + game.broadcastAll( + function (player, text) { + player.identity = text; + player.setIdentity(text, "kami"); + }, + source, + text + ); source.changeGroup(text); - source.removeMark('yexinjia_mark',1); - var targets=game.filterPlayer(function(current){ - return current.identity!='ye'&¤t!=source&&!get.is.jun(current)&&!event.targets2.includes(current)&&!current.getStorage('yexinjia_friend').length; + source.removeMark("yexinjia_mark", 1); + var targets = game.filterPlayer(function (current) { + return ( + current.identity != "ye" && + current != source && + !get.is.jun(current) && + !event.targets2.includes(current) && + !current.getStorage("yexinjia_friend").length + ); }); - if(!targets.length) event.goto(8); - else event.targets=targets; - 'step 5' - var source=event.source; - var target=targets.shift(); - event.target=target; - source.line(target,'green'); - target.chooseBool('是否响应'+get.translation(source)+'发起的【拉拢人心】?','将势力改为'+event.text).set('ai',_status.event.choice).set('choice',function(){ - let fs=target.getFriends(true).length; - if(game.players.length<=2*fs) return false; - if(source.getFriends(true).length+fs>game.players.length/2) return true; - if(target.isDamaged()||target.countCards('h')<4) return false; - return true; - }()); - 'step 6' - if(result.bool){ - target.chat('加入'); + if (!targets.length) event.goto(8); + else event.targets = targets; + "step 5"; + var source = event.source; + var target = targets.shift(); + event.target = target; + source.line(target, "green"); + target + .chooseBool( + "是否响应" + get.translation(source) + "发起的【拉拢人心】?", + "将势力改为" + event.text + ) + .set("ai", _status.event.choice) + .set( + "choice", + (function () { + let fs = target.getFriends(true).length; + if (game.players.length <= 2 * fs) return false; + if (source.getFriends(true).length + fs > game.players.length / 2) + return true; + if (target.isDamaged() || target.countCards("h") < 4) return false; + return true; + })() + ); + "step 6"; + if (result.bool) { + target.chat("加入"); //event.targets4.push(target); - game.broadcastAll(function(player,text){ - player.identity=text; - player.setIdentity(text,'kami'); - },target,event.text); + game.broadcastAll( + function (player, text) { + player.identity = text; + player.setIdentity(text, "kami"); + }, + target, + event.text + ); target.changeGroup(event.text); - } - else{ - target.chat('拒绝'); + } else { + target.chat("拒绝"); event.targets3.push(target); } game.delay(1.5); - if(targets.length) event.goto(5); + if (targets.length) event.goto(5); /* else if(event.targets4.length){ for(var i of event.targets4){ @@ -17093,106 +21825,105 @@ return event.junling=='junling5'?1:0;}); } } */ - 'step 7' - if(event.targets3.length){ - for(var i of event.targets3){ + "step 7"; + if (event.targets3.length) { + for (var i of event.targets3) { i.drawTo(4); i.recover(); } } - 'step 8' - if(event.targets2.length) event.goto(3); - else{ + "step 8"; + if (event.targets2.length) event.goto(3); + else { delete _status.showYexings; - if(!game.hasPlayer(current=>{ - return game.hasPlayer(target=>{ - return !target.isFriendOf(current); - }); - })){ - game.broadcastAll(function(id){ - game.winner_id=id; - },event.source.playerid); + if ( + !game.hasPlayer((current) => { + return game.hasPlayer((target) => { + return !target.isFriendOf(current); + }); + }) + ) { + game.broadcastAll(function (id) { + game.winner_id = id; + }, event.source.playerid); game.checkResult(); } } }); }, - getCharacterChoice:function(list,num){ - var choice=list.splice(0,num).sort(function(a,b){ - return (get.is.double(a)?1:-1)-(get.is.double(b)?1:-1); + getCharacterChoice: function (list, num) { + var choice = list.splice(0, num).sort(function (a, b) { + return (get.is.double(a) ? 1 : -1) - (get.is.double(b) ? 1 : -1); }); - var map={wei:[],shu:[],wu:[],qun:[],key:[],jin:[],ye:[]}; - for(var i=0;i=num){ + list.splice(i--, 1); + if (choice.length >= num) { break; } } - } - else{ - if(!map[lib.character[list[i]][1]]&&!get.is.double(list[i])){ - group=lib.character[list[i]][1]; - if(group=='ye') group=null; + } else { + if (!map[lib.character[list[i]][1]] && !get.is.double(list[i])) { + group = lib.character[list[i]][1]; + if (group == "ye") group = null; choice.push(list[i]); - list.splice(i--,1); - if(choice.length>=num){ + list.splice(i--, 1); + if (choice.length >= num) { break; } } @@ -17201,262 +21932,316 @@ return event.junling=='junling5'?1:0;}); } return choice.randomSort(); }, - getState:function(){ - var state={}; - for(var i in lib.playerOL){ - var player=lib.playerOL[i]; - state[i]={ - identity:player.identity, + getState: function () { + var state = {}; + for (var i in lib.playerOL) { + var player = lib.playerOL[i]; + state[i] = { + identity: player.identity, //group:player.group, - shown:player.ai.shown, + shown: player.ai.shown, }; } return state; }, - updateState:function(state){ - for(var i in state){ - var player=lib.playerOL[i]; - if(player){ - player.identity=state[i].identity; + updateState: function (state) { + for (var i in state) { + var player = lib.playerOL[i]; + if (player) { + player.identity = state[i].identity; //player.group=state[i].group; - player.ai.shown=state[i].shown; + player.ai.shown = state[i].shown; } } }, - getRoomInfo:function(uiintro){ - var num,last; - if(lib.configOL.initshow_draw=='off'){ - num='关闭' + getRoomInfo: function (uiintro) { + var num, last; + if (lib.configOL.initshow_draw == "off") { + num = "关闭"; + } else { + num = { mark: "标记", draw: "摸牌" }[lib.configOL.initshow_draw]; } - else{ - num={mark:'标记',draw:'摸牌'}[lib.configOL.initshow_draw]; - } - uiintro.add('
          群雄割据:'+(lib.configOL.separatism?'开启':'关闭')); - uiintro.add('
          首亮奖励:'+num); - uiintro.add('
          珠联璧合:'+(lib.configOL.zhulian?'开启':'关闭')); - uiintro.add('
          出牌时限:'+lib.configOL.choose_timeout+'秒'); - uiintro.add('
          国战牌堆:'+(lib.configOL.guozhanpile?'开启':'关闭')); - uiintro.add('
          鏖战模式:'+(lib.configOL.aozhan?'开启':'关闭')); - last=uiintro.add('
          观看下家副将:'+(lib.configOL.viewnext?'开启':'关闭')); - last.style.paddingBottom='8px'; + uiintro.add( + '
          群雄割据:' + (lib.configOL.separatism ? "开启" : "关闭") + ); + uiintro.add('
          首亮奖励:' + num); + uiintro.add('
          珠联璧合:' + (lib.configOL.zhulian ? "开启" : "关闭")); + uiintro.add('
          出牌时限:' + lib.configOL.choose_timeout + "秒"); + uiintro.add( + '
          国战牌堆:' + (lib.configOL.guozhanpile ? "开启" : "关闭") + ); + uiintro.add('
          鏖战模式:' + (lib.configOL.aozhan ? "开启" : "关闭")); + last = uiintro.add( + '
          观看下家副将:' + (lib.configOL.viewnext ? "开启" : "关闭") + ); + last.style.paddingBottom = "8px"; }, - addRecord:function(bool){ - if(typeof bool=='boolean'){ - var data=lib.config.gameRecord.guozhan.data; - var identity=game.me.identity; - if(!data[identity]){ - data[identity]=[0,0]; + addRecord: function (bool) { + if (typeof bool == "boolean") { + var data = lib.config.gameRecord.guozhan.data; + var identity = game.me.identity; + if (!data[identity]) { + data[identity] = [0, 0]; } - if(bool){ + if (bool) { data[identity][0]++; - } - else{ + } else { data[identity][1]++; } - var list=lib.group.slice(0); - list.add('ye'); - var str=''; - for(var i=0;i'; + var list = lib.group.slice(0); + list.add("ye"); + var str = ""; + for (var i = 0; i < list.length; i++) { + if (list[i] != "shen" && data[list[i]]) { + str += + lib.translate[list[i] + "2"] + + ":" + + data[list[i]][0] + + "胜" + + " " + + data[list[i]][1] + + "负
          "; } } - lib.config.gameRecord.guozhan.str=str; - game.saveConfig('gameRecord',lib.config.gameRecord); + lib.config.gameRecord.guozhan.str = str; + game.saveConfig("gameRecord", lib.config.gameRecord); } }, - getIdentityList:function(player){ - if(!player.isUnseen()) return; - if(player==game.me) return; - var list={ - wei:'魏', - shu:'蜀', - wu:'吴', - qun:'群', - ye:'野', - unknown:'猜' - } - var num=Math.floor((game.players.length+game.dead.length)/2); - var noye=true; - if(get.population('wei')>=num){ + getIdentityList: function (player) { + if (!player.isUnseen()) return; + if (player == game.me) return; + var list = { + wei: "魏", + shu: "蜀", + wu: "吴", + qun: "群", + ye: "野", + unknown: "猜", + }; + var num = Math.floor((game.players.length + game.dead.length) / 2); + var noye = true; + if (get.population("wei") >= num) { delete list.wei; - noye=false; + noye = false; } - if(get.population('shu')>=num){ + if (get.population("shu") >= num) { delete list.shu; - noye=false; + noye = false; } - if(get.population('wu')>=num){ + if (get.population("wu") >= num) { delete list.wu; - noye=false; + noye = false; } - if(get.population('qun')>=num){ + if (get.population("qun") >= num) { delete list.qun; - noye=false; + noye = false; } - if(noye){ + if (noye) { delete list.ye; } return list; }, - getIdentityList2:function(list){ - for(var i in list){ - switch(i){ - case 'unknown':list[i]='未知';break; - case 'ye':list[i]='野心家';break; - case 'qun':list[i]+='雄';break; - case 'key':list[i]='Key';break; - case 'jin':list[i]+='朝';break; - default:list[i]+='国'; + getIdentityList2: function (list) { + for (var i in list) { + switch (i) { + case "unknown": + list[i] = "未知"; + break; + case "ye": + list[i] = "野心家"; + break; + case "qun": + list[i] += "雄"; + break; + case "key": + list[i] = "Key"; + break; + case "jin": + list[i] += "朝"; + break; + default: + list[i] += "国"; } } }, - getVideoName:function(){ - var str=get.translation(game.me.name1)+'/'+get.translation(game.me.name2); - var str2=_status.separatism?get.modetrans({ - mode:lib.config.mode, - separatism:true - }):get.cnNumber(parseInt(get.config('player_number')))+'人'+ - get.translation(lib.config.mode); - if(game.me.identity=='ye'){ - str2+=' - 野心家'; + getVideoName: function () { + var str = get.translation(game.me.name1) + "/" + get.translation(game.me.name2); + var str2 = _status.separatism + ? get.modetrans({ + mode: lib.config.mode, + separatism: true, + }) + : get.cnNumber(parseInt(get.config("player_number"))) + + "人" + + get.translation(lib.config.mode); + if (game.me.identity == "ye") { + str2 += " - 野心家"; } - var name=[str,str2]; + var name = [str, str2]; return name; }, - showIdentity:function(started){ - if(game.phaseNumber==0&&!started) return; - for(var i=0;i1){ - if(!hiddens.length&&sides.length==2){ - if(map[sides[0]].length==1&&!map[sides[1]].filter(function(i){ - return i.identity!='ye'&&i.isUnseen(0); - }).length) map[sides[0]][0].showGiveup(); - if(map[sides[1]].length==1&&!map[sides[0]].filter(function(i){ - return i.identity!='ye'&&i.isUnseen(0); - }).length) map[sides[1]][0].showGiveup(); + if (!sides.length) return; + else if (sides.length > 1) { + if (!hiddens.length && sides.length == 2) { + if ( + map[sides[0]].length == 1 && + !map[sides[1]].filter(function (i) { + return i.identity != "ye" && i.isUnseen(0); + }).length + ) + map[sides[0]][0].showGiveup(); + if ( + map[sides[1]].length == 1 && + !map[sides[0]].filter(function (i) { + return i.identity != "ye" && i.isUnseen(0); + }).length + ) + map[sides[1]][0].showGiveup(); } - } - else{ - var isYe=function(player){ - return player.identity!='ye'&&lib.character[player.name1][1]=='ye'; - } - if(!hiddens.length){ - if(map[sides[0]].length>1){ - for(var i of map[sides[0]]){ - if(isYe(i)){ + } else { + var isYe = function (player) { + return player.identity != "ye" && lib.character[player.name1][1] == "ye"; + }; + if (!hiddens.length) { + if (map[sides[0]].length > 1) { + for (var i of map[sides[0]]) { + if (isYe(i)) { game.showYexings(); return; } } } - game.broadcastAll(function(id){ - game.winner_id=id; - },sides[0]); + game.broadcastAll(function (id) { + game.winner_id = id; + }, sides[0]); game.checkResult(); - } - else{ - var identity=map[sides[0]][0].identity; - if(identity=='ye') return; - for(var i of map[sides[0]]){ - if(isYe(i)) return; + } else { + var identity = map[sides[0]][0].identity; + if (identity == "ye") return; + for (var i of map[sides[0]]) { + if (isYe(i)) return; } - for(var ind=0;inddouble.includes(group)); + var filterChoice = function (name1, name2) { + if (_status.separatism) return true; + var group1 = lib.character[name1][1]; + var group2 = lib.character[name2][1]; + var doublex = get.is.double(name1, true); + if (doublex) { + var double = get.is.double(name2, true); + if (double) return doublex.some((group) => double.includes(group)); return doublex.includes(group2); - } - else{ - if(group1=='ye') return group2!='ye'; - var double=get.is.double(name2,true); - if(double) return double.includes(group1); - return group1==group2; + } else { + if (group1 == "ye") return group2 != "ye"; + var double = get.is.double(name2, true); + if (double) return double.includes(group1); + return group1 == group2; } }; - for(var i=0;iget.is.double(mainx,true).includes(group)).randomGet(); - else player.trueIdentity=get.is.double(mainx,true).find(group=>get.is.double(vicex,true).includes(group)); - } - else if(lib.character[mainx][1]=='ye'&&get.is.double(vicex,true)) player.trueIdentity=get.is.double(vicex,true).randomGet(); - if(back){ + player.init(mainx, vicex, false); + if (get.is.double(mainx, true)) { + if (!get.is.double(vicex, true)) + player.trueIdentity = lib.character[vicex][1]; + else if ( + get.is.double(mainx, true).removeArray(get.is.double(vicex, true)) + .length == 0 || + get.is.double(vicex, true).removeArray(get.is.double(mainx, true)) + .length == 0 + ) + player.trueIdentity = get.is + .double(vicex, true) + .filter((group) => get.is.double(mainx, true).includes(group)) + .randomGet(); + else + player.trueIdentity = get.is + .double(mainx, true) + .find((group) => get.is.double(vicex, true).includes(group)); + } else if (lib.character[mainx][1] == "ye" && get.is.double(vicex, true)) + player.trueIdentity = get.is.double(vicex, true).randomGet(); + if (back) { list.remove(player.name1); list.remove(player.name2); - for(var i=0;i'; - td.link=i-1; + }; + next.setContent(function () { + "step 0"; + ui.arena.classList.add("choose-character"); + var addSetting = function (dialog) { + dialog.add("选择座位").classList.add("add-setting"); + var seats = document.createElement("table"); + seats.classList.add("add-setting"); + seats.style.margin = "0"; + seats.style.width = "100%"; + seats.style.position = "relative"; + for (var i = 1; i <= game.players.length; i++) { + var td = ui.create.div(".shadowed.reduce_radius.pointerdiv.tdnode"); + td.innerHTML = "" + get.cnNumber(i, true) + ""; + td.link = i - 1; seats.appendChild(td); - td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){ - if(_status.dragged) return; - if(_status.justdragged) return; - if(_status.cheat_seat){ - _status.cheat_seat.classList.remove('bluebg'); - if(_status.cheat_seat==this){ + td.addEventListener(lib.config.touchscreen ? "touchend" : "click", function () { + if (_status.dragged) return; + if (_status.justdragged) return; + if (_status.cheat_seat) { + _status.cheat_seat.classList.remove("bluebg"); + if (_status.cheat_seat == this) { delete _status.cheat_seat; return; } } - this.classList.add('bluebg'); - _status.cheat_seat=this; + this.classList.add("bluebg"); + _status.cheat_seat = this; }); } dialog.content.appendChild(seats); - if(game.me==game.zhu){ - seats.previousSibling.style.display='none'; - seats.style.display='none'; + if (game.me == game.zhu) { + seats.previousSibling.style.display = "none"; + seats.style.display = "none"; } - dialog.add(ui.create.div('.placeholder.add-setting')); - dialog.add(ui.create.div('.placeholder.add-setting')); - if(get.is.phoneLayout()) dialog.add(ui.create.div('.placeholder.add-setting')); + dialog.add(ui.create.div(".placeholder.add-setting")); + dialog.add(ui.create.div(".placeholder.add-setting")); + if (get.is.phoneLayout()) dialog.add(ui.create.div(".placeholder.add-setting")); }; - var removeSetting=function(){ - var dialog=_status.event.dialog; - if(dialog){ - dialog.style.height=''; + var removeSetting = function () { + var dialog = _status.event.dialog; + if (dialog) { + dialog.style.height = ""; delete dialog._scrollset; - var list=Array.from(dialog.querySelectorAll('.add-setting')); - while(list.length){ + var list = Array.from(dialog.querySelectorAll(".add-setting")); + while (list.length) { list.shift().remove(); } ui.update(); } }; - event.addSetting=addSetting; - event.removeSetting=removeSetting; + event.addSetting = addSetting; + event.removeSetting = removeSetting; - var chosen=lib.config.continue_name||[]; - game.saveConfig('continue_name'); - event.chosen=chosen; + var chosen = lib.config.continue_name || []; + game.saveConfig("continue_name"); + event.chosen = chosen; var i; - event.list=[]; - for(i in lib.character){ - if(i.indexOf('gz_shibing')==0) continue; - if(chosen.includes(i)) continue; - if(lib.filter.characterDisabled(i)) continue; - if(get.config('onlyguozhan')){ - if(!lib.characterGuozhanFilter.some(pack=>lib.characterPack[pack][i])) continue; - if(get.is.jun(i)) continue; + event.list = []; + for (i in lib.character) { + if (i.indexOf("gz_shibing") == 0) continue; + if (chosen.includes(i)) continue; + if (lib.filter.characterDisabled(i)) continue; + if (get.config("onlyguozhan")) { + if (!lib.characterGuozhanFilter.some((pack) => lib.characterPack[pack][i])) + continue; + if (get.is.jun(i)) continue; } - if(lib.character[i][4].includes('hiddenSkill')) continue; - if(lib.character[i][2]==3||lib.character[i][2]==4||lib.character[i][2]==5) - event.list.push(i); + if (lib.character[i][4].includes("hiddenSkill")) continue; + if (lib.character[i][2] == 3 || lib.character[i][2] == 4 || lib.character[i][2] == 5) + event.list.push(i); } - _status.characterlist=event.list.slice(0); - _status.yeidentity=[]; - if(_status.brawl&&_status.brawl.chooseCharacterFilter){ - event.list=_status.brawl.chooseCharacterFilter(event.list); + _status.characterlist = event.list.slice(0); + _status.yeidentity = []; + if (_status.brawl && _status.brawl.chooseCharacterFilter) { + event.list = _status.brawl.chooseCharacterFilter(event.list); } event.list.randomSort(); // var list=event.list.splice(0,parseInt(get.config('choice_num'))); var list; - if(_status.brawl&&_status.brawl.chooseCharacter){ - list=_status.brawl.chooseCharacter(event.list,game.me); + if (_status.brawl && _status.brawl.chooseCharacter) { + list = _status.brawl.chooseCharacter(event.list, game.me); + } else { + list = game.getCharacterChoice(event.list, parseInt(get.config("choice_num"))); } - else{ - list=game.getCharacterChoice(event.list,parseInt(get.config('choice_num'))); - } - if(_status.auto){ - event.ai(game.me,list); + if (_status.auto) { + event.ai(game.me, list); lib.init.onfree(); - } - else if(chosen.length){ - game.me.init(chosen[0],chosen[1],false); + } else if (chosen.length) { + game.me.init(chosen[0], chosen[1], false); lib.init.onfree(); - } - else{ - var dialog=ui.create.dialog('选择角色','hidden',[list,'character']); - if(!_status.brawl||!_status.brawl.noAddSetting){ - if(get.config('change_identity')){ + } else { + var dialog = ui.create.dialog("选择角色", "hidden", [list, "character"]); + if (!_status.brawl || !_status.brawl.noAddSetting) { + if (get.config("change_identity")) { addSetting(dialog); } } - var next=game.me.chooseButton(dialog,true,2).set('onfree',true); - next.filterButton=function(button){ - if(ui.dialog.buttons.length<=10){ - for(var i=0;idouble.includes(group)); + if (lib.character[button.link][4].includes("hiddenSkill")) return false; + var filterChoice = function (name1, name2) { + if (_status.separatism) return true; + var group1 = lib.character[name1][1]; + var group2 = lib.character[name2][1]; + var doublex = get.is.double(name1, true); + if (doublex) { + var double = get.is.double(name2, true); + if (double) return doublex.some((group) => double.includes(group)); return doublex.includes(group2); - } - else{ - if(group1=='ye') return group2!='ye'; - var double=get.is.double(name2,true); - if(double) return double.includes(group1); - return group1==group2; + } else { + if (group1 == "ye") return group2 != "ye"; + var double = get.is.double(name2, true); + if (double) return double.includes(group1); + return group1 == group2; } }; - if(!ui.selected.buttons.length){ - return ui.dialog.buttons.some(but=>{ - if(but==button) return false; - return filterChoice(button.link,but.link); + if (!ui.selected.buttons.length) { + return ui.dialog.buttons.some((but) => { + if (but == button) return false; + return filterChoice(button.link, but.link); }); } - return filterChoice(ui.selected.buttons[0].link,button.link); + return filterChoice(ui.selected.buttons[0].link, button.link); }; - next.switchToAuto=function(){ - event.ai(game.me,list); - ui.arena.classList.remove('selecting'); + next.switchToAuto = function () { + event.ai(game.me, list); + ui.arena.classList.remove("selecting"); }; - var createCharacterDialog=function(){ - event.dialogxx=ui.create.characterDialog('heightset',function(i){ - if(i.indexOf('gz_shibing')==0) return true; - if(get.config('onlyguozhan')){ - if(!lib.characterGuozhanFilter.some(pack=>lib.characterPack[pack][i])) return true; - if(get.is.jun(i)) return true; - } - },get.config('onlyguozhanexpand')?'expandall':undefined,get.config('onlyguozhan')?'onlypack:mode_guozhan':undefined); - if(ui.cheat2){ - ui.cheat2.addTempClass('controlpressdownx',500); - ui.cheat2.classList.remove('disabled'); + var createCharacterDialog = function () { + event.dialogxx = ui.create.characterDialog( + "heightset", + function (i) { + if (i.indexOf("gz_shibing") == 0) return true; + if (get.config("onlyguozhan")) { + if ( + !lib.characterGuozhanFilter.some( + (pack) => lib.characterPack[pack][i] + ) + ) + return true; + if (get.is.jun(i)) return true; + } + }, + get.config("onlyguozhanexpand") ? "expandall" : undefined, + get.config("onlyguozhan") ? "onlypack:mode_guozhan" : undefined + ); + if (ui.cheat2) { + ui.cheat2.addTempClass("controlpressdownx", 500); + ui.cheat2.classList.remove("disabled"); } }; - if(lib.onfree){ + if (lib.onfree) { lib.onfree.push(createCharacterDialog); - } - else{ + } else { createCharacterDialog(); } - ui.create.cheat2=function(){ - ui.cheat2=ui.create.control('自由选将',function(){ - if(this.dialog==_status.event.dialog){ - if(game.changeCoin){ + 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; + _status.event.dialog = this.backup; this.backup.open(); delete this.backup; game.uncheck(); game.check(); - if(ui.cheat){ - ui.cheat.addTempClass('controlpressdownx',500); - ui.cheat.classList.remove('disabled'); + if (ui.cheat) { + ui.cheat.addTempClass("controlpressdownx", 500); + ui.cheat.classList.remove("disabled"); } - } - else{ - if(game.changeCoin){ + } else { + if (game.changeCoin) { game.changeCoin(-10); } - this.backup=_status.event.dialog; + this.backup = _status.event.dialog; _status.event.dialog.close(); - _status.event.dialog=_status.event.parent.dialogxx; - this.dialog=_status.event.dialog; + _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 (ui.cheat) { + ui.cheat.classList.add("disabled"); } } }); - if(lib.onfree){ - ui.cheat2.classList.add('disabled'); + if (lib.onfree) { + ui.cheat2.classList.add("disabled"); } - } - ui.create.cheat=function(){ - _status.createControl=ui.cheat2; - ui.cheat=ui.create.control('更换',function(){ - if(ui.cheat2&&ui.cheat2.dialog==_status.event.dialog){ + }; + 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){ + if (game.changeCoin) { game.changeCoin(-3); } - event.list=event.list.concat(list); + event.list = event.list.concat(list); event.list.randomSort(); // list=event.list.splice(0,parseInt(get.config('choice_num'))); - list=game.getCharacterChoice(event.list,parseInt(get.config('choice_num'))); - 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.addTempClass('start'); + list = game.getCharacterChoice( + event.list, + parseInt(get.config("choice_num")) + ); + 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.addTempClass("start"); node.remove(); game.uncheck(); game.check(); }); delete _status.createControl; - } - 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(); + }; + 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){ + "step 1"; + if (ui.cheat) { ui.cheat.close(); delete ui.cheat; } - if(ui.cheat2){ + if (ui.cheat2) { ui.cheat2.close(); delete ui.cheat2; } - if(result.buttons){ - var name1=result.buttons[0].link,name2=result.buttons[1].link; - event.choosen=[name1,name2]; - if(get.is.double(name1,true)){ - if(!get.is.double(name2,true)) event._result={control:lib.character[name2][1]}; - else if(get.is.double(name1,true).removeArray(get.is.double(name2,true)).length==0||get.is.double(name2,true).removeArray(get.is.double(name1,true)).length==0) game.me.chooseControl(get.is.double(name2,true).filter(group=>get.is.double(name1,true).includes(group))).set('prompt','请选择你代表的势力').set('ai',()=>_status.event.controls.randomGet()); - else event._result={control:get.is.double(name1,true).find(group=>get.is.double(name2,true).includes(group))}; - } - else if(lib.character[name1][1]=='ye'&&get.is.double(name2,true)) game.me.chooseControl(get.is.double(name2,true)).set('prompt','请选择副将代表的势力').set('ai',()=>_status.event.controls.randomGet()); + if (result.buttons) { + var name1 = result.buttons[0].link, + name2 = result.buttons[1].link; + event.choosen = [name1, name2]; + if (get.is.double(name1, true)) { + if (!get.is.double(name2, true)) + event._result = { control: lib.character[name2][1] }; + else if ( + get.is.double(name1, true).removeArray(get.is.double(name2, true)).length == + 0 || + get.is.double(name2, true).removeArray(get.is.double(name1, true)).length == 0 + ) + game.me + .chooseControl( + get.is + .double(name2, true) + .filter((group) => get.is.double(name1, true).includes(group)) + ) + .set("prompt", "请选择你代表的势力") + .set("ai", () => _status.event.controls.randomGet()); + else + event._result = { + control: get.is + .double(name1, true) + .find((group) => get.is.double(name2, true).includes(group)), + }; + } else if (lib.character[name1][1] == "ye" && get.is.double(name2, true)) + game.me + .chooseControl(get.is.double(name2, true)) + .set("prompt", "请选择副将代表的势力") + .set("ai", () => _status.event.controls.randomGet()); } - 'step 2' - if(result&&result.control) game.me.trueIdentity=result.control; - if(event.choosen){ - game.me.init(event.choosen[0],event.choosen[1],false); - game.addRecentCharacter(event.choosen[0],event.choosen[1]); + "step 2"; + if (result && result.control) game.me.trueIdentity = result.control; + if (event.choosen) { + game.me.init(event.choosen[0], event.choosen[1], false); + game.addRecentCharacter(event.choosen[0], event.choosen[1]); } event.list.remove(game.me.name1); event.list.remove(game.me.name2); - for(var i=0;ilist.length){ - num=5; + if (lib.configOL.number * 6 > list.length) { + num = 5; + } else if (lib.configOL.number * 7 > list.length) { + num = 6; + } else { + num = 7; } - else if(lib.configOL.number*7>list.length){ - num=6; - } - else{ - num=7; - } - var filterButton=function(button){ - if(ui.dialog){ - if(ui.dialog.buttons.length<=10){ - for(var i=0;idouble.includes(group)); + var filterChoice = function (name1, name2) { + if (_status.separatism) return true; + var group1 = lib.character[name1][1]; + var group2 = lib.character[name2][1]; + var doublex = get.is.double(name1, true); + if (doublex) { + var double = get.is.double(name2, true); + if (double) return doublex.some((group) => double.includes(group)); return doublex.includes(group2); - } - else{ - if(group1=='ye') return group2!='ye'; - var double=get.is.double(name2,true); - if(double) return double.includes(group1); - return group1==group2; + } else { + if (group1 == "ye") return group2 != "ye"; + var double = get.is.double(name2, true); + if (double) return double.includes(group1); + return group1 == group2; } }; - if(!ui.selected.buttons.length){ - return ui.dialog.buttons.some(but=>{ - if(but==button) return false; - return filterChoice(button.link,but.link); + if (!ui.selected.buttons.length) { + return ui.dialog.buttons.some((but) => { + if (but == button) return false; + return filterChoice(button.link, but.link); }); } - return filterChoice(ui.selected.buttons[0].link,button.link); + return filterChoice(ui.selected.buttons[0].link, button.link); }; list.randomSort(); - for(var i=0;idouble.includes(group)); - return doublex.includes(group2); - } - else{ - if(group1=='ye') return group2!='ye'; - var double=get.is.double(name2,true); - if(double) return double.includes(group1); - return group1==group2; - } - }; - for(var i=0;i double.includes(group)); + return doublex.includes(group2); + } else { + if (group1 == "ye") return group2 != "ye"; + var double = get.is.double(name2, true); + if (double) return double.includes(group1); + return group1 == group2; + } + }; + for (var i = 0; i < buttons.length - 1; i++) { + for (var j = i + 1; j < buttons.length; j++) { + if ( + filterChoice(buttons[i].link, buttons[j].link) || + filterChoice(buttons[j].link, buttons[i].link) + ) { + var mainx = buttons[i].link; + var vicex = buttons[j].link; + if ( + !filterChoice(mainx, vicex) || + (filterChoice(vicex, mainx) && get.guozhanReverse(mainx, vicex)) + ) { + mainx = buttons[j].link; + vicex = buttons[i].link; + } + var list = [mainx, vicex]; + return { + bool: true, + links: list, + }; } } } - } - }); - 'step 1' - var sort=true,chosen=[],chosenCharacter=[]; - for(var i in result){ - if(result[i]&&result[i].links){ - for(var j=0;jget.is.double(name2,true).includes(group)); - } - else if(lib.character[name1][1]=='ye'&&get.is.double(name2,true)){ + chosenCharacter.push([name1, name2]); + } else + lib.playerOL[i].trueIdentity = get.is + .double(name1, true) + .find((group) => get.is.double(name2, true).includes(group)); + } else if (lib.character[name1][1] == "ye" && get.is.double(name2, true)) { chosen.push(lib.playerOL[i]); - chosenCharacter.push([name1,name2]); + chosenCharacter.push([name1, name2]); } } - event.result2=result; - if(chosen.length){ - for(var i=0;iget.is.double(name1,true).includes(group)); + event.result2 = result; + if (chosen.length) { + for (var i = 0; i < chosen.length; i++) { + var name1 = chosenCharacter[i][0], + name2 = chosenCharacter[i][1], + str, + choice; + if (get.is.double(name1, true)) { + str = "请选择你代表的势力"; + choice = get.is + .double(name2, true) + .filter((group) => get.is.double(name1, true).includes(group)); } - if(lib.character[name1][1]=='ye'){ - str='请选择你的副将代表的势力'; - choice=get.is.double(name2,true); + if (lib.character[name1][1] == "ye") { + str = "请选择你的副将代表的势力"; + choice = get.is.double(name2, true); } - chosen[i]=[chosen[i],[str,[choice.map(function(i){ - return ['','','group_'+i]; - }),'vcard']],1,true]; + chosen[i] = [ + chosen[i], + [ + str, + [ + choice.map(function (i) { + return ["", "", "group_" + i]; + }), + "vcard", + ], + ], + 1, + true, + ]; } - game.me.chooseButtonOL(chosen,function(player,result){ - if(player==game.me) player.trueIdentity=result.links[0][2].slice(6); - }).set('switchToAuto',function(){ - _status.event.result='ai'; - }).set('processAI',function(){ - return { - bool:true, - links:[_status.event.dialog.buttons.randomGet().link], - } - }); - } - else event._result={}; - 'step 2' - if(!result) result={}; - var result2=event.result2; - game.broadcastAll(function(result,result2){ - for(var i=0;i根据“烽火”的数量,所有吴势力角色可于其准备阶段选择并获得其中一个技能直到回合结束:一张以上:〖英姿〗;两张以上:〖好施〗;三张以上:〖涉猎〗;四张以上:〖度势〗;五张以上:可额外选择一项。
          锁定技,当你受到【杀】或锦囊牌造成的伤害后,你将一张“烽火”置入弃牌堆。', - yuanjiangfenghuotu_ab:'江图', - yuanjiangfenghuotu_bg:'图', - wuxin:'悟心', - wuxin_info:'摸牌阶段开始时,你可以观看牌堆顶的X张牌(X为群势力角色的数量),然后将这些牌以任意顺序置于牌堆顶。', - hongfa:'弘法', - hongfa_use:'天兵', - hongfa_respond:'天兵', - hongfa_info:'君主技,锁定技,此武将牌明置时,你获得“黄巾天兵符”;准备阶段,若没有“天兵”,你将牌堆顶的X张牌置于“黄巾天兵符”上,称为“天兵”(X为群势力角色的数量)。', - wendao:'问道', - wendao_info:'出牌阶段限一次,你可以弃置一张不为【太平要术】的红色牌,然后获得弃牌堆或场上的一张【太平要术】。', - huangjintianbingfu:'黄巾天兵符', - huangjintianbingfu_ab:'兵符', - huangjintianbingfu_bg:'符', - huangjintianbingfu_info:'锁定技,当你计算群势力角色数时,每一张“天兵”均可视为一名群势力角色。
          当你失去体力时,你可改为将一张“天兵”置入弃牌堆。
          与你势力相同的角色可将一张“天兵”当作【杀】使用或打出。', - wuhujiangdaqi:'五虎将大旗', - wuhujiangdaqi_ab:'将旗', - wuhujiangdaqi_bg:'旗', - wuhujiangdaqi_info:'存活的蜀势力角色的技能按以下规则改动:
          武圣:将“红色牌”改为“任意牌”
          咆哮:增加描述“你使用的【杀】无视其他角色的防具”
          龙胆:增加描述“你发动〖龙胆〗使用或打出牌时摸一张牌”
          烈弓:增加描述“你的攻击范围+1”
          铁骑:将“一张明置的武将牌”改为“所有明置的武将牌”', - zhangwu:'章武', - zhangwu_info:'锁定技。当【飞龙夺凤】进入弃牌堆或其他角色的装备区后,你获得之。当你不因使用而失去【飞龙夺风】时,你展示此牌,将此牌置于牌堆底并摸两张牌。', - shouyue:'授钺', - shouyue_info:'君主技。只要此武将牌处于明置状态,你便拥有“五虎将大旗”。', - jizhao:'激诏', - jizhao_bg:'诏', - jizhao_info:'限定技。当你处于濒死状态时,你可以将手牌补至体力上限,体力回复至2点,失去技能〖授钺〗并获得技能〖仁德〗。', - gzshoucheng:'守成', - gzshoucheng_info:'当与你势力相同的一名角色于其回合外失去手牌时,若其没有手牌,则你可以令其摸一张牌。', - gzmingshi:'名士', - gzmingshi_info:'锁定技,当你受到伤害时,若伤害来源有暗置的武将牌,此伤害-1。', - fengshi:'锋矢', - fengshi_sha:'锋矢', - fengshi_info:'阵法技,在一个围攻关系中,若你是围攻角色,则你或另一名围攻角色使用【杀】指定被围攻角色为目标后,可令该角色弃置装备区内的一张牌。', - gzsuishi:'随势', - gzsuishi2:'随势', - gzsuishi_info:'锁定技,其他角色进入濒死状态时,若伤害来源与你势力相同,你摸一张牌;其他角色死亡时,若其与你势力相同,你失去1点体力。', - baoling:'暴凌', - baoling_info:'主将技,锁定技,出牌阶段结束时,若你有副将,则你移除副将,然后加3点体力上限,回复3点体力,失去技能〖暴凌〗并获得〖崩坏〗。', - yingyang:'鹰扬', - yingyang_info:'当你的拼点牌亮出后,你可以令此牌的点数+3或-3(至多为K,至少为1)。', - hunshang:'魂殇', - hunshang_info:'副将技,此武将牌减少半个阴阳鱼;准备阶段,若你的体力值不大于1,则你本回合获得“英姿”和“英魂”。', - gzguixiu:'闺秀', - gzguixiu_info:'当你明置此武将牌时,你可以摸两张牌;当你移除此武将牌时,你可以回复1点体力。', - gzcunsi:'存嗣', - gzcunsi_info:'出牌阶段,你可以移除此武将牌并选择一名角色,然后其获得技能〖勇决〗,若你选择的目标角色不是自己,则其摸两张牌。', - gzyongjue:'勇决', - gzyongjue_info:'与你势力相同的一名角色于其回合内使用【杀】结算完成后,若此牌是其本回合内使用的第一张牌,则其可以获得此牌对应的所有实体牌。', - gzqianxi:'潜袭', - gzqianxi_info:'准备阶段,你可以进行判定,然后你选择距离为1的一名角色,直到回合结束,该角色不能使用或打出与结果颜色相同的手牌。', - gzshangyi:'尚义', - gzshangyi_info:'出牌阶段限一次,你可以令一名其他角色观看你的手牌。若如此做,你选择一项:1.观看其手牌并可以弃置其中的一张黑色牌;2.观看其所有暗置的武将牌。', - niaoxiang:'鸟翔', - niaoxiang_sha:'鸟翔', - niaoxiang_info:'阵法技,在同一个围攻关系中,若你是围攻角色,则你或另一名围攻角色使用【杀】指定被围攻角色为目标后,该角色需依次使用两张【闪】才能抵消。', - yicheng:'疑城', - yicheng_info:'当与你势力相同的一名角色成为【杀】的目标后,你可以令该角色摸一张牌,然后弃置一张牌。', - gzyicheng:'疑城', - gzyicheng_info:'阵法技。当你和你队列中的角色使用【杀】指定第一个目标后,或成为【杀】的目标后,其可以摸一张牌,然后弃置一张牌。', - yizhi:'遗志', - yizhi_info:'副将技,此武将牌减少半个阴阳鱼。若你的主将拥有技能〖观星〗,则将其描述中的X改为5;若你的主将没有技能〖观星〗,则你视为拥有技能〖观星〗。', - tianfu:'天覆', - tianfu_info:'主将技,阵法技,若当前回合角色与你处于同一队列,则你视为拥有技能〖看破〗。', - ziliang:'资粮', - ziliang_info:'副将技,当与你势力相同的一名角色受到伤害后,你可以将一张“田”交给该角色。', - gzjixi:'急袭', - gzjixi_info:'主将技,此武将牌减少半个阴阳鱼。你可以将一张“田”当作【顺手牵羊】使用。', - huyuan:'护援', - huyuan_info:'结束阶段,你可以将一张装备牌置入一名角色的装备区,然后你可以弃置该角色距离为1的一名角色的一张牌。', - heyi:'鹤翼', - heyi_info:'阵法技。与你处于同一队列的角色视为拥有技能〖飞影〗。', - gzhuyuan:'护援', - gzhuyuan_info:'结束阶段,你可以选择一项:⒈将一张非装备牌交给一名其他角色。⒉将一张装备牌置入其他角色的装备区内,然后你可以弃置场上的一张牌。', - gz_shibing1wei:'魏兵', - gz_shibing2wei:'魏兵', - gz_shibing1shu:'蜀兵', - gz_shibing2shu:'蜀兵', - gz_shibing1wu:'吴兵', - gz_shibing2wu:'吴兵', - gz_shibing1qun:'群兵', - gz_shibing2qun:'群兵', - gz_shibing1jin:'晋兵', - gz_shibing2jin:'晋兵', - gz_shibing1ye:'士兵', - gz_shibing2ye:'士兵', - gz_shibing1key:'键兵', - gz_shibing2key:'键兵', - gzduanchang:'断肠', - gzduanchang_info:'锁定技,当你死亡时,你令杀死你的角色失去一张武将牌上的所有技能。', - gzweimu:'帷幕', - gzweimu_info:'锁定技,当你成为黑色普通锦囊牌的目标时,或有黑色延时锦囊牌进入你的判定区时,取消之。', - gzqianxun:'谦逊', - gzqianxun_info:'锁定技,当你成为【顺手牵羊】的目标时,或有【乐不思蜀】进入你的判定区时,取消之。', - gzkongcheng:'空城', - gzkongcheng_info:'锁定技,当你成为【杀】或【决斗】的目标时,若你没有手牌,则取消之。', - gzxiaoji:'枭姬', - gzxiaoji_info:'当你失去装备区里的牌后,你可以摸一张牌。若你不是当前回合角色,则你改为摸三张牌。', - gzrende:'仁德', - gzrende_info:'出牌阶段,你可以将任意张手牌交给其他角色,然后若你于此阶段内给出第三张“仁德”牌时,你回复1点体力。', - gzzhiheng:'制衡', - gzzhiheng_info:'出牌阶段限一次,你可以弃置至多X张牌(X为你的体力上限),然后摸等量的牌。', - duoshi:'度势', - duoshi_info:'出牌阶段限四次,你可以将一张红色手牌当做【以逸待劳】使用。', - gzxiaoguo:'骁果', - gzxiaoguo_info:'其他角色的结束阶段,你可以弃置一张基本牌,令该角色选择一项:1.弃置一张装备牌;2.受到你对其造成的1点伤害。', + jubao: "聚宝", + jubao_info: + "锁定技,你装备区里的宝物牌不能被其他角色获得。结束阶段,若场上或弃牌堆有【定澜夜明珠】,则你摸一张牌,然后获得装备区里有【定澜夜明珠】角色的一张牌。", + jiahe: "嘉禾", + jiahe_info: "君主技,只要此武将牌处于明置状态,你便拥有“缘江烽火图”。", + jiahe_put: "烽火", + jiahe_put_info: "出牌阶段限一次,你可以将一张装备牌置于“缘江烽火图”上,称之为“烽火”。", + jiahe_skill: "缘江烽火图", + yuanjiangfenghuotu: "缘江烽火图", + yuanjiangfenghuotu_info: + "每名吴势力角色的出牌阶段限一次,该角色可以将一张装备牌置于“缘江烽火图”上,称之为“烽火”。
          根据“烽火”的数量,所有吴势力角色可于其准备阶段选择并获得其中一个技能直到回合结束:一张以上:〖英姿〗;两张以上:〖好施〗;三张以上:〖涉猎〗;四张以上:〖度势〗;五张以上:可额外选择一项。
          锁定技,当你受到【杀】或锦囊牌造成的伤害后,你将一张“烽火”置入弃牌堆。", + yuanjiangfenghuotu_ab: "江图", + yuanjiangfenghuotu_bg: "图", + wuxin: "悟心", + wuxin_info: + "摸牌阶段开始时,你可以观看牌堆顶的X张牌(X为群势力角色的数量),然后将这些牌以任意顺序置于牌堆顶。", + hongfa: "弘法", + hongfa_use: "天兵", + hongfa_respond: "天兵", + hongfa_info: + "君主技,锁定技,此武将牌明置时,你获得“黄巾天兵符”;准备阶段,若没有“天兵”,你将牌堆顶的X张牌置于“黄巾天兵符”上,称为“天兵”(X为群势力角色的数量)。", + wendao: "问道", + wendao_info: + "出牌阶段限一次,你可以弃置一张不为【太平要术】的红色牌,然后获得弃牌堆或场上的一张【太平要术】。", + huangjintianbingfu: "黄巾天兵符", + huangjintianbingfu_ab: "兵符", + huangjintianbingfu_bg: "符", + huangjintianbingfu_info: + "锁定技,当你计算群势力角色数时,每一张“天兵”均可视为一名群势力角色。
          当你失去体力时,你可改为将一张“天兵”置入弃牌堆。
          与你势力相同的角色可将一张“天兵”当作【杀】使用或打出。", + wuhujiangdaqi: "五虎将大旗", + wuhujiangdaqi_ab: "将旗", + wuhujiangdaqi_bg: "旗", + wuhujiangdaqi_info: + "存活的蜀势力角色的技能按以下规则改动:
          武圣:将“红色牌”改为“任意牌”
          咆哮:增加描述“你使用的【杀】无视其他角色的防具”
          龙胆:增加描述“你发动〖龙胆〗使用或打出牌时摸一张牌”
          烈弓:增加描述“你的攻击范围+1”
          铁骑:将“一张明置的武将牌”改为“所有明置的武将牌”", + zhangwu: "章武", + zhangwu_info: + "锁定技。当【飞龙夺凤】进入弃牌堆或其他角色的装备区后,你获得之。当你不因使用而失去【飞龙夺风】时,你展示此牌,将此牌置于牌堆底并摸两张牌。", + shouyue: "授钺", + shouyue_info: "君主技。只要此武将牌处于明置状态,你便拥有“五虎将大旗”。", + jizhao: "激诏", + jizhao_bg: "诏", + jizhao_info: + "限定技。当你处于濒死状态时,你可以将手牌补至体力上限,体力回复至2点,失去技能〖授钺〗并获得技能〖仁德〗。", + gzshoucheng: "守成", + gzshoucheng_info: + "当与你势力相同的一名角色于其回合外失去手牌时,若其没有手牌,则你可以令其摸一张牌。", + gzmingshi: "名士", + gzmingshi_info: "锁定技,当你受到伤害时,若伤害来源有暗置的武将牌,此伤害-1。", + fengshi: "锋矢", + fengshi_sha: "锋矢", + fengshi_info: + "阵法技,在一个围攻关系中,若你是围攻角色,则你或另一名围攻角色使用【杀】指定被围攻角色为目标后,可令该角色弃置装备区内的一张牌。", + gzsuishi: "随势", + gzsuishi2: "随势", + gzsuishi_info: + "锁定技,其他角色进入濒死状态时,若伤害来源与你势力相同,你摸一张牌;其他角色死亡时,若其与你势力相同,你失去1点体力。", + baoling: "暴凌", + baoling_info: + "主将技,锁定技,出牌阶段结束时,若你有副将,则你移除副将,然后加3点体力上限,回复3点体力,失去技能〖暴凌〗并获得〖崩坏〗。", + yingyang: "鹰扬", + yingyang_info: "当你的拼点牌亮出后,你可以令此牌的点数+3或-3(至多为K,至少为1)。", + hunshang: "魂殇", + hunshang_info: + "副将技,此武将牌减少半个阴阳鱼;准备阶段,若你的体力值不大于1,则你本回合获得“英姿”和“英魂”。", + gzguixiu: "闺秀", + gzguixiu_info: "当你明置此武将牌时,你可以摸两张牌;当你移除此武将牌时,你可以回复1点体力。", + gzcunsi: "存嗣", + gzcunsi_info: + "出牌阶段,你可以移除此武将牌并选择一名角色,然后其获得技能〖勇决〗,若你选择的目标角色不是自己,则其摸两张牌。", + gzyongjue: "勇决", + gzyongjue_info: + "与你势力相同的一名角色于其回合内使用【杀】结算完成后,若此牌是其本回合内使用的第一张牌,则其可以获得此牌对应的所有实体牌。", + gzqianxi: "潜袭", + gzqianxi_info: + "准备阶段,你可以进行判定,然后你选择距离为1的一名角色,直到回合结束,该角色不能使用或打出与结果颜色相同的手牌。", + gzshangyi: "尚义", + gzshangyi_info: + "出牌阶段限一次,你可以令一名其他角色观看你的手牌。若如此做,你选择一项:1.观看其手牌并可以弃置其中的一张黑色牌;2.观看其所有暗置的武将牌。", + niaoxiang: "鸟翔", + niaoxiang_sha: "鸟翔", + niaoxiang_info: + "阵法技,在同一个围攻关系中,若你是围攻角色,则你或另一名围攻角色使用【杀】指定被围攻角色为目标后,该角色需依次使用两张【闪】才能抵消。", + yicheng: "疑城", + yicheng_info: + "当与你势力相同的一名角色成为【杀】的目标后,你可以令该角色摸一张牌,然后弃置一张牌。", + gzyicheng: "疑城", + gzyicheng_info: + "阵法技。当你和你队列中的角色使用【杀】指定第一个目标后,或成为【杀】的目标后,其可以摸一张牌,然后弃置一张牌。", + yizhi: "遗志", + yizhi_info: + "副将技,此武将牌减少半个阴阳鱼。若你的主将拥有技能〖观星〗,则将其描述中的X改为5;若你的主将没有技能〖观星〗,则你视为拥有技能〖观星〗。", + tianfu: "天覆", + tianfu_info: "主将技,阵法技,若当前回合角色与你处于同一队列,则你视为拥有技能〖看破〗。", + ziliang: "资粮", + ziliang_info: "副将技,当与你势力相同的一名角色受到伤害后,你可以将一张“田”交给该角色。", + gzjixi: "急袭", + gzjixi_info: "主将技,此武将牌减少半个阴阳鱼。你可以将一张“田”当作【顺手牵羊】使用。", + huyuan: "护援", + huyuan_info: + "结束阶段,你可以将一张装备牌置入一名角色的装备区,然后你可以弃置该角色距离为1的一名角色的一张牌。", + heyi: "鹤翼", + heyi_info: "阵法技。与你处于同一队列的角色视为拥有技能〖飞影〗。", + gzhuyuan: "护援", + gzhuyuan_info: + "结束阶段,你可以选择一项:⒈将一张非装备牌交给一名其他角色。⒉将一张装备牌置入其他角色的装备区内,然后你可以弃置场上的一张牌。", + gz_shibing1wei: "魏兵", + gz_shibing2wei: "魏兵", + gz_shibing1shu: "蜀兵", + gz_shibing2shu: "蜀兵", + gz_shibing1wu: "吴兵", + gz_shibing2wu: "吴兵", + gz_shibing1qun: "群兵", + gz_shibing2qun: "群兵", + gz_shibing1jin: "晋兵", + gz_shibing2jin: "晋兵", + gz_shibing1ye: "士兵", + gz_shibing2ye: "士兵", + gz_shibing1key: "键兵", + gz_shibing2key: "键兵", + gzduanchang: "断肠", + gzduanchang_info: "锁定技,当你死亡时,你令杀死你的角色失去一张武将牌上的所有技能。", + gzweimu: "帷幕", + gzweimu_info: + "锁定技,当你成为黑色普通锦囊牌的目标时,或有黑色延时锦囊牌进入你的判定区时,取消之。", + gzqianxun: "谦逊", + gzqianxun_info: + "锁定技,当你成为【顺手牵羊】的目标时,或有【乐不思蜀】进入你的判定区时,取消之。", + gzkongcheng: "空城", + gzkongcheng_info: "锁定技,当你成为【杀】或【决斗】的目标时,若你没有手牌,则取消之。", + gzxiaoji: "枭姬", + gzxiaoji_info: "当你失去装备区里的牌后,你可以摸一张牌。若你不是当前回合角色,则你改为摸三张牌。", + gzrende: "仁德", + gzrende_info: + "出牌阶段,你可以将任意张手牌交给其他角色,然后若你于此阶段内给出第三张“仁德”牌时,你回复1点体力。", + gzzhiheng: "制衡", + gzzhiheng_info: "出牌阶段限一次,你可以弃置至多X张牌(X为你的体力上限),然后摸等量的牌。", + duoshi: "度势", + duoshi_info: "出牌阶段限四次,你可以将一张红色手牌当做【以逸待劳】使用。", + gzxiaoguo: "骁果", + gzxiaoguo_info: + "其他角色的结束阶段,你可以弃置一张基本牌,令该角色选择一项:1.弃置一张装备牌;2.受到你对其造成的1点伤害。", - gzdangxian:'当先', - gzdangxian_info:'锁定技。当你首次明置此武将牌时,你获得一枚“先驱”标记。回合开始时,你获得一个额外的出牌阶段。', - gzhuanshi:'缓释', - gzhuanshi_info:'一名己方角色的判定牌生效前,你可打出一张牌代替之。', - gzhongyuan:'弘援', - gzhongyuan_info:'①出牌阶段限一次。你可以令一张没有「合纵」标签的卡牌视为拥有「合纵」标签直到本回合结束。②当你即将因合纵效果摸牌时,你可放弃摸牌,并令一名己方角色摸等量的牌。', - gzmingzhe:'明哲', - gzmingzhe_info:'你的回合外,当你使用或打出红色手牌,或失去装备区内的红色装备牌时,你可摸一张牌。', - gzxiongzhi:'雄志', - gzxiongzhi_info:'限定技。出牌阶段,你可依次展示牌堆顶的X张牌并使用之(X为你的体力上限)。', - gzquanbian:'权变', - gzquanbian_info:'当你于出牌阶段内使用/打出手牌时,若此牌有花色且你本回合内未使用/打出过该花色的其他手牌,则你可以观看牌堆顶X张牌,选择获得其中的一张并展示之。若你本回合使用过与得到的牌花色相同的牌,则你本回合内不能再发动〖权变〗。', - gzhuishi:'慧识', - gzhuishi_info:'摸牌阶段,你可以放弃摸牌,改为观看牌堆顶的X张牌,获得其中的一半(向下取整),然后将其余牌置入牌堆底。(X为弃牌堆顶的两张牌的名称字数之和)', - gzqingleng:'清冷', - gzqingleng_info:'一名角色的回合结束时,若其有未明置的武将牌,则你可将一张牌当无距离限制的冰属性【杀】对其使用;若其所有武将牌均未明置,则你摸一张牌。', - gzchoufa:'筹伐', - gzchoufa_info:'出牌阶段限一次,你可展示一名其他角色的一张手牌A。你令其所有类型与A不同的手牌的牌名均视为【杀】且均视为无属性直到本回合结束。', - gzbolan:'博览', - gzbolan_info:'每名角色的出牌阶段限一次。其可以随机展示武将牌堆顶的一张武将牌,然后根据此武将牌包含的势力选择获得一个技能直到回合结束:魏:〖奇策〗;蜀:〖挑衅〗;吴:〖制衡〗;群:〖除疠〗;晋:〖三陈〗。若该角色不为你,则其失去1点体力。', - gzsanchen:'三陈', - gzsanchen_info:'出牌阶段,你可选择一名本回合内未选择过的角色。其摸三张牌,然后弃置三张牌。若其未以此法弃置牌或以此法弃置的牌的类别均不相同,则你于本回合获得一枚“陈”且其摸一张牌;否则你本阶段内不能再发动〖三陈〗。', - gzpozhu:'破竹', - gzpozhu_info:'主将技。此武将牌减少半个阴阳鱼。出牌阶段,你可以移去一枚“陈”并将一张手牌当做【出其不意】使用。', - gzyimie:'夷灭', - gzyimie_info:'主将技,此武将牌减少一整个阴阳鱼。每回合限一次,当你对其他角色造成伤害时,若伤害值X小于Y,则你可失去1点体力,将伤害值改为Y。此伤害结算结束后,其回复(Y-X)点体力。(Y为其体力值)', - gztairan:'泰然', - gztairan_info:'出牌阶段开始时,你可以失去任意点体力并弃置任意张牌(弃牌数不能大于你已损失的体力值)。若如此做,本回合结束时,你回复等量的体力并摸等量的牌。', - gzxuanbei:'选备', - gzxuanbei_info:'①当你首次明置此武将牌时,你获得两张拥有“应变”或“合纵”标签的牌(不足则摸牌),且你本回合内使用带有“应变”标签的牌时直接强化,使用带有“合纵”标签的牌时摸一张牌。②当你死亡时,你可以令一名其他角色变更副将。', - gzzhaosong:'诏颂', - gzzhaosong_info:'每局游戏每项限一次。①一名角色进入濒死状态时,你可以令其回复至2点体力并摸一张牌。②出牌阶段,你可观看一名其他角色的所有暗置武将牌和手牌,然后可以获得其区域内的一张牌。③一名角色使用【杀】选择唯一目标后,你可以为此【杀】增加两个目标。', - gzlisi:'离思', - gzlisi_info:'一名己方角色死亡后,你可以选择〖诏颂〗中的一个已发动过的选项,令其视为未发动过。', - gzcaiyuan:'才媛', - gzcaiyuan_info:'锁定技。结束阶段,若你的手牌数大于本回合开始时的手牌数,则你摸两张牌或回复1点体力。', - gzwanyi:'婉嫕', - gzwanyi_info:'出牌阶段每项各限一次。你可以将一张带有“合纵”标签的牌当做【联军盛宴】/【火烧连营】/【挟天子以令诸侯】/【戮力同心】使用。', - gzwanyi_info_guozhan_yingbian:'出牌阶段每项各限一次。你可以将一张带有“应变”标签的牌当做【逐近弃远】/【洞烛先机】/【水淹七军】/【出其不意】使用。', - gzmaihuo:'埋祸', - gzmaihuo_info:'限定技。当有己方角色成为【杀】的目标时,你可以取消此【杀】的所有目标。然后此【杀】的使用者下回合开始时,其视为对你使用一张【杀】。若此【杀】对你造成伤害,则你防止此伤害,摸两张牌并移除此武将牌(若此武将牌为副将则改为变更副将)。', - gzzhenxi:'震袭', - gzzhenxi_info:'当你使用【杀】指定目标后,你可以选择一项:1.弃置目标角色一张牌;2.将一张♦非锦囊牌当做【乐不思蜀】或♣非锦囊牌当做【兵粮寸断】对目标角色使用;3.背水:若其有暗置的武将牌且你的武将牌均明置,则你可以依次执行这两项。', - gzjiansu:'俭素', - gzjiansu_tag:'俭', - gzjiansu_info:'副将技。此武将牌减少半个阴阳鱼。①当你于回合外得到牌后,你可以展示这些牌,称为“俭”。②出牌阶段开始时,你可以弃置任意张“俭”,令一名体力值不大于X的角色回复1点体力(X为你以此法弃置的牌数)。', - gzzhuidu:'追妒', - gzzhuidu_info:'出牌阶段限一次。当你造成伤害时,你可以令受伤角色选择一项:1.此伤害+1;2.弃置装备区里的所有牌。若该角色为女性,则你可以弃置一张牌,改为令其选择两项。', - gzshigong:'示恭', - gzshigong_info:'限定技。当你于回合外进入濒死状态时,你可以移除副将,然后令当前回合角色选择一项:1.获得你以此法移除的副将武将牌上的一个没有技能标签的技能,然后令你将体力值回复至体力上限;2.令你将体力值回复至1点。', - gz_old_huaxiong:'华雄', - gzyaowu:'耀武', - gzyaowu_info:'限定技。当你造成伤害后,你可以明置此武将牌,然后你加2点体力上限并回复2点体力,修改〖恃勇〗,且当你死亡后,所有与你势力相同的角色失去1点体力。', - gzshiyong:'恃勇', - gzshiyong_info:'锁定技。当你受到牌造成的伤害后,若此牌不为红色,你摸一张牌。', - gzshiyongx:'恃勇·改', - gzshiyongx_info:'锁定技。当你受到牌造成的伤害后,若此牌不为黑色,伤害来源摸一张牌。', - gztanfeng:'探锋', - gztanfeng_info:'准备阶段,你可以弃置与你势力不同的一名角色区域内的一张牌,然后其可以令你对其造成1点火焰伤害,并令你跳过本回合的一个阶段(准备阶段和结束阶段除外)。', + gzdangxian: "当先", + gzdangxian_info: + "锁定技。当你首次明置此武将牌时,你获得一枚“先驱”标记。回合开始时,你获得一个额外的出牌阶段。", + gzhuanshi: "缓释", + gzhuanshi_info: "一名己方角色的判定牌生效前,你可打出一张牌代替之。", + gzhongyuan: "弘援", + gzhongyuan_info: + "①出牌阶段限一次。你可以令一张没有「合纵」标签的卡牌视为拥有「合纵」标签直到本回合结束。②当你即将因合纵效果摸牌时,你可放弃摸牌,并令一名己方角色摸等量的牌。", + gzmingzhe: "明哲", + gzmingzhe_info: + "你的回合外,当你使用或打出红色手牌,或失去装备区内的红色装备牌时,你可摸一张牌。", + gzxiongzhi: "雄志", + gzxiongzhi_info: "限定技。出牌阶段,你可依次展示牌堆顶的X张牌并使用之(X为你的体力上限)。", + gzquanbian: "权变", + gzquanbian_info: + "当你于出牌阶段内使用/打出手牌时,若此牌有花色且你本回合内未使用/打出过该花色的其他手牌,则你可以观看牌堆顶X张牌,选择获得其中的一张并展示之。若你本回合使用过与得到的牌花色相同的牌,则你本回合内不能再发动〖权变〗。", + gzhuishi: "慧识", + gzhuishi_info: + "摸牌阶段,你可以放弃摸牌,改为观看牌堆顶的X张牌,获得其中的一半(向下取整),然后将其余牌置入牌堆底。(X为弃牌堆顶的两张牌的名称字数之和)", + gzqingleng: "清冷", + gzqingleng_info: + "一名角色的回合结束时,若其有未明置的武将牌,则你可将一张牌当无距离限制的冰属性【杀】对其使用;若其所有武将牌均未明置,则你摸一张牌。", + gzchoufa: "筹伐", + gzchoufa_info: + "出牌阶段限一次,你可展示一名其他角色的一张手牌A。你令其所有类型与A不同的手牌的牌名均视为【杀】且均视为无属性直到本回合结束。", + gzbolan: "博览", + gzbolan_info: + "每名角色的出牌阶段限一次。其可以随机展示武将牌堆顶的一张武将牌,然后根据此武将牌包含的势力选择获得一个技能直到回合结束:魏:〖奇策〗;蜀:〖挑衅〗;吴:〖制衡〗;群:〖除疠〗;晋:〖三陈〗。若该角色不为你,则其失去1点体力。", + gzsanchen: "三陈", + gzsanchen_info: + "出牌阶段,你可选择一名本回合内未选择过的角色。其摸三张牌,然后弃置三张牌。若其未以此法弃置牌或以此法弃置的牌的类别均不相同,则你于本回合获得一枚“陈”且其摸一张牌;否则你本阶段内不能再发动〖三陈〗。", + gzpozhu: "破竹", + gzpozhu_info: + "主将技。此武将牌减少半个阴阳鱼。出牌阶段,你可以移去一枚“陈”并将一张手牌当做【出其不意】使用。", + gzyimie: "夷灭", + gzyimie_info: + "主将技,此武将牌减少一整个阴阳鱼。每回合限一次,当你对其他角色造成伤害时,若伤害值X小于Y,则你可失去1点体力,将伤害值改为Y。此伤害结算结束后,其回复(Y-X)点体力。(Y为其体力值)", + gztairan: "泰然", + gztairan_info: + "出牌阶段开始时,你可以失去任意点体力并弃置任意张牌(弃牌数不能大于你已损失的体力值)。若如此做,本回合结束时,你回复等量的体力并摸等量的牌。", + gzxuanbei: "选备", + gzxuanbei_info: + "①当你首次明置此武将牌时,你获得两张拥有“应变”或“合纵”标签的牌(不足则摸牌),且你本回合内使用带有“应变”标签的牌时直接强化,使用带有“合纵”标签的牌时摸一张牌。②当你死亡时,你可以令一名其他角色变更副将。", + gzzhaosong: "诏颂", + gzzhaosong_info: + "每局游戏每项限一次。①一名角色进入濒死状态时,你可以令其回复至2点体力并摸一张牌。②出牌阶段,你可观看一名其他角色的所有暗置武将牌和手牌,然后可以获得其区域内的一张牌。③一名角色使用【杀】选择唯一目标后,你可以为此【杀】增加两个目标。", + gzlisi: "离思", + gzlisi_info: "一名己方角色死亡后,你可以选择〖诏颂〗中的一个已发动过的选项,令其视为未发动过。", + gzcaiyuan: "才媛", + gzcaiyuan_info: + "锁定技。结束阶段,若你的手牌数大于本回合开始时的手牌数,则你摸两张牌或回复1点体力。", + gzwanyi: "婉嫕", + gzwanyi_info: + "出牌阶段每项各限一次。你可以将一张带有“合纵”标签的牌当做【联军盛宴】/【火烧连营】/【挟天子以令诸侯】/【戮力同心】使用。", + gzwanyi_info_guozhan_yingbian: + "出牌阶段每项各限一次。你可以将一张带有“应变”标签的牌当做【逐近弃远】/【洞烛先机】/【水淹七军】/【出其不意】使用。", + gzmaihuo: "埋祸", + gzmaihuo_info: + "限定技。当有己方角色成为【杀】的目标时,你可以取消此【杀】的所有目标。然后此【杀】的使用者下回合开始时,其视为对你使用一张【杀】。若此【杀】对你造成伤害,则你防止此伤害,摸两张牌并移除此武将牌(若此武将牌为副将则改为变更副将)。", + gzzhenxi: "震袭", + gzzhenxi_info: + "当你使用【杀】指定目标后,你可以选择一项:1.弃置目标角色一张牌;2.将一张♦非锦囊牌当做【乐不思蜀】或♣非锦囊牌当做【兵粮寸断】对目标角色使用;3.背水:若其有暗置的武将牌且你的武将牌均明置,则你可以依次执行这两项。", + gzjiansu: "俭素", + gzjiansu_tag: "俭", + gzjiansu_info: + "副将技。此武将牌减少半个阴阳鱼。①当你于回合外得到牌后,你可以展示这些牌,称为“俭”。②出牌阶段开始时,你可以弃置任意张“俭”,令一名体力值不大于X的角色回复1点体力(X为你以此法弃置的牌数)。", + gzzhuidu: "追妒", + gzzhuidu_info: + "出牌阶段限一次。当你造成伤害时,你可以令受伤角色选择一项:1.此伤害+1;2.弃置装备区里的所有牌。若该角色为女性,则你可以弃置一张牌,改为令其选择两项。", + gzshigong: "示恭", + gzshigong_info: + "限定技。当你于回合外进入濒死状态时,你可以移除副将,然后令当前回合角色选择一项:1.获得你以此法移除的副将武将牌上的一个没有技能标签的技能,然后令你将体力值回复至体力上限;2.令你将体力值回复至1点。", + gz_old_huaxiong: "华雄", + gzyaowu: "耀武", + gzyaowu_info: + "限定技。当你造成伤害后,你可以明置此武将牌,然后你加2点体力上限并回复2点体力,修改〖恃勇〗,且当你死亡后,所有与你势力相同的角色失去1点体力。", + gzshiyong: "恃勇", + gzshiyong_info: "锁定技。当你受到牌造成的伤害后,若此牌不为红色,你摸一张牌。", + gzshiyongx: "恃勇·改", + gzshiyongx_info: "锁定技。当你受到牌造成的伤害后,若此牌不为黑色,伤害来源摸一张牌。", + gztanfeng: "探锋", + gztanfeng_info: + "准备阶段,你可以弃置与你势力不同的一名角色区域内的一张牌,然后其可以令你对其造成1点火焰伤害,并令你跳过本回合的一个阶段(准备阶段和结束阶段除外)。", //官盗「群雄割据」 - gzduanshi:'断势', - gzduanshi_info:'主将技,锁定技。此武将牌减少半个阴阳鱼。当一名角色因杀死与你势力相同的角色而摸牌时,其少摸一张牌。然后你摸一张牌。', - gzjingce:'精策', - gzjingce_info:'回合结束时,若于本回合内进入弃牌堆的牌数不小于X,你可以执行一个额外的摸牌阶段;若你本回合使用过的牌数不小于X,你可以执行一个额外的出牌阶段(X为你的体力值)。', - gzzhengrong:'征荣', - gzzhengrong_info:'锁定技。①你至大势力角色的距离-1。②当你选择“军令”时,你令可选军令数量+1。③当你造成或受到伤害时,若你没有存活的队友,则此伤害+1。', - gzhongju:'鸿举', - gzhongju_info:'限定技。出牌阶段,你可以选择一名其他角色A并选择一个“军令”。你执行该军令,然后令除A以外的所有其他角色依次选择一项:⒈执行该军令。⒉于本回合视为移出游戏。', - gzbiaozhao:'表召', - gzbiaozhao_info:'出牌阶段限一次。你可以选择两名势力不同的其他角色A和B。你视为对A使用一张【知己知彼】,然后将一张牌交给B并摸一张牌。', - gzyechou:'业仇', - gzyechou_info:'锁定技。当你死亡时,你视为对杀死你的角色依次使用三张【杀】,其中第一张不可被响应,第二张无视防具,第三张对其造成的伤害+1。若其以此法进入濒死状态,则于本次濒死结算中除其外与其势力相同的角色不能对其使用【桃】。', + gzduanshi: "断势", + gzduanshi_info: + "主将技,锁定技。此武将牌减少半个阴阳鱼。当一名角色因杀死与你势力相同的角色而摸牌时,其少摸一张牌。然后你摸一张牌。", + gzjingce: "精策", + gzjingce_info: + "回合结束时,若于本回合内进入弃牌堆的牌数不小于X,你可以执行一个额外的摸牌阶段;若你本回合使用过的牌数不小于X,你可以执行一个额外的出牌阶段(X为你的体力值)。", + gzzhengrong: "征荣", + gzzhengrong_info: + "锁定技。①你至大势力角色的距离-1。②当你选择“军令”时,你令可选军令数量+1。③当你造成或受到伤害时,若你没有存活的队友,则此伤害+1。", + gzhongju: "鸿举", + gzhongju_info: + "限定技。出牌阶段,你可以选择一名其他角色A并选择一个“军令”。你执行该军令,然后令除A以外的所有其他角色依次选择一项:⒈执行该军令。⒉于本回合视为移出游戏。", + gzbiaozhao: "表召", + gzbiaozhao_info: + "出牌阶段限一次。你可以选择两名势力不同的其他角色A和B。你视为对A使用一张【知己知彼】,然后将一张牌交给B并摸一张牌。", + gzyechou: "业仇", + gzyechou_info: + "锁定技。当你死亡时,你视为对杀死你的角色依次使用三张【杀】,其中第一张不可被响应,第二张无视防具,第三张对其造成的伤害+1。若其以此法进入濒死状态,则于本次濒死结算中除其外与其势力相同的角色不能对其使用【桃】。", //官盗「十年经典」 - gzdianhu:'点虎', - gzdianhu_info:'锁定技。当你首次明置此武将牌时,你选择一名其他角色。与你势力相同的角色对其造成伤害后,伤害来源摸一张牌。', - gzjianji:'谏计', - gzjianji_info:'出牌阶段限一次。你可以令一名角色摸一张牌并展示之,然后其可以使用此牌。', - gzgongjian:'攻坚', - gzgongjian_info:'①当其他角色的牌因弃置而进入弃牌堆后,若令其弃置这些牌的角色为你,你获得其中所有的【杀】。②每回合限一次,当一名角色使用【杀】指定目标后,若有目标与本局游戏上一张被使用的【杀】相同,你可以令这些目标弃置两张牌。', - gzkuimang:'溃蟒', - gzkuimang_info:'锁定技。当你杀死与你势力不同且处于队列的角色时,你摸两张牌。', - gzyinpan:'引叛', - gzyinpan_info:'出牌阶段限一次。你可以选择一名其他角色,令所有与其势力不同的角色依次选择是否对其使用一张【杀】。然后其下回合使用【杀】的次数上限+X(X为其以此法受到的伤害次数),若其以此法进入过濒死状态,其回复1点体力。', - gzxingmou:'兴谋', - gzxingmou_info:'锁定技。①你杀死其他角色或其他角色杀死你均不执行奖惩。②其他角色因执行奖惩而摸牌时,你摸一张牌。', + gzdianhu: "点虎", + gzdianhu_info: + "锁定技。当你首次明置此武将牌时,你选择一名其他角色。与你势力相同的角色对其造成伤害后,伤害来源摸一张牌。", + gzjianji: "谏计", + gzjianji_info: "出牌阶段限一次。你可以令一名角色摸一张牌并展示之,然后其可以使用此牌。", + gzgongjian: "攻坚", + gzgongjian_info: + "①当其他角色的牌因弃置而进入弃牌堆后,若令其弃置这些牌的角色为你,你获得其中所有的【杀】。②每回合限一次,当一名角色使用【杀】指定目标后,若有目标与本局游戏上一张被使用的【杀】相同,你可以令这些目标弃置两张牌。", + gzkuimang: "溃蟒", + gzkuimang_info: "锁定技。当你杀死与你势力不同且处于队列的角色时,你摸两张牌。", + gzyinpan: "引叛", + gzyinpan_info: + "出牌阶段限一次。你可以选择一名其他角色,令所有与其势力不同的角色依次选择是否对其使用一张【杀】。然后其下回合使用【杀】的次数上限+X(X为其以此法受到的伤害次数),若其以此法进入过濒死状态,其回复1点体力。", + gzxingmou: "兴谋", + gzxingmou_info: + "锁定技。①你杀死其他角色或其他角色杀死你均不执行奖惩。②其他角色因执行奖惩而摸牌时,你摸一张牌。", //官正「十年踪迹十年心」 - gzyouyan:'诱言', - gzyouyan_info:'回合内限一次。当你的牌因弃置而进入弃牌堆后,你可以展示牌堆顶的四张牌,然后获得其中与你此次弃置的牌花色均不同的牌。', - gzzhuihuan:'追还', - gzzhuihuan_info:'结束阶段,你可以选择至多两名角色,然后依次为被选择的角色标记A或B(字母不能重复标记)。直到你的下回合开始,当A第一次受到伤害后,其对来源造成1点伤害;当B第一次受到伤害后,来源弃置两张手牌。', + gzyouyan: "诱言", + gzyouyan_info: + "回合内限一次。当你的牌因弃置而进入弃牌堆后,你可以展示牌堆顶的四张牌,然后获得其中与你此次弃置的牌花色均不同的牌。", + gzzhuihuan: "追还", + gzzhuihuan_info: + "结束阶段,你可以选择至多两名角色,然后依次为被选择的角色标记A或B(字母不能重复标记)。直到你的下回合开始,当A第一次受到伤害后,其对来源造成1点伤害;当B第一次受到伤害后,来源弃置两张手牌。", //插个眼,手杀国战新张鲁 - gzrebushi:'布施', - gzrebushi_info:'①回合结束后,你获得X个“义舍”标记(X为你的体力值)。②其他角色的准备阶段,你可以失去1个“义舍”标记,交给其一张牌并摸两张牌。③准备阶段,你须弃置Y张牌,然后失去所有“义舍”标记(Y为场上存活人数-你的体力值-2)。', - gzremidao:'米道', - gzremidao_info:'①结束阶段,若你的武将牌上没有“米”,则你可以摸两张牌。若如此做,你将两张牌置于武将牌上,称为“米”。②一名角色的判定牌生效前,你可以打出一张“米”作为新的判定牌,然后你获得原判定牌。', - jiahe_reyingzi:'英姿', - jiahe_haoshi:'好施', - jiahe_shelie:'涉猎', - jiahe_duoshi:'度势', + gzrebushi: "布施", + gzrebushi_info: + "①回合结束后,你获得X个“义舍”标记(X为你的体力值)。②其他角色的准备阶段,你可以失去1个“义舍”标记,交给其一张牌并摸两张牌。③准备阶段,你须弃置Y张牌,然后失去所有“义舍”标记(Y为场上存活人数-你的体力值-2)。", + gzremidao: "米道", + gzremidao_info: + "①结束阶段,若你的武将牌上没有“米”,则你可以摸两张牌。若如此做,你将两张牌置于武将牌上,称为“米”。②一名角色的判定牌生效前,你可以打出一张“米”作为新的判定牌,然后你获得原判定牌。", + jiahe_reyingzi: "英姿", + jiahe_haoshi: "好施", + jiahe_shelie: "涉猎", + jiahe_duoshi: "度势", //国战典藏2023 - gzdiaodu:'调度', - gzdiaodu_info:'①与你势力相同的角色使用装备牌时,其可以摸一张牌。②出牌阶段开始时,你可以获得一名与你势力相同的角色的装备区里的一张牌,然后你将此牌交给另一名角色。', - gzqiance:'谦策', - gzqiance_info:'与你势力相同的角色使用锦囊牌指定第一个目标后,你可以令其中的所有大势力角色无法响应此牌。', - gzjujian:'举荐', - gzjujian_info:'副将技,锁定技。①此武将牌计算体力上限时减少半个阴阳鱼。②与你势力相同的角色进入濒死状态时,你可以令其将体力值回复至1点,然后你变更副将。', - gztongling:'通令', - gztongling_info:'出牌阶段限一次,当你对一名与你势力不同的角色A造成伤害后,你可以选择一名与你势力相同的角色B,令B选择是否对A使用一张牌。若B选择使用,则此牌结算后,若此牌造成过伤害,你和B各摸两张牌,否则A获得你对其造成伤害的牌。', - gzjinyu:'近谀', - gzjinyu_info:'当你明置此武将牌后,你令所有与你距离为1以内的角色依次执行以下效果:若其武将牌均明置,则其选择一张武将牌暗置,否则其弃置两张牌。', - gzrehuaiyi:'怀异', - gzrehuaiyi_info:'出牌阶段限一次,你可以展示所有手牌。若其中至少包含两种颜色,则你可以弃置其中一种颜色的所有牌,然后获得至多等量名角色的各一张牌。然后你将以此法得到的装备牌置于武将牌上,称为“异”。你可以将“异”如手牌般使用或打出。', - gzrezisui:'恣睢', - gzrezisui_info:'锁定技。①摸牌阶段,你多摸X张牌。②结束阶段,若X大于你的体力上限,你死亡(X为你武将牌上的“异”数)。', - gztaidan:'太丹', - gztaidan_taipingyaoshu:'太丹', - gztaidan_info:'锁定技,若你的防具栏为空且你的防具栏未被废除,你视为装备【太平要术】。', - gzrejinghe:'经合', - gzrejinghe_info:'出牌阶段限一次,你可以转动“天书”,然后令一名角色获得“天书”向上一面的技能直到你的下个回合开始。', - gzrejinghe_faq:'转动“天书”', - gzrejinghe_faq_info:'
        • 若游戏未拥有“天书”,系统将[雷击,阴兵,活气,鬼助,仙授,论道,观月,言政]以顺时针方向组成圆环作为“天书”,并转动圆环将随机一个技能至于最上面。
        • 若游戏已拥有“天书”,则以逆时针方向转动转动“天书”至下个技能于最上面。', + gzdiaodu: "调度", + gzdiaodu_info: + "①与你势力相同的角色使用装备牌时,其可以摸一张牌。②出牌阶段开始时,你可以获得一名与你势力相同的角色的装备区里的一张牌,然后你将此牌交给另一名角色。", + gzqiance: "谦策", + gzqiance_info: + "与你势力相同的角色使用锦囊牌指定第一个目标后,你可以令其中的所有大势力角色无法响应此牌。", + gzjujian: "举荐", + gzjujian_info: + "副将技,锁定技。①此武将牌计算体力上限时减少半个阴阳鱼。②与你势力相同的角色进入濒死状态时,你可以令其将体力值回复至1点,然后你变更副将。", + gztongling: "通令", + gztongling_info: + "出牌阶段限一次,当你对一名与你势力不同的角色A造成伤害后,你可以选择一名与你势力相同的角色B,令B选择是否对A使用一张牌。若B选择使用,则此牌结算后,若此牌造成过伤害,你和B各摸两张牌,否则A获得你对其造成伤害的牌。", + gzjinyu: "近谀", + gzjinyu_info: + "当你明置此武将牌后,你令所有与你距离为1以内的角色依次执行以下效果:若其武将牌均明置,则其选择一张武将牌暗置,否则其弃置两张牌。", + gzrehuaiyi: "怀异", + gzrehuaiyi_info: + "出牌阶段限一次,你可以展示所有手牌。若其中至少包含两种颜色,则你可以弃置其中一种颜色的所有牌,然后获得至多等量名角色的各一张牌。然后你将以此法得到的装备牌置于武将牌上,称为“异”。你可以将“异”如手牌般使用或打出。", + gzrezisui: "恣睢", + gzrezisui_info: + "锁定技。①摸牌阶段,你多摸X张牌。②结束阶段,若X大于你的体力上限,你死亡(X为你武将牌上的“异”数)。", + gztaidan: "太丹", + gztaidan_taipingyaoshu: "太丹", + gztaidan_info: "锁定技,若你的防具栏为空且你的防具栏未被废除,你视为装备【太平要术】。", + gzrejinghe: "经合", + gzrejinghe_info: + "出牌阶段限一次,你可以转动“天书”,然后令一名角色获得“天书”向上一面的技能直到你的下个回合开始。", + gzrejinghe_faq: "转动“天书”", + gzrejinghe_faq_info: + "
        • 若游戏未拥有“天书”,系统将[雷击,阴兵,活气,鬼助,仙授,论道,观月,言政]以顺时针方向组成圆环作为“天书”,并转动圆环将随机一个技能至于最上面。
        • 若游戏已拥有“天书”,则以逆时针方向转动转动“天书”至下个技能于最上面。", - gz_key_ushio:'冈崎汐', - ushio_huanxin:'幻心', - ushio_huanxin_info:'当你受到伤害后/使用【杀】造成伤害后/使用装备牌后,你可进行判定。然后你获得判定牌并弃置一张牌。', - ushio_xilv:'汐旅', - ushio_xilv2:'汐旅', - ushio_xilv_info:'锁定技,此武将牌可作为任意单势力武将牌的副将。当你进行判定后,你令你的手牌上限+1直至你的下个结束阶段。', + gz_key_ushio: "冈崎汐", + ushio_huanxin: "幻心", + ushio_huanxin_info: + "当你受到伤害后/使用【杀】造成伤害后/使用装备牌后,你可进行判定。然后你获得判定牌并弃置一张牌。", + ushio_xilv: "汐旅", + ushio_xilv2: "汐旅", + ushio_xilv_info: + "锁定技,此武将牌可作为任意单势力武将牌的副将。当你进行判定后,你令你的手牌上限+1直至你的下个结束阶段。", //官盗2023 - fakexiaoguo:'骁果', - fakexiaoguo_info:'一名其他角色的准备阶段,你可以弃置任意张基本牌,然后弃置其装备区等量的牌,若其装备区的牌数小于你弃置的牌数,则你对其造成1点伤害。', - fakeduanbing:'短兵', - fakeduanbing_info:'①你使用【杀】可以额外指定一名距离为1或以内的目标。②当你使用【杀】指定唯一目标后,你令目标角色需要额外使用一张【闪】响应此【杀】。', - fakeduoshi:'度势', - fakeduoshi_info:'每轮限一次,友方角色可以将一张红色手牌当作【以逸待劳】使用,然后若你为小势力角色,你可以令一名友方角色将X张手牌当作不可被响应的【火烧连营】使用(X为此【以逸待劳】指定的目标数)。', - fakehanzhan:'酣战', - fakehanzhan_info:'有你参与的拼点事件结束后,没赢的角色可以获得对方装备区的一张牌。', - fakeshuangxiong:'双雄', - fakeshuangxiong_info:'①摸牌阶段,你可以放弃摸牌并进行判定,本回合你可以将一张与此牌颜色不同的手牌当作【决斗】使用。②当你的判定牌于回合内生效后,你获得此牌。', - fakeyicheng:'疑城', - fakeyicheng_info:'与你势力相同的角色成为【杀】的目标后,你可以令其摸一张牌,然后其可以使用一张装备牌,其于此回合结束时弃置X张牌(X为你本回合对其发动此技能的次数)。', - fakefenming:'奋命', - fakefenming_info:'出牌阶段限一次,若你处于横置状态,你可以弃置所有处于横置状态的角色的各一张牌。', - fakebaoling:'暴凌', - fakebaoling_info:'主将技,锁定技,出牌阶段结束时,若你有副将,则你移除副将,加3点体力上限并回复3点体力,然后获得〖崩坏〗。', - fakebenghuai:'崩坏', - fakebenghuai_info:'结束阶段,若你的体力值不为全场最低,则你选择一项:①失去1点体力;②减1点体力上限;③背水:执行一个额外的摸牌阶段。', - fakediaodu:'调度', - fakediaodu_info:'①每回合每种牌的类别限一次,与你势力相同的角色使用牌时,若此牌有目标且包含其,则其可以摸一张牌。②出牌阶段开始时,你可以获得与你势力相同的一名角色装备区内的一张牌,然后你可以将此牌交给另一名与你势力相同的其他角色。', - fakeyigui:'役鬼', - fakeyigui_info:'①当你首次明置此武将牌时,你将剩余武将牌堆的两张牌称为“魂”置于武将牌上。②你可以展示一张武将牌上的“魂”并将其置入剩余武将牌堆,视为使用一张本回合内未以此法使用过的类别的基本牌或普通锦囊牌(此牌须指定目标,且目标须为未确定势力的角色或野心家或与此“魂”势力相同的角色)。', - fakejihun:'汲魂', - fakejihun_info:'①当你受到伤害后,或与你势力不同的角色脱离濒死状态后,你可以将剩余武将牌堆的一张牌称为“魂”置于武将牌上。②准备阶段,你可以将至多两张“魂”置入剩余武将牌堆,然后将剩余武将牌堆的等量张牌称为“魂”置于武将牌上。', - fakejueyan:'决堰', - fakejizhi:'集智', - fakejueyan_info:'主将技。①此武将牌计算体力上限时减少半个阴阳鱼。②准备阶段,你可以选择一个区域并于本回合的结束阶段弃置此区域的所有牌,然后你于本回合获得以下对应效果:⒈判定区:跳过判定阶段,获得〖集智〗直到回合结束;⒉装备区:摸三张牌,本回合手牌上限+3;⒊本回合使用【杀】的额定次数+3。', - fakequanji:'权计', - fakequanji_info:'①每回合每项各限一次,当你造成或受到伤害后,你可以摸X张牌,然后将等量的牌称为“权”置于武将牌上。②你的手牌上限+X(X为你武将牌上的“权”数)。', - fakepaiyi:'排异', - fakepaiyi_info:'出牌阶段限一次,你可以选择一名角色,然后选择一个军令令其选择是否执行。若其执行,则你摸X张牌,然后将一张“权”置入弃牌堆;若其不执行,则你可以对至多X名与其势力相同的角色各造成1点伤害,然后将等量的“权”置入弃牌堆。(X为你武将牌上的“权”数)', - fakeshilu:'嗜戮', - fakeshilu_info:'①出牌阶段结束时,若你有副将且本阶段未发动过副将武将牌上的非锁定技,则你更换副将至你武将牌上的“戮”未包含的势力并将原副将称为“戮”置于武将牌上。②准备阶段,你弃置X张手牌,然后摸X张牌(X为你武将牌上的“戮”数,少牌全弃,无牌不弃)。', - fakexiongnve:'凶虐', - fakexiongnve_info:'①当你使用【杀】造成伤害时或受到【杀】造成的伤害时,若你武将牌上的“戮”包含伤害来源的势力,则你令此伤害+1。②当你受到不为【杀】造成的伤害时,若你武将牌上的“戮”包含伤害来源的势力,则此伤害-1。', - fakehuaiyi:'怀异', - fakehuaiyi_info:'出牌阶段限一次,你可以移除副将或弃置一个区域的所有牌,然后令所有大势力角色依次交给你至少一张牌,然后若存在多个大势力,则你移除一个此次交给你牌总数唯一最少的势力的其中一名角色的副将。', - fakezisui:'恣睢', - fakezisui_info:'锁定技。①一名角色被你移除副将后,你将被移除的武将牌称为“异”置于武将牌上。②摸牌阶段,你多摸X张牌。③结束阶段,若X大于你的体力上限,你死亡。(X为你武将牌上的“异”数)', - fakejujian:'举荐', - fakejujian_info:'副将技。①此武将牌计算体力上限时减少半个阴阳鱼。②结束阶段,你可以弃置一张非基本牌并选择一名友方角色,令其选择摸两张牌或回复1点体力,然后其可以变更副将。', - fakexibing:'息兵', - fakexibing_info:'当一名其他角色在其出牌阶段内使用第一张黑色【杀】或黑色普通锦囊牌指定唯一角色为目标后,你可令该角色将手牌摸至体力值且本回合不能再使用手牌。若你与其均明置了所有武将牌,则你可以暗置你与其各一张武将牌且本回合不能再明置此武将牌。', - fakechengshang:'承赏', - fakechengshang_info:'出牌阶段限一次,当你使用存在花色和点数且指定了其他势力角色为目标的牌结算完毕后,若你未因此牌造成过伤害,则你可以摸一张牌,然后本阶段你可以将一张手牌当作初始游戏牌堆中与此牌花色和点数相同的另一张基本牌或普通锦囊牌使用一次。', - fakezhente:'贞特', - fakezhente_info:'每回合限一次,当你成为其他角色使用普通锦囊牌或黑色基本牌的目标后,你可令使用者选择一项:1.本回合不能再使用与此牌颜色相同的牌;2.令此牌对你无效。', - fakezhiwei:'至微', - fakezhiwei_info:'你明置此武将牌时,选择一名其他角色。该角色造成伤害后,你摸一张牌,该角色受到伤害后,你随机弃置一张手牌。你弃牌阶段弃置的牌均被该角色获得。该角色死亡时,若你的两个武将牌均明置,你暗置此武将牌。若该角色未死亡,则此武将牌被暗置前,取消之。', - fakekuangcai:'狂才', - fakekuangcai_info:'锁定技,你于回合内使用牌无距离和次数限制;弃牌阶段开始时,若你本回合内:未使用过牌,则你本回合手牌上限+1;使用过牌但未造成过伤害,则你本回合手牌上限-1。', - faketunchu:'屯储', - faketunchu_info:'摸牌阶段,你可以额外摸两张牌,然后你将一至两张牌称为“粮”置于武将牌上。若如此做,你本回合不能使用【杀】。', - fakeshuliang:'输粮', - fakeshuliang_info:'友方角色的结束阶段,若你与其的距离不大于你武将牌上的“粮”数,则你可以移去一张“粮”,然后令其摸两张牌。', - fakedujin:'独进', - fakedujin_info:'①摸牌阶段,你可以额外摸X张牌(X为你装备区的牌数的一半,向上取整)。②当你首次明置此武将牌时,若你为你们势力第一个明置武将牌的角色,则你获得1个“先驱”标记。', - fakezhufu:'注傅', - fakezhufu_info:'出牌阶段,你可以弃置一张本阶段未以此法弃置过的花色的牌,然后根据此牌的花色为你使用的下一张牌添加对应的应变效果:红桃,助战、目标+1;方片,富甲、不可被响应;黑桃,残躯、摸一张牌;草花,空巢、伤害+1。', - fakeguishu:'鬼术', - fakeguishu_info:'出牌阶段限一次,你可以将一张黑桃手牌当作【知己知彼】或【远交近攻】使用。若你本局游戏内已经发动过了〖鬼术〗,则你必须选择与上次不同的选项。', - fakeyuanyu:'远域', - fakeyuanyu_info:'锁定技,当你受到伤害时,若你不在伤害来源的攻击范围内,则防止此伤害。', - fakemibei:'秘备', - fakemibei_info:'①准备阶段,若你的手牌数不为全场最多,则你须选择一名手牌数为全场最多的角色,令其对你发起军令。②当你执行军令后,你将手牌数摸至与发起者相同(至多摸五张)。③当你拒绝执行军令后,你展示一至三张牌,然后你本回合可以将其中一张牌当作另一张基本牌或非延时锦囊牌使用一次。', - fakeqizhi:'奇制', - fakeqizhi_info:'当你于回合内声明使用非装备牌A时,你可以弃置不是此牌目标的一名角色的一张牌B,然后其摸一张牌。若A具有应变效果,且A和B的花色相同,则你无视条件触发A的应变效果。', - fakejinqu:'进趋', - fakejinqu_info:'结束阶段,你可以摸两张牌,然后你将手牌弃置至X张(X为你本回合发动过〖奇制〗的次数)。', - fakejuzhan:'拒战', - fakejuzhan_info:'转换技。阴:当你成为【杀】的目标后,你可以与使用者各摸X张牌,然后若使用者的武将牌均明置,则你可以暗置其一张武将牌,且其本回合不能明置此武将牌。阳,当你使用【杀】指定目标后,你可以获得目标角色的X张牌,然后若你的武将牌均明置,则其可以暗置此武将牌,且你本回合不能明置此武将牌。(X为使用者已损失的体力值且X至少为1)', - fakedanshou:'胆守', - fakedanshou_info:'每轮限一次,一名角色的准备阶段,你可以弃置一个区域的所有牌。若如此做,本回合其每个阶段开始时(准备阶段和结束阶段除外),你摸一张牌或令本回合以此法摸牌数+1,然后若你选择了摸牌且你本次至少摸了四张牌,则你可以对其造成1点伤害。', - fakexunxi:'迅析', - fakexunxi_info:'其他角色于回合外明置武将牌时,你可以视为对其使用一张【杀】(无距离限制)。', - fakehuanjia:'擐甲', - fakehuanjia_info:'锁定技,每回合每项各限一次。①当你成为【杀】的目标后,本回合你视为装备此牌使用者的防具,直到你的装备区中有防具。②当你使用【杀】指定唯一目标后,本回合你视为装备目标角色的武器,直到你的装备区中有武器。', - fakexiongshu:'凶竖', - fakexiongshu_info:'每回合限一次,一名角色使用【杀】或伤害类锦囊牌指定第一个目标后,若你为/不为此牌使用者,则你可以摸一张牌并令一名其他角色成为此牌的伤害来源/弃置一张牌并成为此牌的伤害来源。', - fakejianhui:'奸回', - fakejianhui_info:'当一名角色受到其势力相同的另一名角色造成的伤害后,你可以令其中一名角色摸一张牌,然后弃置其中另一名角色的一张牌。', - fakechongxin:'崇信', - fakechongxin_info:'出牌阶段限一次,你可以选择一名与你势力不同的角色,视为你使用一张指定你与其为目标的【以逸待劳】。', - fakeweirong:'卫戎', - fakeweirong_info:'转换技,每轮限一次,出牌阶段。阴:你可以弃置X张牌,然后当你于本轮不因此法得到牌后,你摸一张牌。阳:你可以摸X张牌,然后当你于本轮不因此法失去牌后,你弃置一张牌。(X为你上一轮以此法摸和弃置的牌数之和,且X至少为1,至多为你的体力上限)', - gz_re_taishici:'太史慈', - gz_xin_zhuran:'朱然', - gz_jin_jiachong:'贾充', - gz_jin_yanghu:'羊祜', - gz_wangling:'王淩', - fakequanbian:'权变', - fakequanbian_tag:'牌堆顶', - fakequanbian_info:'当你于回合内使用或打出牌时,你可以将一张手牌与牌堆顶X张牌的其中一张进行交换(X为你的体力上限)。', - fakezhouting:'骤霆', - fakezhouting_info:'限定技,出牌阶段,你可以依次使用牌堆顶X张牌中所有可以使用的牌,然后获得其中不能使用的牌,然后若有角色因此死亡,则你重置〖骤霆〗(X为你的体力上限)。', - fakexuanbei:'选备', - fakexuanbei_info:'①当你首次明置此武将牌时,你摸两张牌,且你本回合内使用带有“应变”标签的牌时直接强化。②每回合限一次,当你使用带有“应变”标签的牌结算完毕后,你可以令一名其他角色获得此牌对应的所有实体牌。③当你死亡时,你可以令一名其他角色变更副将。', - fakeqingleng:'清冷', - fakeqingleng_info:'其他角色的结束阶段,若其武将牌均明置,则你可以将一张牌当作冰【杀】对其使用(无距离限制)。然后若此牌未对其造成伤害,则你暗置其一张武将牌,且直到其下个回合开始,其明置此武将牌时,你对其造成1点伤害。', - fakexijue:'袭爵', - fakexijue_info:'①当你首次明置此武将牌时,你获得2枚“爵”标记。②回合结束时,若你本回合造成过伤害,则你获得1枚“爵”标记。③你可以于合适的时机发动〖突袭〗或〖骁果〗(至多弃置X张基本牌),然后移去1枚“爵”标记。④摸牌阶段,你改为摸X张牌。(X为你的“爵”标记数,且X至多为你的体力上限)', - fakexijue_xiaoguo:'骁果', - fakexijue_xiaoguo_info:'一名其他角色的准备阶段,你可以弃置至多X张基本牌(X为你的“爵”标记数,且X至多为你的体力上限),然后弃置其装备区等量的牌,若其装备区的牌数小于你弃置的牌数,则你对其造成1点伤害。', - fakeqimei:'齐眉', - fakeqimei_info:'准备阶段,你可以选择一名其他角色。若如此做,直到回合结束:当你或其获得牌/失去手牌后,若你与其手牌数相等,则另一名角色回复1点体力;当你或其的体力值变化后,若你与其体力值相等,则另一名角色摸一张牌。', - fakebaoqie:'宝箧', - fakebaoqie_info:'①当你受到伤害时,若此武将牌未明置过,则你可以明置此武将牌并防止此伤害。②当你首次明置此武将牌时,你可以获得一名角色装备区里所有的宝物牌,然后你可以使用其中的一张牌。', - fakeciwei:'慈威', - fakeciwei_info:'其他角色于一回合内使用第偶数张牌时,你可以弃置一张牌并取消此牌的所有目标,然后若此牌为装备牌,你可以获得之且你可以使用之。', - fakehuirong:'慧容', - fakehuirong_info:'①当你受到伤害时,若此武将牌未明置过,则你可以明置此武将牌并防止此伤害。②当你首次明置此武将牌时,你可以令一名角色将手牌数调整至其体力值。', - fakeyanxi:'宴戏', - fakeyanxi_info:'出牌阶段限一次,你可以展示一名其他角色的一张手牌和牌堆顶的两张牌,然后你获得其中一种颜色或类别的所有牌且本回合手牌上限+X(X为你获得的牌数),然后其获得剩余的牌。', - fakeshiren:'识人', - fakeshiren_info:'①当你受到伤害时,若此武将牌未明置过,则你可以明置此武将牌并防止此伤害。②当你首次明置此武将牌时,你可以发动一次〖宴戏〗。', - fakecanmou:'参谋', - fakecanmou_info:'每回合每项限一次,一名角色使用普通锦囊牌指定第一个目标时,若其手牌数为全场唯一最多,则你可以为此牌增加或减少一个目标(目标数至少为1)。', - fakezhuosheng:'擢升', - fakezhuosheng_info:'每回合每种牌名限一次,你可以将至少两张手牌当作任意基本牌使用,若你以此法使用的牌中包含具有应变效果的牌,则你令此牌无视条件获得对应的应变效果。', - fakejuhou:'拒后', - fakejuhou_info:'阵法技,与你处于同一队列的角色成为【杀】或普通锦囊牌的目标后,你可以令其将任意张牌置于其武将牌上,然后其于此牌结算完毕后获得这些牌。', - gznaxiang:'纳降', - gznaxiang_info:'锁定技,当你受到其他角色造成的伤害后,或你对其他角色造成伤害后,你对其发动〖才望〗时的“弃置”改为“获得”直到你的下回合开始。', - fakecaiwang:'才望', - fakecaiwang_info:'①你可以助战自己。②每回合每项各限一次,当你响应助战后,若你弃置的牌和被强化的牌:颜色相同,你可以弃置一名其他角色的一张牌;颜色不同,你摸一张牌。', - fakenaxiang:'纳降', - fakenaxiang_info:'锁定技。①当你对与你势力不同的角色造成伤害后,或受到与你势力不同的角色对你造成的伤害后。你对其发起军令,若其不执行,则你不能对其发动〖纳降①〗直到你的下个回合开始。②你响应助战弃牌无类别限制,且你触发具有应变的卡牌的条件均视为助战。', - fakehuyuan:'护援', - fakehuyuan_info:'①你的回合内,当一张装备牌进入一名角色的装备区后,你可以弃置与其距离为1以内的另一名角色区域里的一张牌。②结束阶段,你可以将一张装备牌置入一名角色的装备区。', - fakekeshou:'恪守', - fakekeshou_info:'①当你受到伤害时,你可以弃置两张颜色相同的牌并令此伤害-1。②当你因弃置而一次性失去至少两张牌后,若你的势力已确定且场上没有与你势力相同的其他角色,则你可以进行判定,若结果判定为红色,你摸一张牌。', + fakexiaoguo: "骁果", + fakexiaoguo_info: + "一名其他角色的准备阶段,你可以弃置任意张基本牌,然后弃置其装备区等量的牌,若其装备区的牌数小于你弃置的牌数,则你对其造成1点伤害。", + fakeduanbing: "短兵", + fakeduanbing_info: + "①你使用【杀】可以额外指定一名距离为1或以内的目标。②当你使用【杀】指定唯一目标后,你令目标角色需要额外使用一张【闪】响应此【杀】。", + fakeduoshi: "度势", + fakeduoshi_info: + "每轮限一次,友方角色可以将一张红色手牌当作【以逸待劳】使用,然后若你为小势力角色,你可以令一名友方角色将X张手牌当作不可被响应的【火烧连营】使用(X为此【以逸待劳】指定的目标数)。", + fakehanzhan: "酣战", + fakehanzhan_info: "有你参与的拼点事件结束后,没赢的角色可以获得对方装备区的一张牌。", + fakeshuangxiong: "双雄", + fakeshuangxiong_info: + "①摸牌阶段,你可以放弃摸牌并进行判定,本回合你可以将一张与此牌颜色不同的手牌当作【决斗】使用。②当你的判定牌于回合内生效后,你获得此牌。", + fakeyicheng: "疑城", + fakeyicheng_info: + "与你势力相同的角色成为【杀】的目标后,你可以令其摸一张牌,然后其可以使用一张装备牌,其于此回合结束时弃置X张牌(X为你本回合对其发动此技能的次数)。", + fakefenming: "奋命", + fakefenming_info: + "出牌阶段限一次,若你处于横置状态,你可以弃置所有处于横置状态的角色的各一张牌。", + fakebaoling: "暴凌", + fakebaoling_info: + "主将技,锁定技,出牌阶段结束时,若你有副将,则你移除副将,加3点体力上限并回复3点体力,然后获得〖崩坏〗。", + fakebenghuai: "崩坏", + fakebenghuai_info: + "结束阶段,若你的体力值不为全场最低,则你选择一项:①失去1点体力;②减1点体力上限;③背水:执行一个额外的摸牌阶段。", + fakediaodu: "调度", + fakediaodu_info: + "①每回合每种牌的类别限一次,与你势力相同的角色使用牌时,若此牌有目标且包含其,则其可以摸一张牌。②出牌阶段开始时,你可以获得与你势力相同的一名角色装备区内的一张牌,然后你可以将此牌交给另一名与你势力相同的其他角色。", + fakeyigui: "役鬼", + fakeyigui_info: + "①当你首次明置此武将牌时,你将剩余武将牌堆的两张牌称为“魂”置于武将牌上。②你可以展示一张武将牌上的“魂”并将其置入剩余武将牌堆,视为使用一张本回合内未以此法使用过的类别的基本牌或普通锦囊牌(此牌须指定目标,且目标须为未确定势力的角色或野心家或与此“魂”势力相同的角色)。", + fakejihun: "汲魂", + fakejihun_info: + "①当你受到伤害后,或与你势力不同的角色脱离濒死状态后,你可以将剩余武将牌堆的一张牌称为“魂”置于武将牌上。②准备阶段,你可以将至多两张“魂”置入剩余武将牌堆,然后将剩余武将牌堆的等量张牌称为“魂”置于武将牌上。", + fakejueyan: "决堰", + fakejizhi: "集智", + fakejueyan_info: + "主将技。①此武将牌计算体力上限时减少半个阴阳鱼。②准备阶段,你可以选择一个区域并于本回合的结束阶段弃置此区域的所有牌,然后你于本回合获得以下对应效果:⒈判定区:跳过判定阶段,获得〖集智〗直到回合结束;⒉装备区:摸三张牌,本回合手牌上限+3;⒊本回合使用【杀】的额定次数+3。", + fakequanji: "权计", + fakequanji_info: + "①每回合每项各限一次,当你造成或受到伤害后,你可以摸X张牌,然后将等量的牌称为“权”置于武将牌上。②你的手牌上限+X(X为你武将牌上的“权”数)。", + fakepaiyi: "排异", + fakepaiyi_info: + "出牌阶段限一次,你可以选择一名角色,然后选择一个军令令其选择是否执行。若其执行,则你摸X张牌,然后将一张“权”置入弃牌堆;若其不执行,则你可以对至多X名与其势力相同的角色各造成1点伤害,然后将等量的“权”置入弃牌堆。(X为你武将牌上的“权”数)", + fakeshilu: "嗜戮", + fakeshilu_info: + "①出牌阶段结束时,若你有副将且本阶段未发动过副将武将牌上的非锁定技,则你更换副将至你武将牌上的“戮”未包含的势力并将原副将称为“戮”置于武将牌上。②准备阶段,你弃置X张手牌,然后摸X张牌(X为你武将牌上的“戮”数,少牌全弃,无牌不弃)。", + fakexiongnve: "凶虐", + fakexiongnve_info: + "①当你使用【杀】造成伤害时或受到【杀】造成的伤害时,若你武将牌上的“戮”包含伤害来源的势力,则你令此伤害+1。②当你受到不为【杀】造成的伤害时,若你武将牌上的“戮”包含伤害来源的势力,则此伤害-1。", + fakehuaiyi: "怀异", + fakehuaiyi_info: + "出牌阶段限一次,你可以移除副将或弃置一个区域的所有牌,然后令所有大势力角色依次交给你至少一张牌,然后若存在多个大势力,则你移除一个此次交给你牌总数唯一最少的势力的其中一名角色的副将。", + fakezisui: "恣睢", + fakezisui_info: + "锁定技。①一名角色被你移除副将后,你将被移除的武将牌称为“异”置于武将牌上。②摸牌阶段,你多摸X张牌。③结束阶段,若X大于你的体力上限,你死亡。(X为你武将牌上的“异”数)", + fakejujian: "举荐", + fakejujian_info: + "副将技。①此武将牌计算体力上限时减少半个阴阳鱼。②结束阶段,你可以弃置一张非基本牌并选择一名友方角色,令其选择摸两张牌或回复1点体力,然后其可以变更副将。", + fakexibing: "息兵", + fakexibing_info: + "当一名其他角色在其出牌阶段内使用第一张黑色【杀】或黑色普通锦囊牌指定唯一角色为目标后,你可令该角色将手牌摸至体力值且本回合不能再使用手牌。若你与其均明置了所有武将牌,则你可以暗置你与其各一张武将牌且本回合不能再明置此武将牌。", + fakechengshang: "承赏", + fakechengshang_info: + "出牌阶段限一次,当你使用存在花色和点数且指定了其他势力角色为目标的牌结算完毕后,若你未因此牌造成过伤害,则你可以摸一张牌,然后本阶段你可以将一张手牌当作初始游戏牌堆中与此牌花色和点数相同的另一张基本牌或普通锦囊牌使用一次。", + fakezhente: "贞特", + fakezhente_info: + "每回合限一次,当你成为其他角色使用普通锦囊牌或黑色基本牌的目标后,你可令使用者选择一项:1.本回合不能再使用与此牌颜色相同的牌;2.令此牌对你无效。", + fakezhiwei: "至微", + fakezhiwei_info: + "你明置此武将牌时,选择一名其他角色。该角色造成伤害后,你摸一张牌,该角色受到伤害后,你随机弃置一张手牌。你弃牌阶段弃置的牌均被该角色获得。该角色死亡时,若你的两个武将牌均明置,你暗置此武将牌。若该角色未死亡,则此武将牌被暗置前,取消之。", + fakekuangcai: "狂才", + fakekuangcai_info: + "锁定技,你于回合内使用牌无距离和次数限制;弃牌阶段开始时,若你本回合内:未使用过牌,则你本回合手牌上限+1;使用过牌但未造成过伤害,则你本回合手牌上限-1。", + faketunchu: "屯储", + faketunchu_info: + "摸牌阶段,你可以额外摸两张牌,然后你将一至两张牌称为“粮”置于武将牌上。若如此做,你本回合不能使用【杀】。", + fakeshuliang: "输粮", + fakeshuliang_info: + "友方角色的结束阶段,若你与其的距离不大于你武将牌上的“粮”数,则你可以移去一张“粮”,然后令其摸两张牌。", + fakedujin: "独进", + fakedujin_info: + "①摸牌阶段,你可以额外摸X张牌(X为你装备区的牌数的一半,向上取整)。②当你首次明置此武将牌时,若你为你们势力第一个明置武将牌的角色,则你获得1个“先驱”标记。", + fakezhufu: "注傅", + fakezhufu_info: + "出牌阶段,你可以弃置一张本阶段未以此法弃置过的花色的牌,然后根据此牌的花色为你使用的下一张牌添加对应的应变效果:红桃,助战、目标+1;方片,富甲、不可被响应;黑桃,残躯、摸一张牌;草花,空巢、伤害+1。", + fakeguishu: "鬼术", + fakeguishu_info: + "出牌阶段限一次,你可以将一张黑桃手牌当作【知己知彼】或【远交近攻】使用。若你本局游戏内已经发动过了〖鬼术〗,则你必须选择与上次不同的选项。", + fakeyuanyu: "远域", + fakeyuanyu_info: "锁定技,当你受到伤害时,若你不在伤害来源的攻击范围内,则防止此伤害。", + fakemibei: "秘备", + fakemibei_info: + "①准备阶段,若你的手牌数不为全场最多,则你须选择一名手牌数为全场最多的角色,令其对你发起军令。②当你执行军令后,你将手牌数摸至与发起者相同(至多摸五张)。③当你拒绝执行军令后,你展示一至三张牌,然后你本回合可以将其中一张牌当作另一张基本牌或非延时锦囊牌使用一次。", + fakeqizhi: "奇制", + fakeqizhi_info: + "当你于回合内声明使用非装备牌A时,你可以弃置不是此牌目标的一名角色的一张牌B,然后其摸一张牌。若A具有应变效果,且A和B的花色相同,则你无视条件触发A的应变效果。", + fakejinqu: "进趋", + fakejinqu_info: + "结束阶段,你可以摸两张牌,然后你将手牌弃置至X张(X为你本回合发动过〖奇制〗的次数)。", + fakejuzhan: "拒战", + fakejuzhan_info: + "转换技。阴:当你成为【杀】的目标后,你可以与使用者各摸X张牌,然后若使用者的武将牌均明置,则你可以暗置其一张武将牌,且其本回合不能明置此武将牌。阳,当你使用【杀】指定目标后,你可以获得目标角色的X张牌,然后若你的武将牌均明置,则其可以暗置此武将牌,且你本回合不能明置此武将牌。(X为使用者已损失的体力值且X至少为1)", + fakedanshou: "胆守", + fakedanshou_info: + "每轮限一次,一名角色的准备阶段,你可以弃置一个区域的所有牌。若如此做,本回合其每个阶段开始时(准备阶段和结束阶段除外),你摸一张牌或令本回合以此法摸牌数+1,然后若你选择了摸牌且你本次至少摸了四张牌,则你可以对其造成1点伤害。", + fakexunxi: "迅析", + fakexunxi_info: "其他角色于回合外明置武将牌时,你可以视为对其使用一张【杀】(无距离限制)。", + fakehuanjia: "擐甲", + fakehuanjia_info: + "锁定技,每回合每项各限一次。①当你成为【杀】的目标后,本回合你视为装备此牌使用者的防具,直到你的装备区中有防具。②当你使用【杀】指定唯一目标后,本回合你视为装备目标角色的武器,直到你的装备区中有武器。", + fakexiongshu: "凶竖", + fakexiongshu_info: + "每回合限一次,一名角色使用【杀】或伤害类锦囊牌指定第一个目标后,若你为/不为此牌使用者,则你可以摸一张牌并令一名其他角色成为此牌的伤害来源/弃置一张牌并成为此牌的伤害来源。", + fakejianhui: "奸回", + fakejianhui_info: + "当一名角色受到其势力相同的另一名角色造成的伤害后,你可以令其中一名角色摸一张牌,然后弃置其中另一名角色的一张牌。", + fakechongxin: "崇信", + fakechongxin_info: + "出牌阶段限一次,你可以选择一名与你势力不同的角色,视为你使用一张指定你与其为目标的【以逸待劳】。", + fakeweirong: "卫戎", + fakeweirong_info: + "转换技,每轮限一次,出牌阶段。阴:你可以弃置X张牌,然后当你于本轮不因此法得到牌后,你摸一张牌。阳:你可以摸X张牌,然后当你于本轮不因此法失去牌后,你弃置一张牌。(X为你上一轮以此法摸和弃置的牌数之和,且X至少为1,至多为你的体力上限)", + gz_re_taishici: "太史慈", + gz_xin_zhuran: "朱然", + gz_jin_jiachong: "贾充", + gz_jin_yanghu: "羊祜", + gz_wangling: "王淩", + fakequanbian: "权变", + fakequanbian_tag: "牌堆顶", + fakequanbian_info: + "当你于回合内使用或打出牌时,你可以将一张手牌与牌堆顶X张牌的其中一张进行交换(X为你的体力上限)。", + fakezhouting: "骤霆", + fakezhouting_info: + "限定技,出牌阶段,你可以依次使用牌堆顶X张牌中所有可以使用的牌,然后获得其中不能使用的牌,然后若有角色因此死亡,则你重置〖骤霆〗(X为你的体力上限)。", + fakexuanbei: "选备", + fakexuanbei_info: + "①当你首次明置此武将牌时,你摸两张牌,且你本回合内使用带有“应变”标签的牌时直接强化。②每回合限一次,当你使用带有“应变”标签的牌结算完毕后,你可以令一名其他角色获得此牌对应的所有实体牌。③当你死亡时,你可以令一名其他角色变更副将。", + fakeqingleng: "清冷", + fakeqingleng_info: + "其他角色的结束阶段,若其武将牌均明置,则你可以将一张牌当作冰【杀】对其使用(无距离限制)。然后若此牌未对其造成伤害,则你暗置其一张武将牌,且直到其下个回合开始,其明置此武将牌时,你对其造成1点伤害。", + fakexijue: "袭爵", + fakexijue_info: + "①当你首次明置此武将牌时,你获得2枚“爵”标记。②回合结束时,若你本回合造成过伤害,则你获得1枚“爵”标记。③你可以于合适的时机发动〖突袭〗或〖骁果〗(至多弃置X张基本牌),然后移去1枚“爵”标记。④摸牌阶段,你改为摸X张牌。(X为你的“爵”标记数,且X至多为你的体力上限)", + fakexijue_xiaoguo: "骁果", + fakexijue_xiaoguo_info: + "一名其他角色的准备阶段,你可以弃置至多X张基本牌(X为你的“爵”标记数,且X至多为你的体力上限),然后弃置其装备区等量的牌,若其装备区的牌数小于你弃置的牌数,则你对其造成1点伤害。", + fakeqimei: "齐眉", + fakeqimei_info: + "准备阶段,你可以选择一名其他角色。若如此做,直到回合结束:当你或其获得牌/失去手牌后,若你与其手牌数相等,则另一名角色回复1点体力;当你或其的体力值变化后,若你与其体力值相等,则另一名角色摸一张牌。", + fakebaoqie: "宝箧", + fakebaoqie_info: + "①当你受到伤害时,若此武将牌未明置过,则你可以明置此武将牌并防止此伤害。②当你首次明置此武将牌时,你可以获得一名角色装备区里所有的宝物牌,然后你可以使用其中的一张牌。", + fakeciwei: "慈威", + fakeciwei_info: + "其他角色于一回合内使用第偶数张牌时,你可以弃置一张牌并取消此牌的所有目标,然后若此牌为装备牌,你可以获得之且你可以使用之。", + fakehuirong: "慧容", + fakehuirong_info: + "①当你受到伤害时,若此武将牌未明置过,则你可以明置此武将牌并防止此伤害。②当你首次明置此武将牌时,你可以令一名角色将手牌数调整至其体力值。", + fakeyanxi: "宴戏", + fakeyanxi_info: + "出牌阶段限一次,你可以展示一名其他角色的一张手牌和牌堆顶的两张牌,然后你获得其中一种颜色或类别的所有牌且本回合手牌上限+X(X为你获得的牌数),然后其获得剩余的牌。", + fakeshiren: "识人", + fakeshiren_info: + "①当你受到伤害时,若此武将牌未明置过,则你可以明置此武将牌并防止此伤害。②当你首次明置此武将牌时,你可以发动一次〖宴戏〗。", + fakecanmou: "参谋", + fakecanmou_info: + "每回合每项限一次,一名角色使用普通锦囊牌指定第一个目标时,若其手牌数为全场唯一最多,则你可以为此牌增加或减少一个目标(目标数至少为1)。", + fakezhuosheng: "擢升", + fakezhuosheng_info: + "每回合每种牌名限一次,你可以将至少两张手牌当作任意基本牌使用,若你以此法使用的牌中包含具有应变效果的牌,则你令此牌无视条件获得对应的应变效果。", + fakejuhou: "拒后", + fakejuhou_info: + "阵法技,与你处于同一队列的角色成为【杀】或普通锦囊牌的目标后,你可以令其将任意张牌置于其武将牌上,然后其于此牌结算完毕后获得这些牌。", + gznaxiang: "纳降", + gznaxiang_info: + "锁定技,当你受到其他角色造成的伤害后,或你对其他角色造成伤害后,你对其发动〖才望〗时的“弃置”改为“获得”直到你的下回合开始。", + fakecaiwang: "才望", + fakecaiwang_info: + "①你可以助战自己。②每回合每项各限一次,当你响应助战后,若你弃置的牌和被强化的牌:颜色相同,你可以弃置一名其他角色的一张牌;颜色不同,你摸一张牌。", + fakenaxiang: "纳降", + fakenaxiang_info: + "锁定技。①当你对与你势力不同的角色造成伤害后,或受到与你势力不同的角色对你造成的伤害后。你对其发起军令,若其不执行,则你不能对其发动〖纳降①〗直到你的下个回合开始。②你响应助战弃牌无类别限制,且你触发具有应变的卡牌的条件均视为助战。", + fakehuyuan: "护援", + fakehuyuan_info: + "①你的回合内,当一张装备牌进入一名角色的装备区后,你可以弃置与其距离为1以内的另一名角色区域里的一张牌。②结束阶段,你可以将一张装备牌置入一名角色的装备区。", + fakekeshou: "恪守", + fakekeshou_info: + "①当你受到伤害时,你可以弃置两张颜色相同的牌并令此伤害-1。②当你因弃置而一次性失去至少两张牌后,若你的势力已确定且场上没有与你势力相同的其他角色,则你可以进行判定,若结果判定为红色,你摸一张牌。", - guozhan_default:"国战标准", - guozhan_zhen:"君临天下·阵", - guozhan_shi:"君临天下·势", - guozhan_bian:"君临天下·变", - guozhan_quan:"君临天下·权", - guozhan_jun:"君主武将", - guozhan_jin:'文德武备', - guozhan_single:'君临天下EX', - guozhan_double:'双势力武将', - guozhan_yexinjia:'野心家武将', - guozhan_zongheng:'纵横捭阖', - guozhan_tw:'海外服专属', - guozhan_mobile:'移动版', - guozhan_qunxiong:'群雄割据', - guozhan_decade:'十年踪迹十年心', - guozhan_others:"其他", + guozhan_default: "国战标准", + guozhan_zhen: "君临天下·阵", + guozhan_shi: "君临天下·势", + guozhan_bian: "君临天下·变", + guozhan_quan: "君临天下·权", + guozhan_jun: "君主武将", + guozhan_jin: "文德武备", + guozhan_single: "君临天下EX", + guozhan_double: "双势力武将", + guozhan_yexinjia: "野心家武将", + guozhan_zongheng: "纵横捭阖", + guozhan_tw: "海外服专属", + guozhan_mobile: "移动版", + guozhan_qunxiong: "群雄割据", + guozhan_decade: "十年踪迹十年心", + guozhan_others: "其他", }, - junList:['liubei','zhangjiao','sunquan','caocao'], - guozhanPile_yingbian:[ + junList: ["liubei", "zhangjiao", "sunquan", "caocao"], + guozhanPile_yingbian: [ //黑桃普通 - ['spade',1,'shandian'], - ['spade',1,'xietianzi'], - ['spade',1,'juedou'], - ['spade',2,'bagua'], - ['spade',2,'heiguangkai'], - ['spade',2,'cixiong'], - ['spade',2,'taigongyinfu'], - ['spade',3,'zhujinqiyuan',null,['yingbian_zhuzhan','yingbian_add']], - ['spade',3,'huoshaolianying'], - ['spade',3,'shuiyanqijunx',null,['yingbian_zhuzhan','yingbian_add']], - ['spade',4,'guohe'], - ['spade',4,'sha'], - ['spade',4,'shuiyanqijunx',null,['yingbian_zhuzhan','yingbian_add']], - ['spade',5,'jueying'], - ['spade',5,'qinglong'], - ['spade',5,'sha'], - ['spade',6,'qinggang'], - ['spade',6,'jiu'], - ['spade',6,'sha','ice'], - ['spade',7,'sha'], - ['spade',7,'sha'], - ['spade',7,'sha','ice'], - ['spade',8,'sha','ice'], - ['spade',8,'sha','ice'], - ['spade',8,'sha'], - ['spade',9,'jiu'], - ['spade',9,'sha','thunder'], - ['spade',9,'sha'], - ['spade',10,'bingliang'], - ['spade',10,'sha','thunder'], - ['spade',10,'sha',null,['yingbian_canqu','yingbian_add']], - ['spade',11,'wuxie',null,['yingbian_kongchao','yingbian_draw']], - ['spade',11,'sha',null,['yingbian_canqu','yingbian_add']], - ['spade',11,'sha','thunder'], - ['spade',12,'zhangba'], - ['spade',12,'lulitongxin'], - ['spade',12,'tiesuo'], - ['spade',13,'wutiesuolian'], - ['spade',13,'wuxie'], - ['spade',13,'nanman',null,['yingbian_fujia','yingbian_remove']], + ["spade", 1, "shandian"], + ["spade", 1, "xietianzi"], + ["spade", 1, "juedou"], + ["spade", 2, "bagua"], + ["spade", 2, "heiguangkai"], + ["spade", 2, "cixiong"], + ["spade", 2, "taigongyinfu"], + ["spade", 3, "zhujinqiyuan", null, ["yingbian_zhuzhan", "yingbian_add"]], + ["spade", 3, "huoshaolianying"], + ["spade", 3, "shuiyanqijunx", null, ["yingbian_zhuzhan", "yingbian_add"]], + ["spade", 4, "guohe"], + ["spade", 4, "sha"], + ["spade", 4, "shuiyanqijunx", null, ["yingbian_zhuzhan", "yingbian_add"]], + ["spade", 5, "jueying"], + ["spade", 5, "qinglong"], + ["spade", 5, "sha"], + ["spade", 6, "qinggang"], + ["spade", 6, "jiu"], + ["spade", 6, "sha", "ice"], + ["spade", 7, "sha"], + ["spade", 7, "sha"], + ["spade", 7, "sha", "ice"], + ["spade", 8, "sha", "ice"], + ["spade", 8, "sha", "ice"], + ["spade", 8, "sha"], + ["spade", 9, "jiu"], + ["spade", 9, "sha", "thunder"], + ["spade", 9, "sha"], + ["spade", 10, "bingliang"], + ["spade", 10, "sha", "thunder"], + ["spade", 10, "sha", null, ["yingbian_canqu", "yingbian_add"]], + ["spade", 11, "wuxie", null, ["yingbian_kongchao", "yingbian_draw"]], + ["spade", 11, "sha", null, ["yingbian_canqu", "yingbian_add"]], + ["spade", 11, "sha", "thunder"], + ["spade", 12, "zhangba"], + ["spade", 12, "lulitongxin"], + ["spade", 12, "tiesuo"], + ["spade", 13, "wutiesuolian"], + ["spade", 13, "wuxie"], + ["spade", 13, "nanman", null, ["yingbian_fujia", "yingbian_remove"]], //草花普通 - ['club',1,'juedou'], - ['club',1,'yuxi'], - ['club',1,'huxinjing'], - ['club',2,'sha'], - ['club',2,'tianjitu'], - ['club',2,'renwang'], - ['club',2,'tengjia'], - ['club',3,'sha'], - ['club',3,'chiling'], - ['club',3,'zhibi'], - ['club',4,'sha',null,['yingbian_kongchao','yingbian_add']], - ['club',4,'sha','thunder'], - ['club',4,'zhibi'], - ['club',5,'sha',null,['yingbian_kongchao','yingbian_add']], - ['club',5,'sha','thunder'], - ['club',5,'tongque'], - ['club',6,'sha','thunder'], - ['club',6,'sha',null,['yingbian_kongchao','yingbian_add']], - ['club',6,'lebu'], - ['club',7,'sha','thunder'], - ['club',7,'sha'], - ['club',7,'nanman',null,['yingbian_fujia','yingbian_remove']], - ['club',8,'sha','thunder'], - ['club',8,'sha',null,['yingbian_canqu','yingbian_add']], - ['club',8,'sha'], - ['club',9,'sha'], - ['club',9,'jiu'], - ['club',9,'jiu'], - ['club',10,'bingliang'], - ['club',10,'lulitongxin'], - ['club',10,'sha'], - ['club',11,'sha'], - ['club',11,'huoshaolianying'], - ['club',11,'sha'], - ['club',12,'zhujinqiyuan',null,['yingbian_zhuzhan','yingbian_add']], - ['club',12,'jiedao',null,['yingbian_fujia','yingbian_hit']], - ['club',12,'tiesuo'], - ['club',13,'tiesuo'], - ['club',13,'wuxie',null,['guo']], - ['club',13,'wuxie',null,['guo']], + ["club", 1, "juedou"], + ["club", 1, "yuxi"], + ["club", 1, "huxinjing"], + ["club", 2, "sha"], + ["club", 2, "tianjitu"], + ["club", 2, "renwang"], + ["club", 2, "tengjia"], + ["club", 3, "sha"], + ["club", 3, "chiling"], + ["club", 3, "zhibi"], + ["club", 4, "sha", null, ["yingbian_kongchao", "yingbian_add"]], + ["club", 4, "sha", "thunder"], + ["club", 4, "zhibi"], + ["club", 5, "sha", null, ["yingbian_kongchao", "yingbian_add"]], + ["club", 5, "sha", "thunder"], + ["club", 5, "tongque"], + ["club", 6, "sha", "thunder"], + ["club", 6, "sha", null, ["yingbian_kongchao", "yingbian_add"]], + ["club", 6, "lebu"], + ["club", 7, "sha", "thunder"], + ["club", 7, "sha"], + ["club", 7, "nanman", null, ["yingbian_fujia", "yingbian_remove"]], + ["club", 8, "sha", "thunder"], + ["club", 8, "sha", null, ["yingbian_canqu", "yingbian_add"]], + ["club", 8, "sha"], + ["club", 9, "sha"], + ["club", 9, "jiu"], + ["club", 9, "jiu"], + ["club", 10, "bingliang"], + ["club", 10, "lulitongxin"], + ["club", 10, "sha"], + ["club", 11, "sha"], + ["club", 11, "huoshaolianying"], + ["club", 11, "sha"], + ["club", 12, "zhujinqiyuan", null, ["yingbian_zhuzhan", "yingbian_add"]], + ["club", 12, "jiedao", null, ["yingbian_fujia", "yingbian_hit"]], + ["club", 12, "tiesuo"], + ["club", 13, "tiesuo"], + ["club", 13, "wuxie", null, ["guo"]], + ["club", 13, "wuxie", null, ["guo"]], //红桃普通 - ['heart',1,'wanjian'], - ['heart',1,'taoyuan'], - ['heart',1,'lianjunshengyan'], - ['heart',2,'shan'], - ['heart',2,'chuqibuyi',null,['yingbian_zhuzhan','yingbian_add']], - ['heart',2,'diaohulishan'], - ['heart',3,'chuqibuyi',null,['yingbian_zhuzhan','yingbian_add']], - ['heart',3,'wugu'], - ['heart',3,'jingfanma'], - ['heart',4,'tao'], - ['heart',4,'sha','fire',['yingbian_canqu','yingbian_damage']], - ['heart',4,'shan'], - ['heart',5,'qilin'], - ['heart',5,'chitu'], - ['heart',5,'shan',null,['yingbian_kongchao','yingbian_draw']], - ['heart',6,'lebu'], - ['heart',6,'tao'], - ['heart',6,'shan',null,['yingbian_kongchao','yingbian_draw']], - ['heart',7,'tao'], - ['heart',7,'dongzhuxianji'], - ['heart',7,'shan'], - ['heart',8,'tao'], - ['heart',8,'dongzhuxianji'], - ['heart',8,'tao'], - ['heart',9,'tao'], - ['heart',9,'yuanjiao'], - ['heart',9,'tao'], - ['heart',10,'sha'], - ['heart',10,'shan'], - ['heart',10,'sha'], - ['heart',11,'yiyi'], - ['heart',11,'tao'], - ['heart',11,'sha',null,['yingbian_zhuzhan','yingbian_add']], - ['heart',12,'tao'], - ['heart',12,'sha'], - ['heart',12,'huoshaolianying'], - ['heart',13,'zhuahuang'], - ['heart',13,'shan'], - ['heart',13,'huogong',null,['yingbian_zhuzhan','yingbian_add']], + ["heart", 1, "wanjian"], + ["heart", 1, "taoyuan"], + ["heart", 1, "lianjunshengyan"], + ["heart", 2, "shan"], + ["heart", 2, "chuqibuyi", null, ["yingbian_zhuzhan", "yingbian_add"]], + ["heart", 2, "diaohulishan"], + ["heart", 3, "chuqibuyi", null, ["yingbian_zhuzhan", "yingbian_add"]], + ["heart", 3, "wugu"], + ["heart", 3, "jingfanma"], + ["heart", 4, "tao"], + ["heart", 4, "sha", "fire", ["yingbian_canqu", "yingbian_damage"]], + ["heart", 4, "shan"], + ["heart", 5, "qilin"], + ["heart", 5, "chitu"], + ["heart", 5, "shan", null, ["yingbian_kongchao", "yingbian_draw"]], + ["heart", 6, "lebu"], + ["heart", 6, "tao"], + ["heart", 6, "shan", null, ["yingbian_kongchao", "yingbian_draw"]], + ["heart", 7, "tao"], + ["heart", 7, "dongzhuxianji"], + ["heart", 7, "shan"], + ["heart", 8, "tao"], + ["heart", 8, "dongzhuxianji"], + ["heart", 8, "tao"], + ["heart", 9, "tao"], + ["heart", 9, "yuanjiao"], + ["heart", 9, "tao"], + ["heart", 10, "sha"], + ["heart", 10, "shan"], + ["heart", 10, "sha"], + ["heart", 11, "yiyi"], + ["heart", 11, "tao"], + ["heart", 11, "sha", null, ["yingbian_zhuzhan", "yingbian_add"]], + ["heart", 12, "tao"], + ["heart", 12, "sha"], + ["heart", 12, "huoshaolianying"], + ["heart", 13, "zhuahuang"], + ["heart", 13, "shan"], + ["heart", 13, "huogong", null, ["yingbian_zhuzhan", "yingbian_add"]], //方片普通 - ['diamond',1,'wuxinghelingshan'], - ['diamond',1,'zhuge'], - ['diamond',1,'xietianzi'], - ['diamond',2,'shan'], - ['diamond',2,'tao'], - ['diamond',2,'tao'], - ['diamond',3,'shunshou'], - ['diamond',3,'shan'], - ['diamond',3,'tao'], - ['diamond',4,'yiyi'], - ['diamond',4,'sha','fire',['yingbian_canqu','yingbian_damage']], - ['diamond',4,'sha','fire',['yingbian_zhuzhan','yingbian_add']], - ['diamond',5,'guanshi'], - ['diamond',5,'sha','fire'], - ['diamond',5,'muniu'], - ['diamond',6,'wuliu'], - ['diamond',6,'shan'], - ['diamond',6,'shan'], - ['diamond',7,'shan',null,['yingbian_kongchao','yingbian_draw']], - ['diamond',7,'shan',null,['yingbian_kongchao','yingbian_draw']], - ['diamond',7,'shan'], - ['diamond',8,'shan',null,['yingbian_kongchao','yingbian_draw']], - ['diamond',8,'shan',null,['yingbian_kongchao','yingbian_draw']], - ['diamond',8,'sha','fire'], - ['diamond',9,'jiu'], - ['diamond',9,'shan'], - ['diamond',9,'sha','fire'], - ['diamond',10,'shan'], - ['diamond',10,'sha'], - ['diamond',10,'diaohulishan'], - ['diamond',11,'sha'], - ['diamond',11,'shan'], - ['diamond',11,'wuxie',null,['guo']], - ['diamond',12,'sha'], - ['diamond',12,'sanjian'], - ['diamond',12,'wuxie',null,['guo']], - ['diamond',12,'fangtian'], - ['diamond',13,'zixin'], - ['diamond',13,'shan'], - ['diamond',13,'shan'], + ["diamond", 1, "wuxinghelingshan"], + ["diamond", 1, "zhuge"], + ["diamond", 1, "xietianzi"], + ["diamond", 2, "shan"], + ["diamond", 2, "tao"], + ["diamond", 2, "tao"], + ["diamond", 3, "shunshou"], + ["diamond", 3, "shan"], + ["diamond", 3, "tao"], + ["diamond", 4, "yiyi"], + ["diamond", 4, "sha", "fire", ["yingbian_canqu", "yingbian_damage"]], + ["diamond", 4, "sha", "fire", ["yingbian_zhuzhan", "yingbian_add"]], + ["diamond", 5, "guanshi"], + ["diamond", 5, "sha", "fire"], + ["diamond", 5, "muniu"], + ["diamond", 6, "wuliu"], + ["diamond", 6, "shan"], + ["diamond", 6, "shan"], + ["diamond", 7, "shan", null, ["yingbian_kongchao", "yingbian_draw"]], + ["diamond", 7, "shan", null, ["yingbian_kongchao", "yingbian_draw"]], + ["diamond", 7, "shan"], + ["diamond", 8, "shan", null, ["yingbian_kongchao", "yingbian_draw"]], + ["diamond", 8, "shan", null, ["yingbian_kongchao", "yingbian_draw"]], + ["diamond", 8, "sha", "fire"], + ["diamond", 9, "jiu"], + ["diamond", 9, "shan"], + ["diamond", 9, "sha", "fire"], + ["diamond", 10, "shan"], + ["diamond", 10, "sha"], + ["diamond", 10, "diaohulishan"], + ["diamond", 11, "sha"], + ["diamond", 11, "shan"], + ["diamond", 11, "wuxie", null, ["guo"]], + ["diamond", 12, "sha"], + ["diamond", 12, "sanjian"], + ["diamond", 12, "wuxie", null, ["guo"]], + ["diamond", 12, "fangtian"], + ["diamond", 13, "zixin"], + ["diamond", 13, "shan"], + ["diamond", 13, "shan"], //特殊 - ['heart',3,'taipingyaoshu'], - ['diamond',4,'dinglanyemingzhu'], - ['heart',5,'liulongcanjia'], - ['spade',6,'feilongduofeng'], - ['club',12,'gz_wenheluanwu'], - ['heart',1,'gz_guguoanbang'], - ['spade',12,'gz_haolingtianxia'], - ['diamond',1,'gz_kefuzhongyuan'], + ["heart", 3, "taipingyaoshu"], + ["diamond", 4, "dinglanyemingzhu"], + ["heart", 5, "liulongcanjia"], + ["spade", 6, "feilongduofeng"], + ["club", 12, "gz_wenheluanwu"], + ["heart", 1, "gz_guguoanbang"], + ["spade", 12, "gz_haolingtianxia"], + ["diamond", 1, "gz_kefuzhongyuan"], ], - guozhanPile_old:[ - ['spade',1,'juedou'], - ['spade',1,'shandian'], - ['spade',2,'cixiong'], - ['spade',2,'bagua'], - ['spade',2,'hanbing'], - ['spade',3,'guohe'], - ['spade',3,'shunshou'], - ['spade',4,'guohe'], - ['spade',4,'shunshou'], - ['spade',5,'sha'], - ['spade',5,'jueying'], - ['spade',6,'qinggang'], - ['spade',6,'sha','thunder'], - ['spade',7,'sha'], - ['spade',7,'sha','thunder'], - ['spade',8,'sha'], - ['spade',8,'sha'], - ['spade',9,'sha'], - ['spade',9,'jiu'], - ['spade',10,'sha'], - ['spade',10,'bingliang'], - ['spade',11,'sha'], - ['spade',11,'wuxie'], - ['spade',12,'zhangba'], - ['spade',12,'tiesuo'], - ['spade',13,'nanman'], - ['spade',13,'dawan'], + guozhanPile_old: [ + ["spade", 1, "juedou"], + ["spade", 1, "shandian"], + ["spade", 2, "cixiong"], + ["spade", 2, "bagua"], + ["spade", 2, "hanbing"], + ["spade", 3, "guohe"], + ["spade", 3, "shunshou"], + ["spade", 4, "guohe"], + ["spade", 4, "shunshou"], + ["spade", 5, "sha"], + ["spade", 5, "jueying"], + ["spade", 6, "qinggang"], + ["spade", 6, "sha", "thunder"], + ["spade", 7, "sha"], + ["spade", 7, "sha", "thunder"], + ["spade", 8, "sha"], + ["spade", 8, "sha"], + ["spade", 9, "sha"], + ["spade", 9, "jiu"], + ["spade", 10, "sha"], + ["spade", 10, "bingliang"], + ["spade", 11, "sha"], + ["spade", 11, "wuxie"], + ["spade", 12, "zhangba"], + ["spade", 12, "tiesuo"], + ["spade", 13, "nanman"], + ["spade", 13, "dawan"], - ['club',1,'juedou'], - ['club',1,'baiyin'], - ['club',2,'sha'], - ['club',2,'tengjia'], - ['club',2,'renwang'], - ['club',3,'sha'], - ['club',3,'zhibi'], - ['club',4,'sha'], - ['club',4,'zhibi'], - ['club',5,'sha'], - ['club',5,'dilu'], - ['club',6,'lebu'], - ['club',6,'sha','thunder'], - ['club',7,'nanman'], - ['club',7,'sha','thunder'], - ['club',8,'sha'], - ['club',8,'sha','thunder'], - ['club',9,'sha'], - ['club',9,'jiu'], - ['club',10,'sha'], - ['club',10,'bingliang'], - ['club',11,'sha'], - ['club',11,'sha'], - ['club',12,'jiedao'], - ['club',12,'tiesuo'], - ['club',13,'wuxie',null,['guo']], - ['club',13,'tiesuo'], + ["club", 1, "juedou"], + ["club", 1, "baiyin"], + ["club", 2, "sha"], + ["club", 2, "tengjia"], + ["club", 2, "renwang"], + ["club", 3, "sha"], + ["club", 3, "zhibi"], + ["club", 4, "sha"], + ["club", 4, "zhibi"], + ["club", 5, "sha"], + ["club", 5, "dilu"], + ["club", 6, "lebu"], + ["club", 6, "sha", "thunder"], + ["club", 7, "nanman"], + ["club", 7, "sha", "thunder"], + ["club", 8, "sha"], + ["club", 8, "sha", "thunder"], + ["club", 9, "sha"], + ["club", 9, "jiu"], + ["club", 10, "sha"], + ["club", 10, "bingliang"], + ["club", 11, "sha"], + ["club", 11, "sha"], + ["club", 12, "jiedao"], + ["club", 12, "tiesuo"], + ["club", 13, "wuxie", null, ["guo"]], + ["club", 13, "tiesuo"], - ['diamond',1,'zhuge'], - ['diamond',1,'zhuque'], - ['diamond',2,'shan'], - ['diamond',2,'tao'], - ['diamond',3,'shan'], - ['diamond',3,'shunshou'], - ['diamond',4,'yiyi'], - ['diamond',4,'sha','fire'], - ['diamond',5,'guanshi'], - ['diamond',5,'sha','fire'], - ['diamond',6,'shan'], - ['diamond',6,'wuliu'], - ['diamond',7,'shan'], - ['diamond',7,'shan'], - ['diamond',8,'shan'], - ['diamond',8,'shan'], - ['diamond',9,'shan'], - ['diamond',9,'jiu'], - ['diamond',10,'shan'], - ['diamond',10,'sha'], - ['diamond',11,'shan'], - ['diamond',11,'sha'], - ['diamond',12,'sha'], - ['diamond',12,'sanjian'], - ['diamond',12,'wuxie',null,['guo']], - ['diamond',13,'shan'], - ['diamond',13,'zixin'], + ["diamond", 1, "zhuge"], + ["diamond", 1, "zhuque"], + ["diamond", 2, "shan"], + ["diamond", 2, "tao"], + ["diamond", 3, "shan"], + ["diamond", 3, "shunshou"], + ["diamond", 4, "yiyi"], + ["diamond", 4, "sha", "fire"], + ["diamond", 5, "guanshi"], + ["diamond", 5, "sha", "fire"], + ["diamond", 6, "shan"], + ["diamond", 6, "wuliu"], + ["diamond", 7, "shan"], + ["diamond", 7, "shan"], + ["diamond", 8, "shan"], + ["diamond", 8, "shan"], + ["diamond", 9, "shan"], + ["diamond", 9, "jiu"], + ["diamond", 10, "shan"], + ["diamond", 10, "sha"], + ["diamond", 11, "shan"], + ["diamond", 11, "sha"], + ["diamond", 12, "sha"], + ["diamond", 12, "sanjian"], + ["diamond", 12, "wuxie", null, ["guo"]], + ["diamond", 13, "shan"], + ["diamond", 13, "zixin"], - ['heart',1,'taoyuan'], - ['heart',1,'wanjian'], - ['heart',2,'shan'], - ['heart',2,'huogong'], - ['heart',3,'wugu'], - ['heart',3,'huogong'], - ['heart',4,'tao'], - ['heart',4,'sha','fire'], - ['heart',5,'qilin'], - ['heart',5,'chitu'], - ['heart',6,'tao'], - ['heart',6,'lebu'], - ['heart',7,'tao'], - ['heart',7,'wuzhong'], - ['heart',8,'tao'], - ['heart',8,'wuzhong'], - ['heart',9,'tao'], - ['heart',9,'yuanjiao'], - ['heart',10,'tao'], - ['heart',10,'sha'], - ['heart',11,'shan'], - ['heart',11,'yiyi'], - ['heart',12,'tao'], - ['heart',12,'sha'], - ['heart',12,'guohe'], - ['heart',13,'shan'], - ['heart',13,'zhuahuang'], + ["heart", 1, "taoyuan"], + ["heart", 1, "wanjian"], + ["heart", 2, "shan"], + ["heart", 2, "huogong"], + ["heart", 3, "wugu"], + ["heart", 3, "huogong"], + ["heart", 4, "tao"], + ["heart", 4, "sha", "fire"], + ["heart", 5, "qilin"], + ["heart", 5, "chitu"], + ["heart", 6, "tao"], + ["heart", 6, "lebu"], + ["heart", 7, "tao"], + ["heart", 7, "wuzhong"], + ["heart", 8, "tao"], + ["heart", 8, "wuzhong"], + ["heart", 9, "tao"], + ["heart", 9, "yuanjiao"], + ["heart", 10, "tao"], + ["heart", 10, "sha"], + ["heart", 11, "shan"], + ["heart", 11, "yiyi"], + ["heart", 12, "tao"], + ["heart", 12, "sha"], + ["heart", 12, "guohe"], + ["heart", 13, "shan"], + ["heart", 13, "zhuahuang"], ], - guozhanPile:[ - ['spade',1,'juedou'], - ['spade',1,'shandian'], - ['spade',2,'feilongduofeng'], - ['spade',2,'bagua'], - ['spade',2,'hanbing'], - ['spade',3,'guohe'], - ['spade',3,'shunshou'], - ['spade',4,'guohe'], - ['spade',4,'shunshou'], - ['spade',5,'sha'], - ['spade',5,'jueying'], - ['spade',6,'qinggang'], - ['spade',6,'sha','thunder'], - ['spade',7,'sha'], - ['spade',7,'sha','thunder'], - ['spade',8,'sha'], - ['spade',8,'sha'], - ['spade',9,'sha'], - ['spade',9,'jiu'], - ['spade',10,'sha'], - ['spade',10,'bingliang'], - ['spade',11,'sha'], - ['spade',11,'wuxie'], - ['spade',12,'zhangba'], - ['spade',12,'tiesuo'], - ['spade',13,'nanman'], - ['spade',13,'dawan'], + guozhanPile: [ + ["spade", 1, "juedou"], + ["spade", 1, "shandian"], + ["spade", 2, "feilongduofeng"], + ["spade", 2, "bagua"], + ["spade", 2, "hanbing"], + ["spade", 3, "guohe"], + ["spade", 3, "shunshou"], + ["spade", 4, "guohe"], + ["spade", 4, "shunshou"], + ["spade", 5, "sha"], + ["spade", 5, "jueying"], + ["spade", 6, "qinggang"], + ["spade", 6, "sha", "thunder"], + ["spade", 7, "sha"], + ["spade", 7, "sha", "thunder"], + ["spade", 8, "sha"], + ["spade", 8, "sha"], + ["spade", 9, "sha"], + ["spade", 9, "jiu"], + ["spade", 10, "sha"], + ["spade", 10, "bingliang"], + ["spade", 11, "sha"], + ["spade", 11, "wuxie"], + ["spade", 12, "zhangba"], + ["spade", 12, "tiesuo"], + ["spade", 13, "nanman"], + ["spade", 13, "dawan"], - ['club',1,'juedou'], - ['club',1,'baiyin'], - ['club',2,'sha'], - ['club',2,'tengjia'], - ['club',2,'renwang'], - ['club',3,'sha'], - ['club',3,'zhibi'], - ['club',4,'sha'], - ['club',4,'zhibi'], - ['club',5,'sha'], - ['club',5,'dilu'], - ['club',6,'lebu'], - ['club',6,'sha','thunder'], - ['club',7,'nanman'], - ['club',7,'sha','thunder'], - ['club',8,'sha'], - ['club',8,'sha','thunder'], - ['club',9,'sha'], - ['club',9,'jiu'], - ['club',10,'sha'], - ['club',10,'bingliang'], - ['club',11,'sha'], - ['club',11,'sha'], - ['club',12,'jiedao'], - ['club',12,'tiesuo'], - ['club',13,'wuxie',null,['guo']], - ['club',13,'tiesuo'], + ["club", 1, "juedou"], + ["club", 1, "baiyin"], + ["club", 2, "sha"], + ["club", 2, "tengjia"], + ["club", 2, "renwang"], + ["club", 3, "sha"], + ["club", 3, "zhibi"], + ["club", 4, "sha"], + ["club", 4, "zhibi"], + ["club", 5, "sha"], + ["club", 5, "dilu"], + ["club", 6, "lebu"], + ["club", 6, "sha", "thunder"], + ["club", 7, "nanman"], + ["club", 7, "sha", "thunder"], + ["club", 8, "sha"], + ["club", 8, "sha", "thunder"], + ["club", 9, "sha"], + ["club", 9, "jiu"], + ["club", 10, "sha"], + ["club", 10, "bingliang"], + ["club", 11, "sha"], + ["club", 11, "sha"], + ["club", 12, "jiedao"], + ["club", 12, "tiesuo"], + ["club", 13, "wuxie", null, ["guo"]], + ["club", 13, "tiesuo"], - ['diamond',1,'zhuge'], - ['diamond',1,'zhuque'], - ['diamond',2,'shan'], - ['diamond',2,'tao'], - ['diamond',3,'shan'], - ['diamond',3,'shunshou'], - ['diamond',4,'yiyi'], - ['diamond',4,'sha','fire'], - ['diamond',5,'guanshi'], - ['diamond',5,'sha','fire'], - ['diamond',6,'shan'], - ['diamond',6,'wuliu'], - ['diamond',7,'shan'], - ['diamond',7,'shan'], - ['diamond',8,'shan'], - ['diamond',8,'shan'], - ['diamond',9,'shan'], - ['diamond',9,'jiu'], - ['diamond',10,'shan'], - ['diamond',10,'sha'], - ['diamond',11,'shan'], - ['diamond',11,'sha'], - ['diamond',12,'sha'], - ['diamond',12,'sanjian'], - ['diamond',12,'wuxie',null,['guo']], - ['diamond',13,'shan'], - ['diamond',13,'zixin'], + ["diamond", 1, "zhuge"], + ["diamond", 1, "zhuque"], + ["diamond", 2, "shan"], + ["diamond", 2, "tao"], + ["diamond", 3, "shan"], + ["diamond", 3, "shunshou"], + ["diamond", 4, "yiyi"], + ["diamond", 4, "sha", "fire"], + ["diamond", 5, "guanshi"], + ["diamond", 5, "sha", "fire"], + ["diamond", 6, "shan"], + ["diamond", 6, "wuliu"], + ["diamond", 7, "shan"], + ["diamond", 7, "shan"], + ["diamond", 8, "shan"], + ["diamond", 8, "shan"], + ["diamond", 9, "shan"], + ["diamond", 9, "jiu"], + ["diamond", 10, "shan"], + ["diamond", 10, "sha"], + ["diamond", 11, "shan"], + ["diamond", 11, "sha"], + ["diamond", 12, "sha"], + ["diamond", 12, "sanjian"], + ["diamond", 12, "wuxie", null, ["guo"]], + ["diamond", 13, "shan"], + ["diamond", 13, "zixin"], - ['heart',1,'taoyuan'], - ['heart',1,'wanjian'], - ['heart',2,'shan'], - ['heart',2,'huogong'], - ['heart',3,'wugu'], - ['heart',3,'taipingyaoshu'], - ['heart',3,'huogong'], - ['heart',4,'tao'], - ['heart',4,'sha','fire'], - ['heart',5,'qilin'], - ['heart',5,'chitu'], - ['heart',6,'tao'], - ['heart',6,'lebu'], - ['heart',7,'tao'], - ['heart',7,'wuzhong'], - ['heart',8,'tao'], - ['heart',8,'wuzhong'], - ['heart',9,'tao'], - ['heart',9,'yuanjiao'], - ['heart',10,'tao'], - ['heart',10,'sha'], - ['heart',11,'shan'], - ['heart',11,'yiyi'], - ['heart',12,'tao'], - ['heart',12,'sha'], - ['heart',12,'guohe'], - ['heart',13,'shan'], - ['heart',13,'zhuahuang'], + ["heart", 1, "taoyuan"], + ["heart", 1, "wanjian"], + ["heart", 2, "shan"], + ["heart", 2, "huogong"], + ["heart", 3, "wugu"], + ["heart", 3, "taipingyaoshu"], + ["heart", 3, "huogong"], + ["heart", 4, "tao"], + ["heart", 4, "sha", "fire"], + ["heart", 5, "qilin"], + ["heart", 5, "chitu"], + ["heart", 6, "tao"], + ["heart", 6, "lebu"], + ["heart", 7, "tao"], + ["heart", 7, "wuzhong"], + ["heart", 8, "tao"], + ["heart", 8, "wuzhong"], + ["heart", 9, "tao"], + ["heart", 9, "yuanjiao"], + ["heart", 10, "tao"], + ["heart", 10, "sha"], + ["heart", 11, "shan"], + ["heart", 11, "yiyi"], + ["heart", 12, "tao"], + ["heart", 12, "sha"], + ["heart", 12, "guohe"], + ["heart", 13, "shan"], + ["heart", 13, "zhuahuang"], - ['spade',1,'xietianzi',null,['lianheng']], - ['spade',2,'minguangkai'], - ['spade',3,'huoshaolianying',null,['lianheng']], - ['spade',4,'sha'], - ['spade',5,'qinglong'], - ['spade',6,'jiu',null,['lianheng']], - ['spade',7,'sha'], - ['spade',8,'sha'], - ['spade',9,'sha','thunder'], - ['spade',10,'sha','thunder'], - ['spade',11,'sha','thunder',['lianheng']], - ['spade',12,'lulitongxin'], - ['spade',13,'wuxie'], + ["spade", 1, "xietianzi", null, ["lianheng"]], + ["spade", 2, "minguangkai"], + ["spade", 3, "huoshaolianying", null, ["lianheng"]], + ["spade", 4, "sha"], + ["spade", 5, "qinglong"], + ["spade", 6, "jiu", null, ["lianheng"]], + ["spade", 7, "sha"], + ["spade", 8, "sha"], + ["spade", 9, "sha", "thunder"], + ["spade", 10, "sha", "thunder"], + ["spade", 11, "sha", "thunder", ["lianheng"]], + ["spade", 12, "lulitongxin"], + ["spade", 13, "wuxie"], - ['heart',1,'lianjunshengyan'], - ['heart',2,'diaohulishan'], - ['heart',3,'jingfanma',null,['lianheng']], - ['heart',4,'shan'], - ['heart',5,'shan'], - ['heart',6,'shan'], - ['heart',7,'shan'], - ['heart',8,'tao'], - ['heart',9,'tao'], - ['heart',10,'sha'], - ['heart',11,'sha'], - ['heart',12,'huoshaolianying',null,['lianheng']], - ['heart',13,'shuiyanqijunx'], + ["heart", 1, "lianjunshengyan"], + ["heart", 2, "diaohulishan"], + ["heart", 3, "jingfanma", null, ["lianheng"]], + ["heart", 4, "shan"], + ["heart", 5, "shan"], + ["heart", 6, "shan"], + ["heart", 7, "shan"], + ["heart", 8, "tao"], + ["heart", 9, "tao"], + ["heart", 10, "sha"], + ["heart", 11, "sha"], + ["heart", 12, "huoshaolianying", null, ["lianheng"]], + ["heart", 13, "shuiyanqijunx"], - ['club',1,'yuxi'], - ['club',2,'huxinjing',null,['lianheng']], - ['club',3,'chiling'], - ['club',4,'sha'], - ['club',5,'sha','thunder',['lianheng']], - ['club',6,'sha'], - ['club',7,'sha'], - ['club',8,'sha'], - ['club',9,'jiu'], - ['club',10,'lulitongxin'], - ['club',11,'huoshaolianying',null,['lianheng']], - ['club',12,'shuiyanqijunx'], - ['club',13,'wuxie',null,['guo']], + ["club", 1, "yuxi"], + ["club", 2, "huxinjing", null, ["lianheng"]], + ["club", 3, "chiling"], + ["club", 4, "sha"], + ["club", 5, "sha", "thunder", ["lianheng"]], + ["club", 6, "sha"], + ["club", 7, "sha"], + ["club", 8, "sha"], + ["club", 9, "jiu"], + ["club", 10, "lulitongxin"], + ["club", 11, "huoshaolianying", null, ["lianheng"]], + ["club", 12, "shuiyanqijunx"], + ["club", 13, "wuxie", null, ["guo"]], - ['diamond',1,'xietianzi',null,['lianheng']], - ['diamond',2,'tao'], - ['diamond',3,'tao',null,['lianheng']], - ['diamond',4,'xietianzi',null,['lianheng']], - ['diamond',5,'muniu'], - ['diamond',6,'shan'], - ['diamond',7,'shan'], - ['diamond',8,'sha','fire'], - ['diamond',9,'sha','fire'], - ['diamond',10,'diaohulishan',null,['lianheng']], - ['diamond',11,'wuxie',null,['guo']], - ['diamond',12,'fangtian'], - ['diamond',13,'shan'], + ["diamond", 1, "xietianzi", null, ["lianheng"]], + ["diamond", 2, "tao"], + ["diamond", 3, "tao", null, ["lianheng"]], + ["diamond", 4, "xietianzi", null, ["lianheng"]], + ["diamond", 5, "muniu"], + ["diamond", 6, "shan"], + ["diamond", 7, "shan"], + ["diamond", 8, "sha", "fire"], + ["diamond", 9, "sha", "fire"], + ["diamond", 10, "diaohulishan", null, ["lianheng"]], + ["diamond", 11, "wuxie", null, ["guo"]], + ["diamond", 12, "fangtian"], + ["diamond", 13, "shan"], - ['diamond',6,'dinglanyemingzhu'], - ['heart',13,'liulongcanjia'], + ["diamond", 6, "dinglanyemingzhu"], + ["heart", 13, "liulongcanjia"], //['spade',12,'gz_haolingtianxia'], //['diamond',1,'gz_kefuzhongyuan'], //['heart',1,'gz_guguoanbang'], //['club',12,'gz_wenheluanwu'], ], - element:{ - content:{ - hideCharacter:function(){ - game.addVideo('hideCharacter',player,num); - var skills,log=event.log; - switch(num){ + element: { + content: { + hideCharacter: function () { + game.addVideo("hideCharacter", player, num); + var skills, + log = event.log; + switch (num) { case 0: - if(log!==false) game.log(player,'暗置了主将'+get.translation(player.name1)); - skills=lib.character[player.name1][3]; - player.name=player.name2; - player.sex=lib.character[player.name2][0]; - player.classList.add('unseen'); - break; + if (log !== false) game.log(player, "暗置了主将" + get.translation(player.name1)); + skills = lib.character[player.name1][3]; + player.name = player.name2; + player.sex = lib.character[player.name2][0]; + player.classList.add("unseen"); + break; case 1: - if(log!==false) game.log(player,'暗置了副将'+get.translation(player.name2)); - skills=lib.character[player.name2][3]; - player.classList.add('unseen2'); - break; + if (log !== false) game.log(player, "暗置了副将" + get.translation(player.name2)); + skills = lib.character[player.name2][3]; + player.classList.add("unseen2"); + break; } - game.broadcast(function(player,name,sex,num,skills){ - player.name=name; - player.sex=sex; - switch(num){ - case 0:player.classList.add('unseen');break; - case 1:player.classList.add('unseen2');break; - } - for(var i=0;i选项'+get.cnNumber(i+1,true)+':'+event.choiceList[i]+'
    '); - controls.push('选项'+get.cnNumber(i+1,true)); + dialog.add([[event.junling], "vcard"]); + var controls = []; + if (event.choiceList) { + for (var i = 0; i < event.choiceList.length; i++) { + dialog.add( + '" + ); + controls.push("选项" + get.cnNumber(i + 1, true)); } - } - else if(event.controls) controls=event.controls; - else controls=['执行该军令','不执行该军令']; - if(!event.ai) event.ai=function(){return Math.floor(controls.length*Math.random())}; - player.chooseControl(controls).set('dialog',dialog).set('ai',event.ai); - 'step 1' - event.result={ - index:result.index, - control:result.control, + } else if (event.controls) controls = event.controls; + else controls = ["执行该军令", "不执行该军令"]; + if (!event.ai) + event.ai = function () { + return Math.floor(controls.length * Math.random()); + }; + player.chooseControl(controls).set("dialog", dialog).set("ai", event.ai); + "step 1"; + event.result = { + index: result.index, + control: result.control, }; }, - carryOutJunling:function(){ - 'step 0' - switch(event.junling){ - case 'junling1':{ - if(targets[0].isAlive()){ - player.line(targets,'green'); + carryOutJunling: function () { + "step 0"; + switch (event.junling) { + case "junling1": { + if (targets[0].isAlive()) { + player.line(targets, "green"); targets[0].damage(player); } break; } - case 'junling2':player.draw();event.num=1;break; - case 'junling3':player.loseHp();break; - case 'junling4':player.addTempSkill('junling4_eff');player.addTempSkill('fengyin_vice');player.addTempSkill('fengyin_main');break; - case 'junling5':player.turnOver();player.addTempSkill('junling5_eff');break; + case "junling2": + player.draw(); + event.num = 1; + break; + case "junling3": + player.loseHp(); + break; + case "junling4": + player.addTempSkill("junling4_eff"); + player.addTempSkill("fengyin_vice"); + player.addTempSkill("fengyin_main"); + break; + case "junling5": + player.turnOver(); + player.addTempSkill("junling5_eff"); + break; } - 'step 1' - if(event.junling=='junling2'&&source!=player&&player.countCards('he')>0){ - player.chooseCard('交给'+get.translation(source)+'第'+get.cnNumber(event.num)+'张牌(共两张)','he',true); - event.ing=true; + "step 1"; + if (event.junling == "junling2" && source != player && player.countCards("he") > 0) { + player.chooseCard( + "交给" + + get.translation(source) + + "第" + + get.cnNumber(event.num) + + "张牌(共两张)", + "he", + true + ); + event.ing = true; } - if(event.junling=='junling6'){ - var position='',num0=0; - if(player.countCards('h')){position+='h';num0++;} - if(player.countCards('e')){position+='e';num0++;} - player.chooseCard('选择一张手牌和一张装备区内牌(若有),然后弃置其余的牌',position,num0,function(card){ - if(ui.selected.cards.length) return get.position(card)!=get.position(ui.selected.cards[0]); - return true; - },true).set('complexCard',true).set('ai',function(card){return get.value(card)}); + if (event.junling == "junling6") { + var position = "", + num0 = 0; + if (player.countCards("h")) { + position += "h"; + num0++; + } + if (player.countCards("e")) { + position += "e"; + num0++; + } + player + .chooseCard( + "选择一张手牌和一张装备区内牌(若有),然后弃置其余的牌", + position, + num0, + function (card) { + if (ui.selected.cards.length) + return get.position(card) != get.position(ui.selected.cards[0]); + return true; + }, + true + ) + .set("complexCard", true) + .set("ai", function (card) { + return get.value(card); + }); } - 'step 2' - if(event.junling=='junling2'&&source!=player){ - if(result.cards.length&&event.ing){ - player.give(result.cards,source); + "step 2"; + if (event.junling == "junling2" && source != player) { + if (result.cards.length && event.ing) { + player.give(result.cards, source); } event.num++; - if(event.num<3){ - event.ing=false; + if (event.num < 3) { + event.ing = false; event.goto(1); } } - if(event.junling=='junling6'){ - var cards=player.getCards('he'); - for(var i=0;i0){ + removeMaxHp: function (num) { + if (game.online) return; + if (!num) num = 1; + while (num > 0) { num--; - if(typeof this.singleHp=='boolean'){ - if(this.singleHp){ - this.singleHp=false; - } - else{ - this.singleHp=true; + if (typeof this.singleHp == "boolean") { + if (this.singleHp) { + this.singleHp = false; + } else { + this.singleHp = true; this.maxHp--; } - } - else{ + } else { this.maxHp--; } } this.update(); }, - hideCharacter:function(num,log){ - if(this.isUnseen(2)) return; - var name=this['name'+(num+1)]; - var next=game.createEvent('hideCharacter'); - next.player=this; - next.toHide=name; - next.num=num; - next.log=log; - next.setContent('hideCharacter'); + hideCharacter: function (num, log) { + if (this.isUnseen(2)) return; + var name = this["name" + (num + 1)]; + var next = game.createEvent("hideCharacter"); + next.player = this; + next.toHide = name; + next.num = num; + next.log = log; + next.setContent("hideCharacter"); return next; }, - removeCharacter:function(num){ - var name=this['name'+(num+1)]; - var next=game.createEvent('removeCharacter'); - next.player=this; - next.toRemove=name; - next.num=num; - next.setContent('removeCharacter'); + removeCharacter: function (num) { + var name = this["name" + (num + 1)]; + var next = game.createEvent("removeCharacter"); + next.player = this; + next.toRemove = name; + next.num = num; + next.setContent("removeCharacter"); return next; }, - $removeCharacter:function(num){ - var name=this['name'+(num+1)]; - var info=lib.character[name]; - if(!info) return; - var to='gz_shibing'+(info[0]=='male'?1:2)+info[1]; - game.log(this,'移除了'+(num?'副将':'主将'),'#b'+name); - this.reinit(name,to,false); - this.showCharacter(num,false); + $removeCharacter: function (num) { + var name = this["name" + (num + 1)]; + var info = lib.character[name]; + if (!info) return; + var to = "gz_shibing" + (info[0] == "male" ? 1 : 2) + info[1]; + game.log(this, "移除了" + (num ? "副将" : "主将"), "#b" + name); + this.reinit(name, to, false); + this.showCharacter(num, false); _status.characterlist.add(name); }, - changeVice:function(hidden){ - var next=game.createEvent('changeVice'); - next.player=this; - next.setContent('changeVice'); - next.num=(!_status.connectMode&&get.config('changeViceType')=='online')?1:3; - if(hidden) next.hidden=true; + changeVice: function (hidden) { + var next = game.createEvent("changeVice"); + next.player = this; + next.setContent("changeVice"); + next.num = !_status.connectMode && get.config("changeViceType") == "online" ? 1 : 3; + if (hidden) next.hidden = true; return next; }, - hasMainCharacter:function(){ - return this.name1.indexOf('gz_shibing')!=0; + hasMainCharacter: function () { + return this.name1.indexOf("gz_shibing") != 0; }, - hasViceCharacter:function(){ - return this.name2.indexOf('gz_shibing')!=0; + hasViceCharacter: function () { + return this.name2.indexOf("gz_shibing") != 0; }, - $showCharacter:function(num,log){ - var showYe=false; - if(num==0&&!this.isUnseen(0)){ + $showCharacter: function (num, log) { + var showYe = false; + if (num == 0 && !this.isUnseen(0)) { return; } - if(num==1&&!this.isUnseen(1)){ + if (num == 1 && !this.isUnseen(1)) { return; } - if(!this.isUnseen(2)){ + if (!this.isUnseen(2)) { return; } - game.addVideo('showCharacter',this,num); - if(this.identity=='unknown'||((num==0||num==2)&&lib.character[this.name1][1]=='ye')){ - this.group=this.getGuozhanGroup(num); - if((num==0||num==2)&&lib.character[this.name1][1]=='ye'){ - this.identity='ye'; - if(!this._ye){ - this._ye=true; - showYe=true; + game.addVideo("showCharacter", this, num); + if ( + this.identity == "unknown" || + ((num == 0 || num == 2) && lib.character[this.name1][1] == "ye") + ) { + this.group = this.getGuozhanGroup(num); + if ((num == 0 || num == 2) && lib.character[this.name1][1] == "ye") { + this.identity = "ye"; + if (!this._ye) { + this._ye = true; + showYe = true; } - } - else if(get.is.jun(this.name1)&&this.isAlive()){ - this.identity=this.group; - } - else if(this.wontYe(this.group)){ - this.identity=this.group; - } - else{ - this.identity='ye'; + } else if (get.is.jun(this.name1) && this.isAlive()) { + this.identity = this.group; + } else if (this.wontYe(this.group)) { + this.identity = this.group; + } else { + this.identity = "ye"; } this.setIdentity(this.identity); - this.ai.shown=1; - this.node.identity.classList.remove('guessing'); + this.ai.shown = 1; + this.node.identity.classList.remove("guessing"); - if(_status.clickingidentity&&_status.clickingidentity[0]==this){ - for(var i=0;i<_status.clickingidentity[1].length;i++){ + if (_status.clickingidentity && _status.clickingidentity[0] == this) { + for (var i = 0; i < _status.clickingidentity[1].length; i++) { _status.clickingidentity[1][i].delete(); - _status.clickingidentity[1][i].style.transform=''; + _status.clickingidentity[1][i].style.transform = ""; } delete _status.clickingidentity; } - game.addVideo('setIdentity',this,this.identity); + game.addVideo("setIdentity", this, this.identity); } var skills; - switch(num){ + switch (num) { case 0: - if(log!==false) game.log(this,'展示了主将','#b'+this.name1); - this.name=this.name1; - skills=lib.character[this.name][3]; - this.sex=lib.character[this.name][0]; - this.classList.remove('unseen'); - break; + if (log !== false) game.log(this, "展示了主将", "#b" + this.name1); + this.name = this.name1; + skills = lib.character[this.name][3]; + this.sex = lib.character[this.name][0]; + this.classList.remove("unseen"); + break; case 1: - if(log!==false) game.log(this,'展示了副将','#b'+this.name2); - skills=lib.character[this.name2][3]; - if(this.sex=='unknown') this.sex=lib.character[this.name2][0]; - if(this.name.indexOf('unknown')==0) this.name=this.name2; - this.classList.remove('unseen2'); - break; + if (log !== false) game.log(this, "展示了副将", "#b" + this.name2); + skills = lib.character[this.name2][3]; + if (this.sex == "unknown") this.sex = lib.character[this.name2][0]; + if (this.name.indexOf("unknown") == 0) this.name = this.name2; + this.classList.remove("unseen2"); + break; case 2: - if(log!==false) game.log(this,'展示了主将','#b'+this.name1,'、副将','#b'+this.name2); - this.name=this.name1; - skills=lib.character[this.name][3].concat(lib.character[this.name2][3]); - this.sex=lib.character[this.name][0]; - this.classList.remove('unseen'); - this.classList.remove('unseen2'); - break; + if (log !== false) + game.log(this, "展示了主将", "#b" + this.name1, "、副将", "#b" + this.name2); + this.name = this.name1; + skills = lib.character[this.name][3].concat(lib.character[this.name2][3]); + this.sex = lib.character[this.name][0]; + this.classList.remove("unseen"); + this.classList.remove("unseen2"); + break; } - game.broadcast(function(player,name,sex,num,identity,group){ - player.identityShown=true; - player.group=group; - player.name=name; - player.sex=sex; - player.node.identity.classList.remove('guessing'); - switch(num){ - case 0:player.classList.remove('unseen');break; - case 1:player.classList.remove('unseen2');break; - case 2:player.classList.remove('unseen');player.classList.remove('unseen2');break; - } - player.ai.shown=1; - player.identity=identity; - player.setIdentity(identity); - if(_status.clickingidentity&&_status.clickingidentity[0]==player){ - for(var i=0;i<_status.clickingidentity[1].length;i++){ - _status.clickingidentity[1][i].delete(); - _status.clickingidentity[1][i].style.transform=''; + game.broadcast( + function (player, name, sex, num, identity, group) { + player.identityShown = true; + player.group = group; + player.name = name; + player.sex = sex; + player.node.identity.classList.remove("guessing"); + switch (num) { + case 0: + player.classList.remove("unseen"); + break; + case 1: + player.classList.remove("unseen2"); + break; + case 2: + player.classList.remove("unseen"); + player.classList.remove("unseen2"); + break; } - delete _status.clickingidentity; - } - },this,this.name,this.sex,num,this.identity,this.group); - this.identityShown=true; - for(var i=0;imap[player].length) return false; + if (!player || map[player].length < 2) return false; + for (var i in map) { + if (map[i].length > map[player].length) return false; } return true; }, - isNotMajor:function(){ - for(var i=0;i0){ - for(var i=0;i 0) { + for (var i = 0; i < targets.length; i++) { + shown = Math.abs(targets[i].ai.shown); + if (shown < 0.2 || targets[i].identity == "nei") c = 0; + else if (shown < 0.4) c = 0.5; + else if (shown < 0.6) c = 0.8; + else c = 1; + effect += get.effect(targets[i], card, this) * c; } } - if(effect>0){ - if(effect<1) c=0.5; - else c=1; - if(targets.length==1&&targets[0]==this); - else if(targets.length==1) this.ai.shown+=0.2*c; - else this.ai.shown+=0.1*c; + if (effect > 0) { + if (effect < 1) c = 0.5; + else c = 1; + if (targets.length == 1 && targets[0] == this); + else if (targets.length == 1) this.ai.shown += 0.2 * c; + else this.ai.shown += 0.1 * c; } } - if(this.ai.shown>0.95) this.ai.shown=0.95; - if(this.ai.shown<-0.5) this.ai.shown=-0.5; + if (this.ai.shown > 0.95) this.ai.shown = 0.95; + if (this.ai.shown < -0.5) this.ai.shown = -0.5; }, - } + }, }, - get:{ - guozhanReverse:function(name1,name2){ - if(get.is.double(name2)) return false; - if(['gz_xunyou','gz_lvfan','gz_liubei'].includes(name2)) return true; - if(name1=='gz_re_xushu') return true; - if(name2=='gz_dengai') return lib.character[name1][2]%2==1; - if(['gz_sunce','gz_jiangwei'].includes(name1)) return name2=='gz_zhoutai'||lib.character[name2][2]%2==1; + get: { + guozhanReverse: function (name1, name2) { + if (get.is.double(name2)) return false; + if (["gz_xunyou", "gz_lvfan", "gz_liubei"].includes(name2)) return true; + if (name1 == "gz_re_xushu") return true; + if (name2 == "gz_dengai") return lib.character[name1][2] % 2 == 1; + if (["gz_sunce", "gz_jiangwei"].includes(name1)) + return name2 == "gz_zhoutai" || lib.character[name2][2] % 2 == 1; return false; }, - guozhanRank:function(name,player){ - if(name.indexOf('gz_shibing')==0) return -1; - if(name.indexOf('gz_jun_')==0) return 7; - if(player){ - var skills=lib.character[name][3].slice(0); - for(var i=0;i0})) eff1=2; - else{ - if(get.damageEffect(targets[0],performer,source)>=0) eff1=2; - else eff1=-2; - if(get.damageEffect(targets[0],source,performer)>=0) eff2=2; - else eff2=-2; - } - break; - case 'junling2': - if(performer.countCards('he')){eff1=1;eff2=0;} - else{eff1=2;eff2=-1;} - break; - case 'junling3': - if(performer.hp==1&&!performer.hasSkillTag('save',true)) eff2=-5; - else{ - if(performer==viewer){ - if(performer.hasSkillTag('maihp',true)) eff2=3; - else eff2=-2; + junlingEffect: function (source, junling, performer, targets, viewer) { + var att1 = get.attitude(viewer, source), + att2 = get.attitude(viewer, performer); + var eff1 = 0, + eff2 = 0; + switch (junling) { + case "junling1": + if ( + !targets.length && + game.countPlayer(function (current) { + return get.damageEffect(viewer, current, viewer) > 0; + }) + ) + eff1 = 2; + else { + if (get.damageEffect(targets[0], performer, source) >= 0) eff1 = 2; + else eff1 = -2; + if (get.damageEffect(targets[0], source, performer) >= 0) eff2 = 2; + else eff2 = -2; } - else{ - if(performer.hasSkillTag('maihp',false)) eff2=3; - else eff2=-2; + break; + case "junling2": + if (performer.countCards("he")) { + eff1 = 1; + eff2 = 0; + } else { + eff1 = 2; + eff2 = -1; } - } - break; - case 'junling4':eff1=0;eff2=-2;break; - case 'junling5': - var td=performer.isTurnedOver(); - if(td){ - if(performer==viewer){ - if(_status.currentPhase==performer&&performer.hasSkill('jushou')) eff2=-3; - else eff2=3; + break; + case "junling3": + if (performer.hp == 1 && !performer.hasSkillTag("save", true)) eff2 = -5; + else { + if (performer == viewer) { + if (performer.hasSkillTag("maihp", true)) eff2 = 3; + else eff2 = -2; + } else { + if (performer.hasSkillTag("maihp", false)) eff2 = 3; + else eff2 = -2; + } } - else eff2=3; - } - else{ - if(performer==viewer){ - if(performer.hasSkillTag('noturn',true)) eff2=0; - else eff2=-3; + break; + case "junling4": + eff1 = 0; + eff2 = -2; + break; + case "junling5": + var td = performer.isTurnedOver(); + if (td) { + if (performer == viewer) { + if (_status.currentPhase == performer && performer.hasSkill("jushou")) + eff2 = -3; + else eff2 = 3; + } else eff2 = 3; + } else { + if (performer == viewer) { + if (performer.hasSkillTag("noturn", true)) eff2 = 0; + else eff2 = -3; + } else { + if (performer.hasSkillTag("noturn", false)) eff2 = 0; + else eff2 = -3; + } } - else{ - if(performer.hasSkillTag('noturn',false)) eff2=0; - else eff2=-3; - } - } - break; - case 'junling6': - if(performer.countCards('h')>1) eff2+=1-performer.countCards('h'); - if(performer.countCards('e')>1) eff2+=1-performer.countCards('e'); - break; + break; + case "junling6": + if (performer.countCards("h") > 1) eff2 += 1 - performer.countCards("h"); + if (performer.countCards("e") > 1) eff2 += 1 - performer.countCards("e"); + break; } - return Math.sign(att1)*eff1+Math.sign(att2)*eff2; + return Math.sign(att1) * eff1 + Math.sign(att2) * eff2; }, - realAttitude:function(from,to,difficulty,toidentity){ - var getIdentity=function(player){ - if(player.isUnseen()){ - if(!player.wontYe()) return 'ye'; + realAttitude: function (from, to, difficulty, toidentity) { + var getIdentity = function (player) { + if (player.isUnseen()) { + if (!player.wontYe()) return "ye"; return player.getGuozhanGroup(0); } return player.identity; }; - var fid=getIdentity(from); - if(fid==toidentity&&toidentity!='ye'){ - return 4+difficulty; + var fid = getIdentity(from); + if (fid == toidentity && toidentity != "ye") { + return 4 + difficulty; } - if(from.identity=='unknown'&&fid==toidentity){ - if(from.wontYe()) return 4+difficulty; + if (from.identity == "unknown" && fid == toidentity) { + if (from.wontYe()) return 4 + difficulty; } - var groups=[]; - var map={},sides=[],pmap=_status.connectMode?lib.playerOL:game.playerMap,player; - for(var i of game.players){ - if(i.identity=='unknown') continue; - var added=false; - for(var j of sides){ - if(i.isFriendOf(pmap[j])){ - added=true; + var groups = []; + var map = {}, + sides = [], + pmap = _status.connectMode ? lib.playerOL : game.playerMap, + player; + for (var i of game.players) { + if (i.identity == "unknown") continue; + var added = false; + for (var j of sides) { + if (i.isFriendOf(pmap[j])) { + added = true; map[j].push(i); - if(i==this) player=j; + if (i == this) player = j; break; } } - if(!added){ - map[i.playerid]=[i]; + if (!added) { + map[i.playerid] = [i]; sides.push(i.playerid); - if(i==this) player=i.playerid; + if (i == this) player = i.playerid; } } - for(var i in map){ - var num=map[i].length; + for (var i in map) { + var num = map[i].length; groups.push(num); } - var max=Math.max.apply(this,groups); - if(max<=1) return -3; + var max = Math.max.apply(this, groups); + if (max <= 1) return -3; var from_p; - if(from.identity=='unknown'&&from.wontYe()) from_p=get.population(fid); - else from_p=game.countPlayer(function(current){ - return current.isFriendOf(from); - }); - var to_p=game.countPlayer(function(current){ + if (from.identity == "unknown" && from.wontYe()) from_p = get.population(fid); + else + from_p = game.countPlayer(function (current) { + return current.isFriendOf(from); + }); + var to_p = game.countPlayer(function (current) { return current.isFriendOf(to); }); - if(to.identity=='ye') to_p+=1.5; + if (to.identity == "ye") to_p += 1.5; - if(to_p>=max) return -5; - if(from_p>=max) return -2-to_p; - if(max>=game.players.length/2){ - if(to_p<=from_p){ + if (to_p >= max) return -5; + if (from_p >= max) return -2 - to_p; + if (max >= game.players.length / 2) { + if (to_p <= from_p) { return 0.5; } return 0; } - if(to_p=0.5) return att*to.ai.shown; + if (to.ai.shown >= 0.5) return att * to.ai.shown; - var nshown=0; - for(var i=0;i=game.players.length/2&&att>=0){ + if (to.ai.shown == 0) { + if (nshown >= game.players.length / 2 && att >= 0) { return 0; } - return Math.min(0,Math.random()-0.5)+difficulty; + return Math.min(0, Math.random() - 0.5) + difficulty; } - if(to.ai.shown>=0.2){ - if(att>2){ - return Math.max(0,Math.random()-0.5)+difficulty; + if (to.ai.shown >= 0.2) { + if (att > 2) { + return Math.max(0, Math.random() - 0.5) + difficulty; } - if(att>=0){ + if (att >= 0) { return 0; } - return Math.min(0,Math.random()-0.7)+difficulty; + return Math.min(0, Math.random() - 0.7) + difficulty; } - if(att>2){ - return Math.max(0,Math.random()-0.7)+difficulty; + if (att > 2) { + return Math.max(0, Math.random() - 0.7) + difficulty; } - if(att>=0){ - return Math.min(0,Math.random()-0.3)+difficulty; + if (att >= 0) { + return Math.min(0, Math.random() - 0.3) + difficulty; } - return Math.min(0,Math.random()-0.5)+difficulty; + return Math.min(0, Math.random() - 0.5) + difficulty; }, }, - help:{ - '国战模式': - '
    声明
    • 以下所有规则均为根据公开爆料整理,经村规改动后制定的临时规则。不代表任何官方意见。请以后续发布的官方规则作为标准。
    ' - +'
    双势力武将
    • 双势力武将牌可以和野心家武将牌/包含势力单武将牌/含有重叠势力的其他双势力武将牌组合,若你的主将为双势力武将,则:若你的副将为单势力武将牌,你的势力视为此势力;若你的副将为双势力武将,你的势力视为两张武将牌上的重叠势力(若重叠势力不止一个则需在游戏开始时选择一个作为自己的势力);野心家武将牌为主将,双势力武将牌为副将时,游戏开始时需选择一个副将所含势力作为副将的势力。
    • 变更副将时,可以选择包含原势力的双势力武将牌。左慈发动〖役鬼〗时,可以使用双势力武将牌同时指定两个不同势力的角色为目标。
    • 特殊地,“冈崎汐”作为多势力武将牌,结算流程和规则与其他双势力武将相同。
    ' - +'
    野心家武将
    • 野心家武将只能放在主将位置。副将可以为任意非野心家武将牌。
    • 选择了野心家武将牌的角色(以下简称“野心家角色”)仅明置副将时,若副将为单势力武将牌,则势力暂时视为与该武将牌相同。若副将为双势力武将牌,则势力视为游戏开始时选择的副将代表的势力。
    • 野心家角色明置主将时,其势力改为野心家。若其是首次明置该武将牌,则其获得一个“野心家”标记。
    • “野心家”标记可以当做“先驱”标记,“阴阳鱼”标记或是“珠联璧合”标记使用。当同时拥有两种标记时,优先弃置原装标记,下次发动时才弃置“野心家”标记。
    • 野心家角色变更副将时,若其主将未明置过,则按照副将的势力进行变更。若主将已经明置过,则可以选择所有的非野心家武将牌。左慈发动〖役鬼〗时,可以使用野心家武将牌同时指定所有势力的角色为目标。' - +'
    • 当场上触发了胜利条件时,若这些角色中存在未明置过主将的野心家角色,则这些野心家角色选择是否“暴露野心”。若无人选择“是”且场上存在非野心家角色存活,则所有非野心家角色胜利,野心家角色失败。若有人选择“是”,则这些角色明置主将,然后选择是否发起“拉拢人心”。
    • 选择发起“拉拢人心”的野心家角色选择一个新的势力作为自己的势力,弃置“野心家”标记,令所有其他非野心家角色且非君主且非已“结盟”角色依次选择是否和该野心家角色“结盟”。选择“是”的角色将势力改为和该野心家势力相同。此次“拉拢人心”对所有其他角色询问结束后,所有选择“否”的角色将手牌摸至四张并回复1点体力。
    ' - +'
    纵横捭阖
    • 当一名角色对目标角色发动具有拥有“纵横”衍生技的技能时,其可以令对方获得“纵横”衍生技直到其下回合结束。
    ', + help: { + 国战模式: + '
    声明
    • 以下所有规则均为根据公开爆料整理,经村规改动后制定的临时规则。不代表任何官方意见。请以后续发布的官方规则作为标准。
    ' + + '
    双势力武将
    • 双势力武将牌可以和野心家武将牌/包含势力单武将牌/含有重叠势力的其他双势力武将牌组合,若你的主将为双势力武将,则:若你的副将为单势力武将牌,你的势力视为此势力;若你的副将为双势力武将,你的势力视为两张武将牌上的重叠势力(若重叠势力不止一个则需在游戏开始时选择一个作为自己的势力);野心家武将牌为主将,双势力武将牌为副将时,游戏开始时需选择一个副将所含势力作为副将的势力。
    • 变更副将时,可以选择包含原势力的双势力武将牌。左慈发动〖役鬼〗时,可以使用双势力武将牌同时指定两个不同势力的角色为目标。
    • 特殊地,“冈崎汐”作为多势力武将牌,结算流程和规则与其他双势力武将相同。
    ' + + '
    野心家武将
    • 野心家武将只能放在主将位置。副将可以为任意非野心家武将牌。
    • 选择了野心家武将牌的角色(以下简称“野心家角色”)仅明置副将时,若副将为单势力武将牌,则势力暂时视为与该武将牌相同。若副将为双势力武将牌,则势力视为游戏开始时选择的副将代表的势力。
    • 野心家角色明置主将时,其势力改为野心家。若其是首次明置该武将牌,则其获得一个“野心家”标记。
    • “野心家”标记可以当做“先驱”标记,“阴阳鱼”标记或是“珠联璧合”标记使用。当同时拥有两种标记时,优先弃置原装标记,下次发动时才弃置“野心家”标记。
    • 野心家角色变更副将时,若其主将未明置过,则按照副将的势力进行变更。若主将已经明置过,则可以选择所有的非野心家武将牌。左慈发动〖役鬼〗时,可以使用野心家武将牌同时指定所有势力的角色为目标。' + + "
    • 当场上触发了胜利条件时,若这些角色中存在未明置过主将的野心家角色,则这些野心家角色选择是否“暴露野心”。若无人选择“是”且场上存在非野心家角色存活,则所有非野心家角色胜利,野心家角色失败。若有人选择“是”,则这些角色明置主将,然后选择是否发起“拉拢人心”。
    • 选择发起“拉拢人心”的野心家角色选择一个新的势力作为自己的势力,弃置“野心家”标记,令所有其他非野心家角色且非君主且非已“结盟”角色依次选择是否和该野心家角色“结盟”。选择“是”的角色将势力改为和该野心家势力相同。此次“拉拢人心”对所有其他角色询问结束后,所有选择“否”的角色将手牌摸至四张并回复1点体力。
    " + + '
    纵横捭阖
    • 当一名角色对目标角色发动具有拥有“纵横”衍生技的技能时,其可以令对方获得“纵横”衍生技直到其下回合结束。
    ', }, }; }); diff --git a/mode/identity.js b/mode/identity.js index 9e1e30cc2..15c00e139 100644 --- a/mode/identity.js +++ b/mode/identity.js @@ -1,1620 +1,1908 @@ -'use strict'; -game.import('mode',function(lib,game,ui,get,ai,_status){ +"use strict"; +game.import("mode", function (lib, game, ui, get, ai, _status) { return { - name:'identity', - start:function(){ - "step 0" - if(!lib.config.new_tutorial){ - ui.arena.classList.add('only_dialog'); + name: "identity", + start: function () { + "step 0"; + if (!lib.config.new_tutorial) { + ui.arena.classList.add("only_dialog"); } - _status.mode=get.config('identity_mode'); - if(_status.brawl&&_status.brawl.submode){ - _status.mode=_status.brawl.submode; + _status.mode = get.config("identity_mode"); + if (_status.brawl && _status.brawl.submode) { + _status.mode = _status.brawl.submode; } - event.replacePile=function(){ - var list=['shengdong','qijia','caomu','jinchan','zengbin','fulei','qibaodao','zhungangshuo','lanyinjia']; - var map={ - shunshou:'shengdong', - jiedao:'qijia', - bingliang:'caomu', - wuxie:'jinchan', - wuzhong:'zengbin', - wugu:'zengbin', - shandian:'fulei', - qinggang:'qibaodao', - qinglong:'zhungangshuo', - bagua:'lanyinjia' + event.replacePile = function () { + var list = [ + "shengdong", + "qijia", + "caomu", + "jinchan", + "zengbin", + "fulei", + "qibaodao", + "zhungangshuo", + "lanyinjia", + ]; + var map = { + shunshou: "shengdong", + jiedao: "qijia", + bingliang: "caomu", + wuxie: "jinchan", + wuzhong: "zengbin", + wugu: "zengbin", + shandian: "fulei", + qinggang: "qibaodao", + qinglong: "zhungangshuo", + bagua: "lanyinjia", }; - for(var i=0;i跳过后,你可以在选项-其它中重置新手向导'); ui.auto.hide(); - ui.create.control('跳过向导',function(){ + ui.create.control("跳过向导", function () { clear(); clear2(); game.resume(); // lib.cheat.cfg(); // owidgets }); - ui.create.control('继续',step2); - } - var step2=function(){ - if(!lib.config.phonelayout){ + ui.create.control("继续", step2); + }; + var step2 = function () { + if (!lib.config.phonelayout) { clear(); - ui.create.dialog('如果你在使用手机,可能会觉得按钮有点小'+ - ',将布局改成移动可以使按钮变大'); + ui.create.dialog( + "如果你在使用手机,可能会觉得按钮有点小" + ",将布局改成移动可以使按钮变大" + ); ui.dialog.add('
    你可以在选项-外观-布局中更改此设置'); - var lcontrol=ui.create.control('使用移动布局',function(){ - if(lib.config.phonelayout){ - ui.control.firstChild.firstChild.innerHTML='使用移动布局'; - game.saveConfig('phonelayout',false); - lib.init.layout('mobile'); - } - else{ - ui.control.firstChild.firstChild.innerHTML='使用默认布局'; - game.saveConfig('phonelayout',true); - lib.init.layout('mobile'); + var lcontrol = ui.create.control("使用移动布局", function () { + if (lib.config.phonelayout) { + ui.control.firstChild.firstChild.innerHTML = "使用移动布局"; + game.saveConfig("phonelayout", false); + lib.init.layout("mobile"); + } else { + ui.control.firstChild.firstChild.innerHTML = "使用默认布局"; + game.saveConfig("phonelayout", true); + lib.init.layout("mobile"); } }); - ui.create.control('继续',step3); - } - else{ + ui.create.control("继续", step3); + } else { step3(); } }; - var step3=function(){ - if(lib.config.touchscreen){ + var step3 = function () { + if (lib.config.touchscreen) { clear(); - ui.create.dialog('触屏模式中,下划可以显示菜单,上划可以切换托管,双指单击可以暂停'); + ui.create.dialog("触屏模式中,下划可以显示菜单,上划可以切换托管,双指单击可以暂停"); ui.dialog.add('
    你可以在选项-通用-中更改手势设置'); - ui.create.control('继续',step4); - } - else{ + ui.create.control("继续", step4); + } else { step4(); } }; - var step4=lib.genAsync(function*(){ + var step4 = lib.genAsync(function* () { clear(); - ui.window.classList.add('noclick_important'); + ui.window.classList.add("noclick_important"); ui.click.configMenu(); - ui.control.classList.add('noclick_click_important'); - ui.control.style.top='calc(100% - 105px)'; - yield new Promise(resolve => ui.create.control('在菜单中,可以进行各项设置',resolve)); - ui.click.menuTab('选项'); - yield new Promise(resolve => ui.controls[0].replace('如果你感到游戏较卡,可以开启流畅模式',resolve)); - yield new Promise(resolve => ui.controls[0].replace('在技能一栏中,可以设置自动发动或双将禁配的技能',resolve)); - ui.click.menuTab('武将'); - yield new Promise(resolve => ui.controls[0].replace('在武将或卡牌一栏中,单击武将/卡牌可以将其禁用',resolve)); - ui.click.menuTab('战局'); - yield new Promise(resolve => ui.controls[0].replace('在战局中可以输入游戏命令,或者管理录像',resolve)); - ui.click.menuTab('帮助'); - yield new Promise(resolve => ui.controls[0].replace('在帮助中,可以检查更新和下载素材',resolve)); + ui.control.classList.add("noclick_click_important"); + ui.control.style.top = "calc(100% - 105px)"; + yield new Promise((resolve) => ui.create.control("在菜单中,可以进行各项设置", resolve)); + ui.click.menuTab("选项"); + yield new Promise((resolve) => + ui.controls[0].replace("如果你感到游戏较卡,可以开启流畅模式", resolve) + ); + yield new Promise((resolve) => + ui.controls[0].replace("在技能一栏中,可以设置自动发动或双将禁配的技能", resolve) + ); + ui.click.menuTab("武将"); + yield new Promise((resolve) => + ui.controls[0].replace("在武将或卡牌一栏中,单击武将/卡牌可以将其禁用", resolve) + ); + ui.click.menuTab("战局"); + yield new Promise((resolve) => + ui.controls[0].replace("在战局中可以输入游戏命令,或者管理录像", resolve) + ); + ui.click.menuTab("帮助"); + yield new Promise((resolve) => + ui.controls[0].replace("在帮助中,可以检查更新和下载素材", resolve) + ); ui.click.configMenu(); - ui.window.classList.remove('noclick_important'); - ui.control.classList.remove('noclick_click_important'); - ui.control.style.top=''; + ui.window.classList.remove("noclick_important"); + ui.control.classList.remove("noclick_click_important"); + ui.control.style.top = ""; step5(); }); - var step5=function(){ + var step5 = function () { clear(); - ui.create.dialog('如果还有其它问题,欢迎来到百度无名杀吧进行交流'); - ui.create.control('完成',function(){ + ui.create.dialog("如果还有其它问题,欢迎来到百度无名杀吧进行交流"); + ui.create.control("完成", function () { clear(); clear2(); game.resume(); - }) + }); }; game.pause(); step1(); - } - else{ - if(!_status.connectMode){ + } else { + if (!_status.connectMode) { game.showChangeLog(); } } - "step 3" - if(typeof _status.new_tutorial=='function'){ + "step 3"; + if (typeof _status.new_tutorial == "function") { _status.new_tutorial(); } delete _status.new_tutorial; - if(_status.connectMode){ - game.waitForPlayer(function(){ - if(lib.configOL.identity_mode=='zhong'||lib.configOL.identity_mode=='purple'){ - lib.configOL.number=8; + if (_status.connectMode) { + game.waitForPlayer(function () { + if (lib.configOL.identity_mode == "zhong" || lib.configOL.identity_mode == "purple") { + lib.configOL.number = 8; } }); } - "step 4" - var yearLimitCheck=()=>{ - var next=game.createEvent('year_limit_pop',false); - next.setContent(function(){ - 'step 0' - var str=get.cnNumber(game.shuffleNumber+1,true); - game.me.$fullscreenpop(`第${str}年`,'thunder'); - game.log('游戏进入了',`#y第${str}年`); - if(game.shuffleNumber+1 { + var next = game.createEvent("year_limit_pop", false); + next.setContent(function () { + "step 0"; + var str = get.cnNumber(game.shuffleNumber + 1, true); + game.me.$fullscreenpop(`第${str}年`, "thunder"); + game.log("游戏进入了", `#y第${str}年`); + if (game.shuffleNumber + 1 < game.countPlayer2()) event.finish(); else game.delay(2); - 'step 1' - game.me.$fullscreenpop('年份已到','metal'); - game.log('年份已到,主忠方判定为胜利'); + "step 1"; + game.me.$fullscreenpop("年份已到", "metal"); + game.log("年份已到,主忠方判定为胜利"); game.delay(2); - 'step 2' - game.over(game.me.identity=='zhu'||game.me.identity=='zhong'||game.me.identity=='mingzhong'||(game.me.identity=='commoner'&&game.me.isIn())); + "step 2"; + game.over( + game.me.identity == "zhu" || + game.me.identity == "zhong" || + game.me.identity == "mingzhong" || + (game.me.identity == "commoner" && game.me.isIn()) + ); }); }; - if(_status.connectMode){ - _status.mode=lib.configOL.identity_mode; - if(_status.mode=='zhong'){ - lib.configOL.number=8; - if(lib.configOL.zhong_card){ + if (_status.connectMode) { + _status.mode = lib.configOL.identity_mode; + if (_status.mode == "zhong") { + lib.configOL.number = 8; + if (lib.configOL.zhong_card) { event.replacePile(); } - } - else if(_status.mode=='purple'){ - lib.configOL.number=8; - } - else if(_status.mode=='normal'){ - if(lib.configOL.enable_commoner||lib.configOL.double_nei){ - var identity=lib.configOL.enable_commoner?'commoner':'nei'; - for(var i=1;ii=='nei').length>=2) toReplace='nei'; - else if(list.filter(i=>i=='zhong').length>list.filter(i=>i=='fan').length/2) toReplace='zhong'; - else toReplace='fan'; + if (list.filter((i) => i == "nei").length >= 2) toReplace = "nei"; + else if ( + list.filter((i) => i == "zhong").length > + list.filter((i) => i == "fan").length / 2 + ) + toReplace = "zhong"; + else toReplace = "fan"; list.remove(toReplace); list.push(identity); } - game.broadcast(identityList=>lib.config.mode_config.identity.identity=identityList,lib.config.mode_config.identity.identity); + game.broadcast( + (identityList) => (lib.config.mode_config.identity.identity = identityList), + lib.config.mode_config.identity.identity + ); } } - if(lib.configOL.number<2){ - lib.configOL.number=2; + if (lib.configOL.number < 2) { + lib.configOL.number = 2; } - if(_status.mode!='purple'&&lib.configOL.enable_year_limit){ + if (_status.mode != "purple" && lib.configOL.enable_year_limit) { lib.onwash.push(yearLimitCheck); } game.randomMapOL(); - } - else{ - if(_status.mode=='normal'&&(get.config('enable_commoner')||get.config('double_nei'))){ - var identity=get.config('enable_commoner')?'commoner':'nei'; - for(var i=1;ii=='nei').length>=2) toReplace='nei'; - else if(list.filter(i=>i=='zhong').length>list.filter(i=>i=='fan').length/2) toReplace='zhong'; - else toReplace='fan'; + if (list.filter((i) => i == "nei").length >= 2) toReplace = "nei"; + else if ( + list.filter((i) => i == "zhong").length > + list.filter((i) => i == "fan").length / 2 + ) + toReplace = "zhong"; + else toReplace = "fan"; list.remove(toReplace); list.push(identity); } } - if(_status.mode!='purple'&&get.config('enable_year_limit')){ + if (_status.mode != "purple" && get.config("enable_year_limit")) { lib.onwash.push(yearLimitCheck); } - for(var i=0;i{ - _status.stratagemFuryMax=3; - ui.css.stratagemCardStyle=lib.init.sheet([ - '.card.stratagem-fury-glow:before{', - 'opacity:0.2;', - 'box-shadow:rgba(0,0,0,0.2) 0 0 0 1px,rgb(255,109,12) 0 0 5px,rgb(255,0,0) 0 0 10px;', - 'background-color:yellow;', - '-webkit-filter:blur(5px);', - 'filter:blur(5px);', - '}' - ].join('')); + var stratagemBroadcast = () => { + _status.stratagemFuryMax = 3; + ui.css.stratagemCardStyle = lib.init.sheet( + [ + ".card.stratagem-fury-glow:before{", + "opacity:0.2;", + "box-shadow:rgba(0,0,0,0.2) 0 0 0 1px,rgb(255,109,12) 0 0 5px,rgb(255,0,0) 0 0 10px;", + "background-color:yellow;", + "-webkit-filter:blur(5px);", + "filter:blur(5px);", + "}", + ].join("") + ); }; game.broadcastAll(stratagemBroadcast); - if(_status.connectMode&&!_status.postReconnect.stratagemReinit) _status.postReconnect.stratagemReinit=[stratagemBroadcast,{}]; - for(var current of game.players){ - if(current.identity=='zhu') current.addSkill('stratagem_monarchy'); - if(current.identity=='fan') current.addSkill('stratagem_revitalization'); + if (_status.connectMode && !_status.postReconnect.stratagemReinit) + _status.postReconnect.stratagemReinit = [stratagemBroadcast, {}]; + for (var current of game.players) { + if (current.identity == "zhu") current.addSkill("stratagem_monarchy"); + if (current.identity == "fan") current.addSkill("stratagem_revitalization"); } } - if(game.zhu==game.me&&game.zhu.identity!='zhu'&&_status.brawl&&_status.brawl.identityShown){ + if ( + game.zhu == game.me && + game.zhu.identity != "zhu" && + _status.brawl && + _status.brawl.identityShown + ) { delete game.zhu; - } - else{ - if(!stratagemMode) game.zhu.ai.shown=1; - if(game.zhu2){ - game.zhong=game.zhu; - game.zhu=game.zhu2; + } else { + if (!stratagemMode) game.zhu.ai.shown = 1; + if (game.zhu2) { + game.zhong = game.zhu; + game.zhu = game.zhu2; delete game.zhu2; - if(game.zhong.sex=='male'&&game.zhong.maxHp<=4){ - game.zhong.addSkill('dongcha'); - } - else{ - game.zhong.addSkill('sheshen'); + if (game.zhong.sex == "male" && game.zhong.maxHp <= 4) { + game.zhong.addSkill("dongcha"); + } else { + game.zhong.addSkill("sheshen"); } } - var enhance_zhu=false; - if(_status.connectMode){ - enhance_zhu=(!['zhong','stratagem','purple'].includes(_status.mode)&&lib.configOL.enhance_zhu&&get.population('fan')>=3); + var enhance_zhu = false; + if (_status.connectMode) { + enhance_zhu = + !["zhong", "stratagem", "purple"].includes(_status.mode) && + lib.configOL.enhance_zhu && + get.population("fan") >= 3; + } else { + enhance_zhu = + !["zhong", "stratagem", "purple"].includes(_status.mode) && + get.config("enhance_zhu") && + get.population("fan") >= 3; } - else{ - enhance_zhu=(!['zhong','stratagem','purple'].includes(_status.mode)&&get.config('enhance_zhu')&&get.population('fan')>=3); - } - if(enhance_zhu){ + if (enhance_zhu) { var skill; - switch(game.zhu.name){ - case 'key_yuri':skill='buqu';break; - case 'liubei':skill='jizhen';break; - case 'dongzhuo':skill='hengzheng';break; - case 'sunquan':skill='batu';break; - case 'sp_zhangjiao':skill='tiangong';break; - case 'liushan':skill='shengxi';break; - case 'sunce':skill='ciqiu';break; - case 're_sunben':skill='ciqiu';break; - case 'yuanshao':skill='geju';break; - case 're_caocao':skill='dangping';break; - case 'caopi':skill='junxing';break; - case 'liuxie':skill='moukui';break; - default:skill='tianming';break; + switch (game.zhu.name) { + case "key_yuri": + skill = "buqu"; + break; + case "liubei": + skill = "jizhen"; + break; + case "dongzhuo": + skill = "hengzheng"; + break; + case "sunquan": + skill = "batu"; + break; + case "sp_zhangjiao": + skill = "tiangong"; + break; + case "liushan": + skill = "shengxi"; + break; + case "sunce": + skill = "ciqiu"; + break; + case "re_sunben": + skill = "ciqiu"; + break; + case "yuanshao": + skill = "geju"; + break; + case "re_caocao": + skill = "dangping"; + break; + case "caopi": + skill = "junxing"; + break; + case "liuxie": + skill = "moukui"; + break; + default: + skill = "tianming"; + break; } - game.broadcastAll(function(player,skill){ - player.addSkill(skill); - player.storage.enhance_zhu=skill; - },game.zhu,skill); + game.broadcastAll( + function (player, skill) { + player.addSkill(skill); + player.storage.enhance_zhu = skill; + }, + game.zhu, + skill + ); } } game.syncState(); - event.trigger('gameStart'); + event.trigger("gameStart"); - var players=get.players(lib.sort.position); - var info=[]; - for(var i=0;i5) return 5; + "step 6"; + if (_status.mode != "stratagem") + event.beginner = _status.firstAct2 || game.zhong || game.zhu || _status.firstAct || game.me; + game.gameDraw(event.beginner, function (player) { + if (_status.mode == "purple" && player.seatNum > 5) return 5; return 4; }); - if(_status.connectMode&&lib.configOL.change_card) game.replaceHandcards(game.players.slice(0)); - "step 7" + if (_status.connectMode && lib.configOL.change_card) game.replaceHandcards(game.players.slice(0)); + "step 7"; game.phaseLoop(event.beginner); }, - game:{ - canReplaceViewpoint:()=>true, - getState:function(){ - var state={}; - for(var i in lib.playerOL){ - var player=lib.playerOL[i]; - state[i]={identity:player.identity}; - if(player==game.zhu){ - state[i].zhu=true; + game: { + canReplaceViewpoint: () => true, + getState: function () { + var state = {}; + for (var i in lib.playerOL) { + var player = lib.playerOL[i]; + state[i] = { identity: player.identity }; + if (player == game.zhu) { + state[i].zhu = true; } - if(player==game.zhong){ - state[i].zhong=true; + if (player == game.zhong) { + state[i].zhong = true; } - if(player.isZhu){ - state[i].isZhu=true; + if (player.isZhu) { + state[i].isZhu = true; } - if(player.special_identity){ - state[i].special_identity=player.special_identity; + if (player.special_identity) { + state[i].special_identity = player.special_identity; } - state[i].shown=player.ai.shown; + state[i].shown = player.ai.shown; //state[i].group=player.group; } return state; }, - updateState:function(state){ - for(var i in state){ - var player=lib.playerOL[i]; - if(player){ - player.identity=state[i].identity; - if(state[i].identity=='rZhu'||state[i].identity=='bZhu') game[state[i].identity]=player; - if(state[i].special_identity){ - player.special_identity=state[i].special_identity; - if(player.node.dieidentity){ - player.node.dieidentity.innerHTML=get.translation(state[i].special_identity); - player.node.identity.firstChild.innerHTML=get.translation(state[i].special_identity+'_bg'); + updateState: function (state) { + for (var i in state) { + var player = lib.playerOL[i]; + if (player) { + player.identity = state[i].identity; + if (state[i].identity == "rZhu" || state[i].identity == "bZhu") + game[state[i].identity] = player; + if (state[i].special_identity) { + player.special_identity = state[i].special_identity; + if (player.node.dieidentity) { + player.node.dieidentity.innerHTML = get.translation( + state[i].special_identity + ); + player.node.identity.firstChild.innerHTML = get.translation( + state[i].special_identity + "_bg" + ); } } - if(state[i].zhu){ - game.zhu=player; + if (state[i].zhu) { + game.zhu = player; } - if(state[i].isZhu){ - player.isZhu=true; + if (state[i].isZhu) { + player.isZhu = true; } - if(state[i].zhong){ - game.zhong=player; + if (state[i].zhong) { + game.zhong = player; } - player.ai.shown=state[i].shown; + player.ai.shown = state[i].shown; //player.group=state[i].group; //player.node.name.dataset.nature=get.groupnature(player.group); } } }, - getRoomInfo:function(uiintro){ - uiintro.add('
    游戏模式:'+(lib.configOL.identity_mode=='zhong'?'明忠':'标准')); - uiintro.add('
    双将模式:'+(lib.configOL.double_character?'开启':'关闭')); - if(lib.configOL.identity_mode!='zhong'){ - if(lib.configOL.identity_mode=='stratagem'){ - uiintro.add('
    首轮强化:'+(lib.configOL.round_one_use_fury?'开启':'关闭')); - } - else if(lib.configOL.identity_mode!='purple'){ - uiintro.add('
    双内奸:'+(lib.configOL.double_nei?'开启':'关闭')); - if(lib.configOL.identity_mode!='stratagem'){ - uiintro.add('
    加强主公:'+(lib.configOL.enhance_zhu?'开启':'关闭')); - uiintro.add('
    平民身份:'+(lib.configOL.enable_commoner?'开启':'关闭')); + getRoomInfo: function (uiintro) { + uiintro.add( + '
    游戏模式:' + + (lib.configOL.identity_mode == "zhong" ? "明忠" : "标准") + ); + uiintro.add( + '
    双将模式:' + (lib.configOL.double_character ? "开启" : "关闭") + ); + if (lib.configOL.identity_mode != "zhong") { + if (lib.configOL.identity_mode == "stratagem") { + uiintro.add( + '
    首轮强化:' + + (lib.configOL.round_one_use_fury ? "开启" : "关闭") + ); + } else if (lib.configOL.identity_mode != "purple") { + uiintro.add( + '
    双内奸:' + (lib.configOL.double_nei ? "开启" : "关闭") + ); + if (lib.configOL.identity_mode != "stratagem") { + uiintro.add( + '
    加强主公:' + + (lib.configOL.enhance_zhu ? "开启" : "关闭") + ); + uiintro.add( + '
    平民身份:' + + (lib.configOL.enable_commoner ? "开启" : "关闭") + ); } - uiintro.add('
    年机制:'+(lib.configOL.enable_year_limit?'开启':'关闭')); + uiintro.add( + '
    年机制:' + + (lib.configOL.enable_year_limit ? "开启" : "关闭") + ); } + } else { + uiintro.add( + '
    卡牌替换:' + (lib.configOL.zhong_card ? "开启" : "关闭") + ); } - else{ - uiintro.add('
    卡牌替换:'+(lib.configOL.zhong_card?'开启':'关闭')); - } - var last=uiintro.add('
    出牌时限:'+lib.configOL.choose_timeout+'秒'); + var last = uiintro.add( + '
    出牌时限:' + lib.configOL.choose_timeout + "秒" + ); // uiintro.add('
    屏蔽弱将:'+(lib.configOL.ban_weak?'开启':'关闭')); // var last=uiintro.add('
    屏蔽强将:'+(lib.configOL.ban_strong?'开启':'关闭')); - if(lib.configOL.banned.length){ - last=uiintro.add('
    禁用武将:'+get.translation(lib.configOL.banned)); + if (lib.configOL.banned.length) { + last = uiintro.add( + '
    禁用武将:' + get.translation(lib.configOL.banned) + ); } - if(lib.configOL.bannedcards.length){ - last=uiintro.add('
    禁用卡牌:'+get.translation(lib.configOL.bannedcards)); + if (lib.configOL.bannedcards.length) { + last = uiintro.add( + '
    禁用卡牌:' + get.translation(lib.configOL.bannedcards) + ); } - last.style.paddingBottom='8px'; + last.style.paddingBottom = "8px"; }, - getIdentityList:function(player){ - if(player.identityShown) return; - if(player==game.me) return; - if(_status.mode=='purple'){ - if(_status.yeconfirm&&['rNei','bNei'].includes(game.me.identity)&&['rNei','bNei'].includes(player.identity)) return; - if(player.identity.slice(0,1)=='r') return { - cai2:'猜', - rZhong:'忠', - rNei:'内', - rYe:'野', - } + getIdentityList: function (player) { + if (player.identityShown) return; + if (player == game.me) return; + if (_status.mode == "purple") { + if ( + _status.yeconfirm && + ["rNei", "bNei"].includes(game.me.identity) && + ["rNei", "bNei"].includes(player.identity) + ) + return; + if (player.identity.slice(0, 1) == "r") + return { + cai2: "猜", + rZhong: "忠", + rNei: "内", + rYe: "野", + }; return { - cai:'猜', - bZhong:'忠', - bNei:'内', - bYe:'野', - } - } - else if(_status.mode=='zhong'){ - if(player.fanfixed) return; - if(game.zhu&&game.zhu.isZhu){ + cai: "猜", + bZhong: "忠", + bNei: "内", + bYe: "野", + }; + } else if (_status.mode == "zhong") { + if (player.fanfixed) return; + if (game.zhu && game.zhu.isZhu) { return { - fan:'反', - zhong:'忠', - nei:'内', - cai:'猜', - } - } - else{ + fan: "反", + zhong: "忠", + nei: "内", + cai: "猜", + }; + } else { return { - fan:'反', - zhong:'忠', - nei:'内', - zhu:'主', - cai:'猜', - } + fan: "反", + zhong: "忠", + nei: "内", + zhu: "主", + cai: "猜", + }; } - } - else if(_status.mode=='stratagem'){ - if(game.zhu&&game.zhu.isZhu&&game.zhu.identityShown||game.me.identity=='zhu'){ + } else if (_status.mode == "stratagem") { + if ((game.zhu && game.zhu.isZhu && game.zhu.identityShown) || game.me.identity == "zhu") { return { - fan:'反', - zhong:'忠', - nei:'内', - enemy:'敌', - friend:'友', - cai:'猜', - } + fan: "反", + zhong: "忠", + nei: "内", + enemy: "敌", + friend: "友", + cai: "猜", + }; + } else { + return { + fan: "反", + zhong: "忠", + nei: "内", + zhu: "主", + enemy: "敌", + friend: "友", + cai: "猜", + }; } - else{ + } else { + if (get.config("enable_commoner")) { return { - fan:'反', - zhong:'忠', - nei:'内', - zhu:'主', - enemy:'敌', - friend:'友', - cai:'猜', - } - } - } - else{ - if(get.config('enable_commoner')){ + fan: "反", + zhong: "忠", + nei: "内", + commoner: "民", + cai: "猜", + }; + } else { return { - fan:'反', - zhong:'忠', - nei:'内', - commoner:'民', - cai:'猜', - } - } - else{ - return { - fan:'反', - zhong:'忠', - nei:'内', - cai:'猜', - } + fan: "反", + zhong: "忠", + nei: "内", + cai: "猜", + }; } } }, - getIdentityList2:function(list){ - for(var i in list){ - switch(i){ - case 'fan':list[i]='反贼';break; - case 'zhong':list[i]='忠臣';break; - case 'nei':list[i]='内奸';break; - case 'commoner':list[i]='平民'; break; - case 'zhu':list[i]='主公';break; - case 'enemy':list[i]='敌方';break; - case 'friend':list[i]='友方';break; - case 'cai':case 'cai2':list[i]='未知';break; - case 'rZhong':case 'bZhong':list[i]='前锋';break; - case 'rNei':case 'bNei':list[i]='细作';break; - case 'rYe':case 'bYe':list[i]='野心家';break; + getIdentityList2: function (list) { + for (var i in list) { + switch (i) { + case "fan": + list[i] = "反贼"; + break; + case "zhong": + list[i] = "忠臣"; + break; + case "nei": + list[i] = "内奸"; + break; + case "commoner": + list[i] = "平民"; + break; + case "zhu": + list[i] = "主公"; + break; + case "enemy": + list[i] = "敌方"; + break; + case "friend": + list[i] = "友方"; + break; + case "cai": + case "cai2": + list[i] = "未知"; + break; + case "rZhong": + case "bZhong": + list[i] = "前锋"; + break; + case "rNei": + case "bNei": + list[i] = "细作"; + break; + case "rYe": + case "bYe": + list[i] = "野心家"; + break; } } }, - getVideoName:function(){ - var str=get.translation(game.me.name); - if(game.me.name2){ - str+='/'+get.translation(game.me.name2); + getVideoName: function () { + var str = get.translation(game.me.name); + if (game.me.name2) { + str += "/" + get.translation(game.me.name2); } var str2; - if(game.identityVideoName) str2=game.identityVideoName; - else{ - switch(_status.mode){ - case 'purple':str2='3v3v2 - '+(game.me.identity.indexOf('r')==0?'暖色':'冷色')+lib.translate[game.me.identity+'2'];break; - case 'zhong':str2='忠胆英杰 - '+lib.translate[game.me.identity+'2'];break; - case 'stratagem':str2=get.cnNumber(get.playerNumber())+'人谋攻'+'-'+lib.translate[game.me.identity+'2'];break; - default:str2=get.cnNumber(get.playerNumber())+'人'+get.translation(lib.config.mode)+' - '+lib.translate[game.me.identity+'2'] + if (game.identityVideoName) str2 = game.identityVideoName; + else { + switch (_status.mode) { + case "purple": + str2 = + "3v3v2 - " + + (game.me.identity.indexOf("r") == 0 ? "暖色" : "冷色") + + lib.translate[game.me.identity + "2"]; + break; + case "zhong": + str2 = "忠胆英杰 - " + lib.translate[game.me.identity + "2"]; + break; + case "stratagem": + str2 = + get.cnNumber(get.playerNumber()) + + "人谋攻" + + "-" + + lib.translate[game.me.identity + "2"]; + break; + default: + str2 = + get.cnNumber(get.playerNumber()) + + "人" + + get.translation(lib.config.mode) + + " - " + + lib.translate[game.me.identity + "2"]; } } - var name=[ - str, - str2, - ]; + var name = [str, str2]; return name; }, - addRecord:function(bool){ - if(typeof bool=='boolean'){ - var data=lib.config.gameRecord.identity.data; - var identity=game.me.identity; - if(identity=='mingzhong'){ - identity='zhong'; + addRecord: function (bool) { + if (typeof bool == "boolean") { + var data = lib.config.gameRecord.identity.data; + var identity = game.me.identity; + if (identity == "mingzhong") { + identity = "zhong"; } - if(!data[identity]){ - data[identity]=[0,0]; + if (!data[identity]) { + data[identity] = [0, 0]; } - if(bool){ + if (bool) { data[identity][0]++; - } - else{ + } else { data[identity][1]++; } - var list=['zhu','zhong','nei','fan','commoner']; - var str=''; - for(var i=0;i'; + var list = ["zhu", "zhong", "nei", "fan", "commoner"]; + var str = ""; + for (var i = 0; i < list.length; i++) { + if (data[list[i]]) { + str += + lib.translate[list[i] + "2"] + + ":" + + data[list[i]][0] + + "胜" + + " " + + data[list[i]][1] + + "负
    "; } } - lib.config.gameRecord.identity.str=str; - game.saveConfig('gameRecord',lib.config.gameRecord); + lib.config.gameRecord.identity.str = str; + game.saveConfig("gameRecord", lib.config.gameRecord); } }, - showIdentity:function(me){ - for(var i=0;i0||loser.length==game.players.length){ - game.broadcastAll(function(winner,loser){ - _status.winner=winner; - _status.loser=loser; - },winner,loser); - if(loser.length==game.players.length){ + if (winner.length > 0 || loser.length == game.players.length) { + game.broadcastAll( + function (winner, loser) { + _status.winner = winner; + _status.loser = loser; + }, + winner, + loser + ); + if (loser.length == game.players.length) { game.showIdentity(); - game.over('游戏平局'); - } - else if(winner2.includes(me)){ + game.over("游戏平局"); + } else if (winner2.includes(me)) { game.showIdentity(); - if(loser2.includes(me)) game.over(false); + if (loser2.includes(me)) game.over(false); else game.over(true); - } - else{ + } else { game.showIdentity(); game.over(false); } } return; } - if(!game.zhu){ - if(get.population('fan')==0){ - switch(me.identity){ - case 'fan':game.over(false);break; - case 'zhong':game.over(true);break; - case 'commoner':game.over(true); break; - default:game.over();break; + if (!game.zhu) { + if (get.population("fan") == 0) { + switch (me.identity) { + case "fan": + game.over(false); + break; + case "zhong": + game.over(true); + break; + case "commoner": + game.over(true); + break; + default: + game.over(); + break; } - } - else if(get.population('zhong')==0){ - switch(me.identity){ - case 'fan':game.over(true);break; - case 'zhong':game.over(false);break; - case 'commoner':game.over(true); break; - default:game.over();break; + } else if (get.population("zhong") == 0) { + switch (me.identity) { + case "fan": + game.over(true); + break; + case "zhong": + game.over(false); + break; + case "commoner": + game.over(true); + break; + default: + game.over(); + break; } } return; } - if(game.zhu.isAlive()&&get.population('fan')+get.population('nei')>0) return; - if(game.zhong){ - game.zhong.identity='zhong'; + if (game.zhu.isAlive() && get.population("fan") + get.population("nei") > 0) return; + if (game.zhong) { + game.zhong.identity = "zhong"; } game.showIdentity(); - if(me.identity=='zhu'||me.identity=='zhong'||me.identity=='mingzhong'){ - if(game.zhu.classList.contains('dead')){ + if (me.identity == "zhu" || me.identity == "zhong" || me.identity == "mingzhong") { + if (game.zhu.classList.contains("dead")) { game.over(false); - } - else{ + } else { game.over(true); } - } - else if(me.identity=='nei'){ - if(game.players.length==(1+game.players.filter(i=>i.identity=='commoner').length)&&me.isAlive()){ + } else if (me.identity == "nei") { + if ( + game.players.length == + 1 + game.players.filter((i) => i.identity == "commoner").length && + me.isAlive() + ) { game.over(true); - } - else{ + } else { game.over(false); } - } - else if(me.identity=='fan'){ - if((get.population('fan')+get.population('zhong')>0||get.population('nei')>1)&& - game.zhu.classList.contains('dead')){ + } else if (me.identity == "fan") { + if ( + (get.population("fan") + get.population("zhong") > 0 || get.population("nei") > 1) && + game.zhu.classList.contains("dead") + ) { game.over(true); - } - else{ + } else { game.over(false); } - } - else if(me.identity=='commoner'){ + } else if (me.identity == "commoner") { game.over(true); } }, - checkOnlineResult:function(player){ - if(_status.winner&&_status.loser){ - if(_status.loser.length==game.players.length) return null; - if(_status.loser.includes(player)) return false; - if(_status.winner.includes(player)) return true; + checkOnlineResult: function (player) { + if (_status.winner && _status.loser) { + if (_status.loser.length == game.players.length) return null; + if (_status.loser.includes(player)) return false; + if (_status.winner.includes(player)) return true; } - if(game.zhu.isAlive()){ - return (player.identity=='zhu'||player.identity=='zhong'||player.identity=='mingzhong'||player.identity=='commoner'&&player.isAlive()); - } - else if(game.players.length==(1+game.players.filter(i=>i.identity=='commoner').length)&&game.players[0].identity=='nei'||game.players[0].identity=='commoner'){ + if (game.zhu.isAlive()) { + return ( + player.identity == "zhu" || + player.identity == "zhong" || + player.identity == "mingzhong" || + (player.identity == "commoner" && player.isAlive()) + ); + } else if ( + (game.players.length == 1 + game.players.filter((i) => i.identity == "commoner").length && + game.players[0].identity == "nei") || + game.players[0].identity == "commoner" + ) { return player.isAlive(); - } - else{ - return player.identity=='fan'||player.identity=='commoner'&&player.isAlive(); + } else { + return player.identity == "fan" || (player.identity == "commoner" && player.isAlive()); } }, - chooseCharacterPurpleOL:function(){ - var next=game.createEvent('chooseCharacter'); - next.setContent(function(){ - "step 0" - ui.arena.classList.add('choose-character'); - "step 1" - var list=['rZhu','rZhong','rNei','rYe']; - var list2=['bZhu','bZhong','bNei','bYe']; + chooseCharacterPurpleOL: function () { + var next = game.createEvent("chooseCharacter"); + next.setContent(function () { + "step 0"; + ui.arena.classList.add("choose-character"); + "step 1"; + var list = ["rZhu", "rZhong", "rNei", "rYe"]; + var list2 = ["bZhu", "bZhong", "bNei", "bYe"]; list.randomSort(); list2.randomSort(); - var identityList=list.concat(list2); - var num=get.rand(0,7); - var players=game.players.slice(0); - for(var i=0;i15?5:3; + } else event.mapNum[i] = map[i].length > 15 ? 5 : 3; } - list.sort(function(a,b){ - return lib.group.indexOf(a)-lib.group.indexOf(b); + list.sort(function (a, b) { + return lib.group.indexOf(a) - lib.group.indexOf(b); }); - event.list=list; - event.map=map; - event.map_zhu=map_zhu; - game.bZhu.chooseControl(list).set('prompt','请选择冷方武将势力').set('ai',function(){ - return _status.event.choice; - }).set('choice',event.list.randomGet()); - "step 3" - event.bZhu=result.control; + event.list = list; + event.map = map; + event.map_zhu = map_zhu; + game.bZhu + .chooseControl(list) + .set("prompt", "请选择冷方武将势力") + .set("ai", function () { + return _status.event.choice; + }) + .set("choice", event.list.randomGet()); + "step 3"; + event.bZhu = result.control; event.list.remove(event.bZhu); - game.rZhu.chooseControl(event.list).set('prompt','请选择暖方武将的势力').set('ai',function(){ - return _status.event.choice; - }).set('choice',event.list.randomGet()); - "step 4" - event.rZhu=result.control; - var players=[game.rZhu,game.bZhu]; - var list=[]; - for(var i=0;i5){ - num=5; + var num, + num2 = 0; + num = Math.floor(event.list.length / (game.players.length - 1)); + if (num > 5) { + num = 5; } - num2=event.list.length-num*(game.players.length-1); - if(lib.configOL.double_nei){ - num2=Math.floor(num2/2); + num2 = event.list.length - num * (game.players.length - 1); + if (lib.configOL.double_nei) { + num2 = Math.floor(num2 / 2); } - if(num2>2){ - num2=2; + if (num2 > 2) { + num2 = 2; } - for(var i=0;igame.addGlobalSkill(globalSkill)); - game.players.forEach(current=>{ - current.storage.zhibi=[]; - current.storage.stratagem_expose=[]; - current.markSkill('stratagem_fury'); + ["stratagem_gain", "stratagem_insight", "stratagem_expose"].forEach((globalSkill) => + game.addGlobalSkill(globalSkill) + ); + game.players.forEach((current) => { + current.storage.zhibi = []; + current.storage.stratagem_expose = []; + current.markSkill("stratagem_fury"); }); - setTimeout(function(){ - ui.arena.classList.remove('choose-character'); - },500); + setTimeout(function () { + ui.arena.classList.remove("choose-character"); + }, 500); }); }, - chooseCharacter:function(){ - if(_status.mode=='purple'){ + chooseCharacter: function () { + if (_status.mode == "purple") { game.chooseCharacterPurple(); return; } - var next=game.createEvent('chooseCharacter'); - next.showConfig=true; - next.addPlayer=function(player){ - var list=get.identityList(game.players.length-1); - var list2=get.identityList(game.players.length); - for(var i=0;i4){ - if(!player.isInitFilter('noZhuHp')){ + if (game.players.length > 4) { + if (!player.isInitFilter("noZhuHp")) { player.hp++; player.maxHp++; player.update(); } } - } - else if(player.identity=='zhong'&&(Math.random()<0.5||['sunliang','key_akane'].includes(game.zhu.name))&&!stratagemMode){ - var listc=list.slice(0); - for(var i=0;i'; - td.addEventListener(lib.config.touchscreen?'touchend':'click',function(){ - if(_status.dragged) return; - if(_status.justdragged) return; - _status.tempNoButton=true; - setTimeout(function(){ - _status.tempNoButton=false; - },500); - var link=this.link; - if(game.zhu){ - if(link!='random'){ - _status.event.parent.fixedseat=get.distance(game.me,game.zhu,'absolute'); + td.innerHTML = "" + get.translation(listi[i] + "2") + ""; + td.addEventListener(lib.config.touchscreen ? "touchend" : "click", function () { + if (_status.dragged) return; + if (_status.justdragged) return; + _status.tempNoButton = true; + setTimeout(function () { + _status.tempNoButton = false; + }, 500); + var link = this.link; + if (game.zhu) { + if (link != "random") { + _status.event.parent.fixedseat = get.distance( + game.me, + game.zhu, + "absolute" + ); } - if(game.zhu.name) game.zhu.uninit(); + if (game.zhu.name) game.zhu.uninit(); delete game.zhu.isZhu; delete game.zhu.identityShown; } - var current=this.parentNode.querySelector('.bluebg'); - if(current){ - current.classList.remove('bluebg'); + var current = this.parentNode.querySelector(".bluebg"); + if (current) { + current.classList.remove("bluebg"); } - current=_status.cheat_seat||seats.querySelector('.bluebg'); - if(current){ - current.classList.remove('bluebg'); + current = _status.cheat_seat || seats.querySelector(".bluebg"); + if (current) { + current.classList.remove("bluebg"); } - if(link=='random'){ - if(event.zhongmode){ - link=['zhu','zhong','nei','fan','mingzhong'].randomGet(); + if (link == "random") { + if (event.zhongmode) { + link = ["zhu", "zhong", "nei", "fan", "mingzhong"].randomGet(); + } else { + var listi = ["zhu", "zhong", "nei", "fan"]; + if (get.config("enable_commoner") && !event.stratagemMode) + listi.push("commoner"); + link = listi.randomGet(); } - else{ - var listi=['zhu','zhong','nei','fan']; - if(get.config('enable_commoner')&&!event.stratagemMode) listi.push('commoner'); - link=listi.randomGet(); - } - for(var i=0;i=1){ - fans.randomRemove().special_identity='identity_zeishou'; - event.special_identity.push('identity_zeishou'); + if (fans.length >= 1) { + fans.randomRemove().special_identity = "identity_zeishou"; + event.special_identity.push("identity_zeishou"); } - if(zhongs.length>1){ - zhongs.randomRemove().special_identity='identity_dajiang'; - zhongs.randomRemove().special_identity='identity_junshi'; - event.special_identity.push('identity_dajiang'); - event.special_identity.push('identity_junshi'); - } - else if(zhongs.length==1){ - if(Math.random()<0.5){ - zhongs.randomRemove().special_identity='identity_dajiang'; - event.special_identity.push('identity_dajiang'); - } - else{ - zhongs.randomRemove().special_identity='identity_junshi'; - event.special_identity.push('identity_junshi'); + if (zhongs.length > 1) { + zhongs.randomRemove().special_identity = "identity_dajiang"; + zhongs.randomRemove().special_identity = "identity_junshi"; + event.special_identity.push("identity_dajiang"); + event.special_identity.push("identity_junshi"); + } else if (zhongs.length == 1) { + if (Math.random() < 0.5) { + zhongs.randomRemove().special_identity = "identity_dajiang"; + event.special_identity.push("identity_dajiang"); + } else { + zhongs.randomRemove().special_identity = "identity_junshi"; + event.special_identity.push("identity_junshi"); } } } - if(!game.zhu) game.zhu=game.me; - else{ - if(!stratagemMode){ + if (!game.zhu) game.zhu = game.me; + else { + if (!stratagemMode) { game.zhu.setIdentity(); - game.zhu.identityShown=true; - game.zhu.node.identity.classList.remove('guessing'); + game.zhu.identityShown = true; + game.zhu.node.identity.classList.remove("guessing"); } - game.zhu.isZhu=(game.zhu.identity=='zhu'); + game.zhu.isZhu = game.zhu.identity == "zhu"; game.me.setIdentity(); - game.me.node.identity.classList.remove('guessing'); + game.me.node.identity.classList.remove("guessing"); } //选将框分配 - for(i in lib.characterReplace){ - var ix=lib.characterReplace[i]; - for(var j=0;j4){ - if(!game.me.isInitFilter('noZhuHp')){ + if (!event.stratagemMode && game.me == game.zhu && game.players.length > 4) { + if (!game.me.isInitFilter("noZhuHp")) { game.me.hp++; game.me.maxHp++; game.me.update(); } } - for(var i=0;igame.addGlobalSkill(globalSkill)); - game.players.forEach(i=>{ - i.storage.zhibi=[]; - i.storage.stratagem_expose=[]; - i.markSkill('stratagem_fury'); + "step 4"; + if (event.stratagemMode) { + ["stratagem_gain", "stratagem_insight", "stratagem_expose"].forEach((globalSkill) => + game.addGlobalSkill(globalSkill) + ); + game.players.forEach((i) => { + i.storage.zhibi = []; + i.storage.stratagem_expose = []; + i.markSkill("stratagem_fury"); }); } - setTimeout(function(){ - ui.arena.classList.remove('choose-character'); - },500); + setTimeout(function () { + ui.arena.classList.remove("choose-character"); + }, 500); - if(event.special_identity){ - for(var i=0;i=1){ - map.identity_zeishou=fans.randomRemove(); + if (fans.length >= 1) { + map.identity_zeishou = fans.randomRemove(); } - if(zhongs.length>1){ - map.identity_dajiang=zhongs.randomRemove(); - map.identity_junshi=zhongs.randomRemove(); - } - else if(zhongs.length==1){ - if(Math.random()<0.5){ - map.identity_dajiang=zhongs.randomRemove(); - } - else{ - map.identity_junshi=zhongs.randomRemove(); + if (zhongs.length > 1) { + map.identity_dajiang = zhongs.randomRemove(); + map.identity_junshi = zhongs.randomRemove(); + } else if (zhongs.length == 1) { + if (Math.random() < 0.5) { + map.identity_dajiang = zhongs.randomRemove(); + } else { + map.identity_junshi = zhongs.randomRemove(); } } - game.broadcastAll(function(zhu,map){ - for(var i in map){ - map[i].special_identity=i; - } - },game.zhu,map); - event.special_identity=map; + game.broadcastAll( + function (zhu, map) { + for (var i in map) { + map[i].special_identity = i; + } + }, + game.zhu, + map + ); + event.special_identity = map; } game.zhu.setIdentity(); - game.zhu.identityShown=true; - game.zhu.isZhu=(game.zhu.identity=='zhu'); - game.zhu.node.identity.classList.remove('guessing'); + game.zhu.identityShown = true; + game.zhu.isZhu = game.zhu.identity == "zhu"; + game.zhu.node.identity.classList.remove("guessing"); game.me.setIdentity(); - game.me.node.identity.classList.remove('guessing'); - if(game.me.special_identity){ - game.me.node.identity.firstChild.innerHTML=get.translation(game.me.special_identity+'_bg'); + game.me.node.identity.classList.remove("guessing"); + if (game.me.special_identity) { + game.me.node.identity.firstChild.innerHTML = get.translation( + game.me.special_identity + "_bg" + ); } - for(var i=0;i4){ - if(!game.zhu.isInitFilter('noZhuHp')){ + if (game.players.length > 4) { + if (!game.zhu.isInitFilter("noZhuHp")) { game.zhu.maxHp++; game.zhu.hp++; game.zhu.update(); } } - game.broadcast(function(zhu,name,name2,addMaxHp){ - if(!zhu.name){ - zhu.init(name,name2); - } - if(addMaxHp){ - if(!zhu.isInitFilter('noZhuHp')){ - zhu.maxHp++; - zhu.hp++; - zhu.update(); + game.broadcast( + function (zhu, name, name2, addMaxHp) { + if (!zhu.name) { + zhu.init(name, name2); } - } - },game.zhu,result.links[0],result.links[1],game.players.length>4); + if (addMaxHp) { + if (!zhu.isInitFilter("noZhuHp")) { + zhu.maxHp++; + zhu.hp++; + zhu.update(); + } + } + }, + game.zhu, + result.links[0], + result.links[1], + game.players.length > 4 + ); - if(game.zhu.group=='shen'&&!game.zhu.isUnseen(0)){ - var list=['wei','shu','wu','qun','jin','key']; - for(var i=0;i5){ - num=5; + var num, + num2 = 0; + if (event.zhongmode) { + num = 6; + } else { + num = Math.floor(event.list.length / (game.players.length - 1)); + if (num > 5) { + num = 5; } - num2=event.list.length-num*(game.players.length-1); - if(lib.configOL.double_nei){ - num2=Math.floor(num2/2); + num2 = event.list.length - num * (game.players.length - 1); + if (lib.configOL.double_nei) { + num2 = Math.floor(num2 / 2); } - if(num2>2){ - num2=2; + if (num2 > 2) { + num2 = 2; } } - for(var i=0;i0.95){ - this.ai.shown=0.95; + addExpose: function (num) { + if (!game.zhu || !game.zhu.isZhu || !game.zhu.identityShown) return; + if (typeof this.ai.shown == "number" && !this.identityShown && this.ai.shown < 1) { + this.ai.shown += num; + if (this.ai.shown > 0.95) { + this.ai.shown = 0.95; } } return this; }, - yexinbilu:function(){ - game.broadcastAll(function(player){ + yexinbilu: function () { + game.broadcastAll(function (player) { player.showIdentity(); - },this); + }, this); this.gainMaxHp(); this.recover(); }, - $dieAfter:function(){ - if(_status.video) return; - if(!this.node.dieidentity){ + $dieAfter: function () { + if (_status.video) return; + if (!this.node.dieidentity) { var str; - if(this.special_identity){ - str=get.translation(this.special_identity); + if (this.special_identity) { + str = get.translation(this.special_identity); + } else { + str = get.translation(this.identity + "2"); } - else{ - str=get.translation(this.identity+'2'); - } - var node=ui.create.div('.damage.dieidentity',str,this); - if(str=='野心家'){ - node.style.fontSize='40px'; + var node = ui.create.div(".damage.dieidentity", str, this); + if (str == "野心家") { + node.style.fontSize = "40px"; } ui.refresh(node); - node.style.opacity=1; - this.node.dieidentity=node; + node.style.opacity = 1; + this.node.dieidentity = node; } - var trans=this.style.transform; - if(trans){ - if(trans.indexOf('rotateY')!=-1){ - this.node.dieidentity.style.transform='rotateY(180deg)'; + var trans = this.style.transform; + if (trans) { + if (trans.indexOf("rotateY") != -1) { + this.node.dieidentity.style.transform = "rotateY(180deg)"; + } else if (trans.indexOf("rotateX") != -1) { + this.node.dieidentity.style.transform = "rotateX(180deg)"; + } else { + this.node.dieidentity.style.transform = ""; } - else if(trans.indexOf('rotateX')!=-1){ - this.node.dieidentity.style.transform='rotateX(180deg)'; - } - else{ - this.node.dieidentity.style.transform=''; - } - } - else{ - this.node.dieidentity.style.transform=''; + } else { + this.node.dieidentity.style.transform = ""; } }, - dieAfter2:function(source){ - if(_status.mode=='stratagem') return; - if(_status.mode=='purple'){ - if(source){ - if(this.identity=='rZhu'||this.identity=='bZhu'){ - if(this.identity.slice(0,1)!=source.identity.slice(0,1)) source.recover(); - } - else if(this.identity=='rZhong'||this.identity=='bZhong'){ - if(this.identity.slice(0,1)!=source.identity.slice(0,1)) source.draw(2); - else if(source.identity.indexOf('Zhu')==1) source.discard(source.getCards('h')); - } - else if(this.identity=='rNei'||this.identity=='bNei'){ - if(this.identity.slice(0,1)==source.identity.slice(0,1)) source.draw(3); + dieAfter2: function (source) { + if (_status.mode == "stratagem") return; + if (_status.mode == "purple") { + if (source) { + if (this.identity == "rZhu" || this.identity == "bZhu") { + if (this.identity.slice(0, 1) != source.identity.slice(0, 1)) + source.recover(); + } else if (this.identity == "rZhong" || this.identity == "bZhong") { + if (this.identity.slice(0, 1) != source.identity.slice(0, 1)) source.draw(2); + else if (source.identity.indexOf("Zhu") == 1) + source.discard(source.getCards("h")); + } else if (this.identity == "rNei" || this.identity == "bNei") { + if (this.identity.slice(0, 1) == source.identity.slice(0, 1)) source.draw(3); } } - if(!_status.yeconfirm){ - _status.yeconfirm=true; - game.addGlobalSkill('yexinbilu'); - game.broadcastAll(function(){ - if(game.me.identity=='rYe'||game.me.identity=='bYe'){ - var player=game.findPlayer(function(current){ - return current!=game.me&&(current.identity=='bYe'||current.identity=='rYe'); + if (!_status.yeconfirm) { + _status.yeconfirm = true; + game.addGlobalSkill("yexinbilu"); + game.broadcastAll(function () { + if (game.me.identity == "rYe" || game.me.identity == "bYe") { + var player = game.findPlayer(function (current) { + return ( + current != game.me && + (current.identity == "bYe" || current.identity == "rYe") + ); }); - if(player){ + if (player) { player.showIdentity(); } } }); } } - if(this.identity=='fan'&&source) source.draw(3); - else if(this.identity=='commoner'&&source) source.draw(2); - else if(this.identity=='mingzhong'&&source){ - if(source.identity=='zhu'){ - source.discard(source.getCards('he')); - } - else{ + if (this.identity == "fan" && source) source.draw(3); + else if (this.identity == "commoner" && source) source.draw(2); + else if (this.identity == "mingzhong" && source) { + if (source.identity == "zhu") { + source.discard(source.getCards("he")); + } else { source.draw(3); } - } - else if(this.identity=='zhong'&&source&&source.identity=='zhu'&&source.isZhu){ - source.discard(source.getCards('he')); + } else if ( + this.identity == "zhong" && + source && + source.identity == "zhu" && + source.isZhu + ) { + source.discard(source.getCards("he")); } }, - dieAfter:function(source){ - if(!this.identityShown){ - game.broadcastAll(function(player,identity,identity2){ - player.setIdentity(player.identity); - player.identityShown=true; - player.node.identity.classList.remove('guessing'); - if(identity){ - player.node.identity.firstChild.innerHTML=get.translation(identity+'_bg'); - game.log(player,'的身份是','#g'+get.translation(identity)); - } - else{ - game.log(player,'的身份是','#g'+get.translation(identity2+'2')); - } - },this,this.special_identity,this.identity); + dieAfter: function (source) { + if (!this.identityShown) { + game.broadcastAll( + function (player, identity, identity2) { + player.setIdentity(player.identity); + player.identityShown = true; + player.node.identity.classList.remove("guessing"); + if (identity) { + player.node.identity.firstChild.innerHTML = get.translation( + identity + "_bg" + ); + game.log(player, "的身份是", "#g" + get.translation(identity)); + } else { + game.log(player, "的身份是", "#g" + get.translation(identity2 + "2")); + } + }, + this, + this.special_identity, + this.identity + ); } - if(this.special_identity){ - game.broadcastAll(function(zhu,identity){ - zhu.removeSkill(identity); - },game.zhu,this.special_identity); + if (this.special_identity) { + game.broadcastAll( + function (zhu, identity) { + zhu.removeSkill(identity); + }, + game.zhu, + this.special_identity + ); } game.checkResult(); - if(_status.mode=='purple'){ - var red=[]; - var blue=[]; - game.countPlayer(function(current){ - var identity=current.identity.slice(1); - if(identity!='Zhu'){ - if(current.identity.indexOf('r')==0) red.push(current); + if (_status.mode == "purple") { + var red = []; + var blue = []; + game.countPlayer(function (current) { + var identity = current.identity.slice(1); + if (identity != "Zhu") { + if (current.identity.indexOf("r") == 0) red.push(current); else blue.push(current); } }); - if(red.length<=1&&blue.length<=1) game.broadcastAll(game.showIdentity); + if (red.length <= 1 && blue.length <= 1) game.broadcastAll(game.showIdentity); return; } - if(game.zhu&&game.zhu.isZhu){ - if((get.population('zhong')+get.population('nei')==0|| - get.population('zhong')+get.population('fan')==0)&&get.population('commoner')==0){ - game.broadcastAll(function(){ - if(game.showIdentity) game.showIdentity(); - if(game.zhu&&game.zhu.isAlive()&&get.population('nei')==1&&get.config('nei_fullscreenpop')) game.me.$fullscreenpop('主公 vs 内奸',null,null,false); + if (game.zhu && game.zhu.isZhu) { + if ( + (get.population("zhong") + get.population("nei") == 0 || + get.population("zhong") + get.population("fan") == 0) && + get.population("commoner") == 0 + ) { + game.broadcastAll(function () { + if (game.showIdentity) game.showIdentity(); + if ( + game.zhu && + game.zhu.isAlive() && + get.population("nei") == 1 && + get.config("nei_fullscreenpop") + ) + game.me.$fullscreenpop( + '主公 vs 内奸', + null, + null, + false + ); }); } } - if(game.zhu&&game.zhu.storage.enhance_zhu&&get.population('fan')<3){ + if (game.zhu && game.zhu.storage.enhance_zhu && get.population("fan") < 3) { game.zhu.removeSkill(game.zhu.storage.enhance_zhu); delete game.zhu.storage.enhance_zhu; } - if(this==game.zhong){ - game.broadcastAll(function(player){ - game.zhu=player; - game.zhu.identityShown=true; - game.zhu.ai.shown=1; + if (this == game.zhong) { + game.broadcastAll(function (player) { + game.zhu = player; + game.zhu.identityShown = true; + game.zhu.ai.shown = 1; game.zhu.setIdentity(); - game.zhu.isZhu=true; - var skills=player.getStockSkills(true,true).filter(skill=>{ - if(player.hasSkill(skill)) return false; - var info=get.info(skill); - return info&&info.zhuSkill; + game.zhu.isZhu = true; + var skills = player.getStockSkills(true, true).filter((skill) => { + if (player.hasSkill(skill)) return false; + var info = get.info(skill); + return info && info.zhuSkill; }); - if(skills.length){ + if (skills.length) { player.addSkills(skills); } - game.zhu.node.identity.classList.remove('guessing'); - if(lib.config.animation&&!lib.config.low_performance) game.zhu.$legend(); + game.zhu.node.identity.classList.remove("guessing"); + if (lib.config.animation && !lib.config.low_performance) game.zhu.$legend(); delete game.zhong; - if(_status.clickingidentity&&_status.clickingidentity[0]==game.zhu){ - for(var i=0;i<_status.clickingidentity[1].length;i++){ + if (_status.clickingidentity && _status.clickingidentity[0] == game.zhu) { + for (var i = 0; i < _status.clickingidentity[1].length; i++) { _status.clickingidentity[1][i].delete(); - _status.clickingidentity[1][i].style.transform=''; + _status.clickingidentity[1][i].style.transform = ""; } delete _status.clickingidentity; } - },game.zhu); + }, game.zhu); game.delay(2); game.zhu.playerfocus(1000); } - if(!_status.over){ + if (!_status.over) { var giveup; - if(get.population('fan')+get.population('nei')==1){ - for(var i=0;i0){ - for(var i=0;i 0) { + for (var i = 0; i < targets.length; i++) { + shown = Math.abs(targets[i].ai.shown); + if (shown < 0.2 || targets[i].identity == "nei") c = 0; + else if (shown < 0.4) c = 0.5; + else if (shown < 0.6) c = 0.8; + else c = 1; + var eff = get.effect(targets[i], card, this); + effect += eff * c; + if ( + eff == 0 && + shown == 0 && + ["zhong", "rZhong", "bZhong"].includes(this.identity) && + targets[i] != this + ) { + effect += 0.1; } } } - if(effect>0){ - if(effect<1) c=0.5; - else c=1; - if(targets.length==1&&targets[0]==this); - else if(targets.length==1) this.ai.shown+=0.2*c; - else this.ai.shown+=0.1*c; - } - else if(effect<0&&this==game.me&&['nei','commoner','rYe','bYe'].includes(game.me.identity)){ - if(targets.length==1&&targets[0]==this); - else if(targets.length==1) this.ai.shown-=0.2; - else this.ai.shown-=0.1; + if (effect > 0) { + if (effect < 1) c = 0.5; + else c = 1; + if (targets.length == 1 && targets[0] == this); + else if (targets.length == 1) this.ai.shown += 0.2 * c; + else this.ai.shown += 0.1 * c; + } else if ( + effect < 0 && + this == game.me && + ["nei", "commoner", "rYe", "bYe"].includes(game.me.identity) + ) { + if (targets.length == 1 && targets[0] == this); + else if (targets.length == 1) this.ai.shown -= 0.2; + else this.ai.shown -= 0.1; } } - if(!stratagemMode&&this!=game.me) this.ai.shown*=2; - if(this.ai.shown>0.95) this.ai.shown=0.95; - if(this.ai.shown<-0.5) this.ai.shown=-0.5; - if(_status.mode=='purple') return; - if(stratagemMode) return; + if (!stratagemMode && this != game.me) this.ai.shown *= 2; + if (this.ai.shown > 0.95) this.ai.shown = 0.95; + if (this.ai.shown < -0.5) this.ai.shown = -0.5; + if (_status.mode == "purple") return; + if (stratagemMode) return; - var marknow=(!_status.connectMode&&this!=game.me&&get.config('auto_mark_identity')&&this.ai.identity_mark!='finished'); + var marknow = + !_status.connectMode && + this != game.me && + get.config("auto_mark_identity") && + this.ai.identity_mark != "finished"; // if(true){ - if(marknow&&_status.clickingidentity&&_status.clickingidentity[0]==this){ - for(var i=0;i<_status.clickingidentity[1].length;i++){ - _status.clickingidentity[1][i].delete(); - _status.clickingidentity[1][i].style.transform=''; - } - delete _status.clickingidentity; - } - if(!Array.isArray(targets)){ - targets=[]; - } - var effect=0,c,shown; - var zhu=game.zhu; - if(_status.mode=='zhong'&&!game.zhu.isZhu){ - zhu=game.zhong; - } - if(targets.length==1&&targets[0]==this){ - effect=0; - } - else if(this.identity!='nei'&&this.identity!='commoner'){ - if(this.ai.shown>0){ - if(this.identity=='fan'){ - effect=-1; - } - else{ - effect=1; - } - } - } - else if(targets.length>0){ - for(var i=0;i0){ - if(this.ai.identity_mark=='fan'){ - if(marknow) this.setIdentity(); - this.ai.identity_mark='finished'; - } - else{ - if(marknow) this.setIdentity('zhong'); - this.ai.identity_mark='zhong'; - } - } - else if(effect<0&&get.population('fan')>0){ - if(this.ai.identity_mark=='zhong'){ - if(marknow) this.setIdentity(); - this.ai.identity_mark='finished'; - } - else{ - if(marknow) this.setIdentity('fan'); - this.ai.identity_mark='fan'; - } - } - } - else if(marknow){ - if(effect>0&&this.identity!='fan'){ - this.setIdentity('zhong'); - this.ai.identity_mark='finished'; - } - else if(effect<0&&this.identity=='fan'){ - this.setIdentity('fan'); - this.ai.identity_mark='finished'; - } - } - // } - }, - showIdentity:function(){ - this.node.identity.classList.remove('guessing'); - this.identityShown=true; - this.ai.shown=1; - this.setIdentity(); - if(this.special_identity){ - this.node.identity.firstChild.innerHTML=get.translation(this.special_identity+'_bg'); - } - if(this.identity=='zhu'){ - this.isZhu=true; - } - else{ - delete this.isZhu; - } - if(_status.clickingidentity){ - for(var i=0;i<_status.clickingidentity[1].length;i++){ + if (marknow && _status.clickingidentity && _status.clickingidentity[0] == this) { + for (var i = 0; i < _status.clickingidentity[1].length; i++) { _status.clickingidentity[1][i].delete(); - _status.clickingidentity[1][i].style.transform=''; + _status.clickingidentity[1][i].style.transform = ""; } delete _status.clickingidentity; } - } + if (!Array.isArray(targets)) { + targets = []; + } + var effect = 0, + c, + shown; + var zhu = game.zhu; + if (_status.mode == "zhong" && !game.zhu.isZhu) { + zhu = game.zhong; + } + if (targets.length == 1 && targets[0] == this) { + effect = 0; + } else if (this.identity != "nei" && this.identity != "commoner") { + if (this.ai.shown > 0) { + if (this.identity == "fan") { + effect = -1; + } else { + effect = 1; + } + } + } else if (targets.length > 0) { + for (var i = 0; i < targets.length; i++) { + shown = Math.abs(targets[i].ai.shown); + if (shown < 0.2 || targets[i].identity == "nei") c = 0; + else if (shown < 0.4) c = 0.5; + else if (shown < 0.6) c = 0.8; + else c = 1; + effect += get.effect(targets[i], card, this, zhu) * c; + } + } + if (this.identity == "nei" || this.identity == "commoner") { + if (effect > 0) { + if (this.ai.identity_mark == "fan") { + if (marknow) this.setIdentity(); + this.ai.identity_mark = "finished"; + } else { + if (marknow) this.setIdentity("zhong"); + this.ai.identity_mark = "zhong"; + } + } else if (effect < 0 && get.population("fan") > 0) { + if (this.ai.identity_mark == "zhong") { + if (marknow) this.setIdentity(); + this.ai.identity_mark = "finished"; + } else { + if (marknow) this.setIdentity("fan"); + this.ai.identity_mark = "fan"; + } + } + } else if (marknow) { + if (effect > 0 && this.identity != "fan") { + this.setIdentity("zhong"); + this.ai.identity_mark = "finished"; + } else if (effect < 0 && this.identity == "fan") { + this.setIdentity("fan"); + this.ai.identity_mark = "finished"; + } + } + // } + }, + showIdentity: function () { + this.node.identity.classList.remove("guessing"); + this.identityShown = true; + this.ai.shown = 1; + this.setIdentity(); + if (this.special_identity) { + this.node.identity.firstChild.innerHTML = get.translation( + this.special_identity + "_bg" + ); + } + if (this.identity == "zhu") { + this.isZhu = true; + } else { + delete this.isZhu; + } + if (_status.clickingidentity) { + for (var i = 0; i < _status.clickingidentity[1].length; i++) { + _status.clickingidentity[1][i].delete(); + _status.clickingidentity[1][i].style.transform = ""; + } + delete _status.clickingidentity; + } + }, }, - content:{ - stratagemInsight:event=>{ - 'step 0' - game.log(player,'洞察了',target,'与其的阵营关系'); - 'step 1' - var storage=player.storage; - if(!storage.zhibi) storage.zhibi=[]; - var zhibi=storage.zhibi; - if(!zhibi.includes(target)) zhibi.push(target); - var insightResult=event.insightResult=get.insightResult(player,target); - event.videoId=lib.status.videoId++; - var send=(clientTarget,clientInsightResult,id)=>{ - var classList=clientTarget.classList,nonStratagemInsightFlashing=classList.contains('flash-animation-iteration-count-infinite'); - if(nonStratagemInsightFlashing) clientTarget.nonStratagemInsightFlashing=true; - else classList.add('flash-animation-iteration-count-infinite'); - var identity=get.translation(`${clientInsightResult}2`); - clientTarget.prompt(identity,clientInsightResult); - var dialog=ui.create.dialog(`${get.translation(clientTarget)}是${identity}
    `,'forcebutton'); - ui.create.spinningIdentityCard(clientInsightResult,dialog); - var control=ui.create.control('ok',()=>{ + content: { + stratagemInsight: (event) => { + "step 0"; + game.log(player, "洞察了", target, "与其的阵营关系"); + "step 1"; + var storage = player.storage; + if (!storage.zhibi) storage.zhibi = []; + var zhibi = storage.zhibi; + if (!zhibi.includes(target)) zhibi.push(target); + var insightResult = (event.insightResult = get.insightResult(player, target)); + event.videoId = lib.status.videoId++; + var send = (clientTarget, clientInsightResult, id) => { + var classList = clientTarget.classList, + nonStratagemInsightFlashing = classList.contains( + "flash-animation-iteration-count-infinite" + ); + if (nonStratagemInsightFlashing) clientTarget.nonStratagemInsightFlashing = true; + else classList.add("flash-animation-iteration-count-infinite"); + var identity = get.translation(`${clientInsightResult}2`); + clientTarget.prompt(identity, clientInsightResult); + var dialog = ui.create.dialog( + `${get.translation(clientTarget)}是${identity}
    `, + "forcebutton" + ); + ui.create.spinningIdentityCard(clientInsightResult, dialog); + var control = ui.create.control("ok", () => { dialog.close(); control.close(); - _status.imchoosing=false; - _status.event._result={ - bool:true + _status.imchoosing = false; + _status.event._result = { + bool: true, }; game.resume(); }); - dialog.videoId=id; + dialog.videoId = id; game.pause(); game.countChoose(); }; - game.broadcastAll((clientPlayer,clientTarget,id)=>{ - if(clientPlayer!=game.me) ui.create.dialog(`${get.translation(clientPlayer)}正在洞察${get.translation(clientTarget)}的阵营...
    `).videoId=id; - },player,target,event.videoId); - if(event.isMine()) send(target,insightResult,event.videoId); - else if(event.isOnline()){ - player.send(send,target,insightResult,event.videoId); + game.broadcastAll( + (clientPlayer, clientTarget, id) => { + if (clientPlayer != game.me) + ui.create.dialog( + `${get.translation(clientPlayer)}正在洞察${get.translation( + clientTarget + )}的阵营...
    ` + ).videoId = id; + }, + player, + target, + event.videoId + ); + if (event.isMine()) send(target, insightResult, event.videoId); + else if (event.isOnline()) { + player.send(send, target, insightResult, event.videoId); player.wait(); game.pause(); } - 'step 2' - game.broadcastAll('closeDialog',event.videoId); - if(!_status.connectMode&&get.config('auto_mark_identity')&&!target.node.identity.firstChild.innerHTML.length) game.broadcastAll((clientPlayer,clientTarget,insightResult)=>{ - if(clientPlayer.isUnderControl(true)) clientTarget.setIdentity(insightResult); - },player,target,event.insightResult); - var afterInsight=clientTarget=>{ + "step 2"; + game.broadcastAll("closeDialog", event.videoId); + if ( + !_status.connectMode && + get.config("auto_mark_identity") && + !target.node.identity.firstChild.innerHTML.length + ) + game.broadcastAll( + (clientPlayer, clientTarget, insightResult) => { + if (clientPlayer.isUnderControl(true)) + clientTarget.setIdentity(insightResult); + }, + player, + target, + event.insightResult + ); + var afterInsight = (clientTarget) => { clientTarget.unprompt(); - if(clientTarget.nonStratagemInsightFlashing){ + if (clientTarget.nonStratagemInsightFlashing) { delete clientTarget.nonStratagemInsightFlashing; return; } - var classList=clientTarget.classList; - if(classList.contains('flash-animation-iteration-count-infinite')) classList.remove('flash-animation-iteration-count-infinite'); + var classList = clientTarget.classList; + if (classList.contains("flash-animation-iteration-count-infinite")) + classList.remove("flash-animation-iteration-count-infinite"); }; - if(event.isMine()) afterInsight(target); - else if(event.isOnline()) player.send(afterInsight,target); + if (event.isMine()) afterInsight(target); + else if (event.isOnline()) player.send(afterInsight, target); }, - stratagemCamouflage:()=>{ - 'step 0' - var camouflaged=event.targets=game.players.filter(current=>current.identity=='fan'&&!current.ai.stratagemCamouflage).randomGets(Math.max(Math.round(get.population()/6),1)); - camouflaged.forEach(current=>current.ai.stratagemCamouflage=true); - var me=game.me; - if(event.players.includes(me)&&me.identity=='nei'){ - event.videoId=lib.status.videoId++; - var rebel=get.translation('fan2'),dialog=ui.create.dialog(`${get.translation(camouflaged)}是${rebel}
    `,'forcebutton'); - ui.create.spinningIdentityCard('fan',dialog); - dialog.videoId=event.videoId; - camouflaged.forEach(victim=>{ - var classList=victim.classList,nonCamouflageFlashing=classList.contains('flash-animation-iteration-count-infinite'); - if(nonCamouflageFlashing) victim.nonCamouflageFlashing=true; - else classList.add('flash-animation-iteration-count-infinite'); - victim.prompt(rebel,'fan'); + stratagemCamouflage: () => { + "step 0"; + var camouflaged = (event.targets = game.players + .filter((current) => current.identity == "fan" && !current.ai.stratagemCamouflage) + .randomGets(Math.max(Math.round(get.population() / 6), 1))); + camouflaged.forEach((current) => (current.ai.stratagemCamouflage = true)); + var me = game.me; + if (event.players.includes(me) && me.identity == "nei") { + event.videoId = lib.status.videoId++; + var rebel = get.translation("fan2"), + dialog = ui.create.dialog( + `${get.translation(camouflaged)}是${rebel}
    `, + "forcebutton" + ); + ui.create.spinningIdentityCard("fan", dialog); + dialog.videoId = event.videoId; + camouflaged.forEach((victim) => { + var classList = victim.classList, + nonCamouflageFlashing = classList.contains( + "flash-animation-iteration-count-infinite" + ); + if (nonCamouflageFlashing) victim.nonCamouflageFlashing = true; + else classList.add("flash-animation-iteration-count-infinite"); + victim.prompt(rebel, "fan"); }); - me.chooseControl('ok').set('dialog',dialog); + me.chooseControl("ok").set("dialog", dialog); } - game.filterPlayer(current=>{ - if(current.identity!='nei') return; - var storage=current.storage; - if(!storage.zhibi) storage.zhibi=[]; + game.filterPlayer((current) => { + if (current.identity != "nei") return; + var storage = current.storage; + if (!storage.zhibi) storage.zhibi = []; storage.zhibi.addArray(camouflaged); }); - 'step 1' - targets.forEach(current=>{ - if(game.me.identity=='nei'&&get.config('nei_auto_mark_camouflage')) current.setIdentity(); + "step 1"; + targets.forEach((current) => { + if (game.me.identity == "nei" && get.config("nei_auto_mark_camouflage")) + current.setIdentity(); current.unprompt(); - if(current.nonCamouflageFlashing){ + if (current.nonCamouflageFlashing) { delete current.nonCamouflageFlashing; return; } - var classList=current.classList; - if(classList.contains('flash-animation-iteration-count-infinite')) classList.remove('flash-animation-iteration-count-infinite'); + var classList = current.classList; + if (classList.contains("flash-animation-iteration-count-infinite")) + classList.remove("flash-animation-iteration-count-infinite"); }); }, - stratagemCamouflageOL:()=>{ - 'step 0' - var send=(clientCamouflaged,id,online)=>{ - var me=game.me; - if(me.identity=='nei'){ - var storage=me.storage; - if(!storage.zhibi) storage.zhibi=[]; + stratagemCamouflageOL: () => { + "step 0"; + var send = (clientCamouflaged, id, online) => { + var me = game.me; + if (me.identity == "nei") { + var storage = me.storage; + if (!storage.zhibi) storage.zhibi = []; storage.zhibi.addArray(clientCamouflaged); - var rebel=get.translation('fan2'),dialog=ui.create.dialog(`${get.translation(clientCamouflaged)}是${rebel}
    `,'forcebutton'); - ui.create.spinningIdentityCard('fan',dialog); - dialog.videoId=id; - clientCamouflaged.forEach(victim=>{ - var classList=victim.classList,nonCamouflageFlashing=classList.contains('flash-animation-iteration-count-infinite'); - if(nonCamouflageFlashing) victim.nonCamouflageFlashing=true; - else classList.add('flash-animation-iteration-count-infinite'); - victim.prompt(rebel,'fan'); + var rebel = get.translation("fan2"), + dialog = ui.create.dialog( + `${get.translation(clientCamouflaged)}是${rebel}
    `, + "forcebutton" + ); + ui.create.spinningIdentityCard("fan", dialog); + dialog.videoId = id; + clientCamouflaged.forEach((victim) => { + var classList = victim.classList, + nonCamouflageFlashing = classList.contains( + "flash-animation-iteration-count-infinite" + ); + if (nonCamouflageFlashing) victim.nonCamouflageFlashing = true; + else classList.add("flash-animation-iteration-count-infinite"); + victim.prompt(rebel, "fan"); }); - me.chooseControl('ok').set('dialog',dialog); - } - else ui.create.dialog('请等待内奸身份确认...').videoId=id; - if(online) game.resume(); + me.chooseControl("ok").set("dialog", dialog); + } else ui.create.dialog("请等待内奸身份确认...").videoId = id; + if (online) game.resume(); }; - var camouflaged=event.targets=game.players.filter(current=>current.identity=='fan'&&!current.ai.stratagemCamouflage).randomGets(Math.max(Math.round(get.population()/6),1)); - camouflaged.forEach(current=>current.ai.stratagemCamouflage=true); - event.videoId=lib.status.videoId++; - var time=10000; - if(lib.configOL&&lib.configOL.choose_timeout) time=parseInt(lib.configOL.choose_timeout)*1000; - var aiTargets=event.aiTargets=[]; - event.players.forEach(current=>{ + var camouflaged = (event.targets = game.players + .filter((current) => current.identity == "fan" && !current.ai.stratagemCamouflage) + .randomGets(Math.max(Math.round(get.population() / 6), 1))); + camouflaged.forEach((current) => (current.ai.stratagemCamouflage = true)); + event.videoId = lib.status.videoId++; + var time = 10000; + if (lib.configOL && lib.configOL.choose_timeout) + time = parseInt(lib.configOL.choose_timeout) * 1000; + var aiTargets = (event.aiTargets = []); + event.players.forEach((current) => { current.showTimer(time); - if(current.isOnline()){ - current.send(send,camouflaged,event.videoId,true); + if (current.isOnline()) { + current.send(send, camouflaged, event.videoId, true); current.wait(); - if(current.identity=='nei') event.withOL=true; + if (current.identity == "nei") event.withOL = true; return; } - var me=game.me; - if(current==me){ - event.withMe=true; - send(camouflaged,event.videoId); - if(me.identity=='nei') me.wait(); - else event._result={ - bool:true - }; + var me = game.me; + if (current == me) { + event.withMe = true; + send(camouflaged, event.videoId); + if (me.identity == "nei") me.wait(); + else + event._result = { + bool: true, + }; return; } - if(current.identity=='nei') aiTargets.push(current); + if (current.identity == "nei") aiTargets.push(current); }); - if(!aiTargets.length) return; + if (!aiTargets.length) return; aiTargets.randomSort(); - new Promise(resolve=>setTimeout(resolve,Math.ceil(5000+5000*Math.random()))).then(()=>{ - var interval=setInterval(()=>{ + new Promise((resolve) => + setTimeout(resolve, Math.ceil(5000 + 5000 * Math.random())) + ).then(() => { + var interval = setInterval(() => { aiTargets.shift(); - if(aiTargets.length) return; + if (aiTargets.length) return; clearInterval(interval); - if(event.withAI) game.resume(); - },Math.ceil(500+500*Math.random())) + if (event.withAI) game.resume(); + }, Math.ceil(500 + 500 * Math.random())); }); - 'step 1' - if(event.withMe) game.me.unwait(result); - 'step 2' - if(event.withOL&&!event.resultOL) game.pause(); - 'step 3' - if(!event.aiTargets.length) return; - event.withAI=true; + "step 1"; + if (event.withMe) game.me.unwait(result); + "step 2"; + if (event.withOL && !event.resultOL) game.pause(); + "step 3"; + if (!event.aiTargets.length) return; + event.withAI = true; game.pause(); - 'step 4' - game.broadcastAll('closeDialog',event.videoId); - event.players.forEach(current=>current.hideTimer()); - var afterCamouflage=clientCamouflaged=>clientCamouflaged.forEach(victim=>{ - victim.unprompt(); - if(victim.nonCamouflageFlashing){ - delete victim.nonCamouflageFlashing; + "step 4"; + game.broadcastAll("closeDialog", event.videoId); + event.players.forEach((current) => current.hideTimer()); + var afterCamouflage = (clientCamouflaged) => + clientCamouflaged.forEach((victim) => { + victim.unprompt(); + if (victim.nonCamouflageFlashing) { + delete victim.nonCamouflageFlashing; + return; + } + var classList = victim.classList; + if (classList.contains("flash-animation-iteration-count-infinite")) + classList.remove("flash-animation-iteration-count-infinite"); + }); + event.players.forEach((current) => { + if (current.isOnline()) { + current.send(afterCamouflage, targets); return; } - var classList=victim.classList; - if(classList.contains('flash-animation-iteration-count-infinite')) classList.remove('flash-animation-iteration-count-infinite'); + var me = game.me; + if (current == me && me.identity == "nei") afterCamouflage(targets); }); - event.players.forEach(current=>{ - if(current.isOnline()){ - current.send(afterCamouflage,targets); - return; - } - var me=game.me; - if(current==me&&me.identity=='nei') afterCamouflage(targets); - }); - } - } + }, + }, }, - get:{ - rawAttitude:function(from,to){ - var x=0,num=0,temp,i; - if(_status.ai.customAttitude){ - for(i=0;i<_status.ai.customAttitude.length;i++){ - temp=_status.ai.customAttitude[i](from,to); - if(temp!=undefined){ - x+=temp; + get: { + rawAttitude: function (from, to) { + var x = 0, + num = 0, + temp, + i; + if (_status.ai.customAttitude) { + for (i = 0; i < _status.ai.customAttitude.length; i++) { + temp = _status.ai.customAttitude[i](from, to); + if (temp != undefined) { + x += temp; num++; } } } - if(num){ - return x/num; + if (num) { + return x / num; } - if(_status.mode=='purple'){ - var real=get.realAttitude(from,to); - if(from==to||to.identityShown||from.storage.zhibi&&from.storage.zhibi.includes(to)||(_status.yeconfirm&&['rYe','bYe'].includes(to.identity)&&['rYe','bYe'].includes(to.identity))) return real*1.1; - return ((to.ai.shown+0.1)*real+(from.identity.slice(0,1)==to.identity.slice(0,1)?3:-3)*(1-to.ai.shown)) - } - else if(_status.mode=='stratagem'){ - var x=0,num=0,temp,i; - if(_status.ai.customAttitude){ - for(i=0;i<_status.ai.customAttitude.length;i++){ - temp=_status.ai.customAttitude[i](from,to); - if(temp!=undefined){ - x+=temp; + if (_status.mode == "purple") { + var real = get.realAttitude(from, to); + if ( + from == to || + to.identityShown || + (from.storage.zhibi && from.storage.zhibi.includes(to)) || + (_status.yeconfirm && + ["rYe", "bYe"].includes(to.identity) && + ["rYe", "bYe"].includes(to.identity)) + ) + return real * 1.1; + return ( + (to.ai.shown + 0.1) * real + + (from.identity.slice(0, 1) == to.identity.slice(0, 1) ? 3 : -3) * (1 - to.ai.shown) + ); + } else if (_status.mode == "stratagem") { + var x = 0, + num = 0, + temp, + i; + if (_status.ai.customAttitude) { + for (i = 0; i < _status.ai.customAttitude.length; i++) { + temp = _status.ai.customAttitude[i](from, to); + if (temp != undefined) { + x += temp; num++; } } } - if(num){ - return x/num; + if (num) { + return x / num; } - var real=get.realAttitude(from,to),zhibi=from.storage.zhibi,stratagem_expose=from.storage.stratagem_expose,followCamouflage=true; - 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'].includes(from.identity)||get.situation()>=3&&from.identity=='fan')?2.9:-2.9)) - if(from==to||to.identityShown||((stratagem_expose&&stratagem_expose.includes(to))||(zhibi&&zhibi.includes(to)))&&!to.ai.stratagemCamouflage) return real*1.1; - if(from.identity=='nei'&&to.ai.stratagemCamouflage) return real*1.1; - if(to.identity=='nei'){ - if(from.identity=='fan'){ - if(get.population('zhong')==0){ - if(zhibi){ - var dead=game.dead.slice(); - for(var current of dead){ - if(from.storage.zhibi.includes(current)&¤t.ai.stratagemCamouflage){ - if(from.storage.stratagem_expose&&from.storage.stratagem_expose.includes(to)) return -7; + var real = get.realAttitude(from, to), + zhibi = from.storage.zhibi, + stratagem_expose = from.storage.stratagem_expose, + followCamouflage = true; + 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"].includes(from.identity)) || + (get.situation() >= 3 && from.identity == "fan") + ? 2.9 + : -2.9)) + ); + if ( + from == to || + to.identityShown || + (((stratagem_expose && stratagem_expose.includes(to)) || + (zhibi && zhibi.includes(to))) && + !to.ai.stratagemCamouflage) + ) + return real * 1.1; + if (from.identity == "nei" && to.ai.stratagemCamouflage) return real * 1.1; + if (to.identity == "nei") { + if (from.identity == "fan") { + if (get.population("zhong") == 0) { + if (zhibi) { + var dead = game.dead.slice(); + for (var current of dead) { + if ( + from.storage.zhibi.includes(current) && + current.ai.stratagemCamouflage + ) { + if ( + from.storage.stratagem_expose && + from.storage.stratagem_expose.includes(to) + ) + return -7; } } - if(zhibi.includes(to)) return 3; + if (zhibi.includes(to)) return 3; } } } } - if(to.identity=='fan'&&from.identity=='nei'&&zhibi.includes(game.zhu)&&game.players.filter(i=>i!=from&&!zhibi.includes(i)).map(i=>i.identity).reduce((p,c)=>(!p.includes(c)?(p.push(c)&&p):p),[]).length==1) return real; - for(var fan of game.dead){ - if(fan.identity!='fan'||!fan.storage.stratagem_revitalization) continue; - for(var current of fan.storage.stratagem_expose){ - if(to==current){ + if ( + to.identity == "fan" && + from.identity == "nei" && + zhibi.includes(game.zhu) && + game.players + .filter((i) => i != from && !zhibi.includes(i)) + .map((i) => i.identity) + .reduce((p, c) => (!p.includes(c) ? p.push(c) && p : p), []).length == 1 + ) + return real; + for (var fan of game.dead) { + if (fan.identity != "fan" || !fan.storage.stratagem_revitalization) continue; + for (var current of fan.storage.stratagem_expose) { + if (to == current) { return real; } } } - if(from.identity=='fan'&&to.identity=='fan'){ - if(from.ai.stratagemCamouflage){ - var zhu=game.zhu&&game.zhu.isZhu&&game.zhu.identityShown?game.zhu:undefined; - if(zhu){ - if(zhu.storage.stratagem_expose&&zhu.storage.stratagem_expose.includes(to)) return 0; + if (from.identity == "fan" && to.identity == "fan") { + if (from.ai.stratagemCamouflage) { + var zhu = + game.zhu && game.zhu.isZhu && game.zhu.identityShown ? game.zhu : undefined; + if (zhu) { + if (zhu.storage.stratagem_expose && zhu.storage.stratagem_expose.includes(to)) + return 0; } - if(zhibi&&zhibi.includes(to)) return -7; + if (zhibi && zhibi.includes(to)) return -7; } - if(to.ai.stratagemCamouflage){ - var zhu=game.zhu&&game.zhu.isZhu&&game.zhu.identityShown?game.zhu:undefined; - if(zhu){ - if(zhu.storage.stratagem_expose&&zhu.storage.stratagem_expose.includes(to)) return 0; + if (to.ai.stratagemCamouflage) { + var zhu = + game.zhu && game.zhu.isZhu && game.zhu.identityShown ? game.zhu : undefined; + if (zhu) { + if (zhu.storage.stratagem_expose && zhu.storage.stratagem_expose.includes(to)) + return 0; } - if(zhibi&&zhibi.includes(to)) return -7; + if (zhibi && zhibi.includes(to)) return -7; } } - if(from.identity!='nei'&&zhibi&&zhibi.includes(to)&&!to.identityShown&&(followCamouflage&&to.ai.stratagemCamouflage)) return -5; - if(from.identity!='nei'&&stratagem_expose&&stratagem_expose.includes(to)&&!to.identityShown) return -5; - if(zhibi){ - for(var to2 of zhibi){ - if(to2.storage.stratagem_expose){ - if(to2.ai.stratagemCamouflage){ - for(var to3 of to2.storage.stratagem_expose){ - if(zhibi.slice().addArray(stratagem_expose).includes(to3)){ - if(to==to2){ + if ( + from.identity != "nei" && + zhibi && + zhibi.includes(to) && + !to.identityShown && + followCamouflage && + to.ai.stratagemCamouflage + ) + return -5; + if ( + from.identity != "nei" && + stratagem_expose && + stratagem_expose.includes(to) && + !to.identityShown + ) + return -5; + if (zhibi) { + for (var to2 of zhibi) { + if (to2.storage.stratagem_expose) { + if (to2.ai.stratagemCamouflage) { + for (var to3 of to2.storage.stratagem_expose) { + if (zhibi.slice().addArray(stratagem_expose).includes(to3)) { + if (to == to2) { return real; } - } else if(to==to3){ - return Math.abs(real+10)/10; + } else if (to == to3) { + return Math.abs(real + 10) / 10; } } - }else{ - for(var to3 of to2.storage.stratagem_expose){ - if(!zhibi.slice().addArray(stratagem_expose).includes(to3)&&to==to3){ - return get.rawAttitude(to3,to)*Math.sign(real); + } else { + for (var to3 of to2.storage.stratagem_expose) { + if ( + !zhibi.slice().addArray(stratagem_expose).includes(to3) && + to == to3 + ) { + return get.rawAttitude(to3, to) * Math.sign(real); } } } } } } - return Math.max(-1,Math.min(-0.1,(-Math.min(5,to.countCards('hes')/2+1)/5-Math.max(0,5-to.hp)/4)/2)); + return Math.max( + -1, + Math.min( + -0.1, + (-Math.min(5, to.countCards("hes") / 2 + 1) / 5 - Math.max(0, 5 - to.hp) / 4) / 2 + ) + ); } //正常身份模式态度 - var difficulty=0; - if(to==game.me) difficulty=2-get.difficulty(); - if(from==to||to.identityShown||(from.storage.dongcha==to)||to.identityShown||from.storage.zhibi&&from.storage.zhibi.includes(to)){ - return get.realAttitude(from,to)+difficulty*1.5; - } - else{ - if(from.identity=='zhong'&&to.ai.shown==0&&from.ai.tempIgnore&& - !from.ai.tempIgnore.includes(to)){ - for(var i=0;i1&&to.hp>fan.hp&&to.countCards('he')>fan.countCards('he')){ + if (fan) { + if ( + to.hp > 1 && + to.hp > fan.hp && + to.countCards("he") > fan.countCards("he") + ) { return -3; } } return 0; } - if(situation>1) return Math.max((situation-8)/3,-2); - return Math.min(3,get.population('fan')); - case 'fan': - if(get.population('fan')==1&&get.population('nei')==1&&game.players.length==3){ + if (situation > 1) return Math.max((situation - 8) / 3, -2); + return Math.min(3, get.population("fan")); + case "fan": + if ( + get.population("fan") == 1 && + get.population("nei") == 1 && + game.players.length == 3 + ) { var nei; - for(var i=0;i1&&nei.hp>to.hp&&nei.countCards('he')>to.countCards('he')){ + if (nei) { + if ( + nei.hp > 1 && + nei.hp > to.hp && + nei.countCards("he") > to.countCards("he") + ) { return 0; } } @@ -3382,831 +3976,967 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ return -4; } break; - case 'zhong': - switch (identity2){ - case 'zhu':return 10; - case 'zhong': - if(from==to) return 5; - if(get.population('zhong')>1) return 3; + case "zhong": + switch (identity2) { + case "zhu": + return 10; + case "zhong": + if (from == to) return 5; + if (get.population("zhong") > 1) return 3; return 4; - case 'nei': - if(get.population('fan')==0&&get.population('zhong')==1) return -2; - if(get.population('zhong')>=1) return Math.min(3,-situation); + case "nei": + if (get.population("fan") == 0 && get.population("zhong") == 1) return -2; + if (get.population("zhong") >= 1) return Math.min(3, -situation); return 3; - case 'fan':return -8; + case "fan": + return -8; } break; - case 'nei': - if(identity2=='zhu'&&game.players.length==2) return -10; - if(from!=to&&identity2!='zhu'&&game.players.length==3) return -8; - var strategy=get.aiStrategy(); - if(strategy==4){ - if(from==to) return 10; + case "nei": + if (identity2 == "zhu" && game.players.length == 2) return -10; + if (from != to && identity2 != "zhu" && game.players.length == 3) return -8; + var strategy = get.aiStrategy(); + if (strategy == 4) { + if (from == to) return 10; return 0; } var num; - switch (identity2){ - case 'zhu': - if(strategy==6) return -1; - if(strategy==5) return 10; - if(to.hp<=0) return 10; - if(get.population('fan')==1){ + switch (identity2) { + case "zhu": + if (strategy == 6) return -1; + if (strategy == 5) return 10; + if (to.hp <= 0) return 10; + if (get.population("fan") == 1) { var fan; - for(var i=0;i1&&to.hp>fan.hp&&to.countCards('he')>fan.countCards('he')){ + if (fan) { + if ( + to.hp > 1 && + to.hp > fan.hp && + to.countCards("he") > fan.countCards("he") + ) { return -3; } } return 0; + } else { + if (situation > 1 || get.population("fan") == 0) num = 0; + else num = get.population("fan") + Math.max(0, 3 - game.zhu.hp); } - else{ - if(situation>1||get.population('fan')==0) num=0; - else num=get.population('fan')+Math.max(0,3-game.zhu.hp); - } - if(strategy==2) num--; - if(strategy==3) num++; + if (strategy == 2) num--; + if (strategy == 3) num++; return num; - case 'zhong': - if(strategy==5) return Math.min(0,-situation); - if(strategy==6) return Math.max(-1,-situation); - if(get.population('fan')==0) num=-5; - else if(situation<=0) num=0; - else if(game.zhu&&game.zhu.hp<2) num=0; - else if(game.zhu&&game.zhu.hp==2) num=-1; - else if(game.zhu&&game.zhu.hp<=2&&situation>1) num=-1; - else num=-2; - if(strategy==2) num--; - if(strategy==3) num++; + case "zhong": + if (strategy == 5) return Math.min(0, -situation); + if (strategy == 6) return Math.max(-1, -situation); + if (get.population("fan") == 0) num = -5; + else if (situation <= 0) num = 0; + else if (game.zhu && game.zhu.hp < 2) num = 0; + else if (game.zhu && game.zhu.hp == 2) num = -1; + else if (game.zhu && game.zhu.hp <= 2 && situation > 1) num = -1; + else num = -2; + if (strategy == 2) num--; + if (strategy == 3) num++; return num; - case 'nei': - if(from==to) return 10; - if(from.ai.friend.includes(to)) return 5; - if(get.population('fan')+get.population('zhong')>0) return 0; + case "nei": + if (from == to) return 10; + if (from.ai.friend.includes(to)) return 5; + if (get.population("fan") + get.population("zhong") > 0) return 0; return -5; - case 'fan': - if(strategy==5) return Math.max(-1,situation); - if(strategy==6) return Math.min(0,situation); - if((game.zhu&&game.zhu.hp<=2&&situation<0)||situation<-1) num=-3; - else if(situation<0||get.population('zhong')==0) num=-2; - else if((game.zhu&&game.zhu.hp>=4&&situation>0)||situation>1) num=1; - else num=0; - if(strategy==2) num++; - if(strategy==3) num--; + case "fan": + if (strategy == 5) return Math.max(-1, situation); + if (strategy == 6) return Math.min(0, situation); + if ((game.zhu && game.zhu.hp <= 2 && situation < 0) || situation < -1) + num = -3; + else if (situation < 0 || get.population("zhong") == 0) num = -2; + else if ((game.zhu && game.zhu.hp >= 4 && situation > 0) || situation > 1) + num = 1; + else num = 0; + if (strategy == 2) num++; + if (strategy == 3) num--; return num; } break; - case 'fan': - switch (identity2){ - case 'zhu': - if(get.population('nei')>0){ - if(situation==1) return -6; - if(situation>1) return -5; + case "fan": + switch (identity2) { + case "zhu": + if (get.population("nei") > 0) { + if (situation == 1) return -6; + if (situation > 1) return -5; } return -8; - case 'zhong': - if(game.zhu.hp>=3&&to.hp==1){ + case "zhong": + if (game.zhu.hp >= 3 && to.hp == 1) { return -10; } return -7; - case 'nei': - if(get.population('fan')==1) return 0; - if(get.population('zhong')==0) return -2; - if(game.zhu&&game.zhu.hp<=2&&game.zhu.identityShown) return -1; + case "nei": + if (get.population("fan") == 1) return 0; + if (get.population("zhong") == 0) return -2; + if (game.zhu && game.zhu.hp <= 2 && game.zhu.identityShown) return -1; return 3; - case 'fan': + case "fan": return 5; } } } //正常身份模式态度 - if(!game.zhu){ - if(from.identity=='nei'||to.identity=='nei'||from.identity=='commoner'||to.identity=='commoner') return -1; - if(from.identity==to.identity) return 6; + if (!game.zhu) { + if ( + from.identity == "nei" || + to.identity == "nei" || + from.identity == "commoner" || + to.identity == "commoner" + ) + return -1; + if (from.identity == to.identity) return 6; return -6; } - var situation=get.situation(); - var identity=from.identity; - var identity2=to.identity; - if(identity2=='zhu'&&!to.isZhu){ - identity2='zhong'; - if(from==to) return 10; + var situation = get.situation(); + var identity = from.identity; + var identity2 = to.identity; + if (identity2 == "zhu" && !to.isZhu) { + identity2 = "zhong"; + if (from == to) return 10; } - if(from!=to&&to.identity=='nei'&&to.ai.shown<1&&(to.ai.identity_mark=='fan'||to.ai.identity_mark=='zhong')){ - identity2=to.ai.identity_mark; + if ( + from != to && + to.identity == "nei" && + to.ai.shown < 1 && + (to.ai.identity_mark == "fan" || to.ai.identity_mark == "zhong") + ) { + identity2 = to.ai.identity_mark; } - if(from.identity!='nei'&&from.identity!='commoner'&&from!=to&&get.population('fan')==0&&identity2=='zhong'){ - for(var i=0;i1&&to.hp>fan.hp&&to.countCards('he')>fan.countCards('he')){ + if (fan) { + if ( + to.hp > 1 && + to.hp > fan.hp && + to.countCards("he") > fan.countCards("he") + ) { return -3; } } return 0; } - if(situation>1) return 0; - return Math.min(3,get.population('fan')); - case 'fan': - if(get.population('fan')==1&&get.population('nei')==1&&game.players.length==3){ + if (situation > 1) return 0; + return Math.min(3, get.population("fan")); + case "fan": + if ( + get.population("fan") == 1 && + get.population("nei") == 1 && + game.players.length == 3 + ) { var nei; - for(var i=0;i1&&nei.hp>to.hp&&nei.countCards('he')>to.countCards('he')){ + if (nei) { + if ( + nei.hp > 1 && + nei.hp > to.hp && + nei.countCards("he") > to.countCards("he") + ) { return 0; } } return -3; } return -4; - case 'commoner': - if(to.identity=='zhong') return 0; - if(get.population('fan')==0){ - if(to.ai.identity_mark=='zhong'&&to.ai.shown<1) return 0; + case "commoner": + if (to.identity == "zhong") return 0; + if (get.population("fan") == 0) { + if (to.ai.identity_mark == "zhong" && to.ai.shown < 1) return 0; return -0.5; } - if(zhongmode&&to.ai.sizhong&&to.ai.shown<1) return 6; - if(game.players.length==3){ + if (zhongmode && to.ai.sizhong && to.ai.shown < 1) return 6; + if (game.players.length == 3) { var fan; - for(var i=0; i1&&to.hp>fan.hp&&to.countCards('he')>fan.countCards('he')){ + if (fan) { + if ( + to.hp > 1 && + to.hp > fan.hp && + to.countCards("he") > fan.countCards("he") + ) { return -3; } } return 3; } - if(situation<0&&game.zhu&&game.zhu.hp<=2) return -3.8; - return Math.max(-4,2-get.population('fan')); + if (situation < 0 && game.zhu && game.zhu.hp <= 2) return -3.8; + return Math.max(-4, 2 - get.population("fan")); } break; - case 'zhong':case 'mingzhong': - switch(identity2){ - case 'zhu': return 10; - case 'zhong':case 'mingzhong': return 4; - case 'nei': - if(get.population('fan')==0) return -2; - if(zhongmode&&to.ai.sizhong&&to.ai.shown<1) return 6; - return Math.min(3,-situation); - case 'fan': return -8; - case 'commoner': - return Math.min(3,Math.max(-3,situation-0.2)); + case "zhong": + case "mingzhong": + switch (identity2) { + case "zhu": + return 10; + case "zhong": + case "mingzhong": + return 4; + case "nei": + if (get.population("fan") == 0) return -2; + if (zhongmode && to.ai.sizhong && to.ai.shown < 1) return 6; + return Math.min(3, -situation); + case "fan": + return -8; + case "commoner": + return Math.min(3, Math.max(-3, situation - 0.2)); } break; - case 'nei': - if(identity2=='zhu'&&game.players.length==2) return -10; - if(from!=to&&identity2!='zhu'&&identity2!='commoner'&&game.players.length==3) return -8; - var strategy=get.aiStrategy(); - if(strategy==4){ - if(from==to) return 10; + case "nei": + if (identity2 == "zhu" && game.players.length == 2) return -10; + if ( + from != to && + identity2 != "zhu" && + identity2 != "commoner" && + game.players.length == 3 + ) + return -8; + var strategy = get.aiStrategy(); + if (strategy == 4) { + if (from == to) return 10; return 0; } var num; - switch(identity2){ - case 'zhu': - if(strategy==6) return -1; - if(strategy==5) return 10; - if(to.hp<=0) return 10; - if(get.population('fan')==1){ + switch (identity2) { + case "zhu": + if (strategy == 6) return -1; + if (strategy == 5) return 10; + if (to.hp <= 0) return 10; + if (get.population("fan") == 1) { var fan; - for(var i=0;i1&&to.hp>fan.hp&&to.countCards('he')>fan.countCards('he')){ + if (fan) { + if ( + to.hp > 1 && + to.hp > fan.hp && + to.countCards("he") > fan.countCards("he") + ) { return -1.7; } } return 0; + } else { + if (situation > 1 || get.population("fan") == 0) num = 0; + else num = get.population("fan") + Math.max(0, 3 - game.zhu.hp); } - else{ - if(situation>1||get.population('fan')==0) num=0; - else num=get.population('fan')+Math.max(0,3-game.zhu.hp); - } - if(strategy==2) num--; - if(strategy==3) num++; + if (strategy == 2) num--; + if (strategy == 3) num++; return num; - case 'zhong': - if(strategy==5) return Math.min(0,-situation); - if(strategy==6) return Math.max(-1,-situation); - if(get.population('fan')==0) num=-5; - else if(situation<=0) num=0; - else if(game.zhu&&game.zhu.hp<2) num=0; - else if(game.zhu&&game.zhu.hp==2) num=-1; - else if(game.zhu&&game.zhu.hp<=2&&situation>1) num=-1; - else num=-2; - if(zhongmode&&situation<2){ - num=4; + case "zhong": + if (strategy == 5) return Math.min(0, -situation); + if (strategy == 6) return Math.max(-1, -situation); + if (get.population("fan") == 0) num = -5; + else if (situation <= 0) num = 0; + else if (game.zhu && game.zhu.hp < 2) num = 0; + else if (game.zhu && game.zhu.hp == 2) num = -1; + else if (game.zhu && game.zhu.hp <= 2 && situation > 1) num = -1; + else num = -2; + if (zhongmode && situation < 2) { + num = 4; } - if(strategy==2) num--; - if(strategy==3) num++; + if (strategy == 2) num--; + if (strategy == 3) num++; return num; - case 'mingzhong': - if(zhongmode){ - if(from.ai.sizhong==undefined){ - from.ai.sizhong=(Math.random()<0.5); + case "mingzhong": + if (zhongmode) { + if (from.ai.sizhong == undefined) { + from.ai.sizhong = Math.random() < 0.5; } - if(from.ai.sizhong) return 6; + if (from.ai.sizhong) return 6; } - if(strategy==5) return Math.min(0,-situation); - if(strategy==6) return Math.max(-1,-situation); - if(get.population('fan')==0) num=-5; - else if(situation<=0) num=0; - else num=-3; - if(strategy==2) num--; - if(strategy==3) num++; + if (strategy == 5) return Math.min(0, -situation); + if (strategy == 6) return Math.max(-1, -situation); + if (get.population("fan") == 0) num = -5; + else if (situation <= 0) num = 0; + else num = -3; + if (strategy == 2) num--; + if (strategy == 3) num++; return num; - case 'nei': - if(from==to) return 10; - if(from.ai.friend.includes(to)) return 5; - if(get.population('fan')+get.population('zhong')>0) return 0; + case "nei": + if (from == to) return 10; + if (from.ai.friend.includes(to)) return 5; + if (get.population("fan") + get.population("zhong") > 0) return 0; return -5; - case 'fan': - if(strategy==5) return Math.max(-1,situation); - if(strategy==6) return Math.min(0,situation); - if((game.zhu&&game.zhu.hp<=2&&situation<0)||situation<-1) num=-3; - else if(situation<0||get.population('zhong')+get.population('mingzhong')==0) num=-2; - else if((game.zhu&&game.zhu.hp>=4&&situation>0)||situation>1) num=1; - else num=0; - if(strategy==2) num++; - if(strategy==3) num--; + case "fan": + if (strategy == 5) return Math.max(-1, situation); + if (strategy == 6) return Math.min(0, situation); + if ((game.zhu && game.zhu.hp <= 2 && situation < 0) || situation < -1) + num = -3; + else if ( + situation < 0 || + get.population("zhong") + get.population("mingzhong") == 0 + ) + num = -2; + else if ((game.zhu && game.zhu.hp >= 4 && situation > 0) || situation > 1) + num = 1; + else num = 0; + if (strategy == 2) num++; + if (strategy == 3) num--; return num; - case 'commoner': - if(game.players.length<=4) return 5; - return Math.min(Math.max(-situation,-2),2); + case "commoner": + if (game.players.length <= 4) return 5; + return Math.min(Math.max(-situation, -2), 2); } break; - case 'fan': - switch(identity2){ - case 'zhu': - if(get.population('nei')>0){ - if(situation==1) return -6; - if(situation>1) return -5; + case "fan": + switch (identity2) { + case "zhu": + if (get.population("nei") > 0) { + if (situation == 1) return -6; + if (situation > 1) return -5; } return -8; - case 'zhong': - if(!zhongmode&&game.zhu.hp>=3&&to.hp==1){ + case "zhong": + if (!zhongmode && game.zhu.hp >= 3 && to.hp == 1) { return -10; } return -7; - case 'mingzhong':return -5; - case 'nei': - if(zhongmode&&to.ai.sizhong) return -7; - if(get.population('fan')==1) return 0; - if(get.population('zhong')+get.population('mingzhong')==0) return -7; - if(game.zhu&&game.zhu.hp<=2) return -1; - return Math.min(3,situation); - case 'fan': return 5; - case 'commoner': - return 2*get.population('fan')-3; + case "mingzhong": + return -5; + case "nei": + if (zhongmode && to.ai.sizhong) return -7; + if (get.population("fan") == 1) return 0; + if (get.population("zhong") + get.population("mingzhong") == 0) return -7; + if (game.zhu && game.zhu.hp <= 2) return -1; + return Math.min(3, situation); + case "fan": + return 5; + case "commoner": + return 2 * get.population("fan") - 3; } break; - case 'commoner': - switch(identity2){ - case 'zhu': - if(situation>0) return 2*Math.min(4,(to.hp+to.countCards('h')/4-2)); - if(situation>=-3&&game.zhu) return (to.hp-2)+to.countCards('h')/4; //return Math.min(-0.1,5-game.zhu.hp); - return to.hp+to.countCards('h')/3-4; - case 'zhong': - if(situation>0){ - if(to.hp>=2) return Math.min(3,Math.max(1,to.hp+to.countCards('h')/4-4)); + case "commoner": + switch (identity2) { + case "zhu": + if (situation > 0) return 2 * Math.min(4, to.hp + to.countCards("h") / 4 - 2); + if (situation >= -3 && game.zhu) return to.hp - 2 + to.countCards("h") / 4; //return Math.min(-0.1,5-game.zhu.hp); + return to.hp + to.countCards("h") / 3 - 4; + case "zhong": + if (situation > 0) { + if (to.hp >= 2) + return Math.min(3, Math.max(1, to.hp + to.countCards("h") / 4 - 4)); else return 0; } return -2; - case 'nei': - if(game.players.length==3&&get.population('nei')==1) return Math.min(3.5,(to.hp-1.5)+to.countCards('h')/3)-(to.hp<(game.zhu?game.zhu.hp:0)?4:0); - if(game.players.length<=4&&get.population('nei')==1) return Math.min(5,(to.hp-1.5)+to.countCards('h')/3); - if(situation>0) return -3; + case "nei": + if (game.players.length == 3 && get.population("nei") == 1) + return ( + Math.min(3.5, to.hp - 1.5 + to.countCards("h") / 3) - + (to.hp < (game.zhu ? game.zhu.hp : 0) ? 4 : 0) + ); + if (game.players.length <= 4 && get.population("nei") == 1) + return Math.min(5, to.hp - 1.5 + to.countCards("h") / 3); + if (situation > 0) return -3; return 0; - case 'fan': - if(situation<0) return to.hp+to.countCards('h')/4-1.7*get.population('fan')+2; - else if(situation==0) return 0; - return 0.55*get.population('fan')-2.1; - case 'commoner': - return from==to?10:(to.hp<=2?-2:0); + case "fan": + if (situation < 0) + return to.hp + to.countCards("h") / 4 - 1.7 * get.population("fan") + 2; + else if (situation == 0) return 0; + return 0.55 * get.population("fan") - 2.1; + case "commoner": + return from == to ? 10 : to.hp <= 2 ? -2 : 0; } break; } }, - situation:function(absolute){ - var i,j,player; - var zhuzhong=0,total=0,zhu,fan=0; - for(i=0;i4){ - php=4; + situation: function (absolute) { + var i, j, player; + var zhuzhong = 0, + total = 0, + zhu, + fan = 0; + for (i = 0; i < game.players.length; i++) { + player = game.players[i]; + var php = player.hp; + if (player.hasSkill("benghuai") && php > 4) { + php = 4; + } else if (php > 6) { + php = 6; } - else if(php>6){ - php=6; - } - j=player.countCards('h')+player.countCards('e')*1.5+php*2; - if(player.identity=='zhu'){ - zhuzhong+=j*1.2+5; - total+=j*1.2+5; - zhu=j; - } - else if(player.identity=='zhong'||player.identity=='mingzhong'){ - zhuzhong+=j*0.8+3; - total+=j*0.8+3; - } - else if(player.identity=='fan'){ - zhuzhong-=j+4; - total+=j+4; - fan+=j+4; + j = player.countCards("h") + player.countCards("e") * 1.5 + php * 2; + if (player.identity == "zhu") { + zhuzhong += j * 1.2 + 5; + total += j * 1.2 + 5; + zhu = j; + } else if (player.identity == "zhong" || player.identity == "mingzhong") { + zhuzhong += j * 0.8 + 3; + total += j * 0.8 + 3; + } else if (player.identity == "fan") { + zhuzhong -= j + 4; + total += j + 4; + fan += j + 4; } } - if(absolute) return zhuzhong; - var result=parseInt(10*Math.abs(zhuzhong/total)); - if(zhuzhong<0) result=-result; - if(!game.zhong){ - if(zhu<12&&fan>30) result--; - if(zhu<6&&fan>15) result--; - if(zhu<4) result--; + if (absolute) return zhuzhong; + var result = parseInt(10 * Math.abs(zhuzhong / total)); + if (zhuzhong < 0) result = -result; + if (!game.zhong) { + if (zhu < 12 && fan > 30) result--; + if (zhu < 6 && fan > 15) result--; + if (zhu < 4) result--; } return result; }, - insightResult:function(from,to){ - var friend='friend',enemy='enemy'; - if(from.identity=='nei') return to.identity; - if(to.identity=='nei') return friend; - if(from.ai.stratagemCamouflage||to.ai.stratagemCamouflage) return enemy; - if(from.identity==to.identity||from.identity=='zhu'&&to.identity=='zhong'||from.identity=='zhong'&&to.identity=='zhu') return friend; + insightResult: function (from, to) { + var friend = "friend", + enemy = "enemy"; + if (from.identity == "nei") return to.identity; + if (to.identity == "nei") return friend; + if (from.ai.stratagemCamouflage || to.ai.stratagemCamouflage) return enemy; + if ( + from.identity == to.identity || + (from.identity == "zhu" && to.identity == "zhong") || + (from.identity == "zhong" && to.identity == "zhu") + ) + return friend; return enemy; - } + }, }, - skill:{ - stratagem_gain:{ - silent:true, - charlotte:true, - ruleSkill:true, - trigger:{ - player:['phaseBegin','damageEnd'] + skill: { + stratagem_gain: { + silent: true, + charlotte: true, + ruleSkill: true, + trigger: { + player: ["phaseBegin", "damageEnd"], + }, + content: () => { + player.changeFury(trigger.name == "damage" ? trigger.num : 1, true); }, - content:()=>{ - player.changeFury(trigger.name=='damage'?trigger.num:1,true); - } }, - stratagem_insight:{ - trigger:{ - source:'damageSource', - global:'loseHpEnd' + stratagem_insight: { + trigger: { + source: "damageSource", + global: "loseHpEnd", }, - filter:(event,player)=>{ - if(!player.storage.stratagem_fury) return false; - const target=event.player; - if(target==player||!target.isIn()||target.identityShown) return false; - let source=event.source; - if(event.name=='loseHp'){ - const trigger=event.getParent()._trigger; - if(trigger) source=trigger.source; + filter: (event, player) => { + if (!player.storage.stratagem_fury) return false; + const target = event.player; + if (target == player || !target.isIn() || target.identityShown) return false; + let source = event.source; + if (event.name == "loseHp") { + const trigger = event.getParent()._trigger; + if (trigger) source = trigger.source; } - return player==source; + return player == source; }, - logTarget:'player', - prompt2:event=>`消耗1点怒气,洞察${get.translation(event.player)}的身份`, - check:(event,player)=>{ - const storage=player.storage,zhibi=storage.zhibi; - if(zhibi&&zhibi.includes(event.player)) return false; - const stratagemExpose=storage.stratagem_expose; - if(stratagemExpose&&stratagemExpose.includes(event.player)) return false; - if(get.population('zhong')==0&&player.identity=='fan') return false; - return Math.abs(get.attitude(player,event.player))<=1; + logTarget: "player", + prompt2: (event) => `消耗1点怒气,洞察${get.translation(event.player)}的身份`, + check: (event, player) => { + const storage = player.storage, + zhibi = storage.zhibi; + if (zhibi && zhibi.includes(event.player)) return false; + const stratagemExpose = storage.stratagem_expose; + if (stratagemExpose && stratagemExpose.includes(event.player)) return false; + if (get.population("zhong") == 0 && player.identity == "fan") return false; + return Math.abs(get.attitude(player, event.player)) <= 1; }, - content:()=>{ - player.changeFury(-1,true); + content: () => { + player.changeFury(-1, true); player.insightInto(trigger.player); - } + }, }, - stratagem_monarchy:{ - trigger:{ - player:['dying','phaseZhunbeiBegin'], - global:'dieAfter', + stratagem_monarchy: { + trigger: { + player: ["dying", "phaseZhunbeiBegin"], + global: "dieAfter", }, - forced:true, - priority:100, - popup:false, - unique:true, - firstDo:true, - silent:true, - charlotte:true, - ruleSkill:true, - filter:(event,player,name)=>{ - if(player.storage.stratagem_monarchy||player.identity!='zhu') return false; - if(name=='dieAfter') return game.dead.length>=Math.max(Math.round(get.population()/3),2); - return name=='dying'||game.roundNumber>=Math.max(Math.round(get.population()/2),3); + forced: true, + priority: 100, + popup: false, + unique: true, + firstDo: true, + silent: true, + charlotte: true, + ruleSkill: true, + filter: (event, player, name) => { + if (player.storage.stratagem_monarchy || player.identity != "zhu") return false; + if (name == "dieAfter") + return game.dead.length >= Math.max(Math.round(get.population() / 3), 2); + return ( + name == "dying" || game.roundNumber >= Math.max(Math.round(get.population() / 2), 3) + ); }, - content:()=>{ - 'step 0' - if(event.triggername=='dying') game.delayx(); - 'step 1' - player.storage.stratagem_monarchy=true; - game.broadcastAll(clientPlayer=>{ - if(!game.zhu) game.zhu=clientPlayer; - clientPlayer.identityShown=true; - clientPlayer.ai.shown=1; + content: () => { + "step 0"; + if (event.triggername == "dying") game.delayx(); + "step 1"; + player.storage.stratagem_monarchy = true; + game.broadcastAll((clientPlayer) => { + if (!game.zhu) game.zhu = clientPlayer; + clientPlayer.identityShown = true; + clientPlayer.ai.shown = 1; clientPlayer.setIdentity(); - clientPlayer.isZhu=true; - clientPlayer.node.identity.classList.remove('guessing'); - var config=lib.config; - if(config.animation&&!config.low_performance) clientPlayer.$legend(); - var clickingIdentity=_status.clickingidentity; - if(!clickingIdentity||clickingIdentity[0]!=clientPlayer) return; - clickingIdentity[1].forEach(element=>{ + clientPlayer.isZhu = true; + clientPlayer.node.identity.classList.remove("guessing"); + var config = lib.config; + if (config.animation && !config.low_performance) clientPlayer.$legend(); + var clickingIdentity = _status.clickingidentity; + if (!clickingIdentity || clickingIdentity[0] != clientPlayer) return; + clickingIdentity[1].forEach((element) => { element.delete(); - element.style.transform=''; + element.style.transform = ""; }); delete _status.clickingidentity; - },player); - game.addVideo('showIdentity',player,'zhu'); + }, player); + game.addVideo("showIdentity", player, "zhu"); game.delay(2); player.playerfocus(1000); - event.trigger('zhuUpdate'); - 'step 2' + event.trigger("zhuUpdate"); + "step 2"; player.recover(); player.draw(); - 'step 3' - const skills = player.getStockSkills(true,true).filter(stockSkill=>{ - if(player.hasSkill(stockSkill)) return; - var info=get.info(stockSkill); - if(!info||!info.zhuSkill) return; + "step 3"; + const skills = player.getStockSkills(true, true).filter((stockSkill) => { + if (player.hasSkill(stockSkill)) return; + var info = get.info(stockSkill); + if (!info || !info.zhuSkill) return; return true; }); - if(skills.length) player.addSkills(skills) - } + if (skills.length) player.addSkills(skills); + }, }, - stratagem_revitalization:{ - trigger:{ - player:'dying', + stratagem_revitalization: { + trigger: { + player: "dying", }, - forced:true, - unique:true, - silent:true, - charlotte:true, - ruleSkill:true, - filter:(event,player)=>{ - const storage=player.storage; - return !storage.stratagem_revitalization&&player.ai.stratagemCamouflage&&game.dead.length=2; + forced: true, + unique: true, + silent: true, + charlotte: true, + ruleSkill: true, + filter: (event, player) => { + const storage = player.storage; + return ( + !storage.stratagem_revitalization && + player.ai.stratagemCamouflage && + game.dead.length < Math.max(Math.round(get.population() / 6), 1) && + storage.stratagem_fury >= 2 + ); }, - content:()=>{ - 'step 0' + content: () => { + "step 0"; game.delayx(); - 'step 1' - player.storage.stratagem_revitalization=true; - game.broadcastAll(clientPlayer=>{ - clientPlayer.identityShown=true; - clientPlayer.ai.shown=1; + "step 1"; + player.storage.stratagem_revitalization = true; + game.broadcastAll((clientPlayer) => { + clientPlayer.identityShown = true; + clientPlayer.ai.shown = 1; clientPlayer.setIdentity(); - clientPlayer.node.identity.classList.remove('guessing'); - if(lib.config.animation&&!lib.config.low_performance) clientPlayer.$thunder(); - },player); - game.addVideo('showIdentity',player,'fan'); + clientPlayer.node.identity.classList.remove("guessing"); + if (lib.config.animation && !lib.config.low_performance) clientPlayer.$thunder(); + }, player); + game.addVideo("showIdentity", player, "fan"); game.delay(2); player.playerfocus(800); - 'step 2' - player.changeFury(-player.storage.stratagem_fury,true); - player.discard(player.getCards('hej')); + "step 2"; + player.changeFury(-player.storage.stratagem_fury, true); + player.discard(player.getCards("hej")); player.link(false); player.turnOver(false); - player.recover(2-player.hp); + player.recover(2 - player.hp); player.draw(3); - } - }, - stratagem_expose:{ - trigger:{player:'useCard'}, - forced:true, - silent:true, - popup:false, - filter:(event,player)=>{ - const targets=event.targets; - if(targets.length!=1) return false; - const target=targets[0]; - return target==player&&(target.identityShown||player.storage.zhibi.includes(target)||game.hasPlayer2(current=>{ - if(!current.identityShown) return false; - const storage=current.storage; - return (storage.stratagem_revitalization||storage.stratagem_monarchy)&&storage.stratagem_expose.includes(target); - })); }, - content:()=>{ - var storage=trigger.targets[0].storage; - if(!storage.stratagem_expose) storage.stratagem_expose=[]; + }, + stratagem_expose: { + trigger: { player: "useCard" }, + forced: true, + silent: true, + popup: false, + filter: (event, player) => { + const targets = event.targets; + if (targets.length != 1) return false; + const target = targets[0]; + return ( + target == player && + (target.identityShown || + player.storage.zhibi.includes(target) || + game.hasPlayer2((current) => { + if (!current.identityShown) return false; + const storage = current.storage; + return ( + (storage.stratagem_revitalization || storage.stratagem_monarchy) && + storage.stratagem_expose.includes(target) + ); + })) + ); + }, + content: () => { + var storage = trigger.targets[0].storage; + if (!storage.stratagem_expose) storage.stratagem_expose = []; storage.stratagem_expose.add(player); - } - }, - yexinbilu:{ - enable:'phaseUse', - filter:function(event,player){ - return player.identity=='rYe'||player.identity=='bYe'; }, - skillAnimation:'legend', - animationColor:'thunder', - content:function(){ - game.removeGlobalSkill('yexinbilu'); + }, + yexinbilu: { + enable: "phaseUse", + filter: function (event, player) { + return player.identity == "rYe" || player.identity == "bYe"; + }, + skillAnimation: "legend", + animationColor: "thunder", + content: function () { + game.removeGlobalSkill("yexinbilu"); player.yexinbilu(); }, - ai:{ - order:10, - result:{ - player:function(player){ - return 1-game.countPlayer(function(current){ - return current!=player&&(current.identity=='rYe'||current.identity=='bYe')&&(current==game.me||current.isOnline()); - }) + ai: { + order: 10, + result: { + player: function (player) { + return ( + 1 - + game.countPlayer(function (current) { + return ( + current != player && + (current.identity == "rYe" || current.identity == "bYe") && + (current == game.me || current.isOnline()) + ); + }) + ); }, }, }, }, - identity_junshi:{ - name:'军师', - mark:true, - intro:{ - content:'准备阶段开始时,可以观看牌堆顶的三张牌,然后将这些牌以任意顺序置于牌堆顶或牌堆底' + identity_junshi: { + name: "军师", + mark: true, + intro: { + content: + "准备阶段开始时,可以观看牌堆顶的三张牌,然后将这些牌以任意顺序置于牌堆顶或牌堆底", }, - trigger:{player:'phaseZhunbeiBegin'}, - silent:true, - content:function(){ - "step 0" - var cards=get.cards(3); + trigger: { player: "phaseZhunbeiBegin" }, + silent: true, + content: function () { + "step 0"; + var cards = get.cards(3); game.cardsGotoOrdering(cards); - var next=player.chooseToMove(); - next.set('list',[ - ['牌堆顶',cards], - ['牌堆底'], - ]); - next.set('prompt','观星:点击将牌移动到牌堆顶或牌堆底'); - next.processAI=function(list){ - var cards=list[0][1],player=_status.event.player; - var top=[]; - var judges=player.getCards('j'); - var stopped=false; - if(!player.hasWuxie()){ - for(var i=0;i0; - }).set('ai',function(target){ - var player=_status.event.player; - var att=get.attitude(player,target); + forceunique: true, + content: function () { + "step 0"; + player + .chooseTarget(get.prompt("dongcha"), function (card, player, target) { + return target.countCards("ej") > 0; + }) + .set("ai", function (target) { + var player = _status.event.player; + var att = get.attitude(player, target); - if(att>0){ - var js=target.getCards('j'); - if(js.length){ - var jj=js[0].viewAs?{name:js[0].viewAs}:js[0]; - if(jj.name=='guohe'||js.length>1||get.effect(target,jj,target,player)<0){ - return 2*att; + if (att > 0) { + var js = target.getCards("j"); + if (js.length) { + var jj = js[0].viewAs ? { name: js[0].viewAs } : js[0]; + if ( + jj.name == "guohe" || + js.length > 1 || + get.effect(target, jj, target, player) < 0 + ) { + return 2 * att; + } + } + if ( + target.getEquip("baiyin") && + target.isDamaged() && + get.recoverEffect(target, player, player) > 0 + ) { + if (target.hp == 1 && !target.hujia) return 1.6 * att; + if (target.hp == 2) return 0.01 * att; + return 0; } } - if(target.getEquip('baiyin')&&target.isDamaged()&& - get.recoverEffect(target,player,player)>0){ - if(target.hp==1&&!target.hujia) return 1.6*att; - if(target.hp==2) return 0.01*att; - return 0; - } - } - var es=target.getCards('e'); - var noe=target.hasSkillTag('noe'); - var noe2=(es.length==1&&es[0].name=='baiyin'&&target.isDamaged()); - if(noe||noe2) return 0; - if(att<=0&&!es.length) return 1.5*att; - return -1.5*att; - }); - 'step 1' - if(result.bool){ - event.target=result.targets[0]; + var es = target.getCards("e"); + var noe = target.hasSkillTag("noe"); + var noe2 = es.length == 1 && es[0].name == "baiyin" && target.isDamaged(); + if (noe || noe2) return 0; + if (att <= 0 && !es.length) return 1.5 * att; + return -1.5 * att; + }); + "step 1"; + if (result.bool) { + event.target = result.targets[0]; event.target.addExpose(0.1); - player.logSkill('dongcha',event.target); + player.logSkill("dongcha", event.target); game.delayx(); - } - else{ + } else { event.finish(); } - 'step 2' - if(event.target){ - player.discardPlayerCard('ej',true,event.target); + "step 2"; + if (event.target) { + player.discardPlayerCard("ej", true, event.target); } }, - group:['dongcha_begin','dongcha_log'], - subSkill:{ - begin:{ - trigger:{global:'gameStart'}, - forced:true, - popup:false, - content:function(){ - var list=[]; - for(var i=0;i0; + }, + }, }, - logTarget:'player', - content:function(){ - 'step 0' + }, + sheshen: { + trigger: { global: "dieBefore" }, + forced: true, + unique: true, + forceunique: true, + filter: function (event, player) { + return event.player == game.zhu && player.hp > 0; + }, + logTarget: "player", + content: function () { + "step 0"; trigger.player.gainMaxHp(); - 'step 1' - var dh=player.hp-trigger.player.hp; - if(dh>0){ + "step 1"; + var dh = player.hp - trigger.player.hp; + if (dh > 0) { trigger.player.recover(dh); } - 'step 2' - var cards=player.getCards('he'); - if(cards.length){ - trigger.player.gain(cards,player); - player.$giveAuto(cards,trigger.player); + "step 2"; + var cards = player.getCards("he"); + if (cards.length) { + trigger.player.gain(cards, player); + player.$giveAuto(cards, trigger.player); } - 'step 3' + "step 3"; trigger.cancel(); player.die(); - } - } + }, + }, + }, + help: { + 身份模式: + '
    选项
    • 加强主公
      反贼人数多于2时主公会额外增加一个技能(每个主公的额外技能固定,非常备主公增加天命)' + + '
    • 特殊身份
      • 军师:忠臣身份。只要军师存活,主公在准备阶段开始时,可以观看牌堆顶的三张牌,然后将这些牌以任意顺序置于牌堆顶或牌堆底
      • 大将:忠臣身份。只要大将存活,主公手牌上限+1
      • 贼首:反贼身份,只要贼首存活,主公手牌上限-1
    ' + + "
  • 平民身份
    英盗版三国杀于2017标准版中提出的新概念。平民的获胜条件为:当其他身份的角色达成了其获胜条件,且你存活,你也获胜;同时内奸的获胜条件改为:主公死亡时,场上所有忠臣和反贼均已死亡。即内奸可以和与平民共同胜利。杀死平民的角色的奖惩为:摸两张牌。" + + "
  • 年机制
    英盗版三国杀于2019标准版中提出的新概念。“年”是一个全局概念,游戏开始时为第一年,当牌堆洗牌时,年数+1。一局游戏的限定年数为本局游戏开始时玩家总数。当年数增加后,若当前年数已超过限定年数,则主忠方直接获胜,若平民存活则平民也获胜。", + 明忠模式: + '
    明忠模式(忠胆英杰)
    • 本模式需要8名玩家进行游戏,使用的身份牌为:1主公、2忠臣、4反贼和1内奸。游戏开始时,每名玩家随机获得一个身份,由系统随机选择一名忠臣身份的玩家亮出身份(将忠臣牌正面朝上放在面前),其他身份(包括主公)的玩家不亮出身份。
    • ' + + "首先由亮出身份的忠臣玩家随机获得六张武将牌,挑选一名角色,并将选好的武将牌展示给其他玩家。之后其余每名玩家随机获得三张武将牌,各自从其中挑选一张同时亮出
    • " + + "亮出身份牌的忠臣增加1点体力上限。角色濒死和死亡的结算及胜利条件与普通身份局相同。", + 谋攻模式: + '
      模式命名由来
      • 《谋攻篇》一词出自《孙子兵法·谋攻篇》,是春秋时期兵法家孙武创作的一篇散文。《谋攻篇》故知胜有五:知可以战与不可以战者胜,识众寡之用者胜,上下同欲者胜,以虞待不虞者胜,将能而君不御者胜。
      ' + + '
      游戏规则
      • 谋攻篇模式为六名玩家参与的全暗身份模式,引入新机制“怒气”,玩家可以消耗怒气探查其他角色的身份是敌人或者队友,或使用怒气强化手牌,以达到识别出队友并击杀敌人的目标。' + + "
      • 各身份玩家的胜利条件与身份局中对应身份的胜利条件一致,且该模式下没有奖惩。" + + "
      • 当主公进入濒死、场上有两名角色阵亡、第三轮的主公准备阶段,主公将会翻开身份牌,回复1点体力并摸一张牌,并获得武将牌上的主公技。" + + "
      • 内奸在游戏开始时将会得知一名反贼的身份,并令该反贼被“伪装”。本局游戏内,被“伪装”的反贼在被任何人探查身份时,结果都提示为“敌人”。作为补偿,其第一次进入濒死时,若场上没有角色死亡且其怒气值不小于2,其弃置区域内所有牌,重置武将牌,将体力回复至2点并摸三张牌。" + + "
      • 特殊地,内奸在被所有角色探查时,都提示为“队友”;内奸在进行探查时,直接得知目标的身份。
      " + + '
      新机制“怒气”
      • 一名角色在回合开始时或受到1点伤害后,将获得1点怒气;怒气上限为3。
      • 一名角色令其他角色扣减体力后,该角色可以消耗1点怒气,查探扣减体力的角色是敌或友。
      ' + + '
      强化卡牌规则
      • 在第二轮游戏开始后,当你需要使用一张“强化表”内的牌时,你可以通过消耗怒气将此牌强化。' + + '
      • 可强化卡牌
          ' + + "
        • 【杀】:消耗1点怒气进行强化,你令响应此杀所需使用的【闪】数+1" + + "
        • 【闪】:消耗1点怒气进行强化,使用时视为两张【闪】的效果" + + "
        • 【决斗】:消耗2点怒气进行强化,对此牌的目标造成伤害时,伤害+1" + + "
        • 【火攻】:消耗2点怒气进行强化,造成的伤害+1" + + "
        • 【桃】:消耗3点怒气进行强化,回复的体力+1
      ", + "3v3v2": + '
      3v3v2模式
      • 游戏准备
        本模式需要8名玩家进行游戏。游戏开始前,所有玩家随机分成两组,每组四人,分别称为「冷色阵营」和「暖色阵营」,然后分发身份牌,抽取到「主帅」身份的玩家亮出身份牌。' + + "
      • 身份牌
        每组的身份分为四种。
        主帅(主)和前锋(忠):联合对方阵营的细作,击杀己方细作,对方阵营的主帅和前锋以及所有的野心家。
        细作(内):帮助对方阵营的主帅和前锋,击杀对方细作,己方阵营的主帅和前锋以及所有的野心家。
        野心家(野):联合对方阵营中的野心家,击杀所有其他角色,成为最后的生还者。
        " + + "
      • 胜负判定
        冷色主帅,先锋和暖色细作在所有野心家和对方主帅全部阵亡后视为胜利,在冷色主帅阵亡后视为游戏失败。
        暖色主帅,先锋和冷色细作在所有野心家和对方主帅阵亡后视为胜利,在暖色主帅阵亡后视为失败。
        野心家在所有不为野心家的角色阵亡后视为胜利,在双方主帅全部阵亡而有非野心家角色存活时失败。
        当有角色阵亡后,若有角色满足胜利条件,游戏结束。若所有角色均满足失败条件,则游戏平局。若一名角色满足失败条件,即使其满足胜利条件,也视为游戏失败。
        " + + "
      • 游戏流程
        在「游戏准备」中的工作完成后,冷色主帅选择一个势力,然后暖色主帅选择一个其他势力,作为双方各自的势力将池。
        双方主帅从各自的势力将池中获得两张常备主公武将牌和四张非常备主公武将牌,然后选择一张作为武将牌,将其他的武将牌放回势力将池并洗混。然后双方的其他玩家从各自的势力将池中随机获得五张武将牌,选择一张作为自己的武将牌。
        暖色主帅成为游戏的一号位,双方主帅各加1点体力和体力上限。七号位和八号位的起始手牌+1。
        当场上第一次有玩家死亡时,野心家确认彼此的身份牌,然后获得技能〖野心毕露〗:出牌阶段,你可以明置身份牌,加1点体力上限和体力值。若如此做,所有的野心家失去技能〖野心毕露〗
        " + + "
      • 击杀奖惩
        杀死颜色不同的主帅的角色回复1点体力,杀死颜色不同的先锋的角色摸两张牌,杀死颜色相同的细作的角色摸三张牌,杀死颜色相同的先锋的主帅弃置所有手牌。
        " + + "
      • 制作团队
        游戏出品:紫星居
        游戏设计:食茸貳拾肆
        游戏开发:食茸貳拾肆、紫髯的小乔、聆星Mine、空城琴音依旧弥漫、丽景原同志、雪之彩翼、拉普拉斯、明月照沟渠
        程序化:无名杀
        鸣谢:荆哲、魔风、萨巴鲁酱、这就是秋夜
    ", }, - help:{ - '身份模式':'
    选项
    • 加强主公
      反贼人数多于2时主公会额外增加一个技能(每个主公的额外技能固定,非常备主公增加天命)'+ - '
    • 特殊身份
      • 军师:忠臣身份。只要军师存活,主公在准备阶段开始时,可以观看牌堆顶的三张牌,然后将这些牌以任意顺序置于牌堆顶或牌堆底
      • 大将:忠臣身份。只要大将存活,主公手牌上限+1
      • 贼首:反贼身份,只要贼首存活,主公手牌上限-1
    '+ - '
  • 平民身份
    英盗版三国杀于2017标准版中提出的新概念。平民的获胜条件为:当其他身份的角色达成了其获胜条件,且你存活,你也获胜;同时内奸的获胜条件改为:主公死亡时,场上所有忠臣和反贼均已死亡。即内奸可以和与平民共同胜利。杀死平民的角色的奖惩为:摸两张牌。'+ - '
  • 年机制
    英盗版三国杀于2019标准版中提出的新概念。“年”是一个全局概念,游戏开始时为第一年,当牌堆洗牌时,年数+1。一局游戏的限定年数为本局游戏开始时玩家总数。当年数增加后,若当前年数已超过限定年数,则主忠方直接获胜,若平民存活则平民也获胜。', - '明忠模式':'
    明忠模式(忠胆英杰)
    • 本模式需要8名玩家进行游戏,使用的身份牌为:1主公、2忠臣、4反贼和1内奸。游戏开始时,每名玩家随机获得一个身份,由系统随机选择一名忠臣身份的玩家亮出身份(将忠臣牌正面朝上放在面前),其他身份(包括主公)的玩家不亮出身份。
    • '+ - '首先由亮出身份的忠臣玩家随机获得六张武将牌,挑选一名角色,并将选好的武将牌展示给其他玩家。之后其余每名玩家随机获得三张武将牌,各自从其中挑选一张同时亮出
    • '+ - '亮出身份牌的忠臣增加1点体力上限。角色濒死和死亡的结算及胜利条件与普通身份局相同。', - '谋攻模式':'
      模式命名由来
      • 《谋攻篇》一词出自《孙子兵法·谋攻篇》,是春秋时期兵法家孙武创作的一篇散文。《谋攻篇》故知胜有五:知可以战与不可以战者胜,识众寡之用者胜,上下同欲者胜,以虞待不虞者胜,将能而君不御者胜。
      '+ - '
      游戏规则
      • 谋攻篇模式为六名玩家参与的全暗身份模式,引入新机制“怒气”,玩家可以消耗怒气探查其他角色的身份是敌人或者队友,或使用怒气强化手牌,以达到识别出队友并击杀敌人的目标。'+ - '
      • 各身份玩家的胜利条件与身份局中对应身份的胜利条件一致,且该模式下没有奖惩。'+ - '
      • 当主公进入濒死、场上有两名角色阵亡、第三轮的主公准备阶段,主公将会翻开身份牌,回复1点体力并摸一张牌,并获得武将牌上的主公技。'+ - '
      • 内奸在游戏开始时将会得知一名反贼的身份,并令该反贼被“伪装”。本局游戏内,被“伪装”的反贼在被任何人探查身份时,结果都提示为“敌人”。作为补偿,其第一次进入濒死时,若场上没有角色死亡且其怒气值不小于2,其弃置区域内所有牌,重置武将牌,将体力回复至2点并摸三张牌。'+ - '
      • 特殊地,内奸在被所有角色探查时,都提示为“队友”;内奸在进行探查时,直接得知目标的身份。
      '+ - '
      新机制“怒气”
      • 一名角色在回合开始时或受到1点伤害后,将获得1点怒气;怒气上限为3。
      • 一名角色令其他角色扣减体力后,该角色可以消耗1点怒气,查探扣减体力的角色是敌或友。
      '+ - '
      强化卡牌规则
      • 在第二轮游戏开始后,当你需要使用一张“强化表”内的牌时,你可以通过消耗怒气将此牌强化。'+ - '
      • 可强化卡牌
          '+ - '
        • 【杀】:消耗1点怒气进行强化,你令响应此杀所需使用的【闪】数+1'+ - '
        • 【闪】:消耗1点怒气进行强化,使用时视为两张【闪】的效果'+ - '
        • 【决斗】:消耗2点怒气进行强化,对此牌的目标造成伤害时,伤害+1'+ - '
        • 【火攻】:消耗2点怒气进行强化,造成的伤害+1'+ - '
        • 【桃】:消耗3点怒气进行强化,回复的体力+1
      ', - '3v3v2':'
      3v3v2模式
      • 游戏准备
        本模式需要8名玩家进行游戏。游戏开始前,所有玩家随机分成两组,每组四人,分别称为「冷色阵营」和「暖色阵营」,然后分发身份牌,抽取到「主帅」身份的玩家亮出身份牌。'+ - '
      • 身份牌
        每组的身份分为四种。
        主帅(主)和前锋(忠):联合对方阵营的细作,击杀己方细作,对方阵营的主帅和前锋以及所有的野心家。
        细作(内):帮助对方阵营的主帅和前锋,击杀对方细作,己方阵营的主帅和前锋以及所有的野心家。
        野心家(野):联合对方阵营中的野心家,击杀所有其他角色,成为最后的生还者。
        '+ - '
      • 胜负判定
        冷色主帅,先锋和暖色细作在所有野心家和对方主帅全部阵亡后视为胜利,在冷色主帅阵亡后视为游戏失败。
        暖色主帅,先锋和冷色细作在所有野心家和对方主帅阵亡后视为胜利,在暖色主帅阵亡后视为失败。
        野心家在所有不为野心家的角色阵亡后视为胜利,在双方主帅全部阵亡而有非野心家角色存活时失败。
        当有角色阵亡后,若有角色满足胜利条件,游戏结束。若所有角色均满足失败条件,则游戏平局。若一名角色满足失败条件,即使其满足胜利条件,也视为游戏失败。
        '+ - '
      • 游戏流程
        在「游戏准备」中的工作完成后,冷色主帅选择一个势力,然后暖色主帅选择一个其他势力,作为双方各自的势力将池。
        双方主帅从各自的势力将池中获得两张常备主公武将牌和四张非常备主公武将牌,然后选择一张作为武将牌,将其他的武将牌放回势力将池并洗混。然后双方的其他玩家从各自的势力将池中随机获得五张武将牌,选择一张作为自己的武将牌。
        暖色主帅成为游戏的一号位,双方主帅各加1点体力和体力上限。七号位和八号位的起始手牌+1。
        当场上第一次有玩家死亡时,野心家确认彼此的身份牌,然后获得技能〖野心毕露〗:出牌阶段,你可以明置身份牌,加1点体力上限和体力值。若如此做,所有的野心家失去技能〖野心毕露〗
        '+'
      • 击杀奖惩
        杀死颜色不同的主帅的角色回复1点体力,杀死颜色不同的先锋的角色摸两张牌,杀死颜色相同的细作的角色摸三张牌,杀死颜色相同的先锋的主帅弃置所有手牌。
        '+ - '
      • 制作团队
        游戏出品:紫星居
        游戏设计:食茸貳拾肆
        游戏开发:食茸貳拾肆、紫髯的小乔、聆星Mine、空城琴音依旧弥漫、丽景原同志、雪之彩翼、拉普拉斯、明月照沟渠
        程序化:无名杀
        鸣谢:荆哲、魔风、萨巴鲁酱、这就是秋夜
    ', - } }; }); diff --git a/mode/realtime.js b/mode/realtime.js index fb2f2ab9d..d8d9c1642 100644 --- a/mode/realtime.js +++ b/mode/realtime.js @@ -1,10 +1,8 @@ -'use strict'; -game.import('mode',function(lib,game,ui,get,ai,_status){ - return { - name:'realtime', - start:function(){ - }, - game:{ - } - }; -}); +"use strict"; +game.import("mode", function (lib, game, ui, get, ai, _status) { + return { + name: "realtime", + start: function () {}, + game: {}, + }; +}); diff --git a/mode/single.js b/mode/single.js index 9ee0a27fa..94e4ba69f 100644 --- a/mode/single.js +++ b/mode/single.js @@ -1,1884 +1,2284 @@ -'use strict'; -game.import('mode',function(lib,game,ui,get,ai,_status){ +"use strict"; +game.import("mode", function (lib, game, ui, get, ai, _status) { return { - name:'single', - changbanCharacter:[ - "key_rei","key_yoshino","key_noda","key_nagisa", - "re_caocao","re_caozhang","re_diaochan","re_ganning","re_gongsunzan","re_guojia","re_huangyueying","re_lidian","re_lvbu", - "re_simayi","sunquan","re_xiahoudun","re_xushu","yuanshu","xf_yiji","re_zhangfei","re_zhangliao","re_xuzhu", - "re_zhaoyun","re_zhouyu","re_zhugeliang","ol_xiahouyuan","re_huangzhong","re_weiyan","dianwei","te_yanwen","re_pangde", - "re_zhurong","re_sunjian","jiaxu","dengai","re_jiangwei","re_sunben","wangji","wangping","guanqiujian","chendao","ol_yujin", - "re_caozhi","xin_masu","re_lingtong","xusheng","re_gaoshun","xunyou","guanzhang","madai","handang","caochong", - "re_guohuai","guanping","liufeng","re_zhuran","xin_liru","hanhaoshihuan","guyong","zhuhuan","caoxiu","liuchen","re_zhangyi", - "re_quancong","sunxiu","sundeng","guohuanghou","re_jikang","xuezong","qinmi","lvdai","re_zhangliang","lingcao", - "sunru","zhuling","sp_caoren","fanchou","fuwan","sp_ganning","guanyinping","guosi","heqi","sp_jiangwei","litong", - "re_panfeng","sp_pangde","xf_sufei","xf_tangzi","xiahouba","xujing","yuejin","sp_zhangfei","zhangji","zhangyì","dongcheng", + name: "single", + changbanCharacter: [ + "key_rei", + "key_yoshino", + "key_noda", + "key_nagisa", + "re_caocao", + "re_caozhang", + "re_diaochan", + "re_ganning", + "re_gongsunzan", + "re_guojia", + "re_huangyueying", + "re_lidian", + "re_lvbu", + "re_simayi", + "sunquan", + "re_xiahoudun", + "re_xushu", + "yuanshu", + "xf_yiji", + "re_zhangfei", + "re_zhangliao", + "re_xuzhu", + "re_zhaoyun", + "re_zhouyu", + "re_zhugeliang", + "ol_xiahouyuan", + "re_huangzhong", + "re_weiyan", + "dianwei", + "te_yanwen", + "re_pangde", + "re_zhurong", + "re_sunjian", + "jiaxu", + "dengai", + "re_jiangwei", + "re_sunben", + "wangji", + "wangping", + "guanqiujian", + "chendao", + "ol_yujin", + "re_caozhi", + "xin_masu", + "re_lingtong", + "xusheng", + "re_gaoshun", + "xunyou", + "guanzhang", + "madai", + "handang", + "caochong", + "re_guohuai", + "guanping", + "liufeng", + "re_zhuran", + "xin_liru", + "hanhaoshihuan", + "guyong", + "zhuhuan", + "caoxiu", + "liuchen", + "re_zhangyi", + "re_quancong", + "sunxiu", + "sundeng", + "guohuanghou", + "re_jikang", + "xuezong", + "qinmi", + "lvdai", + "re_zhangliang", + "lingcao", + "sunru", + "zhuling", + "sp_caoren", + "fanchou", + "fuwan", + "sp_ganning", + "guanyinping", + "guosi", + "heqi", + "sp_jiangwei", + "litong", + "re_panfeng", + "sp_pangde", + "xf_sufei", + "xf_tangzi", + "xiahouba", + "xujing", + "yuejin", + "sp_zhangfei", + "zhangji", + "zhangyì", + "dongcheng", ], - singlePile:[ - ['spade',5,'sha'], - ['spade',7,'sha'], - ['spade',8,'sha'], - ['spade',10,'sha'], - ['heart',10,'sha'], - ['heart',11,'sha'], - ['club',4,'sha'], - ['club',5,'sha'], - ['club',6,'sha'], - ['club',8,'sha'], - ['club',9,'sha'], - ['club',10,'sha'], - ['club',11,'sha'], - ['diamond',6,'sha'], - ['diamond',9,'sha'], - ['diamond',11,'sha'], - ['heart',2,'shan'], - ['heart',5,'shan'], - ['diamond',2,'shan'], - ['diamond',3,'shan'], - ['diamond',7,'shan'], - ['diamond',8,'shan'], - ['diamond',10,'shan'], - ['diamond',11,'shan'], - ['heart',3,'tao'], - ['heart',4,'tao'], - ['heart',9,'tao'], - ['diamond',12,'tao'], - ['club',12,'bingliang'], - ['spade',3,'guohe'], - ['diamond',12,'guohe'], - ['club',3,'guohe'], - ['club',1,'juedou'], - ['spade',1,'juedou'], - ['heart',6,'lebu'], - ['spade',1,'nanman'], - ['club',7,'shuiyanqijunx'], - ['spade',4,'shunshou'], - ['spade',11,'shunshou'], - ['diamond',4,'shunshou'], - ['heart',1,'wanjian'], - ['heart',5,'wuxie'], - ['club',5,'wuxie'], - ['heart',7,'wuzhong'], - ['heart',8,'wuzhong'], - ['diamond',5,'guanshi'], - ['spade',9,'hanbing'], - ['spade',6,'qinggang'], - ['spade',12,'zhangba'], - ['diamond',1,'zhuge'], - ['spade',2,'bagua'], - ['club',2,'renwang'], + singlePile: [ + ["spade", 5, "sha"], + ["spade", 7, "sha"], + ["spade", 8, "sha"], + ["spade", 10, "sha"], + ["heart", 10, "sha"], + ["heart", 11, "sha"], + ["club", 4, "sha"], + ["club", 5, "sha"], + ["club", 6, "sha"], + ["club", 8, "sha"], + ["club", 9, "sha"], + ["club", 10, "sha"], + ["club", 11, "sha"], + ["diamond", 6, "sha"], + ["diamond", 9, "sha"], + ["diamond", 11, "sha"], + ["heart", 2, "shan"], + ["heart", 5, "shan"], + ["diamond", 2, "shan"], + ["diamond", 3, "shan"], + ["diamond", 7, "shan"], + ["diamond", 8, "shan"], + ["diamond", 10, "shan"], + ["diamond", 11, "shan"], + ["heart", 3, "tao"], + ["heart", 4, "tao"], + ["heart", 9, "tao"], + ["diamond", 12, "tao"], + ["club", 12, "bingliang"], + ["spade", 3, "guohe"], + ["diamond", 12, "guohe"], + ["club", 3, "guohe"], + ["club", 1, "juedou"], + ["spade", 1, "juedou"], + ["heart", 6, "lebu"], + ["spade", 1, "nanman"], + ["club", 7, "shuiyanqijunx"], + ["spade", 4, "shunshou"], + ["spade", 11, "shunshou"], + ["diamond", 4, "shunshou"], + ["heart", 1, "wanjian"], + ["heart", 5, "wuxie"], + ["club", 5, "wuxie"], + ["heart", 7, "wuzhong"], + ["heart", 8, "wuzhong"], + ["diamond", 5, "guanshi"], + ["spade", 9, "hanbing"], + ["spade", 6, "qinggang"], + ["spade", 12, "zhangba"], + ["diamond", 1, "zhuge"], + ["spade", 2, "bagua"], + ["club", 2, "renwang"], ], - singlePile_wuxianhuoli:[ - ['heart',1,'wanjian'], - ['heart',2,'shan'], - ['heart',2,'huogong'], - ['heart',3,'tao'], - ['heart',3,'huogong'], - ['heart',4,'tao'], - ['heart',4,'sha','fire'], - ['heart',6,'tao'], - ['heart',7,'sha','fire'], - ['heart',7,'wuzhong'], - ['heart',8,'wuzhong'], - ['heart',9,'wuzhong'], - ['heart',10,'sha'], - ['heart',10,'sha'], - ['heart',10,'sha','fire'], - ['heart',12,'guohe'], - ['heart',12,'shandian'], - ['heart',13,'shan'], + singlePile_wuxianhuoli: [ + ["heart", 1, "wanjian"], + ["heart", 2, "shan"], + ["heart", 2, "huogong"], + ["heart", 3, "tao"], + ["heart", 3, "huogong"], + ["heart", 4, "tao"], + ["heart", 4, "sha", "fire"], + ["heart", 6, "tao"], + ["heart", 7, "sha", "fire"], + ["heart", 7, "wuzhong"], + ["heart", 8, "wuzhong"], + ["heart", 9, "wuzhong"], + ["heart", 10, "sha"], + ["heart", 10, "sha"], + ["heart", 10, "sha", "fire"], + ["heart", 12, "guohe"], + ["heart", 12, "shandian"], + ["heart", 13, "shan"], - ['diamond',1,'juedou'], - ['diamond',1,'zhuge'], - ['diamond',1,'zhuque'], - ['diamond',3,'shunshou'], - ['diamond',4,'shunshou'], - ['diamond',5,'guanshi'], - ['diamond',6,'sha'], - ['diamond',6,'shan'], - ['diamond',7,'sha'], - ['diamond',7,'shan'], - ['diamond',8,'sha'], - ['diamond',8,'shan'], - ['diamond',9,'sha'], - ['diamond',9,'shan'], - ['diamond',9,'jiu'], - ['diamond',10,'shan'], - ['diamond',11,'shan'], - ['diamond',12,'tao'], - ['diamond',12,'wuxie'], - ['diamond',12,'huogong'], + ["diamond", 1, "juedou"], + ["diamond", 1, "zhuge"], + ["diamond", 1, "zhuque"], + ["diamond", 3, "shunshou"], + ["diamond", 4, "shunshou"], + ["diamond", 5, "guanshi"], + ["diamond", 6, "sha"], + ["diamond", 6, "shan"], + ["diamond", 7, "sha"], + ["diamond", 7, "shan"], + ["diamond", 8, "sha"], + ["diamond", 8, "shan"], + ["diamond", 9, "sha"], + ["diamond", 9, "shan"], + ["diamond", 9, "jiu"], + ["diamond", 10, "shan"], + ["diamond", 11, "shan"], + ["diamond", 12, "tao"], + ["diamond", 12, "wuxie"], + ["diamond", 12, "huogong"], - ['club',1,'juedou'], - ['club',1,'baiyin'], - ['club',2,'sha'], - ['club',2,'bagua'], - ['club',2,'renwang'], - ['club',3,'sha'], - ['club',3,'guohe'], - ['club',4,'sha'], - ['club',5,'sha'], - ['club',5,'sha','thunder'], - ['club',6,'sha'], - ['club',6,'sha','thunder'], - ['club',7,'sha'], - ['club',7,'sha','thunder'], - ['club',7,'nanman'], - ['club',8,'sha'], - ['club',9,'sha'], - ['club',9,'jiu'], - ['club',12,'wuxie'], - ['club',13,'wuxie'], + ["club", 1, "juedou"], + ["club", 1, "baiyin"], + ["club", 2, "sha"], + ["club", 2, "bagua"], + ["club", 2, "renwang"], + ["club", 3, "sha"], + ["club", 3, "guohe"], + ["club", 4, "sha"], + ["club", 5, "sha"], + ["club", 5, "sha", "thunder"], + ["club", 6, "sha"], + ["club", 6, "sha", "thunder"], + ["club", 7, "sha"], + ["club", 7, "sha", "thunder"], + ["club", 7, "nanman"], + ["club", 8, "sha"], + ["club", 9, "sha"], + ["club", 9, "jiu"], + ["club", 12, "wuxie"], + ["club", 13, "wuxie"], - ['spade',1,'juedou'], - ['spade',1,'guding'], - ['spade',2,'cixiong'], - ['spade',2,'hanbing'], - ['spade',2,'tengjia'], - ['spade',3,'shunshou'], - ['spade',4,'sha','thunder'], - ['spade',4,'guohe'], - ['spade',4,'shunshou'], - ['spade',5,'sha','thunder'], - ['spade',5,'qinglong'], - ['spade',6,'sha','thunder'], - ['spade',6,'qinggang'], - ['spade',7,'sha'], - ['spade',7,'sha','thunder'], - ['spade',8,'sha'], - ['spade',8,'sha'], - ['spade',8,'sha','thunder'], - ['spade',9,'sha'], - ['spade',9,'jiu'], - ['spade',10,'sha'], - ['spade',10,'bingliang'], - ['spade',11,'wuxie'], - ['spade',12,'guohe'], - ['spade',12,'zhangba'], - ['spade',13,'nanman'], + ["spade", 1, "juedou"], + ["spade", 1, "guding"], + ["spade", 2, "cixiong"], + ["spade", 2, "hanbing"], + ["spade", 2, "tengjia"], + ["spade", 3, "shunshou"], + ["spade", 4, "sha", "thunder"], + ["spade", 4, "guohe"], + ["spade", 4, "shunshou"], + ["spade", 5, "sha", "thunder"], + ["spade", 5, "qinglong"], + ["spade", 6, "sha", "thunder"], + ["spade", 6, "qinggang"], + ["spade", 7, "sha"], + ["spade", 7, "sha", "thunder"], + ["spade", 8, "sha"], + ["spade", 8, "sha"], + ["spade", 8, "sha", "thunder"], + ["spade", 9, "sha"], + ["spade", 9, "jiu"], + ["spade", 10, "sha"], + ["spade", 10, "bingliang"], + ["spade", 11, "wuxie"], + ["spade", 12, "guohe"], + ["spade", 12, "zhangba"], + ["spade", 13, "nanman"], ], - characterSingle:{ - caocao:['male','wei',4,['jianxiong'],['zhu']], - simayi:['male','wei',3,['fankui','guicai']], - xiahoudun:['male','wei',4,['ganglie']], - zhangliao:['male','wei',4,['retuxi']], - xuzhu:['male','wei',4,['luoyi','xiechan']], - guojia:['male','wei',3,['tiandu','yiji']], - zhenji:['female','wei',3,['luoshen','sgqingguo']], - liubei:['male','shu',4,['sgrenwang'],['zhu']], - guanyu:['male','shu',4,['wusheng','huwei']], - zhangfei:['male','shu',4,['paoxiao']], - zhugeliang:['male','shu',3,['guanxing','kongcheng']], - zhaoyun:['male','shu',4,['longdan']], - machao:['male','shu',4,['xiaoxi','tieji']], - huangyueying:['female','shu',3,['jizhi','cangji']], - sunquan:['male','wu',4,['sgzhiheng'],['zhu']], - ganning:['male','wu',4,['qixi']], - lvmeng:['male','wu',4,['shenju','botu']], - huanggai:['male','wu',4,['kurou']], - zhouyu:['male','wu',3,['yingzi','fanjian']], - daqiao:['female','wu',3,['guose','wanrong']], - luxun:['male','wu',3,['qianxun','lianying']], - sunshangxiang:['female','wu',3,['xiaoji','yinli']], + characterSingle: { + caocao: ["male", "wei", 4, ["jianxiong"], ["zhu"]], + simayi: ["male", "wei", 3, ["fankui", "guicai"]], + xiahoudun: ["male", "wei", 4, ["ganglie"]], + zhangliao: ["male", "wei", 4, ["retuxi"]], + xuzhu: ["male", "wei", 4, ["luoyi", "xiechan"]], + guojia: ["male", "wei", 3, ["tiandu", "yiji"]], + zhenji: ["female", "wei", 3, ["luoshen", "sgqingguo"]], + liubei: ["male", "shu", 4, ["sgrenwang"], ["zhu"]], + guanyu: ["male", "shu", 4, ["wusheng", "huwei"]], + zhangfei: ["male", "shu", 4, ["paoxiao"]], + zhugeliang: ["male", "shu", 3, ["guanxing", "kongcheng"]], + zhaoyun: ["male", "shu", 4, ["longdan"]], + machao: ["male", "shu", 4, ["xiaoxi", "tieji"]], + huangyueying: ["female", "shu", 3, ["jizhi", "cangji"]], + sunquan: ["male", "wu", 4, ["sgzhiheng"], ["zhu"]], + ganning: ["male", "wu", 4, ["qixi"]], + lvmeng: ["male", "wu", 4, ["shenju", "botu"]], + huanggai: ["male", "wu", 4, ["kurou"]], + zhouyu: ["male", "wu", 3, ["yingzi", "fanjian"]], + daqiao: ["female", "wu", 3, ["guose", "wanrong"]], + luxun: ["male", "wu", 3, ["qianxun", "lianying"]], + sunshangxiang: ["female", "wu", 3, ["xiaoji", "yinli"]], //huatuo:['male','qun',3,['qingnang','jijiu']], - lvbu:['male','qun',4,['wushuang']], - diaochan:['female','qun',3,['pianyi','biyue']], + lvbu: ["male", "qun", 4, ["wushuang"]], + diaochan: ["female", "qun", 3, ["pianyi", "biyue"]], - xiahouyuan:['male','wei',4,['shensu','suzi']], - old_caoren:['male','wei',4,['jushou']], - huangzhong:['male','shu',4,['liegong']], - weiyan:['male','shu',4,['sgkuanggu']], - xiaoqiao:['female','wu',3,['tianxiang','hongyan']], - old_zhoutai:['male','wu',4,['gzbuqu']], - zhangjiao:['male','qun',3,['leiji','guidao'],['zhu']], + xiahouyuan: ["male", "wei", 4, ["shensu", "suzi"]], + old_caoren: ["male", "wei", 4, ["jushou"]], + huangzhong: ["male", "shu", 4, ["liegong"]], + weiyan: ["male", "shu", 4, ["sgkuanggu"]], + xiaoqiao: ["female", "wu", 3, ["tianxiang", "hongyan"]], + old_zhoutai: ["male", "wu", 4, ["gzbuqu"]], + zhangjiao: ["male", "qun", 3, ["leiji", "guidao"], ["zhu"]], - dianwei:['male','wei',4,['qiangxi']], - yanwen:['male','qun',4,['shuangxiong']], - pangde:['male','qun',4,['xiaoxi','mengjin']], + dianwei: ["male", "wei", 4, ["qiangxi"]], + yanwen: ["male", "qun", 4, ["shuangxiong"]], + pangde: ["male", "qun", 4, ["xiaoxi", "mengjin"]], - menghuo:['male','shu',4,['manyi','zaiqi']], - zhurong:['female','shu',4,['manyi','lieren']], - xuhuang:['male','wei',4,['sgduanliang']], - sunjian:['male','wu',4,['gzyinghun']], + menghuo: ["male", "shu", 4, ["manyi", "zaiqi"]], + zhurong: ["female", "shu", 4, ["manyi", "lieren"]], + xuhuang: ["male", "wei", 4, ["sgduanliang"]], + sunjian: ["male", "wu", 4, ["gzyinghun"]], - jiangwei:['male','shu',4,['tiaoxin']], + jiangwei: ["male", "shu", 4, ["tiaoxin"]], - hejin:['male','qun',4,['mouzhu','yanhuo']], - hansui:['male','qun',4,['xiaoxi','niluan']], - niujin:['male','wei',4,['cuorui','liewei']], + hejin: ["male", "qun", 4, ["mouzhu", "yanhuo"]], + hansui: ["male", "qun", 4, ["xiaoxi", "niluan"]], + niujin: ["male", "wei", 4, ["cuorui", "liewei"]], - jin_zhangchunhua:['female','jin',3,['huishi','qingleng']], - jin_simayi:['male','jin',3,['smyyingshi','xiongzhi','quanbian']], - jin_wangyuanji:['female','jin',3,['yanxi']], - jin_simazhao:['male','jin',3,['choufa','zhaoran']], - jin_xiahouhui:['female','jin',3,['jyishi','shiduo']], - jin_simashi:['male','jin','3/4',['yimie','tairan']], - zhanghuyuechen:['male','jin',4,['xijue']], - duyu:['male','jin',4,['sanchen','zhaotao']], + jin_zhangchunhua: ["female", "jin", 3, ["huishi", "qingleng"]], + jin_simayi: ["male", "jin", 3, ["smyyingshi", "xiongzhi", "quanbian"]], + jin_wangyuanji: ["female", "jin", 3, ["yanxi"]], + jin_simazhao: ["male", "jin", 3, ["choufa", "zhaoran"]], + jin_xiahouhui: ["female", "jin", 3, ["jyishi", "shiduo"]], + jin_simashi: ["male", "jin", "3/4", ["yimie", "tairan"]], + zhanghuyuechen: ["male", "jin", 4, ["xijue"]], + duyu: ["male", "jin", 4, ["sanchen", "zhaotao"]], }, - startBefore:function(){ - - }, - onreinit:function(){ - _status.mode=_status.connectMode?lib.configOL.single_mode:get.config('single_mode'); - if(_status.mode!='normal') return; - for(var i in lib.characterSingle){ - lib.character[i]=lib.characterSingle[i]; - if(!lib.character[i][4]){ - lib.character[i][4]=[]; + startBefore: function () {}, + onreinit: function () { + _status.mode = _status.connectMode ? lib.configOL.single_mode : get.config("single_mode"); + if (_status.mode != "normal") return; + for (var i in lib.characterSingle) { + lib.character[i] = lib.characterSingle[i]; + if (!lib.character[i][4]) { + lib.character[i][4] = []; } } - for(var j in lib.singleTranslate) lib.translate[j]=lib.singleTranslate[j]; + for (var j in lib.singleTranslate) lib.translate[j] = lib.singleTranslate[j]; }, - start:function(){ - "step 0" - _status.mode=_status.connectMode?lib.configOL.single_mode:get.config('single_mode'); - var playback=localStorage.getItem(lib.configprefix+'playback'); - if(playback){ + start: function () { + "step 0"; + _status.mode = _status.connectMode ? lib.configOL.single_mode : get.config("single_mode"); + var playback = localStorage.getItem(lib.configprefix + "playback"); + if (playback) { ui.create.me(); - ui.arena.style.display='none'; - ui.system.style.display='none'; - _status.playback=playback; - localStorage.removeItem(lib.configprefix+'playback'); - var store=lib.db.transaction(['video'],'readwrite').objectStore('video'); - store.get(parseInt(playback)).onsuccess=function(e){ - if(e.target.result){ + ui.arena.style.display = "none"; + ui.system.style.display = "none"; + _status.playback = playback; + localStorage.removeItem(lib.configprefix + "playback"); + var store = lib.db.transaction(["video"], "readwrite").objectStore("video"); + store.get(parseInt(playback)).onsuccess = function (e) { + if (e.target.result) { game.playVideoContent(e.target.result.video); - } - else{ - alert('播放失败:找不到录像'); + } else { + alert("播放失败:找不到录像"); game.reload(); } - } + }; event.finish(); - } - else if(!_status.connectMode){ + } else if (!_status.connectMode) { game.prepareArena(2); } - "step 1" - if(_status.connectMode){ - game.waitForPlayer(function(){ - lib.configOL.number=2; + "step 1"; + if (_status.connectMode) { + game.waitForPlayer(function () { + lib.configOL.number = 2; }); } - "step 2" - if(_status.mode=='normal'){ - lib.card.list=lib.singlePile.slice(0); - game.fixedPile=true; - game.broadcastAll(function(singleTranslate,characterSingle,jin){ - _status.mode='normal'; - for(var j in singleTranslate) lib.translate[j]=singleTranslate[j]; - _status.characterlist=[]; - for(var i in characterSingle){ - if(!jin&&characterSingle[i][1]=='jin') continue; - lib.character[i]=characterSingle[i]; - if(!lib.character[i][4]){ - lib.character[i][4]=[]; + "step 2"; + if (_status.mode == "normal") { + lib.card.list = lib.singlePile.slice(0); + game.fixedPile = true; + game.broadcastAll( + function (singleTranslate, characterSingle, jin) { + _status.mode = "normal"; + for (var j in singleTranslate) lib.translate[j] = singleTranslate[j]; + _status.characterlist = []; + for (var i in characterSingle) { + if (!jin && characterSingle[i][1] == "jin") continue; + lib.character[i] = characterSingle[i]; + if (!lib.character[i][4]) { + lib.character[i][4] = []; + } + _status.characterlist.push(i); } - _status.characterlist.push(i); - } - },lib.singleTranslate,lib.characterSingle,_status.connectMode?lib.configOL.enable_jin:get.config('enable_jin')); - } - else if(_status.mode=='changban'){ - _status.characterlist=[]; - for(var i=0;i_status.characterlist=list,list); + _status.characterlist = list; + game.broadcast((list) => (_status.characterlist = list), list); } - if(_status.connectMode){ - lib.configOL.number=2; + if (_status.connectMode) { + lib.configOL.number = 2; game.randomMapOL(); - } - else{ - for(var i=0;icurrent.showGiveup(),true); + game.countPlayer((current) => current.showGiveup(), true); }, - game:{ - canReplaceViewpoint:()=>true, - addRecord:function(bool){ - if(typeof bool=='boolean'){ - var mode=_status.mode; - var data=lib.config.gameRecord.single.data; - if(!get.is.object(data[mode])) data[mode]={}; - var data2=data[mode] - var identity=game.me.identity; - if(!data2[identity]){ - data2[identity]=[0,0]; + game: { + canReplaceViewpoint: () => true, + addRecord: function (bool) { + if (typeof bool == "boolean") { + var mode = _status.mode; + var data = lib.config.gameRecord.single.data; + if (!get.is.object(data[mode])) data[mode] = {}; + var data2 = data[mode]; + var identity = game.me.identity; + if (!data2[identity]) { + data2[identity] = [0, 0]; } - if(bool){ + if (bool) { data2[identity][0]++; - } - else{ + } else { data2[identity][1]++; } - var list=['zhu','fan']; - var str=''; - for(var j in data){ - str+=get.translation(j+2)+':
    '; - for(var i=0;i'; + var list = ["zhu", "fan"]; + var str = ""; + for (var j in data) { + str += get.translation(j + 2) + ":
    "; + for (var i = 0; i < list.length; i++) { + if (data[j][list[i]]) { + str += + lib.translate[list[i] + "2"] + + ":" + + data[j][list[i]][0] + + "胜" + + " " + + data[j][list[i]][1] + + "负
    "; } } } - lib.config.gameRecord.single.str=str; - game.saveConfig('gameRecord',lib.config.gameRecord); + lib.config.gameRecord.single.str = str; + game.saveConfig("gameRecord", lib.config.gameRecord); } }, - getState:function(){ - var state={}; - for(var i in lib.playerOL){ - var player=lib.playerOL[i]; - state[i]={identity:player.identity}; + getState: function () { + var state = {}; + for (var i in lib.playerOL) { + var player = lib.playerOL[i]; + state[i] = { identity: player.identity }; } return state; }, - updateState:function(state){ - for(var i in state){ - var player=lib.playerOL[i]; - if(player){ - player.identity=state[i].identity; + updateState: function (state) { + for (var i in state) { + var player = lib.playerOL[i]; + if (player) { + player.identity = state[i].identity; } } }, - getRoomInfo:function(uiintro){ - if(lib.configOL.single_mode=='normal') uiintro.add('
    晋势力武将:'+(lib.configOL.enable_jin?'开启':'关闭')); - if(lib.configOL.bannedcards.length){ - uiintro.add('
    禁用卡牌:'+get.translation(lib.configOL.bannedcards)); + getRoomInfo: function (uiintro) { + if (lib.configOL.single_mode == "normal") + uiintro.add( + '
    晋势力武将:' + (lib.configOL.enable_jin ? "开启" : "关闭") + ); + if (lib.configOL.bannedcards.length) { + uiintro.add( + '
    禁用卡牌:' + get.translation(lib.configOL.bannedcards) + ); } - uiintro.style.paddingBottom='8px'; + uiintro.style.paddingBottom = "8px"; }, - getVideoName:function(){ - var str=get.translation(game.me.name); - if(game.me.name2){ - str+='/'+get.translation(game.me.name2); + getVideoName: function () { + var str = get.translation(game.me.name); + if (game.me.name2) { + str += "/" + get.translation(game.me.name2); } - var name=[ + var name = [ str, - get.translation(_status.mode+2)+' - '+lib.translate[game.me.identity+'2'] + get.translation(_status.mode + 2) + " - " + lib.translate[game.me.identity + "2"], ]; return name; }, - showIdentity:function(){}, - checkResult:function(){ - game.over((game.me._trueMe||game.me).isAlive()); + showIdentity: function () {}, + checkResult: function () { + game.over((game.me._trueMe || game.me).isAlive()); }, - checkOnlineResult:function(player){ + checkOnlineResult: function (player) { return player.isAlive(); }, - chooseCharacterDianjiang:function(){ - var next=game.createEvent('chooseCharacter'); - next.showConfig=true; - next.setContent(function(){ - "step 0" - ui.arena.classList.add('choose-character'); + chooseCharacterDianjiang: function () { + var next = game.createEvent("chooseCharacter"); + next.showConfig = true; + next.setContent(function () { + "step 0"; + ui.arena.classList.add("choose-character"); lib.init.onfree(); - "step 1" - game.me.chooseControl('先手','后手').prompt='请选择自己的行动顺序'; - "step 2" - var map=result.control=='先手'?['zhu','fan']:['fan','zhu']; - game.me.identity=map[0]; - game.me.next.identity=map[1]; + "step 1"; + game.me.chooseControl("先手", "后手").prompt = "请选择自己的行动顺序"; + "step 2"; + var map = result.control == "先手" ? ["zhu", "fan"] : ["fan", "zhu"]; + game.me.identity = map[0]; + game.me.next.identity = map[1]; game.me.showIdentity(); game.me.next.showIdentity(); - "step 3" - event.flipassign=true; - event.videoId=lib.status.videoId++; - var list=[]; - for(var i in lib.character){ - if(lib.filter.characterDisabled(i)) continue; + "step 3"; + event.flipassign = true; + event.videoId = lib.status.videoId++; + var list = []; + for (var i in lib.character) { + if (lib.filter.characterDisabled(i)) continue; list.push(i); } - _status.characterlist=list; - var filter=function(name){ + _status.characterlist = list; + var filter = function (name) { return !_status.characterlist.includes(name); }; - var dialog=ui.create.characterDialog('heightset',filter).open(); - dialog.videoId=event.videoId; + var dialog = ui.create.characterDialog("heightset", filter).open(); + dialog.videoId = event.videoId; - game.me.chooseButton(true).set('ai',function(button){ - return Math.random(); - }).set('dialog',event.videoId); - "step 4" + game.me + .chooseButton(true) + .set("ai", function (button) { + return Math.random(); + }) + .set("dialog", event.videoId); + "step 4"; game.me.init(result.links[0]); _status.characterlist.remove(result.links[0]); game.addRecentCharacter(result.links[0]); - game.me.chooseButton(true).set('ai',function(button){ - return Math.random(); - }).set('dialog',event.videoId); - "step 5" - game.broadcastAll('closeDialog',event.videoId); + game.me + .chooseButton(true) + .set("ai", function (button) { + return Math.random(); + }) + .set("dialog", event.videoId); + "step 5"; + game.broadcastAll("closeDialog", event.videoId); game.me.next.init(result.links[0]); _status.characterlist.remove(result.links[0]); game.addRecentCharacter(result.links[0]); - setTimeout(function(){ - ui.arena.classList.remove('choose-character'); - },500); + setTimeout(function () { + ui.arena.classList.remove("choose-character"); + }, 500); }); }, - chooseCharacterWuxianhuoli(){ - const next=game.createEvent('chooseCharacter'); - next.showConfig=true; - next.setContent(function(){ - 'step 0' - ui.arena.classList.add('choose-character'); + chooseCharacterWuxianhuoli() { + const next = game.createEvent("chooseCharacter"); + next.showConfig = true; + next.setContent(function () { + "step 0"; + ui.arena.classList.add("choose-character"); lib.init.onfree(); - var num=[0,1].randomGet(); - game.players[num].identity='zhu'; - game.players[1-num].identity='fan'; - game.broadcastAll(function(p,t){ - p.enemy=t;t.enemy=p; - },game.players[0],game.players[1]); - for(var i=0;i本局游戏Buff
    ', - ]; - game.globalBuff.forEach((buff,ind)=>{ - dialog.add(`
    「${ind===0?'固定':'随机'}」 ${get.translation(buff)}:${get.skillInfoTranslation(buff)}
    `); + const dialog = ["请选择出场武将", '
    本局游戏Buff
    ']; + game.globalBuff.forEach((buff, ind) => { + dialog.add( + `
    「${ind === 0 ? "固定" : "随机"}」 ${get.translation( + buff + )}:${get.skillInfoTranslation(buff)}
    ` + ); }); - dialog.add([_status.characterChoice[game.me.identity],'character']); - game.me.chooseButton(true,dialog); - 'step 2' + dialog.add([_status.characterChoice[game.me.identity], "character"]); + game.me.chooseButton(true, dialog); + "step 2"; game.me.init(result.links[0]); _status.characterChoice[game.me.identity].removeArray(result.links); - var list=_status.characterChoice[game.me.enemy.identity].randomRemove(1); + var list = _status.characterChoice[game.me.enemy.identity].randomRemove(1); game.me.enemy.init(list[0]); - [game.me,game.me.enemy].forEach(current=>{ - if(current.storage.nohp||lib.character[current.name1][4].includes('hiddenSkill')&&!current.noclick){ - current.storage.rawHp=1; - current.storage.rawMaxHp=1; + [game.me, game.me.enemy].forEach((current) => { + if ( + current.storage.nohp || + (lib.character[current.name1][4].includes("hiddenSkill") && !current.noclick) + ) { + current.storage.rawHp = 1; + current.storage.rawMaxHp = 1; } - current.hp=10; - current.maxHp=10; - current.hujia=0; + current.hp = 10; + current.maxHp = 10; + current.hujia = 0; current.update(); }); - game.globalBuff.forEach(buff=>{ + game.globalBuff.forEach((buff) => { game.addGlobalSkill(buff); }); - game.addGlobalSkill('wuxianhuoli_task'); - _status.wuxianhuoliProgress=0; - _status.wuxianhuoliLevel=0; - const func=()=>{ - ui.wuxianhuoliProgress=get.is.phoneLayout()?ui.create.div('.touchinfo.left',ui.window):ui.create.div(ui.gameinfo); - ui.wuxianhuoliProgress.innerHTML='任务进度(0/3)'; - const showTasks=()=>{ - if(ui.wuxianhuoliInfo) return; - ui.wuxianhuoliInfo=ui.create.system('无限火力',null,true); - ui.wuxianhuoliInfo.currentProgress=0; - ui.wuxianhuoliInfo.currentLevel=0; - lib.setPopped(ui.wuxianhuoliInfo,()=>{ - var uiintro=ui.create.dialog('hidden'); - uiintro.add(`
    任务列表
    `); - if(typeof _status.wuxianhuoliLevel!=='number'){ - uiintro.add(`
    未获取当前进度,请于一名角色受伤后再查看
    `); - } - else if(_status.wuxianhuoliLevel<2){ - uiintro.add(`
    全场角色造成${_status.wuxianhuoliLevel===0?3:5}点伤害(当前${_status.wuxianhuoliProgress}点)
    \ + game.addGlobalSkill("wuxianhuoli_task"); + _status.wuxianhuoliProgress = 0; + _status.wuxianhuoliLevel = 0; + const func = () => { + ui.wuxianhuoliProgress = get.is.phoneLayout() + ? ui.create.div(".touchinfo.left", ui.window) + : ui.create.div(ui.gameinfo); + ui.wuxianhuoliProgress.innerHTML = "任务进度(0/3)"; + const showTasks = () => { + if (ui.wuxianhuoliInfo) return; + ui.wuxianhuoliInfo = ui.create.system("无限火力", null, true); + ui.wuxianhuoliInfo.currentProgress = 0; + ui.wuxianhuoliInfo.currentLevel = 0; + lib.setPopped( + ui.wuxianhuoliInfo, + () => { + var uiintro = ui.create.dialog("hidden"); + uiintro.add( + `
    任务列表
    ` + ); + if (typeof _status.wuxianhuoliLevel !== "number") { + uiintro.add( + `
    未获取当前进度,请于一名角色受伤后再查看
    ` + ); + } else if (_status.wuxianhuoliLevel < 2) { + uiintro.add(`
    全场角色造成${ + _status.wuxianhuoliLevel === 0 ? 3 : 5 + }点伤害(当前${_status.wuxianhuoliProgress}点)
    \
    奖励:获得一个技能,摸两张牌
    `); - } - else{ - uiintro.add(`
    所有任务已完成,无后续任务
    `); - } - uiintro.add(`
    全局Buff
    `); - uiintro.add(`
    ${game.globalBuff.map((buff,ind)=>{ - return get.translation(buff)+':'+get.skillInfoTranslation(buff); - }).join('
    ')}
    `); - var ul=uiintro.querySelector('ul'); - if(ul) ul.style.width='180px'; - uiintro.add(ui.create.div('.placeholder')); - return uiintro; - },250); + } else { + uiintro.add( + `
    所有任务已完成,无后续任务
    ` + ); + } + uiintro.add( + `
    全局Buff
    ` + ); + uiintro.add( + `
    ${game.globalBuff + .map((buff, ind) => { + return ( + get.translation(buff) + + ":" + + get.skillInfoTranslation(buff) + ); + }) + .join("
    ")}
    ` + ); + var ul = uiintro.querySelector("ul"); + if (ul) ul.style.width = "180px"; + uiintro.add(ui.create.div(".placeholder")); + return uiintro; + }, + 250 + ); }; showTasks(); - var dialog=ui.create.dialog('hidden','forcebutton'); + var dialog = ui.create.dialog("hidden", "forcebutton"); dialog.add(`任务一`); dialog.addText(`任务:全场角色共计造成3点伤害
    奖励:获得一个技能,摸两张牌`); dialog.add(`任务二
    (完成任务一后解锁)
    \
    任务:全场角色共计造成5点伤害
    奖励:获得一个技能,摸两张牌
    `); dialog.open(); - setTimeout(()=>{ + setTimeout(() => { dialog.close(); - },3000); + }, 3000); }; game.broadcastAll(func); - game.delay(0,3000); - 'step 3' + game.delay(0, 3000); + "step 3"; _status.characterlist.addArray(Object.values(_status.characterChoice).flat()); - setTimeout(function(){ - ui.arena.classList.remove('choose-character'); - },500); + setTimeout(function () { + ui.arena.classList.remove("choose-character"); + }, 500); }); }, - chooseCharacter:function(){ - if(_status.mode=='dianjiang'){ + chooseCharacter: function () { + if (_status.mode == "dianjiang") { game.chooseCharacterDianjiang(); return; } - if(_status.mode=='wuxianhuoli'){ + if (_status.mode == "wuxianhuoli") { game.chooseCharacterWuxianhuoli(); return; } - var next=game.createEvent('chooseCharacter'); - next.showConfig=true; - next.setContent(function(){ - "step 0" - ui.arena.classList.add('choose-character'); - var num=[0,1].randomGet(); - game.players[num].identity='zhu'; - game.players[1-num].identity='fan'; - game.broadcastAll(function(p,t){ - p.enemy=t;t.enemy=p; - },game.players[0],game.players[1]); - for(var i=0;i{game.globalBuff=buff}; - game.broadcast(setBuff,game.globalBuff); - if(!_status.postReconnect.wuxianhuoliBuff) _status.postReconnect.wuxianhuoliBuff=[setBuff,[]]; - _status.postReconnect.wuxianhuoliBuff[1].addArray(game.globalBuff); - 'step 1' - _status.characterChoice={ - zhu:_status.characterlist.randomRemove(6), - fan:_status.characterlist.randomRemove(6), + const setBuff = (buff) => { + game.globalBuff = buff; }; - const list=['zhu','fan'].map(identity=>{ - const dialog=[ - '请选择出场武将', - '
    本局游戏Buff
    ', - ]; - game.globalBuff.forEach((buff,ind)=>{ - dialog.add(`
    「${ind===0?'固定':'随机'}」 ${get.translation(buff)}:${get.skillInfoTranslation(buff)}
    `); + game.broadcast(setBuff, game.globalBuff); + if (!_status.postReconnect.wuxianhuoliBuff) + _status.postReconnect.wuxianhuoliBuff = [setBuff, []]; + _status.postReconnect.wuxianhuoliBuff[1].addArray(game.globalBuff); + "step 1"; + _status.characterChoice = { + zhu: _status.characterlist.randomRemove(6), + fan: _status.characterlist.randomRemove(6), + }; + const list = ["zhu", "fan"].map((identity) => { + const dialog = ["请选择出场武将", '
    本局游戏Buff
    ']; + game.globalBuff.forEach((buff, ind) => { + dialog.add( + `
    「${ind === 0 ? "固定" : "随机"}」 ${get.translation( + buff + )}:${get.skillInfoTranslation(buff)}
    ` + ); }); - dialog.add([_status.characterChoice[identity],'character']); - return [game[identity],true,dialog]; + dialog.add([_status.characterChoice[identity], "character"]); + return [game[identity], true, dialog]; }); - game.me.chooseButtonOL(list,function(player,result){ - if(game.online||player==game.me){ + game.me.chooseButtonOL(list, function (player, result) { + if (game.online || player == game.me) { player.init(result.links[0]); - player.hp=10; - player.maxHp=10; - player.hujia=0; + player.hp = 10; + player.maxHp = 10; + player.hujia = 0; player.update(); } }); - 'step 2' - for(var i in result){ - var current=lib.playerOL[i]; - if(result[i]=='ai'){ - result[i]=_status.characterChoice[current.identity].randomGets(1); - } - else{ - result[i]=result[i].links; + "step 2"; + for (var i in result) { + var current = lib.playerOL[i]; + if (result[i] == "ai") { + result[i] = _status.characterChoice[current.identity].randomGets(1); + } else { + result[i] = result[i].links; } _status.characterChoice[current.identity].removeArray(result[i]); - if(!current.name){ + if (!current.name) { current.init(result[i][0]); - if(current.storage.nohp||lib.character[current.name1][4].includes('hiddenSkill')&&!current.noclick){ - current.storage.rawHp=1; - current.storage.rawMaxHp=1; + if ( + current.storage.nohp || + (lib.character[current.name1][4].includes("hiddenSkill") && !current.noclick) + ) { + current.storage.rawHp = 1; + current.storage.rawMaxHp = 1; } - current.hp=10; - current.maxHp=10; - current.hujia=0; + current.hp = 10; + current.maxHp = 10; + current.hujia = 0; current.update(); } } - game.broadcast(function(result){ - for(var i in result){ - const current=lib.playerOL[i]; - if(!current.name){ + game.broadcast(function (result) { + for (var i in result) { + const current = lib.playerOL[i]; + if (!current.name) { current.init(result[i][0]); - if(current.storage.nohp||lib.character[current.name1][4].includes('hiddenSkill')&&!current.noclick){ - current.storage.rawHp=1; - current.storage.rawMaxHp=1; + if ( + current.storage.nohp || + (lib.character[current.name1][4].includes("hiddenSkill") && + !current.noclick) + ) { + current.storage.rawHp = 1; + current.storage.rawMaxHp = 1; } - current.hp=10; - current.maxHp=10; - current.hujia=0; + current.hp = 10; + current.maxHp = 10; + current.hujia = 0; current.update(); } } - setTimeout(function(){ - ui.arena.classList.remove('choose-character'); - },500); - },result); - game.globalBuff.forEach(buff=>{ + setTimeout(function () { + ui.arena.classList.remove("choose-character"); + }, 500); + }, result); + game.globalBuff.forEach((buff) => { game.addGlobalSkill(buff); }); - game.addGlobalSkill('wuxianhuoli_task'); - game.broadcastAll(()=>{ - _status.wuxianhuoliProgress=0; - _status.wuxianhuoliLevel=0; + game.addGlobalSkill("wuxianhuoli_task"); + game.broadcastAll(() => { + _status.wuxianhuoliProgress = 0; + _status.wuxianhuoliLevel = 0; }); - const func=()=>{ - ui.wuxianhuoliProgress=get.is.phoneLayout()?ui.create.div('.touchinfo.left',ui.window):ui.create.div(ui.gameinfo); - ui.wuxianhuoliProgress.innerHTML='任务进度(0/3)'; - const showTasks=()=>{ - if(ui.wuxianhuoliInfo) return; - ui.wuxianhuoliInfo=ui.create.system('无限火力',null,true); - ui.wuxianhuoliInfo.currentProgress=0; - ui.wuxianhuoliInfo.currentLevel=0; - lib.setPopped(ui.wuxianhuoliInfo,()=>{ - var uiintro=ui.create.dialog('hidden'); - uiintro.add(`
    任务列表
    `); - if(typeof _status.wuxianhuoliLevel!=='number'){ - uiintro.add(`
    未获取当前进度,请于一名角色受伤后再查看
    `); - } - else if(_status.wuxianhuoliLevel<2){ - uiintro.add(`
    全场角色造成${_status.wuxianhuoliLevel===0?3:5}点伤害(当前${_status.wuxianhuoliProgress}点)
    \ + const func = () => { + ui.wuxianhuoliProgress = get.is.phoneLayout() + ? ui.create.div(".touchinfo.left", ui.window) + : ui.create.div(ui.gameinfo); + ui.wuxianhuoliProgress.innerHTML = "任务进度(0/3)"; + const showTasks = () => { + if (ui.wuxianhuoliInfo) return; + ui.wuxianhuoliInfo = ui.create.system("无限火力", null, true); + ui.wuxianhuoliInfo.currentProgress = 0; + ui.wuxianhuoliInfo.currentLevel = 0; + lib.setPopped( + ui.wuxianhuoliInfo, + () => { + var uiintro = ui.create.dialog("hidden"); + uiintro.add( + `
    任务列表
    ` + ); + if (typeof _status.wuxianhuoliLevel !== "number") { + uiintro.add( + `
    未获取当前进度,请于一名角色受伤后再查看
    ` + ); + } else if (_status.wuxianhuoliLevel < 2) { + uiintro.add(`
    全场角色造成${ + _status.wuxianhuoliLevel === 0 ? 3 : 5 + }点伤害(当前${_status.wuxianhuoliProgress}点)
    \
    奖励:获得一个技能,摸两张牌
    `); - } - else{ - uiintro.add(`
    所有任务已完成,无后续任务
    `); - } - uiintro.add(`
    全局Buff
    `); - uiintro.add(`
    ${game.globalBuff.map((buff,ind)=>{ - return get.translation(buff)+':'+get.skillInfoTranslation(buff); - }).join('
    ')}
    `); - var ul=uiintro.querySelector('ul'); - if(ul) ul.style.width='180px'; - uiintro.add(ui.create.div('.placeholder')); - return uiintro; - },250); + } else { + uiintro.add( + `
    所有任务已完成,无后续任务
    ` + ); + } + uiintro.add( + `
    全局Buff
    ` + ); + uiintro.add( + `
    ${game.globalBuff + .map((buff, ind) => { + return ( + get.translation(buff) + + ":" + + get.skillInfoTranslation(buff) + ); + }) + .join("
    ")}
    ` + ); + var ul = uiintro.querySelector("ul"); + if (ul) ul.style.width = "180px"; + uiintro.add(ui.create.div(".placeholder")); + return uiintro; + }, + 250 + ); }; showTasks(); - if(!_status.postReconnect.wuxianhuoliShowTasks) _status.postReconnect.wuxianhuoliShowTasks=[showTasks,[]]; - const dialog=ui.create.dialog('hidden','forcebutton'); + if (!_status.postReconnect.wuxianhuoliShowTasks) + _status.postReconnect.wuxianhuoliShowTasks = [showTasks, []]; + const dialog = ui.create.dialog("hidden", "forcebutton"); dialog.add(`任务一`); dialog.addText(`任务:全场角色共计造成3点伤害
    奖励:获得一个技能,摸两张牌`); dialog.add(`任务二
    (完成任务一后解锁)
    \
    任务:全场角色共计造成5点伤害
    奖励:获得一个技能,摸两张牌
    `); dialog.open(); - setTimeout(()=>{ + setTimeout(() => { dialog.close(); - },3000); + }, 3000); }; game.broadcastAll(func); - game.delay(0,3000); - 'step 3' + game.delay(0, 3000); + "step 3"; _status.characterlist.addArray(Object.values(_status.characterChoice).flat()); - setTimeout(function(){ - ui.arena.classList.remove('choose-character'); - },500); + setTimeout(function () { + ui.arena.classList.remove("choose-character"); + }, 500); }); }, - chooseCharacterOL:function(){ - if(_status.mode=='dianjiang'){ + chooseCharacterOL: function () { + if (_status.mode == "dianjiang") { game.chooseCharacterDianjiangOL(); return; } - if(_status.mode=='wuxianhuoli'){ + if (_status.mode == "wuxianhuoli") { game.chooseCharacterWuxianhuoliOL(); return; } - var next=game.createEvent('chooseCharacter'); - next.setContent(function(){ - "step 0" - ui.arena.classList.add('choose-character'); - var num=[0,1].randomGet(); - game.players[num].identity='zhu'; - game.players[1-num].identity='fan'; - game.broadcastAll(function(p,t){ - p.enemy=t;t.enemy=p; - },game.players[0],game.players[1]); - for(var i=0;i=12; - })&&get.effect(target,{name:'juedou'},player,player)>0) return -1; + ai: { + order: 1, + result: { + target: function (player, target) { + if ( + player.countCards("h", function (card) { + return get.value(card) <= 5 && get.number(card) >= 12; + }) && + get.effect(target, { name: "juedou" }, player, player) > 0 + ) + return -1; return 0; }, }, }, }, - huwei:{ - audio:2, - trigger:{ - player:'enterGame', - global:'gameDrawAfter', + huwei: { + audio: 2, + trigger: { + player: "enterGame", + global: "gameDrawAfter", }, - direct:true, - content:function(){ - player.chooseUseTarget('shuiyanqijunx',get.prompt('huwei'),'视为使用一张【水淹七军】').logSkill='huwei'; + direct: true, + content: function () { + player.chooseUseTarget( + "shuiyanqijunx", + get.prompt("huwei"), + "视为使用一张【水淹七军】" + ).logSkill = "huwei"; }, }, - sgkuanggu:{ - audio:'kuanggu', - trigger:{source:'damageSource'}, - frequent:true, - filter:function(event,player){ + sgkuanggu: { + audio: "kuanggu", + trigger: { source: "damageSource" }, + frequent: true, + filter: function (event, player) { return player.isDamaged(); }, - content:function(){ - 'step 0' - player.judge(function(result){ - return get.color(result)=='black'?2:-2; + content: function () { + "step 0"; + player.judge(function (result) { + return get.color(result) == "black" ? 2 : -2; }); - 'step 1' - if(result.bool==true) player.recover(); + "step 1"; + if (result.bool == true) player.recover(); }, }, - suzi:{ - inherit:'xingshang', + suzi: { + inherit: "xingshang", }, - cangji:{ - trigger:{player:'die'}, - filter:function(event,player){ - return player.countCards('e')>0; + cangji: { + trigger: { player: "die" }, + filter: function (event, player) { + return player.countCards("e") > 0; }, - forceDie:true, - skillAnimation:true, - animationColor:'orange', - content:function(){ - var cards=player.getCards('e'); - player.cangji_yozuru=cards; - player.lose(cards,ui.special); - player.addSkill('cangji_yozuru'); + forceDie: true, + skillAnimation: true, + animationColor: "orange", + content: function () { + var cards = player.getCards("e"); + player.cangji_yozuru = cards; + player.lose(cards, ui.special); + player.addSkill("cangji_yozuru"); }, - subSkill:{ - yozuru:{ - sub:true, - charlotte:true, - superCharlotte:true, - trigger:{player:'enterGame'}, - forced:true, - popup:false, + subSkill: { + yozuru: { + sub: true, + charlotte: true, + superCharlotte: true, + trigger: { player: "enterGame" }, + forced: true, + popup: false, //onremove:true, - content:function(){ - var cards=player.cangji_yozuru.slice(0); - for(var i=0;i{ - if(evt.name!=='damage') return false; - return evt.card&&evt.card.name==='sha'; - }).indexOf(event)===0; - }, - forced:true, - silent:true, - popup:true, - charlotte:true, - async content(_,trigger){ - trigger.increase('num'); - }, - }, - wuxianhuoli_liuanhuaming:{ - trigger:{ - player:'loseAfter', - global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'], - }, - filter(event,player){ - if(player===_status.currentPhase) return false; - const evt=event.getl(player); - return evt.cards2&&evt.cards2.length>0; - }, - forced:true, - silent:true, - popup:true, - charlotte:true, - usable:2, - async content(_,__,player){ - player.draw(); - }, - }, - wuxianhuoli_mianmianjudao:{ - trigger:{player:'phaseZhunbeiBegin'}, - forced:true, - silent:true, - popup:true, - charlotte:true, - async content(_,__,player){ - const cards=[]; - for(const type of ['basic','trick']){ - const card=get.cardPile(card=>{ - const typex=get.type2(card,false); - return type===typex; - }); - if(card) cards.add(card); + content: function () { + "step 0"; + player.chooseBool("是否更换手牌?").ai = function () { + var hs = player.getCards("h"); + return get.value(hs, "raw") < 6 * hs; + }; + "step 1"; + if (result.bool) { + var hs = player.getCards("h"); + player.lose(hs, ui.special); + event.hs = hs; + } else event.finish(); + "step 2"; + var hs = event.hs; + player.draw(hs.length, "nodelay"); + for (var i = 0; i < hs.length; i++) { + hs[i].fix(); + ui.cardPile.insertBefore( + hs[i], + ui.cardPile.childNodes[get.rand(ui.cardPile.childElementCount)] + ); } - if(cards.length) player.gain(cards,'gain2'); }, }, - wuxianhuoli_task:{ - trigger:{source:'damageAfter'}, - forced:true, - popup:false, - silent:true, - charlotte:true, - async content(event,trigger,player){ - if(!_status.wuxianhuoliProgress) _status.wuxianhuoliProgress=0; - if(!_status.wuxianhuoliLevel) _status.wuxianhuoliLevel=0; - if(_status.wuxianhuoliLevel>1) return; - _status.wuxianhuoliProgress+=trigger.num; - game.broadcastAll((num,level)=>{ - _status.wuxianhuoliProgress=num; - _status.wuxianhuoliLevel=level; - if(!ui.wuxianhuoliProgress){ - ui.wuxianhuoliProgress=get.is.phoneLayout()?ui.create.div('.touchinfo.left',ui.window):ui.create.div(ui.gameinfo); - } - ui.wuxianhuoliProgress.innerHTML='任务进度('+num+'/'+(level===0?3:5)+')'; - },_status.wuxianhuoliProgress,_status.wuxianhuoliLevel); - if(_status.wuxianhuoliProgress<(_status.wuxianhuoliLevel===0?3:5)) return; - game.broadcastAll(()=>{ - _status.wuxianhuoliProgress=0; + wuxianhuoli_weisuoyuwei: { + trigger: { player: "phaseZhunbeiBegin" }, + forced: true, + silent: true, + popup: true, + charlotte: true, + async content(_, __, player) { + player.draw(); + }, + mod: { + cardUsable(card, player, num) { + if (card.name == "sha") return num + 1; + }, + }, + }, + wuxianhuoli_duoduoyishan: { + trigger: { global: "phaseEnd" }, + forced: true, + silent: true, + popup: true, + charlotte: true, + async content(_, __, player) { + player.draw(); + }, + }, + wuxianhuoli_xushidaifa: { + trigger: { source: "damageBegin1" }, + filter(event, player) { + if (!event.card || event.card.name !== "sha") return false; + return ( + game + .getGlobalHistory("everything", (evt) => { + if (evt.name !== "damage") return false; + return evt.card && evt.card.name === "sha"; + }) + .indexOf(event) === 0 + ); + }, + forced: true, + silent: true, + popup: true, + charlotte: true, + async content(_, trigger) { + trigger.increase("num"); + }, + }, + wuxianhuoli_liuanhuaming: { + trigger: { + player: "loseAfter", + global: [ + "equipAfter", + "addJudgeAfter", + "gainAfter", + "loseAsyncAfter", + "addToExpansionAfter", + ], + }, + filter(event, player) { + if (player === _status.currentPhase) return false; + const evt = event.getl(player); + return evt.cards2 && evt.cards2.length > 0; + }, + forced: true, + silent: true, + popup: true, + charlotte: true, + usable: 2, + async content(_, __, player) { + player.draw(); + }, + }, + wuxianhuoli_mianmianjudao: { + trigger: { player: "phaseZhunbeiBegin" }, + forced: true, + silent: true, + popup: true, + charlotte: true, + async content(_, __, player) { + const cards = []; + for (const type of ["basic", "trick"]) { + const card = get.cardPile((card) => { + const typex = get.type2(card, false); + return type === typex; + }); + if (card) cards.add(card); + } + if (cards.length) player.gain(cards, "gain2"); + }, + }, + wuxianhuoli_task: { + trigger: { source: "damageAfter" }, + forced: true, + popup: false, + silent: true, + charlotte: true, + async content(event, trigger, player) { + if (!_status.wuxianhuoliProgress) _status.wuxianhuoliProgress = 0; + if (!_status.wuxianhuoliLevel) _status.wuxianhuoliLevel = 0; + if (_status.wuxianhuoliLevel > 1) return; + _status.wuxianhuoliProgress += trigger.num; + game.broadcastAll( + (num, level) => { + _status.wuxianhuoliProgress = num; + _status.wuxianhuoliLevel = level; + if (!ui.wuxianhuoliProgress) { + ui.wuxianhuoliProgress = get.is.phoneLayout() + ? ui.create.div(".touchinfo.left", ui.window) + : ui.create.div(ui.gameinfo); + } + ui.wuxianhuoliProgress.innerHTML = + "任务进度(" + num + "/" + (level === 0 ? 3 : 5) + ")"; + }, + _status.wuxianhuoliProgress, + _status.wuxianhuoliLevel + ); + if (_status.wuxianhuoliProgress < (_status.wuxianhuoliLevel === 0 ? 3 : 5)) return; + game.broadcastAll(() => { + _status.wuxianhuoliProgress = 0; _status.wuxianhuoliLevel++; }); let next; - const send=(skills,refreshable,stop=false)=>{ - let next=game.createEvent('wuxianhuoli_reward',false); + const send = (skills, refreshable, stop = false) => { + let next = game.createEvent("wuxianhuoli_reward", false); next.setContent(lib.skill.wuxianhuoli_task.contentx); - next.set('skills',skills); - next.set('refreshable',refreshable); - next.set('includeOut',true); - if(!stop) game.resume(); + next.set("skills", skills); + next.set("refreshable", refreshable); + next.set("includeOut", true); + if (!stop) game.resume(); return next; }; - const sendback=(result,player)=>{ - if(!result) result={}; - if(!result.control&&(typeof result.index!=='number'||result.index<0)){ - result.index=0; + const sendback = (result, player) => { + if (!result) result = {}; + if (!result.control && (typeof result.index !== "number" || result.index < 0)) { + result.index = 0; } - results.push([player,result]); + results.push([player, result]); }; - const ai_targets=[],results=[],players=game.players.slice(),skillsMap={}; - let withme=false,withol=false,withai=false; - for(const current of players){ - if(_status.connectMode) current.showTimer(); - const skills=get.info('wuxianhuoli_task').getSkills(); - const refreshable=!current.storage.wuxianhuoli_refreshed; - skillsMap[current.playerid]=skills; - if(current.isOnline()){ - withol=true; - current.send(send,skills,refreshable); + const ai_targets = [], + results = [], + players = game.players.slice(), + skillsMap = {}; + let withme = false, + withol = false, + withai = false; + for (const current of players) { + if (_status.connectMode) current.showTimer(); + const skills = get.info("wuxianhuoli_task").getSkills(); + const refreshable = !current.storage.wuxianhuoli_refreshed; + skillsMap[current.playerid] = skills; + if (current.isOnline()) { + withol = true; + current.send(send, skills, refreshable); current.wait(sendback); - } - else if(current==game.me){ - withme=true; - next=send(skills,refreshable,true); - if(_status.connectMode) game.me.wait(sendback); - } - else{ + } else if (current == game.me) { + withme = true; + next = send(skills, refreshable, true); + if (_status.connectMode) game.me.wait(sendback); + } else { ai_targets.push(current); } } - if(ai_targets.length){ - for(let i=0;i{ - const interval=setInterval(()=>{ - if(results.length===players.length){ + if (withol && !event.resultOL) { + await new Promise((resolve) => { + const interval = setInterval(() => { + if (results.length === players.length) { resolve(); clearInterval(interval); } - },4); + }, 4); }); } - if(ai_targets.length>0){ - withai=true; - await new Promise((resolve)=>{ - const interval=setInterval(()=>{ - if(results.length===players.length){ + if (ai_targets.length > 0) { + withai = true; + await new Promise((resolve) => { + const interval = setInterval(() => { + if (results.length === players.length) { resolve(); clearInterval(interval); } - },4); + }, 4); }); } - if(_status.connectMode){ - for(var i of players) i.hideTimer(); + if (_status.connectMode) { + for (var i of players) i.hideTimer(); } - const entries=[]; - for(const res of results){ - const target=res[0],result=res[1]; - if(!target||!result) continue; - let skill=result.control; - if(!skill) skill=skillsMap[target.playerid][result.index]; - if(result.refreshed) target.storage.wuxianhuoli_refreshed=true; - entries.push([target,skill]); + const entries = []; + for (const res of results) { + const target = res[0], + result = res[1]; + if (!target || !result) continue; + let skill = result.control; + if (!skill) skill = skillsMap[target.playerid][result.index]; + if (result.refreshed) target.storage.wuxianhuoli_refreshed = true; + entries.push([target, skill]); } - entries.sort((a,b)=>lib.sort.seat(a[0],b[0])); - for(const entry of entries){ + entries.sort((a, b) => lib.sort.seat(a[0], b[0])); + for (const entry of entries) { entry[0].popup(entry[1]); await entry[0].addSkills(entry[1]); } - for(const entry of entries){ - await entry[0].draw(2,'nodelay'); + for (const entry of entries) { + await entry[0].draw(2, "nodelay"); } - game.broadcastAll((num,level)=>{ - if(level===2&&ui.wuxianhuoliProgress){ - ui.wuxianhuoliProgress.innerHTML=''; - return; - } - if(!ui.wuxianhuoliProgress){ - ui.wuxianhuoliProgress=get.is.phoneLayout()?ui.create.div('.touchinfo.left',ui.window):ui.create.div(ui.gameinfo); - } - ui.wuxianhuoliProgress.innerHTML='任务进度('+num+'/'+(level===0?3:5)+')'; - },_status.wuxianhuoliProgress,_status.wuxianhuoliLevel); + game.broadcastAll( + (num, level) => { + if (level === 2 && ui.wuxianhuoliProgress) { + ui.wuxianhuoliProgress.innerHTML = ""; + return; + } + if (!ui.wuxianhuoliProgress) { + ui.wuxianhuoliProgress = get.is.phoneLayout() + ? ui.create.div(".touchinfo.left", ui.window) + : ui.create.div(ui.gameinfo); + } + ui.wuxianhuoliProgress.innerHTML = + "任务进度(" + num + "/" + (level === 0 ? 3 : 5) + ")"; + }, + _status.wuxianhuoliProgress, + _status.wuxianhuoliLevel + ); await game.asyncDelay(); }, - getSkills(num=6){ - let allList=_status.characterlist.slice(0); - let list=[]; - let skills=[]; - let map=[]; - let entries=[]; + getSkills(num = 6) { + let allList = _status.characterlist.slice(0); + let list = []; + let skills = []; + let map = []; + let entries = []; allList.randomSort(); - for(let i=0;i=num) break; + if (list.length >= num) break; } return skills; }, - async contentx(event){ - _status.noclearcountdown=true; - const controls=[link=>{ - const evt=get.event(); - evt.result={refresh:true}; - event.control.classList.add('disabled'); - event.control.firstChild.innerText='刷新(1/1)'; - game.resume(); - }]; - event.control=ui.create.control(controls.concat(['刷新(0/1)','stayleft'])); - if(!event.refreshable){ - event.control.classList.add('disabled'); - event.control.firstChild.innerText='刷新(1/1)'; + async contentx(event) { + _status.noclearcountdown = true; + const controls = [ + (link) => { + const evt = get.event(); + evt.result = { refresh: true }; + event.control.classList.add("disabled"); + event.control.firstChild.innerText = "刷新(1/1)"; + game.resume(); + }, + ]; + event.control = ui.create.control(controls.concat(["刷新(0/1)", "stayleft"])); + if (!event.refreshable) { + event.control.classList.add("disabled"); + event.control.firstChild.innerText = "刷新(1/1)"; } - let refreshed=false,result; - while(true){ - const skills=event.skills.slice(3*refreshed,3*(refreshed+1)); - const next=game.me.chooseControl(skills).set('choiceList',skills.map(skill=>{ - return '
    【'+get.translation(lib.translate[skill+'_ab']||get.translation(skill).slice(0,2))+'】
    '+ - '
    '+get.skillInfoTranslation(skill,game.me)+'
    '; - })).set('displayIndex',false).set('prompt','选择获得一个技能'); - result=await next.forResult(); - if(!result.refresh) break; - refreshed=true; + let refreshed = false, + result; + while (true) { + const skills = event.skills.slice(3 * refreshed, 3 * (refreshed + 1)); + const next = game.me + .chooseControl(skills) + .set( + "choiceList", + skills.map((skill) => { + return ( + '
    【' + + get.translation( + lib.translate[skill + "_ab"] || get.translation(skill).slice(0, 2) + ) + + "】
    " + + "
    " + + get.skillInfoTranslation(skill, game.me) + + "
    " + ); + }) + ) + .set("displayIndex", false) + .set("prompt", "选择获得一个技能"); + result = await next.forResult(); + if (!result.refresh) break; + refreshed = true; } - if(event.control) event.control.close(); - delete _status.noclearcountdown;game.stopCountChoose(); - event.result={control:result.control,refreshed}; + if (event.control) event.control.close(); + delete _status.noclearcountdown; + game.stopCountChoose(); + event.result = { control: result.control, refreshed }; }, }, }, - singleTranslate:{ - xiahouyuan:'夏侯渊', - huangzhong:'黄忠', - weiyan:'魏延', - xiaoqiao:'小乔', - xuhuang:'徐晃', - pangde:'庞德', - zhangjiao:'张角', - old_caoren:'曹仁', - old_zhoutai:'周泰', - shuiyanqijunx_info:'出牌阶段,对一名其他角色使用。目标角色选择一项:1、弃置装备区里的所有牌;2、受到你造成的1点伤害。', - guohe_info:'出牌阶段,对有牌的一名其他角色使用。你选择一项:①弃置其装备区里的一张牌。②观看其手牌并弃置其中的一张。', - shunshou_info:'出牌阶段,对距离为1且有牌的一名其他角色使用。你获得其的一张牌。', + singleTranslate: { + xiahouyuan: "夏侯渊", + huangzhong: "黄忠", + weiyan: "魏延", + xiaoqiao: "小乔", + xuhuang: "徐晃", + pangde: "庞德", + zhangjiao: "张角", + old_caoren: "曹仁", + old_zhoutai: "周泰", + shuiyanqijunx_info: + "出牌阶段,对一名其他角色使用。目标角色选择一项:1、弃置装备区里的所有牌;2、受到你造成的1点伤害。", + guohe_info: + "出牌阶段,对有牌的一名其他角色使用。你选择一项:①弃置其装备区里的一张牌。②观看其手牌并弃置其中的一张。", + shunshou_info: "出牌阶段,对距离为1且有牌的一名其他角色使用。你获得其的一张牌。", }, - translate:{ - zhu:"先", - fan:"后", - zhu2:"先手", - fan2:"后手", - normal2:'新1v1', - changban2:'血战长坂坡', - dianjiang2:'点将单挑', - wuxianhuoli2:'无限火力', + translate: { + zhu: "先", + fan: "后", + zhu2: "先手", + fan2: "后手", + normal2: "新1v1", + changban2: "血战长坂坡", + dianjiang2: "点将单挑", + wuxianhuoli2: "无限火力", - wuxianhuoli_weisuoyuwei:'为所欲为', - wuxianhuoli_weisuoyuwei_info:'①准备阶段,你摸一张牌。②你使用【杀】的次数上限+1。', - wuxianhuoli_duoduoyishan:'多多益善', - wuxianhuoli_duoduoyishan_info:'一名角色的回合结束时,你摸一张牌。', - wuxianhuoli_xushidaifa:'蓄势待发', - wuxianhuoli_xushidaifa_info:'当你于一回合首次造成渠道为【杀】的伤害时,此伤害+1。', - wuxianhuoli_liuanhuaming:'柳暗花明', - wuxianhuoli_liuanhuaming_info:'每回合限两次。当你于回合外失去牌后,你摸一张牌。', - wuxianhuoli_mianmianjudao:'面面俱到', - wuxianhuoli_mianmianjudao_info:'准备阶段,你从牌堆或弃牌堆中获得基本牌和锦囊牌各一张。', + wuxianhuoli_weisuoyuwei: "为所欲为", + wuxianhuoli_weisuoyuwei_info: "①准备阶段,你摸一张牌。②你使用【杀】的次数上限+1。", + wuxianhuoli_duoduoyishan: "多多益善", + wuxianhuoli_duoduoyishan_info: "一名角色的回合结束时,你摸一张牌。", + wuxianhuoli_xushidaifa: "蓄势待发", + wuxianhuoli_xushidaifa_info: "当你于一回合首次造成渠道为【杀】的伤害时,此伤害+1。", + wuxianhuoli_liuanhuaming: "柳暗花明", + wuxianhuoli_liuanhuaming_info: "每回合限两次。当你于回合外失去牌后,你摸一张牌。", + wuxianhuoli_mianmianjudao: "面面俱到", + wuxianhuoli_mianmianjudao_info: "准备阶段,你从牌堆或弃牌堆中获得基本牌和锦囊牌各一张。", - wanrong:'婉容', - wanrong_info:'当你成为【杀】的目标后,你可以摸一张牌。', - sgzhiheng:'制衡', - sgzhiheng_info:'出牌阶段限一次,你可以弃置至多两张牌,然后摸等量的牌。', - xiechan:'挟缠', - xiechan_info:'限定技,出牌阶段,你可以和对手拼点。若你赢/没赢,你/其视为对其/你使用一张【决斗】。', - huwei:'虎威', - huwei_info:'当你登场时,你可以视为使用一张【水淹七军】。', - sgkuanggu:'狂骨', - sgkuanggu_info:'当你造成伤害后,若你已受伤,你可以进行判定:若结果为黑色,你回复1点体力。', - suzi:'肃资', - cangji:'藏机', - cangji_info:'当你死亡时,你可以将装备区内的所有牌移动到游戏外。若如此做,你的下一名角色登场时,你将这些牌置入你的装备区。', - sgrenwang:'仁望', - sgrenwang_info:'当你于一名其他角色的出牌阶段内成为该角色使用的【杀】或普通锦囊牌的目标后,若此牌不是其本阶段内对你使用的第一张【杀】或普通锦囊牌,则你可以弃置该角色的一张牌。', - sgduanliang:'断粮', - sgduanliang_info:'出牌阶段,若你本回合内使用牌指定过其他角色为目标,则你可以将一张黑色基本牌或装备牌当做【兵粮寸断】使用。', - sgqingguo:'倾国', - sgqingguo_info:'你可以将一张装备区内的牌当做【闪】使用或打出。', - pianyi:'翩仪', - pianyi_info:'锁定技,当你于对手的回合内登场时,你结束此回合。', - yinli:'姻礼', - yinli_info:'其他角色的装备牌于其回合内进入弃牌堆后,你可以获得之。', - shenju:'慎拒', - shenju_info:'锁定技,你的手牌上限+X(X为你对手的体力值)。', + wanrong: "婉容", + wanrong_info: "当你成为【杀】的目标后,你可以摸一张牌。", + sgzhiheng: "制衡", + sgzhiheng_info: "出牌阶段限一次,你可以弃置至多两张牌,然后摸等量的牌。", + xiechan: "挟缠", + xiechan_info: + "限定技,出牌阶段,你可以和对手拼点。若你赢/没赢,你/其视为对其/你使用一张【决斗】。", + huwei: "虎威", + huwei_info: "当你登场时,你可以视为使用一张【水淹七军】。", + sgkuanggu: "狂骨", + sgkuanggu_info: "当你造成伤害后,若你已受伤,你可以进行判定:若结果为黑色,你回复1点体力。", + suzi: "肃资", + cangji: "藏机", + cangji_info: + "当你死亡时,你可以将装备区内的所有牌移动到游戏外。若如此做,你的下一名角色登场时,你将这些牌置入你的装备区。", + sgrenwang: "仁望", + sgrenwang_info: + "当你于一名其他角色的出牌阶段内成为该角色使用的【杀】或普通锦囊牌的目标后,若此牌不是其本阶段内对你使用的第一张【杀】或普通锦囊牌,则你可以弃置该角色的一张牌。", + sgduanliang: "断粮", + sgduanliang_info: + "出牌阶段,若你本回合内使用牌指定过其他角色为目标,则你可以将一张黑色基本牌或装备牌当做【兵粮寸断】使用。", + sgqingguo: "倾国", + sgqingguo_info: "你可以将一张装备区内的牌当做【闪】使用或打出。", + pianyi: "翩仪", + pianyi_info: "锁定技,当你于对手的回合内登场时,你结束此回合。", + yinli: "姻礼", + yinli_info: "其他角色的装备牌于其回合内进入弃牌堆后,你可以获得之。", + shenju: "慎拒", + shenju_info: "锁定技,你的手牌上限+X(X为你对手的体力值)。", + }, + help: { + 血战长坂: + '
    游戏规则
    • 选将阶段
      双方在游戏开始时由系统随机分配身份。分配到先手身份的玩家优先出牌,分配到后手身份的玩家优先选将。
      双方各自随机获得3名暗置武将,同时从将池中随机选出6名明置武将,由后手玩家开始,按照一次1张-2张-2张-1张的顺序,轮流选择获得明置武将。之后双方各从自己的6名武将中选择2名分别作为主将和副将进行游戏。
    • 胜利条件
      对方死亡。' + + "
    • 双将规则
      双将主将决定角色的性别和势力,体力上限为主副将体力上限的平均值,向下取整。体力上限为3的角色可在游戏开始后更换一次起始手牌。
    • 牌堆
      牌堆中移除【木牛流马】【闪电】,♣花色的【藤甲】和【无懈可击 ♦️Q】️
    ", + 无限火力: + '
    1v1火力全开模式
      (来自三国杀国际服)
    • 所有角色的初始体力值和体力上限均为10,护甲均为0
    • 每局游戏会有一个固定的Buff和一个随机的Buff,对所有角色生效' + + "
    • 游戏全程会有两个任务,分别为“所有角色造成3点伤害”和“所有角色造成5点伤害”,在任务一完成后才会解锁任务二。
      每当任务完成时,系统会发放奖励:所有角色观看三个随机的技能并获得其中一个(每名角色每局有一次刷新的机会),然后摸两张牌。", }, - help:{ - '血战长坂':'
      游戏规则
      • 选将阶段
        双方在游戏开始时由系统随机分配身份。分配到先手身份的玩家优先出牌,分配到后手身份的玩家优先选将。
        双方各自随机获得3名暗置武将,同时从将池中随机选出6名明置武将,由后手玩家开始,按照一次1张-2张-2张-1张的顺序,轮流选择获得明置武将。之后双方各从自己的6名武将中选择2名分别作为主将和副将进行游戏。
      • 胜利条件
        对方死亡。'+ - '
      • 双将规则
        双将主将决定角色的性别和势力,体力上限为主副将体力上限的平均值,向下取整。体力上限为3的角色可在游戏开始后更换一次起始手牌。
      • 牌堆
        牌堆中移除【木牛流马】【闪电】,♣花色的【藤甲】和【无懈可击 ♦️Q】️
      ', - '无限火力':'
      1v1火力全开模式
        (来自三国杀国际服)
      • 所有角色的初始体力值和体力上限均为10,护甲均为0
      • 每局游戏会有一个固定的Buff和一个随机的Buff,对所有角色生效'+ - '
      • 游戏全程会有两个任务,分别为“所有角色造成3点伤害”和“所有角色造成5点伤害”,在任务一完成后才会解锁任务二。
        每当任务完成时,系统会发放奖励:所有角色观看三个随机的技能并获得其中一个(每名角色每局有一次刷新的机会),然后摸两张牌。', - } }; }); diff --git a/mode/stone.js b/mode/stone.js index 6fc498c71..9d7de1f9a 100644 --- a/mode/stone.js +++ b/mode/stone.js @@ -1,861 +1,878 @@ -'use strict'; -game.import('mode',function(lib,game,ui,get,ai,_status){ +"use strict"; +game.import("mode", function (lib, game, ui, get, ai, _status) { return { - name:'stone', - start:function(){ - "step 0" - lib.init.css(lib.assetURL+'layout/mode/','stone'); - _status.mode='deck'; + name: "stone", + start: function () { + "step 0"; + lib.init.css(lib.assetURL + "layout/mode/", "stone"); + _status.mode = "deck"; game.initStone(); - var playback=localStorage.getItem(lib.configprefix+'playback'); + var playback = localStorage.getItem(lib.configprefix + "playback"); - if(!playback&&_status.mode=='deck'){ - var createCardDialog=function(){ - ui.deckBuilder=ui.create.div('.popup-container#deck-builder',function(){ - if(careerList.classList.contains('shown')){ - careerList.classList.remove('shown'); - newDeck.classList.remove('active'); - } - else if(!cardDialog.classList.contains('shown')){ - this.classList.remove('shown'); - this.timeout=setTimeout(function(){ + if (!playback && _status.mode == "deck") { + var createCardDialog = function () { + ui.deckBuilder = ui.create.div(".popup-container#deck-builder", function () { + if (careerList.classList.contains("shown")) { + careerList.classList.remove("shown"); + newDeck.classList.remove("active"); + } else if (!cardDialog.classList.contains("shown")) { + this.classList.remove("shown"); + this.timeout = setTimeout(function () { ui.deckBuilder.remove(); - },500); - ui.arena.style.top=''; - ui.arena.style.transform=''; - ui.arena.style.opacity=''; - ui.system.style.opacity=''; + }, 500); + ui.arena.style.top = ""; + ui.arena.style.transform = ""; + ui.arena.style.opacity = ""; + ui.system.style.opacity = ""; ui.auto.show(); ui.pause.show(); ui.historybar.show(); } }); - var clickNode=function(){ - cardDialog.classList.add('shown'); - controls.classList.add('shown'); - var name='未命名'; - for(var i=1;;i++){ - if(!lib.storage.deckList[name+i]){ + var clickNode = function () { + cardDialog.classList.add("shown"); + controls.classList.add("shown"); + var name = "未命名"; + for (var i = 1; ; i++) { + if (!lib.storage.deckList[name + i]) { break; } } - cardDialog.editing={ - name:name+i, - content:{ - career:this.firstChild.dataset.career, - deck:[] + cardDialog.editing = { + name: name + i, + content: { + career: this.firstChild.dataset.career, + deck: [], }, - } - rename.innerHTML=name+i; - newDeck.innerHTML='确认编辑'; - newDeck.classList.add('active'); - careerList.classList.remove('shown'); - listContainer.style.transform='translateX(200px)'; - deckContainer.innerHTML=''; - deckContainer.classList.add('shown'); + }; + rename.innerHTML = name + i; + newDeck.innerHTML = "确认编辑"; + newDeck.classList.add("active"); + careerList.classList.remove("shown"); + listContainer.style.transform = "translateX(200px)"; + deckContainer.innerHTML = ""; + deckContainer.classList.add("shown"); updateCardDialog(); + }; + var careerList = ui.create.div(".shadowed.career", ui.deckBuilder); + for (var i = 0; i < lib.careerList.length; i++) { + var node = ui.create.div(careerList, clickNode); + ui.create.div(".menubutton.round", node).dataset.career = lib.careerList[i]; + ui.create.div(".text", lib.translate[lib.careerList[i]], node); } - var careerList=ui.create.div('.shadowed.career',ui.deckBuilder); - for(var i=0;i/g,''); + var removeLine = function () { + rename.innerHTML = rename.innerHTML.replace(/\n|
        /g, ""); }; var observer = new MutationObserver(removeLine); - observer.observe(rename,{characterData:true,subtree:true}); - rename.addEventListener('keyup',removeLine); + observer.observe(rename, { characterData: true, subtree: true }); + rename.addEventListener("keyup", removeLine); - var cardDialog=ui.create.cardDialog(true,function(name){ - if(lib.card[name].stonehidden) return true; - var type=lib.card[name].type; - return type!='stonecard'&&type!='stonecharacter'; - },{seperate:function(list){ - var nl=[],ns=[]; - var career={}; - var careerspell={}; - for(var i=0;i=30){ - for(var i=0;i= 30) { + for (var i = 0; i < cardDialog.buttons.length; i++) { + cardDialog.buttons[i].classList.add("unselectable"); } - } - else{ - var nummap={}; - for(var i=0;i=2){ + var list = []; + for (var i in nummap) { + if (nummap[i] >= 2) { list.push(i); } } - for(var i=0;ib) return 1; - if(a b) return 1; + if (a < b) return -1; + return 0; + }); + if (editing.origin) { + for (var i = 0; i < listContainer.childElementCount; i++) { + if (listContainer.childNodes[i].name == editing.origin) { + listContainer.childNodes[i].name = editing.name; + listContainer.childNodes[i].firstChild.innerHTML = + editing.name; + break; + } + } + delete lib.storage.deckList[editing.origin]; + } else if (!lib.storage.deckList[editing.name]) { + var deckitem = ui.create.div( + ".deckitem.shadowed", + "" + editing.name + "", + listContainer, + editDeck + ); + ui.create.div(".menubutton.round", deckitem).dataset.career = + editing.content.career; + deckitem.name = editing.name; + } + lib.storage.deckList[editing.name] = editing.content; } - else if(!lib.storage.deckList[editing.name]){ - var deckitem=ui.create.div('.deckitem.shadowed',''+editing.name+'', - listContainer,editDeck); - ui.create.div('.menubutton.round',deckitem).dataset.career=editing.content.career; - deckitem.name=editing.name; - } - lib.storage.deckList[editing.name]=editing.content; + game.save("deckList", lib.storage.deckList); + listContainer.style.transform = ""; + deckContainer.classList.remove("shown"); + updateCardDialog(); } - game.save('deckList',lib.storage.deckList); - listContainer.style.transform=''; - deckContainer.classList.remove('shown'); - updateCardDialog(); + e.stopPropagation(); } - e.stopPropagation(); - }); - var listContainer=ui.create.div('.list-container',deckList); - for(var i in lib.storage.deckList){ - var deckitem=ui.create.div('.deckitem.shadowed',''+i+'', - listContainer,editDeck); - ui.create.div('.menubutton.round',deckitem).dataset.career=lib.storage.deckList[i].career; - deckitem.name=i; + ); + var listContainer = ui.create.div(".list-container", deckList); + for (var i in lib.storage.deckList) { + var deckitem = ui.create.div( + ".deckitem.shadowed", + "" + i + "", + listContainer, + editDeck + ); + ui.create.div(".menubutton.round", deckitem).dataset.career = + lib.storage.deckList[i].career; + deckitem.name = i; } - var deckContainer=ui.create.div('.list-container.deck',deckList); - if(ui.deckcontrol){ + var deckContainer = ui.create.div(".list-container.deck", deckList); + if (ui.deckcontrol) { ui.deckcontrol.show(); - setTimeout(function(){ - if(ui.deckcontrol) ui.deckcontrol.style.transition=''; - },500); + setTimeout(function () { + if (ui.deckcontrol) ui.deckcontrol.style.transition = ""; + }, 500); } }; - ui.deckcontrol=ui.create.system('卡组管理',function(){ - if(this.classList.contains('hidden')) return; - // if(lib.config.low_performance){ - // ui.arena.style.transform='translateY('+ui.window.offsetHeight+'px)'; - // } - // else{ - // ui.arena.style.top='100%'; - // } - // ui.arena.style.transform='scale(0.6)'; - ui.arena.style.opacity=0; - ui.system.style.opacity=0; - ui.window.appendChild(ui.deckBuilder); - if(ui.deckBuilder.timeout){ - clearTimeout(ui.deckBuilder.timeout); - delete ui.deckBuilder.timeout; - } - ui.refresh(ui.deckBuilder); - ui.deckBuilder.classList.add('shown'); - ui.auto.hide(); - ui.pause.hide(); - ui.historybar.hide(); - },true); + ui.deckcontrol = ui.create.system( + "卡组管理", + function () { + if (this.classList.contains("hidden")) return; + // if(lib.config.low_performance){ + // ui.arena.style.transform='translateY('+ui.window.offsetHeight+'px)'; + // } + // else{ + // ui.arena.style.top='100%'; + // } + // ui.arena.style.transform='scale(0.6)'; + ui.arena.style.opacity = 0; + ui.system.style.opacity = 0; + ui.window.appendChild(ui.deckBuilder); + if (ui.deckBuilder.timeout) { + clearTimeout(ui.deckBuilder.timeout); + delete ui.deckBuilder.timeout; + } + ui.refresh(ui.deckBuilder); + ui.deckBuilder.classList.add("shown"); + ui.auto.hide(); + ui.pause.hide(); + ui.historybar.hide(); + }, + true + ); - if(lib.onfree){ - ui.deckcontrol.style.transition='all 0.5s'; + if (lib.onfree) { + ui.deckcontrol.style.transition = "all 0.5s"; ui.deckcontrol.hide(); lib.onfree.push(createCardDialog); - } - else{ + } else { createCardDialog(); } } - if(playback){ + if (playback) { ui.create.me(); - ui.arena.style.display='none'; - ui.system.style.display='none'; - _status.playback=playback; - localStorage.removeItem(lib.configprefix+'playback'); - var store=lib.db.transaction(['video'],'readwrite').objectStore('video'); - store.get(parseInt(playback)).onsuccess=function(e){ - if(e.target.result){ + ui.arena.style.display = "none"; + ui.system.style.display = "none"; + _status.playback = playback; + localStorage.removeItem(lib.configprefix + "playback"); + var store = lib.db.transaction(["video"], "readwrite").objectStore("video"); + store.get(parseInt(playback)).onsuccess = function (e) { + if (e.target.result) { game.playVideoContent(e.target.result.video); - } - else{ - alert('播放失败:找不到录像'); + } else { + alert("播放失败:找不到录像"); game.reload(); } - } + }; event.finish(); - } - else{ + } else { game.prepareArena(2); // game.delay(); } - ui.arena.classList.add('stone'); - "step 1" - for(var i=0;i'+game.me.deckCards.length); - uiintro.addSmall([game.me.deckCards,'card']); - return uiintro; - },220); - if(get.config('skill_bar')){ - _status.rageEnabled=true; + "step 2"; + if (_status.mode == "deck") { + _status.deckButton = ui.create.system("卡组", null, true); + lib.setPopped( + _status.deckButton, + function () { + var uiintro = ui.create.dialog("hidden"); + uiintro.listen(function (e) { + e.stopPropagation(); + }); + uiintro.add( + '剩余 ' + game.me.deckCards.length + ); + uiintro.addSmall([game.me.deckCards, "card"]); + return uiintro; + }, + 220 + ); + if (get.config("skill_bar")) { + _status.rageEnabled = true; - ui.friendBar=ui.create.div('.skillbar.right.shadowed.playerbg',ui.arena); - ui.enemyBar=ui.create.div('.skillbar.left.shadowed.playerbg',ui.arena); + ui.friendBar = ui.create.div(".skillbar.right.shadowed.playerbg", ui.arena); + ui.enemyBar = ui.create.div(".skillbar.left.shadowed.playerbg", ui.arena); // ui.friendBar.dataset.nature='metal'; // ui.enemyBar.dataset.nature='fire'; - ui.create.div('.skillbarshadow',ui.friendBar); - ui.create.div('.skillbarshadow',ui.enemyBar); - ui.create.div('.skillbarfill',ui.friendBar); - ui.create.div('.skillbarfill',ui.enemyBar); - ui.friendBar.fillnode=ui.create.div(ui.friendBar.lastChild); - ui.enemyBar.fillnode=ui.create.div(ui.enemyBar.lastChild); + ui.create.div(".skillbarshadow", ui.friendBar); + ui.create.div(".skillbarshadow", ui.enemyBar); + ui.create.div(".skillbarfill", ui.friendBar); + ui.create.div(".skillbarfill", ui.enemyBar); + ui.friendBar.fillnode = ui.create.div(ui.friendBar.lastChild); + ui.enemyBar.fillnode = ui.create.div(ui.enemyBar.lastChild); // ui.friendBar.popnode=ui.create.div('.skillbartext',ui.friendBar); // ui.enemyBar.popnode=ui.create.div('.skillbartext',ui.enemyBar); - _status.friendRage=0; - _status.enemyRage=0; + _status.friendRage = 0; + _status.enemyRage = 0; - lib.setIntro(ui.friendBar,null,true); - lib.setIntro(ui.enemyBar,null,true); + lib.setIntro(ui.friendBar, null, true); + lib.setIntro(ui.enemyBar, null, true); } } - _status.friendCount=ui.create.system('',null,true); - _status.enemyCount=ui.create.system('',null,true); + _status.friendCount = ui.create.system("", null, true); + _status.enemyCount = ui.create.system("", null, true); game.updateStatusCount(); - lib.setPopped(_status.friendCount,function(){ - var uiintro=ui.create.dialog('hidden'); + lib.setPopped(_status.friendCount, function () { + var uiintro = ui.create.dialog("hidden"); - if(_status.deadfriend.length){ - uiintro.add('已阵亡'); - uiintro.add([_status.deadfriend,'player']); + if (_status.deadfriend.length) { + uiintro.add("已阵亡"); + uiintro.add([_status.deadfriend, "player"]); } - uiintro.add('未上场'); - if(_status.mylist.length){ - uiintro.add([_status.mylist,'character']); - } - else{ - uiintro.add('(无)') + uiintro.add("未上场"); + if (_status.mylist.length) { + uiintro.add([_status.mylist, "character"]); + } else { + uiintro.add("(无)"); } return uiintro; }); - lib.setPopped(_status.enemyCount,function(){ - if(_status.deadenemy.length){ - var uiintro=ui.create.dialog('hidden'); - uiintro.add('已阵亡'); - uiintro.add([_status.deadenemy,'player']); + lib.setPopped(_status.enemyCount, function () { + if (_status.deadenemy.length) { + var uiintro = ui.create.dialog("hidden"); + uiintro.add("已阵亡"); + uiintro.add([_status.deadenemy, "player"]); return uiintro; } }); - game.me.side=Math.random()<0.5; - game.enemy.side=!game.me.side; + game.me.side = Math.random() < 0.5; + game.enemy.side = !game.me.side; - var players=get.players(lib.sort.position); - var info=[]; - for(var i=0;i=100){ - _status.friendRage=100; - ui.friendBar.fillnode.style.top='-50%'; - ui.friendBar.classList.add('full'); + if (_status.friendRage >= 100) { + _status.friendRage = 100; + ui.friendBar.fillnode.style.top = "-50%"; + ui.friendBar.classList.add("full"); + } else { + ui.friendBar.fillnode.style.top = 100 - _status.friendRage + "%"; + ui.friendBar.classList.remove("full"); } - else{ - ui.friendBar.fillnode.style.top=(100-_status.friendRage)+'%'; - ui.friendBar.classList.remove('full'); + } else { + if (_status.enemyRage < 100) { + popup = ui.enemyBar; + } + _status.enemyRage += num; + if (_status.enemyRage < 0) { + _status.enemyRage = 0; + } + if (_status.enemyRage >= 100) { + _status.enemyRage = 100; + ui.enemyBar.fillnode.style.top = "-50%"; + ui.enemyBar.classList.add("full"); + } else { + ui.enemyBar.fillnode.style.top = 100 - _status.enemyRage + "%"; + ui.enemyBar.classList.remove("full"); } } - else{ - if(_status.enemyRage<100){ - popup=ui.enemyBar; - } - _status.enemyRage+=num; - if(_status.enemyRage<0){ - _status.enemyRage=0; - } - if(_status.enemyRage>=100){ - _status.enemyRage=100; - ui.enemyBar.fillnode.style.top='-50%'; - ui.enemyBar.classList.add('full'); - } - else{ - ui.enemyBar.fillnode.style.top=(100-_status.enemyRage)+'%'; - ui.enemyBar.classList.remove('full'); - } - } - if(num>0&&popup){ - var node=ui.create.div('.skillbartext',num.toString(),popup); + if (num > 0 && popup) { + var node = ui.create.div(".skillbartext", num.toString(), popup); ui.refresh(node); - node.style.opacity=1; - setTimeout(function(){ + node.style.opacity = 1; + setTimeout(function () { node.delete(); - },700); + }, 700); } }, - drawDeck:function(num,log){ - if(!num){ - num=1; + drawDeck: function (num, log) { + if (!num) { + num = 1; } - var cards=this.getDeckCards(num); - if(log==false){ + var cards = this.getDeckCards(num); + if (log == false) { this.directgain(cards); - } - else if(log==true){ + } else if (log == true) { this.directgain(cards); - game.log(this,'从牌库中获得了'+get.cnNumber(num)+'张牌'); - } - else{ - this.gain(cards,'draw'); - game.log(this,'从牌库中获得了'+get.cnNumber(num)+'张牌'); + game.log(this, "从牌库中获得了" + get.cnNumber(num) + "张牌"); + } else { + this.gain(cards, "draw"); + game.log(this, "从牌库中获得了" + get.cnNumber(num) + "张牌"); } return cards; }, - updateActCount:function(used,countx,current){ - if(_status.video){ - this.actcount=countx||2; + updateActCount: function (used, countx, current) { + if (_status.video) { + this.actcount = countx || 2; + } else { + game.addVideo("updateActCount", this, [used, this.actcount, this.getActCount()]); } - else{ - game.addVideo('updateActCount',this,[used,this.actcount,this.getActCount()]); - } - var maxcount,overflow2; - if(game.layout=='default'||used=='outphase'||_status.currentPhase!=this){ - maxcount=this.actcount; - } - else{ - if(_status.video){ - maxcount=this.actcount-(current||0); + var maxcount, overflow2; + if (game.layout == "default" || used == "outphase" || _status.currentPhase != this) { + maxcount = this.actcount; + } else { + if (_status.video) { + maxcount = this.actcount - (current || 0); + } else { + maxcount = this.actcount - this.getActCount(); } - else{ - maxcount=this.actcount-this.getActCount(); + if (this.actcount > maxcount) { + maxcount = this.actcount; } - if(this.actcount>maxcount){ - maxcount=this.actcount; - } - if(maxcount>12){ - maxcount=this.actcount+1; - this.node.actcount.classList.add('overflow2'); - } - else{ - this.node.actcount.classList.remove('overflow2'); + if (maxcount > 12) { + maxcount = this.actcount + 1; + this.node.actcount.classList.add("overflow2"); + } else { + this.node.actcount.classList.remove("overflow2"); } } - for(var i=0;i<12;i++){ - if(maxcount>this.node.actcount.childElementCount){ + for (var i = 0; i < 12; i++) { + if (maxcount > this.node.actcount.childElementCount) { ui.create.div(this.node.actcount); - } - else if(maxcount=this.actcount){ - this.node.actcount.childNodes[i].classList.add('overflow'); + for (var i = 0; i < this.node.actcount.childElementCount; i++) { + if (i < count) { + this.node.actcount.childNodes[i].classList.remove("lost"); + if (i >= this.actcount) { + this.node.actcount.childNodes[i].classList.add("overflow"); + } else { + this.node.actcount.childNodes[i].classList.remove("overflow"); } - else{ - this.node.actcount.childNodes[i].classList.remove('overflow'); - } - } - else{ - this.node.actcount.childNodes[i].classList.add('lost'); - this.node.actcount.childNodes[i].classList.remove('overflow'); + } else { + this.node.actcount.childNodes[i].classList.add("lost"); + this.node.actcount.childNodes[i].classList.remove("overflow"); } } } }, - getAct:function(){ - return this.actcount-this.getActCount(); + getAct: function () { + return this.actcount - this.getActCount(); }, - hasFellowSkill:function(skill,exclude){ - for(var i=0;i=0){ - this.actcharacterlist[index]=null; + removeFellow: function (fellow) { + if (!this.actcharacterlist) return this; + var index = this.actcharacterlist.indexOf(fellow); + if (index >= 0) { + this.actcharacterlist[index] = null; } return this; }, - dieAfter:function(source){ - var dead=this; - if(game.me.isDead()){ - if(!_status.mylist.length){ - _status.friendCount.innerHTML='友军: '+get.cnNumber(0); + dieAfter: function (source) { + var dead = this; + if (game.me.isDead()) { + if (!_status.mylist.length) { + _status.friendCount.innerHTML = "友军: " + get.cnNumber(0); game.over(false); } - } - else if(game.enemy.isDead()){ - if(!_status.enemylist.length){ - _status.enemyCount.innerHTML='敌军: '+get.cnNumber(0); + } else if (game.enemy.isDead()) { + if (!_status.enemylist.length) { + _status.enemyCount.innerHTML = "敌军: " + get.cnNumber(0); game.over(true); } } }, - dieAfter2:function(source){ - var dead=this; - if(game.me.isDead()){ - if(!_status.mylist.length){ - _status.friendCount.innerHTML='友军: '+get.cnNumber(0); + dieAfter2: function (source) { + var dead = this; + if (game.me.isDead()) { + if (!_status.mylist.length) { + _status.friendCount.innerHTML = "友军: " + get.cnNumber(0); game.over(false); - } - else{ + } else { game.pause(); _status.deadfriend.push(this); game.additionaldead.push(this); - setTimeout(function(){ - var player=ui.create.player(); + setTimeout(function () { + var player = ui.create.player(); player.getId(); - player.classList.add('noidentity'); - player.dataset.position=dead.dataset.position; - player.side=dead.side; - player.actcharacterlist=dead.actcharacterlist; - player.addTempClass('replaceme'); - player.actcount=game.enemy.actcount; - player.actcount=dead.actcount; - if(_status.double_character){ - player.init(_status.mylist.shift(),_status.mylist.shift()); - } - else{ + player.classList.add("noidentity"); + player.dataset.position = dead.dataset.position; + player.side = dead.side; + player.actcharacterlist = dead.actcharacterlist; + player.addTempClass("replaceme"); + player.actcount = game.enemy.actcount; + player.actcount = dead.actcount; + if (_status.double_character) { + player.init(_status.mylist.shift(), _status.mylist.shift()); + } else { player.init(_status.mylist.shift()); } player.maxHp++; player.hp++; - if(_status.mode=='deck'){ - get.deck(player,_status.deck.shift()); + if (_status.mode == "deck") { + get.deck(player, _status.deck.shift()); } game.players.push(player); ui.arena.appendChild(player); - game.addVideo('stoneSwap',null,{ - name:player.name1, - name2:player.name2, - position:player.dataset.position, - actcount:player.actcount, - me:true + game.addVideo("stoneSwap", null, { + name: player.name1, + name2: player.name2, + position: player.dataset.position, + actcount: player.actcount, + me: true, }); game.swapControl(player); game.arrangePlayers(); - if(_status.mode=='deck'){ - var nd=game.enemy.countFellow(); - if(nd){ - player.draw(3+nd,{drawDeck:nd},false); + if (_status.mode == "deck") { + var nd = game.enemy.countFellow(); + if (nd) { + player.draw(3 + nd, { drawDeck: nd }, false); + } else { + player.draw(3, false); } - else{ - player.draw(3,false); - } - } - else{ - player.draw(3+game.enemy.countFellow(),false); + } else { + player.draw(3 + game.enemy.countFellow(), false); } game.resume(); game.updateStatusCount(); - },lib.config.duration); + }, lib.config.duration); } - } - else if(game.enemy.isDead()){ - if(!_status.enemylist.length){ - _status.enemyCount.innerHTML='敌军: '+get.cnNumber(0); + } else if (game.enemy.isDead()) { + if (!_status.enemylist.length) { + _status.enemyCount.innerHTML = "敌军: " + get.cnNumber(0); game.over(true); - } - else{ + } else { game.pause(); _status.deadenemy.push(this); game.additionaldead.push(this); - setTimeout(function(){ - var player=ui.create.player(); + setTimeout(function () { + var player = ui.create.player(); player.getId(); - player.classList.add('noidentity'); - player.dataset.position=dead.dataset.position; - player.side=dead.side; - player.actcharacterlist=dead.actcharacterlist; - player.addTempClass('replaceenemy'); - player.actcount=dead.actcount; - if(_status.double_character){ - player.init(_status.enemylist.shift(),_status.enemylist.shift()); - } - else{ + player.classList.add("noidentity"); + player.dataset.position = dead.dataset.position; + player.side = dead.side; + player.actcharacterlist = dead.actcharacterlist; + player.addTempClass("replaceenemy"); + player.actcount = dead.actcount; + if (_status.double_character) { + player.init(_status.enemylist.shift(), _status.enemylist.shift()); + } else { player.init(_status.enemylist.shift()); } player.maxHp++; player.hp++; - if(_status.mode=='deck'){ - get.deck(player,'random'); + if (_status.mode == "deck") { + get.deck(player, "random"); } game.players.push(player); - game.enemy=player; + game.enemy = player; ui.arena.appendChild(player); - game.addVideo('stoneSwap',null,{ - name:player.name1, - name2:player.name2, - position:player.dataset.position, - actcount:player.actcount, + game.addVideo("stoneSwap", null, { + name: player.name1, + name2: player.name2, + position: player.dataset.position, + actcount: player.actcount, }); game.arrangePlayers(); - if(_status.mode=='deck'){ - var nd=game.me.countFellow(); - if(nd){ - player.draw(3+nd,{drawDeck:nd},false); + if (_status.mode == "deck") { + var nd = game.me.countFellow(); + if (nd) { + player.draw(3 + nd, { drawDeck: nd }, false); + } else { + player.draw(3, false); } - else{ - player.draw(3,false); - } - } - else{ - player.draw(3+game.me.countFellow(),false); + } else { + player.draw(3 + game.me.countFellow(), false); } game.resume(); game.updateStatusCount(); - },lib.config.duration); + }, lib.config.duration); } } - if(source&&source.side!=this.side&&!source.isMin()){ - if(_status.mode=='deck'){ + if (source && source.side != this.side && !source.isMin()) { + if (_status.mode == "deck") { source.drawDeck(); - } - else{ + } else { source.draw(); } source.actused--; @@ -1047,621 +1056,1585 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ game.dead.remove(this); game.arrangePlayers(); this.getLeader().removeFellow(this); - setTimeout(function(){ + setTimeout(function () { dead.delete(); - },500); + }, 500); }, - } + }, }, - beastList:['stone_misha','stone_leiouke','stone_huofu','stone_caoyuanshi','stone_jiewangzhu', - 'stone_huangjialeixiang','stone_damoshatuo','stone_tujiu','stone_senlinlang', - 'stone_fennuxiaoji','stone_juxingchanchu','stone_yanjingshe','stone_yuanhou' + beastList: [ + "stone_misha", + "stone_leiouke", + "stone_huofu", + "stone_caoyuanshi", + "stone_jiewangzhu", + "stone_huangjialeixiang", + "stone_damoshatuo", + "stone_tujiu", + "stone_senlinlang", + "stone_fennuxiaoji", + "stone_juxingchanchu", + "stone_yanjingshe", + "stone_yuanhou", ], - cardPack:{ - mode_stone:[ - 'spell_xiaoshi','spell_chenmo','spell_morizaihuo','spell_shengerpingdeng','spell_jingshenkongzhi','spell_anyingkuangluan', - 'spell_binghuan','spell_yanmie','spell_zhiliaozhichu','spell_wangzhezhufu','spell_diyulieyan','spell_zhiliaoshui', - 'spell_hanbingjian','spell_huoqiushu','spell_bianxingshu','spell_aoshuzhihui','spell_baofengxue','spell_lieyanfengbao', - 'spell_shandianfengbao','spell_chazhuangshandian','spell_yaoshu','spell_shixue','spell_lianhuanbaolie','spell_yexinglanghun', - 'spell_fuchouzhinu','spell_liliangzhufu','spell_fennuzhichui','spell_fengxian','spell_zuozhandongyuan','spell_shengliaoshu', - 'spell_cigu','spell_modaoyou','spell_jianrenluanwu','spell_daoshan','spell_cisha','spell_sijidaifa', - 'spell_huotigenxu','spell_wuyashenxiang','spell_ziranzhili','spell_yemanpaoxiao','spell_hengsao','spell_yexingchengzhang', - 'spell_xishengqiyue','spell_zuzhou','spell_xiaoguibaopo','spell_emozhinu','spell_anyinglieyan','spell_liliangdaijia', - 'spell_shenshengxinxing','spell_shengguangzhadan','spell_maizang','spell_xinlingshijie','spell_naluzhiguang','spell_zhiliaozhihuan', - 'spell_nuxi','spell_dunpaimengji','spell_zhansha','spell_nuhuozhongshao','spell_xuanfengzhan','spell_juemingluandou', - 'spell_lierenyinji','spell_kuaisusheji','spell_guanmenfanggou','spell_zhaohuanchongwu','spell_zidanshangtang','spell_duochongsheji', - 'spell_xianzuzhihun','spell_xianzuzhaohuan','spell_fengnu','spell_shihuawuqi','spell_xianzuzhishi','spell_rongyanbaolie', - 'spell_laojiuhuoba','spell_chirehuoba','spell_aoshufeidan','spell_canying','spell_yanbaoshu','spell_hanbingpingzhang','spell_jingxiang', - 'spell_mengun','spell_jipao','spell_beici','spell_weijisifu','spell_zhumo','spell_anzhongpohuai','spell_piaoqie', - 'spell_conglinzhihun','spell_heiandiyu','spell_fugen','spell_xingchenzhuiluo','spell_fennu','spell_ziyang', - 'spell_shalumingling','spell_tianjiangzhuqun','spell_tanxianmao','spell_dubiao','spell_qiangfengsheji','spell_zhuizongshu', - 'spell_zhenyanshu','spell_enzeshu','spell_anyingxingtai','spell_kuaisuzhiliao','spell_kongxinshu','spell_xinlinghanbao', - 'spell_jinyingduijue','spell_zhihuizhufu','spell_shenshengfennu','spell_yongshizhufu','spell_shenpan','spell_zhengqianghaosheng', - 'spell_zhongnian','spell_fuchoudaji','spell_yingyongdaji','spell_zhandounuhuo','spell_chongfeng','spell_kuangbao', - 'spell_linghunhongxi','spell_siwangchanrao','spell_emozhixin','spell_fushishu','spell_ansezhadan','spell_heianqiyue' - ] + cardPack: { + mode_stone: [ + "spell_xiaoshi", + "spell_chenmo", + "spell_morizaihuo", + "spell_shengerpingdeng", + "spell_jingshenkongzhi", + "spell_anyingkuangluan", + "spell_binghuan", + "spell_yanmie", + "spell_zhiliaozhichu", + "spell_wangzhezhufu", + "spell_diyulieyan", + "spell_zhiliaoshui", + "spell_hanbingjian", + "spell_huoqiushu", + "spell_bianxingshu", + "spell_aoshuzhihui", + "spell_baofengxue", + "spell_lieyanfengbao", + "spell_shandianfengbao", + "spell_chazhuangshandian", + "spell_yaoshu", + "spell_shixue", + "spell_lianhuanbaolie", + "spell_yexinglanghun", + "spell_fuchouzhinu", + "spell_liliangzhufu", + "spell_fennuzhichui", + "spell_fengxian", + "spell_zuozhandongyuan", + "spell_shengliaoshu", + "spell_cigu", + "spell_modaoyou", + "spell_jianrenluanwu", + "spell_daoshan", + "spell_cisha", + "spell_sijidaifa", + "spell_huotigenxu", + "spell_wuyashenxiang", + "spell_ziranzhili", + "spell_yemanpaoxiao", + "spell_hengsao", + "spell_yexingchengzhang", + "spell_xishengqiyue", + "spell_zuzhou", + "spell_xiaoguibaopo", + "spell_emozhinu", + "spell_anyinglieyan", + "spell_liliangdaijia", + "spell_shenshengxinxing", + "spell_shengguangzhadan", + "spell_maizang", + "spell_xinlingshijie", + "spell_naluzhiguang", + "spell_zhiliaozhihuan", + "spell_nuxi", + "spell_dunpaimengji", + "spell_zhansha", + "spell_nuhuozhongshao", + "spell_xuanfengzhan", + "spell_juemingluandou", + "spell_lierenyinji", + "spell_kuaisusheji", + "spell_guanmenfanggou", + "spell_zhaohuanchongwu", + "spell_zidanshangtang", + "spell_duochongsheji", + "spell_xianzuzhihun", + "spell_xianzuzhaohuan", + "spell_fengnu", + "spell_shihuawuqi", + "spell_xianzuzhishi", + "spell_rongyanbaolie", + "spell_laojiuhuoba", + "spell_chirehuoba", + "spell_aoshufeidan", + "spell_canying", + "spell_yanbaoshu", + "spell_hanbingpingzhang", + "spell_jingxiang", + "spell_mengun", + "spell_jipao", + "spell_beici", + "spell_weijisifu", + "spell_zhumo", + "spell_anzhongpohuai", + "spell_piaoqie", + "spell_conglinzhihun", + "spell_heiandiyu", + "spell_fugen", + "spell_xingchenzhuiluo", + "spell_fennu", + "spell_ziyang", + "spell_shalumingling", + "spell_tianjiangzhuqun", + "spell_tanxianmao", + "spell_dubiao", + "spell_qiangfengsheji", + "spell_zhuizongshu", + "spell_zhenyanshu", + "spell_enzeshu", + "spell_anyingxingtai", + "spell_kuaisuzhiliao", + "spell_kongxinshu", + "spell_xinlinghanbao", + "spell_jinyingduijue", + "spell_zhihuizhufu", + "spell_shenshengfennu", + "spell_yongshizhufu", + "spell_shenpan", + "spell_zhengqianghaosheng", + "spell_zhongnian", + "spell_fuchoudaji", + "spell_yingyongdaji", + "spell_zhandounuhuo", + "spell_chongfeng", + "spell_kuangbao", + "spell_linghunhongxi", + "spell_siwangchanrao", + "spell_emozhixin", + "spell_fushishu", + "spell_ansezhadan", + "spell_heianqiyue", + ], }, - characterPack:{ - mode_stone:{ - stone_tutengyongshi:['male','wei',4,['shaman_jili'],['minskin','stone'],[4,2,'shaman']], - stone_xuejuren:['male','wei',2,['shaman_xueju'],['minskin','stone'],[1,1,'shaman']], - stone_tuyuansu:['male','qun',5,['lschaofeng'],['minskin','stone'],[5,4,'shaman']], - stone_huoyuansu:['male','shu',3,['shaman_huoxi'],['minskin','stone'],[4,3,'shaman']], - stone_fachao:['male','wei',3,['shaman_tuteng','shaman_fachao'],['minskin','stone'],[3,0,'shaman']], - stone_huoshe:['male','shu',3,['shaman_tuteng','shaman_huoshe'],['minskin','stone'],[3,0,'shaman']], - stone_huoli:['male','wei',3,['shaman_tuteng','shaman_huoli'],['minskin','stone'],[2,0,'shaman']], - stone_huoyanweishi:['male','shu',4,['shaman_zhuhuo'],['minskin','stone'],[4,1,'shaman']], - stone_tutengshi:['female','wei',2,['shaman_peiyu'],['minskin','stone'],[3,3,'shaman']], - stone_shachuisaman:['male','qun',3,['shaman_fengnu'],['minskin','stone'],[4,4,'shaman']], - stone_wanshiyuansu:['male','qun',3,['shaman_zoushi'],['minskin','stone'],[3,1,'shaman']], - stone_shalinxingzhe:['male','qun',4,['shaman_anhun'],['minskin','stone'],[4,2,'shaman']], + characterPack: { + mode_stone: { + stone_tutengyongshi: [ + "male", + "wei", + 4, + ["shaman_jili"], + ["minskin", "stone"], + [4, 2, "shaman"], + ], + stone_xuejuren: ["male", "wei", 2, ["shaman_xueju"], ["minskin", "stone"], [1, 1, "shaman"]], + stone_tuyuansu: ["male", "qun", 5, ["lschaofeng"], ["minskin", "stone"], [5, 4, "shaman"]], + stone_huoyuansu: ["male", "shu", 3, ["shaman_huoxi"], ["minskin", "stone"], [4, 3, "shaman"]], + stone_fachao: [ + "male", + "wei", + 3, + ["shaman_tuteng", "shaman_fachao"], + ["minskin", "stone"], + [3, 0, "shaman"], + ], + stone_huoshe: [ + "male", + "shu", + 3, + ["shaman_tuteng", "shaman_huoshe"], + ["minskin", "stone"], + [3, 0, "shaman"], + ], + stone_huoli: [ + "male", + "wei", + 3, + ["shaman_tuteng", "shaman_huoli"], + ["minskin", "stone"], + [2, 0, "shaman"], + ], + stone_huoyanweishi: [ + "male", + "shu", + 4, + ["shaman_zhuhuo"], + ["minskin", "stone"], + [4, 1, "shaman"], + ], + stone_tutengshi: [ + "female", + "wei", + 2, + ["shaman_peiyu"], + ["minskin", "stone"], + [3, 3, "shaman"], + ], + stone_shachuisaman: [ + "male", + "qun", + 3, + ["shaman_fengnu"], + ["minskin", "stone"], + [4, 4, "shaman"], + ], + stone_wanshiyuansu: [ + "male", + "qun", + 3, + ["shaman_zoushi"], + ["minskin", "stone"], + [3, 1, "shaman"], + ], + stone_shalinxingzhe: [ + "male", + "qun", + 4, + ["shaman_anhun"], + ["minskin", "stone"], + [4, 2, "shaman"], + ], - stone_kuangyedoushi:['male','wu',3,['druid_nuhuo'],['minskin','stone'],[4,2,'druid']], - stone_conglinshouwei:['male','wu',3,['druid_huwei'],['minskin','stone'],[4,2,'druid']], - stone_baohuzhishu:['male','qun',6,['lschaofeng'],['minskin','stone'],[6,4,'druid']], - stone_liebao:['male','wei',3,['stone_chongfeng'],['minskin','stone'],[3,2,'druid']], - stone_zongxiong:['male','shu',4,['lschaofeng'],['minskin','stone'],[4,2,'druid']], - stone_baoqishi:['female','wei',2,['druid_chengzhang'],['minskin','stone'],[2,2,'druid']], - stone_renyaqishi:['female','wei',1,['druid_renya'],['minskin','stone'],[1,1,'druid']], - stone_huangyeqishi:['male','wei',4,['druid_chicheng'],['minskin','stone'],[5,2,'druid']], - stone_huoshanxiemu:['male','wei',3,['druid_juhuo','lschaofeng'],['minskin','stone'],[5,6,'druid']], - stone_conglinxiaoshou:['male','wei',3,['druid_yuehuo'],['minskin','stone'],[4,4,'druid']], - stone_lindishuyao:['female','wei',3,['druid_yeyou'],['minskin','stone'],[3,3,'druid']], - stone_xunmenglong:['male','wei',2,['druid_qicheng'],['minskin','stone'],[3,3,'druid']], + stone_kuangyedoushi: [ + "male", + "wu", + 3, + ["druid_nuhuo"], + ["minskin", "stone"], + [4, 2, "druid"], + ], + stone_conglinshouwei: [ + "male", + "wu", + 3, + ["druid_huwei"], + ["minskin", "stone"], + [4, 2, "druid"], + ], + stone_baohuzhishu: ["male", "qun", 6, ["lschaofeng"], ["minskin", "stone"], [6, 4, "druid"]], + stone_liebao: ["male", "wei", 3, ["stone_chongfeng"], ["minskin", "stone"], [3, 2, "druid"]], + stone_zongxiong: ["male", "shu", 4, ["lschaofeng"], ["minskin", "stone"], [4, 2, "druid"]], + stone_baoqishi: [ + "female", + "wei", + 2, + ["druid_chengzhang"], + ["minskin", "stone"], + [2, 2, "druid"], + ], + stone_renyaqishi: [ + "female", + "wei", + 1, + ["druid_renya"], + ["minskin", "stone"], + [1, 1, "druid"], + ], + stone_huangyeqishi: [ + "male", + "wei", + 4, + ["druid_chicheng"], + ["minskin", "stone"], + [5, 2, "druid"], + ], + stone_huoshanxiemu: [ + "male", + "wei", + 3, + ["druid_juhuo", "lschaofeng"], + ["minskin", "stone"], + [5, 6, "druid"], + ], + stone_conglinxiaoshou: [ + "male", + "wei", + 3, + ["druid_yuehuo"], + ["minskin", "stone"], + [4, 4, "druid"], + ], + stone_lindishuyao: [ + "female", + "wei", + 3, + ["druid_yeyou"], + ["minskin", "stone"], + [3, 3, "druid"], + ], + stone_xunmenglong: [ + "male", + "wei", + 2, + ["druid_qicheng"], + ["minskin", "stone"], + [3, 3, "druid"], + ], - stone_caoyuanshi:['male','qun',5,['hunter_nuhou'],['minskin','stone'],[5,2,'hunter']], - stone_leiouke:['male','shu',2,['hunter_zhanhuo'],['minskin','stone'],[3,1,'hunter']], - stone_huofu:['male','qun',2,['stone_chongfeng'],['minskin','stone'],[3,4,'hunter']], - stone_misha:['male','shu',3,['lschaofeng'],['minskin','stone'],[3,3,'hunter']], - stone_jiewangzhu:['male','wu',1,['hunter_jiewang'],['minskin','stone'],[1,2,'hunter']], - stone_xunshoushi:['male','qun',2,['hunter_xunshou'],['minskin','stone'],[4,3,'hunter']], - stone_senlinlang:['male','qun',1,['hunter_qunxi'],['minskin','stone'],[1,2,'hunter']], - stone_tujiu:['male','qun',3,['hunter_mishi'],['minskin','stone'],[3,2,'hunter']], - stone_muyangren:['male','qun',3,['hunter_muyang'],['minskin','stone'],[4,3,'hunter']], - stone_jujishou:['male','qun',2,['hunter_juji'],['minskin','stone'],[2,2,'hunter']], - stone_damoshatuo:['male','qun',3,['hunter_dusha'],['minskin','stone'],[3,3,'hunter']], - stone_huangjialeixiang:['male','qun',2,['hunter_chuanlin'],['minskin','stone'],[2,3,'hunter']], + stone_caoyuanshi: [ + "male", + "qun", + 5, + ["hunter_nuhou"], + ["minskin", "stone"], + [5, 2, "hunter"], + ], + stone_leiouke: ["male", "shu", 2, ["hunter_zhanhuo"], ["minskin", "stone"], [3, 1, "hunter"]], + stone_huofu: ["male", "qun", 2, ["stone_chongfeng"], ["minskin", "stone"], [3, 4, "hunter"]], + stone_misha: ["male", "shu", 3, ["lschaofeng"], ["minskin", "stone"], [3, 3, "hunter"]], + stone_jiewangzhu: [ + "male", + "wu", + 1, + ["hunter_jiewang"], + ["minskin", "stone"], + [1, 2, "hunter"], + ], + stone_xunshoushi: [ + "male", + "qun", + 2, + ["hunter_xunshou"], + ["minskin", "stone"], + [4, 3, "hunter"], + ], + stone_senlinlang: [ + "male", + "qun", + 1, + ["hunter_qunxi"], + ["minskin", "stone"], + [1, 2, "hunter"], + ], + stone_tujiu: ["male", "qun", 3, ["hunter_mishi"], ["minskin", "stone"], [3, 2, "hunter"]], + stone_muyangren: [ + "male", + "qun", + 3, + ["hunter_muyang"], + ["minskin", "stone"], + [4, 3, "hunter"], + ], + stone_jujishou: ["male", "qun", 2, ["hunter_juji"], ["minskin", "stone"], [2, 2, "hunter"]], + stone_damoshatuo: [ + "male", + "qun", + 3, + ["hunter_dusha"], + ["minskin", "stone"], + [3, 3, "hunter"], + ], + stone_huangjialeixiang: [ + "male", + "qun", + 2, + ["hunter_chuanlin"], + ["minskin", "stone"], + [2, 3, "hunter"], + ], - stone_shuiyuansu:['male','wei',4,['mage_bingdong'],['minskin','stone'],[4,2,'mage']], - stone_wushixuetu:['female','wu',1,['mage_zhufa'],['minskin','stone'],[1,2,'mage']], - stone_huoyao:['male','shu',3,['mage_lieyan'],['minskin','stone'],[3,1,'mage']], - stone_falifulong:['male','shu',2,['mage_tunfa'],['minskin','stone'],[1,1,'mage']], - stone_yingxiongzhihun:['male','wei',1,['mage_minghuo'],['minskin','stone'],[1,2,'mage']], - stone_shifazhe:['male','qun',3,['mage_shifa'],['minskin','stone'],[3,3,'mage']], - stone_aoshushi:['male','qun',3,['mage_aoshu'],['minskin','stone'],[3,2,'mage']], - stone_faqishi:['male','qun',4,['mage_jili'],['minskin','stone'],[4,2,'mage']], - stone_fuhuokaijia:['male','qun',3,['mage_gushou'],['minskin','stone'],[3,3,'mage']], - stone_kaodalalong:['male','qun',4,['mage_yufa'],['minskin','stone'],[5,4,'mage']], - stone_yanshushi:['male','qun',2,['mage_yanshu'],['minskin','stone'],[4,4,'mage']], - stone_xulingwushi:['male','qun',2,['mage_pingxu'],['minskin','stone'],[3,3,'mage']], + stone_shuiyuansu: ["male", "wei", 4, ["mage_bingdong"], ["minskin", "stone"], [4, 2, "mage"]], + stone_wushixuetu: ["female", "wu", 1, ["mage_zhufa"], ["minskin", "stone"], [1, 2, "mage"]], + stone_huoyao: ["male", "shu", 3, ["mage_lieyan"], ["minskin", "stone"], [3, 1, "mage"]], + stone_falifulong: ["male", "shu", 2, ["mage_tunfa"], ["minskin", "stone"], [1, 1, "mage"]], + stone_yingxiongzhihun: [ + "male", + "wei", + 1, + ["mage_minghuo"], + ["minskin", "stone"], + [1, 2, "mage"], + ], + stone_shifazhe: ["male", "qun", 3, ["mage_shifa"], ["minskin", "stone"], [3, 3, "mage"]], + stone_aoshushi: ["male", "qun", 3, ["mage_aoshu"], ["minskin", "stone"], [3, 2, "mage"]], + stone_faqishi: ["male", "qun", 4, ["mage_jili"], ["minskin", "stone"], [4, 2, "mage"]], + stone_fuhuokaijia: ["male", "qun", 3, ["mage_gushou"], ["minskin", "stone"], [3, 3, "mage"]], + stone_kaodalalong: ["male", "qun", 4, ["mage_yufa"], ["minskin", "stone"], [5, 4, "mage"]], + stone_yanshushi: ["male", "qun", 2, ["mage_yanshu"], ["minskin", "stone"], [4, 4, "mage"]], + stone_xulingwushi: ["male", "qun", 2, ["mage_pingxu"], ["minskin", "stone"], [3, 3, "mage"]], - stone_hudunren:['male','qun',2,['paladin_hudun'],['minskin','stone'],[2,2,'paladin']], - stone_junxuguan:['male','qun',3,['paladin_buji'],['minskin','stone'],[4,1,'paladin']], - stone_yurenqishi:['male','qun',2,['paladin_zhaochao'],['minskin','stone'],[4,2,'paladin']], - stone_chidunweishi:['male','qun',3,['paladin_chidun'],['minskin','stone'],[3,2,'paladin']], - stone_liewangshouwei:['male','qun',5,['paladin_shouwei'],['minskin','stone'],[5,2,'paladin']], - stone_longwangpeiou:['female','qun',4,['paladin_zhaohuan'],['minskin','stone'],[5,4,'paladin']], - stone_baoweizhe:['male','qun',2,['paladin_baowei'],['minskin','stone'],[2,1,'paladin']], - stone_guiqishi:['male','qun',5,['paladin_tuxi'],['minskin','stone'],[5,4,'paladin']], - stone_shenmiqishou:['male','qun',4,['paladin_miying'],['minskin','stone'],[5,4,'paladin']], - stone_shixiangweishi:['female','qun',3,['paladin_huashi'],['minskin','stone'],[3,3,'paladin']], - stone_xuefanzhanshi:['male','qun',3,['paladin_jinghua'],['minskin','stone'],[4,4,'paladin']], - stone_xunmashi:['male','qun',3,['paladin_moma'],['minskin','stone'],[3,2,'paladin']], + stone_hudunren: [ + "male", + "qun", + 2, + ["paladin_hudun"], + ["minskin", "stone"], + [2, 2, "paladin"], + ], + stone_junxuguan: [ + "male", + "qun", + 3, + ["paladin_buji"], + ["minskin", "stone"], + [4, 1, "paladin"], + ], + stone_yurenqishi: [ + "male", + "qun", + 2, + ["paladin_zhaochao"], + ["minskin", "stone"], + [4, 2, "paladin"], + ], + stone_chidunweishi: [ + "male", + "qun", + 3, + ["paladin_chidun"], + ["minskin", "stone"], + [3, 2, "paladin"], + ], + stone_liewangshouwei: [ + "male", + "qun", + 5, + ["paladin_shouwei"], + ["minskin", "stone"], + [5, 2, "paladin"], + ], + stone_longwangpeiou: [ + "female", + "qun", + 4, + ["paladin_zhaohuan"], + ["minskin", "stone"], + [5, 4, "paladin"], + ], + stone_baoweizhe: [ + "male", + "qun", + 2, + ["paladin_baowei"], + ["minskin", "stone"], + [2, 1, "paladin"], + ], + stone_guiqishi: ["male", "qun", 5, ["paladin_tuxi"], ["minskin", "stone"], [5, 4, "paladin"]], + stone_shenmiqishou: [ + "male", + "qun", + 4, + ["paladin_miying"], + ["minskin", "stone"], + [5, 4, "paladin"], + ], + stone_shixiangweishi: [ + "female", + "qun", + 3, + ["paladin_huashi"], + ["minskin", "stone"], + [3, 3, "paladin"], + ], + stone_xuefanzhanshi: [ + "male", + "qun", + 3, + ["paladin_jinghua"], + ["minskin", "stone"], + [4, 4, "paladin"], + ], + stone_xunmashi: ["male", "qun", 3, ["paladin_moma"], ["minskin", "stone"], [3, 2, "paladin"]], - stone_lieyanxiaogui:['male','qun',2,['warlock_nonghuo'],['minskin','stone'],[1,4,'warlock']], - stone_xiaoguishouling:['male','qun',3,['warlock_zhaogui'],['minskin','stone'],[3,1,'warlock']], - stone_xiaogui:['male','qun',1,[],['minskin','stone','stonehidden'],[1,1]], - stone_kongjuzhanma:['male','qun',1,['warlock_yongsheng'],['minskin','stone'],[3,1,'warlock']], - stone_morishouwei:['male','qun',4,['stone_chongfeng','warlock_zaihuo'],['minskin','stone'],[4,4,'warlock']], - stone_xukongxingzhe:['male','qun',2,['lschaofeng'],['minskin','stone'],[1,1,'warlock']], - stone_diyuhuo:['male','qun',4,['warlock_yuhuo'],['minskin','stone'],[5,4,'warlock']], - stone_diyuhuox:['male','qun',2,[],['minskin','stone','stonehidden'],[2,2,'warlock']], - stone_heishitanfan:['male','qun',2,['warlock_anyu'],['minskin','stone'],[2,2,'warlock']], - stone_zhaohuanzhe:['male','qun',3,['warlock_zhaohuan'],['minskin','stone'],[4,2,'warlock']], - stone_meimo:['male','qun',3,['warlock_huanmeng'],['minskin','stone'],[2,3,'warlock']], - stone_tongkunvwang:['male','qun',2,['warlock_tongku'],['minskin','stone'],[2,1,'warlock']], - stone_xukongkongmo:['male','qun',3,['warlock_tunshi'],['minskin','stone'],[3,3,'warlock']], - stone_fukongmoyan:['male','qun',4,['warlock_shijie'],['minskin','stone'],[5,4,'warlock']], + stone_lieyanxiaogui: [ + "male", + "qun", + 2, + ["warlock_nonghuo"], + ["minskin", "stone"], + [1, 4, "warlock"], + ], + stone_xiaoguishouling: [ + "male", + "qun", + 3, + ["warlock_zhaogui"], + ["minskin", "stone"], + [3, 1, "warlock"], + ], + stone_xiaogui: ["male", "qun", 1, [], ["minskin", "stone", "stonehidden"], [1, 1]], + stone_kongjuzhanma: [ + "male", + "qun", + 1, + ["warlock_yongsheng"], + ["minskin", "stone"], + [3, 1, "warlock"], + ], + stone_morishouwei: [ + "male", + "qun", + 4, + ["stone_chongfeng", "warlock_zaihuo"], + ["minskin", "stone"], + [4, 4, "warlock"], + ], + stone_xukongxingzhe: [ + "male", + "qun", + 2, + ["lschaofeng"], + ["minskin", "stone"], + [1, 1, "warlock"], + ], + stone_diyuhuo: ["male", "qun", 4, ["warlock_yuhuo"], ["minskin", "stone"], [5, 4, "warlock"]], + stone_diyuhuox: [ + "male", + "qun", + 2, + [], + ["minskin", "stone", "stonehidden"], + [2, 2, "warlock"], + ], + stone_heishitanfan: [ + "male", + "qun", + 2, + ["warlock_anyu"], + ["minskin", "stone"], + [2, 2, "warlock"], + ], + stone_zhaohuanzhe: [ + "male", + "qun", + 3, + ["warlock_zhaohuan"], + ["minskin", "stone"], + [4, 2, "warlock"], + ], + stone_meimo: [ + "male", + "qun", + 3, + ["warlock_huanmeng"], + ["minskin", "stone"], + [2, 3, "warlock"], + ], + stone_tongkunvwang: [ + "male", + "qun", + 2, + ["warlock_tongku"], + ["minskin", "stone"], + [2, 1, "warlock"], + ], + stone_xukongkongmo: [ + "male", + "qun", + 3, + ["warlock_tunshi"], + ["minskin", "stone"], + [3, 3, "warlock"], + ], + stone_fukongmoyan: [ + "male", + "qun", + 4, + ["warlock_shijie"], + ["minskin", "stone"], + [5, 4, "warlock"], + ], - stone_zhihuiguan:['female','qun',2,['warrior_tongling'],['minskin','stone'],[3,2,'warrior']], - stone_kuangzhanshi:['male','qun',2,['warrior_baoluan'],['minskin','stone'],[3,1,'warrior']], - stone_zhujiashi:['male','qun',2,['warrior_zhujia'],['minskin','stone'],[2,1,'warrior']], - stone_jiangong:['male','qun',2,['warrior_jiangong'],['minskin','stone'],[2,2,'warrior']], - stone_chidunshinv:['female','qun',4,['warrior_tidun'],['minskin','stone'],[5,4,'warrior']], - stone_yuanhou:['male','qun',2,['lschaofeng'],['minskin','stone'],[2,3,'warrior']], - stone_heiyaoyaoshou:['male','qun',4,['warrior_heiyao'],['minskin','stone'],[5,4,'warrior']], - stone_honglongyongshi:['male','qun',2,['warrior_fenyong'],['minskin','stone'],[2,3,'warrior']], - stone_peilianshi:['male','qun',2,['lschaofeng','warrior_peilian'],['minskin','stone'],[2,2,'warrior']], - stone_jingyingweishi:['male','qun',3,['stone_chongfeng'],['minskin','stone'],[4,3,'warrior']], - stone_mengmaren:['male','qun',3,['warrior_chuanci'],['minskin','stone'],[4,4,'warrior']], - stone_zhifuzhe:['male','qun',2,['warrior_zhifu'],['minskin','stone'],[3,1,'warrior']], + stone_zhihuiguan: [ + "female", + "qun", + 2, + ["warrior_tongling"], + ["minskin", "stone"], + [3, 2, "warrior"], + ], + stone_kuangzhanshi: [ + "male", + "qun", + 2, + ["warrior_baoluan"], + ["minskin", "stone"], + [3, 1, "warrior"], + ], + stone_zhujiashi: [ + "male", + "qun", + 2, + ["warrior_zhujia"], + ["minskin", "stone"], + [2, 1, "warrior"], + ], + stone_jiangong: [ + "male", + "qun", + 2, + ["warrior_jiangong"], + ["minskin", "stone"], + [2, 2, "warrior"], + ], + stone_chidunshinv: [ + "female", + "qun", + 4, + ["warrior_tidun"], + ["minskin", "stone"], + [5, 4, "warrior"], + ], + stone_yuanhou: ["male", "qun", 2, ["lschaofeng"], ["minskin", "stone"], [2, 3, "warrior"]], + stone_heiyaoyaoshou: [ + "male", + "qun", + 4, + ["warrior_heiyao"], + ["minskin", "stone"], + [5, 4, "warrior"], + ], + stone_honglongyongshi: [ + "male", + "qun", + 2, + ["warrior_fenyong"], + ["minskin", "stone"], + [2, 3, "warrior"], + ], + stone_peilianshi: [ + "male", + "qun", + 2, + ["lschaofeng", "warrior_peilian"], + ["minskin", "stone"], + [2, 2, "warrior"], + ], + stone_jingyingweishi: [ + "male", + "qun", + 3, + ["stone_chongfeng"], + ["minskin", "stone"], + [4, 3, "warrior"], + ], + stone_mengmaren: [ + "male", + "qun", + 3, + ["warrior_chuanci"], + ["minskin", "stone"], + [4, 4, "warrior"], + ], + stone_zhifuzhe: [ + "male", + "qun", + 2, + ["warrior_zhifu"], + ["minskin", "stone"], + [3, 1, "warrior"], + ], - stone_daomufeizei:['male','qun',3,['rogue_xunbao'],['minskin','stone'],[4,3,'rogue']], - stone_qiezei:['male','qun',2,['rogue_touqie'],['minskin','stone'],[2,2,'rogue']], - stone_heitieairen:['male','qun',2,['rogue_qiancang'],['minskin','stone'],[4,3,'rogue']], - stone_tegong:['male','qun',2,['rogue_touxi'],['minskin','stone'],[3,3,'rogue']], - stone_haidaotoumu:['male','qun',2,['rogue_zhaomu'],['minskin','stone'],[2,2,'rogue']], - stone_haidao:['male','qun',1,[],['minskin','stone','stonehidden'],[1,2,'rogue']], - stone_cike:['male','qun',1,['rogue_cisha','stone_qianxing'],['minskin','stone'],[1,1,'rogue']], - stone_duyanhaidao:['male','qun',2,['rogue_duxing'],['minskin','stone'],[3,4,'rogue']], - stone_gangtiewushi:['male','qun',2,['rogue_shoudao'],['minskin','stone'],[3,2,'rogue']], - stone_lifaji:['male','qun',2,['rogue_lifa'],['minskin','stone'],[2,2,'rogue']], - stone_shihualong:['male','qun',1,['rogue_fusheng'],['minskin','stone'],[3,2,'rogue']], - stone_xiushuihaidao:['male','qun',1,['rogue_jielue'],['minskin','stone'],[1,2,'rogue']], - stone_zousishangfan:['male','qun',3,['rogue_jiaoyi'],['minskin','stone'],[4,3,'rogue']], + stone_daomufeizei: [ + "male", + "qun", + 3, + ["rogue_xunbao"], + ["minskin", "stone"], + [4, 3, "rogue"], + ], + stone_qiezei: ["male", "qun", 2, ["rogue_touqie"], ["minskin", "stone"], [2, 2, "rogue"]], + stone_heitieairen: [ + "male", + "qun", + 2, + ["rogue_qiancang"], + ["minskin", "stone"], + [4, 3, "rogue"], + ], + stone_tegong: ["male", "qun", 2, ["rogue_touxi"], ["minskin", "stone"], [3, 3, "rogue"]], + stone_haidaotoumu: [ + "male", + "qun", + 2, + ["rogue_zhaomu"], + ["minskin", "stone"], + [2, 2, "rogue"], + ], + stone_haidao: ["male", "qun", 1, [], ["minskin", "stone", "stonehidden"], [1, 2, "rogue"]], + stone_cike: [ + "male", + "qun", + 1, + ["rogue_cisha", "stone_qianxing"], + ["minskin", "stone"], + [1, 1, "rogue"], + ], + stone_duyanhaidao: [ + "male", + "qun", + 2, + ["rogue_duxing"], + ["minskin", "stone"], + [3, 4, "rogue"], + ], + stone_gangtiewushi: [ + "male", + "qun", + 2, + ["rogue_shoudao"], + ["minskin", "stone"], + [3, 2, "rogue"], + ], + stone_lifaji: ["male", "qun", 2, ["rogue_lifa"], ["minskin", "stone"], [2, 2, "rogue"]], + stone_shihualong: [ + "male", + "qun", + 1, + ["rogue_fusheng"], + ["minskin", "stone"], + [3, 2, "rogue"], + ], + stone_xiushuihaidao: [ + "male", + "qun", + 1, + ["rogue_jielue"], + ["minskin", "stone"], + [1, 2, "rogue"], + ], + stone_zousishangfan: [ + "male", + "qun", + 3, + ["rogue_jiaoyi"], + ["minskin", "stone"], + [4, 3, "rogue"], + ], - stone_beijunmushi:['male','qun',2,['priest_shengliao'],['minskin','stone'],[1,1,'priest']], - stone_guanliyuan:['male','qun',2,['priest_faxian'],['minskin','stone'],[2,1,'priest']], - stone_linghunjisi:['female','qun',4,['priest_hunwu'],['minskin','stone'],[4,2,'priest']], - stone_heianjiaotu:['male','qun',3,['priest_zhufu'],['minskin','stone'],[3,2,'priest']], - stone_guangyaozhizi:['male','qun',3,['priest_guangyao'],['minskin','stone'],[5,3,'priest']], - stone_longmianjiaoguan:['male','qun',2,['priest_xundao'],['minskin','stone'],[2,2,'priest']], - stone_shengdianzhishi:['male','qun',4,['priest_puzhao'],['minskin','stone'],[5,4,'priest']], - stone_suoxiaojishi:['male','qun',2,['priest_suoxiao'],['minskin','stone'],[2,2,'priest']], - stone_anyingzisi:['male','qun',3,['priest_shixin'],['minskin','stone'],[4,4,'priest']], - stone_guangmingquan:['male','qun',3,['priest_shengshui'],['minskin','stone'],[2,0,'priest']], - stone_muguangchulong:['male','qun',2,['priest_muguang'],['minskin','stone'],[1,1,'priest']], - stone_shenshengyongshi:['male','qun',3,['priest_shengguang'],['minskin','stone'],[4,3,'priest']], + stone_beijunmushi: [ + "male", + "qun", + 2, + ["priest_shengliao"], + ["minskin", "stone"], + [1, 1, "priest"], + ], + stone_guanliyuan: [ + "male", + "qun", + 2, + ["priest_faxian"], + ["minskin", "stone"], + [2, 1, "priest"], + ], + stone_linghunjisi: [ + "female", + "qun", + 4, + ["priest_hunwu"], + ["minskin", "stone"], + [4, 2, "priest"], + ], + stone_heianjiaotu: [ + "male", + "qun", + 3, + ["priest_zhufu"], + ["minskin", "stone"], + [3, 2, "priest"], + ], + stone_guangyaozhizi: [ + "male", + "qun", + 3, + ["priest_guangyao"], + ["minskin", "stone"], + [5, 3, "priest"], + ], + stone_longmianjiaoguan: [ + "male", + "qun", + 2, + ["priest_xundao"], + ["minskin", "stone"], + [2, 2, "priest"], + ], + stone_shengdianzhishi: [ + "male", + "qun", + 4, + ["priest_puzhao"], + ["minskin", "stone"], + [5, 4, "priest"], + ], + stone_suoxiaojishi: [ + "male", + "qun", + 2, + ["priest_suoxiao"], + ["minskin", "stone"], + [2, 2, "priest"], + ], + stone_anyingzisi: [ + "male", + "qun", + 3, + ["priest_shixin"], + ["minskin", "stone"], + [4, 4, "priest"], + ], + stone_guangmingquan: [ + "male", + "qun", + 3, + ["priest_shengshui"], + ["minskin", "stone"], + [2, 0, "priest"], + ], + stone_muguangchulong: [ + "male", + "qun", + 2, + ["priest_muguang"], + ["minskin", "stone"], + [1, 1, "priest"], + ], + stone_shenshengyongshi: [ + "male", + "qun", + 3, + ["priest_shengguang"], + ["minskin", "stone"], + [4, 3, "priest"], + ], - stone_zhongshi:['male','wei',1,['stone_zhongshi1'],['minskin','stone'],[1,2]], - stone_zhucangzhe:['male','wei',1,['stone_zhucangzhe1'],['minskin','stone'],[1,2]], - stone_huoqiangshou:['male','wei',3,['stone_huoqiangshou1'],['minskin','stone'],[3,1]], + stone_zhongshi: ["male", "wei", 1, ["stone_zhongshi1"], ["minskin", "stone"], [1, 2]], + stone_zhucangzhe: ["male", "wei", 1, ["stone_zhucangzhe1"], ["minskin", "stone"], [1, 2]], + stone_huoqiangshou: ["male", "wei", 3, ["stone_huoqiangshou1"], ["minskin", "stone"], [3, 1]], - stone_lansaizhanshi:['male','shu',1,['stone_chongfeng'],['minskin','stone'],[1,2]], - stone_kutongsiseng:['male','shu',1,['stone_kutongsiseng1'],['minskin','stone'],[1,2]], - stone_yuanguanying:['male','shu',3,['stone_yuanguanying1'],['minskin','stone'],[3,1]], + stone_lansaizhanshi: ["male", "shu", 1, ["stone_chongfeng"], ["minskin", "stone"], [1, 2]], + stone_kutongsiseng: ["male", "shu", 1, ["stone_kutongsiseng1"], ["minskin", "stone"], [1, 2]], + stone_yuanguanying: ["male", "shu", 3, ["stone_yuanguanying1"], ["minskin", "stone"], [3, 1]], - stone_dijieshicong:['male','wu',2,['stone_dijieshicong1'],['minskin','stone'],[1,1]], - stone_yaosaishouwei:['male','wu',2,['stone_yaosaishouwei1'],['minskin','stone'],[1,1]], - stone_famingjia:['male','wu',3,['stone_famingjia1'],['minskin','stone'],[3,1]], + stone_dijieshicong: ["male", "wu", 2, ["stone_dijieshicong1"], ["minskin", "stone"], [1, 1]], + stone_yaosaishouwei: [ + "male", + "wu", + 2, + ["stone_yaosaishouwei1"], + ["minskin", "stone"], + [1, 1], + ], + stone_famingjia: ["male", "wu", 3, ["stone_famingjia1"], ["minskin", "stone"], [3, 1]], - stone_chilundashi:['male','qun',2,['stone_chilundashi1'],['minskin','stone'],[1,1]], - stone_hanguangzhizhe:['male','qun',2,['stone_hanguangzhizhe1'],['minskin','stone'],[2,2]], - stone_aihaozhihun:['male','qun',3,['stone_aihaozhihun1'],['minskin','stone'],[3,1]], + stone_chilundashi: ["male", "qun", 2, ["stone_chilundashi1"], ["minskin", "stone"], [1, 1]], + stone_hanguangzhizhe: [ + "male", + "qun", + 2, + ["stone_hanguangzhizhe1"], + ["minskin", "stone"], + [2, 2], + ], + stone_aihaozhihun: ["male", "qun", 3, ["stone_aihaozhihun1"], ["minskin", "stone"], [3, 1]], - stone_fennuxiaoji:['male','qun',1,['stone_fennuxiaoji1'],['minskin','stone'],[1,2]], - stone_juxingchanchu:['male','qun',2,['stone_juxingchanchu1'],['minskin','stone'],[2,1]], - stone_wuyi:['male','qun',1,['jijiu'],['minskin','stone','die_audio'],[2,2]], - stone_langren:['male','qun',1,['stone_qianxing'],['minskin','stone'],[1,2]], - stone_shishigui:['male','qun',2,['stone_shishigui1'],['minskin','stone'],[2,1]], + stone_fennuxiaoji: ["male", "qun", 1, ["stone_fennuxiaoji1"], ["minskin", "stone"], [1, 2]], + stone_juxingchanchu: [ + "male", + "qun", + 2, + ["stone_juxingchanchu1"], + ["minskin", "stone"], + [2, 1], + ], + stone_wuyi: ["male", "qun", 1, ["jijiu"], ["minskin", "stone", "die_audio"], [2, 2]], + stone_langren: ["male", "qun", 1, ["stone_qianxing"], ["minskin", "stone"], [1, 2]], + stone_shishigui: ["male", "qun", 2, ["stone_shishigui1"], ["minskin", "stone"], [2, 1]], - stone_fatiaozhuru:['female','qun',1,['stone_fatiaozhuru1'],['minskin','stone'],[1,2]], - stone_mingguangjisi:['female','wu',2,['shushen'],['minskin','stone'],[2,1]], - stone_nianqingjisi:['female','wei',2,['stone_zhufu'],['minskin','stone'],[2,1]], - stone_aomishouwei:['female','qun',1,['biyue'],['minskin','stone'],[2,2]], - stone_yanjingshe:['female','qun',2,['stone_yanjingshe1'],['minskin','stone'],[3,2]], - stone_zhiyuzhe:['female','qun',3,['stone_zhiyu'],['minskin','stone'],[3,1]], - stone_mafengzhuru:['female','qun',1,['stone_mafengzhuru1'],['minskin','stone'],[1,2]], + stone_fatiaozhuru: ["female", "qun", 1, ["stone_fatiaozhuru1"], ["minskin", "stone"], [1, 2]], + stone_mingguangjisi: ["female", "wu", 2, ["shushen"], ["minskin", "stone"], [2, 1]], + stone_nianqingjisi: ["female", "wei", 2, ["stone_zhufu"], ["minskin", "stone"], [2, 1]], + stone_aomishouwei: ["female", "qun", 1, ["biyue"], ["minskin", "stone"], [2, 2]], + stone_yanjingshe: ["female", "qun", 2, ["stone_yanjingshe1"], ["minskin", "stone"], [3, 2]], + stone_zhiyuzhe: ["female", "qun", 3, ["stone_zhiyu"], ["minskin", "stone"], [3, 1]], + stone_mafengzhuru: ["female", "qun", 1, ["stone_mafengzhuru1"], ["minskin", "stone"], [1, 2]], - stone_shumiao:['none','wu',1,[],['minskin','stone','stonehidden'],[1,1]], - stone_shuren:['none','wu',2,['stone_chongfeng','stone_zibao'],['minskin','stone','stonehidden'],[2,2]], - stone_shurenx:['none','wu',2,[],['minskin','stone','stonehidden'],[2,2]], - stone_shurenxx:['none','wu',2,['lschaofeng'],['minskin','stone','stonehidden'],[2,2]], - stone_youlinglang:['none','qun',2,['lschaofeng'],['minskin','stone','stonehidden'],[2,2]], - stone_xiaojingling:['none','qun',1,['xuying'],['minskin','stone','stonehidden'],[1,1]], - stone_zhumo:['none','qun',2,[],['minskin','stone','stonehidden'],[2,2]], - stone_jingxiang:['none','qun',2,['stone_jingxiang','lschaofeng'],['minskin','stone','stonehidden'],[2,0]], - stone_shengguanghuwei:['female','qun',2,['priest_shengguang'],['minskin','stone','stonehidden'],[1,1]], - stone_liegou:['none','qun',1,['stone_chongfeng'],['minskin','stone','stonehidden'],[1,2]], - stone_mianyang:['none','qun',1,['mage_mianyang'],['minskin','stone','stonehidden'],[1,0]], - stone_qingwa:['none','wu',1,['shaman_qingwa'],['minskin','stone','stonehidden'],[1,0]], - stone_shengjiachong:['none','qun',1,['lschaofeng'],['minskin','stone','stonehidden'],[1,1]], + stone_shumiao: ["none", "wu", 1, [], ["minskin", "stone", "stonehidden"], [1, 1]], + stone_shuren: [ + "none", + "wu", + 2, + ["stone_chongfeng", "stone_zibao"], + ["minskin", "stone", "stonehidden"], + [2, 2], + ], + stone_shurenx: ["none", "wu", 2, [], ["minskin", "stone", "stonehidden"], [2, 2]], + stone_shurenxx: [ + "none", + "wu", + 2, + ["lschaofeng"], + ["minskin", "stone", "stonehidden"], + [2, 2], + ], + stone_youlinglang: [ + "none", + "qun", + 2, + ["lschaofeng"], + ["minskin", "stone", "stonehidden"], + [2, 2], + ], + stone_xiaojingling: [ + "none", + "qun", + 1, + ["xuying"], + ["minskin", "stone", "stonehidden"], + [1, 1], + ], + stone_zhumo: ["none", "qun", 2, [], ["minskin", "stone", "stonehidden"], [2, 2]], + stone_jingxiang: [ + "none", + "qun", + 2, + ["stone_jingxiang", "lschaofeng"], + ["minskin", "stone", "stonehidden"], + [2, 0], + ], + stone_shengguanghuwei: [ + "female", + "qun", + 2, + ["priest_shengguang"], + ["minskin", "stone", "stonehidden"], + [1, 1], + ], + stone_liegou: [ + "none", + "qun", + 1, + ["stone_chongfeng"], + ["minskin", "stone", "stonehidden"], + [1, 2], + ], + stone_mianyang: [ + "none", + "qun", + 1, + ["mage_mianyang"], + ["minskin", "stone", "stonehidden"], + [1, 0], + ], + stone_qingwa: [ + "none", + "wu", + 1, + ["shaman_qingwa"], + ["minskin", "stone", "stonehidden"], + [1, 0], + ], + stone_shengjiachong: [ + "none", + "qun", + 1, + ["lschaofeng"], + ["minskin", "stone", "stonehidden"], + [1, 1], + ], - stone_tuteng1:['none','qun',2,['shaman_tuteng','lschaofeng'],['minskin','stone','stonehidden'],[2,0]], - stone_tuteng2:['none','qun',2,['shaman_tuteng','shaman_zhuore'],['minskin','stone','stonehidden'],[2,0]], - stone_tuteng3:['none','qun',2,['shaman_tuteng','shaman_fali'],['minskin','stone','stonehidden'],[2,0]], - stone_tuteng4:['none','qun',2,['shaman_tuteng','shaman_zhiliao'],['minskin','stone','stonehidden'],[2,0]], - stone_xinbing:['none','qun',2,[],['minskin','stone','stonehidden'],[2,0]], + stone_tuteng1: [ + "none", + "qun", + 2, + ["shaman_tuteng", "lschaofeng"], + ["minskin", "stone", "stonehidden"], + [2, 0], + ], + stone_tuteng2: [ + "none", + "qun", + 2, + ["shaman_tuteng", "shaman_zhuore"], + ["minskin", "stone", "stonehidden"], + [2, 0], + ], + stone_tuteng3: [ + "none", + "qun", + 2, + ["shaman_tuteng", "shaman_fali"], + ["minskin", "stone", "stonehidden"], + [2, 0], + ], + stone_tuteng4: [ + "none", + "qun", + 2, + ["shaman_tuteng", "shaman_zhiliao"], + ["minskin", "stone", "stonehidden"], + [2, 0], + ], + stone_xinbing: ["none", "qun", 2, [], ["minskin", "stone", "stonehidden"], [2, 0]], - stone_siwangzhiyi:['male','qun',4,['stone_mieshi'],['minskin','stone','stonehidden','stonelegend'],[6,4]], - stone_alaikesita:['female','qun',4,['stone_fushi'],['minskin','stone','stonehidden','stonelegend'],[6,4]], - stone_yisela:['female','qun',4,['stone_chenshui'],['minskin','stone','stonehidden','stonelegend'],[6,2]], - stone_nuoziduomu:['male','qun',4,['stone_shixu'],['minskin','stone','stonehidden','stonelegend'],[6,4]], - stone_maligousi:['male','qun',4,['stone_mowang'],['minskin','stone','stonehidden','stonelegend'],[6,2]], + stone_siwangzhiyi: [ + "male", + "qun", + 4, + ["stone_mieshi"], + ["minskin", "stone", "stonehidden", "stonelegend"], + [6, 4], + ], + stone_alaikesita: [ + "female", + "qun", + 4, + ["stone_fushi"], + ["minskin", "stone", "stonehidden", "stonelegend"], + [6, 4], + ], + stone_yisela: [ + "female", + "qun", + 4, + ["stone_chenshui"], + ["minskin", "stone", "stonehidden", "stonelegend"], + [6, 2], + ], + stone_nuoziduomu: [ + "male", + "qun", + 4, + ["stone_shixu"], + ["minskin", "stone", "stonehidden", "stonelegend"], + [6, 4], + ], + stone_maligousi: [ + "male", + "qun", + 4, + ["stone_mowang"], + ["minskin", "stone", "stonehidden", "stonelegend"], + [6, 2], + ], - stone_aolajier:['male','qun',4,['stone_chongfeng','shaman_fengnu','paladin_hudun','lschaofeng'],['minskin','stone','stonehidden','stonelegend_shaman'],[6,4]], - stone_andongni:['male','qun',4,['stone_zhiyin'],['minskin','stone','stonehidden','stonelegend_mage'],[6,4]], - stone_jialakesi:['male','qun',6,['stone_bianshen'],['minskin','stone','stonehidden','stonelegend_warlock'],[6,0]], - stone_jialakesix:['male','qun',6,['stone_lianyu'],['modeimage','stonehidden','stonespecial']], - stone_kelushi:['male','qun',5,['stone_chongfeng'],['minskin','stone','stonehidden','stonelegend_hunter'],[6,5]], - stone_geluomashi:['male','qun',4,['stone_chongfeng','stone_jinu'],['minskin','stone','stonehidden','stonelegend_warrior'],[6,4]], - stone_aidewen:['male','qun',3,['stone_lianji'],['minskin','stone','stonehidden','stonelegend_rogue'],[6,3]], - stone_sainaliusi:['male','qun',3,['stone_shenyu'],['minskin','stone','stonehidden','stonelegend_druid'],[6,3]], - stone_fuding:['male','qun',3,['paladin_hudun','lschaofeng','stone_fuchou'],['minskin','stone','stonehidden','stonelegend_paladin'],[6,3]], - stone_weilun:['male','qun',4,['stone_shenyou'],['minskin','stone','stonehidden','stonelegend_priest'],[6,6]], - } + stone_aolajier: [ + "male", + "qun", + 4, + ["stone_chongfeng", "shaman_fengnu", "paladin_hudun", "lschaofeng"], + ["minskin", "stone", "stonehidden", "stonelegend_shaman"], + [6, 4], + ], + stone_andongni: [ + "male", + "qun", + 4, + ["stone_zhiyin"], + ["minskin", "stone", "stonehidden", "stonelegend_mage"], + [6, 4], + ], + stone_jialakesi: [ + "male", + "qun", + 6, + ["stone_bianshen"], + ["minskin", "stone", "stonehidden", "stonelegend_warlock"], + [6, 0], + ], + stone_jialakesix: [ + "male", + "qun", + 6, + ["stone_lianyu"], + ["modeimage", "stonehidden", "stonespecial"], + ], + stone_kelushi: [ + "male", + "qun", + 5, + ["stone_chongfeng"], + ["minskin", "stone", "stonehidden", "stonelegend_hunter"], + [6, 5], + ], + stone_geluomashi: [ + "male", + "qun", + 4, + ["stone_chongfeng", "stone_jinu"], + ["minskin", "stone", "stonehidden", "stonelegend_warrior"], + [6, 4], + ], + stone_aidewen: [ + "male", + "qun", + 3, + ["stone_lianji"], + ["minskin", "stone", "stonehidden", "stonelegend_rogue"], + [6, 3], + ], + stone_sainaliusi: [ + "male", + "qun", + 3, + ["stone_shenyu"], + ["minskin", "stone", "stonehidden", "stonelegend_druid"], + [6, 3], + ], + stone_fuding: [ + "male", + "qun", + 3, + ["paladin_hudun", "lschaofeng", "stone_fuchou"], + ["minskin", "stone", "stonehidden", "stonelegend_paladin"], + [6, 3], + ], + stone_weilun: [ + "male", + "qun", + 4, + ["stone_shenyou"], + ["minskin", "stone", "stonehidden", "stonelegend_priest"], + [6, 6], + ], + }, }, - careerList:['mage','shaman','druid','paladin','rogue','priest','hunter','warrior','warlock'], - game:{ - reserveDead:true, - bannedcards:['lebu','guiyoujie','xietianzi','lingjiandai','jiguanshu','sifeizhenmian','fengxueren','chuansongmen'], - onwash:function(){ - if(_status.mode!='deck') return; - var list=[]; - for(var i=0;i'+i+'',buttons,clickButton); - ui.create.div('.menubutton.round',deckitem).dataset.career=lib.storage.deckList[i].career; - deckitem.name=i; + for (var i in lib.storage.deckList) { + if (lib.storage.deckList[i].deck.length == 30) { + var deckitem = ui.create.div( + ".deckitem.shadowed", + "" + i + "", + buttons, + clickButton + ); + ui.create.div(".menubutton.round", deckitem).dataset.career = + lib.storage.deckList[i].career; + deckitem.name = i; } } - for(var i=0;i随机',buttons,clickButton); - ui.create.div('.menubutton.round',deckitem).dataset.career=lib.careerList[i]; - deckitem.name='random:'+lib.careerList[i]; + for (var i = 0; i < lib.careerList.length; i++) { + var deckitem = ui.create.div( + ".deckitem.shadowed", + "随机", + buttons, + clickButton + ); + ui.create.div(".menubutton.round", deckitem).dataset.career = + lib.careerList[i]; + deckitem.name = "random:" + lib.careerList[i]; } event.dialog.open(); - } - else{ - var bn=parseInt(get.config('battle_number')); - for(var i=0;ib) return 1; - if(a==b) return 0; + deck.sort(function (a, b) { + if (a > b) return 1; + if (a == b) return 0; return -1; }); - player.deck=name; - player.career=career; - if(!player.node.career){ - player.node.career=ui.create.div('.menubutton.round.identity',player); - player.node.career.dataset.career=career; - lib.setIntro(player.node.career,null,true); + player.deck = name; + player.career = career; + if (!player.node.career) { + player.node.career = ui.create.div(".menubutton.round.identity", player); + player.node.career.dataset.career = career; + lib.setIntro(player.node.career, null, true); } - if(!player.deckCards) player.deckCards=[]; - for(var i=0;i=2) return 1; + ai: { + order: 7, + value: 5, + useful: 5, + result: { + player: function (player) { + if (player.getEnemy().countFellow() >= 2) return 1; return 0; - } - } - } + }, + }, + }, }, - spell_linghunhongxi:{ - type:'stonecard', - stoneact:4, - career:'warlock', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ + spell_linghunhongxi: { + type: "stonecard", + stoneact: 4, + career: "warlock", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { return target.isMin(); }, - content:function(){ - 'step 0' + content: function () { + "step 0"; target.die(); - 'step 1' + "step 1"; player.recover(); }, - ai:{ - order:7.5, - value:5, - useful:5, - result:{ - target:function(player,target){ - return -target.hp-target.countCards('h')/2; - } - } - } + ai: { + order: 7.5, + value: 5, + useful: 5, + result: { + target: function (player, target) { + return -target.hp - target.countCards("h") / 2; + }, + }, + }, }, - spell_fushishu:{ - type:'stonecard', - stoneact:2, - career:'warlock', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - return target.isMin()&&!target.hasSkill('warlock_fushishu'); + spell_fushishu: { + type: "stonecard", + stoneact: 2, + career: "warlock", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { + return target.isMin() && !target.hasSkill("warlock_fushishu"); }, - content:function(){ - target.addSkill('warlock_fushishu'); + content: function () { + target.addSkill("warlock_fushishu"); + }, + ai: { + order: 7.5, + value: 5, + useful: 5, + result: { + target: function (player, target) { + return -target.hp - target.countCards("h") / 2; + }, + }, }, - ai:{ - order:7.5, - value:5, - useful:5, - result:{ - target:function(player,target){ - return -target.hp-target.countCards('h')/2; - } - } - } }, - spell_fuchoudaji:{ - type:'stonecard', - fullimage:true, - enable:true, - stoneact:3, - career:'warrior', - filterTarget:function(card,player,target){ + spell_fuchoudaji: { + type: "stonecard", + fullimage: true, + enable: true, + stoneact: 3, + career: "warrior", + filterTarget: function (card, player, target) { return target.isMin(); }, - selectTarget:-1, - content:function(){ - if(player.hp<=2){ + selectTarget: -1, + content: function () { + if (player.hp <= 2) { target.damage(3); - } - else{ + } else { target.damage(); } }, - ai:{ - order:8.9, - value:5, - useful:5, - result:{ - target:-1.5 + ai: { + order: 8.9, + value: 5, + useful: 5, + result: { + target: -1.5, + }, + tag: { + damage: 1, + multitarget: 1, + multineg: 1, }, - tag:{ - damage:1, - multitarget:1, - multineg:1, - } - } - }, - spell_yingyongdaji:{ - type:'stonecard', - stoneact:2, - career:'warrior', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - return target.side!=player.side; }, - content:function(){ - 'step 0' - player.damage(2,target); - 'step 1' + }, + spell_yingyongdaji: { + type: "stonecard", + stoneact: 2, + career: "warrior", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { + return target.side != player.side; + }, + content: function () { + "step 0"; + player.damage(2, target); + "step 1"; target.damage(2); }, - ai:{ - order:8, - value:5, - useful:5, - result:{ - target:function(player,target){ - if(player.hujia>=2) return -1.5; - if(player.hujia==1){ - if(player.hp>3) return -1.5; + ai: { + order: 8, + value: 5, + useful: 5, + result: { + target: function (player, target) { + if (player.hujia >= 2) return -1.5; + if (player.hujia == 1) { + if (player.hp > 3) return -1.5; return 0; } return 0; - } + }, }, - tag:{ - damage:1, - } - } + tag: { + damage: 1, + }, + }, }, - spell_zhandounuhuo:{ - type:'stonecard', - fullimage:true, - enable:function(event,player){ - for(var i=0;i=2) return -1.5; + if (num >= 2) return -1.5; } } return 0; }, - tag:{ - damage:1 - } - } - } + tag: { + damage: 1, + }, + }, + }, }, - spell_jinyingduijue:{ - type:'stonecard', - stoneact:4, - career:'paladin', - enable:function(card,player){ - var n1=player.countFellow(); - var n2=player.getEnemy().countFellow(); - return n1>0&&n2>0&&n1+n2>2; + spell_jinyingduijue: { + type: "stonecard", + stoneact: 4, + career: "paladin", + enable: function (card, player) { + var n1 = player.countFellow(); + var n2 = player.getEnemy().countFellow(); + return n1 > 0 && n2 > 0 && n1 + n2 > 2; }, - fullimage:true, - filterTarget:function(card,player,target){ + fullimage: true, + filterTarget: function (card, player, target) { return target.isMin(); }, - selectTarget:-1, - multitarget:true, - multiline:true, - content:function(){ - 'step 0' - if(!targets.length){ + selectTarget: -1, + multitarget: true, + multiline: true, + content: function () { + "step 0"; + if (!targets.length) { event.finish(); return; } - var maxf=[],maxe=[]; - for(var i=0;i maxf[0].hp) { + maxf.length = 0; maxf.push(targets[i]); } - else if(targets[i].hp>maxf[0].hp){ - maxf.length=0; - maxf.push(targets[i]); - } - } - else{ - if(!maxe.length||targets[i].hp==maxe[0].hp){ + } else { + if (!maxe.length || targets[i].hp == maxe[0].hp) { maxe.push(targets[i]); - } - else if(targets[i].hp>maxe[0].hp){ - maxe.length=0; + } else if (targets[i].hp > maxe[0].hp) { + maxe.length = 0; maxe.push(targets[i]); } } } - if(maxf.length){ + if (maxf.length) { targets.remove(maxf.randomGet()); } - if(maxe.length){ + if (maxe.length) { targets.remove(maxe.randomGet()); } targets.sort(lib.sort.seat); - event.targets=targets; - 'step 1' - if(event.targets.length){ + event.targets = targets; + "step 1"; + if (event.targets.length) { event.targets.shift().die(); event.redo(); } }, - ai:{ - order:9, - value:2, - useful:2, - result:{ - player:function(player,target){ - return player.getEnemy().countFellow()-player.countFellow(); - } - } - } + ai: { + order: 9, + value: 2, + useful: 2, + result: { + player: function (player, target) { + return player.getEnemy().countFellow() - player.countFellow(); + }, + }, + }, }, - spell_zhihuizhufu:{ - type:'stonecard', - stoneact:1, - career:'paladin', - enable:function(card,player){ + spell_zhihuizhufu: { + type: "stonecard", + stoneact: 1, + career: "paladin", + enable: function (card, player) { return !player.isMin(); }, - fullimage:true, - filterTarget:function(card,player,target){ - return target.isMin()&&!target.hasSkill('paladin_zhihuizhufu'); + fullimage: true, + filterTarget: function (card, player, target) { + return target.isMin() && !target.hasSkill("paladin_zhihuizhufu"); }, - content:function(){ - target.addSkill('paladin_zhihuizhufu'); - target.storage.paladin_zhihuizhufu=player; + content: function () { + target.addSkill("paladin_zhihuizhufu"); + target.storage.paladin_zhihuizhufu = player; }, - ai:{ - order:2, - value:5, - useful:5, - result:{ - player:function(player,target){ + ai: { + order: 2, + value: 5, + useful: 5, + result: { + player: function (player, target) { return target.hp; - } - } - } + }, + }, + }, }, - spell_shenshengfennu:{ - type:'stonecard', - stoneact:5, - career:'paladin', - enable:true, - fullimage:true, - filterTarget:true, - content:function(){ - 'step 0' - event.card=player.getDeckCards()[0]; - player.gain(event.card,'gain2','log'); - 'step 1' - var num=lib.card[event.card.name].stoneact; - if(num&&typeof num=='number'){ + spell_shenshengfennu: { + type: "stonecard", + stoneact: 5, + career: "paladin", + enable: true, + fullimage: true, + filterTarget: true, + content: function () { + "step 0"; + event.card = player.getDeckCards()[0]; + player.gain(event.card, "gain2", "log"); + "step 1"; + var num = lib.card[event.card.name].stoneact; + if (num && typeof num == "number") { target.damage(num); } }, - ai:{ - order:6, - value:2, - useful:2, - result:{ - target:-2 + ai: { + order: 6, + value: 2, + useful: 2, + result: { + target: -2, }, - tag:{ - damage:2 - } - } + tag: { + damage: 2, + }, + }, }, - spell_yongshizhufu:{ - type:'stonecard', - stoneact:2, - career:'paladin', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - return target.isMin()&&target.countCards('h')>0; + spell_yongshizhufu: { + type: "stonecard", + stoneact: 2, + career: "paladin", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { + return target.isMin() && target.countCards("h") > 0; }, - content:function(){ - target.draw(target.countCards('h')); + content: function () { + target.draw(target.countCards("h")); + }, + ai: { + order: 4, + value: 2, + useful: 2, + result: { + target: function (player, target) { + return Math.max(0, target.countCards("h") - 1); + }, + }, }, - ai:{ - order:4, - value:2, - useful:2, - result:{ - target:function(player,target){ - return Math.max(0,target.countCards('h')-1); - } - } - } }, - spell_shenpan:{ - type:'stonecard', - stoneact:2, - career:'paladin', - enable:function(card,player){ - var num=player.getEnemy().countFellow(); - return num>0&&num>=player.countFellow(); + spell_shenpan: { + type: "stonecard", + stoneact: 2, + career: "paladin", + enable: function (card, player) { + var num = player.getEnemy().countFellow(); + return num > 0 && num >= player.countFellow(); }, - fullimage:true, - notarget:true, - content:function(){ - var target=player.getEnemy().getFellow().randomGet(); + fullimage: true, + notarget: true, + content: function () { + var target = player.getEnemy().getFellow().randomGet(); player.line(target); target.die(); }, - ai:{ - order:9, - value:4, - useful:4, - result:{ - player:1 - } - } + ai: { + order: 9, + value: 4, + useful: 4, + result: { + player: 1, + }, + }, }, - spell_zhengqianghaosheng:{ - type:'stonecard', - stoneact:2, - career:'paladin', - enable:function(card,player){ - return !player.hasSkill('paladin_zhengqianghaosheng'); + spell_zhengqianghaosheng: { + type: "stonecard", + stoneact: 2, + career: "paladin", + enable: function (card, player) { + return !player.hasSkill("paladin_zhengqianghaosheng"); }, - fullimage:true, - filterTarget:function(card,player,target){ - return player==target; + fullimage: true, + filterTarget: function (card, player, target) { + return player == target; }, - selectTarget:-1, - content:function(){ - player.addSkill('paladin_zhengqianghaosheng'); + selectTarget: -1, + content: function () { + player.addSkill("paladin_zhengqianghaosheng"); }, - ai:{ - order:3, - value:4, - useful:4, - result:{ - player:function(player){ - if(player.countFellow()>=2) return 1; + ai: { + order: 3, + value: 4, + useful: 4, + result: { + player: function (player) { + if (player.countFellow() >= 2) return 1; return 0; - } - } - } + }, + }, + }, }, - spell_zhenyanshu:{ - type:'stonecard', - stoneact:1, - career:'priest', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ + spell_zhenyanshu: { + type: "stonecard", + stoneact: 1, + career: "priest", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { return target.isMin(); }, - content:function(){ + content: function () { target.maxHp++; target.hp++; target.update(); player.drawDeck(); }, - ai:{ - order:7, - value:3, - useful:3, - result:{ - target:function(player,target){ - return Math.max(1,10-target.hp); - } - } - } + ai: { + order: 7, + value: 3, + useful: 3, + result: { + target: function (player, target) { + return Math.max(1, 10 - target.hp); + }, + }, + }, }, - spell_enzeshu:{ - type:'stonecard', - stoneact:3, - career:'priest', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ + spell_enzeshu: { + type: "stonecard", + stoneact: 3, + career: "priest", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { return target.isMin(); }, - content:function(){ - target.maxHp+=3; - target.hp+=3; + content: function () { + target.maxHp += 3; + target.hp += 3; target.update(); }, - ai:{ - order:5, - value:3, - useful:3, - result:{ - target:function(player,target){ - return Math.max(1,10-target.hp); - } - } - } + ai: { + order: 5, + value: 3, + useful: 3, + result: { + target: function (player, target) { + return Math.max(1, 10 - target.hp); + }, + }, + }, }, - spell_anyingxingtai:{ - type:'stonecard', - stoneact:2, - career:'priest', - recastable:true, - enable:function(event,player){ - if(player.career!='priest') return false; - return !player.storage.anyingxingtai||player.storage.anyingxingtai<2; + spell_anyingxingtai: { + type: "stonecard", + stoneact: 2, + career: "priest", + recastable: true, + enable: function (event, player) { + if (player.career != "priest") return false; + return !player.storage.anyingxingtai || player.storage.anyingxingtai < 2; }, - fullimage:true, - filterTarget:function(card,player,target){ - return player==target; + fullimage: true, + filterTarget: function (card, player, target) { + return player == target; }, - selectTarget:-1, - content:function(){ - if(typeof player.storage.anyingxingtai!='number'){ - player.storage.anyingxingtai=1; + selectTarget: -1, + content: function () { + if (typeof player.storage.anyingxingtai != "number") { + player.storage.anyingxingtai = 1; + } else if (player.storage.anyingxingtai < 2) { + player.storage.anyingxingtai = 2; } - else if(player.storage.anyingxingtai<2){ - player.storage.anyingxingtai=2; - } - player.markSkill('priest_anyingxingtai'); + player.markSkill("priest_anyingxingtai"); + }, + ai: { + order: 6.1, + value: 3, + useful: 3, + result: { + player: 1, + }, }, - ai:{ - order:6.1, - value:3, - useful:3, - result:{ - player:1 - } - } }, - spell_kuaisuzhiliao:{ - type:'stonecard', - stoneact:2, - career:'priest', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - if(player.hasFellowSkill('priest_hunwu')){ + spell_kuaisuzhiliao: { + type: "stonecard", + stoneact: 2, + career: "priest", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { + if (player.hasFellowSkill("priest_hunwu")) { return true; } - return target.hp=2) return 1; + if (num >= 2) return 1; } } return 0; - } - } - } + }, + }, + }, }, - spell_heiandiyu:{ - fullimage:true, - type:'stonecard', - enable:true, - stoneact:4, - career:'druid', - filterTarget:function(card,player,target){ + spell_heiandiyu: { + fullimage: true, + type: "stonecard", + enable: true, + stoneact: 4, + career: "druid", + filterTarget: function (card, player, target) { return target.isMin(); }, - multitarget:true, - targetprompt:['增加体力并摸牌'], - selectTarget:[0,1], - notarget:true, - content:function(){ - 'step 0' - if(targets.length){ + multitarget: true, + targetprompt: ["增加体力并摸牌"], + selectTarget: [0, 1], + notarget: true, + content: function () { + "step 0"; + if (targets.length) { targets[0].maxHp++; targets[0].hp++; target.update(); targets[0].draw(3); event.finish(); + } else { + event.num = 0; } - else{ - event.num=0; - } - 'step 1' - if(player.canAddFellow()&&event.num++<10){ - player.addFellowAuto('stone_xiaojingling'); + "step 1"; + if (player.canAddFellow() && event.num++ < 10) { + player.addFellowAuto("stone_xiaojingling"); event.redo(); } }, - ai:{ - order:5, - result:{ - target:function(player,target){ - return Math.max(1,target.hp-target.countCards('h')); + ai: { + order: 5, + result: { + target: function (player, target) { + return Math.max(1, target.hp - target.countCards("h")); }, - } - } + }, + }, }, - spell_ziyang:{ - type:'stonecard', - stoneact:3, - career:'druid', - enable:function(card,player){ - return player.deckCards&&!player.isMin(); + spell_ziyang: { + type: "stonecard", + stoneact: 3, + career: "druid", + enable: function (card, player) { + return player.deckCards && !player.isMin(); }, - fullimage:true, - filterTarget:function(card,player,target){ - return player==target; + fullimage: true, + filterTarget: function (card, player, target) { + return player == target; }, - selectTarget:-1, - content:function(){ - 'step 0' - if(player.hasSkill('druid_ziyang')){ + selectTarget: -1, + content: function () { + "step 0"; + if (player.hasSkill("druid_ziyang")) { player.drawDeck(3); event.finish(); - } - else{ - player.chooseControl('获得行动值','摸牌').ai=function(){ - if(player.countCards('h')<=1) return '摸牌'; - return '获得行动值'; + } else { + player.chooseControl("获得行动值", "摸牌").ai = function () { + if (player.countCards("h") <= 1) return "摸牌"; + return "获得行动值"; }; } - 'step 1' - if(result.control=='摸牌'){ + "step 1"; + if (result.control == "摸牌") { player.drawDeck(3); - } - else{ - player.addSkill('druid_ziyang'); + } else { + player.addSkill("druid_ziyang"); } }, - ai:{ - order:1, - value:4, - useful:4, - result:{ - player:1 - } - } + ai: { + order: 1, + value: 4, + useful: 4, + result: { + player: 1, + }, + }, }, - spell_xingchenzhuiluo:{ - type:'stonecard', - fullimage:true, - enable:true, - stoneact:6, - career:'druid', - targetprompt:['造成五点伤害'], - multitarget:true, - filterTarget:function(card,player,target){ - return target.side!=player.side&&target.isMin(); + spell_xingchenzhuiluo: { + type: "stonecard", + fullimage: true, + enable: true, + stoneact: 6, + career: "druid", + targetprompt: ["造成五点伤害"], + multitarget: true, + filterTarget: function (card, player, target) { + return target.side != player.side && target.isMin(); }, - selectTarget:[0,1], - notarget:true, - content:function(){ - 'step 0' - if(targets.length){ + selectTarget: [0, 1], + notarget: true, + content: function () { + "step 0"; + if (targets.length) { targets[0].damage(4); event.finish(); - } - else{ - var list=player.getFellow(true); - if(list.length){ + } else { + var list = player.getFellow(true); + if (list.length) { list.sort(lib.sort.seat); - event.list=list; + event.list = list; player.line(list); - } - else{ + } else { event.finish(); } } - 'step 1' - if(event.list.length){ + "step 1"; + if (event.list.length) { event.list.shift().damage(2); event.redo(); } }, - ai:{ - order:7, - useful:5, - value:5, - result:{ - target:function(player,target){ - if(target==player.getEnemy()) return -2; + ai: { + order: 7, + useful: 5, + value: 5, + result: { + target: function (player, target) { + if (target == player.getEnemy()) return -2; return -1; - } + }, }, - tag:{ - damage:2 - } - } + tag: { + damage: 2, + }, + }, }, - spell_fennu:{ - type:'stonecard', - fullimage:true, - enable:true, - stoneact:2, - career:'druid', - filterTarget:function(card,player,target){ + spell_fennu: { + type: "stonecard", + fullimage: true, + enable: true, + stoneact: 2, + career: "druid", + filterTarget: function (card, player, target) { return target.isMin(); }, - content:function(){ - 'step 0' - player.chooseControl('两点','一点').prompt='造成2点伤害,或造成1点伤害并从牌库中获得一张牌'; - 'step 1' - if(result.control=='一点'){ + content: function () { + "step 0"; + player.chooseControl("两点", "一点").prompt = + "造成2点伤害,或造成1点伤害并从牌库中获得一张牌"; + "step 1"; + if (result.control == "一点") { target.damage(); - } - else{ + } else { target.damage(2); event.finish(); } - 'step 2' + "step 2"; player.drawDeck(); }, - ai:{ - order:8, - value:5, - useful:5, - result:{ - target:-1 + ai: { + order: 8, + value: 5, + useful: 5, + result: { + target: -1, }, - tag:{ - damage:2, - } - } + tag: { + damage: 2, + }, + }, }, - spell_fugen:{ - type:'stonecard', - stoneact:2, - career:'druid', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ + spell_fugen: { + type: "stonecard", + stoneact: 2, + career: "druid", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { return target.isMin(); }, - content:function(){ - 'step 0' + content: function () { + "step 0"; target.die(); - 'step 1' - var list=[]; - for(var i in lib.card){ - if(lib.card[i].stonehidden) continue; - if(lib.card[i].type=='stonecharacter'){ + "step 1"; + var list = []; + for (var i in lib.card) { + if (lib.card[i].stonehidden) continue; + if (lib.card[i].type == "stonecharacter") { list.push(i); } } - player.getEnemy().gain(game.createCard(list.randomGet()),'draw'); + player.getEnemy().gain(game.createCard(list.randomGet()), "draw"); + }, + ai: { + order: 8.8, + value: 5, + useful: 5, + result: { + target: function (player, target) { + return -target.hp - target.countCards("h") / 2; + }, + }, }, - ai:{ - order:8.8, - value:5, - useful:5, - result:{ - target:function(player,target){ - return -target.hp-target.countCards('h')/2; - } - } - } }, - spell_mengun:{ - type:'stonecard', - stoneact:2, - career:'rogue', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - return target.isMin()&&target.side!=player.side; + spell_mengun: { + type: "stonecard", + stoneact: 2, + career: "rogue", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { + return target.isMin() && target.side != player.side; }, - content:function(){ - 'step 0' - target.die()._triggered=null; - event.name=target.name; - 'step 1' - player.getEnemy().gain(game.createCard(event.name+'_stonecharacter'),'gain2'); + content: function () { + "step 0"; + target.die()._triggered = null; + event.name = target.name; + "step 1"; + player.getEnemy().gain(game.createCard(event.name + "_stonecharacter"), "gain2"); + }, + ai: { + order: 8.8, + value: 5, + useful: 5, + result: { + target: function (player, target) { + return -target.hp - target.countCards("h") / 2; + }, + }, }, - ai:{ - order:8.8, - value:5, - useful:5, - result:{ - target:function(player,target){ - return -target.hp-target.countCards('h')/2; - } - } - } }, - spell_jipao:{ - type:'stonecard', - stoneact:3, - career:'rogue', - enable:function(card,player){ + spell_jipao: { + type: "stonecard", + stoneact: 3, + career: "rogue", + enable: function (card, player) { return !player.isMin(); }, - fullimage:true, - filterTarget:function(card,player,target){ - return target==player; + fullimage: true, + filterTarget: function (card, player, target) { + return target == player; }, - selectTarget:-1, - content:function(){ - if(!player.isMin()){ + selectTarget: -1, + content: function () { + if (!player.isMin()) { player.drawDeck(4); } }, - ai:{ - order:1, - value:3, - useful:3, - result:{ - player:1 - } - } - }, - spell_beici:{ - type:'stonecard', - stoneact:0, - career:'rogue', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - return target.isMin()&&target.hp==target.maxHp; + ai: { + order: 1, + value: 3, + useful: 3, + result: { + player: 1, + }, }, - content:function(){ + }, + spell_beici: { + type: "stonecard", + stoneact: 0, + career: "rogue", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { + return target.isMin() && target.hp == target.maxHp; + }, + content: function () { target.loseHp(); }, - ai:{ - order:9, - result:{ - target:-1 + ai: { + order: 9, + result: { + target: -1, }, - value:6, - useful:6, - } - }, - spell_weijisifu:{ - type:'stonecard', - stoneact:2, - career:'rogue', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - return target==player.getEnemy(); + value: 6, + useful: 6, }, - selectTarget:-1, - content:function(){ - if(target.deckCards){ - var cards=[]; - for(var i=0;i<3;i++){ - cards.push(game.createCard('spell_zhumo')); + }, + spell_weijisifu: { + type: "stonecard", + stoneact: 2, + career: "rogue", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { + return target == player.getEnemy(); + }, + selectTarget: -1, + content: function () { + if (target.deckCards) { + var cards = []; + for (var i = 0; i < 3; i++) { + cards.push(game.createCard("spell_zhumo")); } - player.$give(cards,target); - for(var i=0;i0; + spell_laojiuhuoba: { + type: "stonecard", + fullimage: true, + enable: true, + stoneact: 2, + career: "mage", + filterTarget: true, + content: function () { + target.damage("fire"); + if (player.deckCards) { + player.deckCards.push(game.createCard("spell_chirehuoba")); + } }, - stoneact:2, - career:'mage', - filterTarget:function(card,player,target){ - return target.side!=player.side&&target.isMin(); + ai: { + order: 7, + value: 4, + useful: 4, + result: { + target: -1, + }, + tag: { + damage: 1, + natureDamage: 1, + fireDamage: 1, + }, }, - selectTarget:-1, - multitarget:true, - multiline:true, - content:function(){ - 'step 0' - if(!targets.length){ + }, + spell_chirehuoba: { + type: "stonecard", + fullimage: true, + enable: true, + stoneact: 2, + career: "mage", + stonehidden: true, + filterTarget: true, + content: function () { + target.damage(2, "fire"); + }, + ai: { + order: 7, + value: 6, + useful: 6, + result: { + target: -2, + }, + tag: { + damage: 2, + natureDamage: 2, + fireDamage: 2, + }, + }, + }, + spell_hanbingpingzhang: { + type: "stonecard", + stoneact: 1, + career: "mage", + enable: true, + fullimage: true, + filterTarget: true, + content: function () { + if (target.maxHp < 2) { + target.maxHp = 2; + } + if (target.hp < 2) { + target.hp = 2; + target.update(); + } + target.addSkill("mage_hanbingpingzhang"); + }, + ai: { + order: 1, + value: 3, + useful: 3, + result: { + target: function (player, target) { + if (target.hp <= 2) return 3 - target.hp; + return 0; + }, + }, + }, + }, + spell_aoshufeidan: { + type: "stonecard", + fullimage: true, + enable: function (event, player) { + return player.getEnemy().countFellow() > 0; + }, + stoneact: 2, + career: "mage", + filterTarget: function (card, player, target) { + return target.side != player.side && target.isMin(); + }, + selectTarget: -1, + multitarget: true, + multiline: true, + content: function () { + "step 0"; + if (!targets.length) { event.finish(); return; } - var map=[]; - for(var i=0;i1) return target.hp; + ai: { + order: 4, + value: 4, + useful: 4, + result: { + target: function (player, target) { + if (target.hasSkill("shaman_tuteng")) return 0; + if (target.hp > 1) return target.hp; return 0; - } - } - } + }, + }, + }, }, - spell_shihuawuqi:{ - type:'stonecard', - stoneact:1, - career:'shaman', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - return target.isMin()&&!target.hasSkill('shaman_shihuawuqi'); + spell_shihuawuqi: { + type: "stonecard", + stoneact: 1, + career: "shaman", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { + return target.isMin() && !target.hasSkill("shaman_shihuawuqi"); }, - content:function(){ - target.addSkill('shaman_shihuawuqi'); + content: function () { + target.addSkill("shaman_shihuawuqi"); }, - ai:{ - order:4, - value:4, - useful:4, - result:{ - target:function(player,target){ - if(target.isTurnedOver()) return 0; - var num=0; - if(target.hasSkill('shaman_fengnu')){ - num=3; + ai: { + order: 4, + value: 4, + useful: 4, + result: { + target: function (player, target) { + if (target.isTurnedOver()) return 0; + var num = 0; + if (target.hasSkill("shaman_fengnu")) { + num = 3; } - if(target.isMin()) return target.hp+num; + if (target.isMin()) return target.hp + num; return 1.1; - } - } - } + }, + }, + }, }, - spell_xianzuzhaohuan:{ - type:'stonecard', - stoneact:2, - career:'shaman', - fullimage:true, - enable:true, - filterTarget:function(card,player,target){ + spell_xianzuzhaohuan: { + type: "stonecard", + stoneact: 2, + career: "shaman", + fullimage: true, + enable: true, + filterTarget: function (card, player, target) { return !target.isMin(); }, - multitarget:true, - multiline:true, - selectTarget:-1, - content:function(){ - 'step 0' - if(targets[0]){ - var hs=targets[0].getCards('h',function(card){ - return get.type(card)=='stonecharacter'; + multitarget: true, + multiline: true, + selectTarget: -1, + content: function () { + "step 0"; + if (targets[0]) { + var hs = targets[0].getCards("h", function (card) { + return get.type(card) == "stonecharacter"; }); - if(hs.length&&targets[0].canAddFellow()){ - targets[0].useCard(targets[0],hs.randomGet(),false).noActCount=true; + if (hs.length && targets[0].canAddFellow()) { + targets[0].useCard(targets[0], hs.randomGet(), false).noActCount = true; } } - 'step 1' - if(targets[1]){ - var hs=targets[1].getCards('h',function(card){ - return get.type(card)=='stonecharacter'; + "step 1"; + if (targets[1]) { + var hs = targets[1].getCards("h", function (card) { + return get.type(card) == "stonecharacter"; }); - if(hs.length&&targets[1].canAddFellow()){ - targets[1].useCard(targets[1],hs.randomGet(),false).noActCount=true; + if (hs.length && targets[1].canAddFellow()) { + targets[1].useCard(targets[1], hs.randomGet(), false).noActCount = true; } } }, - ai:{ - order:9, - value:5, - useful:5, - result:{ - player:function(player){ - var hs=player.getCards('h',function(card){ - return get.type(card)=='stonecharacter'; + ai: { + order: 9, + value: 5, + useful: 5, + result: { + player: function (player) { + var hs = player.getCards("h", function (card) { + return get.type(card) == "stonecharacter"; }); - if(hs.length==0) return 0; - var enemy=player.getEnemy(); - if(enemy.countCards('h')<=1) return 1; - var num=0; - for(var i=0;i=3) return 1; + if (num / hs.length >= 3) return 1; return 0; - } - } - } + }, + }, + }, }, - spell_xianzuzhihun:{ - type:'stonecard', - stoneact:2, - career:'shaman', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - return target.isMin()&&!target.hasSkill('shaman_xianzuzhihun'); + spell_xianzuzhihun: { + type: "stonecard", + stoneact: 2, + career: "shaman", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { + return target.isMin() && !target.hasSkill("shaman_xianzuzhihun"); }, - content:function(){ - target.addSkill('shaman_xianzuzhihun'); + content: function () { + target.addSkill("shaman_xianzuzhihun"); }, - ai:{ - order:5, - value:4, - useful:4, - result:{ - target:function(player,target){ - if(lib.card[target.name+'_stonecharacter']){ - return lib.card[target.name+'_stonecharacter'].stoneact-1; + ai: { + order: 5, + value: 4, + useful: 4, + result: { + target: function (player, target) { + if (lib.card[target.name + "_stonecharacter"]) { + return lib.card[target.name + "_stonecharacter"].stoneact - 1; } return 0; - } - } - } - }, - spell_xianzuzhishi:{ - type:'stonecard', - fullimage:true, - enable:true, - stoneact:0, - career:'shaman', - filterTarget:function(card,player,target){ - return target==player; + }, + }, }, - selectTarget:-1, - content:function(){ + }, + spell_xianzuzhishi: { + type: "stonecard", + fullimage: true, + enable: true, + stoneact: 0, + career: "shaman", + filterTarget: function (card, player, target) { + return target == player; + }, + selectTarget: -1, + content: function () { player.drawDeck(2); - player.addTempSkill('shaman_xianzuzhishi'); + player.addTempSkill("shaman_xianzuzhishi"); + }, + ai: { + order: 10, + result: { + player: 1, + }, }, - ai:{ - order:10, - result:{ - player:1 - } - } }, - spell_rongyanbaolie:{ - type:'stonecard', - fullimage:true, - enable:true, - stoneact:3, - career:'shaman', - filterTarget:true, - content:function(){ - 'step 0' - target.damage(3,'fire'); - 'step 1' + spell_rongyanbaolie: { + type: "stonecard", + fullimage: true, + enable: true, + stoneact: 3, + career: "shaman", + filterTarget: true, + content: function () { + "step 0"; + target.damage(3, "fire"); + "step 1"; player.loseHp(); }, - ai:{ - order:8, - value:6, - useful:5, - result:{ - target:-2 + ai: { + order: 8, + value: 6, + useful: 5, + result: { + target: -2, }, - tag:{ - damage:2, - natureDamage:2, - fireDamage:2, - } - } + tag: { + damage: 2, + natureDamage: 2, + fireDamage: 2, + }, + }, }, - spell_shenshengxinxing:{ - type:'stonecard', - stoneact:5, - career:'priest', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - if(player.hasFellowSkill('priest_hunwu')||target.side!=player.side) return true; + spell_shenshengxinxing: { + type: "stonecard", + stoneact: 5, + career: "priest", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { + if (player.hasFellowSkill("priest_hunwu") || target.side != player.side) return true; return target.isDamaged(); }, - selectTarget:-1, - content:function(){ - var num=1; - if(player.hasFellowSkill('stone_shenyou')){ - num=2; + selectTarget: -1, + content: function () { + var num = 1; + if (player.hasFellowSkill("stone_shenyou")) { + num = 2; } - if(player.side==target.side){ - if(player.hasFellowSkill('priest_hunwu')){ + if (player.side == target.side) { + if (player.hasFellowSkill("priest_hunwu")) { target.loseHp(num); - } - else{ + } else { target.recover(num); } - } - else{ + } else { target.damage(); } }, - ai:{ - order:7, - value:5, - useful:5, - result:{ - target:function(player,target){ - if(player.hasFellowSkill('priest_hunwu')) return -1; - if(player.side==target.side) return 1; + ai: { + order: 7, + value: 5, + useful: 5, + result: { + target: function (player, target) { + if (player.hasFellowSkill("priest_hunwu")) return -1; + if (player.side == target.side) return 1; return -1; - } + }, + }, + tag: { + damage: 1, + multitarget: 1, + multineg: 1, }, - tag:{ - damage:1, - multitarget:1, - multineg:1 - } - } - }, - spell_shengguangzhadan:{ - type:'stonecard', - stoneact:2, - career:'priest', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - return target.isMin()&&target.countCards('h')>0; }, - selectTarget:-1, - content:function(){ - var num=1; + }, + spell_shengguangzhadan: { + type: "stonecard", + stoneact: 2, + career: "priest", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { + return target.isMin() && target.countCards("h") > 0; + }, + selectTarget: -1, + content: function () { + var num = 1; // if(player.hasFellowSkill('stone_shenyou')){ // num=2; // } - target.damage(target.countCards('h')*num); + target.damage(target.countCards("h") * num); }, - ai:{ - order:7, - value:5, - useful:5, - result:{ - target:function(player,target){ - return -Math.min(target.countCards('h'),target.hp); - } + ai: { + order: 7, + value: 5, + useful: 5, + result: { + target: function (player, target) { + return -Math.min(target.countCards("h"), target.hp); + }, }, - tag:{ - damage:1, - multitarget:1, - multineg:1 - } - } + tag: { + damage: 1, + multitarget: 1, + multineg: 1, + }, + }, }, - spell_maizang:{ - type:'stonecard', - stoneact:3, - career:'priest', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - return target.isMin()&&target.side!=player.side; + spell_maizang: { + type: "stonecard", + stoneact: 3, + career: "priest", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { + return target.isMin() && target.side != player.side; }, - content:function(){ - 'step 0' - target.die()._triggered=null; - 'step 1' - if(player.deckCards){ - player.deckCards.push(game.createCard(target.name+'_stonecharacter')); + content: function () { + "step 0"; + target.die()._triggered = null; + "step 1"; + if (player.deckCards) { + player.deckCards.push(game.createCard(target.name + "_stonecharacter")); } }, - ai:{ - order:7, - value:5, - useful:5, - result:{ - target:function(player,target){ - return -target.hp-target.countCards('h')/2; - } - } - } + ai: { + order: 7, + value: 5, + useful: 5, + result: { + target: function (player, target) { + return -target.hp - target.countCards("h") / 2; + }, + }, + }, }, - spell_xinlingshijie:{ - type:'stonecard', - stoneact:0, - career:'priest', - enable:function(event,player){ - return player.getEnemy().countCards('h')>0; + spell_xinlingshijie: { + type: "stonecard", + stoneact: 0, + career: "priest", + enable: function (event, player) { + return player.getEnemy().countCards("h") > 0; }, - fullimage:true, - filterTarget:function(card,player,target){ - return target==player.getEnemy(); + fullimage: true, + filterTarget: function (card, player, target) { + return target == player.getEnemy(); }, - selectTarget:-1, - content:function(){ - var card=target.getCards('h').randomGet(); - if(card){ - player.gain(game.createCard(card.name,card.suit,card.number,card.nature),'draw'); + selectTarget: -1, + content: function () { + var card = target.getCards("h").randomGet(); + if (card) { + player.gain(game.createCard(card.name, card.suit, card.number, card.nature), "draw"); } }, - ai:{ - order:9.5, - value:5, - useful:5, - result:{ - player:1 - } - } + ai: { + order: 9.5, + value: 5, + useful: 5, + result: { + player: 1, + }, + }, }, - spell_naluzhiguang:{ - type:'stonecard', - stoneact:1, - career:'priest', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - if(player.hasFellowSkill('priest_hunwu')){ + spell_naluzhiguang: { + type: "stonecard", + stoneact: 1, + career: "priest", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { + if (player.hasFellowSkill("priest_hunwu")) { return true; } - return target.hp0; }, - fullimage:true, - filterTarget:function(card,player,target){ + }, + spell_dunpaimengji: { + type: "stonecard", + stoneact: 2, + career: "warrior", + enable: function (event, player) { + return player.hujia > 0; + }, + fullimage: true, + filterTarget: function (card, player, target) { return target.isMin(); }, - content:function(){ + content: function () { target.damage(player.hujia); }, - ai:{ - order:7.2, - value:5, - useful:5, - result:{ - target:-1.5, - tag:{ - damage:1 - } - } - } - }, - spell_zhansha:{ - type:'stonecard', - stoneact:1, - career:'warrior', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - return target.isMin()&&target.hp=4) return 1.5; - if(target.hp>=3&&target.countCards('h')= 4) return 1.5; + if (target.hp >= 3 && target.countCards("h") < target.hp) return 1; return 0; - } - } - } + }, + }, + }, }, - spell_xuanfengzhan:{ - type:'stonecard', - fullimage:true, - enable:true, - stoneact:2, - career:'warrior', - filterTarget:function(card,player,target){ + spell_xuanfengzhan: { + type: "stonecard", + fullimage: true, + enable: true, + stoneact: 2, + career: "warrior", + filterTarget: function (card, player, target) { return target.isMin(); }, - selectTarget:-1, - content:function(){ + selectTarget: -1, + content: function () { target.damage(); }, - ai:{ - order:9, - value:5, - useful:5, - result:{ - target:-1.5 + ai: { + order: 9, + value: 5, + useful: 5, + result: { + target: -1.5, }, - tag:{ - damage:1, - multitarget:1, - multineg:1, - } - } + tag: { + damage: 1, + multitarget: 1, + multineg: 1, + }, + }, }, - spell_juemingluandou:{ - type:'stonecard', - stoneact:4, - career:'warrior', - enable:function(){ - var num=0; - for(var i=0;i=2) return true; + if (num >= 2) return true; } } return false; }, - fullimage:true, - filterTarget:function(card,player,target){ + fullimage: true, + filterTarget: function (card, player, target) { return target.isMin(); }, - selectTarget:-1, - content:function(){ - 'step 0' + selectTarget: -1, + content: function () { + "step 0"; targets.randomRemove(); targets.sort(lib.sort.seat); - event.list=targets; - 'step 1' - if(event.list.length){ + event.list = targets; + "step 1"; + if (event.list.length) { event.list.shift().die(); event.redo(); } }, - ai:{ - order:9, - value:5, - useful:5, - result:{ - target:-2 - } - } + ai: { + order: 9, + value: 5, + useful: 5, + result: { + target: -2, + }, + }, }, - spell_lierenyinji:{ - type:'stonecard', - stoneact:0, - career:'hunter', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - return target.isMin()&&target.maxHp>1; + spell_lierenyinji: { + type: "stonecard", + stoneact: 0, + career: "hunter", + enable: true, + fullimage: true, + filterTarget: function (card, player, target) { + return target.isMin() && target.maxHp > 1; }, - content:function(){ - target.loseMaxHp(target.maxHp-1); + content: function () { + target.loseMaxHp(target.maxHp - 1); + }, + ai: { + order: 7, + value: 5, + useful: 5, + result: { + target: function (player, target) { + return 1 - target.hp; + }, + }, }, - ai:{ - order:7, - value:5, - useful:5, - result:{ - target:function(player,target){ - return 1-target.hp; - } - } - } }, - spell_kuaisusheji:{ - type:'stonecard', - stoneact:2, - career:'hunter', - enable:true, - fullimage:true, - filterTarget:true, - content:function(){ + spell_kuaisusheji: { + type: "stonecard", + stoneact: 2, + career: "hunter", + enable: true, + fullimage: true, + filterTarget: true, + content: function () { target.damage(); player.draw(); }, - ai:{ - order:7, - value:5, - useful:5, - result:{ - target:-1.5, + ai: { + order: 7, + value: 5, + useful: 5, + result: { + target: -1.5, }, - tag:{ - damage:1 - } - } + tag: { + damage: 1, + }, + }, }, - spell_guanmenfanggou:{ - type:'stonecard', - stoneact:2, - career:'hunter', - enable:function(event,player){ - return player.getEnemy().countFellow()>0&&player.canAddFellow(); + spell_guanmenfanggou: { + type: "stonecard", + stoneact: 2, + career: "hunter", + enable: function (event, player) { + return player.getEnemy().countFellow() > 0 && player.canAddFellow(); }, - fullimage:true, - filterTarget:function(card,player,target){ - return target==player; + fullimage: true, + filterTarget: function (card, player, target) { + return target == player; }, - selectTarget:-1, - content:function(){ - 'step 0' - event.num=player.getEnemy().countFellow(); - 'step 1' - if(player.canAddFellow()&&event.num--){ - player.addFellowAuto('stone_liegou'); + selectTarget: -1, + content: function () { + "step 0"; + event.num = player.getEnemy().countFellow(); + "step 1"; + if (player.canAddFellow() && event.num--) { + player.addFellowAuto("stone_liegou"); event.redo(); } }, - ai:{ - order:7, - value:5, - useful:5, - result:{ - target:1 - } - } + ai: { + order: 7, + value: 5, + useful: 5, + result: { + target: 1, + }, + }, }, - spell_zhaohuanchongwu:{ - type:'stonecard', - stoneact:2, - career:'hunter', - enable:function(event,player){ + spell_zhaohuanchongwu: { + type: "stonecard", + stoneact: 2, + career: "hunter", + enable: function (event, player) { return player.canAddFellow(); }, - fullimage:true, - filterTarget:function(card,player,target){ - return target==player; + fullimage: true, + filterTarget: function (card, player, target) { + return target == player; }, - selectTarget:-1, - content:function(){ + selectTarget: -1, + content: function () { player.addFellowAuto(lib.beastList.randomGet()); }, - ai:{ - order:6, - value:5, - useful:5, - result:{ - player:1 - } - } - }, - spell_zidanshangtang:{ - type:'stonecard', - stoneact:1, - career:'hunter', - enable:true, - fullimage:true, - filterTarget:function(card,player,target){ - return target==player; + ai: { + order: 6, + value: 5, + useful: 5, + result: { + player: 1, + }, }, - selectTarget:-1, - content:function(){ - var list=['spell_lierenyinji','spell_guanmenfanggou','spell_duochongsheji','spell_kuaisusheji','spell_zhaohuanchongwu']; - player.gain(game.createCard(list.randomGet()),'draw'); - player.addTempSkill('hunter_zidanshangtang'); - }, - ai:{ - order:7.5, - value:5, - useful:5, - result:{ - player:1 - } - } }, - spell_duochongsheji:{ - type:'stonecard', - fullimage:true, - enable:function(event,player){ - for(var i=0;imaxHp){ - maxHp=game.players[i].hp; + if (game.players[i].hp > maxHp) { + maxHp = game.players[i].hp; } } } - if(list.length<2) return 0; - if(list.length==2&&target.hp>=4) return 0; - if(target.hp>maxHp) return 1; + if (list.length < 2) return 0; + if (list.length == 2 && target.hp >= 4) return 0; + if (target.hp > maxHp) return 1; return target.hp; - } + }, }, - } + }, }, - spell_xishengqiyue:{ - type:'stonecard', - fullimage:true, - enable:true, - stoneact:0, - career:'warlock', - filterTarget:function(card,player,target){ - if(!target.isMin()) return false; - if(ui.selected.targets.length){ - return target.side!=ui.selected.targets[0].side; + spell_xishengqiyue: { + type: "stonecard", + fullimage: true, + enable: true, + stoneact: 0, + career: "warlock", + filterTarget: function (card, player, target) { + if (!target.isMin()) return false; + if (ui.selected.targets.length) { + return target.side != ui.selected.targets[0].side; } return true; }, - selectTarget:2, - multitarget:true, - multiline:true, - content:function(){ + selectTarget: 2, + multitarget: true, + multiline: true, + content: function () { targets.sort(lib.sort.seat); - for(var i=0;i=2) return 1; + ai: { + order: 1, + value: 5, + useful: 5, + result: { + player: function (player) { + if (player.countFellow() >= 2) return 1; return 0; - } + }, }, - } - }, - spell_hengsao:{ - type:'stonecard', - fullimage:true, - enable:true, - stoneact:4, - career:'druid', - filterTarget:function(card,player,target){ - return target.side!=player.side; }, - content:function(){ - 'step 0' - event.list=[]; - for(var i=0;i0; + spell_fuchouzhinu: { + type: "stonecard", + fullimage: true, + enable: function (event, player) { + return player.getEnemy().countFellow() > 0; }, - stoneact:4, - career:'paladin', - filterTarget:function(card,player,target){ - return target.side!=player.side&&target.isMin(); + stoneact: 4, + career: "paladin", + filterTarget: function (card, player, target) { + return target.side != player.side && target.isMin(); }, - selectTarget:-1, - multitarget:true, - multiline:true, - content:function(){ - 'step 0' - if(!targets.length){ + selectTarget: -1, + multitarget: true, + multiline: true, + content: function () { + "step 0"; + if (!targets.length) { event.finish(); return; } - var map=[]; - for(var i=0;i1||target.countCards('he')>0); + spell_chenmo: { + type: "stonecard", + enable: true, + stoneact: 2, + fullimage: true, + filterTarget: function (card, player, target) { + return target.isMin() && (target.maxHp > 1 || target.countCards("he") > 0); }, - content:function(){ - "step 0" - target.discard(target.getCards('he')); - "step 1" - if(target.maxHp>2){ - target.loseMaxHp(target.maxHp-2); + content: function () { + "step 0"; + target.discard(target.getCards("he")); + "step 1"; + if (target.maxHp > 2) { + target.loseMaxHp(target.maxHp - 2); } }, - ai:{ - result:{ - target:function(player,target){ - return Math.min(0,2-target.hp)-target.countCards('h')/2; - } + ai: { + result: { + target: function (player, target) { + return Math.min(0, 2 - target.hp) - target.countCards("h") / 2; + }, }, - order:7 - } + order: 7, + }, }, - spell_morizaihuo:{ - fullimage:true, - type:'stonecard', - enable:true, - filterTarget:function(card,player,target){ + spell_morizaihuo: { + fullimage: true, + type: "stonecard", + enable: true, + filterTarget: function (card, player, target) { return target.isMin(); }, - selectTarget:-1, - multiline:true, - multitarget:true, - content:function(){ - 'step 0' + selectTarget: -1, + multiline: true, + multitarget: true, + content: function () { + "step 0"; targets.sort(lib.sort.seat); - event.list=targets; - 'step 1' - if(event.list.length){ + event.list = targets; + "step 1"; + if (event.list.length) { event.list.shift().die(); event.redo(); } - 'step 2' - player.recover(2) + "step 2"; + player.recover(2); }, - stoneact:5, - ai:{ - order:9, - result:{ - target:-1, - player:function(player){ - if(player.hp1; + spell_shengerpingdeng: { + fullimage: true, + type: "stonecard", + enable: true, + stoneact: 2, + filterTarget: function (card, player, target) { + return target.isMin() && target.maxHp > 1; }, - selectTarget:-1, - content:function(){ - target.loseMaxHp(target.maxHp-1); + selectTarget: -1, + content: function () { + target.loseMaxHp(target.maxHp - 1); }, - ai:{ - order:9.1, - result:{ - target:function(player,target){ - if(target.hp>1) return -1; - if(target.maxHp>1) return -0.1; + ai: { + order: 9.1, + result: { + target: function (player, target) { + if (target.hp > 1) return -1; + if (target.maxHp > 1) return -0.1; return 0; - } - } - } + }, + }, + }, }, - spell_jingshenkongzhi:{ - fullimage:true, - type:'stonecard', - enable:function(event,player){ - if(player.isMin()) return false; + spell_jingshenkongzhi: { + fullimage: true, + type: "stonecard", + enable: function (event, player) { + if (player.isMin()) return false; return player.canAddFellow(); }, - stoneact:6, - filterTarget:function(card,player,target){ - return target.isMin()&&target.side!=player.side; + stoneact: 6, + filterTarget: function (card, player, target) { + return target.isMin() && target.side != player.side; }, - content:function(){ + content: function () { target.getLeader().removeFellow(target); - target.side=player.side; + target.side = player.side; player.addFellow(target); - if(!target.isTurnedOver()){ + if (!target.isTurnedOver()) { target.turnOver(); } }, - ai:{ - order:9.5, - result:{ - target:function(player,target){ + ai: { + order: 9.5, + result: { + target: function (player, target) { return -target.hp; - } - } - } + }, + }, + }, }, - spell_anyingkuangluan:{ - type:'stonecard', - fullimage:true, - enable:function(event,player){ - if(player.isMin()) return false; + spell_anyingkuangluan: { + type: "stonecard", + fullimage: true, + enable: function (event, player) { + if (player.isMin()) return false; return player.canAddFellow(); }, - stoneact:4, - filterTarget:function(card,player,target){ - return target.isMin()&&target.side!=player.side&&target.countCards('h')<=1; + stoneact: 4, + filterTarget: function (card, player, target) { + return target.isMin() && target.side != player.side && target.countCards("h") <= 1; }, - content:function(){ + content: function () { target.getLeader().removeFellow(target); - target.side=player.side; + target.side = player.side; player.addFellow(target); - target.addSkill('spell_anyingkuangluan_die'); + target.addSkill("spell_anyingkuangluan_die"); }, - ai:{ - order:9.5, - result:{ - target:function(player,target){ + ai: { + order: 9.5, + result: { + target: function (player, target) { return -target.hp; - } - } - } + }, + }, + }, }, - spell_binghuan:{ - fullimage:true, - type:'stonecard', - enable:true, - stoneact:1, - filterTarget:function(card,player,target){ + spell_binghuan: { + fullimage: true, + type: "stonecard", + enable: true, + stoneact: 1, + filterTarget: function (card, player, target) { return target.isMin(); }, - selectTarget:-1, - content:function(){ + selectTarget: -1, + content: function () { target.turnOver(); }, - ai:{ - order:7, - result:{ - target:function(player,target){ - if(target.isTurnedOver()) return 1; + ai: { + order: 7, + result: { + target: function (player, target) { + if (target.isTurnedOver()) return 1; return -1; - } - } - } - }, - spell_zhiliaozhichu:{ - fullimage:true, - type:'stonecard', - enable:true, - stoneact:1, - filterTarget:function(card,player,target){ - return target.isMin()&&target.side==player.side&& - (!target.hasSkill('lschaofeng')||target.hp0){ + "step 2"; + var dh = target.countCards("h") - player.countCards("h"); + if (dh > 0) { player.draw(dh); } }, - ai:{ - order:7, - value:1, - useful:1, - result:{ - target:function(player,target){ - var ne1=target.countCards('e'),ne2=player.countCards('e'); - var nh1=target.countCards('h'),nh2=player.countCards('h'); - if(nh10){ - target.discard(target.getCards('h').randomGets(dh)); + content: function () { + "step 0"; + target.gain(target.getCards("e"), "gain2"); + "step 1"; + var dh = target.countCards("h") - player.countCards("h"); + if (dh > 0) { + target.discard(target.getCards("h").randomGets(dh)); } }, - ai:{ - order:1, - value:1, - useful:1, - result:{ - target:function(player,target){ - if(target.countCards('he')>=player.countCards('h')) return -1; + ai: { + order: 1, + value: 1, + useful: 1, + result: { + target: function (player, target) { + if (target.countCards("he") >= player.countCards("h")) return -1; return 0; - } - } - } + }, + }, + }, }, }, - skill:{ - stone_mieshi:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - for(var i=0;i=player.maxHp-1) return [0,0]; - } - } - } - }, - stone_lianyu:{ - mark:true, - intro:{ - content:function(storage){ - return '地狱火的初始手牌数和体力值为'+(storage+2); - } - }, - ai:{ - threaten:function(player,target){ - return 1+target.storage.stone_lianyu; + if (get.tag(card, "recover") && player.hp >= player.maxHp - 1) return [0, 0]; + }, }, - } - }, - stone_lianji:{ - trigger:{global:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - return event.player.side==player.side&&event.source!=player; }, - content:function(){ + }, + stone_lianyu: { + mark: true, + intro: { + content: function (storage) { + return "地狱火的初始手牌数和体力值为" + (storage + 2); + }, + }, + ai: { + threaten: function (player, target) { + return 1 + target.storage.stone_lianyu; + }, + }, + }, + stone_lianji: { + trigger: { global: "fellow" }, + forced: true, + unique: true, + filter: function (event, player) { + return event.player.side == player.side && event.source != player; + }, + content: function () { player.maxHp++; player.hp++; player.update(); player.draw(); }, - ai:{ - threaten:2 - } + ai: { + threaten: 2, + }, }, - stone_shenyu:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - content:function(){ - 'step 0' - var target=player.getLeader(); - var next=target.chooseControl('召唤树人','增强随从'); - next.prompt='召唤两个嘲讽树人,或令所有其他随从增加1点体力和体力上限并摸两张牌'; - next.ai=function(){ - if(target.countFellow()<=2) return '召唤树人'; - return '增强随从'; - } - 'step 1' - if(result.control=='增强随从'){ - var targets=player.getLeader().getFellow(); + stone_shenyu: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + content: function () { + "step 0"; + var target = player.getLeader(); + var next = target.chooseControl("召唤树人", "增强随从"); + next.prompt = "召唤两个嘲讽树人,或令所有其他随从增加1点体力和体力上限并摸两张牌"; + next.ai = function () { + if (target.countFellow() <= 2) return "召唤树人"; + return "增强随从"; + }; + "step 1"; + if (result.control == "增强随从") { + var targets = player.getLeader().getFellow(); targets.remove(player); - for(var i=0;i0; + warrior_fenyong: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + filter: function (event, player) { + return player.getLeader().countCards("h", { type: "stonecharacter" }) > 0; }, - content:function(){ - player.addSkill('stone_chongfeng'); - if(player.isTurnedOver()){ + content: function () { + player.addSkill("stone_chongfeng"); + if (player.isTurnedOver()) { player.turnOver(); } - } + }, }, - warrior_peilian:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - for(var i=0;i1) return true; + priest_suoxiao: { + trigger: { source: "fellow" }, + unique: true, + forced: true, + filter: function (event, player) { + for (var i = 0; i < game.players.length; i++) { + if (game.players[i] != player && game.players[i].isMin() && game.players[i].maxHp > 1) + return true; } return false; }, - content:function(){ - "step 0" - event.chooser=player.getLeader(); - event.chooser.chooseTarget('缩小:令一名随从减少2点体力上限',function(card,playerx,target){ - return player!=target&&target.isMin()&&target.maxHp>1; - }).ai=function(target){ - if(get.attitude(player,target)>=0) return 0; - if(target.hp==1) return 0.01; - if(target.maxHp-target.hp>=2) return 0.01; - if(target.maxHp-target.hp==1){ - if(target.hp==2) return 1; + content: function () { + "step 0"; + event.chooser = player.getLeader(); + event.chooser.chooseTarget( + "缩小:令一名随从减少2点体力上限", + function (card, playerx, target) { + return player != target && target.isMin() && target.maxHp > 1; + } + ).ai = function (target) { + if (get.attitude(player, target) >= 0) return 0; + if (target.hp == 1) return 0.01; + if (target.maxHp - target.hp >= 2) return 0.01; + if (target.maxHp - target.hp == 1) { + if (target.hp == 2) return 1; return 0.1; } - switch(target.hp){ - case 1:return 0.01; - case 2:return 1; - case 3:return 2; - case 4:return 1.5; - case 5:return 1; - default:return 0.8; + switch (target.hp) { + case 1: + return 0.01; + case 2: + return 1; + case 3: + return 2; + case 4: + return 1.5; + case 5: + return 1; + default: + return 0.8; } }; player.line(event.chooser); - "step 1" - if(result.bool){ + "step 1"; + if (result.bool) { event.chooser.line(result.targets[0]); - result.targets[0].maxHp-=2; - if(result.targets[0].maxHp<1){ - result.targets[0].maxHp=1; + result.targets[0].maxHp -= 2; + if (result.targets[0].maxHp < 1) { + result.targets[0].maxHp = 1; } result.targets[0].update(); } - } - }, - priest_shixin:{ - trigger:{global:'useSkillAfter'}, - forced:true, - unique:true, - filter:function(event,player){ - return event.career&&event.player.side==player.side; }, - content:function(){ - 'step 0' - var target=player.getLeader(); - target.damage(); - player.line(target,'green'); - 'step 1' - var target=player.getEnemy(); - target.damage(); - player.line(target,'green'); - } }, - priest_shengshui:{ - trigger:{player:'phaseBegin'}, - unique:true, - forced:true, - filter:function(event,player){ - for(var i=0;i0; + noPhaseDelay: 1, }, - content:function(){ + }, + priest_muguang: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + filter: function (event, player) { + return player.getLeader().countCards("h", { type: "stonecharacter" }) > 0; + }, + content: function () { player.maxHp++; player.hp++; player.update(); - } + }, }, - hunter_mishi:{ - trigger:{global:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - return event.player.side==player.side&&event.source!=player; + hunter_mishi: { + trigger: { global: "fellow" }, + forced: true, + unique: true, + filter: function (event, player) { + return event.player.side == player.side && event.source != player; }, - content:function(){ + content: function () { player.draw(); - } - }, - hunter_muyang:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - return player.getLeader().countFellow()>1&&player.getLeader().canAddFellow(); }, - content:function(){ - var num=player.getLeader().countFellow()-1; - var list=[]; - for(var i in lib.character){ - if(lib.character[i][4].includes('stone')&& - !lib.character[i][4].includes('stonehidden')&& - lib.character[i][5]&&lib.character[i][5][0]==num){ + }, + hunter_muyang: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + filter: function (event, player) { + return player.getLeader().countFellow() > 1 && player.getLeader().canAddFellow(); + }, + content: function () { + var num = player.getLeader().countFellow() - 1; + var list = []; + for (var i in lib.character) { + if ( + lib.character[i][4].includes("stone") && + !lib.character[i][4].includes("stonehidden") && + lib.character[i][5] && + lib.character[i][5][0] == num + ) { list.push(i); } } - var target=player.getLeader(); - if(list.length){ + var target = player.getLeader(); + if (list.length) { target.addFellowAuto(list.randomGet()); } - } - }, - hunter_juji:{ - unique:true - }, - hunter_dusha:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - content:function(){ - 'step 0' - var list=[]; - var target=player.getLeader(); - for(var i=0;i0; + rogue_jiaoyi: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + filter: function (event, player) { + var target = player.getLeader(); + return target.countCards("e") > 0; }, - content:function(){ - "step 0" - event.chooser=player.getLeader(); - event.chooser.chooseToDiscard('是否弃置一张装备牌令'+get.translation(player)+'摸三张牌?', - 'he',function(card){ - return get.type(card)=='equip'; - }).ai=function(card){ - return 7-get.value(card); + content: function () { + "step 0"; + event.chooser = player.getLeader(); + event.chooser.chooseToDiscard( + "是否弃置一张装备牌令" + get.translation(player) + "摸三张牌?", + "he", + function (card) { + return get.type(card) == "equip"; + } + ).ai = function (card) { + return 7 - get.value(card); }; - "step 1" - if(result.bool){ + "step 1"; + if (result.bool) { player.draw(3); } - } - }, - rogue_jielue:{ - trigger:{global:'equipEnd'}, - unique:true, - forced:true, - filter:function(event,player){ - return event.player.side==player.side&&get.subtype(event.card)=='equip1'; }, - content:function(){ + }, + rogue_jielue: { + trigger: { global: "equipEnd" }, + unique: true, + forced: true, + filter: function (event, player) { + return event.player.side == player.side && get.subtype(event.card) == "equip1"; + }, + content: function () { player.draw(2); }, - ai:{ - threaten:1.3 - } + ai: { + threaten: 1.3, + }, }, - rogue_fusheng:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - for(var i=0;i1){ + rogue_fusheng: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + filter: function (event, player) { + for (var i = 0; i < game.players.length; i++) { + if (game.players[i].isMin() && game.players[i].hp > 1) { return true; } } }, - content:function(){ - var num=1; - for(var i=0;inum){ - num=game.players[i].hp; + content: function () { + var num = 1; + for (var i = 0; i < game.players.length; i++) { + if (game.players[i].isMin() && game.players[i].hp > num) { + num = game.players[i].hp; } } - player.hp=num; - player.maxHp=num; + player.hp = num; + player.maxHp = num; player.update(); - } + }, }, - rogue_lifa:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - content:function(){ - 'step 0' - var target=player.getLeader(); - if(target.getEquip(1)){ - target=target.getEnemy(); - player.line(target,'green'); + rogue_lifa: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + content: function () { + "step 0"; + var target = player.getLeader(); + if (target.getEquip(1)) { + target = target.getEnemy(); + player.line(target, "green"); target.damage(); - } - else{ - player.line(target,'green'); - var equip1=get.cardPile(function(card){ - return get.subtype(card)=='equip1'; + } else { + player.line(target, "green"); + var equip1 = get.cardPile(function (card) { + return get.subtype(card) == "equip1"; }); - if(!equip1){ - equip1=game.createCard('qingnang'); + if (!equip1) { + equip1 = game.createCard("qingnang"); } target.equip(equip1); } - } - }, - rogue_shoudao:{ - trigger:{global:'phaseEnd'}, - forced:true, - direct:true, - filter:function(event,player){ - return event.player==player.getLeader()&&event.player.countFellow()>1; }, - content:function(){ - 'step 0' - var players=get.players(); - var targets=[]; - for(var i=0;i 1; + }, + content: function () { + "step 0"; + var players = get.players(); + var targets = []; + for (var i = 0; i < players.length; i++) { + if (players[i].side == player.side && players[i].isMin() && players[i] != player) { targets.push(players[i]); } } - if(targets.length){ - var target=targets.randomGet(); - player.logSkill('rogue_shoudao',target); + if (targets.length) { + var target = targets.randomGet(); + player.logSkill("rogue_shoudao", target); target.maxHp++; target.hp++; target.update(); target.draw(); } }, - ai:{ - threaten:1.8 - } - }, - rogue_duxing:{ - trigger:{global:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - return event.player.side!=player.side&&!player.hasSkill('qianxing'); + ai: { + threaten: 1.8, }, - content:function(){ + }, + rogue_duxing: { + trigger: { global: "fellow" }, + forced: true, + unique: true, + filter: function (event, player) { + return event.player.side != player.side && !player.hasSkill("qianxing"); + }, + content: function () { player.tempHide(); - } + }, }, - paladin_moma:{ - global:'paladin_moma2', - ai:{ - threaten:1.5 - } - }, - paladin_moma2:{ - trigger:{player:'phaseDrawBegin'}, - forced:true, - filter:function(event,player){ - return player.name=='stone_xinbing'&&player.hasFellowSkill('paladin_moma'); + paladin_moma: { + global: "paladin_moma2", + ai: { + threaten: 1.5, }, - content:function(){ - trigger.num+=player.countFellowSkill('paladin_moma'); - } }, - paladin_jinghua:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - for(var i=0;i1){ + paladin_moma2: { + trigger: { player: "phaseDrawBegin" }, + forced: true, + filter: function (event, player) { + return player.name == "stone_xinbing" && player.hasFellowSkill("paladin_moma"); + }, + content: function () { + trigger.num += player.countFellowSkill("paladin_moma"); + }, + }, + paladin_jinghua: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + filter: function (event, player) { + for (var i = 0; i < game.players.length; i++) { + if ( + game.players[i].isMin() && + game.players[i] != player && + game.players[i].countCards("h") > 1 + ) { return true; } } return false; }, - content:function(){ - "step 0" - var list=[]; - for(var i=0;i1){ + content: function () { + "step 0"; + var list = []; + for (var i = 0; i < game.players.length; i++) { + if ( + game.players[i].isMin() && + game.players[i] != player && + game.players[i].countCards("h") > 1 + ) { list.push(game.players[i]); } } list.sort(lib.sort.seat); - event.list=list; - "step 1" - if(event.list.length){ - var current=event.list.shift(); + event.list = list; + "step 1"; + if (event.list.length) { + var current = event.list.shift(); current.damage(2); - player.line(current,'green'); + player.line(current, "green"); event.redo(); } - } - }, - paladin_tuxi:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - var leader=player.getLeader(); - return leader.hp2){ - return get.attitude(event.chooser,target)*(2-target.maxHp)/100; + content: function () { + "step 0"; + event.chooser = player.getLeader(); + event.chooser.chooseTarget( + "化石:令一名随从的体力值及体力上限变为2", + function (card, playerx, target) { + return ( + player != target && target.isMin() && (target.hp != 2 || target.maxHp != 2) + ); } - return get.attitude(event.chooser,target)*(2-target.hp); + ).ai = function (target) { + if (target.hp == 2 && target.maxHp > 2) { + return (get.attitude(event.chooser, target) * (2 - target.maxHp)) / 100; + } + return get.attitude(event.chooser, target) * (2 - target.hp); }; player.line(event.chooser); - "step 1" - if(result.bool){ + "step 1"; + if (result.bool) { event.chooser.line(result.targets[0]); - result.targets[0].hp=2; - result.targets[0].maxHp=2; + result.targets[0].hp = 2; + result.targets[0].maxHp = 2; result.targets[0].update(); } - } + }, }, - paladin_baowei:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - for(var i=0;i0&&player.getEnemy().hasFellow(); }, - content:function(){ - 'step 0' - var num=player.getLeader().countCards('e'); - var map=[]; - var targets=player.getEnemy().getFellow(); - event.targets=targets; - for(var i=0;i 0 && player.getEnemy().hasFellow(); + }, + content: function () { + "step 0"; + var num = player.getLeader().countCards("e"); + var map = []; + var targets = player.getEnemy().getFellow(); + event.targets = targets; + for (var i = 0; i < targets.length; i++) { map.push(0); } - for(var i=0;i1; + player.line(target, "green"); }, - content:function(){ - var target=player.getLeader(); - var num=target.countFellow(); - if(num>1){ - target.actused-=num-1; + }, + druid_yeyou: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + content: function () { + game.asyncDraw([player.getLeader(), player.getEnemy()], 1, { drawDeck: 1 }); + }, + }, + druid_chicheng: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + filter: function (event, player) { + var target = player.getLeader(); + return _status.currentPhase == target && target.countFellow() > 1; + }, + content: function () { + var target = player.getLeader(); + var num = target.countFellow(); + if (num > 1) { + target.actused -= num - 1; target.updateActCount(); } - } - }, - druid_qicheng:{ - trigger:{player:'dieBegin'}, - forced:true, - unique:true, - content:function(){ - player.getLeader().addSkill('druid_qicheng2'); }, - ai:{ - threaten:0.8 - } }, - druid_qicheng2:{ - trigger:{global:'dieAfter'}, - forced:true, - popup:false, - filter:function(event,player){ - return event.player.hasSkill('druid_qicheng'); + druid_qicheng: { + trigger: { player: "dieBegin" }, + forced: true, + unique: true, + content: function () { + player.getLeader().addSkill("druid_qicheng2"); }, - content:function(){ + ai: { + threaten: 0.8, + }, + }, + druid_qicheng2: { + trigger: { global: "dieAfter" }, + forced: true, + popup: false, + filter: function (event, player) { + return event.player.hasSkill("druid_qicheng"); + }, + content: function () { game.delay(); - var list=[]; - for(var i in lib.character){ - if(lib.character[i][4].includes('stone')&& - !lib.character[i][4].includes('stonehidden')&& - lib.character[i][5]&&lib.character[i][5][0]==1){ + var list = []; + for (var i in lib.character) { + if ( + lib.character[i][4].includes("stone") && + !lib.character[i][4].includes("stonehidden") && + lib.character[i][5] && + lib.character[i][5][0] == 1 + ) { list.push(i); } } player.addFellowAuto(list.randomGet()); - player.removeSkill('druid_qicheng2'); - } + player.removeSkill("druid_qicheng2"); + }, }, - druid_renya:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - content:function(){ - 'step 0' - player.getLeader().chooseControl('冲锋','潜行').ai=function(){ - if(Math.random()<0.5) return '潜行'; - return '冲锋'; - } - 'step 1' - if(result.control=='潜行'){ + druid_renya: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + content: function () { + "step 0"; + player.getLeader().chooseControl("冲锋", "潜行").ai = function () { + if (Math.random() < 0.5) return "潜行"; + return "冲锋"; + }; + "step 1"; + if (result.control == "潜行") { player.maxHp++; player.hp++; player.update(); player.tempHide(); - } - else{ + } else { player.draw(); - player.addSkill('stone_chongfeng'); - if(player.isTurnedOver()){ + player.addSkill("stone_chongfeng"); + if (player.isTurnedOver()) { player.turnOver(); } } - } - }, - druid_yuehuo:{ - trigger:{global:'damageBegin'}, - forced:true, - unique:true, - filter:function(event){ - return event.card&&get.type(event.card)=='trick'&&event.notLink(); }, - content:function(){ + }, + druid_yuehuo: { + trigger: { global: "damageBegin" }, + forced: true, + unique: true, + filter: function (event) { + return event.card && get.type(event.card) == "trick" && event.notLink(); + }, + content: function () { trigger.num++; }, }, - shaman_anhun:{ - trigger:{global:'dieAfter'}, - forced:true, - unique:true, - filter:function(event,player){ - return event.player.side==player.side; + shaman_anhun: { + trigger: { global: "dieAfter" }, + forced: true, + unique: true, + filter: function (event, player) { + return event.player.side == player.side; }, - content:function(){ - player.line(player.getLeader(),'green'); + content: function () { + player.line(player.getLeader(), "green"); player.getLeader().drawDeck(); - } - }, - shaman_zoushi:{ - trigger:{global:'useCardAfter'}, - direct:true, - unique:true, - filter:function(event,player){ - return get.type(event.card)=='stonecharacter'&&event.player==player.getLeader(); }, - content:function(){ - if(!player.storage.shaman_zoushi){ - player.storage.shaman_zoushi=true; - } - else{ - var list=[]; - for(var i=0;i3) num=3; - player.actused-=num; - player.updateActCount(); - player.removeSkill('spell_sijidaifa'); - } - }, - shaman_qingwa:{ - trigger:{player:'phaseDrawBefore'}, - forced:true, - unique:true, - popup:false, - content:function(){ - trigger.cancel(); - }, - ai:{ - threaten:0.1 - } - }, - stone_jingxiang:{ - trigger:{player:'phaseDrawBefore'}, - forced:true, - unique:true, - popup:false, - content:function(){ - trigger.cancel(); - }, - ai:{ - effect:{ - target:function(card){ - if(card.name=='bingliang') return 0; - } + }, }, - noPhaseDelay:1 - } - }, - mage_mianyang:{ - mod:{ - cardEnabled:function(card){ - if(card.name=='sha') return false; - } }, - ai:{ - threaten:0.1 - } + group: "mage_hanbingpingzhang2", }, - priest_xundao:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - return player.getLeader().countCards('h',{type:'stonecharacter'})>0; + mage_hanbingpingzhang2: { + trigger: { global: "phaseBegin" }, + forced: true, + popup: false, + filter: function (event, player) { + return event.player == player.getLeader(); }, - content:function(){ + content: function () { + player.removeSkill("mage_hanbingpingzhang"); + }, + }, + spell_modaoyou: { + intro: { + content: function (storage) { + return "下次剑刃乱舞的伤害+" + storage; + }, + }, + }, + hunter_jiewang2: { + trigger: { global: "dieAfter" }, + forced: true, + popup: false, + filter: function (event, player) { + return event.player.hasSkill("hunter_jiewang"); + }, + content: function () { + player.gain(game.createCard(lib.beastList.randomGet() + "_stonecharacter"), "draw"); + player.removeSkill("hunter_jiewang2"); + }, + }, + hunter_zidanshangtang: { + trigger: { player: "useCard" }, + forced: true, + mark: true, + intro: { + content: "每当你使用一张法术牌,便随机获得一张猎人职业法术牌", + }, + filter: function (event) { + return get.type(event.card) == "stonecard"; + }, + content: function () { + var list = [ + "spell_lierenyinji", + "spell_guanmenfanggou", + "spell_duochongsheji", + "spell_kuaisusheji", + "spell_zhaohuanchongwu", + ]; + player.gain(game.createCard(list.randomGet()), "draw"); + }, + }, + spell_yemanpaoxiao: { + mark: true, + intro: { + content: "友方角色造成的伤害+1", + }, + global: "spell_yemanpaoxiao2", + }, + spell_yemanpaoxiao2: { + trigger: { source: "damageBegin" }, + forced: true, + filter: function (event, player) { + return player.getLeader().hasSkill("spell_yemanpaoxiao") && event.notLink(); + }, + content: function () { + trigger.num++; + }, + }, + stone_zibao: { + trigger: { player: "phaseAfter" }, + forced: true, + content: function () { + player.die(); + }, + }, + spell_sijidaifa: { + trigger: { player: "useCard" }, + forced: true, + filter: function (event, player) { + return get.type(event.card) == "stonecard"; + }, + mark: true, + intro: { + content: "使用下一张法术牌时获得X点行动值,X为该法术的行动值消耗且不超过3", + }, + content: function () { + var num = lib.card[trigger.card.name].stoneact; + if (num > 3) num = 3; + player.actused -= num; + player.updateActCount(); + player.removeSkill("spell_sijidaifa"); + }, + }, + shaman_qingwa: { + trigger: { player: "phaseDrawBefore" }, + forced: true, + unique: true, + popup: false, + content: function () { + trigger.cancel(); + }, + ai: { + threaten: 0.1, + }, + }, + stone_jingxiang: { + trigger: { player: "phaseDrawBefore" }, + forced: true, + unique: true, + popup: false, + content: function () { + trigger.cancel(); + }, + ai: { + effect: { + target: function (card) { + if (card.name == "bingliang") return 0; + }, + }, + noPhaseDelay: 1, + }, + }, + mage_mianyang: { + mod: { + cardEnabled: function (card) { + if (card.name == "sha") return false; + }, + }, + ai: { + threaten: 0.1, + }, + }, + priest_xundao: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + filter: function (event, player) { + return player.getLeader().countCards("h", { type: "stonecharacter" }) > 0; + }, + content: function () { player.draw(); - player.addSkill('lschaofeng'); - } - }, - priest_guangyao:{ - trigger:{player:'changeHp'}, - forced:true, - unique:true, - filter:function(event){ - return event.num!=0; + player.addSkill("lschaofeng"); }, - content:function(){ + }, + priest_guangyao: { + trigger: { player: "changeHp" }, + forced: true, + unique: true, + filter: function (event) { + return event.num != 0; + }, + content: function () { player.draw(Math.abs(trigger.num)); }, }, - priest_zhufu:{ - trigger:{player:'dieBegin'}, - forced:true, - unique:true, - filter:function(event,player){ - for(var i=0;i0; + rogue_cisha: { + trigger: { source: "damageEnd" }, + forced: true, + unique: true, + filter: function (event, player) { + return event.player.isAlive() && event.player.isMin(); }, - content:function(){ - "step 0" - event.chooser=player.getLeader(); + content: function () { + trigger.player.die({ source: player }); + }, + }, + rogue_touxi: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + filter: function (event, player) { + var target = player.getLeader(); + return target.countCards("e") > 0; + }, + content: function () { + "step 0"; + event.chooser = player.getLeader(); event.chooser.chooseCardTarget({ - position:'e', - filterTarget:function(card,player,target){ - return player.side!=target.side; + position: "e", + filterTarget: function (card, player, target) { + return player.side != target.side; }, - filterCard:true, - ai1:function(card){ - return 9-get.value(card); + filterCard: true, + ai1: function (card) { + return 9 - get.value(card); }, - ai2:function(target){ - return get.damageEffect(target,player,player); + ai2: function (target) { + return get.damageEffect(target, player, player); }, - prompt:'偷袭:弃置一张装备区内的牌并对一名敌方角色1点伤害' + prompt: "偷袭:弃置一张装备区内的牌并对一名敌方角色1点伤害", }); player.line(event.chooser); - "step 1" - if(result.bool){ + "step 1"; + if (result.bool) { event.chooser.discard(result.cards); event.chooser.line(result.targets[0]); result.targets[0].damage(event.chooser); } - } + }, }, - rogue_qiancang:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - for(var i=0;i0; - }).ai=function(target){ - return target.countCards('he'); + content: function () { + "step 0"; + event.chooser = player.getLeader(); + event.chooser.chooseTarget( + "持盾:弃置对方一名随从的所有牌", + function (card, playerx, target) { + return ( + player.side != target.side && target.isMin() && target.countCards("he") > 0 + ); + } + ).ai = function (target) { + return target.countCards("he"); }; player.line(event.chooser); - "step 1" - if(result.bool){ + "step 1"; + if (result.bool) { event.chooser.line(result.targets[0]); game.delay(); - result.targets[0].discard(result.targets[0].getCards('he')); + result.targets[0].discard(result.targets[0].getCards("he")); } - } - }, - paladin_zhaochao:{ - trigger:{global:'useSkillAfter'}, - forced:true, - unique:true, - filter:function(event,player){ - return event.career&&event.player.side==player.side; }, - content:function(){ - player.draw(2); - } }, - paladin_buji:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - for(var i=0;i1) return 'discard_card'; - return '造成伤害'; + "step 1"; + if (result.bool) { + event.target = result.targets[0]; + event.chooser.chooseControl("造成伤害", "discard_card").ai = function () { + if (event.target.hp > 1) return "discard_card"; + return "造成伤害"; }; event.chooser.line(event.target); game.delay(); - } - else{ + } else { event.finish(); } - "step 2" - if(result.control=='造成伤害'){ + "step 2"; + if (result.control == "造成伤害") { event.target.damage(event.chooser); - } - else{ - event.target.discard(event.target.getCards('h')); - if(event.target.maxHp>2){ - event.target.loseMaxHp(event.target.maxHp-2); + } else { + event.target.discard(event.target.getCards("h")); + if (event.target.maxHp > 2) { + event.target.loseMaxHp(event.target.maxHp - 2); } } - } - }, - druid_yexingchengzhang:{ - trigger:{player:'phaseUseBegin'}, - forced:true, - mark:true, - intro:{ - content:'下个出牌阶段开始时获得三点额外行动值', }, - content:function(){ - player.actused-=3; - player.updateActCount(); - player.removeSkill('druid_yexingchengzhang'); - } }, - druid_ziyang:{ - trigger:{player:'phaseUseBegin'}, - forced:true, - mark:true, - intro:{ - content:'下个出牌阶段开始时获得四点额外行动值', + druid_yexingchengzhang: { + trigger: { player: "phaseUseBegin" }, + forced: true, + mark: true, + intro: { + content: "下个出牌阶段开始时获得三点额外行动值", }, - content:function(){ - player.actused-=4; + content: function () { + player.actused -= 3; player.updateActCount(); - player.removeSkill('druid_ziyang'); - } + player.removeSkill("druid_yexingchengzhang"); + }, }, - druid_chengzhang:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - content:function(){ - var target=player.getLeader(); + druid_ziyang: { + trigger: { player: "phaseUseBegin" }, + forced: true, + mark: true, + intro: { + content: "下个出牌阶段开始时获得四点额外行动值", + }, + content: function () { + player.actused -= 4; + player.updateActCount(); + player.removeSkill("druid_ziyang"); + }, + }, + druid_chengzhang: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + content: function () { + var target = player.getLeader(); target.actused--; target.updateActCount(); }, - group:'druid_chengzhang2' + group: "druid_chengzhang2", }, - druid_chengzhang2:{ - trigger:{player:'dieBegin'}, - forced:true, - unique:true, - content:function(){ - player.getLeader().addSkill('druid_chengzhang3'); - } - }, - druid_chengzhang3:{ - trigger:{global:'dieAfter'}, - forced:true, - popup:false, - filter:function(event,player){ - return event.player.hasSkill('druid_chengzhang'); + druid_chengzhang2: { + trigger: { player: "dieBegin" }, + forced: true, + unique: true, + content: function () { + player.getLeader().addSkill("druid_chengzhang3"); }, - content:function(){ - if(player.countCards('h')){ + }, + druid_chengzhang3: { + trigger: { global: "dieAfter" }, + forced: true, + popup: false, + filter: function (event, player) { + return event.player.hasSkill("druid_chengzhang"); + }, + content: function () { + if (player.countCards("h")) { game.delay(); - player.chooseToDiscard('h',true); + player.chooseToDiscard("h", true); } - player.removeSkill('druid_chengzhang3'); - } - }, - shaman_xueju:{ - trigger:{global:'useCard'}, - forced:true, - unique:true, - filter:function(event,player){ - return get.type(event.card)=='stonecharacter'&&event.player==player.getLeader(); + player.removeSkill("druid_chengzhang3"); }, - content:function(){ - player.draw(); - } }, - shaman_huoxi:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - for(var i=0;iplayer.actcount) return false; - if(player.storage.anyingxingtai) return false; + shaman_huoshe: { + trigger: { global: "damageBegin" }, + forced: true, + filter: function (event, player) { + return ( + event.source && + event.source != player && + event.source.isMin() && + player.side == event.source.side && + event.notLink() + ); + }, + content: function () { + trigger.num++; + }, + ai: { + threaten: 1.8, + }, + }, + _priest_skill: { + enable: "phaseUse", + filter: function (event, player) { + if (player.career != "priest") return false; + if (player.getActCount() + 2 > player.actcount) return false; + if (player.storage.anyingxingtai) return false; return true; }, - usable:1, - prompt:function(event){ - if(event.player.hasFellowSkill('priest_hunwu')) return '令目标失去1点体力'; - return '回复1点体力'; + usable: 1, + prompt: function (event) { + if (event.player.hasFellowSkill("priest_hunwu")) return "令目标失去1点体力"; + return "回复1点体力"; }, - filterTarget:function(card,player,target){ - if(player.hasFellowSkill('priest_hunwu')) return true; - return target.hpplayer.actcount) return false; - if(!player.storage.anyingxingtai) return false; + _priest_skillx: { + enable: "phaseUse", + filter: function (event, player) { + if (player.career != "priest") return false; + if (player.getActCount() + 2 > player.actcount) return false; + if (!player.storage.anyingxingtai) return false; return true; }, - usable:1, - prompt:function(event,player){ - return '造成'+get.cnNumber(_status.event.player.storage.anyingxingtai)+'点伤害'; + usable: 1, + prompt: function (event, player) { + return "造成" + get.cnNumber(_status.event.player.storage.anyingxingtai) + "点伤害"; }, - filterTarget:true, - content:function(){ - player.actused+=2; + filterTarget: true, + content: function () { + player.actused += 2; player.updateActCount(); - event.parent.career='priest'; - var num=1; + event.parent.career = "priest"; + var num = 1; // if(player.hasFellowSkill('stone_shenyou')){ // num=2; // } - target.damage(player.storage.anyingxingtai*num); + target.damage(player.storage.anyingxingtai * num); + }, + ai: { + order: 2, + result: { + target: function (player, target) { + return get.damageEffect(target, player, target); + }, + }, }, - ai:{ - order:2, - result:{ - target:function(player,target){ - return get.damageEffect(target,player,target); - } - } - } }, - _mage_skill:{ - enable:'phaseUse', - filter:function(event,player){ - if(player.career!='mage') return false; - if(player.getActCount()+2>player.actcount) return false; + _mage_skill: { + enable: "phaseUse", + filter: function (event, player) { + if (player.career != "mage") return false; + if (player.getActCount() + 2 > player.actcount) return false; return true; }, - usable:1, - line:'fire', - filterTarget:function(card,player,target){ + usable: 1, + line: "fire", + filterTarget: function (card, player, target) { return !target.career; }, - content:function(){ - player.actused+=2; + content: function () { + player.actused += 2; player.updateActCount(); - target.damage('fire'); - event.parent.career='mage'; + target.damage("fire"); + event.parent.career = "mage"; + }, + ai: { + order: 2, + result: { + target: function (player, target) { + return get.damageEffect(target, player, target, "fire"); + }, + }, }, - ai:{ - order:2, - result:{ - target:function(player,target){ - return get.damageEffect(target,player,target,'fire'); - } - } - } }, - _warlock_skill:{ - enable:'phaseUse', - filter:function(event,player){ - if(player.hasSkill('stone_lianyu')) return false; - if(player.career!='warlock') return false; - if(player.getActCount()+2>player.actcount) return false; + _warlock_skill: { + enable: "phaseUse", + filter: function (event, player) { + if (player.hasSkill("stone_lianyu")) return false; + if (player.career != "warlock") return false; + if (player.getActCount() + 2 > player.actcount) return false; return true; }, - usable:1, - content:function(){ - player.actused+=2; + usable: 1, + content: function () { + player.actused += 2; player.updateActCount(); player.drawDeck(2); - event.parent.career='warlock'; + event.parent.career = "warlock"; + }, + ai: { + order: 0.5, + result: { + player: 1, + }, }, - ai:{ - order:0.5, - result:{ - player:1 - } - } }, - _warlock_skillx:{ - enable:'phaseUse', - filter:function(event,player){ - if(!player.hasSkill('stone_lianyu')) return false; - if(player.career!='warlock') return false; - if(player.getActCount()+2>player.actcount) return false; - if(!player.canAddFellow()) return false; + _warlock_skillx: { + enable: "phaseUse", + filter: function (event, player) { + if (!player.hasSkill("stone_lianyu")) return false; + if (player.career != "warlock") return false; + if (player.getActCount() + 2 > player.actcount) return false; + if (!player.canAddFellow()) return false; return true; }, - usable:1, - content:function(){ - 'step 0' - player.actused+=2; + usable: 1, + content: function () { + "step 0"; + player.actused += 2; player.updateActCount(); - event.parent.career='warlock'; - player.addFellowAuto('stone_diyuhuox'); - 'step 1' - var num=player.storage.stone_lianyu; - if(num&&get.itemtype(result)=='player'){ - result.maxHp+=num; - result.hp+=num; + event.parent.career = "warlock"; + player.addFellowAuto("stone_diyuhuox"); + "step 1"; + var num = player.storage.stone_lianyu; + if (num && get.itemtype(result) == "player") { + result.maxHp += num; + result.hp += num; result.directgain(get.cards(num)); } }, - ai:{ - order:0.5, - result:{ - player:1 - } - } + ai: { + order: 0.5, + result: { + player: 1, + }, + }, }, - _hunter_skill:{ - enable:'phaseUse', - filter:function(event,player){ - if(player.career!='hunter') return false; - if(player.getActCount()+2>player.actcount) return false; + _hunter_skill: { + enable: "phaseUse", + filter: function (event, player) { + if (player.career != "hunter") return false; + if (player.getActCount() + 2 > player.actcount) return false; return true; }, - usable:1, - prompt:function(event){ - if(event.player.hasFellowSkill('hunter_juji')) return '造成1点伤害'; - return '对敌方主将造成1点伤害'; + usable: 1, + prompt: function (event) { + if (event.player.hasFellowSkill("hunter_juji")) return "造成1点伤害"; + return "对敌方主将造成1点伤害"; }, - selectTarget:function(){ - if(_status.event.player.hasFellowSkill('hunter_juji')) return 1; + selectTarget: function () { + if (_status.event.player.hasFellowSkill("hunter_juji")) return 1; return -1; }, - filterTarget:function(card,player,target){ - if(player.hasFellowSkill('hunter_juji')) return target!=player; - return target.career&&target.side!=player.side; + filterTarget: function (card, player, target) { + if (player.hasFellowSkill("hunter_juji")) return target != player; + return target.career && target.side != player.side; }, - content:function(){ - player.actused+=2; + content: function () { + player.actused += 2; player.updateActCount(); target.damage(); - event.parent.career='hunter'; + event.parent.career = "hunter"; + }, + ai: { + order: 2, + result: { + target: function (player, target) { + return get.damageEffect(target, player, target); + }, + }, }, - ai:{ - order:2, - result:{ - target:function(player,target){ - return get.damageEffect(target,player,target); - } - } - } }, - _warrior_skill:{ - enable:'phaseUse', - filter:function(event,player){ - if(player.hujia>=3) return false; - if(player.career!='warrior') return false; - if(player.getActCount()+2>player.actcount) return false; + _warrior_skill: { + enable: "phaseUse", + filter: function (event, player) { + if (player.hujia >= 3) return false; + if (player.career != "warrior") return false; + if (player.getActCount() + 2 > player.actcount) return false; return true; }, - usable:1, - content:function(){ - player.actused+=2; + usable: 1, + content: function () { + player.actused += 2; player.updateActCount(); player.changeHujia(1); - event.parent.career='warrior'; + event.parent.career = "warrior"; + }, + ai: { + order: 2, + result: { + player: 1, + }, }, - ai:{ - order:2, - result:{ - player:1 - } - } }, - _rogue_skill:{ - enable:'phaseUse', - filter:function(event,player){ - if(player.career!='rogue') return false; - if(player.getActCount()+2>player.actcount) return false; + _rogue_skill: { + enable: "phaseUse", + filter: function (event, player) { + if (player.career != "rogue") return false; + if (player.getActCount() + 2 > player.actcount) return false; return true; }, - usable:1, - content:function(){ - 'step 0' - player.actused+=2; + usable: 1, + content: function () { + "step 0"; + player.actused += 2; player.updateActCount(); - var equip1=get.cardPile(function(card){ - return get.subtype(card)=='equip1'; + var equip1 = get.cardPile(function (card) { + return get.subtype(card) == "equip1"; }); - if(!equip1){ - equip1=game.createCard('qingnang'); + if (!equip1) { + equip1 = game.createCard("qingnang"); } - var equip4=get.cardPile(function(card){ - return get.type(card)=='equip'&&get.subtype(card)!='equip1'; + var equip4 = get.cardPile(function (card) { + return get.type(card) == "equip" && get.subtype(card) != "equip1"; }); - if(!equip4){ - equip4=game.createCard('chitu'); + if (!equip4) { + equip4 = game.createCard("chitu"); } player.$gain(equip1); - setTimeout(function(){ + setTimeout(function () { player.$gain(equip4); - },250); + }, 250); game.delay(); - event.equip1=equip1; - event.equip4=equip4; - 'step 1' + event.equip1 = equip1; + event.equip4 = equip4; + "step 1"; player.equip(event.equip1); game.delay(0.5); - 'step 2' + "step 2"; player.equip(event.equip4); - event.parent.career='rogue'; + event.parent.career = "rogue"; }, - ai:{ - order:function(skill,player){ - if(!player.getEquip(1)&&player.countCards('e')<2){ - if(player.countCards('h','sha')&&player.getActCount()+3<=player.actcount){ + ai: { + order: function (skill, player) { + if (!player.getEquip(1) && player.countCards("e") < 2) { + if ( + player.countCards("h", "sha") && + player.getActCount() + 3 <= player.actcount + ) { return 4; } return 0.1; } return 0; }, - result:{ - player:function(player){ - if(player.countCards('e')<=2) return 1; + result: { + player: function (player) { + if (player.countCards("e") <= 2) return 1; return 0; - } - } - } - }, - _druid_skill:{ - enable:'phaseUse', - filter:function(event,player){ - if(player.career!='druid') return false; - if(player.getActCount()+2>player.actcount) return false; - return lib.filter.cardEnabled({name:'sha'},player); - }, - usable:1, - filterTarget:function(card,player,target){ - return player.canUse('sha',target,null,false); - }, - direct:true, - content:function(){ - player.actused+=2; - player.updateActCount(); - player.useCard({name:'sha'},targets,'_druid_skill',false).animate=false; - event.parent.career='druid'; - }, - ai:{ - order:function(){ - return get.order({name:'sha'})-0.1; + }, }, - result:{ - target:function(player,target){ - return get.effect(target,{name:'sha'},player,target); - } - } - } + }, }, - shaman_tuteng:{ - trigger:{player:'phaseDrawBefore'}, - forced:true, - popup:false, - content:function(){ + _druid_skill: { + enable: "phaseUse", + filter: function (event, player) { + if (player.career != "druid") return false; + if (player.getActCount() + 2 > player.actcount) return false; + return lib.filter.cardEnabled({ name: "sha" }, player); + }, + usable: 1, + filterTarget: function (card, player, target) { + return player.canUse("sha", target, null, false); + }, + direct: true, + content: function () { + player.actused += 2; + player.updateActCount(); + player.useCard({ name: "sha" }, targets, "_druid_skill", false).animate = false; + event.parent.career = "druid"; + }, + ai: { + order: function () { + return get.order({ name: "sha" }) - 0.1; + }, + result: { + target: function (player, target) { + return get.effect(target, { name: "sha" }, player, target); + }, + }, + }, + }, + shaman_tuteng: { + trigger: { player: "phaseDrawBefore" }, + forced: true, + popup: false, + content: function () { trigger.cancel(); }, - ai:{ - effect:{ - target:function(card){ - if(card.name=='bingliang') return 0; - } + ai: { + effect: { + target: function (card) { + if (card.name == "bingliang") return 0; + }, }, - noPhaseDelay:1 - } + noPhaseDelay: 1, + }, }, - shaman_zhiliao:{ - trigger:{player:'phaseEnd'}, - forced:true, - direct:true, - content:function(){ - 'step 0' - var players=get.players(); - var targets=[]; - for(var i=0;iplayer.actcount) return false; + _shaman_skill: { + enable: "phaseUse", + filter: function (event, player) { + if (player.career != "shaman") return false; + if (!player.canAddFellow()) return false; + if (player.getActCount() + 2 > player.actcount) return false; return true; }, - usable:1, - content:function(){ - player.actused+=2; + usable: 1, + content: function () { + player.actused += 2; player.updateActCount(); - var name='stone_tuteng'+Math.ceil(Math.random()*4); + var name = "stone_tuteng" + Math.ceil(Math.random() * 4); player.addFellowAuto(name); - event.parent.career='shaman'; + event.parent.career = "shaman"; + }, + ai: { + order: 2, + result: { + player: 1, + }, }, - ai:{ - order:2, - result:{ - player:1 - } - } }, - _paladin_skill:{ - enable:'phaseUse', - filter:function(event,player){ - if(player.career!='paladin') return false; - if(!player.canAddFellow()) return false; - if(player.getActCount()+2>player.actcount) return false; + _paladin_skill: { + enable: "phaseUse", + filter: function (event, player) { + if (player.career != "paladin") return false; + if (!player.canAddFellow()) return false; + if (player.getActCount() + 2 > player.actcount) return false; return true; }, - usable:1, - content:function(){ - player.actused+=2; + usable: 1, + content: function () { + player.actused += 2; player.updateActCount(); - player.addFellowAuto('stone_xinbing'); - event.parent.career='paladin'; + player.addFellowAuto("stone_xinbing"); + event.parent.career = "paladin"; + }, + ai: { + order: 2, + result: { + player: 1, + }, }, - ai:{ - order:2, - result:{ - player:1 - } - } }, - lschaofeng:{ - mark:true, - intro:{ - content:'已获得嘲讽' - } + lschaofeng: { + mark: true, + intro: { + content: "已获得嘲讽", + }, }, - _lschaofeng:{ - mod:{ - targetEnabled:function(card,player,target){ - if(target.hasSkill('lschaofeng')) return; - if(card.name=='sha'){ - for(var i=0;i0; - }).ai=function(target){ - return target.countCards('he'); + content: function () { + "step 0"; + event.chooser = player.getLeader(); + event.chooser.chooseTarget( + "叫嚣:弃置对方一名随从的所有牌", + function (card, playerx, target) { + return ( + player.side != target.side && target.isMin() && target.countCards("he") > 0 + ); + } + ).ai = function (target) { + return target.countCards("he"); }; player.line(event.chooser); - "step 1" - if(result.bool){ + "step 1"; + if (result.bool) { event.chooser.line(result.targets[0]); game.delay(); - result.targets[0].discard(result.targets[0].getCards('he')); + result.targets[0].discard(result.targets[0].getCards("he")); } - } + }, }, - stone_huoqiangshou1:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - for(var i=0;i0; }, - content:function(){ - var enemy=player.getEnemy(); - var es=enemy.getCards('e'); - if(es.length){ + }, + stone_dijieshicong1: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + filter: function (event, player) { + return player.getEnemy().countCards("e") > 0; + }, + content: function () { + var enemy = player.getEnemy(); + var es = enemy.getCards("e"); + if (es.length) { player.getLeader().line(enemy); game.delay(); enemy.discard(es.randomGet()); // game.log(get.translation(event.enemy)+'将'+get.translation(es)+'收入手牌') } - } - }, - stone_yaosaishouwei1:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - content:function(){ - player.getLeader().addTempSkill('stone_yaosaishouwei2'); - } - }, - stone_yaosaishouwei2:{ - mod:{ - maxHandcard:function(player,num){ - return num+2; - } }, }, - stone_famingjia1:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - content:function(){ + stone_yaosaishouwei1: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + content: function () { + player.getLeader().addTempSkill("stone_yaosaishouwei2"); + }, + }, + stone_yaosaishouwei2: { + mod: { + maxHandcard: function (player, num) { + return num + 2; + }, + }, + }, + stone_famingjia1: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + content: function () { player.getLeader().draw(2); - } + }, }, - stone_chilundashi1:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - content:function(){ - player.addSkill('stone_chilundashi2'); - } + stone_chilundashi1: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + content: function () { + player.addSkill("stone_chilundashi2"); + }, }, - stone_chilundashi2:{ - trigger:{player:'phaseDrawBegin'}, - forced:true, - content:function(){ + stone_chilundashi2: { + trigger: { player: "phaseDrawBegin" }, + forced: true, + content: function () { trigger.num++; - player.removeSkill('stone_chilundashi2'); - } + player.removeSkill("stone_chilundashi2"); + }, }, - stone_hanguangzhizhe1:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - content:function(){ - var targets=[]; - for(var i=0;i0&&num>=player.getLeader().countFellow(); }, - content:function(){ - var list=[]; - for(var i=0;i 0 && num >= player.getLeader().countFellow(); + }, + content: function () { + var list = []; + for (var i = 0; i < game.players.length; i++) { + if (game.players[i].isMin() && game.players[i].side != player.side) { list.push(game.players[i]); } } - if(list.length){ - var target=list.randomGet(); - player.line(target,'green'); - target.die({source:player}); + if (list.length) { + var target = list.randomGet(); + player.line(target, "green"); + target.die({ source: player }); game.delay(); } - } - }, - stone_yanjingshe_old:{ - trigger:{source:'fellow'}, - forced:true, - unique:true, - filter:function(event,player){ - return player.getEnemy().countFellow()>=player.getLeader().countFellow(); }, - content:function(){ - "step 0" - event.chooser=player.getEnemy(); - event.chooser.chooseTarget('毒噬:选择己方一名随从令其死亡',function(card,playerx,target){ - return target.isMin()&&target.side!=player.side; - },true).ai=function(target){ + }, + stone_yanjingshe_old: { + trigger: { source: "fellow" }, + forced: true, + unique: true, + filter: function (event, player) { + return player.getEnemy().countFellow() >= player.getLeader().countFellow(); + }, + content: function () { + "step 0"; + event.chooser = player.getEnemy(); + event.chooser.chooseTarget( + "毒噬:选择己方一名随从令其死亡", + function (card, playerx, target) { + return target.isMin() && target.side != player.side; + }, + true + ).ai = function (target) { return -target.hp; }; player.line(event.chooser); - "step 1" - if(result.bool){ + "step 1"; + if (result.bool) { event.chooser.line(result.targets[0]); game.delay(); result.targets[0].die(); } - } - }, - stone_mafengzhuru1:{ - trigger:{player:'dieBegin'}, - forced:true, - filter:function(event){ - return event.source&&event.source.isMin(); - }, - content:function(){ - trigger.source.addSkill('stone_mafengzhuru2'); }, }, - stone_mafengzhuru2:{ - trigger:{global:'dieAfter'}, - forced:true, - popup:false, - unique:true, - filter:function(event,player){ - return player.hasSkill('stone_mafengzhuru2'); + stone_mafengzhuru1: { + trigger: { player: "dieBegin" }, + forced: true, + filter: function (event) { + return event.source && event.source.isMin(); }, - content:function(){ + content: function () { + trigger.source.addSkill("stone_mafengzhuru2"); + }, + }, + stone_mafengzhuru2: { + trigger: { global: "dieAfter" }, + forced: true, + popup: false, + unique: true, + filter: function (event, player) { + return player.hasSkill("stone_mafengzhuru2"); + }, + content: function () { player.loseHp(); - player.removeSkill('stone_mafengzhuru2'); - } + player.removeSkill("stone_mafengzhuru2"); + }, }, - stone_zhufu:{ - trigger:{global:'phaseEnd'}, - forced:true, - unique:true, - filter:function(event,player){ - if(event.player!=player.getLeader()) return false; - for(var i=0;iplayer.actcount) return false; - } + if (player.getActCount() + stoneact > player.actcount) return false; + }, }, - trigger:{player:'phaseBegin'}, - forced:true, - popup:false, - priority:15, - filter:function(event,player){ + trigger: { player: "phaseBegin" }, + forced: true, + popup: false, + priority: 15, + filter: function (event, player) { return !player.isMin(); }, - content:function(){ - player.actused=0; - if(player.side){ - player.actcount=player.getEnemy().actcount+1; - } - else{ - player.actcount=player.getEnemy().actcount; - if(!_status.actcoin){ - _status.actcoin=true; + content: function () { + player.actused = 0; + if (player.side) { + player.actcount = player.getEnemy().actcount + 1; + } else { + player.actcount = player.getEnemy().actcount; + if (!_status.actcoin) { + _status.actcoin = true; player.actused--; } } - if(player.actcount>6){ - if(get.config('mana_mode')=='inc'){ - player.actcount=6; - } - else{ - player.actcount-=4; + if (player.actcount > 6) { + if (get.config("mana_mode") == "inc") { + player.actcount = 6; + } else { + player.actcount -= 4; } } player.updateActCount(); - player.getEnemy().updateActCount('outphase'); - } - }, - _actcount2:{ - trigger:{player:'useCard'}, - forced:true, - popup:false, - filter:function(event,player){ - return !player.isMin()&&!event.noActCount&&_status.currentPhase==player; + player.getEnemy().updateActCount("outphase"); }, - content:function(){ - var stoneact=get.info(trigger.card).stoneact; - if(typeof stoneact==='number'){ - player.actused+=stoneact-1; + }, + _actcount2: { + trigger: { player: "useCard" }, + forced: true, + popup: false, + filter: function (event, player) { + return !player.isMin() && !event.noActCount && _status.currentPhase == player; + }, + content: function () { + var stoneact = get.info(trigger.card).stoneact; + if (typeof stoneact === "number") { + player.actused += stoneact - 1; } player.updateActCount(); - } + }, }, - stonesha:{ - unique:true, - mod:{ - cardname:function(card){ - if(lib.card[card.name].type=='equip') return 'sha'; + stonesha: { + unique: true, + mod: { + cardname: function (card) { + if (lib.card[card.name].type == "equip") return "sha"; }, }, }, - stoneshan:{ - unique:true, - mod:{ - cardname:function(card){ - if(lib.card[card.name].type.indexOf('stone')==0) return 'shan'; + stoneshan: { + unique: true, + mod: { + cardname: function (card) { + if (lib.card[card.name].type.indexOf("stone") == 0) return "shan"; }, }, }, - stonedraw:{ - trigger:{player:'phaseDrawBegin'}, - forced:true, - popup:false, - content:function(){ + stonedraw: { + trigger: { player: "phaseDrawBegin" }, + forced: true, + popup: false, + content: function () { trigger.num--; }, - ai:{ - effect:{ - target:function(card){ - if(card.name=='bingliang'){ + ai: { + effect: { + target: function (card) { + if (card.name == "bingliang") { return 0.6; } - } - } - } + }, + }, + }, }, - _stonerage1:{ - trigger:{player:'damageEnd'}, - forced:true, - popup:false, - content:function(){ - if(player.isMin()){ - player.changeRage(3*trigger.num); + _stonerage1: { + trigger: { player: "damageEnd" }, + forced: true, + popup: false, + content: function () { + if (player.isMin()) { + player.changeRage(3 * trigger.num); + } else { + player.changeRage(6 * trigger.num); } - else{ - player.changeRage(6*trigger.num); - } - } + }, }, - _stonerage2:{ - trigger:{player:'dieBegin'}, - forced:true, - popup:false, - content:function(){ - if(player.isMin()){ + _stonerage2: { + trigger: { player: "dieBegin" }, + forced: true, + popup: false, + content: function () { + if (player.isMin()) { player.changeRage(10); - } - else{ + } else { player.changeRage(20); } - } - }, - _stonerage3:{ - trigger:{player:'phaseAfter'}, - forced:true, - popup:false, - filter:function(event,player){ - return !player.isMin()&&player.getEnemy().countFellow()>player.countFellow(); }, - content:function(){ - player.changeRage((player.getEnemy().countFellow()-player.countFellow())*10); - } }, - _stonerage_add:{ - trigger:{player:'phaseBegin'}, - direct:true, - priority:10, - filter:function(event,player){ - if(!player.canAddFellow()){ + _stonerage3: { + trigger: { player: "phaseAfter" }, + forced: true, + popup: false, + filter: function (event, player) { + return !player.isMin() && player.getEnemy().countFellow() > player.countFellow(); + }, + content: function () { + player.changeRage((player.getEnemy().countFellow() - player.countFellow()) * 10); + }, + }, + _stonerage_add: { + trigger: { player: "phaseBegin" }, + direct: true, + priority: 10, + filter: function (event, player) { + if (!player.canAddFellow()) { return false; } - if(player==game.me){ - return _status.friendRage>=100; - } - else if(player==game.me.getEnemy()){ - return _status.enemyRage>=100; + if (player == game.me) { + return _status.friendRage >= 100; + } else if (player == game.me.getEnemy()) { + return _status.enemyRage >= 100; } return false; }, - content:function(){ - 'step 0' - var list=[]; - var list2=[]; - for(var i in lib.character){ - if(lib.character[i][4].includes('stonelegend_'+player.career)){ + content: function () { + "step 0"; + var list = []; + var list2 = []; + for (var i in lib.character) { + if (lib.character[i][4].includes("stonelegend_" + player.career)) { list.push(i); - } - else if(lib.character[i][4].includes('stonelegend')){ + } else if (lib.character[i][4].includes("stonelegend")) { list2.push(i); } } - var dialog=ui.create.dialog('hidden','召唤一名传说随从','
        消耗100怒气值和4点行动值
        ',[list.concat(list2),'character']); - var heilong=false; - var dc=player.getEnemy().countFellow()-player.countFellow(); - if(dc>2){ - heilong=true; - } - else if(dc==2){ - if(player.getEnemy().countFellow()>=3){ - heilong=Math.random()<0.5; - } - else if(player.actcount-player.getActCount()<=0){ - heilong=true; - } - else{ - dc=0; - for(var i=0;i消耗100怒气值和4点行动值
    ', + [list.concat(list2), "character"] + ); + var heilong = false; + var dc = player.getEnemy().countFellow() - player.countFellow(); + if (dc > 2) { + heilong = true; + } else if (dc == 2) { + if (player.getEnemy().countFellow() >= 3) { + heilong = Math.random() < 0.5; + } else if (player.actcount - player.getActCount() <= 0) { + heilong = true; + } else { + dc = 0; + for (var i = 0; i < game.players.length; i++) { + if (game.players[i].isMin() && game.players[i].side != player.side) { + dc += game.players[i].hp; } } - if(dc>5){ - heilong=true; - } - else{ - heilong=Math.random()<0.3; + if (dc > 5) { + heilong = true; + } else { + heilong = Math.random() < 0.3; } } } - var honglong=false; - if(!heilong){ - var num=0; - for(var i=0;i6){ - honglong=true; - } - else if(player.maxHp-player.hp>=3&&player.hp<=2){ - honglong=true; + if (num > 6) { + honglong = true; + } else if (player.maxHp - player.hp >= 3 && player.hp <= 2) { + honglong = true; } } - player.chooseButton(dialog).ai=function(button){ - if(button.link=='stone_siwangzhiyi'){ - if(heilong) return 3; + player.chooseButton(dialog).ai = function (button) { + if (button.link == "stone_siwangzhiyi") { + if (heilong) return 3; return 0; } - if(button.link=='stone_alaikesita'){ - if(honglong) return 2; + if (button.link == "stone_alaikesita") { + if (honglong) return 2; return 0; } return Math.random(); - } - 'step 1' - if(result.bool){ - player.$skill(get.translation(result.links[0]),'legend','metal'); + }; + "step 1"; + if (result.bool) { + player.$skill(get.translation(result.links[0]), "legend", "metal"); game.delay(2); - event.addname=result.links[0]; + event.addname = result.links[0]; player.changeRage(-100); - player.actused+=4; + player.actused += 4; player.updateActCount(); - } - else{ + } else { event.finish(); } - 'step 2' - if(event.addname){ - if(event.addname=='stone_jialakesi'){ - if(player.name=='stone_jialakesix'){ - player.hp=player.maxHp; + "step 2"; + if (event.addname) { + if (event.addname == "stone_jialakesi") { + if (player.name == "stone_jialakesix") { + player.hp = player.maxHp; player.update(); - player.actused-=4; + player.actused -= 4; player.updateActCount(); player.storage.stone_lianyu++; - } - else{ - if(player.name2){ - player.storage.stone_lianyu=1; + } else { + if (player.name2) { + player.storage.stone_lianyu = 1; + } else { + player.storage.stone_lianyu = 0; } - else{ - player.storage.stone_lianyu=0; - } - player.init('stone_jialakesix'); - game.addVideo('reinit2',player,'stone_jialakesix'); + player.init("stone_jialakesix"); + game.addVideo("reinit2", player, "stone_jialakesix"); } - player.syncStorage('stone_lianyu'); - var card=game.createCard('stone_jialakesi_stonecharacter'); + player.syncStorage("stone_lianyu"); + var card = game.createCard("stone_jialakesi_stonecharacter"); card.node.info.remove(); card.node.addinfo.remove(); - player.$give(card,player); - } - else{ + player.$give(card, player); + } else { player.addFellowAuto(event.addname); } } - } - } + }, + }, }, - translate:{ - shaman:'萨满', - mage:'法师', - priest:'牧师', - warrior:'战士', - warlock:'术士', - knight:'死亡骑士', - rogue:'潜行者', - paladin:'圣骑士', - hunter:'猎人', - druid:'德鲁伊', - - stone_siwangzhiyi:'死亡之翼', - stone_alaikesita:'阿莱克萨', - stone_yisela:'伊瑟拉', - stone_nuoziduomu:'诺兹多姆', - stone_maligousi:'玛里苟斯', - stone_aolajier:'奥拉基尔', - stone_andongni:'安东尼', - stone_jialakesi:'加拉克斯', - stone_jialakesix:'加拉克斯', - stone_kelushi:'克鲁什', - stone_geluomashi:'格罗玛什', - stone_aidewen:'艾德温', - stone_sainaliusi:'塞纳留斯', - stone_fuding:'弗丁', - stone_weilun:'维纶', - - stone_fushi:'缚誓', - stone_fushi_info:'你出场时,为所有友方角色回复所有体力值。', - stone_mieshi:'灭世', - stone_mieshi_info:'你出场时,对所有其他随从造成2点伤害,然后弃置己方主将的所有手牌。', - stone_shixu:'时序', - stone_shixu_info:'你出场的回合内,己方主将获得4点行动值。', - stone_chenshui:'沉睡', - stone_chenshui_info:'在你的结束阶段,令己方主将获得一张梦境牌。', - stone_mowang:'魔网', - stone_mowang_info:'己方法术对主将伤害+2,对随从伤害+4。', - - stone_zhiyin:'指引', - stone_zhiyin_info:'每当己方主将使用一张法术牌,将一张火球术置于其手牌。', - stone_bianshen:'变身', - stone_bianshen_info:'你出场时,若己方主将职业为术士,则代之成为新的主将;若己变身,则改为令你召唤的地狱火的初始手牌数和体力值+1。', - stone_lianyu:'炼狱', - stone_lianyu_info:'你的职业技能改为召唤一个地狱火。', - stone_lianji:'连击', - stone_lianji_info:'每当己方主将召唤一个随从,便增加1点体力和体力上限并摸一张牌。', - stone_shenyu:'神谕', - stone_shenyu_info:'你出场时,己方主将可以选择一项:召唤两个嘲讽树人,或令所有其他随从增加1点体力和体力上限并摸两张牌。', - stone_fuchou:'复仇', - stone_fuchou_info:'你死亡后,视为己方主将使用了一张复仇之怒。', - stone_shenyou:'神佑', - stone_shenyou_info:'己方主将的职业技能和法术的治疗效果翻倍。', - stone_jinu:'激怒', - stone_jinu_info:'摸牌阶段,若你己受伤,则额外摸两张牌。', - - spell_shenshengxinxing:'神圣新星', - spell_shenshengxinxing_info:'对所有敌方角色造成1点伤害,令所有友方角色回复1点体力。', - spell_shengguangzhadan:'圣光炸弹', - spell_shengguangzhadan_info:'对所有随从造成等同于其手牌数的伤害。', - spell_maizang:'埋葬', - spell_maizang_info:'令一名敌方随从死亡(不触发死亡技能),并将一张与该随从同名的随从洗入你的牌库。', - spell_xinlingshijie:'心灵视界', - spell_xinlingshijie_info:'将一张敌方主将手牌的复制置于你的手牌。', - spell_naluzhiguang:'纳鲁之光', - spell_naluzhiguang_info:'恢复1点体力值,若目标仍处于受伤状态,则召唤一名圣光护卫。', - spell_zhiliaozhihuan:'治疗之环', - spell_zhiliaozhihuan_info:'令所有随从回复3点体力。', - - spell_zhenyanshu:'真言术', - spell_zhenyanshu_info:'令一名随从增加1点体力和体力上限;从牌库中获得一张牌。', - spell_enzeshu:'恩泽术', - spell_enzeshu_info:'令一名随从增加3点体力和体力上限。', - spell_anyingxingtai:'暗影形态', - priest_anyingxingtai:'暗影形态', - spell_anyingxingtai_info:'你的职业技能改为造成1点伤害,若已进入暗影形态,则改为造成2点伤害。', - spell_kuaisuzhiliao:'快速治疗', - spell_kuaisuzhiliao_info:'回复2点体力。', - spell_xinlinghanbao:'心灵撼爆', - spell_xinlinghanbao_info:'对敌方主将造成2点伤害。', - spell_kongxinshu:'控心术', - spell_kongxinshu_info:'复制敌方牌库中的一张随从,将其置入战场。', - - stone_shengguanghuwei:'圣光护卫', - priest_shengguang:'圣光', - priest_shengguang_info:'每当一名随从获得治疗,摸一张牌。', - - spell_nuxi:'怒袭', - spell_nuxi_info:'造成1点伤害,获得2点护甲。', - spell_dunpaimengji:'盾牌猛击', - spell_dunpaimengji_info:'对一名随从造成等同于你护甲值的伤害。', - spell_zhansha:'斩杀', - spell_zhansha_info:'令一名已受伤的敌方随从死亡。', - spell_nuhuozhongshao:'怒火中烧', - spell_nuhuozhongshao_info:'对一名随从造成1点伤害,然后令其摸两张牌。', - spell_xuanfengzhan:'旋风斩', - spell_xuanfengzhan_info:'对所有随从造成1点伤害。', - spell_juemingluandou:'绝命乱斗', - spell_juemingluandou_info:'随机保留一名随从,然后令所有其他随从死亡。', - - spell_zhongnian:'重碾', - spell_zhongnian_info:'造成X点伤害,X为已受伤的友方角色数且不超过3。', - spell_zhandounuhuo:'战斗怒火', - spell_zhandounuhuo_info:'从牌库中获得X张牌,X为已受伤的友方角色数。', - spell_chongfeng:'冲锋', - spell_chongfeng_info:'令一名武将牌背面朝上的友方随从摸三张牌,然后将武将牌翻至正面。', - spell_fuchoudaji:'复仇打击', - spell_fuchoudaji_info:'对所有随从造成1点伤害,若你的体力值不大于2,改为造成3点伤害。', - spell_kuangbao:'狂暴', - spell_kuangbao_info:'令一名已受伤的友方随从摸四张牌。', - spell_yingyongdaji:'英勇打击', - spell_yingyongdaji_info:'令一名敌方角色对你造成2点伤害,然后对其造成2点伤害。', - - spell_dubiao:'毒镖', - spell_dubiao_info:'对一名随机敌方角色造成1点伤害。', - spell_qiangfengsheji:'强风射击', - spell_qiangfengsheji_info:'对两名敌方随从各造成1点伤害,并弃置其两张手牌。', - spell_tanxianmao:'探险帽', - hunter_tanxianmao:'探险帽', - hunter_tanxianmao_info:'你死亡时,将一张探险帽置入主将的手牌。', - spell_tanxianmao_info:'令一名友方随从增加1点体力和体力上限并摸一张牌,当该随从死亡时,将一张探险帽置入你的手牌。', - spell_shalumingling:'杀戮命令', - spell_shalumingling_info:'造成1点伤害,如果你控制任何野兽,则改为造成2点伤害。', - spell_zhuizongshu:'追踪术', - spell_zhuizongshu_info:'从牌库中随机选择三张牌,获得其中的一张。', - spell_tianjiangzhuqun:'天降蛛群', - spell_tianjiangzhuqun_info:'召唤三只结网蛛。', - - spell_lierenyinji:'猎人印记', - spell_lierenyinji_info:'将一名随从的体力上限降至1。', - spell_kuaisusheji:'快速射击', - spell_kuaisusheji_info:'造成1点伤害,摸一张牌。', - spell_guanmenfanggou:'关门放狗', - spell_guanmenfanggou_info:'每有一名敌方随从,便召唤一只猎狗。', - spell_zhaohuanchongwu:'动物伙伴', - spell_zhaohuanchongwu_info:'随机召唤一只野兽。', - spell_zidanshangtang:'子弹上膛', - spell_zidanshangtang_info:'随机获得一张猎人职业法术牌,并获得技能〖上膛〗直到回合结束。', - spell_duochongsheji:'多重射击', - spell_duochongsheji_info:'对两名随机敌方随从各造成2点伤害。', - - stone_liegou:'猎狗', - hunter_zidanshangtang:'上膛', - hunter_zidanshangtang_bg:'膛', - hunter_zidanshangtang_info:'每当你使用一张法术牌,便随机获得一张猎人职业法术牌。', - - spell_zuzhou:'诅咒', - spell_zuzhou_info:'将目标随从翻面,摸一张牌。', - spell_xishengqiyue:'牺牲契约', - spell_xishengqiyue_info:'令双方各一名随从立即死亡。', - spell_xiaoguibaopo:'小鬼爆破', - spell_xiaoguibaopo_info:'对一名随从造成1~3点伤害,每造成1点伤害,便召唤一只小鬼。', - spell_anyinglieyan:'暗影裂焰', - spell_anyinglieyan_info:'杀死一名友方随从,并对所有敌方随从造成等于其体力值的伤害。', - spell_liliangdaijia:'力量代价', - spell_liliangdaijia_info:'令一名友方随从摸四张牌,将体力值变为5,并在其下个回合结束后死亡。', - spell_emozhinu:'恶魔之怒', - spell_emozhinu_info:'对所有随从造成2点伤害。', - - spell_emozhixin:'恶魔之心', - spell_emozhixin_info:'对一名敌方随从造成4点伤害,或令一名友方随从摸四张牌。', - spell_ansezhadan:'暗色炸弹', - spell_ansezhadan_info:'造成2点伤害。', - spell_fushishu:'腐蚀术', - warlock_fushishu:'腐蚀', - warlock_fushishu_info:'下个回合结束后死亡。', - spell_fushishu_info:'令一名敌方随从于其下个回合结束后死亡。', - spell_heianqiyue:'黑暗契约', - spell_heianqiyue_info:'随机令两名敌方随从死亡,随机弃置两张手牌。', - spell_linghunhongxi:'灵魂虹吸', - spell_linghunhongxi_info:'令一名随从死亡,回复1点体力。', - spell_siwangchanrao:'死亡缠绕', - spell_siwangchanrao_info:'对一名随从造成1点伤害;若该随从死亡,从牌库中获得一张牌。', - - spell_wuyashenxiang:'乌鸦神像', - spell_wuyashenxiang_info:'从三张法术牌或随从牌中选择一张加入手牌。', - spell_huotigenxu:'活体根须', - spell_huotigenxu_info:'造成1点伤害,或召唤两个树苗。', - spell_hengsao:'横扫', - spell_hengsao_info:'对一名敌方角色造成2点伤害,然后对其他敌方角色造成1点伤害。', - spell_yexingchengzhang:'野性成长', - spell_yexingchengzhang_info:'下个出牌阶段开始时获得三点额外行动值。', - spell_ziranzhili:'自然之力', - spell_ziranzhili_info:'召唤三个自爆树人。', - spell_yemanpaoxiao:'野蛮咆哮', - spell_yemanpaoxiao_bg:'咆', - spell_yemanpaoxiao2:'咆哮', - spell_yemanpaoxiao_info:'所有友方角色造成的伤害+1,直到你的下个回合开始。', - - spell_conglinzhihun:'丛林之魂', - druid_conglinzhihun:'树魂', - druid_conglinzhihun_info:'你死亡后召唤一个树人。', - spell_conglinzhihun_info:'令所有友方随从获得技能树魂(你死亡后召唤一个树人)。', - spell_ziyang:'滋养', - spell_ziyang_info:'下个出牌开始阶段获得4点额外行动值,或从牌库中获得三张牌。', - spell_fugen:'腐根', - spell_fugen_info:'令一名随从死亡,将一张随机随从置入对手的手牌。', - spell_xingchenzhuiluo:'星辰坠落', - spell_xingchenzhuiluo_info:'对一名敌方随从造成5点伤害,或对所有敌方随从造成2点伤害。', - spell_fennu:'愤怒', - spell_fennu_info:'对一名随从造成2点伤害,或造成1点伤害并从牌库中获得一张牌。', - spell_heiandiyu:'黑暗低语', - spell_heiandiyu_info:'召唤若干个小精灵直到你的随从数达到4;或令一名随从增加1点体力和体力上限并摸三张牌。', - - druid_yexingchengzhang:'成长', - druid_yexingchengzhang_bg:'长', - druid_yexingchengzhang_info:'下个出牌阶段开始时获得三点额外行动值。', - druid_ziyang:'滋养', - druid_ziyang_bg:'养', - druid_ziyang_info:'下个出牌阶段开始时获得四点额外行动值。', - - stone_shumiao:'树苗', - stone_shuren:'自爆树人', - stone_shurenx:'树人', - stone_shurenxx:'嘲讽树人', - stone_zibao:'自爆', - stone_zibao_info:'结合结束后立即死亡。', - - spell_cigu:'刺骨', - spell_cigu_info:'造成1点伤害,你可以弃置一张装备区内的牌令伤害+1。', - spell_jianrenluanwu:'剑刃乱舞', - spell_jianrenluanwu_info:'弃置你的武器牌,并对所有敌方角色造成1点伤害。', - spell_daoshan:'刀扇', - spell_daoshan_info:'对所有敌方随从造成1点伤害,从牌库中获得一张牌。', - spell_sijidaifa:'伺机待发', - spell_sijidaifa_info:'你使用下一张法术牌时获得X点行动值,X为该法术的行动值消耗且不超过3。', - spell_cisha:'刺杀', - spell_cisha_info:'杀死一名随从。', - spell_modaoyou:'磨刀油', - spell_modaoyou_info:'令你下一次剑刃乱舞造成的伤害+1,并与一名随机友方随从各摸两张牌。', - - spell_mengun:'闷棍', - spell_mengun_info:'令一名敌方随从死亡(不触发死亡技能),将一张该随从的复制置入对手的手牌。', - spell_anzhongpohuai:'暗中破坏', - spell_anzhongpohuai_info:'随机杀死一名敌方随从,随机弃置敌方的一张装备牌。', - spell_beici:'背刺', - spell_beici_info:'令一名未受伤的随从失去1点体力。', - spell_weijisifu:'危机四伏', - spell_zhumo:'蛛魔', - stone_zhumo:'蛛魔', - spell_zhumo_info:'每当该牌被弃置,为你的对手召唤一只蛛魔。', - spell_weijisifu_info:'将三张蛛魔牌洗入对手的牌库;每当一名角色弃置蛛魔牌,为其对手召唤一只蛛魔。', - spell_piaoqie:'剽窃', - spell_piaoqie_info:'复制两张对手牌库中的牌加入你的手牌。', - spell_jipao:'疾跑', - spell_jipao_info:'从牌库中获得四张牌。', - - spell_fengxian:'奉献', - spell_fengxian_info:'对所有敌方角色造成1点伤害。', - spell_fuchouzhinu:'复仇之怒', - spell_fuchouzhinu_info:'造成5点伤害,随机分配到所有敌方随从上。', - spell_shengliaoshu:'圣疗术', - spell_shengliaoshu_info:'恢复2点体力,摸两张牌。', - spell_fennuzhichui:'愤怒之锤', - spell_fennuzhichui_info:'造成1点伤害,从牌库中获得一张牌。', - spell_zuozhandongyuan:'作战动员', - spell_zuozhandongyuan_info:'召唤两个新兵,随机装备一把武器。', - spell_liliangzhufu:'力量祝福', - spell_liliangzhufu_info:'令一名随从摸两张牌。', - - spell_jinyingduijue:'精英对决', - spell_jinyingduijue_info:'双方各保留体力值最高的一名随从,然后令其他随从死亡。', - spell_shenpan:'审判', - spell_shenpan_info:'若你的对手随从数不少于你,则随机令一名敌方随从死亡。', - spell_shenshengfennu:'神圣愤怒', - spell_shenshengfennu_info:'从牌库中获得一张牌,并造成等同于其行动值消耗的伤害。', - spell_yongshizhufu:'勇士祝福', - spell_yongshizhufu_info:'令一名随从的手牌数翻倍。', - spell_zhengqianghaosheng:'争强好胜', - paladin_zhengqianghaosheng:'争强好胜', - paladin_zhengqianghaosheng_info:'在你的下一准备阶段,令所有友方随从增加1点体力和体力上限并摸一张牌。', - spell_zhengqianghaosheng_info:'在你的下一准备阶段,令所有友方随从增加1点体力和体力上限并摸一张牌。', - spell_zhihuizhufu:'智慧祝福', - paladin_zhihuizhufu:'智慧祝福', - spell_zhihuizhufu_info:'选择一名随从,在其每个准备阶段,你从牌库中获得一张牌。', - - spell_fengnu:'风怒', - shaman_fengnu:'风怒', - shaman_fengnu_info:'回合结束后,你获得一个额外回合。', - spell_fengnu_info:'令一名随从获得技能风怒(回合结束后,你获得一个额外回合)。', - spell_rongyanbaolie:'熔岩爆裂', - spell_rongyanbaolie_info:'造成3点火焰伤害,失去1点体力。', - spell_shihuawuqi:'石化武器', - shaman_shihuawuqi:'充能', - shaman_shihuawuqi_info:'准备阶段,你摸三张牌。', - spell_shihuawuqi_info:'令一名友方随从获得技能充能(准备阶段,你摸三张牌),直到你的下一回合开始。', - spell_xianzuzhaohuan:'先祖召唤', - spell_xianzuzhaohuan_info:'双方各将手牌中的一张随机随从牌置入战场。', - spell_xianzuzhihun:'先祖之魂', - shaman_xianzuzhihun:'转生', - shaman_xianzuzhihun_info:'你死亡后,召唤一个自身的复制。', - spell_xianzuzhihun_info:'令一名随从获得技能转生(你死亡后,召唤一个自身的复制)。', - spell_xianzuzhishi:'先祖知识', - shaman_xianzuzhishi:'先祖知识', - shaman_xianzuzhishi_info:'本回合手牌上限-1。', - spell_xianzuzhishi_info:'从牌库中获得两张牌,本回合手牌上限-1(多次使用不叠加)。', - - spell_lianhuanbaolie:'连环爆裂', - spell_lianhuanbaolie_info:'造成1~2点雷电伤害。', - spell_shandianfengbao:'闪电风暴', - spell_shandianfengbao_info:'对所有敌方随从造成1~2点伤害。', - spell_yaoshu:'妖术', - spell_yaoshu_info:'将一个随从变成一只青蛙。', - spell_yexinglanghun:'野性狼魂', - spell_yexinglanghun_info:'召唤两个幽灵狼。', - spell_shixue:'嗜血', - spell_shixue_info:'所有友方随从摸两张牌。', - spell_chazhuangshandian:'叉状闪电', - spell_chazhuangshandian_info:'对两个随机敌方随从各造成1点雷电伤害。', - - stone_qingwa:'青蛙', - stone_youlinglang:'幽灵狼', - stone_jingxiang:'镜像', - stone_jingxiang_info:'锁定技,你跳过摸牌阶段。', - shaman_qingwa:'青蛙', - shaman_qingwa_info:'锁定技,你跳过摸牌阶段。', - stone_xiaojingling:'小精灵', - - spell_laojiuhuoba:'老旧火把', - spell_laojiuhuoba_info:'造成1点伤害,将一张炽热火把置入你的牌库。', - spell_chirehuoba:'炽热火把', - spell_chirehuoba_info:'造成2点火焰伤害。', - spell_canying:'残影', - spell_canying_info:'复制你的所有随从,并将其置入你的手牌。', - spell_yanbaoshu:'炎爆术', - spell_yanbaoshu_info:'造成4点火焰伤害(若目标为主将,伤害不能超过目标的当前体力值)。', - spell_jingxiang:'镜像', - spell_jingxiang_info:'召唤两个具有嘲讽且摸牌阶段不摸牌的随从。', - spell_aoshufeidan:'奥术飞弹', - spell_aoshufeidan_info:'造成3点伤害,随从分配到所有敌方随从上。', - spell_hanbingpingzhang:'寒冰屏障', - mage_hanbingpingzhang:'寒冰屏障', - mage_hanbingpingzhang_info:'体力值不能降到2以内。', - spell_hanbingpingzhang_info:'令一名角色的体力值不能降到2以内,直到你的下一回合开始。', - - spell_hanbingjian:'寒冰箭', - spell_hanbingjian_info:'对一个随从造成2点伤害,然后将其翻面。', - spell_lieyanfengbao:'烈焰风暴', - spell_lieyanfengbao_info:'对所有敌方随从造成2点伤害。', - spell_baofengxue:'暴风雪', - spell_baofengxue_info:'对所有敌方随从造成1点伤害,然后将其翻面。', - spell_aoshuzhihui:'奥术智慧', - spell_aoshuzhihui_info:'从牌库中获得两张牌。', - spell_bianxingshu:'变形术', - spell_bianxingshu_info:'将一个随从变成一只绵羊。', - spell_huoqiushu:'火球术', - spell_huoqiushu_info:'造成3点火焰伤害(若目标为主将,伤害不能超过目标的当前体力值)。', - - stone_mianyang:'绵羊', - mage_mianyang:'绵羊', - mage_mianyang_info:'锁定技,你不能使用杀。', - - stone_beijunmushi:'北郡牧师', - stone_guangyaozhizi:'光耀之子', - stone_longmianjiaoguan:'龙眠教官', - stone_linghunjisi:'灵魂祭司', - stone_guanliyuan:'管理员', - stone_heianjiaotu:'黑暗教徒', - - stone_shengdianzhishi:'圣殿执事', - stone_suoxiaojishi:'缩小技师', - stone_anyingzisi:'暗影子嗣', - stone_guangmingquan:'光明泉', - stone_muguangchulong:'暮光雏龙', - stone_shenshengyongshi:'神圣勇士', - - priest_puzhao:'普照', - priest_puzhao_info:'你出场时,己方主将可令一名其他友方随从增加2点体力和体力上限。', - priest_suoxiao:'缩小', - priest_suoxiao_info:'你出场时,己方主将可令一名其他随从减少2点体力上限(不能小于1)。', - priest_shengshui:'圣水', - priest_shengshui_info:'你跳过摸牌阶段;在你的准备阶段,令一名随机友方角色回复2点体力。', - priest_muguang:'暮光', - priest_muguang_info:'你出场时,若主将手牌中有随从牌,则增加1点体力和体力上限。', - priest_shixin:'蚀心', - priest_shixin_info:'每当己方主将使用一次职业技能,对双方主将各造成1点伤害。', - - priest_shengliao:'圣疗', - priest_shengliao_info:'每当一名随从回复体力,己方主将从牌库中获得一张牌。', - priest_guangyao:'光耀', - priest_guangyao_info:'每当你的体力值发生改变,摸一张牌。', - priest_xundao:'训导', - priest_xundao_info:'你出场时,若己方主将手牌中有随从牌,则摸一张牌并获得嘲讽。', - priest_hunwu:'魂舞', - priest_hunwu_info:'己方主将的职业技能及法术的治疗效果改为令目标失去等量体力。', - priest_faxian:'发现', - priest_faxian_info:'你出场时,己方主将从三张随机随从牌中选择一张加入手牌。', - priest_zhufu:'献身', - priest_zhufu_info:'你死亡时,令一名随机友方随从增加1点体力和体力上限。', - - stone_daomufeizei:'盗墓匪贼', - stone_haidao:'海盗', - stone_haidaotoumu:'海盗头目', - stone_cike:'刺客', - stone_tegong:'特工', - stone_qiezei:'窃贼', - stone_heitieairen:'黑铁矮人', - - stone_duyanhaidao:'独眼海盗', - stone_gangtiewushi:'刚铁武师', - stone_lifaji:'理发机', - stone_shihualong:'石化龙', - stone_xiushuihaidao:'锈水海盗', - stone_zousishangfan:'走私商贩', - - rogue_duxing:'独行', - rogue_duxing_info:'每当敌方主将召唤一名随从,便获得潜行。', - rogue_shoudao:'授道', - rogue_shoudao_info:'在己方主将的结束阶段,令一名随机友方随从增加1点体力和体力上限并摸一张牌。', - rogue_lifa:'理发', - rogue_lifa_info:'为己方主将装备一把武器,若已有武器,改为对敌方主将造成1点伤害。', - rogue_fusheng:'复生', - rogue_fusheng_info:'你出场时,体力值和体力上限变为X,X为场上体力最高的随从的体力值。', - rogue_jielue:'劫掠', - rogue_jielue_info:'每当己方主将装备一把武器牌,摸两张牌。', - rogue_jiaoyi:'交易', - rogue_jiaoyi_info:'你出场时,己方主将可以弃置一张装备牌令你摸三张牌。', - - rogue_touqie:'偷窃', - rogue_touqie_info:'每当你造成一次伤害,己方主将从牌库中获得一张牌。', - rogue_xunbao:'寻宝', - rogue_xunbao_info:'你死亡时,将一张伺机行发置于己方主将的手牌。', - rogue_cisha:'刺杀', - rogue_cisha_info:'每当你对一名随从造成伤害,受伤害随从立即死亡。', - rogue_touxi:'偷袭', - rogue_touxi_info:'你出场时,己方主将可弃置一张装备区内的牌并对一名敌方角色造成1点伤害。', - rogue_qiancang:'潜藏', - rogue_qiancang_info:'你出场时,对所有未受伤害的敌方随从造成1点伤害。', - rogue_zhaomu:'结伙', - rogue_zhaomu_info:'你出场时,召唤一个海盗。', - - stone_zhihuiguan:'指挥官', - stone_jiangong:'监工', - stone_yuanhou:'猿猴', - stone_chidunshinv:'持盾侍女', - stone_zhujiashi:'铸甲师', - stone_kuangzhanshi:'狂战士', - - stone_heiyaoyaoshou:'黑曜妖兽', - stone_honglongyongshi:'红龙勇士', - stone_peilianshi:'陪练师', - stone_jingyingweishi:'精英卫士', - stone_shengjiachong:'圣甲虫', - stone_mengmaren:'猛犸人', - stone_zhifuzhe:'掷斧者', - - warrior_heiyao:'黑曜', - warrior_heiyao_info:'在己方主将的结束阶段,召唤一只圣甲虫。', - warrior_peilian:'陪练', - warrior_peilian_info:'你出场时,己方主将可令一名其他随从获得嘲讽。', - warrior_fenyong:'奋勇', - warrior_fenyong_info:'你出场时,若己方主将手牌中有随从牌,则获得冲锋。', - warrior_chuanci:'穿刺', - warrior_chuanci_info:'每当你对一名敌方随从造成伤害,对另一名随机敌方随从造成等量的伤害。', - warrior_zhifu:'掷斧', - warrior_zhifu_info:'每当你受到一次伤害,对敌方主将造成1点伤害。', - - warrior_tongling:'统领', - warrior_tongling_info:'每当你召唤一个初始手牌数不大于2的随从,令其获得冲锋。', - warrior_baoluan:'暴乱', - warrior_baoluan_info:'每当一名随从受到一次伤害,摸一张牌。', - warrior_jiangong:'监工', - warrior_jiangong_info:'你出场时,己方主将可对一名随从造成1点伤害,然后令该随从摸两张牌。', - warrior_zhujia:'铸甲', - warrior_zhujia_info:'每当你受到一次伤害,己方主将获得1点护甲。', - warrior_tidun:'提盾', - warrior_tidun_info:'你出场时,己方主将获得2点护甲。', - - stone_lieyanxiaogui:'烈焰小鬼', - stone_xiaoguishouling:'小鬼首领', - stone_kongjuzhanma:'恐惧战马', - stone_morishouwei:'末日守卫', - stone_xukongxingzhe:'虚空行者', - stone_diyuhuo:'地狱火', - stone_diyuhuox:'地狱火', - stone_xiaogui:'小鬼', - - stone_heishitanfan:'黑市摊贩', - stone_zhaohuanzhe:'召唤者', - stone_meimo:'魅魔', - stone_tongkunvwang:'痛苦女王', - stone_xukongkongmo:'虚空恐魔', - stone_fukongmoyan:'浮空魔眼', - - warlock_anyu:'暗语', - warlock_anyu_info:'你出场时,己方主将从三张随机的行动值消耗为1的牌中选择一张加入手牌。', - warlock_zhaohuan:'召唤', - warlock_zhaohuan_info:'你死亡时,将手牌中的一张随机随从牌置入战场。', - warlock_huanmeng:'幻梦', - warlock_huanmeng_info:'你出场时,己方主将随机弃置一张手牌。', - warlock_tongku:'痛苦', - warlock_tongku_info:'每当你造成一次伤害,令己方主将回复1点体力。', - warlock_tunshi:'吞噬', - warlock_tunshi_info:'你出场时,己方主将须令一名其他友方随从死亡,然后你获得其全部的手牌和体力值。', - warlock_shijie:'视界', - warlock_shijie_info:'每当己方主将受到一次伤害,你增加1点体力和体力上限并摸一张牌。', - - warlock_nonghuo:'弄火', - warlock_nonghuo_info:'你出场时,对己方主将造成1点火焰伤害。', - warlock_zhaogui:'召鬼', - warlock_zhaogui_info:'每当你受到一次伤害,召唤一个小鬼。', - warlock_yongsheng:'永生', - warlock_yongsheng_info:'你死亡后,召唤一匹恐惧战马。', - warlock_yuhuo:'狱火', - warlock_yuhuo_info:'你出场时,对所有其他随从造成1点伤害。', - warlock_zaihuo:'灾祸', - warlock_zaihuo_info:'你出场时,随机弃置主将的两张手牌。', - - stone_hudunren:'护盾人', - stone_junxuguan:'军需官', - stone_yurenqishi:'鱼人骑士', - stone_chidunweishi:'持盾卫士', - stone_liewangshouwei:'列王守卫', - stone_longwangpeiou:'龙王配偶', - - stone_baoweizhe:'保卫者', - stone_guiqishi:'龟骑士', - stone_shenmiqishou:'神秘骑手', - stone_shixiangweishi:'石像卫士', - stone_xuefanzhanshi:'血帆战士', - stone_xunmashi:'训马师', - - paladin_baowei:'保卫', - paladin_baowei_info:'你出场时,己方主将可令一名其他随从获得1点护甲。', - paladin_tuxi:'吐息', - paladin_tuxi_info:'你出场时,己方主将进行一次判定,若为红色,则回复1点体力。', - paladin_miying:'秘影', - paladin_miying_info:'你出场时,依次将牌堆中的所有不重名的判定牌置入敌方主将的判定区。', - paladin_huashi:'化石', - paladin_huashi_info:'你出场时,己方主将可将一名其他随从的体力值及体力上限变为2。', - paladin_jinghua:'净化', - paladin_jinghua_info:'你出场时,对所有手牌数大于1的随从造成2点伤害。', - paladin_moma:'秣马', - paladin_moma2:'秣马', - paladin_moma_info:'所有友方新兵摸牌阶段摸牌数+1。', - - paladin_zhaohuan:'召唤', - paladin_zhaohuan2:'召唤', - paladin_zhaohuan_info:'你出场后,你的主将在使用下一张随从牌时获得两点行动值。', - paladin_shouwei:'守卫', - paladin_shouwei_info:'你出场时,你的主将回复2点体力值。', - paladin_chidun:'持盾', - paladin_chidun_info:'你出场时,己方主将可以弃置对方一名随从的所有牌。', - paladin_buji:'补给', - paladin_buji_info:'你出场时,所有友方新兵增加1点体力和体力上限并摸两张牌。', - paladin_hudun:'护盾', - paladin_hudun_info:'你出场时,获得1点护甲值。', - paladin_zhaochao:'招潮', - paladin_zhaochao_info:'每当你的主将使用一次英雄技能,便摸两张牌。', - - stone_shifazhe:'嗜法者', - stone_wushixuetu:'巫师学徒', - stone_shuiyuansu:'水元素', - stone_falifulong:'法力浮龙', - stone_yingxiongzhihun:'英雄之魂', - stone_huoyao:'火妖', - - stone_aoshushi:'奥术师', - stone_faqishi:'法骑士', - stone_fuhuokaijia:'复活铠甲', - stone_kaodalalong:'考达拉龙', - stone_yanshushi:'炎术士', - stone_xulingwushi:'虚灵巫师', - - mage_aoshu:'奥术', - mage_aoshu_info:'你出场时,将一张奥术智慧置入主将的手牌。', - mage_jili:'激励', - mage_jili_info:'每当主将使用一次职业技能,摸一张牌。', - mage_gushou:'固守', - mage_gushou_info:'每当己方主将受到多于1伤害时,防止其余伤害。', - mage_yufa:'驭法', - mage_yufa_info:'每当己方主将使用一次职业技能,令其获得1点行动值。', - mage_yanshu:'炎术', - mage_yanshu_info:'你出场时,造成X点火焰伤害,随机分配到敌方随从上,X为己方主将装备区内装备牌的数量。', - mage_pingxu:'冯虚', - mage_pingxu_info:'你出场时,己方主将从三张随机法术牌中选择一张加入手牌。', - - mage_shifa:'嗜法', - mage_shifa_info:'你出场时,将一张随机法术牌置入双方主将的手牌。', - mage_minghuo:'冥火', - mage_minghuo_info:'你的主将的职业技能造成的伤害+1。', - mage_tunfa:'吞法', - mage_tunfa_info:'每当己方主将使用一张法术牌,摸一张牌。', - mage_lieyan:'烈焰', - mage_lieyan_info:'每当己方主将使用一张法术牌,对一名随机敌方角色造成1点火焰伤害。', - mage_zhufa:'助法', - mage_zhufa_info:'每当己方主将使用一张法术牌,令其获得1点行动值。', - mage_bingdong:'冰冻', - mage_bingdong_info:'每当你对一个随从造成伤害,该随从将武将牌翻至背面。', - - stone_caoyuanshi:'草原狮', - stone_leiouke:'雷欧克', - stone_misha:'米莎', - stone_huofu:'霍弗', - stone_jiewangzhu:'结网蛛', - stone_xunshoushi:'驯兽师', - - stone_senlinlang:'森林狼', - stone_tujiu:'秃鹫', - stone_muyangren:'牧羊人', - stone_jujishou:'狙击手', - stone_damoshatuo:'大漠沙驼', - stone_huangjialeixiang:'皇家雷象', - - hunter_jiewang:'结网', - hunter_jiewang_info:'你死亡时,己方主将获得一张随机野兽牌。', - hunter_xunshou:'驯兽', - hunter_xunshou_info:'你出场时,己方主将可选择一名其他友方随从令其增加1点体力和体力上限,摸两张牌并获得嘲讽。', - hunter_nuhou:'怒吼', - hunter_nuhou_info:'当你死亡时,对所有敌方角色造成1点伤害。', - hunter_zhanhuo:'战火', - hunter_zhanhuo2:'战火', - hunter_zhanhuo_info:'其他友方随从摸牌阶段的摸牌数+1。', - - hunter_qunxi:'群袭', - hunter_qunxi_info:'你出场时,所有友方随从摸一张牌。', - hunter_mishi:'觅食', - hunter_mishi_info:'每当己方主将召唤一个随从,摸一张牌。', - hunter_dusha:'渡沙', - hunter_dusha_info:'你出场时,令双方主将各随机使用一张牌库中的1费随从牌(不计入行动值消耗)。', - hunter_chuanlin:'穿林', - hunter_chuanlin_info:'你出场时,己方主将展示牌库中的一张随机随从牌并获得之。', - hunter_muyang:'牧羊', - hunter_muyang_info:'你出场时,随机召唤一个行动值消耗为X的随从,X为其他友方随从数。', - hunter_juji:'狙击', - hunter_juji_info:'你的职业技能可以指定随从为目标。', - - stone_baoqishi:'豹骑士', - stone_conglinshouwei:'从林守卫', - stone_baohuzhishu:'保护之树', - stone_kuangyedoushi:'狂野斗士', - stone_liebao:'猎豹', - stone_zongxiong:'棕熊', - - stone_renyaqishi:'刃牙骑士', - stone_conglinxiaoshou:'丛林枭兽', - stone_huangyeqishi:'荒野骑士', - stone_xunmenglong:'迅猛龙', - stone_lindishuyao:'林地树妖', - stone_huoshanxiemu:'火山邪木', - - druid_renya:'刃牙', - druid_renya_info:'你出场时,己方主将可以选择一项:令你摸一张牌并将武将牌翻至正面,或令你增加1点体力上限并获得技能潜行。', - druid_yuehuo:'月火', - druid_yuehuo_info:'所有锦囊牌造成的伤害+1。', - druid_qicheng:'骑乘', - druid_qicheng_info:'你死亡时,随机召唤一个行动消耗为1的随从。', - druid_chicheng:'驰骋', - druid_chicheng_info:'你出场时,己方主将获得X点行动值,X为其他友方随从数。', - druid_yeyou:'夜游', - druid_yeyou_info:'双方主将各从牌库中获得一张牌。', - druid_juhuo:'举火', - druid_juhuo_info:'己方主将回合内,每有一名随从死亡,令己方主将获得1点行动值。', - - stone_chongfeng:'冲锋', - stone_chongfeng_info:'你出场时,立即将武将牌翻至正面。', - druid_nuhuo:'怒火', - druid_nuhuo_info:'每当己方主将使用一次职业技能,便对一名随机敌人造成1点伤害。', - druid_chengzhang:'成长', - druid_chengzhang2:'成长', - druid_chengzhang_info:'你出场时,己方主将获得1点行动值;你死亡时,己方主将需弃置一张手牌。', - druid_huwei:'护卫', - druid_huwei_info:'你出场时,己方主将可以选择一项:对一名随从造成1点伤害,或弃置一名随从的所有牌并将其体力上限改为2。', - - stone_fachao:'法潮图腾', - stone_tutengyongshi:'图腾勇士', - stone_huoshe:'火舌图腾', - stone_huoyuansu:'火元素', - stone_tuyuansu:'土元素', - stone_wujiyuansu:'无羁元素', - stone_xuejuren:'穴居人', - stone_huoli:'活力图腾', - stone_tutengshi:'图腾师', - stone_shachuisaman:'砂槌萨满', - stone_huoyanweishi:'火焰卫士', - stone_wanshiyuansu:'顽石元素', - stone_shalinxingzhe:'砂鳞行者', - - shaman_anhun:'暗魂', - shaman_anhun_info:'每当一名友方随从死亡,令主将从牌库中获得一张牌。', - shaman_zoushi:'走石', - shaman_zoushi_info:'每当己方主将使用一张随从牌,对一名随机敌方角色造成1点伤害。', - shaman_zhuhuo:'逐火', - shaman_zhuhuo_info:'你出场时,摸1~3张牌。', - shaman_peiyu:'培育', - shaman_peiyu_info:'你出场时,增加X点体力和体力上限,X为友方图腾数。', - shaman_huoli:'活力', - shaman_huoli_info:'己方主将出牌阶段开始时,你令其获得1点行动值。', - shaman_xueju:'穴居', - shaman_xueju_info:'每当己主将使用一张随从牌,摸一张牌。', - shaman_huoxi:'火袭', - shaman_huoxi_info:'你出场时,己方主将可以对对方一名随从造成2点火焰伤害。', - shaman_fachao:'法潮', - shaman_fachao_info:'己方主将在其每个回合结束阶从牌库中获得一张牌并回复1点体力。', - shaman_huoshe:'火舌', - shaman_huoshe_info:'其他友方随从造成的伤害始终+1。', - - shaman_jili:'激励', - shaman_jili_info:'己方主将的结束阶段,所有友方图腾摸一张牌。', - shaman_tuteng:'图腾', - shaman_tuteng_info:'你跳过摸牌阶段。', - shaman_fali:'空气', - shaman_fali_info:'已方主将使用的法术牌伤害+1。', - shaman_zhiliao:'治疗', - shaman_zhiliao_info:'在你的结束阶段,令所有友方随从回复1点体力。', - shaman_zhuore:'灼热', - shaman_zhuore_info:'已方主将的结束阶段,对一名随机敌方随从造成1点伤害。', - - _shaman_skill:'图腾', - _shaman_skill_info:'召唤一个随机图腾。', - _mage_skill:'火冲', - _mage_skill_info:'对一名随从造成1点火焰伤害。', - _priest_skill:'治疗', - _priest_skill_info:'回复1点体力。', - _priest_skillx:'心刺', - _priest_skillx_info:'造成1点伤害。', - _warrior_skill:'战甲', - _warrior_skill_info:'获得1点护甲(不能超过3点)。', - _warlock_skill:'分流', - _warlock_skill_info:'从牌库中获得两张牌。', - _warlock_skillx:'炼狱', - _warlock_skillx_info:'召唤一个地狱火。', - _rogue_skill:'出鞘', - _rogue_skill_info:'装备一把武器和一个随机非武器装备。', - _paladin_skill:'动员', - _paladin_skill_info:'召唤一名士兵。', - _hunter_skill:'射击', - _hunter_skill_info:'对敌方主将造成1点伤害。', - _druid_skill:'猛击', - _druid_skill_info:'视为使用一张不计入出杀次数的杀。', - - stone_tuteng1:'石爪图腾', - stone_tuteng2:'灼热图腾', - stone_tuteng3:'空气图腾', - stone_tuteng4:'治疗图腾', - - stone_xinbing:'新兵', - - stone_zhongshi:'中士', - stone_zhongshi1:'叫嚣', - stone_zhongshi1_info:'你出场时,己方主将可以弃置对方一名随从的所有牌。', - stone_zhucangzhe:'伫藏者', - stone_zhucangzhe1:'伫藏', - stone_zhucangzhe1_info:'你出场时,己方主将可以令己方一名其他角色摸一张牌。', - stone_huoqiangshou:'火枪手', - stone_huoqiangshou1:'火枪', - stone_huoqiangshou1_info:'你出场时,己方主将可以对对方一名随从造成1点伤害。', - - stone_lansaizhanshi:'蓝腮战士', - stone_kutongsiseng:'苦痛侍僧', - stone_kutongsiseng1:'苦痛', - stone_kutongsiseng2:'苦痛', - stone_kutongsiseng1_info:'你出场时,己方主将于本结束阶段摸一张牌。', - stone_yuanguanying:'远古暗影', - stone_yuanguanying1:'暗影', - stone_yuanguanying1_info:'你出场时,己方主将可视为对一名敌方角色使用一张杀。', - - stone_dijieshicong:'低阶侍从', - stone_dijieshicong1:'持枪', - stone_dijieshicong1_info:'你出场时,敌方主将随机弃置一张装备牌。', - stone_yaosaishouwei:'要塞守卫', - stone_yaosaishouwei1:'守卫', - stone_yaosaishouwei1_info:'你出场时,己方主将本回合手牌上限+2。', - stone_famingjia:'发明家', - stone_famingjia1:'发明', - stone_famingjia1_info:'你出场时,己方主将摸两张牌。', - - stone_chilundashi:'齿轮大师', - stone_chilundashi1:'齿轮', - stone_chilundashi2:'齿轮', - stone_chilundashi1_info:'你出场后的第一个摸牌阶段摸牌数+1。', - stone_hanguangzhizhe:'寒光智者', - stone_hanguangzhizhe1:'寒光', - stone_hanguangzhizhe1_info:'你出场时,所有其他随从各摸一张牌。', - stone_aihaozhihun:'哀嚎之魂', - stone_aihaozhihun1:'哀嚎', - stone_aihaozhihun1_info:'你出场时,敌方随从弃置所有牌。', - - stone_fennuxiaoji:'愤怒小鸡', - stone_fennuxiaoji1:'暴怒', - stone_fennuxiaoji1_info:'准备阶段,若你没有手牌,你摸两张牌。', - stone_juxingchanchu:'巨型蟾蜍', - stone_juxingchanchu1:'毒液', - stone_juxingchanchu1_info:'你死亡时,己方主将可令一名敌方随从失去1点体力。', - stone_shishigui:'食尸鬼', - stone_shishigui1:'食尸', - stone_shishigui1_info:'你死亡后,场上所有其他随从失去1点体力。', - stone_wuyi:'巫医', - stone_langren:'狼人', - stone_qianxing:'潜行', - stone_qianxing_info:'你出场时,获得潜行直到下一回合开始。', - - stone_mingguangjisi:'明光祭司', - stone_nianqingjisi:'年轻祭司', - stone_zhufu:'祝福', - stone_zhufu_info:'己方主将的结束阶段,你令一名随机的受伤友方随从回复1点体力。', - stone_aomishouwei:'奥秘守卫', - stone_yanjingshe:'眼镜蛇', - stone_yanjingshe1:'毒噬', - stone_yanjingshe1_info:'你出场时,若敌方随从数不少于己方,则随机杀死一名随从。', - stone_zhiyuzhe:'治愈者', - stone_zhiyu:'治愈', - stone_zhiyu_info:'你出场时,令所有友方随从回复1点体力。', - stone_mafengzhuru:'麻风侏儒', - stone_mafengzhuru1:'麻风', - stone_mafengzhuru1_info:'杀死你的随从失去1点体力。', - stone_fatiaozhuru:'发条侏儒', - stone_fatiaozhuru1:'发条', - stone_fatiaozhuru1_info:'结束阶段,若你没有手牌,你摸两张牌。', - - stonesha:'进攻', - stonesha_info:'锁定技,你的装备牌均视为杀。', - stoneshan:'格挡', - stoneshan_info:'锁定技,你的随从和法术牌均视为闪。', - - stonecharacter:'随从', - spell_shengerpingdeng:'生而平等', - spell_shengerpingdeng_info:'将所有随从体力上限降为1。', - spell_jingshenkongzhi:'精神控制', - spell_jingshenkongzhi_info:'将一名敌方随从吸收为己方。', - spell_anyingkuangluan:'暗影狂乱', - spell_anyingkuangluan_info:'将一名手牌数不超过1的敌方随从吸收为己方,并令其于下个回合结束后死亡。', - spell_anyingkuangluan_die:'暗影狂乱', - spell_anyingkuangluan_die_info:'下个回合结束后死亡。', - spell_binghuan:'冰环', - spell_binghuan_info:'将场上所有随从翻面。', - spell_morizaihuo:'末日灾祸', - spell_morizaihuo_info:'令场上所有随从立即死亡,回复2点体力。', - spell_zhiliaozhichu:'治疗之触', - spell_zhiliaozhichu_info:'令目标随从恢复所有体力值并获得嘲讽。', - lschaofeng:'嘲讽', - lschaofeng_info:'同阵营的无嘲讽角色不以能成为杀的目标。', - spell_wangzhezhufu:'王者祝福', - spell_wangzhezhufu_info:'令一名随从增加2点体力和体力上限并摸两张牌。', - spell_diyulieyan:'地狱烈焰', - spell_diyulieyan_info:'所有角色失去1点体力。', - spell_chenmo:'沉默', - spell_chenmo_info:'弃置一名随从的所有牌,并令其体力上限减至2。', - spell_zhiliaoshui:'治疗水', - spell_zhiliaoshui_info:'出牌阶段对自己使用,恢复2点体力值;或于濒死阶段对一名角色使用,令目标恢复1点体力。', - spell_yanmie:'极恶之咒', - spell_yanmie_info:'交换你与敌方主将的装备区,并摸若干张牌直到你的手牌数与敌方主将相等。', - spell_xiaoshi:'消失', - spell_xiaoshi_info:'令敌方主将将所有装备区内的牌收入手牌,并弃置其若干张手牌,直到其手牌数与你相等。', - - stonecard:'法术', - mode_stone_card_config:'炉石模式', - mode_stone_character_config:'炉石模式', + translate: { + shaman: "萨满", + mage: "法师", + priest: "牧师", + warrior: "战士", + warlock: "术士", + knight: "死亡骑士", + rogue: "潜行者", + paladin: "圣骑士", + hunter: "猎人", + druid: "德鲁伊", + + stone_siwangzhiyi: "死亡之翼", + stone_alaikesita: "阿莱克萨", + stone_yisela: "伊瑟拉", + stone_nuoziduomu: "诺兹多姆", + stone_maligousi: "玛里苟斯", + stone_aolajier: "奥拉基尔", + stone_andongni: "安东尼", + stone_jialakesi: "加拉克斯", + stone_jialakesix: "加拉克斯", + stone_kelushi: "克鲁什", + stone_geluomashi: "格罗玛什", + stone_aidewen: "艾德温", + stone_sainaliusi: "塞纳留斯", + stone_fuding: "弗丁", + stone_weilun: "维纶", + + stone_fushi: "缚誓", + stone_fushi_info: "你出场时,为所有友方角色回复所有体力值。", + stone_mieshi: "灭世", + stone_mieshi_info: "你出场时,对所有其他随从造成2点伤害,然后弃置己方主将的所有手牌。", + stone_shixu: "时序", + stone_shixu_info: "你出场的回合内,己方主将获得4点行动值。", + stone_chenshui: "沉睡", + stone_chenshui_info: "在你的结束阶段,令己方主将获得一张梦境牌。", + stone_mowang: "魔网", + stone_mowang_info: "己方法术对主将伤害+2,对随从伤害+4。", + + stone_zhiyin: "指引", + stone_zhiyin_info: "每当己方主将使用一张法术牌,将一张火球术置于其手牌。", + stone_bianshen: "变身", + stone_bianshen_info: + "你出场时,若己方主将职业为术士,则代之成为新的主将;若己变身,则改为令你召唤的地狱火的初始手牌数和体力值+1。", + stone_lianyu: "炼狱", + stone_lianyu_info: "你的职业技能改为召唤一个地狱火。", + stone_lianji: "连击", + stone_lianji_info: "每当己方主将召唤一个随从,便增加1点体力和体力上限并摸一张牌。", + stone_shenyu: "神谕", + stone_shenyu_info: + "你出场时,己方主将可以选择一项:召唤两个嘲讽树人,或令所有其他随从增加1点体力和体力上限并摸两张牌。", + stone_fuchou: "复仇", + stone_fuchou_info: "你死亡后,视为己方主将使用了一张复仇之怒。", + stone_shenyou: "神佑", + stone_shenyou_info: "己方主将的职业技能和法术的治疗效果翻倍。", + stone_jinu: "激怒", + stone_jinu_info: "摸牌阶段,若你己受伤,则额外摸两张牌。", + + spell_shenshengxinxing: "神圣新星", + spell_shenshengxinxing_info: "对所有敌方角色造成1点伤害,令所有友方角色回复1点体力。", + spell_shengguangzhadan: "圣光炸弹", + spell_shengguangzhadan_info: "对所有随从造成等同于其手牌数的伤害。", + spell_maizang: "埋葬", + spell_maizang_info: + "令一名敌方随从死亡(不触发死亡技能),并将一张与该随从同名的随从洗入你的牌库。", + spell_xinlingshijie: "心灵视界", + spell_xinlingshijie_info: "将一张敌方主将手牌的复制置于你的手牌。", + spell_naluzhiguang: "纳鲁之光", + spell_naluzhiguang_info: "恢复1点体力值,若目标仍处于受伤状态,则召唤一名圣光护卫。", + spell_zhiliaozhihuan: "治疗之环", + spell_zhiliaozhihuan_info: "令所有随从回复3点体力。", + + spell_zhenyanshu: "真言术", + spell_zhenyanshu_info: "令一名随从增加1点体力和体力上限;从牌库中获得一张牌。", + spell_enzeshu: "恩泽术", + spell_enzeshu_info: "令一名随从增加3点体力和体力上限。", + spell_anyingxingtai: "暗影形态", + priest_anyingxingtai: "暗影形态", + spell_anyingxingtai_info: "你的职业技能改为造成1点伤害,若已进入暗影形态,则改为造成2点伤害。", + spell_kuaisuzhiliao: "快速治疗", + spell_kuaisuzhiliao_info: "回复2点体力。", + spell_xinlinghanbao: "心灵撼爆", + spell_xinlinghanbao_info: "对敌方主将造成2点伤害。", + spell_kongxinshu: "控心术", + spell_kongxinshu_info: "复制敌方牌库中的一张随从,将其置入战场。", + + stone_shengguanghuwei: "圣光护卫", + priest_shengguang: "圣光", + priest_shengguang_info: "每当一名随从获得治疗,摸一张牌。", + + spell_nuxi: "怒袭", + spell_nuxi_info: "造成1点伤害,获得2点护甲。", + spell_dunpaimengji: "盾牌猛击", + spell_dunpaimengji_info: "对一名随从造成等同于你护甲值的伤害。", + spell_zhansha: "斩杀", + spell_zhansha_info: "令一名已受伤的敌方随从死亡。", + spell_nuhuozhongshao: "怒火中烧", + spell_nuhuozhongshao_info: "对一名随从造成1点伤害,然后令其摸两张牌。", + spell_xuanfengzhan: "旋风斩", + spell_xuanfengzhan_info: "对所有随从造成1点伤害。", + spell_juemingluandou: "绝命乱斗", + spell_juemingluandou_info: "随机保留一名随从,然后令所有其他随从死亡。", + + spell_zhongnian: "重碾", + spell_zhongnian_info: "造成X点伤害,X为已受伤的友方角色数且不超过3。", + spell_zhandounuhuo: "战斗怒火", + spell_zhandounuhuo_info: "从牌库中获得X张牌,X为已受伤的友方角色数。", + spell_chongfeng: "冲锋", + spell_chongfeng_info: "令一名武将牌背面朝上的友方随从摸三张牌,然后将武将牌翻至正面。", + spell_fuchoudaji: "复仇打击", + spell_fuchoudaji_info: "对所有随从造成1点伤害,若你的体力值不大于2,改为造成3点伤害。", + spell_kuangbao: "狂暴", + spell_kuangbao_info: "令一名已受伤的友方随从摸四张牌。", + spell_yingyongdaji: "英勇打击", + spell_yingyongdaji_info: "令一名敌方角色对你造成2点伤害,然后对其造成2点伤害。", + + spell_dubiao: "毒镖", + spell_dubiao_info: "对一名随机敌方角色造成1点伤害。", + spell_qiangfengsheji: "强风射击", + spell_qiangfengsheji_info: "对两名敌方随从各造成1点伤害,并弃置其两张手牌。", + spell_tanxianmao: "探险帽", + hunter_tanxianmao: "探险帽", + hunter_tanxianmao_info: "你死亡时,将一张探险帽置入主将的手牌。", + spell_tanxianmao_info: + "令一名友方随从增加1点体力和体力上限并摸一张牌,当该随从死亡时,将一张探险帽置入你的手牌。", + spell_shalumingling: "杀戮命令", + spell_shalumingling_info: "造成1点伤害,如果你控制任何野兽,则改为造成2点伤害。", + spell_zhuizongshu: "追踪术", + spell_zhuizongshu_info: "从牌库中随机选择三张牌,获得其中的一张。", + spell_tianjiangzhuqun: "天降蛛群", + spell_tianjiangzhuqun_info: "召唤三只结网蛛。", + + spell_lierenyinji: "猎人印记", + spell_lierenyinji_info: "将一名随从的体力上限降至1。", + spell_kuaisusheji: "快速射击", + spell_kuaisusheji_info: "造成1点伤害,摸一张牌。", + spell_guanmenfanggou: "关门放狗", + spell_guanmenfanggou_info: "每有一名敌方随从,便召唤一只猎狗。", + spell_zhaohuanchongwu: "动物伙伴", + spell_zhaohuanchongwu_info: "随机召唤一只野兽。", + spell_zidanshangtang: "子弹上膛", + spell_zidanshangtang_info: "随机获得一张猎人职业法术牌,并获得技能〖上膛〗直到回合结束。", + spell_duochongsheji: "多重射击", + spell_duochongsheji_info: "对两名随机敌方随从各造成2点伤害。", + + stone_liegou: "猎狗", + hunter_zidanshangtang: "上膛", + hunter_zidanshangtang_bg: "膛", + hunter_zidanshangtang_info: "每当你使用一张法术牌,便随机获得一张猎人职业法术牌。", + + spell_zuzhou: "诅咒", + spell_zuzhou_info: "将目标随从翻面,摸一张牌。", + spell_xishengqiyue: "牺牲契约", + spell_xishengqiyue_info: "令双方各一名随从立即死亡。", + spell_xiaoguibaopo: "小鬼爆破", + spell_xiaoguibaopo_info: "对一名随从造成1~3点伤害,每造成1点伤害,便召唤一只小鬼。", + spell_anyinglieyan: "暗影裂焰", + spell_anyinglieyan_info: "杀死一名友方随从,并对所有敌方随从造成等于其体力值的伤害。", + spell_liliangdaijia: "力量代价", + spell_liliangdaijia_info: "令一名友方随从摸四张牌,将体力值变为5,并在其下个回合结束后死亡。", + spell_emozhinu: "恶魔之怒", + spell_emozhinu_info: "对所有随从造成2点伤害。", + + spell_emozhixin: "恶魔之心", + spell_emozhixin_info: "对一名敌方随从造成4点伤害,或令一名友方随从摸四张牌。", + spell_ansezhadan: "暗色炸弹", + spell_ansezhadan_info: "造成2点伤害。", + spell_fushishu: "腐蚀术", + warlock_fushishu: "腐蚀", + warlock_fushishu_info: "下个回合结束后死亡。", + spell_fushishu_info: "令一名敌方随从于其下个回合结束后死亡。", + spell_heianqiyue: "黑暗契约", + spell_heianqiyue_info: "随机令两名敌方随从死亡,随机弃置两张手牌。", + spell_linghunhongxi: "灵魂虹吸", + spell_linghunhongxi_info: "令一名随从死亡,回复1点体力。", + spell_siwangchanrao: "死亡缠绕", + spell_siwangchanrao_info: "对一名随从造成1点伤害;若该随从死亡,从牌库中获得一张牌。", + + spell_wuyashenxiang: "乌鸦神像", + spell_wuyashenxiang_info: "从三张法术牌或随从牌中选择一张加入手牌。", + spell_huotigenxu: "活体根须", + spell_huotigenxu_info: "造成1点伤害,或召唤两个树苗。", + spell_hengsao: "横扫", + spell_hengsao_info: "对一名敌方角色造成2点伤害,然后对其他敌方角色造成1点伤害。", + spell_yexingchengzhang: "野性成长", + spell_yexingchengzhang_info: "下个出牌阶段开始时获得三点额外行动值。", + spell_ziranzhili: "自然之力", + spell_ziranzhili_info: "召唤三个自爆树人。", + spell_yemanpaoxiao: "野蛮咆哮", + spell_yemanpaoxiao_bg: "咆", + spell_yemanpaoxiao2: "咆哮", + spell_yemanpaoxiao_info: "所有友方角色造成的伤害+1,直到你的下个回合开始。", + + spell_conglinzhihun: "丛林之魂", + druid_conglinzhihun: "树魂", + druid_conglinzhihun_info: "你死亡后召唤一个树人。", + spell_conglinzhihun_info: "令所有友方随从获得技能树魂(你死亡后召唤一个树人)。", + spell_ziyang: "滋养", + spell_ziyang_info: "下个出牌开始阶段获得4点额外行动值,或从牌库中获得三张牌。", + spell_fugen: "腐根", + spell_fugen_info: "令一名随从死亡,将一张随机随从置入对手的手牌。", + spell_xingchenzhuiluo: "星辰坠落", + spell_xingchenzhuiluo_info: "对一名敌方随从造成5点伤害,或对所有敌方随从造成2点伤害。", + spell_fennu: "愤怒", + spell_fennu_info: "对一名随从造成2点伤害,或造成1点伤害并从牌库中获得一张牌。", + spell_heiandiyu: "黑暗低语", + spell_heiandiyu_info: + "召唤若干个小精灵直到你的随从数达到4;或令一名随从增加1点体力和体力上限并摸三张牌。", + + druid_yexingchengzhang: "成长", + druid_yexingchengzhang_bg: "长", + druid_yexingchengzhang_info: "下个出牌阶段开始时获得三点额外行动值。", + druid_ziyang: "滋养", + druid_ziyang_bg: "养", + druid_ziyang_info: "下个出牌阶段开始时获得四点额外行动值。", + + stone_shumiao: "树苗", + stone_shuren: "自爆树人", + stone_shurenx: "树人", + stone_shurenxx: "嘲讽树人", + stone_zibao: "自爆", + stone_zibao_info: "结合结束后立即死亡。", + + spell_cigu: "刺骨", + spell_cigu_info: "造成1点伤害,你可以弃置一张装备区内的牌令伤害+1。", + spell_jianrenluanwu: "剑刃乱舞", + spell_jianrenluanwu_info: "弃置你的武器牌,并对所有敌方角色造成1点伤害。", + spell_daoshan: "刀扇", + spell_daoshan_info: "对所有敌方随从造成1点伤害,从牌库中获得一张牌。", + spell_sijidaifa: "伺机待发", + spell_sijidaifa_info: "你使用下一张法术牌时获得X点行动值,X为该法术的行动值消耗且不超过3。", + spell_cisha: "刺杀", + spell_cisha_info: "杀死一名随从。", + spell_modaoyou: "磨刀油", + spell_modaoyou_info: "令你下一次剑刃乱舞造成的伤害+1,并与一名随机友方随从各摸两张牌。", + + spell_mengun: "闷棍", + spell_mengun_info: "令一名敌方随从死亡(不触发死亡技能),将一张该随从的复制置入对手的手牌。", + spell_anzhongpohuai: "暗中破坏", + spell_anzhongpohuai_info: "随机杀死一名敌方随从,随机弃置敌方的一张装备牌。", + spell_beici: "背刺", + spell_beici_info: "令一名未受伤的随从失去1点体力。", + spell_weijisifu: "危机四伏", + spell_zhumo: "蛛魔", + stone_zhumo: "蛛魔", + spell_zhumo_info: "每当该牌被弃置,为你的对手召唤一只蛛魔。", + spell_weijisifu_info: + "将三张蛛魔牌洗入对手的牌库;每当一名角色弃置蛛魔牌,为其对手召唤一只蛛魔。", + spell_piaoqie: "剽窃", + spell_piaoqie_info: "复制两张对手牌库中的牌加入你的手牌。", + spell_jipao: "疾跑", + spell_jipao_info: "从牌库中获得四张牌。", + + spell_fengxian: "奉献", + spell_fengxian_info: "对所有敌方角色造成1点伤害。", + spell_fuchouzhinu: "复仇之怒", + spell_fuchouzhinu_info: "造成5点伤害,随机分配到所有敌方随从上。", + spell_shengliaoshu: "圣疗术", + spell_shengliaoshu_info: "恢复2点体力,摸两张牌。", + spell_fennuzhichui: "愤怒之锤", + spell_fennuzhichui_info: "造成1点伤害,从牌库中获得一张牌。", + spell_zuozhandongyuan: "作战动员", + spell_zuozhandongyuan_info: "召唤两个新兵,随机装备一把武器。", + spell_liliangzhufu: "力量祝福", + spell_liliangzhufu_info: "令一名随从摸两张牌。", + + spell_jinyingduijue: "精英对决", + spell_jinyingduijue_info: "双方各保留体力值最高的一名随从,然后令其他随从死亡。", + spell_shenpan: "审判", + spell_shenpan_info: "若你的对手随从数不少于你,则随机令一名敌方随从死亡。", + spell_shenshengfennu: "神圣愤怒", + spell_shenshengfennu_info: "从牌库中获得一张牌,并造成等同于其行动值消耗的伤害。", + spell_yongshizhufu: "勇士祝福", + spell_yongshizhufu_info: "令一名随从的手牌数翻倍。", + spell_zhengqianghaosheng: "争强好胜", + paladin_zhengqianghaosheng: "争强好胜", + paladin_zhengqianghaosheng_info: + "在你的下一准备阶段,令所有友方随从增加1点体力和体力上限并摸一张牌。", + spell_zhengqianghaosheng_info: + "在你的下一准备阶段,令所有友方随从增加1点体力和体力上限并摸一张牌。", + spell_zhihuizhufu: "智慧祝福", + paladin_zhihuizhufu: "智慧祝福", + spell_zhihuizhufu_info: "选择一名随从,在其每个准备阶段,你从牌库中获得一张牌。", + + spell_fengnu: "风怒", + shaman_fengnu: "风怒", + shaman_fengnu_info: "回合结束后,你获得一个额外回合。", + spell_fengnu_info: "令一名随从获得技能风怒(回合结束后,你获得一个额外回合)。", + spell_rongyanbaolie: "熔岩爆裂", + spell_rongyanbaolie_info: "造成3点火焰伤害,失去1点体力。", + spell_shihuawuqi: "石化武器", + shaman_shihuawuqi: "充能", + shaman_shihuawuqi_info: "准备阶段,你摸三张牌。", + spell_shihuawuqi_info: + "令一名友方随从获得技能充能(准备阶段,你摸三张牌),直到你的下一回合开始。", + spell_xianzuzhaohuan: "先祖召唤", + spell_xianzuzhaohuan_info: "双方各将手牌中的一张随机随从牌置入战场。", + spell_xianzuzhihun: "先祖之魂", + shaman_xianzuzhihun: "转生", + shaman_xianzuzhihun_info: "你死亡后,召唤一个自身的复制。", + spell_xianzuzhihun_info: "令一名随从获得技能转生(你死亡后,召唤一个自身的复制)。", + spell_xianzuzhishi: "先祖知识", + shaman_xianzuzhishi: "先祖知识", + shaman_xianzuzhishi_info: "本回合手牌上限-1。", + spell_xianzuzhishi_info: "从牌库中获得两张牌,本回合手牌上限-1(多次使用不叠加)。", + + spell_lianhuanbaolie: "连环爆裂", + spell_lianhuanbaolie_info: "造成1~2点雷电伤害。", + spell_shandianfengbao: "闪电风暴", + spell_shandianfengbao_info: "对所有敌方随从造成1~2点伤害。", + spell_yaoshu: "妖术", + spell_yaoshu_info: "将一个随从变成一只青蛙。", + spell_yexinglanghun: "野性狼魂", + spell_yexinglanghun_info: "召唤两个幽灵狼。", + spell_shixue: "嗜血", + spell_shixue_info: "所有友方随从摸两张牌。", + spell_chazhuangshandian: "叉状闪电", + spell_chazhuangshandian_info: "对两个随机敌方随从各造成1点雷电伤害。", + + stone_qingwa: "青蛙", + stone_youlinglang: "幽灵狼", + stone_jingxiang: "镜像", + stone_jingxiang_info: "锁定技,你跳过摸牌阶段。", + shaman_qingwa: "青蛙", + shaman_qingwa_info: "锁定技,你跳过摸牌阶段。", + stone_xiaojingling: "小精灵", + + spell_laojiuhuoba: "老旧火把", + spell_laojiuhuoba_info: "造成1点伤害,将一张炽热火把置入你的牌库。", + spell_chirehuoba: "炽热火把", + spell_chirehuoba_info: "造成2点火焰伤害。", + spell_canying: "残影", + spell_canying_info: "复制你的所有随从,并将其置入你的手牌。", + spell_yanbaoshu: "炎爆术", + spell_yanbaoshu_info: "造成4点火焰伤害(若目标为主将,伤害不能超过目标的当前体力值)。", + spell_jingxiang: "镜像", + spell_jingxiang_info: "召唤两个具有嘲讽且摸牌阶段不摸牌的随从。", + spell_aoshufeidan: "奥术飞弹", + spell_aoshufeidan_info: "造成3点伤害,随从分配到所有敌方随从上。", + spell_hanbingpingzhang: "寒冰屏障", + mage_hanbingpingzhang: "寒冰屏障", + mage_hanbingpingzhang_info: "体力值不能降到2以内。", + spell_hanbingpingzhang_info: "令一名角色的体力值不能降到2以内,直到你的下一回合开始。", + + spell_hanbingjian: "寒冰箭", + spell_hanbingjian_info: "对一个随从造成2点伤害,然后将其翻面。", + spell_lieyanfengbao: "烈焰风暴", + spell_lieyanfengbao_info: "对所有敌方随从造成2点伤害。", + spell_baofengxue: "暴风雪", + spell_baofengxue_info: "对所有敌方随从造成1点伤害,然后将其翻面。", + spell_aoshuzhihui: "奥术智慧", + spell_aoshuzhihui_info: "从牌库中获得两张牌。", + spell_bianxingshu: "变形术", + spell_bianxingshu_info: "将一个随从变成一只绵羊。", + spell_huoqiushu: "火球术", + spell_huoqiushu_info: "造成3点火焰伤害(若目标为主将,伤害不能超过目标的当前体力值)。", + + stone_mianyang: "绵羊", + mage_mianyang: "绵羊", + mage_mianyang_info: "锁定技,你不能使用杀。", + + stone_beijunmushi: "北郡牧师", + stone_guangyaozhizi: "光耀之子", + stone_longmianjiaoguan: "龙眠教官", + stone_linghunjisi: "灵魂祭司", + stone_guanliyuan: "管理员", + stone_heianjiaotu: "黑暗教徒", + + stone_shengdianzhishi: "圣殿执事", + stone_suoxiaojishi: "缩小技师", + stone_anyingzisi: "暗影子嗣", + stone_guangmingquan: "光明泉", + stone_muguangchulong: "暮光雏龙", + stone_shenshengyongshi: "神圣勇士", + + priest_puzhao: "普照", + priest_puzhao_info: "你出场时,己方主将可令一名其他友方随从增加2点体力和体力上限。", + priest_suoxiao: "缩小", + priest_suoxiao_info: "你出场时,己方主将可令一名其他随从减少2点体力上限(不能小于1)。", + priest_shengshui: "圣水", + priest_shengshui_info: "你跳过摸牌阶段;在你的准备阶段,令一名随机友方角色回复2点体力。", + priest_muguang: "暮光", + priest_muguang_info: "你出场时,若主将手牌中有随从牌,则增加1点体力和体力上限。", + priest_shixin: "蚀心", + priest_shixin_info: "每当己方主将使用一次职业技能,对双方主将各造成1点伤害。", + + priest_shengliao: "圣疗", + priest_shengliao_info: "每当一名随从回复体力,己方主将从牌库中获得一张牌。", + priest_guangyao: "光耀", + priest_guangyao_info: "每当你的体力值发生改变,摸一张牌。", + priest_xundao: "训导", + priest_xundao_info: "你出场时,若己方主将手牌中有随从牌,则摸一张牌并获得嘲讽。", + priest_hunwu: "魂舞", + priest_hunwu_info: "己方主将的职业技能及法术的治疗效果改为令目标失去等量体力。", + priest_faxian: "发现", + priest_faxian_info: "你出场时,己方主将从三张随机随从牌中选择一张加入手牌。", + priest_zhufu: "献身", + priest_zhufu_info: "你死亡时,令一名随机友方随从增加1点体力和体力上限。", + + stone_daomufeizei: "盗墓匪贼", + stone_haidao: "海盗", + stone_haidaotoumu: "海盗头目", + stone_cike: "刺客", + stone_tegong: "特工", + stone_qiezei: "窃贼", + stone_heitieairen: "黑铁矮人", + + stone_duyanhaidao: "独眼海盗", + stone_gangtiewushi: "刚铁武师", + stone_lifaji: "理发机", + stone_shihualong: "石化龙", + stone_xiushuihaidao: "锈水海盗", + stone_zousishangfan: "走私商贩", + + rogue_duxing: "独行", + rogue_duxing_info: "每当敌方主将召唤一名随从,便获得潜行。", + rogue_shoudao: "授道", + rogue_shoudao_info: "在己方主将的结束阶段,令一名随机友方随从增加1点体力和体力上限并摸一张牌。", + rogue_lifa: "理发", + rogue_lifa_info: "为己方主将装备一把武器,若已有武器,改为对敌方主将造成1点伤害。", + rogue_fusheng: "复生", + rogue_fusheng_info: "你出场时,体力值和体力上限变为X,X为场上体力最高的随从的体力值。", + rogue_jielue: "劫掠", + rogue_jielue_info: "每当己方主将装备一把武器牌,摸两张牌。", + rogue_jiaoyi: "交易", + rogue_jiaoyi_info: "你出场时,己方主将可以弃置一张装备牌令你摸三张牌。", + + rogue_touqie: "偷窃", + rogue_touqie_info: "每当你造成一次伤害,己方主将从牌库中获得一张牌。", + rogue_xunbao: "寻宝", + rogue_xunbao_info: "你死亡时,将一张伺机行发置于己方主将的手牌。", + rogue_cisha: "刺杀", + rogue_cisha_info: "每当你对一名随从造成伤害,受伤害随从立即死亡。", + rogue_touxi: "偷袭", + rogue_touxi_info: "你出场时,己方主将可弃置一张装备区内的牌并对一名敌方角色造成1点伤害。", + rogue_qiancang: "潜藏", + rogue_qiancang_info: "你出场时,对所有未受伤害的敌方随从造成1点伤害。", + rogue_zhaomu: "结伙", + rogue_zhaomu_info: "你出场时,召唤一个海盗。", + + stone_zhihuiguan: "指挥官", + stone_jiangong: "监工", + stone_yuanhou: "猿猴", + stone_chidunshinv: "持盾侍女", + stone_zhujiashi: "铸甲师", + stone_kuangzhanshi: "狂战士", + + stone_heiyaoyaoshou: "黑曜妖兽", + stone_honglongyongshi: "红龙勇士", + stone_peilianshi: "陪练师", + stone_jingyingweishi: "精英卫士", + stone_shengjiachong: "圣甲虫", + stone_mengmaren: "猛犸人", + stone_zhifuzhe: "掷斧者", + + warrior_heiyao: "黑曜", + warrior_heiyao_info: "在己方主将的结束阶段,召唤一只圣甲虫。", + warrior_peilian: "陪练", + warrior_peilian_info: "你出场时,己方主将可令一名其他随从获得嘲讽。", + warrior_fenyong: "奋勇", + warrior_fenyong_info: "你出场时,若己方主将手牌中有随从牌,则获得冲锋。", + warrior_chuanci: "穿刺", + warrior_chuanci_info: "每当你对一名敌方随从造成伤害,对另一名随机敌方随从造成等量的伤害。", + warrior_zhifu: "掷斧", + warrior_zhifu_info: "每当你受到一次伤害,对敌方主将造成1点伤害。", + + warrior_tongling: "统领", + warrior_tongling_info: "每当你召唤一个初始手牌数不大于2的随从,令其获得冲锋。", + warrior_baoluan: "暴乱", + warrior_baoluan_info: "每当一名随从受到一次伤害,摸一张牌。", + warrior_jiangong: "监工", + warrior_jiangong_info: "你出场时,己方主将可对一名随从造成1点伤害,然后令该随从摸两张牌。", + warrior_zhujia: "铸甲", + warrior_zhujia_info: "每当你受到一次伤害,己方主将获得1点护甲。", + warrior_tidun: "提盾", + warrior_tidun_info: "你出场时,己方主将获得2点护甲。", + + stone_lieyanxiaogui: "烈焰小鬼", + stone_xiaoguishouling: "小鬼首领", + stone_kongjuzhanma: "恐惧战马", + stone_morishouwei: "末日守卫", + stone_xukongxingzhe: "虚空行者", + stone_diyuhuo: "地狱火", + stone_diyuhuox: "地狱火", + stone_xiaogui: "小鬼", + + stone_heishitanfan: "黑市摊贩", + stone_zhaohuanzhe: "召唤者", + stone_meimo: "魅魔", + stone_tongkunvwang: "痛苦女王", + stone_xukongkongmo: "虚空恐魔", + stone_fukongmoyan: "浮空魔眼", + + warlock_anyu: "暗语", + warlock_anyu_info: "你出场时,己方主将从三张随机的行动值消耗为1的牌中选择一张加入手牌。", + warlock_zhaohuan: "召唤", + warlock_zhaohuan_info: "你死亡时,将手牌中的一张随机随从牌置入战场。", + warlock_huanmeng: "幻梦", + warlock_huanmeng_info: "你出场时,己方主将随机弃置一张手牌。", + warlock_tongku: "痛苦", + warlock_tongku_info: "每当你造成一次伤害,令己方主将回复1点体力。", + warlock_tunshi: "吞噬", + warlock_tunshi_info: + "你出场时,己方主将须令一名其他友方随从死亡,然后你获得其全部的手牌和体力值。", + warlock_shijie: "视界", + warlock_shijie_info: "每当己方主将受到一次伤害,你增加1点体力和体力上限并摸一张牌。", + + warlock_nonghuo: "弄火", + warlock_nonghuo_info: "你出场时,对己方主将造成1点火焰伤害。", + warlock_zhaogui: "召鬼", + warlock_zhaogui_info: "每当你受到一次伤害,召唤一个小鬼。", + warlock_yongsheng: "永生", + warlock_yongsheng_info: "你死亡后,召唤一匹恐惧战马。", + warlock_yuhuo: "狱火", + warlock_yuhuo_info: "你出场时,对所有其他随从造成1点伤害。", + warlock_zaihuo: "灾祸", + warlock_zaihuo_info: "你出场时,随机弃置主将的两张手牌。", + + stone_hudunren: "护盾人", + stone_junxuguan: "军需官", + stone_yurenqishi: "鱼人骑士", + stone_chidunweishi: "持盾卫士", + stone_liewangshouwei: "列王守卫", + stone_longwangpeiou: "龙王配偶", + + stone_baoweizhe: "保卫者", + stone_guiqishi: "龟骑士", + stone_shenmiqishou: "神秘骑手", + stone_shixiangweishi: "石像卫士", + stone_xuefanzhanshi: "血帆战士", + stone_xunmashi: "训马师", + + paladin_baowei: "保卫", + paladin_baowei_info: "你出场时,己方主将可令一名其他随从获得1点护甲。", + paladin_tuxi: "吐息", + paladin_tuxi_info: "你出场时,己方主将进行一次判定,若为红色,则回复1点体力。", + paladin_miying: "秘影", + paladin_miying_info: "你出场时,依次将牌堆中的所有不重名的判定牌置入敌方主将的判定区。", + paladin_huashi: "化石", + paladin_huashi_info: "你出场时,己方主将可将一名其他随从的体力值及体力上限变为2。", + paladin_jinghua: "净化", + paladin_jinghua_info: "你出场时,对所有手牌数大于1的随从造成2点伤害。", + paladin_moma: "秣马", + paladin_moma2: "秣马", + paladin_moma_info: "所有友方新兵摸牌阶段摸牌数+1。", + + paladin_zhaohuan: "召唤", + paladin_zhaohuan2: "召唤", + paladin_zhaohuan_info: "你出场后,你的主将在使用下一张随从牌时获得两点行动值。", + paladin_shouwei: "守卫", + paladin_shouwei_info: "你出场时,你的主将回复2点体力值。", + paladin_chidun: "持盾", + paladin_chidun_info: "你出场时,己方主将可以弃置对方一名随从的所有牌。", + paladin_buji: "补给", + paladin_buji_info: "你出场时,所有友方新兵增加1点体力和体力上限并摸两张牌。", + paladin_hudun: "护盾", + paladin_hudun_info: "你出场时,获得1点护甲值。", + paladin_zhaochao: "招潮", + paladin_zhaochao_info: "每当你的主将使用一次英雄技能,便摸两张牌。", + + stone_shifazhe: "嗜法者", + stone_wushixuetu: "巫师学徒", + stone_shuiyuansu: "水元素", + stone_falifulong: "法力浮龙", + stone_yingxiongzhihun: "英雄之魂", + stone_huoyao: "火妖", + + stone_aoshushi: "奥术师", + stone_faqishi: "法骑士", + stone_fuhuokaijia: "复活铠甲", + stone_kaodalalong: "考达拉龙", + stone_yanshushi: "炎术士", + stone_xulingwushi: "虚灵巫师", + + mage_aoshu: "奥术", + mage_aoshu_info: "你出场时,将一张奥术智慧置入主将的手牌。", + mage_jili: "激励", + mage_jili_info: "每当主将使用一次职业技能,摸一张牌。", + mage_gushou: "固守", + mage_gushou_info: "每当己方主将受到多于1伤害时,防止其余伤害。", + mage_yufa: "驭法", + mage_yufa_info: "每当己方主将使用一次职业技能,令其获得1点行动值。", + mage_yanshu: "炎术", + mage_yanshu_info: + "你出场时,造成X点火焰伤害,随机分配到敌方随从上,X为己方主将装备区内装备牌的数量。", + mage_pingxu: "冯虚", + mage_pingxu_info: "你出场时,己方主将从三张随机法术牌中选择一张加入手牌。", + + mage_shifa: "嗜法", + mage_shifa_info: "你出场时,将一张随机法术牌置入双方主将的手牌。", + mage_minghuo: "冥火", + mage_minghuo_info: "你的主将的职业技能造成的伤害+1。", + mage_tunfa: "吞法", + mage_tunfa_info: "每当己方主将使用一张法术牌,摸一张牌。", + mage_lieyan: "烈焰", + mage_lieyan_info: "每当己方主将使用一张法术牌,对一名随机敌方角色造成1点火焰伤害。", + mage_zhufa: "助法", + mage_zhufa_info: "每当己方主将使用一张法术牌,令其获得1点行动值。", + mage_bingdong: "冰冻", + mage_bingdong_info: "每当你对一个随从造成伤害,该随从将武将牌翻至背面。", + + stone_caoyuanshi: "草原狮", + stone_leiouke: "雷欧克", + stone_misha: "米莎", + stone_huofu: "霍弗", + stone_jiewangzhu: "结网蛛", + stone_xunshoushi: "驯兽师", + + stone_senlinlang: "森林狼", + stone_tujiu: "秃鹫", + stone_muyangren: "牧羊人", + stone_jujishou: "狙击手", + stone_damoshatuo: "大漠沙驼", + stone_huangjialeixiang: "皇家雷象", + + hunter_jiewang: "结网", + hunter_jiewang_info: "你死亡时,己方主将获得一张随机野兽牌。", + hunter_xunshou: "驯兽", + hunter_xunshou_info: + "你出场时,己方主将可选择一名其他友方随从令其增加1点体力和体力上限,摸两张牌并获得嘲讽。", + hunter_nuhou: "怒吼", + hunter_nuhou_info: "当你死亡时,对所有敌方角色造成1点伤害。", + hunter_zhanhuo: "战火", + hunter_zhanhuo2: "战火", + hunter_zhanhuo_info: "其他友方随从摸牌阶段的摸牌数+1。", + + hunter_qunxi: "群袭", + hunter_qunxi_info: "你出场时,所有友方随从摸一张牌。", + hunter_mishi: "觅食", + hunter_mishi_info: "每当己方主将召唤一个随从,摸一张牌。", + hunter_dusha: "渡沙", + hunter_dusha_info: "你出场时,令双方主将各随机使用一张牌库中的1费随从牌(不计入行动值消耗)。", + hunter_chuanlin: "穿林", + hunter_chuanlin_info: "你出场时,己方主将展示牌库中的一张随机随从牌并获得之。", + hunter_muyang: "牧羊", + hunter_muyang_info: "你出场时,随机召唤一个行动值消耗为X的随从,X为其他友方随从数。", + hunter_juji: "狙击", + hunter_juji_info: "你的职业技能可以指定随从为目标。", + + stone_baoqishi: "豹骑士", + stone_conglinshouwei: "从林守卫", + stone_baohuzhishu: "保护之树", + stone_kuangyedoushi: "狂野斗士", + stone_liebao: "猎豹", + stone_zongxiong: "棕熊", + + stone_renyaqishi: "刃牙骑士", + stone_conglinxiaoshou: "丛林枭兽", + stone_huangyeqishi: "荒野骑士", + stone_xunmenglong: "迅猛龙", + stone_lindishuyao: "林地树妖", + stone_huoshanxiemu: "火山邪木", + + druid_renya: "刃牙", + druid_renya_info: + "你出场时,己方主将可以选择一项:令你摸一张牌并将武将牌翻至正面,或令你增加1点体力上限并获得技能潜行。", + druid_yuehuo: "月火", + druid_yuehuo_info: "所有锦囊牌造成的伤害+1。", + druid_qicheng: "骑乘", + druid_qicheng_info: "你死亡时,随机召唤一个行动消耗为1的随从。", + druid_chicheng: "驰骋", + druid_chicheng_info: "你出场时,己方主将获得X点行动值,X为其他友方随从数。", + druid_yeyou: "夜游", + druid_yeyou_info: "双方主将各从牌库中获得一张牌。", + druid_juhuo: "举火", + druid_juhuo_info: "己方主将回合内,每有一名随从死亡,令己方主将获得1点行动值。", + + stone_chongfeng: "冲锋", + stone_chongfeng_info: "你出场时,立即将武将牌翻至正面。", + druid_nuhuo: "怒火", + druid_nuhuo_info: "每当己方主将使用一次职业技能,便对一名随机敌人造成1点伤害。", + druid_chengzhang: "成长", + druid_chengzhang2: "成长", + druid_chengzhang_info: "你出场时,己方主将获得1点行动值;你死亡时,己方主将需弃置一张手牌。", + druid_huwei: "护卫", + druid_huwei_info: + "你出场时,己方主将可以选择一项:对一名随从造成1点伤害,或弃置一名随从的所有牌并将其体力上限改为2。", + + stone_fachao: "法潮图腾", + stone_tutengyongshi: "图腾勇士", + stone_huoshe: "火舌图腾", + stone_huoyuansu: "火元素", + stone_tuyuansu: "土元素", + stone_wujiyuansu: "无羁元素", + stone_xuejuren: "穴居人", + stone_huoli: "活力图腾", + stone_tutengshi: "图腾师", + stone_shachuisaman: "砂槌萨满", + stone_huoyanweishi: "火焰卫士", + stone_wanshiyuansu: "顽石元素", + stone_shalinxingzhe: "砂鳞行者", + + shaman_anhun: "暗魂", + shaman_anhun_info: "每当一名友方随从死亡,令主将从牌库中获得一张牌。", + shaman_zoushi: "走石", + shaman_zoushi_info: "每当己方主将使用一张随从牌,对一名随机敌方角色造成1点伤害。", + shaman_zhuhuo: "逐火", + shaman_zhuhuo_info: "你出场时,摸1~3张牌。", + shaman_peiyu: "培育", + shaman_peiyu_info: "你出场时,增加X点体力和体力上限,X为友方图腾数。", + shaman_huoli: "活力", + shaman_huoli_info: "己方主将出牌阶段开始时,你令其获得1点行动值。", + shaman_xueju: "穴居", + shaman_xueju_info: "每当己主将使用一张随从牌,摸一张牌。", + shaman_huoxi: "火袭", + shaman_huoxi_info: "你出场时,己方主将可以对对方一名随从造成2点火焰伤害。", + shaman_fachao: "法潮", + shaman_fachao_info: "己方主将在其每个回合结束阶从牌库中获得一张牌并回复1点体力。", + shaman_huoshe: "火舌", + shaman_huoshe_info: "其他友方随从造成的伤害始终+1。", + + shaman_jili: "激励", + shaman_jili_info: "己方主将的结束阶段,所有友方图腾摸一张牌。", + shaman_tuteng: "图腾", + shaman_tuteng_info: "你跳过摸牌阶段。", + shaman_fali: "空气", + shaman_fali_info: "已方主将使用的法术牌伤害+1。", + shaman_zhiliao: "治疗", + shaman_zhiliao_info: "在你的结束阶段,令所有友方随从回复1点体力。", + shaman_zhuore: "灼热", + shaman_zhuore_info: "已方主将的结束阶段,对一名随机敌方随从造成1点伤害。", + + _shaman_skill: "图腾", + _shaman_skill_info: "召唤一个随机图腾。", + _mage_skill: "火冲", + _mage_skill_info: "对一名随从造成1点火焰伤害。", + _priest_skill: "治疗", + _priest_skill_info: "回复1点体力。", + _priest_skillx: "心刺", + _priest_skillx_info: "造成1点伤害。", + _warrior_skill: "战甲", + _warrior_skill_info: "获得1点护甲(不能超过3点)。", + _warlock_skill: "分流", + _warlock_skill_info: "从牌库中获得两张牌。", + _warlock_skillx: "炼狱", + _warlock_skillx_info: "召唤一个地狱火。", + _rogue_skill: "出鞘", + _rogue_skill_info: "装备一把武器和一个随机非武器装备。", + _paladin_skill: "动员", + _paladin_skill_info: "召唤一名士兵。", + _hunter_skill: "射击", + _hunter_skill_info: "对敌方主将造成1点伤害。", + _druid_skill: "猛击", + _druid_skill_info: "视为使用一张不计入出杀次数的杀。", + + stone_tuteng1: "石爪图腾", + stone_tuteng2: "灼热图腾", + stone_tuteng3: "空气图腾", + stone_tuteng4: "治疗图腾", + + stone_xinbing: "新兵", + + stone_zhongshi: "中士", + stone_zhongshi1: "叫嚣", + stone_zhongshi1_info: "你出场时,己方主将可以弃置对方一名随从的所有牌。", + stone_zhucangzhe: "伫藏者", + stone_zhucangzhe1: "伫藏", + stone_zhucangzhe1_info: "你出场时,己方主将可以令己方一名其他角色摸一张牌。", + stone_huoqiangshou: "火枪手", + stone_huoqiangshou1: "火枪", + stone_huoqiangshou1_info: "你出场时,己方主将可以对对方一名随从造成1点伤害。", + + stone_lansaizhanshi: "蓝腮战士", + stone_kutongsiseng: "苦痛侍僧", + stone_kutongsiseng1: "苦痛", + stone_kutongsiseng2: "苦痛", + stone_kutongsiseng1_info: "你出场时,己方主将于本结束阶段摸一张牌。", + stone_yuanguanying: "远古暗影", + stone_yuanguanying1: "暗影", + stone_yuanguanying1_info: "你出场时,己方主将可视为对一名敌方角色使用一张杀。", + + stone_dijieshicong: "低阶侍从", + stone_dijieshicong1: "持枪", + stone_dijieshicong1_info: "你出场时,敌方主将随机弃置一张装备牌。", + stone_yaosaishouwei: "要塞守卫", + stone_yaosaishouwei1: "守卫", + stone_yaosaishouwei1_info: "你出场时,己方主将本回合手牌上限+2。", + stone_famingjia: "发明家", + stone_famingjia1: "发明", + stone_famingjia1_info: "你出场时,己方主将摸两张牌。", + + stone_chilundashi: "齿轮大师", + stone_chilundashi1: "齿轮", + stone_chilundashi2: "齿轮", + stone_chilundashi1_info: "你出场后的第一个摸牌阶段摸牌数+1。", + stone_hanguangzhizhe: "寒光智者", + stone_hanguangzhizhe1: "寒光", + stone_hanguangzhizhe1_info: "你出场时,所有其他随从各摸一张牌。", + stone_aihaozhihun: "哀嚎之魂", + stone_aihaozhihun1: "哀嚎", + stone_aihaozhihun1_info: "你出场时,敌方随从弃置所有牌。", + + stone_fennuxiaoji: "愤怒小鸡", + stone_fennuxiaoji1: "暴怒", + stone_fennuxiaoji1_info: "准备阶段,若你没有手牌,你摸两张牌。", + stone_juxingchanchu: "巨型蟾蜍", + stone_juxingchanchu1: "毒液", + stone_juxingchanchu1_info: "你死亡时,己方主将可令一名敌方随从失去1点体力。", + stone_shishigui: "食尸鬼", + stone_shishigui1: "食尸", + stone_shishigui1_info: "你死亡后,场上所有其他随从失去1点体力。", + stone_wuyi: "巫医", + stone_langren: "狼人", + stone_qianxing: "潜行", + stone_qianxing_info: "你出场时,获得潜行直到下一回合开始。", + + stone_mingguangjisi: "明光祭司", + stone_nianqingjisi: "年轻祭司", + stone_zhufu: "祝福", + stone_zhufu_info: "己方主将的结束阶段,你令一名随机的受伤友方随从回复1点体力。", + stone_aomishouwei: "奥秘守卫", + stone_yanjingshe: "眼镜蛇", + stone_yanjingshe1: "毒噬", + stone_yanjingshe1_info: "你出场时,若敌方随从数不少于己方,则随机杀死一名随从。", + stone_zhiyuzhe: "治愈者", + stone_zhiyu: "治愈", + stone_zhiyu_info: "你出场时,令所有友方随从回复1点体力。", + stone_mafengzhuru: "麻风侏儒", + stone_mafengzhuru1: "麻风", + stone_mafengzhuru1_info: "杀死你的随从失去1点体力。", + stone_fatiaozhuru: "发条侏儒", + stone_fatiaozhuru1: "发条", + stone_fatiaozhuru1_info: "结束阶段,若你没有手牌,你摸两张牌。", + + stonesha: "进攻", + stonesha_info: "锁定技,你的装备牌均视为杀。", + stoneshan: "格挡", + stoneshan_info: "锁定技,你的随从和法术牌均视为闪。", + + stonecharacter: "随从", + spell_shengerpingdeng: "生而平等", + spell_shengerpingdeng_info: "将所有随从体力上限降为1。", + spell_jingshenkongzhi: "精神控制", + spell_jingshenkongzhi_info: "将一名敌方随从吸收为己方。", + spell_anyingkuangluan: "暗影狂乱", + spell_anyingkuangluan_info: + "将一名手牌数不超过1的敌方随从吸收为己方,并令其于下个回合结束后死亡。", + spell_anyingkuangluan_die: "暗影狂乱", + spell_anyingkuangluan_die_info: "下个回合结束后死亡。", + spell_binghuan: "冰环", + spell_binghuan_info: "将场上所有随从翻面。", + spell_morizaihuo: "末日灾祸", + spell_morizaihuo_info: "令场上所有随从立即死亡,回复2点体力。", + spell_zhiliaozhichu: "治疗之触", + spell_zhiliaozhichu_info: "令目标随从恢复所有体力值并获得嘲讽。", + lschaofeng: "嘲讽", + lschaofeng_info: "同阵营的无嘲讽角色不以能成为杀的目标。", + spell_wangzhezhufu: "王者祝福", + spell_wangzhezhufu_info: "令一名随从增加2点体力和体力上限并摸两张牌。", + spell_diyulieyan: "地狱烈焰", + spell_diyulieyan_info: "所有角色失去1点体力。", + spell_chenmo: "沉默", + spell_chenmo_info: "弃置一名随从的所有牌,并令其体力上限减至2。", + spell_zhiliaoshui: "治疗水", + spell_zhiliaoshui_info: + "出牌阶段对自己使用,恢复2点体力值;或于濒死阶段对一名角色使用,令目标恢复1点体力。", + spell_yanmie: "极恶之咒", + spell_yanmie_info: "交换你与敌方主将的装备区,并摸若干张牌直到你的手牌数与敌方主将相等。", + spell_xiaoshi: "消失", + spell_xiaoshi_info: + "令敌方主将将所有装备区内的牌收入手牌,并弃置其若干张手牌,直到其手牌数与你相等。", + + stonecard: "法术", + mode_stone_card_config: "炉石模式", + mode_stone_character_config: "炉石模式", + }, + help: { + 炉石模式: + '
    构筑
    • 点击右上角的卡组管理构建卡组
    • 一套卡组共30张牌,由法术和随从牌构成,每个同名卡牌最多带两张' + + "
    • 卡组管理器中,随从右上角的x/y表示登场状态为x牌y血" + + "
    • 游戏开始时,双方摸三张牌并从牌库中获得一张牌,并可选择将手牌置换一次" + + "
    • 每当主将摸X张牌时,若X至少为2,则其中的X-1张牌从牌堆中获得,1张牌从牌库中获得" + + "
    • 每名角色使用一套卡组,卡组用完后会重新补满" + + "
    • 卡组与职业绑定,每个职业有一个专属技能,每回合限用一次,消耗两点行动值
    " + + '
    职业技能
    • 祭司:召唤一个随机图腾' + + "
    • 法师:对一名随从造成1点火焰伤害" + + "
    • 牧师:回复1点体力" + + "
    • 战士:获得1点护甲(不能超过3点)" + + "
    • 术士:牌库中摸两张牌" + + "
    • 潜行者:装备一把武器和一个随机非武器装备" + + "
    • 圣骑士:召唤一名士兵" + + "
    • 猎人:对敌方主将造成1点伤害" + + "
    • 德鲁伊:视为使用一张不计入出杀次数的杀
    " + + '
    怒气值
    • 每当友方随从受到伤害获得3点怒气值,主将受到伤害获得6点怒气值' + + "
    • 每有一个友方随从死亡,获得10点怒气值,主将死亡获得20点怒气值" + + "
    • 结束阶段,若己方随从数少于对方会获得10X点怒气值,X为随从数之差" + + "
    • 怒气值达到100时不再增加。准备阶段,若怒气值己满,可消耗全部怒气值和4点行动值并召唤一名传说随从
    " + + '
    战斗
    • 场上有两名主将进行对抗,主将的体力上限+1' + + "
    • 游戏牌堆移除了乐不思蜀等跳过出牌阶段以及包含翻面功能的卡牌" + + "
    • 主将出牌阶段的出牌数量(行动值)有上限,从1开始递增,后手的首个回合有一点额外行动值,装备牌不计入出牌上限
    • 游戏每进行一轮,主将的出牌上限+1,直到增加至6" + + "
    • 使用随从牌可召唤一个随从,随从出场时背面朝上。每一方在场的随从数不能超过4
    • 随从于摸牌阶段摸牌基数为1,随从的法术和随从牌均视为闪,装备牌均视为杀
    • " + + "随从与其他所有角色相互距离基数为1
    • " + + "主将杀死对方随从后获得一个额外的行动值并从牌库中获得一张牌,杀死己方随从无惩罚,随从杀死随从无效果" + + "
    • 主将在随从满员时可重铸随从牌,但回合内总的重铸次数不能超过3;若重铸的牌为随从牌或法术牌,则摸牌改为获得一张随机法术牌" + + "
    • 嘲讽:若一方阵营中有嘲讽角色,则同阵营的无嘲讽角色不以能成为杀目标" + + "
    • 行动顺序为先主将后随从。主将或随从死亡后立即移出游戏,主将死亡后替补登场,替补登场时摸3+X张牌,X为对方存活的随从数,无替补时游戏结束", }, - help:{ - '炉石模式': - '
      构筑
      • 点击右上角的卡组管理构建卡组
      • 一套卡组共30张牌,由法术和随从牌构成,每个同名卡牌最多带两张'+ - '
      • 卡组管理器中,随从右上角的x/y表示登场状态为x牌y血'+ - '
      • 游戏开始时,双方摸三张牌并从牌库中获得一张牌,并可选择将手牌置换一次'+ - '
      • 每当主将摸X张牌时,若X至少为2,则其中的X-1张牌从牌堆中获得,1张牌从牌库中获得'+ - '
      • 每名角色使用一套卡组,卡组用完后会重新补满'+ - '
      • 卡组与职业绑定,每个职业有一个专属技能,每回合限用一次,消耗两点行动值
      '+ - '
      职业技能
      • 祭司:召唤一个随机图腾'+ - '
      • 法师:对一名随从造成1点火焰伤害'+ - '
      • 牧师:回复1点体力'+ - '
      • 战士:获得1点护甲(不能超过3点)'+ - '
      • 术士:牌库中摸两张牌'+ - '
      • 潜行者:装备一把武器和一个随机非武器装备'+ - '
      • 圣骑士:召唤一名士兵'+ - '
      • 猎人:对敌方主将造成1点伤害'+ - '
      • 德鲁伊:视为使用一张不计入出杀次数的杀
      '+ - '
      怒气值
      • 每当友方随从受到伤害获得3点怒气值,主将受到伤害获得6点怒气值'+ - '
      • 每有一个友方随从死亡,获得10点怒气值,主将死亡获得20点怒气值'+ - '
      • 结束阶段,若己方随从数少于对方会获得10X点怒气值,X为随从数之差'+ - '
      • 怒气值达到100时不再增加。准备阶段,若怒气值己满,可消耗全部怒气值和4点行动值并召唤一名传说随从
      '+ - '
      战斗
      • 场上有两名主将进行对抗,主将的体力上限+1'+ - '
      • 游戏牌堆移除了乐不思蜀等跳过出牌阶段以及包含翻面功能的卡牌'+ - '
      • 主将出牌阶段的出牌数量(行动值)有上限,从1开始递增,后手的首个回合有一点额外行动值,装备牌不计入出牌上限
      • 游戏每进行一轮,主将的出牌上限+1,直到增加至6'+ - '
      • 使用随从牌可召唤一个随从,随从出场时背面朝上。每一方在场的随从数不能超过4
      • 随从于摸牌阶段摸牌基数为1,随从的法术和随从牌均视为闪,装备牌均视为杀
      • '+ - '随从与其他所有角色相互距离基数为1
      • '+ - '主将杀死对方随从后获得一个额外的行动值并从牌库中获得一张牌,杀死己方随从无惩罚,随从杀死随从无效果'+ - '
      • 主将在随从满员时可重铸随从牌,但回合内总的重铸次数不能超过3;若重铸的牌为随从牌或法术牌,则摸牌改为获得一张随机法术牌'+ - '
      • 嘲讽:若一方阵营中有嘲讽角色,则同阵营的无嘲讽角色不以能成为杀目标'+ - '
      • 行动顺序为先主将后随从。主将或随从死亡后立即移出游戏,主将死亡后替补登场,替补登场时摸3+X张牌,X为对方存活的随从数,无替补时游戏结束' - } }; }); diff --git a/mode/tafang.js b/mode/tafang.js index 695be18ed..94fc96cf3 100644 --- a/mode/tafang.js +++ b/mode/tafang.js @@ -1,485 +1,505 @@ -'use strict'; -game.import('mode',function(lib,game,ui,get,ai,_status){ +"use strict"; +game.import("mode", function (lib, game, ui, get, ai, _status) { return { - name:'tafang', - canvasUpdates2:[], - start:function(){ - "step 0" - _status.gameDrawed=true; - lib.init.css(lib.assetURL+'layout/mode','chess'); - lib.init.css(lib.assetURL+'layout/mode','tafang'); - game.loadMode('chess'); - "step 1" - if(get.is.phoneLayout()&&lib.config.touchscreen&& - !lib.config.show_round_menu&& - !['system','menu'].includes(lib.config.swipe_left)&& - !['system','menu'].includes(lib.config.swipe_right)&& - !['system','menu'].includes(lib.config.swipe_up)){ - ui.roundmenu.style.display=''; + name: "tafang", + canvasUpdates2: [], + start: function () { + "step 0"; + _status.gameDrawed = true; + lib.init.css(lib.assetURL + "layout/mode", "chess"); + lib.init.css(lib.assetURL + "layout/mode", "tafang"); + game.loadMode("chess"); + "step 1"; + if ( + get.is.phoneLayout() && + lib.config.touchscreen && + !lib.config.show_round_menu && + !["system", "menu"].includes(lib.config.swipe_left) && + !["system", "menu"].includes(lib.config.swipe_right) && + !["system", "menu"].includes(lib.config.swipe_up) + ) { + ui.roundmenu.style.display = ""; } - if(lib.config.player_border=='normal'&&(lib.config.layout=='long'||lib.config.layout=='long2')){ - ui.arena.classList.add('lslim_player'); + if ( + lib.config.player_border == "normal" && + (lib.config.layout == "long" || lib.config.layout == "long2") + ) { + ui.arena.classList.add("lslim_player"); } - for(var i in result.element){ - for(var j in result.element[i]){ - if(j!='dieAfter'){ - lib.element[i][j]=result.element[i][j]; + for (var i in result.element) { + for (var j in result.element[i]) { + if (j != "dieAfter") { + lib.element[i][j] = result.element[i][j]; } } } - for(var i in result.ui){ - for(var j in result.ui[i]){ - ui[i][j]=result.ui[i][j]; + for (var i in result.ui) { + for (var j in result.ui[i]) { + ui[i][j] = result.ui[i][j]; } } - get.chessDistance=result.get.chessDistance; - get.rawAttitude=result.get.rawAttitude; - var toLoad=['addChessPlayer','addObstacle','removeObstacle','isChessNeighbour', - 'draw2','updateCanvas2','setChessInfo','modeSwapPlayer','initChess']; - for(var i=0;i=8&&j!=0&&j!=ui.chesswidth-1) continue; - if(tafanglist.includes(j)){ - var cg=i*ui.chesswidth+j; + event.obs = []; + if (!event.video) { + var tafanglist = [0, 2, 3, 5, 6, 8, 9, 11, 12]; + for (var i = 0; i < ui.chessheight - 1; i++) { + for (var j = 0; j < ui.chesswidth; j++) { + if (i >= 8 && j != 0 && j != ui.chesswidth - 1) continue; + if (tafanglist.includes(j)) { + var cg = i * ui.chesswidth + j; grids.remove(cg); - game.addObstacle(cg.toString(),false); + game.addObstacle(cg.toString(), false); event.obs.push(cg.toString()); } } } - for(var i=0;icount){ - map[i][j].classList.add('unselectable'); - map[i][j].classList.remove('pointerdiv'); - } - else if(i=='zhaomu'&&_status.friends.length+selectedZhaomu>=5){ - map[i][j].classList.add('unselectable'); - map[i][j].classList.remove('pointerdiv'); - } - else if(i=='bufang'){ - var numbufang=0; - for(var k=0;k count) { + map[i][j].classList.add("unselectable"); + map[i][j].classList.remove("pointerdiv"); + } else if (i == "zhaomu" && _status.friends.length + selectedZhaomu >= 5) { + map[i][j].classList.add("unselectable"); + map[i][j].classList.remove("pointerdiv"); + } else if (i == "bufang") { + var numbufang = 0; + for (var k = 0; k < game.treasures.length; k++) { + if (game.treasures[k].name == map[i][j].link) { numbufang++; } - if(numbufang>=3){ - map[i][j].classList.add('unselectable'); + if (numbufang >= 3) { + map[i][j].classList.add("unselectable"); break; } } } } } - ui.dialog.content.firstChild.innerHTML='剩余行动点:'+count; - } - var clickOrder=0; - event.custom.replace.button=function(button){ - if(!button.classList.contains('unselectable')|| - button.classList.contains('selected')){ - button.classList.toggle('selected'); - button._clickOrder=clickOrder++; + ui.dialog.content.firstChild.innerHTML = "剩余行动点:" + count; + }; + var clickOrder = 0; + event.custom.replace.button = function (button) { + if ( + !button.classList.contains("unselectable") || + button.classList.contains("selected") + ) { + button.classList.toggle("selected"); + button._clickOrder = clickOrder++; } updateSelected(); - } - event.custom.add.window=function(clicked){ - if(clicked) return; - if(event.step>1) return; - for(var i in map){ - for(var j=0;j 1) return; + for (var i in map) { + for (var j = 0; j < map[i].length; j++) { + map[i][j].classList.remove("selected"); + map[i][j].classList.remove("unselectable"); } } updateSelected(); - } - var update=function(link){ - for(var i in map){ - for(var j=0;j=5){ - event.control.childNodes[1].style.opacity=0.5; - event.control.childNodes[1].disabled=true; - if(_status.lastTafangCommand=='招募'){ - _status.lastTafangCommand='布防'; + if (_status.friends.length >= 5) { + event.control.childNodes[1].style.opacity = 0.5; + event.control.childNodes[1].disabled = true; + if (_status.lastTafangCommand == "招募") { + _status.lastTafangCommand = "布防"; } } - _status.imchoosing=true; + _status.imchoosing = true; ui.auto.hide(); - var eventdong=function(){ - var selected=dialog.querySelectorAll('.button.selected'); - event.bufang=[]; - event.zhaomu=[]; - event.xingdong=_status.friends.slice(0); + var eventdong = function () { + var selected = dialog.querySelectorAll(".button.selected"); + event.bufang = []; + event.zhaomu = []; + event.xingdong = _status.friends.slice(0); // var xingdongs=[]; - _status.remainingCount+=10; - for(var i=0;i0){ + }, 50); + event.switchToAuto = eventdong; + if (!_status.auto && 10 + _status.remainingCount > 0) { game.pause(); - } - else{ + } else { eventdong(); } - 'step 1' + "step 1"; event.dialog.close(); event.control.close(); event.done.close(); delete event.dialog; delete event.control; delete event.done; - 'step 2' - event.chooseObstacle=false; - if(event.bufang.length){ - event.obstacles=game.obstacles.slice(0); - for(var i=0;i=0;k--){ - var pos=i+k*ui.chesswidth; - if(lib.posmap[pos]){ + if (j < ui.chessheight) { + shalldelay = true; + for (var k = j; k >= 0; k--) { + var pos = i + k * ui.chesswidth; + if (lib.posmap[pos]) { lib.posmap[pos].moveDown(); } } } } } - if(shalldelay) game.delay(); - 'step 7' - event.justadded=[]; - if(_status.characterList.length){ - if(_status.enemies.length=_status.turnTotal){ + if (_status.turnCount >= _status.turnTotal) { game.over(true); - } - else{ + } else { event.goto(0); game.delay(); } }); }, - loadMap:function(){ - var next=game.createEvent('loadMap'); - next.setContent(function(){ - if(!lib.storage.map){ - lib.storage.map=['basic_small','basic_medium','basic_large']; + loadMap: function () { + var next = game.createEvent("loadMap"); + next.setContent(function () { + if (!lib.storage.map) { + lib.storage.map = ["basic_small", "basic_medium", "basic_large"]; } - if(!lib.storage.newmap){ - lib.storage.newmap=[]; + if (!lib.storage.newmap) { + lib.storage.newmap = []; } - var sceneview=ui.create.div('.storyscene'); - if(!lib.config.touchscreen&&lib.config.mousewheel){ - sceneview._scrollspeed=30; - sceneview._scrollnum=10; - sceneview.onmousewheel=function(){ - if(!this.classList.contains('lockscroll')){ - ui.click.mousewheel.apply(this,arguments); + var sceneview = ui.create.div(".storyscene"); + if (!lib.config.touchscreen && lib.config.mousewheel) { + sceneview._scrollspeed = 30; + sceneview._scrollnum = 10; + sceneview.onmousewheel = function () { + if (!this.classList.contains("lockscroll")) { + ui.click.mousewheel.apply(this, arguments); } }; } lib.setScroll(sceneview); - var switchScene=function(){ - event.result=this.link; + var switchScene = function () { + event.result = this.link; sceneview.delete(); - setTimeout(game.resume,300); - } - var clickScene=function(e){ - if(this.classList.contains('unselectable')) return; - if(this._clicking) return; - if(e&&e.stopPropagation) e.stopPropagation(); - if(this.classList.contains('flipped')){ + setTimeout(game.resume, 300); + }; + var clickScene = function (e) { + if (this.classList.contains("unselectable")) return; + if (this._clicking) return; + if (e && e.stopPropagation) e.stopPropagation(); + if (this.classList.contains("flipped")) { return; } - if(this.classList.contains('glow3')){ - this.classList.remove('glow3'); + if (this.classList.contains("glow3")) { + this.classList.remove("glow3"); lib.storage.newmap.remove(this.name); - game.save('newmap',lib.storage.newmap); + game.save("newmap", lib.storage.newmap); } - var sceneNode=this.parentNode; - var current=document.querySelector('.flipped.scene'); - if(current){ - restoreScene(current,true); + var sceneNode = this.parentNode; + var current = document.querySelector(".flipped.scene"); + if (current) { + restoreScene(current, true); } - this.content.innerHTML=''; - ui.create.div('.menubutton.large.enter','进入',this.content,switchScene).link=this.name; - sceneNode.classList.add('lockscroll'); - var node=this; - node._clicking=true; - setTimeout(function(){ - node._clicking=false; - },700); - sceneNode.dx=ui.window.offsetWidth/2-(-sceneNode.scrollLeft+this.offsetLeft+this.offsetWidth/2); - if(Math.abs(sceneNode.dx)<20){ - sceneNode.dx=0; + this.content.innerHTML = ""; + ui.create.div(".menubutton.large.enter", "进入", this.content, switchScene).link = + this.name; + sceneNode.classList.add("lockscroll"); + var node = this; + node._clicking = true; + setTimeout(function () { + node._clicking = false; + }, 700); + sceneNode.dx = + ui.window.offsetWidth / 2 - + (-sceneNode.scrollLeft + this.offsetLeft + this.offsetWidth / 2); + if (Math.abs(sceneNode.dx) < 20) { + sceneNode.dx = 0; } - if(!sceneNode.sceneInterval&&sceneNode.dx){ - sceneNode.sceneInterval=setInterval(function(){ - var dx=sceneNode.dx; - if(Math.abs(dx)<=2){ - sceneNode.scrollLeft-=dx; + if (!sceneNode.sceneInterval && sceneNode.dx) { + sceneNode.sceneInterval = setInterval(function () { + var dx = sceneNode.dx; + if (Math.abs(dx) <= 2) { + sceneNode.scrollLeft -= dx; clearInterval(sceneNode.sceneInterval); delete sceneNode.sceneInterval; + } else { + var ddx = (dx / Math.sqrt(Math.abs(dx))) * 1.5; + sceneNode.scrollLeft -= ddx; + sceneNode.dx -= ddx; } - else{ - var ddx=dx/Math.sqrt(Math.abs(dx))*1.5; - sceneNode.scrollLeft-=ddx; - sceneNode.dx-=ddx; - } - },16); + }, 16); } - node.style.transition='all ease-in 0.2s'; - node.style.transform='perspective(1600px) rotateY(90deg) scale(0.75)'; - var onEnd=function(){ - node.removeEventListener('webkitTransitionEnd',onEnd); - node.classList.add('flipped'); - sceneNode.classList.add('lockscroll'); - node.style.transition='all ease-out 0.4s'; - node.style.transform='perspective(1600px) rotateY(180deg) scale(1)' + node.style.transition = "all ease-in 0.2s"; + node.style.transform = "perspective(1600px) rotateY(90deg) scale(0.75)"; + var onEnd = function () { + node.removeEventListener("webkitTransitionEnd", onEnd); + node.classList.add("flipped"); + sceneNode.classList.add("lockscroll"); + node.style.transition = "all ease-out 0.4s"; + node.style.transform = "perspective(1600px) rotateY(180deg) scale(1)"; }; node.listenTransition(onEnd); - } - ui.click.scene=clickScene; - var restoreScene=function(node,forced){ - if(node._clicking&&!forced) return; - if(node.transformInterval){ + }; + ui.click.scene = clickScene; + var restoreScene = function (node, forced) { + if (node._clicking && !forced) return; + if (node.transformInterval) { clearInterval(node.transformInterval); delete node.transformInterval; } - var sceneNode=node.parentNode; - node._clicking=true; - setTimeout(function(){ - node._clicking=false; - },700); - node.style.transition='all ease-in 0.2s'; - node.style.transform='perspective(1600px) rotateY(90deg) scale(0.75)'; - var onEnd=function(){ - node.removeEventListener('webkitTransitionEnd',onEnd); - node.classList.remove('flipped'); - if(!sceneNode.querySelector('.flipped')){ - sceneNode.classList.remove('lockscroll'); + var sceneNode = node.parentNode; + node._clicking = true; + setTimeout(function () { + node._clicking = false; + }, 700); + node.style.transition = "all ease-in 0.2s"; + node.style.transform = "perspective(1600px) rotateY(90deg) scale(0.75)"; + var onEnd = function () { + node.removeEventListener("webkitTransitionEnd", onEnd); + node.classList.remove("flipped"); + if (!sceneNode.querySelector(".flipped")) { + sceneNode.classList.remove("lockscroll"); } - node.style.transition='all ease-out 0.4s'; - node.style.transform='perspective(1600px) rotateY(0deg) scale(0.7)' + node.style.transition = "all ease-out 0.4s"; + node.style.transform = "perspective(1600px) rotateY(0deg) scale(0.7)"; }; node.listenTransition(onEnd); - } - ui.click.scene2=restoreScene; - var createScene=function(name){ - var scene=lib.tafang.map[name]; - var node=ui.create.div('.scene',clickScene); - node.style.transform='perspective(1600px) rotateY(0deg) scale(0.7)'; - node.name=name; - node.bgnode=ui.create.div('.background.player',node); - node.info=scene; - ui.create.div('.avatar.menu',node.bgnode); - node.namenode=ui.create.div('.name',node,(scene.name)); - if(lib.storage.map.includes(name)){ - if(lib.storage.newmap.includes(name)){ - node.classList.add('glow3'); + }; + ui.click.scene2 = restoreScene; + var createScene = function (name) { + var scene = lib.tafang.map[name]; + var node = ui.create.div(".scene", clickScene); + node.style.transform = "perspective(1600px) rotateY(0deg) scale(0.7)"; + node.name = name; + node.bgnode = ui.create.div(".background.player", node); + node.info = scene; + ui.create.div(".avatar.menu", node.bgnode); + node.namenode = ui.create.div(".name", node, scene.name); + if (lib.storage.map.includes(name)) { + if (lib.storage.newmap.includes(name)) { + node.classList.add("glow3"); } - node.namenode.dataset.nature='soilm'; + node.namenode.dataset.nature = "soilm"; + } else { + node.classList.add("unselectable"); + node.namenode.innerHTML = "未开启"; } - else{ - node.classList.add('unselectable'); - node.namenode.innerHTML=('未开启'); - } - var content=ui.create.div('.menu',node); + var content = ui.create.div(".menu", node); lib.setScroll(content); - node.content=content; + node.content = content; sceneview.appendChild(node); return node; - } - event.custom.add.window=function(){ - var current=document.querySelector('.flipped.scene'); - if(current){ + }; + event.custom.add.window = function () { + var current = document.querySelector(".flipped.scene"); + if (current) { restoreScene(current); } - } - for(var i in lib.tafang.map){ + }; + for (var i in lib.tafang.map) { createScene(i); } - ui.window.appendChild(sceneview.addTempClass('start')); + ui.window.appendChild(sceneview.addTempClass("start")); game.pause(); }); }, }, - skill:{ - tafang_mech_weixingxianjing_skill:{ - filter:function(player){ - for(var i=0;i<_status.enemies.length;i++){ - if(!_status.enemies[i].isTurnedOver()&& - get.chessDistance(player,_status.enemies[i])<=2){ + skill: { + tafang_mech_weixingxianjing_skill: { + filter: function (player) { + for (var i = 0; i < _status.enemies.length; i++) { + if ( + !_status.enemies[i].isTurnedOver() && + get.chessDistance(player, _status.enemies[i]) <= 2 + ) { return true; } } return false; }, - content:function(){ - var list=[]; - for(var i=0;i<_status.enemies.length;i++){ - if(!_status.enemies[i].isTurnedOver()&& - get.chessDistance(player,_status.enemies[i])<=2){ + content: function () { + var list = []; + for (var i = 0; i < _status.enemies.length; i++) { + if ( + !_status.enemies[i].isTurnedOver() && + get.chessDistance(player, _status.enemies[i]) <= 2 + ) { list.push(_status.enemies[i]); } } - if(list.length){ - game.log('小型陷阱发动'); - var target=list.randomGet(); + if (list.length) { + game.log("小型陷阱发动"); + var target = list.randomGet(); target.turnOver(); - game.logv(player,'tafang_mech_weixingxianjing_skill',[target]).node.text.style.display='none'; - player.line(target,'green'); + game.logv(player, "tafang_mech_weixingxianjing_skill", [ + target, + ]).node.text.style.display = "none"; + player.line(target, "green"); } - } + }, }, - tafang_mech_nengliangqiu_skill:{ - filter:function(player){ - for(var i=0;i<_status.friends.length;i++){ - if(get.chessDistance(player,_status.friends[i])<=3){ + tafang_mech_nengliangqiu_skill: { + filter: function (player) { + for (var i = 0; i < _status.friends.length; i++) { + if (get.chessDistance(player, _status.friends[i]) <= 3) { return true; } } return false; }, - content:function(){ - var list1=[],list2=[]; - for(var i=0;i<_status.friends.length;i++){ - if(get.chessDistance(player,_status.friends[i])<=1){ + content: function () { + var list1 = [], + list2 = []; + for (var i = 0; i < _status.friends.length; i++) { + if (get.chessDistance(player, _status.friends[i]) <= 1) { list2.push(_status.friends[i]); - } - else if(get.chessDistance(player,_status.friends[i])<=3){ + } else if (get.chessDistance(player, _status.friends[i]) <= 3) { list1.push(_status.friends[i]); } // else if(get.chessDistance(player,_status.friends[i])<=4){ // list2.push(_status.friends[i]); // } } - if(list2.length){ - game.asyncDraw(list2,2); - player.line(list2,'green'); + if (list2.length) { + game.asyncDraw(list2, 2); + player.line(list2, "green"); } - if(list1.length){ + if (list1.length) { game.asyncDraw(list1); - player.line(list1,'green'); + player.line(list1, "green"); } - if(list1.length||list2.length){ - game.log('能量球发动'); - game.logv(player,'tafang_mech_nengliangqiu_skill',list1.concat(list2)).node.text.style.display='none'; + if (list1.length || list2.length) { + game.log("能量球发动"); + game.logv( + player, + "tafang_mech_nengliangqiu_skill", + list1.concat(list2) + ).node.text.style.display = "none"; } - } + }, }, - tafang_mech_mutong_skill:{ - filter:function(player){ - for(var i=0;i<_status.enemies.length;i++){ - if(get.chessDistance(player,_status.enemies[i])<=3){ + tafang_mech_mutong_skill: { + filter: function (player) { + for (var i = 0; i < _status.enemies.length; i++) { + if (get.chessDistance(player, _status.enemies[i]) <= 3) { return true; } } return false; }, - content:function(){ - var list=[]; - for(var i=0;i<_status.enemies.length;i++){ - if(get.chessDistance(player,_status.enemies[i])<=3){ + content: function () { + var list = []; + for (var i = 0; i < _status.enemies.length; i++) { + if (get.chessDistance(player, _status.enemies[i]) <= 3) { list.push(_status.enemies[i]); } } - if(list.length){ - game.log('木桶发动'); - var targets=list.randomGets(1); - game.logv(player,'tafang_mech_mutong_skill',targets).node.text.style.display='none'; - player.line(targets,'green'); - for(var i=0;i
      • 阻上敌人到达最下方的出口,坚持到给定的回合数即获得胜利
      • '+ - '每轮可获得10个行动点,用来布置机关、招募武将。场上每有一个友方武将,行动点数-1。游戏难度将影响不同操作消耗的行动点数。未用完的行动点将减半(向下取整)并累积到下一轮
      • '+ - '每一轮在最上方的一个随机位置增加一名敌人,若最上方已有角色,则将其下移一格
      • '+ - '战场上最多出现3个相同的机关,每个机关在置入战场3轮后消失。战场上最多招募5名友方角色。
      • '+ - '敌方角色到达底部出口时游戏失败,已方角色到达底部出口,将被移出游戏', + posmap: {}, + help: { + 塔防模式: + "
        • 阻上敌人到达最下方的出口,坚持到给定的回合数即获得胜利
        • " + + "每轮可获得10个行动点,用来布置机关、招募武将。场上每有一个友方武将,行动点数-1。游戏难度将影响不同操作消耗的行动点数。未用完的行动点将减半(向下取整)并累积到下一轮
        • " + + "每一轮在最上方的一个随机位置增加一名敌人,若最上方已有角色,则将其下移一格
        • " + + "战场上最多出现3个相同的机关,每个机关在置入战场3轮后消失。战场上最多招募5名友方角色。
        • " + + "敌方角色到达底部出口时游戏失败,已方角色到达底部出口,将被移出游戏", }, }; }); diff --git a/mode/versus.js b/mode/versus.js index c304121be..952c2dc8c 100644 --- a/mode/versus.js +++ b/mode/versus.js @@ -1,447 +1,479 @@ -'use strict'; -game.import('mode',function(lib,game,ui,get,ai,_status){ +"use strict"; +game.import("mode", function (lib, game, ui, get, ai, _status) { return { - name:'versus', - init:function(){ - if(get.config('versus_mode')=='jiange'){ - lib.characterPack.mode_versus=lib.jiangeboss; - } - else if(get.config('versus_mode')=='siguo'){ - lib.characterPack.mode_versus={ - tangzi:['male',['wei','wu'].randomGet(),4,['xingzhao'],[]], - liuqi:['male',['shu','qun'].randomGet(),3,['wenji','tunjiang'],[]], + name: "versus", + init: function () { + if (get.config("versus_mode") == "jiange") { + lib.characterPack.mode_versus = lib.jiangeboss; + } else if (get.config("versus_mode") == "siguo") { + lib.characterPack.mode_versus = { + tangzi: ["male", ["wei", "wu"].randomGet(), 4, ["xingzhao"], []], + liuqi: ["male", ["shu", "qun"].randomGet(), 3, ["wenji", "tunjiang"], []], }; - for(var i in lib.characterPack.mode_versus){ - lib.character[i]=lib.characterPack.mode_versus[i]; + for (var i in lib.characterPack.mode_versus) { + lib.character[i] = lib.characterPack.mode_versus[i]; } delete lib.character.sp_liuqi; delete lib.character.xf_tangzi; - lib.cardPack.mode_versus=['zong','xionghuangjiu','tongzhougongji','lizhengshangyou']; - lib.translate.mode_versus_character_config='四国武将'; + lib.cardPack.mode_versus = ["zong", "xionghuangjiu", "tongzhougongji", "lizhengshangyou"]; + lib.translate.mode_versus_character_config = "四国武将"; } - if(!lib.cardPack.mode_versus){ + if (!lib.cardPack.mode_versus) { delete lib.card.zong; delete lib.card.xionghuangjiu; delete lib.card.tongzhougongji; delete lib.card.lizhengshangyou; } }, - start:function(){ - "step 0" - _status.mode=get.config('versus_mode'); - if(_status.connectMode) _status.mode=lib.configOL.versus_mode; - if(_status.brawl&&_status.brawl.submode){ - _status.mode=_status.brawl.submode; + start: function () { + "step 0"; + _status.mode = get.config("versus_mode"); + if (_status.connectMode) _status.mode = lib.configOL.versus_mode; + if (_status.brawl && _status.brawl.submode) { + _status.mode = _status.brawl.submode; } - if(lib.config.test_game){ - _status.mode='standard'; + if (lib.config.test_game) { + _status.mode = "standard"; } - "step 1" - var playback=localStorage.getItem(lib.configprefix+'playback'); - if(playback){ + "step 1"; + var playback = localStorage.getItem(lib.configprefix + "playback"); + if (playback) { ui.create.me(); - ui.arena.style.display='none'; - ui.system.style.display='none'; - _status.playback=playback; - localStorage.removeItem(lib.configprefix+'playback'); - var store=lib.db.transaction(['video'],'readwrite').objectStore('video'); - store.get(parseInt(playback)).onsuccess=function(e){ - if(e.target.result){ + ui.arena.style.display = "none"; + ui.system.style.display = "none"; + _status.playback = playback; + localStorage.removeItem(lib.configprefix + "playback"); + var store = lib.db.transaction(["video"], "readwrite").objectStore("video"); + store.get(parseInt(playback)).onsuccess = function (e) { + if (e.target.result) { game.playVideoContent(e.target.result.video); - } - else{ - alert('播放失败:找不到录像'); + } else { + alert("播放失败:找不到录像"); game.reload(); } - } + }; event.finish(); return; } - if(_status.connectMode){ - game.waitForPlayer(function(){ - switch(lib.configOL.versus_mode){ - case '1v1':lib.configOL.number=2;break; - case '2v2':lib.configOL.number=4;break; - case '3v3':lib.configOL.number=6;break; - case '4v4':case 'guandu':lib.configOL.number=8;break; + if (_status.connectMode) { + game.waitForPlayer(function () { + switch (lib.configOL.versus_mode) { + case "1v1": + lib.configOL.number = 2; + break; + case "2v2": + lib.configOL.number = 4; + break; + case "3v3": + lib.configOL.number = 6; + break; + case "4v4": + case "guandu": + lib.configOL.number = 8; + break; } }); - } - else if(_status.mode=='jiange'||_status.mode=='siguo'||_status.mode=='four'||_status.mode=='guandu'){ - if(_status.mode=='four'&&!get.config('enable_all_cards_four')){ - lib.card.list=lib.cardsFour; - game.fixedPile=true; - } - else if(_status.mode=='siguo'){ - for(var i=0;i=8){ - j-=8; + } else if (_status.mode == "jiange") { + var list = ["shumech", "shu", "shuboss", "shu", "wei", "weiboss", "wei", "weimech"]; + var pos = Math.floor(Math.random() * 8); + for (var i = 0; i < 8; i++) { + var j = pos + i; + if (j >= 8) { + j -= 8; } - if(list[i][0]=='w'){ - game.players[j].side=true; - game.players[j].setIdentity('wei'); - game.players[j].identity='wei'; + if (list[i][0] == "w") { + game.players[j].side = true; + game.players[j].setIdentity("wei"); + game.players[j].identity = "wei"; + } else { + game.players[j].side = false; + game.players[j].setIdentity("shu"); + game.players[j].identity = "shu"; } - else{ - game.players[j].side=false; - game.players[j].setIdentity('shu'); - game.players[j].identity='shu'; - } - if(list[i].indexOf('mech')!=-1){ - game.players[j].type='mech'; - } - else if(list[i].indexOf('boss')!=-1){ - game.players[j].type='boss'; - } - else{ - game.players[j].type='human'; + if (list[i].indexOf("mech") != -1) { + game.players[j].type = "mech"; + } else if (list[i].indexOf("boss") != -1) { + game.players[j].type = "boss"; + } else { + game.players[j].type = "human"; } game.players[i].getId(); } game.chooseCharacterJiange(); - } - else if(_status.mode=='three'){ + } else if (_status.mode == "three") { game.chooseCharacterThree(); - } - else{ + } else { game.chooseCharacter(); } - "step 3" - var players=get.players(lib.sort.position); - var info=[]; - for(var i=0;i= 4); } - else{ - info.push(lib.storage.single_control&&game.players.length>=4); - } - game.addVideo('init',null,info); - event.trigger('gameStart'); - if(_status.connectMode){ - if(_status.mode=='1v1'){ - _status.first_less=true; + game.addVideo("init", null, info); + event.trigger("gameStart"); + if (_status.connectMode) { + if (_status.mode == "1v1") { + _status.first_less = true; game.gameDraw(_status.firstChoose.next); game.phaseLoop(_status.firstChoose.next); - } - else if(_status.mode=='2v2'||_status.mode=='3v3'){ - _status.first_less=true; - var firstChoose=(_status.firstAct||game.players.randomGet()); - if(firstChoose.next.side==firstChoose.side){ - firstChoose=firstChoose.next; + } else if (_status.mode == "2v2" || _status.mode == "3v3") { + _status.first_less = true; + var firstChoose = _status.firstAct || game.players.randomGet(); + if (firstChoose.next.side == firstChoose.side) { + firstChoose = firstChoose.next; } - game.gameDraw(firstChoose,function(player){ - if(lib.configOL.replace_handcard&&player==firstChoose.previousSeat){ + game.gameDraw(firstChoose, function (player) { + if (lib.configOL.replace_handcard && player == firstChoose.previousSeat) { return 5; } return 4; }); game.phaseLoop(firstChoose); - } - else if(_status.mode=='guandu'){ + } else if (_status.mode == "guandu") { game.gameDraw(_status.firstAct); game.phaseLoop(_status.firstAct); - } - else if(_status.mode=='4v4'){ - game.gameDraw(_status.firstAct,function(player){ - if(player==_status.firstAct.previousSeat){ + } else if (_status.mode == "4v4") { + game.gameDraw(_status.firstAct, function (player) { + if (player == _status.firstAct.previousSeat) { return 5; } return 4; }); - game.replaceHandcards(_status.firstAct.previous,_status.firstAct.previous.previous); + game.replaceHandcards(_status.firstAct.previous, _status.firstAct.previous.previous); game.phaseLoop(_status.firstAct); } event.finish(); - } - else{ - if(_status.mode=='guandu'){ - game.gameDraw(_status.firstAct,4); + } else { + if (_status.mode == "guandu") { + game.gameDraw(_status.firstAct, 4); game.phaseLoop(_status.firstAct); - } - else if(_status.mode=='two'){ - _status.first_less=true; - _status.first_less_forced=true; - var firstChoose=_status.firstAct; - game.gameDraw(firstChoose,function(player){ - if(player==_status.firstAct.previousSeat&&get.config('replace_handcard_two')){ + } else if (_status.mode == "two") { + _status.first_less = true; + _status.first_less_forced = true; + var firstChoose = _status.firstAct; + game.gameDraw(firstChoose, function (player) { + if (player == _status.firstAct.previousSeat && get.config("replace_handcard_two")) { return 5; } return 4; }); game.phaseLoop(firstChoose); - } - else if(_status.mode=='endless'){ - _status.first_less=true; - _status.first_less_forced=true; - var firstChoose=_status.firstAct; + } else if (_status.mode == "endless") { + _status.first_less = true; + _status.first_less_forced = true; + var firstChoose = _status.firstAct; game.gameDraw(firstChoose); game.phaseLoop(firstChoose); - } - else if(_status.mode=='four'){ - game.gameDraw(_status.firstAct,function(player){ - if(player==_status.firstAct.previousSeat){ + } else if (_status.mode == "four") { + game.gameDraw(_status.firstAct, function (player) { + if (player == _status.firstAct.previousSeat) { return 5; } return 4; }); - if(game.me==_status.firstAct.previous||game.me==_status.firstAct.previous.previous){ - game.me.chooseBool('是否置换手牌?'); - event.replaceCard=true; + if ( + game.me == _status.firstAct.previous || + game.me == _status.firstAct.previous.previous + ) { + game.me.chooseBool("是否置换手牌?"); + event.replaceCard = true; } - } - else if(_status.mode=='siguo'){ - _status.siguoai=[ - [-7.5,-2,0,-4.5,-6,-7.5], - [-7.5,-2,0,-4.5,-6,-7.5], - [-6,-6,-1,-4.5,-6,-7.5], - [-6,-3,0,-3,-3,-6], - [-6,-3,0,-3,-3,-6], - [-6,-6,-6,-6,-6,-6], + } else if (_status.mode == "siguo") { + _status.siguoai = [ + [-7.5, -2, 0, -4.5, -6, -7.5], + [-7.5, -2, 0, -4.5, -6, -7.5], + [-6, -6, -1, -4.5, -6, -7.5], + [-6, -3, 0, -3, -3, -6], + [-6, -3, 0, -3, -3, -6], + [-6, -6, -6, -6, -6, -6], ].randomGet(); - var firstChoose=_status.firstAct; + var firstChoose = _status.firstAct; game.gameDraw(firstChoose); game.phaseLoop(firstChoose); - } - else if(_status.mode=='jiange'){ + } else if (_status.mode == "jiange") { var firstAct; - for(var i=0;i1){ - for(var i=0;i 1) { + for (var i = 0; i < game.players.length - 1; i++) { + if (game.players[i].side != game.players[i + 1].side) { var actcount; - if(Math.random()<0.5){ - actcount=i; - } - else{ - if(i>=lib.storage.number){ - actcount=i-lib.storage.number; - } - else{ - actcount=i+lib.storage.number; + if (Math.random() < 0.5) { + actcount = i; + } else { + if (i >= lib.storage.number) { + actcount = i - lib.storage.number; + } else { + actcount = i + lib.storage.number; } } - if(actcount>0){ + if (actcount > 0) { actcount--; + } else { + actcount = game.players.length - 1; } - else{ - actcount=game.players.length-1; - } - firstAct=game.players[actcount]; + firstAct = game.players[actcount]; break; } } - } - else{ - firstAct=game.players[Math.floor(Math.random()*game.players.length)]; + } else { + firstAct = game.players[Math.floor(Math.random() * game.players.length)]; } } - game.gameDraw(firstAct,4); - _status.first_less=true; - _status.round=0; - if(lib.storage.single_control){ - game.addGlobalSkill('autoswap'); - if(game.players.length>2&&lib.config.show_handcardbutton){ - ui.versushs=ui.create.system('手牌',null,true); - lib.setPopped(ui.versushs,game.versusHoverHandcards,220); + game.gameDraw(firstAct, 4); + _status.first_less = true; + _status.round = 0; + if (lib.storage.single_control) { + game.addGlobalSkill("autoswap"); + if (game.players.length > 2 && lib.config.show_handcardbutton) { + ui.versushs = ui.create.system("手牌", null, true); + lib.setPopped(ui.versushs, game.versusHoverHandcards, 220); } } - _status.enemyCount=ui.create.system('杀敌: '+get.cnNumber(0,true),null,true); - _status.friendCount=ui.create.system('阵亡: '+get.cnNumber(0,true),null,true); + _status.enemyCount = ui.create.system("杀敌: " + get.cnNumber(0, true), null, true); + _status.friendCount = ui.create.system("阵亡: " + get.cnNumber(0, true), null, true); - lib.setPopped(_status.friendCount,game.versusHoverFriend); - lib.setPopped(_status.enemyCount,game.versusHoverEnemy); + lib.setPopped(_status.friendCount, game.versusHoverFriend); + lib.setPopped(_status.enemyCount, game.versusHoverEnemy); - if(lib.storage.zhu){ + if (lib.storage.zhu) { game.versusPhaseLoop(firstAct); - } - else{ + } else { game.versusPhaseLoop(firstAct); } } - if(_status.mode!='four'){ + if (_status.mode != "four") { event.finish(); } } - "step 4" - if(event.replaceCard&&result.bool){ - var hs=game.me.getCards('h'); - for(var i=0;i侯选人数:'+lib.configOL.choice_num+'人'); - uiintro.add('
          替补人数:'+lib.configOL.replace_number+'人'); + getRoomInfo: function (uiintro) { + if (lib.configOL.versus_mode == "1v1") { + uiintro.add('
          侯选人数:' + lib.configOL.choice_num + "人"); + uiintro.add('
          替补人数:' + lib.configOL.replace_number + "人"); } - if(lib.configOL.versus_mode=='2v2'||lib.configOL.versus_mode=='3v3'){ - uiintro.add('
          四号位保护:'+(lib.configOL.replace_handcard?'开启':'关闭')); - if(lib.configOL.versus_mode=='2v2') uiintro.add('
          四号位【飞扬】:'+(lib.configOL.olfeiyang_four?'开启':'关闭')); + if (lib.configOL.versus_mode == "2v2" || lib.configOL.versus_mode == "3v3") { + uiintro.add( + '
          四号位保护:' + + (lib.configOL.replace_handcard ? "开启" : "关闭") + ); + if (lib.configOL.versus_mode == "2v2") + uiintro.add( + '
          四号位【飞扬】:' + + (lib.configOL.olfeiyang_four ? "开启" : "关闭") + ); } - var last=uiintro.add('
          出牌时限:'+lib.configOL.choose_timeout+'秒'); + var last = uiintro.add( + '
          出牌时限:' + lib.configOL.choose_timeout + "秒" + ); // uiintro.add('
          屏蔽弱将:'+(lib.configOL.ban_weak?'开启':'关闭')); // var last=uiintro.add('
          屏蔽强将:'+(lib.configOL.ban_strong?'开启':'关闭')); - if(lib.configOL.banned.length){ - last=uiintro.add('
          禁用武将:'+get.translation(lib.configOL.banned)); + if (lib.configOL.banned.length) { + last = uiintro.add( + '
          禁用武将:' + get.translation(lib.configOL.banned) + ); } - if(lib.configOL.bannedcards.length){ - last=uiintro.add('
          禁用卡牌:'+get.translation(lib.configOL.bannedcards)); + if (lib.configOL.bannedcards.length) { + last = uiintro.add( + '
          禁用卡牌:' + get.translation(lib.configOL.bannedcards) + ); } - last.style.paddingBottom='8px'; + last.style.paddingBottom = "8px"; }, - getVideoName:function(){ - if(_status.mode=='three'){ - var zhu=game.findPlayer2(function(current){ - return current.side==game.me.side&¤t.identity=='zhu'; + getVideoName: function () { + if (_status.mode == "three") { + var zhu = game.findPlayer2(function (current) { + return current.side == game.me.side && current.identity == "zhu"; }); - var str=(game.me.side?'暖/':'冷/')+get.translation(zhu.previousSeat.name1)+'/'+get.translation(zhu.name1)+'/'+get.translation(zhu.nextSeat.name1); - return ['统率三军',str] + var str = + (game.me.side ? "暖/" : "冷/") + + get.translation(zhu.previousSeat.name1) + + "/" + + get.translation(zhu.name1) + + "/" + + get.translation(zhu.nextSeat.name1); + return ["统率三军", str]; } - var str=get.translation(game.me.name1); - if(game.me.name2){ - str+='/'+get.translation(game.me.name2); + var str = get.translation(game.me.name1); + if (game.me.name2) { + str += "/" + get.translation(game.me.name2); } 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 + 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; } } - return [str,str2]; + return [str, str2]; }, - addRecord:function(bool){ - if(typeof bool=='boolean'){ - var data=lib.config.gameRecord.versus.data; - var identity=get.cnNumber(lib.storage.number)+'人'; - if(!data[identity]){ - data[identity]=[0,0]; + addRecord: function (bool) { + if (typeof bool == "boolean") { + var data = lib.config.gameRecord.versus.data; + var identity = get.cnNumber(lib.storage.number) + "人"; + if (!data[identity]) { + data[identity] = [0, 0]; } - if(bool){ + if (bool) { data[identity][0]++; - } - else{ + } else { data[identity][1]++; } - var list=['一人','两人','三人']; - var str=''; - for(var i=0;i'; + var list = ["一人", "两人", "三人"]; + var str = ""; + for (var i = 0; i < list.length; i++) { + if (data[list[i]]) { + str += + list[i] + ":" + data[list[i]][0] + "胜" + " " + data[list[i]][1] + "负
          "; } } - lib.config.gameRecord.versus.str=str; - game.saveConfig('gameRecord',lib.config.gameRecord); + lib.config.gameRecord.versus.str = str; + game.saveConfig("gameRecord", lib.config.gameRecord); } }, - chooseCharacterJiange:function(){ - var next=game.createEvent('chooseCharacter'); - next.showConfig=true; - next.setContent(function(){ - 'step 0' - ui.arena.classList.add('choose-character'); - for(var i in lib.characterPack.mode_versus){ - lib.character[i]=lib.characterPack.mode_versus[i]; - if(!lib.character[i][4]){ - lib.character[i][4]=[]; + chooseCharacterJiange: function () { + var next = game.createEvent("chooseCharacter"); + next.showConfig = true; + next.setContent(function () { + "step 0"; + ui.arena.classList.add("choose-character"); + for (var i in lib.characterPack.mode_versus) { + lib.character[i] = lib.characterPack.mode_versus[i]; + if (!lib.character[i][4]) { + lib.character[i][4] = []; } } - lib.characterIntro.boss_liedixuande=lib.characterIntro.liubei; - lib.characterIntro.boss_gongshenyueying=lib.characterIntro.huangyueying; - lib.characterIntro.boss_tianhoukongming=lib.characterIntro.shen_zhugeliang; - lib.characterIntro.boss_yuhuoshiyuan=lib.characterIntro.pangtong; - lib.characterIntro.boss_qiaokuijunyi=lib.characterIntro.zhenghe; - lib.characterIntro.boss_jiarenzidan=lib.characterIntro.caozhen; - lib.characterIntro.boss_duanyuzhongda=lib.characterIntro.simayi; - lib.characterIntro.boss_juechenmiaocai=lib.characterIntro.xiahouyuan; - lib.characterIntro.boss_kumuyuanrang=lib.characterIntro.xiahoudun; - lib.characterIntro.boss_baijiwenyuan=lib.characterIntro.zhangliao; - lib.characterIntro.boss_yihanyunchang=lib.characterIntro.guanyu; - lib.characterIntro.boss_fuweizilong=lib.characterIntro.zhaoyun; - 'step 1' - for(var i in lib.skill){ - if(lib.skill[i].changeSeat){ - lib.skill[i]={}; - if(lib.translate[i+'_info']){ - lib.translate[i+'_info']='此模式下不可用'; + lib.characterIntro.boss_liedixuande = lib.characterIntro.liubei; + lib.characterIntro.boss_gongshenyueying = lib.characterIntro.huangyueying; + lib.characterIntro.boss_tianhoukongming = lib.characterIntro.shen_zhugeliang; + lib.characterIntro.boss_yuhuoshiyuan = lib.characterIntro.pangtong; + lib.characterIntro.boss_qiaokuijunyi = lib.characterIntro.zhenghe; + lib.characterIntro.boss_jiarenzidan = lib.characterIntro.caozhen; + lib.characterIntro.boss_duanyuzhongda = lib.characterIntro.simayi; + lib.characterIntro.boss_juechenmiaocai = lib.characterIntro.xiahouyuan; + lib.characterIntro.boss_kumuyuanrang = lib.characterIntro.xiahoudun; + lib.characterIntro.boss_baijiwenyuan = lib.characterIntro.zhangliao; + lib.characterIntro.boss_yihanyunchang = lib.characterIntro.guanyu; + lib.characterIntro.boss_fuweizilong = lib.characterIntro.zhaoyun; + "step 1"; + for (var i in lib.skill) { + if (lib.skill[i].changeSeat) { + lib.skill[i] = {}; + if (lib.translate[i + "_info"]) { + lib.translate[i + "_info"] = "此模式下不可用"; } } } - var list={ - weilist:[],shulist:[], - weimech:[],shumech:[], - weiboss:[],shuboss:[], - } - event.list=list; - if(lib.characterPack.boss){ - for(var i in lib.characterPack.boss){ - if(!lib.character[i]&&lib.characterPack.boss[i][4]){ - if(lib.characterPack.boss[i][4].includes('jiangeboss')|| - lib.characterPack.boss[i][4].includes('jiangemech')){ - lib.character[i]=lib.characterPack.boss[i]; + var list = { + weilist: [], + shulist: [], + weimech: [], + shumech: [], + weiboss: [], + shuboss: [], + }; + event.list = list; + if (lib.characterPack.boss) { + for (var i in lib.characterPack.boss) { + if (!lib.character[i] && lib.characterPack.boss[i][4]) { + if ( + lib.characterPack.boss[i][4].includes("jiangeboss") || + lib.characterPack.boss[i][4].includes("jiangemech") + ) { + lib.character[i] = lib.characterPack.boss[i]; } } } } - for(var i in lib.character){ - if(lib.character[i][4]){ - if(lib.character[i][4].includes('jiangeboss')){ - list[lib.character[i][1]+'boss'].push(i);continue; - } - else if(lib.character[i][4].includes('jiangemech')){ - list[lib.character[i][1]+'mech'].push(i);continue; + for (var i in lib.character) { + if (lib.character[i][4]) { + if (lib.character[i][4].includes("jiangeboss")) { + list[lib.character[i][1] + "boss"].push(i); + continue; + } else if (lib.character[i][4].includes("jiangemech")) { + list[lib.character[i][1] + "mech"].push(i); + continue; } } - if(lib.filter.characterDisabled(i)) continue; - if(get.is.double(i)) continue; - if(lib.character[i][1]=='wei'){ + if (lib.filter.characterDisabled(i)) continue; + if (get.is.double(i)) continue; + if (lib.character[i][1] == "wei") { list.weilist.push(i); - } - else if(lib.character[i][1]=='shu'){ + } else if (lib.character[i][1] == "shu") { list.shulist.push(i); } } var dialog; - switch(game.me.type){ - case 'human': - for(var i=0;i当前分数:
          '+(lib.storage.ladder.current+(_status.ladder_tmp?40:0))+'
          '); - uiintro.add('
          历史最高:
          '+lib.storage.ladder.top+'
          '); - uiintro.content.lastChild.style.paddingBottom='8px'; - return uiintro; - },180); - _status.ladder=true; - _status.ladder_mmr=0; + ui.ladder = ui.create.system( + game.getLadderName(lib.storage.ladder.current), + null, + true + ); + lib.setPopped( + ui.ladder, + function (uiintro) { + var uiintro = ui.create.dialog("hidden"); + uiintro.add( + '
          当前分数:
          ' + + (lib.storage.ladder.current + (_status.ladder_tmp ? 40 : 0)) + + "
          " + ); + uiintro.add( + '
          历史最高:
          ' + + lib.storage.ladder.top + + "
          " + ); + uiintro.content.lastChild.style.paddingBottom = "8px"; + return uiintro; + }, + 180 + ); + _status.ladder = true; + _status.ladder_mmr = 0; } - event.addSetting=function(){ - var cs=function(link,node){ + event.addSetting = function () { + var cs = function (link, node) { game.swapPlayer(node._link); - _status.rechoose=true; - for(var i=0;ib?1:-1; - } - if(lib.storage.choice=='∞'){ + return a > b ? 1 : -1; + }; + if (lib.storage.choice == "∞") { list.sort(sortByGroup); - } - else{ + } else { list.randomSort(); } - _status.list=list; - var choice=(lib.storage.choice=='∞')?list.length:lib.storage.choice; - event.dialog=ui.create.dialog('选择角色',[list.slice(0,choice),'character']); - event.dialog.classList.add('fixed'); + _status.list = list; + var choice = lib.storage.choice == "∞" ? list.length : lib.storage.choice; + event.dialog = ui.create.dialog("选择角色", [list.slice(0, choice), "character"]); + event.dialog.classList.add("fixed"); // for(var i=0;i=dialog.versus_number.link+dialog.replace_number.link){ - event.fill.firstChild.innerHTML='开始'; - _status.choosefinished=true; - if(ui.cheat){ + event.custom.add.window = function () { + var dialog = _status.event.dialog; + if ( + _status.friend.length == _status.enemy.length && + _status.friend.length >= dialog.versus_number.link + dialog.replace_number.link + ) { + event.fill.firstChild.innerHTML = "开始"; + _status.choosefinished = true; + if (ui.cheat) { ui.cheat.close(); delete ui.cheat; } } - game.save('zhu',dialog.versus_zhu.link); - if(lib.storage.zhu){ + game.save("zhu", dialog.versus_zhu.link); + if (lib.storage.zhu) { // dialog.versus_only_zhu.parentNode.classList.remove('disabled'); - dialog.versus_main_zhu.parentNode.classList.remove('disabled'); - } - else{ + dialog.versus_main_zhu.parentNode.classList.remove("disabled"); + } else { // dialog.versus_only_zhu.parentNode.classList.add('disabled'); - dialog.versus_main_zhu.parentNode.classList.add('disabled'); + dialog.versus_main_zhu.parentNode.classList.add("disabled"); } // game.save('only_zhu',dialog.versus_only_zhu.link); - game.save('main_zhu',dialog.versus_main_zhu.link); - game.save('assign_enemy',dialog.versus_assign_enemy.link); - game.save('seat_order',dialog.versus_seat_order.link); + game.save("main_zhu", dialog.versus_main_zhu.link); + game.save("assign_enemy", dialog.versus_assign_enemy.link); + game.save("seat_order", dialog.versus_seat_order.link); // game.save('cross_seat',dialog.versus_cross_seat.link); - game.save('noreplace_end',dialog.versus_noreplace_end.link); - game.save('single_control',dialog.versus_single_control.link); - switch(lib.storage.seat_order){ - case '交叉':lib.storage.cross_seat=true;lib.storage.random_seat=false;break; - case '随机':lib.storage.cross_seat=false;lib.storage.random_seat=true;break; - default:lib.storage.cross_seat=false;lib.storage.random_seat=false; + game.save("noreplace_end", dialog.versus_noreplace_end.link); + game.save("single_control", dialog.versus_single_control.link); + switch (lib.storage.seat_order) { + case "交叉": + lib.storage.cross_seat = true; + lib.storage.random_seat = false; + break; + case "随机": + lib.storage.cross_seat = false; + lib.storage.random_seat = true; + break; + default: + lib.storage.cross_seat = false; + lib.storage.random_seat = false; } - game.saveConfig('first_less',dialog.versus_first_less.link,true); - game.save('number',dialog.versus_number.link); - game.save('versus_reward',dialog.versus_reward.link); - game.save('versus_punish',dialog.versus_punish.link); - game.save('replace_number',dialog.replace_number.link); - game.save('choice',dialog.choice.link); - var count,i; - if(dialog.buttons.length>lib.storage.choice){ - count=dialog.buttons.length-lib.storage.choice; - var removed=[]; - for(i=dialog.buttons.length-1;i>=0&&count>0;i--){ - if(dialog.buttons[i].classList.contains('target')==false&& - dialog.buttons[i].classList.contains('glow')==false){ + game.saveConfig("first_less", dialog.versus_first_less.link, true); + game.save("number", dialog.versus_number.link); + game.save("versus_reward", dialog.versus_reward.link); + game.save("versus_punish", dialog.versus_punish.link); + game.save("replace_number", dialog.replace_number.link); + game.save("choice", dialog.choice.link); + var count, i; + if (dialog.buttons.length > lib.storage.choice) { + count = dialog.buttons.length - lib.storage.choice; + var removed = []; + for (i = dialog.buttons.length - 1; i >= 0 && count > 0; i--) { + if ( + dialog.buttons[i].classList.contains("target") == false && + dialog.buttons[i].classList.contains("glow") == false + ) { dialog.buttons[i].remove(); _status.list.remove(dialog.buttons[i].link); - removed.push(dialog.buttons[i].link) - dialog.buttons.splice(i,1); + removed.push(dialog.buttons[i].link); + dialog.buttons.splice(i, 1); count--; } } - for(i=0;i=4){ - ui.arena.setNumber(parseInt(ui.arena.dataset.number)+1); - for(var i=0;i= 4) { + ui.arena.setNumber(parseInt(ui.arena.dataset.number) + 1); + for (var i = 0; i < game.players.length; i++) { + game.players[i].dataset.position = parseInt(game.players[i].dataset.position) + 1; } - game.singleHandcard=true; - ui.arena.classList.add('single-handcard'); - ui.window.classList.add('single-handcard'); - ui.fakeme=ui.create.div('.fakeme.avatar'); + game.singleHandcard = true; + ui.arena.classList.add("single-handcard"); + ui.window.classList.add("single-handcard"); + ui.fakeme = ui.create.div(".fakeme.avatar"); // ui.fakeme.line=lib.element.player.line; // ui.fakemebg=ui.create.div('.avatar',ui.fakeme).hide(); } - _status.prepareArena=true; + _status.prepareArena = true; ui.create.me(); - if(ui.fakeme){ + if (ui.fakeme) { ui.me.appendChild(ui.fakeme); } - var position,i; - if(lib.storage.zhu&&lib.storage.only_zhu) position=Math.ceil(num/2)-1; - else position=Math.floor(Math.random()*num) - game.friend=[]; - game.enemy=[]; - if(lib.storage.random_seat){ - var players=game.players.slice(0); + var position, i; + if (lib.storage.zhu && lib.storage.only_zhu) position = Math.ceil(num / 2) - 1; + else position = Math.floor(Math.random() * num); + game.friend = []; + game.enemy = []; + if (lib.storage.random_seat) { + var players = game.players.slice(0); game.friend.push(game.me); players.remove(game.me); - for(i=0;i=4){ + _status.friend.splice(0, num); + _status.enemy.splice(0, num); + if (lib.storage.single_control && game.players.length >= 4) { // ui.fakemebg.show(); game.onSwapControl(); } }); }, - chooseCharacterOL:function(){ - switch(lib.configOL.versus_mode){ - case '1v1':game.chooseCharacterOL1();break; - case '2v2':game.chooseCharacterOL2();break; - case '3v3':game.chooseCharacterOL3();break; - case '4v4':game.chooseCharacterOL4();break; - case 'guandu':game.chooseCharacterOLGuandu();break; + chooseCharacterOL: function () { + switch (lib.configOL.versus_mode) { + case "1v1": + game.chooseCharacterOL1(); + break; + case "2v2": + game.chooseCharacterOL2(); + break; + case "3v3": + game.chooseCharacterOL3(); + break; + case "4v4": + game.chooseCharacterOL4(); + break; + case "guandu": + game.chooseCharacterOLGuandu(); + break; } }, - chooseCharacterOLGuandu:function(){ - var next=game.createEvent('chooseCharacter'); - 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'], + chooseCharacterOLGuandu: function () { + var next = game.createEvent("chooseCharacter"); + 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(); - 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); + 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]; } - 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; + 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].node.identity.dataset.color = get.translation( + game.players[i].side + "Color" + ); game.players[i].getId(); } - var side=true; - var map={}; - 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); + var side = true; + var map = {}; + 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]; } - else{ - game.players[i].side=!side; - game.players[i].identity=list[i]; - } - map[game.players[i].playerid]=[game.players[i].side,game.players[i].identity]; + map[game.players[i].playerid] = [game.players[i].side, game.players[i].identity]; } - var evt_list=[['huoshaowuchao','chunyuqiong'],['liangcaokuifa','sp_xuyou'],['zhanyanliangzhuwenchou','jsp_guanyu'],['shishengshibai','re_guojia'],['xutuhuanjin','yj_jushou'],['liangjunxiangchi','yj_jushou'],['jianshoudaiyuan','tianfeng'],['yiruoshengqiang','re_caocao'],['shichongerjiao','sp_xuyou']].randomGet(); - var evt=evt_list[0],character=evt_list[1]; + var evt_list = [ + ["huoshaowuchao", "chunyuqiong"], + ["liangcaokuifa", "sp_xuyou"], + ["zhanyanliangzhuwenchou", "jsp_guanyu"], + ["shishengshibai", "re_guojia"], + ["xutuhuanjin", "yj_jushou"], + ["liangjunxiangchi", "yj_jushou"], + ["jianshoudaiyuan", "tianfeng"], + ["yiruoshengqiang", "re_caocao"], + ["shichongerjiao", "sp_xuyou"], + ].randomGet(); + var evt = evt_list[0], + character = evt_list[1]; game.addGlobalSkill(evt); - var func=function(map,evt,character){ - for(var i in map){ - var player=lib.playerOL[i]; - if(player){ - player.side=map[i][0]; - player.identity=map[i][1]; + var func = function (map, evt, character) { + for (var i in map) { + var player = lib.playerOL[i]; + if (player) { + player.side = map[i][0]; + player.identity = map[i][1]; player.setIdentity(); - player.node.identity.dataset.color=get.translation(player.side+'Color'); - if(player.identity=='zhu'){ - game[player.side+'Zhu']=player; - player.isZhu=true; + player.node.identity.dataset.color = get.translation(player.side + "Color"); + if (player.identity == "zhu") { + game[player.side + "Zhu"] = player; + player.isZhu = true; } } } - ui.arena.classList.add('choose-character'); - if(evt=='shishengshibai'){ - ui.guanduInfo=get.is.phoneLayout()?ui.create.div('.touchinfo.left',ui.window):ui.create.div(ui.gameinfo); - ui.guanduInfo.innerHTML='十胜十败(0)'; + ui.arena.classList.add("choose-character"); + if (evt == "shishengshibai") { + ui.guanduInfo = get.is.phoneLayout() + ? ui.create.div(".touchinfo.left", ui.window) + : ui.create.div(ui.gameinfo); + ui.guanduInfo.innerHTML = "十胜十败(0)"; } - const showGuanduEvent=function(evt,character){ - if(ui['GuanduEvent_'+evt]) return; - ui['GuanduEvent_'+evt]=ui.create.system(get.translation(evt),null,true); - lib.setPopped(ui['GuanduEvent_'+evt],function(){ - var uiintro=ui.create.dialog('hidden'); - uiintro.add(get.translation(evt)); - uiintro.add('
          '+get.translation(evt+'_info')+'
          '); - var ul=uiintro.querySelector('ul'); - if(ul) ul.style.width='180px'; - uiintro.add(ui.create.div('.placeholder')); - return uiintro; - },250); + const showGuanduEvent = function (evt, character) { + if (ui["GuanduEvent_" + evt]) return; + ui["GuanduEvent_" + evt] = ui.create.system(get.translation(evt), null, true); + lib.setPopped( + ui["GuanduEvent_" + evt], + function () { + var uiintro = ui.create.dialog("hidden"); + uiintro.add(get.translation(evt)); + uiintro.add( + '
          ' + + get.translation(evt + "_info") + + "
          " + ); + var ul = uiintro.querySelector("ul"); + if (ul) ul.style.width = "180px"; + uiintro.add(ui.create.div(".placeholder")); + return uiintro; + }, + 250 + ); }; - for(const i in lib.playerOL){ - const target=lib.playerOL[i]; - if(target==game.me){ - showGuanduEvent(evt,character); - } - else if(target.isOnline2()){ - target.send(showGuanduEvent,evt,character); + for (const i in lib.playerOL) { + const target = lib.playerOL[i]; + if (target == game.me) { + showGuanduEvent(evt, character); + } else if (target.isOnline2()) { + target.send(showGuanduEvent, evt, character); } } - if(lib.config.background_speak) game.playAudio('skill',evt); - var dialog=ui.create.dialog('本局特殊事件:'+get.translation(evt)); - dialog.addText(get.translation(evt+'_info'),false); - dialog.add([[character],'character']); - setTimeout(function(){ + if (lib.config.background_speak) game.playAudio("skill", evt); + var dialog = ui.create.dialog("本局特殊事件:" + get.translation(evt)); + dialog.addText(get.translation(evt + "_info"), false); + dialog.add([[character], "character"]); + setTimeout(function () { dialog.close(); - },5000) + }, 5000); }; - game.broadcastAll(func,map,evt,character); - _status.firstAct=game.falseZhu; - game.delay(0,5000); - "step 1" - game.falseZhu.chooseButtonOL([ - [game.falseZhu,[ - '请选择武将', - [['caocao'],'characterx'], - ],true], - [game.trueZhu,[ - '请选择武将', - [['re_yuanshao'],'characterx'], - ],true] - ],function(player,result){ - if(game.online||player==game.me){ - player.init(result.links[0]); + game.broadcastAll(func, map, evt, character); + _status.firstAct = game.falseZhu; + game.delay(0, 5000); + "step 1"; + game.falseZhu.chooseButtonOL( + [ + [game.falseZhu, ["请选择武将", [["caocao"], "characterx"]], true], + [game.trueZhu, ["请选择武将", [["re_yuanshao"], "characterx"]], true], + ], + function (player, result) { + if (game.online || player == game.me) { + player.init(result.links[0]); + } } - }) - "step 2" - game.broadcastAll(function(result){ - for(var i in result){ - if(!lib.playerOL[i].name){ + ); + "step 2"; + game.broadcastAll(function (result) { + for (var i in result) { + if (!lib.playerOL[i].name) { lib.playerOL[i].init(result[i].links[0]); } lib.playerOL[i].hp++; lib.playerOL[i].maxHp++; lib.playerOL[i].update(); } - },result); - "step 3" - event.falseList=['xiahouyuan','litong','zangba','manchong','xunyu','guojia','zhangliao','xuhuang','caohong','jsp_guanyu','hanhaoshihuan','caoren','yujin','liuye','chengyu','xunyou','zhangxiu','sp_jiaxu'].filter(function(name){ - if(lib.characterReplace[name]){ + }, result); + "step 3"; + event.falseList = [ + "xiahouyuan", + "litong", + "zangba", + "manchong", + "xunyu", + "guojia", + "zhangliao", + "xuhuang", + "caohong", + "jsp_guanyu", + "hanhaoshihuan", + "caoren", + "yujin", + "liuye", + "chengyu", + "xunyou", + "zhangxiu", + "sp_jiaxu", + ].filter(function (name) { + if (lib.characterReplace[name]) { let goon = false; - for(let i of lib.characterReplace[name]){ - if(lib.character[i]){ - lib.character[i][1] = 'wei'; + for (let i of lib.characterReplace[name]) { + if (lib.character[i]) { + lib.character[i][1] = "wei"; goon = true; } } return goon; - } - else if(lib.character[name]){ - lib.character[name][1] = 'wei'; + } else if (lib.character[name]) { + lib.character[name][1] = "wei"; return true; } return false; }); - event.trueList=['xinping','hanmeng','gaogan','yuantanyuanshang','lvkuanglvxiang','xinpi','xunchen','sp_ol_zhanghe','chenlin','jsp_liubei','yj_jushou','guotufengji','gaolan','xuyou','tianfeng','chunyuqiong','shenpei'].filter(function(name){ - if(lib.characterReplace[name]){ + event.trueList = [ + "xinping", + "hanmeng", + "gaogan", + "yuantanyuanshang", + "lvkuanglvxiang", + "xinpi", + "xunchen", + "sp_ol_zhanghe", + "chenlin", + "jsp_liubei", + "yj_jushou", + "guotufengji", + "gaolan", + "xuyou", + "tianfeng", + "chunyuqiong", + "shenpei", + ].filter(function (name) { + if (lib.characterReplace[name]) { let goon = false; - for(let i of lib.characterReplace[name]){ - if(lib.character[i]){ - lib.character[i][1] = 'qun'; + for (let i of lib.characterReplace[name]) { + if (lib.character[i]) { + lib.character[i][1] = "qun"; goon = true; } } return goon; - } - else if(lib.character[name]){ - lib.character[name][1] = 'qun'; + } else if (lib.character[name]) { + lib.character[name][1] = "qun"; return true; } return false; }); - game.broadcast(function(list1,list2){ - for(let name of list1){ - if(lib.characterReplace[name]){ - for(let i of lib.characterReplace[name]){ - if(lib.character[i]){ - lib.character[i][1] = 'wei'; + game.broadcast( + function (list1, list2) { + for (let name of list1) { + if (lib.characterReplace[name]) { + for (let i of lib.characterReplace[name]) { + if (lib.character[i]) { + lib.character[i][1] = "wei"; + } } + } else if (lib.character[name]) { + lib.character[name][1] = "wei"; } } - else if(lib.character[name]){ - lib.character[name][1] = 'wei'; - } - } - for(let name of list2){ - if(lib.characterReplace[name]){ - for(let i of lib.characterReplace[name]){ - if(lib.character[i]){ - lib.character[i][1] = 'qun'; + for (let name of list2) { + if (lib.characterReplace[name]) { + for (let i of lib.characterReplace[name]) { + if (lib.character[i]) { + lib.character[i][1] = "qun"; + } } + } else if (lib.character[name]) { + lib.character[name][1] = "qun"; } } - else if(lib.character[name]){ - lib.character[name][1] = 'qun'; - } - } - },event.falseList,event.trueList); - event.map={}; - var list=[]; - game.countPlayer(function(current){ - if(current.identity=='zhong'){ - var choice=event[current.side+'List'].randomRemove(2); - event.map[current.playerid]=choice; - list.push([current,['请选择武将',[choice,'characterx']],true]); + }, + event.falseList, + event.trueList + ); + event.map = {}; + var list = []; + game.countPlayer(function (current) { + if (current.identity == "zhong") { + var choice = event[current.side + "List"].randomRemove(2); + event.map[current.playerid] = choice; + list.push([current, ["请选择武将", [choice, "characterx"]], true]); } }); - game.me.chooseButtonOL(list,function(player,result){ - if(game.online||player==game.me){ + game.me.chooseButtonOL(list, function (player, result) { + if (game.online || player == game.me) { player.init(result.links[0]); } }); - "step 4" - for(var i in result){ - if(result[i]=='ai'){ - result[i]=event.map[i].randomRemove(1)[0]; - } - else result[i]=result[i].links[0]; + "step 4"; + for (var i in result) { + if (result[i] == "ai") { + result[i] = event.map[i].randomRemove(1)[0]; + } else result[i] = result[i].links[0]; } - game.broadcastAll(function(result){ - for(var i in result){ - if(!lib.playerOL[i].name) lib.playerOL[i].init(result[i]); + game.broadcastAll(function (result) { + for (var i in result) { + if (!lib.playerOL[i].name) lib.playerOL[i].init(result[i]); } - setTimeout(function(){ - ui.arena.classList.remove('choose-character'); - },500); - },result); + setTimeout(function () { + ui.arena.classList.remove("choose-character"); + }, 500); + }, result); }); }, - chooseCharacterGuandu:function(){ - var next=game.createEvent('chooseCharacter'); - next.setContent(function(){ - 'step 0' + chooseCharacterGuandu: function () { + var next = game.createEvent("chooseCharacter"); + next.setContent(function () { + "step 0"; lib.init.onfree(); - ui.arena.classList.add('choose-character'); - const side=game.me.side.toString(); - event.friendSide=side;event.enemySide=(side=='true'?'false':'true'); - event.zhuList=[['caocao'],['re_yuanshao']]; - event.falseList=['xiahouyuan','litong','zangba','manchong','xunyu','guojia','zhangliao','xuhuang','caohong','jsp_guanyu','hanhaoshihuan','caoren','yujin','liuye','chengyu','xunyou','zhangxiu','sp_jiaxu'].filter(function(name){ - if(lib.characterReplace[name]){ + ui.arena.classList.add("choose-character"); + const side = game.me.side.toString(); + event.friendSide = side; + event.enemySide = side == "true" ? "false" : "true"; + event.zhuList = [["caocao"], ["re_yuanshao"]]; + event.falseList = [ + "xiahouyuan", + "litong", + "zangba", + "manchong", + "xunyu", + "guojia", + "zhangliao", + "xuhuang", + "caohong", + "jsp_guanyu", + "hanhaoshihuan", + "caoren", + "yujin", + "liuye", + "chengyu", + "xunyou", + "zhangxiu", + "sp_jiaxu", + ].filter(function (name) { + if (lib.characterReplace[name]) { let goon = false; - for(let i of lib.characterReplace[name]){ - if(lib.character[i]){ - lib.character[i][1] = 'wei'; + for (let i of lib.characterReplace[name]) { + if (lib.character[i]) { + lib.character[i][1] = "wei"; goon = true; } } return goon; - } - else if(lib.character[name]){ - lib.character[name][1] = 'wei'; + } else if (lib.character[name]) { + lib.character[name][1] = "wei"; return true; } return false; }); - event.trueList=['xinping','hanmeng','gaogan','yuantanyuanshang','lvkuanglvxiang','xinpi','xunchen','sp_ol_zhanghe','chenlin','jsp_liubei','yj_jushou','guotufengji','gaolan','xuyou','tianfeng','chunyuqiong','shenpei'].filter(function(name){ - if(lib.characterReplace[name]){ + event.trueList = [ + "xinping", + "hanmeng", + "gaogan", + "yuantanyuanshang", + "lvkuanglvxiang", + "xinpi", + "xunchen", + "sp_ol_zhanghe", + "chenlin", + "jsp_liubei", + "yj_jushou", + "guotufengji", + "gaolan", + "xuyou", + "tianfeng", + "chunyuqiong", + "shenpei", + ].filter(function (name) { + if (lib.characterReplace[name]) { let goon = false; - for(let i of lib.characterReplace[name]){ - if(lib.character[i]){ - lib.character[i][1] = 'qun'; + for (let i of lib.characterReplace[name]) { + if (lib.character[i]) { + lib.character[i][1] = "qun"; goon = true; } } return goon; - } - else if(lib.character[name]){ - lib.character[name][1] = 'qun'; + } else if (lib.character[name]) { + lib.character[name][1] = "qun"; return true; } return false; }); - 'step 1' - game[event.enemySide+'Zhu'].chooseButton(['请选择你的武将牌',[event.zhuList[event.enemySide=='true'?1:0],'characterx']],true); - 'step 2' - game[event.enemySide+'Zhu'].init(result.links[0]); - game[event.enemySide+'Zhu'].maxHp++; - game[event.enemySide+'Zhu'].hp++; - game[event.enemySide+'Zhu'].update(); - 'step 3' - game.countPlayer(current=>{ - if(current.side.toString()==event.enemySide&¤t.identity=='zhong'){ - let choice=event[event.enemySide+'List'].randomRemove(2)[0]; - if(lib.characterReplace[choice]) choice=lib.characterReplace[choice].randomGet(); + "step 1"; + game[event.enemySide + "Zhu"].chooseButton( + [ + "请选择你的武将牌", + [event.zhuList[event.enemySide == "true" ? 1 : 0], "characterx"], + ], + true + ); + "step 2"; + game[event.enemySide + "Zhu"].init(result.links[0]); + game[event.enemySide + "Zhu"].maxHp++; + game[event.enemySide + "Zhu"].hp++; + game[event.enemySide + "Zhu"].update(); + "step 3"; + game.countPlayer((current) => { + if (current.side.toString() == event.enemySide && current.identity == "zhong") { + let choice = event[event.enemySide + "List"].randomRemove(2)[0]; + if (lib.characterReplace[choice]) + choice = lib.characterReplace[choice].randomGet(); current.init(choice); } }); - 'step 4' - var evt_list=[['huoshaowuchao','chunyuqiong'],['liangcaokuifa','sp_xuyou'],['zhanyanliangzhuwenchou','jsp_guanyu'],['shishengshibai','re_guojia'],['xutuhuanjin','yj_jushou'],['liangjunxiangchi','yj_jushou'],['jianshoudaiyuan','tianfeng'],['yiruoshengqiang','re_caocao'],['shichongerjiao','sp_xuyou']].randomGet(); - var evt=evt_list[0],character=evt_list[1]; + "step 4"; + var evt_list = [ + ["huoshaowuchao", "chunyuqiong"], + ["liangcaokuifa", "sp_xuyou"], + ["zhanyanliangzhuwenchou", "jsp_guanyu"], + ["shishengshibai", "re_guojia"], + ["xutuhuanjin", "yj_jushou"], + ["liangjunxiangchi", "yj_jushou"], + ["jianshoudaiyuan", "tianfeng"], + ["yiruoshengqiang", "re_caocao"], + ["shichongerjiao", "sp_xuyou"], + ].randomGet(); + var evt = evt_list[0], + character = evt_list[1]; game.addGlobalSkill(evt); - const showGuanduEvent=function(evt){ - if(ui['GuanduEvent_'+evt]) return; - ui['GuanduEvent_'+evt]=ui.create.system(get.translation(evt),null,true); - lib.setPopped(ui['GuanduEvent_'+evt],function(){ - var uiintro=ui.create.dialog('hidden'); - uiintro.add(get.translation(evt)); - uiintro.add('
          '+get.translation(evt+'_info')+'
          '); - var ul=uiintro.querySelector('ul'); - if(ul) ul.style.width='180px'; - uiintro.add(ui.create.div('.placeholder')); - return uiintro; - },250); + const showGuanduEvent = function (evt) { + if (ui["GuanduEvent_" + evt]) return; + ui["GuanduEvent_" + evt] = ui.create.system(get.translation(evt), null, true); + lib.setPopped( + ui["GuanduEvent_" + evt], + function () { + var uiintro = ui.create.dialog("hidden"); + uiintro.add(get.translation(evt)); + uiintro.add( + '
          ' + get.translation(evt + "_info") + "
          " + ); + var ul = uiintro.querySelector("ul"); + if (ul) ul.style.width = "180px"; + uiintro.add(ui.create.div(".placeholder")); + return uiintro; + }, + 250 + ); }; showGuanduEvent(evt); - game.broadcastAll(function(evt){ - if(lib.config.background_speak) game.playAudio('skill',evt); - if(evt=='shishengshibai'){ - ui.guanduInfo=get.is.phoneLayout()?ui.create.div('.touchinfo.left',ui.window):ui.create.div(ui.gameinfo); - ui.guanduInfo.innerHTML='十胜十败(0)'; + game.broadcastAll(function (evt) { + if (lib.config.background_speak) game.playAudio("skill", evt); + if (evt == "shishengshibai") { + ui.guanduInfo = get.is.phoneLayout() + ? ui.create.div(".touchinfo.left", ui.window) + : ui.create.div(ui.gameinfo); + ui.guanduInfo.innerHTML = "十胜十败(0)"; } - },evt); - game.me.chooseControl('ok').set('dialog',['###本局特殊事件:'+get.translation(evt)+'###'+get.translation(evt+'_info'),[[character],'character']]); - 'step 5' - game[event.friendSide+'Zhu'].chooseButton(['请选择你的武将牌',[event.zhuList[event.friendSide=='true'?1:0],'characterx']],true); - 'step 6' - if(game[event.friendSide+'Zhu']==game.me){ - game[event.friendSide+'Zhu'].init(result.links[0]); - game[event.friendSide+'Zhu'].maxHp++; - game[event.friendSide+'Zhu'].hp++; - game[event.friendSide+'Zhu'].update(); + }, evt); + game.me + .chooseControl("ok") + .set("dialog", [ + "###本局特殊事件:" + + get.translation(evt) + + "###" + + get.translation(evt + "_info"), + [[character], "character"], + ]); + "step 5"; + game[event.friendSide + "Zhu"].chooseButton( + [ + "请选择你的武将牌", + [event.zhuList[event.friendSide == "true" ? 1 : 0], "characterx"], + ], + true + ); + "step 6"; + if (game[event.friendSide + "Zhu"] == game.me) { + game[event.friendSide + "Zhu"].init(result.links[0]); + game[event.friendSide + "Zhu"].maxHp++; + game[event.friendSide + "Zhu"].hp++; + game[event.friendSide + "Zhu"].update(); + } else event.zhuChoice = result.links[0]; + "step 7"; + if (game.me.identity != "zhu") { + event.choose_me = true; + game.me.chooseButton( + [ + "请选择你的武将牌", + [event[event.friendSide + "List"].randomRemove(2), "characterx"], + ], + true + ); } - else event.zhuChoice=result.links[0]; - 'step 7' - if(game.me.identity!='zhu'){ - event.choose_me=true; - game.me.chooseButton(['请选择你的武将牌',[event[event.friendSide+'List'].randomRemove(2),'characterx']],true); - } - 'step 8' - if(event.choose_me) game.me.init(result.links[0]); - game.countPlayer(function(current){ - if(current!=game.me&¤t.side.toString()==event.friendSide){ - if(current.identity=='zhong'){ - let choice=event[event.friendSide+'List'].randomRemove(2)[0]; - if(lib.characterReplace[choice]) choice = lib.characterReplace[choice].randomGet(); + "step 8"; + if (event.choose_me) game.me.init(result.links[0]); + game.countPlayer(function (current) { + if (current != game.me && current.side.toString() == event.friendSide) { + if (current.identity == "zhong") { + let choice = event[event.friendSide + "List"].randomRemove(2)[0]; + if (lib.characterReplace[choice]) + choice = lib.characterReplace[choice].randomGet(); current.init(choice); - } - else{ + } else { current.init(event.zhuChoice); current.maxHp++; current.hp++; @@ -2903,924 +3308,1041 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } } }); - 'step 9' - setTimeout(function(){ - ui.arena.classList.remove('choose-character'); - },500); + "step 9"; + setTimeout(function () { + ui.arena.classList.remove("choose-character"); + }, 500); }); }, - chooseCharacterOL4:function(){ - var next=game.createEvent('chooseCharacter'); - next.setContent(function(){ - "step 0" - var list=[ - ['zhong','ezhong','ezhong','zhong','zhong','ezhong','ezhong','zhong'], - ['zhong','ezhong','zhong','ezhong','ezhong','zhong','ezhong','zhong'], - ['zhong','ezhong','ezhong','zhong','ezhong','zhong','zhong','ezhong'], - ['zhong','ezhong','zhong','ezhong','zhong','ezhong','zhong','ezhong'], - ['zhong','ezhong','ezhong','zhong','ezhong','zhong','ezhong','zhong'], + chooseCharacterOL4: function () { + var next = game.createEvent("chooseCharacter"); + next.setContent(function () { + "step 0"; + var list = [ + ["zhong", "ezhong", "ezhong", "zhong", "zhong", "ezhong", "ezhong", "zhong"], + ["zhong", "ezhong", "zhong", "ezhong", "ezhong", "zhong", "ezhong", "zhong"], + ["zhong", "ezhong", "ezhong", "zhong", "ezhong", "zhong", "zhong", "ezhong"], + ["zhong", "ezhong", "zhong", "ezhong", "zhong", "ezhong", "zhong", "ezhong"], + ["zhong", "ezhong", "ezhong", "zhong", "ezhong", "zhong", "ezhong", "zhong"], ].randomGet(); - var rand1=Math.floor(Math.random()*4); - var rand2=Math.floor(Math.random()*4); - for(var i=0;i0.4){ - return (rank>=6)?Math.random():-Math.random(); - } - else if(seed>0.1){ - return (rank>=4&&rank<6)?Math.random():-Math.random(); - } - else{ - return (rank<4)?Math.random():-Math.random(); - } - }).set('selected',_status.event.selected).set('dialog',event.videoId).set('seed',Math.random()); - "step 2" + ui.arena.classList.add("choose-character"); + }; + event.map = map; + event.selected = []; + game.broadcastAll(func, filterChoice, event.videoId, event.selected, map, lib.choiceFour); + _status.onreconnect = [ + func, + filterChoice, + event.videoId, + event.selected, + map, + lib.choiceFour, + ]; + "step 1"; + game.broadcastAll(function (player) { + player.classList.add("selectedx"); + }, event.current); + event.current + .chooseButton(true) + .set("filterButton", function (button) { + return !_status.event.selected.includes(button.link); + }) + .set("ai", function (button) { + if (_status.event.player.identity == "zhu") { + if (Math.random() < 0.8) { + var info = lib.character[button.link]; + if (!info[4] || !info[4].includes("zhu")) { + return 0; + } + } + } + var seed = _status.event.seed; + var rank = get.rank(button.link, true); + if (seed > 0.4) { + return rank >= 6 ? Math.random() : -Math.random(); + } else if (seed > 0.1) { + return rank >= 4 && rank < 6 ? Math.random() : -Math.random(); + } else { + return rank < 4 ? Math.random() : -Math.random(); + } + }) + .set("selected", _status.event.selected) + .set("dialog", event.videoId) + .set("seed", Math.random()); + "step 2"; event.selected.push(result.links[0]); - game.broadcastAll(function(player,name,zhu){ - player.classList.remove('selectedx'); - player.init(name); - if(player.node.name_seat){ - player.node.name_seat.remove(); - } - },event.current,result.links[0]); - if(event.current.identity=='zhu'){ - if(!event.current.isInitFilter('noZhuHp')){ + game.broadcastAll( + function (player, name, zhu) { + player.classList.remove("selectedx"); + player.init(name); + if (player.node.name_seat) { + player.node.name_seat.remove(); + } + }, + event.current, + result.links[0] + ); + if (event.current.identity == "zhu") { + if (!event.current.isInitFilter("noZhuHp")) { event.current.maxHp++; event.current.hp++; event.current.update(); } } - event.current.classList.remove('selectedx'); - for(var i=0;i0){ - event.withai=true; + "step 3"; + if (event.ai_targets.length > 0) { + event.withai = true; game.pause(); } - 'step 4' - game.broadcastAll(function(id){ - var dialog=get.idDialog(id); - if(dialog){ + "step 4"; + game.broadcastAll(function (id) { + var dialog = get.idDialog(id); + if (dialog) { dialog.close(); clearInterval(dialog.delay); } - },event.videoId); - var result=event._choiceMap; - for(var i in lib.playerOL){ - if(!lib.character[result[i]]){ - result[i]=game._characterChoice[i].randomGet(); + }, event.videoId); + var result = event._choiceMap; + for (var i in lib.playerOL) { + if (!lib.character[result[i]]) { + result[i] = game._characterChoice[i].randomGet(); } _status.characterlist.remove(result[i]); - if(!lib.playerOL[i].name1){ + if (!lib.playerOL[i].name1) { lib.playerOL[i].init(result[i]); } lib.playerOL[i].update(); } - game.broadcast(function(result){ - for(var i in result){ - if(!lib.playerOL[i].name1){ + game.broadcast(function (result) { + for (var i in result) { + if (!lib.playerOL[i].name1) { lib.playerOL[i].init(result[i]); lib.playerOL[i].update(); } } - setTimeout(function(){ - ui.arena.classList.remove('choose-character'); - },500) - },result); - setTimeout(function(){ - ui.arena.classList.remove('choose-character'); - },500); - if(lib.configOL.olfeiyang_four){ - var target=_status.firstAct.previous; - if(target.isIn()) target.addSkill('olfeiyang'); + setTimeout(function () { + ui.arena.classList.remove("choose-character"); + }, 500); + }, result); + setTimeout(function () { + ui.arena.classList.remove("choose-character"); + }, 500); + if (lib.configOL.olfeiyang_four) { + var target = _status.firstAct.previous; + if (target.isIn()) target.addSkill("olfeiyang"); } - game.addGlobalSkill('versus_viewHandcard'); + game.addGlobalSkill("versus_viewHandcard"); }); }, - chooseCharacterOL1:function(){ - var next=game.createEvent('chooseCharacterOL'); - next.setContent(function(){ - 'step 0' - game.removeCard('shengdong'); - game.additionaldead=[]; - var list=get.charactersOL(); - list=list.randomGets(parseInt(lib.configOL.choice_num)); - list.remove('huatuo'); - list.remove('sunquan'); - event.videoId=lib.status.videoId++; - if(Math.random()<0.5){ - event.choosing=game.players[0]; + chooseCharacterOL1: function () { + var next = game.createEvent("chooseCharacterOL"); + next.setContent(function () { + "step 0"; + game.removeCard("shengdong"); + game.additionaldead = []; + var list = get.charactersOL(); + list = list.randomGets(parseInt(lib.configOL.choice_num)); + list.remove("huatuo"); + list.remove("sunquan"); + event.videoId = lib.status.videoId++; + if (Math.random() < 0.5) { + event.choosing = game.players[0]; + } else { + event.choosing = game.players[1]; } - else{ - event.choosing=game.players[1]; - } - var createDialog=function(list,id,list1,list2){ - var dialog=ui.create.dialog('选择角色',[list,'character']); - dialog.classList.add('fullwidth'); - dialog.classList.add('fullheight'); - dialog.classList.add('noslide'); - dialog.classList.add('fixed'); - dialog.videoId=id; - if(list2&&list2){ - ui.arena.classList.add('playerhidden'); - for(var i=0;icurrent.classList.contains('acted'))){ - next._isThreeRound=true; + next.setContent(function () { + "step 0"; + var next = player.phase(); + if (!game.players.some((current) => current.classList.contains("acted"))) { + next._isThreeRound = true; } - player.classList.add('acted'); - 'step 1' - if(player.identity!='zhu'){ - for(var i=0;i=2*Math.max(game.friend.length,game.enemy.length)){ - _status.round=0; - for(var i=0;i= 2 * Math.max(game.friend.length, game.enemy.length)) { + _status.round = 0; + for (var i = 0; i < game.players.length; i++) { + game.players[i].classList.remove("acted"); } delete _status.roundStart; } - var list=(_status.currentSide==game.me.side)?game.friend.slice(0):game.enemy.slice(0); - for(var i=0;ib.countCards('j')) return 1; - return a.hp-b.hp; - }) - event.player=list[0]; + if (list.length == 0) event.redo(); + else if ( + list.length == 1 || + (game.me != game.friendZhu && !lib.storage.single_control) || + _status.currentSide != game.me.side + ) { + list.sort(function (a, b) { + if (a.countCards("j") > b.countCards("j")) return 1; + return a.hp - b.hp; + }); + event.player = list[0]; event.goto(0); + } else { + game.me.chooseTarget("选择要行动的角色", true, function (card, player, target) { + return ( + target.classList.contains("acted") == false && target.side == game.me.side + ); + }).includeOut = true; } - else{ - game.me.chooseTarget('选择要行动的角色',true,function(card,player,target){ - return (target.classList.contains('acted')==false&&target.side==game.me.side); - }).includeOut=true; - } - } - else{ - event.player=event.player.next; + } else { + event.player = event.player.next; event.goto(0); } - "step 2" - event.player=result.targets[0]; + "step 2"; + event.player = result.targets[0]; event.goto(0); }); }, - phaseLoopJiange:function(){ - var next=game.createEvent('phaseLoop'); - next.num=0; - next.setContent(function(){ - if(event.num>=8){ - event.num-=8; + phaseLoopJiange: function () { + var next = game.createEvent("phaseLoop"); + next.num = 0; + next.setContent(function () { + if (event.num >= 8) { + event.num -= 8; } - var player=_status.actlist[event.num]; - if(player.isAlive()){ + var player = _status.actlist[event.num]; + if (player.isAlive()) { player.phase(); } event.num++; event.redo(); }); }, - replacePlayerOL:function(player){ - var next=game.createEvent('replacePlayer',false,_status.event.getParent()); - next.source=player; - next.setContent('replacePlayerOL'); + replacePlayerOL: function (player) { + var next = game.createEvent("replacePlayer", false, _status.event.getParent()); + next.source = player; + next.setContent("replacePlayerOL"); }, - replacePlayer:function(player){ - var next=game.createEvent('replacePlayer',false,_status.event.getParent()); - next.source=player; - next.setContent('replacePlayer'); + replacePlayer: function (player) { + var next = game.createEvent("replacePlayer", false, _status.event.getParent()); + next.source = player; + next.setContent("replacePlayer"); }, - replacePlayerTwo:function(player,character){ - var next=game.createEvent('replacePlayerTwo',false,_status.event.getParent()); - next.source=player; - next.character=character; - next.setContent('replacePlayerTwo'); + replacePlayerTwo: function (player, character) { + var next = game.createEvent("replacePlayerTwo", false, _status.event.getParent()); + next.source = player; + next.character = character; + next.setContent("replacePlayerTwo"); }, - versusClickToSwap:function(e){ - if(_status.dragged) return; - if(this.link==game.me){ - if(!this.classList.contains('buttonclick')){ - this.addTempClass('buttonclick'); + versusClickToSwap: function (e) { + if (_status.dragged) return; + if (this.link == game.me) { + if (!this.classList.contains("buttonclick")) { + this.addTempClass("buttonclick"); } - } - else if(_status.event.player==game.me&&!_status.auto){ - game.me.popup('请稍后再换人'); + } else if (_status.event.player == game.me && !_status.auto) { + game.me.popup("请稍后再换人"); e.stopPropagation(); - } - else{ + } else { game.modeSwapPlayer(this.link); } }, - versusHoverEnemy:function(){ - var uiintro=ui.create.dialog('hidden'); + versusHoverEnemy: function () { + var uiintro = ui.create.dialog("hidden"); - if(_status.enemyDied.length){ - uiintro.add('已阵亡'); - uiintro.add([_status.enemyDied,'character']); + if (_status.enemyDied.length) { + uiintro.add("已阵亡"); + uiintro.add([_status.enemyDied, "character"]); } - uiintro.add('未上场'); - if(_status.enemy.length){ - uiintro.add([_status.enemy,'character']); - } - else{ - uiintro.add('(无)') + uiintro.add("未上场"); + if (_status.enemy.length) { + uiintro.add([_status.enemy, "character"]); + } else { + uiintro.add("(无)"); } return uiintro; }, - versusHoverFriend:function(){ - var uiintro=ui.create.dialog('hidden'); + versusHoverFriend: function () { + var uiintro = ui.create.dialog("hidden"); - if(_status.friendDied.length){ - uiintro.add('已阵亡'); - uiintro.add([_status.friendDied,'character']); + if (_status.friendDied.length) { + uiintro.add("已阵亡"); + uiintro.add([_status.friendDied, "character"]); } - uiintro.add('未上场'); - if(_status.friend.length){ - uiintro.add([_status.friend,'character']); - } - else{ - uiintro.add('(无)') + uiintro.add("未上场"); + if (_status.friend.length) { + uiintro.add([_status.friend, "character"]); + } else { + uiintro.add("(无)"); } return uiintro; }, - versusHoverHandcards:function(){ - var uiintro=ui.create.dialog('hidden'); - var added=false; - for(var i=0;i0; + liangcaokuifa: { + trigger: { player: ["useCardAfter", "phaseDrawBegin"] }, + silent: true, + filter: function (event, player) { + if (event.name == "phaseDraw") return true; + return ( + player.getHistory("sourceDamage", function (evt) { + return evt.card == event.card; + }).length > 0 + ); }, - content:function(){ - if(trigger.name=='phaseDraw') trigger.num--; + content: function () { + if (trigger.name == "phaseDraw") trigger.num--; else player.draw(); }, }, - zhanyanliangzhuwenchou:{ - trigger:{player:'phaseBegin'}, - silent:true, - content:function(){ - 'step 0' - player.chooseUseTarget({ - name:'juedou', - isCard:true, - storage:{nowuxie:true} - }, - '选择一名角色,视为对其使用【决斗】','或点【取消】失去1点体力'); - 'step 1' - if(!result.bool) player.loseHp(); + zhanyanliangzhuwenchou: { + trigger: { player: "phaseBegin" }, + silent: true, + content: function () { + "step 0"; + player.chooseUseTarget( + { + name: "juedou", + isCard: true, + storage: { nowuxie: true }, + }, + "选择一名角色,视为对其使用【决斗】", + "或点【取消】失去1点体力" + ); + "step 1"; + if (!result.bool) player.loseHp(); }, }, - xujiu2:{ - charlotte:true, - onremove:true, - trigger:{player:'damageBegin2'}, - forced:true, - content:function(){ - trigger.num+=player.countMark('xujiu2'); + xujiu2: { + charlotte: true, + onremove: true, + trigger: { player: "damageBegin2" }, + forced: true, + content: function () { + trigger.num += player.countMark("xujiu2"); }, - intro:{content:'本回合受到的伤害+#'}, - ai:{threaten:(player,target)=>1+target.countMark('xujiu2')}, + intro: { content: "本回合受到的伤害+#" }, + ai: { threaten: (player, target) => 1 + target.countMark("xujiu2") }, }, - shishengshibai:{ - mod:{ - aiOrder:function(player,card,num){ - if(_status.shishengshibai&&_status.shishengshibai%10==9){ - if(['sha','tao','guohe','shunshou','tunliang','wuzhong','juedou','yuanjun'].includes(card.name)) return num+15; + shishengshibai: { + mod: { + aiOrder: function (player, card, num) { + if (_status.shishengshibai && _status.shishengshibai % 10 == 9) { + if ( + [ + "sha", + "tao", + "guohe", + "shunshou", + "tunliang", + "wuzhong", + "juedou", + "yuanjun", + ].includes(card.name) + ) + return num + 15; } }, }, - trigger:{ - player:'useCard1', + trigger: { + player: "useCard1", }, - silent:true, - content:function(){ - if(event.triggername=='useCard1'){ - if(!_status.shishengshibai) _status.shishengshibai=0; + silent: true, + content: function () { + if (event.triggername == "useCard1") { + if (!_status.shishengshibai) _status.shishengshibai = 0; _status.shishengshibai++; - game.broadcastAll(function(num){ - if(ui.guanduInfo) ui.guanduInfo.innerHTML='十胜十败('+num+')'; - },_status.shishengshibai); - if(_status.shishengshibai%10==0&&trigger.targets&&trigger.targets.length>0&&!['delay','equip'].includes(get.type(trigger.card))){ + game.broadcastAll(function (num) { + if (ui.guanduInfo) ui.guanduInfo.innerHTML = "十胜十败(" + num + ")"; + }, _status.shishengshibai); + if ( + _status.shishengshibai % 10 == 0 && + trigger.targets && + trigger.targets.length > 0 && + !["delay", "equip"].includes(get.type(trigger.card)) + ) { trigger.effectCount++; } } }, - ai:{ - result:{ - player:function(card,player,target){ - if(_status.shishengshibai&&_status.shishengshibai%10==9&&card.name=='tiesuo') return 'zerotarget'; + ai: { + result: { + player: function (card, player, target) { + if ( + _status.shishengshibai && + _status.shishengshibai % 10 == 9 && + card.name == "tiesuo" + ) + return "zerotarget"; }, }, }, }, liangjunxiangchi: { mod: { - maxHandcard: function(player, num) { + maxHandcard: function (player, num) { if (game.roundNumber <= 4) return num + game.roundNumber; }, }, - trigger: { source: 'damageBegin1' }, - filter: function(event, player) { + trigger: { source: "damageBegin1" }, + filter: function (event, player) { if (game.roundNumber <= 4) return false; - var evt2 = event.getParent('phaseUse'); + var evt2 = event.getParent("phaseUse"); if (evt2.player != player) return false; - return player.getHistory('useCard', function (evt) { - return evt.card.name == 'sha' && evt.getParent('phaseUse') == evt2; - }).indexOf(event.getParent()) == 0; + return ( + player + .getHistory("useCard", function (evt) { + return evt.card.name == "sha" && evt.getParent("phaseUse") == evt2; + }) + .indexOf(event.getParent()) == 0 + ); }, silent: true, forced: true, - content: function() { + content: function () { trigger.num++; }, }, xutuhuanjin: { - trigger: { player: 'phaseUseEnd' }, - filter: function(event, player) { - if (player.getHistory('useCard', function (evt) { - return evt.card && evt.card.name == 'sha' && evt.getParent('phaseUse') == event; - }).length > 0) return false; - if (player.getHistory('respond', function (evt) { - return evt.card && evt.card.name == 'sha' && evt.getParent('phaseUse') == event; - }).length > 0) return false; + trigger: { player: "phaseUseEnd" }, + filter: function (event, player) { + if ( + player.getHistory("useCard", function (evt) { + return evt.card && evt.card.name == "sha" && evt.getParent("phaseUse") == event; + }).length > 0 + ) + return false; + if ( + player.getHistory("respond", function (evt) { + return evt.card && evt.card.name == "sha" && evt.getParent("phaseUse") == event; + }).length > 0 + ) + return false; return true; }, forced: true, - content: function() { - player.addTempSkill('xutuhuanjin_yingzi', { player: 'phaseDrawAfter' }); - player.addMark('xutuhuanjin_yingzi', 1, false); + content: function () { + player.addTempSkill("xutuhuanjin_yingzi", { player: "phaseDrawAfter" }); + player.addMark("xutuhuanjin_yingzi", 1, false); }, subSkill: { yingzi: { charlotte: true, onremove: true, - trigger: { player: 'phaseDrawBegin2' }, - filter: function(event, player) { - return !event.numFixed && player.hasMark('xutuhuanjin_yingzi'); + trigger: { player: "phaseDrawBegin2" }, + filter: function (event, player) { + return !event.numFixed && player.hasMark("xutuhuanjin_yingzi"); }, forced: true, - content: function() { - trigger.num += player.countMark('xutuhuanjin_yingzi'); + content: function () { + trigger.num += player.countMark("xutuhuanjin_yingzi"); }, - marktext: '缓', - intro: { content: '下个摸牌阶段多摸#张牌' }, + marktext: "缓", + intro: { content: "下个摸牌阶段多摸#张牌" }, }, }, }, jianshoudaiyuan: { charlotte: true, mod: { - aiValue: function(player, card, num) { - if (card.name != 'sha' && card.name != 'shan') return; + aiValue: function (player, card, num) { + if (card.name != "sha" && card.name != "shan") return; var geti = function () { - var cards = player.getCards('hs', function (card) { - return card.name == 'sha' || card.name == 'shan'; + var cards = player.getCards("hs", function (card) { + return card.name == "sha" || card.name == "shan"; }); if (cards.contains(card)) { return cards.indexOf(card); @@ -4920,45 +5812,52 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }; return Math.max(num, [7, 5, 5, 3][Math.min(geti(), 3)]); }, - aiUseful: function() { + aiUseful: function () { return lib.skill.jianshoudaiyuan.mod.aiValue.apply(this, arguments); }, }, locked: false, - enable: ['chooseToUse', 'chooseToRespond'], - position: 'hs', - prompt: '将【杀】当作【闪】,或将【闪】当作的【杀】使用或打出,然后你的下个弃牌阶段的手牌上限-1', - viewAs:function(cards,player){ - if(cards.length){ - var name=false; - switch(get.name(cards[0],player)){ - case 'sha':name='shan';break; - case 'shan':name='sha';break; + enable: ["chooseToUse", "chooseToRespond"], + position: "hs", + prompt: "将【杀】当作【闪】,或将【闪】当作的【杀】使用或打出,然后你的下个弃牌阶段的手牌上限-1", + viewAs: function (cards, player) { + if (cards.length) { + var name = false; + switch (get.name(cards[0], player)) { + case "sha": + name = "shan"; + break; + case "shan": + name = "sha"; + break; } - if(name) return {name:name}; + if (name) return { name: name }; } return null; }, - onuse: function(links, player) { - player.addTempSkill('jianshoudaiyuan_less', { player: 'phaseDiscardAfter' }); - player.addMark('jianshoudaiyuan_less', 1, false); - player.markSkill('jianshoudaiyuan_less'); + onuse: function (links, player) { + player.addTempSkill("jianshoudaiyuan_less", { player: "phaseDiscardAfter" }); + player.addMark("jianshoudaiyuan_less", 1, false); + player.markSkill("jianshoudaiyuan_less"); }, - onrespond: function(links, player) { - player.addTempSkill('jianshoudaiyuan_less', { player: 'phaseDiscardAfter' }); - player.addMark('jianshoudaiyuan_less', 1, false); - player.markSkill('jianshoudaiyuan_less'); + onrespond: function (links, player) { + player.addTempSkill("jianshoudaiyuan_less", { player: "phaseDiscardAfter" }); + player.addMark("jianshoudaiyuan_less", 1, false); + player.markSkill("jianshoudaiyuan_less"); }, - check: function(card) { + check: function (card) { var player = _status.event.player; - if (_status.event.type == 'phase') { + if (_status.event.type == "phase") { var max = 0; var name2; - var list = ['sha']; - var map = { sha: 'shan' }; + var list = ["sha"]; + var map = { sha: "shan" }; for (var i = 0; i < list.length; i++) { var name = list[i]; - if (player.countCards('hs', map[name]) && player.getUseValue({ name: name }) > 0) { + if ( + player.countCards("hs", map[name]) && + player.getUseValue({ name: name }) > 0 + ) { var temp = get.order({ name: name }); if (temp > max) { max = temp; @@ -4971,35 +5870,41 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } return 1; }, - filterCard: function(card, player, event) { + filterCard: function (card, player, event) { event = event || _status.event; var filter = event._backup.filterCard; var name = get.name(card, player); - if (name == 'sha' && filter({ name: 'shan', cards: [card] }, player, event)) return true; - if (name == 'shan' && filter({ name: 'sha', cards: [card] }, player, event)) return true; + if (name == "sha" && filter({ name: "shan", cards: [card] }, player, event)) return true; + if (name == "shan" && filter({ name: "sha", cards: [card] }, player, event)) return true; return false; }, - filter: function(event, player) { + filter: function (event, player) { var filter = event.filterCard; - if (filter({ name: 'sha' }, player, event) && player.countCards('hs', 'shan')) return true; - if (filter({ name: 'shan' }, player, event) && player.countCards('hs', 'sha')) return true; + if (filter({ name: "sha" }, player, event) && player.countCards("hs", "shan")) + return true; + if (filter({ name: "shan" }, player, event) && player.countCards("hs", "sha")) + return true; return false; }, ai: { respondSha: true, respondShan: true, - skillTagFilter: function(player, tag) { + skillTagFilter: function (player, tag) { var name; switch (tag) { - case 'respondSha': name = 'shan'; break; - case 'respondShan': name = 'sha'; break; + case "respondSha": + name = "shan"; + break; + case "respondShan": + name = "sha"; + break; } - if (!player.countCards('hs', name)) return false; + if (!player.countCards("hs", name)) return false; }, - order:function(item,player){ - if(player&&_status.event.type=='phase'){ - if(player.countCards('hs','shan')&&player.getUseValue({name:'sha'})>0){ - return get.order({name:'sha'},player)*0.99; + order: function (item, player) { + if (player && _status.event.type == "phase") { + if (player.countCards("hs", "shan") && player.getUseValue({ name: "sha" }) > 0) { + return get.order({ name: "sha" }, player) * 0.99; } return 0; } @@ -5010,221 +5915,234 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ less: { onremove: true, charlotte: true, - market: '守', - intro: { content: '手牌上限-#' }, + market: "守", + intro: { content: "手牌上限-#" }, mod: { - maxHandcard: function(player, num) { - return num - player.countMark('jianshoudaiyuan_less'); + maxHandcard: function (player, num) { + return num - player.countMark("jianshoudaiyuan_less"); }, }, }, }, }, yiruoshengqiang: { - trigger: { source: 'damageBegin2' }, - filter: function(event, player) { + trigger: { source: "damageBegin2" }, + filter: function (event, player) { return event.player.hp > player.hp; }, forced: true, silent: true, - content: function() { + content: function () { trigger.num++; }, }, shichongerjiao: { charlotte: true, - trigger: { player: 'phaseJieshu' }, - filter: function(event, player) { - return lib.skill.shichongerjiao.filterx(event, player) || lib.skill.shichongerjiao.filtery(event, player); + trigger: { player: "phaseJieshu" }, + filter: function (event, player) { + return ( + lib.skill.shichongerjiao.filterx(event, player) || + lib.skill.shichongerjiao.filtery(event, player) + ); }, - filterx: function(event, player) { + filterx: function (event, player) { return player.isMaxHp(); }, - filtery: function(event, player) { + filtery: function (event, player) { return player.isMaxHandcard(); }, forced: true, silent: true, - content: function() { + content: function () { var bool1 = lib.skill.shichongerjiao.filterx(trigger, player); var bool2 = lib.skill.shichongerjiao.filtery(trigger, player); - if (bool1) player.chooseToDiscard('he', true); + if (bool1) player.chooseToDiscard("he", true); if (bool2) player.loseHp(); }, }, - wenji:{ - trigger:{global:'phaseUseBegin'}, - filter:function(event,player){ - return event.player.side==player.side&&event.player!=player&&event.player.countCards('h'); + wenji: { + trigger: { global: "phaseUseBegin" }, + filter: function (event, player) { + return ( + event.player.side == player.side && + event.player != player && + event.player.countCards("h") + ); }, - logTarget:'player', - check:function(event,player){ - return event.player.needsToDiscard(1)||event.player.countCards('h')>player.countCards('h')+1||player.hp==1; + logTarget: "player", + check: function (event, player) { + return ( + event.player.needsToDiscard(1) || + event.player.countCards("h") > player.countCards("h") + 1 || + player.hp == 1 + ); }, - content:function(){ - 'step 0' - trigger.player.chooseCard('将一张手牌交给'+get.translation(player),true).ai=function(card){ - if(get.type(card)=='trick') return 8-get.value(card); - return 6-get.value(card); - } - 'step 1' - if(result.bool&&result.cards.length){ - player.gain(result.cards,trigger.player,'give'); - if(get.type(result.cards[0])=='trick'){ - player.addTempSkill('wenji2',{player:'phaseBegin'}); + content: function () { + "step 0"; + trigger.player.chooseCard("将一张手牌交给" + get.translation(player), true).ai = + function (card) { + if (get.type(card) == "trick") return 8 - get.value(card); + return 6 - get.value(card); + }; + "step 1"; + if (result.bool && result.cards.length) { + player.gain(result.cards, trigger.player, "give"); + if (get.type(result.cards[0]) == "trick") { + player.addTempSkill("wenji2", { player: "phaseBegin" }); } } - } + }, }, - wenji2:{ - mark:true, - intro:{ - content:'非队友角色计算与你的距离+1' + wenji2: { + mark: true, + intro: { + content: "非队友角色计算与你的距离+1", }, - mod:{ - globalTo:function(from,to,distance){ - if(from.side!=to.side){ - return distance+1; + mod: { + globalTo: function (from, to, distance) { + if (from.side != to.side) { + return distance + 1; } - } - } + }, + }, }, - tunjiang:{ - trigger:{player:'phaseEnd'}, - direct:true, - filter:function(event,player){ - return !player.getStat('damage')&&player.countUsed()>=2; + tunjiang: { + trigger: { player: "phaseEnd" }, + direct: true, + filter: function (event, player) { + return !player.getStat("damage") && player.countUsed() >= 2; }, - content:function(){ - 'step 0' - var target=null; - for(var i=0;i=player.countCards('h')){ - return 1; - } - return 0; - }).set('prompt',get.prompt('xingzhao')).set('choiceList',[ - '摸两张牌','令'+get.translation(target)+'摸两张牌' - ]); + if (target) { + event.target = target; + player + .chooseControl("cancel2", function () { + if (target.countCards("h") >= player.countCards("h")) { + return 1; + } + return 0; + }) + .set("prompt", get.prompt("xingzhao")) + .set("choiceList", ["摸两张牌", "令" + get.translation(target) + "摸两张牌"]); + } else { + player.chooseBool(get.prompt("xingzhao")); } - else{ - player.chooseBool(get.prompt('xingzhao')); - } - 'step 1' - if(event.target){ - if(result.index==0){ - player.logSkill('xingzhao'); + "step 1"; + if (event.target) { + if (result.index == 0) { + player.logSkill("xingzhao"); player.draw(2); - } - else if(result.index==1){ - player.logSkill('xingzhao',event.target); + } else if (result.index == 1) { + player.logSkill("xingzhao", event.target); event.target.draw(2); } - } - else{ - if(result.bool){ - player.logSkill('xingzhao'); + } else { + if (result.bool) { + player.logSkill("xingzhao"); player.draw(2); } } - } + }, }, - xingzhao:{ - inherit:'xunxun', - mark:true, - intro:{ - content:function(storage,player){ - var num=0; - for(var i=0;i=1){ - str='具有技能“恂恂”'; + var str = "无技能"; + if (num >= 1) { + str = "具有技能“恂恂”"; } - if(num>=2){ - str+=';当你或队友使用装备牌时,其摸一张牌'; + if (num >= 2) { + str += ";当你或队友使用装备牌时,其摸一张牌"; } - if(num>=3){ - str+=';你和队友跳过判定阶段'; + if (num >= 3) { + str += ";你和队友跳过判定阶段"; } return str; - } + }, }, - filter:function(event,player){ - var num=0; - for(var i=0;i=2; + return bool && num >= 2; }, - content:function(){ + content: function () { player.draw(); - } + }, }, - xingzhao3:{ - trigger:{player:'phaseJudgeBefore'}, - forced:true, - filter:function(event,player){ - var num=0,bool=false; - for(var i=0;i=3; + return bool && num >= 3; }, - content:function(){ + content: function () { trigger.cancel(); - game.log(player,'跳过了判定阶段'); - } - }, - xionghuangjiu:{ - trigger:{source:'damageBegin1'}, - filter:function(event,player){ - return event.card&&event.card==player.storage.xionghuangjiu&&event.notLink(); + game.log(player, "跳过了判定阶段"); }, - forced:true, - content:function(){ + }, + xionghuangjiu: { + trigger: { source: "damageBegin1" }, + filter: function (event, player) { + return event.card && event.card == player.storage.xionghuangjiu && event.notLink(); + }, + forced: true, + content: function () { trigger.num++; }, - temp:true, - vanish:true, - onremove:function(player){ - game.addVideo('jiuNode',player,false); - if(player.node.jiu){ + temp: true, + vanish: true, + onremove: function (player) { + game.addVideo("jiuNode", player, false); + if (player.node.jiu) { player.node.jiu.delete(); player.node.jiu2.delete(); delete player.node.jiu; @@ -5232,1427 +6150,1505 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } delete player.storage.xionghuangjiu; }, - group:['xionghuangjiu2','xionghuangjiu3'] + group: ["xionghuangjiu2", "xionghuangjiu3"], }, - xionghuangjiu2:{ - trigger:{player:'useCardAfter',global:'phaseAfter'}, - priority:2, - filter:function(event,player){ - if(event.name=='useCard') return (event.card&&event.card==player.storage.xionghuangjiu); + xionghuangjiu2: { + trigger: { player: "useCardAfter", global: "phaseAfter" }, + priority: 2, + filter: function (event, player) { + if (event.name == "useCard") + return event.card && event.card == player.storage.xionghuangjiu; return true; }, - forced:true, - popup:false, - audio:false, - content:function(){ - game.broadcastAll(function(player){ - player.removeSkill('xionghuangjiu'); - },player); + forced: true, + popup: false, + audio: false, + content: function () { + game.broadcastAll(function (player) { + player.removeSkill("xionghuangjiu"); + }, player); }, }, - xionghuangjiu3:{ - trigger:{player:'useCard'}, - silent:true, - filter:function(event,player){ + xionghuangjiu3: { + trigger: { player: "useCard" }, + silent: true, + filter: function (event, player) { return !player.storage.xionghuangjiu; }, - content:function(){ - player.storage.xionghuangjiu=trigger.card; - } - }, - longchuanzhibao:{ - mark:'auto', - nopop:true, - init:function(player){ - player.storage.longchuanzhibao=0; + content: function () { + player.storage.xionghuangjiu = trigger.card; }, - intro:{ - content:function(storage,player){ - var str='已有'+storage+'个龙船至宝,'+get.translation(player.side)+'势力共有'; - var num=storage; - for(var i=0;i0; + trigger: { source: "damageEnd" }, + silent: true, + filter: function (event, player) { + return event.player.storage.longchuanzhibao > 0; }, - content:function(){ - player.gainZhibao(1,trigger.player); + content: function () { + player.gainZhibao(1, trigger.player); game.delay(); }, - group:'longchuanzhibao_over', - subSkill:{ - over:{ - trigger:{player:'roundStart'}, - silent:true, - filter:function(){ - var map={wei:0,shu:0,wu:0,qun:0}; - for(var i=0;i=4){ - _status.winside=current.side; + group: "longchuanzhibao_over", + subSkill: { + over: { + trigger: { player: "roundStart" }, + silent: true, + filter: function () { + var map = { wei: 0, shu: 0, wu: 0, qun: 0 }; + for (var i = 0; i < game.players.length; i++) { + var current = game.players[i]; + map[current.side] += current.storage.longchuanzhibao; + if (map[current.side] >= 4) { + _status.winside = current.side; return true; } } }, - content:function(){ - for(var i=0;i0; + forced: true, + filter: function (event, player) { + if (event.name == "die") return event.player.isEnemyOf(player); + return !event.numFixed && player.countMark("boss_huchen") > 0; }, - content:function(){ - if(trigger.name=='die') player.addMark('boss_huchen',1); - else trigger.num+=player.countMark('boss_huchen'); + content: function () { + if (trigger.name == "die") player.addMark("boss_huchen", 1); + else trigger.num += player.countMark("boss_huchen"); }, - intro:{ - content:'已斩杀过$名敌将', + intro: { + content: "已斩杀过$名敌将", }, }, - boss_fengjian:{ - trigger:{source:'damageSource'}, - forced:true, - filter:function(event,player){ + boss_fengjian: { + trigger: { source: "damageSource" }, + forced: true, + filter: function (event, player) { return event.player.isAlive(); }, - logTarget:'player', - content:function(){ - trigger.player.addTempSkill('boss_fengjian2',{player:'phaseAfter'}); - trigger.player.markAuto('boss_fengjian2',[player]); + logTarget: "player", + content: function () { + trigger.player.addTempSkill("boss_fengjian2", { player: "phaseAfter" }); + trigger.player.markAuto("boss_fengjian2", [player]); }, }, - boss_fengjian2:{ - onremove:true, - intro:{ - content:'不能对$使用牌', + boss_fengjian2: { + onremove: true, + intro: { + content: "不能对$使用牌", }, - mod:{ - playerEnabled:function(card,player,target){ - if(player.getStorage('boss_fengjian2').includes(target)) return false; + mod: { + playerEnabled: function (card, player, target) { + if (player.getStorage("boss_fengjian2").includes(target)) return false; }, }, }, - boss_keding:{ - trigger:{player:'useCard2'}, - direct:true, - filter:function(event,player){ - if(!event.targets||event.targets.length!=1) return false; - var card=event.card; - if(card.name!='sha'&&get.type(card)!='trick')return false; - var info=get.info(card); - if(info.allowMultiple==false) return false; - if(!player.countCards('h')) return false; - if(!info.multitarget){ - if(game.hasPlayer(function(current){ - return !event.targets.includes(current)&&lib.filter.targetEnabled2(card,player,current)&&lib.filter.targetInRange(card,player,current); - })){ + boss_keding: { + trigger: { player: "useCard2" }, + direct: true, + filter: function (event, player) { + if (!event.targets || event.targets.length != 1) return false; + var card = event.card; + if (card.name != "sha" && get.type(card) != "trick") return false; + var info = get.info(card); + if (info.allowMultiple == false) return false; + if (!player.countCards("h")) return false; + if (!info.multitarget) { + if ( + game.hasPlayer(function (current) { + return ( + !event.targets.includes(current) && + lib.filter.targetEnabled2(card, player, current) && + lib.filter.targetInRange(card, player, current) + ); + }) + ) { return true; } } return false; }, - content:function(){ - 'step 0' - var card=trigger.card; - var prompt2='弃置任意张手牌,并为'+get.translation(card)+'增加等量的目标'; - var targets=game.filterPlayer(function(current){ - return !trigger.targets.includes(current)&&lib.filter.targetEnabled2(card,player,current)&&lib.filter.targetInRange(card,player,current); + content: function () { + "step 0"; + var card = trigger.card; + var prompt2 = "弃置任意张手牌,并为" + get.translation(card) + "增加等量的目标"; + var targets = game.filterPlayer(function (current) { + return ( + !trigger.targets.includes(current) && + lib.filter.targetEnabled2(card, player, current) && + lib.filter.targetInRange(card, player, current) + ); }); - var max=0; - if(!trigger.targets[0].hasSkill('heiguangkai_skill')) max=targets.filter(function(target){ - return get.effect(target,card,player,player)>0; - }).length; + var max = 0; + if (!trigger.targets[0].hasSkill("heiguangkai_skill")) + max = targets.filter(function (target) { + return get.effect(target, card, player, player) > 0; + }).length; player.chooseCardTarget({ - prompt:get.prompt('boss_keding'), - prompt2:prompt2, - selectCard:function(){ - var player=_status.event.player; - var targets=_status.event.targets; - return [Math.max(1,ui.selected.targets.length),Math.min(targets.length,player.countCards('h'))]; + prompt: get.prompt("boss_keding"), + prompt2: prompt2, + selectCard: function () { + var player = _status.event.player; + var targets = _status.event.targets; + return [ + Math.max(1, ui.selected.targets.length), + Math.min(targets.length, player.countCards("h")), + ]; }, - selectTarget:function(){ + selectTarget: function () { return ui.selected.cards.length; }, - position:'h', - filterCard:lib.filter.cardDiscardable, - filterTarget:function(card,player,target){ + position: "h", + filterCard: lib.filter.cardDiscardable, + filterTarget: function (card, player, target) { return _status.event.targets.includes(target); }, - targets:targets, - ai1:function(card){ - if(ui.selected.cards.length>=_status.event.max) return 0; - return 5-get.value(card); + targets: targets, + ai1: function (card) { + if (ui.selected.cards.length >= _status.event.max) return 0; + return 5 - get.value(card); }, - ai2:function(target){ - if(target.hasSkill('heiguangkai_skill')) return 0; - var trigger=_status.event.getTrigger(); - var player=_status.event.player; - return get.effect(target,trigger.card,player,player); + ai2: function (target) { + if (target.hasSkill("heiguangkai_skill")) return 0; + var trigger = _status.event.getTrigger(); + var player = _status.event.player; + return get.effect(target, trigger.card, player, player); }, - max:max, + max: max, }); - 'step 1' - if(result.bool){ - player.logSkill('boss_keding',result.targets); + "step 1"; + if (result.bool) { + player.logSkill("boss_keding", result.targets); player.discard(result.cards); trigger.targets.addArray(result.targets); } }, }, - boss_bashi:{ - filter:function(event,player){ - return event.player!=player&&event.card&&(event.card.name=='sha'||get.type(event.card)=='trick')&&!player.isTurnedOver(); + boss_bashi: { + filter: function (event, player) { + return ( + event.player != player && + event.card && + (event.card.name == "sha" || get.type(event.card) == "trick") && + !player.isTurnedOver() + ); }, - logTarget:'player', - check:function(event,player){ - if(event.getParent().excluded.includes(player)) return false; - if(get.attitude(player,event.player)>0){ + logTarget: "player", + check: function (event, player) { + if (event.getParent().excluded.includes(player)) return false; + if (get.attitude(player, event.player) > 0) { return false; } - if(get.tag(event.card,'respondSha')){ - if(player.countCards('h',{name:'sha'})==0){ + if (get.tag(event.card, "respondSha")) { + if (player.countCards("h", { name: "sha" }) == 0) { return true; } - } - else if(get.tag(event.card,'respondShan')){ - if(player.countCards('h',{name:'shan'})==0){ + } else if (get.tag(event.card, "respondShan")) { + if (player.countCards("h", { name: "shan" }) == 0) { return true; } - } - else if(get.tag(event.card,'damage')){ - if(event.card.name=='shuiyanqijunx') return player.countCards('e')<2; + } else if (get.tag(event.card, "damage")) { + if (event.card.name == "shuiyanqijunx") return player.countCards("e") < 2; return true; //if(player.countCards('h')<2) return true; } return false; }, - trigger:{target:'useCardToTargeted'}, - content:function(){ + trigger: { target: "useCardToTargeted" }, + content: function () { player.turnOver(); trigger.getParent().excluded.add(player); }, }, - boss_danjing:{ - trigger:{global:'dying'}, - filter:function(event,player){ - return player.hp>1&&event.player.hp<1&&event.player.isFriendOf(player); + boss_danjing: { + trigger: { global: "dying" }, + filter: function (event, player) { + return player.hp > 1 && event.player.hp < 1 && event.player.isFriendOf(player); }, - check:function(event,player){ - var target=event.player; - return get.attitude(player,target)>0&&lib.filter.cardSavable({name:'tao',isCard:true},player,target); + check: function (event, player) { + var target = event.player; + return ( + get.attitude(player, target) > 0 && + lib.filter.cardSavable({ name: "tao", isCard: true }, player, target) + ); }, - logTarget:'player', - content:function(){ - 'step 0' + logTarget: "player", + content: function () { + "step 0"; player.loseHp(); - 'step 1' - var card={name:'tao',isCard:true}; - if(lib.filter.cardSavable(card,player,trigger.player)) player.useCard(card,trigger.player); + "step 1"; + var card = { name: "tao", isCard: true }; + if (lib.filter.cardSavable(card, player, trigger.player)) + player.useCard(card, trigger.player); }, }, - boss_jiaoxie:{ - enable:'phaseUse', - usable:1, - filter:function(event,player){ - return game.hasPlayer(function(current){ - return lib.skill.boss_jiaoxie.filterTarget(null,player,current); + boss_jiaoxie: { + enable: "phaseUse", + usable: 1, + filter: function (event, player) { + return game.hasPlayer(function (current) { + return lib.skill.boss_jiaoxie.filterTarget(null, player, current); }); }, - filterTarget:function(card,player,target){ - return target.isEnemyOf(player)&&target.type=='mech'&&target.countCards('he')>0; + filterTarget: function (card, player, target) { + return target.isEnemyOf(player) && target.type == "mech" && target.countCards("he") > 0; }, - content:function(){ - 'step 0' - if(!target.countCards('he')) event.finish(); - else target.chooseCard('he',true,'将一张牌交给'+get.translation(player)); - 'step 1' - if(result.bool){ - player.gain(result.cards,target,'give'); + content: function () { + "step 0"; + if (!target.countCards("he")) event.finish(); + else target.chooseCard("he", true, "将一张牌交给" + get.translation(player)); + "step 1"; + if (result.bool) { + player.gain(result.cards, target, "give"); } }, - ai:{ - order:9, - result:{ - target:function(player,target){ - if(target.countCards('e',function(card){ - return get.value(card,target)<=0; - })>0) return 1; + ai: { + order: 9, + result: { + target: function (player, target) { + if ( + target.countCards("e", function (card) { + return get.value(card, target) <= 0; + }) > 0 + ) + return 1; return -1; }, }, }, }, - boss_didongjg:{ - trigger:{player:'phaseEnd'}, - direct:true, - content:function(){ - "step 0" - player.chooseTarget(get.prompt('boss_didongjg'),function(card,player,target){ + boss_didongjg: { + trigger: { player: "phaseEnd" }, + direct: true, + content: function () { + "step 0"; + player.chooseTarget(get.prompt("boss_didongjg"), function (card, player, target) { return target.isEnemyOf(player); - }).ai=function(target){ - var att=get.attitude(player,target); - if(target.isTurnedOver()){ - if(att>0){ - return att+5; + }).ai = function (target) { + var att = get.attitude(player, target); + if (target.isTurnedOver()) { + if (att > 0) { + return att + 5; } return -1; } - if(player.isTurnedOver()){ - return 5-att; + if (player.isTurnedOver()) { + return 5 - att; } return -att; }; - "step 1" - if(result.bool){ - player.logSkill('boss_didongjg',result.targets); + "step 1"; + if (result.bool) { + player.logSkill("boss_didongjg", result.targets); result.targets[0].turnOver(); } }, - ai:{ - threaten:1.7 - } + ai: { + threaten: 1.7, + }, }, - boss_lianyujg:{ - trigger:{player:'phaseEnd'}, - unique:true, - content:function(){ - "step 0" - event.players=game.filterPlayer(function(current){ + boss_lianyujg: { + trigger: { player: "phaseEnd" }, + unique: true, + content: function () { + "step 0"; + event.players = game.filterPlayer(function (current) { return current.isEnemyOf(player); }); - "step 1" - if(event.players.length){ - var current=event.players.shift(); - player.line(current,'fire'); - current.damage('fire'); + "step 1"; + if (event.players.length) { + var current = event.players.shift(); + player.line(current, "fire"); + current.damage("fire"); event.redo(); } }, - ai:{ - threaten:2 - } + ai: { + threaten: 2, + }, }, - boss_mojianjg:{ - trigger:{player:'phaseUseBegin'}, - content:function(){ - var list=game.filterPlayer(function(current){ - return player.canUse('wanjian',current)&¤t.isEnemyOf(player); + boss_mojianjg: { + trigger: { player: "phaseUseBegin" }, + content: function () { + var list = game.filterPlayer(function (current) { + return player.canUse("wanjian", current) && current.isEnemyOf(player); }); list.sort(lib.sort.seat); - player.useCard({name:'wanjian'},list); + player.useCard({ name: "wanjian" }, list); + }, + ai: { + threaten: 1.8, }, - ai:{ - threaten:1.8 - } }, - boss_qiwu:{ - audio:true, - trigger:{player:'useCard'}, - direct:true, - filter:function(event,player){ - if(get.suit(event.card)=='club'){ - return game.hasPlayer(function(current){ - return current.isFriendOf(player)&¤t.isDamaged(); + boss_qiwu: { + audio: true, + trigger: { player: "useCard" }, + direct: true, + filter: function (event, player) { + if (get.suit(event.card) == "club") { + return game.hasPlayer(function (current) { + return current.isFriendOf(player) && current.isDamaged(); }); } return false; }, - content:function(){ - "step 0" - var noneed=(trigger.card.name=='tao'&&trigger.targets[0]==player&&player.hp==player.maxHp-1); - player.chooseTarget(get.prompt('boss_qiwu'),function(card,player,target){ - return target.hp0){ - if(noneed&&player==target){ - num=0.5; - } - else if(target.hp==1){ - num+=3; - } - else if(target.hp==2){ - num+=1; + content: function () { + "step 0"; + var noneed = + trigger.card.name == "tao" && + trigger.targets[0] == player && + player.hp == player.maxHp - 1; + player.chooseTarget(get.prompt("boss_qiwu"), function (card, player, target) { + return target.hp < target.maxHp && target.isFriendOf(player); + }).ai = function (target) { + var num = get.attitude(player, target); + if (num > 0) { + if (noneed && player == target) { + num = 0.5; + } else if (target.hp == 1) { + num += 3; + } else if (target.hp == 2) { + num += 1; } } return num; - } - "step 1" - if(result.bool){ - player.logSkill('qiwu',result.targets); + }; + "step 1"; + if (result.bool) { + player.logSkill("qiwu", result.targets); result.targets[0].recover(); } }, - ai:{ - expose:0.3, - threaten:1.5 - } + ai: { + expose: 0.3, + threaten: 1.5, + }, }, - boss_tianyujg:{ - audio:true, - trigger:{player:'phaseEnd'}, - forced:true, - filter:function(event,player){ - return game.hasPlayer(function(current){ - return current.isEnemyOf(player)&&!current.isLinked(); + boss_tianyujg: { + audio: true, + trigger: { player: "phaseEnd" }, + forced: true, + filter: function (event, player) { + return game.hasPlayer(function (current) { + return current.isEnemyOf(player) && !current.isLinked(); }); }, - content:function(){ - "step 0" - event.targets=game.filterPlayer(); + content: function () { + "step 0"; + event.targets = game.filterPlayer(); event.targets.sort(lib.sort.seat); - "step 1" - if(event.targets.length){ - var target=event.targets.shift(); - if(!target.isLinked()&&target.isEnemyOf(player)){ - player.line(target,'green'); + "step 1"; + if (event.targets.length) { + var target = event.targets.shift(); + if (!target.isLinked() && target.isEnemyOf(player)) { + player.line(target, "green"); target.link(); } event.redo(); } - } + }, }, - boss_jueji:{ - audio:2, - trigger:{global:'phaseDrawBegin'}, - filter:function(event,player){ - if(event.player.isFriendOf(player)){ + boss_jueji: { + audio: 2, + trigger: { global: "phaseDrawBegin" }, + filter: function (event, player) { + if (event.player.isFriendOf(player)) { return false; } - return event.num>0&&event.player!=player&&event.player.hp 0 && event.player != player && event.player.hp < event.player.maxHp; }, - logTarget:'player', - content:function(){ - player.line(trigger.player,'green'); + logTarget: "player", + content: function () { + player.line(trigger.player, "green"); trigger.num--; }, - ai:{ - expose:0.2, - threaten:1.4 - } + ai: { + expose: 0.2, + threaten: 1.4, + }, }, - boss_huodi:{ - audio:2, - trigger:{player:'phaseEnd'}, - direct:true, - filter:function(event,player){ - return game.hasPlayer(function(current){ - return current.isFriendOf(player)&¤t.isTurnedOver(); + boss_huodi: { + audio: 2, + trigger: { player: "phaseEnd" }, + direct: true, + filter: function (event, player) { + return game.hasPlayer(function (current) { + return current.isFriendOf(player) && current.isTurnedOver(); }); }, - content:function(){ - "step 0" - player.chooseTarget(get.prompt('boss_huodi'),function(card,player,target){ + content: function () { + "step 0"; + player.chooseTarget(get.prompt("boss_huodi"), function (card, player, target) { return !target.isFriendOf(player); - }).ai=function(target){ - if(target.isTurnedOver()) return 0; - return -get.attitude(player,target); + }).ai = function (target) { + if (target.isTurnedOver()) return 0; + return -get.attitude(player, target); }; - "step 1" - if(result.bool){ - player.logSkill('boss_huodi',result.targets); + "step 1"; + if (result.bool) { + player.logSkill("boss_huodi", result.targets); result.targets[0].turnOver(); } }, - ai:{ - expose:0.2 - } + ai: { + expose: 0.2, + }, }, - boss_chuanyun:{ - audio:true, - trigger:{player:'phaseEnd'}, - direct:true, - content:function(){ - "step 0" - player.chooseTarget(get.prompt('boss_chuanyun'),function(card,player,target){ - return player.hp=0; + return num >= 0; }, - forced:true, - content:function(){ - 'step 0' - var targets=game.filterPlayer(function(current){ + forced: true, + content: function () { + "step 0"; + var targets = game.filterPlayer(function (current) { return current.isEnemyOf(player); }); targets.sort(lib.sort.seat); - event.targets=targets; - player.line(targets,'thunder'); - event.num=targets.length; - 'step 1' - if(event.targets.length){ - event.targets.shift().damage('thunder'); + event.targets = targets; + player.line(targets, "thunder"); + event.num = targets.length; + "step 1"; + if (event.targets.length) { + event.targets.shift().damage("thunder"); event.redo(); } - 'step 2' + "step 2"; player.recover(event.num); }, - ai:{ - threaten:function(player,target){ - if(target.hp==1) return 2; - if(target.hp==2&&game.players.length<8) return 1.5; + ai: { + threaten: function (player, target) { + if (target.hp == 1) return 2; + if (target.hp == 2 && game.players.length < 8) return 1.5; return 0.5; }, - } + }, }, - boss_chiying:{ - audio:2, - trigger:{global:'damageBegin4'}, - forced:true, - filter:function(event,player){ - if(event.num<=1) return false; + boss_chiying: { + audio: 2, + trigger: { global: "damageBegin4" }, + forced: true, + filter: function (event, player) { + if (event.num <= 1) return false; return event.player.isFriendOf(player); }, - content:function(){ - trigger.num=1; - } + content: function () { + trigger.num = 1; + }, }, - boss_jingfan:{ - global:'boss_jingfan2', + boss_jingfan: { + global: "boss_jingfan2", }, - boss_jingfan2:{ - mod:{ - globalFrom:function(from,to,distance){ - if(to.isEnemyOf(from)) return; - var players=game.filterPlayer(); - for(var i=0;i0){ - if(players[i].hp==1){ + boss_lingyu: { + trigger: { player: "phaseEnd" }, + check: function (event, player) { + if (player.isTurnedOver()) return true; + var num = 0, + players = game.filterPlayer(); + for (var i = 0; i < players.length; i++) { + if ( + players[i].hp < players[i].maxHp && + players[i].isFriendOf(player) && + get.recoverEffect(players[i]) > 0 + ) { + if (players[i].hp == 1) { return true; } num++; - if(num>=2) return true; + if (num >= 2) return true; } } return false; }, - content:function(){ - 'step 0' + content: function () { + "step 0"; player.turnOver(); - 'step 1' - var list=game.filterPlayer(function(current){ - return current.isDamaged()&¤t.isFriendOf(player); + "step 1"; + var list = game.filterPlayer(function (current) { + return current.isDamaged() && current.isFriendOf(player); }); - player.line(list,'green'); - event.targets=list; - 'step 2' - if(event.targets.length){ + player.line(list, "green"); + event.targets = list; + "step 2"; + if (event.targets.length) { event.targets.shift().recover(); event.redo(); } }, - ai:{ - threaten:1.5, - effect:{ - target:function(card,player,target){ - if(card.name=='guiyoujie') return [0,1]; - } - } + ai: { + threaten: 1.5, + effect: { + target: function (card, player, target) { + if (card.name == "guiyoujie") return [0, 1]; + }, + }, }, }, - boss_zhenwei:{ - global:'boss_zhenwei2', - ai:{ - threaten:1.5 - } + boss_zhenwei: { + global: "boss_zhenwei2", + ai: { + threaten: 1.5, + }, }, - boss_zhenwei2:{ - mod:{ - globalTo:function(from,to,distance){ - if(to.isFriendOf(from)) return; - var players=game.filterPlayer(); - for(var i=0;i0.4?2:3,'thunder'); + if (target) { + player.line(target, "thunder"); + target.damage(Math.random() > 0.4 ? 2 : 3, "thunder"); } }, - ai:{ - threaten:function(player,target){ - if(_status.mode=='jiange'){ - for(var i=0;i0; + if (_status.mode == "jiange") { + for (var i = 0; i < players.length; i++) { + if (players[i].isFriendOf(player) && players[i].hasSkill("huodi")) { + return num > 0; } } } - return num>=4; + return num >= 4; }, - filter:function(event,player){ - var players=game.filterPlayer(); - for(var i=0;i0; + filter: function (event, player) { + return player.countCards("h") > 0; + }, + content: function () { + player.chooseToDiscard("h", true); }, - content:function(){ - player.chooseToDiscard('h',true); - } }, - boss_tunshi:{ - trigger:{player:'phaseBegin'}, - forced:true, - filter:function(event,player){ - var nh=player.countCards('h'); - return game.hasPlayer(function(current){ - return current.isEnemyOf(player)&¤t.countCards('h')>nh; + boss_tunshi: { + trigger: { player: "phaseBegin" }, + forced: true, + filter: function (event, player) { + var nh = player.countCards("h"); + return game.hasPlayer(function (current) { + return current.isEnemyOf(player) && current.countCards("h") > nh; }); }, - content:function(){ - 'step 0' - var nh=player.countCards('h'); - var targets=game.filterPlayer(function(current){ - return current.isEnemyOf(player)&¤t.countCards('h')>nh; + content: function () { + "step 0"; + var nh = player.countCards("h"); + var targets = game.filterPlayer(function (current) { + return current.isEnemyOf(player) && current.countCards("h") > nh; }); targets.sort(lib.sort.seat); - event.targets=targets; - 'step 1' - if(event.targets.length){ - var current=event.targets.shift(); + event.targets = targets; + "step 1"; + if (event.targets.length) { + var current = event.targets.shift(); current.damage(); - player.line(current,'thunder'); + player.line(current, "thunder"); event.redo(); } - } + }, }, - boss_jiguan:{ - mod:{ - targetEnabled:function(card,player,target){ - if(card.name=='lebu'){ + boss_jiguan: { + mod: { + targetEnabled: function (card, player, target) { + if (card.name == "lebu") { return false; } - } - } + }, + }, }, - boss_gongshenjg:{ - audio:2, - trigger:{player:'phaseEnd'}, - mode:['versus'], - filter:function(event,player){ - if(_status.mode!='jiange') return false; - var players=game.filterPlayer(); - for(var i=0;i0&&target.hasJudge('lebu')){ + next.ai = function (target) { + var att = get.attitude(player, target); + if (att > 0 && target.hasJudge("lebu")) { return 0.1; } - if(player.countCards('h')>player.hp){ - if(target==player) return Math.max(1,att-2); + if (player.countCards("h") > player.hp) { + if (target == player) return Math.max(1, att - 2); } - if(target==player) return att+5; + if (target == player) return att + 5; return att; - } + }; } - "step 2" - if(result&&result.targets&&result.targets.length){ - event.target=result.targets[0]; + "step 2"; + if (result && result.targets && result.targets.length) { + event.target = result.targets[0]; } - if(event.cards2.length){ - player.line(event.target,'green'); - event.target.gain(event.cards2,'gain2','log'); + if (event.cards2.length) { + player.line(event.target, "green"); + event.target.gain(event.cards2, "gain2", "log"); } }, - ai:{ - threaten:1.3 - } + ai: { + threaten: 1.3, + }, }, - boss_biantian4:{ - trigger:{player:'dieBegin'}, - forced:true, - popup:false, - content:function(){ - for(var i=0;i-3) return 0; - var eff=get.damageEffect(target,player,player,'fire'); - if(eff>0){ - return eff+target.countCards('e')/2; + }).ai = function (target) { + if (player.hp <= 1) return 0; + if (get.attitude(player, target) > -3) return 0; + var eff = get.damageEffect(target, player, player, "fire"); + if (eff > 0) { + return eff + target.countCards("e") / 2; } return 0; - } - "step 1" - if(result.bool){ - player.logSkill('boss_tianyun',result.targets,'fire'); + }; + "step 1"; + if (result.bool) { + player.logSkill("boss_tianyun", result.targets, "fire"); player.loseHp(); - event.target=result.targets[0]; - } - else{ + event.target = result.targets[0]; + } else { event.finish(); } - "step 2" - if(event.target){ - event.target.damage(Math.random()>0.4?2:3,'fire'); + "step 2"; + if (event.target) { + event.target.damage(Math.random() > 0.4 ? 2 : 3, "fire"); } - "step 3" - if(event.target){ - var es=event.target.getCards('e'); - if(es.length){ + "step 3"; + if (event.target) { + var es = event.target.getCards("e"); + if (es.length) { event.target.discard(es); } } }, - ai:{ - threaten:2 - } - }, - versus_ladder:{ - trigger:{global:['damageEnd','recoverEnd','dieEnd','gainEnd','phaseDiscardEnd']}, - silent:true, - filter:function(event,player){ - if(!_status.ladder) return false; - if(event._ladder_mmr_counted) return false; - if(!event.source) return false; - return event.source==game.me||event.player==game.me; + ai: { + threaten: 2, }, - content:function(){ - switch(event.triggername){ - case 'damageEnd':{ - if(trigger.source.side!=trigger.player.side){ - if(trigger.source==game.me){ - _status.ladder_mmr+=0.5*Math.max(1,trigger.num); - } - else{ - _status.ladder_mmr+=0.2*Math.max(1,trigger.num); + }, + versus_ladder: { + trigger: { global: ["damageEnd", "recoverEnd", "dieEnd", "gainEnd", "phaseDiscardEnd"] }, + silent: true, + filter: function (event, player) { + if (!_status.ladder) return false; + if (event._ladder_mmr_counted) return false; + if (!event.source) return false; + return event.source == game.me || event.player == game.me; + }, + content: function () { + switch (event.triggername) { + case "damageEnd": { + if (trigger.source.side != trigger.player.side) { + if (trigger.source == game.me) { + _status.ladder_mmr += 0.5 * Math.max(1, trigger.num); + } else { + _status.ladder_mmr += 0.2 * Math.max(1, trigger.num); } } break; } - case 'recoverEnd':{ - if(trigger.source!=trigger.player){ - if(trigger.source==game.me){ - if(trigger.player.side==game.me.side){ - _status.ladder_mmr+=0.5*trigger.num; - } - else{ - _status.ladder_mmr-=0.3*trigger.num; + case "recoverEnd": { + if (trigger.source != trigger.player) { + if (trigger.source == game.me) { + if (trigger.player.side == game.me.side) { + _status.ladder_mmr += 0.5 * trigger.num; + } else { + _status.ladder_mmr -= 0.3 * trigger.num; } } - } - else{ - _status.ladder_mmr+=0.3*trigger.num; + } else { + _status.ladder_mmr += 0.3 * trigger.num; } break; } - case 'dieEnd':{ - if(trigger.source==game.me&&trigger.player.side!=game.me.side){ - _status.ladder_mmr+=2; + case "dieEnd": { + if (trigger.source == game.me && trigger.player.side != game.me.side) { + _status.ladder_mmr += 2; } break; } - case 'gainEnd':{ - if(trigger.cards&&trigger.cards.length){ - if(trigger.source==game.me&&trigger.player!=game.me){ - if(trigger.player.side==game.me.side){ - _status.ladder_mmr+=0.3*trigger.cards.length; + case "gainEnd": { + if (trigger.cards && trigger.cards.length) { + if (trigger.source == game.me && trigger.player != game.me) { + if (trigger.player.side == game.me.side) { + _status.ladder_mmr += 0.3 * trigger.cards.length; + } else { + _status.ladder_mmr -= 0.1 * trigger.cards.length; } - else{ - _status.ladder_mmr-=0.1*trigger.cards.length; - } - } - else{ - if(trigger.source){ - if(trigger.source.side!=game.me.side){ - _status.ladder_mmr+=0.3*trigger.cards.length; + } else { + if (trigger.source) { + if (trigger.source.side != game.me.side) { + _status.ladder_mmr += 0.3 * trigger.cards.length; } - } - else{ - _status.ladder_mmr+=0.1*trigger.cards.length; + } else { + _status.ladder_mmr += 0.1 * trigger.cards.length; } } } break; } - case 'phaseDiscardEnd':{ - if(trigger.player==player){ - if(trigger.cards&&trigger.cards.length){ - _status.ladder_mmr-=0.2*trigger.cards.length; + case "phaseDiscardEnd": { + if (trigger.player == player) { + if (trigger.cards && trigger.cards.length) { + _status.ladder_mmr -= 0.2 * trigger.cards.length; } } break; } } - trigger._ladder_mmr_counted=true; - } - } + trigger._ladder_mmr_counted = true; + }, + }, }, - card:{ - tunliang:{ - audio:true, - fullskin:true, - type:'trick', - enable:true, - selectTarget:[1,3], - filterTarget:true, - content:function(){ + card: { + tunliang: { + audio: true, + fullskin: true, + type: "trick", + enable: true, + selectTarget: [1, 3], + filterTarget: true, + content: function () { target.draw(); }, - ai:{ - basic:{ - order:7.2, - useful:4.5, - value:9.2 + ai: { + basic: { + order: 7.2, + useful: 4.5, + value: 9.2, }, - result:{ - target:1, + result: { + target: 1, + }, + tag: { + draw: 1, }, - tag:{ - draw:1 - } - } - }, - yuanjun:{ - fullskin:true, - type:'trick', - selectTarget:[1,2], - enable:true, - filterTarget:function(card,player,target){ - return target!=player&&target.hp{ - var cards=player.getCards('hs',card=>get.tag(card,'damage')&&player.hasValueTarget(card)); - if(!cards.length) return 0; - var cardx=cards.filter(card=>get.name(card)=='sha'); - cardx.sort((a,b)=>player.getUseValue(b)-player.getUseValue(a)); - cardx=cardx.slice(Math.min(cardx.length,player.getCardUsable('sha')),cardx.length); + ai: { + basic: { + order: (item, player) => { + var cards = player.getCards( + "hs", + (card) => get.tag(card, "damage") && player.hasValueTarget(card) + ); + if (!cards.length) return 0; + var cardx = cards.filter((card) => get.name(card) == "sha"); + cardx.sort((a, b) => player.getUseValue(b) - player.getUseValue(a)); + cardx = cardx.slice( + Math.min(cardx.length, player.getCardUsable("sha")), + cardx.length + ); cards.removeArray(cardx); - return get.order(cards.sort((a,b)=>get.order(b,player)-get.order(a,player))[0])+0.3; + return ( + get.order( + cards.sort((a, b) => get.order(b, player) - get.order(a, player))[0] + ) + 0.3 + ); }, - useful:5, - value:3, + useful: 5, + value: 3, }, - result:{ - target:(player,target)=>{ - if(target.hasSkill('gangzhi')||get.attitude(player,target)>=0) return 0; - var cards=player.getCards('hs',card=>get.tag(card,'damage')&&player.canUse(card,target)&&get.effect(target,card,player,player)>0); - if(!cards.length) return 0; - var cardx=cards.filter(card=>get.name(card)=='sha'); - cardx.sort((a,b)=>get.effect(target,b,player,player)-get.effect(target,a,player,player)); - cardx=cardx.slice(Math.min(cardx.length,player.getCardUsable('sha')),cardx.length); + result: { + target: (player, target) => { + if (target.hasSkill("gangzhi") || get.attitude(player, target) >= 0) return 0; + var cards = player.getCards( + "hs", + (card) => + get.tag(card, "damage") && + player.canUse(card, target) && + get.effect(target, card, player, player) > 0 + ); + if (!cards.length) return 0; + var cardx = cards.filter((card) => get.name(card) == "sha"); + cardx.sort( + (a, b) => + get.effect(target, b, player, player) - + get.effect(target, a, player, player) + ); + cardx = cardx.slice( + Math.min(cardx.length, player.getCardUsable("sha")), + cardx.length + ); cards.removeArray(cardx); - return -cards.reduce((sum,card)=>sum+get.effect(target,card,player,player),0); + return -cards.reduce( + (sum, card) => sum + get.effect(target, card, player, player), + 0 + ); }, }, }, }, - zong:{ - fullskin:true, - type:'basic', - cardcolor:'red', - enable:function(card,player){ - return player.hp= 2 && target.countCards("h", "tao") <= 1) { + keep = true; } - else if(nd==1&&target.hp>=2&&target.countCards('h','tao')<=1){ - keep=true; - } - var mode=get.mode(); - if(target.hp>=2&&keep&&target.hasFriend()){ - if(target.hp>2||nd==0) return 0; - if(target.hp==2){ - if(game.hasPlayer(function(current){ - if(target!=current&&get.attitude(target,current)>=3){ - if(current.hp<=1) return true; - } - })){ + var mode = get.mode(); + if (target.hp >= 2 && keep && target.hasFriend()) { + if (target.hp > 2 || nd == 0) return 0; + if (target.hp == 2) { + if ( + game.hasPlayer(function (current) { + if (target != current && get.attitude(target, current) >= 3) { + if (current.hp <= 1) return true; + } + }) + ) { return 0; } } @@ -6660,246 +7656,263 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ return 2; }, }, - tag:{ - recover:1, - save:1, - } - } + tag: { + recover: 1, + save: 1, + }, + }, }, - xionghuangjiu:{ - fullskin:true, - type:"basic", - enable:function(event,player){ - return !player.hasSkill('jiu')&&!player.hasSkill('xionghuangjiu'); + xionghuangjiu: { + fullskin: true, + type: "basic", + enable: function (event, player) { + return !player.hasSkill("jiu") && !player.hasSkill("xionghuangjiu"); }, - lianheng:true, - logv:false, - savable:function(card,player,dying){ - return dying==player; + lianheng: true, + logv: false, + savable: function (card, player, dying) { + return dying == player; }, - usable:1, - selectTarget:-1, - modTarget:true, - filterTarget:function(card,player,target){ - return target==player; + usable: 1, + selectTarget: -1, + modTarget: true, + filterTarget: function (card, player, target) { + return target == player; }, - content:function(){ - if(target.isDying()){ + content: function () { + if (target.isDying()) { target.recover(); - if(_status.currentPhase==target){ + if (_status.currentPhase == target) { target.getStat().card.jiu--; } - } - else{ - if(cards&&cards.length){ - card=cards[0]; + } else { + if (cards && cards.length) { + card = cards[0]; } - game.broadcastAll(function(target,card,gain2){ - if(get.population(target.side)==1){ - target.addSkill('xionghuangjiu'); - } - else{ - if(!target.storage.jiu) target.storage.jiu=0; - target.storage.jiu++; - target.addSkill('jiu'); - } - game.addVideo('jiuNode',target,true); - if(!target.node.jiu&&lib.config.jiu_effect){ - target.node.jiu=ui.create.div('.playerjiu',target.node.avatar); - target.node.jiu2=ui.create.div('.playerjiu',target.node.avatar2); - } - if(gain2&&card.clone&&(card.clone.parentNode==target.parentNode||card.clone.parentNode==ui.arena)){ - card.clone.moveDelete(target); - } - },target,card,target==targets[0]); - if(target==targets[0]){ - if(card.clone&&(card.clone.parentNode==target.parentNode||card.clone.parentNode==ui.arena)){ - game.addVideo('gain2',target,get.cardsInfo([card])); + game.broadcastAll( + function (target, card, gain2) { + if (get.population(target.side) == 1) { + target.addSkill("xionghuangjiu"); + } else { + if (!target.storage.jiu) target.storage.jiu = 0; + target.storage.jiu++; + target.addSkill("jiu"); + } + game.addVideo("jiuNode", target, true); + if (!target.node.jiu && lib.config.jiu_effect) { + target.node.jiu = ui.create.div(".playerjiu", target.node.avatar); + target.node.jiu2 = ui.create.div(".playerjiu", target.node.avatar2); + } + if ( + gain2 && + card.clone && + (card.clone.parentNode == target.parentNode || + card.clone.parentNode == ui.arena) + ) { + card.clone.moveDelete(target); + } + }, + target, + card, + target == targets[0] + ); + if (target == targets[0]) { + if ( + card.clone && + (card.clone.parentNode == target.parentNode || + card.clone.parentNode == ui.arena) + ) { + game.addVideo("gain2", target, get.cardsInfo([card])); } } } }, - ai:{ - basic:{ - useful:function(card,i){ - if(_status.event.player.hp>1){ - if(i==0) return 5; + ai: { + basic: { + useful: function (card, i) { + if (_status.event.player.hp > 1) { + if (i == 0) return 5; return 1; } - if(i==0) return 7.3; + if (i == 0) return 7.3; return 3; }, - value:function(card,player,i){ - if(player.hp>1){ - if(i==0) return 5; + value: function (card, player, i) { + if (player.hp > 1) { + if (i == 0) return 5; return 1; } - if(i==0) return 7.3; + if (i == 0) return 7.3; return 3; }, }, - order:function(){ - return get.order({name:'sha'})+0.2; + order: function () { + return get.order({ name: "sha" }) + 0.2; }, - result:{ - target:function(player,target){ - if(target&&target.isDying()) return 2; - if(lib.config.mode=='stone'&&!player.isMin()){ - if(player.getActCount()+1>=player.actcount) return 0; + result: { + target: function (player, target) { + if (target && target.isDying()) return 2; + if (lib.config.mode == "stone" && !player.isMin()) { + if (player.getActCount() + 1 >= player.actcount) return 0; } - var shas=player.getCards('h','sha'); - if(shas.length>1&&player.getCardUsable('sha')>1){ + var shas = player.getCards("h", "sha"); + if (shas.length > 1 && player.getCardUsable("sha") > 1) { return 0; } var card; - if(shas.length){ - for(var i=0;i0); - })){ + if (card) { + if ( + game.hasPlayer(function (current) { + return ( + get.attitude(target, current) < 0 && + target.canUse(card, current, true, true) && + !current.getEquip("baiyin") && + get.effect(current, card, target) > 0 + ); + }) + ) { return 1; } } return 0; }, }, - tag:{ - save:1 - } - } + tag: { + save: 1, + }, + }, }, - tongzhougongji:{ - fullskin:true, - cardimage:'lulitongxin', - notarget:true, - enable:true, - type:'trick', - content:function(){ - 'step 0' - var num=0; - for(var i=0;i2){ - return 0; - } - if(num==2&&get.population(player.side)==1){ - return 0; - } - return 1; - }).set('choiceList',[ - '摸'+get.cnNumber(num)+'张牌', - '你和队友各摸一张牌' - ]); - event.num=num; - 'step 1' - if(result.index==0){ - if(event.num){ + player + .chooseControl(function () { + if (num > 2) { + return 0; + } + if (num == 2 && get.population(player.side) == 1) { + return 0; + } + return 1; + }) + .set("choiceList", ["摸" + get.cnNumber(num) + "张牌", "你和队友各摸一张牌"]); + event.num = num; + "step 1"; + if (result.index == 0) { + if (event.num) { player.draw(event.num); } - } - else{ - if(event.friend){ + } else { + if (event.friend) { player.line(event.friend); - game.asyncDraw([player,event.friend]); - } - else{ + game.asyncDraw([player, event.friend]); + } else { player.draw(); } } }, - ai:{ - basic:{ - order:7.2, - useful:4, - value:9.2 + ai: { + basic: { + order: 7.2, + useful: 4, + value: 9.2, }, - result:{ - target:2, + result: { + target: 2, }, - tag:{ - draw:1 - } - } + tag: { + draw: 1, + }, + }, }, - lizhengshangyou:{ - fullskin:true, - cardimage:'lianjunshengyan', - type:'trick', - enable:true, - selectTarget:-1, - reverseOrder:true, - filterTarget:function(card,player,target){ - for(var i=0;i1&&(game.me==game.friendZhu||(lib.storage.zhu&&lib.storage.single_control))&& - !_status.auto){ - event.dialog=ui.create.dialog('选择替补角色',[list,'character']); - event.filterButton=function(){return true;}; - event.player=game.me; - event.forced=true; - event.custom.replace.confirm=function(){ - event.character=ui.selected.buttons[0].link; + if ( + source.side == game.me.side && + list.length > 1 && + (game.me == game.friendZhu || (lib.storage.zhu && lib.storage.single_control)) && + !_status.auto + ) { + event.dialog = ui.create.dialog("选择替补角色", [list, "character"]); + event.filterButton = function () { + return true; + }; + event.player = game.me; + event.forced = true; + event.custom.replace.confirm = function () { + event.character = ui.selected.buttons[0].link; event.dialog.close(); - if(ui.confirm) ui.confirm.close(); + if (ui.confirm) ui.confirm.close(); delete event.player; game.resume(); - } + }; game.check(); game.pause(); + } else { + event.character = list[Math.floor(Math.random() * list.length)]; } - else{ - event.character=list[Math.floor(Math.random()*list.length)]; - } - "step 2" + "step 2"; game.uncheck(); _status.friend.remove(event.character); _status.enemy.remove(event.character); - source.revive(null,false); + source.revive(null, false); game.additionaldead.push({ - name:source.name, - stat:source.stat + name: source.name, + stat: source.stat, }); - game.addVideo('reinit',source,[event.character,get.translation(source.side+'Color')]); + game.addVideo("reinit", source, [ + event.character, + get.translation(source.side + "Color"), + ]); source.uninit(); source.init(event.character); - game.log(source,'出场'); - source.node.identity.dataset.color=get.translation(source.side+'Color'); + game.log(source, "出场"); + source.node.identity.dataset.color = get.translation(source.side + "Color"); source.draw(4); - var evt=event.getParent('dying'); - if(evt&&evt.parent){ - evt=evt.parent; - evt.untrigger(false,source); - for(var i=0;i<100;i++){ - evt=evt.parent; - if(evt.player==source){ + var evt = event.getParent("dying"); + if (evt && evt.parent) { + evt = evt.parent; + evt.untrigger(false, source); + for (var i = 0; i < 100; i++) { + evt = evt.parent; + if (evt.player == source) { evt.finish(); } - if(evt.name=='phase'){ + if (evt.name == "phase") { break; } } } - if(lib.storage.single_control){ + if (lib.storage.single_control) { game.onSwapControl(); } game.triggerEnter(source); - "step 3" + "step 3"; // if(_status.currentPhase==source){ // source.skip('phase'); // } }, - replacePlayerTwo:function(){ - 'step 0' - var cards=source.getCards('hej'); - if(cards.length){ - source.$throw(cards,1000); + replacePlayerTwo: function () { + "step 0"; + var cards = source.getCards("hej"); + if (cards.length) { + source.$throw(cards, 1000); game.cardsDiscard(cards); } game.delay(); - 'step 1' - source.revive(null,false); + "step 1"; + source.revive(null, false); game.additionaldead.push({ - name:source.name, - stat:source.stat + name: source.name, + stat: source.stat, }); - game.addVideo('reinit',source,[event.character,get.translation(source.side+'Color')]); + game.addVideo("reinit", source, [ + event.character, + get.translation(source.side + "Color"), + ]); source.uninit(); source.init(event.character); - game.log(source,'出场'); + game.log(source, "出场"); // source.node.identity.dataset.color=source.side+'zhu'; source.draw(4); - var evt=event.getParent('dying'); - if(evt&&evt.parent){ - evt=evt.parent; - evt.untrigger(false,source); - for(var i=0;i<100;i++){ - evt=evt.parent; - if(evt.player==source){ + var evt = event.getParent("dying"); + if (evt && evt.parent) { + evt = evt.parent; + evt.untrigger(false, source); + for (var i = 0; i < 100; i++) { + evt = evt.parent; + if (evt.player == source) { evt.finish(); } - if(evt.name=='phase'){ + if (evt.name == "phase") { break; } } } game.triggerEnter(source); }, - replacePlayerOL:function(){ - 'step 0' - var cards=source.getCards('hej'); - if(cards.length){ - source.$throw(cards,1000); + replacePlayerOL: function () { + "step 0"; + var cards = source.getCards("hej"); + if (cards.length) { + source.$throw(cards, 1000); game.cardsDiscard(cards); } game.delay(); - 'step 1' - if(event.source.side==game.me.side){ - if(_status.friend.length==1){ - event.directresult=_status.friend[0]; - } - else if(event.source==game.me){ - if(_status.auto){ - event.directresult=_status.friend.randomGet(); + "step 1"; + if (event.source.side == game.me.side) { + if (_status.friend.length == 1) { + event.directresult = _status.friend[0]; + } else if (event.source == game.me) { + if (_status.auto) { + event.directresult = _status.friend.randomGet(); + } + } else { + if (!event.source.isOnline()) { + event.directresult = _status.friend.randomGet(); } } - else{ - if(!event.source.isOnline()){ - event.directresult=_status.friend.randomGet(); + } else { + if (_status.enemy.length == 1) { + event.directresult = _status.enemy[0]; + } else { + if (!event.source.isOnline()) { + event.directresult = _status.enemy.randomGet(); } } } - else{ - if(_status.enemy.length==1){ - event.directresult=_status.enemy[0]; - } - else{ - if(!event.source.isOnline()){ - event.directresult=_status.enemy.randomGet(); - } - } - } - if(!event.directresult){ - if(event.source==game.me){ - event.dialog=ui.create.dialog('选择替补角色',[_status.friend,'character']); - event.filterButton=function(){return true}; - event.player=game.me; - event.forced=true; - event.custom.replace.confirm=function(){ - event.directresult=ui.selected.buttons[0].link; + if (!event.directresult) { + if (event.source == game.me) { + event.dialog = ui.create.dialog("选择替补角色", [_status.friend, "character"]); + event.filterButton = function () { + return true; + }; + event.player = game.me; + event.forced = true; + event.custom.replace.confirm = function () { + event.directresult = ui.selected.buttons[0].link; event.dialog.close(); - if(ui.confirm) ui.confirm.close(); + if (ui.confirm) ui.confirm.close(); delete event.player; game.resume(); - } - event.switchToAuto=function(){ - event.directresult=_status.friend.randomGet(); + }; + event.switchToAuto = function () { + event.directresult = _status.friend.randomGet(); event.dialog.close(); - if(ui.confirm) ui.confirm.close(); + if (ui.confirm) ui.confirm.close(); delete event.player; }; game.check(); game.pause(); - } - else{ - event.source.send(function(player){ - if(_status.auto){ - _status.event._result=_status.friend.randomGet(); - } - else{ - var next=game.createEvent('replacePlayer'); - next.source=player; - next.setContent(function(){ - event.dialog=ui.create.dialog('选择替补角色',[_status.friend,'character']); - event.filterButton=function(){return true}; - event.player=event.source; - event.forced=true; - event.custom.replace.confirm=function(){ - event.result=ui.selected.buttons[0].link; + } else { + event.source.send(function (player) { + if (_status.auto) { + _status.event._result = _status.friend.randomGet(); + } else { + var next = game.createEvent("replacePlayer"); + next.source = player; + next.setContent(function () { + event.dialog = ui.create.dialog("选择替补角色", [ + _status.friend, + "character", + ]); + event.filterButton = function () { + return true; + }; + event.player = event.source; + event.forced = true; + event.custom.replace.confirm = function () { + event.result = ui.selected.buttons[0].link; event.dialog.close(); - if(ui.confirm) ui.confirm.close(); + if (ui.confirm) ui.confirm.close(); delete event.player; game.resume(); game.uncheck(); - } - event.switchToAuto=function(){ - event.result=_status.friend.randomGet(); + }; + event.switchToAuto = function () { + event.result = _status.friend.randomGet(); event.dialog.close(); - if(ui.confirm) ui.confirm.close(); + if (ui.confirm) ui.confirm.close(); delete event.player; game.uncheck(); }; @@ -7103,509 +8132,499 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }); } game.resume(); - },event.source); + }, event.source); event.source.wait(); game.pause(); } } - 'step 2' + "step 2"; game.uncheck(); - if(!event.directresult){ - if(event.resultOL){ - event.directresult=event.resultOL[source.playerid]; + if (!event.directresult) { + if (event.resultOL) { + event.directresult = event.resultOL[source.playerid]; } - if(!event.directresult||event.directresult=='ai'){ - if(source.side==game.me.side){ - event.directresult=_status.friend.randomGet(); - } - else{ - event.directresult=_status.enemy.randomGet(); + if (!event.directresult || event.directresult == "ai") { + if (source.side == game.me.side) { + event.directresult = _status.friend.randomGet(); + } else { + event.directresult = _status.enemy.randomGet(); } } } - var name=event.directresult; - var color=source.node.identity.dataset.color; + var name = event.directresult; + var color = source.node.identity.dataset.color; game.additionaldead.push({ - name:source.name, - stat:source.stat + name: source.name, + stat: source.stat, }); - game.broadcastAll(function(source,name,color){ - _status.friend.remove(name); - _status.enemy.remove(name); - source.revive(null,false); - source.uninit(); - source.init(name); - source.node.identity.dataset.color=color; - if(source==game.me){ - ui.arena.classList.remove('selecting'); - } - },source,name,color); - game.log(source,'出场'); + game.broadcastAll( + function (source, name, color) { + _status.friend.remove(name); + _status.enemy.remove(name); + source.revive(null, false); + source.uninit(); + source.init(name); + source.node.identity.dataset.color = color; + if (source == game.me) { + ui.arena.classList.remove("selecting"); + } + }, + source, + name, + color + ); + game.log(source, "出场"); source.draw(4); - var evt=event.getParent('dying'); - if(evt&&evt.parent){ - evt=evt.parent; - evt.untrigger(false,source); - for(var i=0;i<100;i++){ - evt=evt.parent; - if(evt.player==source){ + var evt = event.getParent("dying"); + if (evt && evt.parent) { + evt = evt.parent; + evt.untrigger(false, source); + for (var i = 0; i < 100; i++) { + evt = evt.parent; + if (evt.player == source) { evt.finish(); } - if(evt.name=='phase'){ + if (evt.name == "phase") { break; } } } - game.addVideo('reinit',source,[name,color]); + game.addVideo("reinit", source, [name, color]); game.triggerEnter(source); }, }, - player:{ - gainZhibao:function(num,source){ - if(source){ - if(num===true||num>source.storage.longchuanzhibao){ - num=source.storage.longchuanzhibao; + player: { + gainZhibao: function (num, source) { + if (source) { + if (num === true || num > source.storage.longchuanzhibao) { + num = source.storage.longchuanzhibao; + } + } else { + if (typeof num != "number") { + num = 1; } } - else{ - if(typeof num!='number'){ - num=1; - } - } - if(!num||typeof num!='number') return this; + if (!num || typeof num != "number") return this; - this.storage.longchuanzhibao+=num; - this.updateMark('longchuanzhibao'); + this.storage.longchuanzhibao += num; + this.updateMark("longchuanzhibao"); - if(source){ - source.storage.longchuanzhibao-=num; - source.updateMark('longchuanzhibao'); - game.log(this,'从',source,'处获得了'+get.cnNumber(num)+'个','#y龙船至宝'); - } - else{ - game.log(this,'获得了'+get.cnNumber(num)+'个','#y龙船至宝'); + if (source) { + source.storage.longchuanzhibao -= num; + source.updateMark("longchuanzhibao"); + game.log(this, "从", source, "处获得了" + get.cnNumber(num) + "个", "#y龙船至宝"); + } else { + game.log(this, "获得了" + get.cnNumber(num) + "个", "#y龙船至宝"); } - if(source&&source.side!=this.side){ - this.draw(num,'nodelay'); - var that=this; - var friend=game.findPlayer(function(current){ - return current.side==that.side&¤t!=that; + if (source && source.side != this.side) { + this.draw(num, "nodelay"); + var that = this; + var friend = game.findPlayer(function (current) { + return current.side == that.side && current != that; }); - if(friend){ - friend.draw(num,'nodelay'); + if (friend) { + friend.draw(num, "nodelay"); } } - var map={wei:0,shu:0,wu:0,qun:0}; - for(var i=0;i=4){ - current.classList.add('current_action'); - } - else{ - current.classList.remove('current_action'); + for (var i = 0; i < game.players.length; i++) { + var current = game.players[i]; + if (map[current.side] >= 4) { + current.classList.add("current_action"); + } else { + current.classList.remove("current_action"); } } return this; }, - dieAfter2:function(source){ - if(_status.connectMode&&_status.mode!='guandu'){ - if(_status.mode=='1v1'||_status.mode=='3v3') return; - else if(_status.mode=='2v2'){ + dieAfter2: function (source) { + if (_status.connectMode && _status.mode != "guandu") { + if (_status.mode == "1v1" || _status.mode == "3v3") return; + else if (_status.mode == "2v2") { var friend; - for(var i=0;i2)){ + var list = this.side == game.me.side ? _status.friend : _status.enemy; + if ( + (list.length == 0 && lib.storage.noreplace_end) || + (lib.storage.zhu && + lib.storage.main_zhu && + this.identity == "zhu" && + game.players.length > 2) + ) { return; - } - else if(game.friend.length==1&&this==game.friend[0]&&_status.friend.length==0){ + } else if ( + game.friend.length == 1 && + this == game.friend[0] && + _status.friend.length == 0 + ) { return; - } - else if(game.enemy.length==1&&this==game.enemy[0]&&_status.enemy.length==0){ + } else if ( + game.enemy.length == 1 && + this == game.enemy[0] && + _status.enemy.length == 0 + ) { return; - } - else{ - if(source){ - if(source.side!=this.side){ - if(lib.storage.versus_reward){ + } else { + if (source) { + if (source.side != this.side) { + if (lib.storage.versus_reward) { + source.draw(lib.storage.versus_reward); + } + } else { + if (lib.storage.versus_punish == "弃牌") { + source.discard(source.getCards("he")); + } else if ( + lib.storage.versus_punish == "摸牌" && + lib.storage.versus_reward + ) { source.draw(lib.storage.versus_reward); } } - else{ - if(lib.storage.versus_punish=='弃牌'){ - source.discard(source.getCards('he')); - } - else if(lib.storage.versus_punish=='摸牌'&&lib.storage.versus_reward){ - source.draw(lib.storage.versus_reward); - } - } - } - else{ + } else { game.delay(); } } } }, - dieAfter:function(source){ - if(_status.connectMode){ - if(_status.mode=='1v1'||_status.mode=='3v3'){ - game.broadcastAll(function(dead){ - if(dead.side==game.me.side){ + dieAfter: function (source) { + if (_status.connectMode) { + if (_status.mode == "1v1" || _status.mode == "3v3") { + game.broadcastAll(function (dead) { + if (dead.side == game.me.side) { _status.friendDied.push(dead.name1); - _status.friendCount.innerHTML='阵亡: '+get.cnNumber(_status.friendDied.length,true); - } - else{ + _status.friendCount.innerHTML = + "阵亡: " + get.cnNumber(_status.friendDied.length, true); + } else { _status.enemyDied.push(dead.name1); - _status.enemyCount.innerHTML='杀敌: '+get.cnNumber(_status.enemyDied.length,true); + _status.enemyCount.innerHTML = + "杀敌: " + get.cnNumber(_status.enemyDied.length, true); } - },this); - if(this.side==game.me.side){ - if(_status.friend.length==0){ + }, this); + if (this.side == game.me.side) { + if (_status.friend.length == 0) { game.over(false); return; } - } - else{ - if(_status.enemy.length==0){ + } else { + if (_status.enemy.length == 0) { game.over(true); return; } } game.replacePlayerOL(this); - } - else if(_status.mode=='2v2'){ - if(_status.replacetwo){ + } else if (_status.mode == "2v2") { + if (_status.replacetwo) { // later ? } var friend; - for(var i=0;i=side2.length+2){ + } else { + if (side1.length >= side2.length + 2) { me.showGiveup(); } } } return; - } - else if(_status.mode=='two'){ + } else if (_status.mode == "two") { var friend; - for(var i=0;imax){ - max=list[i].storage.longchuanzhibao; + for (var i = 0; i < list.length; i++) { + if (list[i].storage.longchuanzhibao > max) { + max = list[i].storage.longchuanzhibao; } } - for(var i=0;i2)){ - if(game.friend.includes(this)){ + var list = this.side == me.side ? _status.friend : _status.enemy; + if ( + (list.length == 0 && lib.storage.noreplace_end) || + (lib.storage.zhu && + lib.storage.main_zhu && + this.identity == "zhu" && + game.players.length > 2) + ) { + if (game.friend.includes(this)) { game.over(false); - } - else{ + } else { game.over(true); } - } - else if(game.friend.length==1&&this==game.friend[0]&&_status.friend.length==0){ + } else if ( + game.friend.length == 1 && + this == game.friend[0] && + _status.friend.length == 0 + ) { game.over(false); - } - else if(game.enemy.length==1&&this==game.enemy[0]&&_status.enemy.length==0){ + } else if ( + game.enemy.length == 1 && + this == game.enemy[0] && + _status.enemy.length == 0 + ) { game.over(true); - } - else{ + } else { game.replacePlayer(this); } } - } - } + }, + }, }, - get:{ - rawAttitude:function(from,to){ - if(from.side==to.side){ - if(to.identity=='zhu'){ - if(_status.connectMode){ - if(_status.mode=='4v4'||_status.mode=='guandu') return 7; - } - else{ - if(lib.storage.main_zhu||_status.mode=='four'||_status.mode=='guandu') return 7; + get: { + rawAttitude: function (from, to) { + if (from.side == to.side) { + if (to.identity == "zhu") { + if (_status.connectMode) { + if (_status.mode == "4v4" || _status.mode == "guandu") return 7; + } else { + if (lib.storage.main_zhu || _status.mode == "four" || _status.mode == "guandu") + return 7; } } return 6; - } - else{ - if(_status.mode=='siguo'){ - var list=['wei','shu','wu','qun']; - var map={wei:0,shu:0,wu:0,qun:0}; - var map2={wei:0,shu:0,wu:0,qun:0}; - for(var i=0;i=4){ - allin=i; + if (map2[i] >= 4) { + allin = i; break; - } - else if(map2[i]==3){ - map[i]+=10; - } - else if(map2[i]==2){ + } else if (map2[i] == 3) { + map[i] += 10; + } else if (map2[i] == 2) { map[i]++; } } - if(allin) return to.side==allin?-20:0; - list.sort(function(a,b){ - return map[b]-map[a]; + if (allin) return to.side == allin ? -20 : 0; + list.sort(function (a, b) { + return map[b] - map[a]; }); - var id1=list.indexOf(from.side); - var id2=list.indexOf(to.side); - var att=-1; - switch(id1){ - case 0:att=_status.siguoai[id2+2];break; + var id1 = list.indexOf(from.side); + var id2 = list.indexOf(to.side); + var att = -1; + switch (id1) { + case 0: + att = _status.siguoai[id2 + 2]; + break; case 1: - switch(id2){ - case 0:att=_status.siguoai[0];break; - case 2:att=_status.siguoai[1];break; - case 3:att=_status.siguoai[2];break; + switch (id2) { + case 0: + att = _status.siguoai[0]; + break; + case 2: + att = _status.siguoai[1]; + break; + case 3: + att = _status.siguoai[2]; + break; } break; case 2: - switch(id2){ - case 0:att=_status.siguoai[0];break; - case 1:att=_status.siguoai[1];break; - case 3:att=_status.siguoai[2];break; + switch (id2) { + case 0: + att = _status.siguoai[0]; + break; + case 1: + att = _status.siguoai[1]; + break; + case 3: + att = _status.siguoai[2]; + break; } break; - case 3:{ - if(id2==0){ - att=_status.siguoai[1];break; - } - else{ - att=_status.siguoai[2];break; + case 3: { + if (id2 == 0) { + att = _status.siguoai[1]; + break; + } else { + att = _status.siguoai[2]; + break; } } } - if(map2[to.side]>=4){ - att-=10; + if (map2[to.side] >= 4) { + att -= 10; + } else if (map2[to.side] == 3) { + att -= 3; + } else if (map2[to.side] == 2) { + att -= 0.5; } - else if(map2[to.side]==3){ - att-=3; - } - else if(map2[to.side]==2){ - att-=0.5; - } - if(to.storage.longchuanzhibao){ - return att*1.2; + if (to.storage.longchuanzhibao) { + return att * 1.2; } return att; - } - else{ - if(to.identity=='zhu'){ - if(_status.connectMode){ - if(_status.mode=='4v4'||_status.mode=='guandu') return -10; - } - else{ - if(lib.storage.main_zhu||_status.mode=='four'||_status.mode=='guandu') return -10; + } else { + if (to.identity == "zhu") { + if (_status.connectMode) { + if (_status.mode == "4v4" || _status.mode == "guandu") return -10; + } else { + if ( + lib.storage.main_zhu || + _status.mode == "four" || + _status.mode == "guandu" + ) + return -10; } } return -6; @@ -7744,20 +8786,20 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } }, }, - help:{ - '对决模式': - '
          同舟共济(四国)
          • 游戏开始时,每个势力的随机一名角色得到一个龙船至宝,1号位角色所在的势力额外获得一个龙船至宝,场上共5枚龙船至宝。龙船至宝是一个特殊标记。'+ - '
          • 争夺龙船至宝的方式:当敌人受到了你造成的伤害后,若其有龙船至宝,则你获得其一个龙船至宝。若你杀死了该敌人,则你获得其所有的龙船至宝。'+ - '
          • 获得龙船至宝时的摸牌:除游戏开始时外,若你从非队友处获得了龙船至宝,则你和队友各摸X张牌。(X为该次获得的龙船至宝数;获得队友的龙船至宝不摸牌)'+ - '
          • 无来源死亡时:当一名角色死亡时,若没有伤害来源,则其持有的所有龙船至宝交给场上龙船至宝数唯一最多的角色,若没有则随机分配,获得龙船至宝的角色和其队友各摸X张牌。'+ - '
          • 杀死队友时:当你杀死队友时,则将你和队友持有的所有龙船至宝交给场上龙船至宝数唯一最多的敌人,若没有则随机分配,获得龙船至宝的角色和其队友各摸X张牌。'+ - '
          • 胜利条件:满足一下任意条件游戏结束:(1)在新的一轮开始时,若你的势力获得的龙船至宝至少为4个,则你和队友获胜;(2)消灭所有敌人。'+ - '
          '+ - '
          2v2 替补模式
          • 选将时额外选择一名替补武将,阵亡时使用自己的替补武将上场,无替补时改为用队友的替补武将,两人均无替补时游戏结束'+ - '
          • 杀死敌方武将摸三张牌,杀死友方武将弃置所有牌
          '+ - '
          4v4
          • 双方各有一名主公和三名忠臣,杀死对方主公获胜
          • '+ - '8号位游戏开始时额外摸一张牌,7、8号位可在游戏开始时置换一次手牌
          • '+ - '杀死对方忠臣摸2+x张牌,x为对方(含刚被杀的忠臣)与己方的存活人数之差;主公杀死己方忠臣须弃置所有牌', - } + help: { + 对决模式: + '
            同舟共济(四国)
            • 游戏开始时,每个势力的随机一名角色得到一个龙船至宝,1号位角色所在的势力额外获得一个龙船至宝,场上共5枚龙船至宝。龙船至宝是一个特殊标记。' + + "
            • 争夺龙船至宝的方式:当敌人受到了你造成的伤害后,若其有龙船至宝,则你获得其一个龙船至宝。若你杀死了该敌人,则你获得其所有的龙船至宝。" + + "
            • 获得龙船至宝时的摸牌:除游戏开始时外,若你从非队友处获得了龙船至宝,则你和队友各摸X张牌。(X为该次获得的龙船至宝数;获得队友的龙船至宝不摸牌)" + + "
            • 无来源死亡时:当一名角色死亡时,若没有伤害来源,则其持有的所有龙船至宝交给场上龙船至宝数唯一最多的角色,若没有则随机分配,获得龙船至宝的角色和其队友各摸X张牌。" + + "
            • 杀死队友时:当你杀死队友时,则将你和队友持有的所有龙船至宝交给场上龙船至宝数唯一最多的敌人,若没有则随机分配,获得龙船至宝的角色和其队友各摸X张牌。" + + "
            • 胜利条件:满足一下任意条件游戏结束:(1)在新的一轮开始时,若你的势力获得的龙船至宝至少为4个,则你和队友获胜;(2)消灭所有敌人。" + + "
            " + + '
            2v2 替补模式
            • 选将时额外选择一名替补武将,阵亡时使用自己的替补武将上场,无替补时改为用队友的替补武将,两人均无替补时游戏结束' + + "
            • 杀死敌方武将摸三张牌,杀死友方武将弃置所有牌
            " + + '
            4v4
            • 双方各有一名主公和三名忠臣,杀死对方主公获胜
            • ' + + "8号位游戏开始时额外摸一张牌,7、8号位可在游戏开始时置换一次手牌
            • " + + "杀死对方忠臣摸2+x张牌,x为对方(含刚被杀的忠臣)与己方的存活人数之差;主公杀死己方忠臣须弃置所有牌", + }, }; });