Commit f91fdbcf authored by mercury233's avatar mercury233

add ClientCard.IsOriginalCode

parent e2046451
...@@ -336,6 +336,11 @@ namespace WindBot.Game ...@@ -336,6 +336,11 @@ namespace WindBot.Game
return ids.Contains(Id) || Alias != 0 && ids.Contains(Alias); return ids.Contains(Id) || Alias != 0 && ids.Contains(Alias);
} }
public bool IsOriginalCode(int id)
{
return Id == id || Alias - Id < 10 && Alias == id;
}
public bool HasXyzMaterial() public bool HasXyzMaterial()
{ {
return Overlays.Count > 0; return Overlays.Count > 0;
......
...@@ -306,10 +306,11 @@ namespace WindBot.Game ...@@ -306,10 +306,11 @@ namespace WindBot.Game
public int GetRemainingCount(int cardId, int initialCount) public int GetRemainingCount(int cardId, int initialCount)
{ {
int remaining = initialCount; int remaining = initialCount;
remaining = remaining - Hand.Count(card => card != null && card.IsCode(cardId)); remaining = remaining - Hand.Count(card => card != null && card.IsOriginalCode(cardId));
remaining = remaining - SpellZone.Count(card => card != null && card.IsCode(cardId)); remaining = remaining - SpellZone.Count(card => card != null && card.IsOriginalCode(cardId));
remaining = remaining - Graveyard.Count(card => card != null && card.IsCode(cardId)); remaining = remaining - MonsterZone.Count(card => card != null && card.IsOriginalCode(cardId));
remaining = remaining - Banished.Count(card => card != null && card.IsCode(cardId)); remaining = remaining - Graveyard.Count(card => card != null && card.IsOriginalCode(cardId));
remaining = remaining - Banished.Count(card => card != null && card.IsOriginalCode(cardId));
return (remaining < 0) ? 0 : remaining; return (remaining < 0) ? 0 : remaining;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment