public static Character createRandomCharacter() { /** * We want to setup these values in a very particular sequence. * i.e. What is said in life events depends on age. * i.e. A character's name depends on their gender. * etc. etc. */ Age age = Age.ReturnRandomAge(); Mother mother = Mother.ReturnMother(); Father father = Father.ReturnFather(); Parents parents = Parents.ReturnRandomParentsComment(); Appearance appearance = Appearance.ReturnRandomAppearanceComment(); Race race = Race.ReturnRandomRace(); LifeEvents lifeEvents = LifeEvents.ReturnRandomLifeEventsComment(); Childhood childhood = Childhood.ReturnRandomChildhoodEvent(); Adolescence adolescence = Adolescence.ReturnRandomAdolescenceEvent(); Adulthood adulthood = Adulthood.ReturnRandomAdulthoodEvent(); OldAge elder = OldAge.ReturnRandomElderlyEvent(); Profession profession = Profession.ReturnRandomProfession(); RelationshipStatus relationshipStatus = RelationshipStatus.ReturnRandomRelationshipStatus(); Stats stats = Stats.GenerateRandomStats(); Role role = Role.ReturnRandomRole(); Demeanor demeanor = Demeanor.ReturnRandomDemeanor(); Gender gender = Gender.ReturnRandomGender(); CharacterName characterName = CharacterName.ReturnRandomCharacterName(gender); PlaceOfResidence placeOfResidence = PlaceOfResidence.ReturnRandomPlaceOfResidence(); NullChatMenuComponent nullChatMenuComponent = new NullChatMenuComponent(""); Character randomCharacter; randomCharacter = new Character(characterName, age, parents, mother, father, appearance, race, lifeEvents, childhood, adolescence, adulthood, elder, profession, relationshipStatus, stats, role, demeanor, gender, placeOfResidence, nullChatMenuComponent); return(randomCharacter); }
public Dictionary <string, Action> SetupChildhood() { Debug.Log("Set up childhood phase"); Childhood childhood = new Childhood(you); Dictionary <string, Action> options = childhood.GetPossibleActions(); return(options); }
public static Childhood ReturnRandomChildhoodEvent() { List<string> childhoodEventsList = new List<string>(); childhoodEventsList.Add("I fell in love."); childhoodEventsList.Add("I became very sick."); childhoodEventsList.Add("I joined the resistance."); childhoodEventsList.Add("I liberated a group of mutant slaves."); childhoodEventsList.Add("I found myself homeless."); childhoodEventsList.Add("I found myself employed by a very generous corporation."); Childhood randomChildhoodEvent = new Childhood(childhoodEventsList[Random.Range(0, childhoodEventsList.Count)]); return randomChildhoodEvent; }
public Character(CharacterName characterName, Age age, Parents parents, Mother mother, Father father, Appearance appearance, Race race, LifeEvents lifeEvents, Childhood childhood, Adolescence adolescence, Adulthood adulthood, OldAge elder, Profession profession, RelationshipStatus relationshipStatus, Stats stats, Role role, Demeanor demeanor, Gender gender, PlaceOfResidence placeOfResidence, NullChatMenuComponent nullChatMenuComponent) { this.characterName = characterName; this.age = age; this.parents = parents; this.mother = mother; this.father = father; this.appearance = appearance; this.race = race; this.lifeEvents = lifeEvents; this.childhood = childhood; this.adolescence = adolescence; this.adulthood = adulthood; this.elder = elder; this.profession = profession; this.relationshipStatus = relationshipStatus; this.stats = stats; this.role = role; this.demeanor = demeanor; this.gender = gender; this.placeOfResidence = placeOfResidence; this.nullChatMenuComponent = nullChatMenuComponent; }
public void GenerateLife(Random rand, NPCData data, FantasyDate referenceDate) { GenerateID(); BirthDate = referenceDate - rand.Next((int)(data.Race.AverageLifeSpan * 0.2f), (int)(data.Race.AverageLifeSpan * 0.8f)); DeathDate = BirthDate + (data.Race.AverageLifeSpan - (data.Race.AverageLifeSpan / 4)) + rand.Next(1, data.Race.AverageLifeSpan / 2); Dead = DeathDate < data.CurrentDate; Age = Dead ? DeathDate - BirthDate : data.CurrentDate - BirthDate; Male = rand.Next(0, 2) == 0; Race = data.Race.Name; CityOfOrigin = data.CityOfOrigin; KnewParents = rand.Next(1, 101) <= 95; int birthPlaceRoll = rand.Next(1, 101); List <Birthplace> birthPlaceOptions = new List <Birthplace>((IEnumerable <Birthplace>)System.Enum.GetValues(typeof(Birthplace))); for (int i = 0; i < birthPlaceOptions.Count; i++) { int val = (int)birthPlaceOptions[i]; if (birthPlaceRoll <= val) { BirthPlace = birthPlaceOptions[i]; break; } } int upbringingRoll = rand.Next(1, 101); List <Upbringing> upbringingOptions = new List <Upbringing>((IEnumerable <Upbringing>)System.Enum.GetValues(typeof(Upbringing))); for (int i = 0; i < upbringingOptions.Count; i++) { int val = (int)upbringingOptions[i]; if (upbringingRoll <= val) { Family = upbringingOptions[i]; break; } } Background = (Background)rand.Next(0, System.Enum.GetValues(typeof(Background)).Length); if (!KnewParents || Family != Upbringing.MotherAndFather) { AbsentParentReason = (AbsentParent)rand.Next(1, 5); } else { AbsentParentReason = AbsentParent.NotAbsent; } int childhoodRoll = rand.Next(1, 7) + rand.Next(1, 7) + rand.Next(1, 7); List <Childhood> childhoodOptions = new List <Childhood>((IEnumerable <Childhood>)System.Enum.GetValues(typeof(Childhood))); for (int i = 0; i < childhoodOptions.Count; i++) { int val = (int)childhoodOptions[i]; if (childhoodRoll <= val) { Childhood = childhoodOptions[i]; break; } } int lifeEvents = 1; if (Age > 100) { lifeEvents = rand.Next(1, 13); } else if (Age > 90) { lifeEvents = rand.Next(1, 11); } else if (Age > 70) { lifeEvents = rand.Next(1, 9); } else if (Age > 60) { lifeEvents = rand.Next(1, 7); } else if (Age > 21) { lifeEvents = rand.Next(1, 5); } List <LifeEventOption> lifeEventOptions = new List <LifeEventOption>((IEnumerable <LifeEventOption>)System.Enum.GetValues(typeof(LifeEventOption))); for (int i = 0; i < lifeEvents; i++) { int lifeEventRoll = rand.Next(1, 101); LifeEvent lifeEvent = new LifeEvent(); for (int j = 0; j < lifeEventOptions.Count; j++) { int val = (int)lifeEventOptions[j]; if (lifeEventRoll <= val) { lifeEvent.Event = lifeEventOptions[j]; break; } } switch (lifeEvent.Event) { case LifeEventOption.Tragedy: break; case LifeEventOption.GoodFortune: break; case LifeEventOption.EnemyOfAdventurer: break; case LifeEventOption.MetSomeoneImportant: break; case LifeEventOption.WentOnAdventure: break; case LifeEventOption.SupernaturalExperience: break; case LifeEventOption.Crime: break; case LifeEventOption.MagicEncounter: break; case LifeEventOption.StrangeEvent: break; } LifeEvents.Add(lifeEvent); } }