Ejemplo n.º 1
0
        public bool HasDamage(DamageType damage)
        {
            if (DamageHealthExtraDice != null)
            {
                DieRollDetails dieRollDetails = DieRollDetails.From(DamageHealthExtraDice);
                foreach (Roll roll in dieRollDetails.Rolls)
                {
                    if (DndUtils.ToDamage(roll.Descriptor) == damage)
                    {
                        return(true);
                    }
                }
            }

            if (DiceDtos?.Any() == true)
            {
                foreach (DiceDto diceDto in DiceDtos)
                {
                    if (diceDto.DamageType == damage)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
        void AddDice(int quantity, int sides, string label, double modifier, VantageKind vantage, int creatureId, string backColor = null, string fontColor = null, string playerName = null)
        {
            if (vantage != VantageKind.Normal && quantity == 1)
            {
                quantity = 2;
            }

            DiceDto diceDto = new DiceDto();

            if (backColor != null)
            {
                diceDto.BackColor = backColor;
            }
            if (fontColor != null)
            {
                diceDto.FontColor = fontColor;
            }
            diceDto.Label = label;
            if (playerName == null)
            {
                playerName = label;
            }
            diceDto.PlayerName = playerName;
            diceDto.CreatureId = creatureId;
            diceDto.Quantity   = quantity;
            diceDto.Sides      = sides;
            diceDto.Modifier   = modifier;
            diceDto.Vantage    = vantage;
            DiceDtos.Add(diceDto);
        }