This commit is contained in:
libccy 2017-02-11 22:16:35 +08:00
parent ffde185827
commit 2cce257e7d
5 changed files with 65 additions and 63 deletions

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.countPlayer(lib.filter.all); event.num=game.countPlayer();
if(event.num%2==0){ if(event.num%2==0){
event.num--; event.num--;
} }
@ -619,7 +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;
if(player.hasUnknown()) return 0; if(player.hasUnknown(2)) 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.countPlayer(lib.filter.all)<=2; return game.countPlayer()<=2;
}, },
singleCard:true, singleCard:true,
type:'trick', type:'trick',

View File

@ -224,23 +224,25 @@ card.standard={
result:{ result:{
target:function(player,target){ target:function(player,target){
// if(player==target&&player.hp<=0) return 2; // if(player==target&&player.hp<=0) return 2;
var nh=target.num('h'); var nd=player.needsToDiscard();
var keep=false; var keep=false;
if(nh<=target.hp){ if(nd<=0){
keep=true; keep=true;
} }
else if(nh==target.hp+1&&target.hp>=2&&target.num('h','tao')<=1){ else if(nd==1&&target.hp>=2&&target.num('h','tao')<=1){
keep=true; keep=true;
} }
var mode=get.mode(); var mode=get.mode();
if(target.hp>=2&&keep&&target.hasFriend()){ if(target.hp>=2&&keep&&target.hasFriend()){
if(target.hp>2) return 0; if(target.hp>2||nd==0) return 0;
if(target.hp==2){ if(target.hp==2){
for(var i=0;i<game.players.length;i++){ if(game.hasPlayer(function(current){
if(target!=game.players[i]&&ai.get.attitude(target,game.players[i])>=3){ if(target!=current&&ai.get.attitude(target,current)>=3){
if(game.players[i].hp<=1) return 0; if(current.hp<=1) return true;
if(mode=='identity'&&game.players[i].isZhu&&game.players[i].hp<=2) return 0; if((mode=='identity'||mode=='versus'||mode=='chess')&&current.identity=='zhu'&&current.hp<=2) return true;
} }
})){
return 0;
} }
} }
} }
@ -250,13 +252,11 @@ card.standard={
var tri=_status.event.getTrigger(); var tri=_status.event.getTrigger();
if(mode=='identity'&&player.identity=='fan'&&target.identity=='fan'){ if(mode=='identity'&&player.identity=='fan'&&target.identity=='fan'){
if(tri&&tri.name=='dying'&&tri.source&&tri.source.identity=='fan'&&tri.source!=target){ if(tri&&tri.name=='dying'&&tri.source&&tri.source.identity=='fan'&&tri.source!=target){
var num=0; var num=game.countPlayer(function(current){
for(var i=0;i<game.players.length;i++){ if(current.identity=='fan'){
if(game.players[i].identity=='fan'){ return current.num('h','tao');
num+=game.players[i].num('h','tao');
if(num>2) return 2;
} }
} });
if(num>1&&player==target) return 2; if(num>1&&player==target) return 2;
return 0; return 0;
} }
@ -334,17 +334,14 @@ card.standard={
ai:{ ai:{
basic:{ basic:{
equipValue:function(card,player){ equipValue:function(card,player){
var num=1,i,no_target=true; if(!game.hasPlayer(function(current){
for(i=0;i<game.players.length;i++){ return player.canUse('sha',current)&&ai.get.effect(current,{name:'sha'},player,player)<0;
if(player.canUse({name:'sha'},game.players[i])) { })){
if(ai.get.attitude(player,game.players[i])<0){ return 1;
no_target=false;break;
}
}
} }
if(no_target) return 1; var num=player.num('h','sha');
num+=player.get('h','sha').length; if(num>1) return 4+num;
return num+1; return 2+num;
} }
} }
}, },
@ -474,7 +471,7 @@ card.standard={
} }
"step 3" "step 3"
ui.clear(); ui.clear();
var cards=get.cards(game.players.length); var cards=get.cards(game.countPlayer());
var dialog=ui.create.dialog('五谷丰登',cards,true); var dialog=ui.create.dialog('五谷丰登',cards,true);
_status.dieClose.push(dialog); _status.dieClose.push(dialog);
dialog.videoId=lib.status.videoId++; dialog.videoId=lib.status.videoId++;
@ -589,12 +586,10 @@ card.standard={
if(target==player) return 1.5; if(target==player) return 1.5;
return 1; return 1;
} }
var num=0; if(player.hasUnknown(2)){
for(var i=0;i<game.players.length;i++){ return 0;
if(game.players[i].ai.shown==0) num++;
} }
if(num>1) return 0; return 2-2*get.distance(player,target,'absolute')/game.countPlayer();
return 2-2*get.distance(player,target,'absolute')/game.players.length;
} }
}, },
tag:{ tag:{
@ -672,11 +667,7 @@ card.standard={
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
var num=0; if(player.hasUnknown(2)) 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('h'); var nh=target.num('h');
if(get.mode()=='identity'){ if(get.mode()=='identity'){
if(target.isZhu&&nh<=2&&target.hp<=1) return -100; if(target.isZhu&&nh<=2&&target.hp<=1) return -100;
@ -734,11 +725,7 @@ card.standard={
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
var num=0; if(player.hasUnknown(2)) 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('h'); var nh=target.num('h');
if(get.mode()=='identity'){ if(get.mode()=='identity'){
if(target.isZhu&&nh<=2&&target.hp<=1) return -100; if(target.isZhu&&nh<=2&&target.hp<=1) return -100;
@ -1233,17 +1220,21 @@ card.standard={
}, },
result:{ result:{
target:function(player,target){ target:function(player,target){
var rejudge,num=0; var num=game.countPlayer(function(current){
for(var i=0;i<game.players.length;i++){ var skills=current.get('s');
for(var j=0;j<game.players[i].skills.length;j++){ for(var j=0;j<current.skills.length;j++){
rejudge=get.tag(game.players[i].skills[j],'rejudge',game.players[i]); var rejudge=get.tag(current.skills[j],'rejudge',current);
if(rejudge!=undefined){ if(rejudge!=undefined){
if(ai.get.attitude(target,game.players[i])>0&& if(ai.get.attitude(target,current)>0&&
ai.get.attitude(game.players[i],target)>0) num+=rejudge; ai.get.attitude(current,target)>0){
else num-=rejudge; return rejudge;
}
else{
return -rejudge;
}
} }
} }
} });
if(num>0) return num; if(num>0) return num;
if(num==0){ if(num==0){
var mode=get.mode(); var mode=get.mode();
@ -1259,12 +1250,14 @@ card.standard={
} }
else if(mode=='guozhan'){ else if(mode=='guozhan'){
if(target.identity=='ye') return 1; if(target.identity=='ye') return 1;
for(var i=0;i<game.players.length;i++){ if(game.hasPlayer(function(current){
if(game.players[i].identity=='unknown') return -1; return current.identity=='unknown';
})){
return -1;
} }
if(get.population(target.identity)==1){ if(get.population(target.identity)==1){
if(target.maxHp>2&&target.hp<2) return 1; if(target.maxHp>2&&target.hp<2) return 1;
if(game.players.length<3) return -1; if(game.countPlayer()<3) return -1;
if(target.hp<=2&&target.num('he')<=3) return 1; if(target.hp<=2&&target.num('he')<=3) return 1;
} }
} }
@ -1701,14 +1694,11 @@ card.standard={
} }
}; };
'step 1' 'step 1'
var list=[]; var list=game.filterPlayer(function(current){
return current.hasWuxie();
});
event.list=list; event.list=list;
event.id=get.id(); event.id=get.id();
for(var i=0;i<game.players.length;i++){
if(game.players[i].hasWuxie()){
list.push(game.players[i]);
}
}
list.sort(function(a,b){ list.sort(function(a,b){
return get.distance(event.source,a,'absolute')-get.distance(event.source,b,'absolute'); return get.distance(event.source,a,'absolute')-get.distance(event.source,b,'absolute');
}); });

View File

@ -3175,7 +3175,7 @@ card.swd={
}, },
ai:{ ai:{
tag:{ tag:{
rejudge:10 rejudge:1
} }
} }
}, },

View File

@ -13039,12 +13039,18 @@
} }
return false; return false;
}, },
hasUnknown:function(){ hasUnknown:function(num){
var mode=get.mode(); var mode=get.mode();
if(typeof num!='number'){
num=0;
}
if(mode=='identity'||mode=='guozhan'){ if(mode=='identity'||mode=='guozhan'){
for(var i=0;i<game.players.length;i++){ for(var i=0;i<game.players.length;i++){
if(game.players[i].ai.shown==0&&game.players[i]!=this){ if(game.players[i].ai.shown==0&&game.players[i]!=this){
return true; num--;
if(num<=0){
return true;
}
} }
} }
} }
@ -22675,6 +22681,9 @@
}, },
countPlayer:function(func){ countPlayer:function(func){
var num=0; var num=0;
if(typeof func!='function'){
func=lib.filter.all;
}
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;
var result=func(game.players[i]); var result=func(game.players[i]);
@ -22691,6 +22700,9 @@
if(!Array.isArray(list)){ if(!Array.isArray(list)){
list=[]; list=[];
} }
if(typeof func!='function'){
func=lib.filter.all;
}
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])){