public PlayerClassDefinition(RarityCategory rarity, NameGenerator nameGenerator, IPlayerClass playerClass) { Rarity = rarity; NameGenerator = nameGenerator; PlayerClass = playerClass; Id = playerClass.Id; }
public static void TakeInitialClass(IPlayerClass playerClass) { FeaturesManager.RemoveClassFeatures(); ProficiencyManager.RemoveClassProficiencies(); PrimaryClass = playerClass.TakeAsPrimaryClass(); Classes.Clear(); Classes.Add(PrimaryClass); HitDiceTotal = new CompoundDice(PrimaryClass.CurrentTotalHitDice); HitDiceCurrent = new CompoundDice(HitDiceTotal); }
public static string GetTooltip(ICharacterClass characterClass) { IPlayerClass asPlayerClass = characterClass as IPlayerClass; StringBuilder sb = new StringBuilder(50); if (!string.IsNullOrWhiteSpace(characterClass.Desc)) { sb.Append("\"").Append(characterClass.Desc).AppendLine("\""); } if (asPlayerClass != null) { if (asPlayerClass.WeaponProficiency != WeaponType.Invalid) { sb.AppendLine("Weapon Proficiencies: "); bool any = false; sb.Append(" "); foreach (WeaponType weaponType in Enum.GetValues(typeof(WeaponType))) { if (weaponType == WeaponType.Invalid) { continue; } if (asPlayerClass.WeaponProficiency.HasFlag(weaponType)) { if (any) { sb.Append(" | "); } any = true; sb.Append(weaponType); } } sb.AppendLine(); } if (asPlayerClass.ArmorProficiency != ArmorType.Invalid) { sb.AppendLine("Armor Proficiencies: "); bool any = false; sb.Append(" "); foreach (ArmorType armorType in Enum.GetValues(typeof(ArmorType))) { if (armorType == ArmorType.Invalid) { continue; } if (asPlayerClass.ArmorProficiency.HasFlag(armorType)) { if (any) { sb.Append(" | "); } any = true; sb.Append(armorType); } } sb.AppendLine(); } } if (characterClass.IntrinsicDamageModification.Count > 0) { sb.AppendLine("Damage Modifiers: "); foreach (var dmgModKvp in characterClass.IntrinsicDamageModification) { sb.Append(" ").Append(dmgModKvp.Key).Append(": ").Append(dmgModKvp.Value).AppendLine("%"); } } if (characterClass.AbilitiesPerLevel.Count > 0) { sb.AppendLine("Learned Abilities: "); foreach (var abilitiesForLevel in characterClass.AbilitiesPerLevel) { uint level = abilitiesForLevel.Key; foreach (var ability in abilitiesForLevel.Value) { sb.Append(" [Lvl ").Append(level).Append("] ").AppendLine(ability.Name); } } } return(sb.ToString()); }