first commit

This commit is contained in:
2026-06-04 23:22:13 +03:00
commit d329f501be
310 changed files with 36395 additions and 0 deletions
+64
View File
@@ -0,0 +1,64 @@
using System;
using OTGIntegrated.Items;
using UnityEngine;
namespace OTGIntegrated.Quests
{
public enum QuestGoalType
{
CollectItem,
KillEnemy,
TalkToNPC,
CraftItem
}
public enum QuestStatus
{
Active,
ReadyToComplete,
Completed
}
[Serializable]
public sealed class QuestGoal
{
public QuestGoalType goalType;
public ItemData targetItem;
public string enemyId;
public string npcId;
[Min(1)] public int requiredAmount = 1;
public string GetTargetKey()
{
switch (goalType)
{
case QuestGoalType.CollectItem:
case QuestGoalType.CraftItem:
return targetItem != null ? targetItem.itemId : string.Empty;
case QuestGoalType.KillEnemy:
return enemyId;
case QuestGoalType.TalkToNPC:
return npcId;
default:
return string.Empty;
}
}
public string GetDisplayName()
{
switch (goalType)
{
case QuestGoalType.CollectItem:
return targetItem != null ? targetItem.displayName : "Предмет";
case QuestGoalType.CraftItem:
return targetItem != null ? $"Создать {targetItem.displayName}" : "Создать предмет";
case QuestGoalType.KillEnemy:
return string.IsNullOrWhiteSpace(enemyId) ? "Враг" : enemyId;
case QuestGoalType.TalkToNPC:
return string.IsNullOrWhiteSpace(npcId) ? "NPC" : npcId;
default:
return "Цель";
}
}
}
}