From fdba06bdc8efe2f27e94b3146d55e83e252a23b2 Mon Sep 17 00:00:00 2001 From: RosimInc Date: Sun, 16 Aug 2015 23:06:37 -0400 Subject: [PATCH] Added statuses. Signed-off-by: RosimInc --- Assets/Scenes/Gameplay.unity | 16 ++++++++++++++++ Assets/Scripts/Models/Person.cs | 16 ++++++++-------- Assets/Scripts/Models/Status.cs | 8 ++++---- Assets/Scripts/PersonNode.cs | 2 +- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/Assets/Scenes/Gameplay.unity b/Assets/Scenes/Gameplay.unity index c0e07ca..abac13f 100644 --- a/Assets/Scenes/Gameplay.unity +++ b/Assets/Scenes/Gameplay.unity @@ -1512,6 +1512,22 @@ Prefab: propertyPath: DetailsPanel value: objectReference: {fileID: 1197925315} + - target: {fileID: 11432906, guid: 136ea38d5deb4c9418beb879167d9b03, type: 2} + propertyPath: strategy.deathNoticing.modifier + value: .200000003 + objectReference: {fileID: 0} + - target: {fileID: 11432906, guid: 136ea38d5deb4c9418beb879167d9b03, type: 2} + propertyPath: levelOptions.NumPeople + value: 50 + objectReference: {fileID: 0} + - target: {fileID: 11432906, guid: 136ea38d5deb4c9418beb879167d9b03, type: 2} + propertyPath: levelOptions.AvgNumFriends + value: 8 + objectReference: {fileID: 0} + - target: {fileID: 11432906, guid: 136ea38d5deb4c9418beb879167d9b03, type: 2} + propertyPath: levelOptions.FriendshipLikeliness + value: .600000024 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 136ea38d5deb4c9418beb879167d9b03, type: 2} m_IsPrefabParent: 0 diff --git a/Assets/Scripts/Models/Person.cs b/Assets/Scripts/Models/Person.cs index a5cf0b3..8e50662 100644 --- a/Assets/Scripts/Models/Person.cs +++ b/Assets/Scripts/Models/Person.cs @@ -154,7 +154,7 @@ namespace DeathBook.Model AwarenessLevel = Mathf.Min(AwarenessLevel + strategyOutput, 1f); - if (Random.value < 0.3f) + if (Random.value < 0.2f) { CurrentStatus = new Status(GameLevel.GameTime, f); } @@ -170,23 +170,23 @@ namespace DeathBook.Model return !(time < ConnectionTime && time > DisconnectionTime); } - private void ShareStatus() + /*private void ShareStatus() { if (Random.value < 0.3f) { foreach (Friendship f in friendsList) f.Friend.ReceiveStatus(CurrentStatus); } - } + }*/ - public void ReceiveStatus(Status newStatus) + /*public void ReceiveStatus(Status newStatus) { Debug.Log("Oh noes, " + newStatus.Friends.Friend + " died..."); - /*foreach (Friendship f in friendsList) + foreach (Friendship f in friendsList) { if (f.Friend == newStatus.Friends) ; - }*/ - } + } + }*/ public void Update(float deltaTime) { @@ -194,7 +194,7 @@ namespace DeathBook.Model { if (CurrentStatus.EndTime < GameLevel.GameTime) { - ShareStatus(); + //ShareStatus(); CurrentStatus = null; } } diff --git a/Assets/Scripts/Models/Status.cs b/Assets/Scripts/Models/Status.cs index 4a7ce09..e01213e 100644 --- a/Assets/Scripts/Models/Status.cs +++ b/Assets/Scripts/Models/Status.cs @@ -4,8 +4,8 @@ namespace DeathBook.Model { public class Status { - /*private int startTime; - public int StartTime { get { return startTime; } }*/ + private int startTime; + public int StartTime { get { return startTime; } } private int endTime; public int EndTime { get { return endTime; } } private Friendship friends; @@ -13,8 +13,8 @@ namespace DeathBook.Model public Status(int startTime, Friendship friendship) { - /*this.startTime = startTime;*/ - this.endTime = startTime = (int) Utils.GetRandomValue(60*1.5f, 35, 3); + this.startTime = startTime; + this.endTime = startTime + (int) Utils.GetRandomValue(700, 250, 3); friends = friendship; } } diff --git a/Assets/Scripts/PersonNode.cs b/Assets/Scripts/PersonNode.cs index 64a68d9..56c4fcf 100644 --- a/Assets/Scripts/PersonNode.cs +++ b/Assets/Scripts/PersonNode.cs @@ -8,7 +8,7 @@ using System; [RequireComponent(typeof(Collider))] public class PersonNode : MonoBehaviour, IObserver { - private const float UpdateFrequency = 0.5f; + private const float UpdateFrequency = 0.4f; private float time = 0; public Action OnClicked;