This commit is contained in:
libccy 2017-02-09 18:51:08 +08:00
parent c301b28b50
commit 6709fd635d
6 changed files with 105 additions and 84 deletions

View File

@ -413,58 +413,45 @@ card.hearth={
tanshezhiren:{ tanshezhiren:{
fullskin:true, fullskin:true,
type:'trick', type:'trick',
enable:function(card,player){ enable:true,
if(game.players.length<3) return false;
for(var i=0;i<game.players.length;i++){
if(game.players[i]!=player&&game.players[i].num('h')) return true;
}
return false;
},
chongzhu:true, chongzhu:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
return target.num('h')>0&&target!=player; return target==player;
}, },
selectTarget:-1, selectTarget:-1,
multitarget:true, modTarget:true,
multiline:true,
content:function(){ content:function(){
'step 0' 'step 0'
for(var i=0;i<targets.length;i++){ event.current=target;
if(!targets[i].num('h')) targets.splice(i--,1); event.num=game.players.length;
if(event.num%2==0){
event.num--;
} }
if(targets.contains(player)){
event.current=player;
}
else{
event.current=targets.randomGet();
}
if(!targets.length) event.finish();
event.num=0;
'step 1' 'step 1'
var current; if(event.num){
if(targets.length>1){ var enemies=event.current.getEnemies();
current=targets.randomGet(event.current); for(var i=0;i<enemies.length;i++){
event.current.line(current); if(!enemies[i].num('h')){
} enemies.splice(i--,1);
else{ }
current=targets[0]; }
} if(enemies.length){
var hs=current.get('h'); var enemy=enemies.randomGet();
if(hs.length){ event.current.line(enemy);
current.discard(hs.randomGet()); enemy.discard(enemy.get('h').randomGet());
} event.current=enemy;
if(hs.length>1){ event.num--;
event.current=current;
event.num++;
if(event.num<10){
event.redo(); event.redo();
} }
} }
}, },
ai:{ ai:{
order:8, order:1.5,
wuxie:function(){
return 0;
},
result:{ result:{
target:-1 player:1
}, },
tag:{ tag:{
multineg:1, multineg:1,
@ -689,7 +676,7 @@ card.hearth={
xingjiegoutong:'星界沟通', xingjiegoutong:'星界沟通',
xingjiegoutong_info:'增加一点体力上限并回复一点体力,弃置你的所有手牌', xingjiegoutong_info:'增加一点体力上限并回复一点体力,弃置你的所有手牌',
tanshezhiren:'弹射之刃', tanshezhiren:'弹射之刃',
tanshezhiren_info:'限场存活角色不小于3时使用弃置一名随机角色不含你的手牌重复此过程直到有一名角色失去最后一张手牌最多重复10次', tanshezhiren_info:'出牌阶段对自己使用第一次结算时随机弃置一名使用者的敌人的一张手牌从第二次结算开始每次随机弃置一名上一次被弃牌角色的敌人的一张手牌共结算X次X为存活角色数若X为偶数改为X-1',
chuansongmen:'传送门', chuansongmen:'传送门',
chuansongmen_info:'摸一张牌并展示若发生在出牌阶段你可以立即使用摸到的牌若如此做你将传送门收回手牌每阶段最多收回2张传送门', chuansongmen_info:'摸一张牌并展示若发生在出牌阶段你可以立即使用摸到的牌若如此做你将传送门收回手牌每阶段最多收回2张传送门',
dunpaigedang:'盾牌格挡', dunpaigedang:'盾牌格挡',

View File

@ -75,6 +75,7 @@ card.sp={
chongzhu:function(){ chongzhu:function(){
return game.players.length<=2; return game.players.length<=2;
}, },
singleCard:true,
type:'trick', type:'trick',
selectTarget:2, selectTarget:2,
multitarget:true, multitarget:true,
@ -88,8 +89,8 @@ card.sp={
event.finish(); event.finish();
} }
else{ else{
event.target1=targets[0]; event.target1=target;
event.target2=targets[1]; event.target2=event.addedTarget;
player.chooseCard('h','将一张手牌交给'+get.translation(event.target1),true); player.chooseCard('h','将一张手牌交给'+get.translation(event.target1),true);
} }
'step 1' 'step 1'
@ -598,7 +599,7 @@ card.sp={
du:'毒', du:'毒',
du_info:'当你因使用、打出或弃置而失去此牌时,你失去一点体力', du_info:'当你因使用、打出或弃置而失去此牌时,你失去一点体力',
shengdong:'声东击西', shengdong:'声东击西',
shengdong_info:'出牌阶段,对一名其他角色使用。你交给目标角色一张手牌,若如此做,其将两张牌交给另一名由你选择的其他角色(存活角色不超过2时可重铸', shengdong_info:'出牌阶段,对一名其他角色使用。你交给目标角色一张手牌,若如此做,其将两张牌交给另一名由你选择的其他角色(不足则全给,存活角色不超过2时可重铸',
zengbin:'增兵减灶', zengbin:'增兵减灶',
zengbin_info:'出牌阶段对一名角色使用。目标角色摸三张牌然后选择一项1.弃置一张非基本牌2.弃置两张牌', zengbin_info:'出牌阶段对一名角色使用。目标角色摸三张牌然后选择一项1.弃置一张非基本牌2.弃置两张牌',
caomu:'草木皆兵', caomu:'草木皆兵',

View File

@ -1029,6 +1029,7 @@ card.standard={
type:'trick', type:'trick',
enable:true, enable:true,
selectTarget:2, selectTarget:2,
singleCard:true,
multitarget:true, multitarget:true,
targetprompt:['被借刀','出杀目标'], targetprompt:['被借刀','出杀目标'],
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
@ -1041,12 +1042,12 @@ card.standard={
}, },
content:function(){ content:function(){
"step 0" "step 0"
if(!targets[0].hasSha()){ if(!target.hasSha()){
event.directfalse=true; event.directfalse=true;
} }
else{ else{
targets[0].chooseToUse('对'+get.translation(targets[1])+'使用一张杀,或令'+get.translation(player)+'获得你的武器牌', target.chooseToUse('对'+get.translation(event.addedTarget)+'使用一张杀,或令'+get.translation(player)+'获得你的武器牌',
{name:'sha'},targets[1],-1).set('targetRequired',true); {name:'sha'},event.addedTarget,-1).set('targetRequired',true);
} }
"step 1" "step 1"
if(event.directfalse||result.bool==false){ if(event.directfalse||result.bool==false){

View File

@ -263,27 +263,25 @@ card.yunchou={
}, },
multitarget:true, multitarget:true,
multiline:true, multiline:true,
singleCard:true,
content:function(){ content:function(){
'step 0' 'step 0'
targets[0].chooseToCompare(targets[1]); target.chooseToCompare(event.addedTarget);
'step 1' 'step 1'
if(!result.tie){ if(!result.tie){
if(result.bool){ if(result.bool){
targets[0].gainPlayerCard(targets[1],true); target.gainPlayerCard(event.addedTarget,true);
targets[0].line(targets[1]); target.line(targets[1]);
} }
else{ else{
targets[1].gainPlayerCard(targets[0],true); event.addedTarget.gainPlayerCard(target,true);
targets[1].line(targets[0]); event.addedTarget.line(target);
} }
event.finish(); event.finish();
} }
'step 2' 'step 2'
targets[0].discardPlayerCard(player); target.discardPlayerCard(player);
targets[0].line(player); target.line(player);
'step 3'
targets[1].discardPlayerCard(player);
targets[1].line(player);
}, },
selectTarget:2, selectTarget:2,
ai:{ ai:{
@ -560,6 +558,7 @@ card.yunchou={
fullskin:true, fullskin:true,
type:'trick', type:'trick',
enable:true, enable:true,
singleCard:true,
filterTarget:function(card,player,target){ filterTarget:function(card,player,target){
if(target.isMin()) return false; if(target.isMin()) return false;
if(ui.selected.targets.length){ if(ui.selected.targets.length){
@ -572,9 +571,9 @@ card.yunchou={
selectTarget:2, selectTarget:2,
multitarget:true, multitarget:true,
content:function(){ content:function(){
if(targets[0].get('e','5')){ if(target.get('e','5')){
targets[0].$give(targets[0].get('e','5'),targets[1]); target.$give(target.get('e','5'),event.addedTarget);
targets[1].equip(targets[0].get('e','5')); event.addedTarget.equip(target.get('e','5'));
game.delay(); game.delay();
} }
}, },
@ -671,33 +670,35 @@ card.yunchou={
}, },
selectTarget:2, selectTarget:2,
multitarget:true, multitarget:true,
singleCard:true,
targetprompt:['被拿牌','得牌'], targetprompt:['被拿牌','得牌'],
content:function(){ content:function(){
"step 0" "step 0"
targets[0].addTempSkill('toulianghuanzhu2','phaseAfter'); target.addTempSkill('toulianghuanzhu2','phaseAfter');
var hs=targets[0].get('h'); var hs=target.get('h');
event.num=Math.min(2,hs.length); event.num=Math.min(2,hs.length);
if(event.num){ if(event.num){
targets[1].gain(hs.randomGets(event.num),targets[0]); var gived=hs.randomGets(event.num);
targets[0].$give(event.num,targets[1]); event.addedTarget.gain(gived,target);
target.$giveAuto(gived,event.addedTarget);
game.delay(); game.delay();
} }
else{ else{
event.finish(); event.finish();
} }
"step 1" "step 1"
if(targets[1].num('h')){ if(event.addedTarget.num('h')){
if(_status.auto&&targets[1]==game.me){ if(_status.auto&&event.addedTarget==game.me){
game.delay(); game.delay();
} }
targets[1].chooseCard(true,event.num,'选择'+get.cnNumber(event.num)+'张手牌还给'+get.translation(targets[0])).ai=ai.get.disvalue; event.addedTarget.chooseCard(true,event.num,'选择'+get.cnNumber(event.num)+'张手牌还给'+get.translation(target)).ai=ai.get.disvalue;
} }
else{ else{
event.finish(); event.finish();
} }
"step 2" "step 2"
targets[0].gain(result.cards,targets[1]); target.gain(result.cards,event.addedTarget);
targets[1].$give(event.num,targets[0]); event.addedTarget.$give(event.num,target);
}, },
ai:{ ai:{
order:6.5, order:6.5,
@ -1220,12 +1221,12 @@ card.yunchou={
suolianjia_info:'锁定技,你防止即将受到的属性伤害,当装备时进入连环状态,当卸下时解除连环状态', suolianjia_info:'锁定技,你防止即将受到的属性伤害,当装备时进入连环状态,当卸下时解除连环状态',
suolianjia_bg:'链', suolianjia_bg:'链',
geanguanhuo:'隔岸观火', geanguanhuo:'隔岸观火',
geanguanhuo_info:'出牌阶段对两名其他角色使用,令目标拼点,赢的角色获得另一方的一张牌;若点数相同,两名目标可分别弃置你一张牌', geanguanhuo_info:'出牌阶段对一名其他角色使用,令目标与一名你指定的另一名角色拼点,赢的角色获得对方的一张牌;若点数相同,目标可弃置你一张牌',
toulianghuanzhu:'偷梁换柱', toulianghuanzhu:'偷梁换柱',
toulianghuanzhu_info:'令一名角色获得另一名角色的两张手牌,然后还回两张手牌', toulianghuanzhu_info:'出牌阶段对一名有手牌的角色使用,选择另一名角色获得目标两张手牌(不足则全拿),然后还给其等量手牌',
toulianghuanzhu_bg:'柱', toulianghuanzhu_bg:'柱',
yihuajiemu:'移花接木', yihuajiemu:'移花接木',
yihuajiemu_info:'将一名角色的宝物牌转移至另一名角色', yihuajiemu_info:'对一名装备区内有宝物的角色使用,将其宝物牌转移至另一名角色',
fudichouxin:'釜底抽薪', fudichouxin:'釜底抽薪',
fudichouxin_info:'与一名角色进行拼点,若成功则获得双方拼点牌', fudichouxin_info:'与一名角色进行拼点,若成功则获得双方拼点牌',
shuiyanqijun:'水攻', shuiyanqijun:'水攻',

View File

@ -4578,7 +4578,7 @@ character.yijiang={
position:'he', position:'he',
filterCard:true, filterCard:true,
selectCard:2, selectCard:2,
prompt:'弃置任意张牌并摸等量的牌', prompt:'弃置两张牌并摸一张牌',
check:function(card){return 4-ai.get.useful(card)}, check:function(card){return 4-ai.get.useful(card)},
content:function(){ content:function(){
player.draw(); player.draw();
@ -6002,9 +6002,8 @@ character.yijiang={
} }
} }
if(cards.length){ if(cards.length){
player.gain(cards); player.gain(cards,'log');
player.$gain2(cards); player.$gain2(cards);
game.log(player,'发动','【落英】',',获得了',cards);
} }
}, },
}, },
@ -6021,7 +6020,7 @@ character.yijiang={
return (get.suit(event.result.card)=='club'); return (get.suit(event.result.card)=='club');
}, },
content:function(){ content:function(){
player.gain(trigger.result.card); player.gain(trigger.result.card,'log');
player.$gain2(trigger.result.card); player.$gain2(trigger.result.card);
} }
}, },

View File

@ -5802,7 +5802,7 @@
game.reload(); game.reload();
}, },
uj:function(){ uj:function(){
cheat.ge('qilin'); cheat.e('qilin');
game.me.next.useCard({name:'jiedao'},[game.me,game.me.previous]); game.me.next.useCard({name:'jiedao'},[game.me,game.me.previous]);
}, },
u:function(){ u:function(){
@ -8297,7 +8297,10 @@
(card.classList&&card.classList.contains('thunder'))){ (card.classList&&card.classList.contains('thunder'))){
config.color='thunder'; config.color='thunder';
} }
if(get.info(card).multitarget&&targets.length>1&&!get.info(card).multiline){ if(event.addedTarget){
player.line2(targets.concat(event.addedTargets),config);
}
else if(get.info(card).multitarget&&targets.length>1&&!get.info(card).multiline){
player.line2(targets,config); player.line2(targets,config);
} }
else{ else{
@ -8337,10 +8340,20 @@
} }
str+='使用了'; str+='使用了';
if(cards.length&&(cards.length>1||cards[0]!=card)){ if(cards.length&&(cards.length>1||cards[0]!=card)){
game.log(player,str,card,'',cards,''); if(event.addedTarget){
game.log(player,str,card,'',cards,',指向',event.addedTargets,'');
}
else{
game.log(player,str,card,'',cards,'');
}
} }
else{ else{
game.log(player,str,card); if(event.addedTarget){
game.log(player,str,card,'(指向',event.addedTargets,'');
}
else{
game.log(player,str,card);
}
} }
if(card.name=='wuxie'){ if(card.name=='wuxie'){
game.logv(player,[card,cards],[event.getTrigger().card]); game.logv(player,[card,cards],[event.getTrigger().card]);
@ -8409,6 +8422,10 @@
next.skill=event.skill; next.skill=event.skill;
next.multitarget=info.multitarget; next.multitarget=info.multitarget;
next.preResult=event.preResult; next.preResult=event.preResult;
if(event.addedTargets){
next.addedTargets=event.addedTargets;
next.addedTarget=event.addedTarget;
}
if(info.targetDelay===false){ if(info.targetDelay===false){
event.targetDelay=false; event.targetDelay=false;
} }
@ -11226,9 +11243,21 @@
if(!next.targets){ if(!next.targets){
next.targets=[]; next.targets=[];
} }
if(next.card&&get.info(next.card)&&get.info(next.card).changeTarget){ if(next.card){
get.info(next.card).changeTarget(next.player,next.targets); var info=get.info(next.card);
} if(info){
if(info.changeTarget){
info.changeTarget(next.player,next.targets);
}
if(info.singleCard){
next.target=next.targets[0];
next.addedTargets=next.targets.splice(1);
if(next.addedTargets.length){
next.addedTarget=next.addedTargets[0];
}
}
}
}
for(var i=0;i<next.targets.length;i++){ for(var i=0;i<next.targets.length;i++){
if(ai.get.attitude(this,next.targets[i])>=-1&&ai.get.attitude(this,next.targets[i])<0){ if(ai.get.attitude(this,next.targets[i])>=-1&&ai.get.attitude(this,next.targets[i])<0){
if(!this.ai.tempIgnore) this.ai.tempIgnore=[]; if(!this.ai.tempIgnore) this.ai.tempIgnore=[];
@ -15437,11 +15466,14 @@
}, },
targetEnabled:function(card,player,target){ targetEnabled:function(card,player,target){
if(card==undefined) return false; if(card==undefined) return false;
var filter=get.info(card).filterTarget; var info=get.info(card);
var filter=info.filterTarget;
var mod=game.checkMod(card,player,target,'unchanged','playerEnabled',player.get('s')); var mod=game.checkMod(card,player,target,'unchanged','playerEnabled',player.get('s'));
if(mod==false) return false; if(mod==false) return false;
var mod=game.checkMod(card,player,target,'unchanged','targetEnabled',target.get('s')); if(!info.singleCard||ui.selected.targets.length==0){
if(mod!='unchanged') return mod; var mod=game.checkMod(card,player,target,'unchanged','targetEnabled',target.get('s'));
if(mod!='unchanged') return mod;
}
if(typeof filter=='boolean') return filter; if(typeof filter=='boolean') return filter;
if(typeof filter=='function') return filter(card,player,target); if(typeof filter=='function') return filter(card,player,target);
}, },