diff --git a/card/basic.js b/card/basic.js
new file mode 100644
index 000000000..b4ff72bda
--- /dev/null
+++ b/card/basic.js
@@ -0,0 +1,184 @@
+'use strict';
+card.basic={
+ connect:true,
+ card:{
+ yexingchengzhang:{
+ cost:2,
+ class:'druid',
+ },
+ ailongbakebaohuzhe:{
+ cost:8,
+ class:'druid',
+ attack:8,
+ health:8,
+ skill:{
+ taunt:true
+ },
+ },
+ dongwuhuoban:{
+ cost:3,
+ class:'hunter'
+ },
+ xunshoushi:{
+ cost:4,
+ class:'hunter',
+ attack:4,
+ health:3,
+ skill:{
+ battlecry:{}
+ },
+ },
+ hanbingjian:{
+ cost:2,
+ class:'mage',
+ },
+ shuiyuansu:{
+ cost:4,
+ class:'mage',
+ attack:3,
+ health:6,
+ skill:{
+ freeze:{}
+ },
+ },
+ fengxian:{
+ cost:4,
+ class:'paladin'
+ },
+ liewangshouwei:{
+ cost:7,
+ class:'paladin',
+ attack:5,
+ health:6,
+ skill:{
+ battlecry:{}
+ }
+ },
+ zhenyanshudun:{
+ cost:1,
+ class:'priest'
+ },
+ beijunmushi:{
+ cost:1,
+ class:'priest',
+ attack:1,
+ health:3,
+ skill:{
+ heal:{}
+ }
+ },
+ beici:{
+ cost:0,
+ class:'rogue'
+ },
+ cikezhiren:{
+ cost:5,
+ class:'rogue',
+ attack:3,
+ duration:4,
+ },
+ yaoshu:{
+ cost:3,
+ class:'shaman'
+ },
+ huoyuansu:{
+ cost:6,
+ class:'shaman',
+ attack:6,
+ health:5,
+ skill:{
+ battlecry:{}
+ }
+ },
+ diyulieyan:{
+ cost:4,
+ class:'warlock'
+ },
+ xukongxingzhe:{
+ cost:1,
+ class:'warlock',
+ attack:1,
+ health:3,
+ race:'deamon',
+ skill:{
+ taunt:true
+ }
+ },
+ chiyanzhanfu:{
+ cost:2,
+ class:'warrior',
+ attack:3,
+ duration:2,
+ },
+ zhangezhihuiguan:{
+ cost:3,
+ class:'warrior',
+ attack:2,
+ health:3,
+ skill:{
+ zhihui:{}
+ }
+ },
+ lansaizhanshi:{
+ cost:2,
+ class:'neutral',
+ attack:2,
+ health:1,
+ race:'murlock',
+ skill:{
+ charge:true
+ }
+ },
+ zhurufamingjia:{
+ cost:4,
+ class:'neutral',
+ attack:2,
+ health:4,
+ skill:{
+ battlecry:{}
+ }
+ }
+ },
+ translate:{
+ yexingchengzhang:'野性成长',
+ yexingchengzhang_info:'获得一个空的法力水晶',
+ ailongbakebaohuzhe:'埃隆巴克保护者',
+ ailongbakebaohuzhe_info:'嘲讽',
+ dongwuhuoban:'动物伙伴',
+ dongwuhuoban_info:'随机召唤一个野兽伙伴',
+ xunshoushi:'驯兽师',
+ xunshoushi_info:'战吼:使一个友方野兽获得+2/+2并获得嘲讽',
+ hanbingjian:'寒冰箭',
+ hanbingjian_info:'对一个角色造成3点伤害,并使其冻结',
+ shuiyuansu:'水元素',
+ shuiyuansu_info:'冻结任何受到该随从伤害的角色',
+ fengxian:'奉献',
+ fengxian_info:'对所有敌人造成2点伤害',
+ liewangshouwei:'列王守卫',
+ liewangshouwei_info:'战吼:为你的英雄恢复6点生命值',
+ zhenyanshudun:'真言术·盾',
+ zhenyanshudun_info:'使一个随从获得+2生命值。抽一张牌',
+ beijunmushi:'北郡牧师',
+ beijunmushi_info:'每当一个随从获得治疗时,抽一张牌',
+ beici:'背刺',
+ beici_info:'对一个未受伤的随从造成2点伤害',
+ cikezhiren:'刺客之刃',
+ cikezhiren_info:' ',
+ yaoshu:'妖术',
+ yaoshu_info:'使一个随从变形成为一个0/1并具有嘲讽的青蛙',
+ huoyuansu:'火元素',
+ huoyuansu_info:'战吼:造成3点伤害',
+ diyulieyan:'地狱烈焰',
+ diyulieyan_info:'对所有角色造成3点伤害',
+ xukongxingzhe:'虚空行者',
+ xukongxingzhe_info:'嘲讽',
+ chiyanzhanfu:'炽炎战斧',
+ chiyanzhanfu_info:' ',
+ zhangezhihuiguan:'战歌指挥官',
+ zhangezhihuiguan_info:'你的具有冲锋的随从获得+1攻击力',
+ lansaizhanshi:'蓝鳃战士',
+ lansaizhanshi_info:'冲锋',
+ zhurufamingjia:'侏儒发明家',
+ zhurufamingjia_info:'战吼:抽一张牌',
+ },
+}
diff --git a/card/classic.js b/card/classic.js
new file mode 100644
index 000000000..3f65258ee
--- /dev/null
+++ b/card/classic.js
@@ -0,0 +1,10 @@
+'use strict';
+card.classic={
+ connect:true,
+ card:{
+
+ },
+ translate:{
+
+ },
+}
diff --git a/card/naxx.js b/card/naxx.js
new file mode 100644
index 000000000..f15a86a7b
--- /dev/null
+++ b/card/naxx.js
@@ -0,0 +1,10 @@
+'use strict';
+card.naxx={
+ connect:true,
+ card:{
+
+ },
+ translate:{
+
+ },
+}
diff --git a/character/classic.js b/character/classic.js
new file mode 100644
index 000000000..c6ed69925
--- /dev/null
+++ b/character/classic.js
@@ -0,0 +1,4 @@
+'use strict';
+character.classic={
+
+}
diff --git a/extension/hsmod/extension.js b/extension/hsmod/extension.js
new file mode 100644
index 000000000..86c57b7b0
--- /dev/null
+++ b/extension/hsmod/extension.js
@@ -0,0 +1,96 @@
+play.hsmod={
+ arenaReady:function(){
+ var data={
+ total:160,
+ sha:{
+ diamond:6,
+ club:14,
+ heart:3,
+ spade:7,
+ },
+ huosha:{
+ diamond:2,
+ heart:3
+ },
+ leisha:{
+ spade:5,
+ club:4
+ },
+ shan:{
+ heart:6,
+ diamond:18
+ },
+ jiu:{
+ diamond:1,
+ spade:2,
+ club:2
+ },
+ tao:{
+ heart:9,
+ diamond:3,
+ },
+ wanjian:{
+ heart:1,
+ },
+ nanman:{
+ spade:2,
+ club:1,
+ },
+ guohe:{
+ spade:3,
+ club:2,
+ heart:1
+ },
+ shunshou:{
+ spade:3,
+ diamond:2
+ },
+ wuxie:{
+ heart:2,
+ diamond:1,
+ spade:2,
+ club:2
+ },
+ tiesuo:{
+ spade:2,
+ club:4
+ }
+ }
+ var rand=function(){
+ return Math.ceil(Math.random()*13);
+ };
+ var getn=function(i,j){
+ return Math.round(data[i][j]*parseFloat(lib.config['cardpile_'+i+'_playpackconfig']));
+ };
+ var num=0;
+ for(var i in data){
+ for(var j in data[i]){
+ num+=getn(i,j);
+ }
+ }
+ var dn=num*(lib.card.list.length-data.total)/(data.total-num);
+ if(dn>1000) dn=1000;
+ if(dn>0){
+ var p=0;
+ for(var i in data){
+ for(var j in data[i]){
+ var n=Math.round(dn*getn(i,j)/num);
+ while(n--){
+ if(i=='huosha'){
+ lib.card.list.push([j,rand(),'sha','fire']);
+ }
+ else if(i=='leisha'){
+ lib.card.list.push([j,rand(),'sha','thunder']);
+ }
+ else{
+ lib.card.list.push([j,rand(),i]);
+ }
+ }
+ }
+ }
+ }
+ },
+ help:{
+ '牌堆补充':'
- 将杀闪等牌在牌堆中的比例维持在与军争牌堆相同,防止开启扩展包后重要的牌被过多地稀释'
+ },
+}
diff --git a/game/asset.js b/game/asset.js
index ccd0fd461..94a89eb43 100644
--- a/game/asset.js
+++ b/game/asset.js
@@ -1,5 +1,5 @@
window.noname_asset_list=[
- '1.9.2',
+ '1.9.3',
'image/background/huangtian_bg.jpg',
'image/background/shengshi_bg.jpg',
'image/background/xueji_bg.jpg',
@@ -715,6 +715,16 @@ window.noname_asset_list=[
'image/character/zhuzhi.jpg',
'image/character/zumao.jpg',
'image/character/zuoci.jpg',
+ 'image/class/druid.png',
+ 'image/class/hunter.png',
+ 'image/class/knight.png',
+ 'image/class/mage.png',
+ 'image/class/paladin.png',
+ 'image/class/priest.png',
+ 'image/class/rogue.png',
+ 'image/class/shaman.png',
+ 'image/class/warlock.png',
+ 'image/class/warrior.png',
'image/mode/boss/character/boss_baiwuchang.jpg',
'image/mode/boss/character/boss_caiwenji.jpg',
'image/mode/boss/character/boss_chi.jpg',
@@ -788,16 +798,6 @@ window.noname_asset_list=[
'image/mode/tafang/character/tafang_mech_toushiche.jpg',
'image/mode/tafang/character/tafang_mech_tutengzhen.jpg',
'image/mode/tafang/character/tafang_mech_weixingxianjing.jpg',
- 'image/mode/stone/career/druid.png',
- 'image/mode/stone/career/hunter.png',
- 'image/mode/stone/career/knight.png',
- 'image/mode/stone/career/mage.png',
- 'image/mode/stone/career/paladin.png',
- 'image/mode/stone/career/priest.png',
- 'image/mode/stone/career/rogue.png',
- 'image/mode/stone/career/shaman.png',
- 'image/mode/stone/career/warlock.png',
- 'image/mode/stone/career/warrior.png',
'image/mode/stone/character/stone_chilundashi.jpg',
'image/mode/stone/character/stone_aidewen.jpg',
'image/mode/stone/character/stone_aihaozhihun.jpg',
diff --git a/game/config.js b/game/config.js
index f3604f175..5435e10dc 100644
--- a/game/config.js
+++ b/game/config.js
@@ -27,7 +27,8 @@ window.config={
forbiddouble:['zhugedan','swd_kangnalishi','dongzhuo','wutugu','jg_simayi','hs_siwangzhiyi','hs_ronghejuren','hs_shanlingjuren'],
layoutfixed:['chess','brawl'],
all:{
- stockmode:['identity','guozhan','versus','boss','chess','stone','connect','brawl','tafang'],
+ stockmode:['identity','guozhan','versus','boss','chess','stone','connect','brawl','tafang','hearthstone'],
+ stockextension:['boss','cardpile','character','coin','soldier','weather','wuxing','hs_mod'],
layout:['default','newlayout'],
theme:['woodden','music','simple'],
card_font:['xiaozhuan','huangcao','caoshu','xingshu'],
@@ -272,7 +273,7 @@ window.config={
right_click:'pause',
sort:'type_sort',
- cards:['standard','ex','extra','sp'],
+ cards:['standard','ex','extra','sp','classic','basic'],
characters:['standard','shenhua','refresh','sp','yijiang'],
connect_characters:[],
connect_cards:[],
diff --git a/game/game.js b/game/game.js
index c20cb4ca2..669150ebe 100644
--- a/game/game.js
+++ b/game/game.js
@@ -149,6 +149,18 @@
general:{
name:'通用',
config:{
+ // game:{
+ // name:'游戏模式',
+ // init:'sgs',
+ // item:{
+ // sgs:'三国杀',
+ // hs:'炉石传说',
+ // },
+ // onclick:function(item){
+ // game.saveConfig('game',item);
+ // game.reload();
+ // }
+ // },
low_performance:{
name:'流畅模式',
init:false,
@@ -190,10 +202,12 @@
wuxie_self:{
name:'不无懈自己',
init:true,
+ game:'sgs',
},
tao_enemy:{
name:'不对敌将使用桃',
init:false,
+ game:'sgs',
},
touchscreen:{
name:'触屏模式',
@@ -272,6 +286,7 @@
show_splash:{
name:'显示开始界面',
init:false,
+ game:'sgs',
},
game_speed:{
name:'游戏速度',
@@ -479,6 +494,7 @@
layout:{
name:'布局',
init:'mobile',
+ game:'sgs',
item:{
default:'旧版',
newlayout:'对称',
@@ -500,9 +516,24 @@
}
}
},
+ layouths:{
+ name:'布局',
+ init:'mobile',
+ game:'hs',
+ item:{
+ mobile:'默认',
+ phone:'移动'
+ },
+ onclick:function(layout){
+ game.saveConfig('layouths',layout);
+ lib.config.layout=layout;
+ lib.init.layout(layout,true);
+ }
+ },
textequip:{
name:'装备显示',
init:'image',
+ game:'sgs',
item:{
image:'图片',
text:'文字',
@@ -654,11 +685,12 @@
},
change_skin:{
name:'双击换肤',
- init:true
+ init:true,
},
card_style:{
name:'卡牌样式',
init:'default',
+ game:'sgs',
item:{
default:'默认',
wood:'木纹',
@@ -697,6 +729,7 @@
hp_style:{
name:'体力条样式',
init:'default',
+ game:'sgs',
item:{
default:'默认',
official:'勾玉',
@@ -745,6 +778,7 @@
show_log:{
name:'历史记录栏',
init:'off',
+ game:'sgs',
unfrequent:true,
item:{
off:'关闭',
@@ -767,6 +801,7 @@
clear_log:{
name:'自动清除历史记录',
init:false,
+ game:'sgs',
unfrequent:true,
},
log_highlight:{
@@ -778,6 +813,7 @@
name:'当前回合角色高亮',
unfrequent:true,
init:'yellow',
+ game:'sgs',
item:{
none:'无',
yellow:'黄色',
@@ -800,6 +836,7 @@
mark_identity_style:{
name:'标记身份操作',
unfrequent:true,
+ game:'sgs',
init:'menu',
item:{
menu:'菜单',
@@ -878,16 +915,19 @@
},
hide_card_prompt_basic:{
name:'隐藏基本牌提示',
+ game:'sgs',
init:false,
unfrequent:true,
},
hide_card_prompt_equip:{
name:'隐藏装备牌提示',
+ game:'sgs',
init:false,
unfrequent:true,
},
show_phase_prompt:{
name:'显示阶段提示',
+ game:'sgs',
init:true,
unfrequent:true,
},
@@ -904,21 +944,25 @@
auto_popped_config:{
name:'自动弹出选项',
init:true,
+ game:'sgs',
unfrequent:true,
},
auto_popped_history:{
name:'自动弹出历史',
init:false,
+ game:'sgs',
unfrequent:true,
},
remember_dialog:{
name:'记住对话框位置',
init:false,
+ game:'sgs',
unfrequent:true,
},
reset_dialog:{
name:'重置对话框位置',
clear:true,
+ game:'sgs',
unfrequent:true,
onclick:function(){
if(ui.dialog){
@@ -961,6 +1005,7 @@
character_dialog_tool:{
name:'自由选将显示',
init:'最近',
+ game:'sgs',
item:{
'收藏':'收藏',
'最近':'最近',
@@ -972,6 +1017,7 @@
recent_character_number:{
name:'最近使用武将',
init:'12',
+ game:'sgs',
item:{
'6':'6',
'12':'12',
@@ -983,6 +1029,7 @@
show_favourite:{
name:'显示添加收藏',
init:true,
+ game:'sgs',
unfrequent:true
},
hide_card_image:{
@@ -990,10 +1037,12 @@
init:false,
unfrequent:true,
restart:true,
+ game:'sgs',
},
show_name:{
name:'显示武将名',
init:false,
+ game:'sgs',
unfrequent:true,
onclick:function(bool){
game.saveConfig('show_name',bool);
@@ -1026,6 +1075,7 @@
show_playerids:{
name:'显示身份按钮',
init:true,
+ game:'sgs',
unfrequent:true,
onclick:function(bool){
game.saveConfig('show_playerids',bool);
@@ -1082,6 +1132,7 @@
show_cardpile:{
name:'显示牌堆按钮',
init:true,
+ game:'sgs',
unfrequent:true,
onclick:function(bool){
game.saveConfig('show_cardpile',bool);
@@ -1096,6 +1147,7 @@
show_handcardbutton:{
name:'显示手牌按钮',
init:true,
+ game:'sgs',
unfrequent:true,
onclick:function(bool){
game.saveConfig('show_handcardbutton',bool);
@@ -1104,6 +1156,7 @@
show_wuxie:{
name:'显示不询问无懈',
init:false,
+ game:'sgs',
unfrequent:true,
onclick:function(bool){
game.saveConfig('show_wuxie',bool);
@@ -1118,6 +1171,7 @@
show_discardpile:{
name:'暂停时显示弃牌堆',
init:false,
+ game:'sgs',
unfrequent:true,
},
title:{
@@ -1161,6 +1215,7 @@
jiu_effect:{
name:'喝酒效果',
init:true,
+ game:'sgs',
unfrequent:true,
},
die_flip:{
@@ -1193,6 +1248,7 @@
link_style:{
name:'横置样式',
init:'rotate',
+ game:'sgs',
unfrequent:true,
item:{
rotate:'横置',
@@ -1226,6 +1282,7 @@
},
identity_font:{
name:'身份字体',
+ game:'sgs',
init:'huangcao',
unfrequent:true,
item:{},
@@ -1513,6 +1570,7 @@
},
reset_hiddenpack:{
name:'重置隐藏扩展包',
+ game:'sgs',
onclick:function(){
if(this.innerHTML!='已重置'){
this.innerHTML='已重置'
@@ -1568,6 +1626,7 @@
},
trim_game:{
name:'隐藏非官方扩展包',
+ game:'sgs',
onclick:function(){
if(this.innerHTML!='已隐藏'){
this.innerHTML='已隐藏';
@@ -1936,6 +1995,31 @@
}
},
},
+ hsmod:{
+ enable:{
+ name:'开启',
+ init:false,
+ restart:true,
+ onclick:function(bool){
+ if(bool){
+ lib.config.plays.add('hsmod');
+ }
+ else{
+ lib.config.plays.remove('hsmod');
+ }
+ game.saveConfig('plays',lib.config.plays);
+ }
+ },
+ hide:{
+ name:'隐藏此扩展',
+ clear:true,
+ onclick:function(){
+ this.innerHTML='此扩展将在重启后隐藏';
+ lib.config.hiddenPlayPack.add('hsmod');
+ game.saveConfig('hiddenPlayPack',lib.config.hiddenPlayPack);
+ }
+ },
+ },
},
mode:{
identity:{
@@ -3592,11 +3676,12 @@
if(window.isNonameServer){
lib.config.mode='connect';
}
- if(lib.config.hearth){
+ if(lib.config.game=='hs'){
character.pack=character.hearthpack;
card.pack=card.hearthpack;
play.pack=play.hearthpack;
- mode.pack=mode.hearthpack;
+ mode.pack=[];
+ lib.config.mode='hearthstone';
}
for(i in character.pack){
if(lib.config.hiddenCharacterPack.indexOf(i)==-1){
@@ -3627,7 +3712,7 @@
}
}
}
- if(lib.config.all.mode.length==0){
+ if(lib.config.all.mode.length==0&&lib.config.game=='sgs'){
lib.config.all.mode.push('identity');
lib.translate.identity='身份';
if(!lib.config.gameRecord.identity){
@@ -3688,6 +3773,7 @@
game.saveConfig('confirm_exit',true);
if(!lib.ipad){
game.saveConfig('layout','phone');
+ game.saveConfig('layouths','phone');
}
}
delete lib.ipad;
@@ -3699,9 +3785,13 @@
localStorage.setItem(lib.configprefix+'disable_extension',true);
}
}
- var extensionlist;
+ var extensionlist=[];
if(!localStorage.getItem(lib.configprefix+'disable_extension')){
- extensionlist=lib.config.plays.slice(0);
+ for(var i=0;i=5){
this.node.name.classList.add('long');
+ if(name.length>=7){
+ this.node.name.classList.add('longlong');
+ }
}
this.node.name2.innerHTML=get.translation(card[0])+card[1]+' '+name;
this.suit=card[0];
@@ -13183,6 +13284,23 @@
if(_status.connectMode&&!game.online&&lib.cardOL&&!this.cardid){
this.cardid=get.id();
lib.cardOL[this.cardid]=this;
+ }
+ if(lib.config.game=='hs'){
+ var info=lib.card[card[2]];
+ if(info.class!='neutral'){
+ this.node.name.dataset.careercolor=info.class;
+ }
+ if(info.health){
+ this.node.info.innerHTML=info.attack+'/'+info.health;
+ }
+ else if(info.duration){
+ this.node.info.innerHTML=info.attack+'/'+info.duration;
+ }
+ else{
+ this.node.info.innerHTML='';
+ }
+ this.node.cost=ui.create.div('.cost',this);
+ this.node.cost.innerHTML=info.cost;
}
return this;
},
@@ -20975,10 +21093,16 @@
clickContainer.call(menuContainer);
}
}
-
- menux=createMenu(['开始','选项','武将','卡牌','扩展','其它'],{
- position:menuContainer,bar:40
- });
+ if(lib.config.game=='hs'){
+ menux=createMenu(['选项','卡牌','扩展','其它'],{
+ position:menuContainer,bar:95
+ });
+ }
+ else{
+ menux=createMenu(['开始','选项','武将','卡牌','扩展','其它'],{
+ position:menuContainer,bar:40
+ });
+ }
menu=menux.menu;
}
else{
@@ -21021,6 +21145,7 @@
var copyObj=get.copy;
(function(){
+ if(lib.config.game=='hs') return;
var start=menuxpages.shift();
var rightPane=start.lastChild;
@@ -21654,6 +21779,9 @@
// cfgnode.hide();
cfgnode.style.display='none';
}
+ if(cfg.game&&cfg.game!=lib.config.game){
+ cfgnode.style.display='none';
+ }
if(j=='import_data_button'){
ui.import_data_button=cfgnode;
cfgnode.hide();
@@ -21769,6 +21897,7 @@
};
for(var i in lib.configMenu){
+ if(i=='skill'&&lib.config.game=='hs') continue;
createModeConfig(i,start.firstChild);
}
for(var i in lib.help){
@@ -21836,6 +21965,7 @@
}());
(function(){
+ if(lib.config.game=='hs') return;
var start=menuxpages.shift();
var rightPane=start.lastChild;
@@ -21908,6 +22038,9 @@
var info=lib.characterPack[mode];
var page=ui.create.div('');
var node=ui.create.div('.menubutton.large',lib.translate[mode+'_character_config'],position,clickMode);
+ if(node.innerHTML.length>=5){
+ node.classList.add('smallfont');
+ }
if(position2){
position.insertBefore(node,position2);
}
@@ -22802,6 +22935,9 @@
var info=lib.cardPack[mode];
var page=ui.create.div('');
var node=ui.create.div('.menubutton.large',lib.translate[mode+'_card_config'],position,clickMode);
+ if(node.innerHTML.length>=5){
+ node.classList.add('smallfont');
+ }
node.link=page;
node.mode=mode;
var list=[];
@@ -23057,7 +23193,7 @@
rightPane.appendChild(active.link);
(function(){
- if(connectMenu) return;
+ if(connectMenu||lib.config.game=='hs') return;
var page=ui.create.div('.menu-buttons');
var node=ui.create.div('.menubutton.large','牌堆',clickMode);
start.firstChild.insertBefore(node,start.firstChild.querySelector('.lefttext'));
@@ -23270,6 +23406,9 @@
}
else{
node=ui.create.div('.menubutton.large',lib.translate[mode+'_play_config'],position,clickMode);
+ }
+ if(node.innerHTML.length>=5){
+ node.classList.add('smallfont');
}
node.link=page;
node.mode=mode;
@@ -23305,6 +23444,7 @@
return node;
};
for(var i in lib.extensionMenu){
+ if(lib.config.all.stockextension.contains(i)&&!lib.config.all.plays.contains(i)) continue;
if(lib.config.hiddenPlayPack.contains(i)) continue;
createModeConfig(i,start.firstChild);
}
@@ -25876,6 +26016,7 @@
page.appendChild(ul);
}());
(function(){
+ if(lib.config.game=='hs') return;
var checkCheat=function(){
if(currentrow1&¤trow2&&row3.querySelector('.glow')){
cheatButton.classList.add('glowing');
@@ -26019,6 +26160,7 @@
});
}());
(function(){
+ if(lib.config.game=='hs') return;
var page=ui.create.div('');
var node=ui.create.div('.menubutton.large','换人',start.firstChild,clickMode);
node.link=page;
@@ -27521,7 +27663,7 @@
ui.window.appendChild(ui.backgroundMusic);
ui.arenalog=ui.create.div('#arenalog',ui.arena);
- if(lib.config.show_log=='off'){
+ if(lib.config.show_log=='off'||lib.config.game!='sgs'){
ui.arenalog.style.display='none';
}
else{
@@ -27724,10 +27866,10 @@
if(!lib.config.show_auto){
ui.auto.style.display='none';
}
- if(!lib.config.show_wuxie){
+ if(!lib.config.show_wuxie||lib.config.game!='sgs'){
ui.wuxie.style.display='none';
}
- if(!lib.config.show_cardpile||_status.connectMode){
+ if(!lib.config.show_cardpile||_status.connectMode||lib.config.game!='sgs'){
ui.cardPileButton.style.display='none';
}
if(lib.config.touchscreen&&!lib.config.confirmtouch){
@@ -27749,7 +27891,7 @@
_status.identityShown=true;
}
},true);
- if(!lib.config.show_playerids||!game.showIdentity){
+ if(!lib.config.show_playerids||!game.showIdentity||lib.config.game!='sgs'){
ui.playerids.style.display='none';
}
if(!lib.config.show_replay){
@@ -28021,7 +28163,7 @@
ui.create.div('',node.node.hp);
}
}
- if(!lib.config.show_name){
+ if(!lib.config.show_name||lib.config.game=='hs'){
node.node.name.style.display='none';
}
if(node.node.hp.childNodes.length==0){
@@ -28490,6 +28632,7 @@
pausehistory:function(){
if(!lib.config.auto_popped_history) return;
if(!ui.sidebar.childNodes.length) return;
+ if(lib.config.game=='hs') return;
var uiintro=ui.create.dialog('hidden');
uiintro.style.maxHeight='400px';
uiintro.add(ui.sidebar);
@@ -28498,6 +28641,7 @@
pauseconfig:function(){
if(!lib.config.auto_popped_config) return;
if(lib.config.layout=='phone') return;
+ if(lib.config.game=='hs') return;
// if(!ui.config.childNodes.length) return;
var uiintro=ui.create.dialog('hidden');
uiintro.listen(function(e){
@@ -30416,7 +30560,7 @@
game.pause2();
var node=ui.create.pause().animate('start');
ui.sidebar3.innerHTML='';
- if(lib.config.show_discardpile){
+ if(lib.config.show_discardpile&&lib.config.game=='sgs'){
for(var i=0;i.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.stone>.player.minskin[data-position='9']{top:30px;left:calc(100% - 120px);}
+#arena.stone>.card[data-position='9']{top:38px;left:calc(100% - 112px);}
+#arena.stone>.popup[data-position='9']{top:160px;left:calc(100% - 112px);}
+#arena.stone>.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.stone>.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.stone>.player.minskin[data-position='8']{top:30px;left:0;}
+#arena.stone>.card[data-position='8']{top:38px;left:8px;}
+#arena.stone>.popup[data-position='8']{top:160px;left:8px;}
+#arena:not(.chess).mobile>.player[data-position='0']>.name{
+ top:30px;
+}
+#arena .player>.name{
+ top:36px;
+}
+#arena.slim_player .player>.name{
+ top:33px;
+}
+#arena .player.linked>.name{
+ transform: rotate(90deg) translate(120px,-96px);
+}
+#arena .player.linked>.name.name2{
+ transform: rotate(90deg) translate(98px,-31px);
+}
+
+#arena.oldlayout .player.linked>.name{
+ transform: none !important;
+}
+#arena.oldlayout .player.linked>.name.name2{
+ transform: none !important;
+}
+
+.player>.identity.menubutton.round{
+ padding: 0;
+ transform: scale(1.2) translate(-2px,2px);
+}
+.card .wunature{
+ top:74px;
+ left:6px;
+ right: auto;
+}
+.player .equips{
+ z-index: 4;
+}
+
+#arena:not(.chess).mobile .player[data-position='0']:not(.minskin)>.identity{
+ left: 102px;
+ top: -7px;
+}
+
+#deck-builder{
+ overflow: hidden;
+}
+#deck-builder>.shadowed.list{
+ width: 200px;
+ height: 100%;
+ right: 0;
+ top:0;
+ border-radius: 0px;
+ transform: translateX(200px);
+ opacity: 0;
+}
+#deck-builder.shown>.shadowed.list{
+ transform: none;
+ opacity: 1;
+}
+#deck-builder>.shadowed.list>.menubutton.large.create{
+ position: absolute;
+ bottom: 10px;
+ left: auto;
+ right: 10px;
+ margin: 0;
+ padding: 0;
+ width: 180px;
+ height: 50px;
+ font-size: 36px;
+ line-height: 50px;
+ z-index: 2;
+}
+#deck-builder>.shadowed.list>.list-container{
+ width:100%;
+ left:0;
+ height: calc(100% - 60px);
+ overflow-y: scroll;
+ overflow-x: visible;
+ text-align: left;
+}
+#deck-builder>.shadowed.list>.list-container:not(.deck){
+ z-index: 1;
+}
+#deck-builder>.shadowed.list>.list-container.deck{
+ pointer-events: none;
+ opacity: 0;
+}
+#deck-builder>.shadowed.list>.list-container.deck.shown{
+ pointer-events: auto;
+ opacity: 1;
+}
+#deck-builder>.shadowed.list>.list-container.deck>.card{
+ zoom:0.8;
+ margin-bottom: 15px;
+ margin-top: 0;
+ transition: all 0s;
+}
+#deck-builder>.shadowed.list>.list-container.deck>.card:nth-child(2n+1){
+ margin-left: 15px;
+}
+#deck-builder>.shadowed.list>.list-container.deck>.card:nth-child(2n){
+ margin-left: 7px;
+}
+#deck-builder>.shadowed.list>.list-container.deck>.card:first-child,
+#deck-builder>.shadowed.list>.list-container.deck>.card:first-child+div{
+ margin-top: 15px;
+}
+.deckitem{
+ position: relative;
+ width: 170px;
+ margin-left: 15px;
+ margin-right: 0;
+ padding-left: 0;
+ padding-right: 0;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ margin-top: 15px;
+ margin-bottom: 0px;
+ text-align: left;
+ font-size:24px;
+ line-height:30px;
+ font-family:'xinwei';
+ border-radius: 40px 4px 4px 40px;
+ background-size: cover;
+ white-space: nowrap;
+ transition: all 0s;
+}
+.deckitem.random{
+ border-radius: 4px;
+ text-align: center;
+}
+.deckitem.random>span{
+ margin-left: 0;
+}
+.deckitem:last-child{
+ margin-bottom: 15px;
+}
+.deckitem>span{
+ margin-left: 46px;
+}
+.deckitem>.menubutton.round{
+ position: absolute;
+ left: -1px;
+ top: -2px;
+ width: 34px;
+ height: 34px;
+}
+#deck-builder>.shadowed.career{
+ width: 240px;
+ height: 240px;
+ right: 220px;
+ bottom: 20px;
+ opacity: 0;
+ transform: scale(0) translateX(300px);
+ transform-origin: right bottom;
+ transition-duration: 0.3s;
+ z-index: 8;
+}
+#deck-builder>.shadowed.career.shown{
+ transform: scale(1) translateX(0);
+ opacity: 1;
+}
+#deck-builder>.shadowed.career>div{
+ width: 80px;
+ height: 80px;
+ margin: 0;
+ padding: 0;
+ position: relative;
+ display: inline-block;
+}
+#deck-builder>.shadowed.career>div>.menubutton.round{
+ left: 15px;
+ top: 5px;
+}
+#deck-builder>.shadowed.career>div>.text{
+ font-size: 12px;
+ width: 100%;
+ text-align: center;
+ top: 58px;
+}
+#deck-builder>.dialog.fixed{
+ left: auto;
+ right: 240px;
+ width: calc(100% - 280px);
+ /*opacity: 0;*/
+ animation: none;
+ -webkit-animation:none;
+ /*transform: scale(0.8);*/
+ /*pointer-events: none;*/
+ /*-webkit-animation:dialog_start2 0.5s;*/
+ transition: all 0.5s;
+}
+#deck-builder:not(.shown)>.dialog.fixed{
+ opacity: 0;
+ transform: scale(0.8);
+ pointer-events: none;
+}
+#deck-builder>.dialog.fixed.shown{
+ opacity: 1;
+ transform: scale(1);
+ pointer-events: auto;
+}
+#deck-builder>.controls{
+ opacity: 0;
+ height: 50px;
+ width: calc(100% - 200px);
+ bottom: 10px;
+ left: 0;
+ text-align: right;
+ z-index: 9;
+ pointer-events: none;
+}
+#deck-builder>.controls>div{
+ position: relative;
+ margin-top:5px;
+ margin-left: 5px;
+ margin-right: 5px;
+}
+#deck-builder>.controls>.card-count{
+ position: absolute;
+ width: 100px;
+ height: 100%;
+ left: calc(50% - 50px);
+ text-align: center;
+ font-family: 'xinwei';
+ font-size: 24px;
+ line-height: 50px;
+ margin: 0;
+}
+#deck-builder>.controls>div:last-child{
+ margin-right: 40px;
+ white-space: nowrap;
+ -webkit-user-select: text;
+}
+#deck-builder>.controls.shown{
+ opacity: 1;
+ pointer-events: auto;
+}
+#arena>.player.stone_deck{
+ transform: scale(1) translateX(100px);
+ opacity: 0;
+ transition: all 0.5s;
+ left: calc(5% + 50px);
+ top:calc(50% - 90px);
+}
+#arena>.player.stone_deck.shown{
+ transform: scale(0.8);
+ opacity: 1;
+}
+#arena>.player.stone_deck.shown.removing{
+ transform: scale(0.6) translateX(-100px);
+}
+#arena>.player.stone_deck>div:not(.avatar):not(.avatar2){
+ display: none !important;
+}
+
+
+/*#arena>.skillbar>.skillbartext:hover{
+ opacity: 1;
+}*/
+@-webkit-keyframes skillbarglow{
+ 0%{box-shadow: rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(255, 0, 0, 0.4) 0 0 5px}
+ 50%{box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px,rgba(255, 0, 0, 0.4) 0 0 5px,
+ rgba(255, 0, 0, 0.4) 0 0 12px, rgba(255, 0, 0, 1) 0 0 30px, rgba(255, 0, 0, 0.2) 0 0 30px}
+ 100%{box-shadow: rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(255, 0, 0, 0.4) 0 0 5px}
+}
+
+div[data-career='mage']{
+ background-image: url('../../../image/class/mage.png');
+ background-size:cover;
+}
+div[data-career='druid']{
+ background-image: url('../../../image/class/druid.png');
+ background-size:cover;
+}
+div[data-career='hunter']{
+ background-image: url('../../../image/class/hunter.png');
+ background-size:cover;
+}
+div[data-career='shaman']{
+ background-image: url('../../../image/class/shaman.png');
+ background-size:cover;
+}
+div[data-career='paladin']{
+ background-image: url('../../../image/class/paladin.png');
+ background-size:cover;
+}
+div[data-career='rogue']{
+ background-image: url('../../../image/class/rogue.png');
+ background-size:cover;
+}
+div[data-career='priest']{
+ background-image: url('../../../image/class/priest.png');
+ background-size:cover;
+}
+div[data-career='warrior']{
+ background-image: url('../../../image/class/warrior.png');
+ background-size:cover;
+}
+div[data-career='warlock']{
+ background-image: url('../../../image/class/warlock.png');
+ background-size:cover;
+}
+div[data-career='knight']{
+ background-image: url('../../../image/class/knight.png');
+ background-size:cover;
+}
+
+div[data-careercolor='mage']{
+ background-image: linear-gradient(rgba(139, 216, 245,0.8),rgba(90, 172, 204,0.8));
+ box-shadow: rgb(62, 137, 167) 0 0 0 1px;
+}
+div[data-careercolor='druid']{
+ background-image: linear-gradient(rgba(158, 87, 13,0.8),rgba(140, 77, 11,0.8));
+ box-shadow: rgb(101, 54, 5) 0 0 0 1px;
+}
+div[data-careercolor='hunter']{
+ background-image: linear-gradient(rgba(70, 162, 1,0.8),rgba(62, 138, 5,0.8));
+ box-shadow: rgb(39, 86, 3) 0 0 0 1px;
+}
+div[data-careercolor='shaman']{
+ background-image: linear-gradient(rgba(11, 99, 230,0.8),rgba(0, 85, 212,0.8));
+ box-shadow: rgb(4, 60, 142) 0 0 0 1px;
+}
+div[data-careercolor='paladin']{
+ background-image: linear-gradient(rgba(255, 236, 11,0.8),rgba(214, 182, 66,0.8));
+ box-shadow: rgb(177, 138, 53) 0 0 0 1px;
+}
+div[data-careercolor='rogue']{
+ background-image: linear-gradient(rgba(107, 120, 150,0.8),rgba(97, 109, 138,0.8));
+ box-shadow: rgb(75, 85, 111) 0 0 0 1px;
+}
+div[data-careercolor='priest']{
+ background-image: linear-gradient(rgba(255, 255, 255,0.8),rgba(224, 224, 224,0.8));
+ box-shadow: rgb(200, 200, 200) 0 0 0 1px;
+}
+div[data-careercolor='warrior']{
+ background-image: linear-gradient(rgba(187, 60, 60,0.8),rgba(165, 40, 40,0.8));
+ box-shadow: rgb(123, 23, 23) 0 0 0 1px;
+}
+div[data-careercolor='warlock']{
+ background-image: linear-gradient(rgba(132, 60, 187,0.8),rgba(114, 48, 165,0.8));
+ box-shadow: rgb(90, 31, 136) 0 0 0 1px;
+}
+
+.card>.info{
+ /*display: none;*/
+}
+.card>.name{
+ padding: 2px;
+ border-radius: 4px;
+ top: 8px;
+ left: 6px;
+}
+.card>.name,
+div:not(.handcards)>.card>.name,
+.handcards>.card:last-child>.name{
+ transform: scale(0.8) !important;
+}
+.card>.name.longlong{
+ top: 5px;
+}
+.card>.cost{
+ bottom: 6px;
+ right: 6px;
+ text-align: center;
+ font-family: 'xinwei';
+ border: none;
+}
diff --git a/layout/default/layout.css b/layout/default/layout.css
index 01549516b..e7ba788ae 100644
--- a/layout/default/layout.css
+++ b/layout/default/layout.css
@@ -1870,6 +1870,10 @@ span[data-color="unknownm"]{
.menubutton.large.disabled{
opacity: 0.5;
}
+.menubutton.large.smallfont{
+ font-size: 22px !important;
+ text-indent: -2px;
+}
.config>.toggle.onoff>div>div{
width:8px;
height:8px;
diff --git a/layout/mode/stone.css b/layout/mode/stone.css
index f8d19e415..057f3da82 100644
--- a/layout/mode/stone.css
+++ b/layout/mode/stone.css
@@ -289,42 +289,42 @@
}
div[data-career='mage']{
- background-image: url('../../../image/mode/stone/career/mage.png');
+ background-image: url('../../../image/class/mage.png');
background-size:cover;
}
div[data-career='druid']{
- background-image: url('../../../image/mode/stone/career/druid.png');
+ background-image: url('../../../image/class/druid.png');
background-size:cover;
}
div[data-career='hunter']{
- background-image: url('../../../image/mode/stone/career/hunter.png');
+ background-image: url('../../../image/class/hunter.png');
background-size:cover;
}
div[data-career='shaman']{
- background-image: url('../../../image/mode/stone/career/shaman.png');
+ background-image: url('../../../image/class/shaman.png');
background-size:cover;
}
div[data-career='paladin']{
- background-image: url('../../../image/mode/stone/career/paladin.png');
+ background-image: url('../../../image/class/paladin.png');
background-size:cover;
}
div[data-career='rogue']{
- background-image: url('../../../image/mode/stone/career/rogue.png');
+ background-image: url('../../../image/class/rogue.png');
background-size:cover;
}
div[data-career='priest']{
- background-image: url('../../../image/mode/stone/career/priest.png');
+ background-image: url('../../../image/class/priest.png');
background-size:cover;
}
div[data-career='warrior']{
- background-image: url('../../../image/mode/stone/career/warrior.png');
+ background-image: url('../../../image/class/warrior.png');
background-size:cover;
}
div[data-career='warlock']{
- background-image: url('../../../image/mode/stone/career/warlock.png');
+ background-image: url('../../../image/class/warlock.png');
background-size:cover;
}
div[data-career='knight']{
- background-image: url('../../../image/mode/stone/career/knight.png');
+ background-image: url('../../../image/class/knight.png');
background-size:cover;
}
diff --git a/mode/brawl.js b/mode/brawl.js
index 84b14bb0c..8a3ad7d2e 100644
--- a/mode/brawl.js
+++ b/mode/brawl.js
@@ -150,6 +150,7 @@ mode.brawl={
if(bool&&level.index+1stage.level){
@@ -168,6 +169,7 @@ mode.brawl={
else{
game.save('directStage',[stage.name,level.index],'brawl');
}
+ localStorage.setItem(lib.configprefix+'directstart',true);
game.reload();
});
if(stage.mode=='sequal'&&level.index==stage.scenes.length-1){
diff --git a/mode/hearthstone.js b/mode/hearthstone.js
new file mode 100644
index 000000000..162a6d3e8
--- /dev/null
+++ b/mode/hearthstone.js
@@ -0,0 +1,1392 @@
+'use strict';
+// next: 新建卡组
+mode.hearthstone={
+ start:function(){
+ "step 0"
+ lib.init.css(lib.assetURL+'layout/default/','hearthstone');
+ game.initStone();
+ var playback=localStorage.getItem(lib.configprefix+'playback');
+ if(!playback){
+ (function(){
+ ui.deckBuilder=ui.create.div('.popup-container#deck-builder',function(){
+ if(careerList.classList.contains('shown')){
+ careerList.classList.remove('shown');
+ newDeck.classList.remove('active');
+ }
+ else if(!cardDialog.classList.contains('shown')){
+ this.classList.remove('shown');
+ this.timeout=setTimeout(function(){
+ ui.deckBuilder.remove();
+ },500);
+ ui.arena.style.top='';
+ ui.arena.style.transform='';
+ ui.arena.style.opacity='';
+ ui.system.style.opacity='';
+ ui.auto.show();
+ ui.pause.show();
+ ui.historybar.show();
+ }
+ });
+ var clickNode=function(){
+ cardDialog.classList.add('shown');
+ controls.classList.add('shown');
+ var name='未命名';
+ for(var i=1;;i++){
+ if(!lib.storage.deckList[name+i]){
+ break;
+ }
+ }
+ cardDialog.editing={
+ name:name+i,
+ content:{
+ career:this.firstChild.dataset.career,
+ deck:[]
+ },
+ }
+ rename.innerHTML=name+i;
+ newDeck.innerHTML='确认编辑';
+ newDeck.classList.add('active');
+ careerList.classList.remove('shown');
+ listContainer.style.transform='translateX(200px)';
+ deckContainer.innerHTML='';
+ deckContainer.classList.add('shown');
+ updateCardDialog();
+ }
+ var careerList=ui.create.div('.shadowed.career',ui.deckBuilder);
+ for(var i=0;i/g,'');
+ };
+ var observer = new MutationObserver(removeLine);
+ observer.observe(rename,{characterData:true,subtree:true});
+ rename.addEventListener('keyup',removeLine);
+
+ var cardDialog=ui.create.cardDialog(true,function(name){
+ if(lib.card[name].hidden) return true;
+ },{seperate:function(list){
+ var result={
+ list:{}
+ };
+ for(var i=0;i=30){
+ for(var i=0;i=2){
+ list.push(i);
+ }
+ }
+ for(var i=0;ib) return 1;
+ if(a'+editing.name+'',
+ listContainer,editDeck);
+ ui.create.div('.menubutton.round',deckitem).dataset.career=editing.content.career;
+ deckitem.name=editing.name;
+ }
+ lib.storage.deckList[editing.name]=editing.content;
+ }
+ game.save('deckList',lib.storage.deckList);
+ listContainer.style.transform='';
+ deckContainer.classList.remove('shown');
+ updateCardDialog();
+ }
+ e.stopPropagation();
+ });
+ var listContainer=ui.create.div('.list-container',deckList);
+ for(var i in lib.storage.deckList){
+ var deckitem=ui.create.div('.deckitem.shadowed',''+i+'',
+ listContainer,editDeck);
+ ui.create.div('.menubutton.round',deckitem).dataset.career=lib.storage.deckList[i].career;
+ deckitem.name=i;
+ }
+ var deckContainer=ui.create.div('.list-container.deck',deckList);
+
+ ui.deckcontrol=ui.create.system('卡组管理',function(){
+ ui.arena.style.opacity=0;
+ ui.system.style.opacity=0;
+ ui.window.appendChild(ui.deckBuilder);
+ if(ui.deckBuilder.timeout){
+ clearTimeout(ui.deckBuilder.timeout);
+ delete ui.deckBuilder.timeout;
+ }
+ ui.refresh(ui.deckBuilder);
+ ui.deckBuilder.classList.add('shown');
+ ui.auto.hide();
+ ui.pause.hide();
+ ui.historybar.hide();
+ },true);
+ }());
+
+ }
+
+ if(playback){
+ ui.create.me();
+ ui.arena.style.display='none';
+ ui.system.style.display='none';
+ _status.playback=playback;
+ localStorage.removeItem(lib.configprefix+'playback');
+ var store=lib.db.transaction(['video'],'readwrite').objectStore('video');
+ store.get(parseInt(playback)).onsuccess=function(e){
+ if(e.target.result){
+ game.playVideoContent(e.target.result.video);
+ }
+ else{
+ alert('播放失败:找不到录像');
+ game.reload();
+ }
+ }
+ event.finish();
+ }
+ else{
+ game.prepareArena(2);
+ game.delay();
+ }
+ ui.arena.classList.add('stone');
+ "step 1"
+ for(var i=0;i'+game.me.deckCards.length);
+ uiintro.addSmall([game.me.deckCards,'card']);
+ return uiintro;
+ },220);
+ if(get.config('skill_bar')){
+ _status.rageEnabled=true;
+
+ ui.friendBar=ui.create.div('.skillbar.right.shadowed.playerbg',ui.arena);
+ ui.enemyBar=ui.create.div('.skillbar.left.shadowed.playerbg',ui.arena);
+ // ui.friendBar.dataset.nature='metal';
+ // ui.enemyBar.dataset.nature='fire';
+ ui.create.div('.skillbarshadow',ui.friendBar);
+ ui.create.div('.skillbarshadow',ui.enemyBar);
+ ui.create.div('.skillbarfill',ui.friendBar);
+ ui.create.div('.skillbarfill',ui.enemyBar);
+ ui.friendBar.fillnode=ui.create.div(ui.friendBar.lastChild);
+ ui.enemyBar.fillnode=ui.create.div(ui.enemyBar.lastChild);
+ // ui.friendBar.popnode=ui.create.div('.skillbartext',ui.friendBar);
+ // ui.enemyBar.popnode=ui.create.div('.skillbartext',ui.enemyBar);
+ _status.friendRage=0;
+ _status.enemyRage=0;
+
+ if(lib.config.touchscreen){
+ lib.setLongPress(ui.friendBar,ui.click.intro);
+ lib.setLongPress(ui.enemyBar,ui.click.intro);
+ }
+ else{
+ if(lib.config.hover_all){
+ lib.setHover(ui.friendBar,ui.click.hoverplayer);
+ lib.setHover(ui.enemyBar,ui.click.hoverplayer);
+ }
+ if(lib.config.right_info){
+ ui.friendBar.oncontextmenu=ui.click.rightplayer;
+ ui.enemyBar.oncontextmenu=ui.click.rightplayer;
+ }
+ }
+ }
+ }
+ _status.friendCount=ui.create.system('',null,true);
+ _status.enemyCount=ui.create.system('',null,true);
+ game.updateStatusCount();
+ lib.setPopped(_status.friendCount,function(){
+ var uiintro=ui.create.dialog('hidden');
+
+ if(_status.deadfriend.length){
+ uiintro.add('已阵亡');
+ uiintro.add([_status.deadfriend,'player']);
+ }
+
+ uiintro.add('未上场');
+ if(_status.mylist.length){
+ uiintro.add([_status.mylist,'character']);
+ }
+ else{
+ uiintro.add('(无)')
+ }
+
+ return uiintro;
+ });
+ lib.setPopped(_status.enemyCount,function(){
+ if(_status.deadenemy.length){
+ var uiintro=ui.create.dialog('hidden');
+ uiintro.add('已阵亡');
+ uiintro.add([_status.deadenemy,'player']);
+ return uiintro;
+ }
+ });
+
+ game.me.side=Math.random()<0.5;
+ game.enemy.side=!game.me.side;
+
+ var players=get.players(lib.sort.position);
+ var info=[];
+ for(var i=0;i=100){
+ _status.friendRage=100;
+ ui.friendBar.fillnode.style.top='-50%';
+ ui.friendBar.classList.add('full');
+ }
+ else{
+ ui.friendBar.fillnode.style.top=(100-_status.friendRage)+'%';
+ ui.friendBar.classList.remove('full');
+ }
+ }
+ else{
+ if(_status.enemyRage<100){
+ popup=ui.enemyBar;
+ }
+ _status.enemyRage+=num;
+ if(_status.enemyRage<0){
+ _status.enemyRage=0;
+ }
+ if(_status.enemyRage>=100){
+ _status.enemyRage=100;
+ ui.enemyBar.fillnode.style.top='-50%';
+ ui.enemyBar.classList.add('full');
+ }
+ else{
+ ui.enemyBar.fillnode.style.top=(100-_status.enemyRage)+'%';
+ ui.enemyBar.classList.remove('full');
+ }
+ }
+ if(num>0&&popup){
+ var node=ui.create.div('.skillbartext',num.toString(),popup);
+ ui.refresh(node);
+ node.style.opacity=1;
+ setTimeout(function(){
+ node.delete();
+ },700);
+ }
+ },
+ drawDeck:function(num,log){
+ if(!num){
+ num=1;
+ }
+ var cards=this.getDeckCards(num);
+ if(log==false){
+ this.directgain(cards);
+ }
+ else if(log==true){
+ this.directgain(cards);
+ game.log(this,'从牌库中获得了'+get.cnNumber(num)+'张牌');
+ }
+ else{
+ this.gain(cards,'draw');
+ game.log(this,'从牌库中获得了'+get.cnNumber(num)+'张牌');
+ }
+ return cards;
+ },
+ updateActCount:function(used,countx,current){
+ if(_status.video){
+ this.actcount=countx||2;
+ }
+ else{
+ game.addVideo('updateActCount',this,[used,this.actcount,this.getActCount()]);
+ }
+ var maxcount,overflow2;
+ if(lib.config.layout=='default'||used=='outphase'||_status.currentPhase!=this){
+ maxcount=this.actcount;
+ }
+ else{
+ if(_status.video){
+ maxcount=this.actcount-(current||0);
+ }
+ else{
+ maxcount=this.actcount-this.getActCount();
+ }
+ if(this.actcount>maxcount){
+ maxcount=this.actcount;
+ }
+ if(maxcount>12){
+ maxcount=this.actcount+1;
+ this.node.actcount.classList.add('overflow2');
+ }
+ else{
+ this.node.actcount.classList.remove('overflow2');
+ }
+ }
+ for(var i=0;i<12;i++){
+ if(maxcount>this.node.actcount.childElementCount){
+ ui.create.div(this.node.actcount);
+ }
+ else if(maxcount=this.actcount){
+ this.node.actcount.childNodes[i].classList.add('overflow');
+ }
+ else{
+ this.node.actcount.childNodes[i].classList.remove('overflow');
+ }
+ }
+ else{
+ this.node.actcount.childNodes[i].classList.add('lost');
+ this.node.actcount.childNodes[i].classList.remove('overflow');
+ }
+ }
+ }
+ },
+ getAct:function(){
+ return this.actcount-this.getActCount();
+ },
+ hasFellowSkill:function(skill,exclude){
+ for(var i=0;i=0){
+ this.actcharacterlist[index]=null;
+ }
+ return this;
+ },
+ dieAfter:function(source){
+ var dead=this;
+ if(game.me.isDead()){
+ if(!_status.mylist.length){
+ _status.friendCount.innerHTML='友军: '+get.cnNumber(0);
+ game.over(false);
+ }
+ else{
+ game.pause();
+ _status.deadfriend.push(this);
+ game.additionaldead.push(this);
+ setTimeout(function(){
+ var player=ui.create.player();
+ player.getId();
+ player.classList.add('noidentity');
+ player.dataset.position=dead.dataset.position;
+ player.side=dead.side;
+ player.actcharacterlist=dead.actcharacterlist;
+ player.animate('replaceme');
+ player.actcount=game.enemy.actcount;
+ player.actcount=dead.actcount;
+ if(_status.double_character){
+ player.init(_status.mylist.shift(),_status.mylist.shift());
+ }
+ else{
+ player.init(_status.mylist.shift());
+ }
+ player.maxHp++;
+ player.hp++;
+ if(_status.mode=='deck'){
+ get.deck(player,_status.deck.shift());
+ }
+ game.players.push(player);
+ ui.arena.appendChild(player);
+
+ game.addVideo('stoneSwap',null,{
+ name:player.name,
+ name2:player.name2,
+ position:player.dataset.position,
+ actcount:player.actcount,
+ me:true
+ });
+ game.swapControl(player);
+ game.arrangePlayers();
+ if(_status.mode=='deck'){
+ var nd=game.enemy.countFellow();
+ if(nd){
+ player.draw(3+nd,{drawDeck:nd},false);
+ }
+ else{
+ player.draw(3,false);
+ }
+ }
+ else{
+ player.draw(3+game.enemy.countFellow(),false);
+ }
+ game.resume();
+ game.updateStatusCount();
+ },lib.config.duration);
+
+ }
+ }
+ else if(game.enemy.isDead()){
+ if(!_status.enemylist.length){
+ _status.enemyCount.innerHTML='敌军: '+get.cnNumber(0);
+ game.over(true);
+ }
+ else{
+ game.pause();
+ _status.deadenemy.push(this);
+ game.additionaldead.push(this);
+ setTimeout(function(){
+ var player=ui.create.player();
+ player.getId();
+ player.classList.add('noidentity');
+ player.dataset.position=dead.dataset.position;
+ player.side=dead.side;
+ player.actcharacterlist=dead.actcharacterlist;
+ player.animate('replaceenemy');
+ player.actcount=dead.actcount;
+ if(_status.double_character){
+ player.init(_status.enemylist.shift(),_status.enemylist.shift());
+ }
+ else{
+ player.init(_status.enemylist.shift());
+ }
+ player.maxHp++;
+ player.hp++;
+ if(_status.mode=='deck'){
+ get.deck(player,'random');
+ }
+ game.players.push(player);
+ game.enemy=player;
+ ui.arena.appendChild(player);
+
+ game.addVideo('stoneSwap',null,{
+ name:player.name,
+ name2:player.name2,
+ position:player.dataset.position,
+ actcount:player.actcount,
+ });
+ game.arrangePlayers();
+ if(_status.mode=='deck'){
+ var nd=game.me.countFellow();
+ if(nd){
+ player.draw(3+nd,{drawDeck:nd},false);
+ }
+ else{
+ player.draw(3,false);
+ }
+ }
+ else{
+ player.draw(3+game.me.countFellow(),false);
+ }
+ game.resume();
+ game.updateStatusCount();
+ },lib.config.duration);
+ }
+ }
+ if(source&&source.side!=this.side&&!source.isMin()){
+ if(_status.mode=='deck'){
+ source.drawDeck();
+ }
+ else{
+ source.draw();
+ }
+ source.actused--;
+ source.updateActCount();
+ }
+ game.dead.remove(this);
+ game.arrangePlayers();
+ this.getLeader().removeFellow(this);
+ setTimeout(function(){
+ dead.delete();
+ },500);
+ }
+ }
+ },
+ careerList:['mage','shaman','druid','paladin','rogue','priest','hunter','warrior','warlock'],
+ game:{
+ reserveDead:true,
+ getVideoName:function(){
+ var str=get.translation(game.me.name);
+ if(game.me.name2){
+ str+='/'+get.translation(game.me.name2);
+ }
+ var name=[
+ str,'炉石 - '+get.config('battle_number')+'人'
+ ];
+ return name;
+ },
+ updateStatusCount:function(){
+ _status.friendCount.innerHTML='友军: '+get.cnNumber(1+_status.mylist.length/(_status.double_character?2:1),true);
+ _status.enemyCount.innerHTML='敌军: '+get.cnNumber(1+_status.enemylist.length/(_status.double_character?2:1),true);
+ },
+ stoneLoop:function(player){
+ var next=game.createEvent('phaseLoop');
+ next.player=player;
+ next.setContent(function(){
+ "step 0"
+ player.phase();
+ event.num=0;
+ "step 1"
+ if(event.num'+i+'',buttons,clickButton);
+ ui.create.div('.menubutton.round',deckitem).dataset.career=lib.storage.deckList[i].career;
+ deckitem.name=i;
+ }
+ }
+ for(var i=0;i随机',buttons,clickButton);
+ ui.create.div('.menubutton.round',deckitem).dataset.career=lib.careerList[i];
+ deckitem.name='random:'+lib.careerList[i];
+ }
+ event.dialog.open();
+ }
+ else{
+ var bn=parseInt(get.config('battle_number'));
+ for(var i=0;ib) return 1;
+ if(a==b) return 0;
+ return -1;
+ });
+ player.deck=name;
+ player.career=career;
+ if(!player.node.career){
+ player.node.career=ui.create.div('.menubutton.round.identity',player);
+ player.node.career.dataset.career=career;
+ if(lib.config.touchscreen){
+ lib.setLongPress(player.node.career,ui.click.intro);
+ }
+ else{
+ if(lib.config.hover_all){
+ lib.setHover(player.node.career,ui.click.hoverplayer);
+ }
+ if(lib.config.right_info){
+ player.node.career.oncontextmenu=ui.click.rightplayer;
+ }
+ }
+ }
+ if(!player.deckCards) player.deckCards=[];
+ for(var i=0;i