This commit is contained in:
libccy 2017-03-01 12:48:42 +08:00
parent d240be3f25
commit c129a6e3fe
5 changed files with 64 additions and 71 deletions

View File

@ -175,6 +175,7 @@ character.hearth={
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
return game.hasPlayer(function(current){ return game.hasPlayer(function(current){
if(current==player) return false;
var nh=current.num('h'); var nh=current.num('h');
return nh&&nh>=player.num('h'); return nh&&nh>=player.num('h');
}); });
@ -182,6 +183,7 @@ character.hearth={
content:function(){ content:function(){
'step 0' 'step 0'
player.chooseTarget(get.prompt('kuixin'),function(card,player,target){ player.chooseTarget(get.prompt('kuixin'),function(card,player,target){
if(target==player) return false;
var nh=target.num('h'); var nh=target.num('h');
return nh&&nh>=player.num('h'); return nh&&nh>=player.num('h');
}).ai=function(target){ }).ai=function(target){

View File

@ -52,21 +52,8 @@ character.old={
} }
player.logSkill('zhenshan',result.targets); player.logSkill('zhenshan',result.targets);
player.addTempSkill('zhenshan2','phaseAfter'); player.addTempSkill('zhenshan2','phaseAfter');
event.target=result.targets[0]; player.swapHandcards(result.targets[0]);
event.cards0=player.get('h');
event.cards1=event.target.get('h');
player.lose(event.cards0,ui.special);
event.target.lose(event.cards1,ui.special);
} }
else{
event.finish();
}
"step 2"
player.gain(event.cards1,event.target);
event.target.gain(event.cards0,player);
player.$give(event.cards0.length,event.target);
event.target.$give(event.cards1.length,player);
game.delay();
}, },
group:['zhenshan_sha','zhenshan_tao','zhenshan_jiu'] group:['zhenshan_sha','zhenshan_tao','zhenshan_jiu']
}, },
@ -93,20 +80,8 @@ character.old={
'step 1' 'step 1'
if(result.bool){ if(result.bool){
player.logSkill('zhenshan_sha',result.targets); player.logSkill('zhenshan_sha',result.targets);
event.target=result.targets[0]; player.swapHandcards(result.targets[0]);
event.cards0=player.get('h');
event.cards1=event.target.get('h');
player.lose(event.cards0,ui.special);
event.target.lose(event.cards1,ui.special);
} }
else{
event.finish();
}
'step 2'
player.gain(event.cards1,event.target);
event.target.gain(event.cards0,player);
player.$give(event.cards0.length,event.target);
event.target.$give(event.cards1.length,player);
}, },
filterCard:function(card){ filterCard:function(card){
return false; return false;
@ -155,20 +130,8 @@ character.old={
'step 1' 'step 1'
if(result.bool){ if(result.bool){
player.logSkill('zhenshan_tao',result.targets); player.logSkill('zhenshan_tao',result.targets);
event.target=result.targets[0]; player.swapHandcards(result.targets[0]);
event.cards0=player.get('h');
event.cards1=event.target.get('h');
player.lose(event.cards0,ui.special);
event.target.lose(event.cards1,ui.special);
} }
else{
event.finish();
}
'step 2'
player.gain(event.cards1,event.target);
event.target.gain(event.cards0,player);
player.$give(event.cards0.length,event.target);
event.target.$give(event.cards1.length,player);
}, },
filterCard:function(card){ filterCard:function(card){
return false; return false;
@ -217,20 +180,8 @@ character.old={
'step 1' 'step 1'
if(result.bool){ if(result.bool){
player.logSkill('zhenshan_jiu',result.targets); player.logSkill('zhenshan_jiu',result.targets);
event.target=result.targets[0]; player.swapHandcards(result.targets[0]);
event.cards0=player.get('h');
event.cards1=event.target.get('h');
player.lose(event.cards0,ui.special);
event.target.lose(event.cards1,ui.special);
} }
else{
event.finish();
}
'step 2'
player.gain(event.cards1,event.target);
event.target.gain(event.cards0,player);
player.$give(event.cards0.length,event.target);
event.target.$give(event.cards1.length,player);
}, },
filterCard:function(card){ filterCard:function(card){
return false; return false;

View File

@ -2146,16 +2146,7 @@ character.shenhua={
multitarget:true, multitarget:true,
multiline:true, multiline:true,
content:function(){ content:function(){
'step 0' targets[0].swapHandcards(targets[1]);
event.cards0=targets[0].get('h');
event.cards1=targets[1].get('h');
targets[0].lose(event.cards0,ui.special);
targets[1].lose(event.cards1,ui.special);
'step 1'
targets[0].gain(event.cards1,targets[1]);
targets[1].gain(event.cards0,targets[0]);
targets[0].$give(event.cards0.length,targets[1]);
targets[1].$give(event.cards1.length,targets[0]);
}, },
check:function(card){ check:function(card){
var list=[],player=_status.event.player; var list=[],player=_status.event.player;

View File

@ -41,7 +41,7 @@ character.yxs={
yxs_zhangsanfeng:['male','wei',4,['zbudao','taiji']], yxs_zhangsanfeng:['male','wei',4,['zbudao','taiji']],
yxs_nandinggeer:['female','shu',3,['huli','xianqu','yixin']], yxs_nandinggeer:['female','shu',3,['huli','xianqu','yixin']],
yxs_weizhongxian:['male','qun',3,['zhuxin','wlianhuan']], yxs_weizhongxian:['male','qun',3,['zhuxin','wlianhuan']],
// yxs_meixi:['female','shu',3,['liebo','yaoji']], yxs_meixi:['female','shu',3,['liebo','yaoji']],
// yxs_lanlinwang:['male','shu',4,['guimian','yuxue']], // yxs_lanlinwang:['male','shu',4,['guimian','yuxue']],
}, },
characterIntro:{ characterIntro:{
@ -89,6 +89,22 @@ character.yxs={
yxs_lanlinwang:'高长恭541年―573年又名高孝瓘、高肃祖籍渤海调蓨今河北省景县神武帝高欢之孙文襄帝高澄第四子生母不详南北朝时期北齐宗室、将领封爵兰陵郡王。高长恭貌柔心壮音容兼美。为将躬勤细事每得甘美虽一瓜数果必与将士分享。累次升任至并州刺史。突厥攻入晋阳高长恭奋力将其击退。邙山之战高长恭为中军率领五百骑兵再入周军包围圈直至金墉城下因高长恭戴着头盔城中的人不确定是敌军或是我军直到高长恭把头盔脱下来城上的人才知道是高长恭派弓箭手开始放箭保护他之后高长恭成功替金墉解围高长恭在此次战中威名大振士兵们为此战而讴歌他即后来知名的《兰陵王入阵曲》。', yxs_lanlinwang:'高长恭541年―573年又名高孝瓘、高肃祖籍渤海调蓨今河北省景县神武帝高欢之孙文襄帝高澄第四子生母不详南北朝时期北齐宗室、将领封爵兰陵郡王。高长恭貌柔心壮音容兼美。为将躬勤细事每得甘美虽一瓜数果必与将士分享。累次升任至并州刺史。突厥攻入晋阳高长恭奋力将其击退。邙山之战高长恭为中军率领五百骑兵再入周军包围圈直至金墉城下因高长恭戴着头盔城中的人不确定是敌军或是我军直到高长恭把头盔脱下来城上的人才知道是高长恭派弓箭手开始放箭保护他之后高长恭成功替金墉解围高长恭在此次战中威名大振士兵们为此战而讴歌他即后来知名的《兰陵王入阵曲》。',
}, },
skill:{ skill:{
yaoji:{
trigger:{player:'damageEnd'},
filter:function(event,player){
return event.source&&event.source.isIn()&&event.source!=player&&!event.source.hasJudge('lebu');
},
check:function(event,player){
return ai.get.attitude(player,event.source)<=0;
},
logTarget:'source',
content:function(){
var card=game.createCard('lebu');
trigger.source.addJudge(card);
trigger.source.$draw(card);
game.delay();
}
},
liebo:{ liebo:{
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
@ -96,12 +112,7 @@ character.yxs={
return Math.abs(target.num('h')-player.num('h'))<=1; return Math.abs(target.num('h')-player.num('h'))<=1;
}, },
content:function(){ content:function(){
var cards0=target.get('h'); player.swapHandcards(target);
var cards1=player.get('h');
target.gain(cards1,player);
player.gain(cards0,target);
target.$giveAuto(cards0,player);
player.$giveAuto(cards1,target);
}, },
ai:{ ai:{
order:function(){ order:function(){

View File

@ -9272,6 +9272,36 @@
event.trigger('respond'); event.trigger('respond');
game.delayx(0.5); game.delayx(0.5);
}, },
swapHandcards:function(){
'step 0'
event.cards1=player.get('h');
event.cards2=target.get('h');
target.$giveAuto(event.cards1,player);
player.$giveAuto(event.cards2,target);
'step 1'
event.cards=event.cards1;
var next=player.lose(event.cards,ui.special).set('type','gain');
if(player==game.me){
event.delayed=true;
}
else{
next.delay=false;
}
'step 1'
event.cards=event.cards2;
var next=target.lose(event.cards,ui.special).set('type','gain');
if(target==game.me){
event.delayed=true;
}
else{
next.delay=false;
}
'step 2'
if(!event.delayed) game.delay();
'step 3'
player.gain(event.cards2,target);
target.gain(event.cards1,player);
},
gain:function(){ gain:function(){
"step 0" "step 0"
if(cards){ if(cards){
@ -11970,6 +12000,14 @@
} }
} }
next.setContent('respond'); next.setContent('respond');
return next;
},
swapHandcards:function(target){
var next=game.createEvent('swapHandcards',false);
next.player=this;
next.target=target;
next.setContent('swapHandcards');
return next;
}, },
directgain:function(cards){ directgain:function(cards){
var hs=this.get('h'); var hs=this.get('h');
@ -12007,7 +12045,7 @@
var current=targets[i]; var current=targets[i];
var card=current.get(position||'h').randomGet(); var card=current.get(position||'h').randomGet();
if(!card) continue; if(!card) continue;
if(current==game.me){ if(current==game.me||current.isOnline()){
this.gain(card,current); this.gain(card,current);
delayed=true; delayed=true;
} }