及时移除部分失效的全局ai以提高游戏流畅度
This commit is contained in:
parent
a8d60ed38f
commit
67d3559612
|
@ -7778,7 +7778,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
mod:{
|
||||
globalFrom:function(from,to,num){
|
||||
return num-game.countPlayer(function(current){
|
||||
return current!=from&¤t.isFriendOf(from)&¤t.hasSkill('yuzuru_bujin');
|
||||
return current!=from&¤t.hasSkill('yuzuru_bujin')&¤t.isFriendOf(from);
|
||||
});
|
||||
},
|
||||
},
|
||||
|
@ -11916,6 +11916,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
},
|
||||
nslongyue:{
|
||||
init:()=>{
|
||||
game.addGlobalSkill('nslongyue_ai');
|
||||
},
|
||||
onremove:()=>{
|
||||
if(!game.hasPlayer(i=>i.hasSkill('nslongyue'),true)) game.removeGlobalSkill('nslongyue_ai');
|
||||
},
|
||||
trigger:{global:'useCard'},
|
||||
filter:function(event,player){
|
||||
return get.type(event.card,'trick')=='trick'&&event.player.getHistory('useCard').indexOf(event)==0;
|
||||
|
@ -11929,8 +11935,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
ai:{
|
||||
expose:0.2,
|
||||
},
|
||||
global:'nslongyue_ai',
|
||||
}
|
||||
},
|
||||
nslongyue_ai:{
|
||||
mod:{
|
||||
|
@ -11940,6 +11945,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
})) return num+6;
|
||||
},
|
||||
},
|
||||
trigger:{player:'dieAfter'},
|
||||
filter:()=>{
|
||||
return !game.hasPlayer(i=>i.hasSkill('nslongyue'),true);
|
||||
},
|
||||
silent:true,
|
||||
forceDie:true,
|
||||
content:()=>{
|
||||
game.removeGlobalSkill('nslongyue_ai');
|
||||
}
|
||||
},
|
||||
nszhenyin:{
|
||||
trigger:{global:'judge'},
|
||||
|
|
|
@ -1638,11 +1638,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
},
|
||||
meiying:{
|
||||
global:'meiying2',
|
||||
globalSilent:true,
|
||||
trigger:{global:'phaseEnd'},
|
||||
filter:function(event,player){
|
||||
return event.player!=player&&!event.player.tempSkills.meiying3&&event.player.isAlive()&&player.countCards('he',{color:'red'})>0;
|
||||
return event.player!=player&&event.player.isAlive()&&player.countCards('he',{color:'red'})&&event.player.getHistory('useCard',evt=>{
|
||||
return evt.targets&&evt.targets.some(i=>i!==event.player);
|
||||
}).length===0;
|
||||
},
|
||||
direct:true,
|
||||
content:function(){
|
||||
|
@ -1665,18 +1666,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
expose:0.1
|
||||
}
|
||||
},
|
||||
meiying2:{
|
||||
trigger:{player:'useCard'},
|
||||
filter:function(event,player){
|
||||
return _status.currentPhase==player&&event.targets&&(event.targets.length>1||event.targets[0]!=player);
|
||||
},
|
||||
forced:true,
|
||||
popup:false,
|
||||
content:function(){
|
||||
player.addTempSkill('meiying3');
|
||||
}
|
||||
},
|
||||
meiying3:{},
|
||||
jianwu:{
|
||||
trigger:{player:'shaBegin'},
|
||||
forced:true,
|
||||
|
|
|
@ -1850,6 +1850,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
//裴元绍
|
||||
dcmoyu:{
|
||||
audio:2,
|
||||
init:()=>{
|
||||
game.addGlobalSkill('dcmoyu_ai');
|
||||
},
|
||||
onremove:()=>{
|
||||
if(!game.hasPlayer(i=>i.hasSkill('dcmoyu'),true)) game.removeGlobalSkill('dcmoyu_ai');
|
||||
},
|
||||
enable:'phaseUse',
|
||||
filter:function(event,player){
|
||||
return !player.hasSkill('dcmoyu_ban')&&game.hasPlayer(current=>lib.skill.dcmoyu.filterTarget(null,player,current));
|
||||
|
@ -1857,7 +1863,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
filterTarget:function(card,player,target){
|
||||
return player!=target&&!player.getStorage('dcmoyu_clear').contains(target)&&target.countGainableCards(player,'hej');
|
||||
},
|
||||
global:'dcmoyu_ai',
|
||||
content:function(){
|
||||
'step 0'
|
||||
player.addTempSkill('dcmoyu_clear');
|
||||
|
@ -1893,6 +1898,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
intro:{content:'偷马贼被反打了!'},
|
||||
},
|
||||
ai:{
|
||||
trigger:{player:'dieAfter'},
|
||||
filter:()=>{
|
||||
return !game.hasPlayer(i=>i.hasSkill('dcmoyu'),true);
|
||||
},
|
||||
silent:true,
|
||||
forceDie:true,
|
||||
content:()=>{
|
||||
game.removeGlobalSkill('dcmoyu_ai');
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
target:function(card,player,target,current){
|
||||
|
|
|
@ -1678,7 +1678,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
audio:2,
|
||||
zhuSkill:true,
|
||||
forced:true,
|
||||
global:'jsrgjiemeng_effect',
|
||||
init:()=>{
|
||||
game.addGlobalSkill('jsrgjiemeng_effect');
|
||||
},
|
||||
onremove:()=>{
|
||||
if(!game.hasPlayer(i=>i.hasSkill('jsrgjiemeng'),true)) game.removeGlobalSkill('jsrgjiemeng_effect');
|
||||
},
|
||||
subSkill:{
|
||||
effect:{
|
||||
mod:{
|
||||
|
@ -1688,6 +1693,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return distance-game.countPlayer(current=>current.group=='qun');
|
||||
},
|
||||
},
|
||||
trigger:{player:'dieAfter'},
|
||||
filter:()=>{
|
||||
return !game.hasPlayer(i=>i.hasSkill('jsrgjiemeng'),true);
|
||||
},
|
||||
silent:true,
|
||||
forceDie:true,
|
||||
content:()=>{
|
||||
game.removeGlobalSkill('jsrgjiemeng_effect');
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
@ -3729,7 +3729,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
yjdumou:{
|
||||
audio:2,
|
||||
forced:true,
|
||||
global:'yjdumou_du',
|
||||
mod:{
|
||||
cardname:function(card,player,name){
|
||||
if(player==_status.currentPhase&&card.name=='du') return 'guohe';
|
||||
|
@ -3738,6 +3737,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
if(card.name=='du') return get.value({name:'guohe'});
|
||||
},
|
||||
},
|
||||
init:()=>{
|
||||
game.addGlobalSkill('yjdumou_du');
|
||||
},
|
||||
onremove:()=>{
|
||||
if(!game.hasPlayer(i=>i.hasSkill('yjdumou'),true)) game.removeGlobalSkill('yjdumou_du');
|
||||
},
|
||||
subSkill:{
|
||||
du:{
|
||||
mod:{
|
||||
|
@ -3747,6 +3752,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
aiValue:function(player,card,num){
|
||||
if(get.name(card)=='du'&&card.name!='du') return get.value({name:card.name});
|
||||
},
|
||||
},
|
||||
trigger:{player:'dieAfter'},
|
||||
filter:()=>{
|
||||
return !game.hasPlayer(i=>i.hasSkill('yjdumou'),true);
|
||||
},
|
||||
silent:true,
|
||||
forceDie:true,
|
||||
content:()=>{
|
||||
game.removeGlobalSkill('yjdumou_du');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -5352,15 +5352,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
wansha2:{
|
||||
mod:{
|
||||
cardSavable:function(card,player){
|
||||
if(!_status.currentPhase) return;
|
||||
if(_status.currentPhase.isIn()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){
|
||||
if(card.name=='tao'&&!player.isDying()) return false;
|
||||
if(card.name=='tao'&&_status.currentPhase&&_status.currentPhase.isIn()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){
|
||||
if(!player.isDying()) return false;
|
||||
}
|
||||
},
|
||||
cardEnabled:function(card,player){
|
||||
if(!_status.currentPhase) return;
|
||||
if(_status.currentPhase.isIn()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){
|
||||
if(card.name=='tao'&&!player.isDying()) return false;
|
||||
if(card.name=='tao'&&_status.currentPhase&&_status.currentPhase.isIn()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){
|
||||
if(!player.isDying()) return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2362,6 +2362,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
//胡班
|
||||
dcchongyi:{
|
||||
audio:2,
|
||||
init:()=>{
|
||||
game.addGlobalSkill('dcchongyi_ai');
|
||||
},
|
||||
onremove:()=>{
|
||||
if(!game.hasPlayer(i=>i.hasSkill('dcchongyi'),true)) game.removeGlobalSkill('dcchongyi_ai');
|
||||
},
|
||||
trigger:{global:'useCard'},
|
||||
logTarget:'player',
|
||||
filter:function(event,player){
|
||||
|
@ -2387,7 +2393,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
target.addTempSkill('dcchongyi_sha');
|
||||
},
|
||||
group:'dcchongyi_end',
|
||||
global:'dcchongyi_ai',
|
||||
subSkill:{
|
||||
ai:{
|
||||
mod:{
|
||||
|
@ -2403,6 +2408,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
})) return num+10;
|
||||
},
|
||||
},
|
||||
trigger:{player:'dieAfter'},
|
||||
filter:()=>{
|
||||
return !game.hasPlayer(i=>i.hasSkill('dcchongyi'),true);
|
||||
},
|
||||
silent:true,
|
||||
forceDie:true,
|
||||
content:()=>{
|
||||
game.removeGlobalSkill('dcchongyi_ai');
|
||||
}
|
||||
},
|
||||
end:{
|
||||
audio:'dcchongyi',
|
||||
|
|
|
@ -4479,6 +4479,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
//谢灵毓
|
||||
dcyuandi:{
|
||||
audio:2,
|
||||
init:()=>{
|
||||
game.addGlobalSkill('dcyuandi_ai');
|
||||
},
|
||||
onremove:()=>{
|
||||
if(!game.hasPlayer(i=>i.hasSkill('dcyuandi'),true)) game.removeGlobalSkill('dcyuandi_ai');
|
||||
},
|
||||
trigger:{global:'useCard'},
|
||||
filter:function(event,player){
|
||||
var evt=event.getParent('phaseUse');
|
||||
|
@ -4489,7 +4495,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}).indexOf(event)==0;
|
||||
},
|
||||
direct:true,
|
||||
global:'dcyuandi_ai',
|
||||
content:function(){
|
||||
'step 0'
|
||||
var target=trigger.player;
|
||||
|
@ -4533,6 +4538,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return num/3;
|
||||
},
|
||||
},
|
||||
trigger:{player:'dieAfter'},
|
||||
filter:()=>{
|
||||
return !game.hasPlayer(i=>i.hasSkill('dcyuandi'),true);
|
||||
},
|
||||
silent:true,
|
||||
forceDie:true,
|
||||
content:()=>{
|
||||
game.removeGlobalSkill('dcyuandi_ai');
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
|
|
|
@ -881,6 +881,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
xinfu_guanwei:{
|
||||
audio:2,
|
||||
usable:1,
|
||||
init:()=>{
|
||||
game.addGlobalSkill('xinfu_guanwei_ai');
|
||||
},
|
||||
onremove:()=>{
|
||||
if(!game.hasPlayer(i=>i.hasSkill('xinfu_guanwei'),true)) game.removeGlobalSkill('xinfu_guanwei_ai');
|
||||
},
|
||||
trigger:{
|
||||
global:"phaseUseEnd",
|
||||
},
|
||||
|
@ -898,7 +904,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return num>1;
|
||||
},
|
||||
direct:true,
|
||||
global:'xinfu_guanwei_ai',
|
||||
content:function (){
|
||||
'step 0'
|
||||
var target=trigger.player;
|
||||
|
@ -925,6 +930,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
subSkill:{
|
||||
ai:{
|
||||
trigger:{player:'dieAfter'},
|
||||
filter:()=>{
|
||||
return !game.hasPlayer(i=>i.hasSkill('xinfu_guanwei'),true);
|
||||
},
|
||||
silent:true,
|
||||
forceDie:true,
|
||||
content:()=>{
|
||||
game.removeGlobalSkill('xinfu_guanwei_ai');
|
||||
},
|
||||
ai:{
|
||||
effect:{
|
||||
player_use:function(card,player,target){
|
||||
|
|
|
@ -2401,6 +2401,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
},
|
||||
ciwei:{
|
||||
init:()=>{
|
||||
game.addGlobalSkill('ciwei_ai');
|
||||
},
|
||||
onremove:()=>{
|
||||
if(!game.hasPlayer(i=>i.hasSkill('ciwei'),true)) game.removeGlobalSkill('ciwei_ai');
|
||||
},
|
||||
trigger:{global:'useCard'},
|
||||
direct:true,
|
||||
preHidden:true,
|
||||
|
@ -2426,8 +2432,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
trigger.targets.length=0;
|
||||
trigger.all_excluded=true;
|
||||
}
|
||||
},
|
||||
global:'ciwei_ai',
|
||||
}
|
||||
},
|
||||
ciwei_ai:{
|
||||
mod:{
|
||||
|
@ -2448,6 +2453,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return num;
|
||||
},
|
||||
},
|
||||
trigger:{player:'dieAfter'},
|
||||
filter:()=>{
|
||||
return !game.hasPlayer(i=>i.hasSkill('ciwei'),true);
|
||||
},
|
||||
silent:true,
|
||||
forceDie:true,
|
||||
content:()=>{
|
||||
game.removeGlobalSkill('ciwei_ai');
|
||||
}
|
||||
},
|
||||
caiyuan:{
|
||||
trigger:{player:'phaseEnd'},
|
||||
|
|
Loading…
Reference in New Issue