Merge pull request #1114 from PZ157/PR-Branch

修复【逊贤】【崖柴】【桃】
This commit is contained in:
Spmario233 2024-03-20 21:41:03 +08:00 committed by GitHub
commit 1d845e574b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 36 additions and 32 deletions

View File

@ -469,14 +469,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){
return 2; return 2;
}, },
target_use:(player,target,card)=>{ target_use:(player,target,card)=>{
if(player===_status.currentPhase&&player.hasSkillTag('nokeep',true,{ if(!player.isPhaseUsing()||player.hasSkillTag('nokeep',true,{
card:card, card:card,
target:target target:target
},true)) return 2; },true)) return 2;
let mode = get.mode(), let mode = get.mode(),
taos = player.getCards('hs',i=>get.name(i)==='tao'&&lib.filter.cardEnabled(i,target,'forceEnable')); taos = player.getCards('hs',i=>get.name(i)==='tao'&&lib.filter.cardEnabled(i,target,'forceEnable'));
if(target.hp>0){ if(target.hp>0){
if(!player.isPhaseUsing()) return 0;
let min = 7.2-4*player.hp/player.maxHp, let min = 7.2-4*player.hp/player.maxHp,
nd = player.needsToDiscard(0,(i,player)=>{ nd = player.needsToDiscard(0,(i,player)=>{
return !player.canIgnoreHandcard(i)&&(taos.includes(i)||get.value(i)>=min); return !player.canIgnoreHandcard(i)&&(taos.includes(i)||get.value(i)>=min);

View File

@ -9946,11 +9946,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
intro:{content:'不能使用手牌'}, intro:{content:'不能使用手牌'},
charlotte:true, charlotte:true,
mod:{ mod:{
cardEnabled:function(card){ cardEnabled:function(card,player){
if(get.position(card)=='h') return false; let hs=player.getCards('h'),cards=[card];
if(Array.isArray(card.cards)) cards.addArray(card.cards);
for(let i of cards){
if(hs.includes(i)) return false;
}
}, },
cardSavable:function(card){ cardSavable:function(card,player){
if(get.position(card)=='h') return false; let hs=player.getCards('h'),cards=[card];
if(Array.isArray(card.cards)) cards.addArray(card.cards);
for(let i of cards){
if(hs.includes(i)) return false;
}
}, },
}, },
}, },

View File

@ -1365,7 +1365,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player:["useCardAfter","respond"], player:["useCardAfter","respond"],
}, },
filter:function (event,player){ filter:function (event,player){
if(get.itemtype(event.cards)!='cards') return false; if(get.itemtype(event.cards)!=='cards'||!game.hasPlayer(current=>{
if(current===player) return false;
return current.getHp()>player.getHp()||current.countCards('h')>player.countCards('h');
})) return false;
for(var i=0;i<event.cards.length;i++){ for(var i=0;i<event.cards.length;i++){
if(event.cards[i].isInPile()){ if(event.cards[i].isInPile()){
return true; return true;
@ -1373,36 +1376,30 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
return false; return false;
}, },
direct:true, async cost(event, trigger, player){
content:function (){ event.result = await player.chooseTarget(get.prompt2('xinfu_xunxian'),(card,player,target)=>{
'step 0' if(target===player) return false;
player.chooseTarget(get.prompt2('xinfu_xunxian'),function(card,player,target){ return target.getHp()>player.getHp()||target.countCards('h')>player.countCards('h');
if(target==player) return false; }).set('ai',(target)=>{
return target.countCards('h')>player.countCards('h')||Math.max(0,target.hp)>Math.max(0,player.hp);
}).set('ai',function(target){
let att=get.attitude(_status.event.player,target),name=_status.event.cards[0].name; let att=get.attitude(_status.event.player,target),name=_status.event.cards[0].name;
if(att<3) return 0; if(att<3) return 0;
if(target.hasJudge('lebu')) att/=5; if(target.hasJudge('lebu')) att/=5;
if(name==='sha'&&target.hasSha()) att/=5; if(name==='sha'&&target.hasSha()) att/=5;
if(name==='wuxie'&&target.needsToDiscard(_status.event.cards)) att/=5; if(name==='wuxie'&&target.needsToDiscard(_status.event.cards)) att/=5;
return att/(1+get.distance(player,target,'absolute')); return att/(1+get.distance(player,target,'absolute'));
}).set('cards',trigger.cards); }).set('cards',trigger.cards).forResult();
'step 1' },
if(result.bool){ async content(event, trigger, player){
var list=[]; let list=[];
for(var i=0;i<trigger.cards.length;i++){ for(let i=0;i<trigger.cards.length;i++){
if(trigger.cards[i].isInPile()){ if(trigger.cards[i].isInPile()){
list.push(trigger.cards[i]); list.push(trigger.cards[i]);
} }
} }
player.logSkill('xinfu_xunxian',result.targets[0]); if(get.mode()!=='identity'||player.identity!=='nei') player.addExpose(0.2);
result.targets[0].gain(list,'gain2').giver=player; event.targets[0].gain(list,'gain2').giver=player;
} }
}, },
ai:{
expose:0.3,
},
},
"xinfu_kannan":{ "xinfu_kannan":{
audio:2, audio:2,
subSkill:{ subSkill:{