This commit is contained in:
libccy 2015-12-15 16:20:57 +08:00
parent 75b98028fb
commit 38f93922e1
10 changed files with 170 additions and 12 deletions

View File

@ -198,6 +198,7 @@ window.config={
glow_phase:'yellow',
skin:{},
gameRecord:{},
hiddenModePack:[],
hiddenCharacterPack:[],
hiddenCardPack:[],

View File

@ -22,6 +22,7 @@
'双指拖动对话框',
'对决模式调整',
'炉石构筑模式',
'战绩',
'金币系统(在选项-玩法中开启,暂无实际用途)',
],
configprefix:'noname_0.9_',
@ -1221,6 +1222,18 @@
game.saveConfig('plays',lib.config.plays);
}
},
coin_display_playpackconfig:{
name:'金币显示',
init:'text',
item:{
symbol:'符号',
text:'文字'
},
onclick:function(item){
game.saveConfig('coin_display_playpackconfig',item);
if(game.changeCoin) game.changeCoin(0);
}
},
update:function(config,map){
for(var i in map){
if(i.indexOf('_playpackconfig')!=-1){
@ -2335,11 +2348,11 @@
'<li>法师:对一名随从造成一点火焰伤害'+
'<li>医生:回复一点体力'+
'<li>战士:获得一点护甲,摸一张牌'+
'<li>术士:弃置一张牌并从牌库中摸两张牌'+
'<li>游侠:装备一把武器和一匹-1马'+
'<li>术士:牌库中摸两张牌'+
'<li>装备一把武器和一个随机非武器装备'+
'<li>谋士:召唤一名士兵'+
'<li>猎人:弃置一张牌并对敌方主将造成一点伤害'+
'<li>蛮人:视为使用一张杀,此杀无视距离和防具且不计入出杀限制</ul>'+
'<li>猎人:对敌方主将造成一点伤害'+
'<li>蛮人:视为使用一张不计入出杀次数的杀</ul>'+
'<div style="margin:10px">战斗</div><ul style="margin-top:0"><li>游戏流程类似1v1场上有两名主将进行对抗'+
'<li>主将出牌阶段的出牌数量行动值有上限先手为2后手为3装备牌不计入出牌上限<li>游戏每进行一轮,主将的出牌上限+1超过6时减至2并重新累加'+
'<li>使用随从牌可召唤一个随从随从出场时背面朝上。每一方在场的随从数不能超过4<li>随从于摸牌阶段摸牌基数为1随从的随从牌均视为闪装备牌均视为杀<li>'+
@ -2547,10 +2560,17 @@
lib.config.all.plays.push(i);
lib.translate[i+'_play_config']=play.pack[i];
}
if(!lib.config.gameRecord){
lib.config.gameRecord={};
}
for(i in mode.pack){
if(lib.config.hiddenModePack.indexOf(i)==-1){
lib.config.all.mode.push(i);
lib.translate[i]=mode.pack[i];
if(!lib.config.gameRecord[i]){
lib.config.gameRecord[i]={data:{}};
}
}
}
if(background&&background.pack){
@ -11055,6 +11075,17 @@
delete ui.swap;
}
if(game.onOver) game.onOver(result);
if(game.addRecord){
if(result=='战斗胜利'){
game.addRecord(true);
}
else if(result=='战斗失败'){
game.addRecord(false);
}
else{
game.addRecord();
}
}
},
loop:function(){
var event=_status.event;
@ -15194,6 +15225,37 @@
// }
});
}());
(function(){
var page=ui.create.div('');
var node=ui.create.div('.menubutton.large','战绩',start.firstChild,clickMode);
node.type='rec';
node.link=page;
page.style.paddingBottom='10px';
var reset=function(){
if(this.innerHTML=='重置'){
this.innerHTML='确定';
var that=this;
setTimeout(function(){
that.innerHTML='重置';
},1000);
}
else{
this.parentNode.previousSibling.remove();
this.parentNode.remove();
delete lib.config.gameRecord[this.parentNode.link];
game.saveConfig('gameRecord',lib.config.gameRecord);
}
}
for(var i=0;i<lib.config.all.mode.length;i++){
if(lib.config.gameRecord[lib.config.all.mode[i]].str){
ui.create.div('.config.indent',lib.translate[lib.config.all.mode[i]],page).style.marginBottom='-5px';
var item=ui.create.div('.config.indent',lib.config.gameRecord[lib.config.all.mode[i]].str+'<span>重置</span>',page);
item.style.height='auto';
item.lastChild.addEventListener('click',reset);
item.link=lib.config.all.mode[i];
}
}
}());
(function(){
if(!window.indexedDB) return;
var page=ui.create.div('');

View File

@ -231,9 +231,9 @@
.player.linked{
transform:rotate(-90deg);
}
.player.linked.target{
transform:rotate(-93deg);
}
#arena:not(.no_target_shake) .linked.target{transform: rotate(-93deg);}
#arena:not(.no_target_shake) .linked.target2{transform: rotate(-87deg);}
.player.acted.linked .identity{
transform:rotate(270deg);
}

View File

@ -1,6 +1,6 @@
{
"name": "noname",
"xwalk_version": "1.7.0",
"xwalk_version": "1.7.2",
"start_url": "index.html",
"icons": [
{

View File

@ -1,6 +1,30 @@
'use strict';
mode.guozhan={
game:{
addRecord:function(bool){
if(typeof bool=='boolean'){
var data=lib.config.gameRecord.guozhan.data;
var identity=game.me.identity;
if(!data[identity]){
data[identity]=[0,0];
}
if(bool){
data[identity][0]++;
}
else{
data[identity][1]++;
}
var list=['wei','shu','wu','qun','ye'];
var str='';
for(var i=0;i<list.length;i++){
if(data[list[i]]){
str+=lib.translate[list[i]+'2']+''+data[list[i]][0]+'胜'+' '+data[list[i]][1]+'负<br>';
}
}
lib.config.gameRecord.guozhan.str=str;
game.saveConfig('gameRecord',lib.config.gameRecord);
}
},
getIdentityList:function(player){
if(!player.isUnseen()) return;
if(player==game.me) return;
@ -431,6 +455,11 @@ mode.guozhan={
translate:{
change_identity_config:'自由选择座位',
ye:'野',
ye2:'野心家',
wei2:'魏国',
shu2:'蜀国',
wu2:'吴国',
qun2:'群雄',
unknown:'无名氏',
unknown0:'一号位',
unknown1:'二号位',

View File

@ -44,6 +44,33 @@ mode.identity={
];
return name;
},
addRecord:function(bool){
if(typeof bool=='boolean'){
var data=lib.config.gameRecord.identity.data;
var identity=game.me.identity;
if(identity=='mingzhong'){
identity='zhong';
}
if(!data[identity]){
data[identity]=[0,0];
}
if(bool){
data[identity][0]++;
}
else{
data[identity][1]++;
}
var list=['zhu','zhong','nei','fan'];
var str='';
for(var i=0;i<list.length;i++){
if(data[list[i]]){
str+=lib.translate[list[i]+'2']+''+data[list[i]][0]+'胜'+' '+data[list[i]][1]+'负<br>';
}
}
lib.config.gameRecord.identity.str=str;
game.saveConfig('gameRecord',lib.config.gameRecord);
}
},
start:function(){
var next=game.createEvent('game',false);
next.content=function(){

View File

@ -1335,7 +1335,7 @@ mode.stone={
fullskin:true,
type:'stonecard',
enable:true,
stoneact:3,
stoneact:2,
filterTarget:function(card,player,target){
return target.isMin();
},

View File

@ -11,6 +11,30 @@ mode.versus={
];
return name;
},
addRecord:function(bool){
if(typeof bool=='boolean'){
var data=lib.config.gameRecord.versus.data;
var identity=get.cnNumber(lib.storage.number)+'人';
if(!data[identity]){
data[identity]=[0,0];
}
if(bool){
data[identity][0]++;
}
else{
data[identity][1]++;
}
var list=['一人','两人','三人'];
var str='';
for(var i=0;i<list.length;i++){
if(data[list[i]]){
str+=list[i]+''+data[list[i]][0]+'胜'+' '+data[list[i]][1]+'负<br>';
}
}
lib.config.gameRecord.versus.str=str;
game.saveConfig('gameRecord',lib.config.gameRecord);
}
},
start:function(){
var next=game.createEvent('game',false);
next.content=function(){

View File

@ -1,5 +1,5 @@
{
"name" : "无名杀",
"version" : "1.7.0",
"version" : "1.7.2",
"main" : "main.js"
}

View File

@ -1,3 +1,4 @@
'use strict';
play.coin={
init:function(){
if(lib.config.mode!='chess'||get.config('chess_mode')!='leader'){
@ -7,14 +8,28 @@ play.coin={
arenaReady:function(){
if(_status.video) return;
if(lib.config.mode!='chess'||get.config('chess_mode')!='leader'){
ui.coin=ui.create.system('<span style="position:absolute">㉤</span><span style="margin-left:18px;font-family:xinwei;line-height:10px">'+lib.config.coin+'</span>',null,true);
var str;
if(lib.config.coin_display_playpackconfig=='text'){
str='<span>'+lib.config.coin+'</span><span>金</span>'
}
else{
str='<span style="position:absolute">㉤</span><span style="margin-left:18px;font-family:xinwei;line-height:10px">'+lib.config.coin+'</span>';
}
ui.coin=ui.create.system(str,null,true);
}
},
game:{
changeCoin:function(num){
if(typeof num=='number'&&ui.coin){
game.saveConfig('coin',lib.config.coin+num);
ui.coin.lastChild.innerHTML=lib.config.coin;
var str;
if(lib.config.coin_display_playpackconfig=='text'){
str='<span>'+lib.config.coin+'</span><span>金</span>'
}
else{
str='<span style="position:absolute">㉤</span><span style="margin-left:18px;font-family:xinwei;line-height:10px">'+lib.config.coin+'</span>';
}
ui.coin.innerHTML=str;
}
},
},