This commit is contained in:
parent
242e2bba28
commit
0ada36f702
|
@ -1827,11 +1827,7 @@ card.swd={
|
||||||
result:{
|
result:{
|
||||||
target:function(player,target){
|
target:function(player,target){
|
||||||
if(target.hasSkillTag('nofire')) return 0;
|
if(target.hasSkillTag('nofire')) return 0;
|
||||||
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(lib.config.mode=='identity'){
|
if(lib.config.mode=='identity'){
|
||||||
if(target.isZhu&&nh<=2&&target.hp<=1) return -100;
|
if(target.isZhu&&nh<=2&&target.hp<=1) return -100;
|
||||||
|
|
103
card/yunchou.js
103
card/yunchou.js
|
@ -32,7 +32,7 @@ card.yunchou={
|
||||||
}
|
}
|
||||||
"step 3"
|
"step 3"
|
||||||
ui.clear();
|
ui.clear();
|
||||||
var cards=get.cards(Math.ceil(game.players.length/2));
|
var cards=get.cards(Math.ceil(game.countPlayer()/2));
|
||||||
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++;
|
||||||
|
@ -147,7 +147,7 @@ card.yunchou={
|
||||||
player:1,
|
player:1,
|
||||||
target:function(player,target){
|
target:function(player,target){
|
||||||
if(target.num('h')==0) return 0;
|
if(target.num('h')==0) return 0;
|
||||||
return (Math.sqrt(target.num('h'))-get.distance(player,target,'absolute')/game.players.length/3)/2;
|
return (Math.sqrt(target.num('h'))-get.distance(player,target,'absolute')/countPlayer()/3)/2;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tag:{
|
tag:{
|
||||||
|
@ -304,12 +304,9 @@ card.yunchou={
|
||||||
modTarget:true,
|
modTarget:true,
|
||||||
content:function(){
|
content:function(){
|
||||||
'step 0'
|
'step 0'
|
||||||
var list=[];
|
var list=game.filterPlayer(function(current){
|
||||||
for(var i=0;i<game.players.length;i++){
|
return current!=target&¤t.num('h');
|
||||||
if(game.players[i]!=target&&game.players[i].num('h')){
|
});
|
||||||
list.push(game.players[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!list.length){
|
if(!list.length){
|
||||||
target.draw(3);
|
target.draw(3);
|
||||||
event.finish();
|
event.finish();
|
||||||
|
@ -524,11 +521,7 @@ card.yunchou={
|
||||||
multitarget:true,
|
multitarget:true,
|
||||||
multiline:true,
|
multiline:true,
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
var num=target.num('h');
|
return target.isFewestHandcard();
|
||||||
for(var i=0;i<game.players.length;i++){
|
|
||||||
if(game.players[i].num('h')<num) return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
content:function(){
|
content:function(){
|
||||||
var num=[];
|
var num=[];
|
||||||
|
@ -756,11 +749,12 @@ card.yunchou={
|
||||||
effect:function(){
|
effect:function(){
|
||||||
if(result.judge){
|
if(result.judge){
|
||||||
player.damage(2,'fire','nosource');
|
player.damage(2,'fire','nosource');
|
||||||
var players=get.players();
|
var players=game.filterPlayer(function(current){
|
||||||
for(var i=0;i<game.players.length;i++){
|
return get.distance(player,current)<=1&&player!=current;
|
||||||
if(get.distance(player,game.players[i])<=1&&player!=game.players[i]){
|
});
|
||||||
game.players[i].damage(1,'fire','nosource');
|
players.sort(lib.sort.seat);
|
||||||
}
|
for(var i=0;i<players.length;i++){
|
||||||
|
players[i].damage(1,'fire','nosource');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -826,42 +820,7 @@ card.yunchou={
|
||||||
order:1,
|
order:1,
|
||||||
result:{
|
result:{
|
||||||
target:function(player,target){
|
target:function(player,target){
|
||||||
var rejudge,num=0;
|
return lib.card.shandian.ai.result.target(player,target);
|
||||||
for(var i=0;i<game.players.length;i++){
|
|
||||||
for(var j=0;j<game.players[i].skills.length;j++){
|
|
||||||
rejudge=get.tag(game.players[i].skills[j],'rejudge',game.players[i]);
|
|
||||||
if(rejudge!=undefined){
|
|
||||||
if(ai.get.attitude(target,game.players[i])>0&&
|
|
||||||
ai.get.attitude(game.players[i],target)>0) num+=rejudge;
|
|
||||||
else num-=rejudge;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(num>0) return num;
|
|
||||||
if(num==0){
|
|
||||||
if(lib.config.mode=='identity'){
|
|
||||||
if(target.identity=='nei') return 1;
|
|
||||||
var situ=ai.get.situation();
|
|
||||||
if(target.identity=='fan'){
|
|
||||||
if(situ>1) return 1;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if(situ<-1) return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(lib.config.mode=='guozhan'){
|
|
||||||
if(target.identity=='ye') return 1;
|
|
||||||
for(var i=0;i<game.players.length;i++){
|
|
||||||
if(game.players[i].identity=='unknown') return -1;
|
|
||||||
}
|
|
||||||
if(get.population(target.identity)==1){
|
|
||||||
if(target.maxHp>2&&target.hp<2) return 1;
|
|
||||||
if(game.players.length<3) return -1;
|
|
||||||
if(target.hp<=2&&target.num('he')<=3) return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tag:{
|
tag:{
|
||||||
|
@ -969,41 +928,7 @@ card.yunchou={
|
||||||
order:1,
|
order:1,
|
||||||
result:{
|
result:{
|
||||||
target:function(player,target){
|
target:function(player,target){
|
||||||
var rejudge,num=0;
|
return lib.card.shandian.ai.result.target.call(player,target);
|
||||||
for(var i=0;i<game.players.length;i++){
|
|
||||||
for(var j=0;j<game.players[i].skills.length;j++){
|
|
||||||
rejudge=get.tag(game.players[i].skills[j],'rejudge',game.players[i]);
|
|
||||||
if(rejudge!=undefined){
|
|
||||||
if(ai.get.attitude(target,game.players[i])>0&&
|
|
||||||
ai.get.attitude(game.players[i],target)>0) num+=rejudge;
|
|
||||||
else num-=rejudge;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(num>0) return num;
|
|
||||||
if(num==0){
|
|
||||||
if(lib.config.mode=='identity'){
|
|
||||||
if(target.identity=='nei') return 1;
|
|
||||||
var situ=ai.get.situation();
|
|
||||||
if(target.identity=='fan'){
|
|
||||||
if(situ>0) return 1;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if(situ<0) return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(lib.config.mode=='guozhan'){
|
|
||||||
if(game.players.length<=2) return -1;
|
|
||||||
if(target.identity=='ye') return 1;
|
|
||||||
for(var i=0;i<game.players.length;i++){
|
|
||||||
if(game.players[i].identity=='unknown') return -1;
|
|
||||||
}
|
|
||||||
if(get.population(target.identity)==1){
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,9 @@ card.zhenfa={
|
||||||
selectTarget:-1,
|
selectTarget:-1,
|
||||||
multitarget:true,
|
multitarget:true,
|
||||||
content:function(){
|
content:function(){
|
||||||
var n=game.players.length;
|
var n=targets.length;
|
||||||
while(n--){
|
while(n--){
|
||||||
game.swapSeat(game.players.randomGet(),game.players.randomGet());
|
game.swapSeat(targets.randomGet(),targets.randomGet());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mode:['guozhan'],
|
mode:['guozhan'],
|
||||||
|
@ -53,10 +53,9 @@ card.zhenfa={
|
||||||
type:'zhenfa',
|
type:'zhenfa',
|
||||||
chongzhu:true,
|
chongzhu:true,
|
||||||
enable:function(){
|
enable:function(){
|
||||||
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;
|
|
||||||
},
|
},
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
return target.isMajor()&&target.num('he')>0;
|
return target.isMajor()&&target.num('he')>0;
|
||||||
|
@ -80,10 +79,9 @@ card.zhenfa={
|
||||||
type:'zhenfa',
|
type:'zhenfa',
|
||||||
chongzhu:true,
|
chongzhu:true,
|
||||||
enable:function(){
|
enable:function(){
|
||||||
for(var i=0;i<game.players.length;i++){
|
return game.hasPlayer(function(current){
|
||||||
if(game.players[i].isMinor()) return true;
|
return current.isMinor();
|
||||||
}
|
});
|
||||||
return false;
|
|
||||||
},
|
},
|
||||||
multitarget:true,
|
multitarget:true,
|
||||||
multiline:true,
|
multiline:true,
|
||||||
|
@ -193,10 +191,9 @@ card.zhenfa={
|
||||||
enable:function(card,player){
|
enable:function(card,player){
|
||||||
if(player.identity=='unknown'||player.identity=='ye') return false;
|
if(player.identity=='unknown'||player.identity=='ye') return false;
|
||||||
if(get.population(player.identity)<=1) return false;
|
if(get.population(player.identity)<=1) return false;
|
||||||
for(var i=0;i<game.players.length;i++){
|
return game.hasPlayer(function(current){
|
||||||
if(game.players[i]!=player&&game.players[i].identity==player.identity&&!player.inline(game.players[i])) return true;
|
return current!=player&¤t.identity==player.identity&&!player.inline(current);
|
||||||
}
|
});
|
||||||
return false;
|
|
||||||
},
|
},
|
||||||
filterTarget:function(card,player,target){
|
filterTarget:function(card,player,target){
|
||||||
return target.identity==player.identity;
|
return target.identity==player.identity;
|
||||||
|
|
|
@ -12932,6 +12932,7 @@
|
||||||
},
|
},
|
||||||
isHighestHp:function(equal){
|
isHighestHp:function(equal){
|
||||||
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(equal){
|
if(equal){
|
||||||
if(game.players[i].hp>=this.hp) return false;
|
if(game.players[i].hp>=this.hp) return false;
|
||||||
}
|
}
|
||||||
|
@ -12943,6 +12944,7 @@
|
||||||
},
|
},
|
||||||
isLowestHp:function(equal){
|
isLowestHp:function(equal){
|
||||||
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(equal){
|
if(equal){
|
||||||
if(game.players[i].hp<=this.hp) return false;
|
if(game.players[i].hp<=this.hp) return false;
|
||||||
}
|
}
|
||||||
|
@ -12955,6 +12957,7 @@
|
||||||
isMostHandcard:function(equal){
|
isMostHandcard:function(equal){
|
||||||
var nh=this.num('h');
|
var nh=this.num('h');
|
||||||
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(equal){
|
if(equal){
|
||||||
if(game.players[i].num('h')>=nh) return false;
|
if(game.players[i].num('h')>=nh) return false;
|
||||||
}
|
}
|
||||||
|
@ -12967,6 +12970,7 @@
|
||||||
isFewestHandcard:function(equal){
|
isFewestHandcard:function(equal){
|
||||||
var nh=this.num('h');
|
var nh=this.num('h');
|
||||||
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(equal){
|
if(equal){
|
||||||
if(game.players[i].num('h')<=nh) return false;
|
if(game.players[i].num('h')<=nh) return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue