Skip to content

Commit

Permalink
some more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianKirk committed Jun 22, 2023
1 parent 3f3562c commit fa255c6
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 79 deletions.
34 changes: 17 additions & 17 deletions SDD2023-SocialSim/Assets/Scenes/MainMenu.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1716,8 +1716,8 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1502215160}
m_RootOrder: 0
m_Father: {fileID: 495834810}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -1820,7 +1820,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Back
m_text: Exit
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 25be80cecf58edd4d9074b75ddcb79c6, type: 2}
m_sharedMaterial: {fileID: 7306700722704891338, guid: 25be80cecf58edd4d9074b75ddcb79c6, type: 2}
Expand Down Expand Up @@ -2319,8 +2319,12 @@ RectTransform:
- {fileID: 193189739}
- {fileID: 447506523}
- {fileID: 68675815}
- {fileID: 418454518}
- {fileID: 1111207468}
- {fileID: 838228398}
- {fileID: 1361949739}
m_Father: {fileID: 1502215160}
m_RootOrder: 4
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
Expand Down Expand Up @@ -3010,7 +3014,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Exit
m_text: Back
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 25be80cecf58edd4d9074b75ddcb79c6, type: 2}
m_sharedMaterial: {fileID: 7306700722704891338, guid: 25be80cecf58edd4d9074b75ddcb79c6, type: 2}
Expand Down Expand Up @@ -3642,8 +3646,8 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1502215160}
m_RootOrder: 2
m_Father: {fileID: 495834810}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -4141,7 +4145,7 @@ RectTransform:
- {fileID: 615366736}
- {fileID: 2019082130}
m_Father: {fileID: 1502215160}
m_RootOrder: 5
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
Expand Down Expand Up @@ -4518,8 +4522,8 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1502215160}
m_RootOrder: 1
m_Father: {fileID: 495834810}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -5209,7 +5213,7 @@ RectTransform:
- {fileID: 1182863980}
- {fileID: 1392758887}
m_Father: {fileID: 1502215160}
m_RootOrder: 6
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
Expand Down Expand Up @@ -5449,8 +5453,8 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1502215160}
m_RootOrder: 3
m_Father: {fileID: 495834810}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -6318,10 +6322,6 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 418454518}
- {fileID: 1111207468}
- {fileID: 838228398}
- {fileID: 1361949739}
- {fileID: 495834810}
- {fileID: 974370039}
- {fileID: 1270702284}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public override void EnterState(HumanStateManager master)
{
if (master.m_inventory.m_currentWeight == master.m_inventory.m_maxWeight)
{
if (master.homeOwner && master.m_inventory.GetFoodWeight() > 50f /*&& master.houseInventory.m_currentWeight > (30 * (master.NumberOfChildren + 1))*/)
if (master.homeOwner && (master.m_inventory.GetFoodWeight() > 40f || master.houseInventory.GetFoodWeight() > 25f))
//They will try to have new children if they are able to support them
{
master.SwitchState(master.seekPartnerState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ protected override void OnNewMonth()
{
if ((m_inventory.GetFoodWeight()) < (-m_age * (m_age - 100f) * (0.006f))) //They starve if they don't have enough food
{
Debug.Log("I starved during the " + m_currentState + " state.");

WorldManager.RESULTS.deathsByCauses["Starvation"] += 1;

Die();
Expand Down Expand Up @@ -232,6 +230,8 @@ protected override void OnNewMonth()
if (Random.Range(0, 100) < 5) //5% chance to die from disease
{
WorldManager.RESULTS.deathsByCauses["Disease"] += 1;

Die();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,23 @@ public virtual void SwitchState(State<HumanStateManager> newState) {}

if (currentPath == null || currentPath.Count < 1)
{
Debug.Log("Destination is unreachable");
// Debug.Log("Destination is unreachable");
return false;
}
else
{
currentTarget = currentPath[0];
try
{
currentTarget = currentPath[0];

rBody.velocity = new Vector2(currentTarget.xPos - transform.position.x, currentTarget.yPos - transform.position.y);
rBody.velocity.Normalize();
rBody.velocity = rBody.velocity * m_speed;
rBody.velocity = new Vector2(currentTarget.xPos - transform.position.x, currentTarget.yPos - transform.position.y);
rBody.velocity.Normalize();
rBody.velocity = rBody.velocity * m_speed;
}
catch
{

}
return true;
}
}
Expand Down
Loading

0 comments on commit fa255c6

Please sign in to comment.