炉石模式

This commit is contained in:
libccy 2015-05-03 23:17:15 +08:00
parent 8a4cd7532d
commit 00acd45371
46 changed files with 666 additions and 128 deletions

View File

@ -106,9 +106,12 @@ card.extra={
result:{ result:{
player:function(player){ player:function(player){
var nh=player.num('h'); var nh=player.num('h');
if(nh==2&&player.hp==1) return 0;
if(nh<=player.hp&& if(nh<=player.hp&&
_status.event.name=='chooseToUse'&&_status.event.filterCard({name:'huogong'})) return -10; _status.event.name=='chooseToUse'&&
_status.event.filterCard({name:'huogong'})){
return -10;
}
return 0;
}, },
target:function(player,target){ target:function(player,target){
if(target.skills.contains('huogong2')) return 0; if(target.skills.contains('huogong2')) return 0;

View File

@ -116,6 +116,7 @@ card.qimou={
type:'trick', type:'trick',
enable:true, enable:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(target.isMin()) return false;
if(ui.selected.targets.length){ if(ui.selected.targets.length){
return target.get('e',{subtype:'equip5'}).length==0; return target.get('e',{subtype:'equip5'}).length==0;
} }

View File

@ -314,6 +314,7 @@ character.mountain={
for(var i=0;i<judges.length;i++){ for(var i=0;i<judges.length;i++){
if(!target.hasJudge(judges[i].viewAs||judges[i].name)) return true; if(!target.hasJudge(judges[i].viewAs||judges[i].name)) return true;
} }
if(target.isMin()) return false;
if((from.get('e','1')&&!target.get('e','1'))|| if((from.get('e','1')&&!target.get('e','1'))||
(from.get('e','2')&&!target.get('e','2'))|| (from.get('e','2')&&!target.get('e','2'))||
(from.get('e','3')&&!target.get('e','3'))|| (from.get('e','3')&&!target.get('e','3'))||
@ -645,6 +646,7 @@ character.mountain={
return 6-ai.get.value(card); return 6-ai.get.value(card);
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(target.isMin()) return false;
return player!=target&&!target.get('e',get.subtype(card)[5]); return player!=target&&!target.get('e',get.subtype(card)[5]);
}, },
content:function(){ content:function(){

View File

@ -2480,6 +2480,7 @@ character.sp={
}, },
trigger:{player:'shaBefore'}, trigger:{player:'shaBefore'},
forced:true, forced:true,
popup:false,
check:function(event,player){ check:function(event,player){
return player.num('h','sha')>0; return player.num('h','sha')>0;
}, },
@ -2692,8 +2693,8 @@ character.sp={
guiming:'归命', guiming:'归命',
guiming_info:'主公技,其他吴势力角色于你的回合内视为已受伤的角色。', guiming_info:'主公技,其他吴势力角色于你的回合内视为已受伤的角色。',
chixin:'赤心', chixin:'赤心',
chixin1:'赤', chixin1:'赤',
chixin2:'赤', chixin2:'赤',
chixin_info:'你可以将♦牌当【杀】或【闪】使用或打出。出牌阶段,你对你攻击范围内的每名角色均可使用一张【杀】。', chixin_info:'你可以将♦牌当【杀】或【闪】使用或打出。出牌阶段,你对你攻击范围内的每名角色均可使用一张【杀】。',
suiren:'随仁', suiren:'随仁',
suiren_info:'限定技准备阶段开始时你可以失去技能“义从”然后加1点体力上限并回复1点体力再令一名角色摸三张牌。', suiren_info:'限定技准备阶段开始时你可以失去技能“义从”然后加1点体力上限并回复1点体力再令一名角色摸三张牌。',

View File

@ -901,6 +901,7 @@ character.swd={
}, },
fuyan:{ fuyan:{
trigger:{player:'damageEnd'}, trigger:{player:'damageEnd'},
frequent:true,
filter:function(event){ filter:function(event){
return event.num>0; return event.num>0;
}, },
@ -3952,7 +3953,7 @@ character.swd={
filter:function(event,player){ filter:function(event,player){
var content=player.storage.yishan; var content=player.storage.yishan;
for(var i=0;i<content.length;i++){ for(var i=0;i<content.length;i++){
if(get.owner(content[i])!=player){ if(get.owner(content[i])!=player&&get.position(content[i])!='s'){
return true; return true;
} }
} }
@ -3964,7 +3965,7 @@ character.swd={
mark:true, mark:true,
content:function(){ content:function(){
for(var i=0;i<player.storage.yishan.length;i++){ for(var i=0;i<player.storage.yishan.length;i++){
if(get.owner(player.storage.yishan[i])==player){ if(get.owner(player.storage.yishan[i])==player||get.position(player.storage.yishan[i])=='s'){
player.storage.yishan.splice(i,1); player.storage.yishan.splice(i,1);
i--; i--;
} }
@ -3972,6 +3973,7 @@ character.swd={
var cards=player.storage.yishan.splice(0,2); var cards=player.storage.yishan.splice(0,2);
player.gain(cards); player.gain(cards);
player.$gain2(cards); player.$gain2(cards);
game.log(get.translation(player)+'获得了'+get.translation(cards));
}, },
ai:{ ai:{
maixie:true, maixie:true,
@ -3996,7 +3998,7 @@ character.swd={
dialog.add('<div class="text center">最近失去的牌</div>'); dialog.add('<div class="text center">最近失去的牌</div>');
var cards=[]; var cards=[];
for(var i=0;i<content.length;i++){ for(var i=0;i<content.length;i++){
if(get.owner(content[i])!=player){ if(get.owner(content[i])!=player&&get.position(content[i])!='s'){
cards.push(content[i]); cards.push(content[i]);
if(cards.length>=4) break; if(cards.length>=4) break;
} }
@ -4012,7 +4014,7 @@ character.swd={
var str='最近失去的牌:'; var str='最近失去的牌:';
var cards=[]; var cards=[];
for(var i=0;i<content.length;i++){ for(var i=0;i<content.length;i++){
if(get.owner(content[i])!=player){ if(get.owner(content[i])!=player&&get.position(content[i])!='s'){
cards.push(content[i]); cards.push(content[i]);
if(cards.length>=4) break; if(cards.length>=4) break;
} }

View File

@ -2063,7 +2063,7 @@ character.yijiang={
"step 1" "step 1"
if(result.bool){ if(result.bool){
lib.skill.qice2.viewAs={name:result.buttons[0].link[2]}; lib.skill.qice2.viewAs={name:result.buttons[0].link[2]};
player.popup(result.buttons[0].link[2]); // player.popup(result.buttons[0].link[2]);
event.parent.parent.backup('qice2'); event.parent.parent.backup('qice2');
event.parent.parent.step=0; event.parent.parent.step=0;
if(event.isMine()){ if(event.isMine()){

View File

@ -830,12 +830,9 @@ character.yxs={
var from=ui.selected.targets[0]; var from=ui.selected.targets[0];
var judges=from.get('j'); var judges=from.get('j');
for(var i=0;i<judges.length;i++){ for(var i=0;i<judges.length;i++){
if(judges[i].viewAs){ if(!target.hasJudge(judges[i].viewAs||judges[i].name)) return true;
if(target.num('j',{name:judges[i].viewAs})==0&&
target.num('j',{viewAs:judges[i].viewAs})==0) return true;
}
else if(target.num('j',{name:judges[i].name})==0) return true;
} }
if(target.isMin()) return false;
if((from.get('e','1')&&!target.get('e','1'))|| if((from.get('e','1')&&!target.get('e','1'))||
(from.get('e','2')&&!target.get('e','2'))|| (from.get('e','2')&&!target.get('e','2'))||
(from.get('e','3')&&!target.get('e','3'))|| (from.get('e','3')&&!target.get('e','3'))||

View File

@ -7,7 +7,7 @@ window.config={
forbidversus:['swd_kangnalishi'], forbidversus:['swd_kangnalishi'],
forbiddouble:['zhugedan','swd_kangnalishi','swd_nicole','dongzhuo','jg_simayi'], forbiddouble:['zhugedan','swd_kangnalishi','swd_nicole','dongzhuo','jg_simayi'],
all:{ all:{
mode:['identity','guozhan','versus'], mode:['identity','guozhan','versus','stone'],
characters:['standard','wind','fire','woods','mountain','extra','sp','yijiang','refresh','guozhan','jiange','zhuogui','diy','yxs','swd','xswd','gujian','xianjian'], characters:['standard','wind','fire','woods','mountain','extra','sp','yijiang','refresh','guozhan','jiange','zhuogui','diy','yxs','swd','xswd','gujian','xianjian'],
cards:['standard','ex','extra','refresh','guozhan','zhenfa','qimou','yibao','shenbing','wanxiang','swd','shenqi','compensate'], cards:['standard','ex','extra','refresh','guozhan','zhenfa','qimou','yibao','shenbing','wanxiang','swd','shenqi','compensate'],
plays:['character','soldier','wuxing'], plays:['character','soldier','wuxing'],
@ -28,6 +28,7 @@ window.config={
identity:'身份', identity:'身份',
guozhan:'国战', guozhan:'国战',
versus:'对决', versus:'对决',
stone:'炉石',
changjing:'场景', changjing:'场景',
mowang:'魔王', mowang:'魔王',
infinity:'无限', infinity:'无限',

View File

@ -29,7 +29,7 @@ window.play={};
frameId:0, frameId:0,
}, },
help:{ help:{
'关于':'无名杀 1.0.1<div class="dashedline"></div><ul><li>1L 先谢神上<li>图片等素材来自网(shén)络(shā)<li>bug反馈/建议欢迎来百度无名杀吧', '关于':'无名杀 1.0.6<div class="dashedline"></div><ul><li>1L 先谢神上<li>图片等素材来自网(shén)络(shā)<li>bug反馈/建议欢迎来百度无名杀吧',
'选项帮助':'<ul><li>控制台命令:开启后可用浏览器控制台控制游戏<li>自动确认开启后当候选目标仅有1个时点击目标无需再点击确定<li>悬停时间:弹出角色/卡牌介绍所需的等待时间<li>'+ '选项帮助':'<ul><li>控制台命令:开启后可用浏览器控制台控制游戏<li>自动确认开启后当候选目标仅有1个时点击目标无需再点击确定<li>悬停时间:弹出角色/卡牌介绍所需的等待时间<li>'+
'触屏模式可消除iOS等设备上300ms的点击延迟但开启后无法使用鼠标<li>滚轮控制手牌开启后滚轮可控制手牌的左右滚动建议Mac等具备横向滚动功能的设备关闭此选项'+ '触屏模式可消除iOS等设备上300ms的点击延迟但开启后无法使用鼠标<li>滚轮控制手牌开启后滚轮可控制手牌的左右滚动建议Mac等具备横向滚动功能的设备关闭此选项'+
'<li>隐藏非全身皮肤:在新版布局中,若角色没有全身皮肤将被隐藏<li>游戏玩法:为游戏增加不同玩法,开启后可在帮助中查看介绍'+ '<li>隐藏非全身皮肤:在新版布局中,若角色没有全身皮肤将被隐藏<li>游戏玩法:为游戏增加不同玩法,开启后可在帮助中查看介绍'+
@ -877,9 +877,7 @@ window.play={};
if(event.position[i]=='h'&&target.num('h')){ if(event.position[i]=='h'&&target.num('h')){
event.dialog.add('手牌'); event.dialog.add('手牌');
var hs=target.get('h'); var hs=target.get('h');
for(var hsi=0;hsi<hs.length;hsi++){ hs.randomSort();
hs.sort(lib.sort.random);
}
if(event.visible){ if(event.visible){
event.dialog.add(hs); event.dialog.add(hs);
} }
@ -939,9 +937,7 @@ window.play={};
if(event.position[i]=='h'&&target.num('h')){ if(event.position[i]=='h'&&target.num('h')){
event.dialog.add('手牌'); event.dialog.add('手牌');
var hs=target.get('h'); var hs=target.get('h');
for(var hsi=0;hsi<hs.length;hsi++){ hs.randomSort();
hs.sort(lib.sort.random);
}
if(event.visible){ if(event.visible){
event.dialog.add(hs); event.dialog.add(hs);
} }
@ -1009,9 +1005,7 @@ window.play={};
if(event.position[i]=='h'&&target.num('h')){ if(event.position[i]=='h'&&target.num('h')){
event.dialog.add('手牌'); event.dialog.add('手牌');
var hs=target.get('h'); var hs=target.get('h');
for(var hsi=0;hsi<hs.length;hsi++){ hs.randomSort();
hs.sort(lib.sort.random);
}
if(event.visible){ if(event.visible){
event.dialog.add(hs); event.dialog.add(hs);
} }
@ -1135,6 +1129,7 @@ window.play={};
player.lose(cards); player.lose(cards);
if(event.skill){ if(event.skill){
player.popup(event.skill); player.popup(event.skill);
player.popup(event.card.name);
if(player.checkShow){ if(player.checkShow){
player.checkShow(event.skill); player.checkShow(event.skill);
} }
@ -1823,12 +1818,14 @@ window.play={};
} }
game.log(str); game.log(str);
} }
if(!game.reserveDead){
for(var mark in player.marks){ for(var mark in player.marks){
player.unmarkSkill(mark); player.unmarkSkill(mark);
} }
while(player.node.marks.childNodes.length){ while(player.node.marks.childNodes.length){
player.node.marks.firstChild.remove(); player.node.marks.firstChild.remove();
} }
}
player.classList.add('dead'); player.classList.add('dead');
player.classList.remove('turnedover'); player.classList.remove('turnedover');
player.classList.remove('out'); player.classList.remove('out');
@ -1879,6 +1876,12 @@ window.play={};
player.lose(player.get('e',{subtype:get.subtype(card)}),false); player.lose(player.get('e',{subtype:get.subtype(card)}),false);
"step 1" "step 1"
card.fix(); card.fix();
if(player.isMin()){
event.finish();
ui.discardPile.appendChild(card);
delete player.equiping;
return;
}
if(lib.config.background_audio){ if(lib.config.background_audio){
game.playAudio('effect',get.subtype(card)); game.playAudio('effect',get.subtype(card));
} }
@ -1993,12 +1996,17 @@ window.play={};
var skills=info[3]; var skills=info[3];
this.skills.length=0; this.skills.length=0;
if(lib.config.layout=='newlayout'&&info[4]&&info[4].contains('fullskin')){ if(lib.config.layout=='newlayout'&&info[4]&&info[4].contains('fullskin')){
this.classList.remove('minskin');
this.classList.add('fullskin'); this.classList.add('fullskin');
this.node.avatar.style.backgroundImage='url("image/character/fullskin/'+character+'.jpg")'; this.node.avatar.style.backgroundImage='url("image/character/fullskin/'+character+'.jpg")';
this.node.avatar.style.backgroundSize='cover'; this.node.avatar.style.backgroundSize='cover';
} }
else{ else{
this.node.avatar.setBackground(character,'character'); this.node.avatar.setBackground(character,'character');
this.classList.remove('fullskin');
if(info[4]&&info[4].contains('minskin')){
this.classList.add('minskin');
}
} }
this.node.avatar.show(); this.node.avatar.show();
@ -2073,7 +2081,7 @@ window.play={};
this.update(); this.update();
return this; return this;
}, },
uninit:function(){ uninit:function(stat){
var that=this; var that=this;
this.node.avatar.hide(); this.node.avatar.hide();
this.node.count.hide(); this.node.count.hide();
@ -2108,7 +2116,9 @@ window.play={};
this.hiddenSkills=[]; this.hiddenSkills=[];
this.forbiddenSkills=[]; this.forbiddenSkills=[];
this.modeSkills=[]; this.modeSkills=[];
if(stat!==false){
this.stat=[{card:{},skill:{}}]; this.stat=[{card:{},skill:{}}];
}
this.tempSkills={}; this.tempSkills={};
this.storage={}; this.storage={};
this.marks={}; this.marks={};
@ -2141,18 +2151,17 @@ window.play={};
hp.childNodes[i].classList.add('lost'); hp.childNodes[i].classList.add('lost');
} }
} }
if(this.maxHp>=9){
if(this.maxHp>9){ if(this.maxHp>9){
this.node.hp.classList.add('longlong'); this.node.hp.classList.add('longlong');
} }
else{ else{
this.node.hp.classList.remove('longlong'); this.node.hp.classList.remove('longlong');
this.node.hp.classList.add('long');
} }
if(this.maxHp==9||this.maxHp>=17){
this.node.hp.classList.add('long');
} }
else{ else{
this.node.hp.classList.remove('long'); this.node.hp.classList.remove('long');
this.node.hp.classList.remove('longlong');
} }
} }
@ -3470,7 +3479,7 @@ window.play={};
} }
node.dataset.position=this.dataset.position; node.dataset.position=this.dataset.position;
if(this.dataset.position==0||parseInt(this.dataset.position)==(game.players.length+game.dead.length)/2|| if(this.dataset.position==0||parseInt(this.dataset.position)==(game.players.length+game.dead.length)/2||
typeof name2=='number'){ typeof name2=='number'||this.classList.contains('minskin')){
node.innerHTML=name2; node.innerHTML=name2;
} }
else{ else{
@ -3487,7 +3496,7 @@ window.play={};
var node=ui.create.div('.popup',ui.arena); var node=ui.create.div('.popup',ui.arena);
node.dataset.position=this.dataset.position; node.dataset.position=this.dataset.position;
if(this.dataset.position==0||parseInt(this.dataset.position)==(game.players.length+game.dead.length)/2|| if(this.dataset.position==0||parseInt(this.dataset.position)==(game.players.length+game.dead.length)/2||
typeof name2=='number'){ typeof name2=='number'||this.classList.contains('minskin')){
node.innerHTML=name2; node.innerHTML=name2;
} }
else{ else{
@ -3787,6 +3796,9 @@ window.play={};
isOut:function(){ isOut:function(){
return this.classList.contains('out'); return this.classList.contains('out');
}, },
isMin:function(){
return this.classList.contains('minskin');
},
isIn:function(){ isIn:function(){
return this.classList.contains('dead')==false&&this.classList.contains('out')==false&&!this.removed; return this.classList.contains('dead')==false&&this.classList.contains('out')==false&&!this.removed;
}, },
@ -5735,9 +5747,6 @@ window.play={};
ui.handcards2=player.node.handcards2.animate('start').fix(); ui.handcards2=player.node.handcards2.animate('start').fix();
ui.me.appendChild(ui.handcards1); ui.me.appendChild(ui.handcards1);
ui.me.appendChild(ui.handcards2); ui.me.appendChild(ui.handcards2);
if(game.onSwapControl){
game.onSwapControl();
}
game.me.node.handcards1.dataset.number=Math.min(6,game.me.node.handcards1.childNodes.length- game.me.node.handcards1.dataset.number=Math.min(6,game.me.node.handcards1.childNodes.length-
game.me.node.handcards1.getElementsByClassName('removing').length)-1; game.me.node.handcards1.getElementsByClassName('removing').length)-1;
game.me.node.handcards2.dataset.number=Math.min(6,game.me.node.handcards2.childNodes.length- game.me.node.handcards2.dataset.number=Math.min(6,game.me.node.handcards2.childNodes.length-
@ -6074,10 +6083,6 @@ window.play={};
localStorage.setItem(lib.configprefix+'config',JSON.stringify(config)); localStorage.setItem(lib.configprefix+'config',JSON.stringify(config));
}, },
addPlayer:function(position,character,character2){ addPlayer:function(position,character,character2){
if(game.players.length+game.dead.length==8){
alert('Too many players');
return;
}
if(position<0||position>game.players.length+game.dead.length||position==undefined){ if(position<0||position>game.players.length+game.dead.length||position==undefined){
position=Math.ceil(Math.random()*(game.players.length+game.dead.length)); position=Math.ceil(Math.random()*(game.players.length+game.dead.length));
} }
@ -6095,11 +6100,14 @@ window.play={};
game.arrangePlayers(); game.arrangePlayers();
return player; return player;
}, },
addFellow:function(position,character){
var player=ui.create.player(ui.arena).animate('start');
player.dataset.position=position||game.players.length+game.dead.length;
if(character) player.init(character);
game.players.push(player);game.arrangePlayers();
return player;
},
restorePlayer:function(player){ restorePlayer:function(player){
if(game.players.length+game.dead.length==8){
alert('Too many players');
return;
}
if(game.players.contains(player)||game.dead.contains(player)) return; if(game.players.contains(player)||game.dead.contains(player)) return;
var position=parseInt(player.dataset.position); var position=parseInt(player.dataset.position);
if(position<0||position>game.players.length+game.dead.length||position==undefined){ if(position<0||position>game.players.length+game.dead.length||position==undefined){
@ -6121,10 +6129,6 @@ window.play={};
return player; return player;
}, },
removePlayer:function(player){ removePlayer:function(player){
if(game.players.length+game.dead.length==1){
alert('Too few players');
return;
}
var players=game.players.concat(game.dead); var players=game.players.concat(game.dead);
player.style.top=player.offsetTop+'px'; player.style.top=player.offsetTop+'px';
player.style.left=player.offsetLeft+'px'; player.style.left=player.offsetLeft+'px';
@ -6454,6 +6458,7 @@ window.play={};
} }
else{ else{
for(var i in lib.character){ for(var i in lib.character){
if(lib.character[i][4]&&lib.character[i][4].contains('minskin')) continue;
if(filter&&filter(i)) continue; if(filter&&filter(i)) continue;
list.push(i); list.push(i);
if(namecapt.indexOf(getCapt(i))==-1){ if(namecapt.indexOf(getCapt(i))==-1){
@ -6508,7 +6513,15 @@ window.play={};
} }
var groupSort; var groupSort;
if(thisiscard){ if(thisiscard){
groupSort=function(){return 0;}; groupSort=function(name){
if(lib.card[name[2]].type=='basic') return 0;
if(lib.card[name[2]].type=='stonecharacter') return 1;
if(lib.card[name[2]].type=='trick') return 2;
if(lib.card[name[2]].type=='delay') return 3;
if(lib.card[name[2]].type=='equip') return 4;
if(lib.card[name[2]].type=='zhenfa') return 5;
return 6;
};
} }
else{ else{
groupSort=function(name){ groupSort=function(name){
@ -6835,18 +6848,16 @@ window.play={};
})); }));
var span1='<div style="width:20px;text-align:center;padding-right:0">-</div>'; var span1='<div style="width:20px;text-align:center;padding-right:0">-</div>';
var span2='<div style="width:20px;text-align:center;padding-right:0">·</div>'; var span2='<div style="width:20px;text-align:center;padding-right:0">·</div>';
newgame.push(ui.create.line((lib.config.mode=='identity'?span1:span2)+'身份模式',function(){ var clickmode=function(){
game.saveConfig('mode','identity'); game.saveConfig('mode',this.parentNode.link);
game.reload(); game.reload();
})); };
newgame.push(ui.create.line((lib.config.mode=='guozhan'?span1:span2)+'国战模式',function(){ for(var i=0;i<lib.config.all.mode.length;i++){
game.saveConfig('mode','guozhan'); var thismode=lib.config.all.mode[i];
game.reload(); var line=ui.create.line((lib.config.mode==thismode?span1:span2)+lib.translate[thismode]+'模式',clickmode);
})); line.link=thismode;
newgame.push(ui.create.line((lib.config.mode=='versus'?span1:span2)+'对决模式',function(){ newgame.push(line);
game.saveConfig('mode','versus'); }
game.reload();
}));
if(!lib.config.modeconfig&&!lib.config.gameconfig&&!lib.config.appearence){ if(!lib.config.modeconfig&&!lib.config.gameconfig&&!lib.config.appearence){
for(i=0;i<newgame.length;i++){ for(i=0;i<newgame.length;i++){
@ -6861,7 +6872,7 @@ window.play={};
var modeconfig=[]; var modeconfig=[];
modeconfig._configstr='modeconfig'; modeconfig._configstr='modeconfig';
folditems.push(modeconfig); folditems.push(modeconfig);
ui.config.appendChild(ui.create.line2(get.translation(lib.config.mode+'_mode')+'选项',function(){ ui.config.appendChild(ui.create.line2(get.translation(lib.config.mode)+'选项',function(){
if(this.clicked) return; if(this.clicked) return;
if(lib.config.modeconfig){ if(lib.config.modeconfig){
game.saveConfig('modeconfig',false); game.saveConfig('modeconfig',false);
@ -7208,8 +7219,7 @@ window.play={};
})); }));
ui.cardviewdialog=(function(){ ui.cardviewdialog=(function(){
var dialog=ui.create.cardDialog(true); var dialog=ui.create.cardDialog(true);
dialog.style.height='calc(100% - 80px)'; dialog.classList.add('fullheight');
dialog.style.top='40px';
var stopprop=function(e){e.stopPropagation();return false;}; var stopprop=function(e){e.stopPropagation();return false;};
var clickpop=function(){ var clickpop=function(){
this.delete(); this.delete();
@ -7267,8 +7277,7 @@ window.play={};
})); }));
ui.characterviewdialog=(function(){ ui.characterviewdialog=(function(){
var dialog=ui.create.characterDialog(true); var dialog=ui.create.characterDialog(true);
dialog.style.height='calc(100% - 80px)'; dialog.classList.add('fullheight');
dialog.style.top='40px';
var stopprop=function(e){e.stopPropagation();return false;}; var stopprop=function(e){e.stopPropagation();return false;};
var clickpop=function(){ var clickpop=function(){
this.delete(); this.delete();
@ -7525,7 +7534,7 @@ window.play={};
} }
ui.config2=ui.create.system('选项',ui.click.config); ui.config2=ui.create.system('选项',ui.click.config);
if(!lib.config.touchscreen){ if(!lib.config.touchscreen){
lib.setPopped(ui.config2,ui.click.pauseconfig,170); lib.setPopped(ui.config2,ui.click.pauseconfig,190);
} }
ui.wuxie=ui.create.system('不询问无懈',ui.click.wuxie,true); ui.wuxie=ui.create.system('不询问无懈',ui.click.wuxie,true);
ui.auto=ui.create.system('托管',ui.click.auto); ui.auto=ui.create.system('托管',ui.click.auto);
@ -7842,8 +7851,7 @@ window.play={};
}, },
cards:function(random){ cards:function(random){
if(!random){ if(!random){
for(var i=0;i<lib.card.list.length;i++) lib.card.list.randomSort();
lib.card.list.sort(lib.sort.random);
} }
for(var i=0;i<lib.card.list.length;i++){ for(var i=0;i<lib.card.list.length;i++){
if(lib.card[lib.card.list[i][2]]){ if(lib.card[lib.card.list[i][2]]){
@ -7866,11 +7874,11 @@ window.play={};
if(!ui.config.childNodes.length) return; if(!ui.config.childNodes.length) return;
var uiintro=ui.create.dialog('hidden'); var uiintro=ui.create.dialog('hidden');
var node=ui.create.div('.newgame'); var node=ui.create.div('.newgame');
var list=[['identity','身份'],['guozhan','国战'],['versus','对决']]; for(var i=0;i<lib.config.all.mode.length;i++){
for(var i=0;i<list.length;i++){ var thismode=lib.config.all.mode[i];
var div=ui.create.div(list[i][0]==lib.config.mode?'.underlinenode.on':'.underlinenode',node); var div=ui.create.div(thismode==lib.config.mode?'.underlinenode.on':'.underlinenode',node);
div.innerHTML=list[i][1]; div.innerHTML=lib.translate[thismode];
div.link=list[i][0]; div.link=thismode;
div.addEventListener(lib.config.touchscreen?'touchend':'click',function(){ div.addEventListener(lib.config.touchscreen?'touchend':'click',function(){
game.saveConfig('mode',this.link); game.saveConfig('mode',this.link);
game.reload(); game.reload();
@ -9551,7 +9559,7 @@ window.play={};
for(i=0;i<ui.discardPile.childNodes.length;i++){ for(i=0;i<ui.discardPile.childNodes.length;i++){
cards.push(ui.discardPile.childNodes[i]); cards.push(ui.discardPile.childNodes[i]);
} }
cards.sort(lib.sort.random); cards.randomSort();
for(var i=0;i<cards.length;i++){ for(var i=0;i<cards.length;i++){
ui.cardPile.appendChild(cards[i]); ui.cardPile.appendChild(cards[i]);
} }
@ -9572,20 +9580,24 @@ window.play={};
distance:function(from,to,method){ distance:function(from,to,method){
if(from==to) return 0; if(from==to) return 0;
var player=from,m,n=1,i; var player=from,m,n=1,i;
if(to.isMin()||from.isMin()){
if(method=='raw'||method=='pure') return 1;
}
else{
var length=game.players.length; var length=game.players.length;
while(player.nextSeat!=to){ while(player.nextSeat!=to){
player=player.nextSeat; player=player.nextSeat;
if(player.isAlive()&&player.isOut()==false) n++; if(player.isAlive()&&!player.isOut()&&!player.isMin()) n++;
// else if(player.isOut()) length--;
} }
for(i=0;i<game.players.length;i++){ for(i=0;i<game.players.length;i++){
if(game.players[i].isOut()) length--; if(game.players[i].isOut()||game.players[i].isMin()) length--;
} }
if(method=='absolute') return n; if(method=='absolute') return n;
if(from.isDead()) length++; if(from.isDead()) length++;
if(to.isDead()) length++; if(to.isDead()) length++;
n=Math.min(n,length-n); n=Math.min(n,length-n);
if(method=='pure') return n; if(method=='pure') return n;
}
n=game.checkMod(from,to,n,'globalFrom',from.get('s')); n=game.checkMod(from,to,n,'globalFrom',from.get('s'));
n=game.checkMod(from,to,n,'globalTo',to.get('s')); n=game.checkMod(from,to,n,'globalTo',to.get('s'));
@ -9819,7 +9831,7 @@ window.play={};
selectable.push(game.players[i]); selectable.push(game.players[i]);
} }
} }
selectable.sort(lib.sort.random); selectable.randomSort();
if(sort){ if(sort){
selectable.sort(sort); selectable.sort(sort);
} }
@ -9950,7 +9962,8 @@ window.play={};
var func; var func;
if(sort=='type_sort'){ if(sort=='type_sort'){
func=function(card){ func=function(card){
if(get.type(card)=='basic') return 1; if(get.type(card)=='basic') return 2;
if(get.type(card)=='stonecharacter') return 1;
if(get.type(card)=='trick') return -1; if(get.type(card)=='trick') return -1;
if(get.type(card)=='delay') return -2; if(get.type(card)=='delay') return -2;
if(get.type(card)=='equip') return -3; if(get.type(card)=='equip') return -3;
@ -10887,6 +10900,16 @@ window.play={};
var num=Math.floor(Math.random()*this.length); var num=Math.floor(Math.random()*this.length);
return this.splice(num,1)[0]; return this.splice(num,1)[0];
}; };
Array.prototype.randomSort=function(){
var list=[];
while(this.length){
list.push(this.randomRemove());
}
for(var i=0;i<list.length;i++){
this.push(list[i]);
}
return this;
};
Array.prototype.randomGets=function(num){ Array.prototype.randomGets=function(num){
var arr=this.slice(0); var arr=this.slice(0);
var list=[]; var list=[];
@ -11206,7 +11229,8 @@ window.play={};
for(k in character[i][j]){ for(k in character[i][j]){
if(j=='character'){ if(j=='character'){
if(lib.config.only_fullskin&&lib.config.layout=='newlayout'){ if(lib.config.only_fullskin&&lib.config.layout=='newlayout'){
if(!character[i][j][k][4]||!character[i][j][k][4].contains('fullskin')){ if(!character[i][j][k][4]) continue;
if(!character[i][j][k][4].contains('fullskin')&&!character[i][j][k][4].contains('minskin')){
continue; continue;
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -111,6 +111,7 @@ body>.background{z-index:-2}
/*--------窗口--------*/ /*--------窗口--------*/
.dialog{text-align: center;} .dialog{text-align: center;}
.dialog{width: calc(90% - 420px);height: calc(100% / 3 - 160px / 3 + 120px);} .dialog{width: calc(90% - 420px);height: calc(100% / 3 - 160px / 3 + 120px);}
.dialog.fullheight{height:calc(100% - 80px) !important;top:40px !important}
.dialog{top:calc(100% / 3 - 100px / 3);left: calc(5% + 210px);} .dialog{top:calc(100% / 3 - 100px / 3);left: calc(5% + 210px);}
#window>.dialog.popped{ #window>.dialog.popped{
@ -185,11 +186,12 @@ margin-bottom: 5px;
.control>div{position: relative;padding: 3px;} .control>div{position: relative;padding: 3px;}
/*--------角色--------*/ /*--------角色--------*/
.player{z-index: 4;width: 240px;height: 120px;} .player{z-index: 4;width: 240px;height: 120px;}
.player.minskin{width:120px;}
.player>div{z-index: 2;} .player>div{z-index: 2;}
.player.dead,.player.likedead{z-index: 1;-webkit-filter:grayscale(1);} .player.dead,.player.likedead{z-index: 1;-webkit-filter:grayscale(1);}
.player>.name{left: 18px;top:36px;} .player>.name{left: 18px;top:36px;}
.player>.intro{top:87px;left: 18px;} .player>.intro{top:87px;left: 18px;}
.avatar{width: 94px;height: 94px;left: 12px;top: 12px;overflow: hidden;} .avatar{width: 96px;height: 96px;left: 12px;top: 12px;overflow: hidden;}
.avatar2{width: 42px;height: 42px;top: 70px;left: 70px;overflow: hidden;} .avatar2{width: 42px;height: 42px;top: 70px;left: 70px;overflow: hidden;}
.equips{width: 96px;height: 96px;right: 14px;top:12px;} .equips{width: 96px;height: 96px;right: 14px;top:12px;}
.equips>div{width: 42px;height: 42px;margin: 0;position: absolute;} .equips>div{width: 42px;height: 42px;margin: 0;position: absolute;}
@ -235,6 +237,15 @@ margin-bottom: 5px;
background: rgba(148, 27, 27,1); background: rgba(148, 27, 27,1);
border: 1px solid rgba(79, 7, 7, 1); border: 1px solid rgba(79, 7, 7, 1);
} }
.hp.actcount>div:not(.lost){
background: rgba(63, 119, 173,1);
border: 1px solid rgba(31, 82, 131, 1);
}
.hp.actcount>.lost{
background: rgba(63, 119, 173,1);
border: 1px solid rgba(31, 82, 131, 1);
-webkit-filter: grayscale(1);
}
.hp>.lost{ .hp>.lost{
background: rgba(57, 123, 4,1); background: rgba(57, 123, 4,1);
border: 1px solid rgba(39, 79, 7, 1); border: 1px solid rgba(39, 79, 7, 1);
@ -245,6 +256,7 @@ margin-bottom: 5px;
/*.hp>div{width: 6px;height: 6px;margin-left: 3px;position: relative;}*/ /*.hp>div{width: 6px;height: 6px;margin-left: 3px;position: relative;}*/
.count.p2{right: 174px;} .count.p2{right: 174px;}
.count{right: 140px;top:86px;text-align: right;font-size: 14px;} .count{right: 140px;top:86px;text-align: right;font-size: 14px;}
.player.minskin .count{right:20px;}
.identity{left: 90px;top:5px;} .identity{left: 90px;top:5px;}
.identity{text-align: center;width: 22px;height: 22px;} .identity{text-align: center;width: 22px;height: 22px;}
.identity>div{position: relative;top: 2px;} .identity>div{position: relative;top: 2px;}
@ -254,6 +266,33 @@ margin-bottom: 5px;
.linked>.identity{top: 88px;} .linked>.identity{top: 88px;}
.linked>.count{right: 154px;} .linked>.count{right: 154px;}
.acted>.identity{-webkit-transform:rotate(180deg);} .acted>.identity{-webkit-transform:rotate(180deg);}
/*--------位置(n人)------*/
#arena.stone>.player.minskin[data-position='4']{top:calc(100% - 305px);left:calc(100% - 120px);}
#arena.stone>.card[data-position='4']{top:calc(100% - 297px);left:calc(100% - 112px);}
#arena.stone>.popup[data-position='4']{top:calc(100% - 340px);left:calc(100% - 112px);}
#arena.stone>.player.minskin[data-position='6']{top:calc(100% - 305px);left:calc(100% - 260px);}
#arena.stone>.card[data-position='6']{top:calc(100% - 297px);left:calc(100% - 252px);}
#arena.stone>.popup[data-position='6']{top:calc(100% - 340px);left:calc(100% - 252px);}
#arena.stone>.player.minskin[data-position='7']{top:calc(100% - 305px);left:140px;}
#arena.stone>.card[data-position='7']{top:calc(100% - 297px);left:148px;}
#arena.stone>.popup[data-position='7']{top:calc(100% - 340px);left:148px;}
#arena.stone>.player.minskin[data-position='5']{top:calc(100% - 305px);left:0;}
#arena.stone>.card[data-position='5']{top:calc(100% - 297px);left:8px;}
#arena.stone>.popup[data-position='5']{top:calc(100% - 340px);left:8px;}
#arena>.player.minskin[data-position='9']{top:10px;left:calc(100% - 120px);}
#arena.stone>.card[data-position='9']{top:18px;left:calc(100% - 112px);}
#arena.stone>.popup[data-position='9']{top:140px;left:calc(100% - 112px);}
#arena>.player.minskin[data-position='11']{top:10px;left:calc(100% - 260px);}
#arena.stone>.card[data-position='11']{top:18px;left:calc(100% - 252px);}
#arena.stone>.popup[data-position='11']{top:140px;left:calc(100% - 252px);}
#arena>.player.minskin[data-position='10']{top:10px;left:140px;}
#arena.stone>.card[data-position='10']{top:18px;left:148px;}
#arena.stone>.popup[data-position='10']{top:140px;left:148px;}
#arena>.player.minskin[data-position='8']{top:10px;left:0;}
#arena.stone>.card[data-position='8']{top:18px;left:8px;}
#arena.stone>.popup[data-position='8']{top:140px;left:8px;}
/*--------位置(8人)------*/ /*--------位置(8人)------*/
[data-number='8']>.player[data-position='1']{top:calc(200% / 3 - 90px);left:calc(100% - 240px);} [data-number='8']>.player[data-position='1']{top:calc(200% / 3 - 90px);left:calc(100% - 240px);}
[data-number='8']>.player[data-position='2']{top:calc(100% / 3 - 40px);left:calc(100% - 240px);} [data-number='8']>.player[data-position='2']{top:calc(100% / 3 - 40px);left:calc(100% - 240px);}
@ -465,7 +504,7 @@ div:hover>.intro{opacity: 1;}
} }
.newgame{ .newgame{
width:150px; width:170px;
display:flex; display:flex;
} }
.newgame>div{ .newgame>div{
@ -504,7 +543,8 @@ div[data-nature='metal']{
rgba(255, 203, 0,1) 0 0 10px rgba(255, 203, 0,1) 0 0 10px
} }
.player .identity[data-color="nei"], .player .identity[data-color="nei"],
.player .identity[data-color="ye"]{ .player .identity[data-color="ye"],
div[data-nature='thunder']{
text-shadow: rgba(100, 74, 139,1) 0 0 2px,rgba(100, 74, 139,1) 0 0 5px,rgba(100, 74, 139,1) 0 0 10px, text-shadow: rgba(100, 74, 139,1) 0 0 2px,rgba(100, 74, 139,1) 0 0 5px,rgba(100, 74, 139,1) 0 0 10px,
rgba(100, 74, 139,1) 0 0 10px,rgba(100, 74, 139,1) 0 0 20px,rgba(100, 74, 139,1) 0 0 20px,black 0 0 1px; rgba(100, 74, 139,1) 0 0 10px,rgba(100, 74, 139,1) 0 0 20px,rgba(100, 74, 139,1) 0 0 20px,black 0 0 1px;
} }
@ -619,10 +659,26 @@ div[data-nature='soil']{
font-size: 24px; font-size: 24px;
color:white !important; color:white !important;
} }
.player .actcount.hp{
left: -24px;
top: 9px;
width: 20px;
}
.player .actcount.hp>div{
width:12px;
height:12px;
margin-left:4px;
margin-bottom: 3px;
-webkit-animation:game_start 0.5s;
}
.player .wunature{ .player .wunature{
top:77px; top:77px;
left:14px; left:14px;
} }
.player{
top:47px;
left:14px;
}
.card .wunature{ .card .wunature{
top:74px; top:74px;
right:6px; right:6px;

View File

@ -5,7 +5,19 @@
} }
.player .avatar{ .player .avatar{
width:126px; width:126px;
height:107px; height:156px;
}
.player.minskin{
width:120px;
height:120px;
/*zoom:0.9;*/
}
.player.minskin .avatar{
height:96px;
width:96px;
}
.player.minskin .hp{
left:86px;
} }
.player .avatar2{ .player .avatar2{
width:52px; width:52px;
@ -20,8 +32,14 @@
.player .wunature{ .player .wunature{
top:137px; top:137px;
} }
.player.fullskin .avatar{ .player .actcount.hp{
height:156px; top: 18px;
left: 15px;
width: 130px;
bottom: auto;
right: auto;
text-align: left;
-webkit-transform: none;
} }
.player.fullskin2 .avatar, .player.fullskin2 .avatar,
.player.fullskin2 .avatar2{ .player.fullskin2 .avatar2{
@ -222,6 +240,9 @@
border-radius:2px; border-radius:2px;
box-shadow: rgba(0,0,0,0.2) 1px -1px 2px inset,rgba(255,255,255,0.15) -1px 1px 5px inset; box-shadow: rgba(0,0,0,0.2) 1px -1px 2px inset,rgba(255,255,255,0.15) -1px 1px 5px inset;
} }
.player .count.action{
bottom:60px;
}
.player .count[data-condition="none"]{ .player .count[data-condition="none"]{
background: rgba(57, 123, 4,1); background: rgba(57, 123, 4,1);
border: 1px solid rgba(39, 79, 7, 1); border: 1px solid rgba(39, 79, 7, 1);
@ -248,6 +269,9 @@
top: -8px; top: -8px;
left: 132px; left: 132px;
} }
.player.minskin .identity{
left:102px;
}
.player.linked{ .player.linked{
-webkit-transform:rotate(-90deg); -webkit-transform:rotate(-90deg);
} }
@ -266,6 +290,32 @@
.linked>.avatar2{top:73px;} .linked>.avatar2{top:73px;}
.linked>.identity{top: -5px;} .linked>.identity{top: -5px;}
.linked>.count{right: auto;} .linked>.count{right: auto;}
/*--------位置(n人)------*/
#arena.stone>.player.minskin[data-position='4']{top:calc(100% - 305px);left:calc(100% - 120px);}
#arena.stone>.card[data-position='4']{top:calc(100% - 297px);left:calc(100% - 112px);}
#arena.stone>.popup[data-position='4']{top:calc(100% - 340px);left:calc(100% - 112px);}
#arena.stone>.player.minskin[data-position='6']{top:calc(100% - 305px);left:calc(100% - 260px);}
#arena.stone>.card[data-position='6']{top:calc(100% - 297px);left:calc(100% - 252px);}
#arena.stone>.popup[data-position='6']{top:calc(100% - 340px);left:calc(100% - 252px);}
#arena.stone>.player.minskin[data-position='7']{top:calc(100% - 305px);left:140px;}
#arena.stone>.card[data-position='7']{top:calc(100% - 297px);left:148px;}
#arena.stone>.popup[data-position='7']{top:calc(100% - 340px);left:148px;}
#arena.stone>.player.minskin[data-position='5']{top:calc(100% - 305px);left:0;}
#arena.stone>.card[data-position='5']{top:calc(100% - 297px);left:8px;}
#arena.stone>.popup[data-position='5']{top:calc(100% - 340px);left:8px;}
#arena>.player.minskin[data-position='9']{top:10px;left:calc(100% - 120px);}
#arena.stone>.card[data-position='9']{top:18px;left:calc(100% - 112px);}
#arena.stone>.popup[data-position='9']{top:140px;left:calc(100% - 112px);}
#arena>.player.minskin[data-position='11']{top:10px;left:calc(100% - 260px);}
#arena.stone>.card[data-position='11']{top:18px;left:calc(100% - 252px);}
#arena.stone>.popup[data-position='11']{top:140px;left:calc(100% - 252px);}
#arena>.player.minskin[data-position='10']{top:10px;left:140px;}
#arena.stone>.card[data-position='10']{top:18px;left:148px;}
#arena.stone>.popup[data-position='10']{top:140px;left:148px;}
#arena>.player.minskin[data-position='8']{top:10px;left:0;}
#arena.stone>.card[data-position='8']{top:18px;left:8px;}
#arena.stone>.popup[data-position='8']{top:140px;left:8px;}
/*--------位置(8人)------*/ /*--------位置(8人)------*/
[data-number='8']>.player[data-position='1']{top:calc(200% / 3 - 160px);left:calc(100% - 150px);} [data-number='8']>.player[data-position='1']{top:calc(200% / 3 - 160px);left:calc(100% - 150px);}
[data-number='8']>.player[data-position='2']{top:calc(100% / 3 - 170px);left:calc(100% - 150px);} [data-number='8']>.player[data-position='2']{top:calc(100% / 3 - 170px);left:calc(100% - 150px);}
@ -374,6 +424,10 @@
transition-property:opacity,background,box-shadow; transition-property:opacity,background,box-shadow;
-webkit-animation: dialog_start2 0.5s; -webkit-animation: dialog_start2 0.5s;
} }
#arena.stone .dialog{
width: calc(90% - 440px);
left: calc(5% + 220px);
}
.dialog.removing{ .dialog.removing{
top:auto; top:auto;
} }
@ -406,7 +460,14 @@
} }
@media screen and (min-width: 1150px) { @media screen and (min-width: 1150px) {
.dialog{width: 630px;left: calc(50% - 315px);} .dialog{
width: 630px;
left: calc(50% - 315px);
}
#arena.stone .dialog{
width: calc(90% - 440px);
left: calc(5% + 220px);
}
} }
@-webkit-keyframes card_start2x{from {opacity: 0;margin-top: -13px;margin-bottom:-11px}} @-webkit-keyframes card_start2x{from {opacity: 0;margin-top: -13px;margin-bottom:-11px}}
@-webkit-keyframes card_start2xx{from {opacity: 0;margin-top: -12px;margin-bottom:-12px;-webkit-transform:scale(0)}} @-webkit-keyframes card_start2xx{from {opacity: 0;margin-top: -12px;margin-bottom:-12px;-webkit-transform:scale(0)}}

View File

@ -156,7 +156,7 @@ mode.guozhan={
if(lib.character[i][2]==3||lib.character[i][2]==4||lib.character[i][2]==5) if(lib.character[i][2]==3||lib.character[i][2]==4||lib.character[i][2]==5)
event.list.push(i); event.list.push(i);
} }
event.list.sort(lib.sort.random); event.list.randomSort();
var list=event.list.splice(0,7); var list=event.list.splice(0,7);
if(_status.auto){ if(_status.auto){
event.ai(game.me,list); event.ai(game.me,list);
@ -205,7 +205,7 @@ mode.guozhan={
ui.create.cheat=function(){ ui.create.cheat=function(){
ui.cheat=ui.create.control('更换',function(){ ui.cheat=ui.create.control('更换',function(){
event.list=event.list.concat(list); event.list=event.list.concat(list);
event.list.sort(lib.sort.random); event.list.randomSort();
list=event.list.splice(0,7); list=event.list.splice(0,7);
_status.event.dialog.close(); _status.event.dialog.close();
_status.event.dialog=ui.create.dialog('选择角色',[list,'character']); _status.event.dialog=ui.create.dialog('选择角色',[list,'character']);
@ -299,7 +299,6 @@ mode.guozhan={
}, },
translate:{ translate:{
change_identity_config:'自由选择座位', change_identity_config:'自由选择座位',
guozhan_mode:'国战',
ye:'野', ye:'野',
unknown:'无名氏', unknown:'无名氏',
unknown0:'一号位', unknown0:'一号位',

View File

@ -152,8 +152,7 @@ mode.identity={
next.ai=function(player,list,list2){ next.ai=function(player,list,list2){
switch(player.identity){ switch(player.identity){
case 'zhu': case 'zhu':
for(var i=0;i<list2.length;i++) list2.randomSort();
list2.sort(lib.sort.random);
var choice,choice2; var choice,choice2;
if(Math.random()-0.8<0&&list2.length){ if(Math.random()-0.8<0&&list2.length){
choice=list2[0]; choice=list2[0];
@ -305,9 +304,7 @@ mode.identity={
event.addSetting=addSetting; event.addSetting=addSetting;
event.removeSetting=removeSetting; event.removeSetting=removeSetting;
event.list=[]; event.list=[];
for(i=0;i<identityList.length;i++){ identityList.randomSort();
identityList.sort(lib.sort.random);
}
if(event.identity){ if(event.identity){
identityList.remove(event.identity); identityList.remove(event.identity);
identityList.unshift(event.identity); identityList.unshift(event.identity);
@ -337,8 +334,8 @@ mode.identity={
list3.push(i); list3.push(i);
} }
} }
event.list.sort(lib.sort.random); event.list.randomSort();
list3.sort(lib.sort.random); list3.randomSort();
var num=get.config('choice')[game.me.identity]; var num=get.config('choice')[game.me.identity];
if(game.zhu!=game.me){ if(game.zhu!=game.me){
event.ai(game.zhu,event.list,list2) event.ai(game.zhu,event.list,list2)
@ -360,11 +357,11 @@ mode.identity={
ui.cheat=ui.create.control('更换',function(){ ui.cheat=ui.create.control('更换',function(){
if(game.zhu!=game.me){ if(game.zhu!=game.me){
event.list=event.list.concat(list); event.list=event.list.concat(list);
event.list.sort(lib.sort.random); event.list.randomSort();
list=event.list.splice(0,num); list=event.list.splice(0,num);
} }
else{ else{
list3.sort(lib.sort.random); list3.randomSort();
list=list3.slice(0,num).concat(list2); list=list3.slice(0,num).concat(list2);
} }
_status.event.dialog.close(); _status.event.dialog.close();
@ -443,7 +440,6 @@ mode.identity={
}, },
}, },
translate:{ translate:{
identity_mode:'身份',
zhu:"主", zhu:"主",
zhong:"忠", zhong:"忠",
nei:"内", nei:"内",
@ -701,7 +697,6 @@ mode.identity={
} }
} }
}, },
identity:[['zhu','zhong','nei','fan','cai'],['fan','zhong','nei','cai']],
config:{ config:{
player_number:true, player_number:true,
double_character:true, double_character:true,

394
mode/stone.js Normal file
View File

@ -0,0 +1,394 @@
mode.stone={
element:{
player:{
init:function(player){
if(!player.isMin()){
player.node.actcount=ui.create.div('.actcount.hp',player);
player.actcount=1;
player.actcharacterlist=[];
player.updateActCount();
}
},
updateActCount:function(){
while(this.actcount>this.node.actcount.childElementCount){
ui.create.div(this.node.actcount);
}
while(this.actcount<this.node.actcount.childElementCount){
this.node.actcount.lastChild.remove();
}
var count=this.actcount-get.cardCount(true,this);
for(var i=0;i<this.actcount;i++){
if(i<count){
this.node.actcount.childNodes[i].classList.remove('lost');
}
else{
this.node.actcount.childNodes[i].classList.add('lost');
}
}
},
dieAfter:function(){
if(game.me.isDead()) game.over(false);
if(game.enemy.isDead()) game.over(true);
game.dead.remove(this);
var player,pos;
if(this.side==game.me.side){
player=game.me;
pos=0;
}
else{
player=game.enemy;
pos=4;
}
player.actcharacterlist.remove(this);
var dead=this;
setTimeout(function(){
dead.delete();
},500);
for(var i=0;i<player.actcharacterlist.length;i++){
player.actcharacterlist[i].dataset.position=i+4+pos;
}
}
}
},
game:{
reserveDead:true,
layoutFixed:true,
stoneLoop:function(player){
var next=game.createEvent('phaseLoop');
next.player=player;
next.content=function(){
"step 0"
player.phase();
event.num=0;
"step 1"
var current=player.actcharacterlist[event.num];
if(current){
current.phase();
event.num++;
event.redo();
}
"step 2"
if(event.player==game.me){
event.player=game.enemy;
}
else{
event.player=game.me;
}
event.goto(0);
}
},
initStone:function(){
var list=[],list2=[];
var i,j,name;
for(i in lib.character){
if(lib.character[i][4]&&lib.character[i][4].contains('minskin')){
list.push(i);
}
}
var totallength=lib.card.list.length/3;
var suit=['heart','diamond','club','spade'];
for(i=0;i<totallength;i++){
var thisname=list.randomGet();
name=thisname+'_stonecharacter';
lib.card[name]={
enable:true,
type:'stonecharacter',
image:'character/default/'+thisname,
color:'white',
opacity:1,
enable:function(event,player){
if(!player.actcharacterlist) return false;
return player.actcharacterlist.length<4;
},
chongzhu:true,
textShadow:'black 0 0 2px',
filterTarget:function(card,player,target){
return player==target;
},
selectTarget:-1,
content:function(){
var name=card.name.slice(0,card.name.indexOf('_stonecharacter'));
var pos=player.actcharacterlist.length+4;
if(player!=game.me){
pos+=4;
}
var fellow=game.addFellow(pos,name);
fellow.side=player.side;
fellow.classList.add('turnedover');
player.actcharacterlist.push(fellow);
fellow.$gain2(card);
},
ai:{
order:9,
result:{
target:(function(name){
return function(player,target){
return 1;
}
}(thisname))
}
}
};
lib.translate[name]=get.translation(thisname);
lib.translate[name+'_info']=get.skillintro(thisname,true,true);
list2.push([suit.randomGet(),Math.ceil(Math.random()*13),name]);
}
lib.card.list=lib.card.list.concat(list2);
lib.card.list.randomSort();
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.card){
if(lib.card[i].type=='equip'){
lib.card[i].chongzhu=true;
}
}
},
start:function(){
var next=game.createEvent('game',false);
next.content=function(){
"step 0"
game.initStone();
game.prepareArena(2);
ui.arena.classList.add('stone');
game.delay();
"step 1"
game.chooseCharacter();
"step 2"
game.me.identity='zhu';
game.enemy=game.me.next;
game.enemy.identity='zhu';
game.me.side=Math.random()<0.5;
game.enemy.side=!game.me.side;
game.gameDraw(game.me,2);
if(game.me.side){
game.enemy.actcount++;
game.enemy.updateActCount();
game.stoneLoop(game.me);
}
else{
game.me.actcount++;
game.me.updateActCount();
game.stoneLoop(game.enemy);
}
}
},
chooseCharacter:function(){
var next=game.createEvent('chooseCharacter',false);
next.showConfig=true;
next.ai=function(player,list){
if(get.config('double_character')){
player.init(list[0],list[1]);
}
else{
player.init(list[0]);
}
}
next.content=function(){
"step 0"
var i;
var list=[];
event.list=list;
for(i in lib.character){
if(lib.character[i][4]&&lib.character[i][4].contains('minskin')) continue;
if(lib.config.forbidai.contains(i)) continue;
if(lib.config.forbidall.contains(i)) continue;
if(!get.config('double_character')&&get.config('ban_weak')&&lib.config.forbidsingle.contains(i)) continue;
if(get.config('double_character')&&lib.config.forbiddouble.contains(i)) continue;
list.push(i);
}
list.randomSort();
var dialog=ui.create.dialog('选择角色',[list.slice(0,7),'character']);
game.me.chooseButton(dialog,true).selectButton=function(){
return get.config('double_character')?2:1
};
ui.create.cheat=function(){
ui.cheat=ui.create.control('更换',function(){
list.randomSort();
_status.event.dialog=ui.create.dialog('选择角色',[list.slice(0,7),'character']);
game.uncheck();
game.check();
});
};
event.dialogxx=ui.create.characterDialog();
ui.create.cheat2=function(){
ui.cheat2=ui.create.control('自由选将',function(){
if(this.dialog==_status.event.dialog){
this.dialog.close();
_status.event.dialog=this.backup;
this.backup.open();
delete this.backup;
game.uncheck();
game.check();
if(ui.cheat2x){
ui.cheat2x.close();
delete ui.cheat2x;
}
}
else{
ui.cheat2x=ui.create.groupControl(_status.event.parent.dialogxx);
this.backup=_status.event.dialog;
_status.event.dialog.close();
_status.event.dialog=_status.event.parent.dialogxx;
this.dialog=_status.event.dialog;
this.dialog.open();
game.uncheck();
game.check();
}
});
}
if(!ui.cheat&&get.config('change_choice'))
ui.create.cheat();
if(!ui.cheat2&&get.config('free_choose'))
ui.create.cheat2();
"step 1"
if(ui.cheat){
ui.cheat.close();
delete ui.cheat;
}
if(ui.cheat2){
ui.cheat2.close();
delete ui.cheat2;
}
if(ui.cheat2x){
ui.cheat2x.close();
delete ui.cheat2x;
}
if(result.buttons.length==2){
game.me.init(result.buttons[0].link,result.buttons[1].link)
}
else{
game.me.init(result.buttons[0].link)
}
event.list.remove(game.me.name);
event.list.remove(game.me.name2);
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=game.me){
event.ai(game.players[i],event.list.splice(0,7));
}
}
}
},
},
character:{
stone_weibing:['male','wei',2,[],['minskin']],
stone_weiguan:['male','wei',1,[],['minskin']],
stone_weijiang:['male','wei',3,[],['minskin']],
stone_shubing:['male','shu',2,[],['minskin']],
stone_shuguan:['male','shu',1,[],['minskin']],
stone_shujiang:['male','shu',3,[],['minskin']],
stone_wubing:['male','wu',2,[],['minskin']],
stone_wuguan:['male','wu',1,[],['minskin']],
stone_wujiang:['male','wu',3,[],['minskin']],
stone_qunbing:['male','qun',2,[],['minskin']],
stone_qunguan:['male','qun',1,[],['minskin']],
stone_qunjiang:['male','qun',3,[],['minskin']],
stone_daogu:['male','qun',2,[],['minskin']],
stone_daoshi:['male','qun',1,[],['minskin']],
stone_sanxian:['male','qun',3,[],['minskin']],
stone_yisheng:['male','qun',2,[],['minskin']],
stone_yinshi:['male','qun',1,[],['minskin']],
stone_sanxian:['male','qun',3,[],['minskin']],
stone_banxian:['male','qun',3,[],['minskin']],
stone_gongzhu:['female','qun',2,[],['minskin']],
stone_genv:['female','qun',1,[],['minskin']],
stone_wunv:['female','qun',3,[],['minskin']],
stone_wanghou:['female','qun',3,[],['minskin']],
stone_feipin:['female','qun',3,[],['minskin']],
stone_yiji:['female','qun',3,[],['minskin']],
},
skill:{
_actcount:{
mod:{
cardEnabled:function(card,player){
if(player.isMin()){
if(get.type(card)=='equip') return false;
return;
}
if(_status.currentPhase!=player) return;
if(get.cardCount(true,player)>=player.actcount) return false;
}
},
trigger:{player:'phaseUseBegin'},
forced:true,
popup:false,
filter:function(event,player){
return !player.isMin();
},
content:function(){
player.actcount++;
if(player.actcount>6){
player.actcount-=6;
}
player.updateActCount();
}
},
_actcount2:{
trigger:{player:['useCard','useCardAfter']},
forced:true,
popup:false,
filter:function(event,player){
return !player.isMin();
},
content:function(){
player.updateActCount();
}
},
},
translate:{
stone_weibing:'士兵',
stone_weiguan:'文官',
stone_weijiang:'将领',
stone_shubing:'士兵',
stone_shuguan:'文官',
stone_shujiang:'将领',
stone_wubing:'士兵',
stone_wuguan:'文官',
stone_wujiang:'将领',
stone_qunbing:'士兵',
stone_qunguan:'文官',
stone_qunjiang:'将领',
stone_daoshi:'道士',
stone_sanxian:'散仙',
stone_banxian:'半仙',
stone_yisheng:'医生',
stone_yinshi:'隐士',
stone_gongzhu:'公主',
stone_genv:'歌女',
stone_wunv:'舞女',
stone_wanghou:'皇后',
stone_feipin:'妃嫔',
stone_yiji:'艺伎',
stone_daogu:'道姑',
},
ai:{
get:{
attitude:function(from,to){
return (to.identity=='zhu'?7:5)*(from.side==to.side?1:-1);
}
}
},
config:{
double_character:true,
ban_weak:true,
free_choose:true,
change_choice:true,
},
}

View File

@ -129,7 +129,7 @@ mode.versus={
list.sort(sortByGroup); list.sort(sortByGroup);
} }
else{ else{
list.sort(lib.sort.random); list.randomSort();
} }
_status.list=list; _status.list=list;
var choice=(lib.storage.choice=='∞')?list.length:lib.storage.choice; var choice=(lib.storage.choice=='∞')?list.length:lib.storage.choice;
@ -144,7 +144,7 @@ mode.versus={
list.sort(sortByGroup); list.sort(sortByGroup);
} }
else{ else{
list.sort(lib.sort.random); list.randomSort();
} }
event.dialog.close(); event.dialog.close();
_status.friend.length=0; _status.friend.length=0;
@ -160,7 +160,7 @@ mode.versus={
delete _status.choosefinished; delete _status.choosefinished;
arguments[1].parentNode.close(); arguments[1].parentNode.close();
var buttons=_status.event.dialog.buttons.slice(0); var buttons=_status.event.dialog.buttons.slice(0);
buttons.sort(lib.sort.random); buttons.randomSort();
for(var i=0;i<buttons.length;i++){ for(var i=0;i<buttons.length;i++){
if(buttons[i].classList.contains('glow')||buttons[i].classList.contains('selected')){ if(buttons[i].classList.contains('glow')||buttons[i].classList.contains('selected')){
buttons.splice(i,1);i--; buttons.splice(i,1);i--;
@ -553,7 +553,7 @@ mode.versus={
_status.friend.remove(event.character); _status.friend.remove(event.character);
_status.enemy.remove(event.character); _status.enemy.remove(event.character);
source.revive(); source.revive();
source.uninit(); source.uninit(false);
source.init(event.character); source.init(event.character);
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);
@ -808,7 +808,7 @@ mode.versus={
this.classList.toggle('on'); this.classList.toggle('on');
game.save('autoreplaceinnerhtml',this.classList.contains('on')); game.save('autoreplaceinnerhtml',this.classList.contains('on'));
}, },
onSwapControl:function(e){ onSwapControl:function(){
var name=game.me.name; var name=game.me.name;
if(ui.fakeme&&ui.fakeme.current!=name){ if(ui.fakeme&&ui.fakeme.current!=name){
ui.fakeme.current=name; ui.fakeme.current=name;
@ -834,6 +834,7 @@ mode.versus={
modeSwapPlayer:function(player){ modeSwapPlayer:function(player){
if(lib.storage.control_all){ if(lib.storage.control_all){
game.swapControl(player); game.swapControl(player);
game.onSwapControl();
} }
else{ else{
game.swapPlayer(player); game.swapPlayer(player);
@ -880,7 +881,6 @@ mode.versus={
}, },
}, },
translate:{ translate:{
versus_mode:'对决',
trueZhu:"帅", trueZhu:"帅",
falseZhu:"将", falseZhu:"将",
trueZhong:"兵", trueZhong:"兵",

View File

@ -1,4 +1,5 @@
play.character={ play.character={
mode:['identity','guozhan','versus'],
init:function(){ init:function(){
var list=[],list2=[]; var list=[],list2=[];
var i,j,name; var i,j,name;
@ -9,7 +10,7 @@ play.character={
if(get.config('double_character')&&lib.config.forbiddouble.contains(i)) continue; if(get.config('double_character')&&lib.config.forbiddouble.contains(i)) continue;
list.push(i); list.push(i);
} }
list.sort(lib.sort.random); list.randomSort();
list=list.splice(0,Math.ceil(lib.card.list.length/20)); list=list.splice(0,Math.ceil(lib.card.list.length/20));
var suit=['heart','diamond','club','spade']; var suit=['heart','diamond','club','spade'];
for(i=0;i<list.length;i++){ for(i=0;i<list.length;i++){

View File

@ -1,4 +1,5 @@
play.soldier={ play.soldier={
mode:['identity','guozhan','versus'],
skill:{ skill:{
soldier:{ soldier:{
group:['soldier2','soldier3'], group:['soldier2','soldier3'],