DEG-15 [Feat] 출근 가능 여부 추가

This commit is contained in:
Sehyeon 2025-04-18 09:30:08 +09:00
parent 15384a1e28
commit 3c5623016f
3 changed files with 13 additions and 5 deletions

View File

@ -9,6 +9,7 @@ public enum ActionType
LessSleep, // 5시간 취침
SleepWell, // 8시간 취침
ForcedSleep, // 강제 수면(10시간)
Sleep,
Eat,
Work,
Dungeon,
@ -24,7 +25,7 @@ public class GameConstants
// 기본 스탯 값
public float baseHealth = 8f;
public float baseTime = 8f;
public float baseReputation = 5f;
public float baseReputation = 2f;
// 스탯 한계 값
public float maxHealth = 10f;

View File

@ -52,6 +52,15 @@ public class PlayerStats : MonoBehaviour
ModifyReputation(effect.reputationChange);
}
// 출근 가능 여부 확인 메서드
public bool CanWork()
{
bool isTimeToWork = TimeStat is >= 8.0f and < 9.0f; // 8시에서 9시 사이만 true
bool isCanPerformWork = CanPerformByHealth(ActionType.Work); // 체력상 가능한지 확인
return isTimeToWork && isCanPerformWork;
}
// 하루 종료 처리
private void EndDay(bool isForced) //bool isForced? 해서 true면 강제 수면이라 8시에 깨는
{

View File

@ -33,10 +33,8 @@ public class ValueByAction
actionEffects = new Dictionary<ActionType, ActionEffect>
{
// 기본 액션들, 효과(시간, 체력, 평판 순)
{ ActionType.NotSleep, new ActionEffect(_gameConstants.forcedValue, 0, 0) }, // 8시 강제 기상
{ ActionType.LessSleep, new ActionEffect(+5.0f, +6.0f, 0) },
{ ActionType.SleepWell, new ActionEffect(+8.0f, +8.0f, 0) },
{ ActionType.ForcedSleep, new ActionEffect(+10.0f, +4.0f, 0) },
{ ActionType.Sleep, new ActionEffect(_gameConstants.forcedValue, 0, 0) }, // 8시 강제 기상
{ ActionType.ForcedSleep, new ActionEffect(+10.0f, +4.0f, 0) }, // 체력 0
{ ActionType.Eat, new ActionEffect(+1.0f, +1.0f, 0) },
{ ActionType.Work, new ActionEffect(+10.0f, -3.0f, +0.2f) }, // 8to6: 10시간
{ ActionType.Dungeon, new ActionEffect(+3.0f, -3.0f, 0) },