Skip to content

Commit

Permalink
Session EE test
Browse files Browse the repository at this point in the history
  • Loading branch information
interaktivarum committed Mar 14, 2017
1 parent a2577ac commit d7bd8ac
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
Binary file added Screenshots/avatarstats.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Screenshots/eetest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion Tribe2020/Assets/Data/Avatar Activities/HelpDeskWork.asset
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ MonoBehaviour:
currentRoom: 0
setActivityAppliance: 1
useActivityAppliance: 1
testEnergyEffeciency: 0
setAvatarMood: 0
mood: 0
- title: Sit at station
Expand All @@ -34,6 +35,7 @@ MonoBehaviour:
currentRoom: 0
setActivityAppliance: 0
useActivityAppliance: 1
testEnergyEffeciency: 0
setAvatarMood: 0
mood: 0
- title: Become available
Expand All @@ -46,6 +48,7 @@ MonoBehaviour:
currentRoom: 0
setActivityAppliance: 0
useActivityAppliance: 1
testEnergyEffeciency: 0
setAvatarMood: 0
mood: 0
- title: Start help desk station
Expand All @@ -58,6 +61,7 @@ MonoBehaviour:
currentRoom: 0
setActivityAppliance: 0
useActivityAppliance: 0
testEnergyEffeciency: 0
setAvatarMood: 0
mood: 0
- title: Do work
Expand All @@ -69,9 +73,10 @@ MonoBehaviour:
currentRoom: 0
setActivityAppliance: 0
useActivityAppliance: 1
testEnergyEffeciency: 0
setAvatarMood: 2
mood: 6
- title: Start help desk station
- title: Turn off help desk station
type: 8
appliance: {fileID: 0}
requiredAffordance: {fileID: 11400000, guid: 746f09dfe276fdb4eb9ca243a0f50469,
Expand All @@ -81,6 +86,7 @@ MonoBehaviour:
currentRoom: 0
setActivityAppliance: 0
useActivityAppliance: 0
testEnergyEffeciency: 1
setAvatarMood: 0
mood: 0
- title: Become unavailable
Expand All @@ -93,6 +99,7 @@ MonoBehaviour:
currentRoom: 0
setActivityAppliance: 0
useActivityAppliance: 1
testEnergyEffeciency: 0
setAvatarMood: 0
mood: 0
_currSession: 0
Expand Down
10 changes: 5 additions & 5 deletions Tribe2020/Assets/Scripts/Avatar/AvatarActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public class Session {
public bool setActivityAppliance;
public bool useActivityAppliance = true;

public bool testEnergyEffeciency;

public enum SetMoodOptions { No, Try, Force }
public SetMoodOptions setAvatarMood;
public AvatarMood.Mood mood;
Expand Down Expand Up @@ -188,11 +190,9 @@ public void Start() {
public void StartSession(Session session) {
DebugManager.Log(_ai.name + " started session " + session.title + " of type " + session.type + ". Part of activity " + this.name, this);

//Add temporary avatar affordances
//Shouldn't it be possible to also have temporary affordances for non temporary activities? For example being available for discussion when chilling in the sofa? //Gunnar
/*if (!isTemporary) {
_ai.GetComponent<Appliance>().SetTemporaryAvatarAffordances(session.tempAvatarAffordances);
}*/
if(session.testEnergyEffeciency && !_ai.GetComponent<AvatarStats>().TestEnergyEfficiency()) {
return;
}

//Set mood
switch (session.setAvatarMood) {
Expand Down
4 changes: 3 additions & 1 deletion Tribe2020/Assets/Scripts/Avatar/AvatarStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public float GetEnergyEfficiency()
}

public bool RunEnergyEfficiencyTest() {
return GetEnergyEfficiency() >= Random.value;
float val = GetEnergyEfficiency();
float r = Random.value;
return val >= r;
}

//TestEnergyEfficiency()
Expand Down
8 changes: 4 additions & 4 deletions Tribe2020/Assets/scenes/Martin/San Pablo Martin.unity
Original file line number Diff line number Diff line change
Expand Up @@ -43905,7 +43905,7 @@ Prefab:
- target: {fileID: 114000012038547090, guid: 346cda8097346714eaa6165fdbde0362,
type: 2}
propertyPath: schedule.Array.data[1].time
value: 7:30
value: 7:10
objectReference: {fileID: 0}
- target: {fileID: 114000012038547090, guid: 346cda8097346714eaa6165fdbde0362,
type: 2}
Expand All @@ -43916,7 +43916,7 @@ Prefab:
- target: {fileID: 114000012038547090, guid: 346cda8097346714eaa6165fdbde0362,
type: 2}
propertyPath: schedule.Array.data[2].time
value: 8:00
value: 7:20
objectReference: {fileID: 0}
- target: {fileID: 114000012038547090, guid: 346cda8097346714eaa6165fdbde0362,
type: 2}
Expand Down Expand Up @@ -44041,12 +44041,12 @@ Prefab:
- target: {fileID: 114000013719618876, guid: 346cda8097346714eaa6165fdbde0362,
type: 2}
propertyPath: _knowledge
value: 0.437
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114000013719618876, guid: 346cda8097346714eaa6165fdbde0362,
type: 2}
propertyPath: _attitude
value: 0.304
value: 0
objectReference: {fileID: 0}
- target: {fileID: 114000013719618876, guid: 346cda8097346714eaa6165fdbde0362,
type: 2}
Expand Down

0 comments on commit d7bd8ac

Please sign in to comment.