Exemple #1
0
        public void UsePartyDie(CompanionType companion)
        {
            // TODO: Consider using this method everywhere Dice need to be moved from party to graveyard
            // first check if we have a companion that was transformed from a monster
            bool companionFromEnemyRemoved = PartyDice.RemoveFirst(d => d.IsFromMonster && d.Companion == companion);

            if (companionFromEnemyRemoved)
            {
                return;
            }

            // now let's check if we have a companion that was from hero ability or treasure

            bool companionFromTreasureRemoved = PartyDice.RemoveFirst(d => d.IsFromTreasureOrHeroAbility && d.Companion == companion);

            if (companionFromTreasureRemoved)
            {
                return;
            }
            // player didnt have a companion of this type that came from treasure, let's remove a normal die
            var partyDie = PartyDice.First(d => d.Companion == companion);

            PartyDice.Remove(partyDie);
            Graveyard++;
        }
Exemple #2
0
        public List <DungeonDieType> UseCompanionToAttack(string companion)
        {
            var partyDie = PartyDice.First(d => d.Name == companion);

            // add this companion to the graveyard and remove from party
            UsePartyDie(partyDie.Companion);

            return(partyDie.TargetList);
        }
        public override string TransformCompanion(CompanionType companion)
        {
            if (companion == CompanionType.Scroll)
            {
                return($"You don't need to transform a scroll into a scroll. Try saying transform scroll to champion instead.  ");
            }

            PartyDice.First(d => d.Companion == CompanionType.Scroll).Companion = companion;
            return($"You transformed a scroll into a {companion}. ");
        }
Exemple #4
0
        public override string TransformCompanion(CompanionType companion)
        {
            if (companion != CompanionType.Cleric && companion != CompanionType.Mage)
            {
                return($"You cannot transform a {companion}. Try saying transform cleric or transform mage instead. ");
            }
            if (companion == CompanionType.Cleric)
            {
                PartyDice.First(d => d.Companion == companion).Companion = CompanionType.Mage;
                return("You transformed a cleric into a mage. ");
            }

            PartyDice.First(d => d.Companion == companion).Companion = CompanionType.Cleric;
            return("You transformed a mage into a cleric. ");
        }
        public override string TransformCompanion(CompanionType companion)
        {
            if (companion != CompanionType.Thief && companion != CompanionType.Mage)
            {
                return($"You cannot transform a {companion}. Try saying transform thief or transform mage instead. ");
            }
            if (companion == CompanionType.Thief)
            {
                PartyDice.First(d => d.Companion == companion).Companion = CompanionType.Mage;
                return("You transformed a thief into a mage. ");
            }

            PartyDice.First(d => d.Companion == companion).Companion = CompanionType.Thief;
            return("You transformed a mage into a thief. ");
        }
Exemple #6
0
        public string AcquireSingleTreasureItem(CompanionType companion, TreasureItem item)
        {
            // acquire a single treasure item
            // first remove companion from party and add to graveyard
            var companionDie = PartyDice.First(d => d.Companion == companion);

            UsePartyDie(companion);

            // now add treasure
            Inventory.Add(item);

            string message = $"You used a {companionDie.Name} to open a chest and received {item.TreasureType.GetDescription()}. ";

            return(message);
        }
Exemple #7
0
        public string DefeatDragon(TreasureItem treasureItem, Dungeon dungeon)
        {
            // player defeated dragon, let's remove the dice selection and move companions to graveyard
            string selectedCompanions = string.Join(", ", PartyDice.Where(d => d.IsSelected).Select(d => d.Name).ToList());
            int    companionCount     = PartyDice.Count(d => d.IsSelected);

            for (int i = 0; i < companionCount; i++)
            {
                UsePartyDie(PartyDice.First(d => d.IsSelected).Companion);
            }

            Inventory.Add(treasureItem);
            string message = $"{SoundManager.DragonDeathSound(true)} <amazon:emotion name=\"excited\" intensity=\"medium\">You used your {selectedCompanions}, to defeat the dragon. You acquired {treasureItem.TreasureType.GetDescription()}. ";

            message += GainExperiencePoints(1, dungeon);
            message += "</amazon:emotion>";
            return(message);
        }