public override void Discard(GameContext gameContext)
 {
     if (!_isHidden)
     {
         _originalCard.Discard(gameContext);
     }
 }
 public static void TakeBadStuff(this Dungeon dungeon, GameContext gameContext)
 {
     foreach (var monsterCard in gameContext.Dungeon.DungeonMonsters)
     {
         monsterCard.BadStuff(gameContext);
     }
 }
 public override Task BadStuff(GameContext gameContext)
 {
     gameContext.Dungeon.CurrentPlayer.LevelDown();
     gameContext.Dungeon.CurrentPlayer.LevelDown();
     gameContext.Dungeon.CurrentPlayer.LevelDown();
     return Task.CompletedTask;
 }
        public override async void Execute(GameContext gameContext)
        {
            if (Shots >= 0)
            {
                Shots--;

                var playerCards = Player.InPlayEquipped
                    .Concat(Player.YourHand)
                    .Concat(Player.InPlayCarried);

                var response = gameContext.RequestSink.Request<Card>(Player, Player, playerCards);
                var card = await response.GetResult();
                Player.Discard(card);

                var diceRoll = Dice.Roll();
                // TODO: include dice roll subtraction from curses

                if (diceRoll > 3)
                {
                    // TODO: discard as -2 strength
                    await gameContext.Dungeon.PlayACard(card);
                }
                else
                {
                    // TODO: simply discard
                    await gameContext.Dungeon.PlayACard(card);
                }
            }
        }
 public override Task Play(GameContext gameContext)
 {
     gameContext.Players
         .Where(player => player.InPlayEquipped.FirstOrDefault(x => x is ClericClass) != null)
         .ForEach(player => player.LevelUp());
     return Task.CompletedTask;
 }
 public override Task Play(GameContext gameContext)
 {
     // select player to steal level from
     gameContext.Players.First().LevelDown();
     
     // level up the owner player
     return base.Play(gameContext);
 }
 public static bool PlayersWon(this DungeonState dungeonState, GameContext gameContext)
 {
     // TODO: come up with a solution on how to take classes and races into account
     return (dungeonState.HeroesStrength > dungeonState.MonsterStrength);
     //|| ((gameContext.Dungeon.CurrentPlayer.Is<WarriorClass>()
     //    || gameContext.Dungeon.HelpingPlayer.Is<WarriorClass>())
     //    && dungeonState.HeroesStrength >= dungeonState.MonsterStrength);
 }
 public override Task Play(GameContext gameContext)
 {
     gameContext.Dungeon.CurrentPlayer.InPlayEquipped
         .OfType<PermanentItemCard>()
         .FirstOrDefault(x => x.WearingType == EWearingType.Armor)
         ?.Discard(gameContext);
     return Task.CompletedTask;
 }
 public override Task BadStuff(GameContext gameContext)
 {
     gameContext.Dungeon.CurrentPlayer.InPlayEquipped
         .OfType<ItemCard>()
         .Where(x => x.ItemSize == EItemSize.Big)
         .ForEach(x => x.Discard(gameContext));
     return Task.CompletedTask;
 }
        public override Task Play(GameContext gameContext)
        {
            if (!_isHidden)
            {
                _originalCard.Play(gameContext);
            }

            return Task.CompletedTask;
        }
Beispiel #11
0
        public override Task BadStuff(GameContext gameContext)
        {
            gameContext.Dungeon?.CurrentPlayer.InPlayEquipped
                .OfType<PermanentItemCard>()
                .Where(x => x.WearingType == EWearingType.Headgear)
                .ForEach(x => x.Discard(gameContext));

            return Task.CompletedTask;
        }
        public override Task BadStuff(GameContext gameContext)
        {
            uint minPlayerLevel = gameContext.Players.Min(x => x.Level);
            while (gameContext.Dungeon.CurrentPlayer.Level > minPlayerLevel)
            {
                gameContext.Dungeon.CurrentPlayer.LevelDown();
            }

            return Task.CompletedTask;
        }
        public override Task Play(GameContext gameContext)
        {
            var currentHeroIsElf = Owner.InPlayEquipped.OfType<ElfRace>().Any();
            if (currentHeroIsElf)
            {
                gameContext.Dungeon.State.MonsterStrength += 2;
            }

            return base.Play(gameContext);
        }
        public override Task Play(GameContext gameContext)
        {
            var playerWithhirelingCard = gameContext.Players.FirstOrDefault(x => x.InPlayEquipped.OfType<Hireling>().Any());
            var hirelingCard = playerWithhirelingCard?.InPlayEquipped.FirstOrDefault(x => x is Hireling);
            if (hirelingCard != null)
            {
                hirelingCard.Discard(gameContext);
                return base.Play(gameContext);
            }

            return Task.CompletedTask;
        }
        public override Task Play(GameContext gameContext)
        {
            var currentHero = gameContext.Dungeon.CurrentPlayer;
            var currentHeroIsElf = currentHero.InPlayEquipped.OfType<ElfRace>().Any();

            var helpingHero = gameContext.Dungeon.HelpingPlayer;
            var helpingHeroIsElf = helpingHero?.InPlayEquipped.OfType<ElfRace>().Any();

            if (currentHeroIsElf || helpingHeroIsElf != null && helpingHeroIsElf.Value)
            {
                gameContext.Dungeon.State.HeroesStrength += 6;
            }

            return base.Play(gameContext);
        }
        public override Task Play(GameContext gameContext)
        {
            var currentHero = gameContext.Dungeon.CurrentPlayer;
            var currentHeroIsWarrior = currentHero.InPlayEquipped.OfType<WarriorClass>().Any();

            var helpingHero = gameContext.Dungeon.HelpingPlayer;
            var helpingHeroIsWarrior = helpingHero?.InPlayEquipped.OfType<WarriorClass>().Any();

            if (currentHeroIsWarrior || helpingHeroIsWarrior != null && helpingHeroIsWarrior.Value)
            {
                gameContext.Dungeon.State.MonsterStrength += 4;
            }

            return base.Play(gameContext);
        }
        public static void TakeReward(this DungeonState dungeonState, GameContext gameContext)
        {
            for (int i = 0; i < dungeonState.RewardLevels; i++)
            {
                // TODO: allow helping hero to level up if he is an elf
                gameContext.Dungeon.CurrentPlayer.LevelUp();
            }

            for (int i = 0; i < dungeonState.RewardTreasures; i++)
            {
                // TODO: allow helping hero to take bribes
                var treasureCard = gameContext.TreasureCardDeck.Take();
                gameContext.Dungeon.CurrentPlayer.TakeInHand(treasureCard);
            }
        }
Beispiel #18
0
        public override Task Play(GameContext gameContext)
        {
            var currentHero = gameContext.Dungeon.CurrentPlayer;
            var currentHeroIsWizard = currentHero.InPlayEquipped.OfType<WizardClass>().Any();

            var helpingHero = gameContext.Dungeon.HelpingPlayer;
            var helpingHeroIsWizard = helpingHero?.InPlayEquipped.OfType<WizardClass>().Any();

            if (currentHeroIsWizard || helpingHeroIsWizard != null && helpingHeroIsWizard.Value)
            {
                gameContext.Dungeon.State.HeroesStrength += 5;
            }

            return base.Play(gameContext);
        }
        public override async void Execute(GameContext gameContext)
        {
            if (Shots >= 0)
            {
                Shots--;
                var playerCards = Player.InPlayEquipped
                    .Concat(Player.YourHand)
                    .Concat(Player.InPlayCarried);

                var response = gameContext.RequestSink.Request<Card>(Player, Player, playerCards);
                var card = await response.GetResult();
                Player.Discard(card);
                await gameContext.Dungeon.PlayACard(card);
            }
        }
Beispiel #20
0
        public override Task Play(GameContext gameContext)
        {
            // take all strength properties bound to monster
            var oneShotProperties = BoundTo.BoundCards
                .NotOfType<Mate>()
                .SelectMany(x => x.Properties)
                .ToList();

            // calculate mate monster strength and treasures
            int strength = oneShotProperties.OfType<StrengthBonus>().Select(x => x.Bonus).Aggregate((x, y) => x + y);
            int treasure = oneShotProperties.OfType<TreasureBonus>().Select(x => x.Bonus).Aggregate((x, y) => x + y);

            // add mate monster strength
            gameContext.Dungeon.State.HeroesStrength += strength;
            gameContext.Dungeon.State.RewardTreasures += treasure;
            return Task.CompletedTask;
        }
Beispiel #21
0
        public override Task BadStuff(GameContext gameContext)
        {
            var diceRollResult = Dice.Roll();
            if (diceRollResult <= 2)
            {
                gameContext.Dungeon.CurrentPlayer.Die();
            }
            else
            {
                for (int i = 0; i < diceRollResult; i++)
                {
                    gameContext.Dungeon.CurrentPlayer.LevelDown();
                }
            }

            return Task.CompletedTask;
        }
        public override Task Play(GameContext gameContext)
        {
            var classes = gameContext.Dungeon.CurrentPlayer.InPlayEquipped
                .OfType<ClassCard>()
                .ToList();

            if (classes.Count > 1)
            {
                // select which one to discard
            }
            else
            {
                classes.FirstOrDefault()?.Discard(gameContext);
            }

            return Task.CompletedTask;
        }
        public override Task Play(GameContext gameContext)
        {
            foreach (var equippedCard in gameContext.Dungeon.CurrentPlayer.InPlayEquipped)
            {
                if (equippedCard is RaceCard || equippedCard is Halfbreed)
                {
                    equippedCard.Discard(gameContext);
                }
            }

            var firstDiscardedRace = gameContext.DiscardedDoorsCards.TakeFirst<RaceCard>();
            if (firstDiscardedRace != null)
            {
                gameContext.Dungeon.CurrentPlayer.PutInPlayAsEquipped(firstDiscardedRace);
            }

            return Task.CompletedTask;
        }
        public override Task Play(GameContext gameContext)
        {
            foreach (var equippedCard in gameContext.Dungeon.CurrentPlayer.InPlayEquipped)
            {
                if (equippedCard is ClassCard || equippedCard is SuperMunchkin)
                {
                    equippedCard.Discard(gameContext);
                }
            }

            var firstDiscardedClass = gameContext.DiscardedDoorsCards.TakeFirst<ClassCard>();
            if (firstDiscardedClass != null)
            {
                gameContext.Dungeon.CurrentPlayer.PutInPlayAsEquipped(firstDiscardedClass);
            }

            return Task.CompletedTask;
        }
Beispiel #25
0
        public override Task Play(GameContext gameContext)
        {
            var currentHero = gameContext.Dungeon.CurrentPlayer;
            var currentHeroIsDwarf = currentHero.InPlayEquipped.OfType<DwarfRace>().Any();
            var currentHeroIsHalfling = currentHero.InPlayEquipped.OfType<HalflingRace>().Any();

            var helpingHero = gameContext.Dungeon.HelpingPlayer;
            var helpingHeroIsDwarf = helpingHero?.InPlayEquipped.OfType<DwarfRace>().Any();
            var helpingHeroIsHalfling = helpingHero?.InPlayEquipped.OfType<HalflingRace>().Any();

            if (currentHeroIsDwarf
                || currentHeroIsHalfling
                || helpingHeroIsDwarf != null && helpingHeroIsDwarf.Value
                || helpingHeroIsHalfling != null && helpingHeroIsHalfling.Value)
            {
                gameContext.Dungeon.State.HeroesStrength += 3;
            }

            return base.Play(gameContext);
        }
        public override Task Play(GameContext gameContext)
        {
            // take all strength properties from player
            var playerProperties = Owner.InPlayEquipped
                .SelectMany(x => x.Properties)
                .OfType<StrengthBonus>();

            // take all strength properties from cards used by player
            var oneShotProperties = BoundTo.BoundCards
                .NotOfType<Doppleganger>()
                .SelectMany(x => x.Properties)
                .OfType<StrengthBonus>();

            // calculate doppleganger strength
            int strength = oneShotProperties.Select(x => x.Bonus).Aggregate((x, y) => x + y);
            strength += playerProperties.Select(x => x.Bonus).Aggregate((x, y) => x + y);

            // add doppleganger strength
            gameContext.Dungeon.State.HeroesStrength += strength;
            return base.Play(gameContext);
        }
        public override async void Execute(GameContext gameContext)
        {
            if (Shots >= 0)
            {
                // TODO: if stabbing failed, can player try and stab once more?
                Shots--;

                var playerSelectionRequest = gameContext.RequestSink.Request<Player>(Player, Player, gameContext.Players);
                var selectedPlayer = await playerSelectionRequest.GetResult();
                var stealableCards = selectedPlayer.InPlayEquipped.Concat(Player.InPlayCarried);

                var diceRoll = Dice.Roll();
                // TODO: include dice roll subtraction from curses

                if (diceRoll > 3)
                {
                    var response = gameContext.RequestSink.Request<Card>(Player, Player, stealableCards);
                    var card = await response.GetResult();
                    selectedPlayer.Discard(card);
                    Player.TakeInHand(card);
                }
            }
        }
 public static bool MonstersWon(this DungeonState dungeonState, GameContext gameContext)
 {
     return !PlayersWon(dungeonState, gameContext);
 }
Beispiel #29
0
 public override Task Play(GameContext gameContext)
 {
     throw new NotImplementedException();
 }
Beispiel #30
0
 public override Task BadStuff(GameContext gameContext)
 {
     throw new System.NotImplementedException();
 }