This commit is contained in:
libccy 2016-04-05 13:18:30 +08:00
parent 459098ab87
commit d7a52b8c80
7 changed files with 152 additions and 59 deletions

View File

@ -128,16 +128,21 @@ card.refresh={
direct:true, direct:true,
content:function(){ content:function(){
"step 0" "step 0"
var dialog=ui.create.dialog('木牛流马',player.get('e','5').cards); player.chooseButton(['木牛流马',player.get('e','5').cards]).set('filterButton',function(button){
player.chooseButton(dialog).filterButton=function(button){ var evt=_status.event.getParent()._trigger;
return trigger.filterCard(button.link); if(evt&&evt.filterCard){
}; return evt.filterCard(button.link,_status.event.player);
}
return true;
});
"step 1" "step 1"
if(result.bool){ if(result.bool){
trigger.untrigger(); trigger.untrigger();
trigger.responded=true; trigger.responded=true;
trigger.result={bool:true,card:result.buttons[0].link}; trigger.result={bool:true,card:result.links[0]};
player.get('e','5').cards.remove(result.buttons[0].link); var muniu=player.get('e','5');
muniu.cards.remove(result.links[0]);
lib.skill.muniu_skill.sync(muniu);
} }
}, },
ai:{ ai:{
@ -148,7 +153,6 @@ card.refresh={
}, },
muniu_skill4:{ muniu_skill4:{
enable:'chooseToUse', enable:'chooseToUse',
direct:true,
filter:function(event,player){ filter:function(event,player){
var muniu=player.get('e','5'); var muniu=player.get('e','5');
if(!muniu.cards) return false; if(!muniu.cards) return false;
@ -158,12 +162,18 @@ card.refresh={
} }
return false; return false;
}, },
delay:0, chooseButton:{
content:function(){ dialog:function(event,player){
"step 0" return ui.create.dialog('木牛流马',player.get('e','5').cards,'hidden');
var dialog=ui.create.dialog('木牛流马',player.get('e','5').cards); },
var trigger=event.parent.parent; filter:function(button,player){
player.chooseButton(dialog,function(button){ var evt=_status.event.getParent();
if(evt&&evt.filterCard){
return evt.filterCard(button.link,player,_status.event.getParent());
}
return true;
},
check:function(button){
var player=_status.event.player; var player=_status.event.player;
if(get.select(get.info(button.link).selectTarget)[1]==-1){ if(get.select(get.info(button.link).selectTarget)[1]==-1){
if(get.type(button.link)=='delay') return -1; if(get.type(button.link)=='delay') return -1;
@ -182,28 +192,29 @@ card.refresh={
return -1; return -1;
} }
return 1; return 1;
}).filterButton=function(button){ },
return trigger.filterCard(button.link,player,trigger); backup:function(links,player){
}; return {
player.addTempSkill('muniu_skill8',['useCardAfter','phaseAfter']); filterCard:function(){return false},
"step 1" selectCard:-1,
if(result.bool){ viewAs:links[0],
lib.skill.muniu_skill5.viewAs=result.buttons[0].link; onuse:function(result,player){
event.parent.parent.backup('muniu_skill5'); var muniu=player.get('e','5');
event.parent.parent.step=0; if(muniu&&muniu.cards){
if(event.isMine()){ muniu.cards.remove(result.card);
event.parent.parent.openskilldialog='选择'+get.translation(result.buttons[0].link)+'的目标'; lib.skill.muniu_skill.sync(muniu);
}
}
} }
} },
else{ prompt:function(links,player){
event.parent.parent.step=0; return '选择'+get.translation(links)+'的目标';
} }
}, },
ai:{ ai:{
order:4, order:4,
result:{ result:{
player:function(player){ player:function(player){
if(player.skills.contains('muniu_skill8')) return 0;
if(_status.dying) return ai.get.attitude(player,_status.dying); if(_status.dying) return ai.get.attitude(player,_status.dying);
return 1; return 1;
} }
@ -212,12 +223,7 @@ card.refresh={
value:-1 value:-1
} }
}, },
muniu_skill5:{
filterCard:function(){return false},
selectCard:-1
},
muniu_skill6:{}, muniu_skill6:{},
muniu_skill8:{},
muniu_skill7:{ muniu_skill7:{
filter:function(){return false}, filter:function(){return false},
hiddenCard:function(player,name){ hiddenCard:function(player,name){
@ -273,8 +279,8 @@ card.refresh={
muniu_skill2:'流马', muniu_skill2:'流马',
muniu_skill3:'流马', muniu_skill3:'流马',
muniu_skill4:'流马', muniu_skill4:'流马',
muniu_skill5:'流马',
muniu_skill6:'流马', muniu_skill6:'流马',
muniu_skill4_backup:'流马',
muniu_info:'出牌阶段限一次,你可以将一张手牌扣置于你装备区里的【木牛流马】下,若如此做,你可以将此装备移动到一名其他角色的装备区里;你可以将此装备牌下的牌如手牌般使用或打出。', muniu_info:'出牌阶段限一次,你可以将一张手牌扣置于你装备区里的【木牛流马】下,若如此做,你可以将此装备移动到一名其他角色的装备区里;你可以将此装备牌下的牌如手牌般使用或打出。',
muniu_skill_info:'出牌阶段限一次,你可以将一张手牌扣置于你装备区里的【木牛流马】下,若如此做,你可以将此装备移动到一名其他角色的装备区里;你可以将此装备牌下的牌如手牌般使用或打出。', muniu_skill_info:'出牌阶段限一次,你可以将一张手牌扣置于你装备区里的【木牛流马】下,若如此做,你可以将此装备移动到一名其他角色的装备区里;你可以将此装备牌下的牌如手牌般使用或打出。',
}, },

View File

@ -1383,6 +1383,12 @@ card.standard={
event.state=true; event.state=true;
event.card=trigger.card; event.card=trigger.card;
event._global_waiting=true; event._global_waiting=true;
event.filterCard=function(card,player){
if(card.name!='wuxie') return false;
var mod=game.checkMod(card,player,'unchanged','cardEnabled',player.get('s'));
if(mod!='unchanged') return mod;
return true;
};
event.send=function(player,state,isJudge,card,source,target,targets,id){ event.send=function(player,state,isJudge,card,source,target,targets,id){
state=state?1:-1; state=state?1:-1;
var str=''; var str='';

View File

@ -2749,7 +2749,6 @@ character.shenhua={
player.storage.buqu.push(event.card); player.storage.buqu.push(event.card);
game.addVideo('storage',player,['buqu',get.cardsInfo(player.storage.buqu),'cards']); game.addVideo('storage',player,['buqu',get.cardsInfo(player.storage.buqu),'cards']);
player.showCards(player.storage.buqu,'不屈') player.showCards(player.storage.buqu,'不屈')
game.log(player,'的不屈牌为',player.storage.buqu);
player.markSkill('buqu'); player.markSkill('buqu');
"step 1" "step 1"
for(var i=0;i<player.storage.buqu.length-1;i++){ for(var i=0;i<player.storage.buqu.length-1;i++){

View File

@ -2214,7 +2214,7 @@ character.sp={
}, },
content:function(){ content:function(){
player.storage.mozhi.add(trigger.card); player.storage.mozhi.add(trigger.card);
player.markSkill('mozhi'); if(player.get('s').contains('mozhi')) player.markSkill('mozhi');
} }
}, },
chenqing2:{}, chenqing2:{},

View File

@ -3768,14 +3768,14 @@
game.saveConfig('mode',this.link); game.saveConfig('mode',this.link);
splash.delete(); splash.delete();
delete window.inSplash; delete window.inSplash;
var scriptnode=lib.init.js(lib.assetURL+'mode',lib.config.mode); lib.init.js(lib.assetURL+'mode',lib.config.mode,proceed);
if(scriptnode){
scriptnode.onload=proceed;
}
else{
proceed();
}
} }
var downNode=function(){
this.classList.add('glow');
}
var upNode=function(){
this.classList.remove('glow');
}
var splash=ui.create.div('#splash',document.body); var splash=ui.create.div('#splash',document.body);
for(var i=0;i<lib.config.all.mode.length;i++){ for(var i=0;i<lib.config.all.mode.length;i++){
var node=ui.create.div(splash,'.hidden',clickNode); var node=ui.create.div(splash,'.hidden',clickNode);
@ -3787,6 +3787,16 @@
else{ else{
ui.create.div(node,'.avatar').setBackgroundDB(lib.mode[lib.config.all.mode[i]].splash); ui.create.div(node,'.avatar').setBackgroundDB(lib.mode[lib.config.all.mode[i]].splash);
} }
if(lib.config.touchscreen){
node.addEventListener('touchstart',downNode);
node.addEventListener('touchend',upNode);
node.addEventListener('mouseleave',upNode);
}
else{
node.addEventListener('mousedown',downNode);
node.addEventListener('mouseup',upNode);
node.addEventListener('mouseleave',upNode);
}
ui.refresh(node); ui.refresh(node);
setTimeout((function(node){ setTimeout((function(node){
return function(){ return function(){
@ -4246,6 +4256,10 @@
var skill=event.skill; var skill=event.skill;
ui.click.cancel(); ui.click.cancel();
event.aiexclude.add(skill); event.aiexclude.add(skill);
var info=get.info(skill);
if(info.aiexclude){
event.aiexclude.add(info.aiexclude);
}
} }
else{ else{
get.card().aiexclude(); get.card().aiexclude();
@ -4271,21 +4285,55 @@
} }
} }
"step 2" "step 2"
if(event.result){
if(event.result.skill){
var info=get.info(event.result.skill);
if(info&&info.chooseButton){
if(event.dialog&&typeof event.dialog=='object') event.dialog.close();
var dialog=info.chooseButton.dialog(event,player);
var next=player.chooseButton(dialog);
next.set('ai',info.chooseButton.check||function(){return 0;});
next.set('filterButton',info.chooseButton.filter||function(){return true;});
event.buttoned=event.result.skill;
}
}
}
"step 3"
if(event.buttoned){
if(result.bool){
var info=get.info(event.buttoned).chooseButton;
lib.skill[event.buttoned+'_backup']=info.backup(result.links,player);
lib.skill[event.buttoned+'_backup'].aiexclude=event.buttoned;
if(game.online){
event._sendskill=[event.buttoned+'_backup',lib.skill[event.buttoned+'_backup']];
}
event.backup(event.buttoned+'_backup');
if(info.prompt){
event.openskilldialog=info.prompt(result.links,player);
}
}
else{
event.aiexclude.add(event.buttoned);
}
event.goto(0);
delete event.buttoned;
}
"step 4"
delete _status.noclearcountdown; delete _status.noclearcountdown;
if(event.skillDialog&&get.objtype(event.skillDialog)=='div'){ if(event.skillDialog&&get.objtype(event.skillDialog)=='div'){
event.skillDialog.close(); event.skillDialog.close();
} }
if(event.onresult){
event.onresult(event.result);
}
if(event.result.bool&&!game.online&&!event.nouse){ if(event.result.bool&&!game.online&&!event.nouse){
player.useResult(event.result,event); player.useResult(event.result,event);
} }
else if(event._sendskill){
event.result._sendskill=event._sendskill;
}
if(event.dialog&&typeof event.dialog=='object') event.dialog.close(); if(event.dialog&&typeof event.dialog=='object') event.dialog.close();
if(!_status.noclearcountdown){ if(!_status.noclearcountdown){
game.stopCountChoose(); game.stopCountChoose();
} }
"step 3" "step 5"
if(event._result&&event.result){ if(event._result&&event.result){
event.result.result=event._result; event.result.result=event._result;
} }
@ -5420,6 +5468,9 @@
next.preResult=event.preResult; next.preResult=event.preResult;
} }
"step 5" "step 5"
if(event._result){
event.result=event._result;
}
delete player.using; delete player.using;
if(document.getElementsByClassName('thrown').length){ if(document.getElementsByClassName('thrown').length){
if(event.delayx!==false) game.delayx(); if(event.delayx!==false) game.delayx();
@ -5435,9 +5486,6 @@
ui.tempnowuxie.close(); ui.tempnowuxie.close();
delete ui.tempnowuxie; delete ui.tempnowuxie;
} }
if(event._result){
event.result=event._result;
}
}, },
useSkill:function(){ useSkill:function(){
"step 0" "step 0"
@ -7698,8 +7746,20 @@
}, },
useResult:function(result,event){ useResult:function(result,event){
event=event||_status.event; event=event||_status.event;
if(result.skill&&get.info(result.skill).direct){ if(result._sendskill){
_status.noclearcountdown=true; lib.skill[result._sendskill[0]]=result._sendskill[1];
}
if(event.onresult){
event.onresult(result);
}
if(result.skill){
var info=get.info(result.skill);
if(info.onuse){
info.onuse(result,this);
}
if(info.direct){
_status.noclearcountdown=true;
}
} }
if(event.logSkill){ if(event.logSkill){
if(typeof event.logSkill=='string'){ if(typeof event.logSkill=='string'){
@ -10234,6 +10294,7 @@
var skills={ var skills={
global:lib.skill.global global:lib.skill.global
}; };
var skillinfo={};
for(var i in lib.playerOL){ for(var i in lib.playerOL){
skills[i]={ skills[i]={
skills:lib.playerOL[i].skills, skills:lib.playerOL[i].skills,
@ -10243,7 +10304,12 @@
storage:lib.playerOL[i].storage, storage:lib.playerOL[i].storage,
} }
} }
this.player.send(function(name,args,set,event,stat,skills){ for(var i in lib.skill){
if(lib.skill[i].chooseButton&&lib.skill[i].enable){
skillinfo[i]=lib.skill[i].chooseButton;
}
}
this.player.send(function(name,args,set,event,stat,skills,skillinfo){
for(var i in skills){ for(var i in skills){
if(i=='global'){ if(i=='global'){
lib.skill.global=skills[i]; lib.skill.global=skills[i];
@ -10254,6 +10320,12 @@
} }
} }
} }
for(var i in skillinfo){
if(!lib.skill[i]){
lib.skill[i]={};
}
lib.skill[i].chooseButton=skillinfo[i];
}
game.me.stat=[stat]; game.me.stat=[stat];
var next=game.me[name].apply(game.me,args); var next=game.me[name].apply(game.me,args);
for(var i=0;i<set.length;i++){ for(var i=0;i<set.length;i++){
@ -10263,7 +10335,7 @@
game.resume(); game.resume();
},this.name,this._args||[],this._set, },this.name,this._args||[],this._set,
get.stringifiedResult(this.parent,3), get.stringifiedResult(this.parent,3),
this.player.getStat(),skills); this.player.getStat(),skills,skillinfo);
this.player.wait(); this.player.wait();
game.pause(); game.pause();
}, },
@ -11531,7 +11603,7 @@
game.createEvent('game',false).content=lib.init.startOnline; game.createEvent('game',false).content=lib.init.startOnline;
game.loop(); game.loop();
game.send('reinited'); game.send('reinited');
if(!observe&&game.me&&game.me.isDead){ if(!observe&&game.me&&game.me.isDead()){
ui.exit=ui.create.control('退出联机',function(){ ui.exit=ui.create.control('退出联机',function(){
game.saveConfig('reconnect_info'); game.saveConfig('reconnect_info');
game.reload(); game.reload();
@ -14812,7 +14884,7 @@
if(info.filter&&info.filter(event,player)==false) enable=false; if(info.filter&&info.filter(event,player)==false) enable=false;
if(info.viewAs&&event.filterCard&&!event.filterCard(info.viewAs,player)) enable=false; if(info.viewAs&&event.filterCard&&!event.filterCard(info.viewAs,player)) enable=false;
if(info.viewAs&&info.viewAsFilter&&info.viewAsFilter(player)==false) enable=false; if(info.viewAs&&info.viewAsFilter&&info.viewAsFilter(player)==false) enable=false;
if(event.aiexclude.contains(skills2[i])) enable=false; if(!event.isMine()&&event.aiexclude.contains(skills2[i])) enable=false;
if(info.usable&&get.skillCount(skills2[i])>=info.usable) enable=false; if(info.usable&&get.skillCount(skills2[i])>=info.usable) enable=false;
} }
if(enable){ if(enable){
@ -23110,6 +23182,9 @@
}, },
funcInfoOL:function(func){ funcInfoOL:function(func){
if(typeof func=='function'){ if(typeof func=='function'){
if(func._filter_args){
return '_noname_func:'+JSON.stringify(get.stringifiedResult(func._filter_args,3));
}
return '_noname_func:'+func.toString(); return '_noname_func:'+func.toString();
} }
return ''; return '';
@ -23122,6 +23197,9 @@
catch(e){ catch(e){
return function(){}; return function(){};
} }
if(Array.isArray(func)){
func=get.filter.apply(this,get.parsedResult(func));
}
return func; return func;
}, },
stringifiedResult:function(item,level){ stringifiedResult:function(item,level){
@ -23683,7 +23761,7 @@
filter:function(filter,i){ filter:function(filter,i){
if(typeof filter=='function') return filter; if(typeof filter=='function') return filter;
if(i==undefined) i=0; if(i==undefined) i=0;
return function(){ var result=function(){
if(filter==arguments[i]) return true; if(filter==arguments[i]) return true;
for(var j in filter){ for(var j in filter){
if(filter.hasOwnProperty(j)){ if(filter.hasOwnProperty(j)){
@ -23742,6 +23820,8 @@
} }
return true; return true;
} }
result._filter_args=[filter,i];
return result;
}, },
cardCount:function(card,player){ cardCount:function(card,player){
var num; var num;

View File

@ -2,7 +2,6 @@ window.noname_update={
version:'1.8.2.9', version:'1.8.2.9',
changeLog:[ changeLog:[
'联机死亡后可退出', '联机死亡后可退出',
'修复双击换肤', 'bug修复换肤、濒死出酒、无懈、自定义模式、木马'
'修复不能出酒的bug'
] ]
} }

View File

@ -62,6 +62,9 @@ table{table-layout: fixed;}
position: relative; position: relative;
transition: all 0.5s; transition: all 0.5s;
} }
#splash>div:hover{
transform: scale(1.02);
}
#splash>div.hidden{ #splash>div.hidden{
transform: translateY(-200px); transform: translateY(-200px);
} }