Beispiel #1
0
 public void RemoveFromSpeciesTracking(CreatureSpecies Species)
 {
     if (PersistentData.SpeciesCounts.ContainsKey(Species.Name))
     {
         PersistentData.SpeciesCounts[Species.Name] = Math.Max(0, PersistentData.SpeciesCounts[Species.Name] - 1);
     }
 }
Beispiel #2
0
 public int GetSpeciesPopulation(CreatureSpecies Species)
 {
     if (!PersistentData.SpeciesCounts.ContainsKey(Species.Name))
     {
         return(0);
     }
     return(PersistentData.SpeciesCounts[Species.Name]);
 }
Beispiel #3
0
        public void AddToSpeciesTracking(CreatureSpecies Species)
        {
            if (!PersistentData.SpeciesCounts.ContainsKey(Species.Name))
            {
                PersistentData.SpeciesCounts.Add(Species.Name, 0);
            }

            PersistentData.SpeciesCounts[Species.Name] += 1;
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
 public void RemoveFromSpeciesTracking(CreatureSpecies Species)
 {
     if (!PersistentData.SpeciesCounts.ContainsKey(Species.Name))
     {
         PersistentData.SpeciesCounts.Add(Species.Name, 0);
     }
     else
     {
         PersistentData.SpeciesCounts[Species.Name] += 1;
     }
 }
Beispiel #6
0
        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;
        }
Beispiel #7
0
 void OnDeserializing(StreamingContext context)
 {
     CurrentClass = Library.GetClass(ClassName);
     Species      = Library.GetSpecies(SpeciesName);
 }