add areaname
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
public class Stat
|
||||
using Assets.Scripts.Interfaces;
|
||||
|
||||
public class NumericStat : INumericStat
|
||||
{
|
||||
public string Name { get; private set; }
|
||||
public float Value { get; private set; }
|
||||
@@ -6,14 +8,14 @@ public class Stat
|
||||
public float Quantity { get; private set; }
|
||||
public float MaxValue { get; private set; }
|
||||
|
||||
public Stat(string name, float startValue, float maxValue)
|
||||
public NumericStat(string name, float startValue, float maxValue)
|
||||
{
|
||||
Name = name;
|
||||
Value = startValue;
|
||||
MaxValue = maxValue;
|
||||
MaxValue = maxValue;
|
||||
}
|
||||
|
||||
public Stat(string name, float price, float quantity, float maxValue)
|
||||
public NumericStat(string name, float price, float quantity, float maxValue)
|
||||
{
|
||||
Name = name;
|
||||
Price = price;
|
||||
@@ -1,6 +1,6 @@
|
||||
using Assets.Scripts.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class Player : MonoBehaviour
|
||||
private PlayerStates _currentActing;
|
||||
private AnimationStates _currentAnimation;
|
||||
|
||||
public Dictionary<StatsId, Stat> Stats;
|
||||
public Dictionary<StatsId, object> Stats;
|
||||
public JobPositions JobPosition { get; set; }
|
||||
|
||||
public EducationSkill Education { get; set; }
|
||||
@@ -33,6 +33,7 @@ public class Player : MonoBehaviour
|
||||
|
||||
private ContainerItem _containerItem;
|
||||
private Action _OnAnimationFinish;
|
||||
private string _locationName;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -213,27 +214,27 @@ public class Player : MonoBehaviour
|
||||
switch (_currentActing)
|
||||
{
|
||||
case PlayerStates.Eating:
|
||||
Stats[StatsId.Food].increase(10f);
|
||||
(Stats[StatsId.Food] as INumericStat).increase(10f);
|
||||
break;
|
||||
case PlayerStates.Sleeping:
|
||||
Stats[StatsId.Energy].increase(0.2f);
|
||||
Stats[StatsId.Food].deduct(0.03f);
|
||||
(Stats[StatsId.Energy] as INumericStat).increase(0.2f);
|
||||
(Stats[StatsId.Food] as INumericStat).deduct(0.03f);
|
||||
break;
|
||||
default:
|
||||
Stats[StatsId.Food].deduct(0.05f); // 48 hours it's 100, 100/2880=~0.034 per minute
|
||||
Stats[StatsId.Energy].deduct(0.1f); // 24 hours it's 100, 100/1440=~0.096 per minute
|
||||
(Stats[StatsId.Food] as INumericStat).deduct(0.05f); // 48 hours it's 100, 100/2880=~0.034 per minute
|
||||
(Stats[StatsId.Energy] as INumericStat).deduct(0.1f); // 24 hours it's 100, 100/1440=~0.096 per minute
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void Pay(float amount)
|
||||
{
|
||||
Stats[StatsId.Money].deduct(amount);
|
||||
(Stats[StatsId.Money] as INumericStat).deduct(amount);
|
||||
}
|
||||
|
||||
public void AddMoney(float amount)
|
||||
{
|
||||
Stats[StatsId.Money].increase(amount);
|
||||
(Stats[StatsId.Money] as INumericStat).increase(amount);
|
||||
}
|
||||
|
||||
public void SetContainerItem(ContainerItem containerItem)
|
||||
@@ -255,4 +256,13 @@ public class Player : MonoBehaviour
|
||||
{
|
||||
return _containerItem != null;
|
||||
}
|
||||
|
||||
public void SetLocationName(string locationName)
|
||||
{
|
||||
_locationName = locationName;
|
||||
}
|
||||
public string GetLocationName()
|
||||
{
|
||||
return _locationName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,18 +3,20 @@ using System.Collections.Generic;
|
||||
|
||||
public class PlayerStats
|
||||
{
|
||||
public static Dictionary<StatsId, Stat> CreateInitialStats()
|
||||
public static Dictionary<StatsId, object> CreateInitialStats()
|
||||
{
|
||||
return new Dictionary<StatsId, Stat>()
|
||||
return new Dictionary<StatsId, object>()
|
||||
{
|
||||
{StatsId.Money, new Stat("Money", 100.0f,10000000f)},
|
||||
{StatsId.RentAccount, new Stat("Rent Account", 0,10f)},
|
||||
{StatsId.Food, new Stat("Food Energy", 50f,100f) },
|
||||
{StatsId.Energy,new Stat("Energy", 50f,100f) },
|
||||
{StatsId.Money, new NumericStat("Money", 100.0f,10000000f)},
|
||||
{StatsId.RentAccount, new NumericStat("Rent Account", 0,10f)},
|
||||
{StatsId.Food, new NumericStat("Food Energy", 50f,100f) },
|
||||
{StatsId.Energy,new NumericStat("Energy", 50f,100f) },
|
||||
{StatsId.LocationName,new StringStat("Location","Nowhere") },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//// Knowledge for University Jobs
|
||||
//public Stat literatureKnowledge = new Stat("LiteratureKnowledge", 0);
|
||||
//public Stat mathematicsKnowledge = new Stat("MathematicsKnowledge", 0);
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using Assets.Scripts.Interfaces;
|
||||
|
||||
public class StringStat : IStringStat
|
||||
{
|
||||
public string Name { get; private set; }
|
||||
public string Value { get; private set; }
|
||||
|
||||
public StringStat(string name, string startValue)
|
||||
{
|
||||
Name = name;
|
||||
Value = startValue;
|
||||
}
|
||||
|
||||
public void SetValue(string value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c57f2033235f86b4585b18775c652653
|
||||
Reference in New Issue
Block a user