Aura.Channel.World.Entities.NPC.GetStress C# (CSharp) Метод

GetStress() публичный Метод

Gets how much the other creature is stressing the NPC.
public GetStress ( Creature other ) : int
other Creature
Результат int
		public int GetStress(Creature other)
		{
			// Get NPC stress and last change date
			var stress = other.Vars.Perm["npc_stress_" + this.Name] ?? 0;
			var change = other.Vars.Perm["npc_stress_change_" + this.Name];

			// Reduce stress by 1 each minute
			if (change != null && stress > 0)
			{
				TimeSpan diff = DateTime.Now - change;
				stress = Math.Max(0, stress - Math.Floor(diff.TotalMinutes));
			}

			return (int)stress;
		}