This commit is contained in:
libccy 2016-03-28 11:15:47 +08:00
parent 6a4448074a
commit 8bdda26b39
6 changed files with 87 additions and 41 deletions

View File

@ -568,6 +568,7 @@ character.hearth={
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filter:function(event,player){ filter:function(event,player){
if(!lib.card.chiyuxi||!lib.card.jingleishan) return false;
return player.num('he')>0; return player.num('he')>0;
}, },
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){

View File

@ -2175,6 +2175,7 @@ character.swd={
huangyu:{ huangyu:{
enable:'phaseUse', enable:'phaseUse',
filter:function(event,player){ filter:function(event,player){
if(!lib.card.chiyuxi) return false;
return !player.getStat('skill').huangyu&&player.num('he',{color:'red'})>1; return !player.getStat('skill').huangyu&&player.num('he',{color:'red'})>1;
}, },
filterCard:{color:'red'}, filterCard:{color:'red'},

View File

@ -9,9 +9,12 @@
} }
} }
else{ else{
alert(document.head.outerHTML)
if(confirm('游戏似乎未正常载入,是否重置游戏?')){ if(confirm('游戏似乎未正常载入,是否重置游戏?')){
var noname_inited=localStorage.getItem('noname_inited');
localStorage.clear(); localStorage.clear();
if(noname_inited){
localStorage.setItem(noname_inited);
}
if(indexedDB) indexedDB.deleteDatabase('noname_0.9_data'); if(indexedDB) indexedDB.deleteDatabase('noname_0.9_data');
window.location.reload(); window.location.reload();
} }
@ -36,18 +39,10 @@
dieClose:[] dieClose:[]
}; };
var lib={ var lib={
version:'1.8.1',
changeLog:[
'AI问题修复',
'检查更新功能',
'游戏内下载/更新素材',
'iOS/Mac/Windows版优化',
'iOS版支持录像、扩展等'
],
configprefix:'noname_0.9_', configprefix:'noname_0.9_',
updateURL:'http://isha.applinzi.com/', updateURL:'http://isha.applinzi.com/',
onlineURL:'http',
assetURL:'', assetURL:'',
changeLog:[],
updates:[], updates:[],
canvasUpdates:[], canvasUpdates:[],
video:[], video:[],
@ -1487,7 +1482,11 @@
onclick:function(){ onclick:function(){
var node=this; var node=this;
if(node._clearing){ if(node._clearing){
var noname_inited=localStorage.getItem('noname_inited');
localStorage.clear(); localStorage.clear();
if(noname_inited){
localStorage.setItem(noname_inited);
}
game.reload(); game.reload();
return; return;
} }
@ -2542,6 +2541,7 @@
init:'3', init:'3',
frequent:true, frequent:true,
item:{ item:{
'1':'一人',
'2':'两人', '2':'两人',
'3':'三人', '3':'三人',
'4':'四人', '4':'四人',
@ -2557,6 +2557,15 @@
} }
}, },
}, },
mana_mode:{
name:'行动值变化',
init:'inc',
item:{
inf:'涨落',
inc:'递增'
},
frequent:true
},
skill_bar:{ skill_bar:{
name:'怒气值', name:'怒气值',
init:true, init:true,
@ -2786,6 +2795,12 @@
}, },
init:{ init:{
init:function(){ init:function(){
if(window.noname_update){
lib.version=window.noname_update.version;
lib.changeLog=window.noname_update.changeLog;
delete window.noname_update;
}
var scripts=document.head.querySelectorAll('script'); var scripts=document.head.querySelectorAll('script');
for(var i=0;i<scripts.length;i++){ for(var i=0;i<scripts.length;i++){
if(scripts[i].src&&scripts[i].src.indexOf('game/game.js')!=-1){ if(scripts[i].src&&scripts[i].src.indexOf('game/game.js')!=-1){
@ -2979,18 +2994,10 @@
delete game.importedPack; delete game.importedPack;
} }
} }
var toLoad=lib.config.all.cards.length+lib.config.all.characters.length+lib.config.plays.length+1;
if(localStorage.getItem(lib.configprefix+'playback')){ var packLoaded=function(){
lib.init.js(lib.assetURL+'mode',lib.config.mode); toLoad--;
} if(toLoad==0){
else if((localStorage.getItem(lib.configprefix+'directstart')||!lib.config.show_splash)&&
lib.config.all.mode.indexOf(lib.config.mode)!=-1){
lib.init.js(lib.assetURL+'mode',lib.config.mode);
}
lib.init.js(lib.assetURL+'card',lib.config.all.cards);
lib.init.js(lib.assetURL+'character',lib.config.all.characters);
lib.init.js(lib.assetURL+'play',lib.config.plays);
lib.init.js(lib.assetURL+'character','rank',function(){
if(_status.windowLoaded){ if(_status.windowLoaded){
delete _status.windowLoaded; delete _status.windowLoaded;
lib.init.onload(); lib.init.onload();
@ -2998,7 +3005,21 @@
else{ else{
_status.packLoaded=true; _status.packLoaded=true;
} }
}); }
};
if(localStorage.getItem(lib.configprefix+'playback')){
toLoad++;
lib.init.js(lib.assetURL+'mode',lib.config.mode,packLoaded,packLoaded);
}
else if((localStorage.getItem(lib.configprefix+'directstart')||!lib.config.show_splash)&&
lib.config.all.mode.indexOf(lib.config.mode)!=-1){
toLoad++;
lib.init.js(lib.assetURL+'mode',lib.config.mode,packLoaded,packLoaded);
}
lib.init.js(lib.assetURL+'card',lib.config.all.cards,packLoaded,packLoaded);
lib.init.js(lib.assetURL+'character',lib.config.all.characters,packLoaded,packLoaded);
lib.init.js(lib.assetURL+'play',lib.config.plays,packLoaded,packLoaded);
lib.init.js(lib.assetURL+'character','rank',packLoaded,packLoaded);
ui.css={}; ui.css={};
lib.init.css(lib.assetURL+'layout/default','menu'); lib.init.css(lib.assetURL+'layout/default','menu');
var layout=lib.config.layout; var layout=lib.config.layout;
@ -3670,7 +3691,7 @@
} }
return style; return style;
}, },
js:function(path,file,onload){ js:function(path,file,onload,onerror){
if(path[path.length-1]=='/'){ if(path[path.length-1]=='/'){
path=path.slice(0,path.length-1); path=path.slice(0,path.length-1);
} }
@ -3678,9 +3699,9 @@
lib.init['setMode_'+file](); lib.init['setMode_'+file]();
return; return;
} }
if(typeof file=='object'){ if(Array.isArray(file)){
for(var i=0;i<file.length;i++){ for(var i=0;i<file.length;i++){
lib.init.js(path,file[i]); lib.init.js(path,file[i],onload,onerror);
} }
} }
else{ else{
@ -3689,6 +3710,7 @@
document.head.appendChild(script); document.head.appendChild(script);
if(typeof onload=='function'){ if(typeof onload=='function'){
script.addEventListener('load',onload); script.addEventListener('load',onload);
script.addEventListener('error',onerror);
} }
return script; return script;
} }
@ -15875,7 +15897,11 @@
if(!data) return; if(!data) return;
try{ try{
data=JSON.parse(lib.init.decode(data)); data=JSON.parse(lib.init.decode(data));
var noname_inited=localStorage.getItem('noname_inited');
localStorage.clear(); localStorage.clear();
if(noname_inited){
localStorage.setItem(noname_inited);
}
for(var i in data){ for(var i in data){
localStorage.setItem(i,data[i]); localStorage.setItem(i,data[i]);
} }
@ -17823,8 +17849,12 @@
if(update.version!=lib.version){ if(update.version!=lib.version){
var str='有新版本'+update.version+'可用,是否下载?'; var str='有新版本'+update.version+'可用,是否下载?';
if(navigator.notification&&navigator.notification.confirm){ if(navigator.notification&&navigator.notification.confirm){
var str2=update.changeLog[0];
for(var i=1;i<update.changeLog.length;i++){
str2+=''+update.changeLog[i];
}
navigator.notification.confirm( navigator.notification.confirm(
update.content, str2,
function(index){ function(index){
if(index==1){ if(index==1){
goupdate(); goupdate();
@ -23387,7 +23417,11 @@
else if(e.keyCode==116||((e.ctrlKey||e.metaKey)&&e.keyCode==82)){ else if(e.keyCode==116||((e.ctrlKey||e.metaKey)&&e.keyCode==82)){
if(e.shiftKey){ if(e.shiftKey){
if(confirm('是否重置游戏?')){ if(confirm('是否重置游戏?')){
var noname_inited=localStorage.getItem('noname_inited');
localStorage.clear(); localStorage.clear();
if(noname_inited){
localStorage.setItem(noname_inited);
}
if(indexedDB) indexedDB.deleteDatabase(lib.configprefix+'data'); if(indexedDB) indexedDB.deleteDatabase(lib.configprefix+'data');
game.reload(); game.reload();
return; return;

View File

@ -1,8 +1,8 @@
window.noname_update={ window.noname_update={
version:'1.8.1', version:'1.8.1',
content:[ changeLog:[
'检查更新功能', '游戏内安装新版本和素材',
'游戏内下载素材', '可选择更新稳定版或测试版',
'bug修复', 'bug修复',
'Mac/iOS优化' 'Mac/iOS优化'
] ]

View File

@ -4,6 +4,7 @@
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="user-scalable=no"> <meta name="viewport" content="user-scalable=no">
<title>无名杀</title> <title>无名杀</title>
<script src="game/update.js"></script>
<script src="game/config.js"></script> <script src="game/config.js"></script>
<script src="game/package.js"></script> <script src="game/package.js"></script>
<script src="game/game.js"></script> <script src="game/game.js"></script>

View File

@ -598,7 +598,7 @@ mode.stone={
player.node.actcount=ui.create.div('.actcount.hp',player); player.node.actcount=ui.create.div('.actcount.hp',player);
} }
if(typeof player.actcount!=='number'){ if(typeof player.actcount!=='number'){
player.actcount=2; player.actcount=0;
} }
player.actused=0; player.actused=0;
if(!player.actcharacterlist){ if(!player.actcharacterlist){
@ -9011,14 +9011,23 @@ mode.stone={
content:function(){ content:function(){
player.actused=0; player.actused=0;
if(player.side){ if(player.side){
player.actcount=player.getEnemy().actcount;
}
else{
player.actcount=player.getEnemy().actcount+1; player.actcount=player.getEnemy().actcount+1;
} }
else{
player.actcount=player.getEnemy().actcount;
if(!_status.actcoin){
_status.actcoin=true;
player.actused--;
}
}
if(player.actcount>6){ if(player.actcount>6){
if(get.config('mana_mode')=='inc'){
player.actcount=6;
}
else{
player.actcount-=4; player.actcount-=4;
} }
}
player.updateActCount(); player.updateActCount();
player.getEnemy().updateActCount('outphase'); player.getEnemy().updateActCount('outphase');
} }
@ -10149,7 +10158,7 @@ mode.stone={
'<li>怒气值达到100时不再增加。回合开始阶段若怒气值己满可消耗全部怒气值并召唤一名传说随从</ul>'+ '<li>怒气值达到100时不再增加。回合开始阶段若怒气值己满可消耗全部怒气值并召唤一名传说随从</ul>'+
'<div style="margin:10px">战斗</div><ul style="margin-top:0"><li>游戏流程类似1v1场上有两名主将进行对抗主将的体力上限+1'+ '<div style="margin:10px">战斗</div><ul style="margin-top:0"><li>游戏流程类似1v1场上有两名主将进行对抗主将的体力上限+1'+
'<li>游戏牌堆移除了乐不思蜀等跳过出牌阶段的卡牌'+ '<li>游戏牌堆移除了乐不思蜀等跳过出牌阶段的卡牌'+
'<li>主将出牌阶段的出牌数量(行动值)有上限,先手为2后手为3,装备牌不计入出牌上限<li>游戏每进行一轮,主将的出牌上限+1超过6时减至3并重新累加'+ '<li>主将出牌阶段的出牌数量(行动值)有上限,从1开始递增后手的首个回合有一点额外行动值,装备牌不计入出牌上限<li>游戏每进行一轮,主将的出牌上限+1超过6时减至3并重新累加'+
'<li>使用随从牌可召唤一个随从随从出场时背面朝上。每一方在场的随从数不能超过4<li>随从于摸牌阶段摸牌基数为1随从的随从牌均视为闪装备牌均视为杀<li>'+ '<li>使用随从牌可召唤一个随从随从出场时背面朝上。每一方在场的随从数不能超过4<li>随从于摸牌阶段摸牌基数为1随从的随从牌均视为闪装备牌均视为杀<li>'+
'随从与其他所有角色相互距离基数为1<li>'+ '随从与其他所有角色相互距离基数为1<li>'+
'主将杀死对方随从后获得一个额外的行动值并摸两张牌,杀死己方随从无惩罚,随从杀死随从无效果'+ '主将杀死对方随从后获得一个额外的行动值并摸两张牌,杀死己方随从无惩罚,随从杀死随从无效果'+