Exemplo n.º 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);
     }
 }
Exemplo n.º 2
0
 public int GetSpeciesPopulation(CreatureSpecies Species)
 {
     if (!PersistentData.SpeciesCounts.ContainsKey(Species.Name))
     {
         return(0);
     }
     return(PersistentData.SpeciesCounts[Species.Name]);
 }
Exemplo n.º 3
0
        public void AddToSpeciesTracking(CreatureSpecies Species)
        {
            if (!PersistentData.SpeciesCounts.ContainsKey(Species.Name))
            {
                PersistentData.SpeciesCounts.Add(Species.Name, 0);
            }

            PersistentData.SpeciesCounts[Species.Name] += 1;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
     }
 }
Exemplo n.º 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;
        }
Exemplo n.º 7
0
 void OnDeserializing(StreamingContext context)
 {
     CurrentClass = Library.GetClass(ClassName);
     Species      = Library.GetSpecies(SpeciesName);
 }