流离AI
This commit is contained in:
parent
b5daee0a3f
commit
74103c8661
|
@ -993,15 +993,16 @@ character.refresh={
|
|||
position:'he',
|
||||
filterCard:{suit:'diamond'},
|
||||
filterTarget:function(card,player,target){
|
||||
if(player!=target) return lib.filter.targetEnabled({name:'lebu'},player,target);
|
||||
return target.num('j','lebu');
|
||||
if(player==target) return false;
|
||||
if(target.hasJudge('lebu')) return true;
|
||||
return lib.filter.targetEnabled({name:'lebu'},player,target);
|
||||
},
|
||||
check:function(card){
|
||||
return 7-ai.get.value(card);
|
||||
},
|
||||
content:function(){
|
||||
if(target.num('j','lebu')){
|
||||
target.discard(target.get('j','lebu',0));
|
||||
if(target.hasJudge('lebu')){
|
||||
target.discard(target.getJudge('lebu'));
|
||||
}
|
||||
else{
|
||||
target.addJudge('lebu',cards);
|
||||
|
@ -1011,7 +1012,7 @@ character.refresh={
|
|||
ai:{
|
||||
result:{
|
||||
target:function(player,target){
|
||||
if(target.num('j','lebu')) return -ai.get.effect(target,{name:'lebu'},player,target);
|
||||
if(target.hasJudge('lebu')) return -ai.get.effect(target,{name:'lebu'},player,target);
|
||||
return ai.get.effect(target,{name:'lebu'},player,target);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1047,16 +1047,19 @@ character.standard={
|
|||
if(target.num('he')==0) return;
|
||||
if(card.name!='sha') return;
|
||||
var min=1;
|
||||
var friend=ai.get.attitude(player,target)>0;
|
||||
var vcard={name:'shacopy',nature:card.nature,suit:card.suit};
|
||||
for(var i=0;i<game.players.length;i++){
|
||||
if(player!=game.players[i]&&
|
||||
ai.get.attitude(target,game.players[i])<0&&
|
||||
target.canUse(card,game.players[i])){
|
||||
if(min&&player.canUse(card,game.players[i])){
|
||||
min=0;
|
||||
}
|
||||
if(ai.get.effect(game.players[i],{name:'shacopy',nature:card.nature,suit:card.suit},player,player)>0){
|
||||
if(!friend) return 0;
|
||||
if(ai.get.effect(game.players[i],vcard,player,player)>0){
|
||||
if(!player.canUse(card,game.players[0])){
|
||||
return [0,0.1];
|
||||
}
|
||||
min=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return min;
|
||||
|
|
38
game/game.js
38
game/game.js
|
@ -3814,6 +3814,15 @@ window.play={};
|
|||
}
|
||||
return false;
|
||||
},
|
||||
getJudge:function(name){
|
||||
var judges=this.node.judges.childNodes;
|
||||
for(var i=0;i<judges.length;i++){
|
||||
if((judges[i].viewAs||judges[i].name)==name){
|
||||
return judges[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
$draw:function(num){
|
||||
var cards,node;
|
||||
if(get.itemtype(num)=='cards'){
|
||||
|
@ -6559,18 +6568,8 @@ window.play={};
|
|||
ui.configbg.listen(ui.click.config2);
|
||||
ui.configbg.oncontextmenu=ui.click.config2;
|
||||
ui.config=ui.create.div('#sidebar2.content');
|
||||
ui.config.listen(function(e){
|
||||
if(_status.choosing){
|
||||
if(_status.choosing.expand) _status.choosing.expand=false;
|
||||
else{
|
||||
_status.choosing.parentNode.style.height='';
|
||||
_status.choosing.nextSibling.delete();
|
||||
_status.choosing.previousSibling.show();
|
||||
delete _status.choosing;
|
||||
}
|
||||
}
|
||||
_status.clicked=true;
|
||||
return false;
|
||||
ui.config.listen(function(){
|
||||
// _status.clicked=true;
|
||||
});
|
||||
ui.config.oncontextmenu=function(e){
|
||||
e.stopPropagation();
|
||||
|
@ -8109,6 +8108,14 @@ window.play={};
|
|||
_status.editing.innerHTML=get.translation(_status.editing.link);
|
||||
delete _status.editing;
|
||||
}
|
||||
else if(_status.choosing){
|
||||
if(!_status.choosing.expand){
|
||||
_status.choosing.parentNode.style.height='';
|
||||
_status.choosing.nextSibling.delete();
|
||||
_status.choosing.previousSibling.show();
|
||||
delete _status.choosing;
|
||||
}
|
||||
}
|
||||
else if(ui.intro){
|
||||
ui.intro.close();
|
||||
delete ui.intro;
|
||||
|
@ -8185,7 +8192,12 @@ window.play={};
|
|||
}
|
||||
this.parentNode.style.height=(node.offsetHeight)+'px';
|
||||
_status.choosing=this;
|
||||
if(!_status.choosing.expand){
|
||||
_status.choosing.expand=true;
|
||||
setTimeout(function(){
|
||||
_status.choosing.expand=false;
|
||||
},500);
|
||||
}
|
||||
},
|
||||
choice:function(){
|
||||
if(_status.dragged) return;
|
||||
|
@ -8596,7 +8608,7 @@ window.play={};
|
|||
if(_status.config2){
|
||||
game.resume2();
|
||||
}
|
||||
e.stopPropagation();
|
||||
// e.stopPropagation();
|
||||
return false;
|
||||
},
|
||||
swap:function(){
|
||||
|
|
Loading…
Reference in New Issue