This commit is contained in:
libccy 2017-03-22 12:08:52 +08:00
parent d524804c9c
commit 43f8367c3f
3 changed files with 110 additions and 141 deletions

View File

@ -25,7 +25,7 @@ character.old={
trigger:{player:'chooseToRespondBegin'}, trigger:{player:'chooseToRespondBegin'},
filter:function(event,player){ filter:function(event,player){
if(event.responded) return false; if(event.responded) return false;
if(!event.filterCard({name:'shan'})&&!!event.filterCard({name:'sha'})) return false; if(!event.filterCard({name:'shan'},player,event)&&!!event.filterCard({name:'sha'},player,event)) return false;
if(player.hasSkill('zhenshan2')) return false; if(player.hasSkill('zhenshan2')) return false;
var nh=player.num('h'); var nh=player.num('h');
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
@ -55,20 +55,64 @@ character.old={
player.swapHandcards(result.targets[0]); player.swapHandcards(result.targets[0]);
} }
}, },
group:['zhenshan_sha','zhenshan_tao','zhenshan_jiu'] group:'zhenshan_use'
}, },
zhenshan2:{}, zhenshan2:{},
zhenshan_sha:{ zhenshan_use:{
enable:'chooseToUse', enable:'chooseToUse',
viewAs:{name:'sha'}, filter:function(event,player){
log:false,
viewAsFilter:function(player){
if(player.hasSkill('zhenshan2')) return false; if(player.hasSkill('zhenshan2')) return false;
var nh=player.num('h'); var nh=player.num('h');
return game.hasPlayer(function(current){ if(!game.hasPlayer(function(current){
return current!=player&&current.num('h')<nh; return current!=player&&current.num('h')<nh;
}); })){
return false;
}
return event.filterCard({name:'sha'},player,event)||
event.filterCard({name:'jiu'},player,event)||
event.filterCard({name:'tao'},player,event);
}, },
chooseButton:{
dialog:function(event,player){
var list=[];
if(event.filterCard({name:'sha'},player,event)){
list.push(['基本','','sha']);
list.push(['基本','','sha','fire']);
list.push(['基本','','sha','thunder']);
}
if(event.filterCard({name:'tao'},player,event)){
list.push(['基本','','tao']);
}
if(event.filterCard({name:'jiu'},player,event)){
list.push(['基本','','jiu']);
}
return ui.create.dialog('振赡',[list,'vcard'],'hidden');
},
check:function(button){
var player=_status.event.player;
var card={name:button.link[2],nature:button.link[3]};
if(card.name=='jiu') return 0;
if(game.hasPlayer(function(current){
return player.canUse(card,current)&&ai.get.effect(current,card,player,player)>0;
})){
if(card.name=='sha'){
if(card.nature=='fire') return 2.95;
else if(card.nature=='fire') return 2.92;
else return 2.9;
}
else if(card.name=='tao'){
return 4;
}
}
return 0;
},
backup:function(links,player){
return {
filterCard:function(){return false},
viewAs:{name:links[0][2],nature:links[0][3]},
selectCard:-1,
popname:true,
log:false,
precontent:function(){ precontent:function(){
'step 0' 'step 0'
player.chooseTarget('选择交换手牌的目标',function(card,player,target){ player.chooseTarget('选择交换手牌的目标',function(card,player,target){
@ -79,65 +123,42 @@ character.old={
player.addTempSkill('zhenshan2','phaseAfter'); player.addTempSkill('zhenshan2','phaseAfter');
'step 1' 'step 1'
if(result.bool){ if(result.bool){
player.logSkill('zhenshan_sha',result.targets); player.logSkill('zhenshan',result.targets);
player.swapHandcards(result.targets[0]); player.swapHandcards(result.targets[0]);
} }
}, },
filterCard:function(card){ }
return false; },
prompt:function(links,player){
return '选择'+get.translation(links[0][3]||'')+get.translation(links[0][2])+'的目标';
}
}, },
selectCard:-1,
ai:{ ai:{
skillTagFilter:function(player,tag,arg){
if(player.hasSkill('zhenshan2')) return false;
var nh=player.num('h');
return game.hasPlayer(function(current){
return current!=player&&current.num('h')<nh;
});
},
order:function(){ order:function(){
var player=_status.event.player; var player=_status.event.player;
var event=_status.event;
var nh=player.num('h'); var nh=player.num('h');
if(game.hasPlayer(function(current){ if(game.hasPlayer(function(current){
return ai.get.attitude(player,current)>0&&current.num('h')<nh; return ai.get.attitude(player,current)>0&&current.num('h')<nh;
})){ })){
if(event.type=='dying'){
if(event.filterCard({name:'tao'},player,event)){
return 0.5;
}
}
else{
if(event.filterCard({name:'tao'},player,event)){
return 4;
}
if(event.filterCard({name:'sha'},player,event)){
return 2.9; return 2.9;
}
}
} }
return 0; return 0;
}, },
save:true,
respondSha:true, respondSha:true,
},
},
zhenshan_tao:{
enable:'chooseToUse',
viewAs:{name:'tao'},
viewAsFilter:function(player){
if(player.hasSkill('zhenshan2')) return false;
var nh=player.num('h');
return game.hasPlayer(function(current){
return current!=player&&current.num('h')<nh;
});
},
log:false,
precontent:function(){
'step 0'
player.chooseTarget('选择交换手牌的目标',function(card,player,target){
return target.num('h')<player.num('h')
},true).ai=function(target){
return ai.get.attitude(player,target);
}
player.addTempSkill('zhenshan2','phaseAfter');
'step 1'
if(result.bool){
player.logSkill('zhenshan_tao',result.targets);
player.swapHandcards(result.targets[0]);
}
},
filterCard:function(card){
return false;
},
selectCard:-1,
ai:{
skillTagFilter:function(player,tag,arg){ skillTagFilter:function(player,tag,arg){
if(player.hasSkill('zhenshan2')) return false; if(player.hasSkill('zhenshan2')) return false;
var nh=player.num('h'); var nh=player.num('h');
@ -145,59 +166,10 @@ character.old={
return current!=player&&current.num('h')<nh; return current!=player&&current.num('h')<nh;
}); });
}, },
order:function(){ result:{
var player=_status.event.player; player:1
var nh=player.num('h');
if(game.hasPlayer(function(current){
return ai.get.attitude(player,current)>0&&current.num('h')<nh;
})){
return _status.event.type=='dying'?0.5:4;
} }
return 0;
},
save:true,
},
},
zhenshan_jiu:{
enable:'chooseToUse',
viewAs:{name:'jiu'},
viewAsFilter:function(player){
if(player.hasSkill('zhenshan2')) return false;
var nh=player.num('h');
return game.hasPlayer(function(current){
return current!=player&&current.num('h')<nh;
});
},
log:false,
precontent:function(){
'step 0'
player.chooseTarget('选择交换手牌的目标',function(card,player,target){
return target.num('h')<player.num('h')
},true).ai=function(target){
return ai.get.attitude(player,target);
} }
player.addTempSkill('zhenshan2','phaseAfter');
'step 1'
if(result.bool){
player.logSkill('zhenshan_jiu',result.targets);
player.swapHandcards(result.targets[0]);
}
},
filterCard:function(card){
return false;
},
selectCard:-1,
ai:{
skillTagFilter:function(player,tag,arg){
if(player.hasSkill('zhenshan2')) return false;
var nh=player.num('h');
return game.hasPlayer(function(current){
return current!=player&&current.num('h')<nh;
});
},
order:0,
save:true,
},
}, },
oldzhenlie:{ oldzhenlie:{
audio:'zhenlie', audio:'zhenlie',
@ -383,10 +355,10 @@ character.old={
old_quancong:'旧全琮', old_quancong:'旧全琮',
zhenshan:'振赡', zhenshan:'振赡',
zhenshan_sha:'赡杀', zhenshan_use:'振赡',
zhenshan_tao:'赡桃', zhenshan_use_backup:'振赡',
zhenshan_jiu:'赡酒',
zhenshan_info:'每名角色的回合限一次,每当你需要使用或打出一张基本牌时,你可以与一名手牌数少于你的角色交换手牌。若如此做,视为你使用或打出了此牌', zhenshan_info:'每名角色的回合限一次,每当你需要使用或打出一张基本牌时,你可以与一名手牌数少于你的角色交换手牌。若如此做,视为你使用或打出了此牌',
zhenshan_use_info:'每名角色的回合限一次,每当你需要使用或打出一张基本牌时,你可以与一名手牌数少于你的角色交换手牌。若如此做,视为你使用或打出了此牌',
oldzhenlie:'贞烈', oldzhenlie:'贞烈',
oldzhenlie_info:'在你的判定牌生效前,你可以亮出牌堆顶的一张牌代替之', oldzhenlie_info:'在你的判定牌生效前,你可以亮出牌堆顶的一张牌代替之',
oldmiji:'秘计', oldmiji:'秘计',

View File

@ -8753,7 +8753,7 @@
next.set('selectButton',info.chooseButton.select||1); next.set('selectButton',info.chooseButton.select||1);
event.buttoned=event.result.skill; event.buttoned=event.result.skill;
} }
else if(info&&info.precontent){ else if(info&&info.precontent&&!game.online){
var next=game.createEvent('pre_'+event.result.skill); var next=game.createEvent('pre_'+event.result.skill);
next.setContent(info.precontent); next.setContent(info.precontent);
next.set('result',event.result); next.set('result',event.result);
@ -10184,10 +10184,10 @@
} }
if(lib.skill[event.skill].log!=false){ if(lib.skill[event.skill].log!=false){
player.logSkill(event.skill); player.logSkill(event.skill);
}
if(get.info(event.skill).popname){ if(get.info(event.skill).popname){
player.popup({name:event.card.name,nature:event.card.nature},'metal'); player.popup({name:event.card.name,nature:event.card.nature},'metal');
} }
}
} }
else if(lib.config.show_card_prompt){ else if(lib.config.show_card_prompt){
if(get.type(event.card)=='equip'&&lib.config.hide_card_prompt_equip); if(get.type(event.card)=='equip'&&lib.config.hide_card_prompt_equip);
@ -10804,8 +10804,8 @@
'step 0' 'step 0'
event.cards1=player.get('h'); event.cards1=player.get('h');
event.cards2=target.get('h'); event.cards2=target.get('h');
target.$giveAuto(event.cards1,player); player.$giveAuto(event.cards1,target);
player.$giveAuto(event.cards2,target); target.$giveAuto(event.cards2,player);
'step 1' 'step 1'
event.cards=event.cards1; event.cards=event.cards1;
var next=player.lose(event.cards,ui.special).set('type','gain'); var next=player.lose(event.cards,ui.special).set('type','gain');
@ -16121,6 +16121,7 @@
return node; return node;
}, },
$giveAuto:function(card,player){ $giveAuto:function(card,player){
if(Array.isArray(card)&&card.length==0) return;
var args=Array.from(arguments); var args=Array.from(arguments);
if(_status.connectMode||(!this.isUnderControl(true)&&!player.isUnderControl(true))){ if(_status.connectMode||(!this.isUnderControl(true)&&!player.isUnderControl(true))){
if(Array.isArray(card)){ if(Array.isArray(card)){

View File

@ -1,6 +1,6 @@
window.noname_update={ window.noname_update={
version:'1.9.12.5', version:'1.9.12.5',
update:'1.9.12.5', update:'1.9.12.4',
changeLog:[ changeLog:[
'bug修复', 'bug修复',
], ],
@ -12,11 +12,7 @@ window.noname_update={
'game/asset.js', 'game/asset.js',
// 'card/standard.js', // 'card/standard.js',
// 'character/*', // 'character/*',
// 'character/xianjian.js', 'character/old.js',
// 'character/ow.js',
// 'character/yxs.js',
// 'character/hearth.js',
// 'character/extra.js',
'character/yijiang.js', 'character/yijiang.js',
// 'mode/boss.js', // 'mode/boss.js',
// 'mode/chess.js', // 'mode/chess.js',