This commit is contained in:
libccy 2015-12-10 23:57:45 +08:00
parent fa5ef6a258
commit 9fdcfa7aa0
8 changed files with 161 additions and 50 deletions

View File

@ -1029,9 +1029,18 @@ card.standard={
else{ else{
if(!card.expired){ if(!card.expired){
var target=player.next; var target=player.next;
if(target.num('j','shandian')&&!target.next.num('j','shandian')){ for(var iwhile=0;iwhile<10;iwhile++){
if(target.num('j','shandian')){
target=target.next; target=target.next;
} }
else{
break;
}
}
if(target.num('j','shandian')||target==player){
ui.discardPile.appendChild(card);
}
else{
if(card.name!='shandian'){ if(card.name!='shandian'){
target.addJudge('shandian',card); target.addJudge('shandian',card);
} }
@ -1039,6 +1048,7 @@ card.standard={
target.addJudge(card); target.addJudge(card);
} }
} }
}
else{ else{
card.expired=false; card.expired=false;
} }
@ -1047,9 +1057,18 @@ card.standard={
cancel:function(){ cancel:function(){
if(!card.expired){ if(!card.expired){
var target=player.next; var target=player.next;
if(target.num('j','shandian')&&!target.next.num('j','shandian')){ for(var iwhile=0;iwhile<10;iwhile++){
if(target.num('j','shandian')){
target=target.next; target=target.next;
} }
else{
break;
}
}
if(target.num('j','shandian')||target==player){
ui.discardPile.appendChild(card);
}
else{
if(card.name!='shandian'){ if(card.name!='shandian'){
target.addJudge('shandian',card); target.addJudge('shandian',card);
} }
@ -1057,6 +1076,7 @@ card.standard={
target.addJudge(card); target.addJudge(card);
} }
} }
}
else{ else{
card.expired=false; card.expired=false;
} }

View File

@ -35,14 +35,24 @@ card.yibao={
else{ else{
if(!card.expired){ if(!card.expired){
var target=player.next; var target=player.next;
if(target.num('j','huoshan')&&!target.next.num('j','huoshan')){ for(var iwhile=0;iwhile<10;iwhile++){
if(target.num('j','huoshan')){
target=target.next; target=target.next;
} }
if(card.name!='huoshan'){ else{
player.next.addJudge('huoshan',card); break;
}
}
if(target.num('j','huoshan')||target==player){
ui.discardPile.appendChild(card);
} }
else{ else{
player.next.addJudge(card); if(card.name!='huoshan'){
target.addJudge('huoshan',card);
}
else{
target.addJudge(card);
}
} }
} }
else{ else{
@ -53,14 +63,24 @@ card.yibao={
cancel:function(){ cancel:function(){
if(!card.expired){ if(!card.expired){
var target=player.next; var target=player.next;
if(target.num('j','huoshan')&&!target.next.num('j','huoshan')){ for(var iwhile=0;iwhile<10;iwhile++){
if(target.num('j','huoshan')){
target=target.next; target=target.next;
} }
if(card.name!='huoshan'){ else{
player.next.addJudge('huoshan',card); break;
}
}
if(target.num('j','huoshan')||target==player){
ui.discardPile.appendChild(card);
} }
else{ else{
player.next.addJudge(card); if(card.name!='huoshan'){
target.addJudge('huoshan',card);
}
else{
target.addJudge(card);
}
} }
} }
else{ else{
@ -155,9 +175,18 @@ card.yibao={
else{ else{
if(!card.expired){ if(!card.expired){
var target=player.next; var target=player.next;
if(target.num('j','hongshui')&&!target.next.num('j','hongshui')){ for(var iwhile=0;iwhile<10;iwhile++){
if(target.num('j','hongshui')){
target=target.next; target=target.next;
} }
else{
break;
}
}
if(target.num('j','hongshui')||target==player){
ui.discardPile.appendChild(card);
}
else{
if(card.name!='hongshui'){ if(card.name!='hongshui'){
target.addJudge('hongshui',card); target.addJudge('hongshui',card);
} }
@ -165,6 +194,7 @@ card.yibao={
target.addJudge(card); target.addJudge(card);
} }
} }
}
else{ else{
card.expired=false; card.expired=false;
} }
@ -173,9 +203,18 @@ card.yibao={
cancel:function(){ cancel:function(){
if(!card.expired){ if(!card.expired){
var target=player.next; var target=player.next;
if(target.num('j','hongshui')&&!target.next.num('j','hongshui')){ for(var iwhile=0;iwhile<10;iwhile++){
if(target.num('j','hongshui')){
target=target.next; target=target.next;
} }
else{
break;
}
}
if(target.num('j','hongshui')||target==player){
ui.discardPile.appendChild(card);
}
else{
if(card.name!='hongshui'){ if(card.name!='hongshui'){
target.addJudge('hongshui',card); target.addJudge('hongshui',card);
} }
@ -183,6 +222,7 @@ card.yibao={
target.addJudge(card); target.addJudge(card);
} }
} }
}
else{ else{
card.expired=false; card.expired=false;
} }

View File

@ -1511,7 +1511,7 @@ character.standard={
jianxiong_info:'你可以立即获得对你造成伤害的牌', jianxiong_info:'你可以立即获得对你造成伤害的牌',
fankui_info:'当你受到伤害时,可以获得伤害来源的一张牌', fankui_info:'当你受到伤害时,可以获得伤害来源的一张牌',
guicai_info:'在任意角色的判定牌生效前,你可以打出一张手牌代替之', guicai_info:'在任意角色的判定牌生效前,你可以打出一张手牌代替之',
ganglie_info:'每当你受到一次伤害,可进行一次判定,若结果不为红桃,则伤害来源须弃置两张手牌受到来自你的一点伤害', ganglie_info:'每当你受到一次伤害,可进行一次判定,若结果不为红桃,则伤害来源须弃置两张手牌受到来自你的一点伤害',
tuxi_info:'摸牌阶段你可以放弃摸牌并从1~2名其他角色各抽取一张手牌', tuxi_info:'摸牌阶段你可以放弃摸牌并从1~2名其他角色各抽取一张手牌',
luoyi_info:'摸牌阶段,你可以少摸一张牌,若如此做,你本回合内[杀]或[决斗]造成的伤害+1', luoyi_info:'摸牌阶段,你可以少摸一张牌,若如此做,你本回合内[杀]或[决斗]造成的伤害+1',
tiandu_info:'你可以立即获得你的判定牌', tiandu_info:'你可以立即获得你的判定牌',

View File

@ -9,7 +9,7 @@ window.config={
forbidchess:['hetaihou','swd_kangnalishi'], forbidchess:['hetaihou','swd_kangnalishi'],
forbidboss:['caiwenji','gjqt_aruan','pal_xuanxiao','swd_hupo'], forbidboss:['caiwenji','gjqt_aruan','pal_xuanxiao','swd_hupo'],
forbiddouble:['zhugedan','swd_kangnalishi','swd_nicole','dongzhuo','wutugu','jg_simayi'], forbiddouble:['zhugedan','swd_kangnalishi','swd_nicole','dongzhuo','wutugu','jg_simayi'],
layoutfixed:['chess','boss'], layoutfixed:['chess'],
all:{ all:{
mode:['identity','guozhan','versus','boss','chess','stone'], mode:['identity','guozhan','versus','boss','chess','stone'],
layout:['default','newlayout'], layout:['default','newlayout'],

View File

@ -2300,6 +2300,9 @@
if(game.singleHandcard||lib.config.layout=='mobile'||lib.config.layout=='phone'){ if(game.singleHandcard||lib.config.layout=='mobile'||lib.config.layout=='phone'){
return true; return true;
} }
if(lib.config.layout=='default'&&lib.config.layoutfixed.contains(lib.config.mode)){
return true;
}
return false; return false;
}, },
setHover:function(node,func,hoveration,width){ setHover:function(node,func,hoveration,width){
@ -2499,7 +2502,7 @@
var layout=lib.config.layout; var layout=lib.config.layout;
if(lib.config.layoutfixed.indexOf(lib.config.mode)!==-1){ if(lib.config.layoutfixed.indexOf(lib.config.mode)!==-1){
if(layout=='default'){ if(layout=='default'){
layout='newlayout'; layout='mobile';
} }
} }
ui.css.layout=lib.init.css('layout/'+layout,'layout'); ui.css.layout=lib.init.css('layout/'+layout,'layout');
@ -2635,10 +2638,12 @@
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){
if(scripts[i].src.indexOf('ipad')!=-1){ if(scripts[i].src.indexOf('ios')!=-1){
var ua=navigator.userAgent.toLowerCase();
if(ua.indexOf('ipad')!=-1){
window.isIpad=true; window.isIpad=true;
} }
else if(scripts[i].src.indexOf('iphone')!=-1){ else{
var metas=document.head.querySelectorAll('meta'); var metas=document.head.querySelectorAll('meta');
for(var i=0;i<metas.length;i++){ for(var i=0;i<metas.length;i++){
if(metas[i].name=='viewport'){ if(metas[i].name=='viewport'){
@ -2648,6 +2653,7 @@
} }
} }
} }
}
}, },
css:function(path,file,before){ css:function(path,file,before){
var style = document.createElement("link"); var style = document.createElement("link");
@ -13831,13 +13837,15 @@
toggle.innerHTML='编辑武将 <div>&gt;</div>'; toggle.innerHTML='编辑武将 <div>&gt;</div>';
var confirm=newCharacter.querySelector('.menubutton.large'); var confirm=newCharacter.querySelector('.menubutton.large');
confirm.innerHTML='编辑武将'; confirm.innerHTML='编辑武将';
confirm._origin=this;
var button=this; var button=this;
var delnode=ui.create.div('.menubutton.large','删除',confirm.parentNode,function(){ var delnodefunc=function(){
button.remove(); button.remove();
lib.customCharacters.remove(button.link); lib.customCharacters.remove(button.link);
game.deleteDB('character',button.link); game.deleteDB('character',button.link);
game.deleteDB('image','character:'+button.link); game.deleteDB('image','character:'+button.link);
var skills=lib.character[button.link][3]; var skills=lib.character[button.link][3];
delete lib.character[button.link];
for(var i=0;i<skills.length;i++){ for(var i=0;i<skills.length;i++){
if(!lib.checkSkillName(skills[i])){ if(!lib.checkSkillName(skills[i])){
var keep=false; var keep=false;
@ -13853,7 +13861,8 @@
} }
} }
resetEditor(); resetEditor();
}); };
var delnode=ui.create.div('.menubutton.large','删除',confirm.parentNode,delnodefunc);
delnode.style.marginLeft='25px'; delnode.style.marginLeft='25px';
} }
@ -14094,6 +14103,7 @@
toggle.innerHTML='创建武将 <div>&gt;</div>'; toggle.innerHTML='创建武将 <div>&gt;</div>';
var node=newCharacter.querySelector('.menubutton.large'); var node=newCharacter.querySelector('.menubutton.large');
node.innerHTML='创建武将'; node.innerHTML='创建武将';
delete node._origin;
if(node.nextSibling){ if(node.nextSibling){
node.nextSibling.remove(); node.nextSibling.remove();
} }
@ -14285,9 +14295,45 @@
hp=parseInt(hp); hp=parseInt(hp);
if(!hp) hp=1; if(!hp) hp=1;
var skills=[]; var skills=[];
var dontcreate=false;
if(this.innerHTML=='编辑武将'&&this._origin&&this._origin.link!=name){
dontcreate=true;
var origin=this._origin;
game.getDB('image','character:'+this._origin.link,function(data){
if(data){
game.putDB('image','character:'+name,data);
origin.remove();
lib.customCharacters.remove(origin.link);
game.deleteDB('character',origin.link);
game.deleteDB('image','character:'+origin.link);
if(lib.character[origin.link]){
var skills=lib.character[origin.link][3];
delete lib.character[origin.link];
for(var i=0;i<skills.length;i++){
if(!lib.checkSkillName(skills[i])){
var keep=false;
for(var j=0;j<lib.customCharacters.length;j++){
if(lib.customCharacters[j]==origin.link) continue;
if(lib.character[lib.customCharacters[j]][3].contains(skills[i])){
keep=true;break;
}
}
if(!keep){
game.deleteDB('skill',skills[i]);
}
}
}
}
}
createButton(name);
});
}
else{
if(image){ if(image){
game.putDB('image','character:'+name,image); game.putDB('image','character:'+name,image);
} }
}
for(var i=0;i<skillList.firstChild.childNodes.length;i++){ for(var i=0;i<skillList.firstChild.childNodes.length;i++){
if(skillList.firstChild.childNodes[i].createInfo&& if(skillList.firstChild.childNodes[i].createInfo&&
lib.checkSkillName(skillList.firstChild.childNodes[i].skill)) continue; lib.checkSkillName(skillList.firstChild.childNodes[i].skill)) continue;
@ -14330,9 +14376,10 @@
} }
} }
} }
createButton(name); if(!dontcreate) createButton(name);
resetEditor(); resetEditor();
currentEditing=null; currentEditing=null;
delete this._origin;
}); });
}); });

View File

@ -847,8 +847,8 @@ margin-bottom: 5px;
-webkit-animation: card_start 0.5s; -webkit-animation: card_start 0.5s;
} }
.dialog{ .dialog{
animation: dialog_start 0.5s; animation: dialog_start2 0.5s;
-webkit-animation: dialog_start 0.5s; -webkit-animation: dialog_start2 0.5s;
} }
.dialog.noslide{ .dialog.noslide{
animation: dialog_start2 0.5s; animation: dialog_start2 0.5s;

View File

@ -151,7 +151,11 @@ mode.boss={
ui.create.cards(); ui.create.cards();
game.finishCards(); game.finishCards();
ui.arena.dataset.number=8; ui.arena.dataset.number=8;
ui.control.style.transitionProperty='opacity';
ui.control.classList.add('bosslist'); ui.control.classList.add('bosslist');
setTimeout(function(){
ui.control.style.transitionProperty='';
},1000);
ui.window.appendChild(bosslist); ui.window.appendChild(bosslist);

View File

@ -2083,7 +2083,7 @@ mode.chess={
delete window.characterRank; delete window.characterRank;
ui.control.style.transition='all 0s'; ui.control.style.transition='all 0s';
if(lib.config.layout=='mobile'){ if(lib.config.layout=='mobile'||lib.config.layout=='default'){
ui.control.style.top='calc(100% - 70px)'; ui.control.style.top='calc(100% - 70px)';
} }
else if(lib.config.layout=='phone'){ else if(lib.config.layout=='phone'){
@ -3567,7 +3567,7 @@ mode.chess={
bosses.childNodes[i].classList.add('squarebutton'); bosses.childNodes[i].classList.add('squarebutton');
} }
ui.control.style.transition='all 0s'; ui.control.style.transition='all 0s';
if(lib.config.layout=='mobile'){ if(lib.config.layout=='mobile'||lib.config.layout=='default'){
ui.control.style.top='calc(100% - 70px)'; ui.control.style.top='calc(100% - 70px)';
} }
else if(lib.config.layout=='phone'){ else if(lib.config.layout=='phone'){