Example #1
0
 public CreatureStats(EmployeeClass creatureClass, int level)
 {
     CanSleep     = false;
     CanEat       = false;
     FullName     = "";
     CurrentClass = creatureClass;
     AllowedTasks = CurrentClass.Actions;
     LevelIndex   = level;
     XP           = creatureClass.Levels[level].XP;
     Dexterity    = Math.Max(Dexterity, CurrentLevel.BaseStats.Dexterity);
     Constitution = Math.Max(Constitution, CurrentLevel.BaseStats.Constitution);
     Strength     = Math.Max(Strength, CurrentLevel.BaseStats.Strength);
     Wisdom       = Math.Max(Wisdom, CurrentLevel.BaseStats.Wisdom);
     Charisma     = Math.Max(Charisma, CurrentLevel.BaseStats.Charisma);
     Intelligence = Math.Max(Intelligence, CurrentLevel.BaseStats.Intelligence);
     StatBuffs    = new StatNums()
     {
         Charisma     = 0,
         Constitution = 0,
         Dexterity    = 0,
         Intelligence = 0,
         Size         = 0,
         Strength     = 0,
         Wisdom       = 0
     };
     Age = (int)Math.Max(MathFunctions.RandNormalDist(30, 15), 10);
 }
Example #2
0
 public CreatureStats()
 {
     CanSleep     = false;
     CanEat       = false;
     CanGetBored  = false;
     FullName     = "";
     CurrentClass = new WorkerClass();
     AllowedTasks = CurrentClass.Actions;
     LevelIndex   = 0;
     XP           = 0;
     IsMigratory  = false;
     StatBuffs    = new StatNums()
     {
         Charisma     = 0,
         Constitution = 0,
         Dexterity    = 0,
         Intelligence = 0,
         Size         = 0,
         Strength     = 0,
         Wisdom       = 0
     };
     Age        = (int)Math.Max(MathFunctions.RandNormalDist(30, 15), 10);
     RandomSeed = MathFunctions.RandInt(int.MinValue, int.MaxValue);
     VoicePitch = 1.0f;
 }
Example #3
0
        public EmployeeClass(EmployeeClassDef definition)
        {
            Name   = definition.Name;
            Levels = definition.Levels;
            foreach (string s in definition.Actions)
            {
                var value = Task.TaskCategory.None;
                if (Enum.TryParse(s, true, out value))
                {
                    Actions |= value;
                }
            }

            Animations = AnimationLibrary.LoadCompositeAnimationSet(definition.Animations, Name);
            Attacks    = definition.Attacks;
        }
Example #4
0
        // Todo: Should just include name of attack animation. Kinda what the AttackMode is.

        public bool IsTaskAllowed(Task.TaskCategory TaskCategory)
        {
            return((Actions & TaskCategory) == TaskCategory);
        }
Example #5
0
 public static List <CreatureAI> FilterMinionsWithCapability(List <CreatureAI> minions, Task.TaskCategory action)
 {
     return(minions.Where(creature => creature.Stats.IsTaskAllowed(action)).ToList());
 }