/// <summary> /// Updates influences. /// </summary> /// <param name="_influences">Influences.</param> public void UpdateStatusInfluences(InfluenceObject _influences) { if (_influences == null || _influences.Enabled == false) { return; } if (_influences.UseDamageInPercent) { Status.AddDamageInPercent(_influences.GetDamage()); } else { Status.AddDamage(_influences.GetDamage()); } if (_influences.UseStressInPercent) { Status.AddStressInPercent(_influences.GetStress()); } else { Status.AddStress(_influences.GetStress()); } if (_influences.UseDebilityInPercent) { Status.AddDebilityInPercent(_influences.GetDebility()); } else { Status.AddDebility(_influences.GetDebility()); } if (_influences.UseHungerInPercent) { Status.AddHungerInPercent(_influences.GetHunger()); } else { Status.AddHunger(_influences.GetHunger()); } if (_influences.UseThirstInPercent) { Status.AddThirstInPercent(_influences.GetThirst()); } else { Status.AddThirst(_influences.GetThirst()); } Status.AddAggressivity(_influences.Aggressivity); Status.AddAnxiety(_influences.Anxiety); Status.AddExperience(_influences.Experience); Status.AddNosiness(_influences.Nosiness); }
//-------------------------------------------------- public void FixedUpdate() { //TODO: obsolete if (Missions.Outpost.TargetReady()) { Missions.Outpost.Target.FixedUpdate(); } if (Missions.Escort.TargetReady()) { Missions.Escort.Target.FixedUpdate(); } if (Missions.Patrol.TargetReady()) { Missions.Patrol.Target.FixedUpdate(); } if (Interaction.TargetReady()) { Interaction.FixedUpdate(); } if (ActiveTarget != null && ActiveTarget.IsValid) { ActiveTarget.FixedUpdate(); } if (Behaviour.BehaviourMode != null && Behaviour.BehaviourMode.Rule != null && Behaviour.BehaviourMode.Rule.Influences.Enabled) { Status.AddDamage(Behaviour.BehaviourMode.Rule.Influences.Damage); Status.AddStress(Behaviour.BehaviourMode.Rule.Influences.Stress); Status.AddDebility(Behaviour.BehaviourMode.Rule.Influences.Debility); Status.AddHunger(Behaviour.BehaviourMode.Rule.Influences.Hunger); Status.AddThirst(Behaviour.BehaviourMode.Rule.Influences.Thirst); } if (Environment.SurfaceHandler.ActiveSurface != null && Environment.SurfaceHandler.ActiveSurface.Influences.Enabled == true) { Status.AddDamage(Environment.SurfaceHandler.ActiveSurface.Influences.Damage); Status.AddStress(Environment.SurfaceHandler.ActiveSurface.Influences.Stress); Status.AddDebility(Environment.SurfaceHandler.ActiveSurface.Influences.Debility); Status.AddHunger(Environment.SurfaceHandler.ActiveSurface.Influences.Hunger); Status.AddThirst(Environment.SurfaceHandler.ActiveSurface.Influences.Thirst); } Status.FixedUpdate(); if (Status.IsDead) { Behaviour.SetBehaviourModeByKey(Essentials.BehaviourModeDead); Status.RespawnRequest(); } if (Status.IsRespawnTime) { Status.Respawn(); } }
public void HandleCollision(Collision collision) { if (!Environment.CollisionHandler.Enabled || Status.IsDead) { return; } CollisionDataObject _impact = Environment.CollisionHandler.CheckCollision(collision); if (_impact != null) { Status.AddDamage(_impact.Influences.Damage); Status.AddStress(_impact.Influences.Stress); Status.AddDebility(_impact.Influences.Debility); Status.AddHunger(_impact.Influences.Hunger); Status.AddThirst(_impact.Influences.Thirst); if (_impact.BehaviourModeKey != "") { Behaviour.SetBehaviourModeByKey(_impact.BehaviourModeKey); } } }