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,14 +1029,24 @@ 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++){
target=target.next; if(target.num('j','shandian')){
target=target.next;
}
else{
break;
}
} }
if(card.name!='shandian'){ if(target.num('j','shandian')||target==player){
target.addJudge('shandian',card); ui.discardPile.appendChild(card);
} }
else{ else{
target.addJudge(card); if(card.name!='shandian'){
target.addJudge('shandian',card);
}
else{
target.addJudge(card);
}
} }
} }
else{ else{
@ -1047,14 +1057,24 @@ 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++){
target=target.next; if(target.num('j','shandian')){
target=target.next;
}
else{
break;
}
} }
if(card.name!='shandian'){ if(target.num('j','shandian')||target==player){
target.addJudge('shandian',card); ui.discardPile.appendChild(card);
} }
else{ else{
target.addJudge(card); if(card.name!='shandian'){
target.addJudge('shandian',card);
}
else{
target.addJudge(card);
}
} }
} }
else{ else{

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++){
target=target.next; if(target.num('j','huoshan')){
target=target.next;
}
else{
break;
}
} }
if(card.name!='huoshan'){ if(target.num('j','huoshan')||target==player){
player.next.addJudge('huoshan',card); 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++){
target=target.next; if(target.num('j','huoshan')){
target=target.next;
}
else{
break;
}
} }
if(card.name!='huoshan'){ if(target.num('j','huoshan')||target==player){
player.next.addJudge('huoshan',card); 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,14 +175,24 @@ 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++){
target=target.next; if(target.num('j','hongshui')){
target=target.next;
}
else{
break;
}
} }
if(card.name!='hongshui'){ if(target.num('j','hongshui')||target==player){
target.addJudge('hongshui',card); ui.discardPile.appendChild(card);
} }
else{ else{
target.addJudge(card); if(card.name!='hongshui'){
target.addJudge('hongshui',card);
}
else{
target.addJudge(card);
}
} }
} }
else{ else{
@ -173,14 +203,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','hongshui')&&!target.next.num('j','hongshui')){ for(var iwhile=0;iwhile<10;iwhile++){
target=target.next; if(target.num('j','hongshui')){
target=target.next;
}
else{
break;
}
} }
if(card.name!='hongshui'){ if(target.num('j','hongshui')||target==player){
target.addJudge('hongshui',card); ui.discardPile.appendChild(card);
} }
else{ else{
target.addJudge(card); if(card.name!='hongshui'){
target.addJudge('hongshui',card);
}
else{
target.addJudge(card);
}
} }
} }
else{ else{

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,14 +2638,17 @@
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){
window.isIpad=true; var ua=navigator.userAgent.toLowerCase();
} if(ua.indexOf('ipad')!=-1){
else if(scripts[i].src.indexOf('iphone')!=-1){ window.isIpad=true;
var metas=document.head.querySelectorAll('meta'); }
for(var i=0;i<metas.length;i++){ else{
if(metas[i].name=='viewport'){ var metas=document.head.querySelectorAll('meta');
metas[i].content="user-scalable=no, initial-scale=0.6, maximum-scale=0.6, minimum-scale=0.6, width=device-width, height=device-height"; for(var i=0;i<metas.length;i++){
if(metas[i].name=='viewport'){
metas[i].content="user-scalable=no, initial-scale=0.6, maximum-scale=0.6, minimum-scale=0.6, width=device-width, height=device-height";
}
} }
} }
} }
@ -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=[];
if(image){ var dontcreate=false;
game.putDB('image','character:'+name,image); 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){
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'){