修复小概率过早移除全局技能的bug(部分)

This commit is contained in:
157 2023-12-25 15:28:20 +08:00
parent cb14094876
commit 0c57827800
7 changed files with 14 additions and 20 deletions

View File

@ -7974,9 +7974,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
init:function(player){
game.addGlobalSkill('huguan_all');
},
onremove:function(player){
game.removeGlobalSkill('huguan_all');
},
trigger:{global:'useCard'},
direct:true,
filter:function(event,player){
@ -8052,7 +8049,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
let num = -157;
game.countPlayer(function (current){
if(current.hasSkill('huguan')) num = Math.max(num, get.attitude(_status.event.player, current));
});
}, true);
if(num === -157) game.removeGlobalSkill('huguan_all');
else if(num === 0) player.storage.huguan_all = 6;
else if(num > 0) player.storage.huguan_all = 9;
@ -9168,7 +9165,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.addGlobalSkill('fengxiang_use');
},
onremove:function(player){
game.removeGlobalSkill('fengxiang_use');
if(!game.hasPlayer(current=>current.hasSkill('fengxiang'),true)) game.removeGlobalSkill('fengxiang_use');
},
trigger:{player:'damageEnd'},
forced:true,
@ -9210,10 +9207,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
trigger:{player:'dieAfter'},
filter:function(event,player){
for(let i of game.players){
if(i.hasSkill('fengxiang')) return false;
}
return true;
return !game.hasPlayer(current=>current.hasSkill('fengxiang'),true);
},
silent:true,
forceDie:true,

View File

@ -682,7 +682,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.addGlobalSkill('jsrgninghan_frozen');
},
onremove:(player)=>{
game.removeGlobalSkill('jsrgninghan_frozen');
if(!game.hasPlayer(current=>current.hasSkill('jsrgninghan'),true)) game.removeGlobalSkill('jsrgninghan_frozen');
},
trigger:{global:'damageEnd'},
filter:function(event,player){
@ -709,7 +709,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
trigger:{player:'dieAfter'},
filter:(event,player)=>{
return !game.hasPlayer(current=>!current.hasSkill('jsrgninghan'));
return !game.hasPlayer(current=>!current.hasSkill('jsrgninghan'),true);
},
silent:true,
forceDie:true,

View File

@ -5828,7 +5828,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.addGlobalSkill('relongyin_order');
},
onremove:(player)=>{
game.removeGlobalSkill('relongyin_order');
if(!game.hasPlayer(current=>current.hasSkill('relongyin'),true)) game.removeGlobalSkill('relongyin_order');
},
trigger:{global:'useCard'},
direct:true,
@ -5917,7 +5917,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
trigger:{player:'dieAfter'},
filter:(event,player)=>{
return !game.hasPlayer(current=>current.hasSkill('relongyin'));
return !game.hasPlayer(current=>current.hasSkill('relongyin'),true);
},
silent:true,
forceDie:true,

View File

@ -5994,7 +5994,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.addGlobalSkill('spshanxi_bj');
},
onremove:function(player){
game.removeGlobalSkill('spshanxi_bj');
if(!game.hasPlayer(current=>current.hasSkill('spshanxi'),true)) game.removeGlobalSkill('spshanxi_bj');
},
trigger:{player:'phaseUseBegin'},
direct:true,

View File

@ -11909,7 +11909,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.addGlobalSkill('twzhian_ai');
},
onremove:function(player){
game.removeGlobalSkill('twzhian_ai');
if(!game.hasPlayer((current)=>current.hasSkill('twzhian'),true)) game.removeGlobalSkill('twzhian_ai');
},
usable:1,
trigger:{global:'useCardAfter'},

View File

@ -4783,7 +4783,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.addGlobalSkill('dcaichen_hit');
},
onremove:function(player){
game.removeGlobalSkill('dcaichen_hit');
if(!game.hasPlayer(current=>current.hasSkill('dcaichen'),true)) game.removeGlobalSkill('dcaichen_hit');
},
trigger:{
player:['loseAfter','phaseDiscardBefore'],
@ -4813,7 +4813,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
hit:{
trigger:{player:'dieAfter'},
filter:function(event,player){
return !game.hasPlayer(current=>current.hasSkill('dcaichen'));
return !game.hasPlayer(current=>current.hasSkill('dcaichen'),true);
},
silent:true,
forceDie:true,
@ -5526,7 +5526,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
all:{
trigger:{player:'dieAfter'},
filter:function(event,player){
return !game.hasPlayer(current=>current.hasSkill('dcwumei_wake'));
return !game.hasPlayer(current=>current.hasSkill('dcwumei_wake'),true);
},
silent:true,
forceDie:true,

View File

@ -7558,7 +7558,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.addGlobalSkill('longyin_order');
},
onremove:(player)=>{
game.removeGlobalSkill('longyin_order');
if(!game.hasPlayer(current=>current.hasSkill('longyin'),true)) game.removeGlobalSkill('longyin_order');
},
trigger:{global:'useCard'},
direct:true,
@ -7647,7 +7647,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},
trigger:{player:'dieAfter'},
filter:(event,player)=>{
return !game.hasPlayer(current=>current.hasSkill('longyin'));
return !game.hasPlayer(current=>current.hasSkill('longyin'),true);
},
silent:true,
forceDie:true,