卡特琳娜
This commit is contained in:
@@ -19,10 +19,37 @@ namespace TcgEngine
|
||||
public RarityData has_rarity;
|
||||
public RarityData exclude_rarity;
|
||||
|
||||
[Header("All cards on board are of camp")]
|
||||
public TraitData allCardTrait;
|
||||
|
||||
public ConditionOperatorBool oper;
|
||||
|
||||
public override bool IsTargetConditionMet(Game data, AbilityData ability, Card caster, Card target)
|
||||
{
|
||||
// 检查allCardTrait条件
|
||||
if (allCardTrait != null && caster != null)
|
||||
{
|
||||
Player casterPlayer = data.GetPlayer(caster.player_id);
|
||||
if (casterPlayer != null)
|
||||
{
|
||||
// 检查场上所有卡牌
|
||||
foreach (Card boardCard in casterPlayer.cards_board)
|
||||
{
|
||||
if (!boardCard.HasTrait(allCardTrait))
|
||||
{
|
||||
return false; // 如果有任何一张卡牌没有指定特性,返回false
|
||||
}
|
||||
}
|
||||
|
||||
if (casterPlayer.cards_board.Count == 0 && casterPlayer.cards_equip.Count == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Debug.Log("所有卡牌都具有指定特性 " + allCardTrait.id);
|
||||
}
|
||||
}
|
||||
|
||||
return CompareBool(IsTrait(target), oper);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user