unsure的花色/颜色/点数匹配,用于给转化牌技能放行

This commit is contained in:
Spmario233 2024-03-03 08:50:59 +08:00
parent 42be1714f4
commit c6817e5095
8 changed files with 24 additions and 24 deletions

View File

@ -6875,13 +6875,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
//获取卡牌花色
var name=get.suit(card,player);
//如果这张牌是梅花并且当前时机能够使用/打出闪 那么这张牌可以选择
if(name=='club'&&filter({name:'shan'},player,event)) return true;
if(name=='club'&&filter(get.autoViewAs({name:'shan'},'unsure'),player,event)) return true;
//如果这张牌是方片并且当前时机能够使用/打出火杀 那么这张牌可以选择
if(name=='diamond'&&filter({name:'sha',nature:'fire'},player,event)) return true;
if(name=='diamond'&&filter(get.autoViewAs({name:'sha',nature:'fire'},'unsure'),player,event)) return true;
//如果这张牌是黑桃并且当前时机能够使用/打出无懈 那么这张牌可以选择
if(name=='spade'&&filter({name:'wuxie'},player,event)) return true;
if(name=='spade'&&filter(get.autoViewAs({name:'wuxie'},'unsure'),player,event)) return true;
//如果这张牌是红桃并且当前时机能够使用/打出桃 那么这张牌可以选择
if(name=='heart'&&filter({name:'tao'},player,event)) return true;
if(name=='heart'&&filter(get.autoViewAs({name:'tao'},'unsure'),player,event)) return true;
//上述条件都不满足 那么就不能选择这张牌
return false;
},

View File

@ -205,8 +205,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
let evt=_status.event;
if(evt.name!='chooseToUse') evt=evt.getParent('chooseToUse');
if(!evt||!evt.respondTo||!storage.includes(evt.respondTo[1])) return;
const num=get.number(card,player);
if(!(typeof num!='number'||num>=get.number(evt.respondTo[1]))) return false;
const num = get.number(card);
if(num!='unsure' && (typeof num!='number' || num<=get.number(evt.respondTo[1]))) return false;
},
},
onremove(player){

View File

@ -2259,16 +2259,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
"nzry_chenglve1":{
mod:{
cardUsable:function(card,player){
var cards=player.storage.nzry_chenglve1;
for(var i=0;i<cards.length;i++){
if(cards[i]==get.suit(card)) return Infinity;
}
const suit = get.suit(card);
if (suit == 'unsure' || player.getStorage('nzry_chenglve1').includes(suit)) return Infinity;
},
targetInRange:function(card,player){
var cards=player.storage.nzry_chenglve1;
for(var i=0;i<cards.length;i++){
if(cards[i]==get.suit(card)) return true;
}
const suit = get.suit(card);
if (suit == 'unsure' || player.getStorage('nzry_chenglve1').includes(suit)) return true;
}
},
onremove:true,

View File

@ -23889,7 +23889,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event,player){
if(event.responded||player==_status.currentPhase||event.aocai) return false;
for(var i of lib.inpile){
if(get.type(i)=='basic'&&event.filterCard({name:i},player,event)) return true;
if(get.type(i)=='basic'&&event.filterCard(get.autoViewAs({name:i},'unsure'),player,event)) return true;
}
return false;
},

View File

@ -281,11 +281,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
for (let target of targets) {
if (target.isIn() && player.inRange(target)) {
const result = await target.chooseToRespond(prompt, (card,player)=>{
return get.type(card) == 'basic' && get.color(card) != 'black';
}).set('filterOk', ()=>{
const card = get.card();
if (card && get.color(card)!='red') return false;
return true;
if (get.type(card) !== 'basic') return false;
const color = get.color(card);
return (color == 'red' || color == 'unsure');
}).set('ai',card => {
const player = get.player(), event = get.event();
const source = event.getParent().player;

View File

@ -6141,7 +6141,7 @@ export class Game extends Uninstantable {
if (enable) {
if (!game.expandSkills(player.getSkills(false).concat(lib.skill.global)).includes(skills2[i]) && (info.noHidden || get.mode() != 'guozhan' || player.hasSkillTag('nomingzhi', false, null, true))) enable = false;
if (info.filter && !info.filter(event, player)) enable = false;
if (info.viewAs && typeof info.viewAs != 'function' && event.filterCard && !event.filterCard(info.viewAs, player, event)) enable = false;
if (info.viewAs && typeof info.viewAs != 'function' && event.filterCard && !event.filterCard(get.autoViewAs(info.viewAs, 'unsure'), player, event)) enable = false;
if (info.viewAs && typeof info.viewAs != 'function' && info.viewAsFilter && info.viewAsFilter(player) == false) enable = false;
if (info.usable && get.skillCount(skills2[i]) >= info.usable) enable = false;
if (info.chooseButton && _status.event.noButton) enable = false;

View File

@ -1791,7 +1791,7 @@ export class Get extends Uninstantable {
return game.checkMod(card, owner, game.checkMod(card, card.suit, 'suit', owner), 'cardsuit', owner);
}
}
if (lib.suits.includes(card.suit)) return card.suit;
if (card.suit === 'unsure' || lib.suits.includes(card.suit)) return card.suit;
return 'none';
}
}
@ -1810,7 +1810,7 @@ export class Get extends Uninstantable {
}
return color;
}
else if (Object.keys(lib.color).includes(card.color)) {
else if (card.color === 'unsure' || Object.keys(lib.color).includes(card.color)) {
return card.color;
}
else if (Array.isArray(card.cards) && !lib.suit.includes(card.suit)) {
@ -1835,7 +1835,8 @@ export class Get extends Uninstantable {
var number = null;
if ('number' in card) {
number = card.number;
if (typeof number != 'number') number = null;
if (number === 'unsure') return number;
else if (typeof number != 'number') number = null;
}
else {
if (card.cards && card.cards.length == 1) number = get.number(card.cards[0], false);

View File

@ -79,6 +79,11 @@ export class VCard {
if (!this.nature) this.nature = get.nature(this);
}
}
else if(numberOrCards === 'unsure') {
if(!this.suit) this.suit = 'unsure';
if(!this.color) this.color = 'unsure';
if(!this.number) this.number = 'unsure';
}
const info = get.info(this, false);
if (info) {
const autoViewAs = info.autoViewAs;