void SetAbilitiesFrom(MonsterDto monsterDto) { baseStrength = MathUtils.GetInt(monsterDto.STR); strengthMod = GetNumberInParens(monsterDto.STR_mod); baseIntelligence = MathUtils.GetInt(monsterDto.INT); intelligenceMod = GetNumberInParens(monsterDto.INT_mod); baseDexterity = MathUtils.GetInt(monsterDto.DEX); dexterityMod = GetNumberInParens(monsterDto.DEX_mod); baseConstitution = MathUtils.GetInt(monsterDto.CON); constitutionMod = GetNumberInParens(monsterDto.CON_mod); baseWisdom = MathUtils.GetInt(monsterDto.WIS); wisdomMod = GetNumberInParens(monsterDto.WIS_mod); baseCharisma = MathUtils.GetInt(monsterDto.CHA); charismaMod = GetNumberInParens(monsterDto.CHA_mod); }
public static Monster From(MonsterDto monsterDto) { Monster monster = new Monster(); monster.SetFromMeta(monsterDto.Meta); monster.Kind = monsterDto.Kind; monster.SetArmorClassFromStr(monsterDto.ArmorClass); monster.SetHitPointsFromStr(monsterDto.HitPoints); monster.SetAbilitiesFrom(monsterDto); monster.SetSavingThrowModsFrom(monsterDto.SavingThrows); monster.SetSpeedFromStr(monsterDto.Speed); monster.SetSkillCheckBonuses(monsterDto.Skills); monster.SetDamageImmunities(monsterDto.DamageImmunities); monster.SetConditionImmunities(monsterDto.ConditionImmunities); monster.SetDamageVulnerabilities(monsterDto.DamageVulnerabilities); monster.SetDamageResistances(monsterDto.DamageResistances); monster.SetSensesFromStr(monsterDto.Senses); monster.SetChallengeRatingXpFromStr(monsterDto.Challenge); monster.ImageUrl = monsterDto.img_url; monster.ImageCropInfo = PictureCropInfo.FromStr(monsterDto.imageCrop); return(monster); }