2026-04-02 타임라인 (진행중)
This commit is contained in:
@@ -15,21 +15,15 @@ public void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
||||
|
||||
public void ItemUse(ItemInstance item)
|
||||
{
|
||||
Debug.Log("아이템 사용");
|
||||
|
||||
switch(item.Data.ItemEffectType)
|
||||
{
|
||||
case ItemEffectType.RECOVERY_HP:
|
||||
{
|
||||
Debug.Log($"전 HP : {GameManager.Instance.Level.CurrentCharacter.GetComponent<Health>().CurrentHP}");
|
||||
RecoveryHPHealthEffect(GameManager.Instance.Level.CurrentCharacter.GetComponent<Health>(), item.Data.RecoveryHP, item.Data.ItemEffectVisual);
|
||||
Debug.Log($"후 HP : {GameManager.Instance.Level.CurrentCharacter.GetComponent<Health>().CurrentHP}");
|
||||
}
|
||||
break;
|
||||
case ItemEffectType.INTERVAL_DAMAGE:
|
||||
{
|
||||
Debug.Log("틱데미지 아이템 타입임");
|
||||
|
||||
IntervalDamageHealthEffect(GameManager.Instance.Level.CurrentCharacter.GetComponent<Health>(), item.Data.IntervalDamage, item.Data.IntervalDamageTime, item.Data.ItemEffectVisual);
|
||||
}
|
||||
break;
|
||||
@@ -65,20 +59,13 @@ public async void IntervalDamage(Health health, float damage,float time, GameObj
|
||||
|
||||
float tickDamage = damage / time;
|
||||
|
||||
Debug.Log($"damage: {damage}");
|
||||
Debug.Log($"time: {time}");
|
||||
Debug.Log($"tickDamage: {tickDamage}");
|
||||
Debug.Log($"CurrentHP : {health.CurrentHP}");
|
||||
|
||||
try
|
||||
{
|
||||
while (time > 0)
|
||||
{
|
||||
Debug.Log($"진입");
|
||||
health.ChangeHP(health.CurrentHP - Mathf.FloorToInt(tickDamage)); //소수점 전부 버림
|
||||
if (health.CurrentHP <= 0) break;
|
||||
time--;
|
||||
Debug.Log($"중독 HP : {GameManager.Instance.Level.CurrentCharacter.GetComponent<Health>().CurrentHP}");
|
||||
await Task.Delay(1000, token);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user