添加阵营

This commit is contained in:
xianyi
2025-08-18 17:56:34 +08:00
parent 092355aa31
commit 4734c47c63
18 changed files with 242 additions and 9 deletions

View File

@@ -15,6 +15,7 @@ namespace TcgEngine
public CardType has_type;
public TeamData has_team;
public TraitData has_trait;
public CardCamp has_camp;
public ConditionOperatorBool oper;
@@ -38,7 +39,8 @@ namespace TcgEngine
bool is_type = target.type == has_type || has_type == CardType.None;
bool is_team = target.team == has_team || has_team == null;
bool is_trait = target.HasTrait(has_trait) || has_trait == null;
return (is_type && is_team && is_trait);
bool is_camp = target.camp == has_camp || has_camp == CardCamp.None;
return (is_type && is_team && is_trait && is_camp);
}
private bool IsTrait(Card card)
@@ -46,7 +48,8 @@ namespace TcgEngine
bool is_type = card.CardData.type == has_type || has_type == CardType.None;
bool is_team = card.CardData.team == has_team || has_team == null;
bool is_trait = card.HasTrait(has_trait) || has_trait == null;
return (is_type && is_team && is_trait);
bool is_camp = card.CardData.camp == has_camp || has_camp == CardCamp.None;
return (is_type && is_team && is_trait && is_camp);
}
}
}

View File

@@ -14,6 +14,17 @@ namespace TcgEngine
Equipment = 50,
}
public enum CardCamp
{
None = -1, // 无阵营限制
ZiYouRen = 0, // 自由人
YiYongJun = 5, // 义勇军
WangGuoJun = 10, // 王国军
DiGuoJun = 20, // 帝国军
ShouQun = 30, // 兽群
XieMo = 40, // 邪魔
}
/// <summary>
/// Defines all card data
/// </summary>
@@ -30,6 +41,7 @@ namespace TcgEngine
[Header("Stats")]
public CardType type;
public CardCamp camp;
public TeamData team;
public RarityData rarity;
public int mana;