Example #1
0
        public static void AddDiceForCreature(List <DiceDto> diceDtos, string dieStr, int creatureIndex, DiceRollType type)
        {
            DieRollDetails dieRollDetails = DieRollDetails.From(dieStr);

            foreach (InGameCreature inGameCreature in Creatures)
            {
                if (inGameCreature.Index == creatureIndex)
                {
                    foreach (Roll roll in dieRollDetails.Rolls)
                    {
                        DiceDto npcMonsterDice = new DiceDto();
                        npcMonsterDice.Sides    = roll.Sides;
                        npcMonsterDice.Quantity = (int)Math.Round(roll.Count);
                        npcMonsterDice.SetRollDetails(type, roll.Descriptor);
                        SetDiceFromCreature(inGameCreature, npcMonsterDice);
                        diceDtos.Add(npcMonsterDice);
                    }
                }
            }
        }
Example #2
0
        public static void AddDiceForTargeted(List <DiceDto> diceDtos, string dieStr)
        {
            DieRollDetails dieRollDetails = DieRollDetails.From(dieStr);

            foreach (InGameCreature inGameCreature in Creatures)
            {
                if (inGameCreature.IsTargeted)
                {
                    foreach (Roll roll in dieRollDetails.Rolls)
                    {
                        DiceDto npcMonsterDice = new DiceDto
                        {
                            Sides    = roll.Sides,
                            Quantity = (int)Math.Round(roll.Count),
                        };
                        npcMonsterDice.SetRollDetails(DiceRollType.None, roll.Descriptor);
                        SetDiceFromCreature(inGameCreature, npcMonsterDice);
                        diceDtos.Add(npcMonsterDice);
                    }
                }
            }
        }