private void SetMonsterStats(MonsterPerson monsterPerson, Language currentLanguage) { var hpStat = monsterPerson.GetModule <ISurvivalModule>().Stats.SingleOrDefault(x => x.Type == SurvivalStatType.Health); if (hpStat == null) { return; } var monsterHealthStateKey = HealthHelper.GetHealthStateKey(hpStat); var monsterHealthState = StaticPhrases.GetValue($"state-hp-{monsterHealthStateKey}", currentLanguage); MonsterHpText.text = monsterHealthState; }
public static string GetPerkHintText(MonsterPerson monster) { var name = GetMonsterName(monster); var description = GetMonsterDescription(monster); var survivalModule = monster.GetModule <ISurvivalModule>(); var hpStat = survivalModule.Stats.Single(x => x.Type == SurvivalStatType.Health); var healthState = GetHealthState(hpStat.ValueShare); if (!string.IsNullOrWhiteSpace(description)) { return($"{name}\n{new string('-', 8)}\n{healthState}\n{new string('-', 8)}\n{description}"); } return($"{name}\n{new string('-', 8)}\n{healthState}"); }