mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-04-21 11:39:35 +08:00
更新任务类
This commit is contained in:
parent
6303be1abc
commit
1168f5dd7b
@ -12,20 +12,29 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
public Dictionary<string, int> Awards { get; set; } = [];
|
public Dictionary<string, int> Awards { get; set; } = [];
|
||||||
public DateTime? StartTime { get; set; } = null;
|
public DateTime? StartTime { get; set; } = null;
|
||||||
public DateTime? SettleTime { get; set; } = null;
|
public DateTime? SettleTime { get; set; } = null;
|
||||||
|
public QuestType QuestType { get; set; } = QuestType.Continuous;
|
||||||
|
public int Progress { get; set; } = 0;
|
||||||
|
public int MaxProgress { get; set; } = 100;
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
|
string progressString = "";
|
||||||
|
if (QuestType == QuestType.Progressive)
|
||||||
|
{
|
||||||
|
progressString = $"\r\n当前进度:{Progress}/{MaxProgress}";
|
||||||
|
}
|
||||||
|
|
||||||
return $"{Id}. {Name}\r\n" +
|
return $"{Id}. {Name}\r\n" +
|
||||||
$"{Description}\r\n" +
|
$"{Description}\r\n" +
|
||||||
$"需要时间:{EstimatedMinutes} 分钟\r\n" +
|
(QuestType == QuestType.Continuous ? $"需要时间:{EstimatedMinutes} 分钟\r\n" : "") +
|
||||||
(StartTime.HasValue ? $"开始时间:{StartTime.Value.ToString(General.GeneralDateTimeFormatChinese)}" +
|
(StartTime.HasValue ? $"开始时间:{StartTime.Value.ToString(General.GeneralDateTimeFormatChinese)}" +
|
||||||
(Status == QuestState.InProgress ?
|
(Status == QuestState.InProgress && QuestType == QuestType.Continuous ?
|
||||||
$"\r\n预计在 {Math.Max(Math.Round((StartTime.Value.AddMinutes(EstimatedMinutes) - DateTime.Now).TotalMinutes, MidpointRounding.ToPositiveInfinity), 1)} 分钟后完成" : "")
|
$"\r\n预计在 {Math.Max(Math.Round((StartTime.Value.AddMinutes(EstimatedMinutes) - DateTime.Now).TotalMinutes, MidpointRounding.ToPositiveInfinity), 1)} 分钟后完成" : "")
|
||||||
+ "\r\n"
|
+ "\r\n"
|
||||||
: "") +
|
: "") +
|
||||||
$"完成奖励:{string.Join(",", Awards.Select(kv=> kv.Key + " * " + kv.Value))}\r\n" +
|
$"完成奖励:{string.Join(",", Awards.Select(kv => kv.Key + " * " + kv.Value))}\r\n" +
|
||||||
$"任务状态:{GetStatus()}" +
|
$"任务状态:{GetStatus()}" + progressString +
|
||||||
(SettleTime.HasValue ? $"\r\n结算时间:{SettleTime.Value.ToString(General.GeneralDateTimeFormatChinese)}" : "");
|
(SettleTime.HasValue ? $"\r\n结算时间:{SettleTime.Value.ToString(General.GeneralDateTimeFormatChinese)}" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetStatus()
|
private string GetStatus()
|
||||||
|
@ -802,4 +802,11 @@ namespace Milimoe.FunGame.Core.Library.Constant
|
|||||||
MySQL,
|
MySQL,
|
||||||
SQLite
|
SQLite
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum QuestType
|
||||||
|
{
|
||||||
|
Continuous,
|
||||||
|
Immediate,
|
||||||
|
Progressive
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user