This commit is contained in:
libccy 2017-02-11 21:42:46 +08:00
parent 6e8185616d
commit ffde185827
8 changed files with 86 additions and 119 deletions

View File

@ -667,11 +667,9 @@ card.gujian={
return target!=player&&target.num('he')>0; return target!=player&&target.num('he')>0;
}, },
changeTarget:function(player,targets){ changeTarget:function(player,targets){
game.countPlayer(function(current){ game.filterPlayer(function(current){
if(get.distance(targets[0],current,'pure')==1&&current.num('he')){ return get.distance(targets[0],current,'pure')==1&&current.num('he');
targets.push(current); },targets);
}
});
}, },
content:function(){ content:function(){
var he=target.get('he'); var he=target.get('he');

View File

@ -89,21 +89,18 @@ card.guozhan={
fullskin:true, fullskin:true,
type:'trick', type:'trick',
enable:function(card,player){ enable:function(card,player){
for(var i=0;i<game.players.length;i++){ return game.hasPlayer(function(current){
if(game.players[i].isMajor()) return true; return current.isMajor();
} });
return false;
}, },
mode:['guozhan'], mode:['guozhan'],
filterTarget:true, filterTarget:true,
chongzhu:true, chongzhu:true,
changeTarget:function(player,targets){ changeTarget:function(player,targets){
var target=targets[0]; var target=targets[0];
for(var i=0;i<game.players.length;i++){ game.filterPlayer(function(current){
if(game.players[i].isMajor()==target.isMajor()&&game.players[i]!=target){ return current.isMajor()==target.isMajor()&&current!=target;
targets.push(game.players[i]); },targets);
}
}
}, },
content:function(){ content:function(){
if(target.isLinked()){ if(target.isLinked()){
@ -122,18 +119,16 @@ card.guozhan={
}, },
result:{ result:{
player:function(player,target){ player:function(player,target){
var num=0; return game.countPlayer(function(current){
for(var i=0;i<game.players.length;i++){ if(target.isMajor()==current.isMajor()){
if(target.isMajor()==game.players[i].isMajor()){ if(current.isLinked()){
if(game.players[i].isLinked()){ return ai.get.attitude(player,target);
num+=ai.get.attitude(player,target);
} }
else{ else{
num-=ai.get.attitude(player,target)*0.8; return -ai.get.attitude(player,target)*0.8;
} }
} }
} });
return num;
} }
} }
} }
@ -152,11 +147,9 @@ card.guozhan={
var target=targets[0]; var target=targets[0];
targets.push(player); targets.push(player);
if(target.identity!='ye'){ if(target.identity!='ye'){
for(var i=0;i<game.players.length;i++){ game.filterPlayer(function(current){
if(target!=game.players[i]&&target.identity==game.players[i].identity){ return target!=current&&target.identity==current.identity;
targets.push(game.players[i]); },targets);
}
}
} }
}, },
content:function(){ content:function(){
@ -264,15 +257,14 @@ card.guozhan={
player:function(player,target){ player:function(player,target){
var att=ai.get.attitude(player,target); var att=ai.get.attitude(player,target);
if(target.hp==1&&att<0) return 0; if(target.hp==1&&att<0) return 0;
for(var i=0;i<game.players.length;i++){ if(game.hasPlayer(function(current){
if(game.players[i]==target) continue; return ai.get.attitude(player,current)<att;
if(ai.get.attitude(player,game.players[i])<att){ })){
var num=1; var num=1;
if(target==player.next||target==player.previous){ if(target==player.next||target==player.previous){
num+=0.5; num+=0.5;
}
return num;
} }
return num;
} }
return 0; return 0;
} }
@ -301,36 +293,28 @@ card.guozhan={
return target==next||target.inline(next); return target==next||target.inline(next);
} }
if(player==target) return false; if(player==target) return false;
var link=false; if(game.hasPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.isLinked()&&current!=player;
if(game.players[i].isLinked()&&game.players[i]!=player){ })){
link=true;break;
}
}
if(link){
if(!target.isLinked()) return false; if(!target.isLinked()) return false;
var distance=get.distance(player,target,'absolute'); var distance=get.distance(player,target,'absolute');
for(var i=0;i<game.players.length;i++){ return !game.hasPlayer(function(current){
if(target!=game.players[i]&& if(target!=current&&current!=player&&current.isLinked()){
game.players[i]!=player&& var dist=get.distance(player,current,'absolute');
game.players[i].isLinked()){ if(dist<distance){
if(get.distance(player,game.players[i],'absolute')<distance){ return true;
return false;
} }
if(get.distance(player,game.players[i],'absolute')==distance&& if(dist==distance&&parseInt(current.dataset.position)<parseInt(target.dataset.position)){
parseInt(game.players[i].dataset.position)<parseInt(target.dataset.position)){ return true;
return false;
} }
} }
} });
return true;
} }
else{ else{
var dist=get.distance(player,target); var dist=get.distance(player,target);
for(var i=0;i<game.players.length;i++){ return !game.hasPlayer(function(current){
if(game.players[i]!=player&&get.distance(player,game.players[i])<dist) return false; return current!=player&&get.distance(player,current)<dist
} });
return true;
} }
}, },
enable:true, enable:true,
@ -353,19 +337,11 @@ card.guozhan={
if(!target.isLinked()){ if(!target.isLinked()){
return ai.get.damageEffect(target,player,target,'fire'); return ai.get.damageEffect(target,player,target,'fire');
} }
var num=0; return game.countPlayer(function(current){
for(var i=0;i<game.players.length;i++){ if(current.isLinked()){
if(game.players[i].isLinked()){ return get.sgn(ai.get.damageEffect(current,player,target,'fire'));
var eff=ai.get.damageEffect(game.players[i],player,target,'fire');
if(eff>0){
num++;
}
else if(eff<0){
num--;
}
} }
} });
return num;
} }
} }
} }
@ -527,11 +503,9 @@ card.guozhan={
basic:{ basic:{
equipValue:function(card,player){ equipValue:function(card,player){
if(player.identity=='unknown'||player.identity=='ye') return 2.5; if(player.identity=='unknown'||player.identity=='ye') return 2.5;
var num=2; return 2+game.countPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current.identity==player.identity;
if(game.players[i].identity==player.identity) num+=0.5; })/2;
}
return num;
} }
} }
}, },
@ -574,10 +548,9 @@ card.guozhan={
trigger:{player:'phaseUseBegin'}, trigger:{player:'phaseUseBegin'},
forced:true, forced:true,
filter:function(event,player){ filter:function(event,player){
for(var i=0;i<game.players.length;i++){ return game.hasPlayer(function(current){
if(player.canUse({name:'zhibi'},game.players[i])) return true; return player.canUse('zhibi',current);
} });
return false;
}, },
content:function(){ content:function(){
'step 0' 'step 0'
@ -810,13 +783,12 @@ card.guozhan={
_wuliu_skill2:{ _wuliu_skill2:{
mod:{ mod:{
attackFrom:function(from,to,distance){ attackFrom:function(from,to,distance){
for(var i=0;i<game.players.length;i++){ return distance-game.countPlayer(function(current){
if(game.players[i]==from) continue; if(current==from) return false;
if(game.players[i].identity=='unknown'||game.players[i].identity=='ye') continue; if(current.identity=='unknown'||current.identity=='ye') return false;
if(game.players[i].identity!=from.identity) continue; if(current.identity!=from.identity) return false;
if(game.players[i].num('e','wuliu')) distance--; if(current.hasSkill('wuliu_skill')) return true;
} });
return distance;
} }
} }
}, },
@ -828,11 +800,9 @@ card.guozhan={
if(player.num('h')==0) return false; if(player.num('h')==0) return false;
if(!event.card) return false; if(!event.card) return false;
if(event.card.name!='sha') return false; if(event.card.name!='sha') return false;
var num=0; return game.hasPlayer(function(current){
for(var i=0;i<game.players.length;i++){ return current!=event.player&&get.distance(event.player,current)<=1;
if(game.players[i]!=event.player&&get.distance(event.player,game.players[i])<=1) num++; });
}
return num>0;
}, },
content:function(){ content:function(){
"step 0" "step 0"

View File

@ -423,7 +423,7 @@ card.hearth={
content:function(){ content:function(){
'step 0' 'step 0'
event.current=target; event.current=target;
event.num=game.players.length; event.num=game.countPlayer(lib.filter.all);
if(event.num%2==0){ if(event.num%2==0){
event.num--; event.num--;
} }
@ -619,11 +619,7 @@ card.hearth={
result:{ result:{
target:function(player,target){ target:function(player,target){
if(target.hasSkillTag('nothunder')) return 0; if(target.hasSkillTag('nothunder')) return 0;
var num=0; if(player.hasUnknown()) return 0;
for(var i=0;i<game.players.length;i++){
if(game.players[i].ai.shown==0) num++;
}
if(num>1) return 0;
var nh=target.num('he'); var nh=target.num('he');
if(target==player) nh--; if(target==player) nh--;
if(nh==2) return -2.5; if(nh==2) return -2.5;

View File

@ -68,7 +68,7 @@ card.sp={
fullskin:true, fullskin:true,
enable:true, enable:true,
chongzhu:function(){ chongzhu:function(){
return game.players.length<=2; return game.countPlayer(lib.filter.all)<=2;
}, },
singleCard:true, singleCard:true,
type:'trick', type:'trick',
@ -200,25 +200,23 @@ card.sp={
}, },
result:{ result:{
player:function(player,target){ player:function(player,target){
var num=0; return game.countPlayer(function(current){
for(var i=0;i<game.players.length;i++){ if(get.distance(target,current)<=1&&current!=target){
if(get.distance(target,game.players[i])<=1&&game.players[i]!=target){ var att=ai.get.attitude(player,current);
var att=ai.get.attitude(player,game.players[i]);
if(att>3){ if(att>3){
num+=1.1; return 1.1;
} }
else if(att>0){ else if(att>0){
num++; return 1;
} }
else if(att<-3){ else if(att<-3){
num-=1.1; return -1.1;
} }
else if(att<0){ else if(att<0){
num--; return -1;
} }
} }
} });
return num;
}, },
target:-1 target:-1
}, },
@ -304,14 +302,12 @@ card.sp={
game.broadcast(function(muniu,cards){ game.broadcast(function(muniu,cards){
muniu.cards=cards; muniu.cards=cards;
},muniu,muniu.cards); },muniu,muniu.cards);
var players=[]; var players=game.filterPlayer(function(current){
for(var i=0;i<game.players.length;i++){ if(!current.get('e','5')&&current!=player&&!current.isTurnedOver()&&
if(!game.players[i].get('e','5')&&game.players[i]!=player&& ai.get.attitude(player,current)>=3&&ai.get.attitude(current,player)>=3){
!game.players[i].isTurnedOver()&& return true;
ai.get.attitude(player,game.players[i])>=3&&ai.get.attitude(game.players[i],player)>=3){
players.push(game.players[i]);
} }
} });
players.sort(lib.sort.seat); players.sort(lib.sort.seat);
var choice=players[0]; var choice=players[0];
var next=player.chooseTarget('是否移动木牛流马?',function(card,player,target){ var next=player.chooseTarget('是否移动木牛流马?',function(card,player,target){

View File

@ -74,7 +74,6 @@ window.characterRank={
'hs_laxiao', 'hs_laxiao',
'hs_shaku', 'hs_shaku',
'hs_fandral', 'hs_fandral',
'hs_totemic',
'sundeng', 'sundeng',
'hs_xialikeer', 'hs_xialikeer',
'hs_sainaliusi', 'hs_sainaliusi',
@ -144,6 +143,7 @@ window.characterRank={
], ],
am:[ am:[
'old_wangyi', 'old_wangyi',
'hs_totemic',
'swd_duanmeng', 'swd_duanmeng',
'pal_wenhui', 'pal_wenhui',
'gjqt_xunfang', 'gjqt_xunfang',

View File

@ -22687,12 +22687,14 @@
} }
return num; return num;
}, },
filterPlayer:function(func){ filterPlayer:function(func,list){
var list=[]; if(!Array.isArray(list)){
list=[];
}
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].isOut()) continue; if(game.players[i].isOut()) continue;
if(func(game.players[i])){ if(func(game.players[i])){
list.push(game.players[i]); list.add(game.players[i]);
} }
} }
return list; return list;
@ -33150,6 +33152,11 @@
return false; return false;
}, },
}, },
sgn:function(num){
if(num>0) return 1;
if(num<0) return -1;
return 0;
},
rand:function(num,num2){ rand:function(num,num2){
if(typeof num2=='number'){ if(typeof num2=='number'){
return num+Math.floor(Math.random()*(num2-num+1)); return num+Math.floor(Math.random()*(num2-num+1));

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

@ -752,7 +752,7 @@ table {
opacity: 0; opacity: 0;
pointer-events: none; pointer-events: none;
} }
#arena.auto #me .card{ #arena.auto #me .handcards{
opacity: 0.5 opacity: 0.5
} }
#autonode>div { #autonode>div {