From d768704b68926aa5eec894ffee3fecc20046d6e8 Mon Sep 17 00:00:00 2001 From: RosimInc Date: Sun, 16 Aug 2015 03:34:18 -0400 Subject: [PATCH] Started the exhaustive awareness functions Signed-off-by: RosimInc --- Assets/Scripts/Models/Person.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Models/Person.cs b/Assets/Scripts/Models/Person.cs index f03871f..77b7a91 100644 --- a/Assets/Scripts/Models/Person.cs +++ b/Assets/Scripts/Models/Person.cs @@ -39,6 +39,9 @@ namespace DeathBook.Model private float awarenessLevel = 0; //on a scale from 0 to 1 public float AwarenessLevel { get { return awarenessLevel; } } + private int lastFriendDeath = 0; + public int LastFriendDeath { get { return lastFriendDeath; } } + private bool alive = true; public bool Alive { get { return alive; } } @@ -97,10 +100,21 @@ namespace DeathBook.Model public void NoticeDeath(Friendship f) { + int deathTime = LevelManager.Instance.GameLevel.GameTime; + float lastFriendDeathMalus = 0; + //Last friend death + if (numDeadFriends > 0) + { + //TODO malus + + //Mathf.Clamp + //lastFriendDeathMalus = deathTime - lastFriendDeath + } + lastFriendDeath = deathTime; + //TODO apply more rules here awarenessLevel = Mathf.Min(AwarenessLevel + 0.2f, 1f); Debug.Log("I am " + id + " and I know my friend " + f.Friend.Id + " was killed.. " + AwarenessLevel); - //TODO remove from dead friends list to accelerate NotifyObservers(); }