Merge pull request #1141 from PZ157/PR-Branch

修复【桃】ai
This commit is contained in:
Spmario233 2024-03-29 09:51:36 +08:00 committed by GitHub
commit 4cc78b3a4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 9 deletions

View File

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

View File

@ -53,10 +53,13 @@ export class Get extends Uninstantable {
return list;
}
/**
* 根据座次数n从0开始获取对应的n+1号位翻译
* @param {number} seat
* 根据(Player的)座次数n从1开始获取对应的n号位翻译
* @param {number | Player} seat
*/
static seatTranslation(seat) { return `${get.cnNumber(seat + 1, true)}号位`; }
static seatTranslation(seat) {
if (get.itemtype(seat) === 'player') seat = seat.getSeatNum();
return `${get.cnNumber(seat, true)}号位`;
}
/**
* @param {number} numberOfPlayers
* @returns {string[]}