public virtual string CreateNextDungeonLevel() { // creates the next dungeon level Level++; // get the number of dice we can roll int dungeonDiceToRoll = Math.Min(Level, TOTAL_DUNGEON_DICE - DragonsLair); for (int i = 0; i < dungeonDiceToRoll; i++) { var die = new DungeonDie(); // if dragon add it to dragon's lair and continue if (die.DungeonDieType == DungeonDieType.Dragon) { DragonsLair++; // we got a dragon continue with a new die continue; } // not a dragon, at it to dungeon dice DungeonDice.Add(die); } string dragons = DragonsLair > 0 ? $"The number of dragon dice in the Dragon's lair is {DragonsLair}. " : ""; string message = $"{SoundManager.DiceRollSound(true)} {dragons}"; return(message); }
public override string CreateNewDungeon() { // create default dungeon if we don't need to transform skeletons yet if (!SkeletonsToPotions) { return(base.CreateNewDungeon()); } string message = ""; NumberOfDelves++; Level = 1; DungeonDice = new List <DungeonDie>(); DragonsLair = 0; switch (NumberOfDelves) { case 1: message += "Get ready for your first dungeon delve! "; break; case 2: message += "Get ready for your second dungeon delve! "; break; case 3: message += "Get ready for your final dungeon delve! "; break; } DungeonDie die = new DungeonDie(); if (die.DungeonDieType == DungeonDieType.Dragon) { DragonsLair++; message += "The first level of the dungeon is empty, but there is one dragon die in the Dragon's Lair. "; } else if (die.DungeonDieType == DungeonDieType.Skeleton) { die.DungeonDieType = DungeonDieType.Potion; DungeonDice.Add(die); message += $"The first level in the dungeon has one {DungeonDice[0].DungeonDieType} which was transformed from a skeleton. "; } else { DungeonDice.Add(die); message += $"The first level in the dungeon has one {DungeonDice[0].DungeonDieType}. "; } return(message); }
public override string CreateNewDungeon() { string message = ""; if (TreasureItems == null) { TreasureItems = Utilities.GenerateTreasureItems(); } NumberOfDelves++; Level = 1; DungeonDice = new List <DungeonDie>(); DragonsLair = 0; switch (NumberOfDelves) { case 1: message += "Get ready for your first dungeon delve! "; break; case 2: message += "Get ready for your second dungeon delve! "; break; case 3: message += "Get ready for your final dungeon delve! "; break; } DungeonDie die = new DungeonDie(); if (die.DungeonDieType == DungeonDieType.Dragon) { DragonsLair++; message += "The first level of the dungeon is empty, but there is one dragon die in the Dragon's Lair. "; } else if (die.DungeonDieType == DungeonDieType.Chest) { die.DungeonDieType = DungeonDieType.Potion; DungeonDice.Add(die); message += $"The first level in the dungeon has one {DungeonDice[0].DungeonDieType} which was transformed from a chest. "; } else { DungeonDice.Add(die); message += $"The first level in the dungeon has one {DungeonDice[0].DungeonDieType}. "; } return(message); }
public override string CreateNextDungeonLevel() { // use default level creation if we dont need to transform yet if (!SkeletonsToPotions) { return(base.CreateNextDungeonLevel()); } Level++; // get the number of dice we can roll int dungeonDiceToRoll = Math.Min(Level, TOTAL_DUNGEON_DICE - DragonsLair); int transformedSkeletons = 0; for (int i = 0; i < dungeonDiceToRoll; i++) { var die = new DungeonDie(); // if dragon add it to dragon's lair and continue if (die.DungeonDieType == DungeonDieType.Dragon) { DragonsLair++; // we got a dragon continue with a new die continue; } // transform skeleton into potion if die is a skeleton if (die.DungeonDieType == DungeonDieType.Skeleton) { die.DungeonDieType = DungeonDieType.Potion; transformedSkeletons++; } // at it to dungeon dice DungeonDice.Add(die); } string dragons = DragonsLair > 0 ? $"The number of dragon dice in the Dragon's lair is {DragonsLair}. " : ""; string skeletonsToPotionsMessage = ""; if (transformedSkeletons == 1) { skeletonsToPotionsMessage = "One skeleton was transformed to a potion. "; } if (transformedSkeletons > 1) { skeletonsToPotionsMessage = $"{transformedSkeletons} skeletons were transformed to potions. "; } string message = $"{SoundManager.DiceRollSound(true)} {dragons}{skeletonsToPotionsMessage}"; return(message); }
public override string CreateNextDungeonLevel() { // creates the next dungeon level Level++; // get the number of dice we can roll int dungeonDiceToRoll = Math.Min(Level, TOTAL_DUNGEON_DICE - DragonsLair); int transformedChests = 0; for (int i = 0; i < dungeonDiceToRoll; i++) { var die = new DungeonDie(); // if dragon add it to dragon's lair and continue if (die.DungeonDieType == DungeonDieType.Dragon) { DragonsLair++; // we got a dragon continue with a new die continue; } // transform chest into potion if die is a chest if (die.DungeonDieType == DungeonDieType.Chest) { die.DungeonDieType = DungeonDieType.Potion; transformedChests++; } // at it to dungeon dice DungeonDice.Add(die); } string dragons = DragonsLair > 0 ? $"The number of dragon dice in the Dragon's lair is {DragonsLair}. " : ""; string chestsToPotions = ""; if (transformedChests == 1) { chestsToPotions = "One chest was transformed to a potion. "; } if (transformedChests > 1) { chestsToPotions = $"{transformedChests} chests were transformed to potions. "; } string message = $"{SoundManager.DiceRollSound(true)} {dragons}{chestsToPotions}"; return(message); }
public virtual string CreateNewDungeon() { string message = ""; NumberOfDelves++; Level = 1; DungeonDice = new List <DungeonDie>(); DragonsLair = 0; switch (NumberOfDelves) { case 1: message += "Get ready for your first dungeon delve! "; break; case 2: message += "Get ready for your second dungeon delve! "; break; case 3: message += "Get ready for your final dungeon delve! "; break; } DungeonDie die = new DungeonDie(); if (die.DungeonDieType == DungeonDieType.Dragon) { DragonsLair++; message += "The first level of the dungeon is empty, but there is one dragon die in the Dragon's Lair. "; } else { DungeonDice.Add(die); message += $"The first level in the dungeon has one {DungeonDice[0].DungeonDieType}. "; } return(message); }