Implement emotions

This commit is contained in:
henriquenakashima 2020-09-26 18:24:46 -04:00
parent 08c395cf51
commit 11df4f1164
25 changed files with 369 additions and 40 deletions

View file

@ -47,10 +47,17 @@ public class HandPlayability<BaseCardT> where BaseCardT : BaseCard {
private void UpdatePlayability() {
this.playable.Clear();
foreach (BaseCardT card in this.deck.GetHandPile()) {
this.playable[card] =
this.battleState.IsTeamsTurn(this.team)
&& card.Owner.CanUseCard(card)
&& this.energyPool.CanPayForCard(card);
bool canPlay;
if (card.Type == CardType.Emotion) {
canPlay = this.battleState.CanPlayEmotion(this.team);
} else {
canPlay = this.energyPool.CanPayForCard(card);
}
canPlay = canPlay
&& this.battleState.IsTeamsTurn(this.team)
&& card.Owner.CanUseCard(card);
this.playable[card] = canPlay;
}
TriggerOnPlayabilityChanged();