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{
if(!card.expired){
var target=player.next;
if(target.num('j','shandian')&&!target.next.num('j','shandian')){
target=target.next;
for(var iwhile=0;iwhile<10;iwhile++){
if(target.num('j','shandian')){
target=target.next;
}
else{
break;
}
}
if(card.name!='shandian'){
target.addJudge('shandian',card);
if(target.num('j','shandian')||target==player){
ui.discardPile.appendChild(card);
}
else{
target.addJudge(card);
if(card.name!='shandian'){
target.addJudge('shandian',card);
}
else{
target.addJudge(card);
}
}
}
else{
@ -1047,14 +1057,24 @@ card.standard={
cancel:function(){
if(!card.expired){
var target=player.next;
if(target.num('j','shandian')&&!target.next.num('j','shandian')){
target=target.next;
for(var iwhile=0;iwhile<10;iwhile++){
if(target.num('j','shandian')){
target=target.next;
}
else{
break;
}
}
if(card.name!='shandian'){
target.addJudge('shandian',card);
if(target.num('j','shandian')||target==player){
ui.discardPile.appendChild(card);
}
else{
target.addJudge(card);
if(card.name!='shandian'){
target.addJudge('shandian',card);
}
else{
target.addJudge(card);
}
}
}
else{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2083,7 +2083,7 @@ mode.chess={
delete window.characterRank;
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)';
}
else if(lib.config.layout=='phone'){
@ -3567,7 +3567,7 @@ mode.chess={
bosses.childNodes[i].classList.add('squarebutton');
}
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)';
}
else if(lib.config.layout=='phone'){