Conflicts:
	Assets/Scripts/Models/Status.cs
This commit is contained in:
Patrice Vignola 2015-08-16 23:42:47 -04:00
commit 46968948fb
12 changed files with 399 additions and 39 deletions

View File

@ -17,6 +17,23 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &138142
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 495284}
- 33: {fileID: 3383236}
- 23: {fileID: 2397622}
m_Layer: 0
m_Name: BloodSplatter
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!1 &147480
GameObject:
m_ObjectHideFlags: 0
@ -28,7 +45,7 @@ GameObject:
- 33: {fileID: 3395424}
- 23: {fileID: 2372840}
m_Layer: 0
m_Name: BloodSplatter
m_Name: ShoutBubble
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -98,9 +115,10 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 193868}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -.133731544, y: -.756275117, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 495284}
- {fileID: 424146}
- {fileID: 496448}
m_Father: {fileID: 0}
@ -112,11 +130,11 @@ Transform:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 147480}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -.0109999999}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: .800000012, y: .75, z: -.0500000007}
m_LocalScale: {x: .75, y: .75, z: 1}
m_Children: []
m_Father: {fileID: 410576}
m_RootOrder: 0
m_RootOrder: 1
--- !u!4 &476902
Transform:
m_ObjectHideFlags: 1
@ -129,6 +147,18 @@ Transform:
m_Children: []
m_Father: {fileID: 496448}
m_RootOrder: 0
--- !u!4 &495284
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 138142}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -.0109999999}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 410576}
m_RootOrder: 0
--- !u!4 &496448
Transform:
m_ObjectHideFlags: 1
@ -142,7 +172,7 @@ Transform:
- {fileID: 476902}
- {fileID: 498100}
m_Father: {fileID: 410576}
m_RootOrder: 1
m_RootOrder: 2
--- !u!4 &498100
Transform:
m_ObjectHideFlags: 1
@ -261,6 +291,30 @@ MeshRenderer:
m_CastShadows: 0
m_ReceiveShadows: 1
m_Materials:
- {fileID: 2100000, guid: 3480ff1ba6e1dea4da6b793db1251755, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 1
m_ReflectionProbeUsage: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_ImportantGI: 0
m_AutoUVMaxDistance: .5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!23 &2397622
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 138142}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 1
m_Materials:
- {fileID: 2100000, guid: 8c192887af84c6d489323981a0248291, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
@ -296,6 +350,13 @@ MeshFilter:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 136744}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &3383236
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 138142}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &3387390
MeshFilter:
m_ObjectHideFlags: 1
@ -368,7 +429,8 @@ MonoBehaviour:
KillHoldDuration: 2
xMarkLeft: {fileID: 11439868}
xMarkRight: {fileID: 11422410}
bloodSplatter: {fileID: 2372840}
bloodSplatter: {fileID: 2397622}
shoutBubble: {fileID: 2372840}
--- !u!114 &11422410
MonoBehaviour:
m_ObjectHideFlags: 1

View File

@ -0,0 +1,165 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 5
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: ShoutBubble
m_Shader: {fileID: 32, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: f0ae3145accc33c4f98e5ba66267789f, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Cutoff
second: .5
data:
first:
name: _Shininess
second: .257999986
data:
first:
name: _SrcBlend
second: 1
data:
first:
name: _DstBlend
second: 0
data:
first:
name: _Parallax
second: .0199999996
data:
first:
name: _ZWrite
second: 1
data:
first:
name: _Glossiness
second: .5
data:
first:
name: _BumpScale
second: 1
data:
first:
name: _OcclusionStrength
second: 1
data:
first:
name: _DetailNormalMapScale
second: 1
data:
first:
name: _UVSec
second: 0
data:
first:
name: _EmissionScaleUI
second: 0
data:
first:
name: _Mode
second: 0
data:
first:
name: _Metallic
second: 0
data:
first:
name: _Ratio
second: 0
m_Colors:
data:
first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 0}
data:
first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _SpecColor
second: {r: .5, g: .5, b: .5, a: 0}
data:
first:
name: _EmissionColorUI
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _CompletedColor
second: {r: 0, g: 0, b: 0, a: 0}
data:
first:
name: _RemainingColor
second: {r: 1, g: 1, b: 1, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3480ff1ba6e1dea4da6b793db1251755
timeCreated: 1439775713
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -0,0 +1,55 @@
fileFormatVersion: 2
guid: f0ae3145accc33c4f98e5ba66267789f
timeCreated: 1439780562
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -447,6 +447,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

View File

@ -43,7 +43,6 @@ namespace DeathBook.Model
link.Awareness += Self.Strategy.GetDeathNoticing(1f /*Friend.Popularity*/, Link.Importance, Self.FriendCount, Self.AwarenessLevel);
link.Awareness = Mathf.Min(link.Awareness + deltaTime * 0.1f, 1f);
if (link.Awareness >= 1f)
{
self.NoticeDeath(this);

View File

@ -76,7 +76,7 @@ namespace DeathBook.Model
for (int i = 0; i < totalCount; i++)
{
p1 = people[i];
missing = avgConnections - p1.FriendCount; // TODO Add randomness
missing = Mathf.Clamp((int) Utils.GetRandomValue(avgConnections, avgConnections*1.2f, 3), 1, 100) - p1.FriendCount;
if (missing <= 0)
continue;

View File

@ -1,6 +1,5 @@
using UnityEngine;
using System.Collections.Generic;
using System;
using DeathBook.Util;
namespace DeathBook.Model
@ -43,6 +42,18 @@ namespace DeathBook.Model
float change = value - awarenessLevel;
awarenessLevel = value;
LevelManager.Instance.GameLevel.AddAwareness(change);
NotifyObservers();
}
}
private static Level level;
private static Level GameLevel
{
get
{
if (level == null)
level = LevelManager.Instance.GameLevel;
return level;
}
}
@ -58,8 +69,15 @@ namespace DeathBook.Model
private Sprite picture;
public Sprite Picture { get { return picture; } }
private Action onSelected;
public Action OnSelected {get {return onSelected;} set { onSelected = value; } }
private System.Action onSelected;
public System.Action OnSelected {get {return onSelected;} set { onSelected = value; } }
private Status status = null;
public Status CurrentStatus
{
get { return status; }
set { status = value; NotifyObservers(); }
}
private GameStrategy strategy;
public GameStrategy Strategy
@ -109,15 +127,16 @@ namespace DeathBook.Model
//Debug.Log("Person " + id + " died!");
alive = false;
CurrentStatus = null;
if (LevelManager.Instance.GameLevel.tutorialInt == 4)
LevelManager.Instance.GameLevel.tutorialInt = 5;
if (GameLevel.tutorialInt == 4)
GameLevel.tutorialInt = 5;
foreach (Friendship f in friendsList)
f.Other.NotifyFriendWasKilled();
NotifyObservers();
LevelManager.Instance.GameLevel.RegisterKill(this);
GameLevel.RegisterKill(this);
if (LevelManager.Instance.GameLevel.tutorialInt == 5 && LevelManager.Instance.GameLevel.NumDead == 3)
{
@ -129,15 +148,17 @@ namespace DeathBook.Model
public void NoticeDeath(Friendship f)
{
int deathTime = LevelManager.Instance.GameLevel.GameTime;
int deathTime = GameLevel.GameTime;
int sinceLastDeath = numDeadFriends == 0 ? int.MaxValue/2 : deathTime - lastFriendDeath;
float strategyOutput = Strategy.GetAwarenessChange(numDeadFriends, numAliveFriends, sinceLastDeath);
AwarenessLevel = Mathf.Min(AwarenessLevel + strategyOutput, 1f);
NotifyObservers();
if (Random.value < 0.2f)
{
CurrentStatus = new Status(GameLevel.GameTime, f);
}
//Debug.Log("I am " + id + " and I know my friend " + f.Friend.Id + " was killed.. " + strategyOutput);
}
@ -150,12 +171,39 @@ namespace DeathBook.Model
return !(time < ConnectionTime && time > DisconnectionTime);
}
/*private void ShareStatus()
{
if (Random.value < 0.3f)
{
foreach (Friendship f in friendsList)
f.Friend.ReceiveStatus(CurrentStatus);
}
}*/
/*public void ReceiveStatus(Status newStatus)
{
Debug.Log("Oh noes, " + newStatus.Friends.Friend + " died...");
foreach (Friendship f in friendsList)
{
if (f.Friend == newStatus.Friends) ;
}
}*/
public void Update(float deltaTime)
{
if (CurrentStatus != null)
{
if (CurrentStatus.EndTime < GameLevel.GameTime)
{
//ShareStatus();
CurrentStatus = null;
}
}
if (!Alive)
return;
int time = LevelManager.Instance.GameLevel.DayTime;
int time = GameLevel.DayTime;
bool isOnline = IsOnline(time);

View File

@ -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<PersonNode> OnClicked;
@ -23,7 +23,8 @@ public class PersonNode : MonoBehaviour, IObserver
public float KillHoldDuration = 2f;
public RatioProgression xMarkLeft;
public RatioProgression xMarkRight;
public Renderer bloodSplatter;
public Renderer bloodSplatter;
public Renderer shoutBubble;
private List<Link> _links;
private bool _highlighted = false;
@ -157,6 +158,8 @@ public class PersonNode : MonoBehaviour, IObserver
//If dead -> set offline until all friends are aware, then add a big red X to profile pic
if (_model.Alive)
{
shoutBubble.gameObject.SetActive(_model.CurrentStatus != null);
SetColors();
}
else

View File

@ -7,11 +7,15 @@ using UnityEngine.UI;
public class Timer : MonoBehaviour
{
public Text TimerText;
int lastTime = -1;
void Update()
{
TimerText.text = Utils.GetTimeString(LevelManager.Instance.GameLevel.DayTime);
int time = LevelManager.Instance.GameLevel.DayTime / 30;
if (time != lastTime)
{
TimerText.text = Utils.GetTimeString(time * 30);
lastTime = time;
}
}
}

View File

@ -13,7 +13,7 @@ public class loadLevel : MonoBehaviour
void NextScene()
{
Application.LoadLevel("Gameplay");
Application.LoadLevel("Tutoriel");
}
}