public void RemoveFromSpeciesTracking(CreatureSpecies Species) { if (PersistentData.SpeciesCounts.ContainsKey(Species.Name)) { PersistentData.SpeciesCounts[Species.Name] = Math.Max(0, PersistentData.SpeciesCounts[Species.Name] - 1); } }
public int GetSpeciesPopulation(CreatureSpecies Species) { if (!PersistentData.SpeciesCounts.ContainsKey(Species.Name)) { return(0); } return(PersistentData.SpeciesCounts[Species.Name]); }
public void AddToSpeciesTracking(CreatureSpecies Species) { if (!PersistentData.SpeciesCounts.ContainsKey(Species.Name)) { PersistentData.SpeciesCounts.Add(Species.Name, 0); } PersistentData.SpeciesCounts[Species.Name] += 1; }
public bool CanSpawnWithoutExceedingSpeciesLimit(CreatureSpecies Species) { if (!PersistentData.SpeciesCounts.ContainsKey(Species.Name)) { return(true); } var effectiveLimit = Math.Round(Species.SpeciesLimit * GameSettings.Current.SpeciesLimitAdjust); return(PersistentData.SpeciesCounts[Species.Name] < effectiveLimit); }
public void RemoveFromSpeciesTracking(CreatureSpecies Species) { if (!PersistentData.SpeciesCounts.ContainsKey(Species.Name)) { PersistentData.SpeciesCounts.Add(Species.Name, 0); } else { PersistentData.SpeciesCounts[Species.Name] += 1; } }
public CreatureStats(String SpeciesName, String ClassName, int level) : this() { this.ClassName = ClassName; CurrentClass = Library.GetClass(ClassName); this.SpeciesName = SpeciesName; Species = Library.GetSpecies(SpeciesName); AllowedTasks = CurrentClass.Actions; LevelIndex = level; XP = CurrentClass.Levels[level].XP; BaseCharisma = CurrentLevel.BaseStats.Charisma; BaseConstitution = CurrentLevel.BaseStats.Constitution; BaseDexterity = CurrentLevel.BaseStats.Dexterity; BaseIntelligence = CurrentLevel.BaseStats.Intelligence; BaseStrength = CurrentLevel.BaseStats.Strength; BaseWisdom = CurrentLevel.BaseStats.Wisdom; Title = CurrentLevel.Name; }
void OnDeserializing(StreamingContext context) { CurrentClass = Library.GetClass(ClassName); Species = Library.GetSpecies(SpeciesName); }