static public Task ShowFearCardToUser(this Spirit spirit, string prompt, PositionFearCard cardToShow, int?activationLevel = null) { var display = activationLevel != null ? new ActivatedFearCard(cardToShow.FearOptions, activationLevel.Value) : new ActivatedFearCard(cardToShow.FearOptions); return(spirit.Select(prompt, new IOption[] { display }, Present.Always)); }
public void AddCard(IFearOptions fearCard) { if (Deck.Count >= 9) { throw new InvalidOperationException("Fear deck is full."); } var labels = new string[] { "1-A", "1-B", "1-C", "2-A", "2-B", "2-C", "3-A", "3-B", "3-C" }; int index = 9 - Deck.Count - 1; var td = new PositionFearCard { FearOptions = fearCard, Text = "Lvl " + labels[index] }; Deck.Push(td); }
public async Task Apply() { while (ActivatedCards.Count > 0) { PositionFearCard fearCard = ActivatedCards.Pop(); // show card to each user foreach (var spirit in gs.Spirits) { await spirit.ShowFearCardToUser("Activating Fear", fearCard, TerrorLevel); } var ctx = new FearCtx(gs); switch (TerrorLevel) { case 1: await fearCard.FearOptions.Level1(ctx); break; case 2: await fearCard.FearOptions.Level2(ctx); break; case 3: await fearCard.FearOptions.Level3(ctx); break; } } }