static void ScaleDiceToMatchPlayers(DiceRoll diceRoll) { if (diceRoll.IsOnePlayer) { List <int> creatureIds = diceRoll.GetCreatureIds(); if (creatureIds != null && creatureIds.Count == 1 && creatureIds[0] >= 0) { diceRoll.OverallDieScale = GetPlayerDieScaleById(creatureIds[0]); } } else { foreach (DiceDto diceDto in diceRoll.DiceDtos) { if (diceDto?.CreatureId >= 0) { diceDto.Scale = GetPlayerDieScaleById(diceDto.CreatureId); } } foreach (PlayerRollOptions playerRollOptions in diceRoll.PlayerRollOptions) { playerRollOptions.Scale = GetPlayerDieScaleById(playerRollOptions.PlayerID); } } }
static void AddVantageDice(DiceRoll diceRoll) { VantageKind vantageKind = diceRoll.VantageKind; if (diceRoll.IsOnePlayer) { List <int> creatureIds = diceRoll.GetCreatureIds(); if (creatureIds != null && creatureIds.Count == 1) { diceRoll.VantageKind = vantageKind; foreach (PlayerRollOptions playerRollOptions in diceRoll.PlayerRollOptions) { if (playerRollOptions.PlayerID == creatureIds[0]) { vantageKind = playerRollOptions.VantageKind; BeforePlayerRolls(creatureIds[0], diceRoll, ref vantageKind); playerRollOptions.VantageKind = vantageKind; break; } } } } else { foreach (PlayerRollOptions playerRollOptions in diceRoll.PlayerRollOptions) { vantageKind = playerRollOptions.VantageKind; BeforePlayerRolls(playerRollOptions.PlayerID, diceRoll, ref vantageKind); } } }