/// <summary> /// Create a generic NpcCharacter. /// </summary> /// <param name="ParentObjectScript">The in-game object that represents this NPC.</param> /// <param name="MasterSubjectListRef">A reference to the main MasterSubjectList.</param> public NpcCore(AnimalObjectScript ParentObjectScript, MasterSubjectList MasterSubjectListRef) { db = MasterSubjectListRef; objectScript = ParentObjectScript; health = 100; food = 100; safety = 100; definition = new NpcDefinition(); status = new NpcStatus(); drivers = new NpcDriversList(); unexploredLocations = new List <LocationSubject>(); subjectID = -1; searchedObjects = new List <int>(); searchedLocations = new List <int>(); reExploreLocations = new List <LocationSubject>(); SetFoodPreference(); }
/// <summary> /// Initialize a new NpcCharacter. /// </summary> /// <param name="ParentObject">The in-game object that represents this NPC.</param> /// <param name="MasterSubjectListRef">A reference to the main MasterSubjectList.</param> /// <param name="BasedOnSubject">Subject's NpcDefinition will define the character's initial resource pools, thresholds for fulfilling basic needs, and memories.</param> public NpcCore(AnimalObjectScript ParentObjectScript, MasterSubjectList MasterSubjectListRef, Subject BasedOnSubject) { db = MasterSubjectListRef; if (BasedOnSubject is AnimalSubject) { objectScript = ParentObjectScript; AnimalSubject animalSubject = BasedOnSubject as AnimalSubject; definition = animalSubject.Definition; subjectID = animalSubject.SubjectID; health = definition.HealthMax; food = definition.FoodMax; safety = definition.SafetyHigh; status = new NpcStatus(); drivers = new NpcDriversList(); unexploredLocations = new List <LocationSubject>(); searchedObjects = new List <int>(); searchedLocations = new List <int>(); reExploreLocations = new List <LocationSubject>(); SetFoodPreference(); } }