From f8ca13c5fa9fbef8d168f38bed67bee80c3e7b41 Mon Sep 17 00:00:00 2001 From: libccy Date: Sun, 12 Nov 2017 21:16:14 +0800 Subject: [PATCH] 2 --- character/mtg.js | 139 +++++------------------------------ game/game.js | 186 +++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 182 insertions(+), 143 deletions(-) diff --git a/character/mtg.js b/character/mtg.js index 2b2ea4d5c..8c76cbd39 100644 --- a/character/mtg.js +++ b/character/mtg.js @@ -45,81 +45,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){ lingyong:{ enable:'phaseUse', filter:function(event,player){ - return player.hasSkillTag('lingyong'); + return !player.hasSkill('subplayer')&&player.getSubPlayers('lingyong_get').length>0; }, unique:true, forceunique:true, - group:'lingyong2', + group:'lingyong_get', direct:true, delay:0, skillAnimation:true, animationColor:'thunder', content:function(){ - 'step 0' - var list=[]; - var list2=[]; - var skills=player.getSkills(); - for(var i=0;i1){ - var dialog=ui.create.dialog('灵俑','hidden'); - dialog.add([list,'character']); - player.chooseButton(dialog,true); - } - else if(list.length==1){ - event.directresult=list[0]; - } - else{ - event.finish(); - } - player.logSkill('lingyong'); - 'step 1' - if(!event.directresult){ - if(result&&result.bool&&result.links[0]){ - event.directresult=result.links[0]; - } - else{ - event.finish(); - return; - } - } - if(event.directresult){ - var storage={}; - for(var i=0;i/g,'')+'之俑'; - lib.skill[name]={ - intro:{ - content:'出牌阶段,你可以移去此标记,然后变身为'+get.translation(trigger.player) + subSkill:{ + get:{ + trigger:{global:'dieAfter'}, + forced:true, + filter:function(event,player){ + return ![player.name,player.name1,player.name2].contains(event.player.name); }, - mark:'character', - onremove:true, - ai:{ - lingyong:true + content:function(){ + player.addSubPlayer({ + name:trigger.player.name, + skills:lib.character[trigger.player.name][3], + hs:get.cards(2), + intro:'出牌阶段,你可以调遣此随从', + intro2:'xx' + }); } } - player.storage[name]=trigger.player; - player.addSkill(name); - } - }, - lingyong3:{ - trigger:{player:'dieBefore'}, - forced:true, - priority:-9, - onremove:true, - mark:'character', - intro:{ - content:'死亡前变回莉莲娜' - }, - content:function(){ - 'step 0' - if(player.storage.lingyong3){ - player.reinit(player.storage.lingyong3.name2,'mtg_lilianna',[ - player.storage.lingyong3.hp, - player.storage.lingyong3.maxHp - ]); - player.update(); - for(var i in player.storage.lingyong3.storage){ - player.storage[i]=player.storage.lingyong3.storage[i]; - } - player.addSkill(player.storage.lingyong3.skills); - trigger.cancel(); - player.lose(player.getCards('he'),ui.discardPile)._triggered=null; - } - 'step 1' - if(player.storage.lingyong3){ - player.directgain(player.storage.lingyong3.hs); - player.directequip(player.storage.lingyong3.es); - } - player.removeSkill('lingyong3'); - }, - ai:{ - nosave:true, - threaten:0.8 } }, mhuanyi:{ diff --git a/game/game.js b/game/game.js index 39d0b6a3d..8877668d4 100644 --- a/game/game.js +++ b/game/game.js @@ -5577,7 +5577,7 @@ '
游戏操作
  • 在命令框中输出结果
    game.print(str)
  • 清除命令框中的内容
    cls
  • 上一条/下一条输入的内容
    up/down
  • 游戏结束
    game.over(bool)'+ '
  • 角色资料
    lib.character
  • 卡牌资料
    lib.card
', '游戏名词':'
  • 护甲:和体力类似,每点护甲可抵挡一点伤害,但不影响手牌上限'+ - '
  • 子武将:通过技能获得,拥有独立的技能、手牌区和装备区(共享判定区),出场时替代主武将的位置;子武将死亡时自动切换回主武将' + '
  • 随从:通过技能获得,拥有独立的技能、手牌区和装备区(共享判定区),出场时替代主武将的位置;随从死亡时自动切换回主武将' }, setIntro:function(node,func){ if(lib.config.touchscreen){ @@ -5911,6 +5911,9 @@ else if(nameinfo[4][i].indexOf('mode:')==0){ modeimage=nameinfo[4][i].slice(5);break; } + else if(nameinfo[4][i].indexOf('character:')==0){ + name=nameinfo[4][i].slice(10);break; + } } } if(extimage){ @@ -8975,6 +8978,104 @@ }, element:{ content:{ + exitSubPlayer:function(){ + 'step 0' + if(player.storage.subplayer){ + var current=player.storage.subplayer.name2; + player.reinit(current,player.storage.subplayer.name,[ + player.storage.subplayer.hp, + player.storage.subplayer.maxHp + ]); + player.update(); + if(event.remove){ + delete player.storage.subplayer.storage[current]; + player.storage.subplayer.skills.remove(current); + game.log(player,'牺牲了随从','#g'+current); + } + else{ + game.log(player,'收回了随从','#g'+current); + } + for(var i in player.storage.subplayer.storage){ + player.storage[i]=player.storage.subplayer.storage[i]; + } + player.addSkill(player.storage.subplayer.skills); + if(event.remove){ + player.lose(player.getCards('he'),ui.discardPile)._triggered=null; + } + else{ + player.storage[current].hs=player.getCards('h'); + player.storage[current].es=player.getCards('e'); + player.lose(player.getCards('he'),ui.special)._triggered=null; + } + } + 'step 1' + if(player.storage.subplayer){ + player.directgain(player.storage.subplayer.hs); + player.directequip(player.storage.subplayer.es); + } + player.removeSkill('subplayer'); + }, + callSubPlayer:function(){ + 'step 0' + var list=player.getSubPlayers(event.tag); + event.list=list; + if(!event.directresult){ + if(list.length>1){ + var dialog=ui.create.dialog('调遣一个随从','hidden'); + dialog.add([list,'character']); + player.chooseButton(dialog,true); + } + else if(list.length==1){ + event.directresult=list[0]; + } + else{ + event.finish(); + } + } + else{ + if(!list.contains(event.directresult)){ + event.finish(); + } + } + 'step 1' + if(!event.directresult){ + if(result&&result.bool&&result.links[0]){ + event.directresult=result.links[0]; + } + else{ + event.finish(); + return; + } + } + if(event.directresult){ + var storage={}; + for(var i=0;i