first commit
This commit is contained in:
@@ -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 "Цель";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user