This commit is contained in:
libccy 2016-08-18 18:51:06 +08:00
parent 216383b569
commit 5327d6136f
9 changed files with 558 additions and 51 deletions

View File

@ -216,7 +216,9 @@ card.sp={
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseToUse('是否发动【银月枪】?',{name:'sha'}).logSkill='yinyueqiang'; var next=player.chooseToUse('是否发动【银月枪】?',{name:'sha'});
next.logSkill='yinyueqiang';
next.noButton=true;
'step 1' 'step 1'
if(result.bool){ if(result.bool){
game.delay(); game.delay();

View File

@ -1517,11 +1517,11 @@ card.swd={
trigger:{player:'phaseEnd'}, trigger:{player:'phaseEnd'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return player.num('he',{suit:'spade'})>0&&player.hp<player.maxHp; return player.num('he',{color:'red'})>0&&player.hp<player.maxHp;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
var next=player.chooseToDiscard('he',{suit:'spade'},'是否发动【寒晶】?'); var next=player.chooseToDiscard('he',{color:'red'},'是否发动【寒晶】?');
next.ai=function(card){ next.ai=function(card){
return 8-ai.get.value(card); return 8-ai.get.value(card);
}; };
@ -3602,11 +3602,11 @@ card.swd={
_xuanwuzhihuang:'玄武之璜', _xuanwuzhihuang:'玄武之璜',
xuanwuzhihuang_duanzao:'寒晶', xuanwuzhihuang_duanzao:'寒晶',
xuanwuzhihuang_info:'可用于煅造装备;此牌在你手牌中时,每当你造成伤害,你回复等量的体力', xuanwuzhihuang_info:'可用于煅造装备;此牌在你手牌中时,每当你造成伤害,你回复等量的体力',
xuanwuzhihuang_equip1_info:'回合结束阶段,你可以弃置一张黑桃牌并回复一点体力', xuanwuzhihuang_equip1_info:'回合结束阶段,你可以弃置一张红色牌并回复一点体力',
xuanwuzhihuang_equip2_info:'回合结束阶段,你可以弃置一张黑桃牌并回复一点体力', xuanwuzhihuang_equip2_info:'回合结束阶段,你可以弃置一张红色牌并回复一点体力',
xuanwuzhihuang_equip3_info:'回合结束阶段,你可以弃置一张黑桃牌并回复一点体力', xuanwuzhihuang_equip3_info:'回合结束阶段,你可以弃置一张红色牌并回复一点体力',
xuanwuzhihuang_equip4_info:'回合结束阶段,你可以弃置一张黑桃牌并回复一点体力', xuanwuzhihuang_equip4_info:'回合结束阶段,你可以弃置一张红色牌并回复一点体力',
xuanwuzhihuang_equip5_info:'回合结束阶段,你可以弃置一张黑桃牌并回复一点体力', xuanwuzhihuang_equip5_info:'回合结束阶段,你可以弃置一张红色牌并回复一点体力',
huanglinzhicong:'黄麟之琮', huanglinzhicong:'黄麟之琮',
_huanglinzhicong:'黄麟之琮', _huanglinzhicong:'黄麟之琮',
huanglinzhicong_duanzao:'玄甲', huanglinzhicong_duanzao:'玄甲',

View File

@ -1632,16 +1632,15 @@ character.hearth={
filter:function(event,player){ filter:function(event,player){
if(event.parent.parent.name=='phaseDraw') return false; if(event.parent.parent.name=='phaseDraw') return false;
if(event.parent.name=='fenlie') return false; if(event.parent.name=='fenlie') return false;
if(player.storage.fenlie>=3) return false;
if(!event.cards) return false; if(!event.cards) return false;
return true; return true;
}, },
usable:2,
content:function(){ content:function(){
var cards=[]; var cards=[];
for(var i=0;i<trigger.cards.length;i++){ for(var i=0;i<trigger.cards.length;i++){
cards.push(game.createCard(trigger.cards[i])); cards.push(game.createCard(trigger.cards[i]));
} }
player.storage.fenlie++;
player.gain(cards,'draw'); player.gain(cards,'draw');
}, },
ai:{ ai:{
@ -1652,16 +1651,6 @@ character.hearth={
} }
} }
} }
},
group:'fenlie2'
},
fenlie2:{
trigger:{global:'phaseBegin'},
forced:true,
popup:false,
silent:true,
content:function(){
player.storage.fenlie=0;
} }
}, },
nianfu:{ nianfu:{
@ -4055,6 +4044,9 @@ character.hearth={
selectTarget:-1, selectTarget:-1,
modTarget:true, modTarget:true,
content:function(){ content:function(){
'step 0'
target.chooseToDiscard('he',true);
'step 1'
target.draw(2); target.draw(2);
}, },
ai:{ ai:{
@ -4558,7 +4550,7 @@ character.hearth={
hsdusu_huoyanhua:'火焰花', hsdusu_huoyanhua:'火焰花',
hsdusu_huoyanhua_info:'对攻击范围内的一名角色造成一点火焰伤害', hsdusu_huoyanhua_info:'对攻击范围内的一名角色造成一点火焰伤害',
hsdusu_huangxuecao:'皇血草', hsdusu_huangxuecao:'皇血草',
hsdusu_huangxuecao_info:'两张牌', hsdusu_huangxuecao_info:'弃置一张牌并摸两张牌',
duxin:'毒心', duxin:'毒心',
duxin_info:'回合开始和结束阶段,你可以获得一张随机毒素牌', duxin_info:'回合开始和结束阶段,你可以获得一张随机毒素牌',
hstuteng:'图腾', hstuteng:'图腾',
@ -4635,7 +4627,7 @@ character.hearth={
hhudun:'护盾', hhudun:'护盾',
hhudun_info:'锁定技回合开始阶段若你的护甲值小于3你获得一点护甲', hhudun_info:'锁定技回合开始阶段若你的护甲值小于3你获得一点护甲',
fenlie:'分裂', fenlie:'分裂',
fenlie_info:'锁定技,每当你于摸牌阶段外获得卡牌,你获得一张此牌的复制,每回合最多发动次', fenlie_info:'锁定技,每当你于摸牌阶段外获得卡牌,你获得一张此牌的复制,每回合最多发动次',
nianfu:'粘附', nianfu:'粘附',
nianfu_info:'出牌阶段限一次你可以指定一名其他角色随机弃置其1~2张装备牌', nianfu_info:'出牌阶段限一次你可以指定一名其他角色随机弃置其1~2张装备牌',
shixu:'时序', shixu:'时序',

View File

@ -2261,12 +2261,16 @@ character.sp={
'step 1' 'step 1'
var choice=event.choice||result.control; var choice=event.choice||result.control;
if(choice=='武器牌'){ if(choice=='武器牌'){
target.discard(event.e1); if(event.e1){
target.discard(event.e1);
}
player.draw(); player.draw();
} }
else{ else{
player.equip(event.e2); if(event.e2){
target.$give(event.e2,player); player.equip(event.e2);
target.$give(event.e2,player);
}
} }
}, },
ai:{ ai:{

View File

@ -174,6 +174,7 @@ character.xianjian={
var num=0; var num=0;
var num2=0; var num2=0;
for(var i=0;i<player.storage.leiyu.length;i++){ for(var i=0;i<player.storage.leiyu.length;i++){
if(player.storage.leiyu[i].isDead()) continue;
var eff=ai.get.effect(player.storage.leiyu[i],{name:'jingleishan',nature:'thunder'},player,player); var eff=ai.get.effect(player.storage.leiyu[i],{name:'jingleishan',nature:'thunder'},player,player);
num+=eff; num+=eff;
if(eff>0){ if(eff>0){
@ -186,15 +187,30 @@ character.xianjian={
return num>0&&num2>=2; return num>0&&num2>=2;
}, },
prompt:function(event,player){ prompt:function(event,player){
for(var i=0;i<player.storage.leiyu.length;i++){
if(player.storage.leiyu[i].isDead()){
player.storage.leiyu.splice(i--,1);
}
}
return '是否对'+get.translation(player.storage.leiyu)+'发动【雷狱】?' return '是否对'+get.translation(player.storage.leiyu)+'发动【雷狱】?'
}, },
filter:function(event,player){ filter:function(event,player){
return player.storage.leiyu&&player.storage.leiyu.length>0; if(player.storage.leiyu){
for(var i=0;i<player.storage.leiyu.length;i++){
if(player.storage.leiyu[i].isAlive()) return true;
}
}
return false;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
player.loseHp(); player.loseHp();
'step 1' 'step 1'
for(var i=0;i<player.storage.leiyu.length;i++){
if(player.storage.leiyu[i].isDead()){
player.storage.leiyu.splice(i--,1);
}
}
player.storage.leiyu2=true; player.storage.leiyu2=true;
player.storage.leiyu.sort(lib.sort.seat); player.storage.leiyu.sort(lib.sort.seat);
player.useCard({name:'jingleishan',nature:'thunder'},player.storage.leiyu); player.useCard({name:'jingleishan',nature:'thunder'},player.storage.leiyu);

View File

@ -4511,6 +4511,12 @@
window.lib=lib; window.lib=lib;
window._status=_status; window._status=_status;
}, },
b:function(){
if(!ui.dialog||!ui.dialog.buttons) return;
for(var i=0;i<Math.min(arguments.length,ui.dialog.buttons.length);i++){
ui.dialog.buttons[i].link=arguments[i];
}
},
uy:function(me){ uy:function(me){
if(me){ if(me){
game.me.useCard({name:'spell_yexinglanghun'},game.me); game.me.useCard({name:'spell_yexinglanghun'},game.me);
@ -4629,13 +4635,23 @@
target.update(); target.update();
ui.updatehl(); ui.updatehl();
}, },
ge:function(){ ge:function(target){
cheat.g('zhuge'); if(target){
cheat.g('qilin'); cheat.gx('zhuge',target);
cheat.g('bagua'); cheat.gx('qilin',target);
cheat.g('dilu'); cheat.gx('bagua',target);
cheat.g('chitu'); cheat.gx('dilu',target);
cheat.g('muniu'); cheat.gx('chitu',target);
cheat.gx('muniu',target);
}
else{
cheat.g('zhuge');
cheat.g('qilin');
cheat.g('bagua');
cheat.g('dilu');
cheat.g('chitu');
cheat.g('muniu');
}
}, },
gj:function(){ gj:function(){
cheat.g('shandian'); cheat.g('shandian');
@ -12580,8 +12596,8 @@
this.node.range.innerHTML='范围: 1'; this.node.range.innerHTML='范围: 1';
} }
break; break;
case 'equip3':this.node.range.innerHTML='防御: 1';break; case 'equip3':this.node.range.innerHTML='防御: 1';this.node.name2.innerHTML+='+';break;
case 'equip4':this.node.range.innerHTML='进攻: 1';break; case 'equip4':this.node.range.innerHTML='进攻: 1';this.node.name2.innerHTML+='-';break;
} }
if(_status.connectMode&&!game.online&&lib.cardOL&&!this.cardid){ if(_status.connectMode&&!game.online&&lib.cardOL&&!this.cardid){
this.cardid=get.id(); this.cardid=get.id();
@ -18443,6 +18459,7 @@
if(info.viewAs&&info.viewAsFilter&&info.viewAsFilter(player)==false) enable=false; if(info.viewAs&&info.viewAsFilter&&info.viewAsFilter(player)==false) enable=false;
if(!event.isMine()&&event.aiexclude.contains(skills2[i])) enable=false; if(!event.isMine()&&event.aiexclude.contains(skills2[i])) enable=false;
if(info.usable&&get.skillCount(skills2[i])>=info.usable) enable=false; if(info.usable&&get.skillCount(skills2[i])>=info.usable) enable=false;
if(info.chooseButton&&_status.event.noButton) enable=false;
} }
if(enable){ if(enable){
skills.add(skills2[i]); skills.add(skills2[i]);
@ -19778,6 +19795,43 @@
if(listen) node.listen(listen); if(listen) node.listen(listen);
return node; return node;
}, },
node:function(){
var tagName,innerHTML,position,position2,style,divposition,listen;
for(var i=0;i<arguments.length;i++){
if(typeof arguments[i]=='string'){
if(typeof tagName=='string'){
innerHTML=arguments[i];
}
else{
tagName=arguments[i];
}
}
else if(get.objtype(arguments[i])=='div'||
get.objtype(arguments[i])=='table'||
get.objtype(arguments[i])=='tr'||
get.objtype(arguments[i])=='td'||
get.objtype(arguments[i])=='body') position=arguments[i];
else if(typeof arguments[i]=='number') position2=arguments[i];
else if(get.itemtype(arguments[i])=='divposition') divposition=arguments[i];
else if(typeof arguments[i]=='object') style=arguments[i];
else if(typeof arguments[i]=='function') listen=arguments[i];
}
if(tagName==undefined) tagName='div';
var node=document.createElement(tagName);
if(position){
if(typeof position2=='number'&&position.childNodes.length>position2){
position.insertBefore(node,position.childNodes[position2]);
}
else{
position.appendChild(node);
}
}
if(style) HTMLDivElement.prototype.css.call(node,style);
if(divposition) HTMLDivElement.prototype.setPosition.call(node,divposition);
if(innerHTML) node.innerHTML=innerHTML;
if(listen) node.onclick=listen;
return node;
},
chat:function(){ chat:function(){
var chat=ui.create.system('聊天',null,true); var chat=ui.create.system('聊天',null,true);
ui.chatButton=chat; ui.chatButton=chat;
@ -29425,6 +29479,11 @@
} }
if(game.online){ if(game.online){
game.send('auto'); game.send('auto');
}
else if(_status.connectMode){
game.broadcastAll(function(player){
player.setNickname(player.nickname+' - 托管');
},game.me);
} }
} }
else{ else{
@ -29435,6 +29494,11 @@
if(game.online){ if(game.online){
game.send('unauto'); game.send('unauto');
}
else if(_status.connectMode){
game.broadcastAll(function(player){
player.setNickname(player.nickname);
},game.me);
} }
} }
}, },

View File

@ -18,6 +18,7 @@ mode.brawl={
var clickCapt=function(){ var clickCapt=function(){
var active=this.parentNode.querySelector('.active'); var active=this.parentNode.querySelector('.active');
if(active){ if(active){
if(active==this) return;
for(var i=0;i<active.nodes.length;i++){ for(var i=0;i<active.nodes.length;i++){
active.nodes[i].remove(); active.nodes[i].remove();
if(active.nodes[i].showcaseinterval){ if(active.nodes[i].showcaseinterval){
@ -37,6 +38,8 @@ mode.brawl={
showcase.action(showcase._showcased?false:true); showcase.action(showcase._showcased?false:true);
showcase._showcased=true; showcase._showcased=true;
} }
if(this._nostart) start.style.display='none';
else start.style.display='';
game.save('currentBrawl',this.link); game.save('currentBrawl',this.link);
} }
var createNode=function(name){ var createNode=function(name){
@ -68,17 +71,12 @@ mode.brawl={
showcase showcase
]; ];
node.link=name; node.link=name;
node._nostart=info.nostart;
if(lib.storage.currentBrawl==name){ if(lib.storage.currentBrawl==name){
clickCapt.call(node); clickCapt.call(node);
} }
return node; return node;
} }
for(var i in lib.brawl){
createNode(i);
}
if(!lib.storage.currentBrawl){
clickCapt.call(packnode.firstChild);
}
var start=ui.create.div('.menubutton.round.highlight','斗',dialog.content,function(){ var start=ui.create.div('.menubutton.round.highlight','斗',dialog.content,function(){
var active=packnode.querySelector('.active'); var active=packnode.querySelector('.active');
if(active){ if(active){
@ -122,6 +120,12 @@ mode.brawl={
start.style.fontSize='72px'; start.style.fontSize='72px';
start.style.zIndex=3; start.style.zIndex=3;
start.style.transition='all 0s'; start.style.transition='all 0s';
for(var i in lib.brawl){
createNode(i);
}
if(!lib.storage.currentBrawl){
clickCapt.call(packnode.firstChild);
}
}, },
brawl:{ brawl:{
duzhansanguo:{ duzhansanguo:{
@ -215,7 +219,7 @@ mode.brawl={
card.style.transform='scale(0.9)'; card.style.transform='scale(0.9)';
} }
else{ else{
card=ui.create.card(); card=ui.create.card(null,null,true);
} }
card.style.opacity=0; card.style.opacity=0;
card.style.position='absolute'; card.style.position='absolute';
@ -348,11 +352,11 @@ mode.brawl={
} }
num2++; num2++;
switch(num++){ switch(num++){
case 0:dx=-150;dy=0;break; case 0:dx=-180;dy=0;break;
case 1:dx=-120;dy=100;break; case 1:dx=-140;dy=100;break;
case 2:dx=0;dy=155;break; case 2:dx=0;dy=155;break;
case 3:dx=120;dy=100;break; case 3:dx=140;dy=100;break;
case 4:dx=150;dy=0;break; case 4:dx=180;dy=0;break;
} }
if(num>=5){ if(num>=5){
num=0; num=0;
@ -594,6 +598,8 @@ mode.brawl={
card.node.hp.remove(); card.node.hp.remove();
node.nodes.push(card); node.nodes.push(card);
card.style.position='absolute'; card.style.position='absolute';
card.style.zIndex=2;
card.style.transition='all 2s';
var rand1=Math.round(Math.random()*100); var rand1=Math.round(Math.random()*100);
var rand2=Math.round(Math.random()*100); var rand2=Math.round(Math.random()*100);
var rand3=Math.round(Math.random()*40)-20; var rand3=Math.round(Math.random()*40)-20;
@ -601,7 +607,26 @@ mode.brawl={
card.style.top='calc('+rand2+'% - '+(rand2*1.8)+'px)'; card.style.top='calc('+rand2+'% - '+(rand2*1.8)+'px)';
card.style.transform='scale(0.8) rotate('+rand3+'deg)'; card.style.transform='scale(0.8) rotate('+rand3+'deg)';
node.appendChild(card); node.appendChild(card);
ui.refresh(card);
}; };
var list2=['qilin','dawan','zhuahuang'];
var func2=function(){
var card=game.createCard(list2.shift());
node.nodes.push(card);
card.style.position='absolute';
card.style.zIndex=2;
card.style.transition='all 2s';
var rand1=Math.round(Math.random()*100);
var rand2=Math.round(Math.random()*100);
var rand3=Math.round(Math.random()*40)-20;
card.style.left='calc('+rand1+'% - '+rand1+'px)';
card.style.top='calc('+rand2+'% - '+rand2+'px)';
card.style.transform='rotate('+rand3+'deg)';
node.appendChild(card);
ui.refresh(card);
};
if(init){ if(init){
node.nodes=[]; node.nodes=[];
} }
@ -610,9 +635,36 @@ mode.brawl={
node.nodes.shift().remove(); node.nodes.shift().remove();
} }
} }
for(var i=0;i<8;i++){ for(var i=0;i<5;i++){
func(); func();
} }
for(var i=0;i<3;i++){
func2();
func();
}
var func3=function(){
for(var i=0;i<node.nodes.length;i++){
var card=node.nodes[i];
if(card.classList.contains('player')){
var rand1=Math.round(Math.random()*100);
var rand2=Math.round(Math.random()*100);
var rand3=Math.round(Math.random()*40)-20;
card.style.left='calc('+rand1+'% - '+(rand1*1.5)+'px)';
card.style.top='calc('+rand2+'% - '+(rand2*1.8)+'px)';
card.style.transform='scale(0.8) rotate('+rand3+'deg)';
}
else{
var rand1=Math.round(Math.random()*100);
var rand2=Math.round(Math.random()*100);
var rand3=Math.round(Math.random()*40)-20;
card.style.left='calc('+rand1+'% - '+rand1+'px)';
card.style.top='calc('+rand2+'% - '+rand2+'px)';
card.style.transform='rotate('+rand3+'deg)';
}
}
}
func3();
node.showcaseinterval=setInterval(func3,5000);
}, },
content:{ content:{
cardPile:function(list){ cardPile:function(list){
@ -650,7 +702,9 @@ mode.brawl={
return ['re_caocao']; return ['re_caocao'];
} }
else{ else{
return _status.brawl.list.randomGets(1); _status.brawl.list.randomSort();
return _status.brawl.list;
// return _status.brawl.list.randomGets(1);
} }
} }
} }
@ -757,7 +811,368 @@ mode.brawl={
// '玩家在选将时可从6-8张的武将牌里选择两张武将牌一张面向大家可见加入游戏另一张是隐藏面孔暗置', // '玩家在选将时可从6-8张的武将牌里选择两张武将牌一张面向大家可见加入游戏另一张是隐藏面孔暗置',
// '选择的两张武将牌需满足以下至少两个条件1.性别相同2.体力上限相同3.技能数量相同', // '选择的两张武将牌需满足以下至少两个条件1.性别相同2.体力上限相同3.技能数量相同',
// '每名玩家在其回合开始或回合结束时,可以选择将自己的武将牌弃置,然后使用暗置的武将牌进行剩余的游戏' // '每名玩家在其回合开始或回合结束时,可以选择将自己的武将牌弃置,然后使用暗置的武将牌进行剩余的游戏'
// ] // ],
// content:{
// submode:'two',
// chooseCharacterNum:2,
// chooseCharacterAfter:function(){
//
// }
// }
// } // }
scene:{
name:'自创场景',
mode:'identity',
intro:'场景名称:<input name="scenename" type="text" style="width:120px"><br>场景说明:<input name="sceneintro" type="text" style="width:120px">',
content:{
submode:'normal'
},
nostart:true,
showcase:function(init){
if(init){
this.style.transition='all 0s';
this.style.height=(this.offsetHeight-10)+'px';
this.style.overflow='scroll';
lib.setScroll(this);
this.style.paddingTop='10px';
var style={marginLeft:'3px',marginRight:'3px'};
var style2={position:'relative',display:'block',left:0,top:0,marginBottom:'6px',padding:0,width:'100%'};
var line1=ui.create.div(style2,this);
var current=null;
var addCharacter=ui.create.node('button','添加角色',line1,function(){
line1.style.display='none';
line7.style.display='none';
line2.style.display='block';
line2_t.style.display='block';
line3.style.display='block';
line4.style.display='block';
line5.style.display='block';
line6_h.style.display='block';
line6_e.style.display='block';
line6_j.style.display='block';
capt1.style.display='block';
capt2.style.display='block';
if(line6_h.childElementCount) capt_h.style.display='block';
if(line6_e.childElementCount) capt_e.style.display='block';
if(line6_j.childElementCount) capt_j.style.display='block';
},style);
var editPile=ui.create.node('button','编辑牌堆',line1,function(){
console.log(1);
},style);
var saveButton=ui.create.node('button','保存',line1,function(){
console.log(1);
},style);
var capt1=ui.create.div(style2,'','角色信息',this);
var line2=ui.create.div(style2,this);
line2.style.display='none';
var identity=ui.create.selectlist([['zhu','主公'],['zhong','忠臣'],['nei','内奸'],['fan','反贼']],'zhu',line2);
identity.style.marginLeft='3px';
identity.style.marginRight='3px';
var position=ui.create.selectlist([['1','一号位'],['2','二号位'],['3','三号位'],['4','四号位'],['5','五号位'],['6','六号位'],['7','七号位'],['8','八号位']],'1',line2);
position.style.marginLeft='3px';
position.style.marginRight='3px';
var line2_t=ui.create.div(style2,this);
line2_t.style.display='none';
ui.create.node('span','体力:',line2_t);
var hp=ui.create.node('input',line2_t,{width:'40px'});
hp.type='text';
ui.create.node('span','体力上限:',line2_t,{marginLeft:'20px'});
var maxHp=ui.create.node('input',line2_t,{width:'40px'});
maxHp.type='text';
var list=[];
for(var i in lib.character){
list.push([i,lib.translate[i]]);
}
list.sort(function(a,b){
a=a[0];b=b[0];
var aa=a,bb=b;
if(aa.indexOf('_')!=-1){
aa=aa.slice(aa.indexOf('_')+1);
}
if(bb.indexOf('_')!=-1){
bb=bb.slice(bb.indexOf('_')+1);
}
if(aa!=bb){
return aa>bb?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';
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<lib.config.cards.length;i++){
if(!lib.cardPack[lib.config.cards[i]]) continue;
for(var j=0;j<lib.cardPack[lib.config.cards[i]].length;j++){
var cname=lib.cardPack[lib.config.cards[i]][j];
pileaddlist.push([cname,get.translation(cname)]);
if(cname=='sha'){
pileaddlist.push(['huosha','火杀']);
pileaddlist.push(['leisha','雷杀']);
}
}
}
for(var i in lib.cardPack){
if(lib.config.all.cards.contains(i)) continue;
for(var j=0;j<lib.cardPack[i].length;j++){
var cname=lib.cardPack[i][j];
pileaddlist.push([cname,get.translation(cname)]);
}
}
pileaddlist.unshift(['random',['随机卡牌']])
var cardpileaddname=ui.create.selectlist(pileaddlist,null,line3);
cardpileaddname.style.marginLeft='3px';
cardpileaddname.style.marginRight='3px';
cardpileaddname.style.maxWidth='80px';
var cardpileaddsuit=ui.create.selectlist([
['random','随机花色'],
['heart','红桃'],
['diamond','方片'],
['club','梅花'],
['spade','黑桃'],
],null,line3);
cardpileaddsuit.style.marginLeft='3px';
cardpileaddsuit.style.marginRight='3px';
var cardpileaddnumber=ui.create.selectlist([
['random','随机点数'],1,2,3,4,5,6,7,8,9,10,11,12,13
],null,line3);
cardpileaddnumber.style.marginLeft='3px';
cardpileaddnumber.style.marginRight='3px';
var cc_h=ui.create.node('button','加入手牌',line5,function(){
var card=ui.create.card(null,'noclick',true);
card.style.zoom=0.6;
var name=cardpileaddname.value;
var suit=cardpileaddsuit.value;
var number=parseInt(cardpileaddnumber.value);
var name2=name;
var suit2=suit;
var number2=number;
if(name2=='random') name2='sha';
if(suit2=='random') suit2='?';
if(!number2){
number='random';
number2='?';
}
card.init([suit2,number2,name2]);
card.name=name;
card.suit=suit;
card.number=number;
if(name=='random'){
card.node.name.innerHTML=get.verticalStr('随机卡牌');
}
card.listen(function(){
this.remove();
if(!line6_h.childElementCount) capt_h.style.display='none';
});
line6_h.appendChild(card);
capt_h.style.display='block';
});
var cc_e=ui.create.node('button','加入装备',line5,function(){
if(get.type(cardpileaddname.value)!='equip') return;
var subtype=get.subtype(cardpileaddname.value);
for(var i=0;i<line6_e.childElementCount;i++){
if(get.subtype(line6_e.childNodes[i].name)==subtype){
line6_e.childNodes[i].remove();break;
}
}
var card=ui.create.card(null,'noclick',true);
card.style.zoom=0.6;
var name=cardpileaddname.value;
var suit=cardpileaddsuit.value;
var number=parseInt(cardpileaddnumber.value);
var name2=name;
var suit2=suit;
var number2=number;
if(name2=='random') name2='sha';
if(suit2=='random') suit2='?';
if(!number2){
number='random';
number2='?';
}
card.init([suit2,number2,name2]);
card.name=name;
card.suit=suit;
card.number=number;
if(name=='random'){
card.node.name.innerHTML=get.verticalStr('随机卡牌');
}
card.listen(function(){
this.remove();
if(!line6_e.childElementCount) capt_e.style.display='none';
});
line6_e.appendChild(card);
capt_e.style.display='block';
});
var cc_j=ui.create.node('button','加入判定',line5,function(){
if(get.type(cardpileaddname.value)!='delay') return;
for(var i=0;i<line6_j.childElementCount;i++){
if(line6_j.childNodes[i].name==cardpileaddname.value){
line6_j.childNodes[i].remove();break;
}
}
var card=ui.create.card(null,'noclick',true);
card.style.zoom=0.6;
var name=cardpileaddname.value;
var suit=cardpileaddsuit.value;
var number=parseInt(cardpileaddnumber.value);
var name2=name;
var suit2=suit;
var number2=number;
if(name2=='random') name2='sha';
if(suit2=='random') suit2='?';
if(!number2){
number='random';
number2='?';
}
card.init([suit2,number2,name2]);
card.name=name;
card.suit=suit;
card.number=number;
if(name=='random'){
card.node.name.innerHTML=get.verticalStr('随机卡牌');
}
card.listen(function(){
this.remove();
if(!line6_j.childElementCount) capt_j.style.display='none';
});
line6_j.appendChild(card);
capt_j.style.display='block';
});
cc_h.style.marginLeft='3px';
cc_h.style.marginRight='3px';
cc_e.style.marginLeft='3px';
cc_e.style.marginRight='3px';
cc_j.style.marginLeft='3px';
cc_j.style.marginRight='3px';
var capt_h=ui.create.div(style2,'','手牌区',this);
var line6_h=ui.create.div(style2,this);
var capt_e=ui.create.div(style2,'','装备区',this);
var line6_e=ui.create.div(style2,this);
var capt_j=ui.create.div(style2,'','判定区',this);
var line6_j=ui.create.div(style2,this);
line6_j.style.marginBottom='10px';
capt_h.style.display='none';
capt_e.style.display='none';
capt_j.style.display='none';
var line4=ui.create.div(style2,this);
line4.style.display='none';
var resetCharacter=function(){
line1.style.display='block';
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='zhu';
position.value='1';
hp.value='';
maxHp.value='';
line6_h.innerHTML='';
line6_e.innerHTML='';
line6_j.innerHTML='';
cardpileaddname.value='random';
cardpileaddsuit.value='random';
cardpileaddnumber.value='random';
};
ui.create.node('button','确定',line4,style,function(){
var info={
name:name1.value,
name2:name2.value,
identity:identity.value,
position:position.value,
hp:hp.value,
maxHp:maxHp.value,
handcards:[],
equips:[],
judges:[]
};
for(var i=0;i<line6_h.childElementCount;i++){
info.handcards.push([line6_h.childNodes[i].name,line6_h.childNodes[i].suit,line6_h.childNodes[i].number]);
}
for(var i=0;i<line6_e.childElementCount;i++){
info.equips.push([line6_e.childNodes[i].name,line6_e.childNodes[i].suit,line6_e.childNodes[i].number]);
}
for(var i=0;i<line6_j.childElementCount;i++){
info.judges.push([line6_j.childNodes[i].name,line6_j.childNodes[i].suit,line6_j.childNodes[i].number]);
}
var player=ui.create.player();
var name=info.name,name3=info.name2;
if(name=='random'){
name='re_caocao';
}
if(name3!='none'){
if(name3=='random'){
name3='liubei';
}
player.init(name,name3);
if(info.name2=='random'){
player.node.name2.innerHTML=get.verticalStr('随机副将');
}
}
else{
player.init(name);
}
if(info.name=='random'){
player.node.name.innerHTML=get.verticalStr('随机主将');
}
if(info.maxHp){
player.maxHp=info.maxHp;
}
if(info.hp){
player.hp=Math.min(info.hp,player.maxHp);
}
for(var i=0;i<info.handcards.length;i++){
player.node.handcards.appendChild(ui.create.card());
}
player.update();
player.style.zoom=0.6;
player.style.position='relative';
player.style.left=0;
player.style.top=0;
player.style.margin='8px';
player.node.marks.remove();
line7.appendChild(player);
resetCharacter();
});
ui.create.node('button','取消',line4,style,resetCharacter);
var line7=ui.create.div(style2,this);
line7.style.marginTop='12px';
}
}
}
} }
}; };

View File

@ -84,7 +84,6 @@ mode.chess={
lib.config.game_speed='vfast'; lib.config.game_speed='vfast';
_status.auto=true; _status.auto=true;
setTimeout(function(){ setTimeout(function(){
console.log(get.translation(game.players));
ui.updatehl(); ui.updatehl();
},500); },500);
ui.auto.classList.add('glow'); ui.auto.classList.add('glow');
@ -1240,6 +1239,7 @@ mode.chess={
event.swapNow=true; event.swapNow=true;
} }
'step 1' 'step 1'
game.uncheck();
var player=game.addChessPlayer(event.playername,event.enemy); var player=game.addChessPlayer(event.playername,event.enemy);
game.log(player,'加入游戏'); game.log(player,'加入游戏');
player.chessFocus(); player.chessFocus();

View File

@ -249,6 +249,7 @@ mode.versus={
else{ else{
var firstAct; var firstAct;
if(lib.storage.zhu){ if(lib.storage.zhu){
_status.currentSide=true;
firstAct=(_status.currentSide==game.me.side)?game.friendZhu:game.enemyZhu; firstAct=(_status.currentSide==game.me.side)?game.friendZhu:game.enemyZhu;
} }
else{ else{
@ -309,7 +310,6 @@ mode.versus={
lib.setPopped(_status.enemyCount,game.versusHoverEnemy); lib.setPopped(_status.enemyCount,game.versusHoverEnemy);
if(lib.storage.zhu){ if(lib.storage.zhu){
_status.currentSide=true;
game.versusPhaseLoop(firstAct); game.versusPhaseLoop(firstAct);
} }
else{ else{
@ -2493,6 +2493,7 @@ mode.versus={
event.character=list[Math.floor(Math.random()*list.length)]; event.character=list[Math.floor(Math.random()*list.length)];
} }
"step 1" "step 1"
game.uncheck();
_status.friend.remove(event.character); _status.friend.remove(event.character);
_status.enemy.remove(event.character); _status.enemy.remove(event.character);
source.revive(null,false); source.revive(null,false);
@ -2507,6 +2508,16 @@ mode.versus={
source.node.identity.dataset.color=get.translation(source.side+'Color'); source.node.identity.dataset.color=get.translation(source.side+'Color');
source.draw(4); source.draw(4);
_status.event.parent.parent.parent.untrigger(false,source); _status.event.parent.parent.parent.untrigger(false,source);
var evt=_status.event.parent.parent.parent;
for(var i=0;i<100;i++){
evt=evt.parent;
if(evt.player==source){
evt.finish();
}
if(evt.name=='phase'){
break;
}
}
if(lib.storage.single_control&&lib.storage.control_all){ if(lib.storage.single_control&&lib.storage.control_all){
game.onSwapControl(); game.onSwapControl();
} }
@ -2585,12 +2596,14 @@ mode.versus={
if(ui.confirm) ui.confirm.close(); if(ui.confirm) ui.confirm.close();
delete event.player; delete event.player;
game.resume(); game.resume();
game.uncheck();
} }
event.switchToAuto=function(){ event.switchToAuto=function(){
event.result=_status.friend.randomGet(); event.result=_status.friend.randomGet();
event.dialog.close(); event.dialog.close();
if(ui.confirm) ui.confirm.close(); if(ui.confirm) ui.confirm.close();
delete event.player; delete event.player;
game.uncheck();
}; };
game.check(); game.check();
game.pause(); game.pause();
@ -2603,6 +2616,7 @@ mode.versus={
} }
} }
'step 2' 'step 2'
game.uncheck();
if(!event.directresult){ if(!event.directresult){
if(event.resultOL){ if(event.resultOL){
event.directresult=event.resultOL[source.playerid]; event.directresult=event.resultOL[source.playerid];