This commit is contained in:
libccy 2016-07-09 23:23:11 +08:00
parent 186673c54e
commit 1e3b3aca14
21 changed files with 375 additions and 274 deletions

View File

@ -1,210 +0,0 @@
'use strict';
card.mingzhong={
connect:true,
card:{
shengdong:{
fullskin:true,
enable:function(card,player){
var hs=player.get('h');
if(hs.length>1) return true;
if(hs.length==1&&hs[0]!=card) return true;
return false;
},
type:'trick',
selectTarget:2,
multitarget:true,
targetprompt:['交给其一张牌','得两张牌'],
filterTarget:function(card,player,target){
return target!=player;
},
content:function(){
'step 0'
if(!player.num('h')){
event.finish();
}
else{
event.target1=targets[0];
event.target2=targets[1];
player.chooseCard('h','将一张手牌交给'+get.translation(event.target1),true);
}
'step 1'
player.$give(1,event.target1);
event.target1.gain(result.cards);
'step 2'
if(!event.target1.num('h')){
event.finish();
}
else{
var he=event.target1.get('he');
if(he.length<=2){
event.directresult=he;
}
else{
event.target1.chooseCard('he','将两张牌交给'+get.translation(event.target2),2,true);
}
}
'step 3'
if(!event.directresult){
event.directresult=result.cards;
}
event.target1.$give(event.directresult.length,event.target2);
event.target2.gain(event.directresult);
},
ai:{
order:2.5,
value:[4,1],
useful:1,
wuxie:function(){
return 0;
},
result:{
target:function(player,target){
var ok=false;
var hs=player.get('h');
for(var i=0;i<hs.length;i++){
if(ai.get.value(hs[i])<=5){
ok=true;
break;
}
}
if(!ok) return 0;
if(ui.selected.targets.length==1) return 2;
if(target.num('he')==0) return 0;
if(player.hasFriend()) return -1;
return 0;
}
}
}
},
zengbin:{
fullskin:true,
enable:true,
type:'trick',
filterTarget:true,
content:function(){
'step 0'
target.draw(3);
'step 1'
if(target.num('he',{type:'basic'})<target.num('he')){
target.chooseToDiscard('弃置一张非基本牌(或取消并弃置两张牌)','he',function(card){
return get.type(card)!='basic';
}).ai=function(card){
return 7-ai.get.value(card);
};
event.more=true;
}
else{
target.chooseToDiscard('he',2,true);
}
'step 2'
if(event.more&&!result.bool){
target.chooseToDiscard('he',2,true);
}
},
ai:{
order:7,
useful:4,
value:10,
result:{
target:function(player,target){
if(target.num('j','lebu')) return 0;
return Math.max(1,2-target.num('h')/10);
}
}
}
},
caomu:{
fullskin:true,
enable:true,
type:'delay',
filterTarget:function(card,player,target){
return (lib.filter.judge(card,player,target)&&player!=target);
},
judge:function(card){
if(get.suit(card)=='club') return 0;
return -3;
},
effect:function(){
if(result.bool==false){
player.addTempSkill('caomu_skill','phaseAfter');
}
},
ai:{
basic:{
order:1,
useful:1,
value:4.5,
},
result:{
player:function(player,target){
var num=0;
for(var i=0;i<game.players.length;i++){
if(get.distance(target,game.players[i])<=1&&game.players[i]!=target){
var att=ai.get.attitude(player,game.players[i]);
if(att>3){
num+=1.1;
}
else if(att>0){
num++;
}
else if(att<-3){
num-=1.1;
}
else if(att<0){
num--;
}
}
}
return num;
},
target:-1
},
}
}
},
skill:{
caomu_skill:{
unique:true,
trigger:{player:'phaseDrawBegin'},
forced:true,
popup:false,
silent:true,
content:function(){
trigger.num--;
},
group:'caomu_skill2'
},
caomu_skill2:{
trigger:{player:'phaseDrawAfter'},
forced:true,
popup:false,
silent:true,
content:function(){
var targets=game.filterPlayer(function(current){
return get.distance(player,current)<=1&&player!=current;
});
if(targets.length){
game.asyncDraw(targets);
}
}
}
},
translate:{
shengdong:'声东击西',
shengdong_info:'出牌阶段,对一名其他角色使用。你交给目标角色一张手牌,若如此做,其将两张牌交给另一名由你选择的其他角色',
zengbin:'增兵减灶',
zengbin_info:'出牌阶段对一名角色使用。目标角色摸三张牌然后选择一项1.弃置一张非基本牌2.弃置两张牌',
caomu:'草木皆兵',
caomu_info:'出牌阶段对一名其他角色使用。将【草木皆兵】放置于该角色的判定区里若判定结果不为梅花摸牌阶段目标角色少摸一张牌摸牌阶段结束时与其距离为1的角色各摸一张牌',
},
list:[
["spade",1,'caomu'],
["club",3,'caomu'],
["heart",12,'shengdong',],
["club",9,'shengdong'],
["spade",9,'shengdong'],
["diamond",4,'zengbin'],
["heart",6,'zengbin'],
["spade",7,'zengbin'],
],
}

265
card/refresh.js → card/sp.js Executable file → Normal file
View File

@ -1,7 +1,19 @@
'use strict'; 'use strict';
card.refresh={ card.sp={
connect:true, connect:true,
card:{ card:{
yinyueqiang:{
fullskin:true,
type:'equip',
subtype:'equip1',
distance:{attackFrom:-2},
ai:{
basic:{
equipValue:4
}
},
skills:['yinyueqiang']
},
muniu:{ muniu:{
fullskin:true, fullskin:true,
type:'equip', type:'equip',
@ -15,14 +27,196 @@ card.refresh={
} }
} }
} }
} },
du:{
type:'basic',
fullskin:true,
ai:{
value:-5,
useful:6,
}
},
shengdong:{
fullskin:true,
enable:function(card,player){
var hs=player.get('h');
if(hs.length>1) return true;
if(hs.length==1&&hs[0]!=card) return true;
return false;
},
type:'trick',
selectTarget:2,
multitarget:true,
targetprompt:['交给其一张牌','得两张牌'],
filterTarget:function(card,player,target){
return target!=player;
},
content:function(){
'step 0'
if(!player.num('h')){
event.finish();
}
else{
event.target1=targets[0];
event.target2=targets[1];
player.chooseCard('h','将一张手牌交给'+get.translation(event.target1),true);
}
'step 1'
player.$give(1,event.target1);
event.target1.gain(result.cards);
'step 2'
if(!event.target1.num('h')){
event.finish();
}
else{
var he=event.target1.get('he');
if(he.length<=2){
event.directresult=he;
}
else{
event.target1.chooseCard('he','将两张牌交给'+get.translation(event.target2),2,true);
}
}
'step 3'
if(!event.directresult){
event.directresult=result.cards;
}
event.target1.$give(event.directresult.length,event.target2);
event.target2.gain(event.directresult);
},
ai:{
order:2.5,
value:[4,1],
useful:1,
wuxie:function(){
return 0;
},
result:{
target:function(player,target){
var ok=false;
var hs=player.get('h');
for(var i=0;i<hs.length;i++){
if(ai.get.value(hs[i])<=5){
ok=true;
break;
}
}
if(!ok) return 0;
if(ui.selected.targets.length==1) return 2;
if(target.num('he')==0) return 0;
if(player.hasFriend()) return -1;
return 0;
}
}
}
},
zengbin:{
fullskin:true,
enable:true,
type:'trick',
filterTarget:true,
content:function(){
'step 0'
target.draw(3);
'step 1'
if(target.num('he',{type:'basic'})<target.num('he')){
target.chooseToDiscard('弃置一张非基本牌(或取消并弃置两张牌)','he',function(card){
return get.type(card)!='basic';
}).ai=function(card){
return 7-ai.get.value(card);
};
event.more=true;
}
else{
target.chooseToDiscard('he',2,true);
}
'step 2'
if(event.more&&!result.bool){
target.chooseToDiscard('he',2,true);
}
},
ai:{
order:7,
useful:4,
value:10,
result:{
target:function(player,target){
if(target.num('j','lebu')) return 0;
return Math.max(1,2-target.num('h')/10);
}
}
}
},
caomu:{
fullskin:true,
enable:true,
type:'delay',
filterTarget:function(card,player,target){
return (lib.filter.judge(card,player,target)&&player!=target);
},
judge:function(card){
if(get.suit(card)=='club') return 0;
return -3;
},
effect:function(){
if(result.bool==false){
player.addTempSkill('caomu_skill','phaseAfter');
}
},
ai:{
basic:{
order:1,
useful:1,
value:4.5,
},
result:{
player:function(player,target){
var num=0;
for(var i=0;i<game.players.length;i++){
if(get.distance(target,game.players[i])<=1&&game.players[i]!=target){
var att=ai.get.attitude(player,game.players[i]);
if(att>3){
num+=1.1;
}
else if(att>0){
num++;
}
else if(att<-3){
num-=1.1;
}
else if(att<0){
num--;
}
}
}
return num;
},
target:-1
},
}
}
}, },
skill:{ skill:{
yinyueqiang:{
trigger:{player:['useCard','respondAfter']},
direct:true,
filter:function(event,player){
if(_status.currentPhase==player) return false;
if(!event.cards) return false;
if(event.cards.length!=1) return false;
if(lib.filter.autoRespondSha.call({player:player})) return false;
return get.color(event.cards[0])=='black';
},
content:function(){
player.chooseToUse('是否发动【银月枪】?',{name:'sha'}).logSkill='yinyueqiang';
}
},
muniu_skill:{ muniu_skill:{
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
if(card.name=='du') return 20;
var player=_status.event.player; var player=_status.event.player;
var nh=player.num('h'); var nh=player.num('h');
if(nh<=player.hp){ if(nh<=player.hp){
@ -290,8 +484,52 @@ card.refresh={
} }
} }
}, },
_du:{
trigger:{player:['useCardAfter','respondAfter','discardAfter']},
popup:false,
forced:true,
filter:function(event,player){
if(event.cards){
for(var i=0;i<event.cards.length;i++){
if(event.cards[i].name=='du'&&event.cards[i].original!='j') return true;
}
}
return false;
},
content:function(){
player.popup('毒','wood');
player.loseHp();
},
},
caomu_skill:{
unique:true,
trigger:{player:'phaseDrawBegin'},
forced:true,
popup:false,
silent:true,
content:function(){
trigger.num--;
},
group:'caomu_skill2'
},
caomu_skill2:{
trigger:{player:'phaseDrawAfter'},
forced:true,
popup:false,
silent:true,
content:function(){
var targets=game.filterPlayer(function(current){
return get.distance(player,current)<=1&&player!=current;
});
if(targets.length){
game.asyncDraw(targets);
}
}
}
}, },
translate:{ translate:{
yinyueqiang:'银月枪',
yinyueqiang_info:'你的回合外,每当你使用或打出了一张黑色手牌(若为使用则在它结算之前),你可以立即对你攻击范围内的任意一名角色使用一张【杀】',
muniu:'木牛流马', muniu:'木牛流马',
muniu_bg:'牛', muniu_bg:'牛',
muniu_skill:'木牛', muniu_skill:'木牛',
@ -302,8 +540,31 @@ card.refresh={
muniu_skill4_backup:'流马', muniu_skill4_backup:'流马',
muniu_info:'出牌阶段限一次,你可以将一张手牌扣置于你装备区里的【木牛流马】下,若如此做,你可以将此装备移动到一名其他角色的装备区里;你可以将此装备牌下的牌如手牌般使用或打出。', muniu_info:'出牌阶段限一次,你可以将一张手牌扣置于你装备区里的【木牛流马】下,若如此做,你可以将此装备移动到一名其他角色的装备区里;你可以将此装备牌下的牌如手牌般使用或打出。',
muniu_skill_info:'出牌阶段限一次,你可以将一张手牌扣置于你装备区里的【木牛流马】下,若如此做,你可以将此装备移动到一名其他角色的装备区里;你可以将此装备牌下的牌如手牌般使用或打出。', muniu_skill_info:'出牌阶段限一次,你可以将一张手牌扣置于你装备区里的【木牛流马】下,若如此做,你可以将此装备移动到一名其他角色的装备区里;你可以将此装备牌下的牌如手牌般使用或打出。',
du:'毒',
du_info:'当你因使用、打出或弃置而失去此牌时,你失去一点体力',
shengdong:'声东击西',
shengdong_info:'出牌阶段,对一名其他角色使用。你交给目标角色一张手牌,若如此做,其将两张牌交给另一名由你选择的其他角色',
zengbin:'增兵减灶',
zengbin_info:'出牌阶段对一名角色使用。目标角色摸三张牌然后选择一项1.弃置一张非基本牌2.弃置两张牌',
caomu:'草木皆兵',
caomu_info:'出牌阶段对一名其他角色使用。将【草木皆兵】放置于该角色的判定区里若判定结果不为梅花摸牌阶段目标角色少摸一张牌摸牌阶段结束时与其距离为1的角色各摸一张牌',
}, },
list:[ list:[
['spade',1,'caomu'],
['club',3,'caomu'],
['heart',12,'shengdong',],
['club',9,'shengdong'],
['spade',9,'shengdong'],
['diamond',4,'zengbin'],
['heart',6,'zengbin'],
['spade',7,'zengbin'],
['spade',3,'du'],
['spade',9,'du'],
['club',3,'du'],
['club',9,'du'],
['diamond',5,'du'],
['diamond',9,'du'],
["diamond",5,'muniu'], ["diamond",5,'muniu'],
["diamond",12,'yinyueqiang'],
], ],
} }

View File

@ -1394,34 +1394,17 @@ card.swd={
mujiaren_skill:{ mujiaren_skill:{
enable:'phaseUse', enable:'phaseUse',
filter:function(event,player){ filter:function(event,player){
return player.num('h',{type:'hslingjian'})>=2; return player.num('h',{type:'hslingjian'})>=1;
}, },
filterCard:{type:'hslingjian'}, filterCard:{type:'hslingjian'},
selectCard:2, viewAs:{name:'jiguanshu'}
content:function(){
player.gain(game.createCard('jiguanshu'));
},
ai:{
order:7,
result:{
player:function(player){
for(var i=0;i<game.players.length;i++){
if(player.canUse('jiguanshu',game.players[i])&&
ai.get.effect(game.players[i],{name:'jiguanshu'},player,player>0)){
return 1;
}
return 0;
}
}
}
}
}, },
_lingjianduanzao:{ _lingjianduanzao:{
enable:'phaseUse', enable:'phaseUse',
position:'he', position:'he',
prompt:function(event){ prompt:function(event){
var lingjians=[],types=[]; var lingjians=[],types=[];
var hs=event.player.get('h'); var hs=event.player.get('he');
for(var i=0;i<hs.length;i++){ for(var i=0;i<hs.length;i++){
switch(get.type(hs[i])){ switch(get.type(hs[i])){
case 'equip':types.add(get.subtype(hs[i]));break; case 'equip':types.add(get.subtype(hs[i]));break;
@ -1598,7 +1581,7 @@ card.swd={
return 2; return 2;
}, },
filter:function(event,player){ filter:function(event,player){
return player.num('h',{type:'equip'})&&player.num('h',{type:'hslingjian'}); return player.num('he',{type:'equip'})&&player.num('h',{type:'hslingjian'});
}, },
content:function(){ content:function(){
var name=lib.skill._lingjianduanzao.process(cards); var name=lib.skill._lingjianduanzao.process(cards);
@ -2224,7 +2207,7 @@ card.swd={
lingjiandai_info:'出牌阶段对距离1以内的一名角色使用目标获得3张随机零件', lingjiandai_info:'出牌阶段对距离1以内的一名角色使用目标获得3张随机零件',
mujiaren:'木甲人', mujiaren:'木甲人',
mujiaren_skill:'木甲人', mujiaren_skill:'木甲人',
mujiaren_skill_info:'你在煅造装备时可以额外加入一个零件;你可以弃置两个零件并获得一个机关鼠', mujiaren_skill_info:'你在煅造装备时可以额外加入一个零件;你可以将零件当作机关鼠使用',
mujiaren_info:'出牌阶段对距离1以内的一名角色使用目标获得技能木甲人你在煅造装备时可以额外加入一个零件你可以弃置两个零件并获得一个机关鼠', mujiaren_info:'出牌阶段对距离1以内的一名角色使用目标获得技能木甲人你在煅造装备时可以额外加入一个零件你可以弃置两个零件并获得一个机关鼠',
hslingjian:'零件', hslingjian:'零件',
hslingjian_xuanfengzhiren:'旋风之刃', hslingjian_xuanfengzhiren:'旋风之刃',

View File

@ -663,7 +663,7 @@ character.extra={
} }
"step 2" "step 2"
player.chooseCardButton(player.storage.qixing,'选择'+event.num+'张牌作为手牌',event.num,true).ai=function(button){ player.chooseCardButton(player.storage.qixing,'选择'+event.num+'张牌作为手牌',event.num,true).ai=function(button){
if(player.skipList.contains('phaseUse')){ if(player.skipList.contains('phaseUse')&&button.link!='du'){
return -ai.get.value(button.link); return -ai.get.value(button.link);
} }
return ai.get.value(button.link); return ai.get.value(button.link);

View File

@ -23,7 +23,7 @@ character.gujian={
direct:true, direct:true,
content:function(){ content:function(){
"step 0" "step 0"
var next=player.chooseToDiscard('魅影:是否弃置一张红色牌视为对'+get.translation(trigger.player)+'使用一张杀?'); var next=player.chooseToDiscard('he','魅影:是否弃置一张红色牌视为对'+get.translation(trigger.player)+'使用一张杀?');
next.logSkill=['meiying',trigger.player]; next.logSkill=['meiying',trigger.player];
var eff=ai.get.effect(trigger.player,{name:'sha'},player,player); var eff=ai.get.effect(trigger.player,{name:'sha'},player,player);
next.ai=function(card){ next.ai=function(card){

View File

@ -45,6 +45,8 @@ character.refresh={
delete player.storage.rerende2; delete player.storage.rerende2;
}, },
check:function(card){ check:function(card){
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0;
if(!ui.selected.cards.length&&card.name=='du') return 20;
var player=get.owner(card); var player=get.owner(card);
if(ui.selected.cards.length>=Math.max(2,player.num('h')-player.hp)) return 0; if(ui.selected.cards.length>=Math.max(2,player.num('h')-player.hp)) return 0;
if(player.hp==player.maxHp||player.storage.rerende<0||player.num('h')<=1){ if(player.hp==player.maxHp||player.storage.rerende<0||player.num('h')<=1){
@ -85,10 +87,10 @@ character.refresh={
} }
if(player.canUse('tao',player,true,true)){ if(player.canUse('tao',player,true,true)){
list.push('tao'); list.push('tao');
}; }
if(player.canUse('jiu',player,true,true)){ if(player.canUse('jiu',player,true,true)){
list.push('jiu'); list.push('jiu');
}; }
if(list.length){ if(list.length){
list.push('cancel'); list.push('cancel');
player.chooseControl(list,function(){ player.chooseControl(list,function(){
@ -151,6 +153,9 @@ character.refresh={
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
return -10;
}
if(target.num('j','lebu')) return 0; if(target.num('j','lebu')) return 0;
var nh=target.num('h'); var nh=target.num('h');
var np=player.num('h'); var np=player.num('h');
@ -469,9 +474,9 @@ character.refresh={
unique:true, unique:true,
trigger:{player:'gainAfter'}, trigger:{player:'gainAfter'},
direct:true, direct:true,
usable:4,
filter:function(event,player){ filter:function(event,player){
if(event.parent.parent.name=='phaseDraw') return false; if(event.parent.parent.name=='phaseDraw') return false;
if(player.storage.qingjian>=4) return false;
return event.cards&&event.cards.length>0 return event.cards&&event.cards.length>0
}, },
content:function(){ content:function(){
@ -488,11 +493,16 @@ character.refresh={
}, },
ai1:function(card){ ai1:function(card){
if(ui.selected.cards.length>0) return -1; if(ui.selected.cards.length>0) return -1;
if(card.name=='du') return 20;
return (_status.event.player.num('h')-_status.event.player.hp); return (_status.event.player.num('h')-_status.event.player.hp);
}, },
ai2:function(target){ ai2:function(target){
var att=ai.get.attitude(_status.event.player,target);
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
return 1-att;
}
if(target.num('h')>_status.event.player.num('h')) return 0; if(target.num('h')>_status.event.player.num('h')) return 0;
return ai.get.attitude(_status.event.player,target)-4; return att-4;
}, },
prompt:'请选择要送人的卡牌' prompt:'请选择要送人的卡牌'
}); });
@ -511,16 +521,6 @@ character.refresh={
ai:{ ai:{
expose:0.3 expose:0.3
}, },
group:'qingjian2'
},
qingjian2:{
trigger:{global:'phaseBegin'},
forced:true,
popup:false,
silent:true,
content:function(){
player.storage.qingjian=0;
}
}, },
reyingzi:{ reyingzi:{
audio:2, audio:2,
@ -594,7 +594,7 @@ character.refresh={
order:9, order:9,
result:{ result:{
target:function(player,target){ target:function(player,target){
return -target.num('he'); return -target.num('he')-(player.num('h','du')?1:0);
} }
}, },
threaten:2, threaten:2,
@ -760,13 +760,16 @@ character.refresh={
game.addVideo('thrownhighlight1'); game.addVideo('thrownhighlight1');
game.addVideo('centernode',null,get.cardInfo(event.card)); game.addVideo('centernode',null,get.cardInfo(event.card));
if(get.type(event.card,'trick')==get.type(trigger.card,'trick')){ if(get.type(event.card,'trick')==get.type(trigger.card,'trick')){
player.chooseTarget('选择获得此牌的角色').ai=function(target){ player.chooseTarget('选择获得此牌的角色').set('ai',function(target){
var att=ai.get.attitude(_status.event.player,target); var att=ai.get.attitude(_status.event.player,target);
if(_status.event.du){
return -att;
}
if(att>0){ if(att>0){
return att+Math.max(0,5-target.num('h')); return att+Math.max(0,5-target.num('h'));
} }
return att; return att;
} }).set('du',event.card.name=='du');
} }
else{ else{
player.chooseBool('是否弃置'+get.translation(event.card)+''); player.chooseBool('是否弃置'+get.translation(event.card)+'');
@ -888,10 +891,15 @@ character.refresh={
}, },
ai1:function(card){ ai1:function(card){
if(ui.selected.cards.length>0) return -1; if(ui.selected.cards.length>0) return -1;
if(card.name=='du') return 20;
return (_status.event.player.num('h')-_status.event.player.hp); return (_status.event.player.num('h')-_status.event.player.hp);
}, },
ai2:function(target){ ai2:function(target){
return ai.get.attitude(_status.event.player,target)-4; var att=ai.get.attitude(_status.event.player,target);
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
return 1-att;
}
return att-4;
}, },
prompt:'请选择要送人的卡牌' prompt:'请选择要送人的卡牌'
}); });
@ -1233,6 +1241,7 @@ character.refresh={
trigger:{global:'phaseEnd'}, trigger:{global:'phaseEnd'},
direct:true, direct:true,
filter:function(event,player){ filter:function(event,player){
if(lib.filter.autoRespondSha.call({player:player})) return false;
return event.player.isAlive()&&event.player.getStat('damage')&& return event.player.isAlive()&&event.player.getStat('damage')&&
lib.filter.targetEnabled({name:'sha'},player,event.player)&& lib.filter.targetEnabled({name:'sha'},player,event.player)&&
!lib.filter.autoRespondSha.call({player:player}); !lib.filter.autoRespondSha.call({player:player});

View File

@ -729,6 +729,7 @@ character.shenhua={
content:function(){ content:function(){
"step 0" "step 0"
player.chooseToCompare(target,function(card){ player.chooseToCompare(target,function(card){
if(card.name=='du') return 20;
var player=get.owner(card); var player=get.owner(card);
var target=_status.event.getParent().target; var target=_status.event.getParent().target;
if(player!=target&&ai.get.attitude(player,target)>0){ if(player!=target&&ai.get.attitude(player,target)>0){
@ -749,7 +750,8 @@ character.shenhua={
expose:0.2, expose:0.2,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(player.num('h')<=player.hp) return false; if(player.num('h','du')&&ai.get.attitude(player,target)<0) return -1;
if(player.num('h')<=player.hp) return 0;
var maxnum=0; var maxnum=0;
var cards2=target.get('h'); var cards2=target.get('h');
for(var i=0;i<cards2.length;i++){ for(var i=0;i<cards2.length;i++){

View File

@ -960,8 +960,10 @@ character.sp={
player.chooseTarget('将'+get.translation(result.target)+'交给一名角色',function(card,player,target){ player.chooseTarget('将'+get.translation(result.target)+'交给一名角色',function(card,player,target){
return target.hp<=player.hp; return target.hp<=player.hp;
}).set('ai',function(target){ }).set('ai',function(target){
return ai.get.attitude(_status.event.player,target); var att=ai.get.attitude(_status.event.player,target);
}); if(_status.event.du) return -att;
return att;
}).set('du',event.card.name=='du');
target.addTempSkill('dahe2','phaseAfter'); target.addTempSkill('dahe2','phaseAfter');
event.card=result.target; event.card=result.target;
} }
@ -3919,8 +3921,10 @@ character.sp={
player.chooseTarget('是否发动【礼让】?',function(card,player,target){ player.chooseTarget('是否发动【礼让】?',function(card,player,target){
return player!=target return player!=target
}).set('ai',function(target){ }).set('ai',function(target){
return ai.get.attitude(_status.event.player,target); var att=ai.get.attitude(_status.event.player,target);
}); if(_status.event.du) return -att;
return att;
}).set('du',(trigger.cards.length==1&&trigger.cards[0].name=='du'));
"step 2" "step 2"
if(result.bool){ if(result.bool){
var target=result.targets[0]; var target=result.targets[0];

View File

@ -348,10 +348,15 @@ character.standard={
}, },
ai1:function(card){ ai1:function(card){
if(ui.selected.cards.length>0) return -1; if(ui.selected.cards.length>0) return -1;
if(card.name=='du') return 20;
return (_status.event.player.num('h')-_status.event.player.hp); return (_status.event.player.num('h')-_status.event.player.hp);
}, },
ai2:function(target){ ai2:function(target){
return ai.get.attitude(_status.event.player,target)-4; var att=ai.get.attitude(_status.event.player,target);
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
return 1-att;
}
return att-4;
}, },
prompt:'请选择要送人的卡牌' prompt:'请选择要送人的卡牌'
}); });
@ -465,6 +470,8 @@ character.standard={
}, },
check:function(card){ check:function(card){
if(ui.selected.cards.length>1) return 0; if(ui.selected.cards.length>1) return 0;
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0;
if(!ui.selected.cards.length&&card.name=='du') return 20;
var player=get.owner(card); var player=get.owner(card);
if(player.hp==player.maxHp||player.storage.rende<0||player.num('h')<=1){ if(player.hp==player.maxHp||player.storage.rende<0||player.num('h')<=1){
if(ui.selected.cards.length){ if(ui.selected.cards.length){
@ -508,6 +515,9 @@ character.standard={
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
return -10;
}
if(target.num('j','lebu')) return 0; if(target.num('j','lebu')) return 0;
var nh=target.num('h'); var nh=target.num('h');
var np=player.num('h'); var np=player.num('h');

View File

@ -1478,9 +1478,13 @@ character.swd={
filterCard:true, filterCard:true,
selectCard:[1,Infinity], selectCard:[1,Infinity],
ai1:function(card){ ai1:function(card){
if(ui.selected.cards.length==0&&player.hp==1) return 11-ai.get.value(card); var useful=ai.get.useful(card);
if(card.name=='du'){
useful=-5;
}
if(ui.selected.cards.length==0&&player.hp==1) return 11-useful;
if(ui.selected.cards.length>1) return 0; if(ui.selected.cards.length>1) return 0;
return 7-ai.get.useful(card); return 7-useful;
}, },
ai2:function(target){ ai2:function(target){
if(target.hp>ui.selected.cards.length){ if(target.hp>ui.selected.cards.length){
@ -2503,6 +2507,7 @@ character.swd={
return lib.filter.targetEnabled({name:'guiyoujie'},player,target); return lib.filter.targetEnabled({name:'guiyoujie'},player,target);
}, },
check:function(card){ check:function(card){
if(card.name=='du') return 20;
return Math.max(7-ai.get.value(card),7-ai.get.useful(card)); return Math.max(7-ai.get.value(card),7-ai.get.useful(card));
}, },
content:function(){ content:function(){
@ -5666,6 +5671,7 @@ character.swd={
}, },
filterCard:true, filterCard:true,
check:function(card){ check:function(card){
if(card.name=='du') return 20;
if(get.owner(card).num('h')<get.owner(card).hp) return 0; if(get.owner(card).num('h')<get.owner(card).hp) return 0;
return 4-ai.get.value(card); return 4-ai.get.value(card);
}, },
@ -5689,7 +5695,12 @@ character.swd={
}, },
ai:{ ai:{
result:{ result:{
target:1, target:function(player,target){
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
return -1;
}
return 1;
},
}, },
order:1 order:1
} }

View File

@ -1362,6 +1362,7 @@ character.yijiang={
var target=result.targets[0]; var target=result.targets[0];
event.target=target; event.target=target;
target.chooseCard('将一张牌置于'+get.translation(player)+'的武将牌上,或令其弃置你的一张牌','he').set('ai',function(card){ target.chooseCard('将一张牌置于'+get.translation(player)+'的武将牌上,或令其弃置你的一张牌','he').set('ai',function(card){
if(card.name=='du') return 20;
var player=_status.event.player; var player=_status.event.player;
if(ai.get.attitude(player,_status.event.getParent().player)>0){ if(ai.get.attitude(player,_status.event.getParent().player)>0){
return 8-ai.get.value(card); return 8-ai.get.value(card);
@ -3385,6 +3386,7 @@ character.yijiang={
order:1, order:1,
result:{ result:{
target:function(player,target){ target:function(player,target){
if(player.num('h')==1&&player.num('h','du')) return -1;
if(player.hp<=2&&player.num('h','shan')) return 0; if(player.hp<=2&&player.num('h','shan')) return 0;
if(target.num('h')+player.num('h')>target.hp+2) return 0; if(target.num('h')+player.num('h')>target.hp+2) return 0;
if(ai.get.attitude(player,target)>3) return 1; if(ai.get.attitude(player,target)>3) return 1;
@ -5302,13 +5304,17 @@ character.yijiang={
return player!=target; return player!=target;
}, },
ai1:function(card){ ai1:function(card){
var player=_status.event.player;
if(player.maxHp-player.hp==1&&card.name=='du') return 30;
var check=_status.event.check; var check=_status.event.check;
if(check<1) return 0; if(check<1) return 0;
if(_status.event.player.hp>1&&check<2) return 0; if(player.hp>1&&check<2) return 0;
return ai.get.unuseful(card)+9; return ai.get.unuseful(card)+9;
}, },
ai2:function(target){ ai2:function(target){
return ai.get.attitude(_status.event.player,target)-2; var att=ai.get.attitude(_status.event.player,target);
if(ui.selected.cards.length==1&&ui.selected.cards[0].name=='du') return 1-att;
return att-2;
}, },
prompt:'将'+get.cnNumber(event.num)+'张手牌交给一名其他角色', prompt:'将'+get.cnNumber(event.num)+'张手牌交给一名其他角色',
}).set('check',check); }).set('check',check);

View File

@ -683,8 +683,10 @@ character.yxs={
"step 1" "step 1"
player.chooseTarget('是否发动【仗义】?',function(card,player,target){ player.chooseTarget('是否发动【仗义】?',function(card,player,target){
return player!=target return player!=target
}).ai=function(target){ }).set('du',(trigger.cards.length==1&&trigger.cards[0].name=='du')).ai=function(target){
return ai.get.attitude(player,target); var att=ai.get.attitude(_status.event.player,target);
if(_status.event.du) return -att;
return att;
}; };
"step 2" "step 2"
if(result.bool){ if(result.bool){

View File

@ -270,6 +270,7 @@ window.noname_asset_list=[
'image/card/xixueguizhihuan.png', 'image/card/xixueguizhihuan.png',
'image/card/xuanyuanjian.png', 'image/card/xuanyuanjian.png',
'image/card/yihuajiemu.png', 'image/card/yihuajiemu.png',
'image/card/yinyueqiang.png',
'image/card/yiyi.png', 'image/card/yiyi.png',
'image/card/yuanjiao.png', 'image/card/yuanjiao.png',
'image/card/yuxi.png', 'image/card/yuxi.png',

View File

@ -271,7 +271,7 @@ window.config={
right_click:'pause', right_click:'pause',
sort:'type_sort', sort:'type_sort',
cards:['standard','ex','extra','refresh'], cards:['standard','ex','extra','sp'],
characters:['standard','shenhua','refresh','sp','yijiang'], characters:['standard','shenhua','refresh','sp','yijiang'],
connect_characters:[], connect_characters:[],
connect_cards:[], connect_cards:[],

View File

@ -4961,6 +4961,14 @@
event.skillDialog.close(); event.skillDialog.close();
} }
if(event.result&&event.result.bool&&!game.online&&!event.nouse){ if(event.result&&event.result.bool&&!game.online&&!event.nouse){
if(event.logSkill){
if(typeof event.logSkill=='string'){
player.logSkill(event.logSkill);
}
else if(Array.isArray(event.logSkill)){
player.logSkill.apply(player,event.logSkill);
}
}
player.useResult(event.result,event); player.useResult(event.result,event);
} }
else if(event._sendskill){ else if(event._sendskill){
@ -8278,6 +8286,7 @@
var event=_status.event.getParent(); var event=_status.event.getParent();
var to=(player==event.player?event.target:event.player); var to=(player==event.player?event.target:event.player);
var addi=(ai.get.value(card)>=8&&get.type(card)!='equip')?-10:0; var addi=(ai.get.value(card)>=8&&get.type(card)!='equip')?-10:0;
if(card.name=='du') addi+=5;
if(player==event.player){ if(player==event.player){
if(ai.get.attitude(player,to)>0&&event.small){ if(ai.get.attitude(player,to)>0&&event.small){
return -get.number(card)-ai.get.value(card)/2+addi; return -get.number(card)-ai.get.value(card)/2+addi;
@ -8378,7 +8387,7 @@
} }
if(next.filterCard==undefined) next.filterCard=lib.filter.all; if(next.filterCard==undefined) next.filterCard=lib.filter.all;
if(next.selectCard==undefined) next.selectCard=[1,1]; if(next.selectCard==undefined) next.selectCard=[1,1];
if(next.ai==undefined) next.ai=ai.get.unuseful2; if(next.ai==undefined) next.ai=ai.get.unuseful3;
next.content=lib.element.playerproto.chooseCard; next.content=lib.element.playerproto.chooseCard;
next._args=Array.from(arguments); next._args=Array.from(arguments);
return next; return next;
@ -20511,7 +20520,7 @@
selectname.style.maxWidth='85px'; selectname.style.maxWidth='85px';
var skillopt=ui.create.selectlist(list2,list2[0],addSkill); var skillopt=ui.create.selectlist(list2,list2[0],addSkill);
var editSkillButton=document.createElement('button'); var editSkillButton=document.createElement('button');
editSkillButton.innerHTML='编辑'; editSkillButton.innerHTML='引用';
editSkillButton.style.marginRight='3px'; editSkillButton.style.marginRight='3px';
addSkill.appendChild(editSkillButton); addSkill.appendChild(editSkillButton);
var addSkillButton=document.createElement('button'); var addSkillButton=document.createElement('button');
@ -28651,6 +28660,10 @@
unuseful2:function(card){ unuseful2:function(card){
return 10-ai.get.useful(card); return 10-ai.get.useful(card);
}, },
unuseful3:function(card){
if(card.name=='du') return 20;
return 10-ai.get.useful(card);
},
value:function(card,player,method){ value:function(card,player,method){
var aii=get.info(card).ai; var aii=get.info(card).ai;
var value; var value;

View File

@ -19,9 +19,8 @@ character.pack={
card.pack={ card.pack={
standard:'标准', standard:'标准',
extra:'军争', extra:'军争',
refresh:'界限突破', sp:'SP',
guozhan:'国战', guozhan:'国战',
mingzhong:'SP',
zhenfa:'阵法', zhenfa:'阵法',
yunchou:'运筹帷幄', yunchou:'运筹帷幄',
swd:'轩辕剑', swd:'轩辕剑',

View File

@ -3,8 +3,7 @@ window.noname_source_list=[
'card/extra.js', 'card/extra.js',
'card/guozhan.js', 'card/guozhan.js',
'card/hearth.js', 'card/hearth.js',
'card/mingzhong.js', 'card/sp.js',
'card/refresh.js',
'card/shenqi.js', 'card/shenqi.js',
'card/standard.js', 'card/standard.js',
'card/swd.js', 'card/swd.js',

View File

@ -7,16 +7,27 @@ window.noname_update={
files:{ files:{
global:[ global:[
'game/game.js', 'game/game.js',
'game/config.js',
'game/asset.js', 'game/asset.js',
'game/package.js', 'game/package.js',
'game/source.js', 'game/source.js',
'character/hearth.js', 'character/hearth.js',
'character/swd.js', 'character/swd.js',
'character/sp.js', 'character/sp.js',
'character/ow.js',
'character/yijiang.js',
'character/shenhua.js',
'character/gujian.js',
'character/standard.js',
'character/refresh.js',
'character/extra.js',
'character/yxs.js',
'card/swd.js', 'card/swd.js',
'card/hearth.js', 'card/hearth.js',
'card/yunchou.js', 'card/yunchou.js',
'card/standard.js', 'card/standard.js',
'card/compensate.js',
'card/sp.js',
'layout/default/layout.css', 'layout/default/layout.css',
'theme/woodden/style.css', 'theme/woodden/style.css',
], ],

BIN
image/card/chenhuodajie.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

BIN
image/card/du.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
image/card/yinyueqiang.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB