// returns a delta that removes the top card from the deck // adding that card to the hand will need to be implemented elsewhere public RemoveFromDeckDelta[] GetDrawDeltas(int startingIndex = 0, int count = 1) { RemoveFromDeckDelta[] r = new RemoveFromDeckDelta[count - startingIndex]; for (int i = startingIndex; i < startingIndex + count; i++) { r[i - startingIndex] = new RemoveFromDeckDelta(this, this[i], 0); // remove index is 0 because assumes all cards above will have been drawn at that point } return(r); }
void MulchInner(List <Delta> deltas, GMWithLocation gmLoc, Damage.Type?phase) { RemoveFromDeckDelta top = new RemoveFromDeckDelta(gmLoc.SubjectPlayer.Deck, gmLoc.SubjectPlayer.Deck[0], 0); deltas.Add(top); UnitCard topUnitCard = top.Card as UnitCard; // BackUnit works out perfectly because it returns null if its empty or if it contains SubjectUnit if (topUnitCard != null && gmLoc.SubjectPlayer.ManaPool.CanAfford(topUnitCard.DeployCost - 1) && gmLoc.BackUnit == null) { deltas.AddRange(gmLoc.SubjectPlayer.ManaPool.GetSubtractDeltas(topUnitCard.DeployCost - 1)); deltas.AddRange(gmLoc.SubjectLane.GetDeployDeltas(topUnitCard, gmLoc.Side, 1, gmLoc.GameManager)); } else { deltas.AddRange(gmLoc.SubjectPlayer.Discard.GetDiscardDeltas(new Card[] { top.Card })); } }