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 Mother(CharacterName name, Race race, Profession profession, Demeanor demeanor, Gender gender) { this.name = name; this.race = race; this.profession = profession; this.demeanor = demeanor; this.gender = gender; }
public void Anger() { demeanor = demeanor.Increment(); if (demeanor == Demeanor.Angry) { stateMachine.SetState("AngryIdle"); } }
public static Mother ReturnMother() { Gender gender = new Gender("female"); CharacterName name = CharacterName.ReturnRandomCharacterName(gender); Race race = Race.ReturnRandomRace(); Profession profession = Profession.ReturnRandomProfession(); Demeanor demeanor = Demeanor.ReturnRandomDemeanor(); return(new Mother(name, race, profession, demeanor, gender)); }
public void Slow(float fraction) { // Force a new path if the sheep was angry before. if (demeanor == Demeanor.Angry) { stateMachine.SetState("Idle"); } demeanor = demeanor.Decrement(); slowFraction = fraction; }
public ActionResult Create([Bind(Include = "AnimalFriendly,KidFriendly,Comments,DogId")] Demeanor demeanor) { var userResult = User.Identity.GetUserId(); var currentUser = db.Owners.Where(x => userResult == x.ApplicationId).FirstOrDefault(); var currentDog = db.Dogs.Where(x => currentUser.Id == x.OwnerId).FirstOrDefault(); demeanor.DogId = currentDog.Id; if (ModelState.IsValid) { db.Demeanor.Add(demeanor); db.SaveChanges(); return(RedirectToAction("Index", "Dogs")); } return(View(demeanor)); }
public static Demeanor ReturnRandomDemeanor() { List <string> demeanorList = new List <string>(); demeanorList.Add("happy"); demeanorList.Add("positive"); demeanorList.Add("indifferent"); demeanorList.Add("angry"); demeanorList.Add("abusive"); demeanorList.Add("depressed"); Demeanor randomDemeanor = new Demeanor(demeanorList[Random.Range(0, demeanorList.Count)]); return(randomDemeanor); }
public static Demeanor Decrement(this Demeanor effect) { switch (effect) { case Demeanor.Slow: return(Demeanor.Slow); case Demeanor.Normal: return(Demeanor.Slow); case Demeanor.Angry: return(Demeanor.Normal); } return(Demeanor.Normal); }
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 static GameObject LoadGameObject(this XElement xml) { if (xml.Name.LocalName != GameObjectNode) { throw new ArgumentException("Load GameObject: xml is not a GameObject"); } var type = (ObjectType)Enum.Parse(typeof(ObjectType), xml.Attribute("Type").Value); switch (type) { case ObjectType.Character: return(Character.FromXml(xml)); case ObjectType.Demeanor: return(Demeanor.FromXml(xml)); case ObjectType.Advantage: return(Advantage.FromXml(xml)); case ObjectType.Disadvantage: return(Disadvantage.FromXml(xml)); case ObjectType.Ability: return(Ability.FromXml(xml)); case ObjectType.Equipment: return(Gear.FromXml(xml)); case ObjectType.Template: return(Template.FromXml(xml)); default: throw new ArgumentException("Load GameObject: xml GameObject unknown type."); } }
// GET: Demeanors/Create public ActionResult Create() { Demeanor demeanor = new Demeanor(); return(View(demeanor)); }