This commit is contained in:
libccy 2016-08-10 00:48:05 +08:00
parent 137c375d13
commit 47e481b7fd
4 changed files with 300 additions and 9 deletions

View File

@ -60,7 +60,10 @@ character.sp={
tadun:['male','qun',4,['luanzhan']], tadun:['male','qun',4,['luanzhan']],
yanbaihu:['male','qun',4,['zhidao','jili']], yanbaihu:['male','qun',4,['zhidao','jili']],
chengyu:['male','wei',3,['shefu','benyu']], chengyu:['male','wei',3,['shefu','benyu']],
wanglang:['male','wei',3,[]],
wanglang:['male','wei',3,['gushe','jici']],
sp_pangde:['male','wei',4,['mashu','juesi']],
sp_jiaxu:['male','wei',3,['zhenlue','jianshu','yongdi']],
}, },
perfectPair:{ perfectPair:{
zhugejin:['zhugeke'], zhugejin:['zhugeke'],
@ -5920,6 +5923,7 @@ character.sp={
zhangliang:'张梁', zhangliang:'张梁',
tianfeng:'田丰', tianfeng:'田丰',
sp_pangtong:'sp庞统', sp_pangtong:'sp庞统',
sp_jiaxu:'sp贾诩',
maliang:'马良', maliang:'马良',
sp_caoren:'sp曹仁', sp_caoren:'sp曹仁',
yuejin:'乐进', yuejin:'乐进',
@ -5934,7 +5938,7 @@ character.sp={
caoang:'曹昂', caoang:'曹昂',
kongrong:'孔融', kongrong:'孔融',
fuwan:'伏完', fuwan:'伏完',
sp_pangde:'庞德', sp_pangde:'sp庞德',
sp_sunshangxiang:'孙尚香', sp_sunshangxiang:'孙尚香',
zhugedan:'诸葛诞', zhugedan:'诸葛诞',
sp_machao:'sp马超', sp_machao:'sp马超',
@ -5973,6 +5977,18 @@ character.sp={
tadun:'蹋顿', tadun:'蹋顿',
yanbaihu:'严白虎', yanbaihu:'严白虎',
juesi:'决死',
juesi_info:'出牌阶段,你可以弃置一张杀并选择你攻击范围内的一名有牌的其他角色,该角色弃置一张牌,然后若弃置的牌不是杀且你的体力值不大于该角色,你视为对其使用决斗',
zhenlue:'缜略',
zhenlue_info:'锁定技,你使用的非延时类锦囊牌不能被无懈可击响应;你不能被选择为延时类锦囊牌的目标',
jianshu:'间书',
jianshu_info:'限定技,出牌阶段,你可以将一张黑色手牌交给一名其他角色,并选择一名攻击范围内含有其的另一名其他角色,然后令这两名角色拼点,赢的角色弃置两张牌,没赢的角色失去一点体力',
yongdi:'拥嫡',
yongdi_info:'限定技,当你受到伤害后,你可令一名其他男性角色增加一点体力上限,然后若该角色的武将牌上有主公技且其不为主公,其获得此主公技',
gushe:'鼓舌',
gushe_info:'出牌阶段限一次你可以用一张手牌与至多三名角色同时拼点然后依次结算拼点结果没赢的角色选择一项1.弃置一张牌2.令你摸一张牌。若拼点没赢的角色是你你需先获得一个“饶舌”标记你有7个饶舌标记时你死亡',
jici:'激词',
jici_info:'当你发动“鼓舌”拼点的牌亮出后若点数小于X你可令点数+X若点数等于X你可令你本回合发动“鼓舌”的次数上限+1X为你“饶舌”标记的数量',
shefu:'设伏', shefu:'设伏',
shefu_info:'结束阶段开始时,你可以将一张手牌移出游戏,称为"伏兵"。然后为"伏兵"记录一个基本牌或锦囊牌名称(须与其他"伏兵"记录的名称均不同)。你的回合外,当有其他角色使用与你记录的"伏兵"牌名相同的牌时,你可以令此牌无效,然后将该"伏兵"置入弃牌堆', shefu_info:'结束阶段开始时,你可以将一张手牌移出游戏,称为"伏兵"。然后为"伏兵"记录一个基本牌或锦囊牌名称(须与其他"伏兵"记录的名称均不同)。你的回合外,当有其他角色使用与你记录的"伏兵"牌名相同的牌时,你可以令此牌无效,然后将该"伏兵"置入弃牌堆',
benyu:'贲育', benyu:'贲育',

View File

@ -5170,6 +5170,7 @@
if(event.dialog&&event.dialog.close) event.dialog.close(); if(event.dialog&&event.dialog.close) event.dialog.close();
}, },
chooseToCompareMultiple:function(){ chooseToCompareMultiple:function(){
"step 0"
if(player.num('h')==0){ if(player.num('h')==0){
event.result={cancelled:true,bool:false} event.result={cancelled:true,bool:false}
event.finish(); event.finish();
@ -5182,7 +5183,64 @@
return; return;
} }
} }
game.log(player,'对',target,'发起拼点'); game.log(player,'对',targets,'发起拼点');
"step 1"
event.list=targets.slice(0);
event.list.unshift(player);
player.chooseCardOL(event.list,'请选择拼点牌',true).set('ai',event.ai).aiCard=function(target){
var hs=target.get('h');
_status.event.player=target;
hs.sort(function(a,b){
return event.ai(b)-event.ai(a);
});
delete _status.event.player;
return {bool:true,cards:[hs[0]]};
};
"step 2"
var cards=[];
player.lose(result[0].cards);
for(var i=1;i<result.length;i++){
event.list[i].lose(result[i].cards);
cards.push(result[i].cards[0]);
}
event.list2=cards;
event.card1=result[0].cards[0];
event.result={player:event.card1,targets:cards.slice(0)};
event.list.shift();
game.log(player,'的拼点牌为',event.card1);
"step 3"
if(event.list.length){
game.broadcastAll(function(){
ui.arena.classList.add('thrownhighlight');
});
game.addVideo('thrownhighlight1');
event.current=event.list.shift();
event.current.animate('target');
player.animate('target');
event.card2=event.list2.shift();
game.log(event.current,'的拼点牌为',event.card2);
player.$compare(event.card1,event.current,event.card2);
game.delay(4);
}
else{
event.finish();
}
"step 4"
if(event.callback){
var next=game.createEvent('compareMultiple');
next.player=player;
next.target=event.current;
next.card1=event.card1;
next.card2=event.card2;
next.content=event.callback;
}
"step 5"
game.broadcastAll(function(id){
ui.arena.classList.remove('thrownhighlight');
ui.clear();
});
game.addVideo('thrownhighlight2');
event.goto(3);
}, },
chooseToCompare:function(){ chooseToCompare:function(){
"step 0" "step 0"
@ -5382,6 +5440,80 @@
event.callback(event.player,event.result); event.callback(event.player,event.result);
} }
}, },
chooseCardOL:function(){
'step 0'
event.targets=event.list.slice(0);
if(!_status.connectMode){
event.result=[];
event.goto(7);
}
else{
for(var i=0;i<event.list.length;i++){
var target=event.list[i];
target.wait();
if(target.isOnline()){
target.send(function(args,set){
game.me.chooseCard.apply(game.me,args).set(set);
game.resume();
},event._args,event._set);
event.list.splice(i--,1);
}
else if(target==game.me){
event.withme=true;
event.list.splice(i--,1);
}
}
}
'step 1'
if(event.list.length){
event.target=event.list.shift();
event.target.chooseCard.apply(event.target,event._args).set(event._set);
}
else{
event.goto(3);
}
'step 2'
event.target.unwait(result);
event.goto(1);
'step 3'
if(event.withme){
game.me.chooseCard.apply(game.me,event._args).set(event._set);
}
else{
event.goto(5);
}
'step 4'
game.me.unwait(result);
'step 5'
if(!event.resultOL){
game.pause();
}
'step 6'
event.result=[];
for(var i=0;i<event.targets.length;i++){
event.result[i]=event.resultOL[event.targets[i].playerid]||{};
if(event.result[i]=='ai'&&event.aiCard){
event.result[i]=event.aiCard(event.targets[i]);
}
}
event.finish();
'step 7'
if(event.list.length){
event.target=event.list.shift();
event.target.chooseCard.apply(event.target,event._args).set(event._set);
}
else{
for(var i=0;i<event.targets.length;i++){
if(!event.result[i]){
event.result[i]={};
}
}
event.finish();
}
'step 8'
event.result[event.targets.indexOf(event.target)]=result;
event.goto(7);
},
chooseButtonOL:function(){ chooseButtonOL:function(){
'step 0' 'step 0'
ui.arena.classList.add('markhidden'); ui.arena.classList.add('markhidden');
@ -5496,7 +5628,7 @@
} }
} }
"step 2" "step 2"
if(event.glow_result){ if(event.glow_result&&event.result.cards){
for(var i=0;i<event.result.cards.length;i++){ for(var i=0;i<event.result.cards.length;i++){
event.result.cards[i].classList.add('glow'); event.result.cards[i].classList.add('glow');
} }
@ -8454,6 +8586,21 @@
next.callback=callback; next.callback=callback;
next._args=Array.from(arguments); next._args=Array.from(arguments);
return next; return next;
},
chooseCardOL:function(){
var next=game.createEvent('chooseCardOL');
next._args=[];
for(var i=0;i<arguments.length;i++){
if(get.itemtype(arguments[i])=='players'){
next.list=arguments[i].slice(0);
}
else{
next._args.push(arguments[i]);
}
}
next.content=lib.element.playerproto.chooseCardOL;
next._args.add('glow_result');
return next;
}, },
chooseCard:function(){ chooseCard:function(){
var next=game.createEvent('chooseCard'); var next=game.createEvent('chooseCard');
@ -8478,6 +8625,9 @@
else if(typeof arguments[i]=='object'&&arguments[i]){ else if(typeof arguments[i]=='object'&&arguments[i]){
next.filterCard=get.filter(arguments[i]); next.filterCard=get.filter(arguments[i]);
} }
else if(arguments[i]=='glow_result'){
next.glow_result=true;
}
else if(typeof arguments[i]=='string'){ else if(typeof arguments[i]=='string'){
next.prompt=arguments[i]; next.prompt=arguments[i];
} }
@ -10258,6 +10408,99 @@
} }
} }
}, },
$compareMultiple:function(card1,targets,cards){
game.broadcast(function(player,card1,targets,cards){
player.$compareMultiple(card1,targets,cards);
},this,card1,targets,cards);
game.addVideo('compareMultiple',this,[get.cardInfo(card1),get.targetsInfo(targets),get.cardsInfo(cards)]);
var player=this;
var node1=player.$throwxy2(card1,
'calc(50% - 52px)','calc(50% + 10px)','perspective(600px) rotateY(180deg)',true
);
if(lib.config.cardback_style!='default'){
node1.style.transitionProperty='none';
ui.refresh(node1);
node1.classList.add('infohidden');
ui.refresh(node1);
node1.style.transitionProperty='';
}
else{
node1.classList.add('infohidden');
}
node1.style.transform='perspective(600px) rotateY(180deg) translateX(0)';
var onEnd01=function(){
node1.removeEventListener('webkitTransitionEnd',onEnd01);
setTimeout(function(){
node1.style.transition='all ease-in 0.3s';
node1.style.transform='perspective(600px) rotateY(270deg) translateX(52px)';
var onEnd=function(){
node1.classList.remove('infohidden');
node1.style.transition='all 0s';
ui.refresh(node1);
node1.style.transform='perspective(600px) rotateY(-90deg) translateX(52px)';
ui.refresh(node1);
node1.style.transition='';
ui.refresh(node1);
node1.style.transform='';
node1.removeEventListener('webkitTransitionEnd',onEnd);
}
node1.addEventListener('webkitTransitionEnd',onEnd);
},300);
};
node1.addEventListener('webkitTransitionEnd',onEnd01);
setTimeout(function(){
var left0=-targets.length*52-(targets.length-1)*8;
for(var i=0;i<targets.length;i++){
(function(target,card2,i){
var left=left0+i*120;
var node2;
if(left<0){
node2=target.$throwxy2(card2,
'calc(50% - '+(-left)+'px)','calc(50% - 114px)','perspective(600px) rotateY(180deg)',true
);
}
else{
node2=target.$throwxy2(card2,
'calc(50% + '+left+'px)','calc(50% - 114px)','perspective(600px) rotateY(180deg)',true
);
}
if(lib.config.cardback_style!='default'){
node2.style.transitionProperty='none';
ui.refresh(node2);
node2.classList.add('infohidden');
ui.refresh(node2);
node2.style.transitionProperty='';
}
else{
node2.classList.add('infohidden');
}
node2.style.transform='perspective(600px) rotateY(180deg) translateX(0)';
var onEnd02=function(){
node2.removeEventListener('webkitTransitionEnd',onEnd02);
setTimeout(function(){
node2.style.transition='all ease-in 0.3s';
node2.style.transform='perspective(600px) rotateY(270deg) translateX(52px)';
var onEnd=function(){
node2.classList.remove('infohidden');
node2.style.transition='all 0s';
ui.refresh(node2);
node2.style.transform='perspective(600px) rotateY(-90deg) translateX(52px)';
ui.refresh(node2);
node2.style.transition='';
ui.refresh(node2);
node2.style.transform='';
node2.removeEventListener('webkitTransitionEnd',onEnd);
}
node2.addEventListener('webkitTransitionEnd',onEnd);
},200);
};
node2.addEventListener('webkitTransitionEnd',onEnd02);
}(targets[i],cards[i],i))
}
},200);
},
$compare:function(card1,target,card2){ $compare:function(card1,target,card2){
game.broadcast(function(player,target,card1,card2){ game.broadcast(function(player,target,card1,card2){
player.$compare(card1,target,card2); player.$compare(card1,target,card2);
@ -11529,8 +11772,17 @@
this.step--; this.step--;
}, },
set:function(key,value){ set:function(key,value){
this[key]=value; if(arguments.length==1&&Array.isArray(arguments[0])){
this._set.push([key,value]); for(var i=0;i<arguments[0].length;i++){
if(Array.isArray(arguments[0][i])){
this.set(arguments[0][i][0],arguments[0][i][1]);
}
}
}
else{
this[key]=value;
this._set.push([key,value]);
}
return this; return this;
}, },
send:function(){ send:function(){
@ -15129,6 +15381,14 @@
console.log(player); console.log(player);
} }
}, },
compareMultiple:function(player,info){
if(player&&info){
player.$compareMultiple(get.infoCard(info[0]),get.infoTargets(info[1]),get.infoCards(info[2]));
}
else{
console.log(player);
}
},
give:function(player,info){ give:function(player,info){
if(player&&info){ if(player&&info){
player.$give(info[0],game.playerMap[info[1]]); player.$give(info[0],game.playerMap[info[1]]);
@ -23870,7 +24130,7 @@
var li1=document.createElement('li'); var li1=document.createElement('li');
var li2=document.createElement('li'); var li2=document.createElement('li');
var li3=document.createElement('li'); var li3=document.createElement('li');
li1.innerHTML='游戏版本:'+lib.version+'<p style="margin-top:8px"></p>'; li1.innerHTML='游戏版本:'+lib.version+'<p style="margin-top:8px;white-space:nowrap"></p>';
li2.innerHTML='素材版本:'+(lib.config.asset_version||'无')+'<p style="margin-top:8px"></p>'; li2.innerHTML='素材版本:'+(lib.config.asset_version||'无')+'<p style="margin-top:8px"></p>';
li3.innerHTML='更新源<br><p style="margin-top:8px"><input type="text" style="width:120px" value="'+lib.updateURL+'"><button style="margin-left:5px">确定</button></p>'; li3.innerHTML='更新源<br><p style="margin-top:8px"><input type="text" style="width:120px" value="'+lib.updateURL+'"><button style="margin-left:5px">确定</button></p>';
li3.querySelector('button').onclick=function(){ li3.querySelector('button').onclick=function(){
@ -29394,6 +29654,20 @@
if(lib.characterPack.boss&&lib.characterPack.boss[name]) return num?10:'sp'; if(lib.characterPack.boss&&lib.characterPack.boss[name]) return num?10:'sp';
return num?1:'x'; return num?1:'x';
}, },
targetsInfo:function(targets){
var info=[];
for(var i=0;i<targets.length;i++){
info.push(targets[i].dataset.position);
}
return info;
},
infoTargets:function(info){
var targets=[];
for(var i=0;i<info.length;i++){
targets.push(game.playerMap[info[i]]);
}
return targets;
},
cardInfo:function(card){ cardInfo:function(card){
return [card.suit,card.number,card.name,card.nature]; return [card.suit,card.number,card.name,card.nature];
}, },

View File

@ -16,8 +16,8 @@ var load=function(id){
} }
load(1); load(1);
load(2); // load(2);
load(3); // load(3);
setTimeout(function(){ setTimeout(function(){
phantom.exit(); phantom.exit();

View File

@ -7,6 +7,7 @@ window.noname_update={
global:[ global:[
'game/asset.js', 'game/asset.js',
'game/game.js', 'game/game.js',
'game/phantom.js',
'character/swd.js', 'character/swd.js',
'character/rank.js', 'character/rank.js',
'character/sp.js', 'character/sp.js',