This commit is contained in:
libccy 2017-11-12 22:03:10 +08:00
parent f8ca13c5fa
commit fa5a9573ce
2 changed files with 84 additions and 26 deletions

View File

@ -2,6 +2,7 @@
game.import('character',function(lib,game,ui,get,ai,_status){ game.import('character',function(lib,game,ui,get,ai,_status){
return { return {
name:'mtg', name:'mtg',
connect:true,
character:{ character:{
mtg_jiding:['male','qun',4,['mbaizhan','msilian']], mtg_jiding:['male','qun',4,['mbaizhan','msilian']],
// mtg_qianzhuo:['female','shu',3,[]], // mtg_qianzhuo:['female','shu',3,[]],
@ -80,8 +81,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
name:trigger.player.name, name:trigger.player.name,
skills:lib.character[trigger.player.name][3], skills:lib.character[trigger.player.name][3],
hs:get.cards(2), hs:get.cards(2),
intro:'出牌阶段,你可以调遣此随从', intro:'出牌阶段,你可以调遣此随从(直到随从死亡不可再次切换)'
intro2:'xx'
}); });
} }
} }
@ -471,7 +471,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
lingyong2:'灵俑', lingyong2:'灵俑',
lingyong3:'灵俑', lingyong3:'灵俑',
lingyong3_bg:'俑', lingyong3_bg:'俑',
lingyong_info:'锁定技,每当一名角色死亡你获得一枚对应该角色主将的灵俑标记出牌阶段你可以弃置一枚灵俑标记并变身为标记对应的角色体力上限设为1若如此做你将你的牌移出游戏结束出牌阶段并获得一个额外回合处于变身状态的你在死亡前变回原形', lingyong_info:'锁定技,每当一名其他角色死亡你获得一个与该角色同名且体力上限为1、初始手牌为2的随从出牌阶段你可以调遣以此法获得的随从直到随从死亡不可再次切换',
mbaizhan:'百战', mbaizhan:'百战',
mbaizhan_info:'锁定技,每当你造成一点伤害,你获得一点护甲', mbaizhan_info:'锁定技,每当你造成一点伤害,你获得一点护甲',
msilian:'祀炼', msilian:'祀炼',

View File

@ -8304,6 +8304,16 @@
window.lib=lib; window.lib=lib;
window._status=_status; window._status=_status;
}, },
dy:function(){
var next=game.me.next;
for(var i=0;i<10;i++){
if(next.identity!='zhu'){
break;
}
next=next.next;
}
next.die();
},
x:function(){ x:function(){
var gl=function(dir,callback){ var gl=function(dir,callback){
var files=[],folders=[]; var files=[],folders=[];
@ -9075,6 +9085,8 @@
if(cfg.hs.length) player.directgain(cfg.hs); if(cfg.hs.length) player.directgain(cfg.hs);
if(cfg.es.length) player.directequip(cfg.es); if(cfg.es.length) player.directequip(cfg.es);
} }
'step 2'
game.delay();
}, },
reverseOrder:function(){ reverseOrder:function(){
"step 0" "step 0"
@ -13525,6 +13537,7 @@
this.sex=info2[0]; this.sex=info2[0];
this.name=to; this.name=to;
} }
this.smoothAvatar(true);
this.node.avatar2.setBackground(to,'character'); this.node.avatar2.setBackground(to,'character');
this.node.name2.innerHTML=get.slimName(to); this.node.name2.innerHTML=get.slimName(to);
} }
@ -13536,6 +13549,7 @@
this.name=to; this.name=to;
this.sex=info2[0]; this.sex=info2[0];
} }
this.smoothAvatar(false);
this.node.avatar.setBackground(to,'character'); this.node.avatar.setBackground(to,'character');
this.node.name.innerHTML=get.slimName(to); this.node.name.innerHTML=get.slimName(to);
} }
@ -13644,10 +13658,15 @@
return this; return this;
}, },
smoothAvatar:function(){ smoothAvatar:function(vice){
var div=ui.create.div('.fullsize'); var div=ui.create.div('.fullsize');
div.style.background=getComputedStyle(this.node.avatar).background; div.style.background=getComputedStyle(this.node.avatar).background;
if(vice){
this.node.avatar2.appendChild(div);
}
else{
this.node.avatar.appendChild(div); this.node.avatar.appendChild(div);
}
ui.refresh(div); ui.refresh(div);
div.style.transition='all 1s'; div.style.transition='all 1s';
setTimeout(function(){ setTimeout(function(){
@ -13656,7 +13675,7 @@
div.remove(); div.remove();
},2000); },2000);
},100); },100);
game.addVideo('smoothAvatar',this); game.addVideo('smoothAvatar',this,vice);
}, },
changeSeat:function(position,video){ changeSeat:function(position,video){
var player=this; var player=this;
@ -16851,17 +16870,6 @@
}, },
addSubPlayer:function(cfg){ addSubPlayer:function(cfg){
var skill='subplayer_'+cfg.name+'_'+get.id(); var skill='subplayer_'+cfg.name+'_'+get.id();
lib.skill[skill]={
intro:{
content:cfg.intro||''
},
mark:'character',
onremove:true,
subplayer:cfg.skill||_status.event.name,
ai:{
subplayer:true
}
}
cfg.hs=cfg.hs||[]; cfg.hs=cfg.hs||[];
cfg.es=cfg.es||[]; cfg.es=cfg.es||[];
cfg.skills=cfg.skills||[]; cfg.skills=cfg.skills||[];
@ -16879,9 +16887,24 @@
cfg.source=this.name; cfg.source=this.name;
} }
} }
game.broadcastAll(function(player,skill,cfg){
lib.skill[skill]={
intro:{
content:cfg.intro||''
},
mark:'character',
onremove:true,
subplayer:cfg.skill,
ai:{
subplayer:true
}
}
lib.character[skill]=[cfg.sex,cfg.group,cfg.maxHp,cfg.skills,['character:'+cfg.name]]; lib.character[skill]=[cfg.sex,cfg.group,cfg.maxHp,cfg.skills,['character:'+cfg.name]];
lib.translate[skill]=cfg.caption||get.rawName(cfg.name); lib.translate[skill]=cfg.caption||get.rawName(cfg.name);
this.storage[skill]=cfg; player.storage[skill]=cfg;
},this,skill,cfg);
game.addVideo('addSubPlayer',this,[skill,lib.skill[skill],lib.character[skill],lib.translate[skill],{name:cfg.name}]);
this.addSkill(skill); this.addSkill(skill);
}, },
removeSubPlayer:function(){ removeSubPlayer:function(){
@ -17028,7 +17051,17 @@
intro=intro.replace(/&/g,get.cnNumber(this.storage[skill])); intro=intro.replace(/&/g,get.cnNumber(this.storage[skill]));
intro=intro.replace(/\$/g,get.translation(this.storage[skill])); intro=intro.replace(/\$/g,get.translation(this.storage[skill]));
} }
this.markSkillCharacter(skill,this.storage[skill],get.translation(skill),intro); var caption;
if(typeof info.intro.name=='function'){
caption=info.intro.name(this.storage[skill],this);
}
else if(typeof info.intro.name=='string'){
caption=info.name;
}
else{
caption=get.translation(skill);
}
this.markSkillCharacter(skill,this.storage[skill],caption,intro);
} }
else{ else{
this.markSkill(skill); this.markSkill(skill);
@ -20797,10 +20830,10 @@
content:function(storage,player){ content:function(storage,player){
if(typeof storage.intro2=='string') return storage.intro2; if(typeof storage.intro2=='string') return storage.intro2;
if(typeof storage.intro2=='function') return storage.intro2(storage,player); if(typeof storage.intro2=='function') return storage.intro2(storage,player);
return '死亡前变回'+get.translation(storage.name); return '死亡前切换回主武将'
}, },
name:function(storage){ name:function(storage){
return get.rawName(storage.name2); return get.rawName(storage.name);
} }
}, },
content:function(){ content:function(){
@ -23549,9 +23582,28 @@
console.log(player); console.log(player);
} }
}, },
smoothAvatar:function(player){ smoothAvatar:function(player,vice){
if(player&&player.node&&player.node.avatar){ if(player&&player.node){
player.smoothAvatar(); if(vice){
if(player.node.avatar2){
player.smoothAvatar(vice);
}
}
else{
if(player.node.avatar){
player.smoothAvatar(vice);
}
}
}
},
addSubPlayer:function(player,content){
if(player&&content&&content[0]&&content[1]&&
content[2]&&content[3]&&content[4]){
var skill=content[0];
lib.skill[skill]=content[1];
lib.character[skill]=content[2];
lib.translate[skill]=content[3];
player.storage[skill]=content[4];
} }
}, },
arenaNumber:function(content){ arenaNumber:function(content){
@ -25938,6 +25990,12 @@
} }
} }
} }
if(newvid.name1&&newvid.name1.indexOf('subplayer_')==0){
newvid.name1=newvid.name1.slice(10,newvid.name1.lastIndexOf('_'));
}
if(newvid.name2&&newvid.name2.indexOf('subplayer_')==0){
newvid.name1=newvid.name2.slice(10,newvid.name1.lastIndexOf('_'));
}
lib.videos.unshift(newvid); lib.videos.unshift(newvid);
store.put(newvid); store.put(newvid);
ui.create.videoNode(newvid,true); ui.create.videoNode(newvid,true);