This commit is contained in:
libccy 2017-01-14 02:51:13 +08:00
parent 5039c3af95
commit e981cd782d
23 changed files with 226 additions and 126 deletions

View File

@ -785,7 +785,7 @@ card.guozhan={
// delay:0.5,
content:function(){
"step 0"
target.gain(cards);
target.gain(cards,player);
"step 1"
if(!target.isUnseen()){
player.draw();

View File

@ -70,7 +70,7 @@ card.sp={
}
'step 1'
player.$give(1,event.target1);
event.target1.gain(result.cards);
event.target1.gain(result.cards,player);
'step 2'
if(!event.target1.num('h')){
event.finish();
@ -89,7 +89,7 @@ card.sp={
event.directresult=result.cards;
}
event.target1.$give(event.directresult.length,event.target2);
event.target2.gain(event.directresult);
event.target2.gain(event.directresult,event.target1);
},
ai:{
order:2.5,

View File

@ -996,7 +996,7 @@ card.standard={
{name:'sha'},targets[1],-1).set('targetRequired',true);
"step 1"
if(result.bool==false){
player.gain(targets[0].get('e',{subtype:'equip1'}));
player.gain(targets[0].get('e',{subtype:'equip1'}),targets[0]);
targets[0].$give(targets[0].get('e',{subtype:'equip1'}),player);
}
},

View File

@ -2188,7 +2188,7 @@ card.swd={
filterTarget:function(card,player,target){
return player!=target&&target.hp>=player.hp;
},
filterCard:function(card){
filterCard:function(card,player){
return get.color(card)=='red'&&lib.filter.cardDiscardable(card,player);
},
ai1:function(card){
@ -3850,7 +3850,7 @@ card.swd={
});
"step 1"
if(result.bool){
player.gain(target.get('h').randomGet());
player.gain(target.get('h').randomGet(),target);
target.$give(1,player);
}
},
@ -4027,7 +4027,7 @@ card.swd={
},
content:function(){
target.damage();
target.gain(cards);
target.gain(cards,player);
game.delay();
},
check:function(card){

View File

@ -196,7 +196,7 @@ card.yunchou={
var hs=targets[0].get('h');
event.num=Math.min(2,hs.length);
if(event.num){
targets[1].gain(hs.randomGets(event.num));
targets[1].gain(hs.randomGets(event.num),targets[0]);
targets[0].$give(event.num,targets[1]);
game.delay();
}
@ -214,7 +214,7 @@ card.yunchou={
event.finish();
}
"step 2"
targets[0].gain(result.cards);
targets[0].gain(result.cards,targets[1]);
targets[1].$give(event.num,targets[0]);
},
ai:{

View File

@ -553,7 +553,7 @@ character.extra={
var hej=event.targets[num].get('hej')
if(hej.length){
var card=hej.randomGet();
player.gain(card);
player.gain(card,event.targets[num]);
if(get.position(card)=='h'){
event.targets[num].$give(1,player);
}

View File

@ -197,7 +197,7 @@ character.gujian={
};
"step 1"
if(result.bool){
player.gain(result.cards[0]);
player.gain(result.cards[0],trigger.source);
trigger.source.$give(1,player);
}
},
@ -492,8 +492,8 @@ character.gujian={
filterTarget:function(card,player,target){
return player!=target;
},
filterCard:function(card){
return get.color(card)=='red';
filterCard:function(card,player){
return get.color(card)=='red'&&lib.filter.cardDiscardable(card,player);
},
ai1:function(card){
return 9-ai.get.value(card);

View File

@ -207,7 +207,7 @@ character.hearth={
content:function(){
var card=trigger.source.get('h').randomGet();
if(card){
player.gain(card);
player.gain(card,trigger.source);
if(get.color(card)=='black'){
trigger.source.$give(card,player);
event.redo();
@ -2837,8 +2837,8 @@ character.hearth={
player.logSkill('kuixin',result.targets);
var cards0=target.get('h');
var cards1=player.get('h');
target.gain(cards1);
player.gain(cards0);
target.gain(cards1,player);
player.gain(cards0,target);
target.$give(cards0.length,player);
player.$give(cards1.length,target);
}
@ -3146,7 +3146,7 @@ character.hearth={
if(result.bool){
player.logSkill('shijie',result.targets);
var target=result.targets[0];
player.gain(target.get('h').randomGet());
player.gain(target.get('h').randomGet(),target);
event.target=target;
target.$give(1,player);
game.delay();

View File

@ -1968,7 +1968,9 @@ character.ow={
var next=player.chooseCardTarget({
prompt:get.prompt('yihun'),
position:'he',
filterCard:{suit:'spade'},
filterCard:function(card,player){
return get.suit(card)=='spade'&&lib.filter.cardDiscardable(card,player);
},
ai1:function(card){
return 7-ai.get.value(card);
},

View File

@ -71,7 +71,7 @@ character.refresh={
player.storage.rerende2=[];
}
player.storage.rerende2.push(target);
target.gain(cards);
target.gain(cards,player);
game.delay();
if(typeof player.storage.rerende!='number'){
player.storage.rerende=0;
@ -368,7 +368,7 @@ character.refresh={
"step 2"
if(result.bool){
player.logSkill('refankui',trigger.source);
player.gain(result.links[0]);
player.gain(result.links[0],trigger.source);
trigger.source.$give(1,player);
event.goto(1);
}
@ -511,7 +511,7 @@ character.refresh={
if(result.bool){
player.storage.qingjian++;
player.logSkill('qingjian',result.targets);
result.targets[0].gain(result.cards);
result.targets[0].gain(result.cards,player);
player.$give(result.cards.length,result.targets[0]);
for(var i=0;i<result.cards.length;i++){
event.cards.remove(result.cards[i]);
@ -561,7 +561,7 @@ character.refresh={
content:function(){
"step 0"
target.storage.refanjian=cards[0];
target.gain(cards[0]);
target.gain(cards[0],player);
"step 1"
target.chooseControl('refanjian_card','refanjian_hp').ai=function(event,player){
var cards=player.get('he',{suit:get.suit(player.storage.refanjian)});
@ -1171,7 +1171,7 @@ character.refresh={
"step 2"
if(get.position(card)=='d'){
if(get.subtype(card)=='equip3'||get.subtype(card)=='equip4'){
player.gain(card);
player.gain(card,trigger.player);
player.$gain2(card);
}
}

View File

@ -478,7 +478,7 @@ character.shenhua={
return target.num('h')>0;
},
selectTarget:[0,2],
filterCard:true,
filterCard:lib.filter.cardDiscardable,
prompt:'是否发动巧变跳过摸牌阶段?',
check:check,
target:target
@ -581,7 +581,7 @@ character.shenhua={
}
},
selectTarget:2,
filterCard:true,
filterCard:lib.filter.cardDiscardable,
prompt:'是否发动巧变跳过出牌阶段?',
targetprompt:['被移走','移动目标'],
check:check,
@ -1788,7 +1788,7 @@ character.shenhua={
}).set('temp',temp);
"step 1"
if(result.targets&&result.targets[0]){
result.targets[0].gain(result.cards);
result.targets[0].gain(result.cards,player);
player.$give(result.cards.length,result.targets[0]);
}
}
@ -1818,8 +1818,8 @@ character.shenhua={
targets[0].lose(event.cards0,ui.special);
targets[1].lose(event.cards1,ui.special);
'step 1'
targets[0].gain(event.cards1);
targets[1].gain(event.cards0);
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]);
},
@ -2867,8 +2867,8 @@ character.shenhua={
var check=player.num('h')<=player.hp;
player.chooseCardTarget({
prompt:get.prompt('shensu'),
filterCard:function(card){
return get.type(card)=='equip'
filterCard:function(card,player){
return get.type(card)=='equip'&&lib.filter.cardDiscardable(card,player)
},
position:'he',
filterTarget:function(card,player,target){
@ -2953,8 +2953,8 @@ character.shenhua={
content:function(){
"step 0"
player.chooseCardTarget({
filterCard:function(card){
return get.suit(card)=='heart';
filterCard:function(card,player){
return get.suit(card)=='heart'&&lib.filter.cardDiscardable(card,player);
},
filterTarget:function(card,player,target){
return player!=target;
@ -3308,7 +3308,7 @@ character.shenhua={
usable:1,
forceaudio:true,
content:function(){
target.gain(cards);
target.gain(cards,player);
},
ai:{
expose:0.3,

View File

@ -97,13 +97,73 @@ character.sp={
madai:['mayunlu'],
chengpu:['zhouyu'],
hanba:['swd_muyun'],
dongbai:['dongzhuo']
},
skill:{
xiehui:{
mod:{
cardDiscardable:function(card,player){
return get.color(card)=='red';
maxHandcard:function(player,num){
var hs=player.get('h');
for(var i=0;i<hs.length;i++){
if(get.color(hs[i])=='black'){
num++;
}
}
return num;
},
},
trigger:{global:'gainBegin'},
forced:true,
popup:false,
filter:function(event,player){
if(event.player!=player&&event.cards&&event.cards[0]&&get.owner(event.cards[0])==player){
for(var i=0;i<event.cards.length;i++){
if(get.color(event.cards[i])=='black') return true;
}
}
return false;
},
content:function(){
trigger.player.addSkill('xiehui2');
if(!trigger.player.storage.xiehui2){
trigger.player.storage.xiehui2=[];
}
}
},
xiehui2:{
mark:true,
intro:{
content:'cards'
},
mod:{
cardDiscardable:function(card,player){
if(player.storage.xiehui2&&player.storage.xiehui2.contains(card)) return false;
},
cardEnabled:function(card,player){
if(player.storage.xiehui2&&player.storage.xiehui2.contains(card)) return false;
},
cardUsable:function(card,player){
if(player.storage.xiehui2&&player.storage.xiehui2.contains(card)) return false;
},
cardRespondable:function(card,player){
if(player.storage.xiehui2&&player.storage.xiehui2.contains(card)) return false;
},
cardSavable:function(card,player){
if(player.storage.xiehui2&&player.storage.xiehui2.contains(card)) return false;
},
},
group:'xiehui3'
},
xiehui3:{
trigger:{player:'changeHp'},
forced:true,
popup:false,
filter:function(event){
return event.num<0;
},
content:function(){
player.removeSkill('xiehui2');
delete player.storage.xiehui2;
}
},
shanjia:{
@ -314,7 +374,7 @@ character.sp={
content:function(){
player.storage.shichou=true;
player.unmarkSkill('shichou');
target.gain(cards);
target.gain(cards,player);
player.storage.shichou_target=target;
player.addSkill('shichou2');
target.markSkillCharacter('shichou',player,'誓仇','代替'+get.translation(player)+'承受伤害直到首次进入濒死状态');
@ -576,7 +636,7 @@ character.sp={
}
else{
var es=target.get('e');
player.gain(es);
player.gain(es,target);
target.$give(es,player);
}
'step 3'
@ -667,7 +727,7 @@ character.sp={
return 0;
},
content:function(){
target.gain(cards);
target.gain(cards,player);
target.recover();
game.delay();
},
@ -833,7 +893,7 @@ character.sp={
'step 0'
player.unmark('jianshu');
player.storage.jianshu=true;
targets[0].gain(cards);
targets[0].gain(cards,player);
'step 1'
targets[0].chooseToCompare(targets[1]);
'step 2'
@ -2394,8 +2454,8 @@ character.sp={
content:function(){
"step 0"
player.chooseCardTarget({
filterCard:function(card){
return get.suit(card)=='heart';
filterCard:function(card,player){
return get.suit(card)=='heart'&&lib.filter.cardDiscardable(card,player);
},
filterTarget:function(card,player,target){
return player!=target;
@ -2485,6 +2545,7 @@ character.sp={
"step 0"
var next=player.chooseCardTarget({
position:'he',
filterCard:lib.filter.cardDiscardable,
filterTarget:function(card,player,target){
var trigger=_status.event.getTrigger();
if(get.distance(player,target,'attack')<=1&&
@ -3354,8 +3415,8 @@ character.sp={
var check=player.num('h')<=player.hp;
player.chooseCardTarget({
prompt:get.prompt('qingyi'),
filterCard:function(card){
return get.type(card)=='equip'
filterCard:function(card,player){
return get.type(card)=='equip'&&lib.filter.cardDiscardable(card,player);
},
position:'he',
filterTarget:function(card,player,target){
@ -4541,7 +4602,7 @@ character.sp={
content:function(){
"step 0"
player.chooseCardTarget({
filterCard:true,
filterCard:lib.filter.cardDiscardable,
filterTarget:function(card,player,target){
var trigger=_status.event.getTrigger();
return lib.filter.targetEnabled(trigger.card,player,target)&&target!=trigger.targets[0];
@ -4814,7 +4875,7 @@ character.sp={
event.finish();
}
"step 1"
trigger.target.gain(result.cards);
trigger.target.gain(result.cards,player);
player.$give(result.cards,trigger.target);
game.delay();
event.card=result.cards[0];
@ -5312,7 +5373,7 @@ character.sp={
"step 0"
player.unmarkSkill('cunsi');
var cards=player.get('h');
target.gain(cards);
target.gain(cards,player);
player.$give(cards.length,target);
player.storage.cunsi=true;
game.delay();
@ -5646,7 +5707,7 @@ character.sp={
}
"step 1"
var cards=player.get('h');
target.gain(cards);
target.gain(cards,player);
event.num=cards.length;
player.$give(event.num,target);
game.delay();
@ -5654,7 +5715,7 @@ character.sp={
target.chooseCard('选择还给'+get.translation(player)+'的牌',true,event.num);
game.delay(0.2);
"step 3"
player.gain(result.cards);
player.gain(result.cards,target);
target.$give(result.cards.length,player);
game.delay();
}
@ -6292,7 +6353,7 @@ character.sp={
}
"step 1"
if(result.bool&&!event.directfalse){
player.storage.bifa[1].gain(result.cards);
player.storage.bifa[1].gain(result.cards,player);
player.$give(result.cards,player.storage.bifa[1]);
player.gain(player.storage.bifa[0],'draw2');
}
@ -6431,7 +6492,7 @@ character.sp={
return event.target.num('h')>0;
},
content:function(){
player.gain(trigger.target.get('h').randomGet());
player.gain(trigger.target.get('h').randomGet(),trigger.target);
trigger.target.$give(1,player);
game.delay();
}
@ -6444,7 +6505,7 @@ character.sp={
return event.source&&event.source.num('h')>0;
},
content:function(){
player.gain(trigger.source.get('h').randomGet());
player.gain(trigger.source.get('h').randomGet(),trigger.source);
trigger.source.$give(1,player);
game.delay();
}
@ -6459,7 +6520,7 @@ character.sp={
filterCard:true,
position:'he',
content:function(){
player.gain(target.get('h'));
player.gain(target.get('h'),target);
target.$give(target.num('h'),player);
player.turnOver();
player.addSkill('lihun2');
@ -6501,7 +6562,7 @@ character.sp={
player.chooseCard('he',true,player.storage.lihun.hp);
}
"step 1"
player.storage.lihun.gain(result.cards);
player.storage.lihun.gain(result.cards,player);
player.$give(result.cards.length,player.storage.lihun);
}
},
@ -6635,7 +6696,7 @@ character.sp={
return player!=target;
},
discard:false,
prepare:'give',
prepare:'give2',
ai:{
order:1,
result:{
@ -6659,7 +6720,7 @@ character.sp={
content:function(){
"step 0"
event.target1=targets[0];
targets[0].gain(cards);
targets[0].gain(cards,player);
game.delay();
for(var i=0;i<game.players.length;i++){
if(game.players[i].num('h')&&game.players[i]!=event.target1&&game.players[i]!=player){
@ -6953,6 +7014,11 @@ character.sp={
sp_liubei:'sp刘备',
caochun:'曹纯',
xiehui:'黠慧',
xiehui2:'黠慧',
xiehui_info:'锁定技,你的黑色牌不占用手牌上限;其他角色获得你的黑色牌时,其不能使用、打出、弃置这些牌直到其体力值减少为止',
lianzhu:'连诛',
lianzhu_info:'出牌阶段限一次你可以展示并交给一名其他角色一张牌若该牌为黑色其选择一项1.你摸两张牌2.弃置两张牌',
zhaolie:'昭烈',
zhaolie_info:'摸牌阶段摸牌时你可以少摸一张指定你攻击范围内的一名角色亮出牌堆顶上3张牌将其中的非基本牌和【桃】置于弃牌堆该角色进行二选一你对其造成X点伤害然后他获得这些基本牌或他弃置X张牌然后你获得这些基本牌。X为其中非基本牌的数量',
shichou:'誓仇',

View File

@ -132,7 +132,7 @@ character.standard={
"step 1"
if(result.bool){
player.logSkill('fankui',trigger.source);
player.gain(result.links[0]);
player.gain(result.links[0],trigger.source);
trigger.source.$give(1,player);
}
},
@ -270,7 +270,7 @@ character.standard={
if(result.bool){
player.logSkill('tuxi',result.targets);
for(var i=0;i<result.targets.length;i++){
player.gain(result.targets[i].get('h').randomGet());
player.gain(result.targets[i].get('h').randomGet(),result.targets[i]);
result.targets[i].$give(1,player);
}
trigger.finish();
@ -371,7 +371,7 @@ character.standard={
"step 3"
if(result.bool){
player.line(result.targets,'green');
result.targets[0].gain(result.cards);
result.targets[0].gain(result.cards,player);
player.$give(result.cards.length,result.targets[0]);
for(var i=0;i<result.cards.length;i++){
event.cards.remove(result.cards[i]);
@ -501,7 +501,7 @@ character.standard={
return 10-ai.get.value(card);
},
content:function(){
target.gain(cards);
target.gain(cards,player);
game.delay();
if(typeof player.storage.rende!='number'){
player.storage.rende=0;
@ -1185,7 +1185,7 @@ character.standard={
event.choice=result.control;
target.popup(event.choice);
event.card=player.get('h').randomGet();
target.gain(event.card);
target.gain(event.card,player);
player.$give(event.card,target);
game.delay();
"step 2"
@ -1245,6 +1245,7 @@ character.standard={
"step 0"
var next=player.chooseCardTarget({
position:'he',
filterCard:lib.filter.cardDiscardable,
filterTarget:function(card,player,target){
var trigger=_status.event.getTrigger();
if(get.distance(player,target,'attack')<=1&&

View File

@ -1350,7 +1350,7 @@ character.swd={
return get.distance(player,target,'attack')<=1&&
player!=target&&player.hp<=target.hp;
},
filterCard:true,
filterCard:lib.filter.cardDiscardable,
ai1:function(card){
return 9-ai.get.value(card);
},
@ -1452,7 +1452,7 @@ character.swd={
content:function(){
player.storage.pingshen2=true;
player.unmarkSkill('pingshen2');
player.gain(target.get('h'));
player.gain(target.get('h'),target);
target.$give(target.num('h'),player);
player.turnOver();
player.addSkill('pingshen3');
@ -1496,7 +1496,7 @@ character.swd={
player.chooseCard('he',true,player.storage.pingshen.hp);
}
"step 1"
player.storage.pingshen.gain(result.cards);
player.storage.pingshen.gain(result.cards,player);
player.$give(result.cards.length,player.storage.pingshen);
}
},
@ -1931,7 +1931,7 @@ character.swd={
if(player.num('he')){
player.chooseCardTarget({
prompt:get.prompt('huanxing'),
filterCard:true,
filterCard:lib.filter.cardDiscardable,
position:'he',
filterTarget:function(card,player,target){
if(target==player) return false;
@ -2077,7 +2077,9 @@ character.swd={
}
return ui.selected.cards.length;
},
filterCard:{color:'black'},
filterCard:function(card,player){
return get.color(card)=='black'&&lib.filter.cardDiscardable(card,player);
},
ai1:function(card){
if(ui.selected.cards.length>=enemy) return 0;
return 9-ai.get.value(card);
@ -2719,7 +2721,7 @@ character.swd={
filterTarget:function(card,player,target){
return player!=target&&trigger.player!=target&&get.distance(trigger.player,target)<=1;
},
filterCard:true,
filterCard:lib.filter.cardDiscardable,
ai1:function(card){
return ai.get.unuseful(card)+9;
},
@ -2800,7 +2802,7 @@ character.swd={
"step 1"
if(result.bool){
player.logSkill('guisi');
trigger.player.gain(result.cards);
trigger.player.gain(result.cards,player);
player.$give(result.cards,trigger.player);
trigger.untrigger();
trigger.finish();
@ -4106,7 +4108,9 @@ character.swd={
"step 1"
var suit=get.suit(trigger.cards);
event.suit=suit;
player.chooseCard('he',get.prompt('liaoyuan'),{suit:suit}).ai=function(card){
player.chooseCard('he',get.prompt('liaoyuan'),function(card,player){
return get.suit(card)==suit&&lib.filter.cardDiscardable(card,player);
}).ai=function(card){
if(ai.get.attitude(player,trigger.target)>=0) return 0;
if(ai.get.effect(trigger.target,{name:'sha'},player,player)>0){
return 7-ai.get.value(card);
@ -4304,7 +4308,7 @@ character.swd={
player.equip(result.buttons[0].link);
}
else{
player.gain(result.buttons[0].link);
player.gain(result.buttons[0].link,event.target);
}
event.target.$give(1,player);
game.delay();
@ -5036,7 +5040,7 @@ character.swd={
game.delay(0.5);
player.chooseCardTarget({
prompt:get.prompt('xielei'),
filterCard:true,
filterCard:lib.filter.cardDiscardable,
position:'he',
filterTarget:function(card,player,target){
if(player==target) return false;
@ -5152,7 +5156,7 @@ character.swd={
priority:5,
content:function(){
trigger.player.$give(trigger.player.get('e','1'),player);
player.gain(trigger.player.get('e','1'));
player.gain(trigger.player.get('e','1'),trigger.player);
},
ai:{
effect:{
@ -5751,7 +5755,7 @@ character.swd={
},
content:function(){
"step 0"
target.gain(cards);
target.gain(cards,player);
event.skillai=function(list){
return list.randomGet();
};
@ -5999,7 +6003,7 @@ character.swd={
},
content:function(){
"step 0"
target.gain(cards);
target.gain(cards,player);
target.storage.funiao=true;
target.addSkill('funiao2');
game.delay();
@ -7339,7 +7343,7 @@ character.swd={
}
"step 1"
if(result.bool){
player.gain(result.links[0]);
player.gain(result.links[0],target);
target.$give(1,player);
game.delay(0,500);
}
@ -7437,7 +7441,7 @@ character.swd={
}
"step 3"
if(result.bool){
player.gain(result.cards[0]);
player.gain(result.cards[0],target);
target.$give(1,player);
}
event.goto(1);
@ -7810,7 +7814,7 @@ character.swd={
var check=player.num('h')<=player.hp+(player.hp>2?2:1);
player.chooseCardTarget({
prompt:get.prompt('ljifeng'),
filterCard:true,
filterCard:lib.filter.cardDiscardable,
filterTarget:function(card,player,target){
if(player==target) return false;
return player.canUse({name:'sha'},target,false);

View File

@ -455,7 +455,7 @@ character.xianjian={
},
discard:false,
content:function(){
target.gain(cards);
target.gain(cards,player);
if(!player.hasSkill('diewu2')){
player.draw();
player.addTempSkill('diewu2','phaseAfter');
@ -531,8 +531,8 @@ character.xianjian={
}
'step 2'
if(result.bool){
player.gain(event.card);
target.gain(result.cards);
player.gain(event.card,target);
target.gain(result.cards,player);
player.$give(1,target);
target.$give(1,player);
game.log(player,'与',target,'交换了一张手牌');

View File

@ -353,7 +353,7 @@ character.yijiang={
'step 2'
var target=event.target;
if(result.bool){
player.gain(result.cards);
player.gain(result.cards,target);
target.$give(result.cards,player);
}
else{
@ -573,7 +573,7 @@ character.yijiang={
'step 2'
if(result.bool){
var card=result.links[0];
trigger.source.gain(card);
trigger.source.gain(card,player);
if(get.position(card)=='e'){
player.$give(card,trigger.source);
}
@ -1020,7 +1020,7 @@ character.yijiang={
}
'step 2'
if(result.bool&&result.cards&&result.cards.length){
player.gain(result.cards);
player.gain(result.cards,target);
target.$give(result.cards,player);
}
},
@ -1163,7 +1163,7 @@ character.yijiang={
audio:2,
content:function(){
'step 0'
player.gain(target.get('h').randomGet());
player.gain(target.get('h').randomGet(),target);
target.$give(1,player);
'step 1'
player.chooseControl('选项一','选项二',function(){
@ -1344,13 +1344,16 @@ character.yijiang={
'step 1'
ui.cardPile.insertBefore(cards[0],ui.cardPile.firstChild);
var n1=target.get('he',function(card){
if(!lib.filter.cardDiscardable(card,player)) return false;
return get.type(card,'trick')=='trick';
});
var n2=target.get('he',function(card){
if(!lib.filter.cardDiscardable(card,player)) return false;
return get.type(card,'trick')!='trick';
});
if(n1.length>1||n2.length>2||(n1.length==1&&n2.length==2)){
target.chooseToDiscard('弃置一张锦囊牌,或两张非锦囊牌',true,'he',function(card){
target.chooseToDiscard('弃置一张锦囊牌,或两张非锦囊牌',true,'he',function(card,player){
if(!lib.filter.cardDiscardable(card,player)) return false;
if(!_status.event.nontrick){
return get.type(card,'trick')=='trick';
}
@ -1455,7 +1458,7 @@ character.yijiang={
filterTarget:function(card,player,target){
return target!=player&&target.num('he')>0;
},
filterCard:true,
filterCard:lib.filter.cardDiscardable,
ai1:function(card){
return 7-ai.get.useful(card);
},
@ -2617,7 +2620,7 @@ character.yijiang={
'step 1'
if(result.bool){
var es=target.get('e');
player.gain(es);
player.gain(es,target);
target.$give(es,player);
player.removeSkill('yanzhu');
}
@ -3547,7 +3550,7 @@ character.yijiang={
lose:true,
content:function(){
player.$give(cards.length,target);
target.gain(cards);
target.gain(cards,player);
target.addTempSkill('mingjian2',{player:'phaseAfter'});
},
ai:{
@ -3605,7 +3608,7 @@ character.yijiang={
var target=result.targets[0];
target.addSkill('mingjian2');
var hs=player.get('h');
target.gain(hs);
target.gain(hs,player);
player.$give(hs.length,target);
}
}
@ -3695,7 +3698,7 @@ character.yijiang={
'step 1'
if(result.bool){
trigger.source.$give(trigger.source.get('e','1'),player);
player.gain(trigger.source.get('e','1'));
player.gain(trigger.source.get('e','1'),trigger.source);
}
},
},
@ -4484,7 +4487,7 @@ character.yijiang={
return 0;
});
"step 2"
trigger.player.gain(result.cards);
trigger.player.gain(result.cards,player);
if(player==game.me||trigger.player==game.me)
player.$give(result.cards,trigger.player);
else
@ -4712,7 +4715,7 @@ character.yijiang={
});
"step 3"
if(result.bool){
player.gain(result.cards);
player.gain(result.cards,event.target);
event.target.$give(1,player);
game.delay();
trigger.untrigger();
@ -4882,7 +4885,7 @@ character.yijiang={
"step 0"
player.unmarkSkill('xianzhou');
var cards=player.get('e');
target.gain(cards);
target.gain(cards,player);
event.num=cards.length;
player.$give(cards,target);
player.storage.xianzhou=true;
@ -5038,7 +5041,7 @@ character.yijiang={
}
"step 2"
if(result.bool){
player.gain(result.cards);
player.gain(result.cards,event.target);
event.target.$give(result.cards,player);
game.delay();
}
@ -5182,7 +5185,7 @@ character.yijiang={
event.giver=giver;
'step 1'
var card=result.cards[0];
event.gainner.gain(card,'give');
event.gainner.gain(card,event.giver);
event.giver.$give(1,event.gainner);
'step 2'
if(event.gainner.num('h')==event.giver.num('h')){
@ -5259,7 +5262,7 @@ character.yijiang={
},
content:function(){
"step 0"
targets[0].gain(cards);
targets[0].gain(cards,player);
game.delay(2);
"step 1"
targets[0].chooseControl('draw_card','出杀').set('ai',function(){
@ -5497,7 +5500,7 @@ character.yijiang={
}).set('check',check);
"step 2"
if(result.bool){
result.targets[0].gain(result.cards);
result.targets[0].gain(result.cards,event.player);
event.player.$give(result.cards.length,result.targets[0]);
}
},
@ -5633,8 +5636,8 @@ character.yijiang={
filterTarget:function(card,player,target){
return player!=target;
},
filterCard:function(card){
return get.type(card)!='basic';
filterCard:function(card,player){
return get.type(card)!='basic'&&lib.filter.cardDiscardable(card,player);
},
ai1:function(card){
if(get.tag(card,'damage')&&get.type(card)=='trick'){
@ -6140,7 +6143,7 @@ character.yijiang={
if(num!=2) event.finish();
'step 1'
if(result.cards){
player.gain(result.cards);
player.gain(result.cards,target);
target.$give(result.cards.length,player);
}
},
@ -6441,7 +6444,7 @@ character.yijiang={
});
"step 2"
if(result.bool){
player.gain(result.cards[0]);
player.gain(result.cards[0],trigger.source);
trigger.source.$give(1,player);
}
else{
@ -6519,7 +6522,7 @@ character.yijiang={
});
"step 1"
if(result.bool){
player.gain(result.cards[0]);
player.gain(result.cards[0],trigger.source);
trigger.source.$give(1,player);
}
else{
@ -6552,7 +6555,7 @@ character.yijiang={
},
content:function(){
"step 0"
target.gain(cards);
target.gain(cards,player);
game.delay();
"step 1"
player.gainPlayerCard(target,'he',true);
@ -6566,7 +6569,7 @@ character.yijiang={
}).set('source',target);
"step 3"
if(result.bool){
result.targets[0].gain(card);
result.targets[0].gain(card,player);
player.$give(1,result.targets[0]);
game.delay();
}
@ -6692,7 +6695,12 @@ character.yijiang={
else{
return Math.random();
}
}).set('check',check);
}).set('check',check).set('filterButton',function(button){
if(_status.event.player==_status.event.target){
return lib.filter.cardDiscardable(button.link,_status.event.player);
}
return true;
});
"step 1"
if(result.bool){
player.logSkill('buyi',trigger.player);

View File

@ -175,7 +175,7 @@ character.yxs={
"step 1"
if(result.bool){
player.line(result.targets,'green');
result.targets[0].gain(result.cards);
result.targets[0].gain(result.cards,player);
player.$give(result.cards.length,result.targets[0]);
game.delay(0.7);
}
@ -252,7 +252,7 @@ character.yxs={
"step 3"
if(result.bool){
player.line(result.targets,'green');
result.targets[0].gain(result.cards);
result.targets[0].gain(result.cards,player);
player.$give(result.cards.length,result.targets[0]);
for(var i=0;i<result.cards.length;i++){
event.cards.remove(result.cards[i]);
@ -300,7 +300,7 @@ character.yxs={
'step 3'
if(result.bool&&result.cards&&result.cards.length){
event.target.$give(1,player);
player.gain(result.cards);
player.gain(result.cards,event.target);
}
event.goto(2);
},
@ -656,7 +656,7 @@ character.yxs={
});
"step 3"
if(result.bool){
result.targets[0].gain(result.cards);
result.targets[0].gain(result.cards,player);
player.$give(result.cards.length,result.targets[0]);
for(var i=0;i<result.cards.length;i++){
event.cards.remove(result.cards[i]);
@ -862,9 +862,8 @@ character.yxs={
var hs=target.get('h');
if(hs.length){
event.card=hs.randomGet();
player.gain(event.card);
player.gain(event.card,target);
target.$give(1,player);
}
else{
event.finish();
@ -882,7 +881,7 @@ character.yxs={
}
"step 2"
if(result.bool){
result.targets[0].gain(card);
result.targets[0].gain(card,player);
player.$give(1,result.targets[0]);
game.delay();
}
@ -1129,7 +1128,7 @@ character.yxs={
'step 1'
if(result.bool){
player.logSkill('xiadao',result.targets);
result.targets[0].gain(trigger.player.get('h').randomGet());
result.targets[0].gain(trigger.player.get('h').randomGet(),trigger.player);
trigger.player.$give(1,result.targets[0]);
}
},
@ -1197,7 +1196,7 @@ character.yxs={
if(player.num('he')){
player.chooseCardTarget({
prompt:get.prompt('yizhuang'),
filterCard:true,
filterCard:lib.filter.cardDiscardable,
position:'he',
filterTarget:function(card,player,target){
if(target==player) return false;
@ -1645,7 +1644,7 @@ character.yxs={
"step 2"
if(event.targets.length){
var target=event.targets.shift();
player.gain(target.get('h').randomGet(),'give');
player.gain(target.get('h').randomGet(),target);
target.$give(1,player);
event.redo();
}
@ -2100,7 +2099,7 @@ character.yxs={
};
"step 1"
if(result.bool){
player.gain(result.cards[0]);
player.gain(result.cards[0],trigger.source);
trigger.source.$give(1,player);
}
else{

View File

@ -238,7 +238,7 @@ character.zhuogui={
"step 1"
if(result.targets&&result.targets.length){
player.logSkill('qiangzheng',result.targets);
player.gain(result.targets[0].get('h').randomGet());
player.gain(result.targets[0].get('h').randomGet(),result.targets[0]);
result.targets[0].$give(1,player);
game.delay();
}

View File

@ -339,7 +339,7 @@ play.soldier={
return 10-ai.get.value(card);
},
content:function(){
target.gain(cards);
target.gain(cards,player);
player.$give(cards.length,target);
game.delay();
player.draw(cards.length);
@ -372,7 +372,7 @@ play.soldier={
return 10-ai.get.value(card);
},
content:function(){
target.gain(cards);
target.gain(cards,player);
player.$give(cards.length,target);
game.delay();
player.draw(cards.length);

View File

@ -7353,7 +7353,7 @@
else{
game.delayx();
}
player.gain(event.cards);
player.gain(event.cards,target);
},
showHandcards:function(){
"step 0"
@ -7700,7 +7700,9 @@
if(info.prepare){
switch(info.prepare){
case 'give':player.$give(cards,targets[0]);break;
case 'give2':player.$give(cards.length,targets[0]);break;
case 'throw':player.$throw(cards);break;
case 'throw2':player.$throw(cards.length);break;
default:info.prepare(cards,player,targets);
}
}
@ -7720,7 +7722,9 @@
if(info.prepare){
switch(info.prepare){
case 'give':player.$give(cards,targets[0]);break;
case 'give2':player.$give(cards.length,targets[0]);break;
case 'throw':player.$throw(cards);break;
case 'throw2':player.$throw(cards.length);break;
default:info.prepare(cards,player,targets);
}
}
@ -8045,7 +8049,7 @@
gain:function(){
"step 0"
if(cards){
event.source=get.owner(cards[0]);
event.source=event.source||get.owner(cards[0]);
if(event.source){
event.source.lose(cards,ui.special);
}
@ -30479,6 +30483,14 @@
var info=get.info(skill);
var event=_status.event;
event.backup(skill);
if(info.filterCard&&info.discard!=false&&info.lose!=false&&!info.viewAs){
var cards=event.player.get(event.position||'h');
for(var i=0;i<cards.length;i++){
if(!lib.filter.cardDiscardable(cards[i],event.player)){
cards[i].uncheck('useSkill');
}
}
}
if(typeof event.skillDialog=='object'){
event.skillDialog.close();
}
@ -30533,6 +30545,10 @@
if(event.skillDialog&&get.objtype(event.skillDialog)=='div'){
event.skillDialog.close();
}
var cards=event.player.get('hej');
for(var i=0;i<cards.length;i++){
cards[i].recheck('useSkill');
}
event.restore();
}
if(ui.skills) ui.skills.close();
@ -30557,6 +30573,10 @@
event.dialog=ui.create.dialog(event.dialog);
}
event.restore();
var cards=event.player.get('hej');
for(var i=0;i<cards.length;i++){
cards[i].recheck('useSkill');
}
game.uncheck();
game.check();
return;
@ -34065,7 +34085,7 @@
}
};
if(!lib.config.touchscreen){
document.onmousewheel=ui.click.windowmousewheel;
document.addEventListener('mousewheel',ui.click.windowmousewheel,{passive:true});
document.onmousemove=ui.click.windowmousemove;
document.onmousedown=ui.click.windowmousedown;
document.onmouseup=ui.click.windowmouseup;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

@ -1897,7 +1897,7 @@ mode.boss={
if(game.players[i]!=player){
var e=game.players[i].get('e','qinggang');
if(e.length){
player.gain(e);
player.gain(e,game.players[i]);
game.players[i].$give(e,player);
break;
}
@ -2030,7 +2030,7 @@ mode.boss={
var current=event.players.shift();
var hs=current.get('h')
if(hs.length){
player.gain(hs.randomGet());
player.gain(hs.randomGet(),current);
current.$give(1,player);
}
event.redo();
@ -2277,7 +2277,7 @@ mode.boss={
if(!lib.character[target.name]) return false;
return player!=target&&!target.storage.boss_hujia;
},
filterCard:true,
filterCard:lib.filter.cardDiscardable,
ai1:function(card){
return ai.get.unuseful(card)+9;
},

View File

@ -4524,7 +4524,7 @@ mode.chess={
var current=event.players.shift();
var hs=current.get('h')
if(hs.length){
player.gain(hs.randomGet());
player.gain(hs.randomGet(),current);
current.$give(1,player);
}
event.redo();
@ -5032,7 +5032,7 @@ mode.chess={
}
"step 2"
if(result.cards.length){
player.gain(result.cards);
player.gain(result.cards,event.current);
event.current.$give(1,player);
event.goto(1);
}